#!/usr/bin/env node

"use strict";var e=require("postcss-selector-parser"),t=require("tty"),r=require("path"),n=require("url"),s=require("fs");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(e),a=i(t),l=i(r),u=i(n),c=i(s);const h=e=>{e="object"==typeof e&&e||p;const t=Boolean(!("preserve"in e)||e.preserve);return{postcssPlugin:"css-has-pseudo",Rule:(e,{result:r})=>{if(!e.selector.includes(":has("))return;let n;try{const t=o.default((e=>{e.walkPseudos((e=>{if(":has"===e.value&&e.nodes){const t=d(e);e.value=t?":not-has":":has";const r=o.default.attribute({attribute:f(String(e))});t?e.parent.parent.replaceWith(r):e.replaceWith(r)}}))})).processSync(e.selector);n=String(t)}catch(t){return void e.warn(r,`Failed to parse selector : ${e.selector}`)}void 0!==n&&n!==e.selector&&(t?e.cloneBefore({selector:n}):e.selector=n)}}};h.postcss=!0;const p={preserve:!0},f=e=>{let t="",r="";const n=()=>{if(r){const e=encodeURIComponent(r);let n="",s="";const i=()=>{n&&(s+=n,n="")};let o=!1;for(let t=0;t<e.length;t++){const r=e[t];if(o)n+=r,o=!1;else switch(r){case"%":i(),s+="\\"+r;continue;case"\\":n+=r,o=!0;continue;default:n+=r;continue}}i(),t+=s,r=""}};let s=!1;for(let i=0;i<e.length;i++){const o=e[i];if(s)r+=o,s=!1;else switch(o){case":":case"[":case"]":case",":case"(":case")":n(),t+="\\"+o;continue;case"\\":r+=o,s=!0;continue;default:r+=o;continue}}return n(),t},d=e=>{var t,r;return"pseudo"===(null==(t=e.parent)||null==(r=t.parent)?void 0:r.type)&&":not"===e.parent.parent.value};var g;!function(e){e.InvalidArguments="INVALID_ARGUMENTS"}(g||(g={}));var m={exports:{}};let w=a.default,y=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||w.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),v=(e,t,r=e)=>n=>{let s=""+n,i=s.indexOf(t,e.length);return~i?e+S(s,t,r,i)+t:e+s+t},S=(e,t,r,n)=>{let s=e.substring(0,n)+r,i=e.substring(n+t.length),o=i.indexOf(t);return~o?s+S(i,t,r,o):s+i},C=(e=y)=>({isColorSupported:e,reset:e?e=>`