import t from"../../../../../_virtual/_node_path.mjs";import{__require as e}from"./scan.mjs";import{__require as r}from"./parse.mjs";import{__require as o}from"./utils.mjs";import{__require as n}from"./constants.mjs";var s,a;function i(){if(a)return s;a=1;const i=t,p=e(),u=r(),c=o(),m=n(),f=(t,e,r=!1)=>{if(Array.isArray(t)){const o=t.map(t=>f(t,e,r)),n=t=>{for(const e of o){const r=e(t);if(r)return r}return!1};return n}const o=(n=t)&&"object"==typeof n&&!Array.isArray(n)&&t.tokens&&t.input;var n;if(""===t||"string"!=typeof t&&!o)throw new TypeError("Expected pattern to be a non-empty string");const s=e||{},a=c.isWindows(e),i=o?f.compileRe(t,e):f.makeRe(t,e,!1,!0),p=i.state;delete i.state;let u=()=>!1;if(s.ignore){const t={...e,ignore:null,onMatch:null,onResult:null};u=f(s.ignore,t,r)}const m=(r,o=!1)=>{const{isMatch:n,match:c,output:m}=f.test(r,i,e,{glob:t,posix:a}),l={glob:t,state:p,regex:i,posix:a,input:r,output:m,match:c,isMatch:n};return"function"==typeof s.onResult&&s.onResult(l),!1===n?(l.isMatch=!1,!!o&&l):u(r)?("function"==typeof s.onIgnore&&s.onIgnore(l),l.isMatch=!1,!!o&&l):("function"==typeof s.onMatch&&s.onMatch(l),!o||l)};return r&&(m.state=p),m};return f.test=(t,e,r,{glob:o,posix:n}={})=>{if("string"!=typeof t)throw new TypeError("Expected input to be a string");if(""===t)return{isMatch:!1,output:""};const s=r||{},a=s.format||(n?c.toPosixSlashes:null);let i=t===o,p=i&&a?a(t):t;return!1===i&&(p=a?a(t):t,i=p===o),!1!==i&&!0!==s.capture||(i=!0===s.matchBase||!0===s.basename?f.matchBase(t,e,r,n):e.exec(p)),{isMatch:Boolean(i),match:i,output:p}},f.matchBase=(t,e,r,o=c.isWindows(r))=>(e instanceof RegExp?e:f.makeRe(e,r)).test(i.basename(t)),f.isMatch=(t,e,r)=>f(e,r)(t),f.parse=(t,e)=>Array.isArray(t)?t.map(t=>f.parse(t,e)):u(t,{...e,fastpaths:!1}),f.scan=(t,e)=>p(t,e),f.compileRe=(t,e,r=!1,o=!1)=>{if(!0===r)return t.output;const n=e||{},s=n.contains?"":"^",a=n.contains?"":"$";let i=`${s}(?:${t.output})${a}`;t&&!0===t.negated&&(i=`^(?!${i}).*$`);const p=f.toRegex(i,e);return!0===o&&(p.state=t),p},f.makeRe=(t,e={},r=!1,o=!1)=>{if(!t||"string"!=typeof t)throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return!1===e.fastpaths||"."!==t[0]&&"*"!==t[0]||(n.output=u.fastpaths(t,e)),n.output||(n=u(t,e)),f.compileRe(n,e,r,o)},f.toRegex=(t,e)=>{try{const r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(t){if(e&&!0===e.debug)throw t;return/$^/}},f.constants=m,s=f}export{i as __require};import p from"node:url";import u from"node:path";import c from"node:module";const m=p.fileURLToPath(import.meta.url);u.dirname(m),c.createRequire(import.meta.url);