import{animationNameKeywords as e}from"../../reference/keywords.mjs";import{atRuleRegexes as n}from"../../utils/regexes.mjs";import{declarationValueIndex as s}from"../../utils/nodeFieldIndices.mjs";import o from"../../utils/findAnimationName.mjs";import t from"../../utils/report.mjs";import r from"../../utils/ruleMessages.mjs";import a from"../../utils/validateOptions.mjs";const i="no-unknown-animations",m=r(i,{rejected:e=>`Unexpected unknown animation name "${e}"`}),u=r=>(u,l)=>{if(!a(l,i,{actual:r}))return;const d=new Set;u.walkAtRules(n.keyframesName,e=>{d.add(e.params)}),u.walkDecls(n=>{if("animation"===n.prop.toLowerCase()||"animation-name"===n.prop.toLowerCase()){const r=o(n.value);if(0===r.length)return;for(const o of r){if(e.has(o.value.toLowerCase()))continue;if(d.has(o.value))continue;const r=s(n);t({result:l,ruleName:i,message:m.rejected,messageArgs:[o.value],node:n,index:r+o.sourceIndex,endIndex:r+o.sourceEndIndex})}}})};u.ruleName=i,u.messages=m,u.meta={url:"https://stylelint.io/user-guide/rules/no-unknown-animations"};export{u as default};