html-standard 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/accessibility/aria-roles.ts","../src/shared/default-options.ts","../src/attribute/attributes-state.ts","../src/element/element-state.ts","../src/accessibility/implicit-role.ts","../src/shared/result.ts","../src/attribute/validators/boolean-attribute.ts","../src/attribute/validators/error-messages.ts","../src/attribute/validators/enumerated-attribute.ts","../src/attribute/validators/signed-integer.ts","../src/shared/regex.ts","../src/attribute/validators/space-separated-tokens.ts","../src/attribute/validators/text.ts","../src/attribute/validators/valid-url.ts","../src/attribute/validators/non-negative-integer.ts","../src/attribute/validators/id.ts","../src/attribute/validators/floating-point-number.ts","../src/attribute/validators/comma-separated-tokens.ts","../src/attribute/validators/css-color.ts","../src/attribute/validators/bcp-47.ts","../src/attribute/validators/mime-type.ts","../src/attribute/validators/date-string.ts","../src/attribute/validators/regular-expression.ts","../src/attribute/validators/hash-name-reference.ts","../src/attribute/validators/navigable-target-name.ts","../src/attribute/validators/srcset-attribute.ts","../src/attribute/validators/media-query-list.ts","../src/attribute/validators/source-size-list.ts","../src/attribute/validators/floating-point-number-list.ts","../src/attribute/validators/or-validator.ts","../src/attribute/validators/autocomplete-attribute.ts","../src/attribute/create-attribute-spec.ts","../src/attribute/attribute-spec.ts","../src/attribute/global-attributes.ts","../src/element/element-definitions.ts","../src/attribute/attribute-spec-map.ts","../src/element/element-spec.ts","../src/element/element.ts"],"sourcesContent":["export { element } from \"./element/element.js\";\n","// ARIA roles used in implicit role mapping\nexport const ARIA_ROLES = {\n ARTICLE: \"article\",\n BLOCKQUOTE: \"blockquote\",\n BUTTON: \"button\",\n CAPTION: \"caption\",\n CELL: \"cell\",\n CHECKBOX: \"checkbox\",\n CODE: \"code\",\n COMBOBOX: \"combobox\",\n COMPLEMENTARY: \"complementary\",\n CONTENTINFO: \"contentinfo\",\n DELETION: \"deletion\",\n DIALOG: \"dialog\",\n DOCUMENT: \"document\",\n EMPHASIS: \"emphasis\",\n FIGURE: \"figure\",\n FORM: \"form\",\n GENERIC: \"generic\",\n GROUP: \"group\",\n HEADING: \"heading\",\n IMG: \"img\",\n INSERTION: \"insertion\",\n LINK: \"link\",\n LIST: \"list\",\n LISTBOX: \"listbox\",\n MAIN: \"main\",\n METER: \"meter\",\n NAVIGATION: \"navigation\",\n OPTION: \"option\",\n PARAGRAPH: \"paragraph\",\n PROGRESSBAR: \"progressbar\",\n RADIO: \"radio\",\n ROW: \"row\",\n ROWGROUP: \"rowgroup\",\n SEARCH: \"search\",\n SEARCHBOX: \"searchbox\",\n SEPARATOR: \"separator\",\n SLIDER: \"slider\",\n SPINBUTTON: \"spinbutton\",\n STATUS: \"status\",\n STRONG: \"strong\",\n TABLE: \"table\",\n TERM: \"term\",\n TEXTBOX: \"textbox\",\n TIME: \"time\",\n} as const;\n","import type { AttributesOptions, ElementOptions } from \"../types/index.js\";\n\nexport const DEFAULT_ATTRIBUTES_OPTIONS: AttributesOptions = {\n get(_: string) {\n return null;\n },\n};\n\nexport const DEFAULT_ELEMENT_OPTIONS: ElementOptions = {\n attributes: {\n get(_: string) {\n return null;\n },\n },\n};\n","import { DEFAULT_ATTRIBUTES_OPTIONS } from \"../shared/default-options.js\";\nimport type { AttributesOptions, AttributeValue } from \"../types/index.js\";\n\nexport class AttributesState {\n constructor(\n private options: AttributesOptions = DEFAULT_ATTRIBUTES_OPTIONS,\n ) {}\n\n get(key: string): AttributeValue | null {\n return this.options.get(key);\n }\n\n has(key: string): boolean {\n return this.options.get(key) !== null;\n }\n}\n","import type { ElementOptions } from \"../types/index.js\";\nimport { AttributesState } from \"../attribute/attributes-state.js\";\n\nexport class ElementState {\n public readonly name: string;\n\n constructor(\n name: string,\n private options: ElementOptions,\n ) {\n this.name = name.toLowerCase();\n }\n\n get attributes(): AttributesState {\n return new AttributesState(this.options.attributes);\n }\n\n parent(): ElementState | null {\n if (!this.options.ancestors) {\n return null;\n }\n\n const iterator = this.options.ancestors()[Symbol.iterator]();\n const first = iterator.next();\n\n if (first.done || !first.value) {\n return null;\n }\n\n return new ElementState(first.value.name, first.value);\n }\n\n ancestors(): Iterable<\n {\n name: string;\n } & ElementOptions\n > {\n return this.options.ancestors?.() || [];\n }\n}\n","import { ARIA_ROLES } from \"./aria-roles.js\";\nimport { ElementState } from \"../element/element-state.js\";\n\n/**\n * https://www.w3.org/TR/html-aria/\n */\nexport const IMPLICIT_ROLE: Record<\n string,\n (element: ElementState) => string | null\n> = {\n a: (element) =>\n element.attributes.has(\"href\") ? ARIA_ROLES.LINK : ARIA_ROLES.GENERIC,\n abbr: () => null,\n address: () => ARIA_ROLES.GROUP,\n area: (element) =>\n element.attributes.has(\"href\") ? ARIA_ROLES.LINK : ARIA_ROLES.GENERIC,\n article: () => ARIA_ROLES.ARTICLE,\n aside: () => ARIA_ROLES.COMPLEMENTARY,\n audio: () => null,\n b: () => ARIA_ROLES.GENERIC,\n base: () => null,\n bdi: () => ARIA_ROLES.GENERIC,\n bdo: () => ARIA_ROLES.GENERIC,\n blockquote: () => ARIA_ROLES.BLOCKQUOTE,\n body: () => ARIA_ROLES.GENERIC,\n br: () => null,\n button: () => ARIA_ROLES.BUTTON,\n canvas: () => null,\n caption: () => ARIA_ROLES.CAPTION,\n cite: () => null,\n code: () => ARIA_ROLES.CODE,\n col: () => null,\n colgroup: () => null,\n data: () => ARIA_ROLES.GENERIC,\n datalist: () => ARIA_ROLES.LISTBOX,\n dd: () => null,\n del: () => ARIA_ROLES.DELETION,\n details: () => ARIA_ROLES.GROUP,\n dfn: () => ARIA_ROLES.TERM,\n dialog: () => ARIA_ROLES.DIALOG,\n div: () => ARIA_ROLES.GENERIC,\n dl: () => null,\n dt: () => null,\n em: () => ARIA_ROLES.EMPHASIS,\n embed: () => null,\n fieldset: () => ARIA_ROLES.GROUP,\n figcaption: () => null,\n figure: () => ARIA_ROLES.FIGURE,\n footer: (element) => {\n const sectioningElements = [\"article\", \"aside\", \"main\", \"nav\", \"section\"];\n for (const ancestor of element.ancestors()) {\n if (sectioningElements.includes(ancestor.name.toLowerCase())) {\n return ARIA_ROLES.GENERIC;\n }\n }\n return ARIA_ROLES.CONTENTINFO;\n },\n form: () => ARIA_ROLES.FORM,\n h1: () => ARIA_ROLES.HEADING,\n h2: () => ARIA_ROLES.HEADING,\n h3: () => ARIA_ROLES.HEADING,\n h4: () => ARIA_ROLES.HEADING,\n h5: () => ARIA_ROLES.HEADING,\n h6: () => ARIA_ROLES.HEADING,\n head: () => null,\n header: () => null, // TODO: banner if not descendant of article/aside/main/nav/section, otherwise generic\n hgroup: () => ARIA_ROLES.GROUP,\n hr: () => ARIA_ROLES.SEPARATOR,\n html: () => ARIA_ROLES.DOCUMENT,\n i: () => ARIA_ROLES.GENERIC,\n iframe: () => null,\n img: (element) => {\n const alt = element.attributes.get(\"alt\");\n if (alt === \"\") return null;\n return ARIA_ROLES.IMG;\n },\n input: (element) => {\n const type = element.attributes.get(\"type\") || \"text\";\n switch (type) {\n case \"button\":\n case \"image\":\n case \"reset\":\n case \"submit\":\n return ARIA_ROLES.BUTTON;\n case \"checkbox\":\n return ARIA_ROLES.CHECKBOX;\n case \"color\":\n case \"date\":\n case \"datetime-local\":\n case \"file\":\n case \"hidden\":\n case \"month\":\n case \"password\":\n case \"time\":\n case \"week\":\n return null;\n case \"email\":\n case \"tel\":\n case \"text\":\n case \"url\":\n return ARIA_ROLES.TEXTBOX;\n case \"number\":\n return ARIA_ROLES.SPINBUTTON;\n case \"radio\":\n return ARIA_ROLES.RADIO;\n case \"range\":\n return ARIA_ROLES.SLIDER;\n case \"search\":\n return ARIA_ROLES.SEARCHBOX;\n default:\n return ARIA_ROLES.TEXTBOX;\n }\n },\n ins: () => ARIA_ROLES.INSERTION,\n kbd: () => null,\n label: () => null,\n legend: () => null,\n li: () => null, // TODO: listitem if child of ol/ul/menu, otherwise generic\n link: () => null,\n main: () => ARIA_ROLES.MAIN,\n map: () => null,\n mark: () => null,\n menu: () => ARIA_ROLES.LIST,\n meta: () => null,\n meter: () => ARIA_ROLES.METER,\n nav: () => ARIA_ROLES.NAVIGATION,\n noscript: () => null,\n object: () => null,\n ol: () => ARIA_ROLES.LIST,\n optgroup: () => ARIA_ROLES.GROUP,\n option: () => ARIA_ROLES.OPTION,\n output: () => ARIA_ROLES.STATUS,\n p: () => ARIA_ROLES.PARAGRAPH,\n param: () => null,\n picture: () => null,\n pre: () => ARIA_ROLES.GENERIC,\n progress: () => ARIA_ROLES.PROGRESSBAR,\n q: () => ARIA_ROLES.GENERIC,\n rp: () => null,\n rt: () => null,\n ruby: () => null,\n s: () => ARIA_ROLES.DELETION,\n samp: () => ARIA_ROLES.GENERIC,\n script: () => null,\n search: () => ARIA_ROLES.SEARCH,\n section: () => null,\n select: (element) =>\n element.attributes.has(\"multiple\")\n ? ARIA_ROLES.LISTBOX\n : ARIA_ROLES.COMBOBOX,\n slot: () => null,\n small: () => ARIA_ROLES.GENERIC,\n span: () => ARIA_ROLES.GENERIC,\n strong: () => ARIA_ROLES.STRONG,\n style: () => null,\n sub: () => null,\n summary: () => ARIA_ROLES.BUTTON,\n sup: () => null,\n svg: () => null,\n table: () => ARIA_ROLES.TABLE,\n tbody: () => ARIA_ROLES.ROWGROUP,\n td: () => ARIA_ROLES.CELL,\n template: () => null,\n textarea: () => ARIA_ROLES.TEXTBOX,\n tfoot: () => ARIA_ROLES.ROWGROUP,\n th: () => null,\n thead: () => ARIA_ROLES.ROWGROUP,\n time: () => ARIA_ROLES.TIME,\n title: () => null,\n tr: () => ARIA_ROLES.ROW,\n track: () => null,\n u: () => null,\n ul: () => ARIA_ROLES.LIST,\n var: () => null,\n video: () => null,\n wbr: () => null,\n};\n","import type { AttributeSpecValidateResult } from \"../types/index.js\";\n\nconst VALID: AttributeSpecValidateResult = {\n valid: true,\n};\n\nexport function valid(): AttributeSpecValidateResult {\n return VALID;\n}\n\nexport function invalid(reason: string): AttributeSpecValidateResult {\n return {\n valid: false,\n reason,\n };\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\n\nexport type BooleanAttributeOptions = {\n attributeKey: string;\n};\n\n/**\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attribute\n */\nexport class BooleanAttribute implements AttributeSpec {\n static type = \"BooleanAttribute\" as const;\n constructor(private attributeKey: string) {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (!value) {\n return valid();\n }\n\n if (this.attributeKey === value?.toLowerCase()) {\n return valid();\n }\n\n return invalid(\n `Boolean attribute value must be empty or match the attribute name \"${this.attributeKey}\", got: \"${value}\"`,\n );\n }\n}\n","/**\n * Common error messages used across attribute validators\n */\nexport const ERROR_MESSAGES = {\n VALUE_MUST_BE_STRING: \"Value must be a string\",\n VALUE_CANNOT_BE_EMPTY: \"Value cannot be empty\",\n INVALID_MEDIA_QUERY_LIST: \"Invalid media query list\",\n} as const;\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport type EnumeratedAttributeOptions = {\n keywords: string[];\n};\n\n/**\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute\n */\nexport class EnumeratedAttribute implements AttributeSpec {\n static type = \"EnumeratedAttribute\" as const;\n constructor(private options: EnumeratedAttributeOptions) {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n const normalizedValue = value.toLowerCase();\n const isValid = this.options.keywords.includes(normalizedValue);\n\n if (!isValid) {\n return invalid(\n `Value \"${value}\" is not a valid keyword. Expected one of: ${this.options.keywords.join(\", \")}`,\n );\n }\n\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * A string is a valid integer if it consists of one or more ASCII digits,\n * optionally prefixed with a U+002D HYPHEN-MINUS character (-).\n *\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#signed-integers\n */\nexport class SignedInteger implements AttributeSpec {\n static type = \"SignedInteger\" as const;\n\n // Matches: optional hyphen-minus, followed by one or more digits\n private static readonly PATTERN = /^-?\\d+$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (!SignedInteger.PATTERN.test(value)) {\n return invalid(`Invalid signed integer: \"${value}\"`);\n }\n\n return valid();\n }\n}\n","/**\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n */\nexport const REGEX_ASCII_WHITESPACE = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/;\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { REGEX_ASCII_WHITESPACE } from \"../../shared/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport type SpaceSeparatedTokensOptions = {\n unique: boolean;\n allowed?: string[];\n validateToken?: (value: string) => boolean;\n};\n\n/**\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#space-separated-tokens\n */\nexport class SpaceSeparatedTokens implements AttributeSpec {\n static type = \"SpaceSeparatedTokens\" as const;\n constructor(private options: SpaceSeparatedTokensOptions) {}\n\n private parse(value: string) {\n const tokens = value.split(REGEX_ASCII_WHITESPACE);\n return tokens;\n }\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n const tokens = this.parse(value).filter((token) => token !== \"\");\n\n // Check uniqueness\n if (this.options.unique) {\n const uniqueTokens = new Set(tokens);\n\n if (tokens.length !== uniqueTokens.size) {\n return invalid(\"Tokens must be unique\");\n }\n }\n\n // Check allowed tokens\n if (this.options.allowed) {\n for (const token of tokens) {\n const isAllowed = this.options.allowed.some((allowedToken) => {\n return token.toLowerCase() === allowedToken.toLowerCase();\n });\n\n if (!isAllowed) {\n return invalid(\n `Invalid token: \"${token}\". Allowed tokens: ${this.options.allowed.join(\", \")}`,\n );\n }\n }\n }\n // Custom token validation\n if (typeof this.options.validateToken === \"function\") {\n for (const token of tokens) {\n if (!this.options.validateToken(token)) {\n return invalid(`Invalid token: \"${token}\"`);\n }\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid } from \"../../shared/result.js\";\n\nexport class Text implements AttributeSpec {\n static type = \"Text\" as const;\n\n validateValue(_: AttributeValue): AttributeSpecValidateResult {\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\n\nexport type ValidURLOptions = {\n /**\n * If true, empty strings are not allowed.\n * If false, empty strings are valid (treated as relative URLs).\n */\n nonEmpty?: boolean;\n /**\n * If true, leading and trailing ASCII whitespace characters are allowed and will be stripped.\n * If false, URLs with surrounding spaces are invalid.\n */\n potentiallySurroundedBySpaces?: boolean;\n};\n\n/**\n * Validates URLs according to HTML Standard.\n * A valid URL is a string that can be parsed as a URL.\n *\n * @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#valid-url-string\n */\nexport class ValidURL implements AttributeSpec {\n static type = \"ValidURL\" as const;\n\n static PotentiallySurroundedBySpaces = {\n type: ValidURL.type,\n options: {\n nonEmpty: false,\n potentiallySurroundedBySpaces: true,\n },\n };\n\n static NonEmptyPotentiallySurroundedBySpaces = {\n type: ValidURL.type,\n options: {\n nonEmpty: true,\n potentiallySurroundedBySpaces: true,\n },\n };\n\n constructor(private options: ValidURLOptions = {}) {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (typeof value !== \"string\") {\n return invalid(\"Value must be a string\");\n }\n\n let processedValue = value;\n\n if (this.options.potentiallySurroundedBySpaces) {\n processedValue = this.stripASCIIWhitespace(value);\n }\n\n if (this.options.nonEmpty && processedValue === \"\") {\n return invalid(\"Value cannot be empty\");\n }\n\n if (processedValue === \"\") {\n return valid();\n }\n\n if (this.hasInvalidURLCharacters(processedValue)) {\n return invalid(\"URL contains invalid characters\");\n }\n\n try {\n new URL(processedValue);\n return valid(); // absolute url\n } catch {\n try {\n new URL(processedValue, \"https://www.base.com\");\n\n return valid();\n } catch {\n return invalid(\"Invalid URL format\");\n }\n }\n }\n\n /**\n * Strips leading and trailing ASCII whitespace characters.\n * ASCII whitespace: space (0x20), tab (0x09), LF (0x0A), FF (0x0C), CR (0x0D)\n *\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n */\n private stripASCIIWhitespace(value: string): string {\n return value.replace(\n /^[\\x20\\x09\\x0A\\x0C\\x0D]+|[\\x20\\x09\\x0A\\x0C\\x0D]+$/g,\n \"\",\n );\n }\n\n /**\n * Checks for characters that are explicitly invalid in URLs\n * based on the URL Standard.\n * Control characters (0x00-0x1F), space (0x20), and DEL (0x7F) are invalid.\n */\n private hasInvalidURLCharacters(value: string): boolean {\n for (let i = 0; i < value.length; i++) {\n const code = value.charCodeAt(i);\n // Control characters (0x00-0x1F), space (0x20), and DEL (0x7F)\n if (code <= 0x20 || code === 0x7f) {\n return true;\n }\n }\n return false;\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport type NonNegativeIntegerOptions = {\n min?: number;\n max?: number;\n};\n\n/**\n * A string is a valid non-negative integer if it consists of one or more ASCII digits.\n *\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#non-negative-integers\n */\nexport class NonNegativeInteger implements AttributeSpec {\n static type = \"NonNegativeInteger\" as const;\n\n constructor(private options?: NonNegativeIntegerOptions) {}\n\n // Matches: one or more digits (no hyphen-minus allowed)\n private static readonly PATTERN = /^\\d+$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (!NonNegativeInteger.PATTERN.test(value)) {\n return invalid(`Invalid non-negative integer: \"${value}\"`);\n }\n\n const numValue = parseInt(value, 10);\n\n if (this.options?.min !== undefined) {\n if (numValue < this.options.min) {\n return invalid(\n `Value must be at least ${this.options.min}: \"${value}\"`,\n );\n }\n }\n\n if (this.options?.max !== undefined) {\n if (numValue > this.options.max) {\n return invalid(`Value must be at most ${this.options.max}: \"${value}\"`);\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport class ID implements AttributeSpec {\n static type = \"ID\" as const;\n constructor() {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * A string is a valid floating-point number if it consists of:\n *\n * - Optionally, a U+002D HYPHEN-MINUS character (-).\n * - One or both of the following, in the given order:\n * - A series of one or more ASCII digits.\n * - Both of the following, in the given order:\n * - A single U+002E FULL STOP character (.).\n * - A series of one or more ASCII digits.\n * - Optionally:\n * - Either a U+0065 LATIN SMALL LETTER E character (e) or a U+0045 LATIN CAPITAL LETTER E character (E).\n * - Optionally, a U+002D HYPHEN-MINUS character (-) or U+002B PLUS SIGN character (+).\n * - A series of one or more ASCII digits.\n *\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#floating-point-numbers\n */\nexport class FloatingPointNumber implements AttributeSpec {\n static type = \"FloatingPointNumber\" as const;\n\n // Matches valid floating-point numbers according to HTML spec\n // Pattern breakdown:\n // -? : optional minus sign\n // (?: : non-capturing group for the number part\n // \\d+ : one or more digits\n // (?:\\.\\d+)? : optionally followed by decimal point and digits\n // | : OR\n // \\.\\d+ : decimal point followed by one or more digits\n // )\n // (?:[eE][+-]?\\d+)? : optional exponent part\n private static readonly PATTERN =\n /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (!FloatingPointNumber.PATTERN.test(value)) {\n return invalid(`Invalid floating-point number: \"${value}\"`);\n }\n\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * A set of comma-separated tokens is a string containing zero or more tokens each separated from the next by a single U+002C COMMA character (,), where tokens consist of any string of zero or more characters, neither beginning nor ending with ASCII whitespace, nor containing any U+002C COMMA characters (,), and optionally surrounded by ASCII whitespace.\n *\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#comma-separated-tokens\n */\nexport class CommaSeparatedTokens implements AttributeSpec {\n static type = \"CommaSeparatedTokens\" as const;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // According to the spec:\n // - Tokens can be zero or more characters\n // - Tokens are separated by commas\n // - Tokens can be optionally surrounded by ASCII whitespace\n // - Tokens themselves should not begin or end with ASCII whitespace\n // - Tokens should not contain commas\n\n // The spec is describing the format, not validation rules.\n // Any comma-separated string is valid as the parsing handles whitespace trimming.\n\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport class CSSColor implements AttributeSpec {\n static type = \"CSSColor\" as const;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * BCP 47 language tag validator\n *\n * A valid BCP 47 language tag follows the ABNF grammar from RFC 5646:\n * - Language subtag (2-3 or 5-8 letters)\n * - Optional extended language subtags (3 letters, up to 3)\n * - Optional script subtag (4 letters)\n * - Optional region subtag (2 letters or 3 digits)\n * - Optional variant subtags (5-8 alphanumeric or 4 characters starting with digit)\n * - Optional extension subtags (singleton + 2-8 alphanumeric)\n * - Optional private use subtags (x- + 1-8 alphanumeric)\n *\n * Examples: en, en-US, zh-Hans-CN, en-GB-oxendict, x-private\n *\n * @see https://datatracker.ietf.org/doc/html/rfc5646\n * @see https://html.spec.whatwg.org/multipage/dom.html#attr-lang\n */\nexport class BCP47 implements AttributeSpec {\n static type = \"BCP47\" as const;\n\n // Simplified BCP 47 pattern\n // This is a practical implementation that covers most common cases\n // Full RFC 5646 compliance would require more complex parsing\n private static readonly PATTERN =\n /^[a-zA-Z]{2,3}(?:-[a-zA-Z]{3}){0,3}(?:-[a-zA-Z]{4})?(?:-(?:[a-zA-Z]{2}|[0-9]{3}))?(?:-(?:[a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*(?:-[0-9a-wyzA-WYZ](?:-[a-zA-Z0-9]{2,8})+)*(?:-x(?:-[a-zA-Z0-9]{1,8})+)?$|^x(?:-[a-zA-Z0-9]{1,8})+$|^[a-zA-Z]{4,8}$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Empty string is valid (no language specified)\n if (value === \"\") {\n return valid();\n }\n\n // Basic validation: check against pattern\n if (!BCP47.PATTERN.test(value)) {\n return invalid(`Invalid BCP 47 language tag: \"${value}\"`);\n }\n\n // Additional validation: check subtag lengths\n const subtags = value.split(\"-\");\n\n for (let i = 0; i < subtags.length; i++) {\n const subtag = subtags[i];\n\n // Subtags must not be empty\n if (subtag.length === 0) {\n return invalid(\n `Invalid BCP 47 language tag: empty subtag in \"${value}\"`,\n );\n }\n\n // First subtag (language or 'x' for private use) should be 2-8 letters\n if (i === 0) {\n if (subtag === \"x\") {\n // Private use tag, remaining subtags should be 1-8 alphanumeric\n continue;\n }\n if (!/^[a-zA-Z]{2,8}$/.test(subtag)) {\n return invalid(`Invalid language subtag in \"${value}\": \"${subtag}\"`);\n }\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * A valid MIME type string represents a MIME type.\n *\n * Format: type \"/\" subtype [ \";\" parameter ]\n *\n * @see https://html.spec.whatwg.org/multipage/infrastructure.html#valid-mime-type\n * @see https://datatracker.ietf.org/doc/html/rfc2045#section-5.1\n */\nexport class MIMEType implements AttributeSpec {\n static type = \"MIMEType\" as const;\n constructor() {}\n\n // Matches: type/subtype with optional parameters\n // type and subtype: one or more characters from the token character set\n // token: any CHAR except CTLs or separators\n private static readonly PATTERN =\n /^[a-zA-Z0-9!#$%&'*+\\-.^_`{|}~]+\\/[a-zA-Z0-9!#$%&'*+\\-.^_`{|}~]+(?:\\s*;\\s*[a-zA-Z0-9!#$%&'*+\\-.^_`{|}~]+=(?:[a-zA-Z0-9!#$%&'*+\\-.^_`{|}~]+|\"[^\"]*\"))*$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (!MIMEType.PATTERN.test(value)) {\n return invalid(`Invalid MIME type: \"${value}\"`);\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * Validates date strings and global date-time strings.\n *\n * Valid date string format: YYYY-MM-DD\n * Valid global date-time string format: YYYY-MM-DDTHH:MM[:SS[.sss]][Z|±HH:MM]\n *\n * @see https://html.spec.whatwg.org/#valid-date-string\n * @see https://html.spec.whatwg.org/#valid-global-date-and-time-string\n */\nexport class DateString implements AttributeSpec {\n static type = \"DateString\" as const;\n constructor() {}\n\n // Valid date string: YYYY-MM-DD (year must be 4+ digits)\n private static readonly DATE_PATTERN = /^\\d{4,}-\\d{2}-\\d{2}$/;\n\n // Valid global date-time string: YYYY-MM-DD[T| ]HH:MM[:SS[.sss]][Z|±HH:MM]\n private static readonly DATETIME_PATTERN =\n /^\\d{4,}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{1,3})?)?(?:Z|[+-]\\d{2}:\\d{2})?$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Check if it matches either date or datetime format\n if (\n !DateString.DATE_PATTERN.test(value) &&\n !DateString.DATETIME_PATTERN.test(value)\n ) {\n return invalid(`Invalid date or datetime string: \"${value}\"`);\n }\n\n // Additional validation for date components\n const dateMatch = value.match(/^(\\d{4,})-(\\d{2})-(\\d{2})/);\n if (dateMatch) {\n const year = parseInt(dateMatch[1], 10);\n const month = parseInt(dateMatch[2], 10);\n const day = parseInt(dateMatch[3], 10);\n\n if (year === 0) {\n return invalid(`Year must be greater than 0: \"${value}\"`);\n }\n\n if (month < 1 || month > 12) {\n return invalid(`Month must be between 1 and 12: \"${value}\"`);\n }\n\n // Check day range (simplified - doesn't account for leap years and month lengths)\n if (day < 1 || day > 31) {\n return invalid(`Day must be between 1 and 31: \"${value}\"`);\n }\n }\n\n // Additional validation for time components (if present)\n const timeMatch = value.match(/[T ](\\d{2}):(\\d{2})/);\n if (timeMatch) {\n const hour = parseInt(timeMatch[1], 10);\n const minute = parseInt(timeMatch[2], 10);\n\n if (hour > 23) {\n return invalid(`Hour must be between 0 and 23: \"${value}\"`);\n }\n\n if (minute > 59) {\n return invalid(`Minute must be between 0 and 59: \"${value}\"`);\n }\n\n // Check seconds if present\n const secondMatch = value.match(/[T ]\\d{2}:\\d{2}:(\\d{2})/);\n if (secondMatch) {\n const second = parseInt(secondMatch[1], 10);\n if (second > 59) {\n return invalid(`Second must be between 0 and 59: \"${value}\"`);\n }\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * Validates a regular expression pattern string.\n *\n * Used for HTML attributes that accept JavaScript regular expression patterns,\n * such as the pattern attribute on input elements.\n *\n * @see https://html.spec.whatwg.org/multipage/input.html#the-pattern-attribute\n */\nexport class RegularExpression implements AttributeSpec {\n static type = \"RegularExpression\" as const;\n constructor() {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Try to compile the regular expression to check if it's valid\n try {\n new RegExp(value);\n return valid();\n } catch (error) {\n return invalid(\n `Invalid regular expression: \"${value}\" - ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * Validates a hash-name reference to an element.\n *\n * A valid hash-name reference consists of a U+0023 NUMBER SIGN character (#)\n * followed by a string that matches the value of a name attribute.\n *\n * Format: #name-value\n *\n * @see https://html.spec.whatwg.org/#valid-hash-name-reference\n */\nexport class HashNameReference implements AttributeSpec {\n static type = \"HashNameReference\" as const;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Must start with # and have at least one character after it\n if (!value.startsWith(\"#\")) {\n return invalid(`Hash-name reference must start with \"#\": \"${value}\"`);\n }\n\n if (value.length === 1) {\n return invalid(\n `Hash-name reference must have a name after \"#\": \"${value}\"`,\n );\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * Validates a navigable target name (browsing context name).\n *\n * A valid navigable target name is any string with at least one character that:\n * - Does not contain ASCII tab (\\t), newline (\\n), or U+003C (<)\n * - Does not start with U+005F (_) - reserved for special keywords like _blank, _self, _parent, _top\n *\n * @see https://html.spec.whatwg.org/multipage/document-sequences.html#valid-navigable-target-name\n */\nexport class NavigableTargetName implements AttributeSpec {\n static type = \"NavigableTargetName\" as const;\n constructor() {}\n\n // Pattern to detect invalid characters: tab, newline, or <\n private static readonly INVALID_CHARS_PATTERN = /[\\t\\n<]/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Must have at least one character\n if (value.length === 0) {\n return invalid(\"Navigable target name must have at least one character\");\n }\n\n // Cannot start with underscore (_) - reserved for keywords\n if (value.startsWith(\"_\")) {\n return invalid(\n `Navigable target name cannot start with \"_\" (reserved for keywords like _blank, _self): \"${value}\"`,\n );\n }\n\n // Cannot contain tab, newline, or <\n if (NavigableTargetName.INVALID_CHARS_PATTERN.test(value)) {\n return invalid(\n `Navigable target name cannot contain tab, newline, or \"<\" character: \"${value}\"`,\n );\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\n\n/**\n * Validates srcset attribute values.\n *\n * The value consists of one or more image candidate strings, separated by commas.\n * Each image candidate string contains:\n * - A valid non-empty URL (not starting/ending with comma)\n * - Optional descriptor: width (e.g., \"100w\") or pixel density (e.g., \"2x\")\n *\n * Examples:\n * - \"image.jpg\"\n * - \"image-1x.jpg 1x, image-2x.jpg 2x\"\n * - \"small.jpg 100w, large.jpg 500w\"\n *\n * @see https://html.spec.whatwg.org/multipage/images.html#srcset-attributes\n */\nexport class SrcsetAttribute implements AttributeSpec {\n static type = \"SrcsetAttribute\" as const;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (value.trim() === \"\") {\n return invalid(\"Srcset cannot be empty\");\n }\n\n // Split by commas to get image candidate strings\n const candidates = value.split(\",\");\n\n for (let i = 0; i < candidates.length; i++) {\n const candidate = candidates[i].trim();\n\n if (candidate === \"\") {\n return invalid(`Image candidate string ${i + 1} is empty`);\n }\n\n // Parse the candidate: URL + optional descriptor\n const parts = candidate.split(/\\s+/);\n const url = parts[0];\n\n // URL must not start or end with comma\n if (url.startsWith(\",\") || url.endsWith(\",\")) {\n return invalid(`URL cannot start or end with comma: \"${url}\"`);\n }\n\n // URL must not be empty\n if (url === \"\") {\n return invalid(`URL in candidate string ${i + 1} is empty`);\n }\n\n // If there's a descriptor, validate it\n if (parts.length > 1) {\n const descriptor = parts[parts.length - 1];\n\n // Width descriptor: must be positive integer followed by 'w'\n if (descriptor.endsWith(\"w\")) {\n const widthStr = descriptor.slice(0, -1);\n const width = parseInt(widthStr, 10);\n\n if (!/^\\d+$/.test(widthStr) || width <= 0) {\n return invalid(\n `Invalid width descriptor: \"${descriptor}\" (must be positive integer followed by 'w')`,\n );\n }\n }\n // Pixel density descriptor: must be positive number followed by 'x'\n else if (descriptor.endsWith(\"x\")) {\n const densityStr = descriptor.slice(0, -1);\n const density = parseFloat(densityStr);\n\n if (\n !/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?$/.test(densityStr) ||\n density <= 0\n ) {\n return invalid(\n `Invalid pixel density descriptor: \"${descriptor}\" (must be positive number followed by 'x')`,\n );\n }\n }\n // Invalid descriptor\n else {\n return invalid(\n `Invalid descriptor: \"${descriptor}\" (must end with 'w' or 'x')`,\n );\n }\n\n // There should be only one descriptor\n if (parts.length > 2) {\n // Multiple tokens after URL - check if they're all whitespace or if there are extra descriptors\n const extraParts = parts.slice(1, -1);\n if (extraParts.some((p: string) => p !== \"\")) {\n return invalid(\n `Invalid image candidate string: \"${candidate}\" (extra tokens found)`,\n );\n }\n }\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\nimport {\n getCSSLanguageService,\n TextDocument,\n} from \"vscode-css-languageservice\";\n\nexport class MediaQueryList implements AttributeSpec {\n static type = \"MediaQueryList\" as const;\n private cssLanguageService = getCSSLanguageService();\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n try {\n const cssText = `@media ${value} {}`;\n const document = TextDocument.create(\"test.css\", \"css\", 1, cssText);\n\n const stylesheet = this.cssLanguageService.parseStylesheet(document);\n const diagnostics = this.cssLanguageService.doValidation(\n document,\n stylesheet,\n );\n\n if (diagnostics.length > 0) {\n return invalid(ERROR_MESSAGES.INVALID_MEDIA_QUERY_LIST);\n }\n\n return valid();\n } catch (error) {\n return invalid(ERROR_MESSAGES.INVALID_MEDIA_QUERY_LIST);\n }\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport class SourceSizeList implements AttributeSpec {\n static type = \"SourceSizeList\" as const;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // TODO: Implementation\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { FloatingPointNumber } from \"./floating-point-number\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * A valid list of floating-point numbers is a number of valid floating-point numbers separated by U+002C COMMA characters, with no other characters (e.g. no ASCII whitespace). In addition, there might be restrictions on the number of floating-point numbers that can be given, or on the range of values allowed.\n *\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-list-of-floating-point-numbers\n */\nexport class FloatingPointNumberList implements AttributeSpec {\n static type = \"FloatingPointNumberList\" as const;\n\n private floatingPointNumberValidator = new FloatingPointNumber();\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Empty string is not valid\n if (value.length === 0) {\n return invalid(ERROR_MESSAGES.VALUE_CANNOT_BE_EMPTY);\n }\n\n // Split by comma (no whitespace allowed)\n const numbers = value.split(\",\");\n\n // Validate each number\n for (let i = 0; i < numbers.length; i++) {\n const number = numbers[i];\n\n // Check that there are no empty parts (which would indicate consecutive commas or leading/trailing commas)\n if (number.length === 0) {\n return invalid(`Empty value at position ${i + 1}`);\n }\n\n // Validate using FloatingPointNumber validator\n const result = this.floatingPointNumberValidator.validateValue(number);\n if (!result.valid) {\n return invalid(\n `Invalid floating-point number at position ${i + 1}: \"${number}\"`,\n );\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport type { AnyAttribute } from \"./any-attribute.js\";\nimport { createAttributeSpec } from \"../create-attribute-spec.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\n\nexport type OrValidatorOptions = {\n items: Exclude<AnyAttribute, { type: \"#or\" }>[];\n};\n\n/**\n * OrValidator validates a value against multiple validators.\n * If any validator passes, the value is considered valid.\n * If all validators fail, returns the error from the last validator.\n */\nexport class OrValidator implements AttributeSpec {\n static type = \"#or\" as const;\n constructor(private options: OrValidatorOptions) {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Try each validator in order\n let lastError: string | undefined;\n\n for (const item of this.options.items) {\n const spec = createAttributeSpec(\"\", item);\n const result = spec.validateValue(value);\n\n if (result.valid) {\n return valid();\n }\n\n lastError = result.reason;\n }\n\n // If all validators failed, return the last error\n return invalid(\n lastError ?? \"Value does not match any of the allowed formats\",\n );\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\nimport { REGEX_ASCII_WHITESPACE } from \"../../shared/index.js\";\n\n/**\n * Validates the autocomplete attribute for input, select, and textarea elements.\n *\n * The autocomplete attribute can be:\n * 1. \"on\" or \"off\"\n * 2. An ordered set of space-separated tokens:\n * - Optional: section-* (where * is a string)\n * - Optional: billing or shipping\n * - Required: autofill field name\n * - Optional: webauthn (only for username and certain fields)\n *\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill\n */\nexport class AutocompleteAttribute implements AttributeSpec {\n static type = \"AutocompleteAttribute\" as const;\n\n // Autofill field names per HTML Standard\n private static readonly AUTOFILL_FIELD_NAMES = new Set([\n \"name\",\n \"honorific-prefix\",\n \"given-name\",\n \"additional-name\",\n \"family-name\",\n \"honorific-suffix\",\n \"nickname\",\n \"username\",\n \"new-password\",\n \"current-password\",\n \"one-time-code\",\n \"organization-title\",\n \"organization\",\n \"street-address\",\n \"address-line1\",\n \"address-line2\",\n \"address-line3\",\n \"address-level4\",\n \"address-level3\",\n \"address-level2\",\n \"address-level1\",\n \"country\",\n \"country-name\",\n \"postal-code\",\n \"cc-name\",\n \"cc-given-name\",\n \"cc-additional-name\",\n \"cc-family-name\",\n \"cc-number\",\n \"cc-exp\",\n \"cc-exp-month\",\n \"cc-exp-year\",\n \"cc-csc\",\n \"cc-type\",\n \"transaction-currency\",\n \"transaction-amount\",\n \"language\",\n \"bday\",\n \"bday-day\",\n \"bday-month\",\n \"bday-year\",\n \"sex\",\n \"url\",\n \"photo\",\n \"tel\",\n \"tel-country-code\",\n \"tel-national\",\n \"tel-area-code\",\n \"tel-local\",\n \"tel-local-prefix\",\n \"tel-local-suffix\",\n \"tel-extension\",\n \"email\",\n \"impp\",\n ]);\n\n // Fields that can have webauthn token\n private static readonly WEBAUTHN_COMPATIBLE_FIELDS = new Set([\n \"username\",\n \"current-password\",\n ]);\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Empty string means default behavior\n if (value === \"\") {\n return valid();\n }\n\n const normalized = value.toLowerCase().trim();\n\n // Check for simple \"on\" or \"off\"\n if (normalized === \"on\" || normalized === \"off\") {\n return valid();\n }\n\n // Parse as space-separated tokens\n const tokens = normalized.split(REGEX_ASCII_WHITESPACE).filter(Boolean);\n\n if (tokens.length === 0) {\n return invalid(\"Autocomplete value cannot be empty\");\n }\n\n let index = 0;\n let hasSection = false;\n let hasAddressType = false;\n let hasFieldName = false;\n let hasWebauthn = false;\n let fieldName = \"\";\n\n // Optional: section-* token\n if (tokens[index]?.startsWith(\"section-\")) {\n hasSection = true;\n index++;\n }\n\n // Optional: billing or shipping\n if (tokens[index] === \"billing\" || tokens[index] === \"shipping\") {\n hasAddressType = true;\n index++;\n }\n\n // Required: autofill field name\n if (index < tokens.length) {\n const token = tokens[index];\n if (AutocompleteAttribute.AUTOFILL_FIELD_NAMES.has(token)) {\n hasFieldName = true;\n fieldName = token;\n index++;\n } else {\n return invalid(\n `Invalid autofill field name: \"${token}\". Must be one of the standard autofill field names.`,\n );\n }\n } else {\n return invalid(\"Autocomplete value must include an autofill field name\");\n }\n\n // Optional: webauthn\n if (index < tokens.length) {\n if (tokens[index] === \"webauthn\") {\n if (!AutocompleteAttribute.WEBAUTHN_COMPATIBLE_FIELDS.has(fieldName)) {\n return invalid(\n `\"webauthn\" token is only valid with username or current-password fields, not \"${fieldName}\"`,\n );\n }\n hasWebauthn = true;\n index++;\n }\n }\n\n // No extra tokens allowed\n if (index < tokens.length) {\n return invalid(\n `Invalid extra token in autocomplete value: \"${tokens[index]}\"`,\n );\n }\n\n return valid();\n }\n}\n","import {\n AutocompleteAttribute,\n BCP47,\n BooleanAttribute,\n CommaSeparatedTokens,\n CSSColor,\n DateString,\n EnumeratedAttribute,\n FloatingPointNumber,\n FloatingPointNumberList,\n HashNameReference,\n ID,\n MediaQueryList,\n MIMEType,\n NavigableTargetName,\n NonNegativeInteger,\n OrValidator,\n RegularExpression,\n SignedInteger,\n SourceSizeList,\n SpaceSeparatedTokens,\n SrcsetAttribute,\n Text,\n ValidURL,\n type AnyAttribute,\n} from \"./validators/index.js\";\nimport * as types from \"../types/index.js\";\n\nexport function createAttributeSpec(\n key: string,\n def: AnyAttribute,\n): types.AttributeSpec {\n switch (def.type) {\n case SpaceSeparatedTokens.type: {\n return new SpaceSeparatedTokens(def.options);\n }\n case EnumeratedAttribute.type: {\n return new EnumeratedAttribute(def.options);\n }\n case BooleanAttribute.type: {\n return new BooleanAttribute(key);\n }\n case SignedInteger.type: {\n return new SignedInteger();\n }\n case Text.type: {\n return new Text();\n }\n case ValidURL.type: {\n return new ValidURL(def.options);\n }\n case NonNegativeInteger.type: {\n return new NonNegativeInteger(def.options);\n }\n case ID.type: {\n return new ID();\n }\n case FloatingPointNumber.type: {\n return new FloatingPointNumber();\n }\n case CommaSeparatedTokens.type: {\n return new CommaSeparatedTokens();\n }\n case CSSColor.type: {\n return new CSSColor();\n }\n case BCP47.type: {\n return new BCP47();\n }\n case MIMEType.type: {\n return new MIMEType();\n }\n case DateString.type: {\n return new DateString();\n }\n case RegularExpression.type: {\n return new RegularExpression();\n }\n case HashNameReference.type: {\n return new HashNameReference();\n }\n case NavigableTargetName.type: {\n return new NavigableTargetName();\n }\n case SrcsetAttribute.type: {\n return new SrcsetAttribute();\n }\n case MediaQueryList.type: {\n return new MediaQueryList();\n }\n case SourceSizeList.type: {\n return new SourceSizeList();\n }\n case FloatingPointNumberList.type: {\n return new FloatingPointNumberList();\n }\n case OrValidator.type: {\n return new OrValidator({ items: def.items });\n }\n case AutocompleteAttribute.type: {\n return new AutocompleteAttribute();\n }\n }\n}\n","import type { AnyAttribute } from \"./validators/index.js\";\nimport * as types from \"../types/index.js\";\nimport { createAttributeSpec } from \"./create-attribute-spec.js\";\n\nexport class AttributeSpec implements types.AttributeSpec {\n constructor(\n private key: string,\n private definition: AnyAttribute,\n ) {}\n\n validateValue(\n value: types.AttributeValue,\n ): types.AttributeSpecValidateResult {\n const spec = createAttributeSpec(this.key, this.definition);\n return spec.validateValue(value);\n }\n}\n","import type { AnyAttribute } from \"./validators/any-attribute.js\";\nimport { BooleanAttribute } from \"./validators/boolean-attribute.js\";\nimport { EnumeratedAttribute } from \"./validators/enumerated-attribute.js\";\nimport { SignedInteger } from \"./validators/signed-integer.js\";\nimport { SpaceSeparatedTokens } from \"./validators/space-separated-tokens.js\";\nimport { Text } from \"./validators/text.js\";\nimport { ValidURL } from \"./validators/valid-url.js\";\nimport { BCP47 } from \"./validators/bcp-47.js\";\nimport { NonNegativeInteger } from \"./validators/non-negative-integer.js\";\n\n/**\n * @see https://html.spec.whatwg.org/multipage/dom.html#global-attributes\n */\nexport const globalAttributes = new Map<string, AnyAttribute>([\n [\n // If specified, the value must be an ordered set of unique space-separated tokens\n // none of which are identical to another token and each of which must be exactly one code point in length.\n \"accesskey\",\n {\n type: SpaceSeparatedTokens.type,\n options: {\n unique: true,\n validateToken(value) {\n // Each token must be exactly one code point in length\n // Use Array.from to properly handle Unicode code points (e.g., emojis, surrogate pairs)\n const codePoints = Array.from(value);\n return codePoints.length === 1;\n },\n },\n },\n ],\n [\n \"autocapitalize\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"off\", \"none\", \"on\", \"sentences\", \"words\", \"characters\"],\n },\n },\n ],\n [\n \"autocorrect\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"on\", \"off\"],\n },\n },\n ],\n [\n \"autofocus\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"contenteditable\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"true\", \"false\", \"plaintext-only\"],\n },\n },\n ],\n [\n \"dir\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"ltr\", \"rtl\", \"auto\"],\n },\n },\n ],\n [\n \"draggable\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"true\", \"false\"],\n },\n },\n ],\n [\n \"enterkeyhint\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"enter\", \"done\", \"go\", \"next\", \"previous\", \"search\", \"send\"],\n },\n },\n ],\n [\n \"headingoffset\",\n {\n type: NonNegativeInteger.type,\n options: {\n min: 0,\n max: 8,\n },\n },\n ],\n [\n \"headingreset\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"hidden\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"until-found\", \"hidden\"],\n },\n },\n ],\n [\n \"inert\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"inputmode\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"none\",\n \"text\",\n \"tel\",\n \"url\",\n \"email\",\n \"numeric\",\n \"decimal\",\n \"search\",\n ],\n },\n },\n ],\n [\n \"is\",\n {\n type: Text.type,\n },\n ],\n [\"itemid\", ValidURL.PotentiallySurroundedBySpaces],\n [\n \"itemprop\",\n {\n type: SpaceSeparatedTokens.type,\n options: { unique: true },\n },\n ],\n [\n \"itemref\",\n {\n type: SpaceSeparatedTokens.type,\n options: { unique: true },\n },\n ],\n [\n \"itemscope\",\n {\n type: BooleanAttribute.type,\n },\n ],\n /**\n * The itemtype attribute, if specified, must have a value that is an unordered set of unique space-separated tokens,\n * none of which are identical to another token and each of which is a valid URL string that is an absolute URL,\n * and all of which are defined to use the same vocabulary. The attribute's value must have at least one token.\n */\n [\n \"itemtype\",\n {\n type: SpaceSeparatedTokens.type,\n options: {\n unique: true,\n validateToken(value) {\n // Each token must be a valid absolute URL\n try {\n new URL(value);\n // URL constructor only accepts absolute URLs, so if it succeeds, it's absolute\n return true;\n } catch {\n return false;\n }\n },\n },\n },\n ],\n [\n \"lang\",\n {\n type: BCP47.type,\n },\n ],\n [\n \"nonce\",\n {\n type: Text.type,\n },\n ],\n [\n \"popover\",\n {\n type: \"#or\",\n items: [\n {\n type: BooleanAttribute.type,\n },\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"auto\", \"manual\", \"hint\"],\n },\n },\n ],\n },\n ],\n [\n \"spellcheck\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"true\", \"false\"],\n },\n },\n ],\n [\n \"style\",\n {\n type: Text.type,\n },\n ],\n [\n \"tabindex\",\n {\n type: SignedInteger.type,\n },\n ],\n [\n \"title\",\n {\n type: Text.type,\n },\n ],\n [\n \"translate\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"yes\", \"no\"],\n },\n },\n ],\n [\n \"writingsuggestions\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"true\", \"false\"],\n },\n },\n ],\n]);\n","import {\n AutocompleteAttribute,\n BooleanAttribute,\n CommaSeparatedTokens,\n EnumeratedAttribute,\n NonNegativeInteger,\n SignedInteger,\n SpaceSeparatedTokens,\n Text,\n ValidURL,\n ID,\n FloatingPointNumber,\n CSSColor,\n BCP47,\n MIMEType,\n DateString,\n RegularExpression,\n HashNameReference,\n NavigableTargetName,\n SrcsetAttribute,\n MediaQueryList,\n SourceSizeList,\n FloatingPointNumberList,\n type AnyAttribute,\n OrValidator,\n} from \"../attribute/validators/index.js\";\nimport { type ElementSpecDefinition } from \"../types/index.js\";\n\nconst empty: [string, AnyAttribute][] = [];\n\nexport const elementSpecDefinitionMap: Record<string, ElementSpecDefinition> = {\n html: {\n globalAttributes: true,\n attributes: empty,\n },\n head: { globalAttributes: true, attributes: empty },\n title: { globalAttributes: true, attributes: empty },\n base: {\n globalAttributes: true,\n attributes: [\n [\"href\", ValidURL.PotentiallySurroundedBySpaces],\n [\n \"target\",\n {\n type: \"#or\",\n items: [\n {\n type: NavigableTargetName.type,\n },\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n },\n ],\n },\n ],\n ],\n },\n link: {\n globalAttributes: true,\n attributes: [\n [\"href\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"crossorigin\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"anonymous\", \"use-credentials\"],\n },\n },\n ],\n [\n \"rel\",\n {\n type: SpaceSeparatedTokens.type,\n options: {\n unique: true,\n // allowed: [\n // \"alternate\",\n // \"canonical\",\n // \"author\",\n // \"dns-prefetch\",\n // \"expect\",\n // \"help\",\n // \"icon\",\n // \"manifest\",\n // \"modulepreload\",\n // \"license\",\n // \"next\",\n // \"pingback\",\n // \"preconnect\",\n // \"prefetch\",\n // \"preload\",\n // \"prev\",\n // \"privacy-policy\",\n // \"search\",\n // \"stylesheet\",\n // \"terms-of-service\",\n // ],\n },\n },\n ],\n [\n \"media\",\n {\n type: MediaQueryList.type,\n },\n ],\n [\n \"integrity\",\n {\n type: Text.type,\n },\n ],\n [\n \"hreflang\",\n {\n type: BCP47.type,\n },\n ],\n [\n \"type\",\n {\n type: MIMEType.type,\n },\n ],\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n },\n ],\n [\n \"sizes\",\n {\n type: SpaceSeparatedTokens.type,\n options: {\n unique: true,\n validateToken(value: string) {\n // Accept \"any\" (case-insensitive)\n if (value.toLowerCase() === \"any\") {\n return true;\n }\n\n // Accept dimension pairs: NNNxMMM or NNNxMMM (e.g., \"100x200\")\n // Must be two non-negative integers without leading zeros, separated by 'x' or 'X'\n const dimensionPattern = /^([1-9]\\d*|0)[xX]([1-9]\\d*|0)$/;\n const match = value.match(dimensionPattern);\n\n if (!match) {\n return false;\n }\n\n // Check that neither number has a leading zero (except for \"0\" itself)\n const [, width, height] = match;\n if (\n (width.length > 1 && width.startsWith(\"0\")) ||\n (height.length > 1 && height.startsWith(\"0\"))\n ) {\n return false;\n }\n\n return true;\n },\n },\n },\n ],\n // TODO: conditional - only valid when rel=\"preload\" and as=\"image\"\n [\n \"imagesrcset\",\n {\n type: SrcsetAttribute.type,\n },\n ],\n // TODO: conditional - only valid when rel=\"preload\", as=\"image\", and imagesrcset is present\n [\n \"imagesizes\",\n {\n type: SourceSizeList.type,\n },\n ],\n // TODO: conditional - only valid when rel contains \"preload\" or \"modulepreload\"\n [\n \"as\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"fetch\",\n \"font\",\n \"image\",\n \"script\",\n \"style\",\n \"track\",\n \"json\",\n \"style\",\n \"audioworklet\",\n \"paintworklet\",\n \"script\",\n \"serviceworker\",\n \"sharedworker\",\n \"worker\",\n ],\n },\n },\n ],\n [\n \"blocking\",\n {\n type: SpaceSeparatedTokens.type,\n options: { unique: true, allowed: [\"render\"] },\n },\n ],\n [\n \"color\",\n {\n type: CSSColor.type,\n },\n ],\n [\n \"disabled\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"fetchpriority\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"high\", \"low\", \"auto\"],\n },\n },\n ],\n ],\n },\n meta: {\n globalAttributes: true,\n attributes: [\n [\n \"name\",\n {\n type: Text.type,\n },\n ],\n [\n \"http-equiv\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"content-language\",\n \"content-type\",\n \"default-style\",\n \"refresh\",\n \"set-cookie\",\n \"x-ua-compatible\",\n \"content-security-policy\",\n ],\n },\n },\n ],\n [\n \"content\",\n {\n type: Text.type,\n },\n ],\n [\n \"charset\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"utf-8\"],\n },\n },\n ],\n [\n \"media\",\n {\n type: MediaQueryList.type,\n },\n ],\n ],\n },\n style: {\n globalAttributes: true,\n attributes: [\n [\n \"media\",\n {\n type: MediaQueryList.type,\n },\n ],\n [\n \"blocking\",\n {\n type: SpaceSeparatedTokens.type,\n options: { unique: true, allowed: [\"render\"] },\n },\n ],\n ],\n },\n body: { globalAttributes: true, attributes: empty },\n article: { globalAttributes: true, attributes: empty },\n section: { globalAttributes: true, attributes: empty },\n nav: { globalAttributes: true, attributes: empty },\n aside: { globalAttributes: true, attributes: empty },\n hgroup: { globalAttributes: true, attributes: empty },\n header: { globalAttributes: true, attributes: empty },\n footer: { globalAttributes: true, attributes: empty },\n address: { globalAttributes: true, attributes: empty },\n p: { globalAttributes: true, attributes: empty },\n hr: { globalAttributes: true, attributes: empty },\n pre: { globalAttributes: true, attributes: empty },\n blockquote: {\n globalAttributes: true,\n attributes: [[\"cite\", ValidURL.PotentiallySurroundedBySpaces]],\n },\n ol: {\n globalAttributes: true,\n attributes: [\n [\n \"reversed\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"start\",\n {\n type: SignedInteger.type,\n },\n ],\n [\n \"type\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"1\", \"a\", \"A\", \"i\", \"I\"],\n },\n },\n ],\n ],\n },\n ul: { globalAttributes: true, attributes: empty },\n menu: { globalAttributes: true, attributes: empty },\n li: {\n globalAttributes: true,\n attributes: [\n [\n \"value\",\n {\n type: SignedInteger.type,\n },\n ],\n ],\n },\n dl: { globalAttributes: true, attributes: empty },\n dt: { globalAttributes: true, attributes: empty },\n dd: { globalAttributes: true, attributes: empty },\n figure: { globalAttributes: true, attributes: empty },\n figcaption: { globalAttributes: true, attributes: empty },\n main: { globalAttributes: true, attributes: empty },\n search: { globalAttributes: true, attributes: empty },\n div: { globalAttributes: true, attributes: empty },\n a: {\n globalAttributes: true,\n attributes: [\n [\"href\", ValidURL.PotentiallySurroundedBySpaces],\n [\n \"target\",\n {\n type: \"#or\",\n items: [\n {\n type: NavigableTargetName.type,\n },\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n },\n ],\n },\n ],\n [\n \"download\",\n {\n type: Text.type,\n },\n ],\n [\n \"ping\",\n {\n type: SpaceSeparatedTokens.type,\n options: {\n unique: false,\n validateToken(value: string) {\n // URLs of the resources that are interested in being notified if the user follows the hyperlink.\n // Each token must be a valid non-empty URL whose scheme is an HTTP(S) scheme.\n if (value.length === 0) {\n return false;\n }\n\n try {\n const url = new URL(value);\n // Check if the scheme is http or https\n return url.protocol === \"http:\" || url.protocol === \"https:\";\n } catch {\n // Invalid URL format\n return false;\n }\n },\n },\n },\n ],\n [\n \"rel\",\n {\n type: SpaceSeparatedTokens.type,\n options: {\n unique: true,\n allowed: [\n \"alternate\",\n \"author\",\n \"bookmark\",\n \"external\",\n \"help\",\n \"license\",\n \"next\",\n \"nofollow\",\n \"noopener\",\n \"noreferrer\",\n \"opener\",\n \"prev\",\n \"privacy-policy\",\n \"search\",\n \"tag\",\n \"terms-of-service\",\n ],\n },\n },\n ],\n [\n \"hreflang\",\n {\n type: BCP47.type,\n },\n ],\n [\n \"type\",\n {\n type: MIMEType.type,\n },\n ],\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n },\n ],\n ],\n },\n em: { globalAttributes: true, attributes: empty },\n strong: { globalAttributes: true, attributes: empty },\n small: { globalAttributes: true, attributes: empty },\n s: { globalAttributes: true, attributes: empty },\n cite: { globalAttributes: true, attributes: empty },\n q: {\n globalAttributes: true,\n attributes: [[\"cite\", ValidURL.PotentiallySurroundedBySpaces]],\n },\n dfn: { globalAttributes: true, attributes: empty },\n abbr: { globalAttributes: true, attributes: empty },\n ruby: { globalAttributes: true, attributes: empty },\n rt: { globalAttributes: true, attributes: empty },\n rp: { globalAttributes: true, attributes: empty },\n data: {\n globalAttributes: true,\n attributes: [\n [\n \"value\",\n {\n type: Text.type,\n },\n ],\n ],\n },\n time: {\n globalAttributes: true,\n attributes: [\n [\n \"datetime\",\n {\n type: DateString.type,\n },\n ],\n ],\n },\n code: { globalAttributes: true, attributes: empty },\n var: { globalAttributes: true, attributes: empty },\n samp: { globalAttributes: true, attributes: empty },\n kbd: { globalAttributes: true, attributes: empty },\n i: { globalAttributes: true, attributes: empty },\n b: { globalAttributes: true, attributes: empty },\n u: { globalAttributes: true, attributes: empty },\n mark: { globalAttributes: true, attributes: empty },\n bdi: { globalAttributes: true, attributes: empty },\n bdo: { globalAttributes: true, attributes: empty },\n span: { globalAttributes: true, attributes: empty },\n br: { globalAttributes: true, attributes: empty },\n wbr: { globalAttributes: true, attributes: empty },\n ins: {\n globalAttributes: true,\n attributes: [\n [\"cite\", ValidURL.PotentiallySurroundedBySpaces],\n [\n \"datetime\",\n {\n type: DateString.type,\n },\n ],\n ],\n },\n del: {\n globalAttributes: true,\n attributes: [\n [\"cite\", ValidURL.PotentiallySurroundedBySpaces],\n [\n \"datetime\",\n {\n type: DateString.type,\n },\n ],\n ],\n },\n picture: { globalAttributes: true, attributes: empty },\n source: {\n globalAttributes: true,\n attributes: [\n [\n \"type\",\n {\n type: MIMEType.type,\n },\n ],\n [\n \"media\",\n {\n type: MediaQueryList.type,\n },\n ],\n // TODO: conditional - only valid when parent is <audio> or <video> (invalid when parent is <picture>)\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n // TODO: conditional - only valid when parent is <picture> (invalid when parent is <audio> or <video>)\n [\n \"srcset\",\n {\n type: SrcsetAttribute.type,\n },\n ],\n // TODO: conditional - only valid when parent is <picture> (invalid when parent is <audio> or <video>)\n [\n \"sizes\",\n {\n type: SourceSizeList.type,\n },\n ],\n [\n \"width\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"height\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n ],\n },\n img: {\n globalAttributes: true,\n attributes: [\n [\n \"alt\",\n {\n type: Text.type,\n },\n ],\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"srcset\",\n {\n type: SrcsetAttribute.type,\n },\n ],\n [\n \"sizes\",\n {\n type: SourceSizeList.type,\n },\n ],\n [\n \"crossorigin\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"anonymous\", \"use-credentials\"],\n },\n },\n ],\n // TODO: conditional - invalid when <img> is a descendant of <a> or <button>\n [\n \"usemap\",\n {\n type: HashNameReference.type,\n },\n ],\n // TODO: conditional - only valid when <img> is a descendant of <a> with href attribute\n [\n \"ismap\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"width\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"height\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n },\n ],\n [\n \"decoding\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"sync\", \"async\", \"auto\"],\n },\n },\n ],\n [\n \"loading\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"eager\", \"lazy\"],\n },\n },\n ],\n [\n \"fetchpriority\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"high\", \"low\", \"auto\"],\n },\n },\n ],\n ],\n },\n iframe: {\n globalAttributes: true,\n attributes: [\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"srcdoc\",\n {\n type: Text.type,\n },\n ],\n [\n \"name\",\n {\n type: \"#or\",\n items: [\n {\n type: NavigableTargetName.type,\n },\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n },\n ],\n },\n ],\n [\n \"sandbox\",\n {\n type: SpaceSeparatedTokens.type,\n options: {\n unique: true,\n allowed: [\n \"allow-downloads\",\n \"allow-forms\",\n \"allow-modals\",\n \"allow-orientation-lock\",\n \"allow-pointer-lock\",\n \"allow-popups\",\n \"allow-popups-to-escape-sandbox\",\n \"allow-presentation\",\n \"allow-same-origin\",\n \"allow-scripts\",\n \"allow-top-navigation\",\n \"allow-top-navigation-by-user-activation\",\n \"allow-top-navigation-to-custom-protocols\",\n ],\n },\n },\n ],\n [\n \"allow\",\n {\n type: Text.type,\n },\n ],\n [\n \"allowfullscreen\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"width\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"height\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n },\n ],\n [\n \"loading\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"eager\", \"lazy\"],\n },\n },\n ],\n ],\n },\n embed: {\n globalAttributes: true,\n attributes: [\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"type\",\n {\n type: MIMEType.type,\n },\n ],\n [\n \"width\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"height\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n ],\n },\n object: {\n globalAttributes: true,\n attributes: [\n [\"data\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"type\",\n {\n type: MIMEType.type,\n },\n ],\n [\n \"name\",\n {\n type: \"#or\",\n items: [\n {\n type: NavigableTargetName.type,\n },\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n },\n ],\n },\n ],\n\n [\n \"form\",\n {\n type: ID.type,\n },\n ],\n [\n \"width\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"height\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n ],\n },\n video: {\n globalAttributes: true,\n attributes: [\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"crossorigin\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"anonymous\", \"use-credentials\"],\n },\n },\n ],\n [\"poster\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"preload\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"none\", \"metadata\", \"auto\"],\n },\n },\n ],\n [\n \"autoplay\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"playsinline\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"loop\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"muted\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"controls\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"width\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"height\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n ],\n },\n audio: {\n globalAttributes: true,\n attributes: [\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"crossorigin\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"anonymous\", \"use-credentials\"],\n },\n },\n ],\n [\n \"preload\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"none\", \"metadata\", \"auto\"],\n },\n },\n ],\n [\n \"autoplay\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"loop\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"muted\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"controls\",\n {\n type: BooleanAttribute.type,\n },\n ],\n ],\n },\n track: {\n globalAttributes: true,\n attributes: [\n [\n \"kind\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"subtitles\",\n \"captions\",\n \"descriptions\",\n \"chapters\",\n \"metadata\",\n ],\n },\n },\n ],\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"srclang\",\n {\n type: BCP47.type,\n },\n ],\n [\n \"label\",\n {\n type: Text.type,\n },\n ],\n [\n \"default\",\n {\n type: BooleanAttribute.type,\n },\n ],\n ],\n },\n map: {\n globalAttributes: true,\n attributes: [\n [\n \"name\",\n {\n type: Text.type,\n },\n ],\n ],\n },\n area: {\n globalAttributes: true,\n attributes: [\n [\n \"alt\",\n {\n type: Text.type,\n },\n ],\n [\n \"coords\",\n {\n type: FloatingPointNumberList.type,\n },\n ],\n [\n \"shape\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"circle\", \"default\", \"poly\", \"rect\"],\n },\n },\n ],\n [\"href\", ValidURL.PotentiallySurroundedBySpaces],\n // TODO: conditional - only applicable when href attribute is present\n [\n \"target\",\n {\n type: \"#or\",\n items: [\n {\n type: NavigableTargetName.type,\n },\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n },\n ],\n },\n ],\n // TODO: conditional - only applicable when href attribute is present\n [\n \"download\",\n {\n type: Text.type,\n },\n ],\n // TODO: conditional - only applicable when href attribute is present\n [\n \"ping\",\n {\n type: SpaceSeparatedTokens.type,\n options: {\n unique: false,\n validateToken(value: string) {\n // URLs of the resources that are interested in being notified if the user follows the hyperlink.\n // Each token must be a valid non-empty URL whose scheme is an HTTP(S) scheme.\n if (value.length === 0) {\n return false;\n }\n\n try {\n const url = new URL(value);\n // Check if the scheme is http or https\n return url.protocol === \"http:\" || url.protocol === \"https:\";\n } catch {\n // Invalid URL format\n return false;\n }\n },\n },\n },\n ],\n // TODO: conditional - only applicable when href attribute is present\n [\n \"rel\",\n {\n type: SpaceSeparatedTokens.type,\n options: {\n unique: true,\n allowed: [\n \"alternate\",\n \"author\",\n \"bookmark\",\n \"external\",\n \"help\",\n \"license\",\n \"next\",\n \"nofollow\",\n \"noopener\",\n \"noreferrer\",\n \"opener\",\n \"prev\",\n \"privacy-policy\",\n \"search\",\n \"tag\",\n \"terms-of-service\",\n ],\n },\n },\n ],\n // TODO: conditional - only applicable when href attribute is present\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n },\n ],\n ],\n },\n table: { globalAttributes: true, attributes: empty },\n caption: { globalAttributes: true, attributes: empty },\n colgroup: {\n globalAttributes: true,\n attributes: [\n [\n \"span\",\n {\n type: NonNegativeInteger.type,\n options: {\n min: 1,\n },\n },\n ],\n ],\n },\n col: {\n globalAttributes: true,\n attributes: [\n [\n \"span\",\n {\n type: NonNegativeInteger.type,\n options: {\n min: 1,\n },\n },\n ],\n ],\n },\n tbody: { globalAttributes: true, attributes: empty },\n thead: { globalAttributes: true, attributes: empty },\n tfoot: { globalAttributes: true, attributes: empty },\n tr: { globalAttributes: true, attributes: empty },\n td: {\n globalAttributes: true,\n attributes: [\n [\n \"colspan\",\n {\n type: NonNegativeInteger.type,\n options: {\n min: 1,\n },\n },\n ],\n [\n \"rowspan\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"headers\",\n {\n type: SpaceSeparatedTokens.type,\n options: { unique: true },\n },\n ],\n ],\n },\n th: {\n globalAttributes: true,\n attributes: [\n [\n \"colspan\",\n {\n type: NonNegativeInteger.type,\n options: {\n min: 1,\n },\n },\n ],\n [\n \"rowspan\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"headers\",\n {\n type: SpaceSeparatedTokens.type,\n options: { unique: true },\n },\n ],\n [\n \"scope\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"row\", \"col\", \"rowgroup\", \"colgroup\"],\n },\n },\n ],\n [\n \"abbr\",\n {\n type: Text.type,\n },\n ],\n ],\n },\n form: {\n globalAttributes: true,\n attributes: [\n [\n \"accept-charset\",\n {\n type: SpaceSeparatedTokens.type,\n options: { unique: true },\n },\n ],\n [\"action\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"autocomplete\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"on\", \"off\"],\n },\n },\n ],\n [\n \"enctype\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"application/x-www-form-urlencoded\",\n \"multipart/form-data\",\n \"text/plain\",\n ],\n },\n },\n ],\n [\n \"method\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"get\", \"post\", \"dialog\"],\n },\n },\n ],\n [\n \"name\",\n {\n type: Text.type,\n },\n ],\n [\n \"novalidate\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"target\",\n {\n type: \"#or\",\n items: [\n {\n type: NavigableTargetName.type,\n },\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n },\n ],\n },\n ],\n [\n \"rel\",\n {\n type: SpaceSeparatedTokens.type,\n options: {\n unique: true,\n allowed: [\n \"external\",\n \"help\",\n \"license\",\n \"next\",\n \"nofollow\",\n \"noopener\",\n \"noreferrer\",\n \"opener\",\n \"prev\",\n \"search\",\n ],\n },\n },\n ],\n ],\n },\n label: {\n globalAttributes: true,\n attributes: [\n [\n \"for\",\n {\n type: ID.type,\n },\n ],\n ],\n },\n input: {\n globalAttributes: true,\n attributes: [\n // TODO: conditional - only valid when type=\"file\"\n [\n \"accept\",\n {\n type: CommaSeparatedTokens.type,\n },\n ],\n // TODO: conditional - only valid when type=\"image\"\n [\n \"alt\",\n {\n type: Text.type,\n },\n ],\n [\n \"autocomplete\",\n {\n type: AutocompleteAttribute.type,\n },\n ],\n // TODO: conditional - only valid when type=\"checkbox\" or type=\"radio\"\n [\n \"checked\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"dirname\",\n {\n type: Text.type,\n },\n ],\n [\n \"disabled\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"form\",\n {\n type: ID.type,\n },\n ],\n [\"formaction\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"formenctype\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"application/x-www-form-urlencoded\",\n \"multipart/form-data\",\n \"text/plain\",\n ],\n },\n },\n ],\n [\n \"formmethod\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"get\", \"post\", \"dialog\"],\n },\n },\n ],\n [\n \"formnovalidate\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"formtarget\",\n {\n type: \"#or\",\n items: [\n {\n type: NavigableTargetName.type,\n },\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n },\n ],\n },\n ],\n // TODO: conditional - only valid when type=\"image\"\n [\n \"height\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"list\",\n {\n type: ID.type,\n },\n ],\n // TODO: conditional - allowed value format varies based on type attribute (date, number, range, etc.)\n [\n \"max\",\n {\n // TODO: varies based on type\n type: Text.type,\n },\n ],\n [\n \"maxlength\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n // TODO: conditional - allowed value format varies based on type attribute (date, number, range, etc.)\n [\n \"min\",\n {\n // TODO: varies based on type\n type: Text.type,\n },\n ],\n [\n \"minlength\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n // TODO: conditional - only valid when type=\"file\" or type=\"email\"\n [\n \"multiple\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"name\",\n {\n type: Text.type,\n },\n ],\n // TODO: conditional - only applicable to text-based input types (excludes checkbox, radio, hidden, submit, image, reset, button, range, color)\n [\n \"pattern\",\n {\n type: RegularExpression.type,\n },\n ],\n [\n \"placeholder\",\n {\n type: Text.type,\n },\n ],\n [\n \"popovertarget\",\n {\n type: Text.type,\n },\n ],\n [\n \"popovertargetaction\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"hide\", \"show\", \"toggle\"],\n },\n },\n ],\n [\n \"readonly\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"required\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"size\",\n {\n type: NonNegativeInteger.type,\n options: {\n min: 1,\n },\n },\n ],\n // TODO: conditional - only valid when type=\"image\"\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n // TODO: conditional - only valid when type is one of: date, month, week, time, datetime-local, number, range\n [\n \"step\",\n {\n type: \"#or\",\n items: [\n {\n type: FloatingPointNumber.type,\n },\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"any\"],\n },\n },\n ],\n },\n ],\n [\n \"type\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"hidden\",\n \"text\",\n \"search\",\n \"tel\",\n \"url\",\n \"email\",\n \"password\",\n \"date\",\n \"month\",\n \"week\",\n \"time\",\n \"datetime-local\",\n \"number\",\n \"range\",\n \"color\",\n \"checkbox\",\n \"radio\",\n \"file\",\n \"submit\",\n \"image\",\n \"reset\",\n \"button\",\n ],\n },\n },\n ],\n [\n \"value\",\n {\n type: Text.type,\n },\n ],\n // TODO: conditional - only valid when type=\"image\"\n [\n \"width\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n ],\n },\n button: {\n globalAttributes: true,\n attributes: [\n [\n \"disabled\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"form\",\n {\n type: ID.type,\n },\n ],\n // TODO: conditional - only valid when type=\"submit\"\n [\"formaction\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n // TODO: conditional - only valid when type=\"submit\"\n [\n \"formenctype\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"application/x-www-form-urlencoded\",\n \"multipart/form-data\",\n \"text/plain\",\n ],\n },\n },\n ],\n // TODO: conditional - only valid when type=\"submit\"\n [\n \"formmethod\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"get\", \"post\", \"dialog\"],\n },\n },\n ],\n // TODO: conditional - only valid when type=\"submit\"\n [\n \"formnovalidate\",\n {\n type: BooleanAttribute.type,\n },\n ],\n // TODO: conditional - only valid when type=\"submit\"\n [\n \"formtarget\",\n {\n type: \"#or\",\n items: [\n {\n type: NavigableTargetName.type,\n },\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n },\n ],\n },\n ],\n [\n \"name\",\n {\n type: Text.type,\n },\n ],\n [\n \"popovertarget\",\n {\n type: Text.type,\n },\n ],\n [\n \"popovertargetaction\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"hide\", \"show\", \"toggle\"],\n },\n },\n ],\n [\n \"type\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"submit\", \"reset\", \"button\"],\n },\n },\n ],\n [\n \"value\",\n {\n type: Text.type,\n },\n ],\n ],\n },\n select: {\n globalAttributes: true,\n attributes: [\n [\n \"autocomplete\",\n {\n type: AutocompleteAttribute.type,\n },\n ],\n [\n \"disabled\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"form\",\n {\n type: ID.type,\n },\n ],\n [\n \"multiple\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"name\",\n {\n type: Text.type,\n },\n ],\n [\n \"required\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"size\",\n {\n type: NonNegativeInteger.type,\n options: {\n min: 1,\n },\n },\n ],\n ],\n },\n datalist: { globalAttributes: true, attributes: empty },\n optgroup: {\n globalAttributes: true,\n attributes: [\n [\n \"disabled\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"label\",\n {\n type: Text.type,\n },\n ],\n ],\n },\n option: {\n globalAttributes: true,\n attributes: [\n [\n \"disabled\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"label\",\n {\n type: Text.type,\n },\n ],\n [\n \"selected\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"value\",\n {\n type: Text.type,\n },\n ],\n ],\n },\n textarea: {\n globalAttributes: true,\n attributes: [\n [\n \"autocomplete\",\n {\n type: AutocompleteAttribute.type,\n },\n ],\n [\n \"cols\",\n {\n type: NonNegativeInteger.type,\n options: {\n min: 1,\n },\n },\n ],\n [\n \"dirname\",\n {\n type: Text.type,\n },\n ],\n [\n \"disabled\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"form\",\n {\n type: ID.type,\n },\n ],\n [\n \"maxlength\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"minlength\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"name\",\n {\n type: Text.type,\n },\n ],\n [\n \"placeholder\",\n {\n type: Text.type,\n },\n ],\n [\n \"readonly\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"required\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"rows\",\n {\n type: NonNegativeInteger.type,\n options: {\n min: 1,\n },\n },\n ],\n [\n \"wrap\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"soft\", \"hard\"],\n },\n },\n ],\n ],\n },\n output: {\n globalAttributes: true,\n attributes: [\n [\n \"for\",\n {\n type: SpaceSeparatedTokens.type,\n options: { unique: true },\n },\n ],\n [\n \"form\",\n {\n type: ID.type,\n },\n ],\n [\n \"name\",\n {\n type: Text.type,\n },\n ],\n ],\n },\n progress: {\n globalAttributes: true,\n attributes: [\n [\n \"value\",\n {\n type: FloatingPointNumber.type,\n },\n ],\n [\n \"max\",\n {\n type: FloatingPointNumber.type,\n },\n ],\n ],\n },\n meter: {\n globalAttributes: true,\n attributes: [\n [\n \"value\",\n {\n type: FloatingPointNumber.type,\n },\n ],\n [\n \"min\",\n {\n type: FloatingPointNumber.type,\n },\n ],\n [\n \"max\",\n {\n type: FloatingPointNumber.type,\n },\n ],\n [\n \"low\",\n {\n type: FloatingPointNumber.type,\n },\n ],\n [\n \"high\",\n {\n type: FloatingPointNumber.type,\n },\n ],\n [\n \"optimum\",\n {\n type: FloatingPointNumber.type,\n },\n ],\n ],\n },\n fieldset: {\n globalAttributes: true,\n attributes: [\n [\n \"disabled\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"form\",\n {\n type: ID.type,\n },\n ],\n [\n \"name\",\n {\n type: Text.type,\n },\n ],\n ],\n },\n legend: { globalAttributes: true, attributes: empty },\n selectedcontent: { globalAttributes: true, attributes: empty },\n details: {\n globalAttributes: true,\n attributes: [\n [\n \"open\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"name\",\n {\n type: Text.type,\n },\n ],\n ],\n },\n summary: { globalAttributes: true, attributes: empty },\n dialog: {\n globalAttributes: true,\n attributes: [\n [\n \"open\",\n {\n type: BooleanAttribute.type,\n },\n ],\n ],\n },\n script: {\n globalAttributes: true,\n attributes: [\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"type\",\n {\n type: OrValidator.type,\n items: [\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"module\", \"importmap\", \"speculationrules\"],\n },\n },\n {\n type: MIMEType.type,\n },\n ],\n },\n ],\n // TODO: conditional - only meaningful for classic scripts (not type=\"module\")\n [\n \"nomodule\",\n {\n type: BooleanAttribute.type,\n },\n ],\n // TODO: conditional - applicable when src attribute is present or type=\"module\"\n [\n \"async\",\n {\n type: BooleanAttribute.type,\n },\n ],\n // TODO: conditional - only applicable to classic scripts (not type=\"module\")\n [\n \"defer\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"crossorigin\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"\", \"anonymous\", \"use-credentials\"],\n },\n },\n ],\n [\n \"integrity\",\n {\n type: Text.type,\n },\n ],\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n },\n ],\n [\n \"blocking\",\n {\n type: SpaceSeparatedTokens.type,\n options: { unique: true },\n },\n ],\n [\n \"fetchpriority\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"high\", \"low\", \"auto\"],\n },\n },\n ],\n ],\n },\n noscript: { globalAttributes: true, attributes: empty },\n template: {\n globalAttributes: true,\n attributes: [\n [\n \"shadowrootmode\",\n {\n type: EnumeratedAttribute.type,\n options: {\n keywords: [\"open\", \"closed\"],\n },\n },\n ],\n [\n \"shadowrootdelegatesfocus\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"shadowrootclonable\",\n {\n type: BooleanAttribute.type,\n },\n ],\n [\n \"shadowrootserializable\",\n {\n type: BooleanAttribute.type,\n },\n ],\n ],\n },\n slot: {\n globalAttributes: true,\n attributes: [\n [\n \"name\",\n {\n type: Text.type,\n },\n ],\n ],\n },\n canvas: {\n globalAttributes: true,\n attributes: [\n [\n \"width\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n [\n \"height\",\n {\n type: NonNegativeInteger.type,\n options: {},\n },\n ],\n ],\n },\n};\n","import { AttributeSpec } from \"./attribute-spec.js\";\nimport type { AnyAttribute } from \"./validators/any-attribute.js\";\nimport { globalAttributes } from \"./global-attributes.js\";\nimport { elementSpecDefinitionMap } from \"../element/element-definitions.js\";\nimport type { ElementState } from \"../element/element-state.js\";\nimport * as types from \"../types/index.js\";\n\nexport class AttributeSpecMap implements types.AttributeSpecMap {\n constructor(private state: ElementState) {}\n\n private getSpecDefinition(): types.ElementSpecDefinition | null {\n const spec = elementSpecDefinitionMap[this.state.name];\n return spec ?? null;\n }\n\n get = (key: string): types.AttributeSpec | null => {\n const def = this.getSpecDefinition();\n if (!def) {\n return null;\n }\n let spec: AnyAttribute | null = null;\n if (def.globalAttributes) {\n spec = globalAttributes.get(key) ?? null;\n if (spec) {\n return new AttributeSpec(key, spec);\n }\n }\n spec = def?.attributes.find(([k]) => key.toLowerCase() === k)?.[1] ?? null;\n if (spec) {\n return new AttributeSpec(key, spec);\n }\n return null;\n };\n has = (key: string): boolean => {\n const def = this.getSpecDefinition();\n if (def?.globalAttributes) {\n const has = globalAttributes.has(key);\n if (has) {\n return true;\n }\n }\n const found = def?.attributes.find(([k]) => key.toLowerCase() === k);\n return !!found;\n };\n}\n","import { IMPLICIT_ROLE } from \"../accessibility/implicit-role.js\";\nimport { AttributeSpecMap } from \"../attribute/attribute-spec-map.js\";\nimport { ElementState } from \"./element-state.js\";\nimport * as types from \"../types/index.js\";\n\nexport class ElementSpec implements types.ElementSpec {\n private state: ElementState;\n constructor(name: string, options: types.ElementOptions) {\n this.state = new ElementState(name, options);\n }\n\n implicitRole = () => {\n const role = IMPLICIT_ROLE[this.state.name];\n if (role) {\n return role(this.state);\n }\n return null;\n };\n\n get attributes() {\n return new AttributeSpecMap(this.state);\n }\n}\n","import { ElementSpec } from \"./element-spec.js\";\nimport type { ElementOptions } from \"../types/index.js\";\n\nexport function element(name: string, options: ElementOptions = {}) {\n return new ElementSpec(name, options);\n}\n"],"mappings":"ubAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,ICCO,IAAMI,EAAa,CACxB,QAAS,UACT,WAAY,aACZ,OAAQ,SACR,QAAS,UACT,KAAM,OACN,SAAU,WACV,KAAM,OACN,SAAU,WACV,cAAe,gBACf,YAAa,cACb,SAAU,WACV,OAAQ,SACR,SAAU,WACV,SAAU,WACV,OAAQ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ACE,YACA,CACE,KAAMC,EAAiB,IACzB,CACF,EACA,CACE,kBACA,CACE,KAAMD,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,OAAQ,QAAS,gBAAgB,CAC9C,CACF,CACF,EACA,CACE,MACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,MAAO,MAAO,MAAM,CACjC,CACF,CACF,EACA,CACE,YACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,OAAQ,OAAO,CAC5B,CACF,CACF,EACA,CACE,eACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,QAAS,OAAQ,KAAM,OAAQ,WAAY,SAAU,MAAM,CACxE,CACF,CACF,EACA,CACE,gBACA,CACE,KAAME,EAAmB,KACzB,QAAS,CACP,IAAK,EACL,IAAK,CACP,CACF,CACF,EACA,CACE,eACA,CACE,KAAMD,EAAiB,IACzB,CACF,EACA,CACE,SACA,CACE,KAAMD,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,GAAI,cAAe,QAAQ,CACxC,CACF,CACF,EACA,CACE,QACA,CACE,KAAMC,EAAiB,IACzB,CACF,EACA,CACE,YACA,CACE,KAAMD,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,OACA,OACA,MACA,MACA,QACA,UACA,UACA,QACF,CACF,CACF,CACF,EACA,CACE,KACA,CACE,KAAMG,EAAK,IACb,CACF,EACA,CAAC,SAAUC,EAAS,6BAA6B,EACjD,CACE,WACA,CACE,KAAMN,EAAqB,KAC3B,QAAS,CAAE,OAAQ,EAAK,CAC1B,CACF,EACA,CACE,UACA,CACE,KAAMA,EAAqB,KAC3B,QAAS,CAAE,OAAQ,EAAK,CAC1B,CACF,EACA,CACE,YACA,CACE,KAAMG,EAAiB,IACzB,CACF,EAMA,CACE,WACA,CACE,KAAMH,EAAqB,KAC3B,QAAS,CACP,OAAQ,GACR,cAAcC,EAAO,CAEnB,GAAI,CACF,WAAI,IAAIA,CAA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AC,OAAQF,EAAS,qCAAqC,EACvD,CACE,cACA,CACE,KAAME,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,GAAI,YAAa,iBAAiB,CAC/C,CACF,CACF,EACA,CACE,MACA,CACE,KAAMC,EAAqB,KAC3B,QAAS,CACP,OAAQ,EAuBV,CACF,CACF,EACA,CACE,QACA,CACE,KAAMC,EAAe,IACvB,CACF,EACA,CACE,YACA,CACE,KAAMC,EAAK,IACb,CACF,EACA,CACE,WACA,CACE,KAAMC,EAAM,IACd,CACF,EACA,CACE,OACA,CACE,KAAMC,EAAS,IACjB,CACF,EACA,CACE,iBACA,CACE,KAAML,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,GACA,cACA,6BACA,cACA,SACA,gBACA,2BACA,kCACA,YACF,CACF,CACF,CACF,EACA,CACE,QACA,CACE,KAAMC,EAAqB,KAC3B,QAAS,CACP,OAAQ,GACR,cAAcK,EAAe,CAE3B,GAAIA,EAAM,YAAY,IAAM,MAC1B,MAAO,GAKT,IAAMC,EAAmB,iCACnBC,EAAQF,EAAM,MAAMC,CAAgB,EAE1C,GAAI,CAACC,EACH,MAAO,GAIT,GAAM,CAAC,CAAEC,EAAOC,CAAM,EAAIF,EAC1B,MACG,EAAAC,EAAM,OAAS,GAAKA,EAAM,WAAW,GAAG,GACxCC,EAAO,OAAS,GAAKA,EAAO,WAAW,GAAG,EAM/C,CACF,CACF,CACF,EAEA,CACE,cACA,CACE,KAAMC,EAAgB,IACxB,CACF,EAEA,CACE,aACA,CACE,KAAMC,EAAe,IACvB,CACF,EAEA,CACE,KACA,CACE,KAAMZ,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,QACA,OACA,QACA,SACA,QACA,QACA,OACA,QACA,eACA,eACA,SACA,gBACA,eACA,QACF,CACF,CACF,CACF,EACA,CACE,WACA,CACE,KAAMC,EAAqB,KAC3B,QAAS,CAAE,OAAQ,GAAM,QAAS,CAAC,QAAQ,CAAE,CAC/C,CACF,EACA,CACE,QACA,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a,EAAgB,IACxB,CACF,EAEA,CACE,QACA,CACE,KAAMC,EAAe,IACvB,CACF,EACA,CACE,QACA,CACE,KAAMO,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,SACA,CACE,KAAMA,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,CACF,CACF,EACA,IAAK,CACH,iBAAkB,GAClB,WAAY,CACV,CACE,MACA,CACE,KAAMhB,EAAK,IACb,CACF,EACA,CAAC,MAAOL,EAAS,qCAAqC,EACtD,CACE,SACA,CACE,KAAMa,EAAgB,IACxB,CACF,EACA,CACE,QACA,CACE,KAAMC,EAAe,IACvB,CACF,EACA,CACE,cACA,CACE,KAAMZ,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,GAAI,YAAa,iBAAiB,CAC/C,CACF,CACF,EAEA,CACE,SACA,CACE,KAAMoB,EAAkB,IAC1B,CACF,EAEA,CACE,QACA,CACE,KAAMN,EAAiB,IACzB,CACF,EACA,CACE,QACA,CACE,KAAMK,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,SACA,CACE,KAAMA,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,iBACA,CACE,KAAMnB,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,GACA,cACA,6BACA,cACA,SACA,gBACA,2BACA,kCACA,YACF,CACF,CACF,CACF,EACA,CACE,WACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,OAAQ,QAAS,MAAM,CACpC,CACF,CACF,EACA,CACE,UACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,QAAS,MAAM,CAC5B,CACF,CACF,EACA,CACE,gBACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,OAAQ,MAAO,MAAM,CAClC,CACF,CACF,CACF,CACF,EACA,OAAQ,CACN,iBAAkB,GAClB,WAAY,CACV,CAAC,MAAOF,EAAS,qCAAqC,EACtD,CACE,SACA,CACE,KAAMK,EAAK,IACb,CACF,EACA,CACE,OACA,CACE,KAAM,MACN,MAAO,CACL,CACE,KAAMJ,EAAoB,IAC5B,EACA,CACE,KAAMC,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,SAAU,QAAS,UAAW,MAAM,CACjD,CACF,CACF,CACF,CACF,EACA,CACE,UACA,CACE,KAAMC,EAAqB,KAC3B,QAAS,CACP,OAAQ,GACR,QAAS,CACP,kBACA,cACA,eACA,yBACA,qBACA,eACA,iCACA,qBACA,oBACA,gBACA,uBACA,0CACA,0CACF,CACF,CACF,CACF,EACA,CACE,QACA,CACE,KAAME,EAAK,IACb,CACF,EACA,CACE,kBACA,CACE,KAAMW,EAAiB,IACzB,CACF,EACA,CACE,QACA,CACE,KAAMK,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,SACA,CACE,KAAMA,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,iBACA,CACE,KAAMnB,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,GACA,cACA,6BACA,cACA,SACA,gBACA,2BACA,kCACA,YACF,CACF,CACF,CACF,EACA,CACE,UACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,QAAS,MAAM,CAC5B,CACF,CACF,CACF,CACF,EACA,MAAO,CACL,iBAAkB,GAClB,WAAY,CACV,CAAC,MAAOF,EAAS,qCAAqC,EACtD,CACE,OACA,CACE,KAAMO,EAAS,IACjB,CACF,EACA,CACE,QACA,CACE,KAAMc,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,SACA,CACE,KAAMA,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,CACF,CACF,EACA,OAAQ,CACN,iBAAkB,GAClB,WAAY,CACV,CAAC,OAAQrB,EAAS,qCAAqC,EACvD,CACE,OACA,CACE,KAAMO,EAAS,IACjB,CACF,EACA,CACE,OACA,CACE,KAAM,MACN,MAAO,CACL,CACE,KAAMN,EAAoB,IAC5B,EACA,CACE,KAAMC,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,SAAU,QAAS,UAAW,MAAM,CACjD,CACF,CACF,CACF,CACF,EAEA,CACE,OACA,CACE,KAAMqB,EAAG,IACX,CACF,EACA,CACE,QACA,CACE,KAAMF,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,SACA,CACE,KAAMA,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,CACF,CACF,EACA,MAAO,CACL,iBAAkB,GAClB,WAAY,CACV,CAAC,MAAOrB,EAAS,qCAAqC,EACtD,CACE,cACA,CACE,KAAME,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,GAAI,YAAa,iBAAiB,CAC/C,CACF,CACF,EACA,CAAC,SAAUF,EAAS,qCAAqC,EACzD,CACE,UACA,CACE,KAAME,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,GAAI,OAAQ,WAAY,MAAM,CAC3C,CACF,CACF,EACA,CACE,WACA,CACE,KAAMc,EAAiB,IACzB,CACF,EACA,CACE,cACA,CACE,KAAMA,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMA,EAAiB,IACzB,CACF,EACA,CACE,QACA,CACE,KAAMA,EAAiB,IACzB,CACF,EACA,CACE,WACA,CACE,KAAMA,EAAiB,IACzB,CACF,EACA,CACE,QACA,CACE,KAAMK,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,SACA,CACE,KAAMA,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,CACF,CACF,EACA,MAAO,CACL,iBAAkB,GAClB,WAAY,CACV,CAAC,MAAOrB,EAAS,qCAAqC,EACtD,CACE,cACA,CACE,KAAME,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,GAAI,YAAa,iBAAiB,CAC/C,CACF,CACF,EACA,CACE,UACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,GAAI,OAAQ,WAAY,MAAM,CAC3C,CACF,CACF,EACA,CACE,WACA,CACE,KAAMc,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMA,EAAiB,IACzB,CACF,EACA,CACE,QACA,CACE,KAAMA,EAAiB,IACzB,CACF,EACA,CACE,WACA,CACE,KAAMA,EAAiB,IACzB,CACF,CACF,CACF,EACA,MAAO,CACL,iBAAkB,GAClB,WAAY,CACV,CACE,OACA,CACE,KAAMd,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,YACA,WACA,eACA,WACA,UACF,CACF,CACF,CACF,EACA,CAAC,MAAOF,EAAS,qCAAqC,EACtD,CACE,UACA,CACE,KAAMM,EAAM,IACd,CACF,EACA,CACE,QACA,CACE,KAAMD,EAAK,IACb,CACF,EACA,CACE,UACA,CACE,KAAMW,EAAiB,IACzB,CACF,CACF,CACF,EACA,IAAK,CACH,iBAAkB,GAClB,WAAY,CACV,CACE,OACA,CACE,KAAMX,EAAK,IACb,CACF,CACF,CACF,EACA,KAAM,CACJ,iBAAkB,GAClB,WAAY,CACV,CACE,MACA,CACE,KAAMA,EAAK,IACb,CACF,EACA,CACE,SACA,CACE,KAAMmB,EAAwB,IAChC,CACF,EACA,CACE,QACA,CACE,KAAMtB,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,SAAU,UAAW,OAAQ,MAAM,CAChD,CACF,CACF,EACA,CAAC,OAAQF,EAAS,6BAA6B,EAE/C,CACE,SACA,CACE,KAAM,MACN,MAAO,CACL,CACE,KAAMC,EAAoB,IAC5B,EACA,CACE,KAAMC,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,SAAU,QAAS,UAAW,MAAM,CACjD,CACF,CACF,CACF,CACF,EAEA,CACE,WACA,CACE,KAAMG,EAAK,IACb,CACF,EAEA,CACE,OACA,CACE,KAAMF,EAAqB,KAC3B,QAAS,CACP,OAAQ,GACR,cAAcK,EAAe,CAG3B,GAAIA,EAAM,SAAW,EACnB,MAAO,GAGT,GAAI,CACF,IAAMU,EAAM,IAAI,IAAIV,CAAK,EAEzB,OAAOU,EAAI,WAAa,SAAWA,EAAI,WAAa,QACtD,OAAQC,EAAA,CAEN,MAAO,EACT,CACF,CACF,CACF,CACF,EAEA,CACE,MACA,CACE,KAAMhB,EAAqB,KAC3B,QAAS,CACP,OAAQ,GACR,QAAS,CACP,YACA,SACA,WACA,WACA,OACA,UACA,OACA,WACA,WACA,aACA,SACA,OACA,iBACA,SACA,MACA,kBACF,CACF,CACF,CACF,EAEA,CACE,iBACA,CACE,KAAMD,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,GACA,cACA,6BACA,cACA,SACA,gBACA,2BACA,kCACA,YACF,CACF,CACF,CACF,CACF,CACF,EACA,MAAO,CAAE,iBAAkB,GAAM,WAAYJ,CAAM,EACnD,QAAS,CAAE,iBAAkB,GAAM,WAAYA,CAAM,EACrD,SAAU,CACR,iBAAkB,GAClB,WAAY,CACV,CACE,OACA,CACE,KAAMuB,EAAmB,KACzB,QAAS,CACP,IAAK,CACP,CACF,CACF,CACF,CACF,EACA,IAAK,CACH,iBAAkB,GAClB,WAAY,CACV,CACE,OACA,CACE,KAAMA,EAAmB,KACzB,QAAS,CACP,IAAK,CACP,CACF,CACF,CACF,CACF,EACA,MAAO,CAAE,iBAAkB,GAAM,WAAYvB,CAAM,EACnD,MAAO,CAAE,iBAAkB,GAAM,WAAYA,CAAM,EACnD,MAAO,CAAE,iBAAkB,GAAM,WAAYA,CAAM,EACnD,GAAI,CAAE,iBAAkB,GAAM,WAAYA,CAAM,EAChD,GAAI,CACF,iBAAkB,GAClB,WAAY,CACV,CACE,UACA,CACE,KAAMuB,EAAmB,KACzB,QAAS,CACP,IAAK,CACP,CACF,CACF,EACA,CACE,UACA,CACE,KAAMA,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,UACA,CACE,KAAMlB,EAAqB,KAC3B,QAAS,CAAE,OAAQ,EAAK,CAC1B,CACF,CACF,CACF,EACA,GAAI,CACF,iBAAkB,GAClB,WAAY,CACV,CACE,UACA,CACE,KAAMkB,EAAmB,KACzB,QAAS,CACP,IAAK,CACP,CACF,CACF,EACA,CACE,UACA,CACE,KAAMA,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,UACA,CACE,KAAMlB,EAAqB,KAC3B,QAAS,CAAE,OAAQ,EAAK,CAC1B,CACF,EACA,CACE,QACA,CACE,KAAMD,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,MAAO,MAAO,WAAY,UAAU,CACjD,CACF,CACF,EACA,CACE,OACA,CACE,KAAMG,EAAK,IACb,CACF,CACF,CACF,EACA,KAAM,CACJ,iBAAkB,GAClB,WAAY,CACV,CACE,iBACA,CACE,KAAMF,EAAqB,KAC3B,QAAS,CAAE,OAAQ,EAAK,CAC1B,CACF,EACA,CAAC,SAAUH,EAAS,qCAAqC,EACzD,CACE,eACA,CACE,KAAME,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,KAAM,KAAK,CACxB,CACF,CACF,EACA,CACE,UACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,oCACA,sBACA,YACF,CACF,CACF,CACF,EACA,CACE,SACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,MAAO,OAAQ,QAAQ,CACpC,CACF,CACF,EACA,CACE,OACA,CACE,KAAMG,EAAK,IACb,CACF,EACA,CACE,aACA,CACE,KAAMW,EAAiB,IACzB,CACF,EACA,CACE,SACA,CACE,KAAM,MACN,MAAO,CACL,CACE,KAAMf,EAAoB,IAC5B,EACA,CACE,KAAMC,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,SAAU,QAAS,UAAW,MAAM,CACjD,CACF,CACF,CACF,CACF,EACA,CACE,MACA,CACE,KAAMC,EAAqB,KAC3B,QAAS,CACP,OAAQ,GACR,QAAS,CACP,WACA,OACA,UACA,OACA,WACA,WACA,aACA,SACA,OACA,QACF,CACF,CACF,CACF,CACF,CACF,EACA,MAAO,CACL,iBAAkB,GAClB,WAAY,CACV,CACE,MACA,CACE,KAAMoB,EAAG,IACX,CACF,CACF,CACF,EACA,MAAO,CACL,iBAAkB,GAClB,WAAY,CAEV,CACE,SACA,CACE,KAAME,EAAqB,IAC7B,CACF,EAEA,CACE,MACA,CACE,KAAMpB,EAAK,IACb,CACF,EACA,CACE,eACA,CACE,KAAMqB,EAAsB,IAC9B,CACF,EAEA,CACE,UACA,CACE,KAAMV,EAAiB,IACzB,CACF,EACA,CACE,UACA,CACE,KAAMX,EAAK,IACb,CACF,EACA,CACE,WACA,CACE,KAAMW,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMO,EAAG,IACX,CACF,EACA,CAAC,aAAcvB,EAAS,qCAAqC,EAC7D,CACE,cACA,CACE,KAAME,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,oCACA,sBACA,YACF,CACF,CACF,CACF,EACA,CACE,aACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,MAAO,OAAQ,QAAQ,CACpC,CACF,CACF,EACA,CACE,iBACA,CACE,KAAMc,EAAiB,IACzB,CACF,EACA,CACE,aACA,CACE,KAAM,MACN,MAAO,CACL,CACE,KAAMf,EAAoB,IAC5B,EACA,CACE,KAAMC,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,SAAU,QAAS,UAAW,MAAM,CACjD,CACF,CACF,CACF,CACF,EAEA,CACE,SACA,CACE,KAAMmB,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,OACA,CACE,KAAME,EAAG,IACX,CACF,EAEA,CACE,MACA,CAEE,KAAMlB,EAAK,IACb,CACF,EACA,CACE,YACA,CACE,KAAMgB,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EAEA,CACE,MACA,CAEE,KAAMhB,EAAK,IACb,CACF,EACA,CACE,YACA,CACE,KAAMgB,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EAEA,CACE,WACA,CACE,KAAML,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMX,EAAK,IACb,CACF,EAEA,CACE,UACA,CACE,KAAMsB,EAAkB,IAC1B,CACF,EACA,CACE,cACA,CACE,KAAMtB,EAAK,IACb,CACF,EACA,CACE,gBACA,CACE,KAAMA,EAAK,IACb,CACF,EACA,CACE,sBACA,CACE,KAAMH,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,OAAQ,OAAQ,QAAQ,CACrC,CACF,CACF,EACA,CACE,WACA,CACE,KAAMc,EAAiB,IACzB,CACF,EACA,CACE,WACA,CACE,KAAMA,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMK,EAAmB,KACzB,QAAS,CACP,IAAK,CACP,CACF,CACF,EAEA,CAAC,MAAOrB,EAAS,qCAAqC,EAEtD,CACE,OACA,CACE,KAAM,MACN,MAAO,CACL,CACE,KAAM4B,EAAoB,IAC5B,EACA,CACE,KAAM1B,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,KAAK,CAClB,CACF,CACF,CACF,CACF,EACA,CACE,OACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,SACA,OACA,SACA,MACA,MACA,QACA,WACA,OACA,QACA,OACA,OACA,iBACA,SACA,QACA,QACA,WACA,QACA,OACA,SACA,QACA,QACA,QACF,CACF,CACF,CACF,EACA,CACE,QACA,CACE,KAAMG,EAAK,IACb,CACF,EAEA,CACE,QACA,CACE,KAAMgB,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,CACF,CACF,EACA,OAAQ,CACN,iBAAkB,GAClB,WAAY,CACV,CACE,WACA,CACE,KAAML,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMO,EAAG,IACX,CACF,EAEA,CAAC,aAAcvB,EAAS,qCAAqC,EAE7D,CACE,cACA,CACE,KAAME,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,oCACA,sBACA,YACF,CACF,CACF,CACF,EAEA,CACE,aACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,MAAO,OAAQ,QAAQ,CACpC,CACF,CACF,EAEA,CACE,iBACA,CACE,KAAMc,EAAiB,IACzB,CACF,EAEA,CACE,aACA,CACE,KAAM,MACN,MAAO,CACL,CACE,KAAMf,EAAoB,IAC5B,EACA,CACE,KAAMC,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,SAAU,QAAS,UAAW,MAAM,CACjD,CACF,CACF,CACF,CACF,EACA,CACE,OACA,CACE,KAAMG,EAAK,IACb,CACF,EACA,CACE,gBACA,CACE,KAAMA,EAAK,IACb,CACF,EACA,CACE,sBACA,CACE,KAAMH,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,OAAQ,OAAQ,QAAQ,CACrC,CACF,CACF,EACA,CACE,OACA,CACE,KAAMA,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,SAAU,QAAS,QAAQ,CACxC,CACF,CACF,EACA,CACE,QACA,CACE,KAAMG,EAAK,IACb,CACF,CACF,CACF,EACA,OAAQ,CACN,iBAAkB,GAClB,WAAY,CACV,CACE,eACA,CACE,KAAMqB,EAAsB,IAC9B,CACF,EACA,CACE,WACA,CACE,KAAMV,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMO,EAAG,IACX,CACF,EACA,CACE,WACA,CACE,KAAMP,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMX,EAAK,IACb,CACF,EACA,CACE,WACA,CACE,KAAMW,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMK,EAAmB,KACzB,QAAS,CACP,IAAK,CACP,CACF,CACF,CACF,CACF,EACA,SAAU,CAAE,iBAAkB,GAAM,WAAYvB,CAAM,EACtD,SAAU,CACR,iBAAkB,GAClB,WAAY,CACV,CACE,WACA,CACE,KAAMkB,EAAiB,IACzB,CACF,EACA,CACE,QACA,CACE,KAAMX,EAAK,IACb,CACF,CACF,CACF,EACA,OAAQ,CACN,iBAAkB,GAClB,WAAY,CACV,CACE,WACA,CACE,KAAMW,EAAiB,IACzB,CACF,EACA,CACE,QACA,CACE,KAAMX,EAAK,IACb,CACF,EACA,CACE,WACA,CACE,KAAMW,EAAiB,IACzB,CACF,EACA,CACE,QACA,CACE,KAAMX,EAAK,IACb,CACF,CACF,CACF,EACA,SAAU,CACR,iBAAkB,GAClB,WAAY,CACV,CACE,eACA,CACE,KAAMqB,EAAsB,IAC9B,CACF,EACA,CACE,OACA,CACE,KAAML,EAAmB,KACzB,QAAS,CACP,IAAK,CACP,CACF,CACF,EACA,CACE,UACA,CACE,KAAMhB,EAAK,IACb,CACF,EACA,CACE,WACA,CACE,KAAMW,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMO,EAAG,IACX,CACF,EACA,CACE,YACA,CACE,KAAMF,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,YACA,CACE,KAAMA,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,OACA,CACE,KAAMhB,EAAK,IACb,CACF,EACA,CACE,cACA,CACE,KAAMA,EAAK,IACb,CACF,EACA,CACE,WACA,CACE,KAAMW,EAAiB,IACzB,CACF,EACA,CACE,WACA,CACE,KAAMA,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMK,EAAmB,KACzB,QAAS,CACP,IAAK,CACP,CACF,CACF,EACA,CACE,OACA,CACE,KAAMnB,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,OAAQ,MAAM,CAC3B,CACF,CACF,CACF,CACF,EACA,OAAQ,CACN,iBAAkB,GAClB,WAAY,CACV,CACE,MACA,CACE,KAAMC,EAAqB,KAC3B,QAAS,CAAE,OAAQ,EAAK,CAC1B,CACF,EACA,CACE,OACA,CACE,KAAMoB,EAAG,IACX,CACF,EACA,CACE,OACA,CACE,KAAMlB,EAAK,IACb,CACF,CACF,CACF,EACA,SAAU,CACR,iBAAkB,GAClB,WAAY,CACV,CACE,QACA,CACE,KAAMuB,EAAoB,IAC5B,CACF,EACA,CACE,MACA,CACE,KAAMA,EAAoB,IAC5B,CACF,CACF,CACF,EACA,MAAO,CACL,iBAAkB,GAClB,WAAY,CACV,CACE,QACA,CACE,KAAMA,EAAoB,IAC5B,CACF,EACA,CACE,MACA,CACE,KAAMA,EAAoB,IAC5B,CACF,EACA,CACE,MACA,CACE,KAAMA,EAAoB,IAC5B,CACF,EACA,CACE,MACA,CACE,KAAMA,EAAoB,IAC5B,CACF,EACA,CACE,OACA,CACE,KAAMA,EAAoB,IAC5B,CACF,EACA,CACE,UACA,CACE,KAAMA,EAAoB,IAC5B,CACF,CACF,CACF,EACA,SAAU,CACR,iBAAkB,GAClB,WAAY,CACV,CACE,WACA,CACE,KAAMZ,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMO,EAAG,IACX,CACF,EACA,CACE,OACA,CACE,KAAMlB,EAAK,IACb,CACF,CACF,CACF,EACA,OAAQ,CAAE,iBAAkB,GAAM,WAAYP,CAAM,EACpD,gBAAiB,CAAE,iBAAkB,GAAM,WAAYA,CAAM,EAC7D,QAAS,CACP,iBAAkB,GAClB,WAAY,CACV,CACE,OACA,CACE,KAAMkB,EAAiB,IACzB,CACF,EACA,CACE,OACA,CACE,KAAMX,EAAK,IACb,CACF,CACF,CACF,EACA,QAAS,CAAE,iBAAkB,GAAM,WAAYP,CAAM,EACrD,OAAQ,CACN,iBAAkB,GAClB,WAAY,CACV,CACE,OACA,CACE,KAAMkB,EAAiB,IACzB,CACF,CACF,CACF,EACA,OAAQ,CACN,iBAAkB,GAClB,WAAY,CACV,CAAC,MAAOhB,EAAS,qCAAqC,EACtD,CACE,OACA,CACE,KAAM6B,EAAY,KAClB,MAAO,CACL,CACE,KAAM3B,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,SAAU,YAAa,kBAAkB,CACtD,CACF,EACA,CACE,KAAMK,EAAS,IACjB,CACF,CACF,CACF,EAEA,CACE,WACA,CACE,KAAMS,EAAiB,IACzB,CACF,EAEA,CACE,QACA,CACE,KAAMA,EAAiB,IACzB,CACF,EAEA,CACE,QACA,CACE,KAAMA,EAAiB,IACzB,CACF,EACA,CACE,cACA,CACE,KAAMd,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,GAAI,YAAa,iBAAiB,CAC/C,CACF,CACF,EACA,CACE,YACA,CACE,KAAMG,EAAK,IACb,CACF,EACA,CACE,iBACA,CACE,KAAMH,EAAoB,KAC1B,QAAS,CACP,SAAU,CACR,GACA,cACA,6BACA,cACA,SACA,gBACA,2BACA,kCACA,YACF,CACF,CACF,CACF,EACA,CACE,WACA,CACE,KAAMC,EAAqB,KAC3B,QAAS,CAAE,OAAQ,EAAK,CAC1B,CACF,EACA,CACE,gBACA,CACE,KAAMD,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,OAAQ,MAAO,MAAM,CAClC,CACF,CACF,CACF,CACF,EACA,SAAU,CAAE,iBAAkB,GAAM,WAAYJ,CAAM,EACtD,SAAU,CACR,iBAAkB,GAClB,WAAY,CACV,CACE,iBACA,CACE,KAAMI,EAAoB,KAC1B,QAAS,CACP,SAAU,CAAC,OAAQ,QAAQ,CAC7B,CACF,CACF,EACA,CACE,2BACA,CACE,KAAMc,EAAiB,IACzB,CACF,EACA,CACE,qBACA,CACE,KAAMA,EAAiB,IACzB,CACF,EACA,CACE,yBACA,CACE,KAAMA,EAAiB,IACzB,CACF,CACF,CACF,EACA,KAAM,CACJ,iBAAkB,GAClB,WAAY,CACV,CACE,OACA,CACE,KAAMX,EAAK,IACb,CACF,CACF,CACF,EACA,OAAQ,CACN,iBAAkB,GAClB,WAAY,CACV,CACE,QACA,CACE,KAAMgB,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,EACA,CACE,SACA,CACE,KAAMA,EAAmB,KACzB,QAAS,CAAC,CACZ,CACF,CACF,CACF,CACF,EChtEO,IAAMS,EAAN,KAAyD,CAC9D,YAAoBC,EAAqB,CAArB,WAAAA,EAOpB,SAAOC,GAA4C,CAfrD,IAAAC,EAAAC,EAAAC,EAgBI,IAAMC,EAAM,KAAK,kBAAkB,EACnC,GAAI,CAACA,EACH,OAAO,KAET,IAAIC,EAA4B,KAChC,OAAID,EAAI,mBACNC,GAAOJ,EAAAK,GAAiB,IAAIN,CAAG,IAAxB,KAAAC,EAA6B,KAChCI,GACK,IAAIE,EAAcP,EAAKK,CAAI,GAGtCA,GAAOF,GAAAD,EAAAE,GAAA,YAAAA,EAAK,WAAW,KAAK,CAAC,CAACI,CAAC,IAAMR,EAAI,YAAY,IAAMQ,KAApD,YAAAN,EAAyD,KAAzD,KAAAC,EAA+D,KAClEE,EACK,IAAIE,EAAcP,EAAKK,CAAI,EAE7B,KACT,EACA,SAAOL,GAAyB,CAC9B,IAAMI,EAAM,KAAK,kBAAkB,EACnC,OAAIA,GAAA,MAAAA,EAAK,kBACKE,GAAiB,IAAIN,CAAG,EAE3B,GAIJ,CAAC,EADMI,GAAA,YAAAA,EAAK,WAAW,KAAK,CAAC,CAACI,CAAC,IAAMR,EAAI,YAAY,IAAMQ,GAEpE,CAnC0C,CAElC,mBAAwD,CAC9D,IAAMH,EAAOI,GAAyB,KAAK,MAAM,IAAI,EACrD,OAAOJ,GAAA,KAAAA,EAAQ,IACjB,CA+BF,ECvCO,IAAMK,GAAN,KAA+C,CAEpD,YAAYC,EAAcC,EAA+B,CAIzD,kBAAe,IAAM,CACnB,IAAMC,EAAOC,GAAc,KAAK,MAAM,IAAI,EAC1C,OAAID,EACKA,EAAK,KAAK,KAAK,EAEjB,IACT,EATE,KAAK,MAAQ,IAAIE,EAAaJ,EAAMC,CAAO,CAC7C,CAUA,IAAI,YAAa,CACf,OAAO,IAAII,EAAiB,KAAK,KAAK,CACxC,CACF,ECnBO,SAASC,GAAQC,EAAcC,EAA0B,CAAC,EAAG,CAClE,OAAO,IAAIC,GAAYF,EAAMC,CAAO,CACtC","names":["index_exports","__export","element","__toCommonJS","ARIA_ROLES","DEFAULT_ATTRIBUTES_OPTIONS","_","AttributesState","options","DEFAULT_ATTRIBUTES_OPTIONS","key","ElementState","_ElementState","name","options","AttributesState","first","_a","_b","IMPLICIT_ROLE","element","ARIA_ROLES","sectioningElements","ancestor","VALID","valid","invalid","reason","BooleanAttribute","attributeKey","value","valid","invalid","ERROR_MESSAGES","EnumeratedAttribute","options","value","normalizedValue","valid","invalid","_SignedInteger","value","valid","invalid","SignedInteger","REGEX_ASCII_WHITESPACE","SpaceSeparatedTokens","options","value","REGEX_ASCII_WHITESPACE","tokens","token","uniqueTokens","invalid","allowedToken","valid","Text","_","valid","_ValidURL","options","value","invalid","processedValue","valid","e","i","code","ValidURL","_NonNegativeInteger","options","value","_a","_b","invalid","numValue","valid","NonNegativeInteger","ID","value","valid","_FloatingPointNumber","value","valid","invalid","FloatingPointNumber","CommaSeparatedTokens","value","valid","CSSColor","value","valid","_BCP47","value","valid","invalid","subtags","i","subtag","BCP47","_MIMEType","value","valid","invalid","MIMEType","_DateString","value","invalid","dateMatch","year","month","day","timeMatch","hour","minute","secondMatch","valid","DateString","RegularExpression","value","valid","error","invalid","HashNameReference","value","invalid","valid","_NavigableTargetName","value","invalid","valid","NavigableTargetName","SrcsetAttribute","value","invalid","candidates","i","candidate","parts","url","descriptor","widthStr","width","densityStr","density","p","valid","import_vscode_css_languageservice","MediaQueryList","value","cssText","document","stylesheet","invalid","ERROR_MESSAGES","valid","error","SourceSizeList","value","valid","FloatingPointNumberList","FloatingPointNumber","value","invalid","ERROR_MESSAGES","numbers","i","number","valid","OrValidator","options","value","lastError","item","result","createAttributeSpec","valid","invalid","_AutocompleteAttribute","value","_a","valid","normalized","tokens","REGEX_ASCII_WHITESPACE","invalid","index","hasSection","hasAddressType","hasFieldName","hasWebauthn","fieldName","token","AutocompleteAttribute","createAttributeSpec","key","def","SpaceSeparatedTokens","EnumeratedAttribute","BooleanAttribute","SignedInteger","Text","ValidURL","NonNegativeInteger","ID","FloatingPointNumber","CommaSeparatedTokens","CSSColor","BCP47","MIMEType","DateString","RegularExpression","HashNameReference","NavigableTargetName","SrcsetAttribute","MediaQueryList","SourceSizeList","FloatingPointNumberList","OrValidator","AutocompleteAttribute","AttributeSpec","key","definition","value","createAttributeSpec","globalAttributes","SpaceSeparatedTokens","value","EnumeratedAttribute","BooleanAttribute","NonNegativeInteger","Text","ValidURL","e","BCP47","SignedInteger","empty","elementSpecDefinitionMap","ValidURL","NavigableTargetName","EnumeratedAttribute","SpaceSeparatedTokens","MediaQueryList","Text","BCP47","MIMEType","value","dimensionPattern","match","width","height","SrcsetAttribute","SourceSizeList","CSSColor","BooleanAttribute","SignedInteger","url","e","DateString","NonNegativeInteger","HashNameReference","ID","FloatingPointNumberList","CommaSeparatedTokens","AutocompleteAttribute","RegularExpression","FloatingPointNumber","OrValidator","AttributeSpecMap","state","key","_a","_b","_c","def","spec","globalAttributes","AttributeSpec","k","elementSpecDefinitionMap","ElementSpec","name","options","role","IMPLICIT_ROLE","ElementState","AttributeSpecMap","element","name","options","ElementSpec"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/accessibility/aria-roles.ts","../src/shared/default-options.ts","../src/attribute/attributes-state.ts","../src/element/element-state.ts","../src/accessibility/implicit-role.ts","../src/shared/result.ts","../src/attribute/validators/boolean-attribute.ts","../src/attribute/validators/error-messages.ts","../src/attribute/validators/enumerated-attribute.ts","../src/attribute/validators/signed-integer.ts","../src/shared/regex.ts","../src/attribute/validators/space-separated-tokens.ts","../src/attribute/validators/text.ts","../src/attribute/validators/valid-url.ts","../src/attribute/validators/non-negative-integer.ts","../src/attribute/validators/id.ts","../src/attribute/validators/floating-point-number.ts","../src/attribute/validators/comma-separated-tokens.ts","../src/attribute/validators/css-color.ts","../src/attribute/validators/bcp-47.ts","../src/attribute/validators/mime-type.ts","../src/attribute/validators/date-string.ts","../src/attribute/validators/regular-expression.ts","../src/attribute/validators/hash-name-reference.ts","../src/attribute/validators/navigable-target-name.ts","../src/attribute/validators/srcset-attribute.ts","../src/attribute/validators/media-query-list.ts","../src/attribute/validators/source-size-list.ts","../src/attribute/validators/floating-point-number-list.ts","../src/attribute/validators/or-validator.ts","../src/attribute/validators/autocomplete-attribute.ts","../src/attribute/create-attribute-spec.ts","../src/attribute/attribute-spec.ts","../src/attribute/global-attributes.ts","../src/element/element-definitions.ts","../src/attribute/attribute-spec-map.ts","../src/element/element-spec.ts","../src/element/element.ts"],"sourcesContent":["export { element } from \"./element/element.js\";\n","// ARIA roles used in implicit role mapping\nexport const ARIA_ROLES = {\n ARTICLE: \"article\",\n BLOCKQUOTE: \"blockquote\",\n BUTTON: \"button\",\n CAPTION: \"caption\",\n CELL: \"cell\",\n CHECKBOX: \"checkbox\",\n CODE: \"code\",\n COMBOBOX: \"combobox\",\n COMPLEMENTARY: \"complementary\",\n CONTENTINFO: \"contentinfo\",\n DELETION: \"deletion\",\n DIALOG: \"dialog\",\n DOCUMENT: \"document\",\n EMPHASIS: \"emphasis\",\n FIGURE: \"figure\",\n FORM: \"form\",\n GENERIC: \"generic\",\n GROUP: \"group\",\n HEADING: \"heading\",\n IMG: \"img\",\n INSERTION: \"insertion\",\n LINK: \"link\",\n LIST: \"list\",\n LISTBOX: \"listbox\",\n MAIN: \"main\",\n METER: \"meter\",\n NAVIGATION: \"navigation\",\n OPTION: \"option\",\n PARAGRAPH: \"paragraph\",\n PROGRESSBAR: \"progressbar\",\n RADIO: \"radio\",\n ROW: \"row\",\n ROWGROUP: \"rowgroup\",\n SEARCH: \"search\",\n SEARCHBOX: \"searchbox\",\n SEPARATOR: \"separator\",\n SLIDER: \"slider\",\n SPINBUTTON: \"spinbutton\",\n STATUS: \"status\",\n STRONG: \"strong\",\n TABLE: \"table\",\n TERM: \"term\",\n TEXTBOX: \"textbox\",\n TIME: \"time\",\n} as const;\n","import type { AttributesOptions, ElementOptions } from \"../types/index.js\";\n\nexport const DEFAULT_ATTRIBUTES_OPTIONS: AttributesOptions = {\n get(_: string) {\n return null;\n },\n};\n\nexport const DEFAULT_ELEMENT_OPTIONS: ElementOptions = {\n attributes: {\n get(_: string) {\n return null;\n },\n },\n};\n","import { DEFAULT_ATTRIBUTES_OPTIONS } from \"../shared/default-options.js\";\nimport type { AttributesOptions, AttributeValue } from \"../types/index.js\";\n\nexport class AttributesState {\n constructor(\n private options: AttributesOptions = DEFAULT_ATTRIBUTES_OPTIONS,\n ) {}\n\n get(key: string): AttributeValue | null {\n return this.options.get(key);\n }\n\n has(key: string): boolean {\n return this.options.get(key) !== null;\n }\n}\n","import type { ElementOptions } from \"../types/index.js\";\nimport { AttributesState } from \"../attribute/attributes-state.js\";\n\nexport class ElementState {\n public readonly name: string;\n\n constructor(\n name: string,\n private options: ElementOptions,\n ) {\n this.name = name.toLowerCase();\n }\n\n get attributes(): AttributesState {\n return new AttributesState(this.options.attributes);\n }\n\n parent(): ElementState | null {\n if (!this.options.ancestors) {\n return null;\n }\n\n const iterator = this.options.ancestors()[Symbol.iterator]();\n const first = iterator.next();\n\n if (first.done || !first.value) {\n return null;\n }\n\n return new ElementState(first.value.name, first.value);\n }\n\n ancestors(): Iterable<\n {\n name: string;\n } & ElementOptions\n > {\n return this.options.ancestors?.() || [];\n }\n}\n","import { ARIA_ROLES } from \"./aria-roles.js\";\nimport { ElementState } from \"../element/element-state.js\";\n\n/**\n * https://www.w3.org/TR/html-aria/\n */\nexport const IMPLICIT_ROLE: Record<\n string,\n (element: ElementState) => string | null\n> = {\n a: (element) =>\n element.attributes.has(\"href\") ? ARIA_ROLES.LINK : ARIA_ROLES.GENERIC,\n abbr: () => null,\n address: () => ARIA_ROLES.GROUP,\n area: (element) =>\n element.attributes.has(\"href\") ? ARIA_ROLES.LINK : ARIA_ROLES.GENERIC,\n article: () => ARIA_ROLES.ARTICLE,\n aside: () => ARIA_ROLES.COMPLEMENTARY,\n audio: () => null,\n b: () => ARIA_ROLES.GENERIC,\n base: () => null,\n bdi: () => ARIA_ROLES.GENERIC,\n bdo: () => ARIA_ROLES.GENERIC,\n blockquote: () => ARIA_ROLES.BLOCKQUOTE,\n body: () => ARIA_ROLES.GENERIC,\n br: () => null,\n button: () => ARIA_ROLES.BUTTON,\n canvas: () => null,\n caption: () => ARIA_ROLES.CAPTION,\n cite: () => null,\n code: () => ARIA_ROLES.CODE,\n col: () => null,\n colgroup: () => null,\n data: () => ARIA_ROLES.GENERIC,\n datalist: () => ARIA_ROLES.LISTBOX,\n dd: () => null,\n del: () => ARIA_ROLES.DELETION,\n details: () => ARIA_ROLES.GROUP,\n dfn: () => ARIA_ROLES.TERM,\n dialog: () => ARIA_ROLES.DIALOG,\n div: () => ARIA_ROLES.GENERIC,\n dl: () => null,\n dt: () => null,\n em: () => ARIA_ROLES.EMPHASIS,\n embed: () => null,\n fieldset: () => ARIA_ROLES.GROUP,\n figcaption: () => null,\n figure: () => ARIA_ROLES.FIGURE,\n footer: (element) => {\n const sectioningElements = [\"article\", \"aside\", \"main\", \"nav\", \"section\"];\n for (const ancestor of element.ancestors()) {\n if (sectioningElements.includes(ancestor.name.toLowerCase())) {\n return ARIA_ROLES.GENERIC;\n }\n }\n return ARIA_ROLES.CONTENTINFO;\n },\n form: () => ARIA_ROLES.FORM,\n h1: () => ARIA_ROLES.HEADING,\n h2: () => ARIA_ROLES.HEADING,\n h3: () => ARIA_ROLES.HEADING,\n h4: () => ARIA_ROLES.HEADING,\n h5: () => ARIA_ROLES.HEADING,\n h6: () => ARIA_ROLES.HEADING,\n head: () => null,\n header: () => null, // TODO: banner if not descendant of article/aside/main/nav/section, otherwise generic\n hgroup: () => ARIA_ROLES.GROUP,\n hr: () => ARIA_ROLES.SEPARATOR,\n html: () => ARIA_ROLES.DOCUMENT,\n i: () => ARIA_ROLES.GENERIC,\n iframe: () => null,\n img: (element) => {\n const alt = element.attributes.get(\"alt\");\n if (alt === \"\") return null;\n return ARIA_ROLES.IMG;\n },\n input: (element) => {\n const type = element.attributes.get(\"type\") || \"text\";\n switch (type) {\n case \"button\":\n case \"image\":\n case \"reset\":\n case \"submit\":\n return ARIA_ROLES.BUTTON;\n case \"checkbox\":\n return ARIA_ROLES.CHECKBOX;\n case \"color\":\n case \"date\":\n case \"datetime-local\":\n case \"file\":\n case \"hidden\":\n case \"month\":\n case \"password\":\n case \"time\":\n case \"week\":\n return null;\n case \"email\":\n case \"tel\":\n case \"text\":\n case \"url\":\n return ARIA_ROLES.TEXTBOX;\n case \"number\":\n return ARIA_ROLES.SPINBUTTON;\n case \"radio\":\n return ARIA_ROLES.RADIO;\n case \"range\":\n return ARIA_ROLES.SLIDER;\n case \"search\":\n return ARIA_ROLES.SEARCHBOX;\n default:\n return ARIA_ROLES.TEXTBOX;\n }\n },\n ins: () => ARIA_ROLES.INSERTION,\n kbd: () => null,\n label: () => null,\n legend: () => null,\n li: () => null, // TODO: listitem if child of ol/ul/menu, otherwise generic\n link: () => null,\n main: () => ARIA_ROLES.MAIN,\n map: () => null,\n mark: () => null,\n menu: () => ARIA_ROLES.LIST,\n meta: () => null,\n meter: () => ARIA_ROLES.METER,\n nav: () => ARIA_ROLES.NAVIGATION,\n noscript: () => null,\n object: () => null,\n ol: () => ARIA_ROLES.LIST,\n optgroup: () => ARIA_ROLES.GROUP,\n option: () => ARIA_ROLES.OPTION,\n output: () => ARIA_ROLES.STATUS,\n p: () => ARIA_ROLES.PARAGRAPH,\n param: () => null,\n picture: () => null,\n pre: () => ARIA_ROLES.GENERIC,\n progress: () => ARIA_ROLES.PROGRESSBAR,\n q: () => ARIA_ROLES.GENERIC,\n rp: () => null,\n rt: () => null,\n ruby: () => null,\n s: () => ARIA_ROLES.DELETION,\n samp: () => ARIA_ROLES.GENERIC,\n script: () => null,\n search: () => ARIA_ROLES.SEARCH,\n section: () => null,\n select: (element) =>\n element.attributes.has(\"multiple\")\n ? ARIA_ROLES.LISTBOX\n : ARIA_ROLES.COMBOBOX,\n slot: () => null,\n small: () => ARIA_ROLES.GENERIC,\n span: () => ARIA_ROLES.GENERIC,\n strong: () => ARIA_ROLES.STRONG,\n style: () => null,\n sub: () => null,\n summary: () => ARIA_ROLES.BUTTON,\n sup: () => null,\n svg: () => null,\n table: () => ARIA_ROLES.TABLE,\n tbody: () => ARIA_ROLES.ROWGROUP,\n td: () => ARIA_ROLES.CELL,\n template: () => null,\n textarea: () => ARIA_ROLES.TEXTBOX,\n tfoot: () => ARIA_ROLES.ROWGROUP,\n th: () => null,\n thead: () => ARIA_ROLES.ROWGROUP,\n time: () => ARIA_ROLES.TIME,\n title: () => null,\n tr: () => ARIA_ROLES.ROW,\n track: () => null,\n u: () => null,\n ul: () => ARIA_ROLES.LIST,\n var: () => null,\n video: () => null,\n wbr: () => null,\n};\n","import type { AttributeSpecValidateResult } from \"../types/index.js\";\n\nconst VALID: AttributeSpecValidateResult = {\n valid: true,\n};\n\nexport function valid(): AttributeSpecValidateResult {\n return VALID;\n}\n\nexport function invalid(reason: string): AttributeSpecValidateResult {\n return {\n valid: false,\n reason,\n };\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\n\nexport type BooleanAttributeOptions = {\n attributeKey: string;\n};\n\n/**\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attribute\n */\nexport class BooleanAttribute implements AttributeSpec {\n static type = \"BooleanAttribute\" as const;\n\n static Type = {\n type: BooleanAttribute.type,\n };\n\n constructor(private attributeKey: string) {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (!value) {\n return valid();\n }\n\n if (this.attributeKey === value?.toLowerCase()) {\n return valid();\n }\n\n return invalid(\n `Boolean attribute value must be empty or match the attribute name \"${this.attributeKey}\", got: \"${value}\"`,\n );\n }\n}\n","/**\n * Common error messages used across attribute validators\n */\nexport const ERROR_MESSAGES = {\n VALUE_MUST_BE_STRING: \"Value must be a string\",\n VALUE_CANNOT_BE_EMPTY: \"Value cannot be empty\",\n INVALID_MEDIA_QUERY_LIST: \"Invalid media query list\",\n} as const;\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport type EnumeratedAttributeOptions = {\n keywords: string[];\n};\n\n/**\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute\n */\nexport class EnumeratedAttribute implements AttributeSpec {\n static type = \"EnumeratedAttribute\" as const;\n constructor(private options: EnumeratedAttributeOptions) {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n const normalizedValue = value.toLowerCase();\n const isValid = this.options.keywords.includes(normalizedValue);\n\n if (!isValid) {\n return invalid(\n `Value \"${value}\" is not a valid keyword. Expected one of: ${this.options.keywords.join(\", \")}`,\n );\n }\n\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * A string is a valid integer if it consists of one or more ASCII digits,\n * optionally prefixed with a U+002D HYPHEN-MINUS character (-).\n *\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#signed-integers\n */\nexport class SignedInteger implements AttributeSpec {\n static type = \"SignedInteger\" as const;\n\n static Type = {\n type: SignedInteger.type,\n };\n\n // Matches: optional hyphen-minus, followed by one or more digits\n private static readonly PATTERN = /^-?\\d+$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (!SignedInteger.PATTERN.test(value)) {\n return invalid(`Invalid signed integer: \"${value}\"`);\n }\n\n return valid();\n }\n}\n","/**\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n */\nexport const REGEX_ASCII_WHITESPACE = /[\\u0009\\u000A\\u000C\\u000D\\u0020]/;\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { REGEX_ASCII_WHITESPACE } from \"../../shared/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport type SpaceSeparatedTokensOptions = {\n unique: boolean;\n allowed?: string[];\n validateToken?: (value: string) => boolean;\n};\n\n/**\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#space-separated-tokens\n */\nexport class SpaceSeparatedTokens implements AttributeSpec {\n static type = \"SpaceSeparatedTokens\" as const;\n constructor(private options: SpaceSeparatedTokensOptions) {}\n\n private parse(value: string) {\n const tokens = value.split(REGEX_ASCII_WHITESPACE);\n return tokens;\n }\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n const tokens = this.parse(value).filter((token) => token !== \"\");\n\n // Check uniqueness\n if (this.options.unique) {\n const uniqueTokens = new Set(tokens);\n\n if (tokens.length !== uniqueTokens.size) {\n return invalid(\"Tokens must be unique\");\n }\n }\n\n // Check allowed tokens\n if (this.options.allowed) {\n for (const token of tokens) {\n const isAllowed = this.options.allowed.some((allowedToken) => {\n return token.toLowerCase() === allowedToken.toLowerCase();\n });\n\n if (!isAllowed) {\n return invalid(\n `Invalid token: \"${token}\". Allowed tokens: ${this.options.allowed.join(\", \")}`,\n );\n }\n }\n }\n // Custom token validation\n if (typeof this.options.validateToken === \"function\") {\n for (const token of tokens) {\n if (!this.options.validateToken(token)) {\n return invalid(`Invalid token: \"${token}\"`);\n }\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid } from \"../../shared/result.js\";\n\nexport class Text implements AttributeSpec {\n static type = \"Text\" as const;\n\n static Type = {\n type: Text.type,\n };\n\n validateValue(_: AttributeValue): AttributeSpecValidateResult {\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\n\nexport type ValidURLOptions = {\n /**\n * If true, leading and trailing ASCII whitespace characters are allowed and will be stripped.\n * If false, URLs with surrounding spaces are invalid.\n */\n potentiallySurroundedBySpaces?: boolean;\n};\n\n/**\n * Validates URLs according to HTML Standard.\n * A valid URL is a string that can be parsed as a URL.\n *\n * @see https://html.spec.whatwg.org/multipage/urls-and-fetching.html#valid-url-string\n */\nexport class ValidURL implements AttributeSpec {\n static type = \"ValidURL\" as const;\n\n static PotentiallySurroundedBySpaces = {\n type: ValidURL.type,\n potentiallySurroundedBySpaces: true,\n };\n\n static NonEmptyPotentiallySurroundedBySpaces = {\n type: ValidURL.type,\n potentiallySurroundedBySpaces: true,\n };\n\n constructor(private options: ValidURLOptions = {}) {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n let processedValue = value;\n\n if (this.options.potentiallySurroundedBySpaces) {\n processedValue = this.stripASCIIWhitespace(value);\n }\n\n if (processedValue === \"\") {\n return valid();\n }\n\n if (this.hasInvalidURLCharacters(processedValue)) {\n return invalid(\"URL contains invalid characters\");\n }\n\n try {\n new URL(processedValue);\n return valid(); // absolute url\n } catch {\n try {\n new URL(processedValue, \"https://www.base.com\");\n\n return valid();\n } catch {\n return invalid(\"Invalid URL format\");\n }\n }\n }\n\n /**\n * Strips leading and trailing ASCII whitespace characters.\n * ASCII whitespace: space (0x20), tab (0x09), LF (0x0A), FF (0x0C), CR (0x0D)\n *\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n */\n private stripASCIIWhitespace(value: string): string {\n return value.replace(\n /^[\\x20\\x09\\x0A\\x0C\\x0D]+|[\\x20\\x09\\x0A\\x0C\\x0D]+$/g,\n \"\",\n );\n }\n\n /**\n * Checks for characters that are explicitly invalid in URLs\n * based on the URL Standard.\n * Control characters (0x00-0x1F), space (0x20), and DEL (0x7F) are invalid.\n */\n private hasInvalidURLCharacters(value: string): boolean {\n for (let i = 0; i < value.length; i++) {\n const code = value.charCodeAt(i);\n // Control characters (0x00-0x1F), space (0x20), and DEL (0x7F)\n if (code <= 0x20 || code === 0x7f) {\n return true;\n }\n }\n return false;\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport type NonNegativeIntegerOptions = {\n min?: number;\n max?: number;\n};\n\n/**\n * A string is a valid non-negative integer if it consists of one or more ASCII digits.\n *\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#non-negative-integers\n */\nexport class NonNegativeInteger implements AttributeSpec {\n static type = \"NonNegativeInteger\" as const;\n\n static Type = {\n type: NonNegativeInteger.type,\n };\n\n static GreaterThanZero = {\n type: NonNegativeInteger.type,\n min: 1,\n };\n\n constructor(private options: NonNegativeIntegerOptions) {}\n\n // Matches: one or more digits (no hyphen-minus allowed)\n private static readonly PATTERN = /^\\d+$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (!NonNegativeInteger.PATTERN.test(value)) {\n return invalid(`Invalid non-negative integer: \"${value}\"`);\n }\n\n const numValue = parseInt(value, 10);\n\n if (this.options?.min !== undefined) {\n if (numValue < this.options.min) {\n return invalid(\n `Value must be at least ${this.options.min}: \"${value}\"`,\n );\n }\n }\n\n if (this.options?.max !== undefined) {\n if (numValue > this.options.max) {\n return invalid(`Value must be at most ${this.options.max}: \"${value}\"`);\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport class ID implements AttributeSpec {\n static type = \"ID\" as const;\n\n static Type = {\n type: ID.type,\n };\n\n constructor() {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * A string is a valid floating-point number if it consists of:\n *\n * - Optionally, a U+002D HYPHEN-MINUS character (-).\n * - One or both of the following, in the given order:\n * - A series of one or more ASCII digits.\n * - Both of the following, in the given order:\n * - A single U+002E FULL STOP character (.).\n * - A series of one or more ASCII digits.\n * - Optionally:\n * - Either a U+0065 LATIN SMALL LETTER E character (e) or a U+0045 LATIN CAPITAL LETTER E character (E).\n * - Optionally, a U+002D HYPHEN-MINUS character (-) or U+002B PLUS SIGN character (+).\n * - A series of one or more ASCII digits.\n *\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#floating-point-numbers\n */\nexport class FloatingPointNumber implements AttributeSpec {\n static type = \"FloatingPointNumber\" as const;\n\n static Type = {\n type: FloatingPointNumber.type,\n };\n\n // Matches valid floating-point numbers according to HTML spec\n // Pattern breakdown:\n // -? : optional minus sign\n // (?: : non-capturing group for the number part\n // \\d+ : one or more digits\n // (?:\\.\\d+)? : optionally followed by decimal point and digits\n // | : OR\n // \\.\\d+ : decimal point followed by one or more digits\n // )\n // (?:[eE][+-]?\\d+)? : optional exponent part\n private static readonly PATTERN =\n /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (!FloatingPointNumber.PATTERN.test(value)) {\n return invalid(`Invalid floating-point number: \"${value}\"`);\n }\n\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * A set of comma-separated tokens is a string containing zero or more tokens each separated from the next by a single U+002C COMMA character (,), where tokens consist of any string of zero or more characters, neither beginning nor ending with ASCII whitespace, nor containing any U+002C COMMA characters (,), and optionally surrounded by ASCII whitespace.\n *\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#comma-separated-tokens\n */\nexport class CommaSeparatedTokens implements AttributeSpec {\n static type = \"CommaSeparatedTokens\" as const;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // According to the spec:\n // - Tokens can be zero or more characters\n // - Tokens are separated by commas\n // - Tokens can be optionally surrounded by ASCII whitespace\n // - Tokens themselves should not begin or end with ASCII whitespace\n // - Tokens should not contain commas\n\n // The spec is describing the format, not validation rules.\n // Any comma-separated string is valid as the parsing handles whitespace trimming.\n\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport class CSSColor implements AttributeSpec {\n static type = \"CSSColor\" as const;\n\n static Type = {\n type: CSSColor.type,\n };\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // TODO: implement\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * BCP 47 language tag validator\n *\n * A valid BCP 47 language tag follows the ABNF grammar from RFC 5646:\n * - Language subtag (2-3 or 5-8 letters)\n * - Optional extended language subtags (3 letters, up to 3)\n * - Optional script subtag (4 letters)\n * - Optional region subtag (2 letters or 3 digits)\n * - Optional variant subtags (5-8 alphanumeric or 4 characters starting with digit)\n * - Optional extension subtags (singleton + 2-8 alphanumeric)\n * - Optional private use subtags (x- + 1-8 alphanumeric)\n *\n * Examples: en, en-US, zh-Hans-CN, en-GB-oxendict, x-private\n *\n * @see https://datatracker.ietf.org/doc/html/rfc5646\n * @see https://html.spec.whatwg.org/multipage/dom.html#attr-lang\n */\nexport class BCP47 implements AttributeSpec {\n static type = \"BCP47\" as const;\n\n static Type = {\n type: BCP47.type,\n };\n\n // Simplified BCP 47 pattern\n // This is a practical implementation that covers most common cases\n // Full RFC 5646 compliance would require more complex parsing\n private static readonly PATTERN =\n /^[a-zA-Z]{2,3}(?:-[a-zA-Z]{3}){0,3}(?:-[a-zA-Z]{4})?(?:-(?:[a-zA-Z]{2}|[0-9]{3}))?(?:-(?:[a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*(?:-[0-9a-wyzA-WYZ](?:-[a-zA-Z0-9]{2,8})+)*(?:-x(?:-[a-zA-Z0-9]{1,8})+)?$|^x(?:-[a-zA-Z0-9]{1,8})+$|^[a-zA-Z]{4,8}$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Empty string is valid (no language specified)\n if (value === \"\") {\n return valid();\n }\n\n // Basic validation: check against pattern\n if (!BCP47.PATTERN.test(value)) {\n return invalid(`Invalid BCP 47 language tag: \"${value}\"`);\n }\n\n // Additional validation: check subtag lengths\n const subtags = value.split(\"-\");\n\n for (let i = 0; i < subtags.length; i++) {\n const subtag = subtags[i];\n\n // Subtags must not be empty\n if (subtag.length === 0) {\n return invalid(\n `Invalid BCP 47 language tag: empty subtag in \"${value}\"`,\n );\n }\n\n // First subtag (language or 'x' for private use) should be 2-8 letters\n if (i === 0) {\n if (subtag === \"x\") {\n // Private use tag, remaining subtags should be 1-8 alphanumeric\n continue;\n }\n if (!/^[a-zA-Z]{2,8}$/.test(subtag)) {\n return invalid(`Invalid language subtag in \"${value}\": \"${subtag}\"`);\n }\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * A valid MIME type string represents a MIME type.\n *\n * Format: type \"/\" subtype [ \";\" parameter ]\n *\n * @see https://html.spec.whatwg.org/multipage/infrastructure.html#valid-mime-type\n * @see https://datatracker.ietf.org/doc/html/rfc2045#section-5.1\n */\nexport class MIMEType implements AttributeSpec {\n static type = \"MIMEType\" as const;\n\n static Type = {\n type: MIMEType.type,\n };\n\n constructor() {}\n\n // Matches: type/subtype with optional parameters\n // type and subtype: one or more characters from the token character set\n // token: any CHAR except CTLs or separators\n private static readonly PATTERN =\n /^[a-zA-Z0-9!#$%&'*+\\-.^_`{|}~]+\\/[a-zA-Z0-9!#$%&'*+\\-.^_`{|}~]+(?:\\s*;\\s*[a-zA-Z0-9!#$%&'*+\\-.^_`{|}~]+=(?:[a-zA-Z0-9!#$%&'*+\\-.^_`{|}~]+|\"[^\"]*\"))*$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (!MIMEType.PATTERN.test(value)) {\n return invalid(`Invalid MIME type: \"${value}\"`);\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * Validates date strings and global date-time strings.\n *\n * Valid date string format: YYYY-MM-DD\n * Valid global date-time string format: YYYY-MM-DDTHH:MM[:SS[.sss]][Z|±HH:MM]\n *\n * @see https://html.spec.whatwg.org/#valid-date-string\n * @see https://html.spec.whatwg.org/#valid-global-date-and-time-string\n */\nexport class DateString implements AttributeSpec {\n static type = \"DateString\" as const;\n\n static Type = {\n type: DateString.type,\n };\n\n constructor() {}\n\n // Valid date string: YYYY-MM-DD (year must be 4+ digits)\n private static readonly DATE_PATTERN = /^\\d{4,}-\\d{2}-\\d{2}$/;\n\n // Valid global date-time string: YYYY-MM-DD[T| ]HH:MM[:SS[.sss]][Z|±HH:MM]\n private static readonly DATETIME_PATTERN =\n /^\\d{4,}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{1,3})?)?(?:Z|[+-]\\d{2}:\\d{2})?$/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Check if it matches either date or datetime format\n if (\n !DateString.DATE_PATTERN.test(value) &&\n !DateString.DATETIME_PATTERN.test(value)\n ) {\n return invalid(`Invalid date or datetime string: \"${value}\"`);\n }\n\n // Additional validation for date components\n const dateMatch = value.match(/^(\\d{4,})-(\\d{2})-(\\d{2})/);\n if (dateMatch) {\n const year = parseInt(dateMatch[1], 10);\n const month = parseInt(dateMatch[2], 10);\n const day = parseInt(dateMatch[3], 10);\n\n if (year === 0) {\n return invalid(`Year must be greater than 0: \"${value}\"`);\n }\n\n if (month < 1 || month > 12) {\n return invalid(`Month must be between 1 and 12: \"${value}\"`);\n }\n\n // Check day range (simplified - doesn't account for leap years and month lengths)\n if (day < 1 || day > 31) {\n return invalid(`Day must be between 1 and 31: \"${value}\"`);\n }\n }\n\n // Additional validation for time components (if present)\n const timeMatch = value.match(/[T ](\\d{2}):(\\d{2})/);\n if (timeMatch) {\n const hour = parseInt(timeMatch[1], 10);\n const minute = parseInt(timeMatch[2], 10);\n\n if (hour > 23) {\n return invalid(`Hour must be between 0 and 23: \"${value}\"`);\n }\n\n if (minute > 59) {\n return invalid(`Minute must be between 0 and 59: \"${value}\"`);\n }\n\n // Check seconds if present\n const secondMatch = value.match(/[T ]\\d{2}:\\d{2}:(\\d{2})/);\n if (secondMatch) {\n const second = parseInt(secondMatch[1], 10);\n if (second > 59) {\n return invalid(`Second must be between 0 and 59: \"${value}\"`);\n }\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * Validates a regular expression pattern string.\n *\n * Used for HTML attributes that accept JavaScript regular expression patterns,\n * such as the pattern attribute on input elements.\n *\n * @see https://html.spec.whatwg.org/multipage/input.html#the-pattern-attribute\n */\nexport class RegularExpression implements AttributeSpec {\n static type = \"RegularExpression\" as const;\n static Type = {\n type: RegularExpression.type,\n };\n\n constructor() {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Try to compile the regular expression to check if it's valid\n try {\n new RegExp(value);\n return valid();\n } catch (error) {\n return invalid(\n `Invalid regular expression: \"${value}\" - ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * Validates a hash-name reference to an element.\n *\n * A valid hash-name reference consists of a U+0023 NUMBER SIGN character (#)\n * followed by a string that matches the value of a name attribute.\n *\n * Format: #name-value\n *\n * @see https://html.spec.whatwg.org/#valid-hash-name-reference\n */\nexport class HashNameReference implements AttributeSpec {\n static type = \"HashNameReference\" as const;\n\n static Type = {\n type: HashNameReference.type,\n };\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Must start with # and have at least one character after it\n if (!value.startsWith(\"#\")) {\n return invalid(`Hash-name reference must start with \"#\": \"${value}\"`);\n }\n\n if (value.length === 1) {\n return invalid(\n `Hash-name reference must have a name after \"#\": \"${value}\"`,\n );\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * Validates a navigable target name (browsing context name).\n *\n * A valid navigable target name is any string with at least one character that:\n * - Does not contain ASCII tab (\\t), newline (\\n), or U+003C (<)\n * - Does not start with U+005F (_) - reserved for special keywords like _blank, _self, _parent, _top\n *\n * @see https://html.spec.whatwg.org/multipage/document-sequences.html#valid-navigable-target-name\n */\nexport class NavigableTargetName implements AttributeSpec {\n static type = \"NavigableTargetName\" as const;\n\n static Type = {\n type: NavigableTargetName.type,\n };\n\n constructor() {}\n\n // Pattern to detect invalid characters: tab, newline, or <\n private static readonly INVALID_CHARS_PATTERN = /[\\t\\n<]/;\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Must have at least one character\n if (value.length === 0) {\n return invalid(\"Navigable target name must have at least one character\");\n }\n\n // Cannot start with underscore (_) - reserved for keywords\n if (value.startsWith(\"_\")) {\n return invalid(\n `Navigable target name cannot start with \"_\" (reserved for keywords like _blank, _self): \"${value}\"`,\n );\n }\n\n // Cannot contain tab, newline, or <\n if (NavigableTargetName.INVALID_CHARS_PATTERN.test(value)) {\n return invalid(\n `Navigable target name cannot contain tab, newline, or \"<\" character: \"${value}\"`,\n );\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\n\n/**\n * Validates srcset attribute values.\n *\n * The value consists of one or more image candidate strings, separated by commas.\n * Each image candidate string contains:\n * - A valid non-empty URL (not starting/ending with comma)\n * - Optional descriptor: width (e.g., \"100w\") or pixel density (e.g., \"2x\")\n *\n * Examples:\n * - \"image.jpg\"\n * - \"image-1x.jpg 1x, image-2x.jpg 2x\"\n * - \"small.jpg 100w, large.jpg 500w\"\n *\n * @see https://html.spec.whatwg.org/multipage/images.html#srcset-attributes\n */\nexport class SrcsetAttribute implements AttributeSpec {\n static type = \"SrcsetAttribute\" as const;\n\n static Type = {\n type: SrcsetAttribute.type,\n };\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n if (value.trim() === \"\") {\n return invalid(\"Srcset cannot be empty\");\n }\n\n // Split by commas to get image candidate strings\n const candidates = value.split(\",\");\n\n for (let i = 0; i < candidates.length; i++) {\n const candidate = candidates[i].trim();\n\n if (candidate === \"\") {\n return invalid(`Image candidate string ${i + 1} is empty`);\n }\n\n // Parse the candidate: URL + optional descriptor\n const parts = candidate.split(/\\s+/);\n const url = parts[0];\n\n // URL must not start or end with comma\n if (url.startsWith(\",\") || url.endsWith(\",\")) {\n return invalid(`URL cannot start or end with comma: \"${url}\"`);\n }\n\n // URL must not be empty\n if (url === \"\") {\n return invalid(`URL in candidate string ${i + 1} is empty`);\n }\n\n // If there's a descriptor, validate it\n if (parts.length > 1) {\n const descriptor = parts[parts.length - 1];\n\n // Width descriptor: must be positive integer followed by 'w'\n if (descriptor.endsWith(\"w\")) {\n const widthStr = descriptor.slice(0, -1);\n const width = parseInt(widthStr, 10);\n\n if (!/^\\d+$/.test(widthStr) || width <= 0) {\n return invalid(\n `Invalid width descriptor: \"${descriptor}\" (must be positive integer followed by 'w')`,\n );\n }\n }\n // Pixel density descriptor: must be positive number followed by 'x'\n else if (descriptor.endsWith(\"x\")) {\n const densityStr = descriptor.slice(0, -1);\n const density = parseFloat(densityStr);\n\n if (\n !/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?$/.test(densityStr) ||\n density <= 0\n ) {\n return invalid(\n `Invalid pixel density descriptor: \"${descriptor}\" (must be positive number followed by 'x')`,\n );\n }\n }\n // Invalid descriptor\n else {\n return invalid(\n `Invalid descriptor: \"${descriptor}\" (must end with 'w' or 'x')`,\n );\n }\n\n // There should be only one descriptor\n if (parts.length > 2) {\n // Multiple tokens after URL - check if they're all whitespace or if there are extra descriptors\n const extraParts = parts.slice(1, -1);\n if (extraParts.some((p: string) => p !== \"\")) {\n return invalid(\n `Invalid image candidate string: \"${candidate}\" (extra tokens found)`,\n );\n }\n }\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\nimport { getCSSLanguageService } from \"vscode-css-languageservice\";\nimport { TextDocument } from \"vscode-languageserver-textdocument\";\n\nexport class MediaQueryList implements AttributeSpec {\n static type = \"MediaQueryList\" as const;\n private cssLanguageService = getCSSLanguageService();\n\n static Type = {\n type: MediaQueryList.type,\n };\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n try {\n const cssText = `@media ${value} {}`;\n const document = TextDocument.create(\"test.css\", \"css\", 1, cssText);\n\n const stylesheet = this.cssLanguageService.parseStylesheet(document);\n const diagnostics = this.cssLanguageService.doValidation(\n document,\n stylesheet,\n );\n\n if (diagnostics.length > 0) {\n return invalid(ERROR_MESSAGES.INVALID_MEDIA_QUERY_LIST);\n }\n\n return valid();\n } catch (error) {\n return invalid(ERROR_MESSAGES.INVALID_MEDIA_QUERY_LIST);\n }\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\nexport class SourceSizeList implements AttributeSpec {\n static type = \"SourceSizeList\" as const;\n\n static Type = {\n type: SourceSizeList.type,\n };\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // TODO: Implementation\n return valid();\n }\n}\n","import type {\n AttributeSpec,\n AttributeSpecValidateResult,\n AttributeValue,\n} from \"../../types/index.js\";\nimport { FloatingPointNumber } from \"./floating-point-number\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\n\n/**\n * A valid list of floating-point numbers is a number of valid floating-point numbers separated by U+002C COMMA characters, with no other characters (e.g. no ASCII whitespace). In addition, there might be restrictions on the number of floating-point numbers that can be given, or on the range of values allowed.\n *\n * @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-list-of-floating-point-numbers\n */\nexport class FloatingPointNumberList implements AttributeSpec {\n static type = \"FloatingPointNumberList\" as const;\n\n private floatingPointNumberValidator = new FloatingPointNumber();\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Empty string is not valid\n if (value.length === 0) {\n return invalid(ERROR_MESSAGES.VALUE_CANNOT_BE_EMPTY);\n }\n\n // Split by comma (no whitespace allowed)\n const numbers = value.split(\",\");\n\n // Validate each number\n for (let i = 0; i < numbers.length; i++) {\n const number = numbers[i];\n\n // Check that there are no empty parts (which would indicate consecutive commas or leading/trailing commas)\n if (number.length === 0) {\n return invalid(`Empty value at position ${i + 1}`);\n }\n\n // Validate using FloatingPointNumber validator\n const result = this.floatingPointNumberValidator.validateValue(number);\n if (!result.valid) {\n return invalid(\n `Invalid floating-point number at position ${i + 1}: \"${number}\"`,\n );\n }\n }\n\n return valid();\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport type { AnyAttribute } from \"./any-attribute.js\";\nimport { createAttributeSpec } from \"../create-attribute-spec.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\n\nexport type OrValidatorOptions = {\n items: Exclude<AnyAttribute, { type: \"#or\" }>[];\n};\n\n/**\n * OrValidator validates a value against multiple validators.\n * If any validator passes, the value is considered valid.\n * If all validators fail, returns the error from the last validator.\n */\nexport class OrValidator implements AttributeSpec {\n static type = \"#or\" as const;\n constructor(private options: OrValidatorOptions) {}\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Try each validator in order\n let lastError: string | undefined;\n\n for (const item of this.options.items) {\n const spec = createAttributeSpec(\"\", item);\n const result = spec.validateValue(value);\n\n if (result.valid) {\n return valid();\n }\n\n lastError = result.reason;\n }\n\n // If all validators failed, return the last error\n return invalid(\n lastError ?? \"Value does not match any of the allowed formats\",\n );\n }\n}\n","import type {\n AttributeValue,\n AttributeSpec,\n AttributeSpecValidateResult,\n} from \"../../types/index.js\";\nimport { valid, invalid } from \"../../shared/result.js\";\nimport { ERROR_MESSAGES } from \"./error-messages.js\";\nimport { REGEX_ASCII_WHITESPACE } from \"../../shared/index.js\";\n\n/**\n * Validates the autocomplete attribute for input, select, and textarea elements.\n *\n * The autocomplete attribute can be:\n * 1. \"on\" or \"off\"\n * 2. An ordered set of space-separated tokens:\n * - Optional: section-* (where * is a string)\n * - Optional: billing or shipping\n * - Required: autofill field name\n * - Optional: webauthn (only for username and certain fields)\n *\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill\n */\nexport class AutocompleteAttribute implements AttributeSpec {\n static type = \"AutocompleteAttribute\" as const;\n\n static Type = {\n type: AutocompleteAttribute.type,\n };\n\n // Autofill field names per HTML Standard\n private static readonly AUTOFILL_FIELD_NAMES = new Set([\n \"name\",\n \"honorific-prefix\",\n \"given-name\",\n \"additional-name\",\n \"family-name\",\n \"honorific-suffix\",\n \"nickname\",\n \"username\",\n \"new-password\",\n \"current-password\",\n \"one-time-code\",\n \"organization-title\",\n \"organization\",\n \"street-address\",\n \"address-line1\",\n \"address-line2\",\n \"address-line3\",\n \"address-level4\",\n \"address-level3\",\n \"address-level2\",\n \"address-level1\",\n \"country\",\n \"country-name\",\n \"postal-code\",\n \"cc-name\",\n \"cc-given-name\",\n \"cc-additional-name\",\n \"cc-family-name\",\n \"cc-number\",\n \"cc-exp\",\n \"cc-exp-month\",\n \"cc-exp-year\",\n \"cc-csc\",\n \"cc-type\",\n \"transaction-currency\",\n \"transaction-amount\",\n \"language\",\n \"bday\",\n \"bday-day\",\n \"bday-month\",\n \"bday-year\",\n \"sex\",\n \"url\",\n \"photo\",\n \"tel\",\n \"tel-country-code\",\n \"tel-national\",\n \"tel-area-code\",\n \"tel-local\",\n \"tel-local-prefix\",\n \"tel-local-suffix\",\n \"tel-extension\",\n \"email\",\n \"impp\",\n ]);\n\n // Fields that can have webauthn token\n private static readonly WEBAUTHN_COMPATIBLE_FIELDS = new Set([\n \"username\",\n \"current-password\",\n ]);\n\n validateValue(value: AttributeValue): AttributeSpecValidateResult {\n // Empty string means default behavior\n if (value === \"\") {\n return valid();\n }\n\n const normalized = value.toLowerCase().trim();\n\n // Check for simple \"on\" or \"off\"\n if (normalized === \"on\" || normalized === \"off\") {\n return valid();\n }\n\n // Parse as space-separated tokens\n const tokens = normalized.split(REGEX_ASCII_WHITESPACE).filter(Boolean);\n\n if (tokens.length === 0) {\n return invalid(\"Autocomplete value cannot be empty\");\n }\n\n let index = 0;\n let hasSection = false;\n let hasAddressType = false;\n let hasFieldName = false;\n let hasWebauthn = false;\n let fieldName = \"\";\n\n // Optional: section-* token\n if (tokens[index]?.startsWith(\"section-\")) {\n hasSection = true;\n index++;\n }\n\n // Optional: billing or shipping\n if (tokens[index] === \"billing\" || tokens[index] === \"shipping\") {\n hasAddressType = true;\n index++;\n }\n\n // Required: autofill field name\n if (index < tokens.length) {\n const token = tokens[index];\n if (AutocompleteAttribute.AUTOFILL_FIELD_NAMES.has(token)) {\n hasFieldName = true;\n fieldName = token;\n index++;\n } else {\n return invalid(\n `Invalid autofill field name: \"${token}\". Must be one of the standard autofill field names.`,\n );\n }\n } else {\n return invalid(\"Autocomplete value must include an autofill field name\");\n }\n\n // Optional: webauthn\n if (index < tokens.length) {\n if (tokens[index] === \"webauthn\") {\n if (!AutocompleteAttribute.WEBAUTHN_COMPATIBLE_FIELDS.has(fieldName)) {\n return invalid(\n `\"webauthn\" token is only valid with username or current-password fields, not \"${fieldName}\"`,\n );\n }\n hasWebauthn = true;\n index++;\n }\n }\n\n // No extra tokens allowed\n if (index < tokens.length) {\n return invalid(\n `Invalid extra token in autocomplete value: \"${tokens[index]}\"`,\n );\n }\n\n return valid();\n }\n}\n","import {\n AutocompleteAttribute,\n BCP47,\n BooleanAttribute,\n CommaSeparatedTokens,\n CSSColor,\n DateString,\n EnumeratedAttribute,\n FloatingPointNumber,\n FloatingPointNumberList,\n HashNameReference,\n ID,\n MediaQueryList,\n MIMEType,\n NavigableTargetName,\n NonNegativeInteger,\n OrValidator,\n RegularExpression,\n SignedInteger,\n SourceSizeList,\n SpaceSeparatedTokens,\n SrcsetAttribute,\n Text,\n ValidURL,\n type AnyAttribute,\n} from \"./validators/index.js\";\nimport * as types from \"../types/index.js\";\n\nexport function createAttributeSpec(\n key: string,\n def: AnyAttribute,\n): types.AttributeSpec {\n switch (def.type) {\n case SpaceSeparatedTokens.type: {\n return new SpaceSeparatedTokens({\n unique: def.unique,\n allowed: def.allowed,\n validateToken: def.validateToken,\n });\n }\n case EnumeratedAttribute.type: {\n return new EnumeratedAttribute({\n keywords: def.keywords,\n });\n }\n case BooleanAttribute.type: {\n return new BooleanAttribute(key);\n }\n case SignedInteger.type: {\n return new SignedInteger();\n }\n case Text.type: {\n return new Text();\n }\n case ValidURL.type: {\n return new ValidURL({\n nonEmpty: def.nonEmpty,\n potentiallySurroundedBySpaces: def.potentiallySurroundedBySpaces,\n });\n }\n case NonNegativeInteger.type: {\n return new NonNegativeInteger({\n min: def.min,\n max: def.max,\n });\n }\n case ID.type: {\n return new ID();\n }\n case FloatingPointNumber.type: {\n return new FloatingPointNumber();\n }\n case CommaSeparatedTokens.type: {\n return new CommaSeparatedTokens();\n }\n case CSSColor.type: {\n return new CSSColor();\n }\n case BCP47.type: {\n return new BCP47();\n }\n case MIMEType.type: {\n return new MIMEType();\n }\n case DateString.type: {\n return new DateString();\n }\n case RegularExpression.type: {\n return new RegularExpression();\n }\n case HashNameReference.type: {\n return new HashNameReference();\n }\n case NavigableTargetName.type: {\n return new NavigableTargetName();\n }\n case SrcsetAttribute.type: {\n return new SrcsetAttribute();\n }\n case MediaQueryList.type: {\n return new MediaQueryList();\n }\n case SourceSizeList.type: {\n return new SourceSizeList();\n }\n case FloatingPointNumberList.type: {\n return new FloatingPointNumberList();\n }\n case OrValidator.type: {\n return new OrValidator({ items: def.items });\n }\n case AutocompleteAttribute.type: {\n return new AutocompleteAttribute();\n }\n }\n}\n","import type { AnyAttribute } from \"./validators/index.js\";\nimport * as types from \"../types/index.js\";\nimport { createAttributeSpec } from \"./create-attribute-spec.js\";\n\nexport class AttributeSpec implements types.AttributeSpec {\n constructor(\n private key: string,\n private definition: AnyAttribute,\n ) {}\n\n validateValue(\n value: types.AttributeValue,\n ): types.AttributeSpecValidateResult {\n const spec = createAttributeSpec(this.key, this.definition);\n return spec.validateValue(value);\n }\n}\n","import type { AnyAttribute } from \"./validators/any-attribute.js\";\nimport { BooleanAttribute } from \"./validators/boolean-attribute.js\";\nimport { EnumeratedAttribute } from \"./validators/enumerated-attribute.js\";\nimport { SignedInteger } from \"./validators/signed-integer.js\";\nimport { SpaceSeparatedTokens } from \"./validators/space-separated-tokens.js\";\nimport { Text } from \"./validators/text.js\";\nimport { ValidURL } from \"./validators/valid-url.js\";\nimport { BCP47 } from \"./validators/bcp-47.js\";\nimport { NonNegativeInteger } from \"./validators/non-negative-integer.js\";\n\n/**\n * @see https://html.spec.whatwg.org/multipage/dom.html#global-attributes\n */\nexport const globalAttributes = new Map<string, AnyAttribute>([\n [\n // If specified, the value must be an ordered set of unique space-separated tokens\n // none of which are identical to another token and each of which must be exactly one code point in length.\n \"accesskey\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n validateToken(value) {\n // Each token must be exactly one code point in length\n // Use Array.from to properly handle Unicode code points (e.g., emojis, surrogate pairs)\n const codePoints = Array.from(value);\n return codePoints.length === 1;\n },\n },\n ],\n [\n \"autocapitalize\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"off\", \"none\", \"on\", \"sentences\", \"words\", \"characters\"],\n },\n ],\n [\n \"autocorrect\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"on\", \"off\"],\n },\n ],\n [\"autofocus\", BooleanAttribute.Type],\n [\n \"contenteditable\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"true\", \"false\", \"plaintext-only\"],\n },\n ],\n [\n \"dir\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"ltr\", \"rtl\", \"auto\"],\n },\n ],\n [\n \"draggable\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"true\", \"false\"],\n },\n ],\n [\n \"enterkeyhint\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"enter\", \"done\", \"go\", \"next\", \"previous\", \"search\", \"send\"],\n },\n ],\n [\n \"headingoffset\",\n {\n type: NonNegativeInteger.type,\n min: 0,\n max: 8,\n },\n ],\n [\"headingreset\", BooleanAttribute.Type],\n [\n \"hidden\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"until-found\", \"hidden\"],\n },\n ],\n [\"inert\", BooleanAttribute.Type],\n [\n \"inputmode\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"none\",\n \"text\",\n \"tel\",\n \"url\",\n \"email\",\n \"numeric\",\n \"decimal\",\n \"search\",\n ],\n },\n ],\n [\"is\", Text.Type],\n [\"itemid\", ValidURL.PotentiallySurroundedBySpaces],\n [\n \"itemprop\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n },\n ],\n [\n \"itemref\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n },\n ],\n [\"itemscope\", BooleanAttribute.Type],\n /**\n * The itemtype attribute, if specified, must have a value that is an unordered set of unique space-separated tokens,\n * none of which are identical to another token and each of which is a valid URL string that is an absolute URL,\n * and all of which are defined to use the same vocabulary. The attribute's value must have at least one token.\n */\n [\n \"itemtype\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n validateToken(value) {\n // Each token must be a valid absolute URL\n try {\n new URL(value);\n // URL constructor only accepts absolute URLs, so if it succeeds, it's absolute\n return true;\n } catch {\n return false;\n }\n },\n },\n ],\n [\"lang\", BCP47.Type],\n [\"nonce\", Text.Type],\n [\n \"popover\",\n {\n type: \"#or\",\n items: [\n BooleanAttribute.Type,\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"auto\", \"manual\", \"hint\"],\n },\n ],\n },\n ],\n [\n \"spellcheck\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"true\", \"false\"],\n },\n ],\n [\"style\", Text.Type],\n [\"tabindex\", SignedInteger.Type],\n [\"title\", Text.Type],\n [\n \"translate\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"yes\", \"no\"],\n },\n ],\n [\n \"writingsuggestions\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"true\", \"false\"],\n },\n ],\n]);\n","import {\n AutocompleteAttribute,\n BooleanAttribute,\n CommaSeparatedTokens,\n EnumeratedAttribute,\n NonNegativeInteger,\n SignedInteger,\n SpaceSeparatedTokens,\n Text,\n ValidURL,\n ID,\n FloatingPointNumber,\n CSSColor,\n BCP47,\n MIMEType,\n DateString,\n RegularExpression,\n HashNameReference,\n NavigableTargetName,\n SrcsetAttribute,\n MediaQueryList,\n SourceSizeList,\n FloatingPointNumberList,\n type AnyAttribute,\n OrValidator,\n} from \"../attribute/validators/index.js\";\nimport { type ElementSpecDefinition } from \"../types/index.js\";\n\nconst empty: [string, AnyAttribute][] = [];\n\nexport const elementSpecDefinitionMap: Record<string, ElementSpecDefinition> = {\n html: {\n globalAttributes: true,\n attributes: empty,\n },\n head: { globalAttributes: true, attributes: empty },\n title: { globalAttributes: true, attributes: empty },\n base: {\n globalAttributes: true,\n attributes: [\n [\"href\", ValidURL.PotentiallySurroundedBySpaces],\n [\n \"target\",\n {\n type: \"#or\",\n items: [\n NavigableTargetName.Type,\n {\n type: EnumeratedAttribute.type,\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n ],\n },\n ],\n ],\n },\n link: {\n globalAttributes: true,\n attributes: [\n [\"href\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"crossorigin\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"anonymous\", \"use-credentials\"],\n },\n ],\n [\n \"rel\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n // allowed: [\n // \"alternate\",\n // \"canonical\",\n // \"author\",\n // \"dns-prefetch\",\n // \"expect\",\n // \"help\",\n // \"icon\",\n // \"manifest\",\n // \"modulepreload\",\n // \"license\",\n // \"next\",\n // \"pingback\",\n // \"preconnect\",\n // \"prefetch\",\n // \"preload\",\n // \"prev\",\n // \"privacy-policy\",\n // \"search\",\n // \"stylesheet\",\n // \"terms-of-service\",\n // ],\n },\n ],\n [\"media\", MediaQueryList.Type],\n [\"integrity\", Text.Type],\n [\"hreflang\", BCP47.Type],\n [\"type\", MIMEType.Type],\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n ],\n [\n \"sizes\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n validateToken(value: string) {\n // Accept \"any\" (case-insensitive)\n if (value.toLowerCase() === \"any\") {\n return true;\n }\n\n // Accept dimension pairs: NNNxMMM or NNNxMMM (e.g., \"100x200\")\n // Must be two non-negative integers without leading zeros, separated by 'x' or 'X'\n const dimensionPattern = /^([1-9]\\d*|0)[xX]([1-9]\\d*|0)$/;\n const match = value.match(dimensionPattern);\n\n if (!match) {\n return false;\n }\n\n // Check that neither number has a leading zero (except for \"0\" itself)\n const [, width, height] = match;\n if (\n (width.length > 1 && width.startsWith(\"0\")) ||\n (height.length > 1 && height.startsWith(\"0\"))\n ) {\n return false;\n }\n\n return true;\n },\n },\n ],\n // TODO: conditional - only valid when rel=\"preload\" and as=\"image\"\n [\"imagesrcset\", SrcsetAttribute.Type],\n // TODO: conditional - only valid when rel=\"preload\", as=\"image\", and imagesrcset is present\n [\"imagesizes\", SourceSizeList.Type],\n // TODO: conditional - only valid when rel contains \"preload\" or \"modulepreload\"\n [\n \"as\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"fetch\",\n \"font\",\n \"image\",\n \"script\",\n \"style\",\n \"track\",\n \"json\",\n \"style\",\n \"audioworklet\",\n \"paintworklet\",\n \"script\",\n \"serviceworker\",\n \"sharedworker\",\n \"worker\",\n ],\n },\n ],\n [\n \"blocking\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n allowed: [\"render\"],\n },\n ],\n [\"color\", CSSColor.Type],\n [\"disabled\", BooleanAttribute.Type],\n [\n \"fetchpriority\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"high\", \"low\", \"auto\"],\n },\n ],\n ],\n },\n meta: {\n globalAttributes: true,\n attributes: [\n [\"name\", Text.Type],\n [\n \"http-equiv\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"content-language\",\n \"content-type\",\n \"default-style\",\n \"refresh\",\n \"set-cookie\",\n \"x-ua-compatible\",\n \"content-security-policy\",\n ],\n },\n ],\n [\"content\", Text.Type],\n [\n \"charset\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"utf-8\"],\n },\n ],\n [\"media\", MediaQueryList.Type],\n ],\n },\n style: {\n globalAttributes: true,\n attributes: [\n [\"media\", MediaQueryList.Type],\n [\n \"blocking\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n allowed: [\"render\"],\n },\n ],\n ],\n },\n body: { globalAttributes: true, attributes: empty },\n article: { globalAttributes: true, attributes: empty },\n section: { globalAttributes: true, attributes: empty },\n nav: { globalAttributes: true, attributes: empty },\n aside: { globalAttributes: true, attributes: empty },\n hgroup: { globalAttributes: true, attributes: empty },\n header: { globalAttributes: true, attributes: empty },\n footer: { globalAttributes: true, attributes: empty },\n address: { globalAttributes: true, attributes: empty },\n p: { globalAttributes: true, attributes: empty },\n hr: { globalAttributes: true, attributes: empty },\n pre: { globalAttributes: true, attributes: empty },\n blockquote: {\n globalAttributes: true,\n attributes: [[\"cite\", ValidURL.PotentiallySurroundedBySpaces]],\n },\n ol: {\n globalAttributes: true,\n attributes: [\n [\"reversed\", BooleanAttribute.Type],\n [\"start\", SignedInteger.Type],\n [\n \"type\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"1\", \"a\", \"A\", \"i\", \"I\"],\n },\n ],\n ],\n },\n ul: { globalAttributes: true, attributes: empty },\n menu: { globalAttributes: true, attributes: empty },\n li: {\n globalAttributes: true,\n attributes: [[\"value\", SignedInteger.Type]],\n },\n dl: { globalAttributes: true, attributes: empty },\n dt: { globalAttributes: true, attributes: empty },\n dd: { globalAttributes: true, attributes: empty },\n figure: { globalAttributes: true, attributes: empty },\n figcaption: { globalAttributes: true, attributes: empty },\n main: { globalAttributes: true, attributes: empty },\n search: { globalAttributes: true, attributes: empty },\n div: { globalAttributes: true, attributes: empty },\n a: {\n globalAttributes: true,\n attributes: [\n [\"href\", ValidURL.PotentiallySurroundedBySpaces],\n [\n \"target\",\n {\n type: \"#or\",\n items: [\n NavigableTargetName.Type,\n {\n type: EnumeratedAttribute.type,\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n ],\n },\n ],\n [\"download\", Text.Type],\n [\n \"ping\",\n {\n type: SpaceSeparatedTokens.type,\n unique: false,\n validateToken(value: string) {\n // URLs of the resources that are interested in being notified if the user follows the hyperlink.\n // Each token must be a valid non-empty URL whose scheme is an HTTP(S) scheme.\n if (value.length === 0) {\n return false;\n }\n\n try {\n const url = new URL(value);\n // Check if the scheme is http or https\n return url.protocol === \"http:\" || url.protocol === \"https:\";\n } catch {\n // Invalid URL format\n return false;\n }\n },\n },\n ],\n [\n \"rel\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n allowed: [\n \"alternate\",\n \"author\",\n \"bookmark\",\n \"external\",\n \"help\",\n \"license\",\n \"next\",\n \"nofollow\",\n \"noopener\",\n \"noreferrer\",\n \"opener\",\n \"prev\",\n \"privacy-policy\",\n \"search\",\n \"tag\",\n \"terms-of-service\",\n ],\n },\n ],\n [\"hreflang\", BCP47.Type],\n [\"type\", MIMEType.Type],\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n ],\n ],\n },\n em: { globalAttributes: true, attributes: empty },\n strong: { globalAttributes: true, attributes: empty },\n small: { globalAttributes: true, attributes: empty },\n s: { globalAttributes: true, attributes: empty },\n cite: { globalAttributes: true, attributes: empty },\n q: {\n globalAttributes: true,\n attributes: [[\"cite\", ValidURL.PotentiallySurroundedBySpaces]],\n },\n dfn: { globalAttributes: true, attributes: empty },\n abbr: { globalAttributes: true, attributes: empty },\n ruby: { globalAttributes: true, attributes: empty },\n rt: { globalAttributes: true, attributes: empty },\n rp: { globalAttributes: true, attributes: empty },\n data: {\n globalAttributes: true,\n attributes: [[\"value\", Text.Type]],\n },\n time: {\n globalAttributes: true,\n attributes: [[\"datetime\", DateString.Type]],\n },\n code: { globalAttributes: true, attributes: empty },\n var: { globalAttributes: true, attributes: empty },\n samp: { globalAttributes: true, attributes: empty },\n kbd: { globalAttributes: true, attributes: empty },\n i: { globalAttributes: true, attributes: empty },\n b: { globalAttributes: true, attributes: empty },\n u: { globalAttributes: true, attributes: empty },\n mark: { globalAttributes: true, attributes: empty },\n bdi: { globalAttributes: true, attributes: empty },\n bdo: { globalAttributes: true, attributes: empty },\n span: { globalAttributes: true, attributes: empty },\n br: { globalAttributes: true, attributes: empty },\n wbr: { globalAttributes: true, attributes: empty },\n ins: {\n globalAttributes: true,\n attributes: [\n [\"cite\", ValidURL.PotentiallySurroundedBySpaces],\n [\"datetime\", DateString.Type],\n ],\n },\n del: {\n globalAttributes: true,\n attributes: [\n [\"cite\", ValidURL.PotentiallySurroundedBySpaces],\n [\"datetime\", DateString.Type],\n ],\n },\n picture: { globalAttributes: true, attributes: empty },\n source: {\n globalAttributes: true,\n attributes: [\n [\"type\", MIMEType.Type],\n [\"media\", MediaQueryList.Type],\n // TODO: conditional - only valid when parent is <audio> or <video> (invalid when parent is <picture>)\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n // TODO: conditional - only valid when parent is <picture> (invalid when parent is <audio> or <video>)\n [\"srcset\", SrcsetAttribute.Type],\n // TODO: conditional - only valid when parent is <picture> (invalid when parent is <audio> or <video>)\n [\"sizes\", SourceSizeList.Type],\n [\"width\", NonNegativeInteger.Type],\n [\"height\", NonNegativeInteger.Type],\n ],\n },\n img: {\n globalAttributes: true,\n attributes: [\n [\"alt\", Text.Type],\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\"srcset\", SrcsetAttribute.Type],\n [\"sizes\", SourceSizeList.Type],\n [\n \"crossorigin\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"anonymous\", \"use-credentials\"],\n },\n ],\n // TODO: conditional - invalid when <img> is a descendant of <a> or <button>\n [\"usemap\", HashNameReference.Type],\n // TODO: conditional - only valid when <img> is a descendant of <a> with href attribute\n [\"ismap\", BooleanAttribute.Type],\n [\"width\", NonNegativeInteger.Type],\n [\"height\", NonNegativeInteger.Type],\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n ],\n [\n \"decoding\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"sync\", \"async\", \"auto\"],\n },\n ],\n [\n \"loading\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"eager\", \"lazy\"],\n },\n ],\n [\n \"fetchpriority\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"high\", \"low\", \"auto\"],\n },\n ],\n ],\n },\n iframe: {\n globalAttributes: true,\n attributes: [\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\"srcdoc\", Text.Type],\n [\n \"name\",\n {\n type: \"#or\",\n items: [\n NavigableTargetName.Type,\n {\n type: EnumeratedAttribute.type,\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n ],\n },\n ],\n [\n \"sandbox\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n allowed: [\n \"allow-downloads\",\n \"allow-forms\",\n \"allow-modals\",\n \"allow-orientation-lock\",\n \"allow-pointer-lock\",\n \"allow-popups\",\n \"allow-popups-to-escape-sandbox\",\n \"allow-presentation\",\n \"allow-same-origin\",\n \"allow-scripts\",\n \"allow-top-navigation\",\n \"allow-top-navigation-by-user-activation\",\n \"allow-top-navigation-to-custom-protocols\",\n ],\n },\n ],\n [\"allow\", Text.Type],\n [\"allowfullscreen\", BooleanAttribute.Type],\n [\"width\", NonNegativeInteger.Type],\n [\"height\", NonNegativeInteger.Type],\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n ],\n [\n \"loading\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"eager\", \"lazy\"],\n },\n ],\n ],\n },\n embed: {\n globalAttributes: true,\n attributes: [\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\"type\", MIMEType.Type],\n [\"width\", NonNegativeInteger.Type],\n [\"height\", NonNegativeInteger.Type],\n ],\n },\n object: {\n globalAttributes: true,\n attributes: [\n [\"data\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\"type\", MIMEType.Type],\n [\n \"name\",\n {\n type: \"#or\",\n items: [\n NavigableTargetName.Type,\n {\n type: EnumeratedAttribute.type,\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n ],\n },\n ],\n\n [\"form\", ID.Type],\n [\"width\", NonNegativeInteger.Type],\n [\"height\", NonNegativeInteger.Type],\n ],\n },\n video: {\n globalAttributes: true,\n attributes: [\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"crossorigin\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"anonymous\", \"use-credentials\"],\n },\n ],\n [\"poster\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"preload\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"none\", \"metadata\", \"auto\"],\n },\n ],\n [\"autoplay\", BooleanAttribute.Type],\n [\"playsinline\", BooleanAttribute.Type],\n [\"loop\", BooleanAttribute.Type],\n [\"muted\", BooleanAttribute.Type],\n [\"controls\", BooleanAttribute.Type],\n [\"width\", NonNegativeInteger.Type],\n [\"height\", NonNegativeInteger.Type],\n ],\n },\n audio: {\n globalAttributes: true,\n attributes: [\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"crossorigin\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"anonymous\", \"use-credentials\"],\n },\n ],\n [\n \"preload\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"none\", \"metadata\", \"auto\"],\n },\n ],\n [\"autoplay\", BooleanAttribute.Type],\n [\"loop\", BooleanAttribute.Type],\n [\"muted\", BooleanAttribute.Type],\n [\"controls\", BooleanAttribute.Type],\n ],\n },\n track: {\n globalAttributes: true,\n attributes: [\n [\n \"kind\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"subtitles\",\n \"captions\",\n \"descriptions\",\n \"chapters\",\n \"metadata\",\n ],\n },\n ],\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\"srclang\", BCP47.Type],\n [\"label\", Text.Type],\n [\"default\", BooleanAttribute.Type],\n ],\n },\n map: {\n globalAttributes: true,\n attributes: [[\"name\", Text.Type]],\n },\n area: {\n globalAttributes: true,\n attributes: [\n [\"alt\", Text.Type],\n [\n \"coords\",\n {\n type: FloatingPointNumberList.type,\n },\n ],\n [\n \"shape\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"circle\", \"default\", \"poly\", \"rect\"],\n },\n ],\n [\"href\", ValidURL.PotentiallySurroundedBySpaces],\n // TODO: conditional - only applicable when href attribute is present\n [\n \"target\",\n {\n type: \"#or\",\n items: [\n NavigableTargetName.Type,\n {\n type: EnumeratedAttribute.type,\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n ],\n },\n ],\n // TODO: conditional - only applicable when href attribute is present\n [\"download\", Text.Type],\n // TODO: conditional - only applicable when href attribute is present\n [\n \"ping\",\n {\n type: SpaceSeparatedTokens.type,\n unique: false,\n validateToken(value: string) {\n // URLs of the resources that are interested in being notified if the user follows the hyperlink.\n // Each token must be a valid non-empty URL whose scheme is an HTTP(S) scheme.\n if (value.length === 0) {\n return false;\n }\n\n try {\n const url = new URL(value);\n // Check if the scheme is http or https\n return url.protocol === \"http:\" || url.protocol === \"https:\";\n } catch {\n // Invalid URL format\n return false;\n }\n },\n },\n ],\n // TODO: conditional - only applicable when href attribute is present\n [\n \"rel\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n allowed: [\n \"alternate\",\n \"author\",\n \"bookmark\",\n \"external\",\n \"help\",\n \"license\",\n \"next\",\n \"nofollow\",\n \"noopener\",\n \"noreferrer\",\n \"opener\",\n \"prev\",\n \"privacy-policy\",\n \"search\",\n \"tag\",\n \"terms-of-service\",\n ],\n },\n ],\n // TODO: conditional - only applicable when href attribute is present\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n ],\n ],\n },\n table: { globalAttributes: true, attributes: empty },\n caption: { globalAttributes: true, attributes: empty },\n colgroup: {\n globalAttributes: true,\n attributes: [[\"span\", NonNegativeInteger.GreaterThanZero]],\n },\n col: {\n globalAttributes: true,\n attributes: [[\"span\", NonNegativeInteger.GreaterThanZero]],\n },\n tbody: { globalAttributes: true, attributes: empty },\n thead: { globalAttributes: true, attributes: empty },\n tfoot: { globalAttributes: true, attributes: empty },\n tr: { globalAttributes: true, attributes: empty },\n td: {\n globalAttributes: true,\n attributes: [\n [\"colspan\", NonNegativeInteger.GreaterThanZero],\n [\"rowspan\", NonNegativeInteger.Type],\n [\n \"headers\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n },\n ],\n ],\n },\n th: {\n globalAttributes: true,\n attributes: [\n [\"colspan\", NonNegativeInteger.GreaterThanZero],\n [\"rowspan\", NonNegativeInteger.Type],\n [\n \"headers\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n },\n ],\n [\n \"scope\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"row\", \"col\", \"rowgroup\", \"colgroup\"],\n },\n ],\n [\"abbr\", Text.Type],\n ],\n },\n form: {\n globalAttributes: true,\n attributes: [\n [\n \"accept-charset\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n },\n ],\n [\"action\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"autocomplete\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"on\", \"off\"],\n },\n ],\n [\n \"enctype\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"application/x-www-form-urlencoded\",\n \"multipart/form-data\",\n \"text/plain\",\n ],\n },\n ],\n [\n \"method\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"get\", \"post\", \"dialog\"],\n },\n ],\n [\"name\", Text.Type],\n [\"novalidate\", BooleanAttribute.Type],\n [\n \"target\",\n {\n type: \"#or\",\n items: [\n NavigableTargetName.Type,\n {\n type: EnumeratedAttribute.type,\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n ],\n },\n ],\n [\n \"rel\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n allowed: [\n \"external\",\n \"help\",\n \"license\",\n \"next\",\n \"nofollow\",\n \"noopener\",\n \"noreferrer\",\n \"opener\",\n \"prev\",\n \"search\",\n ],\n },\n ],\n ],\n },\n label: {\n globalAttributes: true,\n attributes: [[\"for\", ID.Type]],\n },\n input: {\n globalAttributes: true,\n attributes: [\n // TODO: conditional - only valid when type=\"file\"\n [\n \"accept\",\n {\n type: CommaSeparatedTokens.type,\n },\n ],\n // TODO: conditional - only valid when type=\"image\"\n [\"alt\", Text.Type],\n [\"autocomplete\", AutocompleteAttribute.Type],\n // TODO: conditional - only valid when type=\"checkbox\" or type=\"radio\"\n [\"checked\", BooleanAttribute.Type],\n [\"dirname\", Text.Type],\n [\"disabled\", BooleanAttribute.Type],\n [\"form\", ID.Type],\n [\"formaction\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"formenctype\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"application/x-www-form-urlencoded\",\n \"multipart/form-data\",\n \"text/plain\",\n ],\n },\n ],\n [\n \"formmethod\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"get\", \"post\", \"dialog\"],\n },\n ],\n [\"formnovalidate\", BooleanAttribute.Type],\n [\n \"formtarget\",\n {\n type: \"#or\",\n items: [\n NavigableTargetName.Type,\n {\n type: EnumeratedAttribute.type,\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n ],\n },\n ],\n // TODO: conditional - only valid when type=\"image\"\n [\"height\", NonNegativeInteger.Type],\n [\"list\", ID.Type],\n // TODO: conditional - allowed value format varies based on type attribute (date, number, range, etc.)\n [\n \"max\",\n // TODO: varies based on type\n Text.Type,\n ],\n [\"maxlength\", NonNegativeInteger.Type],\n // TODO: conditional - allowed value format varies based on type attribute (date, number, range, etc.)\n [\n \"min\",\n // TODO: varies based on type\n Text.Type,\n ],\n [\"minlength\", NonNegativeInteger.Type],\n // TODO: conditional - only valid when type=\"file\" or type=\"email\"\n [\"multiple\", BooleanAttribute.Type],\n [\"name\", Text.Type],\n // TODO: conditional - only applicable to text-based input types (excludes checkbox, radio, hidden, submit, image, reset, button, range, color)\n [\"pattern\", RegularExpression.Type],\n [\"placeholder\", Text.Type],\n [\"popovertarget\", Text.Type],\n [\n \"popovertargetaction\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"hide\", \"show\", \"toggle\"],\n },\n ],\n [\"readonly\", BooleanAttribute.Type],\n [\"required\", BooleanAttribute.Type],\n [\"size\", NonNegativeInteger.GreaterThanZero],\n // TODO: conditional - only valid when type=\"image\"\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n // TODO: conditional - only valid when type is one of: date, month, week, time, datetime-local, number, range\n [\n \"step\",\n {\n type: \"#or\",\n items: [\n FloatingPointNumber.Type,\n {\n type: EnumeratedAttribute.type,\n keywords: [\"any\"],\n },\n ],\n },\n ],\n [\n \"type\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"hidden\",\n \"text\",\n \"search\",\n \"tel\",\n \"url\",\n \"email\",\n \"password\",\n \"date\",\n \"month\",\n \"week\",\n \"time\",\n \"datetime-local\",\n \"number\",\n \"range\",\n \"color\",\n \"checkbox\",\n \"radio\",\n \"file\",\n \"submit\",\n \"image\",\n \"reset\",\n \"button\",\n ],\n },\n ],\n [\"value\", Text.Type],\n // TODO: conditional - only valid when type=\"image\"\n [\"width\", NonNegativeInteger.Type],\n ],\n },\n button: {\n globalAttributes: true,\n attributes: [\n [\"disabled\", BooleanAttribute.Type],\n [\"form\", ID.Type],\n // TODO: conditional - only valid when type=\"submit\"\n [\"formaction\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n // TODO: conditional - only valid when type=\"submit\"\n [\n \"formenctype\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"application/x-www-form-urlencoded\",\n \"multipart/form-data\",\n \"text/plain\",\n ],\n },\n ],\n // TODO: conditional - only valid when type=\"submit\"\n [\n \"formmethod\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"get\", \"post\", \"dialog\"],\n },\n ],\n // TODO: conditional - only valid when type=\"submit\"\n [\"formnovalidate\", BooleanAttribute.Type],\n // TODO: conditional - only valid when type=\"submit\"\n [\n \"formtarget\",\n {\n type: \"#or\",\n items: [\n NavigableTargetName.Type,\n {\n type: EnumeratedAttribute.type,\n keywords: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n },\n ],\n },\n ],\n [\"name\", Text.Type],\n [\"popovertarget\", Text.Type],\n [\n \"popovertargetaction\",\n {\n type: EnumeratedAttribute.type,\n\n keywords: [\"hide\", \"show\", \"toggle\"],\n },\n ],\n [\n \"type\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"submit\", \"reset\", \"button\"],\n },\n ],\n [\"value\", Text.Type],\n ],\n },\n select: {\n globalAttributes: true,\n attributes: [\n [\"autocomplete\", AutocompleteAttribute.Type],\n [\"disabled\", BooleanAttribute.Type],\n [\"form\", ID.Type],\n [\"multiple\", BooleanAttribute.Type],\n [\"name\", Text.Type],\n [\"required\", BooleanAttribute.Type],\n [\"size\", NonNegativeInteger.GreaterThanZero],\n ],\n },\n datalist: { globalAttributes: true, attributes: empty },\n optgroup: {\n globalAttributes: true,\n attributes: [\n [\"disabled\", BooleanAttribute.Type],\n [\"label\", Text.Type],\n ],\n },\n option: {\n globalAttributes: true,\n attributes: [\n [\"disabled\", BooleanAttribute.Type],\n [\"label\", Text.Type],\n [\"selected\", BooleanAttribute.Type],\n [\"value\", Text.Type],\n ],\n },\n textarea: {\n globalAttributes: true,\n attributes: [\n [\"autocomplete\", AutocompleteAttribute.Type],\n [\"cols\", NonNegativeInteger.GreaterThanZero],\n [\"dirname\", Text.Type],\n [\"disabled\", BooleanAttribute.Type],\n [\"form\", ID.Type],\n [\"maxlength\", NonNegativeInteger.Type],\n [\"minlength\", NonNegativeInteger.Type],\n [\"name\", Text.Type],\n [\"placeholder\", Text.Type],\n [\"readonly\", BooleanAttribute.Type],\n [\"required\", BooleanAttribute.Type],\n [\"rows\", NonNegativeInteger.GreaterThanZero],\n [\n \"wrap\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"soft\", \"hard\"],\n },\n ],\n ],\n },\n output: {\n globalAttributes: true,\n attributes: [\n [\n \"for\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n },\n ],\n [\"form\", ID.Type],\n [\"name\", Text.Type],\n ],\n },\n progress: {\n globalAttributes: true,\n attributes: [\n [\"value\", FloatingPointNumber.Type],\n [\"max\", FloatingPointNumber.Type],\n ],\n },\n meter: {\n globalAttributes: true,\n attributes: [\n [\"value\", FloatingPointNumber.Type],\n [\"min\", FloatingPointNumber.Type],\n [\"max\", FloatingPointNumber.Type],\n [\"low\", FloatingPointNumber.Type],\n [\"high\", FloatingPointNumber.Type],\n [\"optimum\", FloatingPointNumber.Type],\n ],\n },\n fieldset: {\n globalAttributes: true,\n attributes: [\n [\"disabled\", BooleanAttribute.Type],\n [\"form\", ID.Type],\n [\"name\", Text.Type],\n ],\n },\n legend: { globalAttributes: true, attributes: empty },\n selectedcontent: { globalAttributes: true, attributes: empty },\n details: {\n globalAttributes: true,\n attributes: [\n [\"open\", BooleanAttribute.Type],\n [\"name\", Text.Type],\n ],\n },\n summary: { globalAttributes: true, attributes: empty },\n dialog: {\n globalAttributes: true,\n attributes: [[\"open\", BooleanAttribute.Type]],\n },\n script: {\n globalAttributes: true,\n attributes: [\n [\"src\", ValidURL.NonEmptyPotentiallySurroundedBySpaces],\n [\n \"type\",\n {\n type: OrValidator.type,\n items: [\n {\n type: EnumeratedAttribute.type,\n keywords: [\"module\", \"importmap\", \"speculationrules\"],\n },\n MIMEType.Type,\n ],\n },\n ],\n // TODO: conditional - only meaningful for classic scripts (not type=\"module\")\n [\"nomodule\", BooleanAttribute.Type],\n // TODO: conditional - applicable when src attribute is present or type=\"module\"\n [\"async\", BooleanAttribute.Type],\n // TODO: conditional - only applicable to classic scripts (not type=\"module\")\n [\"defer\", BooleanAttribute.Type],\n [\n \"crossorigin\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"\", \"anonymous\", \"use-credentials\"],\n },\n ],\n [\"integrity\", Text.Type],\n [\n \"referrerpolicy\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\n \"\",\n \"no-referrer\",\n \"no-referrer-when-downgrade\",\n \"same-origin\",\n \"origin\",\n \"strict-origin\",\n \"origin-when-cross-origin\",\n \"strict-origin-when-cross-origin\",\n \"unsafe-url\",\n ],\n },\n ],\n [\n \"blocking\",\n {\n type: SpaceSeparatedTokens.type,\n unique: true,\n },\n ],\n [\n \"fetchpriority\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"high\", \"low\", \"auto\"],\n },\n ],\n ],\n },\n noscript: { globalAttributes: true, attributes: empty },\n template: {\n globalAttributes: true,\n attributes: [\n [\n \"shadowrootmode\",\n {\n type: EnumeratedAttribute.type,\n keywords: [\"open\", \"closed\"],\n },\n ],\n [\"shadowrootdelegatesfocus\", BooleanAttribute.Type],\n [\"shadowrootclonable\", BooleanAttribute.Type],\n [\"shadowrootserializable\", BooleanAttribute.Type],\n ],\n },\n slot: {\n globalAttributes: true,\n attributes: [[\"name\", Text.Type]],\n },\n canvas: {\n globalAttributes: true,\n attributes: [\n [\"width\", NonNegativeInteger.Type],\n [\"height\", NonNegativeInteger.Type],\n ],\n },\n};\n","import { AttributeSpec } from \"./attribute-spec.js\";\nimport type { AnyAttribute } from \"./validators/any-attribute.js\";\nimport { globalAttributes } from \"./global-attributes.js\";\nimport { elementSpecDefinitionMap } from \"../element/element-definitions.js\";\nimport type { ElementState } from \"../element/element-state.js\";\nimport * as types from \"../types/index.js\";\n\nexport class AttributeSpecMap implements types.AttributeSpecMap {\n constructor(private state: ElementState) {}\n\n private getSpecDefinition(): types.ElementSpecDefinition | null {\n const spec = elementSpecDefinitionMap[this.state.name];\n return spec ?? null;\n }\n\n get = (key: string): types.AttributeSpec | null => {\n const def = this.getSpecDefinition();\n if (!def) {\n return null;\n }\n let spec: AnyAttribute | null = null;\n if (def.globalAttributes) {\n spec = globalAttributes.get(key) ?? null;\n if (spec) {\n return new AttributeSpec(key, spec);\n }\n }\n spec = def?.attributes.find(([k]) => key.toLowerCase() === k)?.[1] ?? null;\n if (spec) {\n return new AttributeSpec(key, spec);\n }\n return null;\n };\n has = (key: string): boolean => {\n const def = this.getSpecDefinition();\n if (def?.globalAttributes) {\n const has = globalAttributes.has(key);\n if (has) {\n return true;\n }\n }\n const found = def?.attributes.find(([k]) => key.toLowerCase() === k);\n return !!found;\n };\n}\n","import { IMPLICIT_ROLE } from \"../accessibility/implicit-role.js\";\nimport { AttributeSpecMap } from \"../attribute/attribute-spec-map.js\";\nimport { ElementState } from \"./element-state.js\";\nimport * as types from \"../types/index.js\";\n\nexport class ElementSpec implements types.ElementSpec {\n private state: ElementState;\n constructor(name: string, options: types.ElementOptions) {\n this.state = new ElementState(name, options);\n }\n\n implicitRole = () => {\n const role = IMPLICIT_ROLE[this.state.name];\n if (role) {\n return role(this.state);\n }\n return null;\n };\n\n get attributes() {\n return new AttributeSpecMap(this.state);\n }\n}\n","import { ElementSpec } from \"./element-spec.js\";\nimport type { ElementOptions } from \"../types/index.js\";\n\nexport function element(name: string, options: ElementOptions = {}) {\n return new ElementSpec(name, options);\n}\n"],"mappings":"ubAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,ICCO,IAAMI,EAAa,CACxB,QAAS,UACT,WAAY,aACZ,OAAQ,SACR,QAAS,UACT,KAAM,OACN,SAAU,WACV,KAAM,OACN,SAAU,WACV,cAAe,gBACf,YAAa,cACb,SAAU,WACV,OAAQ,SACR,SAAU,WACV,SAAU,WACV,OAAQ,SACR,KAAM,OACN,QAAS,UACT,MAAO,QACP,QAAS,UACT,IAAK,MACL,UAAW,YACX,KAAM,OACN,KAAM,OACN,QAAS,UACT,KAAM,OACN,MAAO,QACP,WAAY,aACZ,OAAQ,SACR,UAAW,YACX,YAAa,cACb,MAAO,QACP,IAAK,MACL,SAAU,WACV,OAAQ,SACR,UAAW,YACX,UAAW,YACX,OAAQ,SACR,WAAY,aACZ,OAAQ,SACR,OAAQ,SACR,MAAO,QACP,KAAM,OACN,QAAS,UACT,KAAM,MACR,EC5CO,IAAMC,GAAgD,CAC3D,IAAIC,EAAW,CACb,OAAO,IACT,CACF,ECHO,IAAMC,GAAN,KAAsB,CAC3B,YACUC,EAA6BC,GACrC,CADQ,aAAAD,CACP,CAEH,IAAIE,EAAoC,CACtC,OAAO,KAAK,QAAQ,IAAIA,CAAG,CAC7B,CAEA,IAAIA,EAAsB,CACxB,OAAO,KAAK,QAAQ,IAAIA,CAAG,IAAM,IACnC,CACF,ECZO,IAAMC,GAAN,MAAMC,CAAa,CAGxB,YACEC,EACQC,EACR,CADQ,aAAAA,EAER,KAAK,KAAOD,EAAK,YAAY,CAC/B,CAEA,IAAI,YAA8B,CAChC,OAAO,IAAIE,GAAgB,KAAK,QAAQ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AAO,KAET,IAAIC,EAA4B,KAChC,OAAID,EAAI,mBACNC,GAAOJ,EAAAK,GAAiB,IAAIN,CAAG,IAAxB,KAAAC,EAA6B,KAChCI,GACK,IAAIE,GAAcP,EAAKK,CAAI,GAGtCA,GAAOF,GAAAD,EAAAE,GAAA,YAAAA,EAAK,WAAW,KAAK,CAAC,CAACI,CAAC,IAAMR,EAAI,YAAY,IAAMQ,KAApD,YAAAN,EAAyD,KAAzD,KAAAC,EAA+D,KAClEE,EACK,IAAIE,GAAcP,EAAKK,CAAI,EAE7B,KACT,EACA,SAAOL,GAAyB,CAC9B,IAAMI,EAAM,KAAK,kBAAkB,EACnC,OAAIA,GAAA,MAAAA,EAAK,kBACKE,GAAiB,IAAIN,CAAG,EAE3B,GAIJ,CAAC,EADMI,GAAA,YAAAA,EAAK,WAAW,KAAK,CAAC,CAACI,CAAC,IAAMR,EAAI,YAAY,IAAMQ,GAEpE,CAnC0C,CAElC,mBAAwD,CAC9D,IAAMH,EAAOI,GAAyB,KAAK,MAAM,IAAI,EACrD,OAAOJ,GAAA,KAAAA,EAAQ,IACjB,CA+BF,ECvCO,IAAMK,GAAN,KAA+C,CAEpD,YAAYC,EAAcC,EAA+B,CAIzD,kBAAe,IAAM,CACnB,IAAMC,EAAOC,GAAc,KAAK,MAAM,IAAI,EAC1C,OAAID,EACKA,EAAK,KAAK,KAAK,EAEjB,IACT,EATE,KAAK,MAAQ,IAAIE,GAAaJ,EAAMC,CAAO,CAC7C,CAUA,IAAI,YAAa,CACf,OAAO,IAAII,GAAiB,KAAK,KAAK,CACxC,CACF,ECnBO,SAASC,GAAQC,EAAcC,EAA0B,CAAC,EAAG,CAClE,OAAO,IAAIC,GAAYF,EAAMC,CAAO,CACtC","names":["index_exports","__export","element","__toCommonJS","ARIA_ROLES","DEFAULT_ATTRIBUTES_OPTIONS","_","AttributesState","options","DEFAULT_ATTRIBUTES_OPTIONS","key","ElementState","_ElementState","name","options","AttributesState","first","_a","_b","IMPLICIT_ROLE","element","ARIA_ROLES","sectioningElements","ancestor","VALID","valid","invalid","reason","_BooleanAttribute","attributeKey","value","valid","invalid","BooleanAttribute","ERROR_MESSAGES","EnumeratedAttribute","options","value","normalizedValue","valid","invalid","_SignedInteger","value","valid","invalid","SignedInteger","REGEX_ASCII_WHITESPACE","SpaceSeparatedTokens","options","value","REGEX_ASCII_WHITESPACE","tokens","token","uniqueTokens","invalid","allowedToken","valid","_Text","_","valid","Text","_ValidURL","options","value","processedValue","valid","invalid","e","i","code","ValidURL","_NonNegativeInteger","options","value","_a","_b","invalid","numValue","valid","NonNegativeInteger","_ID","value","valid","ID","_FloatingPointNumber","value","valid","invalid","FloatingPointNumber","CommaSeparatedTokens","value","valid","_CSSColor","value","valid","CSSColor","_BCP47","value","valid","invalid","subtags","i","subtag","BCP47","_MIMEType","value","valid","invalid","MIMEType","_DateString","value","invalid","dateMatch","year","month","day","timeMatch","hour","minute","secondMatch","valid","DateString","_RegularExpression","value","valid","error","invalid","RegularExpression","_HashNameReference","value","invalid","valid","HashNameReference","_NavigableTargetName","value","invalid","valid","NavigableTargetName","_SrcsetAttribute","value","invalid","candidates","i","candidate","parts","url","descriptor","widthStr","width","densityStr","density","p","valid","SrcsetAttribute","import_vscode_css_languageservice","import_vscode_languageserver_textdocument","_MediaQueryList","value","cssText","document","stylesheet","invalid","ERROR_MESSAGES","valid","error","MediaQueryList","_SourceSizeList","value","valid","SourceSizeList","FloatingPointNumberList","FloatingPointNumber","value","invalid","ERROR_MESSAGES","numbers","i","number","valid","OrValidator","options","value","lastError","item","result","createAttributeSpec","valid","invalid","_AutocompleteAttribute","value","_a","valid","normalized","tokens","REGEX_ASCII_WHITESPACE","invalid","index","hasSection","hasAddressType","hasFieldName","hasWebauthn","fieldName","token","AutocompleteAttribute","createAttributeSpec","key","def","SpaceSeparatedTokens","EnumeratedAttribute","BooleanAttribute","SignedInteger","Text","ValidURL","NonNegativeInteger","ID","FloatingPointNumber","CommaSeparatedTokens","CSSColor","BCP47","MIMEType","DateString","RegularExpression","HashNameReference","NavigableTargetName","SrcsetAttribute","MediaQueryList","SourceSizeList","FloatingPointNumberList","OrValidator","AutocompleteAttribute","AttributeSpec","key","definition","value","createAttributeSpec","globalAttributes","SpaceSeparatedTokens","value","EnumeratedAttribute","BooleanAttribute","NonNegativeInteger","Text","ValidURL","e","BCP47","SignedInteger","empty","elementSpecDefinitionMap","ValidURL","NavigableTargetName","EnumeratedAttribute","SpaceSeparatedTokens","MediaQueryList","Text","BCP47","MIMEType","value","dimensionPattern","match","width","height","SrcsetAttribute","SourceSizeList","CSSColor","BooleanAttribute","SignedInteger","url","e","DateString","NonNegativeInteger","HashNameReference","ID","FloatingPointNumberList","CommaSeparatedTokens","AutocompleteAttribute","RegularExpression","FloatingPointNumber","OrValidator","AttributeSpecMap","state","key","_a","_b","_c","def","spec","globalAttributes","AttributeSpec","k","elementSpecDefinitionMap","ElementSpec","name","options","role","IMPLICIT_ROLE","ElementState","AttributeSpecMap","element","name","options","ElementSpec"]}
|