import e from"../../../../../_virtual/index19.mjs";import{isString as t,isRegExp as r}from"../../utils/validateTypes.mjs";import{declarationValueIndex as o}from"../../utils/nodeFieldIndices.mjs";import s from"../../utils/isCustomProperty.mjs";import i from"../../utils/isStandardSyntaxFunction.mjs";import l from"../../utils/matchesStringOrRegExp.mjs";import n from"../../utils/report.mjs";import u from"../../utils/ruleMessages.mjs";import a from"../../utils/validateOptions.mjs";import m from"../../utils/vendor.mjs";const p="function-allowed-list",f=u(p,{rejected:e=>`Unexpected function "${e}"`}),c=(u,c)=>(d,j)=>{if(!a(j,p,{actual:u,possible:[t,r]},{actual:c,possible:{exceptWithoutPropertyFallback:[t,r]},optional:!0}))return;const x=c?.exceptWithoutPropertyFallback??[];d.walkDecls(t=>{e(t.value).walk(e=>{if("function"!==e.type)return;if(!i(e))return;const r=m.unprefixed(e.value);if(l(r,u)){if(!l(r,x))return;if(function(e){const t=e.prop.toLowerCase();if(s(t))return!1;let r=e.prev();for(;r;){if("decl"===r.type&&r.prop.toLowerCase()===t)return!0;r=r.prev()}return!1}(t))return}const a=o(t)+e.sourceIndex,c=a+e.value.length;n({message:f.rejected,messageArgs:[e.value],node:t,index:a,endIndex:c,result:j,ruleName:p})})})};c.primaryOptionArray=!0,c.ruleName=p,c.messages=f,c.meta={url:"https://stylelint.io/user-guide/rules/function-allowed-list"};export{c as default};