@mherod/get-cookie 4.0.4 → 4.2.0

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 (53) hide show
  1. package/.env.example +5 -0
  2. package/.husky/commit-msg +6 -2
  3. package/.husky/pre-commit +6 -4
  4. package/.husky/pre-push +6 -4
  5. package/dist/chunk-GVQTX3C5.js +2 -0
  6. package/dist/chunk-GVQTX3C5.js.map +1 -0
  7. package/dist/cli.cjs +1 -3
  8. package/dist/cli.cjs.map +1 -1
  9. package/dist/getChromePassword-6XZINNNO.js +2 -0
  10. package/dist/{getChromePassword-GTIXL733.js.map → getChromePassword-6XZINNNO.js.map} +1 -1
  11. package/dist/index.cjs +1 -3
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +228 -49
  14. package/dist/index.d.ts +228 -49
  15. package/dist/index.js +1 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/tsconfig.tsbuildinfo +1 -0
  18. package/eslint.config.js +2 -17
  19. package/examples/README.md +37 -0
  20. package/examples/advanced-usage.ts +56 -0
  21. package/examples/basic-usage.ts +44 -0
  22. package/examples/cli-examples.sh +51 -0
  23. package/package.json +22 -26
  24. package/tsconfig.build.json +2 -2
  25. package/tsconfig.cli.json +12 -0
  26. package/tsconfig.tsup.json +12 -0
  27. package/tsup.cli.ts +1 -0
  28. package/tsup.lib.ts +1 -0
  29. package/dist/chunk-56Z35D5R.js +0 -2
  30. package/dist/chunk-56Z35D5R.js.map +0 -1
  31. package/dist/chunk-5FUMK7M3.js +0 -4
  32. package/dist/chunk-5FUMK7M3.js.map +0 -1
  33. package/dist/chunk-A6MIB6FP.js +0 -2
  34. package/dist/chunk-A6MIB6FP.js.map +0 -1
  35. package/dist/chunk-CFMK2YSL.js +0 -2
  36. package/dist/chunk-CFMK2YSL.js.map +0 -1
  37. package/dist/chunk-IRERRCUF.js +0 -2
  38. package/dist/chunk-IRERRCUF.js.map +0 -1
  39. package/dist/chunk-UPNW543B.js +0 -2
  40. package/dist/chunk-UPNW543B.js.map +0 -1
  41. package/dist/chunk-VMBA4NVU.js +0 -2
  42. package/dist/chunk-VMBA4NVU.js.map +0 -1
  43. package/dist/getChromeCookie-CL3SRRWX.js +0 -2
  44. package/dist/getChromeCookie-CL3SRRWX.js.map +0 -1
  45. package/dist/getChromePassword-GTIXL733.js +0 -2
  46. package/dist/getCookie-WV5KDZN7.js +0 -2
  47. package/dist/getCookie-WV5KDZN7.js.map +0 -1
  48. package/dist/getFirefoxCookie-BXQ2GXAW.js +0 -2
  49. package/dist/getFirefoxCookie-BXQ2GXAW.js.map +0 -1
  50. package/dist/getGroupedRenderedCookies-FNJ6FQVQ.js +0 -2
  51. package/dist/getGroupedRenderedCookies-FNJ6FQVQ.js.map +0 -1
  52. package/dist/getMergedRenderedCookies-PNC2LHSD.js +0 -2
  53. package/dist/getMergedRenderedCookies-PNC2LHSD.js.map +0 -1
package/.env.example ADDED
@@ -0,0 +1,5 @@
1
+ # Logging
2
+ LOG_LEVEL=info # Set to 'debug' for verbose logging
3
+
4
+ # System Paths
5
+ # HOME=/path/to/home # Uncomment to override system HOME directory
package/.husky/commit-msg CHANGED
@@ -1,2 +1,6 @@
1
- #!/bin/sh
2
- npx --no -- commitlint --edit ${1}
1
+ # Try pnpm first, fallback to npx if pnpm not found
2
+ if command -v pnpm >/dev/null 2>&1; then
3
+ pnpm exec commitlint --edit ${1}
4
+ else
5
+ npx --no -- commitlint --edit ${1}
6
+ fi
package/.husky/pre-commit CHANGED
@@ -1,4 +1,6 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- pnpm lint-staged
1
+ # Try pnpm first, fallback to npx if pnpm not found
2
+ if command -v pnpm >/dev/null 2>&1; then
3
+ pnpm lint-staged
4
+ else
5
+ npx --no -- lint-staged
6
+ fi
package/.husky/pre-push CHANGED
@@ -1,4 +1,6 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- pnpm run type-check && pnpm run test
1
+ # Try pnpm first, fallback to npx if pnpm not found
2
+ if command -v pnpm >/dev/null 2>&1; then
3
+ pnpm run validate
4
+ else
5
+ npm run validate
6
+ fi
@@ -0,0 +1,2 @@
1
+ import{createConsola as m}from"consola";import{homedir as a}from"os";import{config as c}from"dotenv";import{z as s}from"zod";c();var p=s.object({LOG_LEVEL:s.enum(["debug","info","warn","error"]).default("info"),HOME:s.string().optional().transform(e=>e??process.env.USERPROFILE??"").pipe(s.string().min(1))}),i=p.parse({LOG_LEVEL:process.env.LOG_LEVEL,HOME:a()});var u=m({fancy:!0,formatOptions:{showLogLevel:!1,colors:!0,date:!1,compact:!0,columns:typeof process.stdout.columns=="number"?process.stdout.columns:80},level:i.LOG_LEVEL==="debug"?5:2}),x=i.LOG_LEVEL==="debug",t=u;function b(e,o,n){let g=`${o?"\u2705":"\u274C"} ${e} ${o?"succeeded":"failed"}`;o?t.success(g,n):t.error(g,n)}function h(e,o,n){let r={...n??{},error:o instanceof Error?{name:o.name,message:o.message,stack:o.stack}:o};t.error(e,r)}function k(e,o,n){t.withTag(e).debug(o,n)}function C(e){return t.withTag(e)}function T(e,o,n){t.withTag(e).warn(o,n)}export{t as a,b,h as c,k as d,C as e,T as f};
2
+ //# sourceMappingURL=chunk-GVQTX3C5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/logger.ts","../src/config.ts","../src/utils/logHelpers.ts"],"sourcesContent":["import { createConsola } from \"consola\";\n\nimport { env } from \"../config\";\n\n/**\n * Standard log levels and their usage:\n * - debug: Detailed information for debugging\n * - info: General operational information\n * - success: Successful operations\n * - warn: Warning conditions\n * - error: Error conditions that might still allow the app to continue\n * - fatal: Critical errors that prevent the app from continuing\n */\nconst consola = createConsola({\n fancy: true,\n formatOptions: {\n showLogLevel: false,\n colors: true,\n date: false,\n compact: true,\n columns:\n typeof process.stdout.columns === \"number\" ? process.stdout.columns : 80,\n },\n level: env.LOG_LEVEL === \"debug\" ? 5 : 2,\n});\n\n/**\n * Indicates whether debug logging is enabled\n * @example\n * if (isDebug) {\n * logger.debug(\"Detailed debugging information\");\n * }\n */\nexport const isDebug = env.LOG_LEVEL === \"debug\";\n\n/**\n * Configured consola logger instance with standardized formatting and colored output.\n * Used for consistent logging throughout the application.\n * @example\n * // Basic usage\n * logger.info('Operation started');\n * logger.success('Task completed');\n * logger.error('Failed to process', error);\n *\n * // Tagged logging for module context\n * const moduleLogger = logger.withTag('ModuleName');\n * moduleLogger.info('Module specific log');\n *\n * // Structured logging\n * logger.info('User action', {\n * userId: '123',\n * action: 'login',\n * timestamp: new Date()\n * });\n *\n * // Error logging with full context\n * logger.error('Operation failed', {\n * error: error,\n * context: 'operation name',\n * input: data\n * });\n */\nexport default consola;\n","import { homedir } from \"os\";\n\nimport { config } from \"dotenv\";\nimport { z } from \"zod\";\n\n// Load environment variables from .env file\nconfig();\n\nconst EnvironmentSchema = z.object({\n LOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n HOME: z\n .string()\n .optional()\n .transform((val) => val ?? process.env.USERPROFILE ?? \"\")\n .pipe(z.string().min(1)),\n});\n\n/**\n * Validated environment variables with type safety and fallbacks\n * @example\n * // Using the environment variables\n * if (env.LOG_LEVEL === \"debug\") {\n * console.log(\"Debug mode enabled\");\n * }\n *\n * // Accessing home directory\n * const cookiePath = join(env.HOME, \"Library/Cookies\");\n */\nexport const env = EnvironmentSchema.parse({\n LOG_LEVEL: process.env.LOG_LEVEL,\n HOME: homedir(),\n});\n","import logger from \"./logger\";\n\n/**\n * Helper functions for common logging patterns.\n * @module\n * @example\n * ```typescript\n * import { logOperationResult, logError } from './logHelpers';\n *\n * try {\n * const result = await someOperation();\n * logOperationResult('Operation', true, { data: result });\n * } catch (error) {\n * logError('Operation failed', error);\n * }\n * ```\n */\n\ninterface OperationContext {\n [key: string]: unknown;\n}\n\n/**\n * Logs the result of an operation with consistent formatting.\n * @param operation - Name of the operation.\n * @param success - Whether the operation succeeded.\n * @param [context] - Additional context about the operation.\n * @example\n * ```typescript\n * logOperationResult('Database Backup', true, { size: '1.2GB' });\n * // ✅ Database Backup succeeded\n *\n * logOperationResult('File Upload', false, { error: 'Network timeout' });\n * // ❌ File Upload failed\n * ```\n */\nexport function logOperationResult(\n operation: string,\n success: boolean,\n context?: OperationContext,\n): void {\n const icon = success ? \"✅\" : \"❌\";\n const message = `${icon} ${operation} ${success ? \"succeeded\" : \"failed\"}`;\n\n if (success) {\n logger.success(message, context);\n } else {\n logger.error(message, context);\n }\n}\n\n/**\n * Logs an error with consistent formatting and context.\n * @param message - Error message to display.\n * @param error - Error object or error information.\n * @param [context] - Additional context about the error.\n * @example\n * ```typescript\n * try {\n * throw new Error('Connection failed');\n * } catch (error) {\n * logError('Database error', error, { retries: 3 });\n * }\n * ```\n */\nexport function logError(\n message: string,\n error: unknown,\n context?: OperationContext,\n): void {\n const errorContext = {\n ...(context ?? {}),\n error:\n error instanceof Error\n ? {\n name: error.name,\n message: error.message,\n stack: error.stack,\n }\n : error,\n };\n\n logger.error(message, errorContext);\n}\n\n/**\n * Logs debug information with consistent formatting.\n * @param component - Component or module name.\n * @param message - Debug message to log.\n * @param [data] - Optional debug data to include.\n * @example\n * ```typescript\n * logDebug('AuthService', 'Token refresh started', { userId: '123' });\n * ```\n */\nexport function logDebug(\n component: string,\n message: string,\n data?: unknown,\n): void {\n const componentLogger = logger.withTag(component);\n componentLogger.debug(message, data);\n}\n\n/**\n * Creates a tagged logger with consistent naming.\n * @param component - Component or module name.\n * @returns A tagged logger instance.\n * @example\n * ```typescript\n * const dbLogger = createTaggedLogger('Database');\n * dbLogger.info('Connection established');\n * ```\n */\nexport function createTaggedLogger(\n component: string,\n): ReturnType<typeof logger.withTag> {\n return logger.withTag(component);\n}\n\n/**\n * Logs a warning with consistent formatting.\n * @param component - Component or module name.\n * @param message - Warning message to display.\n * @param [context] - Additional context about the warning.\n * @example\n * ```typescript\n * logWarn('Cache', 'Cache miss', { key: 'user-123' });\n * ```\n */\nexport function logWarn(\n component: string,\n message: string,\n context?: OperationContext,\n): void {\n const componentLogger = logger.withTag(component);\n componentLogger.warn(message, context);\n}\n\n// Re-export the base logger for direct usage\n/**\n * Re-export of the base logger for direct usage.\n */\nexport { default as logger } from \"./logger\";\n"],"mappings":"AAAA,OAAS,iBAAAA,MAAqB,UCA9B,OAAS,WAAAC,MAAe,KAExB,OAAS,UAAAC,MAAc,SACvB,OAAS,KAAAC,MAAS,MAGlBD,EAAO,EAEP,IAAME,EAAoBD,EAAE,OAAO,CACjC,UAAWA,EAAE,KAAK,CAAC,QAAS,OAAQ,OAAQ,OAAO,CAAC,EAAE,QAAQ,MAAM,EACpE,KAAMA,EACH,OAAO,EACP,SAAS,EACT,UAAWE,GAAQA,GAAO,QAAQ,IAAI,aAAe,EAAE,EACvD,KAAKF,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAC3B,CAAC,EAaYG,EAAMF,EAAkB,MAAM,CACzC,UAAW,QAAQ,IAAI,UACvB,KAAMH,EAAQ,CAChB,CAAC,EDlBD,IAAMM,EAAUC,EAAc,CAC5B,MAAO,GACP,cAAe,CACb,aAAc,GACd,OAAQ,GACR,KAAM,GACN,QAAS,GACT,QACE,OAAO,QAAQ,OAAO,SAAY,SAAW,QAAQ,OAAO,QAAU,EAC1E,EACA,MAAOC,EAAI,YAAc,QAAU,EAAI,CACzC,CAAC,EASYC,EAAUD,EAAI,YAAc,QA6BlCE,EAAQJ,EE1BR,SAASK,EACdC,EACAC,EACAC,EACM,CAEN,IAAMC,EAAU,GADHF,EAAU,SAAM,QACN,IAAID,CAAS,IAAIC,EAAU,YAAc,QAAQ,GAEpEA,EACFG,EAAO,QAAQD,EAASD,CAAO,EAE/BE,EAAO,MAAMD,EAASD,CAAO,CAEjC,CAgBO,SAASG,EACdF,EACAG,EACAJ,EACM,CACN,IAAMK,EAAe,CACnB,GAAIL,GAAW,CAAC,EAChB,MACEI,aAAiB,MACb,CACE,KAAMA,EAAM,KACZ,QAASA,EAAM,QACf,MAAOA,EAAM,KACf,EACAA,CACR,EAEAF,EAAO,MAAMD,EAASI,CAAY,CACpC,CAYO,SAASC,EACdC,EACAN,EACAO,EACM,CACkBN,EAAO,QAAQK,CAAS,EAChC,MAAMN,EAASO,CAAI,CACrC,CAYO,SAASC,EACdF,EACmC,CACnC,OAAOL,EAAO,QAAQK,CAAS,CACjC,CAYO,SAASG,EACdH,EACAN,EACAD,EACM,CACkBE,EAAO,QAAQK,CAAS,EAChC,KAAKN,EAASD,CAAO,CACvC","names":["createConsola","homedir","config","z","EnvironmentSchema","val","env","consola","createConsola","env","isDebug","logger_default","logOperationResult","operation","success","context","message","logger_default","logError","error","errorContext","logDebug","component","data","createTaggedLogger","logWarn"]}
package/dist/cli.cjs CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var zp=Object.create;var io=Object.defineProperty;var Kp=Object.getOwnPropertyDescriptor;var Qp=Object.getOwnPropertyNames;var Vp=Object.getPrototypeOf,Jp=Object.prototype.hasOwnProperty;var _s=r=>{throw TypeError(r)};var Yp=(r,t,e)=>t in r?io(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var p=(r,t)=>()=>(r&&(t=r(r=0)),t);var Rs=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Zp=(r,t)=>{for(var e in t)io(r,e,{get:t[e],enumerable:!0})},Xp=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qp(t))!Jp.call(r,i)&&i!==e&&io(r,i,{get:()=>t[i],enumerable:!(o=Kp(t,i))||o.enumerable});return r};var ke=(r,t,e)=>(e=r!=null?zp(Vp(r)):{},Xp(t||!r||!r.__esModule?io(e,"default",{value:r,enumerable:!0}):e,r));var c=(r,t,e)=>Yp(r,typeof t!="symbol"?t+"":t,e),ki=(r,t,e)=>t.has(r)||_s("Cannot "+e);var a=(r,t,e)=>(ki(r,t,"read from private field"),e?e.call(r):t.get(r)),w=(r,t,e)=>t.has(r)?_s("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),g=(r,t,e,o)=>(ki(r,t,"write to private field"),o?o.call(r,e):t.set(r,e),e),S=(r,t,e)=>(ki(r,t,"access private method"),e);var Is,eh,O,nt=p(()=>{"use strict";Is=require("consola"),eh=(0,Is.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}),O=eh});function Ls(r,t,e){let i=`${t?"\u2705":"\u274C"} ${r} ${t?"succeeded":"failed"}`;t?O.success(i,e):O.error(i,e)}function I(r,t,e){let o={...e!=null?e:{},error:t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:t};O.error(r,o)}function bt(r,t,e){O.withTag(r).debug(t,e)}function so(r){return O.withTag(r)}function no(r,t,e){O.withTag(r).warn(t,e)}var Pt=p(()=>{"use strict";nt();nt()});var rh,ao,Ti=p(()=>{"use strict";rh=typeof global=="object"&&global&&global.Object===Object&&global,ao=rh});var oh,ih,L,ct=p(()=>{"use strict";Ti();oh=typeof self=="object"&&self&&self.Object===Object&&self,ih=ao||oh||Function("return this")(),L=ih});var sh,at,sr=p(()=>{"use strict";ct();sh=L.Symbol,at=sh});function fh(r){var t=nh.call(r,nr),e=r[nr];try{r[nr]=void 0;var o=!0}catch(s){}var i=ah.call(r);return o&&(t?r[nr]=e:delete r[nr]),i}var Fs,nh,ah,nr,Ns,Bs=p(()=>{"use strict";sr();Fs=Object.prototype,nh=Fs.hasOwnProperty,ah=Fs.toString,nr=at?at.toStringTag:void 0;Ns=fh});function ph(r){return uh.call(r)}var lh,uh,js,Ws=p(()=>{"use strict";lh=Object.prototype,uh=lh.toString;js=ph});function mh(r){return r==null?r===void 0?ch:hh:Us&&Us in Object(r)?Ns(r):js(r)}var hh,ch,Us,et,le=p(()=>{"use strict";sr();Bs();Ws();hh="[object Null]",ch="[object Undefined]",Us=at?at.toStringTag:void 0;et=mh});function dh(r){return r!=null&&typeof r=="object"}var V,Ut=p(()=>{"use strict";V=dh});function xh(r){return typeof r=="symbol"||V(r)&&et(r)==gh}var gh,Oe,fo=p(()=>{"use strict";le();Ut();gh="[object Symbol]";Oe=xh});function yh(r,t){for(var e=-1,o=r==null?0:r.length,i=Array(o);++e<o;)i[e]=t(r[e],e,r);return i}var $s,Gs=p(()=>{"use strict";$s=yh});var wh,D,mt=p(()=>{"use strict";wh=Array.isArray,D=wh});function zs(r){if(typeof r=="string")return r;if(D(r))return $s(r,zs)+"";if(Oe(r))return qs?qs.call(r):"";var t=r+"";return t=="0"&&1/r==-bh?"-0":t}var bh,Hs,qs,Ks,Qs=p(()=>{"use strict";sr();Gs();mt();fo();bh=1/0,Hs=at?at.prototype:void 0,qs=Hs?Hs.toString:void 0;Ks=zs});function Sh(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}var z,_t=p(()=>{"use strict";z=Sh});function vh(r){return r}var Te,lo=p(()=>{"use strict";Te=vh});function Th(r){if(!z(r))return!1;var t=et(r);return t==Eh||t==kh||t==Ch||t==Oh}var Ch,Eh,kh,Oh,Ae,uo=p(()=>{"use strict";le();_t();Ch="[object AsyncFunction]",Eh="[object Function]",kh="[object GeneratorFunction]",Oh="[object Proxy]";Ae=Th});var Ah,po,Vs=p(()=>{"use strict";ct();Ah=L["__core-js_shared__"],po=Ah});function Ph(r){return!!Js&&Js in r}var Js,Ys,Zs=p(()=>{"use strict";Vs();Js=function(){var r=/[^.]+$/.exec(po&&po.keys&&po.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();Ys=Ph});function Dh(r){if(r!=null){try{return Rh.call(r)}catch(t){}try{return r+""}catch(t){}}return""}var _h,Rh,Rt,Ai=p(()=>{"use strict";_h=Function.prototype,Rh=_h.toString;Rt=Dh});function Wh(r){if(!z(r)||Ys(r))return!1;var t=Ae(r)?jh:Ih;return t.test(Rt(r))}var Mh,Ih,Lh,Fh,Nh,Bh,jh,Xs,tn=p(()=>{"use strict";uo();Zs();_t();Ai();Mh=/[\\^$.*+?()[\]{}|]/g,Ih=/^\[object .+?Constructor\]$/,Lh=Function.prototype,Fh=Object.prototype,Nh=Lh.toString,Bh=Fh.hasOwnProperty,jh=RegExp("^"+Nh.call(Bh).replace(Mh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");Xs=Wh});function Uh(r,t){return r==null?void 0:r[t]}var en,rn=p(()=>{"use strict";en=Uh});function $h(r,t){var e=en(r,t);return Xs(e)?e:void 0}var tt,$t=p(()=>{"use strict";tn();rn();tt=$h});var Gh,ho,on=p(()=>{"use strict";$t();ct();Gh=tt(L,"WeakMap"),ho=Gh});var sn,Hh,nn,an=p(()=>{"use strict";_t();sn=Object.create,Hh=function(){function r(){}return function(t){if(!z(t))return{};if(sn)return sn(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}(),nn=Hh});function qh(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}var fn,ln=p(()=>{"use strict";fn=qh});function zh(r,t){var e=-1,o=r.length;for(t||(t=Array(o));++e<o;)t[e]=r[e];return t}var un,pn=p(()=>{"use strict";un=zh});function Jh(r){var t=0,e=0;return function(){var o=Vh(),i=Qh-(o-e);if(e=o,i>0){if(++t>=Kh)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}var Kh,Qh,Vh,hn,cn=p(()=>{"use strict";Kh=800,Qh=16,Vh=Date.now;hn=Jh});function Yh(r){return function(){return r}}var mn,dn=p(()=>{"use strict";mn=Yh});var Zh,Pe,Pi=p(()=>{"use strict";$t();Zh=function(){try{var r=tt(Object,"defineProperty");return r({},"",{}),r}catch(t){}}(),Pe=Zh});var Xh,gn,xn=p(()=>{"use strict";dn();Pi();lo();Xh=Pe?function(r,t){return Pe(r,"toString",{configurable:!0,enumerable:!1,value:mn(t),writable:!0})}:Te,gn=Xh});var tc,yn,wn=p(()=>{"use strict";xn();cn();tc=hn(gn),yn=tc});function oc(r,t){var e=typeof r;return t=t==null?ec:t,!!t&&(e=="number"||e!="symbol"&&rc.test(r))&&r>-1&&r%1==0&&r<t}var ec,rc,_e,co=p(()=>{"use strict";ec=9007199254740991,rc=/^(?:0|[1-9]\d*)$/;_e=oc});function ic(r,t,e){t=="__proto__"&&Pe?Pe(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}var Gt,ar=p(()=>{"use strict";Pi();Gt=ic});function sc(r,t){return r===t||r!==r&&t!==t}var St,Re=p(()=>{"use strict";St=sc});function fc(r,t,e){var o=r[t];(!(ac.call(r,t)&&St(o,e))||e===void 0&&!(t in r))&&Gt(r,t,e)}var nc,ac,bn,Sn=p(()=>{"use strict";ar();Re();nc=Object.prototype,ac=nc.hasOwnProperty;bn=fc});function lc(r,t,e,o){var i=!e;e||(e={});for(var s=-1,n=t.length;++s<n;){var f=t[s],l=o?o(e[f],r[f],f,e,r):void 0;l===void 0&&(l=r[f]),i?Gt(e,f,l):bn(e,f,l)}return e}var vn,Cn=p(()=>{"use strict";Sn();ar();vn=lc});function uc(r,t,e){return t=En(t===void 0?r.length-1:t,0),function(){for(var o=arguments,i=-1,s=En(o.length-t,0),n=Array(s);++i<s;)n[i]=o[t+i];i=-1;for(var f=Array(t+1);++i<t;)f[i]=o[i];return f[t]=e(n),fn(r,this,f)}}var En,kn,On=p(()=>{"use strict";ln();En=Math.max;kn=uc});function pc(r,t){return yn(kn(r,t,Te),r+"")}var Tn,An=p(()=>{"use strict";lo();On();wn();Tn=pc});function cc(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=hc}var hc,De,mo=p(()=>{"use strict";hc=9007199254740991;De=cc});function mc(r){return r!=null&&De(r.length)&&!Ae(r)}var vt,Me=p(()=>{"use strict";uo();mo();vt=mc});function dc(r,t,e){if(!z(e))return!1;var o=typeof t;return(o=="number"?vt(e)&&_e(t,e.length):o=="string"&&t in e)?St(e[t],r):!1}var Pn,_n=p(()=>{"use strict";Re();Me();co();_t();Pn=dc});function gc(r){return Tn(function(t,e){var o=-1,i=e.length,s=i>1?e[i-1]:void 0,n=i>2?e[2]:void 0;for(s=r.length>3&&typeof s=="function"?(i--,s):void 0,n&&Pn(e[0],e[1],n)&&(s=i<3?void 0:s,i=1),t=Object(t);++o<i;){var f=e[o];f&&r(t,f,o,s)}return t})}var Rn,Dn=p(()=>{"use strict";An();_n();Rn=gc});function yc(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||xc;return r===e}var xc,Ie,go=p(()=>{"use strict";xc=Object.prototype;Ie=yc});function wc(r,t){for(var e=-1,o=Array(r);++e<r;)o[e]=t(e);return o}var Mn,In=p(()=>{"use strict";Mn=wc});function Sc(r){return V(r)&&et(r)==bc}var bc,_i,Ln=p(()=>{"use strict";le();Ut();bc="[object Arguments]";_i=Sc});var Fn,vc,Cc,Ec,ue,xo=p(()=>{"use strict";Ln();Ut();Fn=Object.prototype,vc=Fn.hasOwnProperty,Cc=Fn.propertyIsEnumerable,Ec=_i(function(){return arguments}())?_i:function(r){return V(r)&&vc.call(r,"callee")&&!Cc.call(r,"callee")},ue=Ec});function kc(){return!1}var Nn,Bn=p(()=>{"use strict";Nn=kc});var Un,jn,Oc,Wn,Tc,Ac,pe,yo=p(()=>{"use strict";ct();Bn();Un=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jn=Un&&typeof module=="object"&&module&&!module.nodeType&&module,Oc=jn&&jn.exports===Un,Wn=Oc?L.Buffer:void 0,Tc=Wn?Wn.isBuffer:void 0,Ac=Tc||Nn,pe=Ac});function Xc(r){return V(r)&&De(r.length)&&!!P[et(r)]}var Pc,_c,Rc,Dc,Mc,Ic,Lc,Fc,Nc,Bc,jc,Wc,Uc,$c,Gc,Hc,qc,zc,Kc,Qc,Vc,Jc,Yc,Zc,P,$n,Gn=p(()=>{"use strict";le();mo();Ut();Pc="[object Arguments]",_c="[object Array]",Rc="[object Boolean]",Dc="[object Date]",Mc="[object Error]",Ic="[object Function]",Lc="[object Map]",Fc="[object Number]",Nc="[object Object]",Bc="[object RegExp]",jc="[object Set]",Wc="[object String]",Uc="[object WeakMap]",$c="[object ArrayBuffer]",Gc="[object DataView]",Hc="[object Float32Array]",qc="[object Float64Array]",zc="[object Int8Array]",Kc="[object Int16Array]",Qc="[object Int32Array]",Vc="[object Uint8Array]",Jc="[object Uint8ClampedArray]",Yc="[object Uint16Array]",Zc="[object Uint32Array]",P={};P[Hc]=P[qc]=P[zc]=P[Kc]=P[Qc]=P[Vc]=P[Jc]=P[Yc]=P[Zc]=!0;P[Pc]=P[_c]=P[$c]=P[Rc]=P[Gc]=P[Dc]=P[Mc]=P[Ic]=P[Lc]=P[Fc]=P[Nc]=P[Bc]=P[jc]=P[Wc]=P[Uc]=!1;$n=Xc});function tm(r){return function(t){return r(t)}}var Hn,qn=p(()=>{"use strict";Hn=tm});var zn,fr,em,Ri,rm,Di,Kn=p(()=>{"use strict";Ti();zn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fr=zn&&typeof module=="object"&&module&&!module.nodeType&&module,em=fr&&fr.exports===zn,Ri=em&&ao.process,rm=function(){try{var r=fr&&fr.require&&fr.require("util").types;return r||Ri&&Ri.binding&&Ri.binding("util")}catch(t){}}(),Di=rm});var Qn,om,Le,wo=p(()=>{"use strict";Gn();qn();Kn();Qn=Di&&Di.isTypedArray,om=Qn?Hn(Qn):$n,Le=om});function nm(r,t){var e=D(r),o=!e&&ue(r),i=!e&&!o&&pe(r),s=!e&&!o&&!i&&Le(r),n=e||o||i||s,f=n?Mn(r.length,String):[],l=f.length;for(var u in r)(t||sm.call(r,u))&&!(n&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||_e(u,l)))&&f.push(u);return f}var im,sm,bo,Mi=p(()=>{"use strict";In();xo();mt();yo();co();wo();im=Object.prototype,sm=im.hasOwnProperty;bo=nm});function am(r,t){return function(e){return r(t(e))}}var So,Ii=p(()=>{"use strict";So=am});var fm,Vn,Jn=p(()=>{"use strict";Ii();fm=So(Object.keys,Object),Vn=fm});function pm(r){if(!Ie(r))return Vn(r);var t=[];for(var e in Object(r))um.call(r,e)&&e!="constructor"&&t.push(e);return t}var lm,um,Yn,Zn=p(()=>{"use strict";go();Jn();lm=Object.prototype,um=lm.hasOwnProperty;Yn=pm});function hm(r){return vt(r)?bo(r):Yn(r)}var Fe,vo=p(()=>{"use strict";Mi();Zn();Me();Fe=hm});function cm(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}var Xn,ta=p(()=>{"use strict";Xn=cm});function gm(r){if(!z(r))return Xn(r);var t=Ie(r),e=[];for(var o in r)o=="constructor"&&(t||!dm.call(r,o))||e.push(o);return e}var mm,dm,ea,ra=p(()=>{"use strict";_t();go();ta();mm=Object.prototype,dm=mm.hasOwnProperty;ea=gm});function xm(r){return vt(r)?bo(r,!0):ea(r)}var Co,Li=p(()=>{"use strict";Mi();ra();Me();Co=xm});function bm(r,t){if(D(r))return!1;var e=typeof r;return e=="number"||e=="symbol"||e=="boolean"||r==null||Oe(r)?!0:wm.test(r)||!ym.test(r)||t!=null&&r in Object(t)}var ym,wm,Ne,Eo=p(()=>{"use strict";mt();fo();ym=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wm=/^\w*$/;Ne=bm});var Sm,Dt,lr=p(()=>{"use strict";$t();Sm=tt(Object,"create"),Dt=Sm});function vm(){this.__data__=Dt?Dt(null):{},this.size=0}var oa,ia=p(()=>{"use strict";lr();oa=vm});function Cm(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}var sa,na=p(()=>{"use strict";sa=Cm});function Tm(r){var t=this.__data__;if(Dt){var e=t[r];return e===Em?void 0:e}return Om.call(t,r)?t[r]:void 0}var Em,km,Om,aa,fa=p(()=>{"use strict";lr();Em="__lodash_hash_undefined__",km=Object.prototype,Om=km.hasOwnProperty;aa=Tm});function _m(r){var t=this.__data__;return Dt?t[r]!==void 0:Pm.call(t,r)}var Am,Pm,la,ua=p(()=>{"use strict";lr();Am=Object.prototype,Pm=Am.hasOwnProperty;la=_m});function Dm(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=Dt&&t===void 0?Rm:t,this}var Rm,pa,ha=p(()=>{"use strict";lr();Rm="__lodash_hash_undefined__";pa=Dm});function Be(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}var Fi,ca=p(()=>{"use strict";ia();na();fa();ua();ha();Be.prototype.clear=oa;Be.prototype.delete=sa;Be.prototype.get=aa;Be.prototype.has=la;Be.prototype.set=pa;Fi=Be});function Mm(){this.__data__=[],this.size=0}var ma,da=p(()=>{"use strict";ma=Mm});function Im(r,t){for(var e=r.length;e--;)if(St(r[e][0],t))return e;return-1}var Ht,ur=p(()=>{"use strict";Re();Ht=Im});function Nm(r){var t=this.__data__,e=Ht(t,r);if(e<0)return!1;var o=t.length-1;return e==o?t.pop():Fm.call(t,e,1),--this.size,!0}var Lm,Fm,ga,xa=p(()=>{"use strict";ur();Lm=Array.prototype,Fm=Lm.splice;ga=Nm});function Bm(r){var t=this.__data__,e=Ht(t,r);return e<0?void 0:t[e][1]}var ya,wa=p(()=>{"use strict";ur();ya=Bm});function jm(r){return Ht(this.__data__,r)>-1}var ba,Sa=p(()=>{"use strict";ur();ba=jm});function Wm(r,t){var e=this.__data__,o=Ht(e,r);return o<0?(++this.size,e.push([r,t])):e[o][1]=t,this}var va,Ca=p(()=>{"use strict";ur();va=Wm});function je(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}var qt,pr=p(()=>{"use strict";da();xa();wa();Sa();Ca();je.prototype.clear=ma;je.prototype.delete=ga;je.prototype.get=ya;je.prototype.has=ba;je.prototype.set=va;qt=je});var Um,zt,ko=p(()=>{"use strict";$t();ct();Um=tt(L,"Map"),zt=Um});function $m(){this.size=0,this.__data__={hash:new Fi,map:new(zt||qt),string:new Fi}}var Ea,ka=p(()=>{"use strict";ca();pr();ko();Ea=$m});function Gm(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}var Oa,Ta=p(()=>{"use strict";Oa=Gm});function Hm(r,t){var e=r.__data__;return Oa(t)?e[typeof t=="string"?"string":"hash"]:e.map}var Kt,hr=p(()=>{"use strict";Ta();Kt=Hm});function qm(r){var t=Kt(this,r).delete(r);return this.size-=t?1:0,t}var Aa,Pa=p(()=>{"use strict";hr();Aa=qm});function zm(r){return Kt(this,r).get(r)}var _a,Ra=p(()=>{"use strict";hr();_a=zm});function Km(r){return Kt(this,r).has(r)}var Da,Ma=p(()=>{"use strict";hr();Da=Km});function Qm(r,t){var e=Kt(this,r),o=e.size;return e.set(r,t),this.size+=e.size==o?0:1,this}var Ia,La=p(()=>{"use strict";hr();Ia=Qm});function We(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}var he,Oo=p(()=>{"use strict";ka();Pa();Ra();Ma();La();We.prototype.clear=Ea;We.prototype.delete=Aa;We.prototype.get=_a;We.prototype.has=Da;We.prototype.set=Ia;he=We});function Ni(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError(Vm);var e=function(){var o=arguments,i=t?t.apply(this,o):o[0],s=e.cache;if(s.has(i))return s.get(i);var n=r.apply(this,o);return e.cache=s.set(i,n)||s,n};return e.cache=new(Ni.Cache||he),e}var Vm,ft,Bi=p(()=>{"use strict";Oo();Vm="Expected a function";Ni.Cache=he;ft=Ni});function Ym(r){var t=ft(r,function(o){return e.size===Jm&&e.clear(),o}),e=t.cache;return t}var Jm,Fa,Na=p(()=>{"use strict";Bi();Jm=500;Fa=Ym});var Zm,Xm,td,Ba,ja=p(()=>{"use strict";Na();Zm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xm=/\\(\\)?/g,td=Fa(function(r){var t=[];return r.charCodeAt(0)===46&&t.push(""),r.replace(Zm,function(e,o,i,s){t.push(i?s.replace(Xm,"$1"):o||e)}),t}),Ba=td});function ed(r){return r==null?"":Ks(r)}var Wa,Ua=p(()=>{"use strict";Qs();Wa=ed});function rd(r,t){return D(r)?r:Ne(r,t)?[r]:Ba(Wa(r))}var To,ji=p(()=>{"use strict";mt();Eo();ja();Ua();To=rd});function id(r){if(typeof r=="string"||Oe(r))return r;var t=r+"";return t=="0"&&1/r==-od?"-0":t}var od,Qt,cr=p(()=>{"use strict";fo();od=1/0;Qt=id});function sd(r,t){t=To(t,r);for(var e=0,o=t.length;r!=null&&e<o;)r=r[Qt(t[e++])];return e&&e==o?r:void 0}var Ao,Wi=p(()=>{"use strict";ji();cr();Ao=sd});function nd(r,t,e){var o=r==null?void 0:Ao(r,t);return o===void 0?e:o}var $a,Ga=p(()=>{"use strict";Wi();$a=nd});function ad(r,t){for(var e=-1,o=t.length,i=r.length;++e<o;)r[i+e]=t[e];return r}var Ha,qa=p(()=>{"use strict";Ha=ad});var fd,Po,Ui=p(()=>{"use strict";Ii();fd=So(Object.getPrototypeOf,Object),Po=fd});function md(r){if(!V(r)||et(r)!=ld)return!1;var t=Po(r);if(t===null)return!0;var e=hd.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&za.call(e)==cd}var ld,ud,pd,za,hd,cd,Ka,Qa=p(()=>{"use strict";le();Ui();Ut();ld="[object Object]",ud=Function.prototype,pd=Object.prototype,za=ud.toString,hd=pd.hasOwnProperty,cd=za.call(Object);Ka=md});function dd(){this.__data__=new qt,this.size=0}var Va,Ja=p(()=>{"use strict";pr();Va=dd});function gd(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}var Ya,Za=p(()=>{"use strict";Ya=gd});function xd(r){return this.__data__.get(r)}var Xa,tf=p(()=>{"use strict";Xa=xd});function yd(r){return this.__data__.has(r)}var ef,rf=p(()=>{"use strict";ef=yd});function bd(r,t){var e=this.__data__;if(e instanceof qt){var o=e.__data__;if(!zt||o.length<wd-1)return o.push([r,t]),this.size=++e.size,this;e=this.__data__=new he(o)}return e.set(r,t),this.size=e.size,this}var wd,of,sf=p(()=>{"use strict";pr();ko();Oo();wd=200;of=bd});function Ue(r){var t=this.__data__=new qt(r);this.size=t.size}var Vt,_o=p(()=>{"use strict";pr();Ja();Za();tf();rf();sf();Ue.prototype.clear=Va;Ue.prototype.delete=Ya;Ue.prototype.get=Xa;Ue.prototype.has=ef;Ue.prototype.set=of;Vt=Ue});function vd(r,t){if(t)return r.slice();var e=r.length,o=ff?ff(e):new r.constructor(e);return r.copy(o),o}var lf,nf,Sd,af,ff,uf,pf=p(()=>{"use strict";ct();lf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nf=lf&&typeof module=="object"&&module&&!module.nodeType&&module,Sd=nf&&nf.exports===lf,af=Sd?L.Buffer:void 0,ff=af?af.allocUnsafe:void 0;uf=vd});function Cd(r,t){for(var e=-1,o=r==null?0:r.length,i=0,s=[];++e<o;){var n=r[e];t(n,e,r)&&(s[i++]=n)}return s}var hf,cf=p(()=>{"use strict";hf=Cd});function Ed(){return[]}var mf,df=p(()=>{"use strict";mf=Ed});var kd,Od,gf,Td,xf,yf=p(()=>{"use strict";cf();df();kd=Object.prototype,Od=kd.propertyIsEnumerable,gf=Object.getOwnPropertySymbols,Td=gf?function(r){return r==null?[]:(r=Object(r),hf(gf(r),function(t){return Od.call(r,t)}))}:mf,xf=Td});function Ad(r,t,e){var o=t(r);return D(r)?o:Ha(o,e(r))}var wf,bf=p(()=>{"use strict";qa();mt();wf=Ad});function Pd(r){return wf(r,Fe,xf)}var $i,Sf=p(()=>{"use strict";bf();yf();vo();$i=Pd});var _d,Ro,vf=p(()=>{"use strict";$t();ct();_d=tt(L,"DataView"),Ro=_d});var Rd,Do,Cf=p(()=>{"use strict";$t();ct();Rd=tt(L,"Promise"),Do=Rd});var Dd,Mo,Ef=p(()=>{"use strict";$t();ct();Dd=tt(L,"Set"),Mo=Dd});var kf,Md,Of,Tf,Af,Pf,Id,Ld,Fd,Nd,Bd,ce,Gi,_f=p(()=>{"use strict";vf();ko();Cf();Ef();on();le();Ai();kf="[object Map]",Md="[object Object]",Of="[object Promise]",Tf="[object Set]",Af="[object WeakMap]",Pf="[object DataView]",Id=Rt(Ro),Ld=Rt(zt),Fd=Rt(Do),Nd=Rt(Mo),Bd=Rt(ho),ce=et;(Ro&&ce(new Ro(new ArrayBuffer(1)))!=Pf||zt&&ce(new zt)!=kf||Do&&ce(Do.resolve())!=Of||Mo&&ce(new Mo)!=Tf||ho&&ce(new ho)!=Af)&&(ce=function(r){var t=et(r),e=t==Md?r.constructor:void 0,o=e?Rt(e):"";if(o)switch(o){case Id:return Pf;case Ld:return kf;case Fd:return Of;case Nd:return Tf;case Bd:return Af}return t});Gi=ce});var jd,$e,Hi=p(()=>{"use strict";ct();jd=L.Uint8Array,$e=jd});function Wd(r){var t=new r.constructor(r.byteLength);return new $e(t).set(new $e(r)),t}var Rf,Df=p(()=>{"use strict";Hi();Rf=Wd});function Ud(r,t){var e=t?Rf(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}var Mf,If=p(()=>{"use strict";Df();Mf=Ud});function $d(r){return typeof r.constructor=="function"&&!Ie(r)?nn(Po(r)):{}}var Lf,Ff=p(()=>{"use strict";an();Ui();go();Lf=$d});function Hd(r){return this.__data__.set(r,Gd),this}var Gd,Nf,Bf=p(()=>{"use strict";Gd="__lodash_hash_undefined__";Nf=Hd});function qd(r){return this.__data__.has(r)}var jf,Wf=p(()=>{"use strict";jf=qd});function Io(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new he;++t<e;)this.add(r[t])}var Uf,$f=p(()=>{"use strict";Oo();Bf();Wf();Io.prototype.add=Io.prototype.push=Nf;Io.prototype.has=jf;Uf=Io});function zd(r,t){for(var e=-1,o=r==null?0:r.length;++e<o;)if(t(r[e],e,r))return!0;return!1}var Gf,Hf=p(()=>{"use strict";Gf=zd});function Kd(r,t){return r.has(t)}var qf,zf=p(()=>{"use strict";qf=Kd});function Jd(r,t,e,o,i,s){var n=e&Qd,f=r.length,l=t.length;if(f!=l&&!(n&&l>f))return!1;var u=s.get(r),h=s.get(t);if(u&&h)return u==t&&h==r;var d=-1,m=!0,y=e&Vd?new Uf:void 0;for(s.set(r,t),s.set(t,r);++d<f;){var b=r[d],x=t[d];if(o)var C=n?o(x,b,d,t,r,s):o(b,x,d,r,t,s);if(C!==void 0){if(C)continue;m=!1;break}if(y){if(!Gf(t,function(E,T){if(!qf(y,T)&&(b===E||i(b,E,e,o,s)))return y.push(T)})){m=!1;break}}else if(!(b===x||i(b,x,e,o,s))){m=!1;break}}return s.delete(r),s.delete(t),m}var Qd,Vd,Lo,qi=p(()=>{"use strict";$f();Hf();zf();Qd=1,Vd=2;Lo=Jd});function Yd(r){var t=-1,e=Array(r.size);return r.forEach(function(o,i){e[++t]=[i,o]}),e}var Kf,Qf=p(()=>{"use strict";Kf=Yd});function Zd(r){var t=-1,e=Array(r.size);return r.forEach(function(o){e[++t]=o}),e}var Vf,Jf=p(()=>{"use strict";Vf=Zd});function hg(r,t,e,o,i,s,n){switch(e){case pg:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case ug:return!(r.byteLength!=t.byteLength||!s(new $e(r),new $e(t)));case eg:case rg:case sg:return St(+r,+t);case og:return r.name==t.name&&r.message==t.message;case ng:case fg:return r==t+"";case ig:var f=Kf;case ag:var l=o&Xd;if(f||(f=Vf),r.size!=t.size&&!l)return!1;var u=n.get(r);if(u)return u==t;o|=tg,n.set(r,t);var h=Lo(f(r),f(t),o,i,s,n);return n.delete(r),h;case lg:if(zi)return zi.call(r)==zi.call(t)}return!1}var Xd,tg,eg,rg,og,ig,sg,ng,ag,fg,lg,ug,pg,Yf,zi,Zf,Xf=p(()=>{"use strict";sr();Hi();Re();qi();Qf();Jf();Xd=1,tg=2,eg="[object Boolean]",rg="[object Date]",og="[object Error]",ig="[object Map]",sg="[object Number]",ng="[object RegExp]",ag="[object Set]",fg="[object String]",lg="[object Symbol]",ug="[object ArrayBuffer]",pg="[object DataView]",Yf=at?at.prototype:void 0,zi=Yf?Yf.valueOf:void 0;Zf=hg});function gg(r,t,e,o,i,s){var n=e&cg,f=$i(r),l=f.length,u=$i(t),h=u.length;if(l!=h&&!n)return!1;for(var d=l;d--;){var m=f[d];if(!(n?m in t:dg.call(t,m)))return!1}var y=s.get(r),b=s.get(t);if(y&&b)return y==t&&b==r;var x=!0;s.set(r,t),s.set(t,r);for(var C=n;++d<l;){m=f[d];var E=r[m],T=t[m];if(o)var A=n?o(T,E,m,t,r,s):o(E,T,m,r,t,s);if(!(A===void 0?E===T||i(E,T,e,o,s):A)){x=!1;break}C||(C=m=="constructor")}if(x&&!C){var _=r.constructor,N=t.constructor;_!=N&&"constructor"in r&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof N=="function"&&N instanceof N)&&(x=!1)}return s.delete(r),s.delete(t),x}var cg,mg,dg,tl,el=p(()=>{"use strict";Sf();cg=1,mg=Object.prototype,dg=mg.hasOwnProperty;tl=gg});function wg(r,t,e,o,i,s){var n=D(r),f=D(t),l=n?ol:Gi(r),u=f?ol:Gi(t);l=l==rl?Fo:l,u=u==rl?Fo:u;var h=l==Fo,d=u==Fo,m=l==u;if(m&&pe(r)){if(!pe(t))return!1;n=!0,h=!1}if(m&&!h)return s||(s=new Vt),n||Le(r)?Lo(r,t,e,o,i,s):Zf(r,t,l,e,o,i,s);if(!(e&xg)){var y=h&&il.call(r,"__wrapped__"),b=d&&il.call(t,"__wrapped__");if(y||b){var x=y?r.value():r,C=b?t.value():t;return s||(s=new Vt),i(x,C,e,o,s)}}return m?(s||(s=new Vt),tl(r,t,e,o,i,s)):!1}var xg,rl,ol,Fo,yg,il,sl,nl=p(()=>{"use strict";_o();qi();Xf();el();_f();mt();yo();wo();xg=1,rl="[object Arguments]",ol="[object Array]",Fo="[object Object]",yg=Object.prototype,il=yg.hasOwnProperty;sl=wg});function al(r,t,e,o,i){return r===t?!0:r==null||t==null||!V(r)&&!V(t)?r!==r&&t!==t:sl(r,t,e,o,al,i)}var No,Ki=p(()=>{"use strict";nl();Ut();No=al});function vg(r,t,e,o){var i=e.length,s=i,n=!o;if(r==null)return!s;for(r=Object(r);i--;){var f=e[i];if(n&&f[2]?f[1]!==r[f[0]]:!(f[0]in r))return!1}for(;++i<s;){f=e[i];var l=f[0],u=r[l],h=f[1];if(n&&f[2]){if(u===void 0&&!(l in r))return!1}else{var d=new Vt;if(o)var m=o(u,h,l,r,t,d);if(!(m===void 0?No(h,u,bg|Sg,o,d):m))return!1}}return!0}var bg,Sg,fl,ll=p(()=>{"use strict";_o();Ki();bg=1,Sg=2;fl=vg});function Cg(r){return r===r&&!z(r)}var Bo,Qi=p(()=>{"use strict";_t();Bo=Cg});function Eg(r){for(var t=Fe(r),e=t.length;e--;){var o=t[e],i=r[o];t[e]=[o,i,Bo(i)]}return t}var ul,pl=p(()=>{"use strict";Qi();vo();ul=Eg});function kg(r,t){return function(e){return e==null?!1:e[r]===t&&(t!==void 0||r in Object(e))}}var jo,Vi=p(()=>{"use strict";jo=kg});function Og(r){var t=ul(r);return t.length==1&&t[0][2]?jo(t[0][0],t[0][1]):function(e){return e===r||fl(e,r,t)}}var hl,cl=p(()=>{"use strict";ll();pl();Vi();hl=Og});function Tg(r,t){return r!=null&&t in Object(r)}var ml,dl=p(()=>{"use strict";ml=Tg});function Ag(r,t,e){t=To(t,r);for(var o=-1,i=t.length,s=!1;++o<i;){var n=Qt(t[o]);if(!(s=r!=null&&e(r,n)))break;r=r[n]}return s||++o!=i?s:(i=r==null?0:r.length,!!i&&De(i)&&_e(n,i)&&(D(r)||ue(r)))}var gl,xl=p(()=>{"use strict";ji();xo();mt();co();mo();cr();gl=Ag});function Pg(r,t){return r!=null&&gl(r,t,ml)}var yl,wl=p(()=>{"use strict";dl();xl();yl=Pg});function Dg(r,t){return Ne(r)&&Bo(t)?jo(Qt(r),t):function(e){var o=$a(e,r);return o===void 0&&o===t?yl(e,r):No(t,o,_g|Rg)}}var _g,Rg,bl,Sl=p(()=>{"use strict";Ki();Ga();wl();Eo();Qi();Vi();cr();_g=1,Rg=2;bl=Dg});function Mg(r){return function(t){return t==null?void 0:t[r]}}var vl,Cl=p(()=>{"use strict";vl=Mg});function Ig(r){return function(t){return Ao(t,r)}}var El,kl=p(()=>{"use strict";Wi();El=Ig});function Lg(r){return Ne(r)?vl(Qt(r)):El(r)}var Ol,Tl=p(()=>{"use strict";Cl();kl();Eo();cr();Ol=Lg});function Fg(r){return typeof r=="function"?r:r==null?Te:typeof r=="object"?D(r)?bl(r[0],r[1]):hl(r):Ol(r)}var Al,Pl=p(()=>{"use strict";cl();Sl();lo();mt();Tl();Al=Fg});function Ng(r,t,e,o){for(var i=-1,s=r==null?0:r.length;++i<s;){var n=r[i];t(o,n,e(n),r)}return o}var _l,Rl=p(()=>{"use strict";_l=Ng});function Bg(r){return function(t,e,o){for(var i=-1,s=Object(t),n=o(t),f=n.length;f--;){var l=n[r?f:++i];if(e(s[l],l,s)===!1)break}return t}}var Dl,Ml=p(()=>{"use strict";Dl=Bg});var jg,Wo,Ji=p(()=>{"use strict";Ml();jg=Dl(),Wo=jg});function Wg(r,t){return r&&Wo(r,t,Fe)}var Il,Ll=p(()=>{"use strict";Ji();vo();Il=Wg});function Ug(r,t){return function(e,o){if(e==null)return e;if(!vt(e))return r(e,o);for(var i=e.length,s=t?i:-1,n=Object(e);(t?s--:++s<i)&&o(n[s],s,n)!==!1;);return e}}var Fl,Nl=p(()=>{"use strict";Me();Fl=Ug});var $g,Bl,jl=p(()=>{"use strict";Ll();Nl();$g=Fl(Il),Bl=$g});function Gg(r,t,e,o){return Bl(r,function(i,s,n){t(o,i,e(i),n)}),o}var Wl,Ul=p(()=>{"use strict";jl();Wl=Gg});function Hg(r,t){return function(e,o){var i=D(e)?_l:Wl,s=t?t():{};return i(e,r,Al(o,2),s)}}var $l,Gl=p(()=>{"use strict";Rl();Ul();Pl();mt();$l=Hg});function qg(r,t,e){(e!==void 0&&!St(r[t],e)||e===void 0&&!(t in r))&&Gt(r,t,e)}var mr,Yi=p(()=>{"use strict";ar();Re();mr=qg});function zg(r){return V(r)&&vt(r)}var Hl,ql=p(()=>{"use strict";Me();Ut();Hl=zg});function Kg(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}var dr,Zi=p(()=>{"use strict";dr=Kg});function Qg(r){return vn(r,Co(r))}var zl,Kl=p(()=>{"use strict";Cn();Li();zl=Qg});function Vg(r,t,e,o,i,s,n){var f=dr(r,e),l=dr(t,e),u=n.get(l);if(u){mr(r,e,u);return}var h=s?s(f,l,e+"",r,t,n):void 0,d=h===void 0;if(d){var m=D(l),y=!m&&pe(l),b=!m&&!y&&Le(l);h=l,m||y||b?D(f)?h=f:Hl(f)?h=un(f):y?(d=!1,h=uf(l,!0)):b?(d=!1,h=Mf(l,!0)):h=[]:Ka(l)||ue(l)?(h=f,ue(f)?h=zl(f):(!z(f)||Ae(f))&&(h=Lf(l))):d=!1}d&&(n.set(l,h),i(h,l,o,s,n),n.delete(l)),mr(r,e,h)}var Ql,Vl=p(()=>{"use strict";Yi();pf();If();pn();Ff();xo();mt();ql();yo();uo();_t();Qa();wo();Zi();Kl();Ql=Vg});function Jl(r,t,e,o,i){r!==t&&Wo(t,function(s,n){if(i||(i=new Vt),z(s))Ql(r,t,n,e,Jl,o,i);else{var f=o?o(dr(r,n),s,n+"",r,t,i):void 0;f===void 0&&(f=s),mr(r,n,f)}},Co)}var Yl,Zl=p(()=>{"use strict";_o();Yi();Ji();Vl();_t();Li();Zi();Yl=Jl});var Jg,Yg,Zg,gr,Xl=p(()=>{"use strict";ar();Gl();Jg=Object.prototype,Yg=Jg.hasOwnProperty,Zg=$l(function(r,t,e){Yg.call(r,e)?r[e].push(t):Gt(r,e,[t])}),gr=Zg});var Xg,Xi,tu=p(()=>{"use strict";Zl();Dn();Xg=Rn(function(r,t,e){Yl(r,t,e)}),Xi=Xg});var Jt=p(()=>{"use strict";Xl();Bi();tu();});var hu=Rs((Jk,pu)=>{"use strict";pu.exports=lu;function lu(r,t,e){r instanceof RegExp&&(r=fu(r,e)),t instanceof RegExp&&(t=fu(t,e));var o=uu(r,t,e);return o&&{start:o[0],end:o[1],pre:e.slice(0,o[0]),body:e.slice(o[0]+r.length,o[1]),post:e.slice(o[1]+t.length)}}function fu(r,t){var e=t.match(r);return e?e[0]:null}lu.range=uu;function uu(r,t,e){var o,i,s,n,f,l=e.indexOf(r),u=e.indexOf(t,l+1),h=l;if(l>=0&&u>0){if(r===t)return[l,u];for(o=[],s=e.length;h>=0&&!f;)h==l?(o.push(h),l=e.indexOf(r,h+1)):o.length==1?f=[o.pop(),u]:(i=o.pop(),i<s&&(s=i,n=u),u=e.indexOf(t,h+1)),h=l<u&&l>=0?l:u;o.length&&(f=[s,n])}return f}});var bu=Rs((Yk,wu)=>{"use strict";var cu=hu();wu.exports=fx;var mu="\0SLASH"+Math.random()+"\0",du="\0OPEN"+Math.random()+"\0",es="\0CLOSE"+Math.random()+"\0",gu="\0COMMA"+Math.random()+"\0",xu="\0PERIOD"+Math.random()+"\0";function ts(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function nx(r){return r.split("\\\\").join(mu).split("\\{").join(du).split("\\}").join(es).split("\\,").join(gu).split("\\.").join(xu)}function ax(r){return r.split(mu).join("\\").split(du).join("{").split(es).join("}").split(gu).join(",").split(xu).join(".")}function yu(r){if(!r)return[""];var t=[],e=cu("{","}",r);if(!e)return r.split(",");var o=e.pre,i=e.body,s=e.post,n=o.split(",");n[n.length-1]+="{"+i+"}";var f=yu(s);return s.length&&(n[n.length-1]+=f.shift(),n.push.apply(n,f)),t.push.apply(t,n),t}function fx(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),xr(nx(r),!0).map(ax)):[]}function lx(r){return"{"+r+"}"}function ux(r){return/^-?0\d/.test(r)}function px(r,t){return r<=t}function hx(r,t){return r>=t}function xr(r,t){var e=[],o=cu("{","}",r);if(!o)return[r];var i=o.pre,s=o.post.length?xr(o.post,!1):[""];if(/\$$/.test(o.pre))for(var n=0;n<s.length;n++){var f=i+"{"+o.body+"}"+s[n];e.push(f)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),h=l||u,d=o.body.indexOf(",")>=0;if(!h&&!d)return o.post.match(/,.*\}/)?(r=o.pre+"{"+o.body+es+o.post,xr(r)):[r];var m;if(h)m=o.body.split(/\.\./);else if(m=yu(o.body),m.length===1&&(m=xr(m[0],!1).map(lx),m.length===1))return s.map(function(qp){return o.pre+m[0]+qp});var y;if(h){var b=ts(m[0]),x=ts(m[1]),C=Math.max(m[0].length,m[1].length),E=m.length==3?Math.abs(ts(m[2])):1,T=px,A=x<b;A&&(E*=-1,T=hx);var _=m.some(ux);y=[];for(var N=b;T(N,x);N+=E){var st;if(u)st=String.fromCharCode(N),st==="\\"&&(st="");else if(st=String(N),_){var As=C-st.length;if(As>0){var Ps=new Array(As+1).join("0");N<0?st="-"+Ps+st.slice(1):st=Ps+st}}y.push(st)}}else{y=[];for(var fe=0;fe<m.length;fe++)y.push.apply(y,xr(m[fe],!1))}for(var fe=0;fe<y.length;fe++)for(var n=0;n<s.length;n++){var f=i+y[fe]+s[n];(!t||h||f)&&e.push(f)}}return e}});function Cy(r,t){if(r instanceof ae)throw I("Command execution failed",r,{command:r.command,originalError:r.originalError}),r;if(r instanceof Error){let o=new ae(r.message,t,r);throw I("Failed to execute command",r,{command:t,stack:r.stack}),o}let e=new ae("Unknown error occurred during command execution",t);throw I("Failed to execute command",null,{error:r,command:t}),e}async function Mp(r,t={}){if(!r||typeof r!="string")throw new ae("Command must be a non-empty string",r);let e={encoding:"utf8",maxBuffer:5*1024*1024,timeout:3e4};try{let{stdout:o,stderr:i}=await vy(r,{...e,...t}),s=o.trim();if(!s)throw i?new ae(`Command failed with stderr: ${i}`,r):new ae("Command returned empty result",r);return s}catch(o){Cy(o,r)}}var Rp,Dp,vy,ae,Ip=p(()=>{"use strict";Rp=require("child_process"),Dp=require("util");Pt();vy=(0,Dp.promisify)(Rp.exec),ae=class extends Error{constructor(e,o,i){super(e);this.command=o;this.originalError=i;this.name="CommandExecutionError"}}});var Lp={};Zp(Lp,{getChromePassword:()=>ky});var Ey,ky,Fp=p(()=>{"use strict";Jt();Ip();Ey=async()=>Mp('security find-generic-password -w -s "Chrome Safe Storage"'),ky=ft(Ey)});function th(r){let t=r.split("."),e=[];e.push({name:"%",domain:r});for(let o=1;o<t.length-1;o++){let i=t.slice(o).join(".");e.push({name:"%",domain:i})}return e}function Oi(r){if(!r.includes("://"))try{return Oi(`https://${r}`)}catch(t){return[{name:"%",domain:r}]}try{let t=new URL(r);return th(t.hostname)}catch(t){return[{name:"%",domain:r}]}}var Ds=ke(require("minimist"),1);function Ms(r){let t=(0,Ds.default)(r,{string:["browser","profile","url","domain","name","output"],boolean:["help","version","verbose","dump","dump-grouped","render","render-grouped"],alias:{b:"browser",p:"profile",u:"url",d:"domain",n:"name",h:"help",v:"version",D:"dump-grouped",r:"render",R:"render-grouped"}}),{_:e,...o}=t;return{values:o,positionals:e}}nt();Pt();var su=require("fs"),Go=require("path"),nu=ke(require("fast-glob"),1);Pt();var ou=require("path");Jt();var eu={};Xi(eu,process.env);var Uo=eu.HOME;if(typeof Uo!="string"||Uo.length===0)throw new Error("HOME environment variable is not set or empty");var ru,Ge=(0,ou.join)((ru=Uo)!=null?ru:"","Library","Application Support","Google","Chrome");var iu=ke(require("better-sqlite3"),1);Jt();Pt();var tx=ft(r=>{try{return Promise.resolve(new iu.default(r,{readonly:!0}))}catch(t){throw I("Database open failed",t,{file:r}),t}});function ex(r){try{return r.close(),Promise.resolve()}catch(t){return I("Database close failed",t),Promise.reject(t instanceof Error?t:new Error("Failed to close database: Unknown error"))}}async function $o({file:r,sql:t,params:e,rowFilter:o,rowTransform:i}){let s;try{s=await tx(r);let f=s.prepare(t).all(e),l=o?f.filter(o):f;return i?l.map(i):l}catch(n){throw I("Database query failed",n,{file:r,sql:t}),n}finally{s&&await ex(s)}}function rx(r){if(typeof r!="string")return!1;let t=r.trim();return t.length===0?!1:(0,su.existsSync)(t)}async function ox(){let r=[(0,Go.join)(Ge,"Default/Cookies"),(0,Go.join)(Ge,"Profile */Cookies"),(0,Go.join)(Ge,"Profile Default/Cookies")],t=[];for(let e of r){let o=await(0,nu.default)(e);t.push(...o)}return bt("ChromeCookies","Found cookie files",{count:t.length,files:t}),t}function ix(r,t){let e=r==="%",o=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:o,params:i}}async function sx(r,t,e){try{let{sql:o,params:i}=ix(t,e);bt("ChromeCookies","Executing query",{sql:o,params:i});let s=await $o({file:r,sql:o,params:i,rowTransform:n=>({name:n.name,domain:n.host_key,value:n.encrypted_value,expiry:n.expires_utc})});return Ls("QueryCookies",!0,{file:r,count:s.length}),s}catch(o){return I("Failed to read cookie file",o,{file:r}),[]}}async function au({name:r,domain:t,file:e}){let o=typeof e=="string"&&e.length>0?[e]:await ox();if(o.length===0)return bt("ChromeCookies","No cookie files found"),[];let i=[];for(let s of o){if(!rx(s)){bt("ChromeCookies","Cookie file missing or invalid",{file:s});continue}let n=await sx(s,r,t);i.push(...n)}return bt("ChromeCookies","Query complete",{totalCookies:i.length}),i}var _u=ke(bu(),1);var yr=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")};var cx={"[: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]},wr=r=>r.replace(/[[\]\\-]/g,"\\$&"),mx=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Su=r=>r.join(""),vu=(r,t)=>{let e=t;if(r.charAt(e)!=="[")throw new Error("not in a brace expression");let o=[],i=[],s=e+1,n=!1,f=!1,l=!1,u=!1,h=e,d="";t:for(;s<r.length;){let x=r.charAt(s);if((x==="!"||x==="^")&&s===e+1){u=!0,s++;continue}if(x==="]"&&n&&!l){h=s+1;break}if(n=!0,x==="\\"&&!l){l=!0,s++;continue}if(x==="["&&!l){for(let[C,[E,T,A]]of Object.entries(cx))if(r.startsWith(C,s)){if(d)return["$.",!1,r.length-e,!0];s+=C.length,A?i.push(E):o.push(E),f=f||T;continue t}}if(l=!1,d){x>d?o.push(wr(d)+"-"+wr(x)):x===d&&o.push(wr(x)),d="",s++;continue}if(r.startsWith("-]",s+1)){o.push(wr(x+"-")),s+=2;continue}if(r.startsWith("-",s+1)){d=x,s+=2;continue}o.push(wr(x)),s++}if(h<s)return["",!1,0,!1];if(!o.length&&!i.length)return["$.",!1,r.length-e,!0];if(i.length===0&&o.length===1&&/^\\?.$/.test(o[0])&&!u){let x=o[0].length===2?o[0].slice(-1):o[0];return[mx(x),!1,h-e,!1]}let m="["+(u?"^":"")+Su(o)+"]",y="["+(u?"":"^")+Su(i)+"]";return[o.length&&i.length?"("+m+"|"+y+")":o.length?m:y,f,h-e,!0]};var dt=(r,{windowsPathsNoEscape:t=!1}={})=>t?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var dx=new Set(["!","?","+","*","@"]),Cu=r=>dx.has(r),gx="(?!(?:^|/)\\.\\.?(?:$|/))",Ho="(?!\\.)",xx=new Set(["[","."]),yx=new Set(["..","."]),wx=new Set("().*{}+?[]^$\\!"),bx=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),os="[^/]",Eu=os+"*?",ku=os+"+?",B,W,Mt,R,F,Yt,me,Zt,Ct,de,br,ge,Ou,Xt,qo,rs,Tu,J=class J{constructor(t,e,o={}){w(this,ge);c(this,"type");w(this,B);w(this,W);w(this,Mt,!1);w(this,R,[]);w(this,F);w(this,Yt);w(this,me);w(this,Zt,!1);w(this,Ct);w(this,de);w(this,br,!1);this.type=t,t&&g(this,W,!0),g(this,F,e),g(this,B,a(this,F)?a(a(this,F),B):this),g(this,Ct,a(this,B)===this?o:a(a(this,B),Ct)),g(this,me,a(this,B)===this?[]:a(a(this,B),me)),t==="!"&&!a(a(this,B),Zt)&&a(this,me).push(this),g(this,Yt,a(this,F)?a(a(this,F),R).length:0)}get hasMagic(){if(a(this,W)!==void 0)return a(this,W);for(let t of a(this,R))if(typeof t!="string"&&(t.type||t.hasMagic))return g(this,W,!0);return a(this,W)}toString(){return a(this,de)!==void 0?a(this,de):this.type?g(this,de,this.type+"("+a(this,R).map(t=>String(t)).join("|")+")"):g(this,de,a(this,R).map(t=>String(t)).join(""))}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof J&&a(e,F)===this))throw new Error("invalid part: "+e);a(this,R).push(e)}}toJSON(){var e;let t=this.type===null?a(this,R).slice().map(o=>typeof o=="string"?o:o.toJSON()):[this.type,...a(this,R).map(o=>o.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===a(this,B)||a(a(this,B),Zt)&&((e=a(this,F))==null?void 0:e.type)==="!")&&t.push({}),t}isStart(){var e;if(a(this,B)===this)return!0;if(!((e=a(this,F))!=null&&e.isStart()))return!1;if(a(this,Yt)===0)return!0;let t=a(this,F);for(let o=0;o<a(this,Yt);o++){let i=a(t,R)[o];if(!(i instanceof J&&i.type==="!"))return!1}return!0}isEnd(){var e,o,i;if(a(this,B)===this||((e=a(this,F))==null?void 0:e.type)==="!")return!0;if(!((o=a(this,F))!=null&&o.isEnd()))return!1;if(!this.type)return(i=a(this,F))==null?void 0:i.isEnd();let t=a(this,F)?a(a(this,F),R).length:0;return a(this,Yt)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new J(this.type,t);for(let o of a(this,R))e.copyIn(o);return e}static fromGlob(t,e={}){var i;let o=new J(null,void 0,e);return S(i=J,Xt,qo).call(i,t,o,0,e),o}toMMPattern(){if(this!==a(this,B))return a(this,B).toMMPattern();let t=this.toString(),[e,o,i,s]=this.toRegExpSource();if(!(i||a(this,W)||a(this,Ct).nocase&&!a(this,Ct).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return o;let f=(a(this,Ct).nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${e}$`,f),{_src:e,_glob:t})}get options(){return a(this,Ct)}toRegExpSource(t){var l;let e=t!=null?t:!!a(this,Ct).dot;if(a(this,B)===this&&S(this,ge,Ou).call(this),!this.type){let u=this.isStart()&&this.isEnd(),h=a(this,R).map(b=>{var A;let[x,C,E,T]=typeof b=="string"?S(A=J,Xt,Tu).call(A,b,a(this,W),u):b.toRegExpSource(t);return g(this,W,a(this,W)||E),g(this,Mt,a(this,Mt)||T),x}).join(""),d="";if(this.isStart()&&typeof a(this,R)[0]=="string"&&!(a(this,R).length===1&&yx.has(a(this,R)[0]))){let x=xx,C=e&&x.has(h.charAt(0))||h.startsWith("\\.")&&x.has(h.charAt(2))||h.startsWith("\\.\\.")&&x.has(h.charAt(4)),E=!e&&!t&&x.has(h.charAt(0));d=C?gx:E?Ho:""}let m="";return this.isEnd()&&a(a(this,B),Zt)&&((l=a(this,F))==null?void 0:l.type)==="!"&&(m="(?:$|\\/)"),[d+h+m,dt(h),g(this,W,!!a(this,W)),a(this,Mt)]}let o=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=S(this,ge,rs).call(this,e);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return g(this,R,[u]),this.type=null,g(this,W,void 0),[u,dt(this.toString()),!1,!1]}let n=!o||t||e||!Ho?"":S(this,ge,rs).call(this,!0);n===s&&(n=""),n&&(s=`(?:${s})(?:${n})*?`);let f="";if(this.type==="!"&&a(this,br))f=(this.isStart()&&!e?Ho:"")+ku;else{let u=this.type==="!"?"))"+(this.isStart()&&!e&&!t?Ho:"")+Eu+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&n?")":this.type==="*"&&n?")?":`)${this.type}`;f=i+s+u}return[f,dt(s),g(this,W,!!a(this,W)),a(this,Mt)]}};B=new WeakMap,W=new WeakMap,Mt=new WeakMap,R=new WeakMap,F=new WeakMap,Yt=new WeakMap,me=new WeakMap,Zt=new WeakMap,Ct=new WeakMap,de=new WeakMap,br=new WeakMap,ge=new WeakSet,Ou=function(){if(this!==a(this,B))throw new Error("should only call on root");if(a(this,Zt))return this;this.toString(),g(this,Zt,!0);let t;for(;t=a(this,me).pop();){if(t.type!=="!")continue;let e=t,o=a(e,F);for(;o;){for(let i=a(e,Yt)+1;!o.type&&i<a(o,R).length;i++)for(let s of a(t,R)){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(a(o,R)[i])}e=o,o=a(e,F)}}return this},Xt=new WeakSet,qo=function(t,e,o,i){var y,b;let s=!1,n=!1,f=-1,l=!1;if(e.type===null){let x=o,C="";for(;x<t.length;){let E=t.charAt(x++);if(s||E==="\\"){s=!s,C+=E;continue}if(n){x===f+1?(E==="^"||E==="!")&&(l=!0):E==="]"&&!(x===f+2&&l)&&(n=!1),C+=E;continue}else if(E==="["){n=!0,f=x,l=!1,C+=E;continue}if(!i.noext&&Cu(E)&&t.charAt(x)==="("){e.push(C),C="";let T=new J(E,e);x=S(y=J,Xt,qo).call(y,t,T,x,i),e.push(T);continue}C+=E}return e.push(C),x}let u=o+1,h=new J(null,e),d=[],m="";for(;u<t.length;){let x=t.charAt(u++);if(s||x==="\\"){s=!s,m+=x;continue}if(n){u===f+1?(x==="^"||x==="!")&&(l=!0):x==="]"&&!(u===f+2&&l)&&(n=!1),m+=x;continue}else if(x==="["){n=!0,f=u,l=!1,m+=x;continue}if(Cu(x)&&t.charAt(u)==="("){h.push(m),m="";let C=new J(x,h);h.push(C),u=S(b=J,Xt,qo).call(b,t,C,u,i);continue}if(x==="|"){h.push(m),m="",d.push(h),h=new J(null,e);continue}if(x===")")return m===""&&a(e,R).length===0&&g(e,br,!0),h.push(m),m="",e.push(...d,h),u;m+=x}return e.type=null,g(e,W,void 0),g(e,R,[t.substring(o-1)]),u},rs=function(t){return a(this,R).map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[o,i,s,n]=e.toRegExpSource(t);return g(this,Mt,a(this,Mt)||n),o}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")},Tu=function(t,e,o=!1){let i=!1,s="",n=!1;for(let f=0;f<t.length;f++){let l=t.charAt(f);if(i){i=!1,s+=(wx.has(l)?"\\":"")+l;continue}if(l==="\\"){f===t.length-1?s+="\\\\":i=!0;continue}if(l==="["){let[u,h,d,m]=vu(t,f);if(d){s+=u,n=n||h,f+=d-1,e=e||m;continue}}if(l==="*"){o&&t==="*"?s+=ku:s+=Eu,e=!0;continue}if(l==="?"){s+=os,e=!0;continue}s+=bx(l)}return[s,dt(t),!!e,n]},w(J,Xt);var He=J;var qe=(r,{windowsPathsNoEscape:t=!1}={})=>t?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");var Y=(r,t,e={})=>(yr(t),!e.nocomment&&t.charAt(0)==="#"?!1:new rt(t,e).match(r)),Sx=/^\*+([^+@!?\*\[\(]*)$/,vx=r=>t=>!t.startsWith(".")&&t.endsWith(r),Cx=r=>t=>t.endsWith(r),Ex=r=>(r=r.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(r)),kx=r=>(r=r.toLowerCase(),t=>t.toLowerCase().endsWith(r)),Ox=/^\*+\.\*+$/,Tx=r=>!r.startsWith(".")&&r.includes("."),Ax=r=>r!=="."&&r!==".."&&r.includes("."),Px=/^\.\*+$/,_x=r=>r!=="."&&r!==".."&&r.startsWith("."),Rx=/^\*+$/,Dx=r=>r.length!==0&&!r.startsWith("."),Mx=r=>r.length!==0&&r!=="."&&r!=="..",Ix=/^\?+([^+@!?\*\[\(]*)?$/,Lx=([r,t=""])=>{let e=Ru([r]);return t?(t=t.toLowerCase(),o=>e(o)&&o.toLowerCase().endsWith(t)):e},Fx=([r,t=""])=>{let e=Du([r]);return t?(t=t.toLowerCase(),o=>e(o)&&o.toLowerCase().endsWith(t)):e},Nx=([r,t=""])=>{let e=Du([r]);return t?o=>e(o)&&o.endsWith(t):e},Bx=([r,t=""])=>{let e=Ru([r]);return t?o=>e(o)&&o.endsWith(t):e},Ru=([r])=>{let t=r.length;return e=>e.length===t&&!e.startsWith(".")},Du=([r])=>{let t=r.length;return e=>e.length===t&&e!=="."&&e!==".."},Mu=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Au={win32:{sep:"\\"},posix:{sep:"/"}},jx=Mu==="win32"?Au.win32.sep:Au.posix.sep;Y.sep=jx;var q=Symbol("globstar **");Y.GLOBSTAR=q;var Wx="[^/]",Ux=Wx+"*?",$x="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Gx="(?:(?!(?:\\/|^)\\.).)*?",Hx=(r,t={})=>e=>Y(e,r,t);Y.filter=Hx;var lt=(r,t={})=>Object.assign({},r,t),qx=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return Y;let t=Y;return Object.assign((o,i,s={})=>t(o,i,lt(r,s)),{Minimatch:class extends t.Minimatch{constructor(i,s={}){super(i,lt(r,s))}static defaults(i){return t.defaults(lt(r,i)).Minimatch}},AST:class extends t.AST{constructor(i,s,n={}){super(i,s,lt(r,n))}static fromGlob(i,s={}){return t.AST.fromGlob(i,lt(r,s))}},unescape:(o,i={})=>t.unescape(o,lt(r,i)),escape:(o,i={})=>t.escape(o,lt(r,i)),filter:(o,i={})=>t.filter(o,lt(r,i)),defaults:o=>t.defaults(lt(r,o)),makeRe:(o,i={})=>t.makeRe(o,lt(r,i)),braceExpand:(o,i={})=>t.braceExpand(o,lt(r,i)),match:(o,i,s={})=>t.match(o,i,lt(r,s)),sep:t.sep,GLOBSTAR:q})};Y.defaults=qx;var Iu=(r,t={})=>(yr(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,_u.default)(r));Y.braceExpand=Iu;var zx=(r,t={})=>new rt(r,t).makeRe();Y.makeRe=zx;var Kx=(r,t,e={})=>{let o=new rt(t,e);return r=r.filter(i=>o.match(i)),o.options.nonull&&!r.length&&r.push(t),r};Y.match=Kx;var Pu=/[?*]|[+@!]\(.*?\)|\[|\]/,Qx=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),rt=class{constructor(t,e={}){c(this,"options");c(this,"set");c(this,"pattern");c(this,"windowsPathsNoEscape");c(this,"nonegate");c(this,"negate");c(this,"comment");c(this,"empty");c(this,"preserveMultipleSlashes");c(this,"partial");c(this,"globSet");c(this,"globParts");c(this,"nocase");c(this,"isWindows");c(this,"platform");c(this,"windowsNoMagicRoot");c(this,"regexp");yr(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Mu,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=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let o=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(o),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,n,f)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!Pu.test(s[2]))&&!Pu.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(h=>this.parse(h))];if(u)return[s[0],...s.slice(1).map(h=>this.parse(h))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let n=this.set[s];n[0]===""&&n[1]===""&&this.globParts[s][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 o=0;o<t.length;o++)for(let i=0;i<t[o].length;i++)t[o][i]==="**"&&(t[o][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 o=-1;for(;(o=e.indexOf("**",o+1))!==-1;){let i=o;for(;e[i+1]==="**";)i++;i!==o&&e.splice(o,i-o)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((o,i)=>{let s=o[o.length-1];return i==="**"&&s==="**"?o:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(o.pop(),o):(o.push(i),o)},[]),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 s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(e=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let o=0;for(;(o=t.indexOf("..",o+1))!==-1;){let i=t[o-1];i&&i!=="."&&i!==".."&&i!=="**"&&(e=!0,t.splice(o-1,2),o-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let o of t){let i=-1;for(;(i=o.indexOf("**",i+1))!==-1;){let n=i;for(;o[n+1]==="**";)n++;n>i&&o.splice(i+1,n-i);let f=o[i+1],l=o[i+2],u=o[i+3];if(f!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;e=!0,o.splice(i,1);let h=o.slice(0);h[i]="**",t.push(h),i--}if(!this.preserveMultipleSlashes){for(let n=1;n<o.length-1;n++){let f=o[n];n===1&&f===""&&o[0]===""||(f==="."||f==="")&&(e=!0,o.splice(n,1),n--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(e=!0,o.pop())}let s=0;for(;(s=o.indexOf("..",s+1))!==-1;){let n=o[s-1];if(n&&n!=="."&&n!==".."&&n!=="**"){e=!0;let l=s===1&&o[s+1]==="**"?["."]:[];o.splice(s-1,2,...l),o.length===0&&o.push(""),s-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let o=e+1;o<t.length;o++){let i=this.partsMatch(t[e],t[o],!this.preserveMultipleSlashes);if(i){t[e]=[],t[o]=i;break}}return t.filter(e=>e.length)}partsMatch(t,e,o=!1){let i=0,s=0,n=[],f="";for(;i<t.length&&s<e.length;)if(t[i]===e[s])n.push(f==="b"?e[s]:t[i]),i++,s++;else if(o&&t[i]==="**"&&e[s]===t[i+1])n.push(t[i]),i++;else if(o&&e[s]==="**"&&t[i]===e[s+1])n.push(e[s]),s++;else if(t[i]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(f==="b")return!1;f="a",n.push(t[i]),i++,s++}else if(e[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(f==="a")return!1;f="b",n.push(e[s]),i++,s++}else return!1;return t.length===e.length&&n}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,o=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,o++;o&&(this.pattern=t.slice(o)),this.negate=e}matchOne(t,e,o=!1){let i=this.options;if(this.isWindows){let x=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),C=!x&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),E=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),T=!E&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),A=C?3:x?0:void 0,_=T?3:E?0:void 0;if(typeof A=="number"&&typeof _=="number"){let[N,st]=[t[A],e[_]];N.toLowerCase()===st.toLowerCase()&&(e[_]=N,_>A?e=e.slice(_):A>_&&(t=t.slice(A)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var n=0,f=0,l=t.length,u=e.length;n<l&&f<u;n++,f++){this.debug("matchOne loop");var h=e[f],d=t[n];if(this.debug(e,h,d),h===!1)return!1;if(h===q){this.debug("GLOBSTAR",[e,h,d]);var m=n,y=f+1;if(y===u){for(this.debug("** at the end");n<l;n++)if(t[n]==="."||t[n]===".."||!i.dot&&t[n].charAt(0)===".")return!1;return!0}for(;m<l;){var b=t[m];if(this.debug(`
3
- globstar while`,t,m,e,y,b),this.matchOne(t.slice(m),e.slice(y),o))return this.debug("globstar found match!",m,l,b),!0;if(b==="."||b===".."||!i.dot&&b.charAt(0)==="."){this.debug("dot detected!",t,m,e,y);break}this.debug("globstar swallow a segment, and continue"),m++}return!!(o&&(this.debug(`
4
- >>> no match, partial?`,t,m,e,y),m===l))}let x;if(typeof h=="string"?(x=d===h,this.debug("string match",h,d,x)):(x=h.test(d),this.debug("pattern match",h,d,x)),!x)return!1}if(n===l&&f===u)return!0;if(n===l)return o;if(f===u)return n===l-1&&t[n]==="";throw new Error("wtf?")}braceExpand(){return Iu(this.pattern,this.options)}parse(t){yr(t);let e=this.options;if(t==="**")return q;if(t==="")return"";let o,i=null;(o=t.match(Rx))?i=e.dot?Mx:Dx:(o=t.match(Sx))?i=(e.nocase?e.dot?kx:Ex:e.dot?Cx:vx)(o[1]):(o=t.match(Ix))?i=(e.nocase?e.dot?Fx:Lx:e.dot?Nx:Bx)(o):(o=t.match(Ox))?i=e.dot?Ax:Tx:(o=t.match(Px))&&(i=_x);let s=He.fromGlob(t,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}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,o=e.noglobstar?Ux:e.dot?$x:Gx,i=new Set(e.nocase?["i"]:[]),s=t.map(l=>{let u=l.map(h=>{if(h instanceof RegExp)for(let d of h.flags.split(""))i.add(d);return typeof h=="string"?Qx(h):h===q?q:h._src});return u.forEach((h,d)=>{let m=u[d+1],y=u[d-1];h!==q||y===q||(y===void 0?m!==void 0&&m!==q?u[d+1]="(?:\\/|"+o+"\\/)?"+m:u[d]=o:m===void 0?u[d-1]=y+"(?:\\/|"+o+")?":m!==q&&(u[d-1]=y+"(?:\\/|\\/"+o+"\\/)"+m,u[d+1]=q))}),u.filter(h=>h!==q).join("/")}).join("|"),[n,f]=t.length>1?["(?:",")"]:["",""];s="^"+n+s+f+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...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 o=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let n=i[i.length-1];if(!n)for(let f=i.length-2;!n&&f>=0;f--)n=i[f];for(let f=0;f<s.length;f++){let l=s[f],u=i;if(o.matchBase&&l.length===1&&(u=[n]),this.matchOne(u,l,e))return o.flipNegate?!0:!this.negate}return o.flipNegate?!1:this.negate}static defaults(t){return Y.defaults(t).Minimatch}};Y.AST=He;Y.Minimatch=rt;Y.escape=qe;Y.unescape=dt;var Cp=require("url");var bs=require("lru-cache"),Ze=require("path"),lp=require("url"),At=require("fs"),iy=ke(require("fs"),1),oe=require("fs/promises");var Zo=require("events"),us=ke(require("stream"),1),ip=require("string_decoder");var Lu=typeof process=="object"&&process?process:{stdout:null,stderr:null},Vx=r=>!!r&&typeof r=="object"&&(r instanceof ee||r instanceof us.default||Jx(r)||Yx(r)),Jx=r=>!!r&&typeof r=="object"&&r instanceof Zo.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==us.default.Writable.prototype.pipe,Yx=r=>!!r&&typeof r=="object"&&r instanceof Zo.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function",It=Symbol("EOF"),Lt=Symbol("maybeEmitEnd"),te=Symbol("emittedEnd"),zo=Symbol("emittingEnd"),Sr=Symbol("emittedError"),Ko=Symbol("closed"),Fu=Symbol("read"),Qo=Symbol("flush"),Nu=Symbol("flushChunk"),gt=Symbol("encoding"),ze=Symbol("decoder"),U=Symbol("flowing"),vr=Symbol("paused"),Ke=Symbol("resume"),$=Symbol("buffer"),Z=Symbol("pipes"),G=Symbol("bufferLength"),is=Symbol("bufferPush"),Vo=Symbol("bufferShift"),K=Symbol("objectMode"),M=Symbol("destroyed"),ss=Symbol("error"),ns=Symbol("emitData"),Bu=Symbol("emitEnd"),as=Symbol("emitEnd2"),Et=Symbol("async"),fs=Symbol("abort"),Jo=Symbol("aborted"),Cr=Symbol("signal"),xe=Symbol("dataListeners"),ot=Symbol("discarded"),Er=r=>Promise.resolve().then(r),Zx=r=>r(),Xx=r=>r==="end"||r==="finish"||r==="prefinish",ty=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,ey=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Yo=class{constructor(t,e,o){c(this,"src");c(this,"dest");c(this,"opts");c(this,"ondrain");this.src=t,this.dest=e,this.opts=o,this.ondrain=()=>t[Ke](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ls=class extends Yo{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,o){super(t,e,o),this.proxyErrors=i=>e.emit("error",i),t.on("error",this.proxyErrors)}},ry=r=>!!r.objectMode,oy=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",ju,Wu,Uu,$u,Gu,Hu,qu,zu,Ku,Qu,Vu,Ju,Yu,Zu,Xu,tp,ep,rp,op,ee=class extends Zo.EventEmitter{constructor(...e){let o=e[0]||{};super();c(this,op,!1);c(this,rp,!1);c(this,ep,[]);c(this,tp,[]);c(this,Xu);c(this,Zu);c(this,Yu);c(this,Ju);c(this,Vu,!1);c(this,Qu,!1);c(this,Ku,!1);c(this,zu,!1);c(this,qu,null);c(this,Hu,0);c(this,Gu,!1);c(this,$u);c(this,Uu,!1);c(this,Wu,0);c(this,ju,!1);c(this,"writable",!0);c(this,"readable",!0);if(o.objectMode&&typeof o.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");ry(o)?(this[K]=!0,this[gt]=null):oy(o)?(this[gt]=o.encoding,this[K]=!1):(this[K]=!1,this[gt]=null),this[Et]=!!o.async,this[ze]=this[gt]?new ip.StringDecoder(this[gt]):null,o&&o.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[$]}),o&&o.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Z]});let{signal:i}=o;i&&(this[Cr]=i,i.aborted?this[fs]():i.addEventListener("abort",()=>this[fs]()))}get bufferLength(){return this[G]}get encoding(){return this[gt]}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[K]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Et]}set async(e){this[Et]=this[Et]||!!e}[(op=U,rp=vr,ep=Z,tp=$,Xu=K,Zu=gt,Yu=Et,Ju=ze,Vu=It,Qu=te,Ku=zo,zu=Ko,qu=Sr,Hu=G,Gu=M,$u=Cr,Uu=Jo,Wu=xe,ju=ot,fs)](){var e,o;this[Jo]=!0,this.emit("abort",(e=this[Cr])==null?void 0:e.reason),this.destroy((o=this[Cr])==null?void 0:o.reason)}get aborted(){return this[Jo]}set aborted(e){}write(e,o,i){var n;if(this[Jo])return!1;if(this[It])throw new Error("write after end");if(this[M])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof o=="function"&&(i=o,o="utf8"),o||(o="utf8");let s=this[Et]?Er:Zx;if(!this[K]&&!Buffer.isBuffer(e)){if(ey(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(ty(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[K]?(this[U]&&this[G]!==0&&this[Qo](!0),this[U]?this.emit("data",e):this[is](e),this[G]!==0&&this.emit("readable"),i&&s(i),this[U]):e.length?(typeof e=="string"&&!(o===this[gt]&&!((n=this[ze])!=null&&n.lastNeed))&&(e=Buffer.from(e,o)),Buffer.isBuffer(e)&&this[gt]&&(e=this[ze].write(e)),this[U]&&this[G]!==0&&this[Qo](!0),this[U]?this.emit("data",e):this[is](e),this[G]!==0&&this.emit("readable"),i&&s(i),this[U]):(this[G]!==0&&this.emit("readable"),i&&s(i),this[U])}read(e){if(this[M])return null;if(this[ot]=!1,this[G]===0||e===0||e&&e>this[G])return this[Lt](),null;this[K]&&(e=null),this[$].length>1&&!this[K]&&(this[$]=[this[gt]?this[$].join(""):Buffer.concat(this[$],this[G])]);let o=this[Fu](e||null,this[$][0]);return this[Lt](),o}[Fu](e,o){if(this[K])this[Vo]();else{let i=o;e===i.length||e===null?this[Vo]():typeof i=="string"?(this[$][0]=i.slice(e),o=i.slice(0,e),this[G]-=e):(this[$][0]=i.subarray(e),o=i.subarray(0,e),this[G]-=e)}return this.emit("data",o),!this[$].length&&!this[It]&&this.emit("drain"),o}end(e,o,i){return typeof e=="function"&&(i=e,e=void 0),typeof o=="function"&&(i=o,o="utf8"),e!==void 0&&this.write(e,o),i&&this.once("end",i),this[It]=!0,this.writable=!1,(this[U]||!this[vr])&&this[Lt](),this}[Ke](){this[M]||(!this[xe]&&!this[Z].length&&(this[ot]=!0),this[vr]=!1,this[U]=!0,this.emit("resume"),this[$].length?this[Qo]():this[It]?this[Lt]():this.emit("drain"))}resume(){return this[Ke]()}pause(){this[U]=!1,this[vr]=!0,this[ot]=!1}get destroyed(){return this[M]}get flowing(){return this[U]}get paused(){return this[vr]}[is](e){this[K]?this[G]+=1:this[G]+=e.length,this[$].push(e)}[Vo](){return this[K]?this[G]-=1:this[G]-=this[$][0].length,this[$].shift()}[Qo](e=!1){do;while(this[Nu](this[Vo]())&&this[$].length);!e&&!this[$].length&&!this[It]&&this.emit("drain")}[Nu](e){return this.emit("data",e),this[U]}pipe(e,o){if(this[M])return e;this[ot]=!1;let i=this[te];return o=o||{},e===Lu.stdout||e===Lu.stderr?o.end=!1:o.end=o.end!==!1,o.proxyErrors=!!o.proxyErrors,i?o.end&&e.end():(this[Z].push(o.proxyErrors?new ls(this,e,o):new Yo(this,e,o)),this[Et]?Er(()=>this[Ke]()):this[Ke]()),e}unpipe(e){let o=this[Z].find(i=>i.dest===e);o&&(this[Z].length===1?(this[U]&&this[xe]===0&&(this[U]=!1),this[Z]=[]):this[Z].splice(this[Z].indexOf(o),1),o.unpipe())}addListener(e,o){return this.on(e,o)}on(e,o){let i=super.on(e,o);if(e==="data")this[ot]=!1,this[xe]++,!this[Z].length&&!this[U]&&this[Ke]();else if(e==="readable"&&this[G]!==0)super.emit("readable");else if(Xx(e)&&this[te])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Sr]){let s=o;this[Et]?Er(()=>s.call(this,this[Sr])):s.call(this,this[Sr])}return i}removeListener(e,o){return this.off(e,o)}off(e,o){let i=super.off(e,o);return e==="data"&&(this[xe]=this.listeners("data").length,this[xe]===0&&!this[ot]&&!this[Z].length&&(this[U]=!1)),i}removeAllListeners(e){let o=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[xe]=0,!this[ot]&&!this[Z].length&&(this[U]=!1)),o}get emittedEnd(){return this[te]}[Lt](){!this[zo]&&!this[te]&&!this[M]&&this[$].length===0&&this[It]&&(this[zo]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ko]&&this.emit("close"),this[zo]=!1)}emit(e,...o){let i=o[0];if(e!=="error"&&e!=="close"&&e!==M&&this[M])return!1;if(e==="data")return!this[K]&&!i?!1:this[Et]?(Er(()=>this[ns](i)),!0):this[ns](i);if(e==="end")return this[Bu]();if(e==="close"){if(this[Ko]=!0,!this[te]&&!this[M])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Sr]=i,super.emit(ss,i);let n=!this[Cr]||this.listeners("error").length?super.emit("error",i):!1;return this[Lt](),n}else if(e==="resume"){let n=super.emit("resume");return this[Lt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,...o);return this[Lt](),s}[ns](e){for(let i of this[Z])i.dest.write(e)===!1&&this.pause();let o=this[ot]?!1:super.emit("data",e);return this[Lt](),o}[Bu](){return this[te]?!1:(this[te]=!0,this.readable=!1,this[Et]?(Er(()=>this[as]()),!0):this[as]())}[as](){if(this[ze]){let o=this[ze].end();if(o){for(let i of this[Z])i.dest.write(o);this[ot]||super.emit("data",o)}}for(let o of this[Z])o.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[K]||(e.dataLength=0);let o=this.promise();return this.on("data",i=>{e.push(i),this[K]||(e.dataLength+=i.length)}),await o,e}async concat(){if(this[K])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[gt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,o)=>{this.on(M,()=>o(new Error("stream destroyed"))),this.on("error",i=>o(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ot]=!1;let e=!1,o=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return o();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[It])return o();let n,f,l=m=>{this.off("data",u),this.off("end",h),this.off(M,d),o(),f(m)},u=m=>{this.off("error",l),this.off("end",h),this.off(M,d),this.pause(),n({value:m,done:!!this[It]})},h=()=>{this.off("error",l),this.off("data",u),this.off(M,d),o(),n({done:!0,value:void 0})},d=()=>l(new Error("stream destroyed"));return new Promise((m,y)=>{f=y,n=m,this.once(M,d),this.once("error",l),this.once("end",h),this.once("data",u)})},throw:o,return:o,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ot]=!1;let e=!1,o=()=>(this.pause(),this.off(ss,o),this.off(M,o),this.off("end",o),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return o();let s=this.read();return s===null?o():{done:!1,value:s}};return this.once("end",o),this.once(ss,o),this.once(M,o),{next:i,throw:o,return:o,[Symbol.iterator](){return this}}}destroy(e){if(this[M])return e?this.emit("error",e):this.emit(M),this;this[M]=!0,this[ot]=!0,this[$].length=0,this[G]=0;let o=this;return typeof o.close=="function"&&!this[Ko]&&o.close(),e?this.emit("error",e):this.emit(M),this}static get isStream(){return Vx}};var sy=At.realpathSync.native,Or={lstatSync:At.lstatSync,readdir:At.readdir,readdirSync:At.readdirSync,readlinkSync:At.readlinkSync,realpathSync:sy,promises:{lstat:oe.lstat,readdir:oe.readdir,readlink:oe.readlink,realpath:oe.realpath}},up=r=>!r||r===Or||r===iy?Or:{...Or,...r,promises:{...Or.promises,...r.promises||{}}},pp=/^\\\\\?\\([a-z]:)\\?$/i,ny=r=>r.replace(/\//g,"\\").replace(pp,"$1\\"),ay=/[\\\/]/,pt=0,hp=1,cp=2,kt=4,mp=6,dp=8,ye=10,gp=12,ut=15,kr=~ut,ps=16,sp=32,Tr=64,xt=128,Xo=256,ei=512,np=Tr|xt|ei,fy=1023,hs=r=>r.isFile()?dp:r.isDirectory()?kt:r.isSymbolicLink()?ye:r.isCharacterDevice()?cp:r.isBlockDevice()?mp:r.isSocket()?gp:r.isFIFO()?hp:pt,ap=new Map,Ar=r=>{let t=ap.get(r);if(t)return t;let e=r.normalize("NFKD");return ap.set(r,e),e},fp=new Map,ti=r=>{let t=fp.get(r);if(t)return t;let e=Ar(r.toLowerCase());return fp.set(r,e),e},si=class extends bs.LRUCache{constructor(){super({max:256})}},cs=class extends bs.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},xp=Symbol("PathScurry setAsCwd"),X,Dr,Mr,Ir,Lr,Fr,Nr,Br,jr,Wr,Ur,$r,Gr,Hr,qr,zr,Kr,Qr,Vr,re,we,Ot,Ft,Nt,Bt,k,be,jt,Tt,v,ms,ri,Pr,ds,gs,_r,oi,xs,ys,ii,yp,wp,bp,ws,Qe,Ve,Sp,Se,Q=class{constructor(t,e=pt,o,i,s,n,f){w(this,v);c(this,"name");c(this,"root");c(this,"roots");c(this,"parent");c(this,"nocase");c(this,"isCWD",!1);w(this,X);w(this,Dr);w(this,Mr);w(this,Ir);w(this,Lr);w(this,Fr);w(this,Nr);w(this,Br);w(this,jr);w(this,Wr);w(this,Ur);w(this,$r);w(this,Gr);w(this,Hr);w(this,qr);w(this,zr);w(this,Kr);w(this,Qr);w(this,Vr);w(this,re);w(this,we);w(this,Ot);w(this,Ft);w(this,Nt);w(this,Bt);w(this,k);w(this,be);w(this,jt);w(this,Tt);w(this,Qe,[]);w(this,Ve,!1);w(this,Se);this.name=t,g(this,re,s?ti(t):Ar(t)),g(this,k,e&fy),this.nocase=s,this.roots=i,this.root=o||this,g(this,be,n),g(this,Ot,f.fullpath),g(this,Nt,f.relative),g(this,Bt,f.relativePosix),this.parent=f.parent,this.parent?g(this,X,a(this.parent,X)):g(this,X,up(f.fs))}get dev(){return a(this,Dr)}get mode(){return a(this,Mr)}get nlink(){return a(this,Ir)}get uid(){return a(this,Lr)}get gid(){return a(this,Fr)}get rdev(){return a(this,Nr)}get blksize(){return a(this,Br)}get ino(){return a(this,jr)}get size(){return a(this,Wr)}get blocks(){return a(this,Ur)}get atimeMs(){return a(this,$r)}get mtimeMs(){return a(this,Gr)}get ctimeMs(){return a(this,Hr)}get birthtimeMs(){return a(this,qr)}get atime(){return a(this,zr)}get mtime(){return a(this,Kr)}get ctime(){return a(this,Qr)}get birthtime(){return a(this,Vr)}get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return a(this,we)!==void 0?a(this,we):this.parent?g(this,we,this.parent.depth()+1):g(this,we,0)}childrenCache(){return a(this,be)}resolve(t){var n;if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?S(n=this.getRoot(e),v,ms).call(n,i):S(this,v,ms).call(this,i)}children(){let t=a(this,be).get(this);if(t)return t;let e=Object.assign([],{provisional:0});return a(this,be).set(this,e),g(this,k,a(this,k)&~ps),e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let o=this.children(),i=this.nocase?ti(t):Ar(t);for(let l of o)if(a(l,re)===i)return l;let s=this.parent?this.sep:"",n=a(this,Ot)?a(this,Ot)+s+t:void 0,f=this.newChild(t,pt,{...e,parent:this,fullpath:n});return this.canReaddir()||g(f,k,a(f,k)|xt),o.push(f),f}relative(){if(this.isCWD)return"";if(a(this,Nt)!==void 0)return a(this,Nt);let t=this.name,e=this.parent;if(!e)return g(this,Nt,this.name);let o=e.relative();return o+(!o||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(a(this,Bt)!==void 0)return a(this,Bt);let t=this.name,e=this.parent;if(!e)return g(this,Bt,this.fullpathPosix());let o=e.relativePosix();return o+(!o||!e.parent?"":"/")+t}fullpath(){if(a(this,Ot)!==void 0)return a(this,Ot);let t=this.name,e=this.parent;if(!e)return g(this,Ot,this.name);let i=e.fullpath()+(e.parent?this.sep:"")+t;return g(this,Ot,i)}fullpathPosix(){if(a(this,Ft)!==void 0)return a(this,Ft);if(this.sep==="/")return g(this,Ft,this.fullpath());if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?g(this,Ft,`//?/${i}`):g(this,Ft,i)}let t=this.parent,e=t.fullpathPosix(),o=e+(!e||!t.parent?"":"/")+this.name;return g(this,Ft,o)}isUnknown(){return(a(this,k)&ut)===pt}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,k)&ut)===dp}isDirectory(){return(a(this,k)&ut)===kt}isCharacterDevice(){return(a(this,k)&ut)===cp}isBlockDevice(){return(a(this,k)&ut)===mp}isFIFO(){return(a(this,k)&ut)===hp}isSocket(){return(a(this,k)&ut)===gp}isSymbolicLink(){return(a(this,k)&ye)===ye}lstatCached(){return a(this,k)&sp?this:void 0}readlinkCached(){return a(this,jt)}realpathCached(){return a(this,Tt)}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(a(this,jt))return!0;if(!this.parent)return!1;let t=a(this,k)&ut;return!(t!==pt&&t!==ye||a(this,k)&Xo||a(this,k)&xt)}calledReaddir(){return!!(a(this,k)&ps)}isENOENT(){return!!(a(this,k)&xt)}isNamed(t){return this.nocase?a(this,re)===ti(t):a(this,re)===Ar(t)}async readlink(){var e;let t=a(this,jt);if(t)return t;if(this.canReadlink()&&this.parent)try{let o=await a(this,X).promises.readlink(this.fullpath()),i=(e=await this.parent.realpath())==null?void 0:e.resolve(o);if(i)return g(this,jt,i)}catch(o){S(this,v,ys).call(this,o.code);return}}readlinkSync(){var e;let t=a(this,jt);if(t)return t;if(this.canReadlink()&&this.parent)try{let o=a(this,X).readlinkSync(this.fullpath()),i=(e=this.parent.realpathSync())==null?void 0:e.resolve(o);if(i)return g(this,jt,i)}catch(o){S(this,v,ys).call(this,o.code);return}}async lstat(){if(!(a(this,k)&xt))try{return S(this,v,ws).call(this,await a(this,X).promises.lstat(this.fullpath())),this}catch(t){S(this,v,xs).call(this,t.code)}}lstatSync(){if(!(a(this,k)&xt))try{return S(this,v,ws).call(this,a(this,X).lstatSync(this.fullpath())),this}catch(t){S(this,v,xs).call(this,t.code)}}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let o=this.children();if(this.calledReaddir()){let s=o.slice(0,o.provisional);e?t(null,s):queueMicrotask(()=>t(null,s));return}if(a(this,Qe).push(t),a(this,Ve))return;g(this,Ve,!0);let i=this.fullpath();a(this,X).readdir(i,{withFileTypes:!0},(s,n)=>{if(s)S(this,v,oi).call(this,s.code),o.provisional=0;else{for(let f of n)S(this,v,ii).call(this,f,o);S(this,v,ri).call(this,o)}S(this,v,Sp).call(this,o.slice(0,o.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,Se))await a(this,Se);else{let o=()=>{};g(this,Se,new Promise(i=>o=i));try{for(let i of await a(this,X).promises.readdir(e,{withFileTypes:!0}))S(this,v,ii).call(this,i,t);S(this,v,ri).call(this,t)}catch(i){S(this,v,oi).call(this,i.code),t.provisional=0}g(this,Se,void 0),o()}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 o of a(this,X).readdirSync(e,{withFileTypes:!0}))S(this,v,ii).call(this,o,t);S(this,v,ri).call(this,t)}catch(o){S(this,v,oi).call(this,o.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(a(this,k)&np)return!1;let t=ut&a(this,k);return t===pt||t===kt||t===ye}shouldWalk(t,e){return(a(this,k)&kt)===kt&&!(a(this,k)&np)&&!t.has(this)&&(!e||e(this))}async realpath(){if(a(this,Tt))return a(this,Tt);if(!((ei|Xo|xt)&a(this,k)))try{let t=await a(this,X).promises.realpath(this.fullpath());return g(this,Tt,this.resolve(t))}catch(t){S(this,v,gs).call(this)}}realpathSync(){if(a(this,Tt))return a(this,Tt);if(!((ei|Xo|xt)&a(this,k)))try{let t=a(this,X).realpathSync(this.fullpath());return g(this,Tt,this.resolve(t))}catch(t){S(this,v,gs).call(this)}}[xp](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),o=[],i=this;for(;i&&i.parent;)e.add(i),g(i,Nt,o.join(this.sep)),g(i,Bt,o.join("/")),i=i.parent,o.push("..");for(i=t;i&&i.parent&&!e.has(i);)g(i,Nt,void 0),g(i,Bt,void 0),i=i.parent}};X=new WeakMap,Dr=new WeakMap,Mr=new WeakMap,Ir=new WeakMap,Lr=new WeakMap,Fr=new WeakMap,Nr=new WeakMap,Br=new WeakMap,jr=new WeakMap,Wr=new WeakMap,Ur=new WeakMap,$r=new WeakMap,Gr=new WeakMap,Hr=new WeakMap,qr=new WeakMap,zr=new WeakMap,Kr=new WeakMap,Qr=new WeakMap,Vr=new WeakMap,re=new WeakMap,we=new WeakMap,Ot=new WeakMap,Ft=new WeakMap,Nt=new WeakMap,Bt=new WeakMap,k=new WeakMap,be=new WeakMap,jt=new WeakMap,Tt=new WeakMap,v=new WeakSet,ms=function(t){let e=this;for(let o of t)e=e.child(o);return e},ri=function(t){var e;g(this,k,a(this,k)|ps);for(let o=t.provisional;o<t.length;o++){let i=t[o];i&&S(e=i,v,Pr).call(e)}},Pr=function(){a(this,k)&xt||(g(this,k,(a(this,k)|xt)&kr),S(this,v,ds).call(this))},ds=function(){var e;let t=this.children();t.provisional=0;for(let o of t)S(e=o,v,Pr).call(e)},gs=function(){g(this,k,a(this,k)|ei),S(this,v,_r).call(this)},_r=function(){if(a(this,k)&Tr)return;let t=a(this,k);(t&ut)===kt&&(t&=kr),g(this,k,t|Tr),S(this,v,ds).call(this)},oi=function(t=""){t==="ENOTDIR"||t==="EPERM"?S(this,v,_r).call(this):t==="ENOENT"?S(this,v,Pr).call(this):this.children().provisional=0},xs=function(t=""){var e;if(t==="ENOTDIR"){let o=this.parent;S(e=o,v,_r).call(e)}else t==="ENOENT"&&S(this,v,Pr).call(this)},ys=function(t=""){var o;let e=a(this,k);e|=Xo,t==="ENOENT"&&(e|=xt),(t==="EINVAL"||t==="UNKNOWN")&&(e&=kr),g(this,k,e),t==="ENOTDIR"&&this.parent&&S(o=this.parent,v,_r).call(o)},ii=function(t,e){return S(this,v,wp).call(this,t,e)||S(this,v,yp).call(this,t,e)},yp=function(t,e){let o=hs(t),i=this.newChild(t.name,o,{parent:this}),s=a(i,k)&ut;return s!==kt&&s!==ye&&s!==pt&&g(i,k,a(i,k)|Tr),e.unshift(i),e.provisional++,i},wp=function(t,e){for(let o=e.provisional;o<e.length;o++){let i=e[o];if((this.nocase?ti(t.name):Ar(t.name))===a(i,re))return S(this,v,bp).call(this,t,i,o,e)}},bp=function(t,e,o,i){let s=e.name;return g(e,k,a(e,k)&kr|hs(t)),s!==t.name&&(e.name=t.name),o!==i.provisional&&(o===i.length-1?i.pop():i.splice(o,1),i.unshift(e)),i.provisional++,e},ws=function(t){let{atime:e,atimeMs:o,birthtime:i,birthtimeMs:s,blksize:n,blocks:f,ctime:l,ctimeMs:u,dev:h,gid:d,ino:m,mode:y,mtime:b,mtimeMs:x,nlink:C,rdev:E,size:T,uid:A}=t;g(this,zr,e),g(this,$r,o),g(this,Vr,i),g(this,qr,s),g(this,Br,n),g(this,Ur,f),g(this,Qr,l),g(this,Hr,u),g(this,Dr,h),g(this,Fr,d),g(this,jr,m),g(this,Mr,y),g(this,Kr,b),g(this,Gr,x),g(this,Ir,C),g(this,Nr,E),g(this,Wr,T),g(this,Lr,A);let _=hs(t);g(this,k,a(this,k)&kr|_|sp),_!==pt&&_!==kt&&_!==ye&&g(this,k,a(this,k)|Tr)},Qe=new WeakMap,Ve=new WeakMap,Sp=function(t){g(this,Ve,!1);let e=a(this,Qe).slice();a(this,Qe).length=0,e.forEach(o=>o(null,t))},Se=new WeakMap;var ni=class r extends Q{constructor(e,o=pt,i,s,n,f,l){super(e,o,i,s,n,f,l);c(this,"sep","\\");c(this,"splitSep",ay)}newChild(e,o=pt,i={}){return new r(e,o,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return Ze.win32.parse(e).root}getRoot(e){if(e=ny(e.toUpperCase()),e===this.root.name)return this.root;for(let[o,i]of Object.entries(this.roots))if(this.sameRoot(e,o))return this.roots[e]=i;return this.roots[e]=new Xe(e,this).root}sameRoot(e,o=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(pp,"$1\\"),e===o}},ai=class r extends Q{constructor(e,o=pt,i,s,n,f,l){super(e,o,i,s,n,f,l);c(this,"splitSep","/");c(this,"sep","/")}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,o=pt,i={}){return new r(e,o,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Je,Ye,Jr,Yr,fi=class{constructor(t=process.cwd(),e,o,{nocase:i,childrenCacheSize:s=16*1024,fs:n=Or}={}){c(this,"root");c(this,"rootPath");c(this,"roots");c(this,"cwd");w(this,Je);w(this,Ye);w(this,Jr);c(this,"nocase");w(this,Yr);g(this,Yr,up(n)),(t instanceof URL||t.startsWith("file://"))&&(t=(0,lp.fileURLToPath)(t));let f=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(f),g(this,Je,new si),g(this,Ye,new si),g(this,Jr,new cs(s));let l=f.substring(this.rootPath.length).split(o);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(a(this,Yr)),this.roots[this.rootPath]=this.root;let u=this.root,h=l.length-1,d=e.sep,m=this.rootPath,y=!1;for(let b of l){let x=h--;u=u.child(b,{relative:new Array(x).fill("..").join(d),relativePosix:new Array(x).fill("..").join("/"),fullpath:m+=(y?"":d)+b}),y=!0}this.cwd=u}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return a(this,Jr)}resolve(...t){let e="";for(let s=t.length-1;s>=0;s--){let n=t[s];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let o=a(this,Je).get(e);if(o!==void 0)return o;let i=this.cwd.resolve(e).fullpath();return a(this,Je).set(e,i),i}resolvePosix(...t){let e="";for(let s=t.length-1;s>=0;s--){let n=t[s];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let o=a(this,Ye).get(e);if(o!==void 0)return o;let i=this.cwd.resolve(e).fullpathPosix();return a(this,Ye).set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o}=e;if(t.canReaddir()){let i=await t.readdir();return o?i:i.map(s=>s.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0}=e;return t.canReaddir()?o?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t.withFileTypes,t=this.cwd);let o=await t.readlink();return e?o:o==null?void 0:o.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t.withFileTypes,t=this.cwd);let o=t.readlinkSync();return e?o:o==null?void 0:o.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t.withFileTypes,t=this.cwd);let o=await t.realpath();return e?o:o==null?void 0:o.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t.withFileTypes,t=this.cwd);let o=t.realpathSync();return e?o:o==null?void 0:o.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0,follow:i=!1,filter:s,walkFilter:n}=e,f=[];(!s||s(t))&&f.push(o?t:t.fullpath());let l=new Set,u=(d,m)=>{l.add(d),d.readdirCB((y,b)=>{if(y)return m(y);let x=b.length;if(!x)return m();let C=()=>{--x===0&&m()};for(let E of b)(!s||s(E))&&f.push(o?E:E.fullpath()),i&&E.isSymbolicLink()?E.realpath().then(T=>T!=null&&T.isUnknown()?T.lstat():T).then(T=>T!=null&&T.shouldWalk(l,n)?u(T,C):C()):E.shouldWalk(l,n)?u(E,C):C()},!0)},h=t;return new Promise((d,m)=>{u(h,y=>{if(y)return m(y);d(f)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0,follow:i=!1,filter:s,walkFilter:n}=e,f=[];(!s||s(t))&&f.push(o?t:t.fullpath());let l=new Set([t]);for(let u of l){let h=u.readdirSync();for(let d of h){(!s||s(d))&&f.push(o?d:d.fullpath());let m=d;if(d.isSymbolicLink()){if(!(i&&(m=d.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(l,n)&&l.add(m)}}return f}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0,follow:i=!1,filter:s,walkFilter:n}=e;(!s||s(t))&&(yield o?t:t.fullpath());let f=new Set([t]);for(let l of f){let u=l.readdirSync();for(let h of u){(!s||s(h))&&(yield o?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(i&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(f,n)&&f.add(d)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0,follow:i=!1,filter:s,walkFilter:n}=e,f=new ee({objectMode:!0});(!s||s(t))&&f.write(o?t:t.fullpath());let l=new Set,u=[t],h=0,d=()=>{let m=!1;for(;!m;){let y=u.shift();if(!y){h===0&&f.end();return}h++,l.add(y);let b=(C,E,T=!1)=>{if(C)return f.emit("error",C);if(i&&!T){let A=[];for(let _ of E)_.isSymbolicLink()&&A.push(_.realpath().then(N=>N!=null&&N.isUnknown()?N.lstat():N));if(A.length){Promise.all(A).then(()=>b(null,E,!0));return}}for(let A of E)A&&(!s||s(A))&&(f.write(o?A:A.fullpath())||(m=!0));h--;for(let A of E){let _=A.realpathCached()||A;_.shouldWalk(l,n)&&u.push(_)}m&&!f.flowing?f.once("drain",d):x||d()},x=!0;y.readdirCB(b,!0),x=!1}};return d(),f}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0,follow:i=!1,filter:s,walkFilter:n}=e,f=new ee({objectMode:!0}),l=new Set;(!s||s(t))&&f.write(o?t:t.fullpath());let u=[t],h=0,d=()=>{let m=!1;for(;!m;){let y=u.shift();if(!y){h===0&&f.end();return}h++,l.add(y);let b=y.readdirSync();for(let x of b)(!s||s(x))&&(f.write(o?x:x.fullpath())||(m=!0));h--;for(let x of b){let C=x;if(x.isSymbolicLink()){if(!(i&&(C=x.realpathSync())))continue;C.isUnknown()&&C.lstatSync()}C.shouldWalk(l,n)&&u.push(C)}}m&&!f.flowing&&f.once("drain",d)};return d(),f}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[xp](e)}};Je=new WeakMap,Ye=new WeakMap,Jr=new WeakMap,Yr=new WeakMap;var Xe=class extends fi{constructor(e=process.cwd(),o={}){let{nocase:i=!0}=o;super(e,Ze.win32,"\\",{...o,nocase:i});c(this,"sep","\\");this.nocase=i;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return Ze.win32.parse(e).root.toUpperCase()}newRoot(e){return new ni(this.rootPath,kt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},tr=class extends fi{constructor(e=process.cwd(),o={}){let{nocase:i=!1}=o;super(e,Ze.posix,"/",{...o,nocase:i});c(this,"sep","/");this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new ai(this.rootPath,kt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Rr=class extends tr{constructor(t=process.cwd(),e={}){let{nocase:o=!0}=e;super(t,{...e,nocase:o})}},bO=process.platform==="win32"?ni:ai,vp=process.platform==="win32"?Xe:process.platform==="darwin"?Rr:tr;var ly=r=>r.length>=1,uy=r=>r.length>=1,j,it,H,ve,yt,Zr,ie,se,ne,er,Ss=class Ss{constructor(t,e,o,i){w(this,j);w(this,it);w(this,H);c(this,"length");w(this,ve);w(this,yt);w(this,Zr);w(this,ie);w(this,se);w(this,ne);w(this,er,!0);if(!ly(t))throw new TypeError("empty pattern list");if(!uy(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,o<0||o>=this.length)throw new TypeError("index out of range");if(g(this,j,t),g(this,it,e),g(this,H,o),g(this,ve,i),a(this,H)===0){if(this.isUNC()){let[s,n,f,l,...u]=a(this,j),[h,d,m,y,...b]=a(this,it);u[0]===""&&(u.shift(),b.shift());let x=[s,n,f,l,""].join("/"),C=[h,d,m,y,""].join("/");g(this,j,[x,...u]),g(this,it,[C,...b]),this.length=a(this,j).length}else if(this.isDrive()||this.isAbsolute()){let[s,...n]=a(this,j),[f,...l]=a(this,it);n[0]===""&&(n.shift(),l.shift());let u=s+"/",h=f+"/";g(this,j,[u,...n]),g(this,it,[h,...l]),this.length=a(this,j).length}}}pattern(){return a(this,j)[a(this,H)]}isString(){return typeof a(this,j)[a(this,H)]=="string"}isGlobstar(){return a(this,j)[a(this,H)]===q}isRegExp(){return a(this,j)[a(this,H)]instanceof RegExp}globString(){return g(this,Zr,a(this,Zr)||(a(this,H)===0?this.isAbsolute()?a(this,it)[0]+a(this,it).slice(1).join("/"):a(this,it).join("/"):a(this,it).slice(a(this,H)).join("/")))}hasMore(){return this.length>a(this,H)+1}rest(){return a(this,yt)!==void 0?a(this,yt):this.hasMore()?(g(this,yt,new Ss(a(this,j),a(this,it),a(this,H)+1,a(this,ve))),g(a(this,yt),ne,a(this,ne)),g(a(this,yt),se,a(this,se)),g(a(this,yt),ie,a(this,ie)),a(this,yt)):g(this,yt,null)}isUNC(){let t=a(this,j);return a(this,se)!==void 0?a(this,se):g(this,se,a(this,ve)==="win32"&&a(this,H)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=a(this,j);return a(this,ie)!==void 0?a(this,ie):g(this,ie,a(this,ve)==="win32"&&a(this,H)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=a(this,j);return a(this,ne)!==void 0?a(this,ne):g(this,ne,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=a(this,j)[0];return typeof t=="string"&&this.isAbsolute()&&a(this,H)===0?t:""}checkFollowGlobstar(){return!(a(this,H)===0||!this.isGlobstar()||!a(this,er))}markFollowGlobstar(){return a(this,H)===0||!this.isGlobstar()||!a(this,er)?!1:(g(this,er,!1),!0)}};j=new WeakMap,it=new WeakMap,H=new WeakMap,ve=new WeakMap,yt=new WeakMap,Zr=new WeakMap,ie=new WeakMap,se=new WeakMap,ne=new WeakMap,er=new WeakMap;var rr=Ss;var py=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",or=class{constructor(t,{nobrace:e,nocase:o,noext:i,noglobstar:s,platform:n=py}){c(this,"relative");c(this,"relativeChildren");c(this,"absolute");c(this,"absoluteChildren");c(this,"platform");c(this,"mmopts");this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:!0,nobrace:e,nocase:o,noext:i,noglobstar:s,optimizationLevel:2,platform:n,nocomment:!0,nonegate:!0};for(let f of t)this.add(f)}add(t){let e=new rt(t,this.mmopts);for(let o=0;o<e.set.length;o++){let i=e.set[o],s=e.globParts[o];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let n=new rr(i,s,0,this.platform),f=new rt(n.globString(),this.mmopts),l=s[s.length-1]==="**",u=n.isAbsolute();u?this.absolute.push(f):this.relative.push(f),l&&(u?this.absoluteChildren.push(f):this.relativeChildren.push(f))}}ignored(t){let e=t.fullpath(),o=`${e}/`,i=t.relative()||".",s=`${i}/`;for(let n of this.relative)if(n.match(i)||n.match(s))return!0;for(let n of this.absolute)if(n.match(e)||n.match(o))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",o=(t.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(o))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}};var vs=class r{constructor(t=new Map){c(this,"store");this.store=t}copy(){return new r(new Map(this.store))}hasWalked(t,e){var o;return(o=this.store.get(t.fullpath()))==null?void 0:o.has(e.globString())}storeWalked(t,e){let o=t.fullpath(),i=this.store.get(o);i?i.add(e.globString()):this.store.set(o,new Set([e.globString()]))}},Cs=class{constructor(){c(this,"store",new Map)}add(t,e,o){let i=(e?2:0)|(o?1:0),s=this.store.get(t);this.store.set(t,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},Es=class{constructor(){c(this,"store",new Map)}add(t,e){if(!t.canReaddir())return;let o=this.store.get(t);o?o.find(i=>i.globString()===e.globString())||o.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())}},Xr=class r{constructor(t,e){c(this,"hasWalkedCache");c(this,"matches",new Cs);c(this,"subwalks",new Es);c(this,"patterns");c(this,"follow");c(this,"dot");c(this,"opts");this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new vs}processPatterns(t,e){this.patterns=e;let o=e.map(i=>[t,i]);for(let[i,s]of o){this.hasWalkedCache.storeWalked(i,s);let n=s.root(),f=s.isAbsolute()&&this.opts.absolute!==!1;if(n){i=i.resolve(n==="/"&&this.opts.root!==void 0?this.opts.root:n);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,h=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,h=!0;if(l=s.pattern(),u=s.rest(),h){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),f,d);continue}else if(l===q){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u==null?void 0:u.pattern(),m=u==null?void 0:u.rest();if(!u||(d===""||d===".")&&!m)this.matches.add(i,f,d===""||d===".");else if(d===".."){let y=i.parent||i;m?this.hasWalkedCache.hasWalked(y,m)||this.subwalks.add(y,m):this.matches.add(y,f,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(t,e){let o=this.subwalks.get(t),i=this.child();for(let s of e)for(let n of o){let f=n.isAbsolute(),l=n.pattern(),u=n.rest();l===q?i.testGlobstar(s,n,u,f):l instanceof RegExp?i.testRegExp(s,l,u,f):i.testString(s,l,u,f)}return i}testGlobstar(t,e,o,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()&&(o&&e.checkFollowGlobstar()?this.subwalks.add(t,o):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),o){let s=o.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(t,s,o.rest(),i);else if(s===".."){let n=t.parent||t;this.subwalks.add(n,o)}else s instanceof RegExp&&this.testRegExp(t,s,o.rest(),i)}}testRegExp(t,e,o,i){e.test(t.name)&&(o?this.subwalks.add(t,o):this.matches.add(t,i,!1))}testString(t,e,o,i){t.isNamed(e)&&(o?this.subwalks.add(t,o):this.matches.add(t,i,!1))}};var hy=(r,t)=>typeof r=="string"?new or([r],t):Array.isArray(r)?new or(r,t):r,ir,Wt,Ee,ht,Ce,ks,li=class{constructor(t,e,o){w(this,ht);c(this,"path");c(this,"patterns");c(this,"opts");c(this,"seen",new Set);c(this,"paused",!1);c(this,"aborted",!1);w(this,ir,[]);w(this,Wt);w(this,Ee);c(this,"signal");c(this,"maxDepth");c(this,"includeChildMatches");var i;if(this.patterns=t,this.path=e,this.opts=o,g(this,Ee,!o.posix&&o.platform==="win32"?"\\":"/"),this.includeChildMatches=o.includeChildMatches!==!1,(o.ignore||!this.includeChildMatches)&&(g(this,Wt,hy((i=o.ignore)!=null?i:[],o)),!this.includeChildMatches&&typeof a(this,Wt).add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=o.maxDepth||1/0,o.signal&&(this.signal=o.signal,this.signal.addEventListener("abort",()=>{a(this,ir).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,ir).shift());)t()}onResume(t){var e;(e=this.signal)!=null&&e.aborted||(this.paused?a(this,ir).push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let o;if(this.opts.realpath){if(o=t.realpathCached()||await t.realpath(),!o)return;t=o}let s=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&(s!=null&&s.isSymbolicLink())){let n=await s.realpath();n&&(n.isUnknown()||this.opts.stat)&&await n.lstat()}return this.matchCheckTest(s,e)}matchCheckTest(t,e){var o;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()||!((o=t.realpathCached())!=null&&o.isDirectory()))&&!S(this,ht,Ce).call(this,t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let o;if(this.opts.realpath){if(o=t.realpathCached()||t.realpathSync(),!o)return;t=o}let s=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&(s!=null&&s.isSymbolicLink())){let n=s.realpathSync();n&&(n!=null&&n.isUnknown()||this.opts.stat)&&n.lstatSync()}return this.matchCheckTest(s,e)}matchFinish(t,e){var s;if(S(this,ht,Ce).call(this,t))return;if(!this.includeChildMatches&&((s=a(this,Wt))!=null&&s.add)){let n=`${t.relativePosix()}/**`;a(this,Wt).add(n)}let o=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?a(this,Ee):"";if(this.opts.withFileTypes)this.matchEmit(t);else if(o){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?t.relativePosix():t.relative(),f=this.opts.dotRelative&&!n.startsWith(".."+a(this,Ee))?"."+a(this,Ee):"";this.matchEmit(n?f+n+i:"."+i)}}async match(t,e,o){let i=await this.matchCheck(t,o);i&&this.matchFinish(i,e)}matchSync(t,e,o){let i=this.matchCheckSync(t,o);i&&this.matchFinish(i,e)}walkCB(t,e,o){var i;(i=this.signal)!=null&&i.aborted&&o(),this.walkCB2(t,e,new Xr(this.opts),o)}walkCB2(t,e,o,i){var f;if(S(this,ht,ks).call(this,t))return i();if((f=this.signal)!=null&&f.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(t,e,o,i));return}o.processPatterns(t,e);let s=1,n=()=>{--s===0&&i()};for(let[l,u,h]of o.matches.entries())S(this,ht,Ce).call(this,l)||(s++,this.match(l,u,h).then(()=>n()));for(let l of o.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirCached();l.calledReaddir()?this.walkCB3(l,u,o,n):l.readdirCB((h,d)=>this.walkCB3(l,d,o,n),!0)}n()}walkCB3(t,e,o,i){o=o.filterEntries(t,e);let s=1,n=()=>{--s===0&&i()};for(let[f,l,u]of o.matches.entries())S(this,ht,Ce).call(this,f)||(s++,this.match(f,l,u).then(()=>n()));for(let[f,l]of o.subwalks.entries())s++,this.walkCB2(f,l,o.child(),n);n()}walkCBSync(t,e,o){var i;(i=this.signal)!=null&&i.aborted&&o(),this.walkCB2Sync(t,e,new Xr(this.opts),o)}walkCB2Sync(t,e,o,i){var f;if(S(this,ht,ks).call(this,t))return i();if((f=this.signal)!=null&&f.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,o,i));return}o.processPatterns(t,e);let s=1,n=()=>{--s===0&&i()};for(let[l,u,h]of o.matches.entries())S(this,ht,Ce).call(this,l)||this.matchSync(l,u,h);for(let l of o.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirSync();this.walkCB3Sync(l,u,o,n)}n()}walkCB3Sync(t,e,o,i){o=o.filterEntries(t,e);let s=1,n=()=>{--s===0&&i()};for(let[f,l,u]of o.matches.entries())S(this,ht,Ce).call(this,f)||this.matchSync(f,l,u);for(let[f,l]of o.subwalks.entries())s++,this.walkCB2Sync(f,l,o.child(),n);n()}};ir=new WeakMap,Wt=new WeakMap,Ee=new WeakMap,ht=new WeakSet,Ce=function(t){var e,o;return this.seen.has(t)||!!((o=(e=a(this,Wt))==null?void 0:e.ignored)!=null&&o.call(e,t))},ks=function(t){var e,o;return!!((o=(e=a(this,Wt))==null?void 0:e.childrenIgnored)!=null&&o.call(e,t))};var to=class extends li{constructor(e,o,i){super(e,o,i);c(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((o,i)=>{this.walkCB(this.path,this.patterns,()=>{var s;(s=this.signal)!=null&&s.aborted?i(this.signal.reason):o(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 o;if((o=this.signal)!=null&&o.aborted)throw this.signal.reason}),this.matches}},eo=class extends li{constructor(e,o,i){super(e,o,i);c(this,"results");this.results=new ee({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 cy=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",wt=class{constructor(t,e){c(this,"absolute");c(this,"cwd");c(this,"root");c(this,"dot");c(this,"dotRelative");c(this,"follow");c(this,"ignore");c(this,"magicalBraces");c(this,"mark");c(this,"matchBase");c(this,"maxDepth");c(this,"nobrace");c(this,"nocase");c(this,"nodir");c(this,"noext");c(this,"noglobstar");c(this,"pattern");c(this,"platform");c(this,"realpath");c(this,"scurry");c(this,"stat");c(this,"signal");c(this,"windowsPathsNoEscape");c(this,"withFileTypes");c(this,"includeChildMatches");c(this,"opts");c(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,Cp.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||cy,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"?Xe:e.platform==="darwin"?Rr:e.platform?tr:vp;this.scurry=new l(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let o=this.platform==="darwin"||this.platform==="win32",i={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:o,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new rt(l,i)),[n,f]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=n.map((l,u)=>{let h=f[u];if(!h)throw new Error("invalid pattern object");return new rr(l,h,0,this.platform)})}async walk(){return[...await new to(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 to(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 eo(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 eo(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 Os=(r,t={})=>{Array.isArray(r)||(r=[r]);for(let e of r)if(new rt(e,t).hasMagic())return!0;return!1};function ui(r,t={}){return new wt(r,t).streamSync()}function Op(r,t={}){return new wt(r,t).stream()}function Tp(r,t={}){return new wt(r,t).walkSync()}async function Ep(r,t={}){return new wt(r,t).walk()}function pi(r,t={}){return new wt(r,t).iterateSync()}function Ap(r,t={}){return new wt(r,t).iterate()}var my=ui,dy=Object.assign(Op,{sync:ui}),gy=pi,xy=Object.assign(Ap,{sync:pi}),ro=Object.assign(Tp,{stream:ui,iterate:pi}),kp=Object.assign(Ep,{glob:Ep,globSync:Tp,sync:ro,globStream:Op,stream:dy,globStreamSync:ui,streamSync:my,globIterate:Ap,iterate:xy,globIterateSync:pi,iterateSync:gy,Glob:wt,hasMagic:Os,escape:qe,unescape:dt});kp.glob=kp;nt();var yy=O.withTag("listChromeProfiles");function Pp(){let r=ro("./**/Cookies",{cwd:Ge,absolute:!0});return yy.debug("Found cookie files:",r),r}var hi=require("crypto");Jt();var wy=ft(r=>r.length>=3&&r[0]===118&&r[1]===49&&r[2]===48?r.slice(3):r,r=>r.toString("hex")),by=ft(r=>{let t=r[r.length-1];return t&&t<=16?r.slice(0,-t):r},r=>r.toString("hex"));function Sy(r){var e;let t=[/.*?0t(.+)$/,/.*?1e`(.+)$/,/.*?[`'](.+)$/,/[^\x20-\x7E]*([\x20-\x7E].+)$/];for(let o of t){let i=r.match(o),s=(e=i==null?void 0:i[1])!=null?e:"";if(s.length>0)return s}return r}async function _p(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,o)=>{(0,hi.pbkdf2)(t,"saltysalt",1003,16,"sha1",(i,s)=>{try{if(i){o(new Error("Failed to derive key: "+i.message));return}let n=wy(r);if(n.length%16!==0){o(new Error("Encrypted data length is not a multiple of 16"));return}let f=Buffer.alloc(16," "),l=(0,hi.createDecipheriv)("aes-128-cbc",s,f);l.setAutoPadding(!1);let u=l.update(n);try{l.final()}catch(d){o(new Error("Failed to finalize decryption: "+d.message));return}u=by(u);let h=u.toString("utf8");e(Sy(h))}catch(n){o(new Error("Decryption failed: "+n.message))}})})}Jt();Pt();var Np=ft(async()=>{if(process.platform!=="darwin")throw I("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(()=>(Fp(),Lp)),t=await r();return bt("ChromePassword","Retrieved password successfully",{platform:"macOS"}),t}catch(r){throw I("Chrome password retrieval failed",r,{platform:"macOS"}),r}});function Oy(r){return typeof r!="number"||r<=0?"Infinity":new Date(r)}function Bp(r,t,e,o,i,s){return{domain:r,name:t,value:e,expiry:Oy(o),meta:{file:i,browser:"Chrome",decrypted:s}}}var ci=class{constructor(){this.logger=so("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 o=Pp();if(o.length===0)return this.logger.warn("No Chrome cookie files found"),[];let i=await Np();return(await Promise.all(o.map(n=>this.processFile(n,t,e,i)))).flat()}catch(o){return o instanceof Error?I("Failed to query cookies",o,{name:t,domain:e}):I("Failed to query cookies",new Error(String(o)),{name:t,domain:e}),[]}}async processFile(t,e,o,i){try{let s=await au({name:e,domain:o,file:t}),n={file:t,password:i};return(await Promise.allSettled(s.map(l=>this.processCookie(l,n)))).map(l=>l.status==="fulfilled"?l.value:null).filter(l=>l!==null)}catch(s){return s instanceof Error?this.logger.error("Failed to process cookie file",{error:s,file:t}):this.logger.error("Failed to process cookie file",{error:String(s),file:t}),[]}}async processCookie(t,e){try{let o=Buffer.isBuffer(t.value)?t.value:Buffer.from(String(t.value)),i=await _p(o,e.password);return Bp(t.domain,t.name,i,t.expiry,e.file,!0)}catch(o){return o instanceof Error?this.logger.warn("Failed to decrypt cookie",{error:o}):this.logger.warn("Failed to decrypt cookie",{error:String(o)}),Bp(t.domain,t.name,t.value.toString("utf-8"),t.expiry,e.file,!1)}}};async function jp(r,t,e=[]){return r.length===0?e:(await Promise.all(r.map(async i=>{try{return await t(i)}catch(s){return e}}))).flat()}Pt();var mi=class{constructor(t){this.strategies=t;this.logger=so("CompositeCookieQueryStrategy");this.browserName="internal"}handleStrategyError(t,e){t instanceof Error?this.logger.error("Strategy failed",{error:t,strategy:e}):this.logger.error("Strategy failed with unknown error",{error:String(t),strategy:e})}async queryCookies(t,e){try{return this.logger.info("Querying cookies from all strategies",{name:t,domain:e,strategyCount:this.strategies.length}),await jp(this.strategies,async o=>{try{return await o.queryCookies(t,e)}catch(i){return this.handleStrategyError(i,o),[]}},[])}catch(o){return o instanceof Error?this.logger.error("Failed to query cookies",{error:o}):this.logger.error("Failed to query cookies with unknown error",{error:String(o)}),[]}}};var Ts=require("path");Pt();function Ty(){let r=[],t=process.env.HOME;if(typeof t!="string"||t.length===0)return no("FirefoxCookieQuery","HOME environment variable not set"),r;let e=[(0,Ts.join)(t,"Library/Application Support/Firefox/Profiles/*/cookies.sqlite"),(0,Ts.join)(t,".mozilla/firefox/*/cookies.sqlite")];for(let o of e){let i=ro(o);r.push(...i)}return bt("FirefoxCookieQuery","Found Firefox cookie files",{files:r}),r}var di=class{constructor(){this.browserName="Firefox"}async queryCookies(t,e){let o=Ty(),i=[];for(let s of o)try{let n=await $o({file:s,sql:"SELECT name, value, host as domain, expiry FROM moz_cookies WHERE name = ? AND host LIKE ?",params:[t,`%${e}%`],rowTransform:f=>({name:f.name,value:f.value,domain:f.domain,expiry:f.expiry>0?new Date(f.expiry*1e3):"Infinity",meta:{file:s,browser:"Firefox",decrypted:!1}})});i.push(...n)}catch(n){n instanceof Error?no("FirefoxCookieQuery",`Error reading Firefox cookie file ${s}`,{error:n.message}):no("FirefoxCookieQuery",`Error reading Firefox cookie file ${s}`)}return i}};var $p=require("path");Pt();var Wp=require("fs");var Ay=1706047360;function gi(r,t){let e=t;for(;e<r.length&&r[e]!==0;)e++;return[r.toString("utf8",t,e),e+1]}function Py(r,t){let e=r.readUInt32LE(t),o=t+43,s=r.readUInt32LE(o)-Ay,n=t+56,[f,l]=gi(r,n);n=l;let[u,h]=gi(r,n);n=h;let[d,m]=gi(r,n);n=m;let[y,b]=gi(r,n);return[{name:u,value:y,domain:f.startsWith(".")?f.slice(1):f,path:d||"/",expiry:s,creation:s},e]}function _y(r,t,e){let o=t+5,i=r.readUInt32BE(o),s=t+i,n=[],f=t+e;for(;s<f-8;)try{let[l,u]=Py(r,s);n.push(l),s+=u}catch(l){console.warn(`Error decoding cookie at offset ${s}:`,l);break}return n}function Up(r){let t=(0,Wp.readFileSync)(r),e=t.readUInt32BE(4),o=[];for(let n=0;n<e;n++)o.push(t.readUInt32BE(8+n*4));let i=8+e*4,s=[];for(let n=0;n<e;n++)try{let f=_y(t,i,o[n]);s.push(...f),i+=o[n]}catch(f){console.warn(`Error decoding page ${n}:`,f),i+=o[n]}return s}var xi=class{constructor(){this.browserName="Safari"}getHomeDir(){let t=process.env.HOME;return typeof t!="string"||t.trim().length===0?(I("SafariCookieQueryStrategy","HOME environment variable not set"),""):t}getCookieDbPath(t){return(0,$p.join)(t,"Library","Containers","com.apple.Safari","Data","Library","Cookies","Cookies.binarycookies")}decodeCookies(t,e,o){try{return Up(t).filter(s=>s.name===e&&s.domain.includes(o)).map(s=>({domain:s.domain,name:s.name,value:s.value.toString(),expiry:typeof s.expiry=="number"&&s.expiry>0?new Date(s.expiry*1e3):"Infinity",meta:{file:t,browser:"Safari",decrypted:!1}}))}catch(i){return i instanceof Error?I("SafariCookieQueryStrategy",`Error decoding ${t}`,{error:i,name:e,domain:o}):I("SafariCookieQueryStrategy",`Error decoding ${t}`,{error:"Unknown error",name:e,domain:o}),[]}}async queryCookies(t,e){let o=this.getHomeDir();if(typeof o!="string"||o.length===0)return Promise.resolve([]);let i=this.getCookieDbPath(o);return Promise.resolve(this.decodeCookies(i,t,e))}};function Ry(r){return r.expiry===void 0?r:typeof r.expiry=="number"?{...r,expiry:new Date(r.expiry*1e3)}:r}async function Gp(r,t={}){var n;let e=(n=t.strategy)!=null?n:new mi([new ci,new di,new xi]),o=async f=>(await e.queryCookies(f.name,f.domain)).map(Ry),i=Array.isArray(r)?await Promise.all(r.map(o)):await o(r),s=Array.isArray(i)?i.flat():i;if(t.removeExpired===!0){let f=Date.now();s=s.filter(l=>l.expiry==="Infinity"||l.expiry instanceof Date&&l.expiry.getTime()>f)}return typeof t.limit=="number"&&t.limit>0&&(s=s.slice(0,t.limit)),s}nt();nt();var oo=class{canHandle(t){return!0}handle(t){let e=new Set(t.map(o=>o.value));for(let o of e)O.log(o)}};nt();var yi=class{canHandle(t){return t.dump===!0||t.d===!0}handle(t){O.log(t)}};Jt();nt();var wi=class{canHandle(t){return t["dump-grouped"]===!0||t.D===!0}handle(t){let e=gr(t,o=>{var i,s;return(s=(i=o.meta)==null?void 0:i.file)!=null?s:"unknown"});O.log(JSON.stringify(e,null,2))}};Jt();function bi(r,t={}){let{format:e="merged",showFilePaths:o=!0,separator:i="; "}=t;if(r.length===0)return e==="merged"?"":[];if(e==="merged")return r.map(n=>n.value).join(i);let s=gr(r,n=>{var f,l;return(l=(f=n.meta)==null?void 0:f.file)!=null?l:"unknown"});return Object.entries(s).map(([n,f])=>{let l=f.map(u=>u.value).join(i);return o?`${n}: ${l}`:l})}nt();var Si=class{canHandle(t){return t["render-grouped"]===!0||t.R===!0}handle(t){O.log(bi(t,{format:"grouped"}))}};nt();var vi=class{canHandle(t){return t.output==="json"}handle(t){O.log(JSON.stringify(t,null,2))}};nt();var Ci=class{canHandle(t){return t.render===!0||t["render-merged"]===!0||t.r===!0}handle(t){O.log(bi(t,{format:"merged"}))}};var Ei=class{constructor(){this.handlers=[new yi,new wi,new Ci,new Si,new vi,new oo]}getHandler(t){var e;return(e=this.handlers.find(o=>o.canHandle(t)))!=null?e:new oo}};async function Hp(r,t,e,o,i,s){try{let n=await Gp(r,{limit:i,removeExpired:s});if(n.length===0){O.error("No results");return}new Ei().getHandler(o).handle(n)}catch(n){n instanceof Error?O.error(n.message):O.error("An unknown error occurred")}}function Dy(){O.log("Usage: get-cookie [name] [domain] [options]"),O.log("Options:"),O.log(" -h, --help: Show this help message"),O.log(" -v, --verbose: Enable verbose output"),O.log(" -d, --dump: Dump all results"),O.log(" -D, --dump-grouped: Dump all results, grouped by profile"),O.log(" -r, --render: Render all results"),O.log(" -u, --url: URL to extract cookie specs from"),O.log(" -n, --name: Cookie name pattern"),O.log(" -d, --domain: Cookie domain pattern"),O.log(" --output: Output format (e.g., json)")}function My(r,t){return{name:r||"%",domain:t||"%"}}function Iy(r,t){let e=r.url;if(typeof e=="string"){let s=Oi(e);return Array.isArray(s)?s:(O.error("Invalid cookie specs from URL"),[])}let o=r.name||t[0]||"%",i=r.domain||t[1]||"%";return[My(o,i)]}async function Ly(r,t){let e=Iy(r,t);r.verbose===!0&&O.log("cookieSpecs",e);try{await Hp(e,["chrome","firefox","safari"],["default"],{...r})}catch(o){o instanceof Error?O.error("Error querying cookies:",o.message):O.error("An unknown error occurred while querying cookies")}}async function Fy(){let r=process.argv.slice(2),{values:t,positionals:e}=Ms(r);if(t.help===!0){Dy();return}await Ly(t,e)}Fy().catch(r=>{r instanceof Error?O.error("Fatal error:",r.message):O.error("An unknown fatal error occurred"),process.exit(1)});
2
+ "use strict";var xn=Object.create;var Cr=Object.defineProperty;var yn=Object.getOwnPropertyDescriptor;var hn=Object.getOwnPropertyNames;var bn=Object.getPrototypeOf,Cn=Object.prototype.hasOwnProperty;var n=(e,r)=>()=>(e&&(r=e(e=0)),r);var wn=(e,r)=>{for(var t in r)Cr(e,t,{get:r[t],enumerable:!0})},kn=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of hn(r))!Cn.call(e,a)&&a!==t&&Cr(e,a,{get:()=>r[a],enumerable:!(o=yn(r,a))||o.enumerable});return e};var J=(e,r,t)=>(t=e!=null?xn(bn(e)):{},kn(r||!e||!e.__esModule?Cr(t,"default",{value:e,enumerable:!0}):t,e));var rt,tt,ce,Sn,kr,ot=n(()=>{"use strict";rt=require("os"),tt=require("dotenv"),ce=require("zod");(0,tt.config)();Sn=ce.z.object({LOG_LEVEL:ce.z.enum(["debug","info","warn","error"]).default("info"),HOME:ce.z.string().optional().transform(e=>e??process.env.USERPROFILE??"").pipe(ce.z.string().min(1))}),kr=Sn.parse({LOG_LEVEL:process.env.LOG_LEVEL,HOME:(0,rt.homedir)()})});var at,En,cm,m,O=n(()=>{"use strict";at=require("consola");ot();En=(0,at.createConsola)({fancy:!0,formatOptions:{showLogLevel:!1,colors:!0,date:!1,compact:!0,columns:typeof process.stdout.columns=="number"?process.stdout.columns:80},level:kr.LOG_LEVEL==="debug"?5:2}),cm=kr.LOG_LEVEL==="debug",m=En});function it(e,r,t){let a=`${r?"\u2705":"\u274C"} ${e} ${r?"succeeded":"failed"}`;r?m.success(a,t):m.error(a,t)}function y(e,r,t){let o={...t??{},error:r instanceof Error?{name:r.name,message:r.message,stack:r.stack}:r};m.error(e,o)}function P(e,r,t){m.withTag(e).debug(r,t)}function Pe(e){return m.withTag(e)}function C(e,r,t){m.withTag(e).warn(r,t)}var v=n(()=>{"use strict";O();O()});var On,Re,vr=n(()=>{"use strict";On=typeof global=="object"&&global&&global.Object===Object&&global,Re=On});var _n,An,b,T=n(()=>{"use strict";vr();_n=typeof self=="object"&&self&&self.Object===Object&&self,An=Re||_n||Function("return this")(),b=An});var Pn,S,xe=n(()=>{"use strict";T();Pn=b.Symbol,S=Pn});function Bn(e){var r=Tn.call(e,ye),t=e[ye];try{e[ye]=void 0;var o=!0}catch{}var a=Rn.call(e);return o&&(r?e[ye]=t:delete e[ye]),a}var nt,Tn,Rn,ye,st,ft=n(()=>{"use strict";xe();nt=Object.prototype,Tn=nt.hasOwnProperty,Rn=nt.toString,ye=S?S.toStringTag:void 0;st=Bn});function Fn(e){return Ln.call(e)}var In,Ln,pt,ut=n(()=>{"use strict";In=Object.prototype,Ln=In.toString;pt=Fn});function jn(e){return e==null?e===void 0?Mn:Dn:mt&&mt in Object(e)?st(e):pt(e)}var Dn,Mn,mt,_,V=n(()=>{"use strict";xe();ft();ut();Dn="[object Null]",Mn="[object Undefined]",mt=S?S.toStringTag:void 0;_=jn});function Nn(e){return e!=null&&typeof e=="object"}var A,Z=n(()=>{"use strict";A=Nn});function Hn(e){return typeof e=="symbol"||A(e)&&_(e)==Un}var Un,X,Be=n(()=>{"use strict";V();Z();Un="[object Symbol]";X=Hn});function zn(e,r){for(var t=-1,o=e==null?0:e.length,a=Array(o);++t<o;)a[t]=r(e[t],t,e);return a}var lt,dt=n(()=>{"use strict";lt=zn});var qn,h,R=n(()=>{"use strict";qn=Array.isArray,h=qn});function xt(e){if(typeof e=="string")return e;if(h(e))return lt(e,xt)+"";if(X(e))return gt?gt.call(e):"";var r=e+"";return r=="0"&&1/e==-Gn?"-0":r}var Gn,ct,gt,yt,ht=n(()=>{"use strict";xe();dt();R();Be();Gn=1/0,ct=S?S.prototype:void 0,gt=ct?ct.toString:void 0;yt=xt});function Qn(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Y,Ie=n(()=>{"use strict";Y=Qn});function Wn(e){return e}var bt,Ct=n(()=>{"use strict";bt=Wn});function Zn(e){if(!Y(e))return!1;var r=_(e);return r==Kn||r==Jn||r==$n||r==Vn}var $n,Kn,Jn,Vn,Le,Sr=n(()=>{"use strict";V();Ie();$n="[object AsyncFunction]",Kn="[object Function]",Jn="[object GeneratorFunction]",Vn="[object Proxy]";Le=Zn});var Xn,Fe,wt=n(()=>{"use strict";T();Xn=b["__core-js_shared__"],Fe=Xn});function Yn(e){return!!kt&&kt in e}var kt,vt,St=n(()=>{"use strict";wt();kt=function(){var e=/[^.]+$/.exec(Fe&&Fe.keys&&Fe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();vt=Yn});function ts(e){if(e!=null){try{return rs.call(e)}catch{}try{return e+""}catch{}}return""}var es,rs,F,Er=n(()=>{"use strict";es=Function.prototype,rs=es.toString;F=ts});function us(e){if(!Y(e)||vt(e))return!1;var r=Le(e)?ps:as;return r.test(F(e))}var os,as,is,ns,ss,fs,ps,Et,Ot=n(()=>{"use strict";Sr();St();Ie();Er();os=/[\\^$.*+?()[\]{}|]/g,as=/^\[object .+?Constructor\]$/,is=Function.prototype,ns=Object.prototype,ss=is.toString,fs=ns.hasOwnProperty,ps=RegExp("^"+ss.call(fs).replace(os,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");Et=us});function ms(e,r){return e?.[r]}var _t,At=n(()=>{"use strict";_t=ms});function ls(e,r){var t=_t(e,r);return Et(t)?t:void 0}var w,j=n(()=>{"use strict";Ot();At();w=ls});var ds,De,Pt=n(()=>{"use strict";j();T();ds=w(b,"WeakMap"),De=ds});var cs,Or,Tt=n(()=>{"use strict";j();cs=function(){try{var e=w(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Or=cs});function ys(e,r){var t=typeof e;return r=r??gs,!!r&&(t=="number"||t!="symbol"&&xs.test(e))&&e>-1&&e%1==0&&e<r}var gs,xs,Me,_r=n(()=>{"use strict";gs=9007199254740991,xs=/^(?:0|[1-9]\d*)$/;Me=ys});function hs(e,r,t){r=="__proto__"&&Or?Or(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var Rt,Bt=n(()=>{"use strict";Tt();Rt=hs});function bs(e,r){return e===r||e!==e&&r!==r}var je,Ar=n(()=>{"use strict";je=bs});function ws(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Cs}var Cs,ee,Ne=n(()=>{"use strict";Cs=9007199254740991;ee=ws});function ks(e){return e!=null&&ee(e.length)&&!Le(e)}var Ue,Pr=n(()=>{"use strict";Sr();Ne();Ue=ks});function Ss(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||vs;return e===t}var vs,It,Lt=n(()=>{"use strict";vs=Object.prototype;It=Ss});function Es(e,r){for(var t=-1,o=Array(e);++t<e;)o[t]=r(t);return o}var Ft,Dt=n(()=>{"use strict";Ft=Es});function _s(e){return A(e)&&_(e)==Os}var Os,Tr,Mt=n(()=>{"use strict";V();Z();Os="[object Arguments]";Tr=_s});var jt,As,Ps,Ts,He,Rr=n(()=>{"use strict";Mt();Z();jt=Object.prototype,As=jt.hasOwnProperty,Ps=jt.propertyIsEnumerable,Ts=Tr(function(){return arguments}())?Tr:function(e){return A(e)&&As.call(e,"callee")&&!Ps.call(e,"callee")},He=Ts});function Rs(){return!1}var Nt,Ut=n(()=>{"use strict";Nt=Rs});var qt,Ht,Bs,zt,Is,Ls,he,Br=n(()=>{"use strict";T();Ut();qt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ht=qt&&typeof module=="object"&&module&&!module.nodeType&&module,Bs=Ht&&Ht.exports===qt,zt=Bs?b.Buffer:void 0,Is=zt?zt.isBuffer:void 0,Ls=Is||Nt,he=Ls});function nf(e){return A(e)&&ee(e.length)&&!!x[_(e)]}var Fs,Ds,Ms,js,Ns,Us,Hs,zs,qs,Gs,Qs,Ws,$s,Ks,Js,Vs,Zs,Xs,Ys,ef,rf,tf,of,af,x,Gt,Qt=n(()=>{"use strict";V();Ne();Z();Fs="[object Arguments]",Ds="[object Array]",Ms="[object Boolean]",js="[object Date]",Ns="[object Error]",Us="[object Function]",Hs="[object Map]",zs="[object Number]",qs="[object Object]",Gs="[object RegExp]",Qs="[object Set]",Ws="[object String]",$s="[object WeakMap]",Ks="[object ArrayBuffer]",Js="[object DataView]",Vs="[object Float32Array]",Zs="[object Float64Array]",Xs="[object Int8Array]",Ys="[object Int16Array]",ef="[object Int32Array]",rf="[object Uint8Array]",tf="[object Uint8ClampedArray]",of="[object Uint16Array]",af="[object Uint32Array]",x={};x[Vs]=x[Zs]=x[Xs]=x[Ys]=x[ef]=x[rf]=x[tf]=x[of]=x[af]=!0;x[Fs]=x[Ds]=x[Ks]=x[Ms]=x[Js]=x[js]=x[Ns]=x[Us]=x[Hs]=x[zs]=x[qs]=x[Gs]=x[Qs]=x[Ws]=x[$s]=!1;Gt=nf});function sf(e){return function(r){return e(r)}}var Wt,$t=n(()=>{"use strict";Wt=sf});var Kt,be,ff,Ir,pf,Lr,Jt=n(()=>{"use strict";vr();Kt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,be=Kt&&typeof module=="object"&&module&&!module.nodeType&&module,ff=be&&be.exports===Kt,Ir=ff&&Re.process,pf=function(){try{var e=be&&be.require&&be.require("util").types;return e||Ir&&Ir.binding&&Ir.binding("util")}catch{}}(),Lr=pf});var Vt,uf,ze,Fr=n(()=>{"use strict";Qt();$t();Jt();Vt=Lr&&Lr.isTypedArray,uf=Vt?Wt(Vt):Gt,ze=uf});function df(e,r){var t=h(e),o=!t&&He(e),a=!t&&!o&&he(e),i=!t&&!o&&!a&&ze(e),s=t||o||a||i,f=s?Ft(e.length,String):[],p=f.length;for(var u in e)(r||lf.call(e,u))&&!(s&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Me(u,p)))&&f.push(u);return f}var mf,lf,Zt,Xt=n(()=>{"use strict";Dt();Rr();R();Br();_r();Fr();mf=Object.prototype,lf=mf.hasOwnProperty;Zt=df});function cf(e,r){return function(t){return e(r(t))}}var Yt,eo=n(()=>{"use strict";Yt=cf});var gf,ro,to=n(()=>{"use strict";eo();gf=Yt(Object.keys,Object),ro=gf});function hf(e){if(!It(e))return ro(e);var r=[];for(var t in Object(e))yf.call(e,t)&&t!="constructor"&&r.push(t);return r}var xf,yf,oo,ao=n(()=>{"use strict";Lt();to();xf=Object.prototype,yf=xf.hasOwnProperty;oo=hf});function bf(e){return Ue(e)?Zt(e):oo(e)}var re,qe=n(()=>{"use strict";Xt();ao();Pr();re=bf});function kf(e,r){if(h(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||X(e)?!0:wf.test(e)||!Cf.test(e)||r!=null&&e in Object(r)}var Cf,wf,te,Ge=n(()=>{"use strict";R();Be();Cf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wf=/^\w*$/;te=kf});var vf,D,Ce=n(()=>{"use strict";j();vf=w(Object,"create"),D=vf});function Sf(){this.__data__=D?D(null):{},this.size=0}var io,no=n(()=>{"use strict";Ce();io=Sf});function Ef(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var so,fo=n(()=>{"use strict";so=Ef});function Pf(e){var r=this.__data__;if(D){var t=r[e];return t===Of?void 0:t}return Af.call(r,e)?r[e]:void 0}var Of,_f,Af,po,uo=n(()=>{"use strict";Ce();Of="__lodash_hash_undefined__",_f=Object.prototype,Af=_f.hasOwnProperty;po=Pf});function Bf(e){var r=this.__data__;return D?r[e]!==void 0:Rf.call(r,e)}var Tf,Rf,mo,lo=n(()=>{"use strict";Ce();Tf=Object.prototype,Rf=Tf.hasOwnProperty;mo=Bf});function Lf(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=D&&r===void 0?If:r,this}var If,co,go=n(()=>{"use strict";Ce();If="__lodash_hash_undefined__";co=Lf});function oe(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}var Dr,xo=n(()=>{"use strict";no();fo();uo();lo();go();oe.prototype.clear=io;oe.prototype.delete=so;oe.prototype.get=po;oe.prototype.has=mo;oe.prototype.set=co;Dr=oe});function Ff(){this.__data__=[],this.size=0}var yo,ho=n(()=>{"use strict";yo=Ff});function Df(e,r){for(var t=e.length;t--;)if(je(e[t][0],r))return t;return-1}var N,we=n(()=>{"use strict";Ar();N=Df});function Nf(e){var r=this.__data__,t=N(r,e);if(t<0)return!1;var o=r.length-1;return t==o?r.pop():jf.call(r,t,1),--this.size,!0}var Mf,jf,bo,Co=n(()=>{"use strict";we();Mf=Array.prototype,jf=Mf.splice;bo=Nf});function Uf(e){var r=this.__data__,t=N(r,e);return t<0?void 0:r[t][1]}var wo,ko=n(()=>{"use strict";we();wo=Uf});function Hf(e){return N(this.__data__,e)>-1}var vo,So=n(()=>{"use strict";we();vo=Hf});function zf(e,r){var t=this.__data__,o=N(t,e);return o<0?(++this.size,t.push([e,r])):t[o][1]=r,this}var Eo,Oo=n(()=>{"use strict";we();Eo=zf});function ae(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}var U,ke=n(()=>{"use strict";ho();Co();ko();So();Oo();ae.prototype.clear=yo;ae.prototype.delete=bo;ae.prototype.get=wo;ae.prototype.has=vo;ae.prototype.set=Eo;U=ae});var qf,H,Qe=n(()=>{"use strict";j();T();qf=w(b,"Map"),H=qf});function Gf(){this.size=0,this.__data__={hash:new Dr,map:new(H||U),string:new Dr}}var _o,Ao=n(()=>{"use strict";xo();ke();Qe();_o=Gf});function Qf(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var Po,To=n(()=>{"use strict";Po=Qf});function Wf(e,r){var t=e.__data__;return Po(r)?t[typeof r=="string"?"string":"hash"]:t.map}var z,ve=n(()=>{"use strict";To();z=Wf});function $f(e){var r=z(this,e).delete(e);return this.size-=r?1:0,r}var Ro,Bo=n(()=>{"use strict";ve();Ro=$f});function Kf(e){return z(this,e).get(e)}var Io,Lo=n(()=>{"use strict";ve();Io=Kf});function Jf(e){return z(this,e).has(e)}var Fo,Do=n(()=>{"use strict";ve();Fo=Jf});function Vf(e,r){var t=z(this,e),o=t.size;return t.set(e,r),this.size+=t.size==o?0:1,this}var Mo,jo=n(()=>{"use strict";ve();Mo=Vf});function ie(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var o=e[r];this.set(o[0],o[1])}}var $,We=n(()=>{"use strict";Ao();Bo();Lo();Do();jo();ie.prototype.clear=_o;ie.prototype.delete=Ro;ie.prototype.get=Io;ie.prototype.has=Fo;ie.prototype.set=Mo;$=ie});function Mr(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(Zf);var t=function(){var o=arguments,a=r?r.apply(this,o):o[0],i=t.cache;if(i.has(a))return i.get(a);var s=e.apply(this,o);return t.cache=i.set(a,s)||i,s};return t.cache=new(Mr.Cache||$),t}var Zf,B,jr=n(()=>{"use strict";We();Zf="Expected a function";Mr.Cache=$;B=Mr});function Yf(e){var r=B(e,function(o){return t.size===Xf&&t.clear(),o}),t=r.cache;return r}var Xf,No,Uo=n(()=>{"use strict";jr();Xf=500;No=Yf});var ep,rp,tp,Ho,zo=n(()=>{"use strict";Uo();ep=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rp=/\\(\\)?/g,tp=No(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(ep,function(t,o,a,i){r.push(a?i.replace(rp,"$1"):o||t)}),r}),Ho=tp});function op(e){return e==null?"":yt(e)}var qo,Go=n(()=>{"use strict";ht();qo=op});function ap(e,r){return h(e)?e:te(e,r)?[e]:Ho(qo(e))}var $e,Nr=n(()=>{"use strict";R();Ge();zo();Go();$e=ap});function np(e){if(typeof e=="string"||X(e))return e;var r=e+"";return r=="0"&&1/e==-ip?"-0":r}var ip,q,Se=n(()=>{"use strict";Be();ip=1/0;q=np});function sp(e,r){r=$e(r,e);for(var t=0,o=r.length;e!=null&&t<o;)e=e[q(r[t++])];return t&&t==o?e:void 0}var Ke,Ur=n(()=>{"use strict";Nr();Se();Ke=sp});function fp(e,r,t){var o=e==null?void 0:Ke(e,r);return o===void 0?t:o}var Qo,Wo=n(()=>{"use strict";Ur();Qo=fp});function pp(e,r){for(var t=-1,o=r.length,a=e.length;++t<o;)e[a+t]=r[t];return e}var $o,Ko=n(()=>{"use strict";$o=pp});function up(){this.__data__=new U,this.size=0}var Jo,Vo=n(()=>{"use strict";ke();Jo=up});function mp(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}var Zo,Xo=n(()=>{"use strict";Zo=mp});function lp(e){return this.__data__.get(e)}var Yo,ea=n(()=>{"use strict";Yo=lp});function dp(e){return this.__data__.has(e)}var ra,ta=n(()=>{"use strict";ra=dp});function gp(e,r){var t=this.__data__;if(t instanceof U){var o=t.__data__;if(!H||o.length<cp-1)return o.push([e,r]),this.size=++t.size,this;t=this.__data__=new $(o)}return t.set(e,r),this.size=t.size,this}var cp,oa,aa=n(()=>{"use strict";ke();Qe();We();cp=200;oa=gp});function ne(e){var r=this.__data__=new U(e);this.size=r.size}var se,Hr=n(()=>{"use strict";ke();Vo();Xo();ea();ta();aa();ne.prototype.clear=Jo;ne.prototype.delete=Zo;ne.prototype.get=Yo;ne.prototype.has=ra;ne.prototype.set=oa;se=ne});function xp(e,r){for(var t=-1,o=e==null?0:e.length,a=0,i=[];++t<o;){var s=e[t];r(s,t,e)&&(i[a++]=s)}return i}var ia,na=n(()=>{"use strict";ia=xp});function yp(){return[]}var sa,fa=n(()=>{"use strict";sa=yp});var hp,bp,pa,Cp,ua,ma=n(()=>{"use strict";na();fa();hp=Object.prototype,bp=hp.propertyIsEnumerable,pa=Object.getOwnPropertySymbols,Cp=pa?function(e){return e==null?[]:(e=Object(e),ia(pa(e),function(r){return bp.call(e,r)}))}:sa,ua=Cp});function wp(e,r,t){var o=r(e);return h(e)?o:$o(o,t(e))}var la,da=n(()=>{"use strict";Ko();R();la=wp});function kp(e){return la(e,re,ua)}var zr,ca=n(()=>{"use strict";da();ma();qe();zr=kp});var vp,Je,ga=n(()=>{"use strict";j();T();vp=w(b,"DataView"),Je=vp});var Sp,Ve,xa=n(()=>{"use strict";j();T();Sp=w(b,"Promise"),Ve=Sp});var Ep,Ze,ya=n(()=>{"use strict";j();T();Ep=w(b,"Set"),Ze=Ep});var ha,Op,ba,Ca,wa,ka,_p,Ap,Pp,Tp,Rp,K,qr,va=n(()=>{"use strict";ga();Qe();xa();ya();Pt();V();Er();ha="[object Map]",Op="[object Object]",ba="[object Promise]",Ca="[object Set]",wa="[object WeakMap]",ka="[object DataView]",_p=F(Je),Ap=F(H),Pp=F(Ve),Tp=F(Ze),Rp=F(De),K=_;(Je&&K(new Je(new ArrayBuffer(1)))!=ka||H&&K(new H)!=ha||Ve&&K(Ve.resolve())!=ba||Ze&&K(new Ze)!=Ca||De&&K(new De)!=wa)&&(K=function(e){var r=_(e),t=r==Op?e.constructor:void 0,o=t?F(t):"";if(o)switch(o){case _p:return ka;case Ap:return ha;case Pp:return ba;case Tp:return Ca;case Rp:return wa}return r});qr=K});var Bp,Gr,Sa=n(()=>{"use strict";T();Bp=b.Uint8Array,Gr=Bp});function Lp(e){return this.__data__.set(e,Ip),this}var Ip,Ea,Oa=n(()=>{"use strict";Ip="__lodash_hash_undefined__";Ea=Lp});function Fp(e){return this.__data__.has(e)}var _a,Aa=n(()=>{"use strict";_a=Fp});function Xe(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new $;++r<t;)this.add(e[r])}var Pa,Ta=n(()=>{"use strict";We();Oa();Aa();Xe.prototype.add=Xe.prototype.push=Ea;Xe.prototype.has=_a;Pa=Xe});function Dp(e,r){for(var t=-1,o=e==null?0:e.length;++t<o;)if(r(e[t],t,e))return!0;return!1}var Ra,Ba=n(()=>{"use strict";Ra=Dp});function Mp(e,r){return e.has(r)}var Ia,La=n(()=>{"use strict";Ia=Mp});function Up(e,r,t,o,a,i){var s=t&jp,f=e.length,p=r.length;if(f!=p&&!(s&&p>f))return!1;var u=i.get(e),d=i.get(r);if(u&&d)return u==r&&d==e;var c=-1,g=!0,L=t&Np?new Pa:void 0;for(i.set(e,r),i.set(r,e);++c<f;){var k=e[c],E=r[c];if(o)var M=s?o(E,k,c,r,e,i):o(k,E,c,e,r,i);if(M!==void 0){if(M)continue;g=!1;break}if(L){if(!Ra(r,function(Q,W){if(!Ia(L,W)&&(k===Q||a(k,Q,t,o,i)))return L.push(W)})){g=!1;break}}else if(!(k===E||a(k,E,t,o,i))){g=!1;break}}return i.delete(e),i.delete(r),g}var jp,Np,Ye,Qr=n(()=>{"use strict";Ta();Ba();La();jp=1,Np=2;Ye=Up});function Hp(e){var r=-1,t=Array(e.size);return e.forEach(function(o,a){t[++r]=[a,o]}),t}var Fa,Da=n(()=>{"use strict";Fa=Hp});function zp(e){var r=-1,t=Array(e.size);return e.forEach(function(o){t[++r]=o}),t}var Ma,ja=n(()=>{"use strict";Ma=zp});function tu(e,r,t,o,a,i,s){switch(t){case ru:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case eu:return!(e.byteLength!=r.byteLength||!i(new Gr(e),new Gr(r)));case Qp:case Wp:case Jp:return je(+e,+r);case $p:return e.name==r.name&&e.message==r.message;case Vp:case Xp:return e==r+"";case Kp:var f=Fa;case Zp:var p=o&qp;if(f||(f=Ma),e.size!=r.size&&!p)return!1;var u=s.get(e);if(u)return u==r;o|=Gp,s.set(e,r);var d=Ye(f(e),f(r),o,a,i,s);return s.delete(e),d;case Yp:if(Wr)return Wr.call(e)==Wr.call(r)}return!1}var qp,Gp,Qp,Wp,$p,Kp,Jp,Vp,Zp,Xp,Yp,eu,ru,Na,Wr,Ua,Ha=n(()=>{"use strict";xe();Sa();Ar();Qr();Da();ja();qp=1,Gp=2,Qp="[object Boolean]",Wp="[object Date]",$p="[object Error]",Kp="[object Map]",Jp="[object Number]",Vp="[object RegExp]",Zp="[object Set]",Xp="[object String]",Yp="[object Symbol]",eu="[object ArrayBuffer]",ru="[object DataView]",Na=S?S.prototype:void 0,Wr=Na?Na.valueOf:void 0;Ua=tu});function nu(e,r,t,o,a,i){var s=t&ou,f=zr(e),p=f.length,u=zr(r),d=u.length;if(p!=d&&!s)return!1;for(var c=p;c--;){var g=f[c];if(!(s?g in r:iu.call(r,g)))return!1}var L=i.get(e),k=i.get(r);if(L&&k)return L==r&&k==e;var E=!0;i.set(e,r),i.set(r,e);for(var M=s;++c<p;){g=f[c];var Q=e[g],W=r[g];if(o)var Xr=s?o(W,Q,g,r,e,i):o(Q,W,g,e,r,i);if(!(Xr===void 0?Q===W||a(Q,W,t,o,i):Xr)){E=!1;break}M||(M=g=="constructor")}if(E&&!M){var _e=e.constructor,Ae=r.constructor;_e!=Ae&&"constructor"in e&&"constructor"in r&&!(typeof _e=="function"&&_e instanceof _e&&typeof Ae=="function"&&Ae instanceof Ae)&&(E=!1)}return i.delete(e),i.delete(r),E}var ou,au,iu,za,qa=n(()=>{"use strict";ca();ou=1,au=Object.prototype,iu=au.hasOwnProperty;za=nu});function pu(e,r,t,o,a,i){var s=h(e),f=h(r),p=s?Qa:qr(e),u=f?Qa:qr(r);p=p==Ga?er:p,u=u==Ga?er:u;var d=p==er,c=u==er,g=p==u;if(g&&he(e)){if(!he(r))return!1;s=!0,d=!1}if(g&&!d)return i||(i=new se),s||ze(e)?Ye(e,r,t,o,a,i):Ua(e,r,p,t,o,a,i);if(!(t&su)){var L=d&&Wa.call(e,"__wrapped__"),k=c&&Wa.call(r,"__wrapped__");if(L||k){var E=L?e.value():e,M=k?r.value():r;return i||(i=new se),a(E,M,t,o,i)}}return g?(i||(i=new se),za(e,r,t,o,a,i)):!1}var su,Ga,Qa,er,fu,Wa,$a,Ka=n(()=>{"use strict";Hr();Qr();Ha();qa();va();R();Br();Fr();su=1,Ga="[object Arguments]",Qa="[object Array]",er="[object Object]",fu=Object.prototype,Wa=fu.hasOwnProperty;$a=pu});function Ja(e,r,t,o,a){return e===r?!0:e==null||r==null||!A(e)&&!A(r)?e!==e&&r!==r:$a(e,r,t,o,Ja,a)}var rr,$r=n(()=>{"use strict";Ka();Z();rr=Ja});function lu(e,r,t,o){var a=t.length,i=a,s=!o;if(e==null)return!i;for(e=Object(e);a--;){var f=t[a];if(s&&f[2]?f[1]!==e[f[0]]:!(f[0]in e))return!1}for(;++a<i;){f=t[a];var p=f[0],u=e[p],d=f[1];if(s&&f[2]){if(u===void 0&&!(p in e))return!1}else{var c=new se;if(o)var g=o(u,d,p,e,r,c);if(!(g===void 0?rr(d,u,uu|mu,o,c):g))return!1}}return!0}var uu,mu,Va,Za=n(()=>{"use strict";Hr();$r();uu=1,mu=2;Va=lu});function du(e){return e===e&&!Y(e)}var tr,Kr=n(()=>{"use strict";Ie();tr=du});function cu(e){for(var r=re(e),t=r.length;t--;){var o=r[t],a=e[o];r[t]=[o,a,tr(a)]}return r}var Xa,Ya=n(()=>{"use strict";Kr();qe();Xa=cu});function gu(e,r){return function(t){return t==null?!1:t[e]===r&&(r!==void 0||e in Object(t))}}var or,Jr=n(()=>{"use strict";or=gu});function xu(e){var r=Xa(e);return r.length==1&&r[0][2]?or(r[0][0],r[0][1]):function(t){return t===e||Va(t,e,r)}}var ei,ri=n(()=>{"use strict";Za();Ya();Jr();ei=xu});function yu(e,r){return e!=null&&r in Object(e)}var ti,oi=n(()=>{"use strict";ti=yu});function hu(e,r,t){r=$e(r,e);for(var o=-1,a=r.length,i=!1;++o<a;){var s=q(r[o]);if(!(i=e!=null&&t(e,s)))break;e=e[s]}return i||++o!=a?i:(a=e==null?0:e.length,!!a&&ee(a)&&Me(s,a)&&(h(e)||He(e)))}var ai,ii=n(()=>{"use strict";Nr();Rr();R();_r();Ne();Se();ai=hu});function bu(e,r){return e!=null&&ai(e,r,ti)}var ni,si=n(()=>{"use strict";oi();ii();ni=bu});function ku(e,r){return te(e)&&tr(r)?or(q(e),r):function(t){var o=Qo(t,e);return o===void 0&&o===r?ni(t,e):rr(r,o,Cu|wu)}}var Cu,wu,fi,pi=n(()=>{"use strict";$r();Wo();si();Ge();Kr();Jr();Se();Cu=1,wu=2;fi=ku});function vu(e){return function(r){return r?.[e]}}var ui,mi=n(()=>{"use strict";ui=vu});function Su(e){return function(r){return Ke(r,e)}}var li,di=n(()=>{"use strict";Ur();li=Su});function Eu(e){return te(e)?ui(q(e)):li(e)}var ci,gi=n(()=>{"use strict";mi();di();Ge();Se();ci=Eu});function Ou(e){return typeof e=="function"?e:e==null?bt:typeof e=="object"?h(e)?fi(e[0],e[1]):ei(e):ci(e)}var xi,yi=n(()=>{"use strict";ri();pi();Ct();R();gi();xi=Ou});function _u(e,r,t,o){for(var a=-1,i=e==null?0:e.length;++a<i;){var s=e[a];r(o,s,t(s),e)}return o}var hi,bi=n(()=>{"use strict";hi=_u});function Au(e){return function(r,t,o){for(var a=-1,i=Object(r),s=o(r),f=s.length;f--;){var p=s[e?f:++a];if(t(i[p],p,i)===!1)break}return r}}var Ci,wi=n(()=>{"use strict";Ci=Au});var Pu,ki,vi=n(()=>{"use strict";wi();Pu=Ci(),ki=Pu});function Tu(e,r){return e&&ki(e,r,re)}var Si,Ei=n(()=>{"use strict";vi();qe();Si=Tu});function Ru(e,r){return function(t,o){if(t==null)return t;if(!Ue(t))return e(t,o);for(var a=t.length,i=r?a:-1,s=Object(t);(r?i--:++i<a)&&o(s[i],i,s)!==!1;);return t}}var Oi,_i=n(()=>{"use strict";Pr();Oi=Ru});var Bu,Ai,Pi=n(()=>{"use strict";Ei();_i();Bu=Oi(Si),Ai=Bu});function Iu(e,r,t,o){return Ai(e,function(a,i,s){r(o,a,t(a),s)}),o}var Ti,Ri=n(()=>{"use strict";Pi();Ti=Iu});function Lu(e,r){return function(t,o){var a=h(t)?hi:Ti,i=r?r():{};return a(t,e,xi(o,2),i)}}var Bi,Ii=n(()=>{"use strict";bi();Ri();yi();R();Bi=Lu});var Fu,Du,Mu,Ee,Li=n(()=>{"use strict";Bt();Ii();Fu=Object.prototype,Du=Fu.hasOwnProperty,Mu=Bi(function(e,r,t){Du.call(e,t)?e[t].push(r):Rt(e,t,[r])}),Ee=Mu});var fe=n(()=>{"use strict";Li();jr();});function Ju(e,r){if(e instanceof G)throw y("Command execution failed",e,{command:e.command,originalError:e.originalError}),e;if(e instanceof Error){let o=new G(e.message,r,e);throw y("Failed to execute command",e,{command:r,stack:e.stack}),o}let t=new G("Unknown error occurred during command execution",r);throw y("Failed to execute command",null,{error:e,command:r}),t}async function $i(e,r={}){if(!e||typeof e!="string")throw new G("Command must be a non-empty string",e);let t={encoding:"utf8",maxBuffer:5*1024*1024,timeout:3e4};try{let{stdout:o,stderr:a}=await Ku(e,{...t,...r}),i=o.trim();if(!i)throw a?new G(`Command failed with stderr: ${a}`,e):new G("Command returned empty result",e);return i}catch(o){Ju(o,e)}}var Qi,Wi,Ku,G,Ki=n(()=>{"use strict";Qi=require("child_process"),Wi=require("util");v();Ku=(0,Wi.promisify)(Qi.exec),G=class extends Error{constructor(t,o,a){super(t);this.command=o;this.originalError=a;this.name="CommandExecutionError"}}});var Ji={};wn(Ji,{getChromePassword:()=>Zu});var Vu,Zu,Vi=n(()=>{"use strict";fe();Ki();Vu=async()=>$i('security find-generic-password -w -s "Chrome Safe Storage"'),Zu=B(Vu)});function vn(e){let r=e.split("."),t=[];t.push({name:"%",domain:e});for(let o=1;o<r.length-1;o++){let a=r.slice(o).join(".");t.push({name:"%",domain:a})}return t}function wr(e){if(!e.includes("://"))try{return wr(`https://${e}`)}catch{return[{name:"%",domain:e}]}try{let r=new URL(e);return vn(r.hostname)}catch{return[{name:"%",domain:e}]}}var Yr=J(require("minimist"),1);function et(e){let r=(0,Yr.default)(e,{string:["browser","profile","url","domain","name","output"],boolean:["help","version","verbose","dump","dump-grouped","render","render-grouped"],alias:{b:"browser",p:"profile",u:"url",d:"domain",n:"name",h:"help",v:"version",D:"dump-grouped",r:"render",R:"render-grouped"}}),{_:t,...o}=r;return{values:o,positionals:t}}O();v();O();var ge=class{canHandle(r){return!0}handle(r){let t=new Set(r.map(o=>o.value));for(let o of t)m.log(o)}};O();var Te=class{canHandle(r){return r.dump===!0||r.d===!0}handle(r){m.log(r)}};fe();O();var ar=class{canHandle(r){return r["dump-grouped"]===!0||r.D===!0}handle(r){let t=Ee(r,o=>o.meta?.file??"unknown");m.log(JSON.stringify(t,null,2))}};fe();function ir(e,r={}){let{format:t="merged",showFilePaths:o=!0,separator:a="; "}=r;if(e.length===0)return t==="merged"?"":[];if(t==="merged")return e.map(s=>s.value).join(a);let i=Ee(e,s=>s.meta?.file??"unknown");return Object.entries(i).map(([s,f])=>{let p=f.map(u=>u.value).join(a);return o?`${s}: ${p}`:p})}O();var nr=class{canHandle(r){return r["render-grouped"]===!0||r.R===!0}handle(r){m.log(ir(r,{format:"grouped"}))}};O();var sr=class{canHandle(r){return r.output==="json"}handle(r){m.log(JSON.stringify(r,null,2))}};O();var fr=class{canHandle(r){return r.render===!0||r["render-merged"]===!0||r.r===!0}handle(r){m.log(ir(r,{format:"merged"}))}};var pr=class{constructor(){this.handlers=[new Te,new ar,new fr,new nr,new sr,new ge]}getHandler(r){return this.handlers.find(t=>t.canHandle(r))??new ge}};var Vr=require("date-fns");function Fi(e){let r=new Date;return e.filter(t=>t.expiry==="Infinity"?!0:t.expiry instanceof Date?(0,Vr.isAfter)(t.expiry,r):typeof t.expiry=="number"?(0,Vr.isAfter)(new Date(t.expiry*1e3),r):!0)}var ur=class{constructor(r){this.strategy=r}async queryCookies(r,t){return this.strategy.queryCookies(r.name,r.domain)}};v();var Ni=require("fs"),lr=require("path"),Ui=J(require("fast-glob"),1);v();var Di=require("os"),Mi=require("path"),pe=(()=>{let e=(0,Di.homedir)();if(!e)throw new Error("Unable to determine user home directory");return(0,Mi.join)(e,"Library","Application Support","Google","Chrome")})();var ji=J(require("better-sqlite3"),1);v();function ju(e){try{return new ji.default(e,{readonly:!0,fileMustExist:!0})}catch(r){throw y("Database open failed",r,{file:e}),r}}function Nu(e){try{return e.close(),Promise.resolve()}catch(r){return y("Database close failed",r),Promise.reject(r instanceof Error?r:new Error("Failed to close database: Unknown error"))}}async function mr({file:e,sql:r,params:t,rowFilter:o,rowTransform:a}){let i;try{i=ju(e);let f=i.prepare(r).all(t),p=o?f.filter(o):f;return a?p.map(a):p}catch(s){throw y("Database query failed",s,{file:e,sql:r}),s}finally{i&&await Nu(i)}}function Uu(e){if(typeof e!="string")return!1;let r=e.trim();return r.length===0?!1:(0,Ni.existsSync)(r)}async function Hu(){let e=[(0,lr.join)(pe,"Default/Cookies"),(0,lr.join)(pe,"Profile */Cookies"),(0,lr.join)(pe,"Profile Default/Cookies")],r=[];for(let t of e){let o=await(0,Ui.default)(t);r.push(...o)}return P("ChromeCookies","Found cookie files",{count:r.length,files:r}),r}function zu(e,r){let t=e==="%",o=t?"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 ?",a=t?[`%${r}%`]:[e,`%${r}%`];return{sql:o,params:a}}async function qu(e,r,t){try{let{sql:o,params:a}=zu(r,t);P("ChromeCookies","Executing query",{sql:o,params:a});let i=await mr({file:e,sql:o,params:a,rowTransform:s=>({name:s.name,domain:s.host_key,value:s.encrypted_value,expiry:s.expires_utc})});return it("QueryCookies",!0,{file:e,count:i.length}),i}catch(o){return y("Failed to read cookie file",o,{file:e}),[]}}async function Hi({name:e,domain:r,file:t}){let o=typeof t=="string"&&t.length>0?[t]:await Hu();if(o.length===0)return P("ChromeCookies","No cookie files found"),[];let a=[];for(let i of o){if(!Uu(i)){P("ChromeCookies","Cookie file missing or invalid",{file:i});continue}let s=await qu(i,e,r);a.push(...s)}return P("ChromeCookies","Query complete",{totalCookies:a.length}),a}var zi=J(require("fast-glob"),1);O();var Gu=m.withTag("listChromeProfiles");function qi(){let e=zi.default.sync("./**/Cookies",{cwd:pe,absolute:!0});return Gu.debug("Found cookie files:",e),e}var dr=require("crypto");fe();var Qu=B(e=>e.length>=3&&e[0]===118&&e[1]===49&&e[2]===48?e.slice(3):e,e=>e.toString("hex")),Wu=B(e=>{let r=e[e.length-1];return r&&r<=16?e.slice(0,-r):e},e=>e.toString("hex"));function $u(e){let r=[/.*?0t(.+)$/,/.*?1e`(.+)$/,/.*?[`'](.+)$/,/[^\x20-\x7E]*([\x20-\x7E].+)$/];for(let t of r){let a=e.match(t)?.[1]??"";if(a.length>0)return a}return e}async function Gi(e,r){if(typeof r!="string")throw new Error("password must be a string");if(!Buffer.isBuffer(e))throw new Error("encryptedData must be a Buffer");return new Promise((t,o)=>{(0,dr.pbkdf2)(r,"saltysalt",1003,16,"sha1",(a,i)=>{try{if(a){o(new Error("Failed to derive key: "+a.message));return}let s=Qu(e);if(s.length%16!==0){o(new Error("Encrypted data length is not a multiple of 16"));return}let f=Buffer.alloc(16," "),p=(0,dr.createDecipheriv)("aes-128-cbc",i,f);p.setAutoPadding(!1);let u=p.update(s);try{p.final()}catch(c){o(new Error("Failed to finalize decryption: "+c.message));return}u=Wu(u);let d=u.toString("utf8");t($u(d))}catch(s){o(new Error("Decryption failed: "+s.message))}})})}fe();v();var Zi=B(async()=>{if(process.platform!=="darwin")throw y("Chrome password retrieval failed",new Error("This only works on macOS"),{platform:process.platform}),new Error("This only works on macOS");try{let{getChromePassword:e}=await Promise.resolve().then(()=>(Vi(),Ji)),r=await e();return P("ChromePassword","Retrieved password successfully",{platform:"macOS"}),r}catch(e){throw y("Chrome password retrieval failed",e,{platform:"macOS"}),e}});function Xu(e){return typeof e!="number"||e<=0?"Infinity":new Date(e)}function Xi(e,r,t,o,a,i){return{domain:e,name:r,value:t,expiry:Xu(o),meta:{file:a,browser:"Chrome",decrypted:i}}}var ue=class{constructor(){this.logger=Pe("ChromeCookieQueryStrategy");this.browserName="Chrome"}async queryCookies(r,t){try{if(this.logger.info("Querying cookies",{name:r,domain:t}),process.platform!=="darwin")return this.logger.warn("Platform not supported",{platform:process.platform}),[];let o=qi();if(o.length===0)return this.logger.warn("No Chrome cookie files found"),[];let a=await Zi();return(await Promise.all(o.map(s=>this.processFile(s,r,t,a)))).flat()}catch(o){return o instanceof Error?y("Failed to query cookies",o,{name:r,domain:t}):y("Failed to query cookies",new Error(String(o)),{name:r,domain:t}),[]}}async processFile(r,t,o,a){try{let i=await Hi({name:t,domain:o,file:r}),s={file:r,password:a};return(await Promise.allSettled(i.map(p=>this.processCookie(p,s)))).map(p=>p.status==="fulfilled"?p.value:null).filter(p=>p!==null)}catch(i){return i instanceof Error?this.logger.error("Failed to process cookie file",{error:i,file:r}):this.logger.error("Failed to process cookie file",{error:String(i),file:r}),[]}}async processCookie(r,t){try{let o=Buffer.isBuffer(r.value)?r.value:Buffer.from(String(r.value)),a=await Gi(o,t.password);return Xi(r.domain,r.name,a,r.expiry,t.file,!0)}catch(o){return o instanceof Error?this.logger.warn("Failed to decrypt cookie",{error:o}):this.logger.warn("Failed to decrypt cookie",{error:String(o)}),Xi(r.domain,r.name,r.value.toString("utf-8"),r.expiry,t.file,!1)}}};async function Yi(e,r,t=[]){return e.length===0?t:(await Promise.all(e.map(async a=>{try{return await r(a)}catch{return t}}))).flat()}v();var Oe=class{constructor(r){this.strategies=r;this.logger=Pe("CompositeCookieQueryStrategy");this.browserName="internal"}handleStrategyError(r,t){r instanceof Error?this.logger.error("Strategy failed",{error:r,strategy:t}):this.logger.error("Strategy failed with unknown error",{error:String(r),strategy:t})}async queryCookies(r,t){try{return this.logger.info("Querying cookies from all strategies",{name:r,domain:t,strategyCount:this.strategies.length}),await Yi(this.strategies,async o=>{try{return await o.queryCookies(r,t)}catch(a){return this.handleStrategyError(a,o),[]}},[])}catch(o){return o instanceof Error?this.logger.error("Failed to query cookies",{error:o}):this.logger.error("Failed to query cookies with unknown error",{error:String(o)}),[]}}};var en=require("os"),Zr=require("path"),rn=J(require("fast-glob"),1);v();function Yu(){let e=(0,en.homedir)();if(!e)return C("FirefoxCookieQuery","Failed to get home directory"),[];let r=[(0,Zr.join)(e,"Library/Application Support/Firefox/Profiles/*/cookies.sqlite"),(0,Zr.join)(e,".mozilla/firefox/*/cookies.sqlite")],t=[];for(let o of r){let a=rn.default.sync(o);t.push(...a)}return P("FirefoxCookieQuery","Found Firefox cookie files",{files:t}),t}var me=class{constructor(){this.browserName="Firefox"}async queryCookies(r,t){let o=Yu(),a=[];for(let i of o)try{let s=await mr({file:i,sql:"SELECT name, value, host as domain, expiry FROM moz_cookies WHERE name = ? AND host LIKE ?",params:[r,`%${t}%`],rowTransform:f=>({name:f.name,value:f.value,domain:f.domain,expiry:f.expiry>0?new Date(f.expiry*1e3):"Infinity",meta:{file:i,browser:"Firefox",decrypted:!1}})});a.push(...s)}catch(s){s instanceof Error?C("FirefoxCookieQuery",`Error reading Firefox cookie file ${i}`,{error:s.message}):C("FirefoxCookieQuery",`Error reading Firefox cookie file ${i}`)}return a}};var ln=require("os"),dn=require("path");v();var sn=require("buffer"),fn=require("fs"),pn=require("os"),un=require("path");v();v();var xr=require("buffer");var tn=J(require("destr"),1),l=require("zod"),cr=l.z.string().trim().min(1,"Domain cannot be empty").refine(e=>/^\.?[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e),"Invalid domain format"),gr=l.z.string().trim().min(1,"Cookie name cannot be empty").refine(e=>e==="%"||/^[!#$%&'()*+\-.:0-9A-Z \^_`a-z|~]+$/.test(e),"Invalid cookie name format - must contain only valid characters (letters, numbers, and certain symbols) or be '%' for wildcard"),on=l.z.string().trim().min(1,"Path cannot be empty").refine(e=>e.startsWith("/"),"Path must start with /").refine(e=>/^\/[!#$%&'()*+,\-./:=@\w~]*$/.test(e),"Invalid path format - must contain only valid URL path characters").default("/"),an=l.z.string().trim().transform(e=>(0,tn.default)(e)).pipe(l.z.any()),nn=l.z.object({name:gr,value:an,domain:cr,path:on,expiry:l.z.number().int(),creation:l.z.number().int(),flags:l.z.number().optional(),version:l.z.number().int().optional(),port:l.z.number().int().optional(),comment:l.z.string().optional(),commentURL:l.z.string().optional()}),Rh=l.z.object({name:gr,domain:cr}).strict(),em=l.z.object({file:l.z.string().trim().min(1,"File path cannot be empty").optional(),browser:l.z.string().trim().optional(),decrypted:l.z.boolean().optional(),secure:l.z.boolean().optional(),httpOnly:l.z.boolean().optional(),path:on.optional()}).catchall(l.z.unknown()).strict(),rm=l.z.object({domain:cr,name:gr,value:an,expiry:l.z.union([l.z.literal("Infinity"),l.z.date(),l.z.number().int().positive("Expiry must be a positive number")]).optional(),meta:em.optional()}).strict(),Bh=l.z.object({expiry:l.z.number().int().optional(),domain:cr,name:gr,value:l.z.union([l.z.string(),l.z.instanceof(Buffer)])}).strict(),Ih=l.z.object({format:l.z.enum(["merged","grouped"]).optional(),separator:l.z.string().optional(),showFilePaths:l.z.boolean().optional()}).strict(),tm=l.z.enum(["Chrome","Firefox","Safari","internal","unknown"]),Lh=l.z.object({browserName:tm,queryCookies:l.z.function().args(l.z.string(),l.z.string()).returns(l.z.promise(l.z.array(rm)))}).strict();var yr=class{constructor(r){this.version=0;this.url="";this.name="";this.path="";this.value="";this.flags={isSecure:!1,isHTTPOnly:!1,unknown1:!1,unknown2:!1};this.expiration=0;this.creation=0;let t={offset:0,buffer:r};this.decode(t)}decodeUrlValue(r){let t=r,o;do{o=t;try{t=decodeURIComponent(t)}catch{return o}}while(t!==o&&t.includes("%"));return t}decodeJwtPayload(r){let t=r.split(".");if(t.length!==3)return null;try{let o=xr.Buffer.from(t[1],"base64").toString("utf8"),a=JSON.parse(o);return JSON.stringify(a)}catch{return null}}parseJsonValue(r){try{let t=JSON.parse(r);return JSON.stringify(t)}catch{return null}}processValue(r){let t=this.decodeUrlValue(r);if(t.match(/^ey[A-Za-z0-9_-]+\.ey[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/)){let o=this.decodeJwtPayload(t);if(typeof o=="string"&&o.length>0)return o}if(t.startsWith("{")||t.startsWith("[")){let o=this.parseJsonValue(t);if(typeof o=="string"&&o.length>0)return o}return t}toCookieRow(){try{let r=this.convertFlags(),t=this.url.replace(/^https?:\/\//,"").replace(/\/.*$/,"")||"uk";return nn.parse({name:this.name.replace(/^: /,""),value:this.processValue(this.value)||"",domain:t,path:this.path||"/",expiry:this.expiration,creation:this.creation,flags:r,version:this.version,port:this.port,comment:this.comment,commentURL:this.commentURL})}catch{return null}}readNullTerminatedString(r,t){let o=t;for(;o<r.buffer.length&&r.buffer[o]!==0;)o++;return r.buffer.toString("utf8",t,o)||""}readHeader(r){let t=r.buffer.readUInt32LE(r.offset);r.offset+=4,r.offset+=4;let o=r.buffer.readUInt32LE(r.offset);r.offset+=4,this.flags={isSecure:(o&1)!==0,isHTTPOnly:(o&4)!==0,unknown1:(o&8)!==0,unknown2:(o&16)!==0};let a=r.buffer.readUInt32LE(r.offset);r.offset+=4;let i={urlOffset:r.buffer.readUInt32LE(r.offset),nameOffset:r.buffer.readUInt32LE(r.offset+4),pathOffset:r.buffer.readUInt32LE(r.offset+8),valueOffset:r.buffer.readUInt32LE(r.offset+12),commentOffset:r.buffer.readUInt32LE(r.offset+16),commentURLOffset:r.buffer.readUInt32LE(r.offset+20)};return{size:t,hasPort:a,offsets:i}}readTimestamps(r){let t=xr.Buffer.alloc(8);for(let s=0;s<8;s++)t[s]=r.buffer[r.offset+s];let o=t.readDoubleLE(0);r.offset+=8;let a=xr.Buffer.alloc(8);for(let s=0;s<8;s++)a[s]=r.buffer[r.offset+s];let i=a.readDoubleLE(0);r.offset+=8,this.expiration=o,this.creation=i}readStrings(r,t,o){let i=[{field:"url",offset:o.urlOffset},{field:"name",offset:o.nameOffset},{field:"path",offset:o.pathOffset},{field:"value",offset:o.valueOffset},{field:"comment",offset:o.commentOffset}].filter(s=>s.offset>0).sort((s,f)=>s.offset-f.offset);for(let s=0;s<i.length;s++){let{field:f,offset:p}=i[s],d=(s<i.length-1?i[s+1].offset:t)-p,c=0+p;for(;c<0+p+d&&r.buffer[c]!==0;)c++;let g=r.buffer.toString("utf8",0+p,c);switch(f){case"url":this.url=g;break;case"name":this.name=g;break;case"path":this.path=g;break;case"value":this.value=g;break;case"comment":this.comment=g;break}}}decode(r){let{size:t,hasPort:o,offsets:a}=this.readHeader(r),i=r.offset;r.offset=i+24,this.readTimestamps(r),o>0&&(this.port=r.buffer.readUInt16LE(r.offset),r.offset+=2),r.offset=i,this.readStrings(r,t,a)}convertFlags(){return(this.flags.isSecure?1:0)|(this.flags.isHTTPOnly?4:0)|(this.flags.unknown1?8:0)|(this.flags.unknown2?16:0)}};var le=class le{constructor(r){this.cookies=[];let t={offset:0,buffer:r};this.decode(t)}toCookieRows(){let r=[];for(let t of this.cookies)try{let o=t.toCookieRow();o!==null&&r.push(o)}catch(o){let a=o instanceof Error?o.message:String(o);C("BinaryCookies","Error converting cookie",{error:a})}return r}decode(r){let t=r.buffer.readUInt32BE(r.offset);if(r.offset+=4,t!==le.HEADER)throw new Error("Invalid page header");let o=r.buffer.readUInt32LE(r.offset);r.offset+=4;let a=r.offset-8,i=[];for(let f=0;f<o;f++){let p=r.buffer.readUInt32LE(r.offset);i.push(p),r.offset+=4}let s=r.buffer.readUInt32BE(r.offset);if(r.offset+=4,s!==le.FOOTER)throw new Error("Invalid page footer");for(let f=0;f<o;f++)try{let p=i[f],u=a+p,d=r.buffer.readUInt32LE(u);if(d<48){C("BinaryCookies",`Invalid cookie size ${d} at index ${f}`);continue}if(u+d>r.buffer.length){C("BinaryCookies",`Cookie size ${d} at index ${f} would exceed buffer length`);continue}let c=r.buffer.subarray(u,u+d),g=new yr(c);this.cookies.push(g)}catch(p){let u=p instanceof Error?p.message:String(p);C("BinaryCookies",`Error decoding cookie at index ${f}`,{error:u})}}};le.HEADER=256,le.FOOTER=0;var hr=le;var I=class I{constructor(r){let t={offset:0,buffer:r};this.pages=[],this.metadata={},this.decode(t)}static fromFile(r){let t=(0,fn.readFileSync)(r);return new I(t)}static fromDefaultPath(){return I.fromFile(I.DEFAULT_COOKIE_PATH)}toCookieRows(){let r=[];for(let t of this.pages)try{let o=t.toCookieRows();Array.isArray(o)&&r.push(...o)}catch(o){let a=o instanceof Error?o.message:String(o);C("BinaryCookies","Error converting page cookies",{error:a})}return r}decode(r){try{let t=r.buffer.subarray(r.offset,r.offset+4);if(r.offset+=4,!t.equals(I.MAGIC))throw new Error("Missing magic value");let o=r.buffer.readUInt32BE(r.offset);r.offset+=4;let a=[];for(let u=0;u<o;u++)a.push(r.buffer.readUInt32BE(r.offset)),r.offset+=4;let i=r.offset;for(let u of a)try{let d=r.buffer.subarray(i,i+u),c=new hr(d);this.pages.push(c),i+=u}catch(d){let c=d instanceof Error?d.message:String(d);C("BinaryCookies","Error decoding page",{error:c}),i+=u}r.offset=i;let s=r.buffer.readUInt32BE(r.offset);r.offset+=4;let f=r.buffer.readBigUInt64BE(r.offset);r.offset+=8,f!==I.FOOTER&&C("BinaryCookies","Invalid cookie file format: wrong footer");let p=r.buffer.subarray(r.offset);this.metadata={}}catch(t){let o=t instanceof Error?t.message:String(t);throw C("BinaryCookies","Error decoding binary cookies file",{error:o}),t}}};I.MAGIC=sn.Buffer.from("cook","utf8"),I.FOOTER=BigInt("0x071720050000004b"),I.DEFAULT_COOKIE_PATH=(0,un.join)((0,pn.homedir)(),"Library/Containers/com.apple.Safari/Data/Library/Cookies/Cookies.binarycookies");var br=I;function mn(e){return br.fromFile(e).toCookieRows()}var de=class{constructor(){this.browserName="Safari"}getCookieDbPath(r){return(0,dn.join)(r,"Library","Containers","com.apple.Safari","Data","Library","Cookies","Cookies.binarycookies")}decodeCookies(r,t,o){try{return mn(r).filter(i=>(t==="%"||i.name===t)&&(o==="%"||i.domain.includes(o))).map(i=>({domain:i.domain,name:i.name,value:Buffer.isBuffer(i.value)?i.value.toString():String(i.value),expiry:typeof i.expiry=="number"&&i.expiry>0?new Date(i.expiry*1e3):"Infinity",meta:{file:r,browser:"Safari",decrypted:!1}}))}catch(a){return a instanceof Error?y("SafariCookieQueryStrategy",`Error decoding ${r}`,{error:a,name:t,domain:o}):y("SafariCookieQueryStrategy",`Error decoding ${r}`,{error:"Unknown error",name:t,domain:o}),[]}}async queryCookies(r,t){let o=(0,ln.homedir)();if(typeof o!="string"||o.length===0)return y("SafariCookieQueryStrategy","Failed to get home directory"),Promise.resolve([]);let a=this.getCookieDbPath(o);return Promise.resolve(this.decodeCookies(a,r||"%",t||"%"))}};var cn={strategies:new Map([["safari",de],["firefox",me],["chrome",ue]]),createStrategy(e){if(typeof e!="string")return new Oe([new de,new me,new ue]);let r=this.strategies.get(e.toLowerCase());return r!==void 0?new r:new Oe([new de,new me,new ue])}};async function om(e,r,t){let o=[];for(let a of r){let i=await e.queryCookies(a,t);if(o.push(...i),typeof t=="number"&&t>0&&o.length>=t){o=o.slice(0,t);break}}return o}async function gn(e,r,t,o=!1){try{let a=typeof e.browser=="string"?e.browser:void 0,i=cn.createStrategy(a),s=new ur(i),f=Array.isArray(r)?r:[r],p=await om(s,f,t);if(o===!0&&(p=Fi(p)),p.length===0){m.error("No results");return}new pr().getHandler(e).handle(p)}catch(a){a instanceof Error?m.error(a.message):m.error("An unknown error occurred")}}function am(){m.log("Usage: get-cookie [name] [domain] [options]"),m.log("Options:"),m.log(" -h, --help: Show this help message"),m.log(" -v, --verbose: Enable verbose output"),m.log(" -d, --dump: Dump all results"),m.log(" -D, --dump-grouped: Dump all results, grouped by profile"),m.log(" -r, --render: Render all results"),m.log(" -u, --url: URL to extract cookie specs from"),m.log(" -n, --name: Cookie name pattern"),m.log(" -d, --domain: Cookie domain pattern"),m.log(" --output: Output format (e.g., json)")}function im(e,r){return{name:e||"%",domain:r||"%"}}function nm(e,r){let t=e.url;if(typeof t=="string"){let i=wr(t);return Array.isArray(i)?i:(m.error("Invalid cookie specs from URL"),[])}let o=e.name||r[0]||"%",a=e.domain||r[1]||"%";return[im(o,a)]}async function sm(e,r){let t=nm(e,r);e.verbose===!0&&m.log("cookieSpecs",t);try{await gn(e,t,void 0,e.removeExpired===!0)}catch(o){o instanceof Error?m.error("Error querying cookies:",o.message):m.error("An unknown error occurred while querying cookies")}}async function fm(){let e=process.argv.slice(2),{values:r,positionals:t}=et(e);if(r.help===!0){am();return}await sm(r,t)}fm().catch(e=>{e instanceof Error?m.error("Fatal error:",e.message):m.error("An unknown fatal error occurred"),process.exit(1)});
5
3
  /*! Bundled license information:
6
4
 
7
5
  lodash-es/lodash.js: