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