/*
 * Copyright (c) 2018, 2025, 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-wctag-packprivate";const DESCRIPTION="Components marked as 'packPrivate' in their component.json metadata, are private base classes "+"that can be extended by other classes in the same pack. They cannot be used as application "+"'stand-alone' components.";const SHORT_DESCRIPTION="'packPrivate' components cannot be used as application 'stand-alone' components.";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{TsxRenderComponent:this._onTsxRC}}_onTsxRC(ruleCtx,tsxRC){tsxRC.components.forEach(tsxComp=>{this._checkPackPrivate(ruleCtx,tsxComp)})}_checkPackPrivate(ruleCtx,tsxComp){var tagName=tsxComp.name;if(ruleCtx.utils.metaLib.isTagPackPrivate(tagName)){_emitIssue(ruleCtx,tsxComp)}if(tsxComp.children){tsxComp.children.forEach(child=>{if(ruleCtx.utils.metaLib.isTagPackPrivate(child.name)){_emitIssue(ruleCtx,child)}})}}};function _emitIssue(ruleCtx,tsxComp){var tagName=tsxComp.name;var issue=new ruleCtx.Issue(`<${tagName}> is not intended for stand-alone use in an application ('packPrivate')`);issue.setPosition(tsxComp.loc.start.line,tsxComp.loc.start.column,tsxComp.range[0],tsxComp.range[1]);ruleCtx.reporter.addIssue(issue,ruleCtx)}module.exports=Rule;