import e from"../../../../../_virtual/index19.mjs";import{declarationValueIndex as r}from"../../utils/nodeFieldIndices.mjs";import t from"../../utils/hasValidHex.mjs";import s from"../../utils/isHexColor.mjs";import l from"../../utils/isUrlFunction.mjs";import i from"../../utils/report.mjs";import n from"../../utils/ruleMessages.mjs";import a from"../../utils/validateOptions.mjs";const o="color-hex-alpha",m=n(o,{expected:e=>`Expected alpha channel in "${e}"`,rejected:e=>`Unexpected alpha channel in "${e}"`}),u=n=>(u,c)=>{a(c,o,{actual:n,possible:["always","never"]})&&u.walkDecls(a=>{if(!t(a.value))return;e(a.value).walk(e=>{if(l(e))return!1;if(!s(e))return;const{value:t}=e;if("always"===n&&p(t))return;if("never"===n&&!p(t))return;const u=r(a)+e.sourceIndex,d=u+t.length;i({message:"never"===n?m.rejected:m.expected,messageArgs:[t],node:a,index:u,endIndex:d,result:c,ruleName:o})})})};function p(e){return 5===e.length||9===e.length}u.ruleName=o,u.messages=m,u.meta={url:"https://stylelint.io/user-guide/rules/color-hex-alpha"};export{u as default};