import{isRegExp as e,isString as t}from"../../utils/validateTypes.mjs";import s from"../../utils/getRuleSelector.mjs";import r from"../../utils/isStandardSyntaxRule.mjs";import l from"../../utils/parseSelector.mjs";import o from"../../utils/report.mjs";import i from"../../utils/ruleMessages.mjs";import m from"../../utils/validateOptions.mjs";const a="selector-id-pattern",u=i(a,{expected:(e,t)=>`Expected "${e}" to match pattern "${t}"`}),n=i=>(n,p)=>{if(!m(p,a,{actual:i,possible:[e,t]}))return;const d=t(i)?new RegExp(i):i;n.walkRules(/#/,e=>{r(e)&&l(s(e),p,e)?.walkIds(t=>{const{value:s,sourceIndex:r}=t;if(d.test(s))return;const l=t.toString().trim(),m=r+l.length;o({result:p,ruleName:a,message:u.expected,messageArgs:[l,i],node:e,index:r,endIndex:m})})})};n.ruleName=a,n.messages=u,n.meta={url:"https://stylelint.io/user-guide/rules/selector-id-pattern"};export{n as default};