From 11ecb8f48bcac7da05e8e8ae83d7f0c7fd165b50 Mon Sep 17 00:00:00 2001 From: sungju Yun Date: Sun, 28 Jun 2026 08:08:31 +0900 Subject: [PATCH] feat(check): SARIF 2.1.0 output mode for `clad check` (F-acedface) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `clad check --format sarif` serializes the gate result as a SARIF 2.1.0 log so every drift finding surfaces inline on the PR diff, in the GitHub Security tab (github/codeql-action/upload-sarif), and in any SARIF viewer — instead of living only in the terminal/`--json` view. Mapping is 1:1 with the existing finding shape: detector → rule, severity (error/warn/info) → level (error/warning/note), path+line → physicalLocation. Each result carries a deterministic partialFingerprints value so re-runs de-duplicate alerts. A blocking stage that produced no findings (type/test failure) still surfaces as a result, so a RED gate never serializes to a falsely-clean SARIF. Output is deterministic (no clock/PRNG); default text and --json outputs are unchanged. Also fixes a latent truncation: clad check's machine-output modes now set process.exitCode and let stdout drain instead of calling process.exit(), which could terminate before a buffered stdout pipe (>64KB) flushed — SARIF is ~150KB and was truncated when piped (file redirects were already safe). Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 21 + plugins/claude-code/dist/clad.js | 475 ++++++++++++----------- spec.yaml | 4 +- spec/attestation.yaml | 65 ++-- spec/features/sarif-export-acedface.yaml | 48 +++ spec/index.yaml | 1 + src/cli/clad.ts | 43 +- src/stages/sarif.ts | Bin 0 -> 6421 bytes tests/cli/clad.test.ts | 17 +- tests/stages/sarif.test.ts | 157 ++++++++ 10 files changed, 544 insertions(+), 287 deletions(-) create mode 100644 spec/features/sarif-export-acedface.yaml create mode 100644 src/stages/sarif.ts create mode 100644 tests/stages/sarif.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e7fb2af..86f02de0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,27 @@ Versioning: [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). report grew by ~1.6 ms (vitest-shaped) to ~7.8 ms (pytest-shaped) per gate run — noise against the ~50 s gate. +- **SARIF 2.1.0 output for `clad check`** (`F-acedface`) — `clad check --format + sarif` serializes the gate result as a SARIF 2.1.0 log, so every drift finding + surfaces inline on the PR diff and in the GitHub Security tab + (`github/codeql-action/upload-sarif`) and in any SARIF viewer, instead of + living only in the terminal/`--json` view. The mapping is 1:1 with the + existing finding shape — detector → rule, severity (`error`/`warn`/`info`) → + level (`error`/`warning`/`note`), `path`+`line` → `physicalLocation` — and each + result carries a deterministic `partialFingerprints` value so re-runs + de-duplicate alerts. A blocking stage that produced no findings (a type or test + failure) still surfaces as a result, so a RED gate never serializes to a + falsely-clean SARIF. Output is deterministic (no clock/PRNG); the default text + and `--json` outputs are unchanged. + +### Fixed + +- **Large `--json` / `--format sarif` output is no longer truncated when piped** + — `clad check`'s machine-output modes set `process.exitCode` and let stdout + drain instead of calling `process.exit()`, which could terminate before a + buffered stdout *pipe* (>64KB) flushed. Redirecting to a file was already safe; + piping to another process now is too. + ## [0.6.3] — 2026-06-26 — Honest Status **In one line:** the one-line-per-feature index that agents grep (and that feeds diff --git a/plugins/claude-code/dist/clad.js b/plugins/claude-code/dist/clad.js index ec7875c1..41cc485e 100755 --- a/plugins/claude-code/dist/clad.js +++ b/plugins/claude-code/dist/clad.js @@ -4,20 +4,20 @@ const require = __claddingCreateRequire(import.meta.url); // Marker for stages/*.ts: when true, the per-stage CLI-entry guard // short-circuits so the bundle doesn't fire every stage at startup. globalThis.__CLADDING_BUNDLED = true; -var fse=Object.create;var Q0=Object.defineProperty;var pse=Object.getOwnPropertyDescriptor;var mse=Object.getOwnPropertyNames;var hse=Object.getPrototypeOf,gse=Object.prototype.hasOwnProperty;var Le=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Sr=(t,e)=>{for(var r in e)Q0(t,r,{get:e[r],enumerable:!0})},yse=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of mse(e))!gse.call(t,i)&&i!==r&&Q0(t,i,{get:()=>e[i],enumerable:!(n=pse(e,i))||n.enumerable});return t};var St=(t,e,r)=>(r=t!=null?fse(hse(t)):{},yse(e||!t||!t.__esModule?Q0(r,"default",{value:t,enumerable:!0}):r,t));var Zu=v(tk=>{var Nh=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},ek=class extends Nh{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};tk.CommanderError=Nh;tk.InvalidArgumentError=ek});var jh=v(nk=>{var{InvalidArgumentError:_se}=Zu(),rk=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new _se(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function vse(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}nk.Argument=rk;nk.humanReadableArgName=vse});var sk=v(ok=>{var{humanReadableArgName:bse}=jh(),ik=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>bse(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` +var gse=Object.create;var Q0=Object.defineProperty;var yse=Object.getOwnPropertyDescriptor;var _se=Object.getOwnPropertyNames;var vse=Object.getPrototypeOf,bse=Object.prototype.hasOwnProperty;var Le=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Sr=(t,e)=>{for(var r in e)Q0(t,r,{get:e[r],enumerable:!0})},Sse=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _se(e))!bse.call(t,i)&&i!==r&&Q0(t,i,{get:()=>e[i],enumerable:!(n=yse(e,i))||n.enumerable});return t};var St=(t,e,r)=>(r=t!=null?gse(vse(t)):{},Sse(e||!t||!t.__esModule?Q0(r,"default",{value:t,enumerable:!0}):r,t));var Zu=v(tk=>{var Nh=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},ek=class extends Nh{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};tk.CommanderError=Nh;tk.InvalidArgumentError=ek});var jh=v(nk=>{var{InvalidArgumentError:wse}=Zu(),rk=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new wse(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function xse(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}nk.Argument=rk;nk.humanReadableArgName=xse});var sk=v(ok=>{var{humanReadableArgName:$se}=jh(),ik=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>$se(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` `)}displayWidth(e){return xL(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,u=(this.helpWidth??80)-r-c-2,d;return u{let a=s.match(i);if(a===null){o.push("");return}let c=[a.shift()],l=this.displayWidth(c[0]);a.forEach(u=>{let d=this.displayWidth(u);if(l+d<=r){c.push(u),l+=d;return}o.push(c.join(""));let f=u.trimStart();c=[f],l=this.displayWidth(f)}),o.push(c.join(""))}),o.join(` -`)}};function xL(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}ok.Help=ik;ok.stripColor=xL});var uk=v(lk=>{var{InvalidArgumentError:Sse}=Zu(),ak=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=wse(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Sse(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?$L(this.name().replace(/^no-/,"")):$L(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ck=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function $L(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function wse(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} +`)}};function xL(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}ok.Help=ik;ok.stripColor=xL});var uk=v(lk=>{var{InvalidArgumentError:kse}=Zu(),ak=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Ese(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new kse(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?$L(this.name().replace(/^no-/,"")):$L(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ck=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function $L(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Ese(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} - a short flag is a single dash and a single character - either use a single dash and a single character (for a short flag) - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a} - too many short flags`):i.test(s)?new Error(`${a} - too many long flags`):new Error(`${a} -- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}lk.Option=ak;lk.DualOptions=ck});var EL=v(kL=>{function xse(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function $se(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=xse(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(as.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` +- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}lk.Option=ak;lk.DualOptions=ck});var EL=v(kL=>{function Ase(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function Tse(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=Ase(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(as.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` (Did you mean one of ${n.join(", ")}?)`:n.length===1?` -(Did you mean ${n[0]}?)`:""}kL.suggestSimilar=$se});var PL=v(hk=>{var kse=Le("node:events").EventEmitter,dk=Le("node:child_process"),Mi=Le("node:path"),Mh=Le("node:fs"),ze=Le("node:process"),{Argument:Ese,humanReadableArgName:Ase}=jh(),{CommanderError:fk}=Zu(),{Help:Tse,stripColor:Ose}=sk(),{Option:AL,DualOptions:Pse}=uk(),{suggestSimilar:TL}=EL(),pk=class t extends kse{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>ze.stdout.write(r),writeErr:r=>ze.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>ze.stdout.isTTY?ze.stdout.columns:void 0,getErrHelpWidth:()=>ze.stderr.isTTY?ze.stderr.columns:void 0,getOutHasColors:()=>mk()??(ze.stdout.isTTY&&ze.stdout.hasColors?.()),getErrHasColors:()=>mk()??(ze.stderr.isTTY&&ze.stderr.hasColors?.()),stripColor:r=>Ose(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Tse,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name -- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new Ese(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. +(Did you mean ${n[0]}?)`:""}kL.suggestSimilar=Tse});var PL=v(hk=>{var Ose=Le("node:events").EventEmitter,dk=Le("node:child_process"),Mi=Le("node:path"),Mh=Le("node:fs"),ze=Le("node:process"),{Argument:Pse,humanReadableArgName:Ise}=jh(),{CommanderError:fk}=Zu(),{Help:Rse,stripColor:Cse}=sk(),{Option:AL,DualOptions:Dse}=uk(),{suggestSimilar:TL}=EL(),pk=class t extends Ose{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>ze.stdout.write(r),writeErr:r=>ze.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>ze.stdout.isTTY?ze.stdout.columns:void 0,getErrHelpWidth:()=>ze.stderr.isTTY?ze.stderr.columns:void 0,getOutHasColors:()=>mk()??(ze.stdout.isTTY&&ze.stdout.hasColors?.()),getErrHasColors:()=>mk()??(ze.stderr.isTTY&&ze.stderr.hasColors?.()),stripColor:r=>Cse(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Rse,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name +- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new Pse(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new fk(e,r,n)),ze.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new AL(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}' - already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof AL)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let u=a.exec(c);return u?u[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){ze.versions?.electron&&(r.from="electron");let i=ze.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=ze.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":ze.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(Mh.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist @@ -26,44 +26,44 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life - ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(u,d){let f=Mi.resolve(u,d);if(Mh.existsSync(f))return f;if(i.includes(Mi.extname(d)))return;let p=i.find(m=>Mh.existsSync(`${f}${m}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=Mh.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=Mi.resolve(Mi.dirname(u),a)}if(a){let u=o(a,s);if(!u&&!e._executableFile&&this._scriptPath){let d=Mi.basename(this._scriptPath,Mi.extname(this._scriptPath));d!==this._name&&(u=o(a,`${d}-${e._name}`))}s=u||s}n=i.includes(Mi.extname(s));let c;ze.platform!=="win32"?n?(r.unshift(s),r=OL(ze.execArgv).concat(r),c=dk.spawn(ze.argv[0],r,{stdio:"inherit"})):c=dk.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),r.unshift(s),r=OL(ze.execArgv).concat(r),c=dk.spawn(ze.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{ze.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",u=>{u=u??1,l?l(new fk(u,"commander.executeSubCommandAsync","(close)")):ze.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(u.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)ze.exit(1);else{let d=new fk(1,"commander.executeSubCommandAsync","(error)");d.nestedError=u,l(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?ie(n,a,s),n.defaultValue))):o===void 0&&(o=[]):ir()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r;function o(u){return u.length>1&&u[0]==="-"}let s=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,c=null,l=0;for(;l2&&u[0]==="-"&&u[1]!=="-"){let d=this._findOption(`-${u[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,u.slice(2)):(this.emit(`option:${d.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let d=u.indexOf("="),f=this._findOption(u.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,u.slice(d+1));continue}}if(i===r&&o(u)&&!(this.commands.length===0&&s(u))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),n.push(...e.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...e.slice(l));break}else if(this._defaultCommandName){n.push(u,...e.slice(l));break}}if(this._passThroughOptions){i.push(u,...e.slice(l));break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;nObject.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e} `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError} `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(` -`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in ze.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,ze.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Pse(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),u=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},i=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=TL(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=TL(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e} -`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Ase(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Mi.basename(e,Mi.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(ze.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText. +`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in ze.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,ze.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Dse(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),u=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},i=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=TL(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=TL(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e} +`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Ise(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Mi.basename(e,Mi.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(ze.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s} -`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function OL(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function mk(){if(ze.env.NO_COLOR||ze.env.FORCE_COLOR==="0"||ze.env.FORCE_COLOR==="false")return!1;if(ze.env.FORCE_COLOR||ze.env.CLICOLOR_FORCE!==void 0)return!0}hk.Command=pk;hk.useColor=mk});var DL=v(cn=>{var{Argument:IL}=jh(),{Command:gk}=PL(),{CommanderError:Ise,InvalidArgumentError:RL}=Zu(),{Help:Rse}=sk(),{Option:CL}=uk();cn.program=new gk;cn.createCommand=t=>new gk(t);cn.createOption=(t,e)=>new CL(t,e);cn.createArgument=(t,e)=>new IL(t,e);cn.Command=gk;cn.Option=CL;cn.Argument=IL;cn.Help=Rse;cn.CommanderError=Ise;cn.InvalidArgumentError=RL;cn.InvalidOptionArgumentError=RL});var Ie=v(Gt=>{"use strict";var _k=Symbol.for("yaml.alias"),zL=Symbol.for("yaml.document"),zh=Symbol.for("yaml.map"),FL=Symbol.for("yaml.pair"),vk=Symbol.for("yaml.scalar"),Fh=Symbol.for("yaml.seq"),zi=Symbol.for("yaml.node.type"),zse=t=>!!t&&typeof t=="object"&&t[zi]===_k,Fse=t=>!!t&&typeof t=="object"&&t[zi]===zL,Lse=t=>!!t&&typeof t=="object"&&t[zi]===zh,Use=t=>!!t&&typeof t=="object"&&t[zi]===FL,LL=t=>!!t&&typeof t=="object"&&t[zi]===vk,qse=t=>!!t&&typeof t=="object"&&t[zi]===Fh;function UL(t){if(t&&typeof t=="object")switch(t[zi]){case zh:case Fh:return!0}return!1}function Bse(t){if(t&&typeof t=="object")switch(t[zi]){case _k:case zh:case vk:case Fh:return!0}return!1}var Zse=t=>(LL(t)||UL(t))&&!!t.anchor;Gt.ALIAS=_k;Gt.DOC=zL;Gt.MAP=zh;Gt.NODE_TYPE=zi;Gt.PAIR=FL;Gt.SCALAR=vk;Gt.SEQ=Fh;Gt.hasAnchor=Zse;Gt.isAlias=zse;Gt.isCollection=UL;Gt.isDocument=Fse;Gt.isMap=Lse;Gt.isNode=Bse;Gt.isPair=Use;Gt.isScalar=LL;Gt.isSeq=qse});var Hu=v(bk=>{"use strict";var Dt=Ie(),wr=Symbol("break visit"),qL=Symbol("skip children"),ri=Symbol("remove node");function Lh(t,e){let r=BL(e);Dt.isDocument(t)?Ja(null,t.contents,r,Object.freeze([t]))===ri&&(t.contents=null):Ja(null,t,r,Object.freeze([]))}Lh.BREAK=wr;Lh.SKIP=qL;Lh.REMOVE=ri;function Ja(t,e,r,n){let i=ZL(t,e,r,n);if(Dt.isNode(i)||Dt.isPair(i))return HL(t,n,i),Ja(t,i,r,n);if(typeof i!="symbol"){if(Dt.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var GL=Ie(),Hse=Hu(),Gse={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Vse=t=>t.replace(/[!,[\]{}]/g,e=>Gse[e]),Gu=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+Vse(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&GL.isNode(e.contents)){let o={};Hse.visit(e.contents,(s,a)=>{GL.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` -`)}};Gu.defaultYaml={explicit:!1,version:"1.2"};Gu.defaultTags={"!!":"tag:yaml.org,2002:"};VL.Directives=Gu});var qh=v(Vu=>{"use strict";var WL=Ie(),Wse=Hu();function Kse(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function KL(t){let e=new Set;return Wse.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function JL(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Jse(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=KL(t));let s=JL(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(WL.isScalar(s.node)||WL.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}Vu.anchorIsValid=Kse;Vu.anchorNames=KL;Vu.createNodeAnchors=Jse;Vu.findNewAnchor=JL});var wk=v(YL=>{"use strict";function Wu(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var Yse=Ie();function XL(t,e,r){if(Array.isArray(t))return t.map((n,i)=>XL(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!Yse.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}QL.toJS=XL});var Bh=v(tU=>{"use strict";var Xse=wk(),eU=Ie(),Qse=vo(),xk=class{constructor(e){Object.defineProperty(this,eU.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!eU.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=Qse.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?Xse.applyReviver(o,{"":a},"",a):a}};tU.NodeBase=xk});var Ku=v(rU=>{"use strict";var eae=qh(),tae=Hu(),Xa=Ie(),rae=Bh(),nae=vo(),$k=class extends rae.NodeBase{constructor(e){super(Xa.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],tae.visit(e,{Node:(o,s)=>{(Xa.isAlias(s)||Xa.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(nae.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Zh(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(eae.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function Zh(t,e,r){if(Xa.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Xa.isCollection(e)){let n=0;for(let i of e.items){let o=Zh(t,i,r);o>n&&(n=o)}return n}else if(Xa.isPair(e)){let n=Zh(t,e.key,r),i=Zh(t,e.value,r);return Math.max(n,i)}return 1}rU.Alias=$k});var At=v(kk=>{"use strict";var iae=Ie(),oae=Bh(),sae=vo(),aae=t=>!t||typeof t!="function"&&typeof t!="object",bo=class extends oae.NodeBase{constructor(e){super(iae.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:sae.toJS(this.value,e,r)}toString(){return String(this.value)}};bo.BLOCK_FOLDED="BLOCK_FOLDED";bo.BLOCK_LITERAL="BLOCK_LITERAL";bo.PLAIN="PLAIN";bo.QUOTE_DOUBLE="QUOTE_DOUBLE";bo.QUOTE_SINGLE="QUOTE_SINGLE";kk.Scalar=bo;kk.isScalarValue=aae});var Ju=v(iU=>{"use strict";var cae=Ku(),Rs=Ie(),nU=At(),lae="tag:yaml.org,2002:";function uae(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function dae(t,e,r){if(Rs.isDocument(t)&&(t=t.contents),Rs.isNode(t))return t;if(Rs.isPair(t)){let d=r.schema[Rs.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new cae.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=lae+e.slice(2));let l=uae(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new nU.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[Rs.MAP]:Symbol.iterator in Object(t)?s[Rs.SEQ]:s[Rs.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new nU.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}iU.createNode=dae});var Gh=v(Hh=>{"use strict";var fae=Ju(),ni=Ie(),pae=Bh();function Ek(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return fae.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var oU=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Ak=class extends pae.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>ni.isNode(n)||ni.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(oU(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(ni.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,Ek(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(ni.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&ni.isScalar(o)?o.value:o:ni.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!ni.isPair(r))return!1;let n=r.value;return n==null||e&&ni.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return ni.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(ni.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,Ek(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Hh.Collection=Ak;Hh.collectionFromPath=Ek;Hh.isEmptyPath=oU});var Yu=v(Vh=>{"use strict";var mae=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Tk(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var hae=(t,e,r)=>t.endsWith(` +`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function OL(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function mk(){if(ze.env.NO_COLOR||ze.env.FORCE_COLOR==="0"||ze.env.FORCE_COLOR==="false")return!1;if(ze.env.FORCE_COLOR||ze.env.CLICOLOR_FORCE!==void 0)return!0}hk.Command=pk;hk.useColor=mk});var DL=v(cn=>{var{Argument:IL}=jh(),{Command:gk}=PL(),{CommanderError:Nse,InvalidArgumentError:RL}=Zu(),{Help:jse}=sk(),{Option:CL}=uk();cn.program=new gk;cn.createCommand=t=>new gk(t);cn.createOption=(t,e)=>new CL(t,e);cn.createArgument=(t,e)=>new IL(t,e);cn.Command=gk;cn.Option=CL;cn.Argument=IL;cn.Help=jse;cn.CommanderError=Nse;cn.InvalidArgumentError=RL;cn.InvalidOptionArgumentError=RL});var Ie=v(Gt=>{"use strict";var _k=Symbol.for("yaml.alias"),zL=Symbol.for("yaml.document"),zh=Symbol.for("yaml.map"),FL=Symbol.for("yaml.pair"),vk=Symbol.for("yaml.scalar"),Fh=Symbol.for("yaml.seq"),zi=Symbol.for("yaml.node.type"),qse=t=>!!t&&typeof t=="object"&&t[zi]===_k,Bse=t=>!!t&&typeof t=="object"&&t[zi]===zL,Zse=t=>!!t&&typeof t=="object"&&t[zi]===zh,Hse=t=>!!t&&typeof t=="object"&&t[zi]===FL,LL=t=>!!t&&typeof t=="object"&&t[zi]===vk,Gse=t=>!!t&&typeof t=="object"&&t[zi]===Fh;function UL(t){if(t&&typeof t=="object")switch(t[zi]){case zh:case Fh:return!0}return!1}function Vse(t){if(t&&typeof t=="object")switch(t[zi]){case _k:case zh:case vk:case Fh:return!0}return!1}var Wse=t=>(LL(t)||UL(t))&&!!t.anchor;Gt.ALIAS=_k;Gt.DOC=zL;Gt.MAP=zh;Gt.NODE_TYPE=zi;Gt.PAIR=FL;Gt.SCALAR=vk;Gt.SEQ=Fh;Gt.hasAnchor=Wse;Gt.isAlias=qse;Gt.isCollection=UL;Gt.isDocument=Bse;Gt.isMap=Zse;Gt.isNode=Vse;Gt.isPair=Hse;Gt.isScalar=LL;Gt.isSeq=Gse});var Hu=v(bk=>{"use strict";var Dt=Ie(),wr=Symbol("break visit"),qL=Symbol("skip children"),ri=Symbol("remove node");function Lh(t,e){let r=BL(e);Dt.isDocument(t)?Ja(null,t.contents,r,Object.freeze([t]))===ri&&(t.contents=null):Ja(null,t,r,Object.freeze([]))}Lh.BREAK=wr;Lh.SKIP=qL;Lh.REMOVE=ri;function Ja(t,e,r,n){let i=ZL(t,e,r,n);if(Dt.isNode(i)||Dt.isPair(i))return HL(t,n,i),Ja(t,i,r,n);if(typeof i!="symbol"){if(Dt.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var GL=Ie(),Kse=Hu(),Jse={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Yse=t=>t.replace(/[!,[\]{}]/g,e=>Jse[e]),Gu=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+Yse(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&GL.isNode(e.contents)){let o={};Kse.visit(e.contents,(s,a)=>{GL.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` +`)}};Gu.defaultYaml={explicit:!1,version:"1.2"};Gu.defaultTags={"!!":"tag:yaml.org,2002:"};VL.Directives=Gu});var qh=v(Vu=>{"use strict";var WL=Ie(),Xse=Hu();function Qse(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function KL(t){let e=new Set;return Xse.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function JL(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function eae(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=KL(t));let s=JL(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(WL.isScalar(s.node)||WL.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}Vu.anchorIsValid=Qse;Vu.anchorNames=KL;Vu.createNodeAnchors=eae;Vu.findNewAnchor=JL});var wk=v(YL=>{"use strict";function Wu(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var tae=Ie();function XL(t,e,r){if(Array.isArray(t))return t.map((n,i)=>XL(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!tae.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}QL.toJS=XL});var Bh=v(t2=>{"use strict";var rae=wk(),e2=Ie(),nae=bo(),xk=class{constructor(e){Object.defineProperty(this,e2.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!e2.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=nae.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?rae.applyReviver(o,{"":a},"",a):a}};t2.NodeBase=xk});var Ku=v(r2=>{"use strict";var iae=qh(),oae=Hu(),Xa=Ie(),sae=Bh(),aae=bo(),$k=class extends sae.NodeBase{constructor(e){super(Xa.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],oae.visit(e,{Node:(o,s)=>{(Xa.isAlias(s)||Xa.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(aae.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Zh(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(iae.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function Zh(t,e,r){if(Xa.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Xa.isCollection(e)){let n=0;for(let i of e.items){let o=Zh(t,i,r);o>n&&(n=o)}return n}else if(Xa.isPair(e)){let n=Zh(t,e.key,r),i=Zh(t,e.value,r);return Math.max(n,i)}return 1}r2.Alias=$k});var At=v(kk=>{"use strict";var cae=Ie(),lae=Bh(),uae=bo(),dae=t=>!t||typeof t!="function"&&typeof t!="object",So=class extends lae.NodeBase{constructor(e){super(cae.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:uae.toJS(this.value,e,r)}toString(){return String(this.value)}};So.BLOCK_FOLDED="BLOCK_FOLDED";So.BLOCK_LITERAL="BLOCK_LITERAL";So.PLAIN="PLAIN";So.QUOTE_DOUBLE="QUOTE_DOUBLE";So.QUOTE_SINGLE="QUOTE_SINGLE";kk.Scalar=So;kk.isScalarValue=dae});var Ju=v(i2=>{"use strict";var fae=Ku(),Cs=Ie(),n2=At(),pae="tag:yaml.org,2002:";function mae(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function hae(t,e,r){if(Cs.isDocument(t)&&(t=t.contents),Cs.isNode(t))return t;if(Cs.isPair(t)){let d=r.schema[Cs.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new fae.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=pae+e.slice(2));let l=mae(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new n2.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[Cs.MAP]:Symbol.iterator in Object(t)?s[Cs.SEQ]:s[Cs.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new n2.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}i2.createNode=hae});var Gh=v(Hh=>{"use strict";var gae=Ju(),ni=Ie(),yae=Bh();function Ek(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return gae.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var o2=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Ak=class extends yae.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>ni.isNode(n)||ni.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(o2(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(ni.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,Ek(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(ni.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&ni.isScalar(o)?o.value:o:ni.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!ni.isPair(r))return!1;let n=r.value;return n==null||e&&ni.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return ni.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(ni.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,Ek(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Hh.Collection=Ak;Hh.collectionFromPath=Ek;Hh.isEmptyPath=o2});var Yu=v(Vh=>{"use strict";var _ae=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Tk(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var vae=(t,e,r)=>t.endsWith(` `)?Tk(r,e):r.includes(` `)?` -`+Tk(r,e):(t.endsWith(" ")?"":" ")+r;Vh.indentComment=Tk;Vh.lineComment=hae;Vh.stringifyComment=mae});var aU=v(Xu=>{"use strict";var gae="flow",Ok="block",Wh="quoted";function yae(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,b=-1;r===Ok&&(h=sU(t,h,e.length),h!==-1&&(d=h+c));for(let x;x=t[h+=1];){if(r===Wh&&x==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(x===` -`)r===Ok&&(h=sU(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(x===" "&&p&&p!==" "&&p!==` +`+Tk(r,e):(t.endsWith(" ")?"":" ")+r;Vh.indentComment=Tk;Vh.lineComment=vae;Vh.stringifyComment=_ae});var a2=v(Xu=>{"use strict";var bae="flow",Ok="block",Wh="quoted";function Sae(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,b=-1;r===Ok&&(h=s2(t,h,e.length),h!==-1&&(d=h+c));for(let x;x=t[h+=1];){if(r===Wh&&x==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(x===` +`)r===Ok&&(h=s2(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(x===" "&&p&&p!==" "&&p!==` `&&p!==" "){let $=t[h+1];$&&$!==" "&&$!==` `&&$!==" "&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===Wh){for(;p===" "||p===" ";)p=x,x=t[h+=1],m=!0;let $=h>b+1?h-2:g-1;if(u[$])return t;l.push($),u[$]=!0,d=$+c,f=void 0}else m=!0}p=x}if(m&&a&&a(),l.length===0)return t;s&&s();let _=t.slice(0,l[0]);for(let x=0;x{"use strict";var Pn=At(),So=aU(),Jh=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Yh=t=>/^(%|---|\.\.\.)/m.test(t);function _ae(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;o{"use strict";var Pn=At(),wo=a2(),Jh=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Yh=t=>/^(%|---|\.\.\.)/m.test(t);function wae(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;on)return!0;if(s=o+1,i-s<=n)return!1}return!0}function Qu(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Yh(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length `;let d,f;for(f=r.length;f>0;--f){let w=r[f-1];if(w!==` `&&w!==" "&&w!==" ")break}let p=r.substring(f),m=p.indexOf(` `);m===-1?d="-":r===p||m!==p.length-1?(d="+",o&&o()):d="",p&&(r=r.slice(0,-p.length),p[p.length-1]===` `&&(p=p.slice(0,-1)),p=p.replace(Ik,`$&${l}`));let h=!1,g,b=-1;for(g=0;g{R=!0});let A=So.foldFlowLines(`${_}${w}${p}`,l,So.FOLD_BLOCK,O);if(!R)return`>${$} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),R=!1,O=Jh(n,!0);s!=="folded"&&e!==Pn.Scalar.BLOCK_FOLDED&&(O.onOverflow=()=>{R=!0});let A=wo.foldFlowLines(`${_}${w}${p}`,l,wo.FOLD_BLOCK,O);if(!R)return`>${$} ${l}${A}`}return r=r.replace(/\n+/g,`$&${l}`),`|${$} -${l}${_}${r}${p}`}function vae(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(` +${l}${_}${r}${p}`}function xae(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(` `)||u&&/[[\]{},]/.test(o))return Qa(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` `)?Qa(o,e):Kh(t,e,r,n);if(!a&&!u&&i!==Pn.Scalar.PLAIN&&o.includes(` `))return Kh(t,e,r,n);if(Yh(o)){if(c==="")return e.forceBlockIndent=!0,Kh(t,e,r,n);if(a&&c===l)return Qa(o,e)}let d=o.replace(/\n+/g,`$& -${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return Qa(o,e)}return a?d:So.foldFlowLines(d,c,So.FOLD_FLOW,Jh(e,!1))}function bae(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Pn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Pn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Pn.Scalar.BLOCK_FOLDED:case Pn.Scalar.BLOCK_LITERAL:return i||o?Qa(s.value,e):Kh(s,e,r,n);case Pn.Scalar.QUOTE_DOUBLE:return Qu(s.value,e);case Pn.Scalar.QUOTE_SINGLE:return Pk(s.value,e);case Pn.Scalar.PLAIN:return vae(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}cU.stringifyString=bae});var td=v(Rk=>{"use strict";var Sae=qh(),wo=Ie(),wae=Yu(),xae=ed();function $ae(t,e){let r=Object.assign({blockQuote:!0,commentString:wae.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function kae(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(wo.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Eae(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(wo.isScalar(t)||wo.isCollection(t))&&t.anchor;o&&Sae.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Aae(t,e,r,n){if(wo.isPair(t))return t.toString(e,r,n);if(wo.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=wo.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=kae(e.doc.schema.tags,o));let s=Eae(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):wo.isScalar(o)?xae.stringifyString(o,e,r,n):o.toString(e,r,n);return s?wo.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} -${e.indent}${a}`:a}Rk.createStringifyContext=$ae;Rk.stringify=Aae});var fU=v(dU=>{"use strict";var Fi=Ie(),lU=At(),uU=td(),rd=Yu();function Tae({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=Fi.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Fi.isCollection(t)||!Fi.isNode(t)&&typeof t=="object"){let O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||Fi.isCollection(t)||(Fi.isScalar(t)?t.type===lU.Scalar.BLOCK_FOLDED||t.type===lU.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=uU.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=rd.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=rd.lineComment(g,r.indent,l(f))),g=`? ${g} -${a}:`):(g=`${g}:`,f&&(g+=rd.lineComment(g,r.indent,l(f))));let b,_,x;Fi.isNode(e)?(b=!!e.spaceBefore,_=e.commentBefore,x=e.comment):(b=!1,_=null,x=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&Fi.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&Fi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let $=!1,w=uU.stringify(e,r,()=>$=!0,()=>h=!0),R=" ";if(f||b||_){if(R=b?` +${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return Qa(o,e)}return a?d:wo.foldFlowLines(d,c,wo.FOLD_FLOW,Jh(e,!1))}function $ae(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Pn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Pn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Pn.Scalar.BLOCK_FOLDED:case Pn.Scalar.BLOCK_LITERAL:return i||o?Qa(s.value,e):Kh(s,e,r,n);case Pn.Scalar.QUOTE_DOUBLE:return Qu(s.value,e);case Pn.Scalar.QUOTE_SINGLE:return Pk(s.value,e);case Pn.Scalar.PLAIN:return xae(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}c2.stringifyString=$ae});var td=v(Rk=>{"use strict";var kae=qh(),xo=Ie(),Eae=Yu(),Aae=ed();function Tae(t,e){let r=Object.assign({blockQuote:!0,commentString:Eae.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Oae(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(xo.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Pae(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(xo.isScalar(t)||xo.isCollection(t))&&t.anchor;o&&kae.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Iae(t,e,r,n){if(xo.isPair(t))return t.toString(e,r,n);if(xo.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=xo.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Oae(e.doc.schema.tags,o));let s=Pae(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):xo.isScalar(o)?Aae.stringifyString(o,e,r,n):o.toString(e,r,n);return s?xo.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} +${e.indent}${a}`:a}Rk.createStringifyContext=Tae;Rk.stringify=Iae});var f2=v(d2=>{"use strict";var Fi=Ie(),l2=At(),u2=td(),rd=Yu();function Rae({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=Fi.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Fi.isCollection(t)||!Fi.isNode(t)&&typeof t=="object"){let O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||Fi.isCollection(t)||(Fi.isScalar(t)?t.type===l2.Scalar.BLOCK_FOLDED||t.type===l2.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=u2.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=rd.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=rd.lineComment(g,r.indent,l(f))),g=`? ${g} +${a}:`):(g=`${g}:`,f&&(g+=rd.lineComment(g,r.indent,l(f))));let b,_,x;Fi.isNode(e)?(b=!!e.spaceBefore,_=e.commentBefore,x=e.comment):(b=!1,_=null,x=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&Fi.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&Fi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let $=!1,w=u2.stringify(e,r,()=>$=!0,()=>h=!0),R=" ";if(f||b||_){if(R=b?` `:"",_){let O=l(_);R+=` ${rd.indentComment(O,r.indent)}`}w===""&&!r.inFlow?R===` `&&x&&(R=` @@ -72,32 +72,32 @@ ${rd.indentComment(O,r.indent)}`}w===""&&!r.inFlow?R===` ${r.indent}`}else if(!p&&Fi.isCollection(e)){let O=w[0],A=w.indexOf(` `),N=A!==-1,k=r.inFlow??e.flow??e.items.length===0;if(N||!k){let Z=!1;if(N&&(O==="&"||O==="!")){let ne=w.indexOf(" ");O==="&"&&ne!==-1&&ne{"use strict";var pU=Le("process");function Oae(t,...e){t==="debug"&&console.log(...e)}function Pae(t,e){(t==="debug"||t==="warn")&&(typeof pU.emitWarning=="function"?pU.emitWarning(e):console.warn(e))}Ck.debug=Oae;Ck.warn=Pae});var rg=v(tg=>{"use strict";var eg=Ie(),mU=At(),Xh="<<",Qh={identify:t=>t===Xh||typeof t=="symbol"&&t.description===Xh,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new mU.Scalar(Symbol(Xh)),{addToJSMap:hU}),stringify:()=>Xh},Iae=(t,e)=>(Qh.identify(e)||eg.isScalar(e)&&(!e.type||e.type===mU.Scalar.PLAIN)&&Qh.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Qh.tag&&r.default);function hU(t,e,r){let n=gU(t,r);if(eg.isSeq(n))for(let i of n.items)Nk(t,e,i);else if(Array.isArray(n))for(let i of n)Nk(t,e,i);else Nk(t,e,n)}function Nk(t,e,r){let n=gU(t,r);if(!eg.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function gU(t,e){return t&&eg.isAlias(e)?e.resolve(t.doc,t):e}tg.addMergeToJSMap=hU;tg.isMergeKey=Iae;tg.merge=Qh});var Mk=v(vU=>{"use strict";var Rae=Dk(),yU=rg(),Cae=td(),_U=Ie(),jk=vo();function Dae(t,e,{key:r,value:n}){if(_U.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(yU.isMergeKey(t,r))yU.addMergeToJSMap(t,e,n);else{let i=jk.toJS(r,"",t);if(e instanceof Map)e.set(i,jk.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=Nae(r,i,t),s=jk.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function Nae(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(_U.isNode(t)&&r?.doc){let n=Cae.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Rae.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}vU.addPairToJSMap=Dae});var xo=v(zk=>{"use strict";var bU=Ju(),jae=fU(),Mae=Mk(),ng=Ie();function zae(t,e,r){let n=bU.createNode(t,void 0,r),i=bU.createNode(e,void 0,r);return new ig(n,i)}var ig=class t{constructor(e,r=null){Object.defineProperty(this,ng.NODE_TYPE,{value:ng.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return ng.isNode(r)&&(r=r.clone(e)),ng.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return Mae.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?jae.stringifyPair(this,e,r,n):JSON.stringify(this)}};zk.Pair=ig;zk.createPair=zae});var Fk=v(wU=>{"use strict";var Cs=Ie(),SU=td(),og=Yu();function Fae(t,e,r){return(e.inFlow??t.flow?Uae:Lae)(t,e,r)}function Lae({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=og.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;m{"use strict";var p2=Le("process");function Cae(t,...e){t==="debug"&&console.log(...e)}function Dae(t,e){(t==="debug"||t==="warn")&&(typeof p2.emitWarning=="function"?p2.emitWarning(e):console.warn(e))}Ck.debug=Cae;Ck.warn=Dae});var rg=v(tg=>{"use strict";var eg=Ie(),m2=At(),Xh="<<",Qh={identify:t=>t===Xh||typeof t=="symbol"&&t.description===Xh,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new m2.Scalar(Symbol(Xh)),{addToJSMap:h2}),stringify:()=>Xh},Nae=(t,e)=>(Qh.identify(e)||eg.isScalar(e)&&(!e.type||e.type===m2.Scalar.PLAIN)&&Qh.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Qh.tag&&r.default);function h2(t,e,r){let n=g2(t,r);if(eg.isSeq(n))for(let i of n.items)Nk(t,e,i);else if(Array.isArray(n))for(let i of n)Nk(t,e,i);else Nk(t,e,n)}function Nk(t,e,r){let n=g2(t,r);if(!eg.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function g2(t,e){return t&&eg.isAlias(e)?e.resolve(t.doc,t):e}tg.addMergeToJSMap=h2;tg.isMergeKey=Nae;tg.merge=Qh});var Mk=v(v2=>{"use strict";var jae=Dk(),y2=rg(),Mae=td(),_2=Ie(),jk=bo();function zae(t,e,{key:r,value:n}){if(_2.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(y2.isMergeKey(t,r))y2.addMergeToJSMap(t,e,n);else{let i=jk.toJS(r,"",t);if(e instanceof Map)e.set(i,jk.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=Fae(r,i,t),s=jk.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function Fae(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(_2.isNode(t)&&r?.doc){let n=Mae.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),jae.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}v2.addPairToJSMap=zae});var $o=v(zk=>{"use strict";var b2=Ju(),Lae=f2(),Uae=Mk(),ng=Ie();function qae(t,e,r){let n=b2.createNode(t,void 0,r),i=b2.createNode(e,void 0,r);return new ig(n,i)}var ig=class t{constructor(e,r=null){Object.defineProperty(this,ng.NODE_TYPE,{value:ng.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return ng.isNode(r)&&(r=r.clone(e)),ng.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return Uae.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?Lae.stringifyPair(this,e,r,n):JSON.stringify(this)}};zk.Pair=ig;zk.createPair=qae});var Fk=v(w2=>{"use strict";var Ds=Ie(),S2=td(),og=Yu();function Bae(t,e,r){return(e.inFlow??t.flow?Hae:Zae)(t,e,r)}function Zae({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=og.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;mg=null);l||(l=d.length>u||b.includes(` +`+og.indentComment(l(t),c),a&&a()):d&&s&&s(),p}function Hae({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;n+=o;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let m=0;mg=null);l||(l=d.length>u||b.includes(` `)),m0&&(l||(l=d.reduce((_,x)=>_+x.length+2,2)+(b.length+2)>e.options.lineWidth)),l&&(b+=",")),g&&(b+=og.lineComment(b,n,a(g))),d.push(b),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let m=d.reduce((h,g)=>h+g.length+2,2);l=e.options.lineWidth>0&&m>e.options.lineWidth}if(l){let m=f;for(let h of d)m+=h?` ${o}${i}${h}`:` `;return`${m} -${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function sg({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=og.indentComment(e(n),t);r.push(o.trimStart())}}wU.stringifyCollection=Fae});var ko=v(Uk=>{"use strict";var qae=Fk(),Bae=Mk(),Zae=Gh(),$o=Ie(),ag=xo(),Hae=At();function nd(t,e){let r=$o.isScalar(e)?e.value:e;for(let n of t)if($o.isPair(n)&&(n.key===e||n.key===r||$o.isScalar(n.key)&&n.key.value===r))return n}var Lk=class extends Zae.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super($o.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(ag.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;$o.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new ag.Pair(e,e?.value):n=new ag.Pair(e.key,e.value);let i=nd(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);$o.isScalar(i.value)&&Hae.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=nd(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=nd(this.items,e)?.value;return(!r&&$o.isScalar(i)?i.value:i)??void 0}has(e){return!!nd(this.items,e)}set(e,r){this.add(new ag.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)Bae.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!$o.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),qae.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Uk.YAMLMap=Lk;Uk.findPair=nd});var ec=v($U=>{"use strict";var Gae=Ie(),xU=ko(),Vae={collection:"map",default:!0,nodeClass:xU.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Gae.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>xU.YAMLMap.from(t,e,r)};$U.map=Vae});var Eo=v(kU=>{"use strict";var Wae=Ju(),Kae=Fk(),Jae=Gh(),lg=Ie(),Yae=At(),Xae=vo(),qk=class extends Jae.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(lg.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=cg(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=cg(e);if(typeof n!="number")return;let i=this.items[n];return!r&&lg.isScalar(i)?i.value:i}has(e){let r=cg(e);return typeof r=="number"&&r=0?e:null}kU.YAMLSeq=qk});var tc=v(AU=>{"use strict";var Qae=Ie(),EU=Eo(),ece={collection:"seq",default:!0,nodeClass:EU.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Qae.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>EU.YAMLSeq.from(t,e,r)};AU.seq=ece});var id=v(TU=>{"use strict";var tce=ed(),rce={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),tce.stringifyString(t,e,r,n)}};TU.string=rce});var ug=v(IU=>{"use strict";var OU=At(),PU={identify:t=>t==null,createNode:()=>new OU.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new OU.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&PU.test.test(t)?t:e.options.nullStr};IU.nullTag=PU});var Bk=v(CU=>{"use strict";var nce=At(),RU={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new nce.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&RU.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};CU.boolTag=RU});var rc=v(DU=>{"use strict";function ice({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}DU.stringifyNumber=ice});var Hk=v(dg=>{"use strict";var oce=At(),Zk=rc(),sce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Zk.stringifyNumber},ace={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Zk.stringifyNumber(t)}},cce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new oce.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Zk.stringifyNumber};dg.float=cce;dg.floatExp=ace;dg.floatNaN=sce});var Vk=v(pg=>{"use strict";var NU=rc(),fg=t=>typeof t=="bigint"||Number.isInteger(t),Gk=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function jU(t,e,r){let{value:n}=t;return fg(n)&&n>=0?r+n.toString(e):NU.stringifyNumber(t)}var lce={identify:t=>fg(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Gk(t,2,8,r),stringify:t=>jU(t,8,"0o")},uce={identify:fg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Gk(t,0,10,r),stringify:NU.stringifyNumber},dce={identify:t=>fg(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Gk(t,2,16,r),stringify:t=>jU(t,16,"0x")};pg.int=uce;pg.intHex=dce;pg.intOct=lce});var zU=v(MU=>{"use strict";var fce=ec(),pce=ug(),mce=tc(),hce=id(),gce=Bk(),Wk=Hk(),Kk=Vk(),yce=[fce.map,mce.seq,hce.string,pce.nullTag,gce.boolTag,Kk.intOct,Kk.int,Kk.intHex,Wk.floatNaN,Wk.floatExp,Wk.float];MU.schema=yce});var UU=v(LU=>{"use strict";var _ce=At(),vce=ec(),bce=tc();function FU(t){return typeof t=="bigint"||Number.isInteger(t)}var mg=({value:t})=>JSON.stringify(t),Sce=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:mg},{identify:t=>t==null,createNode:()=>new _ce.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:mg},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:mg},{identify:FU,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>FU(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:mg}],wce={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},xce=[vce.map,bce.seq].concat(Sce,wce);LU.schema=xce});var Yk=v(qU=>{"use strict";var od=Le("buffer"),Jk=At(),$ce=ed(),kce={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof od.Buffer=="function")return od.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var hg=Ie(),Xk=xo(),Ece=At(),Ace=Eo();function BU(t,e){if(hg.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Xk.Pair(new Ece.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} +${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function sg({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=og.indentComment(e(n),t);r.push(o.trimStart())}}w2.stringifyCollection=Bae});var Eo=v(Uk=>{"use strict";var Gae=Fk(),Vae=Mk(),Wae=Gh(),ko=Ie(),ag=$o(),Kae=At();function nd(t,e){let r=ko.isScalar(e)?e.value:e;for(let n of t)if(ko.isPair(n)&&(n.key===e||n.key===r||ko.isScalar(n.key)&&n.key.value===r))return n}var Lk=class extends Wae.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ko.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(ag.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;ko.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new ag.Pair(e,e?.value):n=new ag.Pair(e.key,e.value);let i=nd(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);ko.isScalar(i.value)&&Kae.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=nd(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=nd(this.items,e)?.value;return(!r&&ko.isScalar(i)?i.value:i)??void 0}has(e){return!!nd(this.items,e)}set(e,r){this.add(new ag.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)Vae.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ko.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Gae.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Uk.YAMLMap=Lk;Uk.findPair=nd});var ec=v($2=>{"use strict";var Jae=Ie(),x2=Eo(),Yae={collection:"map",default:!0,nodeClass:x2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Jae.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>x2.YAMLMap.from(t,e,r)};$2.map=Yae});var Ao=v(k2=>{"use strict";var Xae=Ju(),Qae=Fk(),ece=Gh(),lg=Ie(),tce=At(),rce=bo(),qk=class extends ece.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(lg.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=cg(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=cg(e);if(typeof n!="number")return;let i=this.items[n];return!r&&lg.isScalar(i)?i.value:i}has(e){let r=cg(e);return typeof r=="number"&&r=0?e:null}k2.YAMLSeq=qk});var tc=v(A2=>{"use strict";var nce=Ie(),E2=Ao(),ice={collection:"seq",default:!0,nodeClass:E2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return nce.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>E2.YAMLSeq.from(t,e,r)};A2.seq=ice});var id=v(T2=>{"use strict";var oce=ed(),sce={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),oce.stringifyString(t,e,r,n)}};T2.string=sce});var ug=v(I2=>{"use strict";var O2=At(),P2={identify:t=>t==null,createNode:()=>new O2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new O2.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&P2.test.test(t)?t:e.options.nullStr};I2.nullTag=P2});var Bk=v(C2=>{"use strict";var ace=At(),R2={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new ace.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&R2.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};C2.boolTag=R2});var rc=v(D2=>{"use strict";function cce({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}D2.stringifyNumber=cce});var Hk=v(dg=>{"use strict";var lce=At(),Zk=rc(),uce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Zk.stringifyNumber},dce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Zk.stringifyNumber(t)}},fce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new lce.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Zk.stringifyNumber};dg.float=fce;dg.floatExp=dce;dg.floatNaN=uce});var Vk=v(pg=>{"use strict";var N2=rc(),fg=t=>typeof t=="bigint"||Number.isInteger(t),Gk=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function j2(t,e,r){let{value:n}=t;return fg(n)&&n>=0?r+n.toString(e):N2.stringifyNumber(t)}var pce={identify:t=>fg(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Gk(t,2,8,r),stringify:t=>j2(t,8,"0o")},mce={identify:fg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Gk(t,0,10,r),stringify:N2.stringifyNumber},hce={identify:t=>fg(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Gk(t,2,16,r),stringify:t=>j2(t,16,"0x")};pg.int=mce;pg.intHex=hce;pg.intOct=pce});var z2=v(M2=>{"use strict";var gce=ec(),yce=ug(),_ce=tc(),vce=id(),bce=Bk(),Wk=Hk(),Kk=Vk(),Sce=[gce.map,_ce.seq,vce.string,yce.nullTag,bce.boolTag,Kk.intOct,Kk.int,Kk.intHex,Wk.floatNaN,Wk.floatExp,Wk.float];M2.schema=Sce});var U2=v(L2=>{"use strict";var wce=At(),xce=ec(),$ce=tc();function F2(t){return typeof t=="bigint"||Number.isInteger(t)}var mg=({value:t})=>JSON.stringify(t),kce=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:mg},{identify:t=>t==null,createNode:()=>new wce.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:mg},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:mg},{identify:F2,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>F2(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:mg}],Ece={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Ace=[xce.map,$ce.seq].concat(kce,Ece);L2.schema=Ace});var Yk=v(q2=>{"use strict";var od=Le("buffer"),Jk=At(),Tce=ed(),Oce={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof od.Buffer=="function")return od.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var hg=Ie(),Xk=$o(),Pce=At(),Ice=Ao();function B2(t,e){if(hg.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Xk.Pair(new Pce.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} ${i.key.commentBefore}`:n.commentBefore),n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment} -${o.comment}`:n.comment}n=i}t.items[r]=hg.isPair(n)?n:new Xk.Pair(n)}}else e("Expected a sequence for this tag");return t}function ZU(t,e,r){let{replacer:n}=r,i=new Ace.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(Xk.createPair(a,c,r))}return i}var Tce={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:BU,createNode:ZU};gg.createPairs=ZU;gg.pairs=Tce;gg.resolvePairs=BU});var tE=v(eE=>{"use strict";var HU=Ie(),Qk=vo(),sd=ko(),Oce=Eo(),GU=yg(),Ds=class t extends Oce.YAMLSeq{constructor(){super(),this.add=sd.YAMLMap.prototype.add.bind(this),this.delete=sd.YAMLMap.prototype.delete.bind(this),this.get=sd.YAMLMap.prototype.get.bind(this),this.has=sd.YAMLMap.prototype.has.bind(this),this.set=sd.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(HU.isPair(i)?(o=Qk.toJS(i.key,"",r),s=Qk.toJS(i.value,o,r)):o=Qk.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=GU.createPairs(e,r,n),o=new this;return o.items=i.items,o}};Ds.tag="tag:yaml.org,2002:omap";var Pce={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ds,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=GU.resolvePairs(t,e),n=[];for(let{key:i}of r.items)HU.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Ds,r)},createNode:(t,e,r)=>Ds.from(t,e,r)};eE.YAMLOMap=Ds;eE.omap=Pce});var YU=v(rE=>{"use strict";var VU=At();function WU({value:t,source:e},r){return e&&(t?KU:JU).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var KU={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new VU.Scalar(!0),stringify:WU},JU={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new VU.Scalar(!1),stringify:WU};rE.falseTag=JU;rE.trueTag=KU});var XU=v(_g=>{"use strict";var Ice=At(),nE=rc(),Rce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:nE.stringifyNumber},Cce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():nE.stringifyNumber(t)}},Dce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Ice.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:nE.stringifyNumber};_g.float=Dce;_g.floatExp=Cce;_g.floatNaN=Rce});var e2=v(cd=>{"use strict";var QU=rc(),ad=t=>typeof t=="bigint"||Number.isInteger(t);function vg(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function iE(t,e,r){let{value:n}=t;if(ad(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return QU.stringifyNumber(t)}var Nce={identify:ad,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>vg(t,2,2,r),stringify:t=>iE(t,2,"0b")},jce={identify:ad,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>vg(t,1,8,r),stringify:t=>iE(t,8,"0")},Mce={identify:ad,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>vg(t,0,10,r),stringify:QU.stringifyNumber},zce={identify:ad,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>vg(t,2,16,r),stringify:t=>iE(t,16,"0x")};cd.int=Mce;cd.intBin=Nce;cd.intHex=zce;cd.intOct=jce});var sE=v(oE=>{"use strict";var wg=Ie(),bg=xo(),Sg=ko(),Ns=class t extends Sg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;wg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new bg.Pair(e.key,null):r=new bg.Pair(e,null),Sg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Sg.findPair(this.items,e);return!r&&wg.isPair(n)?wg.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Sg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new bg.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(bg.createPair(s,null,n));return o}};Ns.tag="tag:yaml.org,2002:set";var Fce={collection:"map",identify:t=>t instanceof Set,nodeClass:Ns,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Ns.from(t,e,r),resolve(t,e){if(wg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ns,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};oE.YAMLSet=Ns;oE.set=Fce});var cE=v(xg=>{"use strict";var Lce=rc();function aE(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function t2(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return Lce.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Uce={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>aE(t,r),stringify:t2},qce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>aE(t,!1),stringify:t2},r2={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(r2.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=aE(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};xg.floatTime=qce;xg.intTime=Uce;xg.timestamp=r2});var o2=v(i2=>{"use strict";var Bce=ec(),Zce=ug(),Hce=tc(),Gce=id(),Vce=Yk(),n2=YU(),lE=XU(),$g=e2(),Wce=rg(),Kce=tE(),Jce=yg(),Yce=sE(),uE=cE(),Xce=[Bce.map,Hce.seq,Gce.string,Zce.nullTag,n2.trueTag,n2.falseTag,$g.intBin,$g.intOct,$g.int,$g.intHex,lE.floatNaN,lE.floatExp,lE.float,Vce.binary,Wce.merge,Kce.omap,Jce.pairs,Yce.set,uE.intTime,uE.floatTime,uE.timestamp];i2.schema=Xce});var h2=v(pE=>{"use strict";var l2=ec(),Qce=ug(),u2=tc(),ele=id(),tle=Bk(),dE=Hk(),fE=Vk(),rle=zU(),nle=UU(),d2=Yk(),ld=rg(),f2=tE(),p2=yg(),s2=o2(),m2=sE(),kg=cE(),a2=new Map([["core",rle.schema],["failsafe",[l2.map,u2.seq,ele.string]],["json",nle.schema],["yaml11",s2.schema],["yaml-1.1",s2.schema]]),c2={binary:d2.binary,bool:tle.boolTag,float:dE.float,floatExp:dE.floatExp,floatNaN:dE.floatNaN,floatTime:kg.floatTime,int:fE.int,intHex:fE.intHex,intOct:fE.intOct,intTime:kg.intTime,map:l2.map,merge:ld.merge,null:Qce.nullTag,omap:f2.omap,pairs:p2.pairs,seq:u2.seq,set:m2.set,timestamp:kg.timestamp},ile={"tag:yaml.org,2002:binary":d2.binary,"tag:yaml.org,2002:merge":ld.merge,"tag:yaml.org,2002:omap":f2.omap,"tag:yaml.org,2002:pairs":p2.pairs,"tag:yaml.org,2002:set":m2.set,"tag:yaml.org,2002:timestamp":kg.timestamp};function ole(t,e,r){let n=a2.get(e);if(n&&!t)return r&&!n.includes(ld.merge)?n.concat(ld.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(a2.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(ld.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?c2[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(c2).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}pE.coreKnownTags=ile;pE.getTags=ole});var gE=v(g2=>{"use strict";var mE=Ie(),sle=ec(),ale=tc(),cle=id(),Eg=h2(),lle=(t,e)=>t.keye.key?1:0,hE=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Eg.getTags(e,"compat"):e?Eg.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Eg.coreKnownTags:{},this.tags=Eg.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,mE.MAP,{value:sle.map}),Object.defineProperty(this,mE.SCALAR,{value:cle.string}),Object.defineProperty(this,mE.SEQ,{value:ale.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?lle:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};g2.Schema=hE});var _2=v(y2=>{"use strict";var ule=Ie(),yE=td(),ud=Yu();function dle(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=yE.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(ud.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(ule.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(ud.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=yE.stringify(t.contents,i,()=>a=null,c);a&&(l+=ud.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(yE.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` +${o.comment}`:n.comment}n=i}t.items[r]=hg.isPair(n)?n:new Xk.Pair(n)}}else e("Expected a sequence for this tag");return t}function Z2(t,e,r){let{replacer:n}=r,i=new Ice.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(Xk.createPair(a,c,r))}return i}var Rce={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:B2,createNode:Z2};gg.createPairs=Z2;gg.pairs=Rce;gg.resolvePairs=B2});var tE=v(eE=>{"use strict";var H2=Ie(),Qk=bo(),sd=Eo(),Cce=Ao(),G2=yg(),Ns=class t extends Cce.YAMLSeq{constructor(){super(),this.add=sd.YAMLMap.prototype.add.bind(this),this.delete=sd.YAMLMap.prototype.delete.bind(this),this.get=sd.YAMLMap.prototype.get.bind(this),this.has=sd.YAMLMap.prototype.has.bind(this),this.set=sd.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(H2.isPair(i)?(o=Qk.toJS(i.key,"",r),s=Qk.toJS(i.value,o,r)):o=Qk.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=G2.createPairs(e,r,n),o=new this;return o.items=i.items,o}};Ns.tag="tag:yaml.org,2002:omap";var Dce={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ns,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=G2.resolvePairs(t,e),n=[];for(let{key:i}of r.items)H2.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Ns,r)},createNode:(t,e,r)=>Ns.from(t,e,r)};eE.YAMLOMap=Ns;eE.omap=Dce});var Y2=v(rE=>{"use strict";var V2=At();function W2({value:t,source:e},r){return e&&(t?K2:J2).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var K2={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new V2.Scalar(!0),stringify:W2},J2={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new V2.Scalar(!1),stringify:W2};rE.falseTag=J2;rE.trueTag=K2});var X2=v(_g=>{"use strict";var Nce=At(),nE=rc(),jce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:nE.stringifyNumber},Mce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():nE.stringifyNumber(t)}},zce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Nce.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:nE.stringifyNumber};_g.float=zce;_g.floatExp=Mce;_g.floatNaN=jce});var eU=v(cd=>{"use strict";var Q2=rc(),ad=t=>typeof t=="bigint"||Number.isInteger(t);function vg(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function iE(t,e,r){let{value:n}=t;if(ad(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return Q2.stringifyNumber(t)}var Fce={identify:ad,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>vg(t,2,2,r),stringify:t=>iE(t,2,"0b")},Lce={identify:ad,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>vg(t,1,8,r),stringify:t=>iE(t,8,"0")},Uce={identify:ad,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>vg(t,0,10,r),stringify:Q2.stringifyNumber},qce={identify:ad,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>vg(t,2,16,r),stringify:t=>iE(t,16,"0x")};cd.int=Uce;cd.intBin=Fce;cd.intHex=qce;cd.intOct=Lce});var sE=v(oE=>{"use strict";var wg=Ie(),bg=$o(),Sg=Eo(),js=class t extends Sg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;wg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new bg.Pair(e.key,null):r=new bg.Pair(e,null),Sg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Sg.findPair(this.items,e);return!r&&wg.isPair(n)?wg.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Sg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new bg.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(bg.createPair(s,null,n));return o}};js.tag="tag:yaml.org,2002:set";var Bce={collection:"map",identify:t=>t instanceof Set,nodeClass:js,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>js.from(t,e,r),resolve(t,e){if(wg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new js,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};oE.YAMLSet=js;oE.set=Bce});var cE=v(xg=>{"use strict";var Zce=rc();function aE(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function tU(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return Zce.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Hce={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>aE(t,r),stringify:tU},Gce={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>aE(t,!1),stringify:tU},rU={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(rU.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=aE(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};xg.floatTime=Gce;xg.intTime=Hce;xg.timestamp=rU});var oU=v(iU=>{"use strict";var Vce=ec(),Wce=ug(),Kce=tc(),Jce=id(),Yce=Yk(),nU=Y2(),lE=X2(),$g=eU(),Xce=rg(),Qce=tE(),ele=yg(),tle=sE(),uE=cE(),rle=[Vce.map,Kce.seq,Jce.string,Wce.nullTag,nU.trueTag,nU.falseTag,$g.intBin,$g.intOct,$g.int,$g.intHex,lE.floatNaN,lE.floatExp,lE.float,Yce.binary,Xce.merge,Qce.omap,ele.pairs,tle.set,uE.intTime,uE.floatTime,uE.timestamp];iU.schema=rle});var hU=v(pE=>{"use strict";var lU=ec(),nle=ug(),uU=tc(),ile=id(),ole=Bk(),dE=Hk(),fE=Vk(),sle=z2(),ale=U2(),dU=Yk(),ld=rg(),fU=tE(),pU=yg(),sU=oU(),mU=sE(),kg=cE(),aU=new Map([["core",sle.schema],["failsafe",[lU.map,uU.seq,ile.string]],["json",ale.schema],["yaml11",sU.schema],["yaml-1.1",sU.schema]]),cU={binary:dU.binary,bool:ole.boolTag,float:dE.float,floatExp:dE.floatExp,floatNaN:dE.floatNaN,floatTime:kg.floatTime,int:fE.int,intHex:fE.intHex,intOct:fE.intOct,intTime:kg.intTime,map:lU.map,merge:ld.merge,null:nle.nullTag,omap:fU.omap,pairs:pU.pairs,seq:uU.seq,set:mU.set,timestamp:kg.timestamp},cle={"tag:yaml.org,2002:binary":dU.binary,"tag:yaml.org,2002:merge":ld.merge,"tag:yaml.org,2002:omap":fU.omap,"tag:yaml.org,2002:pairs":pU.pairs,"tag:yaml.org,2002:set":mU.set,"tag:yaml.org,2002:timestamp":kg.timestamp};function lle(t,e,r){let n=aU.get(e);if(n&&!t)return r&&!n.includes(ld.merge)?n.concat(ld.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(aU.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(ld.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?cU[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(cU).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}pE.coreKnownTags=cle;pE.getTags=lle});var gE=v(gU=>{"use strict";var mE=Ie(),ule=ec(),dle=tc(),fle=id(),Eg=hU(),ple=(t,e)=>t.keye.key?1:0,hE=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Eg.getTags(e,"compat"):e?Eg.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Eg.coreKnownTags:{},this.tags=Eg.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,mE.MAP,{value:ule.map}),Object.defineProperty(this,mE.SCALAR,{value:fle.string}),Object.defineProperty(this,mE.SEQ,{value:dle.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?ple:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};gU.Schema=hE});var _U=v(yU=>{"use strict";var mle=Ie(),yE=td(),ud=Yu();function hle(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=yE.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(ud.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(mle.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(ud.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=yE.stringify(t.contents,i,()=>a=null,c);a&&(l+=ud.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(yE.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` `)?(r.push("..."),r.push(ud.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push(ud.indentComment(o(c),"")))}return r.join(` `)+` -`}y2.stringifyDocument=dle});var dd=v(v2=>{"use strict";var fle=Ku(),nc=Gh(),ln=Ie(),ple=xo(),mle=vo(),hle=gE(),gle=_2(),_E=qh(),yle=wk(),_le=Ju(),vE=Sk(),bE=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ln.NODE_TYPE,{value:ln.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new vE.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[ln.NODE_TYPE]:{value:ln.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=ln.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ic(this.contents)&&this.contents.add(e)}addIn(e,r){ic(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=_E.anchorNames(this);e.anchor=!r||n.has(r)?_E.findNewAnchor(r||"a",n):r}return new fle.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,b=r.filter(g).map(String);b.length>0&&(r=r.concat(b)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=_E.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=_le.createNode(e,u,m);return a&&ln.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new ple.Pair(i,o)}delete(e){return ic(this.contents)?this.contents.delete(e):!1}deleteIn(e){return nc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ic(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return ln.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return nc.isEmptyPath(e)?!r&&ln.isScalar(this.contents)?this.contents.value:this.contents:ln.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return ln.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return nc.isEmptyPath(e)?this.contents!==void 0:ln.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=nc.collectionFromPath(this.schema,[e],r):ic(this.contents)&&this.contents.set(e,r)}setIn(e,r){nc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=nc.collectionFromPath(this.schema,Array.from(e),r):ic(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new vE.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new vE.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new hle.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=mle.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?yle.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return gle.stringifyDocument(this,e)}};function ic(t){if(ln.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}v2.Document=bE});var md=v(pd=>{"use strict";var fd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},SE=class extends fd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},wE=class extends fd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},vle=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 +`}yU.stringifyDocument=hle});var dd=v(vU=>{"use strict";var gle=Ku(),nc=Gh(),ln=Ie(),yle=$o(),_le=bo(),vle=gE(),ble=_U(),_E=qh(),Sle=wk(),wle=Ju(),vE=Sk(),bE=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ln.NODE_TYPE,{value:ln.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new vE.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[ln.NODE_TYPE]:{value:ln.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=ln.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ic(this.contents)&&this.contents.add(e)}addIn(e,r){ic(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=_E.anchorNames(this);e.anchor=!r||n.has(r)?_E.findNewAnchor(r||"a",n):r}return new gle.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,b=r.filter(g).map(String);b.length>0&&(r=r.concat(b)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=_E.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=wle.createNode(e,u,m);return a&&ln.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new yle.Pair(i,o)}delete(e){return ic(this.contents)?this.contents.delete(e):!1}deleteIn(e){return nc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ic(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return ln.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return nc.isEmptyPath(e)?!r&&ln.isScalar(this.contents)?this.contents.value:this.contents:ln.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return ln.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return nc.isEmptyPath(e)?this.contents!==void 0:ln.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=nc.collectionFromPath(this.schema,[e],r):ic(this.contents)&&this.contents.set(e,r)}setIn(e,r){nc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=nc.collectionFromPath(this.schema,Array.from(e),r):ic(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new vE.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new vE.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new vle.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=_le.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Sle.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return ble.stringifyDocument(this,e)}};function ic(t){if(ln.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}vU.Document=bE});var md=v(pd=>{"use strict";var fd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},SE=class extends fd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},wE=class extends fd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},xle=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];c?.line===n&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-o)));let l=" ".repeat(o)+"^".repeat(a);r.message+=`: ${s} ${l} -`}};pd.YAMLError=fd;pd.YAMLParseError=SE;pd.YAMLWarning=wE;pd.prettifyError=vle});var hd=v(b2=>{"use strict";function ble(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,b=null,_=null,x=null,$=null,w=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&o(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&A.type!=="comment"&&A.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),A.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&A.source.includes(" ")&&(h=A),u=!0;break;case"comment":{u||o(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=A.source.substring(1)||" ";d?d+=f+N:d=N,f="",l=!1;break}case"newline":l?d?d+=A.source:(!$||r!=="seq-item-ind")&&(c=!0):f+=A.source,l=!0,p=!0,(g||b)&&(_=A),u=!0;break;case"anchor":g&&o(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&o(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=A,w??(w=A.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(A,"MULTIPLE_TAGS","A node can have at most one tag"),b=A,w??(w=A.offset),l=!1,u=!1,m=!0;break}case r:(g||b)&&o(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),$&&o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),$=A,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){x&&o(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),x=A,l=!1,u=!1;break}default:o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),l=!1,u=!1}let R=t[t.length-1],O=R?R.offset+R.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:$,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:b,newlineAfterProp:_,end:O,start:w??O}}b2.resolveProps=ble});var Ag=v(S2=>{"use strict";function xE(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(xE(e.key)||xE(e.value))return!0}return!1;default:return!0}}S2.containsNewline=xE});var $E=v(w2=>{"use strict";var Sle=Ag();function wle(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Sle.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}w2.flowIndentCheck=wle});var kE=v($2=>{"use strict";var x2=Ie();function xle(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||x2.isScalar(o)&&x2.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}$2.mapIncludes=xle});var P2=v(O2=>{"use strict";var k2=xo(),$le=ko(),E2=hd(),kle=Ag(),A2=$E(),Ele=kE(),T2="All mapping items must start at the same column";function Ale({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??$le.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=E2.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",T2)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` -`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||kle.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",T2);r.atKey=!0;let b=h.end,_=f?t(r,f,h,i):e(r,b,d,null,h,i);r.schema.compat&&A2.flowIndentCheck(n.indent,f,i),r.atKey=!1,Ele.mapIncludes(r,a.items,_)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let x=E2.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=x.end,x.found){g&&(m?.type==="block-map"&&!x.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start{"use strict";var Tle=Eo(),Ole=hd(),Ple=$E();function Ile({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Tle.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=Ole.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&Ple.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}I2.resolveBlockSeq=Ile});var oc=v(C2=>{"use strict";function Rle(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}C2.resolveEnd=Rle});var M2=v(j2=>{"use strict";var Cle=Ie(),Dle=xo(),D2=ko(),Nle=Eo(),jle=oc(),N2=hd(),Mle=Ag(),zle=kE(),EE="Block collections are not allowed within flow collections",AE=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Fle({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?D2.YAMLMap:Nle.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=jle.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` -`+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}j2.resolveFlowCollection=Fle});var F2=v(z2=>{"use strict";var Lle=Ie(),Ule=At(),qle=ko(),Ble=Eo(),Zle=P2(),Hle=R2(),Gle=M2();function TE(t,e,r,n,i,o){let s=r.type==="block-map"?Zle.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?Hle.resolveBlockSeq(t,e,r,n,o):Gle.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function Vle(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),TE(t,e,r,i,s)}let l=TE(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=Lle.isNode(u)?u:new Ule.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}z2.composeCollection=Vle});var PE=v(L2=>{"use strict";var OE=At();function Wle(t,e,r){let n=e.offset,i=Kle(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?OE.Scalar.BLOCK_FOLDED:OE.Scalar.BLOCK_LITERAL,s=e.source?Jle(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` +`}};pd.YAMLError=fd;pd.YAMLParseError=SE;pd.YAMLWarning=wE;pd.prettifyError=xle});var hd=v(bU=>{"use strict";function $le(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,b=null,_=null,x=null,$=null,w=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&o(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&A.type!=="comment"&&A.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),A.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&A.source.includes(" ")&&(h=A),u=!0;break;case"comment":{u||o(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=A.source.substring(1)||" ";d?d+=f+N:d=N,f="",l=!1;break}case"newline":l?d?d+=A.source:(!$||r!=="seq-item-ind")&&(c=!0):f+=A.source,l=!0,p=!0,(g||b)&&(_=A),u=!0;break;case"anchor":g&&o(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&o(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=A,w??(w=A.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(A,"MULTIPLE_TAGS","A node can have at most one tag"),b=A,w??(w=A.offset),l=!1,u=!1,m=!0;break}case r:(g||b)&&o(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),$&&o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),$=A,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){x&&o(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),x=A,l=!1,u=!1;break}default:o(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),l=!1,u=!1}let R=t[t.length-1],O=R?R.offset+R.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:$,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:b,newlineAfterProp:_,end:O,start:w??O}}bU.resolveProps=$le});var Ag=v(SU=>{"use strict";function xE(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(xE(e.key)||xE(e.value))return!0}return!1;default:return!0}}SU.containsNewline=xE});var $E=v(wU=>{"use strict";var kle=Ag();function Ele(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&kle.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}wU.flowIndentCheck=Ele});var kE=v($U=>{"use strict";var xU=Ie();function Ale(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||xU.isScalar(o)&&xU.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}$U.mapIncludes=Ale});var PU=v(OU=>{"use strict";var kU=$o(),Tle=Eo(),EU=hd(),Ole=Ag(),AU=$E(),Ple=kE(),TU="All mapping items must start at the same column";function Ile({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Tle.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=EU.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",TU)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` +`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||Ole.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",TU);r.atKey=!0;let b=h.end,_=f?t(r,f,h,i):e(r,b,d,null,h,i);r.schema.compat&&AU.flowIndentCheck(n.indent,f,i),r.atKey=!1,Ple.mapIncludes(r,a.items,_)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let x=EU.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=x.end,x.found){g&&(m?.type==="block-map"&&!x.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start{"use strict";var Rle=Ao(),Cle=hd(),Dle=$E();function Nle({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Rle.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=Cle.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&Dle.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}IU.resolveBlockSeq=Nle});var oc=v(CU=>{"use strict";function jle(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}CU.resolveEnd=jle});var MU=v(jU=>{"use strict";var Mle=Ie(),zle=$o(),DU=Eo(),Fle=Ao(),Lle=oc(),NU=hd(),Ule=Ag(),qle=kE(),EE="Block collections are not allowed within flow collections",AE=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Ble({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?DU.YAMLMap:Fle.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=Lle.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` +`+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}jU.resolveFlowCollection=Ble});var FU=v(zU=>{"use strict";var Zle=Ie(),Hle=At(),Gle=Eo(),Vle=Ao(),Wle=PU(),Kle=RU(),Jle=MU();function TE(t,e,r,n,i,o){let s=r.type==="block-map"?Wle.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?Kle.resolveBlockSeq(t,e,r,n,o):Jle.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function Yle(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),TE(t,e,r,i,s)}let l=TE(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=Zle.isNode(u)?u:new Hle.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}zU.composeCollection=Yle});var PE=v(LU=>{"use strict";var OE=At();function Xle(t,e,r){let n=e.offset,i=Qle(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?OE.Scalar.BLOCK_FOLDED:OE.Scalar.BLOCK_LITERAL,s=e.source?eue(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` `.repeat(Math.max(1,s.length-1)):"",g=n+i.length;return e.source&&(g+=e.source.length),{value:h,type:o,comment:i.comment,range:[n,g,g]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let h=0;hc&&(c=g.length);else{g.length=a;--h)s[h][0].length>c&&(a=h+1);let d="",f="",p=!1;for(let h=0;hc||b[0]===" "?(f===" "?f=` @@ -112,41 +112,41 @@ ${l} `+s[h][0].slice(c);d[d.length-1]!==` `&&(d+=` `);break;default:d+=` -`}let m=n+i.length+e.source.length;return{value:d,type:o,comment:i.comment,range:[n,m,m]}}function Kle({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",c=-1;for(let f=1;f{"use strict";var IE=At(),Yle=oc();function Xle(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(f,p,m)=>r(n+f,p,m);switch(i){case"scalar":a=IE.Scalar.PLAIN,c=Qle(o,l);break;case"single-quoted-scalar":a=IE.Scalar.QUOTE_SINGLE,c=eue(o,l);break;case"double-quoted-scalar":a=IE.Scalar.QUOTE_DOUBLE,c=tue(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,d=Yle.resolveEnd(s,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function Qle(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),U2(t)}function eue(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),U2(t.slice(1,-1)).replace(/''/g,"'")}function U2(t){let e,r;try{e=new RegExp(`(.*?)(?{"use strict";var IE=At(),tue=oc();function rue(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(f,p,m)=>r(n+f,p,m);switch(i){case"scalar":a=IE.Scalar.PLAIN,c=nue(o,l);break;case"single-quoted-scalar":a=IE.Scalar.QUOTE_SINGLE,c=iue(o,l);break;case"double-quoted-scalar":a=IE.Scalar.QUOTE_DOUBLE,c=oue(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,d=tue.resolveEnd(s,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function nue(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),UU(t)}function iue(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),UU(t.slice(1,-1)).replace(/''/g,"'")}function UU(t){let e,r;try{e=new RegExp(`(.*?)(?o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function rue(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` +`)&&(r+=n>o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function sue(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` `||n==="\r")&&!(n==="\r"&&t[e+2]!==` `);)n===` `&&(r+=` -`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var nue={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function iue(t,e,r,n){let i=t.substr(e,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}q2.resolveFlowScalar=Xle});var H2=v(Z2=>{"use strict";var js=Ie(),B2=At(),oue=PE(),sue=RE();function aue(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?oue.resolveBlockScalar(t,e,n):sue.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[js.SCALAR]:c?l=cue(t.schema,i,c,r,n):e.type==="scalar"?l=lue(t,i,e,n):l=t.schema[js.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=js.isScalar(d)?d:new B2.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new B2.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function cue(t,e,r,n,i){if(r==="!")return t[js.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[js.SCALAR])}function lue({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[js.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[js.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}Z2.composeScalar=aue});var V2=v(G2=>{"use strict";function uue(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}G2.emptyScalarPosition=uue});var J2=v(DE=>{"use strict";var due=Ku(),fue=Ie(),pue=F2(),W2=H2(),mue=oc(),hue=V2(),gue={composeNode:K2,composeEmptyNode:CE};function K2(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=yue(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=W2.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=pue.composeCollection(gue,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=CE(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!fue.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function CE(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:hue.emptyScalarPosition(e,r,n),indent:-1,source:""},d=W2.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function yue({options:t},{offset:e,source:r,end:n},i){let o=new due.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=mue.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}DE.composeEmptyNode=CE;DE.composeNode=K2});var Q2=v(X2=>{"use strict";var _ue=dd(),Y2=J2(),vue=oc(),bue=hd();function Sue(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new _ue.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=bue.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Y2.composeNode(l,i,u,s):Y2.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=vue.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}X2.composeDoc=Sue});var jE=v(rq=>{"use strict";var wue=Le("process"),xue=Sk(),$ue=dd(),gd=md(),eq=Ie(),kue=Q2(),Eue=oc();function yd(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function tq(t){let e="",r=!1,n=!1;for(let i=0;i{"use strict";var Ms=Ie(),BU=At(),lue=PE(),uue=RE();function due(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?lue.resolveBlockScalar(t,e,n):uue.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ms.SCALAR]:c?l=fue(t.schema,i,c,r,n):e.type==="scalar"?l=pue(t,i,e,n):l=t.schema[Ms.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=Ms.isScalar(d)?d:new BU.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new BU.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function fue(t,e,r,n,i){if(r==="!")return t[Ms.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Ms.SCALAR])}function pue({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Ms.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Ms.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}ZU.composeScalar=due});var VU=v(GU=>{"use strict";function mue(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}GU.emptyScalarPosition=mue});var JU=v(DE=>{"use strict";var hue=Ku(),gue=Ie(),yue=FU(),WU=HU(),_ue=oc(),vue=VU(),bue={composeNode:KU,composeEmptyNode:CE};function KU(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=Sue(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=WU.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=yue.composeCollection(bue,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=CE(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!gue.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function CE(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:vue.emptyScalarPosition(e,r,n),indent:-1,source:""},d=WU.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function Sue({options:t},{offset:e,source:r,end:n},i){let o=new hue.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=_ue.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}DE.composeEmptyNode=CE;DE.composeNode=KU});var QU=v(XU=>{"use strict";var wue=dd(),YU=JU(),xue=oc(),$ue=hd();function kue(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new wue.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=$ue.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?YU.composeNode(l,i,u,s):YU.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=xue.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}XU.composeDoc=kue});var jE=v(rq=>{"use strict";var Eue=Le("process"),Aue=Sk(),Tue=dd(),gd=md(),eq=Ie(),Oue=QU(),Pue=oc();function yd(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function tq(t){let e="",r=!1,n=!1;for(let i=0;i{let s=yd(r);o?this.warnings.push(new gd.YAMLWarning(s,n,i)):this.errors.push(new gd.YAMLParseError(s,n,i))},this.directives=new xue.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=tq(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} +`)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var NE=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,o)=>{let s=yd(r);o?this.warnings.push(new gd.YAMLWarning(s,n,i)):this.errors.push(new gd.YAMLParseError(s,n,i))},this.directives=new Aue.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=tq(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} ${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(eq.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];eq.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n} ${a}`:n}else{let s=o.commentBefore;o.commentBefore=s?`${n} -${s}`:n}}if(r){for(let o=0;o{let o=yd(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=kue.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new gd.YAMLParseError(yd(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new gd.YAMLParseError(yd(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Eue.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} -${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new gd.YAMLParseError(yd(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new $ue.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};rq.Composer=NE});var oq=v(Tg=>{"use strict";var Aue=PE(),Tue=RE(),Oue=md(),nq=ed();function Pue(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new Oue.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Tue.resolveFlowScalar(t,e,n);case"block-scalar":return Aue.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function Iue(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=nq.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` +${s}`:n}}if(r){for(let o=0;o{let o=yd(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Oue.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new gd.YAMLParseError(yd(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new gd.YAMLParseError(yd(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Pue.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} +${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new gd.YAMLParseError(yd(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Tue.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};rq.Composer=NE});var oq=v(Tg=>{"use strict";var Iue=PE(),Rue=RE(),Cue=md(),nq=ed();function Due(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new Cue.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Rue.resolveFlowScalar(t,e,n);case"block-scalar":return Iue.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function Nue(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=nq.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` `}];switch(a[0]){case"|":case">":{let l=a.indexOf(` `),u=a.substring(0,l),d=a.substring(l+1)+` `,f=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return iq(f,c)||f.push({type:"newline",offset:-1,indent:n,source:` -`}),{type:"block-scalar",offset:o,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function Rue(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=nq.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Cue(t,c);break;case'"':ME(t,c,"double-quoted-scalar");break;case"'":ME(t,c,"single-quoted-scalar");break;default:ME(t,c,"scalar")}}function Cue(t,e){let r=e.indexOf(` +`}),{type:"block-scalar",offset:o,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function jue(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=nq.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Mue(t,c);break;case'"':ME(t,c,"double-quoted-scalar");break;case"'":ME(t,c,"single-quoted-scalar");break;default:ME(t,c,"scalar")}}function Mue(t,e){let r=e.indexOf(` `),n=e.substring(0,r),i=e.substring(r+1)+` `;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];iq(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function iq(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function ME(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` -`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Tg.createScalarToken=Iue;Tg.resolveAsScalar=Pue;Tg.setScalarValue=Rue});var aq=v(sq=>{"use strict";var Due=t=>"type"in t?Pg(t):Og(t);function Pg(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Pg(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Og(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Og(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Og(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Og({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Pg(e)),r)for(let o of r)i+=o.source;return n&&(i+=Pg(n)),i}sq.stringify=Due});var dq=v(uq=>{"use strict";var zE=Symbol("break visit"),Nue=Symbol("skip children"),cq=Symbol("remove item");function Ms(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),lq(Object.freeze([]),t,e)}Ms.BREAK=zE;Ms.SKIP=Nue;Ms.REMOVE=cq;Ms.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};Ms.parentCollection=(t,e)=>{let r=Ms.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function lq(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s{"use strict";var FE=oq(),jue=aq(),Mue=dq(),LE="\uFEFF",UE="",qE="",BE="",zue=t=>!!t&&"items"in t,Fue=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Lue(t){switch(t){case LE:return"";case UE:return"";case qE:return"";case BE:return"";default:return JSON.stringify(t)}}function Uue(t){switch(t){case LE:return"byte-order-mark";case UE:return"doc-mode";case qE:return"flow-error-end";case BE:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Tg.createScalarToken=Nue;Tg.resolveAsScalar=Due;Tg.setScalarValue=jue});var aq=v(sq=>{"use strict";var zue=t=>"type"in t?Pg(t):Og(t);function Pg(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Pg(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Og(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Og(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Og(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Og({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Pg(e)),r)for(let o of r)i+=o.source;return n&&(i+=Pg(n)),i}sq.stringify=zue});var dq=v(uq=>{"use strict";var zE=Symbol("break visit"),Fue=Symbol("skip children"),cq=Symbol("remove item");function zs(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),lq(Object.freeze([]),t,e)}zs.BREAK=zE;zs.SKIP=Fue;zs.REMOVE=cq;zs.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};zs.parentCollection=(t,e)=>{let r=zs.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function lq(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s{"use strict";var FE=oq(),Lue=aq(),Uue=dq(),LE="\uFEFF",UE="",qE="",BE="",que=t=>!!t&&"items"in t,Bue=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Zue(t){switch(t){case LE:return"";case UE:return"";case qE:return"";case BE:return"";default:return JSON.stringify(t)}}function Hue(t){switch(t){case LE:return"byte-order-mark";case UE:return"doc-mode";case qE:return"flow-error-end";case BE:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}xr.createScalarToken=FE.createScalarToken;xr.resolveAsScalar=FE.resolveAsScalar;xr.setScalarValue=FE.setScalarValue;xr.stringify=jue.stringify;xr.visit=Mue.visit;xr.BOM=LE;xr.DOCUMENT=UE;xr.FLOW_END=qE;xr.SCALAR=BE;xr.isCollection=zue;xr.isScalar=Fue;xr.prettyToken=Lue;xr.tokenType=Uue});var GE=v(pq=>{"use strict";var _d=Ig();function In(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}var fq=new Set("0123456789ABCDEFabcdef"),que=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Rg=new Set(",[]{}"),Bue=new Set(` ,[]{} -\r `),ZE=t=>!t||Bue.has(t),HE=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}xr.createScalarToken=FE.createScalarToken;xr.resolveAsScalar=FE.resolveAsScalar;xr.setScalarValue=FE.setScalarValue;xr.stringify=Lue.stringify;xr.visit=Uue.visit;xr.BOM=LE;xr.DOCUMENT=UE;xr.FLOW_END=qE;xr.SCALAR=BE;xr.isCollection=que;xr.isScalar=Bue;xr.prettyToken=Zue;xr.tokenType=Hue});var GE=v(pq=>{"use strict";var _d=Ig();function In(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}var fq=new Set("0123456789ABCDEFabcdef"),Gue=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Rg=new Set(",[]{}"),Vue=new Set(` ,[]{} +\r `),ZE=t=>!t||Vue.has(t),HE=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` `?!0:r==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===` `||!i&&!this.atEnd)return e+n+1}return r===` @@ -161,27 +161,27 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus `&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield _d.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(In(o)||e&&Rg.has(o))break;r=n}else if(In(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===` `?(n+=1,i=` `,o=this.buffer[n+1]):r=n),o==="#"||e&&Rg.has(o))break;if(i===` -`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&Rg.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield _d.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(ZE),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(In(n)||r&&Rg.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!In(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(que.has(r))r=this.buffer[++e];else if(r==="%"&&fq.has(this.buffer[e+1])&&fq.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&Rg.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield _d.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(ZE),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(In(n)||r&&Rg.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!In(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(Gue.has(r))r=this.buffer[++e];else if(r==="%"&&fq.has(this.buffer[e+1])&&fq.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};pq.Lexer=HE});var WE=v(mq=>{"use strict";var VE=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[o]{"use strict";var Zue=Le("process"),hq=Ig(),Hue=GE();function Ao(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Dg(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&yq(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&gq(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};pq.Lexer=HE});var WE=v(mq=>{"use strict";var VE=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[o]{"use strict";var Wue=Le("process"),hq=Ig(),Kue=GE();function To(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Dg(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&yq(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&gq(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;ae.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ao(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(_q(r.key)&&!Ao(r.sep,"newline")){let s=sc(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(Ao(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=sc(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):Ao(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Ao(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Dg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||Ao(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Cg(n),o=sc(i);yq(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` +`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Dg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;ae.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(To(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(_q(r.key)&&!To(r.sep,"newline")){let s=sc(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(To(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=sc(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):To(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!To(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Dg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||To(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Cg(n),o=sc(i);yq(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(` -`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Cg(e),n=sc(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Cg(e),n=sc(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};vq.Parser=KE});var $q=v(bd=>{"use strict";var bq=jE(),Gue=dd(),vd=md(),Vue=Dk(),Wue=Ie(),Kue=WE(),Sq=JE();function wq(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Kue.LineCounter||null,prettyErrors:e}}function Jue(t,e={}){let{lineCounter:r,prettyErrors:n}=wq(e),i=new Sq.Parser(r?.addNewLine),o=new bq.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(vd.prettifyError(t,r)),a.warnings.forEach(vd.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function xq(t,e={}){let{lineCounter:r,prettyErrors:n}=wq(e),i=new Sq.Parser(r?.addNewLine),o=new bq.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new vd.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(vd.prettifyError(t,r)),s.warnings.forEach(vd.prettifyError(t,r))),s}function Yue(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=xq(t,r);if(!i)return null;if(i.warnings.forEach(o=>Vue.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function Xue(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return Wue.isDocument(t)&&!n?t.toString(r):new Gue.Document(t,n,r).toString(r)}bd.parse=Yue;bd.parseAllDocuments=Jue;bd.parseDocument=xq;bd.stringify=Xue});var tr=v(Ue=>{"use strict";var Que=jE(),ede=dd(),tde=gE(),YE=md(),rde=Ku(),To=Ie(),nde=xo(),ide=At(),ode=ko(),sde=Eo(),ade=Ig(),cde=GE(),lde=WE(),ude=JE(),Ng=$q(),kq=Hu();Ue.Composer=Que.Composer;Ue.Document=ede.Document;Ue.Schema=tde.Schema;Ue.YAMLError=YE.YAMLError;Ue.YAMLParseError=YE.YAMLParseError;Ue.YAMLWarning=YE.YAMLWarning;Ue.Alias=rde.Alias;Ue.isAlias=To.isAlias;Ue.isCollection=To.isCollection;Ue.isDocument=To.isDocument;Ue.isMap=To.isMap;Ue.isNode=To.isNode;Ue.isPair=To.isPair;Ue.isScalar=To.isScalar;Ue.isSeq=To.isSeq;Ue.Pair=nde.Pair;Ue.Scalar=ide.Scalar;Ue.YAMLMap=ode.YAMLMap;Ue.YAMLSeq=sde.YAMLSeq;Ue.CST=ade;Ue.Lexer=cde.Lexer;Ue.LineCounter=lde.LineCounter;Ue.Parser=ude.Parser;Ue.parse=Ng.parse;Ue.parseAllDocuments=Ng.parseAllDocuments;Ue.parseDocument=Ng.parseDocument;Ue.stringify=Ng.stringify;Ue.visit=kq.visit;Ue.visitAsync=kq.visitAsync});import{execFileSync as dde}from"node:child_process";import{existsSync as fde,readFileSync as pde}from"node:fs";import{join as Tq}from"node:path";function cc(t,e){return dde("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function Fg(t){try{let e=cc(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function Lg(t,e){mde(t,e);let r=cc(t,["rev-parse","HEAD"]).trim(),n=hde(t,e);return{groups:gde(t,n),head:r,inventory:{after:Aq(Mg(t,"spec.yaml")),before:Aq(XE(t,e,"spec.yaml"))},since:e,unsharded_commits:bde(t,e)}}function QE(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function mde(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");try{cc(t,["rev-parse","--verify","--quiet",`${r}^{commit}`])}catch{throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}}function hde(t,e){let r=cc(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` -`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!Eq(c)&&!Eq(a)))if(s.startsWith("A")){let l=jg(Mg(t,c));if(!l)continue;l.status==="done"?n.push(ac(l,"added-as-done")):l.status==="archived"&&n.push(ac(l,"archived"))}else if(s.startsWith("D")){let l=jg(XE(t,e,a));l&&n.push(ac(l,"archived"))}else{let l=jg(Mg(t,c));if(!l)continue;let d=jg(XE(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(ac(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(ac(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(ac(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function Eq(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function ac(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>QE(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function jg(t){if(t===null)return null;let e;try{e=(0,zg.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function Mg(t,e){let r=Tq(t,e);if(!fde(r))return null;try{return pde(r,"utf8")}catch{return null}}function XE(t,e,r){try{return cc(t,["show",`${e}:${r}`])}catch{return null}}function gde(t,e){let r=yde(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function yde(t){let e=Mg(t,Tq("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,zg.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function Aq(t){let e={};if(t!==null)try{let n=(0,zg.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function bde(t,e){let r=cc(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` -`)){if(i.trim().length===0)continue;let o=i.indexOf(" ");if(o<0)continue;let s=i.slice(0,o),a=i.slice(o+1);_de.test(a)&&(vde.test(a)||n.push({hash:s,subject:a}))}return n}var zg,_de,vde,Ug=y(()=>{"use strict";zg=St(tr(),1);_de=/^(feat|fix)(\([^)]*\))?!?:/,vde=/\bF-(\d{3,}|[a-f0-9]{6,})\b/});import{existsSync as Sde}from"node:fs";import{join as wde}from"node:path";function qg(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${xde[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` -`)}function Bg(t,e,r){let n=[`# Audit \u2014 shipped changes since ${t.since}`,"","| feature | AC | EARS | verification refs |","|---|---|---|---|"],i=new Map(e.features.map(o=>[o.id,o]));for(let o of t.groups)for(let s of o.features){let a=i.get(s.id);if(!a){n.push(`| ${s.id} | \u2014 | \u2014 | (removed from spec \u2014 see git history at ${t.since}) |`);continue}let c=a.acceptance_criteria??[];if(c.length===0){n.push(`| ${a.id} | \u2014 | \u2014 | (no acceptance criteria) |`);continue}for(let l of c)n.push(`| ${a.id} | ${l.id} | ${l.ears??"\u2014"} | ${kde(l,r)} |`)}return n.join(` -`)}function kde(t,e){let r=[...t.test_refs??[],...t.oracle_refs??[],...t.evidence_refs??[]];return r.length===0?"(none)":r.map(n=>{for(let[o,s]of $de)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${Sde(wde(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function Zg(t){let e=[`# ${t.project.name} \u2014 capability catalog`,""],r=[...t.capabilities??[]].filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=new Map(t.features.map(s=>[s.id,s])),i=new Set;for(let s of r){e.push(`## ${s.title??s.id}`,""),s.summary&&e.push(s.summary,"");for(let a of s.features??[]){let c=n.get(a);!c||c.status==="archived"||(i.add(a),Oq(e,c))}}let o=t.features.filter(s=>!i.has(s.id)&&s.status!=="archived").sort((s,a)=>s.id.localeCompare(a.id));if(o.length>0){e.push("## Uncategorized","");for(let s of o)Oq(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` -`)}function Oq(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=QE(r);n&&t.push(`- ${n}`)}t.push("")}var xde,$de,eA=y(()=>{"use strict";Ug();xde={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};$de=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as Ede}from"node:fs";function ii(t="./spec.yaml"){let e=Ede(t,"utf8");return(0,Pq.parse)(e)}var Pq,Hg=y(()=>{"use strict";Pq=St(tr(),1)});var Oo=v(($r,iA)=>{"use strict";var tA=$r.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+Rq(l)},"instance")):i!==void 0&&(this.property=i),e&&(this.message=e),n){var a=n.$id||n.id;this.schema=a||n}r!==void 0&&(this.instance=r),this.name=o,this.argument=s,this.stack=this.toString()};tA.prototype.toString=function(){return this.property+" "+this.message};var Gg=$r.ValidatorResult=function(e,r,n,i){this.instance=e,this.schema=r,this.options=n,this.path=i.path,this.propertyPath=i.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};Gg.prototype.addError=function(e){var r;if(typeof e=="string")r=new tA(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");r=new tA(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new zs(this);if(this.throwError)throw r;return r};Gg.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Ade(t,e){return e+": "+t.toString()+` -`}Gg.prototype.toString=function(e){return this.errors.map(Ade).join("")};Object.defineProperty(Gg.prototype,"valid",{get:function(){return!this.errors.length}});iA.exports.ValidatorResultError=zs;function zs(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,zs),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}zs.prototype=new Error;zs.prototype.constructor=zs;zs.prototype.name="Validation Error";var Iq=$r.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};Iq.prototype=Object.create(Error.prototype,{constructor:{value:Iq,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var rA=$r.SchemaContext=function(e,r,n,i,o){this.schema=e,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,a){return s+Rq(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};rA.prototype.resolve=function(e){return Cq(this.base,e)};rA.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=Cq(this.base,i||"");var s=new rA(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var Rn=$r.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(t){return typeof t=="string"&&parseFloat(t)===parseInt(t,10)&&!isNaN(t)},regex:function(t){var e=!0;try{new RegExp(t)}catch{e=!1}return e},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};Rn.regexp=Rn.regex;Rn.pattern=Rn.regex;Rn.ipv4=Rn["ip-address"];$r.isFormat=function(e,r,n){if(typeof e=="string"&&Rn[r]!==void 0){if(Rn[r]instanceof RegExp)return Rn[r].test(e);if(typeof Rn[r]=="function")return Rn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var Rq=$r.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};$r.deepCompareStrict=function t(e,r){if(typeof e!=typeof r)return!1;if(Array.isArray(e))return!Array.isArray(r)||e.length!==r.length?!1:e.every(function(o,s){return t(e[s],r[s])});if(typeof e=="object"){if(!e||!r)return e===r;var n=Object.keys(e),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return t(e[o],r[o])})}return e===r};function Tde(t,e,r,n){typeof r=="object"?e[n]=nA(t[n],r):t.indexOf(r)===-1&&e.push(r)}function Ode(t,e,r){e[r]=t[r]}function Pde(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=nA(t[n],e[n]):r[n]=e[n]}function nA(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Tde.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(Ode.bind(null,t,n)),Object.keys(e).forEach(Pde.bind(null,t,e,n))),n}iA.exports.deepMerge=nA;$r.objectGetPath=function(e,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e};function Ide(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}$r.encodePath=function(e){return e.map(Ide).join("")};$r.getDecimalPlaces=function(e){var r=0;if(isNaN(e))return r;typeof e!="number"&&(e=Number(e));var n=e.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r};$r.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var Cq=$r.resolveUrl=function(e,r){let n=new URL(r,new URL(e,"resolve://"));if(n.protocol==="resolve:"){let{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()}});var Mq=v((xHe,jq)=>{"use strict";var zr=Oo(),je=zr.ValidatorResult,Po=zr.SchemaError,oA={};oA.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var Me=oA.validators={};Me.type=function(e,r,n,i){if(e===void 0)return null;var o=new je(e,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,e,r,n,i))){var a=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o};function sA(t,e,r,n,i){var o=e.throwError,s=e.throwAll;e.throwError=!1,e.throwAll=!1;var a=this.validateSchema(t,i,e,r);return e.throwError=o,e.throwAll=s,!a.valid&&n instanceof Function&&n(a),a.valid}Me.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new je(e,r,n,i),s=new je(e,r,n,i);if(!Array.isArray(r.anyOf))throw new Po("anyOf must be an array");if(!r.anyOf.some(sA.bind(this,e,n,i,function(c){s.importErrors(c)}))){var a=r.anyOf.map(function(c,l){var u=c.$id||c.id;return u?"<"+u+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:a,message:"is not any of "+a.join(",")})}return o};Me.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new Po("allOf must be an array");var o=new je(e,r,n,i),s=this;return r.allOf.forEach(function(a,c){var l=s.validateSchema(e,a,n,i);if(!l.valid){var u=a.$id||a.id,d=u||a.title&&JSON.stringify(a.title)||a.$ref&&"<"+a.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:d,length:l.errors.length,valid:l},message:"does not match allOf schema "+d+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o};Me.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new Po("oneOf must be an array");var o=new je(e,r,n,i),s=new je(e,r,n,i),a=r.oneOf.filter(sA.bind(this,e,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,u){var d=l.$id||l.id;return d||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+u+"]"});return a!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o};Me.if=function(e,r,n,i){if(e===void 0)return null;if(!zr.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=sA.call(this,e,n,i,null,r.if),s=new je(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!zr.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,r.then,n,i.makeChild(r.then)),s.importErrors(a)}else{if(r.else===void 0)return;if(!zr.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,r.else,n,i.makeChild(r.else)),s.importErrors(a)}return s};function aA(t,e){if(Object.hasOwnProperty.call(t,e))return t[e];if(e in t){for(;t=Object.getPrototypeOf(t);)if(Object.propertyIsEnumerable.call(t,e))return t[e]}}Me.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!zr.isSchema(s))throw new Po('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(aA(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};Me.properties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.properties||{};for(var a in s){var c=s[a];if(c!==void 0){if(c===null)throw new Po('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=aA(e,a),u=this.validateSchema(l,c,n,i.makeChild(c,a));u.instance!==o.instance[a]&&(o.instance[a]=u.instance),o.importErrors(u)}}return o}};function Dq(t,e,r,n,i,o){if(this.types.object(t)&&!(e.properties&&e.properties[i]!==void 0))if(e.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=e.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(t,i,s,r,n);var a=this.validateSchema(t[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}Me.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.patternProperties||{};for(var a in e){var c=!0;for(var l in s){var u=s[l];if(u!==void 0){if(u===null)throw new Po('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(l,"u")}catch{d=new RegExp(l)}if(d.test(a)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,u,n,i);var f=this.validateSchema(e[a],u,n,i.makeChild(u,a));f.instance!==o.instance[a]&&(o.instance[a]=f.instance),o.importErrors(f)}}}c&&Dq.call(this,e,r,n,i,a,o)}return o}};Me.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new je(e,r,n,i);for(var s in e)Dq.call(this,e,r,n,i,s,o);return o}};Me.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=Object.keys(e);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}};Me.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=Object.keys(e);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}};Me.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new je(e,r,n,i);return e.every(function(a,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(a,l,n,i.makeChild(l,c));return u.instance!==s.instance[c]&&(s.instance[c]=u.instance),s.importErrors(u),!0}),s}};Me.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!zr.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new je(e,r,n,i),a=e.some(function(c,l){var u=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return u.errors.length===0});return a===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}};Me.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new je(e,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?e>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):e>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}};Me.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new je(e,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?er.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}};Me.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new je(e,r,n,i),s=e=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}};Me.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new je(e,r,n,i),s=e.match(/[\uDC00-\uDFFF]/g),a=e.length-(s?s.length:0);return a<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}};Me.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new je(e,r,n,i);return e.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}};Me.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new je(e,r,n,i);return e.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function Rde(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var cA=Oo();lA.exports.SchemaScanResult=zq;function zq(t,e){this.id=t,this.ref=e}lA.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=cA.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=cA.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!cA.deepCompareStrict(s[f],l))throw new Error("Schema <"+f+"> already exists with different definition");return s[f]}s[f]=l,f[f.length-1]=="#"&&(s[f.substring(0,f.length-1)]=l)}i(f+"/items",Array.isArray(l.items)?l.items:[l.items]),i(f+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(f+"/additionalItems",l.additionalItems),o(f+"/properties",l.properties),n(f+"/additionalProperties",l.additionalProperties),o(f+"/definitions",l.definitions),o(f+"/patternProperties",l.patternProperties),o(f+"/dependencies",l.dependencies),i(f+"/disallow",l.disallow),i(f+"/allOf",l.allOf),i(f+"/anyOf",l.anyOf),i(f+"/oneOf",l.oneOf),n(f+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var u=0;u{"use strict";var Fq=Mq(),Io=Oo(),Lq=Vg().scan,Uq=Io.ValidatorResult,Cde=Io.ValidatorResultError,Sd=Io.SchemaError,qq=Io.SchemaContext,Dde="/",Zt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(oi),this.attributes=Object.create(Fq.validators)};Zt.prototype.customFormats={};Zt.prototype.schemas=null;Zt.prototype.types=null;Zt.prototype.attributes=null;Zt.prototype.unresolvedRefs=null;Zt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=Lq(r||Dde,e),o=r||e.$id||e.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(a){return typeof n.schemas[a]>"u"}),this.schemas[o]};Zt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=Io.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new Sd("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Zt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new Sd('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,e);if(o&&typeof o=="object"){var s=this.validateSchema(e,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var oi=Zt.prototype.types={};oi.string=function(e){return typeof e=="string"};oi.number=function(e){return typeof e=="number"&&isFinite(e)};oi.integer=function(e){return typeof e=="number"&&e%1===0};oi.boolean=function(e){return typeof e=="boolean"};oi.array=function(e){return Array.isArray(e)};oi.null=function(e){return e===null};oi.date=function(e){return e instanceof Date};oi.any=function(e){return!0};oi.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};Zq.exports=Zt});var Gq=v((EHe,Li)=>{"use strict";var Nde=Li.exports.Validator=Hq();Li.exports.ValidatorResult=Oo().ValidatorResult;Li.exports.ValidatorResultError=Oo().ValidatorResultError;Li.exports.ValidationError=Oo().ValidationError;Li.exports.SchemaError=Oo().SchemaError;Li.exports.SchemaScanResult=Vg().SchemaScanResult;Li.exports.scan=Vg().scan;Li.exports.validate=function(t,e,r){var n=new Nde;return n.validate(t,e,r)}});import{readFileSync as jde}from"node:fs";import{dirname as Mde,join as zde}from"node:path";import{fileURLToPath as Fde}from"node:url";function Zde(t){let e=Bde.validate(t,qde);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function Wq(t){let e=Zde(t);if(!e.valid)throw new Error(`spec.yaml invalid: +`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Cg(e),n=sc(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Cg(e),n=sc(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};vq.Parser=KE});var $q=v(bd=>{"use strict";var bq=jE(),Jue=dd(),vd=md(),Yue=Dk(),Xue=Ie(),Que=WE(),Sq=JE();function wq(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Que.LineCounter||null,prettyErrors:e}}function ede(t,e={}){let{lineCounter:r,prettyErrors:n}=wq(e),i=new Sq.Parser(r?.addNewLine),o=new bq.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(vd.prettifyError(t,r)),a.warnings.forEach(vd.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function xq(t,e={}){let{lineCounter:r,prettyErrors:n}=wq(e),i=new Sq.Parser(r?.addNewLine),o=new bq.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new vd.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(vd.prettifyError(t,r)),s.warnings.forEach(vd.prettifyError(t,r))),s}function tde(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=xq(t,r);if(!i)return null;if(i.warnings.forEach(o=>Yue.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function rde(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return Xue.isDocument(t)&&!n?t.toString(r):new Jue.Document(t,n,r).toString(r)}bd.parse=tde;bd.parseAllDocuments=ede;bd.parseDocument=xq;bd.stringify=rde});var tr=v(Ue=>{"use strict";var nde=jE(),ide=dd(),ode=gE(),YE=md(),sde=Ku(),Oo=Ie(),ade=$o(),cde=At(),lde=Eo(),ude=Ao(),dde=Ig(),fde=GE(),pde=WE(),mde=JE(),Ng=$q(),kq=Hu();Ue.Composer=nde.Composer;Ue.Document=ide.Document;Ue.Schema=ode.Schema;Ue.YAMLError=YE.YAMLError;Ue.YAMLParseError=YE.YAMLParseError;Ue.YAMLWarning=YE.YAMLWarning;Ue.Alias=sde.Alias;Ue.isAlias=Oo.isAlias;Ue.isCollection=Oo.isCollection;Ue.isDocument=Oo.isDocument;Ue.isMap=Oo.isMap;Ue.isNode=Oo.isNode;Ue.isPair=Oo.isPair;Ue.isScalar=Oo.isScalar;Ue.isSeq=Oo.isSeq;Ue.Pair=ade.Pair;Ue.Scalar=cde.Scalar;Ue.YAMLMap=lde.YAMLMap;Ue.YAMLSeq=ude.YAMLSeq;Ue.CST=dde;Ue.Lexer=fde.Lexer;Ue.LineCounter=pde.LineCounter;Ue.Parser=mde.Parser;Ue.parse=Ng.parse;Ue.parseAllDocuments=Ng.parseAllDocuments;Ue.parseDocument=Ng.parseDocument;Ue.stringify=Ng.stringify;Ue.visit=kq.visit;Ue.visitAsync=kq.visitAsync});import{execFileSync as hde}from"node:child_process";import{existsSync as gde,readFileSync as yde}from"node:fs";import{join as Tq}from"node:path";function cc(t,e){return hde("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function Fg(t){try{let e=cc(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function Lg(t,e){_de(t,e);let r=cc(t,["rev-parse","HEAD"]).trim(),n=vde(t,e);return{groups:bde(t,n),head:r,inventory:{after:Aq(Mg(t,"spec.yaml")),before:Aq(XE(t,e,"spec.yaml"))},since:e,unsharded_commits:$de(t,e)}}function QE(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function _de(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");try{cc(t,["rev-parse","--verify","--quiet",`${r}^{commit}`])}catch{throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}}function vde(t,e){let r=cc(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` +`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!Eq(c)&&!Eq(a)))if(s.startsWith("A")){let l=jg(Mg(t,c));if(!l)continue;l.status==="done"?n.push(ac(l,"added-as-done")):l.status==="archived"&&n.push(ac(l,"archived"))}else if(s.startsWith("D")){let l=jg(XE(t,e,a));l&&n.push(ac(l,"archived"))}else{let l=jg(Mg(t,c));if(!l)continue;let d=jg(XE(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(ac(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(ac(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(ac(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function Eq(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function ac(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>QE(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function jg(t){if(t===null)return null;let e;try{e=(0,zg.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function Mg(t,e){let r=Tq(t,e);if(!gde(r))return null;try{return yde(r,"utf8")}catch{return null}}function XE(t,e,r){try{return cc(t,["show",`${e}:${r}`])}catch{return null}}function bde(t,e){let r=Sde(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function Sde(t){let e=Mg(t,Tq("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,zg.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function Aq(t){let e={};if(t!==null)try{let n=(0,zg.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function $de(t,e){let r=cc(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` +`)){if(i.trim().length===0)continue;let o=i.indexOf(" ");if(o<0)continue;let s=i.slice(0,o),a=i.slice(o+1);wde.test(a)&&(xde.test(a)||n.push({hash:s,subject:a}))}return n}var zg,wde,xde,Ug=y(()=>{"use strict";zg=St(tr(),1);wde=/^(feat|fix)(\([^)]*\))?!?:/,xde=/\bF-(\d{3,}|[a-f0-9]{6,})\b/});import{existsSync as kde}from"node:fs";import{join as Ede}from"node:path";function qg(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Ade[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` +`)}function Bg(t,e,r){let n=[`# Audit \u2014 shipped changes since ${t.since}`,"","| feature | AC | EARS | verification refs |","|---|---|---|---|"],i=new Map(e.features.map(o=>[o.id,o]));for(let o of t.groups)for(let s of o.features){let a=i.get(s.id);if(!a){n.push(`| ${s.id} | \u2014 | \u2014 | (removed from spec \u2014 see git history at ${t.since}) |`);continue}let c=a.acceptance_criteria??[];if(c.length===0){n.push(`| ${a.id} | \u2014 | \u2014 | (no acceptance criteria) |`);continue}for(let l of c)n.push(`| ${a.id} | ${l.id} | ${l.ears??"\u2014"} | ${Ode(l,r)} |`)}return n.join(` +`)}function Ode(t,e){let r=[...t.test_refs??[],...t.oracle_refs??[],...t.evidence_refs??[]];return r.length===0?"(none)":r.map(n=>{for(let[o,s]of Tde)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${kde(Ede(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function Zg(t){let e=[`# ${t.project.name} \u2014 capability catalog`,""],r=[...t.capabilities??[]].filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=new Map(t.features.map(s=>[s.id,s])),i=new Set;for(let s of r){e.push(`## ${s.title??s.id}`,""),s.summary&&e.push(s.summary,"");for(let a of s.features??[]){let c=n.get(a);!c||c.status==="archived"||(i.add(a),Oq(e,c))}}let o=t.features.filter(s=>!i.has(s.id)&&s.status!=="archived").sort((s,a)=>s.id.localeCompare(a.id));if(o.length>0){e.push("## Uncategorized","");for(let s of o)Oq(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` +`)}function Oq(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=QE(r);n&&t.push(`- ${n}`)}t.push("")}var Ade,Tde,eA=y(()=>{"use strict";Ug();Ade={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};Tde=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as Pde}from"node:fs";function ii(t="./spec.yaml"){let e=Pde(t,"utf8");return(0,Pq.parse)(e)}var Pq,Hg=y(()=>{"use strict";Pq=St(tr(),1)});var Po=v(($r,iA)=>{"use strict";var tA=$r.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+Rq(l)},"instance")):i!==void 0&&(this.property=i),e&&(this.message=e),n){var a=n.$id||n.id;this.schema=a||n}r!==void 0&&(this.instance=r),this.name=o,this.argument=s,this.stack=this.toString()};tA.prototype.toString=function(){return this.property+" "+this.message};var Gg=$r.ValidatorResult=function(e,r,n,i){this.instance=e,this.schema=r,this.options=n,this.path=i.path,this.propertyPath=i.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};Gg.prototype.addError=function(e){var r;if(typeof e=="string")r=new tA(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");r=new tA(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new Fs(this);if(this.throwError)throw r;return r};Gg.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Ide(t,e){return e+": "+t.toString()+` +`}Gg.prototype.toString=function(e){return this.errors.map(Ide).join("")};Object.defineProperty(Gg.prototype,"valid",{get:function(){return!this.errors.length}});iA.exports.ValidatorResultError=Fs;function Fs(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Fs),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}Fs.prototype=new Error;Fs.prototype.constructor=Fs;Fs.prototype.name="Validation Error";var Iq=$r.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};Iq.prototype=Object.create(Error.prototype,{constructor:{value:Iq,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var rA=$r.SchemaContext=function(e,r,n,i,o){this.schema=e,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,a){return s+Rq(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};rA.prototype.resolve=function(e){return Cq(this.base,e)};rA.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=Cq(this.base,i||"");var s=new rA(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var Rn=$r.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(t){return typeof t=="string"&&parseFloat(t)===parseInt(t,10)&&!isNaN(t)},regex:function(t){var e=!0;try{new RegExp(t)}catch{e=!1}return e},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};Rn.regexp=Rn.regex;Rn.pattern=Rn.regex;Rn.ipv4=Rn["ip-address"];$r.isFormat=function(e,r,n){if(typeof e=="string"&&Rn[r]!==void 0){if(Rn[r]instanceof RegExp)return Rn[r].test(e);if(typeof Rn[r]=="function")return Rn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var Rq=$r.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};$r.deepCompareStrict=function t(e,r){if(typeof e!=typeof r)return!1;if(Array.isArray(e))return!Array.isArray(r)||e.length!==r.length?!1:e.every(function(o,s){return t(e[s],r[s])});if(typeof e=="object"){if(!e||!r)return e===r;var n=Object.keys(e),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return t(e[o],r[o])})}return e===r};function Rde(t,e,r,n){typeof r=="object"?e[n]=nA(t[n],r):t.indexOf(r)===-1&&e.push(r)}function Cde(t,e,r){e[r]=t[r]}function Dde(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=nA(t[n],e[n]):r[n]=e[n]}function nA(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Rde.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(Cde.bind(null,t,n)),Object.keys(e).forEach(Dde.bind(null,t,e,n))),n}iA.exports.deepMerge=nA;$r.objectGetPath=function(e,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e};function Nde(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}$r.encodePath=function(e){return e.map(Nde).join("")};$r.getDecimalPlaces=function(e){var r=0;if(isNaN(e))return r;typeof e!="number"&&(e=Number(e));var n=e.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r};$r.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var Cq=$r.resolveUrl=function(e,r){let n=new URL(r,new URL(e,"resolve://"));if(n.protocol==="resolve:"){let{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()}});var Mq=v((CHe,jq)=>{"use strict";var zr=Po(),je=zr.ValidatorResult,Io=zr.SchemaError,oA={};oA.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var Me=oA.validators={};Me.type=function(e,r,n,i){if(e===void 0)return null;var o=new je(e,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,e,r,n,i))){var a=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o};function sA(t,e,r,n,i){var o=e.throwError,s=e.throwAll;e.throwError=!1,e.throwAll=!1;var a=this.validateSchema(t,i,e,r);return e.throwError=o,e.throwAll=s,!a.valid&&n instanceof Function&&n(a),a.valid}Me.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new je(e,r,n,i),s=new je(e,r,n,i);if(!Array.isArray(r.anyOf))throw new Io("anyOf must be an array");if(!r.anyOf.some(sA.bind(this,e,n,i,function(c){s.importErrors(c)}))){var a=r.anyOf.map(function(c,l){var u=c.$id||c.id;return u?"<"+u+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:a,message:"is not any of "+a.join(",")})}return o};Me.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new Io("allOf must be an array");var o=new je(e,r,n,i),s=this;return r.allOf.forEach(function(a,c){var l=s.validateSchema(e,a,n,i);if(!l.valid){var u=a.$id||a.id,d=u||a.title&&JSON.stringify(a.title)||a.$ref&&"<"+a.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:d,length:l.errors.length,valid:l},message:"does not match allOf schema "+d+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o};Me.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new Io("oneOf must be an array");var o=new je(e,r,n,i),s=new je(e,r,n,i),a=r.oneOf.filter(sA.bind(this,e,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,u){var d=l.$id||l.id;return d||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+u+"]"});return a!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o};Me.if=function(e,r,n,i){if(e===void 0)return null;if(!zr.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=sA.call(this,e,n,i,null,r.if),s=new je(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!zr.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,r.then,n,i.makeChild(r.then)),s.importErrors(a)}else{if(r.else===void 0)return;if(!zr.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,r.else,n,i.makeChild(r.else)),s.importErrors(a)}return s};function aA(t,e){if(Object.hasOwnProperty.call(t,e))return t[e];if(e in t){for(;t=Object.getPrototypeOf(t);)if(Object.propertyIsEnumerable.call(t,e))return t[e]}}Me.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!zr.isSchema(s))throw new Io('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(aA(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};Me.properties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.properties||{};for(var a in s){var c=s[a];if(c!==void 0){if(c===null)throw new Io('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=aA(e,a),u=this.validateSchema(l,c,n,i.makeChild(c,a));u.instance!==o.instance[a]&&(o.instance[a]=u.instance),o.importErrors(u)}}return o}};function Dq(t,e,r,n,i,o){if(this.types.object(t)&&!(e.properties&&e.properties[i]!==void 0))if(e.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=e.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(t,i,s,r,n);var a=this.validateSchema(t[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}Me.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.patternProperties||{};for(var a in e){var c=!0;for(var l in s){var u=s[l];if(u!==void 0){if(u===null)throw new Io('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(l,"u")}catch{d=new RegExp(l)}if(d.test(a)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,u,n,i);var f=this.validateSchema(e[a],u,n,i.makeChild(u,a));f.instance!==o.instance[a]&&(o.instance[a]=f.instance),o.importErrors(f)}}}c&&Dq.call(this,e,r,n,i,a,o)}return o}};Me.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new je(e,r,n,i);for(var s in e)Dq.call(this,e,r,n,i,s,o);return o}};Me.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=Object.keys(e);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}};Me.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=Object.keys(e);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}};Me.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new je(e,r,n,i);return e.every(function(a,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(a,l,n,i.makeChild(l,c));return u.instance!==s.instance[c]&&(s.instance[c]=u.instance),s.importErrors(u),!0}),s}};Me.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!zr.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new je(e,r,n,i),a=e.some(function(c,l){var u=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return u.errors.length===0});return a===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}};Me.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new je(e,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?e>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):e>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}};Me.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new je(e,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?er.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}};Me.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new je(e,r,n,i),s=e=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}};Me.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new je(e,r,n,i),s=e.match(/[\uDC00-\uDFFF]/g),a=e.length-(s?s.length:0);return a<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}};Me.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new je(e,r,n,i);return e.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}};Me.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new je(e,r,n,i);return e.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function jde(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var cA=Po();lA.exports.SchemaScanResult=zq;function zq(t,e){this.id=t,this.ref=e}lA.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=cA.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=cA.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!cA.deepCompareStrict(s[f],l))throw new Error("Schema <"+f+"> already exists with different definition");return s[f]}s[f]=l,f[f.length-1]=="#"&&(s[f.substring(0,f.length-1)]=l)}i(f+"/items",Array.isArray(l.items)?l.items:[l.items]),i(f+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(f+"/additionalItems",l.additionalItems),o(f+"/properties",l.properties),n(f+"/additionalProperties",l.additionalProperties),o(f+"/definitions",l.definitions),o(f+"/patternProperties",l.patternProperties),o(f+"/dependencies",l.dependencies),i(f+"/disallow",l.disallow),i(f+"/allOf",l.allOf),i(f+"/anyOf",l.anyOf),i(f+"/oneOf",l.oneOf),n(f+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var u=0;u{"use strict";var Fq=Mq(),Ro=Po(),Lq=Vg().scan,Uq=Ro.ValidatorResult,Mde=Ro.ValidatorResultError,Sd=Ro.SchemaError,qq=Ro.SchemaContext,zde="/",Zt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(oi),this.attributes=Object.create(Fq.validators)};Zt.prototype.customFormats={};Zt.prototype.schemas=null;Zt.prototype.types=null;Zt.prototype.attributes=null;Zt.prototype.unresolvedRefs=null;Zt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=Lq(r||zde,e),o=r||e.$id||e.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(a){return typeof n.schemas[a]>"u"}),this.schemas[o]};Zt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=Ro.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new Sd("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Zt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new Sd('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,e);if(o&&typeof o=="object"){var s=this.validateSchema(e,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var oi=Zt.prototype.types={};oi.string=function(e){return typeof e=="string"};oi.number=function(e){return typeof e=="number"&&isFinite(e)};oi.integer=function(e){return typeof e=="number"&&e%1===0};oi.boolean=function(e){return typeof e=="boolean"};oi.array=function(e){return Array.isArray(e)};oi.null=function(e){return e===null};oi.date=function(e){return e instanceof Date};oi.any=function(e){return!0};oi.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};Zq.exports=Zt});var Gq=v((jHe,Li)=>{"use strict";var Fde=Li.exports.Validator=Hq();Li.exports.ValidatorResult=Po().ValidatorResult;Li.exports.ValidatorResultError=Po().ValidatorResultError;Li.exports.ValidationError=Po().ValidationError;Li.exports.SchemaError=Po().SchemaError;Li.exports.SchemaScanResult=Vg().SchemaScanResult;Li.exports.scan=Vg().scan;Li.exports.validate=function(t,e,r){var n=new Fde;return n.validate(t,e,r)}});import{readFileSync as Lde}from"node:fs";import{dirname as Ude,join as qde}from"node:path";import{fileURLToPath as Bde}from"node:url";function Wde(t){let e=Vde.validate(t,Gde);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function Wq(t){let e=Wde(t);if(!e.valid)throw new Error(`spec.yaml invalid: ${e.errors.join(` - `)}`)}var Vq,Lde,Ude,qde,Bde,Kq=y(()=>{"use strict";Vq=St(Gq(),1),Lde=Mde(Fde(import.meta.url)),Ude=zde(Lde,"schema.json"),qde=JSON.parse(jde(Ude,"utf8")),Bde=new Vq.Validator});import{existsSync as uA,readdirSync as Hde}from"node:fs";import{dirname as Gde,join as Fs,resolve as Yq}from"node:path";function Jq(t){return uA(t)?Hde(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>ii(Fs(t,r))):[]}function Kg(t,e){Wg=e?{cwd:Yq(t),spec:e}:null}function se(t=".",e="spec.yaml"){return Wg&&e==="spec.yaml"&&Yq(t)===Wg.cwd?Wg.spec:Vde(t,e)}function Vde(t,e){let r=Fs(t,e),n=ii(r),i=Fs(t,Gde(e),"spec");if(!n.features||n.features.length===0){let o=Jq(Fs(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=Jq(Fs(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=Fs(i,"architecture.yaml");uA(o)&&(n.architecture=ii(o))}if(!n.capabilities||n.capabilities.length===0){let o=Fs(i,"capabilities.yaml");if(uA(o)){let s=ii(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return Wq(n),n}var Wg,Tt=y(()=>{"use strict";Hg();Kq();Wg=null});import lc from"node:process";function pA(){return!!lc.stdout.isTTY}function X(t,e,r=""){let n=Xq[t],i=r?` ${r}`:"";pA()?lc.stdout.write(`${dA[t]}${n}${fA} ${e}${i} + `)}`)}var Vq,Zde,Hde,Gde,Vde,Kq=y(()=>{"use strict";Vq=St(Gq(),1),Zde=Ude(Bde(import.meta.url)),Hde=qde(Zde,"schema.json"),Gde=JSON.parse(Lde(Hde,"utf8")),Vde=new Vq.Validator});import{existsSync as uA,readdirSync as Kde}from"node:fs";import{dirname as Jde,join as Ls,resolve as Yq}from"node:path";function Jq(t){return uA(t)?Kde(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>ii(Ls(t,r))):[]}function Kg(t,e){Wg=e?{cwd:Yq(t),spec:e}:null}function se(t=".",e="spec.yaml"){return Wg&&e==="spec.yaml"&&Yq(t)===Wg.cwd?Wg.spec:Yde(t,e)}function Yde(t,e){let r=Ls(t,e),n=ii(r),i=Ls(t,Jde(e),"spec");if(!n.features||n.features.length===0){let o=Jq(Ls(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=Jq(Ls(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=Ls(i,"architecture.yaml");uA(o)&&(n.architecture=ii(o))}if(!n.capabilities||n.capabilities.length===0){let o=Ls(i,"capabilities.yaml");if(uA(o)){let s=ii(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return Wq(n),n}var Wg,Tt=y(()=>{"use strict";Hg();Kq();Wg=null});import lc from"node:process";function pA(){return!!lc.stdout.isTTY}function Y(t,e,r=""){let n=Xq[t],i=r?` ${r}`:"";pA()?lc.stdout.write(`${dA[t]}${n}${fA} ${e}${i} `):lc.stdout.write(`${n} ${e}${i} -`)}function wd(t,e,r=""){if(!pA())return;let n=r?` ${r}`:"";lc.stdout.write(`${Qq}${dA.start}\xB7${fA} ${t} \xB7 ${e}${n}`)}function Ls(t,e,r=""){let n=Xq[t],i=r?` ${r}`:"";pA()?lc.stdout.write(`${Qq}${dA[t]}${n}${fA} ${e}${i} +`)}function wd(t,e,r=""){if(!pA())return;let n=r?` ${r}`:"";lc.stdout.write(`${Qq}${dA.start}\xB7${fA} ${t} \xB7 ${e}${n}`)}function Us(t,e,r=""){let n=Xq[t],i=r?` ${r}`:"";pA()?lc.stdout.write(`${Qq}${dA[t]}${n}${fA} ${e}${i} `):lc.stdout.write(`${n} ${e}${i} -`)}var Xq,dA,fA,Qq,uc=y(()=>{"use strict";Xq={start:"\xB7",pass:"\u2713",fail:"\u2717",skip:"\xB7",note:"\u2139"},dA={start:"\x1B[90m",pass:"\x1B[32m",fail:"\x1B[31m",skip:"\x1B[90m",note:"\x1B[36m"},fA="\x1B[0m",Qq="\r\x1B[K"});import{execFileSync as t4}from"node:child_process";import{appendFileSync as Wde,existsSync as mA,mkdirSync as Kde,readFileSync as Jde,renameSync as Yde,statSync as Xde}from"node:fs";import{userInfo as Qde}from"node:os";import{dirname as efe,join as r4}from"node:path";function n4(t){return r4(t,tfe,rfe)}function Fr(t,e){let r=n4(t),n=efe(r);mA(n)||Kde(n,{recursive:!0});try{mA(r)&&Xde(r).size>ife&&Yde(r,r4(n,nfe))}catch{}Wde(r,`${JSON.stringify(e)} -`,"utf8")}function xd(t){let e=n4(t);if(!mA(e))return[];let r=Jde(e,"utf8").trim();return r.length===0?[]:r.split(` -`).filter(n=>n.length>0).map(n=>JSON.parse(n))}function Lr(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function ofe(t){let e;try{e=t4("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=Qde().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function sfe(t){try{return t4("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function hA(t,e){try{let r=xd(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function qi(t,e,r){try{let n=sfe(t),i=ofe(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=hA(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Fr(t,Lr(e,o))}catch{}}var tfe,rfe,nfe,ife,si=y(()=>{"use strict";tfe=".cladding",rfe="events.log.jsonl",nfe="events.log.1.jsonl",ife=5*1024*1024});import{createHash as afe}from"node:crypto";import{existsSync as cfe,readFileSync as i4,writeFileSync as lfe}from"node:fs";import{join as gA}from"node:path";function $d(t,e){let r=afe("sha256");for(let n of[...e].sort()){r.update(n),r.update("\0");try{r.update(i4(gA(t,n)))}catch{r.update("")}r.update("\0")}return r.digest("hex").slice(0,16)}function dc(t){let e=gA(t,...o4);if(!cfe(e))return null;let r=new Map;try{for(let n of i4(e,"utf8").split(` +`)}var Xq,dA,fA,Qq,uc=y(()=>{"use strict";Xq={start:"\xB7",pass:"\u2713",fail:"\u2717",skip:"\xB7",note:"\u2139"},dA={start:"\x1B[90m",pass:"\x1B[32m",fail:"\x1B[31m",skip:"\x1B[90m",note:"\x1B[36m"},fA="\x1B[0m",Qq="\r\x1B[K"});import{execFileSync as t4}from"node:child_process";import{appendFileSync as Xde,existsSync as mA,mkdirSync as Qde,readFileSync as efe,renameSync as tfe,statSync as rfe}from"node:fs";import{userInfo as nfe}from"node:os";import{dirname as ife,join as r4}from"node:path";function n4(t){return r4(t,ofe,sfe)}function Fr(t,e){let r=n4(t),n=ife(r);mA(n)||Qde(n,{recursive:!0});try{mA(r)&&rfe(r).size>cfe&&tfe(r,r4(n,afe))}catch{}Xde(r,`${JSON.stringify(e)} +`,"utf8")}function xd(t){let e=n4(t);if(!mA(e))return[];let r=efe(e,"utf8").trim();return r.length===0?[]:r.split(` +`).filter(n=>n.length>0).map(n=>JSON.parse(n))}function Lr(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function lfe(t){let e;try{e=t4("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=nfe().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function ufe(t){try{return t4("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function hA(t,e){try{let r=xd(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function qi(t,e,r){try{let n=ufe(t),i=lfe(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=hA(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Fr(t,Lr(e,o))}catch{}}var ofe,sfe,afe,cfe,si=y(()=>{"use strict";ofe=".cladding",sfe="events.log.jsonl",afe="events.log.1.jsonl",cfe=5*1024*1024});import{createHash as dfe}from"node:crypto";import{existsSync as ffe,readFileSync as i4,writeFileSync as pfe}from"node:fs";import{join as gA}from"node:path";function $d(t,e){let r=dfe("sha256");for(let n of[...e].sort()){r.update(n),r.update("\0");try{r.update(i4(gA(t,n)))}catch{r.update("")}r.update("\0")}return r.digest("hex").slice(0,16)}function dc(t){let e=gA(t,...o4);if(!ffe(e))return null;let r=new Map;try{for(let n of i4(e,"utf8").split(` `)){let i=n.match(/^ {2}(F-[\w-]+): ([0-9a-f]{16})$/);i&&r.set(i[1],i[2])}}catch{return null}return r}function s4(t,e){let r=(e.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return!1;let i=`# Cladding \xB7 Tier C \u2014 verification attestation (GREEN strict pre-push gate). Do not edit by hand. # One line per done feature: sha256 tree-hash of its modules at the last # attested verification. STALE_ATTESTATION compares; \`clad check @@ -190,53 +190,53 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus attested: `+r.map(o=>` ${o.id}: ${$d(t,o.modules??[])}`).sort().join(` `)+` -`;return lfe(gA(t,...o4),i,"utf8"),!0}var o4,kd=y(()=>{"use strict";o4=["spec","attestation.yaml"]});function wt(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var Bi=y(()=>{});import{fileURLToPath as vfe}from"node:url";var fc,bfe,vA,bA,pc=y(()=>{fc=(t,e)=>{let r=bA(bfe(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},bfe=t=>vA(t)?t.toString():t,vA=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,bA=t=>t instanceof URL?vfe(t):t});var Yg,SA=y(()=>{Bi();pc();Yg=(t,e=[],r={})=>{let n=fc(t,"First argument"),[i,o]=wt(e)?[[],e]:[e,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(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!wt(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as Sfe}from"node:string_decoder";var p4,m4,Nt,Zi,wfe,h4,xfe,Xg,g4,$fe,Ed,kfe,wA,Efe,Ur=y(()=>{({toString:p4}=Object.prototype),m4=t=>p4.call(t)==="[object ArrayBuffer]",Nt=t=>p4.call(t)==="[object Uint8Array]",Zi=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),wfe=new TextEncoder,h4=t=>wfe.encode(t),xfe=new TextDecoder,Xg=t=>xfe.decode(t),g4=(t,e)=>$fe(t,e).join(""),$fe=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new Sfe(e),n=t.map(o=>typeof o=="string"?h4(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},Ed=t=>t.length===1&&Nt(t[0])?t[0]:wA(kfe(t)),kfe=t=>t.map(e=>typeof e=="string"?h4(e):e),wA=t=>{let e=new Uint8Array(Efe(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},Efe=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as Afe}from"node:child_process";var b4,S4,Tfe,Ofe,y4,Pfe,_4,v4,Ife,w4=y(()=>{Bi();Ur();b4=t=>Array.isArray(t)&&Array.isArray(t.raw),S4=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=Tfe({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},Tfe=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=Ofe(i,t.raw[n]),c=_4(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>v4(d)):[v4(l)];return _4(c,u,a)},Ofe=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=y4.has(e[0]);for(let s=0,a=0;sr||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],v4=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(wt(t)&&("stdout"in t||"isMaxBuffer"in t))return Ife(t);throw t instanceof Afe||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},Ife=({stdout:t})=>{if(typeof t=="string")return t;if(Nt(t))return Xg(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)}});import xA from"node:process";var Cn,Qg,un,ey,Hi=y(()=>{Cn=t=>Qg.includes(t),Qg=[xA.stdin,xA.stdout,xA.stderr],un=["stdin","stdout","stderr"],ey=t=>un[t]??`stdio[${t}]`});import{debuglog as Rfe}from"node:util";var $4,$A,Cfe,Dfe,Nfe,jfe,x4,Mfe,kA,zfe,Ffe,Lfe,Ufe,EA,Gi,Vi=y(()=>{Bi();Hi();$4=t=>{let e={...t};for(let r of EA)e[r]=$A(t,r);return e},$A=(t,e)=>{let r=Array.from({length:Cfe(t)+1}),n=Dfe(t[e],r,e);return Ffe(n,e)},Cfe=({stdio:t})=>Array.isArray(t)?Math.max(t.length,un.length):un.length,Dfe=(t,e,r)=>wt(t)?Nfe(t,e,r):e.fill(t),Nfe=(t,e,r)=>{for(let n of Object.keys(t).sort(jfe))for(let i of Mfe(n,r,e))e[i]=t[n];return e},jfe=(t,e)=>x4(t)t==="stdout"||t==="stderr"?0:t==="all"?2:1,Mfe=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=kA(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid. +`;return pfe(gA(t,...o4),i,"utf8"),!0}var o4,kd=y(()=>{"use strict";o4=["spec","attestation.yaml"]});function wt(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var Bi=y(()=>{});import{fileURLToPath as xfe}from"node:url";var fc,$fe,vA,bA,pc=y(()=>{fc=(t,e)=>{let r=bA($fe(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},$fe=t=>vA(t)?t.toString():t,vA=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,bA=t=>t instanceof URL?xfe(t):t});var Yg,SA=y(()=>{Bi();pc();Yg=(t,e=[],r={})=>{let n=fc(t,"First argument"),[i,o]=wt(e)?[[],e]:[e,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(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!wt(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as kfe}from"node:string_decoder";var p4,m4,Nt,Zi,Efe,h4,Afe,Xg,g4,Tfe,Ed,Ofe,wA,Pfe,Ur=y(()=>{({toString:p4}=Object.prototype),m4=t=>p4.call(t)==="[object ArrayBuffer]",Nt=t=>p4.call(t)==="[object Uint8Array]",Zi=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Efe=new TextEncoder,h4=t=>Efe.encode(t),Afe=new TextDecoder,Xg=t=>Afe.decode(t),g4=(t,e)=>Tfe(t,e).join(""),Tfe=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new kfe(e),n=t.map(o=>typeof o=="string"?h4(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},Ed=t=>t.length===1&&Nt(t[0])?t[0]:wA(Ofe(t)),Ofe=t=>t.map(e=>typeof e=="string"?h4(e):e),wA=t=>{let e=new Uint8Array(Pfe(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},Pfe=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as Ife}from"node:child_process";var b4,S4,Rfe,Cfe,y4,Dfe,_4,v4,Nfe,w4=y(()=>{Bi();Ur();b4=t=>Array.isArray(t)&&Array.isArray(t.raw),S4=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=Rfe({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},Rfe=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=Cfe(i,t.raw[n]),c=_4(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>v4(d)):[v4(l)];return _4(c,u,a)},Cfe=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=y4.has(e[0]);for(let s=0,a=0;sr||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],v4=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(wt(t)&&("stdout"in t||"isMaxBuffer"in t))return Nfe(t);throw t instanceof Ife||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},Nfe=({stdout:t})=>{if(typeof t=="string")return t;if(Nt(t))return Xg(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)}});import xA from"node:process";var Cn,Qg,un,ey,Hi=y(()=>{Cn=t=>Qg.includes(t),Qg=[xA.stdin,xA.stdout,xA.stderr],un=["stdin","stdout","stderr"],ey=t=>un[t]??`stdio[${t}]`});import{debuglog as jfe}from"node:util";var $4,$A,Mfe,zfe,Ffe,Lfe,x4,Ufe,kA,qfe,Bfe,Zfe,Hfe,EA,Gi,Vi=y(()=>{Bi();Hi();$4=t=>{let e={...t};for(let r of EA)e[r]=$A(t,r);return e},$A=(t,e)=>{let r=Array.from({length:Mfe(t)+1}),n=zfe(t[e],r,e);return Bfe(n,e)},Mfe=({stdio:t})=>Array.isArray(t)?Math.max(t.length,un.length):un.length,zfe=(t,e,r)=>wt(t)?Ffe(t,e,r):e.fill(t),Ffe=(t,e,r)=>{for(let n of Object.keys(t).sort(Lfe))for(let i of Ufe(n,r,e))e[i]=t[n];return e},Lfe=(t,e)=>x4(t)t==="stdout"||t==="stderr"?0:t==="all"?2:1,Ufe=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=kA(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid. It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},kA=t=>{if(t==="all")return t;if(un.includes(t))return un.indexOf(t);let e=zfe.exec(t);if(e!==null)return Number(e[1])},zfe=/^fd(\d+)$/,Ffe=(t,e)=>t.map(r=>r===void 0?Ufe[e]:r),Lfe=Rfe("execa").enabled?"full":"none",Ufe={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:Lfe,stripFinalNewline:!0},EA=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Gi=(t,e)=>e==="ipc"?t.at(-1):t[e]});var mc,hc,k4,AA,qfe,ty,ry,Ro=y(()=>{Vi();mc=({verbose:t},e)=>AA(t,e)!=="none",hc=({verbose:t},e)=>!["none","short"].includes(AA(t,e)),k4=({verbose:t},e)=>{let r=AA(t,e);return ty(r)?r:void 0},AA=(t,e)=>e===void 0?qfe(t):Gi(t,e),qfe=t=>t.find(e=>ty(e))??ry.findLast(e=>t.includes(e)),ty=t=>typeof t=="function",ry=["none","short","full"]});import{platform as Bfe}from"node:process";import{stripVTControlCharacters as Zfe}from"node:util";var E4,Ad,A4,Hfe,Gfe,Vfe,Wfe,Kfe,Jfe,Yfe,ny=y(()=>{E4=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>Jfe(A4(o))).join(" ");return{command:n,escapedCommand:i}},Ad=t=>Zfe(t).split(` +Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},kA=t=>{if(t==="all")return t;if(un.includes(t))return un.indexOf(t);let e=qfe.exec(t);if(e!==null)return Number(e[1])},qfe=/^fd(\d+)$/,Bfe=(t,e)=>t.map(r=>r===void 0?Hfe[e]:r),Zfe=jfe("execa").enabled?"full":"none",Hfe={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:Zfe,stripFinalNewline:!0},EA=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Gi=(t,e)=>e==="ipc"?t.at(-1):t[e]});var mc,hc,k4,AA,Gfe,ty,ry,Co=y(()=>{Vi();mc=({verbose:t},e)=>AA(t,e)!=="none",hc=({verbose:t},e)=>!["none","short"].includes(AA(t,e)),k4=({verbose:t},e)=>{let r=AA(t,e);return ty(r)?r:void 0},AA=(t,e)=>e===void 0?Gfe(t):Gi(t,e),Gfe=t=>t.find(e=>ty(e))??ry.findLast(e=>t.includes(e)),ty=t=>typeof t=="function",ry=["none","short","full"]});import{platform as Vfe}from"node:process";import{stripVTControlCharacters as Wfe}from"node:util";var E4,Ad,A4,Kfe,Jfe,Yfe,Xfe,Qfe,epe,tpe,ny=y(()=>{E4=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>epe(A4(o))).join(" ");return{command:n,escapedCommand:i}},Ad=t=>Wfe(t).split(` `).map(e=>A4(e)).join(` -`),A4=t=>t.replaceAll(Vfe,e=>Hfe(e)),Hfe=t=>{let e=Wfe[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=Kfe?`\\u${n.padStart(4,"0")}`:`\\U${n}`},Gfe=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Vfe=Gfe(),Wfe={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Kfe=65535,Jfe=t=>Yfe.test(t)?t:Bfe==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,Yfe=/^[\w./-]+$/});import T4 from"node:process";function TA(){let{env:t}=T4,{TERM:e,TERM_PROGRAM:r}=t;return T4.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var O4=y(()=>{});var P4,I4,Xfe,Qfe,epe,tpe,rpe,iy,FGe,R4=y(()=>{O4();P4={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"},I4={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"},Xfe={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"},Qfe={...P4,...I4},epe={...P4,...Xfe},tpe=TA(),rpe=tpe?Qfe:epe,iy=rpe,FGe=Object.entries(I4)});import npe from"node:tty";var ipe,he,qGe,C4,BGe,ZGe,HGe,GGe,VGe,WGe,KGe,JGe,YGe,XGe,QGe,e9e,t9e,r9e,n9e,oy,i9e,o9e,s9e,a9e,c9e,l9e,u9e,d9e,f9e,D4,p9e,N4,m9e,h9e,g9e,y9e,_9e,v9e,b9e,S9e,w9e,x9e,$9e,OA=y(()=>{ipe=npe?.WriteStream?.prototype?.hasColors?.()??!1,he=(t,e)=>{if(!ipe)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0,u=(e===22?n:"")+r;for(;s!==-1;)a+=o.slice(c,s)+u,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},qGe=he(0,0),C4=he(1,22),BGe=he(2,22),ZGe=he(3,23),HGe=he(4,24),GGe=he(53,55),VGe=he(7,27),WGe=he(8,28),KGe=he(9,29),JGe=he(30,39),YGe=he(31,39),XGe=he(32,39),QGe=he(33,39),e9e=he(34,39),t9e=he(35,39),r9e=he(36,39),n9e=he(37,39),oy=he(90,39),i9e=he(40,49),o9e=he(41,49),s9e=he(42,49),a9e=he(43,49),c9e=he(44,49),l9e=he(45,49),u9e=he(46,49),d9e=he(47,49),f9e=he(100,49),D4=he(91,39),p9e=he(92,39),N4=he(93,39),m9e=he(94,39),h9e=he(95,39),g9e=he(96,39),y9e=he(97,39),_9e=he(101,49),v9e=he(102,49),b9e=he(103,49),S9e=he(104,49),w9e=he(105,49),x9e=he(106,49),$9e=he(107,49)});var j4=y(()=>{OA();OA()});var F4,spe,sy,M4,ape,z4,cpe,L4=y(()=>{R4();j4();F4=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=spe(r),c=ape[t]({failed:o,reject:s,piped:n}),l=cpe[t]({reject:s});return`${oy(`[${a}]`)} ${oy(`[${i}]`)} ${l(c)} ${l(e)}`},spe=t=>`${sy(t.getHours(),2)}:${sy(t.getMinutes(),2)}:${sy(t.getSeconds(),2)}.${sy(t.getMilliseconds(),3)}`,sy=(t,e)=>String(t).padStart(e,"0"),M4=({failed:t,reject:e})=>t?e?iy.cross:iy.warning:iy.tick,ape={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:M4,duration:M4},z4=t=>t,cpe={command:()=>C4,output:()=>z4,ipc:()=>z4,error:({reject:t})=>t?D4:N4,duration:()=>oy}});var U4,lpe,upe,q4=y(()=>{Ro();U4=(t,e,r)=>{let n=k4(e,r);return t.map(({verboseLine:i,verboseObject:o})=>lpe(i,o,n)).filter(i=>i!==void 0).map(i=>upe(i)).join("")},lpe=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},upe=t=>t.endsWith(` +`),A4=t=>t.replaceAll(Yfe,e=>Kfe(e)),Kfe=t=>{let e=Xfe[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=Qfe?`\\u${n.padStart(4,"0")}`:`\\U${n}`},Jfe=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Yfe=Jfe(),Xfe={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Qfe=65535,epe=t=>tpe.test(t)?t:Vfe==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,tpe=/^[\w./-]+$/});import T4 from"node:process";function TA(){let{env:t}=T4,{TERM:e,TERM_PROGRAM:r}=t;return T4.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var O4=y(()=>{});var P4,I4,rpe,npe,ipe,ope,spe,iy,KGe,R4=y(()=>{O4();P4={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"},I4={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"},rpe={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"},npe={...P4,...I4},ipe={...P4,...rpe},ope=TA(),spe=ope?npe:ipe,iy=spe,KGe=Object.entries(I4)});import ape from"node:tty";var cpe,he,XGe,C4,QGe,e9e,t9e,r9e,n9e,i9e,o9e,s9e,a9e,c9e,l9e,u9e,d9e,f9e,p9e,oy,m9e,h9e,g9e,y9e,_9e,v9e,b9e,S9e,w9e,D4,x9e,N4,$9e,k9e,E9e,A9e,T9e,O9e,P9e,I9e,R9e,C9e,D9e,OA=y(()=>{cpe=ape?.WriteStream?.prototype?.hasColors?.()??!1,he=(t,e)=>{if(!cpe)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0,u=(e===22?n:"")+r;for(;s!==-1;)a+=o.slice(c,s)+u,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},XGe=he(0,0),C4=he(1,22),QGe=he(2,22),e9e=he(3,23),t9e=he(4,24),r9e=he(53,55),n9e=he(7,27),i9e=he(8,28),o9e=he(9,29),s9e=he(30,39),a9e=he(31,39),c9e=he(32,39),l9e=he(33,39),u9e=he(34,39),d9e=he(35,39),f9e=he(36,39),p9e=he(37,39),oy=he(90,39),m9e=he(40,49),h9e=he(41,49),g9e=he(42,49),y9e=he(43,49),_9e=he(44,49),v9e=he(45,49),b9e=he(46,49),S9e=he(47,49),w9e=he(100,49),D4=he(91,39),x9e=he(92,39),N4=he(93,39),$9e=he(94,39),k9e=he(95,39),E9e=he(96,39),A9e=he(97,39),T9e=he(101,49),O9e=he(102,49),P9e=he(103,49),I9e=he(104,49),R9e=he(105,49),C9e=he(106,49),D9e=he(107,49)});var j4=y(()=>{OA();OA()});var F4,upe,sy,M4,dpe,z4,fpe,L4=y(()=>{R4();j4();F4=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=upe(r),c=dpe[t]({failed:o,reject:s,piped:n}),l=fpe[t]({reject:s});return`${oy(`[${a}]`)} ${oy(`[${i}]`)} ${l(c)} ${l(e)}`},upe=t=>`${sy(t.getHours(),2)}:${sy(t.getMinutes(),2)}:${sy(t.getSeconds(),2)}.${sy(t.getMilliseconds(),3)}`,sy=(t,e)=>String(t).padStart(e,"0"),M4=({failed:t,reject:e})=>t?e?iy.cross:iy.warning:iy.tick,dpe={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:M4,duration:M4},z4=t=>t,fpe={command:()=>C4,output:()=>z4,ipc:()=>z4,error:({reject:t})=>t?D4:N4,duration:()=>oy}});var U4,ppe,mpe,q4=y(()=>{Co();U4=(t,e,r)=>{let n=k4(e,r);return t.map(({verboseLine:i,verboseObject:o})=>ppe(i,o,n)).filter(i=>i!==void 0).map(i=>mpe(i)).join("")},ppe=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},mpe=t=>t.endsWith(` `)?t:`${t} -`});import{inspect as dpe}from"node:util";var ai,fpe,ppe,mpe,ay,hpe,gc=y(()=>{ny();L4();q4();ai=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=fpe({type:t,result:i,verboseInfo:n}),s=ppe(e,o),a=U4(s,n,r);a!==""&&console.warn(a.slice(0,-1))},fpe=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),ppe=(t,e)=>t.split(` -`).map(r=>mpe({...e,message:r})),mpe=t=>({verboseLine:F4(t),verboseObject:t}),ay=t=>{let e=typeof t=="string"?t:dpe(t);return Ad(e).replaceAll(" "," ".repeat(hpe))},hpe=2});var B4,Z4=y(()=>{Ro();gc();B4=(t,e)=>{mc(e)&&ai({type:"command",verboseMessage:t,verboseInfo:e})}});var H4,gpe,ype,_pe,G4=y(()=>{Ro();H4=(t,e,r)=>{_pe(t);let n=gpe(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},gpe=t=>mc({verbose:t})?ype++:void 0,ype=0n,_pe=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!ry.includes(e)&&!ty(e)){let r=ry.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as V4}from"node:process";var cy,PA,ly=y(()=>{cy=()=>V4.bigint(),PA=t=>Number(V4.bigint()-t)/1e6});var uy,IA=y(()=>{Z4();G4();ly();ny();Vi();uy=(t,e,r)=>{let n=cy(),{command:i,escapedCommand:o}=E4(t,e),s=$A(r,"verbose"),a=H4(s,o,{...r});return B4(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var X4=v((J9e,Y4)=>{Y4.exports=J4;J4.sync=bpe;var W4=Le("fs");function vpe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{r6.exports=e6;e6.sync=Spe;var Q4=Le("fs");function e6(t,e,r){Q4.stat(t,function(n,i){r(n,n?!1:t6(i,e))})}function Spe(t,e){return t6(Q4.statSync(t),e)}function t6(t,e){return t.isFile()&&wpe(t,e)}function wpe(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var o6=v((Q9e,i6)=>{var X9e=Le("fs"),dy;process.platform==="win32"||global.TESTING_WINDOWS?dy=X4():dy=n6();i6.exports=RA;RA.sync=xpe;function RA(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){RA(t,e||{},function(o,s){o?i(o):n(s)})})}dy(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function xpe(t,e){try{return dy.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var f6=v((eVe,d6)=>{var yc=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",s6=Le("path"),$pe=yc?";":":",a6=o6(),c6=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),l6=(t,e)=>{let r=e.colon||$pe,n=t.match(/\//)||yc&&t.match(/\\/)?[""]:[...yc?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=yc?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=yc?i.split(r):[""];return yc&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},u6=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=l6(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(c6(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=s6.join(p,t),h=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;u(c(h,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let m=i[d];a6(l+m,{pathExt:o},(h,g)=>{if(!h&&g)if(e.all)s.push(l+m);else return f(l+m);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},kpe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=l6(t,e),o=[];for(let s=0;s{"use strict";var p6=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};CA.exports=p6;CA.exports.default=p6});var _6=v((rVe,y6)=>{"use strict";var h6=Le("path"),Epe=f6(),Ape=m6();function g6(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=Epe.sync(t.command,{path:r[Ape({env:r})],pathExt:e?h6.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=h6.resolve(i?t.options.cwd:"",s)),s}function Tpe(t){return g6(t)||g6(t,!0)}y6.exports=Tpe});var v6=v((nVe,NA)=>{"use strict";var DA=/([()\][%!^"`<>&|;, *?])/g;function Ope(t){return t=t.replace(DA,"^$1"),t}function Ppe(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(DA,"^$1"),e&&(t=t.replace(DA,"^$1")),t}NA.exports.command=Ope;NA.exports.argument=Ppe});var S6=v((iVe,b6)=>{"use strict";b6.exports=/^#!(.*)/});var x6=v((oVe,w6)=>{"use strict";var Ipe=S6();w6.exports=(t="")=>{let e=t.match(Ipe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var k6=v((sVe,$6)=>{"use strict";var jA=Le("fs"),Rpe=x6();function Cpe(t){let r=Buffer.alloc(150),n;try{n=jA.openSync(t,"r"),jA.readSync(n,r,0,150,0),jA.closeSync(n)}catch{}return Rpe(r.toString())}$6.exports=Cpe});var O6=v((aVe,T6)=>{"use strict";var Dpe=Le("path"),E6=_6(),A6=v6(),Npe=k6(),jpe=process.platform==="win32",Mpe=/\.(?:com|exe)$/i,zpe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Fpe(t){t.file=E6(t);let e=t.file&&Npe(t.file);return e?(t.args.unshift(t.file),t.command=e,E6(t)):t.file}function Lpe(t){if(!jpe)return t;let e=Fpe(t),r=!Mpe.test(e);if(t.options.forceShell||r){let n=zpe.test(e);t.command=Dpe.normalize(t.command),t.command=A6.command(t.command),t.args=t.args.map(o=>A6.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function Upe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:Lpe(n)}T6.exports=Upe});var R6=v((cVe,I6)=>{"use strict";var MA=process.platform==="win32";function zA(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function qpe(t,e){if(!MA)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=P6(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function P6(t,e){return MA&&t===1&&!e.file?zA(e.original,"spawn"):null}function Bpe(t,e){return MA&&t===1&&!e.file?zA(e.original,"spawnSync"):null}I6.exports={hookChildProcess:qpe,verifyENOENT:P6,verifyENOENTSync:Bpe,notFoundError:zA}});var N6=v((lVe,_c)=>{"use strict";var C6=Le("child_process"),FA=O6(),LA=R6();function D6(t,e,r){let n=FA(t,e,r),i=C6.spawn(n.command,n.args,n.options);return LA.hookChildProcess(i,n),i}function Zpe(t,e,r){let n=FA(t,e,r),i=C6.spawnSync(n.command,n.args,n.options);return i.error=i.error||LA.verifyENOENTSync(i.status,n),i}_c.exports=D6;_c.exports.spawn=D6;_c.exports.sync=Zpe;_c.exports._parse=FA;_c.exports._enoent=LA});function fy(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}var j6=y(()=>{});var M6=y(()=>{});import{promisify as Hpe}from"node:util";import{execFile as Gpe,execFileSync as mVe}from"node:child_process";import z6 from"node:path";import{fileURLToPath as Vpe}from"node:url";function py(t){return t instanceof URL?Vpe(t):t}function F6(t){return{*[Symbol.iterator](){let e=z6.resolve(py(t)),r;for(;r!==e;)yield e,r=e,e=z6.resolve(e,"..")}}}var yVe,_Ve,L6=y(()=>{M6();yVe=Hpe(Gpe);_Ve=10*1024*1024});import my from"node:process";import Us from"node:path";var Wpe,Kpe,Jpe,U6,q6=y(()=>{j6();L6();Wpe=({cwd:t=my.cwd(),path:e=my.env[fy()],preferLocal:r=!0,execPath:n=my.execPath,addExecPath:i=!0}={})=>{let o=Us.resolve(py(t)),s=[],a=e.split(Us.delimiter);return r&&Kpe(s,a,o),i&&Jpe(s,a,n,o),e===""||e===Us.delimiter?`${s.join(Us.delimiter)}${e}`:[...s,e].join(Us.delimiter)},Kpe=(t,e,r)=>{for(let n of F6(r)){let i=Us.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},Jpe=(t,e,r,n)=>{let i=Us.resolve(n,py(r),"..");e.includes(i)||t.push(i)},U6=({env:t=my.env,...e}={})=>{t={...t};let r=fy({env:t});return e.path=t[r],t[r]=Wpe(e),t}});var B6,Dn,Z6,H6,G6,hy,Td,Od,qs=y(()=>{B6=(t,e,r)=>{let n=r?Od:Td,i=t instanceof Dn?{}:{cause:t};return new n(e,i)},Dn=class extends Error{},Z6=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,G6,{value:!0,writable:!1,enumerable:!1,configurable:!1})},H6=t=>hy(t)&&G6 in t,G6=Symbol("isExecaError"),hy=t=>Object.prototype.toString.call(t)==="[object Error]",Td=class extends Error{};Z6(Td,Td.name);Od=class extends Error{};Z6(Od,Od.name)});var V6,Ype,W6,K6,J6=y(()=>{V6=()=>{let t=K6-W6+1;return Array.from({length:t},Ype)},Ype=(t,e)=>({name:`SIGRT${e+1}`,number:W6+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),W6=34,K6=64});var Y6,X6=y(()=>{Y6=[{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 Xpe}from"node:os";var UA,Qpe,Q6=y(()=>{X6();J6();UA=()=>{let t=V6();return[...Y6,...t].map(Qpe)},Qpe=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=Xpe,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as eme}from"node:os";var tme,rme,eB,nme,ime,ome,NVe,tB=y(()=>{Q6();tme=()=>{let t=UA();return Object.fromEntries(t.map(rme))},rme=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],eB=tme(),nme=()=>{let t=UA(),e=65,r=Array.from({length:e},(n,i)=>ime(i,t));return Object.assign({},...r)},ime=(t,e)=>{let r=ome(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},ome=(t,e)=>{let r=e.find(({name:n})=>eme.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},NVe=nme()});import{constants as Pd}from"node:os";var nB,iB,oB,sme,ame,rB,cme,qA,lme,ume,gy,Id=y(()=>{tB();nB=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return oB(t,e)},iB=t=>t===0?t:oB(t,"`subprocess.kill()`'s argument"),oB=(t,e)=>{if(Number.isInteger(t))return sme(t,e);if(typeof t=="string")return cme(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. -${qA()}`)},sme=(t,e)=>{if(rB.has(t))return rB.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. -${qA()}`)},ame=()=>new Map(Object.entries(Pd.signals).reverse().map(([t,e])=>[e,t])),rB=ame(),cme=(t,e)=>{if(t in Pd.signals)return t;throw t.toUpperCase()in Pd.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. -${qA()}`)},qA=()=>`Available signal names: ${lme()}. -Available signal numbers: ${ume()}.`,lme=()=>Object.keys(Pd.signals).sort().map(t=>`'${t}'`).join(", "),ume=()=>[...new Set(Object.values(Pd.signals).sort((t,e)=>t-e))].join(", "),gy=t=>eB[t].description});import{setTimeout as dme}from"node:timers/promises";var sB,fme,aB,pme,mme,hme,BA,yy=y(()=>{qs();Id();sB=t=>{if(t===!1)return t;if(t===!0)return fme;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},fme=1e3*5,aB=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=pme(s,a,r);mme(l,n);let u=t(c);return hme({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},pme=(t,e,r)=>{let[n=r,i]=hy(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!hy(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:iB(n),error:i}},mme=(t,e)=>{t!==void 0&&e.reject(t)},hme=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&BA({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},BA=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await dme(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as gme}from"node:events";var _y,ZA=y(()=>{_y=async(t,e)=>{t.aborted||await gme(t,"abort",{signal:e})}});var cB,lB,yme,HA=y(()=>{ZA();cB=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},lB=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[yme(t,e,n,i)],yme=async(t,e,r,{signal:n})=>{throw await _y(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var vc,_me,GA,uB,dB,vy,fB,pB,mB,hB,gB,yB,vme,bme,Sme,Nn,wme,Co,bc,Sc=y(()=>{vc=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{_me(t,e,r),GA(t,e,n)},_me=(t,e,r)=>{if(!r)throw new Error(`${Nn(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},GA=(t,e,r)=>{if(!r)throw new Error(`${Nn(t,e)} cannot be used: the ${Co(e)} has already exited or disconnected.`)},uB=t=>{throw new Error(`${Nn("getOneMessage",t)} could not complete: the ${Co(t)} exited or disconnected.`)},dB=t=>{throw new Error(`${Nn("sendMessage",t)} failed: the ${Co(t)} is sending a message too, instead of listening to incoming messages. +`});import{inspect as hpe}from"node:util";var ai,gpe,ype,_pe,ay,vpe,gc=y(()=>{ny();L4();q4();ai=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=gpe({type:t,result:i,verboseInfo:n}),s=ype(e,o),a=U4(s,n,r);a!==""&&console.warn(a.slice(0,-1))},gpe=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),ype=(t,e)=>t.split(` +`).map(r=>_pe({...e,message:r})),_pe=t=>({verboseLine:F4(t),verboseObject:t}),ay=t=>{let e=typeof t=="string"?t:hpe(t);return Ad(e).replaceAll(" "," ".repeat(vpe))},vpe=2});var B4,Z4=y(()=>{Co();gc();B4=(t,e)=>{mc(e)&&ai({type:"command",verboseMessage:t,verboseInfo:e})}});var H4,bpe,Spe,wpe,G4=y(()=>{Co();H4=(t,e,r)=>{wpe(t);let n=bpe(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},bpe=t=>mc({verbose:t})?Spe++:void 0,Spe=0n,wpe=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!ry.includes(e)&&!ty(e)){let r=ry.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as V4}from"node:process";var cy,PA,ly=y(()=>{cy=()=>V4.bigint(),PA=t=>Number(V4.bigint()-t)/1e6});var uy,IA=y(()=>{Z4();G4();ly();ny();Vi();uy=(t,e,r)=>{let n=cy(),{command:i,escapedCommand:o}=E4(t,e),s=$A(r,"verbose"),a=H4(s,o,{...r});return B4(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var X4=v((sVe,Y4)=>{Y4.exports=J4;J4.sync=$pe;var W4=Le("fs");function xpe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{r6.exports=e6;e6.sync=kpe;var Q4=Le("fs");function e6(t,e,r){Q4.stat(t,function(n,i){r(n,n?!1:t6(i,e))})}function kpe(t,e){return t6(Q4.statSync(t),e)}function t6(t,e){return t.isFile()&&Epe(t,e)}function Epe(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var o6=v((lVe,i6)=>{var cVe=Le("fs"),dy;process.platform==="win32"||global.TESTING_WINDOWS?dy=X4():dy=n6();i6.exports=RA;RA.sync=Ape;function RA(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){RA(t,e||{},function(o,s){o?i(o):n(s)})})}dy(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function Ape(t,e){try{return dy.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var f6=v((uVe,d6)=>{var yc=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",s6=Le("path"),Tpe=yc?";":":",a6=o6(),c6=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),l6=(t,e)=>{let r=e.colon||Tpe,n=t.match(/\//)||yc&&t.match(/\\/)?[""]:[...yc?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=yc?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=yc?i.split(r):[""];return yc&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},u6=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=l6(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(c6(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=s6.join(p,t),h=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;u(c(h,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let m=i[d];a6(l+m,{pathExt:o},(h,g)=>{if(!h&&g)if(e.all)s.push(l+m);else return f(l+m);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},Ope=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=l6(t,e),o=[];for(let s=0;s{"use strict";var p6=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};CA.exports=p6;CA.exports.default=p6});var _6=v((fVe,y6)=>{"use strict";var h6=Le("path"),Ppe=f6(),Ipe=m6();function g6(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=Ppe.sync(t.command,{path:r[Ipe({env:r})],pathExt:e?h6.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=h6.resolve(i?t.options.cwd:"",s)),s}function Rpe(t){return g6(t)||g6(t,!0)}y6.exports=Rpe});var v6=v((pVe,NA)=>{"use strict";var DA=/([()\][%!^"`<>&|;, *?])/g;function Cpe(t){return t=t.replace(DA,"^$1"),t}function Dpe(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(DA,"^$1"),e&&(t=t.replace(DA,"^$1")),t}NA.exports.command=Cpe;NA.exports.argument=Dpe});var S6=v((mVe,b6)=>{"use strict";b6.exports=/^#!(.*)/});var x6=v((hVe,w6)=>{"use strict";var Npe=S6();w6.exports=(t="")=>{let e=t.match(Npe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var k6=v((gVe,$6)=>{"use strict";var jA=Le("fs"),jpe=x6();function Mpe(t){let r=Buffer.alloc(150),n;try{n=jA.openSync(t,"r"),jA.readSync(n,r,0,150,0),jA.closeSync(n)}catch{}return jpe(r.toString())}$6.exports=Mpe});var O6=v((yVe,T6)=>{"use strict";var zpe=Le("path"),E6=_6(),A6=v6(),Fpe=k6(),Lpe=process.platform==="win32",Upe=/\.(?:com|exe)$/i,qpe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Bpe(t){t.file=E6(t);let e=t.file&&Fpe(t.file);return e?(t.args.unshift(t.file),t.command=e,E6(t)):t.file}function Zpe(t){if(!Lpe)return t;let e=Bpe(t),r=!Upe.test(e);if(t.options.forceShell||r){let n=qpe.test(e);t.command=zpe.normalize(t.command),t.command=A6.command(t.command),t.args=t.args.map(o=>A6.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function Hpe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:Zpe(n)}T6.exports=Hpe});var R6=v((_Ve,I6)=>{"use strict";var MA=process.platform==="win32";function zA(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function Gpe(t,e){if(!MA)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=P6(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function P6(t,e){return MA&&t===1&&!e.file?zA(e.original,"spawn"):null}function Vpe(t,e){return MA&&t===1&&!e.file?zA(e.original,"spawnSync"):null}I6.exports={hookChildProcess:Gpe,verifyENOENT:P6,verifyENOENTSync:Vpe,notFoundError:zA}});var N6=v((vVe,_c)=>{"use strict";var C6=Le("child_process"),FA=O6(),LA=R6();function D6(t,e,r){let n=FA(t,e,r),i=C6.spawn(n.command,n.args,n.options);return LA.hookChildProcess(i,n),i}function Wpe(t,e,r){let n=FA(t,e,r),i=C6.spawnSync(n.command,n.args,n.options);return i.error=i.error||LA.verifyENOENTSync(i.status,n),i}_c.exports=D6;_c.exports.spawn=D6;_c.exports.sync=Wpe;_c.exports._parse=FA;_c.exports._enoent=LA});function fy(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}var j6=y(()=>{});var M6=y(()=>{});import{promisify as Kpe}from"node:util";import{execFile as Jpe,execFileSync as $Ve}from"node:child_process";import z6 from"node:path";import{fileURLToPath as Ype}from"node:url";function py(t){return t instanceof URL?Ype(t):t}function F6(t){return{*[Symbol.iterator](){let e=z6.resolve(py(t)),r;for(;r!==e;)yield e,r=e,e=z6.resolve(e,"..")}}}var AVe,TVe,L6=y(()=>{M6();AVe=Kpe(Jpe);TVe=10*1024*1024});import my from"node:process";import qs from"node:path";var Xpe,Qpe,eme,U6,q6=y(()=>{j6();L6();Xpe=({cwd:t=my.cwd(),path:e=my.env[fy()],preferLocal:r=!0,execPath:n=my.execPath,addExecPath:i=!0}={})=>{let o=qs.resolve(py(t)),s=[],a=e.split(qs.delimiter);return r&&Qpe(s,a,o),i&&eme(s,a,n,o),e===""||e===qs.delimiter?`${s.join(qs.delimiter)}${e}`:[...s,e].join(qs.delimiter)},Qpe=(t,e,r)=>{for(let n of F6(r)){let i=qs.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},eme=(t,e,r,n)=>{let i=qs.resolve(n,py(r),"..");e.includes(i)||t.push(i)},U6=({env:t=my.env,...e}={})=>{t={...t};let r=fy({env:t});return e.path=t[r],t[r]=Xpe(e),t}});var B6,Dn,Z6,H6,G6,hy,Td,Od,Bs=y(()=>{B6=(t,e,r)=>{let n=r?Od:Td,i=t instanceof Dn?{}:{cause:t};return new n(e,i)},Dn=class extends Error{},Z6=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,G6,{value:!0,writable:!1,enumerable:!1,configurable:!1})},H6=t=>hy(t)&&G6 in t,G6=Symbol("isExecaError"),hy=t=>Object.prototype.toString.call(t)==="[object Error]",Td=class extends Error{};Z6(Td,Td.name);Od=class extends Error{};Z6(Od,Od.name)});var V6,tme,W6,K6,J6=y(()=>{V6=()=>{let t=K6-W6+1;return Array.from({length:t},tme)},tme=(t,e)=>({name:`SIGRT${e+1}`,number:W6+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),W6=34,K6=64});var Y6,X6=y(()=>{Y6=[{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 rme}from"node:os";var UA,nme,Q6=y(()=>{X6();J6();UA=()=>{let t=V6();return[...Y6,...t].map(nme)},nme=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=rme,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as ime}from"node:os";var ome,sme,eB,ame,cme,lme,HVe,tB=y(()=>{Q6();ome=()=>{let t=UA();return Object.fromEntries(t.map(sme))},sme=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],eB=ome(),ame=()=>{let t=UA(),e=65,r=Array.from({length:e},(n,i)=>cme(i,t));return Object.assign({},...r)},cme=(t,e)=>{let r=lme(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},lme=(t,e)=>{let r=e.find(({name:n})=>ime.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},HVe=ame()});import{constants as Pd}from"node:os";var nB,iB,oB,ume,dme,rB,fme,qA,pme,mme,gy,Id=y(()=>{tB();nB=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return oB(t,e)},iB=t=>t===0?t:oB(t,"`subprocess.kill()`'s argument"),oB=(t,e)=>{if(Number.isInteger(t))return ume(t,e);if(typeof t=="string")return fme(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. +${qA()}`)},ume=(t,e)=>{if(rB.has(t))return rB.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. +${qA()}`)},dme=()=>new Map(Object.entries(Pd.signals).reverse().map(([t,e])=>[e,t])),rB=dme(),fme=(t,e)=>{if(t in Pd.signals)return t;throw t.toUpperCase()in Pd.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. +${qA()}`)},qA=()=>`Available signal names: ${pme()}. +Available signal numbers: ${mme()}.`,pme=()=>Object.keys(Pd.signals).sort().map(t=>`'${t}'`).join(", "),mme=()=>[...new Set(Object.values(Pd.signals).sort((t,e)=>t-e))].join(", "),gy=t=>eB[t].description});import{setTimeout as hme}from"node:timers/promises";var sB,gme,aB,yme,_me,vme,BA,yy=y(()=>{Bs();Id();sB=t=>{if(t===!1)return t;if(t===!0)return gme;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},gme=1e3*5,aB=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=yme(s,a,r);_me(l,n);let u=t(c);return vme({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},yme=(t,e,r)=>{let[n=r,i]=hy(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!hy(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:iB(n),error:i}},_me=(t,e)=>{t!==void 0&&e.reject(t)},vme=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&BA({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},BA=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await hme(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as bme}from"node:events";var _y,ZA=y(()=>{_y=async(t,e)=>{t.aborted||await bme(t,"abort",{signal:e})}});var cB,lB,Sme,HA=y(()=>{ZA();cB=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},lB=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[Sme(t,e,n,i)],Sme=async(t,e,r,{signal:n})=>{throw await _y(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var vc,wme,GA,uB,dB,vy,fB,pB,mB,hB,gB,yB,xme,$me,kme,Nn,Eme,Do,bc,Sc=y(()=>{vc=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{wme(t,e,r),GA(t,e,n)},wme=(t,e,r)=>{if(!r)throw new Error(`${Nn(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},GA=(t,e,r)=>{if(!r)throw new Error(`${Nn(t,e)} cannot be used: the ${Do(e)} has already exited or disconnected.`)},uB=t=>{throw new Error(`${Nn("getOneMessage",t)} could not complete: the ${Do(t)} exited or disconnected.`)},dB=t=>{throw new Error(`${Nn("sendMessage",t)} failed: the ${Do(t)} is sending a message too, instead of listening to incoming messages. This can be fixed by both sending a message and listening to incoming messages at the same time: const [receivedMessage] = await Promise.all([ ${Nn("getOneMessage",t)}, ${Nn("sendMessage",t,"message, {strict: true}")}, -]);`)},vy=(t,e)=>new Error(`${Nn("sendMessage",e)} failed when sending an acknowledgment response to the ${Co(e)}.`,{cause:t}),fB=t=>{throw new Error(`${Nn("sendMessage",t)} failed: the ${Co(t)} is not listening to incoming messages.`)},pB=t=>{throw new Error(`${Nn("sendMessage",t)} failed: the ${Co(t)} exited without listening to incoming messages.`)},mB=()=>new Error(`\`cancelSignal\` aborted: the ${Co(!0)} disconnected.`),hB=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},gB=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${Nn(e,r)} cannot be used: the ${Co(r)} is disconnecting.`,{cause:t})},yB=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(vme(t))throw new Error(`${Nn(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},vme=({code:t,message:e})=>bme.has(t)||Sme.some(r=>e.includes(r)),bme=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Sme=["could not be cloned","circular structure","call stack size exceeded"],Nn=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${wme(e)}${t}(${r})`,wme=t=>t?"":"subprocess.",Co=t=>t?"parent process":"subprocess",bc=t=>{t.connected&&t.disconnect()}});var ci,wc=y(()=>{ci=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var Sy,xc,li,_B,xme,$me,vB,kme,bB,Rd,by,Do=y(()=>{Vi();Sy=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=li.get(t),o=_B(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(vB(o,e,n,!0));return s},xc=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=li.get(t),o=_B(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(vB(o,e,n,!1));return s},li=new WeakMap,_B=(t,e,r)=>{let n=xme(e,r);return $me(n,e,r,t),n},xme=(t,e)=>{let r=kA(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Rd(e)}" must not be "${t}". +]);`)},vy=(t,e)=>new Error(`${Nn("sendMessage",e)} failed when sending an acknowledgment response to the ${Do(e)}.`,{cause:t}),fB=t=>{throw new Error(`${Nn("sendMessage",t)} failed: the ${Do(t)} is not listening to incoming messages.`)},pB=t=>{throw new Error(`${Nn("sendMessage",t)} failed: the ${Do(t)} exited without listening to incoming messages.`)},mB=()=>new Error(`\`cancelSignal\` aborted: the ${Do(!0)} disconnected.`),hB=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},gB=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${Nn(e,r)} cannot be used: the ${Do(r)} is disconnecting.`,{cause:t})},yB=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(xme(t))throw new Error(`${Nn(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},xme=({code:t,message:e})=>$me.has(t)||kme.some(r=>e.includes(r)),$me=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),kme=["could not be cloned","circular structure","call stack size exceeded"],Nn=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Eme(e)}${t}(${r})`,Eme=t=>t?"":"subprocess.",Do=t=>t?"parent process":"subprocess",bc=t=>{t.connected&&t.disconnect()}});var ci,wc=y(()=>{ci=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var Sy,xc,li,_B,Ame,Tme,vB,Ome,bB,Rd,by,No=y(()=>{Vi();Sy=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=li.get(t),o=_B(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(vB(o,e,n,!0));return s},xc=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=li.get(t),o=_B(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(vB(o,e,n,!1));return s},li=new WeakMap,_B=(t,e,r)=>{let n=Ame(e,r);return Tme(n,e,r,t),n},Ame=(t,e)=>{let r=kA(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Rd(e)}" must not be "${t}". It must be ${n} or "fd3", "fd4" (and so on). -It is optional and defaults to "${i}".`)},$me=(t,e,r,n)=>{let i=n[bB(t)];if(i===void 0)throw new TypeError(`"${Rd(r)}" must not be ${e}. That file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${Rd(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${Rd(r)}" must not be ${e}. It must be a writable stream, not readable.`)},vB=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:o}=kme(t,r);return`The "${i}: ${by(o)}" option is incompatible with using "${Rd(n)}: ${by(e)}". -Please set this option with "pipe" instead.`},kme=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=bB(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},bB=t=>t==="all"?1:t,Rd=t=>t?"to":"from",by=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as Eme}from"node:events";var Bs,wy=y(()=>{Bs=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),Eme(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var xy,VA,$y,WA,SB,wB,Cd=y(()=>{xy=(t,e)=>{e&&VA(t)},VA=t=>{t.refCounted()},$y=(t,e)=>{e&&WA(t)},WA=t=>{t.unrefCounted()},SB=(t,e)=>{e&&(WA(t),WA(t))},wB=(t,e)=>{e&&(VA(t),VA(t))}});import{once as Ame}from"node:events";import{scheduler as Tme}from"node:timers/promises";var xB,$B,ky,kB=y(()=>{Ay();Cd();Ey();Ty();xB=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(AB(i)||OB(i))return;ky.has(t)||ky.set(t,[]);let o=ky.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await TB(t,n,i),await Tme.yield();let s=await EB({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},$B=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{KA();let o=ky.get(t);for(;o?.length>0;)await Ame(n,"message:done");t.removeListener("message",i),wB(e,r),n.connected=!1,n.emit("disconnect")},ky=new WeakMap});import{EventEmitter as Ome}from"node:events";var No,Oy,Pme,Py,Dd=y(()=>{kB();Cd();No=(t,e,r)=>{if(Oy.has(t))return Oy.get(t);let n=new Ome;return n.connected=!0,Oy.set(t,n),Pme({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},Oy=new WeakMap,Pme=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=xB.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",$B.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),SB(r,n)},Py=t=>{let e=Oy.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as Ime}from"node:events";var PB,Rme,IB,EB,AB,RB,Iy,Cme,Ry,CB,Ey=y(()=>{wc();wy();Ny();Sc();Dd();Ay();PB=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=No(t,e,r),s=Cy(t,o);return{id:Rme++,type:Ry,message:n,hasListeners:s}},Rme=0n,IB=(t,e)=>{if(!(e?.type!==Ry||e.hasListeners))for(let{id:r}of t)r!==void 0&&Iy[r].resolve({isDeadlock:!0,hasListeners:!1})},EB=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Ry||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:CB,message:Cy(e,i)};try{await Dy({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},AB=t=>{if(t?.type!==CB)return!1;let{id:e,message:r}=t;return Iy[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},RB=async(t,e,r)=>{if(t?.type!==Ry)return;let n=ci();Iy[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,Cme(e,r,i)]);o&&dB(r),s||fB(r)}finally{i.abort(),delete Iy[t.id]}},Iy={},Cme=async(t,e,{signal:r})=>{Bs(t,1,r),await Ime(t,"disconnect",{signal:r}),pB(e)},Ry="execa:ipc:request",CB="execa:ipc:response"});var DB,NB,TB,Nd,Cy,Dme,Ay=y(()=>{wc();Vi();Do();Ey();DB=(t,e,r)=>{Nd.has(t)||Nd.set(t,new Set);let n=Nd.get(t),i=ci(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},NB=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},TB=async(t,e,r)=>{for(;!Cy(t,e)&&Nd.get(t)?.size>0;){let n=[...Nd.get(t)];IB(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Nd=new WeakMap,Cy=(t,e)=>e.listenerCount("message")>Dme(t),Dme=t=>li.has(t)&&!Gi(li.get(t).options.buffer,"ipc")?1:0});import{promisify as Nme}from"node:util";var Dy,jme,YA,Mme,JA,Ny=y(()=>{Sc();Ay();Ey();Dy=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return vc({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),jme({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},jme=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=PB({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=DB(t,s,o);try{await YA({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw bc(t),c}finally{NB(a)}},YA=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=Mme(t);try{await Promise.all([RB(n,t,r),o(n)])}catch(s){throw gB({error:s,methodName:e,isSubprocess:r}),yB({error:s,methodName:e,isSubprocess:r,message:i}),s}},Mme=t=>{if(JA.has(t))return JA.get(t);let e=Nme(t.send.bind(t));return JA.set(t,e),e},JA=new WeakMap});import{scheduler as zme}from"node:timers/promises";var MB,zB,Fme,jB,OB,FB,KA,XA,Ty=y(()=>{Ny();Dd();Sc();MB=(t,e)=>{let r="cancelSignal";return GA(r,!1,t.connected),YA({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:FB,message:e},message:e})},zB=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await Fme({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),XA.signal),Fme=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!jB){if(jB=!0,!n){hB();return}if(e===null){KA();return}No(t,e,r),await zme.yield()}},jB=!1,OB=t=>t?.type!==FB?!1:(XA.abort(t.message),!0),FB="execa:ipc:cancel",KA=()=>{XA.abort(mB())},XA=new AbortController});var LB,UB,Lme,Ume,QA=y(()=>{ZA();Ty();yy();LB=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===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(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},UB=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[Lme({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],Lme=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await _y(e,i);let o=Ume(e);throw await MB(t,o),BA({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},Ume=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as qme}from"node:timers/promises";var qB,BB,Bme,eT=y(()=>{qs();qB=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},BB=(t,e,r,n)=>e===0||e===void 0?[]:[Bme(t,e,r,n)],Bme=async(t,e,r,{signal:n})=>{throw await qme(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new Dn}});import{execPath as Zme,execArgv as Hme}from"node:process";import ZB from"node:path";var HB,GB,tT=y(()=>{pc();HB=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},GB=(t,e,{node:r=!1,nodePath:n=Zme,nodeOptions:i=Hme.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=fc(n,'The "nodePath" option'),l=ZB.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(ZB.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as Gme}from"node:v8";var VB,Vme,Wme,Kme,WB,rT=y(()=>{VB=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Kme[r](t)}},Vme=t=>{try{Gme(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},Wme=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},Kme={advanced:Vme,json:Wme},WB=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var JB,Jme,qr,nT,Yme,KB,jy,Zs=y(()=>{JB=({encoding:t})=>{if(nT.has(t))return;let e=Yme(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${jy(t)}\`. +It is optional and defaults to "${i}".`)},Tme=(t,e,r,n)=>{let i=n[bB(t)];if(i===void 0)throw new TypeError(`"${Rd(r)}" must not be ${e}. That file descriptor does not exist. +Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${Rd(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${Rd(r)}" must not be ${e}. It must be a writable stream, not readable.`)},vB=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:o}=Ome(t,r);return`The "${i}: ${by(o)}" option is incompatible with using "${Rd(n)}: ${by(e)}". +Please set this option with "pipe" instead.`},Ome=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=bB(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},bB=t=>t==="all"?1:t,Rd=t=>t?"to":"from",by=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as Pme}from"node:events";var Zs,wy=y(()=>{Zs=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),Pme(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var xy,VA,$y,WA,SB,wB,Cd=y(()=>{xy=(t,e)=>{e&&VA(t)},VA=t=>{t.refCounted()},$y=(t,e)=>{e&&WA(t)},WA=t=>{t.unrefCounted()},SB=(t,e)=>{e&&(WA(t),WA(t))},wB=(t,e)=>{e&&(VA(t),VA(t))}});import{once as Ime}from"node:events";import{scheduler as Rme}from"node:timers/promises";var xB,$B,ky,kB=y(()=>{Ay();Cd();Ey();Ty();xB=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(AB(i)||OB(i))return;ky.has(t)||ky.set(t,[]);let o=ky.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await TB(t,n,i),await Rme.yield();let s=await EB({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},$B=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{KA();let o=ky.get(t);for(;o?.length>0;)await Ime(n,"message:done");t.removeListener("message",i),wB(e,r),n.connected=!1,n.emit("disconnect")},ky=new WeakMap});import{EventEmitter as Cme}from"node:events";var jo,Oy,Dme,Py,Dd=y(()=>{kB();Cd();jo=(t,e,r)=>{if(Oy.has(t))return Oy.get(t);let n=new Cme;return n.connected=!0,Oy.set(t,n),Dme({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},Oy=new WeakMap,Dme=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=xB.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",$B.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),SB(r,n)},Py=t=>{let e=Oy.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as Nme}from"node:events";var PB,jme,IB,EB,AB,RB,Iy,Mme,Ry,CB,Ey=y(()=>{wc();wy();Ny();Sc();Dd();Ay();PB=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=jo(t,e,r),s=Cy(t,o);return{id:jme++,type:Ry,message:n,hasListeners:s}},jme=0n,IB=(t,e)=>{if(!(e?.type!==Ry||e.hasListeners))for(let{id:r}of t)r!==void 0&&Iy[r].resolve({isDeadlock:!0,hasListeners:!1})},EB=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Ry||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:CB,message:Cy(e,i)};try{await Dy({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},AB=t=>{if(t?.type!==CB)return!1;let{id:e,message:r}=t;return Iy[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},RB=async(t,e,r)=>{if(t?.type!==Ry)return;let n=ci();Iy[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,Mme(e,r,i)]);o&&dB(r),s||fB(r)}finally{i.abort(),delete Iy[t.id]}},Iy={},Mme=async(t,e,{signal:r})=>{Zs(t,1,r),await Nme(t,"disconnect",{signal:r}),pB(e)},Ry="execa:ipc:request",CB="execa:ipc:response"});var DB,NB,TB,Nd,Cy,zme,Ay=y(()=>{wc();Vi();No();Ey();DB=(t,e,r)=>{Nd.has(t)||Nd.set(t,new Set);let n=Nd.get(t),i=ci(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},NB=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},TB=async(t,e,r)=>{for(;!Cy(t,e)&&Nd.get(t)?.size>0;){let n=[...Nd.get(t)];IB(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Nd=new WeakMap,Cy=(t,e)=>e.listenerCount("message")>zme(t),zme=t=>li.has(t)&&!Gi(li.get(t).options.buffer,"ipc")?1:0});import{promisify as Fme}from"node:util";var Dy,Lme,YA,Ume,JA,Ny=y(()=>{Sc();Ay();Ey();Dy=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return vc({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),Lme({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},Lme=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=PB({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=DB(t,s,o);try{await YA({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw bc(t),c}finally{NB(a)}},YA=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=Ume(t);try{await Promise.all([RB(n,t,r),o(n)])}catch(s){throw gB({error:s,methodName:e,isSubprocess:r}),yB({error:s,methodName:e,isSubprocess:r,message:i}),s}},Ume=t=>{if(JA.has(t))return JA.get(t);let e=Fme(t.send.bind(t));return JA.set(t,e),e},JA=new WeakMap});import{scheduler as qme}from"node:timers/promises";var MB,zB,Bme,jB,OB,FB,KA,XA,Ty=y(()=>{Ny();Dd();Sc();MB=(t,e)=>{let r="cancelSignal";return GA(r,!1,t.connected),YA({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:FB,message:e},message:e})},zB=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await Bme({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),XA.signal),Bme=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!jB){if(jB=!0,!n){hB();return}if(e===null){KA();return}jo(t,e,r),await qme.yield()}},jB=!1,OB=t=>t?.type!==FB?!1:(XA.abort(t.message),!0),FB="execa:ipc:cancel",KA=()=>{XA.abort(mB())},XA=new AbortController});var LB,UB,Zme,Hme,QA=y(()=>{ZA();Ty();yy();LB=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===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(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},UB=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[Zme({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],Zme=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await _y(e,i);let o=Hme(e);throw await MB(t,o),BA({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},Hme=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as Gme}from"node:timers/promises";var qB,BB,Vme,eT=y(()=>{Bs();qB=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},BB=(t,e,r,n)=>e===0||e===void 0?[]:[Vme(t,e,r,n)],Vme=async(t,e,r,{signal:n})=>{throw await Gme(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new Dn}});import{execPath as Wme,execArgv as Kme}from"node:process";import ZB from"node:path";var HB,GB,tT=y(()=>{pc();HB=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},GB=(t,e,{node:r=!1,nodePath:n=Wme,nodeOptions:i=Kme.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=fc(n,'The "nodePath" option'),l=ZB.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(ZB.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as Jme}from"node:v8";var VB,Yme,Xme,Qme,WB,rT=y(()=>{VB=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Qme[r](t)}},Yme=t=>{try{Jme(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},Xme=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},Qme={advanced:Yme,json:Xme},WB=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var JB,ehe,qr,nT,the,KB,jy,Hs=y(()=>{JB=({encoding:t})=>{if(nT.has(t))return;let e=the(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${jy(t)}\`. Please rename it to ${jy(e)}.`);let r=[...nT].map(n=>jy(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${jy(t)}\`. -Please rename it to one of: ${r}.`)},Jme=new Set(["utf8","utf16le"]),qr=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),nT=new Set([...Jme,...qr]),Yme=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in KB)return KB[e];if(nT.has(e))return e},KB={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},jy=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as Xme}from"node:fs";import Qme from"node:path";import ehe from"node:process";var YB,XB,QB,iT=y(()=>{pc();YB=(t=XB())=>{let e=fc(t,'The "cwd" option');return Qme.resolve(e)},XB=()=>{try{return ehe.cwd()}catch(t){throw t.message=`The current directory does not exist. -${t.message}`,t}},QB=(t,e)=>{if(e===XB())return t;let r;try{r=Xme(e)}catch(n){return`The "cwd" option is invalid: ${e}. +Please rename it to one of: ${r}.`)},ehe=new Set(["utf8","utf16le"]),qr=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),nT=new Set([...ehe,...qr]),the=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in KB)return KB[e];if(nT.has(e))return e},KB={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},jy=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as rhe}from"node:fs";import nhe from"node:path";import ihe from"node:process";var YB,XB,QB,iT=y(()=>{pc();YB=(t=XB())=>{let e=fc(t,'The "cwd" option');return nhe.resolve(e)},XB=()=>{try{return ihe.cwd()}catch(t){throw t.message=`The current directory does not exist. +${t.message}`,t}},QB=(t,e)=>{if(e===XB())return t;let r;try{r=rhe(e)}catch(n){return`The "cwd" option is invalid: ${e}. ${n.message} ${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}. -${t}`}});import the from"node:path";import eZ from"node:process";var tZ,My,rhe,nhe,oT=y(()=>{tZ=St(N6(),1);q6();yy();Id();HA();QA();eT();tT();rT();Zs();iT();pc();Vi();My=(t,e,r)=>{r.cwd=YB(r.cwd);let[n,i,o]=GB(t,e,r),{command:s,args:a,options:c}=tZ.default._parse(n,i,o),l=$4(c),u=rhe(l);return qB(u),JB(u),VB(u),cB(u),LB(u),u.shell=bA(u.shell),u.env=nhe(u),u.killSignal=nB(u.killSignal),u.forceKillAfterDelay=sB(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!qr.has(u.encoding)&&u.buffer[f]),eZ.platform==="win32"&&the.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},rhe=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),nhe=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...eZ.env,...t}:t;return r||n?U6({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var zy,sT=y(()=>{zy=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function $c(t){if(typeof t=="string")return ihe(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return ohe(t)}var ihe,ohe,rZ,she,nZ,ahe,aT=y(()=>{ihe=t=>t.at(-1)===rZ?t.slice(0,t.at(-2)===nZ?-2:-1):t,ohe=t=>t.at(-1)===she?t.subarray(0,t.at(-2)===ahe?-2:-1):t,rZ=` -`,she=rZ.codePointAt(0),nZ="\r",ahe=nZ.codePointAt(0)});function jn(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function cT(t,{checkOpen:e=!0}={}){return jn(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Hs(t,{checkOpen:e=!0}={}){return jn(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function lT(t,e){return cT(t,e)&&Hs(t,e)}var Gs=y(()=>{});function iZ(){return this[dT].next()}function oZ(t){return this[dT].return(t)}function fT({preventCancel:t=!1}={}){let e=this.getReader(),r=new uT(e,t),n=Object.create(lhe);return n[dT]=r,n}var che,uT,dT,lhe,sZ=y(()=>{che=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),uT=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},dT=Symbol();Object.defineProperty(iZ,"name",{value:"next"});Object.defineProperty(oZ,"name",{value:"return"});lhe=Object.create(che,{next:{enumerable:!0,configurable:!0,writable:!0,value:iZ},return:{enumerable:!0,configurable:!0,writable:!0,value:oZ}})});var aZ=y(()=>{});var cZ=y(()=>{sZ();aZ()});var lZ,uhe,dhe,fhe,jd,pT=y(()=>{Gs();cZ();lZ=t=>{if(Hs(t,{checkOpen:!1})&&jd.on!==void 0)return dhe(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(uhe.call(t)==="[object ReadableStream]")return fT.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:uhe}=Object.prototype,dhe=async function*(t){let e=new AbortController,r={};fhe(t,e,r);try{for await(let[n]of jd.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},fhe=async(t,e,r)=>{try{await jd.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},jd={}});var kc,phe,fZ,uZ,mhe,dZ,ui,Md=y(()=>{pT();kc=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=lZ(t),u=e();u.length=0;try{for await(let d of l){let f=mhe(d),p=r[f](d,u);fZ({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return phe({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},phe=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&fZ({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},fZ=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){uZ(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&uZ(c,e,i,o),new ui},uZ=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},mhe=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=dZ.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&dZ.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:dZ}=Object.prototype,ui=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var Wi,zd,Fy,Ly,Uy,qy=y(()=>{Wi=t=>t,zd=()=>{},Fy=({contents:t})=>t,Ly=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},Uy=t=>t.length});async function By(t,e){return kc(t,_he,e)}var hhe,ghe,yhe,_he,pZ=y(()=>{Md();qy();hhe=()=>({contents:[]}),ghe=()=>1,yhe=(t,{contents:e})=>(e.push(t),e),_he={init:hhe,convertChunk:{string:Wi,buffer:Wi,arrayBuffer:Wi,dataView:Wi,typedArray:Wi,others:Wi},getSize:ghe,truncateChunk:zd,addChunk:yhe,getFinalChunk:zd,finalize:Fy}});async function Zy(t,e){return kc(t,Ahe,e)}var vhe,bhe,She,mZ,hZ,whe,xhe,$he,khe,yZ,gZ,Ehe,_Z,Ahe,vZ=y(()=>{Md();qy();vhe=()=>({contents:new ArrayBuffer(0)}),bhe=t=>She.encode(t),She=new TextEncoder,mZ=t=>new Uint8Array(t),hZ=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),whe=(t,e)=>t.slice(0,e),xhe=(t,{contents:e,length:r},n)=>{let i=_Z()?khe(e,n):$he(e,n);return new Uint8Array(i).set(t,r),i},$he=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(yZ(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},khe=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:yZ(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},yZ=t=>gZ**Math.ceil(Math.log(t)/Math.log(gZ)),gZ=2,Ehe=({contents:t,length:e})=>_Z()?t:t.slice(0,e),_Z=()=>"resize"in ArrayBuffer.prototype,Ahe={init:vhe,convertChunk:{string:bhe,buffer:mZ,arrayBuffer:mZ,dataView:hZ,typedArray:hZ,others:Ly},getSize:Uy,truncateChunk:whe,addChunk:xhe,getFinalChunk:zd,finalize:Ehe}});async function Gy(t,e){return kc(t,Rhe,e)}var The,Hy,Ohe,Phe,Ihe,Rhe,bZ=y(()=>{Md();qy();The=()=>({contents:"",textDecoder:new TextDecoder}),Hy=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),Ohe=(t,{contents:e})=>e+t,Phe=(t,e)=>t.slice(0,e),Ihe=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},Rhe={init:The,convertChunk:{string:Wi,buffer:Hy,arrayBuffer:Hy,dataView:Hy,typedArray:Hy,others:Ly},getSize:Uy,truncateChunk:Phe,addChunk:Ohe,getFinalChunk:Ihe,finalize:Fy}});var SZ=y(()=>{pZ();vZ();bZ();Md()});import{on as Che}from"node:events";import{finished as Dhe}from"node:stream/promises";var Vy=y(()=>{pT();SZ();Object.assign(jd,{on:Che,finished:Dhe})});var wZ,Nhe,xZ,$Z,jhe,kZ,EZ,Wy,Vs=y(()=>{Vy();Hi();Vi();wZ=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof ui))throw t;if(o==="all")return t;let s=Nhe(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},Nhe=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",xZ=(t,e,r)=>{if(e.length!==r)return;let n=new ui;throw n.maxBufferInfo={fdNumber:"ipc"},n},$Z=(t,e)=>{let{streamName:r,threshold:n,unit:i}=jhe(t,e);return`Command's ${r} was larger than ${n} ${i}`},jhe=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=Gi(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:ey(r),threshold:i,unit:n}},kZ=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>Wy(r)),EZ=(t,e,r)=>{if(!e)return t;let n=Wy(r);return t.length>n?t.slice(0,n):t},Wy=([,t])=>t});import{inspect as Mhe}from"node:util";var TZ,zhe,Fhe,Lhe,Uhe,qhe,AZ,OZ=y(()=>{aT();Ur();iT();ny();Vs();Id();qs();TZ=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:b})=>{let _=n?.code,x=zhe({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),$=Lhe(n,b),w=$===void 0?"":` -${$}`,R=`${x}: ${a}${w}`,O=e===void 0?[t[2],t[1]]:[e],A=[R,...O,...t.slice(3),r.map(N=>Uhe(N)).join(` -`)].map(N=>Ad($c(qhe(N)))).filter(Boolean).join(` - -`);return{originalMessage:$,shortMessage:R,message:A}},zhe=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=Fhe(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${$Z(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${gy(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},Fhe=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",Lhe=(t,e)=>{if(t instanceof Dn)return;let r=H6(t)?t.originalMessage:String(t?.message??t),n=Ad(QB(r,e));return n===""?void 0:n},Uhe=t=>typeof t=="string"?t:Mhe(t),qhe=t=>Array.isArray(t)?t.map(e=>$c(AZ(e))).filter(Boolean).join(` -`):AZ(t),AZ=t=>typeof t=="string"?t:Nt(t)?Xg(t):""});var Ky,Ec,Fd,Bhe,PZ,Zhe,Ld=y(()=>{Id();ly();qs();OZ();Ky=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>PZ({command:t,escapedCommand:e,cwd:o,durationMs:PA(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),Ec=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>Fd({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),Fd=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:x},isSync:$})=>{let{exitCode:w,signal:R,signalDescription:O}=Zhe(l,u),{originalMessage:A,shortMessage:N,message:k}=TZ({stdio:d,all:f,ipcOutput:p,originalError:t,signal:R,signalDescription:O,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:x,timeout:h,cwd:_}),Z=B6(t,k,$);return Object.assign(Z,Bhe({error:Z,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:R,signalDescription:O,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:N})),Z},Bhe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>PZ({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:PA(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),PZ=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Zhe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:gy(e);return{exitCode:r,signal:n,signalDescription:i}}});function Hhe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(IZ(t*1e3)%1e3),nanoseconds:Math.trunc(IZ(t*1e6)%1e3)}}function Ghe(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function mT(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Hhe(t);break}case"bigint":return Ghe(t)}throw new TypeError("Expected a finite number or bigint")}var IZ,RZ=y(()=>{IZ=t=>Number.isFinite(t)?t:0});function hT(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+Khe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&Vhe(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+Whe(d,u):f;i.push(p)}},a=mT(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%Jhe):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var Vhe,Whe,Khe,Jhe,CZ=y(()=>{RZ();Vhe=t=>t===0||t===0n,Whe=(t,e)=>e===1||e===1n?t:`${t}s`,Khe=1e-7,Jhe=24n*60n*60n*1000n});var DZ,NZ=y(()=>{gc();DZ=(t,e)=>{t.failed&&ai({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var jZ,Yhe,MZ=y(()=>{CZ();Ro();gc();NZ();jZ=(t,e)=>{mc(e)&&(DZ(t,e),Yhe(t,e))},Yhe=(t,e)=>{let r=`(done in ${hT(t.durationMs)})`;ai({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Ac,Jy=y(()=>{MZ();Ac=(t,e,{reject:r})=>{if(jZ(t,e),t.failed&&r)throw t;return t}});var LZ,Xhe,Qhe,UZ,qZ,zZ,ege,gT,FZ,Ws,BZ,tge,Yy,ZZ,rge,nge,yT,HZ,ige,GZ,Xy,oge,_T,sge,age,VZ,dn,Qy,vT,WZ,KZ,jo,ur=y(()=>{Gs();Bi();Ur();LZ=(t,e)=>Ws(t)?"asyncGenerator":BZ(t)?"generator":Yy(t)?"fileUrl":rge(t)?"filePath":oge(t)?"webStream":jn(t,{checkOpen:!1})?"native":Nt(t)?"uint8Array":sge(t)?"asyncIterable":age(t)?"iterable":_T(t)?UZ({transform:t},e):tge(t)?Xhe(t,e):"native",Xhe=(t,e)=>lT(t.transform,{checkOpen:!1})?Qhe(t,e):_T(t.transform)?UZ(t,e):ege(t,e),Qhe=(t,e)=>(qZ(t,e,"Duplex stream"),"duplex"),UZ=(t,e)=>(qZ(t,e,"web TransformStream"),"webTransform"),qZ=({final:t,binary:e,objectMode:r},n,i)=>{zZ(t,`${n}.final`,i),zZ(e,`${n}.binary`,i),gT(r,`${n}.objectMode`)},zZ=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},ege=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!FZ(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(lT(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(_T(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!FZ(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return gT(r,`${i}.binary`),gT(n,`${i}.objectMode`),Ws(t)||Ws(e)?"asyncGenerator":"generator"},gT=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},FZ=t=>Ws(t)||BZ(t),Ws=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",BZ=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",tge=t=>wt(t)&&(t.transform!==void 0||t.final!==void 0),Yy=t=>Object.prototype.toString.call(t)==="[object URL]",ZZ=t=>Yy(t)&&t.protocol!=="file:",rge=t=>wt(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>nge.has(e))&&yT(t.file),nge=new Set(["file","append"]),yT=t=>typeof t=="string",HZ=(t,e)=>t==="native"&&typeof e=="string"&&!ige.has(e),ige=new Set(["ipc","ignore","inherit","overlapped","pipe"]),GZ=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Xy=t=>Object.prototype.toString.call(t)==="[object WritableStream]",oge=t=>GZ(t)||Xy(t),_T=t=>GZ(t?.readable)&&Xy(t?.writable),sge=t=>VZ(t)&&typeof t[Symbol.asyncIterator]=="function",age=t=>VZ(t)&&typeof t[Symbol.iterator]=="function",VZ=t=>typeof t=="object"&&t!==null,dn=new Set(["generator","asyncGenerator","duplex","webTransform"]),Qy=new Set(["fileUrl","filePath","fileNumber"]),vT=new Set(["fileUrl","filePath"]),WZ=new Set([...vT,"webStream","nodeStream"]),KZ=new Set(["webTransform","duplex"]),jo={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 bT,cge,lge,JZ,ST=y(()=>{ur();bT=(t,e,r,n)=>n==="output"?cge(t,e,r):lge(t,e,r),cge=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},lge=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},JZ=(t,e)=>{let r=t.findLast(({type:n})=>dn.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var YZ,uge,dge,fge,pge,mge,hge,XZ=y(()=>{Bi();Zs();ur();ST();YZ=(t,e,r,n)=>[...t.filter(({type:i})=>!dn.has(i)),...uge(t,e,r,n)],uge=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>dn.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=dge({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return hge(o,r)},dge=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?fge({stdioItem:t,optionName:i}):e==="webTransform"?pge({stdioItem:t,index:r,newTransforms:n,direction:o}):mge({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),fge=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},pge=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=wt(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=bT(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},mge=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=wt(e)?e:{transform:e},d=c||qr.has(o),{writableObjectMode:f,readableObjectMode:p}=bT(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},hge=(t,e)=>e==="input"?t.reverse():t});import wT from"node:process";var QZ,gge,yge,Tc,xT,eH,_ge,vge,tH=y(()=>{Gs();ur();QZ=(t,e,r)=>{let n=t.map(i=>gge(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??vge},gge=({type:t,value:e},r)=>yge[r]??eH[t](e),yge=["input","output","output"],Tc=()=>{},xT=()=>"input",eH={generator:Tc,asyncGenerator:Tc,fileUrl:Tc,filePath:Tc,iterable:xT,asyncIterable:xT,uint8Array:xT,webStream:t=>Xy(t)?"output":"input",nodeStream(t){return Hs(t,{checkOpen:!1})?cT(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Tc,duplex:Tc,native(t){let e=_ge(t);if(e!==void 0)return e;if(jn(t,{checkOpen:!1}))return eH.nodeStream(t)}},_ge=t=>{if([0,wT.stdin].includes(t))return"input";if([1,2,wT.stdout,wT.stderr].includes(t))return"output"},vge="output"});var rH,nH=y(()=>{rH=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var iH,bge,Sge,oH,wge,xge,sH=y(()=>{Hi();nH();Ro();iH=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=bge(t,n).map((a,c)=>oH(a,c));return o?wge(s,r,i):rH(s,e)},bge=(t,e)=>{if(t===void 0)return un.map(n=>e[n]);if(Sge(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${un.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,un.length);return Array.from({length:r},(n,i)=>t[i])},Sge=t=>un.some(e=>t[e]!==void 0),oH=(t,e)=>Array.isArray(t)?t.map(r=>oH(r,e)):t??(e>=un.length?"ignore":"pipe"),wge=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!hc(r,i)&&xge(n)?"ignore":n),xge=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as $ge}from"node:fs";import kge from"node:tty";var cH,Ege,Age,Tge,Oge,aH,lH=y(()=>{Gs();Hi();Ur();Do();cH=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?Ege({stdioItem:t,fdNumber:n,direction:i}):Oge({stdioItem:t,fdNumber:n}),Ege=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=Age({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(jn(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Age=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=Tge(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(kge.isatty(i))throw new TypeError(`The \`${e}: ${by(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Zi($ge(i)),optionName:e}}},Tge=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=Qg.indexOf(t);if(r!==-1)return r},Oge=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:aH(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:aH(e,e,r),optionName:r}:jn(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,aH=(t,e,r)=>{let n=Qg[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var uH,Pge,Ige,Rge,Cge,dH=y(()=>{Gs();Ur();ur();uH=({input:t,inputFile:e},r)=>r===0?[...Pge(t),...Rge(e)]:[],Pge=t=>t===void 0?[]:[{type:Ige(t),value:t,optionName:"input"}],Ige=t=>{if(Hs(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(Nt(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Rge=t=>t===void 0?[]:[{...Cge(t),optionName:"inputFile"}],Cge=t=>{if(Yy(t))return{type:"fileUrl",value:t};if(yT(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var fH,pH,Dge,Nge,mH,jge,Mge,hH,gH=y(()=>{ur();fH=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),pH=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=Dge(i,t);if(s.length!==0){if(o){Nge({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(WZ.has(t))return mH({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});KZ.has(t)&&Mge({otherStdioItems:s,type:t,value:e,optionName:r})}},Dge=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),Nge=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{vT.has(e)&&mH({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},mH=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>jge(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return hH(s,n,e),i==="output"?o[0].stream:void 0},jge=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,Mge=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);hH(i,n,e)},hH=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${jo[r]} that is the same.`)}});var e_,zge,Fge,Lge,Uge,qge,Bge,Zge,Hge,Gge,Vge,Wge,$T,Kge,t_=y(()=>{Hi();XZ();ST();ur();tH();sH();lH();dH();gH();e_=(t,e,r,n)=>{let o=iH(e,r,n).map((a,c)=>zge({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=Gge({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>Kge(a)),s},zge=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=ey(e),{stdioItems:o,isStdioArray:s}=Fge({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=QZ(o,e,i),c=o.map(d=>cH({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=YZ(c,i,a,r),u=JZ(l,a);return Hge(l,u),{direction:a,objectMode:u,stdioItems:l}},Fge=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>Lge(c,n)),...uH(r,e)],s=fH(o),a=s.length>1;return Uge(s,a,n),Bge(s),{stdioItems:s,isStdioArray:a}},Lge=(t,e)=>({type:LZ(t,e),value:t,optionName:e}),Uge=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(qge.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},qge=new Set(["ignore","ipc"]),Bge=t=>{for(let e of t)Zge(e)},Zge=({type:t,value:e,optionName:r})=>{if(ZZ(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. -For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(HZ(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},Hge=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Qy.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},Gge=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push(Vge({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw $T(i),o}},Vge=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>Wge({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},Wge=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=pH({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},$T=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Cn(r)&&r.destroy()},Kge=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as yH}from"node:fs";var vH,di,Jge,bH,_H,Yge,SH=y(()=>{Ur();t_();ur();vH=(t,e)=>e_(Yge,t,e,!0),di=({type:t,optionName:e})=>{bH(e,jo[t])},Jge=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&bH(t,`"${e}"`),{}),bH=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},_H={generator(){},asyncGenerator:di,webStream:di,nodeStream:di,webTransform:di,duplex:di,asyncIterable:di,native:Jge},Yge={input:{..._H,fileUrl:({value:t})=>({contents:[Zi(yH(t))]}),filePath:({value:{file:t}})=>({contents:[Zi(yH(t))]}),fileNumber:di,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{..._H,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:di,string:di,uint8Array:di}}});var Ki,kT,Ud=y(()=>{aT();Ki=(t,{stripFinalNewline:e},r)=>kT(e,r)&&t!==void 0&&!Array.isArray(t)?$c(t):t,kT=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var r_,AT,wH,xH,Xge,Qge,eye,$H,tye,ET,rye,nye,iye,n_=y(()=>{r_=(t,e,r,n)=>t||r?void 0:xH(e,n),AT=(t,e,r)=>r?t.flatMap(n=>wH(n,e)):wH(t,e),wH=(t,e)=>{let{transform:r,final:n}=xH(e,{});return[...r(t),...n()]},xH=(t,e)=>(e.previousChunks="",{transform:Xge.bind(void 0,e,t),final:eye.bind(void 0,e)}),Xge=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=ET(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=ET(n,r.slice(i+1))),t.previousChunks=n},Qge=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),eye=function*({previousChunks:t}){t.length>0&&(yield t)},$H=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:tye.bind(void 0,n)},tye=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?rye:iye;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},ET=(t,e)=>`${t}${e}`,rye={windowsNewline:`\r +${t}`}});import ohe from"node:path";import eZ from"node:process";var tZ,My,she,ahe,oT=y(()=>{tZ=St(N6(),1);q6();yy();Id();HA();QA();eT();tT();rT();Hs();iT();pc();Vi();My=(t,e,r)=>{r.cwd=YB(r.cwd);let[n,i,o]=GB(t,e,r),{command:s,args:a,options:c}=tZ.default._parse(n,i,o),l=$4(c),u=she(l);return qB(u),JB(u),VB(u),cB(u),LB(u),u.shell=bA(u.shell),u.env=ahe(u),u.killSignal=nB(u.killSignal),u.forceKillAfterDelay=sB(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!qr.has(u.encoding)&&u.buffer[f]),eZ.platform==="win32"&&ohe.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},she=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),ahe=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...eZ.env,...t}:t;return r||n?U6({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var zy,sT=y(()=>{zy=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function $c(t){if(typeof t=="string")return che(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return lhe(t)}var che,lhe,rZ,uhe,nZ,dhe,aT=y(()=>{che=t=>t.at(-1)===rZ?t.slice(0,t.at(-2)===nZ?-2:-1):t,lhe=t=>t.at(-1)===uhe?t.subarray(0,t.at(-2)===dhe?-2:-1):t,rZ=` +`,uhe=rZ.codePointAt(0),nZ="\r",dhe=nZ.codePointAt(0)});function jn(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function cT(t,{checkOpen:e=!0}={}){return jn(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Gs(t,{checkOpen:e=!0}={}){return jn(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function lT(t,e){return cT(t,e)&&Gs(t,e)}var Vs=y(()=>{});function iZ(){return this[dT].next()}function oZ(t){return this[dT].return(t)}function fT({preventCancel:t=!1}={}){let e=this.getReader(),r=new uT(e,t),n=Object.create(phe);return n[dT]=r,n}var fhe,uT,dT,phe,sZ=y(()=>{fhe=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),uT=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},dT=Symbol();Object.defineProperty(iZ,"name",{value:"next"});Object.defineProperty(oZ,"name",{value:"return"});phe=Object.create(fhe,{next:{enumerable:!0,configurable:!0,writable:!0,value:iZ},return:{enumerable:!0,configurable:!0,writable:!0,value:oZ}})});var aZ=y(()=>{});var cZ=y(()=>{sZ();aZ()});var lZ,mhe,hhe,ghe,jd,pT=y(()=>{Vs();cZ();lZ=t=>{if(Gs(t,{checkOpen:!1})&&jd.on!==void 0)return hhe(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(mhe.call(t)==="[object ReadableStream]")return fT.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:mhe}=Object.prototype,hhe=async function*(t){let e=new AbortController,r={};ghe(t,e,r);try{for await(let[n]of jd.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},ghe=async(t,e,r)=>{try{await jd.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},jd={}});var kc,yhe,fZ,uZ,_he,dZ,ui,Md=y(()=>{pT();kc=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=lZ(t),u=e();u.length=0;try{for await(let d of l){let f=_he(d),p=r[f](d,u);fZ({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return yhe({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},yhe=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&fZ({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},fZ=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){uZ(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&uZ(c,e,i,o),new ui},uZ=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},_he=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=dZ.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&dZ.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:dZ}=Object.prototype,ui=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var Wi,zd,Fy,Ly,Uy,qy=y(()=>{Wi=t=>t,zd=()=>{},Fy=({contents:t})=>t,Ly=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},Uy=t=>t.length});async function By(t,e){return kc(t,whe,e)}var vhe,bhe,She,whe,pZ=y(()=>{Md();qy();vhe=()=>({contents:[]}),bhe=()=>1,She=(t,{contents:e})=>(e.push(t),e),whe={init:vhe,convertChunk:{string:Wi,buffer:Wi,arrayBuffer:Wi,dataView:Wi,typedArray:Wi,others:Wi},getSize:bhe,truncateChunk:zd,addChunk:She,getFinalChunk:zd,finalize:Fy}});async function Zy(t,e){return kc(t,Ihe,e)}var xhe,$he,khe,mZ,hZ,Ehe,Ahe,The,Ohe,yZ,gZ,Phe,_Z,Ihe,vZ=y(()=>{Md();qy();xhe=()=>({contents:new ArrayBuffer(0)}),$he=t=>khe.encode(t),khe=new TextEncoder,mZ=t=>new Uint8Array(t),hZ=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Ehe=(t,e)=>t.slice(0,e),Ahe=(t,{contents:e,length:r},n)=>{let i=_Z()?Ohe(e,n):The(e,n);return new Uint8Array(i).set(t,r),i},The=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(yZ(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},Ohe=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:yZ(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},yZ=t=>gZ**Math.ceil(Math.log(t)/Math.log(gZ)),gZ=2,Phe=({contents:t,length:e})=>_Z()?t:t.slice(0,e),_Z=()=>"resize"in ArrayBuffer.prototype,Ihe={init:xhe,convertChunk:{string:$he,buffer:mZ,arrayBuffer:mZ,dataView:hZ,typedArray:hZ,others:Ly},getSize:Uy,truncateChunk:Ehe,addChunk:Ahe,getFinalChunk:zd,finalize:Phe}});async function Gy(t,e){return kc(t,jhe,e)}var Rhe,Hy,Che,Dhe,Nhe,jhe,bZ=y(()=>{Md();qy();Rhe=()=>({contents:"",textDecoder:new TextDecoder}),Hy=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),Che=(t,{contents:e})=>e+t,Dhe=(t,e)=>t.slice(0,e),Nhe=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},jhe={init:Rhe,convertChunk:{string:Wi,buffer:Hy,arrayBuffer:Hy,dataView:Hy,typedArray:Hy,others:Ly},getSize:Uy,truncateChunk:Dhe,addChunk:Che,getFinalChunk:Nhe,finalize:Fy}});var SZ=y(()=>{pZ();vZ();bZ();Md()});import{on as Mhe}from"node:events";import{finished as zhe}from"node:stream/promises";var Vy=y(()=>{pT();SZ();Object.assign(jd,{on:Mhe,finished:zhe})});var wZ,Fhe,xZ,$Z,Lhe,kZ,EZ,Wy,Ws=y(()=>{Vy();Hi();Vi();wZ=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof ui))throw t;if(o==="all")return t;let s=Fhe(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},Fhe=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",xZ=(t,e,r)=>{if(e.length!==r)return;let n=new ui;throw n.maxBufferInfo={fdNumber:"ipc"},n},$Z=(t,e)=>{let{streamName:r,threshold:n,unit:i}=Lhe(t,e);return`Command's ${r} was larger than ${n} ${i}`},Lhe=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=Gi(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:ey(r),threshold:i,unit:n}},kZ=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>Wy(r)),EZ=(t,e,r)=>{if(!e)return t;let n=Wy(r);return t.length>n?t.slice(0,n):t},Wy=([,t])=>t});import{inspect as Uhe}from"node:util";var TZ,qhe,Bhe,Zhe,Hhe,Ghe,AZ,OZ=y(()=>{aT();Ur();iT();ny();Ws();Id();Bs();TZ=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:b})=>{let _=n?.code,x=qhe({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),$=Zhe(n,b),w=$===void 0?"":` +${$}`,R=`${x}: ${a}${w}`,O=e===void 0?[t[2],t[1]]:[e],A=[R,...O,...t.slice(3),r.map(N=>Hhe(N)).join(` +`)].map(N=>Ad($c(Ghe(N)))).filter(Boolean).join(` + +`);return{originalMessage:$,shortMessage:R,message:A}},qhe=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=Bhe(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${$Z(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${gy(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},Bhe=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",Zhe=(t,e)=>{if(t instanceof Dn)return;let r=H6(t)?t.originalMessage:String(t?.message??t),n=Ad(QB(r,e));return n===""?void 0:n},Hhe=t=>typeof t=="string"?t:Uhe(t),Ghe=t=>Array.isArray(t)?t.map(e=>$c(AZ(e))).filter(Boolean).join(` +`):AZ(t),AZ=t=>typeof t=="string"?t:Nt(t)?Xg(t):""});var Ky,Ec,Fd,Vhe,PZ,Whe,Ld=y(()=>{Id();ly();Bs();OZ();Ky=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>PZ({command:t,escapedCommand:e,cwd:o,durationMs:PA(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),Ec=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>Fd({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),Fd=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:x},isSync:$})=>{let{exitCode:w,signal:R,signalDescription:O}=Whe(l,u),{originalMessage:A,shortMessage:N,message:k}=TZ({stdio:d,all:f,ipcOutput:p,originalError:t,signal:R,signalDescription:O,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:x,timeout:h,cwd:_}),Z=B6(t,k,$);return Object.assign(Z,Vhe({error:Z,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:R,signalDescription:O,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:A,shortMessage:N})),Z},Vhe=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>PZ({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:PA(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),PZ=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Whe=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:gy(e);return{exitCode:r,signal:n,signalDescription:i}}});function Khe(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(IZ(t*1e3)%1e3),nanoseconds:Math.trunc(IZ(t*1e6)%1e3)}}function Jhe(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function mT(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Khe(t);break}case"bigint":return Jhe(t)}throw new TypeError("Expected a finite number or bigint")}var IZ,RZ=y(()=>{IZ=t=>Number.isFinite(t)?t:0});function hT(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+Qhe);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&Yhe(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+Xhe(d,u):f;i.push(p)}},a=mT(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%ege):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var Yhe,Xhe,Qhe,ege,CZ=y(()=>{RZ();Yhe=t=>t===0||t===0n,Xhe=(t,e)=>e===1||e===1n?t:`${t}s`,Qhe=1e-7,ege=24n*60n*60n*1000n});var DZ,NZ=y(()=>{gc();DZ=(t,e)=>{t.failed&&ai({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var jZ,tge,MZ=y(()=>{CZ();Co();gc();NZ();jZ=(t,e)=>{mc(e)&&(DZ(t,e),tge(t,e))},tge=(t,e)=>{let r=`(done in ${hT(t.durationMs)})`;ai({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Ac,Jy=y(()=>{MZ();Ac=(t,e,{reject:r})=>{if(jZ(t,e),t.failed&&r)throw t;return t}});var LZ,rge,nge,UZ,qZ,zZ,ige,gT,FZ,Ks,BZ,oge,Yy,ZZ,sge,age,yT,HZ,cge,GZ,Xy,lge,_T,uge,dge,VZ,dn,Qy,vT,WZ,KZ,Mo,ur=y(()=>{Vs();Bi();Ur();LZ=(t,e)=>Ks(t)?"asyncGenerator":BZ(t)?"generator":Yy(t)?"fileUrl":sge(t)?"filePath":lge(t)?"webStream":jn(t,{checkOpen:!1})?"native":Nt(t)?"uint8Array":uge(t)?"asyncIterable":dge(t)?"iterable":_T(t)?UZ({transform:t},e):oge(t)?rge(t,e):"native",rge=(t,e)=>lT(t.transform,{checkOpen:!1})?nge(t,e):_T(t.transform)?UZ(t,e):ige(t,e),nge=(t,e)=>(qZ(t,e,"Duplex stream"),"duplex"),UZ=(t,e)=>(qZ(t,e,"web TransformStream"),"webTransform"),qZ=({final:t,binary:e,objectMode:r},n,i)=>{zZ(t,`${n}.final`,i),zZ(e,`${n}.binary`,i),gT(r,`${n}.objectMode`)},zZ=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},ige=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!FZ(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(lT(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(_T(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!FZ(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return gT(r,`${i}.binary`),gT(n,`${i}.objectMode`),Ks(t)||Ks(e)?"asyncGenerator":"generator"},gT=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},FZ=t=>Ks(t)||BZ(t),Ks=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",BZ=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",oge=t=>wt(t)&&(t.transform!==void 0||t.final!==void 0),Yy=t=>Object.prototype.toString.call(t)==="[object URL]",ZZ=t=>Yy(t)&&t.protocol!=="file:",sge=t=>wt(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>age.has(e))&&yT(t.file),age=new Set(["file","append"]),yT=t=>typeof t=="string",HZ=(t,e)=>t==="native"&&typeof e=="string"&&!cge.has(e),cge=new Set(["ipc","ignore","inherit","overlapped","pipe"]),GZ=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Xy=t=>Object.prototype.toString.call(t)==="[object WritableStream]",lge=t=>GZ(t)||Xy(t),_T=t=>GZ(t?.readable)&&Xy(t?.writable),uge=t=>VZ(t)&&typeof t[Symbol.asyncIterator]=="function",dge=t=>VZ(t)&&typeof t[Symbol.iterator]=="function",VZ=t=>typeof t=="object"&&t!==null,dn=new Set(["generator","asyncGenerator","duplex","webTransform"]),Qy=new Set(["fileUrl","filePath","fileNumber"]),vT=new Set(["fileUrl","filePath"]),WZ=new Set([...vT,"webStream","nodeStream"]),KZ=new Set(["webTransform","duplex"]),Mo={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 bT,fge,pge,JZ,ST=y(()=>{ur();bT=(t,e,r,n)=>n==="output"?fge(t,e,r):pge(t,e,r),fge=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},pge=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},JZ=(t,e)=>{let r=t.findLast(({type:n})=>dn.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var YZ,mge,hge,gge,yge,_ge,vge,XZ=y(()=>{Bi();Hs();ur();ST();YZ=(t,e,r,n)=>[...t.filter(({type:i})=>!dn.has(i)),...mge(t,e,r,n)],mge=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>dn.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=hge({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return vge(o,r)},hge=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?gge({stdioItem:t,optionName:i}):e==="webTransform"?yge({stdioItem:t,index:r,newTransforms:n,direction:o}):_ge({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),gge=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},yge=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=wt(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=bT(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},_ge=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=wt(e)?e:{transform:e},d=c||qr.has(o),{writableObjectMode:f,readableObjectMode:p}=bT(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},vge=(t,e)=>e==="input"?t.reverse():t});import wT from"node:process";var QZ,bge,Sge,Tc,xT,eH,wge,xge,tH=y(()=>{Vs();ur();QZ=(t,e,r)=>{let n=t.map(i=>bge(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??xge},bge=({type:t,value:e},r)=>Sge[r]??eH[t](e),Sge=["input","output","output"],Tc=()=>{},xT=()=>"input",eH={generator:Tc,asyncGenerator:Tc,fileUrl:Tc,filePath:Tc,iterable:xT,asyncIterable:xT,uint8Array:xT,webStream:t=>Xy(t)?"output":"input",nodeStream(t){return Gs(t,{checkOpen:!1})?cT(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Tc,duplex:Tc,native(t){let e=wge(t);if(e!==void 0)return e;if(jn(t,{checkOpen:!1}))return eH.nodeStream(t)}},wge=t=>{if([0,wT.stdin].includes(t))return"input";if([1,2,wT.stdout,wT.stderr].includes(t))return"output"},xge="output"});var rH,nH=y(()=>{rH=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var iH,$ge,kge,oH,Ege,Age,sH=y(()=>{Hi();nH();Co();iH=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=$ge(t,n).map((a,c)=>oH(a,c));return o?Ege(s,r,i):rH(s,e)},$ge=(t,e)=>{if(t===void 0)return un.map(n=>e[n]);if(kge(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${un.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,un.length);return Array.from({length:r},(n,i)=>t[i])},kge=t=>un.some(e=>t[e]!==void 0),oH=(t,e)=>Array.isArray(t)?t.map(r=>oH(r,e)):t??(e>=un.length?"ignore":"pipe"),Ege=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!hc(r,i)&&Age(n)?"ignore":n),Age=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as Tge}from"node:fs";import Oge from"node:tty";var cH,Pge,Ige,Rge,Cge,aH,lH=y(()=>{Vs();Hi();Ur();No();cH=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?Pge({stdioItem:t,fdNumber:n,direction:i}):Cge({stdioItem:t,fdNumber:n}),Pge=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=Ige({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(jn(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Ige=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=Rge(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(Oge.isatty(i))throw new TypeError(`The \`${e}: ${by(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Zi(Tge(i)),optionName:e}}},Rge=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=Qg.indexOf(t);if(r!==-1)return r},Cge=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:aH(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:aH(e,e,r),optionName:r}:jn(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,aH=(t,e,r)=>{let n=Qg[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var uH,Dge,Nge,jge,Mge,dH=y(()=>{Vs();Ur();ur();uH=({input:t,inputFile:e},r)=>r===0?[...Dge(t),...jge(e)]:[],Dge=t=>t===void 0?[]:[{type:Nge(t),value:t,optionName:"input"}],Nge=t=>{if(Gs(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(Nt(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},jge=t=>t===void 0?[]:[{...Mge(t),optionName:"inputFile"}],Mge=t=>{if(Yy(t))return{type:"fileUrl",value:t};if(yT(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var fH,pH,zge,Fge,mH,Lge,Uge,hH,gH=y(()=>{ur();fH=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),pH=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=zge(i,t);if(s.length!==0){if(o){Fge({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(WZ.has(t))return mH({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});KZ.has(t)&&Uge({otherStdioItems:s,type:t,value:e,optionName:r})}},zge=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),Fge=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{vT.has(e)&&mH({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},mH=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>Lge(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return hH(s,n,e),i==="output"?o[0].stream:void 0},Lge=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,Uge=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);hH(i,n,e)},hH=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${Mo[r]} that is the same.`)}});var e_,qge,Bge,Zge,Hge,Gge,Vge,Wge,Kge,Jge,Yge,Xge,$T,Qge,t_=y(()=>{Hi();XZ();ST();ur();tH();sH();lH();dH();gH();e_=(t,e,r,n)=>{let o=iH(e,r,n).map((a,c)=>qge({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=Jge({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>Qge(a)),s},qge=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=ey(e),{stdioItems:o,isStdioArray:s}=Bge({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=QZ(o,e,i),c=o.map(d=>cH({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=YZ(c,i,a,r),u=JZ(l,a);return Kge(l,u),{direction:a,objectMode:u,stdioItems:l}},Bge=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>Zge(c,n)),...uH(r,e)],s=fH(o),a=s.length>1;return Hge(s,a,n),Vge(s),{stdioItems:s,isStdioArray:a}},Zge=(t,e)=>({type:LZ(t,e),value:t,optionName:e}),Hge=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(Gge.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},Gge=new Set(["ignore","ipc"]),Vge=t=>{for(let e of t)Wge(e)},Wge=({type:t,value:e,optionName:r})=>{if(ZZ(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. +For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(HZ(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},Kge=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Qy.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},Jge=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push(Yge({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw $T(i),o}},Yge=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>Xge({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},Xge=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=pH({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},$T=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Cn(r)&&r.destroy()},Qge=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as yH}from"node:fs";var vH,di,eye,bH,_H,tye,SH=y(()=>{Ur();t_();ur();vH=(t,e)=>e_(tye,t,e,!0),di=({type:t,optionName:e})=>{bH(e,Mo[t])},eye=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&bH(t,`"${e}"`),{}),bH=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},_H={generator(){},asyncGenerator:di,webStream:di,nodeStream:di,webTransform:di,duplex:di,asyncIterable:di,native:eye},tye={input:{..._H,fileUrl:({value:t})=>({contents:[Zi(yH(t))]}),filePath:({value:{file:t}})=>({contents:[Zi(yH(t))]}),fileNumber:di,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{..._H,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:di,string:di,uint8Array:di}}});var Ki,kT,Ud=y(()=>{aT();Ki=(t,{stripFinalNewline:e},r)=>kT(e,r)&&t!==void 0&&!Array.isArray(t)?$c(t):t,kT=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var r_,AT,wH,xH,rye,nye,iye,$H,oye,ET,sye,aye,cye,n_=y(()=>{r_=(t,e,r,n)=>t||r?void 0:xH(e,n),AT=(t,e,r)=>r?t.flatMap(n=>wH(n,e)):wH(t,e),wH=(t,e)=>{let{transform:r,final:n}=xH(e,{});return[...r(t),...n()]},xH=(t,e)=>(e.previousChunks="",{transform:rye.bind(void 0,e,t),final:iye.bind(void 0,e)}),rye=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=ET(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=ET(n,r.slice(i+1))),t.previousChunks=n},nye=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),iye=function*({previousChunks:t}){t.length>0&&(yield t)},$H=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:oye.bind(void 0,n)},oye=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?sye:cye;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},ET=(t,e)=>`${t}${e}`,sye={windowsNewline:`\r `,unixNewline:` `,LF:` -`,concatBytes:ET},nye=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},iye={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:nye}});import{Buffer as oye}from"node:buffer";var kH,sye,EH,aye,cye,AH,TH=y(()=>{Ur();kH=(t,e)=>t?void 0:sye.bind(void 0,e),sye=function*(t,e){if(typeof e!="string"&&!Nt(e)&&!oye.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},EH=(t,e)=>t?aye.bind(void 0,e):cye.bind(void 0,e),aye=function*(t,e){AH(t,e),yield e},cye=function*(t,e){if(AH(t,e),typeof e!="string"&&!Nt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},AH=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. +`,concatBytes:ET},aye=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},cye={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:aye}});import{Buffer as lye}from"node:buffer";var kH,uye,EH,dye,fye,AH,TH=y(()=>{Ur();kH=(t,e)=>t?void 0:uye.bind(void 0,e),uye=function*(t,e){if(typeof e!="string"&&!Nt(e)&&!lye.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},EH=(t,e)=>t?dye.bind(void 0,e):fye.bind(void 0,e),dye=function*(t,e){AH(t,e),yield e},fye=function*(t,e){if(AH(t,e),typeof e!="string"&&!Nt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},AH=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. Instead, \`yield\` should either be called with a value, or not be called at all. For example: - if (condition) { yield value; }`)}});import{Buffer as lye}from"node:buffer";import{StringDecoder as uye}from"node:string_decoder";var i_,dye,fye,pye,TT=y(()=>{Ur();i_=(t,e,r)=>{if(r)return;if(t)return{transform:dye.bind(void 0,new TextEncoder)};let n=new uye(e);return{transform:fye.bind(void 0,n),final:pye.bind(void 0,n)}},dye=function*(t,e){lye.isBuffer(e)?yield Zi(e):typeof e=="string"?yield t.encode(e):yield e},fye=function*(t,e){yield Nt(e)?t.write(e):e},pye=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as OH}from"node:util";var OT,o_,PH,mye,IH,hye,RH=y(()=>{OT=OH(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),o_=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=hye}=e[r];for await(let i of n(t))yield*o_(i,e,r+1)},PH=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*mye(r,Number(e),t)},mye=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*o_(n,r,e+1)},IH=OH(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),hye=function*(t){yield t}});var PT,CH,Ks,qd,gye,yye,IT=y(()=>{PT=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},CH=(t,e)=>[...e.flatMap(r=>[...Ks(r,t,0)]),...qd(t)],Ks=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=yye}=e[r];for(let i of n(t))yield*Ks(i,e,r+1)},qd=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*gye(r,Number(e),t)},gye=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ks(n,r,e+1)},yye=function*(t){yield t}});import{Transform as _ye,getDefaultHighWaterMark as DH}from"node:stream";var RT,s_,NH,a_=y(()=>{ur();n_();TH();TT();RH();IT();RT=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=NH(t,s,o),l=Ws(e),u=Ws(r),d=l?OT.bind(void 0,o_,a):PT.bind(void 0,Ks),f=l||u?OT.bind(void 0,PH,a):PT.bind(void 0,qd),p=l||u?IH.bind(void 0,a):void 0;return{stream:new _ye({writableObjectMode:n,writableHighWaterMark:DH(n),readableObjectMode:i,readableHighWaterMark:DH(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},s_=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=NH(s,r,a);t=CH(c,t)}return t},NH=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:kH(n,a)},i_(r,s,n),r_(r,o,n,c),{transform:t,final:e},{transform:EH(i,a)},$H({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var jH,vye,bye,Sye,wye,MH=y(()=>{a_();Ur();ur();jH=(t,e)=>{for(let r of vye(t))bye(t,r,e)},vye=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),bye=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${jo[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>Sye(a,n));r.input=Ed(s)},Sye=(t,e)=>{let r=s_(t,e,"utf8",!0);return wye(r),Ed(r)},wye=t=>{let e=t.find(r=>typeof r!="string"&&!Nt(r));if(e!==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: ${e}.`)}});var c_,xye,$ye,zH,FH,kye,LH,CT=y(()=>{Zs();ur();gc();Ro();c_=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&hc(r,n)&&!qr.has(e)&&xye(n)&&(t.some(({type:i,value:o})=>i==="native"&&$ye.has(o))||t.every(({type:i})=>dn.has(i))),xye=t=>t===1||t===2,$ye=new Set(["pipe","overlapped"]),zH=async(t,e,r,n)=>{for await(let i of t)kye(e)||LH(i,r,n)},FH=(t,e,r)=>{for(let n of t)LH(n,e,r)},kye=t=>t._readableState.pipes.length>0,LH=(t,e,r)=>{let n=ay(t);ai({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as Eye,appendFileSync as Aye}from"node:fs";var UH,Tye,Oye,Pye,Iye,Rye,qH=y(()=>{CT();a_();n_();Ur();ur();Vs();UH=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>Tye({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},Tye=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=EZ(t,o,d),p=Zi(f),{stdioItems:m,objectMode:h}=e[r],g=Oye([p],m,c,n),{serializedResult:b,finalResult:_=b}=Pye({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});Iye({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let x=a[r]?_:void 0;try{return n.error===void 0&&Rye(b,m,i),x}catch($){return n.error=$,x}},Oye=(t,e,r,n)=>{try{return s_(t,e,r,!1)}catch(i){return n.error=i,t}},Pye=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Ed(t)};let s=g4(t,r);return n[o]?{serializedResult:s,finalResult:AT(s,!i[o],e)}:{serializedResult:s}},Iye=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!c_({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=AT(t,!1,s);try{FH(a,e,n)}catch(c){r.error??=c}},Rye=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Qy.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?Aye(n,t):(r.add(o),Eye(n,t))}}});var BH,ZH=y(()=>{Ur();Ud();BH=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Ki(e,r,"all")]:Array.isArray(e)?[Ki(t,r,"all"),...e]:Nt(t)&&Nt(e)?wA([t,e]):`${t}${e}`}});import{once as DT}from"node:events";var HH,Cye,GH,VH,Dye,NT,jT=y(()=>{qs();HH=async(t,e)=>{let[r,n]=await Cye(t);return e.isForcefullyTerminated??=!1,[r,n]},Cye=async t=>{let[e,r]=await Promise.allSettled([DT(t,"spawn"),DT(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?GH(t):r.value},GH=async t=>{try{return await DT(t,"exit")}catch{return GH(t)}},VH=async t=>{let[e,r]=await t;if(!Dye(e,r)&&NT(e,r))throw new Dn;return[e,r]},Dye=(t,e)=>t===void 0&&e===void 0,NT=(t,e)=>t!==0||e!==null});var WH,Nye,KH=y(()=>{qs();Vs();jT();WH=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=Nye(t,e,r),s=o?.code==="ETIMEDOUT",a=kZ(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},Nye=(t,e,r)=>t!==void 0?t:NT(e,r)?new Dn:void 0});import{spawnSync as jye}from"node:child_process";var JH,Mye,zye,Fye,l_,Lye,Uye,qye,Bye,YH=y(()=>{IA();oT();sT();Ld();Jy();SH();Ud();MH();qH();Vs();ZH();KH();JH=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=Mye(t,e,r),d=Lye({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Ac(d,c,l)},Mye=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=uy(t,e,r),a=zye(r),{file:c,commandArguments:l,options:u}=My(t,e,a);Fye(u);let d=vH(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},zye=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Fye=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&l_("ipcInput"),t&&l_("ipc: true"),r&&l_("detached: true"),n&&l_("cancelSignal")},l_=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Lye=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=Uye({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=WH(c,r),{output:m,error:h=l}=UH({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,x)=>Ki(_,r,x)),b=Ki(BH(m,r),r,"all");return Bye({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},Uye=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{jH(o,r);let a=qye(r);return jye(...zy(t,e,a))}catch(a){return Ec({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},qye=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Wy(e)}),Bye=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Ky({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):Fd({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as MT,on as Zye}from"node:events";var XH,Hye,Gye,Vye,Wye,QH=y(()=>{Sc();Dd();Cd();XH=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(vc({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Py(t)}),Hye({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),Hye=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{xy(e,i);let o=No(t,e,r),s=new AbortController;try{return await Promise.race([Gye(o,n,s),Vye(o,r,s),Wye(o,r,s)])}catch(a){throw bc(t),a}finally{s.abort(),$y(e,i)}},Gye=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await MT(t,"message",{signal:r});return n}for await(let[n]of Zye(t,"message",{signal:r}))if(e(n))return n},Vye=async(t,e,{signal:r})=>{await MT(t,"disconnect",{signal:r}),uB(e)},Wye=async(t,e,{signal:r})=>{let[n]=await MT(t,"strict:error",{signal:r});throw vy(n,e)}});import{once as tG,on as Kye}from"node:events";var rG,zT,Jye,Yye,Xye,eG,FT=y(()=>{Sc();Dd();Cd();rG=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>zT({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),zT=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{vc({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Py(t)}),xy(e,o);let s=No(t,e,r),a=new AbortController,c={};return Jye(t,s,a),Yye({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),Xye({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},Jye=async(t,e,r)=>{try{await tG(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},Yye=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await tG(t,"strict:error",{signal:r.signal});n.error=vy(i,e),r.abort()}catch{}},Xye=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of Kye(r,"message",{signal:o.signal}))eG(s),yield c}catch{eG(s)}finally{o.abort(),$y(e,a),n||bc(t),i&&await t}},eG=({error:t})=>{if(t)throw t}});import nG from"node:process";var iG,oG,sG,LT=y(()=>{Ny();QH();FT();Ty();iG=(t,{ipc:e})=>{Object.assign(t,sG(t,!1,e))},oG=()=>{let t=nG,e=!0,r=nG.channel!==void 0;return{...sG(t,e,r),getCancelSignal:zB.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},sG=(t,e,r)=>({sendMessage:Dy.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:XH.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:rG.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as Qye}from"node:child_process";import{PassThrough as e_e,Readable as t_e,Writable as r_e,Duplex as n_e}from"node:stream";var aG,i_e,Bd,o_e,s_e,a_e,c_e,cG=y(()=>{t_();Ld();Jy();aG=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{$T(n);let a=new Qye;i_e(a,n),Object.assign(a,{readable:o_e,writable:s_e,duplex:a_e});let c=Ec({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=c_e(c,s,i);return{subprocess:a,promise:l}},i_e=(t,e)=>{let r=Bd(),n=Bd(),i=Bd(),o=Array.from({length:e.length-3},Bd),s=Bd(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},Bd=()=>{let t=new e_e;return t.end(),t},o_e=()=>new t_e({read(){}}),s_e=()=>new r_e({write(){}}),a_e=()=>new n_e({read(){},write(){}}),c_e=async(t,e,r)=>Ac(t,e,r)});import{createReadStream as lG,createWriteStream as uG}from"node:fs";import{Buffer as l_e}from"node:buffer";import{Readable as Zd,Writable as u_e,Duplex as d_e}from"node:stream";var fG,Hd,dG,f_e,pG=y(()=>{a_();t_();ur();fG=(t,e)=>e_(f_e,t,e,!1),Hd=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${jo[t]}.`)},dG={fileNumber:Hd,generator:RT,asyncGenerator:RT,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:d_e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},f_e={input:{...dG,fileUrl:({value:t})=>({stream:lG(t)}),filePath:({value:{file:t}})=>({stream:lG(t)}),webStream:({value:t})=>({stream:Zd.fromWeb(t)}),iterable:({value:t})=>({stream:Zd.from(t)}),asyncIterable:({value:t})=>({stream:Zd.from(t)}),string:({value:t})=>({stream:Zd.from(t)}),uint8Array:({value:t})=>({stream:Zd.from(l_e.from(t))})},output:{...dG,fileUrl:({value:t})=>({stream:uG(t)}),filePath:({value:{file:t,append:e}})=>({stream:uG(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:u_e.fromWeb(t)}),iterable:Hd,asyncIterable:Hd,string:Hd,uint8Array:Hd}}});import{on as p_e,once as mG}from"node:events";import{PassThrough as m_e,getDefaultHighWaterMark as h_e}from"node:stream";import{finished as yG}from"node:stream/promises";function Js(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)qT(i);let e=t.some(({readableObjectMode:i})=>i),r=g_e(t,e),n=new UT({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var g_e,UT,y_e,__e,v_e,qT,b_e,S_e,w_e,x_e,$_e,_G,vG,BT,bG,k_e,u_,hG,gG,d_=y(()=>{g_e=(t,e)=>{if(t.length===0)return h_e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},UT=class extends m_e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(qT(e),this.#t.has(e))return;this.#t.add(e),this.#n??=y_e(this,this.#t,this.#o);let r=b_e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(qT(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},y_e=async(t,e,r)=>{u_(t,hG);let n=new AbortController;try{await Promise.race([__e(t,n),v_e(t,e,r,n)])}finally{n.abort(),u_(t,-hG)}},__e=async(t,{signal:e})=>{try{await yG(t,{signal:e,cleanup:!0})}catch(r){throw _G(t,r),r}},v_e=async(t,e,r,{signal:n})=>{for await(let[i]of p_e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},qT=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},b_e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{u_(t,gG);let a=new AbortController;try{await Promise.race([S_e(o,e,a),w_e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),x_e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),u_(t,-gG)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?BT(t):$_e(t))},S_e=async(t,e,{signal:r})=>{try{await t,r.aborted||BT(e)}catch(n){r.aborted||_G(e,n)}},w_e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await yG(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;vG(s)?i.add(e):bG(t,s)}},x_e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await mG(t,i,{signal:o}),!t.readable)return mG(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},$_e=t=>{t.writable&&t.end()},_G=(t,e)=>{vG(e)?BT(t):bG(t,e)},vG=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",BT=t=>{(t.readable||t.writable)&&t.destroy()},bG=(t,e)=>{t.destroyed||(t.once("error",k_e),t.destroy(e))},k_e=()=>{},u_=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},hG=2,gG=1});import{finished as SG}from"node:stream/promises";var Oc,E_e,ZT,A_e,HT,f_=y(()=>{Hi();Oc=(t,e)=>{t.pipe(e),E_e(t,e),A_e(t,e)},E_e=async(t,e)=>{if(!(Cn(t)||Cn(e))){try{await SG(t,{cleanup:!0,readable:!0,writable:!1})}catch{}ZT(e)}},ZT=t=>{t.writable&&t.end()},A_e=async(t,e)=>{if(!(Cn(t)||Cn(e))){try{await SG(e,{cleanup:!0,readable:!1,writable:!0})}catch{}HT(t)}},HT=t=>{t.readable&&t.destroy()}});var wG,T_e,O_e,P_e,I_e,R_e,xG=y(()=>{d_();Hi();wy();ur();f_();wG=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>dn.has(c)))T_e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!dn.has(c)))P_e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Js(o);Oc(s,i)}},T_e=(t,e,r,n)=>{r==="output"?Oc(t.stdio[n],e):Oc(e,t.stdio[n]);let i=O_e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},O_e=["stdin","stdout","stderr"],P_e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;I_e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},I_e=(t,{signal:e})=>{Cn(t)&&Bs(t,R_e,e)},R_e=2});var Ys,$G=y(()=>{Ys=[];Ys.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ys.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ys.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var p_,GT,VT,C_e,WT,m_,D_e,KT,JT,YT,kG,_8e,v8e,EG=y(()=>{$G();p_=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",GT=Symbol.for("signal-exit emitter"),VT=globalThis,C_e=Object.defineProperty.bind(Object),WT=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(VT[GT])return VT[GT];C_e(VT,GT,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},m_=class{},D_e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),KT=class extends m_{onExit(){return()=>{}}load(){}unload(){}},JT=class extends m_{#t=YT.platform==="win32"?"SIGINT":"SIGHUP";#r=new WT;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of Ys)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!p_(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),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 e of Ys)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,Ys.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return p_(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&p_(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},YT=globalThis.process,{onExit:kG,load:_8e,unload:v8e}=D_e(p_(YT)?new JT(YT):new KT)});import{addAbortListener as N_e}from"node:events";var AG,TG=y(()=>{EG();AG=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=kG(()=>{t.kill()});N_e(n,()=>{i()})}});var PG,j_e,M_e,OG,z_e,IG=y(()=>{SA();ly();Do();pc();PG=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=cy(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=j_e(r,n,i),{sourceStream:d,sourceError:f}=z_e(t,l),{options:p,fileDescriptors:m}=li.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},j_e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=M_e(t,e,...r),a=Sy(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},M_e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(OG,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||vA(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=Yg(r,...n);return{destination:e(OG)(i,o,s),pipeOptions:s}}if(li.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},OG=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),z_e=(t,e)=>{try{return{sourceStream:xc(t,e)}}catch(r){return{sourceError:r}}}});var CG,F_e,XT,RG,QT=y(()=>{Ld();f_();CG=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=F_e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw XT({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},F_e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return HT(t),n;if(e!==void 0)return ZT(r),e},XT=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Ec({error:t,command:RG,escapedCommand:RG,fileDescriptors:e,options:r,startTime:n,isSync:!1}),RG="source.pipe(destination)"});var DG,NG=y(()=>{DG=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as L_e}from"node:stream/promises";var jG,U_e,q_e,B_e,h_,Z_e,H_e,MG=y(()=>{d_();wy();f_();jG=(t,e,r)=>{let n=h_.has(e)?q_e(t,e):U_e(t,e);return Bs(t,Z_e,r.signal),Bs(e,H_e,r.signal),B_e(e),n},U_e=(t,e)=>{let r=Js([t]);return Oc(r,e),h_.set(e,r),r},q_e=(t,e)=>{let r=h_.get(e);return r.add(t),r},B_e=async t=>{try{await L_e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}h_.delete(t)},h_=new WeakMap,Z_e=2,H_e=1});import{aborted as G_e}from"node:util";var zG,V_e,FG=y(()=>{QT();zG=(t,e)=>t===void 0?[]:[V_e(t,e)],V_e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await G_e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw XT({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var g_,W_e,K_e,LG=y(()=>{Bi();IG();QT();NG();MG();FG();g_=(t,...e)=>{if(wt(e[0]))return g_.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=PG(t,...e),i=W_e({...n,destination:r});return i.pipe=g_.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},W_e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=K_e(t,i);CG({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=jG(e,o,d);return await Promise.race([DG(u),...zG(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},K_e=(t,e)=>Promise.allSettled([t,e])});import{on as J_e}from"node:events";import{getDefaultHighWaterMark as Y_e}from"node:stream";var y_,X_e,eO,Q_e,qG,tO,UG,eve,tve,__=y(()=>{TT();n_();IT();y_=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return X_e(e,s),qG({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},X_e=async(t,e)=>{try{await t}catch{}finally{e.abort()}},eO=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;Q_e(e,s,t);let a=t.readableObjectMode&&!o;return qG({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},Q_e=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},qG=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=J_e(t,"data",{signal:e.signal,highWaterMark:UG,highWatermark:UG});return eve({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},tO=Y_e(!0),UG=tO,eve=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=tve({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ks(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*qd(a)}},tve=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[i_(t,r,!e),r_(t,i,!n,{})].filter(Boolean)});import{setImmediate as rve}from"node:timers/promises";var BG,nve,ive,ove,rO,ZG,nO=y(()=>{Vy();Ur();CT();__();Vs();Ud();BG=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=nve({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([ive(t),d]);return}let f=kT(c,r),p=eO({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([ove({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},nve=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!c_({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=eO({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await zH(a,t,r,o)},ive=async t=>{await rve(),t.readableFlowing===null&&t.resume()},ove=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await By(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Zy(r,{maxBuffer:o})):await Gy(r,{maxBuffer:o})}catch(a){return ZG(wZ({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},rO=async t=>{try{return await t}catch(e){return ZG(e)}},ZG=({bufferedData:t})=>m4(t)?new Uint8Array(t):t});import{finished as sve}from"node:stream/promises";var Gd,ave,cve,lve,uve,dve,iO,v_,HG,b_=y(()=>{Gd=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=ave(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],sve(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||uve(a,e,r,n)}finally{s.abort()}},ave=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&cve(t,r,n),n},cve=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{lve(e,r),n.call(t,...i)}},lve=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},uve=(t,e,r,n)=>{if(!dve(t,e,r,n))throw t},dve=(t,e,r,n=!0)=>r.propagating?HG(t)||v_(t):(r.propagating=!0,iO(r,e)===n?HG(t):v_(t)),iO=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",v_=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",HG=t=>t?.code==="EPIPE"});var GG,oO,sO=y(()=>{nO();b_();GG=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>oO({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),oO=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=Gd(t,e,l);if(iO(l,e)){await u;return}let[d]=await Promise.all([BG({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var VG,WG,fve,pve,aO=y(()=>{d_();sO();VG=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Js([t,e].filter(Boolean)):void 0,WG=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>oO({...fve(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:pve(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),fve=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},pve=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var KG,JG,YG=y(()=>{gc();Ro();KG=t=>hc(t,"ipc"),JG=(t,e)=>{let r=ay(t);ai({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var XG,QG,e9=y(()=>{Vs();YG();Vi();FT();XG=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=KG(o),a=Gi(e,"ipc"),c=Gi(r,"ipc");for await(let l of zT({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(xZ(t,i,c),i.push(l)),s&&JG(l,o);return i},QG=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as mve}from"node:events";var t9,hve,gve,yve,r9=y(()=>{Gs();eT();HA();QA();Hi();ur();nO();e9();rT();aO();sO();jT();b_();t9=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=HH(t,f),x={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},$=GG({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:x}),w=WG({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:x}),R=[],O=XG({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:R,verboseInfo:p}),A=hve(h,t,x),N=gve(m,x);try{return await Promise.race([Promise.all([{},VH(_),Promise.all($),w,O,WB(t,d),...A,...N]),g,yve(t,b),...BB(t,o,f,b),...lB({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...UB({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch(k){return f.terminationReason??="other",Promise.all([{error:k},_,Promise.all($.map(Z=>rO(Z))),rO(w),QG(O,R),Promise.allSettled(A),Promise.allSettled(N)])}},hve=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:Gd(n,i,r)),gve=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>jn(o,{checkOpen:!1})&&!Cn(o)).map(({type:i,value:o,stream:s=o})=>Gd(s,n,e,{isSameDirection:dn.has(i),stopOnExit:i==="native"}))),yve=async(t,{signal:e})=>{let[r]=await mve(t,"error",{signal:e});throw r}});var n9,Vd,Pc,S_=y(()=>{wc();n9=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Vd=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=ci();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Pc=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as i9}from"node:stream/promises";var cO,o9,lO,uO,w_,x_,dO=y(()=>{b_();cO=async t=>{if(t!==void 0)try{await lO(t)}catch{}},o9=async t=>{if(t!==void 0)try{await uO(t)}catch{}},lO=async t=>{await i9(t,{cleanup:!0,readable:!1,writable:!0})},uO=async t=>{await i9(t,{cleanup:!0,readable:!0,writable:!1})},w_=async(t,e)=>{if(await t,e)throw e},x_=(t,e,r)=>{r&&!v_(r)?t.destroy(r):e&&t.destroy()}});import{Readable as _ve}from"node:stream";import{callbackify as vve}from"node:util";var s9,fO,pO,mO,bve,hO,gO,a9,yO=y(()=>{Zs();Do();__();wc();S_();dO();s9=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||qr.has(r),{subprocessStdout:a,waitReadableDestroy:c}=fO(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=pO(a,s),{read:f,onStdoutDataDone:p}=mO({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new _ve({read:f,destroy:vve(gO.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return hO({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},fO=(t,e,r)=>{let n=xc(t,e),i=Vd(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},pO=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:tO},mO=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=ci(),s=y_({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){bve(this,s,o)},onStdoutDataDone:o}},bve=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},hO=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await uO(t),await n,await cO(i),await e,r.readable&&r.push(null)}catch(o){await cO(i),a9(r,o)}},gO=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Pc(r,e)&&(a9(t,n),await w_(e,n))},a9=(t,e)=>{x_(t,t.readable,e)}});import{Writable as Sve}from"node:stream";import{callbackify as c9}from"node:util";var l9,_O,vO,wve,xve,bO,SO,u9,wO=y(()=>{Do();S_();dO();l9=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=_O(t,r,e),s=new Sve({...vO(n,t,i),destroy:c9(SO.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return bO(n,s),s},_O=(t,e,r)=>{let n=Sy(t,e),i=Vd(r,n,"writableFinal"),o=Vd(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},vO=(t,e,r)=>({write:wve.bind(void 0,t),final:c9(xve.bind(void 0,t,e,r))}),wve=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},xve=async(t,e,r)=>{await Pc(r,e)&&(t.writable&&t.end(),await e)},bO=async(t,e,r)=>{try{await lO(t),e.writable&&e.end()}catch(n){await o9(r),u9(e,n)}},SO=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Pc(r,e),await Pc(n,e)&&(u9(t,i),await w_(e,i))},u9=(t,e)=>{x_(t,t.writable,e)}});import{Duplex as $ve}from"node:stream";import{callbackify as kve}from"node:util";var d9,Eve,f9=y(()=>{Zs();yO();wO();d9=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||qr.has(r),{subprocessStdout:c,waitReadableDestroy:l}=fO(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=_O(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=pO(c,a),{read:g,onStdoutDataDone:b}=mO({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new $ve({read:g,...vO(u,t,d),destroy:kve(Eve.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return hO({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),bO(u,_,c),_},Eve=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([gO({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),SO({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var xO,Ave,p9=y(()=>{Zs();Do();__();xO=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||qr.has(e),s=xc(t,r),a=y_({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return Ave(a,s,t)},Ave=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var m9,h9=y(()=>{S_();yO();wO();f9();p9();m9=(t,{encoding:e})=>{let r=n9();t.readable=s9.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=l9.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=d9.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=xO.bind(void 0,t,e),t[Symbol.asyncIterator]=xO.bind(void 0,t,e,{})}});var g9,Tve,Ove,y9=y(()=>{g9=(t,e)=>{for(let[r,n]of Ove){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},Tve=(async()=>{})().constructor.prototype,Ove=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Tve,t)])});import{setMaxListeners as Pve}from"node:events";import{spawn as Ive}from"node:child_process";var _9,Rve,Cve,Dve,Nve,jve,v9=y(()=>{Vy();IA();oT();Do();sT();LT();Ld();Jy();cG();pG();Ud();xG();yy();TG();LG();aO();r9();h9();wc();y9();_9=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Rve(t,e,r),{subprocess:f,promise:p}=Dve({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=g_.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),g9(f,p),li.set(f,{options:u,fileDescriptors:d}),f},Rve=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=uy(t,e,r),{file:a,commandArguments:c,options:l}=My(t,e,r),u=Cve(l),d=fG(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},Cve=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},Dve=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=Ive(...zy(t,e,r))}catch(m){return aG({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;Pve(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];wG(c,a,l),AG(c,r,l);let d={},f=ci();c.kill=aB.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=VG(c,r),m9(c,r),iG(c,r);let p=Nve({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Nve=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await t9({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map(($,w)=>Ki($,e,w)),_=Ki(h,e,"all"),x=jve({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Ac(x,n,e)},jve=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?Fd({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof ui,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Ky({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var $_,Mve,zve,b9=y(()=>{Bi();Vi();$_=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,Mve(n,t[n],i)]));return{...t,...r}},Mve=(t,e,r)=>zve.has(t)&&wt(e)&&wt(r)?{...e,...r}:r,zve=new Set(["env",...EA])});var Mo,Fve,Lve,S9=y(()=>{Bi();SA();w4();YH();v9();b9();Mo=(t,e,r,n)=>{let i=(s,a,c)=>Mo(s,a,r,c),o=(...s)=>Fve({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},Fve=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(wt(o))return i(t,$_(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=Lve({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?JH(a,c,l):_9(a,c,l,i)},Lve=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=b4(e)?S4(e,r):[e,...r],[s,a,c]=Yg(...o),l=$_($_(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var w9,x9,$9,Uve,qve,k9=y(()=>{w9=({file:t,commandArguments:e})=>$9(t,e),x9=({file:t,commandArguments:e})=>({...$9(t,e),isSync:!0}),$9=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=Uve(t);return{file:r,commandArguments:n}},Uve=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(qve)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},qve=/ +/g});var E9,A9,Bve,T9,Zve,O9,P9=y(()=>{E9=(t,e,r)=>{t.sync=e(Bve,r),t.s=t.sync},A9=({options:t})=>T9(t),Bve=({options:t})=>({...T9(t),isSync:!0}),T9=t=>({options:{...Zve(t),...t}}),Zve=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},O9={preferLocal:!0}});var c7e,Xe,l7e,u7e,d7e,f7e,p7e,m7e,h7e,g7e,kr=y(()=>{S9();k9();tT();P9();LT();c7e=Mo(()=>({})),Xe=Mo(()=>({isSync:!0})),l7e=Mo(w9),u7e=Mo(x9),d7e=Mo(HB),f7e=Mo(A9,{},O9,E9),{sendMessage:p7e,getOneMessage:m7e,getEachMessage:h7e,getCancelSignal:g7e}=oG()});import{existsSync as k_,statSync as Hve}from"node:fs";import{dirname as $O,extname as Gve,isAbsolute as I9,join as kO,relative as EO,resolve as E_,sep as Vve}from"node:path";function A_(t){return t==="./gradlew"||t==="gradle"}function Wve(t){return(k_(kO(t,"build.gradle.kts"))||k_(kO(t,"build.gradle")))&&k_(kO(t,"gradle.properties"))}function Kve(t,e){let n=EO(t,e).split(Vve).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function zo(t,e){return t===":"?`:${e}`:`${t}:${e}`}function Jve(t,e){let r=E_(t,e),n=r;k_(r)?Hve(r).isFile()&&(n=$O(r)):Gve(r)!==""&&(n=$O(r));let i=EO(t,n);if(i.startsWith("..")||I9(i))return null;let o=n;for(;;){if(Wve(o))return o;if(E_(o)===E_(t))return null;let s=$O(o);if(s===o)return null;let a=EO(t,s);if(a.startsWith("..")||I9(a))return null;o=s}}function T_(t,e){let r=E_(t),n=new Map,i=[];for(let o of e){let s=Jve(r,o);if(!s){i.push(o);continue}let a=Kve(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var O_=y(()=>{"use strict"});import{existsSync as Yve,readFileSync as Xve}from"node:fs";import{join as Qve}from"node:path";function Ic(t="."){let e=Qve(t,".cladding","config.yaml");if(!Yve(e))return AO;try{let n=(0,R9.parse)(Xve(e,"utf8"))?.gate;if(!n)return AO;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of ebe){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return AO}}function C9(t,e){let r=[],n=!1;for(let i of t){let o=tbe.exec(i);if(o){n=!0;for(let s of e)r.push(zo(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var R9,ebe,AO,tbe,P_=y(()=>{"use strict";R9=St(tr(),1);O_();ebe=["type","lint","test","coverage"],AO={scope:"feature"};tbe=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as OO,readFileSync as D9,readdirSync as rbe,statSync as nbe}from"node:fs";import{join as I_}from"node:path";function RO(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=I_(t,e);if(OO(r))try{if(N9.test(D9(r,"utf8")))return!0}catch{}}return!1}function j9(t){try{return OO(t)&&N9.test(D9(t,"utf8"))}catch{return!1}}function M9(t,e=0){if(e>4||!OO(t))return!1;let r;try{r=rbe(t)}catch{return!1}for(let n of r){let i=I_(t,n),o=!1;try{o=nbe(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(M9(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&j9(i))return!0}return!1}function sbe(t){if(RO(t))return!0;for(let e of ibe)if(j9(I_(t,e)))return!0;for(let e of obe)if(M9(I_(t,e)))return!0;return!1}function z9(t="."){let e=Ic(t).coverage;return e||(sbe(t)?"kover":"jacoco")}function F9(t="."){return PO[z9(t)]}function L9(t="."){return TO[z9(t)]}var PO,TO,IO,N9,ibe,obe,R_=y(()=>{"use strict";P_();PO={kover:"koverXmlReport",jacoco:"jacocoTestReport"},TO={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},IO=[TO.kover,TO.jacoco],N9=/kover/i;ibe=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],obe=["buildSrc","build-logic"]});import{existsSync as CO,readdirSync as U9}from"node:fs";import{join as C_}from"node:path";function DO(t){return CO(C_(t,"gradlew"))?"./gradlew":"gradle"}function abe(t){let e=DO(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[F9(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function lbe(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function fbe(t,e){for(let r of e)if(CO(C_(t,r)))return r}function pbe(t,e){try{return U9(t).find(n=>n.endsWith(e))}catch{return}}function hbe(t,e){for(let r of mbe)if(r.configs.some(n=>CO(C_(t,n))))return r.gate;return e}function dt(t="."){for(let e of ube){let r;for(let o of e.manifests)if(o.startsWith(".")?r=pbe(t,o):r=fbe(t,[o]),r)break;if(!r||e.requiresSource&&!lbe(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"&&n.lint?{...n,lint:hbe(t,n.lint)}:n;return{language:e.language,manifest:r,gates:i}}return dbe}var cbe,ube,dbe,mbe,fn=y(()=>{"use strict";R_();cbe=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);ube=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:["--no-install","tsc","--noEmit"]},lint:{cmd:"npx",args:["--no-install","eslint","."]},test:{cmd:"npx",args:["--no-install","vitest","run"]},coverage:{cmd:"npx",args:["--no-install","vitest","run","--coverage"]},secret:{cmd:"npx",args:["--no-install","secretlint","**/*"]},arch:{cmd:"npx",args:["--no-install","madge","--circular","--extensions","ts","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:abe},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}],dbe={language:"unknown",manifest:"",gates:{}};mbe=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:["--no-install","biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:["--no-install","oxlint"]}}]});import{existsSync as gbe,readFileSync as ybe}from"node:fs";import{join as _be}from"node:path";function Wd(t){return t.code==="ENOENT"}function D_(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return q9.test(o)||q9.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function jt(t,e,r){return Wd(r)?{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`}:null}function rr(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Rc(t,e){let r=_be(t,"package.json");if(!gbe(r))return!1;try{return!!JSON.parse(ybe(r,"utf8")).scripts?.[e]}catch{return!1}}var q9,pn=y(()=>{"use strict";q9=/config (is |file )?not found|no such file|ENOENT|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function vbe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.arch;if(!n)return[{detector:N_,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=Xe(n.cmd,[...n.args],{cwd:e,reject:!1});return Wd(i)?[{detector:N_,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:D_(i,N_,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var N_,j_,NO=y(()=>{"use strict";kr();fn();pn();N_="ARCHITECTURE_VIOLATION";j_={name:N_,run:vbe}});import B9 from"node:process";function Xs(t={}){let r=j_.run(t).filter(o=>o.severity==="error"),n=r.length===0,i={stage:bbe,pass:n,exitCode:n?0:1};return n?i:{...i,stderr:r.map(o=>o.message).join(` -`)}}var bbe,Sbe,M_=y(()=>{"use strict";NO();bbe="stage_1.5";Sbe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${B9.argv[1]}`;if(Sbe){let t=Xs();console.log(JSON.stringify(t)),B9.exit(t.exitCode)}});import{existsSync as jO,readdirSync as Z9}from"node:fs";import{join as z_}from"node:path";function xbe(t,e){let r=z_(t,e.path);if(!jO(r))return!0;if(e.isDirectory)try{return Z9(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function $be(t){let{cwd:e="."}=t,r=[];for(let i of wbe)xbe(e,i)&&r.push({detector:Kd,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=z_(e,"spec.yaml");if(jO(n)){let i=Abe(n),o=i?null:kbe(e);if(i)r.push({detector:Kd,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:Kd,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=Ebe(e);s&&r.push({detector:Kd,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function kbe(t){for(let e of["spec/features","spec/scenarios"]){let r=z_(t,e);if(!jO(r))continue;let n;try{n=Z9(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{ii(z_(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function Ebe(t){try{return se(t),null}catch(e){return e.message}}function Abe(t){let e;try{e=ii(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var Kd,wbe,H9,G9=y(()=>{"use strict";Tt();Hg();Kd="ABSENCE_OF_GOVERNANCE",wbe=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];H9={name:Kd,run:$be}});function F_(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function MO(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=F_(r)==="while",o=Obe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${F_(r)}'`}let n=Tbe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:F_(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${F_(r)}'`:null}function Pbe(t,e){let r=MO(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function V9(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...Pbe(r,n));return e}var Tbe,Obe,zO=y(()=>{"use strict";Tbe={event:"when",state:"while",optional:"where",unwanted:"if"},Obe=/\bwhen\b/i});function _e(t,e,r){let n;try{n=se(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var xt=y(()=>{"use strict";Tt()});function Ibe(t){let{cwd:e="."}=t;return _e(e,L_,Rbe)}function Rbe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:L_,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of V9(t.features))e.push({detector:L_,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var L_,W9,K9=y(()=>{"use strict";zO();xt();L_="AC_DRIFT";W9={name:L_,run:Ibe}});function fi(t=".",e){let n=(e??"").trim().toLowerCase()||dt(t).language;return jbe[n]??J9}var Cbe,Dbe,J9,Nbe,jbe,Cc=y(()=>{"use strict";fn();Cbe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,Dbe=/^[ \t]*import\s+([\w.]+)/gm,J9={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:Cbe,importStyle:"relative"},Nbe={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:Dbe,importStyle:"dotted"},jbe={typescript:J9,kotlin:Nbe}});import{existsSync as Mbe,readFileSync as zbe,readdirSync as Fbe,statSync as Lbe}from"node:fs";import{join as X9,relative as Y9}from"node:path";function Ube(t,e){if(!Mbe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=Fbe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=X9(i,s),c;try{c=Lbe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function qbe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function Zbe(t){return Bbe.test(t)}function Hbe(t){let{cwd:e="."}=t,r;try{r=se(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=fi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>Ube(X9(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=zbe(a,"utf8")}catch{continue}let l=c.split(` -`);for(let u=0;u{"use strict";Tt();Cc();Q9="AI_HINTS_FORBIDDEN_PATTERN";Bbe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;eV={name:Q9,run:Hbe}});function Gbe(t){let{cwd:e="."}=t,r;try{r=se(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:rV,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var rV,nV,iV=y(()=>{"use strict";Tt();rV="AC_DUPLICATE_WITHIN_FEATURE";nV={name:rV,run:Gbe}});import{createRequire as Vbe}from"module";import{basename as Wbe,dirname as LO,normalize as Kbe,relative as Jbe,resolve as Ybe,sep as aV}from"path";import*as Xbe from"fs";function Qbe(t){let e=Kbe(t);return e.length>1&&e[e.length-1]===aV&&(e=e.substring(0,e.length-1)),e}function cV(t,e){return t.replace(eSe,e)}function rSe(t){return t==="/"||tSe.test(t)}function FO(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=Ybe(t)),(n||o)&&(t=Qbe(t)),t===".")return"";let s=t[t.length-1]!==i;return cV(s?t+i:t,i)}function lV(t,e){return e+t}function nSe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:cV(Jbe(t,n),e.pathSeparator)+e.pathSeparator+r}}function iSe(t){return t}function oSe(t,e,r){return e+t+r}function sSe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?nSe(t,e):n?lV:iSe}function aSe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function cSe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function fSe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?cSe(t):aSe(t):n&&n.length?uSe:lSe:dSe}function _Se(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?ySe:r&&r.length?n?pSe:mSe:n?hSe:gSe}function SSe(t){return t.group?bSe:vSe}function $Se(t){return t.group?wSe:xSe}function ASe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?ESe:kSe}function uV(t,e,r){if(r.options.useRealPaths)return TSe(e,r);let n=LO(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=LO(n)}return r.symlinks.set(t,e),i>1}function TSe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function U_(t,e,r,n){e(t&&!n?t:null,r)}function MSe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?OSe:CSe:n?e?PSe:jSe:i?e?RSe:NSe:e?ISe:DSe}function LSe(t){return t?FSe:zSe}function ZSe(t,e){return new Promise((r,n)=>{pV(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function pV(t,e,r){new fV(t,e,r).start()}function HSe(t,e){return new fV(t,e).start()}var oV,eSe,tSe,lSe,uSe,dSe,pSe,mSe,hSe,gSe,ySe,vSe,bSe,wSe,xSe,kSe,ESe,OSe,PSe,ISe,RSe,CSe,DSe,NSe,jSe,dV,zSe,FSe,USe,qSe,BSe,fV,sV,mV,hV,gV=y(()=>{oV=Vbe(import.meta.url);eSe=/[\\/]/g;tSe=/^[a-z]:[\\/]$/i;lSe=(t,e)=>{e.push(t||".")},uSe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},dSe=()=>{};pSe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},mSe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},hSe=(t,e,r,n)=>{r.files++},gSe=(t,e)=>{e.push(t)},ySe=()=>{};vSe=t=>t,bSe=()=>[""].slice(0,0);wSe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},xSe=()=>{};kSe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&uV(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},ESe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&uV(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};OSe=t=>t.counts,PSe=t=>t.groups,ISe=t=>t.paths,RSe=t=>t.paths.slice(0,t.options.maxFiles),CSe=(t,e,r)=>(U_(e,r,t.counts,t.options.suppressErrors),null),DSe=(t,e,r)=>(U_(e,r,t.paths,t.options.suppressErrors),null),NSe=(t,e,r)=>(U_(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),jSe=(t,e,r)=>(U_(e,r,t.groups,t.options.suppressErrors),null);dV={withFileTypes:!0},zSe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",dV,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},FSe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",dV)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};USe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},qSe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},BSe=class{aborted=!1;abort(){this.aborted=!0}},fV=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=MSe(e,this.isSynchronous),this.root=FO(t,e),this.state={root:rSe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new qSe,options:e,queue:new USe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new BSe,fs:e.fs||Xbe},this.joinPath=sSe(this.root,e),this.pushDirectory=fSe(this.root,e),this.pushFile=_Se(e),this.getArray=SSe(e),this.groupFiles=$Se(e),this.resolveSymlink=ASe(e,this.isSynchronous),this.walkDirectory=LSe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=FO(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let x=Wbe(_),$=FO(LO(_),this.state.options);_=this.joinPath(x,$),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};sV=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return ZSe(this.root,this.options)}withCallback(t){pV(this.root,this.options,t)}sync(){return HSe(this.root,this.options)}},mV=null;try{oV.resolve("picomatch"),mV=oV("picomatch")}catch{}hV=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:aV,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new sV(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new sV(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||mV;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var Jd=v((_Qe,SV)=>{"use strict";var yV="[^\\\\/]",GSe="(?=.)",_V="[^/]",UO="(?:\\/|$)",vV="(?:^|\\/)",qO=`\\.{1,2}${UO}`,VSe="(?!\\.)",WSe=`(?!${vV}${qO})`,KSe=`(?!\\.{0,1}${UO})`,JSe=`(?!${qO})`,YSe="[^.\\/]",XSe=`${_V}*?`,QSe="/",bV={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:GSe,QMARK:_V,END_ANCHOR:UO,DOTS_SLASH:qO,NO_DOT:VSe,NO_DOTS:WSe,NO_DOT_SLASH:KSe,NO_DOTS_SLASH:JSe,QMARK_NO_DOT:YSe,STAR:XSe,START_ANCHOR:vV,SEP:QSe},ewe={...bV,SLASH_LITERAL:"[\\\\/]",QMARK:yV,STAR:`${yV}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},twe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};SV.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:twe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?ewe:bV}}});var Yd=v(Er=>{"use strict";var{REGEX_BACKSLASH:rwe,REGEX_REMOVE_BACKSLASH:nwe,REGEX_SPECIAL_CHARS:iwe,REGEX_SPECIAL_CHARS_GLOBAL:owe}=Jd();Er.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Er.hasRegexChars=t=>iwe.test(t);Er.isRegexChar=t=>t.length===1&&Er.hasRegexChars(t);Er.escapeRegex=t=>t.replace(owe,"\\$1");Er.toPosixSlashes=t=>t.replace(rwe,"/");Er.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Er.removeBackslashes=t=>t.replace(nwe,e=>e==="\\"?"":e);Er.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Er.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Er.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Er.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Er.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var OV=v((bQe,TV)=>{"use strict";var wV=Yd(),{CHAR_ASTERISK:BO,CHAR_AT:swe,CHAR_BACKWARD_SLASH:Xd,CHAR_COMMA:awe,CHAR_DOT:ZO,CHAR_EXCLAMATION_MARK:HO,CHAR_FORWARD_SLASH:AV,CHAR_LEFT_CURLY_BRACE:GO,CHAR_LEFT_PARENTHESES:VO,CHAR_LEFT_SQUARE_BRACKET:cwe,CHAR_PLUS:lwe,CHAR_QUESTION_MARK:xV,CHAR_RIGHT_CURLY_BRACE:uwe,CHAR_RIGHT_PARENTHESES:$V,CHAR_RIGHT_SQUARE_BRACKET:dwe}=Jd(),kV=t=>t===AV||t===Xd,EV=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},fwe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,x=!1,$=!1,w=!1,R=0,O,A,N={value:"",depth:0,isGlob:!1},k=()=>l>=n,Z=()=>c.charCodeAt(l+1),ne=()=>(O=A,c.charCodeAt(++l));for(;l0&&(P=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),I=c.slice(d)):m===!0?(xe="",I=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&kV(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(I&&(I=wV.removeBackslashes(I)),xe&&_===!0&&(xe=wV.removeBackslashes(xe)));let sn={prefix:P,input:t,start:u,base:xe,glob:I,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:x,negatedExtglob:$};if(r.tokens===!0&&(sn.maxDepth=0,kV(A)||s.push(N),sn.tokens=s),r.parts===!0||r.tokens===!0){let He;for(let ut=0;ut{"use strict";var Qd=Jd(),Br=Yd(),{MAX_LENGTH:q_,POSIX_REGEX_SOURCE:pwe,REGEX_NON_SPECIAL_CHARS:mwe,REGEX_SPECIAL_CHARS_BACKREF:hwe,REPLACEMENTS:PV}=Qd,gwe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Br.escapeRegex(i)).join("..")}return r},Dc=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,IV=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},ywe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},RV=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(ywe(e))return e.replace(/\\(.)/g,"$1")},_we=t=>{let e=t.map(RV).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},vwe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=RV(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?Br.escapeRegex(r[0]):`[${r.map(i=>Br.escapeRegex(i)).join("")}]`}*`},bwe=t=>{let e=0,r=t.trim(),n=WO(r);for(;n;)e++,r=n.body.trim(),n=WO(r);return e},Swe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Qd.DEFAULT_MAX_EXTGLOB_RECURSION,n=IV(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||_we(n)))return{risky:!0};for(let i of n){let o=vwe(i);if(o)return{risky:!0,safeOutput:o};if(bwe(i)>r)return{risky:!0}}return{risky:!1}},KO=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=PV[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(q_,r.maxLength):q_,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=Qd.globChars(r.windows),l=Qd.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:x,STAR:$,START_ANCHOR:w}=c,R=U=>`(${a}(?:(?!${w}${U.dot?m:u}).)*?)`,O=r.dot?"":h,A=r.dot?_:x,N=r.bash===!0?R(r):$;r.capture&&(N=`(${N})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let k={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=Br.removePrefix(t,k),i=t.length;let Z=[],ne=[],xe=[],P=o,I,sn=()=>k.index===i-1,He=k.peek=(U=1)=>t[k.index+U],ut=k.advance=()=>t[++k.index]||"",ji=()=>t.slice(k.index+1),an=(U="",at=0)=>{k.consumed+=U,k.index+=at},yo=U=>{k.output+=U.output!=null?U.output:U.value,an(U.value)},use=()=>{let U=1;for(;He()==="!"&&(He(2)!=="("||He(3)==="?");)ut(),k.start++,U++;return U%2===0?!1:(k.negated=!0,k.start++,!0)},Ch=U=>{k[U]++,xe.push(U)},_o=U=>{k[U]--,xe.pop()},Ee=U=>{if(P.type==="globstar"){let at=k.braces>0&&(U.type==="comma"||U.type==="brace"),L=U.extglob===!0||Z.length&&(U.type==="pipe"||U.type==="paren");U.type!=="slash"&&U.type!=="paren"&&!at&&!L&&(k.output=k.output.slice(0,-P.output.length),P.type="star",P.value="*",P.output=N,k.output+=P.output)}if(Z.length&&U.type!=="paren"&&(Z[Z.length-1].inner+=U.value),(U.value||U.output)&&yo(U),P&&P.type==="text"&&U.type==="text"){P.output=(P.output||P.value)+U.value,P.value+=U.value;return}U.prev=P,s.push(U),P=U},Dh=(U,at)=>{let L={...l[at],conditions:1,inner:""};L.prev=P,L.parens=k.parens,L.output=k.output,L.startIndex=k.index,L.tokensIndex=s.length;let Ae=(r.capture?"(":"")+L.open;Ch("parens"),Ee({type:U,value:at,output:k.output?"":p}),Ee({type:"paren",extglob:!0,value:ut(),output:Ae}),Z.push(L)},dse=U=>{let at=t.slice(U.startIndex,k.index+1),L=t.slice(U.startIndex+2,k.index),Ae=Swe(L,r);if((U.type==="plus"||U.type==="star")&&Ae.risky){let nt=Ae.safeOutput?(U.output?"":p)+(r.capture?`(${Ae.safeOutput})`:Ae.safeOutput):void 0,ei=s[U.tokensIndex];ei.type="text",ei.value=at,ei.output=nt||Br.escapeRegex(at);for(let ti=U.tokensIndex+1;ti1&&U.inner.includes("/")&&(nt=R(r)),(nt!==N||sn()||/^\)+$/.test(ji()))&&(it=U.close=`)$))${nt}`),U.inner.includes("*")&&(Ct=ji())&&/^\.[^\\/.]+$/.test(Ct)){let ei=KO(Ct,{...e,fastpaths:!1}).output;it=U.close=`)${ei})${nt})`}U.prev.type==="bos"&&(k.negatedExtglob=!0)}Ee({type:"paren",extglob:!0,value:I,output:it}),_o("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let U=!1,at=t.replace(hwe,(L,Ae,it,Ct,nt,ei)=>Ct==="\\"?(U=!0,L):Ct==="?"?Ae?Ae+Ct+(nt?_.repeat(nt.length):""):ei===0?A+(nt?_.repeat(nt.length):""):_.repeat(it.length):Ct==="."?u.repeat(it.length):Ct==="*"?Ae?Ae+Ct+(nt?N:""):N:Ae?L:`\\${L}`);return U===!0&&(r.unescape===!0?at=at.replace(/\\/g,""):at=at.replace(/\\+/g,L=>L.length%2===0?"\\\\":L?"\\":"")),at===t&&r.contains===!0?(k.output=t,k):(k.output=Br.wrapOutput(at,k,e),k)}for(;!sn();){if(I=ut(),I==="\0")continue;if(I==="\\"){let L=He();if(L==="/"&&r.bash!==!0||L==="."||L===";")continue;if(!L){I+="\\",Ee({type:"text",value:I});continue}let Ae=/^\\+/.exec(ji()),it=0;if(Ae&&Ae[0].length>2&&(it=Ae[0].length,k.index+=it,it%2!==0&&(I+="\\")),r.unescape===!0?I=ut():I+=ut(),k.brackets===0){Ee({type:"text",value:I});continue}}if(k.brackets>0&&(I!=="]"||P.value==="["||P.value==="[^")){if(r.posix!==!1&&I===":"){let L=P.value.slice(1);if(L.includes("[")&&(P.posix=!0,L.includes(":"))){let Ae=P.value.lastIndexOf("["),it=P.value.slice(0,Ae),Ct=P.value.slice(Ae+2),nt=pwe[Ct];if(nt){P.value=it+nt,k.backtrack=!0,ut(),!o.output&&s.indexOf(P)===1&&(o.output=p);continue}}}(I==="["&&He()!==":"||I==="-"&&He()==="]")&&(I=`\\${I}`),I==="]"&&(P.value==="["||P.value==="[^")&&(I=`\\${I}`),r.posix===!0&&I==="!"&&P.value==="["&&(I="^"),P.value+=I,yo({value:I});continue}if(k.quotes===1&&I!=='"'){I=Br.escapeRegex(I),P.value+=I,yo({value:I});continue}if(I==='"'){k.quotes=k.quotes===1?0:1,r.keepQuotes===!0&&Ee({type:"text",value:I});continue}if(I==="("){Ch("parens"),Ee({type:"paren",value:I});continue}if(I===")"){if(k.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Dc("opening","("));let L=Z[Z.length-1];if(L&&k.parens===L.parens+1){dse(Z.pop());continue}Ee({type:"paren",value:I,output:k.parens?")":"\\)"}),_o("parens");continue}if(I==="["){if(r.nobracket===!0||!ji().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Dc("closing","]"));I=`\\${I}`}else Ch("brackets");Ee({type:"bracket",value:I});continue}if(I==="]"){if(r.nobracket===!0||P&&P.type==="bracket"&&P.value.length===1){Ee({type:"text",value:I,output:`\\${I}`});continue}if(k.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Dc("opening","["));Ee({type:"text",value:I,output:`\\${I}`});continue}_o("brackets");let L=P.value.slice(1);if(P.posix!==!0&&L[0]==="^"&&!L.includes("/")&&(I=`/${I}`),P.value+=I,yo({value:I}),r.literalBrackets===!1||Br.hasRegexChars(L))continue;let Ae=Br.escapeRegex(P.value);if(k.output=k.output.slice(0,-P.value.length),r.literalBrackets===!0){k.output+=Ae,P.value=Ae;continue}P.value=`(${a}${Ae}|${P.value})`,k.output+=P.value;continue}if(I==="{"&&r.nobrace!==!0){Ch("braces");let L={type:"brace",value:I,output:"(",outputIndex:k.output.length,tokensIndex:k.tokens.length};ne.push(L),Ee(L);continue}if(I==="}"){let L=ne[ne.length-1];if(r.nobrace===!0||!L){Ee({type:"text",value:I,output:I});continue}let Ae=")";if(L.dots===!0){let it=s.slice(),Ct=[];for(let nt=it.length-1;nt>=0&&(s.pop(),it[nt].type!=="brace");nt--)it[nt].type!=="dots"&&Ct.unshift(it[nt].value);Ae=gwe(Ct,r),k.backtrack=!0}if(L.comma!==!0&&L.dots!==!0){let it=k.output.slice(0,L.outputIndex),Ct=k.tokens.slice(L.tokensIndex);L.value=L.output="\\{",I=Ae="\\}",k.output=it;for(let nt of Ct)k.output+=nt.output||nt.value}Ee({type:"brace",value:I,output:Ae}),_o("braces"),ne.pop();continue}if(I==="|"){Z.length>0&&Z[Z.length-1].conditions++,Ee({type:"text",value:I});continue}if(I===","){let L=I,Ae=ne[ne.length-1];Ae&&xe[xe.length-1]==="braces"&&(Ae.comma=!0,L="|"),Ee({type:"comma",value:I,output:L});continue}if(I==="/"){if(P.type==="dot"&&k.index===k.start+1){k.start=k.index+1,k.consumed="",k.output="",s.pop(),P=o;continue}Ee({type:"slash",value:I,output:f});continue}if(I==="."){if(k.braces>0&&P.type==="dot"){P.value==="."&&(P.output=u);let L=ne[ne.length-1];P.type="dots",P.output+=I,P.value+=I,L.dots=!0;continue}if(k.braces+k.parens===0&&P.type!=="bos"&&P.type!=="slash"){Ee({type:"text",value:I,output:u});continue}Ee({type:"dot",value:I,output:u});continue}if(I==="?"){if(!(P&&P.value==="(")&&r.noextglob!==!0&&He()==="("&&He(2)!=="?"){Dh("qmark",I);continue}if(P&&P.type==="paren"){let Ae=He(),it=I;(P.value==="("&&!/[!=<:]/.test(Ae)||Ae==="<"&&!/<([!=]|\w+>)/.test(ji()))&&(it=`\\${I}`),Ee({type:"text",value:I,output:it});continue}if(r.dot!==!0&&(P.type==="slash"||P.type==="bos")){Ee({type:"qmark",value:I,output:x});continue}Ee({type:"qmark",value:I,output:_});continue}if(I==="!"){if(r.noextglob!==!0&&He()==="("&&(He(2)!=="?"||!/[!=<:]/.test(He(3)))){Dh("negate",I);continue}if(r.nonegate!==!0&&k.index===0){use();continue}}if(I==="+"){if(r.noextglob!==!0&&He()==="("&&He(2)!=="?"){Dh("plus",I);continue}if(P&&P.value==="("||r.regex===!1){Ee({type:"plus",value:I,output:d});continue}if(P&&(P.type==="bracket"||P.type==="paren"||P.type==="brace")||k.parens>0){Ee({type:"plus",value:I});continue}Ee({type:"plus",value:d});continue}if(I==="@"){if(r.noextglob!==!0&&He()==="("&&He(2)!=="?"){Ee({type:"at",extglob:!0,value:I,output:""});continue}Ee({type:"text",value:I});continue}if(I!=="*"){(I==="$"||I==="^")&&(I=`\\${I}`);let L=mwe.exec(ji());L&&(I+=L[0],k.index+=L[0].length),Ee({type:"text",value:I});continue}if(P&&(P.type==="globstar"||P.star===!0)){P.type="star",P.star=!0,P.value+=I,P.output=N,k.backtrack=!0,k.globstar=!0,an(I);continue}let U=ji();if(r.noextglob!==!0&&/^\([^?]/.test(U)){Dh("star",I);continue}if(P.type==="star"){if(r.noglobstar===!0){an(I);continue}let L=P.prev,Ae=L.prev,it=L.type==="slash"||L.type==="bos",Ct=Ae&&(Ae.type==="star"||Ae.type==="globstar");if(r.bash===!0&&(!it||U[0]&&U[0]!=="/")){Ee({type:"star",value:I,output:""});continue}let nt=k.braces>0&&(L.type==="comma"||L.type==="brace"),ei=Z.length&&(L.type==="pipe"||L.type==="paren");if(!it&&L.type!=="paren"&&!nt&&!ei){Ee({type:"star",value:I,output:""});continue}for(;U.slice(0,3)==="/**";){let ti=t[k.index+4];if(ti&&ti!=="/")break;U=U.slice(3),an("/**",3)}if(L.type==="bos"&&sn()){P.type="globstar",P.value+=I,P.output=R(r),k.output=P.output,k.globstar=!0,an(I);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&!Ct&&sn()){k.output=k.output.slice(0,-(L.output+P.output).length),L.output=`(?:${L.output}`,P.type="globstar",P.output=R(r)+(r.strictSlashes?")":"|$)"),P.value+=I,k.globstar=!0,k.output+=L.output+P.output,an(I);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&U[0]==="/"){let ti=U[1]!==void 0?"|$":"";k.output=k.output.slice(0,-(L.output+P.output).length),L.output=`(?:${L.output}`,P.type="globstar",P.output=`${R(r)}${f}|${f}${ti})`,P.value+=I,k.output+=L.output+P.output,k.globstar=!0,an(I+ut()),Ee({type:"slash",value:"/",output:""});continue}if(L.type==="bos"&&U[0]==="/"){P.type="globstar",P.value+=I,P.output=`(?:^|${f}|${R(r)}${f})`,k.output=P.output,k.globstar=!0,an(I+ut()),Ee({type:"slash",value:"/",output:""});continue}k.output=k.output.slice(0,-P.output.length),P.type="globstar",P.output=R(r),P.value+=I,k.output+=P.output,k.globstar=!0,an(I);continue}let at={type:"star",value:I,output:N};if(r.bash===!0){at.output=".*?",(P.type==="bos"||P.type==="slash")&&(at.output=O+at.output),Ee(at);continue}if(P&&(P.type==="bracket"||P.type==="paren")&&r.regex===!0){at.output=I,Ee(at);continue}(k.index===k.start||P.type==="slash"||P.type==="dot")&&(P.type==="dot"?(k.output+=g,P.output+=g):r.dot===!0?(k.output+=b,P.output+=b):(k.output+=O,P.output+=O),He()!=="*"&&(k.output+=p,P.output+=p)),Ee(at)}for(;k.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Dc("closing","]"));k.output=Br.escapeLast(k.output,"["),_o("brackets")}for(;k.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Dc("closing",")"));k.output=Br.escapeLast(k.output,"("),_o("parens")}for(;k.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Dc("closing","}"));k.output=Br.escapeLast(k.output,"{"),_o("braces")}if(r.strictSlashes!==!0&&(P.type==="star"||P.type==="bracket")&&Ee({type:"maybe_slash",value:"",output:`${f}?`}),k.backtrack===!0){k.output="";for(let U of k.tokens)k.output+=U.output!=null?U.output:U.value,U.suffix&&(k.output+=U.suffix)}return k};KO.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(q_,r.maxLength):q_,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=PV[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=Qd.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let x=O=>O.noglobstar===!0?_:`(${g}(?:(?!${p}${O.dot?c:o}).)*?)`,$=O=>{switch(O){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+x(r);case"**/*":return`(?:${m}${x(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${x(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${x(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(O);if(!A)return;let N=$(A[1]);return N?N+o+A[2]:void 0}}},w=Br.removePrefix(t,b),R=$(w);return R&&r.strictSlashes!==!0&&(R+=`${s}?`),R};CV.exports=KO});var MV=v((wQe,jV)=>{"use strict";var wwe=OV(),JO=DV(),NV=Yd(),xwe=Jd(),$we=t=>t&&typeof t=="object"&&!Array.isArray(t),$t=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>$t(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=$we(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?$t.compileRe(t,e):$t.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=$t(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=$t.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};$t.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?NV.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=$t.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};$t.matchBase=(t,e,r)=>(e instanceof RegExp?e:$t.makeRe(e,r)).test(NV.basename(t));$t.isMatch=(t,e,r)=>$t(e,r)(t);$t.parse=(t,e)=>Array.isArray(t)?t.map(r=>$t.parse(r,e)):JO(t,{...e,fastpaths:!1});$t.scan=(t,e)=>wwe(t,e);$t.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=$t.toRegex(a,e);return n===!0&&(c.state=t),c};$t.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=JO.fastpaths(t,e)),i.output||(i=JO(t,e)),$t.compileRe(i,e,r,n)};$t.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};$t.constants=xwe;jV.exports=$t});var UV=v((xQe,LV)=>{"use strict";var zV=MV(),kwe=Yd();function FV(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:kwe.isWindows()}),zV(t,e,r)}Object.assign(FV,zV);LV.exports=FV});import{readdir as Ewe,readdirSync as Awe,realpath as Twe,realpathSync as Owe,stat as Pwe,statSync as Iwe}from"fs";import{isAbsolute as Rwe,posix as Qs,resolve as Cwe}from"path";import{fileURLToPath as Dwe}from"url";function Mwe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&jwe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>Qs.relative(t,n)||".":n=>Qs.relative(t,`${e}/${n}`)||"."}function Lwe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Qs.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function HV(t){var e;let r=Nc.default.scan(t,Uwe);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function Vwe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Nc.default.scan(t);return r.isGlob||r.negated}function ef(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function GV(t){return typeof t=="string"?[t]:t??[]}function YO(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=Gwe(o);s=Rwe(s.replace(Kwe,""))?Qs.relative(a,s):Qs.normalize(s);let c=(i=Wwe.exec(s))===null||i===void 0?void 0:i[0],l=HV(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?Qs.join(o,...d):o}return s}function Jwe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(YO(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(YO(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(YO(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function Ywe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=Jwe(t,e,n);t.debug&&ef("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(BV,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Nc.default)(i.match,f),m=(0,Nc.default)(i.ignore,f),h=Mwe(i.match,f),g=qV(r,d,o),b=o?g:qV(r,d,!0),_=(w,R)=>{let O=b(R,!0);return O!=="."&&!h(O)||m(O)},x;t.deep!==void 0&&(x=Math.round(t.deep-n.depthOffset));let $=new hV({filters:[a?(w,R)=>{let O=g(w,R),A=p(O)&&!m(O);return A&&ef(`matched ${O}`),A}:(w,R)=>{let O=g(w,R);return p(O)&&!m(O)}],exclude:a?(w,R)=>{let O=_(w,R);return ef(`${O?"skipped":"crawling"} ${R}`),O}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:x,signal:t.signal}).crawl(d);return t.debug&&ef("internal properties:",{...n,root:d}),[$,r!==d&&!o&&Lwe(r,d)]}function Xwe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function exe(t){let e={...Qwe,...t};return e.cwd=(e.cwd instanceof URL?Dwe(e.cwd):Cwe(e.cwd)).replace(BV,"/"),e.ignore=GV(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Ewe,readdirSync:e.fs.readdirSync||Awe,realpath:e.fs.realpath||Twe,realpathSync:e.fs.realpathSync||Owe,stat:e.fs.stat||Pwe,statSync:e.fs.statSync||Iwe}),e.debug&&ef("globbing with options:",e),e}function txe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=Nwe(t)||typeof t=="string",i=GV((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=exe(n?e:t);return i.length>0?Ywe(o,i):[]}function Fo(t,e){let[r,n]=txe(t,e);return r?Xwe(r.sync(),n):[]}var Nc,Nwe,BV,ZV,jwe,zwe,Fwe,Uwe,qwe,Bwe,Zwe,Hwe,Gwe,Wwe,Kwe,Qwe,tf=y(()=>{gV();Nc=St(UV(),1),Nwe=Array.isArray,BV=/\\/g,ZV=process.platform==="win32",jwe=/^(\/?\.\.)+$/;zwe=/^[A-Z]:\/$/i,Fwe=ZV?t=>zwe.test(t):t=>t==="/";Uwe={parts:!0};qwe=/(?t.replace(qwe,"\\$&"),Hwe=t=>t.replace(Bwe,"\\$&"),Gwe=ZV?Hwe:Zwe;Wwe=/^(\/?\.\.)+/,Kwe=/\\(?=[()[\]{}!*+?@|])/g;Qwe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as B_,readFileSync as rxe,readdirSync as nxe,statSync as VV}from"node:fs";import{join as jc}from"node:path";function ixe(t){let{cwd:e="."}=t,r,n;try{let c=se(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=fi(e,n),o=[],{layers:s,forbiddenImports:a}=XO(r);return s.size>0&&(oxe(e,i,s,o),sxe(e,i,s,o)),a.length>0&&axe(e,i,a,o),o}function XO(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function oxe(t,e,r,n){let i=e.mainRoot,o=jc(t,i);if(B_(o))for(let s of nxe(o)){let a=jc(o,s);VV(a).isDirectory()&&(r.has(s)||n.push({detector:Z_,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function sxe(t,e,r,n){let i=e.mainRoot,o=jc(t,i);if(B_(o))for(let s of r){let a=jc(o,s);B_(a)&&VV(a).isDirectory()||n.push({detector:Z_,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function axe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=jc(t,i,s.from);if(!B_(a))continue;let c=Fo([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=jc(a,l),d;try{d=rxe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];cxe(p,s.to,e.importStyle)&&n.push({detector:Z_,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function cxe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var Z_,WV,QO=y(()=>{"use strict";tf();Tt();Cc();Z_="ARCHITECTURE_FROM_SPEC";WV={name:Z_,run:ixe}});import{existsSync as lxe,readFileSync as uxe}from"node:fs";import{join as dxe}from"node:path";function fxe(t){let{cwd:e="."}=t,r=dxe(e,"spec/capabilities.yaml");if(!lxe(r))return[];let n;try{let c=uxe(r,"utf8"),l=KV.default.parse(c);if(!l||typeof l!="object")return[];n=l}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o;try{let c=se(e);o=new Set(c.features.map(l=>l.id))}catch{return[]}let s=[],a=new Set;for(let c of i){if(typeof c!="object"||c===null)continue;let l=String(c.id??"(unnamed)"),u=Array.isArray(c.features)?c.features:[];if(u.length===0){s.push({detector:H_,severity:"warn",path:"spec/capabilities.yaml",message:`capability "${l}" has no features mapped \u2014 bind at least one feature via the features[] field, or remove the capability if it's no longer relevant`});continue}for(let d of u){let f=String(d);o.has(f)?a.add(f):s.push({detector:H_,severity:"error",path:"spec/capabilities.yaml",message:`capability "${l}" references feature ${f} which does not exist in spec.yaml \u2014 either add the feature or remove it from this capability's features[]`})}}for(let c of o)a.has(c)||s.push({detector:H_,severity:"info",path:"spec.yaml",message:`feature ${c} is not claimed by any capability \u2014 if it's user-facing, consider adding it to a capability's features[] in spec/capabilities.yaml`});return s}var KV,H_,JV,YV=y(()=>{"use strict";KV=St(tr(),1);Tt();H_="CAPABILITIES_FEATURE_MAPPING";JV={name:H_,run:fxe}});import{existsSync as pxe,readFileSync as mxe}from"node:fs";import{join as hxe}from"node:path";function gxe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")}function yxe(t){let{cwd:e="."}=t;return _e(e,eP,r=>_xe(r,e))}function _xe(t,e){let r=fi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=hxe(e,o);if(!pxe(s))continue;let a=mxe(s,"utf8");gxe(a)||n.push({detector:eP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var eP,XV,QV=y(()=>{"use strict";Cc();xt();eP="CONVENTION_DRIFT";XV={name:eP,run:yxe}});import{existsSync as tP,readFileSync as eW}from"node:fs";import{join as G_}from"node:path";function vxe(t){return JSON.parse(t).total?.lines?.pct??0}function tW(t){let e=/tP(G_(c.dir,d)));if(!l){s.push(c.path);continue}let u=tW(eW(G_(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:Ji,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=rW(n,i);return a0?[{detector:Ji,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function wxe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let s=Sxe(e,t.focusModules);if(s)return s}let r=fi(e),n=dt(e).language==="kotlin"?IO.find(s=>tP(G_(e,s)))??L9(e):r.coverageSummary,i=G_(e,n);if(!tP(i))return[{detector:Ji,severity:"info",message:`${n} not present \u2014 run stage_2.2 first`}];let o;try{let s=eW(i,"utf8");o=r.coverageFormat==="jacoco-xml"?bxe(s):vxe(s)}catch(s){return[{detector:Ji,severity:"warn",message:`${n} unparseable: ${s.message}`}]}return o===null?[{detector:Ji,severity:"warn",message:`${n} contained no line-coverage counter`}]:o>=V_?[]:[{detector:Ji,severity:"warn",message:`line coverage ${o.toFixed(1)}% < floor ${V_}%`}]}var Ji,V_,nW,iW=y(()=>{"use strict";R_();Cc();O_();fn();Ji="COVERAGE_DROP",V_=70;nW={name:Ji,run:wxe}});import{existsSync as xxe}from"node:fs";import{join as $xe}from"node:path";function kxe(t){let{cwd:e="."}=t;return _e(e,W_,r=>Exe(r,e))}function Exe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);return r?xxe($xe(e,r.path))?[]:[{detector:W_,severity:"error",path:r.path,message:`project.deliverable.path '${r.path}' is declared but does not exist on disk.`}]:n.length===0?[]:[{detector:W_,severity:"warn",message:`${n.length} done feature(s) ship modules but project.deliverable is not declared \u2014 the gate cannot smoke-test the shipped entry, so a broken entry point could ship green. Declare project.deliverable {path, is_safe_to_smoke: true} to enable DELIVERABLE_SMOKE (stage_2.4).`}]}var W_,oW,sW=y(()=>{"use strict";xt();W_="DELIVERABLE_INTEGRITY";oW={name:W_,run:kxe}});function Axe(t){let e=(t.features??[]).filter(i=>i.status==="done");return e.length===0?[]:!t.project?.deliverable?[]:(t.project?.smoke??[]).length>0?[]:[{detector:rP,severity:"warn",path:"spec.yaml",message:`${e.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function Txe(t){let{cwd:e="."}=t;return _e(e,rP,r=>Axe(r))}var rP,aW,cW=y(()=>{"use strict";xt();rP="SMOKE_PROBE_DEMAND";aW={name:rP,run:Txe}});function Oxe(t){let{cwd:e="."}=t;return _e(e,K_,r=>Pxe(r,e))}function Pxe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=dc(e);if(n===null)return[{detector:K_,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=n.get(o.id),a=$d(e,o.modules??[]);s!==a&&i.push({detector:K_,severity:"warn",path:"spec/attestation.yaml",message:s===void 0?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var K_,lW,uW=y(()=>{"use strict";kd();xt();K_="STALE_ATTESTATION";lW={name:K_,run:Oxe}});function Ixe(t){let{cwd:e="."}=t,r;try{r=se(e)}catch{return[]}return Rxe(r)}function Rxe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:dW,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var dW,fW,pW=y(()=>{"use strict";Tt();dW="DEPENDENCY_CYCLE";fW={name:dW,run:Ixe}});import{appendFileSync as Cxe,existsSync as mW,mkdirSync as Dxe,readFileSync as Nxe}from"node:fs";import{dirname as jxe,join as Mxe}from"node:path";function hW(t){return Mxe(t,zxe,Fxe)}function gW(t){return nP.add(t),()=>nP.delete(t)}function ea(t,e){let r=hW(t),n=jxe(r);mW(n)||Dxe(n,{recursive:!0}),Cxe(r,`${JSON.stringify(e)} -`,"utf8");for(let i of nP)try{i(t,e)}catch{}}function mn(t){let e=hW(t);if(!mW(e))return[];let r=Nxe(e,"utf8").trim();return r.length===0?[]:r.split(` -`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var zxe,Fxe,nP,Mn=y(()=>{"use strict";zxe=".cladding",Fxe="audit.log.jsonl";nP=new Set});import{existsSync as Lxe}from"node:fs";import{join as Uxe}from"node:path";function qxe(t){let{cwd:e="."}=t,r=mn(e);if(r.length===0)return[{detector:iP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(Lxe(Uxe(e,i.artifact))||n.push({detector:iP,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var iP,yW,_W=y(()=>{"use strict";Mn();iP="EVIDENCE_MISMATCH";yW={name:iP,run:qxe}});import{existsSync as Bxe,readFileSync as Zxe}from"node:fs";import{join as Hxe}from"node:path";function Gxe(t){let e=Hxe(t,wW);if(!Bxe(e))return null;try{let n=((0,SW.parse)(Zxe(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*bW(t,e){for(let r of t??[])r.startsWith(vW)&&(yield{ref:r,name:r.slice(vW.length),field:e})}function Vxe(t){let{cwd:e="."}=t,r=Gxe(e);if(r===null)return[];let n;try{n=se(e)}catch(o){return[{detector:oP,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...bW(s.evidence_refs,"evidence_refs"),...bW(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:oP,severity:"warn",path:wW,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var SW,oP,vW,wW,xW,$W=y(()=>{"use strict";SW=St(tr(),1);Tt();oP="FIXTURE_REFERENCE_INVALID",vW="fixture:",wW="conformance/fixtures.yaml";xW={name:oP,run:Vxe}});function Wxe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.secret;if(!n)return[{detector:J_,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=Xe(n.cmd,[...n.args],{cwd:e,reject:!1});return Wd(i)?[{detector:J_,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:D_(i,J_,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var J_,Y_,sP=y(()=>{"use strict";kr();fn();pn();J_="HARDCODED_SECRET";Y_={name:J_,run:Wxe}});import{existsSync as Mc,readFileSync as aP}from"node:fs";import{join as ta}from"node:path";function Kxe(t){return Fo(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec)\.ts$/.test(r)).length}function rf(t){if(!Mc(t))return null;try{return JSON.parse(aP(t,"utf8"))}catch{return null}}function Jxe(t,e){let r=ta(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(aP(r,"utf8"))}catch(c){e.push({detector:Yi,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:Yi,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=Kxe(t);s!==a&&e.push({detector:Yi,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function Yxe(t,e){for(let r of kW){let n=ta(t,r.path);if(!Mc(n))continue;let i=rf(n);if(!i){e.push({detector:Yi,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:Yi,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function Xxe(t,e){let r=rf(ta(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of kW){let s=ta(t,o.path);if(!Mc(s))continue;let a=rf(s);a?.version&&a.version!==n&&e.push({detector:Yi,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=ta(t,".claude-plugin","marketplace.json");if(Mc(i)){let o=rf(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:Yi,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function Qxe(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function e$e(t,e){let r=ta(t,"src","cli","clad.ts"),n=ta(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Mc(r)||!Mc(n))return;let i=Qxe(aP(r,"utf8"));if(i.length===0)return;let s=rf(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:Yi,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function t$e(t){let{cwd:e="."}=t,r=[];return Jxe(e,r),e$e(e,r),Yxe(e,r),Xxe(e,r),r}var Yi,kW,EW,AW=y(()=>{"use strict";tf();Yi="HARNESS_INTEGRITY",kW=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];EW={name:Yi,run:t$e}});import{existsSync as r$e,readFileSync as n$e}from"node:fs";import{join as i$e}from"node:path";function s$e(t){let{cwd:e="."}=t;return _e(e,X_,r=>l$e(r,e))}function a$e(){return o$e}function c$e(t){let e=i$e(t,"spec/capabilities.yaml");if(!r$e(e))return!1;try{let r=TW.default.parse(n$e(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function l$e(t,e){let r=t.features.length;if(r{"use strict";TW=St(tr(),1);xt();X_="HOLLOW_GOVERNANCE",o$e=8;OW={name:X_,run:s$e}});function u$e(t){let{cwd:e="."}=t,r;try{r=se(e)}catch{return[]}let n=[];return IW(r.features.map(i=>i.id),"feature","spec/features/",n),IW((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function IW(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:RW,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var RW,CW,DW=y(()=>{"use strict";Tt();RW="ID_COLLISION";CW={name:RW,run:u$e}});import{existsSync as nf,readFileSync as cP,readdirSync as lP,statSync as d$e,writeFileSync as jW}from"node:fs";import{join as Xi}from"node:path";function NW(t){if(!nf(t))return 0;try{return lP(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function f$e(t){if(!nf(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=lP(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=Xi(n,o),a;try{a=d$e(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function p$e(t){let e=Xi(t,"spec","capabilities.yaml");if(!nf(e))return 0;try{let r=Q_.default.parse(cP(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function Lo(t="."){let e=NW(Xi(t,"spec","features")),r=NW(Xi(t,"spec","scenarios")),n=p$e(t),i=f$e(Xi(t,"tests")),o=new Date().toISOString().slice(0,10);return{features:e,scenarios:r,capabilities:n,test_files:i,last_synced:o}}function zc(t,e){let r=Xi(t,"spec.yaml");if(!nf(r))return;let n=cP(r,"utf8"),i=m$e(n,e);i!==n&&jW(r,i)}function m$e(t,e){let r=t.includes(`\r + if (condition) { yield value; }`)}});import{Buffer as pye}from"node:buffer";import{StringDecoder as mye}from"node:string_decoder";var i_,hye,gye,yye,TT=y(()=>{Ur();i_=(t,e,r)=>{if(r)return;if(t)return{transform:hye.bind(void 0,new TextEncoder)};let n=new mye(e);return{transform:gye.bind(void 0,n),final:yye.bind(void 0,n)}},hye=function*(t,e){pye.isBuffer(e)?yield Zi(e):typeof e=="string"?yield t.encode(e):yield e},gye=function*(t,e){yield Nt(e)?t.write(e):e},yye=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as OH}from"node:util";var OT,o_,PH,_ye,IH,vye,RH=y(()=>{OT=OH(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),o_=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=vye}=e[r];for await(let i of n(t))yield*o_(i,e,r+1)},PH=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*_ye(r,Number(e),t)},_ye=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*o_(n,r,e+1)},IH=OH(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),vye=function*(t){yield t}});var PT,CH,Js,qd,bye,Sye,IT=y(()=>{PT=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},CH=(t,e)=>[...e.flatMap(r=>[...Js(r,t,0)]),...qd(t)],Js=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Sye}=e[r];for(let i of n(t))yield*Js(i,e,r+1)},qd=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*bye(r,Number(e),t)},bye=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Js(n,r,e+1)},Sye=function*(t){yield t}});import{Transform as wye,getDefaultHighWaterMark as DH}from"node:stream";var RT,s_,NH,a_=y(()=>{ur();n_();TH();TT();RH();IT();RT=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=NH(t,s,o),l=Ks(e),u=Ks(r),d=l?OT.bind(void 0,o_,a):PT.bind(void 0,Js),f=l||u?OT.bind(void 0,PH,a):PT.bind(void 0,qd),p=l||u?IH.bind(void 0,a):void 0;return{stream:new wye({writableObjectMode:n,writableHighWaterMark:DH(n),readableObjectMode:i,readableHighWaterMark:DH(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},s_=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=NH(s,r,a);t=CH(c,t)}return t},NH=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:kH(n,a)},i_(r,s,n),r_(r,o,n,c),{transform:t,final:e},{transform:EH(i,a)},$H({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var jH,xye,$ye,kye,Eye,MH=y(()=>{a_();Ur();ur();jH=(t,e)=>{for(let r of xye(t))$ye(t,r,e)},xye=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),$ye=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Mo[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>kye(a,n));r.input=Ed(s)},kye=(t,e)=>{let r=s_(t,e,"utf8",!0);return Eye(r),Ed(r)},Eye=t=>{let e=t.find(r=>typeof r!="string"&&!Nt(r));if(e!==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: ${e}.`)}});var c_,Aye,Tye,zH,FH,Oye,LH,CT=y(()=>{Hs();ur();gc();Co();c_=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&hc(r,n)&&!qr.has(e)&&Aye(n)&&(t.some(({type:i,value:o})=>i==="native"&&Tye.has(o))||t.every(({type:i})=>dn.has(i))),Aye=t=>t===1||t===2,Tye=new Set(["pipe","overlapped"]),zH=async(t,e,r,n)=>{for await(let i of t)Oye(e)||LH(i,r,n)},FH=(t,e,r)=>{for(let n of t)LH(n,e,r)},Oye=t=>t._readableState.pipes.length>0,LH=(t,e,r)=>{let n=ay(t);ai({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as Pye,appendFileSync as Iye}from"node:fs";var UH,Rye,Cye,Dye,Nye,jye,qH=y(()=>{CT();a_();n_();Ur();ur();Ws();UH=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>Rye({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},Rye=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=EZ(t,o,d),p=Zi(f),{stdioItems:m,objectMode:h}=e[r],g=Cye([p],m,c,n),{serializedResult:b,finalResult:_=b}=Dye({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});Nye({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let x=a[r]?_:void 0;try{return n.error===void 0&&jye(b,m,i),x}catch($){return n.error=$,x}},Cye=(t,e,r,n)=>{try{return s_(t,e,r,!1)}catch(i){return n.error=i,t}},Dye=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Ed(t)};let s=g4(t,r);return n[o]?{serializedResult:s,finalResult:AT(s,!i[o],e)}:{serializedResult:s}},Nye=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!c_({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=AT(t,!1,s);try{FH(a,e,n)}catch(c){r.error??=c}},jye=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>Qy.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?Iye(n,t):(r.add(o),Pye(n,t))}}});var BH,ZH=y(()=>{Ur();Ud();BH=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Ki(e,r,"all")]:Array.isArray(e)?[Ki(t,r,"all"),...e]:Nt(t)&&Nt(e)?wA([t,e]):`${t}${e}`}});import{once as DT}from"node:events";var HH,Mye,GH,VH,zye,NT,jT=y(()=>{Bs();HH=async(t,e)=>{let[r,n]=await Mye(t);return e.isForcefullyTerminated??=!1,[r,n]},Mye=async t=>{let[e,r]=await Promise.allSettled([DT(t,"spawn"),DT(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?GH(t):r.value},GH=async t=>{try{return await DT(t,"exit")}catch{return GH(t)}},VH=async t=>{let[e,r]=await t;if(!zye(e,r)&&NT(e,r))throw new Dn;return[e,r]},zye=(t,e)=>t===void 0&&e===void 0,NT=(t,e)=>t!==0||e!==null});var WH,Fye,KH=y(()=>{Bs();Ws();jT();WH=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=Fye(t,e,r),s=o?.code==="ETIMEDOUT",a=kZ(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},Fye=(t,e,r)=>t!==void 0?t:NT(e,r)?new Dn:void 0});import{spawnSync as Lye}from"node:child_process";var JH,Uye,qye,Bye,l_,Zye,Hye,Gye,Vye,YH=y(()=>{IA();oT();sT();Ld();Jy();SH();Ud();MH();qH();Ws();ZH();KH();JH=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=Uye(t,e,r),d=Zye({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Ac(d,c,l)},Uye=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=uy(t,e,r),a=qye(r),{file:c,commandArguments:l,options:u}=My(t,e,a);Bye(u);let d=vH(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},qye=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Bye=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&l_("ipcInput"),t&&l_("ipc: true"),r&&l_("detached: true"),n&&l_("cancelSignal")},l_=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Zye=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=Hye({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=WH(c,r),{output:m,error:h=l}=UH({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,x)=>Ki(_,r,x)),b=Ki(BH(m,r),r,"all");return Vye({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},Hye=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{jH(o,r);let a=Gye(r);return Lye(...zy(t,e,a))}catch(a){return Ec({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},Gye=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Wy(e)}),Vye=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?Ky({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):Fd({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as MT,on as Wye}from"node:events";var XH,Kye,Jye,Yye,Xye,QH=y(()=>{Sc();Dd();Cd();XH=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(vc({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Py(t)}),Kye({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),Kye=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{xy(e,i);let o=jo(t,e,r),s=new AbortController;try{return await Promise.race([Jye(o,n,s),Yye(o,r,s),Xye(o,r,s)])}catch(a){throw bc(t),a}finally{s.abort(),$y(e,i)}},Jye=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await MT(t,"message",{signal:r});return n}for await(let[n]of Wye(t,"message",{signal:r}))if(e(n))return n},Yye=async(t,e,{signal:r})=>{await MT(t,"disconnect",{signal:r}),uB(e)},Xye=async(t,e,{signal:r})=>{let[n]=await MT(t,"strict:error",{signal:r});throw vy(n,e)}});import{once as tG,on as Qye}from"node:events";var rG,zT,e_e,t_e,r_e,eG,FT=y(()=>{Sc();Dd();Cd();rG=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>zT({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),zT=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{vc({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Py(t)}),xy(e,o);let s=jo(t,e,r),a=new AbortController,c={};return e_e(t,s,a),t_e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),r_e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},e_e=async(t,e,r)=>{try{await tG(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},t_e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await tG(t,"strict:error",{signal:r.signal});n.error=vy(i,e),r.abort()}catch{}},r_e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of Qye(r,"message",{signal:o.signal}))eG(s),yield c}catch{eG(s)}finally{o.abort(),$y(e,a),n||bc(t),i&&await t}},eG=({error:t})=>{if(t)throw t}});import nG from"node:process";var iG,oG,sG,LT=y(()=>{Ny();QH();FT();Ty();iG=(t,{ipc:e})=>{Object.assign(t,sG(t,!1,e))},oG=()=>{let t=nG,e=!0,r=nG.channel!==void 0;return{...sG(t,e,r),getCancelSignal:zB.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},sG=(t,e,r)=>({sendMessage:Dy.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:XH.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:rG.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as n_e}from"node:child_process";import{PassThrough as i_e,Readable as o_e,Writable as s_e,Duplex as a_e}from"node:stream";var aG,c_e,Bd,l_e,u_e,d_e,f_e,cG=y(()=>{t_();Ld();Jy();aG=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{$T(n);let a=new n_e;c_e(a,n),Object.assign(a,{readable:l_e,writable:u_e,duplex:d_e});let c=Ec({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=f_e(c,s,i);return{subprocess:a,promise:l}},c_e=(t,e)=>{let r=Bd(),n=Bd(),i=Bd(),o=Array.from({length:e.length-3},Bd),s=Bd(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},Bd=()=>{let t=new i_e;return t.end(),t},l_e=()=>new o_e({read(){}}),u_e=()=>new s_e({write(){}}),d_e=()=>new a_e({read(){},write(){}}),f_e=async(t,e,r)=>Ac(t,e,r)});import{createReadStream as lG,createWriteStream as uG}from"node:fs";import{Buffer as p_e}from"node:buffer";import{Readable as Zd,Writable as m_e,Duplex as h_e}from"node:stream";var fG,Hd,dG,g_e,pG=y(()=>{a_();t_();ur();fG=(t,e)=>e_(g_e,t,e,!1),Hd=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Mo[t]}.`)},dG={fileNumber:Hd,generator:RT,asyncGenerator:RT,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:h_e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},g_e={input:{...dG,fileUrl:({value:t})=>({stream:lG(t)}),filePath:({value:{file:t}})=>({stream:lG(t)}),webStream:({value:t})=>({stream:Zd.fromWeb(t)}),iterable:({value:t})=>({stream:Zd.from(t)}),asyncIterable:({value:t})=>({stream:Zd.from(t)}),string:({value:t})=>({stream:Zd.from(t)}),uint8Array:({value:t})=>({stream:Zd.from(p_e.from(t))})},output:{...dG,fileUrl:({value:t})=>({stream:uG(t)}),filePath:({value:{file:t,append:e}})=>({stream:uG(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:m_e.fromWeb(t)}),iterable:Hd,asyncIterable:Hd,string:Hd,uint8Array:Hd}}});import{on as y_e,once as mG}from"node:events";import{PassThrough as __e,getDefaultHighWaterMark as v_e}from"node:stream";import{finished as yG}from"node:stream/promises";function Ys(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)qT(i);let e=t.some(({readableObjectMode:i})=>i),r=b_e(t,e),n=new UT({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var b_e,UT,S_e,w_e,x_e,qT,$_e,k_e,E_e,A_e,T_e,_G,vG,BT,bG,O_e,u_,hG,gG,d_=y(()=>{b_e=(t,e)=>{if(t.length===0)return v_e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},UT=class extends __e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(qT(e),this.#t.has(e))return;this.#t.add(e),this.#n??=S_e(this,this.#t,this.#o);let r=$_e({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(qT(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},S_e=async(t,e,r)=>{u_(t,hG);let n=new AbortController;try{await Promise.race([w_e(t,n),x_e(t,e,r,n)])}finally{n.abort(),u_(t,-hG)}},w_e=async(t,{signal:e})=>{try{await yG(t,{signal:e,cleanup:!0})}catch(r){throw _G(t,r),r}},x_e=async(t,e,r,{signal:n})=>{for await(let[i]of y_e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},qT=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},$_e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{u_(t,gG);let a=new AbortController;try{await Promise.race([k_e(o,e,a),E_e({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),A_e({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),u_(t,-gG)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?BT(t):T_e(t))},k_e=async(t,e,{signal:r})=>{try{await t,r.aborted||BT(e)}catch(n){r.aborted||_G(e,n)}},E_e=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await yG(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;vG(s)?i.add(e):bG(t,s)}},A_e=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await mG(t,i,{signal:o}),!t.readable)return mG(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},T_e=t=>{t.writable&&t.end()},_G=(t,e)=>{vG(e)?BT(t):bG(t,e)},vG=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",BT=t=>{(t.readable||t.writable)&&t.destroy()},bG=(t,e)=>{t.destroyed||(t.once("error",O_e),t.destroy(e))},O_e=()=>{},u_=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},hG=2,gG=1});import{finished as SG}from"node:stream/promises";var Oc,P_e,ZT,I_e,HT,f_=y(()=>{Hi();Oc=(t,e)=>{t.pipe(e),P_e(t,e),I_e(t,e)},P_e=async(t,e)=>{if(!(Cn(t)||Cn(e))){try{await SG(t,{cleanup:!0,readable:!0,writable:!1})}catch{}ZT(e)}},ZT=t=>{t.writable&&t.end()},I_e=async(t,e)=>{if(!(Cn(t)||Cn(e))){try{await SG(e,{cleanup:!0,readable:!1,writable:!0})}catch{}HT(t)}},HT=t=>{t.readable&&t.destroy()}});var wG,R_e,C_e,D_e,N_e,j_e,xG=y(()=>{d_();Hi();wy();ur();f_();wG=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>dn.has(c)))R_e(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!dn.has(c)))D_e({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Ys(o);Oc(s,i)}},R_e=(t,e,r,n)=>{r==="output"?Oc(t.stdio[n],e):Oc(e,t.stdio[n]);let i=C_e[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},C_e=["stdin","stdout","stderr"],D_e=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;N_e(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},N_e=(t,{signal:e})=>{Cn(t)&&Zs(t,j_e,e)},j_e=2});var Xs,$G=y(()=>{Xs=[];Xs.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Xs.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Xs.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var p_,GT,VT,M_e,WT,m_,z_e,KT,JT,YT,kG,T8e,O8e,EG=y(()=>{$G();p_=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",GT=Symbol.for("signal-exit emitter"),VT=globalThis,M_e=Object.defineProperty.bind(Object),WT=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(VT[GT])return VT[GT];M_e(VT,GT,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},m_=class{},z_e=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),KT=class extends m_{onExit(){return()=>{}}load(){}unload(){}},JT=class extends m_{#t=YT.platform==="win32"?"SIGINT":"SIGHUP";#r=new WT;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of Xs)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!p_(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),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 e of Xs)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,Xs.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return p_(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&p_(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},YT=globalThis.process,{onExit:kG,load:T8e,unload:O8e}=z_e(p_(YT)?new JT(YT):new KT)});import{addAbortListener as F_e}from"node:events";var AG,TG=y(()=>{EG();AG=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=kG(()=>{t.kill()});F_e(n,()=>{i()})}});var PG,L_e,U_e,OG,q_e,IG=y(()=>{SA();ly();No();pc();PG=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=cy(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=L_e(r,n,i),{sourceStream:d,sourceError:f}=q_e(t,l),{options:p,fileDescriptors:m}=li.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},L_e=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=U_e(t,e,...r),a=Sy(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},U_e=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(OG,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||vA(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=Yg(r,...n);return{destination:e(OG)(i,o,s),pipeOptions:s}}if(li.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},OG=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),q_e=(t,e)=>{try{return{sourceStream:xc(t,e)}}catch(r){return{sourceError:r}}}});var CG,B_e,XT,RG,QT=y(()=>{Ld();f_();CG=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=B_e({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw XT({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},B_e=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return HT(t),n;if(e!==void 0)return ZT(r),e},XT=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Ec({error:t,command:RG,escapedCommand:RG,fileDescriptors:e,options:r,startTime:n,isSync:!1}),RG="source.pipe(destination)"});var DG,NG=y(()=>{DG=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as Z_e}from"node:stream/promises";var jG,H_e,G_e,V_e,h_,W_e,K_e,MG=y(()=>{d_();wy();f_();jG=(t,e,r)=>{let n=h_.has(e)?G_e(t,e):H_e(t,e);return Zs(t,W_e,r.signal),Zs(e,K_e,r.signal),V_e(e),n},H_e=(t,e)=>{let r=Ys([t]);return Oc(r,e),h_.set(e,r),r},G_e=(t,e)=>{let r=h_.get(e);return r.add(t),r},V_e=async t=>{try{await Z_e(t,{cleanup:!0,readable:!1,writable:!0})}catch{}h_.delete(t)},h_=new WeakMap,W_e=2,K_e=1});import{aborted as J_e}from"node:util";var zG,Y_e,FG=y(()=>{QT();zG=(t,e)=>t===void 0?[]:[Y_e(t,e)],Y_e=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await J_e(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw XT({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var g_,X_e,Q_e,LG=y(()=>{Bi();IG();QT();NG();MG();FG();g_=(t,...e)=>{if(wt(e[0]))return g_.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=PG(t,...e),i=X_e({...n,destination:r});return i.pipe=g_.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},X_e=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=Q_e(t,i);CG({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=jG(e,o,d);return await Promise.race([DG(u),...zG(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Q_e=(t,e)=>Promise.allSettled([t,e])});import{on as eve}from"node:events";import{getDefaultHighWaterMark as tve}from"node:stream";var y_,rve,eO,nve,qG,tO,UG,ive,ove,__=y(()=>{TT();n_();IT();y_=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return rve(e,s),qG({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},rve=async(t,e)=>{try{await t}catch{}finally{e.abort()}},eO=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;nve(e,s,t);let a=t.readableObjectMode&&!o;return qG({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},nve=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},qG=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=eve(t,"data",{signal:e.signal,highWaterMark:UG,highWatermark:UG});return ive({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},tO=tve(!0),UG=tO,ive=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=ove({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Js(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*qd(a)}},ove=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[i_(t,r,!e),r_(t,i,!n,{})].filter(Boolean)});import{setImmediate as sve}from"node:timers/promises";var BG,ave,cve,lve,rO,ZG,nO=y(()=>{Vy();Ur();CT();__();Ws();Ud();BG=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=ave({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([cve(t),d]);return}let f=kT(c,r),p=eO({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([lve({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},ave=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!c_({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=eO({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await zH(a,t,r,o)},cve=async t=>{await sve(),t.readableFlowing===null&&t.resume()},lve=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await By(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Zy(r,{maxBuffer:o})):await Gy(r,{maxBuffer:o})}catch(a){return ZG(wZ({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},rO=async t=>{try{return await t}catch(e){return ZG(e)}},ZG=({bufferedData:t})=>m4(t)?new Uint8Array(t):t});import{finished as uve}from"node:stream/promises";var Gd,dve,fve,pve,mve,hve,iO,v_,HG,b_=y(()=>{Gd=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=dve(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],uve(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||mve(a,e,r,n)}finally{s.abort()}},dve=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&fve(t,r,n),n},fve=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{pve(e,r),n.call(t,...i)}},pve=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},mve=(t,e,r,n)=>{if(!hve(t,e,r,n))throw t},hve=(t,e,r,n=!0)=>r.propagating?HG(t)||v_(t):(r.propagating=!0,iO(r,e)===n?HG(t):v_(t)),iO=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",v_=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",HG=t=>t?.code==="EPIPE"});var GG,oO,sO=y(()=>{nO();b_();GG=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>oO({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),oO=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=Gd(t,e,l);if(iO(l,e)){await u;return}let[d]=await Promise.all([BG({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var VG,WG,gve,yve,aO=y(()=>{d_();sO();VG=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Ys([t,e].filter(Boolean)):void 0,WG=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>oO({...gve(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:yve(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),gve=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},yve=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var KG,JG,YG=y(()=>{gc();Co();KG=t=>hc(t,"ipc"),JG=(t,e)=>{let r=ay(t);ai({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var XG,QG,e9=y(()=>{Ws();YG();Vi();FT();XG=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=KG(o),a=Gi(e,"ipc"),c=Gi(r,"ipc");for await(let l of zT({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(xZ(t,i,c),i.push(l)),s&&JG(l,o);return i},QG=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as _ve}from"node:events";var t9,vve,bve,Sve,r9=y(()=>{Vs();eT();HA();QA();Hi();ur();nO();e9();rT();aO();sO();jT();b_();t9=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:b})=>{let _=HH(t,f),x={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},$=GG({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:x}),w=WG({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:x}),R=[],O=XG({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:R,verboseInfo:p}),A=vve(h,t,x),N=bve(m,x);try{return await Promise.race([Promise.all([{},VH(_),Promise.all($),w,O,WB(t,d),...A,...N]),g,Sve(t,b),...BB(t,o,f,b),...lB({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...UB({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch(k){return f.terminationReason??="other",Promise.all([{error:k},_,Promise.all($.map(Z=>rO(Z))),rO(w),QG(O,R),Promise.allSettled(A),Promise.allSettled(N)])}},vve=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:Gd(n,i,r)),bve=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>jn(o,{checkOpen:!1})&&!Cn(o)).map(({type:i,value:o,stream:s=o})=>Gd(s,n,e,{isSameDirection:dn.has(i),stopOnExit:i==="native"}))),Sve=async(t,{signal:e})=>{let[r]=await _ve(t,"error",{signal:e});throw r}});var n9,Vd,Pc,S_=y(()=>{wc();n9=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Vd=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=ci();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Pc=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as i9}from"node:stream/promises";var cO,o9,lO,uO,w_,x_,dO=y(()=>{b_();cO=async t=>{if(t!==void 0)try{await lO(t)}catch{}},o9=async t=>{if(t!==void 0)try{await uO(t)}catch{}},lO=async t=>{await i9(t,{cleanup:!0,readable:!1,writable:!0})},uO=async t=>{await i9(t,{cleanup:!0,readable:!0,writable:!1})},w_=async(t,e)=>{if(await t,e)throw e},x_=(t,e,r)=>{r&&!v_(r)?t.destroy(r):e&&t.destroy()}});import{Readable as wve}from"node:stream";import{callbackify as xve}from"node:util";var s9,fO,pO,mO,$ve,hO,gO,a9,yO=y(()=>{Hs();No();__();wc();S_();dO();s9=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||qr.has(r),{subprocessStdout:a,waitReadableDestroy:c}=fO(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=pO(a,s),{read:f,onStdoutDataDone:p}=mO({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new wve({read:f,destroy:xve(gO.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return hO({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},fO=(t,e,r)=>{let n=xc(t,e),i=Vd(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},pO=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:tO},mO=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=ci(),s=y_({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){$ve(this,s,o)},onStdoutDataDone:o}},$ve=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},hO=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await uO(t),await n,await cO(i),await e,r.readable&&r.push(null)}catch(o){await cO(i),a9(r,o)}},gO=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Pc(r,e)&&(a9(t,n),await w_(e,n))},a9=(t,e)=>{x_(t,t.readable,e)}});import{Writable as kve}from"node:stream";import{callbackify as c9}from"node:util";var l9,_O,vO,Eve,Ave,bO,SO,u9,wO=y(()=>{No();S_();dO();l9=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=_O(t,r,e),s=new kve({...vO(n,t,i),destroy:c9(SO.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return bO(n,s),s},_O=(t,e,r)=>{let n=Sy(t,e),i=Vd(r,n,"writableFinal"),o=Vd(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},vO=(t,e,r)=>({write:Eve.bind(void 0,t),final:c9(Ave.bind(void 0,t,e,r))}),Eve=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},Ave=async(t,e,r)=>{await Pc(r,e)&&(t.writable&&t.end(),await e)},bO=async(t,e,r)=>{try{await lO(t),e.writable&&e.end()}catch(n){await o9(r),u9(e,n)}},SO=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Pc(r,e),await Pc(n,e)&&(u9(t,i),await w_(e,i))},u9=(t,e)=>{x_(t,t.writable,e)}});import{Duplex as Tve}from"node:stream";import{callbackify as Ove}from"node:util";var d9,Pve,f9=y(()=>{Hs();yO();wO();d9=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||qr.has(r),{subprocessStdout:c,waitReadableDestroy:l}=fO(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=_O(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=pO(c,a),{read:g,onStdoutDataDone:b}=mO({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new Tve({read:g,...vO(u,t,d),destroy:Ove(Pve.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return hO({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),bO(u,_,c),_},Pve=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([gO({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),SO({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var xO,Ive,p9=y(()=>{Hs();No();__();xO=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||qr.has(e),s=xc(t,r),a=y_({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return Ive(a,s,t)},Ive=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var m9,h9=y(()=>{S_();yO();wO();f9();p9();m9=(t,{encoding:e})=>{let r=n9();t.readable=s9.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=l9.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=d9.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=xO.bind(void 0,t,e),t[Symbol.asyncIterator]=xO.bind(void 0,t,e,{})}});var g9,Rve,Cve,y9=y(()=>{g9=(t,e)=>{for(let[r,n]of Cve){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},Rve=(async()=>{})().constructor.prototype,Cve=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Rve,t)])});import{setMaxListeners as Dve}from"node:events";import{spawn as Nve}from"node:child_process";var _9,jve,Mve,zve,Fve,Lve,v9=y(()=>{Vy();IA();oT();No();sT();LT();Ld();Jy();cG();pG();Ud();xG();yy();TG();LG();aO();r9();h9();wc();y9();_9=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=jve(t,e,r),{subprocess:f,promise:p}=zve({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=g_.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),g9(f,p),li.set(f,{options:u,fileDescriptors:d}),f},jve=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=uy(t,e,r),{file:a,commandArguments:c,options:l}=My(t,e,r),u=Mve(l),d=fG(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},Mve=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},zve=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=Nve(...zy(t,e,r))}catch(m){return aG({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;Dve(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];wG(c,a,l),AG(c,r,l);let d={},f=ci();c.kill=aB.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=VG(c,r),m9(c,r),iG(c,r);let p=Fve({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Fve=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await t9({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map(($,w)=>Ki($,e,w)),_=Ki(h,e,"all"),x=Lve({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Ac(x,n,e)},Lve=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?Fd({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof ui,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):Ky({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var $_,Uve,qve,b9=y(()=>{Bi();Vi();$_=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,Uve(n,t[n],i)]));return{...t,...r}},Uve=(t,e,r)=>qve.has(t)&&wt(e)&&wt(r)?{...e,...r}:r,qve=new Set(["env",...EA])});var zo,Bve,Zve,S9=y(()=>{Bi();SA();w4();YH();v9();b9();zo=(t,e,r,n)=>{let i=(s,a,c)=>zo(s,a,r,c),o=(...s)=>Bve({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},Bve=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(wt(o))return i(t,$_(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=Zve({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?JH(a,c,l):_9(a,c,l,i)},Zve=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=b4(e)?S4(e,r):[e,...r],[s,a,c]=Yg(...o),l=$_($_(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var w9,x9,$9,Hve,Gve,k9=y(()=>{w9=({file:t,commandArguments:e})=>$9(t,e),x9=({file:t,commandArguments:e})=>({...$9(t,e),isSync:!0}),$9=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=Hve(t);return{file:r,commandArguments:n}},Hve=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(Gve)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},Gve=/ +/g});var E9,A9,Vve,T9,Wve,O9,P9=y(()=>{E9=(t,e,r)=>{t.sync=e(Vve,r),t.s=t.sync},A9=({options:t})=>T9(t),Vve=({options:t})=>({...T9(t),isSync:!0}),T9=t=>({options:{...Wve(t),...t}}),Wve=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},O9={preferLocal:!0}});var _7e,Xe,v7e,b7e,S7e,w7e,x7e,$7e,k7e,E7e,kr=y(()=>{S9();k9();tT();P9();LT();_7e=zo(()=>({})),Xe=zo(()=>({isSync:!0})),v7e=zo(w9),b7e=zo(x9),S7e=zo(HB),w7e=zo(A9,{},O9,E9),{sendMessage:x7e,getOneMessage:$7e,getEachMessage:k7e,getCancelSignal:E7e}=oG()});import{existsSync as k_,statSync as Kve}from"node:fs";import{dirname as $O,extname as Jve,isAbsolute as I9,join as kO,relative as EO,resolve as E_,sep as Yve}from"node:path";function A_(t){return t==="./gradlew"||t==="gradle"}function Xve(t){return(k_(kO(t,"build.gradle.kts"))||k_(kO(t,"build.gradle")))&&k_(kO(t,"gradle.properties"))}function Qve(t,e){let n=EO(t,e).split(Yve).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function Fo(t,e){return t===":"?`:${e}`:`${t}:${e}`}function ebe(t,e){let r=E_(t,e),n=r;k_(r)?Kve(r).isFile()&&(n=$O(r)):Jve(r)!==""&&(n=$O(r));let i=EO(t,n);if(i.startsWith("..")||I9(i))return null;let o=n;for(;;){if(Xve(o))return o;if(E_(o)===E_(t))return null;let s=$O(o);if(s===o)return null;let a=EO(t,s);if(a.startsWith("..")||I9(a))return null;o=s}}function T_(t,e){let r=E_(t),n=new Map,i=[];for(let o of e){let s=ebe(r,o);if(!s){i.push(o);continue}let a=Qve(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var O_=y(()=>{"use strict"});import{existsSync as tbe,readFileSync as rbe}from"node:fs";import{join as nbe}from"node:path";function Ic(t="."){let e=nbe(t,".cladding","config.yaml");if(!tbe(e))return AO;try{let n=(0,R9.parse)(rbe(e,"utf8"))?.gate;if(!n)return AO;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of ibe){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return AO}}function C9(t,e){let r=[],n=!1;for(let i of t){let o=obe.exec(i);if(o){n=!0;for(let s of e)r.push(Fo(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var R9,ibe,AO,obe,P_=y(()=>{"use strict";R9=St(tr(),1);O_();ibe=["type","lint","test","coverage"],AO={scope:"feature"};obe=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as OO,readFileSync as D9,readdirSync as sbe,statSync as abe}from"node:fs";import{join as I_}from"node:path";function RO(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=I_(t,e);if(OO(r))try{if(N9.test(D9(r,"utf8")))return!0}catch{}}return!1}function j9(t){try{return OO(t)&&N9.test(D9(t,"utf8"))}catch{return!1}}function M9(t,e=0){if(e>4||!OO(t))return!1;let r;try{r=sbe(t)}catch{return!1}for(let n of r){let i=I_(t,n),o=!1;try{o=abe(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(M9(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&j9(i))return!0}return!1}function ube(t){if(RO(t))return!0;for(let e of cbe)if(j9(I_(t,e)))return!0;for(let e of lbe)if(M9(I_(t,e)))return!0;return!1}function z9(t="."){let e=Ic(t).coverage;return e||(ube(t)?"kover":"jacoco")}function F9(t="."){return PO[z9(t)]}function L9(t="."){return TO[z9(t)]}var PO,TO,IO,N9,cbe,lbe,R_=y(()=>{"use strict";P_();PO={kover:"koverXmlReport",jacoco:"jacocoTestReport"},TO={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},IO=[TO.kover,TO.jacoco],N9=/kover/i;cbe=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],lbe=["buildSrc","build-logic"]});import{existsSync as CO,readdirSync as U9}from"node:fs";import{join as C_}from"node:path";function DO(t){return CO(C_(t,"gradlew"))?"./gradlew":"gradle"}function dbe(t){let e=DO(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[F9(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function pbe(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function gbe(t,e){for(let r of e)if(CO(C_(t,r)))return r}function ybe(t,e){try{return U9(t).find(n=>n.endsWith(e))}catch{return}}function vbe(t,e){for(let r of _be)if(r.configs.some(n=>CO(C_(t,n))))return r.gate;return e}function dt(t="."){for(let e of mbe){let r;for(let o of e.manifests)if(o.startsWith(".")?r=ybe(t,o):r=gbe(t,[o]),r)break;if(!r||e.requiresSource&&!pbe(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"&&n.lint?{...n,lint:vbe(t,n.lint)}:n;return{language:e.language,manifest:r,gates:i}}return hbe}var fbe,mbe,hbe,_be,fn=y(()=>{"use strict";R_();fbe=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);mbe=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:["--no-install","tsc","--noEmit"]},lint:{cmd:"npx",args:["--no-install","eslint","."]},test:{cmd:"npx",args:["--no-install","vitest","run"]},coverage:{cmd:"npx",args:["--no-install","vitest","run","--coverage"]},secret:{cmd:"npx",args:["--no-install","secretlint","**/*"]},arch:{cmd:"npx",args:["--no-install","madge","--circular","--extensions","ts","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:dbe},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}],hbe={language:"unknown",manifest:"",gates:{}};_be=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:["--no-install","biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:["--no-install","oxlint"]}}]});import{existsSync as bbe,readFileSync as Sbe}from"node:fs";import{join as wbe}from"node:path";function Wd(t){return t.code==="ENOENT"}function D_(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return q9.test(o)||q9.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function jt(t,e,r){return Wd(r)?{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`}:null}function rr(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Rc(t,e){let r=wbe(t,"package.json");if(!bbe(r))return!1;try{return!!JSON.parse(Sbe(r,"utf8")).scripts?.[e]}catch{return!1}}var q9,pn=y(()=>{"use strict";q9=/config (is |file )?not found|no such file|ENOENT|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function xbe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.arch;if(!n)return[{detector:N_,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=Xe(n.cmd,[...n.args],{cwd:e,reject:!1});return Wd(i)?[{detector:N_,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:D_(i,N_,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var N_,j_,NO=y(()=>{"use strict";kr();fn();pn();N_="ARCHITECTURE_VIOLATION";j_={name:N_,run:xbe}});import B9 from"node:process";function Qs(t={}){let r=j_.run(t).filter(o=>o.severity==="error"),n=r.length===0,i={stage:$be,pass:n,exitCode:n?0:1};return n?i:{...i,stderr:r.map(o=>o.message).join(` +`)}}var $be,kbe,M_=y(()=>{"use strict";NO();$be="stage_1.5";kbe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${B9.argv[1]}`;if(kbe){let t=Qs();console.log(JSON.stringify(t)),B9.exit(t.exitCode)}});import{existsSync as jO,readdirSync as Z9}from"node:fs";import{join as z_}from"node:path";function Abe(t,e){let r=z_(t,e.path);if(!jO(r))return!0;if(e.isDirectory)try{return Z9(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function Tbe(t){let{cwd:e="."}=t,r=[];for(let i of Ebe)Abe(e,i)&&r.push({detector:Kd,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=z_(e,"spec.yaml");if(jO(n)){let i=Ibe(n),o=i?null:Obe(e);if(i)r.push({detector:Kd,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:Kd,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=Pbe(e);s&&r.push({detector:Kd,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function Obe(t){for(let e of["spec/features","spec/scenarios"]){let r=z_(t,e);if(!jO(r))continue;let n;try{n=Z9(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{ii(z_(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function Pbe(t){try{return se(t),null}catch(e){return e.message}}function Ibe(t){let e;try{e=ii(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var Kd,Ebe,H9,G9=y(()=>{"use strict";Tt();Hg();Kd="ABSENCE_OF_GOVERNANCE",Ebe=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];H9={name:Kd,run:Tbe}});function F_(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function MO(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=F_(r)==="while",o=Cbe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${F_(r)}'`}let n=Rbe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:F_(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${F_(r)}'`:null}function Dbe(t,e){let r=MO(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function V9(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...Dbe(r,n));return e}var Rbe,Cbe,zO=y(()=>{"use strict";Rbe={event:"when",state:"while",optional:"where",unwanted:"if"},Cbe=/\bwhen\b/i});function _e(t,e,r){let n;try{n=se(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var xt=y(()=>{"use strict";Tt()});function Nbe(t){let{cwd:e="."}=t;return _e(e,L_,jbe)}function jbe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:L_,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of V9(t.features))e.push({detector:L_,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var L_,W9,K9=y(()=>{"use strict";zO();xt();L_="AC_DRIFT";W9={name:L_,run:Nbe}});function fi(t=".",e){let n=(e??"").trim().toLowerCase()||dt(t).language;return Lbe[n]??J9}var Mbe,zbe,J9,Fbe,Lbe,Cc=y(()=>{"use strict";fn();Mbe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,zbe=/^[ \t]*import\s+([\w.]+)/gm,J9={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:Mbe,importStyle:"relative"},Fbe={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:zbe,importStyle:"dotted"},Lbe={typescript:J9,kotlin:Fbe}});import{existsSync as Ube,readFileSync as qbe,readdirSync as Bbe,statSync as Zbe}from"node:fs";import{join as X9,relative as Y9}from"node:path";function Hbe(t,e){if(!Ube(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=Bbe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=X9(i,s),c;try{c=Zbe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function Gbe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function Wbe(t){return Vbe.test(t)}function Kbe(t){let{cwd:e="."}=t,r;try{r=se(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=fi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>Hbe(X9(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=qbe(a,"utf8")}catch{continue}let l=c.split(` +`);for(let u=0;u{"use strict";Tt();Cc();Q9="AI_HINTS_FORBIDDEN_PATTERN";Vbe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;eV={name:Q9,run:Kbe}});function Jbe(t){let{cwd:e="."}=t,r;try{r=se(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:rV,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var rV,nV,iV=y(()=>{"use strict";Tt();rV="AC_DUPLICATE_WITHIN_FEATURE";nV={name:rV,run:Jbe}});import{createRequire as Ybe}from"module";import{basename as Xbe,dirname as LO,normalize as Qbe,relative as eSe,resolve as tSe,sep as aV}from"path";import*as rSe from"fs";function nSe(t){let e=Qbe(t);return e.length>1&&e[e.length-1]===aV&&(e=e.substring(0,e.length-1)),e}function cV(t,e){return t.replace(iSe,e)}function sSe(t){return t==="/"||oSe.test(t)}function FO(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=tSe(t)),(n||o)&&(t=nSe(t)),t===".")return"";let s=t[t.length-1]!==i;return cV(s?t+i:t,i)}function lV(t,e){return e+t}function aSe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:cV(eSe(t,n),e.pathSeparator)+e.pathSeparator+r}}function cSe(t){return t}function lSe(t,e,r){return e+t+r}function uSe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?aSe(t,e):n?lV:cSe}function dSe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function fSe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function gSe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?fSe(t):dSe(t):n&&n.length?mSe:pSe:hSe}function wSe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?SSe:r&&r.length?n?ySe:_Se:n?vSe:bSe}function kSe(t){return t.group?$Se:xSe}function TSe(t){return t.group?ESe:ASe}function ISe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?PSe:OSe}function uV(t,e,r){if(r.options.useRealPaths)return RSe(e,r);let n=LO(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=LO(n)}return r.symlinks.set(t,e),i>1}function RSe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function U_(t,e,r,n){e(t&&!n?t:null,r)}function USe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?CSe:MSe:n?e?DSe:LSe:i?e?jSe:FSe:e?NSe:zSe}function ZSe(t){return t?BSe:qSe}function WSe(t,e){return new Promise((r,n)=>{pV(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function pV(t,e,r){new fV(t,e,r).start()}function KSe(t,e){return new fV(t,e).start()}var oV,iSe,oSe,pSe,mSe,hSe,ySe,_Se,vSe,bSe,SSe,xSe,$Se,ESe,ASe,OSe,PSe,CSe,DSe,NSe,jSe,MSe,zSe,FSe,LSe,dV,qSe,BSe,HSe,GSe,VSe,fV,sV,mV,hV,gV=y(()=>{oV=Ybe(import.meta.url);iSe=/[\\/]/g;oSe=/^[a-z]:[\\/]$/i;pSe=(t,e)=>{e.push(t||".")},mSe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},hSe=()=>{};ySe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},_Se=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},vSe=(t,e,r,n)=>{r.files++},bSe=(t,e)=>{e.push(t)},SSe=()=>{};xSe=t=>t,$Se=()=>[""].slice(0,0);ESe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},ASe=()=>{};OSe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&uV(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},PSe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&uV(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};CSe=t=>t.counts,DSe=t=>t.groups,NSe=t=>t.paths,jSe=t=>t.paths.slice(0,t.options.maxFiles),MSe=(t,e,r)=>(U_(e,r,t.counts,t.options.suppressErrors),null),zSe=(t,e,r)=>(U_(e,r,t.paths,t.options.suppressErrors),null),FSe=(t,e,r)=>(U_(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),LSe=(t,e,r)=>(U_(e,r,t.groups,t.options.suppressErrors),null);dV={withFileTypes:!0},qSe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",dV,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},BSe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",dV)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};HSe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},GSe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},VSe=class{aborted=!1;abort(){this.aborted=!0}},fV=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=USe(e,this.isSynchronous),this.root=FO(t,e),this.state={root:sSe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new GSe,options:e,queue:new HSe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new VSe,fs:e.fs||rSe},this.joinPath=uSe(this.root,e),this.pushDirectory=gSe(this.root,e),this.pushFile=wSe(e),this.getArray=kSe(e),this.groupFiles=TSe(e),this.resolveSymlink=ISe(e,this.isSynchronous),this.walkDirectory=ZSe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(b.isDirectory()){if(_=FO(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let x=Xbe(_),$=FO(LO(_),this.state.options);_=this.joinPath(x,$),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};sV=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return WSe(this.root,this.options)}withCallback(t){pV(this.root,this.options,t)}sync(){return KSe(this.root,this.options)}},mV=null;try{oV.resolve("picomatch"),mV=oV("picomatch")}catch{}hV=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:aV,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new sV(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new sV(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||mV;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var Jd=v((TQe,SV)=>{"use strict";var yV="[^\\\\/]",JSe="(?=.)",_V="[^/]",UO="(?:\\/|$)",vV="(?:^|\\/)",qO=`\\.{1,2}${UO}`,YSe="(?!\\.)",XSe=`(?!${vV}${qO})`,QSe=`(?!\\.{0,1}${UO})`,ewe=`(?!${qO})`,twe="[^.\\/]",rwe=`${_V}*?`,nwe="/",bV={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:JSe,QMARK:_V,END_ANCHOR:UO,DOTS_SLASH:qO,NO_DOT:YSe,NO_DOTS:XSe,NO_DOT_SLASH:QSe,NO_DOTS_SLASH:ewe,QMARK_NO_DOT:twe,STAR:rwe,START_ANCHOR:vV,SEP:nwe},iwe={...bV,SLASH_LITERAL:"[\\\\/]",QMARK:yV,STAR:`${yV}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},owe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};SV.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:owe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?iwe:bV}}});var Yd=v(Er=>{"use strict";var{REGEX_BACKSLASH:swe,REGEX_REMOVE_BACKSLASH:awe,REGEX_SPECIAL_CHARS:cwe,REGEX_SPECIAL_CHARS_GLOBAL:lwe}=Jd();Er.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Er.hasRegexChars=t=>cwe.test(t);Er.isRegexChar=t=>t.length===1&&Er.hasRegexChars(t);Er.escapeRegex=t=>t.replace(lwe,"\\$1");Er.toPosixSlashes=t=>t.replace(swe,"/");Er.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Er.removeBackslashes=t=>t.replace(awe,e=>e==="\\"?"":e);Er.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Er.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Er.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Er.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Er.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var OV=v((PQe,TV)=>{"use strict";var wV=Yd(),{CHAR_ASTERISK:BO,CHAR_AT:uwe,CHAR_BACKWARD_SLASH:Xd,CHAR_COMMA:dwe,CHAR_DOT:ZO,CHAR_EXCLAMATION_MARK:HO,CHAR_FORWARD_SLASH:AV,CHAR_LEFT_CURLY_BRACE:GO,CHAR_LEFT_PARENTHESES:VO,CHAR_LEFT_SQUARE_BRACKET:fwe,CHAR_PLUS:pwe,CHAR_QUESTION_MARK:xV,CHAR_RIGHT_CURLY_BRACE:mwe,CHAR_RIGHT_PARENTHESES:$V,CHAR_RIGHT_SQUARE_BRACKET:hwe}=Jd(),kV=t=>t===AV||t===Xd,EV=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},gwe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,b=!1,_=!1,x=!1,$=!1,w=!1,R=0,O,A,N={value:"",depth:0,isGlob:!1},k=()=>l>=n,Z=()=>c.charCodeAt(l+1),ne=()=>(O=A,c.charCodeAt(++l));for(;l0&&(P=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),I=c.slice(d)):m===!0?(xe="",I=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&kV(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(I&&(I=wV.removeBackslashes(I)),xe&&_===!0&&(xe=wV.removeBackslashes(xe)));let sn={prefix:P,input:t,start:u,base:xe,glob:I,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:x,negatedExtglob:$};if(r.tokens===!0&&(sn.maxDepth=0,kV(A)||s.push(N),sn.tokens=s),r.parts===!0||r.tokens===!0){let He;for(let ut=0;ut{"use strict";var Qd=Jd(),Br=Yd(),{MAX_LENGTH:q_,POSIX_REGEX_SOURCE:ywe,REGEX_NON_SPECIAL_CHARS:_we,REGEX_SPECIAL_CHARS_BACKREF:vwe,REPLACEMENTS:PV}=Qd,bwe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Br.escapeRegex(i)).join("..")}return r},Dc=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,IV=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},Swe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},RV=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Swe(e))return e.replace(/\\(.)/g,"$1")},wwe=t=>{let e=t.map(RV).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},xwe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=RV(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?Br.escapeRegex(r[0]):`[${r.map(i=>Br.escapeRegex(i)).join("")}]`}*`},$we=t=>{let e=0,r=t.trim(),n=WO(r);for(;n;)e++,r=n.body.trim(),n=WO(r);return e},kwe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Qd.DEFAULT_MAX_EXTGLOB_RECURSION,n=IV(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||wwe(n)))return{risky:!0};for(let i of n){let o=xwe(i);if(o)return{risky:!0,safeOutput:o};if($we(i)>r)return{risky:!0}}return{risky:!1}},KO=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=PV[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(q_,r.maxLength):q_,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=Qd.globChars(r.windows),l=Qd.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:b,QMARK:_,QMARK_NO_DOT:x,STAR:$,START_ANCHOR:w}=c,R=U=>`(${a}(?:(?!${w}${U.dot?m:u}).)*?)`,O=r.dot?"":h,A=r.dot?_:x,N=r.bash===!0?R(r):$;r.capture&&(N=`(${N})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let k={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=Br.removePrefix(t,k),i=t.length;let Z=[],ne=[],xe=[],P=o,I,sn=()=>k.index===i-1,He=k.peek=(U=1)=>t[k.index+U],ut=k.advance=()=>t[++k.index]||"",ji=()=>t.slice(k.index+1),an=(U="",at=0)=>{k.consumed+=U,k.index+=at},_o=U=>{k.output+=U.output!=null?U.output:U.value,an(U.value)},mse=()=>{let U=1;for(;He()==="!"&&(He(2)!=="("||He(3)==="?");)ut(),k.start++,U++;return U%2===0?!1:(k.negated=!0,k.start++,!0)},Ch=U=>{k[U]++,xe.push(U)},vo=U=>{k[U]--,xe.pop()},Ee=U=>{if(P.type==="globstar"){let at=k.braces>0&&(U.type==="comma"||U.type==="brace"),L=U.extglob===!0||Z.length&&(U.type==="pipe"||U.type==="paren");U.type!=="slash"&&U.type!=="paren"&&!at&&!L&&(k.output=k.output.slice(0,-P.output.length),P.type="star",P.value="*",P.output=N,k.output+=P.output)}if(Z.length&&U.type!=="paren"&&(Z[Z.length-1].inner+=U.value),(U.value||U.output)&&_o(U),P&&P.type==="text"&&U.type==="text"){P.output=(P.output||P.value)+U.value,P.value+=U.value;return}U.prev=P,s.push(U),P=U},Dh=(U,at)=>{let L={...l[at],conditions:1,inner:""};L.prev=P,L.parens=k.parens,L.output=k.output,L.startIndex=k.index,L.tokensIndex=s.length;let Ae=(r.capture?"(":"")+L.open;Ch("parens"),Ee({type:U,value:at,output:k.output?"":p}),Ee({type:"paren",extglob:!0,value:ut(),output:Ae}),Z.push(L)},hse=U=>{let at=t.slice(U.startIndex,k.index+1),L=t.slice(U.startIndex+2,k.index),Ae=kwe(L,r);if((U.type==="plus"||U.type==="star")&&Ae.risky){let nt=Ae.safeOutput?(U.output?"":p)+(r.capture?`(${Ae.safeOutput})`:Ae.safeOutput):void 0,ei=s[U.tokensIndex];ei.type="text",ei.value=at,ei.output=nt||Br.escapeRegex(at);for(let ti=U.tokensIndex+1;ti1&&U.inner.includes("/")&&(nt=R(r)),(nt!==N||sn()||/^\)+$/.test(ji()))&&(it=U.close=`)$))${nt}`),U.inner.includes("*")&&(Ct=ji())&&/^\.[^\\/.]+$/.test(Ct)){let ei=KO(Ct,{...e,fastpaths:!1}).output;it=U.close=`)${ei})${nt})`}U.prev.type==="bos"&&(k.negatedExtglob=!0)}Ee({type:"paren",extglob:!0,value:I,output:it}),vo("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let U=!1,at=t.replace(vwe,(L,Ae,it,Ct,nt,ei)=>Ct==="\\"?(U=!0,L):Ct==="?"?Ae?Ae+Ct+(nt?_.repeat(nt.length):""):ei===0?A+(nt?_.repeat(nt.length):""):_.repeat(it.length):Ct==="."?u.repeat(it.length):Ct==="*"?Ae?Ae+Ct+(nt?N:""):N:Ae?L:`\\${L}`);return U===!0&&(r.unescape===!0?at=at.replace(/\\/g,""):at=at.replace(/\\+/g,L=>L.length%2===0?"\\\\":L?"\\":"")),at===t&&r.contains===!0?(k.output=t,k):(k.output=Br.wrapOutput(at,k,e),k)}for(;!sn();){if(I=ut(),I==="\0")continue;if(I==="\\"){let L=He();if(L==="/"&&r.bash!==!0||L==="."||L===";")continue;if(!L){I+="\\",Ee({type:"text",value:I});continue}let Ae=/^\\+/.exec(ji()),it=0;if(Ae&&Ae[0].length>2&&(it=Ae[0].length,k.index+=it,it%2!==0&&(I+="\\")),r.unescape===!0?I=ut():I+=ut(),k.brackets===0){Ee({type:"text",value:I});continue}}if(k.brackets>0&&(I!=="]"||P.value==="["||P.value==="[^")){if(r.posix!==!1&&I===":"){let L=P.value.slice(1);if(L.includes("[")&&(P.posix=!0,L.includes(":"))){let Ae=P.value.lastIndexOf("["),it=P.value.slice(0,Ae),Ct=P.value.slice(Ae+2),nt=ywe[Ct];if(nt){P.value=it+nt,k.backtrack=!0,ut(),!o.output&&s.indexOf(P)===1&&(o.output=p);continue}}}(I==="["&&He()!==":"||I==="-"&&He()==="]")&&(I=`\\${I}`),I==="]"&&(P.value==="["||P.value==="[^")&&(I=`\\${I}`),r.posix===!0&&I==="!"&&P.value==="["&&(I="^"),P.value+=I,_o({value:I});continue}if(k.quotes===1&&I!=='"'){I=Br.escapeRegex(I),P.value+=I,_o({value:I});continue}if(I==='"'){k.quotes=k.quotes===1?0:1,r.keepQuotes===!0&&Ee({type:"text",value:I});continue}if(I==="("){Ch("parens"),Ee({type:"paren",value:I});continue}if(I===")"){if(k.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Dc("opening","("));let L=Z[Z.length-1];if(L&&k.parens===L.parens+1){hse(Z.pop());continue}Ee({type:"paren",value:I,output:k.parens?")":"\\)"}),vo("parens");continue}if(I==="["){if(r.nobracket===!0||!ji().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Dc("closing","]"));I=`\\${I}`}else Ch("brackets");Ee({type:"bracket",value:I});continue}if(I==="]"){if(r.nobracket===!0||P&&P.type==="bracket"&&P.value.length===1){Ee({type:"text",value:I,output:`\\${I}`});continue}if(k.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Dc("opening","["));Ee({type:"text",value:I,output:`\\${I}`});continue}vo("brackets");let L=P.value.slice(1);if(P.posix!==!0&&L[0]==="^"&&!L.includes("/")&&(I=`/${I}`),P.value+=I,_o({value:I}),r.literalBrackets===!1||Br.hasRegexChars(L))continue;let Ae=Br.escapeRegex(P.value);if(k.output=k.output.slice(0,-P.value.length),r.literalBrackets===!0){k.output+=Ae,P.value=Ae;continue}P.value=`(${a}${Ae}|${P.value})`,k.output+=P.value;continue}if(I==="{"&&r.nobrace!==!0){Ch("braces");let L={type:"brace",value:I,output:"(",outputIndex:k.output.length,tokensIndex:k.tokens.length};ne.push(L),Ee(L);continue}if(I==="}"){let L=ne[ne.length-1];if(r.nobrace===!0||!L){Ee({type:"text",value:I,output:I});continue}let Ae=")";if(L.dots===!0){let it=s.slice(),Ct=[];for(let nt=it.length-1;nt>=0&&(s.pop(),it[nt].type!=="brace");nt--)it[nt].type!=="dots"&&Ct.unshift(it[nt].value);Ae=bwe(Ct,r),k.backtrack=!0}if(L.comma!==!0&&L.dots!==!0){let it=k.output.slice(0,L.outputIndex),Ct=k.tokens.slice(L.tokensIndex);L.value=L.output="\\{",I=Ae="\\}",k.output=it;for(let nt of Ct)k.output+=nt.output||nt.value}Ee({type:"brace",value:I,output:Ae}),vo("braces"),ne.pop();continue}if(I==="|"){Z.length>0&&Z[Z.length-1].conditions++,Ee({type:"text",value:I});continue}if(I===","){let L=I,Ae=ne[ne.length-1];Ae&&xe[xe.length-1]==="braces"&&(Ae.comma=!0,L="|"),Ee({type:"comma",value:I,output:L});continue}if(I==="/"){if(P.type==="dot"&&k.index===k.start+1){k.start=k.index+1,k.consumed="",k.output="",s.pop(),P=o;continue}Ee({type:"slash",value:I,output:f});continue}if(I==="."){if(k.braces>0&&P.type==="dot"){P.value==="."&&(P.output=u);let L=ne[ne.length-1];P.type="dots",P.output+=I,P.value+=I,L.dots=!0;continue}if(k.braces+k.parens===0&&P.type!=="bos"&&P.type!=="slash"){Ee({type:"text",value:I,output:u});continue}Ee({type:"dot",value:I,output:u});continue}if(I==="?"){if(!(P&&P.value==="(")&&r.noextglob!==!0&&He()==="("&&He(2)!=="?"){Dh("qmark",I);continue}if(P&&P.type==="paren"){let Ae=He(),it=I;(P.value==="("&&!/[!=<:]/.test(Ae)||Ae==="<"&&!/<([!=]|\w+>)/.test(ji()))&&(it=`\\${I}`),Ee({type:"text",value:I,output:it});continue}if(r.dot!==!0&&(P.type==="slash"||P.type==="bos")){Ee({type:"qmark",value:I,output:x});continue}Ee({type:"qmark",value:I,output:_});continue}if(I==="!"){if(r.noextglob!==!0&&He()==="("&&(He(2)!=="?"||!/[!=<:]/.test(He(3)))){Dh("negate",I);continue}if(r.nonegate!==!0&&k.index===0){mse();continue}}if(I==="+"){if(r.noextglob!==!0&&He()==="("&&He(2)!=="?"){Dh("plus",I);continue}if(P&&P.value==="("||r.regex===!1){Ee({type:"plus",value:I,output:d});continue}if(P&&(P.type==="bracket"||P.type==="paren"||P.type==="brace")||k.parens>0){Ee({type:"plus",value:I});continue}Ee({type:"plus",value:d});continue}if(I==="@"){if(r.noextglob!==!0&&He()==="("&&He(2)!=="?"){Ee({type:"at",extglob:!0,value:I,output:""});continue}Ee({type:"text",value:I});continue}if(I!=="*"){(I==="$"||I==="^")&&(I=`\\${I}`);let L=_we.exec(ji());L&&(I+=L[0],k.index+=L[0].length),Ee({type:"text",value:I});continue}if(P&&(P.type==="globstar"||P.star===!0)){P.type="star",P.star=!0,P.value+=I,P.output=N,k.backtrack=!0,k.globstar=!0,an(I);continue}let U=ji();if(r.noextglob!==!0&&/^\([^?]/.test(U)){Dh("star",I);continue}if(P.type==="star"){if(r.noglobstar===!0){an(I);continue}let L=P.prev,Ae=L.prev,it=L.type==="slash"||L.type==="bos",Ct=Ae&&(Ae.type==="star"||Ae.type==="globstar");if(r.bash===!0&&(!it||U[0]&&U[0]!=="/")){Ee({type:"star",value:I,output:""});continue}let nt=k.braces>0&&(L.type==="comma"||L.type==="brace"),ei=Z.length&&(L.type==="pipe"||L.type==="paren");if(!it&&L.type!=="paren"&&!nt&&!ei){Ee({type:"star",value:I,output:""});continue}for(;U.slice(0,3)==="/**";){let ti=t[k.index+4];if(ti&&ti!=="/")break;U=U.slice(3),an("/**",3)}if(L.type==="bos"&&sn()){P.type="globstar",P.value+=I,P.output=R(r),k.output=P.output,k.globstar=!0,an(I);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&!Ct&&sn()){k.output=k.output.slice(0,-(L.output+P.output).length),L.output=`(?:${L.output}`,P.type="globstar",P.output=R(r)+(r.strictSlashes?")":"|$)"),P.value+=I,k.globstar=!0,k.output+=L.output+P.output,an(I);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&U[0]==="/"){let ti=U[1]!==void 0?"|$":"";k.output=k.output.slice(0,-(L.output+P.output).length),L.output=`(?:${L.output}`,P.type="globstar",P.output=`${R(r)}${f}|${f}${ti})`,P.value+=I,k.output+=L.output+P.output,k.globstar=!0,an(I+ut()),Ee({type:"slash",value:"/",output:""});continue}if(L.type==="bos"&&U[0]==="/"){P.type="globstar",P.value+=I,P.output=`(?:^|${f}|${R(r)}${f})`,k.output=P.output,k.globstar=!0,an(I+ut()),Ee({type:"slash",value:"/",output:""});continue}k.output=k.output.slice(0,-P.output.length),P.type="globstar",P.output=R(r),P.value+=I,k.output+=P.output,k.globstar=!0,an(I);continue}let at={type:"star",value:I,output:N};if(r.bash===!0){at.output=".*?",(P.type==="bos"||P.type==="slash")&&(at.output=O+at.output),Ee(at);continue}if(P&&(P.type==="bracket"||P.type==="paren")&&r.regex===!0){at.output=I,Ee(at);continue}(k.index===k.start||P.type==="slash"||P.type==="dot")&&(P.type==="dot"?(k.output+=g,P.output+=g):r.dot===!0?(k.output+=b,P.output+=b):(k.output+=O,P.output+=O),He()!=="*"&&(k.output+=p,P.output+=p)),Ee(at)}for(;k.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Dc("closing","]"));k.output=Br.escapeLast(k.output,"["),vo("brackets")}for(;k.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Dc("closing",")"));k.output=Br.escapeLast(k.output,"("),vo("parens")}for(;k.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Dc("closing","}"));k.output=Br.escapeLast(k.output,"{"),vo("braces")}if(r.strictSlashes!==!0&&(P.type==="star"||P.type==="bracket")&&Ee({type:"maybe_slash",value:"",output:`${f}?`}),k.backtrack===!0){k.output="";for(let U of k.tokens)k.output+=U.output!=null?U.output:U.value,U.suffix&&(k.output+=U.suffix)}return k};KO.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(q_,r.maxLength):q_,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=PV[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=Qd.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let x=O=>O.noglobstar===!0?_:`(${g}(?:(?!${p}${O.dot?c:o}).)*?)`,$=O=>{switch(O){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+x(r);case"**/*":return`(?:${m}${x(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${x(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${x(r)}${s})?${o}${a}${_}`;default:{let A=/^(.*?)\.(\w+)$/.exec(O);if(!A)return;let N=$(A[1]);return N?N+o+A[2]:void 0}}},w=Br.removePrefix(t,b),R=$(w);return R&&r.strictSlashes!==!0&&(R+=`${s}?`),R};CV.exports=KO});var MV=v((RQe,jV)=>{"use strict";var Ewe=OV(),JO=DV(),NV=Yd(),Awe=Jd(),Twe=t=>t&&typeof t=="object"&&!Array.isArray(t),$t=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>$t(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=Twe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?$t.compileRe(t,e):$t.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=$t(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=$t.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};$t.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?NV.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=$t.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};$t.matchBase=(t,e,r)=>(e instanceof RegExp?e:$t.makeRe(e,r)).test(NV.basename(t));$t.isMatch=(t,e,r)=>$t(e,r)(t);$t.parse=(t,e)=>Array.isArray(t)?t.map(r=>$t.parse(r,e)):JO(t,{...e,fastpaths:!1});$t.scan=(t,e)=>Ewe(t,e);$t.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=$t.toRegex(a,e);return n===!0&&(c.state=t),c};$t.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=JO.fastpaths(t,e)),i.output||(i=JO(t,e)),$t.compileRe(i,e,r,n)};$t.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};$t.constants=Awe;jV.exports=$t});var UV=v((CQe,LV)=>{"use strict";var zV=MV(),Owe=Yd();function FV(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:Owe.isWindows()}),zV(t,e,r)}Object.assign(FV,zV);LV.exports=FV});import{readdir as Pwe,readdirSync as Iwe,realpath as Rwe,realpathSync as Cwe,stat as Dwe,statSync as Nwe}from"fs";import{isAbsolute as jwe,posix as ea,resolve as Mwe}from"path";import{fileURLToPath as zwe}from"url";function Uwe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&Lwe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>ea.relative(t,n)||".":n=>ea.relative(t,`${e}/${n}`)||"."}function Zwe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=ea.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function HV(t){var e;let r=Nc.default.scan(t,Hwe);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function Ywe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Nc.default.scan(t);return r.isGlob||r.negated}function ef(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function GV(t){return typeof t=="string"?[t]:t??[]}function YO(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=Jwe(o);s=jwe(s.replace(Qwe,""))?ea.relative(a,s):ea.normalize(s);let c=(i=Xwe.exec(s))===null||i===void 0?void 0:i[0],l=HV(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?ea.join(o,...d):o}return s}function exe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(YO(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(YO(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(YO(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function txe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=exe(t,e,n);t.debug&&ef("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(BV,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Nc.default)(i.match,f),m=(0,Nc.default)(i.ignore,f),h=Uwe(i.match,f),g=qV(r,d,o),b=o?g:qV(r,d,!0),_=(w,R)=>{let O=b(R,!0);return O!=="."&&!h(O)||m(O)},x;t.deep!==void 0&&(x=Math.round(t.deep-n.depthOffset));let $=new hV({filters:[a?(w,R)=>{let O=g(w,R),A=p(O)&&!m(O);return A&&ef(`matched ${O}`),A}:(w,R)=>{let O=g(w,R);return p(O)&&!m(O)}],exclude:a?(w,R)=>{let O=_(w,R);return ef(`${O?"skipped":"crawling"} ${R}`),O}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:x,signal:t.signal}).crawl(d);return t.debug&&ef("internal properties:",{...n,root:d}),[$,r!==d&&!o&&Zwe(r,d)]}function rxe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function ixe(t){let e={...nxe,...t};return e.cwd=(e.cwd instanceof URL?zwe(e.cwd):Mwe(e.cwd)).replace(BV,"/"),e.ignore=GV(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Pwe,readdirSync:e.fs.readdirSync||Iwe,realpath:e.fs.realpath||Rwe,realpathSync:e.fs.realpathSync||Cwe,stat:e.fs.stat||Dwe,statSync:e.fs.statSync||Nwe}),e.debug&&ef("globbing with options:",e),e}function oxe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=Fwe(t)||typeof t=="string",i=GV((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=ixe(n?e:t);return i.length>0?txe(o,i):[]}function Lo(t,e){let[r,n]=oxe(t,e);return r?rxe(r.sync(),n):[]}var Nc,Fwe,BV,ZV,Lwe,qwe,Bwe,Hwe,Gwe,Vwe,Wwe,Kwe,Jwe,Xwe,Qwe,nxe,tf=y(()=>{gV();Nc=St(UV(),1),Fwe=Array.isArray,BV=/\\/g,ZV=process.platform==="win32",Lwe=/^(\/?\.\.)+$/;qwe=/^[A-Z]:\/$/i,Bwe=ZV?t=>qwe.test(t):t=>t==="/";Hwe={parts:!0};Gwe=/(?t.replace(Gwe,"\\$&"),Kwe=t=>t.replace(Vwe,"\\$&"),Jwe=ZV?Kwe:Wwe;Xwe=/^(\/?\.\.)+/,Qwe=/\\(?=[()[\]{}!*+?@|])/g;nxe={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as B_,readFileSync as sxe,readdirSync as axe,statSync as VV}from"node:fs";import{join as jc}from"node:path";function cxe(t){let{cwd:e="."}=t,r,n;try{let c=se(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=fi(e,n),o=[],{layers:s,forbiddenImports:a}=XO(r);return s.size>0&&(lxe(e,i,s,o),uxe(e,i,s,o)),a.length>0&&dxe(e,i,a,o),o}function XO(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function lxe(t,e,r,n){let i=e.mainRoot,o=jc(t,i);if(B_(o))for(let s of axe(o)){let a=jc(o,s);VV(a).isDirectory()&&(r.has(s)||n.push({detector:Z_,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function uxe(t,e,r,n){let i=e.mainRoot,o=jc(t,i);if(B_(o))for(let s of r){let a=jc(o,s);B_(a)&&VV(a).isDirectory()||n.push({detector:Z_,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function dxe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=jc(t,i,s.from);if(!B_(a))continue;let c=Lo([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=jc(a,l),d;try{d=sxe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];fxe(p,s.to,e.importStyle)&&n.push({detector:Z_,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function fxe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var Z_,WV,QO=y(()=>{"use strict";tf();Tt();Cc();Z_="ARCHITECTURE_FROM_SPEC";WV={name:Z_,run:cxe}});import{existsSync as pxe,readFileSync as mxe}from"node:fs";import{join as hxe}from"node:path";function gxe(t){let{cwd:e="."}=t,r=hxe(e,"spec/capabilities.yaml");if(!pxe(r))return[];let n;try{let c=mxe(r,"utf8"),l=KV.default.parse(c);if(!l||typeof l!="object")return[];n=l}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o;try{let c=se(e);o=new Set(c.features.map(l=>l.id))}catch{return[]}let s=[],a=new Set;for(let c of i){if(typeof c!="object"||c===null)continue;let l=String(c.id??"(unnamed)"),u=Array.isArray(c.features)?c.features:[];if(u.length===0){s.push({detector:H_,severity:"warn",path:"spec/capabilities.yaml",message:`capability "${l}" has no features mapped \u2014 bind at least one feature via the features[] field, or remove the capability if it's no longer relevant`});continue}for(let d of u){let f=String(d);o.has(f)?a.add(f):s.push({detector:H_,severity:"error",path:"spec/capabilities.yaml",message:`capability "${l}" references feature ${f} which does not exist in spec.yaml \u2014 either add the feature or remove it from this capability's features[]`})}}for(let c of o)a.has(c)||s.push({detector:H_,severity:"info",path:"spec.yaml",message:`feature ${c} is not claimed by any capability \u2014 if it's user-facing, consider adding it to a capability's features[] in spec/capabilities.yaml`});return s}var KV,H_,JV,YV=y(()=>{"use strict";KV=St(tr(),1);Tt();H_="CAPABILITIES_FEATURE_MAPPING";JV={name:H_,run:gxe}});import{existsSync as yxe,readFileSync as _xe}from"node:fs";import{join as vxe}from"node:path";function bxe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")}function Sxe(t){let{cwd:e="."}=t;return _e(e,eP,r=>wxe(r,e))}function wxe(t,e){let r=fi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=vxe(e,o);if(!yxe(s))continue;let a=_xe(s,"utf8");bxe(a)||n.push({detector:eP,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var eP,XV,QV=y(()=>{"use strict";Cc();xt();eP="CONVENTION_DRIFT";XV={name:eP,run:Sxe}});import{existsSync as tP,readFileSync as eW}from"node:fs";import{join as G_}from"node:path";function xxe(t){return JSON.parse(t).total?.lines?.pct??0}function tW(t){let e=/tP(G_(c.dir,d)));if(!l){s.push(c.path);continue}let u=tW(eW(G_(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:Ji,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=rW(n,i);return a0?[{detector:Ji,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function Exe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let s=kxe(e,t.focusModules);if(s)return s}let r=fi(e),n=dt(e).language==="kotlin"?IO.find(s=>tP(G_(e,s)))??L9(e):r.coverageSummary,i=G_(e,n);if(!tP(i))return[{detector:Ji,severity:"info",message:`${n} not present \u2014 run stage_2.2 first`}];let o;try{let s=eW(i,"utf8");o=r.coverageFormat==="jacoco-xml"?$xe(s):xxe(s)}catch(s){return[{detector:Ji,severity:"warn",message:`${n} unparseable: ${s.message}`}]}return o===null?[{detector:Ji,severity:"warn",message:`${n} contained no line-coverage counter`}]:o>=V_?[]:[{detector:Ji,severity:"warn",message:`line coverage ${o.toFixed(1)}% < floor ${V_}%`}]}var Ji,V_,nW,iW=y(()=>{"use strict";R_();Cc();O_();fn();Ji="COVERAGE_DROP",V_=70;nW={name:Ji,run:Exe}});import{existsSync as Axe}from"node:fs";import{join as Txe}from"node:path";function Oxe(t){let{cwd:e="."}=t;return _e(e,W_,r=>Pxe(r,e))}function Pxe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);return r?Axe(Txe(e,r.path))?[]:[{detector:W_,severity:"error",path:r.path,message:`project.deliverable.path '${r.path}' is declared but does not exist on disk.`}]:n.length===0?[]:[{detector:W_,severity:"warn",message:`${n.length} done feature(s) ship modules but project.deliverable is not declared \u2014 the gate cannot smoke-test the shipped entry, so a broken entry point could ship green. Declare project.deliverable {path, is_safe_to_smoke: true} to enable DELIVERABLE_SMOKE (stage_2.4).`}]}var W_,oW,sW=y(()=>{"use strict";xt();W_="DELIVERABLE_INTEGRITY";oW={name:W_,run:Oxe}});function Ixe(t){let e=(t.features??[]).filter(i=>i.status==="done");return e.length===0?[]:!t.project?.deliverable?[]:(t.project?.smoke??[]).length>0?[]:[{detector:rP,severity:"warn",path:"spec.yaml",message:`${e.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function Rxe(t){let{cwd:e="."}=t;return _e(e,rP,r=>Ixe(r))}var rP,aW,cW=y(()=>{"use strict";xt();rP="SMOKE_PROBE_DEMAND";aW={name:rP,run:Rxe}});function Cxe(t){let{cwd:e="."}=t;return _e(e,K_,r=>Dxe(r,e))}function Dxe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=dc(e);if(n===null)return[{detector:K_,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=n.get(o.id),a=$d(e,o.modules??[]);s!==a&&i.push({detector:K_,severity:"warn",path:"spec/attestation.yaml",message:s===void 0?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var K_,lW,uW=y(()=>{"use strict";kd();xt();K_="STALE_ATTESTATION";lW={name:K_,run:Cxe}});function Nxe(t){let{cwd:e="."}=t,r;try{r=se(e)}catch{return[]}return jxe(r)}function jxe(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:dW,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var dW,fW,pW=y(()=>{"use strict";Tt();dW="DEPENDENCY_CYCLE";fW={name:dW,run:Nxe}});import{appendFileSync as Mxe,existsSync as mW,mkdirSync as zxe,readFileSync as Fxe}from"node:fs";import{dirname as Lxe,join as Uxe}from"node:path";function hW(t){return Uxe(t,qxe,Bxe)}function gW(t){return nP.add(t),()=>nP.delete(t)}function ta(t,e){let r=hW(t),n=Lxe(r);mW(n)||zxe(n,{recursive:!0}),Mxe(r,`${JSON.stringify(e)} +`,"utf8");for(let i of nP)try{i(t,e)}catch{}}function mn(t){let e=hW(t);if(!mW(e))return[];let r=Fxe(e,"utf8").trim();return r.length===0?[]:r.split(` +`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var qxe,Bxe,nP,Mn=y(()=>{"use strict";qxe=".cladding",Bxe="audit.log.jsonl";nP=new Set});import{existsSync as Zxe}from"node:fs";import{join as Hxe}from"node:path";function Gxe(t){let{cwd:e="."}=t,r=mn(e);if(r.length===0)return[{detector:iP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(Zxe(Hxe(e,i.artifact))||n.push({detector:iP,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var iP,yW,_W=y(()=>{"use strict";Mn();iP="EVIDENCE_MISMATCH";yW={name:iP,run:Gxe}});import{existsSync as Vxe,readFileSync as Wxe}from"node:fs";import{join as Kxe}from"node:path";function Jxe(t){let e=Kxe(t,wW);if(!Vxe(e))return null;try{let n=((0,SW.parse)(Wxe(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*bW(t,e){for(let r of t??[])r.startsWith(vW)&&(yield{ref:r,name:r.slice(vW.length),field:e})}function Yxe(t){let{cwd:e="."}=t,r=Jxe(e);if(r===null)return[];let n;try{n=se(e)}catch(o){return[{detector:oP,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...bW(s.evidence_refs,"evidence_refs"),...bW(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:oP,severity:"warn",path:wW,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var SW,oP,vW,wW,xW,$W=y(()=>{"use strict";SW=St(tr(),1);Tt();oP="FIXTURE_REFERENCE_INVALID",vW="fixture:",wW="conformance/fixtures.yaml";xW={name:oP,run:Yxe}});function Xxe(t){let{cwd:e="."}=t,r=dt(e),n=r.gates.secret;if(!n)return[{detector:J_,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=Xe(n.cmd,[...n.args],{cwd:e,reject:!1});return Wd(i)?[{detector:J_,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:D_(i,J_,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var J_,Y_,sP=y(()=>{"use strict";kr();fn();pn();J_="HARDCODED_SECRET";Y_={name:J_,run:Xxe}});import{existsSync as Mc,readFileSync as aP}from"node:fs";import{join as ra}from"node:path";function Qxe(t){return Lo(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec)\.ts$/.test(r)).length}function rf(t){if(!Mc(t))return null;try{return JSON.parse(aP(t,"utf8"))}catch{return null}}function e$e(t,e){let r=ra(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(aP(r,"utf8"))}catch(c){e.push({detector:Yi,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:Yi,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=Qxe(t);s!==a&&e.push({detector:Yi,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function t$e(t,e){for(let r of kW){let n=ra(t,r.path);if(!Mc(n))continue;let i=rf(n);if(!i){e.push({detector:Yi,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:Yi,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function r$e(t,e){let r=rf(ra(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of kW){let s=ra(t,o.path);if(!Mc(s))continue;let a=rf(s);a?.version&&a.version!==n&&e.push({detector:Yi,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=ra(t,".claude-plugin","marketplace.json");if(Mc(i)){let o=rf(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:Yi,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function n$e(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function i$e(t,e){let r=ra(t,"src","cli","clad.ts"),n=ra(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Mc(r)||!Mc(n))return;let i=n$e(aP(r,"utf8"));if(i.length===0)return;let s=rf(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:Yi,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function o$e(t){let{cwd:e="."}=t,r=[];return e$e(e,r),i$e(e,r),t$e(e,r),r$e(e,r),r}var Yi,kW,EW,AW=y(()=>{"use strict";tf();Yi="HARNESS_INTEGRITY",kW=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];EW={name:Yi,run:o$e}});import{existsSync as s$e,readFileSync as a$e}from"node:fs";import{join as c$e}from"node:path";function u$e(t){let{cwd:e="."}=t;return _e(e,X_,r=>p$e(r,e))}function d$e(){return l$e}function f$e(t){let e=c$e(t,"spec/capabilities.yaml");if(!s$e(e))return!1;try{let r=TW.default.parse(a$e(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function p$e(t,e){let r=t.features.length;if(r{"use strict";TW=St(tr(),1);xt();X_="HOLLOW_GOVERNANCE",l$e=8;OW={name:X_,run:u$e}});function m$e(t){let{cwd:e="."}=t,r;try{r=se(e)}catch{return[]}let n=[];return IW(r.features.map(i=>i.id),"feature","spec/features/",n),IW((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function IW(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:RW,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var RW,CW,DW=y(()=>{"use strict";Tt();RW="ID_COLLISION";CW={name:RW,run:m$e}});import{existsSync as nf,readFileSync as cP,readdirSync as lP,statSync as h$e,writeFileSync as jW}from"node:fs";import{join as Xi}from"node:path";function NW(t){if(!nf(t))return 0;try{return lP(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function g$e(t){if(!nf(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=lP(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=Xi(n,o),a;try{a=h$e(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function y$e(t){let e=Xi(t,"spec","capabilities.yaml");if(!nf(e))return 0;try{let r=Q_.default.parse(cP(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function Uo(t="."){let e=NW(Xi(t,"spec","features")),r=NW(Xi(t,"spec","scenarios")),n=y$e(t),i=g$e(Xi(t,"tests")),o=new Date().toISOString().slice(0,10);return{features:e,scenarios:r,capabilities:n,test_files:i,last_synced:o}}function zc(t,e){let r=Xi(t,"spec.yaml");if(!nf(r))return;let n=cP(r,"utf8"),i=_$e(n,e);i!==n&&jW(r,i)}function _$e(t,e){let r=t.includes(`\r `)?`\r `:` `,n=t.split(/\r?\n/),i=n.findIndex(d=>/^inventory:\s*$/.test(d)),o=["# Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand.","inventory:",` features: ${e.features??0}`,` scenarios: ${e.scenarios??0}`,` capabilities: ${e.capabilities??0}`,` test_files: ${e.test_files??0}`,` last_synced: ${JSON.stringify(e.last_synced??"")}`],s=d=>r===`\r @@ -249,18 +249,18 @@ ${o.join(` `)}let a=i;a>0&&/Auto-maintained by `clad sync`/.test(n[a-1])&&(a-=1);let c=i+1;for(;ci+1);)c++;let l=n.slice(0,a),u=n.slice(c);for(;l.length>0&&l[l.length-1].trim()==="";)l.pop();return l.push(""),s([...l,...o,"",...u.filter((d,f)=>!(f===0&&d.trim()===""))].join(` `).replace(/\n{3,}/g,` -`))}function ra(t="."){let e=Xi(t,"spec","features");if(!nf(e))return!1;let r=[];for(let i of lP(e).sort())if(!(!i.endsWith(".yaml")&&!i.endsWith(".yml")))try{let o=(0,Q_.parse)(cP(Xi(e,i),"utf8"));if(!o?.id)continue;let s=o.slug??i.replace(/\.(ya?ml)$/,"");r.push(` ${o.id}: {slug: ${s}, status: ${o.status??"planned"}, modules: ${(o.modules??[]).length}}`)}catch{continue}r.sort();let n="# Cladding \xB7 Tier C \u2014 generated feature index (`clad sync`). Do not edit by hand.\n# One line per feature \u2192 1-file lookup + line-independent merges\n# (suggested .gitattributes: `spec/index.yaml merge=union`).\nfeatures:\n"+r.join(` +`))}function na(t="."){let e=Xi(t,"spec","features");if(!nf(e))return!1;let r=[];for(let i of lP(e).sort())if(!(!i.endsWith(".yaml")&&!i.endsWith(".yml")))try{let o=(0,Q_.parse)(cP(Xi(e,i),"utf8"));if(!o?.id)continue;let s=o.slug??i.replace(/\.(ya?ml)$/,"");r.push(` ${o.id}: {slug: ${s}, status: ${o.status??"planned"}, modules: ${(o.modules??[]).length}}`)}catch{continue}r.sort();let n="# Cladding \xB7 Tier C \u2014 generated feature index (`clad sync`). Do not edit by hand.\n# One line per feature \u2192 1-file lookup + line-independent merges\n# (suggested .gitattributes: `spec/index.yaml merge=union`).\nfeatures:\n"+r.join(` `)+` -`;return jW(Xi(t,"spec","index.yaml"),n,"utf8"),!0}var Q_,of=y(()=>{"use strict";Q_=St(tr(),1)});import{existsSync as MW,readFileSync as zW,readdirSync as h$e}from"node:fs";import{join as uP}from"node:path";function g$e(t){let{cwd:e="."}=t,r;try{r=se(e)}catch{return[]}let n=Lo(e),i=r.inventory;if(!i){let s=FW.filter(([c])=>(n[c]??0)>0);if(s.length===0)return dP(e);let a=s.map(([c,l])=>`${n[c]??0} ${l}`).join(", ");return[...dP(e),{detector:sf,severity:"warn",path:"spec.yaml",message:`spec.yaml has no inventory: block, but the project has ${a} on disk \u2014 run \`clad sync\` to record the inventory so anyone reading spec.yaml sees its real scale.`}]}let o=[];for(let[s,a]of FW){let c=i[s]??0,l=n[s]??0;c!==l&&o.push({detector:sf,severity:"error",path:"spec.yaml",message:`spec.yaml inventory.${s} declares ${c} but the project has ${l} ${a} on disk \u2014 run \`clad sync\` (a stale inventory hides created/deleted shards from anyone reading spec.yaml).`})}return o.push(...dP(e)),o}function dP(t){let e=uP(t,"spec","index.yaml"),r=uP(t,"spec","features");if(!MW(e)||!MW(r))return[];let n=new Map;try{for(let l of zW(e,"utf8").split(` -`)){let u=l.match(/^ (F-[\w-]+):.*\bstatus:\s*['"]?([\w-]+)['"]?/);if(u){n.set(u[1],u[2]);continue}let d=l.match(/^ (F-[\w-]+):/);d&&n.set(d[1],"planned")}}catch{return[]}let i=new Map;try{for(let l of h$e(r)){if(!l.endsWith(".yaml")&&!l.endsWith(".yml"))continue;let u=zW(uP(r,l),"utf8"),d=u.match(/^id:\s*['"]?(F-[\w-]+)['"]?/m);if(!d)continue;let f=u.match(/^status:\s*['"]?([\w-]+)['"]?/m);i.set(d[1],f?f[1]:"planned")}}catch{return[]}let o=[],s=[...i.keys()].filter(l=>!n.has(l)).sort(),a=[...n.keys()].filter(l=>!i.has(l)).sort();if(s.length>0||a.length>0){let l=[];s.length>0&&l.push(`missing from index: ${s.join(", ")}`),a.length>0&&l.push(`in index but not on disk: ${a.join(", ")}`),o.push({detector:sf,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml disagrees with spec/features/ (${l.join("; ")}) \u2014 run \`clad sync\` to regenerate (a stale index silently misleads agents that trust it for lookup).`})}let c=[...i.keys()].filter(l=>n.has(l)&&n.get(l)!==i.get(l)).sort().map(l=>`${l} (index: ${n.get(l)}, shard: ${i.get(l)})`);return c.length>0&&o.push({detector:sf,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml status disagrees with spec/features/ for ${c.join("; ")} \u2014 run \`clad sync\` to regenerate (a stale status silently misleads agents that trust the index).`}),o}var sf,FW,LW,UW=y(()=>{"use strict";of();Tt();sf="INVENTORY_DRIFT",FW=[["features","feature shard(s)"],["scenarios","scenario shard(s)"],["capabilities","capabilit(ies)"],["test_files","test file(s)"]];LW={name:sf,run:g$e}});import{existsSync as y$e,readFileSync as _$e}from"node:fs";import{join as v$e}from"node:path";function S$e(t){let{cwd:e="."}=t,r=v$e(e,"src","spec","schema.json"),n=[];if(y$e(r)){let i;try{i=JSON.parse(_$e(r,"utf8"))}catch(o){n.push({detector:af,severity:"error",message:`spec/schema.json unreadable or invalid JSON: ${o.message}`})}if(i)for(let o of b$e)i.required?.includes(o)||n.push({detector:af,severity:"error",message:`spec/schema.json does not require root key '${o}'`}),i.properties?.[o]||n.push({detector:af,severity:"error",message:`spec/schema.json does not declare property '${o}'`})}try{let i=se(e);i.schema!==qW&&n.push({detector:af,severity:"error",message:`spec.yaml schema='${i.schema}' but supported version is '${qW}'`})}catch{}return n}var af,b$e,qW,BW,ZW=y(()=>{"use strict";Tt();af="META_INTEGRITY",b$e=["schema","project","features"],qW="0.1";BW={name:af,run:S$e}});function w$e(t){let{cwd:e="."}=t,r;try{r=se(e)}catch{return[]}let n=[];return HW(r.features.map(i=>({id:i.id,slug:i.slug})),"features",n),HW((r.scenarios??[]).map(i=>({id:i.id,slug:i.slug})),"scenarios",n),n}function HW(t,e,r){let n=new Map;for(let i of t){if(!i.slug)continue;let o=n.get(i.slug);o?r.push({detector:GW,severity:"error",message:`slug '${i.slug}' is used by both ${o} and ${i.id} in ${e}/ \u2014 two items in the same namespace cannot share a slug; pick a different slug for one`}):n.set(i.slug,i.id)}}var GW,VW,WW=y(()=>{"use strict";Tt();GW="SLUG_CONFLICT";VW={name:GW,run:w$e}});import{existsSync as x$e}from"node:fs";import{join as $$e}from"node:path";function k$e(t){let{cwd:e="."}=t;return _e(e,fP,r=>E$e(r,e))}function E$e(t,e){let r=[];for(let n of t.features)for(let i of n.modules??[]){let o=$$e(e,i);x$e(o)||r.push({detector:fP,severity:"error",path:i,message:`feature ${n.id} declares module '${i}' but the file does not exist`})}return r}var fP,KW,JW=y(()=>{"use strict";xt();fP="MISSING_IMPLEMENTATION";KW={name:fP,run:k$e}});function A$e(t){let{cwd:e="."}=t;return _e(e,pP,T$e)}function T$e(t){let e=[];for(let r of t.features)if(r.status==="done")for(let n of r.acceptance_criteria??[]){let o=(n.test_refs??[]).filter(c=>!c.startsWith("derived:")).length>0,s=(n.evidence_refs?.length??0)>0,a=!o&&!s&&(n.test_refs?.length??0)>0;!o&&!s&&e.push({detector:pP,severity:"error",message:`${r.id}.${n.id} declares no test_refs or evidence_refs \u2014 AC is unverified`+(a?" (a 'derived:' candidate exists \u2014 confirm it by removing the prefix, or author a real ref)":"")})}return e}var pP,YW,XW=y(()=>{"use strict";xt();pP="MISSING_TESTS";YW={name:pP,run:A$e}});import{existsSync as O$e,readFileSync as P$e}from"node:fs";import{join as QW}from"node:path";function e3(t){if(O$e(t))try{return JSON.parse(P$e(t,"utf8"))}catch{return}}function D$e(t){let{cwd:e="."}=t,r=e3(QW(e,I$e)),n=e3(QW(e,R$e));if(!r||!n)return[{detector:mP,severity:"info",message:"perf baseline or current missing \u2014 run stage_3.2 with --record first"}];let i=[];for(let[o,s]of Object.entries(r.metrics??{})){let a=n.metrics?.[o];if(!a||typeof s.value!="number"||typeof a.value!="number"||s.value===0)continue;let c=(a.value-s.value)/s.value*100;c>C$e&&i.push({detector:mP,severity:"warn",message:`${o} regressed ${c.toFixed(1)}% (baseline ${s.value}${s.unit??""} \u2192 current ${a.value}${a.unit??""})`})}return i}var mP,I$e,R$e,C$e,t3,r3=y(()=>{"use strict";mP="PERFORMANCE_DRIFT",I$e="perf/baseline.json",R$e="perf/current.json",C$e=10;t3={name:mP,run:D$e}});import{existsSync as N$e}from"node:fs";import{join as j$e}from"node:path";function z$e(t){let{cwd:e="."}=t;return _e(e,hP,r=>U$e(r,e))}function F$e(){return M$e}function L$e(t,e){return(t.modules??[]).some(r=>N$e(j$e(e,r)))}function U$e(t,e){let r=[];for(let s of t.features)s.status!=="planned"&&s.status!=="in_progress"||L$e(s,e)||r.push(s.id);let n=F$e();if(r.length<=n)return[];let i=r.slice(0,n3).join(", "),o=r.length>n3?", \u2026":"";return[{detector:hP,severity:"warn",message:`${r.length} planned/in_progress features have NO code on disk (> ${n} tolerated) \u2014 the spec has raced ahead of the code. Work one feature end-to-end before authoring the next (docs/feature-cycle.md). Stalled: ${i}${o}`}]}var hP,M$e,n3,i3,o3=y(()=>{"use strict";xt();hP="PLANNED_BACKLOG",M$e=5,n3=8;i3={name:hP,run:z$e}});import{existsSync as q$e,readFileSync as B$e}from"node:fs";import{join as Z$e}from"node:path";function V$e(t){let{cwd:e="."}=t;return _e(e,gP,r=>K$e(r,e))}function W$e(){return H$e}function K$e(t,e){if(t.features.lengthn.includes(i))?[{detector:gP,severity:"warn",path:"docs/project-context.md",message:`${t.features.length} features but docs/project-context.md is still the unrefined init template (it still carries the placeholder prompts) \u2014 the Why/What/Purpose narrative was never filled in. Refine it with \`clad refine\` or by hand.`}]:[]}var gP,H$e,G$e,s3,a3=y(()=>{"use strict";xt();gP="PROJECT_CONTEXT_DRIFT",H$e=8,G$e=["Refine by hand or re-run with LLM available","What gap or pain led to this project","What does success look like"];s3={name:gP,run:V$e}});function c3(t,e,r){return e?e.filter(n=>!t.has(n)).map(n=>({detector:ev,severity:"error",message:`${r} references unknown id '${n}'`})):[]}function J$e(t){let{cwd:e="."}=t;return _e(e,ev,Y$e)}function Y$e(t){let e=new Set(t.features.map(n=>n.id)),r=[];for(let n of t.features)r.push(...c3(e,n.depends_on,`feature ${n.id}.depends_on`)),n.superseded_by&&!e.has(n.superseded_by)&&r.push({detector:ev,severity:"error",message:`feature ${n.id}.superseded_by references unknown id '${n.superseded_by}'`});for(let n of t.scenarios??[])r.push(...c3(e,n.features,`scenario ${n.id}.features`));return r}var ev,l3,u3=y(()=>{"use strict";xt();ev="REFERENCE_INTEGRITY";l3={name:ev,run:J$e}});function Q$e(t){let{cwd:e="."}=t;return _e(e,cf,r=>t0e(r))}function e0e(){return X$e}function t0e(t){let e=[],r=t.features.length,n=t.scenarios??[];r>=e0e()&&n.length===0&&e.push({detector:cf,severity:"warn",path:"spec/scenarios/",message:`${r} features but no scenarios declared \u2014 cross-feature user-journey flows are not captured. Author at least one with \`clad_create_scenario\`.`});for(let o of n)(o.features??[]).length===0&&e.push({detector:cf,severity:"warn",path:"spec/scenarios/",message:`scenario ${o.id} binds no features (features: []) \u2014 a scenario must cover at least one feature's flow, or it should be removed.`});let i=new Map(t.features.filter(o=>typeof o.slug=="string"&&o.slug.length>0).map(o=>[o.slug,o.id]));for(let o of n){if(!o.flow)continue;let s=new Set(o.features??[]),a=new Map;for(let c of o.flow.matchAll(/\(([^)]+)\)/g))for(let l of c[1].split(/[,/·]/)){let u=l.trim(),d=i.get(u);d&&!s.has(d)&&a.set(u,d)}if(a.size>0){let c=[...a].map(([l,u])=>`${l} (${u})`).join(", ");e.push({detector:cf,severity:"warn",path:"spec/scenarios/",message:`scenario ${o.id} flow references ${c} but features[] does not bind ${a.size===1?"it":"them"} \u2014 bind every feature the flow walks, or trim the flow so coverage is not under-stated.`})}}return e}var cf,X$e,d3,f3=y(()=>{"use strict";xt();cf="SCENARIO_COVERAGE",X$e=8;d3={name:cf,run:Q$e}});import{createHash as r0e}from"node:crypto";function n0e(t){return!Number.isFinite(t)||t<=0?0:t>=1?1:t}function lf(t,e=0){if(t.oracle_policy){let r=t.oracle_policy;return{mandateActive:!0,reportOnly:!1,exhaustive:!1,alwaysEars:new Set(r.always_ears??p3),sample:n0e(r.sample??0)}}return t.require_oracles===!0?{mandateActive:!0,reportOnly:!1,exhaustive:!0,alwaysEars:new Set,sample:1}:t.require_oracles===void 0&&e>=8?{mandateActive:!0,reportOnly:!0,exhaustive:!1,alwaysEars:new Set(p3),sample:0}:{mandateActive:!1,reportOnly:!1,exhaustive:!1,alwaysEars:new Set,sample:0}}function uf(t){return(t.features??[]).filter(e=>e.status==="done").length}function i0e(t,e){return e<=0?!1:e>=1?!0:parseInt(r0e("sha256").update(t).digest("hex").slice(0,8),16)%1e40})}return r}var p3,tv=y(()=>{"use strict";p3=["unwanted"]});import{existsSync as o0e,readdirSync as s0e}from"node:fs";import{join as h3}from"node:path";import g3 from"node:process";function a0e(t){let e=!1,r=n=>{for(let i of s0e(n,{withFileTypes:!0})){if(e)return;let o=h3(n,i.name);i.isDirectory()?r(o):(/\.(test|spec)\.[cm]?[jt]sx?$/.test(i.name)||/_test\.py$/.test(i.name))&&(e=!0)}};try{r(t)}catch{}return e}function yP(t={}){let{cwd:e="."}=t,r=h3(e,Uo);if(!o0e(r)||!a0e(r))return{stage:rv,pass:!1,exitCode:2,stderr:`no spec-conformance oracles under ${Uo}/ \u2014 skipped`};let n=dt(e),i=n.gates.test;if(!i?.cmd||!i.args)return{stage:rv,pass:!1,exitCode:2,stderr:`no test runner registered for language '${n.language}'`};let o=Xe(i.cmd,[...i.args,Uo],{cwd:e,reject:!1}),s=jt(rv,i.cmd,o);return s||rr(rv,o)}var rv,Uo,c0e,_P=y(()=>{"use strict";kr();fn();pn();rv="stage_2.3",Uo="tests/oracle";c0e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${g3.argv[1]}`;if(c0e){let t=yP();console.log(JSON.stringify(t)),g3.exit(t.exitCode)}});import{existsSync as l0e}from"node:fs";import{join as u0e}from"node:path";function d0e(t){let{cwd:e="."}=t;return _e(e,zn,r=>f0e(r,e))}function f0e(t,e){let r=[],n=lf(t.project,uf(t)),i=n.reportOnly?"info":"error",o=n.mandateActive?mn(e):[],s=o.filter(l=>l.kind==="oracle"),a=new Set(["agent:developer","agent:specialists"]),c=l=>o.find(u=>u.featureId===l&&a.has(u.stage))?.identity.name;for(let l of t.features)if(l.status==="done")for(let u of l.acceptance_criteria??[]){let d=u.oracle_refs??[];if(df(n,l.id,u)&&d.length===0){let f=n.exhaustive?"project.require_oracles is set":u.ears&&n.alwaysEars.has(u.ears)?`oracle_policy.always_ears includes '${u.ears}'`:"selected by oracle_policy.sample";r.push({detector:zn,severity:i,message:`${l.id}.${u.id} done AC lacks a spec-conformance oracle (${f}; declare oracle_refs under ${Uo}/)`+(n.reportOnly?" [report-only \u2014 the graduated default enforces in 0.7]":"")})}for(let f of d){if(!l0e(u0e(e,f))){r.push({detector:zn,severity:"error",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' resolves to nothing on disk`});continue}if(f.startsWith(`${Uo}/`)||r.push({detector:zn,severity:"warn",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' lives outside ${Uo}/ \u2014 stage_2.3 only runs ${Uo}/, so this oracle will not execute`}),!n.mandateActive)continue;let p=s.find(g=>g.featureId===l.id&&g.acId===u.id&&g.artifact===f);if(!p){r.push({detector:zn,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' has no authoring-provenance record \u2014 author it via 'clad oracle' (or clad_author_oracle) so impl-blindness can be verified`});continue}let m=c(l.id);m&&p.identity.name===m?r.push({detector:zn,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: authored by the implementer ('${m}')`}):m||r.push({detector:zn,severity:"info",message:`${l.id}.${u.id} oracle author\u2260implementer not verified \u2014 no implementer identity recorded (no clad drive history to compare)`});let h=(p.readManifest??[]).filter(g=>(l.modules??[]).includes(g));h.length>0&&r.push({detector:zn,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: author read implementation file(s) the feature owns (${h.join(", ")})`}),p.blind===!1&&r.push({detector:zn,severity:"info",message:`${l.id}.${u.id} oracle '${f}' provenance is self-reported (host-protocol), not cladding-controlled \u2014 manifest checked, blindness unproven`})}}if(n.mandateActive&&!n.exhaustive){let l=t.features.filter(u=>u.status==="done").flatMap(u=>u.acceptance_criteria??[]).filter(u=>!u.ears).length;l>0&&r.push({detector:zn,severity:"info",message:`${l} done AC(s) carry no EARS tag and are invisible to the risk-weighted oracle mandate \u2014 tag them (ubiquitous/event/state/optional/unwanted/complex) for the mandate to mean anything.`})}return r}var zn,y3,_3=y(()=>{"use strict";Mn();tv();_P();xt();zn="SPEC_CONFORMANCE";y3={name:zn,run:d0e}});function p0e(t){let{cwd:e="."}=t,r=mn(e);if(r.length===0)return[{detector:vP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=Date.now(),i=[];for(let o of r){let s=Date.parse(o.identity.timestamp);if(Number.isNaN(s))continue;let a=(n-s)/(1e3*60*60*24);a>v3&&i.push({detector:vP,severity:"warn",message:`evidence ${o.id} is ${Math.round(a)} days old (floor ${v3})`})}return i}var vP,v3,b3,S3=y(()=>{"use strict";Mn();vP="STALE_EVIDENCE",v3=90;b3={name:vP,run:p0e}});import{existsSync as w3}from"node:fs";import{join as x3}from"node:path";function m0e(t){let{cwd:e="."}=t;return _e(e,Fc,r=>h0e(r,e))}function h0e(t,e){let r=[];for(let n of t.features){if(n.archived_at&&n.status!=="archived"&&r.push({detector:Fc,severity:"warn",message:`feature ${n.id} has archived_at but status='${n.status}' (expected 'archived')`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`archived_at already set but status is '${n.status}'`}}}),n.superseded_by&&!n.archived_at&&r.push({detector:Fc,severity:"warn",message:`feature ${n.id} has superseded_by but no archived_at`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`superseded by ${n.superseded_by} but missing archived_at`}}}),n.status==="archived"){let i=(n.modules??[]).filter(o=>w3(x3(e,o)));i.length>0&&r.push({detector:Fc,severity:"warn",message:`feature ${n.id} is archived but ${i.length} module(s) still exist: ${i.join(", ")}`})}(n.status==="planned"||n.status==="in_progress")&&(n.modules?.length??0)>0&&!(n.modules??[]).some(i=>w3(x3(e,i)))&&r.push({detector:Fc,severity:"warn",message:`feature ${n.id} (status='${n.status}') declares ${n.modules?.length??0} module(s) but none exist on disk \u2014 consider archiving`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:"all declared modules vanished from disk"}}})}return r}var Fc,nv,bP=y(()=>{"use strict";xt();Fc="STALE_SPECIFICATION";nv={name:Fc,run:m0e}});import{existsSync as $3,statSync as k3}from"node:fs";import{join as E3}from"node:path";function y0e(t,e){let r=0;for(let n of e){let i=E3(t,n);if(!$3(i))continue;let o=k3(i).mtimeMs;o>r&&(r=o)}return r}function _0e(t){let{cwd:e="."}=t;return _e(e,SP,r=>v0e(r,e))}function v0e(t,e){let r=fi(e,t.project?.language),n=t.features.flatMap(a=>a.modules??[]),i=y0e(e,n);if(i===0)return[];let o=Fo([...r.testGlobs],{cwd:e,dot:!1});if(o.length===0)return[];let s=[];for(let a of o){let c=E3(e,a);if(!$3(c))continue;let l=k3(c).mtimeMs,u=(i-l)/(1e3*60*60*24);u>g0e&&s.push({detector:SP,severity:"warn",path:a,message:`${a} is ${Math.round(u)} days older than newest source module`})}return s}var SP,g0e,A3,T3=y(()=>{"use strict";tf();Cc();xt();SP="STALE_TESTS",g0e=30;A3={name:SP,run:_0e}});import{existsSync as b0e}from"node:fs";import{join as S0e}from"node:path";function w0e(t){let{cwd:e="."}=t;return _e(e,ff,r=>x0e(r,e))}function x0e(t,e){let r=[];for(let n of t.features){let i=n.modules??[],o=n.acceptance_criteria??[];if(n.status==="done"&&i.length===0&&o.length===0){r.push({detector:ff,severity:"error",message:`feature ${n.id} status='done' but declares no modules and no acceptance_criteria \u2014 nothing to verify (hollow completion)`});continue}if(i.length===0)continue;let s=i.filter(a=>!b0e(S0e(e,a)));s.length!==0&&(n.status==="done"?r.push({detector:ff,severity:"error",message:`feature ${n.id} status='done' but ${s.length}/${i.length} module(s) missing: ${s.join(", ")}`}):n.status==="in_progress"&&s.length===i.length&&r.push({detector:ff,severity:"warn",message:`feature ${n.id} status='in_progress' but every declared module is missing \u2014 likely a stale start`}))}return r}var ff,O3,P3=y(()=>{"use strict";xt();ff="STATUS_DRIFT";O3={name:ff,run:w0e}});function $0e(t){let{cwd:e="."}=t;return _e(e,iv,r=>k0e(r,e))}function k0e(t,e){let r=dt(e).language;return r==="unknown"?[{detector:iv,severity:"info",message:"no manifest matched \u2014 language cannot be cross-checked"}]:t.project.language===r?[]:[{detector:iv,severity:"warn",message:`spec.project.language='${t.project.language}' but the manifest chain detects '${r}'`}]}var iv,I3,R3=y(()=>{"use strict";fn();xt();iv="TECH_STACK_MISMATCH";I3={name:iv,run:$0e}});function O0e(t){if((t.features??[]).length`${i}/${o}/**/*.${n}`)}function P0e(t){let{cwd:e="."}=t;return _e(e,wP,r=>I0e(r,e))}function I0e(t,e){let r=new Set;for(let o of t.features)for(let s of o.modules??[])r.add(s);let n=Fo([...O0e(t)],{cwd:e,dot:!1}),i=[];for(let o of n)r.has(o)||i.push({detector:wP,severity:"error",path:o,message:`file '${o}' is not claimed by any feature in spec.yaml`});return i}var wP,C3,E0e,A0e,T0e,D3,N3=y(()=>{"use strict";tf();QO();xt();wP="UNMAPPED_ARTIFACT",C3=["src/stages/**/*.ts","src/spec/**/*.ts"],E0e={typescript:"ts",javascript:"js",python:"py",rust:"rs",go:"go",kotlin:"kt"},A0e={kotlin:"src/main/kotlin"},T0e=8;D3={name:wP,run:P0e}});import{existsSync as j3}from"node:fs";import{join as M3}from"node:path";function C0e(t){return R0e.some(e=>t.startsWith(e))}function D0e(t){let{cwd:e="."}=t;return _e(e,xP,r=>N0e(r,e))}function N0e(t,e){let r=[];for(let n of t.features)if(n.status==="done")for(let i of n.acceptance_criteria??[])for(let o of i.test_refs??[]){if(C0e(o))continue;let s=o.split("#",1)[0];j3(M3(e,o))||s&&j3(M3(e,s))||r.push({detector:xP,severity:"error",path:o,message:`${n.id}.${i.id} test_ref '${o}' resolves to nothing on disk \u2014 a test_ref must be a real file path (e.g. 'tests/x.test.ts', optionally with a '#' anchor) or a 'self-dogfood: