{"version":3,"file":"elementMatchesRule.min.mjs","sources":["../../../src/parser/elementMatchesRule.ts"],"sourcesContent":["import { selectorMatches } from './selectorMatches';\nimport { doesSomeParentMatch } from './doesSomeParentMatch';\n\n/**\n * @private\n */\n\nexport function elementMatchesRule(element: HTMLElement, selectors: string[]) {\n  let parentMatching = true;\n  // start from rightmost selector.\n  const firstMatching = selectorMatches(element, selectors.pop()!);\n  if (firstMatching && selectors.length) {\n    parentMatching = doesSomeParentMatch(element, selectors);\n  }\n  return firstMatching && parentMatching && selectors.length === 0;\n}\n"],"names":["elementMatchesRule","element","selectors","parentMatching","firstMatching","selectorMatches","pop","length","doesSomeParentMatch"],"mappings":"gIAOO,SAASA,EAAmBC,EAAsBC,GACvD,IAAIC,GAAiB,EAErB,MAAMC,EAAgBC,EAAgBJ,EAASC,EAAUI,OAIzD,OAHIF,GAAiBF,EAAUK,SAC7BJ,EAAiBK,EAAoBP,EAASC,IAEzCE,GAAiBD,GAAuC,IAArBD,EAAUK,MACtD"}