@mherod/get-cookie 4.0.1 → 4.0.3

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 (59) hide show
  1. package/dist/chunk-56Z35D5R.js +2 -0
  2. package/dist/chunk-56Z35D5R.js.map +1 -0
  3. package/dist/chunk-5FUMK7M3.js +4 -0
  4. package/dist/chunk-5FUMK7M3.js.map +1 -0
  5. package/dist/chunk-5ZT2G45S.js +2 -0
  6. package/dist/chunk-5ZT2G45S.js.map +1 -0
  7. package/dist/chunk-FR2MKDHT.js +2 -0
  8. package/dist/chunk-FR2MKDHT.js.map +1 -0
  9. package/dist/{chunk-BKU5PKJ5.js → chunk-HMKSQBDC.js} +2 -2
  10. package/dist/chunk-VMBA4NVU.js +2 -0
  11. package/dist/{chunk-FZ5IFH4R.js → chunk-W3JALMAX.js} +2 -2
  12. package/dist/cli.cjs +19 -0
  13. package/dist/cli.cjs.map +1 -0
  14. package/dist/getChromeCookie-4ZWACG6M.js +2 -0
  15. package/dist/getChromePassword-GTIXL733.js +2 -0
  16. package/dist/getChromePassword-GTIXL733.js.map +1 -0
  17. package/dist/getCookie-43FKMQEZ.js +2 -0
  18. package/dist/getFirefoxCookie-OJYYZFZP.js +2 -0
  19. package/dist/getGroupedRenderedCookies-P5VZXZUC.js +2 -0
  20. package/dist/getMergedRenderedCookies-C6TXK2I4.js +2 -0
  21. package/dist/index.cjs +3 -5
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.js +1 -1
  24. package/jest.setup.js +8 -1
  25. package/package.json +11 -6
  26. package/tsconfig.build.json +7 -3
  27. package/tsup.cli.ts +27 -0
  28. package/tsup.config.ts +27 -0
  29. package/tsup.lib.ts +27 -0
  30. package/dist/chunk-4I5M3M7H.js +0 -6
  31. package/dist/chunk-4I5M3M7H.js.map +0 -1
  32. package/dist/chunk-ACXFQWII.js +0 -2
  33. package/dist/chunk-DR2EQC4R.js +0 -2
  34. package/dist/chunk-DR2EQC4R.js.map +0 -1
  35. package/dist/chunk-S5FU4HO5.js +0 -2
  36. package/dist/chunk-S5FU4HO5.js.map +0 -1
  37. package/dist/chunk-TUGIEFXM.js +0 -2
  38. package/dist/chunk-TUGIEFXM.js.map +0 -1
  39. package/dist/cli/cli.cjs +0 -8
  40. package/dist/cli/cli.cjs.map +0 -1
  41. package/dist/cli/cli.d.ts +0 -1
  42. package/dist/cli/cli.js +0 -4
  43. package/dist/cli/cli.js.map +0 -1
  44. package/dist/getChromeCookie-P623SIWB.js +0 -2
  45. package/dist/getChromePassword-74BC3LXO.js +0 -2
  46. package/dist/getChromePassword-74BC3LXO.js.map +0 -1
  47. package/dist/getCookie-FBQKCKJB.js +0 -2
  48. package/dist/getFirefoxCookie-CGJJJ7VC.js +0 -2
  49. package/dist/getGroupedRenderedCookies-RNB6DKBL.js +0 -2
  50. package/dist/getMergedRenderedCookies-NC3UTOIC.js +0 -2
  51. /package/dist/{chunk-BKU5PKJ5.js.map → chunk-HMKSQBDC.js.map} +0 -0
  52. /package/dist/{chunk-ACXFQWII.js.map → chunk-VMBA4NVU.js.map} +0 -0
  53. /package/dist/{chunk-FZ5IFH4R.js.map → chunk-W3JALMAX.js.map} +0 -0
  54. /package/dist/{cli/cli.d.cts → cli.d.cts} +0 -0
  55. /package/dist/{getChromeCookie-P623SIWB.js.map → getChromeCookie-4ZWACG6M.js.map} +0 -0
  56. /package/dist/{getCookie-FBQKCKJB.js.map → getCookie-43FKMQEZ.js.map} +0 -0
  57. /package/dist/{getFirefoxCookie-CGJJJ7VC.js.map → getFirefoxCookie-OJYYZFZP.js.map} +0 -0
  58. /package/dist/{getGroupedRenderedCookies-RNB6DKBL.js.map → getGroupedRenderedCookies-P5VZXZUC.js.map} +0 -0
  59. /package/dist/{getMergedRenderedCookies-NC3UTOIC.js.map → getMergedRenderedCookies-C6TXK2I4.js.map} +0 -0
@@ -0,0 +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
@@ -0,0 +1,2 @@
1
+ import{c as i}from"./chunk-56Z35D5R.js";import"./chunk-VMBA4NVU.js";import{memoize as l}from"lodash-es";import{exec as m}from"child_process";import{promisify as u}from"util";var f=u(m),o=class extends Error{constructor(n,e,s){super(n);this.command=e;this.originalError=s;this.name="CommandExecutionError"}};function d(t,r){if(t instanceof o)throw i("Command execution failed",t,{command:t.command,originalError:t.originalError}),t;if(t instanceof Error){let e=new o(t.message,r,t);throw i("Failed to execute command",t,{command:r,stack:t.stack}),e}let n=new o("Unknown error occurred during command execution",r);throw i("Failed to execute command",null,{error:t,command:r}),n}async function a(t,r={}){if(!t||typeof t!="string")throw new o("Command must be a non-empty string",t);let n={encoding:"utf8",maxBuffer:5*1024*1024,timeout:3e4};try{let{stdout:e,stderr:s}=await f(t,{...n,...r}),c=e.trim();if(!c)throw s?new o(`Command failed with stderr: ${s}`,t):new o("Command returned empty result",t);return c}catch(e){d(e,t)}}var g=async()=>a('security find-generic-password -w -s "Chrome Safe Storage"'),P=l(g);export{P as getChromePassword};
2
+ //# sourceMappingURL=getChromePassword-GTIXL733.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/browsers/chrome/macos/getChromePassword.ts","../src/utils/execSimple.ts"],"sourcesContent":["import { memoize } from \"lodash-es\";\n\nimport { execSimple } from \"@utils/execSimple\";\n\n/**\n * Retrieves the Chrome Safe Storage password from the macOS keychain\n * @returns A promise that resolves to the Chrome Safe Storage password\n * @throws {Error} If the password cannot be retrieved from the keychain\n */\nconst getChromeSafeStoragePassword = async (): Promise<string> => {\n const command = 'security find-generic-password -w -s \"Chrome Safe Storage\"';\n return execSimple(command);\n};\n\n/**\n * Memoized version of getChromeSafeStoragePassword that caches the result\n * to avoid repeated keychain queries\n * @returns A promise that resolves to the Chrome Safe Storage password\n * @throws {Error} If the password cannot be retrieved from the keychain\n * @example\n */\nexport const getChromePassword: () => Promise<string> = memoize(\n getChromeSafeStoragePassword,\n);\n","// External imports\nimport { exec, ExecOptions } from \"child_process\";\nimport { promisify } from \"util\";\n\n// Internal imports\nimport { logError } from \"@utils/logHelpers\";\n\nconst execPromise = promisify(exec);\n\n/**\n * Custom error class for command execution failures.\n * @property {string} command - The command that failed to execute\n * @property {Error} [originalError] - The underlying error that caused the failure\n * @throws CommandExecutionError Always throws with appropriate error context\n * @example\n * ```typescript\n * throw new CommandExecutionError(\n * 'Command timed out',\n * 'git status',\n * originalError\n * );\n * ```\n */\nclass CommandExecutionError extends Error {\n public constructor(\n message: string,\n public readonly command: string,\n public readonly originalError?: Error,\n ) {\n super(message);\n this.name = \"CommandExecutionError\";\n }\n}\n\n/**\n * Handles execution errors and throws appropriate CommandExecutionError.\n * @internal\n * @param error - The error that occurred during command execution\n * @param command - The command that was being executed when the error occurred\n * @throws CommandExecutionError Always throws with appropriate error context\n * @example\n * ```typescript\n * try {\n * await execPromise('invalid-command');\n * } catch (error) {\n * handleExecutionError(error, 'invalid-command');\n * }\n * ```\n */\nfunction handleExecutionError(error: unknown, command: string): never {\n if (error instanceof CommandExecutionError) {\n logError(\"Command execution failed\", error, {\n command: error.command,\n originalError: error.originalError,\n });\n throw error;\n }\n\n if (error instanceof Error) {\n const commandError = new CommandExecutionError(\n error.message,\n command,\n error,\n );\n logError(\"Failed to execute command\", error, {\n command,\n stack: error.stack,\n });\n throw commandError;\n }\n\n // Handle unknown error types\n const commandError = new CommandExecutionError(\n \"Unknown error occurred during command execution\",\n command,\n );\n logError(\"Failed to execute command\", null, {\n error,\n command,\n });\n throw commandError;\n}\n\n/**\n * Executes a shell command asynchronously and returns its output as a string.\n * @param command - The shell command to execute\n * @param options - Optional execution options that override the defaults\n * @returns A promise that resolves to the trimmed command output\n * @throws CommandExecutionError if the command returns an empty result, times out, or fails to execute\n * @example\n * ```typescript\n * // Basic usage\n * const gitStatus = await execSimple('git status');\n *\n * // With custom timeout\n * const output = await execSimple('long-running-command', { timeout: 60000 });\n *\n * // Error handling\n * try {\n * const result = await execSimple('git push');\n * } catch (error) {\n * if (error instanceof CommandExecutionError) {\n * console.error('Push failed:', error.message);\n * }\n * }\n * ```\n */\nexport async function execSimple(\n command: string,\n options: Partial<ExecOptions> = {},\n): Promise<string> {\n if (!command || typeof command !== \"string\") {\n throw new CommandExecutionError(\n \"Command must be a non-empty string\",\n command,\n );\n }\n\n const defaultOptions = {\n encoding: \"utf8\" as BufferEncoding,\n maxBuffer: 5 * 1024 * 1024, // 5MB buffer\n timeout: 30000, // 30 second timeout\n };\n\n try {\n const { stdout, stderr } = await execPromise(command, {\n ...defaultOptions,\n ...options,\n });\n const result = stdout.trim();\n\n if (!result) {\n if (stderr) {\n throw new CommandExecutionError(\n `Command failed with stderr: ${stderr}`,\n command,\n );\n }\n throw new CommandExecutionError(\"Command returned empty result\", command);\n }\n\n return result;\n } catch (error) {\n handleExecutionError(error, command);\n }\n}\n"],"mappings":"oEAAA,OAAS,WAAAA,MAAe,YCCxB,OAAS,QAAAC,MAAyB,gBAClC,OAAS,aAAAC,MAAiB,OAK1B,IAAMC,EAAcC,EAAUC,CAAI,EAgB5BC,EAAN,cAAoC,KAAM,CACjC,YACLC,EACgBC,EACAC,EAChB,CACA,MAAMF,CAAO,EAHG,aAAAC,EACA,mBAAAC,EAGhB,KAAK,KAAO,uBACd,CACF,EAiBA,SAASC,EAAqBC,EAAgBH,EAAwB,CACpE,GAAIG,aAAiBL,EACnB,MAAAM,EAAS,2BAA4BD,EAAO,CAC1C,QAASA,EAAM,QACf,cAAeA,EAAM,aACvB,CAAC,EACKA,EAGR,GAAIA,aAAiB,MAAO,CAC1B,IAAME,EAAe,IAAIP,EACvBK,EAAM,QACNH,EACAG,CACF,EACA,MAAAC,EAAS,4BAA6BD,EAAO,CAC3C,QAAAH,EACA,MAAOG,EAAM,KACf,CAAC,EACKE,CACR,CAGA,IAAMA,EAAe,IAAIP,EACvB,kDACAE,CACF,EACA,MAAAI,EAAS,4BAA6B,KAAM,CAC1C,MAAAD,EACA,QAAAH,CACF,CAAC,EACKK,CACR,CA0BA,eAAsBC,EACpBN,EACAO,EAAgC,CAAC,EAChB,CACjB,GAAI,CAACP,GAAW,OAAOA,GAAY,SACjC,MAAM,IAAIF,EACR,qCACAE,CACF,EAGF,IAAMQ,EAAiB,CACrB,SAAU,OACV,UAAW,EAAI,KAAO,KACtB,QAAS,GACX,EAEA,GAAI,CACF,GAAM,CAAE,OAAAC,EAAQ,OAAAC,CAAO,EAAI,MAAMf,EAAYK,EAAS,CACpD,GAAGQ,EACH,GAAGD,CACL,CAAC,EACKI,EAASF,EAAO,KAAK,EAE3B,GAAI,CAACE,EACH,MAAID,EACI,IAAIZ,EACR,+BAA+BY,CAAM,GACrCV,CACF,EAEI,IAAIF,EAAsB,gCAAiCE,CAAO,EAG1E,OAAOW,CACT,OAASR,EAAO,CACdD,EAAqBC,EAAOH,CAAO,CACrC,CACF,CDxIA,IAAMY,EAA+B,SAE5BC,EADS,4DACS,EAUdC,EAA2CC,EACtDH,CACF","names":["memoize","exec","promisify","execPromise","promisify","exec","CommandExecutionError","message","command","originalError","handleExecutionError","error","logError","commandError","execSimple","options","defaultOptions","stdout","stderr","result","getChromeSafeStoragePassword","execSimple","getChromePassword","memoize"]}
@@ -0,0 +1,2 @@
1
+ import{a,b}from"./chunk-W3JALMAX.js";import"./chunk-5ZT2G45S.js";import"./chunk-HMKSQBDC.js";import"./chunk-5FUMK7M3.js";import"./chunk-56Z35D5R.js";import"./chunk-VMBA4NVU.js";export{b as default,a as getCookie};
2
+ //# sourceMappingURL=getCookie-43FKMQEZ.js.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-HMKSQBDC.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 a=i;export{a as default,i as getFirefoxCookie};
2
+ //# sourceMappingURL=getFirefoxCookie-OJYYZFZP.js.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-FR2MKDHT.js";import{a as r}from"./chunk-W3JALMAX.js";import"./chunk-5ZT2G45S.js";import"./chunk-HMKSQBDC.js";import"./chunk-5FUMK7M3.js";import{a as o}from"./chunk-56Z35D5R.js";import"./chunk-VMBA4NVU.js";async function p(i,n={}){try{let e=await r(i);return t(e,{...n,format:"grouped"})}catch(e){return o.warn("Error getting grouped rendered cookies:",e instanceof Error?e.message:String(e)),[]}}var g=p;export{g as default,p as getGroupedRenderedCookies};
2
+ //# sourceMappingURL=getGroupedRenderedCookies-P5VZXZUC.js.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-FR2MKDHT.js";import{a as o}from"./chunk-W3JALMAX.js";import"./chunk-5ZT2G45S.js";import"./chunk-HMKSQBDC.js";import"./chunk-5FUMK7M3.js";import{a as r}from"./chunk-56Z35D5R.js";import"./chunk-VMBA4NVU.js";async function m(i,n={}){try{let e=await o(i);return t(e,{...n,format:"merged"})}catch(e){return r.warn("Error getting merged rendered cookies:",e instanceof Error?e.message:String(e)),""}}var d=m;export{d as default,m as getMergedRenderedCookies};
2
+ //# sourceMappingURL=getMergedRenderedCookies-C6TXK2I4.js.map
package/dist/index.cjs CHANGED
@@ -1,6 +1,4 @@
1
- "use strict";var Jn=Object.create;var Ce=Object.defineProperty;var Yn=Object.getOwnPropertyDescriptor;var Zn=Object.getOwnPropertyNames;var Xn=Object.getPrototypeOf,ta=Object.prototype.hasOwnProperty;var Hs=s=>{throw TypeError(s)};var ea=(s,t,e)=>t in s?Ce(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var C=(s,t)=>()=>(s&&(t=s(s=0)),t);var $=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports),Ut=(s,t)=>{for(var e in t)Ce(s,e,{get:t[e],enumerable:!0})},Qs=(s,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Zn(t))!ta.call(s,r)&&r!==e&&Ce(s,r,{get:()=>t[r],enumerable:!(i=Yn(t,r))||i.enumerable});return s};var ft=(s,t,e)=>(e=s!=null?Jn(Xn(s)):{},Qs(t||!s||!s.__esModule?Ce(e,"default",{value:s,enumerable:!0}):e,s)),ia=s=>Qs(Ce({},"__esModule",{value:!0}),s);var u=(s,t,e)=>ea(s,typeof t!="symbol"?t+"":t,e),Yi=(s,t,e)=>t.has(s)||Hs("Cannot "+e);var a=(s,t,e)=>(Yi(s,t,"read from private field"),e?e.call(s):t.get(s)),w=(s,t,e)=>t.has(s)?Hs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),p=(s,t,e,i)=>(Yi(s,t,"write to private field"),i?i.call(s,e):t.set(s,e),e),b=(s,t,e)=>(Yi(s,t,"access private method"),e);var Ks,sa,D,Et=C(()=>{"use strict";Ks=require("consola"),sa=(0,Ks.createConsola)({fancy:!0,formatOptions:{showLogLevel:!0,colors:!0,date:!0,compact:!1,columns:process.stdout.columns||80},level:process.env.LOG_LEVEL==="debug"?5:3}),D=sa});async function Js(s,t,e=[]){return s.length===0?e:(await Promise.all(s.map(async r=>{try{return await t(r)}catch(o){return e}}))).flat()}var Ys=C(()=>{"use strict"});function ui(s,t,e){let r=`${t?"\u2705":"\u274C"} ${s} ${t?"succeeded":"failed"}`;t?D.success(r,e):D.error(r,e)}function G(s,t,e){let i={...e!=null?e:{},error:t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:t};D.error(s,i)}function ut(s,t,e){D.withTag(s).debug(t,e)}function Zs(s){return D.withTag(s)}function pi(s,t,e){D.withTag(s).warn(t,e)}var zt=C(()=>{"use strict";Et();Et()});var Xs,tr,di,er=C(()=>{"use strict";Xs=ft(require("lodash/merge"),1),tr={};(0,Xs.default)(tr,process.env);di=tr.HOME;if(typeof di!="string"||di.length===0)throw new Error("HOME environment variable is not set or empty")});var sr,ir,re,Zi=C(()=>{"use strict";sr=require("path");er();re=(0,sr.join)((ir=di)!=null?ir:"","Library","Application Support","Google","Chrome")});var pt=$(mi=>{"use strict";mi.getBooleanOption=(s,t)=>{let e=!1;if(t in s&&typeof(e=s[t])!="boolean")throw new TypeError(`Expected the "${t}" option to be a boolean`);return e};mi.cppdb=Symbol();mi.inspect=Symbol.for("nodejs.util.inspect.custom")});var ts=$((Rl,rr)=>{"use strict";var Xi={value:"SqliteError",writable:!0,enumerable:!1,configurable:!0};function Gt(s,t){if(new.target!==Gt)return new Gt(s,t);if(typeof t!="string")throw new TypeError("Expected second argument to be a string");Error.call(this,s),Xi.value=""+s,Object.defineProperty(this,"message",Xi),Error.captureStackTrace(this,Gt),this.code=t}Object.setPrototypeOf(Gt,Error);Object.setPrototypeOf(Gt.prototype,Error.prototype);Object.defineProperty(Gt.prototype,"name",Xi);rr.exports=Gt});var nr=$((Ol,or)=>{"use strict";var gi=require("path").sep||"/";or.exports=ra;function ra(s){if(typeof s!="string"||s.length<=7||s.substring(0,7)!="file://")throw new TypeError("must pass in a file:// URI to convert to a file path");var t=decodeURI(s.substring(7)),e=t.indexOf("/"),i=t.substring(0,e),r=t.substring(e+1);return i=="localhost"&&(i=""),i&&(i=gi+gi+i),r=r.replace(/^(.+)\|/,"$1:"),gi=="\\"&&(r=r.replace(/\//g,"\\")),/^.+\:/.test(r)||(r=gi+r),i+r}});var cr=$((oe,lr)=>{"use strict";var es=require("fs"),yi=require("path"),oa=nr(),wi=yi.join,na=yi.dirname,ar=es.accessSync&&function(s){try{es.accessSync(s)}catch(t){return!1}return!0}||es.existsSync||yi.existsSync,hr={arrow:process.env.NODE_BINDINGS_ARROW||" \u2192 ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};function aa(s){typeof s=="string"?s={bindings:s}:s||(s={}),Object.keys(hr).map(function(h){h in s||(s[h]=hr[h])}),s.module_root||(s.module_root=oe.getRoot(oe.getFileName())),yi.extname(s.bindings)!=".node"&&(s.bindings+=".node");for(var t=typeof __webpack_require__=="function"?__non_webpack_require__:require,e=[],i=0,r=s.try.length,o,n,l;i<r;i++){o=wi.apply(null,s.try[i].map(function(h){return s[h]||h})),e.push(o);try{return n=s.path?t.resolve(o):t(o),s.path||(n.path=o),n}catch(h){if(h.code!=="MODULE_NOT_FOUND"&&h.code!=="QUALIFIED_PATH_RESOLUTION_FAILED"&&!/not find/i.test(h.message))throw h}}throw l=new Error(`Could not locate the bindings file. Tried:
2
- `+e.map(function(h){return s.arrow+h}).join(`
3
- `)),l.tries=e,l}lr.exports=oe=aa;oe.getFileName=function(t){var e=Error.prepareStackTrace,i=Error.stackTraceLimit,r={},o;Error.stackTraceLimit=10,Error.prepareStackTrace=function(l,h){for(var c=0,f=h.length;c<f;c++)if(o=h[c].getFileName(),o!==__filename)if(t){if(o!==t)return}else return},Error.captureStackTrace(r),r.stack,Error.prepareStackTrace=e,Error.stackTraceLimit=i;var n="file://";return o.indexOf(n)===0&&(o=oa(o)),o};oe.getRoot=function(t){for(var e=na(t),i;;){if(e==="."&&(e=process.cwd()),ar(wi(e,"package.json"))||ar(wi(e,"node_modules")))return e;if(i===e)throw new Error('Could not find module root given file: "'+t+'". Do you have a `package.json` file? ');i=e,e=wi(e,"..")}}});var fr=$(Pt=>{"use strict";var{cppdb:ot}=pt();Pt.prepare=function(t){return this[ot].prepare(t,this,!1)};Pt.exec=function(t){return this[ot].exec(t),this};Pt.close=function(){return this[ot].close(),this};Pt.loadExtension=function(...t){return this[ot].loadExtension(...t),this};Pt.defaultSafeIntegers=function(...t){return this[ot].defaultSafeIntegers(...t),this};Pt.unsafeMode=function(...t){return this[ot].unsafeMode(...t),this};Pt.getters={name:{get:function(){return this[ot].name},enumerable:!0},open:{get:function(){return this[ot].open},enumerable:!0},inTransaction:{get:function(){return this[ot].inTransaction},enumerable:!0},readonly:{get:function(){return this[ot].readonly},enumerable:!0},memory:{get:function(){return this[ot].memory},enumerable:!0}}});var dr=$((Dl,pr)=>{"use strict";var{cppdb:ha}=pt(),ur=new WeakMap;pr.exports=function(t){if(typeof t!="function")throw new TypeError("Expected first argument to be a function");let e=this[ha],i=la(e,this),{apply:r}=Function.prototype,o={default:{value:bi(r,t,e,i.default)},deferred:{value:bi(r,t,e,i.deferred)},immediate:{value:bi(r,t,e,i.immediate)},exclusive:{value:bi(r,t,e,i.exclusive)},database:{value:this,enumerable:!0}};return Object.defineProperties(o.default.value,o),Object.defineProperties(o.deferred.value,o),Object.defineProperties(o.immediate.value,o),Object.defineProperties(o.exclusive.value,o),o.default.value};var la=(s,t)=>{let e=ur.get(s);if(!e){let i={commit:s.prepare("COMMIT",t,!1),rollback:s.prepare("ROLLBACK",t,!1),savepoint:s.prepare("SAVEPOINT ` _bs3. `",t,!1),release:s.prepare("RELEASE ` _bs3. `",t,!1),rollbackTo:s.prepare("ROLLBACK TO ` _bs3. `",t,!1)};ur.set(s,e={default:Object.assign({begin:s.prepare("BEGIN",t,!1)},i),deferred:Object.assign({begin:s.prepare("BEGIN DEFERRED",t,!1)},i),immediate:Object.assign({begin:s.prepare("BEGIN IMMEDIATE",t,!1)},i),exclusive:Object.assign({begin:s.prepare("BEGIN EXCLUSIVE",t,!1)},i)})}return e},bi=(s,t,e,{begin:i,commit:r,rollback:o,savepoint:n,release:l,rollbackTo:h})=>function(){let f,d,m;e.inTransaction?(f=n,d=l,m=h):(f=i,d=r,m=o),f.run();try{let y=s.call(t,this,arguments);return d.run(),y}catch(y){throw e.inTransaction&&(m.run(),m!==o&&d.run()),y}}});var gr=$((Ml,mr)=>{"use strict";var{getBooleanOption:ca,cppdb:fa}=pt();mr.exports=function(t,e){if(e==null&&(e={}),typeof t!="string")throw new TypeError("Expected first argument to be a string");if(typeof e!="object")throw new TypeError("Expected second argument to be an options object");let i=ca(e,"simple"),r=this[fa].prepare(`PRAGMA ${t}`,this,!0);return i?r.pluck().get():r.all()}});var br=$((Fl,yr)=>{"use strict";var ua=require("fs"),pa=require("path"),{promisify:da}=require("util"),{cppdb:ma}=pt(),wr=da(ua.access);yr.exports=async function(t,e){if(e==null&&(e={}),typeof t!="string")throw new TypeError("Expected first argument to be a string");if(typeof e!="object")throw new TypeError("Expected second argument to be an options object");t=t.trim();let i="attached"in e?e.attached:"main",r="progress"in e?e.progress:null;if(!t)throw new TypeError("Backup filename cannot be an empty string");if(t===":memory:")throw new TypeError('Invalid backup filename ":memory:"');if(typeof i!="string")throw new TypeError('Expected the "attached" option to be a string');if(!i)throw new TypeError('The "attached" option cannot be an empty string');if(r!=null&&typeof r!="function")throw new TypeError('Expected the "progress" option to be a function');await wr(pa.dirname(t)).catch(()=>{throw new TypeError("Cannot save backup because the directory does not exist")});let o=await wr(t).then(()=>!1,()=>!0);return ga(this[ma].backup(this,i,t,o),r||null)};var ga=(s,t)=>{let e=0,i=!0;return new Promise((r,o)=>{setImmediate(function n(){try{let l=s.transfer(e);if(!l.remainingPages){s.close(),r(l);return}if(i&&(i=!1,e=100),t){let h=t(l);if(h!==void 0)if(typeof h=="number"&&h===h)e=Math.max(0,Math.min(2147483647,Math.round(h)));else throw new TypeError("Expected progress callback to return a number or undefined")}setImmediate(n)}catch(l){s.close(),o(l)}})})}});var xr=$((Al,Er)=>{"use strict";var{cppdb:wa}=pt();Er.exports=function(t){if(t==null&&(t={}),typeof t!="object")throw new TypeError("Expected first argument to be an options object");let e="attached"in t?t.attached:"main";if(typeof e!="string")throw new TypeError('Expected the "attached" option to be a string');if(!e)throw new TypeError('The "attached" option cannot be an empty string');return this[wa].serialize(e)}});var kr=$((Nl,Sr)=>{"use strict";var{getBooleanOption:Ei,cppdb:ya}=pt();Sr.exports=function(t,e,i){if(e==null&&(e={}),typeof e=="function"&&(i=e,e={}),typeof t!="string")throw new TypeError("Expected first argument to be a string");if(typeof i!="function")throw new TypeError("Expected last argument to be a function");if(typeof e!="object")throw new TypeError("Expected second argument to be an options object");if(!t)throw new TypeError("User-defined function name cannot be an empty string");let r="safeIntegers"in e?+Ei(e,"safeIntegers"):2,o=Ei(e,"deterministic"),n=Ei(e,"directOnly"),l=Ei(e,"varargs"),h=-1;if(!l){if(h=i.length,!Number.isInteger(h)||h<0)throw new TypeError("Expected function.length to be a positive integer");if(h>100)throw new RangeError("User-defined functions cannot have more than 100 arguments")}return this[ya].function(i,t,h,r,o,n),this}});var Tr=$((jl,vr)=>{"use strict";var{getBooleanOption:xi,cppdb:ba}=pt();vr.exports=function(t,e){if(typeof t!="string")throw new TypeError("Expected first argument to be a string");if(typeof e!="object"||e===null)throw new TypeError("Expected second argument to be an options object");if(!t)throw new TypeError("User-defined function name cannot be an empty string");let i="start"in e?e.start:null,r=is(e,"step",!0),o=is(e,"inverse",!1),n=is(e,"result",!1),l="safeIntegers"in e?+xi(e,"safeIntegers"):2,h=xi(e,"deterministic"),c=xi(e,"directOnly"),f=xi(e,"varargs"),d=-1;if(!f&&(d=Math.max(Cr(r),o?Cr(o):0),d>0&&(d-=1),d>100))throw new RangeError("User-defined functions cannot have more than 100 arguments");return this[ba].aggregate(i,r,o,n,t,d,l,h,c),this};var is=(s,t,e)=>{let i=t in s?s[t]:null;if(typeof i=="function")return i;if(i!=null)throw new TypeError(`Expected the "${t}" option to be a function`);if(e)throw new TypeError(`Missing required option "${t}"`);return null},Cr=({length:s})=>{if(Number.isInteger(s)&&s>=0)return s;throw new TypeError("Expected function.length to be a positive integer")}});var Dr=$((Il,Pr)=>{"use strict";var{cppdb:Ea}=pt();Pr.exports=function(t,e){if(typeof t!="string")throw new TypeError("Expected first argument to be a string");if(!t)throw new TypeError("Virtual table module name cannot be an empty string");let i=!1;if(typeof e=="object"&&e!==null)i=!0,e=Oa(Or(e,"used",t));else{if(typeof e!="function")throw new TypeError("Expected second argument to be a function or a table definition object");e=xa(e)}return this[Ea].table(e,t,i),this};function xa(s){return function(e,i,r,...o){let n={module:e,database:i,table:r},l=Ta.call(s,n,o);if(typeof l!="object"||l===null)throw new TypeError(`Virtual table module "${e}" did not return a table definition object`);return Or(l,"returned",e)}}function Or(s,t,e){if(!ve.call(s,"rows"))throw new TypeError(`Virtual table module "${e}" ${t} a table definition without a "rows" property`);if(!ve.call(s,"columns"))throw new TypeError(`Virtual table module "${e}" ${t} a table definition without a "columns" property`);let i=s.rows;if(typeof i!="function"||Object.getPrototypeOf(i)!==Ra)throw new TypeError(`Virtual table module "${e}" ${t} a table definition with an invalid "rows" property (should be a generator function)`);let r=s.columns;if(!Array.isArray(r)||!(r=[...r]).every(c=>typeof c=="string"))throw new TypeError(`Virtual table module "${e}" ${t} a table definition with an invalid "columns" property (should be an array of strings)`);if(r.length!==new Set(r).size)throw new TypeError(`Virtual table module "${e}" ${t} a table definition with duplicate column names`);if(!r.length)throw new RangeError(`Virtual table module "${e}" ${t} a table definition with zero columns`);let o;if(ve.call(s,"parameters")){if(o=s.parameters,!Array.isArray(o)||!(o=[...o]).every(c=>typeof c=="string"))throw new TypeError(`Virtual table module "${e}" ${t} a table definition with an invalid "parameters" property (should be an array of strings)`)}else o=va(i);if(o.length!==new Set(o).size)throw new TypeError(`Virtual table module "${e}" ${t} a table definition with duplicate parameter names`);if(o.length>32)throw new RangeError(`Virtual table module "${e}" ${t} a table definition with more than the maximum number of 32 parameters`);for(let c of o)if(r.includes(c))throw new TypeError(`Virtual table module "${e}" ${t} a table definition with column "${c}" which was ambiguously defined as both a column and parameter`);let n=2;if(ve.call(s,"safeIntegers")){let c=s.safeIntegers;if(typeof c!="boolean")throw new TypeError(`Virtual table module "${e}" ${t} a table definition with an invalid "safeIntegers" property (should be a boolean)`);n=+c}let l=!1;if(ve.call(s,"directOnly")&&(l=s.directOnly,typeof l!="boolean"))throw new TypeError(`Virtual table module "${e}" ${t} a table definition with an invalid "directOnly" property (should be a boolean)`);return[`CREATE TABLE x(${[...o.map(Rr).map(c=>`${c} HIDDEN`),...r.map(Rr)].join(", ")});`,Sa(i,new Map(r.map((c,f)=>[c,o.length+f])),e),o,n,l]}function Sa(s,t,e){return function*(...r){let o=r.map(n=>Buffer.isBuffer(n)?Buffer.from(n):n);for(let n=0;n<t.size;++n)o.push(null);for(let n of s(...r))if(Array.isArray(n))ka(n,o,t.size,e),yield o;else if(typeof n=="object"&&n!==null)Ca(n,o,t,e),yield o;else throw new TypeError(`Virtual table module "${e}" yielded something that isn't a valid row object`)}}function ka(s,t,e,i){if(s.length!==e)throw new TypeError(`Virtual table module "${i}" yielded a row with an incorrect number of columns`);let r=t.length-e;for(let o=0;o<e;++o)t[o+r]=s[o]}function Ca(s,t,e,i){let r=0;for(let o of Object.keys(s)){let n=e.get(o);if(n===void 0)throw new TypeError(`Virtual table module "${i}" yielded a row with an undeclared column "${o}"`);t[n]=s[o],r+=1}if(r!==e.size)throw new TypeError(`Virtual table module "${i}" yielded a row with missing columns`)}function va({length:s}){if(!Number.isInteger(s)||s<0)throw new TypeError("Expected function.length to be a positive integer");let t=[];for(let e=0;e<s;++e)t.push(`$${e+1}`);return t}var{hasOwnProperty:ve}=Object.prototype,{apply:Ta}=Function.prototype,Ra=Object.getPrototypeOf(function*(){}),Rr=s=>`"${s.replace(/"/g,'""')}"`,Oa=s=>()=>s});var Fr=$((Ll,Mr)=>{"use strict";var Pa=function(){};Mr.exports=function(t,e){return Object.assign(new Pa,this)}});var Ir=$((_l,jr)=>{"use strict";var Da=require("fs"),Ar=require("path"),Si=pt(),Ma=ts(),Nr;function W(s,t){if(new.target==null)return new W(s,t);let e;if(Buffer.isBuffer(s)&&(e=s,s=":memory:"),s==null&&(s=""),t==null&&(t={}),typeof s!="string")throw new TypeError("Expected first argument to be a string");if(typeof t!="object")throw new TypeError("Expected second argument to be an options object");if("readOnly"in t)throw new TypeError('Misspelled option "readOnly" should be "readonly"');if("memory"in t)throw new TypeError('Option "memory" was removed in v7.0.0 (use ":memory:" filename instead)');let i=s.trim(),r=i===""||i===":memory:",o=Si.getBooleanOption(t,"readonly"),n=Si.getBooleanOption(t,"fileMustExist"),l="timeout"in t?t.timeout:5e3,h="verbose"in t?t.verbose:null,c="nativeBinding"in t?t.nativeBinding:null;if(o&&r&&!e)throw new TypeError("In-memory/temporary databases cannot be readonly");if(!Number.isInteger(l)||l<0)throw new TypeError('Expected the "timeout" option to be a positive integer');if(l>2147483647)throw new RangeError('Option "timeout" cannot be greater than 2147483647');if(h!=null&&typeof h!="function")throw new TypeError('Expected the "verbose" option to be a function');if(c!=null&&typeof c!="string"&&typeof c!="object")throw new TypeError('Expected the "nativeBinding" option to be a string or addon object');let f;if(c==null?f=Nr||(Nr=cr()("better_sqlite3.node")):typeof c=="string"?f=(typeof __non_webpack_require__=="function"?__non_webpack_require__:require)(Ar.resolve(c).replace(/(\.node)?$/,".node")):f=c,f.isInitialized||(f.setErrorConstructor(Ma),f.isInitialized=!0),!r&&!Da.existsSync(Ar.dirname(i)))throw new TypeError("Cannot open database because the directory does not exist");Object.defineProperties(this,{[Si.cppdb]:{value:new f.Database(i,s,r,o,n,l,h||null,e||null)},...Vt.getters})}var Vt=fr();W.prototype.prepare=Vt.prepare;W.prototype.transaction=dr();W.prototype.pragma=gr();W.prototype.backup=br();W.prototype.serialize=xr();W.prototype.function=kr();W.prototype.aggregate=Tr();W.prototype.table=Dr();W.prototype.loadExtension=Vt.loadExtension;W.prototype.exec=Vt.exec;W.prototype.close=Vt.close;W.prototype.defaultSafeIntegers=Vt.defaultSafeIntegers;W.prototype.unsafeMode=Vt.unsafeMode;W.prototype[Si.inspect]=Fr();jr.exports=W});var Lr=$((Bl,ss)=>{"use strict";ss.exports=Ir();ss.exports.SqliteError=ts()});function Aa(s){try{return s.close(),Promise.resolve()}catch(t){return G("Database close failed",t),Promise.reject(t instanceof Error?t:new Error("Failed to close database: Unknown error"))}}async function ki({file:s,sql:t,params:e,rowFilter:i,rowTransform:r}){let o;try{o=await Fa(s);let l=o.prepare(t).all(e),h=i?l.filter(i):l;return r?h.map(r):h}catch(n){throw G("Database query failed",n,{file:s,sql:t}),n}finally{o&&await Aa(o)}}var _r,Br,Fa,rs=C(()=>{"use strict";_r=ft(Lr(),1),Br=ft(require("lodash/memoize"),1);zt();Fa=(0,Br.default)(s=>{try{return Promise.resolve(new _r.default(s,{readonly:!0}))}catch(t){throw G("Database open failed",t,{file:s}),t}})});function Na(s){if(typeof s!="string")return!1;let t=s.trim();return t.length===0?!1:(0,$r.existsSync)(t)}async function ja(){let s=[(0,Ci.join)(re,"Default/Cookies"),(0,Ci.join)(re,"Profile */Cookies"),(0,Ci.join)(re,"Profile Default/Cookies")],t=[];for(let e of s){let i=await(0,qr.default)(e);t.push(...i)}return ut("ChromeCookies","Found cookie files",{count:t.length,files:t}),t}function Ia(s,t){let e=s==="%",i=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 ?",r=e?[`%${t}%`]:[s,`%${t}%`];return{sql:i,params:r}}async function La(s,t,e){try{let{sql:i,params:r}=Ia(t,e);ut("ChromeCookies","Executing query",{sql:i,params:r});let o=await ki({file:s,sql:i,params:r,rowTransform:n=>({name:n.name,domain:n.host_key,value:n.encrypted_value,expiry:n.expires_utc})});return ui("QueryCookies",!0,{file:s,count:o.length}),o}catch(i){return G("Failed to read cookie file",i,{file:s}),[]}}async function Wr({name:s,domain:t,file:e}){let i=typeof e=="string"&&e.length>0?[e]:await ja();if(i.length===0)return ut("ChromeCookies","No cookie files found"),[];let r=[];for(let o of i){if(!Na(o)){ut("ChromeCookies","Cookie file missing or invalid",{file:o});continue}let n=await La(o,s,t);r.push(...n)}return ut("ChromeCookies","Query complete",{totalCookies:r.length}),r}var $r,Ci,qr,Ur=C(()=>{"use strict";$r=require("fs"),Ci=require("path"),qr=ft(require("fast-glob"),1);zt();Zi();rs()});var Qr=$((Hl,Hr)=>{"use strict";Hr.exports=Gr;function Gr(s,t,e){s instanceof RegExp&&(s=zr(s,e)),t instanceof RegExp&&(t=zr(t,e));var i=Vr(s,t,e);return i&&{start:i[0],end:i[1],pre:e.slice(0,i[0]),body:e.slice(i[0]+s.length,i[1]),post:e.slice(i[1]+t.length)}}function zr(s,t){var e=t.match(s);return e?e[0]:null}Gr.range=Vr;function Vr(s,t,e){var i,r,o,n,l,h=e.indexOf(s),c=e.indexOf(t,h+1),f=h;if(h>=0&&c>0){if(s===t)return[h,c];for(i=[],o=e.length;f>=0&&!l;)f==h?(i.push(f),h=e.indexOf(s,f+1)):i.length==1?l=[i.pop(),c]:(r=i.pop(),r<o&&(o=r,n=c),c=e.indexOf(t,f+1)),f=h<c&&h>=0?h:c;i.length&&(l=[o,n])}return l}});var io=$((Ql,eo)=>{"use strict";var Kr=Qr();eo.exports=$a;var Jr="\0SLASH"+Math.random()+"\0",Yr="\0OPEN"+Math.random()+"\0",ns="\0CLOSE"+Math.random()+"\0",Zr="\0COMMA"+Math.random()+"\0",Xr="\0PERIOD"+Math.random()+"\0";function os(s){return parseInt(s,10)==s?parseInt(s,10):s.charCodeAt(0)}function _a(s){return s.split("\\\\").join(Jr).split("\\{").join(Yr).split("\\}").join(ns).split("\\,").join(Zr).split("\\.").join(Xr)}function Ba(s){return s.split(Jr).join("\\").split(Yr).join("{").split(ns).join("}").split(Zr).join(",").split(Xr).join(".")}function to(s){if(!s)return[""];var t=[],e=Kr("{","}",s);if(!e)return s.split(",");var i=e.pre,r=e.body,o=e.post,n=i.split(",");n[n.length-1]+="{"+r+"}";var l=to(o);return o.length&&(n[n.length-1]+=l.shift(),n.push.apply(n,l)),t.push.apply(t,n),t}function $a(s){return s?(s.substr(0,2)==="{}"&&(s="\\{\\}"+s.substr(2)),Te(_a(s),!0).map(Ba)):[]}function qa(s){return"{"+s+"}"}function Wa(s){return/^-?0\d/.test(s)}function Ua(s,t){return s<=t}function za(s,t){return s>=t}function Te(s,t){var e=[],i=Kr("{","}",s);if(!i)return[s];var r=i.pre,o=i.post.length?Te(i.post,!1):[""];if(/\$$/.test(i.pre))for(var n=0;n<o.length;n++){var l=r+"{"+i.body+"}"+o[n];e.push(l)}else{var h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),f=h||c,d=i.body.indexOf(",")>=0;if(!f&&!d)return i.post.match(/,.*\}/)?(s=i.pre+"{"+i.body+ns+i.post,Te(s)):[s];var m;if(f)m=i.body.split(/\.\./);else if(m=to(i.body),m.length===1&&(m=Te(m[0],!1).map(qa),m.length===1))return o.map(function(Kn){return i.pre+m[0]+Kn});var y;if(f){var v=os(m[0]),g=os(m[1]),k=Math.max(m[0].length,m[1].length),S=m.length==3?Math.abs(os(m[2])):1,T=Ua,R=g<v;R&&(S*=-1,T=za);var F=m.some(Wa);y=[];for(var J=v;T(J,g);J+=S){var tt;if(c)tt=String.fromCharCode(J),tt==="\\"&&(tt="");else if(tt=String(J),F){var Gs=k-tt.length;if(Gs>0){var Vs=new Array(Gs+1).join("0");J<0?tt="-"+Vs+tt.slice(1):tt=Vs+tt}}y.push(tt)}}else{y=[];for(var Wt=0;Wt<m.length;Wt++)y.push.apply(y,Te(m[Wt],!1))}for(var Wt=0;Wt<y.length;Wt++)for(var n=0;n<o.length;n++){var l=r+y[Wt]+o[n];(!t||f||l)&&e.push(l)}}return e}});var Re,so=C(()=>{"use strict";Re=s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>65536)throw new TypeError("pattern is too long")}});var Ga,Oe,Va,ro,oo,no=C(()=>{"use strict";Ga={"[: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]},Oe=s=>s.replace(/[[\]\\-]/g,"\\$&"),Va=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ro=s=>s.join(""),oo=(s,t)=>{let e=t;if(s.charAt(e)!=="[")throw new Error("not in a brace expression");let i=[],r=[],o=e+1,n=!1,l=!1,h=!1,c=!1,f=e,d="";t:for(;o<s.length;){let g=s.charAt(o);if((g==="!"||g==="^")&&o===e+1){c=!0,o++;continue}if(g==="]"&&n&&!h){f=o+1;break}if(n=!0,g==="\\"&&!h){h=!0,o++;continue}if(g==="["&&!h){for(let[k,[S,T,R]]of Object.entries(Ga))if(s.startsWith(k,o)){if(d)return["$.",!1,s.length-e,!0];o+=k.length,R?r.push(S):i.push(S),l=l||T;continue t}}if(h=!1,d){g>d?i.push(Oe(d)+"-"+Oe(g)):g===d&&i.push(Oe(g)),d="",o++;continue}if(s.startsWith("-]",o+1)){i.push(Oe(g+"-")),o+=2;continue}if(s.startsWith("-",o+1)){d=g,o+=2;continue}i.push(Oe(g)),o++}if(f<o)return["",!1,0,!1];if(!i.length&&!r.length)return["$.",!1,s.length-e,!0];if(r.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!c){let g=i[0].length===2?i[0].slice(-1):i[0];return[Va(g),!1,f-e,!1]}let m="["+(c?"^":"")+ro(i)+"]",y="["+(c?"":"^")+ro(r)+"]";return[i.length&&r.length?"("+m+"|"+y+")":i.length?m:y,l,f-e,!0]}});var nt,vi=C(()=>{"use strict";nt=(s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")});var Ha,ao,Qa,Ti,Ka,Ja,Ya,Za,hs,ho,lo,A,j,xt,O,M,Dt,Ht,Mt,dt,Qt,Pe,Kt,co,Ft,Ri,as,fo,V,ne,ls=C(()=>{"use strict";no();vi();Ha=new Set(["!","?","+","*","@"]),ao=s=>Ha.has(s),Qa="(?!(?:^|/)\\.\\.?(?:$|/))",Ti="(?!\\.)",Ka=new Set(["[","."]),Ja=new Set(["..","."]),Ya=new Set("().*{}+?[]^$\\!"),Za=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),hs="[^/]",ho=hs+"*?",lo=hs+"+?",V=class V{constructor(t,e,i={}){w(this,Kt);u(this,"type");w(this,A);w(this,j);w(this,xt,!1);w(this,O,[]);w(this,M);w(this,Dt);w(this,Ht);w(this,Mt,!1);w(this,dt);w(this,Qt);w(this,Pe,!1);this.type=t,t&&p(this,j,!0),p(this,M,e),p(this,A,a(this,M)?a(a(this,M),A):this),p(this,dt,a(this,A)===this?i:a(a(this,A),dt)),p(this,Ht,a(this,A)===this?[]:a(a(this,A),Ht)),t==="!"&&!a(a(this,A),Mt)&&a(this,Ht).push(this),p(this,Dt,a(this,M)?a(a(this,M),O).length:0)}get hasMagic(){if(a(this,j)!==void 0)return a(this,j);for(let t of a(this,O))if(typeof t!="string"&&(t.type||t.hasMagic))return p(this,j,!0);return a(this,j)}toString(){return a(this,Qt)!==void 0?a(this,Qt):this.type?p(this,Qt,this.type+"("+a(this,O).map(t=>String(t)).join("|")+")"):p(this,Qt,a(this,O).map(t=>String(t)).join(""))}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof V&&a(e,M)===this))throw new Error("invalid part: "+e);a(this,O).push(e)}}toJSON(){var e;let t=this.type===null?a(this,O).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...a(this,O).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===a(this,A)||a(a(this,A),Mt)&&((e=a(this,M))==null?void 0:e.type)==="!")&&t.push({}),t}isStart(){var e;if(a(this,A)===this)return!0;if(!((e=a(this,M))!=null&&e.isStart()))return!1;if(a(this,Dt)===0)return!0;let t=a(this,M);for(let i=0;i<a(this,Dt);i++){let r=a(t,O)[i];if(!(r instanceof V&&r.type==="!"))return!1}return!0}isEnd(){var e,i,r;if(a(this,A)===this||((e=a(this,M))==null?void 0:e.type)==="!")return!0;if(!((i=a(this,M))!=null&&i.isEnd()))return!1;if(!this.type)return(r=a(this,M))==null?void 0:r.isEnd();let t=a(this,M)?a(a(this,M),O).length:0;return a(this,Dt)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new V(this.type,t);for(let i of a(this,O))e.copyIn(i);return e}static fromGlob(t,e={}){var r;let i=new V(null,void 0,e);return b(r=V,Ft,Ri).call(r,t,i,0,e),i}toMMPattern(){if(this!==a(this,A))return a(this,A).toMMPattern();let t=this.toString(),[e,i,r,o]=this.toRegExpSource();if(!(r||a(this,j)||a(this,dt).nocase&&!a(this,dt).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;let l=(a(this,dt).nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${e}$`,l),{_src:e,_glob:t})}get options(){return a(this,dt)}toRegExpSource(t){var h;let e=t!=null?t:!!a(this,dt).dot;if(a(this,A)===this&&b(this,Kt,co).call(this),!this.type){let c=this.isStart()&&this.isEnd(),f=a(this,O).map(v=>{var R;let[g,k,S,T]=typeof v=="string"?b(R=V,Ft,fo).call(R,v,a(this,j),c):v.toRegExpSource(t);return p(this,j,a(this,j)||S),p(this,xt,a(this,xt)||T),g}).join(""),d="";if(this.isStart()&&typeof a(this,O)[0]=="string"&&!(a(this,O).length===1&&Ja.has(a(this,O)[0]))){let g=Ka,k=e&&g.has(f.charAt(0))||f.startsWith("\\.")&&g.has(f.charAt(2))||f.startsWith("\\.\\.")&&g.has(f.charAt(4)),S=!e&&!t&&g.has(f.charAt(0));d=k?Qa:S?Ti:""}let m="";return this.isEnd()&&a(a(this,A),Mt)&&((h=a(this,M))==null?void 0:h.type)==="!"&&(m="(?:$|\\/)"),[d+f+m,nt(f),p(this,j,!!a(this,j)),a(this,xt)]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",o=b(this,Kt,as).call(this,e);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){let c=this.toString();return p(this,O,[c]),this.type=null,p(this,j,void 0),[c,nt(this.toString()),!1,!1]}let n=!i||t||e||!Ti?"":b(this,Kt,as).call(this,!0);n===o&&(n=""),n&&(o=`(?:${o})(?:${n})*?`);let l="";if(this.type==="!"&&a(this,Pe))l=(this.isStart()&&!e?Ti:"")+lo;else{let c=this.type==="!"?"))"+(this.isStart()&&!e&&!t?Ti:"")+ho+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&n?")":this.type==="*"&&n?")?":`)${this.type}`;l=r+o+c}return[l,nt(o),p(this,j,!!a(this,j)),a(this,xt)]}};A=new WeakMap,j=new WeakMap,xt=new WeakMap,O=new WeakMap,M=new WeakMap,Dt=new WeakMap,Ht=new WeakMap,Mt=new WeakMap,dt=new WeakMap,Qt=new WeakMap,Pe=new WeakMap,Kt=new WeakSet,co=function(){if(this!==a(this,A))throw new Error("should only call on root");if(a(this,Mt))return this;this.toString(),p(this,Mt,!0);let t;for(;t=a(this,Ht).pop();){if(t.type!=="!")continue;let e=t,i=a(e,M);for(;i;){for(let r=a(e,Dt)+1;!i.type&&r<a(i,O).length;r++)for(let o of a(t,O)){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(a(i,O)[r])}e=i,i=a(e,M)}}return this},Ft=new WeakSet,Ri=function(t,e,i,r){var y,v;let o=!1,n=!1,l=-1,h=!1;if(e.type===null){let g=i,k="";for(;g<t.length;){let S=t.charAt(g++);if(o||S==="\\"){o=!o,k+=S;continue}if(n){g===l+1?(S==="^"||S==="!")&&(h=!0):S==="]"&&!(g===l+2&&h)&&(n=!1),k+=S;continue}else if(S==="["){n=!0,l=g,h=!1,k+=S;continue}if(!r.noext&&ao(S)&&t.charAt(g)==="("){e.push(k),k="";let T=new V(S,e);g=b(y=V,Ft,Ri).call(y,t,T,g,r),e.push(T);continue}k+=S}return e.push(k),g}let c=i+1,f=new V(null,e),d=[],m="";for(;c<t.length;){let g=t.charAt(c++);if(o||g==="\\"){o=!o,m+=g;continue}if(n){c===l+1?(g==="^"||g==="!")&&(h=!0):g==="]"&&!(c===l+2&&h)&&(n=!1),m+=g;continue}else if(g==="["){n=!0,l=c,h=!1,m+=g;continue}if(ao(g)&&t.charAt(c)==="("){f.push(m),m="";let k=new V(g,f);f.push(k),c=b(v=V,Ft,Ri).call(v,t,k,c,r);continue}if(g==="|"){f.push(m),m="",d.push(f),f=new V(null,e);continue}if(g===")")return m===""&&a(e,O).length===0&&p(e,Pe,!0),f.push(m),m="",e.push(...d,f),c;m+=g}return e.type=null,p(e,j,void 0),p(e,O,[t.substring(i-1)]),c},as=function(t){return a(this,O).map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[i,r,o,n]=e.toRegExpSource(t);return p(this,xt,a(this,xt)||n),i}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")},fo=function(t,e,i=!1){let r=!1,o="",n=!1;for(let l=0;l<t.length;l++){let h=t.charAt(l);if(r){r=!1,o+=(Ya.has(h)?"\\":"")+h;continue}if(h==="\\"){l===t.length-1?o+="\\\\":r=!0;continue}if(h==="["){let[c,f,d,m]=oo(t,l);if(d){o+=c,n=n||f,l+=d-1,e=e||m;continue}}if(h==="*"){i&&t==="*"?o+=lo:o+=ho,e=!0;continue}if(h==="?"){o+=hs,e=!0;continue}o+=Za(h)}return[o,nt(t),!!e,n]},w(V,Ft);ne=V});var ae,cs=C(()=>{"use strict";ae=(s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&")});var mo,H,Xa,th,eh,ih,sh,rh,oh,nh,ah,hh,lh,ch,fh,uh,ph,dh,mh,gh,go,wo,yo,uo,wh,q,yh,bh,Eh,xh,Sh,et,kh,bo,Ch,vh,po,Th,Y,At=C(()=>{"use strict";mo=ft(io(),1);so();ls();cs();vi();ls();cs();vi();H=(s,t,e={})=>(Re(t),!e.nocomment&&t.charAt(0)==="#"?!1:new Y(t,e).match(s)),Xa=/^\*+([^+@!?\*\[\(]*)$/,th=s=>t=>!t.startsWith(".")&&t.endsWith(s),eh=s=>t=>t.endsWith(s),ih=s=>(s=s.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(s)),sh=s=>(s=s.toLowerCase(),t=>t.toLowerCase().endsWith(s)),rh=/^\*+\.\*+$/,oh=s=>!s.startsWith(".")&&s.includes("."),nh=s=>s!=="."&&s!==".."&&s.includes("."),ah=/^\.\*+$/,hh=s=>s!=="."&&s!==".."&&s.startsWith("."),lh=/^\*+$/,ch=s=>s.length!==0&&!s.startsWith("."),fh=s=>s.length!==0&&s!=="."&&s!=="..",uh=/^\?+([^+@!?\*\[\(]*)?$/,ph=([s,t=""])=>{let e=go([s]);return t?(t=t.toLowerCase(),i=>e(i)&&i.toLowerCase().endsWith(t)):e},dh=([s,t=""])=>{let e=wo([s]);return t?(t=t.toLowerCase(),i=>e(i)&&i.toLowerCase().endsWith(t)):e},mh=([s,t=""])=>{let e=wo([s]);return t?i=>e(i)&&i.endsWith(t):e},gh=([s,t=""])=>{let e=go([s]);return t?i=>e(i)&&i.endsWith(t):e},go=([s])=>{let t=s.length;return e=>e.length===t&&!e.startsWith(".")},wo=([s])=>{let t=s.length;return e=>e.length===t&&e!=="."&&e!==".."},yo=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",uo={win32:{sep:"\\"},posix:{sep:"/"}},wh=yo==="win32"?uo.win32.sep:uo.posix.sep;H.sep=wh;q=Symbol("globstar **");H.GLOBSTAR=q;yh="[^/]",bh=yh+"*?",Eh="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",xh="(?:(?!(?:\\/|^)\\.).)*?",Sh=(s,t={})=>e=>H(e,s,t);H.filter=Sh;et=(s,t={})=>Object.assign({},s,t),kh=s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return H;let t=H;return Object.assign((i,r,o={})=>t(i,r,et(s,o)),{Minimatch:class extends t.Minimatch{constructor(r,o={}){super(r,et(s,o))}static defaults(r){return t.defaults(et(s,r)).Minimatch}},AST:class extends t.AST{constructor(r,o,n={}){super(r,o,et(s,n))}static fromGlob(r,o={}){return t.AST.fromGlob(r,et(s,o))}},unescape:(i,r={})=>t.unescape(i,et(s,r)),escape:(i,r={})=>t.escape(i,et(s,r)),filter:(i,r={})=>t.filter(i,et(s,r)),defaults:i=>t.defaults(et(s,i)),makeRe:(i,r={})=>t.makeRe(i,et(s,r)),braceExpand:(i,r={})=>t.braceExpand(i,et(s,r)),match:(i,r,o={})=>t.match(i,r,et(s,o)),sep:t.sep,GLOBSTAR:q})};H.defaults=kh;bo=(s,t={})=>(Re(s),t.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:(0,mo.default)(s));H.braceExpand=bo;Ch=(s,t={})=>new Y(s,t).makeRe();H.makeRe=Ch;vh=(s,t,e={})=>{let i=new Y(t,e);return s=s.filter(r=>i.match(r)),i.options.nonull&&!s.length&&s.push(t),s};H.match=vh;po=/[?*]|[+@!]\(.*?\)|\[|\]/,Th=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Y=class{constructor(t,e={}){u(this,"options");u(this,"set");u(this,"pattern");u(this,"windowsPathsNoEscape");u(this,"nonegate");u(this,"negate");u(this,"comment");u(this,"empty");u(this,"preserveMultipleSlashes");u(this,"partial");u(this,"globSet");u(this,"globParts");u(this,"nocase");u(this,"isWindows");u(this,"platform");u(this,"windowsNoMagicRoot");u(this,"regexp");Re(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||yo,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 i=this.globSet.map(o=>this.slashSplit(o));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let r=this.globParts.map((o,n,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=o[0]===""&&o[1]===""&&(o[2]==="?"||!po.test(o[2]))&&!po.test(o[3]),c=/^[a-z]:/i.test(o[0]);if(h)return[...o.slice(0,4),...o.slice(4).map(f=>this.parse(f))];if(c)return[o[0],...o.slice(1).map(f=>this.parse(f))]}return o.map(h=>this.parse(h))});if(this.debug(this.pattern,r),this.set=r.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 i=0;i<t.length;i++)for(let r=0;r<t[i].length;r++)t[i][r]==="**"&&(t[i][r]="*");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 i=-1;for(;(i=e.indexOf("**",i+1))!==-1;){let r=i;for(;e[r+1]==="**";)r++;r!==i&&e.splice(i,r-i)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((i,r)=>{let o=i[i.length-1];return r==="**"&&o==="**"?i:r===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(i.pop(),i):(i.push(r),i)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let o=t[r];r===1&&o===""&&t[0]===""||(o==="."||o==="")&&(e=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){let r=t[i-1];r&&r!=="."&&r!==".."&&r!=="**"&&(e=!0,t.splice(i-1,2),i-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let i of t){let r=-1;for(;(r=i.indexOf("**",r+1))!==-1;){let n=r;for(;i[n+1]==="**";)n++;n>r&&i.splice(r+1,n-r);let l=i[r+1],h=i[r+2],c=i[r+3];if(l!==".."||!h||h==="."||h===".."||!c||c==="."||c==="..")continue;e=!0,i.splice(r,1);let f=i.slice(0);f[r]="**",t.push(f),r--}if(!this.preserveMultipleSlashes){for(let n=1;n<i.length-1;n++){let l=i[n];n===1&&l===""&&i[0]===""||(l==="."||l==="")&&(e=!0,i.splice(n,1),n--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(e=!0,i.pop())}let o=0;for(;(o=i.indexOf("..",o+1))!==-1;){let n=i[o-1];if(n&&n!=="."&&n!==".."&&n!=="**"){e=!0;let h=o===1&&i[o+1]==="**"?["."]:[];i.splice(o-1,2,...h),i.length===0&&i.push(""),o-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let i=e+1;i<t.length;i++){let r=this.partsMatch(t[e],t[i],!this.preserveMultipleSlashes);if(r){t[e]=[],t[i]=r;break}}return t.filter(e=>e.length)}partsMatch(t,e,i=!1){let r=0,o=0,n=[],l="";for(;r<t.length&&o<e.length;)if(t[r]===e[o])n.push(l==="b"?e[o]:t[r]),r++,o++;else if(i&&t[r]==="**"&&e[o]===t[r+1])n.push(t[r]),r++;else if(i&&e[o]==="**"&&t[r]===e[o+1])n.push(e[o]),o++;else if(t[r]==="*"&&e[o]&&(this.options.dot||!e[o].startsWith("."))&&e[o]!=="**"){if(l==="b")return!1;l="a",n.push(t[r]),r++,o++}else if(e[o]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(l==="a")return!1;l="b",n.push(e[o]),r++,o++}else return!1;return t.length===e.length&&n}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,i=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)e=!e,i++;i&&(this.pattern=t.slice(i)),this.negate=e}matchOne(t,e,i=!1){let r=this.options;if(this.isWindows){let g=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),k=!g&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),S=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),T=!S&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),R=k?3:g?0:void 0,F=T?3:S?0:void 0;if(typeof R=="number"&&typeof F=="number"){let[J,tt]=[t[R],e[F]];J.toLowerCase()===tt.toLowerCase()&&(e[F]=J,F>R?e=e.slice(F):R>F&&(t=t.slice(R)))}}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,l=0,h=t.length,c=e.length;n<h&&l<c;n++,l++){this.debug("matchOne loop");var f=e[l],d=t[n];if(this.debug(e,f,d),f===!1)return!1;if(f===q){this.debug("GLOBSTAR",[e,f,d]);var m=n,y=l+1;if(y===c){for(this.debug("** at the end");n<h;n++)if(t[n]==="."||t[n]===".."||!r.dot&&t[n].charAt(0)===".")return!1;return!0}for(;m<h;){var v=t[m];if(this.debug(`
4
- globstar while`,t,m,e,y,v),this.matchOne(t.slice(m),e.slice(y),i))return this.debug("globstar found match!",m,h,v),!0;if(v==="."||v===".."||!r.dot&&v.charAt(0)==="."){this.debug("dot detected!",t,m,e,y);break}this.debug("globstar swallow a segment, and continue"),m++}return!!(i&&(this.debug(`
5
- >>> no match, partial?`,t,m,e,y),m===h))}let g;if(typeof f=="string"?(g=d===f,this.debug("string match",f,d,g)):(g=f.test(d),this.debug("pattern match",f,d,g)),!g)return!1}if(n===h&&l===c)return!0;if(n===h)return i;if(l===c)return n===h-1&&t[n]==="";throw new Error("wtf?")}braceExpand(){return bo(this.pattern,this.options)}parse(t){Re(t);let e=this.options;if(t==="**")return q;if(t==="")return"";let i,r=null;(i=t.match(lh))?r=e.dot?fh:ch:(i=t.match(Xa))?r=(e.nocase?e.dot?sh:ih:e.dot?eh:th)(i[1]):(i=t.match(uh))?r=(e.nocase?e.dot?dh:ph:e.dot?mh:gh)(i):(i=t.match(rh))?r=e.dot?nh:oh:(i=t.match(ah))&&(r=hh);let o=ne.fromGlob(t,this.options).toMMPattern();return r&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:r}),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,i=e.noglobstar?bh:e.dot?Eh:xh,r=new Set(e.nocase?["i"]:[]),o=t.map(h=>{let c=h.map(f=>{if(f instanceof RegExp)for(let d of f.flags.split(""))r.add(d);return typeof f=="string"?Th(f):f===q?q:f._src});return c.forEach((f,d)=>{let m=c[d+1],y=c[d-1];f!==q||y===q||(y===void 0?m!==void 0&&m!==q?c[d+1]="(?:\\/|"+i+"\\/)?"+m:c[d]=i:m===void 0?c[d-1]=y+"(?:\\/|"+i+")?":m!==q&&(c[d-1]=y+"(?:\\/|\\/"+i+"\\/)"+m,c[d+1]=q))}),c.filter(f=>f!==q).join("/")}).join("|"),[n,l]=t.length>1?["(?:",")"]:["",""];o="^"+n+o+l+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...r].join(""))}catch(h){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 i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let o=this.set;this.debug(this.pattern,"set",o);let n=r[r.length-1];if(!n)for(let l=r.length-2;!n&&l>=0;l--)n=r[l];for(let l=0;l<o.length;l++){let h=o[l],c=r;if(i.matchBase&&h.length===1&&(c=[n]),this.matchOne(c,h,e))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return H.defaults(t).Minimatch}};H.AST=ne;H.Minimatch=Y;H.escape=ae;H.unescape=nt});var Ni,ws,Uo,Eo,Rh,Oh,Ph,St,kt,Nt,Oi,De,Pi,xo,Di,So,at,he,I,Me,le,L,Q,_,fs,Mi,U,P,us,ps,ko,ds,mt,ms,Fi,Fe,Jt,Z,Ae,Dh,Mh,Fh,Ah,Ai,gs,Nh,jh,Co,vo,To,Ro,Oo,Po,Do,Mo,Fo,Ao,No,jo,Io,Lo,_o,Bo,$o,qo,Wo,jt,ys=C(()=>{"use strict";Ni=require("events"),ws=ft(require("stream"),1),Uo=require("string_decoder"),Eo=typeof process=="object"&&process?process:{stdout:null,stderr:null},Rh=s=>!!s&&typeof s=="object"&&(s instanceof jt||s instanceof ws.default||Oh(s)||Ph(s)),Oh=s=>!!s&&typeof s=="object"&&s instanceof Ni.EventEmitter&&typeof s.pipe=="function"&&s.pipe!==ws.default.Writable.prototype.pipe,Ph=s=>!!s&&typeof s=="object"&&s instanceof Ni.EventEmitter&&typeof s.write=="function"&&typeof s.end=="function",St=Symbol("EOF"),kt=Symbol("maybeEmitEnd"),Nt=Symbol("emittedEnd"),Oi=Symbol("emittingEnd"),De=Symbol("emittedError"),Pi=Symbol("closed"),xo=Symbol("read"),Di=Symbol("flush"),So=Symbol("flushChunk"),at=Symbol("encoding"),he=Symbol("decoder"),I=Symbol("flowing"),Me=Symbol("paused"),le=Symbol("resume"),L=Symbol("buffer"),Q=Symbol("pipes"),_=Symbol("bufferLength"),fs=Symbol("bufferPush"),Mi=Symbol("bufferShift"),U=Symbol("objectMode"),P=Symbol("destroyed"),us=Symbol("error"),ps=Symbol("emitData"),ko=Symbol("emitEnd"),ds=Symbol("emitEnd2"),mt=Symbol("async"),ms=Symbol("abort"),Fi=Symbol("aborted"),Fe=Symbol("signal"),Jt=Symbol("dataListeners"),Z=Symbol("discarded"),Ae=s=>Promise.resolve().then(s),Dh=s=>s(),Mh=s=>s==="end"||s==="finish"||s==="prefinish",Fh=s=>s instanceof ArrayBuffer||!!s&&typeof s=="object"&&s.constructor&&s.constructor.name==="ArrayBuffer"&&s.byteLength>=0,Ah=s=>!Buffer.isBuffer(s)&&ArrayBuffer.isView(s),Ai=class{constructor(t,e,i){u(this,"src");u(this,"dest");u(this,"opts");u(this,"ondrain");this.src=t,this.dest=e,this.opts=i,this.ondrain=()=>t[le](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},gs=class extends Ai{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,i){super(t,e,i),this.proxyErrors=r=>e.emit("error",r),t.on("error",this.proxyErrors)}},Nh=s=>!!s.objectMode,jh=s=>!s.objectMode&&!!s.encoding&&s.encoding!=="buffer",jt=class extends Ni.EventEmitter{constructor(...e){let i=e[0]||{};super();u(this,Wo,!1);u(this,qo,!1);u(this,$o,[]);u(this,Bo,[]);u(this,_o);u(this,Lo);u(this,Io);u(this,jo);u(this,No,!1);u(this,Ao,!1);u(this,Fo,!1);u(this,Mo,!1);u(this,Do,null);u(this,Po,0);u(this,Oo,!1);u(this,Ro);u(this,To,!1);u(this,vo,0);u(this,Co,!1);u(this,"writable",!0);u(this,"readable",!0);if(i.objectMode&&typeof i.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Nh(i)?(this[U]=!0,this[at]=null):jh(i)?(this[at]=i.encoding,this[U]=!1):(this[U]=!1,this[at]=null),this[mt]=!!i.async,this[he]=this[at]?new Uo.StringDecoder(this[at]):null,i&&i.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[L]}),i&&i.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Q]});let{signal:r}=i;r&&(this[Fe]=r,r.aborted?this[ms]():r.addEventListener("abort",()=>this[ms]()))}get bufferLength(){return this[_]}get encoding(){return this[at]}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[U]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[mt]}set async(e){this[mt]=this[mt]||!!e}[(Wo=I,qo=Me,$o=Q,Bo=L,_o=U,Lo=at,Io=mt,jo=he,No=St,Ao=Nt,Fo=Oi,Mo=Pi,Do=De,Po=_,Oo=P,Ro=Fe,To=Fi,vo=Jt,Co=Z,ms)](){var e,i;this[Fi]=!0,this.emit("abort",(e=this[Fe])==null?void 0:e.reason),this.destroy((i=this[Fe])==null?void 0:i.reason)}get aborted(){return this[Fi]}set aborted(e){}write(e,i,r){var n;if(this[Fi])return!1;if(this[St])throw new Error("write after end");if(this[P])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof i=="function"&&(r=i,i="utf8"),i||(i="utf8");let o=this[mt]?Ae:Dh;if(!this[U]&&!Buffer.isBuffer(e)){if(Ah(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Fh(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[U]?(this[I]&&this[_]!==0&&this[Di](!0),this[I]?this.emit("data",e):this[fs](e),this[_]!==0&&this.emit("readable"),r&&o(r),this[I]):e.length?(typeof e=="string"&&!(i===this[at]&&!((n=this[he])!=null&&n.lastNeed))&&(e=Buffer.from(e,i)),Buffer.isBuffer(e)&&this[at]&&(e=this[he].write(e)),this[I]&&this[_]!==0&&this[Di](!0),this[I]?this.emit("data",e):this[fs](e),this[_]!==0&&this.emit("readable"),r&&o(r),this[I]):(this[_]!==0&&this.emit("readable"),r&&o(r),this[I])}read(e){if(this[P])return null;if(this[Z]=!1,this[_]===0||e===0||e&&e>this[_])return this[kt](),null;this[U]&&(e=null),this[L].length>1&&!this[U]&&(this[L]=[this[at]?this[L].join(""):Buffer.concat(this[L],this[_])]);let i=this[xo](e||null,this[L][0]);return this[kt](),i}[xo](e,i){if(this[U])this[Mi]();else{let r=i;e===r.length||e===null?this[Mi]():typeof r=="string"?(this[L][0]=r.slice(e),i=r.slice(0,e),this[_]-=e):(this[L][0]=r.subarray(e),i=r.subarray(0,e),this[_]-=e)}return this.emit("data",i),!this[L].length&&!this[St]&&this.emit("drain"),i}end(e,i,r){return typeof e=="function"&&(r=e,e=void 0),typeof i=="function"&&(r=i,i="utf8"),e!==void 0&&this.write(e,i),r&&this.once("end",r),this[St]=!0,this.writable=!1,(this[I]||!this[Me])&&this[kt](),this}[le](){this[P]||(!this[Jt]&&!this[Q].length&&(this[Z]=!0),this[Me]=!1,this[I]=!0,this.emit("resume"),this[L].length?this[Di]():this[St]?this[kt]():this.emit("drain"))}resume(){return this[le]()}pause(){this[I]=!1,this[Me]=!0,this[Z]=!1}get destroyed(){return this[P]}get flowing(){return this[I]}get paused(){return this[Me]}[fs](e){this[U]?this[_]+=1:this[_]+=e.length,this[L].push(e)}[Mi](){return this[U]?this[_]-=1:this[_]-=this[L][0].length,this[L].shift()}[Di](e=!1){do;while(this[So](this[Mi]())&&this[L].length);!e&&!this[L].length&&!this[St]&&this.emit("drain")}[So](e){return this.emit("data",e),this[I]}pipe(e,i){if(this[P])return e;this[Z]=!1;let r=this[Nt];return i=i||{},e===Eo.stdout||e===Eo.stderr?i.end=!1:i.end=i.end!==!1,i.proxyErrors=!!i.proxyErrors,r?i.end&&e.end():(this[Q].push(i.proxyErrors?new gs(this,e,i):new Ai(this,e,i)),this[mt]?Ae(()=>this[le]()):this[le]()),e}unpipe(e){let i=this[Q].find(r=>r.dest===e);i&&(this[Q].length===1?(this[I]&&this[Jt]===0&&(this[I]=!1),this[Q]=[]):this[Q].splice(this[Q].indexOf(i),1),i.unpipe())}addListener(e,i){return this.on(e,i)}on(e,i){let r=super.on(e,i);if(e==="data")this[Z]=!1,this[Jt]++,!this[Q].length&&!this[I]&&this[le]();else if(e==="readable"&&this[_]!==0)super.emit("readable");else if(Mh(e)&&this[Nt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[De]){let o=i;this[mt]?Ae(()=>o.call(this,this[De])):o.call(this,this[De])}return r}removeListener(e,i){return this.off(e,i)}off(e,i){let r=super.off(e,i);return e==="data"&&(this[Jt]=this.listeners("data").length,this[Jt]===0&&!this[Z]&&!this[Q].length&&(this[I]=!1)),r}removeAllListeners(e){let i=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Jt]=0,!this[Z]&&!this[Q].length&&(this[I]=!1)),i}get emittedEnd(){return this[Nt]}[kt](){!this[Oi]&&!this[Nt]&&!this[P]&&this[L].length===0&&this[St]&&(this[Oi]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Pi]&&this.emit("close"),this[Oi]=!1)}emit(e,...i){let r=i[0];if(e!=="error"&&e!=="close"&&e!==P&&this[P])return!1;if(e==="data")return!this[U]&&!r?!1:this[mt]?(Ae(()=>this[ps](r)),!0):this[ps](r);if(e==="end")return this[ko]();if(e==="close"){if(this[Pi]=!0,!this[Nt]&&!this[P])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[De]=r,super.emit(us,r);let n=!this[Fe]||this.listeners("error").length?super.emit("error",r):!1;return this[kt](),n}else if(e==="resume"){let n=super.emit("resume");return this[kt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let o=super.emit(e,...i);return this[kt](),o}[ps](e){for(let r of this[Q])r.dest.write(e)===!1&&this.pause();let i=this[Z]?!1:super.emit("data",e);return this[kt](),i}[ko](){return this[Nt]?!1:(this[Nt]=!0,this.readable=!1,this[mt]?(Ae(()=>this[ds]()),!0):this[ds]())}[ds](){if(this[he]){let i=this[he].end();if(i){for(let r of this[Q])r.dest.write(i);this[Z]||super.emit("data",i)}}for(let i of this[Q])i.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[U]||(e.dataLength=0);let i=this.promise();return this.on("data",r=>{e.push(r),this[U]||(e.dataLength+=r.length)}),await i,e}async concat(){if(this[U])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[at]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,i)=>{this.on(P,()=>i(new Error("stream destroyed"))),this.on("error",r=>i(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Z]=!1;let e=!1,i=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return i();let o=this.read();if(o!==null)return Promise.resolve({done:!1,value:o});if(this[St])return i();let n,l,h=m=>{this.off("data",c),this.off("end",f),this.off(P,d),i(),l(m)},c=m=>{this.off("error",h),this.off("end",f),this.off(P,d),this.pause(),n({value:m,done:!!this[St]})},f=()=>{this.off("error",h),this.off("data",c),this.off(P,d),i(),n({done:!0,value:void 0})},d=()=>h(new Error("stream destroyed"));return new Promise((m,y)=>{l=y,n=m,this.once(P,d),this.once("error",h),this.once("end",f),this.once("data",c)})},throw:i,return:i,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Z]=!1;let e=!1,i=()=>(this.pause(),this.off(us,i),this.off(P,i),this.off("end",i),e=!0,{done:!0,value:void 0}),r=()=>{if(e)return i();let o=this.read();return o===null?i():{done:!1,value:o}};return this.once("end",i),this.once(us,i),this.once(P,i),{next:r,throw:i,return:i,[Symbol.iterator](){return this}}}destroy(e){if(this[P])return e?this.emit("error",e):this.emit(P),this;this[P]=!0,this[Z]=!0,this[L].length=0,this[_]=0;let i=this;return typeof i.close=="function"&&!this[Pi]&&i.close(),e?this.emit("error",e):this.emit(P),this}static get isStream(){return Rh}}});var Os,de,Qo,bt,Ih,Lt,Lh,je,Ko,Jo,_h,Bh,st,Yo,Zo,gt,Xo,tn,Yt,en,it,Ne,bs,zo,Ie,ht,ji,Li,Go,$h,Es,Vo,Le,Ho,Ii,qi,xs,sn,K,qe,We,Ue,ze,Ge,Ve,He,Qe,Ke,Je,Ye,Ze,Xe,ti,ei,ii,si,ri,It,Zt,wt,Ct,vt,Tt,x,Xt,Rt,yt,E,Ss,_i,_e,ks,Cs,Be,Bi,vs,Ts,$i,rn,on,nn,Rs,ce,fe,an,te,z,Wi,Ui,ue,pe,oi,ni,zi,me,ge,$e,wc,hn,ln=C(()=>{"use strict";Os=require("lru-cache"),de=require("path"),Qo=require("url"),bt=require("fs"),Ih=ft(require("fs"),1),Lt=require("fs/promises");ys();Lh=bt.realpathSync.native,je={lstatSync:bt.lstatSync,readdir:bt.readdir,readdirSync:bt.readdirSync,readlinkSync:bt.readlinkSync,realpathSync:Lh,promises:{lstat:Lt.lstat,readdir:Lt.readdir,readlink:Lt.readlink,realpath:Lt.realpath}},Ko=s=>!s||s===je||s===Ih?je:{...je,...s,promises:{...je.promises,...s.promises||{}}},Jo=/^\\\\\?\\([a-z]:)\\?$/i,_h=s=>s.replace(/\//g,"\\").replace(Jo,"$1\\"),Bh=/[\\\/]/,st=0,Yo=1,Zo=2,gt=4,Xo=6,tn=8,Yt=10,en=12,it=15,Ne=~it,bs=16,zo=32,Ie=64,ht=128,ji=256,Li=512,Go=Ie|ht|Li,$h=1023,Es=s=>s.isFile()?tn:s.isDirectory()?gt:s.isSymbolicLink()?Yt:s.isCharacterDevice()?Zo:s.isBlockDevice()?Xo:s.isSocket()?en:s.isFIFO()?Yo:st,Vo=new Map,Le=s=>{let t=Vo.get(s);if(t)return t;let e=s.normalize("NFKD");return Vo.set(s,e),e},Ho=new Map,Ii=s=>{let t=Ho.get(s);if(t)return t;let e=Le(s.toLowerCase());return Ho.set(s,e),e},qi=class extends Os.LRUCache{constructor(){super({max:256})}},xs=class extends Os.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},sn=Symbol("PathScurry setAsCwd"),z=class{constructor(t,e=st,i,r,o,n,l){w(this,E);u(this,"name");u(this,"root");u(this,"roots");u(this,"parent");u(this,"nocase");u(this,"isCWD",!1);w(this,K);w(this,qe);w(this,We);w(this,Ue);w(this,ze);w(this,Ge);w(this,Ve);w(this,He);w(this,Qe);w(this,Ke);w(this,Je);w(this,Ye);w(this,Ze);w(this,Xe);w(this,ti);w(this,ei);w(this,ii);w(this,si);w(this,ri);w(this,It);w(this,Zt);w(this,wt);w(this,Ct);w(this,vt);w(this,Tt);w(this,x);w(this,Xt);w(this,Rt);w(this,yt);w(this,ce,[]);w(this,fe,!1);w(this,te);this.name=t,p(this,It,o?Ii(t):Le(t)),p(this,x,e&$h),this.nocase=o,this.roots=r,this.root=i||this,p(this,Xt,n),p(this,wt,l.fullpath),p(this,vt,l.relative),p(this,Tt,l.relativePosix),this.parent=l.parent,this.parent?p(this,K,a(this.parent,K)):p(this,K,Ko(l.fs))}get dev(){return a(this,qe)}get mode(){return a(this,We)}get nlink(){return a(this,Ue)}get uid(){return a(this,ze)}get gid(){return a(this,Ge)}get rdev(){return a(this,Ve)}get blksize(){return a(this,He)}get ino(){return a(this,Qe)}get size(){return a(this,Ke)}get blocks(){return a(this,Je)}get atimeMs(){return a(this,Ye)}get mtimeMs(){return a(this,Ze)}get ctimeMs(){return a(this,Xe)}get birthtimeMs(){return a(this,ti)}get atime(){return a(this,ei)}get mtime(){return a(this,ii)}get ctime(){return a(this,si)}get birthtime(){return a(this,ri)}get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return a(this,Zt)!==void 0?a(this,Zt):this.parent?p(this,Zt,this.parent.depth()+1):p(this,Zt,0)}childrenCache(){return a(this,Xt)}resolve(t){var n;if(!t)return this;let e=this.getRootString(t),r=t.substring(e.length).split(this.splitSep);return e?b(n=this.getRoot(e),E,Ss).call(n,r):b(this,E,Ss).call(this,r)}children(){let t=a(this,Xt).get(this);if(t)return t;let e=Object.assign([],{provisional:0});return a(this,Xt).set(this,e),p(this,x,a(this,x)&~bs),e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let i=this.children(),r=this.nocase?Ii(t):Le(t);for(let h of i)if(a(h,It)===r)return h;let o=this.parent?this.sep:"",n=a(this,wt)?a(this,wt)+o+t:void 0,l=this.newChild(t,st,{...e,parent:this,fullpath:n});return this.canReaddir()||p(l,x,a(l,x)|ht),i.push(l),l}relative(){if(this.isCWD)return"";if(a(this,vt)!==void 0)return a(this,vt);let t=this.name,e=this.parent;if(!e)return p(this,vt,this.name);let i=e.relative();return i+(!i||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(a(this,Tt)!==void 0)return a(this,Tt);let t=this.name,e=this.parent;if(!e)return p(this,Tt,this.fullpathPosix());let i=e.relativePosix();return i+(!i||!e.parent?"":"/")+t}fullpath(){if(a(this,wt)!==void 0)return a(this,wt);let t=this.name,e=this.parent;if(!e)return p(this,wt,this.name);let r=e.fullpath()+(e.parent?this.sep:"")+t;return p(this,wt,r)}fullpathPosix(){if(a(this,Ct)!==void 0)return a(this,Ct);if(this.sep==="/")return p(this,Ct,this.fullpath());if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?p(this,Ct,`//?/${r}`):p(this,Ct,r)}let t=this.parent,e=t.fullpathPosix(),i=e+(!e||!t.parent?"":"/")+this.name;return p(this,Ct,i)}isUnknown(){return(a(this,x)&it)===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,x)&it)===tn}isDirectory(){return(a(this,x)&it)===gt}isCharacterDevice(){return(a(this,x)&it)===Zo}isBlockDevice(){return(a(this,x)&it)===Xo}isFIFO(){return(a(this,x)&it)===Yo}isSocket(){return(a(this,x)&it)===en}isSymbolicLink(){return(a(this,x)&Yt)===Yt}lstatCached(){return a(this,x)&zo?this:void 0}readlinkCached(){return a(this,Rt)}realpathCached(){return a(this,yt)}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(a(this,Rt))return!0;if(!this.parent)return!1;let t=a(this,x)&it;return!(t!==st&&t!==Yt||a(this,x)&ji||a(this,x)&ht)}calledReaddir(){return!!(a(this,x)&bs)}isENOENT(){return!!(a(this,x)&ht)}isNamed(t){return this.nocase?a(this,It)===Ii(t):a(this,It)===Le(t)}async readlink(){var e;let t=a(this,Rt);if(t)return t;if(this.canReadlink()&&this.parent)try{let i=await a(this,K).promises.readlink(this.fullpath()),r=(e=await this.parent.realpath())==null?void 0:e.resolve(i);if(r)return p(this,Rt,r)}catch(i){b(this,E,Ts).call(this,i.code);return}}readlinkSync(){var e;let t=a(this,Rt);if(t)return t;if(this.canReadlink()&&this.parent)try{let i=a(this,K).readlinkSync(this.fullpath()),r=(e=this.parent.realpathSync())==null?void 0:e.resolve(i);if(r)return p(this,Rt,r)}catch(i){b(this,E,Ts).call(this,i.code);return}}async lstat(){if(!(a(this,x)&ht))try{return b(this,E,Rs).call(this,await a(this,K).promises.lstat(this.fullpath())),this}catch(t){b(this,E,vs).call(this,t.code)}}lstatSync(){if(!(a(this,x)&ht))try{return b(this,E,Rs).call(this,a(this,K).lstatSync(this.fullpath())),this}catch(t){b(this,E,vs).call(this,t.code)}}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let i=this.children();if(this.calledReaddir()){let o=i.slice(0,i.provisional);e?t(null,o):queueMicrotask(()=>t(null,o));return}if(a(this,ce).push(t),a(this,fe))return;p(this,fe,!0);let r=this.fullpath();a(this,K).readdir(r,{withFileTypes:!0},(o,n)=>{if(o)b(this,E,Bi).call(this,o.code),i.provisional=0;else{for(let l of n)b(this,E,$i).call(this,l,i);b(this,E,_i).call(this,i)}b(this,E,an).call(this,i.slice(0,i.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,te))await a(this,te);else{let i=()=>{};p(this,te,new Promise(r=>i=r));try{for(let r of await a(this,K).promises.readdir(e,{withFileTypes:!0}))b(this,E,$i).call(this,r,t);b(this,E,_i).call(this,t)}catch(r){b(this,E,Bi).call(this,r.code),t.provisional=0}p(this,te,void 0),i()}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 i of a(this,K).readdirSync(e,{withFileTypes:!0}))b(this,E,$i).call(this,i,t);b(this,E,_i).call(this,t)}catch(i){b(this,E,Bi).call(this,i.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(a(this,x)&Go)return!1;let t=it&a(this,x);return t===st||t===gt||t===Yt}shouldWalk(t,e){return(a(this,x)&gt)===gt&&!(a(this,x)&Go)&&!t.has(this)&&(!e||e(this))}async realpath(){if(a(this,yt))return a(this,yt);if(!((Li|ji|ht)&a(this,x)))try{let t=await a(this,K).promises.realpath(this.fullpath());return p(this,yt,this.resolve(t))}catch(t){b(this,E,Cs).call(this)}}realpathSync(){if(a(this,yt))return a(this,yt);if(!((Li|ji|ht)&a(this,x)))try{let t=a(this,K).realpathSync(this.fullpath());return p(this,yt,this.resolve(t))}catch(t){b(this,E,Cs).call(this)}}[sn](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),i=[],r=this;for(;r&&r.parent;)e.add(r),p(r,vt,i.join(this.sep)),p(r,Tt,i.join("/")),r=r.parent,i.push("..");for(r=t;r&&r.parent&&!e.has(r);)p(r,vt,void 0),p(r,Tt,void 0),r=r.parent}};K=new WeakMap,qe=new WeakMap,We=new WeakMap,Ue=new WeakMap,ze=new WeakMap,Ge=new WeakMap,Ve=new WeakMap,He=new WeakMap,Qe=new WeakMap,Ke=new WeakMap,Je=new WeakMap,Ye=new WeakMap,Ze=new WeakMap,Xe=new WeakMap,ti=new WeakMap,ei=new WeakMap,ii=new WeakMap,si=new WeakMap,ri=new WeakMap,It=new WeakMap,Zt=new WeakMap,wt=new WeakMap,Ct=new WeakMap,vt=new WeakMap,Tt=new WeakMap,x=new WeakMap,Xt=new WeakMap,Rt=new WeakMap,yt=new WeakMap,E=new WeakSet,Ss=function(t){let e=this;for(let i of t)e=e.child(i);return e},_i=function(t){var e;p(this,x,a(this,x)|bs);for(let i=t.provisional;i<t.length;i++){let r=t[i];r&&b(e=r,E,_e).call(e)}},_e=function(){a(this,x)&ht||(p(this,x,(a(this,x)|ht)&Ne),b(this,E,ks).call(this))},ks=function(){var e;let t=this.children();t.provisional=0;for(let i of t)b(e=i,E,_e).call(e)},Cs=function(){p(this,x,a(this,x)|Li),b(this,E,Be).call(this)},Be=function(){if(a(this,x)&Ie)return;let t=a(this,x);(t&it)===gt&&(t&=Ne),p(this,x,t|Ie),b(this,E,ks).call(this)},Bi=function(t=""){t==="ENOTDIR"||t==="EPERM"?b(this,E,Be).call(this):t==="ENOENT"?b(this,E,_e).call(this):this.children().provisional=0},vs=function(t=""){var e;if(t==="ENOTDIR"){let i=this.parent;b(e=i,E,Be).call(e)}else t==="ENOENT"&&b(this,E,_e).call(this)},Ts=function(t=""){var i;let e=a(this,x);e|=ji,t==="ENOENT"&&(e|=ht),(t==="EINVAL"||t==="UNKNOWN")&&(e&=Ne),p(this,x,e),t==="ENOTDIR"&&this.parent&&b(i=this.parent,E,Be).call(i)},$i=function(t,e){return b(this,E,on).call(this,t,e)||b(this,E,rn).call(this,t,e)},rn=function(t,e){let i=Es(t),r=this.newChild(t.name,i,{parent:this}),o=a(r,x)&it;return o!==gt&&o!==Yt&&o!==st&&p(r,x,a(r,x)|Ie),e.unshift(r),e.provisional++,r},on=function(t,e){for(let i=e.provisional;i<e.length;i++){let r=e[i];if((this.nocase?Ii(t.name):Le(t.name))===a(r,It))return b(this,E,nn).call(this,t,r,i,e)}},nn=function(t,e,i,r){let o=e.name;return p(e,x,a(e,x)&Ne|Es(t)),o!==t.name&&(e.name=t.name),i!==r.provisional&&(i===r.length-1?r.pop():r.splice(i,1),r.unshift(e)),r.provisional++,e},Rs=function(t){let{atime:e,atimeMs:i,birthtime:r,birthtimeMs:o,blksize:n,blocks:l,ctime:h,ctimeMs:c,dev:f,gid:d,ino:m,mode:y,mtime:v,mtimeMs:g,nlink:k,rdev:S,size:T,uid:R}=t;p(this,ei,e),p(this,Ye,i),p(this,ri,r),p(this,ti,o),p(this,He,n),p(this,Je,l),p(this,si,h),p(this,Xe,c),p(this,qe,f),p(this,Ge,d),p(this,Qe,m),p(this,We,y),p(this,ii,v),p(this,Ze,g),p(this,Ue,k),p(this,Ve,S),p(this,Ke,T),p(this,ze,R);let F=Es(t);p(this,x,a(this,x)&Ne|F|zo),F!==st&&F!==gt&&F!==Yt&&p(this,x,a(this,x)|Ie)},ce=new WeakMap,fe=new WeakMap,an=function(t){p(this,fe,!1);let e=a(this,ce).slice();a(this,ce).length=0,e.forEach(i=>i(null,t))},te=new WeakMap;Wi=class s extends z{constructor(e,i=st,r,o,n,l,h){super(e,i,r,o,n,l,h);u(this,"sep","\\");u(this,"splitSep",Bh)}newChild(e,i=st,r={}){return new s(e,i,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return de.win32.parse(e).root}getRoot(e){if(e=_h(e.toUpperCase()),e===this.root.name)return this.root;for(let[i,r]of Object.entries(this.roots))if(this.sameRoot(e,i))return this.roots[e]=r;return this.roots[e]=new me(e,this).root}sameRoot(e,i=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Jo,"$1\\"),e===i}},Ui=class s extends z{constructor(e,i=st,r,o,n,l,h){super(e,i,r,o,n,l,h);u(this,"splitSep","/");u(this,"sep","/")}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,i=st,r={}){return new s(e,i,this.root,this.roots,this.nocase,this.childrenCache(),r)}},zi=class{constructor(t=process.cwd(),e,i,{nocase:r,childrenCacheSize:o=16*1024,fs:n=je}={}){u(this,"root");u(this,"rootPath");u(this,"roots");u(this,"cwd");w(this,ue);w(this,pe);w(this,oi);u(this,"nocase");w(this,ni);p(this,ni,Ko(n)),(t instanceof URL||t.startsWith("file://"))&&(t=(0,Qo.fileURLToPath)(t));let l=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),p(this,ue,new qi),p(this,pe,new qi),p(this,oi,new xs(o));let h=l.substring(this.rootPath.length).split(i);if(h.length===1&&!h[0]&&h.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(a(this,ni)),this.roots[this.rootPath]=this.root;let c=this.root,f=h.length-1,d=e.sep,m=this.rootPath,y=!1;for(let v of h){let g=f--;c=c.child(v,{relative:new Array(g).fill("..").join(d),relativePosix:new Array(g).fill("..").join("/"),fullpath:m+=(y?"":d)+v}),y=!0}this.cwd=c}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return a(this,oi)}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 i=a(this,ue).get(e);if(i!==void 0)return i;let r=this.cwd.resolve(e).fullpath();return a(this,ue).set(e,r),r}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 i=a(this,pe).get(e);if(i!==void 0)return i;let r=this.cwd.resolve(e).fullpathPosix();return a(this,pe).set(e,r),r}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 z||(e=t,t=this.cwd);let{withFileTypes:i}=e;if(t.canReaddir()){let r=await t.readdir();return i?r:r.map(o=>o.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof z||(e=t,t=this.cwd);let{withFileTypes:i=!0}=e;return t.canReaddir()?i?t.readdirSync():t.readdirSync().map(r=>r.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 z||(e=t.withFileTypes,t=this.cwd);let i=await t.readlink();return e?i:i==null?void 0:i.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof z||(e=t.withFileTypes,t=this.cwd);let i=t.readlinkSync();return e?i:i==null?void 0:i.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof z||(e=t.withFileTypes,t=this.cwd);let i=await t.realpath();return e?i:i==null?void 0:i.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof z||(e=t.withFileTypes,t=this.cwd);let i=t.realpathSync();return e?i:i==null?void 0:i.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof z||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:o,walkFilter:n}=e,l=[];(!o||o(t))&&l.push(i?t:t.fullpath());let h=new Set,c=(d,m)=>{h.add(d),d.readdirCB((y,v)=>{if(y)return m(y);let g=v.length;if(!g)return m();let k=()=>{--g===0&&m()};for(let S of v)(!o||o(S))&&l.push(i?S:S.fullpath()),r&&S.isSymbolicLink()?S.realpath().then(T=>T!=null&&T.isUnknown()?T.lstat():T).then(T=>T!=null&&T.shouldWalk(h,n)?c(T,k):k()):S.shouldWalk(h,n)?c(S,k):k()},!0)},f=t;return new Promise((d,m)=>{c(f,y=>{if(y)return m(y);d(l)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof z||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:o,walkFilter:n}=e,l=[];(!o||o(t))&&l.push(i?t:t.fullpath());let h=new Set([t]);for(let c of h){let f=c.readdirSync();for(let d of f){(!o||o(d))&&l.push(i?d:d.fullpath());let m=d;if(d.isSymbolicLink()){if(!(r&&(m=d.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(h,n)&&h.add(m)}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof z||(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 z||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:o,walkFilter:n}=e;(!o||o(t))&&(yield i?t:t.fullpath());let l=new Set([t]);for(let h of l){let c=h.readdirSync();for(let f of c){(!o||o(f))&&(yield i?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(r&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(l,n)&&l.add(d)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof z||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:o,walkFilter:n}=e,l=new jt({objectMode:!0});(!o||o(t))&&l.write(i?t:t.fullpath());let h=new Set,c=[t],f=0,d=()=>{let m=!1;for(;!m;){let y=c.shift();if(!y){f===0&&l.end();return}f++,h.add(y);let v=(k,S,T=!1)=>{if(k)return l.emit("error",k);if(r&&!T){let R=[];for(let F of S)F.isSymbolicLink()&&R.push(F.realpath().then(J=>J!=null&&J.isUnknown()?J.lstat():J));if(R.length){Promise.all(R).then(()=>v(null,S,!0));return}}for(let R of S)R&&(!o||o(R))&&(l.write(i?R:R.fullpath())||(m=!0));f--;for(let R of S){let F=R.realpathCached()||R;F.shouldWalk(h,n)&&c.push(F)}m&&!l.flowing?l.once("drain",d):g||d()},g=!0;y.readdirCB(v,!0),g=!1}};return d(),l}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof z||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:r=!1,filter:o,walkFilter:n}=e,l=new jt({objectMode:!0}),h=new Set;(!o||o(t))&&l.write(i?t:t.fullpath());let c=[t],f=0,d=()=>{let m=!1;for(;!m;){let y=c.shift();if(!y){f===0&&l.end();return}f++,h.add(y);let v=y.readdirSync();for(let g of v)(!o||o(g))&&(l.write(i?g:g.fullpath())||(m=!0));f--;for(let g of v){let k=g;if(g.isSymbolicLink()){if(!(r&&(k=g.realpathSync())))continue;k.isUnknown()&&k.lstatSync()}k.shouldWalk(h,n)&&c.push(k)}}m&&!l.flowing&&l.once("drain",d)};return d(),l}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[sn](e)}};ue=new WeakMap,pe=new WeakMap,oi=new WeakMap,ni=new WeakMap;me=class extends zi{constructor(e=process.cwd(),i={}){let{nocase:r=!0}=i;super(e,de.win32,"\\",{...i,nocase:r});u(this,"sep","\\");this.nocase=r;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return de.win32.parse(e).root.toUpperCase()}newRoot(e){return new Wi(this.rootPath,gt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},ge=class extends zi{constructor(e=process.cwd(),i={}){let{nocase:r=!1}=i;super(e,de.posix,"/",{...i,nocase:r});u(this,"sep","/");this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Ui(this.rootPath,gt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},$e=class extends ge{constructor(t=process.cwd(),e={}){let{nocase:i=!0}=e;super(t,{...e,nocase:i})}},wc=process.platform==="win32"?Wi:Ui,hn=process.platform==="win32"?me:process.platform==="darwin"?$e:ge});var qh,Wh,N,X,B,ee,lt,ai,_t,Bt,$t,we,Ps,ye,Ds=C(()=>{"use strict";At();qh=s=>s.length>=1,Wh=s=>s.length>=1,Ps=class Ps{constructor(t,e,i,r){w(this,N);w(this,X);w(this,B);u(this,"length");w(this,ee);w(this,lt);w(this,ai);w(this,_t);w(this,Bt);w(this,$t);w(this,we,!0);if(!qh(t))throw new TypeError("empty pattern list");if(!Wh(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,i<0||i>=this.length)throw new TypeError("index out of range");if(p(this,N,t),p(this,X,e),p(this,B,i),p(this,ee,r),a(this,B)===0){if(this.isUNC()){let[o,n,l,h,...c]=a(this,N),[f,d,m,y,...v]=a(this,X);c[0]===""&&(c.shift(),v.shift());let g=[o,n,l,h,""].join("/"),k=[f,d,m,y,""].join("/");p(this,N,[g,...c]),p(this,X,[k,...v]),this.length=a(this,N).length}else if(this.isDrive()||this.isAbsolute()){let[o,...n]=a(this,N),[l,...h]=a(this,X);n[0]===""&&(n.shift(),h.shift());let c=o+"/",f=l+"/";p(this,N,[c,...n]),p(this,X,[f,...h]),this.length=a(this,N).length}}}pattern(){return a(this,N)[a(this,B)]}isString(){return typeof a(this,N)[a(this,B)]=="string"}isGlobstar(){return a(this,N)[a(this,B)]===q}isRegExp(){return a(this,N)[a(this,B)]instanceof RegExp}globString(){return p(this,ai,a(this,ai)||(a(this,B)===0?this.isAbsolute()?a(this,X)[0]+a(this,X).slice(1).join("/"):a(this,X).join("/"):a(this,X).slice(a(this,B)).join("/")))}hasMore(){return this.length>a(this,B)+1}rest(){return a(this,lt)!==void 0?a(this,lt):this.hasMore()?(p(this,lt,new Ps(a(this,N),a(this,X),a(this,B)+1,a(this,ee))),p(a(this,lt),$t,a(this,$t)),p(a(this,lt),Bt,a(this,Bt)),p(a(this,lt),_t,a(this,_t)),a(this,lt)):p(this,lt,null)}isUNC(){let t=a(this,N);return a(this,Bt)!==void 0?a(this,Bt):p(this,Bt,a(this,ee)==="win32"&&a(this,B)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=a(this,N);return a(this,_t)!==void 0?a(this,_t):p(this,_t,a(this,ee)==="win32"&&a(this,B)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=a(this,N);return a(this,$t)!==void 0?a(this,$t):p(this,$t,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=a(this,N)[0];return typeof t=="string"&&this.isAbsolute()&&a(this,B)===0?t:""}checkFollowGlobstar(){return!(a(this,B)===0||!this.isGlobstar()||!a(this,we))}markFollowGlobstar(){return a(this,B)===0||!this.isGlobstar()||!a(this,we)?!1:(p(this,we,!1),!0)}};N=new WeakMap,X=new WeakMap,B=new WeakMap,ee=new WeakMap,lt=new WeakMap,ai=new WeakMap,_t=new WeakMap,Bt=new WeakMap,$t=new WeakMap,we=new WeakMap;ye=Ps});var Uh,be,Ms=C(()=>{"use strict";At();Ds();Uh=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",be=class{constructor(t,{nobrace:e,nocase:i,noext:r,noglobstar:o,platform:n=Uh}){u(this,"relative");u(this,"relativeChildren");u(this,"absolute");u(this,"absoluteChildren");u(this,"platform");u(this,"mmopts");this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:!0,nobrace:e,nocase:i,noext:r,noglobstar:o,optimizationLevel:2,platform:n,nocomment:!0,nonegate:!0};for(let l of t)this.add(l)}add(t){let e=new Y(t,this.mmopts);for(let i=0;i<e.set.length;i++){let r=e.set[i],o=e.globParts[i];if(!r||!o)throw new Error("invalid pattern object");for(;r[0]==="."&&o[0]===".";)r.shift(),o.shift();let n=new ye(r,o,0,this.platform),l=new Y(n.globString(),this.mmopts),h=o[o.length-1]==="**",c=n.isAbsolute();c?this.absolute.push(l):this.relative.push(l),h&&(c?this.absoluteChildren.push(l):this.relativeChildren.push(l))}}ignored(t){let e=t.fullpath(),i=`${e}/`,r=t.relative()||".",o=`${r}/`;for(let n of this.relative)if(n.match(r)||n.match(o))return!0;for(let n of this.absolute)if(n.match(e)||n.match(i))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",i=(t.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(i))return!0;for(let r of this.absoluteChildren)if(r.match(e))return!0;return!1}}});var Fs,As,Ns,hi,cn=C(()=>{"use strict";At();Fs=class s{constructor(t=new Map){u(this,"store");this.store=t}copy(){return new s(new Map(this.store))}hasWalked(t,e){var i;return(i=this.store.get(t.fullpath()))==null?void 0:i.has(e.globString())}storeWalked(t,e){let i=t.fullpath(),r=this.store.get(i);r?r.add(e.globString()):this.store.set(i,new Set([e.globString()]))}},As=class{constructor(){u(this,"store",new Map)}add(t,e,i){let r=(e?2:0)|(i?1:0),o=this.store.get(t);this.store.set(t,o===void 0?r:r&o)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},Ns=class{constructor(){u(this,"store",new Map)}add(t,e){if(!t.canReaddir())return;let i=this.store.get(t);i?i.find(r=>r.globString()===e.globString())||i.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())}},hi=class s{constructor(t,e){u(this,"hasWalkedCache");u(this,"matches",new As);u(this,"subwalks",new Ns);u(this,"patterns");u(this,"follow");u(this,"dot");u(this,"opts");this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new Fs}processPatterns(t,e){this.patterns=e;let i=e.map(r=>[t,r]);for(let[r,o]of i){this.hasWalkedCache.storeWalked(r,o);let n=o.root(),l=o.isAbsolute()&&this.opts.absolute!==!1;if(n){r=r.resolve(n==="/"&&this.opts.root!==void 0?this.opts.root:n);let d=o.rest();if(d)o=d;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let h,c,f=!1;for(;typeof(h=o.pattern())=="string"&&(c=o.rest());)r=r.resolve(h),o=c,f=!0;if(h=o.pattern(),c=o.rest(),f){if(this.hasWalkedCache.hasWalked(r,o))continue;this.hasWalkedCache.storeWalked(r,o)}if(typeof h=="string"){let d=h===".."||h===""||h===".";this.matches.add(r.resolve(h),l,d);continue}else if(h===q){(!r.isSymbolicLink()||this.follow||o.checkFollowGlobstar())&&this.subwalks.add(r,o);let d=c==null?void 0:c.pattern(),m=c==null?void 0:c.rest();if(!c||(d===""||d===".")&&!m)this.matches.add(r,l,d===""||d===".");else if(d===".."){let y=r.parent||r;m?this.hasWalkedCache.hasWalked(y,m)||this.subwalks.add(y,m):this.matches.add(y,l,!0)}}else h instanceof RegExp&&this.subwalks.add(r,o)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new s(this.opts,this.hasWalkedCache)}filterEntries(t,e){let i=this.subwalks.get(t),r=this.child();for(let o of e)for(let n of i){let l=n.isAbsolute(),h=n.pattern(),c=n.rest();h===q?r.testGlobstar(o,n,c,l):h instanceof RegExp?r.testRegExp(o,h,c,l):r.testString(o,h,c,l)}return r}testGlobstar(t,e,i,r){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,r,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(i&&e.checkFollowGlobstar()?this.subwalks.add(t,i):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),i){let o=i.pattern();if(typeof o=="string"&&o!==".."&&o!==""&&o!==".")this.testString(t,o,i.rest(),r);else if(o===".."){let n=t.parent||t;this.subwalks.add(n,i)}else o instanceof RegExp&&this.testRegExp(t,o,i.rest(),r)}}testRegExp(t,e,i,r){e.test(t.name)&&(i?this.subwalks.add(t,i):this.matches.add(t,r,!1))}testString(t,e,i,r){t.isNamed(e)&&(i?this.subwalks.add(t,i):this.matches.add(t,r,!1))}}});var zh,Ee,Ot,se,rt,ie,js,Gi,li,ci,fn=C(()=>{"use strict";ys();Ms();cn();zh=(s,t)=>typeof s=="string"?new be([s],t):Array.isArray(s)?new be(s,t):s,Gi=class{constructor(t,e,i){w(this,rt);u(this,"path");u(this,"patterns");u(this,"opts");u(this,"seen",new Set);u(this,"paused",!1);u(this,"aborted",!1);w(this,Ee,[]);w(this,Ot);w(this,se);u(this,"signal");u(this,"maxDepth");u(this,"includeChildMatches");var r;if(this.patterns=t,this.path=e,this.opts=i,p(this,se,!i.posix&&i.platform==="win32"?"\\":"/"),this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(p(this,Ot,zh((r=i.ignore)!=null?r:[],i)),!this.includeChildMatches&&typeof a(this,Ot).add!="function")){let o="cannot ignore child matches, ignore lacks add() method.";throw new Error(o)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{a(this,Ee).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,Ee).shift());)t()}onResume(t){var e;(e=this.signal)!=null&&e.aborted||(this.paused?a(this,Ee).push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||await t.realpath(),!i)return;t=i}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 i;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()||!((i=t.realpathCached())!=null&&i.isDirectory()))&&!b(this,rt,ie).call(this,t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||t.realpathSync(),!i)return;t=i}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,rt,ie).call(this,t))return;if(!this.includeChildMatches&&((o=a(this,Ot))!=null&&o.add)){let n=`${t.relativePosix()}/**`;a(this,Ot).add(n)}let i=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let r=this.opts.mark&&t.isDirectory()?a(this,se):"";if(this.opts.withFileTypes)this.matchEmit(t);else if(i){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+r)}else{let n=this.opts.posix?t.relativePosix():t.relative(),l=this.opts.dotRelative&&!n.startsWith(".."+a(this,se))?"."+a(this,se):"";this.matchEmit(n?l+n+r:"."+r)}}async match(t,e,i){let r=await this.matchCheck(t,i);r&&this.matchFinish(r,e)}matchSync(t,e,i){let r=this.matchCheckSync(t,i);r&&this.matchFinish(r,e)}walkCB(t,e,i){var r;(r=this.signal)!=null&&r.aborted&&i(),this.walkCB2(t,e,new hi(this.opts),i)}walkCB2(t,e,i,r){var l;if(b(this,rt,js).call(this,t))return r();if((l=this.signal)!=null&&l.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(t,e,i,r));return}i.processPatterns(t,e);let o=1,n=()=>{--o===0&&r()};for(let[h,c,f]of i.matches.entries())b(this,rt,ie).call(this,h)||(o++,this.match(h,c,f).then(()=>n()));for(let h of i.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;o++;let c=h.readdirCached();h.calledReaddir()?this.walkCB3(h,c,i,n):h.readdirCB((f,d)=>this.walkCB3(h,d,i,n),!0)}n()}walkCB3(t,e,i,r){i=i.filterEntries(t,e);let o=1,n=()=>{--o===0&&r()};for(let[l,h,c]of i.matches.entries())b(this,rt,ie).call(this,l)||(o++,this.match(l,h,c).then(()=>n()));for(let[l,h]of i.subwalks.entries())o++,this.walkCB2(l,h,i.child(),n);n()}walkCBSync(t,e,i){var r;(r=this.signal)!=null&&r.aborted&&i(),this.walkCB2Sync(t,e,new hi(this.opts),i)}walkCB2Sync(t,e,i,r){var l;if(b(this,rt,js).call(this,t))return r();if((l=this.signal)!=null&&l.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,i,r));return}i.processPatterns(t,e);let o=1,n=()=>{--o===0&&r()};for(let[h,c,f]of i.matches.entries())b(this,rt,ie).call(this,h)||this.matchSync(h,c,f);for(let h of i.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;o++;let c=h.readdirSync();this.walkCB3Sync(h,c,i,n)}n()}walkCB3Sync(t,e,i,r){i=i.filterEntries(t,e);let o=1,n=()=>{--o===0&&r()};for(let[l,h,c]of i.matches.entries())b(this,rt,ie).call(this,l)||this.matchSync(l,h,c);for(let[l,h]of i.subwalks.entries())o++,this.walkCB2Sync(l,h,i.child(),n);n()}};Ee=new WeakMap,Ot=new WeakMap,se=new WeakMap,rt=new WeakSet,ie=function(t){var e,i;return this.seen.has(t)||!!((i=(e=a(this,Ot))==null?void 0:e.ignored)!=null&&i.call(e,t))},js=function(t){var e,i;return!!((i=(e=a(this,Ot))==null?void 0:e.childrenIgnored)!=null&&i.call(e,t))};li=class extends Gi{constructor(e,i,r){super(e,i,r);u(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((i,r)=>{this.walkCB(this.path,this.patterns,()=>{var o;(o=this.signal)!=null&&o.aborted?r(this.signal.reason):i(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 i;if((i=this.signal)!=null&&i.aborted)throw this.signal.reason}),this.matches}},ci=class extends Gi{constructor(e,i,r){super(e,i,r);u(this,"results");this.results=new jt({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 un,Gh,ct,Is=C(()=>{"use strict";At();un=require("url");ln();Ds();fn();Gh=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ct=class{constructor(t,e){u(this,"absolute");u(this,"cwd");u(this,"root");u(this,"dot");u(this,"dotRelative");u(this,"follow");u(this,"ignore");u(this,"magicalBraces");u(this,"mark");u(this,"matchBase");u(this,"maxDepth");u(this,"nobrace");u(this,"nocase");u(this,"nodir");u(this,"noext");u(this,"noglobstar");u(this,"pattern");u(this,"platform");u(this,"realpath");u(this,"scurry");u(this,"stat");u(this,"signal");u(this,"windowsPathsNoEscape");u(this,"withFileTypes");u(this,"includeChildMatches");u(this,"opts");u(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,un.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(h=>h.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(h=>h.includes("/")?h:`./**/${h}`)}if(this.pattern=t,this.platform=e.platform||Gh,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 h=e.platform==="win32"?me:e.platform==="darwin"?$e:e.platform?ge:hn;this.scurry=new h(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",r={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},o=this.pattern.map(h=>new Y(h,r)),[n,l]=o.reduce((h,c)=>(h[0].push(...c.set),h[1].push(...c.globParts),h),[[],[]]);this.patterns=n.map((h,c)=>{let f=l[c];if(!f)throw new Error("invalid pattern object");return new ye(h,f,0,this.platform)})}async walk(){return[...await new li(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 li(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 ci(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 ci(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 Ls,_s=C(()=>{"use strict";At();Ls=(s,t={})=>{Array.isArray(s)||(s=[s]);for(let e of s)if(new Y(e,t).hasMagic())return!0;return!1}});function Vi(s,t={}){return new ct(s,t).streamSync()}function mn(s,t={}){return new ct(s,t).stream()}function gn(s,t={}){return new ct(s,t).walkSync()}async function pn(s,t={}){return new ct(s,t).walk()}function Hi(s,t={}){return new ct(s,t).iterateSync()}function wn(s,t={}){return new ct(s,t).iterate()}var Vh,Hh,Qh,Kh,fi,dn,Bs=C(()=>{"use strict";At();Is();_s();At();Is();_s();Ms();Vh=Vi,Hh=Object.assign(mn,{sync:Vi}),Qh=Hi,Kh=Object.assign(wn,{sync:Hi}),fi=Object.assign(gn,{stream:Vi,iterate:Hi}),dn=Object.assign(pn,{glob:pn,globSync:gn,sync:fi,globStream:mn,stream:Hh,globStreamSync:Vi,streamSync:Vh,globIterate:wn,iterate:Kh,globIterateSync:Hi,iterateSync:Qh,Glob:ct,hasMagic:Ls,escape:ae,unescape:nt});dn.glob=dn});function yn(){let s=fi("./**/Cookies",{cwd:re,absolute:!0});return Jh.debug("Found cookie files:",s),s}var Jh,bn=C(()=>{"use strict";Bs();Et();Zi();Jh=D.withTag("listChromeProfiles")});function Xh(s){var e;let t=[/.*?0t(.+)$/,/.*?1e`(.+)$/,/.*?[`'](.+)$/,/[^\x20-\x7E]*([\x20-\x7E].+)$/];for(let i of t){let r=s.match(i),o=(e=r==null?void 0:r[1])!=null?e:"";if(o.length>0)return o}return s}async function En(s,t){if(typeof t!="string")throw new Error("password must be a string");if(!Buffer.isBuffer(s))throw new Error("encryptedData must be a Buffer");return new Promise((e,i)=>{(0,Qi.pbkdf2)(t,"saltysalt",1003,16,"sha1",(r,o)=>{try{if(r){i(new Error("Failed to derive key: "+r.message));return}let n=Yh(s);if(n.length%16!==0){i(new Error("Encrypted data length is not a multiple of 16"));return}let l=Buffer.alloc(16," "),h=(0,Qi.createDecipheriv)("aes-128-cbc",o,l);h.setAutoPadding(!1);let c=h.update(n);try{h.final()}catch(d){i(new Error("Failed to finalize decryption: "+d.message));return}c=Zh(c);let f=c.toString("utf8");e(Xh(f))}catch(n){i(new Error("Decryption failed: "+n.message))}})})}var Qi,$s,Yh,Zh,xn=C(()=>{"use strict";Qi=require("crypto"),$s=ft(require("lodash/memoize"),1),Yh=(0,$s.default)(s=>s.length>=3&&s[0]===118&&s[1]===49&&s[2]===48?s.slice(3):s,s=>s.toString("hex")),Zh=(0,$s.default)(s=>{let t=s[s.length-1];return t&&t<=16?s.slice(0,-t):s},s=>s.toString("hex"))});function el(s,t){if(s instanceof qt)throw G("Command execution failed",s,{command:s.command,originalError:s.originalError}),s;if(s instanceof Error){let i=new qt(s.message,t,s);throw G("Failed to execute command",s,{command:t,stack:s.stack}),i}let e=new qt("Unknown error occurred during command execution",t);throw G("Failed to execute command",null,{error:s,command:t}),e}async function Cn(s,t={}){if(!s||typeof s!="string")throw new qt("Command must be a non-empty string",s);let e={encoding:"utf8",maxBuffer:5*1024*1024,timeout:3e4};try{let{stdout:i,stderr:r}=await tl(s,{...e,...t}),o=i.trim();if(!o)throw r?new qt(`Command failed with stderr: ${r}`,s):new qt("Command returned empty result",s);return o}catch(i){el(i,s)}}var Sn,kn,tl,qt,vn=C(()=>{"use strict";Sn=require("child_process"),kn=require("util");zt();tl=(0,kn.promisify)(Sn.exec),qt=class extends Error{constructor(e,i,r){super(e);this.command=i;this.originalError=r;this.name="CommandExecutionError"}}});var Rn={};Ut(Rn,{getChromePassword:()=>sl});var Tn,il,sl,On=C(()=>{"use strict";Tn=ft(require("lodash/memoize"),1);vn();il=async()=>Cn('security find-generic-password -w -s "Chrome Safe Storage"'),sl=(0,Tn.default)(il)});var Pn,Dn,Mn=C(()=>{"use strict";Pn=ft(require("lodash/memoize"),1);zt();Dn=(0,Pn.default)(async()=>{if(process.platform!=="darwin")throw G("Chrome password retrieval failed",new Error("This only works on macOS"),{platform:process.platform}),new Error("This only works on macOS");try{let{getChromePassword:s}=await Promise.resolve().then(()=>(On(),Rn)),t=await s();return ut("ChromePassword","Retrieved password successfully",{platform:"macOS"}),t}catch(s){throw G("Chrome password retrieval failed",s,{platform:"macOS"}),s}})});function rl(s){return typeof s!="number"||s<=0?"Infinity":new Date(s)}function Fn(s,t,e,i,r,o){return{domain:s,name:t,value:e,expiry:rl(i),meta:{file:r,browser:"Chrome",decrypted:o}}}var xe,qs=C(()=>{"use strict";Ys();zt();Ur();bn();xn();Mn();xe=class{constructor(){this.logger=Zs("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 r=yn().map(l=>l),o=await Dn(),n=await Js(r,l=>this.processFile(l,t,e,o),[]);return ui("Cookie query",!0,{count:n.length}),n}catch(i){return G("Failed to query cookies",i,{name:t,domain:e}),[]}}async processFile(t,e,i,r){try{let o=await Wr({name:e,domain:i,file:t}),n={file:t,password:r};return(await Promise.allSettled(o.map(h=>this.processCookie(h,n)))).map(h=>h.status==="fulfilled"?h.value:null).filter(h=>h!==null)}catch(o){return this.logger.error("Failed to process cookie file",{error:o,file:t}),[]}}async processCookie(t,e){try{let i=Buffer.isBuffer(t.value)?t.value:Buffer.from(String(t.value)),r=await En(i,e.password);return Fn(t.domain,t.name,r,t.expiry,e.file,!0)}catch(i){return this.logger.warn("Failed to decrypt cookie",{error:i}),Fn(t.domain,t.name,t.value.toString("utf-8"),t.expiry,e.file,!1)}}}});function ol(){let s=[],t=process.env.HOME;if(typeof t!="string"||t.length===0)return pi("FirefoxCookieQuery","HOME environment variable not set"),s;let e=[(0,Ws.join)(t,"Library/Application Support/Firefox/Profiles/*/cookies.sqlite"),(0,Ws.join)(t,".mozilla/firefox/*/cookies.sqlite")];for(let i of e){let r=fi(i);s.push(...r)}return ut("FirefoxCookieQuery","Found Firefox cookie files",{files:s}),s}var Ws,Se,Us=C(()=>{"use strict";Ws=require("path");Bs();zt();rs();Se=class{constructor(){this.browserName="Firefox"}async queryCookies(t,e){let i=ol(),r=[];for(let o of i)try{let n=await ki({file:o,sql:"SELECT name, value, host as domain, expiry FROM moz_cookies WHERE name = ? AND host LIKE ?",params:[t,`%${e}%`],rowTransform:l=>({name:l.name,value:l.value,domain:l.domain,expiry:l.expiry>0?new Date(l.expiry*1e3):"Infinity",meta:{file:o,browser:"Firefox",decrypted:!1}})});r.push(...n)}catch(n){n instanceof Error?pi("FirefoxCookieQuery",`Error reading Firefox cookie file ${o}`,{error:n.message}):pi("FirefoxCookieQuery",`Error reading Firefox cookie file ${o}`)}return r}}});async function An(s){let t=[new xe,new Se];return(await Promise.allSettled(t.map(i=>i.queryCookies(s.name,s.domain)))).filter(i=>i.status==="fulfilled").flatMap(i=>i.value)}var Nn=C(()=>{"use strict";qs();Us()});var jn={};Ut(jn,{default:()=>nl,getCookie:()=>ke});async function ke(s){try{return await An(s)}catch(t){return D.warn("Error querying cookies:",t instanceof Error?t.message:String(t)),[]}}var nl,Ki=C(()=>{"use strict";Et();Nn();nl=ke});var Ln={};Ut(Ln,{default:()=>al,getChromeCookie:()=>In});async function In(s){try{return await new xe().queryCookies(s.name,s.domain)}catch(t){return D.warn("Error querying Chrome cookies:",t),[]}}var al,_n=C(()=>{"use strict";Et();qs();al=In});var $n={};Ut($n,{default:()=>hl,getFirefoxCookie:()=>Bn});async function Bn(s){try{return await new Se().queryCookies(s.name,s.domain)}catch(t){return D.warn("Error querying Firefox cookies:",t instanceof Error?t.message:String(t)),[]}}var hl,qn=C(()=>{"use strict";Et();Us();hl=Bn});function Ji(s,t={}){let{format:e="merged",showFilePaths:i=!0,separator:r="; "}=t;if(s.length===0)return e==="merged"?"":[];if(e==="merged")return s.map(n=>n.value).join(r);let o=(0,Wn.groupBy)(s,n=>{var l,h;return(h=(l=n.meta)==null?void 0:l.file)!=null?h:"unknown"});return Object.entries(o).map(([n,l])=>{let h=l.map(c=>c.value).join(r);return i?`${n}: ${h}`:h})}var Wn,zs=C(()=>{"use strict";Wn=require("lodash")});var zn={};Ut(zn,{default:()=>ll,getGroupedRenderedCookies:()=>Un});async function Un(s,t={}){try{let e=await ke(s);return Ji(e,{...t,format:"grouped"})}catch(e){return D.warn("Error getting grouped rendered cookies:",e instanceof Error?e.message:String(e)),[]}}var ll,Gn=C(()=>{"use strict";Et();Ki();zs();ll=Un});var Hn={};Ut(Hn,{default:()=>cl,getMergedRenderedCookies:()=>Vn});async function Vn(s,t={}){try{let e=await ke(s);return Ji(e,{...t,format:"merged"})}catch(e){return D.warn("Error getting merged rendered cookies:",e instanceof Error?e.message:String(e)),""}}var cl,Qn=C(()=>{"use strict";Et();Ki();zs();cl=Vn});var gl={};Ut(gl,{getChromeCookie:()=>ul,getCookie:()=>fl,getFirefoxCookie:()=>pl,getGroupedRenderedCookies:()=>dl,getMergedRenderedCookies:()=>ml});module.exports=ia(gl);var fl=()=>Promise.resolve().then(()=>(Ki(),jn)).then(s=>s.getCookie),ul=()=>Promise.resolve().then(()=>(_n(),Ln)).then(s=>s.getChromeCookie),pl=()=>Promise.resolve().then(()=>(qn(),$n)).then(s=>s.getFirefoxCookie),dl=()=>Promise.resolve().then(()=>(Gn(),zn)).then(s=>s.getGroupedRenderedCookies),ml=()=>Promise.resolve().then(()=>(Qn(),Hn)).then(s=>s.getMergedRenderedCookies);0&&(module.exports={getChromeCookie,getCookie,getFirefoxCookie,getGroupedRenderedCookies,getMergedRenderedCookies});
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});
6
4
  //# sourceMappingURL=index.cjs.map