@mherod/get-cookie 4.0.3 → 4.0.4

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.
Files changed (50) hide show
  1. package/.husky/commit-msg +0 -0
  2. package/.husky/pre-commit +0 -0
  3. package/.husky/pre-push +0 -0
  4. package/.idea/prettier.xml +2 -1
  5. package/dist/chunk-A6MIB6FP.js +2 -0
  6. package/dist/chunk-A6MIB6FP.js.map +1 -0
  7. package/dist/chunk-CFMK2YSL.js +2 -0
  8. package/dist/chunk-CFMK2YSL.js.map +1 -0
  9. package/dist/chunk-IRERRCUF.js +2 -0
  10. package/dist/chunk-IRERRCUF.js.map +1 -0
  11. package/dist/chunk-UPNW543B.js +2 -0
  12. package/dist/chunk-UPNW543B.js.map +1 -0
  13. package/dist/cli.cjs +2 -3
  14. package/dist/cli.cjs.map +1 -1
  15. package/dist/{getChromeCookie-4ZWACG6M.js → getChromeCookie-CL3SRRWX.js} +2 -2
  16. package/dist/getChromeCookie-CL3SRRWX.js.map +1 -0
  17. package/dist/getCookie-WV5KDZN7.js +2 -0
  18. package/dist/getFirefoxCookie-BXQ2GXAW.js +2 -0
  19. package/dist/getFirefoxCookie-BXQ2GXAW.js.map +1 -0
  20. package/dist/getGroupedRenderedCookies-FNJ6FQVQ.js +2 -0
  21. package/dist/getGroupedRenderedCookies-FNJ6FQVQ.js.map +1 -0
  22. package/dist/getMergedRenderedCookies-PNC2LHSD.js +2 -0
  23. package/dist/getMergedRenderedCookies-PNC2LHSD.js.map +1 -0
  24. package/dist/index.cjs +3 -3
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +164 -152
  27. package/dist/index.d.ts +164 -152
  28. package/dist/index.js +1 -1
  29. package/dist/index.js.map +1 -1
  30. package/eslint.config.js +2 -1
  31. package/package.json +23 -19
  32. package/typedoc.json +3 -8
  33. package/dist/chunk-5ZT2G45S.js +0 -2
  34. package/dist/chunk-5ZT2G45S.js.map +0 -1
  35. package/dist/chunk-FR2MKDHT.js +0 -2
  36. package/dist/chunk-FR2MKDHT.js.map +0 -1
  37. package/dist/chunk-HMKSQBDC.js +0 -2
  38. package/dist/chunk-HMKSQBDC.js.map +0 -1
  39. package/dist/chunk-W3JALMAX.js +0 -2
  40. package/dist/chunk-W3JALMAX.js.map +0 -1
  41. package/dist/getChromeCookie-4ZWACG6M.js.map +0 -1
  42. package/dist/getCookie-43FKMQEZ.js +0 -2
  43. package/dist/getFirefoxCookie-OJYYZFZP.js +0 -2
  44. package/dist/getFirefoxCookie-OJYYZFZP.js.map +0 -1
  45. package/dist/getGroupedRenderedCookies-P5VZXZUC.js +0 -2
  46. package/dist/getGroupedRenderedCookies-P5VZXZUC.js.map +0 -1
  47. package/dist/getMergedRenderedCookies-C6TXK2I4.js +0 -2
  48. package/dist/getMergedRenderedCookies-C6TXK2I4.js.map +0 -1
  49. package/tsup.config.ts +0 -27
  50. /package/dist/{getCookie-43FKMQEZ.js.map → getCookie-WV5KDZN7.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as t}from"./chunk-5ZT2G45S.js";import"./chunk-5FUMK7M3.js";import{a as r}from"./chunk-56Z35D5R.js";import"./chunk-VMBA4NVU.js";async function i(o){try{return await new t().queryCookies(o.name,o.domain)}catch(e){return r.warn("Error querying Chrome cookies:",e),[]}}var k=i;export{k as default,i as getChromeCookie};
2
- //# sourceMappingURL=getChromeCookie-4ZWACG6M.js.map
1
+ import{a as t}from"./chunk-UPNW543B.js";import"./chunk-5FUMK7M3.js";import{a as r}from"./chunk-56Z35D5R.js";import"./chunk-VMBA4NVU.js";async function i(o){try{return await new t().queryCookies(o.name,o.domain)}catch(e){return r.warn("Error querying Chrome cookies:",e),[]}}var a=i;export{a as default,i as getChromeCookie};
2
+ //# sourceMappingURL=getChromeCookie-CL3SRRWX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/cookies/getChromeCookie.ts"],"sourcesContent":["import type { CookieSpec, ExportedCookie } from \"../../types/schemas\";\nimport logger from \"../../utils/logger\";\nimport { ChromeCookieQueryStrategy } from \"../browsers/chrome/ChromeCookieQueryStrategy\";\n\n/**\n * Retrieves cookies from Chrome browser storage that match the specified criteria.\n * @param cookieSpec - The cookie specification containing search criteria\n * @param cookieSpec.name - The name of the cookie to search for\n * @param cookieSpec.domain - (optional) The domain to filter cookies by\n * @returns An array of ExportedCookie objects that match the specification\n * @throws Will catch and handle any errors during cookie querying, logging a warning\n * to the console without throwing to the caller\n * @example\n * ```typescript\n * // Get all cookies named \"sessionId\" from Chrome\n * const cookies = await getChromeCookie({ name: \"sessionId\" });\n *\n * // Get cookies named \"userPref\" from specific domain in Chrome\n * const domainCookies = await getChromeCookie({\n * name: \"userPref\",\n * domain: \"example.com\"\n * });\n * ```\n */\nexport async function getChromeCookie(\n cookieSpec: CookieSpec,\n): Promise<ExportedCookie[]> {\n try {\n const strategy = new ChromeCookieQueryStrategy();\n const cookies = await strategy.queryCookies(\n cookieSpec.name,\n cookieSpec.domain,\n );\n return cookies;\n } catch (error: unknown) {\n logger.warn(\"Error querying Chrome cookies:\", error);\n return [];\n }\n}\n\n/**\n * Default export of the getChromeCookie function.\n * @example\n * ```typescript\n * import getChromeCookie from './getChromeCookie';\n * const cookies = await getChromeCookie({\n * name: \"sessionId\",\n * domain: \"example.com\"\n * });\n * ```\n */\nexport default getChromeCookie;\n"],"mappings":"wIAwBA,eAAsBA,EACpBC,EAC2B,CAC3B,GAAI,CAMF,OAJgB,MADC,IAAIC,EAA0B,EAChB,aAC7BD,EAAW,KACXA,EAAW,MACb,CAEF,OAASE,EAAgB,CACvB,OAAAC,EAAO,KAAK,iCAAkCD,CAAK,EAC5C,CAAC,CACV,CACF,CAaA,IAAOE,EAAQL","names":["getChromeCookie","cookieSpec","ChromeCookieQueryStrategy","error","logger_default","getChromeCookie_default"]}
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-CFMK2YSL.js";import"./chunk-UPNW543B.js";import"./chunk-IRERRCUF.js";import"./chunk-5FUMK7M3.js";import"./chunk-56Z35D5R.js";import"./chunk-VMBA4NVU.js";export{b as default,a as getCookie};
2
+ //# sourceMappingURL=getCookie-WV5KDZN7.js.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-IRERRCUF.js";import"./chunk-5FUMK7M3.js";import{a as r}from"./chunk-56Z35D5R.js";import"./chunk-VMBA4NVU.js";async function i(e){try{return await new t().queryCookies(e.name,e.domain)}catch(o){return r.warn("Error querying Firefox cookies:",o instanceof Error?o.message:String(o)),[]}}var c=i;export{c as default,i as getFirefoxCookie};
2
+ //# sourceMappingURL=getFirefoxCookie-BXQ2GXAW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/cookies/getFirefoxCookie.ts"],"sourcesContent":["import type { CookieSpec, ExportedCookie } from \"../../types/schemas\";\nimport logger from \"../../utils/logger\";\nimport { FirefoxCookieQueryStrategy } from \"../browsers/firefox/FirefoxCookieQueryStrategy\";\n\n/**\n * Retrieves cookies from Firefox browser storage that match the specified criteria.\n * @param cookieSpec - The cookie specification containing search criteria\n * @param cookieSpec.name - The name of the cookie to search for\n * @param cookieSpec.domain - (optional) The domain to filter cookies by\n * @returns An array of ExportedCookie objects that match the specification\n * @throws Will catch and handle any errors during cookie querying, logging a warning\n * to the console without throwing to the caller\n * @example\n * ```typescript\n * // Get all cookies named \"sessionId\" from Firefox\n * const cookies = await getFirefoxCookie({ name: \"sessionId\" });\n *\n * // Get cookies named \"userPref\" from specific domain in Firefox\n * const domainCookies = await getFirefoxCookie({\n * name: \"userPref\",\n * domain: \"example.com\"\n * });\n * ```\n */\nexport async function getFirefoxCookie(\n cookieSpec: CookieSpec,\n): Promise<ExportedCookie[]> {\n try {\n const strategy = new FirefoxCookieQueryStrategy();\n const cookies = await strategy.queryCookies(\n cookieSpec.name,\n cookieSpec.domain,\n );\n return cookies;\n } catch (error: unknown) {\n logger.warn(\n \"Error querying Firefox cookies:\",\n error instanceof Error ? error.message : String(error),\n );\n return [];\n }\n}\n\n/**\n * Default export of the getFirefoxCookie function.\n * @example\n * ```typescript\n * import getFirefoxCookie from './getFirefoxCookie';\n * const sessionCookies = await getFirefoxCookie({\n * name: \"PHPSESSID\",\n * domain: \"example.com\"\n * });\n * ```\n */\nexport default getFirefoxCookie;\n"],"mappings":"wIAwBA,eAAsBA,EACpBC,EAC2B,CAC3B,GAAI,CAMF,OAJgB,MADC,IAAIC,EAA2B,EACjB,aAC7BD,EAAW,KACXA,EAAW,MACb,CAEF,OAASE,EAAgB,CACvB,OAAAC,EAAO,KACL,kCACAD,aAAiB,MAAQA,EAAM,QAAU,OAAOA,CAAK,CACvD,EACO,CAAC,CACV,CACF,CAaA,IAAOE,EAAQL","names":["getFirefoxCookie","cookieSpec","FirefoxCookieQueryStrategy","error","logger_default","getFirefoxCookie_default"]}
@@ -0,0 +1,2 @@
1
+ import{a as i,b as n}from"./chunk-A6MIB6FP.js";import{a as t}from"./chunk-CFMK2YSL.js";import"./chunk-UPNW543B.js";import"./chunk-IRERRCUF.js";import"./chunk-5FUMK7M3.js";import{a as e}from"./chunk-56Z35D5R.js";import"./chunk-VMBA4NVU.js";async function c(s,a={}){try{let r=await t(s);if(!Array.isArray(r))return[];let m=r.filter(p=>{let o=i.safeParse(p);return o.success?!0:(e.warn("Invalid cookie format:",o.error.format()),!1)});return n(m,{...a,format:"grouped"})}catch(r){return e.warn("Error getting grouped rendered cookies:",r instanceof Error?r.message:String(r)),[]}}var g=c;export{g as default,c as getGroupedRenderedCookies};
2
+ //# sourceMappingURL=getGroupedRenderedCookies-FNJ6FQVQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/cookies/getGroupedRenderedCookies.ts"],"sourcesContent":["import type {\n RenderOptions,\n CookieSpec,\n ExportedCookie,\n} from \"../../types/schemas\";\nimport { ExportedCookieSchema } from \"../../types/schemas\";\nimport logger from \"../../utils/logger\";\n\nimport { getCookie } from \"./getCookie\";\nimport { renderCookies } from \"./renderCookies\";\n\n/**\n * Retrieves and renders cookies in a grouped format based on their source files.\n * @param cookieSpec - The cookie specification containing search criteria\n * @param cookieSpec.name - The name of the cookie to search for\n * @param cookieSpec.domain - (optional) The domain to filter cookies by\n * @param options - Options for rendering the cookies\n * @param options.showFilePaths - Whether to include file paths in the output\n * @param options.separator - Custom separator for cookie values\n * @returns An array of strings, each representing a group of cookies from a source file\n * @example\n * ```typescript\n * // Basic usage - get all cookies named \"sessionId\" grouped by source file\n * const cookies = await getGroupedRenderedCookies({ name: \"sessionId\" });\n *\n * // Get cookies with domain filter and custom rendering options\n * const domainCookies = await getGroupedRenderedCookies(\n * {\n * name: \"userPref\",\n * domain: \"example.com\"\n * },\n * {\n * showFilePaths: true,\n * separator: \" | \"\n * }\n * );\n * ```\n */\nexport async function getGroupedRenderedCookies(\n cookieSpec: CookieSpec,\n options: Omit<RenderOptions, \"format\"> = {},\n): Promise<string[]> {\n try {\n const cookies = await getCookie(cookieSpec);\n if (!Array.isArray(cookies)) {\n return [];\n }\n\n // Validate each cookie against the schema\n const validatedCookies = cookies.filter(\n (cookie): cookie is ExportedCookie => {\n const result = ExportedCookieSchema.safeParse(cookie);\n if (!result.success) {\n logger.warn(\"Invalid cookie format:\", result.error.format());\n return false;\n }\n return true;\n },\n );\n\n return renderCookies(validatedCookies, {\n ...options,\n format: \"grouped\",\n }) as string[];\n } catch (error: unknown) {\n logger.warn(\n \"Error getting grouped rendered cookies:\",\n error instanceof Error ? error.message : String(error),\n );\n return [];\n }\n}\n\n/**\n * Default export of the getGroupedRenderedCookies function\n * @example\n * ```typescript\n * import getGroupedCookies from './getGroupedRenderedCookies';\n *\n * // Get all session cookies with custom separator\n * const sessionCookies = await getGroupedCookies(\n * { name: \"session_*\" },\n * { separator: \"\\n\" }\n * );\n *\n * // Get cookies from multiple domains\n * const multiDomainCookies = await getGroupedCookies({\n * name: \"tracking\",\n * domain: [\"site1.com\", \"site2.com\"]\n * });\n * ```\n */\nexport default getGroupedRenderedCookies;\n"],"mappings":"+OAsCA,eAAsBA,EACpBC,EACAC,EAAyC,CAAC,EACvB,CACnB,GAAI,CACF,IAAMC,EAAU,MAAMC,EAAUH,CAAU,EAC1C,GAAI,CAAC,MAAM,QAAQE,CAAO,EACxB,MAAO,CAAC,EAIV,IAAME,EAAmBF,EAAQ,OAC9BG,GAAqC,CACpC,IAAMC,EAASC,EAAqB,UAAUF,CAAM,EACpD,OAAKC,EAAO,QAIL,IAHLE,EAAO,KAAK,yBAA0BF,EAAO,MAAM,OAAO,CAAC,EACpD,GAGX,CACF,EAEA,OAAOG,EAAcL,EAAkB,CACrC,GAAGH,EACH,OAAQ,SACV,CAAC,CACH,OAASS,EAAgB,CACvB,OAAAF,EAAO,KACL,0CACAE,aAAiB,MAAQA,EAAM,QAAU,OAAOA,CAAK,CACvD,EACO,CAAC,CACV,CACF,CAqBA,IAAOC,EAAQZ","names":["getGroupedRenderedCookies","cookieSpec","options","cookies","getCookie","validatedCookies","cookie","result","ExportedCookieSchema","logger_default","renderCookies","error","getGroupedRenderedCookies_default"]}
@@ -0,0 +1,2 @@
1
+ import{a as n,b as s}from"./chunk-A6MIB6FP.js";import{a as i}from"./chunk-CFMK2YSL.js";import"./chunk-UPNW543B.js";import"./chunk-IRERRCUF.js";import"./chunk-5FUMK7M3.js";import{a as r}from"./chunk-56Z35D5R.js";import"./chunk-VMBA4NVU.js";async function d(a,m){try{let e=await i(a);if(!Array.isArray(e))return"";let c=e.filter(f=>{let t=n.safeParse(f);return t.success?!0:(r.warn("Invalid cookie format:",t.error.format()),!1)}),o=s(c,{...m,format:"merged"});return typeof o=="string"?o:""}catch(e){return r.warn("Error getting merged rendered cookies:",e instanceof Error?e.message:String(e)),""}}var C=d;export{C as default,d as getMergedRenderedCookies};
2
+ //# sourceMappingURL=getMergedRenderedCookies-PNC2LHSD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/cookies/getMergedRenderedCookies.ts"],"sourcesContent":["import type {\n RenderOptions,\n CookieSpec,\n ExportedCookie,\n} from \"../../types/schemas\";\nimport { ExportedCookieSchema } from \"../../types/schemas\";\nimport logger from \"../../utils/logger\";\n\nimport { getCookie } from \"./getCookie\";\nimport { renderCookies } from \"./renderCookies\";\n\n/**\n * Retrieves and renders cookies in a merged format\n * @param cookieSpec - The cookie specification to query\n * @param options - Optional rendering options\n * @returns Promise resolving to rendered cookie string\n * @example\n * ```typescript\n * const cookieString = await getMergedRenderedCookies(\n * { name: 'session', domain: 'example.com' },\n * { separator: '; ' }\n * );\n * console.log(cookieString); // \"session=abc123; auth=xyz789\"\n * ```\n */\nexport async function getMergedRenderedCookies(\n cookieSpec: CookieSpec,\n options?: Omit<RenderOptions, \"format\">,\n): Promise<string> {\n try {\n const cookies = await getCookie(cookieSpec);\n if (!Array.isArray(cookies)) {\n return \"\";\n }\n\n // Validate each cookie against the schema\n const validatedCookies = cookies.filter(\n (cookie): cookie is ExportedCookie => {\n const result = ExportedCookieSchema.safeParse(cookie);\n if (!result.success) {\n logger.warn(\"Invalid cookie format:\", result.error.format());\n return false;\n }\n return true;\n },\n );\n\n const result = renderCookies(validatedCookies, {\n ...options,\n format: \"merged\",\n });\n return typeof result === \"string\" ? result : \"\";\n } catch (error: unknown) {\n logger.warn(\n \"Error getting merged rendered cookies:\",\n error instanceof Error ? error.message : String(error),\n );\n return \"\";\n }\n}\n\n/**\n * Default export of the getMergedRenderedCookies function.\n * @example\n * ```typescript\n * import { getMergedRenderedCookies } from './getMergedRenderedCookies';\n * const cookies = await getMergedRenderedCookies({\n * name: 'sessionId',\n * domain: 'example.com'\n * });\n * ```\n */\nexport default getMergedRenderedCookies;\n"],"mappings":"+OAyBA,eAAsBA,EACpBC,EACAC,EACiB,CACjB,GAAI,CACF,IAAMC,EAAU,MAAMC,EAAUH,CAAU,EAC1C,GAAI,CAAC,MAAM,QAAQE,CAAO,EACxB,MAAO,GAIT,IAAME,EAAmBF,EAAQ,OAC9BG,GAAqC,CACpC,IAAMC,EAASC,EAAqB,UAAUF,CAAM,EACpD,OAAKC,EAAO,QAIL,IAHLE,EAAO,KAAK,yBAA0BF,EAAO,MAAM,OAAO,CAAC,EACpD,GAGX,CACF,EAEMA,EAASG,EAAcL,EAAkB,CAC7C,GAAGH,EACH,OAAQ,QACV,CAAC,EACD,OAAO,OAAOK,GAAW,SAAWA,EAAS,EAC/C,OAASI,EAAgB,CACvB,OAAAF,EAAO,KACL,yCACAE,aAAiB,MAAQA,EAAM,QAAU,OAAOA,CAAK,CACvD,EACO,EACT,CACF,CAaA,IAAOC,EAAQZ","names":["getMergedRenderedCookies","cookieSpec","options","cookies","getCookie","validatedCookies","cookie","result","ExportedCookieSchema","logger_default","renderCookies","error","getMergedRenderedCookies_default"]}
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Ko=Object.create;var me=Object.defineProperty;var Vo=Object.getOwnPropertyDescriptor;var Jo=Object.getOwnPropertyNames;var Yo=Object.getPrototypeOf,Zo=Object.prototype.hasOwnProperty;var vi=r=>{throw TypeError(r)};var Xo=(r,t,e)=>t in r?me(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var E=(r,t)=>()=>(r&&(t=r(r=0)),t);var Ri=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),jt=(r,t)=>{for(var e in t)me(r,e,{get:t[e],enumerable:!0})},Ti=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Jo(t))!Zo.call(r,i)&&i!==e&&me(r,i,{get:()=>t[i],enumerable:!(s=Vo(t,i))||s.enumerable});return r};var ge=(r,t,e)=>(e=r!=null?Ko(Yo(r)):{},Ti(t||!r||!r.__esModule?me(e,"default",{value:r,enumerable:!0}):e,r)),tn=r=>Ti(me({},"__esModule",{value:!0}),r);var f=(r,t,e)=>Xo(r,typeof t!="symbol"?t+"":t,e),Ls=(r,t,e)=>t.has(r)||vi("Cannot "+e);var n=(r,t,e)=>(Ls(r,t,"read from private field"),e?e.call(r):t.get(r)),w=(r,t,e)=>t.has(r)?vi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),p=(r,t,e,s)=>(Ls(r,t,"write to private field"),s?s.call(r,e):t.set(r,e),e),b=(r,t,e)=>(Ls(r,t,"access private method"),e);var Pi,en,M,mt=E(()=>{"use strict";Pi=require("consola"),en=(0,Pi.createConsola)({fancy:!0,formatOptions:{showLogLevel:!1,colors:!0,date:!1,compact:!0,columns:typeof process.stdout.columns=="number"?process.stdout.columns:80},level:typeof process.env.LOG_LEVEL=="string"&&process.env.LOG_LEVEL==="debug"?5:2}),M=en});async function Oi(r,t,e=[]){return r.length===0?e:(await Promise.all(r.map(async i=>{try{return await t(i)}catch(o){return e}}))).flat()}var Mi=E(()=>{"use strict"});function is(r,t,e){let i=`${t?"\u2705":"\u274C"} ${r} ${t?"succeeded":"failed"}`;t?M.success(i,e):M.error(i,e)}function q(r,t,e){let s={...e!=null?e:{},error:t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:t};M.error(r,s)}function ht(r,t,e){M.withTag(r).debug(t,e)}function Di(r){return M.withTag(r)}function rs(r,t,e){M.withTag(r).warn(t,e)}var It=E(()=>{"use strict";mt();mt()});var Fi,Ni,os,Li=E(()=>{"use strict";Fi=require("lodash-es"),Ni={};(0,Fi.merge)(Ni,process.env);os=Ni.HOME;if(typeof os!="string"||os.length===0)throw new Error("HOME environment variable is not set or empty")});var Bi,Ai,Jt,As=E(()=>{"use strict";Bi=require("path");Li();Jt=(0,Bi.join)((Ai=os)!=null?Ai:"","Library","Application Support","Google","Chrome")});function rn(r){try{return r.close(),Promise.resolve()}catch(t){return q("Database close failed",t),Promise.reject(t instanceof Error?t:new Error("Failed to close database: Unknown error"))}}async function ns({file:r,sql:t,params:e,rowFilter:s,rowTransform:i}){let o;try{o=await sn(r);let h=o.prepare(t).all(e),l=s?h.filter(s):h;return i?l.map(i):l}catch(a){throw q("Database query failed",a,{file:r,sql:t}),a}finally{o&&await rn(o)}}var ji,Ii,sn,Bs=E(()=>{"use strict";ji=ge(require("better-sqlite3"),1),Ii=require("lodash-es");It();sn=(0,Ii.memoize)(r=>{try{return Promise.resolve(new ji.default(r,{readonly:!0}))}catch(t){throw q("Database open failed",t,{file:r}),t}})});function on(r){if(typeof r!="string")return!1;let t=r.trim();return t.length===0?!1:(0,_i.existsSync)(t)}async function nn(){let r=[(0,as.join)(Jt,"Default/Cookies"),(0,as.join)(Jt,"Profile */Cookies"),(0,as.join)(Jt,"Profile Default/Cookies")],t=[];for(let e of r){let s=await(0,Wi.default)(e);t.push(...s)}return ht("ChromeCookies","Found cookie files",{count:t.length,files:t}),t}function an(r,t){let e=r==="%",s=e?"SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE host_key LIKE ?":"SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE name = ? AND host_key LIKE ?",i=e?[`%${t}%`]:[r,`%${t}%`];return{sql:s,params:i}}async function hn(r,t,e){try{let{sql:s,params:i}=an(t,e);ht("ChromeCookies","Executing query",{sql:s,params:i});let o=await ns({file:r,sql:s,params:i,rowTransform:a=>({name:a.name,domain:a.host_key,value:a.encrypted_value,expiry:a.expires_utc})});return is("QueryCookies",!0,{file:r,count:o.length}),o}catch(s){return q("Failed to read cookie file",s,{file:r}),[]}}async function $i({name:r,domain:t,file:e}){let s=typeof e=="string"&&e.length>0?[e]:await nn();if(s.length===0)return ht("ChromeCookies","No cookie files found"),[];let i=[];for(let o of s){if(!on(o)){ht("ChromeCookies","Cookie file missing or invalid",{file:o});continue}let a=await hn(o,r,t);i.push(...a)}return ht("ChromeCookies","Query complete",{totalCookies:i.length}),i}var _i,as,Wi,Ui=E(()=>{"use strict";_i=require("fs"),as=require("path"),Wi=ge(require("fast-glob"),1);It();As();Bs()});var Qi=Ri((nh,Hi)=>{"use strict";Hi.exports=Gi;function Gi(r,t,e){r instanceof RegExp&&(r=qi(r,e)),t instanceof RegExp&&(t=qi(t,e));var s=zi(r,t,e);return s&&{start:s[0],end:s[1],pre:e.slice(0,s[0]),body:e.slice(s[0]+r.length,s[1]),post:e.slice(s[1]+t.length)}}function qi(r,t){var e=t.match(r);return e?e[0]:null}Gi.range=zi;function zi(r,t,e){var s,i,o,a,h,l=e.indexOf(r),c=e.indexOf(t,l+1),u=l;if(l>=0&&c>0){if(r===t)return[l,c];for(s=[],o=e.length;u>=0&&!h;)u==l?(s.push(u),l=e.indexOf(r,u+1)):s.length==1?h=[s.pop(),c]:(i=s.pop(),i<o&&(o=i,a=c),c=e.indexOf(t,u+1)),u=l<c&&l>=0?l:c;s.length&&(h=[o,a])}return h}});var er=Ri((ah,tr)=>{"use strict";var Ki=Qi();tr.exports=fn;var Vi="\0SLASH"+Math.random()+"\0",Ji="\0OPEN"+Math.random()+"\0",Is="\0CLOSE"+Math.random()+"\0",Yi="\0COMMA"+Math.random()+"\0",Zi="\0PERIOD"+Math.random()+"\0";function js(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function ln(r){return r.split("\\\\").join(Vi).split("\\{").join(Ji).split("\\}").join(Is).split("\\,").join(Yi).split("\\.").join(Zi)}function cn(r){return r.split(Vi).join("\\").split(Ji).join("{").split(Is).join("}").split(Yi).join(",").split(Zi).join(".")}function Xi(r){if(!r)return[""];var t=[],e=Ki("{","}",r);if(!e)return r.split(",");var s=e.pre,i=e.body,o=e.post,a=s.split(",");a[a.length-1]+="{"+i+"}";var h=Xi(o);return o.length&&(a[a.length-1]+=h.shift(),a.push.apply(a,h)),t.push.apply(t,a),t}function fn(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),we(ln(r),!0).map(cn)):[]}function un(r){return"{"+r+"}"}function pn(r){return/^-?0\d/.test(r)}function dn(r,t){return r<=t}function mn(r,t){return r>=t}function we(r,t){var e=[],s=Ki("{","}",r);if(!s)return[r];var i=s.pre,o=s.post.length?we(s.post,!1):[""];if(/\$$/.test(s.pre))for(var a=0;a<o.length;a++){var h=i+"{"+s.body+"}"+o[a];e.push(h)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),u=l||c,m=s.body.indexOf(",")>=0;if(!u&&!m)return s.post.match(/,.*\}/)?(r=s.pre+"{"+s.body+Is+s.post,we(r)):[r];var d;if(u)d=s.body.split(/\.\./);else if(d=Xi(s.body),d.length===1&&(d=we(d[0],!1).map(un),d.length===1))return o.map(function(Qo){return s.pre+d[0]+Qo});var y;if(u){var v=js(d[0]),g=js(d[1]),x=Math.max(d[0].length,d[1].length),C=d.length==3?Math.abs(js(d[2])):1,R=dn,T=g<v;T&&(C*=-1,R=mn);var F=d.some(pn);y=[];for(var K=v;R(K,g);K+=C){var Z;if(c)Z=String.fromCharCode(K),Z==="\\"&&(Z="");else if(Z=String(K),F){var xi=x-Z.length;if(xi>0){var Ei=new Array(xi+1).join("0");K<0?Z="-"+Ei+Z.slice(1):Z=Ei+Z}}y.push(Z)}}else{y=[];for(var Bt=0;Bt<d.length;Bt++)y.push.apply(y,we(d[Bt],!1))}for(var Bt=0;Bt<y.length;Bt++)for(var a=0;a<o.length;a++){var h=i+y[Bt]+o[a];(!t||u||h)&&e.push(h)}}return e}});var ye,sr=E(()=>{"use strict";ye=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")}});var gn,be,wn,ir,rr,or=E(()=>{"use strict";gn={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},be=r=>r.replace(/[[\]\\-]/g,"\\$&"),wn=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ir=r=>r.join(""),rr=(r,t)=>{let e=t;if(r.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],i=[],o=e+1,a=!1,h=!1,l=!1,c=!1,u=e,m="";t:for(;o<r.length;){let g=r.charAt(o);if((g==="!"||g==="^")&&o===e+1){c=!0,o++;continue}if(g==="]"&&a&&!l){u=o+1;break}if(a=!0,g==="\\"&&!l){l=!0,o++;continue}if(g==="["&&!l){for(let[x,[C,R,T]]of Object.entries(gn))if(r.startsWith(x,o)){if(m)return["$.",!1,r.length-e,!0];o+=x.length,T?i.push(C):s.push(C),h=h||R;continue t}}if(l=!1,m){g>m?s.push(be(m)+"-"+be(g)):g===m&&s.push(be(g)),m="",o++;continue}if(r.startsWith("-]",o+1)){s.push(be(g+"-")),o+=2;continue}if(r.startsWith("-",o+1)){m=g,o+=2;continue}s.push(be(g)),o++}if(u<o)return["",!1,0,!1];if(!s.length&&!i.length)return["$.",!1,r.length-e,!0];if(i.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!c){let g=s[0].length===2?s[0].slice(-1):s[0];return[wn(g),!1,u-e,!1]}let d="["+(c?"^":"")+ir(s)+"]",y="["+(c?"":"^")+ir(i)+"]";return[s.length&&i.length?"("+d+"|"+y+")":s.length?d:y,h,u-e,!0]}});var it,hs=E(()=>{"use strict";it=(r,{windowsPathsNoEscape:t=!1}={})=>t?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")});var yn,nr,bn,ls,kn,Sn,Cn,xn,Ws,ar,hr,N,A,gt,P,D,Et,_t,vt,lt,Wt,ke,$t,lr,Rt,cs,_s,cr,G,Yt,$s=E(()=>{"use strict";or();hs();yn=new Set(["!","?","+","*","@"]),nr=r=>yn.has(r),bn="(?!(?:^|/)\\.\\.?(?:$|/))",ls="(?!\\.)",kn=new Set(["[","."]),Sn=new Set(["..","."]),Cn=new Set("().*{}+?[]^$\\!"),xn=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ws="[^/]",ar=Ws+"*?",hr=Ws+"+?",G=class G{constructor(t,e,s={}){w(this,$t);f(this,"type");w(this,N);w(this,A);w(this,gt,!1);w(this,P,[]);w(this,D);w(this,Et);w(this,_t);w(this,vt,!1);w(this,lt);w(this,Wt);w(this,ke,!1);this.type=t,t&&p(this,A,!0),p(this,D,e),p(this,N,n(this,D)?n(n(this,D),N):this),p(this,lt,n(this,N)===this?s:n(n(this,N),lt)),p(this,_t,n(this,N)===this?[]:n(n(this,N),_t)),t==="!"&&!n(n(this,N),vt)&&n(this,_t).push(this),p(this,Et,n(this,D)?n(n(this,D),P).length:0)}get hasMagic(){if(n(this,A)!==void 0)return n(this,A);for(let t of n(this,P))if(typeof t!="string"&&(t.type||t.hasMagic))return p(this,A,!0);return n(this,A)}toString(){return n(this,Wt)!==void 0?n(this,Wt):this.type?p(this,Wt,this.type+"("+n(this,P).map(t=>String(t)).join("|")+")"):p(this,Wt,n(this,P).map(t=>String(t)).join(""))}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof G&&n(e,D)===this))throw new Error("invalid part: "+e);n(this,P).push(e)}}toJSON(){var e;let t=this.type===null?n(this,P).slice().map(s=>typeof s=="string"?s:s.toJSON()):[this.type,...n(this,P).map(s=>s.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===n(this,N)||n(n(this,N),vt)&&((e=n(this,D))==null?void 0:e.type)==="!")&&t.push({}),t}isStart(){var e;if(n(this,N)===this)return!0;if(!((e=n(this,D))!=null&&e.isStart()))return!1;if(n(this,Et)===0)return!0;let t=n(this,D);for(let s=0;s<n(this,Et);s++){let i=n(t,P)[s];if(!(i instanceof G&&i.type==="!"))return!1}return!0}isEnd(){var e,s,i;if(n(this,N)===this||((e=n(this,D))==null?void 0:e.type)==="!")return!0;if(!((s=n(this,D))!=null&&s.isEnd()))return!1;if(!this.type)return(i=n(this,D))==null?void 0:i.isEnd();let t=n(this,D)?n(n(this,D),P).length:0;return n(this,Et)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new G(this.type,t);for(let s of n(this,P))e.copyIn(s);return e}static fromGlob(t,e={}){var i;let s=new G(null,void 0,e);return b(i=G,Rt,cs).call(i,t,s,0,e),s}toMMPattern(){if(this!==n(this,N))return n(this,N).toMMPattern();let t=this.toString(),[e,s,i,o]=this.toRegExpSource();if(!(i||n(this,A)||n(this,lt).nocase&&!n(this,lt).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let h=(n(this,lt).nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${e}$`,h),{_src:e,_glob:t})}get options(){return n(this,lt)}toRegExpSource(t){var l;let e=t!=null?t:!!n(this,lt).dot;if(n(this,N)===this&&b(this,$t,lr).call(this),!this.type){let c=this.isStart()&&this.isEnd(),u=n(this,P).map(v=>{var T;let[g,x,C,R]=typeof v=="string"?b(T=G,Rt,cr).call(T,v,n(this,A),c):v.toRegExpSource(t);return p(this,A,n(this,A)||C),p(this,gt,n(this,gt)||R),g}).join(""),m="";if(this.isStart()&&typeof n(this,P)[0]=="string"&&!(n(this,P).length===1&&Sn.has(n(this,P)[0]))){let g=kn,x=e&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),C=!e&&!t&&g.has(u.charAt(0));m=x?bn:C?ls:""}let d="";return this.isEnd()&&n(n(this,N),vt)&&((l=n(this,D))==null?void 0:l.type)==="!"&&(d="(?:$|\\/)"),[m+u+d,it(u),p(this,A,!!n(this,A)),n(this,gt)]}let s=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",o=b(this,$t,_s).call(this,e);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){let c=this.toString();return p(this,P,[c]),this.type=null,p(this,A,void 0),[c,it(this.toString()),!1,!1]}let a=!s||t||e||!ls?"":b(this,$t,_s).call(this,!0);a===o&&(a=""),a&&(o=`(?:${o})(?:${a})*?`);let h="";if(this.type==="!"&&n(this,ke))h=(this.isStart()&&!e?ls:"")+hr;else{let c=this.type==="!"?"))"+(this.isStart()&&!e&&!t?ls:"")+ar+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;h=i+o+c}return[h,it(o),p(this,A,!!n(this,A)),n(this,gt)]}};N=new WeakMap,A=new WeakMap,gt=new WeakMap,P=new WeakMap,D=new WeakMap,Et=new WeakMap,_t=new WeakMap,vt=new WeakMap,lt=new WeakMap,Wt=new WeakMap,ke=new WeakMap,$t=new WeakSet,lr=function(){if(this!==n(this,N))throw new Error("should only call on root");if(n(this,vt))return this;this.toString(),p(this,vt,!0);let t;for(;t=n(this,_t).pop();){if(t.type!=="!")continue;let e=t,s=n(e,D);for(;s;){for(let i=n(e,Et)+1;!s.type&&i<n(s,P).length;i++)for(let o of n(t,P)){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(n(s,P)[i])}e=s,s=n(e,D)}}return this},Rt=new WeakSet,cs=function(t,e,s,i){var y,v;let o=!1,a=!1,h=-1,l=!1;if(e.type===null){let g=s,x="";for(;g<t.length;){let C=t.charAt(g++);if(o||C==="\\"){o=!o,x+=C;continue}if(a){g===h+1?(C==="^"||C==="!")&&(l=!0):C==="]"&&!(g===h+2&&l)&&(a=!1),x+=C;continue}else if(C==="["){a=!0,h=g,l=!1,x+=C;continue}if(!i.noext&&nr(C)&&t.charAt(g)==="("){e.push(x),x="";let R=new G(C,e);g=b(y=G,Rt,cs).call(y,t,R,g,i),e.push(R);continue}x+=C}return e.push(x),g}let c=s+1,u=new G(null,e),m=[],d="";for(;c<t.length;){let g=t.charAt(c++);if(o||g==="\\"){o=!o,d+=g;continue}if(a){c===h+1?(g==="^"||g==="!")&&(l=!0):g==="]"&&!(c===h+2&&l)&&(a=!1),d+=g;continue}else if(g==="["){a=!0,h=c,l=!1,d+=g;continue}if(nr(g)&&t.charAt(c)==="("){u.push(d),d="";let x=new G(g,u);u.push(x),c=b(v=G,Rt,cs).call(v,t,x,c,i);continue}if(g==="|"){u.push(d),d="",m.push(u),u=new G(null,e);continue}if(g===")")return d===""&&n(e,P).length===0&&p(e,ke,!0),u.push(d),d="",e.push(...m,u),c;d+=g}return e.type=null,p(e,A,void 0),p(e,P,[t.substring(s-1)]),c},_s=function(t){return n(this,P).map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,i,o,a]=e.toRegExpSource(t);return p(this,gt,n(this,gt)||a),s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")},cr=function(t,e,s=!1){let i=!1,o="",a=!1;for(let h=0;h<t.length;h++){let l=t.charAt(h);if(i){i=!1,o+=(Cn.has(l)?"\\":"")+l;continue}if(l==="\\"){h===t.length-1?o+="\\\\":i=!0;continue}if(l==="["){let[c,u,m,d]=rr(t,h);if(m){o+=c,a=a||u,h+=m-1,e=e||d;continue}}if(l==="*"){s&&t==="*"?o+=hr:o+=ar,e=!0;continue}if(l==="?"){o+=Ws,e=!0;continue}o+=xn(l)}return[o,it(t),!!e,a]},w(G,Rt);Yt=G});var Zt,Us=E(()=>{"use strict";Zt=(r,{windowsPathsNoEscape:t=!1}={})=>t?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&")});var pr,z,En,vn,Rn,Tn,Pn,On,Mn,Dn,Fn,Nn,Ln,An,Bn,jn,In,_n,Wn,$n,dr,mr,gr,fr,Un,W,qn,Gn,zn,Hn,Qn,X,Kn,wr,Vn,Jn,ur,Yn,V,Tt=E(()=>{"use strict";pr=ge(er(),1);sr();$s();Us();hs();$s();Us();hs();z=(r,t,e={})=>(ye(t),!e.nocomment&&t.charAt(0)==="#"?!1:new V(t,e).match(r)),En=/^\*+([^+@!?\*\[\(]*)$/,vn=r=>t=>!t.startsWith(".")&&t.endsWith(r),Rn=r=>t=>t.endsWith(r),Tn=r=>(r=r.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(r)),Pn=r=>(r=r.toLowerCase(),t=>t.toLowerCase().endsWith(r)),On=/^\*+\.\*+$/,Mn=r=>!r.startsWith(".")&&r.includes("."),Dn=r=>r!=="."&&r!==".."&&r.includes("."),Fn=/^\.\*+$/,Nn=r=>r!=="."&&r!==".."&&r.startsWith("."),Ln=/^\*+$/,An=r=>r.length!==0&&!r.startsWith("."),Bn=r=>r.length!==0&&r!=="."&&r!=="..",jn=/^\?+([^+@!?\*\[\(]*)?$/,In=([r,t=""])=>{let e=dr([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},_n=([r,t=""])=>{let e=mr([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Wn=([r,t=""])=>{let e=mr([r]);return t?s=>e(s)&&s.endsWith(t):e},$n=([r,t=""])=>{let e=dr([r]);return t?s=>e(s)&&s.endsWith(t):e},dr=([r])=>{let t=r.length;return e=>e.length===t&&!e.startsWith(".")},mr=([r])=>{let t=r.length;return e=>e.length===t&&e!=="."&&e!==".."},gr=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",fr={win32:{sep:"\\"},posix:{sep:"/"}},Un=gr==="win32"?fr.win32.sep:fr.posix.sep;z.sep=Un;W=Symbol("globstar **");z.GLOBSTAR=W;qn="[^/]",Gn=qn+"*?",zn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Hn="(?:(?!(?:\\/|^)\\.).)*?",Qn=(r,t={})=>e=>z(e,r,t);z.filter=Qn;X=(r,t={})=>Object.assign({},r,t),Kn=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return z;let t=z;return Object.assign((s,i,o={})=>t(s,i,X(r,o)),{Minimatch:class extends t.Minimatch{constructor(i,o={}){super(i,X(r,o))}static defaults(i){return t.defaults(X(r,i)).Minimatch}},AST:class extends t.AST{constructor(i,o,a={}){super(i,o,X(r,a))}static fromGlob(i,o={}){return t.AST.fromGlob(i,X(r,o))}},unescape:(s,i={})=>t.unescape(s,X(r,i)),escape:(s,i={})=>t.escape(s,X(r,i)),filter:(s,i={})=>t.filter(s,X(r,i)),defaults:s=>t.defaults(X(r,s)),makeRe:(s,i={})=>t.makeRe(s,X(r,i)),braceExpand:(s,i={})=>t.braceExpand(s,X(r,i)),match:(s,i,o={})=>t.match(s,i,X(r,o)),sep:t.sep,GLOBSTAR:W})};z.defaults=Kn;wr=(r,t={})=>(ye(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,pr.default)(r));z.braceExpand=wr;Vn=(r,t={})=>new V(r,t).makeRe();z.makeRe=Vn;Jn=(r,t,e={})=>{let s=new V(t,e);return r=r.filter(i=>s.match(i)),s.options.nonull&&!r.length&&r.push(t),r};z.match=Jn;ur=/[?*]|[+@!]\(.*?\)|\[|\]/,Yn=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),V=class{constructor(t,e={}){f(this,"options");f(this,"set");f(this,"pattern");f(this,"windowsPathsNoEscape");f(this,"nonegate");f(this,"negate");f(this,"comment");f(this,"empty");f(this,"preserveMultipleSlashes");f(this,"partial");f(this,"globSet");f(this,"globParts");f(this,"nocase");f(this,"isWindows");f(this,"platform");f(this,"windowsNoMagicRoot");f(this,"regexp");ye(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||gr,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...o)=>console.error(...o)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(o=>this.slashSplit(o));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map((o,a,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=o[0]===""&&o[1]===""&&(o[2]==="?"||!ur.test(o[2]))&&!ur.test(o[3]),c=/^[a-z]:/i.test(o[0]);if(l)return[...o.slice(0,4),...o.slice(4).map(u=>this.parse(u))];if(c)return[o[0],...o.slice(1).map(u=>this.parse(u))]}return o.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(o=>o.indexOf(!1)===-1),this.isWindows)for(let o=0;o<this.set.length;o++){let a=this.set[o];a[0]===""&&a[1]===""&&this.globParts[o][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let i=0;i<t[s].length;i++)t[s][i]==="**"&&(t[s][i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,i)=>{let o=s[s.length-1];return i==="**"&&o==="**"?s:i===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(s.pop(),s):(s.push(i),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let o=t[i];i===1&&o===""&&t[0]===""||(o==="."||o==="")&&(e=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let i=t[s-1];i&&i!=="."&&i!==".."&&i!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let i=-1;for(;(i=s.indexOf("**",i+1))!==-1;){let a=i;for(;s[a+1]==="**";)a++;a>i&&s.splice(i+1,a-i);let h=s[i+1],l=s[i+2],c=s[i+3];if(h!==".."||!l||l==="."||l===".."||!c||c==="."||c==="..")continue;e=!0,s.splice(i,1);let u=s.slice(0);u[i]="**",t.push(u),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<s.length-1;a++){let h=s[a];a===1&&h===""&&s[0]===""||(h==="."||h==="")&&(e=!0,s.splice(a,1),a--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let o=0;for(;(o=s.indexOf("..",o+1))!==-1;){let a=s[o-1];if(a&&a!=="."&&a!==".."&&a!=="**"){e=!0;let l=o===1&&s[o+1]==="**"?["."]:[];s.splice(o-1,2,...l),s.length===0&&s.push(""),o-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let i=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(i){t[e]=[],t[s]=i;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let i=0,o=0,a=[],h="";for(;i<t.length&&o<e.length;)if(t[i]===e[o])a.push(h==="b"?e[o]:t[i]),i++,o++;else if(s&&t[i]==="**"&&e[o]===t[i+1])a.push(t[i]),i++;else if(s&&e[o]==="**"&&t[i]===e[o+1])a.push(e[o]),o++;else if(t[i]==="*"&&e[o]&&(this.options.dot||!e[o].startsWith("."))&&e[o]!=="**"){if(h==="b")return!1;h="a",a.push(t[i]),i++,o++}else if(e[o]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(h==="a")return!1;h="b",a.push(e[o]),i++,o++}else return!1;return t.length===e.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let i=this.options;if(this.isWindows){let g=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),x=!g&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),C=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),R=!C&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),T=x?3:g?0:void 0,F=R?3:C?0:void 0;if(typeof T=="number"&&typeof F=="number"){let[K,Z]=[t[T],e[F]];K.toLowerCase()===Z.toLowerCase()&&(e[F]=K,F>T?e=e.slice(F):T>F&&(t=t.slice(T)))}}let{optimizationLevel:o=1}=this.options;o>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var a=0,h=0,l=t.length,c=e.length;a<l&&h<c;a++,h++){this.debug("matchOne loop");var u=e[h],m=t[a];if(this.debug(e,u,m),u===!1)return!1;if(u===W){this.debug("GLOBSTAR",[e,u,m]);var d=a,y=h+1;if(y===c){for(this.debug("** at the end");a<l;a++)if(t[a]==="."||t[a]===".."||!i.dot&&t[a].charAt(0)===".")return!1;return!0}for(;d<l;){var v=t[d];if(this.debug(`
2
- globstar while`,t,d,e,y,v),this.matchOne(t.slice(d),e.slice(y),s))return this.debug("globstar found match!",d,l,v),!0;if(v==="."||v===".."||!i.dot&&v.charAt(0)==="."){this.debug("dot detected!",t,d,e,y);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(s&&(this.debug(`
3
- >>> no match, partial?`,t,d,e,y),d===l))}let g;if(typeof u=="string"?(g=m===u,this.debug("string match",u,m,g)):(g=u.test(m),this.debug("pattern match",u,m,g)),!g)return!1}if(a===l&&h===c)return!0;if(a===l)return s;if(h===c)return a===l-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return wr(this.pattern,this.options)}parse(t){ye(t);let e=this.options;if(t==="**")return W;if(t==="")return"";let s,i=null;(s=t.match(Ln))?i=e.dot?Bn:An:(s=t.match(En))?i=(e.nocase?e.dot?Pn:Tn:e.dot?Rn:vn)(s[1]):(s=t.match(jn))?i=(e.nocase?e.dot?_n:In:e.dot?Wn:$n)(s):(s=t.match(On))?i=e.dot?Dn:Mn:(s=t.match(Fn))&&(i=Nn);let o=Yt.fromGlob(t,this.options).toMMPattern();return i&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:i}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?Gn:e.dot?zn:Hn,i=new Set(e.nocase?["i"]:[]),o=t.map(l=>{let c=l.map(u=>{if(u instanceof RegExp)for(let m of u.flags.split(""))i.add(m);return typeof u=="string"?Yn(u):u===W?W:u._src});return c.forEach((u,m)=>{let d=c[m+1],y=c[m-1];u!==W||y===W||(y===void 0?d!==void 0&&d!==W?c[m+1]="(?:\\/|"+s+"\\/)?"+d:c[m]=s:d===void 0?c[m-1]=y+"(?:\\/|"+s+")?":d!==W&&(c[m-1]=y+"(?:\\/|\\/"+s+"\\/)"+d,c[m+1]=W))}),c.filter(u=>u!==W).join("/")}).join("|"),[a,h]=t.length>1?["(?:",")"]:["",""];o="^"+a+o+h+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...i].join(""))}catch(l){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let o=this.set;this.debug(this.pattern,"set",o);let a=i[i.length-1];if(!a)for(let h=i.length-2;!a&&h>=0;h--)a=i[h];for(let h=0;h<o.length;h++){let l=o[h],c=i;if(s.matchBase&&l.length===1&&(c=[a]),this.matchOne(c,l,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return z.defaults(t).Minimatch}};z.AST=Yt;z.Minimatch=V;z.escape=Zt;z.unescape=it});var ws,Vs,$r,yr,Zn,Xn,ta,wt,yt,Pt,fs,Se,us,br,ps,kr,rt,Xt,B,Ce,te,j,H,I,qs,ds,$,O,Gs,zs,Sr,Hs,ct,Qs,ms,xe,Ut,J,Ee,ea,sa,ia,ra,gs,Ks,oa,na,Cr,xr,Er,vr,Rr,Tr,Pr,Or,Mr,Dr,Fr,Nr,Lr,Ar,Br,jr,Ir,_r,Wr,Ot,Js=E(()=>{"use strict";ws=require("events"),Vs=ge(require("stream"),1),$r=require("string_decoder"),yr=typeof process=="object"&&process?process:{stdout:null,stderr:null},Zn=r=>!!r&&typeof r=="object"&&(r instanceof Ot||r instanceof Vs.default||Xn(r)||ta(r)),Xn=r=>!!r&&typeof r=="object"&&r instanceof ws.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==Vs.default.Writable.prototype.pipe,ta=r=>!!r&&typeof r=="object"&&r instanceof ws.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function",wt=Symbol("EOF"),yt=Symbol("maybeEmitEnd"),Pt=Symbol("emittedEnd"),fs=Symbol("emittingEnd"),Se=Symbol("emittedError"),us=Symbol("closed"),br=Symbol("read"),ps=Symbol("flush"),kr=Symbol("flushChunk"),rt=Symbol("encoding"),Xt=Symbol("decoder"),B=Symbol("flowing"),Ce=Symbol("paused"),te=Symbol("resume"),j=Symbol("buffer"),H=Symbol("pipes"),I=Symbol("bufferLength"),qs=Symbol("bufferPush"),ds=Symbol("bufferShift"),$=Symbol("objectMode"),O=Symbol("destroyed"),Gs=Symbol("error"),zs=Symbol("emitData"),Sr=Symbol("emitEnd"),Hs=Symbol("emitEnd2"),ct=Symbol("async"),Qs=Symbol("abort"),ms=Symbol("aborted"),xe=Symbol("signal"),Ut=Symbol("dataListeners"),J=Symbol("discarded"),Ee=r=>Promise.resolve().then(r),ea=r=>r(),sa=r=>r==="end"||r==="finish"||r==="prefinish",ia=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,ra=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),gs=class{constructor(t,e,s){f(this,"src");f(this,"dest");f(this,"opts");f(this,"ondrain");this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[te](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ks=class extends gs{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=i=>e.emit("error",i),t.on("error",this.proxyErrors)}},oa=r=>!!r.objectMode,na=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",Ot=class extends ws.EventEmitter{constructor(...e){let s=e[0]||{};super();f(this,Wr,!1);f(this,_r,!1);f(this,Ir,[]);f(this,jr,[]);f(this,Br);f(this,Ar);f(this,Lr);f(this,Nr);f(this,Fr,!1);f(this,Dr,!1);f(this,Mr,!1);f(this,Or,!1);f(this,Pr,null);f(this,Tr,0);f(this,Rr,!1);f(this,vr);f(this,Er,!1);f(this,xr,0);f(this,Cr,!1);f(this,"writable",!0);f(this,"readable",!0);if(s.objectMode&&typeof s.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");oa(s)?(this[$]=!0,this[rt]=null):na(s)?(this[rt]=s.encoding,this[$]=!1):(this[$]=!1,this[rt]=null),this[ct]=!!s.async,this[Xt]=this[rt]?new $r.StringDecoder(this[rt]):null,s&&s.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[j]}),s&&s.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[H]});let{signal:i}=s;i&&(this[xe]=i,i.aborted?this[Qs]():i.addEventListener("abort",()=>this[Qs]()))}get bufferLength(){return this[I]}get encoding(){return this[rt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[$]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ct]}set async(e){this[ct]=this[ct]||!!e}[(Wr=B,_r=Ce,Ir=H,jr=j,Br=$,Ar=rt,Lr=ct,Nr=Xt,Fr=wt,Dr=Pt,Mr=fs,Or=us,Pr=Se,Tr=I,Rr=O,vr=xe,Er=ms,xr=Ut,Cr=J,Qs)](){var e,s;this[ms]=!0,this.emit("abort",(e=this[xe])==null?void 0:e.reason),this.destroy((s=this[xe])==null?void 0:s.reason)}get aborted(){return this[ms]}set aborted(e){}write(e,s,i){var a;if(this[ms])return!1;if(this[wt])throw new Error("write after end");if(this[O])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof s=="function"&&(i=s,s="utf8"),s||(s="utf8");let o=this[ct]?Ee:ea;if(!this[$]&&!Buffer.isBuffer(e)){if(ra(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(ia(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[$]?(this[B]&&this[I]!==0&&this[ps](!0),this[B]?this.emit("data",e):this[qs](e),this[I]!==0&&this.emit("readable"),i&&o(i),this[B]):e.length?(typeof e=="string"&&!(s===this[rt]&&!((a=this[Xt])!=null&&a.lastNeed))&&(e=Buffer.from(e,s)),Buffer.isBuffer(e)&&this[rt]&&(e=this[Xt].write(e)),this[B]&&this[I]!==0&&this[ps](!0),this[B]?this.emit("data",e):this[qs](e),this[I]!==0&&this.emit("readable"),i&&o(i),this[B]):(this[I]!==0&&this.emit("readable"),i&&o(i),this[B])}read(e){if(this[O])return null;if(this[J]=!1,this[I]===0||e===0||e&&e>this[I])return this[yt](),null;this[$]&&(e=null),this[j].length>1&&!this[$]&&(this[j]=[this[rt]?this[j].join(""):Buffer.concat(this[j],this[I])]);let s=this[br](e||null,this[j][0]);return this[yt](),s}[br](e,s){if(this[$])this[ds]();else{let i=s;e===i.length||e===null?this[ds]():typeof i=="string"?(this[j][0]=i.slice(e),s=i.slice(0,e),this[I]-=e):(this[j][0]=i.subarray(e),s=i.subarray(0,e),this[I]-=e)}return this.emit("data",s),!this[j].length&&!this[wt]&&this.emit("drain"),s}end(e,s,i){return typeof e=="function"&&(i=e,e=void 0),typeof s=="function"&&(i=s,s="utf8"),e!==void 0&&this.write(e,s),i&&this.once("end",i),this[wt]=!0,this.writable=!1,(this[B]||!this[Ce])&&this[yt](),this}[te](){this[O]||(!this[Ut]&&!this[H].length&&(this[J]=!0),this[Ce]=!1,this[B]=!0,this.emit("resume"),this[j].length?this[ps]():this[wt]?this[yt]():this.emit("drain"))}resume(){return this[te]()}pause(){this[B]=!1,this[Ce]=!0,this[J]=!1}get destroyed(){return this[O]}get flowing(){return this[B]}get paused(){return this[Ce]}[qs](e){this[$]?this[I]+=1:this[I]+=e.length,this[j].push(e)}[ds](){return this[$]?this[I]-=1:this[I]-=this[j][0].length,this[j].shift()}[ps](e=!1){do;while(this[kr](this[ds]())&&this[j].length);!e&&!this[j].length&&!this[wt]&&this.emit("drain")}[kr](e){return this.emit("data",e),this[B]}pipe(e,s){if(this[O])return e;this[J]=!1;let i=this[Pt];return s=s||{},e===yr.stdout||e===yr.stderr?s.end=!1:s.end=s.end!==!1,s.proxyErrors=!!s.proxyErrors,i?s.end&&e.end():(this[H].push(s.proxyErrors?new Ks(this,e,s):new gs(this,e,s)),this[ct]?Ee(()=>this[te]()):this[te]()),e}unpipe(e){let s=this[H].find(i=>i.dest===e);s&&(this[H].length===1?(this[B]&&this[Ut]===0&&(this[B]=!1),this[H]=[]):this[H].splice(this[H].indexOf(s),1),s.unpipe())}addListener(e,s){return this.on(e,s)}on(e,s){let i=super.on(e,s);if(e==="data")this[J]=!1,this[Ut]++,!this[H].length&&!this[B]&&this[te]();else if(e==="readable"&&this[I]!==0)super.emit("readable");else if(sa(e)&&this[Pt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Se]){let o=s;this[ct]?Ee(()=>o.call(this,this[Se])):o.call(this,this[Se])}return i}removeListener(e,s){return this.off(e,s)}off(e,s){let i=super.off(e,s);return e==="data"&&(this[Ut]=this.listeners("data").length,this[Ut]===0&&!this[J]&&!this[H].length&&(this[B]=!1)),i}removeAllListeners(e){let s=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Ut]=0,!this[J]&&!this[H].length&&(this[B]=!1)),s}get emittedEnd(){return this[Pt]}[yt](){!this[fs]&&!this[Pt]&&!this[O]&&this[j].length===0&&this[wt]&&(this[fs]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[us]&&this.emit("close"),this[fs]=!1)}emit(e,...s){let i=s[0];if(e!=="error"&&e!=="close"&&e!==O&&this[O])return!1;if(e==="data")return!this[$]&&!i?!1:this[ct]?(Ee(()=>this[zs](i)),!0):this[zs](i);if(e==="end")return this[Sr]();if(e==="close"){if(this[us]=!0,!this[Pt]&&!this[O])return!1;let a=super.emit("close");return this.removeAllListeners("close"),a}else if(e==="error"){this[Se]=i,super.emit(Gs,i);let a=!this[xe]||this.listeners("error").length?super.emit("error",i):!1;return this[yt](),a}else if(e==="resume"){let a=super.emit("resume");return this[yt](),a}else if(e==="finish"||e==="prefinish"){let a=super.emit(e);return this.removeAllListeners(e),a}let o=super.emit(e,...s);return this[yt](),o}[zs](e){for(let i of this[H])i.dest.write(e)===!1&&this.pause();let s=this[J]?!1:super.emit("data",e);return this[yt](),s}[Sr](){return this[Pt]?!1:(this[Pt]=!0,this.readable=!1,this[ct]?(Ee(()=>this[Hs]()),!0):this[Hs]())}[Hs](){if(this[Xt]){let s=this[Xt].end();if(s){for(let i of this[H])i.dest.write(s);this[J]||super.emit("data",s)}}for(let s of this[H])s.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[$]||(e.dataLength=0);let s=this.promise();return this.on("data",i=>{e.push(i),this[$]||(e.dataLength+=i.length)}),await s,e}async concat(){if(this[$])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[rt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,s)=>{this.on(O,()=>s(new Error("stream destroyed"))),this.on("error",i=>s(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[J]=!1;let e=!1,s=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return s();let o=this.read();if(o!==null)return Promise.resolve({done:!1,value:o});if(this[wt])return s();let a,h,l=d=>{this.off("data",c),this.off("end",u),this.off(O,m),s(),h(d)},c=d=>{this.off("error",l),this.off("end",u),this.off(O,m),this.pause(),a({value:d,done:!!this[wt]})},u=()=>{this.off("error",l),this.off("data",c),this.off(O,m),s(),a({done:!0,value:void 0})},m=()=>l(new Error("stream destroyed"));return new Promise((d,y)=>{h=y,a=d,this.once(O,m),this.once("error",l),this.once("end",u),this.once("data",c)})},throw:s,return:s,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[J]=!1;let e=!1,s=()=>(this.pause(),this.off(Gs,s),this.off(O,s),this.off("end",s),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return s();let o=this.read();return o===null?s():{done:!1,value:o}};return this.once("end",s),this.once(Gs,s),this.once(O,s),{next:i,throw:s,return:s,[Symbol.iterator](){return this}}}destroy(e){if(this[O])return e?this.emit("error",e):this.emit(O),this;this[O]=!0,this[J]=!0,this[j].length=0,this[I]=0;let s=this;return typeof s.close=="function"&&!this[us]&&s.close(),e?this.emit("error",e):this.emit(O),this}static get isStream(){return Zn}}});var ni,oe,Hr,dt,aa,Dt,ha,Re,Qr,Kr,la,ca,et,Vr,Jr,ft,Yr,Zr,qt,Xr,tt,ve,Ys,Ur,Te,ot,ys,ks,qr,fa,Zs,Gr,Pe,zr,bs,Es,Xs,to,Q,Fe,Ne,Le,Ae,Be,je,Ie,_e,We,$e,Ue,qe,Ge,ze,He,Qe,Ke,Ve,Mt,Gt,ut,bt,kt,St,S,zt,Ct,pt,k,ti,Ss,Oe,ei,si,Me,Cs,ii,ri,xs,eo,so,io,oi,ee,se,ro,Ht,U,vs,Rs,ie,re,Je,Ye,Ts,ne,ae,De,Mh,oo,no=E(()=>{"use strict";ni=require("lru-cache"),oe=require("path"),Hr=require("url"),dt=require("fs"),aa=ge(require("fs"),1),Dt=require("fs/promises");Js();ha=dt.realpathSync.native,Re={lstatSync:dt.lstatSync,readdir:dt.readdir,readdirSync:dt.readdirSync,readlinkSync:dt.readlinkSync,realpathSync:ha,promises:{lstat:Dt.lstat,readdir:Dt.readdir,readlink:Dt.readlink,realpath:Dt.realpath}},Qr=r=>!r||r===Re||r===aa?Re:{...Re,...r,promises:{...Re.promises,...r.promises||{}}},Kr=/^\\\\\?\\([a-z]:)\\?$/i,la=r=>r.replace(/\//g,"\\").replace(Kr,"$1\\"),ca=/[\\\/]/,et=0,Vr=1,Jr=2,ft=4,Yr=6,Zr=8,qt=10,Xr=12,tt=15,ve=~tt,Ys=16,Ur=32,Te=64,ot=128,ys=256,ks=512,qr=Te|ot|ks,fa=1023,Zs=r=>r.isFile()?Zr:r.isDirectory()?ft:r.isSymbolicLink()?qt:r.isCharacterDevice()?Jr:r.isBlockDevice()?Yr:r.isSocket()?Xr:r.isFIFO()?Vr:et,Gr=new Map,Pe=r=>{let t=Gr.get(r);if(t)return t;let e=r.normalize("NFKD");return Gr.set(r,e),e},zr=new Map,bs=r=>{let t=zr.get(r);if(t)return t;let e=Pe(r.toLowerCase());return zr.set(r,e),e},Es=class extends ni.LRUCache{constructor(){super({max:256})}},Xs=class extends ni.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},to=Symbol("PathScurry setAsCwd"),U=class{constructor(t,e=et,s,i,o,a,h){w(this,k);f(this,"name");f(this,"root");f(this,"roots");f(this,"parent");f(this,"nocase");f(this,"isCWD",!1);w(this,Q);w(this,Fe);w(this,Ne);w(this,Le);w(this,Ae);w(this,Be);w(this,je);w(this,Ie);w(this,_e);w(this,We);w(this,$e);w(this,Ue);w(this,qe);w(this,Ge);w(this,ze);w(this,He);w(this,Qe);w(this,Ke);w(this,Ve);w(this,Mt);w(this,Gt);w(this,ut);w(this,bt);w(this,kt);w(this,St);w(this,S);w(this,zt);w(this,Ct);w(this,pt);w(this,ee,[]);w(this,se,!1);w(this,Ht);this.name=t,p(this,Mt,o?bs(t):Pe(t)),p(this,S,e&fa),this.nocase=o,this.roots=i,this.root=s||this,p(this,zt,a),p(this,ut,h.fullpath),p(this,kt,h.relative),p(this,St,h.relativePosix),this.parent=h.parent,this.parent?p(this,Q,n(this.parent,Q)):p(this,Q,Qr(h.fs))}get dev(){return n(this,Fe)}get mode(){return n(this,Ne)}get nlink(){return n(this,Le)}get uid(){return n(this,Ae)}get gid(){return n(this,Be)}get rdev(){return n(this,je)}get blksize(){return n(this,Ie)}get ino(){return n(this,_e)}get size(){return n(this,We)}get blocks(){return n(this,$e)}get atimeMs(){return n(this,Ue)}get mtimeMs(){return n(this,qe)}get ctimeMs(){return n(this,Ge)}get birthtimeMs(){return n(this,ze)}get atime(){return n(this,He)}get mtime(){return n(this,Qe)}get ctime(){return n(this,Ke)}get birthtime(){return n(this,Ve)}get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return n(this,Gt)!==void 0?n(this,Gt):this.parent?p(this,Gt,this.parent.depth()+1):p(this,Gt,0)}childrenCache(){return n(this,zt)}resolve(t){var a;if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?b(a=this.getRoot(e),k,ti).call(a,i):b(this,k,ti).call(this,i)}children(){let t=n(this,zt).get(this);if(t)return t;let e=Object.assign([],{provisional:0});return n(this,zt).set(this,e),p(this,S,n(this,S)&~Ys),e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),i=this.nocase?bs(t):Pe(t);for(let l of s)if(n(l,Mt)===i)return l;let o=this.parent?this.sep:"",a=n(this,ut)?n(this,ut)+o+t:void 0,h=this.newChild(t,et,{...e,parent:this,fullpath:a});return this.canReaddir()||p(h,S,n(h,S)|ot),s.push(h),h}relative(){if(this.isCWD)return"";if(n(this,kt)!==void 0)return n(this,kt);let t=this.name,e=this.parent;if(!e)return p(this,kt,this.name);let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(n(this,St)!==void 0)return n(this,St);let t=this.name,e=this.parent;if(!e)return p(this,St,this.fullpathPosix());let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(n(this,ut)!==void 0)return n(this,ut);let t=this.name,e=this.parent;if(!e)return p(this,ut,this.name);let i=e.fullpath()+(e.parent?this.sep:"")+t;return p(this,ut,i)}fullpathPosix(){if(n(this,bt)!==void 0)return n(this,bt);if(this.sep==="/")return p(this,bt,this.fullpath());if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?p(this,bt,`//?/${i}`):p(this,bt,i)}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return p(this,bt,s)}isUnknown(){return(n(this,S)&tt)===et}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(n(this,S)&tt)===Zr}isDirectory(){return(n(this,S)&tt)===ft}isCharacterDevice(){return(n(this,S)&tt)===Jr}isBlockDevice(){return(n(this,S)&tt)===Yr}isFIFO(){return(n(this,S)&tt)===Vr}isSocket(){return(n(this,S)&tt)===Xr}isSymbolicLink(){return(n(this,S)&qt)===qt}lstatCached(){return n(this,S)&Ur?this:void 0}readlinkCached(){return n(this,Ct)}realpathCached(){return n(this,pt)}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(n(this,Ct))return!0;if(!this.parent)return!1;let t=n(this,S)&tt;return!(t!==et&&t!==qt||n(this,S)&ys||n(this,S)&ot)}calledReaddir(){return!!(n(this,S)&Ys)}isENOENT(){return!!(n(this,S)&ot)}isNamed(t){return this.nocase?n(this,Mt)===bs(t):n(this,Mt)===Pe(t)}async readlink(){var e;let t=n(this,Ct);if(t)return t;if(this.canReadlink()&&this.parent)try{let s=await n(this,Q).promises.readlink(this.fullpath()),i=(e=await this.parent.realpath())==null?void 0:e.resolve(s);if(i)return p(this,Ct,i)}catch(s){b(this,k,ri).call(this,s.code);return}}readlinkSync(){var e;let t=n(this,Ct);if(t)return t;if(this.canReadlink()&&this.parent)try{let s=n(this,Q).readlinkSync(this.fullpath()),i=(e=this.parent.realpathSync())==null?void 0:e.resolve(s);if(i)return p(this,Ct,i)}catch(s){b(this,k,ri).call(this,s.code);return}}async lstat(){if(!(n(this,S)&ot))try{return b(this,k,oi).call(this,await n(this,Q).promises.lstat(this.fullpath())),this}catch(t){b(this,k,ii).call(this,t.code)}}lstatSync(){if(!(n(this,S)&ot))try{return b(this,k,oi).call(this,n(this,Q).lstatSync(this.fullpath())),this}catch(t){b(this,k,ii).call(this,t.code)}}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let o=s.slice(0,s.provisional);e?t(null,o):queueMicrotask(()=>t(null,o));return}if(n(this,ee).push(t),n(this,se))return;p(this,se,!0);let i=this.fullpath();n(this,Q).readdir(i,{withFileTypes:!0},(o,a)=>{if(o)b(this,k,Cs).call(this,o.code),s.provisional=0;else{for(let h of a)b(this,k,xs).call(this,h,s);b(this,k,Ss).call(this,s)}b(this,k,ro).call(this,s.slice(0,s.provisional))})}async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(n(this,Ht))await n(this,Ht);else{let s=()=>{};p(this,Ht,new Promise(i=>s=i));try{for(let i of await n(this,Q).promises.readdir(e,{withFileTypes:!0}))b(this,k,xs).call(this,i,t);b(this,k,Ss).call(this,t)}catch(i){b(this,k,Cs).call(this,i.code),t.provisional=0}p(this,Ht,void 0),s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of n(this,Q).readdirSync(e,{withFileTypes:!0}))b(this,k,xs).call(this,s,t);b(this,k,Ss).call(this,t)}catch(s){b(this,k,Cs).call(this,s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(n(this,S)&qr)return!1;let t=tt&n(this,S);return t===et||t===ft||t===qt}shouldWalk(t,e){return(n(this,S)&ft)===ft&&!(n(this,S)&qr)&&!t.has(this)&&(!e||e(this))}async realpath(){if(n(this,pt))return n(this,pt);if(!((ks|ys|ot)&n(this,S)))try{let t=await n(this,Q).promises.realpath(this.fullpath());return p(this,pt,this.resolve(t))}catch(t){b(this,k,si).call(this)}}realpathSync(){if(n(this,pt))return n(this,pt);if(!((ks|ys|ot)&n(this,S)))try{let t=n(this,Q).realpathSync(this.fullpath());return p(this,pt,this.resolve(t))}catch(t){b(this,k,si).call(this)}}[to](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),p(i,kt,s.join(this.sep)),p(i,St,s.join("/")),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)p(i,kt,void 0),p(i,St,void 0),i=i.parent}};Q=new WeakMap,Fe=new WeakMap,Ne=new WeakMap,Le=new WeakMap,Ae=new WeakMap,Be=new WeakMap,je=new WeakMap,Ie=new WeakMap,_e=new WeakMap,We=new WeakMap,$e=new WeakMap,Ue=new WeakMap,qe=new WeakMap,Ge=new WeakMap,ze=new WeakMap,He=new WeakMap,Qe=new WeakMap,Ke=new WeakMap,Ve=new WeakMap,Mt=new WeakMap,Gt=new WeakMap,ut=new WeakMap,bt=new WeakMap,kt=new WeakMap,St=new WeakMap,S=new WeakMap,zt=new WeakMap,Ct=new WeakMap,pt=new WeakMap,k=new WeakSet,ti=function(t){let e=this;for(let s of t)e=e.child(s);return e},Ss=function(t){var e;p(this,S,n(this,S)|Ys);for(let s=t.provisional;s<t.length;s++){let i=t[s];i&&b(e=i,k,Oe).call(e)}},Oe=function(){n(this,S)&ot||(p(this,S,(n(this,S)|ot)&ve),b(this,k,ei).call(this))},ei=function(){var e;let t=this.children();t.provisional=0;for(let s of t)b(e=s,k,Oe).call(e)},si=function(){p(this,S,n(this,S)|ks),b(this,k,Me).call(this)},Me=function(){if(n(this,S)&Te)return;let t=n(this,S);(t&tt)===ft&&(t&=ve),p(this,S,t|Te),b(this,k,ei).call(this)},Cs=function(t=""){t==="ENOTDIR"||t==="EPERM"?b(this,k,Me).call(this):t==="ENOENT"?b(this,k,Oe).call(this):this.children().provisional=0},ii=function(t=""){var e;if(t==="ENOTDIR"){let s=this.parent;b(e=s,k,Me).call(e)}else t==="ENOENT"&&b(this,k,Oe).call(this)},ri=function(t=""){var s;let e=n(this,S);e|=ys,t==="ENOENT"&&(e|=ot),(t==="EINVAL"||t==="UNKNOWN")&&(e&=ve),p(this,S,e),t==="ENOTDIR"&&this.parent&&b(s=this.parent,k,Me).call(s)},xs=function(t,e){return b(this,k,so).call(this,t,e)||b(this,k,eo).call(this,t,e)},eo=function(t,e){let s=Zs(t),i=this.newChild(t.name,s,{parent:this}),o=n(i,S)&tt;return o!==ft&&o!==qt&&o!==et&&p(i,S,n(i,S)|Te),e.unshift(i),e.provisional++,i},so=function(t,e){for(let s=e.provisional;s<e.length;s++){let i=e[s];if((this.nocase?bs(t.name):Pe(t.name))===n(i,Mt))return b(this,k,io).call(this,t,i,s,e)}},io=function(t,e,s,i){let o=e.name;return p(e,S,n(e,S)&ve|Zs(t)),o!==t.name&&(e.name=t.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e},oi=function(t){let{atime:e,atimeMs:s,birthtime:i,birthtimeMs:o,blksize:a,blocks:h,ctime:l,ctimeMs:c,dev:u,gid:m,ino:d,mode:y,mtime:v,mtimeMs:g,nlink:x,rdev:C,size:R,uid:T}=t;p(this,He,e),p(this,Ue,s),p(this,Ve,i),p(this,ze,o),p(this,Ie,a),p(this,$e,h),p(this,Ke,l),p(this,Ge,c),p(this,Fe,u),p(this,Be,m),p(this,_e,d),p(this,Ne,y),p(this,Qe,v),p(this,qe,g),p(this,Le,x),p(this,je,C),p(this,We,R),p(this,Ae,T);let F=Zs(t);p(this,S,n(this,S)&ve|F|Ur),F!==et&&F!==ft&&F!==qt&&p(this,S,n(this,S)|Te)},ee=new WeakMap,se=new WeakMap,ro=function(t){p(this,se,!1);let e=n(this,ee).slice();n(this,ee).length=0,e.forEach(s=>s(null,t))},Ht=new WeakMap;vs=class r extends U{constructor(e,s=et,i,o,a,h,l){super(e,s,i,o,a,h,l);f(this,"sep","\\");f(this,"splitSep",ca)}newChild(e,s=et,i={}){return new r(e,s,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return oe.win32.parse(e).root}getRoot(e){if(e=la(e.toUpperCase()),e===this.root.name)return this.root;for(let[s,i]of Object.entries(this.roots))if(this.sameRoot(e,s))return this.roots[e]=i;return this.roots[e]=new ne(e,this).root}sameRoot(e,s=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Kr,"$1\\"),e===s}},Rs=class r extends U{constructor(e,s=et,i,o,a,h,l){super(e,s,i,o,a,h,l);f(this,"splitSep","/");f(this,"sep","/")}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,s=et,i={}){return new r(e,s,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Ts=class{constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:o=16*1024,fs:a=Re}={}){f(this,"root");f(this,"rootPath");f(this,"roots");f(this,"cwd");w(this,ie);w(this,re);w(this,Je);f(this,"nocase");w(this,Ye);p(this,Ye,Qr(a)),(t instanceof URL||t.startsWith("file://"))&&(t=(0,Hr.fileURLToPath)(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),p(this,ie,new Es),p(this,re,new Es),p(this,Je,new Xs(o));let l=h.substring(this.rootPath.length).split(s);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(n(this,Ye)),this.roots[this.rootPath]=this.root;let c=this.root,u=l.length-1,m=e.sep,d=this.rootPath,y=!1;for(let v of l){let g=u--;c=c.child(v,{relative:new Array(g).fill("..").join(m),relativePosix:new Array(g).fill("..").join("/"),fullpath:d+=(y?"":m)+v}),y=!0}this.cwd=c}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return n(this,Je)}resolve(...t){let e="";for(let o=t.length-1;o>=0;o--){let a=t[o];if(!(!a||a===".")&&(e=e?`${a}/${e}`:a,this.isAbsolute(a)))break}let s=n(this,ie).get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return n(this,ie).set(e,i),i}resolvePosix(...t){let e="";for(let o=t.length-1;o>=0;o--){let a=t[o];if(!(!a||a===".")&&(e=e?`${a}/${e}`:a,this.isAbsolute(a)))break}let s=n(this,re).get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return n(this,re).set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let i=await t.readdir();return s?i:i.map(o=>o.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s==null?void 0:s.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s==null?void 0:s.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s==null?void 0:s.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s==null?void 0:s.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:o,walkFilter:a}=e,h=[];(!o||o(t))&&h.push(s?t:t.fullpath());let l=new Set,c=(m,d)=>{l.add(m),m.readdirCB((y,v)=>{if(y)return d(y);let g=v.length;if(!g)return d();let x=()=>{--g===0&&d()};for(let C of v)(!o||o(C))&&h.push(s?C:C.fullpath()),i&&C.isSymbolicLink()?C.realpath().then(R=>R!=null&&R.isUnknown()?R.lstat():R).then(R=>R!=null&&R.shouldWalk(l,a)?c(R,x):x()):C.shouldWalk(l,a)?c(C,x):x()},!0)},u=t;return new Promise((m,d)=>{c(u,y=>{if(y)return d(y);m(h)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:o,walkFilter:a}=e,h=[];(!o||o(t))&&h.push(s?t:t.fullpath());let l=new Set([t]);for(let c of l){let u=c.readdirSync();for(let m of u){(!o||o(m))&&h.push(s?m:m.fullpath());let d=m;if(m.isSymbolicLink()){if(!(i&&(d=m.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(l,a)&&l.add(d)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:o,walkFilter:a}=e;(!o||o(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let l of h){let c=l.readdirSync();for(let u of c){(!o||o(u))&&(yield s?u:u.fullpath());let m=u;if(u.isSymbolicLink()){if(!(i&&(m=u.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(h,a)&&h.add(m)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:o,walkFilter:a}=e,h=new Ot({objectMode:!0});(!o||o(t))&&h.write(s?t:t.fullpath());let l=new Set,c=[t],u=0,m=()=>{let d=!1;for(;!d;){let y=c.shift();if(!y){u===0&&h.end();return}u++,l.add(y);let v=(x,C,R=!1)=>{if(x)return h.emit("error",x);if(i&&!R){let T=[];for(let F of C)F.isSymbolicLink()&&T.push(F.realpath().then(K=>K!=null&&K.isUnknown()?K.lstat():K));if(T.length){Promise.all(T).then(()=>v(null,C,!0));return}}for(let T of C)T&&(!o||o(T))&&(h.write(s?T:T.fullpath())||(d=!0));u--;for(let T of C){let F=T.realpathCached()||T;F.shouldWalk(l,a)&&c.push(F)}d&&!h.flowing?h.once("drain",m):g||m()},g=!0;y.readdirCB(v,!0),g=!1}};return m(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof U||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:o,walkFilter:a}=e,h=new Ot({objectMode:!0}),l=new Set;(!o||o(t))&&h.write(s?t:t.fullpath());let c=[t],u=0,m=()=>{let d=!1;for(;!d;){let y=c.shift();if(!y){u===0&&h.end();return}u++,l.add(y);let v=y.readdirSync();for(let g of v)(!o||o(g))&&(h.write(s?g:g.fullpath())||(d=!0));u--;for(let g of v){let x=g;if(g.isSymbolicLink()){if(!(i&&(x=g.realpathSync())))continue;x.isUnknown()&&x.lstatSync()}x.shouldWalk(l,a)&&c.push(x)}}d&&!h.flowing&&h.once("drain",m)};return m(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[to](e)}};ie=new WeakMap,re=new WeakMap,Je=new WeakMap,Ye=new WeakMap;ne=class extends Ts{constructor(e=process.cwd(),s={}){let{nocase:i=!0}=s;super(e,oe.win32,"\\",{...s,nocase:i});f(this,"sep","\\");this.nocase=i;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return oe.win32.parse(e).root.toUpperCase()}newRoot(e){return new vs(this.rootPath,ft,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},ae=class extends Ts{constructor(e=process.cwd(),s={}){let{nocase:i=!1}=s;super(e,oe.posix,"/",{...s,nocase:i});f(this,"sep","/");this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new Rs(this.rootPath,ft,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},De=class extends ae{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}},Mh=process.platform==="win32"?vs:Rs,oo=process.platform==="win32"?ne:process.platform==="darwin"?De:ae});var ua,pa,L,Y,_,Qt,nt,Ze,Ft,Nt,Lt,he,ai,le,hi=E(()=>{"use strict";Tt();ua=r=>r.length>=1,pa=r=>r.length>=1,ai=class ai{constructor(t,e,s,i){w(this,L);w(this,Y);w(this,_);f(this,"length");w(this,Qt);w(this,nt);w(this,Ze);w(this,Ft);w(this,Nt);w(this,Lt);w(this,he,!0);if(!ua(t))throw new TypeError("empty pattern list");if(!pa(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(p(this,L,t),p(this,Y,e),p(this,_,s),p(this,Qt,i),n(this,_)===0){if(this.isUNC()){let[o,a,h,l,...c]=n(this,L),[u,m,d,y,...v]=n(this,Y);c[0]===""&&(c.shift(),v.shift());let g=[o,a,h,l,""].join("/"),x=[u,m,d,y,""].join("/");p(this,L,[g,...c]),p(this,Y,[x,...v]),this.length=n(this,L).length}else if(this.isDrive()||this.isAbsolute()){let[o,...a]=n(this,L),[h,...l]=n(this,Y);a[0]===""&&(a.shift(),l.shift());let c=o+"/",u=h+"/";p(this,L,[c,...a]),p(this,Y,[u,...l]),this.length=n(this,L).length}}}pattern(){return n(this,L)[n(this,_)]}isString(){return typeof n(this,L)[n(this,_)]=="string"}isGlobstar(){return n(this,L)[n(this,_)]===W}isRegExp(){return n(this,L)[n(this,_)]instanceof RegExp}globString(){return p(this,Ze,n(this,Ze)||(n(this,_)===0?this.isAbsolute()?n(this,Y)[0]+n(this,Y).slice(1).join("/"):n(this,Y).join("/"):n(this,Y).slice(n(this,_)).join("/")))}hasMore(){return this.length>n(this,_)+1}rest(){return n(this,nt)!==void 0?n(this,nt):this.hasMore()?(p(this,nt,new ai(n(this,L),n(this,Y),n(this,_)+1,n(this,Qt))),p(n(this,nt),Lt,n(this,Lt)),p(n(this,nt),Nt,n(this,Nt)),p(n(this,nt),Ft,n(this,Ft)),n(this,nt)):p(this,nt,null)}isUNC(){let t=n(this,L);return n(this,Nt)!==void 0?n(this,Nt):p(this,Nt,n(this,Qt)==="win32"&&n(this,_)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=n(this,L);return n(this,Ft)!==void 0?n(this,Ft):p(this,Ft,n(this,Qt)==="win32"&&n(this,_)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=n(this,L);return n(this,Lt)!==void 0?n(this,Lt):p(this,Lt,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=n(this,L)[0];return typeof t=="string"&&this.isAbsolute()&&n(this,_)===0?t:""}checkFollowGlobstar(){return!(n(this,_)===0||!this.isGlobstar()||!n(this,he))}markFollowGlobstar(){return n(this,_)===0||!this.isGlobstar()||!n(this,he)?!1:(p(this,he,!1),!0)}};L=new WeakMap,Y=new WeakMap,_=new WeakMap,Qt=new WeakMap,nt=new WeakMap,Ze=new WeakMap,Ft=new WeakMap,Nt=new WeakMap,Lt=new WeakMap,he=new WeakMap;le=ai});var da,ce,li=E(()=>{"use strict";Tt();hi();da=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ce=class{constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:o,platform:a=da}){f(this,"relative");f(this,"relativeChildren");f(this,"absolute");f(this,"absoluteChildren");f(this,"platform");f(this,"mmopts");this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:o,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let h of t)this.add(h)}add(t){let e=new V(t,this.mmopts);for(let s=0;s<e.set.length;s++){let i=e.set[s],o=e.globParts[s];if(!i||!o)throw new Error("invalid pattern object");for(;i[0]==="."&&o[0]===".";)i.shift(),o.shift();let a=new le(i,o,0,this.platform),h=new V(a.globString(),this.mmopts),l=o[o.length-1]==="**",c=a.isAbsolute();c?this.absolute.push(h):this.relative.push(h),l&&(c?this.absoluteChildren.push(h):this.relativeChildren.push(h))}}ignored(t){let e=t.fullpath(),s=`${e}/`,i=t.relative()||".",o=`${i}/`;for(let a of this.relative)if(a.match(i)||a.match(o))return!0;for(let a of this.absolute)if(a.match(e)||a.match(s))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",s=(t.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}}});var ci,fi,ui,Xe,ao=E(()=>{"use strict";Tt();ci=class r{constructor(t=new Map){f(this,"store");this.store=t}copy(){return new r(new Map(this.store))}hasWalked(t,e){var s;return(s=this.store.get(t.fullpath()))==null?void 0:s.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),i=this.store.get(s);i?i.add(e.globString()):this.store.set(s,new Set([e.globString()]))}},fi=class{constructor(){f(this,"store",new Map)}add(t,e,s){let i=(e?2:0)|(s?1:0),o=this.store.get(t);this.store.set(t,o===void 0?i:i&o)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},ui=class{constructor(){f(this,"store",new Map)}add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},Xe=class r{constructor(t,e){f(this,"hasWalkedCache");f(this,"matches",new fi);f(this,"subwalks",new ui);f(this,"patterns");f(this,"follow");f(this,"dot");f(this,"opts");this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new ci}processPatterns(t,e){this.patterns=e;let s=e.map(i=>[t,i]);for(let[i,o]of s){this.hasWalkedCache.storeWalked(i,o);let a=o.root(),h=o.isAbsolute()&&this.opts.absolute!==!1;if(a){i=i.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let m=o.rest();if(m)o=m;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,c,u=!1;for(;typeof(l=o.pattern())=="string"&&(c=o.rest());)i=i.resolve(l),o=c,u=!0;if(l=o.pattern(),c=o.rest(),u){if(this.hasWalkedCache.hasWalked(i,o))continue;this.hasWalkedCache.storeWalked(i,o)}if(typeof l=="string"){let m=l===".."||l===""||l===".";this.matches.add(i.resolve(l),h,m);continue}else if(l===W){(!i.isSymbolicLink()||this.follow||o.checkFollowGlobstar())&&this.subwalks.add(i,o);let m=c==null?void 0:c.pattern(),d=c==null?void 0:c.rest();if(!c||(m===""||m===".")&&!d)this.matches.add(i,h,m===""||m===".");else if(m===".."){let y=i.parent||i;d?this.hasWalkedCache.hasWalked(y,d)||this.subwalks.add(y,d):this.matches.add(y,h,!0)}}else l instanceof RegExp&&this.subwalks.add(i,o)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),i=this.child();for(let o of e)for(let a of s){let h=a.isAbsolute(),l=a.pattern(),c=a.rest();l===W?i.testGlobstar(o,a,c,h):l instanceof RegExp?i.testRegExp(o,l,c,h):i.testString(o,l,c,h)}return i}testGlobstar(t,e,s,i){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let o=s.pattern();if(typeof o=="string"&&o!==".."&&o!==""&&o!==".")this.testString(t,o,s.rest(),i);else if(o===".."){let a=t.parent||t;this.subwalks.add(a,s)}else o instanceof RegExp&&this.testRegExp(t,o,s.rest(),i)}}testRegExp(t,e,s,i){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}}});var ma,fe,xt,Vt,st,Kt,pi,Ps,ts,es,ho=E(()=>{"use strict";Js();li();ao();ma=(r,t)=>typeof r=="string"?new ce([r],t):Array.isArray(r)?new ce(r,t):r,Ps=class{constructor(t,e,s){w(this,st);f(this,"path");f(this,"patterns");f(this,"opts");f(this,"seen",new Set);f(this,"paused",!1);f(this,"aborted",!1);w(this,fe,[]);w(this,xt);w(this,Vt);f(this,"signal");f(this,"maxDepth");f(this,"includeChildMatches");var i;if(this.patterns=t,this.path=e,this.opts=s,p(this,Vt,!s.posix&&s.platform==="win32"?"\\":"/"),this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(p(this,xt,ma((i=s.ignore)!=null?i:[],s)),!this.includeChildMatches&&typeof n(this,xt).add!="function")){let o="cannot ignore child matches, ignore lacks add() method.";throw new Error(o)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{n(this,fe).length=0}))}pause(){this.paused=!0}resume(){var e;if((e=this.signal)!=null&&e.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=n(this,fe).shift());)t()}onResume(t){var e;(e=this.signal)!=null&&e.aborted||(this.paused?n(this,fe).push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let o=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&(o!=null&&o.isSymbolicLink())){let a=await o.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(o,e)}matchCheckTest(t,e){var s;return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!((s=t.realpathCached())!=null&&s.isDirectory()))&&!b(this,st,Kt).call(this,t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let o=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&(o!=null&&o.isSymbolicLink())){let a=o.realpathSync();a&&(a!=null&&a.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(o,e)}matchFinish(t,e){var o;if(b(this,st,Kt).call(this,t))return;if(!this.includeChildMatches&&((o=n(this,xt))!=null&&o.add)){let a=`${t.relativePosix()}/**`;n(this,xt).add(a)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?n(this,Vt):"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let a=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(a+i)}else{let a=this.opts.posix?t.relativePosix():t.relative(),h=this.opts.dotRelative&&!a.startsWith(".."+n(this,Vt))?"."+n(this,Vt):"";this.matchEmit(a?h+a+i:"."+i)}}async match(t,e,s){let i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){let i=this.matchCheckSync(t,s);i&&this.matchFinish(i,e)}walkCB(t,e,s){var i;(i=this.signal)!=null&&i.aborted&&s(),this.walkCB2(t,e,new Xe(this.opts),s)}walkCB2(t,e,s,i){var h;if(b(this,st,pi).call(this,t))return i();if((h=this.signal)!=null&&h.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,i));return}s.processPatterns(t,e);let o=1,a=()=>{--o===0&&i()};for(let[l,c,u]of s.matches.entries())b(this,st,Kt).call(this,l)||(o++,this.match(l,c,u).then(()=>a()));for(let l of s.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;o++;let c=l.readdirCached();l.calledReaddir()?this.walkCB3(l,c,s,a):l.readdirCB((u,m)=>this.walkCB3(l,m,s,a),!0)}a()}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let o=1,a=()=>{--o===0&&i()};for(let[h,l,c]of s.matches.entries())b(this,st,Kt).call(this,h)||(o++,this.match(h,l,c).then(()=>a()));for(let[h,l]of s.subwalks.entries())o++,this.walkCB2(h,l,s.child(),a);a()}walkCBSync(t,e,s){var i;(i=this.signal)!=null&&i.aborted&&s(),this.walkCB2Sync(t,e,new Xe(this.opts),s)}walkCB2Sync(t,e,s,i){var h;if(b(this,st,pi).call(this,t))return i();if((h=this.signal)!=null&&h.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,i));return}s.processPatterns(t,e);let o=1,a=()=>{--o===0&&i()};for(let[l,c,u]of s.matches.entries())b(this,st,Kt).call(this,l)||this.matchSync(l,c,u);for(let l of s.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;o++;let c=l.readdirSync();this.walkCB3Sync(l,c,s,a)}a()}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let o=1,a=()=>{--o===0&&i()};for(let[h,l,c]of s.matches.entries())b(this,st,Kt).call(this,h)||this.matchSync(h,l,c);for(let[h,l]of s.subwalks.entries())o++,this.walkCB2Sync(h,l,s.child(),a);a()}};fe=new WeakMap,xt=new WeakMap,Vt=new WeakMap,st=new WeakSet,Kt=function(t){var e,s;return this.seen.has(t)||!!((s=(e=n(this,xt))==null?void 0:e.ignored)!=null&&s.call(e,t))},pi=function(t){var e,s;return!!((s=(e=n(this,xt))==null?void 0:e.childrenIgnored)!=null&&s.call(e,t))};ts=class extends Ps{constructor(e,s,i){super(e,s,i);f(this,"matches",new Set)}matchEmit(e){this.matches.add(e)}async walk(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((s,i)=>{this.walkCB(this.path,this.patterns,()=>{var o;(o=this.signal)!=null&&o.aborted?i(this.signal.reason):s(this.matches)})}),this.matches}walkSync(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var s;if((s=this.signal)!=null&&s.aborted)throw this.signal.reason}),this.matches}},es=class extends Ps{constructor(e,s,i){super(e,s,i);f(this,"results");this.results=new Ot({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}});var lo,ga,at,di=E(()=>{"use strict";Tt();lo=require("url");no();hi();ho();ga=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",at=class{constructor(t,e){f(this,"absolute");f(this,"cwd");f(this,"root");f(this,"dot");f(this,"dotRelative");f(this,"follow");f(this,"ignore");f(this,"magicalBraces");f(this,"mark");f(this,"matchBase");f(this,"maxDepth");f(this,"nobrace");f(this,"nocase");f(this,"nodir");f(this,"noext");f(this,"noglobstar");f(this,"pattern");f(this,"platform");f(this,"realpath");f(this,"scurry");f(this,"stat");f(this,"signal");f(this,"windowsPathsNoEscape");f(this,"withFileTypes");f(this,"includeChildMatches");f(this,"opts");f(this,"patterns");if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,lo.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=t,this.platform=e.platform||ga,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=e.platform==="win32"?ne:e.platform==="darwin"?De:e.platform?ae:oo;this.scurry=new l(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",i={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},o=this.pattern.map(l=>new V(l,i)),[a,h]=o.reduce((l,c)=>(l[0].push(...c.set),l[1].push(...c.globParts),l),[[],[]]);this.patterns=a.map((l,c)=>{let u=h[c];if(!u)throw new Error("invalid pattern object");return new le(l,u,0,this.platform)})}async walk(){return[...await new ts(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ts(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new es(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new es(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}});var mi,gi=E(()=>{"use strict";Tt();mi=(r,t={})=>{Array.isArray(r)||(r=[r]);for(let e of r)if(new V(e,t).hasMagic())return!0;return!1}});function Os(r,t={}){return new at(r,t).streamSync()}function uo(r,t={}){return new at(r,t).stream()}function po(r,t={}){return new at(r,t).walkSync()}async function co(r,t={}){return new at(r,t).walk()}function Ms(r,t={}){return new at(r,t).iterateSync()}function mo(r,t={}){return new at(r,t).iterate()}var wa,ya,ba,ka,ss,fo,wi=E(()=>{"use strict";Tt();di();gi();Tt();di();gi();li();wa=Os,ya=Object.assign(uo,{sync:Os}),ba=Ms,ka=Object.assign(mo,{sync:Ms}),ss=Object.assign(po,{stream:Os,iterate:Ms}),fo=Object.assign(co,{glob:co,globSync:po,sync:ss,globStream:uo,stream:ya,globStreamSync:Os,streamSync:wa,globIterate:mo,iterate:ka,globIterateSync:Ms,iterateSync:ba,Glob:at,hasMagic:mi,escape:Zt,unescape:it});fo.glob=fo});function go(){let r=ss("./**/Cookies",{cwd:Jt,absolute:!0});return xa.debug("Found cookie files:",r),r}var Sa,Ca,xa,wo=E(()=>{"use strict";Sa=require("fs"),Ca=require("path");wi();mt();As();xa=M.withTag("listChromeProfiles")});function Ra(r){var e;let t=[/.*?0t(.+)$/,/.*?1e`(.+)$/,/.*?[`'](.+)$/,/[^\x20-\x7E]*([\x20-\x7E].+)$/];for(let s of t){let i=r.match(s),o=(e=i==null?void 0:i[1])!=null?e:"";if(o.length>0)return o}return r}async function yo(r,t){if(typeof t!="string")throw new Error("password must be a string");if(!Buffer.isBuffer(r))throw new Error("encryptedData must be a Buffer");return new Promise((e,s)=>{(0,Ds.pbkdf2)(t,"saltysalt",1003,16,"sha1",(i,o)=>{try{if(i){s(new Error("Failed to derive key: "+i.message));return}let a=Ea(r);if(a.length%16!==0){s(new Error("Encrypted data length is not a multiple of 16"));return}let h=Buffer.alloc(16," "),l=(0,Ds.createDecipheriv)("aes-128-cbc",o,h);l.setAutoPadding(!1);let c=l.update(a);try{l.final()}catch(m){s(new Error("Failed to finalize decryption: "+m.message));return}c=va(c);let u=c.toString("utf8");e(Ra(u))}catch(a){s(new Error("Decryption failed: "+a.message))}})})}var Ds,yi,Ea,va,bo=E(()=>{"use strict";Ds=require("crypto"),yi=require("lodash-es"),Ea=(0,yi.memoize)(r=>r.length>=3&&r[0]===118&&r[1]===49&&r[2]===48?r.slice(3):r,r=>r.toString("hex")),va=(0,yi.memoize)(r=>{let t=r[r.length-1];return t&&t<=16?r.slice(0,-t):r},r=>r.toString("hex"))});function Pa(r,t){if(r instanceof At)throw q("Command execution failed",r,{command:r.command,originalError:r.originalError}),r;if(r instanceof Error){let s=new At(r.message,t,r);throw q("Failed to execute command",r,{command:t,stack:r.stack}),s}let e=new At("Unknown error occurred during command execution",t);throw q("Failed to execute command",null,{error:r,command:t}),e}async function Co(r,t={}){if(!r||typeof r!="string")throw new At("Command must be a non-empty string",r);let e={encoding:"utf8",maxBuffer:5*1024*1024,timeout:3e4};try{let{stdout:s,stderr:i}=await Ta(r,{...e,...t}),o=s.trim();if(!o)throw i?new At(`Command failed with stderr: ${i}`,r):new At("Command returned empty result",r);return o}catch(s){Pa(s,r)}}var ko,So,Ta,At,xo=E(()=>{"use strict";ko=require("child_process"),So=require("util");It();Ta=(0,So.promisify)(ko.exec),At=class extends Error{constructor(e,s,i){super(e);this.command=s;this.originalError=i;this.name="CommandExecutionError"}}});var vo={};jt(vo,{getChromePassword:()=>Ma});var Eo,Oa,Ma,Ro=E(()=>{"use strict";Eo=require("lodash-es");xo();Oa=async()=>Co('security find-generic-password -w -s "Chrome Safe Storage"'),Ma=(0,Eo.memoize)(Oa)});var To,Po,Oo=E(()=>{"use strict";To=require("lodash-es");It();Po=(0,To.memoize)(async()=>{if(process.platform!=="darwin")throw q("Chrome password retrieval failed",new Error("This only works on macOS"),{platform:process.platform}),new Error("This only works on macOS");try{let{getChromePassword:r}=await Promise.resolve().then(()=>(Ro(),vo)),t=await r();return ht("ChromePassword","Retrieved password successfully",{platform:"macOS"}),t}catch(r){throw q("Chrome password retrieval failed",r,{platform:"macOS"}),r}})});function Da(r){return typeof r!="number"||r<=0?"Infinity":new Date(r)}function Mo(r,t,e,s,i,o){return{domain:r,name:t,value:e,expiry:Da(s),meta:{file:i,browser:"Chrome",decrypted:o}}}var ue,bi=E(()=>{"use strict";Mi();It();Ui();wo();bo();Oo();ue=class{constructor(){this.logger=Di("ChromeCookieQueryStrategy");this.browserName="Chrome"}async queryCookies(t,e){try{if(this.logger.info("Querying cookies",{name:t,domain:e}),process.platform!=="darwin")return this.logger.warn("Platform not supported",{platform:process.platform}),[];let i=go().map(h=>h),o=await Po(),a=await Oi(i,h=>this.processFile(h,t,e,o),[]);return is("Cookie query",!0,{count:a.length}),a}catch(s){return q("Failed to query cookies",s,{name:t,domain:e}),[]}}async processFile(t,e,s,i){try{let o=await $i({name:e,domain:s,file:t}),a={file:t,password:i};return(await Promise.allSettled(o.map(l=>this.processCookie(l,a)))).map(l=>l.status==="fulfilled"?l.value:null).filter(l=>l!==null)}catch(o){return this.logger.error("Failed to process cookie file",{error:o,file:t}),[]}}async processCookie(t,e){try{let s=Buffer.isBuffer(t.value)?t.value:Buffer.from(String(t.value)),i=await yo(s,e.password);return Mo(t.domain,t.name,i,t.expiry,e.file,!0)}catch(s){return this.logger.warn("Failed to decrypt cookie",{error:s}),Mo(t.domain,t.name,t.value.toString("utf-8"),t.expiry,e.file,!1)}}}});function Fa(){let r=[],t=process.env.HOME;if(typeof t!="string"||t.length===0)return rs("FirefoxCookieQuery","HOME environment variable not set"),r;let e=[(0,ki.join)(t,"Library/Application Support/Firefox/Profiles/*/cookies.sqlite"),(0,ki.join)(t,".mozilla/firefox/*/cookies.sqlite")];for(let s of e){let i=ss(s);r.push(...i)}return ht("FirefoxCookieQuery","Found Firefox cookie files",{files:r}),r}var ki,pe,Si=E(()=>{"use strict";ki=require("path");wi();It();Bs();pe=class{constructor(){this.browserName="Firefox"}async queryCookies(t,e){let s=Fa(),i=[];for(let o of s)try{let a=await ns({file:o,sql:"SELECT name, value, host as domain, expiry FROM moz_cookies WHERE name = ? AND host LIKE ?",params:[t,`%${e}%`],rowTransform:h=>({name:h.name,value:h.value,domain:h.domain,expiry:h.expiry>0?new Date(h.expiry*1e3):"Infinity",meta:{file:o,browser:"Firefox",decrypted:!1}})});i.push(...a)}catch(a){a instanceof Error?rs("FirefoxCookieQuery",`Error reading Firefox cookie file ${o}`,{error:a.message}):rs("FirefoxCookieQuery",`Error reading Firefox cookie file ${o}`)}return i}}});async function Do(r){let t=[new ue,new pe];return(await Promise.allSettled(t.map(s=>s.queryCookies(r.name,r.domain)))).filter(s=>s.status==="fulfilled").flatMap(s=>s.value)}var Fo=E(()=>{"use strict";bi();Si()});var No={};jt(No,{default:()=>Na,getCookie:()=>de});async function de(r){try{return await Do(r)}catch(t){return M.warn("Error querying cookies:",t instanceof Error?t.message:String(t)),[]}}var Na,Fs=E(()=>{"use strict";mt();Fo();Na=de});var Ao={};jt(Ao,{default:()=>La,getChromeCookie:()=>Lo});async function Lo(r){try{return await new ue().queryCookies(r.name,r.domain)}catch(t){return M.warn("Error querying Chrome cookies:",t),[]}}var La,Bo=E(()=>{"use strict";mt();bi();La=Lo});var Io={};jt(Io,{default:()=>Aa,getFirefoxCookie:()=>jo});async function jo(r){try{return await new pe().queryCookies(r.name,r.domain)}catch(t){return M.warn("Error querying Firefox cookies:",t instanceof Error?t.message:String(t)),[]}}var Aa,_o=E(()=>{"use strict";mt();Si();Aa=jo});function Ns(r,t={}){let{format:e="merged",showFilePaths:s=!0,separator:i="; "}=t;if(r.length===0)return e==="merged"?"":[];if(e==="merged")return r.map(a=>a.value).join(i);let o=(0,Wo.groupBy)(r,a=>{var h,l;return(l=(h=a.meta)==null?void 0:h.file)!=null?l:"unknown"});return Object.entries(o).map(([a,h])=>{let l=h.map(c=>c.value).join(i);return s?`${a}: ${l}`:l})}var Wo,Ci=E(()=>{"use strict";Wo=require("lodash-es")});var Uo={};jt(Uo,{default:()=>Ba,getGroupedRenderedCookies:()=>$o});async function $o(r,t={}){try{let e=await de(r);return Ns(e,{...t,format:"grouped"})}catch(e){return M.warn("Error getting grouped rendered cookies:",e instanceof Error?e.message:String(e)),[]}}var Ba,qo=E(()=>{"use strict";mt();Fs();Ci();Ba=$o});var zo={};jt(zo,{default:()=>ja,getMergedRenderedCookies:()=>Go});async function Go(r,t={}){try{let e=await de(r);return Ns(e,{...t,format:"merged"})}catch(e){return M.warn("Error getting merged rendered cookies:",e instanceof Error?e.message:String(e)),""}}var ja,Ho=E(()=>{"use strict";mt();Fs();Ci();ja=Go});var qa={};jt(qa,{getChromeCookie:()=>_a,getCookie:()=>Ia,getFirefoxCookie:()=>Wa,getGroupedRenderedCookies:()=>$a,getMergedRenderedCookies:()=>Ua});module.exports=tn(qa);var Ia=()=>Promise.resolve().then(()=>(Fs(),No)).then(r=>r.getCookie),_a=()=>Promise.resolve().then(()=>(Bo(),Ao)).then(r=>r.getChromeCookie),Wa=()=>Promise.resolve().then(()=>(_o(),Io)).then(r=>r.getFirefoxCookie),$a=()=>Promise.resolve().then(()=>(qo(),Uo)).then(r=>r.getGroupedRenderedCookies),Ua=()=>Promise.resolve().then(()=>(Ho(),zo)).then(r=>r.getMergedRenderedCookies);0&&(module.exports={getChromeCookie,getCookie,getFirefoxCookie,getGroupedRenderedCookies,getMergedRenderedCookies});
1
+ "use strict";var sn=Object.create;var ge=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var nn=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty;var Pi=r=>{throw TypeError(r)};var hn=(r,t,e)=>t in r?ge(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var E=(r,t)=>()=>(r&&(t=r(r=0)),t);var Di=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),_t=(r,t)=>{for(var e in t)ge(r,e,{get:t[e],enumerable:!0})},Mi=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of on(t))!an.call(r,i)&&i!==e&&ge(r,i,{get:()=>t[i],enumerable:!(s=rn(t,i))||s.enumerable});return r};var we=(r,t,e)=>(e=r!=null?sn(nn(r)):{},Mi(t||!r||!r.__esModule?ge(e,"default",{value:r,enumerable:!0}):e,r)),ln=r=>Mi(ge({},"__esModule",{value:!0}),r);var f=(r,t,e)=>hn(r,typeof t!="symbol"?t+"":t,e),Is=(r,t,e)=>t.has(r)||Pi("Cannot "+e);var a=(r,t,e)=>(Is(r,t,"read from private field"),e?e.call(r):t.get(r)),w=(r,t,e)=>t.has(r)?Pi("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),p=(r,t,e,s)=>(Is(r,t,"write to private field"),s?s.call(r,e):t.set(r,e),e),b=(r,t,e)=>(Is(r,t,"access private method"),e);var Fi,cn,D,gt=E(()=>{"use strict";Fi=require("consola"),cn=(0,Fi.createConsola)({fancy:!0,formatOptions:{showLogLevel:!1,colors:!0,date:!1,compact:!0,columns:typeof process.stdout.columns=="number"?process.stdout.columns:80},level:typeof process.env.LOG_LEVEL=="string"&&process.env.LOG_LEVEL==="debug"?5:2}),D=cn});function Ni(r,t,e){let i=`${t?"\u2705":"\u274C"} ${r} ${t?"succeeded":"failed"}`;t?D.success(i,e):D.error(i,e)}function F(r,t,e){let s={...e!=null?e:{},error:t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:t};D.error(r,s)}function lt(r,t,e){D.withTag(r).debug(t,e)}function Li(r){return D.withTag(r)}function os(r,t,e){D.withTag(r).warn(t,e)}var vt=E(()=>{"use strict";gt();gt()});var Ai,Bi,ns,Ii=E(()=>{"use strict";Ai=require("lodash-es"),Bi={};(0,Ai.merge)(Bi,process.env);ns=Bi.HOME;if(typeof ns!="string"||ns.length===0)throw new Error("HOME environment variable is not set or empty")});var _i,ji,Yt,js=E(()=>{"use strict";_i=require("path");Ii();Yt=(0,_i.join)((ji=ns)!=null?ji:"","Library","Application Support","Google","Chrome")});function un(r){try{return r.close(),Promise.resolve()}catch(t){return F("Database close failed",t),Promise.reject(t instanceof Error?t:new Error("Failed to close database: Unknown error"))}}async function as({file:r,sql:t,params:e,rowFilter:s,rowTransform:i}){let o;try{o=await fn(r);let h=o.prepare(t).all(e),l=s?h.filter(s):h;return i?l.map(i):l}catch(n){throw F("Database query failed",n,{file:r,sql:t}),n}finally{o&&await un(o)}}var $i,Wi,fn,_s=E(()=>{"use strict";$i=we(require("better-sqlite3"),1),Wi=require("lodash-es");vt();fn=(0,Wi.memoize)(r=>{try{return Promise.resolve(new $i.default(r,{readonly:!0}))}catch(t){throw F("Database open failed",t,{file:r}),t}})});function pn(r){if(typeof r!="string")return!1;let t=r.trim();return t.length===0?!1:(0,Ui.existsSync)(t)}async function dn(){let r=[(0,hs.join)(Yt,"Default/Cookies"),(0,hs.join)(Yt,"Profile */Cookies"),(0,hs.join)(Yt,"Profile Default/Cookies")],t=[];for(let e of r){let s=await(0,zi.default)(e);t.push(...s)}return lt("ChromeCookies","Found cookie files",{count:t.length,files:t}),t}function mn(r,t){let e=r==="%",s=e?"SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE host_key LIKE ?":"SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE name = ? AND host_key LIKE ?",i=e?[`%${t}%`]:[r,`%${t}%`];return{sql:s,params:i}}async function gn(r,t,e){try{let{sql:s,params:i}=mn(t,e);lt("ChromeCookies","Executing query",{sql:s,params:i});let o=await as({file:r,sql:s,params:i,rowTransform:n=>({name:n.name,domain:n.host_key,value:n.encrypted_value,expiry:n.expires_utc})});return Ni("QueryCookies",!0,{file:r,count:o.length}),o}catch(s){return F("Failed to read cookie file",s,{file:r}),[]}}async function qi({name:r,domain:t,file:e}){let s=typeof e=="string"&&e.length>0?[e]:await dn();if(s.length===0)return lt("ChromeCookies","No cookie files found"),[];let i=[];for(let o of s){if(!pn(o)){lt("ChromeCookies","Cookie file missing or invalid",{file:o});continue}let n=await gn(o,r,t);i.push(...n)}return lt("ChromeCookies","Query complete",{totalCookies:i.length}),i}var Ui,hs,zi,Gi=E(()=>{"use strict";Ui=require("fs"),hs=require("path"),zi=we(require("fast-glob"),1);vt();js();_s()});var Ji=Di((kh,Vi)=>{"use strict";Vi.exports=Qi;function Qi(r,t,e){r instanceof RegExp&&(r=Hi(r,e)),t instanceof RegExp&&(t=Hi(t,e));var s=Ki(r,t,e);return s&&{start:s[0],end:s[1],pre:e.slice(0,s[0]),body:e.slice(s[0]+r.length,s[1]),post:e.slice(s[1]+t.length)}}function Hi(r,t){var e=t.match(r);return e?e[0]:null}Qi.range=Ki;function Ki(r,t,e){var s,i,o,n,h,l=e.indexOf(r),c=e.indexOf(t,l+1),u=l;if(l>=0&&c>0){if(r===t)return[l,c];for(s=[],o=e.length;u>=0&&!h;)u==l?(s.push(u),l=e.indexOf(r,u+1)):s.length==1?h=[s.pop(),c]:(i=s.pop(),i<o&&(o=i,n=c),c=e.indexOf(t,u+1)),u=l<c&&l>=0?l:c;s.length&&(h=[o,n])}return h}});var rr=Di((Sh,ir)=>{"use strict";var Yi=Ji();ir.exports=bn;var Zi="\0SLASH"+Math.random()+"\0",Xi="\0OPEN"+Math.random()+"\0",Ws="\0CLOSE"+Math.random()+"\0",tr="\0COMMA"+Math.random()+"\0",er="\0PERIOD"+Math.random()+"\0";function $s(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function wn(r){return r.split("\\\\").join(Zi).split("\\{").join(Xi).split("\\}").join(Ws).split("\\,").join(tr).split("\\.").join(er)}function yn(r){return r.split(Zi).join("\\").split(Xi).join("{").split(Ws).join("}").split(tr).join(",").split(er).join(".")}function sr(r){if(!r)return[""];var t=[],e=Yi("{","}",r);if(!e)return r.split(",");var s=e.pre,i=e.body,o=e.post,n=s.split(",");n[n.length-1]+="{"+i+"}";var h=sr(o);return o.length&&(n[n.length-1]+=h.shift(),n.push.apply(n,h)),t.push.apply(t,n),t}function bn(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),ye(wn(r),!0).map(yn)):[]}function kn(r){return"{"+r+"}"}function Sn(r){return/^-?0\d/.test(r)}function Cn(r,t){return r<=t}function xn(r,t){return r>=t}function ye(r,t){var e=[],s=Yi("{","}",r);if(!s)return[r];var i=s.pre,o=s.post.length?ye(s.post,!1):[""];if(/\$$/.test(s.pre))for(var n=0;n<o.length;n++){var h=i+"{"+s.body+"}"+o[n];e.push(h)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),u=l||c,m=s.body.indexOf(",")>=0;if(!u&&!m)return s.post.match(/,.*\}/)?(r=s.pre+"{"+s.body+Ws+s.post,ye(r)):[r];var d;if(u)d=s.body.split(/\.\./);else if(d=sr(s.body),d.length===1&&(d=ye(d[0],!1).map(kn),d.length===1))return o.map(function(en){return s.pre+d[0]+en});var y;if(u){var R=$s(d[0]),g=$s(d[1]),x=Math.max(d[0].length,d[1].length),C=d.length==3?Math.abs($s(d[2])):1,T=Cn,O=g<R;O&&(C*=-1,T=xn);var L=d.some(Sn);y=[];for(var V=R;T(V,g);V+=C){var X;if(c)X=String.fromCharCode(V),X==="\\"&&(X="");else if(X=String(V),L){var Ti=x-X.length;if(Ti>0){var Oi=new Array(Ti+1).join("0");V<0?X="-"+Oi+X.slice(1):X=Oi+X}}y.push(X)}}else{y=[];for(var jt=0;jt<d.length;jt++)y.push.apply(y,ye(d[jt],!1))}for(var jt=0;jt<y.length;jt++)for(var n=0;n<o.length;n++){var h=i+y[jt]+o[n];(!t||u||h)&&e.push(h)}}return e}});var be,or=E(()=>{"use strict";be=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")}});var En,ke,vn,nr,ar,hr=E(()=>{"use strict";En={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},ke=r=>r.replace(/[[\]\\-]/g,"\\$&"),vn=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),nr=r=>r.join(""),ar=(r,t)=>{let e=t;if(r.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],i=[],o=e+1,n=!1,h=!1,l=!1,c=!1,u=e,m="";t:for(;o<r.length;){let g=r.charAt(o);if((g==="!"||g==="^")&&o===e+1){c=!0,o++;continue}if(g==="]"&&n&&!l){u=o+1;break}if(n=!0,g==="\\"&&!l){l=!0,o++;continue}if(g==="["&&!l){for(let[x,[C,T,O]]of Object.entries(En))if(r.startsWith(x,o)){if(m)return["$.",!1,r.length-e,!0];o+=x.length,O?i.push(C):s.push(C),h=h||T;continue t}}if(l=!1,m){g>m?s.push(ke(m)+"-"+ke(g)):g===m&&s.push(ke(g)),m="",o++;continue}if(r.startsWith("-]",o+1)){s.push(ke(g+"-")),o+=2;continue}if(r.startsWith("-",o+1)){m=g,o+=2;continue}s.push(ke(g)),o++}if(u<o)return["",!1,0,!1];if(!s.length&&!i.length)return["$.",!1,r.length-e,!0];if(i.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!c){let g=s[0].length===2?s[0].slice(-1):s[0];return[vn(g),!1,u-e,!1]}let d="["+(c?"^":"")+nr(s)+"]",y="["+(c?"":"^")+nr(i)+"]";return[s.length&&i.length?"("+d+"|"+y+")":s.length?d:y,h,u-e,!0]}});var rt,ls=E(()=>{"use strict";rt=(r,{windowsPathsNoEscape:t=!1}={})=>t?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")});var Rn,lr,Tn,cs,On,Pn,Dn,Mn,zs,cr,fr,A,I,wt,P,N,Rt,$t,Tt,ct,Wt,Se,Ut,ur,Ot,fs,Us,pr,G,Zt,qs=E(()=>{"use strict";hr();ls();Rn=new Set(["!","?","+","*","@"]),lr=r=>Rn.has(r),Tn="(?!(?:^|/)\\.\\.?(?:$|/))",cs="(?!\\.)",On=new Set(["[","."]),Pn=new Set(["..","."]),Dn=new Set("().*{}+?[]^$\\!"),Mn=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),zs="[^/]",cr=zs+"*?",fr=zs+"+?",G=class G{constructor(t,e,s={}){w(this,Ut);f(this,"type");w(this,A);w(this,I);w(this,wt,!1);w(this,P,[]);w(this,N);w(this,Rt);w(this,$t);w(this,Tt,!1);w(this,ct);w(this,Wt);w(this,Se,!1);this.type=t,t&&p(this,I,!0),p(this,N,e),p(this,A,a(this,N)?a(a(this,N),A):this),p(this,ct,a(this,A)===this?s:a(a(this,A),ct)),p(this,$t,a(this,A)===this?[]:a(a(this,A),$t)),t==="!"&&!a(a(this,A),Tt)&&a(this,$t).push(this),p(this,Rt,a(this,N)?a(a(this,N),P).length:0)}get hasMagic(){if(a(this,I)!==void 0)return a(this,I);for(let t of a(this,P))if(typeof t!="string"&&(t.type||t.hasMagic))return p(this,I,!0);return a(this,I)}toString(){return a(this,Wt)!==void 0?a(this,Wt):this.type?p(this,Wt,this.type+"("+a(this,P).map(t=>String(t)).join("|")+")"):p(this,Wt,a(this,P).map(t=>String(t)).join(""))}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof G&&a(e,N)===this))throw new Error("invalid part: "+e);a(this,P).push(e)}}toJSON(){var e;let t=this.type===null?a(this,P).slice().map(s=>typeof s=="string"?s:s.toJSON()):[this.type,...a(this,P).map(s=>s.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===a(this,A)||a(a(this,A),Tt)&&((e=a(this,N))==null?void 0:e.type)==="!")&&t.push({}),t}isStart(){var e;if(a(this,A)===this)return!0;if(!((e=a(this,N))!=null&&e.isStart()))return!1;if(a(this,Rt)===0)return!0;let t=a(this,N);for(let s=0;s<a(this,Rt);s++){let i=a(t,P)[s];if(!(i instanceof G&&i.type==="!"))return!1}return!0}isEnd(){var e,s,i;if(a(this,A)===this||((e=a(this,N))==null?void 0:e.type)==="!")return!0;if(!((s=a(this,N))!=null&&s.isEnd()))return!1;if(!this.type)return(i=a(this,N))==null?void 0:i.isEnd();let t=a(this,N)?a(a(this,N),P).length:0;return a(this,Rt)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new G(this.type,t);for(let s of a(this,P))e.copyIn(s);return e}static fromGlob(t,e={}){var i;let s=new G(null,void 0,e);return b(i=G,Ot,fs).call(i,t,s,0,e),s}toMMPattern(){if(this!==a(this,A))return a(this,A).toMMPattern();let t=this.toString(),[e,s,i,o]=this.toRegExpSource();if(!(i||a(this,I)||a(this,ct).nocase&&!a(this,ct).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let h=(a(this,ct).nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${e}$`,h),{_src:e,_glob:t})}get options(){return a(this,ct)}toRegExpSource(t){var l;let e=t!=null?t:!!a(this,ct).dot;if(a(this,A)===this&&b(this,Ut,ur).call(this),!this.type){let c=this.isStart()&&this.isEnd(),u=a(this,P).map(R=>{var O;let[g,x,C,T]=typeof R=="string"?b(O=G,Ot,pr).call(O,R,a(this,I),c):R.toRegExpSource(t);return p(this,I,a(this,I)||C),p(this,wt,a(this,wt)||T),g}).join(""),m="";if(this.isStart()&&typeof a(this,P)[0]=="string"&&!(a(this,P).length===1&&Pn.has(a(this,P)[0]))){let g=On,x=e&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),C=!e&&!t&&g.has(u.charAt(0));m=x?Tn:C?cs:""}let d="";return this.isEnd()&&a(a(this,A),Tt)&&((l=a(this,N))==null?void 0:l.type)==="!"&&(d="(?:$|\\/)"),[m+u+d,rt(u),p(this,I,!!a(this,I)),a(this,wt)]}let s=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",o=b(this,Ut,Us).call(this,e);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){let c=this.toString();return p(this,P,[c]),this.type=null,p(this,I,void 0),[c,rt(this.toString()),!1,!1]}let n=!s||t||e||!cs?"":b(this,Ut,Us).call(this,!0);n===o&&(n=""),n&&(o=`(?:${o})(?:${n})*?`);let h="";if(this.type==="!"&&a(this,Se))h=(this.isStart()&&!e?cs:"")+fr;else{let c=this.type==="!"?"))"+(this.isStart()&&!e&&!t?cs:"")+cr+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&n?")":this.type==="*"&&n?")?":`)${this.type}`;h=i+o+c}return[h,rt(o),p(this,I,!!a(this,I)),a(this,wt)]}};A=new WeakMap,I=new WeakMap,wt=new WeakMap,P=new WeakMap,N=new WeakMap,Rt=new WeakMap,$t=new WeakMap,Tt=new WeakMap,ct=new WeakMap,Wt=new WeakMap,Se=new WeakMap,Ut=new WeakSet,ur=function(){if(this!==a(this,A))throw new Error("should only call on root");if(a(this,Tt))return this;this.toString(),p(this,Tt,!0);let t;for(;t=a(this,$t).pop();){if(t.type!=="!")continue;let e=t,s=a(e,N);for(;s;){for(let i=a(e,Rt)+1;!s.type&&i<a(s,P).length;i++)for(let o of a(t,P)){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(a(s,P)[i])}e=s,s=a(e,N)}}return this},Ot=new WeakSet,fs=function(t,e,s,i){var y,R;let o=!1,n=!1,h=-1,l=!1;if(e.type===null){let g=s,x="";for(;g<t.length;){let C=t.charAt(g++);if(o||C==="\\"){o=!o,x+=C;continue}if(n){g===h+1?(C==="^"||C==="!")&&(l=!0):C==="]"&&!(g===h+2&&l)&&(n=!1),x+=C;continue}else if(C==="["){n=!0,h=g,l=!1,x+=C;continue}if(!i.noext&&lr(C)&&t.charAt(g)==="("){e.push(x),x="";let T=new G(C,e);g=b(y=G,Ot,fs).call(y,t,T,g,i),e.push(T);continue}x+=C}return e.push(x),g}let c=s+1,u=new G(null,e),m=[],d="";for(;c<t.length;){let g=t.charAt(c++);if(o||g==="\\"){o=!o,d+=g;continue}if(n){c===h+1?(g==="^"||g==="!")&&(l=!0):g==="]"&&!(c===h+2&&l)&&(n=!1),d+=g;continue}else if(g==="["){n=!0,h=c,l=!1,d+=g;continue}if(lr(g)&&t.charAt(c)==="("){u.push(d),d="";let x=new G(g,u);u.push(x),c=b(R=G,Ot,fs).call(R,t,x,c,i);continue}if(g==="|"){u.push(d),d="",m.push(u),u=new G(null,e);continue}if(g===")")return d===""&&a(e,P).length===0&&p(e,Se,!0),u.push(d),d="",e.push(...m,u),c;d+=g}return e.type=null,p(e,I,void 0),p(e,P,[t.substring(s-1)]),c},Us=function(t){return a(this,P).map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,i,o,n]=e.toRegExpSource(t);return p(this,wt,a(this,wt)||n),s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")},pr=function(t,e,s=!1){let i=!1,o="",n=!1;for(let h=0;h<t.length;h++){let l=t.charAt(h);if(i){i=!1,o+=(Dn.has(l)?"\\":"")+l;continue}if(l==="\\"){h===t.length-1?o+="\\\\":i=!0;continue}if(l==="["){let[c,u,m,d]=ar(t,h);if(m){o+=c,n=n||u,h+=m-1,e=e||d;continue}}if(l==="*"){s&&t==="*"?o+=fr:o+=cr,e=!0;continue}if(l==="?"){o+=zs,e=!0;continue}o+=Mn(l)}return[o,rt(t),!!e,n]},w(G,Ot);Zt=G});var Xt,Gs=E(()=>{"use strict";Xt=(r,{windowsPathsNoEscape:t=!1}={})=>t?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&")});var gr,H,Fn,Nn,Ln,An,Bn,In,jn,_n,$n,Wn,Un,zn,qn,Gn,Hn,Qn,Kn,Vn,wr,yr,br,dr,Jn,U,Yn,Zn,Xn,ta,ea,tt,sa,kr,ia,ra,mr,oa,J,Pt=E(()=>{"use strict";gr=we(rr(),1);or();qs();Gs();ls();qs();Gs();ls();H=(r,t,e={})=>(be(t),!e.nocomment&&t.charAt(0)==="#"?!1:new J(t,e).match(r)),Fn=/^\*+([^+@!?\*\[\(]*)$/,Nn=r=>t=>!t.startsWith(".")&&t.endsWith(r),Ln=r=>t=>t.endsWith(r),An=r=>(r=r.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(r)),Bn=r=>(r=r.toLowerCase(),t=>t.toLowerCase().endsWith(r)),In=/^\*+\.\*+$/,jn=r=>!r.startsWith(".")&&r.includes("."),_n=r=>r!=="."&&r!==".."&&r.includes("."),$n=/^\.\*+$/,Wn=r=>r!=="."&&r!==".."&&r.startsWith("."),Un=/^\*+$/,zn=r=>r.length!==0&&!r.startsWith("."),qn=r=>r.length!==0&&r!=="."&&r!=="..",Gn=/^\?+([^+@!?\*\[\(]*)?$/,Hn=([r,t=""])=>{let e=wr([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Qn=([r,t=""])=>{let e=yr([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Kn=([r,t=""])=>{let e=yr([r]);return t?s=>e(s)&&s.endsWith(t):e},Vn=([r,t=""])=>{let e=wr([r]);return t?s=>e(s)&&s.endsWith(t):e},wr=([r])=>{let t=r.length;return e=>e.length===t&&!e.startsWith(".")},yr=([r])=>{let t=r.length;return e=>e.length===t&&e!=="."&&e!==".."},br=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",dr={win32:{sep:"\\"},posix:{sep:"/"}},Jn=br==="win32"?dr.win32.sep:dr.posix.sep;H.sep=Jn;U=Symbol("globstar **");H.GLOBSTAR=U;Yn="[^/]",Zn=Yn+"*?",Xn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ta="(?:(?!(?:\\/|^)\\.).)*?",ea=(r,t={})=>e=>H(e,r,t);H.filter=ea;tt=(r,t={})=>Object.assign({},r,t),sa=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return H;let t=H;return Object.assign((s,i,o={})=>t(s,i,tt(r,o)),{Minimatch:class extends t.Minimatch{constructor(i,o={}){super(i,tt(r,o))}static defaults(i){return t.defaults(tt(r,i)).Minimatch}},AST:class extends t.AST{constructor(i,o,n={}){super(i,o,tt(r,n))}static fromGlob(i,o={}){return t.AST.fromGlob(i,tt(r,o))}},unescape:(s,i={})=>t.unescape(s,tt(r,i)),escape:(s,i={})=>t.escape(s,tt(r,i)),filter:(s,i={})=>t.filter(s,tt(r,i)),defaults:s=>t.defaults(tt(r,s)),makeRe:(s,i={})=>t.makeRe(s,tt(r,i)),braceExpand:(s,i={})=>t.braceExpand(s,tt(r,i)),match:(s,i,o={})=>t.match(s,i,tt(r,o)),sep:t.sep,GLOBSTAR:U})};H.defaults=sa;kr=(r,t={})=>(be(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,gr.default)(r));H.braceExpand=kr;ia=(r,t={})=>new J(r,t).makeRe();H.makeRe=ia;ra=(r,t,e={})=>{let s=new J(t,e);return r=r.filter(i=>s.match(i)),s.options.nonull&&!r.length&&r.push(t),r};H.match=ra;mr=/[?*]|[+@!]\(.*?\)|\[|\]/,oa=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),J=class{constructor(t,e={}){f(this,"options");f(this,"set");f(this,"pattern");f(this,"windowsPathsNoEscape");f(this,"nonegate");f(this,"negate");f(this,"comment");f(this,"empty");f(this,"preserveMultipleSlashes");f(this,"partial");f(this,"globSet");f(this,"globParts");f(this,"nocase");f(this,"isWindows");f(this,"platform");f(this,"windowsNoMagicRoot");f(this,"regexp");be(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||br,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...o)=>console.error(...o)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(o=>this.slashSplit(o));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map((o,n,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=o[0]===""&&o[1]===""&&(o[2]==="?"||!mr.test(o[2]))&&!mr.test(o[3]),c=/^[a-z]:/i.test(o[0]);if(l)return[...o.slice(0,4),...o.slice(4).map(u=>this.parse(u))];if(c)return[o[0],...o.slice(1).map(u=>this.parse(u))]}return o.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(o=>o.indexOf(!1)===-1),this.isWindows)for(let o=0;o<this.set.length;o++){let n=this.set[o];n[0]===""&&n[1]===""&&this.globParts[o][2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])&&(n[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let i=0;i<t[s].length;i++)t[s][i]==="**"&&(t[s][i]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,i)=>{let o=s[s.length-1];return i==="**"&&o==="**"?s:i===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(s.pop(),s):(s.push(i),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let o=t[i];i===1&&o===""&&t[0]===""||(o==="."||o==="")&&(e=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let i=t[s-1];i&&i!=="."&&i!==".."&&i!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let i=-1;for(;(i=s.indexOf("**",i+1))!==-1;){let n=i;for(;s[n+1]==="**";)n++;n>i&&s.splice(i+1,n-i);let h=s[i+1],l=s[i+2],c=s[i+3];if(h!==".."||!l||l==="."||l===".."||!c||c==="."||c==="..")continue;e=!0,s.splice(i,1);let u=s.slice(0);u[i]="**",t.push(u),i--}if(!this.preserveMultipleSlashes){for(let n=1;n<s.length-1;n++){let h=s[n];n===1&&h===""&&s[0]===""||(h==="."||h==="")&&(e=!0,s.splice(n,1),n--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let o=0;for(;(o=s.indexOf("..",o+1))!==-1;){let n=s[o-1];if(n&&n!=="."&&n!==".."&&n!=="**"){e=!0;let l=o===1&&s[o+1]==="**"?["."]:[];s.splice(o-1,2,...l),s.length===0&&s.push(""),o-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let i=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(i){t[e]=[],t[s]=i;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let i=0,o=0,n=[],h="";for(;i<t.length&&o<e.length;)if(t[i]===e[o])n.push(h==="b"?e[o]:t[i]),i++,o++;else if(s&&t[i]==="**"&&e[o]===t[i+1])n.push(t[i]),i++;else if(s&&e[o]==="**"&&t[i]===e[o+1])n.push(e[o]),o++;else if(t[i]==="*"&&e[o]&&(this.options.dot||!e[o].startsWith("."))&&e[o]!=="**"){if(h==="b")return!1;h="a",n.push(t[i]),i++,o++}else if(e[o]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(h==="a")return!1;h="b",n.push(e[o]),i++,o++}else return!1;return t.length===e.length&&n}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let i=this.options;if(this.isWindows){let g=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),x=!g&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),C=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),T=!C&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),O=x?3:g?0:void 0,L=T?3:C?0:void 0;if(typeof O=="number"&&typeof L=="number"){let[V,X]=[t[O],e[L]];V.toLowerCase()===X.toLowerCase()&&(e[L]=V,L>O?e=e.slice(L):O>L&&(t=t.slice(O)))}}let{optimizationLevel:o=1}=this.options;o>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var n=0,h=0,l=t.length,c=e.length;n<l&&h<c;n++,h++){this.debug("matchOne loop");var u=e[h],m=t[n];if(this.debug(e,u,m),u===!1)return!1;if(u===U){this.debug("GLOBSTAR",[e,u,m]);var d=n,y=h+1;if(y===c){for(this.debug("** at the end");n<l;n++)if(t[n]==="."||t[n]===".."||!i.dot&&t[n].charAt(0)===".")return!1;return!0}for(;d<l;){var R=t[d];if(this.debug(`
2
+ globstar while`,t,d,e,y,R),this.matchOne(t.slice(d),e.slice(y),s))return this.debug("globstar found match!",d,l,R),!0;if(R==="."||R===".."||!i.dot&&R.charAt(0)==="."){this.debug("dot detected!",t,d,e,y);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(s&&(this.debug(`
3
+ >>> no match, partial?`,t,d,e,y),d===l))}let g;if(typeof u=="string"?(g=m===u,this.debug("string match",u,m,g)):(g=u.test(m),this.debug("pattern match",u,m,g)),!g)return!1}if(n===l&&h===c)return!0;if(n===l)return s;if(h===c)return n===l-1&&t[n]==="";throw new Error("wtf?")}braceExpand(){return kr(this.pattern,this.options)}parse(t){be(t);let e=this.options;if(t==="**")return U;if(t==="")return"";let s,i=null;(s=t.match(Un))?i=e.dot?qn:zn:(s=t.match(Fn))?i=(e.nocase?e.dot?Bn:An:e.dot?Ln:Nn)(s[1]):(s=t.match(Gn))?i=(e.nocase?e.dot?Qn:Hn:e.dot?Kn:Vn)(s):(s=t.match(In))?i=e.dot?_n:jn:(s=t.match($n))&&(i=Wn);let o=Zt.fromGlob(t,this.options).toMMPattern();return i&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:i}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?Zn:e.dot?Xn:ta,i=new Set(e.nocase?["i"]:[]),o=t.map(l=>{let c=l.map(u=>{if(u instanceof RegExp)for(let m of u.flags.split(""))i.add(m);return typeof u=="string"?oa(u):u===U?U:u._src});return c.forEach((u,m)=>{let d=c[m+1],y=c[m-1];u!==U||y===U||(y===void 0?d!==void 0&&d!==U?c[m+1]="(?:\\/|"+s+"\\/)?"+d:c[m]=s:d===void 0?c[m-1]=y+"(?:\\/|"+s+")?":d!==U&&(c[m-1]=y+"(?:\\/|\\/"+s+"\\/)"+d,c[m+1]=U))}),c.filter(u=>u!==U).join("/")}).join("|"),[n,h]=t.length>1?["(?:",")"]:["",""];o="^"+n+o+h+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...i].join(""))}catch(l){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let o=this.set;this.debug(this.pattern,"set",o);let n=i[i.length-1];if(!n)for(let h=i.length-2;!n&&h>=0;h--)n=i[h];for(let h=0;h<o.length;h++){let l=o[h],c=i;if(s.matchBase&&l.length===1&&(c=[n]),this.matchOne(c,l,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return H.defaults(t).Minimatch}};H.AST=Zt;H.Minimatch=J;H.escape=Xt;H.unescape=rt});var ys,Zs,qr,Sr,na,aa,ha,yt,bt,Dt,us,Ce,ps,Cr,ds,xr,ot,te,j,xe,ee,_,Q,$,Hs,ms,z,M,Qs,Ks,Er,Vs,ft,Js,gs,Ee,zt,Y,ve,la,ca,fa,ua,ws,Ys,pa,da,vr,Rr,Tr,Or,Pr,Dr,Mr,Fr,Nr,Lr,Ar,Br,Ir,jr,_r,$r,Wr,Ur,zr,Mt,Xs=E(()=>{"use strict";ys=require("events"),Zs=we(require("stream"),1),qr=require("string_decoder"),Sr=typeof process=="object"&&process?process:{stdout:null,stderr:null},na=r=>!!r&&typeof r=="object"&&(r instanceof Mt||r instanceof Zs.default||aa(r)||ha(r)),aa=r=>!!r&&typeof r=="object"&&r instanceof ys.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==Zs.default.Writable.prototype.pipe,ha=r=>!!r&&typeof r=="object"&&r instanceof ys.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function",yt=Symbol("EOF"),bt=Symbol("maybeEmitEnd"),Dt=Symbol("emittedEnd"),us=Symbol("emittingEnd"),Ce=Symbol("emittedError"),ps=Symbol("closed"),Cr=Symbol("read"),ds=Symbol("flush"),xr=Symbol("flushChunk"),ot=Symbol("encoding"),te=Symbol("decoder"),j=Symbol("flowing"),xe=Symbol("paused"),ee=Symbol("resume"),_=Symbol("buffer"),Q=Symbol("pipes"),$=Symbol("bufferLength"),Hs=Symbol("bufferPush"),ms=Symbol("bufferShift"),z=Symbol("objectMode"),M=Symbol("destroyed"),Qs=Symbol("error"),Ks=Symbol("emitData"),Er=Symbol("emitEnd"),Vs=Symbol("emitEnd2"),ft=Symbol("async"),Js=Symbol("abort"),gs=Symbol("aborted"),Ee=Symbol("signal"),zt=Symbol("dataListeners"),Y=Symbol("discarded"),ve=r=>Promise.resolve().then(r),la=r=>r(),ca=r=>r==="end"||r==="finish"||r==="prefinish",fa=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,ua=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),ws=class{constructor(t,e,s){f(this,"src");f(this,"dest");f(this,"opts");f(this,"ondrain");this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[ee](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ys=class extends ws{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=i=>e.emit("error",i),t.on("error",this.proxyErrors)}},pa=r=>!!r.objectMode,da=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",Mt=class extends ys.EventEmitter{constructor(...e){let s=e[0]||{};super();f(this,zr,!1);f(this,Ur,!1);f(this,Wr,[]);f(this,$r,[]);f(this,_r);f(this,jr);f(this,Ir);f(this,Br);f(this,Ar,!1);f(this,Lr,!1);f(this,Nr,!1);f(this,Fr,!1);f(this,Mr,null);f(this,Dr,0);f(this,Pr,!1);f(this,Or);f(this,Tr,!1);f(this,Rr,0);f(this,vr,!1);f(this,"writable",!0);f(this,"readable",!0);if(s.objectMode&&typeof s.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");pa(s)?(this[z]=!0,this[ot]=null):da(s)?(this[ot]=s.encoding,this[z]=!1):(this[z]=!1,this[ot]=null),this[ft]=!!s.async,this[te]=this[ot]?new qr.StringDecoder(this[ot]):null,s&&s.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[_]}),s&&s.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Q]});let{signal:i}=s;i&&(this[Ee]=i,i.aborted?this[Js]():i.addEventListener("abort",()=>this[Js]()))}get bufferLength(){return this[$]}get encoding(){return this[ot]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[z]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ft]}set async(e){this[ft]=this[ft]||!!e}[(zr=j,Ur=xe,Wr=Q,$r=_,_r=z,jr=ot,Ir=ft,Br=te,Ar=yt,Lr=Dt,Nr=us,Fr=ps,Mr=Ce,Dr=$,Pr=M,Or=Ee,Tr=gs,Rr=zt,vr=Y,Js)](){var e,s;this[gs]=!0,this.emit("abort",(e=this[Ee])==null?void 0:e.reason),this.destroy((s=this[Ee])==null?void 0:s.reason)}get aborted(){return this[gs]}set aborted(e){}write(e,s,i){var n;if(this[gs])return!1;if(this[yt])throw new Error("write after end");if(this[M])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof s=="function"&&(i=s,s="utf8"),s||(s="utf8");let o=this[ft]?ve:la;if(!this[z]&&!Buffer.isBuffer(e)){if(ua(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(fa(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[z]?(this[j]&&this[$]!==0&&this[ds](!0),this[j]?this.emit("data",e):this[Hs](e),this[$]!==0&&this.emit("readable"),i&&o(i),this[j]):e.length?(typeof e=="string"&&!(s===this[ot]&&!((n=this[te])!=null&&n.lastNeed))&&(e=Buffer.from(e,s)),Buffer.isBuffer(e)&&this[ot]&&(e=this[te].write(e)),this[j]&&this[$]!==0&&this[ds](!0),this[j]?this.emit("data",e):this[Hs](e),this[$]!==0&&this.emit("readable"),i&&o(i),this[j]):(this[$]!==0&&this.emit("readable"),i&&o(i),this[j])}read(e){if(this[M])return null;if(this[Y]=!1,this[$]===0||e===0||e&&e>this[$])return this[bt](),null;this[z]&&(e=null),this[_].length>1&&!this[z]&&(this[_]=[this[ot]?this[_].join(""):Buffer.concat(this[_],this[$])]);let s=this[Cr](e||null,this[_][0]);return this[bt](),s}[Cr](e,s){if(this[z])this[ms]();else{let i=s;e===i.length||e===null?this[ms]():typeof i=="string"?(this[_][0]=i.slice(e),s=i.slice(0,e),this[$]-=e):(this[_][0]=i.subarray(e),s=i.subarray(0,e),this[$]-=e)}return this.emit("data",s),!this[_].length&&!this[yt]&&this.emit("drain"),s}end(e,s,i){return typeof e=="function"&&(i=e,e=void 0),typeof s=="function"&&(i=s,s="utf8"),e!==void 0&&this.write(e,s),i&&this.once("end",i),this[yt]=!0,this.writable=!1,(this[j]||!this[xe])&&this[bt](),this}[ee](){this[M]||(!this[zt]&&!this[Q].length&&(this[Y]=!0),this[xe]=!1,this[j]=!0,this.emit("resume"),this[_].length?this[ds]():this[yt]?this[bt]():this.emit("drain"))}resume(){return this[ee]()}pause(){this[j]=!1,this[xe]=!0,this[Y]=!1}get destroyed(){return this[M]}get flowing(){return this[j]}get paused(){return this[xe]}[Hs](e){this[z]?this[$]+=1:this[$]+=e.length,this[_].push(e)}[ms](){return this[z]?this[$]-=1:this[$]-=this[_][0].length,this[_].shift()}[ds](e=!1){do;while(this[xr](this[ms]())&&this[_].length);!e&&!this[_].length&&!this[yt]&&this.emit("drain")}[xr](e){return this.emit("data",e),this[j]}pipe(e,s){if(this[M])return e;this[Y]=!1;let i=this[Dt];return s=s||{},e===Sr.stdout||e===Sr.stderr?s.end=!1:s.end=s.end!==!1,s.proxyErrors=!!s.proxyErrors,i?s.end&&e.end():(this[Q].push(s.proxyErrors?new Ys(this,e,s):new ws(this,e,s)),this[ft]?ve(()=>this[ee]()):this[ee]()),e}unpipe(e){let s=this[Q].find(i=>i.dest===e);s&&(this[Q].length===1?(this[j]&&this[zt]===0&&(this[j]=!1),this[Q]=[]):this[Q].splice(this[Q].indexOf(s),1),s.unpipe())}addListener(e,s){return this.on(e,s)}on(e,s){let i=super.on(e,s);if(e==="data")this[Y]=!1,this[zt]++,!this[Q].length&&!this[j]&&this[ee]();else if(e==="readable"&&this[$]!==0)super.emit("readable");else if(ca(e)&&this[Dt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Ce]){let o=s;this[ft]?ve(()=>o.call(this,this[Ce])):o.call(this,this[Ce])}return i}removeListener(e,s){return this.off(e,s)}off(e,s){let i=super.off(e,s);return e==="data"&&(this[zt]=this.listeners("data").length,this[zt]===0&&!this[Y]&&!this[Q].length&&(this[j]=!1)),i}removeAllListeners(e){let s=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[zt]=0,!this[Y]&&!this[Q].length&&(this[j]=!1)),s}get emittedEnd(){return this[Dt]}[bt](){!this[us]&&!this[Dt]&&!this[M]&&this[_].length===0&&this[yt]&&(this[us]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[ps]&&this.emit("close"),this[us]=!1)}emit(e,...s){let i=s[0];if(e!=="error"&&e!=="close"&&e!==M&&this[M])return!1;if(e==="data")return!this[z]&&!i?!1:this[ft]?(ve(()=>this[Ks](i)),!0):this[Ks](i);if(e==="end")return this[Er]();if(e==="close"){if(this[ps]=!0,!this[Dt]&&!this[M])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Ce]=i,super.emit(Qs,i);let n=!this[Ee]||this.listeners("error").length?super.emit("error",i):!1;return this[bt](),n}else if(e==="resume"){let n=super.emit("resume");return this[bt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let o=super.emit(e,...s);return this[bt](),o}[Ks](e){for(let i of this[Q])i.dest.write(e)===!1&&this.pause();let s=this[Y]?!1:super.emit("data",e);return this[bt](),s}[Er](){return this[Dt]?!1:(this[Dt]=!0,this.readable=!1,this[ft]?(ve(()=>this[Vs]()),!0):this[Vs]())}[Vs](){if(this[te]){let s=this[te].end();if(s){for(let i of this[Q])i.dest.write(s);this[Y]||super.emit("data",s)}}for(let s of this[Q])s.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[z]||(e.dataLength=0);let s=this.promise();return this.on("data",i=>{e.push(i),this[z]||(e.dataLength+=i.length)}),await s,e}async concat(){if(this[z])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[ot]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,s)=>{this.on(M,()=>s(new Error("stream destroyed"))),this.on("error",i=>s(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Y]=!1;let e=!1,s=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return s();let o=this.read();if(o!==null)return Promise.resolve({done:!1,value:o});if(this[yt])return s();let n,h,l=d=>{this.off("data",c),this.off("end",u),this.off(M,m),s(),h(d)},c=d=>{this.off("error",l),this.off("end",u),this.off(M,m),this.pause(),n({value:d,done:!!this[yt]})},u=()=>{this.off("error",l),this.off("data",c),this.off(M,m),s(),n({done:!0,value:void 0})},m=()=>l(new Error("stream destroyed"));return new Promise((d,y)=>{h=y,n=d,this.once(M,m),this.once("error",l),this.once("end",u),this.once("data",c)})},throw:s,return:s,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Y]=!1;let e=!1,s=()=>(this.pause(),this.off(Qs,s),this.off(M,s),this.off("end",s),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return s();let o=this.read();return o===null?s():{done:!1,value:o}};return this.once("end",s),this.once(Qs,s),this.once(M,s),{next:i,throw:s,return:s,[Symbol.iterator](){return this}}}destroy(e){if(this[M])return e?this.emit("error",e):this.emit(M),this;this[M]=!0,this[Y]=!0,this[_].length=0,this[$]=0;let s=this;return typeof s.close=="function"&&!this[ps]&&s.close(),e?this.emit("error",e):this.emit(M),this}static get isStream(){return na}}});var li,ne,Vr,mt,ma,Nt,ga,Te,Jr,Yr,wa,ya,st,Zr,Xr,ut,to,eo,qt,so,et,Re,ti,Gr,Oe,nt,bs,Ss,Hr,ba,ei,Qr,Pe,Kr,ks,vs,si,io,K,Ne,Le,Ae,Be,Ie,je,_e,$e,We,Ue,ze,qe,Ge,He,Qe,Ke,Ve,Je,Ft,Gt,pt,kt,St,Ct,S,Ht,xt,dt,k,ii,Cs,De,ri,oi,Me,xs,ni,ai,Es,ro,oo,no,hi,se,ie,ao,Qt,q,Rs,Ts,re,oe,Ye,Ze,Os,ae,he,Fe,qh,ho,lo=E(()=>{"use strict";li=require("lru-cache"),ne=require("path"),Vr=require("url"),mt=require("fs"),ma=we(require("fs"),1),Nt=require("fs/promises");Xs();ga=mt.realpathSync.native,Te={lstatSync:mt.lstatSync,readdir:mt.readdir,readdirSync:mt.readdirSync,readlinkSync:mt.readlinkSync,realpathSync:ga,promises:{lstat:Nt.lstat,readdir:Nt.readdir,readlink:Nt.readlink,realpath:Nt.realpath}},Jr=r=>!r||r===Te||r===ma?Te:{...Te,...r,promises:{...Te.promises,...r.promises||{}}},Yr=/^\\\\\?\\([a-z]:)\\?$/i,wa=r=>r.replace(/\//g,"\\").replace(Yr,"$1\\"),ya=/[\\\/]/,st=0,Zr=1,Xr=2,ut=4,to=6,eo=8,qt=10,so=12,et=15,Re=~et,ti=16,Gr=32,Oe=64,nt=128,bs=256,Ss=512,Hr=Oe|nt|Ss,ba=1023,ei=r=>r.isFile()?eo:r.isDirectory()?ut:r.isSymbolicLink()?qt:r.isCharacterDevice()?Xr:r.isBlockDevice()?to:r.isSocket()?so:r.isFIFO()?Zr:st,Qr=new Map,Pe=r=>{let t=Qr.get(r);if(t)return t;let e=r.normalize("NFKD");return Qr.set(r,e),e},Kr=new Map,ks=r=>{let t=Kr.get(r);if(t)return t;let e=Pe(r.toLowerCase());return Kr.set(r,e),e},vs=class extends li.LRUCache{constructor(){super({max:256})}},si=class extends li.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},io=Symbol("PathScurry setAsCwd"),q=class{constructor(t,e=st,s,i,o,n,h){w(this,k);f(this,"name");f(this,"root");f(this,"roots");f(this,"parent");f(this,"nocase");f(this,"isCWD",!1);w(this,K);w(this,Ne);w(this,Le);w(this,Ae);w(this,Be);w(this,Ie);w(this,je);w(this,_e);w(this,$e);w(this,We);w(this,Ue);w(this,ze);w(this,qe);w(this,Ge);w(this,He);w(this,Qe);w(this,Ke);w(this,Ve);w(this,Je);w(this,Ft);w(this,Gt);w(this,pt);w(this,kt);w(this,St);w(this,Ct);w(this,S);w(this,Ht);w(this,xt);w(this,dt);w(this,se,[]);w(this,ie,!1);w(this,Qt);this.name=t,p(this,Ft,o?ks(t):Pe(t)),p(this,S,e&ba),this.nocase=o,this.roots=i,this.root=s||this,p(this,Ht,n),p(this,pt,h.fullpath),p(this,St,h.relative),p(this,Ct,h.relativePosix),this.parent=h.parent,this.parent?p(this,K,a(this.parent,K)):p(this,K,Jr(h.fs))}get dev(){return a(this,Ne)}get mode(){return a(this,Le)}get nlink(){return a(this,Ae)}get uid(){return a(this,Be)}get gid(){return a(this,Ie)}get rdev(){return a(this,je)}get blksize(){return a(this,_e)}get ino(){return a(this,$e)}get size(){return a(this,We)}get blocks(){return a(this,Ue)}get atimeMs(){return a(this,ze)}get mtimeMs(){return a(this,qe)}get ctimeMs(){return a(this,Ge)}get birthtimeMs(){return a(this,He)}get atime(){return a(this,Qe)}get mtime(){return a(this,Ke)}get ctime(){return a(this,Ve)}get birthtime(){return a(this,Je)}get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return a(this,Gt)!==void 0?a(this,Gt):this.parent?p(this,Gt,this.parent.depth()+1):p(this,Gt,0)}childrenCache(){return a(this,Ht)}resolve(t){var n;if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?b(n=this.getRoot(e),k,ii).call(n,i):b(this,k,ii).call(this,i)}children(){let t=a(this,Ht).get(this);if(t)return t;let e=Object.assign([],{provisional:0});return a(this,Ht).set(this,e),p(this,S,a(this,S)&~ti),e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),i=this.nocase?ks(t):Pe(t);for(let l of s)if(a(l,Ft)===i)return l;let o=this.parent?this.sep:"",n=a(this,pt)?a(this,pt)+o+t:void 0,h=this.newChild(t,st,{...e,parent:this,fullpath:n});return this.canReaddir()||p(h,S,a(h,S)|nt),s.push(h),h}relative(){if(this.isCWD)return"";if(a(this,St)!==void 0)return a(this,St);let t=this.name,e=this.parent;if(!e)return p(this,St,this.name);let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(a(this,Ct)!==void 0)return a(this,Ct);let t=this.name,e=this.parent;if(!e)return p(this,Ct,this.fullpathPosix());let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(a(this,pt)!==void 0)return a(this,pt);let t=this.name,e=this.parent;if(!e)return p(this,pt,this.name);let i=e.fullpath()+(e.parent?this.sep:"")+t;return p(this,pt,i)}fullpathPosix(){if(a(this,kt)!==void 0)return a(this,kt);if(this.sep==="/")return p(this,kt,this.fullpath());if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?p(this,kt,`//?/${i}`):p(this,kt,i)}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return p(this,kt,s)}isUnknown(){return(a(this,S)&et)===st}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(a(this,S)&et)===eo}isDirectory(){return(a(this,S)&et)===ut}isCharacterDevice(){return(a(this,S)&et)===Xr}isBlockDevice(){return(a(this,S)&et)===to}isFIFO(){return(a(this,S)&et)===Zr}isSocket(){return(a(this,S)&et)===so}isSymbolicLink(){return(a(this,S)&qt)===qt}lstatCached(){return a(this,S)&Gr?this:void 0}readlinkCached(){return a(this,xt)}realpathCached(){return a(this,dt)}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(a(this,xt))return!0;if(!this.parent)return!1;let t=a(this,S)&et;return!(t!==st&&t!==qt||a(this,S)&bs||a(this,S)&nt)}calledReaddir(){return!!(a(this,S)&ti)}isENOENT(){return!!(a(this,S)&nt)}isNamed(t){return this.nocase?a(this,Ft)===ks(t):a(this,Ft)===Pe(t)}async readlink(){var e;let t=a(this,xt);if(t)return t;if(this.canReadlink()&&this.parent)try{let s=await a(this,K).promises.readlink(this.fullpath()),i=(e=await this.parent.realpath())==null?void 0:e.resolve(s);if(i)return p(this,xt,i)}catch(s){b(this,k,ai).call(this,s.code);return}}readlinkSync(){var e;let t=a(this,xt);if(t)return t;if(this.canReadlink()&&this.parent)try{let s=a(this,K).readlinkSync(this.fullpath()),i=(e=this.parent.realpathSync())==null?void 0:e.resolve(s);if(i)return p(this,xt,i)}catch(s){b(this,k,ai).call(this,s.code);return}}async lstat(){if(!(a(this,S)&nt))try{return b(this,k,hi).call(this,await a(this,K).promises.lstat(this.fullpath())),this}catch(t){b(this,k,ni).call(this,t.code)}}lstatSync(){if(!(a(this,S)&nt))try{return b(this,k,hi).call(this,a(this,K).lstatSync(this.fullpath())),this}catch(t){b(this,k,ni).call(this,t.code)}}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let o=s.slice(0,s.provisional);e?t(null,o):queueMicrotask(()=>t(null,o));return}if(a(this,se).push(t),a(this,ie))return;p(this,ie,!0);let i=this.fullpath();a(this,K).readdir(i,{withFileTypes:!0},(o,n)=>{if(o)b(this,k,xs).call(this,o.code),s.provisional=0;else{for(let h of n)b(this,k,Es).call(this,h,s);b(this,k,Cs).call(this,s)}b(this,k,ao).call(this,s.slice(0,s.provisional))})}async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(a(this,Qt))await a(this,Qt);else{let s=()=>{};p(this,Qt,new Promise(i=>s=i));try{for(let i of await a(this,K).promises.readdir(e,{withFileTypes:!0}))b(this,k,Es).call(this,i,t);b(this,k,Cs).call(this,t)}catch(i){b(this,k,xs).call(this,i.code),t.provisional=0}p(this,Qt,void 0),s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of a(this,K).readdirSync(e,{withFileTypes:!0}))b(this,k,Es).call(this,s,t);b(this,k,Cs).call(this,t)}catch(s){b(this,k,xs).call(this,s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(a(this,S)&Hr)return!1;let t=et&a(this,S);return t===st||t===ut||t===qt}shouldWalk(t,e){return(a(this,S)&ut)===ut&&!(a(this,S)&Hr)&&!t.has(this)&&(!e||e(this))}async realpath(){if(a(this,dt))return a(this,dt);if(!((Ss|bs|nt)&a(this,S)))try{let t=await a(this,K).promises.realpath(this.fullpath());return p(this,dt,this.resolve(t))}catch(t){b(this,k,oi).call(this)}}realpathSync(){if(a(this,dt))return a(this,dt);if(!((Ss|bs|nt)&a(this,S)))try{let t=a(this,K).realpathSync(this.fullpath());return p(this,dt,this.resolve(t))}catch(t){b(this,k,oi).call(this)}}[io](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),p(i,St,s.join(this.sep)),p(i,Ct,s.join("/")),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)p(i,St,void 0),p(i,Ct,void 0),i=i.parent}};K=new WeakMap,Ne=new WeakMap,Le=new WeakMap,Ae=new WeakMap,Be=new WeakMap,Ie=new WeakMap,je=new WeakMap,_e=new WeakMap,$e=new WeakMap,We=new WeakMap,Ue=new WeakMap,ze=new WeakMap,qe=new WeakMap,Ge=new WeakMap,He=new WeakMap,Qe=new WeakMap,Ke=new WeakMap,Ve=new WeakMap,Je=new WeakMap,Ft=new WeakMap,Gt=new WeakMap,pt=new WeakMap,kt=new WeakMap,St=new WeakMap,Ct=new WeakMap,S=new WeakMap,Ht=new WeakMap,xt=new WeakMap,dt=new WeakMap,k=new WeakSet,ii=function(t){let e=this;for(let s of t)e=e.child(s);return e},Cs=function(t){var e;p(this,S,a(this,S)|ti);for(let s=t.provisional;s<t.length;s++){let i=t[s];i&&b(e=i,k,De).call(e)}},De=function(){a(this,S)&nt||(p(this,S,(a(this,S)|nt)&Re),b(this,k,ri).call(this))},ri=function(){var e;let t=this.children();t.provisional=0;for(let s of t)b(e=s,k,De).call(e)},oi=function(){p(this,S,a(this,S)|Ss),b(this,k,Me).call(this)},Me=function(){if(a(this,S)&Oe)return;let t=a(this,S);(t&et)===ut&&(t&=Re),p(this,S,t|Oe),b(this,k,ri).call(this)},xs=function(t=""){t==="ENOTDIR"||t==="EPERM"?b(this,k,Me).call(this):t==="ENOENT"?b(this,k,De).call(this):this.children().provisional=0},ni=function(t=""){var e;if(t==="ENOTDIR"){let s=this.parent;b(e=s,k,Me).call(e)}else t==="ENOENT"&&b(this,k,De).call(this)},ai=function(t=""){var s;let e=a(this,S);e|=bs,t==="ENOENT"&&(e|=nt),(t==="EINVAL"||t==="UNKNOWN")&&(e&=Re),p(this,S,e),t==="ENOTDIR"&&this.parent&&b(s=this.parent,k,Me).call(s)},Es=function(t,e){return b(this,k,oo).call(this,t,e)||b(this,k,ro).call(this,t,e)},ro=function(t,e){let s=ei(t),i=this.newChild(t.name,s,{parent:this}),o=a(i,S)&et;return o!==ut&&o!==qt&&o!==st&&p(i,S,a(i,S)|Oe),e.unshift(i),e.provisional++,i},oo=function(t,e){for(let s=e.provisional;s<e.length;s++){let i=e[s];if((this.nocase?ks(t.name):Pe(t.name))===a(i,Ft))return b(this,k,no).call(this,t,i,s,e)}},no=function(t,e,s,i){let o=e.name;return p(e,S,a(e,S)&Re|ei(t)),o!==t.name&&(e.name=t.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e},hi=function(t){let{atime:e,atimeMs:s,birthtime:i,birthtimeMs:o,blksize:n,blocks:h,ctime:l,ctimeMs:c,dev:u,gid:m,ino:d,mode:y,mtime:R,mtimeMs:g,nlink:x,rdev:C,size:T,uid:O}=t;p(this,Qe,e),p(this,ze,s),p(this,Je,i),p(this,He,o),p(this,_e,n),p(this,Ue,h),p(this,Ve,l),p(this,Ge,c),p(this,Ne,u),p(this,Ie,m),p(this,$e,d),p(this,Le,y),p(this,Ke,R),p(this,qe,g),p(this,Ae,x),p(this,je,C),p(this,We,T),p(this,Be,O);let L=ei(t);p(this,S,a(this,S)&Re|L|Gr),L!==st&&L!==ut&&L!==qt&&p(this,S,a(this,S)|Oe)},se=new WeakMap,ie=new WeakMap,ao=function(t){p(this,ie,!1);let e=a(this,se).slice();a(this,se).length=0,e.forEach(s=>s(null,t))},Qt=new WeakMap;Rs=class r extends q{constructor(e,s=st,i,o,n,h,l){super(e,s,i,o,n,h,l);f(this,"sep","\\");f(this,"splitSep",ya)}newChild(e,s=st,i={}){return new r(e,s,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return ne.win32.parse(e).root}getRoot(e){if(e=wa(e.toUpperCase()),e===this.root.name)return this.root;for(let[s,i]of Object.entries(this.roots))if(this.sameRoot(e,s))return this.roots[e]=i;return this.roots[e]=new ae(e,this).root}sameRoot(e,s=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Yr,"$1\\"),e===s}},Ts=class r extends q{constructor(e,s=st,i,o,n,h,l){super(e,s,i,o,n,h,l);f(this,"splitSep","/");f(this,"sep","/")}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,s=st,i={}){return new r(e,s,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Os=class{constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:o=16*1024,fs:n=Te}={}){f(this,"root");f(this,"rootPath");f(this,"roots");f(this,"cwd");w(this,re);w(this,oe);w(this,Ye);f(this,"nocase");w(this,Ze);p(this,Ze,Jr(n)),(t instanceof URL||t.startsWith("file://"))&&(t=(0,Vr.fileURLToPath)(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),p(this,re,new vs),p(this,oe,new vs),p(this,Ye,new si(o));let l=h.substring(this.rootPath.length).split(s);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(a(this,Ze)),this.roots[this.rootPath]=this.root;let c=this.root,u=l.length-1,m=e.sep,d=this.rootPath,y=!1;for(let R of l){let g=u--;c=c.child(R,{relative:new Array(g).fill("..").join(m),relativePosix:new Array(g).fill("..").join("/"),fullpath:d+=(y?"":m)+R}),y=!0}this.cwd=c}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return a(this,Ye)}resolve(...t){let e="";for(let o=t.length-1;o>=0;o--){let n=t[o];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let s=a(this,re).get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return a(this,re).set(e,i),i}resolvePosix(...t){let e="";for(let o=t.length-1;o>=0;o--){let n=t[o];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let s=a(this,oe).get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return a(this,oe).set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let i=await t.readdir();return s?i:i.map(o=>o.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s==null?void 0:s.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s==null?void 0:s.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s==null?void 0:s.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s==null?void 0:s.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:o,walkFilter:n}=e,h=[];(!o||o(t))&&h.push(s?t:t.fullpath());let l=new Set,c=(m,d)=>{l.add(m),m.readdirCB((y,R)=>{if(y)return d(y);let g=R.length;if(!g)return d();let x=()=>{--g===0&&d()};for(let C of R)(!o||o(C))&&h.push(s?C:C.fullpath()),i&&C.isSymbolicLink()?C.realpath().then(T=>T!=null&&T.isUnknown()?T.lstat():T).then(T=>T!=null&&T.shouldWalk(l,n)?c(T,x):x()):C.shouldWalk(l,n)?c(C,x):x()},!0)},u=t;return new Promise((m,d)=>{c(u,y=>{if(y)return d(y);m(h)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:o,walkFilter:n}=e,h=[];(!o||o(t))&&h.push(s?t:t.fullpath());let l=new Set([t]);for(let c of l){let u=c.readdirSync();for(let m of u){(!o||o(m))&&h.push(s?m:m.fullpath());let d=m;if(m.isSymbolicLink()){if(!(i&&(d=m.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(l,n)&&l.add(d)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:o,walkFilter:n}=e;(!o||o(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let l of h){let c=l.readdirSync();for(let u of c){(!o||o(u))&&(yield s?u:u.fullpath());let m=u;if(u.isSymbolicLink()){if(!(i&&(m=u.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(h,n)&&h.add(m)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:o,walkFilter:n}=e,h=new Mt({objectMode:!0});(!o||o(t))&&h.write(s?t:t.fullpath());let l=new Set,c=[t],u=0,m=()=>{let d=!1;for(;!d;){let y=c.shift();if(!y){u===0&&h.end();return}u++,l.add(y);let R=(x,C,T=!1)=>{if(x)return h.emit("error",x);if(i&&!T){let O=[];for(let L of C)L.isSymbolicLink()&&O.push(L.realpath().then(V=>V!=null&&V.isUnknown()?V.lstat():V));if(O.length){Promise.all(O).then(()=>R(null,C,!0));return}}for(let O of C)O&&(!o||o(O))&&(h.write(s?O:O.fullpath())||(d=!0));u--;for(let O of C){let L=O.realpathCached()||O;L.shouldWalk(l,n)&&c.push(L)}d&&!h.flowing?h.once("drain",m):g||m()},g=!0;y.readdirCB(R,!0),g=!1}};return m(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof q||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:o,walkFilter:n}=e,h=new Mt({objectMode:!0}),l=new Set;(!o||o(t))&&h.write(s?t:t.fullpath());let c=[t],u=0,m=()=>{let d=!1;for(;!d;){let y=c.shift();if(!y){u===0&&h.end();return}u++,l.add(y);let R=y.readdirSync();for(let g of R)(!o||o(g))&&(h.write(s?g:g.fullpath())||(d=!0));u--;for(let g of R){let x=g;if(g.isSymbolicLink()){if(!(i&&(x=g.realpathSync())))continue;x.isUnknown()&&x.lstatSync()}x.shouldWalk(l,n)&&c.push(x)}}d&&!h.flowing&&h.once("drain",m)};return m(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[io](e)}};re=new WeakMap,oe=new WeakMap,Ye=new WeakMap,Ze=new WeakMap;ae=class extends Os{constructor(e=process.cwd(),s={}){let{nocase:i=!0}=s;super(e,ne.win32,"\\",{...s,nocase:i});f(this,"sep","\\");this.nocase=i;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return ne.win32.parse(e).root.toUpperCase()}newRoot(e){return new Rs(this.rootPath,ut,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},he=class extends Os{constructor(e=process.cwd(),s={}){let{nocase:i=!1}=s;super(e,ne.posix,"/",{...s,nocase:i});f(this,"sep","/");this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new Ts(this.rootPath,ut,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Fe=class extends he{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}},qh=process.platform==="win32"?Rs:Ts,ho=process.platform==="win32"?ae:process.platform==="darwin"?Fe:he});var ka,Sa,B,Z,W,Kt,at,Xe,Lt,At,Bt,le,ci,ce,fi=E(()=>{"use strict";Pt();ka=r=>r.length>=1,Sa=r=>r.length>=1,ci=class ci{constructor(t,e,s,i){w(this,B);w(this,Z);w(this,W);f(this,"length");w(this,Kt);w(this,at);w(this,Xe);w(this,Lt);w(this,At);w(this,Bt);w(this,le,!0);if(!ka(t))throw new TypeError("empty pattern list");if(!Sa(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(p(this,B,t),p(this,Z,e),p(this,W,s),p(this,Kt,i),a(this,W)===0){if(this.isUNC()){let[o,n,h,l,...c]=a(this,B),[u,m,d,y,...R]=a(this,Z);c[0]===""&&(c.shift(),R.shift());let g=[o,n,h,l,""].join("/"),x=[u,m,d,y,""].join("/");p(this,B,[g,...c]),p(this,Z,[x,...R]),this.length=a(this,B).length}else if(this.isDrive()||this.isAbsolute()){let[o,...n]=a(this,B),[h,...l]=a(this,Z);n[0]===""&&(n.shift(),l.shift());let c=o+"/",u=h+"/";p(this,B,[c,...n]),p(this,Z,[u,...l]),this.length=a(this,B).length}}}pattern(){return a(this,B)[a(this,W)]}isString(){return typeof a(this,B)[a(this,W)]=="string"}isGlobstar(){return a(this,B)[a(this,W)]===U}isRegExp(){return a(this,B)[a(this,W)]instanceof RegExp}globString(){return p(this,Xe,a(this,Xe)||(a(this,W)===0?this.isAbsolute()?a(this,Z)[0]+a(this,Z).slice(1).join("/"):a(this,Z).join("/"):a(this,Z).slice(a(this,W)).join("/")))}hasMore(){return this.length>a(this,W)+1}rest(){return a(this,at)!==void 0?a(this,at):this.hasMore()?(p(this,at,new ci(a(this,B),a(this,Z),a(this,W)+1,a(this,Kt))),p(a(this,at),Bt,a(this,Bt)),p(a(this,at),At,a(this,At)),p(a(this,at),Lt,a(this,Lt)),a(this,at)):p(this,at,null)}isUNC(){let t=a(this,B);return a(this,At)!==void 0?a(this,At):p(this,At,a(this,Kt)==="win32"&&a(this,W)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=a(this,B);return a(this,Lt)!==void 0?a(this,Lt):p(this,Lt,a(this,Kt)==="win32"&&a(this,W)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=a(this,B);return a(this,Bt)!==void 0?a(this,Bt):p(this,Bt,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=a(this,B)[0];return typeof t=="string"&&this.isAbsolute()&&a(this,W)===0?t:""}checkFollowGlobstar(){return!(a(this,W)===0||!this.isGlobstar()||!a(this,le))}markFollowGlobstar(){return a(this,W)===0||!this.isGlobstar()||!a(this,le)?!1:(p(this,le,!1),!0)}};B=new WeakMap,Z=new WeakMap,W=new WeakMap,Kt=new WeakMap,at=new WeakMap,Xe=new WeakMap,Lt=new WeakMap,At=new WeakMap,Bt=new WeakMap,le=new WeakMap;ce=ci});var Ca,fe,ui=E(()=>{"use strict";Pt();fi();Ca=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",fe=class{constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:o,platform:n=Ca}){f(this,"relative");f(this,"relativeChildren");f(this,"absolute");f(this,"absoluteChildren");f(this,"platform");f(this,"mmopts");this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:o,optimizationLevel:2,platform:n,nocomment:!0,nonegate:!0};for(let h of t)this.add(h)}add(t){let e=new J(t,this.mmopts);for(let s=0;s<e.set.length;s++){let i=e.set[s],o=e.globParts[s];if(!i||!o)throw new Error("invalid pattern object");for(;i[0]==="."&&o[0]===".";)i.shift(),o.shift();let n=new ce(i,o,0,this.platform),h=new J(n.globString(),this.mmopts),l=o[o.length-1]==="**",c=n.isAbsolute();c?this.absolute.push(h):this.relative.push(h),l&&(c?this.absoluteChildren.push(h):this.relativeChildren.push(h))}}ignored(t){let e=t.fullpath(),s=`${e}/`,i=t.relative()||".",o=`${i}/`;for(let n of this.relative)if(n.match(i)||n.match(o))return!0;for(let n of this.absolute)if(n.match(e)||n.match(s))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",s=(t.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}}});var pi,di,mi,ts,co=E(()=>{"use strict";Pt();pi=class r{constructor(t=new Map){f(this,"store");this.store=t}copy(){return new r(new Map(this.store))}hasWalked(t,e){var s;return(s=this.store.get(t.fullpath()))==null?void 0:s.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),i=this.store.get(s);i?i.add(e.globString()):this.store.set(s,new Set([e.globString()]))}},di=class{constructor(){f(this,"store",new Map)}add(t,e,s){let i=(e?2:0)|(s?1:0),o=this.store.get(t);this.store.set(t,o===void 0?i:i&o)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},mi=class{constructor(){f(this,"store",new Map)}add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},ts=class r{constructor(t,e){f(this,"hasWalkedCache");f(this,"matches",new di);f(this,"subwalks",new mi);f(this,"patterns");f(this,"follow");f(this,"dot");f(this,"opts");this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new pi}processPatterns(t,e){this.patterns=e;let s=e.map(i=>[t,i]);for(let[i,o]of s){this.hasWalkedCache.storeWalked(i,o);let n=o.root(),h=o.isAbsolute()&&this.opts.absolute!==!1;if(n){i=i.resolve(n==="/"&&this.opts.root!==void 0?this.opts.root:n);let m=o.rest();if(m)o=m;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,c,u=!1;for(;typeof(l=o.pattern())=="string"&&(c=o.rest());)i=i.resolve(l),o=c,u=!0;if(l=o.pattern(),c=o.rest(),u){if(this.hasWalkedCache.hasWalked(i,o))continue;this.hasWalkedCache.storeWalked(i,o)}if(typeof l=="string"){let m=l===".."||l===""||l===".";this.matches.add(i.resolve(l),h,m);continue}else if(l===U){(!i.isSymbolicLink()||this.follow||o.checkFollowGlobstar())&&this.subwalks.add(i,o);let m=c==null?void 0:c.pattern(),d=c==null?void 0:c.rest();if(!c||(m===""||m===".")&&!d)this.matches.add(i,h,m===""||m===".");else if(m===".."){let y=i.parent||i;d?this.hasWalkedCache.hasWalked(y,d)||this.subwalks.add(y,d):this.matches.add(y,h,!0)}}else l instanceof RegExp&&this.subwalks.add(i,o)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),i=this.child();for(let o of e)for(let n of s){let h=n.isAbsolute(),l=n.pattern(),c=n.rest();l===U?i.testGlobstar(o,n,c,h):l instanceof RegExp?i.testRegExp(o,l,c,h):i.testString(o,l,c,h)}return i}testGlobstar(t,e,s,i){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let o=s.pattern();if(typeof o=="string"&&o!==".."&&o!==""&&o!==".")this.testString(t,o,s.rest(),i);else if(o===".."){let n=t.parent||t;this.subwalks.add(n,s)}else o instanceof RegExp&&this.testRegExp(t,o,s.rest(),i)}}testRegExp(t,e,s,i){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}}});var xa,ue,Et,Jt,it,Vt,gi,Ps,es,ss,fo=E(()=>{"use strict";Xs();ui();co();xa=(r,t)=>typeof r=="string"?new fe([r],t):Array.isArray(r)?new fe(r,t):r,Ps=class{constructor(t,e,s){w(this,it);f(this,"path");f(this,"patterns");f(this,"opts");f(this,"seen",new Set);f(this,"paused",!1);f(this,"aborted",!1);w(this,ue,[]);w(this,Et);w(this,Jt);f(this,"signal");f(this,"maxDepth");f(this,"includeChildMatches");var i;if(this.patterns=t,this.path=e,this.opts=s,p(this,Jt,!s.posix&&s.platform==="win32"?"\\":"/"),this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(p(this,Et,xa((i=s.ignore)!=null?i:[],s)),!this.includeChildMatches&&typeof a(this,Et).add!="function")){let o="cannot ignore child matches, ignore lacks add() method.";throw new Error(o)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{a(this,ue).length=0}))}pause(){this.paused=!0}resume(){var e;if((e=this.signal)!=null&&e.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=a(this,ue).shift());)t()}onResume(t){var e;(e=this.signal)!=null&&e.aborted||(this.paused?a(this,ue).push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let o=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&(o!=null&&o.isSymbolicLink())){let n=await o.realpath();n&&(n.isUnknown()||this.opts.stat)&&await n.lstat()}return this.matchCheckTest(o,e)}matchCheckTest(t,e){var s;return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!((s=t.realpathCached())!=null&&s.isDirectory()))&&!b(this,it,Vt).call(this,t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let o=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&(o!=null&&o.isSymbolicLink())){let n=o.realpathSync();n&&(n!=null&&n.isUnknown()||this.opts.stat)&&n.lstatSync()}return this.matchCheckTest(o,e)}matchFinish(t,e){var o;if(b(this,it,Vt).call(this,t))return;if(!this.includeChildMatches&&((o=a(this,Et))!=null&&o.add)){let n=`${t.relativePosix()}/**`;a(this,Et).add(n)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?a(this,Jt):"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?t.relativePosix():t.relative(),h=this.opts.dotRelative&&!n.startsWith(".."+a(this,Jt))?"."+a(this,Jt):"";this.matchEmit(n?h+n+i:"."+i)}}async match(t,e,s){let i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){let i=this.matchCheckSync(t,s);i&&this.matchFinish(i,e)}walkCB(t,e,s){var i;(i=this.signal)!=null&&i.aborted&&s(),this.walkCB2(t,e,new ts(this.opts),s)}walkCB2(t,e,s,i){var h;if(b(this,it,gi).call(this,t))return i();if((h=this.signal)!=null&&h.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,i));return}s.processPatterns(t,e);let o=1,n=()=>{--o===0&&i()};for(let[l,c,u]of s.matches.entries())b(this,it,Vt).call(this,l)||(o++,this.match(l,c,u).then(()=>n()));for(let l of s.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;o++;let c=l.readdirCached();l.calledReaddir()?this.walkCB3(l,c,s,n):l.readdirCB((u,m)=>this.walkCB3(l,m,s,n),!0)}n()}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let o=1,n=()=>{--o===0&&i()};for(let[h,l,c]of s.matches.entries())b(this,it,Vt).call(this,h)||(o++,this.match(h,l,c).then(()=>n()));for(let[h,l]of s.subwalks.entries())o++,this.walkCB2(h,l,s.child(),n);n()}walkCBSync(t,e,s){var i;(i=this.signal)!=null&&i.aborted&&s(),this.walkCB2Sync(t,e,new ts(this.opts),s)}walkCB2Sync(t,e,s,i){var h;if(b(this,it,gi).call(this,t))return i();if((h=this.signal)!=null&&h.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,i));return}s.processPatterns(t,e);let o=1,n=()=>{--o===0&&i()};for(let[l,c,u]of s.matches.entries())b(this,it,Vt).call(this,l)||this.matchSync(l,c,u);for(let l of s.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;o++;let c=l.readdirSync();this.walkCB3Sync(l,c,s,n)}n()}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let o=1,n=()=>{--o===0&&i()};for(let[h,l,c]of s.matches.entries())b(this,it,Vt).call(this,h)||this.matchSync(h,l,c);for(let[h,l]of s.subwalks.entries())o++,this.walkCB2Sync(h,l,s.child(),n);n()}};ue=new WeakMap,Et=new WeakMap,Jt=new WeakMap,it=new WeakSet,Vt=function(t){var e,s;return this.seen.has(t)||!!((s=(e=a(this,Et))==null?void 0:e.ignored)!=null&&s.call(e,t))},gi=function(t){var e,s;return!!((s=(e=a(this,Et))==null?void 0:e.childrenIgnored)!=null&&s.call(e,t))};es=class extends Ps{constructor(e,s,i){super(e,s,i);f(this,"matches",new Set)}matchEmit(e){this.matches.add(e)}async walk(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((s,i)=>{this.walkCB(this.path,this.patterns,()=>{var o;(o=this.signal)!=null&&o.aborted?i(this.signal.reason):s(this.matches)})}),this.matches}walkSync(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var s;if((s=this.signal)!=null&&s.aborted)throw this.signal.reason}),this.matches}},ss=class extends Ps{constructor(e,s,i){super(e,s,i);f(this,"results");this.results=new Mt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}});var uo,Ea,ht,wi=E(()=>{"use strict";Pt();uo=require("url");lo();fi();fo();Ea=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ht=class{constructor(t,e){f(this,"absolute");f(this,"cwd");f(this,"root");f(this,"dot");f(this,"dotRelative");f(this,"follow");f(this,"ignore");f(this,"magicalBraces");f(this,"mark");f(this,"matchBase");f(this,"maxDepth");f(this,"nobrace");f(this,"nocase");f(this,"nodir");f(this,"noext");f(this,"noglobstar");f(this,"pattern");f(this,"platform");f(this,"realpath");f(this,"scurry");f(this,"stat");f(this,"signal");f(this,"windowsPathsNoEscape");f(this,"withFileTypes");f(this,"includeChildMatches");f(this,"opts");f(this,"patterns");if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,uo.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=t,this.platform=e.platform||Ea,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=e.platform==="win32"?ae:e.platform==="darwin"?Fe:e.platform?he:ho;this.scurry=new l(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",i={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},o=this.pattern.map(l=>new J(l,i)),[n,h]=o.reduce((l,c)=>(l[0].push(...c.set),l[1].push(...c.globParts),l),[[],[]]);this.patterns=n.map((l,c)=>{let u=h[c];if(!u)throw new Error("invalid pattern object");return new ce(l,u,0,this.platform)})}async walk(){return[...await new es(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new es(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new ss(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new ss(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}});var yi,bi=E(()=>{"use strict";Pt();yi=(r,t={})=>{Array.isArray(r)||(r=[r]);for(let e of r)if(new J(e,t).hasMagic())return!0;return!1}});function Ds(r,t={}){return new ht(r,t).streamSync()}function go(r,t={}){return new ht(r,t).stream()}function wo(r,t={}){return new ht(r,t).walkSync()}async function po(r,t={}){return new ht(r,t).walk()}function Ms(r,t={}){return new ht(r,t).iterateSync()}function yo(r,t={}){return new ht(r,t).iterate()}var va,Ra,Ta,Oa,is,mo,ki=E(()=>{"use strict";Pt();wi();bi();Pt();wi();bi();ui();va=Ds,Ra=Object.assign(go,{sync:Ds}),Ta=Ms,Oa=Object.assign(yo,{sync:Ms}),is=Object.assign(wo,{stream:Ds,iterate:Ms}),mo=Object.assign(po,{glob:po,globSync:wo,sync:is,globStream:go,stream:Ra,globStreamSync:Ds,streamSync:va,globIterate:yo,iterate:Oa,globIterateSync:Ms,iterateSync:Ta,Glob:ht,hasMagic:yi,escape:Xt,unescape:rt});mo.glob=mo});function bo(){let r=is("./**/Cookies",{cwd:Yt,absolute:!0});return Ma.debug("Found cookie files:",r),r}var Pa,Da,Ma,ko=E(()=>{"use strict";Pa=require("fs"),Da=require("path");ki();gt();js();Ma=D.withTag("listChromeProfiles")});function La(r){var e;let t=[/.*?0t(.+)$/,/.*?1e`(.+)$/,/.*?[`'](.+)$/,/[^\x20-\x7E]*([\x20-\x7E].+)$/];for(let s of t){let i=r.match(s),o=(e=i==null?void 0:i[1])!=null?e:"";if(o.length>0)return o}return r}async function So(r,t){if(typeof t!="string")throw new Error("password must be a string");if(!Buffer.isBuffer(r))throw new Error("encryptedData must be a Buffer");return new Promise((e,s)=>{(0,Fs.pbkdf2)(t,"saltysalt",1003,16,"sha1",(i,o)=>{try{if(i){s(new Error("Failed to derive key: "+i.message));return}let n=Fa(r);if(n.length%16!==0){s(new Error("Encrypted data length is not a multiple of 16"));return}let h=Buffer.alloc(16," "),l=(0,Fs.createDecipheriv)("aes-128-cbc",o,h);l.setAutoPadding(!1);let c=l.update(n);try{l.final()}catch(m){s(new Error("Failed to finalize decryption: "+m.message));return}c=Na(c);let u=c.toString("utf8");e(La(u))}catch(n){s(new Error("Decryption failed: "+n.message))}})})}var Fs,Si,Fa,Na,Co=E(()=>{"use strict";Fs=require("crypto"),Si=require("lodash-es"),Fa=(0,Si.memoize)(r=>r.length>=3&&r[0]===118&&r[1]===49&&r[2]===48?r.slice(3):r,r=>r.toString("hex")),Na=(0,Si.memoize)(r=>{let t=r[r.length-1];return t&&t<=16?r.slice(0,-t):r},r=>r.toString("hex"))});function Ba(r,t){if(r instanceof It)throw F("Command execution failed",r,{command:r.command,originalError:r.originalError}),r;if(r instanceof Error){let s=new It(r.message,t,r);throw F("Failed to execute command",r,{command:t,stack:r.stack}),s}let e=new It("Unknown error occurred during command execution",t);throw F("Failed to execute command",null,{error:r,command:t}),e}async function vo(r,t={}){if(!r||typeof r!="string")throw new It("Command must be a non-empty string",r);let e={encoding:"utf8",maxBuffer:5*1024*1024,timeout:3e4};try{let{stdout:s,stderr:i}=await Aa(r,{...e,...t}),o=s.trim();if(!o)throw i?new It(`Command failed with stderr: ${i}`,r):new It("Command returned empty result",r);return o}catch(s){Ba(s,r)}}var xo,Eo,Aa,It,Ro=E(()=>{"use strict";xo=require("child_process"),Eo=require("util");vt();Aa=(0,Eo.promisify)(xo.exec),It=class extends Error{constructor(e,s,i){super(e);this.command=s;this.originalError=i;this.name="CommandExecutionError"}}});var Oo={};_t(Oo,{getChromePassword:()=>ja});var To,Ia,ja,Po=E(()=>{"use strict";To=require("lodash-es");Ro();Ia=async()=>vo('security find-generic-password -w -s "Chrome Safe Storage"'),ja=(0,To.memoize)(Ia)});var Do,Mo,Fo=E(()=>{"use strict";Do=require("lodash-es");vt();Mo=(0,Do.memoize)(async()=>{if(process.platform!=="darwin")throw F("Chrome password retrieval failed",new Error("This only works on macOS"),{platform:process.platform}),new Error("This only works on macOS");try{let{getChromePassword:r}=await Promise.resolve().then(()=>(Po(),Oo)),t=await r();return lt("ChromePassword","Retrieved password successfully",{platform:"macOS"}),t}catch(r){throw F("Chrome password retrieval failed",r,{platform:"macOS"}),r}})});function _a(r){return typeof r!="number"||r<=0?"Infinity":new Date(r)}function No(r,t,e,s,i,o){return{domain:r,name:t,value:e,expiry:_a(s),meta:{file:i,browser:"Chrome",decrypted:o}}}var pe,Ci=E(()=>{"use strict";vt();Gi();ko();Co();Fo();pe=class{constructor(){this.logger=Li("ChromeCookieQueryStrategy");this.browserName="Chrome"}async queryCookies(t,e){try{if(this.logger.info("Querying cookies",{name:t,domain:e}),process.platform!=="darwin")return this.logger.warn("Platform not supported",{platform:process.platform}),[];let s=bo();if(s.length===0)return this.logger.warn("No Chrome cookie files found"),[];let i=await Mo();return(await Promise.all(s.map(n=>this.processFile(n,t,e,i)))).flat()}catch(s){return s instanceof Error?F("Failed to query cookies",s,{name:t,domain:e}):F("Failed to query cookies",new Error(String(s)),{name:t,domain:e}),[]}}async processFile(t,e,s,i){try{let o=await qi({name:e,domain:s,file:t}),n={file:t,password:i};return(await Promise.allSettled(o.map(l=>this.processCookie(l,n)))).map(l=>l.status==="fulfilled"?l.value:null).filter(l=>l!==null)}catch(o){return o instanceof Error?this.logger.error("Failed to process cookie file",{error:o,file:t}):this.logger.error("Failed to process cookie file",{error:String(o),file:t}),[]}}async processCookie(t,e){try{let s=Buffer.isBuffer(t.value)?t.value:Buffer.from(String(t.value)),i=await So(s,e.password);return No(t.domain,t.name,i,t.expiry,e.file,!0)}catch(s){return s instanceof Error?this.logger.warn("Failed to decrypt cookie",{error:s}):this.logger.warn("Failed to decrypt cookie",{error:String(s)}),No(t.domain,t.name,t.value.toString("utf-8"),t.expiry,e.file,!1)}}}});function $a(){let r=[],t=process.env.HOME;if(typeof t!="string"||t.length===0)return os("FirefoxCookieQuery","HOME environment variable not set"),r;let e=[(0,xi.join)(t,"Library/Application Support/Firefox/Profiles/*/cookies.sqlite"),(0,xi.join)(t,".mozilla/firefox/*/cookies.sqlite")];for(let s of e){let i=is(s);r.push(...i)}return lt("FirefoxCookieQuery","Found Firefox cookie files",{files:r}),r}var xi,de,Ei=E(()=>{"use strict";xi=require("path");ki();vt();_s();de=class{constructor(){this.browserName="Firefox"}async queryCookies(t,e){let s=$a(),i=[];for(let o of s)try{let n=await as({file:o,sql:"SELECT name, value, host as domain, expiry FROM moz_cookies WHERE name = ? AND host LIKE ?",params:[t,`%${e}%`],rowTransform:h=>({name:h.name,value:h.value,domain:h.domain,expiry:h.expiry>0?new Date(h.expiry*1e3):"Infinity",meta:{file:o,browser:"Firefox",decrypted:!1}})});i.push(...n)}catch(n){n instanceof Error?os("FirefoxCookieQuery",`Error reading Firefox cookie file ${o}`,{error:n.message}):os("FirefoxCookieQuery",`Error reading Firefox cookie file ${o}`)}return i}}});function Ns(r,t){let e=t;for(;e<r.length&&r[e]!==0;)e++;return[r.toString("utf8",t,e),e+1]}function qa(r,t){let e=r.readUInt32LE(t),s=t+43,o=r.readUInt32LE(s)-za,n=t+56,[h,l]=Ns(r,n);n=l;let[c,u]=Ns(r,n);n=u;let[m,d]=Ns(r,n);n=d;let[y,R]=Ns(r,n);return[{name:c,value:y,domain:h.startsWith(".")?h.slice(1):h,path:m||"/",expiry:o,creation:o},e]}function Ga(r,t,e){let s=t+5,i=r.readUInt32BE(s),o=t+i,n=[],h=t+e;for(;o<h-8;)try{let[l,c]=qa(r,o);n.push(l),o+=c}catch(l){console.warn(`Error decoding cookie at offset ${o}:`,l);break}return n}function Ao(r){let t=(0,Lo.readFileSync)(r),e=t.readUInt32BE(4),s=[];for(let n=0;n<e;n++)s.push(t.readUInt32BE(8+n*4));let i=8+e*4,o=[];for(let n=0;n<e;n++)try{let h=Ga(t,i,s[n]);o.push(...h),i+=s[n]}catch(h){console.warn(`Error decoding page ${n}:`,h),i+=s[n]}return o}var Lo,Wa,Ua,za,Bo=E(()=>{"use strict";Lo=require("fs"),Wa=require("os"),Ua=require("path"),za=1706047360});var Io,Ls,jo=E(()=>{"use strict";Io=require("path");vt();Bo();Ls=class{constructor(){this.browserName="Safari"}getHomeDir(){let t=process.env.HOME;return typeof t!="string"||t.trim().length===0?(F("SafariCookieQueryStrategy","HOME environment variable not set"),""):t}getCookieDbPath(t){return(0,Io.join)(t,"Library","Containers","com.apple.Safari","Data","Library","Cookies","Cookies.binarycookies")}decodeCookies(t,e,s){try{return Ao(t).filter(o=>o.name===e&&o.domain.includes(s)).map(o=>({domain:o.domain,name:o.name,value:o.value.toString(),expiry:typeof o.expiry=="number"&&o.expiry>0?new Date(o.expiry*1e3):"Infinity",meta:{file:t,browser:"Safari",decrypted:!1}}))}catch(i){return i instanceof Error?F("SafariCookieQueryStrategy",`Error decoding ${t}`,{error:i,name:e,domain:s}):F("SafariCookieQueryStrategy",`Error decoding ${t}`,{error:"Unknown error",name:e,domain:s}),[]}}async queryCookies(t,e){let s=this.getHomeDir();if(typeof s!="string"||s.length===0)return Promise.resolve([]);let i=this.getCookieDbPath(s);return Promise.resolve(this.decodeCookies(i,t,e))}}});async function _o(r){if(!r.name||!r.domain)return[];let{name:t,domain:e}=r;if(typeof t!="string"||typeof e!="string")return[];let s=[new pe,new de,new Ls];return(await Promise.allSettled(s.map(o=>o.queryCookies(t,e)))).filter(o=>o.status==="fulfilled").flatMap(o=>o.value)}var $o=E(()=>{"use strict";Ci();Ei();jo()});var Wo={};_t(Wo,{default:()=>Ha,getCookie:()=>me});async function me(r){try{return await _o(r)}catch(t){return D.warn("Error querying cookies:",t instanceof Error?t.message:String(t)),[]}}var Ha,As=E(()=>{"use strict";gt();$o();Ha=me});var zo={};_t(zo,{default:()=>Qa,getChromeCookie:()=>Uo});async function Uo(r){try{return await new pe().queryCookies(r.name,r.domain)}catch(t){return D.warn("Error querying Chrome cookies:",t),[]}}var Qa,qo=E(()=>{"use strict";gt();Ci();Qa=Uo});var Ho={};_t(Ho,{default:()=>Ka,getFirefoxCookie:()=>Go});async function Go(r){try{return await new de().queryCookies(r.name,r.domain)}catch(t){return D.warn("Error querying Firefox cookies:",t instanceof Error?t.message:String(t)),[]}}var Ka,Qo=E(()=>{"use strict";gt();Ei();Ka=Go});var v,oc,Va,rs,nc,ac,Ja,hc,vi=E(()=>{"use strict";v=require("zod"),oc=v.z.object({name:v.z.string().trim().min(1,"Cookie name cannot be empty"),domain:v.z.string().trim().min(1,"Domain cannot be empty")}).strict(),Va=v.z.object({file:v.z.string().trim().min(1,"File path cannot be empty").optional(),browser:v.z.string().trim().optional(),decrypted:v.z.boolean().optional(),secure:v.z.boolean().optional(),httpOnly:v.z.boolean().optional(),path:v.z.string().optional()}).catchall(v.z.unknown()).strict(),rs=v.z.object({domain:v.z.string().trim().min(1,"Domain cannot be empty"),name:v.z.string().trim().min(1,"Cookie name cannot be empty"),value:v.z.string(),expiry:v.z.union([v.z.literal("Infinity"),v.z.date(),v.z.number().int().positive("Expiry must be a positive number")]).optional(),meta:Va.optional()}).strict(),nc=v.z.object({expiry:v.z.number().int().optional(),domain:v.z.string().trim().min(1,"Domain cannot be empty"),name:v.z.string().trim().min(1,"Cookie name cannot be empty"),value:v.z.union([v.z.string(),v.z.instanceof(Buffer)])}).strict(),ac=v.z.object({format:v.z.enum(["merged","grouped"]).optional(),separator:v.z.string().optional(),showFilePaths:v.z.boolean().optional()}).strict(),Ja=v.z.enum(["Chrome","Firefox","Safari","internal","unknown"]),hc=v.z.object({browserName:Ja,queryCookies:v.z.function().args(v.z.string(),v.z.string()).returns(v.z.promise(v.z.array(rs)))}).strict()});function Bs(r,t={}){let{format:e="merged",showFilePaths:s=!0,separator:i="; "}=t;if(r.length===0)return e==="merged"?"":[];if(e==="merged")return r.map(n=>n.value).join(i);let o=(0,Ko.groupBy)(r,n=>{var h,l;return(l=(h=n.meta)==null?void 0:h.file)!=null?l:"unknown"});return Object.entries(o).map(([n,h])=>{let l=h.map(c=>c.value).join(i);return s?`${n}: ${l}`:l})}var Ko,Ri=E(()=>{"use strict";Ko=require("lodash-es")});var Jo={};_t(Jo,{default:()=>Ya,getGroupedRenderedCookies:()=>Vo});async function Vo(r,t={}){try{let e=await me(r);if(!Array.isArray(e))return[];let s=e.filter(i=>{let o=rs.safeParse(i);return o.success?!0:(D.warn("Invalid cookie format:",o.error.format()),!1)});return Bs(s,{...t,format:"grouped"})}catch(e){return D.warn("Error getting grouped rendered cookies:",e instanceof Error?e.message:String(e)),[]}}var Ya,Yo=E(()=>{"use strict";vi();gt();As();Ri();Ya=Vo});var Xo={};_t(Xo,{default:()=>Za,getMergedRenderedCookies:()=>Zo});async function Zo(r,t){try{let e=await me(r);if(!Array.isArray(e))return"";let s=e.filter(o=>{let n=rs.safeParse(o);return n.success?!0:(D.warn("Invalid cookie format:",n.error.format()),!1)}),i=Bs(s,{...t,format:"merged"});return typeof i=="string"?i:""}catch(e){return D.warn("Error getting merged rendered cookies:",e instanceof Error?e.message:String(e)),""}}var Za,tn=E(()=>{"use strict";vi();gt();As();Ri();Za=Zo});var rh={};_t(rh,{getChromeCookie:()=>th,getCookie:()=>Xa,getFirefoxCookie:()=>eh,getGroupedRenderedCookies:()=>sh,getMergedRenderedCookies:()=>ih});module.exports=ln(rh);var Xa=()=>Promise.resolve().then(()=>(As(),Wo)).then(r=>r.getCookie),th=()=>Promise.resolve().then(()=>(qo(),zo)).then(r=>r.getChromeCookie),eh=()=>Promise.resolve().then(()=>(Qo(),Ho)).then(r=>r.getFirefoxCookie),sh=()=>Promise.resolve().then(()=>(Yo(),Jo)).then(r=>r.getGroupedRenderedCookies),ih=()=>Promise.resolve().then(()=>(tn(),Xo)).then(r=>r.getMergedRenderedCookies);0&&(module.exports={getChromeCookie,getCookie,getFirefoxCookie,getGroupedRenderedCookies,getMergedRenderedCookies});
4
4
  //# sourceMappingURL=index.cjs.map