import e from"../../utils/beforeBlockString.mjs";import t from"../../utils/hasBlock.mjs";import{isComment as r}from"../../utils/typeGuards.mjs";import{isConfigurationComment as o}from"../../utils/configurationComment.mjs";import s from"../../utils/optionsMatches.mjs";import i from"../../utils/report.mjs";import n from"../../utils/ruleMessages.mjs";import m from"../../utils/validateOptions.mjs";const u="block-no-empty",l=n(u,{rejected:"Unexpected empty block"}),a=(n,a,f)=>(p,c)=>{if(!m(c,u,{actual:n,possible:[!0]},{actual:a,possible:{ignore:["comments"]},optional:!0}))return;const g=s(a,"ignore","comments");function d(s){if(!t(s))return;if(function(e){return(e.nodes??[]).some(e=>{if(r(e)){if(g)return!1;if(o(e,f.configurationComment))return!1}return!0})}(s))return;if(function(e){const{after:t}=e.raws;return"string"==typeof t&&/\S/.test(t)}(s))return;let n=e(s,{noRawBefore:!0}).length;void 0===s.raws.between&&n--,i({message:l.rejected,messageArgs:[],node:s,start:s.positionBy({index:n}),end:s.rangeBy({}).end,result:c,ruleName:u})}p.walkRules(d),p.walkAtRules(d)};a.ruleName=u,a.messages=l,a.meta={url:"https://stylelint.io/user-guide/rules/block-no-empty"};export{a as default};