/*
 * 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-html-picker-attrs";const DESCRIPTION="Attribute 'picker-attributes.style' violates the recommended Content Security Policy (CSP) which disallows inline styles, and is therefore ignored in JET 11.0.";const SHORT_DESCRIPTION="Attribute 'picker-attributes.style' is a CSP violation(no inline styles), and is ignored.";const MSG="Attribute 'picker-attributes.style' is ignored in JET 11.0.0, and is a CSP violation - use 'picker-attributes.class'";const PICKER_ATTRIB="picker-attributes";const STYLE="style";class Rule{getName(){return RULENAME}getDescription(){return DESCRIPTION}getShortDescription(){return SHORT_DESCRIPTION}register(){return{"<oj-input-date>":this._onTag,"<oj-input-date-time>":this._onTag,"<oj-input-time>":this._onTag,"<oj-date-picker>":this._onTag,"<oj-date-time-picker>":this._onTag,"<oj-select-many>":this._onTag,"<oj-combobox-many>":this._onTag,"<oj-combobox-one>":this._onTag}}_onTag(ruleCtx){var attribs;if(attribs=ruleCtx.tagNode.attribs){if(attribs.hasOwnProperty(PICKER_ATTRIB)){let o=attribs[PICKER_ATTRIB];if(!_isExpr(o)&&o.charAt(0)==="{"){try{let o=JSON.parse(attribs[PICKER_ATTRIB]);if(o&&o.hasOwnProperty(STYLE)){let issue=new ruleCtx.Issue(MSG);let attrPos=ruleCtx.utils.DomUtils.getAttribPosition(ruleCtx.data,ruleCtx.tagNode,PICKER_ATTRIB);issue.setPosition(attrPos.row,attrPos.col,attrPos.start,attrPos.end);ruleCtx.reporter.addIssue(issue,ruleCtx)}}catch(e){}}}}}}function _isExpr(s){s=s.substring(0,2);return s==="[["||s==="{{"}module.exports=Rule;