import e from"../../../../../_virtual/index19.mjs";import{declarationValueIndex as t}from"../../utils/nodeFieldIndices.mjs";import r from"../../utils/isStandardSyntaxHexColor.mjs";import s from"../../utils/isValidHex.mjs";import i from"../../utils/report.mjs";import o from"../../utils/ruleMessages.mjs";import l from"../../utils/validateOptions.mjs";const n="color-no-invalid-hex",a=o(n,{rejected:e=>`Unexpected invalid hex color "${e}"`}),u=/#[\da-z]+/i,m=o=>(m,d)=>{l(d,n,{actual:o})&&m.walkDecls(o=>{r(o.value)&&u.test(o.value)&&e(o.value).walk(({value:e,type:r,sourceIndex:l})=>{if("function"===r&&e.endsWith("url"))return!1;if("word"!==r)return;const u=/^#[\da-z]+/i.exec(e);if(!u)return;const m=u[0];if(!m||s(m))return;const c=t(o)+l,f=c+m.length;i({message:a.rejected,messageArgs:[m],node:o,index:c,endIndex:f,result:d,ruleName:n})})})};m.ruleName=n,m.messages=a,m.meta={url:"https://stylelint.io/user-guide/rules/color-no-invalid-hex"};export{m as default};