@pickled-dev/cli 0.12.0 → 0.14.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 xZ=Object.create;var{getPrototypeOf:yZ,defineProperty:n4,getOwnPropertyNames:kZ}=Object;var fZ=Object.prototype.hasOwnProperty;function gZ($){return this[$]}var hZ,vZ,r4=($,X,Z)=>{var z=$!=null&&typeof $==="object";if(z){var q=X?hZ??=new WeakMap:vZ??=new WeakMap,J=q.get($);if(J)return J}Z=$!=null?xZ(yZ($)):{};let G=X||!$||!$.__esModule?n4(Z,"default",{value:$,enumerable:!0}):Z;for(let Q of kZ($))if(!fZ.call(G,Q))n4(G,Q,{get:gZ.bind($,Q),enumerable:!0});if(z)q.set($,G);return G};var D=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var Q0=import.meta.require;var F$=D((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=D((cZ)=>{var{InvalidArgumentError:pZ}=F$();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 lZ($){let X=$.name()+($.variadic===!0?"...":"");return $.required?"<"+X+">":"["+X+"]"}cZ.Argument=t4;cZ.humanReadableArgName=lZ});var l2=D((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((z)=>!z._hidden),Z=$._getHelpCommand();if(Z&&!Z._hidden)X.push(Z);if(this.sortSubcommands)X.sort((z,q)=>{return z.name().localeCompare(q.name())});return X}compareOptions($,X){let Z=(z)=>{return z.short?z.short.replace(/^-/,""):z.long.replace(/^--/,"")};return Z($).localeCompare(Z(X))}visibleOptions($){let X=$.options.filter((z)=>!z.hidden),Z=$._getHelpOption();if(Z&&!Z.hidden){let z=Z.short&&$._findOption(Z.short),q=Z.long&&$._findOption(Z.long);if(!z&&!q)X.push(Z);else if(Z.long&&!q)X.push($.createOption(Z.long,Z.description));else if(Z.short&&!z)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 z=Z.options.filter((q)=>!q.hidden);X.push(...z)}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,z)=>{return Math.max(Z,this.displayWidth(X.styleSubcommandTerm(X.subcommandTerm(z))))},0)}longestOptionTermLength($,X){return X.visibleOptions($).reduce((Z,z)=>{return Math.max(Z,this.displayWidth(X.styleOptionTerm(X.optionTerm(z))))},0)}longestGlobalOptionTermLength($,X){return X.visibleGlobalOptions($).reduce((Z,z)=>{return Math.max(Z,this.displayWidth(X.styleOptionTerm(X.optionTerm(z))))},0)}longestArgumentTermLength($,X){return X.visibleArguments($).reduce((Z,z)=>{return Math.max(Z,this.displayWidth(X.styleArgumentTerm(X.argumentTerm(z))))},0)}commandUsage($){let X=$._name;if($._aliases[0])X=X+"|"+$._aliases[0];let Z="";for(let z=$.parent;z;z=z.parent)Z=z.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 z=new Map;return $.forEach((q)=>{let J=Z(q);if(!z.has(J))z.set(J,[])}),X.forEach((q)=>{let J=Z(q);if(!z.has(J))z.set(J,[]);z.get(J).push(q)}),z}formatHelp($,X){let Z=X.padWidth($,X),z=X.helpWidth??80;function q(W,H){return X.formatItem(W,Z,H,X)}let J=[`${X.styleTitle("Usage:")} ${X.styleUsage(X.commandUsage($))}`,""],G=X.commandDescription($);if(G.length>0)J=J.concat([X.boxWrap(X.styleCommandDescription(G),z),""]);let Q=X.visibleArguments($).map((W)=>{return q(X.styleArgumentTerm(X.argumentTerm(W)),X.styleArgumentDescription(X.argumentDescription(W)))});if(J=J.concat(this.formatItemList("Arguments:",Q,X)),this.groupItems($.options,X.visibleOptions($),(W)=>W.helpGroupHeading??"Options:").forEach((W,H)=>{let V=W.map((B)=>{return q(X.styleOptionTerm(X.optionTerm(B)),X.styleOptionDescription(X.optionDescription(B)))});J=J.concat(this.formatItemList(H,V,X))}),X.showGlobalOptions){let W=X.visibleGlobalOptions($).map((H)=>{return q(X.styleOptionTerm(X.optionTerm(H)),X.styleOptionDescription(X.optionDescription(H)))});J=J.concat(this.formatItemList("Global Options:",W,X))}return this.groupItems($.commands,X.visibleCommands($),(W)=>W.helpGroup()||"Commands:").forEach((W,H)=>{let V=W.map((B)=>{return q(X.styleSubcommandTerm(X.subcommandTerm(B)),X.styleSubcommandDescription(X.subcommandDescription(B)))});J=J.concat(this.formatItemList(H,V,X))}),J.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,z){let J=" ".repeat(2);if(!Z)return J+$;let G=$.padEnd(X+$.length-z.displayWidth($)),Q=2,U=(this.helpWidth??80)-X-Q-2,W;if(U<this.minWidthToWrap||z.preformatted(Z))W=Z;else W=z.boxWrap(Z,U).replace(/\n/g,`
5
+ `+" ".repeat(X+Q));return J+G+" ".repeat(Q)+W.replace(/\n/g,`
6
+ ${J}`)}boxWrap($,X){if(X<this.minWidthToWrap)return $;let Z=$.split(/\r\n|\n/),z=/[\s]*[^\s]+/g,q=[];return Z.forEach((J)=>{let G=J.match(z);if(G===null){q.push("");return}let Q=[G.shift()],Y=this.displayWidth(Q[0]);G.forEach((U)=>{let W=this.displayWidth(U);if(Y+W<=X){Q.push(U),Y+=W;return}q.push(Q.join(""));let H=U.trimStart();Q=[H],Y=this.displayWidth(H)}),q.push(Q.join(""))}),q.join(`
7
+ `)}}function $X($){let X=/\x1b\[\d*(;\d*)*m/g;return $.replace(X,"")}nZ.Help=e4;nZ.stripColor=$X});var c2=D(($6)=>{var{InvalidArgumentError:tZ}=F$();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 zX{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 z=this.negativeOptions.get(Z).presetArg,q=z!==void 0?z:!1;return X.negate===(q===$)}}function XX($){return $.split("-").reduce((X,Z)=>{return X+Z[0].toUpperCase()+Z.slice(1)})}function eZ($){let X,Z,z=/^-[^-]$/,q=/^--[^-]/,J=$.split(/[ |,]+/).concat("guard");if(z.test(J[0]))X=J.shift();if(q.test(J[0]))Z=J.shift();if(!X&&z.test(J[0]))X=J.shift();if(!X&&q.test(J[0]))X=Z,Z=J.shift();if(J[0].startsWith("-")){let G=J[0],Q=`option creation failed due to '${G}' in option flags '${$}'`;if(/^-[^-][^-]/.test(G))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(z.test(G))throw Error(`${Q}
11
+ - too many short flags`);if(q.test(G))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=zX});var qX=D((J6)=>{function z6($,X){if(Math.abs($.length-X.length)>3)return Math.max($.length,X.length);let Z=[];for(let z=0;z<=$.length;z++)Z[z]=[z];for(let z=0;z<=X.length;z++)Z[0][z]=z;for(let z=1;z<=X.length;z++)for(let q=1;q<=$.length;q++){let J=1;if($[q-1]===X[z-1])J=0;else J=1;if(Z[q][z]=Math.min(Z[q-1][z]+1,Z[q][z-1]+1,Z[q-1][z-1]+J),q>1&&z>1&&$[q-1]===X[z-2]&&$[q-2]===X[z-1])Z[q][z]=Math.min(Z[q][z],Z[q-2][z-2]+1)}return Z[$.length][X.length]}function q6($,X){if(!X||X.length===0)return"";X=Array.from(new Set(X));let Z=$.startsWith("--");if(Z)$=$.slice(2),X=X.map((G)=>G.slice(2));let z=[],q=3,J=0.4;if(X.forEach((G)=>{if(G.length<=1)return;let Q=z6($,G),Y=Math.max($.length,G.length);if((Y-Q)/Y>J){if(Q<q)q=Q,z=[G];else if(Q===q)z.push(G)}}),z.sort((G,Q)=>G.localeCompare(Q)),Z)z=z.map((G)=>`--${G}`);if(z.length>1)return`
14
+ (Did you mean one of ${z.join(", ")}?)`;if(z.length===1)return`
15
+ (Did you mean ${z[0]}?)`;return""}J6.suggestSimilar=q6});var YX=D((T6)=>{var Q6=Q0("events").EventEmitter,i2=Q0("child_process"),Y0=Q0("path"),B1=Q0("fs"),C=Q0("process"),{Argument:Y6,humanReadableArgName:U6}=T1(),{CommanderError:a2}=F$(),{Help:H6,stripColor:W6}=l2(),{Option:JX,DualOptions:V6}=c2(),{suggestSimilar:GX}=qX();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)=>C.stdout.write(X),writeErr:(X)=>C.stderr.write(X),outputError:(X,Z)=>Z(X),getOutHelpWidth:()=>C.stdout.isTTY?C.stdout.columns:void 0,getErrHelpWidth:()=>C.stderr.isTTY?C.stderr.columns:void 0,getOutHasColors:()=>s2()??(C.stdout.isTTY&&C.stdout.hasColors?.()),getErrHasColors:()=>s2()??(C.stderr.isTTY&&C.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 z=X,q=Z;if(typeof z==="object"&&z!==null)q=z,z=null;q=q||{};let[,J,G]=$.match(/([^ ]+) *(.*)/),Q=this.createCommand(J);if(z)Q.description(z),Q._executableHandler=!0;if(q.isDefault)this._defaultCommandName=Q._name;if(Q._hidden=!!(q.noHelp||q.hidden),Q._executableFile=q.executableFile||null,G)Q.arguments(G);if(this._registerCommand(Q),Q.parent=this,Q.copyInheritedSettings(this),z)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,z){let q=this.createArgument($,X);if(typeof Z==="function")q.default(z).argParser(Z);else q.default(Z);return this.addArgument(q),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]",[,z,q]=Z.match(/([^ ]+) *(.*)/),J=X??"display help for command",G=this.createCommand(z);if(G.helpOption(!1),q)G.arguments(q);if(J)G.description(J);if(this._addImplicitHelpCommand=!0,this._helpCommand=G,$||X)this._initCommandGroup(G);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));C.exit($)}action($){let X=(Z)=>{let z=this.registeredArguments.length,q=Z.slice(0,z);if(this._storeOptionsAsProperties)q[z]=this;else q[z]=this.opts();return q.push(this),$.apply(this,q)};return this._actionHandler=X,this}createOption($,X){return new JX($,X)}_callParseArg($,X,Z,z){try{return $.parseArg(X,Z)}catch(q){if(q.code==="commander.invalidArgument"){let J=`${z} ${q.message}`;this.error(J,{exitCode:q.exitCode,code:q.code})}throw q}}_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=(z)=>{return[z.name()].concat(z.aliases())},Z=X($).find((z)=>this._findCommand(z));if(Z){let z=X(this._findCommand(Z)).join("|"),q=X($).join("|");throw Error(`cannot add command '${q}' as already have command '${z}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let X=$.name(),Z=$.attributeName();if($.negate){let q=$.long.replace(/^--no-/,"--");if(!this._findOption(q))this.setOptionValueWithSource(Z,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(Z,$.defaultValue,"default");let z=(q,J,G)=>{if(q==null&&$.presetArg!==void 0)q=$.presetArg;let Q=this.getOptionValue(Z);if(q!==null&&$.parseArg)q=this._callParseArg($,q,Q,J);else if(q!==null&&$.variadic)q=$._collectValue(q,Q);if(q==null)if($.negate)q=!1;else if($.isBoolean()||$.optional)q=!0;else q="";this.setOptionValueWithSource(Z,q,G)};if(this.on("option:"+X,(q)=>{let J=`error: option '${$.flags}' argument '${q}' is invalid.`;z(q,J,"cli")}),$.envVar)this.on("optionEnv:"+X,(q)=>{let J=`error: option '${$.flags}' value '${q}' from env '${$.envVar}' is invalid.`;z(q,J,"env")});return this}_optionEx($,X,Z,z,q){if(typeof X==="object"&&X instanceof JX)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let J=this.createOption(X,Z);if(J.makeOptionMandatory(!!$.mandatory),typeof z==="function")J.default(q).argParser(z);else if(z instanceof RegExp){let G=z;z=(Q,Y)=>{let U=G.exec(Q);return U?U[0]:Y},J.default(q).argParser(z)}else J.default(z);return this.addOption(J)}option($,X,Z,z){return this._optionEx({},$,X,Z,z)}requiredOption($,X,Z,z){return this._optionEx({mandatory:!0},$,X,Z,z)}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(C.versions?.electron)X.from="electron";let z=C.execArgv??[];if(z.includes("-e")||z.includes("--eval")||z.includes("-p")||z.includes("--print"))X.from="eval"}if($===void 0)$=C.argv;this.rawArgs=$.slice();let Z;switch(X.from){case void 0:case"node":this._scriptPath=$[1],Z=$.slice(2);break;case"electron":if(C.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(B1.existsSync($))return;let z=X?`searched for local subcommand relative to directory '${X}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",q=`'${$}' 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
+ - ${z}`;throw Error(q)}_executeSubCommand($,X){X=X.slice();let Z=!1,z=[".js",".ts",".tsx",".mjs",".cjs"];function q(U,W){let H=Y0.resolve(U,W);if(B1.existsSync(H))return H;if(z.includes(Y0.extname(W)))return;let V=z.find((B)=>B1.existsSync(`${H}${B}`));if(V)return`${H}${V}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let J=$._executableFile||`${this._name}-${$._name}`,G=this._executableDir||"";if(this._scriptPath){let U;try{U=B1.realpathSync(this._scriptPath)}catch{U=this._scriptPath}G=Y0.resolve(Y0.dirname(U),G)}if(G){let U=q(G,J);if(!U&&!$._executableFile&&this._scriptPath){let W=Y0.basename(this._scriptPath,Y0.extname(this._scriptPath));if(W!==this._name)U=q(G,`${W}-${$._name}`)}J=U||J}Z=z.includes(Y0.extname(J));let Q;if(C.platform!=="win32")if(Z)X.unshift(J),X=QX(C.execArgv).concat(X),Q=i2.spawn(C.argv[0],X,{stdio:"inherit"});else Q=i2.spawn(J,X,{stdio:"inherit"});else this._checkForMissingExecutable(J,G,$._name),X.unshift(J),X=QX(C.execArgv).concat(X),Q=i2.spawn(C.execPath,X,{stdio:"inherit"});if(!Q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((W)=>{C.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)C.exit(U);else Y(new a2(U,"commander.executeSubCommandAsync","(close)"))}),Q.on("error",(U)=>{if(U.code==="ENOENT")this._checkForMissingExecutable(J,G,$._name);else if(U.code==="EACCES")throw Error(`'${J}' not executable`);if(!Y)C.exit(1);else{let W=new a2(1,"commander.executeSubCommandAsync","(error)");W.nestedError=U,Y(W)}}),this.runningCommand=Q}_dispatchSubcommand($,X,Z){let z=this._findCommand($);if(!z)this.help({error:!0});z._prepareForParse();let q;return q=this._chainOrCallSubCommandHook(q,z,"preSubcommand"),q=this._chainOrCall(q,()=>{if(z._executableHandler)this._executeSubCommand(z,X.concat(Z));else return z._parseCommand(X,Z)}),q}_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,z,q)=>{let J=z;if(z!==null&&Z.parseArg){let G=`error: command-argument value '${z}' is invalid for argument '${Z.name()}'.`;J=this._callParseArg(Z,z,q,G)}return J};this._checkNumberOfArguments();let X=[];this.registeredArguments.forEach((Z,z)=>{let q=Z.defaultValue;if(Z.variadic){if(z<this.args.length){if(q=this.args.slice(z),Z.parseArg)q=q.reduce((J,G)=>{return $(Z,G,J)},Z.defaultValue)}else if(q===void 0)q=[]}else if(z<this.args.length){if(q=this.args[z],Z.parseArg)q=$(Z,q,Z.defaultValue)}X[z]=q}),this.processedArgs=X}_chainOrCall($,X){if($?.then&&typeof $.then==="function")return $.then(()=>X());return X()}_chainOrCallHooks($,X){let Z=$,z=[];if(this._getCommandAndAncestors().reverse().filter((q)=>q._lifeCycleHooks[X]!==void 0).forEach((q)=>{q._lifeCycleHooks[X].forEach((J)=>{z.push({hookedCommand:q,callback:J})})}),X==="postAction")z.reverse();return z.forEach((q)=>{Z=this._chainOrCall(Z,()=>{return q.callback(q.hookedCommand,this)})}),Z}_chainOrCallSubCommandHook($,X,Z){let z=$;if(this._lifeCycleHooks[Z]!==void 0)this._lifeCycleHooks[Z].forEach((q)=>{z=this._chainOrCall(z,()=>{return q(this,X)})});return z}_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 z=()=>{if(Z.unknown.length>0)this.unknownOption(Z.unknown[0])},q=`command:${this.name()}`;if(this._actionHandler){z(),this._processArguments();let J;if(J=this._chainOrCallHooks(J,"preAction"),J=this._chainOrCall(J,()=>this._actionHandler(this.processedArgs)),this.parent)J=this._chainOrCall(J,()=>{this.parent.emit(q,$,X)});return J=this._chainOrCallHooks(J,"postAction"),J}if(this.parent?.listenerCount(q))z(),this._processArguments(),this.parent.emit(q,$,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 z(),this._processArguments()}else if(this.commands.length)z(),this.help({error:!0});else z(),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 z=Z.attributeName();if(this.getOptionValue(z)===void 0)return!1;return this.getOptionValueSource(z)!=="default"});$.filter((Z)=>Z.conflictsWith.length>0).forEach((Z)=>{let z=$.find((q)=>Z.conflictsWith.includes(q.attributeName()));if(z)this._conflictingOption(Z,z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let X=[],Z=[],z=X;function q(U){return U.length>1&&U[0]==="-"}let J=(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)))},G=null,Q=null,Y=0;while(Y<$.length||Q){let U=Q??$[Y++];if(Q=null,U==="--"){if(z===Z)z.push(U);z.push(...$.slice(Y));break}if(G&&(!q(U)||J(U))){this.emit(`option:${G.name()}`,U);continue}if(G=null,q(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&&(!q($[Y])||J($[Y])))H=$[Y++];this.emit(`option:${W.name()}`,H)}else this.emit(`option:${W.name()}`);G=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(z===X&&q(U)&&!(this.commands.length===0&&J(U)))z=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){z.push(U,...$.slice(Y));break}z.push(U)}return{operands:X,unknown:Z}}opts(){if(this._storeOptionsAsProperties){let $={},X=this.options.length;for(let Z=0;Z<X;Z++){let z=this.options[Z].attributeName();$[z]=z===this._versionOptionName?this._version:this[z]}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||{},z=Z.exitCode||1,q=Z.code||"commander.error";this._exit(z,q,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in C.env){let X=$.attributeName();if(this.getOptionValue(X)===void 0||["default","config","env"].includes(this.getOptionValueSource(X)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,C.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((z)=>!X(z)).forEach((z)=>{this.setOptionValueWithSource(z,Z.implied[z],"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=(J)=>{let G=J.attributeName(),Q=this.getOptionValue(G),Y=this.options.find((W)=>W.negate&&G===W.attributeName()),U=this.options.find((W)=>!W.negate&&G===W.attributeName());if(Y&&(Y.presetArg===void 0&&Q===!1||Y.presetArg!==void 0&&Q===Y.presetArg))return Y;return U||J},z=(J)=>{let G=Z(J),Q=G.attributeName();if(this.getOptionValueSource(Q)==="env")return`environment variable '${G.envVar}'`;return`option '${G.flags}'`},q=`error: ${z($)} cannot be used with ${z(X)}`;this.error(q,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let X="";if($.startsWith("--")&&this._showSuggestionAfterError){let z=[],q=this;do{let J=q.createHelp().visibleOptions(q).filter((G)=>G.long).map((G)=>G.long);z=z.concat(J),q=q.parent}while(q&&!q._enablePositionalOptions);X=GX($,z)}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",q=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${X} argument${Z} but got ${$.length}.`;this.error(q,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],X="";if(this._showSuggestionAfterError){let z=[];this.createHelp().visibleCommands(this).forEach((q)=>{if(z.push(q.name()),q.alias())z.push(q.alias())}),X=GX($,z)}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 z=this.createOption(X,Z);return this._versionOptionName=z.attributeName(),this._registerOption(z),this.on("option:"+z.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 z=[Z.name()].concat(Z.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${z}'`)}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 z=X.formatHelp(this,X);if(Z.hasColors)return z;return this._outputConfiguration.stripColor(z)}_getOutputContext($){$=$||{};let X=!!$.error,Z,z,q;if(X)Z=(G)=>this._outputConfiguration.writeErr(G),z=this._outputConfiguration.getErrHasColors(),q=this._outputConfiguration.getErrHelpWidth();else Z=(G)=>this._outputConfiguration.writeOut(G),z=this._outputConfiguration.getOutHasColors(),q=this._outputConfiguration.getOutHelpWidth();return{error:X,write:(G)=>{if(!z)G=this._outputConfiguration.stripColor(G);return Z(G)},hasColors:z,helpWidth:q}}outputHelp($){let X;if(typeof $==="function")X=$,$=void 0;let Z=this._getOutputContext($),z={error:Z.error,write:Z.write,command:this};this._getCommandAndAncestors().reverse().forEach((J)=>J.emit("beforeAllHelp",z)),this.emit("beforeHelp",z);let q=this.helpInformation({error:Z.error});if(X){if(q=X(q),typeof q!=="string"&&!Buffer.isBuffer(q))throw Error("outputHelp callback must return a string or a Buffer")}if(Z.write(q),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",z),this._getCommandAndAncestors().forEach((J)=>J.emit("afterAllHelp",z))}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(C.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 z=`${$}Help`;return this.on(z,(q)=>{let J;if(typeof X==="function")J=X({error:q.error,command:q.command});else J=X;if(J)q.write(`${J}
28
+ `)}),this}_outputHelpIfRequested($){let X=this._getHelpOption();if(X&&$.find((z)=>X.is(z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function QX($){return $.map((X)=>{if(!X.startsWith("--inspect"))return X;let Z,z="127.0.0.1",q="9229",J;if((J=X.match(/^(--inspect(-brk)?)$/))!==null)Z=J[1];else if((J=X.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(Z=J[1],/^\d+$/.test(J[3]))q=J[3];else z=J[3];else if((J=X.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)Z=J[1],z=J[3],q=J[4];if(Z&&q!=="0")return`${Z}=${z}:${parseInt(q)+1}`;return X})}function s2(){if(C.env.NO_COLOR||C.env.FORCE_COLOR==="0"||C.env.FORCE_COLOR==="false")return!1;if(C.env.FORCE_COLOR||C.env.CLICOLOR_FORCE!==void 0)return!0;return}T6.Command=n2;T6.useColor=s2});var VX=D((_6)=>{var{Argument:UX}=T1(),{Command:r2}=YX(),{CommanderError:L6,InvalidArgumentError:HX}=F$(),{Help:D6}=l2(),{Option:WX}=c2();_6.program=new r2;_6.createCommand=($)=>new r2($);_6.createOption=($,X)=>new WX($,X);_6.createArgument=($,X)=>new UX($,X);_6.Command=r2;_6.Option=WX;_6.Argument=UX;_6.Help=D6;_6.CommanderError=L6;_6.InvalidArgumentError=HX;_6.InvalidOptionArgumentError=HX});var S=D((h6)=>{var $9=Symbol.for("yaml.alias"),KX=Symbol.for("yaml.document"),K1=Symbol.for("yaml.map"),LX=Symbol.for("yaml.pair"),X9=Symbol.for("yaml.scalar"),L1=Symbol.for("yaml.seq"),U0=Symbol.for("yaml.node.type"),E6=($)=>!!$&&typeof $==="object"&&$[U0]===$9,b6=($)=>!!$&&typeof $==="object"&&$[U0]===KX,x6=($)=>!!$&&typeof $==="object"&&$[U0]===K1,y6=($)=>!!$&&typeof $==="object"&&$[U0]===LX,DX=($)=>!!$&&typeof $==="object"&&$[U0]===X9,k6=($)=>!!$&&typeof $==="object"&&$[U0]===L1;function _X($){if($&&typeof $==="object")switch($[U0]){case K1:case L1:return!0}return!1}function f6($){if($&&typeof $==="object")switch($[U0]){case $9:case K1:case X9:case L1:return!0}return!1}var g6=($)=>(DX($)||_X($))&&!!$.anchor;h6.ALIAS=$9;h6.DOC=KX;h6.MAP=K1;h6.NODE_TYPE=U0;h6.PAIR=LX;h6.SCALAR=X9;h6.SEQ=L1;h6.hasAnchor=g6;h6.isAlias=E6;h6.isCollection=_X;h6.isDocument=b6;h6.isMap=x6;h6.isNode=f6;h6.isPair=y6;h6.isScalar=DX;h6.isSeq=k6});var M$=D((Xz)=>{var h=S(),l=Symbol("break visit"),FX=Symbol("skip children"),J0=Symbol("remove node");function D1($,X){let Z=MX(X);if(h.isDocument($)){if(c0(null,$.contents,Z,Object.freeze([$]))===J0)$.contents=null}else c0(null,$,Z,Object.freeze([]))}D1.BREAK=l;D1.SKIP=FX;D1.REMOVE=J0;function c0($,X,Z,z){let q=OX($,X,Z,z);if(h.isNode(q)||h.isPair(q))return wX($,z,q),c0($,q,Z,z);if(typeof q!=="symbol"){if(h.isCollection(X)){z=Object.freeze(z.concat(X));for(let J=0;J<X.items.length;++J){let G=c0(J,X.items[J],Z,z);if(typeof G==="number")J=G-1;else if(G===l)return l;else if(G===J0)X.items.splice(J,1),J-=1}}else if(h.isPair(X)){z=Object.freeze(z.concat(X));let J=c0("key",X.key,Z,z);if(J===l)return l;else if(J===J0)X.key=null;let G=c0("value",X.value,Z,z);if(G===l)return l;else if(G===J0)X.value=null}}return q}async function _1($,X){let Z=MX(X);if(h.isDocument($)){if(await i0(null,$.contents,Z,Object.freeze([$]))===J0)$.contents=null}else await i0(null,$,Z,Object.freeze([]))}_1.BREAK=l;_1.SKIP=FX;_1.REMOVE=J0;async function i0($,X,Z,z){let q=await OX($,X,Z,z);if(h.isNode(q)||h.isPair(q))return wX($,z,q),i0($,q,Z,z);if(typeof q!=="symbol"){if(h.isCollection(X)){z=Object.freeze(z.concat(X));for(let J=0;J<X.items.length;++J){let G=await i0(J,X.items[J],Z,z);if(typeof G==="number")J=G-1;else if(G===l)return l;else if(G===J0)X.items.splice(J,1),J-=1}}else if(h.isPair(X)){z=Object.freeze(z.concat(X));let J=await i0("key",X.key,Z,z);if(J===l)return l;else if(J===J0)X.key=null;let G=await i0("value",X.value,Z,z);if(G===l)return l;else if(G===J0)X.value=null}}return q}function MX($){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,z){if(typeof Z==="function")return Z($,X,z);if(h.isMap(X))return Z.Map?.($,X,z);if(h.isSeq(X))return Z.Seq?.($,X,z);if(h.isPair(X))return Z.Pair?.($,X,z);if(h.isScalar(X))return Z.Scalar?.($,X,z);if(h.isAlias(X))return Z.Alias?.($,X,z);return}function wX($,X,Z){let z=X[X.length-1];if(h.isCollection(z))z.items[$]=Z;else if(h.isPair(z))if($==="key")z.key=Z;else z.value=Z;else if(h.isDocument(z))z.contents=Z;else{let q=h.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${q} parent`)}}Xz.visit=D1;Xz.visitAsync=_1});var Z9=D((Qz)=>{var IX=S(),qz=M$(),Jz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Gz=($)=>$.replace(/[!,[\]{}]/g,(X)=>Jz[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]+/),z=Z.shift();switch(z){case"%TAG":{if(Z.length!==2){if(X(0,"%TAG directive should contain exactly two parts"),Z.length<2)return!1}let[q,J]=Z;return this.tags[q]=J,!0}case"%YAML":{if(this.yaml.explicit=!0,Z.length!==1)return X(0,"%YAML directive should contain exactly one part"),!1;let[q]=Z;if(q==="1.1"||q==="1.2")return this.yaml.version=q,!0;else{let J=/^\d+\.\d+$/.test(q);return X(6,`Unsupported YAML version ${q}`,J),!1}}default:return X(0,`Unknown directive ${z}`,!0),!1}}tagName($,X){if($==="!")return"!";if($[0]!=="!")return X(`Not a valid tag: ${$}`),null;if($[1]==="<"){let J=$.slice(2,-1);if(J==="!"||J==="!!")return X(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")X("Verbatim tags must end with a >");return J}let[,Z,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)X(`The ${$} tag has no suffix`);let q=this.tags[Z];if(q)try{return q+decodeURIComponent(z)}catch(J){return X(String(J)),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+Gz($.substring(Z.length));return $[0]==="!"?$:`!<${$}>`}toString($){let X=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],Z=Object.entries(this.tags),z;if($&&Z.length>0&&IX.isNode($.contents)){let q={};qz.visit($.contents,(J,G)=>{if(IX.isNode(G)&&G.tag)q[G.tag]=!0}),z=Object.keys(q)}else z=[];for(let[q,J]of Z){if(q==="!!"&&J==="tag:yaml.org,2002:")continue;if(!$||z.some((G)=>G.startsWith(J)))X.push(`%TAG ${q} ${J}`)}return X.join(`
29
+ `)}}s.defaultYaml={explicit:!1,version:"1.2"};s.defaultTags={"!!":"tag:yaml.org,2002:"};Qz.Directives=s});var F1=D((Vz)=>{var RX=S(),Uz=M$();function Hz($){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 Uz.visit($,{Value(Z,z){if(z.anchor)X.add(z.anchor)}}),X}function NX($,X){for(let Z=1;;++Z){let z=`${$}${Z}`;if(!X.has(z))return z}}function Wz($,X){let Z=[],z=new Map,q=null;return{onAnchor:(J)=>{Z.push(J),q??(q=PX($));let G=NX(X,q);return q.add(G),G},setAnchors:()=>{for(let J of Z){let G=z.get(J);if(typeof G==="object"&&G.anchor&&(RX.isScalar(G.node)||RX.isCollection(G.node)))G.node.anchor=G.anchor;else{let Q=Error("Failed to resolve repeated object (this should not happen)");throw Q.source=J,Q}}},sourceObjects:z}}Vz.anchorIsValid=Hz;Vz.anchorNames=PX;Vz.createNodeAnchors=Wz;Vz.findNewAnchor=NX});var z9=D((Dz)=>{function O$($,X,Z,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let q=0,J=z.length;q<J;++q){let G=z[q],Q=O$($,z,String(q),G);if(Q===void 0)delete z[q];else if(Q!==G)z[q]=Q}else if(z instanceof Map)for(let q of Array.from(z.keys())){let J=z.get(q),G=O$($,z,q,J);if(G===void 0)z.delete(q);else if(G!==J)z.set(q,G)}else if(z instanceof Set)for(let q of Array.from(z)){let J=O$($,z,q,q);if(J===void 0)z.delete(q);else if(J!==q)z.delete(q),z.add(J)}else for(let[q,J]of Object.entries(z)){let G=O$($,z,q,J);if(G===void 0)delete z[q];else if(G!==J)z[q]=G}return $.call(X,Z,z)}Dz.applyReviver=O$});var K0=D((Mz)=>{var Fz=S();function AX($,X,Z){if(Array.isArray($))return $.map((z,q)=>AX(z,String(q),Z));if($&&typeof $.toJSON==="function"){if(!Z||!Fz.hasAnchor($))return $.toJSON(X,Z);let z={aliasCount:0,count:1,res:void 0};Z.anchors.set($,z),Z.onCreate=(J)=>{z.res=J,delete Z.onCreate};let q=$.toJSON(X,Z);if(Z.onCreate)Z.onCreate(q);return q}if(typeof $==="bigint"&&!Z?.keep)return Number($);return $}Mz.toJS=AX});var M1=D((Rz)=>{var wz=z9(),jX=S(),Iz=K0();class SX{constructor($){Object.defineProperty(this,jX.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:z,reviver:q}={}){if(!jX.isDocument($))throw TypeError("A document argument is required");let J={anchors:new Map,doc:$,keep:!0,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},G=Iz.toJS(this,"",J);if(typeof z==="function")for(let{count:Q,res:Y}of J.anchors.values())z(Y,Q);return typeof q==="function"?wz.applyReviver(q,{"":G},"",G):G}}Rz.NodeBase=SX});var w$=D((Cz)=>{var Nz=F1(),Az=M$(),a0=S(),jz=M1(),Sz=K0();class CX extends jz.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=[],Az.visit($,{Node:(q,J)=>{if(a0.isAlias(J)||a0.hasAnchor(J))Z.push(J)}}),X)X.aliasResolveCache=Z;let z=void 0;for(let q of Z){if(q===this)break;if(q.anchor===this.source)z=q}return z}toJSON($,X){if(!X)return{source:this.source};let{anchors:Z,doc:z,maxAliasCount:q}=X,J=this.resolve(z,X);if(!J){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Q)}let G=Z.get(J);if(!G)Sz.toJS(J,null,X),G=Z.get(J);if(G?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(q>=0){if(G.count+=1,G.aliasCount===0)G.aliasCount=O1(z,J,Z);if(G.count*G.aliasCount>q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return G.res}toString($,X,Z){let z=`*${this.source}`;if($){if(Nz.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(q)}if($.implicitKey)return`${z} `}return z}}function O1($,X,Z){if(a0.isAlias(X)){let z=X.resolve($),q=Z&&z&&Z.get(z);return q?q.count*q.aliasCount:0}else if(a0.isCollection(X)){let z=0;for(let q of X.items){let J=O1($,q,Z);if(J>z)z=J}return z}else if(a0.isPair(X)){let z=O1($,X.key,Z),q=O1($,X.value,Z);return Math.max(z,q)}return 1}Cz.Alias=CX});var g=D((fz)=>{var bz=S(),xz=M1(),yz=K0(),kz=($)=>!$||typeof $!=="function"&&typeof $!=="object";class j0 extends xz.NodeBase{constructor($){super(bz.SCALAR);this.value=$}toJSON($,X){return X?.keep?this.value:yz.toJS(this.value,$,X)}toString(){return String(this.value)}}j0.BLOCK_FOLDED="BLOCK_FOLDED";j0.BLOCK_LITERAL="BLOCK_LITERAL";j0.PLAIN="PLAIN";j0.QUOTE_DOUBLE="QUOTE_DOUBLE";j0.QUOTE_SINGLE="QUOTE_SINGLE";fz.Scalar=j0;fz.isScalarValue=kz});var I$=D((pz)=>{var vz=w$(),S0=S(),EX=g(),uz="tag:yaml.org,2002:";function mz($,X,Z){if(X){let z=Z.filter((J)=>J.tag===X),q=z.find((J)=>!J.format)??z[0];if(!q)throw Error(`Tag ${X} not found`);return q}return Z.find((z)=>z.identify?.($)&&!z.format)}function dz($,X,Z){if(S0.isDocument($))$=$.contents;if(S0.isNode($))return $;if(S0.isPair($)){let H=Z.schema[S0.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:z,onAnchor:q,onTagObj:J,schema:G,sourceObjects:Q}=Z,Y=void 0;if(z&&$&&typeof $==="object")if(Y=Q.get($),Y)return Y.anchor??(Y.anchor=q($)),new vz.Alias(Y.anchor);else Y={anchor:null,node:null},Q.set($,Y);if(X?.startsWith("!!"))X=uz+X.slice(2);let U=mz($,X,G.tags);if(!U){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let H=new EX.Scalar($);if(Y)Y.node=H;return H}U=$ instanceof Map?G[S0.MAP]:(Symbol.iterator in Object($))?G[S0.SEQ]:G[S0.MAP]}if(J)J(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 EX.Scalar($);if(X)W.tag=X;else if(!U.default)W.tag=U.tag;if(Y)Y.node=W;return W}pz.createNode=dz});var w1=D((az)=>{var cz=I$(),G0=S(),iz=M1();function q9($,X,Z){let z=Z;for(let q=X.length-1;q>=0;--q){let J=X[q];if(typeof J==="number"&&Number.isInteger(J)&&J>=0){let G=[];G[J]=z,z=G}else z=new Map([[J,z]])}return cz.createNode(z,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 xX extends iz.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)=>G0.isNode(Z)||G0.isPair(Z)?Z.clone($):Z),this.range)X.range=this.range.slice();return X}addIn($,X){if(bX($))this.add(X);else{let[Z,...z]=$,q=this.get(Z,!0);if(G0.isCollection(q))q.addIn(z,X);else if(q===void 0&&this.schema)this.set(Z,q9(this.schema,z,X));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${z}`)}}deleteIn($){let[X,...Z]=$;if(Z.length===0)return this.delete(X);let z=this.get(X,!0);if(G0.isCollection(z))return z.deleteIn(Z);else throw Error(`Expected YAML collection at ${X}. Remaining path: ${Z}`)}getIn($,X){let[Z,...z]=$,q=this.get(Z,!0);if(z.length===0)return!X&&G0.isScalar(q)?q.value:q;else return G0.isCollection(q)?q.getIn(z,X):void 0}hasAllNullValues($){return this.items.every((X)=>{if(!G0.isPair(X))return!1;let Z=X.value;return Z==null||$&&G0.isScalar(Z)&&Z.value==null&&!Z.commentBefore&&!Z.comment&&!Z.tag})}hasIn($){let[X,...Z]=$;if(Z.length===0)return this.has(X);let z=this.get(X,!0);return G0.isCollection(z)?z.hasIn(Z):!1}setIn($,X){let[Z,...z]=$;if(z.length===0)this.set(Z,X);else{let q=this.get(Z,!0);if(G0.isCollection(q))q.setIn(z,X);else if(q===void 0&&this.schema)this.set(Z,q9(this.schema,z,X));else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${z}`)}}}az.Collection=xX;az.collectionFromPath=q9;az.isEmptyPath=bX});var R$=D((ez)=>{var oz=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function J9($,X){if(/^\n+$/.test($))return $.substring(1);return X?$.replace(/^(?! *$)/gm,X):$}var tz=($,X,Z)=>$.endsWith(`
30
+ `)?J9(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
+ `+J9(Z,X):($.endsWith(" ")?"":" ")+Z;ez.indentComment=J9;ez.lineComment=tz;ez.stringifyComment=oz});var kX=D((q3)=>{function z3($,X,Z="flow",{indentAtStart:z,lineWidth:q=80,minContentWidth:J=20,onFold:G,onOverflow:Q}={}){if(!q||q<0)return $;if(q<J)J=0;let Y=Math.max(1+J,1+q-X.length);if($.length<=Y)return $;let U=[],W={},H=q-X.length;if(typeof z==="number")if(z>q-Math.max(2,J))U.push(0);else H=q-z;let V=void 0,B=void 0,L=!1,T=-1,K=-1,_=-1;if(Z==="block"){if(T=yX($,T,X.length),T!==-1)H=T+Y}for(let O;O=$[T+=1];){if(Z==="quoted"&&O==="\\"){switch(K=T,$[T+1]){case"x":T+=3;break;case"u":T+=5;break;case"U":T+=9;break;default:T+=1}_=T}if(O===`
33
+ `){if(Z==="block")T=yX($,T,X.length);H=T+X.length+Y,V=void 0}else{if(O===" "&&B&&B!==" "&&B!==`
34
+ `&&B!=="\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(B===" "||B==="\t")B=O,O=$[T+=1],L=!0;let I=T>_+1?T-2:K-1;if(W[I])return $;U.push(I),W[I]=!0,H=I+Y,V=void 0}else L=!0}B=O}if(L&&Q)Q();if(U.length===0)return $;if(G)G();let F=$.slice(0,U[0]);for(let O=0;O<U.length;++O){let I=U[O],R=U[O+1]||$.length;if(I===0)F=`
36
+ ${X}${$.slice(0,R)}`;else{if(Z==="quoted"&&W[I])F+=`${$[I]}\\`;F+=`
37
+ ${X}${$.slice(I+1,R)}`}}return F}function yX($,X,Z){let z=X,q=X+1,J=$[q];while(J===" "||J==="\t")if(X<q+Z)J=$[++X];else{do J=$[++X];while(J&&J!==`
38
+ `);z=X,q=X+1,J=$[q]}return z}q3.FOLD_BLOCK="block";q3.FOLD_FLOW="flow";q3.FOLD_QUOTED="quoted";q3.foldFlowLines=z3});var N$=D((V3)=>{var $0=g(),L0=kX(),R1=($,X)=>({indentAtStart:X?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),P1=($)=>/^(%|---|\.\.\.)/m.test($);function U3($,X,Z){if(!X||X<0)return!1;let z=X-Z,q=$.length;if(q<=z)return!1;for(let J=0,G=0;J<q;++J)if($[J]===`
39
+ `){if(J-G>z)return!0;if(G=J+1,q-G<=z)return!1}return!0}function P$($,X){let Z=JSON.stringify($);if(X.options.doubleQuotedAsJSON)return Z;let{implicitKey:z}=X,q=X.options.doubleQuotedMinMultiLineLength,J=X.indent||(P1($)?" ":""),G="",Q=0;for(let Y=0,U=Z[Y];U;U=Z[++Y]){if(U===" "&&Z[Y+1]==="\\"&&Z[Y+2]==="n")G+=Z.slice(Q,Y)+"\\ ",Y+=1,Q=Y,U="\\";if(U==="\\")switch(Z[Y+1]){case"u":{G+=Z.slice(Q,Y);let W=Z.substr(Y+2,4);switch(W){case"0000":G+="\\0";break;case"0007":G+="\\a";break;case"000b":G+="\\v";break;case"001b":G+="\\e";break;case"0085":G+="\\N";break;case"00a0":G+="\\_";break;case"2028":G+="\\L";break;case"2029":G+="\\P";break;default:if(W.substr(0,2)==="00")G+="\\x"+W.substr(2);else G+=Z.substr(Y,6)}Y+=5,Q=Y+1}break;case"n":if(z||Z[Y+2]==='"'||Z.length<q)Y+=1;else{G+=Z.slice(Q,Y)+`
40
+
41
+ `;while(Z[Y+2]==="\\"&&Z[Y+3]==="n"&&Z[Y+4]!=='"')G+=`
42
+ `,Y+=2;if(G+=J,Z[Y+2]===" ")G+="\\";Y+=1,Q=Y+1}break;default:Y+=1}}return G=Q?G+Z.slice(Q):Z,z?G:L0.foldFlowLines(G,J,L0.FOLD_QUOTED,R1(X,!1))}function G9($,X){if(X.options.singleQuote===!1||X.implicitKey&&$.includes(`
43
+ `)||/[ \t]\n|\n[ \t]/.test($))return P$($,X);let Z=X.indent||(P1($)?" ":""),z="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
44
+ ${Z}`)+"'";return X.implicitKey?z:L0.foldFlowLines(z,Z,L0.FOLD_FLOW,R1(X,!1))}function s0($,X){let{singleQuote:Z}=X.options,z;if(Z===!1)z=P$;else{let q=$.includes('"'),J=$.includes("'");if(q&&!J)z=G9;else if(J&&!q)z=P$;else z=Z?G9:P$}return z($,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},z,q,J){let{blockQuote:G,commentString:Q,lineWidth:Y}=z.options;if(!G||/\n[\t ]+$/.test(Z))return s0(Z,z);let U=z.indent||(z.forceBlockIndent||P1(Z)?" ":""),W=G==="literal"?!0:G==="folded"||X===$0.Scalar.BLOCK_FOLDED?!1:X===$0.Scalar.BLOCK_LITERAL?!0:!U3(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 B=Z.substring(V),L=B.indexOf(`
51
+ `);if(L===-1)H="-";else if(Z===B||L!==B.length-1){if(H="+",J)J()}else H="";if(B){if(Z=Z.slice(0,-B.length),B[B.length-1]===`
52
+ `)B=B.slice(0,-1);B=B.replace(Q9,`$&${U}`)}let T=!1,K,_=-1;for(K=0;K<Z.length;++K){let R=Z[K];if(R===" ")T=!0;else if(R===`
53
+ `)_=K;else break}let F=Z.substring(0,_<K?_+1:K);if(F)Z=Z.substring(F.length),F=F.replace(/\n+/g,`$&${U}`);let I=(T?U?"2":"1":"")+H;if($){if(I+=" "+Q($.replace(/ ?[\r\n]+/g," ")),q)q()}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,E=R1(z,!0);if(G!=="folded"&&X!==$0.Scalar.BLOCK_FOLDED)E.onOverflow=()=>{N=!0};let M=L0.foldFlowLines(`${F}${R}${B}`,U,L0.FOLD_BLOCK,E);if(!N)return`>${I}
55
+ ${U}${M}`}return Z=Z.replace(/\n+/g,`$&${U}`),`|${I}
56
+ ${U}${F}${Z}${B}`}function H3($,X,Z,z){let{type:q,value:J}=$,{actualString:G,implicitKey:Q,indent:Y,indentStep:U,inFlow:W}=X;if(Q&&J.includes(`
57
+ `)||W&&/[[\]{},]/.test(J))return s0(J,X);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(J))return Q||W||!J.includes(`
58
+ `)?s0(J,X):I1($,X,Z,z);if(!Q&&!W&&q!==$0.Scalar.PLAIN&&J.includes(`
59
+ `))return I1($,X,Z,z);if(P1(J)){if(Y==="")return X.forceBlockIndent=!0,I1($,X,Z,z);else if(Q&&Y===U)return s0(J,X)}let H=J.replace(/\n+/g,`$&
60
+ ${Y}`);if(G){let V=(T)=>T.default&&T.tag!=="tag:yaml.org,2002:str"&&T.test?.test(H),{compat:B,tags:L}=X.doc.schema;if(L.some(V)||B?.some(V))return s0(J,X)}return Q?H:L0.foldFlowLines(H,Y,L0.FOLD_FLOW,R1(X,!1))}function W3($,X,Z,z){let{implicitKey:q,inFlow:J}=X,G=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(G.value))Q=$0.Scalar.QUOTE_DOUBLE}let Y=(W)=>{switch(W){case $0.Scalar.BLOCK_FOLDED:case $0.Scalar.BLOCK_LITERAL:return q||J?s0(G.value,X):I1(G,X,Z,z);case $0.Scalar.QUOTE_DOUBLE:return P$(G.value,X);case $0.Scalar.QUOTE_SINGLE:return G9(G.value,X);case $0.Scalar.PLAIN:return H3(G,X,Z,z);default:return null}},U=Y(Q);if(U===null){let{defaultKeyType:W,defaultStringType:H}=X.options,V=q&&W||H;if(U=Y(V),U===null)throw Error(`Unsupported default string type ${V}`)}return U}V3.stringifyString=W3});var A$=D((O3)=>{var B3=F1(),D0=S(),K3=R$(),L3=N$();function D3($,X){let Z=Object.assign({blockQuote:!0,commentString:K3.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),z;switch(Z.collectionStyle){case"block":z=!1;break;case"flow":z=!0;break;default:z=null}return{anchors:new Set,doc:$,flowCollectionPadding:Z.flowCollectionPadding?" ":"",indent:"",indentStep:typeof Z.indent==="number"?" ".repeat(Z.indent):" ",inFlow:z,options:Z}}function _3($,X){if(X.tag){let q=$.filter((J)=>J.tag===X.tag);if(q.length>0)return q.find((J)=>J.format===X.format)??q[0]}let Z=void 0,z;if(D0.isScalar(X)){z=X.value;let q=$.filter((J)=>J.identify?.(z));if(q.length>1){let J=q.filter((G)=>G.test);if(J.length>0)q=J}Z=q.find((J)=>J.format===X.format)??q.find((J)=>!J.format)}else z=X,Z=$.find((q)=>q.nodeClass&&z instanceof q.nodeClass);if(!Z){let q=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${q} value`)}return Z}function F3($,X,{anchors:Z,doc:z}){if(!z.directives)return"";let q=[],J=(D0.isScalar($)||D0.isCollection($))&&$.anchor;if(J&&B3.anchorIsValid(J))Z.add(J),q.push(`&${J}`);let G=$.tag??(X.default?null:X.tag);if(G)q.push(z.directives.tagString(G));return q.join(" ")}function M3($,X,Z,z){if(D0.isPair($))return $.toString(X,Z,z);if(D0.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 q=void 0,J=D0.isNode($)?$:X.doc.createNode($,{onTagObj:(Y)=>q=Y});q??(q=_3(X.doc.schema.tags,J));let G=F3(J,q,X);if(G.length>0)X.indentAtStart=(X.indentAtStart??0)+G.length+1;let Q=typeof q.stringify==="function"?q.stringify(J,X,Z,z):D0.isScalar(J)?L3.stringifyString(J,X,Z,z):J.toString(X,Z,z);if(!G)return Q;return D0.isScalar(J)||Q[0]==="{"||Q[0]==="["?`${G} ${Q}`:`${G}
61
+ ${X.indent}${Q}`}O3.createStringifyContext=D3;O3.stringify=M3});var hX=D((P3)=>{var H0=S(),fX=g(),gX=A$(),j$=R$();function R3({key:$,value:X},Z,z,q){let{allNullValues:J,doc:G,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 B=!H&&(!$||V&&X==null&&!Z.inFlow||H0.isCollection($)||(H0.isScalar($)?$.type===fX.Scalar.BLOCK_FOLDED||$.type===fX.Scalar.BLOCK_LITERAL:typeof $==="object"));Z=Object.assign({},Z,{allNullValues:!1,implicitKey:!B&&(H||!J),indent:Q+Y});let L=!1,T=!1,K=gX.stringify($,Z,()=>L=!0,()=>T=!0);if(!B&&!Z.inFlow&&K.length>1024){if(H)throw Error("With simple keys, single line scalar must not span more than 1024 characters");B=!0}if(Z.inFlow){if(J||X==null){if(L&&z)z();return K===""?"?":B?`? ${K}`:K}}else if(J&&!H||X==null&&B){if(K=`? ${K}`,V&&!L)K+=j$.lineComment(K,Z.indent,U(V));else if(T&&q)q();return K}if(L)V=null;if(B){if(V)K+=j$.lineComment(K,Z.indent,U(V));K=`? ${K}
62
+ ${Q}:`}else if(K=`${K}:`,V)K+=j$.lineComment(K,Z.indent,U(V));let _,F,O;if(H0.isNode(X))_=!!X.spaceBefore,F=X.commentBefore,O=X.comment;else if(_=!1,F=null,O=null,X&&typeof X==="object")X=G.createNode(X);if(Z.implicitKey=!1,!B&&!V&&H0.isScalar(X))Z.indentAtStart=K.length+1;if(T=!1,!W&&Y.length>=2&&!Z.inFlow&&!B&&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||_||F){if(N=_?`
63
+ `:"",F){let E=U(F);N+=`
64
+ ${j$.indentComment(E,Z.indent)}`}if(R===""&&!Z.inFlow){if(N===`
65
+ `&&O)N=`
66
+
67
+ `}else N+=`
68
+ ${Z.indent}`}else if(!B&&H0.isCollection(X)){let E=R[0],M=R.indexOf(`
69
+ `),x=M!==-1,a=Z.inFlow??X.flow??X.items.length===0;if(x||!a){let z0=!1;if(x&&(E==="&"||E==="!")){let f=R.indexOf(" ");if(E==="&"&&f!==-1&&f<M&&R[f+1]==="!")f=R.indexOf(" ",f+1);if(f===-1||M<f)z0=!0}if(!z0)N=`
70
+ ${Z.indent}`}}else if(R===""||R[0]===`
71
+ `)N="";if(K+=N+R,Z.inFlow){if(I&&z)z()}else if(O&&!I)K+=j$.lineComment(K,Z.indent,U(O));else if(T&&q)q();return K}P3.stringifyPair=R3});var Y9=D((S3)=>{var vX=Q0("process");function A3($,...X){if($==="debug")console.log(...X)}function j3($,X){if($==="debug"||$==="warn")if(typeof vX.emitWarning==="function")vX.emitWarning(X);else console.warn(X)}S3.debug=A3;S3.warn=j3});var j1=D((x3)=>{var S$=S(),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},b3=($,X)=>(A1.identify(X)||S$.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=$&&S$.isAlias(Z)?Z.resolve($.doc):Z,S$.isSeq(Z))for(let z of Z.items)U9($,X,z);else if(Array.isArray(Z))for(let z of Z)U9($,X,z);else U9($,X,Z)}function U9($,X,Z){let z=$&&S$.isAlias(Z)?Z.resolve($.doc):Z;if(!S$.isMap(z))throw Error("Merge sources must be maps or map aliases");let q=z.toJSON(null,$,Map);for(let[J,G]of q)if(X instanceof Map){if(!X.has(J))X.set(J,G)}else if(X instanceof Set)X.add(J);else if(!Object.prototype.hasOwnProperty.call(X,J))Object.defineProperty(X,J,{value:G,writable:!0,enumerable:!0,configurable:!0});return X}x3.addMergeToJSMap=mX;x3.isMergeKey=b3;x3.merge=A1});var W9=D((m3)=>{var g3=Y9(),dX=j1(),h3=A$(),pX=S(),H9=K0();function v3($,X,{key:Z,value:z}){if(pX.isNode(Z)&&Z.addToJSMap)Z.addToJSMap($,X,z);else if(dX.isMergeKey($,Z))dX.addMergeToJSMap($,X,z);else{let q=H9.toJS(Z,"",$);if(X instanceof Map)X.set(q,H9.toJS(z,q,$));else if(X instanceof Set)X.add(q);else{let J=u3(Z,q,$),G=H9.toJS(z,J,$);if(J in X)Object.defineProperty(X,J,{value:G,writable:!0,enumerable:!0,configurable:!0});else X[J]=G}}return X}function u3($,X,Z){if(X===null)return"";if(typeof X!=="object")return String(X);if(pX.isNode($)&&Z?.doc){let z=h3.createStringifyContext(Z.doc,{});z.anchors=new Set;for(let J of Z.anchors.keys())z.anchors.add(J.anchor);z.inFlow=!0,z.inStringifyKey=!0;let q=$.toString(z);if(!Z.mapKeyWarned){let J=JSON.stringify(q);if(J.length>40)J=J.substring(0,36)+'..."';g3.warn(Z.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${J}. Set mapAsMap: true to use object keys.`),Z.mapKeyWarned=!0}return q}return JSON.stringify(X)}m3.addPairToJSMap=v3});var _0=D((i3)=>{var lX=I$(),p3=hX(),l3=W9(),S1=S();function c3($,X,Z){let z=lX.createNode($,void 0,Z),q=lX.createNode(X,void 0,Z);return new C1(z,q)}class C1{constructor($,X=null){Object.defineProperty(this,S1.NODE_TYPE,{value:S1.PAIR}),this.key=$,this.value=X}clone($){let{key:X,value:Z}=this;if(S1.isNode(X))X=X.clone($);if(S1.isNode(Z))Z=Z.clone($);return new C1(X,Z)}toJSON($,X){let Z=X?.mapAsMap?new Map:{};return l3.addPairToJSMap(X,Z,this)}toString($,X,Z){return $?.doc?p3.stringifyPair(this,$,X,Z):JSON.stringify(this)}}i3.Pair=C1;i3.createPair=c3});var V9=D((t3)=>{var C0=S(),cX=A$(),E1=R$();function n3($,X,Z){return(X.inFlow??$.flow?o3:r3)($,X,Z)}function r3({comment:$,items:X},Z,{blockItemPrefix:z,flowChars:q,itemIndent:J,onChompKeep:G,onComment:Q}){let{indent:Y,options:{commentString:U}}=Z,W=Object.assign({},Z,{indent:J,type:null}),H=!1,V=[];for(let L=0;L<X.length;++L){let T=X[L],K=null;if(C0.isNode(T)){if(!H&&T.spaceBefore)V.push("");if(b1(Z,V,T.commentBefore,H),T.comment)K=T.comment}else if(C0.isPair(T)){let F=C0.isNode(T.key)?T.key:null;if(F){if(!H&&F.spaceBefore)V.push("");b1(Z,V,F.commentBefore,H)}}H=!1;let _=cX.stringify(T,W,()=>K=null,()=>H=!0);if(K)_+=E1.lineComment(_,J,U(K));if(H&&K)H=!1;V.push(z+_)}let B;if(V.length===0)B=q.start+q.end;else{B=V[0];for(let L=1;L<V.length;++L){let T=V[L];B+=T?`
72
+ ${Y}${T}`:`
73
+ `}}if($){if(B+=`
74
+ `+E1.indentComment(U($),Y),Q)Q()}else if(H&&G)G();return B}function o3({items:$},X,{flowChars:Z,itemIndent:z}){let{indent:q,indentStep:J,flowCollectionPadding:G,options:{commentString:Q}}=X;z+=J;let Y=Object.assign({},X,{indent:z,inFlow:!0,type:null}),U=!1,W=0,H=[];for(let L=0;L<$.length;++L){let T=$[L],K=null;if(C0.isNode(T)){if(T.spaceBefore)H.push("");if(b1(X,H,T.commentBefore,!1),T.comment)K=T.comment}else if(C0.isPair(T)){let F=C0.isNode(T.key)?T.key:null;if(F){if(F.spaceBefore)H.push("");if(b1(X,H,F.commentBefore,!1),F.comment)U=!0}let O=C0.isNode(T.value)?T.value:null;if(O){if(O.comment)K=O.comment;if(O.commentBefore)U=!0}else if(T.value==null&&F?.comment)K=F.comment}if(K)U=!0;let _=cX.stringify(T,Y,()=>K=null);if(L<$.length-1)_+=",";if(K)_+=E1.lineComment(_,z,Q(K));if(!U&&(H.length>W||_.includes(`
75
+ `)))U=!0;H.push(_),W=H.length}let{start:V,end:B}=Z;if(H.length===0)return V+B;else{if(!U){let L=H.reduce((T,K)=>T+K.length+2,2);U=X.options.lineWidth>0&&L>X.options.lineWidth}if(U){let L=V;for(let T of H)L+=T?`
76
+ ${J}${q}${T}`:`
77
+ `;return`${L}
78
+ ${q}${B}`}else return`${V}${G}${H.join(" ")}${G}${B}`}}function b1({indent:$,options:{commentString:X}},Z,z,q){if(z&&q)z=z.replace(/^\n+/,"");if(z){let J=E1.indentComment(X(z),$);Z.push(J.trimStart())}}t3.stringifyCollection=n3});var M0=D((q7)=>{var $7=V9(),X7=W9(),Z7=w1(),F0=S(),x1=_0(),z7=g();function C$($,X){let Z=F0.isScalar(X)?X.value:X;for(let z of $)if(F0.isPair(z)){if(z.key===X||z.key===Z)return z;if(F0.isScalar(z.key)&&z.key.value===Z)return z}return}class iX extends Z7.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(F0.MAP,$);this.items=[]}static from($,X,Z){let{keepUndefined:z,replacer:q}=Z,J=new this($),G=(Q,Y)=>{if(typeof q==="function")Y=q.call(X,Q,Y);else if(Array.isArray(q)&&!q.includes(Q))return;if(Y!==void 0||z)J.items.push(x1.createPair(Q,Y,Z))};if(X instanceof Map)for(let[Q,Y]of X)G(Q,Y);else if(X&&typeof X==="object")for(let Q of Object.keys(X))G(Q,X[Q]);if(typeof $.sortMapEntries==="function")J.items.sort($.sortMapEntries);return J}add($,X){let Z;if(F0.isPair($))Z=$;else if(!$||typeof $!=="object"||!("key"in $))Z=new x1.Pair($,$?.value);else Z=new x1.Pair($.key,$.value);let z=C$(this.items,Z.key),q=this.schema?.sortMapEntries;if(z){if(!X)throw Error(`Key ${Z.key} already set`);if(F0.isScalar(z.value)&&z7.isScalarValue(Z.value))z.value.value=Z.value;else z.value=Z.value}else if(q){let J=this.items.findIndex((G)=>q(Z,G)<0);if(J===-1)this.items.push(Z);else this.items.splice(J,0,Z)}else this.items.push(Z)}delete($){let X=C$(this.items,$);if(!X)return!1;return this.items.splice(this.items.indexOf(X),1).length>0}get($,X){let z=C$(this.items,$)?.value;return(!X&&F0.isScalar(z)?z.value:z)??void 0}has($){return!!C$(this.items,$)}set($,X){this.add(new x1.Pair($,X),!0)}toJSON($,X,Z){let z=Z?new Z:X?.mapAsMap?new Map:{};if(X?.onCreate)X.onCreate(z);for(let q of this.items)X7.addPairToJSMap(X,z,q);return z}toString($,X,Z){if(!$)return JSON.stringify(this);for(let z of this.items)if(!F0.isPair(z))throw Error(`Map items must all be pairs; found ${JSON.stringify(z)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return $7.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:Z,onComment:X})}}q7.YAMLMap=iX;q7.findPair=C$});var n0=D((U7)=>{var Q7=S(),aX=M0(),Y7={collection:"map",default:!0,nodeClass:aX.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,X){if(!Q7.isMap($))X("Expected a mapping for this tag");return $},createNode:($,X,Z)=>aX.YAMLMap.from($,X,Z)};U7.map=Y7});var O0=D((L7)=>{var W7=I$(),V7=V9(),T7=w1(),k1=S(),B7=g(),K7=K0();class sX extends T7.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(k1.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let X=y1($);if(typeof X!=="number")return!1;return this.items.splice(X,1).length>0}get($,X){let Z=y1($);if(typeof Z!=="number")return;let z=this.items[Z];return!X&&k1.isScalar(z)?z.value:z}has($){let X=y1($);return typeof X==="number"&&X<this.items.length}set($,X){let Z=y1($);if(typeof Z!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[Z];if(k1.isScalar(z)&&B7.isScalarValue(X))z.value=X;else this.items[Z]=X}toJSON($,X){let Z=[];if(X?.onCreate)X.onCreate(Z);let z=0;for(let q of this.items)Z.push(K7.toJS(q,String(z++),X));return Z}toString($,X,Z){if(!$)return JSON.stringify(this);return V7.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:Z,onComment:X})}static from($,X,Z){let{replacer:z}=Z,q=new this($);if(X&&Symbol.iterator in Object(X)){let J=0;for(let G of X){if(typeof z==="function"){let Q=X instanceof Set?G:String(J++);G=z.call(X,Q,G)}q.items.push(W7.createNode(G,void 0,Z))}}return q}}function y1($){let X=k1.isScalar($)?$.value:$;if(X&&typeof X==="string")X=Number(X);return typeof X==="number"&&Number.isInteger(X)&&X>=0?X:null}L7.YAMLSeq=sX});var r0=D((M7)=>{var _7=S(),nX=O0(),F7={collection:"seq",default:!0,nodeClass:nX.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,X){if(!_7.isSeq($))X("Expected a sequence for this tag");return $},createNode:($,X,Z)=>nX.YAMLSeq.from($,X,Z)};M7.seq=F7});var E$=D((R7)=>{var w7=N$(),I7={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,X,Z,z){return X=Object.assign({actualString:!0},X),w7.stringifyString($,X,Z,z)}};R7.string=I7});var f1=D((N7)=>{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};N7.nullTag=oX});var T9=D((S7)=>{var j7=g(),tX={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new j7.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:X},Z){if($&&tX.test.test($)){let z=$[0]==="t"||$[0]==="T";if(X===z)return $}return X?Z.options.trueStr:Z.options.falseStr}};S7.boolTag=tX});var o0=D((b7)=>{function E7({format:$,minFractionDigits:X,tag:Z,value:z}){if(typeof z==="bigint")return String(z);let q=typeof z==="number"?z:Number(z);if(!isFinite(q))return isNaN(q)?".nan":q<0?"-.inf":".inf";let J=Object.is(z,-0)?"-0":JSON.stringify(z);if(!$&&X&&(!Z||Z==="tag:yaml.org,2002:float")&&/^\d/.test(J)){let G=J.indexOf(".");if(G<0)G=J.length,J+=".";let Q=X-(J.length-G-1);while(Q-- >0)J+="0"}return J}b7.stringifyNumber=E7});var K9=D((h7)=>{var y7=g(),B9=o0(),k7={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:B9.stringifyNumber},f7={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():B9.stringifyNumber($)}},g7={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let X=new y7.Scalar(parseFloat($)),Z=$.indexOf(".");if(Z!==-1&&$[$.length-1]==="0")X.minFractionDigits=$.length-Z-1;return X},stringify:B9.stringifyNumber};h7.float=g7;h7.floatExp=f7;h7.floatNaN=k7});var D9=D((c7)=>{var eX=o0(),g1=($)=>typeof $==="bigint"||Number.isInteger($),L9=($,X,Z,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(X),Z);function $5($,X,Z){let{value:z}=$;if(g1(z)&&z>=0)return Z+z.toString(X);return eX.stringifyNumber($)}var d7={identify:($)=>g1($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,X,Z)=>L9($,2,8,Z),stringify:($)=>$5($,8,"0o")},p7={identify:g1,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,X,Z)=>L9($,0,10,Z),stringify:eX.stringifyNumber},l7={identify:($)=>g1($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,X,Z)=>L9($,2,16,Z),stringify:($)=>$5($,16,"0x")};c7.int=p7;c7.intHex=l7;c7.intOct=d7});var X5=D((Xq)=>{var n7=n0(),r7=f1(),o7=r0(),t7=E$(),e7=T9(),_9=K9(),F9=D9(),$q=[n7.map,o7.seq,t7.string,r7.nullTag,e7.boolTag,F9.intOct,F9.int,F9.intHex,_9.floatNaN,_9.floatExp,_9.float];Xq.schema=$q});var z5=D((Uq)=>{var zq=g(),qq=n0(),Jq=r0();function Z5($){return typeof $==="bigint"||Number.isInteger($)}var h1=({value:$})=>JSON.stringify($),Gq=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:h1},{identify:($)=>$==null,createNode:()=>new zq.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}],Qq={default:!0,tag:"",test:/^/,resolve($,X){return X(`Unresolved plain scalar ${JSON.stringify($)}`),$}},Yq=[qq.map,Jq.seq].concat(Gq,Qq);Uq.schema=Yq});var O9=D((Tq)=>{var b$=Q0("buffer"),M9=g(),Wq=N$(),Vq={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,"")),z=new Uint8Array(Z.length);for(let q=0;q<Z.length;++q)z[q]=Z.charCodeAt(q);return z}else return X("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:X,value:Z},z,q,J){if(!Z)return"";let G=Z,Q;if(typeof b$.Buffer==="function")Q=G instanceof b$.Buffer?G.toString("base64"):b$.Buffer.from(G.buffer).toString("base64");else if(typeof btoa==="function"){let Y="";for(let U=0;U<G.length;++U)Y+=String.fromCharCode(G[U]);Q=btoa(Y)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(X??(X=M9.Scalar.BLOCK_LITERAL),X!==M9.Scalar.QUOTE_DOUBLE){let Y=Math.max(z.options.lineWidth-z.indent.length,z.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===M9.Scalar.BLOCK_LITERAL?`
79
+ `:" ")}return Wq.stringifyString({comment:$,type:X,value:Q},z,q,J)}};Tq.binary=Vq});var u1=D((_q)=>{var v1=S(),w9=_0(),Kq=g(),Lq=O0();function q5($,X){if(v1.isSeq($))for(let Z=0;Z<$.items.length;++Z){let z=$.items[Z];if(v1.isPair(z))continue;else if(v1.isMap(z)){if(z.items.length>1)X("Each pair must have its own sequence indicator");let q=z.items[0]||new w9.Pair(new Kq.Scalar(null));if(z.commentBefore)q.key.commentBefore=q.key.commentBefore?`${z.commentBefore}
80
+ ${q.key.commentBefore}`:z.commentBefore;if(z.comment){let J=q.value??q.key;J.comment=J.comment?`${z.comment}
81
+ ${J.comment}`:z.comment}z=q}$.items[Z]=v1.isPair(z)?z:new w9.Pair(z)}else X("Expected a sequence for this tag");return $}function J5($,X,Z){let{replacer:z}=Z,q=new Lq.YAMLSeq($);q.tag="tag:yaml.org,2002:pairs";let J=0;if(X&&Symbol.iterator in Object(X))for(let G of X){if(typeof z==="function")G=z.call(X,String(J++),G);let Q,Y;if(Array.isArray(G))if(G.length===2)Q=G[0],Y=G[1];else throw TypeError(`Expected [key, value] tuple: ${G}`);else if(G&&G instanceof Object){let U=Object.keys(G);if(U.length===1)Q=U[0],Y=G[Q];else throw TypeError(`Expected tuple with one key, not ${U.length} keys`)}else Q=G;q.items.push(w9.createPair(Q,Y,Z))}return q}var Dq={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:q5,createNode:J5};_q.createPairs=J5;_q.pairs=Dq;_q.resolvePairs=q5});var R9=D((Rq)=>{var G5=S(),I9=K0(),x$=M0(),wq=O0(),Q5=u1();class E0 extends wq.YAMLSeq{constructor(){super();this.add=x$.YAMLMap.prototype.add.bind(this),this.delete=x$.YAMLMap.prototype.delete.bind(this),this.get=x$.YAMLMap.prototype.get.bind(this),this.has=x$.YAMLMap.prototype.has.bind(this),this.set=x$.YAMLMap.prototype.set.bind(this),this.tag=E0.tag}toJSON($,X){if(!X)return super.toJSON($);let Z=new Map;if(X?.onCreate)X.onCreate(Z);for(let z of this.items){let q,J;if(G5.isPair(z))q=I9.toJS(z.key,"",X),J=I9.toJS(z.value,q,X);else q=I9.toJS(z,"",X);if(Z.has(q))throw Error("Ordered maps must not include duplicate keys");Z.set(q,J)}return Z}static from($,X,Z){let z=Q5.createPairs($,X,Z),q=new this;return q.items=z.items,q}}E0.tag="tag:yaml.org,2002:omap";var Iq={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:E0,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,X){let Z=Q5.resolvePairs($,X),z=[];for(let{key:q}of Z.items)if(G5.isScalar(q))if(z.includes(q.value))X(`Ordered maps must not include duplicate keys: ${q.value}`);else z.push(q.value);return Object.assign(new E0,Z)},createNode:($,X,Z)=>E0.from($,X,Z)};Rq.YAMLOMap=E0;Rq.omap=Iq});var V5=D((Aq)=>{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};Aq.falseTag=W5;Aq.trueTag=H5});var T5=D((yq)=>{var Cq=g(),P9=o0(),Eq={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},bq={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($)}},xq={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let X=new Cq.Scalar(parseFloat($.replace(/_/g,""))),Z=$.indexOf(".");if(Z!==-1){let z=$.substring(Z+1).replace(/_/g,"");if(z[z.length-1]==="0")X.minFractionDigits=z.length}return X},stringify:P9.stringifyNumber};yq.float=xq;yq.floatExp=bq;yq.floatNaN=Eq});var K5=D((dq)=>{var B5=o0(),y$=($)=>typeof $==="bigint"||Number.isInteger($);function m1($,X,Z,{intAsBigInt:z}){let q=$[0];if(q==="-"||q==="+")X+=1;if($=$.substring(X).replace(/_/g,""),z){switch(Z){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let G=BigInt($);return q==="-"?BigInt(-1)*G:G}let J=parseInt($,Z);return q==="-"?-1*J:J}function N9($,X,Z){let{value:z}=$;if(y$(z)){let q=z.toString(X);return z<0?"-"+Z+q.substr(1):Z+q}return B5.stringifyNumber($)}var hq={identify:y$,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")},vq={identify:y$,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")},uq={identify:y$,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,X,Z)=>m1($,0,10,Z),stringify:B5.stringifyNumber},mq={identify:y$,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")};dq.int=uq;dq.intBin=hq;dq.intHex=mq;dq.intOct=vq});var A9=D((sq)=>{var l1=S(),d1=_0(),p1=M0();class b0 extends p1.YAMLMap{constructor($){super($);this.tag=b0.tag}add($){let X;if(l1.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&&l1.isPair(Z)?l1.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:z}=Z,q=new this($);if(X&&Symbol.iterator in Object(X))for(let J of X){if(typeof z==="function")J=z.call(X,J,J);q.items.push(d1.createPair(J,null,Z))}return q}}b0.tag="tag:yaml.org,2002:set";var aq={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(l1.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 $}};sq.YAMLSet=b0;sq.set=aq});var S9=D(($J)=>{var oq=o0();function j9($,X){let Z=$[0],z=Z==="-"||Z==="+"?$.substring(1):$,q=(G)=>X?BigInt(G):Number(G),J=z.replace(/_/g,"").split(":").reduce((G,Q)=>G*q(60)+q(Q),q(0));return Z==="-"?q(-1)*J:J}function L5($){let{value:X}=$,Z=(G)=>G;if(typeof X==="bigint")Z=(G)=>BigInt(G);else if(isNaN(X)||!isFinite(X))return oq.stringifyNumber($);let z="";if(X<0)z="-",X*=Z(-1);let q=Z(60),J=[X%q];if(X<60)J.unshift(0);else if(X=(X-J[0])/q,J.unshift(X%q),X>=60)X=(X-J[0])/q,J.unshift(X);return z+J.map((G)=>String(G).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var tq={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})=>j9($,Z),stringify:L5},eq={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:($)=>j9($,!1),stringify:L5},D5={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(D5.test);if(!X)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,Z,z,q,J,G,Q]=X.map(Number),Y=X[7]?Number((X[7]+"00").substr(1,3)):0,U=Date.UTC(Z,z-1,q,J||0,G||0,Q||0,Y),W=X[8];if(W&&W!=="Z"){let H=j9(W,!1);if(Math.abs(H)<30)H*=60;U-=60000*H}return new Date(U)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};$J.floatTime=eq;$J.intTime=tq;$J.timestamp=D5});var F5=D((BJ)=>{var qJ=n0(),JJ=f1(),GJ=r0(),QJ=E$(),YJ=O9(),_5=V5(),C9=T5(),c1=K5(),UJ=j1(),HJ=R9(),WJ=u1(),VJ=A9(),E9=S9(),TJ=[qJ.map,GJ.seq,QJ.string,JJ.nullTag,_5.trueTag,_5.falseTag,c1.intBin,c1.intOct,c1.int,c1.intHex,C9.floatNaN,C9.floatExp,C9.float,YJ.binary,UJ.merge,HJ.omap,WJ.pairs,VJ.set,E9.intTime,E9.floatTime,E9.timestamp];BJ.schema=TJ});var S5=D((IJ)=>{var I5=n0(),LJ=f1(),R5=r0(),DJ=E$(),_J=T9(),b9=K9(),x9=D9(),FJ=X5(),MJ=z5(),P5=O9(),k$=j1(),N5=R9(),A5=u1(),M5=F5(),j5=A9(),i1=S9(),O5=new Map([["core",FJ.schema],["failsafe",[I5.map,R5.seq,DJ.string]],["json",MJ.schema],["yaml11",M5.schema],["yaml-1.1",M5.schema]]),w5={binary:P5.binary,bool:_J.boolTag,float:b9.float,floatExp:b9.floatExp,floatNaN:b9.floatNaN,floatTime:i1.floatTime,int:x9.int,intHex:x9.intHex,intOct:x9.intOct,intTime:i1.intTime,map:I5.map,merge:k$.merge,null:LJ.nullTag,omap:N5.omap,pairs:A5.pairs,seq:R5.seq,set:j5.set,timestamp:i1.timestamp},OJ={"tag:yaml.org,2002:binary":P5.binary,"tag:yaml.org,2002:merge":k$.merge,"tag:yaml.org,2002:omap":N5.omap,"tag:yaml.org,2002:pairs":A5.pairs,"tag:yaml.org,2002:set":j5.set,"tag:yaml.org,2002:timestamp":i1.timestamp};function wJ($,X,Z){let z=O5.get(X);if(z&&!$)return Z&&!z.includes(k$.merge)?z.concat(k$.merge):z.slice();let q=z;if(!q)if(Array.isArray($))q=[];else{let J=Array.from(O5.keys()).filter((G)=>G!=="yaml11").map((G)=>JSON.stringify(G)).join(", ");throw Error(`Unknown schema "${X}"; use one of ${J} or define customTags array`)}if(Array.isArray($))for(let J of $)q=q.concat(J);else if(typeof $==="function")q=$(q.slice());if(Z)q=q.concat(k$.merge);return q.reduce((J,G)=>{let Q=typeof G==="string"?w5[G]:G;if(!Q){let Y=JSON.stringify(G),U=Object.keys(w5).map((W)=>JSON.stringify(W)).join(", ");throw Error(`Unknown custom tag ${Y}; use one of ${U}`)}if(!J.includes(Q))J.push(Q);return J},[])}IJ.coreKnownTags=OJ;IJ.getTags=wJ});var f9=D((CJ)=>{var y9=S(),NJ=n0(),AJ=r0(),jJ=E$(),a1=S5(),SJ=($,X)=>$.key<X.key?-1:$.key>X.key?1:0;class k9{constructor({compat:$,customTags:X,merge:Z,resolveKnownTags:z,schema:q,sortMapEntries:J,toStringDefaults:G}){this.compat=Array.isArray($)?a1.getTags($,"compat"):$?a1.getTags(null,$):null,this.name=typeof q==="string"&&q||"core",this.knownTags=z?a1.coreKnownTags:{},this.tags=a1.getTags(X,this.name,Z),this.toStringOptions=G??null,Object.defineProperty(this,y9.MAP,{value:NJ.map}),Object.defineProperty(this,y9.SCALAR,{value:jJ.string}),Object.defineProperty(this,y9.SEQ,{value:AJ.seq}),this.sortMapEntries=typeof J==="function"?J:J===!0?SJ:null}clone(){let $=Object.create(k9.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}CJ.Schema=k9});var C5=D((yJ)=>{var bJ=S(),g9=A$(),f$=R$();function xJ($,X){let Z=[],z=X.directives===!0;if(X.directives!==!1&&$.directives){let Y=$.directives.toString($);if(Y)Z.push(Y),z=!0;else if($.directives.docStart)z=!0}if(z)Z.push("---");let q=g9.createStringifyContext($,X),{commentString:J}=q.options;if($.commentBefore){if(Z.length!==1)Z.unshift("");let Y=J($.commentBefore);Z.unshift(f$.indentComment(Y,""))}let G=!1,Q=null;if($.contents){if(bJ.isNode($.contents)){if($.contents.spaceBefore&&z)Z.push("");if($.contents.commentBefore){let W=J($.contents.commentBefore);Z.push(f$.indentComment(W,""))}q.forceBlockIndent=!!$.comment,Q=$.contents.comment}let Y=Q?void 0:()=>G=!0,U=g9.stringify($.contents,q,()=>Q=null,Y);if(Q)U+=f$.lineComment(U,"",J(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,q));if($.directives?.docEnd)if($.comment){let Y=J($.comment);if(Y.includes(`
82
+ `))Z.push("..."),Z.push(f$.indentComment(Y,""));else Z.push(`... ${Y}`)}else Z.push("...");else{let Y=$.comment;if(Y&&G)Y=Y.replace(/^\n+/,"");if(Y){if((!G||Q)&&Z[Z.length-1]!=="")Z.push("");Z.push(f$.indentComment(J(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
+ `}yJ.stringifyDocument=xJ});var g$=D((pJ)=>{var fJ=w$(),t0=w1(),n=S(),gJ=_0(),hJ=K0(),vJ=f9(),uJ=C5(),h9=F1(),mJ=z9(),dJ=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 z=null;if(typeof X==="function"||Array.isArray(X))z=X;else if(Z===void 0&&X)Z=X,X=void 0;let q=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},Z);this.options=q;let{version:J}=q;if(Z?._directives){if(this.directives=Z._directives.atDocument(),this.directives.yaml.explicit)J=this.directives.yaml.version}else this.directives=new v9.Directives({version:J});this.setSchema(J,Z),this.contents=$===void 0?null:this.createNode($,z,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 fJ.Alias($.anchor)}createNode($,X,Z){let z=void 0;if(typeof X==="function")$=X.call({"":$},"",$),z=X;else if(Array.isArray(X)){let T=(_)=>typeof _==="number"||_ instanceof String||_ instanceof Number,K=X.filter(T).map(String);if(K.length>0)X=X.concat(K);z=X}else if(Z===void 0&&X)Z=X,X=void 0;let{aliasDuplicateObjects:q,anchorPrefix:J,flow:G,keepUndefined:Q,onTagObj:Y,tag:U}=Z??{},{onAnchor:W,setAnchors:H,sourceObjects:V}=h9.createNodeAnchors(this,J||"a"),B={aliasDuplicateObjects:q??!0,keepUndefined:Q??!1,onAnchor:W,onTagObj:Y,replacer:z,schema:this.schema,sourceObjects:V},L=dJ.createNode($,U,B);if(G&&n.isCollection(L))L.flow=!0;return H(),L}createPair($,X,Z={}){let z=this.createNode($,null,Z),q=this.createNode(X,null,Z);return new gJ.Pair(z,q)}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 z=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${z}`)}}if(X.schema instanceof Object)this.schema=X.schema;else if(Z)this.schema=new vJ.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:z,onAnchor:q,reviver:J}={}){let G={anchors:new Map,doc:this,keep:!$,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},Q=hJ.toJS(this.contents,X??"",G);if(typeof q==="function")for(let{count:Y,res:U}of G.anchors.values())q(U,Y);return typeof J==="function"?mJ.applyReviver(J,{"":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 uJ.stringifyDocument(this,$)}}function e0($){if(n.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}pJ.Document=u9});var h$=D((iJ)=>{class s1 extends Error{constructor($,X,Z,z){super();this.name=$,this.code=Z,this.message=z,this.pos=X}}class E5 extends s1{constructor($,X,Z){super("YAMLParseError",$,X,Z)}}class b5 extends s1{constructor($,X,Z){super("YAMLWarning",$,X,Z)}}var cJ=($,X)=>(Z)=>{if(Z.pos[0]===-1)return;Z.linePos=Z.pos.map((Q)=>X.linePos(Q));let{line:z,col:q}=Z.linePos[0];Z.message+=` at line ${z}, column ${q}`;let J=q-1,G=$.substring(X.lineStarts[z-1],X.lineStarts[z]).replace(/[\n\r]+$/,"");if(J>=60&&G.length>80){let Q=Math.min(J-39,G.length-79);G="\u2026"+G.substring(Q),J-=Q-1}if(G.length>80)G=G.substring(0,79)+"\u2026";if(z>1&&/^ *$/.test(G.substring(0,J))){let Q=$.substring(X.lineStarts[z-2],X.lineStarts[z-1]);if(Q.length>80)Q=Q.substring(0,79)+`\u2026
85
+ `;G=Q+G}if(/[^ ]/.test(G)){let Q=1,Y=Z.linePos[1];if(Y?.line===z&&Y.col>q)Q=Math.max(1,Math.min(Y.col-q,80-J));let U=" ".repeat(J)+"^".repeat(Q);Z.message+=`:
86
86
 
87
- ${Q}
87
+ ${G}
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
+ `}};iJ.YAMLError=s1;iJ.YAMLParseError=E5;iJ.YAMLWarning=b5;iJ.prettifyError=cJ});var v$=D((tJ)=>{function oJ($,{flow:X,indicator:Z,next:z,offset:q,onError:J,parentIndent:G,startOnNewline:Q}){let Y=!1,U=Q,W=Q,H="",V="",B=!1,L=!1,T=null,K=null,_=null,F=null,O=null,I=null,R=null;for(let M of $){if(L){if(M.type!=="space"&&M.type!=="newline"&&M.type!=="comma")J(M.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");L=!1}if(T){if(U&&M.type!=="comment"&&M.type!=="newline")J(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");T=null}switch(M.type){case"space":if(!X&&(Z!=="doc-start"||z?.type!=="flow-collection")&&M.source.includes("\t"))T=M;W=!0;break;case"comment":{if(!W)J(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let x=M.source.substring(1)||" ";if(!H)H=x;else H+=V+x;V="",U=!1;break}case"newline":if(U){if(H)H+=M.source;else if(!I||Z!=="seq-item-ind")Y=!0}else V+=M.source;if(U=!0,B=!0,K||_)F=M;W=!0;break;case"anchor":if(K)J(M,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(M.source.endsWith(":"))J(M.offset+M.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);K=M,R??(R=M.offset),U=!1,W=!1,L=!0;break;case"tag":{if(_)J(M,"MULTIPLE_TAGS","A node can have at most one tag");_=M,R??(R=M.offset),U=!1,W=!1,L=!0;break}case Z:if(K||_)J(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`);if(I)J(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${X??"collection"}`);I=M,U=Z==="seq-item-ind"||Z==="explicit-key-ind",W=!1;break;case"comma":if(X){if(O)J(M,"UNEXPECTED_TOKEN",`Unexpected , in ${X}`);O=M,U=!1,W=!1;break}default:J(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),U=!1,W=!1}}let N=$[$.length-1],E=N?N.offset+N.source.length:q;if(L&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))J(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(T&&(U&&T.indent<=G||z?.type==="block-map"||z?.type==="block-seq"))J(T,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:O,found:I,spaceBefore:Y,comment:H,hasNewline:B,anchor:K,tag:_,newlineAfterProp:F,end:E,start:R??E}}tJ.resolveProps=oJ});var n1=D(($G)=>{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}}$G.containsNewline=m9});var d9=D((qG)=>{var ZG=n1();function zG($,X,Z){if(X?.type==="flow-collection"){let z=X.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&ZG.containsNewline(X))Z(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}qG.flowIndentCheck=zG});var p9=D((QG)=>{var x5=S();function GG($,X,Z){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let q=typeof z==="function"?z:(J,G)=>J===G||x5.isScalar(J)&&x5.isScalar(G)&&J.value===G.value;return X.some((J)=>q(J.key,Z))}QG.mapIncludes=GG});var h5=D((TG)=>{var y5=_0(),UG=M0(),k5=v$(),HG=n1(),f5=d9(),WG=p9(),g5="All mapping items must start at the same column";function VG({composeNode:$,composeEmptyNode:X},Z,z,q,J){let Q=new(J?.nodeClass??UG.YAMLMap)(Z.schema);if(Z.atRoot)Z.atRoot=!1;let Y=z.offset,U=null;for(let W of z.items){let{start:H,key:V,sep:B,value:L}=W,T=k5.resolveProps(H,{indicator:"explicit-key-ind",next:V??B?.[0],offset:Y,onError:q,parentIndent:z.indent,startOnNewline:!0}),K=!T.found;if(K){if(V){if(V.type==="block-seq")q(Y,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in V&&V.indent!==z.indent)q(Y,"BAD_INDENT",g5)}if(!T.anchor&&!T.tag&&!B){if(U=T.end,T.comment)if(Q.comment)Q.comment+=`
91
+ `+T.comment;else Q.comment=T.comment;continue}if(T.newlineAfterProp||HG.containsNewline(V))q(V??H[H.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(T.found?.indent!==z.indent)q(Y,"BAD_INDENT",g5);Z.atKey=!0;let _=T.end,F=V?$(Z,V,T,q):X(Z,_,H,null,T,q);if(Z.schema.compat)f5.flowIndentCheck(z.indent,V,q);if(Z.atKey=!1,WG.mapIncludes(Z,Q.items,F))q(_,"DUPLICATE_KEY","Map keys must be unique");let O=k5.resolveProps(B??[],{indicator:"map-value-ind",next:L,offset:F.range[2],onError:q,parentIndent:z.indent,startOnNewline:!V||V.type==="block-scalar"});if(Y=O.end,O.found){if(K){if(L?.type==="block-map"&&!O.hasNewline)q(Y,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(Z.options.strict&&T.start<O.found.offset-1024)q(F.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let I=L?$(Z,L,O,q):X(Z,Y,B,null,O,q);if(Z.schema.compat)f5.flowIndentCheck(z.indent,L,q);Y=I.range[2];let R=new y5.Pair(F,I);if(Z.options.keepSourceTokens)R.srcToken=W;Q.items.push(R)}else{if(K)q(F.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(O.comment)if(F.comment)F.comment+=`
92
+ `+O.comment;else F.comment=O.comment;let I=new y5.Pair(F);if(Z.options.keepSourceTokens)I.srcToken=W;Q.items.push(I)}}if(U&&U<Y)q(U,"IMPOSSIBLE","Map comment with trailing content");return Q.range=[z.offset,Y,U??Y],Q}TG.resolveBlockMap=VG});var v5=D((FG)=>{var KG=O0(),LG=v$(),DG=d9();function _G({composeNode:$,composeEmptyNode:X},Z,z,q,J){let Q=new(J?.nodeClass??KG.YAMLSeq)(Z.schema);if(Z.atRoot)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let Y=z.offset,U=null;for(let{start:W,value:H}of z.items){let V=LG.resolveProps(W,{indicator:"seq-item-ind",next:H,offset:Y,onError:q,parentIndent:z.indent,startOnNewline:!0});if(!V.found)if(V.anchor||V.tag||H)if(H?.type==="block-seq")q(V.end,"BAD_INDENT","All sequence items must start at the same column");else q(Y,"MISSING_CHAR","Sequence item without - indicator");else{if(U=V.end,V.comment)Q.comment=V.comment;continue}let B=H?$(Z,H,V,q):X(Z,V.end,W,null,V,q);if(Z.schema.compat)DG.flowIndentCheck(z.indent,H,q);Y=B.range[2],Q.items.push(B)}return Q.range=[z.offset,Y,U??Y],Q}FG.resolveBlockSeq=_G});var $$=D((wG)=>{function OG($,X,Z,z){let q="";if($){let J=!1,G="";for(let Q of $){let{source:Y,type:U}=Q;switch(U){case"space":J=!0;break;case"comment":{if(Z&&!J)z(Q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let W=Y.substring(1)||" ";if(!q)q=W;else q+=G+W;G="";break}case"newline":if(q)G+=Y;J=!0;break;default:z(Q,"UNEXPECTED_TOKEN",`Unexpected ${U} at node end`)}X+=Y.length}}return{comment:q,offset:X}}wG.resolveEnd=OG});var d5=D((EG)=>{var RG=S(),PG=_0(),u5=M0(),NG=O0(),AG=$$(),m5=v$(),jG=n1(),SG=p9(),l9="Block collections are not allowed within flow collections",c9=($)=>$&&($.type==="block-map"||$.type==="block-seq");function CG({composeNode:$,composeEmptyNode:X},Z,z,q,J){let G=z.start.source==="{",Q=G?"flow map":"flow sequence",U=new(J?.nodeClass??(G?u5.YAMLMap:NG.YAMLSeq))(Z.schema);U.flow=!0;let W=Z.atRoot;if(W)Z.atRoot=!1;if(Z.atKey)Z.atKey=!1;let H=z.offset+z.start.source.length;for(let K=0;K<z.items.length;++K){let _=z.items[K],{start:F,key:O,sep:I,value:R}=_,N=m5.resolveProps(F,{flow:Q,indicator:"explicit-key-ind",next:O??I?.[0],offset:H,onError:q,parentIndent:z.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!I&&!R){if(K===0&&N.comma)q(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Q}`);else if(K<z.items.length-1)q(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(!G&&Z.options.strict&&jG.containsNewline(O))q(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(K===0){if(N.comma)q(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Q}`)}else{if(!N.comma)q(N.start,"MISSING_CHAR",`Missing , between ${Q} items`);if(N.comment){let E="";$:for(let M of F)switch(M.type){case"comma":case"space":break;case"comment":E=M.source.substring(1);break $;default:break $}if(E){let M=U.items[U.items.length-1];if(RG.isPair(M))M=M.value??M.key;if(M.comment)M.comment+=`
94
+ `+E;else M.comment=E;N.comment=N.comment.substring(E.length+1)}}}if(!G&&!I&&!N.found){let E=R?$(Z,R,N,q):X(Z,N.end,I,null,N,q);if(U.items.push(E),H=E.range[2],c9(R))q(E.range,"BLOCK_IN_FLOW",l9)}else{Z.atKey=!0;let E=N.end,M=O?$(Z,O,N,q):X(Z,E,F,null,N,q);if(c9(O))q(M.range,"BLOCK_IN_FLOW",l9);Z.atKey=!1;let x=m5.resolveProps(I??[],{flow:Q,indicator:"map-value-ind",next:R,offset:M.range[2],onError:q,parentIndent:z.indent,startOnNewline:!1});if(x.found){if(!G&&!N.found&&Z.options.strict){if(I)for(let f of I){if(f===x.found)break;if(f.type==="newline"){q(f,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(N.start<x.found.offset-1024)q(x.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]===":")q(R,"MISSING_CHAR",`Missing space after : in ${Q}`);else q(x.start,"MISSING_CHAR",`Missing , or : between ${Q} items`);let a=R?$(Z,R,x,q):x.found?X(Z,x.end,I,null,x,q):null;if(a){if(c9(R))q(a.range,"BLOCK_IN_FLOW",l9)}else if(x.comment)if(M.comment)M.comment+=`
95
+ `+x.comment;else M.comment=x.comment;let z0=new PG.Pair(M,a);if(Z.options.keepSourceTokens)z0.srcToken=_;if(G){let f=U;if(SG.mapIncludes(Z,f.items,M))q(E,"DUPLICATE_KEY","Map keys must be unique");f.items.push(z0)}else{let f=new u5.YAMLMap(Z.schema);f.flow=!0,f.items.push(z0);let V1=(a??M).range;f.range=[M.range[0],V1[1],V1[2]],U.items.push(f)}H=a?a.range[2]:x.end}}let V=G?"}":"]",[B,...L]=z.end,T=H;if(B?.source===V)T=B.offset+B.source.length;else{let K=Q[0].toUpperCase()+Q.substring(1),_=W?`${K} must end with a ${V}`:`${K} in block collection must be sufficiently indented and end with a ${V}`;if(q(H,W?"MISSING_CHAR":"BAD_INDENT",_),B&&B.source.length!==1)L.unshift(B)}if(L.length>0){let K=AG.resolveEnd(L,T,Z.options.strict,q);if(K.comment)if(U.comment)U.comment+=`
96
+ `+K.comment;else U.comment=K.comment;U.range=[z.offset,T,K.offset]}else U.range=[z.offset,T,T];return U}EG.resolveFlowCollection=CG});var p5=D((mG)=>{var xG=S(),yG=g(),kG=M0(),fG=O0(),gG=h5(),hG=v5(),vG=d5();function i9($,X,Z,z,q,J){let G=Z.type==="block-map"?gG.resolveBlockMap($,X,Z,z,J):Z.type==="block-seq"?hG.resolveBlockSeq($,X,Z,z,J):vG.resolveFlowCollection($,X,Z,z,J),Q=G.constructor;if(q==="!"||q===Q.tagName)return G.tag=Q.tagName,G;if(q)G.tag=q;return G}function uG($,X,Z,z,q){let J=z.tag,G=!J?null:X.directives.tagName(J.source,(V)=>q(J,"TAG_RESOLVE_FAILED",V));if(Z.type==="block-seq"){let{anchor:V,newlineAfterProp:B}=z,L=V&&J?V.offset>J.offset?V:J:V??J;if(L&&(!B||B.offset<L.offset))q(L,"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(!J||!G||G==="!"||G===kG.YAMLMap.tagName&&Q==="map"||G===fG.YAMLSeq.tagName&&Q==="seq")return i9($,X,Z,q,G);let Y=X.schema.tags.find((V)=>V.tag===G&&V.collection===Q);if(!Y){let V=X.schema.knownTags[G];if(V?.collection===Q)X.schema.tags.push(Object.assign({},V,{default:!1})),Y=V;else{if(V)q(J,"BAD_COLLECTION_TYPE",`${V.tag} used for ${Q} collection, but expects ${V.collection??"scalar"}`,!0);else q(J,"TAG_RESOLVE_FAILED",`Unresolved tag: ${G}`,!0);return i9($,X,Z,q,G)}}let U=i9($,X,Z,q,G,Y),W=Y.resolve?.(U,(V)=>q(J,"TAG_RESOLVE_FAILED",V),X.options)??U,H=xG.isNode(W)?W:new yG.Scalar(W);if(H.range=U.range,H.tag=G,Y?.format)H.format=Y.format;return H}mG.composeCollection=uG});var s9=D((iG)=>{var a9=g();function pG($,X,Z){let z=X.offset,q=lG(X,$.options.strict,Z);if(!q)return{value:"",type:null,comment:"",range:[z,z,z]};let J=q.mode===">"?a9.Scalar.BLOCK_FOLDED:a9.Scalar.BLOCK_LITERAL,G=X.source?cG(X.source):[],Q=G.length;for(let T=G.length-1;T>=0;--T){let K=G[T][1];if(K===""||K==="\r")Q=T;else break}if(Q===0){let T=q.chomp==="+"&&G.length>0?`
97
+ `.repeat(Math.max(1,G.length-1)):"",K=z+q.length;if(X.source)K+=X.source.length;return{value:T,type:J,comment:q.comment,range:[z,K,K]}}let Y=X.indent+q.indent,U=X.offset+q.length,W=0;for(let T=0;T<Q;++T){let[K,_]=G[T];if(_===""||_==="\r"){if(q.indent===0&&K.length>Y)Y=K.length}else{if(K.length<Y)Z(U+K.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(q.indent===0)Y=K.length;if(W=T,Y===0&&!$.atRoot)Z(U,"BAD_INDENT","Block scalar values in collections must be indented");break}U+=K.length+_.length+1}for(let T=G.length-1;T>=Q;--T)if(G[T][0].length>Y)Q=T+1;let H="",V="",B=!1;for(let T=0;T<W;++T)H+=G[T][0].slice(Y)+`
98
+ `;for(let T=W;T<Q;++T){let[K,_]=G[T];U+=K.length+_.length+1;let F=_[_.length-1]==="\r";if(F)_=_.slice(0,-1);if(_&&K.length<Y){let I=`Block scalar lines must not be less indented than their ${q.indent?"explicit indentation indicator":"first line"}`;Z(U-_.length-(F?2:1),"BAD_INDENT",I),K=""}if(J===a9.Scalar.BLOCK_LITERAL)H+=V+K.slice(Y)+_,V=`
99
+ `;else if(K.length>Y||_[0]==="\t"){if(V===" ")V=`
100
+ `;else if(!B&&V===`
101
+ `)V=`
102
+
103
+ `;H+=V+K.slice(Y)+_,V=`
104
+ `,B=!0}else if(_==="")if(V===`
105
+ `)H+=`
106
+ `;else V=`
107
+ `;else H+=V+_,V=" ",B=!1}switch(q.chomp){case"-":break;case"+":for(let T=Q;T<G.length;++T)H+=`
108
+ `+G[T][0].slice(Y);if(H[H.length-1]!==`
109
+ `)H+=`
110
+ `;break;default:H+=`
111
+ `}let L=z+q.length+X.source.length;return{value:H,type:J,comment:q.comment,range:[z,L,L]}}function lG({offset:$,props:X},Z,z){if(X[0].type!=="block-scalar-header")return z(X[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:q}=X[0],J=q[0],G=0,Q="",Y=-1;for(let V=1;V<q.length;++V){let B=q[V];if(!Q&&(B==="-"||B==="+"))Q=B;else{let L=Number(B);if(!G&&L)G=L;else if(Y===-1)Y=$+V}}if(Y!==-1)z(Y,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${q}`);let U=!1,W="",H=q.length;for(let V=1;V<X.length;++V){let B=X[V];switch(B.type){case"space":U=!0;case"newline":H+=B.source.length;break;case"comment":if(Z&&!U)z(B,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");H+=B.source.length,W=B.source.substring(1);break;case"error":z(B,"UNEXPECTED_TOKEN",B.message),H+=B.source.length;break;default:{let L=`Unexpected token in block scalar header: ${B.type}`;z(B,"UNEXPECTED_TOKEN",L);let T=B.source;if(T&&typeof T==="string")H+=T.length}}}return{mode:J,indent:G,chomp:Q,comment:W,length:H}}function cG($){let X=$.split(/\n( *)/),Z=X[0],z=Z.match(/^( *)/),J=[z?.[1]?[z[1],Z.slice(z[1].length)]:["",Z]];for(let G=1;G<X.length;G+=2)J.push([X[G],X[G+1]]);return J}iG.resolveBlockScalar=pG});var r9=D((ZQ)=>{var n9=g(),sG=$$();function nG($,X,Z){let{offset:z,type:q,source:J,end:G}=$,Q,Y,U=(V,B,L)=>Z(z+V,B,L);switch(q){case"scalar":Q=n9.Scalar.PLAIN,Y=rG(J,U);break;case"single-quoted-scalar":Q=n9.Scalar.QUOTE_SINGLE,Y=oG(J,U);break;case"double-quoted-scalar":Q=n9.Scalar.QUOTE_DOUBLE,Y=tG(J,U);break;default:return Z($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${q}`),{value:"",type:null,comment:"",range:[z,z+J.length,z+J.length]}}let W=z+J.length,H=sG.resolveEnd(G,W,X,Z);return{value:Y,type:Q,comment:H.comment,range:[z,W,H.offset]}}function rG($,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 l5($)}function oG($,X){if($[$.length-1]!=="'"||$.length===1)X($.length,"MISSING_CHAR","Missing closing 'quote");return l5($.slice(1,-1)).replace(/''/g,"'")}function l5($){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 z=X.exec($);if(!z)return $;let q=z[1],J=" ",G=X.lastIndex;Z.lastIndex=G;while(z=Z.exec($)){if(z[1]==="")if(J===`
114
+ `)q+=J;else J=`
115
+ `;else q+=J+z[1],J=" ";G=Z.lastIndex}let Q=/[ \t]*(.*)/sy;return Q.lastIndex=G,z=Q.exec($),q+J+(z?.[1]??"")}function tG($,X){let Z="";for(let z=1;z<$.length-1;++z){let q=$[z];if(q==="\r"&&$[z+1]===`
116
+ `)continue;if(q===`
117
+ `){let{fold:J,offset:G}=eG($,z);Z+=J,z=G}else if(q==="\\"){let J=$[++z],G=$Q[J];if(G)Z+=G;else if(J===`
118
+ `){J=$[z+1];while(J===" "||J==="\t")J=$[++z+1]}else if(J==="\r"&&$[z+1]===`
119
+ `){J=$[++z+1];while(J===" "||J==="\t")J=$[++z+1]}else if(J==="x"||J==="u"||J==="U"){let Q={x:2,u:4,U:8}[J];Z+=XQ($,z+1,Q,X),z+=Q}else{let Q=$.substr(z-1,2);X(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Q}`),Z+=Q}}else if(q===" "||q==="\t"){let J=z,G=$[z+1];while(G===" "||G==="\t")G=$[++z+1];if(G!==`
120
+ `&&!(G==="\r"&&$[z+2]===`
121
+ `))Z+=z>J?$.slice(J,z+1):q}else Z+=q}if($[$.length-1]!=='"'||$.length===1)X($.length,"MISSING_CHAR",'Missing closing "quote');return Z}function eG($,X){let Z="",z=$[X+1];while(z===" "||z==="\t"||z===`
122
+ `||z==="\r"){if(z==="\r"&&$[X+2]!==`
123
+ `)break;if(z===`
124
+ `)Z+=`
125
+ `;X+=1,z=$[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,z){let q=$.substr(X,Z),G=q.length===Z&&/^[0-9a-fA-F]+$/.test(q)?parseInt(q,16):NaN;if(isNaN(G)){let Q=$.substr(X-2,Z+2);return z(X-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Q}`),Q}return String.fromCodePoint(G)}ZQ.resolveFlowScalar=nG});var i5=D((UQ)=>{var x0=S(),c5=g(),qQ=s9(),JQ=r9();function GQ($,X,Z,z){let{value:q,type:J,comment:G,range:Q}=X.type==="block-scalar"?qQ.resolveBlockScalar($,X,z):JQ.resolveFlowScalar(X,$.options.strict,z),Y=Z?$.directives.tagName(Z.source,(H)=>z(Z,"TAG_RESOLVE_FAILED",H)):null,U;if($.options.stringKeys&&$.atKey)U=$.schema[x0.SCALAR];else if(Y)U=QQ($.schema,q,Y,Z,z);else if(X.type==="scalar")U=YQ($,q,X,z);else U=$.schema[x0.SCALAR];let W;try{let H=U.resolve(q,(V)=>z(Z??X,"TAG_RESOLVE_FAILED",V),$.options);W=x0.isScalar(H)?H:new c5.Scalar(H)}catch(H){let V=H instanceof Error?H.message:String(H);z(Z??X,"TAG_RESOLVE_FAILED",V),W=new c5.Scalar(q)}if(W.range=Q,W.source=q,J)W.type=J;if(Y)W.tag=Y;if(U.format)W.format=U.format;if(G)W.comment=G;return W}function QQ($,X,Z,z,q){if(Z==="!")return $[x0.SCALAR];let J=[];for(let Q of $.tags)if(!Q.collection&&Q.tag===Z)if(Q.default&&Q.test)J.push(Q);else return Q;for(let Q of J)if(Q.test?.test(X))return Q;let G=$.knownTags[Z];if(G&&!G.collection)return $.tags.push(Object.assign({},G,{default:!1,test:void 0})),G;return q(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Z}`,Z!=="tag:yaml.org,2002:str"),$[x0.SCALAR]}function YQ({atKey:$,directives:X,schema:Z},z,q,J){let G=Z.tags.find((Q)=>(Q.default===!0||$&&Q.default==="key")&&Q.test?.test(z))||Z[x0.SCALAR];if(Z.compat){let Q=Z.compat.find((Y)=>Y.default&&Y.test?.test(z))??Z[x0.SCALAR];if(G.tag!==Q.tag){let Y=X.tagString(G.tag),U=X.tagString(Q.tag),W=`Value may be parsed as either ${Y} or ${U}`;J(q,"TAG_RESOLVE_FAILED",W,!0)}}return G}UQ.composeScalar=GQ});var a5=D((VQ)=>{function WQ($,X,Z){if(X){Z??(Z=X.length);for(let z=Z-1;z>=0;--z){let q=X[z];switch(q.type){case"space":case"comment":case"newline":$-=q.source.length;continue}q=X[++z];while(q?.type==="space")$+=q.source.length,q=X[++z];break}}return $}VQ.emptyScalarPosition=WQ});var r5=D((OQ)=>{var BQ=w$(),KQ=S(),LQ=p5(),s5=i5(),DQ=$$(),_Q=a5(),FQ={composeNode:n5,composeEmptyNode:o9};function n5($,X,Z,z){let q=$.atKey,{spaceBefore:J,comment:G,anchor:Q,tag:Y}=Z,U,W=!0;switch(X.type){case"alias":if(U=MQ($,X,z),Q||Y)z(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,z),Q)U.anchor=Q.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(U=LQ.composeCollection(FQ,$,X,Z,z),Q)U.anchor=Q.source.substring(1);break;default:{let H=X.type==="error"?X.message:`Unsupported token (type: ${X.type})`;z(X,"UNEXPECTED_TOKEN",H),U=o9($,X.offset,void 0,null,Z,z),W=!1}}if(Q&&U.anchor==="")z(Q,"BAD_ALIAS","Anchor cannot be an empty string");if(q&&$.options.stringKeys&&(!KQ.isScalar(U)||typeof U.value!=="string"||U.tag&&U.tag!=="tag:yaml.org,2002:str"))z(Y??X,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(J)U.spaceBefore=!0;if(G)if(X.type==="scalar"&&X.source==="")U.comment=G;else U.commentBefore=G;if($.options.keepSourceTokens&&W)U.srcToken=X;return U}function o9($,X,Z,z,{spaceBefore:q,comment:J,anchor:G,tag:Q,end:Y},U){let W={type:"scalar",offset:_Q.emptyScalarPosition(X,Z,z),indent:-1,source:""},H=s5.composeScalar($,W,Q,U);if(G){if(H.anchor=G.source.substring(1),H.anchor==="")U(G,"BAD_ALIAS","Anchor cannot be an empty string")}if(q)H.spaceBefore=!0;if(J)H.comment=J,H.range[2]=Y;return H}function MQ({options:$},{offset:X,source:Z,end:z},q){let J=new BQ.Alias(Z.substring(1));if(J.source==="")q(X,"BAD_ALIAS","Alias cannot be an empty string");if(J.source.endsWith(":"))q(X+Z.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let G=X+Z.length,Q=DQ.resolveEnd(z,G,$.strict,q);if(J.range=[X,G,Q.offset],Q.comment)J.comment=Q.comment;return J}OQ.composeEmptyNode=o9;OQ.composeNode=n5});var t5=D((jQ)=>{var RQ=g$(),o5=r5(),PQ=$$(),NQ=v$();function AQ($,X,{offset:Z,start:z,value:q,end:J},G){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(z,{indicator:"doc-start",next:q??J?.[0],offset:Z,onError:G,parentIndent:0,startOnNewline:!0});if(W.found){if(Y.directives.docStart=!0,q&&(q.type==="block-map"||q.type==="block-seq")&&!W.hasNewline)G(W.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}Y.contents=q?o5.composeNode(U,q,W,G):o5.composeEmptyNode(U,W.end,z,null,W,G);let H=Y.contents.range[2],V=PQ.resolveEnd(J,H,!1,G);if(V.comment)Y.comment=V.comment;return Y.range=[Z,H,V.offset],Y}jQ.composeDoc=AQ});var t9=D((kQ)=>{var CQ=Q0("process"),EQ=Z9(),bQ=g$(),u$=h$(),e5=S(),xQ=t5(),yQ=$$();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,z=!1;for(let q=0;q<$.length;++q){let J=$[q];switch(J[0]){case"#":X+=(X===""?"":z?`
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
+ `)+(J.substring(1)||" "),Z=!0,z=!1;break;case"%":if($[q+1]?.[0]!=="#")q+=1;Z=!1;break;default:if(!Z)z=!0;Z=!1}}return{comment:X,afterEmptyLine:z}}class X8{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(X,Z,z,q)=>{let J=m$(X);if(q)this.warnings.push(new u$.YAMLWarning(J,Z,z));else this.errors.push(new u$.YAMLParseError(J,Z,z))},this.directives=new EQ.Directives({version:$.version||"1.2"}),this.options=$}decorate($,X){let{comment:Z,afterEmptyLine:z}=$8(this.prelude);if(Z){let q=$.contents;if(X)$.comment=$.comment?`${$.comment}
130
+ ${Z}`:Z;else if(z||$.directives.docStart||!q)$.commentBefore=Z;else if(e5.isCollection(q)&&!q.flow&&q.items.length>0){let J=q.items[0];if(e5.isPair(J))J=J.key;let G=J.commentBefore;J.commentBefore=G?`${Z}
131
+ ${G}`:Z}else{let J=q.commentBefore;q.commentBefore=J?`${Z}
132
+ ${J}`: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 z of $)yield*this.next(z);yield*this.end(X,Z)}*next($){if(CQ.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(X,Z,z)=>{let q=m$($);q[0]+=X,this.onError(q,"BAD_DIRECTIVE",Z,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let X=xQ.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=yQ.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),z=new bQ.Document(void 0,Z);if(this.atDirectives)this.onError(X,"MISSING_CHAR","Missing directives-end indicator line");z.range=[0,X,X],this.decorate(z,!1),yield z}}}kQ.Composer=X8});var q8=D((lQ)=>{var gQ=s9(),hQ=r9(),vQ=h$(),Z8=N$();function uQ($,X=!0,Z){if($){let z=(q,J,G)=>{let Q=typeof q==="number"?q:Array.isArray(q)?q[0]:q.offset;if(Z)Z(Q,J,G);else throw new vQ.YAMLParseError([Q,Q+1],J,G)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return hQ.resolveFlowScalar($,X,z);case"block-scalar":return gQ.resolveBlockScalar({options:{strict:X}},$,z)}}return null}function mQ($,X){let{implicitKey:Z=!1,indent:z,inFlow:q=!1,offset:J=-1,type:G="PLAIN"}=X,Q=Z8.stringifyString({type:G,value:$},{implicitKey:Z,indent:z>0?" ".repeat(z):"",inFlow:q,options:{blockQuote:!0,lineWidth:-1}}),Y=X.end??[{type:"newline",offset:-1,indent:z,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:J,indent:z,source:W}];if(!z8(V,Y))V.push({type:"newline",offset:-1,indent:z,source:`
137
+ `});return{type:"block-scalar",offset:J,indent:z,props:V,source:H}}case'"':return{type:"double-quoted-scalar",offset:J,indent:z,source:Q,end:Y};case"'":return{type:"single-quoted-scalar",offset:J,indent:z,source:Q,end:Y};default:return{type:"scalar",offset:J,indent:z,source:Q,end:Y}}}function dQ($,X,Z={}){let{afterKey:z=!1,implicitKey:q=!1,inFlow:J=!1,type:G}=Z,Q="indent"in $?$.indent:null;if(z&&typeof Q==="number")Q+=2;if(!G)switch($.type){case"single-quoted-scalar":G="QUOTE_SINGLE";break;case"double-quoted-scalar":G="QUOTE_DOUBLE";break;case"block-scalar":{let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");G=U.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:G="PLAIN"}let Y=Z8.stringifyString({type:G,value:X},{implicitKey:q||Q===null,indent:Q!==null&&Q>0?" ".repeat(Q):"",inFlow:J,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
+ `),z=X.substring(0,Z),q=X.substring(Z+1)+`
139
+ `;if($.type==="block-scalar"){let J=$.props[0];if(J.type!=="block-scalar-header")throw Error("Invalid block scalar header");J.source=z,$.source=q}else{let{offset:J}=$,G="indent"in $?$.indent:-1,Q=[{type:"block-scalar-header",offset:J,indent:G,source:z}];if(!z8(Q,"end"in $?$.end:void 0))Q.push({type:"newline",offset:-1,indent:G,source:`
140
+ `});for(let Y of Object.keys($))if(Y!=="type"&&Y!=="offset")delete $[Y];Object.assign($,{type:"block-scalar",indent:G,props:Q,source:q})}}function z8($,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 z=$.props.slice(1),q=X.length;if($.props[0].type==="block-scalar-header")q-=$.props[0].source.length;for(let J of z)J.offset+=q;delete $.props,Object.assign($,{type:Z,source:X,end:z});break}case"block-map":case"block-seq":{let q={type:"newline",offset:$.offset+X.length,indent:$.indent,source:`
141
+ `};delete $.items,Object.assign($,{type:Z,source:X,end:[q]});break}default:{let z="indent"in $?$.indent:-1,q="end"in $&&Array.isArray($.end)?$.end.filter((J)=>J.type==="space"||J.type==="comment"||J.type==="newline"):[];for(let J of Object.keys($))if(J!=="type"&&J!=="offset")delete $[J];Object.assign($,{type:Z,indent:z,source:X,end:q})}}}lQ.createScalarToken=mQ;lQ.resolveAsScalar=uQ;lQ.setScalarValue=dQ});var J8=D((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:z}){let q="";for(let J of $)q+=J.source;if(X)q+=o1(X);if(Z)for(let J of Z)q+=J.source;if(z)q+=o1(z);return q}nQ.stringify=sQ});var Y8=D((tQ)=>{var $4=Symbol("break visit"),oQ=Symbol("skip children"),G8=Symbol("remove item");function y0($,X){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};Q8(Object.freeze([]),$,X)}y0.BREAK=$4;y0.SKIP=oQ;y0.REMOVE=G8;y0.itemAtPath=($,X)=>{let Z=$;for(let[z,q]of X){let J=Z?.[z];if(J&&"items"in J)Z=J.items[q];else return}return Z};y0.parentCollection=($,X)=>{let Z=y0.itemAtPath($,X.slice(0,-1)),z=X[X.length-1][0],q=Z?.[z];if(q&&"items"in q)return q;throw Error("Parent collection not found")};function Q8($,X,Z){let z=Z(X,$);if(typeof z==="symbol")return z;for(let q of["key","value"]){let J=X[q];if(J&&"items"in J){for(let G=0;G<J.items.length;++G){let Q=Q8(Object.freeze($.concat([[q,G]])),J.items[G],Z);if(typeof Q==="number")G=Q-1;else if(Q===$4)return $4;else if(Q===G8)J.items.splice(G,1),G-=1}if(typeof z==="function"&&q==="key")z=z(X,$)}}return typeof z==="function"?z(X,$):z}tQ.visit=y0});var t1=D((GY)=>{var X4=q8(),$Y=J8(),XY=Y8(),Z4="\uFEFF",z4="\x02",q4="\x18",J4="\x1F",ZY=($)=>!!$&&("items"in $),zY=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function qY($){switch($){case Z4:return"<BOM>";case z4:return"<DOC>";case q4:return"<FLOW_END>";case J4:return"<SCALAR>";default:return JSON.stringify($)}}function JY($){switch($){case Z4:return"byte-order-mark";case z4:return"doc-mode";case q4:return"flow-error-end";case J4: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}GY.createScalarToken=X4.createScalarToken;GY.resolveAsScalar=X4.resolveAsScalar;GY.setScalarValue=X4.setScalarValue;GY.stringify=$Y.stringify;GY.visit=XY.visit;GY.BOM=Z4;GY.DOCUMENT=z4;GY.FLOW_END=q4;GY.SCALAR=J4;GY.isCollection=ZY;GY.isScalar=zY;GY.prettyToken=qY;GY.tokenType=JY});var Q4=D((wY)=>{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"),MY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),e1=new Set(",[]{}"),OY=new Set(` ,[]{}
145
+ \r `),G4=($)=>!$||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 z=this.buffer[Z+$+1];if(z===`
148
+ `||!z&&!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 q=$[Z-1];if(q===" "||q==="\t"){X=Z-1;break}else Z=$.indexOf("#",Z+1)}while(!0){let q=$[X-1];if(q===" "||q==="\t")X-=1;else break}let z=(yield*this.pushCount(X))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-z),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(G4),"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 z=this.getLine();if(z===null)return this.setNext("flow");if(Z!==-1&&Z<this.indentNext&&z[0]!=="#"||Z===0&&(z.startsWith("---")||z.startsWith("..."))&&X0(z[3])){if(!(Z===this.indentNext-1&&this.flowLevel===1&&(z[0]==="]"||z[0]==="}")))return this.flowLevel=0,yield d$.FLOW_END,yield*this.parseLineStart()}let q=0;while(z[q]===",")q+=yield*this.pushCount(1),q+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(q+=yield*this.pushIndicators(),z[q]){case void 0:return"flow";case"#":return yield*this.pushCount(z.length-q),"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(G4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let J=this.charAt(1);if(this.flowKey||X0(J)||J===",")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 q=0;while(this.buffer[X-1-q]==="\\")q+=1;if(q%2===0)break;X=this.buffer.indexOf('"',X+1)}let Z=this.buffer.substring(0,X),z=Z.indexOf(`
151
+ `,this.pos);if(z!==-1){while(z!==-1){let q=this.continueScalar(z+1);if(q===-1)break;z=Z.indexOf(`
152
+ `,q)}if(z!==-1)X=z-(Z[z-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 q=this.pos;Z=this.buffer[q];++q)switch(Z){case" ":X+=1;break;case`
153
+ `:$=q,X=0;break;case"\r":{let J=this.buffer[q+1];if(!J&&!this.atEnd)return this.setNext("block-scalar");if(J===`
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 q=this.continueScalar($+1);if(q===-1)break;$=this.buffer.indexOf(`
155
+ `,q)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let z=$+1;Z=this.buffer[z];while(Z===" ")Z=this.buffer[++z];if(Z==="\t"){while(Z==="\t"||Z===" "||Z==="\r"||Z===`
156
+ `)Z=this.buffer[++z];$=z-1}else if(!this.blockScalarKeep)do{let q=$-1,J=this.buffer[q];if(J==="\r")J=this.buffer[--q];let G=q;while(J===" ")J=this.buffer[--q];if(J===`
157
+ `&&q>=this.pos&&q+1+X>G)$=q;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,z;while(z=this.buffer[++Z])if(z===":"){let q=this.buffer[Z+1];if(X0(q)||$&&e1.has(q))break;X=Z}else if(X0(z)){let q=this.buffer[Z+1];if(z==="\r")if(q===`
158
+ `)Z+=1,z=`
159
+ `,q=this.buffer[Z+1];else X=Z;if(q==="#"||$&&e1.has(q))break;if(z===`
160
+ `){let J=this.continueScalar(Z+1);if(J===-1)break;Z=Math.max(Z,J-2)}}else{if($&&e1.has(z))break;X=Z}if(!z&&!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(G4))+(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(MY.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 z=X-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=X;return z}*pushUntil($){let X=this.pos,Z=this.buffer[X];while(!$(Z))Z=this.buffer[++X];return yield*this.pushToIndex(X,!1)}}wY.Lexer=H8});var Y4=D((RY)=>{class W8{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let X=0,Z=this.lineStarts.length;while(X<Z){let q=X+Z>>1;if(this.lineStarts[q]<$)X=q+1;else Z=q}if(this.lineStarts[X]===$)return{line:X+1,col:1};if(X===0)return{line:0,col:$};let z=this.lineStarts[X-1];return{line:X,col:$-z+1}}}}RY.LineCounter=W8});var U4=D((jY)=>{var NY=Q0("process"),V8=t1(),AY=Q4();function w0($,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 K8($){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 B8($){if($.start.type==="flow-seq-start"){for(let X of $.items)if(X.sep&&!X.value&&!w0(X.start,"explicit-key-ind")&&!w0(X.sep,"map-value-ind")){if(X.key)X.value=X.key;if(delete X.key,K8(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 L8{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")B8(X);switch(Z.type){case"document":Z.value=X;break;case"block-scalar":Z.props.push(X);break;case"block-map":{let z=Z.items[Z.items.length-1];if(z.value){Z.items.push({start:[],key:X,sep:[]}),this.onKeyLine=!0;return}else if(z.sep)z.value=X;else{Object.assign(z,{key:X,sep:[]}),this.onKeyLine=!z.explicitKey;return}break}case"block-seq":{let z=Z.items[Z.items.length-1];if(z.value)Z.items.push({start:[],value:X});else z.value=X;break}case"flow-collection":{let z=Z.items[Z.items.length-1];if(!z||z.value)Z.items.push({start:[],key:X,sep:[]});else if(z.sep)z.value=X;else Object.assign(z,{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 z=X.items[X.items.length-1];if(z&&!z.sep&&!z.value&&z.start.length>0&&T8(z.start)===-1&&(X.indent===0||z.start.every((q)=>q.type!=="comment"||q.indent<X.indent))){if(Z.type==="document")Z.end=z.start;else Z.items.push({start:z.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),z;if($.end)z=$.end,z.push(this.sourceToken),delete $.end;else z=[this.sourceToken];let q={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:Z,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=q}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 z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,X.start),z.push(this.sourceToken),$.items.pop();return}}X.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let Z=!this.onKeyLine&&this.indent===$.indent,z=Z&&(X.sep||X.explicitKey)&&this.type!=="seq-item-ind",q=[];if(z&&X.sep&&!X.value){let J=[];for(let G=0;G<X.sep.length;++G){let Q=X.sep[G];switch(Q.type){case"newline":J.push(G);break;case"space":break;case"comment":if(Q.indent>$.indent)J.length=0;break;default:J.length=0}}if(J.length>=2)q=X.sep.splice(J[1])}switch(this.type){case"anchor":case"tag":if(z||X.value)q.push(this.sourceToken),$.items.push({start:q}),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(z||X.value)q.push(this.sourceToken),$.items.push({start:q,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(w0(X.start,"newline"))Object.assign(X,{key:null,sep:[this.sourceToken]});else{let J=X$(X.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]})}else if(X.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(w0(X.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:q,key:null,sep:[this.sourceToken]}]});else if(K8(X.key)&&!w0(X.sep,"newline")){let J=X$(X.start),G=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:J,key:G,sep:Q}]})}else if(q.length>0)X.sep=X.sep.concat(q,this.sourceToken);else X.sep.push(this.sourceToken);else if(!X.sep)Object.assign(X,{key:null,sep:[this.sourceToken]});else if(X.value||z)$.items.push({start:q,key:null,sep:[this.sourceToken]});else if(w0(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 J=this.flowScalar(this.type);if(z||X.value)$.items.push({start:q,key:J,sep:[]}),this.onKeyLine=!0;else if(X.sep)this.stack.push(J);else Object.assign(X,{key:J,sep:[]}),this.onKeyLine=!0;return}default:{let J=this.startBlockValue($);if(J){if(J.type==="block-seq"){if(!X.explicitKey&&X.sep&&!w0(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:q});this.stack.push(J);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 z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,X.start),z.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||w0(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 z=this.flowScalar(this.type);if(!X||X.value)$.items.push({start:[],key:z,sep:[]});else if(X.sep)this.stack.push(z);else Object.assign(X,{key:z,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 z=$2(Z),q=X$(z);B8($);let J=$.end.splice(1,$.end.length);J.push(this.sourceToken);let G={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:q,key:$,sep:J}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=G}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()}}}jY.Parser=L8});var O8=D((gY)=>{var D8=t9(),CY=g$(),p$=h$(),EY=Y9(),bY=S(),xY=Y4(),_8=U4();function F8($){let X=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||X&&new xY.LineCounter||null,prettyErrors:X}}function yY($,X={}){let{lineCounter:Z,prettyErrors:z}=F8(X),q=new _8.Parser(Z?.addNewLine),J=new D8.Composer(X),G=Array.from(J.compose(q.parse($)));if(z&&Z)for(let Q of G)Q.errors.forEach(p$.prettifyError($,Z)),Q.warnings.forEach(p$.prettifyError($,Z));if(G.length>0)return G;return Object.assign([],{empty:!0},J.streamInfo())}function M8($,X={}){let{lineCounter:Z,prettyErrors:z}=F8(X),q=new _8.Parser(Z?.addNewLine),J=new D8.Composer(X),G=null;for(let Q of J.compose(q.parse($),!0,$.length))if(!G)G=Q;else if(G.options.logLevel!=="silent"){G.errors.push(new p$.YAMLParseError(Q.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&Z)G.errors.forEach(p$.prettifyError($,Z)),G.warnings.forEach(p$.prettifyError($,Z));return G}function kY($,X,Z){let z=void 0;if(typeof X==="function")z=X;else if(Z===void 0&&X&&typeof X==="object")Z=X;let q=M8($,Z);if(!q)return null;if(q.warnings.forEach((J)=>EY.warn(q.options.logLevel,J)),q.errors.length>0)if(q.options.logLevel!=="silent")throw q.errors[0];else q.errors=[];return q.toJS(Object.assign({reviver:z},Z))}function fY($,X,Z){let z=null;if(typeof X==="function"||Array.isArray(X))z=X;else if(Z===void 0&&X)Z=X;if(typeof Z==="string")Z=Z.length;if(typeof Z==="number"){let q=Math.round(Z);Z=q<1?void 0:q>8?{indent:8}:{indent:q}}if($===void 0){let{keepUndefined:q}=Z??X??{};if(!q)return}if(bY.isDocument($)&&!z)return $.toString(Z);return new CY.Document($,z,Z).toString(Z)}gY.parse=kY;gY.parseAllDocuments=yY;gY.parseDocument=M8;gY.stringify=fY});var I8=D(($U)=>{var dY=t9(),pY=g$(),lY=f9(),H4=h$(),cY=w$(),I0=S(),iY=_0(),aY=g(),sY=M0(),nY=O0(),rY=t1(),oY=Q4(),tY=Y4(),eY=U4(),X2=O8(),w8=M$();$U.Composer=dY.Composer;$U.Document=pY.Document;$U.Schema=lY.Schema;$U.YAMLError=H4.YAMLError;$U.YAMLParseError=H4.YAMLParseError;$U.YAMLWarning=H4.YAMLWarning;$U.Alias=cY.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=w8.visit;$U.visitAsync=w8.visitAsync});var TX=r4(VX(),1),{program:l0,createCommand:nW,createArgument:rW,createOption:oW,CommanderError:tW,InvalidArgumentError:eW,InvalidOptionArgumentError:$V,Command:XV,Argument:ZV,Option:o2,Help:zV}=TX.default;var BX={name:"@pickled-dev/cli",version:"0.13.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 q0={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 z;try{let q=await Z.text();z=R8.default.parse(q)}catch(q){throw Error(`Failed to parse pickled.yml: ${q}`)}return CU(z),z}function CU($){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,z]of Object.entries($.docs.sources))xU(Z,z);if($.targets)for(let[Z,z]of Object.entries($.targets)){if(z.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(z.provider==="codex-cli"){if(!z.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(z.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(z.category==="api"){if(!z.model)throw Error(`pickled.yml: target "${Z}" (api/${z.provider}) requires an explicit 'model' field. Pickled does not substitute a default; reproducible evals depend on pinning the model.`);let q=["allowedTools","disallowedTools","mcpServers","permissionMode","maxTurns","maxThinkingTokens","maxBudgetUsd"];for(let J of q)if(z[J]!==void 0)throw Error(`pickled.yml: target "${Z}" (api/${z.provider}) sets '${J}', which only applies to CLI/Agent SDK targets. Remove the field; API targets accept only model/temperature/maxTokens/threshold.`);if(z.workspaceContext!==void 0)throw Error(`pickled.yml: target "${Z}" (api/${z.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 z of Z.requiredSources)if(!X.has(z))throw Error(`pickled.yml: scenario "${Z.name}" references unknown source "${z}". Declared sources: ${[...X].join(", ")||"(none)"}`);fU(Z.name,Z.traps),bU(Z.name,Z.compareSurfaces,X)}EU($)}function EU($){if(!$.docs?.sources)return;let X=[];for(let[z,q]of Object.entries($.docs.sources)){if(typeof q==="string")continue;let J=q.audit?.traps;if(Array.isArray(J))X.push({id:z,list:J})}if(X.length===0)return;let Z=new Map;for(let z of $.scenarios)for(let q of z.traps??[]){let J=Z.get(q.id);if(J!==void 0)throw Error(`pickled.yml: trap id "${q.id}" is declared in both scenario "${J}" and scenario "${z.name}". Globally unique trap ids are required when any source uses list-form audit.traps suppression. Rename one of the traps.`);Z.set(q.id,z.name)}for(let{id:z,list:q}of X)for(let J of q)if(!Z.has(J)){let G=[...Z.keys()].join(", ")||"(none)";throw Error(`pickled.yml: docs.sources["${z}"].audit.traps lists unknown trap id "${J}". Declared trap ids: ${G}`)}}function bU($,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 z=0;z<X.length;z++){let q=X[z];if(!Array.isArray(q))throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${z}] must be an array of source ids`);if(q.length===0)throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${z}] must be a non-empty list of source ids`);for(let J of q){if(typeof J!=="string")throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${z}] entries must be string source ids`);if(!Z.has(J))throw Error(`pickled.yml: scenario "${$}" compareSurfaces[${z}] references unknown source "${J}". Declared sources: ${[...Z].join(", ")||"(none)"}`)}}}function xU($,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 z=Z.audit;if(z.traps!==void 0){let q=z.traps;if(typeof q==="boolean");else if(Array.isArray(q)){if(q.length===0)throw Error(`pickled.yml: docs.sources["${$}"].audit.traps cannot be an empty array; use true (scan all) or false (skip all) instead`);for(let J=0;J<q.length;J++)if(typeof q[J]!=="string")throw Error(`pickled.yml: docs.sources["${$}"].audit.traps[${J}] must be a string trap id`)}else throw Error(`pickled.yml: docs.sources["${$}"].audit.traps must be a boolean or an array of trap ids`)}for(let q of Object.keys(z))if(q!=="traps")throw Error(`pickled.yml: docs.sources["${$}"].audit has unknown field "${q}"`)}for(let z of Object.keys(Z))if(z!=="path"&&z!=="audit")throw Error(`pickled.yml: docs.sources["${$}"] has unknown field "${z}"`)}var yU=new Set(["g","y"]),kU=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 z of X){if(!z.id||typeof z.id!=="string")throw Error(`pickled.yml: scenario "${$}" has a trap missing 'id'`);if(Z.has(z.id))throw Error(`pickled.yml: scenario "${$}" has duplicate trap id "${z.id}"`);if(Z.add(z.id),!z.reason||typeof z.reason!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${z.id}" requires non-empty 'reason'`);if(z.auditSeverity!==void 0&&z.auditSeverity!=="warning"&&z.auditSeverity!=="error")throw Error(`pickled.yml: scenario "${$}" trap "${z.id}" auditSeverity must be "warning" or "error"`);let q=typeof z.match==="string",J=typeof z.pattern==="string";if(q===J)throw Error(`pickled.yml: scenario "${$}" trap "${z.id}" must set exactly one of 'match' or 'pattern'`);if(q){if(z.match==="")throw Error(`pickled.yml: scenario "${$}" trap "${z.id}" has empty 'match'`);if(z.flags!==void 0)throw Error(`pickled.yml: scenario "${$}" trap "${z.id}" sets 'flags' without 'pattern'`)}else{let G=z.pattern;if(typeof G!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${z.id}" must set 'pattern'`);if(G==="")throw Error(`pickled.yml: scenario "${$}" trap "${z.id}" has empty 'pattern'`);if(z.flags!==void 0){if(typeof z.flags!=="string")throw Error(`pickled.yml: scenario "${$}" trap "${z.id}" has non-string 'flags'`);for(let Q of z.flags){if(yU.has(Q))throw Error(`pickled.yml: scenario "${$}" trap "${z.id}" uses forbidden regex flag "${Q}" (g and y are not allowed)`);if(!kU.has(Q))throw Error(`pickled.yml: scenario "${$}" trap "${z.id}" uses unsupported regex flag "${Q}"`)}}try{new RegExp(G,z.flags??"")}catch(Q){throw Error(`pickled.yml: scenario "${$}" trap "${z.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 z=[...Z].sort().join(", ");throw Error(`Unknown target: "${X}". Available targets: ${z}`)}return{...$,matrix:{...$.matrix,target:[X]},scenarios:$.scenarios.filter((z)=>!z.target||z.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:z,findings:q}=$,J=[],G=q.filter((H)=>H.severity==="error").length,Q=q.filter((H)=>H.severity==="warning").length;if(J.push(`# Agent-context audit
167
+ `),J.push(`Target: \`${X.targetRepo}\``),J.push(`Budgets: root \u2264 ${X.budgets.rootLines} lines, nested warn at ${X.budgets.nestedWarnLines} lines.`),J.push(`Found ${Z.length} agent-doc files. ${G} error(s), ${Q} warning(s).
168
+ `),J.push(`## Inventory
169
+ `),Z.length===0)J.push(`No agent-doc files found.
170
+ `);else{J.push("| File | Lines | Kind | Notes |"),J.push("|---|---|---|---|");let H=[...Z].sort((V,B)=>B.lineCount-V.lineCount);for(let V of H){let B=!V.relPath.includes("/"),L=P8(V.lineCount,B,X),T=V.isSymlink?`symlink \u2192 ${V.symlinkTarget?.replace(`${X.targetRepo}/`,"")??"?"}`:"file";J.push(`| \`${V.relPath}\` | ${V.lineCount} | ${T} | ${L} |`)}J.push("")}if(J.push(`## AGENTS.md / CLAUDE.md pairs
171
+ `),z.length===0)J.push(`No pairs found.
172
+ `);else{J.push("| Directory | A | C | Class | Detail |"),J.push("|---|---|---|---|---|");for(let H of z)J.push(`| \`${H.dir||"(root)"}\` | ${H.agentsExists?"\u2713":"\xB7"} | ${H.claudeExists?"\u2713":"\xB7"} | ${H.classification} | ${H.detail} |`);J.push("")}let Y=Z.filter((H)=>!H.isSymlink&&H.brokenPathRefs.length+H.brokenImports.length>0);if(J.push(`## Broken references
173
+ `),Y.length===0)J.push(`None detected.
174
+ `);else for(let H of Y){if(J.push(`### \`${H.relPath}\`
175
+ `),H.brokenPathRefs.length>0){J.push("Broken path references:");for(let V of H.brokenPathRefs)J.push(` - \`${V}\``);J.push("")}if(H.brokenImports.length>0){J.push("Broken `@`-imports:");for(let V of H.brokenImports)J.push(` - \`${V}\``);J.push("")}}let U=Z.filter((H)=>!H.isSymlink&&H.unresolvedCommands.length>0);if(J.push(`## Unresolved package-manager commands (advisory)
176
+ `),J.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)J.push(`None flagged.
177
+ `);else for(let H of U){J.push(`### \`${H.relPath}\`
178
+ `);for(let V of H.unresolvedCommands)J.push(` - \`${V}\``);J.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(J.push(`## Section breakdown for files over budget
179
+ `),W.length===0)J.push(`All files within budget.
180
+ `);else for(let H of W){J.push(`### \`${H.relPath}\` (${H.lineCount} lines)
181
+ `),J.push(`Largest H2 sections (lines including any subsections):
182
+ `),J.push("| Section | Lines |"),J.push("|---|---|");for(let V of H.sections.slice(0,10))J.push(`| ${V.header} | ${V.lines} |`);J.push("")}if(J.push(`## Registered-source trap matches
183
+ `),J.push("Catches stale claims in `docs.sources` against declared traps. Sources with `audit.traps: false` are excluded.\n"),$.sourceTrapMatches.length===0)J.push(`None.
184
+ `);else{for(let H of $.sourceTrapMatches)J.push(`- **${H.sourceId}** (\`${H.sourcePath}:L${H.line}\`) \u2014 trap \`${H.trapId}\` matched \`${H.matched}\` (${H.severity})`),J.push(` - reason: ${H.trapReason}`),J.push(" - fix: remove the stale claim, retire the trap, or set `audit.traps: false` on the source");J.push("")}return J.join(`
185
+ `)}function z2($){return JSON.stringify($,null,2)}function q2($){let{config:X,files:Z,pairs:z,findings:q}=$,J=[],G=q.filter((H)=>H.severity==="error").length,Q=q.filter((H)=>H.severity==="warning").length;if(J.push("pickled audit"),J.push(`Target: ${X.targetRepo}`),J.push(`Budgets: root \u2264 ${X.budgets.rootLines} lines, nested warn at ${X.budgets.nestedWarnLines} lines.`),J.push(`Found: ${Z.length} agent-doc file(s) \xB7 ${G} error(s) \xB7 ${Q} warning(s)`),J.push(""),J.push("Inventory"),Z.length===0)J.push(" none");else{let H=[...Z].sort((B,L)=>L.lineCount-B.lineCount),V=Math.max(...H.map((B)=>B.relPath.length));for(let B of H){let L=!B.relPath.includes("/"),T=P8(B.lineCount,L,X),K=B.isSymlink?`symlink \u2192 ${B.symlinkTarget?.replace(`${X.targetRepo}/`,"")??"?"}`:"file",_=`${B.lineCount}`.padStart(4),F=B.relPath.padEnd(V),O=T?` (${T})`:"";J.push(` ${F} ${_} lines ${K}${O}`)}}if(J.push(""),J.push("AGENTS.md / CLAUDE.md pairs"),z.length===0)J.push(" none");else for(let H of z){let V=H.dir||"(root)";J.push(` ${V}: ${H.classification} \xB7 ${H.detail}`)}J.push("");let Y=Z.filter((H)=>!H.isSymlink&&H.brokenPathRefs.length+H.brokenImports.length>0);if(J.push("Broken references"),Y.length===0)J.push(" none");else for(let H of Y){J.push(` ${H.relPath}:`);for(let V of H.brokenPathRefs)J.push(` path: ${V}`);for(let V of H.brokenImports)J.push(` @-import: ${V}`)}J.push("");let U=Z.filter((H)=>!H.isSymlink&&H.unresolvedCommands.length>0);if(J.push("Unresolved package-manager commands (advisory)"),U.length===0)J.push(" none");else for(let H of U){J.push(` ${H.relPath}:`);for(let V of H.unresolvedCommands)J.push(` ${V}`)}J.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(J.push("Section breakdown for files over budget"),W.length===0)J.push(" all files within budget");else for(let H of W){J.push(` ${H.relPath} (${H.lineCount} lines):`);for(let V of H.sections.slice(0,10))J.push(` ${V.header.padEnd(40)} ${V.lines} lines`)}if(J.push(""),J.push("Registered-source trap matches"),$.sourceTrapMatches.length===0)J.push(" none");else for(let H of $.sourceTrapMatches){let V=H.severity==="error"?"error":"warning";J.push(` [${V}] ${H.sourceId} (${H.sourcePath}:L${H.line}): trap ${H.trapId} matched "${H.matched}"`),J.push(` reason: ${H.trapReason}`),J.push(" fix: remove the stale claim, retire the trap, or set audit.traps: false on the source")}return J.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 q$,lstatSync as C8,readFileSync as Q2,readlinkSync as lU,statSync as cU}from"fs";import{dirname as Y2,isAbsolute as iU,join as B4,relative as aU,resolve as K4}from"path";var{Glob:S8}=globalThis.Bun;var J2=["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/**"],z$={targetRepo:".",budgets:{rootLines:120,nestedWarnLines:200},ignore:J2,intentionalDifferentPairs:[],knownCommands:[]};function G2($){if(!$)return z$;return{targetRepo:$.targetRepo??z$.targetRepo,budgets:{rootLines:$.budgets?.rootLines??z$.budgets.rootLines,nestedWarnLines:$.budgets?.nestedWarnLines??z$.budgets.nestedWarnLines},ignore:$.ignore??J2,intentionalDifferentPairs:$.intentionalDifferentPairs??[],knownCommands:$.knownCommands??[]}}import{existsSync as mU}from"fs";import{join as dU}from"path";function k0($){let X=[],Z=[];for(let z of $.traps){let q=gU($.response,z);if(q)X.push(q);else Z.push(z.id)}return{fired:X,avoided:Z}}function gU($,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 z=new RegExp(X.pattern,X.flags??"").exec($);if(!z)return null;return{id:X.id,reason:X.reason,matched:z[0],snippet:N8($,z.index,z[0].length),index:z.index}}return null}function N8($,X,Z){let z=Math.max(0,X-40),q=Math.min($.length,X+Z+40),J=$.slice(z,q).replace(/\s+/g," ").trim();if(z>0)J=`...${J}`;if(q<$.length)J=`${J}...`;return J}import T4 from"path";function hU($){return $.startsWith("http://")||$.startsWith("https://")}async function vU($,X,Z){let z=await fetch(X);if(!z.ok)throw Error(`Failed to fetch source "${$}" from ${X}: ${z.status} ${z.statusText}`);let q=await z.text();return{id:$,source:X,content:q,name:new URL(X).hostname+new URL(X).pathname,type:"url",auditTraps:Z}}async function uU($,X,Z,z){let q=T4.isAbsolute(X)?X:T4.resolve(Z,X),J=Bun.file(q);if(!await J.exists())throw Error(`Source "${$}" not found at ${q}`);let G=await J.text();return{id:$,source:X,content:G,name:T4.basename(q),type:"file",auditTraps:z}}async function A8($,X,Z){let{path:z,auditTraps:q}=V4(X);if(hU(z))return vU($,z,q);return uU($,z,Z,q)}async function l$($,X){let Z=Object.entries($);return await Promise.all(Z.map(([q,J])=>A8(q,J,X)))}async function j8($){if(!mU(dU($,"pickled.yml")))return{matches:[],findings:[]};let X=await Z$($),Z=X.docs?.sources;if(!Z||Object.keys(Z).length===0)return{matches:[],findings:[]};let z={};for(let[U,W]of Object.entries(Z)){let H=typeof W==="string"?W:W.path;if(H.startsWith("http://")||H.startsWith("https://"))continue;z[U]=W}if(Object.keys(z).length===0)return{matches:[],findings:[]};let q=[],J=new Map;for(let U of X.scenarios)for(let W of U.traps??[])q.push(W),J.set(W,W.auditSeverity??"warning");if(q.length===0)return{matches:[],findings:[]};let G=await l$(z,$),Q=[],Y=[];for(let U of G){let W=U.auditTraps;if(W===!1)continue;let H=Array.isArray(W)?new Set(W):null;for(let V of q){if(H?.has(V.id))continue;let{fired:B}=k0({response:U.content,traps:[V]}),L=B[0];if(!L)continue;let T=pU(U.content,L.index),K=J.get(V)??"warning";Q.push({sourceId:U.id,sourcePath:U.source,trapId:L.id,trapReason:L.reason,matched:L.matched,snippet:L.snippet,line:T,severity:K}),Y.push({severity:K,category:"trap-source-match",file:U.source,message:`source [${U.id}] matches trap '${L.id}' ("${L.matched}"). ${L.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 pU($,X){let Z=1,z=Math.min(X,$.length);for(let q=0;q<z;q++)if($[q]===`
187
+ `)Z++;return Z}var sU=["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=G2($),Z=K4(X.targetRepo);if(!q$(Z))throw Error(`targetRepo does not exist: ${Z}`);let z=new Set;for(let U of sU){let W=new S8(U);for await(let H of W.scan({cwd:Z,dot:!0,onlyFiles:!1,followSymlinks:!1})){if(X.ignore.some((L)=>new S8(L).match(H)))continue;let V=B4(Z,H),B=C8(V);if(B.isFile()){z.add(H);continue}if(B.isSymbolicLink())try{if(cU(V).isFile())z.add(H)}catch{}}}let q=[];for(let U of[...z].sort())q.push(await nU(Z,U,B4(Z,U),X));let J=QH(q,X),G=YH(q,J,X),{matches:Q,findings:Y}=await j8(Z);return{config:X,files:q,pairs:J,findings:[...G,...Y],sourceTrapMatches:Q}}async function nU($,X,Z,z){let J=C8(Z).isSymbolicLink(),G=null,Q=X;if(J){let V=lU(Z),B=iU(V)?V:K4(Y2(Z),V);if(G=B,q$(B))Q=aU($,B)}let Y=J&&G&&q$(G)?G:Z,U=Q2(Y,"utf8"),W=(U.match(/\n/g)??[]).length,H=U.endsWith(`
188
+ `)?W:W+1;return{relPath:X,absPath:Z,isSymlink:J,symlinkTarget:G,realRelPath:Q,lineCount:H,brokenPathRefs:oU(U,$,X),brokenImports:eU(U,Y2(Z)),unresolvedCommands:zH(U,$,z.knownCommands),sections:qH(U)}}function rU($){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 oU($,X,Z){let z=GH($),q=Y2(Z),J=rU(Z),G=new Set,Q=/`([^`\n]{2,200})`/g,Y;Y=Q.exec(z);while(Y!==null){let U=Y[1].trim().replace(/[#?].*$/,"");if(JH(U)&&!tU(X,U,q,J).found)G.add(U);Y=Q.exec(z)}return[...G].sort()}function tU($,X,Z,z){let q=[X];if(Z&&Z!==".")q.push(`${Z}/${X}`);if(z)q.push(`${z}/${X}`);q.push(`packages/${X}`,`apps/${X}`,`shared/${X}`);for(let J of q){let G=J.replace(/\/+/g,"/");if(q$(`${$}/${G}`))return{found:!0,resolvedAs:G}}return{found:!1}}function eU($,X){let Z=new Set,z=/@([\w./@~-]+\.md)/g,q;q=z.exec($);while(q!==null){let J=q[1];if(J.startsWith("~/")){q=z.exec($);continue}let G=J.startsWith("/")?J:K4(X,J);if(!q$(G))Z.add(J);q=z.exec($)}return[...Z].sort()}var $H=["bun","pnpm","npm","yarn"],XH=new Set(["install","add","remove","update","i","audit","list","ls","why","outdated","exec","run","create","init","x"]),ZH={bun:new Set(["build","test","link","unlink","upgrade"])};function zH($,X,Z){let z=new Set,q=B4(X,"package.json"),J=new Set;if(q$(q))try{let Q=JSON.parse(Q2(q,"utf8"));J=new Set(Object.keys(Q.scripts??{}))}catch{}let G=new Set(Z.map((Q)=>Q.trim()));for(let Q of $H){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(!J.has(W)&&!G.has(`${Q} ${W}`)&&!G.has(`${Q} run ${W}`)&&!XH.has(W)&&!ZH[Q]?.has(W))z.add(`${Q} ${W}`);U=Y.exec($)}}return[...z].sort()}function qH($){let X=$.split(`
189
+ `),Z=[],z=null;if(X.forEach((q,J)=>{if(/^##\s+/.test(q)){if(z)Z.push({header:z.header,lines:J-z.start});z={header:q.replace(/^##\s+/,"").trim(),start:J}}}),z){let q=z;Z.push({header:q.header,lines:X.length-q.start})}return Z.sort((q,J)=>J.lines-q.lines)}function JH($){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 QH($,X){let Z=new Map;for(let J of $){let G=J.relPath.split("/").pop()??"";if(G!=="AGENTS.md"&&G!=="CLAUDE.md")continue;let Q=Y2(J.relPath),Y=Z.get(Q)??{};if(G==="AGENTS.md")Y.agents=J;if(G==="CLAUDE.md")Y.claude=J;Z.set(Q,Y)}let z=new Set(X.intentionalDifferentPairs),q=[];for(let[J,G]of Z){let Q=!!G.agents,Y=!!G.claude;if(!Q&&!Y)continue;if(!Q||!Y){q.push({dir:J,agentsExists:Q,claudeExists:Y,classification:"single",detail:Q?"only AGENTS.md":"only CLAUDE.md"});continue}let{agents:U,claude:W}=G,H=`${U.relPath}:${W.relPath}`,V=`${W.relPath}:${U.relPath}`;if(z.has(H)||z.has(V)){q.push({dir:J,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 K=U.isSymlink?"CLAUDE.md":"AGENTS.md";q.push({dir:J,agentsExists:Q,claudeExists:Y,classification:"linked",detail:`canonical: ${K}`});continue}let L=Q2(U.absPath,"utf8"),T=Q2(W.absPath,"utf8");if(L===T)q.push({dir:J,agentsExists:Q,claudeExists:Y,classification:"unexpected-duplicate",detail:`byte-for-byte duplicate (${U.lineCount}L), not symlinked`});else q.push({dir:J,agentsExists:Q,claudeExists:Y,classification:"unexpected-duplicate",detail:`divergent (${U.lineCount}L vs ${W.lineCount}L), not in intentional-different allowlist`})}return q.sort((J,G)=>J.dir.localeCompare(G.dir)),q}function YH($,X,Z){let z=[];for(let q of $){if(q.isSymlink)continue;for(let Q of q.brokenImports)z.push({severity:"error",category:"broken-import",file:q.relPath,message:`broken @-import: ${Q}`});for(let Q of q.brokenPathRefs)z.push({severity:"error",category:"broken-path-ref",file:q.relPath,message:`broken path reference: ${Q}`});for(let Q of q.unresolvedCommands)z.push({severity:"warning",category:"unresolved-command",file:q.relPath,message:`unresolved command: ${Q}`});let J=!q.relPath.includes("/"),G=J?Z.budgets.rootLines:Z.budgets.nestedWarnLines;if(q.lineCount>G)z.push({severity:"warning",category:"over-budget",file:q.relPath,message:`${q.lineCount} lines exceeds ${J?"root":"nested"} budget of ${G}`})}for(let q of X)if(q.classification==="unexpected-duplicate"){let J=q.detail.startsWith("divergent")?"error":"warning";z.push({severity:J,category:J==="error"?"divergent-pair":"duplicate-pair",file:q.dir||"(root)",message:`AGENTS.md / CLAUDE.md ${q.detail}`})}return z}function f0($){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 L4($){let X=UH($);if(X===null)return[];let Z=[],z=/^\s*-\s+\[([^\]]+)\]\s*(.*)$/gm,q=z.exec(X);while(q!==null)Z.push({id:q[1].trim(),note:q[2].trim()||void 0}),q=z.exec(X);return Z}function UH($){let Z=/^##\s+Sources\s*$/im.exec($);if(!Z)return null;let z=Z.index+Z[0].length,q=$.slice(z),J=/^##\s+/m.exec(q);return J?q.slice(0,J.index):q}function c$($){let X=L4($.response),Z=new Set(X.map((V)=>V.id)),z=new Set($.registeredIds),q=new Set($.requiredSources),J=[...Z],G=[...q].filter((V)=>!Z.has(V)),Q=[...Z].filter((V)=>!z.has(V)),Y=[...q],U,W,H;if(J.length===0)U="NO",W=0,H="No citations in response";else if(Q.length===J.length)U="NO",W=0,H=`All cited sources are unknown: ${Q.join(", ")}`;else if(G.length===0&&Q.length===0)U="YES",W=100,H=Y.length>0?`All required sources cited: ${Y.join(", ")}`:`Cited registered sources: ${J.join(", ")}`;else{U="PARTIAL";let V=Y.length>0?Y.length:1,B=Y.length-G.length,L=Y.length>0?B/V*100:60,T=Q.length*15;W=Math.max(0,Math.min(100,Math.round(L-T)));let K=[];if(G.length>0)K.push(`missing: ${G.join(", ")}`);if(Q.length>0)K.push(`unknown: ${Q.join(", ")}`);H=K.join("; ")}return{answerable:U,confidence:W,reason:H,citations:{cited:J,required:Y,missing:G,unknown:Q}}}var g0="0.40.1";var E8=!1,h0=void 0,D4=void 0,HH=void 0,WH=void 0,VH=void 0,b8=void 0,TH=void 0,H2=void 0,_4=void 0,x8=void 0,F4=void 0,W2=void 0,y8=void 0;function k8($,X={auto:!1}){if(E8)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}'\``);E8=X.auto,h0=$.kind,D4=$.fetch,HH=$.Request,WH=$.Response,VH=$.Headers,b8=$.FormData,TH=$.Blob,H2=$.File,_4=$.ReadableStream,x8=$.getMultipartRequestOptions,F4=$.getDefaultAgent,W2=$.fileFromPath,y8=$.isFsReadStream}class M4{constructor($){this.body=$}get[Symbol.toStringTag](){return"MultipartBody"}}function f8({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,z,q,J;try{Z=fetch,z=Request,q=Response,J=Headers}catch(G){throw Error(`this environment is missing the following Web Fetch API type: ${G.message}. ${X}`)}return{kind:"web",fetch:Z,Request:z,Response:q,Headers:J,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(G,Q)=>({...Q,body:new M4(G)}),getDefaultAgent:(G)=>{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:(G)=>!1}}import{ReadStream as KH}from"fs";function g8(){let $=f8();function X(Z){return Z instanceof KH}return{...$,isFsReadStream:X}}var O4=()=>{if(!h0)k8(g8(),{auto:!0})};O4();class P extends Error{}class v extends P{constructor($,X,Z,z){super(`${v.makeMessage($,X,Z)}`);this.status=$,this.headers=z,this.request_id=z?.["request-id"],this.error=X}static makeMessage($,X,Z){let z=X?.message?typeof X.message==="string"?X.message:JSON.stringify(X.message):X?JSON.stringify(X):Z;if($&&z)return`${$} ${z}`;if($)return`${$} status code (no body)`;if(z)return z;return"(no status code or body)"}static generate($,X,Z,z){if(!$||!z)return new v0({message:Z,cause:M2(X)});let q=X;if($===400)return new V2($,q,Z,z);if($===401)return new T2($,q,Z,z);if($===403)return new B2($,q,Z,z);if($===404)return new K2($,q,Z,z);if($===409)return new L2($,q,Z,z);if($===422)return new D2($,q,Z,z);if($===429)return new _2($,q,Z,z);if($>=500)return new F2($,q,Z,z);return new v($,q,Z,z)}}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 B2 extends v{}class K2 extends v{}class L2 extends v{}class D2 extends v{}class _2 extends v{}class F2 extends v{}var O2=function($,X,Z,z,q){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!q:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?q.call($,Z):q?q.value=Z:X.set($,Z),Z},u0=function($,X,Z,z){if(Z==="a"&&!z)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?z:Z==="a"?z.call($):z?z.value:X.get($)},c;class R0{constructor(){c.set(this,void 0),this.buffer=new Uint8Array,O2(this,c,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 z=[],q;while((q=DH(this.buffer,u0(this,c,"f")))!=null){if(q.carriage&&u0(this,c,"f")==null){O2(this,c,q.index,"f");continue}if(u0(this,c,"f")!=null&&(q.index!==u0(this,c,"f")+1||q.carriage)){z.push(this.decodeText(this.buffer.slice(0,u0(this,c,"f")-1))),this.buffer=this.buffer.slice(u0(this,c,"f")),O2(this,c,null,"f");continue}let J=u0(this,c,"f")!==null?q.preceding-1:q.preceding,G=this.decodeText(this.buffer.slice(0,J));z.push(G),this.buffer=this.buffer.slice(q.index),O2(this,c,null,"f")}return z}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
+ `)}}c=new WeakMap;R0.NEWLINE_CHARS=new Set([`
191
+ `,"\r"]);R0.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function DH($,X){for(let q=X??0;q<$.length;q++){if($[q]===10)return{preceding:q,index:q+1,carriage:!1};if($[q]===13)return{preceding:q,index:q+1,carriage:!0}}return null}function h8($){for(let z=0;z<$.length-1;z++){if($[z]===10&&$[z+1]===10)return z+2;if($[z]===13&&$[z+1]===13)return z+2;if($[z]===13&&$[z+1]===10&&z+3<$.length&&$[z+2]===13&&$[z+3]===10)return z+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*z(){if(Z)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Z=!0;let q=!1;try{for await(let J of _H($,X)){if(J.event==="completion")try{yield JSON.parse(J.data)}catch(G){throw console.error("Could not parse message into JSON:",J.data),console.error("From chunk:",J.raw),G}if(J.event==="message_start"||J.event==="message_delta"||J.event==="message_stop"||J.event==="content_block_start"||J.event==="content_block_delta"||J.event==="content_block_stop")try{yield JSON.parse(J.data)}catch(G){throw console.error("Could not parse message into JSON:",J.data),console.error("From chunk:",J.raw),G}if(J.event==="ping")continue;if(J.event==="error")throw v.generate(void 0,`SSE Error: ${J.data}`,J.data,w4($.headers))}q=!0}catch(J){if(J instanceof Error&&J.name==="AbortError")return;throw J}finally{if(!q)X.abort()}}return new i(z,X)}static fromReadableStream($,X){let Z=!1;async function*z(){let J=new R0,G=a$($);for await(let Q of G)for(let Y of J.decode(Q))yield Y;for(let Q of J.flush())yield Q}async function*q(){if(Z)throw Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Z=!0;let J=!1;try{for await(let G of z()){if(J)continue;if(G)yield JSON.parse(G)}J=!0}catch(G){if(G instanceof Error&&G.name==="AbortError")return;throw G}finally{if(!J)X.abort()}}return new i(q,X)}[Symbol.asyncIterator](){return this.iterator()}tee(){let $=[],X=[],Z=this.iterator(),z=(q)=>{return{next:()=>{if(q.length===0){let J=Z.next();$.push(J),X.push(J)}return q.shift()}}};return[new i(()=>z($),this.controller),new i(()=>z(X),this.controller)]}toReadableStream(){let $=this,X,Z=new TextEncoder;return new _4({async start(){X=$[Symbol.asyncIterator]()},async pull(z){try{let{value:q,done:J}=await X.next();if(J)return z.close();let G=Z.encode(JSON.stringify(q)+`
192
+ `);z.enqueue(G)}catch(q){z.error(q)}},async cancel(){await X.return?.()}})}}async function*_H($,X){if(!$.body)throw X.abort(),new P("Attempted to iterate over a response with no body");let Z=new v8,z=new R0,q=a$($.body);for await(let J of FH(q))for(let G of z.decode(J)){let Q=Z.decode(G);if(Q)yield Q}for(let J of z.flush()){let G=Z.decode(J);if(G)yield G}}async function*FH($){let X=new Uint8Array;for await(let Z of $){if(Z==null)continue;let z=Z instanceof ArrayBuffer?new Uint8Array(Z):typeof Z==="string"?new TextEncoder().encode(Z):Z,q=new Uint8Array(X.length+z.length);q.set(X),q.set(z,X.length),X=q;let J;while((J=h8(X))!==-1)yield X.slice(0,J),X=X.slice(J)}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 q={event:this.event,data:this.data.join(`
193
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],q}if(this.chunks.push($),$.startsWith(":"))return null;let[X,Z,z]=MH($,":");if(z.startsWith(" "))z=z.substring(1);if(X==="event")this.event=z;else if(X==="data")this.data.push(z);return null}}function MH($,X){let Z=$.indexOf(X);if(Z!==-1)return[$.substring(0,Z),X,$.substring(Z+X.length)];return[$,"",""]}var OH=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function",wH=($)=>$!=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 $,wH($))return $;if(OH($)){let q=await $.blob();X||(X=new URL($.url).pathname.split(/[\\/]/).pop()??"unknown_file");let J=s$(q)?[await q.arrayBuffer()]:[q];return new H2(J,X,Z)}let z=await IH($);if(X||(X=PH($)??"unknown_file"),!Z?.type){let q=z[0]?.type;if(typeof q==="string")Z={...Z,type:q}}return new H2(z,X,Z)}async function IH($){let X=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)X.push($);else if(s$($))X.push(await $.arrayBuffer());else if(NH($))for await(let Z of $)X.push(Z);else throw Error(`Unexpected data type: ${typeof $}; constructor: ${$?.constructor?.name}; props: ${RH($)}`);return X}function RH($){return`[${Object.getOwnPropertyNames($).map((Z)=>`"${Z}"`).join(", ")}]`}function PH($){return I4($.name)||I4($.filename)||I4($.path)?.split(/[\\/]/).pop()}var I4=($)=>{if(typeof $==="string")return $;if(typeof Buffer<"u"&&$ instanceof Buffer)return String($);return},NH=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",R4=($)=>$&&typeof $==="object"&&$.body&&$[Symbol.toStringTag]==="MultipartBody";var jH=function($,X,Z,z,q){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!q:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?q.call($,Z):q?q.value=Z:X.set($,Z),Z},SH=function($,X,Z,z){if(Z==="a"&&!z)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?z:Z==="a"?z.call($):z?z.value:X.get($)},w2;O4();async function c8($){let{response:X}=$;if($.options.stream){if(J$("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 z=X.headers.get("content-type")?.split(";")[0]?.trim();if(z?.includes("application/json")||z?.endsWith("+json")){let G=await X.json();return J$("response",X.status,X.url,X.headers,G),i8(G,X)}let J=await X.text();return J$("response",X.status,X.url,X.headers,J),J}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=c8){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:z,fetch:q}){this.baseURL=$,this.maxRetries=P4("maxRetries",X),this.timeout=P4("timeout",Z),this.httpAgent=z,this.fetch=q??D4}authHeaders($){return{}}defaultHeaders($){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...xH(),...this.authHeaders($)}}validateHeaders($,X){}defaultIdempotencyKey(){return`stainless-node-retry-${hH()}`}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(z)=>{let q=z&&s$(z?.body)?new DataView(await z.body.arrayBuffer()):z?.body instanceof DataView?z.body:z?.body instanceof ArrayBuffer?new DataView(z.body):z&&ArrayBuffer.isView(z?.body)?new DataView(z.body.buffer):z?.body;return{method:$,path:X,...z,body:q}}))}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:z,path:q,query:J,headers:G={}}=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(q,J);if("timeout"in Z)P4("timeout",Z.timeout);Z.timeout=Z.timeout??this.timeout;let W=Z.httpAgent??this.httpAgent??F4(U),H=Z.timeout+1000;if(typeof W?.options?.timeout==="number"&&H>(W.options.timeout??0))W.options.timeout=H;if(this.idempotencyHeader&&z!=="get"){if(!$.idempotencyKey)$.idempotencyKey=this.defaultIdempotencyKey();G[this.idempotencyHeader]=$.idempotencyKey}let V=this.buildHeaders({options:Z,headers:G,contentLength:Y,retryCount:X});return{req:{method:z,...Q&&{body:Q},headers:V,...W&&{agent:W},signal:Z.signal??null},url:U,timeout:Z.timeout}}buildHeaders({options:$,headers:X,contentLength:Z,retryCount:z}){let q={};if(Z)q["content-length"]=Z;let J=this.defaultHeaders($);if(l8(q,J),l8(q,X),R4($.body)&&h0!=="node")delete q["content-type"];if(I2(J,"x-stainless-retry-count")===void 0&&I2(X,"x-stainless-retry-count")===void 0)q["x-stainless-retry-count"]=String(z);if(I2(J,"x-stainless-timeout")===void 0&&I2(X,"x-stainless-timeout")===void 0&&$.timeout)q["x-stainless-timeout"]=String(Math.trunc($.timeout/1000));return this.validateHeaders(q,X),q}_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,z){return v.generate($,X,Z,z)}request($,X=null){return new R2(this.makeRequest($,X))}async makeRequest($,X){let Z=await $,z=Z.maxRetries??this.maxRetries;if(X==null)X=z;await this.prepareOptions(Z);let{req:q,url:J,timeout:G}=this.buildRequest(Z,{retryCount:z-X});if(await this.prepareRequest(q,{url:J,options:Z}),J$("request",J,Z,q.headers),Z.signal?.aborted)throw new m;let Q=new AbortController,Y=await this.fetchWithTimeout(J,q,G,Q).catch(M2);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=w4(Y.headers);if(!Y.ok){if(X&&this.shouldRetry(Y)){let T=`retrying, ${X} attempts remaining`;return J$(`response (error; ${T})`,Y.status,J,U),this.retryRequest(Z,X,U)}let W=await Y.text().catch((T)=>M2(T).message),H=yH(W),V=H?void 0:W;throw J$(`response (error; ${X?"(error; no more retries left)":"(error; not retryable)"})`,Y.status,J,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):$)),z=this.defaultQuery();if(!s8(z))X={...z,...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,z){let{signal:q,...J}=X||{};if(q)q.addEventListener("abort",()=>z.abort());let G=setTimeout(()=>z.abort(),Z),Q={signal:z.signal,...J};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(G),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 z,q=Z?.["retry-after-ms"];if(q){let G=parseFloat(q);if(!Number.isNaN(G))z=G}let J=Z?.["retry-after"];if(J&&!z){let G=parseFloat(J);if(!Number.isNaN(G))z=G*1000;else z=Date.parse(J)-Date.now()}if(!(z&&0<=z&&z<60000)){let G=$.maxRetries??this.maxRetries;z=this.calculateDefaultRetryTimeoutMillis(X,G)}return await gH(z),this.makeRequest($,X-1)}calculateDefaultRetryTimeoutMillis($,X){let q=X-$,J=Math.min(0.5*Math.pow(2,q),8),G=1-Math.random()*0.25;return J*G*1000}getUserAgent(){return`${this.constructor.name}/JS ${g0}`}}class A4{constructor($,X,Z,z){w2.set(this,void 0),jH(this,w2,$,"f"),this.options=z,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[z,q]of Z)$.url.searchParams.set(z,q);X.query=void 0,X.path=$.url.toString()}return await SH(this,w2,"f").requestAPIList(this.constructor,X)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(w2=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(z)=>new Z($,z.response,await c8(z),z.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let X of $)yield X}}var w4=($)=>{return new Proxy(Object.fromEntries($.entries()),{get(X,Z){let z=Z.toString();return X[z.toLowerCase()]||X[z]}})},CH={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(CH,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 $=bH();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 bH(){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 z=Z.exec(navigator.userAgent);if(z){let q=z[1]||0,J=z[2]||0,G=z[3]||0;return{browser:X,version:`${q}.${J}.${G}`}}}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,xH=()=>{return p8??(p8=EH())},yH=($)=>{try{return JSON.parse($)}catch(X){return}},kH=/^[a-z][a-z0-9+.-]*:/i,fH=($)=>{return kH.test($)},gH=($)=>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},M2=($)=>{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 l8($,X){for(let Z in X){if(!n8(X,Z))continue;let z=Z.toLowerCase();if(!z)continue;let q=X[Z];if(q===null)delete $[z];else if(q!==void 0)$[z]=q}}function J$($,...X){if(typeof process<"u"&&process?.env?.DEBUG==="true")console.log(`Anthropic:DEBUG:${$}`,...X)}var hH=()=>{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"},vH=($)=>{return typeof $?.get==="function"};var I2=($,X)=>{let Z=X.toLowerCase();if(vH($)){let z=X[0]?.toUpperCase()+X.substring(1).replace(/([^\w])(\w)/g,(q,J,G)=>J+G.toUpperCase());for(let q of[X,Z,X.toUpperCase(),z]){let J=$.get(q);if(J)return J}}for(let[z,q]of Object.entries($))if(z.toLowerCase()===Z){if(Array.isArray(q)){if(q.length<=1)return q[0];return console.warn(`Received ${q.length} entries for the ${X} header, using the first entry.`),q[0]}return q}return};class W0 extends A4{constructor($,X,Z,z){super($,X,Z,z);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 G$ 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{}G$.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,...z}=$;return this._client.post("/v1/messages/batches?beta=true",{body:z,...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:z}=X;return this._client.get(`/v1/messages/batches/${$}?beta=true`,{...Z,headers:{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString(),...Z?.headers}})}list($={},X){if(r($))return this.list({},$);let{betas:Z,...z}=$;return this._client.getAPIList("/v1/messages/batches?beta=true",r$,{query:z,...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:z}=X;return this._client.delete(`/v1/messages/batches/${$}?beta=true`,{...Z,headers:{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString(),...Z?.headers}})}cancel($,X={},Z){if(r(X))return this.cancel($,{},X);let{betas:z}=X;return this._client.post(`/v1/messages/batches/${$}/cancel?beta=true`,{...Z,headers:{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString(),...Z?.headers}})}async results($,X={},Z){if(r(X))return this.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}`);let{betas:q}=X;return this._client.get(z.results_url,{...Z,headers:{"anthropic-beta":[...q??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary",...Z?.headers},stream:!0,__binaryResponse:!0})._thenUnwrap((J,G)=>Q$.fromResponse(G.response,G.controller))}}class r$ extends W0{}Y$.BetaMessageBatchesPage=r$;var pH=($)=>{let X=0,Z=[];while(X<$.length){let z=$[X];if(z==="\\"){X++;continue}if(z==="{"){Z.push({type:"brace",value:"{"}),X++;continue}if(z==="}"){Z.push({type:"brace",value:"}"}),X++;continue}if(z==="["){Z.push({type:"paren",value:"["}),X++;continue}if(z==="]"){Z.push({type:"paren",value:"]"}),X++;continue}if(z===":"){Z.push({type:"separator",value:":"}),X++;continue}if(z===","){Z.push({type:"delimiter",value:","}),X++;continue}if(z==='"'){let Q="",Y=!1;z=$[++X];while(z!=='"'){if(X===$.length){Y=!0;break}if(z==="\\"){if(X++,X===$.length){Y=!0;break}Q+=z+$[X],z=$[++X]}else Q+=z,z=$[++X]}if(z=$[++X],!Y)Z.push({type:"string",value:Q});continue}if(z&&/\s/.test(z)){X++;continue}let J=/[0-9]/;if(z&&J.test(z)||z==="-"||z==="."){let Q="";if(z==="-")Q+=z,z=$[++X];while(z&&J.test(z)||z===".")Q+=z,z=$[++X];Z.push({type:"number",value:Q});continue}let G=/[a-z]/i;if(z&&G.test(z)){let Q="";while(z&&G.test(z)){if(X===$.length)break;Q+=z,z=$[++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 z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),U$($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),U$($);break;case"delimiter":return $=$.slice(0,$.length-1),U$($);break}return $},lH=($)=>{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(lH(U$(pH($)))));var d=function($,X,Z,z,q){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!q:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?q.call($,Z):q?q.value=Z:X.set($,Z),Z},A=function($,X,Z,z){if(Z==="a"&&!z)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?z:Z==="a"?z.call($):z?z.value:X.get($)},o,P0,o$,A2,t$,e$,j2,$1,V0,X1,S2,C2,H$,E2,b2,j4,o8,S4,C4,E4,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),j2.set(this,()=>{}),$1.set(this,()=>{}),V0.set(this,{}),X1.set(this,!1),S2.set(this,!1),C2.set(this,!1),H$.set(this,!1),E2.set(this,void 0),b2.set(this,void 0),S4.set(this,($)=>{if(d(this,S2,!0,"f"),$ instanceof Error&&$.name==="AbortError")$=new m;if($ instanceof m)return d(this,C2,!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,j2,$,"f"),d(this,$1,X,"f")}),"f"),A(this,o$,"f").catch(()=>{}),A(this,e$,"f").catch(()=>{})}get response(){return A(this,E2,"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 z=new Z1;for(let q of X.messages)z._addMessageParam(q);return z._run(()=>z._createMessage($,{...X,stream:!0},{...Z,headers:{...Z?.headers,"X-Stainless-Helper-Method":"stream"}})),z}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},A(this,S4,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,X=!0){if(this.receivedMessages.push($),X)this._emit("message",$)}async _createMessage($,X,Z){let z=Z?.signal;if(z){if(z.aborted)this.controller.abort();z.addEventListener("abort",()=>this.controller.abort())}A(this,o,"m",C4).call(this);let{response:q,data:J}=await $.create({...X,stream:!0},{...Z,signal:this.controller.signal}).withResponse();this._connected(q);for await(let G of J)A(this,o,"m",E4).call(this,G);if(J.controller.signal?.aborted)throw new m;A(this,o,"m",b4).call(this)}_connected($){if(this.ended)return;d(this,E2,$,"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,S2,"f")}get aborted(){return A(this,C2,"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 z=Z.findIndex((q)=>q.listener===X);if(z>=0)Z.splice(z,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",j4).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,j2,"f").call(this);let Z=A(this,V0,"f")[$];if(Z)A(this,V0,"f")[$]=Z.filter((z)=>!z.once),Z.forEach(({listener:z})=>z(...X));if($==="abort"){let z=X[0];if(!A(this,H$,"f")&&!Z?.length)Promise.reject(z);A(this,t$,"f").call(this,z),A(this,$1,"f").call(this,z),this._emit("end");return}if($==="error"){let z=X[0];if(!A(this,H$,"f")&&!Z?.length)Promise.reject(z);A(this,t$,"f").call(this,z),A(this,$1,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",A(this,o,"m",j4).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",C4).call(this),this._connected(null);let z=i.fromReadableStream($,this.controller);for await(let q of z)A(this,o,"m",E4).call(this,q);if(z.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,j2=new WeakMap,$1=new WeakMap,V0=new WeakMap,X1=new WeakMap,S2=new WeakMap,C2=new WeakMap,H$=new WeakMap,E2=new WeakMap,b2=new WeakMap,S4=new WeakMap,o=new WeakSet,j4=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(" ")},C4=function(){if(this.ended)return;d(this,P0,void 0,"f")},E4=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 z=Z.content.at(-1);switch(X.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",X.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",X.delta.citation,z.citations??[]);break}case"input_json_delta":{if(z.type==="tool_use"&&z.input)this._emit("inputJson",X.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",X.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.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 z=Z.content.at(X.index);switch(X.delta.type){case"text_delta":{if(z?.type==="text")z.text+=X.delta.text;break}case"citations_delta":{if(z?.type==="text")z.citations??(z.citations=[]),z.citations.push(X.delta.citation);break}case"input_json_delta":{if(z?.type==="tool_use"){let q=z[e8]||"";if(q+=X.delta.partial_json,Object.defineProperty(z,e8,{value:q,enumerable:!1,writable:!0}),q)z.input=N2(q)}break}case"thinking_delta":{if(z?.type==="thinking")z.thinking+=X.delta.thinking;break}case"signature_delta":{if(z?.type==="thinking")z.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",(z)=>{let q=X.shift();if(q)q.resolve(z);else $.push(z)}),this.on("end",()=>{Z=!0;for(let z of X)z.resolve(void 0);X.length=0}),this.on("abort",(z)=>{Z=!0;for(let q of X)q.reject(z);X.length=0}),this.on("error",(z)=>{Z=!0;for(let q of X)q.reject(z);X.length=0}),{next:async()=>{if(!$.length){if(Z)return{value:void 0,done:!0};return new Promise((q,J)=>X.push({resolve:q,reject:J})).then((q)=>q?{value:q,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,...z}=$;if(z.model in XZ)console.warn(`The model '${z.model}' is deprecated and will reach end-of-life on ${XZ[z.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:z,timeout:this._client._options.timeout??(z.stream?600000:this._client._calculateNonstreamingTimeout(z.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,...z}=$;return this._client.post("/v1/messages/count_tokens?beta=true",{body:z,...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 G$(this._client),this.messages=new m0(this._client)}}T0.Models=G$;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",z1,{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((z,q)=>Q$.fromResponse(q.response,q.controller))}}class z1 extends W0{}V$.MessageBatchesPage=z1;var p=function($,X,Z,z,q){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!q:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?q.call($,Z):q?q.value=Z:X.set($,Z),Z},j=function($,X,Z,z){if(Z==="a"&&!z)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!z:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?z:Z==="a"?z.call($):z?z.value:X.get($)},t,N0,q1,x2,J1,G1,y2,Q1,B0,Y1,k2,f2,T$,g2,h2,x4,ZZ,y4,k4,f4,g4,zZ,qZ="__json_buf";class U1{constructor(){t.add(this),this.messages=[],this.receivedMessages=[],N0.set(this,void 0),this.controller=new AbortController,q1.set(this,void 0),x2.set(this,()=>{}),J1.set(this,()=>{}),G1.set(this,void 0),y2.set(this,()=>{}),Q1.set(this,()=>{}),B0.set(this,{}),Y1.set(this,!1),k2.set(this,!1),f2.set(this,!1),T$.set(this,!1),g2.set(this,void 0),h2.set(this,void 0),y4.set(this,($)=>{if(p(this,k2,!0,"f"),$ instanceof Error&&$.name==="AbortError")$=new m;if($ instanceof m)return p(this,f2,!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,q1,new Promise(($,X)=>{p(this,x2,$,"f"),p(this,J1,X,"f")}),"f"),p(this,G1,new Promise(($,X)=>{p(this,y2,$,"f"),p(this,Q1,X,"f")}),"f"),j(this,q1,"f").catch(()=>{}),j(this,G1,"f").catch(()=>{})}get response(){return j(this,g2,"f")}get request_id(){return j(this,h2,"f")}async withResponse(){let $=await j(this,q1,"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 z=new U1;for(let q of X.messages)z._addMessageParam(q);return z._run(()=>z._createMessage($,{...X,stream:!0},{...Z,headers:{...Z?.headers,"X-Stainless-Helper-Method":"stream"}})),z}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},j(this,y4,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,X=!0){if(this.receivedMessages.push($),X)this._emit("message",$)}async _createMessage($,X,Z){let z=Z?.signal;if(z){if(z.aborted)this.controller.abort();z.addEventListener("abort",()=>this.controller.abort())}j(this,t,"m",k4).call(this);let{response:q,data:J}=await $.create({...X,stream:!0},{...Z,signal:this.controller.signal}).withResponse();this._connected(q);for await(let G of J)j(this,t,"m",f4).call(this,G);if(J.controller.signal?.aborted)throw new m;j(this,t,"m",g4).call(this)}_connected($){if(this.ended)return;p(this,g2,$,"f"),p(this,h2,$?.headers.get("request-id"),"f"),j(this,x2,"f").call(this,$),this._emit("connect")}get ended(){return j(this,Y1,"f")}get errored(){return j(this,k2,"f")}get aborted(){return j(this,f2,"f")}abort(){this.controller.abort()}on($,X){return(j(this,B0,"f")[$]||(j(this,B0,"f")[$]=[])).push({listener:X}),this}off($,X){let Z=j(this,B0,"f")[$];if(!Z)return this;let z=Z.findIndex((q)=>q.listener===X);if(z>=0)Z.splice(z,1);return this}once($,X){return(j(this,B0,"f")[$]||(j(this,B0,"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 j(this,G1,"f")}get currentMessage(){return j(this,N0,"f")}async finalMessage(){return await this.done(),j(this,t,"m",x4).call(this)}async finalText(){return await this.done(),j(this,t,"m",ZZ).call(this)}_emit($,...X){if(j(this,Y1,"f"))return;if($==="end")p(this,Y1,!0,"f"),j(this,y2,"f").call(this);let Z=j(this,B0,"f")[$];if(Z)j(this,B0,"f")[$]=Z.filter((z)=>!z.once),Z.forEach(({listener:z})=>z(...X));if($==="abort"){let z=X[0];if(!j(this,T$,"f")&&!Z?.length)Promise.reject(z);j(this,J1,"f").call(this,z),j(this,Q1,"f").call(this,z),this._emit("end");return}if($==="error"){let z=X[0];if(!j(this,T$,"f")&&!Z?.length)Promise.reject(z);j(this,J1,"f").call(this,z),j(this,Q1,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",j(this,t,"m",x4).call(this))}async _fromReadableStream($,X){let Z=X?.signal;if(Z){if(Z.aborted)this.controller.abort();Z.addEventListener("abort",()=>this.controller.abort())}j(this,t,"m",k4).call(this),this._connected(null);let z=i.fromReadableStream($,this.controller);for await(let q of z)j(this,t,"m",f4).call(this,q);if(z.controller.signal?.aborted)throw new m;j(this,t,"m",g4).call(this)}[(N0=new WeakMap,q1=new WeakMap,x2=new WeakMap,J1=new WeakMap,G1=new WeakMap,y2=new WeakMap,Q1=new WeakMap,B0=new WeakMap,Y1=new WeakMap,k2=new WeakMap,f2=new WeakMap,T$=new WeakMap,g2=new WeakMap,h2=new WeakMap,y4=new WeakMap,t=new WeakSet,x4=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(" ")},k4=function(){if(this.ended)return;p(this,N0,void 0,"f")},f4=function(X){if(this.ended)return;let Z=j(this,t,"m",zZ).call(this,X);switch(this._emit("streamEvent",X,Z),X.type){case"content_block_delta":{let z=Z.content.at(-1);switch(X.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",X.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",X.delta.citation,z.citations??[]);break}case"input_json_delta":{if(z.type==="tool_use"&&z.input)this._emit("inputJson",X.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",X.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.signature);break}default:JZ(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=j(this,N0,"f");if(!X)throw new P("request ended without sending any chunks");return p(this,N0,void 0,"f"),X},zZ=function(X){let Z=j(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 z=Z.content.at(X.index);switch(X.delta.type){case"text_delta":{if(z?.type==="text")z.text+=X.delta.text;break}case"citations_delta":{if(z?.type==="text")z.citations??(z.citations=[]),z.citations.push(X.delta.citation);break}case"input_json_delta":{if(z?.type==="tool_use"){let q=z[qZ]||"";if(q+=X.delta.partial_json,Object.defineProperty(z,qZ,{value:q,enumerable:!1,writable:!0}),q)z.input=N2(q)}break}case"thinking_delta":{if(z?.type==="thinking")z.thinking+=X.delta.thinking;break}case"signature_delta":{if(z?.type==="thinking")z.signature=X.delta.signature;break}default:JZ(X.delta)}return Z}case"content_block_stop":return Z}},Symbol.asyncIterator)](){let $=[],X=[],Z=!1;return this.on("streamEvent",(z)=>{let q=X.shift();if(q)q.resolve(z);else $.push(z)}),this.on("end",()=>{Z=!0;for(let z of X)z.resolve(void 0);X.length=0}),this.on("abort",(z)=>{Z=!0;for(let q of X)q.reject(z);X.length=0}),this.on("error",(z)=>{Z=!0;for(let q of X)q.reject(z);X.length=0}),{next:async()=>{if(!$.length){if(Z)return{value:void 0,done:!0};return new Promise((q,J)=>X.push({resolve:q,reject:J})).then((q)=>q?{value:q,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 JZ($){}class A0 extends u{constructor(){super(...arguments);this.batches=new V$(this._client)}create($,X){if($.model in GZ)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${GZ[$.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 GZ={"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=z1;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",B$,{query:$,...X})}}class B$ extends W0{}d0.ModelInfosPage=B$;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,...z}={}){let q={apiKey:X,authToken:Z,...z,baseURL:$||"https://api.anthropic.com"};if(!q.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:q.baseURL,timeout:q.timeout??600000,httpAgent:q.httpAgent,maxRetries:q.maxRetries,fetch:q.fetch});this.completions=new W$(this),this.messages=new A0(this),this.models=new d0(this),this.beta=new T0(this),this._options=q,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=K2;b.ConflictError=L2;b.RateLimitError=_2;b.BadRequestError=V2;b.AuthenticationError=T2;b.InternalServerError=F2;b.PermissionDeniedError=B2;b.UnprocessableEntityError=D2;b.toFile=u8;b.fileFromPath=W2;b.Completions=W$;b.Messages=A0;b.Models=d0;b.ModelInfosPage=B$;b.Beta=T0;var YZ=b;function K$($,X,Z){let z=X.length>0?X.map((G)=>`- ${G.id}: ${G.name} (${G.source})`).join(`
207
+ `):"(no sources provided)",q=X.map((G)=>`<source id="${G.id}">
208
+ ${G.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
+ `),J=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
+ ${z}
200
217
 
201
- ${Z}
218
+ ${q}
202
219
 
203
- ${H}
220
+ ${J}
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:z,requiredSources:q}=X;if(!this.config.model)throw Error(`API target "${this.name}" missing 'model'. API targets must declare an explicit model.`);let J=K$(Z,z,q),Q=await this.clientFactory().messages.create({model:this.config.model,max_tokens:this.config.maxTokens??4096,temperature:this.config.temperature??0,system:J,messages:[{role:"user",content:$}]}),Y=nH(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 nH($){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 rH}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:z,context:q,docs:J,requiredSources:G}=X,Q=[],Y=[],U=K$(Z,J,G),W={cwd:z,model:this.config.model??"sonnet",systemPrompt:U,allowedTools:q?.allowedTools??this.config.allowedTools??t2,disallowedTools:q?.disallowedTools??this.config.disallowedTools??e2,permissionMode:this.config.permissionMode??"acceptEdits",maxTurns:this.config.maxTurns??10,maxThinkingTokens:this.config.maxThinkingTokens,maxBudgetUsd:this.config.maxBudgetUsd,mcpServers:q?.mcpServers??this.config.mcpServers,settingSources:[]},H=[],V="",B="";for await(let L of rH({prompt:$,options:W})){if(L.type==="assistant"){let T=L.message?.content;if(Array.isArray(T)){let K="";for(let _ of T){if(_.type==="text")K+=_.text;if(_.type==="tool_use"){let F=_;if(!Q.includes(F.name))Q.push(F.name)}}if(K){let _=H.length===0?"initial":"intermediate";H.push({type:_,text:K}),V=K}}}if(L.type==="result"){let T=L;if(T.result)B=T.result}}if(H.length>0)H[H.length-1].type="final";return{response:B||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 oH}from"crypto";import{rm as tH}from"fs/promises";import{tmpdir as eH}from"os";import{join as $W}from"path";var XW="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??JW,this.readFileFn=Z.readFile??GW,this.binary=Z.binary??XW}async run($,X){let{tool:Z,cwd:z,docs:q,requiredSources:J}=X,G=this.config.model;if(!G)throw Error(`CodexCliTarget "${this.name}" requires an explicit model. Validation should have caught this at config load.`);let Y=`${K$(Z,q,J)}
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=$W(eH(),`pickled-codex-${oH()}.txt`),W=["--ask-for-approval","never","exec","--json","--sandbox","read-only","--ignore-user-config","--ignore-rules","--ephemeral","--skip-git-repo-check","--cd",z,"--model",G,"--output-last-message",U,"-"];try{let H=await this.spawnFn(this.binary,W,{cwd:z,stdin:Y}),{allResponses:V,toolsUsed:B}=ZW(H.stdout);if(H.exitCode!==0)throw Error(`codex exec failed (exit ${H.exitCode}): ${H.stderr.trim()||"no stderr output"}`);let L="";try{L=(await this.readFileFn(U)).trim()}catch{L=V.length>0?V[V.length-1].text:""}if(V.length>0)V[V.length-1].type="final";return{response:L,allResponses:V,toolsUsed:B,sources:[],metadata:{model:G,category:this.category,provider:this.provider,target:this.name}}}finally{await tH(U,{force:!0})}}}function ZW($){let X=[],Z=[];for(let z of $.split(`
236
+ `)){let q=z.trim();if(!q)continue;let J;try{J=JSON.parse(q)}catch{continue}let G=zW(J);if(G){let Y=X.length===0?"initial":"intermediate";X.push({type:Y,text:G})}let Q=qW(J);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 JW=async($,X,Z)=>{let z=Bun.spawn([$,...X],{cwd:Z.cwd,stdin:"pipe",stdout:"pipe",stderr:"pipe"});z.stdin.write(Z.stdin),await z.stdin.end();let[q,J,G]=await Promise.all([new Response(z.stdout).text(),new Response(z.stderr).text(),z.exited]);return{exitCode:G,stdout:q,stderr:J}},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??q0;switch(Z.category){case"cli":return QW($,Z);case"api":return YW($,Z);case"ide":throw Error("IDE targets not yet implemented. Coming soon!");default:throw Error(`Unknown target category: ${Z.category}`)}}function QW($,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 YW($,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 L$="default";function d4($,X){if(!$||$===L$)return{name:L$,config:q0};if(X?.[$])return{name:$,config:X[$]};return console.warn(`Target "${$}" not found, using default`),{name:L$,config:q0}}function UZ($,X){if(!$||$===L$)return{name:L$,config:{}};if(X?.[$])return{name:$,config:X[$]};return console.warn(`Context "${$}" not found, using default`),{name:L$,config:{}}}function UW($){let X=[],Z=$.matrix?.target??["default"],z=$.matrix?.context??["default"];for(let q of $.scenarios){let J=q.target?[q.target]:Z,G=q.context?[q.context]:z;for(let Q of J)for(let Y of G)X.push({scenario:q,targetName:Q,contextName:Y})}return X}async function p4($,X,Z={}){let{onProgress:z}=Z,q=[];if(X.scenarios.length===0)throw Error("No scenarios defined in config");let J=X.docs?.sources??{},G=[];if(Object.keys(J).length>0){z?.("Loading sources..."),G=await l$(J,$.path);for(let W of G)z?.(` [${W.id}] ${W.name}`);z?.("")}let Q=G.map((W)=>W.id),Y=UW(X),U="";for(let{scenario:W,targetName:H,contextName:V}of Y){let B=HW(H,V);if(W.name!==U){if(U)z?.("");z?.(`"${W.name}"`),U=W.name}try{let L=await WW(W,H,V,$,X,G,Q,Z);q.push(L);let T=B?B.padEnd(18):"";if(L.surfaces){z?.(` ${T} (compare-surfaces mode)`);for(let K of L.surfaces){let _=f0(K),F=` [${K.active.join(",")}]`.padEnd(22);z?.(`${F} ${_.icon} ${_.label} (${_.confidence}%)`)}}else{let K=f0({answerable:L.answerable??"NO",confidence:L.confidence??0,traps:L.traps??{fired:[],avoided:[]},error:L.error});z?.(` ${T} ${K.icon} ${K.label} (${K.confidence}%)`)}}catch(L){let T=H==="default"?q0:X.targets?.[H]??q0,K={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((F)=>F.id)},error:L instanceof Error?L.message:String(L),target:{target:H,category:T.category,provider:T.provider,model:T.model??"unknown"},context:{name:V}};q.push(K);let _=B?B.padEnd(18):"";z?.(` ${_} \u2717 Error`)}}return z?.(""),VW($,G,q)}function HW($,X){if($==="default"&&X==="default")return"";if(X==="default")return`[${$}]`;return`[${$}/${X}]`}async function WW($,X,Z,z,q,J,G,Q){let{config:Y}=d4(X,q.targets),{config:U}=UZ(Z,q.contexts),W=Q.targetFactory?Q.targetFactory(X,Y):m4(X,Y);if($.compareSurfaces&&$.compareSurfaces.length>0){let F=[],O;for(let I of $.compareSurfaces){let R=new Set(I),N=J.filter((p0)=>R.has(p0.id)),E=$.requiredSources.filter((p0)=>R.has(p0)),M=await W.run($.prompt,{tool:z,cwd:z.path,context:U,docs:N,requiredSources:E,onProgress:Q.onProgress}),x=c$({response:M.response,requiredSources:E,registeredIds:I}),a=k0({response:M.response,traps:$.traps??[]}),z0=a.fired.length>0,f=z0?"NO":x.answerable,V1=z0?0:x.confidence,bZ=z0?`Trap fired: ${a.fired.map((p0)=>`"${p0.id}" (${p0.reason})`).join("; ")}`:x.reason;F.push({active:I,answerable:f,confidence:V1,response:M.response,reason:bZ,citations:x.citations,traps:a,allResponses:M.allResponses}),O=M.metadata??O}return{scenario:$,answerable:null,confidence:null,response:null,reason:null,citations:null,traps:null,surfaces:F,target:O,context:{name:Z}}}let H=await W.run($.prompt,{tool:z,cwd:z.path,context:U,docs:J,requiredSources:$.requiredSources,onProgress:Q.onProgress}),V=c$({response:H.response,requiredSources:$.requiredSources,registeredIds:G}),B=k0({response:H.response,traps:$.traps??[]}),L=B.fired.length>0,T=L?"NO":V.answerable,K=L?0:V.confidence,_=L?`Trap fired: ${B.fired.map((F)=>`"${F.id}" (${F.reason})`).join("; ")}`:V.reason;return{scenario:$,answerable:T,confidence:K,response:H.response,reason:_,citations:V.citations,traps:B,target:H.metadata,context:{name:Z},toolsUsed:H.toolsUsed,sources:H.sources,allResponses:H.allResponses}}function VW($,X,Z){let z=[];for(let Q of Z){if(Q.surfaces){for(let Y of Q.surfaces)z.push({answerable:Y.answerable,confidence:Y.confidence});continue}if(Q.answerable!==null&&Q.confidence!==null)z.push({answerable:Q.answerable,confidence:Q.confidence})}let q=z.length,J=z.filter((Q)=>Q.answerable==="YES"||Q.answerable==="PARTIAL").length,G=q>0?Math.round(z.reduce((Q,Y)=>{if(Y.answerable==="YES")return Q+Y.confidence;if(Y.answerable==="PARTIAL")return Q+Y.confidence*0.5;return Q},0)/q):0;return{tool:{name:$.name,description:$.description,path:$.path},docs:X,scenarios:Z,summary:{total:q,answered:J,unanswered:q-J,score:G}}}var HZ=($=0)=>(X)=>`\x1B[${X+$}m`,WZ=($=0)=>(X)=>`\x1B[${38+$};5;${X}m`,VZ=($=0)=>(X,Z,z)=>`\x1B[${38+$};2;${X};${Z};${z}m`,y={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]}},QL=Object.keys(y.modifier),TW=Object.keys(y.color),BW=Object.keys(y.bgColor),YL=[...TW,...BW];function KW(){let $=new Map;for(let[X,Z]of Object.entries(y)){for(let[z,q]of Object.entries(Z))y[z]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},Z[z]=y[z],$.set(q[0],q[1]);Object.defineProperty(y,X,{value:Z,enumerable:!1})}return Object.defineProperty(y,"codes",{value:$,enumerable:!1}),y.color.close="\x1B[39m",y.bgColor.close="\x1B[49m",y.color.ansi=HZ(),y.color.ansi256=WZ(),y.color.ansi16m=VZ(),y.bgColor.ansi=HZ(10),y.bgColor.ansi256=WZ(10),y.bgColor.ansi16m=VZ(10),Object.defineProperties(y,{rgbToAnsi256:{value(X,Z,z){if(X===Z&&Z===z){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(z/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[z]=Z;if(z.length===3)z=[...z].map((J)=>J+J).join("");let q=Number.parseInt(z,16);return[q>>16&255,q>>8&255,q&255]},enumerable:!1},hexToAnsi256:{value:(X)=>y.rgbToAnsi256(...y.hexToRgb(X)),enumerable:!1},ansi256ToAnsi:{value(X){if(X<8)return 30+X;if(X<16)return 90+(X-8);let Z,z,q;if(X>=232)Z=((X-232)*10+8)/255,z=Z,q=Z;else{X-=16;let Q=X%36;Z=Math.floor(X/36)/5,z=Math.floor(Q/6)/5,q=Q%6/5}let J=Math.max(Z,z,q)*2;if(J===0)return 30;let G=30+(Math.round(q)<<2|Math.round(z)<<1|Math.round(Z));if(J===2)G+=60;return G},enumerable:!1},rgbToAnsi:{value:(X,Z,z)=>y.ansi256ToAnsi(y.rgbToAnsi256(X,Z,z)),enumerable:!1},hexToAnsi:{value:(X)=>y.ansi256ToAnsi(y.hexToAnsi256(X)),enumerable:!1}}),y}var LW=KW(),Z0=LW;import l4 from"process";import DW from"os";import TZ from"tty";function e($,X=globalThis.Deno?globalThis.Deno.args:l4.argv){let Z=$.startsWith("-")?"":$.length===1?"-":"--",z=X.indexOf(Z+$),q=X.indexOf("--");return z!==-1&&(q===-1||z<q)}var{env:k}=l4,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 _W(){if("FORCE_COLOR"in k){if(k.FORCE_COLOR==="true")return 1;if(k.FORCE_COLOR==="false")return 0;return k.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(k.FORCE_COLOR,10),3)}}function FW($){if($===0)return!1;return{level:$,hasBasic:!0,has256:$>=2,has16m:$>=3}}function MW($,{streamIsTTY:X,sniffFlags:Z=!0}={}){let z=_W();if(z!==void 0)v2=z;let q=Z?v2:z;if(q===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 k&&"AGENT_NAME"in k)return 1;if($&&!X&&q===void 0)return 0;let J=q||0;if(k.TERM==="dumb")return J;if(l4.platform==="win32"){let G=DW.release().split(".");if(Number(G[0])>=10&&Number(G[2])>=10586)return Number(G[2])>=14931?3:2;return 1}if("CI"in k){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((G)=>(G in k)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((G)=>(G in k))||k.CI_NAME==="codeship")return 1;return J}if("TEAMCITY_VERSION"in k)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(k.TEAMCITY_VERSION)?1:0;if(k.COLORTERM==="truecolor")return 3;if(k.TERM==="xterm-kitty")return 3;if(k.TERM==="xterm-ghostty")return 3;if(k.TERM==="wezterm")return 3;if("TERM_PROGRAM"in k){let G=Number.parseInt((k.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(k.TERM_PROGRAM){case"iTerm.app":return G>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(k.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(k.TERM))return 1;if("COLORTERM"in k)return 1;return J}function BZ($,X={}){let Z=MW($,{streamIsTTY:$&&$.isTTY,...X});return FW(Z)}var OW={stdout:BZ({isTTY:TZ.isatty(1)}),stderr:BZ({isTTY:TZ.isatty(2)})},KZ=OW;function LZ($,X,Z){let z=$.indexOf(X);if(z===-1)return $;let q=X.length,J=0,G="";do G+=$.slice(J,z)+X+Z,J=z+q,z=$.indexOf(X,J);while(z!==-1);return G+=$.slice(J),G}function DZ($,X,Z,z){let q=0,J="";do{let G=$[z-1]==="\r";J+=$.slice(q,G?z-1:z)+X+(G?`\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,q=z+1,z=$.indexOf(`
239
+ `,q)}while(z!==-1);return J+=$.slice(q),J}var{stdout:_Z,stderr:FZ}=KZ,c4=Symbol("GENERATOR"),D$=Symbol("STYLER"),H1=Symbol("IS_EMPTY"),MZ=["ansi","ansi","ansi256","ansi16m"],_$=Object.create(null),wW=($,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=_Z?_Z.level:0;$.level=X.level===void 0?Z:X.level};var IW=($)=>{let X=(...Z)=>Z.join(" ");return wW(X,$),Object.setPrototypeOf(X,W1.prototype),X};function W1($){return IW($)}Object.setPrototypeOf(W1.prototype,Function.prototype);for(let[$,X]of Object.entries(Z0))_$[$]={get(){let Z=u2(this,a4(X.open,X.close,this[D$]),this[H1]);return Object.defineProperty(this,$,{value:Z}),Z}};_$.visible={get(){let $=u2(this,this[D$],!0);return Object.defineProperty(this,"visible",{value:$}),$}};var i4=($,X,Z,...z)=>{if($==="rgb"){if(X==="ansi16m")return Z0[Z].ansi16m(...z);if(X==="ansi256")return Z0[Z].ansi256(Z0.rgbToAnsi256(...z));return Z0[Z].ansi(Z0.rgbToAnsi(...z))}if($==="hex")return i4("rgb",X,Z,...Z0.hexToRgb(...z));return Z0[Z][$](...z)},RW=["rgb","hex","ansi256"];for(let $ of RW){_$[$]={get(){let{level:Z}=this;return function(...z){let q=a4(i4($,MZ[Z],"color",...z),Z0.color.close,this[D$]);return u2(this,q,this[H1])}}};let X="bg"+$[0].toUpperCase()+$.slice(1);_$[X]={get(){let{level:Z}=this;return function(...z){let q=a4(i4($,MZ[Z],"bgColor",...z),Z0.bgColor.close,this[D$]);return u2(this,q,this[H1])}}}}var PW=Object.defineProperties(()=>{},{..._$,level:{enumerable:!0,get(){return this[c4].level},set($){this[c4].level=$}}}),a4=($,X,Z)=>{let z,q;if(Z===void 0)z=$,q=X;else z=Z.openAll+$,q=X+Z.closeAll;return{open:$,close:X,openAll:z,closeAll:q,parent:Z}},u2=($,X,Z)=>{let z=(...q)=>NW(z,q.length===1?""+q[0]:q.join(" "));return Object.setPrototypeOf(z,PW),z[c4]=$,z[D$]=X,z[H1]=Z,z},NW=($,X)=>{if($.level<=0||!X)return $[H1]?"":X;let Z=$[D$];if(Z===void 0)return X;let{openAll:z,closeAll:q}=Z;if(X.includes("\x1B"))while(Z!==void 0)X=LZ(X,Z.close,Z.open),Z=Z.parent;let J=X.indexOf(`
240
+ `);if(J!==-1)X=DZ(X,q,z,J);return z+X+q};Object.defineProperties(W1.prototype,_$);var AW=W1(),_L=W1({level:FZ?FZ.level:0});var w=AW;var OZ="\u2500".repeat(55);function PZ($){if($==="success")return w.green;if($==="warning")return w.yellow;return w.red}function jW($){if($>=70)return w.green;if($>=50)return w.yellow;return w.red}function NZ($){if($.label==="Error")return $.label;return`${$.label} (${$.confidence}%)`}function SW($){let X=f0({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 CW($){let X=$.target?.target??"default",Z=$.context?.name??"default";if(X==="default"&&Z==="default")return"";if(Z==="default")return w.dim(`[${X}]`);return w.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(w.dim(`${X}error: ${$.error}`)),Z;if($.traps.fired.length>0)for(let z of $.traps.fired)Z.push(w.red(`${X}trap: ${z.id}`)),Z.push(w.dim(`${X}reason: ${z.reason}`)),Z.push(w.dim(`${X}match: "${z.matched}"`));else if($.reason&&$.answerable!=="YES")Z.push(w.dim(`${X}reason: ${$.reason}`));if($.citations.cited.length>0)Z.push(w.dim(`${X}cited: ${m2($.citations.cited)}`));if($.citations.missing.length>0)Z.push(w.dim(`${X}missing: ${m2($.citations.missing)}`));if($.citations.unknown.length>0)Z.push(w.dim(`${X}unknown: ${m2($.citations.unknown)}`));return Z}function wZ($,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:z}=SW($),q=CW($),J=`${X} ${Z}`;return q?`${q} ${z(J)}`:z(J)}function RZ($,X){if(!$.surfaces)return[];let Z=[];Z.push(`${X}${w.dim("Citations scoped to active surface (compare mode)")}`);for(let z of $.surfaces){let q=f0(z),J=PZ(q.tone),G=w.dim(`[${z.active.join(",")}]`),Q=`${J(q.icon)} ${J(NZ(q))}`;Z.push(`${X}${G} ${Q}`),Z.push(...AZ({traps:z.traps,reason:z.reason,answerable:z.answerable,citations:z.citations},`${X} `))}return Z}function bW($){let X=0,Z=0,z=0;for(let q of $){if(q.surfaces){for(let J of q.surfaces)X+=J.traps.fired.length,Z+=J.citations.missing.length,z+=J.citations.unknown.length;continue}if(q.traps)X+=q.traps.fired.length;if(q.citations)Z+=q.citations.missing.length,z+=q.citations.unknown.length}if(X>0&&Z+z>0)return"Review fired traps and citation gaps.";if(X>0)return"Review fired traps before trusting this surface.";if(Z+z>0)return"Review missing and unknown citations.";return"Citations hold. No declared traps fired."}function xW($,X){let Z=$.summary.score,q=`Overall: ${jW(Z)(`${Z}`)} / 100`;if(X===void 0||X<=0)return q;let G=Z>=X?w.green("run passes"):w.red("run fails");return`${q} \xB7 threshold ${X} \xB7 ${G}`}function jZ($,X={}){let{tool:Z,scenarios:z,summary:q}=$,J=z,G=[];if(G.push(w.bold("pickled check")),G.push(OZ),G.push(`Tool: ${w.cyan(Z.name)}`),$.docs.length>0)G.push(`Sources: ${w.dim(m2($.docs.map((Q)=>Q.id)))}`);else G.push(`Sources: ${w.dim("none registered")}`);if(G.push(`Scenarios: ${w.dim(String(q.total))}`),G.push(""),EW(J)){let Q=new Map;for(let Y of J){let U=Y.scenario.name;if(!Q.has(U))Q.set(U,[]);Q.get(U)?.push(Y)}for(let[Y,U]of Q){G.push(`Scenario: ${Y}`);for(let W of U)if(W.surfaces)G.push(...RZ(W," "));else G.push(` ${IZ(W)}`),G.push(...wZ(W," "));G.push("")}}else for(let Q of J){if(G.push(`Scenario: ${Q.scenario.name}`),Q.surfaces)G.push(...RZ(Q," "));else G.push(` ${IZ(Q)}`),G.push(...wZ(Q," "));G.push("")}return G.push(OZ),G.push(xW($,X.threshold)),G.push(w.dim(bW(z))),G.join(`
241
+ `)}function s4($,X={}){console.log(jZ($,X)),console.log()}function d2($,X={}){if(X.verbose)return JSON.stringify($,null,2);let Z={...$,docs:$.docs.map((z)=>({...z,content:""})),scenarios:$.scenarios.map((z)=>{let{allResponses:q,...J}=z;return J})};return JSON.stringify(Z,null,2)}function kW($){if($.format&&$.format!=="terminal")return $.format;if($.json)return"json";return $.format??"terminal"}async function SZ($,X){let{output:Z}=X,z=kW(X),q=yW.resolve($),J;try{J=await U2({targetRepo:q})}catch(H){console.error(w.red(H instanceof Error?H.message:H)),process.exit(1)}let G;if(z==="json")G=z2(J);else if(z==="markdown")G=Z2(J);else G=q2(J);if(Z)await Bun.write(Z,G);else await fW(`${G}
242
+ `);let Q=J.findings.filter((H)=>H.severity==="error").length,Y=J.findings.filter((H)=>H.severity==="warning").length;if(z!=="json"&&!Z)if(console.log(),Q===0&&Y===0)console.log(w.green("Audit clean. No issues found."));else{let H=Q>0?w.red:w.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($,(z)=>{if(z)Z(z);else X()})})}import gW from"path";async function CZ($,X){let{json:Z,output:z,verbose:q}=X,J=(V)=>!Z&&console.log(V),G=gW.resolve($),Q;try{Q=await Z$(G)}catch(V){console.error(w.red(V instanceof Error?V.message:V)),console.error(),console.error(w.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(L){console.error(w.red(L instanceof Error?L.message:String(L))),process.exit(1)}let B=V-Q.scenarios.length;if(B>0&&!Z)J(w.dim(`Skipping ${B} scenario(s) with explicit target != "${X.target}"`))}let Y={name:Q.tool.name,description:Q.tool.description,path:G};if(q){J(w.bold("pickled check")),J(""),J(w.dim(` Tool: ${Y.name}`)),J(w.dim(` Scenarios: ${Q.scenarios.length}`));for(let V of Q.scenarios)J(w.dim(` - ${V.name}`))}let U=await p4(Y,Q,{onProgress:q?(V)=>{if(!Z)J(w.dim(` ${V}`))}:void 0}),W=X.threshold?parseInt(X.threshold,10):Q.threshold??0,H=W>0&&U.summary.score<W;if(z)await Bun.write(z,d2(U,{verbose:q}));else if(Z)await hW(`${d2(U,{verbose:q})}
243
+ `);else s4(U,{threshold:W});if(H){if(Z||z)console.error(w.red(`Overall: ${U.summary.score} / 100 \xB7 threshold ${W} \xB7 run fails`)),console.error(w.dim("Review failed scenarios before trusting this surface."));process.exit(1)}}function hW($){return new Promise((X,Z)=>{process.stdout.write($,(z)=>{if(z)Z(z);else X()})})}import vW from"path";var uW=`# 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 EZ($){let Z=`${vW.resolve($)}/pickled.yml`;if(await Bun.file(Z).exists())console.error(w.red("pickled.yml already exists")),process.exit(1);await Bun.write(Z,uW),console.log(w.green("Created pickled.yml")),console.log(),console.log(w.dim("Next steps:")),console.log(w.dim(" 1. Edit pickled.yml: list your sources and scenarios")),console.log(w.dim(" 2. Run: pickled check")),console.log()}l0.name("pickled").description("Test what agents actually understand about your product").version(BX.version);l0.command("init").description("Create a pickled.yml config file").argument("[path]","Path to your project (default: current directory)",".").action(EZ);l0.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(SZ);l0.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(CZ);await l0.parseAsync();