@gfdelarue/testkit 0.6.0 → 0.6.2

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 (156) hide show
  1. package/README.md +455 -56
  2. package/bin/testkit-windows-owner-arm64.exe +0 -0
  3. package/bin/testkit-windows-owner-x64.exe +0 -0
  4. package/dist/app/bugs/batch.js +1 -0
  5. package/dist/app/bugs/ci-report.js +2 -2
  6. package/dist/app/bugs/ci-summary.js +3 -3
  7. package/dist/app/bugs/draft.js +2 -2
  8. package/dist/app/bugs/file.js +1 -1
  9. package/dist/app/bugs/guide.js +1 -1
  10. package/dist/app/bugs/record.js +1 -1
  11. package/dist/app/bugs/run-reading.js +1 -1
  12. package/dist/app/bugs/store.js +1 -1
  13. package/dist/app/campaigns/summary.js +1 -1
  14. package/dist/app/cleanup/index.js +1 -1
  15. package/dist/app/db-schema/prepare.js +1 -1
  16. package/dist/app/db-schema/refresh.js +1 -1
  17. package/dist/app/db-schema/verify.js +1 -1
  18. package/dist/app/destroy/index.js +1 -1
  19. package/dist/app/environments/config-driven.js +1 -1
  20. package/dist/app/environments/file-setup.js +1 -1
  21. package/dist/app/environments/routing.js +1 -1
  22. package/dist/app/environments/static-values.js +1 -1
  23. package/dist/app/environments/supplied.js +1 -1
  24. package/dist/app/lint/shared.js +1 -1
  25. package/dist/app/run/live-run.js +1 -1
  26. package/dist/app/run/orchestrator.js +1 -1
  27. package/dist/app/run/planning.js +1 -1
  28. package/dist/app/run/results.js +1 -1
  29. package/dist/app/run/run-finalization.js +1 -1
  30. package/dist/app/run/run-finisher.js +1 -0
  31. package/dist/app/run/setup/runtime-node-setup-protocol.js +1 -1
  32. package/dist/app/run/setup/runtime-node-setup-worker.js +1 -1
  33. package/dist/app/run/setup/runtime-node-setup.js +2 -2
  34. package/dist/app/status/runs.js +1 -1
  35. package/dist/app/stop/index.js +1 -1
  36. package/dist/app/tracker/index.js +1 -1
  37. package/dist/app/tracker/token.js +2 -2
  38. package/dist/app/typecheck/index.js +4 -4
  39. package/dist/cli/command-catalog.js +1 -1
  40. package/dist/cli/command-flags.js +1 -1
  41. package/dist/cli/commands/bug/file.js +3 -2
  42. package/dist/cli/framework/help.js +5 -5
  43. package/dist/cli/framework/parser.js +1 -1
  44. package/dist/cli/json-errors.js +1 -1
  45. package/dist/cli/renderers/bug/text.js +1 -1
  46. package/dist/cli/renderers/run/formatting.js +1 -1
  47. package/dist/config/loader/config-loader.js +1 -1
  48. package/dist/config/loader/discover-tests.js +1 -1
  49. package/dist/config/loader/discovery-result.js +1 -0
  50. package/dist/config/loader/index.js +1 -1
  51. package/dist/config/loader/runtime-isolation.js +1 -1
  52. package/dist/config/loader/skip-config.js +1 -1
  53. package/dist/config/loader/test-selection.js +1 -1
  54. package/dist/database/admin.js +5 -2
  55. package/dist/database/call-caps.js +1 -0
  56. package/dist/database/cleanup.js +1 -1
  57. package/dist/database/configured-steps.js +1 -1
  58. package/dist/database/constants.js +1 -1
  59. package/dist/database/docker-endpoint.js +1 -0
  60. package/dist/database/docker-metadata.js +2 -2
  61. package/dist/database/docker.js +5 -5
  62. package/dist/database/index.js +2 -1
  63. package/dist/database/lifecycle-cleanup.js +1 -1
  64. package/dist/database/local-postgres.js +4 -1
  65. package/dist/database/naming.js +1 -1
  66. package/dist/database/operation-deadline.js +1 -0
  67. package/dist/database/postgres/connection-check.js +1 -1
  68. package/dist/database/postgres/index.js +2 -2
  69. package/dist/database/postgres/owned-exec.js +27 -0
  70. package/dist/database/postgres/protocol.js +2 -2
  71. package/dist/database/provider.js +1 -0
  72. package/dist/database/roles.js +2 -2
  73. package/dist/database/schema-operations.js +5 -1
  74. package/dist/database/schema-source.js +3 -3
  75. package/dist/database/steps.js +1 -1
  76. package/dist/database/template-steps.js +4 -4
  77. package/dist/domain/suite-selection.js +1 -1
  78. package/dist/engines/adapters/evidence-files.js +1 -1
  79. package/dist/engines/adapters/execution.js +1 -1
  80. package/dist/engines/node-vitest/adapter/adapter.js +1 -1
  81. package/dist/engines/node-vitest/adapter/driver.js +2 -2
  82. package/dist/engines/node-vitest/runtime/runtime-input.js +1 -1
  83. package/dist/engines/playwright/adapter/adapter.js +1 -1
  84. package/dist/engines/playwright/adapter/browser-network-evidence.js +4 -0
  85. package/dist/engines/playwright/adapter/config.js +16 -6
  86. package/dist/engines/playwright/adapter/evidence.js +2 -1
  87. package/dist/engines/playwright/adapter/failure-details.js +2 -2
  88. package/dist/engines/playwright/adapter/reporter.js +1 -1
  89. package/dist/engines/playwright/runtime/browser-network.js +1 -0
  90. package/dist/engines/playwright/runtime/browser-traffic.js +1 -0
  91. package/dist/engines/playwright/runtime/chromium-environment.js +1 -0
  92. package/dist/engines/playwright/runtime/emulation.js +1 -0
  93. package/dist/engines/playwright/runtime/index.js +1 -1
  94. package/dist/engines/playwright/runtime/managed-test.js +1 -1
  95. package/dist/engines/playwright/runtime/runtime-input.js +2 -2
  96. package/dist/environment/lifecycle-controller.js +1 -1
  97. package/dist/environment/lifecycle.js +1 -1
  98. package/dist/environment/maintenance.js +1 -1
  99. package/dist/environment/run-environment.js +1 -1
  100. package/dist/environment/run-stopping.js +1 -1
  101. package/dist/environment/runtime-manager.js +1 -1
  102. package/dist/evidence/artifacts.js +5 -2
  103. package/dist/evidence/bundles.js +2 -1
  104. package/dist/evidence/compressed-artifacts.js +1 -0
  105. package/dist/evidence/environment-record.js +1 -1
  106. package/dist/evidence/index.js +1 -1
  107. package/dist/evidence/live-run-summary.js +1 -0
  108. package/dist/evidence/local-paths.js +1 -0
  109. package/dist/evidence/maintenance.js +1 -1
  110. package/dist/evidence/operation-timings.js +1 -1
  111. package/dist/evidence/redaction.js +4 -4
  112. package/dist/evidence/run-evidence.js +1 -0
  113. package/dist/evidence/setup-progress.js +1 -1
  114. package/dist/evidence/storage-inventory.js +1 -1
  115. package/dist/evidence/storage.js +2 -2
  116. package/dist/kernel/redaction-targets.js +1 -1
  117. package/dist/kernel/redaction.js +7 -4
  118. package/dist/process/engine-environment-keys.js +1 -0
  119. package/dist/process/environment-overlay.js +1 -1
  120. package/dist/process/environment.js +1 -1
  121. package/dist/process/execa-bundle.json +3 -3
  122. package/dist/process/files/evidence-writes.js +1 -0
  123. package/dist/process/files/product-dir.js +1 -1
  124. package/dist/process/host-process.js +1 -1
  125. package/dist/process/index.js +1 -1
  126. package/dist/process/lifecycle-fence.js +1 -1
  127. package/dist/process/lock-progress.js +2 -0
  128. package/dist/process/locks.js +4 -4
  129. package/dist/process/process-identity.js +1 -1
  130. package/dist/process/process.js +35 -35
  131. package/dist/process/recovery.js +1 -1
  132. package/dist/process/runs/manifest.js +1 -1
  133. package/dist/process/runs/ownership.js +1 -1
  134. package/dist/process/runs/stop.js +1 -1
  135. package/dist/process/shutdown.js +1 -1
  136. package/dist/process/windows-native.js +1 -1
  137. package/dist/repo/history.js +7 -4
  138. package/dist/repo/managed-git.js +1 -1
  139. package/dist/repo/state.js +4 -4
  140. package/dist/steps/environment.js +1 -1
  141. package/dist/toolchains/node-provisioning.js +2 -2
  142. package/dist/tracker/gitea.js +1 -1
  143. package/dist/tracker/github.js +1 -1
  144. package/dist/tracker/http.js +1 -1
  145. package/dist/tracker/ownership.js +1 -0
  146. package/dist/tracker/redaction.js +1 -1
  147. package/dist/tracker/responses.js +1 -1
  148. package/dist/types/playwright.d.ts +38 -2
  149. package/dist/types/workspace.d.ts +4 -4
  150. package/docs/bug-records.md +16 -10
  151. package/docs/engines.md +52 -4
  152. package/docs/release-notes.md +749 -0
  153. package/package.json +14 -2
  154. package/testkit-config-schema.md +36 -42
  155. package/dist/config/loader/task-policy.js +0 -1
  156. package/dist/environment/lifecycle-artifacts.js +0 -1
@@ -1,46 +1,46 @@
1
- var Fc=Object.defineProperty;var n=(e,t)=>Fc(e,"name",{value:t,configurable:!0});function E(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}n(E,"isPlainObject");import{fileURLToPath as Uc}from"node:url";var oe=n((e,t)=>{let r=fr(_c(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},"safeNormalizeFileUrl"),_c=n(e=>dr(e)?e.toString():e,"normalizeDenoExecPath"),dr=n(e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,"isDenoExecPath"),fr=n(e=>e instanceof URL?Uc(e):e,"normalizeFileUrl");var Xe=n((e,t=[],r={})=>{let o=oe(e,"First argument"),[i,s]=E(t)?[[],t]:[t,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(l=>typeof l=="object"&&l!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let a=i.map(String),c=a.find(l=>l.includes("\0"));if(c!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${c}`);if(!E(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[o,a,{__proto__:null,...s}]},"normalizeParameters");import{StringDecoder as vc}from"node:string_decoder";var{toString:jn}=Object.prototype,kn=n(e=>jn.call(e)==="[object ArrayBuffer]","isArrayBuffer"),T=n(e=>jn.call(e)==="[object Uint8Array]","isUint8Array"),N=n(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"bufferToUint8Array"),$c=new TextEncoder,Nn=n(e=>$c.encode(e),"stringToUint8Array"),jc=new TextDecoder,Je=n(e=>jc.decode(e),"uint8ArrayToString"),Gn=n((e,t)=>Nc(e,t).join(""),"joinToString"),Nc=n((e,t)=>{if(t==="utf8"&&e.every(s=>typeof s=="string"))return e;let r=new vc(t),o=e.map(s=>typeof s=="string"?Nn(s):s).map(s=>r.write(s)),i=r.end();return i===""?o:[...o,i]},"uint8ArraysToStrings"),De=n(e=>e.length===1&&T(e[0])?e[0]:ur(kc(e)),"joinToUint8Array"),kc=n(e=>e.map(t=>typeof t=="string"?Nn(t):t),"stringsToUint8Arrays"),ur=n(e=>{let t=new Uint8Array(Gc(e)),r=0;for(let o of e)t.set(o,r),r+=o.length;return t},"concatUint8Arrays"),Gc=n(e=>{let t=0;for(let r of e)t+=r.length;return t},"getJoinLength");import{ChildProcess as Wc}from"node:child_process";var Yn=n(e=>Array.isArray(e)&&Array.isArray(e.raw),"isTemplateString"),Hn=n((e,t)=>{let r=[];for(let[s,a]of e.entries())r=zc({templates:e,expressions:t,tokens:r,index:s,template:a});if(r.length===0)throw new TypeError("Template script must not be empty");let[o,...i]=r;return[o,i,{}]},"parseTemplates"),zc=n(({templates:e,expressions:t,tokens:r,index:o,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[o]}`);let{nextTokens:s,leadingWhitespaces:a,trailingWhitespaces:c}=Vc(i,e.raw[o]),l=zn(r,s,a);if(o===t.length)return l;let d=t[o],f=Array.isArray(d)?d.map(u=>Vn(u)):[Vn(d)];return zn(l,f,c)},"parseTemplate"),Vc=n((e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],o=0,i=Wn.has(t[0]);for(let a=0,c=0;a<e.length;a+=1,c+=1){let l=t[c];if(Wn.has(l))o!==a&&r.push(e.slice(o,a)),o=a+1;else if(l==="\\"){let d=t[c+1];d===`
2
- `?(a-=1,c+=1):d==="u"&&t[c+2]==="{"?c=t.indexOf("}",c+3):c+=Yc[d]??1}}let s=o===e.length;return s||r.push(e.slice(o)),{nextTokens:r,leadingWhitespaces:i,trailingWhitespaces:s}},"splitByWhitespaces"),Wn=new Set([" "," ","\r",`
3
- `]),Yc={x:3,u:5},zn=n((e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],"concatTokens"),Vn=n(e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(E(e)&&("stdout"in e||"isMaxBuffer"in e))return Hc(e);throw e instanceof Wc||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},"parseExpression"),Hc=n(({stdout:e})=>{if(typeof e=="string")return e;if(T(e))return Je(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)},"getSubprocessResult");import pr from"node:process";var C=n(e=>Qe.includes(e),"isStandardStream"),Qe=[pr.stdin,pr.stdout,pr.stderr],R=["stdin","stdout","stderr"],Ze=n(e=>R[e]??`stdio[${e}]`,"getStreamName");import{debuglog as Kc}from"node:util";var Xn=n(e=>{let t={...e};for(let r of gr)t[r]=mr(e,r);return t},"normalizeFdSpecificOptions"),mr=n((e,t)=>{let r=Xc(e),o=Array.from({length:r+1}),i=Jc(e[t],o,t,r);return tl(i,t)},"normalizeFdSpecificOption"),Xc=n(({stdio:e})=>Array.isArray(e)?Math.max(e.length,R.length):R.length,"getStdioLength"),Jc=n((e,t,r,o)=>E(e)?Qc(e,t,r,o):t.fill(e),"normalizeFdSpecificValue"),Qc=n((e,t,r,o)=>{for(let i of Object.keys(e).sort(Zc))for(let s of qc(i,r,o))t[s]=e[i];return t},"normalizeOptionObject"),Zc=n((e,t)=>Kn(e)<Kn(t)?1:-1,"compareFdName"),Kn=n(e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,"getFdNameOrder"),qc=n((e,t,r)=>{if(e==="ipc")return[r];let o=hr(e);if(o===void 0||o===0)throw new TypeError(`"${t}.${e}" is invalid.
4
- It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(o!=="all"&&o>=r)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
5
- Please set the "stdio" option to ensure that file descriptor exists.`);return o==="all"?[1,2]:[o]},"parseFdName"),hr=n(e=>{if(e==="all")return e;if(R.includes(e))return R.indexOf(e);let t=el.exec(e);if(t!==null)return Number(t.groups.fdNumber)},"parseFd"),el=/^fd(?<fdNumber>\d+)$/,tl=n((e,t)=>e.map(r=>r===void 0?nl[t]:r),"addDefaultValue"),rl=Kc("execa").enabled?"full":"none",nl={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:rl,stripFinalNewline:!0},gr=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],k=n((e,t)=>t==="ipc"?e.at(-1):e[t],"getFdSpecificValue");var ie=n(({verbose:e},t)=>yr(e,t)!=="none","isVerbose"),se=n(({verbose:e},t)=>!["none","short"].includes(yr(e,t)),"isFullVerbose"),Jn=n(({verbose:e},t)=>{let r=yr(e,t);return qe(r)?r:void 0},"getVerboseFunction"),yr=n((e,t)=>t===void 0?ol(e):k(e,t),"getFdVerbose"),ol=n(e=>e.find(t=>qe(t))??et.findLast(t=>e.includes(t)),"getFdGenericVerbose"),qe=n(e=>typeof e=="function","isVerboseFunction"),et=["none","short","full"];import{platform as il}from"node:process";import{stripVTControlCharacters as sl}from"node:util";var Zn=n((e,t)=>{let r=[e,...t],o=r.join(" "),i=r.map(s=>ul(Qn(s))).join(" ");return{command:o,escapedCommand:i}},"joinCommand"),Ie=n(e=>sl(e).split(`
6
- `).map(t=>Qn(t)).join(`
7
- `),"escapeLines"),Qn=n(e=>e.replaceAll(ll,t=>al(t)),"escapeControlCharacters"),al=n(e=>{let t=dl[e];if(t!==void 0)return t;let r=e.codePointAt(0),o=r.toString(16);return r<=fl?`\\u${o.padStart(4,"0")}`:`\\U${o}`},"escapeControlCharacter"),cl=n(()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},"getSpecialCharRegExp"),ll=cl(),dl={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},fl=65535,ul=n(e=>pl.test(e)?e:il==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,"quoteString"),pl=/^[\w\-./]+$/;import qn from"node:process";function Sr(){let{env:e}=qn,{TERM:t,TERM_PROGRAM:r}=e;return qn.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}n(Sr,"isUnicodeSupported");var eo={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},to={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},ml={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},hl={...eo,...to},ro={...eo,...ml},no=Sr(),gl=no?hl:ro,tt=gl,yl=Object.entries(to),$y=n((e,{useFallback:t=!no}={})=>{if(t)for(let[r,o]of yl)e=e.replaceAll(o,ro[r]);return e},"replaceSymbols");import Sl from"node:tty";var bl=Sl?.WriteStream?.prototype?.hasColors?.()??!1,h=n((e,t)=>{if(!bl)return i=>i;let r=`\x1B[${e}m`,o=`\x1B[${t}m`;return i=>{let s=i+"",a=s.indexOf(o);if(a===-1)return r+s+o;let c=r,l=0,f=(t===22?o:"")+r;for(;a!==-1;)c+=s.slice(l,a)+f,l=a+o.length,a=s.indexOf(o,l);return c+=s.slice(l)+o,c}},"format"),Gy=h(0,0),oo=h(1,22),Wy=h(2,22),zy=h(3,23),Vy=h(4,24),Yy=h("4:2",24),Hy=h("4:3",24),Ky=h("4:4",24),Xy=h("4:5",24),Jy=h(53,55),Qy=h(7,27),Zy=h(8,28),qy=h(9,29),eS=h(30,39),tS=h(31,39),rS=h(32,39),nS=h(33,39),oS=h(34,39),iS=h(35,39),sS=h(36,39),aS=h(37,39),rt=h(90,39),cS=h(40,49),lS=h(41,49),dS=h(42,49),fS=h(43,49),uS=h(44,49),pS=h(45,49),mS=h(46,49),hS=h(47,49),gS=h(100,49),io=h(91,39),yS=h(92,39),so=h(93,39),SS=h(94,39),bS=h(95,39),wS=h(96,39),xS=h(97,39),ES=h(101,49),TS=h(102,49),OS=h(103,49),AS=h(104,49),DS=h(105,49),IS=h(106,49),RS=h(107,49),MS=h("58;5;0",59),CS=h("58;5;1",59),PS=h("58;5;2",59),LS=h("58;5;3",59),BS=h("58;5;4",59),FS=h("58;5;5",59),US=h("58;5;6",59),_S=h("58;5;7",59),vS=h("58;5;8",59),$S=h("58;5;9",59),jS=h("58;5;10",59),NS=h("58;5;11",59),kS=h("58;5;12",59),GS=h("58;5;13",59),WS=h("58;5;14",59),zS=h("58;5;15",59);var lo=n(({type:e,message:t,timestamp:r,piped:o,commandId:i,result:{failed:s=!1}={},options:{reject:a=!0}})=>{let c=wl(r),l=xl[e]({failed:s,reject:a,piped:o}),d=El[e]({reject:a});return`${rt(`[${c}]`)} ${rt(`[${i}]`)} ${d(l)} ${d(t)}`},"defaultVerboseFunction"),wl=n(e=>`${nt(e.getHours(),2)}:${nt(e.getMinutes(),2)}:${nt(e.getSeconds(),2)}.${nt(e.getMilliseconds(),3)}`,"serializeTimestamp"),nt=n((e,t)=>String(e).padStart(t,"0"),"padField"),ao=n(({failed:e,reject:t})=>e?t?tt.cross:tt.warning:tt.tick,"getFinalIcon"),xl={command:n(({piped:e})=>e?"|":"$","command"),output:n(()=>" ","output"),ipc:n(()=>"*","ipc"),error:ao,duration:ao},co=n(e=>e,"identity"),El={command:n(()=>oo,"command"),output:n(()=>co,"output"),ipc:n(()=>co,"ipc"),error:n(({reject:e})=>e?io:so,"error"),duration:n(()=>rt,"duration")};var fo=n((e,t,r)=>{let o=Jn(t,r);return e.map(({verboseLine:i,verboseObject:s})=>Tl(i,s,o)).filter(i=>i!==void 0).map(i=>Ol(i)).join("")},"applyVerboseOnLines"),Tl=n((e,t,r)=>{if(r===void 0)return e;let o=r(e,t);if(typeof o=="string")return o},"applyVerboseFunction"),Ol=n(e=>e.endsWith(`
1
+ var Uc=Object.defineProperty;var r=(e,t)=>Uc(e,"name",{value:t,configurable:!0});function T(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}r(T,"isPlainObject");import{fileURLToPath as $c}from"node:url";var ae=r((e,t)=>{let n=Sn(vc(e));if(typeof n!="string")throw new TypeError(`${t} must be a string or a file URL: ${n}.`);return n},"safeNormalizeFileUrl"),vc=r(e=>gn(e)?e.toString():e,"normalizeDenoExecPath"),gn=r(e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,"isDenoExecPath"),Sn=r(e=>e instanceof URL?$c(e):e,"normalizeFileUrl");var Qe=r((e,t=[],n={})=>{let o=ae(e,"First argument"),[i,s]=T(t)?[[],t]:[t,n];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(l=>typeof l=="object"&&l!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let a=i.map(String),c=a.find(l=>l.includes("\0"));if(c!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${c}`);if(!T(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[o,a,{__proto__:null,...s}]},"normalizeParameters");import{StringDecoder as Nc}from"node:string_decoder";var{toString:zr}=Object.prototype,Yr=r(e=>zr.call(e)==="[object ArrayBuffer]","isArrayBuffer"),O=r(e=>zr.call(e)==="[object Uint8Array]","isUint8Array"),Y=r(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"bufferToUint8Array"),jc=new TextEncoder,Vr=r(e=>jc.encode(e),"stringToUint8Array"),kc=new TextDecoder,Ze=r(e=>kc.decode(e),"uint8ArrayToString"),Hr=r((e,t)=>Gc(e,t).join(""),"joinToString"),Gc=r((e,t)=>{if(t==="utf8"&&e.every(s=>typeof s=="string"))return e;let n=new Nc(t),o=e.map(s=>typeof s=="string"?Vr(s):s).map(s=>n.write(s)),i=n.end();return i===""?o:[...o,i]},"uint8ArraysToStrings"),Me=r(e=>e.length===1&&O(e[0])?e[0]:yn(Wc(e)),"joinToUint8Array"),Wc=r(e=>e.map(t=>typeof t=="string"?Vr(t):t),"stringsToUint8Arrays"),yn=r(e=>{let t=new Uint8Array(zc(e)),n=0;for(let o of e)t.set(o,n),n+=o.length;return t},"concatUint8Arrays"),zc=r(e=>{let t=0;for(let n of e)t+=n.length;return t},"getJoinLength");import{ChildProcess as Vc}from"node:child_process";var Qr=r(e=>Array.isArray(e)&&Array.isArray(e.raw),"isTemplateString"),Zr=r((e,t)=>{let n=[];for(let[s,a]of e.entries())n=Yc({templates:e,expressions:t,tokens:n,index:s,template:a});if(n.length===0)throw new TypeError("Template script must not be empty");let[o,...i]=n;return[o,i,{}]},"parseTemplates"),Yc=r(({templates:e,expressions:t,tokens:n,index:o,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[o]}`);let{nextTokens:s,leadingWhitespaces:a,trailingWhitespaces:c}=Hc(i,e.raw[o]),l=Xr(n,s,a);if(o===t.length)return l;let d=t[o],f=Array.isArray(d)?d.map(u=>Jr(u)):[Jr(d)];return Xr(l,f,c)},"parseTemplate"),Hc=r((e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],o=0,i=Kr.has(t[0]);for(let a=0,c=0;a<e.length;a+=1,c+=1){let l=t[c];if(Kr.has(l))o!==a&&n.push(e.slice(o,a)),o=a+1;else if(l==="\\"){let d=t[c+1];d===`
2
+ `?(a-=1,c+=1):d==="u"&&t[c+2]==="{"?c=t.indexOf("}",c+3):c+=Kc[d]??1}}let s=o===e.length;return s||n.push(e.slice(o)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},"splitByWhitespaces"),Kr=new Set([" "," ","\r",`
3
+ `]),Kc={x:3,u:5},Xr=r((e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],"concatTokens"),Jr=r(e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(T(e)&&("stdout"in e||"isMaxBuffer"in e))return Xc(e);throw e instanceof Vc||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},"parseExpression"),Xc=r(({stdout:e})=>{if(typeof e=="string")return e;if(O(e))return Ze(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)},"getSubprocessResult");import bn from"node:process";var _=r(e=>qe.includes(e),"isStandardStream"),qe=[bn.stdin,bn.stdout,bn.stderr],L=["stdin","stdout","stderr"],et=r(e=>L[e]??`stdio[${e}]`,"getStreamName");import{debuglog as Jc}from"node:util";var eo=r(e=>{let t={...e};for(let n of En)t[n]=wn(e,n);return t},"normalizeFdSpecificOptions"),wn=r((e,t)=>{let n=Qc(e),o=Array.from({length:n+1}),i=Zc(e[t],o,t,n);return rl(i,t)},"normalizeFdSpecificOption"),Qc=r(({stdio:e})=>Array.isArray(e)?Math.max(e.length,L.length):L.length,"getStdioLength"),Zc=r((e,t,n,o)=>T(e)?qc(e,t,n,o):t.fill(e),"normalizeFdSpecificValue"),qc=r((e,t,n,o)=>{for(let i of Object.keys(e).sort(el))for(let s of tl(i,n,o))t[s]=e[i];return t},"normalizeOptionObject"),el=r((e,t)=>qr(e)<qr(t)?1:-1,"compareFdName"),qr=r(e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,"getFdNameOrder"),tl=r((e,t,n)=>{if(e==="ipc")return[n];let o=xn(e);if(o===void 0||o===0)throw new TypeError(`"${t}.${e}" is invalid.
4
+ It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(o!=="all"&&o>=n)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
5
+ Please set the "stdio" option to ensure that file descriptor exists.`);return o==="all"?[1,2]:[o]},"parseFdName"),xn=r(e=>{if(e==="all")return e;if(L.includes(e))return L.indexOf(e);let t=nl.exec(e);if(t!==null)return Number(t.groups.fdNumber)},"parseFd"),nl=/^fd(?<fdNumber>\d+)$/,rl=r((e,t)=>e.map(n=>n===void 0?il[t]:n),"addDefaultValue"),ol=Jc("execa").enabled?"full":"none",il={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ol,stripFinalNewline:!0},En=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],H=r((e,t)=>t==="ipc"?e.at(-1):e[t],"getFdSpecificValue");var ce=r(({verbose:e},t)=>Tn(e,t)!=="none","isVerbose"),le=r(({verbose:e},t)=>!["none","short"].includes(Tn(e,t)),"isFullVerbose"),to=r(({verbose:e},t)=>{let n=Tn(e,t);return tt(n)?n:void 0},"getVerboseFunction"),Tn=r((e,t)=>t===void 0?sl(e):H(e,t),"getFdVerbose"),sl=r(e=>e.find(t=>tt(t))??nt.findLast(t=>e.includes(t)),"getFdGenericVerbose"),tt=r(e=>typeof e=="function","isVerboseFunction"),nt=["none","short","full"];import{platform as al}from"node:process";import{stripVTControlCharacters as cl}from"node:util";var ro=r((e,t)=>{let n=[e,...t],o=n.join(" "),i=n.map(s=>ml(no(s))).join(" ");return{command:o,escapedCommand:i}},"joinCommand"),Ce=r(e=>cl(e).split(`
6
+ `).map(t=>no(t)).join(`
7
+ `),"escapeLines"),no=r(e=>e.replaceAll(fl,t=>ll(t)),"escapeControlCharacters"),ll=r(e=>{let t=ul[e];if(t!==void 0)return t;let n=e.codePointAt(0),o=n.toString(16);return n<=pl?`\\u${o.padStart(4,"0")}`:`\\U${o}`},"escapeControlCharacter"),dl=r(()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},"getSpecialCharRegExp"),fl=dl(),ul={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},pl=65535,ml=r(e=>hl.test(e)?e:al==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,"quoteString"),hl=/^[\w\-./]+$/;import oo from"node:process";function On(){let{env:e}=oo,{TERM:t,TERM_PROGRAM:n}=e;return oo.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}r(On,"isUnicodeSupported");var io={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},so={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},gl={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Sl={...io,...so},ao={...io,...gl},co=On(),yl=co?Sl:ao,rt=yl,bl=Object.entries(so),VS=r((e,{useFallback:t=!co}={})=>{if(t)for(let[n,o]of bl)e=e.replaceAll(o,ao[n]);return e},"replaceSymbols");import wl from"node:tty";var xl=wl?.WriteStream?.prototype?.hasColors?.()??!1,h=r((e,t)=>{if(!xl)return i=>i;let n=`\x1B[${e}m`,o=`\x1B[${t}m`;return i=>{let s=i+"",a=s.indexOf(o);if(a===-1)return n+s+o;let c=n,l=0,f=(t===22?o:"")+n;for(;a!==-1;)c+=s.slice(l,a)+f,l=a+o.length,a=s.indexOf(o,l);return c+=s.slice(l)+o,c}},"format"),XS=h(0,0),lo=h(1,22),JS=h(2,22),QS=h(3,23),ZS=h(4,24),qS=h("4:2",24),ey=h("4:3",24),ty=h("4:4",24),ny=h("4:5",24),ry=h(53,55),oy=h(7,27),iy=h(8,28),sy=h(9,29),ay=h(30,39),cy=h(31,39),ly=h(32,39),dy=h(33,39),fy=h(34,39),uy=h(35,39),py=h(36,39),my=h(37,39),ot=h(90,39),hy=h(40,49),gy=h(41,49),Sy=h(42,49),yy=h(43,49),by=h(44,49),wy=h(45,49),xy=h(46,49),Ey=h(47,49),Ty=h(100,49),fo=h(91,39),Oy=h(92,39),uo=h(93,39),Ay=h(94,39),Iy=h(95,39),Dy=h(96,39),Ry=h(97,39),My=h(101,49),Cy=h(102,49),Py=h(103,49),Ly=h(104,49),By=h(105,49),Fy=h(106,49),_y=h(107,49),Uy=h("58;5;0",59),$y=h("58;5;1",59),vy=h("58;5;2",59),Ny=h("58;5;3",59),jy=h("58;5;4",59),ky=h("58;5;5",59),Gy=h("58;5;6",59),Wy=h("58;5;7",59),zy=h("58;5;8",59),Vy=h("58;5;9",59),Yy=h("58;5;10",59),Hy=h("58;5;11",59),Ky=h("58;5;12",59),Xy=h("58;5;13",59),Jy=h("58;5;14",59),Qy=h("58;5;15",59);var ho=r(({type:e,message:t,timestamp:n,piped:o,commandId:i,result:{failed:s=!1}={},options:{reject:a=!0}})=>{let c=El(n),l=Tl[e]({failed:s,reject:a,piped:o}),d=Ol[e]({reject:a});return`${ot(`[${c}]`)} ${ot(`[${i}]`)} ${d(l)} ${d(t)}`},"defaultVerboseFunction"),El=r(e=>`${it(e.getHours(),2)}:${it(e.getMinutes(),2)}:${it(e.getSeconds(),2)}.${it(e.getMilliseconds(),3)}`,"serializeTimestamp"),it=r((e,t)=>String(e).padStart(t,"0"),"padField"),po=r(({failed:e,reject:t})=>e?t?rt.cross:rt.warning:rt.tick,"getFinalIcon"),Tl={command:r(({piped:e})=>e?"|":"$","command"),output:r(()=>" ","output"),ipc:r(()=>"*","ipc"),error:po,duration:po},mo=r(e=>e,"identity"),Ol={command:r(()=>lo,"command"),output:r(()=>mo,"output"),ipc:r(()=>mo,"ipc"),error:r(({reject:e})=>e?fo:uo,"error"),duration:r(()=>ot,"duration")};var go=r((e,t,n)=>{let o=to(t,n);return e.map(({verboseLine:i,verboseObject:s})=>Al(i,s,o)).filter(i=>i!==void 0).map(i=>Il(i)).join("")},"applyVerboseOnLines"),Al=r((e,t,n)=>{if(n===void 0)return e;let o=n(e,t);if(typeof o=="string")return o},"applyVerboseFunction"),Il=r(e=>e.endsWith(`
8
8
  `)?e:`${e}
9
- `,"appendNewline");import{inspect as Al}from"node:util";var F=n(({type:e,verboseMessage:t,fdNumber:r,verboseInfo:o,result:i})=>{let s=Dl({type:e,result:i,verboseInfo:o}),a=Il(t,s),c=fo(a,o,r);c!==""&&console.warn(c.slice(0,-1))},"verboseLog"),Dl=n(({type:e,result:t,verboseInfo:r})=>{let{escapedCommand:o,commandId:i,rawOptions:s}=r,{piped:a=!1,...c}=s;return{type:e,escapedCommand:o,commandId:`${i}`,timestamp:new Date,piped:a,result:t,options:c}},"getVerboseObject"),Il=n((e,t)=>e.split(`
10
- `).map(r=>Rl({...t,message:r})),"getPrintedLines"),Rl=n(e=>({verboseLine:lo(e),verboseObject:e}),"getPrintedLine"),ot=n(e=>{let t=typeof e=="string"?e:Al(e);return Ie(t).replaceAll(" ",()=>" ".repeat(Ml))},"serializeVerboseMessage"),Ml=2;var uo=n((e,t)=>{ie(t)&&F({type:"command",verboseMessage:e,verboseInfo:t})},"logCommand");var po=n((e,t,r)=>{Ll(e);let o=Cl(e);return{verbose:e,escapedCommand:t,commandId:o,rawOptions:r}},"getVerboseInfo"),Cl=n(e=>ie({verbose:e})?Pl++:void 0,"getCommandId"),Pl=0n,Ll=n(e=>{for(let t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!et.includes(t)&&!qe(t)){let r=et.map(o=>`'${o}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${r} or a function.`)}}},"validateVerbose");import{hrtime as mo}from"node:process";var it=n(()=>mo.bigint(),"getStartTime"),br=n(e=>Number(mo.bigint()-e)/1e6,"getDurationMs");var st=n((e,t,r)=>{let o=it(),{command:i,escapedCommand:s}=Zn(e,t),a=mr(r,"verbose"),c=po(a,s,{...r});return uo(s,c),{command:i,escapedCommand:s,startTime:o,verboseInfo:c}},"handleCommand");function at(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"}n(at,"pathKey");import{promisify as Bl}from"node:util";import{execFile as Fl,execFileSync as Ul}from"node:child_process";import wr from"node:path";import{fileURLToPath as _l}from"node:url";var vl=Bl(Fl);function Re(e){return e instanceof URL?_l(e):e}n(Re,"toPath");function Mb(e){return wr.parse(Re(e)).root}n(Mb,"rootDirectory");function go(e){return{*[Symbol.iterator](){let t=wr.resolve(Re(e)),r;for(;r!==t;)yield t,r=t,t=wr.resolve(t,"..")}}}n(go,"traversePathUp");var ho=10*1024*1024;async function Cb(e,t,r={}){return vl(e,t,{maxBuffer:ho,...r})}n(Cb,"execFile");function Pb(e,t=[],r={}){return Ul(e,t,{maxBuffer:ho,encoding:"utf8",stdio:"pipe",...r})}n(Pb,"execFileSync");import ct from"node:process";import J from"node:path";var $l=n(({cwd:e=ct.cwd(),path:t=ct.env[at()],preferLocal:r=!0,execPath:o=ct.execPath,addExecPath:i=!0}={})=>{let s=J.resolve(Re(e)),a=[],c=t.split(J.delimiter);return r&&jl(a,c,s),i&&Nl(a,c,o,s),t===""||t===J.delimiter?`${a.join(J.delimiter)}${t}`:[...a,t].join(J.delimiter)},"npmRunPath"),jl=n((e,t,r)=>{for(let o of go(r)){let i=J.join(o,"node_modules/.bin");t.includes(i)||e.push(i)}},"applyPreferLocal"),Nl=n((e,t,r,o)=>{let i=J.resolve(o,Re(r),"..");t.includes(i)||e.push(i)},"applyExecPath"),yo=n(({env:e=ct.env,...t}={})=>{e={...e};let r=at({env:e});return t.path=e[r],e[r]=$l(t),e},"npmRunPathEnv");var wo=n((e,t,r)=>{let o=r?ce:ae,i=e instanceof P?{}:{cause:e};return new o(t,i)},"getFinalError"),P=class extends Error{static{n(this,"DiscardedError")}},So=n((e,t)=>{Object.defineProperties(e.prototype,{name:{value:t,writable:!0,enumerable:!1,configurable:!0},[bo]:{value:!0,writable:!1,enumerable:!1,configurable:!1}})},"setErrorName"),xo=n(e=>lt(e)&&bo in e,"isExecaError"),bo=Symbol("isExecaError"),lt=n(e=>Object.prototype.toString.call(e)==="[object Error]","isErrorInstance"),ae=class extends Error{static{n(this,"ExecaError")}};So(ae,ae.name);var ce=class extends Error{static{n(this,"ExecaSyncError")}};So(ce,ce.name);var To=n(()=>{let e=xr-Eo+1;return Array.from({length:e},kl)},"getRealtimeSignals"),kl=n((e,t)=>({name:`SIGRT${t+1}`,number:Eo+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),"getRealtimeSignal"),Eo=34,xr=64;var Oo=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];import{constants as Gl}from"node:os";var Er=n(()=>{let e=To();return[...Oo,...e].map(Wl)},"getSignals"),Wl=n(({name:e,number:t,description:r,action:o,forced:i=!1,standard:s})=>{let{signals:{[e]:a}}=Gl,c=a!==void 0;return{name:e,number:c?a:t,description:r,supported:c,action:o,forced:i,standard:s}},"normalizeSignal");import{constants as zl}from"node:os";var Vl=n(()=>{let e=Er();return Object.fromEntries(e.map(Yl))},"getSignalsByName"),Yl=n(({name:e,number:t,description:r,supported:o,action:i,forced:s,standard:a})=>[e,{name:e,number:t,description:r,supported:o,action:i,forced:s,standard:a}],"getSignalByName"),Ao=Vl(),Hl=n(()=>{let e=Er(),t=xr+1,r=Array.from({length:t},(o,i)=>Kl(i,e));return Object.assign({},...r)},"getSignalsByNumber"),Kl=n((e,t)=>{let r=Xl(e,t);if(r===void 0)return{};let{name:o,description:i,supported:s,action:a,forced:c,standard:l}=r;return{[e]:{name:o,number:e,description:i,supported:s,action:a,forced:c,standard:l}}},"getSignalByNumber"),Xl=n((e,t)=>{let r=t.find(({name:o})=>zl.signals[o]===e);return r!==void 0?r:t.find(o=>o.number===e)},"findSignalByNumber"),ew=Hl();import{constants as Me}from"node:os";var Ro=n(e=>{let t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return Do(e,t)},"normalizeKillSignal"),Mo=n(e=>e===0?e:Do(e,"`subprocess.kill()`'s argument"),"normalizeSignalArgument"),Do=n((e,t)=>{if(Number.isInteger(e))return Jl(e,t);if(typeof e=="string")return Zl(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
11
- ${Tr()}`)},"normalizeSignal"),Jl=n((e,t)=>{if(Io.has(e))return Io.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
12
- ${Tr()}`)},"normalizeSignalInteger"),Ql=n(()=>new Map(Object.entries(Me.signals).reverse().map(([e,t])=>[t,e])),"getSignalsIntegerToName"),Io=Ql(),Zl=n((e,t)=>{if(e in Me.signals)return e;throw e.toUpperCase()in Me.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
13
- ${Tr()}`)},"normalizeSignalName"),Tr=n(()=>`Available signal names: ${ql()}.
14
- Available signal numbers: ${ed()}.`,"getAvailableSignals"),ql=n(()=>Object.keys(Me.signals).sort().map(e=>`'${e}'`).join(", "),"getAvailableSignalNames"),ed=n(()=>[...new Set(Object.values(Me.signals).sort((e,t)=>e-t))].join(", "),"getAvailableSignalIntegers"),dt=n(e=>Ao[e].description,"getSignalDescription");import{setTimeout as td}from"node:timers/promises";var Co=n(e=>{if(e===!1)return e;if(e===!0)return rd;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},"normalizeForceKillAfterDelay"),rd=1e3*5,Po=n(({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:o,context:i,controller:s},a,c)=>{let{signal:l,error:d}=nd(a,c,r);od(d,o);let f=e(l);return id({kill:e,signal:l,forceKillAfterDelay:t,killSignal:r,killResult:f,context:i,controller:s}),f},"subprocessKill"),nd=n((e,t,r)=>{let[o=r,i]=lt(e)?[void 0,e]:[e,t];if(typeof o!="string"&&!Number.isInteger(o))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(o)}`);if(i!==void 0&&!lt(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Mo(o),error:i}},"parseKillArguments"),od=n((e,t)=>{e!==void 0&&t.reject(e)},"emitKillError"),id=n(async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:o,killResult:i,context:s,controller:a})=>{t===o&&i&&Or({kill:e,forceKillAfterDelay:r,context:s,controllerSignal:a.signal})},"setKillTimeout"),Or=n(async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:o})=>{if(t!==!1)try{await td(t,void 0,{signal:o}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}},"killOnTimeout");import{once as sd}from"node:events";var ft=n(async(e,t)=>{e.aborted||await sd(e,"abort",{signal:t})},"onAbortedSignal");var Lo=n(({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},"validateCancelSignal"),Bo=n(({kill:e,cancelSignal:t,gracefulCancel:r,context:o,controller:i})=>t===void 0||r?[]:[ad(e,t,o,i)],"throwOnCancel"),ad=n(async(e,t,r,{signal:o})=>{throw await ft(t,o),r.terminationReason??="cancel",e(),t.reason},"terminateOnCancel");var le=n(({methodName:e,isSubprocess:t,ipc:r,isConnected:o})=>{cd(e,t,r),Ar(e,t,o)},"validateIpcMethod"),cd=n((e,t,r)=>{if(!r)throw new Error(`${L(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},"validateIpcOption"),Ar=n((e,t,r)=>{if(!r)throw new Error(`${L(e,t)} cannot be used: the ${Y(t)} has already exited or disconnected.`)},"validateConnection"),Fo=n(e=>{throw new Error(`${L("getOneMessage",e)} could not complete: the ${Y(e)} exited or disconnected.`)},"throwOnEarlyDisconnect"),Uo=n(e=>{throw new Error(`${L("sendMessage",e)} failed: the ${Y(e)} is sending a message too, instead of listening to incoming messages.
9
+ `,"appendNewline");import{inspect as Dl}from"node:util";var j=r(({type:e,verboseMessage:t,fdNumber:n,verboseInfo:o,result:i})=>{let s=Rl({type:e,result:i,verboseInfo:o}),a=Ml(t,s),c=go(a,o,n);c!==""&&console.warn(c.slice(0,-1))},"verboseLog"),Rl=r(({type:e,result:t,verboseInfo:n})=>{let{escapedCommand:o,commandId:i,rawOptions:s}=n,{piped:a=!1,...c}=s;return{type:e,escapedCommand:o,commandId:`${i}`,timestamp:new Date,piped:a,result:t,options:c}},"getVerboseObject"),Ml=r((e,t)=>e.split(`
10
+ `).map(n=>Cl({...t,message:n})),"getPrintedLines"),Cl=r(e=>({verboseLine:ho(e),verboseObject:e}),"getPrintedLine"),st=r(e=>{let t=typeof e=="string"?e:Dl(e);return Ce(t).replaceAll(" ",()=>" ".repeat(Pl))},"serializeVerboseMessage"),Pl=2;var So=r((e,t)=>{ce(t)&&j({type:"command",verboseMessage:e,verboseInfo:t})},"logCommand");var yo=r((e,t,n)=>{Fl(e);let o=Ll(e);return{verbose:e,escapedCommand:t,commandId:o,rawOptions:n}},"getVerboseInfo"),Ll=r(e=>ce({verbose:e})?Bl++:void 0,"getCommandId"),Bl=0n,Fl=r(e=>{for(let t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!nt.includes(t)&&!tt(t)){let n=nt.map(o=>`'${o}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${n} or a function.`)}}},"validateVerbose");import{hrtime as bo}from"node:process";var at=r(()=>bo.bigint(),"getStartTime"),An=r(e=>Number(bo.bigint()-e)/1e6,"getDurationMs");var ct=r((e,t,n)=>{let o=at(),{command:i,escapedCommand:s}=ro(e,t),a=wn(n,"verbose"),c=yo(a,s,{...n});return So(s,c),{command:i,escapedCommand:s,startTime:o,verboseInfo:c}},"handleCommand");function lt(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"}r(lt,"pathKey");import{promisify as _l}from"node:util";import{execFile as Ul,execFileSync as $l}from"node:child_process";import In from"node:path";import{fileURLToPath as vl}from"node:url";var Nl=_l(Ul);function Pe(e){return e instanceof URL?vl(e):e}r(Pe,"toPath");function Ub(e){return In.parse(Pe(e)).root}r(Ub,"rootDirectory");function xo(e){return{*[Symbol.iterator](){let t=In.resolve(Pe(e)),n;for(;n!==t;)yield t,n=t,t=In.resolve(t,"..")}}}r(xo,"traversePathUp");var wo=10*1024*1024;async function $b(e,t,n={}){return Nl(e,t,{maxBuffer:wo,...n})}r($b,"execFile");function vb(e,t=[],n={}){return $l(e,t,{maxBuffer:wo,encoding:"utf8",stdio:"pipe",...n})}r(vb,"execFileSync");import dt from"node:process";import te from"node:path";var jl=r(({cwd:e=dt.cwd(),path:t=dt.env[lt()],preferLocal:n=!0,execPath:o=dt.execPath,addExecPath:i=!0}={})=>{let s=te.resolve(Pe(e)),a=[],c=t.split(te.delimiter);return n&&kl(a,c,s),i&&Gl(a,c,o,s),t===""||t===te.delimiter?`${a.join(te.delimiter)}${t}`:[...a,t].join(te.delimiter)},"npmRunPath"),kl=r((e,t,n)=>{for(let o of xo(n)){let i=te.join(o,"node_modules/.bin");t.includes(i)||e.push(i)}},"applyPreferLocal"),Gl=r((e,t,n,o)=>{let i=te.resolve(o,Pe(n),"..");t.includes(i)||e.push(i)},"applyExecPath"),Eo=r(({env:e=dt.env,...t}={})=>{e={...e};let n=lt({env:e});return t.path=e[n],e[n]=jl(t),e},"npmRunPathEnv");var Ao=r((e,t,n)=>{let o=n?fe:de,i=e instanceof U?{}:{cause:e};return new o(t,i)},"getFinalError"),U=class extends Error{static{r(this,"DiscardedError")}},To=r((e,t)=>{Object.defineProperties(e.prototype,{name:{value:t,writable:!0,enumerable:!1,configurable:!0},[Oo]:{value:!0,writable:!1,enumerable:!1,configurable:!1}})},"setErrorName"),Io=r(e=>ft(e)&&Oo in e,"isExecaError"),Oo=Symbol("isExecaError"),ft=r(e=>Object.prototype.toString.call(e)==="[object Error]","isErrorInstance"),de=class extends Error{static{r(this,"ExecaError")}};To(de,de.name);var fe=class extends Error{static{r(this,"ExecaSyncError")}};To(fe,fe.name);var Ro=r(()=>{let e=Dn-Do+1;return Array.from({length:e},Wl)},"getRealtimeSignals"),Wl=r((e,t)=>({name:`SIGRT${t+1}`,number:Do+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),"getRealtimeSignal"),Do=34,Dn=64;var Mo=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];import{constants as zl}from"node:os";var Rn=r(()=>{let e=Ro();return[...Mo,...e].map(Vl)},"getSignals"),Vl=r(({name:e,number:t,description:n,action:o,forced:i=!1,standard:s})=>{let{signals:{[e]:a}}=zl,c=a!==void 0;return{name:e,number:c?a:t,description:n,supported:c,action:o,forced:i,standard:s}},"normalizeSignal");import{constants as Yl}from"node:os";var Hl=r(()=>{let e=Rn();return Object.fromEntries(e.map(Kl))},"getSignalsByName"),Kl=r(({name:e,number:t,description:n,supported:o,action:i,forced:s,standard:a})=>[e,{name:e,number:t,description:n,supported:o,action:i,forced:s,standard:a}],"getSignalByName"),Co=Hl(),Xl=r(()=>{let e=Rn(),t=Dn+1,n=Array.from({length:t},(o,i)=>Jl(i,e));return Object.assign({},...n)},"getSignalsByNumber"),Jl=r((e,t)=>{let n=Ql(e,t);if(n===void 0)return{};let{name:o,description:i,supported:s,action:a,forced:c,standard:l}=n;return{[e]:{name:o,number:e,description:i,supported:s,action:a,forced:c,standard:l}}},"getSignalByNumber"),Ql=r((e,t)=>{let n=t.find(({name:o})=>Yl.signals[o]===e);return n!==void 0?n:t.find(o=>o.number===e)},"findSignalByNumber"),aw=Xl();import{constants as Le}from"node:os";var Bo=r(e=>{let t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return Po(e,t)},"normalizeKillSignal"),Fo=r(e=>e===0?e:Po(e,"`subprocess.kill()`'s argument"),"normalizeSignalArgument"),Po=r((e,t)=>{if(Number.isInteger(e))return Zl(e,t);if(typeof e=="string")return ed(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
11
+ ${Mn()}`)},"normalizeSignal"),Zl=r((e,t)=>{if(Lo.has(e))return Lo.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
12
+ ${Mn()}`)},"normalizeSignalInteger"),ql=r(()=>new Map(Object.entries(Le.signals).reverse().map(([e,t])=>[t,e])),"getSignalsIntegerToName"),Lo=ql(),ed=r((e,t)=>{if(e in Le.signals)return e;throw e.toUpperCase()in Le.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
13
+ ${Mn()}`)},"normalizeSignalName"),Mn=r(()=>`Available signal names: ${td()}.
14
+ Available signal numbers: ${nd()}.`,"getAvailableSignals"),td=r(()=>Object.keys(Le.signals).sort().map(e=>`'${e}'`).join(", "),"getAvailableSignalNames"),nd=r(()=>[...new Set(Object.values(Le.signals).sort((e,t)=>e-t))].join(", "),"getAvailableSignalIntegers"),ut=r(e=>Co[e].description,"getSignalDescription");import{setTimeout as rd}from"node:timers/promises";var _o=r(e=>{if(e===!1)return e;if(e===!0)return od;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},"normalizeForceKillAfterDelay"),od=1e3*5,Uo=r(({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:o,context:i,controller:s},a,c)=>{let{signal:l,error:d}=id(a,c,n);sd(d,o);let f=e(l);return ad({kill:e,signal:l,forceKillAfterDelay:t,killSignal:n,killResult:f,context:i,controller:s}),f},"subprocessKill"),id=r((e,t,n)=>{let[o=n,i]=ft(e)?[void 0,e]:[e,t];if(typeof o!="string"&&!Number.isInteger(o))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(o)}`);if(i!==void 0&&!ft(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Fo(o),error:i}},"parseKillArguments"),sd=r((e,t)=>{e!==void 0&&t.reject(e)},"emitKillError"),ad=r(async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:o,killResult:i,context:s,controller:a})=>{t===o&&i&&Cn({kill:e,forceKillAfterDelay:n,context:s,controllerSignal:a.signal})},"setKillTimeout"),Cn=r(async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:o})=>{if(t!==!1)try{await rd(t,void 0,{signal:o}),e("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}},"killOnTimeout");import{once as cd}from"node:events";var pt=r(async(e,t)=>{e.aborted||await cd(e,"abort",{signal:t})},"onAbortedSignal");var $o=r(({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},"validateCancelSignal"),vo=r(({kill:e,cancelSignal:t,gracefulCancel:n,context:o,controller:i})=>t===void 0||n?[]:[ld(e,t,o,i)],"throwOnCancel"),ld=r(async(e,t,n,{signal:o})=>{throw await pt(t,o),n.terminationReason??="cancel",e(),t.reason},"terminateOnCancel");var ue=r(({methodName:e,isSubprocess:t,ipc:n,isConnected:o})=>{dd(e,t,n),Pn(e,t,o)},"validateIpcMethod"),dd=r((e,t,n)=>{if(!n)throw new Error(`${$(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},"validateIpcOption"),Pn=r((e,t,n)=>{if(!n)throw new Error(`${$(e,t)} cannot be used: the ${Q(t)} has already exited or disconnected.`)},"validateConnection"),No=r(e=>{throw new Error(`${$("getOneMessage",e)} could not complete: the ${Q(e)} exited or disconnected.`)},"throwOnEarlyDisconnect"),jo=r(e=>{throw new Error(`${$("sendMessage",e)} failed: the ${Q(e)} is sending a message too, instead of listening to incoming messages.
15
15
  This can be fixed by both sending a message and listening to incoming messages at the same time:
16
16
 
17
17
  const [receivedMessage] = await Promise.all([
18
- ${L("getOneMessage",e)},
19
- ${L("sendMessage",e,"message, {strict: true}")},
20
- ]);`)},"throwOnStrictDeadlockError"),ut=n((e,t)=>new Error(`${L("sendMessage",t)} failed when sending an acknowledgment response to the ${Y(t)}.`,{cause:e}),"getStrictResponseError"),_o=n(e=>{throw new Error(`${L("sendMessage",e)} failed: the ${Y(e)} is not listening to incoming messages.`)},"throwOnMissingStrict"),vo=n(e=>{throw new Error(`${L("sendMessage",e)} failed: the ${Y(e)} exited without listening to incoming messages.`)},"throwOnStrictDisconnect"),$o=n(()=>new Error(`\`cancelSignal\` aborted: the ${Y(!0)} disconnected.`),"getAbortDisconnectError"),jo=n(()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},"throwOnMissingParent"),No=n(({error:e,methodName:t,isSubprocess:r})=>{if(e.code==="EPIPE")throw new Error(`${L(t,r)} cannot be used: the ${Y(r)} is disconnecting.`,{cause:e})},"handleEpipeError"),ko=n(({error:e,methodName:t,isSubprocess:r,message:o})=>{if(ld(e))throw new Error(`${L(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(o)}.`,{cause:e})},"handleSerializationError"),ld=n(({code:e,message:t})=>dd.has(e)||fd.some(r=>t.includes(r)),"isSerializationError"),dd=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),fd=["could not be cloned","circular structure","call stack size exceeded"],L=n((e,t,r="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${ud(t)}${e}(${r})`,"getMethodName"),ud=n(e=>e?"":"subprocess.","getNamespaceName"),Y=n(e=>e?"parent process":"subprocess","getOtherProcessName"),de=n(e=>{e.connected&&e.disconnect()},"disconnect");var U=n(()=>{let e={},t=new Promise((r,o)=>{Object.assign(e,{resolve:r,reject:o})});return Object.assign(t,e)},"createDeferred");import{addAbortListener as pd}from"node:events";var Q=n((e,t,r)=>{let o=e.getMaxListeners();o===0||o===1/0||(e.setMaxListeners(o+t),pd(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},"incrementMaxListeners");var pt=n((e,t)=>{t&&Dr(e)},"addReference"),Dr=n(e=>{e.refCounted()},"addReferenceCount"),mt=n((e,t)=>{t&&Ir(e)},"removeReference"),Ir=n(e=>{e.unrefCounted()},"removeReferenceCount"),Go=n((e,t)=>{t&&(Ir(e),Ir(e))},"undoAddedReferences"),Wo=n((e,t)=>{t&&(Dr(e),Dr(e))},"redoAddedReferences");import{once as md}from"node:events";import{scheduler as hd}from"node:timers/promises";var zo=n(async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:o},i)=>{if(Ho(i)||Xo(i))return;ht.has(e)||ht.set(e,[]);let s=ht.get(e);if(s.push(i),!(s.length>1))for(;s.length>0;){await Ko(e,o,i),await hd.yield();let a=await Yo({wrappedMessage:s[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:o});s.shift(),o.emit("message",a),o.emit("message:done")}},"onMessage"),Vo=n(async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:o,boundOnMessage:i})=>{Rr();let s=ht.get(e);for(;s?.length>0;)await md(o,"message:done");e.removeListener("message",i),Wo(t,r),o.connected=!1,o.emit("disconnect")},"onDisconnect"),ht=new WeakMap;import{EventEmitter as gd}from"node:events";var H=n((e,t,r)=>{if(gt.has(e))return gt.get(e);let o=new gd;return o.connected=!0,gt.set(e,o),yd({ipcEmitter:o,anyProcess:e,channel:t,isSubprocess:r}),o},"getIpcEmitter"),gt=new WeakMap,yd=n(({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:o})=>{let i=zo.bind(void 0,{anyProcess:t,channel:r,isSubprocess:o,ipcEmitter:e});t.on("message",i),t.once("disconnect",Vo.bind(void 0,{anyProcess:t,channel:r,isSubprocess:o,ipcEmitter:e,boundOnMessage:i})),Go(r,o)},"forwardEvents"),yt=n(e=>{let t=gt.get(e);return t===void 0?e.channel!==void 0&&e.channel!==null:t.connected},"isConnected");import{once as Sd}from"node:events";var Qo=n(({anyProcess:e,channel:t,isSubprocess:r,message:o,strict:i})=>{if(!i)return o;let s=H(e,t,r),a=wt(e,s);return{id:bd++,type:bt,message:o,hasListeners:a}},"handleSendStrict"),bd=0n,Zo=n((e,t)=>{if(!(t?.type!==bt||t.hasListeners))for(let{id:r}of e)r!==void 0&&St[r].resolve({isDeadlock:!0,hasListeners:!1})},"validateStrictDeadlock"),Yo=n(async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:o,ipcEmitter:i})=>{if(e?.type!==bt||!t.connected)return e;let{id:s,message:a}=e,c={id:s,type:Jo,message:wt(t,i)};try{await fe({anyProcess:t,channel:r,isSubprocess:o,ipc:!0},c)}catch(l){i.emit("strict:error",l)}return a},"handleStrictRequest"),Ho=n(e=>{if(e?.type!==Jo)return!1;let{id:t,message:r}=e;return St[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},"handleStrictResponse"),qo=n(async(e,t,r)=>{if(e?.type!==bt)return;let o=U();St[e.id]=o;let i=new AbortController;try{let{isDeadlock:s,hasListeners:a}=await Promise.race([o,wd(t,r,i)]);s&&Uo(r),a||_o(r)}finally{i.abort(),delete St[e.id]}},"waitForStrictResponse"),St={},wd=n(async(e,t,{signal:r})=>{Q(e,1,r),await Sd(e,"disconnect",{signal:r}),vo(t)},"throwOnDisconnect"),bt="execa:ipc:request",Jo="execa:ipc:response";var ri=n((e,t,r)=>{Ce.has(e)||Ce.set(e,new Set);let o=Ce.get(e),i=U(),s=r?t.id:void 0,a={onMessageSent:i,id:s};return o.add(a),{outgoingMessages:o,outgoingMessage:a}},"startSendMessage"),ni=n(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},"endSendMessage"),Ko=n(async(e,t,r)=>{for(;!wt(e,t)&&Ce.get(e)?.size>0;){let o=[...Ce.get(e)];Zo(o,r),await Promise.all(o.map(({onMessageSent:i})=>i))}},"waitForOutgoingMessages"),Ce=new WeakMap,ei=new WeakMap,oi=n((e,t)=>{ei.set(e,t)},"setIpcSubprocessOptions"),wt=n((e,t)=>t.listenerCount("message")>xd(e),"hasMessageListeners"),xd=n(e=>ti(e)!==void 0&&!k(ti(e).buffer,"ipc")?1:0,"getMinListenerCount"),ti=n(e=>ei.get(e),"getOptions");import{promisify as Ed}from"node:util";var fe=n(({anyProcess:e,channel:t,isSubprocess:r,ipc:o},i,{strict:s=!1}={})=>{let a="sendMessage";return le({methodName:a,isSubprocess:r,ipc:o,isConnected:e.connected}),Td({anyProcess:e,channel:t,methodName:a,isSubprocess:r,message:i,strict:s})},"sendMessage"),Td=n(async({anyProcess:e,channel:t,methodName:r,isSubprocess:o,message:i,strict:s})=>{let a=Qo({anyProcess:e,channel:t,isSubprocess:o,message:i,strict:s}),c=ri(e,a,s);try{await Cr({anyProcess:e,methodName:r,isSubprocess:o,wrappedMessage:a,message:i})}catch(l){throw de(e),l}finally{ni(c)}},"sendMessageAsync"),Cr=n(async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:o,message:i})=>{let s=Od(e);try{await Promise.all([qo(o,e,r),s(o)])}catch(a){throw No({error:a,methodName:t,isSubprocess:r}),ko({error:a,methodName:t,isSubprocess:r,message:i}),a}},"sendOneMessage"),Od=n(e=>{if(Mr.has(e))return Mr.get(e);let t=Ed(e.send.bind(e));return Mr.set(e,t),t},"getSendMethod"),Mr=new WeakMap;import{scheduler as Ad}from"node:timers/promises";var ai=n((e,t)=>{let r="cancelSignal";return Ar(r,!1,e.connected),Cr({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:si,message:t},message:t})},"sendAbort"),ci=n(async({anyProcess:e,channel:t,isSubprocess:r,ipc:o})=>(await Dd({anyProcess:e,channel:t,isSubprocess:r,ipc:o}),Pr.signal),"getCancelSignal"),Dd=n(async({anyProcess:e,channel:t,isSubprocess:r,ipc:o})=>{if(!ii){if(ii=!0,!o){jo();return}if(t===null){Rr();return}H(e,t,r),await Ad.yield()}},"startIpc"),ii=!1,Xo=n(e=>e?.type!==si?!1:(Pr.abort(e.message),!0),"handleAbort"),si="execa:ipc:cancel",Rr=n(()=>{Pr.abort($o())},"abortOnDisconnect"),Pr=new AbortController;var li=n(({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:o})=>{if(e){if(t===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(o==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},"validateGracefulCancel"),di=n(({subprocess:e,kill:t,cancelSignal:r,gracefulCancel:o,forceKillAfterDelay:i,context:s,controller:a})=>o?[Id({subprocess:e,kill:t,cancelSignal:r,forceKillAfterDelay:i,context:s,controller:a})]:[],"throwOnGracefulCancel"),Id=n(async({subprocess:e,kill:t,cancelSignal:r,forceKillAfterDelay:o,context:i,controller:{signal:s}})=>{await ft(r,s);let a=Rd(r);throw await ai(e,a),Or({kill:t,forceKillAfterDelay:o,context:i,controllerSignal:s}),i.terminationReason??="gracefulCancel",r.reason},"sendOnAbort"),Rd=n(({reason:e})=>{if(!(e instanceof DOMException))return e;let t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},"getReason");import{setTimeout as Md}from"node:timers/promises";var fi=n(({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},"validateTimeout"),ui=n((e,t,r,o)=>t===0||t===void 0?[]:[Cd(e,t,r,o)],"throwOnTimeout"),Cd=n(async(e,t,r,{signal:o})=>{throw await Md(t,void 0,{signal:o}),r.terminationReason??="timeout",e(),new P},"killAfterTimeout");import{execPath as Pd,execArgv as Ld}from"node:process";import pi from"node:path";var mi=n(({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},"mapNode"),hi=n((e,t,{node:r=!1,nodePath:o=Pd,nodeOptions:i=Ld.filter(l=>!l.startsWith("--inspect")),cwd:s,execPath:a,...c})=>{if(a!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let l=oe(o,'The "nodePath" option'),d=pi.resolve(s,l),f={__proto__:null,shell:!1,...c,nodePath:d,node:r,cwd:s};if(!r)return[e,t,f];if(pi.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[d,[...i,e,...t],{__proto__:null,ipc:!0,...f,shell:!1}]},"handleNodeOption");import{serialize as Bd}from"node:v8";var gi=n(({ipcInput:e,ipc:t,serialization:r})=>{if(e!==void 0){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");_d[r](e)}},"validateIpcInputOption"),Fd=n(e=>{try{Bd(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},"validateAdvancedInput"),Ud=n(e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},"validateJsonInput"),_d={advanced:Fd,json:Ud},yi=n(async(e,t,r)=>{t!==void 0&&await fe({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r},t)},"sendIpcInput");var bi=n(({encoding:e})=>{if(Lr.has(e))return;let t=$d(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${xt(e)}\`.
21
- Please rename it to ${xt(t)}.`);let r=[...Lr].map(o=>xt(o)).join(", ");throw new TypeError(`Invalid option \`encoding: ${xt(e)}\`.
22
- Please rename it to one of: ${r}.`)},"validateEncoding"),vd=new Set(["utf8","utf16le"]),D=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Lr=vd.union(D),$d=n(e=>{if(e===null)return"buffer";if(typeof e!="string")return;let t=e.toLowerCase();if(t in Si)return Si[t];if(Lr.has(t))return t},"getCorrectEncoding"),Si={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},xt=n(e=>typeof e=="string"?`"${e}"`:String(e),"serializeEncoding");import Et from"node:fs";import wi from"node:fs/promises";import Pe from"node:path";import Le from"node:process";var G=Le.platform==="win32",jd=G?new RegExp("[\\/\\\\]","v"):new RegExp("\\/","v"),Nd=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC";function Tt(e,t){if(typeof e!="string"||e.length===0)throw new TypeError("Expected a non-empty string.");let{cwd:r=Le.cwd(),path:o=Le.env.PATH??(G?Le.env.Path:void 0)??"",pathExt:i=Le.env.PATHEXT||Nd}=t;return{cwd:r,searchPath:o,pathExt:i}}n(Tt,"resolveOptions");function kd(e,t){let r=t.split(Pe.delimiter).filter(Boolean),o=Pe.extname(e).toLowerCase();return o!==""&&r.some(i=>i.toLowerCase()===o)?["",...r]:r}n(kd,"windowsExtensions");function*Ot(e,{cwd:t,searchPath:r,pathExt:o}){let i=G?kd(e,o):[""];if(jd.test(e)){let a=Pe.resolve(t,e);for(let c of i)yield a+c;return}let s=[...G?[t]:[],...r.split(Pe.delimiter)];for(let a of s){let c=G&&a.length>1&&a.startsWith('"')&&a.endsWith('"')?a.slice(1,-1):a;if(c==="")continue;let l=Pe.resolve(t,c,e);for(let d of i)yield l+d}}n(Ot,"candidatePaths");async function xi(e){let t;try{t=await wi.stat(e)}catch(r){return G&&r.code==="EACCES"}if(!t.isFile())return!1;if(G)return!0;try{return await wi.access(e,Et.constants.X_OK),!0}catch{return!1}}n(xi,"isExecutable");function Ei(e){let t;try{t=Et.statSync(e)}catch(r){return G&&r.code==="EACCES"}if(!t.isFile())return!1;if(G)return!0;try{return Et.accessSync(e,Et.constants.X_OK),!0}catch{return!1}}n(Ei,"isExecutableSync");async function _x(e,t={}){let r=Tt(e,t);for(let o of Ot(e,r))if(await xi(o))return o}n(_x,"whichCommand");function At(e,t={}){let r=Tt(e,t);for(let o of Ot(e,r))if(Ei(o))return o}n(At,"whichCommandSync");async function vx(e,t={}){let r=Tt(e,t),o=[...Ot(e,r)],i=await Promise.all(o.map(async s=>await xi(s)?s:void 0));return[...new Set(i.filter(Boolean))]}n(vx,"whichCommandAll");function $x(e,t={}){let r=Tt(e,t),o=[];for(let i of Ot(e,r))Ei(i)&&o.push(i);return[...new Set(o)]}n($x,"whichCommandAllSync");import{openSync as Gd,readSync as Wd,closeSync as zd}from"node:fs";import{Buffer as Vd}from"node:buffer";import ue from"node:path";import pe from"node:process";var Ai=n((e,t,r)=>{let o={file:e,commandArguments:[...t],options:r};return r.shell||pe.platform!=="win32"?o:Kd(o)},"parseCommandFile"),Yd=/\.(?:com|exe)$/i,Hd=/\.(?:bat|cmd)$/i,Kd=n(e=>{let t=Xd(e);if(t!==void 0&&Yd.test(t))return e.options.argv0===void 0&&(e.options.argv0=e.file),e.file=t,e;for(let a of[e.file,...e.commandArguments])nf(a);let r=t!==void 0&&Hd.test(t),o=Br(ue.normalize(t??e.file)),i=e.commandArguments.map(a=>af(a,r)),s=`"${[o,...i].join(" ")}"`;return e.options.windowsVerbatimArguments=!0,{file:pe.env.comspec||"cmd.exe",commandArguments:["/d","/s","/c",s],options:e.options}},"escapeWindowsCommand"),Xd=n(e=>{let t=Ti(e),r=t!==void 0&&qd(t);return r?(e.commandArguments.unshift(t),e.file=r,Ti(e)):t},"resolveWithShebang"),Ti=n(e=>{let t=e.options.env||pe.env,r=e.options.cwd??pe.cwd(),o=Be(t,"PATHEXT"),i=ue.extname(e.file),s=i===""?o:`${i}${ue.delimiter}${o??""}`;if(Jd(e.file))return At(ue.resolve(r,e.file),{cwd:r,pathExt:s});let a=Be(t,"PATH")??Be(pe.env,"PATH")??"",c={cwd:r,path:a,pathExt:s};return Qd(t)?At(e.file,c):Zd(e.file,c)},"resolvePath"),Jd=n(e=>e.includes("/")||e.includes("\\")||e.includes(":"),"hasWindowsPathSeparator"),Qd=n(e=>Be(pe.env,"NODEFAULTCURRENTDIRECTORYINEXEPATH")===void 0&&Be(e,"NODEFAULTCURRENTDIRECTORYINEXEPATH")===void 0,"shouldSearchCurrentDirectory"),Zd=n((e,{cwd:t,path:r,pathExt:o})=>{for(let i of r.split(ue.delimiter)){let s=i.length>1&&i.startsWith('"')&&i.endsWith('"')?i.slice(1,-1):i;if(s==="")continue;let a=At(ue.resolve(t,s,e),{cwd:t,pathExt:o});if(a!==void 0)return a}},"resolvePathDirectories"),Be=n((e,t)=>{let r=Object.keys(e).sort().find(o=>o.toUpperCase()===t);return r===void 0?void 0:e[r]},"getWindowsEnvironmentValue"),Oi=150,qd=n(e=>{let t=Vd.alloc(Oi);try{let r=Gd(e,"r");try{Wd(r,t,0,Oi,0)}finally{zd(r)}}catch{return}return tf(t.toString())},"readShebang"),ef=/^#!(?<line>.*)/,tf=n(e=>{let t=e.match(ef)?.groups.line.trim();if(!t)return;let[r,o]=t.split(" "),i=r.split("/").at(-1);return i==="env"?o:o?`${i} ${o}`:i},"parseShebang"),rf=/[\n\r]/,nf=n(e=>{if(rf.test(e))throw new TypeError(`The command and its arguments cannot contain a line break on Windows without a shell.
18
+ ${$("getOneMessage",e)},
19
+ ${$("sendMessage",e,"message, {strict: true}")},
20
+ ]);`)},"throwOnStrictDeadlockError"),mt=r((e,t)=>new Error(`${$("sendMessage",t)} failed when sending an acknowledgment response to the ${Q(t)}.`,{cause:e}),"getStrictResponseError"),ko=r(e=>{throw new Error(`${$("sendMessage",e)} failed: the ${Q(e)} is not listening to incoming messages.`)},"throwOnMissingStrict"),Go=r(e=>{throw new Error(`${$("sendMessage",e)} failed: the ${Q(e)} exited without listening to incoming messages.`)},"throwOnStrictDisconnect"),Wo=r(()=>new Error(`\`cancelSignal\` aborted: the ${Q(!0)} disconnected.`),"getAbortDisconnectError"),zo=r(()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},"throwOnMissingParent"),Vo=r(({error:e,methodName:t,isSubprocess:n})=>{if(e.code==="EPIPE")throw new Error(`${$(t,n)} cannot be used: the ${Q(n)} is disconnecting.`,{cause:e})},"handleEpipeError"),Yo=r(({error:e,methodName:t,isSubprocess:n,message:o})=>{if(fd(e))throw new Error(`${$(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(o)}.`,{cause:e})},"handleSerializationError"),fd=r(({code:e,message:t})=>ud.has(e)||pd.some(n=>t.includes(n)),"isSerializationError"),ud=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),pd=["could not be cloned","circular structure","call stack size exceeded"],$=r((e,t,n="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${md(t)}${e}(${n})`,"getMethodName"),md=r(e=>e?"":"subprocess.","getNamespaceName"),Q=r(e=>e?"parent process":"subprocess","getOtherProcessName"),pe=r(e=>{e.connected&&e.disconnect()},"disconnect");var k=r(()=>{let e={},t=new Promise((n,o)=>{Object.assign(e,{resolve:n,reject:o})});return Object.assign(t,e)},"createDeferred");import{addAbortListener as hd}from"node:events";var ne=r((e,t,n)=>{let o=e.getMaxListeners();o===0||o===1/0||(e.setMaxListeners(o+t),hd(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},"incrementMaxListeners");var ht=r((e,t)=>{t&&Ln(e)},"addReference"),Ln=r(e=>{e.refCounted()},"addReferenceCount"),gt=r((e,t)=>{t&&Bn(e)},"removeReference"),Bn=r(e=>{e.unrefCounted()},"removeReferenceCount"),Ho=r((e,t)=>{t&&(Bn(e),Bn(e))},"undoAddedReferences"),Ko=r((e,t)=>{t&&(Ln(e),Ln(e))},"redoAddedReferences");import{once as gd}from"node:events";import{scheduler as Sd}from"node:timers/promises";var Xo=r(async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:o},i)=>{if(Zo(i)||ei(i))return;St.has(e)||St.set(e,[]);let s=St.get(e);if(s.push(i),!(s.length>1))for(;s.length>0;){await qo(e,o,i),await Sd.yield();let a=await Qo({wrappedMessage:s[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:o});s.shift(),o.emit("message",a),o.emit("message:done")}},"onMessage"),Jo=r(async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:o,boundOnMessage:i})=>{Fn();let s=St.get(e);for(;s?.length>0;)await gd(o,"message:done");e.removeListener("message",i),Ko(t,n),o.connected=!1,o.emit("disconnect")},"onDisconnect"),St=new WeakMap;import{EventEmitter as yd}from"node:events";var Z=r((e,t,n)=>{if(yt.has(e))return yt.get(e);let o=new yd;return o.connected=!0,yt.set(e,o),bd({ipcEmitter:o,anyProcess:e,channel:t,isSubprocess:n}),o},"getIpcEmitter"),yt=new WeakMap,bd=r(({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:o})=>{let i=Xo.bind(void 0,{anyProcess:t,channel:n,isSubprocess:o,ipcEmitter:e});t.on("message",i),t.once("disconnect",Jo.bind(void 0,{anyProcess:t,channel:n,isSubprocess:o,ipcEmitter:e,boundOnMessage:i})),Ho(n,o)},"forwardEvents"),bt=r(e=>{let t=yt.get(e);return t===void 0?e.channel!==void 0&&e.channel!==null:t.connected},"isConnected");import{once as wd}from"node:events";var ni=r(({anyProcess:e,channel:t,isSubprocess:n,message:o,strict:i})=>{if(!i)return o;let s=Z(e,t,n),a=Et(e,s);return{id:xd++,type:xt,message:o,hasListeners:a}},"handleSendStrict"),xd=0n,ri=r((e,t)=>{if(!(t?.type!==xt||t.hasListeners))for(let{id:n}of e)n!==void 0&&wt[n].resolve({isDeadlock:!0,hasListeners:!1})},"validateStrictDeadlock"),Qo=r(async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:o,ipcEmitter:i})=>{if(e?.type!==xt||!t.connected)return e;let{id:s,message:a}=e,c={id:s,type:ti,message:Et(t,i)};try{await me({anyProcess:t,channel:n,isSubprocess:o,ipc:!0},c)}catch(l){i.emit("strict:error",l)}return a},"handleStrictRequest"),Zo=r(e=>{if(e?.type!==ti)return!1;let{id:t,message:n}=e;return wt[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},"handleStrictResponse"),oi=r(async(e,t,n)=>{if(e?.type!==xt)return;let o=k();wt[e.id]=o;let i=new AbortController;try{let{isDeadlock:s,hasListeners:a}=await Promise.race([o,Ed(t,n,i)]);s&&jo(n),a||ko(n)}finally{i.abort(),delete wt[e.id]}},"waitForStrictResponse"),wt={},Ed=r(async(e,t,{signal:n})=>{ne(e,1,n),await wd(e,"disconnect",{signal:n}),Go(t)},"throwOnDisconnect"),xt="execa:ipc:request",ti="execa:ipc:response";var ai=r((e,t,n)=>{Be.has(e)||Be.set(e,new Set);let o=Be.get(e),i=k(),s=n?t.id:void 0,a={onMessageSent:i,id:s};return o.add(a),{outgoingMessages:o,outgoingMessage:a}},"startSendMessage"),ci=r(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},"endSendMessage"),qo=r(async(e,t,n)=>{for(;!Et(e,t)&&Be.get(e)?.size>0;){let o=[...Be.get(e)];ri(o,n),await Promise.all(o.map(({onMessageSent:i})=>i))}},"waitForOutgoingMessages"),Be=new WeakMap,ii=new WeakMap,li=r((e,t)=>{ii.set(e,t)},"setIpcSubprocessOptions"),Et=r((e,t)=>t.listenerCount("message")>Td(e),"hasMessageListeners"),Td=r(e=>si(e)!==void 0&&!H(si(e).buffer,"ipc")?1:0,"getMinListenerCount"),si=r(e=>ii.get(e),"getOptions");import{promisify as Od}from"node:util";var me=r(({anyProcess:e,channel:t,isSubprocess:n,ipc:o},i,{strict:s=!1}={})=>{let a="sendMessage";return ue({methodName:a,isSubprocess:n,ipc:o,isConnected:e.connected}),Ad({anyProcess:e,channel:t,methodName:a,isSubprocess:n,message:i,strict:s})},"sendMessage"),Ad=r(async({anyProcess:e,channel:t,methodName:n,isSubprocess:o,message:i,strict:s})=>{let a=ni({anyProcess:e,channel:t,isSubprocess:o,message:i,strict:s}),c=ai(e,a,s);try{await Un({anyProcess:e,methodName:n,isSubprocess:o,wrappedMessage:a,message:i})}catch(l){throw pe(e),l}finally{ci(c)}},"sendMessageAsync"),Un=r(async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:o,message:i})=>{let s=Id(e);try{await Promise.all([oi(o,e,n),s(o)])}catch(a){throw Vo({error:a,methodName:t,isSubprocess:n}),Yo({error:a,methodName:t,isSubprocess:n,message:i}),a}},"sendOneMessage"),Id=r(e=>{if(_n.has(e))return _n.get(e);let t=Od(e.send.bind(e));return _n.set(e,t),t},"getSendMethod"),_n=new WeakMap;import{scheduler as Dd}from"node:timers/promises";var ui=r((e,t)=>{let n="cancelSignal";return Pn(n,!1,e.connected),Un({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:fi,message:t},message:t})},"sendAbort"),pi=r(async({anyProcess:e,channel:t,isSubprocess:n,ipc:o})=>(await Rd({anyProcess:e,channel:t,isSubprocess:n,ipc:o}),$n.signal),"getCancelSignal"),Rd=r(async({anyProcess:e,channel:t,isSubprocess:n,ipc:o})=>{if(!di){if(di=!0,!o){zo();return}if(t===null){Fn();return}Z(e,t,n),await Dd.yield()}},"startIpc"),di=!1,ei=r(e=>e?.type!==fi?!1:($n.abort(e.message),!0),"handleAbort"),fi="execa:ipc:cancel",Fn=r(()=>{$n.abort(Wo())},"abortOnDisconnect"),$n=new AbortController;var mi=r(({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:o})=>{if(e){if(t===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(o==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},"validateGracefulCancel"),hi=r(({subprocess:e,kill:t,cancelSignal:n,gracefulCancel:o,forceKillAfterDelay:i,context:s,controller:a})=>o?[Md({subprocess:e,kill:t,cancelSignal:n,forceKillAfterDelay:i,context:s,controller:a})]:[],"throwOnGracefulCancel"),Md=r(async({subprocess:e,kill:t,cancelSignal:n,forceKillAfterDelay:o,context:i,controller:{signal:s}})=>{await pt(n,s);let a=Cd(n);throw await ui(e,a),Cn({kill:t,forceKillAfterDelay:o,context:i,controllerSignal:s}),i.terminationReason??="gracefulCancel",n.reason},"sendOnAbort"),Cd=r(({reason:e})=>{if(!(e instanceof DOMException))return e;let t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},"getReason");import{setTimeout as Pd}from"node:timers/promises";var gi=r(({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},"validateTimeout"),Si=r((e,t,n,o)=>t===0||t===void 0?[]:[Ld(e,t,n,o)],"throwOnTimeout"),Ld=r(async(e,t,n,{signal:o})=>{throw await Pd(t,void 0,{signal:o}),n.terminationReason??="timeout",e(),new U},"killAfterTimeout");import{execPath as Bd,execArgv as Fd}from"node:process";import yi from"node:path";var bi=r(({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},"mapNode"),wi=r((e,t,{node:n=!1,nodePath:o=Bd,nodeOptions:i=Fd.filter(l=>!l.startsWith("--inspect")),cwd:s,execPath:a,...c})=>{if(a!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let l=ae(o,'The "nodePath" option'),d=yi.resolve(s,l),f={__proto__:null,shell:!1,...c,nodePath:d,node:n,cwd:s};if(!n)return[e,t,f];if(yi.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[d,[...i,e,...t],{__proto__:null,ipc:!0,...f,shell:!1}]},"handleNodeOption");import{serialize as _d}from"node:v8";var xi=r(({ipcInput:e,ipc:t,serialization:n})=>{if(e!==void 0){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");vd[n](e)}},"validateIpcInputOption"),Ud=r(e=>{try{_d(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},"validateAdvancedInput"),$d=r(e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},"validateJsonInput"),vd={advanced:Ud,json:$d},Ei=r(async(e,t,n)=>{t!==void 0&&await me({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n},t)},"sendIpcInput");var Oi=r(({encoding:e})=>{if(vn.has(e))return;let t=jd(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${Tt(e)}\`.
21
+ Please rename it to ${Tt(t)}.`);let n=[...vn].map(o=>Tt(o)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Tt(e)}\`.
22
+ Please rename it to one of: ${n}.`)},"validateEncoding"),Nd=new Set(["utf8","utf16le"]),M=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),vn=Nd.union(M),jd=r(e=>{if(e===null)return"buffer";if(typeof e!="string")return;let t=e.toLowerCase();if(t in Ti)return Ti[t];if(vn.has(t))return t},"getCorrectEncoding"),Ti={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Tt=r(e=>typeof e=="string"?`"${e}"`:String(e),"serializeEncoding");import Ot from"node:fs";import Ai from"node:fs/promises";import Fe from"node:path";import _e from"node:process";var K=_e.platform==="win32",kd=K?new RegExp("[\\/\\\\]","v"):new RegExp("\\/","v"),Gd=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC";function At(e,t){if(typeof e!="string"||e.length===0)throw new TypeError("Expected a non-empty string.");let{cwd:n=_e.cwd(),path:o=_e.env.PATH??(K?_e.env.Path:void 0)??"",pathExt:i=_e.env.PATHEXT||Gd}=t;return{cwd:n,searchPath:o,pathExt:i}}r(At,"resolveOptions");function Wd(e,t){let n=t.split(Fe.delimiter).filter(Boolean),o=Fe.extname(e).toLowerCase();return o!==""&&n.some(i=>i.toLowerCase()===o)?["",...n]:n}r(Wd,"windowsExtensions");function*It(e,{cwd:t,searchPath:n,pathExt:o}){let i=K?Wd(e,o):[""];if(kd.test(e)){let a=Fe.resolve(t,e);for(let c of i)yield a+c;return}let s=[...K?[t]:[],...n.split(Fe.delimiter)];for(let a of s){let c=K&&a.length>1&&a.startsWith('"')&&a.endsWith('"')?a.slice(1,-1):a;if(c==="")continue;let l=Fe.resolve(t,c,e);for(let d of i)yield l+d}}r(It,"candidatePaths");async function Ii(e){let t;try{t=await Ai.stat(e)}catch(n){return K&&n.code==="EACCES"}if(!t.isFile())return!1;if(K)return!0;try{return await Ai.access(e,Ot.constants.X_OK),!0}catch{return!1}}r(Ii,"isExecutable");function Di(e){let t;try{t=Ot.statSync(e)}catch(n){return K&&n.code==="EACCES"}if(!t.isFile())return!1;if(K)return!0;try{return Ot.accessSync(e,Ot.constants.X_OK),!0}catch{return!1}}r(Di,"isExecutableSync");async function Wx(e,t={}){let n=At(e,t);for(let o of It(e,n))if(await Ii(o))return o}r(Wx,"whichCommand");function Dt(e,t={}){let n=At(e,t);for(let o of It(e,n))if(Di(o))return o}r(Dt,"whichCommandSync");async function zx(e,t={}){let n=At(e,t),o=[...It(e,n)],i=await Promise.all(o.map(async s=>await Ii(s)?s:void 0));return[...new Set(i.filter(Boolean))]}r(zx,"whichCommandAll");function Vx(e,t={}){let n=At(e,t),o=[];for(let i of It(e,n))Di(i)&&o.push(i);return[...new Set(o)]}r(Vx,"whichCommandAllSync");import{openSync as zd,readSync as Vd,closeSync as Yd}from"node:fs";import{Buffer as Hd}from"node:buffer";import he from"node:path";import ge from"node:process";var Ci=r((e,t,n)=>{let o={file:e,commandArguments:[...t],options:n};return n.shell||ge.platform!=="win32"?o:Jd(o)},"parseCommandFile"),Kd=/\.(?:com|exe)$/i,Xd=/\.(?:bat|cmd)$/i,Jd=r(e=>{let t=Qd(e);if(t!==void 0&&Kd.test(t))return e.options.argv0===void 0&&(e.options.argv0=e.file),e.file=t,e;for(let a of[e.file,...e.commandArguments])sf(a);let n=t!==void 0&&Xd.test(t),o=Nn(he.normalize(t??e.file)),i=e.commandArguments.map(a=>lf(a,n)),s=`"${[o,...i].join(" ")}"`;return e.options.windowsVerbatimArguments=!0,{file:ge.env.comspec||"cmd.exe",commandArguments:["/d","/s","/c",s],options:e.options}},"escapeWindowsCommand"),Qd=r(e=>{let t=Ri(e),n=t!==void 0&&tf(t);return n?(e.commandArguments.unshift(t),e.file=n,Ri(e)):t},"resolveWithShebang"),Ri=r(e=>{let t=e.options.env||ge.env,n=e.options.cwd??ge.cwd(),o=Ue(t,"PATHEXT"),i=he.extname(e.file),s=i===""?o:`${i}${he.delimiter}${o??""}`;if(Zd(e.file))return Dt(he.resolve(n,e.file),{cwd:n,pathExt:s});let a=Ue(t,"PATH")??Ue(ge.env,"PATH")??"",c={cwd:n,path:a,pathExt:s};return qd(t)?Dt(e.file,c):ef(e.file,c)},"resolvePath"),Zd=r(e=>e.includes("/")||e.includes("\\")||e.includes(":"),"hasWindowsPathSeparator"),qd=r(e=>Ue(ge.env,"NODEFAULTCURRENTDIRECTORYINEXEPATH")===void 0&&Ue(e,"NODEFAULTCURRENTDIRECTORYINEXEPATH")===void 0,"shouldSearchCurrentDirectory"),ef=r((e,{cwd:t,path:n,pathExt:o})=>{for(let i of n.split(he.delimiter)){let s=i.length>1&&i.startsWith('"')&&i.endsWith('"')?i.slice(1,-1):i;if(s==="")continue;let a=Dt(he.resolve(t,s,e),{cwd:t,pathExt:o});if(a!==void 0)return a}},"resolvePathDirectories"),Ue=r((e,t)=>{let n=Object.keys(e).sort().find(o=>o.toUpperCase()===t);return n===void 0?void 0:e[n]},"getWindowsEnvironmentValue"),Mi=150,tf=r(e=>{let t=Hd.alloc(Mi);try{let n=zd(e,"r");try{Vd(n,t,0,Mi,0)}finally{Yd(n)}}catch{return}return rf(t.toString())},"readShebang"),nf=/^#!(?<line>.*)/,rf=r(e=>{let t=e.match(nf)?.groups.line.trim();if(!t)return;let[n,o]=t.split(" "),i=n.split("/").at(-1);return i==="env"?o:o?`${i} ${o}`:i},"parseShebang"),of=/[\n\r]/,sf=r(e=>{if(of.test(e))throw new TypeError(`The command and its arguments cannot contain a line break on Windows without a shell.
23
23
  This would allow a command injection with \`cmd.exe\`.
24
- Invalid value: ${JSON.stringify(`${e}`)}`)},"assertNoLineBreak"),of=/[()\][%!^"`<>&|;, *?]/g,Br=n(e=>e.replaceAll(of,"^$&"),"escapeMetaChars"),sf=/\\+/g,af=n((e,t)=>{let r=`${e}`.replaceAll(sf,(i,s,a)=>{let c=a[s+i.length];return c==='"'||c===void 0?i.repeat(2):i}).replaceAll('"','\\"'),o=Br(`"${r}"`);return t?Br(o):o},"escapeArgument");import{statSync as cf}from"node:fs";import lf from"node:path";import df from"node:process";var Ii=n((e=Di())=>{let t=oe(e,'The "cwd" option');return lf.resolve(t)},"normalizeCwd"),Di=n(()=>{try{return df.cwd()}catch(e){throw e.message=`The current directory does not exist.
25
- ${e.message}`,e}},"getDefaultCwd"),Ri=n((e,t)=>{if(t===Di())return e;let r;try{r=cf(t)}catch(o){return`The "cwd" option is invalid: ${t}.
24
+ Invalid value: ${JSON.stringify(`${e}`)}`)},"assertNoLineBreak"),af=/[()\][%!^"`<>&|;, *?]/g,Nn=r(e=>e.replaceAll(af,"^$&"),"escapeMetaChars"),cf=/\\+/g,lf=r((e,t)=>{let n=`${e}`.replaceAll(cf,(i,s,a)=>{let c=a[s+i.length];return c==='"'||c===void 0?i.repeat(2):i}).replaceAll('"','\\"'),o=Nn(`"${n}"`);return t?Nn(o):o},"escapeArgument");import{statSync as df}from"node:fs";import ff from"node:path";import uf from"node:process";var Li=r((e=Pi())=>{let t=ae(e,'The "cwd" option');return ff.resolve(t)},"normalizeCwd"),Pi=r(()=>{try{return uf.cwd()}catch(e){throw e.message=`The current directory does not exist.
25
+ ${e.message}`,e}},"getDefaultCwd"),Bi=r((e,t)=>{if(t===Pi())return e;let n;try{n=df(t)}catch(o){return`The "cwd" option is invalid: ${t}.
26
26
  ${o.message}
27
- ${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
28
- ${e}`},"fixCwdError");import ff from"node:path";import Mi from"node:process";var uf=/^cmd(?:\.exe)?$/i,Dt=n((e,t,r)=>{let o={__proto__:null,...r};o.cwd=Ii(o.cwd);let[i,s,a]=hi(e,t,o),c=Xn(a),l=pf(c);l.env=mf(l);let{file:d,commandArguments:f}=Ai(i,s,l);return fi(l),bi(l),gi(l),Lo(l),li(l),l.shell=fr(l.shell),l.killSignal=Ro(l.killSignal),l.forceKillAfterDelay=Co(l.forceKillAfterDelay),l.lines=l.lines.map((u,p)=>u&&!D.has(l.encoding)&&l.buffer[p]),Mi.platform==="win32"&&uf.test(ff.basename(d))&&f.unshift("/q"),{file:d,commandArguments:f,options:l}},"normalizeOptions"),pf=n(({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:o=r,encoding:i="utf8",reject:s=!0,cleanup:a=!0,killDescendants:c=!1,all:l=!1,windowsHide:d=!0,killSignal:f="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:p=!1,ipcInput:m,ipc:g=m!==void 0||p,serialization:S="advanced",...b})=>({__proto__:null,...b,extendEnv:e,preferLocal:t,cwd:r,localDirectory:o,encoding:i,reject:s,cleanup:a,killDescendants:c,all:l,windowsHide:d,killSignal:f,forceKillAfterDelay:u,gracefulCancel:p,ipcInput:m,ipc:g,serialization:S}),"addDefaultOptions"),mf=n(({env:e,extendEnv:t,preferLocal:r,node:o,localDirectory:i,nodePath:s})=>{let a=t?{...Mi.env,...e}:e;return r||o?yo({env:a,cwd:i,execPath:s,preferLocal:r,addExecPath:o}):a},"getEnv");var It=n((e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r],"concatenateShell");function me(e){if(typeof e=="string")return hf(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return gf(e)}n(me,"stripFinalNewline");var hf=n(e=>e.at(-1)===Ci?e.slice(0,e.at(-2)===Pi?-2:-1):e,"stripFinalNewlineString"),gf=n(e=>e.at(-1)===yf?e.subarray(0,e.at(-2)===Sf?-2:-1):e,"stripFinalNewlineBinary"),Ci=`
29
- `,yf=Ci.codePointAt(0),Pi="\r",Sf=Pi.codePointAt(0);function B(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}n(B,"isStream");function Fr(e,{checkOpen:t=!0}={}){return B(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}n(Fr,"isWritableStream");function Z(e,{checkOpen:t=!0}={}){return B(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}n(Z,"isReadableStream");function Rt(e,t){return Fr(e,t)&&Z(e,t)}n(Rt,"isDuplexStream");function xE(e,t){return Rt(e,t)&&typeof e._transform=="function"}n(xE,"isTransformStream");var bf=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),Ur=class{static{n(this,"c")}#t;#r;#e=!1;#n=void 0;constructor(t,r){this.#t=t,this.#r=r}next(){let t=n(()=>this.#i(),"e");return this.#n=this.#n?this.#n.then(t,t):t(),this.#n}return(t){let r=n(()=>this.#o(t),"t");return this.#n?this.#n.then(r,r):r()}async#i(){if(this.#e)return{done:!0,value:void 0};let t;try{t=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return t.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),t}async#o(t){if(this.#e)return{done:!0,value:t};if(this.#e=!0,!this.#r){let r=this.#t.cancel(t);return this.#t.releaseLock(),await r,{done:!0,value:t}}return this.#t.releaseLock(),{done:!0,value:t}}},_r=Symbol();function Li(){return this[_r].next()}n(Li,"i"),Object.defineProperty(Li,"name",{value:"next"});function Bi(e){return this[_r].return(e)}n(Bi,"o"),Object.defineProperty(Bi,"name",{value:"return"});var wf=Object.create(bf,{next:{enumerable:!0,configurable:!0,writable:!0,value:Li},return:{enumerable:!0,configurable:!0,writable:!0,value:Bi}});function Fe({preventCancel:e=!1}={}){let t=this.getReader(),r=new Ur(t,e),o=Object.create(wf);return o[_r]=r,o}n(Fe,"h");function vr(e){let t=xf(e);return new ReadableStream({async pull(r){let{value:o,done:i}=await t.next();i?r.close():r.enqueue(o)},async cancel(r){if(typeof t.return=="function"&&typeof await t.return(r)!="object")throw new TypeError("return() fulfills with a non-object.");return r}},new CountQueuingStrategy({highWaterMark:0}))}n(vr,"c");function xf(e){let t=e[Symbol.asyncIterator]?.bind(e);if(t===void 0){let r=e[Symbol.iterator](),o={[Symbol.iterator]:()=>r};t=n(async function*(){return yield*o},"t")}return t()}n(xf,"a");var Fi=n(e=>{if(Z(e,{checkOpen:!1})&&Ue.on!==void 0)return Tf(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(Ef.call(e)==="[object ReadableStream]")return Fe.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},"getAsyncIterable"),{toString:Ef}=Object.prototype,Tf=n(async function*(e){let t=new AbortController,r={};Of(e,t,r);try{for await(let[o]of Ue.on(e,"data",{signal:t.signal}))yield o}catch(o){if(r.error!==void 0)throw r.error;if(!t.signal.aborted)throw o}finally{e.destroy()}},"getStreamIterable"),Of=n(async(e,t,r)=>{try{await Ue.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(o){r.error=o}finally{t.abort()}},"handleStreamEnd"),Ue={};var he=n(async(e,{init:t,convertChunk:r,getSize:o,truncateChunk:i,addChunk:s,getFinalChunk:a,finalize:c},{maxBuffer:l=Number.POSITIVE_INFINITY}={})=>{let d=Fi(e),f=t();f.length=0;try{for await(let u of d){let p=Df(u),m=r[p](u,f);Ui({convertedChunk:m,state:f,getSize:o,truncateChunk:i,addChunk:s,maxBuffer:l})}return Af({state:f,convertChunk:r,getSize:o,truncateChunk:i,addChunk:s,getFinalChunk:a,maxBuffer:l}),c(f)}catch(u){let p=typeof u=="object"&&u!==null?u:new Error(u);throw p.bufferedData=c(f),p}},"getStreamContents"),Af=n(({state:e,getSize:t,truncateChunk:r,addChunk:o,getFinalChunk:i,maxBuffer:s})=>{let a=i(e);a!==void 0&&Ui({convertedChunk:a,state:e,getSize:t,truncateChunk:r,addChunk:o,maxBuffer:s})},"appendFinalChunk"),Ui=n(({convertedChunk:e,state:t,getSize:r,truncateChunk:o,addChunk:i,maxBuffer:s})=>{let a=r(e),c=t.length+a;if(c<=s){_i(e,t,i,c);return}let l=o(e,s-t.length);throw l!==void 0&&_i(l,t,i,s),new _},"appendChunk"),_i=n((e,t,r,o)=>{t.contents=r(e,t,o),t.length=o},"addNewChunk"),Df=n(e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=vi.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&vi.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},"getChunkType"),{toString:vi}=Object.prototype,_=class extends Error{static{n(this,"MaxBufferError")}name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var W=n(e=>e,"identity"),_e=n(()=>{},"noop"),Mt=n(({contents:e})=>e,"getContentsProperty"),Ct=n(e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},"throwObjectStream"),Pt=n(e=>e.length,"getLengthProperty");async function Lt(e,t){return he(e,Cf,t)}n(Lt,"getStreamAsArray");var If=n(()=>({contents:[]}),"initArray"),Rf=n(()=>1,"increment"),Mf=n((e,{contents:t})=>(t.push(e),t),"addArrayChunk"),Cf={init:If,convertChunk:{string:W,buffer:W,arrayBuffer:W,dataView:W,typedArray:W,others:W},getSize:Rf,truncateChunk:_e,addChunk:Mf,getFinalChunk:_e,finalize:Mt};async function Bt(e,t){return he(e,jf,t)}n(Bt,"getStreamAsArrayBuffer");var Pf=n(()=>({contents:new ArrayBuffer(0)}),"initArrayBuffer"),Lf=n(e=>Bf.encode(e),"useTextEncoder"),Bf=new TextEncoder,$i=n(e=>new Uint8Array(e),"useUint8Array"),ji=n(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"useUint8ArrayWithOffset"),Ff=n((e,t)=>e.slice(0,t),"truncateArrayBufferChunk"),Uf=n((e,{contents:t,length:r},o)=>{let i=Gi()?vf(t,o):_f(t,o);return new Uint8Array(i).set(e,r),i},"addArrayBufferChunk"),_f=n((e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(Ni(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},"resizeArrayBufferSlow"),vf=n((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:Ni(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},"resizeArrayBuffer"),Ni=n(e=>ki**Math.ceil(Math.log(e)/Math.log(ki)),"getNewContentsLength"),ki=2,$f=n(({contents:e,length:t})=>Gi()?e:e.slice(0,t),"finalizeArrayBuffer"),Gi=n(()=>"resize"in ArrayBuffer.prototype,"hasArrayBufferResize"),jf={init:Pf,convertChunk:{string:Lf,buffer:$i,arrayBuffer:$i,dataView:ji,typedArray:ji,others:Ct},getSize:Pt,truncateChunk:Ff,addChunk:Uf,getFinalChunk:_e,finalize:$f};async function Ut(e,t){return he(e,zf,t)}n(Ut,"getStreamAsString");var Nf=n(()=>({contents:"",textDecoder:new TextDecoder}),"initString"),Ft=n((e,{textDecoder:t})=>t.decode(e,{stream:!0}),"useTextDecoder"),kf=n((e,{contents:t})=>t+e,"addStringChunk"),Gf=n((e,t)=>e.slice(0,t),"truncateStringChunk"),Wf=n(({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},"getFinalStringChunk"),zf={init:Nf,convertChunk:{string:W,buffer:Ft,arrayBuffer:Ft,dataView:Ft,typedArray:Ft,others:Ct},getSize:Pt,truncateChunk:Gf,addChunk:kf,getFinalChunk:Wf,finalize:Mt};import{on as Yf}from"node:events";import{finished as Hf}from"node:stream/promises";Object.assign(Ue,{on:Yf,finished:Hf});var Wi=n(({error:e,stream:t,readableObjectMode:r,lines:o,encoding:i,fdNumber:s})=>{if(!(e instanceof _))throw e;if(s==="all")return e;let a=Kf(r,o,i);throw e.maxBufferInfo={fdNumber:s,unit:a},t.destroy(),e},"handleMaxBuffer"),Kf=n((e,t,r)=>e?"objects":t?"lines":r==="buffer"?"bytes":"characters","getMaxBufferUnit"),zi=n((e,t,r)=>{if(t.length!==r)return;let o=new _;throw o.maxBufferInfo={fdNumber:"ipc"},o},"checkIpcMaxBuffer"),Vi=n((e,t)=>{let{streamName:r,threshold:o,unit:i}=Xf(e,t);return`Command's ${r} was larger than ${o} ${i}`},"getMaxBufferMessage"),Xf=n((e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:o}}=e;delete e.maxBufferInfo;let i=k(t,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:Ze(r),threshold:i,unit:o}},"getMaxBufferInfo"),Yi=n((e,t,r)=>e?.code==="ENOBUFS"&&t!==null&&t.some(o=>o!==null&&o.length>_t(r)),"isMaxBufferSync"),Hi=n((e,t,r)=>{if(!t)return e;let o=_t(r);return e.length>o?e.slice(0,o):e},"truncateMaxBufferSync"),_t=n(([,e])=>e,"getMaxBufferSync");import{inspect as Jf}from"node:util";var Xi=n(({stdio:e,all:t,ipcOutput:r,originalError:o,signal:i,signalDescription:s,exitCode:a,escapedCommand:c,timedOut:l,isCanceled:d,isGracefullyCanceled:f,isMaxBuffer:u,isForcefullyTerminated:p,forceKillAfterDelay:m,killSignal:g,maxBuffer:S,timeout:b,cwd:y})=>{let w=o?.code,x=Qf({originalError:o,timedOut:l,timeout:b,isMaxBuffer:u,maxBuffer:S,errorCode:w,signal:i,signalDescription:s,exitCode:a,isCanceled:d,isGracefullyCanceled:f,isForcefullyTerminated:p,forceKillAfterDelay:m,killSignal:g}),O=qf(o,y),A=O===void 0?"":`
30
- ${O}`,I=`${x}: ${c}${A}`,j=t===void 0?[e[2],e[1]]:[t],re=[I,...j,...e.slice(3),r.map(V=>eu(V)).join(`
31
- `)].map(V=>Ie(me(tu(V)))).filter(Boolean).join(`
27
+ ${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
28
+ ${e}`},"fixCwdError");import pf from"node:path";import Fi from"node:process";var mf=/^cmd(?:\.exe)?$/i,Rt=r((e,t,n)=>{let o={__proto__:null,...n};o.cwd=Li(o.cwd);let[i,s,a]=wi(e,t,o),c=eo(a),l=hf(c);l.env=gf(l);let{file:d,commandArguments:f}=Ci(i,s,l);return gi(l),Oi(l),xi(l),$o(l),mi(l),l.shell=Sn(l.shell),l.killSignal=Bo(l.killSignal),l.forceKillAfterDelay=_o(l.forceKillAfterDelay),l.lines=l.lines.map((u,p)=>u&&!M.has(l.encoding)&&l.buffer[p]),Fi.platform==="win32"&&mf.test(pf.basename(d))&&f.unshift("/q"),{file:d,commandArguments:f,options:l}},"normalizeOptions"),hf=r(({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:o=n,encoding:i="utf8",reject:s=!0,cleanup:a=!0,killDescendants:c=!1,all:l=!1,windowsHide:d=!0,killSignal:f="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:p=!1,ipcInput:m,ipc:g=m!==void 0||p,serialization:S="advanced",...w})=>({__proto__:null,...w,extendEnv:e,preferLocal:t,cwd:n,localDirectory:o,encoding:i,reject:s,cleanup:a,killDescendants:c,all:l,windowsHide:d,killSignal:f,forceKillAfterDelay:u,gracefulCancel:p,ipcInput:m,ipc:g,serialization:S}),"addDefaultOptions"),gf=r(({env:e,extendEnv:t,preferLocal:n,node:o,localDirectory:i,nodePath:s})=>{let a=t?{...Fi.env,...e}:e;return n||o?Eo({env:a,cwd:i,execPath:s,preferLocal:n,addExecPath:o}):a},"getEnv");var Mt=r((e,t,n)=>n.shell&&t.length>0?[[e,...t].join(" "),[],n]:[e,t,n],"concatenateShell");function Se(e){if(typeof e=="string")return Sf(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return yf(e)}r(Se,"stripFinalNewline");var Sf=r(e=>e.at(-1)===_i?e.slice(0,e.at(-2)===Ui?-2:-1):e,"stripFinalNewlineString"),yf=r(e=>e.at(-1)===bf?e.subarray(0,e.at(-2)===wf?-2:-1):e,"stripFinalNewlineBinary"),_i=`
29
+ `,bf=_i.codePointAt(0),Ui="\r",wf=Ui.codePointAt(0);function v(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}r(v,"isStream");function jn(e,{checkOpen:t=!0}={}){return v(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}r(jn,"isWritableStream");function re(e,{checkOpen:t=!0}={}){return v(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}r(re,"isReadableStream");function Ct(e,t){return jn(e,t)&&re(e,t)}r(Ct,"isDuplexStream");function RE(e,t){return Ct(e,t)&&typeof e._transform=="function"}r(RE,"isTransformStream");var xf=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),kn=class{static{r(this,"c")}#t;#n;#e=!1;#r=void 0;constructor(t,n){this.#t=t,this.#n=n}next(){let t=r(()=>this.#i(),"e");return this.#r=this.#r?this.#r.then(t,t):t(),this.#r}return(t){let n=r(()=>this.#o(t),"t");return this.#r?this.#r.then(n,n):n()}async#i(){if(this.#e)return{done:!0,value:void 0};let t;try{t=await this.#t.read()}catch(n){throw this.#r=void 0,this.#e=!0,this.#t.releaseLock(),n}return t.done&&(this.#r=void 0,this.#e=!0,this.#t.releaseLock()),t}async#o(t){if(this.#e)return{done:!0,value:t};if(this.#e=!0,!this.#n){let n=this.#t.cancel(t);return this.#t.releaseLock(),await n,{done:!0,value:t}}return this.#t.releaseLock(),{done:!0,value:t}}},Gn=Symbol();function $i(){return this[Gn].next()}r($i,"i"),Object.defineProperty($i,"name",{value:"next"});function vi(e){return this[Gn].return(e)}r(vi,"o"),Object.defineProperty(vi,"name",{value:"return"});var Ef=Object.create(xf,{next:{enumerable:!0,configurable:!0,writable:!0,value:$i},return:{enumerable:!0,configurable:!0,writable:!0,value:vi}});function $e({preventCancel:e=!1}={}){let t=this.getReader(),n=new kn(t,e),o=Object.create(Ef);return o[Gn]=n,o}r($e,"h");function Wn(e){let t=Tf(e);return new ReadableStream({async pull(n){let{value:o,done:i}=await t.next();i?n.close():n.enqueue(o)},async cancel(n){if(typeof t.return=="function"&&typeof await t.return(n)!="object")throw new TypeError("return() fulfills with a non-object.");return n}},new CountQueuingStrategy({highWaterMark:0}))}r(Wn,"c");function Tf(e){let t=e[Symbol.asyncIterator]?.bind(e);if(t===void 0){let n=e[Symbol.iterator](),o={[Symbol.iterator]:()=>n};t=r(async function*(){return yield*o},"t")}return t()}r(Tf,"a");var Ni=r(e=>{if(re(e,{checkOpen:!1})&&ve.on!==void 0)return Af(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(Of.call(e)==="[object ReadableStream]")return $e.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},"getAsyncIterable"),{toString:Of}=Object.prototype,Af=r(async function*(e){let t=new AbortController,n={};If(e,t,n);try{for await(let[o]of ve.on(e,"data",{signal:t.signal}))yield o}catch(o){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw o}finally{e.destroy()}},"getStreamIterable"),If=r(async(e,t,n)=>{try{await ve.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(o){n.error=o}finally{t.abort()}},"handleStreamEnd"),ve={};var ye=r(async(e,{init:t,convertChunk:n,getSize:o,truncateChunk:i,addChunk:s,getFinalChunk:a,finalize:c},{maxBuffer:l=Number.POSITIVE_INFINITY}={})=>{let d=Ni(e),f=t();f.length=0;try{for await(let u of d){let p=Rf(u),m=n[p](u,f);ji({convertedChunk:m,state:f,getSize:o,truncateChunk:i,addChunk:s,maxBuffer:l})}return Df({state:f,convertChunk:n,getSize:o,truncateChunk:i,addChunk:s,getFinalChunk:a,maxBuffer:l}),c(f)}catch(u){let p=typeof u=="object"&&u!==null?u:new Error(u);throw p.bufferedData=c(f),p}},"getStreamContents"),Df=r(({state:e,getSize:t,truncateChunk:n,addChunk:o,getFinalChunk:i,maxBuffer:s})=>{let a=i(e);a!==void 0&&ji({convertedChunk:a,state:e,getSize:t,truncateChunk:n,addChunk:o,maxBuffer:s})},"appendFinalChunk"),ji=r(({convertedChunk:e,state:t,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:s})=>{let a=n(e),c=t.length+a;if(c<=s){ki(e,t,i,c);return}let l=o(e,s-t.length);throw l!==void 0&&ki(l,t,i,s),new G},"appendChunk"),ki=r((e,t,n,o)=>{t.contents=n(e,t,o),t.length=o},"addNewChunk"),Rf=r(e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let n=Gi.call(e);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Gi.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},"getChunkType"),{toString:Gi}=Object.prototype,G=class extends Error{static{r(this,"MaxBufferError")}name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var X=r(e=>e,"identity"),Ne=r(()=>{},"noop"),Pt=r(({contents:e})=>e,"getContentsProperty"),Lt=r(e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},"throwObjectStream"),Bt=r(e=>e.length,"getLengthProperty");async function Ft(e,t){return ye(e,Lf,t)}r(Ft,"getStreamAsArray");var Mf=r(()=>({contents:[]}),"initArray"),Cf=r(()=>1,"increment"),Pf=r((e,{contents:t})=>(t.push(e),t),"addArrayChunk"),Lf={init:Mf,convertChunk:{string:X,buffer:X,arrayBuffer:X,dataView:X,typedArray:X,others:X},getSize:Cf,truncateChunk:Ne,addChunk:Pf,getFinalChunk:Ne,finalize:Pt};async function _t(e,t){return ye(e,kf,t)}r(_t,"getStreamAsArrayBuffer");var Bf=r(()=>({contents:new ArrayBuffer(0)}),"initArrayBuffer"),Ff=r(e=>_f.encode(e),"useTextEncoder"),_f=new TextEncoder,Wi=r(e=>new Uint8Array(e),"useUint8Array"),zi=r(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"useUint8ArrayWithOffset"),Uf=r((e,t)=>e.slice(0,t),"truncateArrayBufferChunk"),$f=r((e,{contents:t,length:n},o)=>{let i=Hi()?Nf(t,o):vf(t,o);return new Uint8Array(i).set(e,n),i},"addArrayBufferChunk"),vf=r((e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(Vi(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},"resizeArrayBufferSlow"),Nf=r((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:Vi(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},"resizeArrayBuffer"),Vi=r(e=>Yi**Math.ceil(Math.log(e)/Math.log(Yi)),"getNewContentsLength"),Yi=2,jf=r(({contents:e,length:t})=>Hi()?e:e.slice(0,t),"finalizeArrayBuffer"),Hi=r(()=>"resize"in ArrayBuffer.prototype,"hasArrayBufferResize"),kf={init:Bf,convertChunk:{string:Ff,buffer:Wi,arrayBuffer:Wi,dataView:zi,typedArray:zi,others:Lt},getSize:Bt,truncateChunk:Uf,addChunk:$f,getFinalChunk:Ne,finalize:jf};async function $t(e,t){return ye(e,Yf,t)}r($t,"getStreamAsString");var Gf=r(()=>({contents:"",textDecoder:new TextDecoder}),"initString"),Ut=r((e,{textDecoder:t})=>t.decode(e,{stream:!0}),"useTextDecoder"),Wf=r((e,{contents:t})=>t+e,"addStringChunk"),zf=r((e,t)=>e.slice(0,t),"truncateStringChunk"),Vf=r(({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},"getFinalStringChunk"),Yf={init:Gf,convertChunk:{string:X,buffer:Ut,arrayBuffer:Ut,dataView:Ut,typedArray:Ut,others:Lt},getSize:Bt,truncateChunk:zf,addChunk:Wf,getFinalChunk:Vf,finalize:Pt};import{on as Kf}from"node:events";import{finished as Xf}from"node:stream/promises";Object.assign(ve,{on:Kf,finished:Xf});var Ki=r(({error:e,stream:t,readableObjectMode:n,lines:o,encoding:i,fdNumber:s})=>{if(!(e instanceof G))throw e;if(s==="all")return e;let a=Jf(n,o,i);throw e.maxBufferInfo={fdNumber:s,unit:a},t.destroy(),e},"handleMaxBuffer"),Jf=r((e,t,n)=>e?"objects":t?"lines":n==="buffer"?"bytes":"characters","getMaxBufferUnit"),Xi=r((e,t,n)=>{if(t.length!==n)return;let o=new G;throw o.maxBufferInfo={fdNumber:"ipc"},o},"checkIpcMaxBuffer"),Ji=r((e,t)=>{let{streamName:n,threshold:o,unit:i}=Qf(e,t);return`Command's ${n} was larger than ${o} ${i}`},"getMaxBufferMessage"),Qf=r((e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:n,unit:o}}=e;delete e.maxBufferInfo;let i=H(t,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:et(n),threshold:i,unit:o}},"getMaxBufferInfo"),Qi=r((e,t,n)=>e?.code==="ENOBUFS"&&t!==null&&t.some(o=>o!==null&&o.length>vt(n)),"isMaxBufferSync"),Zi=r((e,t,n)=>{if(!t)return e;let o=vt(n);return e.length>o?e.slice(0,o):e},"truncateMaxBufferSync"),vt=r(([,e])=>e,"getMaxBufferSync");import{inspect as Zf}from"node:util";var es=r(({stdio:e,all:t,ipcOutput:n,originalError:o,signal:i,signalDescription:s,exitCode:a,escapedCommand:c,timedOut:l,isCanceled:d,isGracefullyCanceled:f,isMaxBuffer:u,isForcefullyTerminated:p,forceKillAfterDelay:m,killSignal:g,maxBuffer:S,timeout:w,cwd:b})=>{let E=o?.code,x=qf({originalError:o,timedOut:l,timeout:w,isMaxBuffer:u,maxBuffer:S,errorCode:E,signal:i,signalDescription:s,exitCode:a,isCanceled:d,isGracefullyCanceled:f,isForcefullyTerminated:p,forceKillAfterDelay:m,killSignal:g}),D=tu(o,b),A=D===void 0?"":`
30
+ ${D}`,R=`${x}: ${c}${A}`,C=t===void 0?[e[2],e[1]]:[t],N=[R,...C,...e.slice(3),n.map(F=>nu(F)).join(`
31
+ `)].map(F=>Ce(Se(ru(F)))).filter(Boolean).join(`
32
32
 
33
- `);return{originalMessage:O,shortMessage:I,message:re}},"createMessages"),Qf=n(({originalError:e,timedOut:t,timeout:r,isMaxBuffer:o,maxBuffer:i,errorCode:s,signal:a,signalDescription:c,exitCode:l,isCanceled:d,isGracefullyCanceled:f,isForcefullyTerminated:u,forceKillAfterDelay:p,killSignal:m})=>{let g=Zf(u,p);return t?`Command timed out after ${r} milliseconds${g}`:f?a===void 0?`Command was gracefully canceled with exit code ${l}`:u?`Command was gracefully canceled${g}`:`Command was gracefully canceled with ${a} (${c})`:d?`Command was canceled${g}`:o?`${Vi(e,i)}${g}`:s!==void 0?`Command failed with ${s}${g}`:u?`Command was killed with ${m} (${dt(m)})${g}`:a!==void 0?`Command was killed with ${a} (${c})`:l!==void 0?`Command failed with exit code ${l}`:"Command failed"},"getErrorPrefix"),Zf=n((e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"","getForcefulSuffix"),qf=n((e,t)=>{if(e instanceof P)return;let r=xo(e)?e.originalMessage:String(e?.message??e),o=Ie(Ri(r,t));return o===""?void 0:o},"getOriginalMessage"),eu=n(e=>typeof e=="string"?e:Jf(e),"serializeIpcMessage"),tu=n(e=>Array.isArray(e)?e.map(t=>me(Ki(t))).filter(Boolean).join(`
34
- `):Ki(e),"serializeMessagePart"),Ki=n(e=>typeof e=="string"?e:T(e)?Je(e):"","serializeMessageItem");var vt=n(({command:e,escapedCommand:t,stdio:r,all:o,ipcOutput:i,options:{cwd:s},startTime:a})=>Ji({command:e,escapedCommand:t,cwd:s,durationMs:br(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:o,stdio:r,ipcOutput:i,pipedFrom:[]}),"makeSuccessResult"),ge=n(({error:e,command:t,escapedCommand:r,fileDescriptors:o,options:i,startTime:s,isSync:a})=>ve({error:e,command:t,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:o.length}),ipcOutput:[],options:i,isSync:a}),"makeEarlyError"),ve=n(({error:e,command:t,escapedCommand:r,startTime:o,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:d,signal:f,stdio:u,all:p,ipcOutput:m,options:{timeoutDuration:g,timeout:S=g,forceKillAfterDelay:b,killSignal:y,cwd:w,maxBuffer:x},isSync:O})=>{let{exitCode:A,signal:I,signalDescription:j}=nu(d,f),{originalMessage:re,shortMessage:V,message:Ke}=Xi({stdio:u,all:p,ipcOutput:m,originalError:e,signal:I,signalDescription:j,exitCode:A,escapedCommand:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:c,isForcefullyTerminated:l,forceKillAfterDelay:b,killSignal:y,maxBuffer:x,timeout:S,cwd:w}),ne=wo(e,Ke,O);return Object.assign(ne,ru({error:ne,command:t,escapedCommand:r,startTime:o,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:A,signal:I,signalDescription:j,stdio:u,all:p,ipcOutput:m,cwd:w,originalMessage:re,shortMessage:V})),ne},"makeError"),ru=n(({error:e,command:t,escapedCommand:r,startTime:o,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:d,signal:f,signalDescription:u,stdio:p,all:m,ipcOutput:g,cwd:S,originalMessage:b,shortMessage:y})=>Ji({shortMessage:y,originalMessage:b,command:t,escapedCommand:r,cwd:S,durationMs:br(o),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isTerminated:f!==void 0,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:d,signal:f,signalDescription:u,code:e.cause?.code,stdout:p[1],stderr:p[2],all:m,stdio:p,ipcOutput:g,pipedFrom:[]}),"getErrorProperties"),Ji=n(e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),"omitUndefinedProperties"),nu=n((e,t)=>{let r=e===null?void 0:e,o=t===null?void 0:t,i=o===void 0?void 0:dt(t);return{exitCode:r,signal:o,signalDescription:i}},"normalizeExitPayload");var Qi=n(e=>Number.isFinite(e)?e:0,"toZeroIfInfinity");function ou(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(Qi(e*1e3)%1e3),nanoseconds:Math.trunc(Qi(e*1e6)%1e3)}}n(ou,"parseNumber");function iu(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}n(iu,"parseBigint");function $r(e){switch(typeof e){case"number":{if(Number.isFinite(e))return ou(e);break}case"bigint":return iu(e)}throw new TypeError("Expected a finite number or bigint")}n($r,"parseMilliseconds");var su=n(e=>e===0||e===0n,"isZero"),au=n((e,t)=>t===1||t===1n?e:`${e}s`,"pluralize"),cu=1e-7,lu=24n*60n*60n*1000n;function jr(e,t){let r=typeof e=="bigint";if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};let o=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],s=n((f,u)=>{let p=Math.floor(f*10**u+cu);return(Math.round(p)/10**u).toFixed(u)},"floorDecimals"),a=n((f,u,p,m)=>{if(!((i.length===0||!t.colonNotation)&&su(f)&&!(t.colonNotation&&p==="m"))){if(m??=String(f),t.colonNotation){let g=m.includes(".")?m.split(".")[0].length:m.length,S=i.length>0?2:1;m="0".repeat(Math.max(0,S-g))+m}else m+=t.verbose?" "+au(u,f):p;i.push(m)}},"add"),c=$r(e),l=BigInt(c.days);if(t.hideYearAndDays?a(BigInt(l)*24n+BigInt(c.hours),"hour","h"):(t.hideYear?a(l,"day","d"):(a(l/365n,"year","y"),a(l%365n,"day","d")),a(Number(c.hours),"hour","h")),a(Number(c.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let f=Number(c.seconds),u=Number(c.milliseconds),p=Number(c.microseconds),m=Number(c.nanoseconds);if(a(f,"second","s"),t.formatSubMilliseconds)a(u,"millisecond","ms"),a(p,"microsecond","\xB5s"),a(m,"nanosecond","ns");else{let g=u+p/1e3+m/1e6,S=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,b=g>=1?Math.round(g):Math.ceil(g),y=S?g.toFixed(S):b;a(Number.parseFloat(y),"millisecond","ms",y)}}else{let f=(r?Number(e%lu):e)/1e3%60,u=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,p=s(f,u),m=t.keepDecimalsOnWholeSeconds?p:p.replace(/\.0+$/,"");a(Number.parseFloat(m),"second","s",m)}if(i.length===0)return o+"0"+(t.verbose?" milliseconds":"ms");let d=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(i=i.slice(0,Math.max(t.unitCount,1))),o+i.join(d)}n(jr,"prettyMilliseconds");var Zi=n((e,t)=>{e.failed&&F({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})},"logError");var qi=n((e,t)=>{ie(t)&&(Zi(e,t),du(e,t))},"logResult"),du=n((e,t)=>{let r=`(done in ${jr(e.durationMs)})`;F({type:"duration",verboseMessage:r,verboseInfo:t,result:e})},"logDuration");var ye=n((e,t,{reject:r})=>{if(qi(e,t),e.failed&&r)throw e;return e},"handleResult");var kr=n((e,t)=>q(e)?"asyncGenerator":os(e)?"generator":$t(e)?"fileUrl":hu(e)?"filePath":bu(e)?"webStream":B(e,{checkOpen:!1})?"native":T(e)?"uint8Array":wu(e)?"asyncIterable":xu(e)?"iterable":Nr(e)?es({transform:e},t):mu(e)?fu(e,t):"native","getStdioItemType"),fu=n((e,t)=>Rt(e.transform,{checkOpen:!1})?uu(e,t):Nr(e.transform)?es(e,t):pu(e,t),"getTransformObjectType"),uu=n((e,t)=>(ts(e,t,"Duplex stream"),"duplex"),"getDuplexType"),es=n((e,t)=>(ts(e,t,"web TransformStream"),"webTransform"),"getTransformStreamType"),ts=n(({final:e,binary:t,objectMode:r},o,i)=>{rs(e,`${o}.final`,i),rs(t,`${o}.binary`,i),$e(r,`${o}.objectMode`)},"validateNonGeneratorType"),rs=n((e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},"checkUndefinedOption"),pu=n(({transform:e,final:t,binary:r,objectMode:o},i)=>{if(e!==void 0&&!ns(e))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Rt(t,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(Nr(t))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!ns(t))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return $e(r,`${i}.binary`),$e(o,`${i}.objectMode`),q(e)||q(t)?"asyncGenerator":"generator"},"getGeneratorObjectType"),$e=n((e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},"checkBooleanOption"),ns=n(e=>q(e)||os(e),"isGenerator"),q=n(e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]","isAsyncGenerator"),os=n(e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]","isSyncGenerator"),mu=n(e=>E(e)&&(e.transform!==void 0||e.final!==void 0),"isTransformOptions"),$t=n(e=>Object.prototype.toString.call(e)==="[object URL]","isUrl"),as=n(e=>$t(e)&&e.protocol!=="file:","isRegularUrl"),hu=n(e=>E(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>gu.has(t))&&Gr(e.file),"isFilePathObject"),gu=new Set(["file","append"]),Gr=n(e=>typeof e=="string","isFilePathString"),je=n(e=>E(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>yu.has(t))&&"value"in e,"isStdioValueObject"),yu=new Set(["value","input"]),cs=n((e,t)=>e==="native"&&typeof t=="string"&&!Su.has(t),"isUnknownStdioString"),Su=new Set(["ipc","ignore","inherit","overlapped","pipe"]),is=n(e=>Object.prototype.toString.call(e)==="[object ReadableStream]","isReadableStream"),jt=n(e=>Object.prototype.toString.call(e)==="[object WritableStream]","isWritableStream"),bu=n(e=>is(e)||jt(e),"isWebStream"),Nr=n(e=>is(e?.readable)&&jt(e?.writable),"isTransformStream"),wu=n(e=>ss(e)&&typeof e[Symbol.asyncIterator]=="function","isAsyncIterableObject"),xu=n(e=>ss(e)&&typeof e[Symbol.iterator]=="function","isIterableObject"),ss=n(e=>typeof e=="object"&&e!==null,"isObject"),M=new Set(["generator","asyncGenerator","duplex","webTransform"]),Nt=new Set(["fileUrl","filePath","fileNumber"]),Wr=new Set(["fileUrl","filePath"]),ls=new Set([...Wr,"webStream","nodeStream"]),ds=new Set(["webTransform","duplex"]),K={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var zr=n((e,t,r,o)=>o==="output"?Eu(e,t,r):Tu(e,t,r),"getTransformObjectModes"),Eu=n((e,t,r)=>{let o=t!==0&&r[t-1].value.readableObjectMode;return{writableObjectMode:o,readableObjectMode:e??o}},"getOutputObjectModes"),Tu=n((e,t,r)=>{let o=t===0?e===!0:r[t-1].value.readableObjectMode,i=t!==r.length-1&&(e??o);return{writableObjectMode:o,readableObjectMode:i}},"getInputObjectModes"),fs=n((e,t)=>{let r=e.findLast(({type:o})=>M.has(o));return r===void 0?!1:t==="input"?r.value.writableObjectMode:r.value.readableObjectMode},"getFdObjectMode");var us=n((e,t,r,o)=>[...e.filter(({type:i})=>!M.has(i)),...Ou(e,t,r,o)],"normalizeTransforms"),Ou=n((e,t,r,{encoding:o})=>{let i=e.filter(({type:a})=>M.has(a)),s=Array.from({length:i.length});for(let[a,c]of Object.entries(i))s[a]=Au({stdioItem:c,index:Number(a),newTransforms:s,optionName:t,direction:r,encoding:o});return Mu(s,r)},"getTransforms"),Au=n(({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:o,optionName:i,direction:s,encoding:a})=>t==="duplex"?Du({stdioItem:e,optionName:i}):t==="webTransform"?Iu({stdioItem:e,index:r,newTransforms:o,direction:s}):Ru({stdioItem:e,index:r,newTransforms:o,direction:s,encoding:a}),"normalizeTransform"),Du=n(({stdioItem:e,optionName:t})=>{let{value:r}=e,{transform:o}=r,{writableObjectMode:i,readableObjectMode:s}=o,{objectMode:a=s}=r;if(a&&!s)throw new TypeError(`The \`${t}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!a&&s)throw new TypeError(`The \`${t}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:o,writableObjectMode:i,readableObjectMode:s}}},"normalizeDuplex"),Iu=n(({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:o,direction:i})=>{let{transform:s,objectMode:a}=E(t)?t:{transform:t},{writableObjectMode:c,readableObjectMode:l}=zr(a,r,o,i);return{...e,value:{transform:s,writableObjectMode:c,readableObjectMode:l}}},"normalizeTransformStream"),Ru=n(({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:o,direction:i,encoding:s})=>{let{transform:a,final:c,binary:l=!1,preserveNewlines:d=!1,objectMode:f}=E(t)?t:{transform:t},u=l||D.has(s),{writableObjectMode:p,readableObjectMode:m}=zr(f,r,o,i);return{...e,value:{transform:a,final:c,binary:u,preserveNewlines:d,writableObjectMode:p,readableObjectMode:m}}},"normalizeGenerator"),Mu=n((e,t)=>t==="input"?e.reverse():e,"sortTransforms");import Vr from"node:process";var ms=n((e,t,r)=>{let o=e.map(i=>Cu(i,t));if(o.includes("input")&&o.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return o.find(Boolean)??Fu},"getStreamDirection"),Cu=n((e,t)=>Lu[t]??Pu(e),"getStdioItemDirection"),Pu=n(({type:e,value:t,direction:r,optionName:o})=>{let i=ps[e](t);if(r==="input"&&i==="output")throw new TypeError(`The \`${o}\` option is invalid: \`input: true\` cannot be used with a writable value, which is always an output.`);return r??i},"getRequestedDirection"),Lu=["input","output","output"],Se=n(()=>{},"anyDirection"),Yr=n(()=>"input","alwaysInput"),ps={generator:Se,asyncGenerator:Se,fileUrl:Se,filePath:Se,iterable:Yr,asyncIterable:Yr,uint8Array:Yr,webStream:n(e=>jt(e)?"output":"input","webStream"),nodeStream(e){return Z(e,{checkOpen:!1})?Fr(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:Se,duplex:Se,native(e){let t=Bu(e);if(t!==void 0)return t;if(B(e,{checkOpen:!1}))return ps.nodeStream(e)}},Bu=n(e=>{if([0,Vr.stdin].includes(e))return"input";if([1,2,Vr.stdout,Vr.stderr].includes(e))return"output"},"getStandardStreamDirection"),Fu="output";var hs=n((e,t)=>t?[...e,"ipc"]:e,"normalizeIpcStdioArray");var bs=n(({stdio:e,ipc:t,buffer:r,...o},i,s)=>{let a=vu(e,o).map((c,l)=>ys(c,l));return Uu(a),s?ju(a,r,i):hs(a,t)},"normalizeStdioOption"),Uu=n(e=>{if(e.some(t=>_u(t)))throw new Error("The `ipc: true` option must be used instead of `stdio: 'ipc'`.")},"validateIpcStdioOption"),_u=n(e=>Array.isArray(e)?e.some(t=>gs(t)):gs(e),"hasIpcStdioOption"),gs=n(e=>je(e)?e.value==="ipc":e==="ipc","hasIpcStdioItem"),vu=n((e,t)=>{if(e===void 0)return R.map(o=>t[o]);if($u(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${R.map(o=>`\`${o}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,R.length);return Array.from({length:r},(o,i)=>e[i])},"getStdioArray"),$u=n(e=>R.some(t=>e[t]!==void 0),"hasAlias"),ys=n((e,t)=>Array.isArray(e)?e.map(r=>ys(r,t)):e??(t>=R.length?"ignore":"pipe"),"addDefaultValue"),ju=n((e,t,r)=>e.map((o,i)=>!t[i]&&i!==0&&!se(r,i)&&Nu(o,i)?"ignore":o),"normalizeStdioSync"),Nu=n((e,t)=>Ss(e,t)||Array.isArray(e)&&e.every(r=>Ss(r,t)),"isOutputPipeOnly"),Ss=n((e,t)=>e==="pipe"||ku(e,t),"isOutputPipe"),ku=n((e,t)=>je(e)&&e.value==="pipe"&&(e.input===void 0||e.input===!1||Gu(t,e.input)),"isOutputPipeObject"),Gu=n((e,t)=>t===!0&&(e===1||e===2),"isFixedOutputPipe");var Gt=n((e,t="stdin")=>{let{options:o,fileDescriptors:i}=v.get(e),s=ws(i,t,!0),a=e.stdio[s];if(a===null)throw new TypeError(xs(s,t,o,!0));return a},"getToStream"),be=n((e,t="stdout")=>{let{options:o,fileDescriptors:i}=v.get(e),s=ws(i,t,!1),a=s==="all"?e.all:e.stdio[s];if(a==null)throw new TypeError(xs(s,t,o,!1));return a},"getFromStream"),v=new WeakMap,ws=n((e,t,r)=>{let o=Wu(t,r);return zu(o,t,r,e),o},"getFdNumber"),Wu=n((e,t)=>{let r=hr(e);if(r!==void 0)return r;let{validOptions:o,defaultValue:i}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Ne(t)}" must not be "${e}".
33
+ `);return{originalMessage:D,shortMessage:R,message:N}},"createMessages"),qf=r(({originalError:e,timedOut:t,timeout:n,isMaxBuffer:o,maxBuffer:i,errorCode:s,signal:a,signalDescription:c,exitCode:l,isCanceled:d,isGracefullyCanceled:f,isForcefullyTerminated:u,forceKillAfterDelay:p,killSignal:m})=>{let g=eu(u,p);return t?`Command timed out after ${n} milliseconds${g}`:f?a===void 0?`Command was gracefully canceled with exit code ${l}`:u?`Command was gracefully canceled${g}`:`Command was gracefully canceled with ${a} (${c})`:d?`Command was canceled${g}`:o?`${Ji(e,i)}${g}`:s!==void 0?`Command failed with ${s}${g}`:u?`Command was killed with ${m} (${ut(m)})${g}`:a!==void 0?`Command was killed with ${a} (${c})`:l!==void 0?`Command failed with exit code ${l}`:"Command failed"},"getErrorPrefix"),eu=r((e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"","getForcefulSuffix"),tu=r((e,t)=>{if(e instanceof U)return;let n=Io(e)?e.originalMessage:String(e?.message??e),o=Ce(Bi(n,t));return o===""?void 0:o},"getOriginalMessage"),nu=r(e=>typeof e=="string"?e:Zf(e),"serializeIpcMessage"),ru=r(e=>Array.isArray(e)?e.map(t=>Se(qi(t))).filter(Boolean).join(`
34
+ `):qi(e),"serializeMessagePart"),qi=r(e=>typeof e=="string"?e:O(e)?Ze(e):"","serializeMessageItem");var Nt=r(({command:e,escapedCommand:t,stdio:n,all:o,ipcOutput:i,options:{cwd:s},startTime:a})=>ts({command:e,escapedCommand:t,cwd:s,durationMs:An(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:o,stdio:n,ipcOutput:i,pipedFrom:[]}),"makeSuccessResult"),be=r(({error:e,command:t,escapedCommand:n,fileDescriptors:o,options:i,startTime:s,isSync:a})=>je({error:e,command:t,escapedCommand:n,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:o.length}),ipcOutput:[],options:i,isSync:a}),"makeEarlyError"),je=r(({error:e,command:t,escapedCommand:n,startTime:o,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:d,signal:f,stdio:u,all:p,ipcOutput:m,options:{timeoutDuration:g,timeout:S=g,forceKillAfterDelay:w,killSignal:b,cwd:E,maxBuffer:x},isSync:D})=>{let{exitCode:A,signal:R,signalDescription:C}=iu(d,f),{originalMessage:N,shortMessage:F,message:y}=es({stdio:u,all:p,ipcOutput:m,originalError:e,signal:R,signalDescription:C,exitCode:A,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:c,isForcefullyTerminated:l,forceKillAfterDelay:w,killSignal:b,maxBuffer:x,timeout:S,cwd:E}),I=Ao(e,y,D);return Object.assign(I,ou({error:I,command:t,escapedCommand:n,startTime:o,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:A,signal:R,signalDescription:C,stdio:u,all:p,ipcOutput:m,cwd:E,originalMessage:N,shortMessage:F})),I},"makeError"),ou=r(({error:e,command:t,escapedCommand:n,startTime:o,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:d,signal:f,signalDescription:u,stdio:p,all:m,ipcOutput:g,cwd:S,originalMessage:w,shortMessage:b})=>ts({shortMessage:b,originalMessage:w,command:t,escapedCommand:n,cwd:S,durationMs:An(o),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isTerminated:f!==void 0,isMaxBuffer:c,isForcefullyTerminated:l,exitCode:d,signal:f,signalDescription:u,code:e.cause?.code,stdout:p[1],stderr:p[2],all:m,stdio:p,ipcOutput:g,pipedFrom:[]}),"getErrorProperties"),ts=r(e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),"omitUndefinedProperties"),iu=r((e,t)=>{let n=e===null?void 0:e,o=t===null?void 0:t,i=o===void 0?void 0:ut(t);return{exitCode:n,signal:o,signalDescription:i}},"normalizeExitPayload");var ns=r(e=>Number.isFinite(e)?e:0,"toZeroIfInfinity");function su(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(ns(e*1e3)%1e3),nanoseconds:Math.trunc(ns(e*1e6)%1e3)}}r(su,"parseNumber");function au(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}r(au,"parseBigint");function zn(e){switch(typeof e){case"number":{if(Number.isFinite(e))return su(e);break}case"bigint":return au(e)}throw new TypeError("Expected a finite number or bigint")}r(zn,"parseMilliseconds");var cu=r(e=>e===0||e===0n,"isZero"),lu=r((e,t)=>t===1||t===1n?e:`${e}s`,"pluralize"),du=1e-7,fu=24n*60n*60n*1000n;function Vn(e,t){let n=typeof e=="bigint";if(!n&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};let o=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],s=r((f,u)=>{let p=Math.floor(f*10**u+du);return(Math.round(p)/10**u).toFixed(u)},"floorDecimals"),a=r((f,u,p,m)=>{if(!((i.length===0||!t.colonNotation)&&cu(f)&&!(t.colonNotation&&p==="m"))){if(m??=String(f),t.colonNotation){let g=m.includes(".")?m.split(".")[0].length:m.length,S=i.length>0?2:1;m="0".repeat(Math.max(0,S-g))+m}else m+=t.verbose?" "+lu(u,f):p;i.push(m)}},"add"),c=zn(e),l=BigInt(c.days);if(t.hideYearAndDays?a(BigInt(l)*24n+BigInt(c.hours),"hour","h"):(t.hideYear?a(l,"day","d"):(a(l/365n,"year","y"),a(l%365n,"day","d")),a(Number(c.hours),"hour","h")),a(Number(c.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let f=Number(c.seconds),u=Number(c.milliseconds),p=Number(c.microseconds),m=Number(c.nanoseconds);if(a(f,"second","s"),t.formatSubMilliseconds)a(u,"millisecond","ms"),a(p,"microsecond","\xB5s"),a(m,"nanosecond","ns");else{let g=u+p/1e3+m/1e6,S=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,w=g>=1?Math.round(g):Math.ceil(g),b=S?g.toFixed(S):w;a(Number.parseFloat(b),"millisecond","ms",b)}}else{let f=(n?Number(e%fu):e)/1e3%60,u=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,p=s(f,u),m=t.keepDecimalsOnWholeSeconds?p:p.replace(/\.0+$/,"");a(Number.parseFloat(m),"second","s",m)}if(i.length===0)return o+"0"+(t.verbose?" milliseconds":"ms");let d=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(i=i.slice(0,Math.max(t.unitCount,1))),o+i.join(d)}r(Vn,"prettyMilliseconds");var rs=r((e,t)=>{e.failed&&j({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})},"logError");var os=r((e,t)=>{ce(t)&&(rs(e,t),uu(e,t))},"logResult"),uu=r((e,t)=>{let n=`(done in ${Vn(e.durationMs)})`;j({type:"duration",verboseMessage:n,verboseInfo:t,result:e})},"logDuration");var we=r((e,t,{reject:n})=>{if(os(e,t),e.failed&&n)throw e;return e},"handleResult");var Hn=r((e,t)=>oe(e)?"asyncGenerator":ls(e)?"generator":jt(e)?"fileUrl":Su(e)?"filePath":xu(e)?"webStream":v(e,{checkOpen:!1})?"native":O(e)?"uint8Array":Eu(e)?"asyncIterable":Tu(e)?"iterable":Yn(e)?is({transform:e},t):gu(e)?pu(e,t):"native","getStdioItemType"),pu=r((e,t)=>Ct(e.transform,{checkOpen:!1})?mu(e,t):Yn(e.transform)?is(e,t):hu(e,t),"getTransformObjectType"),mu=r((e,t)=>(ss(e,t,"Duplex stream"),"duplex"),"getDuplexType"),is=r((e,t)=>(ss(e,t,"web TransformStream"),"webTransform"),"getTransformStreamType"),ss=r(({final:e,binary:t,objectMode:n},o,i)=>{as(e,`${o}.final`,i),as(t,`${o}.binary`,i),ke(n,`${o}.objectMode`)},"validateNonGeneratorType"),as=r((e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},"checkUndefinedOption"),hu=r(({transform:e,final:t,binary:n,objectMode:o},i)=>{if(e!==void 0&&!cs(e))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Ct(t,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(Yn(t))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!cs(t))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return ke(n,`${i}.binary`),ke(o,`${i}.objectMode`),oe(e)||oe(t)?"asyncGenerator":"generator"},"getGeneratorObjectType"),ke=r((e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},"checkBooleanOption"),cs=r(e=>oe(e)||ls(e),"isGenerator"),oe=r(e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]","isAsyncGenerator"),ls=r(e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]","isSyncGenerator"),gu=r(e=>T(e)&&(e.transform!==void 0||e.final!==void 0),"isTransformOptions"),jt=r(e=>Object.prototype.toString.call(e)==="[object URL]","isUrl"),us=r(e=>jt(e)&&e.protocol!=="file:","isRegularUrl"),Su=r(e=>T(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>yu.has(t))&&Kn(e.file),"isFilePathObject"),yu=new Set(["file","append"]),Kn=r(e=>typeof e=="string","isFilePathString"),Ge=r(e=>T(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>bu.has(t))&&"value"in e,"isStdioValueObject"),bu=new Set(["value","input"]),ps=r((e,t)=>e==="native"&&typeof t=="string"&&!wu.has(t),"isUnknownStdioString"),wu=new Set(["ipc","ignore","inherit","overlapped","pipe"]),ds=r(e=>Object.prototype.toString.call(e)==="[object ReadableStream]","isReadableStream"),kt=r(e=>Object.prototype.toString.call(e)==="[object WritableStream]","isWritableStream"),xu=r(e=>ds(e)||kt(e),"isWebStream"),Yn=r(e=>ds(e?.readable)&&kt(e?.writable),"isTransformStream"),Eu=r(e=>fs(e)&&typeof e[Symbol.asyncIterator]=="function","isAsyncIterableObject"),Tu=r(e=>fs(e)&&typeof e[Symbol.iterator]=="function","isIterableObject"),fs=r(e=>typeof e=="object"&&e!==null,"isObject"),B=new Set(["generator","asyncGenerator","duplex","webTransform"]),Gt=new Set(["fileUrl","filePath","fileNumber"]),Xn=new Set(["fileUrl","filePath"]),ms=new Set([...Xn,"webStream","nodeStream"]),hs=new Set(["webTransform","duplex"]),q={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var Jn=r((e,t,n,o)=>o==="output"?Ou(e,t,n):Au(e,t,n),"getTransformObjectModes"),Ou=r((e,t,n)=>{let o=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:o,readableObjectMode:e??o}},"getOutputObjectModes"),Au=r((e,t,n)=>{let o=t===0?e===!0:n[t-1].value.readableObjectMode,i=t!==n.length-1&&(e??o);return{writableObjectMode:o,readableObjectMode:i}},"getInputObjectModes"),gs=r((e,t)=>{let n=e.findLast(({type:o})=>B.has(o));return n===void 0?!1:t==="input"?n.value.writableObjectMode:n.value.readableObjectMode},"getFdObjectMode");var Ss=r((e,t,n,o)=>[...e.filter(({type:i})=>!B.has(i)),...Iu(e,t,n,o)],"normalizeTransforms"),Iu=r((e,t,n,{encoding:o})=>{let i=e.filter(({type:a})=>B.has(a)),s=Array.from({length:i.length});for(let[a,c]of Object.entries(i))s[a]=Du({stdioItem:c,index:Number(a),newTransforms:s,optionName:t,direction:n,encoding:o});return Pu(s,n)},"getTransforms"),Du=r(({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:o,optionName:i,direction:s,encoding:a})=>t==="duplex"?Ru({stdioItem:e,optionName:i}):t==="webTransform"?Mu({stdioItem:e,index:n,newTransforms:o,direction:s}):Cu({stdioItem:e,index:n,newTransforms:o,direction:s,encoding:a}),"normalizeTransform"),Ru=r(({stdioItem:e,optionName:t})=>{let{value:n}=e,{transform:o}=n,{writableObjectMode:i,readableObjectMode:s}=o,{objectMode:a=s}=n;if(a&&!s)throw new TypeError(`The \`${t}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!a&&s)throw new TypeError(`The \`${t}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:o,writableObjectMode:i,readableObjectMode:s}}},"normalizeDuplex"),Mu=r(({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:o,direction:i})=>{let{transform:s,objectMode:a}=T(t)?t:{transform:t},{writableObjectMode:c,readableObjectMode:l}=Jn(a,n,o,i);return{...e,value:{transform:s,writableObjectMode:c,readableObjectMode:l}}},"normalizeTransformStream"),Cu=r(({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:o,direction:i,encoding:s})=>{let{transform:a,final:c,binary:l=!1,preserveNewlines:d=!1,objectMode:f}=T(t)?t:{transform:t},u=l||M.has(s),{writableObjectMode:p,readableObjectMode:m}=Jn(f,n,o,i);return{...e,value:{transform:a,final:c,binary:u,preserveNewlines:d,writableObjectMode:p,readableObjectMode:m}}},"normalizeGenerator"),Pu=r((e,t)=>t==="input"?e.reverse():e,"sortTransforms");import Qn from"node:process";var bs=r((e,t,n)=>{let o=e.map(i=>Lu(i,t));if(o.includes("input")&&o.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return o.find(Boolean)??Uu},"getStreamDirection"),Lu=r((e,t)=>Fu[t]??Bu(e),"getStdioItemDirection"),Bu=r(({type:e,value:t,direction:n,optionName:o})=>{let i=ys[e](t);if(n==="input"&&i==="output")throw new TypeError(`The \`${o}\` option is invalid: \`input: true\` cannot be used with a writable value, which is always an output.`);return n??i},"getRequestedDirection"),Fu=["input","output","output"],xe=r(()=>{},"anyDirection"),Zn=r(()=>"input","alwaysInput"),ys={generator:xe,asyncGenerator:xe,fileUrl:xe,filePath:xe,iterable:Zn,asyncIterable:Zn,uint8Array:Zn,webStream:r(e=>kt(e)?"output":"input","webStream"),nodeStream(e){return re(e,{checkOpen:!1})?jn(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:xe,duplex:xe,native(e){let t=_u(e);if(t!==void 0)return t;if(v(e,{checkOpen:!1}))return ys.nodeStream(e)}},_u=r(e=>{if([0,Qn.stdin].includes(e))return"input";if([1,2,Qn.stdout,Qn.stderr].includes(e))return"output"},"getStandardStreamDirection"),Uu="output";var ws=r((e,t)=>t?[...e,"ipc"]:e,"normalizeIpcStdioArray");var Os=r(({stdio:e,ipc:t,buffer:n,...o},i,s)=>{let a=Nu(e,o).map((c,l)=>Es(c,l));return $u(a),s?ku(a,n,i):ws(a,t)},"normalizeStdioOption"),$u=r(e=>{if(e.some(t=>vu(t)))throw new Error("The `ipc: true` option must be used instead of `stdio: 'ipc'`.")},"validateIpcStdioOption"),vu=r(e=>Array.isArray(e)?e.some(t=>xs(t)):xs(e),"hasIpcStdioOption"),xs=r(e=>Ge(e)?e.value==="ipc":e==="ipc","hasIpcStdioItem"),Nu=r((e,t)=>{if(e===void 0)return L.map(o=>t[o]);if(ju(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${L.map(o=>`\`${o}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let n=Math.max(e.length,L.length);return Array.from({length:n},(o,i)=>e[i])},"getStdioArray"),ju=r(e=>L.some(t=>e[t]!==void 0),"hasAlias"),Es=r((e,t)=>Array.isArray(e)?e.map(n=>Es(n,t)):e??(t>=L.length?"ignore":"pipe"),"addDefaultValue"),ku=r((e,t,n)=>e.map((o,i)=>!t[i]&&i!==0&&!le(n,i)&&Gu(o,i)?"ignore":o),"normalizeStdioSync"),Gu=r((e,t)=>Ts(e,t)||Array.isArray(e)&&e.every(n=>Ts(n,t)),"isOutputPipeOnly"),Ts=r((e,t)=>e==="pipe"||Wu(e,t),"isOutputPipe"),Wu=r((e,t)=>Ge(e)&&e.value==="pipe"&&(e.input===void 0||e.input===!1||zu(t,e.input)),"isOutputPipeObject"),zu=r((e,t)=>t===!0&&(e===1||e===2),"isFixedOutputPipe");var zt=r((e,t="stdin")=>{let{options:o,fileDescriptors:i}=W.get(e),s=As(i,t,!0),a=e.stdio[s];if(a===null)throw new TypeError(Is(s,t,o,!0));return a},"getToStream"),Ee=r((e,t="stdout")=>{let{options:o,fileDescriptors:i}=W.get(e),s=As(i,t,!1),a=s==="all"?e.all:e.stdio[s];if(a==null)throw new TypeError(Is(s,t,o,!1));return a},"getFromStream"),W=new WeakMap,As=r((e,t,n)=>{let o=Vu(t,n);return Yu(o,t,n,e),o},"getFdNumber"),Vu=r((e,t)=>{let n=xn(e);if(n!==void 0)return n;let{validOptions:o,defaultValue:i}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${We(t)}" must not be "${e}".
35
35
  It must be ${o} or "fd3", "fd4" (and so on).
36
- It is optional and defaults to "${i}".`)},"parseFdNumber"),zu=n((e,t,r,o)=>{let i=o[Es(e)];if(i===void 0)throw new TypeError(`"${Ne(r)}" must not be ${t}. That file descriptor does not exist.
37
- Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${Ne(r)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${Ne(r)}" must not be ${t}. It must be a writable stream, not readable.
38
- If you meant to use it as input, please set its "stdio" option to \`{value: 'pipe', input: true}\`.`)},"validateFdNumber"),xs=n((e,t,r,o)=>{if(e==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:s}=Vu(e,r);return`The "${i}: ${kt(s)}" option is incompatible with using "${Ne(o)}: ${kt(t)}".
39
- Please set this option with "pipe" instead.`},"getInvalidStdioOptionMessage"),Vu=n((e,{stdin:t,stdout:r,stderr:o,stdio:i})=>{let s=Es(e);return s===0&&t!==void 0?{optionName:"stdin",optionValue:t}:s===1&&r!==void 0?{optionName:"stdout",optionValue:r}:s===2&&o!==void 0?{optionName:"stderr",optionValue:o}:{optionName:`stdio[${s}]`,optionValue:i[s]}},"getInvalidStdioOption"),Es=n(e=>e==="all"?1:e,"getUsedDescriptor"),Ne=n(e=>e?"to":"from","getOptionName"),kt=n(e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream","serializeOptionValue");import{readFileSync as Yu}from"node:fs";import Hu from"node:tty";var Os=n(({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:o,direction:i,isSync:s})=>!r||t!=="native"?e:s?Ku({stdioItem:e,fdNumber:o,direction:i}):Qu({stdioItem:e,fdNumber:o}),"handleNativeStream"),Ku=n(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:o,direction:i})=>{let s=Xu({value:t,optionName:r,fdNumber:o,direction:i});if(s!==void 0)return s;if(B(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},"handleNativeStreamSync"),Xu=n(({value:e,optionName:t,fdNumber:r,direction:o})=>{let i=Ju(e,r);if(i!==void 0){if(o==="output")return{type:"fileNumber",value:i,optionName:t};if(Hu.isatty(i))throw new TypeError(`The \`${t}: ${kt(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:N(Yu(i)),optionName:t}}},"getTargetFd"),Ju=n((e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let r=Qe.indexOf(e);if(r!==-1)return r},"getTargetFdNumber"),Qu=n(({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:o})=>t==="inherit"?{type:"nodeStream",value:Ts(o,t,r),optionName:r}:typeof t=="number"?{type:"nodeStream",value:Ts(t,t,r),optionName:r}:B(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,"handleNativeStreamAsync"),Ts=n((e,t,r)=>{let o=Qe[e];if(o===void 0)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return o},"getStandardStream");var As=n(({input:e,inputFile:t},r)=>r===0?[...Zu(e),...ep(t)]:[],"handleInputOptions"),Zu=n(e=>e===void 0?[]:[{type:qu(e),value:e,optionName:"input"}],"handleInputOption"),qu=n(e=>{if(Z(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(T(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},"getInputType"),ep=n(e=>e===void 0?[]:[{...tp(e),optionName:"inputFile"}],"handleInputFileOption"),tp=n(e=>{if($t(e))return{type:"fileUrl",value:e};if(Gr(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},"getInputFileType");var Rs=n(e=>e.filter((t,r)=>e.every((o,i)=>!rp(t,o)||r>=i||t.type==="generator"||t.type==="asyncGenerator")),"filterDuplicates"),rp=n((e,t)=>e.value===t.value&&e.direction===t.direction,"hasSameValueAndDirection"),Ms=n(({stdioItem:{type:e,value:t,optionName:r},direction:o,fileDescriptors:i,isSync:s})=>{let a=np(i,e);if(a.length!==0){if(s){op({otherStdioItems:a,type:e,value:t,optionName:r,direction:o});return}if(ls.has(e))return Ds({otherStdioItems:a,type:e,value:t,optionName:r,direction:o});ds.has(e)&&sp({otherStdioItems:a,type:e,value:t,optionName:r})}},"getDuplicateStream"),np=n((e,t)=>e.flatMap(({direction:r,stdioItems:o})=>o.filter(i=>i.type===t).map((i=>({...i,direction:r})))),"getOtherStdioItems"),op=n(({otherStdioItems:e,type:t,value:r,optionName:o,direction:i})=>{Wr.has(t)&&Ds({otherStdioItems:e,type:t,value:r,optionName:o,direction:i})},"validateDuplicateStreamSync"),Ds=n(({otherStdioItems:e,type:t,value:r,optionName:o,direction:i})=>{let s=e.filter(c=>ip(c,r));if(s.length===0)return;let a=s.find(c=>c.direction!==i);return Is(a,o,t),i==="output"?s[0].stream:void 0},"getDuplicateStreamInstance"),ip=n(({type:e,value:t},r)=>e==="filePath"?t.file===r.file:e==="fileUrl"?t.href===r.href:t===r,"hasSameValue"),sp=n(({otherStdioItems:e,type:t,value:r,optionName:o})=>{let i=e.find(({value:{transform:s}})=>s===r.transform);Is(i,o,t)},"validateDuplicateTransform"),Is=n((e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${K[r]} that is the same.`)},"throwOnDuplicateStream");var Wt=n((e,t,r,o)=>{let s=bs(t,r,o).map((c,l)=>ap({stdioOption:c,fdNumber:l,options:t,isSync:o})),a=Sp({initialFileDescriptors:s,addProperties:e,options:t,isSync:o});return t.stdio=a.map(({stdioItems:c})=>xp(c)),a},"handleStdio"),ap=n(({stdioOption:e,fdNumber:t,options:r,isSync:o})=>{let i=Ze(t),{stdioItems:s,isStdioArray:a}=cp({stdioOption:e,fdNumber:t,options:r,optionName:i}),c=ms(s,t,i),l=s.map(u=>Os({stdioItem:u,isStdioArray:a,fdNumber:t,direction:c,isSync:o})),d=us(l,i,c,r),f=fs(d,c);return yp(d,f),{direction:c,objectMode:f,stdioItems:d}},"getFileDescriptor"),cp=n(({stdioOption:e,fdNumber:t,options:r,optionName:o})=>{let i=Array.isArray(e)?e:[e],s=As(r,t),a=[...lp(i.map(d=>fp(d,o)),s),...s],c=Rs(a),l=c.length>1;return pp(c,l,o),hp(c),{stdioItems:c,isStdioArray:l}},"initializeStdioItems"),lp=n((e,t)=>t.length>0&&dp(e)?[]:e,"omitInheritedStdin"),dp=n(e=>e.length===1&&e[0].type==="native"&&e[0].value==="inherit","isInheritedStdinOnly"),fp=n((e,t)=>je(e)?up(e,t):{type:kr(e,t),value:e,optionName:t},"initializeStdioItem"),up=n(({value:e,input:t},r)=>($e(t,`${r}.input`),{type:kr(e,r),value:e,direction:t?"input":void 0,optionName:r}),"initializeStdioValueObject"),pp=n((e,t,r)=>{if(e.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t){for(let{value:o,optionName:i}of e)if(mp.has(o))throw new Error(`The \`${i}\` option must not include \`${o}\`.`)}},"validateStdioArray"),mp=new Set(["ignore"]),hp=n(e=>{for(let t of e)gp(t)},"validateStreams"),gp=n(({type:e,value:t,optionName:r})=>{if(as(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
40
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(cs(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},"validateFileStdio"),yp=n((e,t)=>{if(!t)return;let r=e.find(({type:o})=>Nt.has(o));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},"validateFileObjectMode"),Sp=n(({initialFileDescriptors:e,addProperties:t,options:r,isSync:o})=>{let i=[];try{for(let s of e)i.push(bp({fileDescriptor:s,fileDescriptors:i,addProperties:t,options:r,isSync:o}));return i}catch(s){throw Hr(i),s}},"getFinalFileDescriptors"),bp=n(({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:o,addProperties:i,options:s,isSync:a})=>{let c=r.map(l=>wp({stdioItem:l,addProperties:i,direction:e,options:s,fileDescriptors:o,isSync:a}));return{direction:e,objectMode:t,stdioItems:c}},"getFinalFileDescriptor"),wp=n(({stdioItem:e,addProperties:t,direction:r,options:o,fileDescriptors:i,isSync:s})=>{let a=Ms({stdioItem:e,direction:r,fileDescriptors:i,isSync:s});return a!==void 0?{...e,stream:a}:{...e,...t[r][e.type](e,o)}},"addStreamProperties"),Hr=n(e=>{for(let{stdioItems:t}of e)for(let{stream:r}of t)r!==void 0&&!C(r)&&r.destroy()},"cleanupCustomStreams"),xp=n(e=>{if(e.length>1)return e.some(({value:o})=>o==="overlapped")?"overlapped":"pipe";let[{type:t,value:r}]=e;return t==="native"?r:"pipe"},"forwardStdio");import{readFileSync as Cs}from"node:fs";var Fs=n((e,t)=>Wt(Tp,e,t,!0),"handleStdioSync"),$=n(({type:e,optionName:t})=>{Ls(t,K[e])},"forbiddenIfSync"),Ps=n(({optionName:e,value:t})=>(t==="overlapped"&&Ls(e,`"${t}"`),{}),"forbiddenNativeIfSync"),Ep=n(e=>{let{optionName:t,value:r}=e;if(r==="pipe"&&t!=="stdin")throw new TypeError(`Only the \`stdin\` option, not \`${t}\`, can be an input pipe with synchronous methods.`);return Ps(e)},"forbiddenNativeInputIfSync"),Ls=n((e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},"throwInvalidSyncValue"),Bs={generator(){},asyncGenerator:$,webStream:$,nodeStream:$,webTransform:$,duplex:$,asyncIterable:$,native:Ps},Tp={input:{...Bs,native:Ep,fileUrl:n(({value:e})=>({contents:[N(Cs(e))]}),"fileUrl"),filePath:n(({value:{file:e}})=>({contents:[N(Cs(e))]}),"filePath"),fileNumber:$,iterable:n(({value:e})=>({contents:[...e]}),"iterable"),string:n(({value:e})=>({contents:[e]}),"string"),uint8Array:n(({value:e})=>({contents:[e]}),"uint8Array")},output:{...Bs,fileUrl:n(({value:e})=>({path:e}),"fileUrl"),filePath:n(({value:{file:e,append:t}})=>({path:e,append:t}),"filePath"),fileNumber:n(({value:e})=>({path:e}),"fileNumber"),iterable:$,string:$,uint8Array:$}};var z=n((e,{stripFinalNewline:t},r)=>Kr(t,r)&&e!==void 0&&!Array.isArray(e)?me(e):e,"stripNewline"),Kr=n((e,t)=>t==="all"?e[1]||e[2]:e[t],"getStripFinalNewline");var zt=n((e,t,r,o)=>e||r?void 0:_s(t,o),"getSplitLinesGenerator"),Jr=n((e,t,r)=>r?e.flatMap(o=>Us(o,t)):Us(e,t),"splitLinesSync"),Us=n((e,t)=>{let{transform:r,final:o}=_s(t,{});return[...r(e),...o()]},"splitLinesItemSync"),_s=n((e,t)=>(t.previousChunks="",{transform:Op.bind(void 0,t,e),final:Dp.bind(void 0,t)}),"initializeSplitLines"),Op=n(function*(e,t,r){if(typeof r!="string"){yield r;return}let{previousChunks:o}=e,i=-1;for(let s=0;s<r.length;s+=1){if(r[s]!==`
41
- `)continue;let a=Ap(r,s,t,e),c=r.slice(i+1,s+1-a);o.length>0&&(c=Xr(o,c),o=""),yield c,i=s}i!==r.length-1&&(o=Xr(o,r.slice(i+1))),e.previousChunks=o},"splitGenerator"),Ap=n((e,t,r,o)=>r?0:(o.isWindowsNewline=t!==0&&e[t-1]==="\r",o.isWindowsNewline?2:1),"getNewlineLength"),Dp=n(function*({previousChunks:e}){e.length>0&&(yield e)},"linesFinal"),vs=n(({binary:e,preserveNewlines:t,readableObjectMode:r,state:o})=>e||t||r?void 0:{transform:Ip.bind(void 0,o)},"getAppendNewlineGenerator"),Ip=n(function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:o,LF:i,concatBytes:s}=typeof t=="string"?Rp:Cp;if(t.at(-1)===i){yield t;return}yield s(t,e?o:r)},"appendNewlineGenerator"),Xr=n((e,t)=>`${e}${t}`,"concatString"),Rp={windowsNewline:`\r
36
+ It is optional and defaults to "${i}".`)},"parseFdNumber"),Yu=r((e,t,n,o)=>{let i=o[Ds(e)];if(i===void 0)throw new TypeError(`"${We(n)}" must not be ${t}. That file descriptor does not exist.
37
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!n)throw new TypeError(`"${We(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&n)throw new TypeError(`"${We(n)}" must not be ${t}. It must be a writable stream, not readable.
38
+ If you meant to use it as input, please set its "stdio" option to \`{value: 'pipe', input: true}\`.`)},"validateFdNumber"),Is=r((e,t,n,o)=>{if(e==="all"&&!n.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:s}=Hu(e,n);return`The "${i}: ${Wt(s)}" option is incompatible with using "${We(o)}: ${Wt(t)}".
39
+ Please set this option with "pipe" instead.`},"getInvalidStdioOptionMessage"),Hu=r((e,{stdin:t,stdout:n,stderr:o,stdio:i})=>{let s=Ds(e);return s===0&&t!==void 0?{optionName:"stdin",optionValue:t}:s===1&&n!==void 0?{optionName:"stdout",optionValue:n}:s===2&&o!==void 0?{optionName:"stderr",optionValue:o}:{optionName:`stdio[${s}]`,optionValue:i[s]}},"getInvalidStdioOption"),Ds=r(e=>e==="all"?1:e,"getUsedDescriptor"),We=r(e=>e?"to":"from","getOptionName"),Wt=r(e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream","serializeOptionValue");import{readFileSync as Ku}from"node:fs";import Xu from"node:tty";var Ms=r(({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:o,direction:i,isSync:s})=>!n||t!=="native"?e:s?Ju({stdioItem:e,fdNumber:o,direction:i}):qu({stdioItem:e,fdNumber:o}),"handleNativeStream"),Ju=r(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:o,direction:i})=>{let s=Qu({value:t,optionName:n,fdNumber:o,direction:i});if(s!==void 0)return s;if(v(t,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},"handleNativeStreamSync"),Qu=r(({value:e,optionName:t,fdNumber:n,direction:o})=>{let i=Zu(e,n);if(i!==void 0){if(o==="output")return{type:"fileNumber",value:i,optionName:t};if(Xu.isatty(i))throw new TypeError(`The \`${t}: ${Wt(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Y(Ku(i)),optionName:t}}},"getTargetFd"),Zu=r((e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let n=qe.indexOf(e);if(n!==-1)return n},"getTargetFdNumber"),qu=r(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:o})=>t==="inherit"?{type:"nodeStream",value:Rs(o,t,n),optionName:n}:typeof t=="number"?{type:"nodeStream",value:Rs(t,t,n),optionName:n}:v(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:n}:e,"handleNativeStreamAsync"),Rs=r((e,t,n)=>{let o=qe[e];if(o===void 0)throw new TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return o},"getStandardStream");var Cs=r(({input:e,inputFile:t},n)=>n===0?[...ep(e),...np(t)]:[],"handleInputOptions"),ep=r(e=>e===void 0?[]:[{type:tp(e),value:e,optionName:"input"}],"handleInputOption"),tp=r(e=>{if(re(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(O(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},"getInputType"),np=r(e=>e===void 0?[]:[{...rp(e),optionName:"inputFile"}],"handleInputFileOption"),rp=r(e=>{if(jt(e))return{type:"fileUrl",value:e};if(Kn(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},"getInputFileType");var Bs=r(e=>e.filter((t,n)=>e.every((o,i)=>!op(t,o)||n>=i||t.type==="generator"||t.type==="asyncGenerator")),"filterDuplicates"),op=r((e,t)=>e.value===t.value&&e.direction===t.direction,"hasSameValueAndDirection"),Fs=r(({stdioItem:{type:e,value:t,optionName:n},direction:o,fileDescriptors:i,isSync:s})=>{let a=ip(i,e);if(a.length!==0){if(s){sp({otherStdioItems:a,type:e,value:t,optionName:n,direction:o});return}if(ms.has(e))return Ps({otherStdioItems:a,type:e,value:t,optionName:n,direction:o});hs.has(e)&&cp({otherStdioItems:a,type:e,value:t,optionName:n})}},"getDuplicateStream"),ip=r((e,t)=>e.flatMap(({direction:n,stdioItems:o})=>o.filter(i=>i.type===t).map((i=>({...i,direction:n})))),"getOtherStdioItems"),sp=r(({otherStdioItems:e,type:t,value:n,optionName:o,direction:i})=>{Xn.has(t)&&Ps({otherStdioItems:e,type:t,value:n,optionName:o,direction:i})},"validateDuplicateStreamSync"),Ps=r(({otherStdioItems:e,type:t,value:n,optionName:o,direction:i})=>{let s=e.filter(c=>ap(c,n));if(s.length===0)return;let a=s.find(c=>c.direction!==i);return Ls(a,o,t),i==="output"?s[0].stream:void 0},"getDuplicateStreamInstance"),ap=r(({type:e,value:t},n)=>e==="filePath"?t.file===n.file:e==="fileUrl"?t.href===n.href:t===n,"hasSameValue"),cp=r(({otherStdioItems:e,type:t,value:n,optionName:o})=>{let i=e.find(({value:{transform:s}})=>s===n.transform);Ls(i,o,t)},"validateDuplicateTransform"),Ls=r((e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${q[n]} that is the same.`)},"throwOnDuplicateStream");var Vt=r((e,t,n,o)=>{let s=Os(t,n,o).map((c,l)=>lp({stdioOption:c,fdNumber:l,options:t,isSync:o})),a=wp({initialFileDescriptors:s,addProperties:e,options:t,isSync:o});return t.stdio=a.map(({stdioItems:c})=>Tp(c)),a},"handleStdio"),lp=r(({stdioOption:e,fdNumber:t,options:n,isSync:o})=>{let i=et(t),{stdioItems:s,isStdioArray:a}=dp({stdioOption:e,fdNumber:t,options:n,optionName:i}),c=bs(s,t,i),l=s.map(u=>Ms({stdioItem:u,isStdioArray:a,fdNumber:t,direction:c,isSync:o})),d=Ss(l,i,c,n),f=gs(d,c);return bp(d,f),{direction:c,objectMode:f,stdioItems:d}},"getFileDescriptor"),dp=r(({stdioOption:e,fdNumber:t,options:n,optionName:o})=>{let i=Array.isArray(e)?e:[e],s=Cs(n,t),a=[...fp(i.map(d=>pp(d,o)),s),...s],c=Bs(a),l=c.length>1;return hp(c,l,o),Sp(c),{stdioItems:c,isStdioArray:l}},"initializeStdioItems"),fp=r((e,t)=>t.length>0&&up(e)?[]:e,"omitInheritedStdin"),up=r(e=>e.length===1&&e[0].type==="native"&&e[0].value==="inherit","isInheritedStdinOnly"),pp=r((e,t)=>Ge(e)?mp(e,t):{type:Hn(e,t),value:e,optionName:t},"initializeStdioItem"),mp=r(({value:e,input:t},n)=>(ke(t,`${n}.input`),{type:Hn(e,n),value:e,direction:t?"input":void 0,optionName:n}),"initializeStdioValueObject"),hp=r((e,t,n)=>{if(e.length===0)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(let{value:o,optionName:i}of e)if(gp.has(o))throw new Error(`The \`${i}\` option must not include \`${o}\`.`)}},"validateStdioArray"),gp=new Set(["ignore"]),Sp=r(e=>{for(let t of e)yp(t)},"validateStreams"),yp=r(({type:e,value:t,optionName:n})=>{if(us(t))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
40
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(ps(e,t))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},"validateFileStdio"),bp=r((e,t)=>{if(!t)return;let n=e.find(({type:o})=>Gt.has(o));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},"validateFileObjectMode"),wp=r(({initialFileDescriptors:e,addProperties:t,options:n,isSync:o})=>{let i=[];try{for(let s of e)i.push(xp({fileDescriptor:s,fileDescriptors:i,addProperties:t,options:n,isSync:o}));return i}catch(s){throw qn(i),s}},"getFinalFileDescriptors"),xp=r(({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:o,addProperties:i,options:s,isSync:a})=>{let c=n.map(l=>Ep({stdioItem:l,addProperties:i,direction:e,options:s,fileDescriptors:o,isSync:a}));return{direction:e,objectMode:t,stdioItems:c}},"getFinalFileDescriptor"),Ep=r(({stdioItem:e,addProperties:t,direction:n,options:o,fileDescriptors:i,isSync:s})=>{let a=Fs({stdioItem:e,direction:n,fileDescriptors:i,isSync:s});return a!==void 0?{...e,stream:a}:{...e,...t[n][e.type](e,o)}},"addStreamProperties"),qn=r(e=>{for(let{stdioItems:t}of e)for(let{stream:n}of t)n!==void 0&&!_(n)&&n.destroy()},"cleanupCustomStreams"),Tp=r(e=>{if(e.length>1)return e.some(({value:o})=>o==="overlapped")?"overlapped":"pipe";let[{type:t,value:n}]=e;return t==="native"?n:"pipe"},"forwardStdio");import{readFileSync as _s}from"node:fs";var Ns=r((e,t)=>Vt(Ap,e,t,!0),"handleStdioSync"),z=r(({type:e,optionName:t})=>{$s(t,q[e])},"forbiddenIfSync"),Us=r(({optionName:e,value:t})=>(t==="overlapped"&&$s(e,`"${t}"`),{}),"forbiddenNativeIfSync"),Op=r(e=>{let{optionName:t,value:n}=e;if(n==="pipe"&&t!=="stdin")throw new TypeError(`Only the \`stdin\` option, not \`${t}\`, can be an input pipe with synchronous methods.`);return Us(e)},"forbiddenNativeInputIfSync"),$s=r((e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},"throwInvalidSyncValue"),vs={generator(){},asyncGenerator:z,webStream:z,nodeStream:z,webTransform:z,duplex:z,asyncIterable:z,native:Us},Ap={input:{...vs,native:Op,fileUrl:r(({value:e})=>({contents:[Y(_s(e))]}),"fileUrl"),filePath:r(({value:{file:e}})=>({contents:[Y(_s(e))]}),"filePath"),fileNumber:z,iterable:r(({value:e})=>({contents:[...e]}),"iterable"),string:r(({value:e})=>({contents:[e]}),"string"),uint8Array:r(({value:e})=>({contents:[e]}),"uint8Array")},output:{...vs,fileUrl:r(({value:e})=>({path:e}),"fileUrl"),filePath:r(({value:{file:e,append:t}})=>({path:e,append:t}),"filePath"),fileNumber:r(({value:e})=>({path:e}),"fileNumber"),iterable:z,string:z,uint8Array:z}};var J=r((e,{stripFinalNewline:t},n)=>er(t,n)&&e!==void 0&&!Array.isArray(e)?Se(e):e,"stripNewline"),er=r((e,t)=>t==="all"?e[1]||e[2]:e[t],"getStripFinalNewline");var Yt=r((e,t,n,o)=>e||n?void 0:ks(t,o),"getSplitLinesGenerator"),nr=r((e,t,n)=>n?e.flatMap(o=>js(o,t)):js(e,t),"splitLinesSync"),js=r((e,t)=>{let{transform:n,final:o}=ks(t,{});return[...n(e),...o()]},"splitLinesItemSync"),ks=r((e,t)=>(t.previousChunks="",{transform:Ip.bind(void 0,t,e),final:Rp.bind(void 0,t)}),"initializeSplitLines"),Ip=r(function*(e,t,n){if(typeof n!="string"){yield n;return}let{previousChunks:o}=e,i=-1;for(let s=0;s<n.length;s+=1){if(n[s]!==`
41
+ `)continue;let a=Dp(n,s,t,e),c=n.slice(i+1,s+1-a);o.length>0&&(c=tr(o,c),o=""),yield c,i=s}i!==n.length-1&&(o=tr(o,n.slice(i+1))),e.previousChunks=o},"splitGenerator"),Dp=r((e,t,n,o)=>n?0:(o.isWindowsNewline=t!==0&&e[t-1]==="\r",o.isWindowsNewline?2:1),"getNewlineLength"),Rp=r(function*({previousChunks:e}){e.length>0&&(yield e)},"linesFinal"),Gs=r(({binary:e,preserveNewlines:t,readableObjectMode:n,state:o})=>e||t||n?void 0:{transform:Mp.bind(void 0,o)},"getAppendNewlineGenerator"),Mp=r(function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:o,LF:i,concatBytes:s}=typeof t=="string"?Cp:Lp;if(t.at(-1)===i){yield t;return}yield s(t,e?o:n)},"appendNewlineGenerator"),tr=r((e,t)=>`${e}${t}`,"concatString"),Cp={windowsNewline:`\r
42
42
  `,unixNewline:`
43
43
  `,LF:`
44
- `,concatBytes:Xr},Mp=n((e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},"concatUint8Array"),Cp={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Mp};import{Buffer as Pp}from"node:buffer";var js=n((e,t)=>e?void 0:Lp.bind(void 0,t),"getValidateTransformInput"),Lp=n(function*(e,t){if(typeof t!="string"&&!T(t)&&!Pp.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},"validateStringTransformInput"),Ns=n((e,t)=>e?Bp.bind(void 0,t):Fp.bind(void 0,t),"getValidateTransformReturn"),Bp=n(function*(e,t){$s(e,t),yield t},"validateObjectTransformReturn"),Fp=n(function*(e,t){if($s(e,t),typeof t!="string"&&!T(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},"validateStringTransformReturn"),$s=n((e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
44
+ `,concatBytes:tr},Pp=r((e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},"concatUint8Array"),Lp={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Pp};import{Buffer as Bp}from"node:buffer";var zs=r((e,t)=>e?void 0:Fp.bind(void 0,t),"getValidateTransformInput"),Fp=r(function*(e,t){if(typeof t!="string"&&!O(t)&&!Bp.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},"validateStringTransformInput"),Vs=r((e,t)=>e?_p.bind(void 0,t):Up.bind(void 0,t),"getValidateTransformReturn"),_p=r(function*(e,t){Ws(e,t),yield t},"validateObjectTransformReturn"),Up=r(function*(e,t){if(Ws(e,t),typeof t!="string"&&!O(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},"validateStringTransformReturn"),Ws=r((e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
45
45
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
46
- if (condition) { yield value; }`)},"validateEmptyReturn");import{Buffer as Up}from"node:buffer";import{StringDecoder as _p}from"node:string_decoder";var Vt=n((e,t,r)=>{if(r)return;if(e)return{transform:vp.bind(void 0,new TextEncoder)};let o=new _p(t);return{transform:$p.bind(void 0,o),final:jp.bind(void 0,o)}},"getEncodingTransformGenerator"),vp=n(function*(e,t){Up.isBuffer(t)?yield N(t):typeof t=="string"?yield e.encode(t):yield t},"encodingUint8ArrayGenerator"),$p=n(function*(e,t){yield T(t)?e.write(t):t},"encodingStringGenerator"),jp=n(function*(e){let t=e.end();t!==""&&(yield t)},"encodingStringFinal");import{callbackify as ks}from"node:util";var Qr=ks(async(e,t,r,o)=>{t.currentIterable=e(...r);try{for await(let i of t.currentIterable)o.push(i)}finally{delete t.currentIterable}}),Yt=n(async function*(e,t,r){if(r===t.length){yield e;return}let{transform:o=kp}=t[r];for await(let i of o(e))yield*Yt(i,t,r+1)},"transformChunk"),Gs=n(async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*Np(r,Number(t),e)},"finalChunks"),Np=n(async function*(e,t,r){if(e!==void 0)for await(let o of e())yield*Yt(o,r,t+1)},"generatorFinalChunks"),Ws=ks(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),kp=n(function*(e){yield e},"identityGenerator");var Zr=n((e,t,r,o)=>{try{for(let i of e(...t))r.push(i);o()}catch(i){o(i)}},"pushChunksSync"),zs=n((e,t)=>[...t.flatMap(r=>[...ee(r,e,0)]),...ke(e)],"runTransformSync"),ee=n(function*(e,t,r){if(r===t.length){yield e;return}let{transform:o=Wp}=t[r];for(let i of o(e))yield*ee(i,t,r+1)},"transformChunkSync"),ke=n(function*(e){for(let[t,{final:r}]of Object.entries(e))yield*Gp(r,Number(t),e)},"finalChunksSync"),Gp=n(function*(e,t,r){if(e!==void 0)for(let o of e())yield*ee(o,r,t+1)},"generatorFinalChunksSync"),Wp=n(function*(e){yield e},"identityGenerator");import{Transform as zp,getDefaultHighWaterMark as Vs}from"node:stream";var qr=n(({value:e,value:{transform:t,final:r,writableObjectMode:o,readableObjectMode:i},optionName:s},{encoding:a})=>{let c={},l=Ys(e,a,s),d=q(t),f=q(r),u=d?Qr.bind(void 0,Yt,c):Zr.bind(void 0,ee),p=d||f?Qr.bind(void 0,Gs,c):Zr.bind(void 0,ke),m=d||f?Ws.bind(void 0,c):void 0;return{stream:new zp({writableObjectMode:o,writableHighWaterMark:Vs(o),readableObjectMode:i,readableHighWaterMark:Vs(i),transform(S,b,y){u([S,l,0],this,y)},flush(S){p([l],this,S)},destroy:m})}},"generatorToStream"),Ht=n((e,t,r,o)=>{let i=t.filter(({type:a})=>a==="generator"),s=o?i.reverse():i;for(let{value:a,optionName:c}of s){let l=Ys(a,r,c);e=zs(l,e)}return e},"runGeneratorsSync"),Ys=n(({transform:e,final:t,binary:r,writableObjectMode:o,readableObjectMode:i,preserveNewlines:s},a,c)=>{let l={};return[{transform:js(o,c)},Vt(r,a,o),zt(r,s,o,l),{transform:e,final:t},{transform:Ns(i,c)},vs({binary:r,preserveNewlines:s,readableObjectMode:i,state:l})].filter(Boolean)},"addInternalGenerators");var Hs=n((e,t)=>{for(let r of Vp(e))Yp(e,r,t)},"addInputOptionsSync"),Vp=n(e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),"getInputFdNumbers"),Yp=n((e,t,r)=>{let{stdioItems:o}=e[t],i=o.filter(({contents:c})=>c!==void 0);if(i.length===0)return;if(t!==0){let[{type:c,optionName:l}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${l}\`, can be ${K[c]} with synchronous methods.`)}let a=i.map(({contents:c})=>c).map(c=>Hp(c,o));r.input=De(a)},"addInputOptionSync"),Hp=n((e,t)=>{let r=Ht(e,t,"utf8",!0);return Kp(r),De(r)},"applySingleInputGeneratorsSync"),Kp=n(e=>{let t=e.find(r=>typeof r!="string"&&!T(r));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},"validateSerializable");var Kt=n(({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:o})=>o!=="all"&&se(r,o)&&!D.has(t)&&Xp(o)&&(e.some(({type:i,value:s})=>i==="native"&&Jp.has(s))||e.every(({type:i})=>M.has(i))),"shouldLogOutput"),Xp=n(e=>e===1||e===2,"isFdVerbose"),Jp=new Set(["pipe","overlapped"]),Xs=n(async(e,t,r,o)=>{for await(let i of e)Qp(t)||Ks(i,r,o)},"logLines"),Js=n((e,t,r)=>{for(let o of e)Ks(o,t,r)},"logLinesSync"),Qp=n(e=>e._readableState.pipes.length>0,"isPipingStream"),Ks=n((e,t,r)=>{let o=ot(e);F({type:"output",verboseMessage:o,fdNumber:t,verboseInfo:r})},"logLine");import{writeFileSync as Zp,appendFileSync as qp}from"node:fs";var Qs=n(({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:o,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let s={},a=new Set;return{output:t.map((l,d)=>em({result:l,fileDescriptors:e,fdNumber:d,state:s,outputFiles:a,isMaxBuffer:o,verboseInfo:i},r)),...s}},"transformOutputSync"),em=n(({result:e,fileDescriptors:t,fdNumber:r,state:o,outputFiles:i,isMaxBuffer:s,verboseInfo:a},{buffer:c,encoding:l,lines:d,stripFinalNewline:f,maxBuffer:u})=>{if(e===null)return;let p=Hi(e,s,u),m=N(p),{stdioItems:g,objectMode:S}=t[r],b=tm([m],g,l,o),{serializedResult:y,finalResult:w=y}=rm({chunks:b,objectMode:S,encoding:l,lines:d,stripFinalNewline:f,fdNumber:r});nm({serializedResult:y,fdNumber:r,state:o,verboseInfo:a,encoding:l,stdioItems:g,objectMode:S});let x=c[r]?w:void 0;try{return o.error===void 0&&om(y,g,i),x}catch(O){return o.error=O,x}},"transformOutputResultSync"),tm=n((e,t,r,o)=>{try{return Ht(e,t,r,!1)}catch(i){return o.error=i,e}},"runOutputGeneratorsSync"),rm=n(({chunks:e,objectMode:t,encoding:r,lines:o,stripFinalNewline:i,fdNumber:s})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:De(e)};let a=Gn(e,r);return o[s]?{serializedResult:a,finalResult:Jr(a,!i[s],t)}:{serializedResult:a}},"serializeChunks"),nm=n(({serializedResult:e,fdNumber:t,state:r,verboseInfo:o,encoding:i,stdioItems:s,objectMode:a})=>{if(!Kt({stdioItems:s,encoding:i,verboseInfo:o,fdNumber:t}))return;let c=Jr(e,!1,a);try{Js(c,t,o)}catch(l){r.error??=l}},"logOutputSync"),om=n((e,t,r)=>{let o=t.filter(({type:i})=>Nt.has(i));for(let{path:i,append:s}of o){let a=typeof i=="string"?i:i.toString();s||r.has(a)?qp(i,e):(r.add(a),Zp(i,e))}},"writeToFiles");var Zs=n(([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,z(t,r,"all")]:Array.isArray(t)?[z(e,r,"all"),...t]:T(e)&&T(t)?ur([e,t]):`${e}${t}`},"getAllSync");import{once as en}from"node:events";var ea=n(async(e,t)=>{let[r,o]=await im(e);return t.isForcefullyTerminated??=!1,[r,o]},"waitForExit"),im=n(async e=>{let[t,r]=await Promise.allSettled([en(e,"spawn"),en(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?qs(e):r.value},"waitForExitOrError"),qs=n(async e=>{try{return await en(e,"exit")}catch{return qs(e)}},"waitForSubprocessExit"),ta=n(async e=>{let[t,r]=await e;if(!sm(t,r)&&tn(t,r))throw new P;return[t,r]},"waitForSuccessfulExit"),sm=n((e,t)=>e===void 0&&t===void 0,"isSubprocessErrorExit"),tn=n((e,t)=>e!==0||t!==null,"isFailedExit");var ra=n(({error:e,status:t,signal:r,output:o},{maxBuffer:i})=>{let s=am(e,t,r),a=s?.code==="ETIMEDOUT",c=Yi(s,o,i);return{resultError:s,exitCode:t,signal:r,timedOut:a,isMaxBuffer:c}},"getExitResultSync"),am=n((e,t,r)=>e!==void 0?e:tn(t,r)?new P:void 0,"getResultError");import{spawnSync as cm}from"node:child_process";var na=n((e,t,r)=>{let{file:o,commandArguments:i,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:d,fileDescriptors:f}=lm(e,t,r),u=um({file:o,commandArguments:i,options:d,command:s,escapedCommand:a,verboseInfo:l,fileDescriptors:f,startTime:c});return ye(u,l,d)},"execaCoreSync"),lm=n((e,t,r)=>{let{command:o,escapedCommand:i,startTime:s,verboseInfo:a}=st(e,t,r),c=dm(r),{file:l,commandArguments:d,options:f}=Dt(e,t,c);fm(f);let u=Fs(f,a);return{file:l,commandArguments:d,command:o,escapedCommand:i,startTime:s,verboseInfo:a,options:f,fileDescriptors:u}},"handleSyncArguments"),dm=n(e=>e.node&&!e.ipc?{...e,ipc:!1}:e,"normalizeSyncOptions"),fm=n(({ipc:e,ipcInput:t,detached:r,cancelSignal:o,killDescendants:i})=>{t&&Ge("ipcInput"),e&&Ge("ipc: true"),r&&Ge("detached: true"),i&&Ge("killDescendants: true"),o&&Ge("cancelSignal")},"validateSyncOptions"),Ge=n(e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},"throwInvalidSyncOption"),um=n(({file:e,commandArguments:t,options:r,command:o,escapedCommand:i,verboseInfo:s,fileDescriptors:a,startTime:c})=>{let l=pm({file:e,commandArguments:t,options:r,command:o,escapedCommand:i,fileDescriptors:a,startTime:c});if(l.failed)return l;let{resultError:d,exitCode:f,signal:u,timedOut:p,isMaxBuffer:m}=ra(l,r),{output:g,error:S=d}=Qs({fileDescriptors:a,syncResult:l,options:r,isMaxBuffer:m,verboseInfo:s}),b=g.map((w,x)=>z(w,r,x)),y=z(Zs(g,r),r,"all");return hm({error:S,exitCode:f,signal:u,timedOut:p,isMaxBuffer:m,stdio:b,all:y,options:r,command:o,escapedCommand:i,startTime:c})},"spawnSubprocessSync"),pm=n(({file:e,commandArguments:t,options:r,command:o,escapedCommand:i,fileDescriptors:s,startTime:a})=>{try{Hs(s,r);let c=mm(r);return cm(...It(e,t,c))}catch(c){return ge({error:c,command:o,escapedCommand:i,fileDescriptors:s,options:r,startTime:a,isSync:!0})}},"runSubprocessSync"),mm=n(({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:_t(t)}),"normalizeSpawnSyncOptions"),hm=n(({error:e,exitCode:t,signal:r,timedOut:o,isMaxBuffer:i,stdio:s,all:a,options:c,command:l,escapedCommand:d,startTime:f})=>e===void 0?vt({command:l,escapedCommand:d,stdio:s,all:a,ipcOutput:[],options:c,startTime:f}):ve({error:e,command:l,escapedCommand:d,timedOut:o,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:s,all:a,ipcOutput:[],options:c,startTime:f,isSync:!0}),"getSyncResult");import{once as rn,on as gm}from"node:events";var nn=Symbol("internalGetOneMessageOptions"),oa=n(({anyProcess:e,channel:t,isSubprocess:r,ipc:o},i={})=>{let{reference:s=!0,filter:a}=i,{signal:c}=i[nn]??{};return le({methodName:"getOneMessage",isSubprocess:r,ipc:o,isConnected:yt(e)}),ym({anyProcess:e,channel:t,isSubprocess:r,filter:a,reference:s,signal:c})},"getOneMessage"),ym=n(async({anyProcess:e,channel:t,isSubprocess:r,filter:o,reference:i,signal:s})=>{pt(t,i);let a=H(e,t,r),c=new AbortController;Sm(s,c);try{return await Promise.race([bm(a,o,c),wm(a,r,c),xm(a,r,c)])}catch(l){throw de(e),l}finally{c.abort(),mt(t,i)}},"getOneMessageAsync"),Sm=n((e,t)=>{if(e!==void 0){if(e.aborted){t.abort();return}e.addEventListener("abort",()=>{t.abort()},{once:!0,signal:t.signal})}},"stopOnAbort"),bm=n(async(e,t,{signal:r})=>{if(t===void 0){let[o]=await rn(e,"message",{signal:r});return o}for await(let[o]of gm(e,"message",{signal:r}))if(t(o))return o},"getMessage"),wm=n(async(e,t,{signal:r})=>{await rn(e,"disconnect",{signal:r}),Fo(t)},"throwOnDisconnect"),xm=n(async(e,t,{signal:r})=>{let[o]=await rn(e,"strict:error",{signal:r});throw ut(o,t)},"throwOnStrictError");import{once as ia,on as Em}from"node:events";var on=Symbol("internalGetEachMessageOptions"),aa=n((e,t={})=>{let{reference:r=!0}=t,{signal:o,shouldAwait:i=!e.isSubprocess}=t[on]??{};return sn({...e,shouldAwait:i,reference:r,signal:o})},"getEachMessage"),sn=n(({anyProcess:e,waitProcess:t=e,channel:r,isSubprocess:o,ipc:i,shouldAwait:s,reference:a,signal:c})=>{le({methodName:"getEachMessage",isSubprocess:o,ipc:i,isConnected:yt(e)}),pt(r,a);let l=H(e,r,o),d=new AbortController,f={};return Tm(c,d),Om(e,l,d),Am({ipcEmitter:l,isSubprocess:o,controller:d,state:f}),Dm({anyProcess:e,waitProcess:t,channel:r,ipcEmitter:l,isSubprocess:o,shouldAwait:s,controller:d,state:f,reference:a})},"loopOnMessages"),Tm=n((e,t)=>{if(e!==void 0){if(e.aborted){t.abort();return}e.addEventListener("abort",()=>{t.abort()},{once:!0,signal:t.signal})}},"stopOnAbort"),Om=n(async(e,t,r)=>{try{await ia(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},"stopOnDisconnect"),Am=n(async({ipcEmitter:e,isSubprocess:t,controller:r,state:o})=>{try{let[i]=await ia(e,"strict:error",{signal:r.signal});o.error=ut(i,t),r.abort()}catch{}},"abortOnStrictError"),Dm=n(async function*({anyProcess:e,waitProcess:t,channel:r,ipcEmitter:o,isSubprocess:i,shouldAwait:s,controller:a,state:c,reference:l}){try{for await(let[d]of Em(o,"message",{signal:a.signal}))sa(c),yield d}catch{sa(c)}finally{a.abort(),mt(r,l),i||de(e),s&&await t}},"iterateOnMessages"),sa=n(({error:e})=>{if(e)throw e},"throwIfStrictError");import ca from"node:process";var da=n((e,t,{ipc:r})=>{Object.assign(e,la(t,!1,r,e))},"addIpcMethods"),fa=n(()=>{let e=ca,t=!0,r=ca.channel!==void 0;return{...la(e,t,r),getCancelSignal:ci.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},"getIpcExport"),la=n((e,t,r,o=e)=>({sendMessage:fe.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:oa.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:aa.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r,waitProcess:o})}),"getIpcMethods");import{ChildProcess as Im}from"node:child_process";import{PassThrough as Rm,Readable as ua,Writable as pa,Duplex as ma}from"node:stream";var ba=n(({error:e,command:t,escapedCommand:r,fileDescriptors:o,options:i,startTime:s,verboseInfo:a})=>{Hr(o);let c=new Im,l=Mm(c,o),d=ge({error:e,command:t,escapedCommand:r,fileDescriptors:o,options:i,startTime:s,isSync:!1}),f=Bm(d,a,i);return{subprocess:c,promise:f,all:i.all?l:void 0,convertedStreams:{readable:ha,writable:ga,duplex:ya,readableStream:Cm,writableStream:Pm,transformStream:Lm,iterable:Sa,[Symbol.asyncIterator]:Sa}}},"handleEarlyError"),Mm=n((e,t)=>{let r=We(),o=We(),i=We(),s=Array.from({length:t.length-3},We),a=We(),c=[r,o,i,...s];return Object.assign(e,{stdin:r,stdout:o,stderr:i,stdio:c}),a},"createDummyStreams"),We=n(()=>{let e=new Rm;return e.end(),e},"createDummyStream"),ha=n(()=>new ua({read(){}}),"readable"),ga=n(()=>new pa({write(){}}),"writable"),ya=n(()=>new ma({read(){},write(){}}),"duplex"),Cm=n(()=>ua.toWeb(ha()),"readableStream"),Pm=n(()=>pa.toWeb(ga()),"writableStream"),Lm=n(()=>ma.toWeb(ya()),"transformStream"),Sa=n(async function*(){},"iterable"),Bm=n(async(e,t,r)=>ye(e,t,r),"handleDummyPromise");import{createReadStream as wa,createWriteStream as xa}from"node:fs";import{Buffer as Fm}from"node:buffer";import{Readable as ze,Writable as Um,Duplex as _m}from"node:stream";var Ta=n((e,t)=>Wt(vm,e,t,!1),"handleStdioAsync"),Ve=n(({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${K[e]}.`)},"forbiddenIfAsync"),Ea={fileNumber:Ve,generator:qr,asyncGenerator:qr,nodeStream:n(({value:e})=>({stream:e}),"nodeStream"),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let o=t||r;return{stream:_m.fromWeb(e,{objectMode:o})}},duplex:n(({value:{transform:e}})=>({stream:e}),"duplex"),native(){}},vm={input:{...Ea,fileUrl:n(({value:e})=>({stream:wa(e)}),"fileUrl"),filePath:n(({value:{file:e}})=>({stream:wa(e)}),"filePath"),webStream:n(({value:e})=>({stream:ze.fromWeb(e)}),"webStream"),iterable:n(({value:e})=>({stream:ze.from(e)}),"iterable"),asyncIterable:n(({value:e})=>({stream:ze.from(e)}),"asyncIterable"),string:n(({value:e})=>({stream:ze.from(e)}),"string"),uint8Array:n(({value:e})=>({stream:ze.from(Fm.from(e))}),"uint8Array")},output:{...Ea,fileUrl:n(({value:e})=>({stream:xa(e)}),"fileUrl"),filePath:n(({value:{file:e,append:t}})=>({stream:xa(e,t?{flags:"a"}:{})}),"filePath"),webStream:n(({value:e})=>({stream:Um.fromWeb(e)}),"webStream"),iterable:Ve,asyncIterable:Ve,string:Ve,uint8Array:Ve}};import{on as $m,once as Oa}from"node:events";import{PassThrough as jm,getDefaultHighWaterMark as Nm}from"node:stream";import{finished as Aa}from"node:stream/promises";function te(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let i of e)cn(i);let t=e.some(({readableObjectMode:i})=>i),r=km(e,t),o=new an({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of e)o.add(i);return o}n(te,"mergeStreams");var km=n((e,t)=>{if(e.length===0)return Nm(t);let r=e.filter(({readableObjectMode:o})=>o===t).map(({readableHighWaterMark:o})=>o);return Math.max(...r)},"getHighWaterMark"),an=class extends jm{static{n(this,"MergedStream")}#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(t){if(cn(t),this.#t.has(t))return;this.#t.add(t),this.#n??=Gm(this,this.#t,this.#i);let r=Vm({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#i});this.#o.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(cn(t),!this.#t.has(t))return!1;let r=this.#o.get(t);return r===void 0?!1:(this.#o.delete(t),t.unpipe(this),await r,!0)}},Gm=n(async(e,t,r)=>{Xt(e,Ma);let o=new AbortController;try{await Promise.race([Wm(e,o),zm(e,t,r,o)])}finally{o.abort(),Xt(e,-Ma)}},"onMergedStreamFinished"),Wm=n(async(e,{signal:t})=>{try{await Aa(e,{signal:t,cleanup:!0})}catch(r){throw Da(e,r),r}},"onMergedStreamEnd"),zm=n(async(e,t,r,{signal:o})=>{for await(let[i]of $m(e,"unpipe",{signal:o}))t.has(i)&&i.emit(r)},"onInputStreamsUnpipe"),cn=n(e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},"validateStream"),Vm=n(async({passThroughStream:e,stream:t,streams:r,ended:o,aborted:i,onFinished:s,unpipeEvent:a})=>{Xt(e,Ca);let c=new AbortController;try{await Promise.race([Ym(s,t,c),Hm({passThroughStream:e,stream:t,streams:r,ended:o,aborted:i,controller:c}),Km({stream:t,streams:r,ended:o,aborted:i,unpipeEvent:a,controller:c})])}finally{c.abort(),Xt(e,-Ca)}r.size>0&&r.size===o.size+i.size&&(o.size===0&&i.size>0?ln(e):Xm(e))},"endWhenStreamsDone"),Ym=n(async(e,t,{signal:r})=>{try{await e,r.aborted||ln(t)}catch(o){r.aborted||Da(t,o)}},"afterMergedStreamFinished"),Hm=n(async({passThroughStream:e,stream:t,streams:r,ended:o,aborted:i,controller:{signal:s}})=>{try{await Aa(t,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&o.add(t)}catch(a){if(s.aborted||!r.has(t))return;Ia(a)?i.add(t):Ra(e,a)}},"onInputStreamEnd"),Km=n(async({stream:e,streams:t,ended:r,aborted:o,unpipeEvent:i,controller:{signal:s}})=>{if(await Oa(e,i,{signal:s}),!e.readable)return Oa(s,"abort",{signal:s});t.delete(e),r.delete(e),o.delete(e)},"onInputStreamUnpipe"),Xm=n(e=>{e.writable&&e.end()},"endStream"),Da=n((e,t)=>{Ia(t)?ln(e):Ra(e,t)},"errorOrAbortStream"),Ia=n(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isAbortError"),ln=n(e=>{(e.readable||e.writable)&&e.destroy()},"abortStream"),Ra=n((e,t)=>{e.destroyed||(e.once("error",Jm),e.destroy(t))},"errorStream"),Jm=n(()=>{},"noop"),Xt=n((e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},"updateMaxListeners"),Ma=2,Ca=1;import{finished as Pa}from"node:stream/promises";var we=n((e,t)=>{e.pipe(t),Qm(e,t),Zm(e,t)},"pipeStreams"),Qm=n(async(e,t)=>{if(!(C(e)||C(t))){try{await Pa(e,{cleanup:!0,readable:!0,writable:!1})}catch{}dn(t)}},"onSourceFinish"),dn=n(e=>{e.writable&&e.end()},"endDestinationStream"),Zm=n(async(e,t)=>{if(!(C(e)||C(t))){try{await Pa(t,{cleanup:!0,readable:!1,writable:!0})}catch{}fn(e)}},"onDestinationFinish"),fn=n(e=>{e.readable&&e.destroy()},"abortSourceStream");var La=n((e,t,r)=>{let o=new Map;for(let[i,{stdioItems:s,direction:a}]of Object.entries(t)){let c=s.filter(({type:d})=>M.has(d));for(let{stream:d}of c)qm(e,d,a,i);let l=s.filter(({type:d})=>!M.has(d));for(let{stream:d}of l)th({subprocess:e,stream:d,direction:a,fdNumber:i,pipeGroups:o,controller:r})}for(let[i,s]of o){let a=s.length===1?s[0]:te(s);we(a,i)}},"pipeOutputAsync"),qm=n((e,t,r,o)=>{r==="output"?we(e.stdio[o],t):we(t,e.stdio[o]);let i=eh[o];i!==void 0&&(e[i]=t),e.stdio[o]=t},"pipeTransform"),eh=["stdin","stdout","stderr"],th=n(({subprocess:e,stream:t,direction:r,fdNumber:o,pipeGroups:i,controller:s})=>{if(t===void 0)return;rh(t,s);let[a,c]=r==="output"?[t,e.stdio[o]]:[e.stdio[o],t],l=i.get(a)??[];i.set(a,[...l,c])},"pipeStdioItem"),rh=n((e,{signal:t})=>{C(e)&&Q(e,nh,t)},"setStandardStreamMaxListeners"),nh=2;import Jt from"node:process";import{execFile as oh}from"node:child_process";import Ba from"node:path/win32";var Fa=Jt.platform==="win32",Ua=n(e=>e.killDescendants&&!Fa?{...e,detached:!0}:e,"getSpawnOptions"),_a=n((e,{killDescendants:t})=>t?(Fa?sh:ih).bind(void 0,e):e.kill.bind(e),"getKillFunction"),ih=n((e,t)=>{if(e.pid===void 0)return!1;try{return Jt.kill(-e.pid,t)}catch{return e.kill(t)}},"killDescendantsUnix"),sh=n((e,t)=>{if(e.pid===void 0)return!1;let r=ah();return r===void 0?e.kill(t):(oh(r,["/pid",`${e.pid}`,"/T","/F"],o=>{o&&e.kill(t)}),!0)},"killDescendantsWindows"),ah=n(()=>{let e=[Jt.env.SystemRoot,Jt.env.windir].find(t=>t&&ch(t));return e===void 0?void 0:Ba.join(e,"System32","taskkill.exe")},"getTaskkillFile"),ch=n(e=>{let{root:t}=Ba.parse(e);return/^[a-z]:[/\\]/i.test(t)},"isWindowsDriveAbsolutePath");var X=[];X.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&X.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&X.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Qt=n(e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function","processOk"),un=Symbol.for("signal-exit emitter"),pn=globalThis,lh=Object.defineProperty.bind(Object),mn=class{static{n(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(pn[un])return pn[un];lh(pn,un,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let o=this.listeners[t],i=o.indexOf(r);i!==-1&&(i===0&&o.length===1?o.length=0:o.splice(i,1))}emit(t,r,o){if(this.emitted[t])return!1;this.emitted[t]=!0;let i=!1;for(let s of this.listeners[t])i=s(r,o)===!0||i;return t==="exit"&&(i=this.emit("afterExit",r,o)||i),i}},Zt=class{static{n(this,"SignalExitBase")}},dh=n(e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),"signalExitWrap"),hn=class extends Zt{static{n(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}},gn=class extends Zt{static{n(this,"SignalExit")}#t=yn.platform==="win32"?"SIGINT":"SIGHUP";#r=new mn;#e;#n;#i;#o={};#s=!1;constructor(t){super(),this.#e=t,this.#o={};for(let r of X)this.#o[r]=()=>{let o=this.#e.listeners(r),{count:i}=this.#r,s=t;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),o.length===i){this.unload();let a=this.#r.emit("exit",null,r),c=r==="SIGHUP"?this.#t:r;a||t.kill(t.pid,c)}};this.#i=t.reallyExit,this.#n=t.emit}onExit(t,r){if(!Qt(this.#e))return()=>{};this.#s===!1&&this.load();let o=r?.alwaysLast?"afterExit":"exit";return this.#r.on(o,t),()=>{this.#r.removeListener(o,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let t of X)try{let r=this.#o[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#c(t,...r),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#s&&(this.#s=!1,X.forEach(t=>{let r=this.#o[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#i,this.#r.count-=1)}#a(t){return Qt(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let o=this.#n;if(t==="exit"&&Qt(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=o.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return o.call(this.#e,t,...r)}},yn=globalThis.process,{onExit:va,load:II,unload:RI}=dh(Qt(yn)?new gn(yn):new hn);import{addAbortListener as fh}from"node:events";var $a=n((e,{cleanup:t,detached:r},{signal:o})=>{if(!t||r)return;let i=va(()=>{e()});fh(o,()=>{i()})},"cleanupOnExit");var qt=n(()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),"initializeConcurrentStreams"),Ye=n((e,t,r)=>{let o=e[r];o.has(t)||o.set(t,[]);let i=o.get(t),s=U();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},"addConcurrentStream"),xe=n(async({resolve:e,promises:t},r)=>{e();let[o]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!o},"waitForConcurrentStreams");import{on as uh}from"node:events";import{getDefaultHighWaterMark as ph}from"node:stream";var er=n(({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:o,encoding:i,preserveNewlines:s})=>{let a=new AbortController;return mh(t,a),ja({stream:e,controller:a,binary:r,shouldEncode:!e.readableObjectMode&&o,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:s})},"iterateOnSubprocessStream"),mh=n(async(e,t)=>{try{await e}catch{}finally{t.abort()}},"stopReadingOnExit"),Sn=n(({stream:e,onStreamEnd:t,lines:r,encoding:o,stripFinalNewline:i,allMixed:s})=>{let a=new AbortController;hh(t,a,e);let c=e.readableObjectMode&&!s;return ja({stream:e,controller:a,binary:o==="buffer",shouldEncode:!c,encoding:o,shouldSplit:!c&&r,preserveNewlines:!i})},"iterateForResult"),hh=n(async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},"stopReadingOnStreamEnd"),ja=n(({stream:e,controller:t,binary:r,shouldEncode:o,encoding:i,shouldSplit:s,preserveNewlines:a})=>{let c=uh(e,"data",{signal:t.signal,highWaterMark:Na,highWatermark:Na});return gh({onStdoutChunk:c,controller:t,binary:r,shouldEncode:o,encoding:i,shouldSplit:s,preserveNewlines:a})},"iterateOnStream"),bn=ph(!0),Na=bn,gh=n(async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:o,encoding:i,shouldSplit:s,preserveNewlines:a}){let c=yh({binary:r,shouldEncode:o,encoding:i,shouldSplit:s,preserveNewlines:a});try{for await(let[l]of e)yield*ee(l,c,0)}catch(l){if(!t.signal.aborted)throw l}finally{yield*ke(c)}},"iterateOnData"),yh=n(({binary:e,shouldEncode:t,encoding:r,shouldSplit:o,preserveNewlines:i})=>[Vt(e,r,!t),zt(e,i,!o,{})].filter(Boolean),"getGenerators");var Ee=n((e,t,{from:r,binary:o=!1,preserveNewlines:i=!1}={})=>{let s=o||D.has(t),a=be(e,r),c=er({subprocessStdout:a,subprocess:e,binary:s,shouldEncode:!0,encoding:t,preserveNewlines:i});return Sh(c,a,e)},"createIterable"),Sh=n(async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}},"iterateOnStdoutData");import{finished as bh}from"node:stream/promises";var He=n(async(e,t,r,{isSameDirection:o,stopOnExit:i=!1}={})=>{let s=wh(e,r),a=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],bh(e,{cleanup:!0,signal:a.signal})])}catch(c){s.stdinCleanedUp||Th(c,t,r,o)}finally{a.abort()}},"waitForStream"),wh=n((e,{originalStreams:t,subprocess:r})=>{let[o]=t,i={stdinCleanedUp:!1};return e===o&&xh(e,r,i),i},"handleStdinDestroy"),xh=n((e,t,r)=>{let{_destroy:o}=e;e._destroy=(...i)=>{Eh(t,r),o.call(e,...i)}},"spyOnStdinDestroy"),Eh=n(({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},"setStdinCleanedUp"),Th=n((e,t,r,o)=>{if(!Oh(e,t,r,o))throw e},"handleStreamError"),Oh=n((e,t,r,o=!0)=>r.propagating?ka(e)||Te(e):(r.propagating=!0,wn(r,t)===o?ka(e):Te(e)),"shouldIgnoreStreamError"),wn=n(({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input","isInputFileDescriptor"),Te=n(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isStreamAbort"),ka=n(e=>e?.code==="EPIPE","isStreamEpipe");import{finished as Ga}from"node:stream/promises";var xn=n(async e=>{if(e!==void 0)try{await En(e)}catch{}},"safeWaitForSubprocessStdin"),Wa=n(async e=>{if(e!==void 0)try{await Tn(e)}catch{}},"safeWaitForSubprocessStdout"),En=n(async e=>{await Ga(e,{cleanup:!0,readable:!1,writable:!0})},"waitForSubprocessStdin"),Tn=n(async e=>{await Ga(e,{cleanup:!0,readable:!0,writable:!1})},"waitForSubprocessStdout"),tr=n(async(e,t)=>{if(await e,t)throw t},"waitForSubprocess"),rr=n((e,t,r)=>{r&&!Te(r)?e.destroy(r):t&&e.destroy()},"destroyOtherStream");import{Readable as Ah}from"node:stream";import{callbackify as Dh}from"node:util";var nr=n(({subprocess:e,concurrentStreams:t,encoding:r},{from:o,binary:i=!0,preserveNewlines:s=!0}={})=>{let a=i||D.has(r),{subprocessStdout:c,waitReadableDestroy:l}=On(e,o,t),{readableEncoding:d,readableObjectMode:f,readableHighWaterMark:u}=An(c,a),{read:p,onStdoutDataDone:m}=Dn({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),g=new Ah({read:p,destroy:Dh(Rn.bind(void 0,{subprocessStdout:c,subprocess:e,waitReadableDestroy:l})),highWaterMark:u,objectMode:f,encoding:d});return In({subprocessStdout:c,onStdoutDataDone:m,readable:g,subprocess:e}),g},"createReadable"),On=n((e,t,r)=>{let o=be(e,t),i=Ye(r,o,"readableDestroy");return{subprocessStdout:o,waitReadableDestroy:i}},"getSubprocessStdout"),An=n(({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},o)=>o?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:bn},"getReadableOptions"),Dn=n(({subprocessStdout:e,subprocess:t,binary:r,encoding:o,preserveNewlines:i})=>{let s=U(),a=er({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:o,preserveNewlines:i});return{read(){Ih(this,a,s)},onStdoutDataDone:s}},"getReadableMethods"),Ih=n(async(e,t,r)=>{try{let{value:o,done:i}=await t.next();i?r.resolve():e.push(o)}catch{}},"onRead"),In=n(async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:o,subprocessStdin:i})=>{try{await Tn(e),await o,await xn(i),await t,r.readable&&r.push(null)}catch(s){await xn(i),za(r,await Rh(o,s))}},"onStdoutFinished"),Rh=n(async(e,t)=>{if(t.code!=="ERR_STREAM_PREMATURE_CLOSE")return t;try{await e}catch(r){return r}return t},"getPrematureCloseError"),Rn=n(async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},o)=>{await xe(r,t)&&(za(e,o),await tr(t,o))},"onReadableDestroy"),za=n((e,t)=>{rr(e,e.readable,t)},"destroyOtherReadable");import{Readable as Mh,Writable as Ch,Duplex as Ph}from"node:stream";var or=n((e,t)=>Mh.toWeb(e.readable(t)),"createReadableStream"),Va=n((e,t)=>Ch.toWeb(e.writable(t)),"createWritableStream"),Ya=n((e,t)=>Ph.toWeb(e.duplex(t)),"createTransformStream");var Ka=n(({source:e,sourcePromise:t,boundOptions:r,createNested:o},...i)=>{let s=it(),{destination:a,destinationStream:c,destinationError:l,from:d,unpipeSignal:f}=Lh(r,o,i),{sourceStream:u,sourceError:p}=Fh(e,d),{options:m,fileDescriptors:g}=v.get(e);return{sourcePromise:t,sourceStream:u,sourceOptions:m,sourceError:p,destination:a,destinationStream:c,destinationError:l,unpipeSignal:f,fileDescriptors:g,startTime:s}},"normalizePipeArguments"),Lh=n((e,t,r)=>{try{let{destination:o,pipeOptions:{from:i,to:s,unpipeSignal:a}={}}=Bh(e,t,...r),c=Gt(o,s);return{destination:o,destinationStream:c,from:i,unpipeSignal:a}}catch(o){return{destinationError:o}}},"getDestinationStream"),Bh=n((e,t,r,...o)=>{if(Array.isArray(r))return{destination:t(Ha,e)(r,...o),pipeOptions:e};if(typeof r=="string"||r instanceof URL||dr(r)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,s,a]=Xe(r,...o);return{destination:t(Ha)(i,s,a),pipeOptions:a}}if(v.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:o[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},"getDestination"),Ha=n(({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),"mapDestinationArguments"),Fh=n((e,t)=>{try{return{sourceStream:be(e,t)}}catch(r){return{sourceError:r}}},"getSourceStream");var Ja=n(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:o,fileDescriptors:i,sourceOptions:s,startTime:a})=>{let c=Uh({sourceStream:e,sourceError:t,destinationStream:r,destinationError:o});if(c!==void 0)throw Mn({error:c,fileDescriptors:i,sourceOptions:s,startTime:a})},"handlePipeArgumentsError"),Uh=n(({sourceStream:e,sourceError:t,destinationStream:r,destinationError:o})=>{if(t!==void 0&&o!==void 0)return o;if(o!==void 0)return fn(e),o;if(t!==void 0)return dn(r),t},"getPipeArgumentsError"),Mn=n(({error:e,fileDescriptors:t,sourceOptions:r,startTime:o})=>ge({error:e,command:Xa,escapedCommand:Xa,fileDescriptors:t,options:r,startTime:o,isSync:!1}),"createNonCommandError"),Xa="source.pipe(destination)";var Qa=n(async e=>{let[{status:t,reason:r,value:o=r},{status:i,reason:s,value:a=s}]=await e;if(a.pipedFrom.includes(o)||a.pipedFrom.push(o),i==="rejected")throw a;if(t==="rejected")throw o;return a},"waitForBothSubprocesses");import{finished as _h}from"node:stream/promises";var Za=n((e,t,r)=>{let o=ir.has(t)?$h(e,t):vh(e,t);return Q(e,Nh,r.signal),Q(t,kh,r.signal),jh(t),o},"pipeSubprocessStream"),vh=n((e,t)=>{let r=te([e]);return we(r,t),ir.set(t,r),r},"pipeFirstSubprocessStream"),$h=n((e,t)=>{let r=ir.get(t);return r.add(e),r},"pipeMoreSubprocessStream"),jh=n(async e=>{try{await _h(e,{cleanup:!0,readable:!1,writable:!0})}catch{}ir.delete(e)},"cleanupMergedStreamsMap"),ir=new WeakMap,Nh=2,kh=1;import{aborted as Gh}from"node:util";var qa=n((e,t)=>e===void 0?[]:[Wh(e,t)],"unpipeOnAbort"),Wh=n(async(e,{sourceStream:t,mergedStream:r,fileDescriptors:o,sourceOptions:i,startTime:s})=>{await Gh(e,t),await r.remove(t);let a=new Error("Pipe canceled by `unpipeSignal` option.");throw Mn({error:a,fileDescriptors:o,sourceOptions:i,startTime:s})},"unpipeOnSignalAbort");var sr=n((e,...t)=>{if(E(t[0]))return sr.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...o}=Ka(e,...t),i=new AbortController,s=rg({...o,destination:r,pipeFailureController:i});return s.pipe=sr.bind(void 0,{...e,source:r,sourcePromise:s,boundOptions:{}}),zh(s,r,i.signal),s},"pipeToSubprocess"),zh=n((e,t,r)=>{t!==void 0&&(Vh(e,t),Xh(e,t,r))},"forwardDestinationMethods"),Vh=n((e,t)=>{let r=v.get(t);v.set(e,r),e.stdio=t.stdio,e.all=t.all;let{options:{encoding:o}}=r,i=qt();e[Symbol.asyncIterator]=Ee.bind(void 0,e,o,{}),e.iterable=Ee.bind(void 0,e,o),e.readable=Hh.bind(void 0,e,{subprocess:e,concurrentStreams:i,encoding:o}),e.readableStream=or.bind(void 0,e),Yh(e,t)},"forwardReadableMethods"),Yh=n((e,t)=>{if(t.all===void 0){e.all=void 0;return}Object.defineProperty(e,"all",{get(){ec(e,t.all);let r=e.readable({from:"all"});return ec(e,r),r},enumerable:!0,configurable:!0})},"forwardAll"),ec=n((e,t)=>{Object.defineProperty(e,"all",{value:t,writable:!0,enumerable:!0,configurable:!0})},"setAllProperty"),Hh=n((e,t,...r)=>{let o=nr(t,...r);return Kh(e,o),o},"createPipeReadable"),Kh=n(async(e,t)=>{try{await e}catch(r){t.destroy(r)}},"destroyOnPipeFailure"),Xh=n((e,t,r)=>{e.sendMessage=t.sendMessage,e.getOneMessage=Jh.bind(void 0,t,r),e.getEachMessage=qh.bind(void 0,e,t,r)},"forwardIpcMethods"),Jh=n((e,t,...r)=>{let o=new AbortController,i=e.getOneMessage(...tc(r,o.signal,nn));return Qh(t,i,o)},"getOnePipeMessage"),Qh=n(async(e,t,r)=>{try{return await Promise.race([t,Zh(e,r.signal)])}finally{r.abort()}},"waitForOnePipeMessage"),Zh=n((e,t)=>new Promise((r,o)=>{if(e.aborted){o(e.reason);return}e.addEventListener("abort",()=>{o(e.reason)},{once:!0,signal:t})}),"getSignalRejection"),qh=n((e,t,r,...o)=>{let i=new AbortController,s=t.getEachMessage(...tc(o,i.signal,on));return tg(r,i),eg(e,s,i)},"getEachPipeMessage"),eg=n(async function*(e,t,r){try{yield*t}finally{r.abort(),await e}},"iterateOnPipeMessages"),tc=n((e,t,r)=>{if(e[0]===null)return e;let[o]=e;return[{...o,[r]:{signal:t,shouldAwait:!1}}]},"addPipeOptions"),tg=n((e,t)=>{if(e.aborted){t.abort();return}e.addEventListener("abort",()=>{t.abort()},{once:!0,signal:t.signal})},"abortOnSignal"),rg=n(async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:o,destination:i,destinationStream:s,destinationError:a,unpipeSignal:c,fileDescriptors:l,startTime:d,pipeFailureController:f})=>{let u=new AbortController;try{let p=ng(e,i);Ja({sourceStream:t,sourceError:o,destinationStream:s,destinationError:a,fileDescriptors:l,sourceOptions:r,startTime:d});let m=Za(t,s,u);return await Promise.race([Qa(p),...qa(c,{sourceStream:t,mergedStream:m,sourceOptions:r,fileDescriptors:l,startTime:d})])}catch(p){throw f.abort(p),p}finally{u.abort()}},"handlePipePromise"),ng=n((e,t)=>Promise.allSettled([e,t]),"getSubprocessPromises");import{setImmediate as og}from"node:timers/promises";var nc=n(async({stream:e,onStreamEnd:t,fdNumber:r,encoding:o,buffer:i,maxBuffer:s,lines:a,allMixed:c,stripFinalNewline:l,verboseInfo:d,streamInfo:f})=>{let u=ig({stream:e,onStreamEnd:t,fdNumber:r,encoding:o,allMixed:c,verboseInfo:d,streamInfo:f});if(!i){await Promise.all([sg(e),u]);return}let p=Kr(l,r),m=Sn({stream:e,onStreamEnd:t,lines:a,encoding:o,stripFinalNewline:p,allMixed:c}),[g]=await Promise.all([ag({stream:e,iterable:m,fdNumber:r,encoding:o,maxBuffer:s,lines:a}),u]);return g},"getStreamOutput"),ig=n(async({stream:e,onStreamEnd:t,fdNumber:r,encoding:o,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!Kt({stdioItems:a[r]?.stdioItems,encoding:o,verboseInfo:s,fdNumber:r}))return;let c=Sn({stream:e,onStreamEnd:t,lines:!0,encoding:o,stripFinalNewline:!0,allMixed:i});await Xs(c,e,r,s)},"logOutputAsync"),sg=n(async e=>{await og(),e.readableFlowing===null&&e.resume()},"resumeStream"),ag=n(async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:o,encoding:i,maxBuffer:s,lines:a})=>{try{return t||a?await Lt(r,{maxBuffer:s}):i==="buffer"?new Uint8Array(await Bt(r,{maxBuffer:s})):await Ut(r,{maxBuffer:s})}catch(c){return rc(Wi({error:c,stream:e,readableObjectMode:t,lines:a,encoding:i,fdNumber:o}))}},"getStreamContents"),Cn=n(async e=>{try{return await e}catch(t){return rc(t)}},"getBufferedData"),rc=n(({bufferedData:e})=>kn(e)?new Uint8Array(e):e,"handleBufferedData");var oc=n(({subprocess:e,encoding:t,buffer:r,maxBuffer:o,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:c})=>e.stdio.map((l,d)=>Pn({stream:l,fdNumber:d,encoding:t,buffer:r[d],maxBuffer:o[d],lines:i[d],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:c})),"waitForStdioStreams"),Pn=n(async({stream:e,fdNumber:t,encoding:r,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:d})=>{if(!e)return;let f=He(e,t,d);if(wn(d,t)){await f;return}let[u]=await Promise.all([nc({stream:e,onStreamEnd:f,fdNumber:t,encoding:r,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:d}),f]);return u},"waitForSubprocessStream");var ic=n(({stdout:e,stderr:t},{all:r})=>r&&(e||t)?te([e,t].filter(Boolean)):void 0,"makeAllStream"),sc=n(({subprocess:e,all:t,encoding:r,buffer:o,maxBuffer:i,lines:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>Pn({...cg(e,t,o),fdNumber:"all",encoding:r,maxBuffer:i[1]+i[2],lines:s[1]||s[2],allMixed:lg(e,t),stripFinalNewline:a,verboseInfo:c,streamInfo:l}),"waitForAllStream"),cg=n(({stdout:e,stderr:t},r,[,o,i])=>{let s=o||i;return s?o?i?{stream:r,buffer:s}:{stream:e,buffer:s}:{stream:t,buffer:s}:{stream:r,buffer:s}},"getAllStream"),lg=n(({stdout:e,stderr:t},r)=>r&&e&&t&&e.readableObjectMode!==t.readableObjectMode,"getAllMixed");var ac=n(e=>se(e,"ipc"),"shouldLogIpc"),cc=n((e,t)=>{let r=ot(e);F({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})},"logIpcOutput");var lc=n(async({subprocess:e,buffer:t,maxBuffer:r,ipc:o,ipcOutput:i,verboseInfo:s})=>{if(!o)return i;let a=ac(s),c=k(t,"ipc"),l=k(r,"ipc");for await(let d of sn({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:o,shouldAwait:!1,reference:!0}))c&&(zi(e,i,l),i.push(d)),a&&cc(d,s);return i},"waitForIpcOutput"),dc=n(async(e,t)=>(await Promise.allSettled([e]),t),"getBufferedIpcOutput");import{once as dg}from"node:events";var fc=n(async({subprocess:e,kill:t,all:r,options:{encoding:o,buffer:i,maxBuffer:s,lines:a,timeoutDuration:c,cancelSignal:l,gracefulCancel:d,forceKillAfterDelay:f,stripFinalNewline:u,ipc:p,ipcInput:m},context:g,verboseInfo:S,fileDescriptors:b,originalStreams:y,onInternalError:w,controller:x})=>{let O=ea(e,g),A={originalStreams:y,fileDescriptors:b,subprocess:e,exitPromise:O,propagating:!1},I=oc({subprocess:e,encoding:o,buffer:i,maxBuffer:s,lines:a,stripFinalNewline:u,verboseInfo:S,streamInfo:A}),j=sc({subprocess:e,all:r,encoding:o,buffer:i,maxBuffer:s,lines:a,stripFinalNewline:u,verboseInfo:S,streamInfo:A}),re=[],V=lc({subprocess:e,buffer:i,maxBuffer:s,ipc:p,ipcOutput:re,verboseInfo:S}),Ke=fg(y,e,A),ne=ug(b,A);try{return await Promise.race([Promise.all([{},ta(O),Promise.all(I),j,V,yi(e,m,p),...Ke,...ne]),w,pg(e,x),...ui(t,c,g,x),...Bo({kill:t,cancelSignal:l,gracefulCancel:d,context:g,controller:x}),...di({subprocess:e,kill:t,cancelSignal:l,gracefulCancel:d,forceKillAfterDelay:f,context:g,controller:x})])}catch(Lc){return g.terminationReason??="other",Promise.all([{error:Lc},O,Promise.all(I.map(Bc=>Cn(Bc))),Cn(j),dc(V,re),Promise.allSettled(Ke),Promise.allSettled(ne)])}},"waitForSubprocessResult"),fg=n((e,t,r)=>e.map((o,i)=>o===t.stdio[i]?void 0:He(o,i,r)),"waitForOriginalStreams"),ug=n((e,t)=>e.flatMap(({stdioItems:r},o)=>r.filter(({value:i,stream:s=i})=>B(s,{checkOpen:!1})&&!C(s)).map(({type:i,value:s,stream:a=s})=>He(a,o,t,{isSameDirection:M.has(i),stopOnExit:i==="native"}))),"waitForCustomStreamsEnd"),pg=n(async(e,{signal:t})=>{let[r]=await dg(e,"error",{signal:t});throw r},"throwOnSubprocessError");import{Writable as mg}from"node:stream";import{callbackify as uc}from"node:util";var mc=n(({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:o,waitWritableFinal:i,waitWritableDestroy:s}=Ln(e,r,t),a=new mg({...Bn(o,e,i),destroy:uc(Un.bind(void 0,{subprocessStdin:o,subprocess:e,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:o.writableHighWaterMark,objectMode:o.writableObjectMode});return Fn(o,a,void 0,e),a},"createWritable"),Ln=n((e,t,r)=>{let o=Gt(e,t),i=Ye(r,o,"writableFinal"),s=Ye(r,o,"writableDestroy");return{subprocessStdin:o,waitWritableFinal:i,waitWritableDestroy:s}},"getSubprocessStdin"),Bn=n((e,t,r)=>({write:hg.bind(void 0,e),final:uc(gg.bind(void 0,e,t,r))}),"getWritableMethods"),hg=n((e,t,r,o)=>{e.write(t,r)?o():e.once("drain",o)},"onWrite"),gg=n(async(e,t,r)=>{await xe(r,t)&&(e.writable&&e.end(),await t)},"onWritableFinal"),Fn=n(async(e,t,r,o)=>{try{await En(e),await o,t.writable&&t.end()}catch(i){await Wa(r),pc(t,await yg(o,i))}},"onStdinFinished"),yg=n(async(e,t)=>{if(!Sg(t))return t;try{await e}catch(r){return r}return t},"getSubprocessError"),Sg=n(e=>e===void 0||Te(e),"shouldUseSubprocessError"),Un=n(async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:o},i)=>{await xe(r,t),await xe(o,t)&&(pc(e,i),await tr(t,i))},"onWritableDestroy"),pc=n((e,t)=>{rr(e,e.writable,t)},"destroyOtherWritable");import{Duplex as bg}from"node:stream";import{callbackify as wg}from"node:util";var hc=n(({subprocess:e,concurrentStreams:t,encoding:r},{from:o,to:i,binary:s=!0,preserveNewlines:a=!0}={})=>{let c=s||D.has(r),{subprocessStdout:l,waitReadableDestroy:d}=On(e,o,t),{subprocessStdin:f,waitWritableFinal:u,waitWritableDestroy:p}=Ln(e,i,t),{readableEncoding:m,readableObjectMode:g,readableHighWaterMark:S}=An(l,c),{read:b,onStdoutDataDone:y}=Dn({subprocessStdout:l,subprocess:e,binary:c,encoding:r,preserveNewlines:a}),w=new bg({read:b,...Bn(f,e,u),destroy:wg(xg.bind(void 0,{subprocessStdout:l,subprocessStdin:f,subprocess:e,waitReadableDestroy:d,waitWritableFinal:u,waitWritableDestroy:p})),readableHighWaterMark:S,writableHighWaterMark:f.writableHighWaterMark,readableObjectMode:g,writableObjectMode:f.writableObjectMode,encoding:m});return In({subprocessStdout:l,onStdoutDataDone:y,readable:w,subprocess:e,subprocessStdin:f}),Fn(f,w,l,e),w},"createDuplex"),xg=n(async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:o,waitWritableFinal:i,waitWritableDestroy:s},a)=>{await Promise.all([Rn({subprocessStdout:e,subprocess:r,waitReadableDestroy:o},a),Un({subprocessStdin:t,subprocess:r,waitWritableFinal:i,waitWritableDestroy:s},a)])},"onDuplexDestroy");var gc=n((e,{encoding:t})=>{let r=qt();e.readable=nr.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=mc.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=hc.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.readableStream=or.bind(void 0,e),e.writableStream=Va.bind(void 0,e),e.transformStream=Ya.bind(void 0,e),e.iterable=Ee.bind(void 0,e,t),e[Symbol.asyncIterator]=Ee.bind(void 0,e,t,{})},"addConvertedStreams");var yc=n((e,t)=>Object.assign(e,t),"mergePromise");import{setMaxListeners as Eg}from"node:events";import{spawn as Tg}from"node:child_process";var Sc=n((e,t,r,o)=>{let{file:i,commandArguments:s,command:a,escapedCommand:c,startTime:l,verboseInfo:d,options:f,fileDescriptors:u}=Og(e,t,r),{subprocess:p,promise:m,kill:g,all:S,convertedStreams:b}=Dg({file:i,commandArguments:s,options:f,startTime:l,verboseInfo:d,command:a,escapedCommand:c,fileDescriptors:u}),y=Ig({promise:m,nodeChildProcess:p,kill:g,all:S,convertedStreams:b,options:f});return y.pipe=sr.bind(void 0,{source:y,sourcePromise:m,boundOptions:{},createNested:o}),v.set(y,{options:f,fileDescriptors:u}),y},"execaCoreAsync"),Og=n((e,t,r)=>{let{command:o,escapedCommand:i,startTime:s,verboseInfo:a}=st(e,t,r),{file:c,commandArguments:l,options:d}=Dt(e,t,r),f=Ag(d),u=Ta(f,a);return{file:c,commandArguments:l,command:o,escapedCommand:i,startTime:s,verboseInfo:a,options:f,fileDescriptors:u}},"handleAsyncArguments"),Ag=n(({timeout:e,signal:t,...r})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},"handleAsyncOptions"),Dg=n(({file:e,commandArguments:t,options:r,startTime:o,verboseInfo:i,command:s,escapedCommand:a,fileDescriptors:c})=>{let l;try{l=Tg(...It(e,t,Ua(r)))}catch(b){return ba({error:b,command:s,escapedCommand:a,fileDescriptors:c,options:r,startTime:o,verboseInfo:i})}let d=new AbortController;Eg(1/0,d.signal);let f=[...l.stdio];La(l,c,d),oi(l,r);let u={},p=U(),m=Po.bind(void 0,{kill:_a(l,r),options:r,onInternalError:p,context:u,controller:d});$a(m,r,d);let g=ic(l,r),S=Mg({subprocess:l,kill:m,all:g,options:r,startTime:o,verboseInfo:i,fileDescriptors:c,originalStreams:f,command:s,escapedCommand:a,context:u,onInternalError:p,controller:d});return{subprocess:l,promise:S,kill:m,all:g}},"spawnSubprocessAsync"),Ig=n(({promise:e,nodeChildProcess:t,kill:r,all:o,convertedStreams:i,options:s})=>{let a=yc(e,Rg(t,o));return a.kill=r??a.kill,i===void 0?gc(a,s):Object.assign(a,i),da(a,t,s),a},"getSubprocessPromise"),Rg=n((e,t)=>({nodeChildProcess:e,pid:e.pid,stdin:e.stdin,stdout:e.stdout,stderr:e.stderr,stdio:e.stdio,all:t,kill:e.kill.bind(e)}),"getSubprocessProperties"),Mg=n(async({subprocess:e,kill:t,all:r,options:o,startTime:i,verboseInfo:s,fileDescriptors:a,originalStreams:c,command:l,escapedCommand:d,context:f,onInternalError:u,controller:p})=>{let[m,[g,S],b,y,w]=await fc({subprocess:e,kill:t,all:r,options:o,context:f,verboseInfo:s,fileDescriptors:a,originalStreams:c,onInternalError:u,controller:p});p.abort(),u.resolve();let x=b.map((I,j)=>z(I,o,j)),O=z(y,o,"all"),A=Cg({errorInfo:m,exitCode:g,signal:S,stdio:x,all:O,ipcOutput:w,context:f,options:o,command:l,escapedCommand:d,startTime:i});return ye(A,s,o)},"handlePromise"),Cg=n(({errorInfo:e,exitCode:t,signal:r,stdio:o,all:i,ipcOutput:s,context:a,options:c,command:l,escapedCommand:d,startTime:f})=>"error"in e?ve({error:e.error,command:l,escapedCommand:d,timedOut:a.terminationReason==="timeout",isCanceled:a.terminationReason==="cancel"||a.terminationReason==="gracefulCancel",isGracefullyCanceled:a.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof _,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:r,stdio:o,all:i,ipcOutput:s,options:c,startTime:f,isSync:!1}):vt({command:l,escapedCommand:d,stdio:o,all:i,ipcOutput:s,options:c,startTime:f}),"getAsyncResult");var ar=n((e,t)=>{let r={__proto__:null,...e},o=Object.fromEntries(Object.entries(t).map(([i,s])=>[i,Pg(i,r[i],s)]));return{...r,...o}},"mergeOptions"),Pg=n((e,t,r)=>Lg.has(e)&&E(t)&&E(r)?{...t,...r}:r,"mergeOption"),Lg=new Set(["env",...gr]);var Oe=n((e,t,r,o)=>{let i=n((a,c,l)=>Oe(a,c,r,l),"createNested"),s=n((...a)=>Bg({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:o,createNested:i},...a),"boundExeca");return o!==void 0&&o(s,i,t),s},"createExeca"),Bg=n(({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:o,createNested:i},s,...a)=>{if(E(s))return i(e,ar(r,s),o);let{file:c,commandArguments:l,options:d,isSync:f}=Fg({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:r});return f?na(c,l,d):Sc(c,l,d,i)},"callBoundExeca"),Fg=n(({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:o,boundOptions:i})=>{let s=Yn(t)?Hn(t,r):[t,...r],[a,c,l]=Xe(...s),d=ar(ar(o,i),l),{options:f=d,isSync:u=!1}=e({options:d});return{file:a,commandArguments:c,options:f,isSync:u}},"parseArguments");var wc=n((e,t,r)=>{e.sync=t(Ug,r),e.s=e.sync},"setScriptSync"),xc=n(({options:e})=>bc(e),"mapScriptAsync"),Ug=n(({options:e})=>({...bc(e),isSync:!0}),"mapScriptSync"),bc=n(e=>({options:{..._g(e),...e}}),"getScriptOptions"),_g=n(({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},"getScriptStdinOption"),Ec={preferLocal:!0};var Tc=Oe(()=>({})),oP=Oe(()=>({isSync:!0})),iP=Oe(mi),sP=Oe(xc,{},Ec,wc),{sendMessage:vg,getOneMessage:$g,getEachMessage:jg,getCancelSignal:Ng}=fa();import{accessSync as kg}from"node:fs";import{isAbsolute as Gg}from"node:path";import"./process-contracts.js";import{captureProcessCreationIdentity as Wg,inspectProcessLiveness as zg}from"./process-identity.js";import{MAX_SUPERVISED_PROCESS_CAPTURE_BYTES as Vg}from"./process-limits.js";import{requireReadySignal as Yg,startReadyDeadline as Oc}from"./ready-deadline.js";import{toError as cr}from"../kernel/error-serialization.js";import{}from"./process-contracts.js";import{terminateAttributedProcessLineage as IP,terminateOwnedPosixProcessGroup as RP}from"./recovery.js";import{cleanupExitedProcessGroup as Ac,processGroupExists as Dc}from"./process-group.js";import{createShutdownDeadline as Hg,DEFAULT_SHUTDOWN_TIMEOUT_MS as Ae,FORCE_TERMINATION_WAIT_MS as Ic}from"./shutdown.js";import{settleStoppable as Kg}from"./stoppable-settlement.js";import{terminateWindowsProcessTree as Xg}from"./windows-native.js";import{cleanupExitedProcessGroup as CP}from"./process-group.js";function EP(e){if(Pc(e,!1),e.signal.aborted)return Promise.resolve($n());try{if(process.platform==="win32")return Qg(e);let t=e.timeoutStartsWhenReady;if(t!==void 0)return Jg(e,t);let r=lr(e,"bounded-capture",{cancelSignal:e.signal,forceKillAfterDelay:Ae,timeout:e.timeoutMs});return Mc(r)}catch(t){return Promise.resolve(ey(t))}}n(EP,"runManagedProcess");function Jg(e,t){let r=new AbortController,o=!1,i=lr(e,"bounded-capture",{cancelSignal:r.signal,forceKillAfterDelay:Ae}),s=n(()=>{r.abort()},"onAbort");e.signal.addEventListener("abort",s,{once:!0});let a=Oc({onExpired:n(()=>{r.signal.aborted||(o=!0,r.abort())},"onExpired"),ready:t,stdout:i.stdout,timeoutMs:e.timeoutMs});return i.finally(()=>{a(),e.signal.removeEventListener("abort",s)}),Mc(i).then(c=>o&&c.cancelled?{...c,cancelled:!1,timedOut:o}:c)}n(Jg,"runReadyManagedProcess");function Qg(e){let t=lr(e,"bounded-capture",{forceKillAfterDelay:!1,killDescendants:!1}),r=Date.now()+1e3,o=Kg(t,Ic),i=n(c=>{if(o.stop!==null)return;let l=t.nodeChildProcess,d=l.exitCode!==null||l.signalCode!==null;o.stopWith({reason:c,termination:d?Promise.resolve(null):Zg(t,r)})},"stop"),s=n(()=>{i("cancelled")},"onAbort");e.signal.addEventListener("abort",s,{once:!0});let a=Rc(e.timeoutMs,e.timeoutStartsWhenReady,t.stdout,()=>{i("timedOut")});return(async()=>{let c;try{c=await o.completion}finally{e.signal.removeEventListener("abort",s),a()}let l={cancelled:c.stop?.reason==="cancelled",timedOut:c.stop?.reason==="timedOut"};if(!c.abandoned)return{...vn(c.result,!0,c.terminationError),...l};let d=t.nodeChildProcess;for(let f of[t.stdin,t.stdout,t.stderr])f.destroy();return d.unref(),{...$n(),...l,exitCode:d.exitCode,exitSignal:d.signalCode,terminationError:c.terminationError}})()}n(Qg,"runWindowsManagedProcess");async function Zg(e,t){if(e.pid===void 0)return null;try{return await Xg(e.pid,t,Ae+Ic),null}catch(r){return qg(e.nodeChildProcess),cr(r)}}n(Zg,"terminateWindowsTree");function qg(e){e.exitCode!==null||e.signalCode!==null||e.kill()}n(qg,"terminateRootByHandle");var _n=class extends Error{static{n(this,"ProcessExitedBeforeReadyError")}exitCode;exitSignal;constructor(t,r){super("Process exited before becoming ready"),this.exitCode=t,this.exitSignal=r}};function TP(e){if(Pc(e,!0),e.signal.aborted)throw new Error(`${e.displayLabel} was cancelled before its process could start`);let t=e.timeoutStartsWhenReady,r=t===void 0?null:new AbortController,o=lr(e,e.outputMode,{forceKillAfterDelay:e.shutdownTimeoutMs===void 0?Ae:!1,...r!==null?{cancelSignal:r.signal}:e.timeoutMs===null?{}:{timeout:e.timeoutMs}}),i=o.pid;if(i===void 0)throw o.kill("SIGKILL"),new Error(`${e.displayLabel} could not start ${JSON.stringify(e.executable)}`);let s=!1,a=!1,c=!1,l=Hg(e.shutdownTimeoutMs??Ae),d=null,f={failure:null,cleanup:null},u=n(()=>{if(f.failure=null,l.deadlineAt!==null)try{d?.(l.deadlineAt)}catch(y){f.failure=cr(y)}},"publishShutdown"),p=n(y=>{c||(l.begin(y)&&u(),!s&&(s=!0,o.kill("SIGTERM"),f.cleanup=Ac(i,{remainingMs:l.remainingMs,initialSignalSent:!0,sendSignal:n((w,x)=>{o.kill(x)},"sendSignal")})))},"beginShutdown"),m=n(()=>{!s&&!c&&o.nodeChildProcess.exitCode===null&&o.nodeChildProcess.signalCode===null&&(a=!0),p()},"onAbort");for(let y of[o.stdout,o.stderr])y.once("close",()=>{!y.readableEnded&&o.nodeChildProcess.exitCode===null&&o.nodeChildProcess.signalCode===null&&p()});e.signal.addEventListener("abort",m,{once:!0});let g=e.timeoutMs===null?()=>{}:Rc(e.timeoutMs,t,o.stdout,()=>{s||r?.abort(),p()});o.nodeChildProcess.once("exit",()=>{process.platform!=="win32"&&Dc(i)&&p()});let S=e.recoveryIdentity==="none"?void 0:new Promise((y,w)=>{o.nodeChildProcess.once("error",w),o.nodeChildProcess.once("spawn",()=>{let x=Wg(i);if(x===null){let O=new Error(`${e.displayLabel} process creation identity could not be captured`);zg(i)==="absent"?o.nodeChildProcess.once("exit",(A,I)=>{w(new _n(A,I))}):(o.kill("SIGKILL"),w(O));return}y({pid:i,recovery:{creationIdentity:x,processGroupId:process.platform==="win32"?null:i}})})});S?.catch(()=>{});let b=(async()=>{let y=await o;g(),process.platform!=="win32"&&Dc(i)&&p();let w=f.cleanup===null?null:await f.cleanup,x=vn(y,e.outputMode==="bounded-capture",w??f.failure);return{...x,cancelled:a,timedOut:x.timedOut||r!==null&&y.isCanceled}})().finally(()=>{c=!0,e.signal.removeEventListener("abort",m),g(),f.failure===null&&(d=null)});return{completion:b,...S===void 0?{}:{ready:S},stderr:o.stderr,stdin:o.stdin,stdout:o.stdout,pid:i,shutdownTimeoutMs:e.shutdownTimeoutMs??Ae,get shutdownDeadlineAt(){return l.deadlineAt},onShutdownStarted(y){return d=y,l.deadlineAt!==null&&y(l.deadlineAt),()=>{d===y&&(d=null)}},async stop(y){return f.failure!==null&&u(),p(y),{...await b,terminationError:await f.cleanup??f.failure}}}}n(TP,"startSupervisedProcess");function Rc(e,t,r,o){if(t!==void 0)return Oc({onExpired:o,ready:t,stdout:r,timeoutMs:e});let i=setTimeout(o,e);return()=>{clearTimeout(i)}}n(Rc,"startTimeout");async function Mc(e){let t=e.pid,r=await e,o=t===void 0?null:await Ac(t);return vn(r,!0,o)}n(Mc,"settle");function lr(e,t,r){return process.platform==="win32"&&Gg(e.executable)&&kg(e.executable),Tc(e.executable,[...e.args],{buffer:t==="bounded-capture",maxBuffer:Vg/2,cleanup:!0,killDescendants:!0,...r,cwd:e.cwd,encoding:"utf8",env:e.env,extendEnv:!1,reject:!1,stderr:"pipe",stdin:"pipe",stdout:"pipe",stripFinalNewline:!1,windowsHide:!0,windowsVerbatimArguments:e.windowsVerbatimArguments})}n(lr,"launch");function vn(e,t,r){let o=e.failed&&e.exitCode===void 0&&e.signal===void 0&&!e.timedOut&&!e.isCanceled&&!e.isMaxBuffer?cr(e):null;return{cancelled:e.isCanceled,error:o,exitCode:e.exitCode??null,exitSignal:e.signal??null,outputLimitExceeded:e.isMaxBuffer,stderr:t?Cc(e.stderr):"",stdout:t?Cc(e.stdout):"",terminationError:r,timedOut:e.timedOut}}n(vn,"mapResult");function Cc(e){return typeof e=="string"?e:e instanceof Uint8Array?Buffer.from(e).toString("utf8"):""}n(Cc,"outputString");function Pc(e,t){if(e.executable.length===0)throw new Error("Managed process executable must be non-empty");if(e.cwd.length===0)throw new Error("Managed process working directory must be non-empty");if(e.displayLabel.trim().length===0)throw new Error("Managed process display label must be non-empty");if(e.timeoutMs!==null&&(!Number.isSafeInteger(e.timeoutMs)||e.timeoutMs<=0))throw new Error("Managed process timeout must be a positive safe integer");if(Yg(e.timeoutStartsWhenReady),e.timeoutStartsWhenReady!==void 0&&e.timeoutMs===null)throw new Error("A managed process ready signal needs a timeout to start");if(e.timeoutStartsWhenReady!==void 0&&"stdoutMarker"in e.timeoutStartsWhenReady&&"outputMode"in e&&e.outputMode==="caller-drained")throw new Error("A stdout ready marker needs bounded-capture output");if(t&&"recoveryIdentity"in e&&e.recoveryIdentity!==void 0&&!["capture","none"].includes(e.recoveryIdentity))throw new Error("Supervised process recovery identity mode must be capture or none");if(t&&"outputMode"in e&&!["bounded-capture","caller-drained"].includes(e.outputMode))throw new Error("Supervised process output mode must be bounded-capture or caller-drained")}n(Pc,"requireRequest");function $n(){return{cancelled:!0,error:null,exitCode:null,exitSignal:null,outputLimitExceeded:!1,stderr:"",stdout:"",terminationError:null,timedOut:!1}}n($n,"cancelledBeforeStart");function ey(e){return{...$n(),cancelled:!1,error:cr(e)}}n(ey,"startFailure");export{_n as ProcessExitedBeforeReadyError,CP as cleanupExitedProcessGroup,EP as runManagedProcess,TP as startSupervisedProcess,IP as terminateAttributedProcessLineage,RP as terminateOwnedPosixProcessGroup};
46
+ if (condition) { yield value; }`)},"validateEmptyReturn");import{Buffer as $p}from"node:buffer";import{StringDecoder as vp}from"node:string_decoder";var Ht=r((e,t,n)=>{if(n)return;if(e)return{transform:Np.bind(void 0,new TextEncoder)};let o=new vp(t);return{transform:jp.bind(void 0,o),final:kp.bind(void 0,o)}},"getEncodingTransformGenerator"),Np=r(function*(e,t){$p.isBuffer(t)?yield Y(t):typeof t=="string"?yield e.encode(t):yield t},"encodingUint8ArrayGenerator"),jp=r(function*(e,t){yield O(t)?e.write(t):t},"encodingStringGenerator"),kp=r(function*(e){let t=e.end();t!==""&&(yield t)},"encodingStringFinal");import{callbackify as Ys}from"node:util";var rr=Ys(async(e,t,n,o)=>{t.currentIterable=e(...n);try{for await(let i of t.currentIterable)o.push(i)}finally{delete t.currentIterable}}),Kt=r(async function*(e,t,n){if(n===t.length){yield e;return}let{transform:o=Wp}=t[n];for await(let i of o(e))yield*Kt(i,t,n+1)},"transformChunk"),Hs=r(async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Gp(n,Number(t),e)},"finalChunks"),Gp=r(async function*(e,t,n){if(e!==void 0)for await(let o of e())yield*Kt(o,n,t+1)},"generatorFinalChunks"),Ks=Ys(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Wp=r(function*(e){yield e},"identityGenerator");var or=r((e,t,n,o)=>{try{for(let i of e(...t))n.push(i);o()}catch(i){o(i)}},"pushChunksSync"),Xs=r((e,t)=>[...t.flatMap(n=>[...ie(n,e,0)]),...ze(e)],"runTransformSync"),ie=r(function*(e,t,n){if(n===t.length){yield e;return}let{transform:o=Vp}=t[n];for(let i of o(e))yield*ie(i,t,n+1)},"transformChunkSync"),ze=r(function*(e){for(let[t,{final:n}]of Object.entries(e))yield*zp(n,Number(t),e)},"finalChunksSync"),zp=r(function*(e,t,n){if(e!==void 0)for(let o of e())yield*ie(o,n,t+1)},"generatorFinalChunksSync"),Vp=r(function*(e){yield e},"identityGenerator");import{Transform as Yp,getDefaultHighWaterMark as Js}from"node:stream";var ir=r(({value:e,value:{transform:t,final:n,writableObjectMode:o,readableObjectMode:i},optionName:s},{encoding:a})=>{let c={},l=Qs(e,a,s),d=oe(t),f=oe(n),u=d?rr.bind(void 0,Kt,c):or.bind(void 0,ie),p=d||f?rr.bind(void 0,Hs,c):or.bind(void 0,ze),m=d||f?Ks.bind(void 0,c):void 0;return{stream:new Yp({writableObjectMode:o,writableHighWaterMark:Js(o),readableObjectMode:i,readableHighWaterMark:Js(i),transform(S,w,b){u([S,l,0],this,b)},flush(S){p([l],this,S)},destroy:m})}},"generatorToStream"),Xt=r((e,t,n,o)=>{let i=t.filter(({type:a})=>a==="generator"),s=o?i.reverse():i;for(let{value:a,optionName:c}of s){let l=Qs(a,n,c);e=Xs(l,e)}return e},"runGeneratorsSync"),Qs=r(({transform:e,final:t,binary:n,writableObjectMode:o,readableObjectMode:i,preserveNewlines:s},a,c)=>{let l={};return[{transform:zs(o,c)},Ht(n,a,o),Yt(n,s,o,l),{transform:e,final:t},{transform:Vs(i,c)},Gs({binary:n,preserveNewlines:s,readableObjectMode:i,state:l})].filter(Boolean)},"addInternalGenerators");var Zs=r((e,t)=>{for(let n of Hp(e))Kp(e,n,t)},"addInputOptionsSync"),Hp=r(e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),"getInputFdNumbers"),Kp=r((e,t,n)=>{let{stdioItems:o}=e[t],i=o.filter(({contents:c})=>c!==void 0);if(i.length===0)return;if(t!==0){let[{type:c,optionName:l}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${l}\`, can be ${q[c]} with synchronous methods.`)}let a=i.map(({contents:c})=>c).map(c=>Xp(c,o));n.input=Me(a)},"addInputOptionSync"),Xp=r((e,t)=>{let n=Xt(e,t,"utf8",!0);return Jp(n),Me(n)},"applySingleInputGeneratorsSync"),Jp=r(e=>{let t=e.find(n=>typeof n!="string"&&!O(n));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},"validateSerializable");var Jt=r(({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:o})=>o!=="all"&&le(n,o)&&!M.has(t)&&Qp(o)&&(e.some(({type:i,value:s})=>i==="native"&&Zp.has(s))||e.every(({type:i})=>B.has(i))),"shouldLogOutput"),Qp=r(e=>e===1||e===2,"isFdVerbose"),Zp=new Set(["pipe","overlapped"]),ea=r(async(e,t,n,o)=>{for await(let i of e)qp(t)||qs(i,n,o)},"logLines"),ta=r((e,t,n)=>{for(let o of e)qs(o,t,n)},"logLinesSync"),qp=r(e=>e._readableState.pipes.length>0,"isPipingStream"),qs=r((e,t,n)=>{let o=st(e);j({type:"output",verboseMessage:o,fdNumber:t,verboseInfo:n})},"logLine");import{writeFileSync as em,appendFileSync as tm}from"node:fs";var na=r(({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:o,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let s={},a=new Set;return{output:t.map((l,d)=>nm({result:l,fileDescriptors:e,fdNumber:d,state:s,outputFiles:a,isMaxBuffer:o,verboseInfo:i},n)),...s}},"transformOutputSync"),nm=r(({result:e,fileDescriptors:t,fdNumber:n,state:o,outputFiles:i,isMaxBuffer:s,verboseInfo:a},{buffer:c,encoding:l,lines:d,stripFinalNewline:f,maxBuffer:u})=>{if(e===null)return;let p=Zi(e,s,u),m=Y(p),{stdioItems:g,objectMode:S}=t[n],w=rm([m],g,l,o),{serializedResult:b,finalResult:E=b}=om({chunks:w,objectMode:S,encoding:l,lines:d,stripFinalNewline:f,fdNumber:n});im({serializedResult:b,fdNumber:n,state:o,verboseInfo:a,encoding:l,stdioItems:g,objectMode:S});let x=c[n]?E:void 0;try{return o.error===void 0&&sm(b,g,i),x}catch(D){return o.error=D,x}},"transformOutputResultSync"),rm=r((e,t,n,o)=>{try{return Xt(e,t,n,!1)}catch(i){return o.error=i,e}},"runOutputGeneratorsSync"),om=r(({chunks:e,objectMode:t,encoding:n,lines:o,stripFinalNewline:i,fdNumber:s})=>{if(t)return{serializedResult:e};if(n==="buffer")return{serializedResult:Me(e)};let a=Hr(e,n);return o[s]?{serializedResult:a,finalResult:nr(a,!i[s],t)}:{serializedResult:a}},"serializeChunks"),im=r(({serializedResult:e,fdNumber:t,state:n,verboseInfo:o,encoding:i,stdioItems:s,objectMode:a})=>{if(!Jt({stdioItems:s,encoding:i,verboseInfo:o,fdNumber:t}))return;let c=nr(e,!1,a);try{ta(c,t,o)}catch(l){n.error??=l}},"logOutputSync"),sm=r((e,t,n)=>{let o=t.filter(({type:i})=>Gt.has(i));for(let{path:i,append:s}of o){let a=typeof i=="string"?i:i.toString();s||n.has(a)?tm(i,e):(n.add(a),em(i,e))}},"writeToFiles");var ra=r(([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,J(t,n,"all")]:Array.isArray(t)?[J(e,n,"all"),...t]:O(e)&&O(t)?yn([e,t]):`${e}${t}`},"getAllSync");import{once as sr}from"node:events";var ia=r(async(e,t)=>{let[n,o]=await am(e);return t.isForcefullyTerminated??=!1,[n,o]},"waitForExit"),am=r(async e=>{let[t,n]=await Promise.allSettled([sr(e,"spawn"),sr(e,"exit")]);return t.status==="rejected"?[]:n.status==="rejected"?oa(e):n.value},"waitForExitOrError"),oa=r(async e=>{try{return await sr(e,"exit")}catch{return oa(e)}},"waitForSubprocessExit"),sa=r(async e=>{let[t,n]=await e;if(!cm(t,n)&&ar(t,n))throw new U;return[t,n]},"waitForSuccessfulExit"),cm=r((e,t)=>e===void 0&&t===void 0,"isSubprocessErrorExit"),ar=r((e,t)=>e!==0||t!==null,"isFailedExit");var aa=r(({error:e,status:t,signal:n,output:o},{maxBuffer:i})=>{let s=lm(e,t,n),a=s?.code==="ETIMEDOUT",c=Qi(s,o,i);return{resultError:s,exitCode:t,signal:n,timedOut:a,isMaxBuffer:c}},"getExitResultSync"),lm=r((e,t,n)=>e!==void 0?e:ar(t,n)?new U:void 0,"getResultError");import{spawnSync as dm}from"node:child_process";var ca=r((e,t,n)=>{let{file:o,commandArguments:i,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:d,fileDescriptors:f}=fm(e,t,n),u=mm({file:o,commandArguments:i,options:d,command:s,escapedCommand:a,verboseInfo:l,fileDescriptors:f,startTime:c});return we(u,l,d)},"execaCoreSync"),fm=r((e,t,n)=>{let{command:o,escapedCommand:i,startTime:s,verboseInfo:a}=ct(e,t,n),c=um(n),{file:l,commandArguments:d,options:f}=Rt(e,t,c);pm(f);let u=Ns(f,a);return{file:l,commandArguments:d,command:o,escapedCommand:i,startTime:s,verboseInfo:a,options:f,fileDescriptors:u}},"handleSyncArguments"),um=r(e=>e.node&&!e.ipc?{...e,ipc:!1}:e,"normalizeSyncOptions"),pm=r(({ipc:e,ipcInput:t,detached:n,cancelSignal:o,killDescendants:i})=>{t&&Ve("ipcInput"),e&&Ve("ipc: true"),n&&Ve("detached: true"),i&&Ve("killDescendants: true"),o&&Ve("cancelSignal")},"validateSyncOptions"),Ve=r(e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},"throwInvalidSyncOption"),mm=r(({file:e,commandArguments:t,options:n,command:o,escapedCommand:i,verboseInfo:s,fileDescriptors:a,startTime:c})=>{let l=hm({file:e,commandArguments:t,options:n,command:o,escapedCommand:i,fileDescriptors:a,startTime:c});if(l.failed)return l;let{resultError:d,exitCode:f,signal:u,timedOut:p,isMaxBuffer:m}=aa(l,n),{output:g,error:S=d}=na({fileDescriptors:a,syncResult:l,options:n,isMaxBuffer:m,verboseInfo:s}),w=g.map((E,x)=>J(E,n,x)),b=J(ra(g,n),n,"all");return Sm({error:S,exitCode:f,signal:u,timedOut:p,isMaxBuffer:m,stdio:w,all:b,options:n,command:o,escapedCommand:i,startTime:c})},"spawnSubprocessSync"),hm=r(({file:e,commandArguments:t,options:n,command:o,escapedCommand:i,fileDescriptors:s,startTime:a})=>{try{Zs(s,n);let c=gm(n);return dm(...Mt(e,t,c))}catch(c){return be({error:c,command:o,escapedCommand:i,fileDescriptors:s,options:n,startTime:a,isSync:!0})}},"runSubprocessSync"),gm=r(({encoding:e,maxBuffer:t,...n})=>({...n,encoding:"buffer",maxBuffer:vt(t)}),"normalizeSpawnSyncOptions"),Sm=r(({error:e,exitCode:t,signal:n,timedOut:o,isMaxBuffer:i,stdio:s,all:a,options:c,command:l,escapedCommand:d,startTime:f})=>e===void 0?Nt({command:l,escapedCommand:d,stdio:s,all:a,ipcOutput:[],options:c,startTime:f}):je({error:e,command:l,escapedCommand:d,timedOut:o,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:s,all:a,ipcOutput:[],options:c,startTime:f,isSync:!0}),"getSyncResult");import{once as cr,on as ym}from"node:events";var lr=Symbol("internalGetOneMessageOptions"),la=r(({anyProcess:e,channel:t,isSubprocess:n,ipc:o},i={})=>{let{reference:s=!0,filter:a}=i,{signal:c}=i[lr]??{};return ue({methodName:"getOneMessage",isSubprocess:n,ipc:o,isConnected:bt(e)}),bm({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:s,signal:c})},"getOneMessage"),bm=r(async({anyProcess:e,channel:t,isSubprocess:n,filter:o,reference:i,signal:s})=>{ht(t,i);let a=Z(e,t,n),c=new AbortController;wm(s,c);try{return await Promise.race([xm(a,o,c),Em(a,n,c),Tm(a,n,c)])}catch(l){throw pe(e),l}finally{c.abort(),gt(t,i)}},"getOneMessageAsync"),wm=r((e,t)=>{if(e!==void 0){if(e.aborted){t.abort();return}e.addEventListener("abort",()=>{t.abort()},{once:!0,signal:t.signal})}},"stopOnAbort"),xm=r(async(e,t,{signal:n})=>{if(t===void 0){let[o]=await cr(e,"message",{signal:n});return o}for await(let[o]of ym(e,"message",{signal:n}))if(t(o))return o},"getMessage"),Em=r(async(e,t,{signal:n})=>{await cr(e,"disconnect",{signal:n}),No(t)},"throwOnDisconnect"),Tm=r(async(e,t,{signal:n})=>{let[o]=await cr(e,"strict:error",{signal:n});throw mt(o,t)},"throwOnStrictError");import{once as da,on as Om}from"node:events";var dr=Symbol("internalGetEachMessageOptions"),ua=r((e,t={})=>{let{reference:n=!0}=t,{signal:o,shouldAwait:i=!e.isSubprocess}=t[dr]??{};return fr({...e,shouldAwait:i,reference:n,signal:o})},"getEachMessage"),fr=r(({anyProcess:e,waitProcess:t=e,channel:n,isSubprocess:o,ipc:i,shouldAwait:s,reference:a,signal:c})=>{ue({methodName:"getEachMessage",isSubprocess:o,ipc:i,isConnected:bt(e)}),ht(n,a);let l=Z(e,n,o),d=new AbortController,f={};return Am(c,d),Im(e,l,d),Dm({ipcEmitter:l,isSubprocess:o,controller:d,state:f}),Rm({anyProcess:e,waitProcess:t,channel:n,ipcEmitter:l,isSubprocess:o,shouldAwait:s,controller:d,state:f,reference:a})},"loopOnMessages"),Am=r((e,t)=>{if(e!==void 0){if(e.aborted){t.abort();return}e.addEventListener("abort",()=>{t.abort()},{once:!0,signal:t.signal})}},"stopOnAbort"),Im=r(async(e,t,n)=>{try{await da(t,"disconnect",{signal:n.signal}),n.abort()}catch{}},"stopOnDisconnect"),Dm=r(async({ipcEmitter:e,isSubprocess:t,controller:n,state:o})=>{try{let[i]=await da(e,"strict:error",{signal:n.signal});o.error=mt(i,t),n.abort()}catch{}},"abortOnStrictError"),Rm=r(async function*({anyProcess:e,waitProcess:t,channel:n,ipcEmitter:o,isSubprocess:i,shouldAwait:s,controller:a,state:c,reference:l}){try{for await(let[d]of Om(o,"message",{signal:a.signal}))fa(c),yield d}catch{fa(c)}finally{a.abort(),gt(n,l),i||pe(e),s&&await t}},"iterateOnMessages"),fa=r(({error:e})=>{if(e)throw e},"throwIfStrictError");import pa from"node:process";var ha=r((e,t,{ipc:n})=>{Object.assign(e,ma(t,!1,n,e))},"addIpcMethods"),ga=r(()=>{let e=pa,t=!0,n=pa.channel!==void 0;return{...ma(e,t,n),getCancelSignal:pi.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}},"getIpcExport"),ma=r((e,t,n,o=e)=>({sendMessage:me.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:la.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:ua.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n,waitProcess:o})}),"getIpcMethods");import{ChildProcess as Mm}from"node:child_process";import{PassThrough as Cm,Readable as Sa,Writable as ya,Duplex as ba}from"node:stream";var Oa=r(({error:e,command:t,escapedCommand:n,fileDescriptors:o,options:i,startTime:s,verboseInfo:a})=>{qn(o);let c=new Mm,l=Pm(c,o),d=be({error:e,command:t,escapedCommand:n,fileDescriptors:o,options:i,startTime:s,isSync:!1}),f=_m(d,a,i);return{subprocess:c,promise:f,all:i.all?l:void 0,convertedStreams:{readable:wa,writable:xa,duplex:Ea,readableStream:Lm,writableStream:Bm,transformStream:Fm,iterable:Ta,[Symbol.asyncIterator]:Ta}}},"handleEarlyError"),Pm=r((e,t)=>{let n=Ye(),o=Ye(),i=Ye(),s=Array.from({length:t.length-3},Ye),a=Ye(),c=[n,o,i,...s];return Object.assign(e,{stdin:n,stdout:o,stderr:i,stdio:c}),a},"createDummyStreams"),Ye=r(()=>{let e=new Cm;return e.end(),e},"createDummyStream"),wa=r(()=>new Sa({read(){}}),"readable"),xa=r(()=>new ya({write(){}}),"writable"),Ea=r(()=>new ba({read(){},write(){}}),"duplex"),Lm=r(()=>Sa.toWeb(wa()),"readableStream"),Bm=r(()=>ya.toWeb(xa()),"writableStream"),Fm=r(()=>ba.toWeb(Ea()),"transformStream"),Ta=r(async function*(){},"iterable"),_m=r(async(e,t,n)=>we(e,t,n),"handleDummyPromise");import{createReadStream as Aa,createWriteStream as Ia}from"node:fs";import{Buffer as Um}from"node:buffer";import{Readable as He,Writable as $m,Duplex as vm}from"node:stream";var Ra=r((e,t)=>Vt(Nm,e,t,!1),"handleStdioAsync"),Ke=r(({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${q[e]}.`)},"forbiddenIfAsync"),Da={fileNumber:Ke,generator:ir,asyncGenerator:ir,nodeStream:r(({value:e})=>({stream:e}),"nodeStream"),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let o=t||n;return{stream:vm.fromWeb(e,{objectMode:o})}},duplex:r(({value:{transform:e}})=>({stream:e}),"duplex"),native(){}},Nm={input:{...Da,fileUrl:r(({value:e})=>({stream:Aa(e)}),"fileUrl"),filePath:r(({value:{file:e}})=>({stream:Aa(e)}),"filePath"),webStream:r(({value:e})=>({stream:He.fromWeb(e)}),"webStream"),iterable:r(({value:e})=>({stream:He.from(e)}),"iterable"),asyncIterable:r(({value:e})=>({stream:He.from(e)}),"asyncIterable"),string:r(({value:e})=>({stream:He.from(e)}),"string"),uint8Array:r(({value:e})=>({stream:He.from(Um.from(e))}),"uint8Array")},output:{...Da,fileUrl:r(({value:e})=>({stream:Ia(e)}),"fileUrl"),filePath:r(({value:{file:e,append:t}})=>({stream:Ia(e,t?{flags:"a"}:{})}),"filePath"),webStream:r(({value:e})=>({stream:$m.fromWeb(e)}),"webStream"),iterable:Ke,asyncIterable:Ke,string:Ke,uint8Array:Ke}};import{on as jm,once as Ma}from"node:events";import{PassThrough as km,getDefaultHighWaterMark as Gm}from"node:stream";import{finished as Ca}from"node:stream/promises";function se(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let i of e)pr(i);let t=e.some(({readableObjectMode:i})=>i),n=Wm(e,t),o=new ur({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let i of e)o.add(i);return o}r(se,"mergeStreams");var Wm=r((e,t)=>{if(e.length===0)return Gm(t);let n=e.filter(({readableObjectMode:o})=>o===t).map(({readableHighWaterMark:o})=>o);return Math.max(...n)},"getHighWaterMark"),ur=class extends km{static{r(this,"MergedStream")}#t=new Set([]);#n=new Set([]);#e=new Set([]);#r;#i=Symbol("unpipe");#o=new WeakMap;add(t){if(pr(t),this.#t.has(t))return;this.#t.add(t),this.#r??=zm(this,this.#t,this.#i);let n=Hm({passThroughStream:this,stream:t,streams:this.#t,ended:this.#n,aborted:this.#e,onFinished:this.#r,unpipeEvent:this.#i});this.#o.set(t,n),t.pipe(this,{end:!1})}async remove(t){if(pr(t),!this.#t.has(t))return!1;let n=this.#o.get(t);return n===void 0?!1:(this.#o.delete(t),t.unpipe(this),await n,!0)}},zm=r(async(e,t,n)=>{Qt(e,Fa);let o=new AbortController;try{await Promise.race([Vm(e,o),Ym(e,t,n,o)])}finally{o.abort(),Qt(e,-Fa)}},"onMergedStreamFinished"),Vm=r(async(e,{signal:t})=>{try{await Ca(e,{signal:t,cleanup:!0})}catch(n){throw Pa(e,n),n}},"onMergedStreamEnd"),Ym=r(async(e,t,n,{signal:o})=>{for await(let[i]of jm(e,"unpipe",{signal:o}))t.has(i)&&i.emit(n)},"onInputStreamsUnpipe"),pr=r(e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},"validateStream"),Hm=r(async({passThroughStream:e,stream:t,streams:n,ended:o,aborted:i,onFinished:s,unpipeEvent:a})=>{Qt(e,_a);let c=new AbortController;try{await Promise.race([Km(s,t,c),Xm({passThroughStream:e,stream:t,streams:n,ended:o,aborted:i,controller:c}),Jm({stream:t,streams:n,ended:o,aborted:i,unpipeEvent:a,controller:c})])}finally{c.abort(),Qt(e,-_a)}n.size>0&&n.size===o.size+i.size&&(o.size===0&&i.size>0?mr(e):Qm(e))},"endWhenStreamsDone"),Km=r(async(e,t,{signal:n})=>{try{await e,n.aborted||mr(t)}catch(o){n.aborted||Pa(t,o)}},"afterMergedStreamFinished"),Xm=r(async({passThroughStream:e,stream:t,streams:n,ended:o,aborted:i,controller:{signal:s}})=>{try{await Ca(t,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&o.add(t)}catch(a){if(s.aborted||!n.has(t))return;La(a)?i.add(t):Ba(e,a)}},"onInputStreamEnd"),Jm=r(async({stream:e,streams:t,ended:n,aborted:o,unpipeEvent:i,controller:{signal:s}})=>{if(await Ma(e,i,{signal:s}),!e.readable)return Ma(s,"abort",{signal:s});t.delete(e),n.delete(e),o.delete(e)},"onInputStreamUnpipe"),Qm=r(e=>{e.writable&&e.end()},"endStream"),Pa=r((e,t)=>{La(t)?mr(e):Ba(e,t)},"errorOrAbortStream"),La=r(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isAbortError"),mr=r(e=>{(e.readable||e.writable)&&e.destroy()},"abortStream"),Ba=r((e,t)=>{e.destroyed||(e.once("error",Zm),e.destroy(t))},"errorStream"),Zm=r(()=>{},"noop"),Qt=r((e,t)=>{let n=e.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&e.setMaxListeners(n+t)},"updateMaxListeners"),Fa=2,_a=1;import{finished as Ua}from"node:stream/promises";var Te=r((e,t)=>{e.pipe(t),qm(e,t),eh(e,t)},"pipeStreams"),qm=r(async(e,t)=>{if(!(_(e)||_(t))){try{await Ua(e,{cleanup:!0,readable:!0,writable:!1})}catch{}hr(t)}},"onSourceFinish"),hr=r(e=>{e.writable&&e.end()},"endDestinationStream"),eh=r(async(e,t)=>{if(!(_(e)||_(t))){try{await Ua(t,{cleanup:!0,readable:!1,writable:!0})}catch{}gr(e)}},"onDestinationFinish"),gr=r(e=>{e.readable&&e.destroy()},"abortSourceStream");var $a=r((e,t,n)=>{let o=new Map;for(let[i,{stdioItems:s,direction:a}]of Object.entries(t)){let c=s.filter(({type:d})=>B.has(d));for(let{stream:d}of c)th(e,d,a,i);let l=s.filter(({type:d})=>!B.has(d));for(let{stream:d}of l)rh({subprocess:e,stream:d,direction:a,fdNumber:i,pipeGroups:o,controller:n})}for(let[i,s]of o){let a=s.length===1?s[0]:se(s);Te(a,i)}},"pipeOutputAsync"),th=r((e,t,n,o)=>{n==="output"?Te(e.stdio[o],t):Te(t,e.stdio[o]);let i=nh[o];i!==void 0&&(e[i]=t),e.stdio[o]=t},"pipeTransform"),nh=["stdin","stdout","stderr"],rh=r(({subprocess:e,stream:t,direction:n,fdNumber:o,pipeGroups:i,controller:s})=>{if(t===void 0)return;oh(t,s);let[a,c]=n==="output"?[t,e.stdio[o]]:[e.stdio[o],t],l=i.get(a)??[];i.set(a,[...l,c])},"pipeStdioItem"),oh=r((e,{signal:t})=>{_(e)&&ne(e,ih,t)},"setStandardStreamMaxListeners"),ih=2;import Zt from"node:process";import{execFile as sh}from"node:child_process";import va from"node:path/win32";var Na=Zt.platform==="win32",ja=r(e=>e.killDescendants&&!Na?{...e,detached:!0}:e,"getSpawnOptions"),ka=r((e,{killDescendants:t})=>t?(Na?ch:ah).bind(void 0,e):e.kill.bind(e),"getKillFunction"),ah=r((e,t)=>{if(e.pid===void 0)return!1;try{return Zt.kill(-e.pid,t)}catch{return e.kill(t)}},"killDescendantsUnix"),ch=r((e,t)=>{if(e.pid===void 0)return!1;let n=lh();return n===void 0?e.kill(t):(sh(n,["/pid",`${e.pid}`,"/T","/F"],o=>{o&&e.kill(t)}),!0)},"killDescendantsWindows"),lh=r(()=>{let e=[Zt.env.SystemRoot,Zt.env.windir].find(t=>t&&dh(t));return e===void 0?void 0:va.join(e,"System32","taskkill.exe")},"getTaskkillFile"),dh=r(e=>{let{root:t}=va.parse(e);return/^[a-z]:[/\\]/i.test(t)},"isWindowsDriveAbsolutePath");var ee=[];ee.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&ee.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&ee.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var qt=r(e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function","processOk"),Sr=Symbol.for("signal-exit emitter"),yr=globalThis,fh=Object.defineProperty.bind(Object),br=class{static{r(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(yr[Sr])return yr[Sr];fh(yr,Sr,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,n){this.listeners[t].push(n)}removeListener(t,n){let o=this.listeners[t],i=o.indexOf(n);i!==-1&&(i===0&&o.length===1?o.length=0:o.splice(i,1))}emit(t,n,o){if(this.emitted[t])return!1;this.emitted[t]=!0;let i=!1;for(let s of this.listeners[t])i=s(n,o)===!0||i;return t==="exit"&&(i=this.emit("afterExit",n,o)||i),i}},en=class{static{r(this,"SignalExitBase")}},uh=r(e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),"signalExitWrap"),wr=class extends en{static{r(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}},xr=class extends en{static{r(this,"SignalExit")}#t=Er.platform==="win32"?"SIGINT":"SIGHUP";#n=new br;#e;#r;#i;#o={};#s=!1;constructor(t){super(),this.#e=t,this.#o={};for(let n of ee)this.#o[n]=()=>{let o=this.#e.listeners(n),{count:i}=this.#n,s=t;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),o.length===i){this.unload();let a=this.#n.emit("exit",null,n),c=n==="SIGHUP"?this.#t:n;a||t.kill(t.pid,c)}};this.#i=t.reallyExit,this.#r=t.emit}onExit(t,n){if(!qt(this.#e))return()=>{};this.#s===!1&&this.load();let o=n?.alwaysLast?"afterExit":"exit";return this.#n.on(o,t),()=>{this.#n.removeListener(o,t),this.#n.listeners.exit.length===0&&this.#n.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#n.count+=1;for(let t of ee)try{let n=this.#o[t];n&&this.#e.on(t,n)}catch{}this.#e.emit=(t,...n)=>this.#c(t,...n),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#s&&(this.#s=!1,ee.forEach(t=>{let n=this.#o[t];if(!n)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,n)}catch{}}),this.#e.emit=this.#r,this.#e.reallyExit=this.#i,this.#n.count-=1)}#a(t){return qt(this.#e)?(this.#e.exitCode=t||0,this.#n.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#c(t,...n){let o=this.#r;if(t==="exit"&&qt(this.#e)){typeof n[0]=="number"&&(this.#e.exitCode=n[0]);let i=o.call(this.#e,t,...n);return this.#n.emit("exit",this.#e.exitCode,null),i}else return o.call(this.#e,t,...n)}},Er=globalThis.process,{onExit:Ga,load:FD,unload:_D}=uh(qt(Er)?new xr(Er):new wr);import{addAbortListener as ph}from"node:events";var Wa=r((e,{cleanup:t,detached:n},{signal:o})=>{if(!t||n)return;let i=Ga(()=>{e()});ph(o,()=>{i()})},"cleanupOnExit");var tn=r(()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),"initializeConcurrentStreams"),Xe=r((e,t,n)=>{let o=e[n];o.has(t)||o.set(t,[]);let i=o.get(t),s=k();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},"addConcurrentStream"),Oe=r(async({resolve:e,promises:t},n)=>{e();let[o]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!o},"waitForConcurrentStreams");import{on as mh}from"node:events";import{getDefaultHighWaterMark as hh}from"node:stream";var nn=r(({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:o,encoding:i,preserveNewlines:s})=>{let a=new AbortController;return gh(t,a),za({stream:e,controller:a,binary:n,shouldEncode:!e.readableObjectMode&&o,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:s})},"iterateOnSubprocessStream"),gh=r(async(e,t)=>{try{await e}catch{}finally{t.abort()}},"stopReadingOnExit"),Tr=r(({stream:e,onStreamEnd:t,lines:n,encoding:o,stripFinalNewline:i,allMixed:s})=>{let a=new AbortController;Sh(t,a,e);let c=e.readableObjectMode&&!s;return za({stream:e,controller:a,binary:o==="buffer",shouldEncode:!c,encoding:o,shouldSplit:!c&&n,preserveNewlines:!i})},"iterateForResult"),Sh=r(async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},"stopReadingOnStreamEnd"),za=r(({stream:e,controller:t,binary:n,shouldEncode:o,encoding:i,shouldSplit:s,preserveNewlines:a})=>{let c=mh(e,"data",{signal:t.signal,highWaterMark:Va,highWatermark:Va});return yh({onStdoutChunk:c,controller:t,binary:n,shouldEncode:o,encoding:i,shouldSplit:s,preserveNewlines:a})},"iterateOnStream"),Or=hh(!0),Va=Or,yh=r(async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:o,encoding:i,shouldSplit:s,preserveNewlines:a}){let c=bh({binary:n,shouldEncode:o,encoding:i,shouldSplit:s,preserveNewlines:a});try{for await(let[l]of e)yield*ie(l,c,0)}catch(l){if(!t.signal.aborted)throw l}finally{yield*ze(c)}},"iterateOnData"),bh=r(({binary:e,shouldEncode:t,encoding:n,shouldSplit:o,preserveNewlines:i})=>[Ht(e,n,!t),Yt(e,i,!o,{})].filter(Boolean),"getGenerators");var Ae=r((e,t,{from:n,binary:o=!1,preserveNewlines:i=!1}={})=>{let s=o||M.has(t),a=Ee(e,n),c=nn({subprocessStdout:a,subprocess:e,binary:s,shouldEncode:!0,encoding:t,preserveNewlines:i});return wh(c,a,e)},"createIterable"),wh=r(async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},"iterateOnStdoutData");import{finished as xh}from"node:stream/promises";var Je=r(async(e,t,n,{isSameDirection:o,stopOnExit:i=!1}={})=>{let s=Eh(e,n),a=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],xh(e,{cleanup:!0,signal:a.signal})])}catch(c){s.stdinCleanedUp||Ah(c,t,n,o)}finally{a.abort()}},"waitForStream"),Eh=r((e,{originalStreams:t,subprocess:n})=>{let[o]=t,i={stdinCleanedUp:!1};return e===o&&Th(e,n,i),i},"handleStdinDestroy"),Th=r((e,t,n)=>{let{_destroy:o}=e;e._destroy=(...i)=>{Oh(t,n),o.call(e,...i)}},"spyOnStdinDestroy"),Oh=r(({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},"setStdinCleanedUp"),Ah=r((e,t,n,o)=>{if(!Ih(e,t,n,o))throw e},"handleStreamError"),Ih=r((e,t,n,o=!0)=>n.propagating?Ya(e)||Ie(e):(n.propagating=!0,Ar(n,t)===o?Ya(e):Ie(e)),"shouldIgnoreStreamError"),Ar=r(({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input","isInputFileDescriptor"),Ie=r(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isStreamAbort"),Ya=r(e=>e?.code==="EPIPE","isStreamEpipe");import{finished as Ha}from"node:stream/promises";var Ir=r(async e=>{if(e!==void 0)try{await Dr(e)}catch{}},"safeWaitForSubprocessStdin"),Ka=r(async e=>{if(e!==void 0)try{await Rr(e)}catch{}},"safeWaitForSubprocessStdout"),Dr=r(async e=>{await Ha(e,{cleanup:!0,readable:!1,writable:!0})},"waitForSubprocessStdin"),Rr=r(async e=>{await Ha(e,{cleanup:!0,readable:!0,writable:!1})},"waitForSubprocessStdout"),rn=r(async(e,t)=>{if(await e,t)throw t},"waitForSubprocess"),on=r((e,t,n)=>{n&&!Ie(n)?e.destroy(n):t&&e.destroy()},"destroyOtherStream");import{Readable as Dh}from"node:stream";import{callbackify as Rh}from"node:util";var sn=r(({subprocess:e,concurrentStreams:t,encoding:n},{from:o,binary:i=!0,preserveNewlines:s=!0}={})=>{let a=i||M.has(n),{subprocessStdout:c,waitReadableDestroy:l}=Mr(e,o,t),{readableEncoding:d,readableObjectMode:f,readableHighWaterMark:u}=Cr(c,a),{read:p,onStdoutDataDone:m}=Pr({subprocessStdout:c,subprocess:e,binary:a,encoding:n,preserveNewlines:s}),g=new Dh({read:p,destroy:Rh(Br.bind(void 0,{subprocessStdout:c,subprocess:e,waitReadableDestroy:l})),highWaterMark:u,objectMode:f,encoding:d});return Lr({subprocessStdout:c,onStdoutDataDone:m,readable:g,subprocess:e}),g},"createReadable"),Mr=r((e,t,n)=>{let o=Ee(e,t),i=Xe(n,o,"readableDestroy");return{subprocessStdout:o,waitReadableDestroy:i}},"getSubprocessStdout"),Cr=r(({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},o)=>o?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Or},"getReadableOptions"),Pr=r(({subprocessStdout:e,subprocess:t,binary:n,encoding:o,preserveNewlines:i})=>{let s=k(),a=nn({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:o,preserveNewlines:i});return{read(){Mh(this,a,s)},onStdoutDataDone:s}},"getReadableMethods"),Mh=r(async(e,t,n)=>{try{let{value:o,done:i}=await t.next();i?n.resolve():e.push(o)}catch{}},"onRead"),Lr=r(async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:o,subprocessStdin:i})=>{try{await Rr(e),await o,await Ir(i),await t,n.readable&&n.push(null)}catch(s){await Ir(i),Xa(n,await Ch(o,s))}},"onStdoutFinished"),Ch=r(async(e,t)=>{if(t.code!=="ERR_STREAM_PREMATURE_CLOSE")return t;try{await e}catch(n){return n}return t},"getPrematureCloseError"),Br=r(async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},o)=>{await Oe(n,t)&&(Xa(e,o),await rn(t,o))},"onReadableDestroy"),Xa=r((e,t)=>{on(e,e.readable,t)},"destroyOtherReadable");import{Readable as Ph,Writable as Lh,Duplex as Bh}from"node:stream";var an=r((e,t)=>Ph.toWeb(e.readable(t)),"createReadableStream"),Ja=r((e,t)=>Lh.toWeb(e.writable(t)),"createWritableStream"),Qa=r((e,t)=>Bh.toWeb(e.duplex(t)),"createTransformStream");var qa=r(({source:e,sourcePromise:t,boundOptions:n,createNested:o},...i)=>{let s=at(),{destination:a,destinationStream:c,destinationError:l,from:d,unpipeSignal:f}=Fh(n,o,i),{sourceStream:u,sourceError:p}=Uh(e,d),{options:m,fileDescriptors:g}=W.get(e);return{sourcePromise:t,sourceStream:u,sourceOptions:m,sourceError:p,destination:a,destinationStream:c,destinationError:l,unpipeSignal:f,fileDescriptors:g,startTime:s}},"normalizePipeArguments"),Fh=r((e,t,n)=>{try{let{destination:o,pipeOptions:{from:i,to:s,unpipeSignal:a}={}}=_h(e,t,...n),c=zt(o,s);return{destination:o,destinationStream:c,from:i,unpipeSignal:a}}catch(o){return{destinationError:o}}},"getDestinationStream"),_h=r((e,t,n,...o)=>{if(Array.isArray(n))return{destination:t(Za,e)(n,...o),pipeOptions:e};if(typeof n=="string"||n instanceof URL||gn(n)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,s,a]=Qe(n,...o);return{destination:t(Za)(i,s,a),pipeOptions:a}}if(W.has(n)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:o[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},"getDestination"),Za=r(({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),"mapDestinationArguments"),Uh=r((e,t)=>{try{return{sourceStream:Ee(e,t)}}catch(n){return{sourceError:n}}},"getSourceStream");var tc=r(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:o,fileDescriptors:i,sourceOptions:s,startTime:a})=>{let c=$h({sourceStream:e,sourceError:t,destinationStream:n,destinationError:o});if(c!==void 0)throw Fr({error:c,fileDescriptors:i,sourceOptions:s,startTime:a})},"handlePipeArgumentsError"),$h=r(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:o})=>{if(t!==void 0&&o!==void 0)return o;if(o!==void 0)return gr(e),o;if(t!==void 0)return hr(n),t},"getPipeArgumentsError"),Fr=r(({error:e,fileDescriptors:t,sourceOptions:n,startTime:o})=>be({error:e,command:ec,escapedCommand:ec,fileDescriptors:t,options:n,startTime:o,isSync:!1}),"createNonCommandError"),ec="source.pipe(destination)";var nc=r(async e=>{let[{status:t,reason:n,value:o=n},{status:i,reason:s,value:a=s}]=await e;if(a.pipedFrom.includes(o)||a.pipedFrom.push(o),i==="rejected")throw a;if(t==="rejected")throw o;return a},"waitForBothSubprocesses");import{finished as vh}from"node:stream/promises";var rc=r((e,t,n)=>{let o=cn.has(t)?jh(e,t):Nh(e,t);return ne(e,Gh,n.signal),ne(t,Wh,n.signal),kh(t),o},"pipeSubprocessStream"),Nh=r((e,t)=>{let n=se([e]);return Te(n,t),cn.set(t,n),n},"pipeFirstSubprocessStream"),jh=r((e,t)=>{let n=cn.get(t);return n.add(e),n},"pipeMoreSubprocessStream"),kh=r(async e=>{try{await vh(e,{cleanup:!0,readable:!1,writable:!0})}catch{}cn.delete(e)},"cleanupMergedStreamsMap"),cn=new WeakMap,Gh=2,Wh=1;import{aborted as zh}from"node:util";var oc=r((e,t)=>e===void 0?[]:[Vh(e,t)],"unpipeOnAbort"),Vh=r(async(e,{sourceStream:t,mergedStream:n,fileDescriptors:o,sourceOptions:i,startTime:s})=>{await zh(e,t),await n.remove(t);let a=new Error("Pipe canceled by `unpipeSignal` option.");throw Fr({error:a,fileDescriptors:o,sourceOptions:i,startTime:s})},"unpipeOnSignalAbort");var ln=r((e,...t)=>{if(T(t[0]))return ln.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...o}=qa(e,...t),i=new AbortController,s=og({...o,destination:n,pipeFailureController:i});return s.pipe=ln.bind(void 0,{...e,source:n,sourcePromise:s,boundOptions:{}}),Yh(s,n,i.signal),s},"pipeToSubprocess"),Yh=r((e,t,n)=>{t!==void 0&&(Hh(e,t),Qh(e,t,n))},"forwardDestinationMethods"),Hh=r((e,t)=>{let n=W.get(t);W.set(e,n),e.stdio=t.stdio,e.all=t.all;let{options:{encoding:o}}=n,i=tn();e[Symbol.asyncIterator]=Ae.bind(void 0,e,o,{}),e.iterable=Ae.bind(void 0,e,o),e.readable=Xh.bind(void 0,e,{subprocess:e,concurrentStreams:i,encoding:o}),e.readableStream=an.bind(void 0,e),Kh(e,t)},"forwardReadableMethods"),Kh=r((e,t)=>{if(t.all===void 0){e.all=void 0;return}Object.defineProperty(e,"all",{get(){ic(e,t.all);let n=e.readable({from:"all"});return ic(e,n),n},enumerable:!0,configurable:!0})},"forwardAll"),ic=r((e,t)=>{Object.defineProperty(e,"all",{value:t,writable:!0,enumerable:!0,configurable:!0})},"setAllProperty"),Xh=r((e,t,...n)=>{let o=sn(t,...n);return Jh(e,o),o},"createPipeReadable"),Jh=r(async(e,t)=>{try{await e}catch(n){t.destroy(n)}},"destroyOnPipeFailure"),Qh=r((e,t,n)=>{e.sendMessage=t.sendMessage,e.getOneMessage=Zh.bind(void 0,t,n),e.getEachMessage=tg.bind(void 0,e,t,n)},"forwardIpcMethods"),Zh=r((e,t,...n)=>{let o=new AbortController,i=e.getOneMessage(...sc(n,o.signal,lr));return qh(t,i,o)},"getOnePipeMessage"),qh=r(async(e,t,n)=>{try{return await Promise.race([t,eg(e,n.signal)])}finally{n.abort()}},"waitForOnePipeMessage"),eg=r((e,t)=>new Promise((n,o)=>{if(e.aborted){o(e.reason);return}e.addEventListener("abort",()=>{o(e.reason)},{once:!0,signal:t})}),"getSignalRejection"),tg=r((e,t,n,...o)=>{let i=new AbortController,s=t.getEachMessage(...sc(o,i.signal,dr));return rg(n,i),ng(e,s,i)},"getEachPipeMessage"),ng=r(async function*(e,t,n){try{yield*t}finally{n.abort(),await e}},"iterateOnPipeMessages"),sc=r((e,t,n)=>{if(e[0]===null)return e;let[o]=e;return[{...o,[n]:{signal:t,shouldAwait:!1}}]},"addPipeOptions"),rg=r((e,t)=>{if(e.aborted){t.abort();return}e.addEventListener("abort",()=>{t.abort()},{once:!0,signal:t.signal})},"abortOnSignal"),og=r(async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:o,destination:i,destinationStream:s,destinationError:a,unpipeSignal:c,fileDescriptors:l,startTime:d,pipeFailureController:f})=>{let u=new AbortController;try{let p=ig(e,i);tc({sourceStream:t,sourceError:o,destinationStream:s,destinationError:a,fileDescriptors:l,sourceOptions:n,startTime:d});let m=rc(t,s,u);return await Promise.race([nc(p),...oc(c,{sourceStream:t,mergedStream:m,sourceOptions:n,fileDescriptors:l,startTime:d})])}catch(p){throw f.abort(p),p}finally{u.abort()}},"handlePipePromise"),ig=r((e,t)=>Promise.allSettled([e,t]),"getSubprocessPromises");import{setImmediate as sg}from"node:timers/promises";var cc=r(async({stream:e,onStreamEnd:t,fdNumber:n,encoding:o,buffer:i,maxBuffer:s,lines:a,allMixed:c,stripFinalNewline:l,verboseInfo:d,streamInfo:f})=>{let u=ag({stream:e,onStreamEnd:t,fdNumber:n,encoding:o,allMixed:c,verboseInfo:d,streamInfo:f});if(!i){await Promise.all([cg(e),u]);return}let p=er(l,n),m=Tr({stream:e,onStreamEnd:t,lines:a,encoding:o,stripFinalNewline:p,allMixed:c}),[g]=await Promise.all([lg({stream:e,iterable:m,fdNumber:n,encoding:o,maxBuffer:s,lines:a}),u]);return g},"getStreamOutput"),ag=r(async({stream:e,onStreamEnd:t,fdNumber:n,encoding:o,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!Jt({stdioItems:a[n]?.stdioItems,encoding:o,verboseInfo:s,fdNumber:n}))return;let c=Tr({stream:e,onStreamEnd:t,lines:!0,encoding:o,stripFinalNewline:!0,allMixed:i});await ea(c,e,n,s)},"logOutputAsync"),cg=r(async e=>{await sg(),e.readableFlowing===null&&e.resume()},"resumeStream"),lg=r(async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:o,encoding:i,maxBuffer:s,lines:a})=>{try{return t||a?await Ft(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await _t(n,{maxBuffer:s})):await $t(n,{maxBuffer:s})}catch(c){return ac(Ki({error:c,stream:e,readableObjectMode:t,lines:a,encoding:i,fdNumber:o}))}},"getStreamContents"),_r=r(async e=>{try{return await e}catch(t){return ac(t)}},"getBufferedData"),ac=r(({bufferedData:e})=>Yr(e)?new Uint8Array(e):e,"handleBufferedData");var lc=r(({subprocess:e,encoding:t,buffer:n,maxBuffer:o,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:c})=>e.stdio.map((l,d)=>Ur({stream:l,fdNumber:d,encoding:t,buffer:n[d],maxBuffer:o[d],lines:i[d],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:c})),"waitForStdioStreams"),Ur=r(async({stream:e,fdNumber:t,encoding:n,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:d})=>{if(!e)return;let f=Je(e,t,d);if(Ar(d,t)){await f;return}let[u]=await Promise.all([cc({stream:e,onStreamEnd:f,fdNumber:t,encoding:n,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:d}),f]);return u},"waitForSubprocessStream");var dc=r(({stdout:e,stderr:t},{all:n})=>n&&(e||t)?se([e,t].filter(Boolean)):void 0,"makeAllStream"),fc=r(({subprocess:e,all:t,encoding:n,buffer:o,maxBuffer:i,lines:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>Ur({...dg(e,t,o),fdNumber:"all",encoding:n,maxBuffer:i[1]+i[2],lines:s[1]||s[2],allMixed:fg(e,t),stripFinalNewline:a,verboseInfo:c,streamInfo:l}),"waitForAllStream"),dg=r(({stdout:e,stderr:t},n,[,o,i])=>{let s=o||i;return s?o?i?{stream:n,buffer:s}:{stream:e,buffer:s}:{stream:t,buffer:s}:{stream:n,buffer:s}},"getAllStream"),fg=r(({stdout:e,stderr:t},n)=>n&&e&&t&&e.readableObjectMode!==t.readableObjectMode,"getAllMixed");var uc=r(e=>le(e,"ipc"),"shouldLogIpc"),pc=r((e,t)=>{let n=st(e);j({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:t})},"logIpcOutput");var mc=r(async({subprocess:e,buffer:t,maxBuffer:n,ipc:o,ipcOutput:i,verboseInfo:s})=>{if(!o)return i;let a=uc(s),c=H(t,"ipc"),l=H(n,"ipc");for await(let d of fr({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:o,shouldAwait:!1,reference:!0}))c&&(Xi(e,i,l),i.push(d)),a&&pc(d,s);return i},"waitForIpcOutput"),hc=r(async(e,t)=>(await Promise.allSettled([e]),t),"getBufferedIpcOutput");import{once as ug}from"node:events";var gc=r(async({subprocess:e,kill:t,all:n,options:{encoding:o,buffer:i,maxBuffer:s,lines:a,timeoutDuration:c,cancelSignal:l,gracefulCancel:d,forceKillAfterDelay:f,stripFinalNewline:u,ipc:p,ipcInput:m},context:g,verboseInfo:S,fileDescriptors:w,originalStreams:b,onInternalError:E,controller:x})=>{let D=ia(e,g),A={originalStreams:b,fileDescriptors:w,subprocess:e,exitPromise:D,propagating:!1},R=lc({subprocess:e,encoding:o,buffer:i,maxBuffer:s,lines:a,stripFinalNewline:u,verboseInfo:S,streamInfo:A}),C=fc({subprocess:e,all:n,encoding:o,buffer:i,maxBuffer:s,lines:a,stripFinalNewline:u,verboseInfo:S,streamInfo:A}),N=[],F=mc({subprocess:e,buffer:i,maxBuffer:s,ipc:p,ipcOutput:N,verboseInfo:S}),y=pg(b,e,A),I=mg(w,A);try{return await Promise.race([Promise.all([{},sa(D),Promise.all(R),C,F,Ei(e,m,p),...y,...I]),E,hg(e,x),...Si(t,c,g,x),...vo({kill:t,cancelSignal:l,gracefulCancel:d,context:g,controller:x}),...hi({subprocess:e,kill:t,cancelSignal:l,gracefulCancel:d,forceKillAfterDelay:f,context:g,controller:x})])}catch(P){return g.terminationReason??="other",Promise.all([{error:P},D,Promise.all(R.map(V=>_r(V))),_r(C),hc(F,N),Promise.allSettled(y),Promise.allSettled(I)])}},"waitForSubprocessResult"),pg=r((e,t,n)=>e.map((o,i)=>o===t.stdio[i]?void 0:Je(o,i,n)),"waitForOriginalStreams"),mg=r((e,t)=>e.flatMap(({stdioItems:n},o)=>n.filter(({value:i,stream:s=i})=>v(s,{checkOpen:!1})&&!_(s)).map(({type:i,value:s,stream:a=s})=>Je(a,o,t,{isSameDirection:B.has(i),stopOnExit:i==="native"}))),"waitForCustomStreamsEnd"),hg=r(async(e,{signal:t})=>{let[n]=await ug(e,"error",{signal:t});throw n},"throwOnSubprocessError");import{Writable as gg}from"node:stream";import{callbackify as Sc}from"node:util";var bc=r(({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:o,waitWritableFinal:i,waitWritableDestroy:s}=$r(e,n,t),a=new gg({...vr(o,e,i),destroy:Sc(jr.bind(void 0,{subprocessStdin:o,subprocess:e,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:o.writableHighWaterMark,objectMode:o.writableObjectMode});return Nr(o,a,void 0,e),a},"createWritable"),$r=r((e,t,n)=>{let o=zt(e,t),i=Xe(n,o,"writableFinal"),s=Xe(n,o,"writableDestroy");return{subprocessStdin:o,waitWritableFinal:i,waitWritableDestroy:s}},"getSubprocessStdin"),vr=r((e,t,n)=>({write:Sg.bind(void 0,e),final:Sc(yg.bind(void 0,e,t,n))}),"getWritableMethods"),Sg=r((e,t,n,o)=>{e.write(t,n)?o():e.once("drain",o)},"onWrite"),yg=r(async(e,t,n)=>{await Oe(n,t)&&(e.writable&&e.end(),await t)},"onWritableFinal"),Nr=r(async(e,t,n,o)=>{try{await Dr(e),await o,t.writable&&t.end()}catch(i){await Ka(n),yc(t,await bg(o,i))}},"onStdinFinished"),bg=r(async(e,t)=>{if(!wg(t))return t;try{await e}catch(n){return n}return t},"getSubprocessError"),wg=r(e=>e===void 0||Ie(e),"shouldUseSubprocessError"),jr=r(async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:o},i)=>{await Oe(n,t),await Oe(o,t)&&(yc(e,i),await rn(t,i))},"onWritableDestroy"),yc=r((e,t)=>{on(e,e.writable,t)},"destroyOtherWritable");import{Duplex as xg}from"node:stream";import{callbackify as Eg}from"node:util";var wc=r(({subprocess:e,concurrentStreams:t,encoding:n},{from:o,to:i,binary:s=!0,preserveNewlines:a=!0}={})=>{let c=s||M.has(n),{subprocessStdout:l,waitReadableDestroy:d}=Mr(e,o,t),{subprocessStdin:f,waitWritableFinal:u,waitWritableDestroy:p}=$r(e,i,t),{readableEncoding:m,readableObjectMode:g,readableHighWaterMark:S}=Cr(l,c),{read:w,onStdoutDataDone:b}=Pr({subprocessStdout:l,subprocess:e,binary:c,encoding:n,preserveNewlines:a}),E=new xg({read:w,...vr(f,e,u),destroy:Eg(Tg.bind(void 0,{subprocessStdout:l,subprocessStdin:f,subprocess:e,waitReadableDestroy:d,waitWritableFinal:u,waitWritableDestroy:p})),readableHighWaterMark:S,writableHighWaterMark:f.writableHighWaterMark,readableObjectMode:g,writableObjectMode:f.writableObjectMode,encoding:m});return Lr({subprocessStdout:l,onStdoutDataDone:b,readable:E,subprocess:e,subprocessStdin:f}),Nr(f,E,l,e),E},"createDuplex"),Tg=r(async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:o,waitWritableFinal:i,waitWritableDestroy:s},a)=>{await Promise.all([Br({subprocessStdout:e,subprocess:n,waitReadableDestroy:o},a),jr({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},a)])},"onDuplexDestroy");var xc=r((e,{encoding:t})=>{let n=tn();e.readable=sn.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=bc.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=wc.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.readableStream=an.bind(void 0,e),e.writableStream=Ja.bind(void 0,e),e.transformStream=Qa.bind(void 0,e),e.iterable=Ae.bind(void 0,e,t),e[Symbol.asyncIterator]=Ae.bind(void 0,e,t,{})},"addConvertedStreams");var Ec=r((e,t)=>Object.assign(e,t),"mergePromise");import{setMaxListeners as Og}from"node:events";import{spawn as Ag}from"node:child_process";var Tc=r((e,t,n,o)=>{let{file:i,commandArguments:s,command:a,escapedCommand:c,startTime:l,verboseInfo:d,options:f,fileDescriptors:u}=Ig(e,t,n),{subprocess:p,promise:m,kill:g,all:S,convertedStreams:w}=Rg({file:i,commandArguments:s,options:f,startTime:l,verboseInfo:d,command:a,escapedCommand:c,fileDescriptors:u}),b=Mg({promise:m,nodeChildProcess:p,kill:g,all:S,convertedStreams:w,options:f});return b.pipe=ln.bind(void 0,{source:b,sourcePromise:m,boundOptions:{},createNested:o}),W.set(b,{options:f,fileDescriptors:u}),b},"execaCoreAsync"),Ig=r((e,t,n)=>{let{command:o,escapedCommand:i,startTime:s,verboseInfo:a}=ct(e,t,n),{file:c,commandArguments:l,options:d}=Rt(e,t,n),f=Dg(d),u=Ra(f,a);return{file:c,commandArguments:l,command:o,escapedCommand:i,startTime:s,verboseInfo:a,options:f,fileDescriptors:u}},"handleAsyncArguments"),Dg=r(({timeout:e,signal:t,...n})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:e}},"handleAsyncOptions"),Rg=r(({file:e,commandArguments:t,options:n,startTime:o,verboseInfo:i,command:s,escapedCommand:a,fileDescriptors:c})=>{let l;try{l=Ag(...Mt(e,t,ja(n)))}catch(w){return Oa({error:w,command:s,escapedCommand:a,fileDescriptors:c,options:n,startTime:o,verboseInfo:i})}let d=new AbortController;Og(1/0,d.signal);let f=[...l.stdio];$a(l,c,d),li(l,n);let u={},p=k(),m=Uo.bind(void 0,{kill:ka(l,n),options:n,onInternalError:p,context:u,controller:d});Wa(m,n,d);let g=dc(l,n),S=Pg({subprocess:l,kill:m,all:g,options:n,startTime:o,verboseInfo:i,fileDescriptors:c,originalStreams:f,command:s,escapedCommand:a,context:u,onInternalError:p,controller:d});return{subprocess:l,promise:S,kill:m,all:g}},"spawnSubprocessAsync"),Mg=r(({promise:e,nodeChildProcess:t,kill:n,all:o,convertedStreams:i,options:s})=>{let a=Ec(e,Cg(t,o));return a.kill=n??a.kill,i===void 0?xc(a,s):Object.assign(a,i),ha(a,t,s),a},"getSubprocessPromise"),Cg=r((e,t)=>({nodeChildProcess:e,pid:e.pid,stdin:e.stdin,stdout:e.stdout,stderr:e.stderr,stdio:e.stdio,all:t,kill:e.kill.bind(e)}),"getSubprocessProperties"),Pg=r(async({subprocess:e,kill:t,all:n,options:o,startTime:i,verboseInfo:s,fileDescriptors:a,originalStreams:c,command:l,escapedCommand:d,context:f,onInternalError:u,controller:p})=>{let[m,[g,S],w,b,E]=await gc({subprocess:e,kill:t,all:n,options:o,context:f,verboseInfo:s,fileDescriptors:a,originalStreams:c,onInternalError:u,controller:p});p.abort(),u.resolve();let x=w.map((R,C)=>J(R,o,C)),D=J(b,o,"all"),A=Lg({errorInfo:m,exitCode:g,signal:S,stdio:x,all:D,ipcOutput:E,context:f,options:o,command:l,escapedCommand:d,startTime:i});return we(A,s,o)},"handlePromise"),Lg=r(({errorInfo:e,exitCode:t,signal:n,stdio:o,all:i,ipcOutput:s,context:a,options:c,command:l,escapedCommand:d,startTime:f})=>"error"in e?je({error:e.error,command:l,escapedCommand:d,timedOut:a.terminationReason==="timeout",isCanceled:a.terminationReason==="cancel"||a.terminationReason==="gracefulCancel",isGracefullyCanceled:a.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof G,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:n,stdio:o,all:i,ipcOutput:s,options:c,startTime:f,isSync:!1}):Nt({command:l,escapedCommand:d,stdio:o,all:i,ipcOutput:s,options:c,startTime:f}),"getAsyncResult");var dn=r((e,t)=>{let n={__proto__:null,...e},o=Object.fromEntries(Object.entries(t).map(([i,s])=>[i,Bg(i,n[i],s)]));return{...n,...o}},"mergeOptions"),Bg=r((e,t,n)=>Fg.has(e)&&T(t)&&T(n)?{...t,...n}:n,"mergeOption"),Fg=new Set(["env",...En]);var De=r((e,t,n,o)=>{let i=r((a,c,l)=>De(a,c,n,l),"createNested"),s=r((...a)=>_g({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:o,createNested:i},...a),"boundExeca");return o!==void 0&&o(s,i,t),s},"createExeca"),_g=r(({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:o,createNested:i},s,...a)=>{if(T(s))return i(e,dn(n,s),o);let{file:c,commandArguments:l,options:d,isSync:f}=Ug({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:n});return f?ca(c,l,d):Tc(c,l,d,i)},"callBoundExeca"),Ug=r(({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:o,boundOptions:i})=>{let s=Qr(t)?Zr(t,n):[t,...n],[a,c,l]=Qe(...s),d=dn(dn(o,i),l),{options:f=d,isSync:u=!1}=e({options:d});return{file:a,commandArguments:c,options:f,isSync:u}},"parseArguments");var Ac=r((e,t,n)=>{e.sync=t($g,n),e.s=e.sync},"setScriptSync"),Ic=r(({options:e})=>Oc(e),"mapScriptAsync"),$g=r(({options:e})=>({...Oc(e),isSync:!0}),"mapScriptSync"),Oc=r(e=>({options:{...vg(e),...e}}),"getScriptOptions"),vg=r(({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},"getScriptStdinOption"),Dc={preferLocal:!0};var Rc=De(()=>({})),fP=De(()=>({isSync:!0})),uP=De(bi),pP=De(Ic,{},Dc,Ac),{sendMessage:Ng,getOneMessage:jg,getEachMessage:kg,getCancelSignal:Gg}=ga();import{accessSync as Wg}from"node:fs";import{basename as zg,isAbsolute as Vg}from"node:path";import"./process-contracts.js";import{captureProcessCreationIdentity as Yg,inspectProcessLiveness as Hg}from"./process-identity.js";import{MAX_SUPERVISED_PROCESS_CAPTURE_BYTES as Kg}from"./process-limits.js";import{requireReadySignal as Xg,startReadyDeadline as Mc}from"./ready-deadline.js";import{toError as fn}from"../kernel/error-serialization.js";import{recordWork as Jg}from"../kernel/work-metrics.js";import{}from"./process-contracts.js";import{terminateAttributedProcessLineage as _P,terminateOwnedPosixProcessGroup as UP}from"./recovery.js";import{cleanupExitedProcessGroup as Cc,processGroupExists as Pc}from"./process-group.js";import{createShutdownDeadline as Qg,DEFAULT_SHUTDOWN_TIMEOUT_MS as Re,FORCE_TERMINATION_WAIT_MS as kr,PROCESS_STOP_LIMIT_MS as Zg}from"./shutdown.js";import{settleStoppable as qg}from"./stoppable-settlement.js";import{terminateWindowsProcessTree as eS}from"./windows-native.js";import{cleanupExitedProcessGroup as vP}from"./process-group.js";function CP(e){if(_c(e,!1),e.signal.aborted)return Promise.resolve(pn());try{if(process.platform==="win32")return nS(e);let t=e.timeoutStartsWhenReady;if(t!==void 0)return tS(e,t);let n=un(e,"bounded-capture",{cancelSignal:e.signal,forceKillAfterDelay:Re,timeout:e.timeoutMs});return Bc(n)}catch(t){return Promise.resolve(aS(t))}}r(CP,"runManagedProcess");function tS(e,t){let n=new AbortController,o=!1,i=un(e,"bounded-capture",{cancelSignal:n.signal,forceKillAfterDelay:Re}),s=r(()=>{n.abort()},"onAbort");e.signal.addEventListener("abort",s,{once:!0});let a=Mc({onExpired:r(()=>{n.signal.aborted||(o=!0,n.abort())},"onExpired"),ready:t,stdout:i.stdout,timeoutMs:e.timeoutMs});return i.finally(()=>{a(),e.signal.removeEventListener("abort",s)}),Bc(i).then(c=>o&&c.cancelled?{...c,cancelled:!1,timedOut:o}:c)}r(tS,"runReadyManagedProcess");function nS(e){let t=un(e,"bounded-capture",{forceKillAfterDelay:!1,killDescendants:!1}),n=Date.now()+1e3,o=qg(t,kr),i=r(c=>{if(o.stop!==null)return;let l=t.nodeChildProcess,d=l.exitCode!==null||l.signalCode!==null;o.stopWith({reason:c,termination:d?Promise.resolve(null):rS(t,n)})},"stop"),s=r(()=>{i("cancelled")},"onAbort");e.signal.addEventListener("abort",s,{once:!0});let a=Lc(e.timeoutMs,e.timeoutStartsWhenReady,t.stdout,()=>{i("timedOut")});return(async()=>{let c;try{c=await o.completion}finally{e.signal.removeEventListener("abort",s),a()}let l={cancelled:c.stop?.reason==="cancelled",timedOut:c.stop?.reason==="timedOut"};if(!c.abandoned)return{...Wr(c.result,!0,c.terminationError),...l};let d=t.nodeChildProcess;for(let f of[t.stdin,t.stdout,t.stderr])f.destroy();return d.unref(),{...pn(),...l,exitCode:d.exitCode,exitSignal:d.signalCode,terminationError:c.terminationError}})()}r(nS,"runWindowsManagedProcess");async function rS(e,t){if(e.pid===void 0)return null;try{return await eS(e.pid,t,Re+kr),null}catch(n){return oS(e.nodeChildProcess),fn(n)}}r(rS,"terminateWindowsTree");function oS(e){e.exitCode!==null||e.signalCode!==null||e.kill()}r(oS,"terminateRootByHandle");var Gr=class extends Error{static{r(this,"ProcessExitedBeforeReadyError")}exitCode;exitSignal;constructor(t,n){super("Process exited before becoming ready"),this.exitCode=t,this.exitSignal=n}},iS=2**31-1;function PP(e){if(_c(e,!0),e.signal.aborted)throw new Error(`${e.displayLabel} was cancelled before its process could start`);let t=e.timeoutStartsWhenReady,n=t===void 0?null:new AbortController,o=un(e,e.outputMode,{forceKillAfterDelay:e.shutdownTimeoutMs===void 0?Re:!1,...n!==null?{cancelSignal:n.signal}:e.timeoutMs===null?{}:{timeout:e.timeoutMs}}),i=o.pid;if(i===void 0)throw o.kill("SIGKILL"),new Error(`${e.displayLabel} could not start ${JSON.stringify(e.executable)}`);let s=!1,a=!1,c=!1,l=!1,d=Qg(e.shutdownTimeoutMs??Re),f=(e.shutdownTimeoutMs??0)+(e.stopLimitMs??Zg),u=0,p=null,m=Number.POSITIVE_INFINITY,g,S=r(()=>{},"abandon"),w=new Promise(y=>{S=r(()=>{y(null)},"abandon")}),b=r(y=>{m===Number.POSITIVE_INFINITY&&(u=performance.now());let I=Math.min(m===Number.POSITIVE_INFINITY?Date.now()+f:m,y===void 0?Number.POSITIVE_INFINITY:Math.max(y,Date.now()+kr));if(I>=m)return;m=I,clearTimeout(g);let P=Math.max(0,m-Date.now());P<=iS&&(g=setTimeout(S,P))},"limitSettlement"),E=null,x={failure:null,cleanup:null},D=r(()=>{if(x.failure=null,d.deadlineAt!==null)try{E?.(d.deadlineAt)}catch(y){x.failure=fn(y)}},"publishShutdown"),A=r(y=>{l||(b(y),d.begin(y)&&D(),!s&&(s=!0,o.kill("SIGTERM"),x.cleanup=Cc(i,{remainingMs:d.remainingMs,initialSignalSent:!0,sendSignal:r((I,P)=>{o.kill(P)},"sendSignal")})))},"beginShutdown"),R=r(()=>{!s&&!l&&o.nodeChildProcess.exitCode===null&&o.nodeChildProcess.signalCode===null&&(a=!0),A()},"onAbort");for(let y of[o.stdout,o.stderr])y.once("close",()=>{!y.readableEnded&&o.nodeChildProcess.exitCode===null&&o.nodeChildProcess.signalCode===null&&A()});e.signal.addEventListener("abort",R,{once:!0});let C=e.timeoutMs===null?()=>{}:Lc(e.timeoutMs,t,o.stdout,()=>{if(!s){let y=o.nodeChildProcess;c=y.exitCode===null&&y.signalCode===null,n?.abort()}A()});o.nodeChildProcess.once("exit",()=>{process.platform!=="win32"&&Pc(i)&&A()});let N=e.recoveryIdentity==="none"?void 0:new Promise((y,I)=>{o.nodeChildProcess.once("error",I),o.nodeChildProcess.once("spawn",()=>{let P=Yg(i);if(P===null){let V=new Error(`${e.displayLabel} process creation identity could not be captured`);Hg(i)==="absent"?o.nodeChildProcess.once("exit",(mn,hn)=>{I(new Gr(mn,hn))}):(o.kill("SIGKILL"),I(V));return}y({pid:i,recovery:{creationIdentity:P,processGroupId:process.platform==="win32"?null:i}})})});N?.catch(()=>{});let F=(async()=>{let y=await Promise.race([o,w]);if(C(),clearTimeout(g),y===null){let V=o.nodeChildProcess,mn=V.exitCode!==null||V.signalCode!==null;for(let hn of[o.stdin,o.stdout,o.stderr])hn.destroy();return V.unref(),p=new Error(`${e.displayLabel} didn't settle within ${((performance.now()-u)/1e3).toFixed(1)} s of its termination: `+(mn?"its process exited, but its output stayed open":`process ${i.toString()} is still running`)),{...pn(),cancelled:a,exitCode:V.exitCode,exitSignal:V.signalCode,terminationError:p,timedOut:c}}process.platform!=="win32"&&Pc(i)&&A();let I=x.cleanup===null?null:await x.cleanup,P=Wr(y,e.outputMode==="bounded-capture",I??x.failure);return{...P,cancelled:a,timedOut:P.timedOut||n!==null&&y.isCanceled}})().finally(()=>{l=!0,clearTimeout(g),e.signal.removeEventListener("abort",R),C(),x.failure===null&&(E=null)});return{completion:F,...N===void 0?{}:{ready:N},stderr:o.stderr,stdin:o.stdin,stdout:o.stdout,pid:i,shutdownTimeoutMs:e.shutdownTimeoutMs??Re,get shutdownDeadlineAt(){return d.deadlineAt},onShutdownStarted(y){return E=y,d.deadlineAt!==null&&y(d.deadlineAt),()=>{E===y&&(E=null)}},async stop(y){return x.failure!==null&&D(),A(y),{...await F,terminationError:p??await x.cleanup??x.failure}}}}r(PP,"startSupervisedProcess");function Lc(e,t,n,o){if(t!==void 0)return Mc({onExpired:o,ready:t,stdout:n,timeoutMs:e});let i=setTimeout(o,e);return()=>{clearTimeout(i)}}r(Lc,"startTimeout");async function Bc(e){let t=e.pid,n=await e,o=t===void 0?null:await Cc(t);return Wr(n,!0,o)}r(Bc,"settle");function un(e,t,n){return process.platform==="win32"&&Vg(e.executable)&&Wg(e.executable),Jg(sS(e.executable,e.workPurpose)),Rc(e.executable,[...e.args],{buffer:t==="bounded-capture",maxBuffer:Kg/2,cleanup:!0,killDescendants:!0,...n,cwd:e.cwd,encoding:"utf8",env:e.env,extendEnv:!1,reject:!1,stderr:"pipe",stdin:"pipe",stdout:"pipe",stripFinalNewline:!1,windowsHide:!0,windowsVerbatimArguments:e.windowsVerbatimArguments})}r(un,"launch");function sS(e,t){let n=zg(e).toLowerCase().replace(/\.(?:bat|cmd|exe)$/u,"");return t===void 0?`process.launches.${n}`:`process.launches.${n}.${t}`}r(sS,"processLaunchMetric");function Wr(e,t,n){let o=e.failed&&e.exitCode===void 0&&e.signal===void 0&&!e.timedOut&&!e.isCanceled&&!e.isMaxBuffer?fn(e):null;return{cancelled:e.isCanceled,error:o,exitCode:e.exitCode??null,exitSignal:e.signal??null,outputLimitExceeded:e.isMaxBuffer,stderr:t?Fc(e.stderr):"",stdout:t?Fc(e.stdout):"",terminationError:n,timedOut:e.timedOut}}r(Wr,"mapResult");function Fc(e){return typeof e=="string"?e:e instanceof Uint8Array?Buffer.from(e).toString("utf8"):""}r(Fc,"outputString");function _c(e,t){if(e.executable.length===0)throw new Error("Managed process executable must be non-empty");if(e.cwd.length===0)throw new Error("Managed process working directory must be non-empty");if(e.displayLabel.trim().length===0)throw new Error("Managed process display label must be non-empty");if(e.timeoutMs!==null&&(!Number.isSafeInteger(e.timeoutMs)||e.timeoutMs<=0))throw new Error("Managed process timeout must be a positive safe integer");if(Xg(e.timeoutStartsWhenReady),e.timeoutStartsWhenReady!==void 0&&e.timeoutMs===null)throw new Error("A managed process ready signal needs a timeout to start");if(e.timeoutStartsWhenReady!==void 0&&"stdoutMarker"in e.timeoutStartsWhenReady&&"outputMode"in e&&e.outputMode==="caller-drained")throw new Error("A stdout ready marker needs bounded-capture output");if(t&&"recoveryIdentity"in e&&e.recoveryIdentity!==void 0&&!["capture","none"].includes(e.recoveryIdentity))throw new Error("Supervised process recovery identity mode must be capture or none");if(t&&"outputMode"in e&&!["bounded-capture","caller-drained"].includes(e.outputMode))throw new Error("Supervised process output mode must be bounded-capture or caller-drained")}r(_c,"requireRequest");function pn(){return{cancelled:!0,error:null,exitCode:null,exitSignal:null,outputLimitExceeded:!1,stderr:"",stdout:"",terminationError:null,timedOut:!1}}r(pn,"cancelledBeforeStart");function aS(e){return{...pn(),cancelled:!1,error:fn(e)}}r(aS,"startFailure");export{Gr as ProcessExitedBeforeReadyError,vP as cleanupExitedProcessGroup,CP as runManagedProcess,PP as startSupervisedProcess,_P as terminateAttributedProcessLineage,UP as terminateOwnedPosixProcessGroup};