"use strict";var e=require("postcss-selector-parser");const s="js-focus-visible",o=":focus-visible",creator=n=>{const r=Object.assign({preserve:!0,replaceWith:".focus-visible",disablePolyfillReadyClass:!1},n),t=e().astSync(r.replaceWith);return{postcssPlugin:"postcss-focus-visible",prepare(){const n=new WeakSet;return{Rule(l,{result:a}){if(n.has(l))return;if(!l.selector.toLowerCase().includes(o))return;const i=l.selectors.flatMap((n=>{if(!n.toLowerCase().includes(o))return[n];let i;try{i=e().astSync(n)}catch(e){return l.warn(a,`Failed to parse selector : "${n}" with message: "${e.message}"`),n}if(void 0===i)return[n];let c=!1;if(i.walkPseudos((e=>{e.value.toLowerCase()===o&&(e.nodes&&e.nodes.length||(c=!0,e.replaceWith(t.clone({}))))})),!c)return[n];const u=i.clone();if(!r.disablePolyfillReadyClass){var d,p,f,v,b;if(null!=(d=i.nodes)&&null!=(p=d[0])&&null!=(f=p.nodes)&&f.length)for(let o=0;o