import e from"../../../../../_virtual/index19.mjs";import{atRuleParamIndex as t}from"../../utils/nodeFieldIndices.mjs";import{atRuleRegexes as s}from"../../utils/regexes.mjs";import o from"../../utils/getAtRuleParams.mjs";import r from"../../utils/report.mjs";import i from"../../utils/ruleMessages.mjs";import n from"../../utils/setAtRuleParams.mjs";import m from"../../utils/validateOptions.mjs";const u="import-notation",l=i(u,{expected:(e,t)=>`Expected "${e}" to be "${t}"`}),a=(e,t,s)=>()=>{const o=e.params.slice(s);n(e,`${t}${o}`)},d=i=>(n,d)=>{m(d,u,{actual:i,possible:["string","url"]})&&n.walkAtRules(s.importName,function(s){const n=o(s),m=t(s),p=e(n);for(const t of p.nodes){const{sourceEndIndex:o,type:n,value:p}=t,f={node:s,index:m,endIndex:m+o,result:d,ruleName:u};if("string"===i){if("function"!==n||"url"!==p.toLowerCase())continue;const i=e.stringify(t),m=e.stringify(t.nodes),u="word"===t.nodes[0]?.type?`"${m}"`:m,d=a(s,u,o),c=l.expected,g=[i,u];return void r({...f,message:c,messageArgs:g,fix:{apply:d,node:f.node}})}if("url"===i){if("space"===n)return;if("word"!==n&&"string"!==n)continue;const i=`url(${e.stringify(t)})`,m="word"===n?`"${p}"`:`${t.quote}${p}${t.quote}`,u=a(s,i,o),d=l.expected,c=[m,i];return void r({...f,message:d,messageArgs:c,fix:{apply:u,node:f.node}})}}})};d.ruleName=u,d.messages=l,d.meta={url:"https://stylelint.io/user-guide/rules/import-notation",fixable:!0};export{d as default};