import e from"../../utils/getRuleSelector.mjs";import t from"../../utils/isStandardSyntaxRule.mjs";import{levelOneAndTwoPseudoElements as s}from"../../reference/selectors.mjs";import o from"../../utils/parseSelector.mjs";import r from"../../utils/report.mjs";import l from"../../utils/ruleMessages.mjs";import n from"../../utils/validateOptions.mjs";const i="selector-pseudo-element-colon-notation",u=l(i,{expected:e=>`Expected ${e} colon pseudo-element notation`}),a=l=>(a,m)=>{if(!n(m,i,{actual:l,possible:["single","double"]}))return;let c="";"single"===l?c=":":"double"===l&&(c="::"),a.walkRules(n=>{if(!t(n))return;if(!n.selector.includes(":"))return;const a=o(e(n),m,n);a&&a.walkPseudos(e=>{const t=e.value.replaceAll(":","");if(!s.has(t.toLowerCase()))return;const o=e.value.startsWith("::");if("single"===l&&!o)return;if("double"===l&&o)return;r({message:u.expected,messageArgs:[l],node:n,index:e.sourceIndex,endIndex:e.sourceIndex+(o?2:1),result:m,ruleName:i,fix:{apply:()=>{e.replaceWith(e.clone({value:c+t})),n.selector=a.toString()},node:n}})})})};a.ruleName=i,a.messages=u,a.meta={url:"https://stylelint.io/user-guide/rules/selector-pseudo-element-colon-notation",fixable:!0};export{a as default};