import e from"../../../../../_virtual/index13.mjs";import{__require as r}from"../../utils/optionsHaveException.mjs";import{__require as t}from"../../utils/optionsHaveIgnored.mjs";import{__require as n}from"../../utils/namespace.mjs";import{__require as o}from"../../utils/ruleUrl.mjs";var i,a;function s(){if(a)return i;a=1;const{utils:s}=e,m=r(),p=t(),l=n(),u=o(),c=l("dollar-variable-first-in-block"),f=s.ruleMessages(c,{expected:"Expected $-variable to be first in block"}),d={url:u(c)};function _(e,r){return(t,n)=>{if(!s.validateOptions(n,c,{actual:e},{actual:r,possible:{ignore:["comments","imports"],except:["root","at-rule","function","mixin","if-else","loops"]},optional:!0}))return;const o=e=>e.prop&&"$"===e.prop[0];t.walkDecls(e=>{if(!o(e))return;if(m(r,"root")&&e.parent===t)return;if("atrule"===e.parent.type&&(m(r,"at-rule")||m(r,"function")&&"function"===e.parent.name||m(r,"mixin")&&"mixin"===e.parent.name||m(r,"if-else")&&("if"===e.parent.name||"else"===e.parent.name)||m(r,"loops")&&("each"===e.parent.name||"for"===e.parent.name||"while"===e.parent.name)))return;const i=e.prev();if(!i||o(i))return;let a=!0;const l=p(r,"comments"),u=p(r,"imports"),d=["import","use","forward"];for(const r of e.parent.nodes){if(r===e)break;o(r)||l&&"comment"===r.type||u&&"atrule"===r.type&&d.includes(r.name)||(a=!1)}a||s.report({message:f.expected,node:e,result:n,ruleName:c})})}}return _.ruleName=c,_.messages=f,_.meta=d,i=_}export{s as __require};