import e from"../../../../../_virtual/index19.mjs";import{atRuleRegexes as s}from"../../utils/regexes.mjs";import{declarationValueIndex as r}from"../../utils/nodeFieldIndices.mjs";import t from"../../utils/isVarFunction.mjs";import o from"../../utils/report.mjs";import n from"../../utils/ruleMessages.mjs";import u from"../../utils/validateOptions.mjs";const i="no-unknown-custom-properties",m=n(i,{rejected:e=>`Unexpected unknown custom property "${e}"`}),l=n=>(l,a)=>{if(!u(a,i,{actual:n}))return;const p=new Set;l.walkAtRules(s.propertyName,({params:e})=>{p.add(e)}),l.walkDecls(/^--/,({prop:e})=>{p.add(e)}),l.walkDecls(s=>{const{value:n}=s;e(n).walk(e=>{if(!t(e))return;const[n,u]=e.nodes;if(!n||p.has(n.value))return;if(u&&"div"===u.type)return;const l=r(s);o({result:a,ruleName:i,message:m.rejected,messageArgs:[n.value],node:s,index:l+n.sourceIndex,endIndex:l+n.sourceEndIndex})})})};l.ruleName=i,l.messages=m,l.meta={url:"https://stylelint.io/user-guide/rules/no-unknown-custom-properties"};export{l as default};