@pickled-dev/cli 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +34 -0
  2. package/dist/index.js +204 -187
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,206 +1,223 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var z5=Object.create;var{getPrototypeOf:X5,defineProperty:n1,getOwnPropertyNames:Z5}=Object;var H5=Object.prototype.hasOwnProperty;function Q5($){return this[$]}var J5,U5,o1=($,q,z)=>{var X=$!=null&&typeof $==="object";if(X){var Z=q?J5??=new WeakMap:U5??=new WeakMap,H=Z.get($);if(H)return H}z=$!=null?z5(X5($)):{};let Q=q||!$||!$.__esModule?n1(z,"default",{value:$,enumerable:!0}):z;for(let J of Z5($))if(!H5.call(Q,J))n1(Q,J,{get:Q5.bind($,J),enumerable:!0});if(X)Z.set($,Q);return Q};var I=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports);var a=import.meta.require;var f0=I((G5)=>{class Wq extends Error{constructor($,q,z){super(z);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=q,this.exitCode=$,this.nestedError=void 0}}class t1 extends Wq{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}G5.CommanderError=Wq;G5.InvalidArgumentError=t1});var Y$=I((L5)=>{var{InvalidArgumentError:W5}=f0();class e1{constructor($,q){switch(this.description=q||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,$[0]){case"<":this.required=!0,this._name=$.slice(1,-1);break;case"[":this.required=!1,this._name=$.slice(1,-1);break;default:this.required=!0,this._name=$;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue($,q){if(q===this.defaultValue||!Array.isArray(q))return[$];return q.push($),q}default($,q){return this.defaultValue=$,this.defaultValueDescription=q,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(q,z)=>{if(!this.argChoices.includes(q))throw new W5(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(q,z);return q},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function T5($){let q=$.name()+($.variadic===!0?"...":"");return $.required?"<"+q+">":"["+q+"]"}L5.Argument=e1;L5.humanReadableArgName=T5});var Tq=I((D5)=>{var{humanReadableArgName:I5}=Y$();class $2{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let q=$.commands.filter((X)=>!X._hidden),z=$._getHelpCommand();if(z&&!z._hidden)q.push(z);if(this.sortSubcommands)q.sort((X,Z)=>{return X.name().localeCompare(Z.name())});return q}compareOptions($,q){let z=(X)=>{return X.short?X.short.replace(/^-/,""):X.long.replace(/^--/,"")};return z($).localeCompare(z(q))}visibleOptions($){let q=$.options.filter((X)=>!X.hidden),z=$._getHelpOption();if(z&&!z.hidden){let X=z.short&&$._findOption(z.short),Z=z.long&&$._findOption(z.long);if(!X&&!Z)q.push(z);else if(z.long&&!Z)q.push($.createOption(z.long,z.description));else if(z.short&&!X)q.push($.createOption(z.short,z.description))}if(this.sortOptions)q.sort(this.compareOptions);return q}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let q=[];for(let z=$.parent;z;z=z.parent){let X=z.options.filter((Z)=>!Z.hidden);q.push(...X)}if(this.sortOptions)q.sort(this.compareOptions);return q}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((q)=>{q.description=q.description||$._argsDescription[q.name()]||""});if($.registeredArguments.find((q)=>q.description))return $.registeredArguments;return[]}subcommandTerm($){let q=$.registeredArguments.map((z)=>I5(z)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(q?" "+q:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,q){return q.visibleCommands($).reduce((z,X)=>{return Math.max(z,this.displayWidth(q.styleSubcommandTerm(q.subcommandTerm(X))))},0)}longestOptionTermLength($,q){return q.visibleOptions($).reduce((z,X)=>{return Math.max(z,this.displayWidth(q.styleOptionTerm(q.optionTerm(X))))},0)}longestGlobalOptionTermLength($,q){return q.visibleGlobalOptions($).reduce((z,X)=>{return Math.max(z,this.displayWidth(q.styleOptionTerm(q.optionTerm(X))))},0)}longestArgumentTermLength($,q){return q.visibleArguments($).reduce((z,X)=>{return Math.max(z,this.displayWidth(q.styleArgumentTerm(q.argumentTerm(X))))},0)}commandUsage($){let q=$._name;if($._aliases[0])q=q+"|"+$._aliases[0];let z="";for(let X=$.parent;X;X=X.parent)z=X.name()+" "+z;return z+q+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let q=[];if($.argChoices)q.push(`choices: ${$.argChoices.map((z)=>JSON.stringify(z)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")q.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)q.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)q.push(`env: ${$.envVar}`);if(q.length>0){let z=`(${q.join(", ")})`;if($.description)return`${$.description} ${z}`;return z}return $.description}argumentDescription($){let q=[];if($.argChoices)q.push(`choices: ${$.argChoices.map((z)=>JSON.stringify(z)).join(", ")}`);if($.defaultValue!==void 0)q.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(q.length>0){let z=`(${q.join(", ")})`;if($.description)return`${$.description} ${z}`;return z}return $.description}formatItemList($,q,z){if(q.length===0)return[];return[z.styleTitle($),...q,""]}groupItems($,q,z){let X=new Map;return $.forEach((Z)=>{let H=z(Z);if(!X.has(H))X.set(H,[])}),q.forEach((Z)=>{let H=z(Z);if(!X.has(H))X.set(H,[]);X.get(H).push(Z)}),X}formatHelp($,q){let z=q.padWidth($,q),X=q.helpWidth??80;function Z(B,Y){return q.formatItem(B,z,Y,q)}let H=[`${q.styleTitle("Usage:")} ${q.styleUsage(q.commandUsage($))}`,""],Q=q.commandDescription($);if(Q.length>0)H=H.concat([q.boxWrap(q.styleCommandDescription(Q),X),""]);let J=q.visibleArguments($).map((B)=>{return Z(q.styleArgumentTerm(q.argumentTerm(B)),q.styleArgumentDescription(q.argumentDescription(B)))});if(H=H.concat(this.formatItemList("Arguments:",J,q)),this.groupItems($.options,q.visibleOptions($),(B)=>B.helpGroupHeading??"Options:").forEach((B,Y)=>{let W=B.map((L)=>{return Z(q.styleOptionTerm(q.optionTerm(L)),q.styleOptionDescription(q.optionDescription(L)))});H=H.concat(this.formatItemList(Y,W,q))}),q.showGlobalOptions){let B=q.visibleGlobalOptions($).map((Y)=>{return Z(q.styleOptionTerm(q.optionTerm(Y)),q.styleOptionDescription(q.optionDescription(Y)))});H=H.concat(this.formatItemList("Global Options:",B,q))}return this.groupItems($.commands,q.visibleCommands($),(B)=>B.helpGroup()||"Commands:").forEach((B,Y)=>{let W=B.map((L)=>{return Z(q.styleSubcommandTerm(q.subcommandTerm(L)),q.styleSubcommandDescription(q.subcommandDescription(L)))});H=H.concat(this.formatItemList(Y,W,q))}),H.join(`
4
- `)}displayWidth($){return q2($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((q)=>{if(q==="[options]")return this.styleOptionText(q);if(q==="[command]")return this.styleSubcommandText(q);if(q[0]==="["||q[0]==="<")return this.styleArgumentText(q);return this.styleCommandText(q)}).join(" ")}styleCommandDescription($){return this.styleDescriptionText($)}styleOptionDescription($){return this.styleDescriptionText($)}styleSubcommandDescription($){return this.styleDescriptionText($)}styleArgumentDescription($){return this.styleDescriptionText($)}styleDescriptionText($){return $}styleOptionTerm($){return this.styleOptionText($)}styleSubcommandTerm($){return $.split(" ").map((q)=>{if(q==="[options]")return this.styleOptionText(q);if(q[0]==="["||q[0]==="<")return this.styleArgumentText(q);return this.styleSubcommandText(q)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,q){return Math.max(q.longestOptionTermLength($,q),q.longestGlobalOptionTermLength($,q),q.longestSubcommandTermLength($,q),q.longestArgumentTermLength($,q))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,q,z,X){let H=" ".repeat(2);if(!z)return H+$;let Q=$.padEnd(q+$.length-X.displayWidth($)),J=2,U=(this.helpWidth??80)-q-J-2,B;if(U<this.minWidthToWrap||X.preformatted(z))B=z;else B=X.boxWrap(z,U).replace(/\n/g,`
5
- `+" ".repeat(q+J));return H+Q+" ".repeat(J)+B.replace(/\n/g,`
6
- ${H}`)}boxWrap($,q){if(q<this.minWidthToWrap)return $;let z=$.split(/\r\n|\n/),X=/[\s]*[^\s]+/g,Z=[];return z.forEach((H)=>{let Q=H.match(X);if(Q===null){Z.push("");return}let J=[Q.shift()],G=this.displayWidth(J[0]);Q.forEach((U)=>{let B=this.displayWidth(U);if(G+B<=q){J.push(U),G+=B;return}Z.push(J.join(""));let Y=U.trimStart();J=[Y],G=this.displayWidth(Y)}),Z.push(J.join(""))}),Z.join(`
7
- `)}}function q2($){let q=/\x1b\[\d*(;\d*)*m/g;return $.replace(q,"")}D5.Help=$2;D5.stripColor=q2});var Lq=I((K5)=>{var{InvalidArgumentError:w5}=f0();class X2{constructor($,q){this.flags=$,this.description=q||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let z=P5($);if(this.short=z.shortFlag,this.long=z.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($,q){return this.defaultValue=$,this.defaultValueDescription=q,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let q=$;if(typeof $==="string")q={[$]:!0};return this.implied=Object.assign(this.implied||{},q),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,q){if(q===this.defaultValue||!Array.isArray(q))return[$];return q.push($),q}choices($){return this.argChoices=$.slice(),this.parseArg=(q,z)=>{if(!this.argChoices.includes(q))throw new w5(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(q,z);return q},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return z2(this.name().replace(/^no-/,""));return z2(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class Z2{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((q)=>{if(q.negate)this.negativeOptions.set(q.attributeName(),q);else this.positiveOptions.set(q.attributeName(),q)}),this.negativeOptions.forEach((q,z)=>{if(this.positiveOptions.has(z))this.dualOptions.add(z)})}valueFromOption($,q){let z=q.attributeName();if(!this.dualOptions.has(z))return!0;let X=this.negativeOptions.get(z).presetArg,Z=X!==void 0?X:!1;return q.negate===(Z===$)}}function z2($){return $.split("-").reduce((q,z)=>{return q+z[0].toUpperCase()+z.slice(1)})}function P5($){let q,z,X=/^-[^-]$/,Z=/^--[^-]/,H=$.split(/[ |,]+/).concat("guard");if(X.test(H[0]))q=H.shift();if(Z.test(H[0]))z=H.shift();if(!q&&X.test(H[0]))q=H.shift();if(!q&&Z.test(H[0]))q=z,z=H.shift();if(H[0].startsWith("-")){let Q=H[0],J=`option creation failed due to '${Q}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Q))throw Error(`${J}
3
+ var yZ=Object.create;var{getPrototypeOf:xZ,defineProperty:n4,getOwnPropertyNames:fZ}=Object;var kZ=Object.prototype.hasOwnProperty;function gZ($){return this[$]}var hZ,vZ,r4=($,X,Z)=>{var q=$!=null&&typeof $==="object";if(q){var z=X?hZ??=new WeakMap:vZ??=new WeakMap,G=z.get($);if(G)return G}Z=$!=null?yZ(xZ($)):{};let J=X||!$||!$.__esModule?n4(Z,"default",{value:$,enumerable:!0}):Z;for(let Q of fZ($))if(!kZ.call(J,Q))n4(J,Q,{get:gZ.bind($,Q),enumerable:!0});if(q)z.set($,J);return J};var K=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var Q0=import.meta.require;var _$=K((uZ)=>{class p2 extends Error{constructor($,X,Z){super(Z);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=X,this.exitCode=$,this.nestedError=void 0}}class o4 extends p2{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}uZ.CommanderError=p2;uZ.InvalidArgumentError=o4});var T1=K((lZ)=>{var{InvalidArgumentError:pZ}=_$();class t4{constructor($,X){switch(this.description=X||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,$[0]){case"<":this.required=!0,this._name=$.slice(1,-1);break;case"[":this.required=!1,this._name=$.slice(1,-1);break;default:this.required=!0,this._name=$;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue($,X){if(X===this.defaultValue||!Array.isArray(X))return[$];return X.push($),X}default($,X){return this.defaultValue=$,this.defaultValueDescription=X,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(X,Z)=>{if(!this.argChoices.includes(X))throw new pZ(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(X,Z);return X},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function cZ($){let X=$.name()+($.variadic===!0?"...":"");return $.required?"<"+X+">":"["+X+"]"}lZ.Argument=t4;lZ.humanReadableArgName=cZ});var c2=K((nZ)=>{var{humanReadableArgName:sZ}=T1();class e4{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let X=$.commands.filter((q)=>!q._hidden),Z=$._getHelpCommand();if(Z&&!Z._hidden)X.push(Z);if(this.sortSubcommands)X.sort((q,z)=>{return q.name().localeCompare(z.name())});return X}compareOptions($,X){let Z=(q)=>{return q.short?q.short.replace(/^-/,""):q.long.replace(/^--/,"")};return Z($).localeCompare(Z(X))}visibleOptions($){let X=$.options.filter((q)=>!q.hidden),Z=$._getHelpOption();if(Z&&!Z.hidden){let q=Z.short&&$._findOption(Z.short),z=Z.long&&$._findOption(Z.long);if(!q&&!z)X.push(Z);else if(Z.long&&!z)X.push($.createOption(Z.long,Z.description));else if(Z.short&&!q)X.push($.createOption(Z.short,Z.description))}if(this.sortOptions)X.sort(this.compareOptions);return X}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let X=[];for(let Z=$.parent;Z;Z=Z.parent){let q=Z.options.filter((z)=>!z.hidden);X.push(...q)}if(this.sortOptions)X.sort(this.compareOptions);return X}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((X)=>{X.description=X.description||$._argsDescription[X.name()]||""});if($.registeredArguments.find((X)=>X.description))return $.registeredArguments;return[]}subcommandTerm($){let X=$.registeredArguments.map((Z)=>sZ(Z)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(X?" "+X:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,X){return X.visibleCommands($).reduce((Z,q)=>{return Math.max(Z,this.displayWidth(X.styleSubcommandTerm(X.subcommandTerm(q))))},0)}longestOptionTermLength($,X){return X.visibleOptions($).reduce((Z,q)=>{return Math.max(Z,this.displayWidth(X.styleOptionTerm(X.optionTerm(q))))},0)}longestGlobalOptionTermLength($,X){return X.visibleGlobalOptions($).reduce((Z,q)=>{return Math.max(Z,this.displayWidth(X.styleOptionTerm(X.optionTerm(q))))},0)}longestArgumentTermLength($,X){return X.visibleArguments($).reduce((Z,q)=>{return Math.max(Z,this.displayWidth(X.styleArgumentTerm(X.argumentTerm(q))))},0)}commandUsage($){let X=$._name;if($._aliases[0])X=X+"|"+$._aliases[0];let Z="";for(let q=$.parent;q;q=q.parent)Z=q.name()+" "+Z;return Z+X+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let X=[];if($.argChoices)X.push(`choices: ${$.argChoices.map((Z)=>JSON.stringify(Z)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")X.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)X.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)X.push(`env: ${$.envVar}`);if(X.length>0){let Z=`(${X.join(", ")})`;if($.description)return`${$.description} ${Z}`;return Z}return $.description}argumentDescription($){let X=[];if($.argChoices)X.push(`choices: ${$.argChoices.map((Z)=>JSON.stringify(Z)).join(", ")}`);if($.defaultValue!==void 0)X.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(X.length>0){let Z=`(${X.join(", ")})`;if($.description)return`${$.description} ${Z}`;return Z}return $.description}formatItemList($,X,Z){if(X.length===0)return[];return[Z.styleTitle($),...X,""]}groupItems($,X,Z){let q=new Map;return $.forEach((z)=>{let G=Z(z);if(!q.has(G))q.set(G,[])}),X.forEach((z)=>{let G=Z(z);if(!q.has(G))q.set(G,[]);q.get(G).push(z)}),q}formatHelp($,X){let Z=X.padWidth($,X),q=X.helpWidth??80;function z(W,H){return X.formatItem(W,Z,H,X)}let G=[`${X.styleTitle("Usage:")} ${X.styleUsage(X.commandUsage($))}`,""],J=X.commandDescription($);if(J.length>0)G=G.concat([X.boxWrap(X.styleCommandDescription(J),q),""]);let Q=X.visibleArguments($).map((W)=>{return z(X.styleArgumentTerm(X.argumentTerm(W)),X.styleArgumentDescription(X.argumentDescription(W)))});if(G=G.concat(this.formatItemList("Arguments:",Q,X)),this.groupItems($.options,X.visibleOptions($),(W)=>W.helpGroupHeading??"Options:").forEach((W,H)=>{let V=W.map((w)=>{return z(X.styleOptionTerm(X.optionTerm(w)),X.styleOptionDescription(X.optionDescription(w)))});G=G.concat(this.formatItemList(H,V,X))}),X.showGlobalOptions){let W=X.visibleGlobalOptions($).map((H)=>{return z(X.styleOptionTerm(X.optionTerm(H)),X.styleOptionDescription(X.optionDescription(H)))});G=G.concat(this.formatItemList("Global Options:",W,X))}return this.groupItems($.commands,X.visibleCommands($),(W)=>W.helpGroup()||"Commands:").forEach((W,H)=>{let V=W.map((w)=>{return z(X.styleSubcommandTerm(X.subcommandTerm(w)),X.styleSubcommandDescription(X.subcommandDescription(w)))});G=G.concat(this.formatItemList(H,V,X))}),G.join(`
4
+ `)}displayWidth($){return $X($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((X)=>{if(X==="[options]")return this.styleOptionText(X);if(X==="[command]")return this.styleSubcommandText(X);if(X[0]==="["||X[0]==="<")return this.styleArgumentText(X);return this.styleCommandText(X)}).join(" ")}styleCommandDescription($){return this.styleDescriptionText($)}styleOptionDescription($){return this.styleDescriptionText($)}styleSubcommandDescription($){return this.styleDescriptionText($)}styleArgumentDescription($){return this.styleDescriptionText($)}styleDescriptionText($){return $}styleOptionTerm($){return this.styleOptionText($)}styleSubcommandTerm($){return $.split(" ").map((X)=>{if(X==="[options]")return this.styleOptionText(X);if(X[0]==="["||X[0]==="<")return this.styleArgumentText(X);return this.styleSubcommandText(X)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,X){return Math.max(X.longestOptionTermLength($,X),X.longestGlobalOptionTermLength($,X),X.longestSubcommandTermLength($,X),X.longestArgumentTermLength($,X))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,X,Z,q){let G=" ".repeat(2);if(!Z)return G+$;let J=$.padEnd(X+$.length-q.displayWidth($)),Q=2,U=(this.helpWidth??80)-X-Q-2,W;if(U<this.minWidthToWrap||q.preformatted(Z))W=Z;else W=q.boxWrap(Z,U).replace(/\n/g,`
5
+ `+" ".repeat(X+Q));return G+J+" ".repeat(Q)+W.replace(/\n/g,`
6
+ ${G}`)}boxWrap($,X){if(X<this.minWidthToWrap)return $;let Z=$.split(/\r\n|\n/),q=/[\s]*[^\s]+/g,z=[];return Z.forEach((G)=>{let J=G.match(q);if(J===null){z.push("");return}let Q=[J.shift()],Y=this.displayWidth(Q[0]);J.forEach((U)=>{let W=this.displayWidth(U);if(Y+W<=X){Q.push(U),Y+=W;return}z.push(Q.join(""));let H=U.trimStart();Q=[H],Y=this.displayWidth(H)}),z.push(Q.join(""))}),z.join(`
7
+ `)}}function $X($){let X=/\x1b\[\d*(;\d*)*m/g;return $.replace(X,"")}nZ.Help=e4;nZ.stripColor=$X});var l2=K(($6)=>{var{InvalidArgumentError:tZ}=_$();class ZX{constructor($,X){this.flags=$,this.description=X||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let Z=eZ($);if(this.short=Z.shortFlag,this.long=Z.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($,X){return this.defaultValue=$,this.defaultValueDescription=X,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let X=$;if(typeof $==="string")X={[$]:!0};return this.implied=Object.assign(this.implied||{},X),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,X){if(X===this.defaultValue||!Array.isArray(X))return[$];return X.push($),X}choices($){return this.argChoices=$.slice(),this.parseArg=(X,Z)=>{if(!this.argChoices.includes(X))throw new tZ(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(X,Z);return X},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return XX(this.name().replace(/^no-/,""));return XX(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class qX{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((X)=>{if(X.negate)this.negativeOptions.set(X.attributeName(),X);else this.positiveOptions.set(X.attributeName(),X)}),this.negativeOptions.forEach((X,Z)=>{if(this.positiveOptions.has(Z))this.dualOptions.add(Z)})}valueFromOption($,X){let Z=X.attributeName();if(!this.dualOptions.has(Z))return!0;let q=this.negativeOptions.get(Z).presetArg,z=q!==void 0?q:!1;return X.negate===(z===$)}}function XX($){return $.split("-").reduce((X,Z)=>{return X+Z[0].toUpperCase()+Z.slice(1)})}function eZ($){let X,Z,q=/^-[^-]$/,z=/^--[^-]/,G=$.split(/[ |,]+/).concat("guard");if(q.test(G[0]))X=G.shift();if(z.test(G[0]))Z=G.shift();if(!X&&q.test(G[0]))X=G.shift();if(!X&&z.test(G[0]))X=Z,Z=G.shift();if(G[0].startsWith("-")){let J=G[0],Q=`option creation failed due to '${J}' in option flags '${$}'`;if(/^-[^-][^-]/.test(J))throw Error(`${Q}
8
8
  - a short flag is a single dash and a single character
9
9
  - either use a single dash and a single character (for a short flag)
10
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(X.test(Q))throw Error(`${J}
11
- - too many short flags`);if(Z.test(Q))throw Error(`${J}
12
- - too many long flags`);throw Error(`${J}
13
- - unrecognised flag format`)}if(q===void 0&&z===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:q,longFlag:z}}K5.Option=X2;K5.DualOptions=Z2});var H2=I((S5)=>{function A5($,q){if(Math.abs($.length-q.length)>3)return Math.max($.length,q.length);let z=[];for(let X=0;X<=$.length;X++)z[X]=[X];for(let X=0;X<=q.length;X++)z[0][X]=X;for(let X=1;X<=q.length;X++)for(let Z=1;Z<=$.length;Z++){let H=1;if($[Z-1]===q[X-1])H=0;else H=1;if(z[Z][X]=Math.min(z[Z-1][X]+1,z[Z][X-1]+1,z[Z-1][X-1]+H),Z>1&&X>1&&$[Z-1]===q[X-2]&&$[Z-2]===q[X-1])z[Z][X]=Math.min(z[Z][X],z[Z-2][X-2]+1)}return z[$.length][q.length]}function j5($,q){if(!q||q.length===0)return"";q=Array.from(new Set(q));let z=$.startsWith("--");if(z)$=$.slice(2),q=q.map((Q)=>Q.slice(2));let X=[],Z=3,H=0.4;if(q.forEach((Q)=>{if(Q.length<=1)return;let J=A5($,Q),G=Math.max($.length,Q.length);if((G-J)/G>H){if(J<Z)Z=J,X=[Q];else if(J===Z)X.push(Q)}}),X.sort((Q,J)=>Q.localeCompare(J)),z)X=X.map((Q)=>`--${Q}`);if(X.length>1)return`
14
- (Did you mean one of ${X.join(", ")}?)`;if(X.length===1)return`
15
- (Did you mean ${X[0]}?)`;return""}S5.suggestSimilar=j5});var G2=I((x5)=>{var E5=a("events").EventEmitter,Vq=a("child_process"),s=a("path"),B$=a("fs"),j=a("process"),{Argument:b5,humanReadableArgName:C5}=Y$(),{CommanderError:_q}=f0(),{Help:y5,stripColor:f5}=Tq(),{Option:Q2,DualOptions:k5}=Lq(),{suggestSimilar:J2}=H2();class Dq extends E5{constructor($){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=$||"",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:(q)=>j.stdout.write(q),writeErr:(q)=>j.stderr.write(q),outputError:(q,z)=>z(q),getOutHelpWidth:()=>j.stdout.isTTY?j.stdout.columns:void 0,getErrHelpWidth:()=>j.stderr.isTTY?j.stderr.columns:void 0,getOutHasColors:()=>Iq()??(j.stdout.isTTY&&j.stdout.hasColors?.()),getErrHasColors:()=>Iq()??(j.stderr.isTTY&&j.stderr.hasColors?.()),stripColor:(q)=>f5(q)},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($){return this._outputConfiguration=$._outputConfiguration,this._helpOption=$._helpOption,this._helpCommand=$._helpCommand,this._helpConfiguration=$._helpConfiguration,this._exitCallback=$._exitCallback,this._storeOptionsAsProperties=$._storeOptionsAsProperties,this._combineFlagAndOptionalValue=$._combineFlagAndOptionalValue,this._allowExcessArguments=$._allowExcessArguments,this._enablePositionalOptions=$._enablePositionalOptions,this._showHelpAfterError=$._showHelpAfterError,this._showSuggestionAfterError=$._showSuggestionAfterError,this}_getCommandAndAncestors(){let $=[];for(let q=this;q;q=q.parent)$.push(q);return $}command($,q,z){let X=q,Z=z;if(typeof X==="object"&&X!==null)Z=X,X=null;Z=Z||{};let[,H,Q]=$.match(/([^ ]+) *(.*)/),J=this.createCommand(H);if(X)J.description(X),J._executableHandler=!0;if(Z.isDefault)this._defaultCommandName=J._name;if(J._hidden=!!(Z.noHelp||Z.hidden),J._executableFile=Z.executableFile||null,Q)J.arguments(Q);if(this._registerCommand(J),J.parent=this,J.copyInheritedSettings(this),X)return this;return J}createCommand($){return new Dq($)}createHelp(){return Object.assign(new y5,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...$},this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,q){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
16
- - specify the name in Command constructor or using .name()`);if(q=q||{},q.isDefault)this._defaultCommandName=$._name;if(q.noHelp||q.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,q){return new b5($,q)}argument($,q,z,X){let Z=this.createArgument($,q);if(typeof z==="function")Z.default(X).argParser(z);else Z.default(z);return this.addArgument(Z),this}arguments($){return $.trim().split(/ +/).forEach((q)=>{this.argument(q)}),this}addArgument($){let q=this.registeredArguments.slice(-1)[0];if(q?.variadic)throw Error(`only the last argument can be variadic '${q.name()}'`);if($.required&&$.defaultValue!==void 0&&$.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${$.name()}'`);return this.registeredArguments.push($),this}helpCommand($,q){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let z=$??"help [command]",[,X,Z]=z.match(/([^ ]+) *(.*)/),H=q??"display help for command",Q=this.createCommand(X);if(Q.helpOption(!1),Z)Q.arguments(Z);if(H)Q.description(H);if(this._addImplicitHelpCommand=!0,this._helpCommand=Q,$||q)this._initCommandGroup(Q);return this}addHelpCommand($,q){if(typeof $!=="object")return this.helpCommand($,q),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,this._initCommandGroup($),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook($,q){let z=["preSubcommand","preAction","postAction"];if(!z.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
17
- Expecting one of '${z.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(q);else this._lifeCycleHooks[$]=[q];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(q)=>{if(q.code!=="commander.executeSubCommandAsync")throw q};return this}_exit($,q,z){if(this._exitCallback)this._exitCallback(new _q($,q,z));j.exit($)}action($){let q=(z)=>{let X=this.registeredArguments.length,Z=z.slice(0,X);if(this._storeOptionsAsProperties)Z[X]=this;else Z[X]=this.opts();return Z.push(this),$.apply(this,Z)};return this._actionHandler=q,this}createOption($,q){return new Q2($,q)}_callParseArg($,q,z,X){try{return $.parseArg(q,z)}catch(Z){if(Z.code==="commander.invalidArgument"){let H=`${X} ${Z.message}`;this.error(H,{exitCode:Z.exitCode,code:Z.code})}throw Z}}_registerOption($){let q=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(q){let z=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${z}'
18
- - already used by option '${q.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let q=(X)=>{return[X.name()].concat(X.aliases())},z=q($).find((X)=>this._findCommand(X));if(z){let X=q(this._findCommand(z)).join("|"),Z=q($).join("|");throw Error(`cannot add command '${Z}' as already have command '${X}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let q=$.name(),z=$.attributeName();if($.negate){let Z=$.long.replace(/^--no-/,"--");if(!this._findOption(Z))this.setOptionValueWithSource(z,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(z,$.defaultValue,"default");let X=(Z,H,Q)=>{if(Z==null&&$.presetArg!==void 0)Z=$.presetArg;let J=this.getOptionValue(z);if(Z!==null&&$.parseArg)Z=this._callParseArg($,Z,J,H);else if(Z!==null&&$.variadic)Z=$._collectValue(Z,J);if(Z==null)if($.negate)Z=!1;else if($.isBoolean()||$.optional)Z=!0;else Z="";this.setOptionValueWithSource(z,Z,Q)};if(this.on("option:"+q,(Z)=>{let H=`error: option '${$.flags}' argument '${Z}' is invalid.`;X(Z,H,"cli")}),$.envVar)this.on("optionEnv:"+q,(Z)=>{let H=`error: option '${$.flags}' value '${Z}' from env '${$.envVar}' is invalid.`;X(Z,H,"env")});return this}_optionEx($,q,z,X,Z){if(typeof q==="object"&&q instanceof Q2)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let H=this.createOption(q,z);if(H.makeOptionMandatory(!!$.mandatory),typeof X==="function")H.default(Z).argParser(X);else if(X instanceof RegExp){let Q=X;X=(J,G)=>{let U=Q.exec(J);return U?U[0]:G},H.default(Z).argParser(X)}else H.default(X);return this.addOption(H)}option($,q,z,X){return this._optionEx({},$,q,z,X)}requiredOption($,q,z,X){return this._optionEx({mandatory:!0},$,q,z,X)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,q){return this.setOptionValueWithSource($,q,void 0)}setOptionValueWithSource($,q,z){if(this._storeOptionsAsProperties)this[$]=q;else this._optionValues[$]=q;return this._optionValueSources[$]=z,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let q;return this._getCommandAndAncestors().forEach((z)=>{if(z.getOptionValueSource($)!==void 0)q=z.getOptionValueSource($)}),q}_prepareUserArgs($,q){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(q=q||{},$===void 0&&q.from===void 0){if(j.versions?.electron)q.from="electron";let X=j.execArgv??[];if(X.includes("-e")||X.includes("--eval")||X.includes("-p")||X.includes("--print"))q.from="eval"}if($===void 0)$=j.argv;this.rawArgs=$.slice();let z;switch(q.from){case void 0:case"node":this._scriptPath=$[1],z=$.slice(2);break;case"electron":if(j.defaultApp)this._scriptPath=$[1],z=$.slice(2);else z=$.slice(1);break;case"user":z=$.slice(0);break;case"eval":z=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${q.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",z}parse($,q){this._prepareForParse();let z=this._prepareUserArgs($,q);return this._parseCommand([],z),this}async parseAsync($,q){this._prepareForParse();let z=this._prepareUserArgs($,q);return await this._parseCommand([],z),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
19
- - 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($,q,z){if(B$.existsSync($))return;let X=q?`searched for local subcommand relative to directory '${q}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",Z=`'${$}' does not exist
20
- - if '${z}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
10
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(q.test(J))throw Error(`${Q}
11
+ - too many short flags`);if(z.test(J))throw Error(`${Q}
12
+ - too many long flags`);throw Error(`${Q}
13
+ - unrecognised flag format`)}if(X===void 0&&Z===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:X,longFlag:Z}}$6.Option=ZX;$6.DualOptions=qX});var zX=K((G6)=>{function q6($,X){if(Math.abs($.length-X.length)>3)return Math.max($.length,X.length);let Z=[];for(let q=0;q<=$.length;q++)Z[q]=[q];for(let q=0;q<=X.length;q++)Z[0][q]=q;for(let q=1;q<=X.length;q++)for(let z=1;z<=$.length;z++){let G=1;if($[z-1]===X[q-1])G=0;else G=1;if(Z[z][q]=Math.min(Z[z-1][q]+1,Z[z][q-1]+1,Z[z-1][q-1]+G),z>1&&q>1&&$[z-1]===X[q-2]&&$[z-2]===X[q-1])Z[z][q]=Math.min(Z[z][q],Z[z-2][q-2]+1)}return Z[$.length][X.length]}function z6($,X){if(!X||X.length===0)return"";X=Array.from(new Set(X));let Z=$.startsWith("--");if(Z)$=$.slice(2),X=X.map((J)=>J.slice(2));let q=[],z=3,G=0.4;if(X.forEach((J)=>{if(J.length<=1)return;let Q=q6($,J),Y=Math.max($.length,J.length);if((Y-Q)/Y>G){if(Q<z)z=Q,q=[J];else if(Q===z)q.push(J)}}),q.sort((J,Q)=>J.localeCompare(Q)),Z)q=q.map((J)=>`--${J}`);if(q.length>1)return`
14
+ (Did you mean one of ${q.join(", ")}?)`;if(q.length===1)return`
15
+ (Did you mean ${q[0]}?)`;return""}G6.suggestSimilar=z6});var YX=K((T6)=>{var Q6=Q0("events").EventEmitter,i2=Q0("child_process"),Y0=Q0("path"),w1=Q0("fs"),E=Q0("process"),{Argument:Y6,humanReadableArgName:U6}=T1(),{CommanderError:a2}=_$(),{Help:H6,stripColor:W6}=c2(),{Option:GX,DualOptions:V6}=l2(),{suggestSimilar:JX}=zX();class n2 extends Q6{constructor($){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=$||"",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:(X)=>E.stdout.write(X),writeErr:(X)=>E.stderr.write(X),outputError:(X,Z)=>Z(X),getOutHelpWidth:()=>E.stdout.isTTY?E.stdout.columns:void 0,getErrHelpWidth:()=>E.stderr.isTTY?E.stderr.columns:void 0,getOutHasColors:()=>s2()??(E.stdout.isTTY&&E.stdout.hasColors?.()),getErrHasColors:()=>s2()??(E.stderr.isTTY&&E.stderr.hasColors?.()),stripColor:(X)=>W6(X)},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($){return this._outputConfiguration=$._outputConfiguration,this._helpOption=$._helpOption,this._helpCommand=$._helpCommand,this._helpConfiguration=$._helpConfiguration,this._exitCallback=$._exitCallback,this._storeOptionsAsProperties=$._storeOptionsAsProperties,this._combineFlagAndOptionalValue=$._combineFlagAndOptionalValue,this._allowExcessArguments=$._allowExcessArguments,this._enablePositionalOptions=$._enablePositionalOptions,this._showHelpAfterError=$._showHelpAfterError,this._showSuggestionAfterError=$._showSuggestionAfterError,this}_getCommandAndAncestors(){let $=[];for(let X=this;X;X=X.parent)$.push(X);return $}command($,X,Z){let q=X,z=Z;if(typeof q==="object"&&q!==null)z=q,q=null;z=z||{};let[,G,J]=$.match(/([^ ]+) *(.*)/),Q=this.createCommand(G);if(q)Q.description(q),Q._executableHandler=!0;if(z.isDefault)this._defaultCommandName=Q._name;if(Q._hidden=!!(z.noHelp||z.hidden),Q._executableFile=z.executableFile||null,J)Q.arguments(J);if(this._registerCommand(Q),Q.parent=this,Q.copyInheritedSettings(this),q)return this;return Q}createCommand($){return new n2($)}createHelp(){return Object.assign(new H6,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...$},this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,X){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
16
+ - specify the name in Command constructor or using .name()`);if(X=X||{},X.isDefault)this._defaultCommandName=$._name;if(X.noHelp||X.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,X){return new Y6($,X)}argument($,X,Z,q){let z=this.createArgument($,X);if(typeof Z==="function")z.default(q).argParser(Z);else z.default(Z);return this.addArgument(z),this}arguments($){return $.trim().split(/ +/).forEach((X)=>{this.argument(X)}),this}addArgument($){let X=this.registeredArguments.slice(-1)[0];if(X?.variadic)throw Error(`only the last argument can be variadic '${X.name()}'`);if($.required&&$.defaultValue!==void 0&&$.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${$.name()}'`);return this.registeredArguments.push($),this}helpCommand($,X){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let Z=$??"help [command]",[,q,z]=Z.match(/([^ ]+) *(.*)/),G=X??"display help for command",J=this.createCommand(q);if(J.helpOption(!1),z)J.arguments(z);if(G)J.description(G);if(this._addImplicitHelpCommand=!0,this._helpCommand=J,$||X)this._initCommandGroup(J);return this}addHelpCommand($,X){if(typeof $!=="object")return this.helpCommand($,X),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,this._initCommandGroup($),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook($,X){let Z=["preSubcommand","preAction","postAction"];if(!Z.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
17
+ Expecting one of '${Z.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(X);else this._lifeCycleHooks[$]=[X];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(X)=>{if(X.code!=="commander.executeSubCommandAsync")throw X};return this}_exit($,X,Z){if(this._exitCallback)this._exitCallback(new a2($,X,Z));E.exit($)}action($){let X=(Z)=>{let q=this.registeredArguments.length,z=Z.slice(0,q);if(this._storeOptionsAsProperties)z[q]=this;else z[q]=this.opts();return z.push(this),$.apply(this,z)};return this._actionHandler=X,this}createOption($,X){return new GX($,X)}_callParseArg($,X,Z,q){try{return $.parseArg(X,Z)}catch(z){if(z.code==="commander.invalidArgument"){let G=`${q} ${z.message}`;this.error(G,{exitCode:z.exitCode,code:z.code})}throw z}}_registerOption($){let X=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(X){let Z=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${Z}'
18
+ - already used by option '${X.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let X=(q)=>{return[q.name()].concat(q.aliases())},Z=X($).find((q)=>this._findCommand(q));if(Z){let q=X(this._findCommand(Z)).join("|"),z=X($).join("|");throw Error(`cannot add command '${z}' as already have command '${q}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let X=$.name(),Z=$.attributeName();if($.negate){let z=$.long.replace(/^--no-/,"--");if(!this._findOption(z))this.setOptionValueWithSource(Z,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(Z,$.defaultValue,"default");let q=(z,G,J)=>{if(z==null&&$.presetArg!==void 0)z=$.presetArg;let Q=this.getOptionValue(Z);if(z!==null&&$.parseArg)z=this._callParseArg($,z,Q,G);else if(z!==null&&$.variadic)z=$._collectValue(z,Q);if(z==null)if($.negate)z=!1;else if($.isBoolean()||$.optional)z=!0;else z="";this.setOptionValueWithSource(Z,z,J)};if(this.on("option:"+X,(z)=>{let G=`error: option '${$.flags}' argument '${z}' is invalid.`;q(z,G,"cli")}),$.envVar)this.on("optionEnv:"+X,(z)=>{let G=`error: option '${$.flags}' value '${z}' from env '${$.envVar}' is invalid.`;q(z,G,"env")});return this}_optionEx($,X,Z,q,z){if(typeof X==="object"&&X instanceof GX)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let G=this.createOption(X,Z);if(G.makeOptionMandatory(!!$.mandatory),typeof q==="function")G.default(z).argParser(q);else if(q instanceof RegExp){let J=q;q=(Q,Y)=>{let U=J.exec(Q);return U?U[0]:Y},G.default(z).argParser(q)}else G.default(q);return this.addOption(G)}option($,X,Z,q){return this._optionEx({},$,X,Z,q)}requiredOption($,X,Z,q){return this._optionEx({mandatory:!0},$,X,Z,q)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,X){return this.setOptionValueWithSource($,X,void 0)}setOptionValueWithSource($,X,Z){if(this._storeOptionsAsProperties)this[$]=X;else this._optionValues[$]=X;return this._optionValueSources[$]=Z,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let X;return this._getCommandAndAncestors().forEach((Z)=>{if(Z.getOptionValueSource($)!==void 0)X=Z.getOptionValueSource($)}),X}_prepareUserArgs($,X){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(X=X||{},$===void 0&&X.from===void 0){if(E.versions?.electron)X.from="electron";let q=E.execArgv??[];if(q.includes("-e")||q.includes("--eval")||q.includes("-p")||q.includes("--print"))X.from="eval"}if($===void 0)$=E.argv;this.rawArgs=$.slice();let Z;switch(X.from){case void 0:case"node":this._scriptPath=$[1],Z=$.slice(2);break;case"electron":if(E.defaultApp)this._scriptPath=$[1],Z=$.slice(2);else Z=$.slice(1);break;case"user":Z=$.slice(0);break;case"eval":Z=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${X.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",Z}parse($,X){this._prepareForParse();let Z=this._prepareUserArgs($,X);return this._parseCommand([],Z),this}async parseAsync($,X){this._prepareForParse();let Z=this._prepareUserArgs($,X);return await this._parseCommand([],Z),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
19
+ - 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($,X,Z){if(w1.existsSync($))return;let q=X?`searched for local subcommand relative to directory '${X}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",z=`'${$}' does not exist
20
+ - if '${Z}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
21
21
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
22
- - ${X}`;throw Error(Z)}_executeSubCommand($,q){q=q.slice();let z=!1,X=[".js",".ts",".tsx",".mjs",".cjs"];function Z(U,B){let Y=s.resolve(U,B);if(B$.existsSync(Y))return Y;if(X.includes(s.extname(B)))return;let W=X.find((L)=>B$.existsSync(`${Y}${L}`));if(W)return`${Y}${W}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let H=$._executableFile||`${this._name}-${$._name}`,Q=this._executableDir||"";if(this._scriptPath){let U;try{U=B$.realpathSync(this._scriptPath)}catch{U=this._scriptPath}Q=s.resolve(s.dirname(U),Q)}if(Q){let U=Z(Q,H);if(!U&&!$._executableFile&&this._scriptPath){let B=s.basename(this._scriptPath,s.extname(this._scriptPath));if(B!==this._name)U=Z(Q,`${B}-${$._name}`)}H=U||H}z=X.includes(s.extname(H));let J;if(j.platform!=="win32")if(z)q.unshift(H),q=U2(j.execArgv).concat(q),J=Vq.spawn(j.argv[0],q,{stdio:"inherit"});else J=Vq.spawn(H,q,{stdio:"inherit"});else this._checkForMissingExecutable(H,Q,$._name),q.unshift(H),q=U2(j.execArgv).concat(q),J=Vq.spawn(j.execPath,q,{stdio:"inherit"});if(!J.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((B)=>{j.on(B,()=>{if(J.killed===!1&&J.exitCode===null)J.kill(B)})});let G=this._exitCallback;J.on("close",(U)=>{if(U=U??1,!G)j.exit(U);else G(new _q(U,"commander.executeSubCommandAsync","(close)"))}),J.on("error",(U)=>{if(U.code==="ENOENT")this._checkForMissingExecutable(H,Q,$._name);else if(U.code==="EACCES")throw Error(`'${H}' not executable`);if(!G)j.exit(1);else{let B=new _q(1,"commander.executeSubCommandAsync","(error)");B.nestedError=U,G(B)}}),this.runningCommand=J}_dispatchSubcommand($,q,z){let X=this._findCommand($);if(!X)this.help({error:!0});X._prepareForParse();let Z;return Z=this._chainOrCallSubCommandHook(Z,X,"preSubcommand"),Z=this._chainOrCall(Z,()=>{if(X._executableHandler)this._executeSubCommand(X,q.concat(z));else return X._parseCommand(q,z)}),Z}_dispatchHelpCommand($){if(!$)this.help();let q=this._findCommand($);if(q&&!q._executableHandler)q.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,q)=>{if($.required&&this.args[q]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(z,X,Z)=>{let H=X;if(X!==null&&z.parseArg){let Q=`error: command-argument value '${X}' is invalid for argument '${z.name()}'.`;H=this._callParseArg(z,X,Z,Q)}return H};this._checkNumberOfArguments();let q=[];this.registeredArguments.forEach((z,X)=>{let Z=z.defaultValue;if(z.variadic){if(X<this.args.length){if(Z=this.args.slice(X),z.parseArg)Z=Z.reduce((H,Q)=>{return $(z,Q,H)},z.defaultValue)}else if(Z===void 0)Z=[]}else if(X<this.args.length){if(Z=this.args[X],z.parseArg)Z=$(z,Z,z.defaultValue)}q[X]=Z}),this.processedArgs=q}_chainOrCall($,q){if($?.then&&typeof $.then==="function")return $.then(()=>q());return q()}_chainOrCallHooks($,q){let z=$,X=[];if(this._getCommandAndAncestors().reverse().filter((Z)=>Z._lifeCycleHooks[q]!==void 0).forEach((Z)=>{Z._lifeCycleHooks[q].forEach((H)=>{X.push({hookedCommand:Z,callback:H})})}),q==="postAction")X.reverse();return X.forEach((Z)=>{z=this._chainOrCall(z,()=>{return Z.callback(Z.hookedCommand,this)})}),z}_chainOrCallSubCommandHook($,q,z){let X=$;if(this._lifeCycleHooks[z]!==void 0)this._lifeCycleHooks[z].forEach((Z)=>{X=this._chainOrCall(X,()=>{return Z(this,q)})});return X}_parseCommand($,q){let z=this.parseOptions(q);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(z.operands),q=z.unknown,this.args=$.concat(q),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),q);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(q),this._dispatchSubcommand(this._defaultCommandName,$,q);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(z.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let X=()=>{if(z.unknown.length>0)this.unknownOption(z.unknown[0])},Z=`command:${this.name()}`;if(this._actionHandler){X(),this._processArguments();let H;if(H=this._chainOrCallHooks(H,"preAction"),H=this._chainOrCall(H,()=>this._actionHandler(this.processedArgs)),this.parent)H=this._chainOrCall(H,()=>{this.parent.emit(Z,$,q)});return H=this._chainOrCallHooks(H,"postAction"),H}if(this.parent?.listenerCount(Z))X(),this._processArguments(),this.parent.emit(Z,$,q);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,q);if(this.listenerCount("command:*"))this.emit("command:*",$,q);else if(this.commands.length)this.unknownCommand();else X(),this._processArguments()}else if(this.commands.length)X(),this.help({error:!0});else X(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((q)=>q._name===$||q._aliases.includes($))}_findOption($){return this.options.find((q)=>q.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((q)=>{if(q.mandatory&&$.getOptionValue(q.attributeName())===void 0)$.missingMandatoryOptionValue(q)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((z)=>{let X=z.attributeName();if(this.getOptionValue(X)===void 0)return!1;return this.getOptionValueSource(X)!=="default"});$.filter((z)=>z.conflictsWith.length>0).forEach((z)=>{let X=$.find((Z)=>z.conflictsWith.includes(Z.attributeName()));if(X)this._conflictingOption(z,X)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let q=[],z=[],X=q;function Z(U){return U.length>1&&U[0]==="-"}let H=(U)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(U))return!1;return!this._getCommandAndAncestors().some((B)=>B.options.map((Y)=>Y.short).some((Y)=>/^-\d$/.test(Y)))},Q=null,J=null,G=0;while(G<$.length||J){let U=J??$[G++];if(J=null,U==="--"){if(X===z)X.push(U);X.push(...$.slice(G));break}if(Q&&(!Z(U)||H(U))){this.emit(`option:${Q.name()}`,U);continue}if(Q=null,Z(U)){let B=this._findOption(U);if(B){if(B.required){let Y=$[G++];if(Y===void 0)this.optionMissingArgument(B);this.emit(`option:${B.name()}`,Y)}else if(B.optional){let Y=null;if(G<$.length&&(!Z($[G])||H($[G])))Y=$[G++];this.emit(`option:${B.name()}`,Y)}else this.emit(`option:${B.name()}`);Q=B.variadic?B:null;continue}}if(U.length>2&&U[0]==="-"&&U[1]!=="-"){let B=this._findOption(`-${U[1]}`);if(B){if(B.required||B.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${B.name()}`,U.slice(2));else this.emit(`option:${B.name()}`),J=`-${U.slice(2)}`;continue}}if(/^--[^=]+=/.test(U)){let B=U.indexOf("="),Y=this._findOption(U.slice(0,B));if(Y&&(Y.required||Y.optional)){this.emit(`option:${Y.name()}`,U.slice(B+1));continue}}if(X===q&&Z(U)&&!(this.commands.length===0&&H(U)))X=z;if((this._enablePositionalOptions||this._passThroughOptions)&&q.length===0&&z.length===0){if(this._findCommand(U)){q.push(U),z.push(...$.slice(G));break}else if(this._getHelpCommand()&&U===this._getHelpCommand().name()){q.push(U,...$.slice(G));break}else if(this._defaultCommandName){z.push(U,...$.slice(G));break}}if(this._passThroughOptions){X.push(U,...$.slice(G));break}X.push(U)}return{operands:q,unknown:z}}opts(){if(this._storeOptionsAsProperties){let $={},q=this.options.length;for(let z=0;z<q;z++){let X=this.options[z].attributeName();$[X]=X===this._versionOptionName?this._version:this[X]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,q)=>Object.assign($,q.opts()),{})}error($,q){if(this._outputConfiguration.outputError(`${$}
22
+ - ${q}`;throw Error(z)}_executeSubCommand($,X){X=X.slice();let Z=!1,q=[".js",".ts",".tsx",".mjs",".cjs"];function z(U,W){let H=Y0.resolve(U,W);if(w1.existsSync(H))return H;if(q.includes(Y0.extname(W)))return;let V=q.find((w)=>w1.existsSync(`${H}${w}`));if(V)return`${H}${V}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let G=$._executableFile||`${this._name}-${$._name}`,J=this._executableDir||"";if(this._scriptPath){let U;try{U=w1.realpathSync(this._scriptPath)}catch{U=this._scriptPath}J=Y0.resolve(Y0.dirname(U),J)}if(J){let U=z(J,G);if(!U&&!$._executableFile&&this._scriptPath){let W=Y0.basename(this._scriptPath,Y0.extname(this._scriptPath));if(W!==this._name)U=z(J,`${W}-${$._name}`)}G=U||G}Z=q.includes(Y0.extname(G));let Q;if(E.platform!=="win32")if(Z)X.unshift(G),X=QX(E.execArgv).concat(X),Q=i2.spawn(E.argv[0],X,{stdio:"inherit"});else Q=i2.spawn(G,X,{stdio:"inherit"});else this._checkForMissingExecutable(G,J,$._name),X.unshift(G),X=QX(E.execArgv).concat(X),Q=i2.spawn(E.execPath,X,{stdio:"inherit"});if(!Q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((W)=>{E.on(W,()=>{if(Q.killed===!1&&Q.exitCode===null)Q.kill(W)})});let Y=this._exitCallback;Q.on("close",(U)=>{if(U=U??1,!Y)E.exit(U);else Y(new a2(U,"commander.executeSubCommandAsync","(close)"))}),Q.on("error",(U)=>{if(U.code==="ENOENT")this._checkForMissingExecutable(G,J,$._name);else if(U.code==="EACCES")throw Error(`'${G}' not executable`);if(!Y)E.exit(1);else{let W=new a2(1,"commander.executeSubCommandAsync","(error)");W.nestedError=U,Y(W)}}),this.runningCommand=Q}_dispatchSubcommand($,X,Z){let q=this._findCommand($);if(!q)this.help({error:!0});q._prepareForParse();let z;return z=this._chainOrCallSubCommandHook(z,q,"preSubcommand"),z=this._chainOrCall(z,()=>{if(q._executableHandler)this._executeSubCommand(q,X.concat(Z));else return q._parseCommand(X,Z)}),z}_dispatchHelpCommand($){if(!$)this.help();let X=this._findCommand($);if(X&&!X._executableHandler)X.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,X)=>{if($.required&&this.args[X]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(Z,q,z)=>{let G=q;if(q!==null&&Z.parseArg){let J=`error: command-argument value '${q}' is invalid for argument '${Z.name()}'.`;G=this._callParseArg(Z,q,z,J)}return G};this._checkNumberOfArguments();let X=[];this.registeredArguments.forEach((Z,q)=>{let z=Z.defaultValue;if(Z.variadic){if(q<this.args.length){if(z=this.args.slice(q),Z.parseArg)z=z.reduce((G,J)=>{return $(Z,J,G)},Z.defaultValue)}else if(z===void 0)z=[]}else if(q<this.args.length){if(z=this.args[q],Z.parseArg)z=$(Z,z,Z.defaultValue)}X[q]=z}),this.processedArgs=X}_chainOrCall($,X){if($?.then&&typeof $.then==="function")return $.then(()=>X());return X()}_chainOrCallHooks($,X){let Z=$,q=[];if(this._getCommandAndAncestors().reverse().filter((z)=>z._lifeCycleHooks[X]!==void 0).forEach((z)=>{z._lifeCycleHooks[X].forEach((G)=>{q.push({hookedCommand:z,callback:G})})}),X==="postAction")q.reverse();return q.forEach((z)=>{Z=this._chainOrCall(Z,()=>{return z.callback(z.hookedCommand,this)})}),Z}_chainOrCallSubCommandHook($,X,Z){let q=$;if(this._lifeCycleHooks[Z]!==void 0)this._lifeCycleHooks[Z].forEach((z)=>{q=this._chainOrCall(q,()=>{return z(this,X)})});return q}_parseCommand($,X){let Z=this.parseOptions(X);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(Z.operands),X=Z.unknown,this.args=$.concat(X),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),X);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(X),this._dispatchSubcommand(this._defaultCommandName,$,X);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(Z.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let q=()=>{if(Z.unknown.length>0)this.unknownOption(Z.unknown[0])},z=`command:${this.name()}`;if(this._actionHandler){q(),this._processArguments();let G;if(G=this._chainOrCallHooks(G,"preAction"),G=this._chainOrCall(G,()=>this._actionHandler(this.processedArgs)),this.parent)G=this._chainOrCall(G,()=>{this.parent.emit(z,$,X)});return G=this._chainOrCallHooks(G,"postAction"),G}if(this.parent?.listenerCount(z))q(),this._processArguments(),this.parent.emit(z,$,X);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,X);if(this.listenerCount("command:*"))this.emit("command:*",$,X);else if(this.commands.length)this.unknownCommand();else q(),this._processArguments()}else if(this.commands.length)q(),this.help({error:!0});else q(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((X)=>X._name===$||X._aliases.includes($))}_findOption($){return this.options.find((X)=>X.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((X)=>{if(X.mandatory&&$.getOptionValue(X.attributeName())===void 0)$.missingMandatoryOptionValue(X)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((Z)=>{let q=Z.attributeName();if(this.getOptionValue(q)===void 0)return!1;return this.getOptionValueSource(q)!=="default"});$.filter((Z)=>Z.conflictsWith.length>0).forEach((Z)=>{let q=$.find((z)=>Z.conflictsWith.includes(z.attributeName()));if(q)this._conflictingOption(Z,q)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let X=[],Z=[],q=X;function z(U){return U.length>1&&U[0]==="-"}let G=(U)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(U))return!1;return!this._getCommandAndAncestors().some((W)=>W.options.map((H)=>H.short).some((H)=>/^-\d$/.test(H)))},J=null,Q=null,Y=0;while(Y<$.length||Q){let U=Q??$[Y++];if(Q=null,U==="--"){if(q===Z)q.push(U);q.push(...$.slice(Y));break}if(J&&(!z(U)||G(U))){this.emit(`option:${J.name()}`,U);continue}if(J=null,z(U)){let W=this._findOption(U);if(W){if(W.required){let H=$[Y++];if(H===void 0)this.optionMissingArgument(W);this.emit(`option:${W.name()}`,H)}else if(W.optional){let H=null;if(Y<$.length&&(!z($[Y])||G($[Y])))H=$[Y++];this.emit(`option:${W.name()}`,H)}else this.emit(`option:${W.name()}`);J=W.variadic?W:null;continue}}if(U.length>2&&U[0]==="-"&&U[1]!=="-"){let W=this._findOption(`-${U[1]}`);if(W){if(W.required||W.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${W.name()}`,U.slice(2));else this.emit(`option:${W.name()}`),Q=`-${U.slice(2)}`;continue}}if(/^--[^=]+=/.test(U)){let W=U.indexOf("="),H=this._findOption(U.slice(0,W));if(H&&(H.required||H.optional)){this.emit(`option:${H.name()}`,U.slice(W+1));continue}}if(q===X&&z(U)&&!(this.commands.length===0&&G(U)))q=Z;if((this._enablePositionalOptions||this._passThroughOptions)&&X.length===0&&Z.length===0){if(this._findCommand(U)){X.push(U),Z.push(...$.slice(Y));break}else if(this._getHelpCommand()&&U===this._getHelpCommand().name()){X.push(U,...$.slice(Y));break}else if(this._defaultCommandName){Z.push(U,...$.slice(Y));break}}if(this._passThroughOptions){q.push(U,...$.slice(Y));break}q.push(U)}return{operands:X,unknown:Z}}opts(){if(this._storeOptionsAsProperties){let $={},X=this.options.length;for(let Z=0;Z<X;Z++){let q=this.options[Z].attributeName();$[q]=q===this._versionOptionName?this._version:this[q]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,X)=>Object.assign($,X.opts()),{})}error($,X){if(this._outputConfiguration.outputError(`${$}
23
23
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
24
24
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
25
- `),this.outputHelp({error:!0});let z=q||{},X=z.exitCode||1,Z=z.code||"commander.error";this._exit(X,Z,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in j.env){let q=$.attributeName();if(this.getOptionValue(q)===void 0||["default","config","env"].includes(this.getOptionValueSource(q)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,j.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new k5(this.options),q=(z)=>{return this.getOptionValue(z)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(z))};this.options.filter((z)=>z.implied!==void 0&&q(z.attributeName())&&$.valueFromOption(this.getOptionValue(z.attributeName()),z)).forEach((z)=>{Object.keys(z.implied).filter((X)=>!q(X)).forEach((X)=>{this.setOptionValueWithSource(X,z.implied[X],"implied")})})}missingArgument($){let q=`error: missing required argument '${$}'`;this.error(q,{code:"commander.missingArgument"})}optionMissingArgument($){let q=`error: option '${$.flags}' argument missing`;this.error(q,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let q=`error: required option '${$.flags}' not specified`;this.error(q,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,q){let z=(H)=>{let Q=H.attributeName(),J=this.getOptionValue(Q),G=this.options.find((B)=>B.negate&&Q===B.attributeName()),U=this.options.find((B)=>!B.negate&&Q===B.attributeName());if(G&&(G.presetArg===void 0&&J===!1||G.presetArg!==void 0&&J===G.presetArg))return G;return U||H},X=(H)=>{let Q=z(H),J=Q.attributeName();if(this.getOptionValueSource(J)==="env")return`environment variable '${Q.envVar}'`;return`option '${Q.flags}'`},Z=`error: ${X($)} cannot be used with ${X(q)}`;this.error(Z,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let q="";if($.startsWith("--")&&this._showSuggestionAfterError){let X=[],Z=this;do{let H=Z.createHelp().visibleOptions(Z).filter((Q)=>Q.long).map((Q)=>Q.long);X=X.concat(H),Z=Z.parent}while(Z&&!Z._enablePositionalOptions);q=J2($,X)}let z=`error: unknown option '${$}'${q}`;this.error(z,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let q=this.registeredArguments.length,z=q===1?"":"s",Z=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${q} argument${z} but got ${$.length}.`;this.error(Z,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],q="";if(this._showSuggestionAfterError){let X=[];this.createHelp().visibleCommands(this).forEach((Z)=>{if(X.push(Z.name()),Z.alias())X.push(Z.alias())}),q=J2($,X)}let z=`error: unknown command '${$}'${q}`;this.error(z,{code:"commander.unknownCommand"})}version($,q,z){if($===void 0)return this._version;this._version=$,q=q||"-V, --version",z=z||"output the version number";let X=this.createOption(q,z);return this._versionOptionName=X.attributeName(),this._registerOption(X),this.on("option:"+X.name(),()=>{this._outputConfiguration.writeOut(`${$}
26
- `),this._exit(0,"commander.version",$)}),this}description($,q){if($===void 0&&q===void 0)return this._description;if(this._description=$,q)this._argsDescription=q;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let q=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)q=this.commands[this.commands.length-1];if($===q._name)throw Error("Command alias can't be the same as its name");let z=this.parent?._findCommand($);if(z){let X=[z.name()].concat(z.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${X}'`)}return q._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((q)=>this.alias(q)),this}usage($){if($===void 0){if(this._usage)return this._usage;let q=this.registeredArguments.map((z)=>{return C5(z)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?q:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=s.basename($,s.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let q=this.createHelp(),z=this._getOutputContext($);q.prepareContext({error:z.error,helpWidth:z.helpWidth,outputHasColors:z.hasColors});let X=q.formatHelp(this,q);if(z.hasColors)return X;return this._outputConfiguration.stripColor(X)}_getOutputContext($){$=$||{};let q=!!$.error,z,X,Z;if(q)z=(Q)=>this._outputConfiguration.writeErr(Q),X=this._outputConfiguration.getErrHasColors(),Z=this._outputConfiguration.getErrHelpWidth();else z=(Q)=>this._outputConfiguration.writeOut(Q),X=this._outputConfiguration.getOutHasColors(),Z=this._outputConfiguration.getOutHelpWidth();return{error:q,write:(Q)=>{if(!X)Q=this._outputConfiguration.stripColor(Q);return z(Q)},hasColors:X,helpWidth:Z}}outputHelp($){let q;if(typeof $==="function")q=$,$=void 0;let z=this._getOutputContext($),X={error:z.error,write:z.write,command:this};this._getCommandAndAncestors().reverse().forEach((H)=>H.emit("beforeAllHelp",X)),this.emit("beforeHelp",X);let Z=this.helpInformation({error:z.error});if(q){if(Z=q(Z),typeof Z!=="string"&&!Buffer.isBuffer(Z))throw Error("outputHelp callback must return a string or a Buffer")}if(z.write(Z),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",X),this._getCommandAndAncestors().forEach((H)=>H.emit("afterAllHelp",X))}helpOption($,q){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",q??"display help for command"),$||q)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let q=Number(j.exitCode??0);if(q===0&&$&&typeof $!=="function"&&$.error)q=1;this._exit(q,"commander.help","(outputHelp)")}addHelpText($,q){let z=["beforeAll","before","after","afterAll"];if(!z.includes($))throw Error(`Unexpected value for position to addHelpText.
27
- Expecting one of '${z.join("', '")}'`);let X=`${$}Help`;return this.on(X,(Z)=>{let H;if(typeof q==="function")H=q({error:Z.error,command:Z.command});else H=q;if(H)Z.write(`${H}
28
- `)}),this}_outputHelpIfRequested($){let q=this._getHelpOption();if(q&&$.find((X)=>q.is(X)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function U2($){return $.map((q)=>{if(!q.startsWith("--inspect"))return q;let z,X="127.0.0.1",Z="9229",H;if((H=q.match(/^(--inspect(-brk)?)$/))!==null)z=H[1];else if((H=q.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(z=H[1],/^\d+$/.test(H[3]))Z=H[3];else X=H[3];else if((H=q.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)z=H[1],X=H[3],Z=H[4];if(z&&Z!=="0")return`${z}=${X}:${parseInt(Z)+1}`;return q})}function Iq(){if(j.env.NO_COLOR||j.env.FORCE_COLOR==="0"||j.env.FORCE_COLOR==="false")return!1;if(j.env.FORCE_COLOR||j.env.CLICOLOR_FORCE!==void 0)return!0;return}x5.Command=Dq;x5.useColor=Iq});var T2=I((m5)=>{var{Argument:Y2}=Y$(),{Command:Rq}=G2(),{CommanderError:v5,InvalidArgumentError:B2}=f0(),{Help:u5}=Tq(),{Option:W2}=Lq();m5.program=new Rq;m5.createCommand=($)=>new Rq($);m5.createOption=($,q)=>new W2($,q);m5.createArgument=($,q)=>new Y2($,q);m5.Command=Rq;m5.Option=W2;m5.Argument=Y2;m5.Help=u5;m5.CommanderError=v5;m5.InvalidArgumentError=B2;m5.InvalidOptionArgumentError=B2});var A=I((Jz)=>{var Kq=Symbol.for("yaml.alias"),_2=Symbol.for("yaml.document"),W$=Symbol.for("yaml.map"),I2=Symbol.for("yaml.pair"),Oq=Symbol.for("yaml.scalar"),T$=Symbol.for("yaml.seq"),r=Symbol.for("yaml.node.type"),$z=($)=>!!$&&typeof $==="object"&&$[r]===Kq,qz=($)=>!!$&&typeof $==="object"&&$[r]===_2,zz=($)=>!!$&&typeof $==="object"&&$[r]===W$,Xz=($)=>!!$&&typeof $==="object"&&$[r]===I2,D2=($)=>!!$&&typeof $==="object"&&$[r]===Oq,Zz=($)=>!!$&&typeof $==="object"&&$[r]===T$;function R2($){if($&&typeof $==="object")switch($[r]){case W$:case T$:return!0}return!1}function Hz($){if($&&typeof $==="object")switch($[r]){case Kq:case W$:case Oq:case T$:return!0}return!1}var Qz=($)=>(D2($)||R2($))&&!!$.anchor;Jz.ALIAS=Kq;Jz.DOC=_2;Jz.MAP=W$;Jz.NODE_TYPE=r;Jz.PAIR=I2;Jz.SCALAR=Oq;Jz.SEQ=T$;Jz.hasAnchor=Qz;Jz.isAlias=$z;Jz.isCollection=R2;Jz.isDocument=qz;Jz.isMap=zz;Jz.isNode=Hz;Jz.isPair=Xz;Jz.isScalar=D2;Jz.isSeq=Zz});var k0=I((Oz)=>{var f=A(),k=Symbol("break visit"),M2=Symbol("skip children"),c=Symbol("remove node");function L$($,q){let z=w2(q);if(f.isDocument($)){if(I0(null,$.contents,z,Object.freeze([$]))===c)$.contents=null}else I0(null,$,z,Object.freeze([]))}L$.BREAK=k;L$.SKIP=M2;L$.REMOVE=c;function I0($,q,z,X){let Z=P2($,q,z,X);if(f.isNode(Z)||f.isPair(Z))return K2($,X,Z),I0($,Z,z,X);if(typeof Z!=="symbol"){if(f.isCollection(q)){X=Object.freeze(X.concat(q));for(let H=0;H<q.items.length;++H){let Q=I0(H,q.items[H],z,X);if(typeof Q==="number")H=Q-1;else if(Q===k)return k;else if(Q===c)q.items.splice(H,1),H-=1}}else if(f.isPair(q)){X=Object.freeze(X.concat(q));let H=I0("key",q.key,z,X);if(H===k)return k;else if(H===c)q.key=null;let Q=I0("value",q.value,z,X);if(Q===k)return k;else if(Q===c)q.value=null}}return Z}async function V$($,q){let z=w2(q);if(f.isDocument($)){if(await D0(null,$.contents,z,Object.freeze([$]))===c)$.contents=null}else await D0(null,$,z,Object.freeze([]))}V$.BREAK=k;V$.SKIP=M2;V$.REMOVE=c;async function D0($,q,z,X){let Z=await P2($,q,z,X);if(f.isNode(Z)||f.isPair(Z))return K2($,X,Z),D0($,Z,z,X);if(typeof Z!=="symbol"){if(f.isCollection(q)){X=Object.freeze(X.concat(q));for(let H=0;H<q.items.length;++H){let Q=await D0(H,q.items[H],z,X);if(typeof Q==="number")H=Q-1;else if(Q===k)return k;else if(Q===c)q.items.splice(H,1),H-=1}}else if(f.isPair(q)){X=Object.freeze(X.concat(q));let H=await D0("key",q.key,z,X);if(H===k)return k;else if(H===c)q.key=null;let Q=await D0("value",q.value,z,X);if(Q===k)return k;else if(Q===c)q.value=null}}return Z}function w2($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function P2($,q,z,X){if(typeof z==="function")return z($,q,X);if(f.isMap(q))return z.Map?.($,q,X);if(f.isSeq(q))return z.Seq?.($,q,X);if(f.isPair(q))return z.Pair?.($,q,X);if(f.isScalar(q))return z.Scalar?.($,q,X);if(f.isAlias(q))return z.Alias?.($,q,X);return}function K2($,q,z){let X=q[q.length-1];if(f.isCollection(X))X.items[$]=z;else if(f.isPair(X))if($==="key")X.key=z;else X.value=z;else if(f.isDocument(X))X.contents=z;else{let Z=f.isAlias(X)?"alias":"scalar";throw Error(`Cannot replace node with ${Z} parent`)}}Oz.visit=L$;Oz.visitAsync=V$});var Fq=I((Ez)=>{var O2=A(),jz=k0(),Sz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Nz=($)=>$.replace(/[!,[\]{}]/g,(q)=>Sz[q]);class h{constructor($,q){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},h.defaultYaml,$),this.tags=Object.assign({},h.defaultTags,q)}clone(){let $=new h(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new h(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:h.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},h.defaultTags);break}return $}add($,q){if(this.atNextDocument)this.yaml={explicit:h.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},h.defaultTags),this.atNextDocument=!1;let z=$.trim().split(/[ \t]+/),X=z.shift();switch(X){case"%TAG":{if(z.length!==2){if(q(0,"%TAG directive should contain exactly two parts"),z.length<2)return!1}let[Z,H]=z;return this.tags[Z]=H,!0}case"%YAML":{if(this.yaml.explicit=!0,z.length!==1)return q(0,"%YAML directive should contain exactly one part"),!1;let[Z]=z;if(Z==="1.1"||Z==="1.2")return this.yaml.version=Z,!0;else{let H=/^\d+\.\d+$/.test(Z);return q(6,`Unsupported YAML version ${Z}`,H),!1}}default:return q(0,`Unknown directive ${X}`,!0),!1}}tagName($,q){if($==="!")return"!";if($[0]!=="!")return q(`Not a valid tag: ${$}`),null;if($[1]==="<"){let H=$.slice(2,-1);if(H==="!"||H==="!!")return q(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")q("Verbatim tags must end with a >");return H}let[,z,X]=$.match(/^(.*!)([^!]*)$/s);if(!X)q(`The ${$} tag has no suffix`);let Z=this.tags[z];if(Z)try{return Z+decodeURIComponent(X)}catch(H){return q(String(H)),null}if(z==="!")return $;return q(`Could not resolve tag: ${$}`),null}tagString($){for(let[q,z]of Object.entries(this.tags))if($.startsWith(z))return q+Nz($.substring(z.length));return $[0]==="!"?$:`!<${$}>`}toString($){let q=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],z=Object.entries(this.tags),X;if($&&z.length>0&&O2.isNode($.contents)){let Z={};jz.visit($.contents,(H,Q)=>{if(O2.isNode(Q)&&Q.tag)Z[Q.tag]=!0}),X=Object.keys(Z)}else X=[];for(let[Z,H]of z){if(Z==="!!"&&H==="tag:yaml.org,2002:")continue;if(!$||X.some((Q)=>Q.startsWith(H)))q.push(`%TAG ${Z} ${H}`)}return q.join(`
29
- `)}}h.defaultYaml={explicit:!1,version:"1.2"};h.defaultTags={"!!":"tag:yaml.org,2002:"};Ez.Directives=h});var _$=I((kz)=>{var F2=A(),Cz=k0();function yz($){if(/[\x00-\x19\s,[\]{}]/.test($)){let z=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(z)}return!0}function A2($){let q=new Set;return Cz.visit($,{Value(z,X){if(X.anchor)q.add(X.anchor)}}),q}function j2($,q){for(let z=1;;++z){let X=`${$}${z}`;if(!q.has(X))return X}}function fz($,q){let z=[],X=new Map,Z=null;return{onAnchor:(H)=>{z.push(H),Z??(Z=A2($));let Q=j2(q,Z);return Z.add(Q),Q},setAnchors:()=>{for(let H of z){let Q=X.get(H);if(typeof Q==="object"&&Q.anchor&&(F2.isScalar(Q.node)||F2.isCollection(Q.node)))Q.node.anchor=Q.anchor;else{let J=Error("Failed to resolve repeated object (this should not happen)");throw J.source=H,J}}},sourceObjects:X}}kz.anchorIsValid=yz;kz.anchorNames=A2;kz.createNodeAnchors=fz;kz.findNewAnchor=j2});var Aq=I((uz)=>{function x0($,q,z,X){if(X&&typeof X==="object")if(Array.isArray(X))for(let Z=0,H=X.length;Z<H;++Z){let Q=X[Z],J=x0($,X,String(Z),Q);if(J===void 0)delete X[Z];else if(J!==Q)X[Z]=J}else if(X instanceof Map)for(let Z of Array.from(X.keys())){let H=X.get(Z),Q=x0($,X,Z,H);if(Q===void 0)X.delete(Z);else if(Q!==H)X.set(Z,Q)}else if(X instanceof Set)for(let Z of Array.from(X)){let H=x0($,X,Z,Z);if(H===void 0)X.delete(Z);else if(H!==Z)X.delete(Z),X.add(H)}else for(let[Z,H]of Object.entries(X)){let Q=x0($,X,Z,H);if(Q===void 0)delete X[Z];else if(Q!==H)X[Z]=Q}return $.call(q,z,X)}uz.applyReviver=x0});var o=I((pz)=>{var dz=A();function S2($,q,z){if(Array.isArray($))return $.map((X,Z)=>S2(X,String(Z),z));if($&&typeof $.toJSON==="function"){if(!z||!dz.hasAnchor($))return $.toJSON(q,z);let X={aliasCount:0,count:1,res:void 0};z.anchors.set($,X),z.onCreate=(H)=>{X.res=H,delete z.onCreate};let Z=$.toJSON(q,z);if(z.onCreate)z.onCreate(Z);return Z}if(typeof $==="bigint"&&!z?.keep)return Number($);return $}pz.toJS=S2});var I$=I((az)=>{var cz=Aq(),N2=A(),iz=o();class E2{constructor($){Object.defineProperty(this,N2.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:q,maxAliasCount:z,onAnchor:X,reviver:Z}={}){if(!N2.isDocument($))throw TypeError("A document argument is required");let H={anchors:new Map,doc:$,keep:!0,mapAsMap:q===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},Q=iz.toJS(this,"",H);if(typeof X==="function")for(let{count:J,res:G}of H.anchors.values())X(G,J);return typeof Z==="function"?cz.applyReviver(Z,{"":Q},"",Q):Q}}az.NodeBase=E2});var h0=I((ez)=>{var rz=_$(),nz=k0(),R0=A(),oz=I$(),tz=o();class b2 extends oz.NodeBase{constructor($){super(R0.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,q){let z;if(q?.aliasResolveCache)z=q.aliasResolveCache;else if(z=[],nz.visit($,{Node:(Z,H)=>{if(R0.isAlias(H)||R0.hasAnchor(H))z.push(H)}}),q)q.aliasResolveCache=z;let X=void 0;for(let Z of z){if(Z===this)break;if(Z.anchor===this.source)X=Z}return X}toJSON($,q){if(!q)return{source:this.source};let{anchors:z,doc:X,maxAliasCount:Z}=q,H=this.resolve(X,q);if(!H){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(J)}let Q=z.get(H);if(!Q)tz.toJS(H,null,q),Q=z.get(H);if(Q?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(Z>=0){if(Q.count+=1,Q.aliasCount===0)Q.aliasCount=D$(X,H,z);if(Q.count*Q.aliasCount>Z)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return Q.res}toString($,q,z){let X=`*${this.source}`;if($){if(rz.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let Z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(Z)}if($.implicitKey)return`${X} `}return X}}function D$($,q,z){if(R0.isAlias(q)){let X=q.resolve($),Z=z&&X&&z.get(X);return Z?Z.count*Z.aliasCount:0}else if(R0.isCollection(q)){let X=0;for(let Z of q.items){let H=D$($,Z,z);if(H>X)X=H}return X}else if(R0.isPair(q)){let X=D$($,q.key,z),Z=D$($,q.value,z);return Math.max(X,Z)}return 1}ez.Alias=b2});var y=I((HX)=>{var qX=A(),zX=I$(),XX=o(),ZX=($)=>!$||typeof $!=="function"&&typeof $!=="object";class Q0 extends zX.NodeBase{constructor($){super(qX.SCALAR);this.value=$}toJSON($,q){return q?.keep?this.value:XX.toJS(this.value,$,q)}toString(){return String(this.value)}}Q0.BLOCK_FOLDED="BLOCK_FOLDED";Q0.BLOCK_LITERAL="BLOCK_LITERAL";Q0.PLAIN="PLAIN";Q0.QUOTE_DOUBLE="QUOTE_DOUBLE";Q0.QUOTE_SINGLE="QUOTE_SINGLE";HX.Scalar=Q0;HX.isScalarValue=ZX});var g0=I((WX)=>{var UX=h0(),J0=A(),C2=y(),GX="tag:yaml.org,2002:";function YX($,q,z){if(q){let X=z.filter((H)=>H.tag===q),Z=X.find((H)=>!H.format)??X[0];if(!Z)throw Error(`Tag ${q} not found`);return Z}return z.find((X)=>X.identify?.($)&&!X.format)}function BX($,q,z){if(J0.isDocument($))$=$.contents;if(J0.isNode($))return $;if(J0.isPair($)){let Y=z.schema[J0.MAP].createNode?.(z.schema,null,z);return Y.items.push($),Y}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:X,onAnchor:Z,onTagObj:H,schema:Q,sourceObjects:J}=z,G=void 0;if(X&&$&&typeof $==="object")if(G=J.get($),G)return G.anchor??(G.anchor=Z($)),new UX.Alias(G.anchor);else G={anchor:null,node:null},J.set($,G);if(q?.startsWith("!!"))q=GX+q.slice(2);let U=YX($,q,Q.tags);if(!U){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let Y=new C2.Scalar($);if(G)G.node=Y;return Y}U=$ instanceof Map?Q[J0.MAP]:(Symbol.iterator in Object($))?Q[J0.SEQ]:Q[J0.MAP]}if(H)H(U),delete z.onTagObj;let B=U?.createNode?U.createNode(z.schema,$,z):typeof U?.nodeClass?.from==="function"?U.nodeClass.from(z.schema,$,z):new C2.Scalar($);if(q)B.tag=q;else if(!U.default)B.tag=U.tag;if(G)G.node=B;return B}WX.createNode=BX});var R$=I((_X)=>{var LX=g0(),i=A(),VX=I$();function jq($,q,z){let X=z;for(let Z=q.length-1;Z>=0;--Z){let H=q[Z];if(typeof H==="number"&&Number.isInteger(H)&&H>=0){let Q=[];Q[H]=X,X=Q}else X=new Map([[H,X]])}return LX.createNode(X,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var y2=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class f2 extends VX.NodeBase{constructor($,q){super($);Object.defineProperty(this,"schema",{value:q,configurable:!0,enumerable:!1,writable:!0})}clone($){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)q.schema=$;if(q.items=q.items.map((z)=>i.isNode(z)||i.isPair(z)?z.clone($):z),this.range)q.range=this.range.slice();return q}addIn($,q){if(y2($))this.add(q);else{let[z,...X]=$,Z=this.get(z,!0);if(i.isCollection(Z))Z.addIn(X,q);else if(Z===void 0&&this.schema)this.set(z,jq(this.schema,X,q));else throw Error(`Expected YAML collection at ${z}. Remaining path: ${X}`)}}deleteIn($){let[q,...z]=$;if(z.length===0)return this.delete(q);let X=this.get(q,!0);if(i.isCollection(X))return X.deleteIn(z);else throw Error(`Expected YAML collection at ${q}. Remaining path: ${z}`)}getIn($,q){let[z,...X]=$,Z=this.get(z,!0);if(X.length===0)return!q&&i.isScalar(Z)?Z.value:Z;else return i.isCollection(Z)?Z.getIn(X,q):void 0}hasAllNullValues($){return this.items.every((q)=>{if(!i.isPair(q))return!1;let z=q.value;return z==null||$&&i.isScalar(z)&&z.value==null&&!z.commentBefore&&!z.comment&&!z.tag})}hasIn($){let[q,...z]=$;if(z.length===0)return this.has(q);let X=this.get(q,!0);return i.isCollection(X)?X.hasIn(z):!1}setIn($,q){let[z,...X]=$;if(X.length===0)this.set(z,q);else{let Z=this.get(z,!0);if(i.isCollection(Z))Z.setIn(X,q);else if(Z===void 0&&this.schema)this.set(z,jq(this.schema,X,q));else throw Error(`Expected YAML collection at ${z}. Remaining path: ${X}`)}}}_X.Collection=f2;_X.collectionFromPath=jq;_X.isEmptyPath=y2});var v0=I((PX)=>{var MX=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function Sq($,q){if(/^\n+$/.test($))return $.substring(1);return q?$.replace(/^(?! *$)/gm,q):$}var wX=($,q,z)=>$.endsWith(`
30
- `)?Sq(z,q):z.includes(`
25
+ `),this.outputHelp({error:!0});let Z=X||{},q=Z.exitCode||1,z=Z.code||"commander.error";this._exit(q,z,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in E.env){let X=$.attributeName();if(this.getOptionValue(X)===void 0||["default","config","env"].includes(this.getOptionValueSource(X)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,E.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new V6(this.options),X=(Z)=>{return this.getOptionValue(Z)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(Z))};this.options.filter((Z)=>Z.implied!==void 0&&X(Z.attributeName())&&$.valueFromOption(this.getOptionValue(Z.attributeName()),Z)).forEach((Z)=>{Object.keys(Z.implied).filter((q)=>!X(q)).forEach((q)=>{this.setOptionValueWithSource(q,Z.implied[q],"implied")})})}missingArgument($){let X=`error: missing required argument '${$}'`;this.error(X,{code:"commander.missingArgument"})}optionMissingArgument($){let X=`error: option '${$.flags}' argument missing`;this.error(X,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let X=`error: required option '${$.flags}' not specified`;this.error(X,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,X){let Z=(G)=>{let J=G.attributeName(),Q=this.getOptionValue(J),Y=this.options.find((W)=>W.negate&&J===W.attributeName()),U=this.options.find((W)=>!W.negate&&J===W.attributeName());if(Y&&(Y.presetArg===void 0&&Q===!1||Y.presetArg!==void 0&&Q===Y.presetArg))return Y;return U||G},q=(G)=>{let J=Z(G),Q=J.attributeName();if(this.getOptionValueSource(Q)==="env")return`environment variable '${J.envVar}'`;return`option '${J.flags}'`},z=`error: ${q($)} cannot be used with ${q(X)}`;this.error(z,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let X="";if($.startsWith("--")&&this._showSuggestionAfterError){let q=[],z=this;do{let G=z.createHelp().visibleOptions(z).filter((J)=>J.long).map((J)=>J.long);q=q.concat(G),z=z.parent}while(z&&!z._enablePositionalOptions);X=JX($,q)}let Z=`error: unknown option '${$}'${X}`;this.error(Z,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let X=this.registeredArguments.length,Z=X===1?"":"s",z=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${X} argument${Z} but got ${$.length}.`;this.error(z,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],X="";if(this._showSuggestionAfterError){let q=[];this.createHelp().visibleCommands(this).forEach((z)=>{if(q.push(z.name()),z.alias())q.push(z.alias())}),X=JX($,q)}let Z=`error: unknown command '${$}'${X}`;this.error(Z,{code:"commander.unknownCommand"})}version($,X,Z){if($===void 0)return this._version;this._version=$,X=X||"-V, --version",Z=Z||"output the version number";let q=this.createOption(X,Z);return this._versionOptionName=q.attributeName(),this._registerOption(q),this.on("option:"+q.name(),()=>{this._outputConfiguration.writeOut(`${$}
26
+ `),this._exit(0,"commander.version",$)}),this}description($,X){if($===void 0&&X===void 0)return this._description;if(this._description=$,X)this._argsDescription=X;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let X=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)X=this.commands[this.commands.length-1];if($===X._name)throw Error("Command alias can't be the same as its name");let Z=this.parent?._findCommand($);if(Z){let q=[Z.name()].concat(Z.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${q}'`)}return X._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((X)=>this.alias(X)),this}usage($){if($===void 0){if(this._usage)return this._usage;let X=this.registeredArguments.map((Z)=>{return U6(Z)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?X:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=Y0.basename($,Y0.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let X=this.createHelp(),Z=this._getOutputContext($);X.prepareContext({error:Z.error,helpWidth:Z.helpWidth,outputHasColors:Z.hasColors});let q=X.formatHelp(this,X);if(Z.hasColors)return q;return this._outputConfiguration.stripColor(q)}_getOutputContext($){$=$||{};let X=!!$.error,Z,q,z;if(X)Z=(J)=>this._outputConfiguration.writeErr(J),q=this._outputConfiguration.getErrHasColors(),z=this._outputConfiguration.getErrHelpWidth();else Z=(J)=>this._outputConfiguration.writeOut(J),q=this._outputConfiguration.getOutHasColors(),z=this._outputConfiguration.getOutHelpWidth();return{error:X,write:(J)=>{if(!q)J=this._outputConfiguration.stripColor(J);return Z(J)},hasColors:q,helpWidth:z}}outputHelp($){let X;if(typeof $==="function")X=$,$=void 0;let Z=this._getOutputContext($),q={error:Z.error,write:Z.write,command:this};this._getCommandAndAncestors().reverse().forEach((G)=>G.emit("beforeAllHelp",q)),this.emit("beforeHelp",q);let z=this.helpInformation({error:Z.error});if(X){if(z=X(z),typeof z!=="string"&&!Buffer.isBuffer(z))throw Error("outputHelp callback must return a string or a Buffer")}if(Z.write(z),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",q),this._getCommandAndAncestors().forEach((G)=>G.emit("afterAllHelp",q))}helpOption($,X){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",X??"display help for command"),$||X)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let X=Number(E.exitCode??0);if(X===0&&$&&typeof $!=="function"&&$.error)X=1;this._exit(X,"commander.help","(outputHelp)")}addHelpText($,X){let Z=["beforeAll","before","after","afterAll"];if(!Z.includes($))throw Error(`Unexpected value for position to addHelpText.
27
+ Expecting one of '${Z.join("', '")}'`);let q=`${$}Help`;return this.on(q,(z)=>{let G;if(typeof X==="function")G=X({error:z.error,command:z.command});else G=X;if(G)z.write(`${G}
28
+ `)}),this}_outputHelpIfRequested($){let X=this._getHelpOption();if(X&&$.find((q)=>X.is(q)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function QX($){return $.map((X)=>{if(!X.startsWith("--inspect"))return X;let Z,q="127.0.0.1",z="9229",G;if((G=X.match(/^(--inspect(-brk)?)$/))!==null)Z=G[1];else if((G=X.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(Z=G[1],/^\d+$/.test(G[3]))z=G[3];else q=G[3];else if((G=X.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)Z=G[1],q=G[3],z=G[4];if(Z&&z!=="0")return`${Z}=${q}:${parseInt(z)+1}`;return X})}function s2(){if(E.env.NO_COLOR||E.env.FORCE_COLOR==="0"||E.env.FORCE_COLOR==="false")return!1;if(E.env.FORCE_COLOR||E.env.CLICOLOR_FORCE!==void 0)return!0;return}T6.Command=n2;T6.useColor=s2});var VX=K((D6)=>{var{Argument:UX}=T1(),{Command:r2}=YX(),{CommanderError:B6,InvalidArgumentError:HX}=_$(),{Help:K6}=c2(),{Option:WX}=l2();D6.program=new r2;D6.createCommand=($)=>new r2($);D6.createOption=($,X)=>new WX($,X);D6.createArgument=($,X)=>new UX($,X);D6.Command=r2;D6.Option=WX;D6.Argument=UX;D6.Help=K6;D6.CommanderError=B6;D6.InvalidArgumentError=HX;D6.InvalidOptionArgumentError=HX});var j=K((h6)=>{var $9=Symbol.for("yaml.alias"),LX=Symbol.for("yaml.document"),L1=Symbol.for("yaml.map"),BX=Symbol.for("yaml.pair"),X9=Symbol.for("yaml.scalar"),B1=Symbol.for("yaml.seq"),U0=Symbol.for("yaml.node.type"),C6=($)=>!!$&&typeof $==="object"&&$[U0]===$9,b6=($)=>!!$&&typeof $==="object"&&$[U0]===LX,y6=($)=>!!$&&typeof $==="object"&&$[U0]===L1,x6=($)=>!!$&&typeof $==="object"&&$[U0]===BX,KX=($)=>!!$&&typeof $==="object"&&$[U0]===X9,f6=($)=>!!$&&typeof $==="object"&&$[U0]===B1;function DX($){if($&&typeof $==="object")switch($[U0]){case L1:case B1:return!0}return!1}function k6($){if($&&typeof $==="object")switch($[U0]){case $9:case L1:case X9:case B1:return!0}return!1}var g6=($)=>(KX($)||DX($))&&!!$.anchor;h6.ALIAS=$9;h6.DOC=LX;h6.MAP=L1;h6.NODE_TYPE=U0;h6.PAIR=BX;h6.SCALAR=X9;h6.SEQ=B1;h6.hasAnchor=g6;h6.isAlias=C6;h6.isCollection=DX;h6.isDocument=b6;h6.isMap=y6;h6.isNode=k6;h6.isPair=x6;h6.isScalar=KX;h6.isSeq=f6});var F$=K((Xq)=>{var h=j(),c=Symbol("break visit"),_X=Symbol("skip children"),G0=Symbol("remove node");function K1($,X){let Z=FX(X);if(h.isDocument($)){if(l0(null,$.contents,Z,Object.freeze([$]))===G0)$.contents=null}else l0(null,$,Z,Object.freeze([]))}K1.BREAK=c;K1.SKIP=_X;K1.REMOVE=G0;function l0($,X,Z,q){let z=OX($,X,Z,q);if(h.isNode(z)||h.isPair(z))return MX($,q,z),l0($,z,Z,q);if(typeof z!=="symbol"){if(h.isCollection(X)){q=Object.freeze(q.concat(X));for(let G=0;G<X.items.length;++G){let J=l0(G,X.items[G],Z,q);if(typeof J==="number")G=J-1;else if(J===c)return c;else if(J===G0)X.items.splice(G,1),G-=1}}else if(h.isPair(X)){q=Object.freeze(q.concat(X));let G=l0("key",X.key,Z,q);if(G===c)return c;else if(G===G0)X.key=null;let J=l0("value",X.value,Z,q);if(J===c)return c;else if(J===G0)X.value=null}}return z}async function D1($,X){let Z=FX(X);if(h.isDocument($)){if(await i0(null,$.contents,Z,Object.freeze([$]))===G0)$.contents=null}else await i0(null,$,Z,Object.freeze([]))}D1.BREAK=c;D1.SKIP=_X;D1.REMOVE=G0;async function i0($,X,Z,q){let z=await OX($,X,Z,q);if(h.isNode(z)||h.isPair(z))return MX($,q,z),i0($,z,Z,q);if(typeof z!=="symbol"){if(h.isCollection(X)){q=Object.freeze(q.concat(X));for(let G=0;G<X.items.length;++G){let J=await i0(G,X.items[G],Z,q);if(typeof J==="number")G=J-1;else if(J===c)return c;else if(J===G0)X.items.splice(G,1),G-=1}}else if(h.isPair(X)){q=Object.freeze(q.concat(X));let G=await i0("key",X.key,Z,q);if(G===c)return c;else if(G===G0)X.key=null;let J=await i0("value",X.value,Z,q);if(J===c)return c;else if(J===G0)X.value=null}}return z}function FX($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function OX($,X,Z,q){if(typeof Z==="function")return Z($,X,q);if(h.isMap(X))return Z.Map?.($,X,q);if(h.isSeq(X))return Z.Seq?.($,X,q);if(h.isPair(X))return Z.Pair?.($,X,q);if(h.isScalar(X))return Z.Scalar?.($,X,q);if(h.isAlias(X))return Z.Alias?.($,X,q);return}function MX($,X,Z){let q=X[X.length-1];if(h.isCollection(q))q.items[$]=Z;else if(h.isPair(q))if($==="key")q.key=Z;else q.value=Z;else if(h.isDocument(q))q.contents=Z;else{let z=h.isAlias(q)?"alias":"scalar";throw Error(`Cannot replace node with ${z} parent`)}}Xq.visit=K1;Xq.visitAsync=D1});var Z9=K((Qq)=>{var IX=j(),zq=F$(),Gq={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Jq=($)=>$.replace(/[!,[\]{}]/g,(X)=>Gq[X]);class s{constructor($,X){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,$),this.tags=Object.assign({},s.defaultTags,X)}clone(){let $=new s(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return $}add($,X){if(this.atNextDocument)this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1;let Z=$.trim().split(/[ \t]+/),q=Z.shift();switch(q){case"%TAG":{if(Z.length!==2){if(X(0,"%TAG directive should contain exactly two parts"),Z.length<2)return!1}let[z,G]=Z;return this.tags[z]=G,!0}case"%YAML":{if(this.yaml.explicit=!0,Z.length!==1)return X(0,"%YAML directive should contain exactly one part"),!1;let[z]=Z;if(z==="1.1"||z==="1.2")return this.yaml.version=z,!0;else{let G=/^\d+\.\d+$/.test(z);return X(6,`Unsupported YAML version ${z}`,G),!1}}default:return X(0,`Unknown directive ${q}`,!0),!1}}tagName($,X){if($==="!")return"!";if($[0]!=="!")return X(`Not a valid tag: ${$}`),null;if($[1]==="<"){let G=$.slice(2,-1);if(G==="!"||G==="!!")return X(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")X("Verbatim tags must end with a >");return G}let[,Z,q]=$.match(/^(.*!)([^!]*)$/s);if(!q)X(`The ${$} tag has no suffix`);let z=this.tags[Z];if(z)try{return z+decodeURIComponent(q)}catch(G){return X(String(G)),null}if(Z==="!")return $;return X(`Could not resolve tag: ${$}`),null}tagString($){for(let[X,Z]of Object.entries(this.tags))if($.startsWith(Z))return X+Jq($.substring(Z.length));return $[0]==="!"?$:`!<${$}>`}toString($){let X=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Z=Object.entries(this.tags),q;if($&&Z.length>0&&IX.isNode($.contents)){let z={};zq.visit($.contents,(G,J)=>{if(IX.isNode(J)&&J.tag)z[J.tag]=!0}),q=Object.keys(z)}else q=[];for(let[z,G]of Z){if(z==="!!"&&G==="tag:yaml.org,2002:")continue;if(!$||q.some((J)=>J.startsWith(G)))X.push(`%TAG ${z} ${G}`)}return X.join(`
29
+ `)}}s.defaultYaml={explicit:!1,version:"1.2"};s.defaultTags={"!!":"tag:yaml.org,2002:"};Qq.Directives=s});var _1=K((Vq)=>{var RX=j(),Uq=F$();function Hq($){if(/[\x00-\x19\s,[\]{}]/.test($)){let Z=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(Z)}return!0}function PX($){let X=new Set;return Uq.visit($,{Value(Z,q){if(q.anchor)X.add(q.anchor)}}),X}function NX($,X){for(let Z=1;;++Z){let q=`${$}${Z}`;if(!X.has(q))return q}}function Wq($,X){let Z=[],q=new Map,z=null;return{onAnchor:(G)=>{Z.push(G),z??(z=PX($));let J=NX(X,z);return z.add(J),J},setAnchors:()=>{for(let G of Z){let J=q.get(G);if(typeof J==="object"&&J.anchor&&(RX.isScalar(J.node)||RX.isCollection(J.node)))J.node.anchor=J.anchor;else{let Q=Error("Failed to resolve repeated object (this should not happen)");throw Q.source=G,Q}}},sourceObjects:q}}Vq.anchorIsValid=Hq;Vq.anchorNames=PX;Vq.createNodeAnchors=Wq;Vq.findNewAnchor=NX});var q9=K((Kq)=>{function O$($,X,Z,q){if(q&&typeof q==="object")if(Array.isArray(q))for(let z=0,G=q.length;z<G;++z){let J=q[z],Q=O$($,q,String(z),J);if(Q===void 0)delete q[z];else if(Q!==J)q[z]=Q}else if(q instanceof Map)for(let z of Array.from(q.keys())){let G=q.get(z),J=O$($,q,z,G);if(J===void 0)q.delete(z);else if(J!==G)q.set(z,J)}else if(q instanceof Set)for(let z of Array.from(q)){let G=O$($,q,z,z);if(G===void 0)q.delete(z);else if(G!==z)q.delete(z),q.add(G)}else for(let[z,G]of Object.entries(q)){let J=O$($,q,z,G);if(J===void 0)delete q[z];else if(J!==G)q[z]=J}return $.call(X,Z,q)}Kq.applyReviver=O$});var L0=K((Fq)=>{var _q=j();function AX($,X,Z){if(Array.isArray($))return $.map((q,z)=>AX(q,String(z),Z));if($&&typeof $.toJSON==="function"){if(!Z||!_q.hasAnchor($))return $.toJSON(X,Z);let q={aliasCount:0,count:1,res:void 0};Z.anchors.set($,q),Z.onCreate=(G)=>{q.res=G,delete Z.onCreate};let z=$.toJSON(X,Z);if(Z.onCreate)Z.onCreate(z);return z}if(typeof $==="bigint"&&!Z?.keep)return Number($);return $}Fq.toJS=AX});var F1=K((Rq)=>{var Mq=q9(),SX=j(),Iq=L0();class jX{constructor($){Object.defineProperty(this,SX.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:X,maxAliasCount:Z,onAnchor:q,reviver:z}={}){if(!SX.isDocument($))throw TypeError("A document argument is required");let G={anchors:new Map,doc:$,keep:!0,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},J=Iq.toJS(this,"",G);if(typeof q==="function")for(let{count:Q,res:Y}of G.anchors.values())q(Y,Q);return typeof z==="function"?Mq.applyReviver(z,{"":J},"",J):J}}Rq.NodeBase=jX});var M$=K((Eq)=>{var Nq=_1(),Aq=F$(),a0=j(),Sq=F1(),jq=L0();class EX extends Sq.NodeBase{constructor($){super(a0.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,X){let Z;if(X?.aliasResolveCache)Z=X.aliasResolveCache;else if(Z=[],Aq.visit($,{Node:(z,G)=>{if(a0.isAlias(G)||a0.hasAnchor(G))Z.push(G)}}),X)X.aliasResolveCache=Z;let q=void 0;for(let z of Z){if(z===this)break;if(z.anchor===this.source)q=z}return q}toJSON($,X){if(!X)return{source:this.source};let{anchors:Z,doc:q,maxAliasCount:z}=X,G=this.resolve(q,X);if(!G){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Q)}let J=Z.get(G);if(!J)jq.toJS(G,null,X),J=Z.get(G);if(J?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(z>=0){if(J.count+=1,J.aliasCount===0)J.aliasCount=O1(q,G,Z);if(J.count*J.aliasCount>z)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return J.res}toString($,X,Z){let q=`*${this.source}`;if($){if(Nq.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let z=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(z)}if($.implicitKey)return`${q} `}return q}}function O1($,X,Z){if(a0.isAlias(X)){let q=X.resolve($),z=Z&&q&&Z.get(q);return z?z.count*z.aliasCount:0}else if(a0.isCollection(X)){let q=0;for(let z of X.items){let G=O1($,z,Z);if(G>q)q=G}return q}else if(a0.isPair(X)){let q=O1($,X.key,Z),z=O1($,X.value,Z);return Math.max(q,z)}return 1}Eq.Alias=EX});var g=K((kq)=>{var bq=j(),yq=F1(),xq=L0(),fq=($)=>!$||typeof $!=="function"&&typeof $!=="object";class S0 extends yq.NodeBase{constructor($){super(bq.SCALAR);this.value=$}toJSON($,X){return X?.keep?this.value:xq.toJS(this.value,$,X)}toString(){return String(this.value)}}S0.BLOCK_FOLDED="BLOCK_FOLDED";S0.BLOCK_LITERAL="BLOCK_LITERAL";S0.PLAIN="PLAIN";S0.QUOTE_DOUBLE="QUOTE_DOUBLE";S0.QUOTE_SINGLE="QUOTE_SINGLE";kq.Scalar=S0;kq.isScalarValue=fq});var I$=K((pq)=>{var vq=M$(),j0=j(),CX=g(),uq="tag:yaml.org,2002:";function mq($,X,Z){if(X){let q=Z.filter((G)=>G.tag===X),z=q.find((G)=>!G.format)??q[0];if(!z)throw Error(`Tag ${X} not found`);return z}return Z.find((q)=>q.identify?.($)&&!q.format)}function dq($,X,Z){if(j0.isDocument($))$=$.contents;if(j0.isNode($))return $;if(j0.isPair($)){let H=Z.schema[j0.MAP].createNode?.(Z.schema,null,Z);return H.items.push($),H}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:q,onAnchor:z,onTagObj:G,schema:J,sourceObjects:Q}=Z,Y=void 0;if(q&&$&&typeof $==="object")if(Y=Q.get($),Y)return Y.anchor??(Y.anchor=z($)),new vq.Alias(Y.anchor);else Y={anchor:null,node:null},Q.set($,Y);if(X?.startsWith("!!"))X=uq+X.slice(2);let U=mq($,X,J.tags);if(!U){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let H=new CX.Scalar($);if(Y)Y.node=H;return H}U=$ instanceof Map?J[j0.MAP]:(Symbol.iterator in Object($))?J[j0.SEQ]:J[j0.MAP]}if(G)G(U),delete Z.onTagObj;let W=U?.createNode?U.createNode(Z.schema,$,Z):typeof U?.nodeClass?.from==="function"?U.nodeClass.from(Z.schema,$,Z):new CX.Scalar($);if(X)W.tag=X;else if(!U.default)W.tag=U.tag;if(Y)Y.node=W;return W}pq.createNode=dq});var M1=K((aq)=>{var lq=I$(),J0=j(),iq=F1();function z9($,X,Z){let q=Z;for(let z=X.length-1;z>=0;--z){let G=X[z];if(typeof G==="number"&&Number.isInteger(G)&&G>=0){let J=[];J[G]=q,q=J}else q=new Map([[G,q]])}return lq.createNode(q,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var bX=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class yX extends iq.NodeBase{constructor($,X){super($);Object.defineProperty(this,"schema",{value:X,configurable:!0,enumerable:!1,writable:!0})}clone($){let X=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)X.schema=$;if(X.items=X.items.map((Z)=>J0.isNode(Z)||J0.isPair(Z)?Z.clone($):Z),this.range)X.range=this.range.slice();return X}addIn($,X){if(bX($))this.add(X);else{let[Z,...q]=$,z=this.get(Z,!0);if(J0.isCollection(z))z.addIn(q,X);else if(z===void 0&&this.schema)this.set(Z,z9(this.schema,q,X));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${q}`)}}deleteIn($){let[X,...Z]=$;if(Z.length===0)return this.delete(X);let q=this.get(X,!0);if(J0.isCollection(q))return q.deleteIn(Z);else throw Error(`Expected YAML collection at ${X}. Remaining path: ${Z}`)}getIn($,X){let[Z,...q]=$,z=this.get(Z,!0);if(q.length===0)return!X&&J0.isScalar(z)?z.value:z;else return J0.isCollection(z)?z.getIn(q,X):void 0}hasAllNullValues($){return this.items.every((X)=>{if(!J0.isPair(X))return!1;let Z=X.value;return Z==null||$&&J0.isScalar(Z)&&Z.value==null&&!Z.commentBefore&&!Z.comment&&!Z.tag})}hasIn($){let[X,...Z]=$;if(Z.length===0)return this.has(X);let q=this.get(X,!0);return J0.isCollection(q)?q.hasIn(Z):!1}setIn($,X){let[Z,...q]=$;if(q.length===0)this.set(Z,X);else{let z=this.get(Z,!0);if(J0.isCollection(z))z.setIn(q,X);else if(z===void 0&&this.schema)this.set(Z,z9(this.schema,q,X));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${q}`)}}}aq.Collection=yX;aq.collectionFromPath=z9;aq.isEmptyPath=bX});var R$=K((eq)=>{var oq=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function G9($,X){if(/^\n+$/.test($))return $.substring(1);return X?$.replace(/^(?! *$)/gm,X):$}var tq=($,X,Z)=>$.endsWith(`
30
+ `)?G9(Z,X):Z.includes(`
31
31
  `)?`
32
- `+Sq(z,q):($.endsWith(" ")?"":" ")+z;PX.indentComment=Sq;PX.lineComment=wX;PX.stringifyComment=MX});var x2=I((jX)=>{function AX($,q,z="flow",{indentAtStart:X,lineWidth:Z=80,minContentWidth:H=20,onFold:Q,onOverflow:J}={}){if(!Z||Z<0)return $;if(Z<H)H=0;let G=Math.max(1+H,1+Z-q.length);if($.length<=G)return $;let U=[],B={},Y=Z-q.length;if(typeof X==="number")if(X>Z-Math.max(2,H))U.push(0);else Y=Z-X;let W=void 0,L=void 0,_=!1,T=-1,V=-1,D=-1;if(z==="block"){if(T=k2($,T,q.length),T!==-1)Y=T+G}for(let w;w=$[T+=1];){if(z==="quoted"&&w==="\\"){switch(V=T,$[T+1]){case"x":T+=3;break;case"u":T+=5;break;case"U":T+=9;break;default:T+=1}D=T}if(w===`
33
- `){if(z==="block")T=k2($,T,q.length);Y=T+q.length+G,W=void 0}else{if(w===" "&&L&&L!==" "&&L!==`
34
- `&&L!=="\t"){let K=$[T+1];if(K&&K!==" "&&K!==`
35
- `&&K!=="\t")W=T}if(T>=Y)if(W)U.push(W),Y=W+G,W=void 0;else if(z==="quoted"){while(L===" "||L==="\t")L=w,w=$[T+=1],_=!0;let K=T>D+1?T-2:V-1;if(B[K])return $;U.push(K),B[K]=!0,Y=K+G,W=void 0}else _=!0}L=w}if(_&&J)J();if(U.length===0)return $;if(Q)Q();let R=$.slice(0,U[0]);for(let w=0;w<U.length;++w){let K=U[w],O=U[w+1]||$.length;if(K===0)R=`
36
- ${q}${$.slice(0,O)}`;else{if(z==="quoted"&&B[K])R+=`${$[K]}\\`;R+=`
37
- ${q}${$.slice(K+1,O)}`}}return R}function k2($,q,z){let X=q,Z=q+1,H=$[Z];while(H===" "||H==="\t")if(q<Z+z)H=$[++q];else{do H=$[++q];while(H&&H!==`
38
- `);X=q,Z=q+1,H=$[Z]}return X}jX.FOLD_BLOCK="block";jX.FOLD_FLOW="flow";jX.FOLD_QUOTED="quoted";jX.foldFlowLines=AX});var m0=I((kX)=>{var u=y(),t=x2(),w$=($,q)=>({indentAtStart:q?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),P$=($)=>/^(%|---|\.\.\.)/m.test($);function CX($,q,z){if(!q||q<0)return!1;let X=q-z,Z=$.length;if(Z<=X)return!1;for(let H=0,Q=0;H<Z;++H)if($[H]===`
39
- `){if(H-Q>X)return!0;if(Q=H+1,Z-Q<=X)return!1}return!0}function u0($,q){let z=JSON.stringify($);if(q.options.doubleQuotedAsJSON)return z;let{implicitKey:X}=q,Z=q.options.doubleQuotedMinMultiLineLength,H=q.indent||(P$($)?" ":""),Q="",J=0;for(let G=0,U=z[G];U;U=z[++G]){if(U===" "&&z[G+1]==="\\"&&z[G+2]==="n")Q+=z.slice(J,G)+"\\ ",G+=1,J=G,U="\\";if(U==="\\")switch(z[G+1]){case"u":{Q+=z.slice(J,G);let B=z.substr(G+2,4);switch(B){case"0000":Q+="\\0";break;case"0007":Q+="\\a";break;case"000b":Q+="\\v";break;case"001b":Q+="\\e";break;case"0085":Q+="\\N";break;case"00a0":Q+="\\_";break;case"2028":Q+="\\L";break;case"2029":Q+="\\P";break;default:if(B.substr(0,2)==="00")Q+="\\x"+B.substr(2);else Q+=z.substr(G,6)}G+=5,J=G+1}break;case"n":if(X||z[G+2]==='"'||z.length<Z)G+=1;else{Q+=z.slice(J,G)+`
40
-
41
- `;while(z[G+2]==="\\"&&z[G+3]==="n"&&z[G+4]!=='"')Q+=`
42
- `,G+=2;if(Q+=H,z[G+2]===" ")Q+="\\";G+=1,J=G+1}break;default:G+=1}}return Q=J?Q+z.slice(J):z,X?Q:t.foldFlowLines(Q,H,t.FOLD_QUOTED,w$(q,!1))}function Nq($,q){if(q.options.singleQuote===!1||q.implicitKey&&$.includes(`
43
- `)||/[ \t]\n|\n[ \t]/.test($))return u0($,q);let z=q.indent||(P$($)?" ":""),X="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
44
- ${z}`)+"'";return q.implicitKey?X:t.foldFlowLines(X,z,t.FOLD_FLOW,w$(q,!1))}function M0($,q){let{singleQuote:z}=q.options,X;if(z===!1)X=u0;else{let Z=$.includes('"'),H=$.includes("'");if(Z&&!H)X=Nq;else if(H&&!Z)X=u0;else X=z?Nq:u0}return X($,q)}var Eq;try{Eq=new RegExp(`(^|(?<!
32
+ `+G9(Z,X):($.endsWith(" ")?"":" ")+Z;eq.indentComment=G9;eq.lineComment=tq;eq.stringifyComment=oq});var fX=K((zz)=>{function qz($,X,Z="flow",{indentAtStart:q,lineWidth:z=80,minContentWidth:G=20,onFold:J,onOverflow:Q}={}){if(!z||z<0)return $;if(z<G)G=0;let Y=Math.max(1+G,1+z-X.length);if($.length<=Y)return $;let U=[],W={},H=z-X.length;if(typeof q==="number")if(q>z-Math.max(2,G))U.push(0);else H=z-q;let V=void 0,w=void 0,B=!1,T=-1,L=-1,D=-1;if(Z==="block"){if(T=xX($,T,X.length),T!==-1)H=T+Y}for(let O;O=$[T+=1];){if(Z==="quoted"&&O==="\\"){switch(L=T,$[T+1]){case"x":T+=3;break;case"u":T+=5;break;case"U":T+=9;break;default:T+=1}D=T}if(O===`
33
+ `){if(Z==="block")T=xX($,T,X.length);H=T+X.length+Y,V=void 0}else{if(O===" "&&w&&w!==" "&&w!==`
34
+ `&&w!=="\t"){let I=$[T+1];if(I&&I!==" "&&I!==`
35
+ `&&I!=="\t")V=T}if(T>=H)if(V)U.push(V),H=V+Y,V=void 0;else if(Z==="quoted"){while(w===" "||w==="\t")w=O,O=$[T+=1],B=!0;let I=T>D+1?T-2:L-1;if(W[I])return $;U.push(I),W[I]=!0,H=I+Y,V=void 0}else B=!0}w=O}if(B&&Q)Q();if(U.length===0)return $;if(J)J();let _=$.slice(0,U[0]);for(let O=0;O<U.length;++O){let I=U[O],R=U[O+1]||$.length;if(I===0)_=`
36
+ ${X}${$.slice(0,R)}`;else{if(Z==="quoted"&&W[I])_+=`${$[I]}\\`;_+=`
37
+ ${X}${$.slice(I+1,R)}`}}return _}function xX($,X,Z){let q=X,z=X+1,G=$[z];while(G===" "||G==="\t")if(X<z+Z)G=$[++X];else{do G=$[++X];while(G&&G!==`
38
+ `);q=X,z=X+1,G=$[z]}return q}zz.FOLD_BLOCK="block";zz.FOLD_FLOW="flow";zz.FOLD_QUOTED="quoted";zz.foldFlowLines=qz});var N$=K((Vz)=>{var $0=g(),B0=fX(),R1=($,X)=>({indentAtStart:X?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),P1=($)=>/^(%|---|\.\.\.)/m.test($);function Uz($,X,Z){if(!X||X<0)return!1;let q=X-Z,z=$.length;if(z<=q)return!1;for(let G=0,J=0;G<z;++G)if($[G]===`
39
+ `){if(G-J>q)return!0;if(J=G+1,z-J<=q)return!1}return!0}function P$($,X){let Z=JSON.stringify($);if(X.options.doubleQuotedAsJSON)return Z;let{implicitKey:q}=X,z=X.options.doubleQuotedMinMultiLineLength,G=X.indent||(P1($)?" ":""),J="",Q=0;for(let Y=0,U=Z[Y];U;U=Z[++Y]){if(U===" "&&Z[Y+1]==="\\"&&Z[Y+2]==="n")J+=Z.slice(Q,Y)+"\\ ",Y+=1,Q=Y,U="\\";if(U==="\\")switch(Z[Y+1]){case"u":{J+=Z.slice(Q,Y);let W=Z.substr(Y+2,4);switch(W){case"0000":J+="\\0";break;case"0007":J+="\\a";break;case"000b":J+="\\v";break;case"001b":J+="\\e";break;case"0085":J+="\\N";break;case"00a0":J+="\\_";break;case"2028":J+="\\L";break;case"2029":J+="\\P";break;default:if(W.substr(0,2)==="00")J+="\\x"+W.substr(2);else J+=Z.substr(Y,6)}Y+=5,Q=Y+1}break;case"n":if(q||Z[Y+2]==='"'||Z.length<z)Y+=1;else{J+=Z.slice(Q,Y)+`
40
+
41
+ `;while(Z[Y+2]==="\\"&&Z[Y+3]==="n"&&Z[Y+4]!=='"')J+=`
42
+ `,Y+=2;if(J+=G,Z[Y+2]===" ")J+="\\";Y+=1,Q=Y+1}break;default:Y+=1}}return J=Q?J+Z.slice(Q):Z,q?J:B0.foldFlowLines(J,G,B0.FOLD_QUOTED,R1(X,!1))}function J9($,X){if(X.options.singleQuote===!1||X.implicitKey&&$.includes(`
43
+ `)||/[ \t]\n|\n[ \t]/.test($))return P$($,X);let Z=X.indent||(P1($)?" ":""),q="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
44
+ ${Z}`)+"'";return X.implicitKey?q:B0.foldFlowLines(q,Z,B0.FOLD_FLOW,R1(X,!1))}function s0($,X){let{singleQuote:Z}=X.options,q;if(Z===!1)q=P$;else{let z=$.includes('"'),G=$.includes("'");if(z&&!G)q=J9;else if(G&&!z)q=P$;else q=Z?J9:P$}return q($,X)}var Q9;try{Q9=new RegExp(`(^|(?<!
45
45
  ))
46
46
  +(?!
47
- |$)`,"g")}catch{Eq=/\n+(?!\n|$)/g}function M$({comment:$,type:q,value:z},X,Z,H){let{blockQuote:Q,commentString:J,lineWidth:G}=X.options;if(!Q||/\n[\t ]+$/.test(z))return M0(z,X);let U=X.indent||(X.forceBlockIndent||P$(z)?" ":""),B=Q==="literal"?!0:Q==="folded"||q===u.Scalar.BLOCK_FOLDED?!1:q===u.Scalar.BLOCK_LITERAL?!0:!CX(z,G,U.length);if(!z)return B?`|
47
+ |$)`,"g")}catch{Q9=/\n+(?!\n|$)/g}function I1({comment:$,type:X,value:Z},q,z,G){let{blockQuote:J,commentString:Q,lineWidth:Y}=q.options;if(!J||/\n[\t ]+$/.test(Z))return s0(Z,q);let U=q.indent||(q.forceBlockIndent||P1(Z)?" ":""),W=J==="literal"?!0:J==="folded"||X===$0.Scalar.BLOCK_FOLDED?!1:X===$0.Scalar.BLOCK_LITERAL?!0:!Uz(Z,Y,U.length);if(!Z)return W?`|
48
48
  `:`>
49
- `;let Y,W;for(W=z.length;W>0;--W){let O=z[W-1];if(O!==`
50
- `&&O!=="\t"&&O!==" ")break}let L=z.substring(W),_=L.indexOf(`
51
- `);if(_===-1)Y="-";else if(z===L||_!==L.length-1){if(Y="+",H)H()}else Y="";if(L){if(z=z.slice(0,-L.length),L[L.length-1]===`
52
- `)L=L.slice(0,-1);L=L.replace(Eq,`$&${U}`)}let T=!1,V,D=-1;for(V=0;V<z.length;++V){let O=z[V];if(O===" ")T=!0;else if(O===`
53
- `)D=V;else break}let R=z.substring(0,D<V?D+1:V);if(R)z=z.substring(R.length),R=R.replace(/\n+/g,`$&${U}`);let K=(T?U?"2":"1":"")+Y;if($){if(K+=" "+J($.replace(/ ?[\r\n]+/g," ")),Z)Z()}if(!B){let O=z.replace(/\n+/g,`
54
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${U}`),F=!1,S=w$(X,!0);if(Q!=="folded"&&q!==u.Scalar.BLOCK_FOLDED)S.onOverflow=()=>{F=!0};let M=t.foldFlowLines(`${R}${O}${L}`,U,t.FOLD_BLOCK,S);if(!F)return`>${K}
55
- ${U}${M}`}return z=z.replace(/\n+/g,`$&${U}`),`|${K}
56
- ${U}${R}${z}${L}`}function yX($,q,z,X){let{type:Z,value:H}=$,{actualString:Q,implicitKey:J,indent:G,indentStep:U,inFlow:B}=q;if(J&&H.includes(`
57
- `)||B&&/[[\]{},]/.test(H))return M0(H,q);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(H))return J||B||!H.includes(`
58
- `)?M0(H,q):M$($,q,z,X);if(!J&&!B&&Z!==u.Scalar.PLAIN&&H.includes(`
59
- `))return M$($,q,z,X);if(P$(H)){if(G==="")return q.forceBlockIndent=!0,M$($,q,z,X);else if(J&&G===U)return M0(H,q)}let Y=H.replace(/\n+/g,`$&
60
- ${G}`);if(Q){let W=(T)=>T.default&&T.tag!=="tag:yaml.org,2002:str"&&T.test?.test(Y),{compat:L,tags:_}=q.doc.schema;if(_.some(W)||L?.some(W))return M0(H,q)}return J?Y:t.foldFlowLines(Y,G,t.FOLD_FLOW,w$(q,!1))}function fX($,q,z,X){let{implicitKey:Z,inFlow:H}=q,Q=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:J}=$;if(J!==u.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Q.value))J=u.Scalar.QUOTE_DOUBLE}let G=(B)=>{switch(B){case u.Scalar.BLOCK_FOLDED:case u.Scalar.BLOCK_LITERAL:return Z||H?M0(Q.value,q):M$(Q,q,z,X);case u.Scalar.QUOTE_DOUBLE:return u0(Q.value,q);case u.Scalar.QUOTE_SINGLE:return Nq(Q.value,q);case u.Scalar.PLAIN:return yX(Q,q,z,X);default:return null}},U=G(J);if(U===null){let{defaultKeyType:B,defaultStringType:Y}=q.options,W=Z&&B||Y;if(U=G(W),U===null)throw Error(`Unsupported default string type ${W}`)}return U}kX.stringifyString=fX});var d0=I((lX)=>{var hX=_$(),e=A(),gX=v0(),vX=m0();function uX($,q){let z=Object.assign({blockQuote:!0,commentString:gX.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,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,q),X;switch(z.collectionStyle){case"block":X=!1;break;case"flow":X=!0;break;default:X=null}return{anchors:new Set,doc:$,flowCollectionPadding:z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof z.indent==="number"?" ".repeat(z.indent):" ",inFlow:X,options:z}}function mX($,q){if(q.tag){let Z=$.filter((H)=>H.tag===q.tag);if(Z.length>0)return Z.find((H)=>H.format===q.format)??Z[0]}let z=void 0,X;if(e.isScalar(q)){X=q.value;let Z=$.filter((H)=>H.identify?.(X));if(Z.length>1){let H=Z.filter((Q)=>Q.test);if(H.length>0)Z=H}z=Z.find((H)=>H.format===q.format)??Z.find((H)=>!H.format)}else X=q,z=$.find((Z)=>Z.nodeClass&&X instanceof Z.nodeClass);if(!z){let Z=X?.constructor?.name??(X===null?"null":typeof X);throw Error(`Tag not resolved for ${Z} value`)}return z}function dX($,q,{anchors:z,doc:X}){if(!X.directives)return"";let Z=[],H=(e.isScalar($)||e.isCollection($))&&$.anchor;if(H&&hX.anchorIsValid(H))z.add(H),Z.push(`&${H}`);let Q=$.tag??(q.default?null:q.tag);if(Q)Z.push(X.directives.tagString(Q));return Z.join(" ")}function pX($,q,z,X){if(e.isPair($))return $.toString(q,z,X);if(e.isAlias($)){if(q.doc.directives)return $.toString(q);if(q.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(q.resolvedAliases)q.resolvedAliases.add($);else q.resolvedAliases=new Set([$]);$=$.resolve(q.doc)}}let Z=void 0,H=e.isNode($)?$:q.doc.createNode($,{onTagObj:(G)=>Z=G});Z??(Z=mX(q.doc.schema.tags,H));let Q=dX(H,Z,q);if(Q.length>0)q.indentAtStart=(q.indentAtStart??0)+Q.length+1;let J=typeof Z.stringify==="function"?Z.stringify(H,q,z,X):e.isScalar(H)?vX.stringifyString(H,q,z,X):H.toString(q,z,X);if(!Q)return J;return e.isScalar(H)||J[0]==="{"||J[0]==="["?`${Q} ${J}`:`${Q}
61
- ${q.indent}${J}`}lX.createStringifyContext=uX;lX.stringify=pX});var v2=I((sX)=>{var n=A(),h2=y(),g2=d0(),p0=v0();function aX({key:$,value:q},z,X,Z){let{allNullValues:H,doc:Q,indent:J,indentStep:G,options:{commentString:U,indentSeq:B,simpleKeys:Y}}=z,W=n.isNode($)&&$.comment||null;if(Y){if(W)throw Error("With simple keys, key nodes cannot have comments");if(n.isCollection($)||!n.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let L=!Y&&(!$||W&&q==null&&!z.inFlow||n.isCollection($)||(n.isScalar($)?$.type===h2.Scalar.BLOCK_FOLDED||$.type===h2.Scalar.BLOCK_LITERAL:typeof $==="object"));z=Object.assign({},z,{allNullValues:!1,implicitKey:!L&&(Y||!H),indent:J+G});let _=!1,T=!1,V=g2.stringify($,z,()=>_=!0,()=>T=!0);if(!L&&!z.inFlow&&V.length>1024){if(Y)throw Error("With simple keys, single line scalar must not span more than 1024 characters");L=!0}if(z.inFlow){if(H||q==null){if(_&&X)X();return V===""?"?":L?`? ${V}`:V}}else if(H&&!Y||q==null&&L){if(V=`? ${V}`,W&&!_)V+=p0.lineComment(V,z.indent,U(W));else if(T&&Z)Z();return V}if(_)W=null;if(L){if(W)V+=p0.lineComment(V,z.indent,U(W));V=`? ${V}
62
- ${J}:`}else if(V=`${V}:`,W)V+=p0.lineComment(V,z.indent,U(W));let D,R,w;if(n.isNode(q))D=!!q.spaceBefore,R=q.commentBefore,w=q.comment;else if(D=!1,R=null,w=null,q&&typeof q==="object")q=Q.createNode(q);if(z.implicitKey=!1,!L&&!W&&n.isScalar(q))z.indentAtStart=V.length+1;if(T=!1,!B&&G.length>=2&&!z.inFlow&&!L&&n.isSeq(q)&&!q.flow&&!q.tag&&!q.anchor)z.indent=z.indent.substring(2);let K=!1,O=g2.stringify(q,z,()=>K=!0,()=>T=!0),F=" ";if(W||D||R){if(F=D?`
63
- `:"",R){let S=U(R);F+=`
64
- ${p0.indentComment(S,z.indent)}`}if(O===""&&!z.inFlow){if(F===`
65
- `&&w)F=`
66
-
67
- `}else F+=`
68
- ${z.indent}`}else if(!L&&n.isCollection(q)){let S=O[0],M=O.indexOf(`
69
- `),N=M!==-1,x=z.inFlow??q.flow??q.items.length===0;if(N||!x){let p=!1;if(N&&(S==="&"||S==="!")){let C=O.indexOf(" ");if(S==="&"&&C!==-1&&C<M&&O[C+1]==="!")C=O.indexOf(" ",C+1);if(C===-1||M<C)p=!0}if(!p)F=`
70
- ${z.indent}`}}else if(O===""||O[0]===`
71
- `)F="";if(V+=F+O,z.inFlow){if(K&&X)X()}else if(w&&!K)V+=p0.lineComment(V,z.indent,U(w));else if(T&&Z)Z();return V}sX.stringifyPair=aX});var bq=I((tX)=>{var u2=a("process");function nX($,...q){if($==="debug")console.log(...q)}function oX($,q){if($==="debug"||$==="warn")if(typeof u2.emitWarning==="function")u2.emitWarning(q);else console.warn(q)}tX.debug=nX;tX.warn=oX});var F$=I((z8)=>{var l0=A(),m2=y(),K$="<<",O$={identify:($)=>$===K$||typeof $==="symbol"&&$.description===K$,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new m2.Scalar(Symbol(K$)),{addToJSMap:d2}),stringify:()=>K$},q8=($,q)=>(O$.identify(q)||l0.isScalar(q)&&(!q.type||q.type===m2.Scalar.PLAIN)&&O$.identify(q.value))&&$?.doc.schema.tags.some((z)=>z.tag===O$.tag&&z.default);function d2($,q,z){if(z=$&&l0.isAlias(z)?z.resolve($.doc):z,l0.isSeq(z))for(let X of z.items)Cq($,q,X);else if(Array.isArray(z))for(let X of z)Cq($,q,X);else Cq($,q,z)}function Cq($,q,z){let X=$&&l0.isAlias(z)?z.resolve($.doc):z;if(!l0.isMap(X))throw Error("Merge sources must be maps or map aliases");let Z=X.toJSON(null,$,Map);for(let[H,Q]of Z)if(q instanceof Map){if(!q.has(H))q.set(H,Q)}else if(q instanceof Set)q.add(H);else if(!Object.prototype.hasOwnProperty.call(q,H))Object.defineProperty(q,H,{value:Q,writable:!0,enumerable:!0,configurable:!0});return q}z8.addMergeToJSMap=d2;z8.isMergeKey=q8;z8.merge=O$});var fq=I((Y8)=>{var Q8=bq(),p2=F$(),J8=d0(),l2=A(),yq=o();function U8($,q,{key:z,value:X}){if(l2.isNode(z)&&z.addToJSMap)z.addToJSMap($,q,X);else if(p2.isMergeKey($,z))p2.addMergeToJSMap($,q,X);else{let Z=yq.toJS(z,"",$);if(q instanceof Map)q.set(Z,yq.toJS(X,Z,$));else if(q instanceof Set)q.add(Z);else{let H=G8(z,Z,$),Q=yq.toJS(X,H,$);if(H in q)Object.defineProperty(q,H,{value:Q,writable:!0,enumerable:!0,configurable:!0});else q[H]=Q}}return q}function G8($,q,z){if(q===null)return"";if(typeof q!=="object")return String(q);if(l2.isNode($)&&z?.doc){let X=J8.createStringifyContext(z.doc,{});X.anchors=new Set;for(let H of z.anchors.keys())X.anchors.add(H.anchor);X.inFlow=!0,X.inStringifyKey=!0;let Z=$.toString(X);if(!z.mapKeyWarned){let H=JSON.stringify(Z);if(H.length>40)H=H.substring(0,36)+'..."';Q8.warn(z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${H}. Set mapAsMap: true to use object keys.`),z.mapKeyWarned=!0}return Z}return JSON.stringify(q)}Y8.addPairToJSMap=U8});var $0=I((V8)=>{var c2=g0(),W8=v2(),T8=fq(),A$=A();function L8($,q,z){let X=c2.createNode($,void 0,z),Z=c2.createNode(q,void 0,z);return new j$(X,Z)}class j${constructor($,q=null){Object.defineProperty(this,A$.NODE_TYPE,{value:A$.PAIR}),this.key=$,this.value=q}clone($){let{key:q,value:z}=this;if(A$.isNode(q))q=q.clone($);if(A$.isNode(z))z=z.clone($);return new j$(q,z)}toJSON($,q){let z=q?.mapAsMap?new Map:{};return T8.addPairToJSMap(q,z,this)}toString($,q,z){return $?.doc?W8.stringifyPair(this,$,q,z):JSON.stringify(this)}}V8.Pair=j$;V8.createPair=L8});var kq=I((w8)=>{var U0=A(),i2=d0(),S$=v0();function D8($,q,z){return(q.inFlow??$.flow?M8:R8)($,q,z)}function R8({comment:$,items:q},z,{blockItemPrefix:X,flowChars:Z,itemIndent:H,onChompKeep:Q,onComment:J}){let{indent:G,options:{commentString:U}}=z,B=Object.assign({},z,{indent:H,type:null}),Y=!1,W=[];for(let _=0;_<q.length;++_){let T=q[_],V=null;if(U0.isNode(T)){if(!Y&&T.spaceBefore)W.push("");if(N$(z,W,T.commentBefore,Y),T.comment)V=T.comment}else if(U0.isPair(T)){let R=U0.isNode(T.key)?T.key:null;if(R){if(!Y&&R.spaceBefore)W.push("");N$(z,W,R.commentBefore,Y)}}Y=!1;let D=i2.stringify(T,B,()=>V=null,()=>Y=!0);if(V)D+=S$.lineComment(D,H,U(V));if(Y&&V)Y=!1;W.push(X+D)}let L;if(W.length===0)L=Z.start+Z.end;else{L=W[0];for(let _=1;_<W.length;++_){let T=W[_];L+=T?`
72
- ${G}${T}`:`
73
- `}}if($){if(L+=`
74
- `+S$.indentComment(U($),G),J)J()}else if(Y&&Q)Q();return L}function M8({items:$},q,{flowChars:z,itemIndent:X}){let{indent:Z,indentStep:H,flowCollectionPadding:Q,options:{commentString:J}}=q;X+=H;let G=Object.assign({},q,{indent:X,inFlow:!0,type:null}),U=!1,B=0,Y=[];for(let _=0;_<$.length;++_){let T=$[_],V=null;if(U0.isNode(T)){if(T.spaceBefore)Y.push("");if(N$(q,Y,T.commentBefore,!1),T.comment)V=T.comment}else if(U0.isPair(T)){let R=U0.isNode(T.key)?T.key:null;if(R){if(R.spaceBefore)Y.push("");if(N$(q,Y,R.commentBefore,!1),R.comment)U=!0}let w=U0.isNode(T.value)?T.value:null;if(w){if(w.comment)V=w.comment;if(w.commentBefore)U=!0}else if(T.value==null&&R?.comment)V=R.comment}if(V)U=!0;let D=i2.stringify(T,G,()=>V=null);if(_<$.length-1)D+=",";if(V)D+=S$.lineComment(D,X,J(V));if(!U&&(Y.length>B||D.includes(`
75
- `)))U=!0;Y.push(D),B=Y.length}let{start:W,end:L}=z;if(Y.length===0)return W+L;else{if(!U){let _=Y.reduce((T,V)=>T+V.length+2,2);U=q.options.lineWidth>0&&_>q.options.lineWidth}if(U){let _=W;for(let T of Y)_+=T?`
76
- ${H}${Z}${T}`:`
77
- `;return`${_}
78
- ${Z}${L}`}else return`${W}${Q}${Y.join(" ")}${Q}${L}`}}function N$({indent:$,options:{commentString:q}},z,X,Z){if(X&&Z)X=X.replace(/^\n+/,"");if(X){let H=S$.indentComment(q(X),$);z.push(H.trimStart())}}w8.stringifyCollection=D8});var z0=I((j8)=>{var K8=kq(),O8=fq(),F8=R$(),q0=A(),E$=$0(),A8=y();function c0($,q){let z=q0.isScalar(q)?q.value:q;for(let X of $)if(q0.isPair(X)){if(X.key===q||X.key===z)return X;if(q0.isScalar(X.key)&&X.key.value===z)return X}return}class a2 extends F8.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(q0.MAP,$);this.items=[]}static from($,q,z){let{keepUndefined:X,replacer:Z}=z,H=new this($),Q=(J,G)=>{if(typeof Z==="function")G=Z.call(q,J,G);else if(Array.isArray(Z)&&!Z.includes(J))return;if(G!==void 0||X)H.items.push(E$.createPair(J,G,z))};if(q instanceof Map)for(let[J,G]of q)Q(J,G);else if(q&&typeof q==="object")for(let J of Object.keys(q))Q(J,q[J]);if(typeof $.sortMapEntries==="function")H.items.sort($.sortMapEntries);return H}add($,q){let z;if(q0.isPair($))z=$;else if(!$||typeof $!=="object"||!("key"in $))z=new E$.Pair($,$?.value);else z=new E$.Pair($.key,$.value);let X=c0(this.items,z.key),Z=this.schema?.sortMapEntries;if(X){if(!q)throw Error(`Key ${z.key} already set`);if(q0.isScalar(X.value)&&A8.isScalarValue(z.value))X.value.value=z.value;else X.value=z.value}else if(Z){let H=this.items.findIndex((Q)=>Z(z,Q)<0);if(H===-1)this.items.push(z);else this.items.splice(H,0,z)}else this.items.push(z)}delete($){let q=c0(this.items,$);if(!q)return!1;return this.items.splice(this.items.indexOf(q),1).length>0}get($,q){let X=c0(this.items,$)?.value;return(!q&&q0.isScalar(X)?X.value:X)??void 0}has($){return!!c0(this.items,$)}set($,q){this.add(new E$.Pair($,q),!0)}toJSON($,q,z){let X=z?new z:q?.mapAsMap?new Map:{};if(q?.onCreate)q.onCreate(X);for(let Z of this.items)O8.addPairToJSMap(q,X,Z);return X}toString($,q,z){if(!$)return JSON.stringify(this);for(let X of this.items)if(!q0.isPair(X))throw Error(`Map items must all be pairs; found ${JSON.stringify(X)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return K8.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:z,onComment:q})}}j8.YAMLMap=a2;j8.findPair=c0});var w0=I((C8)=>{var E8=A(),s2=z0(),b8={collection:"map",default:!0,nodeClass:s2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,q){if(!E8.isMap($))q("Expected a mapping for this tag");return $},createNode:($,q,z)=>s2.YAMLMap.from($,q,z)};C8.map=b8});var X0=I((v8)=>{var f8=g0(),k8=kq(),x8=R$(),C$=A(),h8=y(),g8=o();class r2 extends x8.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(C$.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let q=b$($);if(typeof q!=="number")return!1;return this.items.splice(q,1).length>0}get($,q){let z=b$($);if(typeof z!=="number")return;let X=this.items[z];return!q&&C$.isScalar(X)?X.value:X}has($){let q=b$($);return typeof q==="number"&&q<this.items.length}set($,q){let z=b$($);if(typeof z!=="number")throw Error(`Expected a valid index, not ${$}.`);let X=this.items[z];if(C$.isScalar(X)&&h8.isScalarValue(q))X.value=q;else this.items[z]=q}toJSON($,q){let z=[];if(q?.onCreate)q.onCreate(z);let X=0;for(let Z of this.items)z.push(g8.toJS(Z,String(X++),q));return z}toString($,q,z){if(!$)return JSON.stringify(this);return k8.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:z,onComment:q})}static from($,q,z){let{replacer:X}=z,Z=new this($);if(q&&Symbol.iterator in Object(q)){let H=0;for(let Q of q){if(typeof X==="function"){let J=q instanceof Set?Q:String(H++);Q=X.call(q,J,Q)}Z.items.push(f8.createNode(Q,void 0,z))}}return Z}}function b$($){let q=C$.isScalar($)?$.value:$;if(q&&typeof q==="string")q=Number(q);return typeof q==="number"&&Number.isInteger(q)&&q>=0?q:null}v8.YAMLSeq=r2});var P0=I((p8)=>{var m8=A(),n2=X0(),d8={collection:"seq",default:!0,nodeClass:n2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,q){if(!m8.isSeq($))q("Expected a sequence for this tag");return $},createNode:($,q,z)=>n2.YAMLSeq.from($,q,z)};p8.seq=d8});var i0=I((a8)=>{var c8=m0(),i8={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,q,z,X){return q=Object.assign({actualString:!0},q),c8.stringifyString($,q,z,X)}};a8.string=i8});var y$=I((r8)=>{var o2=y(),t2={identify:($)=>$==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:$},q)=>typeof $==="string"&&t2.test.test($)?$:q.options.nullStr};r8.nullTag=t2});var xq=I((t8)=>{var o8=y(),e2={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new o8.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:q},z){if($&&e2.test.test($)){let X=$[0]==="t"||$[0]==="T";if(q===X)return $}return q?z.options.trueStr:z.options.falseStr}};t8.boolTag=e2});var K0=I((qZ)=>{function $Z({format:$,minFractionDigits:q,tag:z,value:X}){if(typeof X==="bigint")return String(X);let Z=typeof X==="number"?X:Number(X);if(!isFinite(Z))return isNaN(Z)?".nan":Z<0?"-.inf":".inf";let H=Object.is(X,-0)?"-0":JSON.stringify(X);if(!$&&q&&(!z||z==="tag:yaml.org,2002:float")&&/^\d/.test(H)){let Q=H.indexOf(".");if(Q<0)Q=H.length,H+=".";let J=q-(H.length-Q-1);while(J-- >0)H+="0"}return H}qZ.stringifyNumber=$Z});var gq=I((JZ)=>{var XZ=y(),hq=K0(),ZZ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:hq.stringifyNumber},HZ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let q=Number($.value);return isFinite(q)?q.toExponential():hq.stringifyNumber($)}},QZ={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let q=new XZ.Scalar(parseFloat($)),z=$.indexOf(".");if(z!==-1&&$[$.length-1]==="0")q.minFractionDigits=$.length-z-1;return q},stringify:hq.stringifyNumber};JZ.float=QZ;JZ.floatExp=HZ;JZ.floatNaN=ZZ});var uq=I((LZ)=>{var $9=K0(),f$=($)=>typeof $==="bigint"||Number.isInteger($),vq=($,q,z,{intAsBigInt:X})=>X?BigInt($):parseInt($.substring(q),z);function q9($,q,z){let{value:X}=$;if(f$(X)&&X>=0)return z+X.toString(q);return $9.stringifyNumber($)}var BZ={identify:($)=>f$($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,q,z)=>vq($,2,8,z),stringify:($)=>q9($,8,"0o")},WZ={identify:f$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,q,z)=>vq($,0,10,z),stringify:$9.stringifyNumber},TZ={identify:($)=>f$($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,q,z)=>vq($,2,16,z),stringify:($)=>q9($,16,"0x")};LZ.int=WZ;LZ.intHex=TZ;LZ.intOct=BZ});var z9=I((OZ)=>{var DZ=w0(),RZ=y$(),MZ=P0(),wZ=i0(),PZ=xq(),mq=gq(),dq=uq(),KZ=[DZ.map,MZ.seq,wZ.string,RZ.nullTag,PZ.boolTag,dq.intOct,dq.int,dq.intHex,mq.floatNaN,mq.floatExp,mq.float];OZ.schema=KZ});var Z9=I((CZ)=>{var AZ=y(),jZ=w0(),SZ=P0();function X9($){return typeof $==="bigint"||Number.isInteger($)}var k$=({value:$})=>JSON.stringify($),NZ=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:k$},{identify:($)=>$==null,createNode:()=>new AZ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:k$},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:k$},{identify:X9,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,q,{intAsBigInt:z})=>z?BigInt($):parseInt($,10),stringify:({value:$})=>X9($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:k$}],EZ={default:!0,tag:"",test:/^/,resolve($,q){return q(`Unresolved plain scalar ${JSON.stringify($)}`),$}},bZ=[jZ.map,SZ.seq].concat(NZ,EZ);CZ.schema=bZ});var lq=I((xZ)=>{var a0=a("buffer"),pq=y(),fZ=m0(),kZ={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,q){if(typeof a0.Buffer==="function")return a0.Buffer.from($,"base64");else if(typeof atob==="function"){let z=atob($.replace(/[\n\r]/g,"")),X=new Uint8Array(z.length);for(let Z=0;Z<z.length;++Z)X[Z]=z.charCodeAt(Z);return X}else return q("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:q,value:z},X,Z,H){if(!z)return"";let Q=z,J;if(typeof a0.Buffer==="function")J=Q instanceof a0.Buffer?Q.toString("base64"):a0.Buffer.from(Q.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let U=0;U<Q.length;++U)G+=String.fromCharCode(Q[U]);J=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(q??(q=pq.Scalar.BLOCK_LITERAL),q!==pq.Scalar.QUOTE_DOUBLE){let G=Math.max(X.options.lineWidth-X.indent.length,X.options.minContentWidth),U=Math.ceil(J.length/G),B=Array(U);for(let Y=0,W=0;Y<U;++Y,W+=G)B[Y]=J.substr(W,G);J=B.join(q===pq.Scalar.BLOCK_LITERAL?`
79
- `:" ")}return fZ.stringifyString({comment:$,type:q,value:J},X,Z,H)}};xZ.binary=kZ});var h$=I((mZ)=>{var x$=A(),cq=$0(),gZ=y(),vZ=X0();function H9($,q){if(x$.isSeq($))for(let z=0;z<$.items.length;++z){let X=$.items[z];if(x$.isPair(X))continue;else if(x$.isMap(X)){if(X.items.length>1)q("Each pair must have its own sequence indicator");let Z=X.items[0]||new cq.Pair(new gZ.Scalar(null));if(X.commentBefore)Z.key.commentBefore=Z.key.commentBefore?`${X.commentBefore}
80
- ${Z.key.commentBefore}`:X.commentBefore;if(X.comment){let H=Z.value??Z.key;H.comment=H.comment?`${X.comment}
81
- ${H.comment}`:X.comment}X=Z}$.items[z]=x$.isPair(X)?X:new cq.Pair(X)}else q("Expected a sequence for this tag");return $}function Q9($,q,z){let{replacer:X}=z,Z=new vZ.YAMLSeq($);Z.tag="tag:yaml.org,2002:pairs";let H=0;if(q&&Symbol.iterator in Object(q))for(let Q of q){if(typeof X==="function")Q=X.call(q,String(H++),Q);let J,G;if(Array.isArray(Q))if(Q.length===2)J=Q[0],G=Q[1];else throw TypeError(`Expected [key, value] tuple: ${Q}`);else if(Q&&Q instanceof Object){let U=Object.keys(Q);if(U.length===1)J=U[0],G=Q[J];else throw TypeError(`Expected tuple with one key, not ${U.length} keys`)}else J=Q;Z.items.push(cq.createPair(J,G,z))}return Z}var uZ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:H9,createNode:Q9};mZ.createPairs=Q9;mZ.pairs=uZ;mZ.resolvePairs=H9});var aq=I((aZ)=>{var J9=A(),iq=o(),s0=z0(),cZ=X0(),U9=h$();class G0 extends cZ.YAMLSeq{constructor(){super();this.add=s0.YAMLMap.prototype.add.bind(this),this.delete=s0.YAMLMap.prototype.delete.bind(this),this.get=s0.YAMLMap.prototype.get.bind(this),this.has=s0.YAMLMap.prototype.has.bind(this),this.set=s0.YAMLMap.prototype.set.bind(this),this.tag=G0.tag}toJSON($,q){if(!q)return super.toJSON($);let z=new Map;if(q?.onCreate)q.onCreate(z);for(let X of this.items){let Z,H;if(J9.isPair(X))Z=iq.toJS(X.key,"",q),H=iq.toJS(X.value,Z,q);else Z=iq.toJS(X,"",q);if(z.has(Z))throw Error("Ordered maps must not include duplicate keys");z.set(Z,H)}return z}static from($,q,z){let X=U9.createPairs($,q,z),Z=new this;return Z.items=X.items,Z}}G0.tag="tag:yaml.org,2002:omap";var iZ={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:G0,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,q){let z=U9.resolvePairs($,q),X=[];for(let{key:Z}of z.items)if(J9.isScalar(Z))if(X.includes(Z.value))q(`Ordered maps must not include duplicate keys: ${Z.value}`);else X.push(Z.value);return Object.assign(new G0,z)},createNode:($,q,z)=>G0.from($,q,z)};aZ.YAMLOMap=G0;aZ.omap=iZ});var T9=I((nZ)=>{var G9=y();function Y9({value:$,source:q},z){if(q&&($?B9:W9).test.test(q))return q;return $?z.options.trueStr:z.options.falseStr}var B9={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new G9.Scalar(!0),stringify:Y9},W9={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new G9.Scalar(!1),stringify:Y9};nZ.falseTag=W9;nZ.trueTag=B9});var L9=I((X6)=>{var eZ=y(),sq=K0(),$6={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:sq.stringifyNumber},q6={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let q=Number($.value);return isFinite(q)?q.toExponential():sq.stringifyNumber($)}},z6={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let q=new eZ.Scalar(parseFloat($.replace(/_/g,""))),z=$.indexOf(".");if(z!==-1){let X=$.substring(z+1).replace(/_/g,"");if(X[X.length-1]==="0")q.minFractionDigits=X.length}return q},stringify:sq.stringifyNumber};X6.float=z6;X6.floatExp=q6;X6.floatNaN=$6});var _9=I((B6)=>{var V9=K0(),r0=($)=>typeof $==="bigint"||Number.isInteger($);function g$($,q,z,{intAsBigInt:X}){let Z=$[0];if(Z==="-"||Z==="+")q+=1;if($=$.substring(q).replace(/_/g,""),X){switch(z){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let Q=BigInt($);return Z==="-"?BigInt(-1)*Q:Q}let H=parseInt($,z);return Z==="-"?-1*H:H}function rq($,q,z){let{value:X}=$;if(r0(X)){let Z=X.toString(q);return X<0?"-"+z+Z.substr(1):z+Z}return V9.stringifyNumber($)}var J6={identify:r0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,q,z)=>g$($,2,2,z),stringify:($)=>rq($,2,"0b")},U6={identify:r0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,q,z)=>g$($,1,8,z),stringify:($)=>rq($,8,"0")},G6={identify:r0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,q,z)=>g$($,0,10,z),stringify:V9.stringifyNumber},Y6={identify:r0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,q,z)=>g$($,2,16,z),stringify:($)=>rq($,16,"0x")};B6.int=G6;B6.intBin=J6;B6.intHex=Y6;B6.intOct=U6});var nq=I((I6)=>{var m$=A(),v$=$0(),u$=z0();class Y0 extends u$.YAMLMap{constructor($){super($);this.tag=Y0.tag}add($){let q;if(m$.isPair($))q=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)q=new v$.Pair($.key,null);else q=new v$.Pair($,null);if(!u$.findPair(this.items,q.key))this.items.push(q)}get($,q){let z=u$.findPair(this.items,$);return!q&&m$.isPair(z)?m$.isScalar(z.key)?z.key.value:z.key:z}set($,q){if(typeof q!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof q}`);let z=u$.findPair(this.items,$);if(z&&!q)this.items.splice(this.items.indexOf(z),1);else if(!z&&q)this.items.push(new v$.Pair($))}toJSON($,q){return super.toJSON($,q,Set)}toString($,q,z){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),q,z);else throw Error("Set items must all have null values")}static from($,q,z){let{replacer:X}=z,Z=new this($);if(q&&Symbol.iterator in Object(q))for(let H of q){if(typeof X==="function")H=X.call(q,H,H);Z.items.push(v$.createPair(H,null,z))}return Z}}Y0.tag="tag:yaml.org,2002:set";var _6={collection:"map",identify:($)=>$ instanceof Set,nodeClass:Y0,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,q,z)=>Y0.from($,q,z),resolve($,q){if(m$.isMap($))if($.hasAllNullValues(!0))return Object.assign(new Y0,$);else q("Set items must all have null values");else q("Expected a mapping for this tag");return $}};I6.YAMLSet=Y0;I6.set=_6});var tq=I((K6)=>{var M6=K0();function oq($,q){let z=$[0],X=z==="-"||z==="+"?$.substring(1):$,Z=(Q)=>q?BigInt(Q):Number(Q),H=X.replace(/_/g,"").split(":").reduce((Q,J)=>Q*Z(60)+Z(J),Z(0));return z==="-"?Z(-1)*H:H}function I9($){let{value:q}=$,z=(Q)=>Q;if(typeof q==="bigint")z=(Q)=>BigInt(Q);else if(isNaN(q)||!isFinite(q))return M6.stringifyNumber($);let X="";if(q<0)X="-",q*=z(-1);let Z=z(60),H=[q%Z];if(q<60)H.unshift(0);else if(q=(q-H[0])/Z,H.unshift(q%Z),q>=60)q=(q-H[0])/Z,H.unshift(q);return X+H.map((Q)=>String(Q).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var w6={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,q,{intAsBigInt:z})=>oq($,z),stringify:I9},P6={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>oq($,!1),stringify:I9},D9={identify:($)=>$ 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($){let q=$.match(D9.test);if(!q)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,z,X,Z,H,Q,J]=q.map(Number),G=q[7]?Number((q[7]+"00").substr(1,3)):0,U=Date.UTC(z,X-1,Z,H||0,Q||0,J||0,G),B=q[8];if(B&&B!=="Z"){let Y=oq(B,!1);if(Math.abs(Y)<30)Y*=60;U-=60000*Y}return new Date(U)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};K6.floatTime=P6;K6.intTime=w6;K6.timestamp=D9});var M9=I((h6)=>{var j6=w0(),S6=y$(),N6=P0(),E6=i0(),b6=lq(),R9=T9(),eq=L9(),d$=_9(),C6=F$(),y6=aq(),f6=h$(),k6=nq(),$1=tq(),x6=[j6.map,N6.seq,E6.string,S6.nullTag,R9.trueTag,R9.falseTag,d$.intBin,d$.intOct,d$.int,d$.intHex,eq.floatNaN,eq.floatExp,eq.float,b6.binary,C6.merge,y6.omap,f6.pairs,k6.set,$1.intTime,$1.floatTime,$1.timestamp];h6.schema=x6});var E9=I((i6)=>{var O9=w0(),v6=y$(),F9=P0(),u6=i0(),m6=xq(),q1=gq(),z1=uq(),d6=z9(),p6=Z9(),A9=lq(),n0=F$(),j9=aq(),S9=h$(),w9=M9(),N9=nq(),p$=tq(),P9=new Map([["core",d6.schema],["failsafe",[O9.map,F9.seq,u6.string]],["json",p6.schema],["yaml11",w9.schema],["yaml-1.1",w9.schema]]),K9={binary:A9.binary,bool:m6.boolTag,float:q1.float,floatExp:q1.floatExp,floatNaN:q1.floatNaN,floatTime:p$.floatTime,int:z1.int,intHex:z1.intHex,intOct:z1.intOct,intTime:p$.intTime,map:O9.map,merge:n0.merge,null:v6.nullTag,omap:j9.omap,pairs:S9.pairs,seq:F9.seq,set:N9.set,timestamp:p$.timestamp},l6={"tag:yaml.org,2002:binary":A9.binary,"tag:yaml.org,2002:merge":n0.merge,"tag:yaml.org,2002:omap":j9.omap,"tag:yaml.org,2002:pairs":S9.pairs,"tag:yaml.org,2002:set":N9.set,"tag:yaml.org,2002:timestamp":p$.timestamp};function c6($,q,z){let X=P9.get(q);if(X&&!$)return z&&!X.includes(n0.merge)?X.concat(n0.merge):X.slice();let Z=X;if(!Z)if(Array.isArray($))Z=[];else{let H=Array.from(P9.keys()).filter((Q)=>Q!=="yaml11").map((Q)=>JSON.stringify(Q)).join(", ");throw Error(`Unknown schema "${q}"; use one of ${H} or define customTags array`)}if(Array.isArray($))for(let H of $)Z=Z.concat(H);else if(typeof $==="function")Z=$(Z.slice());if(z)Z=Z.concat(n0.merge);return Z.reduce((H,Q)=>{let J=typeof Q==="string"?K9[Q]:Q;if(!J){let G=JSON.stringify(Q),U=Object.keys(K9).map((B)=>JSON.stringify(B)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${U}`)}if(!H.includes(J))H.push(J);return H},[])}i6.coreKnownTags=l6;i6.getTags=c6});var H1=I((e6)=>{var X1=A(),r6=w0(),n6=P0(),o6=i0(),l$=E9(),t6=($,q)=>$.key<q.key?-1:$.key>q.key?1:0;class Z1{constructor({compat:$,customTags:q,merge:z,resolveKnownTags:X,schema:Z,sortMapEntries:H,toStringDefaults:Q}){this.compat=Array.isArray($)?l$.getTags($,"compat"):$?l$.getTags(null,$):null,this.name=typeof Z==="string"&&Z||"core",this.knownTags=X?l$.coreKnownTags:{},this.tags=l$.getTags(q,this.name,z),this.toStringOptions=Q??null,Object.defineProperty(this,X1.MAP,{value:r6.map}),Object.defineProperty(this,X1.SCALAR,{value:o6.string}),Object.defineProperty(this,X1.SEQ,{value:n6.seq}),this.sortMapEntries=typeof H==="function"?H:H===!0?t6:null}clone(){let $=Object.create(Z1.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}e6.Schema=Z1});var b9=I((XH)=>{var qH=A(),Q1=d0(),o0=v0();function zH($,q){let z=[],X=q.directives===!0;if(q.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)z.push(G),X=!0;else if($.directives.docStart)X=!0}if(X)z.push("---");let Z=Q1.createStringifyContext($,q),{commentString:H}=Z.options;if($.commentBefore){if(z.length!==1)z.unshift("");let G=H($.commentBefore);z.unshift(o0.indentComment(G,""))}let Q=!1,J=null;if($.contents){if(qH.isNode($.contents)){if($.contents.spaceBefore&&X)z.push("");if($.contents.commentBefore){let B=H($.contents.commentBefore);z.push(o0.indentComment(B,""))}Z.forceBlockIndent=!!$.comment,J=$.contents.comment}let G=J?void 0:()=>Q=!0,U=Q1.stringify($.contents,Z,()=>J=null,G);if(J)U+=o0.lineComment(U,"",H(J));if((U[0]==="|"||U[0]===">")&&z[z.length-1]==="---")z[z.length-1]=`--- ${U}`;else z.push(U)}else z.push(Q1.stringify($.contents,Z));if($.directives?.docEnd)if($.comment){let G=H($.comment);if(G.includes(`
82
- `))z.push("..."),z.push(o0.indentComment(G,""));else z.push(`... ${G}`)}else z.push("...");else{let G=$.comment;if(G&&Q)G=G.replace(/^\n+/,"");if(G){if((!Q||J)&&z[z.length-1]!=="")z.push("");z.push(o0.indentComment(H(G),""))}}return z.join(`
49
+ `;let H,V;for(V=Z.length;V>0;--V){let R=Z[V-1];if(R!==`
50
+ `&&R!=="\t"&&R!==" ")break}let w=Z.substring(V),B=w.indexOf(`
51
+ `);if(B===-1)H="-";else if(Z===w||B!==w.length-1){if(H="+",G)G()}else H="";if(w){if(Z=Z.slice(0,-w.length),w[w.length-1]===`
52
+ `)w=w.slice(0,-1);w=w.replace(Q9,`$&${U}`)}let T=!1,L,D=-1;for(L=0;L<Z.length;++L){let R=Z[L];if(R===" ")T=!0;else if(R===`
53
+ `)D=L;else break}let _=Z.substring(0,D<L?D+1:L);if(_)Z=Z.substring(_.length),_=_.replace(/\n+/g,`$&${U}`);let I=(T?U?"2":"1":"")+H;if($){if(I+=" "+Q($.replace(/ ?[\r\n]+/g," ")),z)z()}if(!W){let R=Z.replace(/\n+/g,`
54
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${U}`),N=!1,C=R1(q,!0);if(J!=="folded"&&X!==$0.Scalar.BLOCK_FOLDED)C.onOverflow=()=>{N=!0};let F=B0.foldFlowLines(`${_}${R}${w}`,U,B0.FOLD_BLOCK,C);if(!N)return`>${I}
55
+ ${U}${F}`}return Z=Z.replace(/\n+/g,`$&${U}`),`|${I}
56
+ ${U}${_}${Z}${w}`}function Hz($,X,Z,q){let{type:z,value:G}=$,{actualString:J,implicitKey:Q,indent:Y,indentStep:U,inFlow:W}=X;if(Q&&G.includes(`
57
+ `)||W&&/[[\]{},]/.test(G))return s0(G,X);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(G))return Q||W||!G.includes(`
58
+ `)?s0(G,X):I1($,X,Z,q);if(!Q&&!W&&z!==$0.Scalar.PLAIN&&G.includes(`
59
+ `))return I1($,X,Z,q);if(P1(G)){if(Y==="")return X.forceBlockIndent=!0,I1($,X,Z,q);else if(Q&&Y===U)return s0(G,X)}let H=G.replace(/\n+/g,`$&
60
+ ${Y}`);if(J){let V=(T)=>T.default&&T.tag!=="tag:yaml.org,2002:str"&&T.test?.test(H),{compat:w,tags:B}=X.doc.schema;if(B.some(V)||w?.some(V))return s0(G,X)}return Q?H:B0.foldFlowLines(H,Y,B0.FOLD_FLOW,R1(X,!1))}function Wz($,X,Z,q){let{implicitKey:z,inFlow:G}=X,J=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:Q}=$;if(Q!==$0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(J.value))Q=$0.Scalar.QUOTE_DOUBLE}let Y=(W)=>{switch(W){case $0.Scalar.BLOCK_FOLDED:case $0.Scalar.BLOCK_LITERAL:return z||G?s0(J.value,X):I1(J,X,Z,q);case $0.Scalar.QUOTE_DOUBLE:return P$(J.value,X);case $0.Scalar.QUOTE_SINGLE:return J9(J.value,X);case $0.Scalar.PLAIN:return Hz(J,X,Z,q);default:return null}},U=Y(Q);if(U===null){let{defaultKeyType:W,defaultStringType:H}=X.options,V=z&&W||H;if(U=Y(V),U===null)throw Error(`Unsupported default string type ${V}`)}return U}Vz.stringifyString=Wz});var A$=K((Oz)=>{var wz=_1(),K0=j(),Lz=R$(),Bz=N$();function Kz($,X){let Z=Object.assign({blockQuote:!0,commentString:Lz.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,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,X),q;switch(Z.collectionStyle){case"block":q=!1;break;case"flow":q=!0;break;default:q=null}return{anchors:new Set,doc:$,flowCollectionPadding:Z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Z.indent==="number"?" ".repeat(Z.indent):" ",inFlow:q,options:Z}}function Dz($,X){if(X.tag){let z=$.filter((G)=>G.tag===X.tag);if(z.length>0)return z.find((G)=>G.format===X.format)??z[0]}let Z=void 0,q;if(K0.isScalar(X)){q=X.value;let z=$.filter((G)=>G.identify?.(q));if(z.length>1){let G=z.filter((J)=>J.test);if(G.length>0)z=G}Z=z.find((G)=>G.format===X.format)??z.find((G)=>!G.format)}else q=X,Z=$.find((z)=>z.nodeClass&&q instanceof z.nodeClass);if(!Z){let z=q?.constructor?.name??(q===null?"null":typeof q);throw Error(`Tag not resolved for ${z} value`)}return Z}function _z($,X,{anchors:Z,doc:q}){if(!q.directives)return"";let z=[],G=(K0.isScalar($)||K0.isCollection($))&&$.anchor;if(G&&wz.anchorIsValid(G))Z.add(G),z.push(`&${G}`);let J=$.tag??(X.default?null:X.tag);if(J)z.push(q.directives.tagString(J));return z.join(" ")}function Fz($,X,Z,q){if(K0.isPair($))return $.toString(X,Z,q);if(K0.isAlias($)){if(X.doc.directives)return $.toString(X);if(X.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(X.resolvedAliases)X.resolvedAliases.add($);else X.resolvedAliases=new Set([$]);$=$.resolve(X.doc)}}let z=void 0,G=K0.isNode($)?$:X.doc.createNode($,{onTagObj:(Y)=>z=Y});z??(z=Dz(X.doc.schema.tags,G));let J=_z(G,z,X);if(J.length>0)X.indentAtStart=(X.indentAtStart??0)+J.length+1;let Q=typeof z.stringify==="function"?z.stringify(G,X,Z,q):K0.isScalar(G)?Bz.stringifyString(G,X,Z,q):G.toString(X,Z,q);if(!J)return Q;return K0.isScalar(G)||Q[0]==="{"||Q[0]==="["?`${J} ${Q}`:`${J}
61
+ ${X.indent}${Q}`}Oz.createStringifyContext=Kz;Oz.stringify=Fz});var hX=K((Pz)=>{var H0=j(),kX=g(),gX=A$(),S$=R$();function Rz({key:$,value:X},Z,q,z){let{allNullValues:G,doc:J,indent:Q,indentStep:Y,options:{commentString:U,indentSeq:W,simpleKeys:H}}=Z,V=H0.isNode($)&&$.comment||null;if(H){if(V)throw Error("With simple keys, key nodes cannot have comments");if(H0.isCollection($)||!H0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let w=!H&&(!$||V&&X==null&&!Z.inFlow||H0.isCollection($)||(H0.isScalar($)?$.type===kX.Scalar.BLOCK_FOLDED||$.type===kX.Scalar.BLOCK_LITERAL:typeof $==="object"));Z=Object.assign({},Z,{allNullValues:!1,implicitKey:!w&&(H||!G),indent:Q+Y});let B=!1,T=!1,L=gX.stringify($,Z,()=>B=!0,()=>T=!0);if(!w&&!Z.inFlow&&L.length>1024){if(H)throw Error("With simple keys, single line scalar must not span more than 1024 characters");w=!0}if(Z.inFlow){if(G||X==null){if(B&&q)q();return L===""?"?":w?`? ${L}`:L}}else if(G&&!H||X==null&&w){if(L=`? ${L}`,V&&!B)L+=S$.lineComment(L,Z.indent,U(V));else if(T&&z)z();return L}if(B)V=null;if(w){if(V)L+=S$.lineComment(L,Z.indent,U(V));L=`? ${L}
62
+ ${Q}:`}else if(L=`${L}:`,V)L+=S$.lineComment(L,Z.indent,U(V));let D,_,O;if(H0.isNode(X))D=!!X.spaceBefore,_=X.commentBefore,O=X.comment;else if(D=!1,_=null,O=null,X&&typeof X==="object")X=J.createNode(X);if(Z.implicitKey=!1,!w&&!V&&H0.isScalar(X))Z.indentAtStart=L.length+1;if(T=!1,!W&&Y.length>=2&&!Z.inFlow&&!w&&H0.isSeq(X)&&!X.flow&&!X.tag&&!X.anchor)Z.indent=Z.indent.substring(2);let I=!1,R=gX.stringify(X,Z,()=>I=!0,()=>T=!0),N=" ";if(V||D||_){if(N=D?`
63
+ `:"",_){let C=U(_);N+=`
64
+ ${S$.indentComment(C,Z.indent)}`}if(R===""&&!Z.inFlow){if(N===`
65
+ `&&O)N=`
66
+
67
+ `}else N+=`
68
+ ${Z.indent}`}else if(!w&&H0.isCollection(X)){let C=R[0],F=R.indexOf(`
69
+ `),y=F!==-1,a=Z.inFlow??X.flow??X.items.length===0;if(y||!a){let q0=!1;if(y&&(C==="&"||C==="!")){let k=R.indexOf(" ");if(C==="&"&&k!==-1&&k<F&&R[k+1]==="!")k=R.indexOf(" ",k+1);if(k===-1||F<k)q0=!0}if(!q0)N=`
70
+ ${Z.indent}`}}else if(R===""||R[0]===`
71
+ `)N="";if(L+=N+R,Z.inFlow){if(I&&q)q()}else if(O&&!I)L+=S$.lineComment(L,Z.indent,U(O));else if(T&&z)z();return L}Pz.stringifyPair=Rz});var Y9=K((jz)=>{var vX=Q0("process");function Az($,...X){if($==="debug")console.log(...X)}function Sz($,X){if($==="debug"||$==="warn")if(typeof vX.emitWarning==="function")vX.emitWarning(X);else console.warn(X)}jz.debug=Az;jz.warn=Sz});var S1=K((yz)=>{var j$=j(),uX=g(),N1="<<",A1={identify:($)=>$===N1||typeof $==="symbol"&&$.description===N1,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new uX.Scalar(Symbol(N1)),{addToJSMap:mX}),stringify:()=>N1},bz=($,X)=>(A1.identify(X)||j$.isScalar(X)&&(!X.type||X.type===uX.Scalar.PLAIN)&&A1.identify(X.value))&&$?.doc.schema.tags.some((Z)=>Z.tag===A1.tag&&Z.default);function mX($,X,Z){if(Z=$&&j$.isAlias(Z)?Z.resolve($.doc):Z,j$.isSeq(Z))for(let q of Z.items)U9($,X,q);else if(Array.isArray(Z))for(let q of Z)U9($,X,q);else U9($,X,Z)}function U9($,X,Z){let q=$&&j$.isAlias(Z)?Z.resolve($.doc):Z;if(!j$.isMap(q))throw Error("Merge sources must be maps or map aliases");let z=q.toJSON(null,$,Map);for(let[G,J]of z)if(X instanceof Map){if(!X.has(G))X.set(G,J)}else if(X instanceof Set)X.add(G);else if(!Object.prototype.hasOwnProperty.call(X,G))Object.defineProperty(X,G,{value:J,writable:!0,enumerable:!0,configurable:!0});return X}yz.addMergeToJSMap=mX;yz.isMergeKey=bz;yz.merge=A1});var W9=K((mz)=>{var gz=Y9(),dX=S1(),hz=A$(),pX=j(),H9=L0();function vz($,X,{key:Z,value:q}){if(pX.isNode(Z)&&Z.addToJSMap)Z.addToJSMap($,X,q);else if(dX.isMergeKey($,Z))dX.addMergeToJSMap($,X,q);else{let z=H9.toJS(Z,"",$);if(X instanceof Map)X.set(z,H9.toJS(q,z,$));else if(X instanceof Set)X.add(z);else{let G=uz(Z,z,$),J=H9.toJS(q,G,$);if(G in X)Object.defineProperty(X,G,{value:J,writable:!0,enumerable:!0,configurable:!0});else X[G]=J}}return X}function uz($,X,Z){if(X===null)return"";if(typeof X!=="object")return String(X);if(pX.isNode($)&&Z?.doc){let q=hz.createStringifyContext(Z.doc,{});q.anchors=new Set;for(let G of Z.anchors.keys())q.anchors.add(G.anchor);q.inFlow=!0,q.inStringifyKey=!0;let z=$.toString(q);if(!Z.mapKeyWarned){let G=JSON.stringify(z);if(G.length>40)G=G.substring(0,36)+'..."';gz.warn(Z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${G}. Set mapAsMap: true to use object keys.`),Z.mapKeyWarned=!0}return z}return JSON.stringify(X)}mz.addPairToJSMap=vz});var D0=K((iz)=>{var cX=I$(),pz=hX(),cz=W9(),j1=j();function lz($,X,Z){let q=cX.createNode($,void 0,Z),z=cX.createNode(X,void 0,Z);return new E1(q,z)}class E1{constructor($,X=null){Object.defineProperty(this,j1.NODE_TYPE,{value:j1.PAIR}),this.key=$,this.value=X}clone($){let{key:X,value:Z}=this;if(j1.isNode(X))X=X.clone($);if(j1.isNode(Z))Z=Z.clone($);return new E1(X,Z)}toJSON($,X){let Z=X?.mapAsMap?new Map:{};return cz.addPairToJSMap(X,Z,this)}toString($,X,Z){return $?.doc?pz.stringifyPair(this,$,X,Z):JSON.stringify(this)}}iz.Pair=E1;iz.createPair=lz});var V9=K((tz)=>{var E0=j(),lX=A$(),C1=R$();function nz($,X,Z){return(X.inFlow??$.flow?oz:rz)($,X,Z)}function rz({comment:$,items:X},Z,{blockItemPrefix:q,flowChars:z,itemIndent:G,onChompKeep:J,onComment:Q}){let{indent:Y,options:{commentString:U}}=Z,W=Object.assign({},Z,{indent:G,type:null}),H=!1,V=[];for(let B=0;B<X.length;++B){let T=X[B],L=null;if(E0.isNode(T)){if(!H&&T.spaceBefore)V.push("");if(b1(Z,V,T.commentBefore,H),T.comment)L=T.comment}else if(E0.isPair(T)){let _=E0.isNode(T.key)?T.key:null;if(_){if(!H&&_.spaceBefore)V.push("");b1(Z,V,_.commentBefore,H)}}H=!1;let D=lX.stringify(T,W,()=>L=null,()=>H=!0);if(L)D+=C1.lineComment(D,G,U(L));if(H&&L)H=!1;V.push(q+D)}let w;if(V.length===0)w=z.start+z.end;else{w=V[0];for(let B=1;B<V.length;++B){let T=V[B];w+=T?`
72
+ ${Y}${T}`:`
73
+ `}}if($){if(w+=`
74
+ `+C1.indentComment(U($),Y),Q)Q()}else if(H&&J)J();return w}function oz({items:$},X,{flowChars:Z,itemIndent:q}){let{indent:z,indentStep:G,flowCollectionPadding:J,options:{commentString:Q}}=X;q+=G;let Y=Object.assign({},X,{indent:q,inFlow:!0,type:null}),U=!1,W=0,H=[];for(let B=0;B<$.length;++B){let T=$[B],L=null;if(E0.isNode(T)){if(T.spaceBefore)H.push("");if(b1(X,H,T.commentBefore,!1),T.comment)L=T.comment}else if(E0.isPair(T)){let _=E0.isNode(T.key)?T.key:null;if(_){if(_.spaceBefore)H.push("");if(b1(X,H,_.commentBefore,!1),_.comment)U=!0}let O=E0.isNode(T.value)?T.value:null;if(O){if(O.comment)L=O.comment;if(O.commentBefore)U=!0}else if(T.value==null&&_?.comment)L=_.comment}if(L)U=!0;let D=lX.stringify(T,Y,()=>L=null);if(B<$.length-1)D+=",";if(L)D+=C1.lineComment(D,q,Q(L));if(!U&&(H.length>W||D.includes(`
75
+ `)))U=!0;H.push(D),W=H.length}let{start:V,end:w}=Z;if(H.length===0)return V+w;else{if(!U){let B=H.reduce((T,L)=>T+L.length+2,2);U=X.options.lineWidth>0&&B>X.options.lineWidth}if(U){let B=V;for(let T of H)B+=T?`
76
+ ${G}${z}${T}`:`
77
+ `;return`${B}
78
+ ${z}${w}`}else return`${V}${J}${H.join(" ")}${J}${w}`}}function b1({indent:$,options:{commentString:X}},Z,q,z){if(q&&z)q=q.replace(/^\n+/,"");if(q){let G=C1.indentComment(X(q),$);Z.push(G.trimStart())}}tz.stringifyCollection=nz});var F0=K((z3)=>{var $3=V9(),X3=W9(),Z3=M1(),_0=j(),y1=D0(),q3=g();function E$($,X){let Z=_0.isScalar(X)?X.value:X;for(let q of $)if(_0.isPair(q)){if(q.key===X||q.key===Z)return q;if(_0.isScalar(q.key)&&q.key.value===Z)return q}return}class iX extends Z3.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(_0.MAP,$);this.items=[]}static from($,X,Z){let{keepUndefined:q,replacer:z}=Z,G=new this($),J=(Q,Y)=>{if(typeof z==="function")Y=z.call(X,Q,Y);else if(Array.isArray(z)&&!z.includes(Q))return;if(Y!==void 0||q)G.items.push(y1.createPair(Q,Y,Z))};if(X instanceof Map)for(let[Q,Y]of X)J(Q,Y);else if(X&&typeof X==="object")for(let Q of Object.keys(X))J(Q,X[Q]);if(typeof $.sortMapEntries==="function")G.items.sort($.sortMapEntries);return G}add($,X){let Z;if(_0.isPair($))Z=$;else if(!$||typeof $!=="object"||!("key"in $))Z=new y1.Pair($,$?.value);else Z=new y1.Pair($.key,$.value);let q=E$(this.items,Z.key),z=this.schema?.sortMapEntries;if(q){if(!X)throw Error(`Key ${Z.key} already set`);if(_0.isScalar(q.value)&&q3.isScalarValue(Z.value))q.value.value=Z.value;else q.value=Z.value}else if(z){let G=this.items.findIndex((J)=>z(Z,J)<0);if(G===-1)this.items.push(Z);else this.items.splice(G,0,Z)}else this.items.push(Z)}delete($){let X=E$(this.items,$);if(!X)return!1;return this.items.splice(this.items.indexOf(X),1).length>0}get($,X){let q=E$(this.items,$)?.value;return(!X&&_0.isScalar(q)?q.value:q)??void 0}has($){return!!E$(this.items,$)}set($,X){this.add(new y1.Pair($,X),!0)}toJSON($,X,Z){let q=Z?new Z:X?.mapAsMap?new Map:{};if(X?.onCreate)X.onCreate(q);for(let z of this.items)X3.addPairToJSMap(X,q,z);return q}toString($,X,Z){if(!$)return JSON.stringify(this);for(let q of this.items)if(!_0.isPair(q))throw Error(`Map items must all be pairs; found ${JSON.stringify(q)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return $3.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Z,onComment:X})}}z3.YAMLMap=iX;z3.findPair=E$});var n0=K((U3)=>{var Q3=j(),aX=F0(),Y3={collection:"map",default:!0,nodeClass:aX.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,X){if(!Q3.isMap($))X("Expected a mapping for this tag");return $},createNode:($,X,Z)=>aX.YAMLMap.from($,X,Z)};U3.map=Y3});var O0=K((B3)=>{var W3=I$(),V3=V9(),T3=M1(),f1=j(),w3=g(),L3=L0();class sX extends T3.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(f1.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let X=x1($);if(typeof X!=="number")return!1;return this.items.splice(X,1).length>0}get($,X){let Z=x1($);if(typeof Z!=="number")return;let q=this.items[Z];return!X&&f1.isScalar(q)?q.value:q}has($){let X=x1($);return typeof X==="number"&&X<this.items.length}set($,X){let Z=x1($);if(typeof Z!=="number")throw Error(`Expected a valid index, not ${$}.`);let q=this.items[Z];if(f1.isScalar(q)&&w3.isScalarValue(X))q.value=X;else this.items[Z]=X}toJSON($,X){let Z=[];if(X?.onCreate)X.onCreate(Z);let q=0;for(let z of this.items)Z.push(L3.toJS(z,String(q++),X));return Z}toString($,X,Z){if(!$)return JSON.stringify(this);return V3.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:Z,onComment:X})}static from($,X,Z){let{replacer:q}=Z,z=new this($);if(X&&Symbol.iterator in Object(X)){let G=0;for(let J of X){if(typeof q==="function"){let Q=X instanceof Set?J:String(G++);J=q.call(X,Q,J)}z.items.push(W3.createNode(J,void 0,Z))}}return z}}function x1($){let X=f1.isScalar($)?$.value:$;if(X&&typeof X==="string")X=Number(X);return typeof X==="number"&&Number.isInteger(X)&&X>=0?X:null}B3.YAMLSeq=sX});var r0=K((F3)=>{var D3=j(),nX=O0(),_3={collection:"seq",default:!0,nodeClass:nX.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,X){if(!D3.isSeq($))X("Expected a sequence for this tag");return $},createNode:($,X,Z)=>nX.YAMLSeq.from($,X,Z)};F3.seq=_3});var C$=K((R3)=>{var M3=N$(),I3={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,X,Z,q){return X=Object.assign({actualString:!0},X),M3.stringifyString($,X,Z,q)}};R3.string=I3});var k1=K((N3)=>{var rX=g(),oX={identify:($)=>$==null,createNode:()=>new rX.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new rX.Scalar(null),stringify:({source:$},X)=>typeof $==="string"&&oX.test.test($)?$:X.options.nullStr};N3.nullTag=oX});var T9=K((j3)=>{var S3=g(),tX={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new S3.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:X},Z){if($&&tX.test.test($)){let q=$[0]==="t"||$[0]==="T";if(X===q)return $}return X?Z.options.trueStr:Z.options.falseStr}};j3.boolTag=tX});var o0=K((b3)=>{function C3({format:$,minFractionDigits:X,tag:Z,value:q}){if(typeof q==="bigint")return String(q);let z=typeof q==="number"?q:Number(q);if(!isFinite(z))return isNaN(z)?".nan":z<0?"-.inf":".inf";let G=Object.is(q,-0)?"-0":JSON.stringify(q);if(!$&&X&&(!Z||Z==="tag:yaml.org,2002:float")&&/^\d/.test(G)){let J=G.indexOf(".");if(J<0)J=G.length,G+=".";let Q=X-(G.length-J-1);while(Q-- >0)G+="0"}return G}b3.stringifyNumber=C3});var L9=K((h3)=>{var x3=g(),w9=o0(),f3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:w9.stringifyNumber},k3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let X=Number($.value);return isFinite(X)?X.toExponential():w9.stringifyNumber($)}},g3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let X=new x3.Scalar(parseFloat($)),Z=$.indexOf(".");if(Z!==-1&&$[$.length-1]==="0")X.minFractionDigits=$.length-Z-1;return X},stringify:w9.stringifyNumber};h3.float=g3;h3.floatExp=k3;h3.floatNaN=f3});var K9=K((l3)=>{var eX=o0(),g1=($)=>typeof $==="bigint"||Number.isInteger($),B9=($,X,Z,{intAsBigInt:q})=>q?BigInt($):parseInt($.substring(X),Z);function $5($,X,Z){let{value:q}=$;if(g1(q)&&q>=0)return Z+q.toString(X);return eX.stringifyNumber($)}var d3={identify:($)=>g1($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,X,Z)=>B9($,2,8,Z),stringify:($)=>$5($,8,"0o")},p3={identify:g1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,X,Z)=>B9($,0,10,Z),stringify:eX.stringifyNumber},c3={identify:($)=>g1($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,X,Z)=>B9($,2,16,Z),stringify:($)=>$5($,16,"0x")};l3.int=p3;l3.intHex=c3;l3.intOct=d3});var X5=K((X7)=>{var n3=n0(),r3=k1(),o3=r0(),t3=C$(),e3=T9(),D9=L9(),_9=K9(),$7=[n3.map,o3.seq,t3.string,r3.nullTag,e3.boolTag,_9.intOct,_9.int,_9.intHex,D9.floatNaN,D9.floatExp,D9.float];X7.schema=$7});var q5=K((U7)=>{var q7=g(),z7=n0(),G7=r0();function Z5($){return typeof $==="bigint"||Number.isInteger($)}var h1=({value:$})=>JSON.stringify($),J7=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:h1},{identify:($)=>$==null,createNode:()=>new q7.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:h1},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:h1},{identify:Z5,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,X,{intAsBigInt:Z})=>Z?BigInt($):parseInt($,10),stringify:({value:$})=>Z5($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:h1}],Q7={default:!0,tag:"",test:/^/,resolve($,X){return X(`Unresolved plain scalar ${JSON.stringify($)}`),$}},Y7=[z7.map,G7.seq].concat(J7,Q7);U7.schema=Y7});var O9=K((T7)=>{var b$=Q0("buffer"),F9=g(),W7=N$(),V7={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,X){if(typeof b$.Buffer==="function")return b$.Buffer.from($,"base64");else if(typeof atob==="function"){let Z=atob($.replace(/[\n\r]/g,"")),q=new Uint8Array(Z.length);for(let z=0;z<Z.length;++z)q[z]=Z.charCodeAt(z);return q}else return X("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:X,value:Z},q,z,G){if(!Z)return"";let J=Z,Q;if(typeof b$.Buffer==="function")Q=J instanceof b$.Buffer?J.toString("base64"):b$.Buffer.from(J.buffer).toString("base64");else if(typeof btoa==="function"){let Y="";for(let U=0;U<J.length;++U)Y+=String.fromCharCode(J[U]);Q=btoa(Y)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(X??(X=F9.Scalar.BLOCK_LITERAL),X!==F9.Scalar.QUOTE_DOUBLE){let Y=Math.max(q.options.lineWidth-q.indent.length,q.options.minContentWidth),U=Math.ceil(Q.length/Y),W=Array(U);for(let H=0,V=0;H<U;++H,V+=Y)W[H]=Q.substr(V,Y);Q=W.join(X===F9.Scalar.BLOCK_LITERAL?`
79
+ `:" ")}return W7.stringifyString({comment:$,type:X,value:Q},q,z,G)}};T7.binary=V7});var u1=K((D7)=>{var v1=j(),M9=D0(),L7=g(),B7=O0();function z5($,X){if(v1.isSeq($))for(let Z=0;Z<$.items.length;++Z){let q=$.items[Z];if(v1.isPair(q))continue;else if(v1.isMap(q)){if(q.items.length>1)X("Each pair must have its own sequence indicator");let z=q.items[0]||new M9.Pair(new L7.Scalar(null));if(q.commentBefore)z.key.commentBefore=z.key.commentBefore?`${q.commentBefore}
80
+ ${z.key.commentBefore}`:q.commentBefore;if(q.comment){let G=z.value??z.key;G.comment=G.comment?`${q.comment}
81
+ ${G.comment}`:q.comment}q=z}$.items[Z]=v1.isPair(q)?q:new M9.Pair(q)}else X("Expected a sequence for this tag");return $}function G5($,X,Z){let{replacer:q}=Z,z=new B7.YAMLSeq($);z.tag="tag:yaml.org,2002:pairs";let G=0;if(X&&Symbol.iterator in Object(X))for(let J of X){if(typeof q==="function")J=q.call(X,String(G++),J);let Q,Y;if(Array.isArray(J))if(J.length===2)Q=J[0],Y=J[1];else throw TypeError(`Expected [key, value] tuple: ${J}`);else if(J&&J instanceof Object){let U=Object.keys(J);if(U.length===1)Q=U[0],Y=J[Q];else throw TypeError(`Expected tuple with one key, not ${U.length} keys`)}else Q=J;z.items.push(M9.createPair(Q,Y,Z))}return z}var K7={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:z5,createNode:G5};D7.createPairs=G5;D7.pairs=K7;D7.resolvePairs=z5});var R9=K((R7)=>{var J5=j(),I9=L0(),y$=F0(),M7=O0(),Q5=u1();class C0 extends M7.YAMLSeq{constructor(){super();this.add=y$.YAMLMap.prototype.add.bind(this),this.delete=y$.YAMLMap.prototype.delete.bind(this),this.get=y$.YAMLMap.prototype.get.bind(this),this.has=y$.YAMLMap.prototype.has.bind(this),this.set=y$.YAMLMap.prototype.set.bind(this),this.tag=C0.tag}toJSON($,X){if(!X)return super.toJSON($);let Z=new Map;if(X?.onCreate)X.onCreate(Z);for(let q of this.items){let z,G;if(J5.isPair(q))z=I9.toJS(q.key,"",X),G=I9.toJS(q.value,z,X);else z=I9.toJS(q,"",X);if(Z.has(z))throw Error("Ordered maps must not include duplicate keys");Z.set(z,G)}return Z}static from($,X,Z){let q=Q5.createPairs($,X,Z),z=new this;return z.items=q.items,z}}C0.tag="tag:yaml.org,2002:omap";var I7={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:C0,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,X){let Z=Q5.resolvePairs($,X),q=[];for(let{key:z}of Z.items)if(J5.isScalar(z))if(q.includes(z.value))X(`Ordered maps must not include duplicate keys: ${z.value}`);else q.push(z.value);return Object.assign(new C0,Z)},createNode:($,X,Z)=>C0.from($,X,Z)};R7.YAMLOMap=C0;R7.omap=I7});var V5=K((A7)=>{var Y5=g();function U5({value:$,source:X},Z){if(X&&($?H5:W5).test.test(X))return X;return $?Z.options.trueStr:Z.options.falseStr}var H5={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Y5.Scalar(!0),stringify:U5},W5={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Y5.Scalar(!1),stringify:U5};A7.falseTag=W5;A7.trueTag=H5});var T5=K((x7)=>{var E7=g(),P9=o0(),C7={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:P9.stringifyNumber},b7={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let X=Number($.value);return isFinite(X)?X.toExponential():P9.stringifyNumber($)}},y7={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let X=new E7.Scalar(parseFloat($.replace(/_/g,""))),Z=$.indexOf(".");if(Z!==-1){let q=$.substring(Z+1).replace(/_/g,"");if(q[q.length-1]==="0")X.minFractionDigits=q.length}return X},stringify:P9.stringifyNumber};x7.float=y7;x7.floatExp=b7;x7.floatNaN=C7});var L5=K((d7)=>{var w5=o0(),x$=($)=>typeof $==="bigint"||Number.isInteger($);function m1($,X,Z,{intAsBigInt:q}){let z=$[0];if(z==="-"||z==="+")X+=1;if($=$.substring(X).replace(/_/g,""),q){switch(Z){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let J=BigInt($);return z==="-"?BigInt(-1)*J:J}let G=parseInt($,Z);return z==="-"?-1*G:G}function N9($,X,Z){let{value:q}=$;if(x$(q)){let z=q.toString(X);return q<0?"-"+Z+z.substr(1):Z+z}return w5.stringifyNumber($)}var h7={identify:x$,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,X,Z)=>m1($,2,2,Z),stringify:($)=>N9($,2,"0b")},v7={identify:x$,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,X,Z)=>m1($,1,8,Z),stringify:($)=>N9($,8,"0")},u7={identify:x$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,X,Z)=>m1($,0,10,Z),stringify:w5.stringifyNumber},m7={identify:x$,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,X,Z)=>m1($,2,16,Z),stringify:($)=>N9($,16,"0x")};d7.int=u7;d7.intBin=h7;d7.intHex=m7;d7.intOct=v7});var A9=K((s7)=>{var c1=j(),d1=D0(),p1=F0();class b0 extends p1.YAMLMap{constructor($){super($);this.tag=b0.tag}add($){let X;if(c1.isPair($))X=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)X=new d1.Pair($.key,null);else X=new d1.Pair($,null);if(!p1.findPair(this.items,X.key))this.items.push(X)}get($,X){let Z=p1.findPair(this.items,$);return!X&&c1.isPair(Z)?c1.isScalar(Z.key)?Z.key.value:Z.key:Z}set($,X){if(typeof X!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof X}`);let Z=p1.findPair(this.items,$);if(Z&&!X)this.items.splice(this.items.indexOf(Z),1);else if(!Z&&X)this.items.push(new d1.Pair($))}toJSON($,X){return super.toJSON($,X,Set)}toString($,X,Z){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),X,Z);else throw Error("Set items must all have null values")}static from($,X,Z){let{replacer:q}=Z,z=new this($);if(X&&Symbol.iterator in Object(X))for(let G of X){if(typeof q==="function")G=q.call(X,G,G);z.items.push(d1.createPair(G,null,Z))}return z}}b0.tag="tag:yaml.org,2002:set";var a7={collection:"map",identify:($)=>$ instanceof Set,nodeClass:b0,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,X,Z)=>b0.from($,X,Z),resolve($,X){if(c1.isMap($))if($.hasAllNullValues(!0))return Object.assign(new b0,$);else X("Set items must all have null values");else X("Expected a mapping for this tag");return $}};s7.YAMLSet=b0;s7.set=a7});var j9=K(($G)=>{var o7=o0();function S9($,X){let Z=$[0],q=Z==="-"||Z==="+"?$.substring(1):$,z=(J)=>X?BigInt(J):Number(J),G=q.replace(/_/g,"").split(":").reduce((J,Q)=>J*z(60)+z(Q),z(0));return Z==="-"?z(-1)*G:G}function B5($){let{value:X}=$,Z=(J)=>J;if(typeof X==="bigint")Z=(J)=>BigInt(J);else if(isNaN(X)||!isFinite(X))return o7.stringifyNumber($);let q="";if(X<0)q="-",X*=Z(-1);let z=Z(60),G=[X%z];if(X<60)G.unshift(0);else if(X=(X-G[0])/z,G.unshift(X%z),X>=60)X=(X-G[0])/z,G.unshift(X);return q+G.map((J)=>String(J).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var t7={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,X,{intAsBigInt:Z})=>S9($,Z),stringify:B5},e7={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>S9($,!1),stringify:B5},K5={identify:($)=>$ 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($){let X=$.match(K5.test);if(!X)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,q,z,G,J,Q]=X.map(Number),Y=X[7]?Number((X[7]+"00").substr(1,3)):0,U=Date.UTC(Z,q-1,z,G||0,J||0,Q||0,Y),W=X[8];if(W&&W!=="Z"){let H=S9(W,!1);if(Math.abs(H)<30)H*=60;U-=60000*H}return new Date(U)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};$G.floatTime=e7;$G.intTime=t7;$G.timestamp=K5});var _5=K((wG)=>{var zG=n0(),GG=k1(),JG=r0(),QG=C$(),YG=O9(),D5=V5(),E9=T5(),l1=L5(),UG=S1(),HG=R9(),WG=u1(),VG=A9(),C9=j9(),TG=[zG.map,JG.seq,QG.string,GG.nullTag,D5.trueTag,D5.falseTag,l1.intBin,l1.intOct,l1.int,l1.intHex,E9.floatNaN,E9.floatExp,E9.float,YG.binary,UG.merge,HG.omap,WG.pairs,VG.set,C9.intTime,C9.floatTime,C9.timestamp];wG.schema=TG});var j5=K((IG)=>{var I5=n0(),BG=k1(),R5=r0(),KG=C$(),DG=T9(),b9=L9(),y9=K9(),_G=X5(),FG=q5(),P5=O9(),f$=S1(),N5=R9(),A5=u1(),F5=_5(),S5=A9(),i1=j9(),O5=new Map([["core",_G.schema],["failsafe",[I5.map,R5.seq,KG.string]],["json",FG.schema],["yaml11",F5.schema],["yaml-1.1",F5.schema]]),M5={binary:P5.binary,bool:DG.boolTag,float:b9.float,floatExp:b9.floatExp,floatNaN:b9.floatNaN,floatTime:i1.floatTime,int:y9.int,intHex:y9.intHex,intOct:y9.intOct,intTime:i1.intTime,map:I5.map,merge:f$.merge,null:BG.nullTag,omap:N5.omap,pairs:A5.pairs,seq:R5.seq,set:S5.set,timestamp:i1.timestamp},OG={"tag:yaml.org,2002:binary":P5.binary,"tag:yaml.org,2002:merge":f$.merge,"tag:yaml.org,2002:omap":N5.omap,"tag:yaml.org,2002:pairs":A5.pairs,"tag:yaml.org,2002:set":S5.set,"tag:yaml.org,2002:timestamp":i1.timestamp};function MG($,X,Z){let q=O5.get(X);if(q&&!$)return Z&&!q.includes(f$.merge)?q.concat(f$.merge):q.slice();let z=q;if(!z)if(Array.isArray($))z=[];else{let G=Array.from(O5.keys()).filter((J)=>J!=="yaml11").map((J)=>JSON.stringify(J)).join(", ");throw Error(`Unknown schema "${X}"; use one of ${G} or define customTags array`)}if(Array.isArray($))for(let G of $)z=z.concat(G);else if(typeof $==="function")z=$(z.slice());if(Z)z=z.concat(f$.merge);return z.reduce((G,J)=>{let Q=typeof J==="string"?M5[J]:J;if(!Q){let Y=JSON.stringify(J),U=Object.keys(M5).map((W)=>JSON.stringify(W)).join(", ");throw Error(`Unknown custom tag ${Y}; use one of ${U}`)}if(!G.includes(Q))G.push(Q);return G},[])}IG.coreKnownTags=OG;IG.getTags=MG});var k9=K((EG)=>{var x9=j(),NG=n0(),AG=r0(),SG=C$(),a1=j5(),jG=($,X)=>$.key<X.key?-1:$.key>X.key?1:0;class f9{constructor({compat:$,customTags:X,merge:Z,resolveKnownTags:q,schema:z,sortMapEntries:G,toStringDefaults:J}){this.compat=Array.isArray($)?a1.getTags($,"compat"):$?a1.getTags(null,$):null,this.name=typeof z==="string"&&z||"core",this.knownTags=q?a1.coreKnownTags:{},this.tags=a1.getTags(X,this.name,Z),this.toStringOptions=J??null,Object.defineProperty(this,x9.MAP,{value:NG.map}),Object.defineProperty(this,x9.SCALAR,{value:SG.string}),Object.defineProperty(this,x9.SEQ,{value:AG.seq}),this.sortMapEntries=typeof G==="function"?G:G===!0?jG:null}clone(){let $=Object.create(f9.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}EG.Schema=f9});var E5=K((xG)=>{var bG=j(),g9=A$(),k$=R$();function yG($,X){let Z=[],q=X.directives===!0;if(X.directives!==!1&&$.directives){let Y=$.directives.toString($);if(Y)Z.push(Y),q=!0;else if($.directives.docStart)q=!0}if(q)Z.push("---");let z=g9.createStringifyContext($,X),{commentString:G}=z.options;if($.commentBefore){if(Z.length!==1)Z.unshift("");let Y=G($.commentBefore);Z.unshift(k$.indentComment(Y,""))}let J=!1,Q=null;if($.contents){if(bG.isNode($.contents)){if($.contents.spaceBefore&&q)Z.push("");if($.contents.commentBefore){let W=G($.contents.commentBefore);Z.push(k$.indentComment(W,""))}z.forceBlockIndent=!!$.comment,Q=$.contents.comment}let Y=Q?void 0:()=>J=!0,U=g9.stringify($.contents,z,()=>Q=null,Y);if(Q)U+=k$.lineComment(U,"",G(Q));if((U[0]==="|"||U[0]===">")&&Z[Z.length-1]==="---")Z[Z.length-1]=`--- ${U}`;else Z.push(U)}else Z.push(g9.stringify($.contents,z));if($.directives?.docEnd)if($.comment){let Y=G($.comment);if(Y.includes(`
82
+ `))Z.push("..."),Z.push(k$.indentComment(Y,""));else Z.push(`... ${Y}`)}else Z.push("...");else{let Y=$.comment;if(Y&&J)Y=Y.replace(/^\n+/,"");if(Y){if((!J||Q)&&Z[Z.length-1]!=="")Z.push("");Z.push(k$.indentComment(G(Y),""))}}return Z.join(`
83
83
  `)+`
84
- `}XH.stringifyDocument=zH});var t0=I((WH)=>{var HH=h0(),O0=R$(),g=A(),QH=$0(),JH=o(),UH=H1(),GH=b9(),J1=_$(),YH=Aq(),BH=g0(),U1=Fq();class G1{constructor($,q,z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,g.NODE_TYPE,{value:g.DOC});let X=null;if(typeof q==="function"||Array.isArray(q))X=q;else if(z===void 0&&q)z=q,q=void 0;let Z=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},z);this.options=Z;let{version:H}=Z;if(z?._directives){if(this.directives=z._directives.atDocument(),this.directives.yaml.explicit)H=this.directives.yaml.version}else this.directives=new U1.Directives({version:H});this.setSchema(H,z),this.contents=$===void 0?null:this.createNode($,X,z)}clone(){let $=Object.create(G1.prototype,{[g.NODE_TYPE]:{value:g.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=g.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(F0(this.contents))this.contents.add($)}addIn($,q){if(F0(this.contents))this.contents.addIn($,q)}createAlias($,q){if(!$.anchor){let z=J1.anchorNames(this);$.anchor=!q||z.has(q)?J1.findNewAnchor(q||"a",z):q}return new HH.Alias($.anchor)}createNode($,q,z){let X=void 0;if(typeof q==="function")$=q.call({"":$},"",$),X=q;else if(Array.isArray(q)){let T=(D)=>typeof D==="number"||D instanceof String||D instanceof Number,V=q.filter(T).map(String);if(V.length>0)q=q.concat(V);X=q}else if(z===void 0&&q)z=q,q=void 0;let{aliasDuplicateObjects:Z,anchorPrefix:H,flow:Q,keepUndefined:J,onTagObj:G,tag:U}=z??{},{onAnchor:B,setAnchors:Y,sourceObjects:W}=J1.createNodeAnchors(this,H||"a"),L={aliasDuplicateObjects:Z??!0,keepUndefined:J??!1,onAnchor:B,onTagObj:G,replacer:X,schema:this.schema,sourceObjects:W},_=BH.createNode($,U,L);if(Q&&g.isCollection(_))_.flow=!0;return Y(),_}createPair($,q,z={}){let X=this.createNode($,null,z),Z=this.createNode(q,null,z);return new QH.Pair(X,Z)}delete($){return F0(this.contents)?this.contents.delete($):!1}deleteIn($){if(O0.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return F0(this.contents)?this.contents.deleteIn($):!1}get($,q){return g.isCollection(this.contents)?this.contents.get($,q):void 0}getIn($,q){if(O0.isEmptyPath($))return!q&&g.isScalar(this.contents)?this.contents.value:this.contents;return g.isCollection(this.contents)?this.contents.getIn($,q):void 0}has($){return g.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(O0.isEmptyPath($))return this.contents!==void 0;return g.isCollection(this.contents)?this.contents.hasIn($):!1}set($,q){if(this.contents==null)this.contents=O0.collectionFromPath(this.schema,[$],q);else if(F0(this.contents))this.contents.set($,q)}setIn($,q){if(O0.isEmptyPath($))this.contents=q;else if(this.contents==null)this.contents=O0.collectionFromPath(this.schema,Array.from($),q);else if(F0(this.contents))this.contents.setIn($,q)}setSchema($,q={}){if(typeof $==="number")$=String($);let z;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new U1.Directives({version:"1.1"});z={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new U1.Directives({version:$});z={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;z=null;break;default:{let X=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${X}`)}}if(q.schema instanceof Object)this.schema=q.schema;else if(z)this.schema=new UH.Schema(Object.assign(z,q));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:q,mapAsMap:z,maxAliasCount:X,onAnchor:Z,reviver:H}={}){let Q={anchors:new Map,doc:this,keep:!$,mapAsMap:z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},J=JH.toJS(this.contents,q??"",Q);if(typeof Z==="function")for(let{count:G,res:U}of Q.anchors.values())Z(U,G);return typeof H==="function"?YH.applyReviver(H,{"":J},"",J):J}toJSON($,q){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:q})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let q=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${q}`)}return GH.stringifyDocument(this,$)}}function F0($){if(g.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}WH.Document=G1});var e0=I((VH)=>{class c$ extends Error{constructor($,q,z,X){super();this.name=$,this.code=z,this.message=X,this.pos=q}}class C9 extends c${constructor($,q,z){super("YAMLParseError",$,q,z)}}class y9 extends c${constructor($,q,z){super("YAMLWarning",$,q,z)}}var LH=($,q)=>(z)=>{if(z.pos[0]===-1)return;z.linePos=z.pos.map((J)=>q.linePos(J));let{line:X,col:Z}=z.linePos[0];z.message+=` at line ${X}, column ${Z}`;let H=Z-1,Q=$.substring(q.lineStarts[X-1],q.lineStarts[X]).replace(/[\n\r]+$/,"");if(H>=60&&Q.length>80){let J=Math.min(H-39,Q.length-79);Q="\u2026"+Q.substring(J),H-=J-1}if(Q.length>80)Q=Q.substring(0,79)+"\u2026";if(X>1&&/^ *$/.test(Q.substring(0,H))){let J=$.substring(q.lineStarts[X-2],q.lineStarts[X-1]);if(J.length>80)J=J.substring(0,79)+`\u2026
85
- `;Q=J+Q}if(/[^ ]/.test(Q)){let J=1,G=z.linePos[1];if(G?.line===X&&G.col>Z)J=Math.max(1,Math.min(G.col-Z,80-H));let U=" ".repeat(H)+"^".repeat(J);z.message+=`:
84
+ `}xG.stringifyDocument=yG});var g$=K((pG)=>{var kG=M$(),t0=M1(),n=j(),gG=D0(),hG=L0(),vG=k9(),uG=E5(),h9=_1(),mG=q9(),dG=I$(),v9=Z9();class u9{constructor($,X,Z){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,n.NODE_TYPE,{value:n.DOC});let q=null;if(typeof X==="function"||Array.isArray(X))q=X;else if(Z===void 0&&X)Z=X,X=void 0;let z=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Z);this.options=z;let{version:G}=z;if(Z?._directives){if(this.directives=Z._directives.atDocument(),this.directives.yaml.explicit)G=this.directives.yaml.version}else this.directives=new v9.Directives({version:G});this.setSchema(G,Z),this.contents=$===void 0?null:this.createNode($,q,Z)}clone(){let $=Object.create(u9.prototype,{[n.NODE_TYPE]:{value:n.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=n.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(e0(this.contents))this.contents.add($)}addIn($,X){if(e0(this.contents))this.contents.addIn($,X)}createAlias($,X){if(!$.anchor){let Z=h9.anchorNames(this);$.anchor=!X||Z.has(X)?h9.findNewAnchor(X||"a",Z):X}return new kG.Alias($.anchor)}createNode($,X,Z){let q=void 0;if(typeof X==="function")$=X.call({"":$},"",$),q=X;else if(Array.isArray(X)){let T=(D)=>typeof D==="number"||D instanceof String||D instanceof Number,L=X.filter(T).map(String);if(L.length>0)X=X.concat(L);q=X}else if(Z===void 0&&X)Z=X,X=void 0;let{aliasDuplicateObjects:z,anchorPrefix:G,flow:J,keepUndefined:Q,onTagObj:Y,tag:U}=Z??{},{onAnchor:W,setAnchors:H,sourceObjects:V}=h9.createNodeAnchors(this,G||"a"),w={aliasDuplicateObjects:z??!0,keepUndefined:Q??!1,onAnchor:W,onTagObj:Y,replacer:q,schema:this.schema,sourceObjects:V},B=dG.createNode($,U,w);if(J&&n.isCollection(B))B.flow=!0;return H(),B}createPair($,X,Z={}){let q=this.createNode($,null,Z),z=this.createNode(X,null,Z);return new gG.Pair(q,z)}delete($){return e0(this.contents)?this.contents.delete($):!1}deleteIn($){if(t0.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return e0(this.contents)?this.contents.deleteIn($):!1}get($,X){return n.isCollection(this.contents)?this.contents.get($,X):void 0}getIn($,X){if(t0.isEmptyPath($))return!X&&n.isScalar(this.contents)?this.contents.value:this.contents;return n.isCollection(this.contents)?this.contents.getIn($,X):void 0}has($){return n.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(t0.isEmptyPath($))return this.contents!==void 0;return n.isCollection(this.contents)?this.contents.hasIn($):!1}set($,X){if(this.contents==null)this.contents=t0.collectionFromPath(this.schema,[$],X);else if(e0(this.contents))this.contents.set($,X)}setIn($,X){if(t0.isEmptyPath($))this.contents=X;else if(this.contents==null)this.contents=t0.collectionFromPath(this.schema,Array.from($),X);else if(e0(this.contents))this.contents.setIn($,X)}setSchema($,X={}){if(typeof $==="number")$=String($);let Z;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new v9.Directives({version:"1.1"});Z={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new v9.Directives({version:$});Z={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;Z=null;break;default:{let q=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${q}`)}}if(X.schema instanceof Object)this.schema=X.schema;else if(Z)this.schema=new vG.Schema(Object.assign(Z,X));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:X,mapAsMap:Z,maxAliasCount:q,onAnchor:z,reviver:G}={}){let J={anchors:new Map,doc:this,keep:!$,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof q==="number"?q:100},Q=hG.toJS(this.contents,X??"",J);if(typeof z==="function")for(let{count:Y,res:U}of J.anchors.values())z(U,Y);return typeof G==="function"?mG.applyReviver(G,{"":Q},"",Q):Q}toJSON($,X){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:X})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let X=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${X}`)}return uG.stringifyDocument(this,$)}}function e0($){if(n.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}pG.Document=u9});var h$=K((iG)=>{class s1 extends Error{constructor($,X,Z,q){super();this.name=$,this.code=Z,this.message=q,this.pos=X}}class C5 extends s1{constructor($,X,Z){super("YAMLParseError",$,X,Z)}}class b5 extends s1{constructor($,X,Z){super("YAMLWarning",$,X,Z)}}var lG=($,X)=>(Z)=>{if(Z.pos[0]===-1)return;Z.linePos=Z.pos.map((Q)=>X.linePos(Q));let{line:q,col:z}=Z.linePos[0];Z.message+=` at line ${q}, column ${z}`;let G=z-1,J=$.substring(X.lineStarts[q-1],X.lineStarts[q]).replace(/[\n\r]+$/,"");if(G>=60&&J.length>80){let Q=Math.min(G-39,J.length-79);J="\u2026"+J.substring(Q),G-=Q-1}if(J.length>80)J=J.substring(0,79)+"\u2026";if(q>1&&/^ *$/.test(J.substring(0,G))){let Q=$.substring(X.lineStarts[q-2],X.lineStarts[q-1]);if(Q.length>80)Q=Q.substring(0,79)+`\u2026
85
+ `;J=Q+J}if(/[^ ]/.test(J)){let Q=1,Y=Z.linePos[1];if(Y?.line===q&&Y.col>z)Q=Math.max(1,Math.min(Y.col-z,80-G));let U=" ".repeat(G)+"^".repeat(Q);Z.message+=`:
86
86
 
87
- ${Q}
87
+ ${J}
88
88
  ${U}
89
- `}};VH.YAMLError=c$;VH.YAMLParseError=C9;VH.YAMLWarning=y9;VH.prettifyError=LH});var $$=I((wH)=>{function MH($,{flow:q,indicator:z,next:X,offset:Z,onError:H,parentIndent:Q,startOnNewline:J}){let G=!1,U=J,B=J,Y="",W="",L=!1,_=!1,T=null,V=null,D=null,R=null,w=null,K=null,O=null;for(let M of $){if(_){if(M.type!=="space"&&M.type!=="newline"&&M.type!=="comma")H(M.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");_=!1}if(T){if(U&&M.type!=="comment"&&M.type!=="newline")H(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");T=null}switch(M.type){case"space":if(!q&&(z!=="doc-start"||X?.type!=="flow-collection")&&M.source.includes("\t"))T=M;B=!0;break;case"comment":{if(!B)H(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=M.source.substring(1)||" ";if(!Y)Y=N;else Y+=W+N;W="",U=!1;break}case"newline":if(U){if(Y)Y+=M.source;else if(!K||z!=="seq-item-ind")G=!0}else W+=M.source;if(U=!0,L=!0,V||D)R=M;B=!0;break;case"anchor":if(V)H(M,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(M.source.endsWith(":"))H(M.offset+M.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);V=M,O??(O=M.offset),U=!1,B=!1,_=!0;break;case"tag":{if(D)H(M,"MULTIPLE_TAGS","A node can have at most one tag");D=M,O??(O=M.offset),U=!1,B=!1,_=!0;break}case z:if(V||D)H(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`);if(K)H(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${q??"collection"}`);K=M,U=z==="seq-item-ind"||z==="explicit-key-ind",B=!1;break;case"comma":if(q){if(w)H(M,"UNEXPECTED_TOKEN",`Unexpected , in ${q}`);w=M,U=!1,B=!1;break}default:H(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),U=!1,B=!1}}let F=$[$.length-1],S=F?F.offset+F.source.length:Z;if(_&&X&&X.type!=="space"&&X.type!=="newline"&&X.type!=="comma"&&(X.type!=="scalar"||X.source!==""))H(X.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(T&&(U&&T.indent<=Q||X?.type==="block-map"||X?.type==="block-seq"))H(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:w,found:K,spaceBefore:G,comment:Y,hasNewline:L,anchor:V,tag:D,newlineAfterProp:R,end:S,start:O??S}}wH.resolveProps=MH});var i$=I((KH)=>{function Y1($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
90
- `))return!0;if($.end){for(let q of $.end)if(q.type==="newline")return!0}return!1;case"flow-collection":for(let q of $.items){for(let z of q.start)if(z.type==="newline")return!0;if(q.sep){for(let z of q.sep)if(z.type==="newline")return!0}if(Y1(q.key)||Y1(q.value))return!0}return!1;default:return!0}}KH.containsNewline=Y1});var B1=I((jH)=>{var FH=i$();function AH($,q,z){if(q?.type==="flow-collection"){let X=q.end[0];if(X.indent===$&&(X.source==="]"||X.source==="}")&&FH.containsNewline(q))z(X,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}jH.flowIndentCheck=AH});var W1=I((EH)=>{var f9=A();function NH($,q,z){let{uniqueKeys:X}=$.options;if(X===!1)return!1;let Z=typeof X==="function"?X:(H,Q)=>H===Q||f9.isScalar(H)&&f9.isScalar(Q)&&H.value===Q.value;return q.some((H)=>Z(H.key,z))}EH.mapIncludes=NH});var v9=I((xH)=>{var k9=$0(),CH=z0(),x9=$$(),yH=i$(),h9=B1(),fH=W1(),g9="All mapping items must start at the same column";function kH({composeNode:$,composeEmptyNode:q},z,X,Z,H){let J=new(H?.nodeClass??CH.YAMLMap)(z.schema);if(z.atRoot)z.atRoot=!1;let G=X.offset,U=null;for(let B of X.items){let{start:Y,key:W,sep:L,value:_}=B,T=x9.resolveProps(Y,{indicator:"explicit-key-ind",next:W??L?.[0],offset:G,onError:Z,parentIndent:X.indent,startOnNewline:!0}),V=!T.found;if(V){if(W){if(W.type==="block-seq")Z(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in W&&W.indent!==X.indent)Z(G,"BAD_INDENT",g9)}if(!T.anchor&&!T.tag&&!L){if(U=T.end,T.comment)if(J.comment)J.comment+=`
91
- `+T.comment;else J.comment=T.comment;continue}if(T.newlineAfterProp||yH.containsNewline(W))Z(W??Y[Y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(T.found?.indent!==X.indent)Z(G,"BAD_INDENT",g9);z.atKey=!0;let D=T.end,R=W?$(z,W,T,Z):q(z,D,Y,null,T,Z);if(z.schema.compat)h9.flowIndentCheck(X.indent,W,Z);if(z.atKey=!1,fH.mapIncludes(z,J.items,R))Z(D,"DUPLICATE_KEY","Map keys must be unique");let w=x9.resolveProps(L??[],{indicator:"map-value-ind",next:_,offset:R.range[2],onError:Z,parentIndent:X.indent,startOnNewline:!W||W.type==="block-scalar"});if(G=w.end,w.found){if(V){if(_?.type==="block-map"&&!w.hasNewline)Z(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(z.options.strict&&T.start<w.found.offset-1024)Z(R.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let K=_?$(z,_,w,Z):q(z,G,L,null,w,Z);if(z.schema.compat)h9.flowIndentCheck(X.indent,_,Z);G=K.range[2];let O=new k9.Pair(R,K);if(z.options.keepSourceTokens)O.srcToken=B;J.items.push(O)}else{if(V)Z(R.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(w.comment)if(R.comment)R.comment+=`
92
- `+w.comment;else R.comment=w.comment;let K=new k9.Pair(R);if(z.options.keepSourceTokens)K.srcToken=B;J.items.push(K)}}if(U&&U<G)Z(U,"IMPOSSIBLE","Map comment with trailing content");return J.range=[X.offset,G,U??G],J}xH.resolveBlockMap=kH});var u9=I((dH)=>{var gH=X0(),vH=$$(),uH=B1();function mH({composeNode:$,composeEmptyNode:q},z,X,Z,H){let J=new(H?.nodeClass??gH.YAMLSeq)(z.schema);if(z.atRoot)z.atRoot=!1;if(z.atKey)z.atKey=!1;let G=X.offset,U=null;for(let{start:B,value:Y}of X.items){let W=vH.resolveProps(B,{indicator:"seq-item-ind",next:Y,offset:G,onError:Z,parentIndent:X.indent,startOnNewline:!0});if(!W.found)if(W.anchor||W.tag||Y)if(Y?.type==="block-seq")Z(W.end,"BAD_INDENT","All sequence items must start at the same column");else Z(G,"MISSING_CHAR","Sequence item without - indicator");else{if(U=W.end,W.comment)J.comment=W.comment;continue}let L=Y?$(z,Y,W,Z):q(z,W.end,B,null,W,Z);if(z.schema.compat)uH.flowIndentCheck(X.indent,Y,Z);G=L.range[2],J.items.push(L)}return J.range=[X.offset,G,U??G],J}dH.resolveBlockSeq=mH});var A0=I((cH)=>{function lH($,q,z,X){let Z="";if($){let H=!1,Q="";for(let J of $){let{source:G,type:U}=J;switch(U){case"space":H=!0;break;case"comment":{if(z&&!H)X(J,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let B=G.substring(1)||" ";if(!Z)Z=B;else Z+=Q+B;Q="";break}case"newline":if(Z)Q+=G;H=!0;break;default:X(J,"UNEXPECTED_TOKEN",`Unexpected ${U} at node end`)}q+=G.length}}return{comment:Z,offset:q}}cH.resolveEnd=lH});var p9=I(($3)=>{var aH=A(),sH=$0(),m9=z0(),rH=X0(),nH=A0(),d9=$$(),oH=i$(),tH=W1(),T1="Block collections are not allowed within flow collections",L1=($)=>$&&($.type==="block-map"||$.type==="block-seq");function eH({composeNode:$,composeEmptyNode:q},z,X,Z,H){let Q=X.start.source==="{",J=Q?"flow map":"flow sequence",U=new(H?.nodeClass??(Q?m9.YAMLMap:rH.YAMLSeq))(z.schema);U.flow=!0;let B=z.atRoot;if(B)z.atRoot=!1;if(z.atKey)z.atKey=!1;let Y=X.offset+X.start.source.length;for(let V=0;V<X.items.length;++V){let D=X.items[V],{start:R,key:w,sep:K,value:O}=D,F=d9.resolveProps(R,{flow:J,indicator:"explicit-key-ind",next:w??K?.[0],offset:Y,onError:Z,parentIndent:X.indent,startOnNewline:!1});if(!F.found){if(!F.anchor&&!F.tag&&!K&&!O){if(V===0&&F.comma)Z(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`);else if(V<X.items.length-1)Z(F.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${J}`);if(F.comment)if(U.comment)U.comment+=`
93
- `+F.comment;else U.comment=F.comment;Y=F.end;continue}if(!Q&&z.options.strict&&oH.containsNewline(w))Z(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(V===0){if(F.comma)Z(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${J}`)}else{if(!F.comma)Z(F.start,"MISSING_CHAR",`Missing , between ${J} items`);if(F.comment){let S="";$:for(let M of R)switch(M.type){case"comma":case"space":break;case"comment":S=M.source.substring(1);break $;default:break $}if(S){let M=U.items[U.items.length-1];if(aH.isPair(M))M=M.value??M.key;if(M.comment)M.comment+=`
94
- `+S;else M.comment=S;F.comment=F.comment.substring(S.length+1)}}}if(!Q&&!K&&!F.found){let S=O?$(z,O,F,Z):q(z,F.end,K,null,F,Z);if(U.items.push(S),Y=S.range[2],L1(O))Z(S.range,"BLOCK_IN_FLOW",T1)}else{z.atKey=!0;let S=F.end,M=w?$(z,w,F,Z):q(z,S,R,null,F,Z);if(L1(w))Z(M.range,"BLOCK_IN_FLOW",T1);z.atKey=!1;let N=d9.resolveProps(K??[],{flow:J,indicator:"map-value-ind",next:O,offset:M.range[2],onError:Z,parentIndent:X.indent,startOnNewline:!1});if(N.found){if(!Q&&!F.found&&z.options.strict){if(K)for(let C of K){if(C===N.found)break;if(C.type==="newline"){Z(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(F.start<N.found.offset-1024)Z(N.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(O)if("source"in O&&O.source?.[0]===":")Z(O,"MISSING_CHAR",`Missing space after : in ${J}`);else Z(N.start,"MISSING_CHAR",`Missing , or : between ${J} items`);let x=O?$(z,O,N,Z):N.found?q(z,N.end,K,null,N,Z):null;if(x){if(L1(O))Z(x.range,"BLOCK_IN_FLOW",T1)}else if(N.comment)if(M.comment)M.comment+=`
95
- `+N.comment;else M.comment=N.comment;let p=new sH.Pair(M,x);if(z.options.keepSourceTokens)p.srcToken=D;if(Q){let C=U;if(tH.mapIncludes(z,C.items,M))Z(S,"DUPLICATE_KEY","Map keys must be unique");C.items.push(p)}else{let C=new m9.YAMLMap(z.schema);C.flow=!0,C.items.push(p);let G$=(x??M).range;C.range=[M.range[0],G$[1],G$[2]],U.items.push(C)}Y=x?x.range[2]:N.end}}let W=Q?"}":"]",[L,..._]=X.end,T=Y;if(L?.source===W)T=L.offset+L.source.length;else{let V=J[0].toUpperCase()+J.substring(1),D=B?`${V} must end with a ${W}`:`${V} in block collection must be sufficiently indented and end with a ${W}`;if(Z(Y,B?"MISSING_CHAR":"BAD_INDENT",D),L&&L.source.length!==1)_.unshift(L)}if(_.length>0){let V=nH.resolveEnd(_,T,z.options.strict,Z);if(V.comment)if(U.comment)U.comment+=`
96
- `+V.comment;else U.comment=V.comment;U.range=[X.offset,T,V.offset]}else U.range=[X.offset,T,T];return U}$3.resolveFlowCollection=eH});var l9=I((Y3)=>{var z3=A(),X3=y(),Z3=z0(),H3=X0(),Q3=v9(),J3=u9(),U3=p9();function V1($,q,z,X,Z,H){let Q=z.type==="block-map"?Q3.resolveBlockMap($,q,z,X,H):z.type==="block-seq"?J3.resolveBlockSeq($,q,z,X,H):U3.resolveFlowCollection($,q,z,X,H),J=Q.constructor;if(Z==="!"||Z===J.tagName)return Q.tag=J.tagName,Q;if(Z)Q.tag=Z;return Q}function G3($,q,z,X,Z){let H=X.tag,Q=!H?null:q.directives.tagName(H.source,(W)=>Z(H,"TAG_RESOLVE_FAILED",W));if(z.type==="block-seq"){let{anchor:W,newlineAfterProp:L}=X,_=W&&H?W.offset>H.offset?W:H:W??H;if(_&&(!L||L.offset<_.offset))Z(_,"MISSING_CHAR","Missing newline after block sequence props")}let J=z.type==="block-map"?"map":z.type==="block-seq"?"seq":z.start.source==="{"?"map":"seq";if(!H||!Q||Q==="!"||Q===Z3.YAMLMap.tagName&&J==="map"||Q===H3.YAMLSeq.tagName&&J==="seq")return V1($,q,z,Z,Q);let G=q.schema.tags.find((W)=>W.tag===Q&&W.collection===J);if(!G){let W=q.schema.knownTags[Q];if(W?.collection===J)q.schema.tags.push(Object.assign({},W,{default:!1})),G=W;else{if(W)Z(H,"BAD_COLLECTION_TYPE",`${W.tag} used for ${J} collection, but expects ${W.collection??"scalar"}`,!0);else Z(H,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,!0);return V1($,q,z,Z,Q)}}let U=V1($,q,z,Z,Q,G),B=G.resolve?.(U,(W)=>Z(H,"TAG_RESOLVE_FAILED",W),q.options)??U,Y=z3.isNode(B)?B:new X3.Scalar(B);if(Y.range=U.range,Y.tag=Q,G?.format)Y.format=G.format;return Y}Y3.composeCollection=G3});var I1=I((V3)=>{var _1=y();function W3($,q,z){let X=q.offset,Z=T3(q,$.options.strict,z);if(!Z)return{value:"",type:null,comment:"",range:[X,X,X]};let H=Z.mode===">"?_1.Scalar.BLOCK_FOLDED:_1.Scalar.BLOCK_LITERAL,Q=q.source?L3(q.source):[],J=Q.length;for(let T=Q.length-1;T>=0;--T){let V=Q[T][1];if(V===""||V==="\r")J=T;else break}if(J===0){let T=Z.chomp==="+"&&Q.length>0?`
97
- `.repeat(Math.max(1,Q.length-1)):"",V=X+Z.length;if(q.source)V+=q.source.length;return{value:T,type:H,comment:Z.comment,range:[X,V,V]}}let G=q.indent+Z.indent,U=q.offset+Z.length,B=0;for(let T=0;T<J;++T){let[V,D]=Q[T];if(D===""||D==="\r"){if(Z.indent===0&&V.length>G)G=V.length}else{if(V.length<G)z(U+V.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(Z.indent===0)G=V.length;if(B=T,G===0&&!$.atRoot)z(U,"BAD_INDENT","Block scalar values in collections must be indented");break}U+=V.length+D.length+1}for(let T=Q.length-1;T>=J;--T)if(Q[T][0].length>G)J=T+1;let Y="",W="",L=!1;for(let T=0;T<B;++T)Y+=Q[T][0].slice(G)+`
98
- `;for(let T=B;T<J;++T){let[V,D]=Q[T];U+=V.length+D.length+1;let R=D[D.length-1]==="\r";if(R)D=D.slice(0,-1);if(D&&V.length<G){let K=`Block scalar lines must not be less indented than their ${Z.indent?"explicit indentation indicator":"first line"}`;z(U-D.length-(R?2:1),"BAD_INDENT",K),V=""}if(H===_1.Scalar.BLOCK_LITERAL)Y+=W+V.slice(G)+D,W=`
99
- `;else if(V.length>G||D[0]==="\t"){if(W===" ")W=`
100
- `;else if(!L&&W===`
101
- `)W=`
102
-
103
- `;Y+=W+V.slice(G)+D,W=`
104
- `,L=!0}else if(D==="")if(W===`
105
- `)Y+=`
106
- `;else W=`
107
- `;else Y+=W+D,W=" ",L=!1}switch(Z.chomp){case"-":break;case"+":for(let T=J;T<Q.length;++T)Y+=`
108
- `+Q[T][0].slice(G);if(Y[Y.length-1]!==`
109
- `)Y+=`
110
- `;break;default:Y+=`
111
- `}let _=X+Z.length+q.source.length;return{value:Y,type:H,comment:Z.comment,range:[X,_,_]}}function T3({offset:$,props:q},z,X){if(q[0].type!=="block-scalar-header")return X(q[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:Z}=q[0],H=Z[0],Q=0,J="",G=-1;for(let W=1;W<Z.length;++W){let L=Z[W];if(!J&&(L==="-"||L==="+"))J=L;else{let _=Number(L);if(!Q&&_)Q=_;else if(G===-1)G=$+W}}if(G!==-1)X(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${Z}`);let U=!1,B="",Y=Z.length;for(let W=1;W<q.length;++W){let L=q[W];switch(L.type){case"space":U=!0;case"newline":Y+=L.source.length;break;case"comment":if(z&&!U)X(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");Y+=L.source.length,B=L.source.substring(1);break;case"error":X(L,"UNEXPECTED_TOKEN",L.message),Y+=L.source.length;break;default:{let _=`Unexpected token in block scalar header: ${L.type}`;X(L,"UNEXPECTED_TOKEN",_);let T=L.source;if(T&&typeof T==="string")Y+=T.length}}}return{mode:H,indent:Q,chomp:J,comment:B,length:Y}}function L3($){let q=$.split(/\n( *)/),z=q[0],X=z.match(/^( *)/),H=[X?.[1]?[X[1],z.slice(X[1].length)]:["",z]];for(let Q=1;Q<q.length;Q+=2)H.push([q[Q],q[Q+1]]);return H}V3.resolveBlockScalar=W3});var R1=I((F3)=>{var D1=y(),I3=A0();function D3($,q,z){let{offset:X,type:Z,source:H,end:Q}=$,J,G,U=(W,L,_)=>z(X+W,L,_);switch(Z){case"scalar":J=D1.Scalar.PLAIN,G=R3(H,U);break;case"single-quoted-scalar":J=D1.Scalar.QUOTE_SINGLE,G=M3(H,U);break;case"double-quoted-scalar":J=D1.Scalar.QUOTE_DOUBLE,G=w3(H,U);break;default:return z($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${Z}`),{value:"",type:null,comment:"",range:[X,X+H.length,X+H.length]}}let B=X+H.length,Y=I3.resolveEnd(Q,B,q,z);return{value:G,type:J,comment:Y.comment,range:[X,B,Y.offset]}}function R3($,q){let z="";switch($[0]){case"\t":z="a tab character";break;case",":z="flow indicator character ,";break;case"%":z="directive indicator character %";break;case"|":case">":{z=`block scalar indicator ${$[0]}`;break}case"@":case"`":{z=`reserved character ${$[0]}`;break}}if(z)q(0,"BAD_SCALAR_START",`Plain value cannot start with ${z}`);return c9($)}function M3($,q){if($[$.length-1]!=="'"||$.length===1)q($.length,"MISSING_CHAR","Missing closing 'quote");return c9($.slice(1,-1)).replace(/''/g,"'")}function c9($){let q,z;try{q=new RegExp(`(.*?)(?<![ ])[ ]*\r?
112
- `,"sy"),z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
113
- `,"sy")}catch{q=/(.*?)[ \t]*\r?\n/sy,z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let X=q.exec($);if(!X)return $;let Z=X[1],H=" ",Q=q.lastIndex;z.lastIndex=Q;while(X=z.exec($)){if(X[1]==="")if(H===`
114
- `)Z+=H;else H=`
115
- `;else Z+=H+X[1],H=" ";Q=z.lastIndex}let J=/[ \t]*(.*)/sy;return J.lastIndex=Q,X=J.exec($),Z+H+(X?.[1]??"")}function w3($,q){let z="";for(let X=1;X<$.length-1;++X){let Z=$[X];if(Z==="\r"&&$[X+1]===`
116
- `)continue;if(Z===`
117
- `){let{fold:H,offset:Q}=P3($,X);z+=H,X=Q}else if(Z==="\\"){let H=$[++X],Q=K3[H];if(Q)z+=Q;else if(H===`
118
- `){H=$[X+1];while(H===" "||H==="\t")H=$[++X+1]}else if(H==="\r"&&$[X+1]===`
119
- `){H=$[++X+1];while(H===" "||H==="\t")H=$[++X+1]}else if(H==="x"||H==="u"||H==="U"){let J={x:2,u:4,U:8}[H];z+=O3($,X+1,J,q),X+=J}else{let J=$.substr(X-1,2);q(X-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),z+=J}}else if(Z===" "||Z==="\t"){let H=X,Q=$[X+1];while(Q===" "||Q==="\t")Q=$[++X+1];if(Q!==`
120
- `&&!(Q==="\r"&&$[X+2]===`
121
- `))z+=X>H?$.slice(H,X+1):Z}else z+=Z}if($[$.length-1]!=='"'||$.length===1)q($.length,"MISSING_CHAR",'Missing closing "quote');return z}function P3($,q){let z="",X=$[q+1];while(X===" "||X==="\t"||X===`
122
- `||X==="\r"){if(X==="\r"&&$[q+2]!==`
123
- `)break;if(X===`
124
- `)z+=`
125
- `;q+=1,X=$[q+1]}if(!z)z=" ";return{fold:z,offset:q}}var K3={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
126
- `,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function O3($,q,z,X){let Z=$.substr(q,z),Q=Z.length===z&&/^[0-9a-fA-F]+$/.test(Z)?parseInt(Z,16):NaN;if(isNaN(Q)){let J=$.substr(q-2,z+2);return X(q-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${J}`),J}return String.fromCodePoint(Q)}F3.resolveFlowScalar=D3});var a9=I((C3)=>{var B0=A(),i9=y(),j3=I1(),S3=R1();function N3($,q,z,X){let{value:Z,type:H,comment:Q,range:J}=q.type==="block-scalar"?j3.resolveBlockScalar($,q,X):S3.resolveFlowScalar(q,$.options.strict,X),G=z?$.directives.tagName(z.source,(Y)=>X(z,"TAG_RESOLVE_FAILED",Y)):null,U;if($.options.stringKeys&&$.atKey)U=$.schema[B0.SCALAR];else if(G)U=E3($.schema,Z,G,z,X);else if(q.type==="scalar")U=b3($,Z,q,X);else U=$.schema[B0.SCALAR];let B;try{let Y=U.resolve(Z,(W)=>X(z??q,"TAG_RESOLVE_FAILED",W),$.options);B=B0.isScalar(Y)?Y:new i9.Scalar(Y)}catch(Y){let W=Y instanceof Error?Y.message:String(Y);X(z??q,"TAG_RESOLVE_FAILED",W),B=new i9.Scalar(Z)}if(B.range=J,B.source=Z,H)B.type=H;if(G)B.tag=G;if(U.format)B.format=U.format;if(Q)B.comment=Q;return B}function E3($,q,z,X,Z){if(z==="!")return $[B0.SCALAR];let H=[];for(let J of $.tags)if(!J.collection&&J.tag===z)if(J.default&&J.test)H.push(J);else return J;for(let J of H)if(J.test?.test(q))return J;let Q=$.knownTags[z];if(Q&&!Q.collection)return $.tags.push(Object.assign({},Q,{default:!1,test:void 0})),Q;return Z(X,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,z!=="tag:yaml.org,2002:str"),$[B0.SCALAR]}function b3({atKey:$,directives:q,schema:z},X,Z,H){let Q=z.tags.find((J)=>(J.default===!0||$&&J.default==="key")&&J.test?.test(X))||z[B0.SCALAR];if(z.compat){let J=z.compat.find((G)=>G.default&&G.test?.test(X))??z[B0.SCALAR];if(Q.tag!==J.tag){let G=q.tagString(Q.tag),U=q.tagString(J.tag),B=`Value may be parsed as either ${G} or ${U}`;H(Z,"TAG_RESOLVE_FAILED",B,!0)}}return Q}C3.composeScalar=N3});var s9=I((k3)=>{function f3($,q,z){if(q){z??(z=q.length);for(let X=z-1;X>=0;--X){let Z=q[X];switch(Z.type){case"space":case"comment":case"newline":$-=Z.source.length;continue}Z=q[++X];while(Z?.type==="space")$+=Z.source.length,Z=q[++X];break}}return $}k3.emptyScalarPosition=f3});var o9=I((l3)=>{var h3=h0(),g3=A(),v3=l9(),r9=a9(),u3=A0(),m3=s9(),d3={composeNode:n9,composeEmptyNode:M1};function n9($,q,z,X){let Z=$.atKey,{spaceBefore:H,comment:Q,anchor:J,tag:G}=z,U,B=!0;switch(q.type){case"alias":if(U=p3($,q,X),J||G)X(q,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(U=r9.composeScalar($,q,G,X),J)U.anchor=J.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(U=v3.composeCollection(d3,$,q,z,X),J)U.anchor=J.source.substring(1);break;default:{let Y=q.type==="error"?q.message:`Unsupported token (type: ${q.type})`;X(q,"UNEXPECTED_TOKEN",Y),U=M1($,q.offset,void 0,null,z,X),B=!1}}if(J&&U.anchor==="")X(J,"BAD_ALIAS","Anchor cannot be an empty string");if(Z&&$.options.stringKeys&&(!g3.isScalar(U)||typeof U.value!=="string"||U.tag&&U.tag!=="tag:yaml.org,2002:str"))X(G??q,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(H)U.spaceBefore=!0;if(Q)if(q.type==="scalar"&&q.source==="")U.comment=Q;else U.commentBefore=Q;if($.options.keepSourceTokens&&B)U.srcToken=q;return U}function M1($,q,z,X,{spaceBefore:Z,comment:H,anchor:Q,tag:J,end:G},U){let B={type:"scalar",offset:m3.emptyScalarPosition(q,z,X),indent:-1,source:""},Y=r9.composeScalar($,B,J,U);if(Q){if(Y.anchor=Q.source.substring(1),Y.anchor==="")U(Q,"BAD_ALIAS","Anchor cannot be an empty string")}if(Z)Y.spaceBefore=!0;if(H)Y.comment=H,Y.range[2]=G;return Y}function p3({options:$},{offset:q,source:z,end:X},Z){let H=new h3.Alias(z.substring(1));if(H.source==="")Z(q,"BAD_ALIAS","Alias cannot be an empty string");if(H.source.endsWith(":"))Z(q+z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let Q=q+z.length,J=u3.resolveEnd(X,Q,$.strict,Z);if(H.range=[q,Q,J.offset],J.comment)H.comment=J.comment;return H}l3.composeEmptyNode=M1;l3.composeNode=n9});var e9=I((o3)=>{var a3=t0(),t9=o9(),s3=A0(),r3=$$();function n3($,q,{offset:z,start:X,value:Z,end:H},Q){let J=Object.assign({_directives:q},$),G=new a3.Document(void 0,J),U={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},B=r3.resolveProps(X,{indicator:"doc-start",next:Z??H?.[0],offset:z,onError:Q,parentIndent:0,startOnNewline:!0});if(B.found){if(G.directives.docStart=!0,Z&&(Z.type==="block-map"||Z.type==="block-seq")&&!B.hasNewline)Q(B.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=Z?t9.composeNode(U,Z,B,Q):t9.composeEmptyNode(U,B.end,X,null,B,Q);let Y=G.contents.range[2],W=s3.resolveEnd(H,Y,!1,Q);if(W.comment)G.comment=W.comment;return G.range=[z,Y,W.offset],G}o3.composeDoc=n3});var w1=I((ZQ)=>{var e3=a("process"),$Q=Fq(),qQ=t0(),q$=e0(),$4=A(),zQ=e9(),XQ=A0();function z$($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:q,source:z}=$;return[q,q+(typeof z==="string"?z.length:1)]}function q4($){let q="",z=!1,X=!1;for(let Z=0;Z<$.length;++Z){let H=$[Z];switch(H[0]){case"#":q+=(q===""?"":X?`
89
+ `}};iG.YAMLError=s1;iG.YAMLParseError=C5;iG.YAMLWarning=b5;iG.prettifyError=lG});var v$=K((tG)=>{function oG($,{flow:X,indicator:Z,next:q,offset:z,onError:G,parentIndent:J,startOnNewline:Q}){let Y=!1,U=Q,W=Q,H="",V="",w=!1,B=!1,T=null,L=null,D=null,_=null,O=null,I=null,R=null;for(let F of $){if(B){if(F.type!=="space"&&F.type!=="newline"&&F.type!=="comma")G(F.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");B=!1}if(T){if(U&&F.type!=="comment"&&F.type!=="newline")G(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");T=null}switch(F.type){case"space":if(!X&&(Z!=="doc-start"||q?.type!=="flow-collection")&&F.source.includes("\t"))T=F;W=!0;break;case"comment":{if(!W)G(F,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let y=F.source.substring(1)||" ";if(!H)H=y;else H+=V+y;V="",U=!1;break}case"newline":if(U){if(H)H+=F.source;else if(!I||Z!=="seq-item-ind")Y=!0}else V+=F.source;if(U=!0,w=!0,L||D)_=F;W=!0;break;case"anchor":if(L)G(F,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(F.source.endsWith(":"))G(F.offset+F.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);L=F,R??(R=F.offset),U=!1,W=!1,B=!0;break;case"tag":{if(D)G(F,"MULTIPLE_TAGS","A node can have at most one tag");D=F,R??(R=F.offset),U=!1,W=!1,B=!0;break}case Z:if(L||D)G(F,"BAD_PROP_ORDER",`Anchors and tags must be after the ${F.source} indicator`);if(I)G(F,"UNEXPECTED_TOKEN",`Unexpected ${F.source} in ${X??"collection"}`);I=F,U=Z==="seq-item-ind"||Z==="explicit-key-ind",W=!1;break;case"comma":if(X){if(O)G(F,"UNEXPECTED_TOKEN",`Unexpected , in ${X}`);O=F,U=!1,W=!1;break}default:G(F,"UNEXPECTED_TOKEN",`Unexpected ${F.type} token`),U=!1,W=!1}}let N=$[$.length-1],C=N?N.offset+N.source.length:z;if(B&&q&&q.type!=="space"&&q.type!=="newline"&&q.type!=="comma"&&(q.type!=="scalar"||q.source!==""))G(q.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(T&&(U&&T.indent<=J||q?.type==="block-map"||q?.type==="block-seq"))G(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:O,found:I,spaceBefore:Y,comment:H,hasNewline:w,anchor:L,tag:D,newlineAfterProp:_,end:C,start:R??C}}tG.resolveProps=oG});var n1=K(($J)=>{function m9($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
90
+ `))return!0;if($.end){for(let X of $.end)if(X.type==="newline")return!0}return!1;case"flow-collection":for(let X of $.items){for(let Z of X.start)if(Z.type==="newline")return!0;if(X.sep){for(let Z of X.sep)if(Z.type==="newline")return!0}if(m9(X.key)||m9(X.value))return!0}return!1;default:return!0}}$J.containsNewline=m9});var d9=K((zJ)=>{var ZJ=n1();function qJ($,X,Z){if(X?.type==="flow-collection"){let q=X.end[0];if(q.indent===$&&(q.source==="]"||q.source==="}")&&ZJ.containsNewline(X))Z(q,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}zJ.flowIndentCheck=qJ});var p9=K((QJ)=>{var y5=j();function JJ($,X,Z){let{uniqueKeys:q}=$.options;if(q===!1)return!1;let z=typeof q==="function"?q:(G,J)=>G===J||y5.isScalar(G)&&y5.isScalar(J)&&G.value===J.value;return X.some((G)=>z(G.key,Z))}QJ.mapIncludes=JJ});var h5=K((TJ)=>{var x5=D0(),UJ=F0(),f5=v$(),HJ=n1(),k5=d9(),WJ=p9(),g5="All mapping items must start at the same column";function VJ({composeNode:$,composeEmptyNode:X},Z,q,z,G){let Q=new(G?.nodeClass??UJ.YAMLMap)(Z.schema);if(Z.atRoot)Z.atRoot=!1;let Y=q.offset,U=null;for(let W of q.items){let{start:H,key:V,sep:w,value:B}=W,T=f5.resolveProps(H,{indicator:"explicit-key-ind",next:V??w?.[0],offset:Y,onError:z,parentIndent:q.indent,startOnNewline:!0}),L=!T.found;if(L){if(V){if(V.type==="block-seq")z(Y,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in V&&V.indent!==q.indent)z(Y,"BAD_INDENT",g5)}if(!T.anchor&&!T.tag&&!w){if(U=T.end,T.comment)if(Q.comment)Q.comment+=`
91
+ `+T.comment;else Q.comment=T.comment;continue}if(T.newlineAfterProp||HJ.containsNewline(V))z(V??H[H.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(T.found?.indent!==q.indent)z(Y,"BAD_INDENT",g5);Z.atKey=!0;let D=T.end,_=V?$(Z,V,T,z):X(Z,D,H,null,T,z);if(Z.schema.compat)k5.flowIndentCheck(q.indent,V,z);if(Z.atKey=!1,WJ.mapIncludes(Z,Q.items,_))z(D,"DUPLICATE_KEY","Map keys must be unique");let O=f5.resolveProps(w??[],{indicator:"map-value-ind",next:B,offset:_.range[2],onError:z,parentIndent:q.indent,startOnNewline:!V||V.type==="block-scalar"});if(Y=O.end,O.found){if(L){if(B?.type==="block-map"&&!O.hasNewline)z(Y,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Z.options.strict&&T.start<O.found.offset-1024)z(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let I=B?$(Z,B,O,z):X(Z,Y,w,null,O,z);if(Z.schema.compat)k5.flowIndentCheck(q.indent,B,z);Y=I.range[2];let R=new x5.Pair(_,I);if(Z.options.keepSourceTokens)R.srcToken=W;Q.items.push(R)}else{if(L)z(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(O.comment)if(_.comment)_.comment+=`
92
+ `+O.comment;else _.comment=O.comment;let I=new x5.Pair(_);if(Z.options.keepSourceTokens)I.srcToken=W;Q.items.push(I)}}if(U&&U<Y)z(U,"IMPOSSIBLE","Map comment with trailing content");return Q.range=[q.offset,Y,U??Y],Q}TJ.resolveBlockMap=VJ});var v5=K((_J)=>{var LJ=O0(),BJ=v$(),KJ=d9();function DJ({composeNode:$,composeEmptyNode:X},Z,q,z,G){let Q=new(G?.nodeClass??LJ.YAMLSeq)(Z.schema);if(Z.atRoot)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let Y=q.offset,U=null;for(let{start:W,value:H}of q.items){let V=BJ.resolveProps(W,{indicator:"seq-item-ind",next:H,offset:Y,onError:z,parentIndent:q.indent,startOnNewline:!0});if(!V.found)if(V.anchor||V.tag||H)if(H?.type==="block-seq")z(V.end,"BAD_INDENT","All sequence items must start at the same column");else z(Y,"MISSING_CHAR","Sequence item without - indicator");else{if(U=V.end,V.comment)Q.comment=V.comment;continue}let w=H?$(Z,H,V,z):X(Z,V.end,W,null,V,z);if(Z.schema.compat)KJ.flowIndentCheck(q.indent,H,z);Y=w.range[2],Q.items.push(w)}return Q.range=[q.offset,Y,U??Y],Q}_J.resolveBlockSeq=DJ});var $$=K((MJ)=>{function OJ($,X,Z,q){let z="";if($){let G=!1,J="";for(let Q of $){let{source:Y,type:U}=Q;switch(U){case"space":G=!0;break;case"comment":{if(Z&&!G)q(Q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let W=Y.substring(1)||" ";if(!z)z=W;else z+=J+W;J="";break}case"newline":if(z)J+=Y;G=!0;break;default:q(Q,"UNEXPECTED_TOKEN",`Unexpected ${U} at node end`)}X+=Y.length}}return{comment:z,offset:X}}MJ.resolveEnd=OJ});var d5=K((CJ)=>{var RJ=j(),PJ=D0(),u5=F0(),NJ=O0(),AJ=$$(),m5=v$(),SJ=n1(),jJ=p9(),c9="Block collections are not allowed within flow collections",l9=($)=>$&&($.type==="block-map"||$.type==="block-seq");function EJ({composeNode:$,composeEmptyNode:X},Z,q,z,G){let J=q.start.source==="{",Q=J?"flow map":"flow sequence",U=new(G?.nodeClass??(J?u5.YAMLMap:NJ.YAMLSeq))(Z.schema);U.flow=!0;let W=Z.atRoot;if(W)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let H=q.offset+q.start.source.length;for(let L=0;L<q.items.length;++L){let D=q.items[L],{start:_,key:O,sep:I,value:R}=D,N=m5.resolveProps(_,{flow:Q,indicator:"explicit-key-ind",next:O??I?.[0],offset:H,onError:z,parentIndent:q.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!I&&!R){if(L===0&&N.comma)z(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Q}`);else if(L<q.items.length-1)z(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${Q}`);if(N.comment)if(U.comment)U.comment+=`
93
+ `+N.comment;else U.comment=N.comment;H=N.end;continue}if(!J&&Z.options.strict&&SJ.containsNewline(O))z(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(L===0){if(N.comma)z(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Q}`)}else{if(!N.comma)z(N.start,"MISSING_CHAR",`Missing , between ${Q} items`);if(N.comment){let C="";$:for(let F of _)switch(F.type){case"comma":case"space":break;case"comment":C=F.source.substring(1);break $;default:break $}if(C){let F=U.items[U.items.length-1];if(RJ.isPair(F))F=F.value??F.key;if(F.comment)F.comment+=`
94
+ `+C;else F.comment=C;N.comment=N.comment.substring(C.length+1)}}}if(!J&&!I&&!N.found){let C=R?$(Z,R,N,z):X(Z,N.end,I,null,N,z);if(U.items.push(C),H=C.range[2],l9(R))z(C.range,"BLOCK_IN_FLOW",c9)}else{Z.atKey=!0;let C=N.end,F=O?$(Z,O,N,z):X(Z,C,_,null,N,z);if(l9(O))z(F.range,"BLOCK_IN_FLOW",c9);Z.atKey=!1;let y=m5.resolveProps(I??[],{flow:Q,indicator:"map-value-ind",next:R,offset:F.range[2],onError:z,parentIndent:q.indent,startOnNewline:!1});if(y.found){if(!J&&!N.found&&Z.options.strict){if(I)for(let k of I){if(k===y.found)break;if(k.type==="newline"){z(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(N.start<y.found.offset-1024)z(y.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(R)if("source"in R&&R.source?.[0]===":")z(R,"MISSING_CHAR",`Missing space after : in ${Q}`);else z(y.start,"MISSING_CHAR",`Missing , or : between ${Q} items`);let a=R?$(Z,R,y,z):y.found?X(Z,y.end,I,null,y,z):null;if(a){if(l9(R))z(a.range,"BLOCK_IN_FLOW",c9)}else if(y.comment)if(F.comment)F.comment+=`
95
+ `+y.comment;else F.comment=y.comment;let q0=new PJ.Pair(F,a);if(Z.options.keepSourceTokens)q0.srcToken=D;if(J){let k=U;if(jJ.mapIncludes(Z,k.items,F))z(C,"DUPLICATE_KEY","Map keys must be unique");k.items.push(q0)}else{let k=new u5.YAMLMap(Z.schema);k.flow=!0,k.items.push(q0);let V1=(a??F).range;k.range=[F.range[0],V1[1],V1[2]],U.items.push(k)}H=a?a.range[2]:y.end}}let V=J?"}":"]",[w,...B]=q.end,T=H;if(w?.source===V)T=w.offset+w.source.length;else{let L=Q[0].toUpperCase()+Q.substring(1),D=W?`${L} must end with a ${V}`:`${L} in block collection must be sufficiently indented and end with a ${V}`;if(z(H,W?"MISSING_CHAR":"BAD_INDENT",D),w&&w.source.length!==1)B.unshift(w)}if(B.length>0){let L=AJ.resolveEnd(B,T,Z.options.strict,z);if(L.comment)if(U.comment)U.comment+=`
96
+ `+L.comment;else U.comment=L.comment;U.range=[q.offset,T,L.offset]}else U.range=[q.offset,T,T];return U}CJ.resolveFlowCollection=EJ});var p5=K((mJ)=>{var yJ=j(),xJ=g(),fJ=F0(),kJ=O0(),gJ=h5(),hJ=v5(),vJ=d5();function i9($,X,Z,q,z,G){let J=Z.type==="block-map"?gJ.resolveBlockMap($,X,Z,q,G):Z.type==="block-seq"?hJ.resolveBlockSeq($,X,Z,q,G):vJ.resolveFlowCollection($,X,Z,q,G),Q=J.constructor;if(z==="!"||z===Q.tagName)return J.tag=Q.tagName,J;if(z)J.tag=z;return J}function uJ($,X,Z,q,z){let G=q.tag,J=!G?null:X.directives.tagName(G.source,(V)=>z(G,"TAG_RESOLVE_FAILED",V));if(Z.type==="block-seq"){let{anchor:V,newlineAfterProp:w}=q,B=V&&G?V.offset>G.offset?V:G:V??G;if(B&&(!w||w.offset<B.offset))z(B,"MISSING_CHAR","Missing newline after block sequence props")}let Q=Z.type==="block-map"?"map":Z.type==="block-seq"?"seq":Z.start.source==="{"?"map":"seq";if(!G||!J||J==="!"||J===fJ.YAMLMap.tagName&&Q==="map"||J===kJ.YAMLSeq.tagName&&Q==="seq")return i9($,X,Z,z,J);let Y=X.schema.tags.find((V)=>V.tag===J&&V.collection===Q);if(!Y){let V=X.schema.knownTags[J];if(V?.collection===Q)X.schema.tags.push(Object.assign({},V,{default:!1})),Y=V;else{if(V)z(G,"BAD_COLLECTION_TYPE",`${V.tag} used for ${Q} collection, but expects ${V.collection??"scalar"}`,!0);else z(G,"TAG_RESOLVE_FAILED",`Unresolved tag: ${J}`,!0);return i9($,X,Z,z,J)}}let U=i9($,X,Z,z,J,Y),W=Y.resolve?.(U,(V)=>z(G,"TAG_RESOLVE_FAILED",V),X.options)??U,H=yJ.isNode(W)?W:new xJ.Scalar(W);if(H.range=U.range,H.tag=J,Y?.format)H.format=Y.format;return H}mJ.composeCollection=uJ});var s9=K((iJ)=>{var a9=g();function pJ($,X,Z){let q=X.offset,z=cJ(X,$.options.strict,Z);if(!z)return{value:"",type:null,comment:"",range:[q,q,q]};let G=z.mode===">"?a9.Scalar.BLOCK_FOLDED:a9.Scalar.BLOCK_LITERAL,J=X.source?lJ(X.source):[],Q=J.length;for(let T=J.length-1;T>=0;--T){let L=J[T][1];if(L===""||L==="\r")Q=T;else break}if(Q===0){let T=z.chomp==="+"&&J.length>0?`
97
+ `.repeat(Math.max(1,J.length-1)):"",L=q+z.length;if(X.source)L+=X.source.length;return{value:T,type:G,comment:z.comment,range:[q,L,L]}}let Y=X.indent+z.indent,U=X.offset+z.length,W=0;for(let T=0;T<Q;++T){let[L,D]=J[T];if(D===""||D==="\r"){if(z.indent===0&&L.length>Y)Y=L.length}else{if(L.length<Y)Z(U+L.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(z.indent===0)Y=L.length;if(W=T,Y===0&&!$.atRoot)Z(U,"BAD_INDENT","Block scalar values in collections must be indented");break}U+=L.length+D.length+1}for(let T=J.length-1;T>=Q;--T)if(J[T][0].length>Y)Q=T+1;let H="",V="",w=!1;for(let T=0;T<W;++T)H+=J[T][0].slice(Y)+`
98
+ `;for(let T=W;T<Q;++T){let[L,D]=J[T];U+=L.length+D.length+1;let _=D[D.length-1]==="\r";if(_)D=D.slice(0,-1);if(D&&L.length<Y){let I=`Block scalar lines must not be less indented than their ${z.indent?"explicit indentation indicator":"first line"}`;Z(U-D.length-(_?2:1),"BAD_INDENT",I),L=""}if(G===a9.Scalar.BLOCK_LITERAL)H+=V+L.slice(Y)+D,V=`
99
+ `;else if(L.length>Y||D[0]==="\t"){if(V===" ")V=`
100
+ `;else if(!w&&V===`
101
+ `)V=`
102
+
103
+ `;H+=V+L.slice(Y)+D,V=`
104
+ `,w=!0}else if(D==="")if(V===`
105
+ `)H+=`
106
+ `;else V=`
107
+ `;else H+=V+D,V=" ",w=!1}switch(z.chomp){case"-":break;case"+":for(let T=Q;T<J.length;++T)H+=`
108
+ `+J[T][0].slice(Y);if(H[H.length-1]!==`
109
+ `)H+=`
110
+ `;break;default:H+=`
111
+ `}let B=q+z.length+X.source.length;return{value:H,type:G,comment:z.comment,range:[q,B,B]}}function cJ({offset:$,props:X},Z,q){if(X[0].type!=="block-scalar-header")return q(X[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:z}=X[0],G=z[0],J=0,Q="",Y=-1;for(let V=1;V<z.length;++V){let w=z[V];if(!Q&&(w==="-"||w==="+"))Q=w;else{let B=Number(w);if(!J&&B)J=B;else if(Y===-1)Y=$+V}}if(Y!==-1)q(Y,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${z}`);let U=!1,W="",H=z.length;for(let V=1;V<X.length;++V){let w=X[V];switch(w.type){case"space":U=!0;case"newline":H+=w.source.length;break;case"comment":if(Z&&!U)q(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");H+=w.source.length,W=w.source.substring(1);break;case"error":q(w,"UNEXPECTED_TOKEN",w.message),H+=w.source.length;break;default:{let B=`Unexpected token in block scalar header: ${w.type}`;q(w,"UNEXPECTED_TOKEN",B);let T=w.source;if(T&&typeof T==="string")H+=T.length}}}return{mode:G,indent:J,chomp:Q,comment:W,length:H}}function lJ($){let X=$.split(/\n( *)/),Z=X[0],q=Z.match(/^( *)/),G=[q?.[1]?[q[1],Z.slice(q[1].length)]:["",Z]];for(let J=1;J<X.length;J+=2)G.push([X[J],X[J+1]]);return G}iJ.resolveBlockScalar=pJ});var r9=K((ZQ)=>{var n9=g(),sJ=$$();function nJ($,X,Z){let{offset:q,type:z,source:G,end:J}=$,Q,Y,U=(V,w,B)=>Z(q+V,w,B);switch(z){case"scalar":Q=n9.Scalar.PLAIN,Y=rJ(G,U);break;case"single-quoted-scalar":Q=n9.Scalar.QUOTE_SINGLE,Y=oJ(G,U);break;case"double-quoted-scalar":Q=n9.Scalar.QUOTE_DOUBLE,Y=tJ(G,U);break;default:return Z($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${z}`),{value:"",type:null,comment:"",range:[q,q+G.length,q+G.length]}}let W=q+G.length,H=sJ.resolveEnd(J,W,X,Z);return{value:Y,type:Q,comment:H.comment,range:[q,W,H.offset]}}function rJ($,X){let Z="";switch($[0]){case"\t":Z="a tab character";break;case",":Z="flow indicator character ,";break;case"%":Z="directive indicator character %";break;case"|":case">":{Z=`block scalar indicator ${$[0]}`;break}case"@":case"`":{Z=`reserved character ${$[0]}`;break}}if(Z)X(0,"BAD_SCALAR_START",`Plain value cannot start with ${Z}`);return c5($)}function oJ($,X){if($[$.length-1]!=="'"||$.length===1)X($.length,"MISSING_CHAR","Missing closing 'quote");return c5($.slice(1,-1)).replace(/''/g,"'")}function c5($){let X,Z;try{X=new RegExp(`(.*?)(?<![ ])[ ]*\r?
112
+ `,"sy"),Z=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
113
+ `,"sy")}catch{X=/(.*?)[ \t]*\r?\n/sy,Z=/[ \t]*(.*?)[ \t]*\r?\n/sy}let q=X.exec($);if(!q)return $;let z=q[1],G=" ",J=X.lastIndex;Z.lastIndex=J;while(q=Z.exec($)){if(q[1]==="")if(G===`
114
+ `)z+=G;else G=`
115
+ `;else z+=G+q[1],G=" ";J=Z.lastIndex}let Q=/[ \t]*(.*)/sy;return Q.lastIndex=J,q=Q.exec($),z+G+(q?.[1]??"")}function tJ($,X){let Z="";for(let q=1;q<$.length-1;++q){let z=$[q];if(z==="\r"&&$[q+1]===`
116
+ `)continue;if(z===`
117
+ `){let{fold:G,offset:J}=eJ($,q);Z+=G,q=J}else if(z==="\\"){let G=$[++q],J=$Q[G];if(J)Z+=J;else if(G===`
118
+ `){G=$[q+1];while(G===" "||G==="\t")G=$[++q+1]}else if(G==="\r"&&$[q+1]===`
119
+ `){G=$[++q+1];while(G===" "||G==="\t")G=$[++q+1]}else if(G==="x"||G==="u"||G==="U"){let Q={x:2,u:4,U:8}[G];Z+=XQ($,q+1,Q,X),q+=Q}else{let Q=$.substr(q-1,2);X(q-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Q}`),Z+=Q}}else if(z===" "||z==="\t"){let G=q,J=$[q+1];while(J===" "||J==="\t")J=$[++q+1];if(J!==`
120
+ `&&!(J==="\r"&&$[q+2]===`
121
+ `))Z+=q>G?$.slice(G,q+1):z}else Z+=z}if($[$.length-1]!=='"'||$.length===1)X($.length,"MISSING_CHAR",'Missing closing "quote');return Z}function eJ($,X){let Z="",q=$[X+1];while(q===" "||q==="\t"||q===`
122
+ `||q==="\r"){if(q==="\r"&&$[X+2]!==`
123
+ `)break;if(q===`
124
+ `)Z+=`
125
+ `;X+=1,q=$[X+1]}if(!Z)Z=" ";return{fold:Z,offset:X}}var $Q={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
126
+ `,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function XQ($,X,Z,q){let z=$.substr(X,Z),J=z.length===Z&&/^[0-9a-fA-F]+$/.test(z)?parseInt(z,16):NaN;if(isNaN(J)){let Q=$.substr(X-2,Z+2);return q(X-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Q}`),Q}return String.fromCodePoint(J)}ZQ.resolveFlowScalar=nJ});var i5=K((UQ)=>{var y0=j(),l5=g(),zQ=s9(),GQ=r9();function JQ($,X,Z,q){let{value:z,type:G,comment:J,range:Q}=X.type==="block-scalar"?zQ.resolveBlockScalar($,X,q):GQ.resolveFlowScalar(X,$.options.strict,q),Y=Z?$.directives.tagName(Z.source,(H)=>q(Z,"TAG_RESOLVE_FAILED",H)):null,U;if($.options.stringKeys&&$.atKey)U=$.schema[y0.SCALAR];else if(Y)U=QQ($.schema,z,Y,Z,q);else if(X.type==="scalar")U=YQ($,z,X,q);else U=$.schema[y0.SCALAR];let W;try{let H=U.resolve(z,(V)=>q(Z??X,"TAG_RESOLVE_FAILED",V),$.options);W=y0.isScalar(H)?H:new l5.Scalar(H)}catch(H){let V=H instanceof Error?H.message:String(H);q(Z??X,"TAG_RESOLVE_FAILED",V),W=new l5.Scalar(z)}if(W.range=Q,W.source=z,G)W.type=G;if(Y)W.tag=Y;if(U.format)W.format=U.format;if(J)W.comment=J;return W}function QQ($,X,Z,q,z){if(Z==="!")return $[y0.SCALAR];let G=[];for(let Q of $.tags)if(!Q.collection&&Q.tag===Z)if(Q.default&&Q.test)G.push(Q);else return Q;for(let Q of G)if(Q.test?.test(X))return Q;let J=$.knownTags[Z];if(J&&!J.collection)return $.tags.push(Object.assign({},J,{default:!1,test:void 0})),J;return z(q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Z}`,Z!=="tag:yaml.org,2002:str"),$[y0.SCALAR]}function YQ({atKey:$,directives:X,schema:Z},q,z,G){let J=Z.tags.find((Q)=>(Q.default===!0||$&&Q.default==="key")&&Q.test?.test(q))||Z[y0.SCALAR];if(Z.compat){let Q=Z.compat.find((Y)=>Y.default&&Y.test?.test(q))??Z[y0.SCALAR];if(J.tag!==Q.tag){let Y=X.tagString(J.tag),U=X.tagString(Q.tag),W=`Value may be parsed as either ${Y} or ${U}`;G(z,"TAG_RESOLVE_FAILED",W,!0)}}return J}UQ.composeScalar=JQ});var a5=K((VQ)=>{function WQ($,X,Z){if(X){Z??(Z=X.length);for(let q=Z-1;q>=0;--q){let z=X[q];switch(z.type){case"space":case"comment":case"newline":$-=z.source.length;continue}z=X[++q];while(z?.type==="space")$+=z.source.length,z=X[++q];break}}return $}VQ.emptyScalarPosition=WQ});var r5=K((OQ)=>{var wQ=M$(),LQ=j(),BQ=p5(),s5=i5(),KQ=$$(),DQ=a5(),_Q={composeNode:n5,composeEmptyNode:o9};function n5($,X,Z,q){let z=$.atKey,{spaceBefore:G,comment:J,anchor:Q,tag:Y}=Z,U,W=!0;switch(X.type){case"alias":if(U=FQ($,X,q),Q||Y)q(X,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(U=s5.composeScalar($,X,Y,q),Q)U.anchor=Q.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(U=BQ.composeCollection(_Q,$,X,Z,q),Q)U.anchor=Q.source.substring(1);break;default:{let H=X.type==="error"?X.message:`Unsupported token (type: ${X.type})`;q(X,"UNEXPECTED_TOKEN",H),U=o9($,X.offset,void 0,null,Z,q),W=!1}}if(Q&&U.anchor==="")q(Q,"BAD_ALIAS","Anchor cannot be an empty string");if(z&&$.options.stringKeys&&(!LQ.isScalar(U)||typeof U.value!=="string"||U.tag&&U.tag!=="tag:yaml.org,2002:str"))q(Y??X,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(G)U.spaceBefore=!0;if(J)if(X.type==="scalar"&&X.source==="")U.comment=J;else U.commentBefore=J;if($.options.keepSourceTokens&&W)U.srcToken=X;return U}function o9($,X,Z,q,{spaceBefore:z,comment:G,anchor:J,tag:Q,end:Y},U){let W={type:"scalar",offset:DQ.emptyScalarPosition(X,Z,q),indent:-1,source:""},H=s5.composeScalar($,W,Q,U);if(J){if(H.anchor=J.source.substring(1),H.anchor==="")U(J,"BAD_ALIAS","Anchor cannot be an empty string")}if(z)H.spaceBefore=!0;if(G)H.comment=G,H.range[2]=Y;return H}function FQ({options:$},{offset:X,source:Z,end:q},z){let G=new wQ.Alias(Z.substring(1));if(G.source==="")z(X,"BAD_ALIAS","Alias cannot be an empty string");if(G.source.endsWith(":"))z(X+Z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let J=X+Z.length,Q=KQ.resolveEnd(q,J,$.strict,z);if(G.range=[X,J,Q.offset],Q.comment)G.comment=Q.comment;return G}OQ.composeEmptyNode=o9;OQ.composeNode=n5});var t5=K((SQ)=>{var RQ=g$(),o5=r5(),PQ=$$(),NQ=v$();function AQ($,X,{offset:Z,start:q,value:z,end:G},J){let Q=Object.assign({_directives:X},$),Y=new RQ.Document(void 0,Q),U={atKey:!1,atRoot:!0,directives:Y.directives,options:Y.options,schema:Y.schema},W=NQ.resolveProps(q,{indicator:"doc-start",next:z??G?.[0],offset:Z,onError:J,parentIndent:0,startOnNewline:!0});if(W.found){if(Y.directives.docStart=!0,z&&(z.type==="block-map"||z.type==="block-seq")&&!W.hasNewline)J(W.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}Y.contents=z?o5.composeNode(U,z,W,J):o5.composeEmptyNode(U,W.end,q,null,W,J);let H=Y.contents.range[2],V=PQ.resolveEnd(G,H,!1,J);if(V.comment)Y.comment=V.comment;return Y.range=[Z,H,V.offset],Y}SQ.composeDoc=AQ});var t9=K((fQ)=>{var EQ=Q0("process"),CQ=Z9(),bQ=g$(),u$=h$(),e5=j(),yQ=t5(),xQ=$$();function m$($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:X,source:Z}=$;return[X,X+(typeof Z==="string"?Z.length:1)]}function $8($){let X="",Z=!1,q=!1;for(let z=0;z<$.length;++z){let G=$[z];switch(G[0]){case"#":X+=(X===""?"":q?`
127
127
 
128
128
  `:`
129
- `)+(H.substring(1)||" "),z=!0,X=!1;break;case"%":if($[Z+1]?.[0]!=="#")Z+=1;z=!1;break;default:if(!z)X=!0;z=!1}}return{comment:q,afterEmptyLine:X}}class z4{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(q,z,X,Z)=>{let H=z$(q);if(Z)this.warnings.push(new q$.YAMLWarning(H,z,X));else this.errors.push(new q$.YAMLParseError(H,z,X))},this.directives=new $Q.Directives({version:$.version||"1.2"}),this.options=$}decorate($,q){let{comment:z,afterEmptyLine:X}=q4(this.prelude);if(z){let Z=$.contents;if(q)$.comment=$.comment?`${$.comment}
130
- ${z}`:z;else if(X||$.directives.docStart||!Z)$.commentBefore=z;else if($4.isCollection(Z)&&!Z.flow&&Z.items.length>0){let H=Z.items[0];if($4.isPair(H))H=H.key;let Q=H.commentBefore;H.commentBefore=Q?`${z}
131
- ${Q}`:z}else{let H=Z.commentBefore;Z.commentBefore=H?`${z}
132
- ${H}`:z}}if(q)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:q4(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,q=!1,z=-1){for(let X of $)yield*this.next(X);yield*this.end(q,z)}*next($){if(e3.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(q,z,X)=>{let Z=z$($);Z[0]+=q,this.onError(Z,"BAD_DIRECTIVE",z,X)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let q=zQ.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!q.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(q,!1),this.doc)yield this.doc;this.doc=q,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let q=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,z=new q$.YAMLParseError(z$($),"UNEXPECTED_TOKEN",q);if(this.atDirectives||!this.doc)this.errors.push(z);else this.doc.errors.push(z);break}case"doc-end":{if(!this.doc){this.errors.push(new q$.YAMLParseError(z$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let q=XQ.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),q.comment){let z=this.doc.comment;this.doc.comment=z?`${z}
133
- ${q.comment}`:q.comment}this.doc.range[2]=q.offset;break}default:this.errors.push(new q$.YAMLParseError(z$($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,q=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let z=Object.assign({_directives:this.directives},this.options),X=new qQ.Document(void 0,z);if(this.atDirectives)this.onError(q,"MISSING_CHAR","Missing directives-end indicator line");X.range=[0,q,q],this.decorate(X,!1),yield X}}}ZQ.Composer=z4});var H4=I((TQ)=>{var QQ=I1(),JQ=R1(),UQ=e0(),X4=m0();function GQ($,q=!0,z){if($){let X=(Z,H,Q)=>{let J=typeof Z==="number"?Z:Array.isArray(Z)?Z[0]:Z.offset;if(z)z(J,H,Q);else throw new UQ.YAMLParseError([J,J+1],H,Q)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return JQ.resolveFlowScalar($,q,X);case"block-scalar":return QQ.resolveBlockScalar({options:{strict:q}},$,X)}}return null}function YQ($,q){let{implicitKey:z=!1,indent:X,inFlow:Z=!1,offset:H=-1,type:Q="PLAIN"}=q,J=X4.stringifyString({type:Q,value:$},{implicitKey:z,indent:X>0?" ".repeat(X):"",inFlow:Z,options:{blockQuote:!0,lineWidth:-1}}),G=q.end??[{type:"newline",offset:-1,indent:X,source:`
134
- `}];switch(J[0]){case"|":case">":{let U=J.indexOf(`
135
- `),B=J.substring(0,U),Y=J.substring(U+1)+`
136
- `,W=[{type:"block-scalar-header",offset:H,indent:X,source:B}];if(!Z4(W,G))W.push({type:"newline",offset:-1,indent:X,source:`
137
- `});return{type:"block-scalar",offset:H,indent:X,props:W,source:Y}}case'"':return{type:"double-quoted-scalar",offset:H,indent:X,source:J,end:G};case"'":return{type:"single-quoted-scalar",offset:H,indent:X,source:J,end:G};default:return{type:"scalar",offset:H,indent:X,source:J,end:G}}}function BQ($,q,z={}){let{afterKey:X=!1,implicitKey:Z=!1,inFlow:H=!1,type:Q}=z,J="indent"in $?$.indent:null;if(X&&typeof J==="number")J+=2;if(!Q)switch($.type){case"single-quoted-scalar":Q="QUOTE_SINGLE";break;case"double-quoted-scalar":Q="QUOTE_DOUBLE";break;case"block-scalar":{let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q=U.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Q="PLAIN"}let G=X4.stringifyString({type:Q,value:q},{implicitKey:Z||J===null,indent:J!==null&&J>0?" ".repeat(J):"",inFlow:H,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":WQ($,G);break;case'"':P1($,G,"double-quoted-scalar");break;case"'":P1($,G,"single-quoted-scalar");break;default:P1($,G,"scalar")}}function WQ($,q){let z=q.indexOf(`
138
- `),X=q.substring(0,z),Z=q.substring(z+1)+`
139
- `;if($.type==="block-scalar"){let H=$.props[0];if(H.type!=="block-scalar-header")throw Error("Invalid block scalar header");H.source=X,$.source=Z}else{let{offset:H}=$,Q="indent"in $?$.indent:-1,J=[{type:"block-scalar-header",offset:H,indent:Q,source:X}];if(!Z4(J,"end"in $?$.end:void 0))J.push({type:"newline",offset:-1,indent:Q,source:`
140
- `});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:Q,props:J,source:Z})}}function Z4($,q){if(q)for(let z of q)switch(z.type){case"space":case"comment":$.push(z);break;case"newline":return $.push(z),!0}return!1}function P1($,q,z){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=z,$.source=q;break;case"block-scalar":{let X=$.props.slice(1),Z=q.length;if($.props[0].type==="block-scalar-header")Z-=$.props[0].source.length;for(let H of X)H.offset+=Z;delete $.props,Object.assign($,{type:z,source:q,end:X});break}case"block-map":case"block-seq":{let Z={type:"newline",offset:$.offset+q.length,indent:$.indent,source:`
141
- `};delete $.items,Object.assign($,{type:z,source:q,end:[Z]});break}default:{let X="indent"in $?$.indent:-1,Z="end"in $&&Array.isArray($.end)?$.end.filter((H)=>H.type==="space"||H.type==="comment"||H.type==="newline"):[];for(let H of Object.keys($))if(H!=="type"&&H!=="offset")delete $[H];Object.assign($,{type:z,indent:X,source:q,end:Z})}}}TQ.createScalarToken=YQ;TQ.resolveAsScalar=GQ;TQ.setScalarValue=BQ});var Q4=I((DQ)=>{var IQ=($)=>("type"in $)?s$($):a$($);function s$($){switch($.type){case"block-scalar":{let q="";for(let z of $.props)q+=s$(z);return q+$.source}case"block-map":case"block-seq":{let q="";for(let z of $.items)q+=a$(z);return q}case"flow-collection":{let q=$.start.source;for(let z of $.items)q+=a$(z);for(let z of $.end)q+=z.source;return q}case"document":{let q=a$($);if($.end)for(let z of $.end)q+=z.source;return q}default:{let q=$.source;if("end"in $&&$.end)for(let z of $.end)q+=z.source;return q}}}function a$({start:$,key:q,sep:z,value:X}){let Z="";for(let H of $)Z+=H.source;if(q)Z+=s$(q);if(z)for(let H of z)Z+=H.source;if(X)Z+=s$(X);return Z}DQ.stringify=IQ});var G4=I((wQ)=>{var K1=Symbol("break visit"),MQ=Symbol("skip children"),J4=Symbol("remove item");function W0($,q){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};U4(Object.freeze([]),$,q)}W0.BREAK=K1;W0.SKIP=MQ;W0.REMOVE=J4;W0.itemAtPath=($,q)=>{let z=$;for(let[X,Z]of q){let H=z?.[X];if(H&&"items"in H)z=H.items[Z];else return}return z};W0.parentCollection=($,q)=>{let z=W0.itemAtPath($,q.slice(0,-1)),X=q[q.length-1][0],Z=z?.[X];if(Z&&"items"in Z)return Z;throw Error("Parent collection not found")};function U4($,q,z){let X=z(q,$);if(typeof X==="symbol")return X;for(let Z of["key","value"]){let H=q[Z];if(H&&"items"in H){for(let Q=0;Q<H.items.length;++Q){let J=U4(Object.freeze($.concat([[Z,Q]])),H.items[Q],z);if(typeof J==="number")Q=J-1;else if(J===K1)return K1;else if(J===J4)H.items.splice(Q,1),Q-=1}if(typeof X==="function"&&Z==="key")X=X(q,$)}}return typeof X==="function"?X(q,$):X}wQ.visit=W0});var r$=I((NQ)=>{var O1=H4(),KQ=Q4(),OQ=G4(),F1="\uFEFF",A1="\x02",j1="\x18",S1="\x1F",FQ=($)=>!!$&&("items"in $),AQ=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function jQ($){switch($){case F1:return"<BOM>";case A1:return"<DOC>";case j1:return"<FLOW_END>";case S1:return"<SCALAR>";default:return JSON.stringify($)}}function SQ($){switch($){case F1:return"byte-order-mark";case A1:return"doc-mode";case j1:return"flow-error-end";case S1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
129
+ `)+(G.substring(1)||" "),Z=!0,q=!1;break;case"%":if($[z+1]?.[0]!=="#")z+=1;Z=!1;break;default:if(!Z)q=!0;Z=!1}}return{comment:X,afterEmptyLine:q}}class X8{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(X,Z,q,z)=>{let G=m$(X);if(z)this.warnings.push(new u$.YAMLWarning(G,Z,q));else this.errors.push(new u$.YAMLParseError(G,Z,q))},this.directives=new CQ.Directives({version:$.version||"1.2"}),this.options=$}decorate($,X){let{comment:Z,afterEmptyLine:q}=$8(this.prelude);if(Z){let z=$.contents;if(X)$.comment=$.comment?`${$.comment}
130
+ ${Z}`:Z;else if(q||$.directives.docStart||!z)$.commentBefore=Z;else if(e5.isCollection(z)&&!z.flow&&z.items.length>0){let G=z.items[0];if(e5.isPair(G))G=G.key;let J=G.commentBefore;G.commentBefore=J?`${Z}
131
+ ${J}`:Z}else{let G=z.commentBefore;z.commentBefore=G?`${Z}
132
+ ${G}`:Z}}if(X)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:$8(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,X=!1,Z=-1){for(let q of $)yield*this.next(q);yield*this.end(X,Z)}*next($){if(EQ.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(X,Z,q)=>{let z=m$($);z[0]+=X,this.onError(z,"BAD_DIRECTIVE",Z,q)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let X=yQ.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!X.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(X,!1),this.doc)yield this.doc;this.doc=X,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let X=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,Z=new u$.YAMLParseError(m$($),"UNEXPECTED_TOKEN",X);if(this.atDirectives||!this.doc)this.errors.push(Z);else this.doc.errors.push(Z);break}case"doc-end":{if(!this.doc){this.errors.push(new u$.YAMLParseError(m$($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let X=xQ.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),X.comment){let Z=this.doc.comment;this.doc.comment=Z?`${Z}
133
+ ${X.comment}`:X.comment}this.doc.range[2]=X.offset;break}default:this.errors.push(new u$.YAMLParseError(m$($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,X=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let Z=Object.assign({_directives:this.directives},this.options),q=new bQ.Document(void 0,Z);if(this.atDirectives)this.onError(X,"MISSING_CHAR","Missing directives-end indicator line");q.range=[0,X,X],this.decorate(q,!1),yield q}}}fQ.Composer=X8});var z8=K((cQ)=>{var gQ=s9(),hQ=r9(),vQ=h$(),Z8=N$();function uQ($,X=!0,Z){if($){let q=(z,G,J)=>{let Q=typeof z==="number"?z:Array.isArray(z)?z[0]:z.offset;if(Z)Z(Q,G,J);else throw new vQ.YAMLParseError([Q,Q+1],G,J)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return hQ.resolveFlowScalar($,X,q);case"block-scalar":return gQ.resolveBlockScalar({options:{strict:X}},$,q)}}return null}function mQ($,X){let{implicitKey:Z=!1,indent:q,inFlow:z=!1,offset:G=-1,type:J="PLAIN"}=X,Q=Z8.stringifyString({type:J,value:$},{implicitKey:Z,indent:q>0?" ".repeat(q):"",inFlow:z,options:{blockQuote:!0,lineWidth:-1}}),Y=X.end??[{type:"newline",offset:-1,indent:q,source:`
134
+ `}];switch(Q[0]){case"|":case">":{let U=Q.indexOf(`
135
+ `),W=Q.substring(0,U),H=Q.substring(U+1)+`
136
+ `,V=[{type:"block-scalar-header",offset:G,indent:q,source:W}];if(!q8(V,Y))V.push({type:"newline",offset:-1,indent:q,source:`
137
+ `});return{type:"block-scalar",offset:G,indent:q,props:V,source:H}}case'"':return{type:"double-quoted-scalar",offset:G,indent:q,source:Q,end:Y};case"'":return{type:"single-quoted-scalar",offset:G,indent:q,source:Q,end:Y};default:return{type:"scalar",offset:G,indent:q,source:Q,end:Y}}}function dQ($,X,Z={}){let{afterKey:q=!1,implicitKey:z=!1,inFlow:G=!1,type:J}=Z,Q="indent"in $?$.indent:null;if(q&&typeof Q==="number")Q+=2;if(!J)switch($.type){case"single-quoted-scalar":J="QUOTE_SINGLE";break;case"double-quoted-scalar":J="QUOTE_DOUBLE";break;case"block-scalar":{let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");J=U.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:J="PLAIN"}let Y=Z8.stringifyString({type:J,value:X},{implicitKey:z||Q===null,indent:Q!==null&&Q>0?" ".repeat(Q):"",inFlow:G,options:{blockQuote:!0,lineWidth:-1}});switch(Y[0]){case"|":case">":pQ($,Y);break;case'"':e9($,Y,"double-quoted-scalar");break;case"'":e9($,Y,"single-quoted-scalar");break;default:e9($,Y,"scalar")}}function pQ($,X){let Z=X.indexOf(`
138
+ `),q=X.substring(0,Z),z=X.substring(Z+1)+`
139
+ `;if($.type==="block-scalar"){let G=$.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");G.source=q,$.source=z}else{let{offset:G}=$,J="indent"in $?$.indent:-1,Q=[{type:"block-scalar-header",offset:G,indent:J,source:q}];if(!q8(Q,"end"in $?$.end:void 0))Q.push({type:"newline",offset:-1,indent:J,source:`
140
+ `});for(let Y of Object.keys($))if(Y!=="type"&&Y!=="offset")delete $[Y];Object.assign($,{type:"block-scalar",indent:J,props:Q,source:z})}}function q8($,X){if(X)for(let Z of X)switch(Z.type){case"space":case"comment":$.push(Z);break;case"newline":return $.push(Z),!0}return!1}function e9($,X,Z){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=Z,$.source=X;break;case"block-scalar":{let q=$.props.slice(1),z=X.length;if($.props[0].type==="block-scalar-header")z-=$.props[0].source.length;for(let G of q)G.offset+=z;delete $.props,Object.assign($,{type:Z,source:X,end:q});break}case"block-map":case"block-seq":{let z={type:"newline",offset:$.offset+X.length,indent:$.indent,source:`
141
+ `};delete $.items,Object.assign($,{type:Z,source:X,end:[z]});break}default:{let q="indent"in $?$.indent:-1,z="end"in $&&Array.isArray($.end)?$.end.filter((G)=>G.type==="space"||G.type==="comment"||G.type==="newline"):[];for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:Z,indent:q,source:X,end:z})}}}cQ.createScalarToken=mQ;cQ.resolveAsScalar=uQ;cQ.setScalarValue=dQ});var G8=K((nQ)=>{var sQ=($)=>("type"in $)?o1($):r1($);function o1($){switch($.type){case"block-scalar":{let X="";for(let Z of $.props)X+=o1(Z);return X+$.source}case"block-map":case"block-seq":{let X="";for(let Z of $.items)X+=r1(Z);return X}case"flow-collection":{let X=$.start.source;for(let Z of $.items)X+=r1(Z);for(let Z of $.end)X+=Z.source;return X}case"document":{let X=r1($);if($.end)for(let Z of $.end)X+=Z.source;return X}default:{let X=$.source;if("end"in $&&$.end)for(let Z of $.end)X+=Z.source;return X}}}function r1({start:$,key:X,sep:Z,value:q}){let z="";for(let G of $)z+=G.source;if(X)z+=o1(X);if(Z)for(let G of Z)z+=G.source;if(q)z+=o1(q);return z}nQ.stringify=sQ});var Y8=K((tQ)=>{var $4=Symbol("break visit"),oQ=Symbol("skip children"),J8=Symbol("remove item");function x0($,X){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};Q8(Object.freeze([]),$,X)}x0.BREAK=$4;x0.SKIP=oQ;x0.REMOVE=J8;x0.itemAtPath=($,X)=>{let Z=$;for(let[q,z]of X){let G=Z?.[q];if(G&&"items"in G)Z=G.items[z];else return}return Z};x0.parentCollection=($,X)=>{let Z=x0.itemAtPath($,X.slice(0,-1)),q=X[X.length-1][0],z=Z?.[q];if(z&&"items"in z)return z;throw Error("Parent collection not found")};function Q8($,X,Z){let q=Z(X,$);if(typeof q==="symbol")return q;for(let z of["key","value"]){let G=X[z];if(G&&"items"in G){for(let J=0;J<G.items.length;++J){let Q=Q8(Object.freeze($.concat([[z,J]])),G.items[J],Z);if(typeof Q==="number")J=Q-1;else if(Q===$4)return $4;else if(Q===J8)G.items.splice(J,1),J-=1}if(typeof q==="function"&&z==="key")q=q(X,$)}}return typeof q==="function"?q(X,$):q}tQ.visit=x0});var t1=K((JY)=>{var X4=z8(),$Y=G8(),XY=Y8(),Z4="\uFEFF",q4="\x02",z4="\x18",G4="\x1F",ZY=($)=>!!$&&("items"in $),qY=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function zY($){switch($){case Z4:return"<BOM>";case q4:return"<DOC>";case z4:return"<FLOW_END>";case G4:return"<SCALAR>";default:return JSON.stringify($)}}function GY($){switch($){case Z4:return"byte-order-mark";case q4:return"doc-mode";case z4:return"flow-error-end";case G4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
142
142
  `:case`\r
143
- `: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($[0]){case" ":case"\t":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}NQ.createScalarToken=O1.createScalarToken;NQ.resolveAsScalar=O1.resolveAsScalar;NQ.setScalarValue=O1.setScalarValue;NQ.stringify=KQ.stringify;NQ.visit=OQ.visit;NQ.BOM=F1;NQ.DOCUMENT=A1;NQ.FLOW_END=j1;NQ.SCALAR=S1;NQ.isCollection=FQ;NQ.isScalar=AQ;NQ.prettyToken=jQ;NQ.tokenType=SQ});var E1=I((cQ)=>{var X$=r$();function m($){switch($){case void 0:case" ":case`
144
- `:case"\r":case"\t":return!0;default:return!1}}var Y4=new Set("0123456789ABCDEFabcdef"),pQ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),n$=new Set(",[]{}"),lQ=new Set(` ,[]{}
145
- \r `),N1=($)=>!$||lQ.has($);class B4{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($,q=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!q;let z=this.next??"stream";while(z&&(q||this.hasChars(1)))z=yield*this.parseNext(z)}atLineEnd(){let $=this.pos,q=this.buffer[$];while(q===" "||q==="\t")q=this.buffer[++$];if(!q||q==="#"||q===`
146
- `)return!0;if(q==="\r")return this.buffer[$+1]===`
147
- `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let q=this.buffer[$];if(this.indentNext>0){let z=0;while(q===" ")q=this.buffer[++z+$];if(q==="\r"){let X=this.buffer[z+$+1];if(X===`
148
- `||!X&&!this.atEnd)return $+z+1}return q===`
149
- `||z>=this.indentNext||!q&&!this.atEnd?$+z:-1}if(q==="-"||q==="."){let z=this.buffer.substr($,3);if((z==="---"||z==="...")&&m(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
150
- `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===X$.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let q=$.length,z=$.indexOf("#");while(z!==-1){let Z=$[z-1];if(Z===" "||Z==="\t"){q=z-1;break}else z=$.indexOf("#",z+1)}while(!0){let Z=$[q-1];if(Z===" "||Z==="\t")q-=1;else break}let X=(yield*this.pushCount(q))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-X),this.pushNewline(),"stream"}if(this.atLineEnd()){let q=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-q),yield*this.pushNewline(),"stream"}return yield X$.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let q=this.peek(3);if((q==="---"||q==="...")&&m(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,q==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!m(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,q]=this.peek(2);if(!q&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&m(q)){let z=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=z,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let q=yield*this.pushIndicators();switch($[q]){case"#":yield*this.pushCount($.length-q);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(N1),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return q+=yield*this.parseBlockScalarHeader(),q+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-q),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,q,z=-1;do{if($=yield*this.pushNewline(),$>0)q=yield*this.pushSpaces(!1),this.indentValue=z=q;else q=0;q+=yield*this.pushSpaces(!0)}while($+q>0);let X=this.getLine();if(X===null)return this.setNext("flow");if(z!==-1&&z<this.indentNext&&X[0]!=="#"||z===0&&(X.startsWith("---")||X.startsWith("..."))&&m(X[3])){if(!(z===this.indentNext-1&&this.flowLevel===1&&(X[0]==="]"||X[0]==="}")))return this.flowLevel=0,yield X$.FLOW_END,yield*this.parseLineStart()}let Z=0;while(X[Z]===",")Z+=yield*this.pushCount(1),Z+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(Z+=yield*this.pushIndicators(),X[Z]){case void 0:return"flow";case"#":return yield*this.pushCount(X.length-Z),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(N1),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let H=this.charAt(1);if(this.flowKey||m(H)||H===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),q=this.buffer.indexOf($,this.pos+1);if($==="'")while(q!==-1&&this.buffer[q+1]==="'")q=this.buffer.indexOf("'",q+2);else while(q!==-1){let Z=0;while(this.buffer[q-1-Z]==="\\")Z+=1;if(Z%2===0)break;q=this.buffer.indexOf('"',q+1)}let z=this.buffer.substring(0,q),X=z.indexOf(`
151
- `,this.pos);if(X!==-1){while(X!==-1){let Z=this.continueScalar(X+1);if(Z===-1)break;X=z.indexOf(`
152
- `,Z)}if(X!==-1)q=X-(z[X-1]==="\r"?2:1)}if(q===-1){if(!this.atEnd)return this.setNext("quoted-scalar");q=this.buffer.length}return yield*this.pushToIndex(q+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let q=this.buffer[++$];if(q==="+")this.blockScalarKeep=!0;else if(q>"0"&&q<="9")this.blockScalarIndent=Number(q)-1;else if(q!=="-")break}return yield*this.pushUntil((q)=>m(q)||q==="#")}*parseBlockScalar(){let $=this.pos-1,q=0,z;$:for(let Z=this.pos;z=this.buffer[Z];++Z)switch(z){case" ":q+=1;break;case`
153
- `:$=Z,q=0;break;case"\r":{let H=this.buffer[Z+1];if(!H&&!this.atEnd)return this.setNext("block-scalar");if(H===`
154
- `)break}default:break $}if(!z&&!this.atEnd)return this.setNext("block-scalar");if(q>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=q;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let Z=this.continueScalar($+1);if(Z===-1)break;$=this.buffer.indexOf(`
155
- `,Z)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let X=$+1;z=this.buffer[X];while(z===" ")z=this.buffer[++X];if(z==="\t"){while(z==="\t"||z===" "||z==="\r"||z===`
156
- `)z=this.buffer[++X];$=X-1}else if(!this.blockScalarKeep)do{let Z=$-1,H=this.buffer[Z];if(H==="\r")H=this.buffer[--Z];let Q=Z;while(H===" ")H=this.buffer[--Z];if(H===`
157
- `&&Z>=this.pos&&Z+1+q>Q)$=Z;else break}while(!0);return yield X$.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,q=this.pos-1,z=this.pos-1,X;while(X=this.buffer[++z])if(X===":"){let Z=this.buffer[z+1];if(m(Z)||$&&n$.has(Z))break;q=z}else if(m(X)){let Z=this.buffer[z+1];if(X==="\r")if(Z===`
158
- `)z+=1,X=`
159
- `,Z=this.buffer[z+1];else q=z;if(Z==="#"||$&&n$.has(Z))break;if(X===`
160
- `){let H=this.continueScalar(z+1);if(H===-1)break;z=Math.max(z,H-2)}}else{if($&&n$.has(X))break;q=z}if(!X&&!this.atEnd)return this.setNext("plain-scalar");return yield X$.SCALAR,yield*this.pushToIndex(q+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,q){let z=this.buffer.slice(this.pos,$);if(z)return yield z,this.pos+=z.length,z.length;else if(q)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(N1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,q=this.charAt(1);if(m(q)||$&&n$.has(q)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,q=this.buffer[$];while(!m(q)&&q!==">")q=this.buffer[++$];return yield*this.pushToIndex(q===">"?$+1:$,!1)}else{let $=this.pos+1,q=this.buffer[$];while(q)if(pQ.has(q))q=this.buffer[++$];else if(q==="%"&&Y4.has(this.buffer[$+1])&&Y4.has(this.buffer[$+2]))q=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
143
+ `: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($[0]){case" ":case"\t":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}JY.createScalarToken=X4.createScalarToken;JY.resolveAsScalar=X4.resolveAsScalar;JY.setScalarValue=X4.setScalarValue;JY.stringify=$Y.stringify;JY.visit=XY.visit;JY.BOM=Z4;JY.DOCUMENT=q4;JY.FLOW_END=z4;JY.SCALAR=G4;JY.isCollection=ZY;JY.isScalar=qY;JY.prettyToken=zY;JY.tokenType=GY});var Q4=K((MY)=>{var d$=t1();function X0($){switch($){case void 0:case" ":case`
144
+ `:case"\r":case"\t":return!0;default:return!1}}var U8=new Set("0123456789ABCDEFabcdef"),FY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),e1=new Set(",[]{}"),OY=new Set(` ,[]{}
145
+ \r `),J4=($)=>!$||OY.has($);class H8{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($,X=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!X;let Z=this.next??"stream";while(Z&&(X||this.hasChars(1)))Z=yield*this.parseNext(Z)}atLineEnd(){let $=this.pos,X=this.buffer[$];while(X===" "||X==="\t")X=this.buffer[++$];if(!X||X==="#"||X===`
146
+ `)return!0;if(X==="\r")return this.buffer[$+1]===`
147
+ `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let X=this.buffer[$];if(this.indentNext>0){let Z=0;while(X===" ")X=this.buffer[++Z+$];if(X==="\r"){let q=this.buffer[Z+$+1];if(q===`
148
+ `||!q&&!this.atEnd)return $+Z+1}return X===`
149
+ `||Z>=this.indentNext||!X&&!this.atEnd?$+Z:-1}if(X==="-"||X==="."){let Z=this.buffer.substr($,3);if((Z==="---"||Z==="...")&&X0(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
150
+ `,this.pos),this.lineEndPos=$;if($===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[$-1]==="\r")$-=1;return this.buffer.substring(this.pos,$)}hasChars($){return this.pos+$<=this.buffer.length}setNext($){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=$,null}peek($){return this.buffer.substr(this.pos,$)}*parseNext($){switch($){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let $=this.getLine();if($===null)return this.setNext("stream");if($[0]===d$.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let X=$.length,Z=$.indexOf("#");while(Z!==-1){let z=$[Z-1];if(z===" "||z==="\t"){X=Z-1;break}else Z=$.indexOf("#",Z+1)}while(!0){let z=$[X-1];if(z===" "||z==="\t")X-=1;else break}let q=(yield*this.pushCount(X))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-q),this.pushNewline(),"stream"}if(this.atLineEnd()){let X=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-X),yield*this.pushNewline(),"stream"}return yield d$.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let $=this.charAt(0);if(!$&&!this.atEnd)return this.setNext("line-start");if($==="-"||$==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let X=this.peek(3);if((X==="---"||X==="...")&&X0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,X==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!X0(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[$,X]=this.peek(2);if(!X&&!this.atEnd)return this.setNext("block-start");if(($==="-"||$==="?"||$===":")&&X0(X)){let Z=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=Z,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let $=this.getLine();if($===null)return this.setNext("doc");let X=yield*this.pushIndicators();switch($[X]){case"#":yield*this.pushCount($.length-X);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(J4),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return X+=yield*this.parseBlockScalarHeader(),X+=yield*this.pushSpaces(!0),yield*this.pushCount($.length-X),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let $,X,Z=-1;do{if($=yield*this.pushNewline(),$>0)X=yield*this.pushSpaces(!1),this.indentValue=Z=X;else X=0;X+=yield*this.pushSpaces(!0)}while($+X>0);let q=this.getLine();if(q===null)return this.setNext("flow");if(Z!==-1&&Z<this.indentNext&&q[0]!=="#"||Z===0&&(q.startsWith("---")||q.startsWith("..."))&&X0(q[3])){if(!(Z===this.indentNext-1&&this.flowLevel===1&&(q[0]==="]"||q[0]==="}")))return this.flowLevel=0,yield d$.FLOW_END,yield*this.parseLineStart()}let z=0;while(q[z]===",")z+=yield*this.pushCount(1),z+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(z+=yield*this.pushIndicators(),q[z]){case void 0:return"flow";case"#":return yield*this.pushCount(q.length-z),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(J4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let G=this.charAt(1);if(this.flowKey||X0(G)||G===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let $=this.charAt(0),X=this.buffer.indexOf($,this.pos+1);if($==="'")while(X!==-1&&this.buffer[X+1]==="'")X=this.buffer.indexOf("'",X+2);else while(X!==-1){let z=0;while(this.buffer[X-1-z]==="\\")z+=1;if(z%2===0)break;X=this.buffer.indexOf('"',X+1)}let Z=this.buffer.substring(0,X),q=Z.indexOf(`
151
+ `,this.pos);if(q!==-1){while(q!==-1){let z=this.continueScalar(q+1);if(z===-1)break;q=Z.indexOf(`
152
+ `,z)}if(q!==-1)X=q-(Z[q-1]==="\r"?2:1)}if(X===-1){if(!this.atEnd)return this.setNext("quoted-scalar");X=this.buffer.length}return yield*this.pushToIndex(X+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let X=this.buffer[++$];if(X==="+")this.blockScalarKeep=!0;else if(X>"0"&&X<="9")this.blockScalarIndent=Number(X)-1;else if(X!=="-")break}return yield*this.pushUntil((X)=>X0(X)||X==="#")}*parseBlockScalar(){let $=this.pos-1,X=0,Z;$:for(let z=this.pos;Z=this.buffer[z];++z)switch(Z){case" ":X+=1;break;case`
153
+ `:$=z,X=0;break;case"\r":{let G=this.buffer[z+1];if(!G&&!this.atEnd)return this.setNext("block-scalar");if(G===`
154
+ `)break}default:break $}if(!Z&&!this.atEnd)return this.setNext("block-scalar");if(X>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=X;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let z=this.continueScalar($+1);if(z===-1)break;$=this.buffer.indexOf(`
155
+ `,z)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let q=$+1;Z=this.buffer[q];while(Z===" ")Z=this.buffer[++q];if(Z==="\t"){while(Z==="\t"||Z===" "||Z==="\r"||Z===`
156
+ `)Z=this.buffer[++q];$=q-1}else if(!this.blockScalarKeep)do{let z=$-1,G=this.buffer[z];if(G==="\r")G=this.buffer[--z];let J=z;while(G===" ")G=this.buffer[--z];if(G===`
157
+ `&&z>=this.pos&&z+1+X>J)$=z;else break}while(!0);return yield d$.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,X=this.pos-1,Z=this.pos-1,q;while(q=this.buffer[++Z])if(q===":"){let z=this.buffer[Z+1];if(X0(z)||$&&e1.has(z))break;X=Z}else if(X0(q)){let z=this.buffer[Z+1];if(q==="\r")if(z===`
158
+ `)Z+=1,q=`
159
+ `,z=this.buffer[Z+1];else X=Z;if(z==="#"||$&&e1.has(z))break;if(q===`
160
+ `){let G=this.continueScalar(Z+1);if(G===-1)break;Z=Math.max(Z,G-2)}}else{if($&&e1.has(q))break;X=Z}if(!q&&!this.atEnd)return this.setNext("plain-scalar");return yield d$.SCALAR,yield*this.pushToIndex(X+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,X){let Z=this.buffer.slice(this.pos,$);if(Z)return yield Z,this.pos+=Z.length,Z.length;else if(X)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(J4))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,X=this.charAt(1);if(X0(X)||$&&e1.has(X)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,X=this.buffer[$];while(!X0(X)&&X!==">")X=this.buffer[++$];return yield*this.pushToIndex(X===">"?$+1:$,!1)}else{let $=this.pos+1,X=this.buffer[$];while(X)if(FY.has(X))X=this.buffer[++$];else if(X==="%"&&U8.has(this.buffer[$+1])&&U8.has(this.buffer[$+2]))X=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
161
161
  `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
162
- `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let q=this.pos-1,z;do z=this.buffer[++q];while(z===" "||$&&z==="\t");let X=q-this.pos;if(X>0)yield this.buffer.substr(this.pos,X),this.pos=q;return X}*pushUntil($){let q=this.pos,z=this.buffer[q];while(!$(z))z=this.buffer[++q];return yield*this.pushToIndex(q,!1)}}cQ.Lexer=B4});var b1=I((aQ)=>{class W4{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let q=0,z=this.lineStarts.length;while(q<z){let Z=q+z>>1;if(this.lineStarts[Z]<$)q=Z+1;else z=Z}if(this.lineStarts[q]===$)return{line:q+1,col:1};if(q===0)return{line:0,col:$};let X=this.lineStarts[q-1];return{line:q,col:$-X+1}}}}aQ.LineCounter=W4});var C1=I((oQ)=>{var rQ=a("process"),T4=r$(),nQ=E1();function Z0($,q){for(let z=0;z<$.length;++z)if($[z].type===q)return!0;return!1}function L4($){for(let q=0;q<$.length;++q)switch($[q].type){case"space":case"comment":case"newline":break;default:return q}return-1}function _4($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function o$($){switch($.type){case"document":return $.start;case"block-map":{let q=$.items[$.items.length-1];return q.sep??q.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function j0($){if($.length===0)return[];let q=$.length;$:while(--q>=0)switch($[q].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++q]?.type==="space");return $.splice(q,$.length)}function V4($){if($.start.type==="flow-seq-start"){for(let q of $.items)if(q.sep&&!q.value&&!Z0(q.start,"explicit-key-ind")&&!Z0(q.sep,"map-value-ind")){if(q.key)q.value=q.key;if(delete q.key,_4(q.value))if(q.value.end)Array.prototype.push.apply(q.value.end,q.sep);else q.value.end=q.sep;else Array.prototype.push.apply(q.start,q.sep);delete q.sep}}}class I4{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new nQ.Lexer,this.onNewLine=$}*parse($,q=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let z of this.lexer.lex($,q))yield*this.next(z);if(!q)yield*this.end()}*next($){if(this.source=$,rQ.env.LOG_TOKENS)console.log("|",T4.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let q=T4.tokenType($);if(!q){let z=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:z,source:$}),this.offset+=$.length}else if(q==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=q,yield*this.step(),q){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let q=$??this.stack.pop();if(!q)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield q;else{let z=this.peek(1);if(q.type==="block-scalar")q.indent="indent"in z?z.indent:0;else if(q.type==="flow-collection"&&z.type==="document")q.indent=0;if(q.type==="flow-collection")V4(q);switch(z.type){case"document":z.value=q;break;case"block-scalar":z.props.push(q);break;case"block-map":{let X=z.items[z.items.length-1];if(X.value){z.items.push({start:[],key:q,sep:[]}),this.onKeyLine=!0;return}else if(X.sep)X.value=q;else{Object.assign(X,{key:q,sep:[]}),this.onKeyLine=!X.explicitKey;return}break}case"block-seq":{let X=z.items[z.items.length-1];if(X.value)z.items.push({start:[],value:q});else X.value=q;break}case"flow-collection":{let X=z.items[z.items.length-1];if(!X||X.value)z.items.push({start:[],key:q,sep:[]});else if(X.sep)X.value=q;else Object.assign(X,{key:q,sep:[]});return}default:yield*this.pop(),yield*this.pop(q)}if((z.type==="document"||z.type==="block-map"||z.type==="block-seq")&&(q.type==="block-map"||q.type==="block-seq")){let X=q.items[q.items.length-1];if(X&&!X.sep&&!X.value&&X.start.length>0&&L4(X.start)===-1&&(q.indent===0||X.start.every((Z)=>Z.type!=="comment"||Z.indent<q.indent))){if(z.type==="document")z.end=X.start;else z.items.push({start:X.start});q.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(L4($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let q=this.startBlockValue($);if(q)this.stack.push(q);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let q=o$(this.peek(2)),z=j0(q),X;if($.end)X=$.end,X.push(this.sourceToken),delete $.end;else X=[this.sourceToken];let Z={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:z,key:$,sep:X}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Z}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let q=this.source.indexOf(`
163
- `)+1;while(q!==0)this.onNewLine(this.offset+q),q=this.source.indexOf(`
164
- `,q)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let q=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,q.value){let z="end"in q.value?q.value.end:void 0;if((Array.isArray(z)?z[z.length-1]:void 0)?.type==="comment")z?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"space":case"comment":if(q.value)$.items.push({start:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else{if(this.atIndentedComment(q.start,$.indent)){let X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,q.start),X.push(this.sourceToken),$.items.pop();return}}q.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let z=!this.onKeyLine&&this.indent===$.indent,X=z&&(q.sep||q.explicitKey)&&this.type!=="seq-item-ind",Z=[];if(X&&q.sep&&!q.value){let H=[];for(let Q=0;Q<q.sep.length;++Q){let J=q.sep[Q];switch(J.type){case"newline":H.push(Q);break;case"space":break;case"comment":if(J.indent>$.indent)H.length=0;break;default:H.length=0}}if(H.length>=2)Z=q.sep.splice(H[1])}switch(this.type){case"anchor":case"tag":if(X||q.value)Z.push(this.sourceToken),$.items.push({start:Z}),this.onKeyLine=!0;else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"explicit-key-ind":if(!q.sep&&!q.explicitKey)q.start.push(this.sourceToken),q.explicitKey=!0;else if(X||q.value)Z.push(this.sourceToken),$.items.push({start:Z,explicitKey:!0});else 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(q.explicitKey)if(!q.sep)if(Z0(q.start,"newline"))Object.assign(q,{key:null,sep:[this.sourceToken]});else{let H=j0(q.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:null,sep:[this.sourceToken]}]})}else if(q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z0(q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]});else if(_4(q.key)&&!Z0(q.sep,"newline")){let H=j0(q.start),Q=q.key,J=q.sep;J.push(this.sourceToken),delete q.key,delete q.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:Q,sep:J}]})}else if(Z.length>0)q.sep=q.sep.concat(Z,this.sourceToken);else q.sep.push(this.sourceToken);else if(!q.sep)Object.assign(q,{key:null,sep:[this.sourceToken]});else if(q.value||X)$.items.push({start:Z,key:null,sep:[this.sourceToken]});else if(Z0(q.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else q.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let H=this.flowScalar(this.type);if(X||q.value)$.items.push({start:Z,key:H,sep:[]}),this.onKeyLine=!0;else if(q.sep)this.stack.push(H);else Object.assign(q,{key:H,sep:[]}),this.onKeyLine=!0;return}default:{let H=this.startBlockValue($);if(H){if(H.type==="block-seq"){if(!q.explicitKey&&q.sep&&!Z0(q.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 if(z)$.items.push({start:Z});this.stack.push(H);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let q=$.items[$.items.length-1];switch(this.type){case"newline":if(q.value){let z="end"in q.value?q.value.end:void 0;if((Array.isArray(z)?z[z.length-1]:void 0)?.type==="comment")z?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else q.start.push(this.sourceToken);return;case"space":case"comment":if(q.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(q.start,$.indent)){let X=$.items[$.items.length-2]?.value?.end;if(Array.isArray(X)){Array.prototype.push.apply(X,q.start),X.push(this.sourceToken),$.items.pop();return}}q.start.push(this.sourceToken)}return;case"anchor":case"tag":if(q.value||this.indent<=$.indent)break;q.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(q.value||Z0(q.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else q.start.push(this.sourceToken);return}if(this.indent>$.indent){let z=this.startBlockValue($);if(z){this.stack.push(z);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let q=$.items[$.items.length-1];if(this.type==="flow-error-end"){let z;do yield*this.pop(),z=this.peek(1);while(z?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!q||q.sep)$.items.push({start:[this.sourceToken]});else q.start.push(this.sourceToken);return;case"map-value-ind":if(!q||q.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else Object.assign(q,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!q||q.value)$.items.push({start:[this.sourceToken]});else if(q.sep)q.sep.push(this.sourceToken);else q.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let X=this.flowScalar(this.type);if(!q||q.value)$.items.push({start:[],key:X,sep:[]});else if(q.sep)this.stack.push(X);else Object.assign(q,{key:X,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let z=this.startBlockValue($);if(z)this.stack.push(z);else yield*this.pop(),yield*this.step()}else{let z=this.peek(2);if(z.type==="block-map"&&(this.type==="map-value-ind"&&z.indent===$.indent||this.type==="newline"&&!z.items[z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&z.type!=="flow-collection"){let X=o$(z),Z=j0(X);V4($);let H=$.end.splice(1,$.end.length);H.push(this.sourceToken);let Q={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:Z,key:$,sep:H}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Q}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let q=this.source.indexOf(`
165
- `)+1;while(q!==0)this.onNewLine(this.offset+q),q=this.source.indexOf(`
166
- `,q)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){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 q=o$($),z=j0(q);return z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let q=o$($),z=j0(q);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,q){if(this.type!=="comment")return!1;if(this.indent<=q)return!1;return $.every((z)=>z.type==="newline"||z.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){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;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}oQ.Parser=I4});var P4=I((Q7)=>{var D4=w1(),eQ=t0(),Z$=e0(),$7=bq(),q7=A(),z7=b1(),R4=C1();function M4($){let q=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||q&&new z7.LineCounter||null,prettyErrors:q}}function X7($,q={}){let{lineCounter:z,prettyErrors:X}=M4(q),Z=new R4.Parser(z?.addNewLine),H=new D4.Composer(q),Q=Array.from(H.compose(Z.parse($)));if(X&&z)for(let J of Q)J.errors.forEach(Z$.prettifyError($,z)),J.warnings.forEach(Z$.prettifyError($,z));if(Q.length>0)return Q;return Object.assign([],{empty:!0},H.streamInfo())}function w4($,q={}){let{lineCounter:z,prettyErrors:X}=M4(q),Z=new R4.Parser(z?.addNewLine),H=new D4.Composer(q),Q=null;for(let J of H.compose(Z.parse($),!0,$.length))if(!Q)Q=J;else if(Q.options.logLevel!=="silent"){Q.errors.push(new Z$.YAMLParseError(J.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(X&&z)Q.errors.forEach(Z$.prettifyError($,z)),Q.warnings.forEach(Z$.prettifyError($,z));return Q}function Z7($,q,z){let X=void 0;if(typeof q==="function")X=q;else if(z===void 0&&q&&typeof q==="object")z=q;let Z=w4($,z);if(!Z)return null;if(Z.warnings.forEach((H)=>$7.warn(Z.options.logLevel,H)),Z.errors.length>0)if(Z.options.logLevel!=="silent")throw Z.errors[0];else Z.errors=[];return Z.toJS(Object.assign({reviver:X},z))}function H7($,q,z){let X=null;if(typeof q==="function"||Array.isArray(q))X=q;else if(z===void 0&&q)z=q;if(typeof z==="string")z=z.length;if(typeof z==="number"){let Z=Math.round(z);z=Z<1?void 0:Z>8?{indent:8}:{indent:Z}}if($===void 0){let{keepUndefined:Z}=z??q??{};if(!Z)return}if(q7.isDocument($)&&!X)return $.toString(z);return new eQ.Document($,X,z).toString(z)}Q7.parse=Z7;Q7.parseAllDocuments=X7;Q7.parseDocument=w4;Q7.stringify=H7});var O4=I((K7)=>{var B7=w1(),W7=t0(),T7=H1(),y1=e0(),L7=h0(),H0=A(),V7=$0(),_7=y(),I7=z0(),D7=X0(),R7=r$(),M7=E1(),w7=b1(),P7=C1(),t$=P4(),K4=k0();K7.Composer=B7.Composer;K7.Document=W7.Document;K7.Schema=T7.Schema;K7.YAMLError=y1.YAMLError;K7.YAMLParseError=y1.YAMLParseError;K7.YAMLWarning=y1.YAMLWarning;K7.Alias=L7.Alias;K7.isAlias=H0.isAlias;K7.isCollection=H0.isCollection;K7.isDocument=H0.isDocument;K7.isMap=H0.isMap;K7.isNode=H0.isNode;K7.isPair=H0.isPair;K7.isScalar=H0.isScalar;K7.isSeq=H0.isSeq;K7.Pair=V7.Pair;K7.Scalar=_7.Scalar;K7.YAMLMap=I7.YAMLMap;K7.YAMLSeq=D7.YAMLSeq;K7.CST=R7;K7.Lexer=M7.Lexer;K7.LineCounter=w7.LineCounter;K7.Parser=P7.Parser;K7.parse=t$.parse;K7.parseAllDocuments=t$.parseAllDocuments;K7.parseDocument=t$.parseDocument;K7.stringify=t$.stringify;K7.visit=K4.visit;K7.visitAsync=K4.visitAsync});var L2=o1(T2(),1),{program:_0,createCommand:EU,createArgument:bU,createOption:CU,CommanderError:yU,InvalidArgumentError:fU,InvalidOptionArgumentError:kU,Command:xU,Argument:hU,Option:Mq,Help:gU}=L2.default;var V2={name:"@pickled-dev/cli",version:"0.11.0",description:"Test what agents actually understand about your product",module:"dist/index.js",type:"module",bin:{pickled:"./dist/index.js"},files:["dist"],scripts:{dev:"bun run ./src/index.ts",build:"bun build ./src/index.ts --outdir ./dist --target bun --minify --external @anthropic-ai/claude-agent-sdk",release:"semantic-release"},dependencies:{commander:"^14.0.2",chalk:"^5.6.2","@anthropic-ai/claude-agent-sdk":"^0.3.0"},devDependencies:{"@pickled-dev/config":"workspace:*","@pickled-dev/core":"workspace:*","semantic-release":"^25.0.2","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/exec":"^7.1.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.2","semantic-release-ai-notes":"^0.3.0"}};import VU from"path";var l={category:"cli",provider:"claude-code",model:"sonnet"},wq=["Read","Glob","Grep","Bash"],Pq=["Edit","MultiEdit","Write","NotebookEdit"];var F4=o1(O4(),1);async function S0($){let q=`${$}/pickled.yml`,z=Bun.file(q);if(!await z.exists())throw Error(`pickled.yml not found in ${$}`);let X;try{let Z=await z.text();X=F4.default.parse(Z)}catch(Z){throw Error(`Failed to parse pickled.yml: ${Z}`)}return e7(X),X}function e7($){if(!$.tool?.name)throw Error("pickled.yml: 'tool.name' is required");if(!Array.isArray($.scenarios)||$.scenarios.length===0)throw Error("pickled.yml: 'scenarios' must be a non-empty array");if($.docs?.sources)for(let[z,X]of Object.entries($.docs.sources))qJ(z,X);if($.targets)for(let[z,X]of Object.entries($.targets)){if(X.systemPrompt!==void 0)throw Error(`pickled.yml: target "${z}" sets 'systemPrompt', which bypasses the citation contract. Remove it; custom prompts are not supported in citation mode.`);if(X.provider==="codex-cli"){if(!X.model)throw Error(`pickled.yml: target "${z}" (codex-cli) requires an explicit 'model' field. Codex's default model can change without notice; pin it for reproducible evals.`);if(X.maxTurns!==void 0)throw Error(`pickled.yml: target "${z}" (codex-cli) sets 'maxTurns', but the codex CLI does not support a turn cap. Remove the field.`)}}let q=new Set(Object.keys($.docs?.sources??{}));for(let z of $.scenarios){if(!z.name||!z.prompt)throw Error("pickled.yml: every scenario needs 'name' and 'prompt'");if(!Array.isArray(z.requiredSources))throw Error(`pickled.yml: scenario "${z.name}" is missing 'requiredSources' (use [] to allow any citation)`);for(let X of z.requiredSources)if(!q.has(X))throw Error(`pickled.yml: scenario "${z.name}" references unknown source "${X}". Declared sources: ${[...q].join(", ")||"(none)"}`);ZJ(z.name,z.traps),$J(z.name,z.compareSurfaces,q)}}function $J($,q,z){if(q===void 0)return;if(!Array.isArray(q))throw Error(`pickled.yml: scenario "${$}" compareSurfaces must be an array of source-id lists`);if(q.length===0)throw Error(`pickled.yml: scenario "${$}" compareSurfaces cannot be empty (use a non-empty list of surfaces, or remove the field)`);for(let X=0;X<q.length;X++){let Z=q[X];if(!Array.isArray(Z))throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] must be an array of source ids`);if(Z.length===0)throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] must be a non-empty list of source ids`);for(let H of Z){if(typeof H!=="string")throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] entries must be string source ids`);if(!z.has(H))throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${X}] references unknown source "${H}". Declared sources: ${[...z].join(", ")||"(none)"}`)}}}function qJ($,q){if(typeof q==="string"){if(q.length===0)throw Error(`pickled.yml: docs.sources["${$}"] string form must be a non-empty file path or URL`);return}if(!q||typeof q!=="object")throw Error(`pickled.yml: docs.sources["${$}"] must be a string (path/URL) or an object with a 'path' field`);let z=q;if(typeof z.path!=="string"||z.path.length===0)throw Error(`pickled.yml: docs.sources["${$}"] object form requires a non-empty 'path' field`);if(z.audit!==void 0){if(typeof z.audit!=="object"||z.audit===null)throw Error(`pickled.yml: docs.sources["${$}"].audit must be an object`);let X=z.audit;if(X.traps!==void 0&&typeof X.traps!=="boolean")throw Error(`pickled.yml: docs.sources["${$}"].audit.traps must be a boolean`);for(let Z of Object.keys(X))if(Z!=="traps")throw Error(`pickled.yml: docs.sources["${$}"].audit has unknown field "${Z}"`)}for(let X of Object.keys(z))if(X!=="path"&&X!=="audit")throw Error(`pickled.yml: docs.sources["${$}"] has unknown field "${X}"`)}var zJ=new Set(["g","y"]),XJ=new Set(["i","m","s","u","v"]);function ZJ($,q){if(q===void 0)return;if(!Array.isArray(q))throw Error(`pickled.yml: scenario "${$}" has non-array 'traps'`);let z=new Set;for(let X of q){if(!X.id||typeof X.id!=="string")throw Error(`pickled.yml: scenario "${$}" has a trap missing 'id'`);if(z.has(X.id))throw Error(`pickled.yml: scenario "${$}" has duplicate trap id "${X.id}"`);if(z.add(X.id),!X.reason||typeof X.reason!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" requires non-empty 'reason'`);if(X.auditSeverity!==void 0&&X.auditSeverity!=="warning"&&X.auditSeverity!=="error")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" auditSeverity must be "warning" or "error"`);let Z=typeof X.match==="string",H=typeof X.pattern==="string";if(Z===H)throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" must set exactly one of 'match' or 'pattern'`);if(Z){if(X.match==="")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has empty 'match'`);if(X.flags!==void 0)throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" sets 'flags' without 'pattern'`)}else{let Q=X.pattern;if(typeof Q!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" must set 'pattern'`);if(Q==="")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has empty 'pattern'`);if(X.flags!==void 0){if(typeof X.flags!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has non-string 'flags'`);for(let J of X.flags){if(zJ.has(J))throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" uses forbidden regex flag "${J}" (g and y are not allowed)`);if(!XJ.has(J))throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" uses unsupported regex flag "${J}"`)}}try{new RegExp(Q,X.flags??"")}catch(J){throw Error(`pickled.yml: scenario "${$}" trap "${X.id}" has invalid regex pattern: ${J instanceof Error?J.message:J}`)}}}}function f1($,q){let z=new Set([...Object.keys($.targets??{}),"default"]);if(!z.has(q)){let X=[...z].sort().join(", ");throw Error(`Unknown target: "${q}". Available targets: ${X}`)}return{...$,matrix:{...$.matrix,target:[q]},scenarios:$.scenarios.filter((X)=>!X.target||X.target===q)}}function k1($){if(typeof $==="string")return{path:$,auditTraps:!0};return{path:$.path,auditTraps:$.audit?.traps??!0}}function e$($){let{config:q,files:z,pairs:X,findings:Z}=$,H=[],Q=Z.filter((Y)=>Y.severity==="error").length,J=Z.filter((Y)=>Y.severity==="warning").length;if(H.push(`# Agent-context audit
167
- `),H.push(`Target: \`${q.targetRepo}\``),H.push(`Budgets: root \u2264 ${q.budgets.rootLines} lines, nested warn at ${q.budgets.nestedWarnLines} lines.`),H.push(`Found ${z.length} agent-doc files. ${Q} error(s), ${J} warning(s).
168
- `),H.push(`## Inventory
169
- `),z.length===0)H.push(`No agent-doc files found.
170
- `);else{H.push("| File | Lines | Kind | Notes |"),H.push("|---|---|---|---|");let Y=[...z].sort((W,L)=>L.lineCount-W.lineCount);for(let W of Y){let L=!W.relPath.includes("/"),_=A4(W.lineCount,L,q),T=W.isSymlink?`symlink \u2192 ${W.symlinkTarget?.replace(`${q.targetRepo}/`,"")??"?"}`:"file";H.push(`| \`${W.relPath}\` | ${W.lineCount} | ${T} | ${_} |`)}H.push("")}if(H.push(`## AGENTS.md / CLAUDE.md pairs
171
- `),X.length===0)H.push(`No pairs found.
172
- `);else{H.push("| Directory | A | C | Class | Detail |"),H.push("|---|---|---|---|---|");for(let Y of X)H.push(`| \`${Y.dir||"(root)"}\` | ${Y.agentsExists?"\u2713":"\xB7"} | ${Y.claudeExists?"\u2713":"\xB7"} | ${Y.classification} | ${Y.detail} |`);H.push("")}let G=z.filter((Y)=>!Y.isSymlink&&Y.brokenPathRefs.length+Y.brokenImports.length>0);if(H.push(`## Broken references
173
- `),G.length===0)H.push(`None detected.
174
- `);else for(let Y of G){if(H.push(`### \`${Y.relPath}\`
175
- `),Y.brokenPathRefs.length>0){H.push("Broken path references:");for(let W of Y.brokenPathRefs)H.push(` - \`${W}\``);H.push("")}if(Y.brokenImports.length>0){H.push("Broken `@`-imports:");for(let W of Y.brokenImports)H.push(` - \`${W}\``);H.push("")}}let U=z.filter((Y)=>!Y.isSymlink&&Y.unresolvedCommands.length>0);if(H.push(`## Unresolved package-manager commands (advisory)
176
- `),H.push("Looks like a script command in markdown that did not match anything in the target `package.json` `scripts` or the `knownCommands` allowlist. Workspace-filtered commands check against root scripts, so false positives are expected. Review, do not fail CI on this.\n"),U.length===0)H.push(`None flagged.
177
- `);else for(let Y of U){H.push(`### \`${Y.relPath}\`
178
- `);for(let W of Y.unresolvedCommands)H.push(` - \`${W}\``);H.push("")}let B=z.filter((Y)=>{if(Y.isSymlink)return!1;return!Y.relPath.includes("/")?Y.lineCount>q.budgets.rootLines:Y.lineCount>q.budgets.nestedWarnLines});if(H.push(`## Section breakdown for files over budget
179
- `),B.length===0)H.push(`All files within budget.
180
- `);else for(let Y of B){H.push(`### \`${Y.relPath}\` (${Y.lineCount} lines)
181
- `),H.push(`Largest H2 sections (lines including any subsections):
182
- `),H.push("| Section | Lines |"),H.push("|---|---|");for(let W of Y.sections.slice(0,10))H.push(`| ${W.header} | ${W.lines} |`);H.push("")}if(H.push(`## Registered-source trap matches
183
- `),H.push("Catches stale claims in `docs.sources` against declared traps. Sources with `audit.traps: false` are excluded.\n"),$.sourceTrapMatches.length===0)H.push(`None.
184
- `);else{for(let Y of $.sourceTrapMatches)H.push(`- **${Y.sourceId}** (\`${Y.sourcePath}:L${Y.line}\`) \u2014 trap \`${Y.trapId}\` matched \`${Y.matched}\` (${Y.severity})`),H.push(` - reason: ${Y.trapReason}`),H.push(" - fix: remove the stale claim, retire the trap, or set `audit.traps: false` on the source");H.push("")}return H.join(`
185
- `)}function $q($){return JSON.stringify($,null,2)}function qq($){let{config:q,files:z,pairs:X,findings:Z}=$,H=[],Q=Z.filter((Y)=>Y.severity==="error").length,J=Z.filter((Y)=>Y.severity==="warning").length;if(H.push("pickled audit"),H.push(`Target: ${q.targetRepo}`),H.push(`Budgets: root \u2264 ${q.budgets.rootLines} lines, nested warn at ${q.budgets.nestedWarnLines} lines.`),H.push(`Found: ${z.length} agent-doc file(s) \xB7 ${Q} error(s) \xB7 ${J} warning(s)`),H.push(""),H.push("Inventory"),z.length===0)H.push(" none");else{let Y=[...z].sort((L,_)=>_.lineCount-L.lineCount),W=Math.max(...Y.map((L)=>L.relPath.length));for(let L of Y){let _=!L.relPath.includes("/"),T=A4(L.lineCount,_,q),V=L.isSymlink?`symlink \u2192 ${L.symlinkTarget?.replace(`${q.targetRepo}/`,"")??"?"}`:"file",D=`${L.lineCount}`.padStart(4),R=L.relPath.padEnd(W),w=T?` (${T})`:"";H.push(` ${R} ${D} lines ${V}${w}`)}}if(H.push(""),H.push("AGENTS.md / CLAUDE.md pairs"),X.length===0)H.push(" none");else for(let Y of X){let W=Y.dir||"(root)";H.push(` ${W}: ${Y.classification} \xB7 ${Y.detail}`)}H.push("");let G=z.filter((Y)=>!Y.isSymlink&&Y.brokenPathRefs.length+Y.brokenImports.length>0);if(H.push("Broken references"),G.length===0)H.push(" none");else for(let Y of G){H.push(` ${Y.relPath}:`);for(let W of Y.brokenPathRefs)H.push(` path: ${W}`);for(let W of Y.brokenImports)H.push(` @-import: ${W}`)}H.push("");let U=z.filter((Y)=>!Y.isSymlink&&Y.unresolvedCommands.length>0);if(H.push("Unresolved package-manager commands (advisory)"),U.length===0)H.push(" none");else for(let Y of U){H.push(` ${Y.relPath}:`);for(let W of Y.unresolvedCommands)H.push(` ${W}`)}H.push("");let B=z.filter((Y)=>{if(Y.isSymlink)return!1;return!Y.relPath.includes("/")?Y.lineCount>q.budgets.rootLines:Y.lineCount>q.budgets.nestedWarnLines});if(H.push("Section breakdown for files over budget"),B.length===0)H.push(" all files within budget");else for(let Y of B){H.push(` ${Y.relPath} (${Y.lineCount} lines):`);for(let W of Y.sections.slice(0,10))H.push(` ${W.header.padEnd(40)} ${W.lines} lines`)}if(H.push(""),H.push("Registered-source trap matches"),$.sourceTrapMatches.length===0)H.push(" none");else for(let Y of $.sourceTrapMatches){let W=Y.severity==="error"?"error":"warning";H.push(` [${W}] ${Y.sourceId} (${Y.sourcePath}:L${Y.line}): trap ${Y.trapId} matched "${Y.matched}"`),H.push(` reason: ${Y.trapReason}`),H.push(" fix: remove the stale claim, retire the trap, or set audit.traps: false on the source")}return H.join(`
186
- `)}function A4($,q,z){if(q&&$>z.budgets.rootLines)return`over root budget (${$} > ${z.budgets.rootLines})`;if(!q&&$>z.budgets.nestedWarnLines)return`over nested-warn (${$} > ${z.budgets.nestedWarnLines})`;return""}import{existsSync as E0,lstatSync as b4,readFileSync as Zq,readlinkSync as WJ,statSync as TJ}from"fs";import{dirname as Hq,isAbsolute as LJ,join as h1,relative as VJ,resolve as g1}from"path";var{Glob:E4}=globalThis.Bun;var zq=["node_modules/**","**/node_modules/**",".git/**","**/.git/**","dist/**","**/dist/**","build/**","**/build/**",".next/**","**/.next/**",".turbo/**","**/.turbo/**",".cache/**","**/.cache/**",".runs/**","**/.runs/**","coverage/**","**/coverage/**","**/__fixtures__/**","**/tests/**/fixture/**","**/tests/**/fixtures/**","**/test/**/fixture/**","**/test/**/fixtures/**"],N0={targetRepo:".",budgets:{rootLines:120,nestedWarnLines:200},ignore:zq,intentionalDifferentPairs:[],knownCommands:[]};function Xq($){if(!$)return N0;return{targetRepo:$.targetRepo??N0.targetRepo,budgets:{rootLines:$.budgets?.rootLines??N0.budgets.rootLines,nestedWarnLines:$.budgets?.nestedWarnLines??N0.budgets.nestedWarnLines},ignore:$.ignore??zq,intentionalDifferentPairs:$.intentionalDifferentPairs??[],knownCommands:$.knownCommands??[]}}import{existsSync as GJ}from"fs";import{join as YJ}from"path";function T0($){let q=[],z=[];for(let X of $.traps){let Z=HJ($.response,X);if(Z)q.push(Z);else z.push(X.id)}return{fired:q,avoided:z}}function HJ($,q){if(q.match!==void 0){let z=$.indexOf(q.match);if(z===-1)return null;return{id:q.id,reason:q.reason,matched:q.match,snippet:j4($,z,q.match.length),index:z}}if(q.pattern!==void 0){let X=new RegExp(q.pattern,q.flags??"").exec($);if(!X)return null;return{id:q.id,reason:q.reason,matched:X[0],snippet:j4($,X.index,X[0].length),index:X.index}}return null}function j4($,q,z){let X=Math.max(0,q-40),Z=Math.min($.length,q+z+40),H=$.slice(X,Z).replace(/\s+/g," ").trim();if(X>0)H=`...${H}`;if(Z<$.length)H=`${H}...`;return H}import x1 from"path";function QJ($){return $.startsWith("http://")||$.startsWith("https://")}async function JJ($,q,z){let X=await fetch(q);if(!X.ok)throw Error(`Failed to fetch source "${$}" from ${q}: ${X.status} ${X.statusText}`);let Z=await X.text();return{id:$,source:q,content:Z,name:new URL(q).hostname+new URL(q).pathname,type:"url",auditTraps:z}}async function UJ($,q,z,X){let Z=x1.isAbsolute(q)?q:x1.resolve(z,q),H=Bun.file(Z);if(!await H.exists())throw Error(`Source "${$}" not found at ${Z}`);let Q=await H.text();return{id:$,source:q,content:Q,name:x1.basename(Z),type:"file",auditTraps:X}}async function S4($,q,z){let{path:X,auditTraps:Z}=k1(q);if(QJ(X))return JJ($,X,Z);return UJ($,X,z,Z)}async function H$($,q){let z=Object.entries($);return await Promise.all(z.map(([Z,H])=>S4(Z,H,q)))}async function N4($){if(!GJ(YJ($,"pickled.yml")))return{matches:[],findings:[]};let q=await S0($),z=q.docs?.sources;if(!z||Object.keys(z).length===0)return{matches:[],findings:[]};let X={};for(let[U,B]of Object.entries(z)){let Y=typeof B==="string"?B:B.path;if(Y.startsWith("http://")||Y.startsWith("https://"))continue;X[U]=B}if(Object.keys(X).length===0)return{matches:[],findings:[]};let Z=[],H=new Map;for(let U of q.scenarios)for(let B of U.traps??[])Z.push(B),H.set(B,B.auditSeverity??"warning");if(Z.length===0)return{matches:[],findings:[]};let Q=await H$(X,$),J=[],G=[];for(let U of Q){if(U.auditTraps===!1)continue;for(let B of Z){let{fired:Y}=T0({response:U.content,traps:[B]}),W=Y[0];if(!W)continue;let L=BJ(U.content,W.index),_=H.get(B)??"warning";J.push({sourceId:U.id,sourcePath:U.source,trapId:W.id,trapReason:W.reason,matched:W.matched,snippet:W.snippet,line:L,severity:_}),G.push({severity:_,category:"trap-source-match",file:U.source,message:`source [${U.id}] matches trap '${W.id}' ("${W.matched}"). ${W.reason} Fix: remove the stale claim from the source, retire the trap if no longer relevant, or set audit.traps: false on the source if it is deliberately stale or test-only.`})}}return{matches:J,findings:G}}function BJ($,q){let z=1,X=Math.min(q,$.length);for(let Z=0;Z<X;Z++)if($[Z]===`
187
- `)z++;return z}var _J=["AGENTS.md","CLAUDE.md","CLAUDE.local.md","llms.txt","llms-full.txt",".claude/CLAUDE.md",".claude/rules/*.md","**/AGENTS.md","**/CLAUDE.md","**/CLAUDE.local.md","**/llms.txt","**/llms-full.txt","**/.claude/CLAUDE.md","**/.claude/rules/*.md"];async function Qq($){let q=Xq($),z=g1(q.targetRepo);if(!E0(z))throw Error(`targetRepo does not exist: ${z}`);let X=new Set;for(let U of _J){let B=new E4(U);for await(let Y of B.scan({cwd:z,dot:!0,onlyFiles:!1,followSymlinks:!1})){if(q.ignore.some((_)=>new E4(_).match(Y)))continue;let W=h1(z,Y),L=b4(W);if(L.isFile()){X.add(Y);continue}if(L.isSymbolicLink())try{if(TJ(W).isFile())X.add(Y)}catch{}}}let Z=[];for(let U of[...X].sort())Z.push(await IJ(z,U,h1(z,U),q));let H=NJ(Z,q),Q=EJ(Z,H,q),{matches:J,findings:G}=await N4(z);return{config:q,files:Z,pairs:H,findings:[...Q,...G],sourceTrapMatches:J}}async function IJ($,q,z,X){let H=b4(z).isSymbolicLink(),Q=null,J=q;if(H){let W=WJ(z),L=LJ(W)?W:g1(Hq(z),W);if(Q=L,E0(L))J=VJ($,L)}let G=H&&Q&&E0(Q)?Q:z,U=Zq(G,"utf8"),B=(U.match(/\n/g)??[]).length,Y=U.endsWith(`
188
- `)?B:B+1;return{relPath:q,absPath:z,isSymlink:H,symlinkTarget:Q,realRelPath:J,lineCount:Y,brokenPathRefs:RJ(U,$,q),brokenImports:wJ(U,Hq(z)),unresolvedCommands:FJ(U,$,X.knownCommands),sections:AJ(U)}}function DJ($){let q=$.split("/");if(q.length<2)return null;if(q[0]==="packages"||q[0]==="apps"||q[0]==="shared")return`${q[0]}/${q[1]}`;if(q[0]==="tests")return q.slice(0,2).join("/");return null}function RJ($,q,z){let X=SJ($),Z=Hq(z),H=DJ(z),Q=new Set,J=/`([^`\n]{2,200})`/g,G;G=J.exec(X);while(G!==null){let U=G[1].trim().replace(/[#?].*$/,"");if(jJ(U)&&!MJ(q,U,Z,H).found)Q.add(U);G=J.exec(X)}return[...Q].sort()}function MJ($,q,z,X){let Z=[q];if(z&&z!==".")Z.push(`${z}/${q}`);if(X)Z.push(`${X}/${q}`);Z.push(`packages/${q}`,`apps/${q}`,`shared/${q}`);for(let H of Z){let Q=H.replace(/\/+/g,"/");if(E0(`${$}/${Q}`))return{found:!0,resolvedAs:Q}}return{found:!1}}function wJ($,q){let z=new Set,X=/@([\w./@~-]+\.md)/g,Z;Z=X.exec($);while(Z!==null){let H=Z[1];if(H.startsWith("~/")){Z=X.exec($);continue}let Q=H.startsWith("/")?H:g1(q,H);if(!E0(Q))z.add(H);Z=X.exec($)}return[...z].sort()}var PJ=["bun","pnpm","npm","yarn"],KJ=new Set(["install","add","remove","update","i","audit","list","ls","why","outdated","exec","run","create","init","x"]),OJ={bun:new Set(["build","test","link","unlink","upgrade"])};function FJ($,q,z){let X=new Set,Z=h1(q,"package.json"),H=new Set;if(E0(Z))try{let J=JSON.parse(Zq(Z,"utf8"));H=new Set(Object.keys(J.scripts??{}))}catch{}let Q=new Set(z.map((J)=>J.trim()));for(let J of PJ){let G=new RegExp(`\\b${J}\\s+(?:run\\s+|--filter\\s+\\S+\\s+(?:run\\s+)?)?([a-zA-Z][\\w:.\\-]*)`,"g"),U;U=G.exec($);while(U!==null){let B=U[1];if(!H.has(B)&&!Q.has(`${J} ${B}`)&&!Q.has(`${J} run ${B}`)&&!KJ.has(B)&&!OJ[J]?.has(B))X.add(`${J} ${B}`);U=G.exec($)}}return[...X].sort()}function AJ($){let q=$.split(`
189
- `),z=[],X=null;if(q.forEach((Z,H)=>{if(/^##\s+/.test(Z)){if(X)z.push({header:X.header,lines:H-X.start});X={header:Z.replace(/^##\s+/,"").trim(),start:H}}}),X){let Z=X;z.push({header:Z.header,lines:q.length-Z.start})}return z.sort((Z,H)=>H.lines-Z.lines)}function jJ($){if($.length===0||$.length>160)return!1;if(!$.includes("/"))return!1;if(/\s/.test($))return!1;if(/^https?:\/\//.test($))return!1;if(/[*?{}[\]<>]/.test($))return!1;if($.startsWith("@"))return!1;if($.startsWith("~/"))return!1;if(/^[a-z]+:\/\//i.test($))return!1;if(/^cdn\./.test($)||/^unpkg\./.test($)||/^npm\./.test($))return!1;if(/^\/[a-z]/.test($)&&/(?:icon|image|img|asset|file|path)/i.test($))return!1;if(/^(cd|pnpm|npm|yarn|bun|node|git|ls|cat|grep|find|sed|awk|mkdir|rm|mv|cp|echo|export|source|sudo|brew|docker|curl|wget)\b/.test($))return!1;return/[a-zA-Z0-9_.-]\/[a-zA-Z0-9_.-]/.test($)}function SJ($){return $.replace(/```[\s\S]*?```/g,"")}function NJ($,q){let z=new Map;for(let H of $){let Q=H.relPath.split("/").pop()??"";if(Q!=="AGENTS.md"&&Q!=="CLAUDE.md")continue;let J=Hq(H.relPath),G=z.get(J)??{};if(Q==="AGENTS.md")G.agents=H;if(Q==="CLAUDE.md")G.claude=H;z.set(J,G)}let X=new Set(q.intentionalDifferentPairs),Z=[];for(let[H,Q]of z){let J=!!Q.agents,G=!!Q.claude;if(!J&&!G)continue;if(!J||!G){Z.push({dir:H,agentsExists:J,claudeExists:G,classification:"single",detail:J?"only AGENTS.md":"only CLAUDE.md"});continue}let{agents:U,claude:B}=Q,Y=`${U.relPath}:${B.relPath}`,W=`${B.relPath}:${U.relPath}`;if(X.has(Y)||X.has(W)){Z.push({dir:H,agentsExists:J,claudeExists:G,classification:"intentional-different",detail:`allowlisted: ${U.lineCount}L vs ${B.lineCount}L`});continue}if(U.isSymlink&&U.symlinkTarget===B.absPath||B.isSymlink&&B.symlinkTarget===U.absPath){let V=U.isSymlink?"CLAUDE.md":"AGENTS.md";Z.push({dir:H,agentsExists:J,claudeExists:G,classification:"linked",detail:`canonical: ${V}`});continue}let _=Zq(U.absPath,"utf8"),T=Zq(B.absPath,"utf8");if(_===T)Z.push({dir:H,agentsExists:J,claudeExists:G,classification:"unexpected-duplicate",detail:`byte-for-byte duplicate (${U.lineCount}L), not symlinked`});else Z.push({dir:H,agentsExists:J,claudeExists:G,classification:"unexpected-duplicate",detail:`divergent (${U.lineCount}L vs ${B.lineCount}L), not in intentional-different allowlist`})}return Z.sort((H,Q)=>H.dir.localeCompare(Q.dir)),Z}function EJ($,q,z){let X=[];for(let Z of $){if(Z.isSymlink)continue;for(let J of Z.brokenImports)X.push({severity:"error",category:"broken-import",file:Z.relPath,message:`broken @-import: ${J}`});for(let J of Z.brokenPathRefs)X.push({severity:"error",category:"broken-path-ref",file:Z.relPath,message:`broken path reference: ${J}`});for(let J of Z.unresolvedCommands)X.push({severity:"warning",category:"unresolved-command",file:Z.relPath,message:`unresolved command: ${J}`});let H=!Z.relPath.includes("/"),Q=H?z.budgets.rootLines:z.budgets.nestedWarnLines;if(Z.lineCount>Q)X.push({severity:"warning",category:"over-budget",file:Z.relPath,message:`${Z.lineCount} lines exceeds ${H?"root":"nested"} budget of ${Q}`})}for(let Z of q)if(Z.classification==="unexpected-duplicate"){let H=Z.detail.startsWith("divergent")?"error":"warning";X.push({severity:H,category:H==="error"?"divergent-pair":"duplicate-pair",file:Z.dir||"(root)",message:`AGENTS.md / CLAUDE.md ${Z.detail}`})}return X}function L0($){let q=$.confidence;if($.error)return{icon:"\u2717",label:"Error",confidence:q,tone:"error"};if($.traps.fired.length>0)return{icon:"\u2717",label:"Trap fired",confidence:q,tone:"error"};if($.answerable==="YES")return{icon:"\u2713",label:q>=90?"Well grounded":"Grounded",confidence:q,tone:"success"};if($.answerable==="PARTIAL")return{icon:"\u26A0",label:"Partially grounded",confidence:q,tone:"warning"};return{icon:"\u2717",label:"Ungrounded",confidence:q,tone:"error"}}function v1($){let q=bJ($);if(q===null)return[];let z=[],X=/^\s*-\s+\[([^\]]+)\]\s*(.*)$/gm,Z=X.exec(q);while(Z!==null)z.push({id:Z[1].trim(),note:Z[2].trim()||void 0}),Z=X.exec(q);return z}function bJ($){let z=/^##\s+Sources\s*$/im.exec($);if(!z)return null;let X=z.index+z[0].length,Z=$.slice(X),H=/^##\s+/m.exec(Z);return H?Z.slice(0,H.index):Z}function Q$($){let q=v1($.response),z=new Set(q.map((W)=>W.id)),X=new Set($.registeredIds),Z=new Set($.requiredSources),H=[...z],Q=[...Z].filter((W)=>!z.has(W)),J=[...z].filter((W)=>!X.has(W)),G=[...Z],U,B,Y;if(H.length===0)U="NO",B=0,Y="No citations in response";else if(J.length===H.length)U="NO",B=0,Y=`All cited sources are unknown: ${J.join(", ")}`;else if(Q.length===0&&J.length===0)U="YES",B=100,Y=G.length>0?`All required sources cited: ${G.join(", ")}`:`Cited registered sources: ${H.join(", ")}`;else{U="PARTIAL";let W=G.length>0?G.length:1,L=G.length-Q.length,_=G.length>0?L/W*100:60,T=J.length*15;B=Math.max(0,Math.min(100,Math.round(_-T)));let V=[];if(Q.length>0)V.push(`missing: ${Q.join(", ")}`);if(J.length>0)V.push(`unknown: ${J.join(", ")}`);Y=V.join("; ")}return{answerable:U,confidence:B,reason:Y,citations:{cited:H,required:G,missing:Q,unknown:J}}}import{query as CJ}from"@anthropic-ai/claude-agent-sdk";function Jq($,q,z){let X=q.length>0?q.map((Q)=>`- ${Q.id}: ${Q.name} (${Q.source})`).join(`
190
- `):"(no sources provided)",Z=q.map((Q)=>`<source id="${Q.id}">
191
- ${Q.content.trimEnd()}
162
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let X=this.pos-1,Z;do Z=this.buffer[++X];while(Z===" "||$&&Z==="\t");let q=X-this.pos;if(q>0)yield this.buffer.substr(this.pos,q),this.pos=X;return q}*pushUntil($){let X=this.pos,Z=this.buffer[X];while(!$(Z))Z=this.buffer[++X];return yield*this.pushToIndex(X,!1)}}MY.Lexer=H8});var Y4=K((RY)=>{class W8{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let X=0,Z=this.lineStarts.length;while(X<Z){let z=X+Z>>1;if(this.lineStarts[z]<$)X=z+1;else Z=z}if(this.lineStarts[X]===$)return{line:X+1,col:1};if(X===0)return{line:0,col:$};let q=this.lineStarts[X-1];return{line:X,col:$-q+1}}}}RY.LineCounter=W8});var U4=K((SY)=>{var NY=Q0("process"),V8=t1(),AY=Q4();function M0($,X){for(let Z=0;Z<$.length;++Z)if($[Z].type===X)return!0;return!1}function T8($){for(let X=0;X<$.length;++X)switch($[X].type){case"space":case"comment":case"newline":break;default:return X}return-1}function L8($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function $2($){switch($.type){case"document":return $.start;case"block-map":{let X=$.items[$.items.length-1];return X.sep??X.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function X$($){if($.length===0)return[];let X=$.length;$:while(--X>=0)switch($[X].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++X]?.type==="space");return $.splice(X,$.length)}function w8($){if($.start.type==="flow-seq-start"){for(let X of $.items)if(X.sep&&!X.value&&!M0(X.start,"explicit-key-ind")&&!M0(X.sep,"map-value-ind")){if(X.key)X.value=X.key;if(delete X.key,L8(X.value))if(X.value.end)Array.prototype.push.apply(X.value.end,X.sep);else X.value.end=X.sep;else Array.prototype.push.apply(X.start,X.sep);delete X.sep}}}class B8{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new AY.Lexer,this.onNewLine=$}*parse($,X=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let Z of this.lexer.lex($,X))yield*this.next(Z);if(!X)yield*this.end()}*next($){if(this.source=$,NY.env.LOG_TOKENS)console.log("|",V8.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let X=V8.tokenType($);if(!X){let Z=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:Z,source:$}),this.offset+=$.length}else if(X==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=X,yield*this.step(),X){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let X=$??this.stack.pop();if(!X)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield X;else{let Z=this.peek(1);if(X.type==="block-scalar")X.indent="indent"in Z?Z.indent:0;else if(X.type==="flow-collection"&&Z.type==="document")X.indent=0;if(X.type==="flow-collection")w8(X);switch(Z.type){case"document":Z.value=X;break;case"block-scalar":Z.props.push(X);break;case"block-map":{let q=Z.items[Z.items.length-1];if(q.value){Z.items.push({start:[],key:X,sep:[]}),this.onKeyLine=!0;return}else if(q.sep)q.value=X;else{Object.assign(q,{key:X,sep:[]}),this.onKeyLine=!q.explicitKey;return}break}case"block-seq":{let q=Z.items[Z.items.length-1];if(q.value)Z.items.push({start:[],value:X});else q.value=X;break}case"flow-collection":{let q=Z.items[Z.items.length-1];if(!q||q.value)Z.items.push({start:[],key:X,sep:[]});else if(q.sep)q.value=X;else Object.assign(q,{key:X,sep:[]});return}default:yield*this.pop(),yield*this.pop(X)}if((Z.type==="document"||Z.type==="block-map"||Z.type==="block-seq")&&(X.type==="block-map"||X.type==="block-seq")){let q=X.items[X.items.length-1];if(q&&!q.sep&&!q.value&&q.start.length>0&&T8(q.start)===-1&&(X.indent===0||q.start.every((z)=>z.type!=="comment"||z.indent<X.indent))){if(Z.type==="document")Z.end=q.start;else Z.items.push({start:q.start});X.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(T8($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let X=this.startBlockValue($);if(X)this.stack.push(X);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let X=$2(this.peek(2)),Z=X$(X),q;if($.end)q=$.end,q.push(this.sourceToken),delete $.end;else q=[this.sourceToken];let z={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:Z,key:$,sep:q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let X=this.source.indexOf(`
163
+ `)+1;while(X!==0)this.onNewLine(this.offset+X),X=this.source.indexOf(`
164
+ `,X)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let X=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,X.value){let Z="end"in X.value?X.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(X.sep)X.sep.push(this.sourceToken);else X.start.push(this.sourceToken);return;case"space":case"comment":if(X.value)$.items.push({start:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else{if(this.atIndentedComment(X.start,$.indent)){let q=$.items[$.items.length-2]?.value?.end;if(Array.isArray(q)){Array.prototype.push.apply(q,X.start),q.push(this.sourceToken),$.items.pop();return}}X.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let Z=!this.onKeyLine&&this.indent===$.indent,q=Z&&(X.sep||X.explicitKey)&&this.type!=="seq-item-ind",z=[];if(q&&X.sep&&!X.value){let G=[];for(let J=0;J<X.sep.length;++J){let Q=X.sep[J];switch(Q.type){case"newline":G.push(J);break;case"space":break;case"comment":if(Q.indent>$.indent)G.length=0;break;default:G.length=0}}if(G.length>=2)z=X.sep.splice(G[1])}switch(this.type){case"anchor":case"tag":if(q||X.value)z.push(this.sourceToken),$.items.push({start:z}),this.onKeyLine=!0;else if(X.sep)X.sep.push(this.sourceToken);else X.start.push(this.sourceToken);return;case"explicit-key-ind":if(!X.sep&&!X.explicitKey)X.start.push(this.sourceToken),X.explicitKey=!0;else if(q||X.value)z.push(this.sourceToken),$.items.push({start:z,explicitKey:!0});else 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(X.explicitKey)if(!X.sep)if(M0(X.start,"newline"))Object.assign(X,{key:null,sep:[this.sourceToken]});else{let G=X$(X.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:G,key:null,sep:[this.sourceToken]}]})}else if(X.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(M0(X.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]});else if(L8(X.key)&&!M0(X.sep,"newline")){let G=X$(X.start),J=X.key,Q=X.sep;Q.push(this.sourceToken),delete X.key,delete X.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:G,key:J,sep:Q}]})}else if(z.length>0)X.sep=X.sep.concat(z,this.sourceToken);else X.sep.push(this.sourceToken);else if(!X.sep)Object.assign(X,{key:null,sep:[this.sourceToken]});else if(X.value||q)$.items.push({start:z,key:null,sep:[this.sourceToken]});else if(M0(X.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else X.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let G=this.flowScalar(this.type);if(q||X.value)$.items.push({start:z,key:G,sep:[]}),this.onKeyLine=!0;else if(X.sep)this.stack.push(G);else Object.assign(X,{key:G,sep:[]}),this.onKeyLine=!0;return}default:{let G=this.startBlockValue($);if(G){if(G.type==="block-seq"){if(!X.explicitKey&&X.sep&&!M0(X.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 if(Z)$.items.push({start:z});this.stack.push(G);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let X=$.items[$.items.length-1];switch(this.type){case"newline":if(X.value){let Z="end"in X.value?X.value.end:void 0;if((Array.isArray(Z)?Z[Z.length-1]:void 0)?.type==="comment")Z?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else X.start.push(this.sourceToken);return;case"space":case"comment":if(X.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(X.start,$.indent)){let q=$.items[$.items.length-2]?.value?.end;if(Array.isArray(q)){Array.prototype.push.apply(q,X.start),q.push(this.sourceToken),$.items.pop();return}}X.start.push(this.sourceToken)}return;case"anchor":case"tag":if(X.value||this.indent<=$.indent)break;X.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(X.value||M0(X.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else X.start.push(this.sourceToken);return}if(this.indent>$.indent){let Z=this.startBlockValue($);if(Z){this.stack.push(Z);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let X=$.items[$.items.length-1];if(this.type==="flow-error-end"){let Z;do yield*this.pop(),Z=this.peek(1);while(Z?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!X||X.sep)$.items.push({start:[this.sourceToken]});else X.start.push(this.sourceToken);return;case"map-value-ind":if(!X||X.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else Object.assign(X,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!X||X.value)$.items.push({start:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else X.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let q=this.flowScalar(this.type);if(!X||X.value)$.items.push({start:[],key:q,sep:[]});else if(X.sep)this.stack.push(q);else Object.assign(X,{key:q,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let Z=this.startBlockValue($);if(Z)this.stack.push(Z);else yield*this.pop(),yield*this.step()}else{let Z=this.peek(2);if(Z.type==="block-map"&&(this.type==="map-value-ind"&&Z.indent===$.indent||this.type==="newline"&&!Z.items[Z.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&Z.type!=="flow-collection"){let q=$2(Z),z=X$(q);w8($);let G=$.end.splice(1,$.end.length);G.push(this.sourceToken);let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:z,key:$,sep:G}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let X=this.source.indexOf(`
165
+ `)+1;while(X!==0)this.onNewLine(this.offset+X),X=this.source.indexOf(`
166
+ `,X)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){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 X=$2($),Z=X$(X);return Z.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let X=$2($),Z=X$(X);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Z,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,X){if(this.type!=="comment")return!1;if(this.indent<=X)return!1;return $.every((Z)=>Z.type==="newline"||Z.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){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;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}SY.Parser=B8});var O8=K((gY)=>{var K8=t9(),EY=g$(),p$=h$(),CY=Y9(),bY=j(),yY=Y4(),D8=U4();function _8($){let X=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||X&&new yY.LineCounter||null,prettyErrors:X}}function xY($,X={}){let{lineCounter:Z,prettyErrors:q}=_8(X),z=new D8.Parser(Z?.addNewLine),G=new K8.Composer(X),J=Array.from(G.compose(z.parse($)));if(q&&Z)for(let Q of J)Q.errors.forEach(p$.prettifyError($,Z)),Q.warnings.forEach(p$.prettifyError($,Z));if(J.length>0)return J;return Object.assign([],{empty:!0},G.streamInfo())}function F8($,X={}){let{lineCounter:Z,prettyErrors:q}=_8(X),z=new D8.Parser(Z?.addNewLine),G=new K8.Composer(X),J=null;for(let Q of G.compose(z.parse($),!0,$.length))if(!J)J=Q;else if(J.options.logLevel!=="silent"){J.errors.push(new p$.YAMLParseError(Q.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(q&&Z)J.errors.forEach(p$.prettifyError($,Z)),J.warnings.forEach(p$.prettifyError($,Z));return J}function fY($,X,Z){let q=void 0;if(typeof X==="function")q=X;else if(Z===void 0&&X&&typeof X==="object")Z=X;let z=F8($,Z);if(!z)return null;if(z.warnings.forEach((G)=>CY.warn(z.options.logLevel,G)),z.errors.length>0)if(z.options.logLevel!=="silent")throw z.errors[0];else z.errors=[];return z.toJS(Object.assign({reviver:q},Z))}function kY($,X,Z){let q=null;if(typeof X==="function"||Array.isArray(X))q=X;else if(Z===void 0&&X)Z=X;if(typeof Z==="string")Z=Z.length;if(typeof Z==="number"){let z=Math.round(Z);Z=z<1?void 0:z>8?{indent:8}:{indent:z}}if($===void 0){let{keepUndefined:z}=Z??X??{};if(!z)return}if(bY.isDocument($)&&!q)return $.toString(Z);return new EY.Document($,q,Z).toString(Z)}gY.parse=fY;gY.parseAllDocuments=xY;gY.parseDocument=F8;gY.stringify=kY});var I8=K(($U)=>{var dY=t9(),pY=g$(),cY=k9(),H4=h$(),lY=M$(),I0=j(),iY=D0(),aY=g(),sY=F0(),nY=O0(),rY=t1(),oY=Q4(),tY=Y4(),eY=U4(),X2=O8(),M8=F$();$U.Composer=dY.Composer;$U.Document=pY.Document;$U.Schema=cY.Schema;$U.YAMLError=H4.YAMLError;$U.YAMLParseError=H4.YAMLParseError;$U.YAMLWarning=H4.YAMLWarning;$U.Alias=lY.Alias;$U.isAlias=I0.isAlias;$U.isCollection=I0.isCollection;$U.isDocument=I0.isDocument;$U.isMap=I0.isMap;$U.isNode=I0.isNode;$U.isPair=I0.isPair;$U.isScalar=I0.isScalar;$U.isSeq=I0.isSeq;$U.Pair=iY.Pair;$U.Scalar=aY.Scalar;$U.YAMLMap=sY.YAMLMap;$U.YAMLSeq=nY.YAMLSeq;$U.CST=rY;$U.Lexer=oY.Lexer;$U.LineCounter=tY.LineCounter;$U.Parser=eY.Parser;$U.parse=X2.parse;$U.parseAllDocuments=X2.parseAllDocuments;$U.parseDocument=X2.parseDocument;$U.stringify=X2.stringify;$U.visit=M8.visit;$U.visitAsync=M8.visitAsync});var TX=r4(VX(),1),{program:c0,createCommand:sW,createArgument:nW,createOption:rW,CommanderError:oW,InvalidArgumentError:tW,InvalidOptionArgumentError:eW,Command:$V,Argument:XV,Option:o2,Help:ZV}=TX.default;var wX={name:"@pickled-dev/cli",version:"0.12.0",description:"Test what agents actually understand about your product",module:"dist/index.js",type:"module",bin:{pickled:"./dist/index.js"},files:["dist"],scripts:{dev:"bun run ./src/index.ts",build:"bun build ./src/index.ts --outdir ./dist --target bun --minify --external @anthropic-ai/claude-agent-sdk",release:"semantic-release"},dependencies:{commander:"^14.0.2",chalk:"^5.6.2","@anthropic-ai/claude-agent-sdk":"^0.3.0"},devDependencies:{"@pickled-dev/config":"workspace:*","@pickled-dev/core":"workspace:*","semantic-release":"^25.0.2","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/exec":"^7.1.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.2","semantic-release-ai-notes":"^0.3.0"}};import yW from"path";var z0={category:"cli",provider:"claude-code",model:"sonnet"},t2=["Read","Glob","Grep","Bash"],e2=["Edit","MultiEdit","Write","NotebookEdit"];var R8=r4(I8(),1);async function Z$($){let X=`${$}/pickled.yml`,Z=Bun.file(X);if(!await Z.exists())throw Error(`pickled.yml not found in ${$}`);let q;try{let z=await Z.text();q=R8.default.parse(z)}catch(z){throw Error(`Failed to parse pickled.yml: ${z}`)}return EU(q),q}function EU($){if(!$.tool?.name)throw Error("pickled.yml: 'tool.name' is required");if(!Array.isArray($.scenarios)||$.scenarios.length===0)throw Error("pickled.yml: 'scenarios' must be a non-empty array");if($.docs?.sources)for(let[Z,q]of Object.entries($.docs.sources))bU(Z,q);if($.targets)for(let[Z,q]of Object.entries($.targets)){if(q.systemPrompt!==void 0)throw Error(`pickled.yml: target "${Z}" sets 'systemPrompt', which bypasses the citation contract. Remove it; custom prompts are not supported in citation mode.`);if(q.provider==="codex-cli"){if(!q.model)throw Error(`pickled.yml: target "${Z}" (codex-cli) requires an explicit 'model' field. Codex's default model can change without notice; pin it for reproducible evals.`);if(q.maxTurns!==void 0)throw Error(`pickled.yml: target "${Z}" (codex-cli) sets 'maxTurns', but the codex CLI does not support a turn cap. Remove the field.`)}if(q.category==="api"){if(!q.model)throw Error(`pickled.yml: target "${Z}" (api/${q.provider}) requires an explicit 'model' field. Pickled does not substitute a default; reproducible evals depend on pinning the model.`);let z=["allowedTools","disallowedTools","mcpServers","permissionMode","maxTurns","maxThinkingTokens","maxBudgetUsd"];for(let G of z)if(q[G]!==void 0)throw Error(`pickled.yml: target "${Z}" (api/${q.provider}) sets '${G}', which only applies to CLI/Agent SDK targets. Remove the field; API targets accept only model/temperature/maxTokens/threshold.`);if(q.workspaceContext!==void 0)throw Error(`pickled.yml: target "${Z}" (api/${q.provider}) sets 'workspaceContext', which only applies to IDE targets. Remove the field.`)}}let X=new Set(Object.keys($.docs?.sources??{}));for(let Z of $.scenarios){if(!Z.name||!Z.prompt)throw Error("pickled.yml: every scenario needs 'name' and 'prompt'");if(!Array.isArray(Z.requiredSources))throw Error(`pickled.yml: scenario "${Z.name}" is missing 'requiredSources' (use [] to allow any citation)`);for(let q of Z.requiredSources)if(!X.has(q))throw Error(`pickled.yml: scenario "${Z.name}" references unknown source "${q}". Declared sources: ${[...X].join(", ")||"(none)"}`);fU(Z.name,Z.traps),CU(Z.name,Z.compareSurfaces,X)}}function CU($,X,Z){if(X===void 0)return;if(!Array.isArray(X))throw Error(`pickled.yml: scenario "${$}" compareSurfaces must be an array of source-id lists`);if(X.length===0)throw Error(`pickled.yml: scenario "${$}" compareSurfaces cannot be empty (use a non-empty list of surfaces, or remove the field)`);for(let q=0;q<X.length;q++){let z=X[q];if(!Array.isArray(z))throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${q}] must be an array of source ids`);if(z.length===0)throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${q}] must be a non-empty list of source ids`);for(let G of z){if(typeof G!=="string")throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${q}] entries must be string source ids`);if(!Z.has(G))throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${q}] references unknown source "${G}". Declared sources: ${[...Z].join(", ")||"(none)"}`)}}}function bU($,X){if(typeof X==="string"){if(X.length===0)throw Error(`pickled.yml: docs.sources["${$}"] string form must be a non-empty file path or URL`);return}if(!X||typeof X!=="object")throw Error(`pickled.yml: docs.sources["${$}"] must be a string (path/URL) or an object with a 'path' field`);let Z=X;if(typeof Z.path!=="string"||Z.path.length===0)throw Error(`pickled.yml: docs.sources["${$}"] object form requires a non-empty 'path' field`);if(Z.audit!==void 0){if(typeof Z.audit!=="object"||Z.audit===null)throw Error(`pickled.yml: docs.sources["${$}"].audit must be an object`);let q=Z.audit;if(q.traps!==void 0&&typeof q.traps!=="boolean")throw Error(`pickled.yml: docs.sources["${$}"].audit.traps must be a boolean`);for(let z of Object.keys(q))if(z!=="traps")throw Error(`pickled.yml: docs.sources["${$}"].audit has unknown field "${z}"`)}for(let q of Object.keys(Z))if(q!=="path"&&q!=="audit")throw Error(`pickled.yml: docs.sources["${$}"] has unknown field "${q}"`)}var yU=new Set(["g","y"]),xU=new Set(["i","m","s","u","v"]);function fU($,X){if(X===void 0)return;if(!Array.isArray(X))throw Error(`pickled.yml: scenario "${$}" has non-array 'traps'`);let Z=new Set;for(let q of X){if(!q.id||typeof q.id!=="string")throw Error(`pickled.yml: scenario "${$}" has a trap missing 'id'`);if(Z.has(q.id))throw Error(`pickled.yml: scenario "${$}" has duplicate trap id "${q.id}"`);if(Z.add(q.id),!q.reason||typeof q.reason!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${q.id}" requires non-empty 'reason'`);if(q.auditSeverity!==void 0&&q.auditSeverity!=="warning"&&q.auditSeverity!=="error")throw Error(`pickled.yml: scenario "${$}" trap "${q.id}" auditSeverity must be "warning" or "error"`);let z=typeof q.match==="string",G=typeof q.pattern==="string";if(z===G)throw Error(`pickled.yml: scenario "${$}" trap "${q.id}" must set exactly one of 'match' or 'pattern'`);if(z){if(q.match==="")throw Error(`pickled.yml: scenario "${$}" trap "${q.id}" has empty 'match'`);if(q.flags!==void 0)throw Error(`pickled.yml: scenario "${$}" trap "${q.id}" sets 'flags' without 'pattern'`)}else{let J=q.pattern;if(typeof J!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${q.id}" must set 'pattern'`);if(J==="")throw Error(`pickled.yml: scenario "${$}" trap "${q.id}" has empty 'pattern'`);if(q.flags!==void 0){if(typeof q.flags!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${q.id}" has non-string 'flags'`);for(let Q of q.flags){if(yU.has(Q))throw Error(`pickled.yml: scenario "${$}" trap "${q.id}" uses forbidden regex flag "${Q}" (g and y are not allowed)`);if(!xU.has(Q))throw Error(`pickled.yml: scenario "${$}" trap "${q.id}" uses unsupported regex flag "${Q}"`)}}try{new RegExp(J,q.flags??"")}catch(Q){throw Error(`pickled.yml: scenario "${$}" trap "${q.id}" has invalid regex pattern: ${Q instanceof Error?Q.message:Q}`)}}}}function W4($,X){let Z=new Set([...Object.keys($.targets??{}),"default"]);if(!Z.has(X)){let q=[...Z].sort().join(", ");throw Error(`Unknown target: "${X}". Available targets: ${q}`)}return{...$,matrix:{...$.matrix,target:[X]},scenarios:$.scenarios.filter((q)=>!q.target||q.target===X)}}function V4($){if(typeof $==="string")return{path:$,auditTraps:!0};return{path:$.path,auditTraps:$.audit?.traps??!0}}function Z2($){let{config:X,files:Z,pairs:q,findings:z}=$,G=[],J=z.filter((H)=>H.severity==="error").length,Q=z.filter((H)=>H.severity==="warning").length;if(G.push(`# Agent-context audit
167
+ `),G.push(`Target: \`${X.targetRepo}\``),G.push(`Budgets: root \u2264 ${X.budgets.rootLines} lines, nested warn at ${X.budgets.nestedWarnLines} lines.`),G.push(`Found ${Z.length} agent-doc files. ${J} error(s), ${Q} warning(s).
168
+ `),G.push(`## Inventory
169
+ `),Z.length===0)G.push(`No agent-doc files found.
170
+ `);else{G.push("| File | Lines | Kind | Notes |"),G.push("|---|---|---|---|");let H=[...Z].sort((V,w)=>w.lineCount-V.lineCount);for(let V of H){let w=!V.relPath.includes("/"),B=P8(V.lineCount,w,X),T=V.isSymlink?`symlink \u2192 ${V.symlinkTarget?.replace(`${X.targetRepo}/`,"")??"?"}`:"file";G.push(`| \`${V.relPath}\` | ${V.lineCount} | ${T} | ${B} |`)}G.push("")}if(G.push(`## AGENTS.md / CLAUDE.md pairs
171
+ `),q.length===0)G.push(`No pairs found.
172
+ `);else{G.push("| Directory | A | C | Class | Detail |"),G.push("|---|---|---|---|---|");for(let H of q)G.push(`| \`${H.dir||"(root)"}\` | ${H.agentsExists?"\u2713":"\xB7"} | ${H.claudeExists?"\u2713":"\xB7"} | ${H.classification} | ${H.detail} |`);G.push("")}let Y=Z.filter((H)=>!H.isSymlink&&H.brokenPathRefs.length+H.brokenImports.length>0);if(G.push(`## Broken references
173
+ `),Y.length===0)G.push(`None detected.
174
+ `);else for(let H of Y){if(G.push(`### \`${H.relPath}\`
175
+ `),H.brokenPathRefs.length>0){G.push("Broken path references:");for(let V of H.brokenPathRefs)G.push(` - \`${V}\``);G.push("")}if(H.brokenImports.length>0){G.push("Broken `@`-imports:");for(let V of H.brokenImports)G.push(` - \`${V}\``);G.push("")}}let U=Z.filter((H)=>!H.isSymlink&&H.unresolvedCommands.length>0);if(G.push(`## Unresolved package-manager commands (advisory)
176
+ `),G.push("Looks like a script command in markdown that did not match anything in the target `package.json` `scripts` or the `knownCommands` allowlist. Workspace-filtered commands check against root scripts, so false positives are expected. Review, do not fail CI on this.\n"),U.length===0)G.push(`None flagged.
177
+ `);else for(let H of U){G.push(`### \`${H.relPath}\`
178
+ `);for(let V of H.unresolvedCommands)G.push(` - \`${V}\``);G.push("")}let W=Z.filter((H)=>{if(H.isSymlink)return!1;return!H.relPath.includes("/")?H.lineCount>X.budgets.rootLines:H.lineCount>X.budgets.nestedWarnLines});if(G.push(`## Section breakdown for files over budget
179
+ `),W.length===0)G.push(`All files within budget.
180
+ `);else for(let H of W){G.push(`### \`${H.relPath}\` (${H.lineCount} lines)
181
+ `),G.push(`Largest H2 sections (lines including any subsections):
182
+ `),G.push("| Section | Lines |"),G.push("|---|---|");for(let V of H.sections.slice(0,10))G.push(`| ${V.header} | ${V.lines} |`);G.push("")}if(G.push(`## Registered-source trap matches
183
+ `),G.push("Catches stale claims in `docs.sources` against declared traps. Sources with `audit.traps: false` are excluded.\n"),$.sourceTrapMatches.length===0)G.push(`None.
184
+ `);else{for(let H of $.sourceTrapMatches)G.push(`- **${H.sourceId}** (\`${H.sourcePath}:L${H.line}\`) \u2014 trap \`${H.trapId}\` matched \`${H.matched}\` (${H.severity})`),G.push(` - reason: ${H.trapReason}`),G.push(" - fix: remove the stale claim, retire the trap, or set `audit.traps: false` on the source");G.push("")}return G.join(`
185
+ `)}function q2($){return JSON.stringify($,null,2)}function z2($){let{config:X,files:Z,pairs:q,findings:z}=$,G=[],J=z.filter((H)=>H.severity==="error").length,Q=z.filter((H)=>H.severity==="warning").length;if(G.push("pickled audit"),G.push(`Target: ${X.targetRepo}`),G.push(`Budgets: root \u2264 ${X.budgets.rootLines} lines, nested warn at ${X.budgets.nestedWarnLines} lines.`),G.push(`Found: ${Z.length} agent-doc file(s) \xB7 ${J} error(s) \xB7 ${Q} warning(s)`),G.push(""),G.push("Inventory"),Z.length===0)G.push(" none");else{let H=[...Z].sort((w,B)=>B.lineCount-w.lineCount),V=Math.max(...H.map((w)=>w.relPath.length));for(let w of H){let B=!w.relPath.includes("/"),T=P8(w.lineCount,B,X),L=w.isSymlink?`symlink \u2192 ${w.symlinkTarget?.replace(`${X.targetRepo}/`,"")??"?"}`:"file",D=`${w.lineCount}`.padStart(4),_=w.relPath.padEnd(V),O=T?` (${T})`:"";G.push(` ${_} ${D} lines ${L}${O}`)}}if(G.push(""),G.push("AGENTS.md / CLAUDE.md pairs"),q.length===0)G.push(" none");else for(let H of q){let V=H.dir||"(root)";G.push(` ${V}: ${H.classification} \xB7 ${H.detail}`)}G.push("");let Y=Z.filter((H)=>!H.isSymlink&&H.brokenPathRefs.length+H.brokenImports.length>0);if(G.push("Broken references"),Y.length===0)G.push(" none");else for(let H of Y){G.push(` ${H.relPath}:`);for(let V of H.brokenPathRefs)G.push(` path: ${V}`);for(let V of H.brokenImports)G.push(` @-import: ${V}`)}G.push("");let U=Z.filter((H)=>!H.isSymlink&&H.unresolvedCommands.length>0);if(G.push("Unresolved package-manager commands (advisory)"),U.length===0)G.push(" none");else for(let H of U){G.push(` ${H.relPath}:`);for(let V of H.unresolvedCommands)G.push(` ${V}`)}G.push("");let W=Z.filter((H)=>{if(H.isSymlink)return!1;return!H.relPath.includes("/")?H.lineCount>X.budgets.rootLines:H.lineCount>X.budgets.nestedWarnLines});if(G.push("Section breakdown for files over budget"),W.length===0)G.push(" all files within budget");else for(let H of W){G.push(` ${H.relPath} (${H.lineCount} lines):`);for(let V of H.sections.slice(0,10))G.push(` ${V.header.padEnd(40)} ${V.lines} lines`)}if(G.push(""),G.push("Registered-source trap matches"),$.sourceTrapMatches.length===0)G.push(" none");else for(let H of $.sourceTrapMatches){let V=H.severity==="error"?"error":"warning";G.push(` [${V}] ${H.sourceId} (${H.sourcePath}:L${H.line}): trap ${H.trapId} matched "${H.matched}"`),G.push(` reason: ${H.trapReason}`),G.push(" fix: remove the stale claim, retire the trap, or set audit.traps: false on the source")}return G.join(`
186
+ `)}function P8($,X,Z){if(X&&$>Z.budgets.rootLines)return`over root budget (${$} > ${Z.budgets.rootLines})`;if(!X&&$>Z.budgets.nestedWarnLines)return`over nested-warn (${$} > ${Z.budgets.nestedWarnLines})`;return""}import{existsSync as z$,lstatSync as E8,readFileSync as Q2,readlinkSync as pU,statSync as cU}from"fs";import{dirname as Y2,isAbsolute as lU,join as w4,relative as iU,resolve as L4}from"path";var{Glob:j8}=globalThis.Bun;var G2=["node_modules/**","**/node_modules/**",".git/**","**/.git/**","dist/**","**/dist/**","build/**","**/build/**",".next/**","**/.next/**",".turbo/**","**/.turbo/**",".cache/**","**/.cache/**",".runs/**","**/.runs/**","coverage/**","**/coverage/**","**/__fixtures__/**","**/tests/**/fixture/**","**/tests/**/fixtures/**","**/test/**/fixture/**","**/test/**/fixtures/**"],q$={targetRepo:".",budgets:{rootLines:120,nestedWarnLines:200},ignore:G2,intentionalDifferentPairs:[],knownCommands:[]};function J2($){if(!$)return q$;return{targetRepo:$.targetRepo??q$.targetRepo,budgets:{rootLines:$.budgets?.rootLines??q$.budgets.rootLines,nestedWarnLines:$.budgets?.nestedWarnLines??q$.budgets.nestedWarnLines},ignore:$.ignore??G2,intentionalDifferentPairs:$.intentionalDifferentPairs??[],knownCommands:$.knownCommands??[]}}import{existsSync as uU}from"fs";import{join as mU}from"path";function f0($){let X=[],Z=[];for(let q of $.traps){let z=kU($.response,q);if(z)X.push(z);else Z.push(q.id)}return{fired:X,avoided:Z}}function kU($,X){if(X.match!==void 0){let Z=$.indexOf(X.match);if(Z===-1)return null;return{id:X.id,reason:X.reason,matched:X.match,snippet:N8($,Z,X.match.length),index:Z}}if(X.pattern!==void 0){let q=new RegExp(X.pattern,X.flags??"").exec($);if(!q)return null;return{id:X.id,reason:X.reason,matched:q[0],snippet:N8($,q.index,q[0].length),index:q.index}}return null}function N8($,X,Z){let q=Math.max(0,X-40),z=Math.min($.length,X+Z+40),G=$.slice(q,z).replace(/\s+/g," ").trim();if(q>0)G=`...${G}`;if(z<$.length)G=`${G}...`;return G}import T4 from"path";function gU($){return $.startsWith("http://")||$.startsWith("https://")}async function hU($,X,Z){let q=await fetch(X);if(!q.ok)throw Error(`Failed to fetch source "${$}" from ${X}: ${q.status} ${q.statusText}`);let z=await q.text();return{id:$,source:X,content:z,name:new URL(X).hostname+new URL(X).pathname,type:"url",auditTraps:Z}}async function vU($,X,Z,q){let z=T4.isAbsolute(X)?X:T4.resolve(Z,X),G=Bun.file(z);if(!await G.exists())throw Error(`Source "${$}" not found at ${z}`);let J=await G.text();return{id:$,source:X,content:J,name:T4.basename(z),type:"file",auditTraps:q}}async function A8($,X,Z){let{path:q,auditTraps:z}=V4(X);if(gU(q))return hU($,q,z);return vU($,q,Z,z)}async function c$($,X){let Z=Object.entries($);return await Promise.all(Z.map(([z,G])=>A8(z,G,X)))}async function S8($){if(!uU(mU($,"pickled.yml")))return{matches:[],findings:[]};let X=await Z$($),Z=X.docs?.sources;if(!Z||Object.keys(Z).length===0)return{matches:[],findings:[]};let q={};for(let[U,W]of Object.entries(Z)){let H=typeof W==="string"?W:W.path;if(H.startsWith("http://")||H.startsWith("https://"))continue;q[U]=W}if(Object.keys(q).length===0)return{matches:[],findings:[]};let z=[],G=new Map;for(let U of X.scenarios)for(let W of U.traps??[])z.push(W),G.set(W,W.auditSeverity??"warning");if(z.length===0)return{matches:[],findings:[]};let J=await c$(q,$),Q=[],Y=[];for(let U of J){if(U.auditTraps===!1)continue;for(let W of z){let{fired:H}=f0({response:U.content,traps:[W]}),V=H[0];if(!V)continue;let w=dU(U.content,V.index),B=G.get(W)??"warning";Q.push({sourceId:U.id,sourcePath:U.source,trapId:V.id,trapReason:V.reason,matched:V.matched,snippet:V.snippet,line:w,severity:B}),Y.push({severity:B,category:"trap-source-match",file:U.source,message:`source [${U.id}] matches trap '${V.id}' ("${V.matched}"). ${V.reason} Fix: remove the stale claim from the source, retire the trap if no longer relevant, or set audit.traps: false on the source if it is deliberately stale or test-only.`})}}return{matches:Q,findings:Y}}function dU($,X){let Z=1,q=Math.min(X,$.length);for(let z=0;z<q;z++)if($[z]===`
187
+ `)Z++;return Z}var aU=["AGENTS.md","CLAUDE.md","CLAUDE.local.md","llms.txt","llms-full.txt",".claude/CLAUDE.md",".claude/rules/*.md","**/AGENTS.md","**/CLAUDE.md","**/CLAUDE.local.md","**/llms.txt","**/llms-full.txt","**/.claude/CLAUDE.md","**/.claude/rules/*.md"];async function U2($){let X=J2($),Z=L4(X.targetRepo);if(!z$(Z))throw Error(`targetRepo does not exist: ${Z}`);let q=new Set;for(let U of aU){let W=new j8(U);for await(let H of W.scan({cwd:Z,dot:!0,onlyFiles:!1,followSymlinks:!1})){if(X.ignore.some((B)=>new j8(B).match(H)))continue;let V=w4(Z,H),w=E8(V);if(w.isFile()){q.add(H);continue}if(w.isSymbolicLink())try{if(cU(V).isFile())q.add(H)}catch{}}}let z=[];for(let U of[...q].sort())z.push(await sU(Z,U,w4(Z,U),X));let G=JH(z,X),J=QH(z,G,X),{matches:Q,findings:Y}=await S8(Z);return{config:X,files:z,pairs:G,findings:[...J,...Y],sourceTrapMatches:Q}}async function sU($,X,Z,q){let G=E8(Z).isSymbolicLink(),J=null,Q=X;if(G){let V=pU(Z),w=lU(V)?V:L4(Y2(Z),V);if(J=w,z$(w))Q=iU($,w)}let Y=G&&J&&z$(J)?J:Z,U=Q2(Y,"utf8"),W=(U.match(/\n/g)??[]).length,H=U.endsWith(`
188
+ `)?W:W+1;return{relPath:X,absPath:Z,isSymlink:G,symlinkTarget:J,realRelPath:Q,lineCount:H,brokenPathRefs:rU(U,$,X),brokenImports:tU(U,Y2(Z)),unresolvedCommands:ZH(U,$,q.knownCommands),sections:qH(U)}}function nU($){let X=$.split("/");if(X.length<2)return null;if(X[0]==="packages"||X[0]==="apps"||X[0]==="shared")return`${X[0]}/${X[1]}`;if(X[0]==="tests")return X.slice(0,2).join("/");return null}function rU($,X,Z){let q=GH($),z=Y2(Z),G=nU(Z),J=new Set,Q=/`([^`\n]{2,200})`/g,Y;Y=Q.exec(q);while(Y!==null){let U=Y[1].trim().replace(/[#?].*$/,"");if(zH(U)&&!oU(X,U,z,G).found)J.add(U);Y=Q.exec(q)}return[...J].sort()}function oU($,X,Z,q){let z=[X];if(Z&&Z!==".")z.push(`${Z}/${X}`);if(q)z.push(`${q}/${X}`);z.push(`packages/${X}`,`apps/${X}`,`shared/${X}`);for(let G of z){let J=G.replace(/\/+/g,"/");if(z$(`${$}/${J}`))return{found:!0,resolvedAs:J}}return{found:!1}}function tU($,X){let Z=new Set,q=/@([\w./@~-]+\.md)/g,z;z=q.exec($);while(z!==null){let G=z[1];if(G.startsWith("~/")){z=q.exec($);continue}let J=G.startsWith("/")?G:L4(X,G);if(!z$(J))Z.add(G);z=q.exec($)}return[...Z].sort()}var eU=["bun","pnpm","npm","yarn"],$H=new Set(["install","add","remove","update","i","audit","list","ls","why","outdated","exec","run","create","init","x"]),XH={bun:new Set(["build","test","link","unlink","upgrade"])};function ZH($,X,Z){let q=new Set,z=w4(X,"package.json"),G=new Set;if(z$(z))try{let Q=JSON.parse(Q2(z,"utf8"));G=new Set(Object.keys(Q.scripts??{}))}catch{}let J=new Set(Z.map((Q)=>Q.trim()));for(let Q of eU){let Y=new RegExp(`\\b${Q}\\s+(?:run\\s+|--filter\\s+\\S+\\s+(?:run\\s+)?)?([a-zA-Z][\\w:.\\-]*)`,"g"),U;U=Y.exec($);while(U!==null){let W=U[1];if(!G.has(W)&&!J.has(`${Q} ${W}`)&&!J.has(`${Q} run ${W}`)&&!$H.has(W)&&!XH[Q]?.has(W))q.add(`${Q} ${W}`);U=Y.exec($)}}return[...q].sort()}function qH($){let X=$.split(`
189
+ `),Z=[],q=null;if(X.forEach((z,G)=>{if(/^##\s+/.test(z)){if(q)Z.push({header:q.header,lines:G-q.start});q={header:z.replace(/^##\s+/,"").trim(),start:G}}}),q){let z=q;Z.push({header:z.header,lines:X.length-z.start})}return Z.sort((z,G)=>G.lines-z.lines)}function zH($){if($.length===0||$.length>160)return!1;if(!$.includes("/"))return!1;if(/\s/.test($))return!1;if(/^https?:\/\//.test($))return!1;if(/[*?{}[\]<>]/.test($))return!1;if($.startsWith("@"))return!1;if($.startsWith("~/"))return!1;if(/^[a-z]+:\/\//i.test($))return!1;if(/^cdn\./.test($)||/^unpkg\./.test($)||/^npm\./.test($))return!1;if(/^\/[a-z]/.test($)&&/(?:icon|image|img|asset|file|path)/i.test($))return!1;if(/^(cd|pnpm|npm|yarn|bun|node|git|ls|cat|grep|find|sed|awk|mkdir|rm|mv|cp|echo|export|source|sudo|brew|docker|curl|wget)\b/.test($))return!1;return/[a-zA-Z0-9_.-]\/[a-zA-Z0-9_.-]/.test($)}function GH($){return $.replace(/```[\s\S]*?```/g,"")}function JH($,X){let Z=new Map;for(let G of $){let J=G.relPath.split("/").pop()??"";if(J!=="AGENTS.md"&&J!=="CLAUDE.md")continue;let Q=Y2(G.relPath),Y=Z.get(Q)??{};if(J==="AGENTS.md")Y.agents=G;if(J==="CLAUDE.md")Y.claude=G;Z.set(Q,Y)}let q=new Set(X.intentionalDifferentPairs),z=[];for(let[G,J]of Z){let Q=!!J.agents,Y=!!J.claude;if(!Q&&!Y)continue;if(!Q||!Y){z.push({dir:G,agentsExists:Q,claudeExists:Y,classification:"single",detail:Q?"only AGENTS.md":"only CLAUDE.md"});continue}let{agents:U,claude:W}=J,H=`${U.relPath}:${W.relPath}`,V=`${W.relPath}:${U.relPath}`;if(q.has(H)||q.has(V)){z.push({dir:G,agentsExists:Q,claudeExists:Y,classification:"intentional-different",detail:`allowlisted: ${U.lineCount}L vs ${W.lineCount}L`});continue}if(U.isSymlink&&U.symlinkTarget===W.absPath||W.isSymlink&&W.symlinkTarget===U.absPath){let L=U.isSymlink?"CLAUDE.md":"AGENTS.md";z.push({dir:G,agentsExists:Q,claudeExists:Y,classification:"linked",detail:`canonical: ${L}`});continue}let B=Q2(U.absPath,"utf8"),T=Q2(W.absPath,"utf8");if(B===T)z.push({dir:G,agentsExists:Q,claudeExists:Y,classification:"unexpected-duplicate",detail:`byte-for-byte duplicate (${U.lineCount}L), not symlinked`});else z.push({dir:G,agentsExists:Q,claudeExists:Y,classification:"unexpected-duplicate",detail:`divergent (${U.lineCount}L vs ${W.lineCount}L), not in intentional-different allowlist`})}return z.sort((G,J)=>G.dir.localeCompare(J.dir)),z}function QH($,X,Z){let q=[];for(let z of $){if(z.isSymlink)continue;for(let Q of z.brokenImports)q.push({severity:"error",category:"broken-import",file:z.relPath,message:`broken @-import: ${Q}`});for(let Q of z.brokenPathRefs)q.push({severity:"error",category:"broken-path-ref",file:z.relPath,message:`broken path reference: ${Q}`});for(let Q of z.unresolvedCommands)q.push({severity:"warning",category:"unresolved-command",file:z.relPath,message:`unresolved command: ${Q}`});let G=!z.relPath.includes("/"),J=G?Z.budgets.rootLines:Z.budgets.nestedWarnLines;if(z.lineCount>J)q.push({severity:"warning",category:"over-budget",file:z.relPath,message:`${z.lineCount} lines exceeds ${G?"root":"nested"} budget of ${J}`})}for(let z of X)if(z.classification==="unexpected-duplicate"){let G=z.detail.startsWith("divergent")?"error":"warning";q.push({severity:G,category:G==="error"?"divergent-pair":"duplicate-pair",file:z.dir||"(root)",message:`AGENTS.md / CLAUDE.md ${z.detail}`})}return q}function k0($){let X=$.confidence;if($.error)return{icon:"\u2717",label:"Error",confidence:X,tone:"error"};if($.traps.fired.length>0)return{icon:"\u2717",label:"Trap fired",confidence:X,tone:"error"};if($.answerable==="YES")return{icon:"\u2713",label:X>=90?"Well grounded":"Grounded",confidence:X,tone:"success"};if($.answerable==="PARTIAL")return{icon:"\u26A0",label:"Partially grounded",confidence:X,tone:"warning"};return{icon:"\u2717",label:"Ungrounded",confidence:X,tone:"error"}}function B4($){let X=YH($);if(X===null)return[];let Z=[],q=/^\s*-\s+\[([^\]]+)\]\s*(.*)$/gm,z=q.exec(X);while(z!==null)Z.push({id:z[1].trim(),note:z[2].trim()||void 0}),z=q.exec(X);return Z}function YH($){let Z=/^##\s+Sources\s*$/im.exec($);if(!Z)return null;let q=Z.index+Z[0].length,z=$.slice(q),G=/^##\s+/m.exec(z);return G?z.slice(0,G.index):z}function l$($){let X=B4($.response),Z=new Set(X.map((V)=>V.id)),q=new Set($.registeredIds),z=new Set($.requiredSources),G=[...Z],J=[...z].filter((V)=>!Z.has(V)),Q=[...Z].filter((V)=>!q.has(V)),Y=[...z],U,W,H;if(G.length===0)U="NO",W=0,H="No citations in response";else if(Q.length===G.length)U="NO",W=0,H=`All cited sources are unknown: ${Q.join(", ")}`;else if(J.length===0&&Q.length===0)U="YES",W=100,H=Y.length>0?`All required sources cited: ${Y.join(", ")}`:`Cited registered sources: ${G.join(", ")}`;else{U="PARTIAL";let V=Y.length>0?Y.length:1,w=Y.length-J.length,B=Y.length>0?w/V*100:60,T=Q.length*15;W=Math.max(0,Math.min(100,Math.round(B-T)));let L=[];if(J.length>0)L.push(`missing: ${J.join(", ")}`);if(Q.length>0)L.push(`unknown: ${Q.join(", ")}`);H=L.join("; ")}return{answerable:U,confidence:W,reason:H,citations:{cited:G,required:Y,missing:J,unknown:Q}}}var g0="0.40.1";var C8=!1,h0=void 0,K4=void 0,UH=void 0,HH=void 0,WH=void 0,b8=void 0,VH=void 0,H2=void 0,D4=void 0,y8=void 0,_4=void 0,W2=void 0,x8=void 0;function f8($,X={auto:!1}){if(C8)throw Error(`you must \`import '@anthropic-ai/sdk/shims/${$.kind}'\` before importing anything else from @anthropic-ai/sdk`);if(h0)throw Error(`can't \`import '@anthropic-ai/sdk/shims/${$.kind}'\` after \`import '@anthropic-ai/sdk/shims/${h0}'\``);C8=X.auto,h0=$.kind,K4=$.fetch,UH=$.Request,HH=$.Response,WH=$.Headers,b8=$.FormData,VH=$.Blob,H2=$.File,D4=$.ReadableStream,y8=$.getMultipartRequestOptions,_4=$.getDefaultAgent,W2=$.fileFromPath,x8=$.isFsReadStream}class F4{constructor($){this.body=$}get[Symbol.toStringTag](){return"MultipartBody"}}function k8({manuallyImported:$}={}){let X=$?"You may need to use polyfills":"Add one of these imports before your first `import \u2026 from '@anthropic-ai/sdk'`:\n- `import '@anthropic-ai/sdk/shims/node'` (if you're running on Node)\n- `import '@anthropic-ai/sdk/shims/web'` (otherwise)\n",Z,q,z,G;try{Z=fetch,q=Request,z=Response,G=Headers}catch(J){throw Error(`this environment is missing the following Web Fetch API type: ${J.message}. ${X}`)}return{kind:"web",fetch:Z,Request:q,Response:z,Headers:G,FormData:typeof FormData<"u"?FormData:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${X}`)}},Blob:typeof Blob<"u"?Blob:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${X}`)}},File:typeof File<"u"?File:class{constructor(){throw Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${X}`)}},ReadableStream:typeof ReadableStream<"u"?ReadableStream:class{constructor(){throw Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${X}`)}},getMultipartRequestOptions:async(J,Q)=>({...Q,body:new F4(J)}),getDefaultAgent:(J)=>{return},fileFromPath:()=>{throw Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/anthropics/anthropic-sdk-typescript#file-uploads")},isFsReadStream:(J)=>!1}}import{ReadStream as wH}from"fs";function g8(){let $=k8();function X(Z){return Z instanceof wH}return{...$,isFsReadStream:X}}var O4=()=>{if(!h0)f8(g8(),{auto:!0})};O4();class P extends Error{}class v extends P{constructor($,X,Z,q){super(`${v.makeMessage($,X,Z)}`);this.status=$,this.headers=q,this.request_id=q?.["request-id"],this.error=X}static makeMessage($,X,Z){let q=X?.message?typeof X.message==="string"?X.message:JSON.stringify(X.message):X?JSON.stringify(X):Z;if($&&q)return`${$} ${q}`;if($)return`${$} status code (no body)`;if(q)return q;return"(no status code or body)"}static generate($,X,Z,q){if(!$||!q)return new v0({message:Z,cause:F2(X)});let z=X;if($===400)return new V2($,z,Z,q);if($===401)return new T2($,z,Z,q);if($===403)return new w2($,z,Z,q);if($===404)return new L2($,z,Z,q);if($===409)return new B2($,z,Z,q);if($===422)return new K2($,z,Z,q);if($===429)return new D2($,z,Z,q);if($>=500)return new _2($,z,Z,q);return new v($,z,Z,q)}}class m extends v{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}}class v0 extends v{constructor({message:$,cause:X}){super(void 0,void 0,$||"Connection error.",void 0);if(X)this.cause=X}}class i$ extends v0{constructor({message:$}={}){super({message:$??"Request timed out."})}}class V2 extends v{}class T2 extends v{}class w2 extends v{}class L2 extends v{}class B2 extends v{}class K2 extends v{}class D2 extends v{}class _2 extends v{}var O2=function($,X,Z,q,z){if(q==="m")throw TypeError("Private method is not writable");if(q==="a"&&!z)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return q==="a"?z.call($,Z):z?z.value=Z:X.set($,Z),Z},u0=function($,X,Z,q){if(Z==="a"&&!q)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!q:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?q:Z==="a"?q.call($):q?q.value:X.get($)},l;class R0{constructor(){l.set(this,void 0),this.buffer=new Uint8Array,O2(this,l,null,"f")}decode($){if($==null)return[];let X=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?new TextEncoder().encode($):$,Z=new Uint8Array(this.buffer.length+X.length);Z.set(this.buffer),Z.set(X,this.buffer.length),this.buffer=Z;let q=[],z;while((z=BH(this.buffer,u0(this,l,"f")))!=null){if(z.carriage&&u0(this,l,"f")==null){O2(this,l,z.index,"f");continue}if(u0(this,l,"f")!=null&&(z.index!==u0(this,l,"f")+1||z.carriage)){q.push(this.decodeText(this.buffer.slice(0,u0(this,l,"f")-1))),this.buffer=this.buffer.slice(u0(this,l,"f")),O2(this,l,null,"f");continue}let G=u0(this,l,"f")!==null?z.preceding-1:z.preceding,J=this.decodeText(this.buffer.slice(0,G));q.push(J),this.buffer=this.buffer.slice(z.index),O2(this,l,null,"f")}return q}decodeText($){if($==null)return"";if(typeof $==="string")return $;if(typeof Buffer<"u"){if($ instanceof Buffer)return $.toString();if($ instanceof Uint8Array)return Buffer.from($).toString();throw new P(`Unexpected: received non-Uint8Array (${$.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if(typeof TextDecoder<"u"){if($ instanceof Uint8Array||$ instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode($);throw new P(`Unexpected: received non-Uint8Array/ArrayBuffer (${$.constructor.name}) in a web platform. Please report this error.`)}throw new P("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){if(!this.buffer.length)return[];return this.decode(`
190
+ `)}}l=new WeakMap;R0.NEWLINE_CHARS=new Set([`
191
+ `,"\r"]);R0.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function BH($,X){for(let z=X??0;z<$.length;z++){if($[z]===10)return{preceding:z,index:z+1,carriage:!1};if($[z]===13)return{preceding:z,index:z+1,carriage:!0}}return null}function h8($){for(let q=0;q<$.length-1;q++){if($[q]===10&&$[q+1]===10)return q+2;if($[q]===13&&$[q+1]===13)return q+2;if($[q]===13&&$[q+1]===10&&q+3<$.length&&$[q+2]===13&&$[q+3]===10)return q+4}return-1}function a$($){if($[Symbol.asyncIterator])return $;let X=$.getReader();return{async next(){try{let Z=await X.read();if(Z?.done)X.releaseLock();return Z}catch(Z){throw X.releaseLock(),Z}},async return(){let Z=X.cancel();return X.releaseLock(),await Z,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}class i{constructor($,X){this.iterator=$,this.controller=X}static fromSSEResponse($,X){let Z=!1;async function*q(){if(Z)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Z=!0;let z=!1;try{for await(let G of KH($,X)){if(G.event==="completion")try{yield JSON.parse(G.data)}catch(J){throw console.error("Could not parse message into JSON:",G.data),console.error("From chunk:",G.raw),J}if(G.event==="message_start"||G.event==="message_delta"||G.event==="message_stop"||G.event==="content_block_start"||G.event==="content_block_delta"||G.event==="content_block_stop")try{yield JSON.parse(G.data)}catch(J){throw console.error("Could not parse message into JSON:",G.data),console.error("From chunk:",G.raw),J}if(G.event==="ping")continue;if(G.event==="error")throw v.generate(void 0,`SSE Error: ${G.data}`,G.data,M4($.headers))}z=!0}catch(G){if(G instanceof Error&&G.name==="AbortError")return;throw G}finally{if(!z)X.abort()}}return new i(q,X)}static fromReadableStream($,X){let Z=!1;async function*q(){let G=new R0,J=a$($);for await(let Q of J)for(let Y of G.decode(Q))yield Y;for(let Q of G.flush())yield Q}async function*z(){if(Z)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Z=!0;let G=!1;try{for await(let J of q()){if(G)continue;if(J)yield JSON.parse(J)}G=!0}catch(J){if(J instanceof Error&&J.name==="AbortError")return;throw J}finally{if(!G)X.abort()}}return new i(z,X)}[Symbol.asyncIterator](){return this.iterator()}tee(){let $=[],X=[],Z=this.iterator(),q=(z)=>{return{next:()=>{if(z.length===0){let G=Z.next();$.push(G),X.push(G)}return z.shift()}}};return[new i(()=>q($),this.controller),new i(()=>q(X),this.controller)]}toReadableStream(){let $=this,X,Z=new TextEncoder;return new D4({async start(){X=$[Symbol.asyncIterator]()},async pull(q){try{let{value:z,done:G}=await X.next();if(G)return q.close();let J=Z.encode(JSON.stringify(z)+`
192
+ `);q.enqueue(J)}catch(z){q.error(z)}},async cancel(){await X.return?.()}})}}async function*KH($,X){if(!$.body)throw X.abort(),new P("Attempted to iterate over a response with no body");let Z=new v8,q=new R0,z=a$($.body);for await(let G of DH(z))for(let J of q.decode(G)){let Q=Z.decode(J);if(Q)yield Q}for(let G of q.flush()){let J=Z.decode(G);if(J)yield J}}async function*DH($){let X=new Uint8Array;for await(let Z of $){if(Z==null)continue;let q=Z instanceof ArrayBuffer?new Uint8Array(Z):typeof Z==="string"?new TextEncoder().encode(Z):Z,z=new Uint8Array(X.length+q.length);z.set(X),z.set(q,X.length),X=z;let G;while((G=h8(X))!==-1)yield X.slice(0,G),X=X.slice(G)}if(X.length>0)yield X}class v8{constructor(){this.event=null,this.data=[],this.chunks=[]}decode($){if($.endsWith("\r"))$=$.substring(0,$.length-1);if(!$){if(!this.event&&!this.data.length)return null;let z={event:this.event,data:this.data.join(`
193
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],z}if(this.chunks.push($),$.startsWith(":"))return null;let[X,Z,q]=_H($,":");if(q.startsWith(" "))q=q.substring(1);if(X==="event")this.event=q;else if(X==="data")this.data.push(q);return null}}function _H($,X){let Z=$.indexOf(X);if(Z!==-1)return[$.substring(0,Z),X,$.substring(Z+X.length)];return[$,"",""]}var FH=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function",OH=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&s$($),s$=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function";async function u8($,X,Z){if($=await $,OH($))return $;if(FH($)){let z=await $.blob();X||(X=new URL($.url).pathname.split(/[\\/]/).pop()??"unknown_file");let G=s$(z)?[await z.arrayBuffer()]:[z];return new H2(G,X,Z)}let q=await MH($);if(X||(X=RH($)??"unknown_file"),!Z?.type){let z=q[0]?.type;if(typeof z==="string")Z={...Z,type:z}}return new H2(q,X,Z)}async function MH($){let X=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)X.push($);else if(s$($))X.push(await $.arrayBuffer());else if(PH($))for await(let Z of $)X.push(Z);else throw Error(`Unexpected data type: ${typeof $}; constructor: ${$?.constructor?.name}; props: ${IH($)}`);return X}function IH($){return`[${Object.getOwnPropertyNames($).map((Z)=>`"${Z}"`).join(", ")}]`}function RH($){return I4($.name)||I4($.filename)||I4($.path)?.split(/[\\/]/).pop()}var I4=($)=>{if(typeof $==="string")return $;if(typeof Buffer<"u"&&$ instanceof Buffer)return String($);return},PH=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",R4=($)=>$&&typeof $==="object"&&$.body&&$[Symbol.toStringTag]==="MultipartBody";var AH=function($,X,Z,q,z){if(q==="m")throw TypeError("Private method is not writable");if(q==="a"&&!z)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return q==="a"?z.call($,Z):z?z.value=Z:X.set($,Z),Z},SH=function($,X,Z,q){if(Z==="a"&&!q)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!q:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?q:Z==="a"?q.call($):q?q.value:X.get($)},M2;O4();async function l8($){let{response:X}=$;if($.options.stream){if(G$("response",X.status,X.url,X.headers,X.body),$.options.__streamClass)return $.options.__streamClass.fromSSEResponse(X,$.controller);return i.fromSSEResponse(X,$.controller)}if(X.status===204)return null;if($.options.__binaryResponse)return X;let q=X.headers.get("content-type")?.split(";")[0]?.trim();if(q?.includes("application/json")||q?.endsWith("+json")){let J=await X.json();return G$("response",X.status,X.url,X.headers,J),i8(J,X)}let G=await X.text();return G$("response",X.status,X.url,X.headers,G),G}function i8($,X){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:X.headers.get("request-id"),enumerable:!1})}class R2 extends Promise{constructor($,X=l8){super((Z)=>{Z(null)});this.responsePromise=$,this.parseResponse=X}_thenUnwrap($){return new R2(this.responsePromise,async(X)=>i8($(await this.parseResponse(X),X),X.response))}asResponse(){return this.responsePromise.then(($)=>$.response)}async withResponse(){let[$,X]=await Promise.all([this.parse(),this.asResponse()]);return{data:$,response:X,request_id:X.headers.get("request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then(this.parseResponse);return this.parsedPromise}then($,X){return this.parse().then($,X)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}}class N4{constructor({baseURL:$,maxRetries:X=2,timeout:Z=600000,httpAgent:q,fetch:z}){this.baseURL=$,this.maxRetries=P4("maxRetries",X),this.timeout=P4("timeout",Z),this.httpAgent=q,this.fetch=z??K4}authHeaders($){return{}}defaultHeaders($){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...bH(),...this.authHeaders($)}}validateHeaders($,X){}defaultIdempotencyKey(){return`stainless-node-retry-${gH()}`}get($,X){return this.methodRequest("get",$,X)}post($,X){return this.methodRequest("post",$,X)}patch($,X){return this.methodRequest("patch",$,X)}put($,X){return this.methodRequest("put",$,X)}delete($,X){return this.methodRequest("delete",$,X)}methodRequest($,X,Z){return this.request(Promise.resolve(Z).then(async(q)=>{let z=q&&s$(q?.body)?new DataView(await q.body.arrayBuffer()):q?.body instanceof DataView?q.body:q?.body instanceof ArrayBuffer?new DataView(q.body):q&&ArrayBuffer.isView(q?.body)?new DataView(q.body.buffer):q?.body;return{method:$,path:X,...q,body:z}}))}getAPIList($,X,Z){return this.requestAPIList(X,{method:"get",path:$,...Z})}calculateContentLength($){if(typeof $==="string"){if(typeof Buffer<"u")return Buffer.byteLength($,"utf8").toString();if(typeof TextEncoder<"u")return new TextEncoder().encode($).length.toString()}else if(ArrayBuffer.isView($))return $.byteLength.toString();return null}buildRequest($,{retryCount:X=0}={}){let Z={...$},{method:q,path:z,query:G,headers:J={}}=Z,Q=ArrayBuffer.isView(Z.body)||Z.__binaryRequest&&typeof Z.body==="string"?Z.body:R4(Z.body)?Z.body.body:Z.body?JSON.stringify(Z.body,null,2):null,Y=this.calculateContentLength(Q),U=this.buildURL(z,G);if("timeout"in Z)P4("timeout",Z.timeout);Z.timeout=Z.timeout??this.timeout;let W=Z.httpAgent??this.httpAgent??_4(U),H=Z.timeout+1000;if(typeof W?.options?.timeout==="number"&&H>(W.options.timeout??0))W.options.timeout=H;if(this.idempotencyHeader&&q!=="get"){if(!$.idempotencyKey)$.idempotencyKey=this.defaultIdempotencyKey();J[this.idempotencyHeader]=$.idempotencyKey}let V=this.buildHeaders({options:Z,headers:J,contentLength:Y,retryCount:X});return{req:{method:q,...Q&&{body:Q},headers:V,...W&&{agent:W},signal:Z.signal??null},url:U,timeout:Z.timeout}}buildHeaders({options:$,headers:X,contentLength:Z,retryCount:q}){let z={};if(Z)z["content-length"]=Z;let G=this.defaultHeaders($);if(c8(z,G),c8(z,X),R4($.body)&&h0!=="node")delete z["content-type"];if(I2(G,"x-stainless-retry-count")===void 0&&I2(X,"x-stainless-retry-count")===void 0)z["x-stainless-retry-count"]=String(q);if(I2(G,"x-stainless-timeout")===void 0&&I2(X,"x-stainless-timeout")===void 0&&$.timeout)z["x-stainless-timeout"]=String(Math.trunc($.timeout/1000));return this.validateHeaders(z,X),z}_calculateNonstreamingTimeout($){if(3600*$/128000>600)throw new P("Streaming is strongly recommended for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-python#streaming-responses for more details");return 600000}async prepareOptions($){}async prepareRequest($,{url:X,options:Z}){}parseHeaders($){return!$?{}:(Symbol.iterator in $)?Object.fromEntries(Array.from($).map((X)=>[...X])):{...$}}makeStatusError($,X,Z,q){return v.generate($,X,Z,q)}request($,X=null){return new R2(this.makeRequest($,X))}async makeRequest($,X){let Z=await $,q=Z.maxRetries??this.maxRetries;if(X==null)X=q;await this.prepareOptions(Z);let{req:z,url:G,timeout:J}=this.buildRequest(Z,{retryCount:q-X});if(await this.prepareRequest(z,{url:G,options:Z}),G$("request",G,Z,z.headers),Z.signal?.aborted)throw new m;let Q=new AbortController,Y=await this.fetchWithTimeout(G,z,J,Q).catch(F2);if(Y instanceof Error){if(Z.signal?.aborted)throw new m;if(X)return this.retryRequest(Z,X);if(Y.name==="AbortError")throw new i$;throw new v0({cause:Y})}let U=M4(Y.headers);if(!Y.ok){if(X&&this.shouldRetry(Y)){let T=`retrying, ${X} attempts remaining`;return G$(`response (error; ${T})`,Y.status,G,U),this.retryRequest(Z,X,U)}let W=await Y.text().catch((T)=>F2(T).message),H=yH(W),V=H?void 0:W;throw G$(`response (error; ${X?"(error; no more retries left)":"(error; not retryable)"})`,Y.status,G,U,V),this.makeStatusError(Y.status,H,V,U)}return{response:Y,options:Z,controller:Q}}requestAPIList($,X){let Z=this.makeRequest(X,null);return new a8(this,Z,$)}buildURL($,X){let Z=fH($)?new URL($):new URL(this.baseURL+(this.baseURL.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),q=this.defaultQuery();if(!s8(q))X={...q,...X};if(typeof X==="object"&&X&&!Array.isArray(X))Z.search=this.stringifyQuery(X);return Z.toString()}stringifyQuery($){return Object.entries($).filter(([X,Z])=>typeof Z<"u").map(([X,Z])=>{if(typeof Z==="string"||typeof Z==="number"||typeof Z==="boolean")return`${encodeURIComponent(X)}=${encodeURIComponent(Z)}`;if(Z===null)return`${encodeURIComponent(X)}=`;throw new P(`Cannot stringify type ${typeof Z}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}async fetchWithTimeout($,X,Z,q){let{signal:z,...G}=X||{};if(z)z.addEventListener("abort",()=>q.abort());let J=setTimeout(()=>q.abort(),Z),Q={signal:q.signal,...G};if(Q.method)Q.method=Q.method.toUpperCase();let Y=60000,U=setTimeout(()=>{if(Q&&Q?.agent?.sockets){for(let W of Object.values(Q?.agent?.sockets).flat())if(W?.setKeepAlive)W.setKeepAlive(!0,Y)}},Y);return this.fetch.call(void 0,$,Q).finally(()=>{clearTimeout(J),clearTimeout(U)})}shouldRetry($){let X=$.headers.get("x-should-retry");if(X==="true")return!0;if(X==="false")return!1;if($.status===408)return!0;if($.status===409)return!0;if($.status===429)return!0;if($.status>=500)return!0;return!1}async retryRequest($,X,Z){let q,z=Z?.["retry-after-ms"];if(z){let J=parseFloat(z);if(!Number.isNaN(J))q=J}let G=Z?.["retry-after"];if(G&&!q){let J=parseFloat(G);if(!Number.isNaN(J))q=J*1000;else q=Date.parse(G)-Date.now()}if(!(q&&0<=q&&q<60000)){let J=$.maxRetries??this.maxRetries;q=this.calculateDefaultRetryTimeoutMillis(X,J)}return await kH(q),this.makeRequest($,X-1)}calculateDefaultRetryTimeoutMillis($,X){let z=X-$,G=Math.min(0.5*Math.pow(2,z),8),J=1-Math.random()*0.25;return G*J*1000}getUserAgent(){return`${this.constructor.name}/JS ${g0}`}}class A4{constructor($,X,Z,q){M2.set(this,void 0),AH(this,M2,$,"f"),this.options=q,this.response=X,this.body=Z}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageInfo()!=null}async getNextPage(){let $=this.nextPageInfo();if(!$)throw new P("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");let X={...this.options};if("params"in $&&typeof X.query==="object")X.query={...X.query,...$.params};else if("url"in $){let Z=[...Object.entries(X.query||{}),...$.url.searchParams.entries()];for(let[q,z]of Z)$.url.searchParams.set(q,z);X.query=void 0,X.path=$.url.toString()}return await SH(this,M2,"f").requestAPIList(this.constructor,X)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(M2=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let X of $.getPaginatedItems())yield X}}class a8 extends R2{constructor($,X,Z){super(X,async(q)=>new Z($,q.response,await l8(q),q.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let X of $)yield X}}var M4=($)=>{return new Proxy(Object.fromEntries($.entries()),{get(X,Z){let q=Z.toString();return X[q.toLowerCase()]||X[q]}})},jH={method:!0,path:!0,query:!0,body:!0,headers:!0,maxRetries:!0,stream:!0,timeout:!0,httpAgent:!0,signal:!0,idempotencyKey:!0,__binaryRequest:!0,__binaryResponse:!0,__streamClass:!0},r=($)=>{return typeof $==="object"&&$!==null&&!s8($)&&Object.keys($).every((X)=>n8(jH,X))},EH=()=>{if(typeof Deno<"u"&&Deno.build!=null)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":g0,"X-Stainless-OS":d8(Deno.build.os),"X-Stainless-Arch":m8(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":g0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":process.version};if(Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":g0,"X-Stainless-OS":d8(process.platform),"X-Stainless-Arch":m8(process.arch),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":process.version};let $=CH();if($)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":g0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${$.browser}`,"X-Stainless-Runtime-Version":$.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":g0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function CH(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:X,pattern:Z}of $){let q=Z.exec(navigator.userAgent);if(q){let z=q[1]||0,G=q[2]||0,J=q[3]||0;return{browser:X,version:`${z}.${G}.${J}`}}}return null}var m8=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},d8=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},p8,bH=()=>{return p8??(p8=EH())},yH=($)=>{try{return JSON.parse($)}catch(X){return}},xH=/^[a-z][a-z0-9+.-]*:/i,fH=($)=>{return xH.test($)},kH=($)=>new Promise((X)=>setTimeout(X,$)),P4=($,X)=>{if(typeof X!=="number"||!Number.isInteger(X))throw new P(`${$} must be an integer`);if(X<0)throw new P(`${$} must be a positive integer`);return X},F2=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null)try{return Error(JSON.stringify($))}catch{}return Error(String($))};var P2=($)=>{if(typeof process<"u")return process.env?.[$]?.trim()??void 0;if(typeof Deno<"u")return Deno.env?.get?.($)?.trim();return};function s8($){if(!$)return!0;for(let X in $)return!1;return!0}function n8($,X){return Object.prototype.hasOwnProperty.call($,X)}function c8($,X){for(let Z in X){if(!n8(X,Z))continue;let q=Z.toLowerCase();if(!q)continue;let z=X[Z];if(z===null)delete $[q];else if(z!==void 0)$[q]=z}}function G$($,...X){if(typeof process<"u"&&process?.env?.DEBUG==="true")console.log(`Anthropic:DEBUG:${$}`,...X)}var gH=()=>{return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,($)=>{let X=Math.random()*16|0;return($==="x"?X:X&3|8).toString(16)})},r8=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},hH=($)=>{return typeof $?.get==="function"};var I2=($,X)=>{let Z=X.toLowerCase();if(hH($)){let q=X[0]?.toUpperCase()+X.substring(1).replace(/([^\w])(\w)/g,(z,G,J)=>G+J.toUpperCase());for(let z of[X,Z,X.toUpperCase(),q]){let G=$.get(z);if(G)return G}}for(let[q,z]of Object.entries($))if(q.toLowerCase()===Z){if(Array.isArray(z)){if(z.length<=1)return z[0];return console.warn(`Received ${z.length} entries for the ${X} header, using the first entry.`),z[0]}return z}return};class W0 extends A4{constructor($,X,Z,q){super($,X,Z,q);this.data=Z.data||[],this.has_more=Z.has_more||!1,this.first_id=Z.first_id||null,this.last_id=Z.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageParams(){let $=this.nextPageInfo();if(!$)return null;if("params"in $)return $.params;let X=Object.fromEntries($.url.searchParams);if(!Object.keys(X).length)return null;return X}nextPageInfo(){if(this.options.query?.before_id){let X=this.first_id;if(!X)return null;return{params:{before_id:X}}}let $=this.last_id;if(!$)return null;return{params:{after_id:$}}}}class u{constructor($){this._client=$}}class J$ extends u{retrieve($,X){return this._client.get(`/v1/models/${$}?beta=true`,X)}list($={},X){if(r($))return this.list({},$);return this._client.getAPIList("/v1/models?beta=true",n$,{query:$,...X})}}class n$ extends W0{}J$.BetaModelInfosPage=n$;class Q${constructor($,X){this.iterator=$,this.controller=X}async*decoder(){let $=new R0;for await(let X of this.iterator)for(let Z of $.decode(X))yield JSON.parse(Z);for(let X of $.flush())yield JSON.parse(X)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse($,X){if(!$.body)throw X.abort(),new P("Attempted to iterate over a response with no body");return new Q$(a$($.body),X)}}class Y$ extends u{create($,X){let{betas:Z,...q}=$;return this._client.post("/v1/messages/batches?beta=true",{body:q,...X,headers:{"anthropic-beta":[...Z??[],"message-batches-2024-09-24"].toString(),...X?.headers}})}retrieve($,X={},Z){if(r(X))return this.retrieve($,{},X);let{betas:q}=X;return this._client.get(`/v1/messages/batches/${$}?beta=true`,{...Z,headers:{"anthropic-beta":[...q??[],"message-batches-2024-09-24"].toString(),...Z?.headers}})}list($={},X){if(r($))return this.list({},$);let{betas:Z,...q}=$;return this._client.getAPIList("/v1/messages/batches?beta=true",r$,{query:q,...X,headers:{"anthropic-beta":[...Z??[],"message-batches-2024-09-24"].toString(),...X?.headers}})}delete($,X={},Z){if(r(X))return this.delete($,{},X);let{betas:q}=X;return this._client.delete(`/v1/messages/batches/${$}?beta=true`,{...Z,headers:{"anthropic-beta":[...q??[],"message-batches-2024-09-24"].toString(),...Z?.headers}})}cancel($,X={},Z){if(r(X))return this.cancel($,{},X);let{betas:q}=X;return this._client.post(`/v1/messages/batches/${$}/cancel?beta=true`,{...Z,headers:{"anthropic-beta":[...q??[],"message-batches-2024-09-24"].toString(),...Z?.headers}})}async results($,X={},Z){if(r(X))return this.results($,{},X);let q=await this.retrieve($);if(!q.results_url)throw new P(`No batch \`results_url\`; Has it finished processing? ${q.processing_status} - ${q.id}`);let{betas:z}=X;return this._client.get(q.results_url,{...Z,headers:{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...Z?.headers},stream:!0,__binaryResponse:!0})._thenUnwrap((G,J)=>Q$.fromResponse(J.response,J.controller))}}class r$ extends W0{}Y$.BetaMessageBatchesPage=r$;var dH=($)=>{let X=0,Z=[];while(X<$.length){let q=$[X];if(q==="\\"){X++;continue}if(q==="{"){Z.push({type:"brace",value:"{"}),X++;continue}if(q==="}"){Z.push({type:"brace",value:"}"}),X++;continue}if(q==="["){Z.push({type:"paren",value:"["}),X++;continue}if(q==="]"){Z.push({type:"paren",value:"]"}),X++;continue}if(q===":"){Z.push({type:"separator",value:":"}),X++;continue}if(q===","){Z.push({type:"delimiter",value:","}),X++;continue}if(q==='"'){let Q="",Y=!1;q=$[++X];while(q!=='"'){if(X===$.length){Y=!0;break}if(q==="\\"){if(X++,X===$.length){Y=!0;break}Q+=q+$[X],q=$[++X]}else Q+=q,q=$[++X]}if(q=$[++X],!Y)Z.push({type:"string",value:Q});continue}if(q&&/\s/.test(q)){X++;continue}let G=/[0-9]/;if(q&&G.test(q)||q==="-"||q==="."){let Q="";if(q==="-")Q+=q,q=$[++X];while(q&&G.test(q)||q===".")Q+=q,q=$[++X];Z.push({type:"number",value:Q});continue}let J=/[a-z]/i;if(q&&J.test(q)){let Q="";while(q&&J.test(q)){if(X===$.length)break;Q+=q,q=$[++X]}if(Q=="true"||Q=="false"||Q==="null")Z.push({type:"name",value:Q});else{X++;continue}continue}X++}return Z},U$=($)=>{if($.length===0)return $;let X=$[$.length-1];switch(X.type){case"separator":return $=$.slice(0,$.length-1),U$($);break;case"number":let Z=X.value[X.value.length-1];if(Z==="."||Z==="-")return $=$.slice(0,$.length-1),U$($);case"string":let q=$[$.length-2];if(q?.type==="delimiter")return $=$.slice(0,$.length-1),U$($);else if(q?.type==="brace"&&q.value==="{")return $=$.slice(0,$.length-1),U$($);break;case"delimiter":return $=$.slice(0,$.length-1),U$($);break}return $},pH=($)=>{let X=[];if($.map((Z)=>{if(Z.type==="brace")if(Z.value==="{")X.push("}");else X.splice(X.lastIndexOf("}"),1);if(Z.type==="paren")if(Z.value==="[")X.push("]");else X.splice(X.lastIndexOf("]"),1)}),X.length>0)X.reverse().map((Z)=>{if(Z==="}")$.push({type:"brace",value:"}"});else if(Z==="]")$.push({type:"paren",value:"]"})});return $},cH=($)=>{let X="";return $.map((Z)=>{switch(Z.type){case"string":X+='"'+Z.value+'"';break;default:X+=Z.value;break}}),X},N2=($)=>JSON.parse(cH(pH(U$(dH($)))));var d=function($,X,Z,q,z){if(q==="m")throw TypeError("Private method is not writable");if(q==="a"&&!z)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return q==="a"?z.call($,Z):z?z.value=Z:X.set($,Z),Z},A=function($,X,Z,q){if(Z==="a"&&!q)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!q:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?q:Z==="a"?q.call($):q?q.value:X.get($)},o,P0,o$,A2,t$,e$,S2,$1,V0,X1,j2,E2,H$,C2,b2,S4,o8,j4,E4,C4,b4,t8,e8="__json_buf";class Z1{constructor(){o.add(this),this.messages=[],this.receivedMessages=[],P0.set(this,void 0),this.controller=new AbortController,o$.set(this,void 0),A2.set(this,()=>{}),t$.set(this,()=>{}),e$.set(this,void 0),S2.set(this,()=>{}),$1.set(this,()=>{}),V0.set(this,{}),X1.set(this,!1),j2.set(this,!1),E2.set(this,!1),H$.set(this,!1),C2.set(this,void 0),b2.set(this,void 0),j4.set(this,($)=>{if(d(this,j2,!0,"f"),$ instanceof Error&&$.name==="AbortError")$=new m;if($ instanceof m)return d(this,E2,!0,"f"),this._emit("abort",$);if($ instanceof P)return this._emit("error",$);if($ instanceof Error){let X=new P($.message);return X.cause=$,this._emit("error",X)}return this._emit("error",new P(String($)))}),d(this,o$,new Promise(($,X)=>{d(this,A2,$,"f"),d(this,t$,X,"f")}),"f"),d(this,e$,new Promise(($,X)=>{d(this,S2,$,"f"),d(this,$1,X,"f")}),"f"),A(this,o$,"f").catch(()=>{}),A(this,e$,"f").catch(()=>{})}get response(){return A(this,C2,"f")}get request_id(){return A(this,b2,"f")}async withResponse(){let $=await A(this,o$,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let X=new Z1;return X._run(()=>X._fromReadableStream($)),X}static createMessage($,X,Z){let q=new Z1;for(let z of X.messages)q._addMessageParam(z);return q._run(()=>q._createMessage($,{...X,stream:!0},{...Z,headers:{...Z?.headers,"X-Stainless-Helper-Method":"stream"}})),q}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},A(this,j4,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,X=!0){if(this.receivedMessages.push($),X)this._emit("message",$)}async _createMessage($,X,Z){let q=Z?.signal;if(q){if(q.aborted)this.controller.abort();q.addEventListener("abort",()=>this.controller.abort())}A(this,o,"m",E4).call(this);let{response:z,data:G}=await $.create({...X,stream:!0},{...Z,signal:this.controller.signal}).withResponse();this._connected(z);for await(let J of G)A(this,o,"m",C4).call(this,J);if(G.controller.signal?.aborted)throw new m;A(this,o,"m",b4).call(this)}_connected($){if(this.ended)return;d(this,C2,$,"f"),d(this,b2,$?.headers.get("request-id"),"f"),A(this,A2,"f").call(this,$),this._emit("connect")}get ended(){return A(this,X1,"f")}get errored(){return A(this,j2,"f")}get aborted(){return A(this,E2,"f")}abort(){this.controller.abort()}on($,X){return(A(this,V0,"f")[$]||(A(this,V0,"f")[$]=[])).push({listener:X}),this}off($,X){let Z=A(this,V0,"f")[$];if(!Z)return this;let q=Z.findIndex((z)=>z.listener===X);if(q>=0)Z.splice(q,1);return this}once($,X){return(A(this,V0,"f")[$]||(A(this,V0,"f")[$]=[])).push({listener:X,once:!0}),this}emitted($){return new Promise((X,Z)=>{if(d(this,H$,!0,"f"),$!=="error")this.once("error",Z);this.once($,X)})}async done(){d(this,H$,!0,"f"),await A(this,e$,"f")}get currentMessage(){return A(this,P0,"f")}async finalMessage(){return await this.done(),A(this,o,"m",S4).call(this)}async finalText(){return await this.done(),A(this,o,"m",o8).call(this)}_emit($,...X){if(A(this,X1,"f"))return;if($==="end")d(this,X1,!0,"f"),A(this,S2,"f").call(this);let Z=A(this,V0,"f")[$];if(Z)A(this,V0,"f")[$]=Z.filter((q)=>!q.once),Z.forEach(({listener:q})=>q(...X));if($==="abort"){let q=X[0];if(!A(this,H$,"f")&&!Z?.length)Promise.reject(q);A(this,t$,"f").call(this,q),A(this,$1,"f").call(this,q),this._emit("end");return}if($==="error"){let q=X[0];if(!A(this,H$,"f")&&!Z?.length)Promise.reject(q);A(this,t$,"f").call(this,q),A(this,$1,"f").call(this,q),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",A(this,o,"m",S4).call(this))}async _fromReadableStream($,X){let Z=X?.signal;if(Z){if(Z.aborted)this.controller.abort();Z.addEventListener("abort",()=>this.controller.abort())}A(this,o,"m",E4).call(this),this._connected(null);let q=i.fromReadableStream($,this.controller);for await(let z of q)A(this,o,"m",C4).call(this,z);if(q.controller.signal?.aborted)throw new m;A(this,o,"m",b4).call(this)}[(P0=new WeakMap,o$=new WeakMap,A2=new WeakMap,t$=new WeakMap,e$=new WeakMap,S2=new WeakMap,$1=new WeakMap,V0=new WeakMap,X1=new WeakMap,j2=new WeakMap,E2=new WeakMap,H$=new WeakMap,C2=new WeakMap,b2=new WeakMap,j4=new WeakMap,o=new WeakSet,S4=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},o8=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");let X=this.receivedMessages.at(-1).content.filter((Z)=>Z.type==="text").map((Z)=>Z.text);if(X.length===0)throw new P("stream ended without producing a content block with type=text");return X.join(" ")},E4=function(){if(this.ended)return;d(this,P0,void 0,"f")},C4=function(X){if(this.ended)return;let Z=A(this,o,"m",t8).call(this,X);switch(this._emit("streamEvent",X,Z),X.type){case"content_block_delta":{let q=Z.content.at(-1);switch(X.delta.type){case"text_delta":{if(q.type==="text")this._emit("text",X.delta.text,q.text||"");break}case"citations_delta":{if(q.type==="text")this._emit("citation",X.delta.citation,q.citations??[]);break}case"input_json_delta":{if(q.type==="tool_use"&&q.input)this._emit("inputJson",X.delta.partial_json,q.input);break}case"thinking_delta":{if(q.type==="thinking")this._emit("thinking",X.delta.thinking,q.thinking);break}case"signature_delta":{if(q.type==="thinking")this._emit("signature",q.signature);break}default:$Z(X.delta)}break}case"message_stop":{this._addMessageParam(Z),this._addMessage(Z,!0);break}case"content_block_stop":{this._emit("contentBlock",Z.content.at(-1));break}case"message_start":{d(this,P0,Z,"f");break}case"content_block_start":case"message_delta":break}},b4=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let X=A(this,P0,"f");if(!X)throw new P("request ended without sending any chunks");return d(this,P0,void 0,"f"),X},t8=function(X){let Z=A(this,P0,"f");if(X.type==="message_start"){if(Z)throw new P(`Unexpected event order, got ${X.type} before receiving "message_stop"`);return X.message}if(!Z)throw new P(`Unexpected event order, got ${X.type} before "message_start"`);switch(X.type){case"message_stop":return Z;case"message_delta":return Z.stop_reason=X.delta.stop_reason,Z.stop_sequence=X.delta.stop_sequence,Z.usage.output_tokens=X.usage.output_tokens,Z;case"content_block_start":return Z.content.push(X.content_block),Z;case"content_block_delta":{let q=Z.content.at(X.index);switch(X.delta.type){case"text_delta":{if(q?.type==="text")q.text+=X.delta.text;break}case"citations_delta":{if(q?.type==="text")q.citations??(q.citations=[]),q.citations.push(X.delta.citation);break}case"input_json_delta":{if(q?.type==="tool_use"){let z=q[e8]||"";if(z+=X.delta.partial_json,Object.defineProperty(q,e8,{value:z,enumerable:!1,writable:!0}),z)q.input=N2(z)}break}case"thinking_delta":{if(q?.type==="thinking")q.thinking+=X.delta.thinking;break}case"signature_delta":{if(q?.type==="thinking")q.signature=X.delta.signature;break}default:$Z(X.delta)}return Z}case"content_block_stop":return Z}},Symbol.asyncIterator)](){let $=[],X=[],Z=!1;return this.on("streamEvent",(q)=>{let z=X.shift();if(z)z.resolve(q);else $.push(q)}),this.on("end",()=>{Z=!0;for(let q of X)q.resolve(void 0);X.length=0}),this.on("abort",(q)=>{Z=!0;for(let z of X)z.reject(q);X.length=0}),this.on("error",(q)=>{Z=!0;for(let z of X)z.reject(q);X.length=0}),{next:async()=>{if(!$.length){if(Z)return{value:void 0,done:!0};return new Promise((z,G)=>X.push({resolve:z,reject:G})).then((z)=>z?{value:z,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new i(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function $Z($){}var XZ={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025"};class m0 extends u{constructor(){super(...arguments);this.batches=new Y$(this._client)}create($,X){let{betas:Z,...q}=$;if(q.model in XZ)console.warn(`The model '${q.model}' is deprecated and will reach end-of-life on ${XZ[q.model]}
194
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);return this._client.post("/v1/messages?beta=true",{body:q,timeout:this._client._options.timeout??(q.stream?600000:this._client._calculateNonstreamingTimeout(q.max_tokens)),...X,headers:{...Z?.toString()!=null?{"anthropic-beta":Z?.toString()}:void 0,...X?.headers},stream:$.stream??!1})}stream($,X){return Z1.createMessage(this,$,X)}countTokens($,X){let{betas:Z,...q}=$;return this._client.post("/v1/messages/count_tokens?beta=true",{body:q,...X,headers:{"anthropic-beta":[...Z??[],"token-counting-2024-11-01"].toString(),...X?.headers}})}}m0.Batches=Y$;m0.BetaMessageBatchesPage=r$;class T0 extends u{constructor(){super(...arguments);this.models=new J$(this._client),this.messages=new m0(this._client)}}T0.Models=J$;T0.BetaModelInfosPage=n$;T0.Messages=m0;class W$ extends u{create($,X){return this._client.post("/v1/complete",{body:$,timeout:this._client._options.timeout??600000,...X,stream:$.stream??!1})}}class V$ extends u{create($,X){return this._client.post("/v1/messages/batches",{body:$,...X})}retrieve($,X){return this._client.get(`/v1/messages/batches/${$}`,X)}list($={},X){if(r($))return this.list({},$);return this._client.getAPIList("/v1/messages/batches",q1,{query:$,...X})}delete($,X){return this._client.delete(`/v1/messages/batches/${$}`,X)}cancel($,X){return this._client.post(`/v1/messages/batches/${$}/cancel`,X)}async results($,X){let Z=await this.retrieve($);if(!Z.results_url)throw new P(`No batch \`results_url\`; Has it finished processing? ${Z.processing_status} - ${Z.id}`);return this._client.get(Z.results_url,{...X,headers:{Accept:"application/binary",...X?.headers},__binaryResponse:!0})._thenUnwrap((q,z)=>Q$.fromResponse(z.response,z.controller))}}class q1 extends W0{}V$.MessageBatchesPage=q1;var p=function($,X,Z,q,z){if(q==="m")throw TypeError("Private method is not writable");if(q==="a"&&!z)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return q==="a"?z.call($,Z):z?z.value=Z:X.set($,Z),Z},S=function($,X,Z,q){if(Z==="a"&&!q)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!q:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?q:Z==="a"?q.call($):q?q.value:X.get($)},t,N0,z1,y2,G1,J1,x2,Q1,w0,Y1,f2,k2,T$,g2,h2,y4,ZZ,x4,f4,k4,g4,qZ,zZ="__json_buf";class U1{constructor(){t.add(this),this.messages=[],this.receivedMessages=[],N0.set(this,void 0),this.controller=new AbortController,z1.set(this,void 0),y2.set(this,()=>{}),G1.set(this,()=>{}),J1.set(this,void 0),x2.set(this,()=>{}),Q1.set(this,()=>{}),w0.set(this,{}),Y1.set(this,!1),f2.set(this,!1),k2.set(this,!1),T$.set(this,!1),g2.set(this,void 0),h2.set(this,void 0),x4.set(this,($)=>{if(p(this,f2,!0,"f"),$ instanceof Error&&$.name==="AbortError")$=new m;if($ instanceof m)return p(this,k2,!0,"f"),this._emit("abort",$);if($ instanceof P)return this._emit("error",$);if($ instanceof Error){let X=new P($.message);return X.cause=$,this._emit("error",X)}return this._emit("error",new P(String($)))}),p(this,z1,new Promise(($,X)=>{p(this,y2,$,"f"),p(this,G1,X,"f")}),"f"),p(this,J1,new Promise(($,X)=>{p(this,x2,$,"f"),p(this,Q1,X,"f")}),"f"),S(this,z1,"f").catch(()=>{}),S(this,J1,"f").catch(()=>{})}get response(){return S(this,g2,"f")}get request_id(){return S(this,h2,"f")}async withResponse(){let $=await S(this,z1,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let X=new U1;return X._run(()=>X._fromReadableStream($)),X}static createMessage($,X,Z){let q=new U1;for(let z of X.messages)q._addMessageParam(z);return q._run(()=>q._createMessage($,{...X,stream:!0},{...Z,headers:{...Z?.headers,"X-Stainless-Helper-Method":"stream"}})),q}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},S(this,x4,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,X=!0){if(this.receivedMessages.push($),X)this._emit("message",$)}async _createMessage($,X,Z){let q=Z?.signal;if(q){if(q.aborted)this.controller.abort();q.addEventListener("abort",()=>this.controller.abort())}S(this,t,"m",f4).call(this);let{response:z,data:G}=await $.create({...X,stream:!0},{...Z,signal:this.controller.signal}).withResponse();this._connected(z);for await(let J of G)S(this,t,"m",k4).call(this,J);if(G.controller.signal?.aborted)throw new m;S(this,t,"m",g4).call(this)}_connected($){if(this.ended)return;p(this,g2,$,"f"),p(this,h2,$?.headers.get("request-id"),"f"),S(this,y2,"f").call(this,$),this._emit("connect")}get ended(){return S(this,Y1,"f")}get errored(){return S(this,f2,"f")}get aborted(){return S(this,k2,"f")}abort(){this.controller.abort()}on($,X){return(S(this,w0,"f")[$]||(S(this,w0,"f")[$]=[])).push({listener:X}),this}off($,X){let Z=S(this,w0,"f")[$];if(!Z)return this;let q=Z.findIndex((z)=>z.listener===X);if(q>=0)Z.splice(q,1);return this}once($,X){return(S(this,w0,"f")[$]||(S(this,w0,"f")[$]=[])).push({listener:X,once:!0}),this}emitted($){return new Promise((X,Z)=>{if(p(this,T$,!0,"f"),$!=="error")this.once("error",Z);this.once($,X)})}async done(){p(this,T$,!0,"f"),await S(this,J1,"f")}get currentMessage(){return S(this,N0,"f")}async finalMessage(){return await this.done(),S(this,t,"m",y4).call(this)}async finalText(){return await this.done(),S(this,t,"m",ZZ).call(this)}_emit($,...X){if(S(this,Y1,"f"))return;if($==="end")p(this,Y1,!0,"f"),S(this,x2,"f").call(this);let Z=S(this,w0,"f")[$];if(Z)S(this,w0,"f")[$]=Z.filter((q)=>!q.once),Z.forEach(({listener:q})=>q(...X));if($==="abort"){let q=X[0];if(!S(this,T$,"f")&&!Z?.length)Promise.reject(q);S(this,G1,"f").call(this,q),S(this,Q1,"f").call(this,q),this._emit("end");return}if($==="error"){let q=X[0];if(!S(this,T$,"f")&&!Z?.length)Promise.reject(q);S(this,G1,"f").call(this,q),S(this,Q1,"f").call(this,q),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",S(this,t,"m",y4).call(this))}async _fromReadableStream($,X){let Z=X?.signal;if(Z){if(Z.aborted)this.controller.abort();Z.addEventListener("abort",()=>this.controller.abort())}S(this,t,"m",f4).call(this),this._connected(null);let q=i.fromReadableStream($,this.controller);for await(let z of q)S(this,t,"m",k4).call(this,z);if(q.controller.signal?.aborted)throw new m;S(this,t,"m",g4).call(this)}[(N0=new WeakMap,z1=new WeakMap,y2=new WeakMap,G1=new WeakMap,J1=new WeakMap,x2=new WeakMap,Q1=new WeakMap,w0=new WeakMap,Y1=new WeakMap,f2=new WeakMap,k2=new WeakMap,T$=new WeakMap,g2=new WeakMap,h2=new WeakMap,x4=new WeakMap,t=new WeakSet,y4=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},ZZ=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");let X=this.receivedMessages.at(-1).content.filter((Z)=>Z.type==="text").map((Z)=>Z.text);if(X.length===0)throw new P("stream ended without producing a content block with type=text");return X.join(" ")},f4=function(){if(this.ended)return;p(this,N0,void 0,"f")},k4=function(X){if(this.ended)return;let Z=S(this,t,"m",qZ).call(this,X);switch(this._emit("streamEvent",X,Z),X.type){case"content_block_delta":{let q=Z.content.at(-1);switch(X.delta.type){case"text_delta":{if(q.type==="text")this._emit("text",X.delta.text,q.text||"");break}case"citations_delta":{if(q.type==="text")this._emit("citation",X.delta.citation,q.citations??[]);break}case"input_json_delta":{if(q.type==="tool_use"&&q.input)this._emit("inputJson",X.delta.partial_json,q.input);break}case"thinking_delta":{if(q.type==="thinking")this._emit("thinking",X.delta.thinking,q.thinking);break}case"signature_delta":{if(q.type==="thinking")this._emit("signature",q.signature);break}default:GZ(X.delta)}break}case"message_stop":{this._addMessageParam(Z),this._addMessage(Z,!0);break}case"content_block_stop":{this._emit("contentBlock",Z.content.at(-1));break}case"message_start":{p(this,N0,Z,"f");break}case"content_block_start":case"message_delta":break}},g4=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let X=S(this,N0,"f");if(!X)throw new P("request ended without sending any chunks");return p(this,N0,void 0,"f"),X},qZ=function(X){let Z=S(this,N0,"f");if(X.type==="message_start"){if(Z)throw new P(`Unexpected event order, got ${X.type} before receiving "message_stop"`);return X.message}if(!Z)throw new P(`Unexpected event order, got ${X.type} before "message_start"`);switch(X.type){case"message_stop":return Z;case"message_delta":return Z.stop_reason=X.delta.stop_reason,Z.stop_sequence=X.delta.stop_sequence,Z.usage.output_tokens=X.usage.output_tokens,Z;case"content_block_start":return Z.content.push(X.content_block),Z;case"content_block_delta":{let q=Z.content.at(X.index);switch(X.delta.type){case"text_delta":{if(q?.type==="text")q.text+=X.delta.text;break}case"citations_delta":{if(q?.type==="text")q.citations??(q.citations=[]),q.citations.push(X.delta.citation);break}case"input_json_delta":{if(q?.type==="tool_use"){let z=q[zZ]||"";if(z+=X.delta.partial_json,Object.defineProperty(q,zZ,{value:z,enumerable:!1,writable:!0}),z)q.input=N2(z)}break}case"thinking_delta":{if(q?.type==="thinking")q.thinking+=X.delta.thinking;break}case"signature_delta":{if(q?.type==="thinking")q.signature=X.delta.signature;break}default:GZ(X.delta)}return Z}case"content_block_stop":return Z}},Symbol.asyncIterator)](){let $=[],X=[],Z=!1;return this.on("streamEvent",(q)=>{let z=X.shift();if(z)z.resolve(q);else $.push(q)}),this.on("end",()=>{Z=!0;for(let q of X)q.resolve(void 0);X.length=0}),this.on("abort",(q)=>{Z=!0;for(let z of X)z.reject(q);X.length=0}),this.on("error",(q)=>{Z=!0;for(let z of X)z.reject(q);X.length=0}),{next:async()=>{if(!$.length){if(Z)return{value:void 0,done:!0};return new Promise((z,G)=>X.push({resolve:z,reject:G})).then((z)=>z?{value:z,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new i(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function GZ($){}class A0 extends u{constructor(){super(...arguments);this.batches=new V$(this._client)}create($,X){if($.model in JZ)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${JZ[$.model]}
195
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);return this._client.post("/v1/messages",{body:$,timeout:this._client._options.timeout??($.stream?600000:this._client._calculateNonstreamingTimeout($.max_tokens)),...X,stream:$.stream??!1})}stream($,X){return U1.createMessage(this,$,X)}countTokens($,X){return this._client.post("/v1/messages/count_tokens",{body:$,...X})}}var JZ={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025"};A0.Batches=V$;A0.MessageBatchesPage=q1;class d0 extends u{retrieve($,X){return this._client.get(`/v1/models/${$}`,X)}list($={},X){if(r($))return this.list({},$);return this._client.getAPIList("/v1/models",w$,{query:$,...X})}}class w$ extends W0{}d0.ModelInfosPage=w$;var QZ;class b extends N4{constructor({baseURL:$=P2("ANTHROPIC_BASE_URL"),apiKey:X=P2("ANTHROPIC_API_KEY")??null,authToken:Z=P2("ANTHROPIC_AUTH_TOKEN")??null,...q}={}){let z={apiKey:X,authToken:Z,...q,baseURL:$||"https://api.anthropic.com"};if(!z.dangerouslyAllowBrowser&&r8())throw new P(`It looks like you're running in a browser-like environment.
196
+
197
+ This is disabled by default, as it risks exposing your secret API credentials to attackers.
198
+ If you understand the risks and have appropriate mitigations in place,
199
+ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
200
+
201
+ new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
202
+ `);super({baseURL:z.baseURL,timeout:z.timeout??600000,httpAgent:z.httpAgent,maxRetries:z.maxRetries,fetch:z.fetch});this.completions=new W$(this),this.messages=new A0(this),this.models=new d0(this),this.beta=new T0(this),this._options=z,this.apiKey=X,this.authToken=Z}defaultQuery(){return this._options.defaultQuery}defaultHeaders($){return{...super.defaultHeaders($),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01",...this._options.defaultHeaders}}validateHeaders($,X){if(this.apiKey&&$["x-api-key"])return;if(X["x-api-key"]===null)return;if(this.authToken&&$.authorization)return;if(X.authorization===null)return;throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}authHeaders($){return{...this.apiKeyAuth($),...this.bearerAuth($)}}apiKeyAuth($){if(this.apiKey==null)return{};return{"X-Api-Key":this.apiKey}}bearerAuth($){if(this.authToken==null)return{};return{Authorization:`Bearer ${this.authToken}`}}}QZ=b;b.Anthropic=QZ;b.HUMAN_PROMPT=`
203
+
204
+ Human:`;b.AI_PROMPT=`
205
+
206
+ Assistant:`;b.DEFAULT_TIMEOUT=600000;b.AnthropicError=P;b.APIError=v;b.APIConnectionError=v0;b.APIConnectionTimeoutError=i$;b.APIUserAbortError=m;b.NotFoundError=L2;b.ConflictError=B2;b.RateLimitError=D2;b.BadRequestError=V2;b.AuthenticationError=T2;b.InternalServerError=_2;b.PermissionDeniedError=w2;b.UnprocessableEntityError=K2;b.toFile=u8;b.fileFromPath=W2;b.Completions=W$;b.Messages=A0;b.Models=d0;b.ModelInfosPage=w$;b.Beta=T0;var YZ=b;function L$($,X,Z){let q=X.length>0?X.map((J)=>`- ${J.id}: ${J.name} (${J.source})`).join(`
207
+ `):"(no sources provided)",z=X.map((J)=>`<source id="${J.id}">
208
+ ${J.content.trimEnd()}
192
209
  </source>`).join(`
193
210
 
194
- `),H=z.length>0?`The scenario REQUIRES citations from: ${z.join(", ")}.`:"No specific source is required, but every claim must cite a registered source.";return`You are answering a question about the tool "${$.name}": ${$.description}.
211
+ `),G=Z.length>0?`The scenario REQUIRES citations from: ${Z.join(", ")}.`:"No specific source is required, but every claim must cite a registered source.";return`You are answering a question about the tool "${$.name}": ${$.description}.
195
212
 
196
213
  Answer using ONLY information from the provided sources below. Do not draw on general knowledge.
197
214
 
198
215
  Available sources:
199
- ${X}
216
+ ${q}
200
217
 
201
- ${Z}
218
+ ${z}
202
219
 
203
- ${H}
220
+ ${G}
204
221
 
205
222
  End your response with a "## Sources" section that lists every source you actually used. Use this exact format:
206
223
 
@@ -211,19 +228,19 @@ End your response with a "## Sources" section that lists every source you actual
211
228
  Rules:
212
229
  - Only cite IDs that appear in the inventory above. Do not invent IDs.
213
230
  - If you cannot answer from the provided sources, say so explicitly and write an empty "## Sources" section (just the heading, no bullets).
214
- - The "## Sources" heading must be the last heading in your response.`}class u1{category="cli";provider="claude-code";name;config;constructor($,q){this.name=$,this.config=q}async run($,q){let{tool:z,cwd:X,context:Z,docs:H,requiredSources:Q}=q,J=[],G=[],U=Jq(z,H,Q),B={cwd:X,model:this.config.model??"sonnet",systemPrompt:U,allowedTools:Z?.allowedTools??this.config.allowedTools??wq,disallowedTools:Z?.disallowedTools??this.config.disallowedTools??Pq,permissionMode:this.config.permissionMode??"acceptEdits",maxTurns:this.config.maxTurns??10,maxThinkingTokens:this.config.maxThinkingTokens,maxBudgetUsd:this.config.maxBudgetUsd,mcpServers:Z?.mcpServers??this.config.mcpServers,settingSources:[]},Y=[],W="",L="";for await(let _ of CJ({prompt:$,options:B})){if(_.type==="assistant"){let T=_.message?.content;if(Array.isArray(T)){let V="";for(let D of T){if(D.type==="text")V+=D.text;if(D.type==="tool_use"){let R=D;if(!J.includes(R.name))J.push(R.name)}}if(V){let D=Y.length===0?"initial":"intermediate";Y.push({type:D,text:V}),W=V}}}if(_.type==="result"){let T=_;if(T.result)L=T.result}}if(Y.length>0)Y[Y.length-1].type="final";return{response:L||W,allResponses:Y,toolsUsed:J,sources:G,metadata:{model:this.config.model??"sonnet",category:this.category,provider:this.provider,target:this.name}}}}import{randomUUID as yJ}from"crypto";import{rm as fJ}from"fs/promises";import{tmpdir as kJ}from"os";import{join as xJ}from"path";var hJ="codex";class m1{category="cli";provider="codex-cli";name;config;spawnFn;readFileFn;binary;constructor($,q,z={}){this.name=$,this.config=q,this.spawnFn=z.spawn??mJ,this.readFileFn=z.readFile??dJ,this.binary=z.binary??hJ}async run($,q){let{tool:z,cwd:X,docs:Z,requiredSources:H}=q,Q=this.config.model;if(!Q)throw Error(`CodexCliTarget "${this.name}" requires an explicit model. Validation should have caught this at config load.`);let G=`${Jq(z,Z,H)}
231
+ - The "## Sources" heading must be the last heading in your response.`}class h4{category="api";provider="anthropic";name;config;clientFactory;constructor($,X,Z){this.name=$,this.config=X,this.clientFactory=Z??(()=>new YZ)}async run($,X){let{tool:Z,docs:q,requiredSources:z}=X;if(!this.config.model)throw Error(`API target "${this.name}" missing 'model'. API targets must declare an explicit model.`);let G=L$(Z,q,z),Q=await this.clientFactory().messages.create({model:this.config.model,max_tokens:this.config.maxTokens??4096,temperature:this.config.temperature??0,system:G,messages:[{role:"user",content:$}]}),Y=sH(Q.content);return{response:Y,allResponses:Y?[{type:"final",text:Y}]:[],toolsUsed:[],sources:[],metadata:{model:this.config.model,category:this.category,provider:this.provider,target:this.name}}}}function sH($){if(!Array.isArray($))return"";let X=[];for(let Z of $)if(Z.type==="text"&&typeof Z.text==="string")X.push(Z.text);return X.join("")}import{query as nH}from"@anthropic-ai/claude-agent-sdk";class v4{category="cli";provider="claude-code";name;config;constructor($,X){this.name=$,this.config=X}async run($,X){let{tool:Z,cwd:q,context:z,docs:G,requiredSources:J}=X,Q=[],Y=[],U=L$(Z,G,J),W={cwd:q,model:this.config.model??"sonnet",systemPrompt:U,allowedTools:z?.allowedTools??this.config.allowedTools??t2,disallowedTools:z?.disallowedTools??this.config.disallowedTools??e2,permissionMode:this.config.permissionMode??"acceptEdits",maxTurns:this.config.maxTurns??10,maxThinkingTokens:this.config.maxThinkingTokens,maxBudgetUsd:this.config.maxBudgetUsd,mcpServers:z?.mcpServers??this.config.mcpServers,settingSources:[]},H=[],V="",w="";for await(let B of nH({prompt:$,options:W})){if(B.type==="assistant"){let T=B.message?.content;if(Array.isArray(T)){let L="";for(let D of T){if(D.type==="text")L+=D.text;if(D.type==="tool_use"){let _=D;if(!Q.includes(_.name))Q.push(_.name)}}if(L){let D=H.length===0?"initial":"intermediate";H.push({type:D,text:L}),V=L}}}if(B.type==="result"){let T=B;if(T.result)w=T.result}}if(H.length>0)H[H.length-1].type="final";return{response:w||V,allResponses:H,toolsUsed:Q,sources:Y,metadata:{model:this.config.model??"sonnet",category:this.category,provider:this.provider,target:this.name}}}}import{randomUUID as rH}from"crypto";import{rm as oH}from"fs/promises";import{tmpdir as tH}from"os";import{join as eH}from"path";var $W="codex";class u4{category="cli";provider="codex-cli";name;config;spawnFn;readFileFn;binary;constructor($,X,Z={}){this.name=$,this.config=X,this.spawnFn=Z.spawn??zW,this.readFileFn=Z.readFile??GW,this.binary=Z.binary??$W}async run($,X){let{tool:Z,cwd:q,docs:z,requiredSources:G}=X,J=this.config.model;if(!J)throw Error(`CodexCliTarget "${this.name}" requires an explicit model. Validation should have caught this at config load.`);let Y=`${L$(Z,z,G)}
215
232
 
216
233
  ---
217
234
 
218
- ${$}`,U=xJ(kJ(),`pickled-codex-${yJ()}.txt`),B=["--ask-for-approval","never","exec","--json","--sandbox","read-only","--ignore-user-config","--ignore-rules","--ephemeral","--skip-git-repo-check","--cd",X,"--model",Q,"--output-last-message",U,"-"];try{let Y=await this.spawnFn(this.binary,B,{cwd:X,stdin:G}),{allResponses:W,toolsUsed:L}=gJ(Y.stdout);if(Y.exitCode!==0)throw Error(`codex exec failed (exit ${Y.exitCode}): ${Y.stderr.trim()||"no stderr output"}`);let _="";try{_=(await this.readFileFn(U)).trim()}catch{_=W.length>0?W[W.length-1].text:""}if(W.length>0)W[W.length-1].type="final";return{response:_,allResponses:W,toolsUsed:L,sources:[],metadata:{model:Q,category:this.category,provider:this.provider,target:this.name}}}finally{await fJ(U,{force:!0})}}}function gJ($){let q=[],z=[];for(let X of $.split(`
219
- `)){let Z=X.trim();if(!Z)continue;let H;try{H=JSON.parse(Z)}catch{continue}let Q=vJ(H);if(Q){let G=q.length===0?"initial":"intermediate";q.push({type:G,text:Q})}let J=uJ(H);if(J&&!z.includes(J))z.push(J)}return{allResponses:q,toolsUsed:z}}function vJ($){if(!$||typeof $!=="object")return null;let q=$;if(typeof q.message==="string")return q.message;if(typeof q.content==="string")return q.content;if(typeof q.type==="string"&&(q.type==="assistant_message"||q.type==="agent_message")&&typeof q.text==="string")return q.text;if(q.type==="message"&&typeof q.text==="string")return q.text;return null}function uJ($){if(!$||typeof $!=="object")return null;let q=$;if(typeof q.tool==="string")return q.tool;if(typeof q.type==="string"&&(q.type==="tool_call"||q.type==="function_call")&&typeof q.name==="string")return q.name;return null}var mJ=async($,q,z)=>{let X=Bun.spawn([$,...q],{cwd:z.cwd,stdin:"pipe",stdout:"pipe",stderr:"pipe"});X.stdin.write(z.stdin),await X.stdin.end();let[Z,H,Q]=await Promise.all([new Response(X.stdout).text(),new Response(X.stderr).text(),X.exited]);return{exitCode:Q,stdout:Z,stderr:H}},dJ=async($)=>{let q=Bun.file($);if(!await q.exists())throw Error(`Last-message file not found: ${$}`);return q.text()};function d1($,q){let z=q??l;switch(z.category){case"cli":return pJ($,z);case"api":throw Error("API targets not yet implemented. Coming soon!");case"ide":throw Error("IDE targets not yet implemented. Coming soon!");default:throw Error(`Unknown target category: ${z.category}`)}}function pJ($,q){switch(q.provider){case"claude-code":return new u1($,q);case"codex-cli":return new m1($,q);case"gemini-cli":throw Error("Gemini CLI target not yet implemented. Coming soon!");case"amazon-q":throw Error("Amazon Q target not yet implemented. Coming soon!");default:throw Error(`Unknown CLI provider: ${q.provider}`)}}var b0="default";function p1($,q){if(!$||$===b0)return{name:b0,config:l};if(q?.[$])return{name:$,config:q[$]};return console.warn(`Target "${$}" not found, using default`),{name:b0,config:l}}function C4($,q){if(!$||$===b0)return{name:b0,config:{}};if(q?.[$])return{name:$,config:q[$]};return console.warn(`Context "${$}" not found, using default`),{name:b0,config:{}}}function lJ($){let q=[],z=$.matrix?.target??["default"],X=$.matrix?.context??["default"];for(let Z of $.scenarios){let H=Z.target?[Z.target]:z,Q=Z.context?[Z.context]:X;for(let J of H)for(let G of Q)q.push({scenario:Z,targetName:J,contextName:G})}return q}async function l1($,q,z={}){let{onProgress:X}=z,Z=[];if(q.scenarios.length===0)throw Error("No scenarios defined in config");let H=q.docs?.sources??{},Q=[];if(Object.keys(H).length>0){X?.("Loading sources..."),Q=await H$(H,$.path);for(let B of Q)X?.(` [${B.id}] ${B.name}`);X?.("")}let J=Q.map((B)=>B.id),G=lJ(q),U="";for(let{scenario:B,targetName:Y,contextName:W}of G){let L=cJ(Y,W);if(B.name!==U){if(U)X?.("");X?.(`"${B.name}"`),U=B.name}try{let _=await iJ(B,Y,W,$,q,Q,J,z);Z.push(_);let T=L?L.padEnd(18):"";if(_.surfaces){X?.(` ${T} (compare-surfaces mode)`);for(let V of _.surfaces){let D=L0(V),R=` [${V.active.join(",")}]`.padEnd(22);X?.(`${R} ${D.icon} ${D.label} (${D.confidence}%)`)}}else{let V=L0({answerable:_.answerable??"NO",confidence:_.confidence??0,traps:_.traps??{fired:[],avoided:[]},error:_.error});X?.(` ${T} ${V.icon} ${V.label} (${V.confidence}%)`)}}catch(_){let T=Y==="default"?l:q.targets?.[Y]??l,V={scenario:B,answerable:"NO",confidence:0,response:"",reason:"Error during run",citations:{cited:[],required:B.requiredSources,missing:B.requiredSources,unknown:[]},traps:{fired:[],avoided:(B.traps??[]).map((R)=>R.id)},error:_ instanceof Error?_.message:String(_),target:{target:Y,category:T.category,provider:T.provider,model:T.model??"unknown"},context:{name:W}};Z.push(V);let D=L?L.padEnd(18):"";X?.(` ${D} \u2717 Error`)}}return X?.(""),aJ($,Q,Z)}function cJ($,q){if($==="default"&&q==="default")return"";if(q==="default")return`[${$}]`;return`[${$}/${q}]`}async function iJ($,q,z,X,Z,H,Q,J){let{config:G}=p1(q,Z.targets),{config:U}=C4(z,Z.contexts),B=J.targetFactory?J.targetFactory(q,G):d1(q,G);if($.compareSurfaces&&$.compareSurfaces.length>0){let R=[],w;for(let K of $.compareSurfaces){let O=new Set(K),F=H.filter((V0)=>O.has(V0.id)),S=$.requiredSources.filter((V0)=>O.has(V0)),M=await B.run($.prompt,{tool:X,cwd:X.path,context:U,docs:F,requiredSources:S,onProgress:J.onProgress}),N=Q$({response:M.response,requiredSources:S,registeredIds:K}),x=T0({response:M.response,traps:$.traps??[]}),p=x.fired.length>0,C=p?"NO":N.answerable,G$=p?0:N.confidence,q5=p?`Trap fired: ${x.fired.map((V0)=>`"${V0.id}" (${V0.reason})`).join("; ")}`:N.reason;R.push({active:K,answerable:C,confidence:G$,response:M.response,reason:q5,citations:N.citations,traps:x,allResponses:M.allResponses}),w=M.metadata??w}return{scenario:$,answerable:null,confidence:null,response:null,reason:null,citations:null,traps:null,surfaces:R,target:w,context:{name:z}}}let Y=await B.run($.prompt,{tool:X,cwd:X.path,context:U,docs:H,requiredSources:$.requiredSources,onProgress:J.onProgress}),W=Q$({response:Y.response,requiredSources:$.requiredSources,registeredIds:Q}),L=T0({response:Y.response,traps:$.traps??[]}),_=L.fired.length>0,T=_?"NO":W.answerable,V=_?0:W.confidence,D=_?`Trap fired: ${L.fired.map((R)=>`"${R.id}" (${R.reason})`).join("; ")}`:W.reason;return{scenario:$,answerable:T,confidence:V,response:Y.response,reason:D,citations:W.citations,traps:L,target:Y.metadata,context:{name:z},toolsUsed:Y.toolsUsed,sources:Y.sources,allResponses:Y.allResponses}}function aJ($,q,z){let X=[];for(let J of z){if(J.surfaces){for(let G of J.surfaces)X.push({answerable:G.answerable,confidence:G.confidence});continue}if(J.answerable!==null&&J.confidence!==null)X.push({answerable:J.answerable,confidence:J.confidence})}let Z=X.length,H=X.filter((J)=>J.answerable==="YES"||J.answerable==="PARTIAL").length,Q=Z>0?Math.round(X.reduce((J,G)=>{if(G.answerable==="YES")return J+G.confidence;if(G.answerable==="PARTIAL")return J+G.confidence*0.5;return J},0)/Z):0;return{tool:{name:$.name,description:$.description,path:$.path},docs:q,scenarios:z,summary:{total:Z,answered:H,unanswered:Z-H,score:Q}}}var y4=($=0)=>(q)=>`\x1B[${q+$}m`,f4=($=0)=>(q)=>`\x1B[${38+$};5;${q}m`,k4=($=0)=>(q,z,X)=>`\x1B[${38+$};2;${q};${z};${X}m`,E={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},UB=Object.keys(E.modifier),sJ=Object.keys(E.color),rJ=Object.keys(E.bgColor),GB=[...sJ,...rJ];function nJ(){let $=new Map;for(let[q,z]of Object.entries(E)){for(let[X,Z]of Object.entries(z))E[X]={open:`\x1B[${Z[0]}m`,close:`\x1B[${Z[1]}m`},z[X]=E[X],$.set(Z[0],Z[1]);Object.defineProperty(E,q,{value:z,enumerable:!1})}return Object.defineProperty(E,"codes",{value:$,enumerable:!1}),E.color.close="\x1B[39m",E.bgColor.close="\x1B[49m",E.color.ansi=y4(),E.color.ansi256=f4(),E.color.ansi16m=k4(),E.bgColor.ansi=y4(10),E.bgColor.ansi256=f4(10),E.bgColor.ansi16m=k4(10),Object.defineProperties(E,{rgbToAnsi256:{value(q,z,X){if(q===z&&z===X){if(q<8)return 16;if(q>248)return 231;return Math.round((q-8)/247*24)+232}return 16+36*Math.round(q/255*5)+6*Math.round(z/255*5)+Math.round(X/255*5)},enumerable:!1},hexToRgb:{value(q){let z=/[a-f\d]{6}|[a-f\d]{3}/i.exec(q.toString(16));if(!z)return[0,0,0];let[X]=z;if(X.length===3)X=[...X].map((H)=>H+H).join("");let Z=Number.parseInt(X,16);return[Z>>16&255,Z>>8&255,Z&255]},enumerable:!1},hexToAnsi256:{value:(q)=>E.rgbToAnsi256(...E.hexToRgb(q)),enumerable:!1},ansi256ToAnsi:{value(q){if(q<8)return 30+q;if(q<16)return 90+(q-8);let z,X,Z;if(q>=232)z=((q-232)*10+8)/255,X=z,Z=z;else{q-=16;let J=q%36;z=Math.floor(q/36)/5,X=Math.floor(J/6)/5,Z=J%6/5}let H=Math.max(z,X,Z)*2;if(H===0)return 30;let Q=30+(Math.round(Z)<<2|Math.round(X)<<1|Math.round(z));if(H===2)Q+=60;return Q},enumerable:!1},rgbToAnsi:{value:(q,z,X)=>E.ansi256ToAnsi(E.rgbToAnsi256(q,z,X)),enumerable:!1},hexToAnsi:{value:(q)=>E.ansi256ToAnsi(E.hexToAnsi256(q)),enumerable:!1}}),E}var oJ=nJ(),d=oJ;import c1 from"process";import tJ from"os";import x4 from"tty";function v($,q=globalThis.Deno?globalThis.Deno.args:c1.argv){let z=$.startsWith("-")?"":$.length===1?"-":"--",X=q.indexOf(z+$),Z=q.indexOf("--");return X!==-1&&(Z===-1||X<Z)}var{env:b}=c1,Uq;if(v("no-color")||v("no-colors")||v("color=false")||v("color=never"))Uq=0;else if(v("color")||v("colors")||v("color=true")||v("color=always"))Uq=1;function eJ(){if("FORCE_COLOR"in b){if(b.FORCE_COLOR==="true")return 1;if(b.FORCE_COLOR==="false")return 0;return b.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(b.FORCE_COLOR,10),3)}}function $U($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function qU($,{streamIsTTY:q,sniffFlags:z=!0}={}){let X=eJ();if(X!==void 0)Uq=X;let Z=z?Uq:X;if(Z===0)return 0;if(z){if(v("color=16m")||v("color=full")||v("color=truecolor"))return 3;if(v("color=256"))return 2}if("TF_BUILD"in b&&"AGENT_NAME"in b)return 1;if($&&!q&&Z===void 0)return 0;let H=Z||0;if(b.TERM==="dumb")return H;if(c1.platform==="win32"){let Q=tJ.release().split(".");if(Number(Q[0])>=10&&Number(Q[2])>=10586)return Number(Q[2])>=14931?3:2;return 1}if("CI"in b){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((Q)=>(Q in b)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((Q)=>(Q in b))||b.CI_NAME==="codeship")return 1;return H}if("TEAMCITY_VERSION"in b)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(b.TEAMCITY_VERSION)?1:0;if(b.COLORTERM==="truecolor")return 3;if(b.TERM==="xterm-kitty")return 3;if(b.TERM==="xterm-ghostty")return 3;if(b.TERM==="wezterm")return 3;if("TERM_PROGRAM"in b){let Q=Number.parseInt((b.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(b.TERM_PROGRAM){case"iTerm.app":return Q>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(b.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(b.TERM))return 1;if("COLORTERM"in b)return 1;return H}function h4($,q={}){let z=qU($,{streamIsTTY:$&&$.isTTY,...q});return $U(z)}var zU={stdout:h4({isTTY:x4.isatty(1)}),stderr:h4({isTTY:x4.isatty(2)})},g4=zU;function v4($,q,z){let X=$.indexOf(q);if(X===-1)return $;let Z=q.length,H=0,Q="";do Q+=$.slice(H,X)+q+z,H=X+Z,X=$.indexOf(q,H);while(X!==-1);return Q+=$.slice(H),Q}function u4($,q,z,X){let Z=0,H="";do{let Q=$[X-1]==="\r";H+=$.slice(Z,Q?X-1:X)+q+(Q?`\r
235
+ ${$}`,U=eH(tH(),`pickled-codex-${rH()}.txt`),W=["--ask-for-approval","never","exec","--json","--sandbox","read-only","--ignore-user-config","--ignore-rules","--ephemeral","--skip-git-repo-check","--cd",q,"--model",J,"--output-last-message",U,"-"];try{let H=await this.spawnFn(this.binary,W,{cwd:q,stdin:Y}),{allResponses:V,toolsUsed:w}=XW(H.stdout);if(H.exitCode!==0)throw Error(`codex exec failed (exit ${H.exitCode}): ${H.stderr.trim()||"no stderr output"}`);let B="";try{B=(await this.readFileFn(U)).trim()}catch{B=V.length>0?V[V.length-1].text:""}if(V.length>0)V[V.length-1].type="final";return{response:B,allResponses:V,toolsUsed:w,sources:[],metadata:{model:J,category:this.category,provider:this.provider,target:this.name}}}finally{await oH(U,{force:!0})}}}function XW($){let X=[],Z=[];for(let q of $.split(`
236
+ `)){let z=q.trim();if(!z)continue;let G;try{G=JSON.parse(z)}catch{continue}let J=ZW(G);if(J){let Y=X.length===0?"initial":"intermediate";X.push({type:Y,text:J})}let Q=qW(G);if(Q&&!Z.includes(Q))Z.push(Q)}return{allResponses:X,toolsUsed:Z}}function ZW($){if(!$||typeof $!=="object")return null;let X=$;if(typeof X.message==="string")return X.message;if(typeof X.content==="string")return X.content;if(typeof X.type==="string"&&(X.type==="assistant_message"||X.type==="agent_message")&&typeof X.text==="string")return X.text;if(X.type==="message"&&typeof X.text==="string")return X.text;return null}function qW($){if(!$||typeof $!=="object")return null;let X=$;if(typeof X.tool==="string")return X.tool;if(typeof X.type==="string"&&(X.type==="tool_call"||X.type==="function_call")&&typeof X.name==="string")return X.name;return null}var zW=async($,X,Z)=>{let q=Bun.spawn([$,...X],{cwd:Z.cwd,stdin:"pipe",stdout:"pipe",stderr:"pipe"});q.stdin.write(Z.stdin),await q.stdin.end();let[z,G,J]=await Promise.all([new Response(q.stdout).text(),new Response(q.stderr).text(),q.exited]);return{exitCode:J,stdout:z,stderr:G}},GW=async($)=>{let X=Bun.file($);if(!await X.exists())throw Error(`Last-message file not found: ${$}`);return X.text()};function m4($,X){let Z=X??z0;switch(Z.category){case"cli":return JW($,Z);case"api":return QW($,Z);case"ide":throw Error("IDE targets not yet implemented. Coming soon!");default:throw Error(`Unknown target category: ${Z.category}`)}}function JW($,X){switch(X.provider){case"claude-code":return new v4($,X);case"codex-cli":return new u4($,X);case"gemini-cli":throw Error("Gemini CLI target not yet implemented. Coming soon!");case"amazon-q":throw Error("Amazon Q target not yet implemented. Coming soon!");default:throw Error(`Unknown CLI provider: ${X.provider}`)}}function QW($,X){switch(X.provider){case"anthropic":return new h4($,X);case"openai":throw Error("OpenAI API target not yet implemented. Coming soon!");case"google":throw Error("Google API target not yet implemented. Coming soon!");default:throw Error(`Unknown API provider: ${X.provider}`)}}var B$="default";function d4($,X){if(!$||$===B$)return{name:B$,config:z0};if(X?.[$])return{name:$,config:X[$]};return console.warn(`Target "${$}" not found, using default`),{name:B$,config:z0}}function UZ($,X){if(!$||$===B$)return{name:B$,config:{}};if(X?.[$])return{name:$,config:X[$]};return console.warn(`Context "${$}" not found, using default`),{name:B$,config:{}}}function YW($){let X=[],Z=$.matrix?.target??["default"],q=$.matrix?.context??["default"];for(let z of $.scenarios){let G=z.target?[z.target]:Z,J=z.context?[z.context]:q;for(let Q of G)for(let Y of J)X.push({scenario:z,targetName:Q,contextName:Y})}return X}async function p4($,X,Z={}){let{onProgress:q}=Z,z=[];if(X.scenarios.length===0)throw Error("No scenarios defined in config");let G=X.docs?.sources??{},J=[];if(Object.keys(G).length>0){q?.("Loading sources..."),J=await c$(G,$.path);for(let W of J)q?.(` [${W.id}] ${W.name}`);q?.("")}let Q=J.map((W)=>W.id),Y=YW(X),U="";for(let{scenario:W,targetName:H,contextName:V}of Y){let w=UW(H,V);if(W.name!==U){if(U)q?.("");q?.(`"${W.name}"`),U=W.name}try{let B=await HW(W,H,V,$,X,J,Q,Z);z.push(B);let T=w?w.padEnd(18):"";if(B.surfaces){q?.(` ${T} (compare-surfaces mode)`);for(let L of B.surfaces){let D=k0(L),_=` [${L.active.join(",")}]`.padEnd(22);q?.(`${_} ${D.icon} ${D.label} (${D.confidence}%)`)}}else{let L=k0({answerable:B.answerable??"NO",confidence:B.confidence??0,traps:B.traps??{fired:[],avoided:[]},error:B.error});q?.(` ${T} ${L.icon} ${L.label} (${L.confidence}%)`)}}catch(B){let T=H==="default"?z0:X.targets?.[H]??z0,L={scenario:W,answerable:"NO",confidence:0,response:"",reason:"Error during run",citations:{cited:[],required:W.requiredSources,missing:W.requiredSources,unknown:[]},traps:{fired:[],avoided:(W.traps??[]).map((_)=>_.id)},error:B instanceof Error?B.message:String(B),target:{target:H,category:T.category,provider:T.provider,model:T.model??"unknown"},context:{name:V}};z.push(L);let D=w?w.padEnd(18):"";q?.(` ${D} \u2717 Error`)}}return q?.(""),WW($,J,z)}function UW($,X){if($==="default"&&X==="default")return"";if(X==="default")return`[${$}]`;return`[${$}/${X}]`}async function HW($,X,Z,q,z,G,J,Q){let{config:Y}=d4(X,z.targets),{config:U}=UZ(Z,z.contexts),W=Q.targetFactory?Q.targetFactory(X,Y):m4(X,Y);if($.compareSurfaces&&$.compareSurfaces.length>0){let _=[],O;for(let I of $.compareSurfaces){let R=new Set(I),N=G.filter((p0)=>R.has(p0.id)),C=$.requiredSources.filter((p0)=>R.has(p0)),F=await W.run($.prompt,{tool:q,cwd:q.path,context:U,docs:N,requiredSources:C,onProgress:Q.onProgress}),y=l$({response:F.response,requiredSources:C,registeredIds:I}),a=f0({response:F.response,traps:$.traps??[]}),q0=a.fired.length>0,k=q0?"NO":y.answerable,V1=q0?0:y.confidence,bZ=q0?`Trap fired: ${a.fired.map((p0)=>`"${p0.id}" (${p0.reason})`).join("; ")}`:y.reason;_.push({active:I,answerable:k,confidence:V1,response:F.response,reason:bZ,citations:y.citations,traps:a,allResponses:F.allResponses}),O=F.metadata??O}return{scenario:$,answerable:null,confidence:null,response:null,reason:null,citations:null,traps:null,surfaces:_,target:O,context:{name:Z}}}let H=await W.run($.prompt,{tool:q,cwd:q.path,context:U,docs:G,requiredSources:$.requiredSources,onProgress:Q.onProgress}),V=l$({response:H.response,requiredSources:$.requiredSources,registeredIds:J}),w=f0({response:H.response,traps:$.traps??[]}),B=w.fired.length>0,T=B?"NO":V.answerable,L=B?0:V.confidence,D=B?`Trap fired: ${w.fired.map((_)=>`"${_.id}" (${_.reason})`).join("; ")}`:V.reason;return{scenario:$,answerable:T,confidence:L,response:H.response,reason:D,citations:V.citations,traps:w,target:H.metadata,context:{name:Z},toolsUsed:H.toolsUsed,sources:H.sources,allResponses:H.allResponses}}function WW($,X,Z){let q=[];for(let Q of Z){if(Q.surfaces){for(let Y of Q.surfaces)q.push({answerable:Y.answerable,confidence:Y.confidence});continue}if(Q.answerable!==null&&Q.confidence!==null)q.push({answerable:Q.answerable,confidence:Q.confidence})}let z=q.length,G=q.filter((Q)=>Q.answerable==="YES"||Q.answerable==="PARTIAL").length,J=z>0?Math.round(q.reduce((Q,Y)=>{if(Y.answerable==="YES")return Q+Y.confidence;if(Y.answerable==="PARTIAL")return Q+Y.confidence*0.5;return Q},0)/z):0;return{tool:{name:$.name,description:$.description,path:$.path},docs:X,scenarios:Z,summary:{total:z,answered:G,unanswered:z-G,score:J}}}var HZ=($=0)=>(X)=>`\x1B[${X+$}m`,WZ=($=0)=>(X)=>`\x1B[${38+$};5;${X}m`,VZ=($=0)=>(X,Z,q)=>`\x1B[${38+$};2;${X};${Z};${q}m`,x={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},JB=Object.keys(x.modifier),VW=Object.keys(x.color),TW=Object.keys(x.bgColor),QB=[...VW,...TW];function wW(){let $=new Map;for(let[X,Z]of Object.entries(x)){for(let[q,z]of Object.entries(Z))x[q]={open:`\x1B[${z[0]}m`,close:`\x1B[${z[1]}m`},Z[q]=x[q],$.set(z[0],z[1]);Object.defineProperty(x,X,{value:Z,enumerable:!1})}return Object.defineProperty(x,"codes",{value:$,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=HZ(),x.color.ansi256=WZ(),x.color.ansi16m=VZ(),x.bgColor.ansi=HZ(10),x.bgColor.ansi256=WZ(10),x.bgColor.ansi16m=VZ(10),Object.defineProperties(x,{rgbToAnsi256:{value(X,Z,q){if(X===Z&&Z===q){if(X<8)return 16;if(X>248)return 231;return Math.round((X-8)/247*24)+232}return 16+36*Math.round(X/255*5)+6*Math.round(Z/255*5)+Math.round(q/255*5)},enumerable:!1},hexToRgb:{value(X){let Z=/[a-f\d]{6}|[a-f\d]{3}/i.exec(X.toString(16));if(!Z)return[0,0,0];let[q]=Z;if(q.length===3)q=[...q].map((G)=>G+G).join("");let z=Number.parseInt(q,16);return[z>>16&255,z>>8&255,z&255]},enumerable:!1},hexToAnsi256:{value:(X)=>x.rgbToAnsi256(...x.hexToRgb(X)),enumerable:!1},ansi256ToAnsi:{value(X){if(X<8)return 30+X;if(X<16)return 90+(X-8);let Z,q,z;if(X>=232)Z=((X-232)*10+8)/255,q=Z,z=Z;else{X-=16;let Q=X%36;Z=Math.floor(X/36)/5,q=Math.floor(Q/6)/5,z=Q%6/5}let G=Math.max(Z,q,z)*2;if(G===0)return 30;let J=30+(Math.round(z)<<2|Math.round(q)<<1|Math.round(Z));if(G===2)J+=60;return J},enumerable:!1},rgbToAnsi:{value:(X,Z,q)=>x.ansi256ToAnsi(x.rgbToAnsi256(X,Z,q)),enumerable:!1},hexToAnsi:{value:(X)=>x.ansi256ToAnsi(x.hexToAnsi256(X)),enumerable:!1}}),x}var LW=wW(),Z0=LW;import c4 from"process";import BW from"os";import TZ from"tty";function e($,X=globalThis.Deno?globalThis.Deno.args:c4.argv){let Z=$.startsWith("-")?"":$.length===1?"-":"--",q=X.indexOf(Z+$),z=X.indexOf("--");return q!==-1&&(z===-1||q<z)}var{env:f}=c4,v2;if(e("no-color")||e("no-colors")||e("color=false")||e("color=never"))v2=0;else if(e("color")||e("colors")||e("color=true")||e("color=always"))v2=1;function KW(){if("FORCE_COLOR"in f){if(f.FORCE_COLOR==="true")return 1;if(f.FORCE_COLOR==="false")return 0;return f.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(f.FORCE_COLOR,10),3)}}function DW($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function _W($,{streamIsTTY:X,sniffFlags:Z=!0}={}){let q=KW();if(q!==void 0)v2=q;let z=Z?v2:q;if(z===0)return 0;if(Z){if(e("color=16m")||e("color=full")||e("color=truecolor"))return 3;if(e("color=256"))return 2}if("TF_BUILD"in f&&"AGENT_NAME"in f)return 1;if($&&!X&&z===void 0)return 0;let G=z||0;if(f.TERM==="dumb")return G;if(c4.platform==="win32"){let J=BW.release().split(".");if(Number(J[0])>=10&&Number(J[2])>=10586)return Number(J[2])>=14931?3:2;return 1}if("CI"in f){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((J)=>(J in f)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((J)=>(J in f))||f.CI_NAME==="codeship")return 1;return G}if("TEAMCITY_VERSION"in f)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(f.TEAMCITY_VERSION)?1:0;if(f.COLORTERM==="truecolor")return 3;if(f.TERM==="xterm-kitty")return 3;if(f.TERM==="xterm-ghostty")return 3;if(f.TERM==="wezterm")return 3;if("TERM_PROGRAM"in f){let J=Number.parseInt((f.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(f.TERM_PROGRAM){case"iTerm.app":return J>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(f.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(f.TERM))return 1;if("COLORTERM"in f)return 1;return G}function wZ($,X={}){let Z=_W($,{streamIsTTY:$&&$.isTTY,...X});return DW(Z)}var FW={stdout:wZ({isTTY:TZ.isatty(1)}),stderr:wZ({isTTY:TZ.isatty(2)})},LZ=FW;function BZ($,X,Z){let q=$.indexOf(X);if(q===-1)return $;let z=X.length,G=0,J="";do J+=$.slice(G,q)+X+Z,G=q+z,q=$.indexOf(X,G);while(q!==-1);return J+=$.slice(G),J}function KZ($,X,Z,q){let z=0,G="";do{let J=$[q-1]==="\r";G+=$.slice(z,J?q-1:q)+X+(J?`\r
220
237
  `:`
221
- `)+z,Z=X+1,X=$.indexOf(`
222
- `,Z)}while(X!==-1);return H+=$.slice(Z),H}var{stdout:m4,stderr:d4}=g4,i1=Symbol("GENERATOR"),C0=Symbol("STYLER"),J$=Symbol("IS_EMPTY"),p4=["ansi","ansi","ansi256","ansi16m"],y0=Object.create(null),XU=($,q={})=>{if(q.level&&!(Number.isInteger(q.level)&&q.level>=0&&q.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let z=m4?m4.level:0;$.level=q.level===void 0?z:q.level};var ZU=($)=>{let q=(...z)=>z.join(" ");return XU(q,$),Object.setPrototypeOf(q,U$.prototype),q};function U$($){return ZU($)}Object.setPrototypeOf(U$.prototype,Function.prototype);for(let[$,q]of Object.entries(d))y0[$]={get(){let z=Gq(this,s1(q.open,q.close,this[C0]),this[J$]);return Object.defineProperty(this,$,{value:z}),z}};y0.visible={get(){let $=Gq(this,this[C0],!0);return Object.defineProperty(this,"visible",{value:$}),$}};var a1=($,q,z,...X)=>{if($==="rgb"){if(q==="ansi16m")return d[z].ansi16m(...X);if(q==="ansi256")return d[z].ansi256(d.rgbToAnsi256(...X));return d[z].ansi(d.rgbToAnsi(...X))}if($==="hex")return a1("rgb",q,z,...d.hexToRgb(...X));return d[z][$](...X)},HU=["rgb","hex","ansi256"];for(let $ of HU){y0[$]={get(){let{level:z}=this;return function(...X){let Z=s1(a1($,p4[z],"color",...X),d.color.close,this[C0]);return Gq(this,Z,this[J$])}}};let q="bg"+$[0].toUpperCase()+$.slice(1);y0[q]={get(){let{level:z}=this;return function(...X){let Z=s1(a1($,p4[z],"bgColor",...X),d.bgColor.close,this[C0]);return Gq(this,Z,this[J$])}}}}var QU=Object.defineProperties(()=>{},{...y0,level:{enumerable:!0,get(){return this[i1].level},set($){this[i1].level=$}}}),s1=($,q,z)=>{let X,Z;if(z===void 0)X=$,Z=q;else X=z.openAll+$,Z=q+z.closeAll;return{open:$,close:q,openAll:X,closeAll:Z,parent:z}},Gq=($,q,z)=>{let X=(...Z)=>JU(X,Z.length===1?""+Z[0]:Z.join(" "));return Object.setPrototypeOf(X,QU),X[i1]=$,X[C0]=q,X[J$]=z,X},JU=($,q)=>{if($.level<=0||!q)return $[J$]?"":q;let z=$[C0];if(z===void 0)return q;let{openAll:X,closeAll:Z}=z;if(q.includes("\x1B"))while(z!==void 0)q=v4(q,z.close,z.open),z=z.parent;let H=q.indexOf(`
223
- `);if(H!==-1)q=u4(q,Z,X,H);return X+q+Z};Object.defineProperties(U$.prototype,y0);var UU=U$(),RB=U$({level:d4?d4.level:0});var P=UU;var l4="\u2500".repeat(55);function s4($){if($==="success")return P.green;if($==="warning")return P.yellow;return P.red}function GU($){if($>=70)return P.green;if($>=50)return P.yellow;return P.red}function r4($){if($.label==="Error")return $.label;return`${$.label} (${$.confidence}%)`}function YU($){let q=L0({answerable:$.answerable??"NO",confidence:$.confidence??0,traps:$.traps??{fired:[],avoided:[]},error:$.error}),z=s4(q.tone);return{icon:z(q.icon),status:r4(q),color:z}}function BU($){let q=$.target?.target??"default",z=$.context?.name??"default";if(q==="default"&&z==="default")return"";if(z==="default")return P.dim(`[${q}]`);return P.dim(`[${q}/${z}]`)}function WU($){let q=$.map((z)=>z.scenario.name);return new Set(q).size!==q.length}function Yq($){return $.map((q)=>`[${q}]`).join(", ")}function n4($,q){let z=[];if($.error)return z.push(P.dim(`${q}error: ${$.error}`)),z;if($.traps.fired.length>0)for(let X of $.traps.fired)z.push(P.red(`${q}trap: ${X.id}`)),z.push(P.dim(`${q}reason: ${X.reason}`)),z.push(P.dim(`${q}match: "${X.matched}"`));else if($.reason&&$.answerable!=="YES")z.push(P.dim(`${q}reason: ${$.reason}`));if($.citations.cited.length>0)z.push(P.dim(`${q}cited: ${Yq($.citations.cited)}`));if($.citations.missing.length>0)z.push(P.dim(`${q}missing: ${Yq($.citations.missing)}`));if($.citations.unknown.length>0)z.push(P.dim(`${q}unknown: ${Yq($.citations.unknown)}`));return z}function c4($,q){if(!$.traps||!$.citations)return[];return n4({error:$.error,traps:$.traps,reason:$.reason??"",answerable:$.answerable??"NO",citations:$.citations},q)}function i4($){let{icon:q,status:z,color:X}=YU($),Z=BU($),H=`${q} ${z}`;return Z?`${Z} ${X(H)}`:X(H)}function a4($,q){if(!$.surfaces)return[];let z=[];z.push(`${q}${P.dim("Citations scoped to active surface (compare mode)")}`);for(let X of $.surfaces){let Z=L0(X),H=s4(Z.tone),Q=P.dim(`[${X.active.join(",")}]`),J=`${H(Z.icon)} ${H(r4(Z))}`;z.push(`${q}${Q} ${J}`),z.push(...n4({traps:X.traps,reason:X.reason,answerable:X.answerable,citations:X.citations},`${q} `))}return z}function TU($){let q=0,z=0,X=0;for(let Z of $){if(Z.surfaces){for(let H of Z.surfaces)q+=H.traps.fired.length,z+=H.citations.missing.length,X+=H.citations.unknown.length;continue}if(Z.traps)q+=Z.traps.fired.length;if(Z.citations)z+=Z.citations.missing.length,X+=Z.citations.unknown.length}if(q>0&&z+X>0)return"Review fired traps and citation gaps.";if(q>0)return"Review fired traps before trusting this surface.";if(z+X>0)return"Review missing and unknown citations.";return"Citations hold. No declared traps fired."}function LU($,q){let z=$.summary.score,Z=`Overall: ${GU(z)(`${z}`)} / 100`;if(q===void 0||q<=0)return Z;let Q=z>=q?P.green("run passes"):P.red("run fails");return`${Z} \xB7 threshold ${q} \xB7 ${Q}`}function o4($,q={}){let{tool:z,scenarios:X,summary:Z}=$,H=X,Q=[];if(Q.push(P.bold("pickled check")),Q.push(l4),Q.push(`Tool: ${P.cyan(z.name)}`),$.docs.length>0)Q.push(`Sources: ${P.dim(Yq($.docs.map((J)=>J.id)))}`);else Q.push(`Sources: ${P.dim("none registered")}`);if(Q.push(`Scenarios: ${P.dim(String(Z.total))}`),Q.push(""),WU(H)){let J=new Map;for(let G of H){let U=G.scenario.name;if(!J.has(U))J.set(U,[]);J.get(U)?.push(G)}for(let[G,U]of J){Q.push(`Scenario: ${G}`);for(let B of U)if(B.surfaces)Q.push(...a4(B," "));else Q.push(` ${i4(B)}`),Q.push(...c4(B," "));Q.push("")}}else for(let J of H){if(Q.push(`Scenario: ${J.scenario.name}`),J.surfaces)Q.push(...a4(J," "));else Q.push(` ${i4(J)}`),Q.push(...c4(J," "));Q.push("")}return Q.push(l4),Q.push(LU($,q.threshold)),Q.push(P.dim(TU(X))),Q.join(`
224
- `)}function r1($,q={}){console.log(o4($,q)),console.log()}function Bq($,q={}){if(q.verbose)return JSON.stringify($,null,2);let z={...$,docs:$.docs.map((X)=>({...X,content:""})),scenarios:$.scenarios.map((X)=>{let{allResponses:Z,...H}=X;return H})};return JSON.stringify(z,null,2)}function _U($){if($.format&&$.format!=="terminal")return $.format;if($.json)return"json";return $.format??"terminal"}async function t4($,q){let{output:z}=q,X=_U(q),Z=VU.resolve($),H;try{H=await Qq({targetRepo:Z})}catch(Y){console.error(P.red(Y instanceof Error?Y.message:Y)),process.exit(1)}let Q;if(X==="json")Q=$q(H);else if(X==="markdown")Q=e$(H);else Q=qq(H);if(z)await Bun.write(z,Q);else await IU(`${Q}
225
- `);let J=H.findings.filter((Y)=>Y.severity==="error").length,G=H.findings.filter((Y)=>Y.severity==="warning").length;if(X!=="json"&&!z)if(console.log(),J===0&&G===0)console.log(P.green("Audit clean. No issues found."));else{let Y=J>0?P.red:P.yellow;console.log(Y(`Audit found ${J} error(s), ${G} warning(s).`))}if((q.failOn??"error")==="warning"?J+G>0:J>0)process.exit(1)}function IU($){return new Promise((q,z)=>{process.stdout.write($,(X)=>{if(X)z(X);else q()})})}import DU from"path";async function e4($,q){let{json:z,output:X,verbose:Z}=q,H=(W)=>!z&&console.log(W),Q=DU.resolve($),J;try{J=await S0(Q)}catch(W){console.error(P.red(W instanceof Error?W.message:W)),console.error(),console.error(P.dim("Run `pickled init` to create a config file")),process.exit(1)}if(q.target){let W=J.scenarios.length;try{J=f1(J,q.target)}catch(_){console.error(P.red(_ instanceof Error?_.message:String(_))),process.exit(1)}let L=W-J.scenarios.length;if(L>0&&!z)H(P.dim(`Skipping ${L} scenario(s) with explicit target != "${q.target}"`))}let G={name:J.tool.name,description:J.tool.description,path:Q};if(Z){H(P.bold("pickled check")),H(""),H(P.dim(` Tool: ${G.name}`)),H(P.dim(` Scenarios: ${J.scenarios.length}`));for(let W of J.scenarios)H(P.dim(` - ${W.name}`))}let U=await l1(G,J,{onProgress:Z?(W)=>{if(!z)H(P.dim(` ${W}`))}:void 0}),B=q.threshold?parseInt(q.threshold,10):J.threshold??0,Y=B>0&&U.summary.score<B;if(X)await Bun.write(X,Bq(U,{verbose:Z}));else if(z)await RU(`${Bq(U,{verbose:Z})}
226
- `);else r1(U,{threshold:B});if(Y){if(z||X)console.error(P.red(`Overall: ${U.summary.score} / 100 \xB7 threshold ${B} \xB7 run fails`)),console.error(P.dim("Review failed scenarios before trusting this surface."));process.exit(1)}}function RU($){return new Promise((q,z)=>{process.stdout.write($,(X)=>{if(X)z(X);else q()})})}import MU from"path";var wU=`# pickled.yml - Agent legibility check for your product
238
+ `)+Z,z=q+1,q=$.indexOf(`
239
+ `,z)}while(q!==-1);return G+=$.slice(z),G}var{stdout:DZ,stderr:_Z}=LZ,l4=Symbol("GENERATOR"),K$=Symbol("STYLER"),H1=Symbol("IS_EMPTY"),FZ=["ansi","ansi","ansi256","ansi16m"],D$=Object.create(null),OW=($,X={})=>{if(X.level&&!(Number.isInteger(X.level)&&X.level>=0&&X.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let Z=DZ?DZ.level:0;$.level=X.level===void 0?Z:X.level};var MW=($)=>{let X=(...Z)=>Z.join(" ");return OW(X,$),Object.setPrototypeOf(X,W1.prototype),X};function W1($){return MW($)}Object.setPrototypeOf(W1.prototype,Function.prototype);for(let[$,X]of Object.entries(Z0))D$[$]={get(){let Z=u2(this,a4(X.open,X.close,this[K$]),this[H1]);return Object.defineProperty(this,$,{value:Z}),Z}};D$.visible={get(){let $=u2(this,this[K$],!0);return Object.defineProperty(this,"visible",{value:$}),$}};var i4=($,X,Z,...q)=>{if($==="rgb"){if(X==="ansi16m")return Z0[Z].ansi16m(...q);if(X==="ansi256")return Z0[Z].ansi256(Z0.rgbToAnsi256(...q));return Z0[Z].ansi(Z0.rgbToAnsi(...q))}if($==="hex")return i4("rgb",X,Z,...Z0.hexToRgb(...q));return Z0[Z][$](...q)},IW=["rgb","hex","ansi256"];for(let $ of IW){D$[$]={get(){let{level:Z}=this;return function(...q){let z=a4(i4($,FZ[Z],"color",...q),Z0.color.close,this[K$]);return u2(this,z,this[H1])}}};let X="bg"+$[0].toUpperCase()+$.slice(1);D$[X]={get(){let{level:Z}=this;return function(...q){let z=a4(i4($,FZ[Z],"bgColor",...q),Z0.bgColor.close,this[K$]);return u2(this,z,this[H1])}}}}var RW=Object.defineProperties(()=>{},{...D$,level:{enumerable:!0,get(){return this[l4].level},set($){this[l4].level=$}}}),a4=($,X,Z)=>{let q,z;if(Z===void 0)q=$,z=X;else q=Z.openAll+$,z=X+Z.closeAll;return{open:$,close:X,openAll:q,closeAll:z,parent:Z}},u2=($,X,Z)=>{let q=(...z)=>PW(q,z.length===1?""+z[0]:z.join(" "));return Object.setPrototypeOf(q,RW),q[l4]=$,q[K$]=X,q[H1]=Z,q},PW=($,X)=>{if($.level<=0||!X)return $[H1]?"":X;let Z=$[K$];if(Z===void 0)return X;let{openAll:q,closeAll:z}=Z;if(X.includes("\x1B"))while(Z!==void 0)X=BZ(X,Z.close,Z.open),Z=Z.parent;let G=X.indexOf(`
240
+ `);if(G!==-1)X=KZ(X,z,q,G);return q+X+z};Object.defineProperties(W1.prototype,D$);var NW=W1(),KB=W1({level:_Z?_Z.level:0});var M=NW;var OZ="\u2500".repeat(55);function PZ($){if($==="success")return M.green;if($==="warning")return M.yellow;return M.red}function AW($){if($>=70)return M.green;if($>=50)return M.yellow;return M.red}function NZ($){if($.label==="Error")return $.label;return`${$.label} (${$.confidence}%)`}function SW($){let X=k0({answerable:$.answerable??"NO",confidence:$.confidence??0,traps:$.traps??{fired:[],avoided:[]},error:$.error}),Z=PZ(X.tone);return{icon:Z(X.icon),status:NZ(X),color:Z}}function jW($){let X=$.target?.target??"default",Z=$.context?.name??"default";if(X==="default"&&Z==="default")return"";if(Z==="default")return M.dim(`[${X}]`);return M.dim(`[${X}/${Z}]`)}function EW($){let X=$.map((Z)=>Z.scenario.name);return new Set(X).size!==X.length}function m2($){return $.map((X)=>`[${X}]`).join(", ")}function AZ($,X){let Z=[];if($.error)return Z.push(M.dim(`${X}error: ${$.error}`)),Z;if($.traps.fired.length>0)for(let q of $.traps.fired)Z.push(M.red(`${X}trap: ${q.id}`)),Z.push(M.dim(`${X}reason: ${q.reason}`)),Z.push(M.dim(`${X}match: "${q.matched}"`));else if($.reason&&$.answerable!=="YES")Z.push(M.dim(`${X}reason: ${$.reason}`));if($.citations.cited.length>0)Z.push(M.dim(`${X}cited: ${m2($.citations.cited)}`));if($.citations.missing.length>0)Z.push(M.dim(`${X}missing: ${m2($.citations.missing)}`));if($.citations.unknown.length>0)Z.push(M.dim(`${X}unknown: ${m2($.citations.unknown)}`));return Z}function MZ($,X){if(!$.traps||!$.citations)return[];return AZ({error:$.error,traps:$.traps,reason:$.reason??"",answerable:$.answerable??"NO",citations:$.citations},X)}function IZ($){let{icon:X,status:Z,color:q}=SW($),z=jW($),G=`${X} ${Z}`;return z?`${z} ${q(G)}`:q(G)}function RZ($,X){if(!$.surfaces)return[];let Z=[];Z.push(`${X}${M.dim("Citations scoped to active surface (compare mode)")}`);for(let q of $.surfaces){let z=k0(q),G=PZ(z.tone),J=M.dim(`[${q.active.join(",")}]`),Q=`${G(z.icon)} ${G(NZ(z))}`;Z.push(`${X}${J} ${Q}`),Z.push(...AZ({traps:q.traps,reason:q.reason,answerable:q.answerable,citations:q.citations},`${X} `))}return Z}function CW($){let X=0,Z=0,q=0;for(let z of $){if(z.surfaces){for(let G of z.surfaces)X+=G.traps.fired.length,Z+=G.citations.missing.length,q+=G.citations.unknown.length;continue}if(z.traps)X+=z.traps.fired.length;if(z.citations)Z+=z.citations.missing.length,q+=z.citations.unknown.length}if(X>0&&Z+q>0)return"Review fired traps and citation gaps.";if(X>0)return"Review fired traps before trusting this surface.";if(Z+q>0)return"Review missing and unknown citations.";return"Citations hold. No declared traps fired."}function bW($,X){let Z=$.summary.score,z=`Overall: ${AW(Z)(`${Z}`)} / 100`;if(X===void 0||X<=0)return z;let J=Z>=X?M.green("run passes"):M.red("run fails");return`${z} \xB7 threshold ${X} \xB7 ${J}`}function SZ($,X={}){let{tool:Z,scenarios:q,summary:z}=$,G=q,J=[];if(J.push(M.bold("pickled check")),J.push(OZ),J.push(`Tool: ${M.cyan(Z.name)}`),$.docs.length>0)J.push(`Sources: ${M.dim(m2($.docs.map((Q)=>Q.id)))}`);else J.push(`Sources: ${M.dim("none registered")}`);if(J.push(`Scenarios: ${M.dim(String(z.total))}`),J.push(""),EW(G)){let Q=new Map;for(let Y of G){let U=Y.scenario.name;if(!Q.has(U))Q.set(U,[]);Q.get(U)?.push(Y)}for(let[Y,U]of Q){J.push(`Scenario: ${Y}`);for(let W of U)if(W.surfaces)J.push(...RZ(W," "));else J.push(` ${IZ(W)}`),J.push(...MZ(W," "));J.push("")}}else for(let Q of G){if(J.push(`Scenario: ${Q.scenario.name}`),Q.surfaces)J.push(...RZ(Q," "));else J.push(` ${IZ(Q)}`),J.push(...MZ(Q," "));J.push("")}return J.push(OZ),J.push(bW($,X.threshold)),J.push(M.dim(CW(q))),J.join(`
241
+ `)}function s4($,X={}){console.log(SZ($,X)),console.log()}function d2($,X={}){if(X.verbose)return JSON.stringify($,null,2);let Z={...$,docs:$.docs.map((q)=>({...q,content:""})),scenarios:$.scenarios.map((q)=>{let{allResponses:z,...G}=q;return G})};return JSON.stringify(Z,null,2)}function xW($){if($.format&&$.format!=="terminal")return $.format;if($.json)return"json";return $.format??"terminal"}async function jZ($,X){let{output:Z}=X,q=xW(X),z=yW.resolve($),G;try{G=await U2({targetRepo:z})}catch(H){console.error(M.red(H instanceof Error?H.message:H)),process.exit(1)}let J;if(q==="json")J=q2(G);else if(q==="markdown")J=Z2(G);else J=z2(G);if(Z)await Bun.write(Z,J);else await fW(`${J}
242
+ `);let Q=G.findings.filter((H)=>H.severity==="error").length,Y=G.findings.filter((H)=>H.severity==="warning").length;if(q!=="json"&&!Z)if(console.log(),Q===0&&Y===0)console.log(M.green("Audit clean. No issues found."));else{let H=Q>0?M.red:M.yellow;console.log(H(`Audit found ${Q} error(s), ${Y} warning(s).`))}if((X.failOn??"error")==="warning"?Q+Y>0:Q>0)process.exit(1)}function fW($){return new Promise((X,Z)=>{process.stdout.write($,(q)=>{if(q)Z(q);else X()})})}import kW from"path";async function EZ($,X){let{json:Z,output:q,verbose:z}=X,G=(V)=>!Z&&console.log(V),J=kW.resolve($),Q;try{Q=await Z$(J)}catch(V){console.error(M.red(V instanceof Error?V.message:V)),console.error(),console.error(M.dim("Run `pickled init` to create a config file")),process.exit(1)}if(X.target){let V=Q.scenarios.length;try{Q=W4(Q,X.target)}catch(B){console.error(M.red(B instanceof Error?B.message:String(B))),process.exit(1)}let w=V-Q.scenarios.length;if(w>0&&!Z)G(M.dim(`Skipping ${w} scenario(s) with explicit target != "${X.target}"`))}let Y={name:Q.tool.name,description:Q.tool.description,path:J};if(z){G(M.bold("pickled check")),G(""),G(M.dim(` Tool: ${Y.name}`)),G(M.dim(` Scenarios: ${Q.scenarios.length}`));for(let V of Q.scenarios)G(M.dim(` - ${V.name}`))}let U=await p4(Y,Q,{onProgress:z?(V)=>{if(!Z)G(M.dim(` ${V}`))}:void 0}),W=X.threshold?parseInt(X.threshold,10):Q.threshold??0,H=W>0&&U.summary.score<W;if(q)await Bun.write(q,d2(U,{verbose:z}));else if(Z)await gW(`${d2(U,{verbose:z})}
243
+ `);else s4(U,{threshold:W});if(H){if(Z||q)console.error(M.red(`Overall: ${U.summary.score} / 100 \xB7 threshold ${W} \xB7 run fails`)),console.error(M.dim("Review failed scenarios before trusting this surface."));process.exit(1)}}function gW($){return new Promise((X,Z)=>{process.stdout.write($,(q)=>{if(q)Z(q);else X()})})}import hW from"path";var vW=`# pickled.yml - Agent legibility check for your product
227
244
 
228
245
  tool:
229
246
  name: "your-product"
@@ -245,4 +262,4 @@ scenarios:
245
262
 
246
263
  # Optional: fail CI if score falls below threshold
247
264
  # threshold: 80
248
- `;async function $5($){let z=`${MU.resolve($)}/pickled.yml`;if(await Bun.file(z).exists())console.error(P.red("pickled.yml already exists")),process.exit(1);await Bun.write(z,wU),console.log(P.green("Created pickled.yml")),console.log(),console.log(P.dim("Next steps:")),console.log(P.dim(" 1. Edit pickled.yml: list your sources and scenarios")),console.log(P.dim(" 2. Run: pickled check")),console.log()}_0.name("pickled").description("Test what agents actually understand about your product").version(V2.version);_0.command("init").description("Create a pickled.yml config file").argument("[path]","Path to your project (default: current directory)",".").action($5);_0.command("audit").description("Static scan of agent-context files (CLAUDE.md, AGENTS.md, llms.txt). No LLM calls.").argument("[path]","Path to your project (default: current directory)",".").addOption(new Mq("--format <name>","Output format").choices(["terminal","markdown","json"]).default("terminal")).option("--json","Shorthand for --format json").option("-o, --output <file>","Save report to file").addOption(new Mq("--fail-on <level>","Exit non-zero on this severity or higher").choices(["error","warning"]).default("error")).action(t4);_0.command("check").description("Run agent scenarios against registered sources").argument("[path]","Path to your project (default: current directory)",".").option("--json","Output as JSON").option("-o, --output <file>","Save report to file").option("-v, --verbose","Show detailed progress").option("-t, --threshold <percent>","Minimum score % to pass (overrides config)").option("--target <name>","Run only the named target (overrides matrix.target)").action(e4);await _0.parseAsync();
265
+ `;async function CZ($){let Z=`${hW.resolve($)}/pickled.yml`;if(await Bun.file(Z).exists())console.error(M.red("pickled.yml already exists")),process.exit(1);await Bun.write(Z,vW),console.log(M.green("Created pickled.yml")),console.log(),console.log(M.dim("Next steps:")),console.log(M.dim(" 1. Edit pickled.yml: list your sources and scenarios")),console.log(M.dim(" 2. Run: pickled check")),console.log()}c0.name("pickled").description("Test what agents actually understand about your product").version(wX.version);c0.command("init").description("Create a pickled.yml config file").argument("[path]","Path to your project (default: current directory)",".").action(CZ);c0.command("audit").description("Static scan of agent-context files (CLAUDE.md, AGENTS.md, llms.txt). No LLM calls.").argument("[path]","Path to your project (default: current directory)",".").addOption(new o2("--format <name>","Output format").choices(["terminal","markdown","json"]).default("terminal")).option("--json","Shorthand for --format json").option("-o, --output <file>","Save report to file").addOption(new o2("--fail-on <level>","Exit non-zero on this severity or higher").choices(["error","warning"]).default("error")).action(jZ);c0.command("check").description("Run agent scenarios against registered sources").argument("[path]","Path to your project (default: current directory)",".").option("--json","Output as JSON").option("-o, --output <file>","Save report to file").option("-v, --verbose","Show detailed progress").option("-t, --threshold <percent>","Minimum score % to pass (overrides config)").option("--target <name>","Run only the named target (overrides matrix.target)").action(EZ);await c0.parseAsync();