/*
 * Copyright (c) 2018, 2026, Oracle and/or its affiliates.
 * Licensed under The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 */
const RULENAME="oj-tsx-acc-navigable-link";const DESCRIPTION="In order to be keyboard accessible, hyperlinks must be defined with either an 'href' or a 'tabindex' property (or both).";const SHORT_DESCRIPTION="Ensure that hyperlinks on the page are keyboard accessible";const HREF="href";const TABINDEX="tabindex";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(regCtx){this._tsxUtils=regCtx.utils.tsxUtils;return{"Tsx<a>":this._onAnchor}}_onAnchor(ruleCtx,tsxComp){if(!this._tsxUtils.getProperty(tsxComp,HREF)&&!this._tsxUtils.getProperty(tsxComp,TABINDEX)){let msg="<a> must have an 'href' or 'tabindex' property to be keyboard accessible.";ruleCtx.reporter.addIssue(new ruleCtx.Issue(msg),ruleCtx)}}}module.exports=Rule;