import e from"../../../../../_virtual/index20.mjs";import t from"../../utils/flattenNestedSelectorsForRule.mjs";import s from"../../utils/getStrippedSelectorSource.mjs";import o from"../../utils/isNonNegativeInteger.mjs";import r from"../../utils/isStandardSyntaxRule.mjs";import m from"../../utils/report.mjs";import i from"../../utils/ruleMessages.mjs";import l from"../../utils/validateOptions.mjs";const{isSelector:a}=e,n="selector-max-combinators",u=i(n,{expected:(e,t)=>`Expected "${e}" to have no more than ${t} ${1===t?"combinator":"combinators"}`}),c=e=>(i,c)=>{l(c,n,{actual:e,possible:o})&&i.walkRules(o=>{r(o)&&t(o,c).forEach(({selector:t,resolvedSelectors:r})=>{r.walk(r=>{a(r)&&function(t,o,r){if(t.reduce((e,t)=>("combinator"===t.type&&(e+=1),e),0)>e){const{index:t,endIndex:i,selector:l}=s(o);m({ruleName:n,result:c,node:r,message:u.expected,messageArgs:[l,e],index:t,endIndex:i})}}(r,t,o)})})})};c.ruleName=n,c.messages=u,c.meta={url:"https://stylelint.io/user-guide/rules/selector-max-combinators"};export{c as default};