stylelint-plugin-use-baseline 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5,5 +5,5 @@ import{parse as e,walk as n}from"css-tree";import t from"stylelint";import a fro
5
5
  * Copyright (c) 2014-2017, Jon Schlinkert.
6
6
  * Released under the MIT License.
7
7
  */
8
- function c(e){return"[object Object]"===Object.prototype.toString.call(e)}function d(e){return"number"==typeof e||e instanceof Number}function u(e){return e instanceof RegExp}function m(e){return"string"==typeof e||e instanceof String}function h(e){return!1!==c(n=e)&&(void 0===(t=n.constructor)||!1!==c(a=t.prototype)&&!1!==a.hasOwnProperty("isPrototypeOf"));var n,t,a}function g(e,n,t){return Boolean(e&&e[n]&&"string"==typeof t&&w(t,e[n]))}function w(e,n){if(!Array.isArray(e))return b(e,n);for(const t of e){const e=b(t,n);if(e)return e}return!1}function b(e,n){if(!Array.isArray(n))return M(e,n);for(const t of n){const n=M(e,t);if(n)return n}return!1}function f(e,n){const t=e.match(n);return!!t&&{match:e,pattern:n,substring:t[0]??""}}function M(e,n){if(n instanceof RegExp)return f(e,n);if(n.startsWith("/")&&(n.endsWith("/")||n.endsWith("/i"))){const t=f(e,n.endsWith("i")?new RegExp(n.slice(1,-2),"i"):new RegExp(n.slice(1,-1)));return t&&(t.pattern=n),t}return e===n&&{match:e,pattern:n,substring:e}}const y=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]);function k(...e){return n=>!!h(n)&&Object.values(n).flat().every(n=>e.some(e=>e(n)))}const{createPlugin:x,utils:{report:v,ruleMessages:z,validateOptions:j}}=t,S="plugin/use-baseline",P=z(S,{notBaselineProperty:(e,n)=>`Property "${e}" is not a ${n} available baseline feature.`,notBaselinePropertyValue:(e,n,t)=>`Value "${n}" of property "${e}" is not a ${t} available baseline feature.`,notBaselineFunction:(e,n)=>`Function "${e}" is not a ${n} available baseline feature.`,notBaselineAtRule:(e,n)=>`At-rule "${e}" is not a ${n} available baseline feature.`,notBaselineMediaCondition:(e,n)=>`Media condition "${e}" is not a ${n} available baseline feature.`,notBaselineSelector:(e,n)=>`Selector "${e}" is not a ${n} available baseline feature.`,unnecessarySupports:(e,n)=>`@supports ${e} is unnecessary as the feature meets the ${n} availability requirement.`});class q{name;#e=new Set;#n=new Set;constructor(e){this.name=e}addIdentifier(e){this.#e.add(e)}hasIdentifier(e){return this.#e.has(e)}hasIdentifiers(){return this.#e.size>0}addFunction(e){this.#n.add(e)}hasFunction(e){return this.#n.has(e)}hasFunctions(){return this.#n.size>0}}class I{#t=new Map;#a=new Set;addProperty(e){if(this.#t.has(e))return this.#t.get(e);const n=new q(e);return this.#t.set(e,n),n}hasProperty(e){return this.#t.has(e)}getProperty(e){return this.#t.get(e)}hasPropertyIdentifier(e,n){const t=this.#t.get(e);return!!t&&t.hasIdentifier(n)}hasPropertyIdentifiers(e){const n=this.#t.get(e);return!!n&&n.hasIdentifiers()}hasFunction(e,n){const t=this.#t.get(e);return!!t&&t.hasFunction(n)}hasFunctions(e){const n=this.#t.get(e);return!!n&&n.hasFunctions()}addSelector(e){this.#a.add(e)}hasSelector(e){return this.#a.has(e)}}class F{#o=[];push(e){this.#o.push(e)}pop(){return this.#o.pop()}last(){return this.#o.at(-1)}hasProperty(e){return this.#o.some(n=>n.hasProperty(e))}hasPropertyIdentifier(e,n){return this.#o.some(t=>t.hasPropertyIdentifier(e,n))}hasPropertyIdentifiers(e){return this.#o.some(n=>n.hasPropertyIdentifiers(e))}hasPropertyFunction(e,n){return this.#o.some(t=>t.hasFunction(e,n))}hasPropertyFunctions(e){return this.#o.some(n=>n.hasFunctions(e))}hasSelector(e){return this.#o.some(n=>n.hasSelector(e))}}class A{#r=void 0;#i=void 0;constructor(e="widely"){this.availability=e,"number"==typeof e?this.#r=e:this.#i="widely"===e?10:5}isSupported(e){const n=e.split(":"),t=Number(n[0]),a=Number(n[1]||NaN);return this.#r?a<=this.#r:t>=this.#i}}const $=(t,c)=>(h,b)=>{if(!j(b,S,{actual:t,possible:[!0]},{actual:c,possible:{available:["widely","newly",d],ignoreAtRules:[m,u],ignoreProperties:k(m,u),ignoreSelectors:[m,u],ignoreFunctions:[m,u]},optional:!0}))return;const f=new A(c?.available),M=new F;function x(t){const a=new I;M.push(a);const r=[];try{const i=e(t.params,{context:"atrulePrelude",atrule:"supports",parseAtrulePrelude:!0,positions:!0});let c=!1,d=0;if(n(i,{enter(e){if(!c){if("Identifier"===e.type&&"not"===e.name)return c=!0,void d++;if("SupportsDeclaration"===e.type){const{declaration:n}=e,i=n.property,l=a.addProperty(i);let c=!1;if(o.has(i)){const e=o.get(i);c=f.isSupported(e)}const d=e.loc?.start?.offset||0,u=e.loc?.end?.offset||0,m=t.params.substring(d,u);let h=!c;n.value.children.forEach(e=>{if("Identifier"===e.type){if(l.addIdentifier(e.name),h)return;const n=e.name;if(y.has(n))return;if(p.has(i)){const e=p.get(i);e.has(n)&&f.isSupported(e.get(n))||(h=!0)}}else if("Function"===e.type){if(l.addFunction(e.name),h)return;s.has(e.name)&&f.isSupported(s.get(e.name))||(h=!0)}}),h||r.push({conditionText:m,startIndex:d,endIndex:u})}if("FeatureFunction"===e.type&&"selector"===e.feature){const n=e.loc?.start?.offset||0,o=e.loc?.end?.offset||0,i=t.params.substring(n,o);let s=!1;for(const n of e.value.children)a.addSelector(n.name),s||l.has(n.name)&&f.isSupported(l.get(n.name))||(s=!0);s||r.push({conditionText:i,startIndex:n,endIndex:o})}}},leave(){c&&(0===d?c=!1:d--)}}),r.length>0){const e=N(t);r.forEach(n=>{v({ruleName:S,message:P.unnecessarySupports,messageArgs:[n.conditionText,f.availability],result:b,node:t,index:e+n.startIndex,endIndex:e+n.endIndex})})}}catch{}t.each(e=>{if("supports"!==e.name){switch(e.type){case"atrule":z(e);break;case"decl":q(e);break;case"rule":$(e)}"function"==typeof e.walk&&e.walk(e=>{switch(e.type){case"atrule":z(e);break;case"decl":q(e);break;case"rule":$(e)}})}else x(e)}),M.pop()}function z(t){const{name:a}=t;if("supports"===a.toLowerCase())return void x(t);if("media"===a)return void function(t){const a=t.params;try{const o=e(a,{context:"atrulePrelude",atrule:"media",parseAtrulePrelude:!0,positions:!0});n(o,e=>{if("Feature"===e.type){const n=e.name;if(!i.has(n))return;const a=i.get(n);if(!f.isSupported(a)){const a=N(t),o=e.loc.start.column,r=o+n.length;v({ruleName:S,result:b,message:P.notBaselineMediaCondition(n,f.availability),node:t,index:a+o,endIndex:a+r})}}})}catch{}}(t);if(g(c,"ignoreAtRules",a))return;if(!r.has(a))return;const o=r.get(a);f.isSupported(o)||v({ruleName:S,message:P.notBaselineAtRule,messageArgs:[`@${a}`,f.availability],result:b,node:t,index:0,endIndex:a.length+1})}function q(e){const{prop:n,value:t}=e;if(function(e,n){if(M.hasProperty(n))return;if(function(e,n){const t=e?.ignoreProperties;if(!t)return!1;for(const[e]of Object.entries(t))if(w(n,e))return!0;return!1}(c,n))return;if(!o.has(n))return;const t=o.get(n);if(!f.isSupported(t))return v({ruleName:S,message:P.notBaselineProperty,messageArgs:[n,f.availability],result:b,node:e,word:n}),!0;return!1}(e,n))return;a(t).walk(t=>{"word"===t.type?function(e,n,t){if(M.hasPropertyIdentifier(n,t))return;if(function(e,n,t){const a=e?.ignoreProperties;if(!a)return!1;for(const[e,o]of Object.entries(a))if(w(n,e)){if(0===o.length)return!1;for(const e of o)if(w(t,e))return!0}return!1}(c,n,t))return;if(y.has(t))return;if(!p.has(n))return;const a=p.get(n);if(!a.has(t))return;const o=a.get(t);f.isSupported(o)||v({ruleName:S,message:P.notBaselinePropertyValue,messageArgs:[n,t,f.availability],result:b,node:e,word:t})}(e,n,t.value):"function"===t.type&&function(e,n){if(g(c,"ignoreFunctions",n))return;if(M.hasPropertyFunction(e.prop,n))return;if(!s.has(n))return;const t=s.get(n);f.isSupported(t)||v({ruleName:S,message:P.notBaselineFunction,messageArgs:[n,f.availability],result:b,node:e,word:n})}(e,t.value)})}function $(t){const{selector:a}=t;try{const o=e(a,{context:"selector",positions:!0});n(o,e=>{let n=e.name;const a=e.type;if("NestingSelector"===a)n="nesting";else if("PseudoClassSelector"!==a&&"PseudoElementSelector"!==a)return;if(g(c,"ignoreSelectors",n))return;if(M.hasSelector(n))return;if(!l.has(n))return;const o=l.get(n);if(!f.isSupported(o)){let a=0;"PseudoClassSelector"===e.type?a=1:"PseudoElementSelector"===e.type&&(a=2);const o=e.loc.start.offset;let r=o;"nesting"!==n&&(r+=n.length+a),v({ruleName:S,result:b,message:P.notBaselineSelector(n,f.availability),node:t,index:o,endIndex:r})}})}catch{}}h.walkAtRules(/^supports$/i,e=>{B(e)||x(e)}),h.walk(e=>{if(("atrule"!==e.type||"supports"!==e.name.toLowerCase())&&!B(e))switch(e.type){case"atrule":z(e);break;case"rule":$(e);break;case"decl":q(e)}})};function B(e){let n=e.parent;for(;n;){if("atrule"===n.type&&"supports"===n.name)return!0;n=n.parent}return!1}function N(e){return 1+e.name.length+(e.raws.afterName?.length??0)}$.ruleName=S,$.messages=P;var R=x(S,$);export{R as default};
8
+ function c(e){return"[object Object]"===Object.prototype.toString.call(e)}function d(e){return"number"==typeof e||e instanceof Number}function u(e){return e instanceof RegExp}function m(e){return"string"==typeof e||e instanceof String}function h(e){return!1!==c(n=e)&&(void 0===(t=n.constructor)||!1!==c(a=t.prototype)&&!1!==a.hasOwnProperty("isPrototypeOf"));var n,t,a}function g(e,n,t){return Boolean(e&&e[n]&&"string"==typeof t&&w(t,e[n]))}function w(e,n){if(!Array.isArray(e))return b(e,n);for(const t of e){const e=b(t,n);if(e)return e}return!1}function b(e,n){if(!Array.isArray(n))return M(e,n);for(const t of n){const n=M(e,t);if(n)return n}return!1}function f(e,n){const t=e.match(n);return!!t&&{match:e,pattern:n,substring:t[0]??""}}function M(e,n){if(n instanceof RegExp)return f(e,n);if(n.startsWith("/")&&(n.endsWith("/")||n.endsWith("/i"))){const t=f(e,n.endsWith("i")?new RegExp(n.slice(1,-2),"i"):new RegExp(n.slice(1,-1)));return t&&(t.pattern=n),t}return e===n&&{match:e,pattern:n,substring:e}}const y=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]);function k(...e){return n=>!!h(n)&&Object.values(n).flat().every(n=>e.some(e=>e(n)))}const{createPlugin:x,utils:{report:v,ruleMessages:z,validateOptions:j}}=t,S="plugin/use-baseline",P=z(S,{notBaselineProperty:(e,n)=>`Property "${e}" is not a ${n} available baseline feature.`,notBaselinePropertyValue:(e,n,t)=>`Value "${n}" of property "${e}" is not a ${t} available baseline feature.`,notBaselineFunction:(e,n)=>`Function "${e}" is not a ${n} available baseline feature.`,notBaselineAtRule:(e,n)=>`At-rule "${e}" is not a ${n} available baseline feature.`,notBaselineMediaCondition:(e,n)=>`Media condition "${e}" is not a ${n} available baseline feature.`,notBaselineSelector:(e,n)=>`Selector "${e}" is not a ${n} available baseline feature.`,unnecessarySupports:(e,n)=>`@supports ${e} is unnecessary as the feature meets the ${n} availability requirement.`});class q{name;#e=new Set;#n=new Set;constructor(e){this.name=e}addIdentifier(e){this.#e.add(e)}hasIdentifier(e){return this.#e.has(e)}hasIdentifiers(){return this.#e.size>0}addFunction(e){this.#n.add(e)}hasFunction(e){return this.#n.has(e)}hasFunctions(){return this.#n.size>0}}class I{#t=new Map;#a=new Set;addProperty(e){if(this.#t.has(e))return this.#t.get(e);const n=new q(e);return this.#t.set(e,n),n}hasProperty(e){return this.#t.has(e)}getProperty(e){return this.#t.get(e)}hasPropertyIdentifier(e,n){const t=this.#t.get(e);return!!t&&t.hasIdentifier(n)}hasPropertyIdentifiers(e){const n=this.#t.get(e);return!!n&&n.hasIdentifiers()}hasFunction(e,n){const t=this.#t.get(e);return!!t&&t.hasFunction(n)}hasFunctions(e){const n=this.#t.get(e);return!!n&&n.hasFunctions()}addSelector(e){this.#a.add(e)}hasSelector(e){return this.#a.has(e)}}class F{#o=[];push(e){this.#o.push(e)}pop(){return this.#o.pop()}last(){return this.#o.at(-1)}hasProperty(e){return this.#o.some(n=>n.hasProperty(e))}hasPropertyIdentifier(e,n){return this.#o.some(t=>t.hasPropertyIdentifier(e,n))}hasPropertyIdentifiers(e){return this.#o.some(n=>n.hasPropertyIdentifiers(e))}hasPropertyFunction(e,n){return this.#o.some(t=>t.hasFunction(e,n))}hasPropertyFunctions(e){return this.#o.some(n=>n.hasFunctions(e))}hasSelector(e){return this.#o.some(n=>n.hasSelector(e))}}class A{#r=void 0;#i=void 0;constructor(e="widely"){this.availability=e,"number"==typeof e?this.#r=e:this.#i="widely"===e?10:5}isSupported(e){const n=e.split(":"),t=Number(n[0]),a=Number(n[1]||NaN);return this.#r?a<=this.#r:t>=this.#i}}const $=(t,c)=>(h,b)=>{if(!j(b,S,{actual:t,possible:[!0]},{actual:c,possible:{available:["widely","newly",d],ignoreAtRules:[m,u],ignoreProperties:k(m,u),ignoreSelectors:[m,u],ignoreFunctions:[m,u]},optional:!0}))return;const f=new A(c?.available),M=new F;function x(t){const a=new I;M.push(a);const r=[];try{const i=e(t.params,{context:"atrulePrelude",atrule:"supports",parseAtrulePrelude:!0,positions:!0});let c=!1,d=0;if(n(i,{enter(e){if(!c){if("Identifier"===e.type&&"not"===e.name)return c=!0,void d++;if("SupportsDeclaration"===e.type){const{declaration:n}=e,i=n.property,l=a.addProperty(i);let c=!1;if(o.has(i)){const e=o.get(i);c=f.isSupported(e)}const d=e.loc?.start?.offset||0,u=e.loc?.end?.offset||0,m=t.params.substring(d,u);let h=!c;n.value.children.forEach(e=>{if("Identifier"===e.type){if(l.addIdentifier(e.name),h)return;const n=e.name;if(y.has(n))return;if(p.has(i)){const e=p.get(i);e.has(n)&&f.isSupported(e.get(n))||(h=!0)}}else if("Function"===e.type){if(l.addFunction(e.name),h)return;s.has(e.name)&&f.isSupported(s.get(e.name))||(h=!0)}}),h||r.push({conditionText:m,startIndex:d,endIndex:u})}if("FeatureFunction"===e.type&&"selector"===e.feature){const n=e.loc?.start?.offset||0,o=e.loc?.end?.offset||0,i=t.params.substring(n,o);let s=!1;for(const n of e.value.children)a.addSelector(n.name),s||l.has(n.name)&&f.isSupported(l.get(n.name))||(s=!0);s||r.push({conditionText:i,startIndex:n,endIndex:o})}}},leave(){c&&(0===d?c=!1:d--)}}),r.length>0){const e=N(t);r.forEach(n=>{v({ruleName:S,message:P.unnecessarySupports,messageArgs:[n.conditionText,f.availability],result:b,node:t,index:e+n.startIndex,endIndex:e+n.endIndex})})}}catch{}t.each(e=>{if("supports"!==e.name){switch(e.type){case"atrule":z(e);break;case"decl":q(e);break;case"rule":$(e)}"function"==typeof e.walk&&e.walk(e=>{switch(e.type){case"atrule":z(e);break;case"decl":q(e);break;case"rule":$(e)}})}else x(e)}),M.pop()}function z(t){const{name:a}=t;if("supports"===a.toLowerCase())return void x(t);if("media"===a)return void function(t){const a=t.params;try{const o=e(a,{context:"atrulePrelude",atrule:"media",parseAtrulePrelude:!0,positions:!0});n(o,e=>{if("Feature"===e.type){const n=e.name;if(!i.has(n))return;const a=i.get(n);if(!f.isSupported(a)){const a=N(t),o=e.loc.start.column,r=o+n.length;v({ruleName:S,result:b,message:P.notBaselineMediaCondition(n,f.availability),node:t,index:a+o,endIndex:a+r})}}})}catch{}}(t);if(g(c,"ignoreAtRules",a))return;if(!r.has(a))return;const o=r.get(a);f.isSupported(o)||v({ruleName:S,message:P.notBaselineAtRule,messageArgs:[`@${a}`,f.availability],result:b,node:t,index:0,endIndex:a.length+1})}function q(e){const{prop:n,value:t}=e;if(function(e,n){if(M.hasProperty(n))return;if(function(e,n){const t=e?.ignoreProperties;if(!t)return!1;for(const[e]of Object.entries(t))if(w(n,e))return!0;return!1}(c,n))return;if(!o.has(n))return;const t=o.get(n);if(!f.isSupported(t))return v({ruleName:S,message:P.notBaselineProperty,messageArgs:[n,f.availability],result:b,node:e,word:n}),!0;return!1}(e,n))return;a(t).walk(t=>{"word"===t.type?function(e,n,t){if(M.hasPropertyIdentifier(n,t))return;if(function(e,n,t){const a=e?.ignoreProperties;if(!a)return!1;for(const[e,o]of Object.entries(a))if(w(n,e)){if(0===o.length)return!1;for(const e of o)if(w(t,e))return!0}return!1}(c,n,t))return;if(y.has(t))return;if(!p.has(n))return;const a=p.get(n);if(!a.has(t))return;const o=a.get(t);f.isSupported(o)||v({ruleName:S,message:P.notBaselinePropertyValue,messageArgs:[n,t,f.availability],result:b,node:e,word:t})}(e,n,t.value):"function"===t.type&&function(e,n){if(g(c,"ignoreFunctions",n))return;if(M.hasPropertyFunction(e.prop,n))return;if(!s.has(n))return;const t=s.get(n);f.isSupported(t)||v({ruleName:S,message:P.notBaselineFunction,messageArgs:[n,f.availability],result:b,node:e,word:n})}(e,t.value)})}function $(t){const{selector:a}=t;try{const o=e(a,{context:"selectorList",positions:!0});n(o,e=>{let n=e.name;const a=e.type;if("NestingSelector"===a)n="nesting";else if("PseudoClassSelector"!==a&&"PseudoElementSelector"!==a)return;if(g(c,"ignoreSelectors",n))return;if(M.hasSelector(n))return;if(!l.has(n))return;const o=l.get(n);if(!f.isSupported(o)){let a=0;"PseudoClassSelector"===e.type?a=1:"PseudoElementSelector"===e.type&&(a=2);const o=e.loc.start.offset;let r=o;"nesting"!==n&&(r+=n.length+a),v({ruleName:S,result:b,message:P.notBaselineSelector(n,f.availability),node:t,index:o,endIndex:r})}})}catch{}}h.walkAtRules(/^supports$/i,e=>{B(e)||x(e)}),h.walk(e=>{if(("atrule"!==e.type||"supports"!==e.name.toLowerCase())&&!B(e))switch(e.type){case"atrule":z(e);break;case"rule":$(e);break;case"decl":q(e)}})};function B(e){let n=e.parent;for(;n;){if("atrule"===n.type&&"supports"===n.name)return!0;n=n.parent}return!1}function N(e){return 1+e.name.length+(e.raws.afterName?.length??0)}$.ruleName=S,$.messages=P;var R=x(S,$);export{R as default};
9
9
  //# sourceMappingURL=index.js.map