/** * Constraint validation for form-associated ty components. * * Components report their own state (e.g. valueMissing) through set(); users * add a custom error through setCustomValidity(). Both are kept separately and * merged into ElementInternals, so a component re-validating on the next * keystroke doesn't wipe the user's custom error (same as native inputs). * * reportValidity() uses the component's own `error` display when it has one * (ty-input, ty-textarea, ty-radio-group, ty-file-upload) instead of the * browser's bubble, and clears that message again once the field is valid. * Whenever the browser fires `invalid` on such a field — a submit attempt, * form.reportValidity(), or checkValidity() on the field or its form — the * message goes into that error line (no bubble), so a plain