import e from"../../../../../_virtual/index19.mjs";import{declarationValueIndex as t}from"../../utils/nodeFieldIndices.mjs";import r from"../../utils/getDimension.mjs";import{isString as i}from"../../utils/validateTypes.mjs";import s from"../../utils/matchesStringOrRegExp.mjs";import o from"../../utils/optionsMatches.mjs";import n from"../../utils/report.mjs";import l from"../../utils/ruleMessages.mjs";import m from"../../utils/validateObjectWithArrayProps.mjs";import u from"../../utils/validateOptions.mjs";import a from"../../utils/vendor.mjs";const p="declaration-property-unit-allowed-list",d=l(p,{rejected:(e,t)=>`Unexpected unit "${t}" for property "${e}"`}),f=(l,f)=>(c,j)=>{u(j,p,{actual:l,possible:[m(i)]},{actual:f,possible:{ignore:["inside-function"]},optional:!0})&&c.walkDecls(i=>{const m=i.prop,u=i.value,c=a.unprefixed(m),g=Object.keys(l).find(e=>s(c,e));if(!g)return;const y=l[g];if(!y)return;const v=new Set([y].flat());e(u).walk(e=>{if("function"===e.type){if("url"===e.value.toLowerCase())return!1;if(o(f,"ignore","inside-function"))return!1}if("string"===e.type)return;const{unit:s}=r(e);if(!s||v.has(s.toLowerCase()))return;const l=t(i)+e.sourceIndex,u=l+e.value.length;n({message:d.rejected,messageArgs:[m,s],node:i,index:l,endIndex:u,result:j,ruleName:p})})})};f.ruleName=p,f.messages=d,f.meta={url:"https://stylelint.io/user-guide/rules/declaration-property-unit-allowed-list"};export{f as default};