faf-cli 6.2.0 → 6.3.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 +28 -6
  2. package/dist/cli.js +156 -156
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,100 +1,100 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as w3}from"node:module";var W3=Object.create;var{getPrototypeOf:H3,defineProperty:ZX,getOwnPropertyNames:U3}=Object;var V3=Object.prototype.hasOwnProperty;function B3($){return this[$]}var K3,M3,N3=($,X,J)=>{var Q=$!=null&&typeof $==="object";if(Q){var q=X?K3??=new WeakMap:M3??=new WeakMap,Y=q.get($);if(Y)return Y}J=$!=null?W3(H3($)):{};let z=X||!$||!$.__esModule?ZX(J,"default",{value:$,enumerable:!0}):J;for(let G of U3($))if(!V3.call(z,G))ZX(z,G,{get:B3.bind($,G),enumerable:!0});if(Q)q.set($,z);return z};var _=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var D3=($)=>$;function O3($,X){this[$]=D3.bind(null,X)}var SX=($,X)=>{for(var J in X)ZX($,J,{get:X[J],enumerable:!0,configurable:!0,set:O3.bind(X,J)})};var g=($,X)=>()=>($&&(X=$($=0)),X);var W$=w3(import.meta.url);var L6=_((L3)=>{class jX extends Error{constructor($,X,J){super(J);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=X,this.exitCode=$,this.nestedError=void 0}}class y9 extends jX{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}L3.CommanderError=jX;L3.InvalidArgumentError=y9});var p2=_((I3)=>{var{InvalidArgumentError:_3}=L6();class g9{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,J)=>{if(!this.argChoices.includes(X))throw new _3(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(X,J);return X},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function F3($){let X=$.name()+($.variadic===!0?"...":"");return $.required?"<"+X+">":"["+X+"]"}I3.Argument=g9;I3.humanReadableArgName=F3});var CX=_((S3)=>{var{humanReadableArgName:Z3}=p2();class v9{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let X=$.commands.filter((Q)=>!Q._hidden),J=$._getHelpCommand();if(J&&!J._hidden)X.push(J);if(this.sortSubcommands)X.sort((Q,q)=>{return Q.name().localeCompare(q.name())});return X}compareOptions($,X){let J=(Q)=>{return Q.short?Q.short.replace(/^-/,""):Q.long.replace(/^--/,"")};return J($).localeCompare(J(X))}visibleOptions($){let X=$.options.filter((Q)=>!Q.hidden),J=$._getHelpOption();if(J&&!J.hidden){let Q=J.short&&$._findOption(J.short),q=J.long&&$._findOption(J.long);if(!Q&&!q)X.push(J);else if(J.long&&!q)X.push($.createOption(J.long,J.description));else if(J.short&&!Q)X.push($.createOption(J.short,J.description))}if(this.sortOptions)X.sort(this.compareOptions);return X}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let X=[];for(let J=$.parent;J;J=J.parent){let Q=J.options.filter((q)=>!q.hidden);X.push(...Q)}if(this.sortOptions)X.sort(this.compareOptions);return X}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((X)=>{X.description=X.description||$._argsDescription[X.name()]||""});if($.registeredArguments.find((X)=>X.description))return $.registeredArguments;return[]}subcommandTerm($){let X=$.registeredArguments.map((J)=>Z3(J)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(X?" "+X:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,X){return X.visibleCommands($).reduce((J,Q)=>{return Math.max(J,this.displayWidth(X.styleSubcommandTerm(X.subcommandTerm(Q))))},0)}longestOptionTermLength($,X){return X.visibleOptions($).reduce((J,Q)=>{return Math.max(J,this.displayWidth(X.styleOptionTerm(X.optionTerm(Q))))},0)}longestGlobalOptionTermLength($,X){return X.visibleGlobalOptions($).reduce((J,Q)=>{return Math.max(J,this.displayWidth(X.styleOptionTerm(X.optionTerm(Q))))},0)}longestArgumentTermLength($,X){return X.visibleArguments($).reduce((J,Q)=>{return Math.max(J,this.displayWidth(X.styleArgumentTerm(X.argumentTerm(Q))))},0)}commandUsage($){let X=$._name;if($._aliases[0])X=X+"|"+$._aliases[0];let J="";for(let Q=$.parent;Q;Q=Q.parent)J=Q.name()+" "+J;return J+X+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let X=[];if($.argChoices)X.push(`choices: ${$.argChoices.map((J)=>JSON.stringify(J)).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 J=`(${X.join(", ")})`;if($.description)return`${$.description} ${J}`;return J}return $.description}argumentDescription($){let X=[];if($.argChoices)X.push(`choices: ${$.argChoices.map((J)=>JSON.stringify(J)).join(", ")}`);if($.defaultValue!==void 0)X.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(X.length>0){let J=`(${X.join(", ")})`;if($.description)return`${$.description} ${J}`;return J}return $.description}formatItemList($,X,J){if(X.length===0)return[];return[J.styleTitle($),...X,""]}groupItems($,X,J){let Q=new Map;return $.forEach((q)=>{let Y=J(q);if(!Q.has(Y))Q.set(Y,[])}),X.forEach((q)=>{let Y=J(q);if(!Q.has(Y))Q.set(Y,[]);Q.get(Y).push(q)}),Q}formatHelp($,X){let J=X.padWidth($,X),Q=X.helpWidth??80;function q(U,V){return X.formatItem(U,J,V,X)}let Y=[`${X.styleTitle("Usage:")} ${X.styleUsage(X.commandUsage($))}`,""],z=X.commandDescription($);if(z.length>0)Y=Y.concat([X.boxWrap(X.styleCommandDescription(z),Q),""]);let G=X.visibleArguments($).map((U)=>{return q(X.styleArgumentTerm(X.argumentTerm(U)),X.styleArgumentDescription(X.argumentDescription(U)))});if(Y=Y.concat(this.formatItemList("Arguments:",G,X)),this.groupItems($.options,X.visibleOptions($),(U)=>U.helpGroupHeading??"Options:").forEach((U,V)=>{let B=U.map((D)=>{return q(X.styleOptionTerm(X.optionTerm(D)),X.styleOptionDescription(X.optionDescription(D)))});Y=Y.concat(this.formatItemList(V,B,X))}),X.showGlobalOptions){let U=X.visibleGlobalOptions($).map((V)=>{return q(X.styleOptionTerm(X.optionTerm(V)),X.styleOptionDescription(X.optionDescription(V)))});Y=Y.concat(this.formatItemList("Global Options:",U,X))}return this.groupItems($.commands,X.visibleCommands($),(U)=>U.helpGroup()||"Commands:").forEach((U,V)=>{let B=U.map((D)=>{return q(X.styleSubcommandTerm(X.subcommandTerm(D)),X.styleSubcommandDescription(X.subcommandDescription(D)))});Y=Y.concat(this.formatItemList(V,B,X))}),Y.join(`
3
- `)}displayWidth($){return h9($).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,J,Q){let Y=" ".repeat(2);if(!J)return Y+$;let z=$.padEnd(X+$.length-Q.displayWidth($)),G=2,H=(this.helpWidth??80)-X-G-2,U;if(H<this.minWidthToWrap||Q.preformatted(J))U=J;else U=Q.boxWrap(J,H).replace(/\n/g,`
2
+ import{createRequire as F3}from"node:module";var K3=Object.create;var{getPrototypeOf:M3,defineProperty:bX,getOwnPropertyNames:N3}=Object;var D3=Object.prototype.hasOwnProperty;function O3($){return this[$]}var w3,L3,R3=($,X,J)=>{var Q=$!=null&&typeof $==="object";if(Q){var q=X?w3??=new WeakMap:L3??=new WeakMap,Y=q.get($);if(Y)return Y}J=$!=null?K3(M3($)):{};let z=X||!$||!$.__esModule?bX(J,"default",{value:$,enumerable:!0}):J;for(let G of N3($))if(!D3.call(z,G))bX(z,G,{get:O3.bind($,G),enumerable:!0});if(Q)q.set($,z);return z};var _=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var A3=($)=>$;function _3($,X){this[$]=A3.bind(null,X)}var PX=($,X)=>{for(var J in X)bX($,J,{get:X[J],enumerable:!0,configurable:!0,set:_3.bind(X,J)})};var g=($,X)=>()=>($&&(X=$($=0)),X);var U$=F3(import.meta.url);var A6=_((I3)=>{class fX extends Error{constructor($,X,J){super(J);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=X,this.exitCode=$,this.nestedError=void 0}}class h9 extends fX{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}I3.CommanderError=fX;I3.InvalidArgumentError=h9});var r2=_((j3)=>{var{InvalidArgumentError:T3}=A6();class u9{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,J)=>{if(!this.argChoices.includes(X))throw new T3(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(X,J);return X},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function S3($){let X=$.name()+($.variadic===!0?"...":"");return $.required?"<"+X+">":"["+X+"]"}j3.Argument=u9;j3.humanReadableArgName=S3});var kX=_((f3)=>{var{humanReadableArgName:P3}=r2();class m9{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let X=$.commands.filter((Q)=>!Q._hidden),J=$._getHelpCommand();if(J&&!J._hidden)X.push(J);if(this.sortSubcommands)X.sort((Q,q)=>{return Q.name().localeCompare(q.name())});return X}compareOptions($,X){let J=(Q)=>{return Q.short?Q.short.replace(/^-/,""):Q.long.replace(/^--/,"")};return J($).localeCompare(J(X))}visibleOptions($){let X=$.options.filter((Q)=>!Q.hidden),J=$._getHelpOption();if(J&&!J.hidden){let Q=J.short&&$._findOption(J.short),q=J.long&&$._findOption(J.long);if(!Q&&!q)X.push(J);else if(J.long&&!q)X.push($.createOption(J.long,J.description));else if(J.short&&!Q)X.push($.createOption(J.short,J.description))}if(this.sortOptions)X.sort(this.compareOptions);return X}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let X=[];for(let J=$.parent;J;J=J.parent){let Q=J.options.filter((q)=>!q.hidden);X.push(...Q)}if(this.sortOptions)X.sort(this.compareOptions);return X}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((X)=>{X.description=X.description||$._argsDescription[X.name()]||""});if($.registeredArguments.find((X)=>X.description))return $.registeredArguments;return[]}subcommandTerm($){let X=$.registeredArguments.map((J)=>P3(J)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(X?" "+X:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,X){return X.visibleCommands($).reduce((J,Q)=>{return Math.max(J,this.displayWidth(X.styleSubcommandTerm(X.subcommandTerm(Q))))},0)}longestOptionTermLength($,X){return X.visibleOptions($).reduce((J,Q)=>{return Math.max(J,this.displayWidth(X.styleOptionTerm(X.optionTerm(Q))))},0)}longestGlobalOptionTermLength($,X){return X.visibleGlobalOptions($).reduce((J,Q)=>{return Math.max(J,this.displayWidth(X.styleOptionTerm(X.optionTerm(Q))))},0)}longestArgumentTermLength($,X){return X.visibleArguments($).reduce((J,Q)=>{return Math.max(J,this.displayWidth(X.styleArgumentTerm(X.argumentTerm(Q))))},0)}commandUsage($){let X=$._name;if($._aliases[0])X=X+"|"+$._aliases[0];let J="";for(let Q=$.parent;Q;Q=Q.parent)J=Q.name()+" "+J;return J+X+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let X=[];if($.argChoices)X.push(`choices: ${$.argChoices.map((J)=>JSON.stringify(J)).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 J=`(${X.join(", ")})`;if($.description)return`${$.description} ${J}`;return J}return $.description}argumentDescription($){let X=[];if($.argChoices)X.push(`choices: ${$.argChoices.map((J)=>JSON.stringify(J)).join(", ")}`);if($.defaultValue!==void 0)X.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(X.length>0){let J=`(${X.join(", ")})`;if($.description)return`${$.description} ${J}`;return J}return $.description}formatItemList($,X,J){if(X.length===0)return[];return[J.styleTitle($),...X,""]}groupItems($,X,J){let Q=new Map;return $.forEach((q)=>{let Y=J(q);if(!Q.has(Y))Q.set(Y,[])}),X.forEach((q)=>{let Y=J(q);if(!Q.has(Y))Q.set(Y,[]);Q.get(Y).push(q)}),Q}formatHelp($,X){let J=X.padWidth($,X),Q=X.helpWidth??80;function q(U,V){return X.formatItem(U,J,V,X)}let Y=[`${X.styleTitle("Usage:")} ${X.styleUsage(X.commandUsage($))}`,""],z=X.commandDescription($);if(z.length>0)Y=Y.concat([X.boxWrap(X.styleCommandDescription(z),Q),""]);let G=X.visibleArguments($).map((U)=>{return q(X.styleArgumentTerm(X.argumentTerm(U)),X.styleArgumentDescription(X.argumentDescription(U)))});if(Y=Y.concat(this.formatItemList("Arguments:",G,X)),this.groupItems($.options,X.visibleOptions($),(U)=>U.helpGroupHeading??"Options:").forEach((U,V)=>{let B=U.map((D)=>{return q(X.styleOptionTerm(X.optionTerm(D)),X.styleOptionDescription(X.optionDescription(D)))});Y=Y.concat(this.formatItemList(V,B,X))}),X.showGlobalOptions){let U=X.visibleGlobalOptions($).map((V)=>{return q(X.styleOptionTerm(X.optionTerm(V)),X.styleOptionDescription(X.optionDescription(V)))});Y=Y.concat(this.formatItemList("Global Options:",U,X))}return this.groupItems($.commands,X.visibleCommands($),(U)=>U.helpGroup()||"Commands:").forEach((U,V)=>{let B=U.map((D)=>{return q(X.styleSubcommandTerm(X.subcommandTerm(D)),X.styleSubcommandDescription(X.subcommandDescription(D)))});Y=Y.concat(this.formatItemList(V,B,X))}),Y.join(`
3
+ `)}displayWidth($){return l9($).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,J,Q){let Y=" ".repeat(2);if(!J)return Y+$;let z=$.padEnd(X+$.length-Q.displayWidth($)),G=2,H=(this.helpWidth??80)-X-G-2,U;if(H<this.minWidthToWrap||Q.preformatted(J))U=J;else U=Q.boxWrap(J,H).replace(/\n/g,`
4
4
  `+" ".repeat(X+G));return Y+z+" ".repeat(G)+U.replace(/\n/g,`
5
5
  ${Y}`)}boxWrap($,X){if(X<this.minWidthToWrap)return $;let J=$.split(/\r\n|\n/),Q=/[\s]*[^\s]+/g,q=[];return J.forEach((Y)=>{let z=Y.match(Q);if(z===null){q.push("");return}let G=[z.shift()],W=this.displayWidth(G[0]);z.forEach((H)=>{let U=this.displayWidth(H);if(W+U<=X){G.push(H),W+=U;return}q.push(G.join(""));let V=H.trimStart();G=[V],W=this.displayWidth(V)}),q.push(G.join(""))}),q.join(`
6
- `)}}function h9($){let X=/\x1b\[\d*(;\d*)*m/g;return $.replace(X,"")}S3.Help=v9;S3.stripColor=h9});var PX=_((f3)=>{var{InvalidArgumentError:P3}=L6();class m9{constructor($,X){this.flags=$,this.description=X||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let J=b3($);if(this.short=J.shortFlag,this.long=J.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,J)=>{if(!this.argChoices.includes(X))throw new P3(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(X,J);return X},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return u9(this.name().replace(/^no-/,""));return u9(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class l9{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,J)=>{if(this.positiveOptions.has(J))this.dualOptions.add(J)})}valueFromOption($,X){let J=X.attributeName();if(!this.dualOptions.has(J))return!0;let Q=this.negativeOptions.get(J).presetArg,q=Q!==void 0?Q:!1;return X.negate===(q===$)}}function u9($){return $.split("-").reduce((X,J)=>{return X+J[0].toUpperCase()+J.slice(1)})}function b3($){let X,J,Q=/^-[^-]$/,q=/^--[^-]/,Y=$.split(/[ |,]+/).concat("guard");if(Q.test(Y[0]))X=Y.shift();if(q.test(Y[0]))J=Y.shift();if(!X&&Q.test(Y[0]))X=Y.shift();if(!X&&q.test(Y[0]))X=J,J=Y.shift();if(Y[0].startsWith("-")){let z=Y[0],G=`option creation failed due to '${z}' in option flags '${$}'`;if(/^-[^-][^-]/.test(z))throw Error(`${G}
6
+ `)}}function l9($){let X=/\x1b\[\d*(;\d*)*m/g;return $.replace(X,"")}f3.Help=m9;f3.stripColor=l9});var xX=_((v3)=>{var{InvalidArgumentError:y3}=A6();class p9{constructor($,X){this.flags=$,this.description=X||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let J=g3($);if(this.short=J.shortFlag,this.long=J.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,J)=>{if(!this.argChoices.includes(X))throw new y3(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(X,J);return X},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return c9(this.name().replace(/^no-/,""));return c9(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class d9{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,J)=>{if(this.positiveOptions.has(J))this.dualOptions.add(J)})}valueFromOption($,X){let J=X.attributeName();if(!this.dualOptions.has(J))return!0;let Q=this.negativeOptions.get(J).presetArg,q=Q!==void 0?Q:!1;return X.negate===(q===$)}}function c9($){return $.split("-").reduce((X,J)=>{return X+J[0].toUpperCase()+J.slice(1)})}function g3($){let X,J,Q=/^-[^-]$/,q=/^--[^-]/,Y=$.split(/[ |,]+/).concat("guard");if(Q.test(Y[0]))X=Y.shift();if(q.test(Y[0]))J=Y.shift();if(!X&&Q.test(Y[0]))X=Y.shift();if(!X&&q.test(Y[0]))X=J,J=Y.shift();if(Y[0].startsWith("-")){let z=Y[0],G=`option creation failed due to '${z}' in option flags '${$}'`;if(/^-[^-][^-]/.test(z))throw Error(`${G}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(Q.test(z))throw Error(`${G}
10
10
  - too many short flags`);if(q.test(z))throw Error(`${G}
11
11
  - too many long flags`);throw Error(`${G}
12
- - unrecognised flag format`)}if(X===void 0&&J===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:X,longFlag:J}}f3.Option=m9;f3.DualOptions=l9});var c9=_((v3)=>{function y3($,X){if(Math.abs($.length-X.length)>3)return Math.max($.length,X.length);let J=[];for(let Q=0;Q<=$.length;Q++)J[Q]=[Q];for(let Q=0;Q<=X.length;Q++)J[0][Q]=Q;for(let Q=1;Q<=X.length;Q++)for(let q=1;q<=$.length;q++){let Y=1;if($[q-1]===X[Q-1])Y=0;else Y=1;if(J[q][Q]=Math.min(J[q-1][Q]+1,J[q][Q-1]+1,J[q-1][Q-1]+Y),q>1&&Q>1&&$[q-1]===X[Q-2]&&$[q-2]===X[Q-1])J[q][Q]=Math.min(J[q][Q],J[q-2][Q-2]+1)}return J[$.length][X.length]}function g3($,X){if(!X||X.length===0)return"";X=Array.from(new Set(X));let J=$.startsWith("--");if(J)$=$.slice(2),X=X.map((z)=>z.slice(2));let Q=[],q=3,Y=0.4;if(X.forEach((z)=>{if(z.length<=1)return;let G=y3($,z),W=Math.max($.length,z.length);if((W-G)/W>Y){if(G<q)q=G,Q=[z];else if(G===q)Q.push(z)}}),Q.sort((z,G)=>z.localeCompare(G)),J)Q=Q.map((z)=>`--${z}`);if(Q.length>1)return`
12
+ - unrecognised flag format`)}if(X===void 0&&J===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:X,longFlag:J}}v3.Option=p9;v3.DualOptions=d9});var i9=_((c3)=>{function m3($,X){if(Math.abs($.length-X.length)>3)return Math.max($.length,X.length);let J=[];for(let Q=0;Q<=$.length;Q++)J[Q]=[Q];for(let Q=0;Q<=X.length;Q++)J[0][Q]=Q;for(let Q=1;Q<=X.length;Q++)for(let q=1;q<=$.length;q++){let Y=1;if($[q-1]===X[Q-1])Y=0;else Y=1;if(J[q][Q]=Math.min(J[q-1][Q]+1,J[q][Q-1]+1,J[q-1][Q-1]+Y),q>1&&Q>1&&$[q-1]===X[Q-2]&&$[q-2]===X[Q-1])J[q][Q]=Math.min(J[q][Q],J[q-2][Q-2]+1)}return J[$.length][X.length]}function l3($,X){if(!X||X.length===0)return"";X=Array.from(new Set(X));let J=$.startsWith("--");if(J)$=$.slice(2),X=X.map((z)=>z.slice(2));let Q=[],q=3,Y=0.4;if(X.forEach((z)=>{if(z.length<=1)return;let G=m3($,z),W=Math.max($.length,z.length);if((W-G)/W>Y){if(G<q)q=G,Q=[z];else if(G===q)Q.push(z)}}),Q.sort((z,G)=>z.localeCompare(G)),J)Q=Q.map((z)=>`--${z}`);if(Q.length>1)return`
13
13
  (Did you mean one of ${Q.join(", ")}?)`;if(Q.length===1)return`
14
- (Did you mean ${Q[0]}?)`;return""}v3.suggestSimilar=g3});var n9=_((i3)=>{var u3=W$("node:events").EventEmitter,bX=W$("node:child_process"),H0=W$("node:path"),d2=W$("node:fs"),a=W$("node:process"),{Argument:m3,humanReadableArgName:l3}=p2(),{CommanderError:fX}=L6(),{Help:c3,stripColor:p3}=CX(),{Option:p9,DualOptions:d3}=PX(),{suggestSimilar:d9}=c9();class xX extends u3{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)=>a.stdout.write(X),writeErr:(X)=>a.stderr.write(X),outputError:(X,J)=>J(X),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:void 0,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:void 0,getOutHasColors:()=>kX()??(a.stdout.isTTY&&a.stdout.hasColors?.()),getErrHasColors:()=>kX()??(a.stderr.isTTY&&a.stderr.hasColors?.()),stripColor:(X)=>p3(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,J){let Q=X,q=J;if(typeof Q==="object"&&Q!==null)q=Q,Q=null;q=q||{};let[,Y,z]=$.match(/([^ ]+) *(.*)/),G=this.createCommand(Y);if(Q)G.description(Q),G._executableHandler=!0;if(q.isDefault)this._defaultCommandName=G._name;if(G._hidden=!!(q.noHelp||q.hidden),G._executableFile=q.executableFile||null,z)G.arguments(z);if(this._registerCommand(G),G.parent=this,G.copyInheritedSettings(this),Q)return this;return G}createCommand($){return new xX($)}createHelp(){return Object.assign(new c3,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
15
- - 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 m3($,X)}argument($,X,J,Q){let q=this.createArgument($,X);if(typeof J==="function")q.default(Q).argParser(J);else q.default(J);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 J=$??"help [command]",[,Q,q]=J.match(/([^ ]+) *(.*)/),Y=X??"display help for command",z=this.createCommand(Q);if(z.helpOption(!1),q)z.arguments(q);if(Y)z.description(Y);if(this._addImplicitHelpCommand=!0,this._helpCommand=z,$||X)this._initCommandGroup(z);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 J=["preSubcommand","preAction","postAction"];if(!J.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
16
- Expecting one of '${J.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,J){if(this._exitCallback)this._exitCallback(new fX($,X,J));a.exit($)}action($){let X=(J)=>{let Q=this.registeredArguments.length,q=J.slice(0,Q);if(this._storeOptionsAsProperties)q[Q]=this;else q[Q]=this.opts();return q.push(this),$.apply(this,q)};return this._actionHandler=X,this}createOption($,X){return new p9($,X)}_callParseArg($,X,J,Q){try{return $.parseArg(X,J)}catch(q){if(q.code==="commander.invalidArgument"){let Y=`${Q} ${q.message}`;this.error(Y,{exitCode:q.exitCode,code:q.code})}throw q}}_registerOption($){let X=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(X){let J=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${J}'
17
- - already used by option '${X.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let X=(Q)=>{return[Q.name()].concat(Q.aliases())},J=X($).find((Q)=>this._findCommand(Q));if(J){let Q=X(this._findCommand(J)).join("|"),q=X($).join("|");throw Error(`cannot add command '${q}' as already have command '${Q}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let X=$.name(),J=$.attributeName();if($.negate){let q=$.long.replace(/^--no-/,"--");if(!this._findOption(q))this.setOptionValueWithSource(J,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(J,$.defaultValue,"default");let Q=(q,Y,z)=>{if(q==null&&$.presetArg!==void 0)q=$.presetArg;let G=this.getOptionValue(J);if(q!==null&&$.parseArg)q=this._callParseArg($,q,G,Y);else if(q!==null&&$.variadic)q=$._collectValue(q,G);if(q==null)if($.negate)q=!1;else if($.isBoolean()||$.optional)q=!0;else q="";this.setOptionValueWithSource(J,q,z)};if(this.on("option:"+X,(q)=>{let Y=`error: option '${$.flags}' argument '${q}' is invalid.`;Q(q,Y,"cli")}),$.envVar)this.on("optionEnv:"+X,(q)=>{let Y=`error: option '${$.flags}' value '${q}' from env '${$.envVar}' is invalid.`;Q(q,Y,"env")});return this}_optionEx($,X,J,Q,q){if(typeof X==="object"&&X instanceof p9)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Y=this.createOption(X,J);if(Y.makeOptionMandatory(!!$.mandatory),typeof Q==="function")Y.default(q).argParser(Q);else if(Q instanceof RegExp){let z=Q;Q=(G,W)=>{let H=z.exec(G);return H?H[0]:W},Y.default(q).argParser(Q)}else Y.default(Q);return this.addOption(Y)}option($,X,J,Q){return this._optionEx({},$,X,J,Q)}requiredOption($,X,J,Q){return this._optionEx({mandatory:!0},$,X,J,Q)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,X){return this.setOptionValueWithSource($,X,void 0)}setOptionValueWithSource($,X,J){if(this._storeOptionsAsProperties)this[$]=X;else this._optionValues[$]=X;return this._optionValueSources[$]=J,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let X;return this._getCommandAndAncestors().forEach((J)=>{if(J.getOptionValueSource($)!==void 0)X=J.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(a.versions?.electron)X.from="electron";let Q=a.execArgv??[];if(Q.includes("-e")||Q.includes("--eval")||Q.includes("-p")||Q.includes("--print"))X.from="eval"}if($===void 0)$=a.argv;this.rawArgs=$.slice();let J;switch(X.from){case void 0:case"node":this._scriptPath=$[1],J=$.slice(2);break;case"electron":if(a.defaultApp)this._scriptPath=$[1],J=$.slice(2);else J=$.slice(1);break;case"user":J=$.slice(0);break;case"eval":J=$.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",J}parse($,X){this._prepareForParse();let J=this._prepareUserArgs($,X);return this._parseCommand([],J),this}async parseAsync($,X){this._prepareForParse();let J=this._prepareUserArgs($,X);return await this._parseCommand([],J),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.
18
- - 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,J){if(d2.existsSync($))return;let Q=X?`searched for local subcommand relative to directory '${X}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",q=`'${$}' does not exist
14
+ (Did you mean ${Q[0]}?)`;return""}c3.suggestSimilar=l3});var a9=_((o3)=>{var d3=U$("node:events").EventEmitter,yX=U$("node:child_process"),U0=U$("node:path"),s2=U$("node:fs"),o=U$("node:process"),{Argument:i3,humanReadableArgName:n3}=r2(),{CommanderError:gX}=A6(),{Help:r3,stripColor:s3}=kX(),{Option:n9,DualOptions:a3}=xX(),{suggestSimilar:r9}=i9();class hX extends d3{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)=>o.stdout.write(X),writeErr:(X)=>o.stderr.write(X),outputError:(X,J)=>J(X),getOutHelpWidth:()=>o.stdout.isTTY?o.stdout.columns:void 0,getErrHelpWidth:()=>o.stderr.isTTY?o.stderr.columns:void 0,getOutHasColors:()=>vX()??(o.stdout.isTTY&&o.stdout.hasColors?.()),getErrHasColors:()=>vX()??(o.stderr.isTTY&&o.stderr.hasColors?.()),stripColor:(X)=>s3(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,J){let Q=X,q=J;if(typeof Q==="object"&&Q!==null)q=Q,Q=null;q=q||{};let[,Y,z]=$.match(/([^ ]+) *(.*)/),G=this.createCommand(Y);if(Q)G.description(Q),G._executableHandler=!0;if(q.isDefault)this._defaultCommandName=G._name;if(G._hidden=!!(q.noHelp||q.hidden),G._executableFile=q.executableFile||null,z)G.arguments(z);if(this._registerCommand(G),G.parent=this,G.copyInheritedSettings(this),Q)return this;return G}createCommand($){return new hX($)}createHelp(){return Object.assign(new r3,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
15
+ - 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 i3($,X)}argument($,X,J,Q){let q=this.createArgument($,X);if(typeof J==="function")q.default(Q).argParser(J);else q.default(J);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 J=$??"help [command]",[,Q,q]=J.match(/([^ ]+) *(.*)/),Y=X??"display help for command",z=this.createCommand(Q);if(z.helpOption(!1),q)z.arguments(q);if(Y)z.description(Y);if(this._addImplicitHelpCommand=!0,this._helpCommand=z,$||X)this._initCommandGroup(z);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 J=["preSubcommand","preAction","postAction"];if(!J.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
16
+ Expecting one of '${J.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,J){if(this._exitCallback)this._exitCallback(new gX($,X,J));o.exit($)}action($){let X=(J)=>{let Q=this.registeredArguments.length,q=J.slice(0,Q);if(this._storeOptionsAsProperties)q[Q]=this;else q[Q]=this.opts();return q.push(this),$.apply(this,q)};return this._actionHandler=X,this}createOption($,X){return new n9($,X)}_callParseArg($,X,J,Q){try{return $.parseArg(X,J)}catch(q){if(q.code==="commander.invalidArgument"){let Y=`${Q} ${q.message}`;this.error(Y,{exitCode:q.exitCode,code:q.code})}throw q}}_registerOption($){let X=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(X){let J=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${J}'
17
+ - already used by option '${X.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let X=(Q)=>{return[Q.name()].concat(Q.aliases())},J=X($).find((Q)=>this._findCommand(Q));if(J){let Q=X(this._findCommand(J)).join("|"),q=X($).join("|");throw Error(`cannot add command '${q}' as already have command '${Q}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let X=$.name(),J=$.attributeName();if($.negate){let q=$.long.replace(/^--no-/,"--");if(!this._findOption(q))this.setOptionValueWithSource(J,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(J,$.defaultValue,"default");let Q=(q,Y,z)=>{if(q==null&&$.presetArg!==void 0)q=$.presetArg;let G=this.getOptionValue(J);if(q!==null&&$.parseArg)q=this._callParseArg($,q,G,Y);else if(q!==null&&$.variadic)q=$._collectValue(q,G);if(q==null)if($.negate)q=!1;else if($.isBoolean()||$.optional)q=!0;else q="";this.setOptionValueWithSource(J,q,z)};if(this.on("option:"+X,(q)=>{let Y=`error: option '${$.flags}' argument '${q}' is invalid.`;Q(q,Y,"cli")}),$.envVar)this.on("optionEnv:"+X,(q)=>{let Y=`error: option '${$.flags}' value '${q}' from env '${$.envVar}' is invalid.`;Q(q,Y,"env")});return this}_optionEx($,X,J,Q,q){if(typeof X==="object"&&X instanceof n9)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let Y=this.createOption(X,J);if(Y.makeOptionMandatory(!!$.mandatory),typeof Q==="function")Y.default(q).argParser(Q);else if(Q instanceof RegExp){let z=Q;Q=(G,W)=>{let H=z.exec(G);return H?H[0]:W},Y.default(q).argParser(Q)}else Y.default(Q);return this.addOption(Y)}option($,X,J,Q){return this._optionEx({},$,X,J,Q)}requiredOption($,X,J,Q){return this._optionEx({mandatory:!0},$,X,J,Q)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,X){return this.setOptionValueWithSource($,X,void 0)}setOptionValueWithSource($,X,J){if(this._storeOptionsAsProperties)this[$]=X;else this._optionValues[$]=X;return this._optionValueSources[$]=J,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let X;return this._getCommandAndAncestors().forEach((J)=>{if(J.getOptionValueSource($)!==void 0)X=J.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(o.versions?.electron)X.from="electron";let Q=o.execArgv??[];if(Q.includes("-e")||Q.includes("--eval")||Q.includes("-p")||Q.includes("--print"))X.from="eval"}if($===void 0)$=o.argv;this.rawArgs=$.slice();let J;switch(X.from){case void 0:case"node":this._scriptPath=$[1],J=$.slice(2);break;case"electron":if(o.defaultApp)this._scriptPath=$[1],J=$.slice(2);else J=$.slice(1);break;case"user":J=$.slice(0);break;case"eval":J=$.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",J}parse($,X){this._prepareForParse();let J=this._prepareUserArgs($,X);return this._parseCommand([],J),this}async parseAsync($,X){this._prepareForParse();let J=this._prepareUserArgs($,X);return await this._parseCommand([],J),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.
18
+ - 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,J){if(s2.existsSync($))return;let Q=X?`searched for local subcommand relative to directory '${X}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",q=`'${$}' does not exist
19
19
  - if '${J}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${Q}`;throw Error(q)}_executeSubCommand($,X){X=X.slice();let J=!1,Q=[".js",".ts",".tsx",".mjs",".cjs"];function q(H,U){let V=H0.resolve(H,U);if(d2.existsSync(V))return V;if(Q.includes(H0.extname(U)))return;let B=Q.find((D)=>d2.existsSync(`${V}${D}`));if(B)return`${V}${B}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Y=$._executableFile||`${this._name}-${$._name}`,z=this._executableDir||"";if(this._scriptPath){let H;try{H=d2.realpathSync(this._scriptPath)}catch{H=this._scriptPath}z=H0.resolve(H0.dirname(H),z)}if(z){let H=q(z,Y);if(!H&&!$._executableFile&&this._scriptPath){let U=H0.basename(this._scriptPath,H0.extname(this._scriptPath));if(U!==this._name)H=q(z,`${U}-${$._name}`)}Y=H||Y}J=Q.includes(H0.extname(Y));let G;if(a.platform!=="win32")if(J)X.unshift(Y),X=i9(a.execArgv).concat(X),G=bX.spawn(a.argv[0],X,{stdio:"inherit"});else G=bX.spawn(Y,X,{stdio:"inherit"});else this._checkForMissingExecutable(Y,z,$._name),X.unshift(Y),X=i9(a.execArgv).concat(X),G=bX.spawn(a.execPath,X,{stdio:"inherit"});if(!G.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((U)=>{a.on(U,()=>{if(G.killed===!1&&G.exitCode===null)G.kill(U)})});let W=this._exitCallback;G.on("close",(H)=>{if(H=H??1,!W)a.exit(H);else W(new fX(H,"commander.executeSubCommandAsync","(close)"))}),G.on("error",(H)=>{if(H.code==="ENOENT")this._checkForMissingExecutable(Y,z,$._name);else if(H.code==="EACCES")throw Error(`'${Y}' not executable`);if(!W)a.exit(1);else{let U=new fX(1,"commander.executeSubCommandAsync","(error)");U.nestedError=H,W(U)}}),this.runningCommand=G}_dispatchSubcommand($,X,J){let Q=this._findCommand($);if(!Q)this.help({error:!0});Q._prepareForParse();let q;return q=this._chainOrCallSubCommandHook(q,Q,"preSubcommand"),q=this._chainOrCall(q,()=>{if(Q._executableHandler)this._executeSubCommand(Q,X.concat(J));else return Q._parseCommand(X,J)}),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 $=(J,Q,q)=>{let Y=Q;if(Q!==null&&J.parseArg){let z=`error: command-argument value '${Q}' is invalid for argument '${J.name()}'.`;Y=this._callParseArg(J,Q,q,z)}return Y};this._checkNumberOfArguments();let X=[];this.registeredArguments.forEach((J,Q)=>{let q=J.defaultValue;if(J.variadic){if(Q<this.args.length){if(q=this.args.slice(Q),J.parseArg)q=q.reduce((Y,z)=>{return $(J,z,Y)},J.defaultValue)}else if(q===void 0)q=[]}else if(Q<this.args.length){if(q=this.args[Q],J.parseArg)q=$(J,q,J.defaultValue)}X[Q]=q}),this.processedArgs=X}_chainOrCall($,X){if($?.then&&typeof $.then==="function")return $.then(()=>X());return X()}_chainOrCallHooks($,X){let J=$,Q=[];if(this._getCommandAndAncestors().reverse().filter((q)=>q._lifeCycleHooks[X]!==void 0).forEach((q)=>{q._lifeCycleHooks[X].forEach((Y)=>{Q.push({hookedCommand:q,callback:Y})})}),X==="postAction")Q.reverse();return Q.forEach((q)=>{J=this._chainOrCall(J,()=>{return q.callback(q.hookedCommand,this)})}),J}_chainOrCallSubCommandHook($,X,J){let Q=$;if(this._lifeCycleHooks[J]!==void 0)this._lifeCycleHooks[J].forEach((q)=>{Q=this._chainOrCall(Q,()=>{return q(this,X)})});return Q}_parseCommand($,X){let J=this.parseOptions(X);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(J.operands),X=J.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(J.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=()=>{if(J.unknown.length>0)this.unknownOption(J.unknown[0])},q=`command:${this.name()}`;if(this._actionHandler){Q(),this._processArguments();let Y;if(Y=this._chainOrCallHooks(Y,"preAction"),Y=this._chainOrCall(Y,()=>this._actionHandler(this.processedArgs)),this.parent)Y=this._chainOrCall(Y,()=>{this.parent.emit(q,$,X)});return Y=this._chainOrCallHooks(Y,"postAction"),Y}if(this.parent?.listenerCount(q))Q(),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 Q(),this._processArguments()}else if(this.commands.length)Q(),this.help({error:!0});else Q(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((X)=>X._name===$||X._aliases.includes($))}_findOption($){return this.options.find((X)=>X.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((X)=>{if(X.mandatory&&$.getOptionValue(X.attributeName())===void 0)$.missingMandatoryOptionValue(X)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((J)=>{let Q=J.attributeName();if(this.getOptionValue(Q)===void 0)return!1;return this.getOptionValueSource(Q)!=="default"});$.filter((J)=>J.conflictsWith.length>0).forEach((J)=>{let Q=$.find((q)=>J.conflictsWith.includes(q.attributeName()));if(Q)this._conflictingOption(J,Q)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let X=[],J=[],Q=X;function q(H){return H.length>1&&H[0]==="-"}let Y=(H)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(H))return!1;return!this._getCommandAndAncestors().some((U)=>U.options.map((V)=>V.short).some((V)=>/^-\d$/.test(V)))},z=null,G=null,W=0;while(W<$.length||G){let H=G??$[W++];if(G=null,H==="--"){if(Q===J)Q.push(H);Q.push(...$.slice(W));break}if(z&&(!q(H)||Y(H))){this.emit(`option:${z.name()}`,H);continue}if(z=null,q(H)){let U=this._findOption(H);if(U){if(U.required){let V=$[W++];if(V===void 0)this.optionMissingArgument(U);this.emit(`option:${U.name()}`,V)}else if(U.optional){let V=null;if(W<$.length&&(!q($[W])||Y($[W])))V=$[W++];this.emit(`option:${U.name()}`,V)}else this.emit(`option:${U.name()}`);z=U.variadic?U:null;continue}}if(H.length>2&&H[0]==="-"&&H[1]!=="-"){let U=this._findOption(`-${H[1]}`);if(U){if(U.required||U.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${U.name()}`,H.slice(2));else this.emit(`option:${U.name()}`),G=`-${H.slice(2)}`;continue}}if(/^--[^=]+=/.test(H)){let U=H.indexOf("="),V=this._findOption(H.slice(0,U));if(V&&(V.required||V.optional)){this.emit(`option:${V.name()}`,H.slice(U+1));continue}}if(Q===X&&q(H)&&!(this.commands.length===0&&Y(H)))Q=J;if((this._enablePositionalOptions||this._passThroughOptions)&&X.length===0&&J.length===0){if(this._findCommand(H)){X.push(H),J.push(...$.slice(W));break}else if(this._getHelpCommand()&&H===this._getHelpCommand().name()){X.push(H,...$.slice(W));break}else if(this._defaultCommandName){J.push(H,...$.slice(W));break}}if(this._passThroughOptions){Q.push(H,...$.slice(W));break}Q.push(H)}return{operands:X,unknown:J}}opts(){if(this._storeOptionsAsProperties){let $={},X=this.options.length;for(let J=0;J<X;J++){let Q=this.options[J].attributeName();$[Q]=Q===this._versionOptionName?this._version:this[Q]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,X)=>Object.assign($,X.opts()),{})}error($,X){if(this._outputConfiguration.outputError(`${$}
21
+ - ${Q}`;throw Error(q)}_executeSubCommand($,X){X=X.slice();let J=!1,Q=[".js",".ts",".tsx",".mjs",".cjs"];function q(H,U){let V=U0.resolve(H,U);if(s2.existsSync(V))return V;if(Q.includes(U0.extname(U)))return;let B=Q.find((D)=>s2.existsSync(`${V}${D}`));if(B)return`${V}${B}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Y=$._executableFile||`${this._name}-${$._name}`,z=this._executableDir||"";if(this._scriptPath){let H;try{H=s2.realpathSync(this._scriptPath)}catch{H=this._scriptPath}z=U0.resolve(U0.dirname(H),z)}if(z){let H=q(z,Y);if(!H&&!$._executableFile&&this._scriptPath){let U=U0.basename(this._scriptPath,U0.extname(this._scriptPath));if(U!==this._name)H=q(z,`${U}-${$._name}`)}Y=H||Y}J=Q.includes(U0.extname(Y));let G;if(o.platform!=="win32")if(J)X.unshift(Y),X=s9(o.execArgv).concat(X),G=yX.spawn(o.argv[0],X,{stdio:"inherit"});else G=yX.spawn(Y,X,{stdio:"inherit"});else this._checkForMissingExecutable(Y,z,$._name),X.unshift(Y),X=s9(o.execArgv).concat(X),G=yX.spawn(o.execPath,X,{stdio:"inherit"});if(!G.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((U)=>{o.on(U,()=>{if(G.killed===!1&&G.exitCode===null)G.kill(U)})});let W=this._exitCallback;G.on("close",(H)=>{if(H=H??1,!W)o.exit(H);else W(new gX(H,"commander.executeSubCommandAsync","(close)"))}),G.on("error",(H)=>{if(H.code==="ENOENT")this._checkForMissingExecutable(Y,z,$._name);else if(H.code==="EACCES")throw Error(`'${Y}' not executable`);if(!W)o.exit(1);else{let U=new gX(1,"commander.executeSubCommandAsync","(error)");U.nestedError=H,W(U)}}),this.runningCommand=G}_dispatchSubcommand($,X,J){let Q=this._findCommand($);if(!Q)this.help({error:!0});Q._prepareForParse();let q;return q=this._chainOrCallSubCommandHook(q,Q,"preSubcommand"),q=this._chainOrCall(q,()=>{if(Q._executableHandler)this._executeSubCommand(Q,X.concat(J));else return Q._parseCommand(X,J)}),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 $=(J,Q,q)=>{let Y=Q;if(Q!==null&&J.parseArg){let z=`error: command-argument value '${Q}' is invalid for argument '${J.name()}'.`;Y=this._callParseArg(J,Q,q,z)}return Y};this._checkNumberOfArguments();let X=[];this.registeredArguments.forEach((J,Q)=>{let q=J.defaultValue;if(J.variadic){if(Q<this.args.length){if(q=this.args.slice(Q),J.parseArg)q=q.reduce((Y,z)=>{return $(J,z,Y)},J.defaultValue)}else if(q===void 0)q=[]}else if(Q<this.args.length){if(q=this.args[Q],J.parseArg)q=$(J,q,J.defaultValue)}X[Q]=q}),this.processedArgs=X}_chainOrCall($,X){if($?.then&&typeof $.then==="function")return $.then(()=>X());return X()}_chainOrCallHooks($,X){let J=$,Q=[];if(this._getCommandAndAncestors().reverse().filter((q)=>q._lifeCycleHooks[X]!==void 0).forEach((q)=>{q._lifeCycleHooks[X].forEach((Y)=>{Q.push({hookedCommand:q,callback:Y})})}),X==="postAction")Q.reverse();return Q.forEach((q)=>{J=this._chainOrCall(J,()=>{return q.callback(q.hookedCommand,this)})}),J}_chainOrCallSubCommandHook($,X,J){let Q=$;if(this._lifeCycleHooks[J]!==void 0)this._lifeCycleHooks[J].forEach((q)=>{Q=this._chainOrCall(Q,()=>{return q(this,X)})});return Q}_parseCommand($,X){let J=this.parseOptions(X);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(J.operands),X=J.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(J.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Q=()=>{if(J.unknown.length>0)this.unknownOption(J.unknown[0])},q=`command:${this.name()}`;if(this._actionHandler){Q(),this._processArguments();let Y;if(Y=this._chainOrCallHooks(Y,"preAction"),Y=this._chainOrCall(Y,()=>this._actionHandler(this.processedArgs)),this.parent)Y=this._chainOrCall(Y,()=>{this.parent.emit(q,$,X)});return Y=this._chainOrCallHooks(Y,"postAction"),Y}if(this.parent?.listenerCount(q))Q(),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 Q(),this._processArguments()}else if(this.commands.length)Q(),this.help({error:!0});else Q(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((X)=>X._name===$||X._aliases.includes($))}_findOption($){return this.options.find((X)=>X.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((X)=>{if(X.mandatory&&$.getOptionValue(X.attributeName())===void 0)$.missingMandatoryOptionValue(X)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((J)=>{let Q=J.attributeName();if(this.getOptionValue(Q)===void 0)return!1;return this.getOptionValueSource(Q)!=="default"});$.filter((J)=>J.conflictsWith.length>0).forEach((J)=>{let Q=$.find((q)=>J.conflictsWith.includes(q.attributeName()));if(Q)this._conflictingOption(J,Q)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let X=[],J=[],Q=X;function q(H){return H.length>1&&H[0]==="-"}let Y=(H)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(H))return!1;return!this._getCommandAndAncestors().some((U)=>U.options.map((V)=>V.short).some((V)=>/^-\d$/.test(V)))},z=null,G=null,W=0;while(W<$.length||G){let H=G??$[W++];if(G=null,H==="--"){if(Q===J)Q.push(H);Q.push(...$.slice(W));break}if(z&&(!q(H)||Y(H))){this.emit(`option:${z.name()}`,H);continue}if(z=null,q(H)){let U=this._findOption(H);if(U){if(U.required){let V=$[W++];if(V===void 0)this.optionMissingArgument(U);this.emit(`option:${U.name()}`,V)}else if(U.optional){let V=null;if(W<$.length&&(!q($[W])||Y($[W])))V=$[W++];this.emit(`option:${U.name()}`,V)}else this.emit(`option:${U.name()}`);z=U.variadic?U:null;continue}}if(H.length>2&&H[0]==="-"&&H[1]!=="-"){let U=this._findOption(`-${H[1]}`);if(U){if(U.required||U.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${U.name()}`,H.slice(2));else this.emit(`option:${U.name()}`),G=`-${H.slice(2)}`;continue}}if(/^--[^=]+=/.test(H)){let U=H.indexOf("="),V=this._findOption(H.slice(0,U));if(V&&(V.required||V.optional)){this.emit(`option:${V.name()}`,H.slice(U+1));continue}}if(Q===X&&q(H)&&!(this.commands.length===0&&Y(H)))Q=J;if((this._enablePositionalOptions||this._passThroughOptions)&&X.length===0&&J.length===0){if(this._findCommand(H)){X.push(H),J.push(...$.slice(W));break}else if(this._getHelpCommand()&&H===this._getHelpCommand().name()){X.push(H,...$.slice(W));break}else if(this._defaultCommandName){J.push(H,...$.slice(W));break}}if(this._passThroughOptions){Q.push(H,...$.slice(W));break}Q.push(H)}return{operands:X,unknown:J}}opts(){if(this._storeOptionsAsProperties){let $={},X=this.options.length;for(let J=0;J<X;J++){let Q=this.options[J].attributeName();$[Q]=Q===this._versionOptionName?this._version:this[Q]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,X)=>Object.assign($,X.opts()),{})}error($,X){if(this._outputConfiguration.outputError(`${$}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0});let J=X||{},Q=J.exitCode||1,q=J.code||"commander.error";this._exit(Q,q,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in a.env){let X=$.attributeName();if(this.getOptionValue(X)===void 0||["default","config","env"].includes(this.getOptionValueSource(X)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,a.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new d3(this.options),X=(J)=>{return this.getOptionValue(J)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(J))};this.options.filter((J)=>J.implied!==void 0&&X(J.attributeName())&&$.valueFromOption(this.getOptionValue(J.attributeName()),J)).forEach((J)=>{Object.keys(J.implied).filter((Q)=>!X(Q)).forEach((Q)=>{this.setOptionValueWithSource(Q,J.implied[Q],"implied")})})}missingArgument($){let X=`error: missing required argument '${$}'`;this.error(X,{code:"commander.missingArgument"})}optionMissingArgument($){let X=`error: option '${$.flags}' argument missing`;this.error(X,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let X=`error: required option '${$.flags}' not specified`;this.error(X,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,X){let J=(Y)=>{let z=Y.attributeName(),G=this.getOptionValue(z),W=this.options.find((U)=>U.negate&&z===U.attributeName()),H=this.options.find((U)=>!U.negate&&z===U.attributeName());if(W&&(W.presetArg===void 0&&G===!1||W.presetArg!==void 0&&G===W.presetArg))return W;return H||Y},Q=(Y)=>{let z=J(Y),G=z.attributeName();if(this.getOptionValueSource(G)==="env")return`environment variable '${z.envVar}'`;return`option '${z.flags}'`},q=`error: ${Q($)} cannot be used with ${Q(X)}`;this.error(q,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let X="";if($.startsWith("--")&&this._showSuggestionAfterError){let Q=[],q=this;do{let Y=q.createHelp().visibleOptions(q).filter((z)=>z.long).map((z)=>z.long);Q=Q.concat(Y),q=q.parent}while(q&&!q._enablePositionalOptions);X=d9($,Q)}let J=`error: unknown option '${$}'${X}`;this.error(J,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let X=this.registeredArguments.length,J=X===1?"":"s",q=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${X} argument${J} but got ${$.length}.`;this.error(q,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],X="";if(this._showSuggestionAfterError){let Q=[];this.createHelp().visibleCommands(this).forEach((q)=>{if(Q.push(q.name()),q.alias())Q.push(q.alias())}),X=d9($,Q)}let J=`error: unknown command '${$}'${X}`;this.error(J,{code:"commander.unknownCommand"})}version($,X,J){if($===void 0)return this._version;this._version=$,X=X||"-V, --version",J=J||"output the version number";let Q=this.createOption(X,J);return this._versionOptionName=Q.attributeName(),this._registerOption(Q),this.on("option:"+Q.name(),()=>{this._outputConfiguration.writeOut(`${$}
25
- `),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 J=this.parent?._findCommand($);if(J){let Q=[J.name()].concat(J.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${Q}'`)}return X._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((X)=>this.alias(X)),this}usage($){if($===void 0){if(this._usage)return this._usage;let X=this.registeredArguments.map((J)=>{return l3(J)});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=H0.basename($,H0.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let X=this.createHelp(),J=this._getOutputContext($);X.prepareContext({error:J.error,helpWidth:J.helpWidth,outputHasColors:J.hasColors});let Q=X.formatHelp(this,X);if(J.hasColors)return Q;return this._outputConfiguration.stripColor(Q)}_getOutputContext($){$=$||{};let X=!!$.error,J,Q,q;if(X)J=(z)=>this._outputConfiguration.writeErr(z),Q=this._outputConfiguration.getErrHasColors(),q=this._outputConfiguration.getErrHelpWidth();else J=(z)=>this._outputConfiguration.writeOut(z),Q=this._outputConfiguration.getOutHasColors(),q=this._outputConfiguration.getOutHelpWidth();return{error:X,write:(z)=>{if(!Q)z=this._outputConfiguration.stripColor(z);return J(z)},hasColors:Q,helpWidth:q}}outputHelp($){let X;if(typeof $==="function")X=$,$=void 0;let J=this._getOutputContext($),Q={error:J.error,write:J.write,command:this};this._getCommandAndAncestors().reverse().forEach((Y)=>Y.emit("beforeAllHelp",Q)),this.emit("beforeHelp",Q);let q=this.helpInformation({error:J.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(J.write(q),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Q),this._getCommandAndAncestors().forEach((Y)=>Y.emit("afterAllHelp",Q))}helpOption($,X){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",X??"display help for command"),$||X)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let X=Number(a.exitCode??0);if(X===0&&$&&typeof $!=="function"&&$.error)X=1;this._exit(X,"commander.help","(outputHelp)")}addHelpText($,X){let J=["beforeAll","before","after","afterAll"];if(!J.includes($))throw Error(`Unexpected value for position to addHelpText.
24
+ `),this.outputHelp({error:!0});let J=X||{},Q=J.exitCode||1,q=J.code||"commander.error";this._exit(Q,q,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in o.env){let X=$.attributeName();if(this.getOptionValue(X)===void 0||["default","config","env"].includes(this.getOptionValueSource(X)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,o.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new a3(this.options),X=(J)=>{return this.getOptionValue(J)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(J))};this.options.filter((J)=>J.implied!==void 0&&X(J.attributeName())&&$.valueFromOption(this.getOptionValue(J.attributeName()),J)).forEach((J)=>{Object.keys(J.implied).filter((Q)=>!X(Q)).forEach((Q)=>{this.setOptionValueWithSource(Q,J.implied[Q],"implied")})})}missingArgument($){let X=`error: missing required argument '${$}'`;this.error(X,{code:"commander.missingArgument"})}optionMissingArgument($){let X=`error: option '${$.flags}' argument missing`;this.error(X,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let X=`error: required option '${$.flags}' not specified`;this.error(X,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,X){let J=(Y)=>{let z=Y.attributeName(),G=this.getOptionValue(z),W=this.options.find((U)=>U.negate&&z===U.attributeName()),H=this.options.find((U)=>!U.negate&&z===U.attributeName());if(W&&(W.presetArg===void 0&&G===!1||W.presetArg!==void 0&&G===W.presetArg))return W;return H||Y},Q=(Y)=>{let z=J(Y),G=z.attributeName();if(this.getOptionValueSource(G)==="env")return`environment variable '${z.envVar}'`;return`option '${z.flags}'`},q=`error: ${Q($)} cannot be used with ${Q(X)}`;this.error(q,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let X="";if($.startsWith("--")&&this._showSuggestionAfterError){let Q=[],q=this;do{let Y=q.createHelp().visibleOptions(q).filter((z)=>z.long).map((z)=>z.long);Q=Q.concat(Y),q=q.parent}while(q&&!q._enablePositionalOptions);X=r9($,Q)}let J=`error: unknown option '${$}'${X}`;this.error(J,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let X=this.registeredArguments.length,J=X===1?"":"s",q=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${X} argument${J} but got ${$.length}.`;this.error(q,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],X="";if(this._showSuggestionAfterError){let Q=[];this.createHelp().visibleCommands(this).forEach((q)=>{if(Q.push(q.name()),q.alias())Q.push(q.alias())}),X=r9($,Q)}let J=`error: unknown command '${$}'${X}`;this.error(J,{code:"commander.unknownCommand"})}version($,X,J){if($===void 0)return this._version;this._version=$,X=X||"-V, --version",J=J||"output the version number";let Q=this.createOption(X,J);return this._versionOptionName=Q.attributeName(),this._registerOption(Q),this.on("option:"+Q.name(),()=>{this._outputConfiguration.writeOut(`${$}
25
+ `),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 J=this.parent?._findCommand($);if(J){let Q=[J.name()].concat(J.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${Q}'`)}return X._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((X)=>this.alias(X)),this}usage($){if($===void 0){if(this._usage)return this._usage;let X=this.registeredArguments.map((J)=>{return n3(J)});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=U0.basename($,U0.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let X=this.createHelp(),J=this._getOutputContext($);X.prepareContext({error:J.error,helpWidth:J.helpWidth,outputHasColors:J.hasColors});let Q=X.formatHelp(this,X);if(J.hasColors)return Q;return this._outputConfiguration.stripColor(Q)}_getOutputContext($){$=$||{};let X=!!$.error,J,Q,q;if(X)J=(z)=>this._outputConfiguration.writeErr(z),Q=this._outputConfiguration.getErrHasColors(),q=this._outputConfiguration.getErrHelpWidth();else J=(z)=>this._outputConfiguration.writeOut(z),Q=this._outputConfiguration.getOutHasColors(),q=this._outputConfiguration.getOutHelpWidth();return{error:X,write:(z)=>{if(!Q)z=this._outputConfiguration.stripColor(z);return J(z)},hasColors:Q,helpWidth:q}}outputHelp($){let X;if(typeof $==="function")X=$,$=void 0;let J=this._getOutputContext($),Q={error:J.error,write:J.write,command:this};this._getCommandAndAncestors().reverse().forEach((Y)=>Y.emit("beforeAllHelp",Q)),this.emit("beforeHelp",Q);let q=this.helpInformation({error:J.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(J.write(q),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Q),this._getCommandAndAncestors().forEach((Y)=>Y.emit("afterAllHelp",Q))}helpOption($,X){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",X??"display help for command"),$||X)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let X=Number(o.exitCode??0);if(X===0&&$&&typeof $!=="function"&&$.error)X=1;this._exit(X,"commander.help","(outputHelp)")}addHelpText($,X){let J=["beforeAll","before","after","afterAll"];if(!J.includes($))throw Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${J.join("', '")}'`);let Q=`${$}Help`;return this.on(Q,(q)=>{let Y;if(typeof X==="function")Y=X({error:q.error,command:q.command});else Y=X;if(Y)q.write(`${Y}
27
- `)}),this}_outputHelpIfRequested($){let X=this._getHelpOption();if(X&&$.find((Q)=>X.is(Q)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function i9($){return $.map((X)=>{if(!X.startsWith("--inspect"))return X;let J,Q="127.0.0.1",q="9229",Y;if((Y=X.match(/^(--inspect(-brk)?)$/))!==null)J=Y[1];else if((Y=X.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(J=Y[1],/^\d+$/.test(Y[3]))q=Y[3];else Q=Y[3];else if((Y=X.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)J=Y[1],Q=Y[3],q=Y[4];if(J&&q!=="0")return`${J}=${Q}:${parseInt(q)+1}`;return X})}function kX(){if(a.env.NO_COLOR||a.env.FORCE_COLOR==="0"||a.env.FORCE_COLOR==="false")return!1;if(a.env.FORCE_COLOR||a.env.CLICOLOR_FORCE!==void 0)return!0;return}i3.Command=xX;i3.useColor=kX});var o9=_((o3)=>{var{Argument:r9}=p2(),{Command:yX}=n9(),{CommanderError:s3,InvalidArgumentError:s9}=L6(),{Help:a3}=CX(),{Option:a9}=PX();o3.program=new yX;o3.createCommand=($)=>new yX($);o3.createOption=($,X)=>new a9($,X);o3.createArgument=($,X)=>new r9($,X);o3.Command=yX;o3.Option=a9;o3.Argument=r9;o3.Help=a3;o3.CommanderError=s3;o3.InvalidArgumentError=s9;o3.InvalidOptionArgumentError=s9});var n=_((Dz)=>{var gX=Symbol.for("yaml.alias"),e9=Symbol.for("yaml.document"),i2=Symbol.for("yaml.map"),$J=Symbol.for("yaml.pair"),vX=Symbol.for("yaml.scalar"),n2=Symbol.for("yaml.seq"),U0=Symbol.for("yaml.node.type"),Hz=($)=>!!$&&typeof $==="object"&&$[U0]===gX,Uz=($)=>!!$&&typeof $==="object"&&$[U0]===e9,Vz=($)=>!!$&&typeof $==="object"&&$[U0]===i2,Bz=($)=>!!$&&typeof $==="object"&&$[U0]===$J,XJ=($)=>!!$&&typeof $==="object"&&$[U0]===vX,Kz=($)=>!!$&&typeof $==="object"&&$[U0]===n2;function JJ($){if($&&typeof $==="object")switch($[U0]){case i2:case n2:return!0}return!1}function Mz($){if($&&typeof $==="object")switch($[U0]){case gX:case i2:case vX:case n2:return!0}return!1}var Nz=($)=>(XJ($)||JJ($))&&!!$.anchor;Dz.ALIAS=gX;Dz.DOC=e9;Dz.MAP=i2;Dz.NODE_TYPE=U0;Dz.PAIR=$J;Dz.SCALAR=vX;Dz.SEQ=n2;Dz.hasAnchor=Nz;Dz.isAlias=Hz;Dz.isCollection=JJ;Dz.isDocument=Uz;Dz.isMap=Vz;Dz.isNode=Mz;Dz.isPair=Bz;Dz.isScalar=XJ;Dz.isSeq=Kz});var R6=_((fz)=>{var w$=n(),T$=Symbol("break visit"),QJ=Symbol("skip children"),e$=Symbol("remove node");function r2($,X){let J=qJ(X);if(w$.isDocument($)){if(R8(null,$.contents,J,Object.freeze([$]))===e$)$.contents=null}else R8(null,$,J,Object.freeze([]))}r2.BREAK=T$;r2.SKIP=QJ;r2.REMOVE=e$;function R8($,X,J,Q){let q=YJ($,X,J,Q);if(w$.isNode(q)||w$.isPair(q))return zJ($,Q,q),R8($,q,J,Q);if(typeof q!=="symbol"){if(w$.isCollection(X)){Q=Object.freeze(Q.concat(X));for(let Y=0;Y<X.items.length;++Y){let z=R8(Y,X.items[Y],J,Q);if(typeof z==="number")Y=z-1;else if(z===T$)return T$;else if(z===e$)X.items.splice(Y,1),Y-=1}}else if(w$.isPair(X)){Q=Object.freeze(Q.concat(X));let Y=R8("key",X.key,J,Q);if(Y===T$)return T$;else if(Y===e$)X.key=null;let z=R8("value",X.value,J,Q);if(z===T$)return T$;else if(z===e$)X.value=null}}return q}async function s2($,X){let J=qJ(X);if(w$.isDocument($)){if(await A8(null,$.contents,J,Object.freeze([$]))===e$)$.contents=null}else await A8(null,$,J,Object.freeze([]))}s2.BREAK=T$;s2.SKIP=QJ;s2.REMOVE=e$;async function A8($,X,J,Q){let q=await YJ($,X,J,Q);if(w$.isNode(q)||w$.isPair(q))return zJ($,Q,q),A8($,q,J,Q);if(typeof q!=="symbol"){if(w$.isCollection(X)){Q=Object.freeze(Q.concat(X));for(let Y=0;Y<X.items.length;++Y){let z=await A8(Y,X.items[Y],J,Q);if(typeof z==="number")Y=z-1;else if(z===T$)return T$;else if(z===e$)X.items.splice(Y,1),Y-=1}}else if(w$.isPair(X)){Q=Object.freeze(Q.concat(X));let Y=await A8("key",X.key,J,Q);if(Y===T$)return T$;else if(Y===e$)X.key=null;let z=await A8("value",X.value,J,Q);if(z===T$)return T$;else if(z===e$)X.value=null}}return q}function qJ($){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 YJ($,X,J,Q){if(typeof J==="function")return J($,X,Q);if(w$.isMap(X))return J.Map?.($,X,Q);if(w$.isSeq(X))return J.Seq?.($,X,Q);if(w$.isPair(X))return J.Pair?.($,X,Q);if(w$.isScalar(X))return J.Scalar?.($,X,Q);if(w$.isAlias(X))return J.Alias?.($,X,Q);return}function zJ($,X,J){let Q=X[X.length-1];if(w$.isCollection(Q))Q.items[$]=J;else if(w$.isPair(Q))if($==="key")Q.key=J;else Q.value=J;else if(w$.isDocument(Q))Q.contents=J;else{let q=w$.isAlias(Q)?"alias":"scalar";throw Error(`Cannot replace node with ${q} parent`)}}fz.visit=r2;fz.visitAsync=s2});var hX=_((hz)=>{var GJ=n(),yz=R6(),gz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},vz=($)=>$.replace(/[!,[\]{}]/g,(X)=>gz[X]);class y${constructor($,X){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},y$.defaultYaml,$),this.tags=Object.assign({},y$.defaultTags,X)}clone(){let $=new y$(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new y$(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:y$.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},y$.defaultTags);break}return $}add($,X){if(this.atNextDocument)this.yaml={explicit:y$.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},y$.defaultTags),this.atNextDocument=!1;let J=$.trim().split(/[ \t]+/),Q=J.shift();switch(Q){case"%TAG":{if(J.length!==2){if(X(0,"%TAG directive should contain exactly two parts"),J.length<2)return!1}let[q,Y]=J;return this.tags[q]=Y,!0}case"%YAML":{if(this.yaml.explicit=!0,J.length!==1)return X(0,"%YAML directive should contain exactly one part"),!1;let[q]=J;if(q==="1.1"||q==="1.2")return this.yaml.version=q,!0;else{let Y=/^\d+\.\d+$/.test(q);return X(6,`Unsupported YAML version ${q}`,Y),!1}}default:return X(0,`Unknown directive ${Q}`,!0),!1}}tagName($,X){if($==="!")return"!";if($[0]!=="!")return X(`Not a valid tag: ${$}`),null;if($[1]==="<"){let Y=$.slice(2,-1);if(Y==="!"||Y==="!!")return X(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")X("Verbatim tags must end with a >");return Y}let[,J,Q]=$.match(/^(.*!)([^!]*)$/s);if(!Q)X(`The ${$} tag has no suffix`);let q=this.tags[J];if(q)try{return q+decodeURIComponent(Q)}catch(Y){return X(String(Y)),null}if(J==="!")return $;return X(`Could not resolve tag: ${$}`),null}tagString($){for(let[X,J]of Object.entries(this.tags))if($.startsWith(J))return X+vz($.substring(J.length));return $[0]==="!"?$:`!<${$}>`}toString($){let X=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],J=Object.entries(this.tags),Q;if($&&J.length>0&&GJ.isNode($.contents)){let q={};yz.visit($.contents,(Y,z)=>{if(GJ.isNode(z)&&z.tag)q[z.tag]=!0}),Q=Object.keys(q)}else Q=[];for(let[q,Y]of J){if(q==="!!"&&Y==="tag:yaml.org,2002:")continue;if(!$||Q.some((z)=>z.startsWith(Y)))X.push(`%TAG ${q} ${Y}`)}return X.join(`
28
- `)}}y$.defaultYaml={explicit:!1,version:"1.2"};y$.defaultTags={"!!":"tag:yaml.org,2002:"};hz.Directives=y$});var a2=_((pz)=>{var WJ=n(),mz=R6();function lz($){if(/[\x00-\x19\s,[\]{}]/.test($)){let J=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(J)}return!0}function HJ($){let X=new Set;return mz.visit($,{Value(J,Q){if(Q.anchor)X.add(Q.anchor)}}),X}function UJ($,X){for(let J=1;;++J){let Q=`${$}${J}`;if(!X.has(Q))return Q}}function cz($,X){let J=[],Q=new Map,q=null;return{onAnchor:(Y)=>{J.push(Y),q??(q=HJ($));let z=UJ(X,q);return q.add(z),z},setAnchors:()=>{for(let Y of J){let z=Q.get(Y);if(typeof z==="object"&&z.anchor&&(WJ.isScalar(z.node)||WJ.isCollection(z.node)))z.node.anchor=z.anchor;else{let G=Error("Failed to resolve repeated object (this should not happen)");throw G.source=Y,G}}},sourceObjects:Q}}pz.anchorIsValid=lz;pz.anchorNames=HJ;pz.createNodeAnchors=cz;pz.findNewAnchor=UJ});var uX=_((sz)=>{function A6($,X,J,Q){if(Q&&typeof Q==="object")if(Array.isArray(Q))for(let q=0,Y=Q.length;q<Y;++q){let z=Q[q],G=A6($,Q,String(q),z);if(G===void 0)delete Q[q];else if(G!==z)Q[q]=G}else if(Q instanceof Map)for(let q of Array.from(Q.keys())){let Y=Q.get(q),z=A6($,Q,q,Y);if(z===void 0)Q.delete(q);else if(z!==Y)Q.set(q,z)}else if(Q instanceof Set)for(let q of Array.from(Q)){let Y=A6($,Q,q,q);if(Y===void 0)Q.delete(q);else if(Y!==q)Q.delete(q),Q.add(Y)}else for(let[q,Y]of Object.entries(Q)){let z=A6($,Q,q,Y);if(z===void 0)delete Q[q];else if(z!==Y)Q[q]=z}return $.call(X,J,Q)}sz.applyReviver=A6});var _0=_((tz)=>{var oz=n();function VJ($,X,J){if(Array.isArray($))return $.map((Q,q)=>VJ(Q,String(q),J));if($&&typeof $.toJSON==="function"){if(!J||!oz.hasAnchor($))return $.toJSON(X,J);let Q={aliasCount:0,count:1,res:void 0};J.anchors.set($,Q),J.onCreate=(Y)=>{Q.res=Y,delete J.onCreate};let q=$.toJSON(X,J);if(J.onCreate)J.onCreate(q);return q}if(typeof $==="bigint"&&!J?.keep)return Number($);return $}tz.toJS=VJ});var o2=_((JG)=>{var $G=uX(),BJ=n(),XG=_0();class KJ{constructor($){Object.defineProperty(this,BJ.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:J,onAnchor:Q,reviver:q}={}){if(!BJ.isDocument($))throw TypeError("A document argument is required");let Y={anchors:new Map,doc:$,keep:!0,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof J==="number"?J:100},z=XG.toJS(this,"",Y);if(typeof Q==="function")for(let{count:G,res:W}of Y.anchors.values())Q(W,G);return typeof q==="function"?$G.applyReviver(q,{"":z},"",z):z}}JG.NodeBase=KJ});var _6=_((WG)=>{var qG=a2(),YG=R6(),_8=n(),zG=o2(),GG=_0();class MJ extends zG.NodeBase{constructor($){super(_8.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,X){let J;if(X?.aliasResolveCache)J=X.aliasResolveCache;else if(J=[],YG.visit($,{Node:(q,Y)=>{if(_8.isAlias(Y)||_8.hasAnchor(Y))J.push(Y)}}),X)X.aliasResolveCache=J;let Q=void 0;for(let q of J){if(q===this)break;if(q.anchor===this.source)Q=q}return Q}toJSON($,X){if(!X)return{source:this.source};let{anchors:J,doc:Q,maxAliasCount:q}=X,Y=this.resolve(Q,X);if(!Y){let G=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(G)}let z=J.get(Y);if(!z)GG.toJS(Y,null,X),z=J.get(Y);if(z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(q>=0){if(z.count+=1,z.aliasCount===0)z.aliasCount=t2(Q,Y,J);if(z.count*z.aliasCount>q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return z.res}toString($,X,J){let Q=`*${this.source}`;if($){if(qG.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`${Q} `}return Q}}function t2($,X,J){if(_8.isAlias(X)){let Q=X.resolve($),q=J&&Q&&J.get(Q);return q?q.count*q.aliasCount:0}else if(_8.isCollection(X)){let Q=0;for(let q of X.items){let Y=t2($,q,J);if(Y>Q)Q=Y}return Q}else if(_8.isPair(X)){let Q=t2($,X.key,J),q=t2($,X.value,J);return Math.max(Q,q)}return 1}WG.Alias=MJ});var M$=_((MG)=>{var UG=n(),VG=o2(),BG=_0(),KG=($)=>!$||typeof $!=="function"&&typeof $!=="object";class r0 extends VG.NodeBase{constructor($){super(UG.SCALAR);this.value=$}toJSON($,X){return X?.keep?this.value:BG.toJS(this.value,$,X)}toString(){return String(this.value)}}r0.BLOCK_FOLDED="BLOCK_FOLDED";r0.BLOCK_LITERAL="BLOCK_LITERAL";r0.PLAIN="PLAIN";r0.QUOTE_DOUBLE="QUOTE_DOUBLE";r0.QUOTE_SINGLE="QUOTE_SINGLE";MG.Scalar=r0;MG.isScalarValue=KG});var F6=_((AG)=>{var OG=_6(),s0=n(),NJ=M$(),wG="tag:yaml.org,2002:";function LG($,X,J){if(X){let Q=J.filter((Y)=>Y.tag===X),q=Q.find((Y)=>!Y.format)??Q[0];if(!q)throw Error(`Tag ${X} not found`);return q}return J.find((Q)=>Q.identify?.($)&&!Q.format)}function RG($,X,J){if(s0.isDocument($))$=$.contents;if(s0.isNode($))return $;if(s0.isPair($)){let V=J.schema[s0.MAP].createNode?.(J.schema,null,J);return V.items.push($),V}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:Q,onAnchor:q,onTagObj:Y,schema:z,sourceObjects:G}=J,W=void 0;if(Q&&$&&typeof $==="object")if(W=G.get($),W)return W.anchor??(W.anchor=q($)),new OG.Alias(W.anchor);else W={anchor:null,node:null},G.set($,W);if(X?.startsWith("!!"))X=wG+X.slice(2);let H=LG($,X,z.tags);if(!H){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new NJ.Scalar($);if(W)W.node=V;return V}H=$ instanceof Map?z[s0.MAP]:(Symbol.iterator in Object($))?z[s0.SEQ]:z[s0.MAP]}if(Y)Y(H),delete J.onTagObj;let U=H?.createNode?H.createNode(J.schema,$,J):typeof H?.nodeClass?.from==="function"?H.nodeClass.from(J.schema,$,J):new NJ.Scalar($);if(X)U.tag=X;else if(!H.default)U.tag=H.tag;if(W)W.node=U;return U}AG.createNode=RG});var e2=_((EG)=>{var FG=F6(),$0=n(),IG=o2();function mX($,X,J){let Q=J;for(let q=X.length-1;q>=0;--q){let Y=X[q];if(typeof Y==="number"&&Number.isInteger(Y)&&Y>=0){let z=[];z[Y]=Q,Q=z}else Q=new Map([[Y,Q]])}return FG.createNode(Q,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var DJ=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class OJ extends IG.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((J)=>$0.isNode(J)||$0.isPair(J)?J.clone($):J),this.range)X.range=this.range.slice();return X}addIn($,X){if(DJ($))this.add(X);else{let[J,...Q]=$,q=this.get(J,!0);if($0.isCollection(q))q.addIn(Q,X);else if(q===void 0&&this.schema)this.set(J,mX(this.schema,Q,X));else throw Error(`Expected YAML collection at ${J}. Remaining path: ${Q}`)}}deleteIn($){let[X,...J]=$;if(J.length===0)return this.delete(X);let Q=this.get(X,!0);if($0.isCollection(Q))return Q.deleteIn(J);else throw Error(`Expected YAML collection at ${X}. Remaining path: ${J}`)}getIn($,X){let[J,...Q]=$,q=this.get(J,!0);if(Q.length===0)return!X&&$0.isScalar(q)?q.value:q;else return $0.isCollection(q)?q.getIn(Q,X):void 0}hasAllNullValues($){return this.items.every((X)=>{if(!$0.isPair(X))return!1;let J=X.value;return J==null||$&&$0.isScalar(J)&&J.value==null&&!J.commentBefore&&!J.comment&&!J.tag})}hasIn($){let[X,...J]=$;if(J.length===0)return this.has(X);let Q=this.get(X,!0);return $0.isCollection(Q)?Q.hasIn(J):!1}setIn($,X){let[J,...Q]=$;if(Q.length===0)this.set(J,X);else{let q=this.get(J,!0);if($0.isCollection(q))q.setIn(Q,X);else if(q===void 0&&this.schema)this.set(J,mX(this.schema,Q,X));else throw Error(`Expected YAML collection at ${J}. Remaining path: ${Q}`)}}}EG.Collection=OJ;EG.collectionFromPath=mX;EG.isEmptyPath=DJ});var I6=_((PG)=>{var jG=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function lX($,X){if(/^\n+$/.test($))return $.substring(1);return X?$.replace(/^(?! *$)/gm,X):$}var CG=($,X,J)=>$.endsWith(`
29
- `)?lX(J,X):J.includes(`
27
+ `)}),this}_outputHelpIfRequested($){let X=this._getHelpOption();if(X&&$.find((Q)=>X.is(Q)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function s9($){return $.map((X)=>{if(!X.startsWith("--inspect"))return X;let J,Q="127.0.0.1",q="9229",Y;if((Y=X.match(/^(--inspect(-brk)?)$/))!==null)J=Y[1];else if((Y=X.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(J=Y[1],/^\d+$/.test(Y[3]))q=Y[3];else Q=Y[3];else if((Y=X.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)J=Y[1],Q=Y[3],q=Y[4];if(J&&q!=="0")return`${J}=${Q}:${parseInt(q)+1}`;return X})}function vX(){if(o.env.NO_COLOR||o.env.FORCE_COLOR==="0"||o.env.FORCE_COLOR==="false")return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0;return}o3.Command=hX;o3.useColor=vX});var $J=_((Jz)=>{var{Argument:o9}=r2(),{Command:uX}=a9(),{CommanderError:$z,InvalidArgumentError:t9}=A6(),{Help:Xz}=kX(),{Option:e9}=xX();Jz.program=new uX;Jz.createCommand=($)=>new uX($);Jz.createOption=($,X)=>new e9($,X);Jz.createArgument=($,X)=>new o9($,X);Jz.Command=uX;Jz.Option=e9;Jz.Argument=o9;Jz.Help=Xz;Jz.CommanderError=$z;Jz.InvalidArgumentError=t9;Jz.InvalidOptionArgumentError=t9});var n=_((Az)=>{var mX=Symbol.for("yaml.alias"),JJ=Symbol.for("yaml.document"),a2=Symbol.for("yaml.map"),QJ=Symbol.for("yaml.pair"),lX=Symbol.for("yaml.scalar"),o2=Symbol.for("yaml.seq"),V0=Symbol.for("yaml.node.type"),Mz=($)=>!!$&&typeof $==="object"&&$[V0]===mX,Nz=($)=>!!$&&typeof $==="object"&&$[V0]===JJ,Dz=($)=>!!$&&typeof $==="object"&&$[V0]===a2,Oz=($)=>!!$&&typeof $==="object"&&$[V0]===QJ,qJ=($)=>!!$&&typeof $==="object"&&$[V0]===lX,wz=($)=>!!$&&typeof $==="object"&&$[V0]===o2;function YJ($){if($&&typeof $==="object")switch($[V0]){case a2:case o2:return!0}return!1}function Lz($){if($&&typeof $==="object")switch($[V0]){case mX:case a2:case lX:case o2:return!0}return!1}var Rz=($)=>(qJ($)||YJ($))&&!!$.anchor;Az.ALIAS=mX;Az.DOC=JJ;Az.MAP=a2;Az.NODE_TYPE=V0;Az.PAIR=QJ;Az.SCALAR=lX;Az.SEQ=o2;Az.hasAnchor=Rz;Az.isAlias=Mz;Az.isCollection=YJ;Az.isDocument=Nz;Az.isMap=Dz;Az.isNode=Lz;Az.isPair=Oz;Az.isScalar=qJ;Az.isSeq=wz});var _6=_((vz)=>{var w$=n(),Z$=Symbol("break visit"),zJ=Symbol("skip children"),e$=Symbol("remove node");function t2($,X){let J=GJ(X);if(w$.isDocument($)){if(A8(null,$.contents,J,Object.freeze([$]))===e$)$.contents=null}else A8(null,$,J,Object.freeze([]))}t2.BREAK=Z$;t2.SKIP=zJ;t2.REMOVE=e$;function A8($,X,J,Q){let q=WJ($,X,J,Q);if(w$.isNode(q)||w$.isPair(q))return HJ($,Q,q),A8($,q,J,Q);if(typeof q!=="symbol"){if(w$.isCollection(X)){Q=Object.freeze(Q.concat(X));for(let Y=0;Y<X.items.length;++Y){let z=A8(Y,X.items[Y],J,Q);if(typeof z==="number")Y=z-1;else if(z===Z$)return Z$;else if(z===e$)X.items.splice(Y,1),Y-=1}}else if(w$.isPair(X)){Q=Object.freeze(Q.concat(X));let Y=A8("key",X.key,J,Q);if(Y===Z$)return Z$;else if(Y===e$)X.key=null;let z=A8("value",X.value,J,Q);if(z===Z$)return Z$;else if(z===e$)X.value=null}}return q}async function e2($,X){let J=GJ(X);if(w$.isDocument($)){if(await _8(null,$.contents,J,Object.freeze([$]))===e$)$.contents=null}else await _8(null,$,J,Object.freeze([]))}e2.BREAK=Z$;e2.SKIP=zJ;e2.REMOVE=e$;async function _8($,X,J,Q){let q=await WJ($,X,J,Q);if(w$.isNode(q)||w$.isPair(q))return HJ($,Q,q),_8($,q,J,Q);if(typeof q!=="symbol"){if(w$.isCollection(X)){Q=Object.freeze(Q.concat(X));for(let Y=0;Y<X.items.length;++Y){let z=await _8(Y,X.items[Y],J,Q);if(typeof z==="number")Y=z-1;else if(z===Z$)return Z$;else if(z===e$)X.items.splice(Y,1),Y-=1}}else if(w$.isPair(X)){Q=Object.freeze(Q.concat(X));let Y=await _8("key",X.key,J,Q);if(Y===Z$)return Z$;else if(Y===e$)X.key=null;let z=await _8("value",X.value,J,Q);if(z===Z$)return Z$;else if(z===e$)X.value=null}}return q}function GJ($){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 WJ($,X,J,Q){if(typeof J==="function")return J($,X,Q);if(w$.isMap(X))return J.Map?.($,X,Q);if(w$.isSeq(X))return J.Seq?.($,X,Q);if(w$.isPair(X))return J.Pair?.($,X,Q);if(w$.isScalar(X))return J.Scalar?.($,X,Q);if(w$.isAlias(X))return J.Alias?.($,X,Q);return}function HJ($,X,J){let Q=X[X.length-1];if(w$.isCollection(Q))Q.items[$]=J;else if(w$.isPair(Q))if($==="key")Q.key=J;else Q.value=J;else if(w$.isDocument(Q))Q.contents=J;else{let q=w$.isAlias(Q)?"alias":"scalar";throw Error(`Cannot replace node with ${q} parent`)}}vz.visit=t2;vz.visitAsync=e2});var cX=_((pz)=>{var UJ=n(),mz=_6(),lz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},cz=($)=>$.replace(/[!,[\]{}]/g,(X)=>lz[X]);class y${constructor($,X){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},y$.defaultYaml,$),this.tags=Object.assign({},y$.defaultTags,X)}clone(){let $=new y$(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new y$(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:y$.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},y$.defaultTags);break}return $}add($,X){if(this.atNextDocument)this.yaml={explicit:y$.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},y$.defaultTags),this.atNextDocument=!1;let J=$.trim().split(/[ \t]+/),Q=J.shift();switch(Q){case"%TAG":{if(J.length!==2){if(X(0,"%TAG directive should contain exactly two parts"),J.length<2)return!1}let[q,Y]=J;return this.tags[q]=Y,!0}case"%YAML":{if(this.yaml.explicit=!0,J.length!==1)return X(0,"%YAML directive should contain exactly one part"),!1;let[q]=J;if(q==="1.1"||q==="1.2")return this.yaml.version=q,!0;else{let Y=/^\d+\.\d+$/.test(q);return X(6,`Unsupported YAML version ${q}`,Y),!1}}default:return X(0,`Unknown directive ${Q}`,!0),!1}}tagName($,X){if($==="!")return"!";if($[0]!=="!")return X(`Not a valid tag: ${$}`),null;if($[1]==="<"){let Y=$.slice(2,-1);if(Y==="!"||Y==="!!")return X(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")X("Verbatim tags must end with a >");return Y}let[,J,Q]=$.match(/^(.*!)([^!]*)$/s);if(!Q)X(`The ${$} tag has no suffix`);let q=this.tags[J];if(q)try{return q+decodeURIComponent(Q)}catch(Y){return X(String(Y)),null}if(J==="!")return $;return X(`Could not resolve tag: ${$}`),null}tagString($){for(let[X,J]of Object.entries(this.tags))if($.startsWith(J))return X+cz($.substring(J.length));return $[0]==="!"?$:`!<${$}>`}toString($){let X=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],J=Object.entries(this.tags),Q;if($&&J.length>0&&UJ.isNode($.contents)){let q={};mz.visit($.contents,(Y,z)=>{if(UJ.isNode(z)&&z.tag)q[z.tag]=!0}),Q=Object.keys(q)}else Q=[];for(let[q,Y]of J){if(q==="!!"&&Y==="tag:yaml.org,2002:")continue;if(!$||Q.some((z)=>z.startsWith(Y)))X.push(`%TAG ${q} ${Y}`)}return X.join(`
28
+ `)}}y$.defaultYaml={explicit:!1,version:"1.2"};y$.defaultTags={"!!":"tag:yaml.org,2002:"};pz.Directives=y$});var $5=_((sz)=>{var VJ=n(),iz=_6();function nz($){if(/[\x00-\x19\s,[\]{}]/.test($)){let J=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(J)}return!0}function BJ($){let X=new Set;return iz.visit($,{Value(J,Q){if(Q.anchor)X.add(Q.anchor)}}),X}function KJ($,X){for(let J=1;;++J){let Q=`${$}${J}`;if(!X.has(Q))return Q}}function rz($,X){let J=[],Q=new Map,q=null;return{onAnchor:(Y)=>{J.push(Y),q??(q=BJ($));let z=KJ(X,q);return q.add(z),z},setAnchors:()=>{for(let Y of J){let z=Q.get(Y);if(typeof z==="object"&&z.anchor&&(VJ.isScalar(z.node)||VJ.isCollection(z.node)))z.node.anchor=z.anchor;else{let G=Error("Failed to resolve repeated object (this should not happen)");throw G.source=Y,G}}},sourceObjects:Q}}sz.anchorIsValid=nz;sz.anchorNames=BJ;sz.createNodeAnchors=rz;sz.findNewAnchor=KJ});var pX=_(($G)=>{function F6($,X,J,Q){if(Q&&typeof Q==="object")if(Array.isArray(Q))for(let q=0,Y=Q.length;q<Y;++q){let z=Q[q],G=F6($,Q,String(q),z);if(G===void 0)delete Q[q];else if(G!==z)Q[q]=G}else if(Q instanceof Map)for(let q of Array.from(Q.keys())){let Y=Q.get(q),z=F6($,Q,q,Y);if(z===void 0)Q.delete(q);else if(z!==Y)Q.set(q,z)}else if(Q instanceof Set)for(let q of Array.from(Q)){let Y=F6($,Q,q,q);if(Y===void 0)Q.delete(q);else if(Y!==q)Q.delete(q),Q.add(Y)}else for(let[q,Y]of Object.entries(Q)){let z=F6($,Q,q,Y);if(z===void 0)delete Q[q];else if(z!==Y)Q[q]=z}return $.call(X,J,Q)}$G.applyReviver=F6});var F0=_((QG)=>{var JG=n();function MJ($,X,J){if(Array.isArray($))return $.map((Q,q)=>MJ(Q,String(q),J));if($&&typeof $.toJSON==="function"){if(!J||!JG.hasAnchor($))return $.toJSON(X,J);let Q={aliasCount:0,count:1,res:void 0};J.anchors.set($,Q),J.onCreate=(Y)=>{Q.res=Y,delete J.onCreate};let q=$.toJSON(X,J);if(J.onCreate)J.onCreate(q);return q}if(typeof $==="bigint"&&!J?.keep)return Number($);return $}QG.toJS=MJ});var X5=_((GG)=>{var YG=pX(),NJ=n(),zG=F0();class DJ{constructor($){Object.defineProperty(this,NJ.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:J,onAnchor:Q,reviver:q}={}){if(!NJ.isDocument($))throw TypeError("A document argument is required");let Y={anchors:new Map,doc:$,keep:!0,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof J==="number"?J:100},z=zG.toJS(this,"",Y);if(typeof Q==="function")for(let{count:G,res:W}of Y.anchors.values())Q(W,G);return typeof q==="function"?YG.applyReviver(q,{"":z},"",z):z}}GG.NodeBase=DJ});var I6=_((KG)=>{var HG=$5(),UG=_6(),F8=n(),VG=X5(),BG=F0();class OJ extends VG.NodeBase{constructor($){super(F8.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,X){let J;if(X?.aliasResolveCache)J=X.aliasResolveCache;else if(J=[],UG.visit($,{Node:(q,Y)=>{if(F8.isAlias(Y)||F8.hasAnchor(Y))J.push(Y)}}),X)X.aliasResolveCache=J;let Q=void 0;for(let q of J){if(q===this)break;if(q.anchor===this.source)Q=q}return Q}toJSON($,X){if(!X)return{source:this.source};let{anchors:J,doc:Q,maxAliasCount:q}=X,Y=this.resolve(Q,X);if(!Y){let G=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(G)}let z=J.get(Y);if(!z)BG.toJS(Y,null,X),z=J.get(Y);if(z?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(q>=0){if(z.count+=1,z.aliasCount===0)z.aliasCount=J5(Q,Y,J);if(z.count*z.aliasCount>q)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return z.res}toString($,X,J){let Q=`*${this.source}`;if($){if(HG.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`${Q} `}return Q}}function J5($,X,J){if(F8.isAlias(X)){let Q=X.resolve($),q=J&&Q&&J.get(Q);return q?q.count*q.aliasCount:0}else if(F8.isCollection(X)){let Q=0;for(let q of X.items){let Y=J5($,q,J);if(Y>Q)Q=Y}return Q}else if(F8.isPair(X)){let Q=J5($,X.key,J),q=J5($,X.value,J);return Math.max(Q,q)}return 1}KG.Alias=OJ});var M$=_((LG)=>{var NG=n(),DG=X5(),OG=F0(),wG=($)=>!$||typeof $!=="function"&&typeof $!=="object";class s0 extends DG.NodeBase{constructor($){super(NG.SCALAR);this.value=$}toJSON($,X){return X?.keep?this.value:OG.toJS(this.value,$,X)}toString(){return String(this.value)}}s0.BLOCK_FOLDED="BLOCK_FOLDED";s0.BLOCK_LITERAL="BLOCK_LITERAL";s0.PLAIN="PLAIN";s0.QUOTE_DOUBLE="QUOTE_DOUBLE";s0.QUOTE_SINGLE="QUOTE_SINGLE";LG.Scalar=s0;LG.isScalarValue=wG});var E6=_((ZG)=>{var _G=I6(),a0=n(),wJ=M$(),FG="tag:yaml.org,2002:";function IG($,X,J){if(X){let Q=J.filter((Y)=>Y.tag===X),q=Q.find((Y)=>!Y.format)??Q[0];if(!q)throw Error(`Tag ${X} not found`);return q}return J.find((Q)=>Q.identify?.($)&&!Q.format)}function EG($,X,J){if(a0.isDocument($))$=$.contents;if(a0.isNode($))return $;if(a0.isPair($)){let V=J.schema[a0.MAP].createNode?.(J.schema,null,J);return V.items.push($),V}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:Q,onAnchor:q,onTagObj:Y,schema:z,sourceObjects:G}=J,W=void 0;if(Q&&$&&typeof $==="object")if(W=G.get($),W)return W.anchor??(W.anchor=q($)),new _G.Alias(W.anchor);else W={anchor:null,node:null},G.set($,W);if(X?.startsWith("!!"))X=FG+X.slice(2);let H=IG($,X,z.tags);if(!H){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new wJ.Scalar($);if(W)W.node=V;return V}H=$ instanceof Map?z[a0.MAP]:(Symbol.iterator in Object($))?z[a0.SEQ]:z[a0.MAP]}if(Y)Y(H),delete J.onTagObj;let U=H?.createNode?H.createNode(J.schema,$,J):typeof H?.nodeClass?.from==="function"?H.nodeClass.from(J.schema,$,J):new wJ.Scalar($);if(X)U.tag=X;else if(!H.default)U.tag=H.tag;if(W)W.node=U;return U}ZG.createNode=EG});var Q5=_((CG)=>{var SG=E6(),$0=n(),jG=X5();function dX($,X,J){let Q=J;for(let q=X.length-1;q>=0;--q){let Y=X[q];if(typeof Y==="number"&&Number.isInteger(Y)&&Y>=0){let z=[];z[Y]=Q,Q=z}else Q=new Map([[Y,Q]])}return SG.createNode(Q,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var LJ=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class RJ extends jG.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((J)=>$0.isNode(J)||$0.isPair(J)?J.clone($):J),this.range)X.range=this.range.slice();return X}addIn($,X){if(LJ($))this.add(X);else{let[J,...Q]=$,q=this.get(J,!0);if($0.isCollection(q))q.addIn(Q,X);else if(q===void 0&&this.schema)this.set(J,dX(this.schema,Q,X));else throw Error(`Expected YAML collection at ${J}. Remaining path: ${Q}`)}}deleteIn($){let[X,...J]=$;if(J.length===0)return this.delete(X);let Q=this.get(X,!0);if($0.isCollection(Q))return Q.deleteIn(J);else throw Error(`Expected YAML collection at ${X}. Remaining path: ${J}`)}getIn($,X){let[J,...Q]=$,q=this.get(J,!0);if(Q.length===0)return!X&&$0.isScalar(q)?q.value:q;else return $0.isCollection(q)?q.getIn(Q,X):void 0}hasAllNullValues($){return this.items.every((X)=>{if(!$0.isPair(X))return!1;let J=X.value;return J==null||$&&$0.isScalar(J)&&J.value==null&&!J.commentBefore&&!J.comment&&!J.tag})}hasIn($){let[X,...J]=$;if(J.length===0)return this.has(X);let Q=this.get(X,!0);return $0.isCollection(Q)?Q.hasIn(J):!1}setIn($,X){let[J,...Q]=$;if(Q.length===0)this.set(J,X);else{let q=this.get(J,!0);if($0.isCollection(q))q.setIn(Q,X);else if(q===void 0&&this.schema)this.set(J,dX(this.schema,Q,X));else throw Error(`Expected YAML collection at ${J}. Remaining path: ${Q}`)}}}CG.Collection=RJ;CG.collectionFromPath=dX;CG.isEmptyPath=LJ});var Z6=_((yG)=>{var kG=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function iX($,X){if(/^\n+$/.test($))return $.substring(1);return X?$.replace(/^(?! *$)/gm,X):$}var xG=($,X,J)=>$.endsWith(`
29
+ `)?iX(J,X):J.includes(`
30
30
  `)?`
31
- `+lX(J,X):($.endsWith(" ")?"":" ")+J;PG.indentComment=lX;PG.lineComment=CG;PG.stringifyComment=jG});var LJ=_((yG)=>{function xG($,X,J="flow",{indentAtStart:Q,lineWidth:q=80,minContentWidth:Y=20,onFold:z,onOverflow:G}={}){if(!q||q<0)return $;if(q<Y)Y=0;let W=Math.max(1+Y,1+q-X.length);if($.length<=W)return $;let H=[],U={},V=q-X.length;if(typeof Q==="number")if(Q>q-Math.max(2,Y))H.push(0);else V=q-Q;let B=void 0,D=void 0,w=!1,M=-1,N=-1,L=-1;if(J==="block"){if(M=wJ($,M,X.length),M!==-1)V=M+W}for(let Z;Z=$[M+=1];){if(J==="quoted"&&Z==="\\"){switch(N=M,$[M+1]){case"x":M+=3;break;case"u":M+=5;break;case"U":M+=9;break;default:M+=1}L=M}if(Z===`
32
- `){if(J==="block")M=wJ($,M,X.length);V=M+X.length+W,B=void 0}else{if(Z===" "&&D&&D!==" "&&D!==`
31
+ `+iX(J,X):($.endsWith(" ")?"":" ")+J;yG.indentComment=iX;yG.lineComment=xG;yG.stringifyComment=kG});var _J=_((mG)=>{function uG($,X,J="flow",{indentAtStart:Q,lineWidth:q=80,minContentWidth:Y=20,onFold:z,onOverflow:G}={}){if(!q||q<0)return $;if(q<Y)Y=0;let W=Math.max(1+Y,1+q-X.length);if($.length<=W)return $;let H=[],U={},V=q-X.length;if(typeof Q==="number")if(Q>q-Math.max(2,Y))H.push(0);else V=q-Q;let B=void 0,D=void 0,w=!1,M=-1,N=-1,L=-1;if(J==="block"){if(M=AJ($,M,X.length),M!==-1)V=M+W}for(let T;T=$[M+=1];){if(J==="quoted"&&T==="\\"){switch(N=M,$[M+1]){case"x":M+=3;break;case"u":M+=5;break;case"U":M+=9;break;default:M+=1}L=M}if(T===`
32
+ `){if(J==="block")M=AJ($,M,X.length);V=M+X.length+W,B=void 0}else{if(T===" "&&D&&D!==" "&&D!==`
33
33
  `&&D!=="\t"){let y=$[M+1];if(y&&y!==" "&&y!==`
34
- `&&y!=="\t")B=M}if(M>=V)if(B)H.push(B),V=B+W,B=void 0;else if(J==="quoted"){while(D===" "||D==="\t")D=Z,Z=$[M+=1],w=!0;let y=M>L+1?M-2:N-1;if(U[y])return $;H.push(y),U[y]=!0,V=y+W,B=void 0}else w=!0}D=Z}if(w&&G)G();if(H.length===0)return $;if(z)z();let I=$.slice(0,H[0]);for(let Z=0;Z<H.length;++Z){let y=H[Z],x=H[Z+1]||$.length;if(y===0)I=`
34
+ `&&y!=="\t")B=M}if(M>=V)if(B)H.push(B),V=B+W,B=void 0;else if(J==="quoted"){while(D===" "||D==="\t")D=T,T=$[M+=1],w=!0;let y=M>L+1?M-2:N-1;if(U[y])return $;H.push(y),U[y]=!0,V=y+W,B=void 0}else w=!0}D=T}if(w&&G)G();if(H.length===0)return $;if(z)z();let I=$.slice(0,H[0]);for(let T=0;T<H.length;++T){let y=H[T],x=H[T+1]||$.length;if(y===0)I=`
35
35
  ${X}${$.slice(0,x)}`;else{if(J==="quoted"&&U[y])I+=`${$[y]}\\`;I+=`
36
- ${X}${$.slice(y+1,x)}`}}return I}function wJ($,X,J){let Q=X,q=X+1,Y=$[q];while(Y===" "||Y==="\t")if(X<q+J)Y=$[++X];else{do Y=$[++X];while(Y&&Y!==`
37
- `);Q=X,q=X+1,Y=$[q]}return Q}yG.FOLD_BLOCK="block";yG.FOLD_FLOW="flow";yG.FOLD_QUOTED="quoted";yG.foldFlowLines=xG});var T6=_((pG)=>{var u$=M$(),F0=LJ(),X5=($,X)=>({indentAtStart:X?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),J5=($)=>/^(%|---|\.\.\.)/m.test($);function mG($,X,J){if(!X||X<0)return!1;let Q=X-J,q=$.length;if(q<=Q)return!1;for(let Y=0,z=0;Y<q;++Y)if($[Y]===`
38
- `){if(Y-z>Q)return!0;if(z=Y+1,q-z<=Q)return!1}return!0}function E6($,X){let J=JSON.stringify($);if(X.options.doubleQuotedAsJSON)return J;let{implicitKey:Q}=X,q=X.options.doubleQuotedMinMultiLineLength,Y=X.indent||(J5($)?" ":""),z="",G=0;for(let W=0,H=J[W];H;H=J[++W]){if(H===" "&&J[W+1]==="\\"&&J[W+2]==="n")z+=J.slice(G,W)+"\\ ",W+=1,G=W,H="\\";if(H==="\\")switch(J[W+1]){case"u":{z+=J.slice(G,W);let U=J.substr(W+2,4);switch(U){case"0000":z+="\\0";break;case"0007":z+="\\a";break;case"000b":z+="\\v";break;case"001b":z+="\\e";break;case"0085":z+="\\N";break;case"00a0":z+="\\_";break;case"2028":z+="\\L";break;case"2029":z+="\\P";break;default:if(U.substr(0,2)==="00")z+="\\x"+U.substr(2);else z+=J.substr(W,6)}W+=5,G=W+1}break;case"n":if(Q||J[W+2]==='"'||J.length<q)W+=1;else{z+=J.slice(G,W)+`
36
+ ${X}${$.slice(y+1,x)}`}}return I}function AJ($,X,J){let Q=X,q=X+1,Y=$[q];while(Y===" "||Y==="\t")if(X<q+J)Y=$[++X];else{do Y=$[++X];while(Y&&Y!==`
37
+ `);Q=X,q=X+1,Y=$[q]}return Q}mG.FOLD_BLOCK="block";mG.FOLD_FLOW="flow";mG.FOLD_QUOTED="quoted";mG.foldFlowLines=uG});var S6=_((sG)=>{var u$=M$(),I0=_J(),Y5=($,X)=>({indentAtStart:X?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),z5=($)=>/^(%|---|\.\.\.)/m.test($);function iG($,X,J){if(!X||X<0)return!1;let Q=X-J,q=$.length;if(q<=Q)return!1;for(let Y=0,z=0;Y<q;++Y)if($[Y]===`
38
+ `){if(Y-z>Q)return!0;if(z=Y+1,q-z<=Q)return!1}return!0}function T6($,X){let J=JSON.stringify($);if(X.options.doubleQuotedAsJSON)return J;let{implicitKey:Q}=X,q=X.options.doubleQuotedMinMultiLineLength,Y=X.indent||(z5($)?" ":""),z="",G=0;for(let W=0,H=J[W];H;H=J[++W]){if(H===" "&&J[W+1]==="\\"&&J[W+2]==="n")z+=J.slice(G,W)+"\\ ",W+=1,G=W,H="\\";if(H==="\\")switch(J[W+1]){case"u":{z+=J.slice(G,W);let U=J.substr(W+2,4);switch(U){case"0000":z+="\\0";break;case"0007":z+="\\a";break;case"000b":z+="\\v";break;case"001b":z+="\\e";break;case"0085":z+="\\N";break;case"00a0":z+="\\_";break;case"2028":z+="\\L";break;case"2029":z+="\\P";break;default:if(U.substr(0,2)==="00")z+="\\x"+U.substr(2);else z+=J.substr(W,6)}W+=5,G=W+1}break;case"n":if(Q||J[W+2]==='"'||J.length<q)W+=1;else{z+=J.slice(G,W)+`
39
39
 
40
40
  `;while(J[W+2]==="\\"&&J[W+3]==="n"&&J[W+4]!=='"')z+=`
41
- `,W+=2;if(z+=Y,J[W+2]===" ")z+="\\";W+=1,G=W+1}break;default:W+=1}}return z=G?z+J.slice(G):J,Q?z:F0.foldFlowLines(z,Y,F0.FOLD_QUOTED,X5(X,!1))}function cX($,X){if(X.options.singleQuote===!1||X.implicitKey&&$.includes(`
42
- `)||/[ \t]\n|\n[ \t]/.test($))return E6($,X);let J=X.indent||(J5($)?" ":""),Q="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
- ${J}`)+"'";return X.implicitKey?Q:F0.foldFlowLines(Q,J,F0.FOLD_FLOW,X5(X,!1))}function F8($,X){let{singleQuote:J}=X.options,Q;if(J===!1)Q=E6;else{let q=$.includes('"'),Y=$.includes("'");if(q&&!Y)Q=cX;else if(Y&&!q)Q=E6;else Q=J?cX:E6}return Q($,X)}var pX;try{pX=new RegExp(`(^|(?<!
41
+ `,W+=2;if(z+=Y,J[W+2]===" ")z+="\\";W+=1,G=W+1}break;default:W+=1}}return z=G?z+J.slice(G):J,Q?z:I0.foldFlowLines(z,Y,I0.FOLD_QUOTED,Y5(X,!1))}function nX($,X){if(X.options.singleQuote===!1||X.implicitKey&&$.includes(`
42
+ `)||/[ \t]\n|\n[ \t]/.test($))return T6($,X);let J=X.indent||(z5($)?" ":""),Q="'"+$.replace(/'/g,"''").replace(/\n+/g,`$&
43
+ ${J}`)+"'";return X.implicitKey?Q:I0.foldFlowLines(Q,J,I0.FOLD_FLOW,Y5(X,!1))}function I8($,X){let{singleQuote:J}=X.options,Q;if(J===!1)Q=T6;else{let q=$.includes('"'),Y=$.includes("'");if(q&&!Y)Q=nX;else if(Y&&!q)Q=T6;else Q=J?nX:T6}return Q($,X)}var rX;try{rX=new RegExp(`(^|(?<!
44
44
  ))
45
45
  +(?!
46
- |$)`,"g")}catch{pX=/\n+(?!\n|$)/g}function $5({comment:$,type:X,value:J},Q,q,Y){let{blockQuote:z,commentString:G,lineWidth:W}=Q.options;if(!z||/\n[\t ]+$/.test(J))return F8(J,Q);let H=Q.indent||(Q.forceBlockIndent||J5(J)?" ":""),U=z==="literal"?!0:z==="folded"||X===u$.Scalar.BLOCK_FOLDED?!1:X===u$.Scalar.BLOCK_LITERAL?!0:!mG(J,W,H.length);if(!J)return U?`|
46
+ |$)`,"g")}catch{rX=/\n+(?!\n|$)/g}function q5({comment:$,type:X,value:J},Q,q,Y){let{blockQuote:z,commentString:G,lineWidth:W}=Q.options;if(!z||/\n[\t ]+$/.test(J))return I8(J,Q);let H=Q.indent||(Q.forceBlockIndent||z5(J)?" ":""),U=z==="literal"?!0:z==="folded"||X===u$.Scalar.BLOCK_FOLDED?!1:X===u$.Scalar.BLOCK_LITERAL?!0:!iG(J,W,H.length);if(!J)return U?`|
47
47
  `:`>
48
48
  `;let V,B;for(B=J.length;B>0;--B){let x=J[B-1];if(x!==`
49
49
  `&&x!=="\t"&&x!==" ")break}let D=J.substring(B),w=D.indexOf(`
50
50
  `);if(w===-1)V="-";else if(J===D||w!==D.length-1){if(V="+",Y)Y()}else V="";if(D){if(J=J.slice(0,-D.length),D[D.length-1]===`
51
- `)D=D.slice(0,-1);D=D.replace(pX,`$&${H}`)}let M=!1,N,L=-1;for(N=0;N<J.length;++N){let x=J[N];if(x===" ")M=!0;else if(x===`
51
+ `)D=D.slice(0,-1);D=D.replace(rX,`$&${H}`)}let M=!1,N,L=-1;for(N=0;N<J.length;++N){let x=J[N];if(x===" ")M=!0;else if(x===`
52
52
  `)L=N;else break}let I=J.substring(0,L<N?L+1:N);if(I)J=J.substring(I.length),I=I.replace(/\n+/g,`$&${H}`);let y=(M?H?"2":"1":"")+V;if($){if(y+=" "+G($.replace(/ ?[\r\n]+/g," ")),q)q()}if(!U){let x=J.replace(/\n+/g,`
53
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${H}`),k=!1,l=X5(Q,!0);if(z!=="folded"&&X!==u$.Scalar.BLOCK_FOLDED)l.onOverflow=()=>{k=!0};let j=F0.foldFlowLines(`${I}${x}${D}`,H,F0.FOLD_BLOCK,l);if(!k)return`>${y}
53
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${H}`),k=!1,l=Y5(Q,!0);if(z!=="folded"&&X!==u$.Scalar.BLOCK_FOLDED)l.onOverflow=()=>{k=!0};let j=I0.foldFlowLines(`${I}${x}${D}`,H,I0.FOLD_BLOCK,l);if(!k)return`>${y}
54
54
  ${H}${j}`}return J=J.replace(/\n+/g,`$&${H}`),`|${y}
55
- ${H}${I}${J}${D}`}function lG($,X,J,Q){let{type:q,value:Y}=$,{actualString:z,implicitKey:G,indent:W,indentStep:H,inFlow:U}=X;if(G&&Y.includes(`
56
- `)||U&&/[[\]{},]/.test(Y))return F8(Y,X);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Y))return G||U||!Y.includes(`
57
- `)?F8(Y,X):$5($,X,J,Q);if(!G&&!U&&q!==u$.Scalar.PLAIN&&Y.includes(`
58
- `))return $5($,X,J,Q);if(J5(Y)){if(W==="")return X.forceBlockIndent=!0,$5($,X,J,Q);else if(G&&W===H)return F8(Y,X)}let V=Y.replace(/\n+/g,`$&
59
- ${W}`);if(z){let B=(M)=>M.default&&M.tag!=="tag:yaml.org,2002:str"&&M.test?.test(V),{compat:D,tags:w}=X.doc.schema;if(w.some(B)||D?.some(B))return F8(Y,X)}return G?V:F0.foldFlowLines(V,W,F0.FOLD_FLOW,X5(X,!1))}function cG($,X,J,Q){let{implicitKey:q,inFlow:Y}=X,z=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:G}=$;if(G!==u$.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(z.value))G=u$.Scalar.QUOTE_DOUBLE}let W=(U)=>{switch(U){case u$.Scalar.BLOCK_FOLDED:case u$.Scalar.BLOCK_LITERAL:return q||Y?F8(z.value,X):$5(z,X,J,Q);case u$.Scalar.QUOTE_DOUBLE:return E6(z.value,X);case u$.Scalar.QUOTE_SINGLE:return cX(z.value,X);case u$.Scalar.PLAIN:return lG(z,X,J,Q);default:return null}},H=W(G);if(H===null){let{defaultKeyType:U,defaultStringType:V}=X.options,B=q&&U||V;if(H=W(B),H===null)throw Error(`Unsupported default string type ${B}`)}return H}pG.stringifyString=cG});var Z6=_((eG)=>{var iG=a2(),I0=n(),nG=I6(),rG=T6();function sG($,X){let J=Object.assign({blockQuote:!0,commentString:nG.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,X),Q;switch(J.collectionStyle){case"block":Q=!1;break;case"flow":Q=!0;break;default:Q=null}return{anchors:new Set,doc:$,flowCollectionPadding:J.flowCollectionPadding?" ":"",indent:"",indentStep:typeof J.indent==="number"?" ".repeat(J.indent):" ",inFlow:Q,options:J}}function aG($,X){if(X.tag){let q=$.filter((Y)=>Y.tag===X.tag);if(q.length>0)return q.find((Y)=>Y.format===X.format)??q[0]}let J=void 0,Q;if(I0.isScalar(X)){Q=X.value;let q=$.filter((Y)=>Y.identify?.(Q));if(q.length>1){let Y=q.filter((z)=>z.test);if(Y.length>0)q=Y}J=q.find((Y)=>Y.format===X.format)??q.find((Y)=>!Y.format)}else Q=X,J=$.find((q)=>q.nodeClass&&Q instanceof q.nodeClass);if(!J){let q=Q?.constructor?.name??(Q===null?"null":typeof Q);throw Error(`Tag not resolved for ${q} value`)}return J}function oG($,X,{anchors:J,doc:Q}){if(!Q.directives)return"";let q=[],Y=(I0.isScalar($)||I0.isCollection($))&&$.anchor;if(Y&&iG.anchorIsValid(Y))J.add(Y),q.push(`&${Y}`);let z=$.tag??(X.default?null:X.tag);if(z)q.push(Q.directives.tagString(z));return q.join(" ")}function tG($,X,J,Q){if(I0.isPair($))return $.toString(X,J,Q);if(I0.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,Y=I0.isNode($)?$:X.doc.createNode($,{onTagObj:(W)=>q=W});q??(q=aG(X.doc.schema.tags,Y));let z=oG(Y,q,X);if(z.length>0)X.indentAtStart=(X.indentAtStart??0)+z.length+1;let G=typeof q.stringify==="function"?q.stringify(Y,X,J,Q):I0.isScalar(Y)?rG.stringifyString(Y,X,J,Q):Y.toString(X,J,Q);if(!z)return G;return I0.isScalar(Y)||G[0]==="{"||G[0]==="["?`${z} ${G}`:`${z}
60
- ${X.indent}${G}`}eG.createStringifyContext=sG;eG.stringify=tG});var _J=_((QW)=>{var V0=n(),RJ=M$(),AJ=Z6(),S6=I6();function JW({key:$,value:X},J,Q,q){let{allNullValues:Y,doc:z,indent:G,indentStep:W,options:{commentString:H,indentSeq:U,simpleKeys:V}}=J,B=V0.isNode($)&&$.comment||null;if(V){if(B)throw Error("With simple keys, key nodes cannot have comments");if(V0.isCollection($)||!V0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let D=!V&&(!$||B&&X==null&&!J.inFlow||V0.isCollection($)||(V0.isScalar($)?$.type===RJ.Scalar.BLOCK_FOLDED||$.type===RJ.Scalar.BLOCK_LITERAL:typeof $==="object"));J=Object.assign({},J,{allNullValues:!1,implicitKey:!D&&(V||!Y),indent:G+W});let w=!1,M=!1,N=AJ.stringify($,J,()=>w=!0,()=>M=!0);if(!D&&!J.inFlow&&N.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");D=!0}if(J.inFlow){if(Y||X==null){if(w&&Q)Q();return N===""?"?":D?`? ${N}`:N}}else if(Y&&!V||X==null&&D){if(N=`? ${N}`,B&&!w)N+=S6.lineComment(N,J.indent,H(B));else if(M&&q)q();return N}if(w)B=null;if(D){if(B)N+=S6.lineComment(N,J.indent,H(B));N=`? ${N}
61
- ${G}:`}else if(N=`${N}:`,B)N+=S6.lineComment(N,J.indent,H(B));let L,I,Z;if(V0.isNode(X))L=!!X.spaceBefore,I=X.commentBefore,Z=X.comment;else if(L=!1,I=null,Z=null,X&&typeof X==="object")X=z.createNode(X);if(J.implicitKey=!1,!D&&!B&&V0.isScalar(X))J.indentAtStart=N.length+1;if(M=!1,!U&&W.length>=2&&!J.inFlow&&!D&&V0.isSeq(X)&&!X.flow&&!X.tag&&!X.anchor)J.indent=J.indent.substring(2);let y=!1,x=AJ.stringify(X,J,()=>y=!0,()=>M=!0),k=" ";if(B||L||I){if(k=L?`
55
+ ${H}${I}${J}${D}`}function nG($,X,J,Q){let{type:q,value:Y}=$,{actualString:z,implicitKey:G,indent:W,indentStep:H,inFlow:U}=X;if(G&&Y.includes(`
56
+ `)||U&&/[[\]{},]/.test(Y))return I8(Y,X);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(Y))return G||U||!Y.includes(`
57
+ `)?I8(Y,X):q5($,X,J,Q);if(!G&&!U&&q!==u$.Scalar.PLAIN&&Y.includes(`
58
+ `))return q5($,X,J,Q);if(z5(Y)){if(W==="")return X.forceBlockIndent=!0,q5($,X,J,Q);else if(G&&W===H)return I8(Y,X)}let V=Y.replace(/\n+/g,`$&
59
+ ${W}`);if(z){let B=(M)=>M.default&&M.tag!=="tag:yaml.org,2002:str"&&M.test?.test(V),{compat:D,tags:w}=X.doc.schema;if(w.some(B)||D?.some(B))return I8(Y,X)}return G?V:I0.foldFlowLines(V,W,I0.FOLD_FLOW,Y5(X,!1))}function rG($,X,J,Q){let{implicitKey:q,inFlow:Y}=X,z=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:G}=$;if(G!==u$.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(z.value))G=u$.Scalar.QUOTE_DOUBLE}let W=(U)=>{switch(U){case u$.Scalar.BLOCK_FOLDED:case u$.Scalar.BLOCK_LITERAL:return q||Y?I8(z.value,X):q5(z,X,J,Q);case u$.Scalar.QUOTE_DOUBLE:return T6(z.value,X);case u$.Scalar.QUOTE_SINGLE:return nX(z.value,X);case u$.Scalar.PLAIN:return nG(z,X,J,Q);default:return null}},H=W(G);if(H===null){let{defaultKeyType:U,defaultStringType:V}=X.options,B=q&&U||V;if(H=W(B),H===null)throw Error(`Unsupported default string type ${B}`)}return H}sG.stringifyString=rG});var j6=_((qW)=>{var oG=$5(),E0=n(),tG=Z6(),eG=S6();function $W($,X){let J=Object.assign({blockQuote:!0,commentString:tG.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,X),Q;switch(J.collectionStyle){case"block":Q=!1;break;case"flow":Q=!0;break;default:Q=null}return{anchors:new Set,doc:$,flowCollectionPadding:J.flowCollectionPadding?" ":"",indent:"",indentStep:typeof J.indent==="number"?" ".repeat(J.indent):" ",inFlow:Q,options:J}}function XW($,X){if(X.tag){let q=$.filter((Y)=>Y.tag===X.tag);if(q.length>0)return q.find((Y)=>Y.format===X.format)??q[0]}let J=void 0,Q;if(E0.isScalar(X)){Q=X.value;let q=$.filter((Y)=>Y.identify?.(Q));if(q.length>1){let Y=q.filter((z)=>z.test);if(Y.length>0)q=Y}J=q.find((Y)=>Y.format===X.format)??q.find((Y)=>!Y.format)}else Q=X,J=$.find((q)=>q.nodeClass&&Q instanceof q.nodeClass);if(!J){let q=Q?.constructor?.name??(Q===null?"null":typeof Q);throw Error(`Tag not resolved for ${q} value`)}return J}function JW($,X,{anchors:J,doc:Q}){if(!Q.directives)return"";let q=[],Y=(E0.isScalar($)||E0.isCollection($))&&$.anchor;if(Y&&oG.anchorIsValid(Y))J.add(Y),q.push(`&${Y}`);let z=$.tag??(X.default?null:X.tag);if(z)q.push(Q.directives.tagString(z));return q.join(" ")}function QW($,X,J,Q){if(E0.isPair($))return $.toString(X,J,Q);if(E0.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,Y=E0.isNode($)?$:X.doc.createNode($,{onTagObj:(W)=>q=W});q??(q=XW(X.doc.schema.tags,Y));let z=JW(Y,q,X);if(z.length>0)X.indentAtStart=(X.indentAtStart??0)+z.length+1;let G=typeof q.stringify==="function"?q.stringify(Y,X,J,Q):E0.isScalar(Y)?eG.stringifyString(Y,X,J,Q):Y.toString(X,J,Q);if(!z)return G;return E0.isScalar(Y)||G[0]==="{"||G[0]==="["?`${z} ${G}`:`${z}
60
+ ${X.indent}${G}`}qW.createStringifyContext=$W;qW.stringify=QW});var EJ=_((WW)=>{var B0=n(),FJ=M$(),IJ=j6(),C6=Z6();function GW({key:$,value:X},J,Q,q){let{allNullValues:Y,doc:z,indent:G,indentStep:W,options:{commentString:H,indentSeq:U,simpleKeys:V}}=J,B=B0.isNode($)&&$.comment||null;if(V){if(B)throw Error("With simple keys, key nodes cannot have comments");if(B0.isCollection($)||!B0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let D=!V&&(!$||B&&X==null&&!J.inFlow||B0.isCollection($)||(B0.isScalar($)?$.type===FJ.Scalar.BLOCK_FOLDED||$.type===FJ.Scalar.BLOCK_LITERAL:typeof $==="object"));J=Object.assign({},J,{allNullValues:!1,implicitKey:!D&&(V||!Y),indent:G+W});let w=!1,M=!1,N=IJ.stringify($,J,()=>w=!0,()=>M=!0);if(!D&&!J.inFlow&&N.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");D=!0}if(J.inFlow){if(Y||X==null){if(w&&Q)Q();return N===""?"?":D?`? ${N}`:N}}else if(Y&&!V||X==null&&D){if(N=`? ${N}`,B&&!w)N+=C6.lineComment(N,J.indent,H(B));else if(M&&q)q();return N}if(w)B=null;if(D){if(B)N+=C6.lineComment(N,J.indent,H(B));N=`? ${N}
61
+ ${G}:`}else if(N=`${N}:`,B)N+=C6.lineComment(N,J.indent,H(B));let L,I,T;if(B0.isNode(X))L=!!X.spaceBefore,I=X.commentBefore,T=X.comment;else if(L=!1,I=null,T=null,X&&typeof X==="object")X=z.createNode(X);if(J.implicitKey=!1,!D&&!B&&B0.isScalar(X))J.indentAtStart=N.length+1;if(M=!1,!U&&W.length>=2&&!J.inFlow&&!D&&B0.isSeq(X)&&!X.flow&&!X.tag&&!X.anchor)J.indent=J.indent.substring(2);let y=!1,x=IJ.stringify(X,J,()=>y=!0,()=>M=!0),k=" ";if(B||L||I){if(k=L?`
62
62
  `:"",I){let l=H(I);k+=`
63
- ${S6.indentComment(l,J.indent)}`}if(x===""&&!J.inFlow){if(k===`
64
- `&&Z)k=`
63
+ ${C6.indentComment(l,J.indent)}`}if(x===""&&!J.inFlow){if(k===`
64
+ `&&T)k=`
65
65
 
66
66
  `}else k+=`
67
- ${J.indent}`}else if(!D&&V0.isCollection(X)){let l=x[0],j=x.indexOf(`
68
- `),G$=j!==-1,t$=J.inFlow??X.flow??X.items.length===0;if(G$||!t$){let i=!1;if(G$&&(l==="&"||l==="!")){let V$=x.indexOf(" ");if(l==="&"&&V$!==-1&&V$<j&&x[V$+1]==="!")V$=x.indexOf(" ",V$+1);if(V$===-1||j<V$)i=!0}if(!i)k=`
67
+ ${J.indent}`}else if(!D&&B0.isCollection(X)){let l=x[0],j=x.indexOf(`
68
+ `),H$=j!==-1,t$=J.inFlow??X.flow??X.items.length===0;if(H$||!t$){let i=!1;if(H$&&(l==="&"||l==="!")){let V$=x.indexOf(" ");if(l==="&"&&V$!==-1&&V$<j&&x[V$+1]==="!")V$=x.indexOf(" ",V$+1);if(V$===-1||j<V$)i=!0}if(!i)k=`
69
69
  ${J.indent}`}}else if(x===""||x[0]===`
70
- `)k="";if(N+=k+x,J.inFlow){if(y&&Q)Q()}else if(Z&&!y)N+=S6.lineComment(N,J.indent,H(Z));else if(M&&q)q();return N}QW.stringifyPair=JW});var dX=_((GW)=>{var FJ=W$("process");function YW($,...X){if($==="debug")console.log(...X)}function zW($,X){if($==="debug"||$==="warn")if(typeof FJ.emitWarning==="function")FJ.emitWarning(X);else console.warn(X)}GW.debug=YW;GW.warn=zW});var Y5=_((VW)=>{var j6=n(),IJ=M$(),Q5="<<",q5={identify:($)=>$===Q5||typeof $==="symbol"&&$.description===Q5,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new IJ.Scalar(Symbol(Q5)),{addToJSMap:EJ}),stringify:()=>Q5},UW=($,X)=>(q5.identify(X)||j6.isScalar(X)&&(!X.type||X.type===IJ.Scalar.PLAIN)&&q5.identify(X.value))&&$?.doc.schema.tags.some((J)=>J.tag===q5.tag&&J.default);function EJ($,X,J){if(J=$&&j6.isAlias(J)?J.resolve($.doc):J,j6.isSeq(J))for(let Q of J.items)iX($,X,Q);else if(Array.isArray(J))for(let Q of J)iX($,X,Q);else iX($,X,J)}function iX($,X,J){let Q=$&&j6.isAlias(J)?J.resolve($.doc):J;if(!j6.isMap(Q))throw Error("Merge sources must be maps or map aliases");let q=Q.toJSON(null,$,Map);for(let[Y,z]of q)if(X instanceof Map){if(!X.has(Y))X.set(Y,z)}else if(X instanceof Set)X.add(Y);else if(!Object.prototype.hasOwnProperty.call(X,Y))Object.defineProperty(X,Y,{value:z,writable:!0,enumerable:!0,configurable:!0});return X}VW.addMergeToJSMap=EJ;VW.isMergeKey=UW;VW.merge=q5});var rX=_((LW)=>{var NW=dX(),TJ=Y5(),DW=Z6(),ZJ=n(),nX=_0();function OW($,X,{key:J,value:Q}){if(ZJ.isNode(J)&&J.addToJSMap)J.addToJSMap($,X,Q);else if(TJ.isMergeKey($,J))TJ.addMergeToJSMap($,X,Q);else{let q=nX.toJS(J,"",$);if(X instanceof Map)X.set(q,nX.toJS(Q,q,$));else if(X instanceof Set)X.add(q);else{let Y=wW(J,q,$),z=nX.toJS(Q,Y,$);if(Y in X)Object.defineProperty(X,Y,{value:z,writable:!0,enumerable:!0,configurable:!0});else X[Y]=z}}return X}function wW($,X,J){if(X===null)return"";if(typeof X!=="object")return String(X);if(ZJ.isNode($)&&J?.doc){let Q=DW.createStringifyContext(J.doc,{});Q.anchors=new Set;for(let Y of J.anchors.keys())Q.anchors.add(Y.anchor);Q.inFlow=!0,Q.inStringifyKey=!0;let q=$.toString(Q);if(!J.mapKeyWarned){let Y=JSON.stringify(q);if(Y.length>40)Y=Y.substring(0,36)+'..."';NW.warn(J.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Y}. Set mapAsMap: true to use object keys.`),J.mapKeyWarned=!0}return q}return JSON.stringify(X)}LW.addPairToJSMap=OW});var E0=_((IW)=>{var SJ=F6(),AW=_J(),_W=rX(),z5=n();function FW($,X,J){let Q=SJ.createNode($,void 0,J),q=SJ.createNode(X,void 0,J);return new G5(Q,q)}class G5{constructor($,X=null){Object.defineProperty(this,z5.NODE_TYPE,{value:z5.PAIR}),this.key=$,this.value=X}clone($){let{key:X,value:J}=this;if(z5.isNode(X))X=X.clone($);if(z5.isNode(J))J=J.clone($);return new G5(X,J)}toJSON($,X){let J=X?.mapAsMap?new Map:{};return _W.addPairToJSMap(X,J,this)}toString($,X,J){return $?.doc?AW.stringifyPair(this,$,X,J):JSON.stringify(this)}}IW.Pair=G5;IW.createPair=FW});var sX=_((CW)=>{var a0=n(),jJ=Z6(),W5=I6();function ZW($,X,J){return(X.inFlow??$.flow?jW:SW)($,X,J)}function SW({comment:$,items:X},J,{blockItemPrefix:Q,flowChars:q,itemIndent:Y,onChompKeep:z,onComment:G}){let{indent:W,options:{commentString:H}}=J,U=Object.assign({},J,{indent:Y,type:null}),V=!1,B=[];for(let w=0;w<X.length;++w){let M=X[w],N=null;if(a0.isNode(M)){if(!V&&M.spaceBefore)B.push("");if(H5(J,B,M.commentBefore,V),M.comment)N=M.comment}else if(a0.isPair(M)){let I=a0.isNode(M.key)?M.key:null;if(I){if(!V&&I.spaceBefore)B.push("");H5(J,B,I.commentBefore,V)}}V=!1;let L=jJ.stringify(M,U,()=>N=null,()=>V=!0);if(N)L+=W5.lineComment(L,Y,H(N));if(V&&N)V=!1;B.push(Q+L)}let D;if(B.length===0)D=q.start+q.end;else{D=B[0];for(let w=1;w<B.length;++w){let M=B[w];D+=M?`
70
+ `)k="";if(N+=k+x,J.inFlow){if(y&&Q)Q()}else if(T&&!y)N+=C6.lineComment(N,J.indent,H(T));else if(M&&q)q();return N}WW.stringifyPair=GW});var sX=_((BW)=>{var ZJ=U$("process");function UW($,...X){if($==="debug")console.log(...X)}function VW($,X){if($==="debug"||$==="warn")if(typeof ZJ.emitWarning==="function")ZJ.emitWarning(X);else console.warn(X)}BW.debug=UW;BW.warn=VW});var H5=_((DW)=>{var b6=n(),TJ=M$(),G5="<<",W5={identify:($)=>$===G5||typeof $==="symbol"&&$.description===G5,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new TJ.Scalar(Symbol(G5)),{addToJSMap:SJ}),stringify:()=>G5},NW=($,X)=>(W5.identify(X)||b6.isScalar(X)&&(!X.type||X.type===TJ.Scalar.PLAIN)&&W5.identify(X.value))&&$?.doc.schema.tags.some((J)=>J.tag===W5.tag&&J.default);function SJ($,X,J){if(J=$&&b6.isAlias(J)?J.resolve($.doc):J,b6.isSeq(J))for(let Q of J.items)aX($,X,Q);else if(Array.isArray(J))for(let Q of J)aX($,X,Q);else aX($,X,J)}function aX($,X,J){let Q=$&&b6.isAlias(J)?J.resolve($.doc):J;if(!b6.isMap(Q))throw Error("Merge sources must be maps or map aliases");let q=Q.toJSON(null,$,Map);for(let[Y,z]of q)if(X instanceof Map){if(!X.has(Y))X.set(Y,z)}else if(X instanceof Set)X.add(Y);else if(!Object.prototype.hasOwnProperty.call(X,Y))Object.defineProperty(X,Y,{value:z,writable:!0,enumerable:!0,configurable:!0});return X}DW.addMergeToJSMap=SJ;DW.isMergeKey=NW;DW.merge=W5});var tX=_((IW)=>{var RW=sX(),jJ=H5(),AW=j6(),CJ=n(),oX=F0();function _W($,X,{key:J,value:Q}){if(CJ.isNode(J)&&J.addToJSMap)J.addToJSMap($,X,Q);else if(jJ.isMergeKey($,J))jJ.addMergeToJSMap($,X,Q);else{let q=oX.toJS(J,"",$);if(X instanceof Map)X.set(q,oX.toJS(Q,q,$));else if(X instanceof Set)X.add(q);else{let Y=FW(J,q,$),z=oX.toJS(Q,Y,$);if(Y in X)Object.defineProperty(X,Y,{value:z,writable:!0,enumerable:!0,configurable:!0});else X[Y]=z}}return X}function FW($,X,J){if(X===null)return"";if(typeof X!=="object")return String(X);if(CJ.isNode($)&&J?.doc){let Q=AW.createStringifyContext(J.doc,{});Q.anchors=new Set;for(let Y of J.anchors.keys())Q.anchors.add(Y.anchor);Q.inFlow=!0,Q.inStringifyKey=!0;let q=$.toString(Q);if(!J.mapKeyWarned){let Y=JSON.stringify(q);if(Y.length>40)Y=Y.substring(0,36)+'..."';RW.warn(J.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${Y}. Set mapAsMap: true to use object keys.`),J.mapKeyWarned=!0}return q}return JSON.stringify(X)}IW.addPairToJSMap=_W});var Z0=_((jW)=>{var bJ=E6(),ZW=EJ(),TW=tX(),U5=n();function SW($,X,J){let Q=bJ.createNode($,void 0,J),q=bJ.createNode(X,void 0,J);return new V5(Q,q)}class V5{constructor($,X=null){Object.defineProperty(this,U5.NODE_TYPE,{value:U5.PAIR}),this.key=$,this.value=X}clone($){let{key:X,value:J}=this;if(U5.isNode(X))X=X.clone($);if(U5.isNode(J))J=J.clone($);return new V5(X,J)}toJSON($,X){let J=X?.mapAsMap?new Map:{};return TW.addPairToJSMap(X,J,this)}toString($,X,J){return $?.doc?ZW.stringifyPair(this,$,X,J):JSON.stringify(this)}}jW.Pair=V5;jW.createPair=SW});var eX=_((xW)=>{var o0=n(),PJ=j6(),B5=Z6();function PW($,X,J){return(X.inFlow??$.flow?kW:fW)($,X,J)}function fW({comment:$,items:X},J,{blockItemPrefix:Q,flowChars:q,itemIndent:Y,onChompKeep:z,onComment:G}){let{indent:W,options:{commentString:H}}=J,U=Object.assign({},J,{indent:Y,type:null}),V=!1,B=[];for(let w=0;w<X.length;++w){let M=X[w],N=null;if(o0.isNode(M)){if(!V&&M.spaceBefore)B.push("");if(K5(J,B,M.commentBefore,V),M.comment)N=M.comment}else if(o0.isPair(M)){let I=o0.isNode(M.key)?M.key:null;if(I){if(!V&&I.spaceBefore)B.push("");K5(J,B,I.commentBefore,V)}}V=!1;let L=PJ.stringify(M,U,()=>N=null,()=>V=!0);if(N)L+=B5.lineComment(L,Y,H(N));if(V&&N)V=!1;B.push(Q+L)}let D;if(B.length===0)D=q.start+q.end;else{D=B[0];for(let w=1;w<B.length;++w){let M=B[w];D+=M?`
71
71
  ${W}${M}`:`
72
72
  `}}if($){if(D+=`
73
- `+W5.indentComment(H($),W),G)G()}else if(V&&z)z();return D}function jW({items:$},X,{flowChars:J,itemIndent:Q}){let{indent:q,indentStep:Y,flowCollectionPadding:z,options:{commentString:G}}=X;Q+=Y;let W=Object.assign({},X,{indent:Q,inFlow:!0,type:null}),H=!1,U=0,V=[];for(let w=0;w<$.length;++w){let M=$[w],N=null;if(a0.isNode(M)){if(M.spaceBefore)V.push("");if(H5(X,V,M.commentBefore,!1),M.comment)N=M.comment}else if(a0.isPair(M)){let I=a0.isNode(M.key)?M.key:null;if(I){if(I.spaceBefore)V.push("");if(H5(X,V,I.commentBefore,!1),I.comment)H=!0}let Z=a0.isNode(M.value)?M.value:null;if(Z){if(Z.comment)N=Z.comment;if(Z.commentBefore)H=!0}else if(M.value==null&&I?.comment)N=I.comment}if(N)H=!0;let L=jJ.stringify(M,W,()=>N=null);if(H||(H=V.length>U||L.includes(`
74
- `)),w<$.length-1)L+=",";else if(X.options.trailingComma){if(X.options.lineWidth>0)H||(H=V.reduce((I,Z)=>I+Z.length+2,2)+(L.length+2)>X.options.lineWidth);if(H)L+=","}if(N)L+=W5.lineComment(L,Q,G(N));V.push(L),U=V.length}let{start:B,end:D}=J;if(V.length===0)return B+D;else{if(!H){let w=V.reduce((M,N)=>M+N.length+2,2);H=X.options.lineWidth>0&&w>X.options.lineWidth}if(H){let w=B;for(let M of V)w+=M?`
73
+ `+B5.indentComment(H($),W),G)G()}else if(V&&z)z();return D}function kW({items:$},X,{flowChars:J,itemIndent:Q}){let{indent:q,indentStep:Y,flowCollectionPadding:z,options:{commentString:G}}=X;Q+=Y;let W=Object.assign({},X,{indent:Q,inFlow:!0,type:null}),H=!1,U=0,V=[];for(let w=0;w<$.length;++w){let M=$[w],N=null;if(o0.isNode(M)){if(M.spaceBefore)V.push("");if(K5(X,V,M.commentBefore,!1),M.comment)N=M.comment}else if(o0.isPair(M)){let I=o0.isNode(M.key)?M.key:null;if(I){if(I.spaceBefore)V.push("");if(K5(X,V,I.commentBefore,!1),I.comment)H=!0}let T=o0.isNode(M.value)?M.value:null;if(T){if(T.comment)N=T.comment;if(T.commentBefore)H=!0}else if(M.value==null&&I?.comment)N=I.comment}if(N)H=!0;let L=PJ.stringify(M,W,()=>N=null);if(H||(H=V.length>U||L.includes(`
74
+ `)),w<$.length-1)L+=",";else if(X.options.trailingComma){if(X.options.lineWidth>0)H||(H=V.reduce((I,T)=>I+T.length+2,2)+(L.length+2)>X.options.lineWidth);if(H)L+=","}if(N)L+=B5.lineComment(L,Q,G(N));V.push(L),U=V.length}let{start:B,end:D}=J;if(V.length===0)return B+D;else{if(!H){let w=V.reduce((M,N)=>M+N.length+2,2);H=X.options.lineWidth>0&&w>X.options.lineWidth}if(H){let w=B;for(let M of V)w+=M?`
75
75
  ${Y}${q}${M}`:`
76
76
  `;return`${w}
77
- ${q}${D}`}else return`${B}${z}${V.join(" ")}${z}${D}`}}function H5({indent:$,options:{commentString:X}},J,Q,q){if(Q&&q)Q=Q.replace(/^\n+/,"");if(Q){let Y=W5.indentComment(X(Q),$);J.push(Y.trimStart())}}CW.stringifyCollection=ZW});var Z0=_((yW)=>{var bW=sX(),fW=rX(),kW=e2(),T0=n(),U5=E0(),xW=M$();function C6($,X){let J=T0.isScalar(X)?X.value:X;for(let Q of $)if(T0.isPair(Q)){if(Q.key===X||Q.key===J)return Q;if(T0.isScalar(Q.key)&&Q.key.value===J)return Q}return}class CJ extends kW.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(T0.MAP,$);this.items=[]}static from($,X,J){let{keepUndefined:Q,replacer:q}=J,Y=new this($),z=(G,W)=>{if(typeof q==="function")W=q.call(X,G,W);else if(Array.isArray(q)&&!q.includes(G))return;if(W!==void 0||Q)Y.items.push(U5.createPair(G,W,J))};if(X instanceof Map)for(let[G,W]of X)z(G,W);else if(X&&typeof X==="object")for(let G of Object.keys(X))z(G,X[G]);if(typeof $.sortMapEntries==="function")Y.items.sort($.sortMapEntries);return Y}add($,X){let J;if(T0.isPair($))J=$;else if(!$||typeof $!=="object"||!("key"in $))J=new U5.Pair($,$?.value);else J=new U5.Pair($.key,$.value);let Q=C6(this.items,J.key),q=this.schema?.sortMapEntries;if(Q){if(!X)throw Error(`Key ${J.key} already set`);if(T0.isScalar(Q.value)&&xW.isScalarValue(J.value))Q.value.value=J.value;else Q.value=J.value}else if(q){let Y=this.items.findIndex((z)=>q(J,z)<0);if(Y===-1)this.items.push(J);else this.items.splice(Y,0,J)}else this.items.push(J)}delete($){let X=C6(this.items,$);if(!X)return!1;return this.items.splice(this.items.indexOf(X),1).length>0}get($,X){let Q=C6(this.items,$)?.value;return(!X&&T0.isScalar(Q)?Q.value:Q)??void 0}has($){return!!C6(this.items,$)}set($,X){this.add(new U5.Pair($,X),!0)}toJSON($,X,J){let Q=J?new J:X?.mapAsMap?new Map:{};if(X?.onCreate)X.onCreate(Q);for(let q of this.items)fW.addPairToJSMap(X,Q,q);return Q}toString($,X,J){if(!$)return JSON.stringify(this);for(let Q of this.items)if(!T0.isPair(Q))throw Error(`Map items must all be pairs; found ${JSON.stringify(Q)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return bW.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:J,onComment:X})}}yW.YAMLMap=CJ;yW.findPair=C6});var I8=_((mW)=>{var hW=n(),PJ=Z0(),uW={collection:"map",default:!0,nodeClass:PJ.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,X){if(!hW.isMap($))X("Expected a mapping for this tag");return $},createNode:($,X,J)=>PJ.YAMLMap.from($,X,J)};mW.map=uW});var S0=_((rW)=>{var cW=F6(),pW=sX(),dW=e2(),B5=n(),iW=M$(),nW=_0();class bJ extends dW.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(B5.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let X=V5($);if(typeof X!=="number")return!1;return this.items.splice(X,1).length>0}get($,X){let J=V5($);if(typeof J!=="number")return;let Q=this.items[J];return!X&&B5.isScalar(Q)?Q.value:Q}has($){let X=V5($);return typeof X==="number"&&X<this.items.length}set($,X){let J=V5($);if(typeof J!=="number")throw Error(`Expected a valid index, not ${$}.`);let Q=this.items[J];if(B5.isScalar(Q)&&iW.isScalarValue(X))Q.value=X;else this.items[J]=X}toJSON($,X){let J=[];if(X?.onCreate)X.onCreate(J);let Q=0;for(let q of this.items)J.push(nW.toJS(q,String(Q++),X));return J}toString($,X,J){if(!$)return JSON.stringify(this);return pW.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:J,onComment:X})}static from($,X,J){let{replacer:Q}=J,q=new this($);if(X&&Symbol.iterator in Object(X)){let Y=0;for(let z of X){if(typeof Q==="function"){let G=X instanceof Set?z:String(Y++);z=Q.call(X,G,z)}q.items.push(cW.createNode(z,void 0,J))}}return q}}function V5($){let X=B5.isScalar($)?$.value:$;if(X&&typeof X==="string")X=Number(X);return typeof X==="number"&&Number.isInteger(X)&&X>=0?X:null}rW.YAMLSeq=bJ});var E8=_((tW)=>{var aW=n(),fJ=S0(),oW={collection:"seq",default:!0,nodeClass:fJ.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,X){if(!aW.isSeq($))X("Expected a sequence for this tag");return $},createNode:($,X,J)=>fJ.YAMLSeq.from($,X,J)};tW.seq=oW});var P6=_((JH)=>{var $H=T6(),XH={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,X,J,Q){return X=Object.assign({actualString:!0},X),$H.stringifyString($,X,J,Q)}};JH.string=XH});var K5=_((qH)=>{var kJ=M$(),xJ={identify:($)=>$==null,createNode:()=>new kJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new kJ.Scalar(null),stringify:({source:$},X)=>typeof $==="string"&&xJ.test.test($)?$:X.options.nullStr};qH.nullTag=xJ});var aX=_((GH)=>{var zH=M$(),yJ={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new zH.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:X},J){if($&&yJ.test.test($)){let Q=$[0]==="t"||$[0]==="T";if(X===Q)return $}return X?J.options.trueStr:J.options.falseStr}};GH.boolTag=yJ});var T8=_((UH)=>{function HH({format:$,minFractionDigits:X,tag:J,value:Q}){if(typeof Q==="bigint")return String(Q);let q=typeof Q==="number"?Q:Number(Q);if(!isFinite(q))return isNaN(q)?".nan":q<0?"-.inf":".inf";let Y=Object.is(Q,-0)?"-0":JSON.stringify(Q);if(!$&&X&&(!J||J==="tag:yaml.org,2002:float")&&/^\d/.test(Y)){let z=Y.indexOf(".");if(z<0)z=Y.length,Y+=".";let G=X-(Y.length-z-1);while(G-- >0)Y+="0"}return Y}UH.stringifyNumber=HH});var tX=_((DH)=>{var BH=M$(),oX=T8(),KH={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:oX.stringifyNumber},MH={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():oX.stringifyNumber($)}},NH={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let X=new BH.Scalar(parseFloat($)),J=$.indexOf(".");if(J!==-1&&$[$.length-1]==="0")X.minFractionDigits=$.length-J-1;return X},stringify:oX.stringifyNumber};DH.float=NH;DH.floatExp=MH;DH.floatNaN=KH});var $4=_((FH)=>{var gJ=T8(),M5=($)=>typeof $==="bigint"||Number.isInteger($),eX=($,X,J,{intAsBigInt:Q})=>Q?BigInt($):parseInt($.substring(X),J);function vJ($,X,J){let{value:Q}=$;if(M5(Q)&&Q>=0)return J+Q.toString(X);return gJ.stringifyNumber($)}var RH={identify:($)=>M5($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,X,J)=>eX($,2,8,J),stringify:($)=>vJ($,8,"0o")},AH={identify:M5,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,X,J)=>eX($,0,10,J),stringify:gJ.stringifyNumber},_H={identify:($)=>M5($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,X,J)=>eX($,2,16,J),stringify:($)=>vJ($,16,"0x")};FH.int=AH;FH.intHex=_H;FH.intOct=RH});var hJ=_((fH)=>{var ZH=I8(),SH=K5(),jH=E8(),CH=P6(),PH=aX(),X4=tX(),J4=$4(),bH=[ZH.map,jH.seq,CH.string,SH.nullTag,PH.boolTag,J4.intOct,J4.int,J4.intHex,X4.floatNaN,X4.floatExp,X4.float];fH.schema=bH});var mJ=_((mH)=>{var xH=M$(),yH=I8(),gH=E8();function uJ($){return typeof $==="bigint"||Number.isInteger($)}var N5=({value:$})=>JSON.stringify($),vH=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:N5},{identify:($)=>$==null,createNode:()=>new xH.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:N5},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:N5},{identify:uJ,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,X,{intAsBigInt:J})=>J?BigInt($):parseInt($,10),stringify:({value:$})=>uJ($)?$.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:N5}],hH={default:!0,tag:"",test:/^/,resolve($,X){return X(`Unresolved plain scalar ${JSON.stringify($)}`),$}},uH=[yH.map,gH.seq].concat(vH,hH);mH.schema=uH});var q4=_((dH)=>{var b6=W$("buffer"),Q4=M$(),cH=T6(),pH={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,X){if(typeof b6.Buffer==="function")return b6.Buffer.from($,"base64");else if(typeof atob==="function"){let J=atob($.replace(/[\n\r]/g,"")),Q=new Uint8Array(J.length);for(let q=0;q<J.length;++q)Q[q]=J.charCodeAt(q);return Q}else return X("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:X,value:J},Q,q,Y){if(!J)return"";let z=J,G;if(typeof b6.Buffer==="function")G=z instanceof b6.Buffer?z.toString("base64"):b6.Buffer.from(z.buffer).toString("base64");else if(typeof btoa==="function"){let W="";for(let H=0;H<z.length;++H)W+=String.fromCharCode(z[H]);G=btoa(W)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(X??(X=Q4.Scalar.BLOCK_LITERAL),X!==Q4.Scalar.QUOTE_DOUBLE){let W=Math.max(Q.options.lineWidth-Q.indent.length,Q.options.minContentWidth),H=Math.ceil(G.length/W),U=Array(H);for(let V=0,B=0;V<H;++V,B+=W)U[V]=G.substr(B,W);G=U.join(X===Q4.Scalar.BLOCK_LITERAL?`
78
- `:" ")}return cH.stringifyString({comment:$,type:X,value:G},Q,q,Y)}};dH.binary=pH});var O5=_((aH)=>{var D5=n(),Y4=E0(),nH=M$(),rH=S0();function lJ($,X){if(D5.isSeq($))for(let J=0;J<$.items.length;++J){let Q=$.items[J];if(D5.isPair(Q))continue;else if(D5.isMap(Q)){if(Q.items.length>1)X("Each pair must have its own sequence indicator");let q=Q.items[0]||new Y4.Pair(new nH.Scalar(null));if(Q.commentBefore)q.key.commentBefore=q.key.commentBefore?`${Q.commentBefore}
77
+ ${q}${D}`}else return`${B}${z}${V.join(" ")}${z}${D}`}}function K5({indent:$,options:{commentString:X}},J,Q,q){if(Q&&q)Q=Q.replace(/^\n+/,"");if(Q){let Y=B5.indentComment(X(Q),$);J.push(Y.trimStart())}}xW.stringifyCollection=PW});var S0=_((mW)=>{var gW=eX(),vW=tX(),hW=Q5(),T0=n(),M5=Z0(),uW=M$();function P6($,X){let J=T0.isScalar(X)?X.value:X;for(let Q of $)if(T0.isPair(Q)){if(Q.key===X||Q.key===J)return Q;if(T0.isScalar(Q.key)&&Q.key.value===J)return Q}return}class fJ extends hW.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(T0.MAP,$);this.items=[]}static from($,X,J){let{keepUndefined:Q,replacer:q}=J,Y=new this($),z=(G,W)=>{if(typeof q==="function")W=q.call(X,G,W);else if(Array.isArray(q)&&!q.includes(G))return;if(W!==void 0||Q)Y.items.push(M5.createPair(G,W,J))};if(X instanceof Map)for(let[G,W]of X)z(G,W);else if(X&&typeof X==="object")for(let G of Object.keys(X))z(G,X[G]);if(typeof $.sortMapEntries==="function")Y.items.sort($.sortMapEntries);return Y}add($,X){let J;if(T0.isPair($))J=$;else if(!$||typeof $!=="object"||!("key"in $))J=new M5.Pair($,$?.value);else J=new M5.Pair($.key,$.value);let Q=P6(this.items,J.key),q=this.schema?.sortMapEntries;if(Q){if(!X)throw Error(`Key ${J.key} already set`);if(T0.isScalar(Q.value)&&uW.isScalarValue(J.value))Q.value.value=J.value;else Q.value=J.value}else if(q){let Y=this.items.findIndex((z)=>q(J,z)<0);if(Y===-1)this.items.push(J);else this.items.splice(Y,0,J)}else this.items.push(J)}delete($){let X=P6(this.items,$);if(!X)return!1;return this.items.splice(this.items.indexOf(X),1).length>0}get($,X){let Q=P6(this.items,$)?.value;return(!X&&T0.isScalar(Q)?Q.value:Q)??void 0}has($){return!!P6(this.items,$)}set($,X){this.add(new M5.Pair($,X),!0)}toJSON($,X,J){let Q=J?new J:X?.mapAsMap?new Map:{};if(X?.onCreate)X.onCreate(Q);for(let q of this.items)vW.addPairToJSMap(X,Q,q);return Q}toString($,X,J){if(!$)return JSON.stringify(this);for(let Q of this.items)if(!T0.isPair(Q))throw Error(`Map items must all be pairs; found ${JSON.stringify(Q)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return gW.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:J,onComment:X})}}mW.YAMLMap=fJ;mW.findPair=P6});var E8=_((iW)=>{var pW=n(),kJ=S0(),dW={collection:"map",default:!0,nodeClass:kJ.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,X){if(!pW.isMap($))X("Expected a mapping for this tag");return $},createNode:($,X,J)=>kJ.YAMLMap.from($,X,J)};iW.map=dW});var j0=_((eW)=>{var rW=E6(),sW=eX(),aW=Q5(),D5=n(),oW=M$(),tW=F0();class xJ extends aW.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(D5.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let X=N5($);if(typeof X!=="number")return!1;return this.items.splice(X,1).length>0}get($,X){let J=N5($);if(typeof J!=="number")return;let Q=this.items[J];return!X&&D5.isScalar(Q)?Q.value:Q}has($){let X=N5($);return typeof X==="number"&&X<this.items.length}set($,X){let J=N5($);if(typeof J!=="number")throw Error(`Expected a valid index, not ${$}.`);let Q=this.items[J];if(D5.isScalar(Q)&&oW.isScalarValue(X))Q.value=X;else this.items[J]=X}toJSON($,X){let J=[];if(X?.onCreate)X.onCreate(J);let Q=0;for(let q of this.items)J.push(tW.toJS(q,String(Q++),X));return J}toString($,X,J){if(!$)return JSON.stringify(this);return sW.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:J,onComment:X})}static from($,X,J){let{replacer:Q}=J,q=new this($);if(X&&Symbol.iterator in Object(X)){let Y=0;for(let z of X){if(typeof Q==="function"){let G=X instanceof Set?z:String(Y++);z=Q.call(X,G,z)}q.items.push(rW.createNode(z,void 0,J))}}return q}}function N5($){let X=D5.isScalar($)?$.value:$;if(X&&typeof X==="string")X=Number(X);return typeof X==="number"&&Number.isInteger(X)&&X>=0?X:null}eW.YAMLSeq=xJ});var Z8=_((QH)=>{var XH=n(),yJ=j0(),JH={collection:"seq",default:!0,nodeClass:yJ.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,X){if(!XH.isSeq($))X("Expected a sequence for this tag");return $},createNode:($,X,J)=>yJ.YAMLSeq.from($,X,J)};QH.seq=JH});var f6=_((GH)=>{var YH=S6(),zH={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,X,J,Q){return X=Object.assign({actualString:!0},X),YH.stringifyString($,X,J,Q)}};GH.string=zH});var O5=_((HH)=>{var gJ=M$(),vJ={identify:($)=>$==null,createNode:()=>new gJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new gJ.Scalar(null),stringify:({source:$},X)=>typeof $==="string"&&vJ.test.test($)?$:X.options.nullStr};HH.nullTag=vJ});var $4=_((BH)=>{var VH=M$(),hJ={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new VH.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:X},J){if($&&hJ.test.test($)){let Q=$[0]==="t"||$[0]==="T";if(X===Q)return $}return X?J.options.trueStr:J.options.falseStr}};BH.boolTag=hJ});var T8=_((NH)=>{function MH({format:$,minFractionDigits:X,tag:J,value:Q}){if(typeof Q==="bigint")return String(Q);let q=typeof Q==="number"?Q:Number(Q);if(!isFinite(q))return isNaN(q)?".nan":q<0?"-.inf":".inf";let Y=Object.is(Q,-0)?"-0":JSON.stringify(Q);if(!$&&X&&(!J||J==="tag:yaml.org,2002:float")&&/^\d/.test(Y)){let z=Y.indexOf(".");if(z<0)z=Y.length,Y+=".";let G=X-(Y.length-z-1);while(G-- >0)Y+="0"}return Y}NH.stringifyNumber=MH});var J4=_((AH)=>{var OH=M$(),X4=T8(),wH={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:X4.stringifyNumber},LH={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():X4.stringifyNumber($)}},RH={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let X=new OH.Scalar(parseFloat($)),J=$.indexOf(".");if(J!==-1&&$[$.length-1]==="0")X.minFractionDigits=$.length-J-1;return X},stringify:X4.stringifyNumber};AH.float=RH;AH.floatExp=LH;AH.floatNaN=wH});var q4=_((SH)=>{var uJ=T8(),w5=($)=>typeof $==="bigint"||Number.isInteger($),Q4=($,X,J,{intAsBigInt:Q})=>Q?BigInt($):parseInt($.substring(X),J);function mJ($,X,J){let{value:Q}=$;if(w5(Q)&&Q>=0)return J+Q.toString(X);return uJ.stringifyNumber($)}var EH={identify:($)=>w5($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,X,J)=>Q4($,2,8,J),stringify:($)=>mJ($,8,"0o")},ZH={identify:w5,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,X,J)=>Q4($,0,10,J),stringify:uJ.stringifyNumber},TH={identify:($)=>w5($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,X,J)=>Q4($,2,16,J),stringify:($)=>mJ($,16,"0x")};SH.int=ZH;SH.intHex=TH;SH.intOct=EH});var lJ=_((vH)=>{var PH=E8(),fH=O5(),kH=Z8(),xH=f6(),yH=$4(),Y4=J4(),z4=q4(),gH=[PH.map,kH.seq,xH.string,fH.nullTag,yH.boolTag,z4.intOct,z4.int,z4.intHex,Y4.floatNaN,Y4.floatExp,Y4.float];vH.schema=gH});var pJ=_((iH)=>{var uH=M$(),mH=E8(),lH=Z8();function cJ($){return typeof $==="bigint"||Number.isInteger($)}var L5=({value:$})=>JSON.stringify($),cH=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:L5},{identify:($)=>$==null,createNode:()=>new uH.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:L5},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:L5},{identify:cJ,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,X,{intAsBigInt:J})=>J?BigInt($):parseInt($,10),stringify:({value:$})=>cJ($)?$.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:L5}],pH={default:!0,tag:"",test:/^/,resolve($,X){return X(`Unresolved plain scalar ${JSON.stringify($)}`),$}},dH=[mH.map,lH.seq].concat(cH,pH);iH.schema=dH});var W4=_((aH)=>{var k6=U$("buffer"),G4=M$(),rH=S6(),sH={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,X){if(typeof k6.Buffer==="function")return k6.Buffer.from($,"base64");else if(typeof atob==="function"){let J=atob($.replace(/[\n\r]/g,"")),Q=new Uint8Array(J.length);for(let q=0;q<J.length;++q)Q[q]=J.charCodeAt(q);return Q}else return X("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:X,value:J},Q,q,Y){if(!J)return"";let z=J,G;if(typeof k6.Buffer==="function")G=z instanceof k6.Buffer?z.toString("base64"):k6.Buffer.from(z.buffer).toString("base64");else if(typeof btoa==="function"){let W="";for(let H=0;H<z.length;++H)W+=String.fromCharCode(z[H]);G=btoa(W)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(X??(X=G4.Scalar.BLOCK_LITERAL),X!==G4.Scalar.QUOTE_DOUBLE){let W=Math.max(Q.options.lineWidth-Q.indent.length,Q.options.minContentWidth),H=Math.ceil(G.length/W),U=Array(H);for(let V=0,B=0;V<H;++V,B+=W)U[V]=G.substr(B,W);G=U.join(X===G4.Scalar.BLOCK_LITERAL?`
78
+ `:" ")}return rH.stringifyString({comment:$,type:X,value:G},Q,q,Y)}};aH.binary=sH});var A5=_((XU)=>{var R5=n(),H4=Z0(),tH=M$(),eH=j0();function dJ($,X){if(R5.isSeq($))for(let J=0;J<$.items.length;++J){let Q=$.items[J];if(R5.isPair(Q))continue;else if(R5.isMap(Q)){if(Q.items.length>1)X("Each pair must have its own sequence indicator");let q=Q.items[0]||new H4.Pair(new tH.Scalar(null));if(Q.commentBefore)q.key.commentBefore=q.key.commentBefore?`${Q.commentBefore}
79
79
  ${q.key.commentBefore}`:Q.commentBefore;if(Q.comment){let Y=q.value??q.key;Y.comment=Y.comment?`${Q.comment}
80
- ${Y.comment}`:Q.comment}Q=q}$.items[J]=D5.isPair(Q)?Q:new Y4.Pair(Q)}else X("Expected a sequence for this tag");return $}function cJ($,X,J){let{replacer:Q}=J,q=new rH.YAMLSeq($);q.tag="tag:yaml.org,2002:pairs";let Y=0;if(X&&Symbol.iterator in Object(X))for(let z of X){if(typeof Q==="function")z=Q.call(X,String(Y++),z);let G,W;if(Array.isArray(z))if(z.length===2)G=z[0],W=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let H=Object.keys(z);if(H.length===1)G=H[0],W=z[G];else throw TypeError(`Expected tuple with one key, not ${H.length} keys`)}else G=z;q.items.push(Y4.createPair(G,W,J))}return q}var sH={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:lJ,createNode:cJ};aH.createPairs=cJ;aH.pairs=sH;aH.resolvePairs=lJ});var G4=_((JU)=>{var pJ=n(),z4=_0(),f6=Z0(),$U=S0(),dJ=O5();class o0 extends $U.YAMLSeq{constructor(){super();this.add=f6.YAMLMap.prototype.add.bind(this),this.delete=f6.YAMLMap.prototype.delete.bind(this),this.get=f6.YAMLMap.prototype.get.bind(this),this.has=f6.YAMLMap.prototype.has.bind(this),this.set=f6.YAMLMap.prototype.set.bind(this),this.tag=o0.tag}toJSON($,X){if(!X)return super.toJSON($);let J=new Map;if(X?.onCreate)X.onCreate(J);for(let Q of this.items){let q,Y;if(pJ.isPair(Q))q=z4.toJS(Q.key,"",X),Y=z4.toJS(Q.value,q,X);else q=z4.toJS(Q,"",X);if(J.has(q))throw Error("Ordered maps must not include duplicate keys");J.set(q,Y)}return J}static from($,X,J){let Q=dJ.createPairs($,X,J),q=new this;return q.items=Q.items,q}}o0.tag="tag:yaml.org,2002:omap";var XU={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:o0,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,X){let J=dJ.resolvePairs($,X),Q=[];for(let{key:q}of J.items)if(pJ.isScalar(q))if(Q.includes(q.value))X(`Ordered maps must not include duplicate keys: ${q.value}`);else Q.push(q.value);return Object.assign(new o0,J)},createNode:($,X,J)=>o0.from($,X,J)};JU.YAMLOMap=o0;JU.omap=XU});var aJ=_((YU)=>{var iJ=M$();function nJ({value:$,source:X},J){if(X&&($?rJ:sJ).test.test(X))return X;return $?J.options.trueStr:J.options.falseStr}var rJ={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new iJ.Scalar(!0),stringify:nJ},sJ={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new iJ.Scalar(!1),stringify:nJ};YU.falseTag=sJ;YU.trueTag=rJ});var oJ=_((BU)=>{var WU=M$(),W4=T8(),HU={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:W4.stringifyNumber},UU={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():W4.stringifyNumber($)}},VU={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let X=new WU.Scalar(parseFloat($.replace(/_/g,""))),J=$.indexOf(".");if(J!==-1){let Q=$.substring(J+1).replace(/_/g,"");if(Q[Q.length-1]==="0")X.minFractionDigits=Q.length}return X},stringify:W4.stringifyNumber};BU.float=VU;BU.floatExp=UU;BU.floatNaN=HU});var eJ=_((RU)=>{var tJ=T8(),k6=($)=>typeof $==="bigint"||Number.isInteger($);function w5($,X,J,{intAsBigInt:Q}){let q=$[0];if(q==="-"||q==="+")X+=1;if($=$.substring(X).replace(/_/g,""),Q){switch(J){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let z=BigInt($);return q==="-"?BigInt(-1)*z:z}let Y=parseInt($,J);return q==="-"?-1*Y:Y}function H4($,X,J){let{value:Q}=$;if(k6(Q)){let q=Q.toString(X);return Q<0?"-"+J+q.substr(1):J+q}return tJ.stringifyNumber($)}var DU={identify:k6,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,X,J)=>w5($,2,2,J),stringify:($)=>H4($,2,"0b")},OU={identify:k6,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,X,J)=>w5($,1,8,J),stringify:($)=>H4($,8,"0")},wU={identify:k6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,X,J)=>w5($,0,10,J),stringify:tJ.stringifyNumber},LU={identify:k6,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,X,J)=>w5($,2,16,J),stringify:($)=>H4($,16,"0x")};RU.int=wU;RU.intBin=DU;RU.intHex=LU;RU.intOct=OU});var U4=_((TU)=>{var A5=n(),L5=E0(),R5=Z0();class t0 extends R5.YAMLMap{constructor($){super($);this.tag=t0.tag}add($){let X;if(A5.isPair($))X=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)X=new L5.Pair($.key,null);else X=new L5.Pair($,null);if(!R5.findPair(this.items,X.key))this.items.push(X)}get($,X){let J=R5.findPair(this.items,$);return!X&&A5.isPair(J)?A5.isScalar(J.key)?J.key.value:J.key:J}set($,X){if(typeof X!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof X}`);let J=R5.findPair(this.items,$);if(J&&!X)this.items.splice(this.items.indexOf(J),1);else if(!J&&X)this.items.push(new L5.Pair($))}toJSON($,X){return super.toJSON($,X,Set)}toString($,X,J){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),X,J);else throw Error("Set items must all have null values")}static from($,X,J){let{replacer:Q}=J,q=new this($);if(X&&Symbol.iterator in Object(X))for(let Y of X){if(typeof Q==="function")Y=Q.call(X,Y,Y);q.items.push(L5.createPair(Y,null,J))}return q}}t0.tag="tag:yaml.org,2002:set";var EU={collection:"map",identify:($)=>$ instanceof Set,nodeClass:t0,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,X,J)=>t0.from($,X,J),resolve($,X){if(A5.isMap($))if($.hasAllNullValues(!0))return Object.assign(new t0,$);else X("Set items must all have null values");else X("Expected a mapping for this tag");return $}};TU.YAMLSet=t0;TU.set=EU});var B4=_((bU)=>{var jU=T8();function V4($,X){let J=$[0],Q=J==="-"||J==="+"?$.substring(1):$,q=(z)=>X?BigInt(z):Number(z),Y=Q.replace(/_/g,"").split(":").reduce((z,G)=>z*q(60)+q(G),q(0));return J==="-"?q(-1)*Y:Y}function $Q($){let{value:X}=$,J=(z)=>z;if(typeof X==="bigint")J=(z)=>BigInt(z);else if(isNaN(X)||!isFinite(X))return jU.stringifyNumber($);let Q="";if(X<0)Q="-",X*=J(-1);let q=J(60),Y=[X%q];if(X<60)Y.unshift(0);else if(X=(X-Y[0])/q,Y.unshift(X%q),X>=60)X=(X-Y[0])/q,Y.unshift(X);return Q+Y.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var CU={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:J})=>V4($,J),stringify:$Q},PU={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:($)=>V4($,!1),stringify:$Q},XQ={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(XQ.test);if(!X)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,J,Q,q,Y,z,G]=X.map(Number),W=X[7]?Number((X[7]+"00").substr(1,3)):0,H=Date.UTC(J,Q-1,q,Y||0,z||0,G||0,W),U=X[8];if(U&&U!=="Z"){let V=V4(U,!1);if(Math.abs(V)<30)V*=60;H-=60000*V}return new Date(H)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};bU.floatTime=PU;bU.intTime=CU;bU.timestamp=XQ});var QQ=_((iU)=>{var yU=I8(),gU=K5(),vU=E8(),hU=P6(),uU=q4(),JQ=aJ(),K4=oJ(),_5=eJ(),mU=Y5(),lU=G4(),cU=O5(),pU=U4(),M4=B4(),dU=[yU.map,vU.seq,hU.string,gU.nullTag,JQ.trueTag,JQ.falseTag,_5.intBin,_5.intOct,_5.int,_5.intHex,K4.floatNaN,K4.floatExp,K4.float,uU.binary,mU.merge,lU.omap,cU.pairs,pU.set,M4.intTime,M4.floatTime,M4.timestamp];iU.schema=dU});var KQ=_((XV)=>{var GQ=I8(),rU=K5(),WQ=E8(),sU=P6(),aU=aX(),N4=tX(),D4=$4(),oU=hJ(),tU=mJ(),HQ=q4(),x6=Y5(),UQ=G4(),VQ=O5(),qQ=QQ(),BQ=U4(),F5=B4(),YQ=new Map([["core",oU.schema],["failsafe",[GQ.map,WQ.seq,sU.string]],["json",tU.schema],["yaml11",qQ.schema],["yaml-1.1",qQ.schema]]),zQ={binary:HQ.binary,bool:aU.boolTag,float:N4.float,floatExp:N4.floatExp,floatNaN:N4.floatNaN,floatTime:F5.floatTime,int:D4.int,intHex:D4.intHex,intOct:D4.intOct,intTime:F5.intTime,map:GQ.map,merge:x6.merge,null:rU.nullTag,omap:UQ.omap,pairs:VQ.pairs,seq:WQ.seq,set:BQ.set,timestamp:F5.timestamp},eU={"tag:yaml.org,2002:binary":HQ.binary,"tag:yaml.org,2002:merge":x6.merge,"tag:yaml.org,2002:omap":UQ.omap,"tag:yaml.org,2002:pairs":VQ.pairs,"tag:yaml.org,2002:set":BQ.set,"tag:yaml.org,2002:timestamp":F5.timestamp};function $V($,X,J){let Q=YQ.get(X);if(Q&&!$)return J&&!Q.includes(x6.merge)?Q.concat(x6.merge):Q.slice();let q=Q;if(!q)if(Array.isArray($))q=[];else{let Y=Array.from(YQ.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${X}"; use one of ${Y} or define customTags array`)}if(Array.isArray($))for(let Y of $)q=q.concat(Y);else if(typeof $==="function")q=$(q.slice());if(J)q=q.concat(x6.merge);return q.reduce((Y,z)=>{let G=typeof z==="string"?zQ[z]:z;if(!G){let W=JSON.stringify(z),H=Object.keys(zQ).map((U)=>JSON.stringify(U)).join(", ");throw Error(`Unknown custom tag ${W}; use one of ${H}`)}if(!Y.includes(G))Y.push(G);return Y},[])}XV.coreKnownTags=eU;XV.getTags=$V});var L4=_((WV)=>{var O4=n(),qV=I8(),YV=E8(),zV=P6(),I5=KQ(),GV=($,X)=>$.key<X.key?-1:$.key>X.key?1:0;class w4{constructor({compat:$,customTags:X,merge:J,resolveKnownTags:Q,schema:q,sortMapEntries:Y,toStringDefaults:z}){this.compat=Array.isArray($)?I5.getTags($,"compat"):$?I5.getTags(null,$):null,this.name=typeof q==="string"&&q||"core",this.knownTags=Q?I5.coreKnownTags:{},this.tags=I5.getTags(X,this.name,J),this.toStringOptions=z??null,Object.defineProperty(this,O4.MAP,{value:qV.map}),Object.defineProperty(this,O4.SCALAR,{value:zV.string}),Object.defineProperty(this,O4.SEQ,{value:YV.seq}),this.sortMapEntries=typeof Y==="function"?Y:Y===!0?GV:null}clone(){let $=Object.create(w4.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}WV.Schema=w4});var MQ=_((BV)=>{var UV=n(),R4=Z6(),y6=I6();function VV($,X){let J=[],Q=X.directives===!0;if(X.directives!==!1&&$.directives){let W=$.directives.toString($);if(W)J.push(W),Q=!0;else if($.directives.docStart)Q=!0}if(Q)J.push("---");let q=R4.createStringifyContext($,X),{commentString:Y}=q.options;if($.commentBefore){if(J.length!==1)J.unshift("");let W=Y($.commentBefore);J.unshift(y6.indentComment(W,""))}let z=!1,G=null;if($.contents){if(UV.isNode($.contents)){if($.contents.spaceBefore&&Q)J.push("");if($.contents.commentBefore){let U=Y($.contents.commentBefore);J.push(y6.indentComment(U,""))}q.forceBlockIndent=!!$.comment,G=$.contents.comment}let W=G?void 0:()=>z=!0,H=R4.stringify($.contents,q,()=>G=null,W);if(G)H+=y6.lineComment(H,"",Y(G));if((H[0]==="|"||H[0]===">")&&J[J.length-1]==="---")J[J.length-1]=`--- ${H}`;else J.push(H)}else J.push(R4.stringify($.contents,q));if($.directives?.docEnd)if($.comment){let W=Y($.comment);if(W.includes(`
81
- `))J.push("..."),J.push(y6.indentComment(W,""));else J.push(`... ${W}`)}else J.push("...");else{let W=$.comment;if(W&&z)W=W.replace(/^\n+/,"");if(W){if((!z||G)&&J[J.length-1]!=="")J.push("");J.push(y6.indentComment(Y(W),""))}}return J.join(`
80
+ ${Y.comment}`:Q.comment}Q=q}$.items[J]=R5.isPair(Q)?Q:new H4.Pair(Q)}else X("Expected a sequence for this tag");return $}function iJ($,X,J){let{replacer:Q}=J,q=new eH.YAMLSeq($);q.tag="tag:yaml.org,2002:pairs";let Y=0;if(X&&Symbol.iterator in Object(X))for(let z of X){if(typeof Q==="function")z=Q.call(X,String(Y++),z);let G,W;if(Array.isArray(z))if(z.length===2)G=z[0],W=z[1];else throw TypeError(`Expected [key, value] tuple: ${z}`);else if(z&&z instanceof Object){let H=Object.keys(z);if(H.length===1)G=H[0],W=z[G];else throw TypeError(`Expected tuple with one key, not ${H.length} keys`)}else G=z;q.items.push(H4.createPair(G,W,J))}return q}var $U={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:dJ,createNode:iJ};XU.createPairs=iJ;XU.pairs=$U;XU.resolvePairs=dJ});var V4=_((GU)=>{var nJ=n(),U4=F0(),x6=S0(),YU=j0(),rJ=A5();class t0 extends YU.YAMLSeq{constructor(){super();this.add=x6.YAMLMap.prototype.add.bind(this),this.delete=x6.YAMLMap.prototype.delete.bind(this),this.get=x6.YAMLMap.prototype.get.bind(this),this.has=x6.YAMLMap.prototype.has.bind(this),this.set=x6.YAMLMap.prototype.set.bind(this),this.tag=t0.tag}toJSON($,X){if(!X)return super.toJSON($);let J=new Map;if(X?.onCreate)X.onCreate(J);for(let Q of this.items){let q,Y;if(nJ.isPair(Q))q=U4.toJS(Q.key,"",X),Y=U4.toJS(Q.value,q,X);else q=U4.toJS(Q,"",X);if(J.has(q))throw Error("Ordered maps must not include duplicate keys");J.set(q,Y)}return J}static from($,X,J){let Q=rJ.createPairs($,X,J),q=new this;return q.items=Q.items,q}}t0.tag="tag:yaml.org,2002:omap";var zU={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:t0,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,X){let J=rJ.resolvePairs($,X),Q=[];for(let{key:q}of J.items)if(nJ.isScalar(q))if(Q.includes(q.value))X(`Ordered maps must not include duplicate keys: ${q.value}`);else Q.push(q.value);return Object.assign(new t0,J)},createNode:($,X,J)=>t0.from($,X,J)};GU.YAMLOMap=t0;GU.omap=zU});var eJ=_((UU)=>{var sJ=M$();function aJ({value:$,source:X},J){if(X&&($?oJ:tJ).test.test(X))return X;return $?J.options.trueStr:J.options.falseStr}var oJ={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new sJ.Scalar(!0),stringify:aJ},tJ={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new sJ.Scalar(!1),stringify:aJ};UU.falseTag=tJ;UU.trueTag=oJ});var $Q=_((OU)=>{var KU=M$(),B4=T8(),MU={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:B4.stringifyNumber},NU={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():B4.stringifyNumber($)}},DU={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let X=new KU.Scalar(parseFloat($.replace(/_/g,""))),J=$.indexOf(".");if(J!==-1){let Q=$.substring(J+1).replace(/_/g,"");if(Q[Q.length-1]==="0")X.minFractionDigits=Q.length}return X},stringify:B4.stringifyNumber};OU.float=DU;OU.floatExp=NU;OU.floatNaN=MU});var JQ=_((EU)=>{var XQ=T8(),y6=($)=>typeof $==="bigint"||Number.isInteger($);function _5($,X,J,{intAsBigInt:Q}){let q=$[0];if(q==="-"||q==="+")X+=1;if($=$.substring(X).replace(/_/g,""),Q){switch(J){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let z=BigInt($);return q==="-"?BigInt(-1)*z:z}let Y=parseInt($,J);return q==="-"?-1*Y:Y}function K4($,X,J){let{value:Q}=$;if(y6(Q)){let q=Q.toString(X);return Q<0?"-"+J+q.substr(1):J+q}return XQ.stringifyNumber($)}var AU={identify:y6,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,X,J)=>_5($,2,2,J),stringify:($)=>K4($,2,"0b")},_U={identify:y6,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,X,J)=>_5($,1,8,J),stringify:($)=>K4($,8,"0")},FU={identify:y6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,X,J)=>_5($,0,10,J),stringify:XQ.stringifyNumber},IU={identify:y6,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,X,J)=>_5($,2,16,J),stringify:($)=>K4($,16,"0x")};EU.int=FU;EU.intBin=AU;EU.intHex=IU;EU.intOct=_U});var M4=_((bU)=>{var E5=n(),F5=Z0(),I5=S0();class e0 extends I5.YAMLMap{constructor($){super($);this.tag=e0.tag}add($){let X;if(E5.isPair($))X=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)X=new F5.Pair($.key,null);else X=new F5.Pair($,null);if(!I5.findPair(this.items,X.key))this.items.push(X)}get($,X){let J=I5.findPair(this.items,$);return!X&&E5.isPair(J)?E5.isScalar(J.key)?J.key.value:J.key:J}set($,X){if(typeof X!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof X}`);let J=I5.findPair(this.items,$);if(J&&!X)this.items.splice(this.items.indexOf(J),1);else if(!J&&X)this.items.push(new F5.Pair($))}toJSON($,X){return super.toJSON($,X,Set)}toString($,X,J){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),X,J);else throw Error("Set items must all have null values")}static from($,X,J){let{replacer:Q}=J,q=new this($);if(X&&Symbol.iterator in Object(X))for(let Y of X){if(typeof Q==="function")Y=Q.call(X,Y,Y);q.items.push(F5.createPair(Y,null,J))}return q}}e0.tag="tag:yaml.org,2002:set";var CU={collection:"map",identify:($)=>$ instanceof Set,nodeClass:e0,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,X,J)=>e0.from($,X,J),resolve($,X){if(E5.isMap($))if($.hasAllNullValues(!0))return Object.assign(new e0,$);else X("Set items must all have null values");else X("Expected a mapping for this tag");return $}};bU.YAMLSet=e0;bU.set=CU});var D4=_((gU)=>{var kU=T8();function N4($,X){let J=$[0],Q=J==="-"||J==="+"?$.substring(1):$,q=(z)=>X?BigInt(z):Number(z),Y=Q.replace(/_/g,"").split(":").reduce((z,G)=>z*q(60)+q(G),q(0));return J==="-"?q(-1)*Y:Y}function QQ($){let{value:X}=$,J=(z)=>z;if(typeof X==="bigint")J=(z)=>BigInt(z);else if(isNaN(X)||!isFinite(X))return kU.stringifyNumber($);let Q="";if(X<0)Q="-",X*=J(-1);let q=J(60),Y=[X%q];if(X<60)Y.unshift(0);else if(X=(X-Y[0])/q,Y.unshift(X%q),X>=60)X=(X-Y[0])/q,Y.unshift(X);return Q+Y.map((z)=>String(z).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var xU={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:J})=>N4($,J),stringify:QQ},yU={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:($)=>N4($,!1),stringify:QQ},qQ={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(qQ.test);if(!X)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,J,Q,q,Y,z,G]=X.map(Number),W=X[7]?Number((X[7]+"00").substr(1,3)):0,H=Date.UTC(J,Q-1,q,Y||0,z||0,G||0,W),U=X[8];if(U&&U!=="Z"){let V=N4(U,!1);if(Math.abs(V)<30)V*=60;H-=60000*V}return new Date(H)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};gU.floatTime=yU;gU.intTime=xU;gU.timestamp=qQ});var zQ=_((oU)=>{var mU=E8(),lU=O5(),cU=Z8(),pU=f6(),dU=W4(),YQ=eJ(),O4=$Q(),Z5=JQ(),iU=H5(),nU=V4(),rU=A5(),sU=M4(),w4=D4(),aU=[mU.map,cU.seq,pU.string,lU.nullTag,YQ.trueTag,YQ.falseTag,Z5.intBin,Z5.intOct,Z5.int,Z5.intHex,O4.floatNaN,O4.floatExp,O4.float,dU.binary,iU.merge,nU.omap,rU.pairs,sU.set,w4.intTime,w4.floatTime,w4.timestamp];oU.schema=aU});var DQ=_((zV)=>{var UQ=E8(),eU=O5(),VQ=Z8(),$V=f6(),XV=$4(),L4=J4(),R4=q4(),JV=lJ(),QV=pJ(),BQ=W4(),g6=H5(),KQ=V4(),MQ=A5(),GQ=zQ(),NQ=M4(),T5=D4(),WQ=new Map([["core",JV.schema],["failsafe",[UQ.map,VQ.seq,$V.string]],["json",QV.schema],["yaml11",GQ.schema],["yaml-1.1",GQ.schema]]),HQ={binary:BQ.binary,bool:XV.boolTag,float:L4.float,floatExp:L4.floatExp,floatNaN:L4.floatNaN,floatTime:T5.floatTime,int:R4.int,intHex:R4.intHex,intOct:R4.intOct,intTime:T5.intTime,map:UQ.map,merge:g6.merge,null:eU.nullTag,omap:KQ.omap,pairs:MQ.pairs,seq:VQ.seq,set:NQ.set,timestamp:T5.timestamp},qV={"tag:yaml.org,2002:binary":BQ.binary,"tag:yaml.org,2002:merge":g6.merge,"tag:yaml.org,2002:omap":KQ.omap,"tag:yaml.org,2002:pairs":MQ.pairs,"tag:yaml.org,2002:set":NQ.set,"tag:yaml.org,2002:timestamp":T5.timestamp};function YV($,X,J){let Q=WQ.get(X);if(Q&&!$)return J&&!Q.includes(g6.merge)?Q.concat(g6.merge):Q.slice();let q=Q;if(!q)if(Array.isArray($))q=[];else{let Y=Array.from(WQ.keys()).filter((z)=>z!=="yaml11").map((z)=>JSON.stringify(z)).join(", ");throw Error(`Unknown schema "${X}"; use one of ${Y} or define customTags array`)}if(Array.isArray($))for(let Y of $)q=q.concat(Y);else if(typeof $==="function")q=$(q.slice());if(J)q=q.concat(g6.merge);return q.reduce((Y,z)=>{let G=typeof z==="string"?HQ[z]:z;if(!G){let W=JSON.stringify(z),H=Object.keys(HQ).map((U)=>JSON.stringify(U)).join(", ");throw Error(`Unknown custom tag ${W}; use one of ${H}`)}if(!Y.includes(G))Y.push(G);return Y},[])}zV.coreKnownTags=qV;zV.getTags=YV});var F4=_((KV)=>{var A4=n(),HV=E8(),UV=Z8(),VV=f6(),S5=DQ(),BV=($,X)=>$.key<X.key?-1:$.key>X.key?1:0;class _4{constructor({compat:$,customTags:X,merge:J,resolveKnownTags:Q,schema:q,sortMapEntries:Y,toStringDefaults:z}){this.compat=Array.isArray($)?S5.getTags($,"compat"):$?S5.getTags(null,$):null,this.name=typeof q==="string"&&q||"core",this.knownTags=Q?S5.coreKnownTags:{},this.tags=S5.getTags(X,this.name,J),this.toStringOptions=z??null,Object.defineProperty(this,A4.MAP,{value:HV.map}),Object.defineProperty(this,A4.SCALAR,{value:VV.string}),Object.defineProperty(this,A4.SEQ,{value:UV.seq}),this.sortMapEntries=typeof Y==="function"?Y:Y===!0?BV:null}clone(){let $=Object.create(_4.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}KV.Schema=_4});var OQ=_((OV)=>{var NV=n(),I4=j6(),v6=Z6();function DV($,X){let J=[],Q=X.directives===!0;if(X.directives!==!1&&$.directives){let W=$.directives.toString($);if(W)J.push(W),Q=!0;else if($.directives.docStart)Q=!0}if(Q)J.push("---");let q=I4.createStringifyContext($,X),{commentString:Y}=q.options;if($.commentBefore){if(J.length!==1)J.unshift("");let W=Y($.commentBefore);J.unshift(v6.indentComment(W,""))}let z=!1,G=null;if($.contents){if(NV.isNode($.contents)){if($.contents.spaceBefore&&Q)J.push("");if($.contents.commentBefore){let U=Y($.contents.commentBefore);J.push(v6.indentComment(U,""))}q.forceBlockIndent=!!$.comment,G=$.contents.comment}let W=G?void 0:()=>z=!0,H=I4.stringify($.contents,q,()=>G=null,W);if(G)H+=v6.lineComment(H,"",Y(G));if((H[0]==="|"||H[0]===">")&&J[J.length-1]==="---")J[J.length-1]=`--- ${H}`;else J.push(H)}else J.push(I4.stringify($.contents,q));if($.directives?.docEnd)if($.comment){let W=Y($.comment);if(W.includes(`
81
+ `))J.push("..."),J.push(v6.indentComment(W,""));else J.push(`... ${W}`)}else J.push("...");else{let W=$.comment;if(W&&z)W=W.replace(/^\n+/,"");if(W){if((!z||G)&&J[J.length-1]!=="")J.push("");J.push(v6.indentComment(Y(W),""))}}return J.join(`
82
82
  `)+`
83
- `}BV.stringifyDocument=VV});var g6=_((AV)=>{var MV=_6(),Z8=e2(),g$=n(),NV=E0(),DV=_0(),OV=L4(),wV=MQ(),A4=a2(),LV=uX(),RV=F6(),_4=hX();class F4{constructor($,X,J){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,g$.NODE_TYPE,{value:g$.DOC});let Q=null;if(typeof X==="function"||Array.isArray(X))Q=X;else if(J===void 0&&X)J=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"},J);this.options=q;let{version:Y}=q;if(J?._directives){if(this.directives=J._directives.atDocument(),this.directives.yaml.explicit)Y=this.directives.yaml.version}else this.directives=new _4.Directives({version:Y});this.setSchema(Y,J),this.contents=$===void 0?null:this.createNode($,Q,J)}clone(){let $=Object.create(F4.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(S8(this.contents))this.contents.add($)}addIn($,X){if(S8(this.contents))this.contents.addIn($,X)}createAlias($,X){if(!$.anchor){let J=A4.anchorNames(this);$.anchor=!X||J.has(X)?A4.findNewAnchor(X||"a",J):X}return new MV.Alias($.anchor)}createNode($,X,J){let Q=void 0;if(typeof X==="function")$=X.call({"":$},"",$),Q=X;else if(Array.isArray(X)){let M=(L)=>typeof L==="number"||L instanceof String||L instanceof Number,N=X.filter(M).map(String);if(N.length>0)X=X.concat(N);Q=X}else if(J===void 0&&X)J=X,X=void 0;let{aliasDuplicateObjects:q,anchorPrefix:Y,flow:z,keepUndefined:G,onTagObj:W,tag:H}=J??{},{onAnchor:U,setAnchors:V,sourceObjects:B}=A4.createNodeAnchors(this,Y||"a"),D={aliasDuplicateObjects:q??!0,keepUndefined:G??!1,onAnchor:U,onTagObj:W,replacer:Q,schema:this.schema,sourceObjects:B},w=RV.createNode($,H,D);if(z&&g$.isCollection(w))w.flow=!0;return V(),w}createPair($,X,J={}){let Q=this.createNode($,null,J),q=this.createNode(X,null,J);return new NV.Pair(Q,q)}delete($){return S8(this.contents)?this.contents.delete($):!1}deleteIn($){if(Z8.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return S8(this.contents)?this.contents.deleteIn($):!1}get($,X){return g$.isCollection(this.contents)?this.contents.get($,X):void 0}getIn($,X){if(Z8.isEmptyPath($))return!X&&g$.isScalar(this.contents)?this.contents.value:this.contents;return g$.isCollection(this.contents)?this.contents.getIn($,X):void 0}has($){return g$.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(Z8.isEmptyPath($))return this.contents!==void 0;return g$.isCollection(this.contents)?this.contents.hasIn($):!1}set($,X){if(this.contents==null)this.contents=Z8.collectionFromPath(this.schema,[$],X);else if(S8(this.contents))this.contents.set($,X)}setIn($,X){if(Z8.isEmptyPath($))this.contents=X;else if(this.contents==null)this.contents=Z8.collectionFromPath(this.schema,Array.from($),X);else if(S8(this.contents))this.contents.setIn($,X)}setSchema($,X={}){if(typeof $==="number")$=String($);let J;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new _4.Directives({version:"1.1"});J={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new _4.Directives({version:$});J={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;J=null;break;default:{let Q=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${Q}`)}}if(X.schema instanceof Object)this.schema=X.schema;else if(J)this.schema=new OV.Schema(Object.assign(J,X));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:X,mapAsMap:J,maxAliasCount:Q,onAnchor:q,reviver:Y}={}){let z={anchors:new Map,doc:this,keep:!$,mapAsMap:J===!0,mapKeyWarned:!1,maxAliasCount:typeof Q==="number"?Q:100},G=DV.toJS(this.contents,X??"",z);if(typeof q==="function")for(let{count:W,res:H}of z.anchors.values())q(H,W);return typeof Y==="function"?LV.applyReviver(Y,{"":G},"",G):G}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 wV.stringifyDocument(this,$)}}function S8($){if(g$.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}AV.Document=F4});var v6=_((IV)=>{class E5 extends Error{constructor($,X,J,Q){super();this.name=$,this.code=J,this.message=Q,this.pos=X}}class NQ extends E5{constructor($,X,J){super("YAMLParseError",$,X,J)}}class DQ extends E5{constructor($,X,J){super("YAMLWarning",$,X,J)}}var FV=($,X)=>(J)=>{if(J.pos[0]===-1)return;J.linePos=J.pos.map((G)=>X.linePos(G));let{line:Q,col:q}=J.linePos[0];J.message+=` at line ${Q}, column ${q}`;let Y=q-1,z=$.substring(X.lineStarts[Q-1],X.lineStarts[Q]).replace(/[\n\r]+$/,"");if(Y>=60&&z.length>80){let G=Math.min(Y-39,z.length-79);z="…"+z.substring(G),Y-=G-1}if(z.length>80)z=z.substring(0,79)+"…";if(Q>1&&/^ *$/.test(z.substring(0,Y))){let G=$.substring(X.lineStarts[Q-2],X.lineStarts[Q-1]);if(G.length>80)G=G.substring(0,79)+`…
83
+ `}OV.stringifyDocument=DV});var h6=_((ZV)=>{var LV=I6(),S8=Q5(),g$=n(),RV=Z0(),AV=F0(),_V=F4(),FV=OQ(),E4=$5(),IV=pX(),EV=E6(),Z4=cX();class T4{constructor($,X,J){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,g$.NODE_TYPE,{value:g$.DOC});let Q=null;if(typeof X==="function"||Array.isArray(X))Q=X;else if(J===void 0&&X)J=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"},J);this.options=q;let{version:Y}=q;if(J?._directives){if(this.directives=J._directives.atDocument(),this.directives.yaml.explicit)Y=this.directives.yaml.version}else this.directives=new Z4.Directives({version:Y});this.setSchema(Y,J),this.contents=$===void 0?null:this.createNode($,Q,J)}clone(){let $=Object.create(T4.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(j8(this.contents))this.contents.add($)}addIn($,X){if(j8(this.contents))this.contents.addIn($,X)}createAlias($,X){if(!$.anchor){let J=E4.anchorNames(this);$.anchor=!X||J.has(X)?E4.findNewAnchor(X||"a",J):X}return new LV.Alias($.anchor)}createNode($,X,J){let Q=void 0;if(typeof X==="function")$=X.call({"":$},"",$),Q=X;else if(Array.isArray(X)){let M=(L)=>typeof L==="number"||L instanceof String||L instanceof Number,N=X.filter(M).map(String);if(N.length>0)X=X.concat(N);Q=X}else if(J===void 0&&X)J=X,X=void 0;let{aliasDuplicateObjects:q,anchorPrefix:Y,flow:z,keepUndefined:G,onTagObj:W,tag:H}=J??{},{onAnchor:U,setAnchors:V,sourceObjects:B}=E4.createNodeAnchors(this,Y||"a"),D={aliasDuplicateObjects:q??!0,keepUndefined:G??!1,onAnchor:U,onTagObj:W,replacer:Q,schema:this.schema,sourceObjects:B},w=EV.createNode($,H,D);if(z&&g$.isCollection(w))w.flow=!0;return V(),w}createPair($,X,J={}){let Q=this.createNode($,null,J),q=this.createNode(X,null,J);return new RV.Pair(Q,q)}delete($){return j8(this.contents)?this.contents.delete($):!1}deleteIn($){if(S8.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return j8(this.contents)?this.contents.deleteIn($):!1}get($,X){return g$.isCollection(this.contents)?this.contents.get($,X):void 0}getIn($,X){if(S8.isEmptyPath($))return!X&&g$.isScalar(this.contents)?this.contents.value:this.contents;return g$.isCollection(this.contents)?this.contents.getIn($,X):void 0}has($){return g$.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(S8.isEmptyPath($))return this.contents!==void 0;return g$.isCollection(this.contents)?this.contents.hasIn($):!1}set($,X){if(this.contents==null)this.contents=S8.collectionFromPath(this.schema,[$],X);else if(j8(this.contents))this.contents.set($,X)}setIn($,X){if(S8.isEmptyPath($))this.contents=X;else if(this.contents==null)this.contents=S8.collectionFromPath(this.schema,Array.from($),X);else if(j8(this.contents))this.contents.setIn($,X)}setSchema($,X={}){if(typeof $==="number")$=String($);let J;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new Z4.Directives({version:"1.1"});J={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new Z4.Directives({version:$});J={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;J=null;break;default:{let Q=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${Q}`)}}if(X.schema instanceof Object)this.schema=X.schema;else if(J)this.schema=new _V.Schema(Object.assign(J,X));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:X,mapAsMap:J,maxAliasCount:Q,onAnchor:q,reviver:Y}={}){let z={anchors:new Map,doc:this,keep:!$,mapAsMap:J===!0,mapKeyWarned:!1,maxAliasCount:typeof Q==="number"?Q:100},G=AV.toJS(this.contents,X??"",z);if(typeof q==="function")for(let{count:W,res:H}of z.anchors.values())q(H,W);return typeof Y==="function"?IV.applyReviver(Y,{"":G},"",G):G}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 FV.stringifyDocument(this,$)}}function j8($){if(g$.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}ZV.Document=T4});var u6=_((jV)=>{class j5 extends Error{constructor($,X,J,Q){super();this.name=$,this.code=J,this.message=Q,this.pos=X}}class wQ extends j5{constructor($,X,J){super("YAMLParseError",$,X,J)}}class LQ extends j5{constructor($,X,J){super("YAMLWarning",$,X,J)}}var SV=($,X)=>(J)=>{if(J.pos[0]===-1)return;J.linePos=J.pos.map((G)=>X.linePos(G));let{line:Q,col:q}=J.linePos[0];J.message+=` at line ${Q}, column ${q}`;let Y=q-1,z=$.substring(X.lineStarts[Q-1],X.lineStarts[Q]).replace(/[\n\r]+$/,"");if(Y>=60&&z.length>80){let G=Math.min(Y-39,z.length-79);z="…"+z.substring(G),Y-=G-1}if(z.length>80)z=z.substring(0,79)+"…";if(Q>1&&/^ *$/.test(z.substring(0,Y))){let G=$.substring(X.lineStarts[Q-2],X.lineStarts[Q-1]);if(G.length>80)G=G.substring(0,79)+`…
84
84
  `;z=G+z}if(/[^ ]/.test(z)){let G=1,W=J.linePos[1];if(W?.line===Q&&W.col>q)G=Math.max(1,Math.min(W.col-q,80-Y));let H=" ".repeat(Y)+"^".repeat(G);J.message+=`:
85
85
 
86
86
  ${z}
87
87
  ${H}
88
- `}};IV.YAMLError=E5;IV.YAMLParseError=NQ;IV.YAMLWarning=DQ;IV.prettifyError=FV});var h6=_((CV)=>{function jV($,{flow:X,indicator:J,next:Q,offset:q,onError:Y,parentIndent:z,startOnNewline:G}){let W=!1,H=G,U=G,V="",B="",D=!1,w=!1,M=null,N=null,L=null,I=null,Z=null,y=null,x=null;for(let j of $){if(w){if(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma")Y(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");w=!1}if(M){if(H&&j.type!=="comment"&&j.type!=="newline")Y(M,"TAB_AS_INDENT","Tabs are not allowed as indentation");M=null}switch(j.type){case"space":if(!X&&(J!=="doc-start"||Q?.type!=="flow-collection")&&j.source.includes("\t"))M=j;U=!0;break;case"comment":{if(!U)Y(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let G$=j.source.substring(1)||" ";if(!V)V=G$;else V+=B+G$;B="",H=!1;break}case"newline":if(H){if(V)V+=j.source;else if(!y||J!=="seq-item-ind")W=!0}else B+=j.source;if(H=!0,D=!0,N||L)I=j;U=!0;break;case"anchor":if(N)Y(j,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(j.source.endsWith(":"))Y(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);N=j,x??(x=j.offset),H=!1,U=!1,w=!0;break;case"tag":{if(L)Y(j,"MULTIPLE_TAGS","A node can have at most one tag");L=j,x??(x=j.offset),H=!1,U=!1,w=!0;break}case J:if(N||L)Y(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`);if(y)Y(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${X??"collection"}`);y=j,H=J==="seq-item-ind"||J==="explicit-key-ind",U=!1;break;case"comma":if(X){if(Z)Y(j,"UNEXPECTED_TOKEN",`Unexpected , in ${X}`);Z=j,H=!1,U=!1;break}default:Y(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),H=!1,U=!1}}let k=$[$.length-1],l=k?k.offset+k.source.length:q;if(w&&Q&&Q.type!=="space"&&Q.type!=="newline"&&Q.type!=="comma"&&(Q.type!=="scalar"||Q.source!==""))Y(Q.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(M&&(H&&M.indent<=z||Q?.type==="block-map"||Q?.type==="block-seq"))Y(M,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:Z,found:y,spaceBefore:W,comment:V,hasNewline:D,anchor:N,tag:L,newlineAfterProp:I,end:l,start:x??l}}CV.resolveProps=jV});var T5=_((bV)=>{function I4($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
89
- `))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 J of X.start)if(J.type==="newline")return!0;if(X.sep){for(let J of X.sep)if(J.type==="newline")return!0}if(I4(X.key)||I4(X.value))return!0}return!1;default:return!0}}bV.containsNewline=I4});var E4=_((yV)=>{var kV=T5();function xV($,X,J){if(X?.type==="flow-collection"){let Q=X.end[0];if(Q.indent===$&&(Q.source==="]"||Q.source==="}")&&kV.containsNewline(X))J(Q,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}yV.flowIndentCheck=xV});var T4=_((hV)=>{var OQ=n();function vV($,X,J){let{uniqueKeys:Q}=$.options;if(Q===!1)return!1;let q=typeof Q==="function"?Q:(Y,z)=>Y===z||OQ.isScalar(Y)&&OQ.isScalar(z)&&Y.value===z.value;return X.some((Y)=>q(Y.key,J))}hV.mapIncludes=vV});var _Q=_((dV)=>{var wQ=E0(),mV=Z0(),LQ=h6(),lV=T5(),RQ=E4(),cV=T4(),AQ="All mapping items must start at the same column";function pV({composeNode:$,composeEmptyNode:X},J,Q,q,Y){let G=new(Y?.nodeClass??mV.YAMLMap)(J.schema);if(J.atRoot)J.atRoot=!1;let W=Q.offset,H=null;for(let U of Q.items){let{start:V,key:B,sep:D,value:w}=U,M=LQ.resolveProps(V,{indicator:"explicit-key-ind",next:B??D?.[0],offset:W,onError:q,parentIndent:Q.indent,startOnNewline:!0}),N=!M.found;if(N){if(B){if(B.type==="block-seq")q(W,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in B&&B.indent!==Q.indent)q(W,"BAD_INDENT",AQ)}if(!M.anchor&&!M.tag&&!D){if(H=M.end,M.comment)if(G.comment)G.comment+=`
90
- `+M.comment;else G.comment=M.comment;continue}if(M.newlineAfterProp||lV.containsNewline(B))q(B??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(M.found?.indent!==Q.indent)q(W,"BAD_INDENT",AQ);J.atKey=!0;let L=M.end,I=B?$(J,B,M,q):X(J,L,V,null,M,q);if(J.schema.compat)RQ.flowIndentCheck(Q.indent,B,q);if(J.atKey=!1,cV.mapIncludes(J,G.items,I))q(L,"DUPLICATE_KEY","Map keys must be unique");let Z=LQ.resolveProps(D??[],{indicator:"map-value-ind",next:w,offset:I.range[2],onError:q,parentIndent:Q.indent,startOnNewline:!B||B.type==="block-scalar"});if(W=Z.end,Z.found){if(N){if(w?.type==="block-map"&&!Z.hasNewline)q(W,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(J.options.strict&&M.start<Z.found.offset-1024)q(I.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let y=w?$(J,w,Z,q):X(J,W,D,null,Z,q);if(J.schema.compat)RQ.flowIndentCheck(Q.indent,w,q);W=y.range[2];let x=new wQ.Pair(I,y);if(J.options.keepSourceTokens)x.srcToken=U;G.items.push(x)}else{if(N)q(I.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(Z.comment)if(I.comment)I.comment+=`
91
- `+Z.comment;else I.comment=Z.comment;let y=new wQ.Pair(I);if(J.options.keepSourceTokens)y.srcToken=U;G.items.push(y)}}if(H&&H<W)q(H,"IMPOSSIBLE","Map comment with trailing content");return G.range=[Q.offset,W,H??W],G}dV.resolveBlockMap=pV});var FQ=_((oV)=>{var nV=S0(),rV=h6(),sV=E4();function aV({composeNode:$,composeEmptyNode:X},J,Q,q,Y){let G=new(Y?.nodeClass??nV.YAMLSeq)(J.schema);if(J.atRoot)J.atRoot=!1;if(J.atKey)J.atKey=!1;let W=Q.offset,H=null;for(let{start:U,value:V}of Q.items){let B=rV.resolveProps(U,{indicator:"seq-item-ind",next:V,offset:W,onError:q,parentIndent:Q.indent,startOnNewline:!0});if(!B.found)if(B.anchor||B.tag||V)if(V?.type==="block-seq")q(B.end,"BAD_INDENT","All sequence items must start at the same column");else q(W,"MISSING_CHAR","Sequence item without - indicator");else{if(H=B.end,B.comment)G.comment=B.comment;continue}let D=V?$(J,V,B,q):X(J,B.end,U,null,B,q);if(J.schema.compat)sV.flowIndentCheck(Q.indent,V,q);W=D.range[2],G.items.push(D)}return G.range=[Q.offset,W,H??W],G}oV.resolveBlockSeq=aV});var j8=_(($B)=>{function eV($,X,J,Q){let q="";if($){let Y=!1,z="";for(let G of $){let{source:W,type:H}=G;switch(H){case"space":Y=!0;break;case"comment":{if(J&&!Y)Q(G,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let U=W.substring(1)||" ";if(!q)q=U;else q+=z+U;z="";break}case"newline":if(q)z+=W;Y=!0;break;default:Q(G,"UNEXPECTED_TOKEN",`Unexpected ${H} at node end`)}X+=W.length}}return{comment:q,offset:X}}$B.resolveEnd=eV});var TQ=_((HB)=>{var JB=n(),QB=E0(),IQ=Z0(),qB=S0(),YB=j8(),EQ=h6(),zB=T5(),GB=T4(),Z4="Block collections are not allowed within flow collections",S4=($)=>$&&($.type==="block-map"||$.type==="block-seq");function WB({composeNode:$,composeEmptyNode:X},J,Q,q,Y){let z=Q.start.source==="{",G=z?"flow map":"flow sequence",H=new(Y?.nodeClass??(z?IQ.YAMLMap:qB.YAMLSeq))(J.schema);H.flow=!0;let U=J.atRoot;if(U)J.atRoot=!1;if(J.atKey)J.atKey=!1;let V=Q.offset+Q.start.source.length;for(let N=0;N<Q.items.length;++N){let L=Q.items[N],{start:I,key:Z,sep:y,value:x}=L,k=EQ.resolveProps(I,{flow:G,indicator:"explicit-key-ind",next:Z??y?.[0],offset:V,onError:q,parentIndent:Q.indent,startOnNewline:!1});if(!k.found){if(!k.anchor&&!k.tag&&!y&&!x){if(N===0&&k.comma)q(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`);else if(N<Q.items.length-1)q(k.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${G}`);if(k.comment)if(H.comment)H.comment+=`
92
- `+k.comment;else H.comment=k.comment;V=k.end;continue}if(!z&&J.options.strict&&zB.containsNewline(Z))q(Z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0){if(k.comma)q(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`)}else{if(!k.comma)q(k.start,"MISSING_CHAR",`Missing , between ${G} items`);if(k.comment){let l="";$:for(let j of I)switch(j.type){case"comma":case"space":break;case"comment":l=j.source.substring(1);break $;default:break $}if(l){let j=H.items[H.items.length-1];if(JB.isPair(j))j=j.value??j.key;if(j.comment)j.comment+=`
93
- `+l;else j.comment=l;k.comment=k.comment.substring(l.length+1)}}}if(!z&&!y&&!k.found){let l=x?$(J,x,k,q):X(J,k.end,y,null,k,q);if(H.items.push(l),V=l.range[2],S4(x))q(l.range,"BLOCK_IN_FLOW",Z4)}else{J.atKey=!0;let l=k.end,j=Z?$(J,Z,k,q):X(J,l,I,null,k,q);if(S4(Z))q(j.range,"BLOCK_IN_FLOW",Z4);J.atKey=!1;let G$=EQ.resolveProps(y??[],{flow:G,indicator:"map-value-ind",next:x,offset:j.range[2],onError:q,parentIndent:Q.indent,startOnNewline:!1});if(G$.found){if(!z&&!k.found&&J.options.strict){if(y)for(let V$ of y){if(V$===G$.found)break;if(V$.type==="newline"){q(V$,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(k.start<G$.found.offset-1024)q(G$.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(x)if("source"in x&&x.source?.[0]===":")q(x,"MISSING_CHAR",`Missing space after : in ${G}`);else q(G$.start,"MISSING_CHAR",`Missing , or : between ${G} items`);let t$=x?$(J,x,G$,q):G$.found?X(J,G$.end,y,null,G$,q):null;if(t$){if(S4(x))q(t$.range,"BLOCK_IN_FLOW",Z4)}else if(G$.comment)if(j.comment)j.comment+=`
94
- `+G$.comment;else j.comment=G$.comment;let i=new QB.Pair(j,t$);if(J.options.keepSourceTokens)i.srcToken=L;if(z){let V$=H;if(GB.mapIncludes(J,V$.items,j))q(l,"DUPLICATE_KEY","Map keys must be unique");V$.items.push(i)}else{let V$=new IQ.YAMLMap(J.schema);V$.flow=!0,V$.items.push(i);let w8=(t$??j).range;V$.range=[j.range[0],w8[1],w8[2]],H.items.push(V$)}V=t$?t$.range[2]:G$.end}}let B=z?"}":"]",[D,...w]=Q.end,M=V;if(D?.source===B)M=D.offset+D.source.length;else{let N=G[0].toUpperCase()+G.substring(1),L=U?`${N} must end with a ${B}`:`${N} in block collection must be sufficiently indented and end with a ${B}`;if(q(V,U?"MISSING_CHAR":"BAD_INDENT",L),D&&D.source.length!==1)w.unshift(D)}if(w.length>0){let N=YB.resolveEnd(w,M,J.options.strict,q);if(N.comment)if(H.comment)H.comment+=`
95
- `+N.comment;else H.comment=N.comment;H.range=[Q.offset,M,N.offset]}else H.range=[Q.offset,M,M];return H}HB.resolveFlowCollection=WB});var ZQ=_((LB)=>{var VB=n(),BB=M$(),KB=Z0(),MB=S0(),NB=_Q(),DB=FQ(),OB=TQ();function j4($,X,J,Q,q,Y){let z=J.type==="block-map"?NB.resolveBlockMap($,X,J,Q,Y):J.type==="block-seq"?DB.resolveBlockSeq($,X,J,Q,Y):OB.resolveFlowCollection($,X,J,Q,Y),G=z.constructor;if(q==="!"||q===G.tagName)return z.tag=G.tagName,z;if(q)z.tag=q;return z}function wB($,X,J,Q,q){let Y=Q.tag,z=!Y?null:X.directives.tagName(Y.source,(B)=>q(Y,"TAG_RESOLVE_FAILED",B));if(J.type==="block-seq"){let{anchor:B,newlineAfterProp:D}=Q,w=B&&Y?B.offset>Y.offset?B:Y:B??Y;if(w&&(!D||D.offset<w.offset))q(w,"MISSING_CHAR","Missing newline after block sequence props")}let G=J.type==="block-map"?"map":J.type==="block-seq"?"seq":J.start.source==="{"?"map":"seq";if(!Y||!z||z==="!"||z===KB.YAMLMap.tagName&&G==="map"||z===MB.YAMLSeq.tagName&&G==="seq")return j4($,X,J,q,z);let W=X.schema.tags.find((B)=>B.tag===z&&B.collection===G);if(!W){let B=X.schema.knownTags[z];if(B?.collection===G)X.schema.tags.push(Object.assign({},B,{default:!1})),W=B;else{if(B)q(Y,"BAD_COLLECTION_TYPE",`${B.tag} used for ${G} collection, but expects ${B.collection??"scalar"}`,!0);else q(Y,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,!0);return j4($,X,J,q,z)}}let H=j4($,X,J,q,z,W),U=W.resolve?.(H,(B)=>q(Y,"TAG_RESOLVE_FAILED",B),X.options)??H,V=VB.isNode(U)?U:new BB.Scalar(U);if(V.range=H.range,V.tag=z,W?.format)V.format=W.format;return V}LB.composeCollection=wB});var P4=_((IB)=>{var C4=M$();function AB($,X,J){let Q=X.offset,q=_B(X,$.options.strict,J);if(!q)return{value:"",type:null,comment:"",range:[Q,Q,Q]};let Y=q.mode===">"?C4.Scalar.BLOCK_FOLDED:C4.Scalar.BLOCK_LITERAL,z=X.source?FB(X.source):[],G=z.length;for(let M=z.length-1;M>=0;--M){let N=z[M][1];if(N===""||N==="\r")G=M;else break}if(G===0){let M=q.chomp==="+"&&z.length>0?`
88
+ `}};jV.YAMLError=j5;jV.YAMLParseError=wQ;jV.YAMLWarning=LQ;jV.prettifyError=SV});var m6=_((xV)=>{function kV($,{flow:X,indicator:J,next:Q,offset:q,onError:Y,parentIndent:z,startOnNewline:G}){let W=!1,H=G,U=G,V="",B="",D=!1,w=!1,M=null,N=null,L=null,I=null,T=null,y=null,x=null;for(let j of $){if(w){if(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma")Y(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");w=!1}if(M){if(H&&j.type!=="comment"&&j.type!=="newline")Y(M,"TAB_AS_INDENT","Tabs are not allowed as indentation");M=null}switch(j.type){case"space":if(!X&&(J!=="doc-start"||Q?.type!=="flow-collection")&&j.source.includes("\t"))M=j;U=!0;break;case"comment":{if(!U)Y(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let H$=j.source.substring(1)||" ";if(!V)V=H$;else V+=B+H$;B="",H=!1;break}case"newline":if(H){if(V)V+=j.source;else if(!y||J!=="seq-item-ind")W=!0}else B+=j.source;if(H=!0,D=!0,N||L)I=j;U=!0;break;case"anchor":if(N)Y(j,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(j.source.endsWith(":"))Y(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);N=j,x??(x=j.offset),H=!1,U=!1,w=!0;break;case"tag":{if(L)Y(j,"MULTIPLE_TAGS","A node can have at most one tag");L=j,x??(x=j.offset),H=!1,U=!1,w=!0;break}case J:if(N||L)Y(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`);if(y)Y(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${X??"collection"}`);y=j,H=J==="seq-item-ind"||J==="explicit-key-ind",U=!1;break;case"comma":if(X){if(T)Y(j,"UNEXPECTED_TOKEN",`Unexpected , in ${X}`);T=j,H=!1,U=!1;break}default:Y(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),H=!1,U=!1}}let k=$[$.length-1],l=k?k.offset+k.source.length:q;if(w&&Q&&Q.type!=="space"&&Q.type!=="newline"&&Q.type!=="comma"&&(Q.type!=="scalar"||Q.source!==""))Y(Q.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(M&&(H&&M.indent<=z||Q?.type==="block-map"||Q?.type==="block-seq"))Y(M,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:T,found:y,spaceBefore:W,comment:V,hasNewline:D,anchor:N,tag:L,newlineAfterProp:I,end:l,start:x??l}}xV.resolveProps=kV});var C5=_((gV)=>{function S4($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
89
+ `))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 J of X.start)if(J.type==="newline")return!0;if(X.sep){for(let J of X.sep)if(J.type==="newline")return!0}if(S4(X.key)||S4(X.value))return!0}return!1;default:return!0}}gV.containsNewline=S4});var j4=_((mV)=>{var hV=C5();function uV($,X,J){if(X?.type==="flow-collection"){let Q=X.end[0];if(Q.indent===$&&(Q.source==="]"||Q.source==="}")&&hV.containsNewline(X))J(Q,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}mV.flowIndentCheck=uV});var C4=_((pV)=>{var RQ=n();function cV($,X,J){let{uniqueKeys:Q}=$.options;if(Q===!1)return!1;let q=typeof Q==="function"?Q:(Y,z)=>Y===z||RQ.isScalar(Y)&&RQ.isScalar(z)&&Y.value===z.value;return X.some((Y)=>q(Y.key,J))}pV.mapIncludes=cV});var EQ=_((aV)=>{var AQ=Z0(),iV=S0(),_Q=m6(),nV=C5(),FQ=j4(),rV=C4(),IQ="All mapping items must start at the same column";function sV({composeNode:$,composeEmptyNode:X},J,Q,q,Y){let G=new(Y?.nodeClass??iV.YAMLMap)(J.schema);if(J.atRoot)J.atRoot=!1;let W=Q.offset,H=null;for(let U of Q.items){let{start:V,key:B,sep:D,value:w}=U,M=_Q.resolveProps(V,{indicator:"explicit-key-ind",next:B??D?.[0],offset:W,onError:q,parentIndent:Q.indent,startOnNewline:!0}),N=!M.found;if(N){if(B){if(B.type==="block-seq")q(W,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in B&&B.indent!==Q.indent)q(W,"BAD_INDENT",IQ)}if(!M.anchor&&!M.tag&&!D){if(H=M.end,M.comment)if(G.comment)G.comment+=`
90
+ `+M.comment;else G.comment=M.comment;continue}if(M.newlineAfterProp||nV.containsNewline(B))q(B??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(M.found?.indent!==Q.indent)q(W,"BAD_INDENT",IQ);J.atKey=!0;let L=M.end,I=B?$(J,B,M,q):X(J,L,V,null,M,q);if(J.schema.compat)FQ.flowIndentCheck(Q.indent,B,q);if(J.atKey=!1,rV.mapIncludes(J,G.items,I))q(L,"DUPLICATE_KEY","Map keys must be unique");let T=_Q.resolveProps(D??[],{indicator:"map-value-ind",next:w,offset:I.range[2],onError:q,parentIndent:Q.indent,startOnNewline:!B||B.type==="block-scalar"});if(W=T.end,T.found){if(N){if(w?.type==="block-map"&&!T.hasNewline)q(W,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(J.options.strict&&M.start<T.found.offset-1024)q(I.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let y=w?$(J,w,T,q):X(J,W,D,null,T,q);if(J.schema.compat)FQ.flowIndentCheck(Q.indent,w,q);W=y.range[2];let x=new AQ.Pair(I,y);if(J.options.keepSourceTokens)x.srcToken=U;G.items.push(x)}else{if(N)q(I.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(T.comment)if(I.comment)I.comment+=`
91
+ `+T.comment;else I.comment=T.comment;let y=new AQ.Pair(I);if(J.options.keepSourceTokens)y.srcToken=U;G.items.push(y)}}if(H&&H<W)q(H,"IMPOSSIBLE","Map comment with trailing content");return G.range=[Q.offset,W,H??W],G}aV.resolveBlockMap=sV});var ZQ=_((JB)=>{var tV=j0(),eV=m6(),$B=j4();function XB({composeNode:$,composeEmptyNode:X},J,Q,q,Y){let G=new(Y?.nodeClass??tV.YAMLSeq)(J.schema);if(J.atRoot)J.atRoot=!1;if(J.atKey)J.atKey=!1;let W=Q.offset,H=null;for(let{start:U,value:V}of Q.items){let B=eV.resolveProps(U,{indicator:"seq-item-ind",next:V,offset:W,onError:q,parentIndent:Q.indent,startOnNewline:!0});if(!B.found)if(B.anchor||B.tag||V)if(V?.type==="block-seq")q(B.end,"BAD_INDENT","All sequence items must start at the same column");else q(W,"MISSING_CHAR","Sequence item without - indicator");else{if(H=B.end,B.comment)G.comment=B.comment;continue}let D=V?$(J,V,B,q):X(J,B.end,U,null,B,q);if(J.schema.compat)$B.flowIndentCheck(Q.indent,V,q);W=D.range[2],G.items.push(D)}return G.range=[Q.offset,W,H??W],G}JB.resolveBlockSeq=XB});var C8=_((YB)=>{function qB($,X,J,Q){let q="";if($){let Y=!1,z="";for(let G of $){let{source:W,type:H}=G;switch(H){case"space":Y=!0;break;case"comment":{if(J&&!Y)Q(G,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let U=W.substring(1)||" ";if(!q)q=U;else q+=z+U;z="";break}case"newline":if(q)z+=W;Y=!0;break;default:Q(G,"UNEXPECTED_TOKEN",`Unexpected ${H} at node end`)}X+=W.length}}return{comment:q,offset:X}}YB.resolveEnd=qB});var jQ=_((MB)=>{var GB=n(),WB=Z0(),TQ=S0(),HB=j0(),UB=C8(),SQ=m6(),VB=C5(),BB=C4(),b4="Block collections are not allowed within flow collections",P4=($)=>$&&($.type==="block-map"||$.type==="block-seq");function KB({composeNode:$,composeEmptyNode:X},J,Q,q,Y){let z=Q.start.source==="{",G=z?"flow map":"flow sequence",H=new(Y?.nodeClass??(z?TQ.YAMLMap:HB.YAMLSeq))(J.schema);H.flow=!0;let U=J.atRoot;if(U)J.atRoot=!1;if(J.atKey)J.atKey=!1;let V=Q.offset+Q.start.source.length;for(let N=0;N<Q.items.length;++N){let L=Q.items[N],{start:I,key:T,sep:y,value:x}=L,k=SQ.resolveProps(I,{flow:G,indicator:"explicit-key-ind",next:T??y?.[0],offset:V,onError:q,parentIndent:Q.indent,startOnNewline:!1});if(!k.found){if(!k.anchor&&!k.tag&&!y&&!x){if(N===0&&k.comma)q(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`);else if(N<Q.items.length-1)q(k.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${G}`);if(k.comment)if(H.comment)H.comment+=`
92
+ `+k.comment;else H.comment=k.comment;V=k.end;continue}if(!z&&J.options.strict&&VB.containsNewline(T))q(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0){if(k.comma)q(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${G}`)}else{if(!k.comma)q(k.start,"MISSING_CHAR",`Missing , between ${G} items`);if(k.comment){let l="";$:for(let j of I)switch(j.type){case"comma":case"space":break;case"comment":l=j.source.substring(1);break $;default:break $}if(l){let j=H.items[H.items.length-1];if(GB.isPair(j))j=j.value??j.key;if(j.comment)j.comment+=`
93
+ `+l;else j.comment=l;k.comment=k.comment.substring(l.length+1)}}}if(!z&&!y&&!k.found){let l=x?$(J,x,k,q):X(J,k.end,y,null,k,q);if(H.items.push(l),V=l.range[2],P4(x))q(l.range,"BLOCK_IN_FLOW",b4)}else{J.atKey=!0;let l=k.end,j=T?$(J,T,k,q):X(J,l,I,null,k,q);if(P4(T))q(j.range,"BLOCK_IN_FLOW",b4);J.atKey=!1;let H$=SQ.resolveProps(y??[],{flow:G,indicator:"map-value-ind",next:x,offset:j.range[2],onError:q,parentIndent:Q.indent,startOnNewline:!1});if(H$.found){if(!z&&!k.found&&J.options.strict){if(y)for(let V$ of y){if(V$===H$.found)break;if(V$.type==="newline"){q(V$,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(k.start<H$.found.offset-1024)q(H$.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(x)if("source"in x&&x.source?.[0]===":")q(x,"MISSING_CHAR",`Missing space after : in ${G}`);else q(H$.start,"MISSING_CHAR",`Missing , or : between ${G} items`);let t$=x?$(J,x,H$,q):H$.found?X(J,H$.end,y,null,H$,q):null;if(t$){if(P4(x))q(t$.range,"BLOCK_IN_FLOW",b4)}else if(H$.comment)if(j.comment)j.comment+=`
94
+ `+H$.comment;else j.comment=H$.comment;let i=new WB.Pair(j,t$);if(J.options.keepSourceTokens)i.srcToken=L;if(z){let V$=H;if(BB.mapIncludes(J,V$.items,j))q(l,"DUPLICATE_KEY","Map keys must be unique");V$.items.push(i)}else{let V$=new TQ.YAMLMap(J.schema);V$.flow=!0,V$.items.push(i);let L8=(t$??j).range;V$.range=[j.range[0],L8[1],L8[2]],H.items.push(V$)}V=t$?t$.range[2]:H$.end}}let B=z?"}":"]",[D,...w]=Q.end,M=V;if(D?.source===B)M=D.offset+D.source.length;else{let N=G[0].toUpperCase()+G.substring(1),L=U?`${N} must end with a ${B}`:`${N} in block collection must be sufficiently indented and end with a ${B}`;if(q(V,U?"MISSING_CHAR":"BAD_INDENT",L),D&&D.source.length!==1)w.unshift(D)}if(w.length>0){let N=UB.resolveEnd(w,M,J.options.strict,q);if(N.comment)if(H.comment)H.comment+=`
95
+ `+N.comment;else H.comment=N.comment;H.range=[Q.offset,M,N.offset]}else H.range=[Q.offset,M,M];return H}MB.resolveFlowCollection=KB});var CQ=_((IB)=>{var DB=n(),OB=M$(),wB=S0(),LB=j0(),RB=EQ(),AB=ZQ(),_B=jQ();function f4($,X,J,Q,q,Y){let z=J.type==="block-map"?RB.resolveBlockMap($,X,J,Q,Y):J.type==="block-seq"?AB.resolveBlockSeq($,X,J,Q,Y):_B.resolveFlowCollection($,X,J,Q,Y),G=z.constructor;if(q==="!"||q===G.tagName)return z.tag=G.tagName,z;if(q)z.tag=q;return z}function FB($,X,J,Q,q){let Y=Q.tag,z=!Y?null:X.directives.tagName(Y.source,(B)=>q(Y,"TAG_RESOLVE_FAILED",B));if(J.type==="block-seq"){let{anchor:B,newlineAfterProp:D}=Q,w=B&&Y?B.offset>Y.offset?B:Y:B??Y;if(w&&(!D||D.offset<w.offset))q(w,"MISSING_CHAR","Missing newline after block sequence props")}let G=J.type==="block-map"?"map":J.type==="block-seq"?"seq":J.start.source==="{"?"map":"seq";if(!Y||!z||z==="!"||z===wB.YAMLMap.tagName&&G==="map"||z===LB.YAMLSeq.tagName&&G==="seq")return f4($,X,J,q,z);let W=X.schema.tags.find((B)=>B.tag===z&&B.collection===G);if(!W){let B=X.schema.knownTags[z];if(B?.collection===G)X.schema.tags.push(Object.assign({},B,{default:!1})),W=B;else{if(B)q(Y,"BAD_COLLECTION_TYPE",`${B.tag} used for ${G} collection, but expects ${B.collection??"scalar"}`,!0);else q(Y,"TAG_RESOLVE_FAILED",`Unresolved tag: ${z}`,!0);return f4($,X,J,q,z)}}let H=f4($,X,J,q,z,W),U=W.resolve?.(H,(B)=>q(Y,"TAG_RESOLVE_FAILED",B),X.options)??H,V=DB.isNode(U)?U:new OB.Scalar(U);if(V.range=H.range,V.tag=z,W?.format)V.format=W.format;return V}IB.composeCollection=FB});var x4=_((jB)=>{var k4=M$();function ZB($,X,J){let Q=X.offset,q=TB(X,$.options.strict,J);if(!q)return{value:"",type:null,comment:"",range:[Q,Q,Q]};let Y=q.mode===">"?k4.Scalar.BLOCK_FOLDED:k4.Scalar.BLOCK_LITERAL,z=X.source?SB(X.source):[],G=z.length;for(let M=z.length-1;M>=0;--M){let N=z[M][1];if(N===""||N==="\r")G=M;else break}if(G===0){let M=q.chomp==="+"&&z.length>0?`
96
96
  `.repeat(Math.max(1,z.length-1)):"",N=Q+q.length;if(X.source)N+=X.source.length;return{value:M,type:Y,comment:q.comment,range:[Q,N,N]}}let W=X.indent+q.indent,H=X.offset+q.length,U=0;for(let M=0;M<G;++M){let[N,L]=z[M];if(L===""||L==="\r"){if(q.indent===0&&N.length>W)W=N.length}else{if(N.length<W)J(H+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(q.indent===0)W=N.length;if(U=M,W===0&&!$.atRoot)J(H,"BAD_INDENT","Block scalar values in collections must be indented");break}H+=N.length+L.length+1}for(let M=z.length-1;M>=G;--M)if(z[M][0].length>W)G=M+1;let V="",B="",D=!1;for(let M=0;M<U;++M)V+=z[M][0].slice(W)+`
97
- `;for(let M=U;M<G;++M){let[N,L]=z[M];H+=N.length+L.length+1;let I=L[L.length-1]==="\r";if(I)L=L.slice(0,-1);if(L&&N.length<W){let y=`Block scalar lines must not be less indented than their ${q.indent?"explicit indentation indicator":"first line"}`;J(H-L.length-(I?2:1),"BAD_INDENT",y),N=""}if(Y===C4.Scalar.BLOCK_LITERAL)V+=B+N.slice(W)+L,B=`
97
+ `;for(let M=U;M<G;++M){let[N,L]=z[M];H+=N.length+L.length+1;let I=L[L.length-1]==="\r";if(I)L=L.slice(0,-1);if(L&&N.length<W){let y=`Block scalar lines must not be less indented than their ${q.indent?"explicit indentation indicator":"first line"}`;J(H-L.length-(I?2:1),"BAD_INDENT",y),N=""}if(Y===k4.Scalar.BLOCK_LITERAL)V+=B+N.slice(W)+L,B=`
98
98
  `;else if(N.length>W||L[0]==="\t"){if(B===" ")B=`
99
99
  `;else if(!D&&B===`
100
100
  `)B=`
@@ -107,75 +107,75 @@ ${H}
107
107
  `+z[M][0].slice(W);if(V[V.length-1]!==`
108
108
  `)V+=`
109
109
  `;break;default:V+=`
110
- `}let w=Q+q.length+X.source.length;return{value:V,type:Y,comment:q.comment,range:[Q,w,w]}}function _B({offset:$,props:X},J,Q){if(X[0].type!=="block-scalar-header")return Q(X[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:q}=X[0],Y=q[0],z=0,G="",W=-1;for(let B=1;B<q.length;++B){let D=q[B];if(!G&&(D==="-"||D==="+"))G=D;else{let w=Number(D);if(!z&&w)z=w;else if(W===-1)W=$+B}}if(W!==-1)Q(W,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${q}`);let H=!1,U="",V=q.length;for(let B=1;B<X.length;++B){let D=X[B];switch(D.type){case"space":H=!0;case"newline":V+=D.source.length;break;case"comment":if(J&&!H)Q(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=D.source.length,U=D.source.substring(1);break;case"error":Q(D,"UNEXPECTED_TOKEN",D.message),V+=D.source.length;break;default:{let w=`Unexpected token in block scalar header: ${D.type}`;Q(D,"UNEXPECTED_TOKEN",w);let M=D.source;if(M&&typeof M==="string")V+=M.length}}}return{mode:Y,indent:z,chomp:G,comment:U,length:V}}function FB($){let X=$.split(/\n( *)/),J=X[0],Q=J.match(/^( *)/),Y=[Q?.[1]?[Q[1],J.slice(Q[1].length)]:["",J]];for(let z=1;z<X.length;z+=2)Y.push([X[z],X[z+1]]);return Y}IB.resolveBlockScalar=AB});var f4=_((kB)=>{var b4=M$(),TB=j8();function ZB($,X,J){let{offset:Q,type:q,source:Y,end:z}=$,G,W,H=(B,D,w)=>J(Q+B,D,w);switch(q){case"scalar":G=b4.Scalar.PLAIN,W=SB(Y,H);break;case"single-quoted-scalar":G=b4.Scalar.QUOTE_SINGLE,W=jB(Y,H);break;case"double-quoted-scalar":G=b4.Scalar.QUOTE_DOUBLE,W=CB(Y,H);break;default:return J($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${q}`),{value:"",type:null,comment:"",range:[Q,Q+Y.length,Q+Y.length]}}let U=Q+Y.length,V=TB.resolveEnd(z,U,X,J);return{value:W,type:G,comment:V.comment,range:[Q,U,V.offset]}}function SB($,X){let J="";switch($[0]){case"\t":J="a tab character";break;case",":J="flow indicator character ,";break;case"%":J="directive indicator character %";break;case"|":case">":{J=`block scalar indicator ${$[0]}`;break}case"@":case"`":{J=`reserved character ${$[0]}`;break}}if(J)X(0,"BAD_SCALAR_START",`Plain value cannot start with ${J}`);return SQ($)}function jB($,X){if($[$.length-1]!=="'"||$.length===1)X($.length,"MISSING_CHAR","Missing closing 'quote");return SQ($.slice(1,-1)).replace(/''/g,"'")}function SQ($){let X,J;try{X=new RegExp(`(.*?)(?<![ ])[ ]*\r?
110
+ `}let w=Q+q.length+X.source.length;return{value:V,type:Y,comment:q.comment,range:[Q,w,w]}}function TB({offset:$,props:X},J,Q){if(X[0].type!=="block-scalar-header")return Q(X[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:q}=X[0],Y=q[0],z=0,G="",W=-1;for(let B=1;B<q.length;++B){let D=q[B];if(!G&&(D==="-"||D==="+"))G=D;else{let w=Number(D);if(!z&&w)z=w;else if(W===-1)W=$+B}}if(W!==-1)Q(W,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${q}`);let H=!1,U="",V=q.length;for(let B=1;B<X.length;++B){let D=X[B];switch(D.type){case"space":H=!0;case"newline":V+=D.source.length;break;case"comment":if(J&&!H)Q(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=D.source.length,U=D.source.substring(1);break;case"error":Q(D,"UNEXPECTED_TOKEN",D.message),V+=D.source.length;break;default:{let w=`Unexpected token in block scalar header: ${D.type}`;Q(D,"UNEXPECTED_TOKEN",w);let M=D.source;if(M&&typeof M==="string")V+=M.length}}}return{mode:Y,indent:z,chomp:G,comment:U,length:V}}function SB($){let X=$.split(/\n( *)/),J=X[0],Q=J.match(/^( *)/),Y=[Q?.[1]?[Q[1],J.slice(Q[1].length)]:["",J]];for(let z=1;z<X.length;z+=2)Y.push([X[z],X[z+1]]);return Y}jB.resolveBlockScalar=ZB});var g4=_((hB)=>{var y4=M$(),bB=C8();function PB($,X,J){let{offset:Q,type:q,source:Y,end:z}=$,G,W,H=(B,D,w)=>J(Q+B,D,w);switch(q){case"scalar":G=y4.Scalar.PLAIN,W=fB(Y,H);break;case"single-quoted-scalar":G=y4.Scalar.QUOTE_SINGLE,W=kB(Y,H);break;case"double-quoted-scalar":G=y4.Scalar.QUOTE_DOUBLE,W=xB(Y,H);break;default:return J($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${q}`),{value:"",type:null,comment:"",range:[Q,Q+Y.length,Q+Y.length]}}let U=Q+Y.length,V=bB.resolveEnd(z,U,X,J);return{value:W,type:G,comment:V.comment,range:[Q,U,V.offset]}}function fB($,X){let J="";switch($[0]){case"\t":J="a tab character";break;case",":J="flow indicator character ,";break;case"%":J="directive indicator character %";break;case"|":case">":{J=`block scalar indicator ${$[0]}`;break}case"@":case"`":{J=`reserved character ${$[0]}`;break}}if(J)X(0,"BAD_SCALAR_START",`Plain value cannot start with ${J}`);return bQ($)}function kB($,X){if($[$.length-1]!=="'"||$.length===1)X($.length,"MISSING_CHAR","Missing closing 'quote");return bQ($.slice(1,-1)).replace(/''/g,"'")}function bQ($){let X,J;try{X=new RegExp(`(.*?)(?<![ ])[ ]*\r?
111
111
  `,"sy"),J=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
112
112
  `,"sy")}catch{X=/(.*?)[ \t]*\r?\n/sy,J=/[ \t]*(.*?)[ \t]*\r?\n/sy}let Q=X.exec($);if(!Q)return $;let q=Q[1],Y=" ",z=X.lastIndex;J.lastIndex=z;while(Q=J.exec($)){if(Q[1]==="")if(Y===`
113
113
  `)q+=Y;else Y=`
114
- `;else q+=Y+Q[1],Y=" ";z=J.lastIndex}let G=/[ \t]*(.*)/sy;return G.lastIndex=z,Q=G.exec($),q+Y+(Q?.[1]??"")}function CB($,X){let J="";for(let Q=1;Q<$.length-1;++Q){let q=$[Q];if(q==="\r"&&$[Q+1]===`
114
+ `;else q+=Y+Q[1],Y=" ";z=J.lastIndex}let G=/[ \t]*(.*)/sy;return G.lastIndex=z,Q=G.exec($),q+Y+(Q?.[1]??"")}function xB($,X){let J="";for(let Q=1;Q<$.length-1;++Q){let q=$[Q];if(q==="\r"&&$[Q+1]===`
115
115
  `)continue;if(q===`
116
- `){let{fold:Y,offset:z}=PB($,Q);J+=Y,Q=z}else if(q==="\\"){let Y=$[++Q],z=bB[Y];if(z)J+=z;else if(Y===`
116
+ `){let{fold:Y,offset:z}=yB($,Q);J+=Y,Q=z}else if(q==="\\"){let Y=$[++Q],z=gB[Y];if(z)J+=z;else if(Y===`
117
117
  `){Y=$[Q+1];while(Y===" "||Y==="\t")Y=$[++Q+1]}else if(Y==="\r"&&$[Q+1]===`
118
- `){Y=$[++Q+1];while(Y===" "||Y==="\t")Y=$[++Q+1]}else if(Y==="x"||Y==="u"||Y==="U"){let G={x:2,u:4,U:8}[Y];J+=fB($,Q+1,G,X),Q+=G}else{let G=$.substr(Q-1,2);X(Q-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),J+=G}}else if(q===" "||q==="\t"){let Y=Q,z=$[Q+1];while(z===" "||z==="\t")z=$[++Q+1];if(z!==`
118
+ `){Y=$[++Q+1];while(Y===" "||Y==="\t")Y=$[++Q+1]}else if(Y==="x"||Y==="u"||Y==="U"){let G={x:2,u:4,U:8}[Y];J+=vB($,Q+1,G,X),Q+=G}else{let G=$.substr(Q-1,2);X(Q-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),J+=G}}else if(q===" "||q==="\t"){let Y=Q,z=$[Q+1];while(z===" "||z==="\t")z=$[++Q+1];if(z!==`
119
119
  `&&!(z==="\r"&&$[Q+2]===`
120
- `))J+=Q>Y?$.slice(Y,Q+1):q}else J+=q}if($[$.length-1]!=='"'||$.length===1)X($.length,"MISSING_CHAR",'Missing closing "quote');return J}function PB($,X){let J="",Q=$[X+1];while(Q===" "||Q==="\t"||Q===`
120
+ `))J+=Q>Y?$.slice(Y,Q+1):q}else J+=q}if($[$.length-1]!=='"'||$.length===1)X($.length,"MISSING_CHAR",'Missing closing "quote');return J}function yB($,X){let J="",Q=$[X+1];while(Q===" "||Q==="\t"||Q===`
121
121
  `||Q==="\r"){if(Q==="\r"&&$[X+2]!==`
122
122
  `)break;if(Q===`
123
123
  `)J+=`
124
- `;X+=1,Q=$[X+1]}if(!J)J=" ";return{fold:J,offset:X}}var bB={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
125
- `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function fB($,X,J,Q){let q=$.substr(X,J),z=q.length===J&&/^[0-9a-fA-F]+$/.test(q)?parseInt(q,16):NaN;if(isNaN(z)){let G=$.substr(X-2,J+2);return Q(X-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),G}return String.fromCodePoint(z)}kB.resolveFlowScalar=ZB});var CQ=_((mB)=>{var e0=n(),jQ=M$(),yB=P4(),gB=f4();function vB($,X,J,Q){let{value:q,type:Y,comment:z,range:G}=X.type==="block-scalar"?yB.resolveBlockScalar($,X,Q):gB.resolveFlowScalar(X,$.options.strict,Q),W=J?$.directives.tagName(J.source,(V)=>Q(J,"TAG_RESOLVE_FAILED",V)):null,H;if($.options.stringKeys&&$.atKey)H=$.schema[e0.SCALAR];else if(W)H=hB($.schema,q,W,J,Q);else if(X.type==="scalar")H=uB($,q,X,Q);else H=$.schema[e0.SCALAR];let U;try{let V=H.resolve(q,(B)=>Q(J??X,"TAG_RESOLVE_FAILED",B),$.options);U=e0.isScalar(V)?V:new jQ.Scalar(V)}catch(V){let B=V instanceof Error?V.message:String(V);Q(J??X,"TAG_RESOLVE_FAILED",B),U=new jQ.Scalar(q)}if(U.range=G,U.source=q,Y)U.type=Y;if(W)U.tag=W;if(H.format)U.format=H.format;if(z)U.comment=z;return U}function hB($,X,J,Q,q){if(J==="!")return $[e0.SCALAR];let Y=[];for(let G of $.tags)if(!G.collection&&G.tag===J)if(G.default&&G.test)Y.push(G);else return G;for(let G of Y)if(G.test?.test(X))return G;let z=$.knownTags[J];if(z&&!z.collection)return $.tags.push(Object.assign({},z,{default:!1,test:void 0})),z;return q(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${J}`,J!=="tag:yaml.org,2002:str"),$[e0.SCALAR]}function uB({atKey:$,directives:X,schema:J},Q,q,Y){let z=J.tags.find((G)=>(G.default===!0||$&&G.default==="key")&&G.test?.test(Q))||J[e0.SCALAR];if(J.compat){let G=J.compat.find((W)=>W.default&&W.test?.test(Q))??J[e0.SCALAR];if(z.tag!==G.tag){let W=X.tagString(z.tag),H=X.tagString(G.tag),U=`Value may be parsed as either ${W} or ${H}`;Y(q,"TAG_RESOLVE_FAILED",U,!0)}}return z}mB.composeScalar=vB});var PQ=_((pB)=>{function cB($,X,J){if(X){J??(J=X.length);for(let Q=J-1;Q>=0;--Q){let q=X[Q];switch(q.type){case"space":case"comment":case"newline":$-=q.source.length;continue}q=X[++Q];while(q?.type==="space")$+=q.source.length,q=X[++Q];break}}return $}pB.emptyScalarPosition=cB});var kQ=_((eB)=>{var iB=_6(),nB=n(),rB=ZQ(),bQ=CQ(),sB=j8(),aB=PQ(),oB={composeNode:fQ,composeEmptyNode:k4};function fQ($,X,J,Q){let q=$.atKey,{spaceBefore:Y,comment:z,anchor:G,tag:W}=J,H,U=!0;switch(X.type){case"alias":if(H=tB($,X,Q),G||W)Q(X,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(H=bQ.composeScalar($,X,W,Q),G)H.anchor=G.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(H=rB.composeCollection(oB,$,X,J,Q),G)H.anchor=G.source.substring(1)}catch(V){let B=V instanceof Error?V.message:String(V);Q(X,"RESOURCE_EXHAUSTION",B)}break;default:{let V=X.type==="error"?X.message:`Unsupported token (type: ${X.type})`;Q(X,"UNEXPECTED_TOKEN",V),U=!1}}if(H??(H=k4($,X.offset,void 0,null,J,Q)),G&&H.anchor==="")Q(G,"BAD_ALIAS","Anchor cannot be an empty string");if(q&&$.options.stringKeys&&(!nB.isScalar(H)||typeof H.value!=="string"||H.tag&&H.tag!=="tag:yaml.org,2002:str"))Q(W??X,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Y)H.spaceBefore=!0;if(z)if(X.type==="scalar"&&X.source==="")H.comment=z;else H.commentBefore=z;if($.options.keepSourceTokens&&U)H.srcToken=X;return H}function k4($,X,J,Q,{spaceBefore:q,comment:Y,anchor:z,tag:G,end:W},H){let U={type:"scalar",offset:aB.emptyScalarPosition(X,J,Q),indent:-1,source:""},V=bQ.composeScalar($,U,G,H);if(z){if(V.anchor=z.source.substring(1),V.anchor==="")H(z,"BAD_ALIAS","Anchor cannot be an empty string")}if(q)V.spaceBefore=!0;if(Y)V.comment=Y,V.range[2]=W;return V}function tB({options:$},{offset:X,source:J,end:Q},q){let Y=new iB.Alias(J.substring(1));if(Y.source==="")q(X,"BAD_ALIAS","Alias cannot be an empty string");if(Y.source.endsWith(":"))q(X+J.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let z=X+J.length,G=sB.resolveEnd(Q,z,$.strict,q);if(Y.range=[X,z,G.offset],G.comment)Y.comment=G.comment;return Y}eB.composeEmptyNode=k4;eB.composeNode=fQ});var yQ=_((zK)=>{var JK=g6(),xQ=kQ(),QK=j8(),qK=h6();function YK($,X,{offset:J,start:Q,value:q,end:Y},z){let G=Object.assign({_directives:X},$),W=new JK.Document(void 0,G),H={atKey:!1,atRoot:!0,directives:W.directives,options:W.options,schema:W.schema},U=qK.resolveProps(Q,{indicator:"doc-start",next:q??Y?.[0],offset:J,onError:z,parentIndent:0,startOnNewline:!0});if(U.found){if(W.directives.docStart=!0,q&&(q.type==="block-map"||q.type==="block-seq")&&!U.hasNewline)z(U.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}W.contents=q?xQ.composeNode(H,q,U,z):xQ.composeEmptyNode(H,U.end,Q,null,U,z);let V=W.contents.range[2],B=QK.resolveEnd(Y,V,!1,z);if(B.comment)W.comment=B.comment;return W.range=[J,V,B.offset],W}zK.composeDoc=YK});var x4=_((KK)=>{var WK=W$("process"),HK=hX(),UK=g6(),u6=v6(),gQ=n(),VK=yQ(),BK=j8();function m6($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:X,source:J}=$;return[X,X+(typeof J==="string"?J.length:1)]}function vQ($){let X="",J=!1,Q=!1;for(let q=0;q<$.length;++q){let Y=$[q];switch(Y[0]){case"#":X+=(X===""?"":Q?`
124
+ `;X+=1,Q=$[X+1]}if(!J)J=" ";return{fold:J,offset:X}}var gB={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
125
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function vB($,X,J,Q){let q=$.substr(X,J),z=q.length===J&&/^[0-9a-fA-F]+$/.test(q)?parseInt(q,16):NaN;if(isNaN(z)){let G=$.substr(X-2,J+2);return Q(X-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${G}`),G}return String.fromCodePoint(z)}hB.resolveFlowScalar=PB});var fQ=_((iB)=>{var $8=n(),PQ=M$(),mB=x4(),lB=g4();function cB($,X,J,Q){let{value:q,type:Y,comment:z,range:G}=X.type==="block-scalar"?mB.resolveBlockScalar($,X,Q):lB.resolveFlowScalar(X,$.options.strict,Q),W=J?$.directives.tagName(J.source,(V)=>Q(J,"TAG_RESOLVE_FAILED",V)):null,H;if($.options.stringKeys&&$.atKey)H=$.schema[$8.SCALAR];else if(W)H=pB($.schema,q,W,J,Q);else if(X.type==="scalar")H=dB($,q,X,Q);else H=$.schema[$8.SCALAR];let U;try{let V=H.resolve(q,(B)=>Q(J??X,"TAG_RESOLVE_FAILED",B),$.options);U=$8.isScalar(V)?V:new PQ.Scalar(V)}catch(V){let B=V instanceof Error?V.message:String(V);Q(J??X,"TAG_RESOLVE_FAILED",B),U=new PQ.Scalar(q)}if(U.range=G,U.source=q,Y)U.type=Y;if(W)U.tag=W;if(H.format)U.format=H.format;if(z)U.comment=z;return U}function pB($,X,J,Q,q){if(J==="!")return $[$8.SCALAR];let Y=[];for(let G of $.tags)if(!G.collection&&G.tag===J)if(G.default&&G.test)Y.push(G);else return G;for(let G of Y)if(G.test?.test(X))return G;let z=$.knownTags[J];if(z&&!z.collection)return $.tags.push(Object.assign({},z,{default:!1,test:void 0})),z;return q(Q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${J}`,J!=="tag:yaml.org,2002:str"),$[$8.SCALAR]}function dB({atKey:$,directives:X,schema:J},Q,q,Y){let z=J.tags.find((G)=>(G.default===!0||$&&G.default==="key")&&G.test?.test(Q))||J[$8.SCALAR];if(J.compat){let G=J.compat.find((W)=>W.default&&W.test?.test(Q))??J[$8.SCALAR];if(z.tag!==G.tag){let W=X.tagString(z.tag),H=X.tagString(G.tag),U=`Value may be parsed as either ${W} or ${H}`;Y(q,"TAG_RESOLVE_FAILED",U,!0)}}return z}iB.composeScalar=cB});var kQ=_((sB)=>{function rB($,X,J){if(X){J??(J=X.length);for(let Q=J-1;Q>=0;--Q){let q=X[Q];switch(q.type){case"space":case"comment":case"newline":$-=q.source.length;continue}q=X[++Q];while(q?.type==="space")$+=q.source.length,q=X[++Q];break}}return $}sB.emptyScalarPosition=rB});var gQ=_((qK)=>{var oB=I6(),tB=n(),eB=CQ(),xQ=fQ(),$K=C8(),XK=kQ(),JK={composeNode:yQ,composeEmptyNode:v4};function yQ($,X,J,Q){let q=$.atKey,{spaceBefore:Y,comment:z,anchor:G,tag:W}=J,H,U=!0;switch(X.type){case"alias":if(H=QK($,X,Q),G||W)Q(X,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(H=xQ.composeScalar($,X,W,Q),G)H.anchor=G.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(H=eB.composeCollection(JK,$,X,J,Q),G)H.anchor=G.source.substring(1)}catch(V){let B=V instanceof Error?V.message:String(V);Q(X,"RESOURCE_EXHAUSTION",B)}break;default:{let V=X.type==="error"?X.message:`Unsupported token (type: ${X.type})`;Q(X,"UNEXPECTED_TOKEN",V),U=!1}}if(H??(H=v4($,X.offset,void 0,null,J,Q)),G&&H.anchor==="")Q(G,"BAD_ALIAS","Anchor cannot be an empty string");if(q&&$.options.stringKeys&&(!tB.isScalar(H)||typeof H.value!=="string"||H.tag&&H.tag!=="tag:yaml.org,2002:str"))Q(W??X,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(Y)H.spaceBefore=!0;if(z)if(X.type==="scalar"&&X.source==="")H.comment=z;else H.commentBefore=z;if($.options.keepSourceTokens&&U)H.srcToken=X;return H}function v4($,X,J,Q,{spaceBefore:q,comment:Y,anchor:z,tag:G,end:W},H){let U={type:"scalar",offset:XK.emptyScalarPosition(X,J,Q),indent:-1,source:""},V=xQ.composeScalar($,U,G,H);if(z){if(V.anchor=z.source.substring(1),V.anchor==="")H(z,"BAD_ALIAS","Anchor cannot be an empty string")}if(q)V.spaceBefore=!0;if(Y)V.comment=Y,V.range[2]=W;return V}function QK({options:$},{offset:X,source:J,end:Q},q){let Y=new oB.Alias(J.substring(1));if(Y.source==="")q(X,"BAD_ALIAS","Alias cannot be an empty string");if(Y.source.endsWith(":"))q(X+J.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let z=X+J.length,G=$K.resolveEnd(Q,z,$.strict,q);if(Y.range=[X,z,G.offset],G.comment)Y.comment=G.comment;return Y}qK.composeEmptyNode=v4;qK.composeNode=yQ});var hQ=_((VK)=>{var GK=h6(),vQ=gQ(),WK=C8(),HK=m6();function UK($,X,{offset:J,start:Q,value:q,end:Y},z){let G=Object.assign({_directives:X},$),W=new GK.Document(void 0,G),H={atKey:!1,atRoot:!0,directives:W.directives,options:W.options,schema:W.schema},U=HK.resolveProps(Q,{indicator:"doc-start",next:q??Y?.[0],offset:J,onError:z,parentIndent:0,startOnNewline:!0});if(U.found){if(W.directives.docStart=!0,q&&(q.type==="block-map"||q.type==="block-seq")&&!U.hasNewline)z(U.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}W.contents=q?vQ.composeNode(H,q,U,z):vQ.composeEmptyNode(H,U.end,Q,null,U,z);let V=W.contents.range[2],B=WK.resolveEnd(Y,V,!1,z);if(B.comment)W.comment=B.comment;return W.range=[J,V,B.offset],W}VK.composeDoc=UK});var h4=_((wK)=>{var KK=U$("process"),MK=cX(),NK=h6(),l6=u6(),uQ=n(),DK=hQ(),OK=C8();function c6($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:X,source:J}=$;return[X,X+(typeof J==="string"?J.length:1)]}function mQ($){let X="",J=!1,Q=!1;for(let q=0;q<$.length;++q){let Y=$[q];switch(Y[0]){case"#":X+=(X===""?"":Q?`
126
126
 
127
127
  `:`
128
- `)+(Y.substring(1)||" "),J=!0,Q=!1;break;case"%":if($[q+1]?.[0]!=="#")q+=1;J=!1;break;default:if(!J)Q=!0;J=!1}}return{comment:X,afterEmptyLine:Q}}class hQ{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(X,J,Q,q)=>{let Y=m6(X);if(q)this.warnings.push(new u6.YAMLWarning(Y,J,Q));else this.errors.push(new u6.YAMLParseError(Y,J,Q))},this.directives=new HK.Directives({version:$.version||"1.2"}),this.options=$}decorate($,X){let{comment:J,afterEmptyLine:Q}=vQ(this.prelude);if(J){let q=$.contents;if(X)$.comment=$.comment?`${$.comment}
129
- ${J}`:J;else if(Q||$.directives.docStart||!q)$.commentBefore=J;else if(gQ.isCollection(q)&&!q.flow&&q.items.length>0){let Y=q.items[0];if(gQ.isPair(Y))Y=Y.key;let z=Y.commentBefore;Y.commentBefore=z?`${J}
128
+ `)+(Y.substring(1)||" "),J=!0,Q=!1;break;case"%":if($[q+1]?.[0]!=="#")q+=1;J=!1;break;default:if(!J)Q=!0;J=!1}}return{comment:X,afterEmptyLine:Q}}class lQ{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(X,J,Q,q)=>{let Y=c6(X);if(q)this.warnings.push(new l6.YAMLWarning(Y,J,Q));else this.errors.push(new l6.YAMLParseError(Y,J,Q))},this.directives=new MK.Directives({version:$.version||"1.2"}),this.options=$}decorate($,X){let{comment:J,afterEmptyLine:Q}=mQ(this.prelude);if(J){let q=$.contents;if(X)$.comment=$.comment?`${$.comment}
129
+ ${J}`:J;else if(Q||$.directives.docStart||!q)$.commentBefore=J;else if(uQ.isCollection(q)&&!q.flow&&q.items.length>0){let Y=q.items[0];if(uQ.isPair(Y))Y=Y.key;let z=Y.commentBefore;Y.commentBefore=z?`${J}
130
130
  ${z}`:J}else{let Y=q.commentBefore;q.commentBefore=Y?`${J}
131
- ${Y}`:J}}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:vQ(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,X=!1,J=-1){for(let Q of $)yield*this.next(Q);yield*this.end(X,J)}*next($){if(WK.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(X,J,Q)=>{let q=m6($);q[0]+=X,this.onError(q,"BAD_DIRECTIVE",J,Q)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let X=VK.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,J=new u6.YAMLParseError(m6($),"UNEXPECTED_TOKEN",X);if(this.atDirectives||!this.doc)this.errors.push(J);else this.doc.errors.push(J);break}case"doc-end":{if(!this.doc){this.errors.push(new u6.YAMLParseError(m6($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let X=BK.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),X.comment){let J=this.doc.comment;this.doc.comment=J?`${J}
132
- ${X.comment}`:X.comment}this.doc.range[2]=X.offset;break}default:this.errors.push(new u6.YAMLParseError(m6($),"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 J=Object.assign({_directives:this.directives},this.options),Q=new UK.Document(void 0,J);if(this.atDirectives)this.onError(X,"MISSING_CHAR","Missing directives-end indicator line");Q.range=[0,X,X],this.decorate(Q,!1),yield Q}}}KK.Composer=hQ});var lQ=_((_K)=>{var NK=P4(),DK=f4(),OK=v6(),uQ=T6();function wK($,X=!0,J){if($){let Q=(q,Y,z)=>{let G=typeof q==="number"?q:Array.isArray(q)?q[0]:q.offset;if(J)J(G,Y,z);else throw new OK.YAMLParseError([G,G+1],Y,z)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return DK.resolveFlowScalar($,X,Q);case"block-scalar":return NK.resolveBlockScalar({options:{strict:X}},$,Q)}}return null}function LK($,X){let{implicitKey:J=!1,indent:Q,inFlow:q=!1,offset:Y=-1,type:z="PLAIN"}=X,G=uQ.stringifyString({type:z,value:$},{implicitKey:J,indent:Q>0?" ".repeat(Q):"",inFlow:q,options:{blockQuote:!0,lineWidth:-1}}),W=X.end??[{type:"newline",offset:-1,indent:Q,source:`
131
+ ${Y}`:J}}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:mQ(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,X=!1,J=-1){for(let Q of $)yield*this.next(Q);yield*this.end(X,J)}*next($){if(KK.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(X,J,Q)=>{let q=c6($);q[0]+=X,this.onError(q,"BAD_DIRECTIVE",J,Q)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let X=DK.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,J=new l6.YAMLParseError(c6($),"UNEXPECTED_TOKEN",X);if(this.atDirectives||!this.doc)this.errors.push(J);else this.doc.errors.push(J);break}case"doc-end":{if(!this.doc){this.errors.push(new l6.YAMLParseError(c6($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let X=OK.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),X.comment){let J=this.doc.comment;this.doc.comment=J?`${J}
132
+ ${X.comment}`:X.comment}this.doc.range[2]=X.offset;break}default:this.errors.push(new l6.YAMLParseError(c6($),"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 J=Object.assign({_directives:this.directives},this.options),Q=new NK.Document(void 0,J);if(this.atDirectives)this.onError(X,"MISSING_CHAR","Missing directives-end indicator line");Q.range=[0,X,X],this.decorate(Q,!1),yield Q}}}wK.Composer=lQ});var dQ=_((TK)=>{var RK=x4(),AK=g4(),_K=u6(),cQ=S6();function FK($,X=!0,J){if($){let Q=(q,Y,z)=>{let G=typeof q==="number"?q:Array.isArray(q)?q[0]:q.offset;if(J)J(G,Y,z);else throw new _K.YAMLParseError([G,G+1],Y,z)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return AK.resolveFlowScalar($,X,Q);case"block-scalar":return RK.resolveBlockScalar({options:{strict:X}},$,Q)}}return null}function IK($,X){let{implicitKey:J=!1,indent:Q,inFlow:q=!1,offset:Y=-1,type:z="PLAIN"}=X,G=cQ.stringifyString({type:z,value:$},{implicitKey:J,indent:Q>0?" ".repeat(Q):"",inFlow:q,options:{blockQuote:!0,lineWidth:-1}}),W=X.end??[{type:"newline",offset:-1,indent:Q,source:`
133
133
  `}];switch(G[0]){case"|":case">":{let H=G.indexOf(`
134
134
  `),U=G.substring(0,H),V=G.substring(H+1)+`
135
- `,B=[{type:"block-scalar-header",offset:Y,indent:Q,source:U}];if(!mQ(B,W))B.push({type:"newline",offset:-1,indent:Q,source:`
136
- `});return{type:"block-scalar",offset:Y,indent:Q,props:B,source:V}}case'"':return{type:"double-quoted-scalar",offset:Y,indent:Q,source:G,end:W};case"'":return{type:"single-quoted-scalar",offset:Y,indent:Q,source:G,end:W};default:return{type:"scalar",offset:Y,indent:Q,source:G,end:W}}}function RK($,X,J={}){let{afterKey:Q=!1,implicitKey:q=!1,inFlow:Y=!1,type:z}=J,G="indent"in $?$.indent:null;if(Q&&typeof G==="number")G+=2;if(!z)switch($.type){case"single-quoted-scalar":z="QUOTE_SINGLE";break;case"double-quoted-scalar":z="QUOTE_DOUBLE";break;case"block-scalar":{let H=$.props[0];if(H.type!=="block-scalar-header")throw Error("Invalid block scalar header");z=H.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:z="PLAIN"}let W=uQ.stringifyString({type:z,value:X},{implicitKey:q||G===null,indent:G!==null&&G>0?" ".repeat(G):"",inFlow:Y,options:{blockQuote:!0,lineWidth:-1}});switch(W[0]){case"|":case">":AK($,W);break;case'"':y4($,W,"double-quoted-scalar");break;case"'":y4($,W,"single-quoted-scalar");break;default:y4($,W,"scalar")}}function AK($,X){let J=X.indexOf(`
135
+ `,B=[{type:"block-scalar-header",offset:Y,indent:Q,source:U}];if(!pQ(B,W))B.push({type:"newline",offset:-1,indent:Q,source:`
136
+ `});return{type:"block-scalar",offset:Y,indent:Q,props:B,source:V}}case'"':return{type:"double-quoted-scalar",offset:Y,indent:Q,source:G,end:W};case"'":return{type:"single-quoted-scalar",offset:Y,indent:Q,source:G,end:W};default:return{type:"scalar",offset:Y,indent:Q,source:G,end:W}}}function EK($,X,J={}){let{afterKey:Q=!1,implicitKey:q=!1,inFlow:Y=!1,type:z}=J,G="indent"in $?$.indent:null;if(Q&&typeof G==="number")G+=2;if(!z)switch($.type){case"single-quoted-scalar":z="QUOTE_SINGLE";break;case"double-quoted-scalar":z="QUOTE_DOUBLE";break;case"block-scalar":{let H=$.props[0];if(H.type!=="block-scalar-header")throw Error("Invalid block scalar header");z=H.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:z="PLAIN"}let W=cQ.stringifyString({type:z,value:X},{implicitKey:q||G===null,indent:G!==null&&G>0?" ".repeat(G):"",inFlow:Y,options:{blockQuote:!0,lineWidth:-1}});switch(W[0]){case"|":case">":ZK($,W);break;case'"':u4($,W,"double-quoted-scalar");break;case"'":u4($,W,"single-quoted-scalar");break;default:u4($,W,"scalar")}}function ZK($,X){let J=X.indexOf(`
137
137
  `),Q=X.substring(0,J),q=X.substring(J+1)+`
138
- `;if($.type==="block-scalar"){let Y=$.props[0];if(Y.type!=="block-scalar-header")throw Error("Invalid block scalar header");Y.source=Q,$.source=q}else{let{offset:Y}=$,z="indent"in $?$.indent:-1,G=[{type:"block-scalar-header",offset:Y,indent:z,source:Q}];if(!mQ(G,"end"in $?$.end:void 0))G.push({type:"newline",offset:-1,indent:z,source:`
139
- `});for(let W of Object.keys($))if(W!=="type"&&W!=="offset")delete $[W];Object.assign($,{type:"block-scalar",indent:z,props:G,source:q})}}function mQ($,X){if(X)for(let J of X)switch(J.type){case"space":case"comment":$.push(J);break;case"newline":return $.push(J),!0}return!1}function y4($,X,J){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=J,$.source=X;break;case"block-scalar":{let Q=$.props.slice(1),q=X.length;if($.props[0].type==="block-scalar-header")q-=$.props[0].source.length;for(let Y of Q)Y.offset+=q;delete $.props,Object.assign($,{type:J,source:X,end:Q});break}case"block-map":case"block-seq":{let q={type:"newline",offset:$.offset+X.length,indent:$.indent,source:`
140
- `};delete $.items,Object.assign($,{type:J,source:X,end:[q]});break}default:{let Q="indent"in $?$.indent:-1,q="end"in $&&Array.isArray($.end)?$.end.filter((Y)=>Y.type==="space"||Y.type==="comment"||Y.type==="newline"):[];for(let Y of Object.keys($))if(Y!=="type"&&Y!=="offset")delete $[Y];Object.assign($,{type:J,indent:Q,source:X,end:q})}}}_K.createScalarToken=LK;_K.resolveAsScalar=wK;_K.setScalarValue=RK});var cQ=_((ZK)=>{var TK=($)=>("type"in $)?S5($):Z5($);function S5($){switch($.type){case"block-scalar":{let X="";for(let J of $.props)X+=S5(J);return X+$.source}case"block-map":case"block-seq":{let X="";for(let J of $.items)X+=Z5(J);return X}case"flow-collection":{let X=$.start.source;for(let J of $.items)X+=Z5(J);for(let J of $.end)X+=J.source;return X}case"document":{let X=Z5($);if($.end)for(let J of $.end)X+=J.source;return X}default:{let X=$.source;if("end"in $&&$.end)for(let J of $.end)X+=J.source;return X}}}function Z5({start:$,key:X,sep:J,value:Q}){let q="";for(let Y of $)q+=Y.source;if(X)q+=S5(X);if(J)for(let Y of J)q+=Y.source;if(Q)q+=S5(Q);return q}ZK.stringify=TK});var iQ=_((CK)=>{var g4=Symbol("break visit"),jK=Symbol("skip children"),pQ=Symbol("remove item");function $8($,X){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};dQ(Object.freeze([]),$,X)}$8.BREAK=g4;$8.SKIP=jK;$8.REMOVE=pQ;$8.itemAtPath=($,X)=>{let J=$;for(let[Q,q]of X){let Y=J?.[Q];if(Y&&"items"in Y)J=Y.items[q];else return}return J};$8.parentCollection=($,X)=>{let J=$8.itemAtPath($,X.slice(0,-1)),Q=X[X.length-1][0],q=J?.[Q];if(q&&"items"in q)return q;throw Error("Parent collection not found")};function dQ($,X,J){let Q=J(X,$);if(typeof Q==="symbol")return Q;for(let q of["key","value"]){let Y=X[q];if(Y&&"items"in Y){for(let z=0;z<Y.items.length;++z){let G=dQ(Object.freeze($.concat([[q,z]])),Y.items[z],J);if(typeof G==="number")z=G-1;else if(G===g4)return g4;else if(G===pQ)Y.items.splice(z,1),z-=1}if(typeof Q==="function"&&q==="key")Q=Q(X,$)}}return typeof Q==="function"?Q(X,$):Q}CK.visit=$8});var j5=_((vK)=>{var v4=lQ(),bK=cQ(),fK=iQ(),h4="\uFEFF",u4="\x02",m4="\x18",l4="\x1F",kK=($)=>!!$&&("items"in $),xK=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function yK($){switch($){case h4:return"<BOM>";case u4:return"<DOC>";case m4:return"<FLOW_END>";case l4:return"<SCALAR>";default:return JSON.stringify($)}}function gK($){switch($){case h4:return"byte-order-mark";case u4:return"doc-mode";case m4:return"flow-error-end";case l4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
138
+ `;if($.type==="block-scalar"){let Y=$.props[0];if(Y.type!=="block-scalar-header")throw Error("Invalid block scalar header");Y.source=Q,$.source=q}else{let{offset:Y}=$,z="indent"in $?$.indent:-1,G=[{type:"block-scalar-header",offset:Y,indent:z,source:Q}];if(!pQ(G,"end"in $?$.end:void 0))G.push({type:"newline",offset:-1,indent:z,source:`
139
+ `});for(let W of Object.keys($))if(W!=="type"&&W!=="offset")delete $[W];Object.assign($,{type:"block-scalar",indent:z,props:G,source:q})}}function pQ($,X){if(X)for(let J of X)switch(J.type){case"space":case"comment":$.push(J);break;case"newline":return $.push(J),!0}return!1}function u4($,X,J){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=J,$.source=X;break;case"block-scalar":{let Q=$.props.slice(1),q=X.length;if($.props[0].type==="block-scalar-header")q-=$.props[0].source.length;for(let Y of Q)Y.offset+=q;delete $.props,Object.assign($,{type:J,source:X,end:Q});break}case"block-map":case"block-seq":{let q={type:"newline",offset:$.offset+X.length,indent:$.indent,source:`
140
+ `};delete $.items,Object.assign($,{type:J,source:X,end:[q]});break}default:{let Q="indent"in $?$.indent:-1,q="end"in $&&Array.isArray($.end)?$.end.filter((Y)=>Y.type==="space"||Y.type==="comment"||Y.type==="newline"):[];for(let Y of Object.keys($))if(Y!=="type"&&Y!=="offset")delete $[Y];Object.assign($,{type:J,indent:Q,source:X,end:q})}}}TK.createScalarToken=IK;TK.resolveAsScalar=FK;TK.setScalarValue=EK});var iQ=_((PK)=>{var bK=($)=>("type"in $)?P5($):b5($);function P5($){switch($.type){case"block-scalar":{let X="";for(let J of $.props)X+=P5(J);return X+$.source}case"block-map":case"block-seq":{let X="";for(let J of $.items)X+=b5(J);return X}case"flow-collection":{let X=$.start.source;for(let J of $.items)X+=b5(J);for(let J of $.end)X+=J.source;return X}case"document":{let X=b5($);if($.end)for(let J of $.end)X+=J.source;return X}default:{let X=$.source;if("end"in $&&$.end)for(let J of $.end)X+=J.source;return X}}}function b5({start:$,key:X,sep:J,value:Q}){let q="";for(let Y of $)q+=Y.source;if(X)q+=P5(X);if(J)for(let Y of J)q+=Y.source;if(Q)q+=P5(Q);return q}PK.stringify=bK});var sQ=_((xK)=>{var m4=Symbol("break visit"),kK=Symbol("skip children"),nQ=Symbol("remove item");function X8($,X){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};rQ(Object.freeze([]),$,X)}X8.BREAK=m4;X8.SKIP=kK;X8.REMOVE=nQ;X8.itemAtPath=($,X)=>{let J=$;for(let[Q,q]of X){let Y=J?.[Q];if(Y&&"items"in Y)J=Y.items[q];else return}return J};X8.parentCollection=($,X)=>{let J=X8.itemAtPath($,X.slice(0,-1)),Q=X[X.length-1][0],q=J?.[Q];if(q&&"items"in q)return q;throw Error("Parent collection not found")};function rQ($,X,J){let Q=J(X,$);if(typeof Q==="symbol")return Q;for(let q of["key","value"]){let Y=X[q];if(Y&&"items"in Y){for(let z=0;z<Y.items.length;++z){let G=rQ(Object.freeze($.concat([[q,z]])),Y.items[z],J);if(typeof G==="number")z=G-1;else if(G===m4)return m4;else if(G===nQ)Y.items.splice(z,1),z-=1}if(typeof Q==="function"&&q==="key")Q=Q(X,$)}}return typeof Q==="function"?Q(X,$):Q}xK.visit=X8});var f5=_((cK)=>{var l4=dQ(),gK=iQ(),vK=sQ(),c4="\uFEFF",p4="\x02",d4="\x18",i4="\x1F",hK=($)=>!!$&&("items"in $),uK=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function mK($){switch($){case c4:return"<BOM>";case p4:return"<DOC>";case d4:return"<FLOW_END>";case i4:return"<SCALAR>";default:return JSON.stringify($)}}function lK($){switch($){case c4:return"byte-order-mark";case p4:return"doc-mode";case d4:return"flow-error-end";case i4:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
141
141
  `:case`\r
142
- `: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}vK.createScalarToken=v4.createScalarToken;vK.resolveAsScalar=v4.resolveAsScalar;vK.setScalarValue=v4.setScalarValue;vK.stringify=bK.stringify;vK.visit=fK.visit;vK.BOM=h4;vK.DOCUMENT=u4;vK.FLOW_END=m4;vK.SCALAR=l4;vK.isCollection=kK;vK.isScalar=xK;vK.prettyToken=yK;vK.tokenType=gK});var p4=_(($M)=>{var l6=j5();function m$($){switch($){case void 0:case" ":case`
143
- `:case"\r":case"\t":return!0;default:return!1}}var nQ=new Set("0123456789ABCDEFabcdef"),tK=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),C5=new Set(",[]{}"),eK=new Set(` ,[]{}
144
- \r `),c4=($)=>!$||eK.has($);class rQ{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 J=this.next??"stream";while(J&&(X||this.hasChars(1)))J=yield*this.parseNext(J)}atLineEnd(){let $=this.pos,X=this.buffer[$];while(X===" "||X==="\t")X=this.buffer[++$];if(!X||X==="#"||X===`
142
+ `: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}cK.createScalarToken=l4.createScalarToken;cK.resolveAsScalar=l4.resolveAsScalar;cK.setScalarValue=l4.setScalarValue;cK.stringify=gK.stringify;cK.visit=vK.visit;cK.BOM=c4;cK.DOCUMENT=p4;cK.FLOW_END=d4;cK.SCALAR=i4;cK.isCollection=hK;cK.isScalar=uK;cK.prettyToken=mK;cK.tokenType=lK});var r4=_((YM)=>{var p6=f5();function m$($){switch($){case void 0:case" ":case`
143
+ `:case"\r":case"\t":return!0;default:return!1}}var aQ=new Set("0123456789ABCDEFabcdef"),QM=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),k5=new Set(",[]{}"),qM=new Set(` ,[]{}
144
+ \r `),n4=($)=>!$||qM.has($);class oQ{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 J=this.next??"stream";while(J&&(X||this.hasChars(1)))J=yield*this.parseNext(J)}atLineEnd(){let $=this.pos,X=this.buffer[$];while(X===" "||X==="\t")X=this.buffer[++$];if(!X||X==="#"||X===`
145
145
  `)return!0;if(X==="\r")return this.buffer[$+1]===`
146
146
  `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let X=this.buffer[$];if(this.indentNext>0){let J=0;while(X===" ")X=this.buffer[++J+$];if(X==="\r"){let Q=this.buffer[J+$+1];if(Q===`
147
147
  `||!Q&&!this.atEnd)return $+J+1}return X===`
148
148
  `||J>=this.indentNext||!X&&!this.atEnd?$+J:-1}if(X==="-"||X==="."){let J=this.buffer.substr($,3);if((J==="---"||J==="...")&&m$(this.buffer[$+3]))return-1}return $}getLine(){let $=this.lineEndPos;if(typeof $!=="number"||$!==-1&&$<this.pos)$=this.buffer.indexOf(`
149
- `,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]===l6.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let X=$.length,J=$.indexOf("#");while(J!==-1){let q=$[J-1];if(q===" "||q==="\t"){X=J-1;break}else J=$.indexOf("#",J+1)}while(!0){let q=$[X-1];if(q===" "||q==="\t")X-=1;else break}let Q=(yield*this.pushCount(X))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-Q),this.pushNewline(),"stream"}if(this.atLineEnd()){let X=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-X),yield*this.pushNewline(),"stream"}return yield l6.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==="...")&&m$(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&&!m$(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(($==="-"||$==="?"||$===":")&&m$(X)){let J=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=J,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(c4),"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,J=-1;do{if($=yield*this.pushNewline(),$>0)X=yield*this.pushSpaces(!1),this.indentValue=J=X;else X=0;X+=yield*this.pushSpaces(!0)}while($+X>0);let Q=this.getLine();if(Q===null)return this.setNext("flow");if(J!==-1&&J<this.indentNext&&Q[0]!=="#"||J===0&&(Q.startsWith("---")||Q.startsWith("..."))&&m$(Q[3])){if(!(J===this.indentNext-1&&this.flowLevel===1&&(Q[0]==="]"||Q[0]==="}")))return this.flowLevel=0,yield l6.FLOW_END,yield*this.parseLineStart()}let q=0;while(Q[q]===",")q+=yield*this.pushCount(1),q+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(q+=yield*this.pushIndicators(),Q[q]){case void 0:return"flow";case"#":return yield*this.pushCount(Q.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(c4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Y=this.charAt(1);if(this.flowKey||m$(Y)||Y===",")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 J=this.buffer.substring(0,X),Q=J.indexOf(`
149
+ `,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]===p6.BOM)yield*this.pushCount(1),$=$.substring(1);if($[0]==="%"){let X=$.length,J=$.indexOf("#");while(J!==-1){let q=$[J-1];if(q===" "||q==="\t"){X=J-1;break}else J=$.indexOf("#",J+1)}while(!0){let q=$[X-1];if(q===" "||q==="\t")X-=1;else break}let Q=(yield*this.pushCount(X))+(yield*this.pushSpaces(!0));return yield*this.pushCount($.length-Q),this.pushNewline(),"stream"}if(this.atLineEnd()){let X=yield*this.pushSpaces(!0);return yield*this.pushCount($.length-X),yield*this.pushNewline(),"stream"}return yield p6.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==="...")&&m$(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&&!m$(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(($==="-"||$==="?"||$===":")&&m$(X)){let J=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=J,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(n4),"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,J=-1;do{if($=yield*this.pushNewline(),$>0)X=yield*this.pushSpaces(!1),this.indentValue=J=X;else X=0;X+=yield*this.pushSpaces(!0)}while($+X>0);let Q=this.getLine();if(Q===null)return this.setNext("flow");if(J!==-1&&J<this.indentNext&&Q[0]!=="#"||J===0&&(Q.startsWith("---")||Q.startsWith("..."))&&m$(Q[3])){if(!(J===this.indentNext-1&&this.flowLevel===1&&(Q[0]==="]"||Q[0]==="}")))return this.flowLevel=0,yield p6.FLOW_END,yield*this.parseLineStart()}let q=0;while(Q[q]===",")q+=yield*this.pushCount(1),q+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(q+=yield*this.pushIndicators(),Q[q]){case void 0:return"flow";case"#":return yield*this.pushCount(Q.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(n4),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let Y=this.charAt(1);if(this.flowKey||m$(Y)||Y===",")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 J=this.buffer.substring(0,X),Q=J.indexOf(`
150
150
  `,this.pos);if(Q!==-1){while(Q!==-1){let q=this.continueScalar(Q+1);if(q===-1)break;Q=J.indexOf(`
151
151
  `,q)}if(Q!==-1)X=Q-(J[Q-1]==="\r"?2:1)}if(X===-1){if(!this.atEnd)return this.setNext("quoted-scalar");X=this.buffer.length}return yield*this.pushToIndex(X+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let $=this.pos;while(!0){let X=this.buffer[++$];if(X==="+")this.blockScalarKeep=!0;else if(X>"0"&&X<="9")this.blockScalarIndent=Number(X)-1;else if(X!=="-")break}return yield*this.pushUntil((X)=>m$(X)||X==="#")}*parseBlockScalar(){let $=this.pos-1,X=0,J;$:for(let q=this.pos;J=this.buffer[q];++q)switch(J){case" ":X+=1;break;case`
152
152
  `:$=q,X=0;break;case"\r":{let Y=this.buffer[q+1];if(!Y&&!this.atEnd)return this.setNext("block-scalar");if(Y===`
153
153
  `)break}default:break $}if(!J&&!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(`
154
154
  `,q)}while($!==-1);if($===-1){if(!this.atEnd)return this.setNext("block-scalar");$=this.buffer.length}}let Q=$+1;J=this.buffer[Q];while(J===" ")J=this.buffer[++Q];if(J==="\t"){while(J==="\t"||J===" "||J==="\r"||J===`
155
155
  `)J=this.buffer[++Q];$=Q-1}else if(!this.blockScalarKeep)do{let q=$-1,Y=this.buffer[q];if(Y==="\r")Y=this.buffer[--q];let z=q;while(Y===" ")Y=this.buffer[--q];if(Y===`
156
- `&&q>=this.pos&&q+1+X>z)$=q;else break}while(!0);return yield l6.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,X=this.pos-1,J=this.pos-1,Q;while(Q=this.buffer[++J])if(Q===":"){let q=this.buffer[J+1];if(m$(q)||$&&C5.has(q))break;X=J}else if(m$(Q)){let q=this.buffer[J+1];if(Q==="\r")if(q===`
156
+ `&&q>=this.pos&&q+1+X>z)$=q;else break}while(!0);return yield p6.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,X=this.pos-1,J=this.pos-1,Q;while(Q=this.buffer[++J])if(Q===":"){let q=this.buffer[J+1];if(m$(q)||$&&k5.has(q))break;X=J}else if(m$(Q)){let q=this.buffer[J+1];if(Q==="\r")if(q===`
157
157
  `)J+=1,Q=`
158
- `,q=this.buffer[J+1];else X=J;if(q==="#"||$&&C5.has(q))break;if(Q===`
159
- `){let Y=this.continueScalar(J+1);if(Y===-1)break;J=Math.max(J,Y-2)}}else{if($&&C5.has(Q))break;X=J}if(!Q&&!this.atEnd)return this.setNext("plain-scalar");return yield l6.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 J=this.buffer.slice(this.pos,$);if(J)return yield J,this.pos+=J.length,J.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(c4))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,X=this.charAt(1);if(m$(X)||$&&C5.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(!m$(X)&&X!==">")X=this.buffer[++$];return yield*this.pushToIndex(X===">"?$+1:$,!1)}else{let $=this.pos+1,X=this.buffer[$];while(X)if(tK.has(X))X=this.buffer[++$];else if(X==="%"&&nQ.has(this.buffer[$+1])&&nQ.has(this.buffer[$+2]))X=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
158
+ `,q=this.buffer[J+1];else X=J;if(q==="#"||$&&k5.has(q))break;if(Q===`
159
+ `){let Y=this.continueScalar(J+1);if(Y===-1)break;J=Math.max(J,Y-2)}}else{if($&&k5.has(Q))break;X=J}if(!Q&&!this.atEnd)return this.setNext("plain-scalar");return yield p6.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 J=this.buffer.slice(this.pos,$);if(J)return yield J,this.pos+=J.length,J.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(n4))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,X=this.charAt(1);if(m$(X)||$&&k5.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(!m$(X)&&X!==">")X=this.buffer[++$];return yield*this.pushToIndex(X===">"?$+1:$,!1)}else{let $=this.pos+1,X=this.buffer[$];while(X)if(QM.has(X))X=this.buffer[++$];else if(X==="%"&&aQ.has(this.buffer[$+1])&&aQ.has(this.buffer[$+2]))X=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
160
160
  `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
161
- `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let X=this.pos-1,J;do J=this.buffer[++X];while(J===" "||$&&J==="\t");let Q=X-this.pos;if(Q>0)yield this.buffer.substr(this.pos,Q),this.pos=X;return Q}*pushUntil($){let X=this.pos,J=this.buffer[X];while(!$(J))J=this.buffer[++X];return yield*this.pushToIndex(X,!1)}}$M.Lexer=rQ});var d4=_((JM)=>{class sQ{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let X=0,J=this.lineStarts.length;while(X<J){let q=X+J>>1;if(this.lineStarts[q]<$)X=q+1;else J=q}if(this.lineStarts[X]===$)return{line:X+1,col:1};if(X===0)return{line:0,col:$};let Q=this.lineStarts[X-1];return{line:X,col:$-Q+1}}}}JM.LineCounter=sQ});var i4=_((zM)=>{var qM=W$("process"),aQ=j5(),YM=p4();function j0($,X){for(let J=0;J<$.length;++J)if($[J].type===X)return!0;return!1}function oQ($){for(let X=0;X<$.length;++X)switch($[X].type){case"space":case"comment":case"newline":break;default:return X}return-1}function eQ($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function P5($){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 C8($){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 tQ($){if($.start.type==="flow-seq-start"){for(let X of $.items)if(X.sep&&!X.value&&!j0(X.start,"explicit-key-ind")&&!j0(X.sep,"map-value-ind")){if(X.key)X.value=X.key;if(delete X.key,eQ(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 $1{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 YM.Lexer,this.onNewLine=$}*parse($,X=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let J of this.lexer.lex($,X))yield*this.next(J);if(!X)yield*this.end()}*next($){if(this.source=$,qM.env.LOG_TOKENS)console.log("|",aQ.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let X=aQ.tokenType($);if(!X){let J=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:J,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 J=this.peek(1);if(X.type==="block-scalar")X.indent="indent"in J?J.indent:0;else if(X.type==="flow-collection"&&J.type==="document")X.indent=0;if(X.type==="flow-collection")tQ(X);switch(J.type){case"document":J.value=X;break;case"block-scalar":J.props.push(X);break;case"block-map":{let Q=J.items[J.items.length-1];if(Q.value){J.items.push({start:[],key:X,sep:[]}),this.onKeyLine=!0;return}else if(Q.sep)Q.value=X;else{Object.assign(Q,{key:X,sep:[]}),this.onKeyLine=!Q.explicitKey;return}break}case"block-seq":{let Q=J.items[J.items.length-1];if(Q.value)J.items.push({start:[],value:X});else Q.value=X;break}case"flow-collection":{let Q=J.items[J.items.length-1];if(!Q||Q.value)J.items.push({start:[],key:X,sep:[]});else if(Q.sep)Q.value=X;else Object.assign(Q,{key:X,sep:[]});return}default:yield*this.pop(),yield*this.pop(X)}if((J.type==="document"||J.type==="block-map"||J.type==="block-seq")&&(X.type==="block-map"||X.type==="block-seq")){let Q=X.items[X.items.length-1];if(Q&&!Q.sep&&!Q.value&&Q.start.length>0&&oQ(Q.start)===-1&&(X.indent===0||Q.start.every((q)=>q.type!=="comment"||q.indent<X.indent))){if(J.type==="document")J.end=Q.start;else J.items.push({start:Q.start});X.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if(oQ($.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=P5(this.peek(2)),J=C8(X),Q;if($.end)Q=$.end,Q.push(this.sourceToken),delete $.end;else Q=[this.sourceToken];let q={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:Q}]};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(`
161
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let X=this.pos-1,J;do J=this.buffer[++X];while(J===" "||$&&J==="\t");let Q=X-this.pos;if(Q>0)yield this.buffer.substr(this.pos,Q),this.pos=X;return Q}*pushUntil($){let X=this.pos,J=this.buffer[X];while(!$(J))J=this.buffer[++X];return yield*this.pushToIndex(X,!1)}}YM.Lexer=oQ});var s4=_((GM)=>{class tQ{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let X=0,J=this.lineStarts.length;while(X<J){let q=X+J>>1;if(this.lineStarts[q]<$)X=q+1;else J=q}if(this.lineStarts[X]===$)return{line:X+1,col:1};if(X===0)return{line:0,col:$};let Q=this.lineStarts[X-1];return{line:X,col:$-Q+1}}}}GM.LineCounter=tQ});var a4=_((VM)=>{var HM=U$("process"),eQ=f5(),UM=r4();function C0($,X){for(let J=0;J<$.length;++J)if($[J].type===X)return!0;return!1}function $q($){for(let X=0;X<$.length;++X)switch($[X].type){case"space":case"comment":case"newline":break;default:return X}return-1}function Jq($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function x5($){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 b8($){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 Xq($){if($.start.type==="flow-seq-start"){for(let X of $.items)if(X.sep&&!X.value&&!C0(X.start,"explicit-key-ind")&&!C0(X.sep,"map-value-ind")){if(X.key)X.value=X.key;if(delete X.key,Jq(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 Qq{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 UM.Lexer,this.onNewLine=$}*parse($,X=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let J of this.lexer.lex($,X))yield*this.next(J);if(!X)yield*this.end()}*next($){if(this.source=$,HM.env.LOG_TOKENS)console.log("|",eQ.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let X=eQ.tokenType($);if(!X){let J=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:J,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 J=this.peek(1);if(X.type==="block-scalar")X.indent="indent"in J?J.indent:0;else if(X.type==="flow-collection"&&J.type==="document")X.indent=0;if(X.type==="flow-collection")Xq(X);switch(J.type){case"document":J.value=X;break;case"block-scalar":J.props.push(X);break;case"block-map":{let Q=J.items[J.items.length-1];if(Q.value){J.items.push({start:[],key:X,sep:[]}),this.onKeyLine=!0;return}else if(Q.sep)Q.value=X;else{Object.assign(Q,{key:X,sep:[]}),this.onKeyLine=!Q.explicitKey;return}break}case"block-seq":{let Q=J.items[J.items.length-1];if(Q.value)J.items.push({start:[],value:X});else Q.value=X;break}case"flow-collection":{let Q=J.items[J.items.length-1];if(!Q||Q.value)J.items.push({start:[],key:X,sep:[]});else if(Q.sep)Q.value=X;else Object.assign(Q,{key:X,sep:[]});return}default:yield*this.pop(),yield*this.pop(X)}if((J.type==="document"||J.type==="block-map"||J.type==="block-seq")&&(X.type==="block-map"||X.type==="block-seq")){let Q=X.items[X.items.length-1];if(Q&&!Q.sep&&!Q.value&&Q.start.length>0&&$q(Q.start)===-1&&(X.indent===0||Q.start.every((q)=>q.type!=="comment"||q.indent<X.indent))){if(J.type==="document")J.end=Q.start;else J.items.push({start:Q.start});X.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if($q($.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=x5(this.peek(2)),J=b8(X),Q;if($.end)Q=$.end,Q.push(this.sourceToken),delete $.end;else Q=[this.sourceToken];let q={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:Q}]};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(`
162
162
  `)+1;while(X!==0)this.onNewLine(this.offset+X),X=this.source.indexOf(`
163
- `,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 J="end"in X.value?X.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(X.sep)X.sep.push(this.sourceToken);else X.start.push(this.sourceToken);return;case"space":case"comment":if(X.value)$.items.push({start:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else{if(this.atIndentedComment(X.start,$.indent)){let Q=$.items[$.items.length-2]?.value?.end;if(Array.isArray(Q)){Array.prototype.push.apply(Q,X.start),Q.push(this.sourceToken),$.items.pop();return}}X.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let J=!this.onKeyLine&&this.indent===$.indent,Q=J&&(X.sep||X.explicitKey)&&this.type!=="seq-item-ind",q=[];if(Q&&X.sep&&!X.value){let Y=[];for(let z=0;z<X.sep.length;++z){let G=X.sep[z];switch(G.type){case"newline":Y.push(z);break;case"space":break;case"comment":if(G.indent>$.indent)Y.length=0;break;default:Y.length=0}}if(Y.length>=2)q=X.sep.splice(Y[1])}switch(this.type){case"anchor":case"tag":if(Q||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(Q||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(j0(X.start,"newline"))Object.assign(X,{key:null,sep:[this.sourceToken]});else{let Y=C8(X.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Y,key:null,sep:[this.sourceToken]}]})}else if(X.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(j0(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(eQ(X.key)&&!j0(X.sep,"newline")){let Y=C8(X.start),z=X.key,G=X.sep;G.push(this.sourceToken),delete X.key,delete X.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Y,key:z,sep:G}]})}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||Q)$.items.push({start:q,key:null,sep:[this.sourceToken]});else if(j0(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 Y=this.flowScalar(this.type);if(Q||X.value)$.items.push({start:q,key:Y,sep:[]}),this.onKeyLine=!0;else if(X.sep)this.stack.push(Y);else Object.assign(X,{key:Y,sep:[]}),this.onKeyLine=!0;return}default:{let Y=this.startBlockValue($);if(Y){if(Y.type==="block-seq"){if(!X.explicitKey&&X.sep&&!j0(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(J)$.items.push({start:q});this.stack.push(Y);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let X=$.items[$.items.length-1];switch(this.type){case"newline":if(X.value){let J="end"in X.value?X.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else X.start.push(this.sourceToken);return;case"space":case"comment":if(X.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(X.start,$.indent)){let Q=$.items[$.items.length-2]?.value?.end;if(Array.isArray(Q)){Array.prototype.push.apply(Q,X.start),Q.push(this.sourceToken),$.items.pop();return}}X.start.push(this.sourceToken)}return;case"anchor":case"tag":if(X.value||this.indent<=$.indent)break;X.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(X.value||j0(X.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else X.start.push(this.sourceToken);return}if(this.indent>$.indent){let J=this.startBlockValue($);if(J){this.stack.push(J);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let X=$.items[$.items.length-1];if(this.type==="flow-error-end"){let J;do yield*this.pop(),J=this.peek(1);while(J?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!X||X.sep)$.items.push({start:[this.sourceToken]});else X.start.push(this.sourceToken);return;case"map-value-ind":if(!X||X.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else Object.assign(X,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!X||X.value)$.items.push({start:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else X.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Q=this.flowScalar(this.type);if(!X||X.value)$.items.push({start:[],key:Q,sep:[]});else if(X.sep)this.stack.push(Q);else Object.assign(X,{key:Q,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let J=this.startBlockValue($);if(J)this.stack.push(J);else yield*this.pop(),yield*this.step()}else{let J=this.peek(2);if(J.type==="block-map"&&(this.type==="map-value-ind"&&J.indent===$.indent||this.type==="newline"&&!J.items[J.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&J.type!=="flow-collection"){let Q=P5(J),q=C8(Q);tQ($);let Y=$.end.splice(1,$.end.length);Y.push(this.sourceToken);let z={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:q,key:$,sep:Y}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let X=this.source.indexOf(`
163
+ `,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 J="end"in X.value?X.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(X.sep)X.sep.push(this.sourceToken);else X.start.push(this.sourceToken);return;case"space":case"comment":if(X.value)$.items.push({start:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else{if(this.atIndentedComment(X.start,$.indent)){let Q=$.items[$.items.length-2]?.value?.end;if(Array.isArray(Q)){Array.prototype.push.apply(Q,X.start),Q.push(this.sourceToken),$.items.pop();return}}X.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let J=!this.onKeyLine&&this.indent===$.indent,Q=J&&(X.sep||X.explicitKey)&&this.type!=="seq-item-ind",q=[];if(Q&&X.sep&&!X.value){let Y=[];for(let z=0;z<X.sep.length;++z){let G=X.sep[z];switch(G.type){case"newline":Y.push(z);break;case"space":break;case"comment":if(G.indent>$.indent)Y.length=0;break;default:Y.length=0}}if(Y.length>=2)q=X.sep.splice(Y[1])}switch(this.type){case"anchor":case"tag":if(Q||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(Q||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(C0(X.start,"newline"))Object.assign(X,{key:null,sep:[this.sourceToken]});else{let Y=b8(X.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Y,key:null,sep:[this.sourceToken]}]})}else if(X.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(C0(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(Jq(X.key)&&!C0(X.sep,"newline")){let Y=b8(X.start),z=X.key,G=X.sep;G.push(this.sourceToken),delete X.key,delete X.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:Y,key:z,sep:G}]})}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||Q)$.items.push({start:q,key:null,sep:[this.sourceToken]});else if(C0(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 Y=this.flowScalar(this.type);if(Q||X.value)$.items.push({start:q,key:Y,sep:[]}),this.onKeyLine=!0;else if(X.sep)this.stack.push(Y);else Object.assign(X,{key:Y,sep:[]}),this.onKeyLine=!0;return}default:{let Y=this.startBlockValue($);if(Y){if(Y.type==="block-seq"){if(!X.explicitKey&&X.sep&&!C0(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(J)$.items.push({start:q});this.stack.push(Y);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let X=$.items[$.items.length-1];switch(this.type){case"newline":if(X.value){let J="end"in X.value?X.value.end:void 0;if((Array.isArray(J)?J[J.length-1]:void 0)?.type==="comment")J?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else X.start.push(this.sourceToken);return;case"space":case"comment":if(X.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(X.start,$.indent)){let Q=$.items[$.items.length-2]?.value?.end;if(Array.isArray(Q)){Array.prototype.push.apply(Q,X.start),Q.push(this.sourceToken),$.items.pop();return}}X.start.push(this.sourceToken)}return;case"anchor":case"tag":if(X.value||this.indent<=$.indent)break;X.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(X.value||C0(X.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else X.start.push(this.sourceToken);return}if(this.indent>$.indent){let J=this.startBlockValue($);if(J){this.stack.push(J);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let X=$.items[$.items.length-1];if(this.type==="flow-error-end"){let J;do yield*this.pop(),J=this.peek(1);while(J?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!X||X.sep)$.items.push({start:[this.sourceToken]});else X.start.push(this.sourceToken);return;case"map-value-ind":if(!X||X.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else Object.assign(X,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!X||X.value)$.items.push({start:[this.sourceToken]});else if(X.sep)X.sep.push(this.sourceToken);else X.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Q=this.flowScalar(this.type);if(!X||X.value)$.items.push({start:[],key:Q,sep:[]});else if(X.sep)this.stack.push(Q);else Object.assign(X,{key:Q,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let J=this.startBlockValue($);if(J)this.stack.push(J);else yield*this.pop(),yield*this.step()}else{let J=this.peek(2);if(J.type==="block-map"&&(this.type==="map-value-ind"&&J.indent===$.indent||this.type==="newline"&&!J.items[J.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&J.type!=="flow-collection"){let Q=x5(J),q=b8(Q);Xq($);let Y=$.end.splice(1,$.end.length);Y.push(this.sourceToken);let z={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:q,key:$,sep:Y}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=z}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let X=this.source.indexOf(`
164
164
  `)+1;while(X!==0)this.onNewLine(this.offset+X),X=this.source.indexOf(`
165
- `,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=P5($),J=C8(X);return J.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let X=P5($),J=C8(X);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,X){if(this.type!=="comment")return!1;if(this.indent<=X)return!1;return $.every((J)=>J.type==="newline"||J.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()}}}zM.Parser=$1});var Y1=_((NM)=>{var X1=x4(),WM=g6(),c6=v6(),HM=dX(),UM=n(),VM=d4(),J1=i4();function Q1($){let X=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||X&&new VM.LineCounter||null,prettyErrors:X}}function BM($,X={}){let{lineCounter:J,prettyErrors:Q}=Q1(X),q=new J1.Parser(J?.addNewLine),Y=new X1.Composer(X),z=Array.from(Y.compose(q.parse($)));if(Q&&J)for(let G of z)G.errors.forEach(c6.prettifyError($,J)),G.warnings.forEach(c6.prettifyError($,J));if(z.length>0)return z;return Object.assign([],{empty:!0},Y.streamInfo())}function q1($,X={}){let{lineCounter:J,prettyErrors:Q}=Q1(X),q=new J1.Parser(J?.addNewLine),Y=new X1.Composer(X),z=null;for(let G of Y.compose(q.parse($),!0,$.length))if(!z)z=G;else if(z.options.logLevel!=="silent"){z.errors.push(new c6.YAMLParseError(G.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(Q&&J)z.errors.forEach(c6.prettifyError($,J)),z.warnings.forEach(c6.prettifyError($,J));return z}function KM($,X,J){let Q=void 0;if(typeof X==="function")Q=X;else if(J===void 0&&X&&typeof X==="object")J=X;let q=q1($,J);if(!q)return null;if(q.warnings.forEach((Y)=>HM.warn(q.options.logLevel,Y)),q.errors.length>0)if(q.options.logLevel!=="silent")throw q.errors[0];else q.errors=[];return q.toJS(Object.assign({reviver:Q},J))}function MM($,X,J){let Q=null;if(typeof X==="function"||Array.isArray(X))Q=X;else if(J===void 0&&X)J=X;if(typeof J==="string")J=J.length;if(typeof J==="number"){let q=Math.round(J);J=q<1?void 0:q>8?{indent:8}:{indent:q}}if($===void 0){let{keepUndefined:q}=J??X??{};if(!q)return}if(UM.isDocument($)&&!Q)return $.toString(J);return new WM.Document($,Q,J).toString(J)}NM.parse=KM;NM.parseAllDocuments=BM;NM.parseDocument=q1;NM.stringify=MM});var RM,AM,_M,n4,FM,C0,IM,EM,TM,ZM,fR,SM,jM,CM,b5,z1,PM,bM,fM,kM,xM,yM,gM,vM,hM,uM,mM,lM,cM,pM,dM,iM,nM,rM,sM,aM,oM,tM,p6,eM,$N,r4,XN,JN;var s4=g(()=>{RM=x4(),AM=g6(),_M=L4(),n4=v6(),FM=_6(),C0=n(),IM=E0(),EM=M$(),TM=Z0(),ZM=S0(),fR=j5(),SM=p4(),jM=d4(),CM=i4(),b5=Y1(),z1=R6();PM=RM.Composer,bM=AM.Document,fM=_M.Schema,kM=n4.YAMLError,xM=n4.YAMLParseError,yM=n4.YAMLWarning,gM=FM.Alias,vM=C0.isAlias,hM=C0.isCollection,uM=C0.isDocument,mM=C0.isMap,lM=C0.isNode,cM=C0.isPair,pM=C0.isScalar,dM=C0.isSeq,iM=IM.Pair,nM=EM.Scalar,rM=TM.YAMLMap,sM=ZM.YAMLSeq,aM=SM.Lexer,oM=jM.LineCounter,tM=CM.Parser,p6=b5.parse,eM=b5.parseAllDocuments,$N=b5.parseDocument,r4=b5.stringify,XN=z1.visit,JN=z1.visitAsync});import{readFileSync as W1,writeFileSync as QN,existsSync as G1}from"fs";function $$($){let X=W1($,"utf-8");return p6(X)}function Q$($,X){let J=r4(X,{lineWidth:0});QN($,J,"utf-8")}function o($){return W1($,"utf-8")}function r($=process.cwd()){let X=["project.faf",".faf"];for(let Q of X){let q=`${$}/${Q}`;if(G1(q))return q}let J=$.replace(/\/[^/]+$/,"");if(J!==$)for(let Q of X){let q=`${J}/${Q}`;if(G1(q))return q}return null}var B$=g(()=>{s4()});var B1=_((HN,V1)=>{var __dirname="/Users/wolfejam/FAF/cli/node_modules/faf-scoring-kernel",H1={};H1.__wbindgen_placeholder__=HN;var f5=null;function P8(){if(f5===null||f5.byteLength===0)f5=new Uint8Array(t.memory.buffer);return f5}var U1=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});U1.decode();function qN($,X){return U1.decode(P8().subarray($,$+X))}function X8($,X){return $=$>>>0,qN($,X)}HN.sdk_version=function(){let $,X;try{let J=t.sdk_version();return $=J[0],X=J[1],X8(J[0],J[1])}finally{t.__wbindgen_free($,X,1)}};var X0=0,d6=new TextEncoder;if(!("encodeInto"in d6))d6.encodeInto=function($,X){let J=d6.encode($);return X.set(J),{read:$.length,written:J.length}};function k5($,X,J){if(J===void 0){let G=d6.encode($),W=X(G.length,1)>>>0;return P8().subarray(W,W+G.length).set(G),X0=G.length,W}let Q=$.length,q=X(Q,1)>>>0,Y=P8(),z=0;for(;z<Q;z++){let G=$.charCodeAt(z);if(G>127)break;Y[q+z]=G}if(z!==Q){if(z!==0)$=$.slice(z);q=J(q,Q,Q=z+$.length*3,1)>>>0;let G=P8().subarray(q+z,q+Q),W=d6.encodeInto($,G);z+=W.written,q=J(q,Q,z,1)>>>0}return X0=z,q}function b8($){let X=t.__wbindgen_externrefs.get($);return t.__externref_table_dealloc($),X}HN.score_faf_enterprise=function($){let X,J;try{let Y=k5($,t.__wbindgen_malloc,t.__wbindgen_realloc),z=X0,G=t.score_faf_enterprise(Y,z);var Q=G[0],q=G[1];if(G[3])throw Q=0,q=0,b8(G[2]);return X=Q,J=q,X8(Q,q)}finally{t.__wbindgen_free(X,J,1)}};HN.score_faf=function($){let X,J;try{let Y=k5($,t.__wbindgen_malloc,t.__wbindgen_realloc),z=X0,G=t.score_faf(Y,z);var Q=G[0],q=G[1];if(G[3])throw Q=0,q=0,b8(G[2]);return X=Q,J=q,X8(Q,q)}finally{t.__wbindgen_free(X,J,1)}};function a4($,X){let J=X($.length*1,1)>>>0;return P8().set($,J/1),X0=$.length,J}HN.decompile_fafb=function($){let X,J;try{let Y=a4($,t.__wbindgen_malloc),z=X0,G=t.decompile_fafb(Y,z);var Q=G[0],q=G[1];if(G[3])throw Q=0,q=0,b8(G[2]);return X=Q,J=q,X8(Q,q)}finally{t.__wbindgen_free(X,J,1)}};HN.score_fafb=function($){let X,J;try{let Y=a4($,t.__wbindgen_malloc),z=X0,G=t.score_fafb(Y,z);var Q=G[0],q=G[1];if(G[3])throw Q=0,q=0,b8(G[2]);return X=Q,J=q,X8(Q,q)}finally{t.__wbindgen_free(X,J,1)}};HN.validate_faf=function($){let X=k5($,t.__wbindgen_malloc,t.__wbindgen_realloc),J=X0;return t.validate_faf(X,J)!==0};function YN($,X){return $=$>>>0,P8().subarray($/1,$/1+X)}HN.compile_fafb=function($){let X=k5($,t.__wbindgen_malloc,t.__wbindgen_realloc),J=X0,Q=t.compile_fafb(X,J);if(Q[3])throw b8(Q[2]);var q=YN(Q[0],Q[1]).slice();return t.__wbindgen_free(Q[0],Q[1]*1,1),q};HN.fafb_info=function($){let X,J;try{let Y=a4($,t.__wbindgen_malloc),z=X0,G=t.fafb_info(Y,z);var Q=G[0],q=G[1];if(G[3])throw Q=0,q=0,b8(G[2]);return X=Q,J=q,X8(Q,q)}finally{t.__wbindgen_free(X,J,1)}};HN.__wbindgen_cast_2241b6af4c4b2941=function($,X){return X8($,X)};HN.__wbindgen_init_externref_table=function(){let $=t.__wbindgen_externrefs,X=$.grow(4);$.set(0,void 0),$.set(X+0,void 0),$.set(X+1,null),$.set(X+2,!0),$.set(X+3,!1)};var zN=`${__dirname}/faf_wasm_sdk_bg.wasm`,GN=W$("fs").readFileSync(zN),WN=new WebAssembly.Module(GN),t=HN.__wasm=new WebAssembly.Instance(WN,H1).exports;t.__wbindgen_start()});function i6(){if(!o4)try{o4=B1()}catch{throw Error(`faf-scoring-kernel not installed.
165
+ `,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=x5($),J=b8(X);return J.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let X=x5($),J=b8(X);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,X){if(this.type!=="comment")return!1;if(this.indent<=X)return!1;return $.every((J)=>J.type==="newline"||J.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()}}}VM.Parser=Qq});var Wq=_((RM)=>{var qq=h4(),KM=h6(),d6=u6(),MM=sX(),NM=n(),DM=s4(),Yq=a4();function zq($){let X=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||X&&new DM.LineCounter||null,prettyErrors:X}}function OM($,X={}){let{lineCounter:J,prettyErrors:Q}=zq(X),q=new Yq.Parser(J?.addNewLine),Y=new qq.Composer(X),z=Array.from(Y.compose(q.parse($)));if(Q&&J)for(let G of z)G.errors.forEach(d6.prettifyError($,J)),G.warnings.forEach(d6.prettifyError($,J));if(z.length>0)return z;return Object.assign([],{empty:!0},Y.streamInfo())}function Gq($,X={}){let{lineCounter:J,prettyErrors:Q}=zq(X),q=new Yq.Parser(J?.addNewLine),Y=new qq.Composer(X),z=null;for(let G of Y.compose(q.parse($),!0,$.length))if(!z)z=G;else if(z.options.logLevel!=="silent"){z.errors.push(new d6.YAMLParseError(G.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(Q&&J)z.errors.forEach(d6.prettifyError($,J)),z.warnings.forEach(d6.prettifyError($,J));return z}function wM($,X,J){let Q=void 0;if(typeof X==="function")Q=X;else if(J===void 0&&X&&typeof X==="object")J=X;let q=Gq($,J);if(!q)return null;if(q.warnings.forEach((Y)=>MM.warn(q.options.logLevel,Y)),q.errors.length>0)if(q.options.logLevel!=="silent")throw q.errors[0];else q.errors=[];return q.toJS(Object.assign({reviver:Q},J))}function LM($,X,J){let Q=null;if(typeof X==="function"||Array.isArray(X))Q=X;else if(J===void 0&&X)J=X;if(typeof J==="string")J=J.length;if(typeof J==="number"){let q=Math.round(J);J=q<1?void 0:q>8?{indent:8}:{indent:q}}if($===void 0){let{keepUndefined:q}=J??X??{};if(!q)return}if(NM.isDocument($)&&!Q)return $.toString(J);return new KM.Document($,Q,J).toString(J)}RM.parse=wM;RM.parseAllDocuments=OM;RM.parseDocument=Gq;RM.stringify=LM});var EM,ZM,TM,o4,SM,b0,jM,CM,bM,PM,hR,fM,kM,xM,y5,Hq,yM,gM,vM,hM,uM,mM,lM,cM,pM,dM,iM,nM,rM,sM,aM,oM,tM,eM,$N,XN,JN,QN,i6,qN,YN,t4,zN,GN;var e4=g(()=>{EM=h4(),ZM=h6(),TM=F4(),o4=u6(),SM=I6(),b0=n(),jM=Z0(),CM=M$(),bM=S0(),PM=j0(),hR=f5(),fM=r4(),kM=s4(),xM=a4(),y5=Wq(),Hq=_6();yM=EM.Composer,gM=ZM.Document,vM=TM.Schema,hM=o4.YAMLError,uM=o4.YAMLParseError,mM=o4.YAMLWarning,lM=SM.Alias,cM=b0.isAlias,pM=b0.isCollection,dM=b0.isDocument,iM=b0.isMap,nM=b0.isNode,rM=b0.isPair,sM=b0.isScalar,aM=b0.isSeq,oM=jM.Pair,tM=CM.Scalar,eM=bM.YAMLMap,$N=PM.YAMLSeq,XN=fM.Lexer,JN=kM.LineCounter,QN=xM.Parser,i6=y5.parse,qN=y5.parseAllDocuments,YN=y5.parseDocument,t4=y5.stringify,zN=Hq.visit,GN=Hq.visitAsync});import{readFileSync as Vq,writeFileSync as WN,existsSync as Uq}from"fs";function $$($){let X=Vq($,"utf-8");return i6(X)}function Q$($,X){let J=t4(X,{lineWidth:0});WN($,J,"utf-8")}function a($){return Vq($,"utf-8")}function r($=process.cwd()){let X=["project.faf",".faf"];for(let Q of X){let q=`${$}/${Q}`;if(Uq(q))return q}let J=$.replace(/\/[^/]+$/,"");if(J!==$)for(let Q of X){let q=`${J}/${Q}`;if(Uq(q))return q}return null}var B$=g(()=>{e4()});var Nq=_((MN,Mq)=>{var __dirname="/Users/wolfejam/FAF/cli/node_modules/faf-scoring-kernel",Bq={};Bq.__wbindgen_placeholder__=MN;var g5=null;function P8(){if(g5===null||g5.byteLength===0)g5=new Uint8Array(t.memory.buffer);return g5}var Kq=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Kq.decode();function HN($,X){return Kq.decode(P8().subarray($,$+X))}function J8($,X){return $=$>>>0,HN($,X)}MN.sdk_version=function(){let $,X;try{let J=t.sdk_version();return $=J[0],X=J[1],J8(J[0],J[1])}finally{t.__wbindgen_free($,X,1)}};var X0=0,n6=new TextEncoder;if(!("encodeInto"in n6))n6.encodeInto=function($,X){let J=n6.encode($);return X.set(J),{read:$.length,written:J.length}};function v5($,X,J){if(J===void 0){let G=n6.encode($),W=X(G.length,1)>>>0;return P8().subarray(W,W+G.length).set(G),X0=G.length,W}let Q=$.length,q=X(Q,1)>>>0,Y=P8(),z=0;for(;z<Q;z++){let G=$.charCodeAt(z);if(G>127)break;Y[q+z]=G}if(z!==Q){if(z!==0)$=$.slice(z);q=J(q,Q,Q=z+$.length*3,1)>>>0;let G=P8().subarray(q+z,q+Q),W=n6.encodeInto($,G);z+=W.written,q=J(q,Q,z,1)>>>0}return X0=z,q}function f8($){let X=t.__wbindgen_externrefs.get($);return t.__externref_table_dealloc($),X}MN.score_faf_enterprise=function($){let X,J;try{let Y=v5($,t.__wbindgen_malloc,t.__wbindgen_realloc),z=X0,G=t.score_faf_enterprise(Y,z);var Q=G[0],q=G[1];if(G[3])throw Q=0,q=0,f8(G[2]);return X=Q,J=q,J8(Q,q)}finally{t.__wbindgen_free(X,J,1)}};MN.score_faf=function($){let X,J;try{let Y=v5($,t.__wbindgen_malloc,t.__wbindgen_realloc),z=X0,G=t.score_faf(Y,z);var Q=G[0],q=G[1];if(G[3])throw Q=0,q=0,f8(G[2]);return X=Q,J=q,J8(Q,q)}finally{t.__wbindgen_free(X,J,1)}};function $7($,X){let J=X($.length*1,1)>>>0;return P8().set($,J/1),X0=$.length,J}MN.decompile_fafb=function($){let X,J;try{let Y=$7($,t.__wbindgen_malloc),z=X0,G=t.decompile_fafb(Y,z);var Q=G[0],q=G[1];if(G[3])throw Q=0,q=0,f8(G[2]);return X=Q,J=q,J8(Q,q)}finally{t.__wbindgen_free(X,J,1)}};MN.score_fafb=function($){let X,J;try{let Y=$7($,t.__wbindgen_malloc),z=X0,G=t.score_fafb(Y,z);var Q=G[0],q=G[1];if(G[3])throw Q=0,q=0,f8(G[2]);return X=Q,J=q,J8(Q,q)}finally{t.__wbindgen_free(X,J,1)}};MN.validate_faf=function($){let X=v5($,t.__wbindgen_malloc,t.__wbindgen_realloc),J=X0;return t.validate_faf(X,J)!==0};function UN($,X){return $=$>>>0,P8().subarray($/1,$/1+X)}MN.compile_fafb=function($){let X=v5($,t.__wbindgen_malloc,t.__wbindgen_realloc),J=X0,Q=t.compile_fafb(X,J);if(Q[3])throw f8(Q[2]);var q=UN(Q[0],Q[1]).slice();return t.__wbindgen_free(Q[0],Q[1]*1,1),q};MN.fafb_info=function($){let X,J;try{let Y=$7($,t.__wbindgen_malloc),z=X0,G=t.fafb_info(Y,z);var Q=G[0],q=G[1];if(G[3])throw Q=0,q=0,f8(G[2]);return X=Q,J=q,J8(Q,q)}finally{t.__wbindgen_free(X,J,1)}};MN.__wbindgen_cast_2241b6af4c4b2941=function($,X){return J8($,X)};MN.__wbindgen_init_externref_table=function(){let $=t.__wbindgen_externrefs,X=$.grow(4);$.set(0,void 0),$.set(X+0,void 0),$.set(X+1,null),$.set(X+2,!0),$.set(X+3,!1)};var VN=`${__dirname}/faf_wasm_sdk_bg.wasm`,BN=U$("fs").readFileSync(VN),KN=new WebAssembly.Module(BN),t=MN.__wasm=new WebAssembly.Instance(KN,Bq).exports;t.__wbindgen_start()});function r6(){if(!X7)try{X7=Nq()}catch{throw Error(`faf-scoring-kernel not installed.
166
166
 
167
167
  Run: npm install faf-scoring-kernel
168
- `)}return o4}function H$($){return JSON.parse(i6().score_faf($))}function K1($){return i6().validate_faf($)}function M1($){return i6().compile_fafb($)}function N1($){return JSON.parse(i6().decompile_fafb($))}function D1(){return i6().sdk_version()}var o4=null;var t4=($)=>(X)=>`\x1B[${$}m${X}\x1B[0m`,S,O,hR,A=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,J8=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var e=g(()=>{S=t4("1"),O=t4("2"),hR=t4("3")});function x5($){return $.indicator}function O1($){for(let X of e4)if($>=X.threshold)return X;return e4[e4.length-1]}var e4;var y5=g(()=>{e();e4=[{name:"TROPHY",indicator:`${J8("\uD83C\uDFC6")} ${J8("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${J8(S("★"))} ${J8("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${A("◆")} ${A("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${A("◇")} ${A("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${S("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${O("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${O("○")} RED`,threshold:1},{name:"WHITE",indicator:`${O("♡")}`,threshold:0}]});function U$($){return{score:$.score,tier:O1($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}var l$=g(()=>{y5()});function N$($,X,J=!1){let Q=x5($.tier),q=S(`${$.score}%`);if(console.log(`${Q} ${q} ${O(`${$.populated}/${$.active} slots`)} ${O("—")} ${X}`),$.tier.name!=="TROPHY"&&$.empty>0)console.log(O(` ${$.empty} empty`));if(J)console.log(""),RN($)}function RN($){for(let[X,J]of Object.entries($.slots)){let Q=J==="populated"?A("●"):J==="slotignored"?O("—"):O("○");console.log(` ${Q} ${J==="slotignored"?O(X):X}`)}}var J0=g(()=>{y5();e()});function D$($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return AN.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var E$,XA,JA,AN,f8;var B0=g(()=>{E$=[{index:1,path:"project.name",description:"Project name",category:"project"},{index:2,path:"project.goal",description:"What the project does",category:"project"},{index:3,path:"project.main_language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",description:"Who is building this",category:"human"},{index:5,path:"human_context.what",description:"What are they building",category:"human"},{index:6,path:"human_context.why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",description:"State management",category:"frontend"},{index:14,path:"stack.backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",description:"Database",category:"backend"},{index:18,path:"stack.connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",description:"Remote build cache",category:"enterprise_ops"}],XA=new Map(E$.map(($)=>[$.path,$])),JA=E$.filter(($)=>$.index<=21),AN=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);f8={cli:["project","human"],library:["project","human"],"static-site":["project","frontend","human"],mcp:["project","backend","universal","human"],backend:["project","backend","universal","human"],"data-science":["project","backend","human"],frontend:["project","frontend","human"],"api-platform":["project","frontend","backend","universal","human"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]}});var w1;var L1=g(()=>{w1=[{name:"Next.js",slug:"nextjs",category:"frontend",signals:[{type:"dependency",key:"next"},{type:"file",pattern:"next.config.*"}]},{name:"React",slug:"react",category:"frontend",signals:[{type:"dependency",key:"react"}]},{name:"SvelteKit",slug:"sveltekit",category:"frontend",signals:[{type:"dependency",key:"@sveltejs/kit"},{type:"file",pattern:"svelte.config.*"}]},{name:"Svelte",slug:"svelte",category:"frontend",signals:[{type:"dependency",key:"svelte"},{type:"devDependency",key:"svelte"}]},{name:"Vue.js",slug:"vue",category:"frontend",signals:[{type:"dependency",key:"vue"}]},{name:"Nuxt",slug:"nuxt",category:"frontend",signals:[{type:"dependency",key:"nuxt"},{type:"file",pattern:"nuxt.config.*"}]},{name:"Angular",slug:"angular",category:"frontend",signals:[{type:"dependency",key:"@angular/core"},{type:"file",pattern:"angular.json"}]},{name:"Astro",slug:"astro",category:"frontend",signals:[{type:"dependency",key:"astro"},{type:"file",pattern:"astro.config.*"}]},{name:"Solid",slug:"solid",category:"frontend",signals:[{type:"dependency",key:"solid-js"}]},{name:"Remix",slug:"remix",category:"frontend",signals:[{type:"dependency",key:"@remix-run/react"}]},{name:"Gatsby",slug:"gatsby",category:"frontend",signals:[{type:"dependency",key:"gatsby"},{type:"file",pattern:"gatsby-config.*"}]},{name:"Qwik",slug:"qwik",category:"frontend",signals:[{type:"dependency",key:"@builder.io/qwik"}]},{name:"Vercel (SvelteKit)",slug:"adapter-vercel",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-vercel"},{type:"devDependency",key:"@sveltejs/adapter-vercel"}]},{name:"Node (SvelteKit)",slug:"adapter-node",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-node"},{type:"devDependency",key:"@sveltejs/adapter-node"}]},{name:"Static (SvelteKit)",slug:"adapter-static",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-static"},{type:"devDependency",key:"@sveltejs/adapter-static"}]},{name:"Cloudflare (SvelteKit)",slug:"adapter-cloudflare",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-cloudflare"},{type:"devDependency",key:"@sveltejs/adapter-cloudflare"}]},{name:"Netlify (SvelteKit)",slug:"adapter-netlify",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-netlify"},{type:"devDependency",key:"@sveltejs/adapter-netlify"}]},{name:"Tailwind CSS",slug:"tailwind",category:"css",signals:[{type:"dependency",key:"tailwindcss"},{type:"devDependency",key:"tailwindcss"},{type:"file",pattern:"tailwind.config.*"}]},{name:"Bootstrap",slug:"bootstrap",category:"css",signals:[{type:"dependency",key:"bootstrap"}]},{name:"Styled Components",slug:"styled-components",category:"css",signals:[{type:"dependency",key:"styled-components"}]},{name:"shadcn/ui",slug:"shadcn",category:"ui",signals:[{type:"file",pattern:"components.json"},{type:"dependency",key:"@radix-ui/react-dialog"}]},{name:"Material UI",slug:"mui",category:"ui",signals:[{type:"dependency",key:"@mui/material"}]},{name:"Chakra UI",slug:"chakra",category:"ui",signals:[{type:"dependency",key:"@chakra-ui/react"}]},{name:"Ant Design",slug:"antd",category:"ui",signals:[{type:"dependency",key:"antd"}]},{name:"Redux",slug:"redux",category:"state",signals:[{type:"dependency",key:"@reduxjs/toolkit"}]},{name:"Zustand",slug:"zustand",category:"state",signals:[{type:"dependency",key:"zustand"}]},{name:"Jotai",slug:"jotai",category:"state",signals:[{type:"dependency",key:"jotai"}]},{name:"Pinia",slug:"pinia",category:"state",signals:[{type:"dependency",key:"pinia"}]},{name:"Express",slug:"express",category:"backend",signals:[{type:"dependency",key:"express"}]},{name:"Fastify",slug:"fastify",category:"backend",signals:[{type:"dependency",key:"fastify"}]},{name:"Hono",slug:"hono",category:"backend",signals:[{type:"dependency",key:"hono"}]},{name:"Elysia",slug:"elysia",category:"backend",signals:[{type:"dependency",key:"elysia"}]},{name:"NestJS",slug:"nestjs",category:"backend",signals:[{type:"dependency",key:"@nestjs/core"}]},{name:"Koa",slug:"koa",category:"backend",signals:[{type:"dependency",key:"koa"}]},{name:"FastAPI",slug:"fastapi",category:"backend",signals:[{type:"dependency",key:"fastapi"}]},{name:"Django",slug:"django",category:"backend",signals:[{type:"dependency",key:"django"},{type:"file",pattern:"manage.py"}]},{name:"Flask",slug:"flask",category:"backend",signals:[{type:"dependency",key:"flask"},{type:"file",pattern:"app.py"}]},{name:"Rails",slug:"rails",category:"backend",signals:[{type:"file",pattern:"Gemfile"},{type:"file",pattern:"config/routes.rb"}]},{name:"Spring Boot",slug:"spring",category:"backend",signals:[{type:"file",pattern:"pom.xml"},{type:"file",pattern:"build.gradle"}]},{name:"Prisma",slug:"prisma",category:"database",signals:[{type:"dependency",key:"prisma"},{type:"devDependency",key:"prisma"},{type:"file",pattern:"prisma/schema.prisma"}]},{name:"Drizzle",slug:"drizzle",category:"database",signals:[{type:"dependency",key:"drizzle-orm"},{type:"file",pattern:"drizzle.config.*"}]},{name:"TypeORM",slug:"typeorm",category:"database",signals:[{type:"dependency",key:"typeorm"}]},{name:"Mongoose",slug:"mongoose",category:"database",signals:[{type:"dependency",key:"mongoose"}]},{name:"SQLAlchemy",slug:"sqlalchemy",category:"database",signals:[{type:"dependency",key:"sqlalchemy"}]},{name:"Tortoise ORM",slug:"tortoise",category:"database",signals:[{type:"dependency",key:"tortoise-orm"}]},{name:"Vite",slug:"vite",category:"build",signals:[{type:"dependency",key:"vite"},{type:"devDependency",key:"vite"},{type:"file",pattern:"vite.config.*"}]},{name:"webpack",slug:"webpack",category:"build",signals:[{type:"dependency",key:"webpack"},{type:"devDependency",key:"webpack"},{type:"file",pattern:"webpack.config.*"}]},{name:"esbuild",slug:"esbuild",category:"build",signals:[{type:"dependency",key:"esbuild"},{type:"devDependency",key:"esbuild"}]},{name:"Turbopack",slug:"turbopack",category:"build",signals:[{type:"file",pattern:"turbo.json"}]},{name:"Jest",slug:"jest",category:"testing",signals:[{type:"devDependency",key:"jest"},{type:"file",pattern:"jest.config.*"}]},{name:"Vitest",slug:"vitest",category:"testing",signals:[{type:"devDependency",key:"vitest"}]},{name:"Playwright",slug:"playwright",category:"testing",signals:[{type:"devDependency",key:"@playwright/test"},{type:"file",pattern:"playwright.config.*"}]},{name:"Cypress",slug:"cypress",category:"testing",signals:[{type:"devDependency",key:"cypress"},{type:"file",pattern:"cypress.config.*"}]},{name:"Turborepo",slug:"turborepo",category:"monorepo",signals:[{type:"devDependency",key:"turbo"},{type:"file",pattern:"turbo.json"}]},{name:"Nx",slug:"nx",category:"monorepo",signals:[{type:"devDependency",key:"nx"},{type:"file",pattern:"nx.json"}]},{name:"Lerna",slug:"lerna",category:"monorepo",signals:[{type:"devDependency",key:"lerna"},{type:"file",pattern:"lerna.json"}]},{name:"MCP SDK (TS)",slug:"mcp-sdk-ts",category:"mcp",signals:[{type:"dependency",key:"@modelcontextprotocol/sdk"}]},{name:"FastMCP",slug:"fastmcp",category:"mcp",signals:[{type:"dependency",key:"fastmcp"}]},{name:"MCP SDK (Python)",slug:"mcp-sdk-py",category:"mcp",signals:[{type:"dependency",key:"mcp"}]},{name:"rmcp",slug:"rmcp",category:"mcp",signals:[{type:"dependency",key:"rmcp"}]},{name:"MCP Go",slug:"mcp-go",category:"mcp",signals:[{type:"dependency",key:"github.com/mark3labs/mcp-go"},{type:"dependency",key:"github.com/modelcontextprotocol/go-sdk"}]},{name:"MCP .NET",slug:"mcp-dotnet",category:"mcp",signals:[{type:"dependency",key:"ModelContextProtocol"}]},{name:"FastMCP (TS)",slug:"fastmcp-ts",category:"mcp",signals:[{type:"dependency",key:"@fastmcp/server"}]},{name:"Anthropic SDK",slug:"anthropic",category:"ai",signals:[{type:"dependency",key:"@anthropic-ai/sdk"}]},{name:"OpenAI SDK",slug:"openai",category:"ai",signals:[{type:"dependency",key:"openai"}]},{name:"LangChain",slug:"langchain",category:"ai",signals:[{type:"dependency",key:"langchain"}]},{name:"Vercel",slug:"vercel",category:"hosting",signals:[{type:"file",pattern:"vercel.json"}]},{name:"Netlify",slug:"netlify",category:"hosting",signals:[{type:"file",pattern:"netlify.toml"}]},{name:"Docker",slug:"docker",category:"hosting",signals:[{type:"file",pattern:"Dockerfile"},{type:"file",pattern:"docker-compose.yml"}]},{name:"Cloudflare Workers",slug:"cloudflare",category:"hosting",signals:[{type:"file",pattern:"wrangler.toml"},{type:"dependency",key:"wrangler"}]},{name:"GitHub Actions",slug:"github-actions",category:"cicd",signals:[{type:"file",pattern:".github/workflows/*.yml"}]},{name:"Commander.js",slug:"commander",category:"cli",signals:[{type:"dependency",key:"commander"}]}]});import{existsSync as P,readFileSync as Q0,readdirSync as R1}from"fs";import{join as C}from"path";function P0($){let X=C($,"package.json");if(!P(X))return null;try{return JSON.parse(Q0(X,"utf-8"))}catch{return null}}function A1($){let X=P0($);if(X?.name)return{name:X.name,description:X.description};let J=C($,"pyproject.toml");if(P(J))try{let q=Q0(J,"utf-8"),Y=q.match(/^\s*name\s*=\s*"([^"]+)"/m),z=q.match(/^\s*description\s*=\s*"([^"]+)"/m);if(Y)return{name:Y[1],description:z?.[1]}}catch{}let Q=C($,"Cargo.toml");if(P(Q))try{let q=Q0(Q,"utf-8"),Y=q.match(/^\s*name\s*=\s*"([^"]+)"/m),z=q.match(/^\s*description\s*=\s*"([^"]+)"/m);if(Y)return{name:Y[1],description:z?.[1]}}catch{}return null}function _N($,X){if(!X.includes("*"))return P(C($,X));let J=X.split("/");if(J.length===1){let G=X.split("*")[0];try{return R1($).some((W)=>W.startsWith(G))}catch{return!1}}let Q=C($,...J.slice(0,-1)),q=J[J.length-1],Y=q.split("*")[0],z=q.split("*")[1]||"";try{return R1(Q).some((G)=>G.startsWith(Y)&&G.endsWith(z))}catch{return!1}}function FN($){let X=C($,"go.mod");if(!P(X))return new Set;try{let J=Q0(X,"utf-8"),Q=new Set;for(let q of J.matchAll(/^\s*([\w./\-]+)\s+v[\d.]/gm))Q.add(q[1]);return Q}catch{return new Set}}function IN($,X,J){switch($.type){case"dependency":if(X?.dependencies?.[$.key])return!0;return FN(J).has($.key);case"devDependency":return!!X?.devDependencies?.[$.key];case"file":return _N(J,$.pattern);default:return!1}}function EN($){let X=C($,"pyproject.toml");if(!P(X))return{};try{let J=Q0(X,"utf-8"),Q={},q=J.match(/dependencies\s*=\s*\[([\s\S]*)\]/);if(q){let Y=q[1].match(/"([^"]+)"/g)||[];for(let z of Y){let G=z.replace(/"/g,"").replace(/\[.*/,"").split(/[>=<]/)[0].trim().toLowerCase();if(G)Q[G]="*"}}return Q}catch{return{}}}function TN($){let X=C($,"Cargo.toml");if(!P(X))return{};try{let J=Q0(X,"utf-8"),Q={},q=J.match(/\[dependencies\]([\s\S]*?)(?:\[|$)/);if(q){let Y=q[1].split(`
169
- `);for(let z of Y){let G=z.match(/^\s*([a-zA-Z_-]+)\s*=/);if(G)Q[G[1].toLowerCase()]="*"}}return Q}catch{return{}}}function $7($){let X=P0($),J=EN($),Q=TN($),q={...J,...Q},Y=X?{...X,dependencies:{...X.dependencies,...q}}:Object.keys(q).length>0?{dependencies:q}:null,z=w1.map((H)=>{let V=H.signals.filter((B)=>IN(B,Y,$)).length/H.signals.length;return{name:H.name,slug:H.slug,category:H.category,confidence:V}}).filter((H)=>H.confidence>0).sort((H,U)=>U.confidence-H.confidence),G=new Set(z.map((H)=>H.slug)),W=new Set;if(G.has("nextjs"))W.add("react");if(G.has("nuxt"))W.add("vue");if(G.has("sveltekit"))W.add("svelte");return z.filter((H)=>!W.has(H.slug))}function _1($){let X=P0($);if(X?.devDependencies?.typescript||X?.dependencies?.typescript)return"TypeScript";if(P(C($,"tsconfig.json")))return"TypeScript";if(P(C($,"index.html"))||P(C($,"index.htm")))return"HTML";if(P(C($,"Cargo.toml")))return"Rust";if(P(C($,"go.mod")))return"Go";if(P(C($,"pyproject.toml"))||P(C($,"setup.py")))return"Python";if(P(C($,"Gemfile")))return"Ruby";if(P(C($,"pom.xml"))||P(C($,"build.gradle")))return"Java";if(P(C($,"Package.swift")))return"Swift";if(P(C($,"build.zig")))return"Zig";if(X)return"JavaScript";return"Unknown"}function F1($){let X=P0($),J=$7($);if(J.some((w)=>w.category==="mcp"))return"mcp";if(X?.bin)return"cli";let q=J.some((w)=>w.slug==="svelte"||w.slug==="sveltekit");if(X?.private===!0&&(P(C($,"pnpm-workspace.yaml"))||X?.workspaces!==void 0)&&q)return"framework";if(q)return"svelte";if(J.some((w)=>w.slug==="nextjs"||w.slug==="nuxt"))return"fullstack";let G=P(C($,"index.html"))||P(C($,"index.htm")),W=P(C($,"404.html"))||P(C($,"about.html"))||P(C($,"contact.html")),H=P(C($,"api")),U=P(C($,"vercel.json")),V=P(C($,"wrangler.toml"))||P(C($,"wrangler.jsonc"));if(H&&(G||U||V))return"api-platform";let B=J.some((w)=>w.category==="frontend"),D=J.some((w)=>w.category==="backend");if(B&&D)return"fullstack";if((G||W)&&!D)return"static-site";if(B)return"frontend";if(D)return"backend";if(X?.main&&!X?.bin)return"library";if(P(C($,"go.mod"))){let w=P(C($,"cmd")),M=P(C($,"main.go"));if((()=>{try{return Q0(C($,"go.mod"),"utf-8")}catch{return""}})().includes("github.com/spf13/cobra")||w&&M)return"cli";return"service"}if(P(C($,"Cargo.toml"))){let w=P(C($,"src/main.rs")),M=(()=>{try{return Q0(C($,"Cargo.toml"),"utf-8")}catch{return""}})(),N=M.includes("[[bin]]"),L=M.includes("command-line-utilities"),I=M.includes("clap")||M.includes("argh")||M.includes("structopt")||M.includes("lexopt");if(N||L||w&&I)return"cli";if(w)return"service";return"library"}if(P(C($,"pyproject.toml"))||P(C($,"requirements.txt"))){let w=(()=>{try{return Q0(C($,"pyproject.toml"),"utf-8")}catch{return""}})(),M=w.includes("console_scripts")||w.includes("[project.scripts]"),N=P(C($,"setup.py")),L=P(C($,"src"))||P(C($,"lib"));if(M)return"cli";if(N||L&&!P(C($,"app.py"))&&!P(C($,"main.py")))return"library";return"service"}return"service"}function I1($){if(P(C($,"bunfig.toml")))return"Bun";if(P(C($,"deno.json"))||P(C($,"deno.jsonc")))return"Deno";if(P0($))return"Node.js";if(P(C($,"Cargo.toml")))return"Rust";if(P(C($,"go.mod")))return"Go";return"Unknown"}function E1($){if(P(C($,"bun.lockb"))||P(C($,"bun.lock")))return"bun";if(P(C($,"pnpm-lock.yaml")))return"pnpm";if(P(C($,"yarn.lock")))return"yarn";if(P(C($,"package-lock.json")))return"npm";return"npm"}function T1($){if(P(C($,".github/workflows")))return"GitHub Actions";if(P(C($,".gitlab-ci.yml")))return"GitLab CI";if(P(C($,".circleci")))return"CircleCI";if(P(C($,"Jenkinsfile")))return"Jenkins";return null}function Z1($){if(P(C($,"vercel.json")))return"Vercel";if(P(C($,"netlify.toml")))return"Netlify";if(P(C($,"wrangler.toml")))return"Cloudflare";if(P(C($,"Dockerfile")))return"Docker";if(P(C($,"fly.toml")))return"Fly.io";if(P(C($,"render.yaml")))return"Render";return null}function S1($){let X=C($,"svelte.config.js");if(!P(X))return null;try{let Q=Q0(X,"utf-8").match(/@sveltejs\/adapter-(\w+)/);if(Q){let q=Q[1];switch(q){case"vercel":return"Vercel";case"node":return"Node";case"static":return"Static";case"cloudflare":return"Cloudflare";case"netlify":return"Netlify";case"auto":return"Auto";default:return q}}return null}catch{return null}}function j1($){let X=P0($);if(X?.devDependencies?.vite||X?.dependencies?.vite)return"Vite";if(X?.devDependencies?.webpack||X?.dependencies?.webpack)return"webpack";if(X?.devDependencies?.esbuild||X?.dependencies?.esbuild)return"esbuild";if(P(C($,"tsconfig.json"))&&X?.devDependencies?.typescript)return"TypeScript (tsc)";return null}var C1=g(()=>{L1()});function k8($){let X=P0($),J=$7($),Q=_1($),q=F1($),Y=I1($),z=E1($),G=T1($),W=Z1($),H=j1($),U=J.find((X$)=>X$.category==="frontend"),V=J.find((X$)=>X$.category==="css"),B=J.find((X$)=>X$.category==="ui"),D=J.find((X$)=>X$.category==="state"),w=J.find((X$)=>X$.category==="backend"),M=J.find((X$)=>X$.category==="database"),N=f8[q]||f8.library,L=q==="framework",I=J.some((X$)=>X$.slug==="svelte"||X$.slug==="sveltekit"),Z=L&&I?"svelte":L?null:null,y=q==="mcp",x=y?J.find((X$)=>X$.category==="mcp"):null,k=x?.slug??null,l=q==="svelte"||Z==="svelte",j=l?S1($):null,G$=l&&J.some((X$)=>X$.slug==="sveltekit"),t$=new Set(["css_framework","ui_library","database","connection","hosting"]),i={},V$=E$.filter((X$)=>X$.path.startsWith("stack."));for(let X$ of V$){let s=X$.path.replace("stack.","");if(!N.includes(X$.category)){i[s]="slotignored";continue}if(L&&t$.has(s)){i[s]="slotignored";continue}switch(s){case"frontend":if(q==="static-site")i[s]="Vanilla HTML";else i[s]=U?.name??(q==="cli"?"CLI":"");break;case"css_framework":if(q==="static-site")i[s]="Vanilla CSS";else i[s]=V?.name??"";break;case"ui_library":if(q==="static-site")i[s]="Vanilla JS";else i[s]=B?.name??"";break;case"state_management":i[s]=l?D?.name??"Runes":D?.name??"";break;case"backend":if(y&&x)i[s]=x.name;else if(q==="static-site")i[s]="Static";else if(l)i[s]=G$?"SvelteKit":w?.name??"";else i[s]=w?.name??"";break;case"api_type":if(y)i[s]="MCP (stdio/SSE)";else if(G$)i[s]="Server Routes";else i[s]="";break;case"runtime":if(q==="static-site")i[s]="Browser";else i[s]=Y!=="Unknown"?Y:"";break;case"database":i[s]=M?.name??"";break;case"connection":i[s]=M?.name??"";break;case"hosting":if(l&&j)i[s]=j;else if(q==="static-site"&&W)i[s]=`${W} (detected)`;else i[s]=W??"";break;case"build":i[s]=l?"Vite":H??"";break;case"cicd":if(q==="static-site"&&G)i[s]=`${G} (detected)`;else i[s]=G??"";break;case"package_manager":i[s]=z;break;default:i[s]="";break}}let w8={},G3=E$.filter((X$)=>X$.path.startsWith("monorepo."));for(let X$ of G3){let s=X$.path.replace("monorepo.","");if(!N.includes(X$.category))w8[s]="slotignored";else w8[s]=""}let x9=A1($),TX={name:x9?.name??$.split("/").pop()??"project",goal:x9?.description??"",main_language:Q,type:q};if(L&&Z)TX.framework=Z;if(y&&k)TX.framework=k;return{faf_version:"3.0",project:TX,stack:i,human_context:{who:"",what:X?.description??"",why:"",where:"",when:"",how:""},monorepo:w8}}var g5=g(()=>{B0();C1()});var f1={};SX(f1,{autoCommand:()=>X7});import{existsSync as SN}from"fs";import{join as jN}from"path";function X7(){let $=process.cwd(),X=jN($,"project.faf"),J=k8($);if(SN(X)){let Y=$$(X),z=b1(Y,J);Q$(X,z),console.log(`${A("updated")} ${X}`)}else{let Y=J.project?.type??"library",z=f8[Y]||f8.library;for(let G of E$)if(!z.includes(G.category)){let[W,H]=G.path.split(".");if(W==="stack"&&J.stack)J.stack[H]="slotignored";if(W==="monorepo"&&J.monorepo)J.monorepo[H]="slotignored"}Q$(X,J),console.log(`${A("created")} ${X}`)}let Q=o(X),q=U$(H$(Q));if(N$(q,X),q.score<100)console.log(O(`
170
- run ${S("'faf go'")} to reach 100%`))}function b1($,X){let J={...$};for(let[Q,q]of Object.entries(X))if(!(Q in J)||J[Q]===null||J[Q]===void 0)J[Q]=q;else if(typeof q==="object"&&q!==null&&!Array.isArray(q))J[Q]=b1(J[Q]??{},q);return J}var J7=g(()=>{g5();B$();l$();J0();e();B0()});var o1=_((v_,QD)=>{QD.exports={name:"faf-cli",version:"6.2.0",description:"51,582+ downloads | Claude Code Skills | Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-approved.",type:"module",icon:"https://faf.one/orange-smiley.svg",logo:"https://faf.one/orange-smiley.svg",main:"dist/index.js",bin:{faf:"dist/cli.js","faf-cli":"dist/cli.js"},exports:{".":{bun:"./src/index.ts",default:"./dist/index.js"}},files:["dist/**/*","skills/**/*","README.md","LICENSE","project.faf"],scripts:{dev:"bun run src/cli.ts",build:"bun build src/cli.ts --outfile dist/cli.js --target=node --minify && bun build src/index.ts --outfile dist/index.js --target=node --minify",compile:"bun build src/cli.ts --compile --bytecode --minify --outfile faf","compile:all":"bun build src/cli.ts --compile --target=bun-darwin-arm64 --outfile faf-darwin-arm64 && bun build src/cli.ts --compile --target=bun-darwin-x64 --outfile faf-darwin-x64 && bun build src/cli.ts --compile --target=bun-linux-x64 --outfile faf-linux-x64 && bun build src/cli.ts --compile --target=bun-windows-x64 --outfile faf-windows-x64.exe",test:"bun test","test:watch":"bun test --watch",lint:"eslint src/**/*.ts",format:"prettier --write 'src/**/*.ts'",prepublishOnly:"bun run build","test:coverage":"bun test --coverage",typecheck:"bun --bun tsc --noEmit"},keywords:["faf","ai-context","project-dna","bi-sync","cli","claude","gemini","cursor","mcp","model-context-protocol","persistent-context","ai-readiness","foundational"],author:"wolfejam <wolfejam@faf.one>",license:"MIT",repository:{type:"git",url:"git+https://github.com/Wolfe-Jam/faf-cli.git"},homepage:"https://faf.one",bugs:{url:"https://github.com/Wolfe-Jam/faf-cli/issues"},dependencies:{commander:"^14.0.3","faf-scoring-kernel":"^2.0.3",open:"8.4.2",yaml:"^2.8.3",zod:"^3.25.76"},optionalDependencies:{"@anthropic-ai/sdk":"^0.74.0"},devDependencies:{"@types/node":"^22.19.17","@typescript-eslint/eslint-plugin":"^8.58.0","@typescript-eslint/parser":"^8.58.0",eslint:"^9.39.4",prettier:"^3.8.1",typescript:"^5.9.3","typescript-eslint":"^8.58.0"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});var V7=_((FF,Uq)=>{var Hq=W$("fs"),U7;function BD(){try{return Hq.statSync("/.dockerenv"),!0}catch($){return!1}}function KD(){try{return Hq.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch($){return!1}}Uq.exports=()=>{if(U7===void 0)U7=BD()||KD();return U7}});var Kq=_((IF,B7)=>{var MD=W$("os"),ND=W$("fs"),Vq=V7(),Bq=()=>{if(process.platform!=="linux")return!1;if(MD.release().toLowerCase().includes("microsoft")){if(Vq())return!1;return!0}try{return ND.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Vq():!1}catch($){return!1}};if(process.env.__IS_WSL_TEST__)B7.exports=Bq;else B7.exports=Bq()});var Nq=_((EF,Mq)=>{Mq.exports=($,X,J)=>{let Q=(q)=>Object.defineProperty($,X,{value:q,enumerable:!0,writable:!0});return Object.defineProperty($,X,{configurable:!0,enumerable:!0,get(){let q=J();return Q(q),q},set(q){Q(q)}}),$}});var _q=_((TF,Aq)=>{var __dirname="/Users/wolfejam/FAF/cli/node_modules/open",DD=W$("path"),OD=W$("child_process"),{promises:l5,constants:Rq}=W$("fs"),m5=Kq(),wD=V7(),M7=Nq(),Dq=DD.join(__dirname,"xdg-open"),{platform:x8,arch:Oq}=process,LD=()=>{try{return l5.statSync("/run/.containerenv"),!0}catch{return!1}},K7;function RD(){if(K7===void 0)K7=LD()||wD();return K7}var AD=(()=>{let X;return async function(){if(X)return X;let J="/etc/wsl.conf",Q=!1;try{await l5.access(J,Rq.F_OK),Q=!0}catch{}if(!Q)return"/mnt/";let q=await l5.readFile(J,{encoding:"utf8"}),Y=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(q);if(!Y)return"/mnt/";return X=Y.groups.mountPoint.trim(),X=X.endsWith("/")?X:`${X}/`,X}})(),wq=async($,X)=>{let J;for(let Q of $)try{return await X(Q)}catch(q){J=q}throw J},c5=async($)=>{if($={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...$},Array.isArray($.app))return wq($.app,(G)=>c5({...$,app:G}));let{name:X,arguments:J=[]}=$.app||{};if(J=[...J],Array.isArray(X))return wq(X,(G)=>c5({...$,app:{name:G,arguments:J}}));let Q,q=[],Y={};if(x8==="darwin"){if(Q="open",$.wait)q.push("--wait-apps");if($.background)q.push("--background");if($.newInstance)q.push("--new");if(X)q.push("-a",X)}else if(x8==="win32"||m5&&!RD()&&!X){let G=await AD();if(Q=m5?`${G}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,q.push("-NoProfile","-NonInteractive","–ExecutionPolicy","Bypass","-EncodedCommand"),!m5)Y.windowsVerbatimArguments=!0;let W=["Start"];if($.wait)W.push("-Wait");if(X){if(W.push(`"\`"${X}\`""`,"-ArgumentList"),$.target)J.unshift($.target)}else if($.target)W.push(`"${$.target}"`);if(J.length>0)J=J.map((H)=>`"\`"${H}\`""`),W.push(J.join(","));$.target=Buffer.from(W.join(" "),"utf16le").toString("base64")}else{if(X)Q=X;else{let G=!__dirname||__dirname==="/",W=!1;try{await l5.access(Dq,Rq.X_OK),W=!0}catch{}Q=process.versions.electron||x8==="android"||G||!W?"xdg-open":Dq}if(J.length>0)q.push(...J);if(!$.wait)Y.stdio="ignore",Y.detached=!0}if($.target)q.push($.target);if(x8==="darwin"&&J.length>0)q.push("--args",...J);let z=OD.spawn(Q,q,Y);if($.wait)return new Promise((G,W)=>{z.once("error",W),z.once("close",(H)=>{if(!$.allowNonzeroExitCode&&H>0){W(Error(`Exited with code ${H}`));return}G(z)})});return z.unref(),z},N7=($,X)=>{if(typeof $!=="string")throw TypeError("Expected a `target`");return c5({...X,target:$})},_D=($,X)=>{if(typeof $!=="string")throw TypeError("Expected a `name`");let{arguments:J=[]}=X||{};if(J!==void 0&&J!==null&&!Array.isArray(J))throw TypeError("Expected `appArguments` as Array type");return c5({...X,app:{name:$,arguments:J}})};function Lq($){if(typeof $==="string"||Array.isArray($))return $;let{[Oq]:X}=$;if(!X)throw Error(`${Oq} is not supported`);return X}function D7({[x8]:$},{wsl:X}){if(X&&m5)return Lq(X);if(!$)throw Error(`${x8} is not supported`);return Lq($)}var p5={};M7(p5,"chrome",()=>D7({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));M7(p5,"firefox",()=>D7({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));M7(p5,"edge",()=>D7({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));N7.apps=p5;N7.openApp=_D;Aq.exports=N7});function E($,X,J,Q,q){if(Q==="m")throw TypeError("Private method is not writable");if(Q==="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 Q==="a"?q.call($,J):q?q.value=J:X.set($,J),J}function K($,X,J,Q){if(J==="a"&&!Q)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!Q:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return J==="m"?Q:J==="a"?Q.call($):Q?Q.value:X.get($)}var K0=()=>{};var O7=function(){let{crypto:$}=globalThis;if($?.randomUUID)return O7=$.randomUUID.bind($),$.randomUUID();let X=new Uint8Array(1),J=$?()=>$.getRandomValues(X)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(Q)=>(+Q^J()&15>>+Q/4).toString(16))};function M0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var $2=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let X=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)X.stack=$.stack;if($.cause&&!X.cause)X.cause=$.cause;if($.name)X.name=$.name;return X}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};var b,O$,_$,f0,y8,g8,v8,h8,u8,m8,l8,c8,p8;var j$=g(()=>{b=class b extends Error{};O$=class O$ extends b{constructor($,X,J,Q){super(`${O$.makeMessage($,X,J)}`);this.status=$,this.headers=Q,this.requestID=Q?.get("request-id"),this.error=X}static makeMessage($,X,J){let Q=X?.message?typeof X.message==="string"?X.message:JSON.stringify(X.message):X?JSON.stringify(X):J;if($&&Q)return`${$} ${Q}`;if($)return`${$} status code (no body)`;if(Q)return Q;return"(no status code or body)"}static generate($,X,J,Q){if(!$||!Q)return new f0({message:J,cause:$2(X)});let q=X;if($===400)return new g8($,q,J,Q);if($===401)return new v8($,q,J,Q);if($===403)return new h8($,q,J,Q);if($===404)return new u8($,q,J,Q);if($===409)return new m8($,q,J,Q);if($===422)return new l8($,q,J,Q);if($===429)return new c8($,q,J,Q);if($>=500)return new p8($,q,J,Q);return new O$($,q,J,Q)}};_$=class _$ extends O${constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};f0=class f0 extends O${constructor({message:$,cause:X}){super(void 0,void 0,$||"Connection error.",void 0);if(X)this.cause=X}};y8=class y8 extends f0{constructor({message:$}={}){super({message:$??"Request timed out."})}};g8=class g8 extends O${};v8=class v8 extends O${};h8=class h8 extends O${};u8=class u8 extends O${};m8=class m8 extends O${};l8=class l8 extends O${};c8=class c8 extends O${};p8=class p8 extends O${}});function d5($){if(typeof $!=="object")return{};return $??{}}function Cq($){if(!$)return!0;for(let X in $)return!1;return!0}function Pq($,X){return Object.prototype.hasOwnProperty.call($,X)}var fD,jq=($)=>{return fD.test($)},w7=($)=>(w7=Array.isArray,w7($)),L7,bq=($,X)=>{if(typeof X!=="number"||!Number.isInteger(X))throw new b(`${$} must be an integer`);if(X<0)throw new b(`${$} must be a positive integer`);return X},i5=($)=>{try{return JSON.parse($)}catch(X){return}};var Y8=g(()=>{j$();fD=/^[a-z][a-z0-9+.-]*:/i,L7=w7});var fq=($)=>new Promise((X)=>setTimeout(X,$));var k0="0.74.0";function kD(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}function yD(){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:J}of $){let Q=J.exec(navigator.userAgent);if(Q){let q=Q[1]||0,Y=Q[2]||0,z=Q[3]||0;return{browser:X,version:`${q}.${Y}.${z}`}}}return null}var gq=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},xD=()=>{let $=kD();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":k0,"X-Stainless-OS":xq(Deno.build.os),"X-Stainless-Arch":kq(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":k0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":k0,"X-Stainless-OS":xq(globalThis.process.platform??"unknown"),"X-Stainless-Arch":kq(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let X=yD();if(X)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":k0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${X.browser}`,"X-Stainless-Runtime-Version":X.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":k0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},kq=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},xq=($)=>{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"},yq,vq=()=>{return yq??(yq=xD())};var R7=()=>{};function hq(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function A7(...$){let X=globalThis.ReadableStream;if(typeof X>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new X(...$)}function n5($){let X=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return A7({start(){},async pull(J){let{done:Q,value:q}=await X.next();if(Q)J.close();else J.enqueue(q)},async cancel(){await X.return?.()}})}function X2($){if($[Symbol.asyncIterator])return $;let X=$.getReader();return{async next(){try{let J=await X.read();if(J?.done)X.releaseLock();return J}catch(J){throw X.releaseLock(),J}},async return(){let J=X.cancel();return X.releaseLock(),await J,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function uq($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let X=$.getReader(),J=X.cancel();X.releaseLock(),await J}var mq=({headers:$,body:X})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(X)}};function pq($){let X=0;for(let q of $)X+=q.length;let J=new Uint8Array(X),Q=0;for(let q of $)J.set(q,Q),Q+=q.length;return J}function J2($){let X;return(lq??(X=new globalThis.TextEncoder,lq=X.encode.bind(X)))($)}function _7($){let X;return(cq??(X=new globalThis.TextDecoder,cq=X.decode.bind(X)))($)}var lq,cq;class x0{constructor(){C$.set(this,void 0),P$.set(this,void 0),E(this,C$,new Uint8Array,"f"),E(this,P$,null,"f")}decode($){if($==null)return[];let X=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?J2($):$;E(this,C$,pq([K(this,C$,"f"),X]),"f");let J=[],Q;while((Q=hD(K(this,C$,"f"),K(this,P$,"f")))!=null){if(Q.carriage&&K(this,P$,"f")==null){E(this,P$,Q.index,"f");continue}if(K(this,P$,"f")!=null&&(Q.index!==K(this,P$,"f")+1||Q.carriage)){J.push(_7(K(this,C$,"f").subarray(0,K(this,P$,"f")-1))),E(this,C$,K(this,C$,"f").subarray(K(this,P$,"f")),"f"),E(this,P$,null,"f");continue}let q=K(this,P$,"f")!==null?Q.preceding-1:Q.preceding,Y=_7(K(this,C$,"f").subarray(0,q));J.push(Y),E(this,C$,K(this,C$,"f").subarray(Q.index),"f"),E(this,P$,null,"f")}return J}flush(){if(!K(this,C$,"f").length)return[];return this.decode(`
171
- `)}}function hD($,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 dq($){for(let Q=0;Q<$.length-1;Q++){if($[Q]===10&&$[Q+1]===10)return Q+2;if($[Q]===13&&$[Q+1]===13)return Q+2;if($[Q]===13&&$[Q+1]===10&&Q+3<$.length&&$[Q+2]===13&&$[Q+3]===10)return Q+4}return-1}var C$,P$;var F7=g(()=>{K0();C$=new WeakMap,P$=new WeakMap;x0.NEWLINE_CHARS=new Set([`
172
- `,"\r"]);x0.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function Q2(){}function r5($,X,J){if(!X||s5[$]>s5[J])return Q2;else return X[$].bind(X)}function R$($){let X=$.logger,J=$.logLevel??"off";if(!X)return uD;let Q=iq.get(X);if(Q&&Q[0]===J)return Q[1];let q={error:r5("error",X,J),warn:r5("warn",X,J),info:r5("info",X,J),debug:r5("debug",X,J)};return iq.set(X,[J,q]),q}var s5,I7=($,X,J)=>{if(!$)return;if(Pq(s5,$))return $;R$(J).warn(`${X} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(s5))}`);return},uD,iq,N0=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([X,J])=>[X,X.toLowerCase()==="x-api-key"||X.toLowerCase()==="authorization"||X.toLowerCase()==="cookie"||X.toLowerCase()==="set-cookie"?"***":J]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var a5=g(()=>{Y8();s5={off:0,error:200,warn:300,info:400,debug:500};uD={error:Q2,warn:Q2,info:Q2,debug:Q2},iq=new WeakMap});async function*mD($,X){if(!$.body){if(X.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new b("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new b("Attempted to iterate over a response with no body")}let J=new nq,Q=new x0,q=X2($.body);for await(let Y of lD(q))for(let z of Q.decode(Y)){let G=J.decode(z);if(G)yield G}for(let Y of Q.flush()){let z=J.decode(Y);if(z)yield z}}async function*lD($){let X=new Uint8Array;for await(let J of $){if(J==null)continue;let Q=J instanceof ArrayBuffer?new Uint8Array(J):typeof J==="string"?J2(J):J,q=new Uint8Array(X.length+Q.length);q.set(X),q.set(Q,X.length),X=q;let Y;while((Y=dq(X))!==-1)yield X.slice(0,Y),X=X.slice(Y)}if(X.length>0)yield X}class nq{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(`
173
- `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],q}if(this.chunks.push($),$.startsWith(":"))return null;let[X,J,Q]=cD($,":");if(Q.startsWith(" "))Q=Q.substring(1);if(X==="event")this.event=Q;else if(X==="data")this.data.push(Q);return null}}function cD($,X){let J=$.indexOf(X);if(J!==-1)return[$.substring(0,J),X,$.substring(J+X.length)];return[$,"",""]}var q2,b$;var E7=g(()=>{K0();j$();F7();Y8();a5();j$();b$=class b${constructor($,X,J){this.iterator=$,q2.set(this,void 0),this.controller=X,E(this,q2,J,"f")}static fromSSEResponse($,X,J){let Q=!1,q=J?R$(J):console;async function*Y(){if(Q)throw new b("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Q=!0;let z=!1;try{for await(let G of mD($,X)){if(G.event==="completion")try{yield JSON.parse(G.data)}catch(W){throw q.error("Could not parse message into JSON:",G.data),q.error("From chunk:",G.raw),W}if(G.event==="message_start"||G.event==="message_delta"||G.event==="message_stop"||G.event==="content_block_start"||G.event==="content_block_delta"||G.event==="content_block_stop")try{yield JSON.parse(G.data)}catch(W){throw q.error("Could not parse message into JSON:",G.data),q.error("From chunk:",G.raw),W}if(G.event==="ping")continue;if(G.event==="error")throw new O$(void 0,i5(G.data)??G.data,void 0,$.headers)}z=!0}catch(G){if(M0(G))return;throw G}finally{if(!z)X.abort()}}return new b$(Y,X,J)}static fromReadableStream($,X,J){let Q=!1;async function*q(){let z=new x0,G=X2($);for await(let W of G)for(let H of z.decode(W))yield H;for(let W of z.flush())yield W}async function*Y(){if(Q)throw new b("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Q=!0;let z=!1;try{for await(let G of q()){if(z)continue;if(G)yield JSON.parse(G)}z=!0}catch(G){if(M0(G))return;throw G}finally{if(!z)X.abort()}}return new b$(Y,X,J)}[(q2=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],X=[],J=this.iterator(),Q=(q)=>{return{next:()=>{if(q.length===0){let Y=J.next();$.push(Y),X.push(Y)}return q.shift()}}};return[new b$(()=>Q($),this.controller,K(this,q2,"f")),new b$(()=>Q(X),this.controller,K(this,q2,"f"))]}toReadableStream(){let $=this,X;return A7({async start(){X=$[Symbol.asyncIterator]()},async pull(J){try{let{value:Q,done:q}=await X.next();if(q)return J.close();let Y=J2(JSON.stringify(Q)+`
174
- `);J.enqueue(Y)}catch(Q){J.error(Q)}},async cancel(){await X.return?.()}})}}});async function o5($,X){let{response:J,requestLogID:Q,retryOfRequestLogID:q,startTime:Y}=X,z=await(async()=>{if(X.options.stream){if(R$($).debug("response",J.status,J.url,J.headers,J.body),X.options.__streamClass)return X.options.__streamClass.fromSSEResponse(J,X.controller);return b$.fromSSEResponse(J,X.controller)}if(J.status===204)return null;if(X.options.__binaryResponse)return J;let W=J.headers.get("content-type")?.split(";")[0]?.trim();if(W?.includes("application/json")||W?.endsWith("+json")){if(J.headers.get("content-length")==="0")return;let B=await J.json();return T7(B,J)}return await J.text()})();return R$($).debug(`[${Q}] response parsed`,N0({retryOfRequestLogID:q,url:J.url,status:J.status,body:z,durationMs:Date.now()-Y})),z}function T7($,X){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:X.headers.get("request-id"),enumerable:!1})}var Z7=g(()=>{E7();a5()});var Y2,y0;var t5=g(()=>{K0();Z7();y0=class y0 extends Promise{constructor($,X,J=o5){super((Q)=>{Q(null)});this.responsePromise=X,this.parseResponse=J,Y2.set(this,void 0),E(this,Y2,$,"f")}_thenUnwrap($){return new y0(K(this,Y2,"f"),this.responsePromise,async(X,J)=>T7($(await this.parseResponse(X,J),J),J.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(K(this,Y2,"f"),$));return this.parsedPromise}then($,X){return this.parse().then($,X)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};Y2=new WeakMap});var e5,S7,z2,p$,G2;var q0=g(()=>{K0();j$();Z7();t5();Y8();S7=class S7{constructor($,X,J,Q){e5.set(this,void 0),E(this,e5,$,"f"),this.options=Q,this.response=X,this.body=J}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let $=this.nextPageRequestOptions();if(!$)throw new b("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await K(this,e5,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(e5=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let X of $.getPaginatedItems())yield X}};z2=class z2 extends y0{constructor($,X,J){super($,X,async(Q,q)=>new J(Q,q.response,await o5(Q,q),q.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let X of $)yield X}};p$=class p$ extends S7{constructor($,X,J,Q){super($,X,J,Q);this.data=J.data||[],this.has_more=J.has_more||!1,this.first_id=J.first_id||null,this.last_id=J.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let X=this.first_id;if(!X)return null;return{...this.options,query:{...d5(this.options.query),before_id:X}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...d5(this.options.query),after_id:$}}}};G2=class G2 extends S7{constructor($,X,J,Q){super($,X,J,Q);this.data=J.data||[],this.has_more=J.has_more||!1,this.next_page=J.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let $=this.next_page;if(!$)return null;return{...this.options,query:{...d5(this.options.query),page:$}}}}});function z8($,X,J){return C7(),new File($,X??"unknown_file",J)}function W2($,X){let J=typeof $==="object"&&$!==null&&(("name"in $)&&$.name&&String($.name)||("url"in $)&&$.url&&String($.url)||("filename"in $)&&$.filename&&String($.filename)||("path"in $)&&$.path&&String($.path))||"";return X?J.split(/[\\/]/).pop()||void 0:J}function dD($){let X=typeof $==="function"?$:$.fetch,J=rq.get(X);if(J)return J;let Q=(async()=>{try{let q="Response"in X?X.Response:(await X("data:,")).constructor,Y=new FormData;if(Y.toString()===await new q(Y).text())return!1;return!0}catch{return!0}})();return rq.set(X,Q),Q}var C7=()=>{if(typeof File>"u"){let{process:$}=globalThis,X=typeof $?.versions?.node==="string"&&parseInt($.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(X?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},P7=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",d8=async($,X,J=!0)=>{return{...$,body:await iD($.body,X,J)}},rq,iD=async($,X,J=!0)=>{if(!await dD(X))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let Q=new FormData;return await Promise.all(Object.entries($||{}).map(([q,Y])=>j7(Q,q,Y,J))),Q},nD=($)=>$ instanceof Blob&&("name"in $),j7=async($,X,J,Q)=>{if(J===void 0)return;if(J==null)throw TypeError(`Received null for "${X}"; to pass null in FormData, you must use the string 'null'`);if(typeof J==="string"||typeof J==="number"||typeof J==="boolean")$.append(X,String(J));else if(J instanceof Response){let q={},Y=J.headers.get("Content-Type");if(Y)q={type:Y};$.append(X,z8([await J.blob()],W2(J,Q),q))}else if(P7(J))$.append(X,z8([await new Response(n5(J)).blob()],W2(J,Q)));else if(nD(J))$.append(X,z8([J],W2(J,Q),{type:J.type}));else if(Array.isArray(J))await Promise.all(J.map((q)=>j7($,X+"[]",q,Q)));else if(typeof J==="object")await Promise.all(Object.entries(J).map(([q,Y])=>j7($,`${X}[${q}]`,Y,Q)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${J} instead`)};var i8=g(()=>{rq=new WeakMap});async function H2($,X,J){if(C7(),$=await $,X||(X=W2($,!0)),rD($)){if($ instanceof File&&X==null&&J==null)return $;return z8([await $.arrayBuffer()],X??$.name,{type:$.type,lastModified:$.lastModified,...J})}if(sD($)){let q=await $.blob();return X||(X=new URL($.url).pathname.split(/[\\/]/).pop()),z8(await b7(q),X,J)}let Q=await b7($);if(!J?.type){let q=Q.find((Y)=>typeof Y==="object"&&("type"in Y)&&Y.type);if(typeof q==="string")J={...J,type:q}}return z8(Q,X,J)}async function b7($){let X=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)X.push($);else if(sq($))X.push($ instanceof Blob?$:await $.arrayBuffer());else if(P7($))for await(let J of $)X.push(...await b7(J));else{let J=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${J?`; constructor: ${J}`:""}${aD($)}`)}return X}function aD($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((J)=>`"${J}"`).join(", ")}]`}var sq=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",rD=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&sq($),sD=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var aq=g(()=>{i8();i8()});var f7=g(()=>{aq()});var oq=()=>{};class q${constructor($){this._client=$}}function*tD($){if(!$)return;if(tq in $){let{values:Q,nulls:q}=$;yield*Q.entries();for(let Y of q)yield[Y,null];return}let X=!1,J;if($ instanceof Headers)J=$.entries();else if(L7($))J=$;else X=!0,J=Object.entries($??{});for(let Q of J){let q=Q[0];if(typeof q!=="string")throw TypeError("expected header name to be a string");let Y=L7(Q[1])?Q[1]:[Q[1]],z=!1;for(let G of Y){if(G===void 0)continue;if(X&&!z)z=!0,yield[q,null];yield[q,G]}}}var tq,u=($)=>{let X=new Headers,J=new Set;for(let Q of $){let q=new Set;for(let[Y,z]of tD(Q)){let G=Y.toLowerCase();if(!q.has(G))X.delete(Y),q.add(G);if(z===null)X.delete(Y),J.add(G);else X.append(Y,z),J.delete(G)}}return{[tq]:!0,values:X,nulls:J}};var f$=g(()=>{Y8();tq=Symbol.for("brand.privateNullableHeaders")});function $X($){return typeof $==="object"&&$!==null&&U2 in $}function k7($,X){let J=new Set;if($){for(let Q of $)if($X(Q))J.add(Q[U2])}if(X)for(let Q of X){if($X(Q))J.add(Q[U2]);if(Array.isArray(Q.content)){for(let q of Q.content)if($X(q))J.add(q[U2])}}return Array.from(J)}function XX($,X){let J=k7($,X);if(J.length===0)return{};return{"x-stainless-helper":J.join(", ")}}function eq($){if($X($))return{"x-stainless-helper":$[U2]};return{}}var U2;var V2=g(()=>{U2=Symbol("anthropic.sdk.stainlessHelper")});function XY($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var $Y,eD=($=XY)=>function(J,...Q){if(J.length===1)return J[0];let q=!1,Y=[],z=J.reduce((U,V,B)=>{if(/[?#]/.test(V))q=!0;let D=Q[B],w=(q?encodeURIComponent:$)(""+D);if(B!==Q.length&&(D==null||typeof D==="object"&&D.toString===Object.getPrototypeOf(Object.getPrototypeOf(D.hasOwnProperty??$Y)??$Y)?.toString))w=D+"",Y.push({start:U.length+V.length,length:w.length,error:`Value of type ${Object.prototype.toString.call(D).slice(8,-1)} is not a valid path parameter`});return U+V+(B===Q.length?"":w)},""),G=z.split(/[?#]/,1)[0],W=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,H;while((H=W.exec(G))!==null)Y.push({start:H.index,length:H[0].length,error:`Value "${H[0]}" can't be safely passed as a path parameter`});if(Y.sort((U,V)=>U.start-V.start),Y.length>0){let U=0,V=Y.reduce((B,D)=>{let w=" ".repeat(D.start-U),M="^".repeat(D.length);return U=D.start+D.length,B+w+M},"");throw new b(`Path parameters result in path with invalid segments:
168
+ `)}return X7}function q$($){return JSON.parse(r6().score_faf($))}function Dq($){return r6().validate_faf($)}function Oq($){return r6().compile_fafb($)}function wq($){return JSON.parse(r6().decompile_fafb($))}function Lq(){return r6().sdk_version()}var X7=null;var J7=($)=>(X)=>`\x1B[${$}m${X}\x1B[0m`,S,O,dR,A=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,Q8=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var e=g(()=>{S=J7("1"),O=J7("2"),dR=J7("3")});function h5($){return $.indicator}function Rq($){for(let X of s6)if($>=X.threshold)return X;return s6[s6.length-1]}var s6;var a6=g(()=>{e();s6=[{name:"TROPHY",indicator:`${Q8("\uD83C\uDFC6")} ${Q8("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${Q8(S("★"))} ${Q8("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${A("◆")} ${A("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${A("◇")} ${A("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${S("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${O("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${O("○")} RED`,threshold:1},{name:"WHITE",indicator:`${O("♡")}`,threshold:0}]});function Y$($){return{score:$.score,tier:Rq($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}var l$=g(()=>{a6()});function N$($,X,J=!1){let Q=h5($.tier),q=S(`${$.score}%`);if(console.log(`${Q} ${q} ${O(`${$.populated}/${$.active} slots`)} ${O("—")} ${X}`),$.tier.name!=="TROPHY"&&$.empty>0)console.log(O(` ${$.empty} empty`));if(J)console.log(""),EN($)}function EN($){for(let[X,J]of Object.entries($.slots)){let Q=J==="populated"?A("●"):J==="slotignored"?O("—"):O("○");console.log(` ${Q} ${J==="slotignored"?O(X):X}`)}}var J0=g(()=>{a6();e()});function D$($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return ZN.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var E$,GA,WA,ZN,k8;var K0=g(()=>{E$=[{index:1,path:"project.name",description:"Project name",category:"project"},{index:2,path:"project.goal",description:"What the project does",category:"project"},{index:3,path:"project.main_language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",description:"Who is building this",category:"human"},{index:5,path:"human_context.what",description:"What are they building",category:"human"},{index:6,path:"human_context.why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",description:"State management",category:"frontend"},{index:14,path:"stack.backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",description:"Database",category:"backend"},{index:18,path:"stack.connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",description:"Remote build cache",category:"enterprise_ops"}],GA=new Map(E$.map(($)=>[$.path,$])),WA=E$.filter(($)=>$.index<=21),ZN=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);k8={cli:["project","human"],library:["project","human"],"static-site":["project","frontend","human"],mcp:["project","backend","universal","human"],backend:["project","backend","universal","human"],"data-science":["project","backend","human"],frontend:["project","frontend","human"],"api-platform":["project","frontend","backend","universal","human"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],framework:["project","frontend","backend","universal","human"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]}});var Aq;var _q=g(()=>{Aq=[{name:"Next.js",slug:"nextjs",category:"frontend",signals:[{type:"dependency",key:"next"},{type:"file",pattern:"next.config.*"}]},{name:"React",slug:"react",category:"frontend",signals:[{type:"dependency",key:"react"}]},{name:"SvelteKit",slug:"sveltekit",category:"frontend",signals:[{type:"dependency",key:"@sveltejs/kit"},{type:"file",pattern:"svelte.config.*"}]},{name:"Svelte",slug:"svelte",category:"frontend",signals:[{type:"dependency",key:"svelte"},{type:"devDependency",key:"svelte"}]},{name:"Vue.js",slug:"vue",category:"frontend",signals:[{type:"dependency",key:"vue"}]},{name:"Nuxt",slug:"nuxt",category:"frontend",signals:[{type:"dependency",key:"nuxt"},{type:"file",pattern:"nuxt.config.*"}]},{name:"Angular",slug:"angular",category:"frontend",signals:[{type:"dependency",key:"@angular/core"},{type:"file",pattern:"angular.json"}]},{name:"Astro",slug:"astro",category:"frontend",signals:[{type:"dependency",key:"astro"},{type:"file",pattern:"astro.config.*"}]},{name:"Solid",slug:"solid",category:"frontend",signals:[{type:"dependency",key:"solid-js"}]},{name:"Remix",slug:"remix",category:"frontend",signals:[{type:"dependency",key:"@remix-run/react"}]},{name:"Gatsby",slug:"gatsby",category:"frontend",signals:[{type:"dependency",key:"gatsby"},{type:"file",pattern:"gatsby-config.*"}]},{name:"Qwik",slug:"qwik",category:"frontend",signals:[{type:"dependency",key:"@builder.io/qwik"}]},{name:"Vercel (SvelteKit)",slug:"adapter-vercel",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-vercel"},{type:"devDependency",key:"@sveltejs/adapter-vercel"}]},{name:"Node (SvelteKit)",slug:"adapter-node",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-node"},{type:"devDependency",key:"@sveltejs/adapter-node"}]},{name:"Static (SvelteKit)",slug:"adapter-static",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-static"},{type:"devDependency",key:"@sveltejs/adapter-static"}]},{name:"Cloudflare (SvelteKit)",slug:"adapter-cloudflare",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-cloudflare"},{type:"devDependency",key:"@sveltejs/adapter-cloudflare"}]},{name:"Netlify (SvelteKit)",slug:"adapter-netlify",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-netlify"},{type:"devDependency",key:"@sveltejs/adapter-netlify"}]},{name:"Tailwind CSS",slug:"tailwind",category:"css",signals:[{type:"dependency",key:"tailwindcss"},{type:"devDependency",key:"tailwindcss"},{type:"file",pattern:"tailwind.config.*"}]},{name:"Bootstrap",slug:"bootstrap",category:"css",signals:[{type:"dependency",key:"bootstrap"}]},{name:"Styled Components",slug:"styled-components",category:"css",signals:[{type:"dependency",key:"styled-components"}]},{name:"shadcn/ui",slug:"shadcn",category:"ui",signals:[{type:"file",pattern:"components.json"},{type:"dependency",key:"@radix-ui/react-dialog"}]},{name:"Material UI",slug:"mui",category:"ui",signals:[{type:"dependency",key:"@mui/material"}]},{name:"Chakra UI",slug:"chakra",category:"ui",signals:[{type:"dependency",key:"@chakra-ui/react"}]},{name:"Ant Design",slug:"antd",category:"ui",signals:[{type:"dependency",key:"antd"}]},{name:"Redux",slug:"redux",category:"state",signals:[{type:"dependency",key:"@reduxjs/toolkit"}]},{name:"Zustand",slug:"zustand",category:"state",signals:[{type:"dependency",key:"zustand"}]},{name:"Jotai",slug:"jotai",category:"state",signals:[{type:"dependency",key:"jotai"}]},{name:"Pinia",slug:"pinia",category:"state",signals:[{type:"dependency",key:"pinia"}]},{name:"Express",slug:"express",category:"backend",signals:[{type:"dependency",key:"express"}]},{name:"Fastify",slug:"fastify",category:"backend",signals:[{type:"dependency",key:"fastify"}]},{name:"Hono",slug:"hono",category:"backend",signals:[{type:"dependency",key:"hono"}]},{name:"Elysia",slug:"elysia",category:"backend",signals:[{type:"dependency",key:"elysia"}]},{name:"NestJS",slug:"nestjs",category:"backend",signals:[{type:"dependency",key:"@nestjs/core"}]},{name:"Koa",slug:"koa",category:"backend",signals:[{type:"dependency",key:"koa"}]},{name:"FastAPI",slug:"fastapi",category:"backend",signals:[{type:"dependency",key:"fastapi"}]},{name:"Django",slug:"django",category:"backend",signals:[{type:"dependency",key:"django"},{type:"file",pattern:"manage.py"}]},{name:"Flask",slug:"flask",category:"backend",signals:[{type:"dependency",key:"flask"},{type:"file",pattern:"app.py"}]},{name:"Rails",slug:"rails",category:"backend",signals:[{type:"file",pattern:"Gemfile"},{type:"file",pattern:"config/routes.rb"}]},{name:"Spring Boot",slug:"spring",category:"backend",signals:[{type:"file",pattern:"pom.xml"},{type:"file",pattern:"build.gradle"}]},{name:"Prisma",slug:"prisma",category:"database",signals:[{type:"dependency",key:"prisma"},{type:"devDependency",key:"prisma"},{type:"file",pattern:"prisma/schema.prisma"}]},{name:"Drizzle",slug:"drizzle",category:"database",signals:[{type:"dependency",key:"drizzle-orm"},{type:"file",pattern:"drizzle.config.*"}]},{name:"TypeORM",slug:"typeorm",category:"database",signals:[{type:"dependency",key:"typeorm"}]},{name:"Mongoose",slug:"mongoose",category:"database",signals:[{type:"dependency",key:"mongoose"}]},{name:"SQLAlchemy",slug:"sqlalchemy",category:"database",signals:[{type:"dependency",key:"sqlalchemy"}]},{name:"Tortoise ORM",slug:"tortoise",category:"database",signals:[{type:"dependency",key:"tortoise-orm"}]},{name:"Vite",slug:"vite",category:"build",signals:[{type:"dependency",key:"vite"},{type:"devDependency",key:"vite"},{type:"file",pattern:"vite.config.*"}]},{name:"webpack",slug:"webpack",category:"build",signals:[{type:"dependency",key:"webpack"},{type:"devDependency",key:"webpack"},{type:"file",pattern:"webpack.config.*"}]},{name:"esbuild",slug:"esbuild",category:"build",signals:[{type:"dependency",key:"esbuild"},{type:"devDependency",key:"esbuild"}]},{name:"Turbopack",slug:"turbopack",category:"build",signals:[{type:"file",pattern:"turbo.json"}]},{name:"Jest",slug:"jest",category:"testing",signals:[{type:"devDependency",key:"jest"},{type:"file",pattern:"jest.config.*"}]},{name:"Vitest",slug:"vitest",category:"testing",signals:[{type:"devDependency",key:"vitest"}]},{name:"Playwright",slug:"playwright",category:"testing",signals:[{type:"devDependency",key:"@playwright/test"},{type:"file",pattern:"playwright.config.*"}]},{name:"Cypress",slug:"cypress",category:"testing",signals:[{type:"devDependency",key:"cypress"},{type:"file",pattern:"cypress.config.*"}]},{name:"Turborepo",slug:"turborepo",category:"monorepo",signals:[{type:"devDependency",key:"turbo"},{type:"file",pattern:"turbo.json"}]},{name:"Nx",slug:"nx",category:"monorepo",signals:[{type:"devDependency",key:"nx"},{type:"file",pattern:"nx.json"}]},{name:"Lerna",slug:"lerna",category:"monorepo",signals:[{type:"devDependency",key:"lerna"},{type:"file",pattern:"lerna.json"}]},{name:"MCP SDK (TS)",slug:"mcp-sdk-ts",category:"mcp",signals:[{type:"dependency",key:"@modelcontextprotocol/sdk"}]},{name:"FastMCP",slug:"fastmcp",category:"mcp",signals:[{type:"dependency",key:"fastmcp"}]},{name:"MCP SDK (Python)",slug:"mcp-sdk-py",category:"mcp",signals:[{type:"dependency",key:"mcp"}]},{name:"rmcp",slug:"rmcp",category:"mcp",signals:[{type:"dependency",key:"rmcp"}]},{name:"MCP Go",slug:"mcp-go",category:"mcp",signals:[{type:"dependency",key:"github.com/mark3labs/mcp-go"},{type:"dependency",key:"github.com/modelcontextprotocol/go-sdk"}]},{name:"MCP .NET",slug:"mcp-dotnet",category:"mcp",signals:[{type:"dependency",key:"ModelContextProtocol"}]},{name:"FastMCP (TS)",slug:"fastmcp-ts",category:"mcp",signals:[{type:"dependency",key:"@fastmcp/server"}]},{name:"Anthropic SDK",slug:"anthropic",category:"ai",signals:[{type:"dependency",key:"@anthropic-ai/sdk"}]},{name:"OpenAI SDK",slug:"openai",category:"ai",signals:[{type:"dependency",key:"openai"}]},{name:"LangChain",slug:"langchain",category:"ai",signals:[{type:"dependency",key:"langchain"}]},{name:"Vercel",slug:"vercel",category:"hosting",signals:[{type:"file",pattern:"vercel.json"}]},{name:"Netlify",slug:"netlify",category:"hosting",signals:[{type:"file",pattern:"netlify.toml"}]},{name:"Docker",slug:"docker",category:"hosting",signals:[{type:"file",pattern:"Dockerfile"},{type:"file",pattern:"docker-compose.yml"}]},{name:"Cloudflare Workers",slug:"cloudflare",category:"hosting",signals:[{type:"file",pattern:"wrangler.toml"},{type:"dependency",key:"wrangler"}]},{name:"GitHub Actions",slug:"github-actions",category:"cicd",signals:[{type:"file",pattern:".github/workflows/*.yml"}]},{name:"Commander.js",slug:"commander",category:"cli",signals:[{type:"dependency",key:"commander"}]}]});import{existsSync as b,readFileSync as Q0,readdirSync as Fq}from"fs";import{join as C}from"path";function P0($){let X=C($,"package.json");if(!b(X))return null;try{return JSON.parse(Q0(X,"utf-8"))}catch{return null}}function Iq($){let X=P0($);if(X?.name)return{name:X.name,description:X.description};let J=C($,"pyproject.toml");if(b(J))try{let q=Q0(J,"utf-8"),Y=q.match(/^\s*name\s*=\s*"([^"]+)"/m),z=q.match(/^\s*description\s*=\s*"([^"]+)"/m);if(Y)return{name:Y[1],description:z?.[1]}}catch{}let Q=C($,"Cargo.toml");if(b(Q))try{let q=Q0(Q,"utf-8"),Y=q.match(/^\s*name\s*=\s*"([^"]+)"/m),z=q.match(/^\s*description\s*=\s*"([^"]+)"/m);if(Y)return{name:Y[1],description:z?.[1]}}catch{}return null}function TN($,X){if(!X.includes("*"))return b(C($,X));let J=X.split("/");if(J.length===1){let G=X.split("*")[0];try{return Fq($).some((W)=>W.startsWith(G))}catch{return!1}}let Q=C($,...J.slice(0,-1)),q=J[J.length-1],Y=q.split("*")[0],z=q.split("*")[1]||"";try{return Fq(Q).some((G)=>G.startsWith(Y)&&G.endsWith(z))}catch{return!1}}function SN($){let X=C($,"go.mod");if(!b(X))return new Set;try{let J=Q0(X,"utf-8"),Q=new Set;for(let q of J.matchAll(/^\s*([\w./-]+)\s+v[\d.]/gm))Q.add(q[1]);return Q}catch{return new Set}}function jN($,X,J){switch($.type){case"dependency":if(X?.dependencies?.[$.key])return!0;return SN(J).has($.key);case"devDependency":return!!X?.devDependencies?.[$.key];case"file":return TN(J,$.pattern);default:return!1}}function CN($){let X=C($,"pyproject.toml");if(!b(X))return{};try{let J=Q0(X,"utf-8"),Q={},q=J.match(/dependencies\s*=\s*\[([\s\S]*)\]/);if(q){let Y=q[1].match(/"([^"]+)"/g)||[];for(let z of Y){let G=z.replace(/"/g,"").replace(/\[.*/,"").split(/[>=<]/)[0].trim().toLowerCase();if(G)Q[G]="*"}}return Q}catch{return{}}}function bN($){let X=C($,"Cargo.toml");if(!b(X))return{};try{let J=Q0(X,"utf-8"),Q={},q=J.match(/\[dependencies\]([\s\S]*?)(?:\[|$)/);if(q){let Y=q[1].split(`
169
+ `);for(let z of Y){let G=z.match(/^\s*([a-zA-Z_-]+)\s*=/);if(G)Q[G[1].toLowerCase()]="*"}}return Q}catch{return{}}}function Q7($){let X=P0($),J=CN($),Q=bN($),q={...J,...Q},Y=X?{...X,dependencies:{...X.dependencies,...q}}:Object.keys(q).length>0?{dependencies:q}:null,z=Aq.map((H)=>{let V=H.signals.filter((B)=>jN(B,Y,$)).length/H.signals.length;return{name:H.name,slug:H.slug,category:H.category,confidence:V}}).filter((H)=>H.confidence>0).sort((H,U)=>U.confidence-H.confidence),G=new Set(z.map((H)=>H.slug)),W=new Set;if(G.has("nextjs"))W.add("react");if(G.has("nuxt"))W.add("vue");if(G.has("sveltekit"))W.add("svelte");return z.filter((H)=>!W.has(H.slug))}function Eq($){let X=P0($);if(X?.devDependencies?.typescript||X?.dependencies?.typescript)return"TypeScript";if(b(C($,"tsconfig.json")))return"TypeScript";if(b(C($,"index.html"))||b(C($,"index.htm")))return"HTML";if(b(C($,"Cargo.toml")))return"Rust";if(b(C($,"go.mod")))return"Go";if(b(C($,"pyproject.toml"))||b(C($,"setup.py")))return"Python";if(b(C($,"Gemfile")))return"Ruby";if(b(C($,"pom.xml"))||b(C($,"build.gradle")))return"Java";if(b(C($,"Package.swift")))return"Swift";if(b(C($,"build.zig")))return"Zig";if(X)return"JavaScript";return"Unknown"}function Zq($){let X=P0($),J=Q7($);if(J.some((w)=>w.category==="mcp"))return"mcp";if(X?.bin)return"cli";let q=J.some((w)=>w.slug==="svelte"||w.slug==="sveltekit");if(X?.private===!0&&(b(C($,"pnpm-workspace.yaml"))||X?.workspaces!==void 0)&&q)return"framework";if(q)return"svelte";if(J.some((w)=>w.slug==="nextjs"||w.slug==="nuxt"))return"fullstack";let G=b(C($,"index.html"))||b(C($,"index.htm")),W=b(C($,"404.html"))||b(C($,"about.html"))||b(C($,"contact.html")),H=b(C($,"api")),U=b(C($,"vercel.json")),V=b(C($,"wrangler.toml"))||b(C($,"wrangler.jsonc"));if(H&&(G||U||V))return"api-platform";let B=J.some((w)=>w.category==="frontend"),D=J.some((w)=>w.category==="backend");if(B&&D)return"fullstack";if((G||W)&&!D)return"static-site";if(B)return"frontend";if(D)return"backend";if(X?.main&&!X?.bin)return"library";if(b(C($,"go.mod"))){let w=b(C($,"cmd")),M=b(C($,"main.go"));if((()=>{try{return Q0(C($,"go.mod"),"utf-8")}catch{return""}})().includes("github.com/spf13/cobra")||w&&M)return"cli";return"service"}if(b(C($,"Cargo.toml"))){let w=b(C($,"src/main.rs")),M=(()=>{try{return Q0(C($,"Cargo.toml"),"utf-8")}catch{return""}})(),N=M.includes("[[bin]]"),L=M.includes("command-line-utilities"),I=M.includes("clap")||M.includes("argh")||M.includes("structopt")||M.includes("lexopt");if(N||L||w&&I)return"cli";if(w)return"service";return"library"}if(b(C($,"pyproject.toml"))||b(C($,"requirements.txt"))){let w=(()=>{try{return Q0(C($,"pyproject.toml"),"utf-8")}catch{return""}})(),M=w.includes("console_scripts")||w.includes("[project.scripts]"),N=b(C($,"setup.py")),L=b(C($,"src"))||b(C($,"lib"));if(M)return"cli";if(N||L&&!b(C($,"app.py"))&&!b(C($,"main.py")))return"library";return"service"}return"service"}function Tq($){if(b(C($,"bunfig.toml")))return"Bun";if(b(C($,"deno.json"))||b(C($,"deno.jsonc")))return"Deno";if(P0($))return"Node.js";if(b(C($,"Cargo.toml")))return"Rust";if(b(C($,"go.mod")))return"Go";return"Unknown"}function Sq($){if(b(C($,"bun.lockb"))||b(C($,"bun.lock")))return"bun";if(b(C($,"pnpm-lock.yaml")))return"pnpm";if(b(C($,"yarn.lock")))return"yarn";if(b(C($,"package-lock.json")))return"npm";return"npm"}function jq($){if(b(C($,".github/workflows")))return"GitHub Actions";if(b(C($,".gitlab-ci.yml")))return"GitLab CI";if(b(C($,".circleci")))return"CircleCI";if(b(C($,"Jenkinsfile")))return"Jenkins";return null}function Cq($){if(b(C($,"vercel.json")))return"Vercel";if(b(C($,"netlify.toml")))return"Netlify";if(b(C($,"wrangler.toml")))return"Cloudflare";if(b(C($,"Dockerfile")))return"Docker";if(b(C($,"fly.toml")))return"Fly.io";if(b(C($,"render.yaml")))return"Render";return null}function bq($){let X=C($,"svelte.config.js");if(!b(X))return null;try{let Q=Q0(X,"utf-8").match(/@sveltejs\/adapter-(\w+)/);if(Q){let q=Q[1];switch(q){case"vercel":return"Vercel";case"node":return"Node";case"static":return"Static";case"cloudflare":return"Cloudflare";case"netlify":return"Netlify";case"auto":return"Auto";default:return q}}return null}catch{return null}}function Pq($){let X=P0($);if(X?.devDependencies?.vite||X?.dependencies?.vite)return"Vite";if(X?.devDependencies?.webpack||X?.dependencies?.webpack)return"webpack";if(X?.devDependencies?.esbuild||X?.dependencies?.esbuild)return"esbuild";if(b(C($,"tsconfig.json"))&&X?.devDependencies?.typescript)return"TypeScript (tsc)";return null}var fq=g(()=>{_q()});function x8($){let X=P0($),J=Q7($),Q=Eq($),q=Zq($),Y=Tq($),z=Sq($),G=jq($),W=Cq($),H=Pq($),U=J.find((X$)=>X$.category==="frontend"),V=J.find((X$)=>X$.category==="css"),B=J.find((X$)=>X$.category==="ui"),D=J.find((X$)=>X$.category==="state"),w=J.find((X$)=>X$.category==="backend"),M=J.find((X$)=>X$.category==="database"),N=k8[q]||k8.library,L=q==="framework",I=J.some((X$)=>X$.slug==="svelte"||X$.slug==="sveltekit"),T=L&&I?"svelte":L?null:null,y=q==="mcp",x=y?J.find((X$)=>X$.category==="mcp"):null,k=x?.slug??null,l=q==="svelte"||T==="svelte",j=l?bq($):null,H$=l&&J.some((X$)=>X$.slug==="sveltekit"),t$=new Set(["css_framework","ui_library","database","connection","hosting"]),i={},V$=E$.filter((X$)=>X$.path.startsWith("stack."));for(let X$ of V$){let s=X$.path.replace("stack.","");if(!N.includes(X$.category)){i[s]="slotignored";continue}if(L&&t$.has(s)){i[s]="slotignored";continue}switch(s){case"frontend":if(q==="static-site")i[s]="Vanilla HTML";else i[s]=U?.name??(q==="cli"?"CLI":"");break;case"css_framework":if(q==="static-site")i[s]="Vanilla CSS";else i[s]=V?.name??"";break;case"ui_library":if(q==="static-site")i[s]="Vanilla JS";else i[s]=B?.name??"";break;case"state_management":i[s]=l?D?.name??"Runes":D?.name??"";break;case"backend":if(y&&x)i[s]=x.name;else if(q==="static-site")i[s]="Static";else if(l)i[s]=H$?"SvelteKit":w?.name??"";else i[s]=w?.name??"";break;case"api_type":if(y)i[s]="MCP (stdio/SSE)";else if(H$)i[s]="Server Routes";else i[s]="";break;case"runtime":if(q==="static-site")i[s]="Browser";else i[s]=Y!=="Unknown"?Y:"";break;case"database":i[s]=M?.name??"";break;case"connection":i[s]=M?.name??"";break;case"hosting":if(l&&j)i[s]=j;else if(q==="static-site"&&W)i[s]=`${W} (detected)`;else i[s]=W??"";break;case"build":i[s]=l?"Vite":H??"";break;case"cicd":if(q==="static-site"&&G)i[s]=`${G} (detected)`;else i[s]=G??"";break;case"package_manager":i[s]=z;break;default:i[s]="";break}}let L8={},B3=E$.filter((X$)=>X$.path.startsWith("monorepo."));for(let X$ of B3){let s=X$.path.replace("monorepo.","");if(!N.includes(X$.category))L8[s]="slotignored";else L8[s]=""}let v9=Iq($),CX={name:v9?.name??$.split("/").pop()??"project",goal:v9?.description??"",main_language:Q,type:q};if(L&&T)CX.framework=T;if(y&&k)CX.framework=k;return{faf_version:"3.0",project:CX,stack:i,human_context:{who:"",what:X?.description??"",why:"",where:"",when:"",how:""},monorepo:L8}}var u5=g(()=>{K0();fq()});import{spawnSync as xq}from"child_process";function fN(){if(y8!==void 0)return y8;if(process.platform!=="darwin")return y8=null,null;try{let $=xq("which",["terminal-notifier"],{encoding:"utf-8"});y8=$.status===0?$.stdout.trim():null}catch{y8=null}return y8}function q0($){if(process.env.FAF_NO_NOTIFY==="1")return;if(!process.stdout.isTTY)return;let X=$.replace(/[\x00-\x1f]/g," ").slice(0,200);if(process.env.FAF_NOTIFY_OSC9!=="1"){let J=fN();if(J){try{xq(J,["-title","FAF","-message",X,"-timeout","0"],{stdio:"ignore"})}catch{}return}}process.stdout.write(`\x1B]9;${X}\x07`)}var y8;var m5=()=>{};var vq={};PX(vq,{autoCommand:()=>q7});import{existsSync as yq}from"fs";import{join as kN}from"path";function q7(){let $=Date.now(),X=process.cwd(),J=kN(X,"project.faf"),Q=x8(X),q=null;if(yq(J))try{q=Y$(q$(a(J))).tier.name}catch{}if(yq(J)){let W=$$(J),H=gq(W,Q);Q$(J,H),console.log(`${A("updated")} ${J}`)}else{let W=Q.project?.type??"library",H=k8[W]||k8.library;for(let U of E$)if(!H.includes(U.category)){let[V,B]=U.path.split(".");if(V==="stack"&&Q.stack)Q.stack[B]="slotignored";if(V==="monorepo"&&Q.monorepo)Q.monorepo[B]="slotignored"}Q$(J,Q),console.log(`${A("created")} ${J}`)}let Y=a(J),z=Y$(q$(Y));if(N$(z,J),z.score<100)console.log(O(`
170
+ run ${S("'faf go'")} to reach 100%`));let G=Date.now()-$;if(z.score===100)q0("FAF: Trophy unlocked at 100%");else if(q&&xN(q,z.tier.name))q0(`FAF: tier upgraded ${q} -> ${z.tier.name} (${z.score}%)`);else if(G>=5000)q0(`FAF: ${z.score}% ${z.tier.name} - stack detected`)}function xN($,X){let J=s6.map((Q)=>Q.name);return J.indexOf(X)<J.indexOf($)}function gq($,X){let J={...$};for(let[Q,q]of Object.entries(X))if(!(Q in J)||J[Q]===null||J[Q]===void 0)J[Q]=q;else if(typeof q==="object"&&q!==null&&!Array.isArray(q))J[Q]=gq(J[Q]??{},q);return J}var Y7=g(()=>{u5();B$();l$();J0();m5();e();K0();a6()});var J1=_((s_,HD)=>{HD.exports={name:"faf-cli",version:"6.3.0",description:"51,582+ downloads | Claude Code Skills | Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-approved.",type:"module",icon:"https://faf.one/orange-smiley.svg",logo:"https://faf.one/orange-smiley.svg",main:"dist/index.js",bin:{faf:"dist/cli.js","faf-cli":"dist/cli.js"},exports:{".":{bun:"./src/index.ts",default:"./dist/index.js"}},files:["dist/**/*","skills/**/*","README.md","LICENSE","project.faf"],scripts:{dev:"bun run src/cli.ts",build:"bun build src/cli.ts --outfile dist/cli.js --target=node --minify && bun build src/index.ts --outfile dist/index.js --target=node --minify",compile:"bun build src/cli.ts --compile --bytecode --minify --outfile faf","compile:all":"bun build src/cli.ts --compile --target=bun-darwin-arm64 --outfile faf-darwin-arm64 && bun build src/cli.ts --compile --target=bun-darwin-x64 --outfile faf-darwin-x64 && bun build src/cli.ts --compile --target=bun-linux-x64 --outfile faf-linux-x64 && bun build src/cli.ts --compile --target=bun-windows-x64 --outfile faf-windows-x64.exe",test:"bun test","test:watch":"bun test --watch",lint:"eslint src/**/*.ts",format:"prettier --write 'src/**/*.ts'",prepublishOnly:"bun run build","test:coverage":"bun test --coverage",typecheck:"bun --bun tsc --noEmit"},keywords:["faf","ai-context","project-dna","bi-sync","cli","claude","gemini","cursor","mcp","model-context-protocol","persistent-context","ai-readiness","foundational"],author:"wolfejam <wolfejam@faf.one>",license:"MIT",repository:{type:"git",url:"git+https://github.com/Wolfe-Jam/faf-cli.git"},homepage:"https://faf.one",bugs:{url:"https://github.com/Wolfe-Jam/faf-cli/issues"},dependencies:{commander:"^14.0.3","faf-scoring-kernel":"^2.0.3",open:"8.4.2",yaml:"^2.8.3",zod:"^3.25.76"},optionalDependencies:{"@anthropic-ai/sdk":"^0.74.0"},devDependencies:{"@types/node":"^22.19.17","@typescript-eslint/eslint-plugin":"^8.58.0","@typescript-eslint/parser":"^8.58.0",eslint:"^9.39.4",prettier:"^3.8.1",typescript:"^5.9.3","typescript-eslint":"^8.58.0"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});var M7=_((kF,N1)=>{var M1=U$("fs"),K7;function wD(){try{return M1.statSync("/.dockerenv"),!0}catch($){return!1}}function LD(){try{return M1.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch($){return!1}}N1.exports=()=>{if(K7===void 0)K7=wD()||LD();return K7}});var w1=_((xF,N7)=>{var RD=U$("os"),AD=U$("fs"),D1=M7(),O1=()=>{if(process.platform!=="linux")return!1;if(RD.release().toLowerCase().includes("microsoft")){if(D1())return!1;return!0}try{return AD.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!D1():!1}catch($){return!1}};if(process.env.__IS_WSL_TEST__)N7.exports=O1;else N7.exports=O1()});var R1=_((yF,L1)=>{L1.exports=($,X,J)=>{let Q=(q)=>Object.defineProperty($,X,{value:q,enumerable:!0,writable:!0});return Object.defineProperty($,X,{configurable:!0,enumerable:!0,get(){let q=J();return Q(q),q},set(q){Q(q)}}),$}});var T1=_((gF,Z1)=>{var __dirname="/Users/wolfejam/FAF/cli/node_modules/open",_D=U$("path"),FD=U$("child_process"),{promises:i5,constants:E1}=U$("fs"),d5=w1(),ID=M7(),O7=R1(),A1=_D.join(__dirname,"xdg-open"),{platform:g8,arch:_1}=process,ED=()=>{try{return i5.statSync("/run/.containerenv"),!0}catch{return!1}},D7;function ZD(){if(D7===void 0)D7=ED()||ID();return D7}var TD=(()=>{let X;return async function(){if(X)return X;let J="/etc/wsl.conf",Q=!1;try{await i5.access(J,E1.F_OK),Q=!0}catch{}if(!Q)return"/mnt/";let q=await i5.readFile(J,{encoding:"utf8"}),Y=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(q);if(!Y)return"/mnt/";return X=Y.groups.mountPoint.trim(),X=X.endsWith("/")?X:`${X}/`,X}})(),F1=async($,X)=>{let J;for(let Q of $)try{return await X(Q)}catch(q){J=q}throw J},n5=async($)=>{if($={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...$},Array.isArray($.app))return F1($.app,(G)=>n5({...$,app:G}));let{name:X,arguments:J=[]}=$.app||{};if(J=[...J],Array.isArray(X))return F1(X,(G)=>n5({...$,app:{name:G,arguments:J}}));let Q,q=[],Y={};if(g8==="darwin"){if(Q="open",$.wait)q.push("--wait-apps");if($.background)q.push("--background");if($.newInstance)q.push("--new");if(X)q.push("-a",X)}else if(g8==="win32"||d5&&!ZD()&&!X){let G=await TD();if(Q=d5?`${G}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,q.push("-NoProfile","-NonInteractive","–ExecutionPolicy","Bypass","-EncodedCommand"),!d5)Y.windowsVerbatimArguments=!0;let W=["Start"];if($.wait)W.push("-Wait");if(X){if(W.push(`"\`"${X}\`""`,"-ArgumentList"),$.target)J.unshift($.target)}else if($.target)W.push(`"${$.target}"`);if(J.length>0)J=J.map((H)=>`"\`"${H}\`""`),W.push(J.join(","));$.target=Buffer.from(W.join(" "),"utf16le").toString("base64")}else{if(X)Q=X;else{let G=!__dirname||__dirname==="/",W=!1;try{await i5.access(A1,E1.X_OK),W=!0}catch{}Q=process.versions.electron||g8==="android"||G||!W?"xdg-open":A1}if(J.length>0)q.push(...J);if(!$.wait)Y.stdio="ignore",Y.detached=!0}if($.target)q.push($.target);if(g8==="darwin"&&J.length>0)q.push("--args",...J);let z=FD.spawn(Q,q,Y);if($.wait)return new Promise((G,W)=>{z.once("error",W),z.once("close",(H)=>{if(!$.allowNonzeroExitCode&&H>0){W(Error(`Exited with code ${H}`));return}G(z)})});return z.unref(),z},w7=($,X)=>{if(typeof $!=="string")throw TypeError("Expected a `target`");return n5({...X,target:$})},SD=($,X)=>{if(typeof $!=="string")throw TypeError("Expected a `name`");let{arguments:J=[]}=X||{};if(J!==void 0&&J!==null&&!Array.isArray(J))throw TypeError("Expected `appArguments` as Array type");return n5({...X,app:{name:$,arguments:J}})};function I1($){if(typeof $==="string"||Array.isArray($))return $;let{[_1]:X}=$;if(!X)throw Error(`${_1} is not supported`);return X}function L7({[g8]:$},{wsl:X}){if(X&&d5)return I1(X);if(!$)throw Error(`${g8} is not supported`);return I1($)}var r5={};O7(r5,"chrome",()=>L7({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));O7(r5,"firefox",()=>L7({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));O7(r5,"edge",()=>L7({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));w7.apps=r5;w7.openApp=SD;Z1.exports=w7});function E($,X,J,Q,q){if(Q==="m")throw TypeError("Private method is not writable");if(Q==="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 Q==="a"?q.call($,J):q?q.value=J:X.set($,J),J}function K($,X,J,Q){if(J==="a"&&!Q)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!Q:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return J==="m"?Q:J==="a"?Q.call($):Q?Q.value:X.get($)}var M0=()=>{};var R7=function(){let{crypto:$}=globalThis;if($?.randomUUID)return R7=$.randomUUID.bind($),$.randomUUID();let X=new Uint8Array(1),J=$?()=>$.getRandomValues(X)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(Q)=>(+Q^J()&15>>+Q/4).toString(16))};function N0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var q2=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let X=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)X.stack=$.stack;if($.cause&&!X.cause)X.cause=$.cause;if($.name)X.name=$.name;return X}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};var P,O$,_$,k0,v8,h8,u8,m8,l8,c8,p8,d8,i8;var j$=g(()=>{P=class P extends Error{};O$=class O$ extends P{constructor($,X,J,Q){super(`${O$.makeMessage($,X,J)}`);this.status=$,this.headers=Q,this.requestID=Q?.get("request-id"),this.error=X}static makeMessage($,X,J){let Q=X?.message?typeof X.message==="string"?X.message:JSON.stringify(X.message):X?JSON.stringify(X):J;if($&&Q)return`${$} ${Q}`;if($)return`${$} status code (no body)`;if(Q)return Q;return"(no status code or body)"}static generate($,X,J,Q){if(!$||!Q)return new k0({message:J,cause:q2(X)});let q=X;if($===400)return new h8($,q,J,Q);if($===401)return new u8($,q,J,Q);if($===403)return new m8($,q,J,Q);if($===404)return new l8($,q,J,Q);if($===409)return new c8($,q,J,Q);if($===422)return new p8($,q,J,Q);if($===429)return new d8($,q,J,Q);if($>=500)return new i8($,q,J,Q);return new O$($,q,J,Q)}};_$=class _$ extends O${constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};k0=class k0 extends O${constructor({message:$,cause:X}){super(void 0,void 0,$||"Connection error.",void 0);if(X)this.cause=X}};v8=class v8 extends k0{constructor({message:$}={}){super({message:$??"Request timed out."})}};h8=class h8 extends O${};u8=class u8 extends O${};m8=class m8 extends O${};l8=class l8 extends O${};c8=class c8 extends O${};p8=class p8 extends O${};d8=class d8 extends O${};i8=class i8 extends O${}});function s5($){if(typeof $!=="object")return{};return $??{}}function x1($){if(!$)return!0;for(let X in $)return!1;return!0}function y1($,X){return Object.prototype.hasOwnProperty.call($,X)}var hD,k1=($)=>{return hD.test($)},A7=($)=>(A7=Array.isArray,A7($)),_7,g1=($,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},a5=($)=>{try{return JSON.parse($)}catch(X){return}};var z8=g(()=>{j$();hD=/^[a-z][a-z0-9+.-]*:/i,_7=A7});var v1=($)=>new Promise((X)=>setTimeout(X,$));var x0="0.74.0";function uD(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}function lD(){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:J}of $){let Q=J.exec(navigator.userAgent);if(Q){let q=Q[1]||0,Y=Q[2]||0,z=Q[3]||0;return{browser:X,version:`${q}.${Y}.${z}`}}}return null}var l1=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},mD=()=>{let $=uD();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":x0,"X-Stainless-OS":u1(Deno.build.os),"X-Stainless-Arch":h1(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":x0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":x0,"X-Stainless-OS":u1(globalThis.process.platform??"unknown"),"X-Stainless-Arch":h1(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let X=lD();if(X)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":x0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${X.browser}`,"X-Stainless-Runtime-Version":X.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":x0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},h1=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},u1=($)=>{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"},m1,c1=()=>{return m1??(m1=mD())};var F7=()=>{};function p1(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function I7(...$){let X=globalThis.ReadableStream;if(typeof X>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new X(...$)}function o5($){let X=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return I7({start(){},async pull(J){let{done:Q,value:q}=await X.next();if(Q)J.close();else J.enqueue(q)},async cancel(){await X.return?.()}})}function Y2($){if($[Symbol.asyncIterator])return $;let X=$.getReader();return{async next(){try{let J=await X.read();if(J?.done)X.releaseLock();return J}catch(J){throw X.releaseLock(),J}},async return(){let J=X.cancel();return X.releaseLock(),await J,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function d1($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let X=$.getReader(),J=X.cancel();X.releaseLock(),await J}var i1=({headers:$,body:X})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(X)}};function s1($){let X=0;for(let q of $)X+=q.length;let J=new Uint8Array(X),Q=0;for(let q of $)J.set(q,Q),Q+=q.length;return J}function z2($){let X;return(n1??(X=new globalThis.TextEncoder,n1=X.encode.bind(X)))($)}function E7($){let X;return(r1??(X=new globalThis.TextDecoder,r1=X.decode.bind(X)))($)}var n1,r1;class y0{constructor(){C$.set(this,void 0),b$.set(this,void 0),E(this,C$,new Uint8Array,"f"),E(this,b$,null,"f")}decode($){if($==null)return[];let X=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?z2($):$;E(this,C$,s1([K(this,C$,"f"),X]),"f");let J=[],Q;while((Q=dD(K(this,C$,"f"),K(this,b$,"f")))!=null){if(Q.carriage&&K(this,b$,"f")==null){E(this,b$,Q.index,"f");continue}if(K(this,b$,"f")!=null&&(Q.index!==K(this,b$,"f")+1||Q.carriage)){J.push(E7(K(this,C$,"f").subarray(0,K(this,b$,"f")-1))),E(this,C$,K(this,C$,"f").subarray(K(this,b$,"f")),"f"),E(this,b$,null,"f");continue}let q=K(this,b$,"f")!==null?Q.preceding-1:Q.preceding,Y=E7(K(this,C$,"f").subarray(0,q));J.push(Y),E(this,C$,K(this,C$,"f").subarray(Q.index),"f"),E(this,b$,null,"f")}return J}flush(){if(!K(this,C$,"f").length)return[];return this.decode(`
171
+ `)}}function dD($,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 a1($){for(let Q=0;Q<$.length-1;Q++){if($[Q]===10&&$[Q+1]===10)return Q+2;if($[Q]===13&&$[Q+1]===13)return Q+2;if($[Q]===13&&$[Q+1]===10&&Q+3<$.length&&$[Q+2]===13&&$[Q+3]===10)return Q+4}return-1}var C$,b$;var Z7=g(()=>{M0();C$=new WeakMap,b$=new WeakMap;y0.NEWLINE_CHARS=new Set([`
172
+ `,"\r"]);y0.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function G2(){}function t5($,X,J){if(!X||e5[$]>e5[J])return G2;else return X[$].bind(X)}function R$($){let X=$.logger,J=$.logLevel??"off";if(!X)return iD;let Q=o1.get(X);if(Q&&Q[0]===J)return Q[1];let q={error:t5("error",X,J),warn:t5("warn",X,J),info:t5("info",X,J),debug:t5("debug",X,J)};return o1.set(X,[J,q]),q}var e5,T7=($,X,J)=>{if(!$)return;if(y1(e5,$))return $;R$(J).warn(`${X} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(e5))}`);return},iD,o1,D0=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([X,J])=>[X,X.toLowerCase()==="x-api-key"||X.toLowerCase()==="authorization"||X.toLowerCase()==="cookie"||X.toLowerCase()==="set-cookie"?"***":J]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var $X=g(()=>{z8();e5={off:0,error:200,warn:300,info:400,debug:500};iD={error:G2,warn:G2,info:G2,debug:G2},o1=new WeakMap});async function*nD($,X){if(!$.body){if(X.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new P("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new P("Attempted to iterate over a response with no body")}let J=new t1,Q=new y0,q=Y2($.body);for await(let Y of rD(q))for(let z of Q.decode(Y)){let G=J.decode(z);if(G)yield G}for(let Y of Q.flush()){let z=J.decode(Y);if(z)yield z}}async function*rD($){let X=new Uint8Array;for await(let J of $){if(J==null)continue;let Q=J instanceof ArrayBuffer?new Uint8Array(J):typeof J==="string"?z2(J):J,q=new Uint8Array(X.length+Q.length);q.set(X),q.set(Q,X.length),X=q;let Y;while((Y=a1(X))!==-1)yield X.slice(0,Y),X=X.slice(Y)}if(X.length>0)yield X}class t1{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(`
173
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],q}if(this.chunks.push($),$.startsWith(":"))return null;let[X,J,Q]=sD($,":");if(Q.startsWith(" "))Q=Q.substring(1);if(X==="event")this.event=Q;else if(X==="data")this.data.push(Q);return null}}function sD($,X){let J=$.indexOf(X);if(J!==-1)return[$.substring(0,J),X,$.substring(J+X.length)];return[$,"",""]}var W2,P$;var S7=g(()=>{M0();j$();Z7();z8();$X();j$();P$=class P${constructor($,X,J){this.iterator=$,W2.set(this,void 0),this.controller=X,E(this,W2,J,"f")}static fromSSEResponse($,X,J){let Q=!1,q=J?R$(J):console;async function*Y(){if(Q)throw new P("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Q=!0;let z=!1;try{for await(let G of nD($,X)){if(G.event==="completion")try{yield JSON.parse(G.data)}catch(W){throw q.error("Could not parse message into JSON:",G.data),q.error("From chunk:",G.raw),W}if(G.event==="message_start"||G.event==="message_delta"||G.event==="message_stop"||G.event==="content_block_start"||G.event==="content_block_delta"||G.event==="content_block_stop")try{yield JSON.parse(G.data)}catch(W){throw q.error("Could not parse message into JSON:",G.data),q.error("From chunk:",G.raw),W}if(G.event==="ping")continue;if(G.event==="error")throw new O$(void 0,a5(G.data)??G.data,void 0,$.headers)}z=!0}catch(G){if(N0(G))return;throw G}finally{if(!z)X.abort()}}return new P$(Y,X,J)}static fromReadableStream($,X,J){let Q=!1;async function*q(){let z=new y0,G=Y2($);for await(let W of G)for(let H of z.decode(W))yield H;for(let W of z.flush())yield W}async function*Y(){if(Q)throw new P("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");Q=!0;let z=!1;try{for await(let G of q()){if(z)continue;if(G)yield JSON.parse(G)}z=!0}catch(G){if(N0(G))return;throw G}finally{if(!z)X.abort()}}return new P$(Y,X,J)}[(W2=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],X=[],J=this.iterator(),Q=(q)=>{return{next:()=>{if(q.length===0){let Y=J.next();$.push(Y),X.push(Y)}return q.shift()}}};return[new P$(()=>Q($),this.controller,K(this,W2,"f")),new P$(()=>Q(X),this.controller,K(this,W2,"f"))]}toReadableStream(){let $=this,X;return I7({async start(){X=$[Symbol.asyncIterator]()},async pull(J){try{let{value:Q,done:q}=await X.next();if(q)return J.close();let Y=z2(JSON.stringify(Q)+`
174
+ `);J.enqueue(Y)}catch(Q){J.error(Q)}},async cancel(){await X.return?.()}})}}});async function XX($,X){let{response:J,requestLogID:Q,retryOfRequestLogID:q,startTime:Y}=X,z=await(async()=>{if(X.options.stream){if(R$($).debug("response",J.status,J.url,J.headers,J.body),X.options.__streamClass)return X.options.__streamClass.fromSSEResponse(J,X.controller);return P$.fromSSEResponse(J,X.controller)}if(J.status===204)return null;if(X.options.__binaryResponse)return J;let W=J.headers.get("content-type")?.split(";")[0]?.trim();if(W?.includes("application/json")||W?.endsWith("+json")){if(J.headers.get("content-length")==="0")return;let B=await J.json();return j7(B,J)}return await J.text()})();return R$($).debug(`[${Q}] response parsed`,D0({retryOfRequestLogID:q,url:J.url,status:J.status,body:z,durationMs:Date.now()-Y})),z}function j7($,X){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:X.headers.get("request-id"),enumerable:!1})}var C7=g(()=>{S7();$X()});var H2,g0;var JX=g(()=>{M0();C7();g0=class g0 extends Promise{constructor($,X,J=XX){super((Q)=>{Q(null)});this.responsePromise=X,this.parseResponse=J,H2.set(this,void 0),E(this,H2,$,"f")}_thenUnwrap($){return new g0(K(this,H2,"f"),this.responsePromise,async(X,J)=>j7($(await this.parseResponse(X,J),J),J.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(K(this,H2,"f"),$));return this.parsedPromise}then($,X){return this.parse().then($,X)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};H2=new WeakMap});var QX,b7,U2,p$,V2;var Y0=g(()=>{M0();j$();C7();JX();z8();b7=class b7{constructor($,X,J,Q){QX.set(this,void 0),E(this,QX,$,"f"),this.options=Q,this.response=X,this.body=J}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let $=this.nextPageRequestOptions();if(!$)throw new P("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await K(this,QX,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(QX=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let X of $.getPaginatedItems())yield X}};U2=class U2 extends g0{constructor($,X,J){super($,X,async(Q,q)=>new J(Q,q.response,await XX(Q,q),q.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let X of $)yield X}};p$=class p$ extends b7{constructor($,X,J,Q){super($,X,J,Q);this.data=J.data||[],this.has_more=J.has_more||!1,this.first_id=J.first_id||null,this.last_id=J.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let X=this.first_id;if(!X)return null;return{...this.options,query:{...s5(this.options.query),before_id:X}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...s5(this.options.query),after_id:$}}}};V2=class V2 extends b7{constructor($,X,J,Q){super($,X,J,Q);this.data=J.data||[],this.has_more=J.has_more||!1,this.next_page=J.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let $=this.next_page;if(!$)return null;return{...this.options,query:{...s5(this.options.query),page:$}}}}});function G8($,X,J){return f7(),new File($,X??"unknown_file",J)}function B2($,X){let J=typeof $==="object"&&$!==null&&(("name"in $)&&$.name&&String($.name)||("url"in $)&&$.url&&String($.url)||("filename"in $)&&$.filename&&String($.filename)||("path"in $)&&$.path&&String($.path))||"";return X?J.split(/[\\/]/).pop()||void 0:J}function oD($){let X=typeof $==="function"?$:$.fetch,J=e1.get(X);if(J)return J;let Q=(async()=>{try{let q="Response"in X?X.Response:(await X("data:,")).constructor,Y=new FormData;if(Y.toString()===await new q(Y).text())return!1;return!0}catch{return!0}})();return e1.set(X,Q),Q}var f7=()=>{if(typeof File>"u"){let{process:$}=globalThis,X=typeof $?.versions?.node==="string"&&parseInt($.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(X?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},k7=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",n8=async($,X,J=!0)=>{return{...$,body:await tD($.body,X,J)}},e1,tD=async($,X,J=!0)=>{if(!await oD(X))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let Q=new FormData;return await Promise.all(Object.entries($||{}).map(([q,Y])=>P7(Q,q,Y,J))),Q},eD=($)=>$ instanceof Blob&&("name"in $),P7=async($,X,J,Q)=>{if(J===void 0)return;if(J==null)throw TypeError(`Received null for "${X}"; to pass null in FormData, you must use the string 'null'`);if(typeof J==="string"||typeof J==="number"||typeof J==="boolean")$.append(X,String(J));else if(J instanceof Response){let q={},Y=J.headers.get("Content-Type");if(Y)q={type:Y};$.append(X,G8([await J.blob()],B2(J,Q),q))}else if(k7(J))$.append(X,G8([await new Response(o5(J)).blob()],B2(J,Q)));else if(eD(J))$.append(X,G8([J],B2(J,Q),{type:J.type}));else if(Array.isArray(J))await Promise.all(J.map((q)=>P7($,X+"[]",q,Q)));else if(typeof J==="object")await Promise.all(Object.entries(J).map(([q,Y])=>P7($,`${X}[${q}]`,Y,Q)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${J} instead`)};var r8=g(()=>{e1=new WeakMap});async function K2($,X,J){if(f7(),$=await $,X||(X=B2($,!0)),$O($)){if($ instanceof File&&X==null&&J==null)return $;return G8([await $.arrayBuffer()],X??$.name,{type:$.type,lastModified:$.lastModified,...J})}if(XO($)){let q=await $.blob();return X||(X=new URL($.url).pathname.split(/[\\/]/).pop()),G8(await x7(q),X,J)}let Q=await x7($);if(!J?.type){let q=Q.find((Y)=>typeof Y==="object"&&("type"in Y)&&Y.type);if(typeof q==="string")J={...J,type:q}}return G8(Q,X,J)}async function x7($){let X=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)X.push($);else if($Y($))X.push($ instanceof Blob?$:await $.arrayBuffer());else if(k7($))for await(let J of $)X.push(...await x7(J));else{let J=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${J?`; constructor: ${J}`:""}${JO($)}`)}return X}function JO($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((J)=>`"${J}"`).join(", ")}]`}var $Y=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",$O=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&$Y($),XO=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var XY=g(()=>{r8();r8()});var y7=g(()=>{XY()});var JY=()=>{};class z${constructor($){this._client=$}}function*qO($){if(!$)return;if(QY in $){let{values:Q,nulls:q}=$;yield*Q.entries();for(let Y of q)yield[Y,null];return}let X=!1,J;if($ instanceof Headers)J=$.entries();else if(_7($))J=$;else X=!0,J=Object.entries($??{});for(let Q of J){let q=Q[0];if(typeof q!=="string")throw TypeError("expected header name to be a string");let Y=_7(Q[1])?Q[1]:[Q[1]],z=!1;for(let G of Y){if(G===void 0)continue;if(X&&!z)z=!0,yield[q,null];yield[q,G]}}}var QY,u=($)=>{let X=new Headers,J=new Set;for(let Q of $){let q=new Set;for(let[Y,z]of qO(Q)){let G=Y.toLowerCase();if(!q.has(G))X.delete(Y),q.add(G);if(z===null)X.delete(Y),J.add(G);else X.append(Y,z),J.delete(G)}}return{[QY]:!0,values:X,nulls:J}};var f$=g(()=>{z8();QY=Symbol.for("brand.privateNullableHeaders")});function qX($){return typeof $==="object"&&$!==null&&M2 in $}function g7($,X){let J=new Set;if($){for(let Q of $)if(qX(Q))J.add(Q[M2])}if(X)for(let Q of X){if(qX(Q))J.add(Q[M2]);if(Array.isArray(Q.content)){for(let q of Q.content)if(qX(q))J.add(q[M2])}}return Array.from(J)}function YX($,X){let J=g7($,X);if(J.length===0)return{};return{"x-stainless-helper":J.join(", ")}}function qY($){if(qX($))return{"x-stainless-helper":$[M2]};return{}}var M2;var N2=g(()=>{M2=Symbol("anthropic.sdk.stainlessHelper")});function zY($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var YY,YO=($=zY)=>function(J,...Q){if(J.length===1)return J[0];let q=!1,Y=[],z=J.reduce((U,V,B)=>{if(/[?#]/.test(V))q=!0;let D=Q[B],w=(q?encodeURIComponent:$)(""+D);if(B!==Q.length&&(D==null||typeof D==="object"&&D.toString===Object.getPrototypeOf(Object.getPrototypeOf(D.hasOwnProperty??YY)??YY)?.toString))w=D+"",Y.push({start:U.length+V.length,length:w.length,error:`Value of type ${Object.prototype.toString.call(D).slice(8,-1)} is not a valid path parameter`});return U+V+(B===Q.length?"":w)},""),G=z.split(/[?#]/,1)[0],W=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,H;while((H=W.exec(G))!==null)Y.push({start:H.index,length:H[0].length,error:`Value "${H[0]}" can't be safely passed as a path parameter`});if(Y.sort((U,V)=>U.start-V.start),Y.length>0){let U=0,V=Y.reduce((B,D)=>{let w=" ".repeat(D.start-U),M="^".repeat(D.length);return U=D.start+D.length,B+w+M},"");throw new P(`Path parameters result in path with invalid segments:
175
175
  ${Y.map((B)=>B.error).join(`
176
176
  `)}
177
177
  ${z}
178
- ${V}`)}return z},J$;var g0=g(()=>{j$();$Y=Object.freeze(Object.create(null)),J$=eD(XY)});var B2;var x7=g(()=>{q0();f$();V2();i8();g0();B2=class B2 extends q${list($={},X){let{betas:J,...Q}=$??{};return this._client.getAPIList("/v1/files",p$,{query:Q,...X,headers:u([{"anthropic-beta":[...J??[],"files-api-2025-04-14"].toString()},X?.headers])})}delete($,X={},J){let{betas:Q}=X??{};return this._client.delete(J$`/v1/files/${$}`,{...J,headers:u([{"anthropic-beta":[...Q??[],"files-api-2025-04-14"].toString()},J?.headers])})}download($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/files/${$}/content`,{...J,headers:u([{"anthropic-beta":[...Q??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},J?.headers]),__binaryResponse:!0})}retrieveMetadata($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/files/${$}`,{...J,headers:u([{"anthropic-beta":[...Q??[],"files-api-2025-04-14"].toString()},J?.headers])})}upload($,X){let{betas:J,...Q}=$;return this._client.post("/v1/files",d8({body:Q,...X,headers:u([{"anthropic-beta":[...J??[],"files-api-2025-04-14"].toString()},eq(Q.file),X?.headers])},this._client))}}});var K2;var y7=g(()=>{q0();f$();g0();K2=class K2 extends q${retrieve($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/models/${$}?beta=true`,{...J,headers:u([{...Q?.toString()!=null?{"anthropic-beta":Q?.toString()}:void 0},J?.headers])})}list($={},X){let{betas:J,...Q}=$??{};return this._client.getAPIList("/v1/models?beta=true",p$,{query:Q,...X,headers:u([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},X?.headers])})}}});var n8=g(()=>{j$()});var JX;var g7=g(()=>{JX={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function JY($){return $?.output_format??$?.output_config?.format}function v7($,X,J){let Q=JY(X);if(!X||!("parse"in(Q??{})))return{...$,content:$.content.map((q)=>{if(q.type==="text"){let Y=Object.defineProperty({...q},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(Y,"parsed",{get(){return J.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return q}),parsed_output:null};return h7($,X,J)}function h7($,X,J){let Q=null,q=$.content.map((Y)=>{if(Y.type==="text"){let z=JO(X,Y.text);if(Q===null)Q=z;let G=Object.defineProperty({...Y},"parsed_output",{value:z,enumerable:!1});return Object.defineProperty(G,"parsed",{get(){return J.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),z},enumerable:!1})}return Y});return{...$,content:q,parsed_output:Q}}function JO($,X){let J=JY($);if(J?.type!=="json_schema")return null;try{if("parse"in J)return J.parse(X);return JSON.parse(X)}catch(Q){throw new b(`Failed to parse structured output: ${Q}`)}}var u7=g(()=>{j$()});var QO=($)=>{let X=0,J=[];while(X<$.length){let Q=$[X];if(Q==="\\"){X++;continue}if(Q==="{"){J.push({type:"brace",value:"{"}),X++;continue}if(Q==="}"){J.push({type:"brace",value:"}"}),X++;continue}if(Q==="["){J.push({type:"paren",value:"["}),X++;continue}if(Q==="]"){J.push({type:"paren",value:"]"}),X++;continue}if(Q===":"){J.push({type:"separator",value:":"}),X++;continue}if(Q===","){J.push({type:"delimiter",value:","}),X++;continue}if(Q==='"'){let G="",W=!1;Q=$[++X];while(Q!=='"'){if(X===$.length){W=!0;break}if(Q==="\\"){if(X++,X===$.length){W=!0;break}G+=Q+$[X],Q=$[++X]}else G+=Q,Q=$[++X]}if(Q=$[++X],!W)J.push({type:"string",value:G});continue}if(Q&&/\s/.test(Q)){X++;continue}let Y=/[0-9]/;if(Q&&Y.test(Q)||Q==="-"||Q==="."){let G="";if(Q==="-")G+=Q,Q=$[++X];while(Q&&Y.test(Q)||Q===".")G+=Q,Q=$[++X];J.push({type:"number",value:G});continue}let z=/[a-z]/i;if(Q&&z.test(Q)){let G="";while(Q&&z.test(Q)){if(X===$.length)break;G+=Q,Q=$[++X]}if(G=="true"||G=="false"||G==="null")J.push({type:"name",value:G});else{X++;continue}continue}X++}return J},r8=($)=>{if($.length===0)return $;let X=$[$.length-1];switch(X.type){case"separator":return $=$.slice(0,$.length-1),r8($);break;case"number":let J=X.value[X.value.length-1];if(J==="."||J==="-")return $=$.slice(0,$.length-1),r8($);case"string":let Q=$[$.length-2];if(Q?.type==="delimiter")return $=$.slice(0,$.length-1),r8($);else if(Q?.type==="brace"&&Q.value==="{")return $=$.slice(0,$.length-1),r8($);break;case"delimiter":return $=$.slice(0,$.length-1),r8($);break}return $},qO=($)=>{let X=[];if($.map((J)=>{if(J.type==="brace")if(J.value==="{")X.push("}");else X.splice(X.lastIndexOf("}"),1);if(J.type==="paren")if(J.value==="[")X.push("]");else X.splice(X.lastIndexOf("]"),1)}),X.length>0)X.reverse().map((J)=>{if(J==="}")$.push({type:"brace",value:"}"});else if(J==="]")$.push({type:"paren",value:"]"})});return $},YO=($)=>{let X="";return $.map((J)=>{switch(J.type){case"string":X+='"'+J.value+'"';break;default:X+=J.value;break}}),X},QX=($)=>JSON.parse(YO(qO(r8(QO($)))));var m7=()=>{};var l7=g(()=>{E7()});function zY($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function GY($){}var v$,v0,s8,M2,qX,N2,D2,YX,O2,D0,w2,zX,GX,G8,WX,HX,L2,c7,QY,UX,p7,d7,i7,qY,YY="__json_buf",R2;var WY=g(()=>{K0();m7();n8();l7();u7();R2=class R2{constructor($,X){v$.add(this),this.messages=[],this.receivedMessages=[],v0.set(this,void 0),s8.set(this,null),this.controller=new AbortController,M2.set(this,void 0),qX.set(this,()=>{}),N2.set(this,()=>{}),D2.set(this,void 0),YX.set(this,()=>{}),O2.set(this,()=>{}),D0.set(this,{}),w2.set(this,!1),zX.set(this,!1),GX.set(this,!1),G8.set(this,!1),WX.set(this,void 0),HX.set(this,void 0),L2.set(this,void 0),UX.set(this,(J)=>{if(E(this,zX,!0,"f"),M0(J))J=new _$;if(J instanceof _$)return E(this,GX,!0,"f"),this._emit("abort",J);if(J instanceof b)return this._emit("error",J);if(J instanceof Error){let Q=new b(J.message);return Q.cause=J,this._emit("error",Q)}return this._emit("error",new b(String(J)))}),E(this,M2,new Promise((J,Q)=>{E(this,qX,J,"f"),E(this,N2,Q,"f")}),"f"),E(this,D2,new Promise((J,Q)=>{E(this,YX,J,"f"),E(this,O2,Q,"f")}),"f"),K(this,M2,"f").catch(()=>{}),K(this,D2,"f").catch(()=>{}),E(this,s8,$,"f"),E(this,L2,X?.logger??console,"f")}get response(){return K(this,WX,"f")}get request_id(){return K(this,HX,"f")}async withResponse(){E(this,G8,!0,"f");let $=await K(this,M2,"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 R2(null);return X._run(()=>X._fromReadableStream($)),X}static createMessage($,X,J,{logger:Q}={}){let q=new R2(X,{logger:Q});for(let Y of X.messages)q._addMessageParam(Y);return E(q,s8,{...X,stream:!0},"f"),q._run(()=>q._createMessage($,{...X,stream:!0},{...J,headers:{...J?.headers,"X-Stainless-Helper-Method":"stream"}})),q}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},K(this,UX,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,X=!0){if(this.receivedMessages.push($),X)this._emit("message",$)}async _createMessage($,X,J){let Q=J?.signal,q;if(Q){if(Q.aborted)this.controller.abort();q=this.controller.abort.bind(this.controller),Q.addEventListener("abort",q)}try{K(this,v$,"m",p7).call(this);let{response:Y,data:z}=await $.create({...X,stream:!0},{...J,signal:this.controller.signal}).withResponse();this._connected(Y);for await(let G of z)K(this,v$,"m",d7).call(this,G);if(z.controller.signal?.aborted)throw new _$;K(this,v$,"m",i7).call(this)}finally{if(Q&&q)Q.removeEventListener("abort",q)}}_connected($){if(this.ended)return;E(this,WX,$,"f"),E(this,HX,$?.headers.get("request-id"),"f"),K(this,qX,"f").call(this,$),this._emit("connect")}get ended(){return K(this,w2,"f")}get errored(){return K(this,zX,"f")}get aborted(){return K(this,GX,"f")}abort(){this.controller.abort()}on($,X){return(K(this,D0,"f")[$]||(K(this,D0,"f")[$]=[])).push({listener:X}),this}off($,X){let J=K(this,D0,"f")[$];if(!J)return this;let Q=J.findIndex((q)=>q.listener===X);if(Q>=0)J.splice(Q,1);return this}once($,X){return(K(this,D0,"f")[$]||(K(this,D0,"f")[$]=[])).push({listener:X,once:!0}),this}emitted($){return new Promise((X,J)=>{if(E(this,G8,!0,"f"),$!=="error")this.once("error",J);this.once($,X)})}async done(){E(this,G8,!0,"f"),await K(this,D2,"f")}get currentMessage(){return K(this,v0,"f")}async finalMessage(){return await this.done(),K(this,v$,"m",c7).call(this)}async finalText(){return await this.done(),K(this,v$,"m",QY).call(this)}_emit($,...X){if(K(this,w2,"f"))return;if($==="end")E(this,w2,!0,"f"),K(this,YX,"f").call(this);let J=K(this,D0,"f")[$];if(J)K(this,D0,"f")[$]=J.filter((Q)=>!Q.once),J.forEach(({listener:Q})=>Q(...X));if($==="abort"){let Q=X[0];if(!K(this,G8,"f")&&!J?.length)Promise.reject(Q);K(this,N2,"f").call(this,Q),K(this,O2,"f").call(this,Q),this._emit("end");return}if($==="error"){let Q=X[0];if(!K(this,G8,"f")&&!J?.length)Promise.reject(Q);K(this,N2,"f").call(this,Q),K(this,O2,"f").call(this,Q),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",K(this,v$,"m",c7).call(this))}async _fromReadableStream($,X){let J=X?.signal,Q;if(J){if(J.aborted)this.controller.abort();Q=this.controller.abort.bind(this.controller),J.addEventListener("abort",Q)}try{K(this,v$,"m",p7).call(this),this._connected(null);let q=b$.fromReadableStream($,this.controller);for await(let Y of q)K(this,v$,"m",d7).call(this,Y);if(q.controller.signal?.aborted)throw new _$;K(this,v$,"m",i7).call(this)}finally{if(J&&Q)J.removeEventListener("abort",Q)}}[(v0=new WeakMap,s8=new WeakMap,M2=new WeakMap,qX=new WeakMap,N2=new WeakMap,D2=new WeakMap,YX=new WeakMap,O2=new WeakMap,D0=new WeakMap,w2=new WeakMap,zX=new WeakMap,GX=new WeakMap,G8=new WeakMap,WX=new WeakMap,HX=new WeakMap,L2=new WeakMap,UX=new WeakMap,v$=new WeakSet,c7=function(){if(this.receivedMessages.length===0)throw new b("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},QY=function(){if(this.receivedMessages.length===0)throw new b("stream ended without producing a Message with role=assistant");let X=this.receivedMessages.at(-1).content.filter((J)=>J.type==="text").map((J)=>J.text);if(X.length===0)throw new b("stream ended without producing a content block with type=text");return X.join(" ")},p7=function(){if(this.ended)return;E(this,v0,void 0,"f")},d7=function(X){if(this.ended)return;let J=K(this,v$,"m",qY).call(this,X);switch(this._emit("streamEvent",X,J),X.type){case"content_block_delta":{let Q=J.content.at(-1);switch(X.delta.type){case"text_delta":{if(Q.type==="text")this._emit("text",X.delta.text,Q.text||"");break}case"citations_delta":{if(Q.type==="text")this._emit("citation",X.delta.citation,Q.citations??[]);break}case"input_json_delta":{if(zY(Q)&&Q.input)this._emit("inputJson",X.delta.partial_json,Q.input);break}case"thinking_delta":{if(Q.type==="thinking")this._emit("thinking",X.delta.thinking,Q.thinking);break}case"signature_delta":{if(Q.type==="thinking")this._emit("signature",Q.signature);break}case"compaction_delta":{if(Q.type==="compaction"&&Q.content)this._emit("compaction",Q.content);break}default:GY(X.delta)}break}case"message_stop":{this._addMessageParam(J),this._addMessage(v7(J,K(this,s8,"f"),{logger:K(this,L2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",J.content.at(-1));break}case"message_start":{E(this,v0,J,"f");break}case"content_block_start":case"message_delta":break}},i7=function(){if(this.ended)throw new b("stream has ended, this shouldn't happen");let X=K(this,v0,"f");if(!X)throw new b("request ended without sending any chunks");return E(this,v0,void 0,"f"),v7(X,K(this,s8,"f"),{logger:K(this,L2,"f")})},qY=function(X){let J=K(this,v0,"f");if(X.type==="message_start"){if(J)throw new b(`Unexpected event order, got ${X.type} before receiving "message_stop"`);return X.message}if(!J)throw new b(`Unexpected event order, got ${X.type} before "message_start"`);switch(X.type){case"message_stop":return J;case"message_delta":if(J.container=X.delta.container,J.stop_reason=X.delta.stop_reason,J.stop_sequence=X.delta.stop_sequence,J.usage.output_tokens=X.usage.output_tokens,J.context_management=X.context_management,X.usage.input_tokens!=null)J.usage.input_tokens=X.usage.input_tokens;if(X.usage.cache_creation_input_tokens!=null)J.usage.cache_creation_input_tokens=X.usage.cache_creation_input_tokens;if(X.usage.cache_read_input_tokens!=null)J.usage.cache_read_input_tokens=X.usage.cache_read_input_tokens;if(X.usage.server_tool_use!=null)J.usage.server_tool_use=X.usage.server_tool_use;if(X.usage.iterations!=null)J.usage.iterations=X.usage.iterations;return J;case"content_block_start":return J.content.push(X.content_block),J;case"content_block_delta":{let Q=J.content.at(X.index);switch(X.delta.type){case"text_delta":{if(Q?.type==="text")J.content[X.index]={...Q,text:(Q.text||"")+X.delta.text};break}case"citations_delta":{if(Q?.type==="text")J.content[X.index]={...Q,citations:[...Q.citations??[],X.delta.citation]};break}case"input_json_delta":{if(Q&&zY(Q)){let q=Q[YY]||"";q+=X.delta.partial_json;let Y={...Q};if(Object.defineProperty(Y,YY,{value:q,enumerable:!1,writable:!0}),q)try{Y.input=QX(q)}catch(z){let G=new b(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${z}. JSON: ${q}`);K(this,UX,"f").call(this,G)}J.content[X.index]=Y}break}case"thinking_delta":{if(Q?.type==="thinking")J.content[X.index]={...Q,thinking:Q.thinking+X.delta.thinking};break}case"signature_delta":{if(Q?.type==="thinking")J.content[X.index]={...Q,signature:X.delta.signature};break}case"compaction_delta":{if(Q?.type==="compaction")J.content[X.index]={...Q,content:(Q.content||"")+X.delta.content};break}default:GY(X.delta)}return J}case"content_block_stop":return J}},Symbol.asyncIterator)](){let $=[],X=[],J=!1;return this.on("streamEvent",(Q)=>{let q=X.shift();if(q)q.resolve(Q);else $.push(Q)}),this.on("end",()=>{J=!0;for(let Q of X)Q.resolve(void 0);X.length=0}),this.on("abort",(Q)=>{J=!0;for(let q of X)q.reject(Q);X.length=0}),this.on("error",(Q)=>{J=!0;for(let q of X)q.reject(Q);X.length=0}),{next:async()=>{if(!$.length){if(J)return{value:void 0,done:!0};return new Promise((q,Y)=>X.push({resolve:q,reject:Y})).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 b$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var a8;var VX=g(()=>{a8=class a8 extends Error{constructor($){let X=typeof $==="string"?$:$.map((J)=>{if(J.type==="text")return J.text;return`[${J.type}]`}).join(" ");super(X);this.name="ToolError",this.content=$}}});var HY=1e5,UY=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
178
+ ${V}`)}return z},J$;var v0=g(()=>{j$();YY=Object.freeze(Object.create(null)),J$=YO(zY)});var D2;var v7=g(()=>{Y0();f$();N2();r8();v0();D2=class D2 extends z${list($={},X){let{betas:J,...Q}=$??{};return this._client.getAPIList("/v1/files",p$,{query:Q,...X,headers:u([{"anthropic-beta":[...J??[],"files-api-2025-04-14"].toString()},X?.headers])})}delete($,X={},J){let{betas:Q}=X??{};return this._client.delete(J$`/v1/files/${$}`,{...J,headers:u([{"anthropic-beta":[...Q??[],"files-api-2025-04-14"].toString()},J?.headers])})}download($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/files/${$}/content`,{...J,headers:u([{"anthropic-beta":[...Q??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},J?.headers]),__binaryResponse:!0})}retrieveMetadata($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/files/${$}`,{...J,headers:u([{"anthropic-beta":[...Q??[],"files-api-2025-04-14"].toString()},J?.headers])})}upload($,X){let{betas:J,...Q}=$;return this._client.post("/v1/files",n8({body:Q,...X,headers:u([{"anthropic-beta":[...J??[],"files-api-2025-04-14"].toString()},qY(Q.file),X?.headers])},this._client))}}});var O2;var h7=g(()=>{Y0();f$();v0();O2=class O2 extends z${retrieve($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/models/${$}?beta=true`,{...J,headers:u([{...Q?.toString()!=null?{"anthropic-beta":Q?.toString()}:void 0},J?.headers])})}list($={},X){let{betas:J,...Q}=$??{};return this._client.getAPIList("/v1/models?beta=true",p$,{query:Q,...X,headers:u([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},X?.headers])})}}});var s8=g(()=>{j$()});var zX;var u7=g(()=>{zX={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function GY($){return $?.output_format??$?.output_config?.format}function m7($,X,J){let Q=GY(X);if(!X||!("parse"in(Q??{})))return{...$,content:$.content.map((q)=>{if(q.type==="text"){let Y=Object.defineProperty({...q},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(Y,"parsed",{get(){return J.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return q}),parsed_output:null};return l7($,X,J)}function l7($,X,J){let Q=null,q=$.content.map((Y)=>{if(Y.type==="text"){let z=WO(X,Y.text);if(Q===null)Q=z;let G=Object.defineProperty({...Y},"parsed_output",{value:z,enumerable:!1});return Object.defineProperty(G,"parsed",{get(){return J.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),z},enumerable:!1})}return Y});return{...$,content:q,parsed_output:Q}}function WO($,X){let J=GY($);if(J?.type!=="json_schema")return null;try{if("parse"in J)return J.parse(X);return JSON.parse(X)}catch(Q){throw new P(`Failed to parse structured output: ${Q}`)}}var c7=g(()=>{j$()});var HO=($)=>{let X=0,J=[];while(X<$.length){let Q=$[X];if(Q==="\\"){X++;continue}if(Q==="{"){J.push({type:"brace",value:"{"}),X++;continue}if(Q==="}"){J.push({type:"brace",value:"}"}),X++;continue}if(Q==="["){J.push({type:"paren",value:"["}),X++;continue}if(Q==="]"){J.push({type:"paren",value:"]"}),X++;continue}if(Q===":"){J.push({type:"separator",value:":"}),X++;continue}if(Q===","){J.push({type:"delimiter",value:","}),X++;continue}if(Q==='"'){let G="",W=!1;Q=$[++X];while(Q!=='"'){if(X===$.length){W=!0;break}if(Q==="\\"){if(X++,X===$.length){W=!0;break}G+=Q+$[X],Q=$[++X]}else G+=Q,Q=$[++X]}if(Q=$[++X],!W)J.push({type:"string",value:G});continue}if(Q&&/\s/.test(Q)){X++;continue}let Y=/[0-9]/;if(Q&&Y.test(Q)||Q==="-"||Q==="."){let G="";if(Q==="-")G+=Q,Q=$[++X];while(Q&&Y.test(Q)||Q===".")G+=Q,Q=$[++X];J.push({type:"number",value:G});continue}let z=/[a-z]/i;if(Q&&z.test(Q)){let G="";while(Q&&z.test(Q)){if(X===$.length)break;G+=Q,Q=$[++X]}if(G=="true"||G=="false"||G==="null")J.push({type:"name",value:G});else{X++;continue}continue}X++}return J},a8=($)=>{if($.length===0)return $;let X=$[$.length-1];switch(X.type){case"separator":return $=$.slice(0,$.length-1),a8($);break;case"number":let J=X.value[X.value.length-1];if(J==="."||J==="-")return $=$.slice(0,$.length-1),a8($);case"string":let Q=$[$.length-2];if(Q?.type==="delimiter")return $=$.slice(0,$.length-1),a8($);else if(Q?.type==="brace"&&Q.value==="{")return $=$.slice(0,$.length-1),a8($);break;case"delimiter":return $=$.slice(0,$.length-1),a8($);break}return $},UO=($)=>{let X=[];if($.map((J)=>{if(J.type==="brace")if(J.value==="{")X.push("}");else X.splice(X.lastIndexOf("}"),1);if(J.type==="paren")if(J.value==="[")X.push("]");else X.splice(X.lastIndexOf("]"),1)}),X.length>0)X.reverse().map((J)=>{if(J==="}")$.push({type:"brace",value:"}"});else if(J==="]")$.push({type:"paren",value:"]"})});return $},VO=($)=>{let X="";return $.map((J)=>{switch(J.type){case"string":X+='"'+J.value+'"';break;default:X+=J.value;break}}),X},GX=($)=>JSON.parse(VO(UO(a8(HO($)))));var p7=()=>{};var d7=g(()=>{S7()});function VY($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function BY($){}var v$,h0,o8,w2,WX,L2,R2,HX,A2,O0,_2,UX,VX,W8,BX,KX,F2,i7,WY,MX,n7,r7,s7,HY,UY="__json_buf",I2;var KY=g(()=>{M0();p7();s8();d7();c7();I2=class I2{constructor($,X){v$.add(this),this.messages=[],this.receivedMessages=[],h0.set(this,void 0),o8.set(this,null),this.controller=new AbortController,w2.set(this,void 0),WX.set(this,()=>{}),L2.set(this,()=>{}),R2.set(this,void 0),HX.set(this,()=>{}),A2.set(this,()=>{}),O0.set(this,{}),_2.set(this,!1),UX.set(this,!1),VX.set(this,!1),W8.set(this,!1),BX.set(this,void 0),KX.set(this,void 0),F2.set(this,void 0),MX.set(this,(J)=>{if(E(this,UX,!0,"f"),N0(J))J=new _$;if(J instanceof _$)return E(this,VX,!0,"f"),this._emit("abort",J);if(J instanceof P)return this._emit("error",J);if(J instanceof Error){let Q=new P(J.message);return Q.cause=J,this._emit("error",Q)}return this._emit("error",new P(String(J)))}),E(this,w2,new Promise((J,Q)=>{E(this,WX,J,"f"),E(this,L2,Q,"f")}),"f"),E(this,R2,new Promise((J,Q)=>{E(this,HX,J,"f"),E(this,A2,Q,"f")}),"f"),K(this,w2,"f").catch(()=>{}),K(this,R2,"f").catch(()=>{}),E(this,o8,$,"f"),E(this,F2,X?.logger??console,"f")}get response(){return K(this,BX,"f")}get request_id(){return K(this,KX,"f")}async withResponse(){E(this,W8,!0,"f");let $=await K(this,w2,"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 I2(null);return X._run(()=>X._fromReadableStream($)),X}static createMessage($,X,J,{logger:Q}={}){let q=new I2(X,{logger:Q});for(let Y of X.messages)q._addMessageParam(Y);return E(q,o8,{...X,stream:!0},"f"),q._run(()=>q._createMessage($,{...X,stream:!0},{...J,headers:{...J?.headers,"X-Stainless-Helper-Method":"stream"}})),q}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},K(this,MX,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,X=!0){if(this.receivedMessages.push($),X)this._emit("message",$)}async _createMessage($,X,J){let Q=J?.signal,q;if(Q){if(Q.aborted)this.controller.abort();q=this.controller.abort.bind(this.controller),Q.addEventListener("abort",q)}try{K(this,v$,"m",n7).call(this);let{response:Y,data:z}=await $.create({...X,stream:!0},{...J,signal:this.controller.signal}).withResponse();this._connected(Y);for await(let G of z)K(this,v$,"m",r7).call(this,G);if(z.controller.signal?.aborted)throw new _$;K(this,v$,"m",s7).call(this)}finally{if(Q&&q)Q.removeEventListener("abort",q)}}_connected($){if(this.ended)return;E(this,BX,$,"f"),E(this,KX,$?.headers.get("request-id"),"f"),K(this,WX,"f").call(this,$),this._emit("connect")}get ended(){return K(this,_2,"f")}get errored(){return K(this,UX,"f")}get aborted(){return K(this,VX,"f")}abort(){this.controller.abort()}on($,X){return(K(this,O0,"f")[$]||(K(this,O0,"f")[$]=[])).push({listener:X}),this}off($,X){let J=K(this,O0,"f")[$];if(!J)return this;let Q=J.findIndex((q)=>q.listener===X);if(Q>=0)J.splice(Q,1);return this}once($,X){return(K(this,O0,"f")[$]||(K(this,O0,"f")[$]=[])).push({listener:X,once:!0}),this}emitted($){return new Promise((X,J)=>{if(E(this,W8,!0,"f"),$!=="error")this.once("error",J);this.once($,X)})}async done(){E(this,W8,!0,"f"),await K(this,R2,"f")}get currentMessage(){return K(this,h0,"f")}async finalMessage(){return await this.done(),K(this,v$,"m",i7).call(this)}async finalText(){return await this.done(),K(this,v$,"m",WY).call(this)}_emit($,...X){if(K(this,_2,"f"))return;if($==="end")E(this,_2,!0,"f"),K(this,HX,"f").call(this);let J=K(this,O0,"f")[$];if(J)K(this,O0,"f")[$]=J.filter((Q)=>!Q.once),J.forEach(({listener:Q})=>Q(...X));if($==="abort"){let Q=X[0];if(!K(this,W8,"f")&&!J?.length)Promise.reject(Q);K(this,L2,"f").call(this,Q),K(this,A2,"f").call(this,Q),this._emit("end");return}if($==="error"){let Q=X[0];if(!K(this,W8,"f")&&!J?.length)Promise.reject(Q);K(this,L2,"f").call(this,Q),K(this,A2,"f").call(this,Q),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",K(this,v$,"m",i7).call(this))}async _fromReadableStream($,X){let J=X?.signal,Q;if(J){if(J.aborted)this.controller.abort();Q=this.controller.abort.bind(this.controller),J.addEventListener("abort",Q)}try{K(this,v$,"m",n7).call(this),this._connected(null);let q=P$.fromReadableStream($,this.controller);for await(let Y of q)K(this,v$,"m",r7).call(this,Y);if(q.controller.signal?.aborted)throw new _$;K(this,v$,"m",s7).call(this)}finally{if(J&&Q)J.removeEventListener("abort",Q)}}[(h0=new WeakMap,o8=new WeakMap,w2=new WeakMap,WX=new WeakMap,L2=new WeakMap,R2=new WeakMap,HX=new WeakMap,A2=new WeakMap,O0=new WeakMap,_2=new WeakMap,UX=new WeakMap,VX=new WeakMap,W8=new WeakMap,BX=new WeakMap,KX=new WeakMap,F2=new WeakMap,MX=new WeakMap,v$=new WeakSet,i7=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},WY=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((J)=>J.type==="text").map((J)=>J.text);if(X.length===0)throw new P("stream ended without producing a content block with type=text");return X.join(" ")},n7=function(){if(this.ended)return;E(this,h0,void 0,"f")},r7=function(X){if(this.ended)return;let J=K(this,v$,"m",HY).call(this,X);switch(this._emit("streamEvent",X,J),X.type){case"content_block_delta":{let Q=J.content.at(-1);switch(X.delta.type){case"text_delta":{if(Q.type==="text")this._emit("text",X.delta.text,Q.text||"");break}case"citations_delta":{if(Q.type==="text")this._emit("citation",X.delta.citation,Q.citations??[]);break}case"input_json_delta":{if(VY(Q)&&Q.input)this._emit("inputJson",X.delta.partial_json,Q.input);break}case"thinking_delta":{if(Q.type==="thinking")this._emit("thinking",X.delta.thinking,Q.thinking);break}case"signature_delta":{if(Q.type==="thinking")this._emit("signature",Q.signature);break}case"compaction_delta":{if(Q.type==="compaction"&&Q.content)this._emit("compaction",Q.content);break}default:BY(X.delta)}break}case"message_stop":{this._addMessageParam(J),this._addMessage(m7(J,K(this,o8,"f"),{logger:K(this,F2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",J.content.at(-1));break}case"message_start":{E(this,h0,J,"f");break}case"content_block_start":case"message_delta":break}},s7=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let X=K(this,h0,"f");if(!X)throw new P("request ended without sending any chunks");return E(this,h0,void 0,"f"),m7(X,K(this,o8,"f"),{logger:K(this,F2,"f")})},HY=function(X){let J=K(this,h0,"f");if(X.type==="message_start"){if(J)throw new P(`Unexpected event order, got ${X.type} before receiving "message_stop"`);return X.message}if(!J)throw new P(`Unexpected event order, got ${X.type} before "message_start"`);switch(X.type){case"message_stop":return J;case"message_delta":if(J.container=X.delta.container,J.stop_reason=X.delta.stop_reason,J.stop_sequence=X.delta.stop_sequence,J.usage.output_tokens=X.usage.output_tokens,J.context_management=X.context_management,X.usage.input_tokens!=null)J.usage.input_tokens=X.usage.input_tokens;if(X.usage.cache_creation_input_tokens!=null)J.usage.cache_creation_input_tokens=X.usage.cache_creation_input_tokens;if(X.usage.cache_read_input_tokens!=null)J.usage.cache_read_input_tokens=X.usage.cache_read_input_tokens;if(X.usage.server_tool_use!=null)J.usage.server_tool_use=X.usage.server_tool_use;if(X.usage.iterations!=null)J.usage.iterations=X.usage.iterations;return J;case"content_block_start":return J.content.push(X.content_block),J;case"content_block_delta":{let Q=J.content.at(X.index);switch(X.delta.type){case"text_delta":{if(Q?.type==="text")J.content[X.index]={...Q,text:(Q.text||"")+X.delta.text};break}case"citations_delta":{if(Q?.type==="text")J.content[X.index]={...Q,citations:[...Q.citations??[],X.delta.citation]};break}case"input_json_delta":{if(Q&&VY(Q)){let q=Q[UY]||"";q+=X.delta.partial_json;let Y={...Q};if(Object.defineProperty(Y,UY,{value:q,enumerable:!1,writable:!0}),q)try{Y.input=GX(q)}catch(z){let G=new P(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${z}. JSON: ${q}`);K(this,MX,"f").call(this,G)}J.content[X.index]=Y}break}case"thinking_delta":{if(Q?.type==="thinking")J.content[X.index]={...Q,thinking:Q.thinking+X.delta.thinking};break}case"signature_delta":{if(Q?.type==="thinking")J.content[X.index]={...Q,signature:X.delta.signature};break}case"compaction_delta":{if(Q?.type==="compaction")J.content[X.index]={...Q,content:(Q.content||"")+X.delta.content};break}default:BY(X.delta)}return J}case"content_block_stop":return J}},Symbol.asyncIterator)](){let $=[],X=[],J=!1;return this.on("streamEvent",(Q)=>{let q=X.shift();if(q)q.resolve(Q);else $.push(Q)}),this.on("end",()=>{J=!0;for(let Q of X)Q.resolve(void 0);X.length=0}),this.on("abort",(Q)=>{J=!0;for(let q of X)q.reject(Q);X.length=0}),this.on("error",(Q)=>{J=!0;for(let q of X)q.reject(Q);X.length=0}),{next:async()=>{if(!$.length){if(J)return{value:void 0,done:!0};return new Promise((q,Y)=>X.push({resolve:q,reject:Y})).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 P$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var t8;var NX=g(()=>{t8=class t8 extends Error{constructor($){let X=typeof $==="string"?$:$.map((J)=>{if(J.type==="text")return J.text;return`[${J.type}]`}).join(" ");super(X);this.name="ToolError",this.content=$}}});var MY=1e5,NY=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
179
179
  1. Task Overview
180
180
  The user's core request and success criteria
181
181
  Any clarifications or constraints they specified
@@ -197,66 +197,66 @@ User preferences or style requirements
197
197
  Domain-specific details that aren't obvious
198
198
  Any promises made to the user
199
199
  Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
200
- Wrap your summary in <summary></summary> tags.`;function BY(){let $,X;return{promise:new Promise((Q,q)=>{$=Q,X=q}),resolve:$,reject:X}}async function zO($,X=$.messages.at(-1)){if(!X||X.role!=="assistant"||!X.content||typeof X.content==="string")return null;let J=X.content.filter((q)=>q.type==="tool_use");if(J.length===0)return null;return{role:"user",content:await Promise.all(J.map(async(q)=>{let Y=$.tools.find((z)=>("name"in z?z.name:z.mcp_server_name)===q.name);if(!Y||!("run"in Y))return{type:"tool_result",tool_use_id:q.id,content:`Error: Tool '${q.name}' not found`,is_error:!0};try{let z=q.input;if("parse"in Y&&Y.parse)z=Y.parse(z);let G=await Y.run(z);return{type:"tool_result",tool_use_id:q.id,content:G}}catch(z){return{type:"tool_result",tool_use_id:q.id,content:z instanceof a8?z.content:`Error: ${z instanceof Error?z.message:String(z)}`,is_error:!0}}}))}}var A2,o8,W8,L$,_2,k$,O0,h0,F2,VY,n7,I2;var r7=g(()=>{K0();VX();j$();f$();V2();I2=class I2{constructor($,X,J){A2.add(this),this.client=$,o8.set(this,!1),W8.set(this,!1),L$.set(this,void 0),_2.set(this,void 0),k$.set(this,void 0),O0.set(this,void 0),h0.set(this,void 0),F2.set(this,0),E(this,L$,{params:{...X,messages:structuredClone(X.messages)}},"f");let q=["BetaToolRunner",...k7(X.tools,X.messages)].join(", ");E(this,_2,{...J,headers:u([{"x-stainless-helper":q},J?.headers])},"f"),E(this,h0,BY(),"f")}async*[(o8=new WeakMap,W8=new WeakMap,L$=new WeakMap,_2=new WeakMap,k$=new WeakMap,O0=new WeakMap,h0=new WeakMap,F2=new WeakMap,A2=new WeakSet,VY=async function(){let X=K(this,L$,"f").params.compactionControl;if(!X||!X.enabled)return!1;let J=0;if(K(this,k$,"f")!==void 0)try{let W=await K(this,k$,"f");J=W.usage.input_tokens+(W.usage.cache_creation_input_tokens??0)+(W.usage.cache_read_input_tokens??0)+W.usage.output_tokens}catch{return!1}let Q=X.contextTokenThreshold??HY;if(J<Q)return!1;let q=X.model??K(this,L$,"f").params.model,Y=X.summaryPrompt??UY,z=K(this,L$,"f").params.messages;if(z[z.length-1].role==="assistant"){let W=z[z.length-1];if(Array.isArray(W.content)){let H=W.content.filter((U)=>U.type!=="tool_use");if(H.length===0)z.pop();else W.content=H}}let G=await this.client.beta.messages.create({model:q,messages:[...z,{role:"user",content:[{type:"text",text:Y}]}],max_tokens:K(this,L$,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(G.content[0]?.type!=="text")throw new b("Expected text response for compaction");return K(this,L$,"f").params.messages=[{role:"user",content:G.content}],!0},Symbol.asyncIterator)](){var $;if(K(this,o8,"f"))throw new b("Cannot iterate over a consumed stream");E(this,o8,!0,"f"),E(this,W8,!0,"f"),E(this,O0,void 0,"f");try{while(!0){let X;try{if(K(this,L$,"f").params.max_iterations&&K(this,F2,"f")>=K(this,L$,"f").params.max_iterations)break;E(this,W8,!1,"f"),E(this,O0,void 0,"f"),E(this,F2,($=K(this,F2,"f"),$++,$),"f"),E(this,k$,void 0,"f");let{max_iterations:J,compactionControl:Q,...q}=K(this,L$,"f").params;if(q.stream)X=this.client.beta.messages.stream({...q},K(this,_2,"f")),E(this,k$,X.finalMessage(),"f"),K(this,k$,"f").catch(()=>{}),yield X;else E(this,k$,this.client.beta.messages.create({...q,stream:!1},K(this,_2,"f")),"f"),yield K(this,k$,"f");if(!await K(this,A2,"m",VY).call(this)){if(!K(this,W8,"f")){let{role:G,content:W}=await K(this,k$,"f");K(this,L$,"f").params.messages.push({role:G,content:W})}let z=await K(this,A2,"m",n7).call(this,K(this,L$,"f").params.messages.at(-1));if(z)K(this,L$,"f").params.messages.push(z);else if(!K(this,W8,"f"))break}}finally{if(X)X.abort()}}if(!K(this,k$,"f"))throw new b("ToolRunner concluded without a message from the server");K(this,h0,"f").resolve(await K(this,k$,"f"))}catch(X){throw E(this,o8,!1,"f"),K(this,h0,"f").promise.catch(()=>{}),K(this,h0,"f").reject(X),E(this,h0,BY(),"f"),X}}setMessagesParams($){if(typeof $==="function")K(this,L$,"f").params=$(K(this,L$,"f").params);else K(this,L$,"f").params=$;E(this,W8,!0,"f"),E(this,O0,void 0,"f")}async generateToolResponse(){let $=await K(this,k$,"f")??this.params.messages.at(-1);if(!$)return null;return K(this,A2,"m",n7).call(this,$)}done(){return K(this,h0,"f").promise}async runUntilDone(){if(!K(this,o8,"f"))for await(let $ of this);return this.done()}get params(){return K(this,L$,"f").params}pushMessages(...$){this.setMessagesParams((X)=>({...X,messages:[...X.messages,...$]}))}then($,X){return this.runUntilDone().then($,X)}};n7=async function(X){if(K(this,O0,"f")!==void 0)return K(this,O0,"f");return E(this,O0,zO(K(this,L$,"f").params,X),"f"),K(this,O0,"f")}});var t8;var s7=g(()=>{j$();F7();t8=class t8{constructor($,X){this.iterator=$,this.controller=X}async*decoder(){let $=new x0;for await(let X of this.iterator)for(let J of $.decode(X))yield JSON.parse(J);for(let X of $.flush())yield JSON.parse(X)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse($,X){if(!$.body){if(X.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new b("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new b("Attempted to iterate over a response with no body")}return new t8(X2($.body),X)}}});var E2;var a7=g(()=>{q0();f$();s7();n8();g0();E2=class E2 extends q${create($,X){let{betas:J,...Q}=$;return this._client.post("/v1/messages/batches?beta=true",{body:Q,...X,headers:u([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString()},X?.headers])})}retrieve($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/messages/batches/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...Q??[],"message-batches-2024-09-24"].toString()},J?.headers])})}list($={},X){let{betas:J,...Q}=$??{};return this._client.getAPIList("/v1/messages/batches?beta=true",p$,{query:Q,...X,headers:u([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString()},X?.headers])})}delete($,X={},J){let{betas:Q}=X??{};return this._client.delete(J$`/v1/messages/batches/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...Q??[],"message-batches-2024-09-24"].toString()},J?.headers])})}cancel($,X={},J){let{betas:Q}=X??{};return this._client.post(J$`/v1/messages/batches/${$}/cancel?beta=true`,{...J,headers:u([{"anthropic-beta":[...Q??[],"message-batches-2024-09-24"].toString()},J?.headers])})}async results($,X={},J){let Q=await this.retrieve($);if(!Q.results_url)throw new b(`No batch \`results_url\`; Has it finished processing? ${Q.processing_status} - ${Q.id}`);let{betas:q}=X??{};return this._client.get(Q.results_url,{...J,headers:u([{"anthropic-beta":[...q??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},J?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Y,z)=>t8.fromResponse(z.response,z.controller))}}});function MY($){if(!$.output_format)return $;if($.output_config?.format)throw new b("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:X,...J}=$;return{...J,output_config:{...$.output_config,format:X}}}var KY,WO,u0;var o7=g(()=>{n8();g7();f$();V2();u7();WY();r7();VX();a7();a7();r7();VX();KY={"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-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},WO=["claude-opus-4-6"];u0=class u0 extends q${constructor(){super(...arguments);this.batches=new E2(this._client)}create($,X){let J=MY($),{betas:Q,...q}=J;if(q.model in KY)console.warn(`The model '${q.model}' is deprecated and will reach end-of-life on ${KY[q.model]}
201
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(q.model in WO&&q.thinking&&q.thinking.type==="enabled")console.warn(`Using Claude with ${q.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let Y=this._client._options.timeout;if(!q.stream&&Y==null){let G=JX[q.model]??void 0;Y=this._client.calculateNonstreamingTimeout(q.max_tokens,G)}let z=XX(q.tools,q.messages);return this._client.post("/v1/messages?beta=true",{body:q,timeout:Y??600000,...X,headers:u([{...Q?.toString()!=null?{"anthropic-beta":Q?.toString()}:void 0},z,X?.headers]),stream:J.stream??!1})}parse($,X){return X={...X,headers:u([{"anthropic-beta":[...$.betas??[],"structured-outputs-2025-12-15"].toString()},X?.headers])},this.create($,X).then((J)=>h7(J,$,{logger:this._client.logger??console}))}stream($,X){return R2.createMessage(this,$,X)}countTokens($,X){let J=MY($),{betas:Q,...q}=J;return this._client.post("/v1/messages/count_tokens?beta=true",{body:q,...X,headers:u([{"anthropic-beta":[...Q??[],"token-counting-2024-11-01"].toString()},X?.headers])})}toolRunner($,X){return new I2(this._client,$,X)}};u0.Batches=E2;u0.BetaToolRunner=I2;u0.ToolError=a8});var T2;var t7=g(()=>{q0();f$();i8();g0();T2=class T2 extends q${create($,X={},J){let{betas:Q,...q}=X??{};return this._client.post(J$`/v1/skills/${$}/versions?beta=true`,d8({body:q,...J,headers:u([{"anthropic-beta":[...Q??[],"skills-2025-10-02"].toString()},J?.headers])},this._client))}retrieve($,X,J){let{skill_id:Q,betas:q}=X;return this._client.get(J$`/v1/skills/${Q}/versions/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...q??[],"skills-2025-10-02"].toString()},J?.headers])})}list($,X={},J){let{betas:Q,...q}=X??{};return this._client.getAPIList(J$`/v1/skills/${$}/versions?beta=true`,G2,{query:q,...J,headers:u([{"anthropic-beta":[...Q??[],"skills-2025-10-02"].toString()},J?.headers])})}delete($,X,J){let{skill_id:Q,betas:q}=X;return this._client.delete(J$`/v1/skills/${Q}/versions/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...q??[],"skills-2025-10-02"].toString()},J?.headers])})}}});var e8;var e7=g(()=>{t7();t7();q0();f$();i8();g0();e8=class e8 extends q${constructor(){super(...arguments);this.versions=new T2(this._client)}create($={},X){let{betas:J,...Q}=$??{};return this._client.post("/v1/skills?beta=true",d8({body:Q,...X,headers:u([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])},this._client,!1))}retrieve($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/skills/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...Q??[],"skills-2025-10-02"].toString()},J?.headers])})}list($={},X){let{betas:J,...Q}=$??{};return this._client.getAPIList("/v1/skills?beta=true",G2,{query:Q,...X,headers:u([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,X={},J){let{betas:Q}=X??{};return this._client.delete(J$`/v1/skills/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...Q??[],"skills-2025-10-02"].toString()},J?.headers])})}};e8.Versions=T2});var Y0;var $9=g(()=>{x7();x7();y7();y7();o7();o7();e7();e7();Y0=class Y0 extends q${constructor(){super(...arguments);this.models=new K2(this._client),this.messages=new u0(this._client),this.files=new B2(this._client),this.skills=new e8(this._client)}};Y0.Models=K2;Y0.Messages=u0;Y0.Files=B2;Y0.Skills=e8});var $6;var X9=g(()=>{f$();$6=class $6 extends q${create($,X){let{betas:J,...Q}=$;return this._client.post("/v1/complete",{body:Q,timeout:this._client._options.timeout??600000,...X,headers:u([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},X?.headers]),stream:$.stream??!1})}}});function NY($){return $?.output_config?.format}function J9($,X,J){let Q=NY(X);if(!X||!("parse"in(Q??{})))return{...$,content:$.content.map((q)=>{if(q.type==="text")return Object.defineProperty({...q},"parsed_output",{value:null,enumerable:!1});return q}),parsed_output:null};return Q9($,X,J)}function Q9($,X,J){let Q=null,q=$.content.map((Y)=>{if(Y.type==="text"){let z=BO(X,Y.text);if(Q===null)Q=z;return Object.defineProperty({...Y},"parsed_output",{value:z,enumerable:!1})}return Y});return{...$,content:q,parsed_output:Q}}function BO($,X){let J=NY($);if(J?.type!=="json_schema")return null;try{if("parse"in J)return J.parse(X);return JSON.parse(X)}catch(Q){throw new b(`Failed to parse structured output: ${Q}`)}}var q9=g(()=>{j$()});function LY($){return $.type==="tool_use"||$.type==="server_tool_use"}function RY($){}var h$,m0,X6,Z2,BX,S2,j2,KX,C2,w0,P2,MX,NX,H8,DX,OX,b2,Y9,DY,z9,G9,W9,H9,OY,wY="__json_buf",f2;var AY=g(()=>{K0();n8();l7();m7();q9();f2=class f2{constructor($,X){h$.add(this),this.messages=[],this.receivedMessages=[],m0.set(this,void 0),X6.set(this,null),this.controller=new AbortController,Z2.set(this,void 0),BX.set(this,()=>{}),S2.set(this,()=>{}),j2.set(this,void 0),KX.set(this,()=>{}),C2.set(this,()=>{}),w0.set(this,{}),P2.set(this,!1),MX.set(this,!1),NX.set(this,!1),H8.set(this,!1),DX.set(this,void 0),OX.set(this,void 0),b2.set(this,void 0),z9.set(this,(J)=>{if(E(this,MX,!0,"f"),M0(J))J=new _$;if(J instanceof _$)return E(this,NX,!0,"f"),this._emit("abort",J);if(J instanceof b)return this._emit("error",J);if(J instanceof Error){let Q=new b(J.message);return Q.cause=J,this._emit("error",Q)}return this._emit("error",new b(String(J)))}),E(this,Z2,new Promise((J,Q)=>{E(this,BX,J,"f"),E(this,S2,Q,"f")}),"f"),E(this,j2,new Promise((J,Q)=>{E(this,KX,J,"f"),E(this,C2,Q,"f")}),"f"),K(this,Z2,"f").catch(()=>{}),K(this,j2,"f").catch(()=>{}),E(this,X6,$,"f"),E(this,b2,X?.logger??console,"f")}get response(){return K(this,DX,"f")}get request_id(){return K(this,OX,"f")}async withResponse(){E(this,H8,!0,"f");let $=await K(this,Z2,"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 f2(null);return X._run(()=>X._fromReadableStream($)),X}static createMessage($,X,J,{logger:Q}={}){let q=new f2(X,{logger:Q});for(let Y of X.messages)q._addMessageParam(Y);return E(q,X6,{...X,stream:!0},"f"),q._run(()=>q._createMessage($,{...X,stream:!0},{...J,headers:{...J?.headers,"X-Stainless-Helper-Method":"stream"}})),q}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},K(this,z9,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,X=!0){if(this.receivedMessages.push($),X)this._emit("message",$)}async _createMessage($,X,J){let Q=J?.signal,q;if(Q){if(Q.aborted)this.controller.abort();q=this.controller.abort.bind(this.controller),Q.addEventListener("abort",q)}try{K(this,h$,"m",G9).call(this);let{response:Y,data:z}=await $.create({...X,stream:!0},{...J,signal:this.controller.signal}).withResponse();this._connected(Y);for await(let G of z)K(this,h$,"m",W9).call(this,G);if(z.controller.signal?.aborted)throw new _$;K(this,h$,"m",H9).call(this)}finally{if(Q&&q)Q.removeEventListener("abort",q)}}_connected($){if(this.ended)return;E(this,DX,$,"f"),E(this,OX,$?.headers.get("request-id"),"f"),K(this,BX,"f").call(this,$),this._emit("connect")}get ended(){return K(this,P2,"f")}get errored(){return K(this,MX,"f")}get aborted(){return K(this,NX,"f")}abort(){this.controller.abort()}on($,X){return(K(this,w0,"f")[$]||(K(this,w0,"f")[$]=[])).push({listener:X}),this}off($,X){let J=K(this,w0,"f")[$];if(!J)return this;let Q=J.findIndex((q)=>q.listener===X);if(Q>=0)J.splice(Q,1);return this}once($,X){return(K(this,w0,"f")[$]||(K(this,w0,"f")[$]=[])).push({listener:X,once:!0}),this}emitted($){return new Promise((X,J)=>{if(E(this,H8,!0,"f"),$!=="error")this.once("error",J);this.once($,X)})}async done(){E(this,H8,!0,"f"),await K(this,j2,"f")}get currentMessage(){return K(this,m0,"f")}async finalMessage(){return await this.done(),K(this,h$,"m",Y9).call(this)}async finalText(){return await this.done(),K(this,h$,"m",DY).call(this)}_emit($,...X){if(K(this,P2,"f"))return;if($==="end")E(this,P2,!0,"f"),K(this,KX,"f").call(this);let J=K(this,w0,"f")[$];if(J)K(this,w0,"f")[$]=J.filter((Q)=>!Q.once),J.forEach(({listener:Q})=>Q(...X));if($==="abort"){let Q=X[0];if(!K(this,H8,"f")&&!J?.length)Promise.reject(Q);K(this,S2,"f").call(this,Q),K(this,C2,"f").call(this,Q),this._emit("end");return}if($==="error"){let Q=X[0];if(!K(this,H8,"f")&&!J?.length)Promise.reject(Q);K(this,S2,"f").call(this,Q),K(this,C2,"f").call(this,Q),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",K(this,h$,"m",Y9).call(this))}async _fromReadableStream($,X){let J=X?.signal,Q;if(J){if(J.aborted)this.controller.abort();Q=this.controller.abort.bind(this.controller),J.addEventListener("abort",Q)}try{K(this,h$,"m",G9).call(this),this._connected(null);let q=b$.fromReadableStream($,this.controller);for await(let Y of q)K(this,h$,"m",W9).call(this,Y);if(q.controller.signal?.aborted)throw new _$;K(this,h$,"m",H9).call(this)}finally{if(J&&Q)J.removeEventListener("abort",Q)}}[(m0=new WeakMap,X6=new WeakMap,Z2=new WeakMap,BX=new WeakMap,S2=new WeakMap,j2=new WeakMap,KX=new WeakMap,C2=new WeakMap,w0=new WeakMap,P2=new WeakMap,MX=new WeakMap,NX=new WeakMap,H8=new WeakMap,DX=new WeakMap,OX=new WeakMap,b2=new WeakMap,z9=new WeakMap,h$=new WeakSet,Y9=function(){if(this.receivedMessages.length===0)throw new b("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},DY=function(){if(this.receivedMessages.length===0)throw new b("stream ended without producing a Message with role=assistant");let X=this.receivedMessages.at(-1).content.filter((J)=>J.type==="text").map((J)=>J.text);if(X.length===0)throw new b("stream ended without producing a content block with type=text");return X.join(" ")},G9=function(){if(this.ended)return;E(this,m0,void 0,"f")},W9=function(X){if(this.ended)return;let J=K(this,h$,"m",OY).call(this,X);switch(this._emit("streamEvent",X,J),X.type){case"content_block_delta":{let Q=J.content.at(-1);switch(X.delta.type){case"text_delta":{if(Q.type==="text")this._emit("text",X.delta.text,Q.text||"");break}case"citations_delta":{if(Q.type==="text")this._emit("citation",X.delta.citation,Q.citations??[]);break}case"input_json_delta":{if(LY(Q)&&Q.input)this._emit("inputJson",X.delta.partial_json,Q.input);break}case"thinking_delta":{if(Q.type==="thinking")this._emit("thinking",X.delta.thinking,Q.thinking);break}case"signature_delta":{if(Q.type==="thinking")this._emit("signature",Q.signature);break}default:RY(X.delta)}break}case"message_stop":{this._addMessageParam(J),this._addMessage(J9(J,K(this,X6,"f"),{logger:K(this,b2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",J.content.at(-1));break}case"message_start":{E(this,m0,J,"f");break}case"content_block_start":case"message_delta":break}},H9=function(){if(this.ended)throw new b("stream has ended, this shouldn't happen");let X=K(this,m0,"f");if(!X)throw new b("request ended without sending any chunks");return E(this,m0,void 0,"f"),J9(X,K(this,X6,"f"),{logger:K(this,b2,"f")})},OY=function(X){let J=K(this,m0,"f");if(X.type==="message_start"){if(J)throw new b(`Unexpected event order, got ${X.type} before receiving "message_stop"`);return X.message}if(!J)throw new b(`Unexpected event order, got ${X.type} before "message_start"`);switch(X.type){case"message_stop":return J;case"message_delta":if(J.stop_reason=X.delta.stop_reason,J.stop_sequence=X.delta.stop_sequence,J.usage.output_tokens=X.usage.output_tokens,X.usage.input_tokens!=null)J.usage.input_tokens=X.usage.input_tokens;if(X.usage.cache_creation_input_tokens!=null)J.usage.cache_creation_input_tokens=X.usage.cache_creation_input_tokens;if(X.usage.cache_read_input_tokens!=null)J.usage.cache_read_input_tokens=X.usage.cache_read_input_tokens;if(X.usage.server_tool_use!=null)J.usage.server_tool_use=X.usage.server_tool_use;return J;case"content_block_start":return J.content.push({...X.content_block}),J;case"content_block_delta":{let Q=J.content.at(X.index);switch(X.delta.type){case"text_delta":{if(Q?.type==="text")J.content[X.index]={...Q,text:(Q.text||"")+X.delta.text};break}case"citations_delta":{if(Q?.type==="text")J.content[X.index]={...Q,citations:[...Q.citations??[],X.delta.citation]};break}case"input_json_delta":{if(Q&&LY(Q)){let q=Q[wY]||"";q+=X.delta.partial_json;let Y={...Q};if(Object.defineProperty(Y,wY,{value:q,enumerable:!1,writable:!0}),q)Y.input=QX(q);J.content[X.index]=Y}break}case"thinking_delta":{if(Q?.type==="thinking")J.content[X.index]={...Q,thinking:Q.thinking+X.delta.thinking};break}case"signature_delta":{if(Q?.type==="thinking")J.content[X.index]={...Q,signature:X.delta.signature};break}default:RY(X.delta)}return J}case"content_block_stop":return J}},Symbol.asyncIterator)](){let $=[],X=[],J=!1;return this.on("streamEvent",(Q)=>{let q=X.shift();if(q)q.resolve(Q);else $.push(Q)}),this.on("end",()=>{J=!0;for(let Q of X)Q.resolve(void 0);X.length=0}),this.on("abort",(Q)=>{J=!0;for(let q of X)q.reject(Q);X.length=0}),this.on("error",(Q)=>{J=!0;for(let q of X)q.reject(Q);X.length=0}),{next:async()=>{if(!$.length){if(J)return{value:void 0,done:!0};return new Promise((q,Y)=>X.push({resolve:q,reject:Y})).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 b$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var k2;var U9=g(()=>{q0();f$();s7();n8();g0();k2=class k2 extends q${create($,X){return this._client.post("/v1/messages/batches",{body:$,...X})}retrieve($,X){return this._client.get(J$`/v1/messages/batches/${$}`,X)}list($={},X){return this._client.getAPIList("/v1/messages/batches",p$,{query:$,...X})}delete($,X){return this._client.delete(J$`/v1/messages/batches/${$}`,X)}cancel($,X){return this._client.post(J$`/v1/messages/batches/${$}/cancel`,X)}async results($,X){let J=await this.retrieve($);if(!J.results_url)throw new b(`No batch \`results_url\`; Has it finished processing? ${J.processing_status} - ${J.id}`);return this._client.get(J.results_url,{...X,headers:u([{Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Q,q)=>t8.fromResponse(q.response,q.controller))}}});var U8,_Y,MO;var V9=g(()=>{f$();V2();AY();q9();U9();U9();g7();U8=class U8 extends q${constructor(){super(...arguments);this.batches=new k2(this._client)}create($,X){if($.model in _Y)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${_Y[$.model]}
202
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if($.model in MO&&$.thinking&&$.thinking.type==="enabled")console.warn(`Using Claude with ${$.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let J=this._client._options.timeout;if(!$.stream&&J==null){let q=JX[$.model]??void 0;J=this._client.calculateNonstreamingTimeout($.max_tokens,q)}let Q=XX($.tools,$.messages);return this._client.post("/v1/messages",{body:$,timeout:J??600000,...X,headers:u([Q,X?.headers]),stream:$.stream??!1})}parse($,X){return this.create($,X).then((J)=>Q9(J,$,{logger:this._client.logger??console}))}stream($,X){return f2.createMessage(this,$,X,{logger:this._client.logger??console})}countTokens($,X){return this._client.post("/v1/messages/count_tokens",{body:$,...X})}};_Y={"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-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026"},MO=["claude-opus-4-6"];U8.Batches=k2});var J6;var B9=g(()=>{q0();f$();g0();J6=class J6 extends q${retrieve($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/models/${$}`,{...J,headers:u([{...Q?.toString()!=null?{"anthropic-beta":Q?.toString()}:void 0},J?.headers])})}list($={},X){let{betas:J,...Q}=$??{};return this._client.getAPIList("/v1/models",p$,{query:Q,...X,headers:u([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},X?.headers])})}}});var FY=g(()=>{$9();X9();V9();B9();oq()});var x2=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim();return};class Y${constructor({baseURL:$=x2("ANTHROPIC_BASE_URL"),apiKey:X=x2("ANTHROPIC_API_KEY")??null,authToken:J=x2("ANTHROPIC_AUTH_TOKEN")??null,...Q}={}){K9.add(this),wX.set(this,void 0);let q={apiKey:X,authToken:J,...Q,baseURL:$||"https://api.anthropic.com"};if(!q.dangerouslyAllowBrowser&&gq())throw new b(`It looks like you're running in a browser-like environment.
200
+ Wrap your summary in <summary></summary> tags.`;function OY(){let $,X;return{promise:new Promise((Q,q)=>{$=Q,X=q}),resolve:$,reject:X}}async function BO($,X=$.messages.at(-1)){if(!X||X.role!=="assistant"||!X.content||typeof X.content==="string")return null;let J=X.content.filter((q)=>q.type==="tool_use");if(J.length===0)return null;return{role:"user",content:await Promise.all(J.map(async(q)=>{let Y=$.tools.find((z)=>("name"in z?z.name:z.mcp_server_name)===q.name);if(!Y||!("run"in Y))return{type:"tool_result",tool_use_id:q.id,content:`Error: Tool '${q.name}' not found`,is_error:!0};try{let z=q.input;if("parse"in Y&&Y.parse)z=Y.parse(z);let G=await Y.run(z);return{type:"tool_result",tool_use_id:q.id,content:G}}catch(z){return{type:"tool_result",tool_use_id:q.id,content:z instanceof t8?z.content:`Error: ${z instanceof Error?z.message:String(z)}`,is_error:!0}}}))}}var E2,e8,H8,L$,Z2,k$,w0,u0,T2,DY,a7,S2;var o7=g(()=>{M0();NX();j$();f$();N2();S2=class S2{constructor($,X,J){E2.add(this),this.client=$,e8.set(this,!1),H8.set(this,!1),L$.set(this,void 0),Z2.set(this,void 0),k$.set(this,void 0),w0.set(this,void 0),u0.set(this,void 0),T2.set(this,0),E(this,L$,{params:{...X,messages:structuredClone(X.messages)}},"f");let q=["BetaToolRunner",...g7(X.tools,X.messages)].join(", ");E(this,Z2,{...J,headers:u([{"x-stainless-helper":q},J?.headers])},"f"),E(this,u0,OY(),"f")}async*[(e8=new WeakMap,H8=new WeakMap,L$=new WeakMap,Z2=new WeakMap,k$=new WeakMap,w0=new WeakMap,u0=new WeakMap,T2=new WeakMap,E2=new WeakSet,DY=async function(){let X=K(this,L$,"f").params.compactionControl;if(!X||!X.enabled)return!1;let J=0;if(K(this,k$,"f")!==void 0)try{let W=await K(this,k$,"f");J=W.usage.input_tokens+(W.usage.cache_creation_input_tokens??0)+(W.usage.cache_read_input_tokens??0)+W.usage.output_tokens}catch{return!1}let Q=X.contextTokenThreshold??MY;if(J<Q)return!1;let q=X.model??K(this,L$,"f").params.model,Y=X.summaryPrompt??NY,z=K(this,L$,"f").params.messages;if(z[z.length-1].role==="assistant"){let W=z[z.length-1];if(Array.isArray(W.content)){let H=W.content.filter((U)=>U.type!=="tool_use");if(H.length===0)z.pop();else W.content=H}}let G=await this.client.beta.messages.create({model:q,messages:[...z,{role:"user",content:[{type:"text",text:Y}]}],max_tokens:K(this,L$,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(G.content[0]?.type!=="text")throw new P("Expected text response for compaction");return K(this,L$,"f").params.messages=[{role:"user",content:G.content}],!0},Symbol.asyncIterator)](){var $;if(K(this,e8,"f"))throw new P("Cannot iterate over a consumed stream");E(this,e8,!0,"f"),E(this,H8,!0,"f"),E(this,w0,void 0,"f");try{while(!0){let X;try{if(K(this,L$,"f").params.max_iterations&&K(this,T2,"f")>=K(this,L$,"f").params.max_iterations)break;E(this,H8,!1,"f"),E(this,w0,void 0,"f"),E(this,T2,($=K(this,T2,"f"),$++,$),"f"),E(this,k$,void 0,"f");let{max_iterations:J,compactionControl:Q,...q}=K(this,L$,"f").params;if(q.stream)X=this.client.beta.messages.stream({...q},K(this,Z2,"f")),E(this,k$,X.finalMessage(),"f"),K(this,k$,"f").catch(()=>{}),yield X;else E(this,k$,this.client.beta.messages.create({...q,stream:!1},K(this,Z2,"f")),"f"),yield K(this,k$,"f");if(!await K(this,E2,"m",DY).call(this)){if(!K(this,H8,"f")){let{role:G,content:W}=await K(this,k$,"f");K(this,L$,"f").params.messages.push({role:G,content:W})}let z=await K(this,E2,"m",a7).call(this,K(this,L$,"f").params.messages.at(-1));if(z)K(this,L$,"f").params.messages.push(z);else if(!K(this,H8,"f"))break}}finally{if(X)X.abort()}}if(!K(this,k$,"f"))throw new P("ToolRunner concluded without a message from the server");K(this,u0,"f").resolve(await K(this,k$,"f"))}catch(X){throw E(this,e8,!1,"f"),K(this,u0,"f").promise.catch(()=>{}),K(this,u0,"f").reject(X),E(this,u0,OY(),"f"),X}}setMessagesParams($){if(typeof $==="function")K(this,L$,"f").params=$(K(this,L$,"f").params);else K(this,L$,"f").params=$;E(this,H8,!0,"f"),E(this,w0,void 0,"f")}async generateToolResponse(){let $=await K(this,k$,"f")??this.params.messages.at(-1);if(!$)return null;return K(this,E2,"m",a7).call(this,$)}done(){return K(this,u0,"f").promise}async runUntilDone(){if(!K(this,e8,"f"))for await(let $ of this);return this.done()}get params(){return K(this,L$,"f").params}pushMessages(...$){this.setMessagesParams((X)=>({...X,messages:[...X.messages,...$]}))}then($,X){return this.runUntilDone().then($,X)}};a7=async function(X){if(K(this,w0,"f")!==void 0)return K(this,w0,"f");return E(this,w0,BO(K(this,L$,"f").params,X),"f"),K(this,w0,"f")}});var $6;var t7=g(()=>{j$();Z7();$6=class $6{constructor($,X){this.iterator=$,this.controller=X}async*decoder(){let $=new y0;for await(let X of this.iterator)for(let J of $.decode(X))yield JSON.parse(J);for(let X of $.flush())yield JSON.parse(X)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse($,X){if(!$.body){if(X.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new P("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new P("Attempted to iterate over a response with no body")}return new $6(Y2($.body),X)}}});var j2;var e7=g(()=>{Y0();f$();t7();s8();v0();j2=class j2 extends z${create($,X){let{betas:J,...Q}=$;return this._client.post("/v1/messages/batches?beta=true",{body:Q,...X,headers:u([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString()},X?.headers])})}retrieve($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/messages/batches/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...Q??[],"message-batches-2024-09-24"].toString()},J?.headers])})}list($={},X){let{betas:J,...Q}=$??{};return this._client.getAPIList("/v1/messages/batches?beta=true",p$,{query:Q,...X,headers:u([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString()},X?.headers])})}delete($,X={},J){let{betas:Q}=X??{};return this._client.delete(J$`/v1/messages/batches/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...Q??[],"message-batches-2024-09-24"].toString()},J?.headers])})}cancel($,X={},J){let{betas:Q}=X??{};return this._client.post(J$`/v1/messages/batches/${$}/cancel?beta=true`,{...J,headers:u([{"anthropic-beta":[...Q??[],"message-batches-2024-09-24"].toString()},J?.headers])})}async results($,X={},J){let Q=await this.retrieve($);if(!Q.results_url)throw new P(`No batch \`results_url\`; Has it finished processing? ${Q.processing_status} - ${Q.id}`);let{betas:q}=X??{};return this._client.get(Q.results_url,{...J,headers:u([{"anthropic-beta":[...q??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},J?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Y,z)=>$6.fromResponse(z.response,z.controller))}}});function LY($){if(!$.output_format)return $;if($.output_config?.format)throw new P("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:X,...J}=$;return{...J,output_config:{...$.output_config,format:X}}}var wY,MO,m0;var $9=g(()=>{s8();u7();f$();N2();c7();KY();o7();NX();e7();e7();o7();NX();wY={"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-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},MO=["claude-opus-4-6"];m0=class m0 extends z${constructor(){super(...arguments);this.batches=new j2(this._client)}create($,X){let J=LY($),{betas:Q,...q}=J;if(q.model in wY)console.warn(`The model '${q.model}' is deprecated and will reach end-of-life on ${wY[q.model]}
201
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(q.model in MO&&q.thinking&&q.thinking.type==="enabled")console.warn(`Using Claude with ${q.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let Y=this._client._options.timeout;if(!q.stream&&Y==null){let G=zX[q.model]??void 0;Y=this._client.calculateNonstreamingTimeout(q.max_tokens,G)}let z=YX(q.tools,q.messages);return this._client.post("/v1/messages?beta=true",{body:q,timeout:Y??600000,...X,headers:u([{...Q?.toString()!=null?{"anthropic-beta":Q?.toString()}:void 0},z,X?.headers]),stream:J.stream??!1})}parse($,X){return X={...X,headers:u([{"anthropic-beta":[...$.betas??[],"structured-outputs-2025-12-15"].toString()},X?.headers])},this.create($,X).then((J)=>l7(J,$,{logger:this._client.logger??console}))}stream($,X){return I2.createMessage(this,$,X)}countTokens($,X){let J=LY($),{betas:Q,...q}=J;return this._client.post("/v1/messages/count_tokens?beta=true",{body:q,...X,headers:u([{"anthropic-beta":[...Q??[],"token-counting-2024-11-01"].toString()},X?.headers])})}toolRunner($,X){return new S2(this._client,$,X)}};m0.Batches=j2;m0.BetaToolRunner=S2;m0.ToolError=t8});var C2;var X9=g(()=>{Y0();f$();r8();v0();C2=class C2 extends z${create($,X={},J){let{betas:Q,...q}=X??{};return this._client.post(J$`/v1/skills/${$}/versions?beta=true`,n8({body:q,...J,headers:u([{"anthropic-beta":[...Q??[],"skills-2025-10-02"].toString()},J?.headers])},this._client))}retrieve($,X,J){let{skill_id:Q,betas:q}=X;return this._client.get(J$`/v1/skills/${Q}/versions/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...q??[],"skills-2025-10-02"].toString()},J?.headers])})}list($,X={},J){let{betas:Q,...q}=X??{};return this._client.getAPIList(J$`/v1/skills/${$}/versions?beta=true`,V2,{query:q,...J,headers:u([{"anthropic-beta":[...Q??[],"skills-2025-10-02"].toString()},J?.headers])})}delete($,X,J){let{skill_id:Q,betas:q}=X;return this._client.delete(J$`/v1/skills/${Q}/versions/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...q??[],"skills-2025-10-02"].toString()},J?.headers])})}}});var X6;var J9=g(()=>{X9();X9();Y0();f$();r8();v0();X6=class X6 extends z${constructor(){super(...arguments);this.versions=new C2(this._client)}create($={},X){let{betas:J,...Q}=$??{};return this._client.post("/v1/skills?beta=true",n8({body:Q,...X,headers:u([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])},this._client,!1))}retrieve($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/skills/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...Q??[],"skills-2025-10-02"].toString()},J?.headers])})}list($={},X){let{betas:J,...Q}=$??{};return this._client.getAPIList("/v1/skills?beta=true",V2,{query:Q,...X,headers:u([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,X={},J){let{betas:Q}=X??{};return this._client.delete(J$`/v1/skills/${$}?beta=true`,{...J,headers:u([{"anthropic-beta":[...Q??[],"skills-2025-10-02"].toString()},J?.headers])})}};X6.Versions=C2});var z0;var Q9=g(()=>{v7();v7();h7();h7();$9();$9();J9();J9();z0=class z0 extends z${constructor(){super(...arguments);this.models=new O2(this._client),this.messages=new m0(this._client),this.files=new D2(this._client),this.skills=new X6(this._client)}};z0.Models=O2;z0.Messages=m0;z0.Files=D2;z0.Skills=X6});var J6;var q9=g(()=>{f$();J6=class J6 extends z${create($,X){let{betas:J,...Q}=$;return this._client.post("/v1/complete",{body:Q,timeout:this._client._options.timeout??600000,...X,headers:u([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},X?.headers]),stream:$.stream??!1})}}});function RY($){return $?.output_config?.format}function Y9($,X,J){let Q=RY(X);if(!X||!("parse"in(Q??{})))return{...$,content:$.content.map((q)=>{if(q.type==="text")return Object.defineProperty({...q},"parsed_output",{value:null,enumerable:!1});return q}),parsed_output:null};return z9($,X,J)}function z9($,X,J){let Q=null,q=$.content.map((Y)=>{if(Y.type==="text"){let z=wO(X,Y.text);if(Q===null)Q=z;return Object.defineProperty({...Y},"parsed_output",{value:z,enumerable:!1})}return Y});return{...$,content:q,parsed_output:Q}}function wO($,X){let J=RY($);if(J?.type!=="json_schema")return null;try{if("parse"in J)return J.parse(X);return JSON.parse(X)}catch(Q){throw new P(`Failed to parse structured output: ${Q}`)}}var G9=g(()=>{j$()});function IY($){return $.type==="tool_use"||$.type==="server_tool_use"}function EY($){}var h$,l0,Q6,b2,DX,P2,f2,OX,k2,L0,x2,wX,LX,U8,RX,AX,y2,W9,AY,H9,U9,V9,B9,_Y,FY="__json_buf",g2;var ZY=g(()=>{M0();s8();d7();p7();G9();g2=class g2{constructor($,X){h$.add(this),this.messages=[],this.receivedMessages=[],l0.set(this,void 0),Q6.set(this,null),this.controller=new AbortController,b2.set(this,void 0),DX.set(this,()=>{}),P2.set(this,()=>{}),f2.set(this,void 0),OX.set(this,()=>{}),k2.set(this,()=>{}),L0.set(this,{}),x2.set(this,!1),wX.set(this,!1),LX.set(this,!1),U8.set(this,!1),RX.set(this,void 0),AX.set(this,void 0),y2.set(this,void 0),H9.set(this,(J)=>{if(E(this,wX,!0,"f"),N0(J))J=new _$;if(J instanceof _$)return E(this,LX,!0,"f"),this._emit("abort",J);if(J instanceof P)return this._emit("error",J);if(J instanceof Error){let Q=new P(J.message);return Q.cause=J,this._emit("error",Q)}return this._emit("error",new P(String(J)))}),E(this,b2,new Promise((J,Q)=>{E(this,DX,J,"f"),E(this,P2,Q,"f")}),"f"),E(this,f2,new Promise((J,Q)=>{E(this,OX,J,"f"),E(this,k2,Q,"f")}),"f"),K(this,b2,"f").catch(()=>{}),K(this,f2,"f").catch(()=>{}),E(this,Q6,$,"f"),E(this,y2,X?.logger??console,"f")}get response(){return K(this,RX,"f")}get request_id(){return K(this,AX,"f")}async withResponse(){E(this,U8,!0,"f");let $=await K(this,b2,"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 g2(null);return X._run(()=>X._fromReadableStream($)),X}static createMessage($,X,J,{logger:Q}={}){let q=new g2(X,{logger:Q});for(let Y of X.messages)q._addMessageParam(Y);return E(q,Q6,{...X,stream:!0},"f"),q._run(()=>q._createMessage($,{...X,stream:!0},{...J,headers:{...J?.headers,"X-Stainless-Helper-Method":"stream"}})),q}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},K(this,H9,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,X=!0){if(this.receivedMessages.push($),X)this._emit("message",$)}async _createMessage($,X,J){let Q=J?.signal,q;if(Q){if(Q.aborted)this.controller.abort();q=this.controller.abort.bind(this.controller),Q.addEventListener("abort",q)}try{K(this,h$,"m",U9).call(this);let{response:Y,data:z}=await $.create({...X,stream:!0},{...J,signal:this.controller.signal}).withResponse();this._connected(Y);for await(let G of z)K(this,h$,"m",V9).call(this,G);if(z.controller.signal?.aborted)throw new _$;K(this,h$,"m",B9).call(this)}finally{if(Q&&q)Q.removeEventListener("abort",q)}}_connected($){if(this.ended)return;E(this,RX,$,"f"),E(this,AX,$?.headers.get("request-id"),"f"),K(this,DX,"f").call(this,$),this._emit("connect")}get ended(){return K(this,x2,"f")}get errored(){return K(this,wX,"f")}get aborted(){return K(this,LX,"f")}abort(){this.controller.abort()}on($,X){return(K(this,L0,"f")[$]||(K(this,L0,"f")[$]=[])).push({listener:X}),this}off($,X){let J=K(this,L0,"f")[$];if(!J)return this;let Q=J.findIndex((q)=>q.listener===X);if(Q>=0)J.splice(Q,1);return this}once($,X){return(K(this,L0,"f")[$]||(K(this,L0,"f")[$]=[])).push({listener:X,once:!0}),this}emitted($){return new Promise((X,J)=>{if(E(this,U8,!0,"f"),$!=="error")this.once("error",J);this.once($,X)})}async done(){E(this,U8,!0,"f"),await K(this,f2,"f")}get currentMessage(){return K(this,l0,"f")}async finalMessage(){return await this.done(),K(this,h$,"m",W9).call(this)}async finalText(){return await this.done(),K(this,h$,"m",AY).call(this)}_emit($,...X){if(K(this,x2,"f"))return;if($==="end")E(this,x2,!0,"f"),K(this,OX,"f").call(this);let J=K(this,L0,"f")[$];if(J)K(this,L0,"f")[$]=J.filter((Q)=>!Q.once),J.forEach(({listener:Q})=>Q(...X));if($==="abort"){let Q=X[0];if(!K(this,U8,"f")&&!J?.length)Promise.reject(Q);K(this,P2,"f").call(this,Q),K(this,k2,"f").call(this,Q),this._emit("end");return}if($==="error"){let Q=X[0];if(!K(this,U8,"f")&&!J?.length)Promise.reject(Q);K(this,P2,"f").call(this,Q),K(this,k2,"f").call(this,Q),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",K(this,h$,"m",W9).call(this))}async _fromReadableStream($,X){let J=X?.signal,Q;if(J){if(J.aborted)this.controller.abort();Q=this.controller.abort.bind(this.controller),J.addEventListener("abort",Q)}try{K(this,h$,"m",U9).call(this),this._connected(null);let q=P$.fromReadableStream($,this.controller);for await(let Y of q)K(this,h$,"m",V9).call(this,Y);if(q.controller.signal?.aborted)throw new _$;K(this,h$,"m",B9).call(this)}finally{if(J&&Q)J.removeEventListener("abort",Q)}}[(l0=new WeakMap,Q6=new WeakMap,b2=new WeakMap,DX=new WeakMap,P2=new WeakMap,f2=new WeakMap,OX=new WeakMap,k2=new WeakMap,L0=new WeakMap,x2=new WeakMap,wX=new WeakMap,LX=new WeakMap,U8=new WeakMap,RX=new WeakMap,AX=new WeakMap,y2=new WeakMap,H9=new WeakMap,h$=new WeakSet,W9=function(){if(this.receivedMessages.length===0)throw new P("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},AY=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((J)=>J.type==="text").map((J)=>J.text);if(X.length===0)throw new P("stream ended without producing a content block with type=text");return X.join(" ")},U9=function(){if(this.ended)return;E(this,l0,void 0,"f")},V9=function(X){if(this.ended)return;let J=K(this,h$,"m",_Y).call(this,X);switch(this._emit("streamEvent",X,J),X.type){case"content_block_delta":{let Q=J.content.at(-1);switch(X.delta.type){case"text_delta":{if(Q.type==="text")this._emit("text",X.delta.text,Q.text||"");break}case"citations_delta":{if(Q.type==="text")this._emit("citation",X.delta.citation,Q.citations??[]);break}case"input_json_delta":{if(IY(Q)&&Q.input)this._emit("inputJson",X.delta.partial_json,Q.input);break}case"thinking_delta":{if(Q.type==="thinking")this._emit("thinking",X.delta.thinking,Q.thinking);break}case"signature_delta":{if(Q.type==="thinking")this._emit("signature",Q.signature);break}default:EY(X.delta)}break}case"message_stop":{this._addMessageParam(J),this._addMessage(Y9(J,K(this,Q6,"f"),{logger:K(this,y2,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",J.content.at(-1));break}case"message_start":{E(this,l0,J,"f");break}case"content_block_start":case"message_delta":break}},B9=function(){if(this.ended)throw new P("stream has ended, this shouldn't happen");let X=K(this,l0,"f");if(!X)throw new P("request ended without sending any chunks");return E(this,l0,void 0,"f"),Y9(X,K(this,Q6,"f"),{logger:K(this,y2,"f")})},_Y=function(X){let J=K(this,l0,"f");if(X.type==="message_start"){if(J)throw new P(`Unexpected event order, got ${X.type} before receiving "message_stop"`);return X.message}if(!J)throw new P(`Unexpected event order, got ${X.type} before "message_start"`);switch(X.type){case"message_stop":return J;case"message_delta":if(J.stop_reason=X.delta.stop_reason,J.stop_sequence=X.delta.stop_sequence,J.usage.output_tokens=X.usage.output_tokens,X.usage.input_tokens!=null)J.usage.input_tokens=X.usage.input_tokens;if(X.usage.cache_creation_input_tokens!=null)J.usage.cache_creation_input_tokens=X.usage.cache_creation_input_tokens;if(X.usage.cache_read_input_tokens!=null)J.usage.cache_read_input_tokens=X.usage.cache_read_input_tokens;if(X.usage.server_tool_use!=null)J.usage.server_tool_use=X.usage.server_tool_use;return J;case"content_block_start":return J.content.push({...X.content_block}),J;case"content_block_delta":{let Q=J.content.at(X.index);switch(X.delta.type){case"text_delta":{if(Q?.type==="text")J.content[X.index]={...Q,text:(Q.text||"")+X.delta.text};break}case"citations_delta":{if(Q?.type==="text")J.content[X.index]={...Q,citations:[...Q.citations??[],X.delta.citation]};break}case"input_json_delta":{if(Q&&IY(Q)){let q=Q[FY]||"";q+=X.delta.partial_json;let Y={...Q};if(Object.defineProperty(Y,FY,{value:q,enumerable:!1,writable:!0}),q)Y.input=GX(q);J.content[X.index]=Y}break}case"thinking_delta":{if(Q?.type==="thinking")J.content[X.index]={...Q,thinking:Q.thinking+X.delta.thinking};break}case"signature_delta":{if(Q?.type==="thinking")J.content[X.index]={...Q,signature:X.delta.signature};break}default:EY(X.delta)}return J}case"content_block_stop":return J}},Symbol.asyncIterator)](){let $=[],X=[],J=!1;return this.on("streamEvent",(Q)=>{let q=X.shift();if(q)q.resolve(Q);else $.push(Q)}),this.on("end",()=>{J=!0;for(let Q of X)Q.resolve(void 0);X.length=0}),this.on("abort",(Q)=>{J=!0;for(let q of X)q.reject(Q);X.length=0}),this.on("error",(Q)=>{J=!0;for(let q of X)q.reject(Q);X.length=0}),{next:async()=>{if(!$.length){if(J)return{value:void 0,done:!0};return new Promise((q,Y)=>X.push({resolve:q,reject:Y})).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 P$(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var v2;var K9=g(()=>{Y0();f$();t7();s8();v0();v2=class v2 extends z${create($,X){return this._client.post("/v1/messages/batches",{body:$,...X})}retrieve($,X){return this._client.get(J$`/v1/messages/batches/${$}`,X)}list($={},X){return this._client.getAPIList("/v1/messages/batches",p$,{query:$,...X})}delete($,X){return this._client.delete(J$`/v1/messages/batches/${$}`,X)}cancel($,X){return this._client.post(J$`/v1/messages/batches/${$}/cancel`,X)}async results($,X){let J=await this.retrieve($);if(!J.results_url)throw new P(`No batch \`results_url\`; Has it finished processing? ${J.processing_status} - ${J.id}`);return this._client.get(J.results_url,{...X,headers:u([{Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((Q,q)=>$6.fromResponse(q.response,q.controller))}}});var V8,TY,RO;var M9=g(()=>{f$();N2();ZY();G9();K9();K9();u7();V8=class V8 extends z${constructor(){super(...arguments);this.batches=new v2(this._client)}create($,X){if($.model in TY)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${TY[$.model]}
202
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if($.model in RO&&$.thinking&&$.thinking.type==="enabled")console.warn(`Using Claude with ${$.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let J=this._client._options.timeout;if(!$.stream&&J==null){let q=zX[$.model]??void 0;J=this._client.calculateNonstreamingTimeout($.max_tokens,q)}let Q=YX($.tools,$.messages);return this._client.post("/v1/messages",{body:$,timeout:J??600000,...X,headers:u([Q,X?.headers]),stream:$.stream??!1})}parse($,X){return this.create($,X).then((J)=>z9(J,$,{logger:this._client.logger??console}))}stream($,X){return g2.createMessage(this,$,X,{logger:this._client.logger??console})}countTokens($,X){return this._client.post("/v1/messages/count_tokens",{body:$,...X})}};TY={"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-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026"},RO=["claude-opus-4-6"];V8.Batches=v2});var q6;var N9=g(()=>{Y0();f$();v0();q6=class q6 extends z${retrieve($,X={},J){let{betas:Q}=X??{};return this._client.get(J$`/v1/models/${$}`,{...J,headers:u([{...Q?.toString()!=null?{"anthropic-beta":Q?.toString()}:void 0},J?.headers])})}list($={},X){let{betas:J,...Q}=$??{};return this._client.getAPIList("/v1/models",p$,{query:Q,...X,headers:u([{...J?.toString()!=null?{"anthropic-beta":J?.toString()}:void 0},X?.headers])})}}});var SY=g(()=>{Q9();q9();M9();N9();JY()});var h2=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim();return};class G${constructor({baseURL:$=h2("ANTHROPIC_BASE_URL"),apiKey:X=h2("ANTHROPIC_API_KEY")??null,authToken:J=h2("ANTHROPIC_AUTH_TOKEN")??null,...Q}={}){D9.add(this),_X.set(this,void 0);let q={apiKey:X,authToken:J,...Q,baseURL:$||"https://api.anthropic.com"};if(!q.dangerouslyAllowBrowser&&l1())throw new P(`It looks like you're running in a browser-like environment.
203
203
 
204
204
  This is disabled by default, as it risks exposing your secret API credentials to attackers.
205
205
  If you understand the risks and have appropriate mitigations in place,
206
206
  you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
207
207
 
208
208
  new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
209
- `);this.baseURL=q.baseURL,this.timeout=q.timeout??M9.DEFAULT_TIMEOUT,this.logger=q.logger??console;let Y="warn";this.logLevel=Y,this.logLevel=I7(q.logLevel,"ClientOptions.logLevel",this)??I7(x2("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Y,this.fetchOptions=q.fetchOptions,this.maxRetries=q.maxRetries??2,this.fetch=q.fetch??hq(),E(this,wX,mq,"f"),this._options=q,this.apiKey=typeof X==="string"?X:null,this.authToken=J}withOptions($){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...$})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:$,nulls:X}){if($.get("x-api-key")||$.get("authorization"))return;if(this.apiKey&&$.get("x-api-key"))return;if(X.has("x-api-key"))return;if(this.authToken&&$.get("authorization"))return;if(X.has("authorization"))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')}async authHeaders($){return u([await this.apiKeyAuth($),await this.bearerAuth($)])}async apiKeyAuth($){if(this.apiKey==null)return;return u([{"X-Api-Key":this.apiKey}])}async bearerAuth($){if(this.authToken==null)return;return u([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery($){return Object.entries($).filter(([X,J])=>typeof J<"u").map(([X,J])=>{if(typeof J==="string"||typeof J==="number"||typeof J==="boolean")return`${encodeURIComponent(X)}=${encodeURIComponent(J)}`;if(J===null)return`${encodeURIComponent(X)}=`;throw new b(`Cannot stringify type ${typeof J}; 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("&")}getUserAgent(){return`${this.constructor.name}/JS ${k0}`}defaultIdempotencyKey(){return`stainless-node-retry-${O7()}`}makeStatusError($,X,J,Q){return O$.generate($,X,J,Q)}buildURL($,X,J){let Q=!K(this,K9,"m",IY).call(this)&&J||this.baseURL,q=jq($)?new URL($):new URL(Q+(Q.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Y=this.defaultQuery();if(!Cq(Y))X={...Y,...X};if(typeof X==="object"&&X&&!Array.isArray(X))q.search=this.stringifyQuery(X);return q.toString()}_calculateNonstreamingTimeout($){if(3600*$/128000>600)throw new b("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions($){}async prepareRequest($,{url:X,options:J}){}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,J){return this.request(Promise.resolve(J).then((Q)=>{return{method:$,path:X,...Q}}))}request($,X=null){return new y0(this,this.makeRequest($,X,void 0))}async makeRequest($,X,J){let Q=await $,q=Q.maxRetries??this.maxRetries;if(X==null)X=q;await this.prepareOptions(Q);let{req:Y,url:z,timeout:G}=await this.buildRequest(Q,{retryCount:q-X});await this.prepareRequest(Y,{url:z,options:Q});let W="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),H=J===void 0?"":`, retryOf: ${J}`,U=Date.now();if(R$(this).debug(`[${W}] sending request`,N0({retryOfRequestLogID:J,method:Q.method,url:z,options:Q,headers:Y.headers})),Q.signal?.aborted)throw new _$;let V=new AbortController,B=await this.fetchWithTimeout(z,Y,G,V).catch($2),D=Date.now();if(B instanceof globalThis.Error){let N=`retrying, ${X} attempts remaining`;if(Q.signal?.aborted)throw new _$;let L=M0(B)||/timed? ?out/i.test(String(B)+("cause"in B?String(B.cause):""));if(X)return R$(this).info(`[${W}] connection ${L?"timed out":"failed"} - ${N}`),R$(this).debug(`[${W}] connection ${L?"timed out":"failed"} (${N})`,N0({retryOfRequestLogID:J,url:z,durationMs:D-U,message:B.message})),this.retryRequest(Q,X,J??W);if(R$(this).info(`[${W}] connection ${L?"timed out":"failed"} - error; no more retries left`),R$(this).debug(`[${W}] connection ${L?"timed out":"failed"} (error; no more retries left)`,N0({retryOfRequestLogID:J,url:z,durationMs:D-U,message:B.message})),L)throw new y8;throw new f0({cause:B})}let w=[...B.headers.entries()].filter(([N])=>N==="request-id").map(([N,L])=>", "+N+": "+JSON.stringify(L)).join(""),M=`[${W}${H}${w}] ${Y.method} ${z} ${B.ok?"succeeded":"failed"} with status ${B.status} in ${D-U}ms`;if(!B.ok){let N=await this.shouldRetry(B);if(X&&N){let k=`retrying, ${X} attempts remaining`;return await uq(B.body),R$(this).info(`${M} - ${k}`),R$(this).debug(`[${W}] response error (${k})`,N0({retryOfRequestLogID:J,url:B.url,status:B.status,headers:B.headers,durationMs:D-U})),this.retryRequest(Q,X,J??W,B.headers)}let L=N?"error; no more retries left":"error; not retryable";R$(this).info(`${M} - ${L}`);let I=await B.text().catch((k)=>$2(k).message),Z=i5(I),y=Z?void 0:I;throw R$(this).debug(`[${W}] response error (${L})`,N0({retryOfRequestLogID:J,url:B.url,status:B.status,headers:B.headers,message:y,durationMs:Date.now()-U})),this.makeStatusError(B.status,Z,y,B.headers)}return R$(this).info(M),R$(this).debug(`[${W}] response start`,N0({retryOfRequestLogID:J,url:B.url,status:B.status,headers:B.headers,durationMs:D-U})),{response:B,options:Q,controller:V,requestLogID:W,retryOfRequestLogID:J,startTime:U}}getAPIList($,X,J){return this.requestAPIList(X,J&&"then"in J?J.then((Q)=>({method:"get",path:$,...Q})):{method:"get",path:$,...J})}requestAPIList($,X){let J=this.makeRequest(X,null,void 0);return new z2(this,J,$)}async fetchWithTimeout($,X,J,Q){let{signal:q,method:Y,...z}=X||{},G=this._makeAbort(Q);if(q)q.addEventListener("abort",G,{once:!0});let W=setTimeout(G,J),H=globalThis.ReadableStream&&z.body instanceof globalThis.ReadableStream||typeof z.body==="object"&&z.body!==null&&Symbol.asyncIterator in z.body,U={signal:Q.signal,...H?{duplex:"half"}:{},method:"GET",...z};if(Y)U.method=Y.toUpperCase();try{return await this.fetch.call(void 0,$,U)}finally{clearTimeout(W)}}async 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,J,Q){let q,Y=Q?.get("retry-after-ms");if(Y){let G=parseFloat(Y);if(!Number.isNaN(G))q=G}let z=Q?.get("retry-after");if(z&&!q){let G=parseFloat(z);if(!Number.isNaN(G))q=G*1000;else q=Date.parse(z)-Date.now()}if(!(q&&0<=q&&q<60000)){let G=$.maxRetries??this.maxRetries;q=this.calculateDefaultRetryTimeoutMillis(X,G)}return await fq(q),this.makeRequest($,X-1,J)}calculateDefaultRetryTimeoutMillis($,X){let q=X-$,Y=Math.min(0.5*Math.pow(2,q),8),z=1-Math.random()*0.25;return Y*z*1000}calculateNonstreamingTimeout($,X){if(3600000*$/128000>600000||X!=null&&$>X)throw new b("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest($,{retryCount:X=0}={}){let J={...$},{method:Q,path:q,query:Y,defaultBaseURL:z}=J,G=this.buildURL(q,Y,z);if("timeout"in J)bq("timeout",J.timeout);J.timeout=J.timeout??this.timeout;let{bodyHeaders:W,body:H}=this.buildBody({options:J}),U=await this.buildHeaders({options:$,method:Q,bodyHeaders:W,retryCount:X});return{req:{method:Q,headers:U,...J.signal&&{signal:J.signal},...globalThis.ReadableStream&&H instanceof globalThis.ReadableStream&&{duplex:"half"},...H&&{body:H},...this.fetchOptions??{},...J.fetchOptions??{}},url:G,timeout:J.timeout}}async buildHeaders({options:$,method:X,bodyHeaders:J,retryCount:Q}){let q={};if(this.idempotencyHeader&&X!=="get"){if(!$.idempotencyKey)$.idempotencyKey=this.defaultIdempotencyKey();q[this.idempotencyHeader]=$.idempotencyKey}let Y=u([q,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(Q),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...vq(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders($),this._options.defaultHeaders,J,$.headers]);return this.validateHeaders(Y),Y.values}_makeAbort($){return()=>$.abort()}buildBody({options:{body:$,headers:X}}){if(!$)return{bodyHeaders:void 0,body:void 0};let J=u([X]);if(ArrayBuffer.isView($)||$ instanceof ArrayBuffer||$ instanceof DataView||typeof $==="string"&&J.values.has("content-type")||globalThis.Blob&&$ instanceof globalThis.Blob||$ instanceof FormData||$ instanceof URLSearchParams||globalThis.ReadableStream&&$ instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:$};else if(typeof $==="object"&&((Symbol.asyncIterator in $)||(Symbol.iterator in $)&&("next"in $)&&typeof $.next==="function"))return{bodyHeaders:void 0,body:n5($)};else return K(this,wX,"f").call(this,{body:$,headers:J})}}var K9,M9,wX,IY,N9="\\n\\nHuman:",D9="\\n\\nAssistant:",l0;var O9=g(()=>{K0();Y8();R7();j$();q0();f7();FY();t5();X9();B9();$9();V9();R7();f$();a5();Y8();M9=Y$,wX=new WeakMap,K9=new WeakSet,IY=function(){return this.baseURL!=="https://api.anthropic.com"};Y$.Anthropic=M9;Y$.HUMAN_PROMPT=N9;Y$.AI_PROMPT=D9;Y$.DEFAULT_TIMEOUT=600000;Y$.AnthropicError=b;Y$.APIError=O$;Y$.APIConnectionError=f0;Y$.APIConnectionTimeoutError=y8;Y$.APIUserAbortError=_$;Y$.NotFoundError=u8;Y$.ConflictError=m8;Y$.RateLimitError=c8;Y$.BadRequestError=g8;Y$.AuthenticationError=v8;Y$.InternalServerError=p8;Y$.PermissionDeniedError=h8;Y$.UnprocessableEntityError=l8;Y$.toFile=H2;l0=class l0 extends Y${constructor(){super(...arguments);this.completions=new $6(this),this.messages=new U8(this),this.models=new J6(this),this.beta=new Y0(this)}};l0.Completions=$6;l0.Messages=U8;l0.Models=J6;l0.Beta=Y0});var w9={};SX(w9,{toFile:()=>H2,default:()=>l0,UnprocessableEntityError:()=>l8,RateLimitError:()=>c8,PermissionDeniedError:()=>h8,PagePromise:()=>z2,NotFoundError:()=>u8,InternalServerError:()=>p8,HUMAN_PROMPT:()=>N9,ConflictError:()=>m8,BaseAnthropic:()=>Y$,BadRequestError:()=>g8,AuthenticationError:()=>v8,AnthropicError:()=>b,Anthropic:()=>l0,APIUserAbortError:()=>_$,APIPromise:()=>y0,APIError:()=>O$,APIConnectionTimeoutError:()=>y8,APIConnectionError:()=>f0,AI_PROMPT:()=>D9});var L9=g(()=>{O9();f7();t5();O9();q0();j$()});var t9=N3(o9(),1),{program:YL,createCommand:zL,createArgument:GL,createOption:WL,CommanderError:HL,InvalidArgumentError:UL,InvalidOptionArgumentError:VL,Command:L8,Argument:BL,Option:KL,Help:ML}=t9.default;B$();l$();J0();y5();e();function n6($,X={}){let J=$??r();if(!J)console.error(`Error: project.faf not found
209
+ `);this.baseURL=q.baseURL,this.timeout=q.timeout??O9.DEFAULT_TIMEOUT,this.logger=q.logger??console;let Y="warn";this.logLevel=Y,this.logLevel=T7(q.logLevel,"ClientOptions.logLevel",this)??T7(h2("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??Y,this.fetchOptions=q.fetchOptions,this.maxRetries=q.maxRetries??2,this.fetch=q.fetch??p1(),E(this,_X,i1,"f"),this._options=q,this.apiKey=typeof X==="string"?X:null,this.authToken=J}withOptions($){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...$})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:$,nulls:X}){if($.get("x-api-key")||$.get("authorization"))return;if(this.apiKey&&$.get("x-api-key"))return;if(X.has("x-api-key"))return;if(this.authToken&&$.get("authorization"))return;if(X.has("authorization"))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')}async authHeaders($){return u([await this.apiKeyAuth($),await this.bearerAuth($)])}async apiKeyAuth($){if(this.apiKey==null)return;return u([{"X-Api-Key":this.apiKey}])}async bearerAuth($){if(this.authToken==null)return;return u([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery($){return Object.entries($).filter(([X,J])=>typeof J<"u").map(([X,J])=>{if(typeof J==="string"||typeof J==="number"||typeof J==="boolean")return`${encodeURIComponent(X)}=${encodeURIComponent(J)}`;if(J===null)return`${encodeURIComponent(X)}=`;throw new P(`Cannot stringify type ${typeof J}; 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("&")}getUserAgent(){return`${this.constructor.name}/JS ${x0}`}defaultIdempotencyKey(){return`stainless-node-retry-${R7()}`}makeStatusError($,X,J,Q){return O$.generate($,X,J,Q)}buildURL($,X,J){let Q=!K(this,D9,"m",jY).call(this)&&J||this.baseURL,q=k1($)?new URL($):new URL(Q+(Q.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),Y=this.defaultQuery();if(!x1(Y))X={...Y,...X};if(typeof X==="object"&&X&&!Array.isArray(X))q.search=this.stringifyQuery(X);return q.toString()}_calculateNonstreamingTimeout($){if(3600*$/128000>600)throw new P("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions($){}async prepareRequest($,{url:X,options:J}){}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,J){return this.request(Promise.resolve(J).then((Q)=>{return{method:$,path:X,...Q}}))}request($,X=null){return new g0(this,this.makeRequest($,X,void 0))}async makeRequest($,X,J){let Q=await $,q=Q.maxRetries??this.maxRetries;if(X==null)X=q;await this.prepareOptions(Q);let{req:Y,url:z,timeout:G}=await this.buildRequest(Q,{retryCount:q-X});await this.prepareRequest(Y,{url:z,options:Q});let W="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),H=J===void 0?"":`, retryOf: ${J}`,U=Date.now();if(R$(this).debug(`[${W}] sending request`,D0({retryOfRequestLogID:J,method:Q.method,url:z,options:Q,headers:Y.headers})),Q.signal?.aborted)throw new _$;let V=new AbortController,B=await this.fetchWithTimeout(z,Y,G,V).catch(q2),D=Date.now();if(B instanceof globalThis.Error){let N=`retrying, ${X} attempts remaining`;if(Q.signal?.aborted)throw new _$;let L=N0(B)||/timed? ?out/i.test(String(B)+("cause"in B?String(B.cause):""));if(X)return R$(this).info(`[${W}] connection ${L?"timed out":"failed"} - ${N}`),R$(this).debug(`[${W}] connection ${L?"timed out":"failed"} (${N})`,D0({retryOfRequestLogID:J,url:z,durationMs:D-U,message:B.message})),this.retryRequest(Q,X,J??W);if(R$(this).info(`[${W}] connection ${L?"timed out":"failed"} - error; no more retries left`),R$(this).debug(`[${W}] connection ${L?"timed out":"failed"} (error; no more retries left)`,D0({retryOfRequestLogID:J,url:z,durationMs:D-U,message:B.message})),L)throw new v8;throw new k0({cause:B})}let w=[...B.headers.entries()].filter(([N])=>N==="request-id").map(([N,L])=>", "+N+": "+JSON.stringify(L)).join(""),M=`[${W}${H}${w}] ${Y.method} ${z} ${B.ok?"succeeded":"failed"} with status ${B.status} in ${D-U}ms`;if(!B.ok){let N=await this.shouldRetry(B);if(X&&N){let k=`retrying, ${X} attempts remaining`;return await d1(B.body),R$(this).info(`${M} - ${k}`),R$(this).debug(`[${W}] response error (${k})`,D0({retryOfRequestLogID:J,url:B.url,status:B.status,headers:B.headers,durationMs:D-U})),this.retryRequest(Q,X,J??W,B.headers)}let L=N?"error; no more retries left":"error; not retryable";R$(this).info(`${M} - ${L}`);let I=await B.text().catch((k)=>q2(k).message),T=a5(I),y=T?void 0:I;throw R$(this).debug(`[${W}] response error (${L})`,D0({retryOfRequestLogID:J,url:B.url,status:B.status,headers:B.headers,message:y,durationMs:Date.now()-U})),this.makeStatusError(B.status,T,y,B.headers)}return R$(this).info(M),R$(this).debug(`[${W}] response start`,D0({retryOfRequestLogID:J,url:B.url,status:B.status,headers:B.headers,durationMs:D-U})),{response:B,options:Q,controller:V,requestLogID:W,retryOfRequestLogID:J,startTime:U}}getAPIList($,X,J){return this.requestAPIList(X,J&&"then"in J?J.then((Q)=>({method:"get",path:$,...Q})):{method:"get",path:$,...J})}requestAPIList($,X){let J=this.makeRequest(X,null,void 0);return new U2(this,J,$)}async fetchWithTimeout($,X,J,Q){let{signal:q,method:Y,...z}=X||{},G=this._makeAbort(Q);if(q)q.addEventListener("abort",G,{once:!0});let W=setTimeout(G,J),H=globalThis.ReadableStream&&z.body instanceof globalThis.ReadableStream||typeof z.body==="object"&&z.body!==null&&Symbol.asyncIterator in z.body,U={signal:Q.signal,...H?{duplex:"half"}:{},method:"GET",...z};if(Y)U.method=Y.toUpperCase();try{return await this.fetch.call(void 0,$,U)}finally{clearTimeout(W)}}async 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,J,Q){let q,Y=Q?.get("retry-after-ms");if(Y){let G=parseFloat(Y);if(!Number.isNaN(G))q=G}let z=Q?.get("retry-after");if(z&&!q){let G=parseFloat(z);if(!Number.isNaN(G))q=G*1000;else q=Date.parse(z)-Date.now()}if(!(q&&0<=q&&q<60000)){let G=$.maxRetries??this.maxRetries;q=this.calculateDefaultRetryTimeoutMillis(X,G)}return await v1(q),this.makeRequest($,X-1,J)}calculateDefaultRetryTimeoutMillis($,X){let q=X-$,Y=Math.min(0.5*Math.pow(2,q),8),z=1-Math.random()*0.25;return Y*z*1000}calculateNonstreamingTimeout($,X){if(3600000*$/128000>600000||X!=null&&$>X)throw new P("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest($,{retryCount:X=0}={}){let J={...$},{method:Q,path:q,query:Y,defaultBaseURL:z}=J,G=this.buildURL(q,Y,z);if("timeout"in J)g1("timeout",J.timeout);J.timeout=J.timeout??this.timeout;let{bodyHeaders:W,body:H}=this.buildBody({options:J}),U=await this.buildHeaders({options:$,method:Q,bodyHeaders:W,retryCount:X});return{req:{method:Q,headers:U,...J.signal&&{signal:J.signal},...globalThis.ReadableStream&&H instanceof globalThis.ReadableStream&&{duplex:"half"},...H&&{body:H},...this.fetchOptions??{},...J.fetchOptions??{}},url:G,timeout:J.timeout}}async buildHeaders({options:$,method:X,bodyHeaders:J,retryCount:Q}){let q={};if(this.idempotencyHeader&&X!=="get"){if(!$.idempotencyKey)$.idempotencyKey=this.defaultIdempotencyKey();q[this.idempotencyHeader]=$.idempotencyKey}let Y=u([q,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(Q),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...c1(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders($),this._options.defaultHeaders,J,$.headers]);return this.validateHeaders(Y),Y.values}_makeAbort($){return()=>$.abort()}buildBody({options:{body:$,headers:X}}){if(!$)return{bodyHeaders:void 0,body:void 0};let J=u([X]);if(ArrayBuffer.isView($)||$ instanceof ArrayBuffer||$ instanceof DataView||typeof $==="string"&&J.values.has("content-type")||globalThis.Blob&&$ instanceof globalThis.Blob||$ instanceof FormData||$ instanceof URLSearchParams||globalThis.ReadableStream&&$ instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:$};else if(typeof $==="object"&&((Symbol.asyncIterator in $)||(Symbol.iterator in $)&&("next"in $)&&typeof $.next==="function"))return{bodyHeaders:void 0,body:o5($)};else return K(this,_X,"f").call(this,{body:$,headers:J})}}var D9,O9,_X,jY,w9="\\n\\nHuman:",L9="\\n\\nAssistant:",c0;var R9=g(()=>{M0();z8();F7();j$();Y0();y7();SY();JX();q9();N9();Q9();M9();F7();f$();$X();z8();O9=G$,_X=new WeakMap,D9=new WeakSet,jY=function(){return this.baseURL!=="https://api.anthropic.com"};G$.Anthropic=O9;G$.HUMAN_PROMPT=w9;G$.AI_PROMPT=L9;G$.DEFAULT_TIMEOUT=600000;G$.AnthropicError=P;G$.APIError=O$;G$.APIConnectionError=k0;G$.APIConnectionTimeoutError=v8;G$.APIUserAbortError=_$;G$.NotFoundError=l8;G$.ConflictError=c8;G$.RateLimitError=d8;G$.BadRequestError=h8;G$.AuthenticationError=u8;G$.InternalServerError=i8;G$.PermissionDeniedError=m8;G$.UnprocessableEntityError=p8;G$.toFile=K2;c0=class c0 extends G${constructor(){super(...arguments);this.completions=new J6(this),this.messages=new V8(this),this.models=new q6(this),this.beta=new z0(this)}};c0.Completions=J6;c0.Messages=V8;c0.Models=q6;c0.Beta=z0});var A9={};PX(A9,{toFile:()=>K2,default:()=>c0,UnprocessableEntityError:()=>p8,RateLimitError:()=>d8,PermissionDeniedError:()=>m8,PagePromise:()=>U2,NotFoundError:()=>l8,InternalServerError:()=>i8,HUMAN_PROMPT:()=>w9,ConflictError:()=>c8,BaseAnthropic:()=>G$,BadRequestError:()=>h8,AuthenticationError:()=>u8,AnthropicError:()=>P,Anthropic:()=>c0,APIUserAbortError:()=>_$,APIPromise:()=>g0,APIError:()=>O$,APIConnectionTimeoutError:()=>v8,APIConnectionError:()=>k0,AI_PROMPT:()=>L9});var _9=g(()=>{R9();y7();JX();R9();Y0();j$()});var XJ=R3($J(),1),{program:VL,createCommand:BL,createArgument:KL,createOption:ML,CommanderError:NL,InvalidArgumentError:DL,InvalidOptionArgumentError:OL,Command:R8,Argument:wL,Option:LL,Help:RL}=XJ.default;B$();l$();J0();a6();e();function o6($,X={}){let J=$??r();if(!J)console.error(`Error: project.faf not found
210
210
 
211
- Run 'faf init' to create one.`),process.exit(2);let Q=o(J),q=H$(Q),Y=U$(q);if(X.json){console.log(JSON.stringify(Y,null,2));return}if(X.status){console.log(`${x5(Y.tier)} ${S(`${Y.score}%`)}`);return}N$(Y,J,X.verbose)}g5();B$();l$();J0();e();import{existsSync as ZN}from"fs";import{join as P1}from"path";function r6($={}){let X=process.cwd(),J=$.output?$.output.endsWith(".faf")?$.output:P1(X,$.output):P1(X,"project.faf");if(ZN(J)&&!$.force)console.error(`project.faf already exists. Use ${S("--force")} to overwrite.`),process.exit(1);let Q=k8(X);Q$(J,Q);let q=o(J),Y=U$(H$(q));if(console.log(`${A("created")} ${J}`),N$(Y,J),Y.score<100)console.log(O(`
212
- run ${S("'faf go'")} to fill empty slots`))}J7();B$();import{existsSync as Q8,statSync as h5}from"fs";import{join as Y7}from"path";import{readFileSync as CN,writeFileSync as PN,existsSync as bN,statSync as jA}from"fs";import{join as k1}from"path";var x1="CLAUDE.md",fN="STATUS: BI-SYNC ACTIVE";function Q7($){let X=k1($,x1);if(!bN(X))return null;return CN(X,"utf-8")}function q7($,X){let J=k1($,x1);PN(J,X,"utf-8")}function b0($){return`<!-- faf: ${[$.project?.name,$.project?.main_language,$.project?.goal].filter(Boolean).map((J)=>String(J).trim()).join(" | ")} -->`}function y1($){let X=[],J=$.project?.name??"Project",Q=$.project?.main_language??"",q=$.project?.goal??"";if(X.push(b0($)),X.push(""),X.push(`# CLAUDE.md — ${J}`),X.push(""),q)X.push("## What This Is"),X.push(""),X.push(q),X.push("");let Y=$.stack??{},z=[];if(Q)z.push(`**Language:** ${Q}`);for(let[H,U]of Object.entries(Y))if(U&&U!=="slotignored"&&String(U).trim()){let V=H.replace(/_/g," ").replace(/\b\w/g,(B)=>B.toUpperCase());z.push(`**${V}:** ${U}`)}if(z.length>0){X.push("## Stack"),X.push("");for(let H of z)X.push(`- ${H}`);X.push("")}let G=$.human_context??{},W=[["Who",G.who],["What",G.what],["Why",G.why],["Where",G.where],["When",G.when],["How",G.how]].filter(([H,U])=>U&&String(U).trim());if(W.length>0){X.push("## Context"),X.push("");for(let[H,U]of W)X.push(`- **${H}:** ${U}`);X.push("")}return X.push("---"),X.push(""),X.push(`*${fN} — ${new Date().toISOString()}*`),X.push(""),X.join(`
213
- `)}function g1($,X){let J=b0(X),Q=$.split(`
211
+ Run 'faf init' to create one.`),process.exit(2);let Q=a(J),q=q$(Q),Y=Y$(q);if(X.json){console.log(JSON.stringify(Y,null,2));return}if(X.status){console.log(`${h5(Y.tier)} ${S(`${Y.score}%`)}`);return}N$(Y,J,X.verbose)}u5();B$();l$();J0();e();import{existsSync as PN}from"fs";import{join as kq}from"path";function t6($={}){let X=process.cwd(),J=$.output?$.output.endsWith(".faf")?$.output:kq(X,$.output):kq(X,"project.faf");if(PN(J)&&!$.force)console.error(`project.faf already exists. Use ${S("--force")} to overwrite.`),process.exit(1);let Q=x8(X);Q$(J,Q);let q=a(J),Y=Y$(q$(q));if(console.log(`${A("created")} ${J}`),N$(Y,J),Y.score<100)console.log(O(`
212
+ run ${S("'faf go'")} to fill empty slots`))}Y7();B$();import{existsSync as q8,statSync as c5}from"fs";import{join as W7}from"path";import{readFileSync as yN,writeFileSync as gN,existsSync as vN,statSync as hA}from"fs";import{join as hq}from"path";var uq="CLAUDE.md",hN="STATUS: BI-SYNC ACTIVE";function z7($){let X=hq($,uq);if(!vN(X))return null;return yN(X,"utf-8")}function G7($,X){let J=hq($,uq);gN(J,X,"utf-8")}function f0($){return`<!-- faf: ${[$.project?.name,$.project?.main_language,$.project?.goal].filter(Boolean).map((J)=>String(J).trim()).join(" | ")} -->`}function mq($){let X=[],J=$.project?.name??"Project",Q=$.project?.main_language??"",q=$.project?.goal??"";if(X.push(f0($)),X.push(""),X.push(`# CLAUDE.md — ${J}`),X.push(""),q)X.push("## What This Is"),X.push(""),X.push(q),X.push("");let Y=$.stack??{},z=[];if(Q)z.push(`**Language:** ${Q}`);for(let[H,U]of Object.entries(Y))if(U&&U!=="slotignored"&&String(U).trim()){let V=H.replace(/_/g," ").replace(/\b\w/g,(B)=>B.toUpperCase());z.push(`**${V}:** ${U}`)}if(z.length>0){X.push("## Stack"),X.push("");for(let H of z)X.push(`- ${H}`);X.push("")}let G=$.human_context??{},W=[["Who",G.who],["What",G.what],["Why",G.why],["Where",G.where],["When",G.when],["How",G.how]].filter(([H,U])=>U&&String(U).trim());if(W.length>0){X.push("## Context"),X.push("");for(let[H,U]of W)X.push(`- **${H}:** ${U}`);X.push("")}return X.push("---"),X.push(""),X.push(`*${hN} — ${new Date().toISOString()}*`),X.push(""),X.join(`
213
+ `)}function lq($,X){let J=f0(X),Q=$.split(`
214
214
  `);if(Q[0]?.startsWith("<!-- faf:")){if(Q[0]===J)return{content:$,changed:!1};return Q[0]=J,{content:Q.join(`
215
215
  `),changed:!0}}return{content:`${J}
216
216
 
217
- ${$}`,changed:!0}}function v5($){let X={project:{}},J=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(J)X.project.name=J[1].trim();if(!X.project.name){let Y=$.match(/\*\*Name:\*\*\s*(.+)/);if(Y)X.project.name=Y[1].trim()}let Q=$.match(/## What This Is\s*\n\s*\n(.+)/);if(Q)X.project.goal=Q[1].trim();if(!X.project.goal){let Y=$.match(/\*\*What Building:\*\*\s*(.+)/);if(Y)X.project.goal=Y[1].trim()}let q=$.match(/\*\*Language:\*\*\s*(.+)/);if(q)X.project.main_language=q[1].trim();if(!X.project.main_language){let Y=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(Y)X.project.main_language=Y[1].trim()}return X}import{readFileSync as fA,writeFileSync as kN,existsSync as kA}from"fs";import{join as xN}from"path";function v1($,X){kN(xN($,"MEMORY.md"),X,"utf-8")}l$();J0();e();function s6($={}){let X=process.cwd(),J=r(X);if(!J)console.error(`Error: project.faf not found
217
+ ${$}`,changed:!0}}function l5($){let X={project:{}},J=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(J)X.project.name=J[1].trim();if(!X.project.name){let Y=$.match(/\*\*Name:\*\*\s*(.+)/);if(Y)X.project.name=Y[1].trim()}let Q=$.match(/## What This Is\s*\n\s*\n(.+)/);if(Q)X.project.goal=Q[1].trim();if(!X.project.goal){let Y=$.match(/\*\*What Building:\*\*\s*(.+)/);if(Y)X.project.goal=Y[1].trim()}let q=$.match(/\*\*Language:\*\*\s*(.+)/);if(q)X.project.main_language=q[1].trim();if(!X.project.main_language){let Y=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(Y)X.project.main_language=Y[1].trim()}return X}import{readFileSync as cA,writeFileSync as uN,existsSync as pA}from"fs";import{join as mN}from"path";function cq($,X){uN(mN($,"MEMORY.md"),X,"utf-8")}l$();J0();m5();e();function e6($={}){let X=Date.now(),J=process.cwd(),Q=r(J);if(!Q)console.error(`Error: project.faf not found
218
218
 
219
- Run 'faf init' to create one.`),process.exit(2);let Q=Y7(X,"CLAUDE.md"),q=Y7(X,"MEMORY.md"),Y=$.direction??"auto";if(Y==="auto")h1(J,Q,X);else if(Y==="push")u1(J,X);else if(Y==="pull")z7(J,Q);if(m1(J,q,X),$.watch)console.log(O("watching for changes... (Ctrl+C to stop)")),gN(J,Q,q,X)}function h1($,X,J){let Q=h5($).mtimeMs,q=Q8(X)?h5(X).mtimeMs:0;if(!Q8(X)||Q>q)u1($,J);else z7($,X)}function u1($,X){let J=Y7(X,"CLAUDE.md"),Q=$$($);if(Q8(J)){let z=Q7(X);if(z){let{content:G,changed:W}=g1(z,Q);if(W)q7(X,G),console.log(`${A("◆")} sync .faf → CLAUDE.md (stamped) ${O("← bi-sync")}`);else console.log(`${A("◆")} sync CLAUDE.md up-to-date ${O("← bi-sync")}`)}z7($,J);return}let q=y1(Q);q7(X,q),console.log(`${A("◆")} sync .faf → CLAUDE.md (created) ${O("← bi-sync")}`);let Y=U$(H$(o($)));N$(Y,$)}function z7($,X){let J=Q7(X.replace("/CLAUDE.md",""));if(!J){console.error("CLAUDE.md not found.");return}let Q=v5(J),q=$$($);if(Q.project?.name)q.project={...q.project,name:Q.project.name};if(Q.project?.goal)q.project={...q.project,goal:Q.project.goal};if(Q.project?.main_language)q.project={...q.project,main_language:Q.project.main_language};Q$($,q),console.log(`${A("◆")} sync CLAUDE.md → .faf ${O("← bi-sync")}`);let Y=U$(H$(o($)));N$(Y,$)}function m1($,X,J){let Q=$$($),q=h5($).mtimeMs,Y=Q8(X)?h5(X).mtimeMs:0;if(!Q8(X)||q>Y){let z=yN(Q);v1(J,z),console.log(`${A("◆")} sync .faf → MEMORY.md ${O("← tri-sync")}`)}else console.log(`${A("◆")} sync MEMORY.md → .faf ${O("← tri-sync")}`)}function yN($){let X=$.project??{},J=[`# ${X.name??"Project"} — Memory Topics`,"","> Generated by faf sync (tri-sync)",""];if(X.name)J.push(`- **Project:** ${X.name}`);if(X.goal)J.push(`- **Goal:** ${X.goal}`);if(X.main_language)J.push(`- **Language:** ${X.main_language}`);if(X.type)J.push(`- **Type:** ${X.type}`);return`${J.join(`
219
+ Run 'faf init' to create one.`),process.exit(2);let q=W7(J,"CLAUDE.md"),Y=W7(J,"MEMORY.md"),z=$.direction??"auto";if(z==="auto")pq(Q,q,J);else if(z==="push")dq(Q,J);else if(z==="pull")H7(Q,q);if(iq(Q,Y,J),$.watch){console.log(O("watching for changes... (Ctrl+C to stop)")),cN(Q,q,Y,J);return}if(Date.now()-X>=5000)q0("FAF: sync complete")}function pq($,X,J){let Q=c5($).mtimeMs,q=q8(X)?c5(X).mtimeMs:0;if(!q8(X)||Q>q)dq($,J);else H7($,X)}function dq($,X){let J=W7(X,"CLAUDE.md"),Q=$$($);if(q8(J)){let z=z7(X);if(z){let{content:G,changed:W}=lq(z,Q);if(W)G7(X,G),console.log(`${A("◆")} sync .faf → CLAUDE.md (stamped) ${O("← bi-sync")}`);else console.log(`${A("◆")} sync CLAUDE.md up-to-date ${O("← bi-sync")}`)}H7($,J);return}let q=mq(Q);G7(X,q),console.log(`${A("◆")} sync .faf → CLAUDE.md (created) ${O("← bi-sync")}`);let Y=Y$(q$(a($)));N$(Y,$)}function H7($,X){let J=z7(X.replace("/CLAUDE.md",""));if(!J){console.error("CLAUDE.md not found.");return}let Q=l5(J),q=$$($);if(Q.project?.name)q.project={...q.project,name:Q.project.name};if(Q.project?.goal)q.project={...q.project,goal:Q.project.goal};if(Q.project?.main_language)q.project={...q.project,main_language:Q.project.main_language};Q$($,q),console.log(`${A("◆")} sync CLAUDE.md → .faf ${O("← bi-sync")}`);let Y=Y$(q$(a($)));N$(Y,$)}function iq($,X,J){let Q=$$($),q=c5($).mtimeMs,Y=q8(X)?c5(X).mtimeMs:0;if(!q8(X)||q>Y){let z=lN(Q);cq(J,z),console.log(`${A("◆")} sync .faf → MEMORY.md ${O("← tri-sync")}`)}else console.log(`${A("◆")} sync MEMORY.md → .faf ${O("← tri-sync")}`)}function lN($){let X=$.project??{},J=[`# ${X.name??"Project"} — Memory Topics`,"","> Generated by faf sync (tri-sync)",""];if(X.name)J.push(`- **Project:** ${X.name}`);if(X.goal)J.push(`- **Goal:** ${X.goal}`);if(X.main_language)J.push(`- **Language:** ${X.main_language}`);if(X.type)J.push(`- **Type:** ${X.type}`);return`${J.join(`
220
220
  `)}
221
- `}function gN($,X,J,Q){let{watch:q}=W$("fs"),Y=null,z=()=>{if(Y)clearTimeout(Y);Y=setTimeout(()=>{console.log(O("change detected...")),h1($,X,Q),m1($,J,Q)},200)};if(q($,z),Q8(X))q(X,z);if(Q8(J))q(J,z)}B$();e();import{writeFileSync as vN}from"fs";function l1($,X={}){let J=$??r();if(!J)console.error(`Error: project.faf not found
221
+ `}function cN($,X,J,Q){let{watch:q}=U$("fs"),Y=null,z=()=>{if(Y)clearTimeout(Y);Y=setTimeout(()=>{console.log(O("change detected...")),pq($,X,Q),iq($,J,Q)},200)};if(q($,z),q8(X))q(X,z);if(q8(J))q(J,z)}B$();e();import{writeFileSync as pN}from"fs";function nq($,X={}){let J=$??r();if(!J)console.error(`Error: project.faf not found
222
222
 
223
- Run 'faf init' to create one.`),process.exit(2);let Q=o(J),q=M1(Q),Y=X.output??J.replace(/\.faf$/,".fafb");vN(Y,q),console.log(`${A("compiled")} ${Y} ${O(`(${q.length} bytes)`)}`)}import{readFileSync as hN}from"fs";function c1($,X={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let J=new Uint8Array(hN($));if(String.fromCharCode(J[0],J[1],J[2],J[3])!=="FAFB")console.error("Error: Not a valid .fafb file (missing FAFB magic bytes)."),process.exit(3);let Q=N1(J);console.log(JSON.stringify(Q,null,2))}B$();function p1($){let X=[];if(!$||typeof $!=="object")return X.push("File is not a valid YAML mapping"),{valid:!1,errors:X};let J=$;if(!J.faf_version)X.push("Missing required field: faf_version");if(!J.project?.name)X.push("Missing required field: project.name");return{valid:X.length===0,errors:X}}l$();J0();e();function G7($,X={}){let J=$??r();if(!J)console.error(`Error: project.faf not found
223
+ Run 'faf init' to create one.`),process.exit(2);let Q=a(J),q=Oq(Q),Y=X.output??J.replace(/\.faf$/,".fafb");pN(Y,q),console.log(`${A("compiled")} ${Y} ${O(`(${q.length} bytes)`)}`)}import{readFileSync as dN}from"fs";function rq($,X={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let J=new Uint8Array(dN($));if(String.fromCharCode(J[0],J[1],J[2],J[3])!=="FAFB")console.error("Error: Not a valid .fafb file (missing FAFB magic bytes)."),process.exit(3);let Q=wq(J);console.log(JSON.stringify(Q,null,2))}B$();function sq($){let X=[];if(!$||typeof $!=="object")return X.push("File is not a valid YAML mapping"),{valid:!1,errors:X};let J=$;if(!J.faf_version)X.push("Missing required field: faf_version");if(!J.project?.name)X.push("Missing required field: project.name");return{valid:X.length===0,errors:X}}l$();J0();e();function U7($,X={}){let J=$??r();if(!J)console.error(`Error: project.faf not found
224
224
 
225
- Run 'faf init' to create one.`),process.exit(2);let Q=$$(J),q=p1(Q);if(!q.valid){console.log(`${S("invalid")} ${J}`);for(let G of q.errors)console.log(` ${O("x")} ${G}`);process.exit(3)}let Y=o(J);if(!K1(Y))console.log(`${S("invalid yaml")} ${J}`),process.exit(3);console.log(`${A("valid")} ${J}`);let z=U$(H$(Y));if(N$(z,J),X.strict&&z.score<100)console.log(O(`
226
- --strict requires 100%`)),process.exit(1)}B$();import{writeFileSync as uN}from"fs";import{join as mN}from"path";function lN($){let X=[];if(X.push(b0($)),X.push(""),X.push(`# AGENTS.md — ${$.project?.name??"Project"}`),X.push(""),X.push("> Auto-generated from project.faf — do not edit directly"),X.push(""),X.push("## Project Context"),X.push(""),$.project?.name)X.push(`- **Name:** ${$.project.name}`);if($.project?.goal)X.push(`- **Goal:** ${$.project.goal}`);if($.project?.main_language)X.push(`- **Language:** ${$.project.main_language}`);if(X.push(""),X.push("## Stack"),X.push(""),$.stack){for(let[J,Q]of Object.entries($.stack))if(Q&&Q!=="slotignored"&&Q!=="")X.push(`- **${J}:** ${Q}`)}if($.human_context){X.push(""),X.push("## Human Context"),X.push("");for(let[J,Q]of Object.entries($.human_context))if(Q&&Q!=="")X.push(`- **${J}:** ${Q}`)}return X.push(""),X.join(`
227
- `)}function d1($,X){uN(mN($,"AGENTS.md"),lN(X),"utf-8")}import{writeFileSync as cN}from"fs";import{join as pN}from"path";function dN($){let X=[];if(X.push(b0($)),X.push(""),X.push("# .cursorrules"),X.push(`# Auto-generated from project.faf — ${$.project?.name??"Project"}`),X.push(""),$.project?.main_language)X.push(`language: ${$.project.main_language}`);if($.stack){X.push(""),X.push("# Stack");for(let[J,Q]of Object.entries($.stack))if(Q&&Q!=="slotignored"&&Q!=="")X.push(`# ${J}: ${Q}`)}return X.push(""),X.join(`
228
- `)}function i1($,X){cN(pN($,".cursorrules"),dN(X),"utf-8")}import{writeFileSync as iN}from"fs";import{join as nN}from"path";function rN($){let X=[];if(X.push(b0($)),X.push(""),X.push(`# GEMINI.md — ${$.project?.name??"Project"}`),X.push(""),X.push("> Auto-generated from project.faf"),X.push(""),$.project?.name)X.push(`Project: ${$.project.name}`);if($.project?.goal)X.push(`Goal: ${$.project.goal}`);if($.project?.main_language)X.push(`Language: ${$.project.main_language}`);if($.stack){X.push(""),X.push("## Stack");for(let[J,Q]of Object.entries($.stack))if(Q&&Q!=="slotignored"&&Q!=="")X.push(`- ${J}: ${Q}`)}return X.push(""),X.join(`
229
- `)}function n1($,X){iN(nN($,"GEMINI.md"),rN(X),"utf-8")}e();function a6($={}){let X=r();if(!X)console.error(`Error: project.faf not found
225
+ Run 'faf init' to create one.`),process.exit(2);let Q=$$(J),q=sq(Q);if(!q.valid){console.log(`${S("invalid")} ${J}`);for(let G of q.errors)console.log(` ${O("x")} ${G}`);process.exit(3)}let Y=a(J);if(!Dq(Y))console.log(`${S("invalid yaml")} ${J}`),process.exit(3);console.log(`${A("valid")} ${J}`);let z=Y$(q$(Y));if(N$(z,J),X.strict&&z.score<100)console.log(O(`
226
+ --strict requires 100%`)),process.exit(1)}B$();import{writeFileSync as iN}from"fs";import{join as nN}from"path";function rN($){let X=[];if(X.push(f0($)),X.push(""),X.push(`# AGENTS.md — ${$.project?.name??"Project"}`),X.push(""),X.push("> Auto-generated from project.faf — do not edit directly"),X.push(""),X.push("## Project Context"),X.push(""),$.project?.name)X.push(`- **Name:** ${$.project.name}`);if($.project?.goal)X.push(`- **Goal:** ${$.project.goal}`);if($.project?.main_language)X.push(`- **Language:** ${$.project.main_language}`);if(X.push(""),X.push("## Stack"),X.push(""),$.stack){for(let[J,Q]of Object.entries($.stack))if(Q&&Q!=="slotignored"&&Q!=="")X.push(`- **${J}:** ${Q}`)}if($.human_context){X.push(""),X.push("## Human Context"),X.push("");for(let[J,Q]of Object.entries($.human_context))if(Q&&Q!=="")X.push(`- **${J}:** ${Q}`)}return X.push(""),X.join(`
227
+ `)}function aq($,X){iN(nN($,"AGENTS.md"),rN(X),"utf-8")}import{writeFileSync as sN}from"fs";import{join as aN}from"path";function oN($){let X=[];if(X.push(f0($)),X.push(""),X.push("# .cursorrules"),X.push(`# Auto-generated from project.faf — ${$.project?.name??"Project"}`),X.push(""),$.project?.main_language)X.push(`language: ${$.project.main_language}`);if($.stack){X.push(""),X.push("# Stack");for(let[J,Q]of Object.entries($.stack))if(Q&&Q!=="slotignored"&&Q!=="")X.push(`# ${J}: ${Q}`)}return X.push(""),X.join(`
228
+ `)}function oq($,X){sN(aN($,".cursorrules"),oN(X),"utf-8")}import{writeFileSync as tN}from"fs";import{join as eN}from"path";function $D($){let X=[];if(X.push(f0($)),X.push(""),X.push(`# GEMINI.md — ${$.project?.name??"Project"}`),X.push(""),X.push("> Auto-generated from project.faf"),X.push(""),$.project?.name)X.push(`Project: ${$.project.name}`);if($.project?.goal)X.push(`Goal: ${$.project.goal}`);if($.project?.main_language)X.push(`Language: ${$.project.main_language}`);if($.stack){X.push(""),X.push("## Stack");for(let[J,Q]of Object.entries($.stack))if(Q&&Q!=="slotignored"&&Q!=="")X.push(`- ${J}: ${Q}`)}return X.push(""),X.join(`
229
+ `)}function tq($,X){tN(eN($,"GEMINI.md"),$D(X),"utf-8")}e();function $2($={}){let X=r();if(!X)console.error(`Error: project.faf not found
230
230
 
231
- Run 'faf init' to create one.`),process.exit(2);let J=process.cwd(),Q=$$(X),q=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.conductor;if(q||$.agents)d1(J,Q),console.log(" AGENTS.md");if(q||$.cursor)i1(J,Q),console.log(" .cursorrules");if(q||$.gemini)n1(J,Q),console.log(" GEMINI.md");console.log(`${A("exported")} ${O(`from ${X}`)}`)}g5();B$();l$();J0();e();import{mkdirSync as r1,rmSync as sN,existsSync as q8,readFileSync as aN}from"fs";import{join as c$,basename as oN}from"path";import{execSync as tN}from"child_process";import{tmpdir as eN}from"os";function $D($){let X=["README.md","README.MD","readme.md","Readme.md"],J="";for(let Y of X){let z=c$($,Y);if(q8(z)){J=aN(z,"utf-8");break}}if(!J)return"";let Q=J.split(`
232
- `),q=!1;for(let Y of Q){let z=Y.trim();if(!z)continue;if(z.startsWith("# ")&&!q){q=!0;continue}if(z.startsWith("![")||z.startsWith("<")||z.startsWith("|")||z.startsWith("#")||z.startsWith("[![")||z.startsWith("---"))continue;let G=z.replace(/\*\*/g,"").replace(/\*/g,"").replace(/`/g,"").trim();if(G.length>10)return G.slice(0,120)}return""}function XD($){if(q8(c$($,"Dockerfile"))||q8(c$($,"docker-compose.yml")))return"Docker";if(q8(c$($,"Makefile")))return"make";if(q8(c$($,"go.mod")))return"go build";if(q8(c$($,"Cargo.toml")))return"cargo build";if(q8(c$($,"pyproject.toml")))return"pip / uv";return""}function JD($,X){let J=$.project??{},Q=$.stack??{};if(!J.goal){let q=$D(X);if(q)J.goal=q}if(!Q.build||Q.build===""){let q=XD(X);if(q)Q.build=q}if(J.type==="mcp"){if(!Q.database||Q.database==="")Q.database="slotignored";if(!Q.connection||Q.connection==="")Q.connection="slotignored"}return{...$,project:J,stack:Q}}function s1($,X,J){let Q=J.endsWith(".git")?J:`${J}.git`;console.log(O(`cloning ${J}...`)),tN(`git clone --depth 1 ${Q} ${$}`,{stdio:"pipe"});let q=k8($),Y=JD(q,$);Q$(X,Y),console.log(`${A("created")} ${X}`);let z=o(X),G=U$(H$(z));N$(G,X)}function a1($,X={}){if(!$)console.error(`Error: Please provide a GitHub URL.
231
+ Run 'faf init' to create one.`),process.exit(2);let J=process.cwd(),Q=$$(X),q=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.conductor;if(q||$.agents)aq(J,Q),console.log(" AGENTS.md");if(q||$.cursor)oq(J,Q),console.log(" .cursorrules");if(q||$.gemini)tq(J,Q),console.log(" GEMINI.md");console.log(`${A("exported")} ${O(`from ${X}`)}`)}u5();B$();l$();J0();e();import{mkdirSync as eq,rmSync as XD,existsSync as Y8,readFileSync as JD}from"fs";import{join as c$,basename as QD}from"path";import{execSync as qD}from"child_process";import{tmpdir as YD}from"os";function zD($){let X=["README.md","README.MD","readme.md","Readme.md"],J="";for(let Y of X){let z=c$($,Y);if(Y8(z)){J=JD(z,"utf-8");break}}if(!J)return"";let Q=J.split(`
232
+ `),q=!1;for(let Y of Q){let z=Y.trim();if(!z)continue;if(z.startsWith("# ")&&!q){q=!0;continue}if(z.startsWith("![")||z.startsWith("<")||z.startsWith("|")||z.startsWith("#")||z.startsWith("[![")||z.startsWith("---"))continue;let G=z.replace(/\*\*/g,"").replace(/\*/g,"").replace(/`/g,"").trim();if(G.length>10)return G.slice(0,120)}return""}function GD($){if(Y8(c$($,"Dockerfile"))||Y8(c$($,"docker-compose.yml")))return"Docker";if(Y8(c$($,"Makefile")))return"make";if(Y8(c$($,"go.mod")))return"go build";if(Y8(c$($,"Cargo.toml")))return"cargo build";if(Y8(c$($,"pyproject.toml")))return"pip / uv";return""}function WD($,X){let J=$.project??{},Q=$.stack??{};if(!J.goal){let q=zD(X);if(q)J.goal=q}if(!Q.build||Q.build===""){let q=GD(X);if(q)Q.build=q}if(J.type==="mcp"){if(!Q.database||Q.database==="")Q.database="slotignored";if(!Q.connection||Q.connection==="")Q.connection="slotignored"}return{...$,project:J,stack:Q}}function $1($,X,J){let Q=J.endsWith(".git")?J:`${J}.git`;console.log(O(`cloning ${J}...`)),qD(`git clone --depth 1 ${Q} ${$}`,{stdio:"pipe"});let q=x8($),Y=WD(q,$);Q$(X,Y),console.log(`${A("created")} ${X}`);let z=a(X),G=Y$(q$(z));N$(G,X)}function X1($,X={}){if(!$)console.error(`Error: Please provide a GitHub URL.
233
233
 
234
- Usage: faf git <url>`),process.exit(1);let J=oN($.replace(/\.git$/,""));if(X.keep){let Q=c$(process.cwd(),J);r1(Q,{recursive:!0}),s1(Q,c$(Q,"project.faf"),$),console.log(O(`
235
- cd ${J} && faf go`))}else{let Q=c$(eN(),`faf-git-${Date.now()}-${Math.random().toString(36).slice(2)}`);r1(Q,{recursive:!0});try{s1(Q,c$(process.cwd(),"project.faf"),$)}finally{sN(Q,{recursive:!0,force:!0})}}}e();function t1($={}){if($.version||Object.keys($).length===0)qD()}function qD(){let $=o1();console.log(`${A(S("faf"))} v${$.version}`),console.log(O(`kernel ${D1()} IANA application/vnd.faf+yaml`))}var o6=[{name:"HTML",extensions:[".html",".htm"],category:"web"},{name:"CSS",extensions:[".css"],category:"web"},{name:"JavaScript",extensions:[".js",".mjs",".cjs"],category:"web"},{name:"TypeScript",extensions:[".ts",".tsx",".mts",".cts"],category:"web"},{name:"JSX",extensions:[".jsx"],category:"web"},{name:"Vue",extensions:[".vue"],category:"web"},{name:"Svelte",extensions:[".svelte"],category:"web"},{name:"Astro",extensions:[".astro"],category:"web"},{name:"JSON",extensions:[".json"],category:"data"},{name:"YAML",extensions:[".yml",".yaml"],category:"data"},{name:"TOML",extensions:[".toml"],category:"data"},{name:"XML",extensions:[".xml"],category:"data"},{name:"CSV",extensions:[".csv"],category:"data"},{name:"INI",extensions:[".ini",".cfg"],category:"config"},{name:"Env",extensions:[".env"],category:"config"},{name:"Dockerfile",extensions:["Dockerfile"],category:"config"},{name:"Rust",extensions:[".rs"],category:"systems"},{name:"Go",extensions:[".go"],category:"systems"},{name:"C",extensions:[".c",".h"],category:"systems"},{name:"C++",extensions:[".cpp",".cc",".hpp"],category:"systems"},{name:"Zig",extensions:[".zig"],category:"systems"},{name:"Python",extensions:[".py"],category:"scripting"},{name:"Ruby",extensions:[".rb"],category:"scripting"},{name:"Shell",extensions:[".sh",".bash",".zsh"],category:"scripting"},{name:"Lua",extensions:[".lua"],category:"scripting"},{name:"Java",extensions:[".java"],category:"jvm"},{name:"Kotlin",extensions:[".kt",".kts"],category:"jvm"},{name:"Scala",extensions:[".scala"],category:"jvm"},{name:"C#",extensions:[".cs"],category:"dotnet"},{name:"F#",extensions:[".fs"],category:"dotnet"},{name:"Swift",extensions:[".swift"],category:"mobile"},{name:"Dart",extensions:[".dart"],category:"mobile"},{name:"Markdown",extensions:[".md",".mdx"],category:"docs"},{name:"LaTeX",extensions:[".tex"],category:"docs"},{name:"reStructuredText",extensions:[".rst"],category:"docs"},{name:"FAF",extensions:[".faf"],category:"faf"},{name:"FAFb",extensions:[".fafb"],category:"faf"}];e();function e1(){console.log(`${A("formats")} ${O("— supported file types")}
236
- `);let $=new Map;for(let X of o6){let J=$.get(X.category)??[];J.push(X),$.set(X.category,J)}for(let[X,J]of $){console.log(` ${S(X)}`);for(let Q of J)console.log(` ${Q.name} ${O(Q.extensions.join(", "))}`);console.log()}console.log(O(` ${o6.length} formats across ${$.size} categories`))}e();import{readdirSync as YD,rmSync as zD}from"fs";import{tmpdir as GD}from"os";import{join as WD}from"path";function $q(){let $=GD(),X=0;try{let J=YD($);for(let Q of J)if(Q.startsWith("faf-git-"))zD(WD($,Q),{recursive:!0,force:!0}),X++}catch{}if(X>0)console.log(`${A("cleared")} ${X} cached director${X===1?"y":"ies"}`);else console.log(O("nothing to clear"))}B$();function Xq($={}){let X=r();if(!X)console.error(`Error: project.faf not found
234
+ Usage: faf git <url>`),process.exit(1);let J=QD($.replace(/\.git$/,""));if(X.keep){let Q=c$(process.cwd(),J);eq(Q,{recursive:!0}),$1(Q,c$(Q,"project.faf"),$),console.log(O(`
235
+ cd ${J} && faf go`))}else{let Q=c$(YD(),`faf-git-${Date.now()}-${Math.random().toString(36).slice(2)}`);eq(Q,{recursive:!0});try{$1(Q,c$(process.cwd(),"project.faf"),$)}finally{XD(Q,{recursive:!0,force:!0})}}}e();function Q1($={}){if($.version||Object.keys($).length===0)UD()}function UD(){let $=J1();console.log(`${A(S("faf"))} v${$.version}`),console.log(O(`kernel ${Lq()} IANA application/vnd.faf+yaml`))}var X2=[{name:"HTML",extensions:[".html",".htm"],category:"web"},{name:"CSS",extensions:[".css"],category:"web"},{name:"JavaScript",extensions:[".js",".mjs",".cjs"],category:"web"},{name:"TypeScript",extensions:[".ts",".tsx",".mts",".cts"],category:"web"},{name:"JSX",extensions:[".jsx"],category:"web"},{name:"Vue",extensions:[".vue"],category:"web"},{name:"Svelte",extensions:[".svelte"],category:"web"},{name:"Astro",extensions:[".astro"],category:"web"},{name:"JSON",extensions:[".json"],category:"data"},{name:"YAML",extensions:[".yml",".yaml"],category:"data"},{name:"TOML",extensions:[".toml"],category:"data"},{name:"XML",extensions:[".xml"],category:"data"},{name:"CSV",extensions:[".csv"],category:"data"},{name:"INI",extensions:[".ini",".cfg"],category:"config"},{name:"Env",extensions:[".env"],category:"config"},{name:"Dockerfile",extensions:["Dockerfile"],category:"config"},{name:"Rust",extensions:[".rs"],category:"systems"},{name:"Go",extensions:[".go"],category:"systems"},{name:"C",extensions:[".c",".h"],category:"systems"},{name:"C++",extensions:[".cpp",".cc",".hpp"],category:"systems"},{name:"Zig",extensions:[".zig"],category:"systems"},{name:"Python",extensions:[".py"],category:"scripting"},{name:"Ruby",extensions:[".rb"],category:"scripting"},{name:"Shell",extensions:[".sh",".bash",".zsh"],category:"scripting"},{name:"Lua",extensions:[".lua"],category:"scripting"},{name:"Java",extensions:[".java"],category:"jvm"},{name:"Kotlin",extensions:[".kt",".kts"],category:"jvm"},{name:"Scala",extensions:[".scala"],category:"jvm"},{name:"C#",extensions:[".cs"],category:"dotnet"},{name:"F#",extensions:[".fs"],category:"dotnet"},{name:"Swift",extensions:[".swift"],category:"mobile"},{name:"Dart",extensions:[".dart"],category:"mobile"},{name:"Markdown",extensions:[".md",".mdx"],category:"docs"},{name:"LaTeX",extensions:[".tex"],category:"docs"},{name:"reStructuredText",extensions:[".rst"],category:"docs"},{name:"FAF",extensions:[".faf"],category:"faf"},{name:"FAFb",extensions:[".fafb"],category:"faf"}];e();function q1(){console.log(`${A("formats")} ${O("— supported file types")}
236
+ `);let $=new Map;for(let X of X2){let J=$.get(X.category)??[];J.push(X),$.set(X.category,J)}for(let[X,J]of $){console.log(` ${S(X)}`);for(let Q of J)console.log(` ${Q.name} ${O(Q.extensions.join(", "))}`);console.log()}console.log(O(` ${X2.length} formats across ${$.size} categories`))}e();import{readdirSync as VD,rmSync as BD}from"fs";import{tmpdir as KD}from"os";import{join as MD}from"path";function Y1(){let $=KD(),X=0;try{let J=VD($);for(let Q of J)if(Q.startsWith("faf-git-"))BD(MD($,Q),{recursive:!0,force:!0}),X++}catch{}if(X>0)console.log(`${A("cleared")} ${X} cached director${X===1?"y":"ies"}`);else console.log(O("nothing to clear"))}B$();function z1($={}){let X=r();if(!X)console.error(`Error: project.faf not found
237
237
 
238
- Run 'faf init' to create one.`),process.exit(2);if($.json){let J=$$(X);console.log(JSON.stringify(J,null,2))}else{let J=o(X);console.log(J)}}B$();B0();e();function Jq(){let $=r();if(!$)console.error(`Error: project.faf not found
238
+ Run 'faf init' to create one.`),process.exit(2);if($.json){let J=$$(X);console.log(JSON.stringify(J,null,2))}else{let J=a(X);console.log(J)}}B$();K0();e();function G1(){let $=r();if(!$)console.error(`Error: project.faf not found
239
239
 
240
240
  Run 'faf init' to create one.`),process.exit(2);let X=$$($),J=[];for(let Q of E$){let[q,Y]=Q.path.split("."),G=X[q]?.[Y];if(D$(G)||G==="slotignored")continue;J.push(`${Q.path}: ${G}`)}if(J.length===0){console.log(O("no populated slots"));return}console.log(J.join(`
241
- `))}B$();e();import{existsSync as HD,statSync as Qq}from"fs";import{join as UD}from"path";var VD=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function qq(){let $=r();if(!$)console.error(`Error: project.faf not found
241
+ `))}B$();e();import{existsSync as ND,statSync as W1}from"fs";import{join as DD}from"path";var OD=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function H1(){let $=r();if(!$)console.error(`Error: project.faf not found
242
242
 
243
- Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),J=Qq($).mtimeMs;console.log(`${A("drift")} ${O("— context file sync status")}
244
- `),console.log(` ${S(".faf")} ${O(W7(J))}`);let Q=0;for(let q of VD){let Y=UD(X,q);if(!HD(Y)){console.log(` ${O("○")} ${q} ${O("missing")}`);continue}let z=Qq(Y).mtimeMs,G=z-J;if(Math.abs(G)<1000)console.log(` ${A("●")} ${q} ${O("in sync")}`);else if(G>0)console.log(` ${S("!")} ${q} ${S("newer")} ${O(W7(z))}`),Q++;else console.log(` ${O("○")} ${q} ${O("older")} ${O(W7(z))}`),Q++}if(Q>0)console.log(O(`
245
- run ${S("'faf sync'")} to resolve drift`))}function W7($){let X=Date.now()-$,J=Math.floor(X/1000);if(J<60)return`${J}s ago`;let Q=Math.floor(J/60);if(Q<60)return`${Q}m ago`;let q=Math.floor(Q/60);if(q<24)return`${q}h ago`;return`${Math.floor(q/24)}d ago`}B$();e();function Yq($,X){if(!$||X===void 0)console.error(`Usage: faf edit <path> <value>
243
+ Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),J=W1($).mtimeMs;console.log(`${A("drift")} ${O("— context file sync status")}
244
+ `),console.log(` ${S(".faf")} ${O(V7(J))}`);let Q=0;for(let q of OD){let Y=DD(X,q);if(!ND(Y)){console.log(` ${O("○")} ${q} ${O("missing")}`);continue}let z=W1(Y).mtimeMs,G=z-J;if(Math.abs(G)<1000)console.log(` ${A("●")} ${q} ${O("in sync")}`);else if(G>0)console.log(` ${S("!")} ${q} ${S("newer")} ${O(V7(z))}`),Q++;else console.log(` ${O("○")} ${q} ${O("older")} ${O(V7(z))}`),Q++}if(Q>0)console.log(O(`
245
+ run ${S("'faf sync'")} to resolve drift`))}function V7($){let X=Date.now()-$,J=Math.floor(X/1000);if(J<60)return`${J}s ago`;let Q=Math.floor(J/60);if(Q<60)return`${Q}m ago`;let q=Math.floor(Q/60);if(q<24)return`${q}h ago`;return`${Math.floor(q/24)}d ago`}B$();e();function U1($,X){if(!$||X===void 0)console.error(`Usage: faf edit <path> <value>
246
246
 
247
247
  Example: faf edit project.name "My Project"`),process.exit(1);let J=r();if(!J)console.error(`Error: project.faf not found
248
248
 
249
- Run 'faf init' to create one.`),process.exit(2);let Q=$$(J),q=$.split(".");if(q.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[Y,z]=q;if(!Q[Y]||typeof Q[Y]!=="object")Q[Y]={};Q[Y][z]=X,Q$(J,Q),console.log(`${A("updated")} ${$} ${O("→")} ${X}`)}B$();import{existsSync as u5,readFileSync as H7}from"fs";import{join as t6}from"path";e();function zq(){let $=process.cwd(),X=[],J={faf_version:"3.0",project:{}},Q=t6($,"CLAUDE.md");if(u5(Q)){let W=H7(Q,"utf-8"),H=v5(W);if(H.project?.name)J.project.name=H.project.name;if(H.project?.goal)J.project.goal=H.project.goal;if(H.project?.main_language)J.project.main_language=H.project.main_language;X.push("CLAUDE.md")}let q=t6($,"AGENTS.md");if(u5(q)){let W=H7(q,"utf-8");if(!J.project.name){let H=W.match(/^#\s+(.+)/m);if(H)J.project.name=H[1].trim()}X.push("AGENTS.md")}let Y=t6($,"GEMINI.md");if(u5(Y)){let W=H7(Y,"utf-8");if(!J.project.name){let H=W.match(/^#\s+(.+)/m);if(H)J.project.name=H[1].trim()}X.push("GEMINI.md")}let z=t6($,".cursorrules");if(u5(z))X.push(".cursorrules");if(X.length===0)console.error("No context files found (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules)."),process.exit(2);let G=r($);if(G){let W=$$(G);if(!W.project)W.project={};if(J.project.name&&!W.project.name)W.project.name=J.project.name;if(J.project.goal&&!W.project.goal)W.project.goal=J.project.goal;if(J.project.main_language&&!W.project.main_language)W.project.main_language=J.project.main_language;Q$(G,W),console.log(`${A("◆")} recover merged into ${G}`)}else{let W=t6($,"project.faf");Q$(W,J),console.log(`${A("◆")} recover created ${W}`)}console.log(O(` sources: ${X.join(", ")}`))}B$();e();var e6="3.0";function Gq($={}){let X=r();if(!X)console.error(`Error: project.faf not found
249
+ Run 'faf init' to create one.`),process.exit(2);let Q=$$(J),q=$.split(".");if(q.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[Y,z]=q;if(!Q[Y]||typeof Q[Y]!=="object")Q[Y]={};Q[Y][z]=X,Q$(J,Q),console.log(`${A("updated")} ${$} ${O("→")} ${X}`)}B$();import{existsSync as p5,readFileSync as B7}from"fs";import{join as J2}from"path";e();function V1(){let $=process.cwd(),X=[],J={faf_version:"3.0",project:{}},Q=J2($,"CLAUDE.md");if(p5(Q)){let W=B7(Q,"utf-8"),H=l5(W);if(H.project?.name)J.project.name=H.project.name;if(H.project?.goal)J.project.goal=H.project.goal;if(H.project?.main_language)J.project.main_language=H.project.main_language;X.push("CLAUDE.md")}let q=J2($,"AGENTS.md");if(p5(q)){let W=B7(q,"utf-8");if(!J.project.name){let H=W.match(/^#\s+(.+)/m);if(H)J.project.name=H[1].trim()}X.push("AGENTS.md")}let Y=J2($,"GEMINI.md");if(p5(Y)){let W=B7(Y,"utf-8");if(!J.project.name){let H=W.match(/^#\s+(.+)/m);if(H)J.project.name=H[1].trim()}X.push("GEMINI.md")}let z=J2($,".cursorrules");if(p5(z))X.push(".cursorrules");if(X.length===0)console.error("No context files found (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules)."),process.exit(2);let G=r($);if(G){let W=$$(G);if(!W.project)W.project={};if(J.project.name&&!W.project.name)W.project.name=J.project.name;if(J.project.goal&&!W.project.goal)W.project.goal=J.project.goal;if(J.project.main_language&&!W.project.main_language)W.project.main_language=J.project.main_language;Q$(G,W),console.log(`${A("◆")} recover merged into ${G}`)}else{let W=J2($,"project.faf");Q$(W,J),console.log(`${A("◆")} recover created ${W}`)}console.log(O(` sources: ${X.join(", ")}`))}B$();e();var Q2="3.0";function B1($={}){let X=r();if(!X)console.error(`Error: project.faf not found
250
250
 
251
- Run 'faf init' to create one.`),process.exit(2);let J=$$(X),Q=J.faf_version??"unknown";if(Q===e6){console.log(`${A("◆")} migrate already at v${e6}`);return}if(J.faf_version=e6,!J.project)J.project={};if(!J.stack)J.stack={};if(!J.human_context)J.human_context={};if(!J.monorepo)J.monorepo={};if($.dryRun){console.log(`${A("◆")} migrate ${O("(dry run)")} v${Q} → v${e6}`),console.log(O(` would update ${X}`));return}Q$(X,J),console.log(`${A("◆")} migrate v${Q} → v${e6}`),console.log(O(` updated ${X}`))}function Wq(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}e();function Fq($){if($==="features")ID();else if($==="activate")ED();else FD()}function FD(){let $=Wq();if(console.log(`${A("pro")} ${O("— FAF Pro status")}
252
- `),console.log(` Status: ${$?J8(S("PRO")):S("Free")}`),console.log(""),!$)console.log(O(" Upgrade: faf pro activate"))}function ID(){console.log(`${A("pro")} ${O("— Pro features")}
253
- `);let $=[["tri-sync",".faf ↔ CLAUDE.md ↔ MEMORY.md — free for developers"],["enterprise slots","33-slot scoring (slots 22-33)"],["advanced analytics","Drift tracking & team metrics"]];for(let[X,J]of $)console.log(` ${A("◆")} ${S(X)} ${O("—")} ${J}`);console.log("")}function ED(){console.log(`${A("pro")} ${O("— activate")}
254
- `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(O(" export FAF_PRO=1")),console.log("");try{_q()("https://faf.one/pro")}catch{console.log(O(" Visit: https://faf.one/pro"))}}B$();e();import{gzipSync as TD}from"zlib";function Iq($={}){let X=r();if(!X)console.error(`Error: project.faf not found
251
+ Run 'faf init' to create one.`),process.exit(2);let J=$$(X),Q=J.faf_version??"unknown";if(Q===Q2){console.log(`${A("◆")} migrate already at v${Q2}`);return}if(J.faf_version=Q2,!J.project)J.project={};if(!J.stack)J.stack={};if(!J.human_context)J.human_context={};if(!J.monorepo)J.monorepo={};if($.dryRun){console.log(`${A("◆")} migrate ${O("(dry run)")} v${Q} → v${Q2}`),console.log(O(` would update ${X}`));return}Q$(X,J),console.log(`${A("◆")} migrate v${Q} → v${Q2}`),console.log(O(` updated ${X}`))}function K1(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}e();function S1($){if($==="features")CD();else if($==="activate")bD();else jD()}function jD(){let $=K1();if(console.log(`${A("pro")} ${O("— FAF Pro status")}
252
+ `),console.log(` Status: ${$?Q8(S("PRO")):S("Free")}`),console.log(""),!$)console.log(O(" Upgrade: faf pro activate"))}function CD(){console.log(`${A("pro")} ${O("— Pro features")}
253
+ `);let $=[["tri-sync",".faf ↔ CLAUDE.md ↔ MEMORY.md — free for developers"],["enterprise slots","33-slot scoring (slots 22-33)"],["advanced analytics","Drift tracking & team metrics"]];for(let[X,J]of $)console.log(` ${A("◆")} ${S(X)} ${O("—")} ${J}`);console.log("")}function bD(){console.log(`${A("pro")} ${O("— activate")}
254
+ `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(O(" export FAF_PRO=1")),console.log("");try{T1()("https://faf.one/pro")}catch{console.log(O(" Visit: https://faf.one/pro"))}}B$();e();import{gzipSync as PD}from"zlib";function j1($={}){let X=r();if(!X)console.error(`Error: project.faf not found
255
255
 
256
- Run 'faf init' to create one.`),process.exit(2);let J=o(X),q=TD(Buffer.from(J)).toString("base64url");if($.raw){console.log(q);return}let Y=`https://faf.one/share?d=${q}`;if(console.log(`${A("◆")} share ${O(X)}
257
- `),console.log(` ${Y}`),$.copy)try{let{execSync:z}=W$("child_process"),G=process.platform;if(G==="darwin")z("pbcopy",{input:Y});else if(G==="linux")z("xclip -selection clipboard",{input:Y});console.log(O(`
256
+ Run 'faf init' to create one.`),process.exit(2);let J=a(X),q=PD(Buffer.from(J)).toString("base64url");if($.raw){console.log(q);return}let Y=`https://faf.one/share?d=${q}`;if(console.log(`${A("◆")} share ${O(X)}
257
+ `),console.log(` ${Y}`),$.copy)try{let{execSync:z}=U$("child_process"),G=process.platform;if(G==="darwin")z("pbcopy",{input:Y});else if(G==="linux")z("xclip -selection clipboard",{input:Y});console.log(O(`
258
258
  copied to clipboard`))}catch{console.log(O(`
259
- copy failed — install xclip or pbcopy`))}}B$();l$();J0();e();import{mkdirSync as ZD,writeFileSync as SD,rmSync as jD}from"fs";import{tmpdir as CD}from"os";import{join as Eq}from"path";function Tq(){let $=Eq(CD(),`faf-demo-${Date.now()}`);ZD($,{recursive:!0}),console.log(`${A("demo")} ${O("— FAF in action")}
259
+ copy failed — install xclip or pbcopy`))}}B$();l$();J0();e();import{mkdirSync as fD,writeFileSync as kD,rmSync as xD}from"fs";import{tmpdir as yD}from"os";import{join as C1}from"path";function b1(){let $=C1(yD(),`faf-demo-${Date.now()}`);fD($,{recursive:!0}),console.log(`${A("demo")} ${O("— FAF in action")}
260
260
  `);let X=`faf_version: "3.0"
261
261
  project:
262
262
  name: acme-app
@@ -282,13 +282,13 @@ human_context:
282
282
  where: Cloud (Vercel + AWS)
283
283
  when: "2026"
284
284
  how: Agile sprints with CI/CD
285
- `,J=Eq($,"project.faf");SD(J,X),console.log(` ${S("1.")} Created sample project.faf`),console.log(O(` ${J}
286
- `)),console.log(` ${S("2.")} Scoring...`);let Q=U$(H$(o(J)));console.log(""),N$(Q,"project.faf",!0),jD($,{recursive:!0,force:!0}),console.log(`
287
- ${O(' Demo complete. Run "faf init" in your project to get started.')}`)}B0();e();function Zq($,X={}){if(!$)console.error("Usage: faf search <keyword>"),process.exit(2);let J=$.toLowerCase(),Q=!X.slots&&!X.formats,q=0;if(Q||X.slots){let Y=E$.filter((z)=>z.path.toLowerCase().includes(J)||z.description.toLowerCase().includes(J)||z.category.toLowerCase().includes(J));if(Y.length>0){console.log(`${A("slots")} ${O(`— ${Y.length} match${Y.length===1?"":"es"}`)}
288
- `);for(let z of Y)console.log(` ${S(`#${z.index}`)} ${z.path} ${O("—")} ${z.description} ${O(`[${z.category}]`)}`);console.log(""),q+=Y.length}}if(Q||X.formats){let Y=o6.filter((z)=>z.name.toLowerCase().includes(J)||z.extensions.some((G)=>G.toLowerCase().includes(J))||z.category.toLowerCase().includes(J));if(Y.length>0){console.log(`${A("formats")} ${O(`— ${Y.length} match${Y.length===1?"":"es"}`)}
289
- `);for(let z of Y)console.log(` ${S(z.name)} ${O(z.extensions.join(", "))} ${O(`[${z.category}]`)}`);console.log(""),q+=Y.length}}if(q===0)console.log(O(` No results for "${$}"`))}B$();l$();e();import{writeFileSync as PD}from"fs";function Sq($={}){let X=r();if(!X)console.error(`Error: project.faf not found
285
+ `,J=C1($,"project.faf");kD(J,X),console.log(` ${S("1.")} Created sample project.faf`),console.log(O(` ${J}
286
+ `)),console.log(` ${S("2.")} Scoring...`);let Q=Y$(q$(a(J)));console.log(""),N$(Q,"project.faf",!0),xD($,{recursive:!0,force:!0}),console.log(`
287
+ ${O(' Demo complete. Run "faf init" in your project to get started.')}`)}K0();e();function P1($,X={}){if(!$)console.error("Usage: faf search <keyword>"),process.exit(2);let J=$.toLowerCase(),Q=!X.slots&&!X.formats,q=0;if(Q||X.slots){let Y=E$.filter((z)=>z.path.toLowerCase().includes(J)||z.description.toLowerCase().includes(J)||z.category.toLowerCase().includes(J));if(Y.length>0){console.log(`${A("slots")} ${O(`— ${Y.length} match${Y.length===1?"":"es"}`)}
288
+ `);for(let z of Y)console.log(` ${S(`#${z.index}`)} ${z.path} ${O("—")} ${z.description} ${O(`[${z.category}]`)}`);console.log(""),q+=Y.length}}if(Q||X.formats){let Y=X2.filter((z)=>z.name.toLowerCase().includes(J)||z.extensions.some((G)=>G.toLowerCase().includes(J))||z.category.toLowerCase().includes(J));if(Y.length>0){console.log(`${A("formats")} ${O(`— ${Y.length} match${Y.length===1?"":"es"}`)}
289
+ `);for(let z of Y)console.log(` ${S(z.name)} ${O(z.extensions.join(", "))} ${O(`[${z.category}]`)}`);console.log(""),q+=Y.length}}if(q===0)console.log(O(` No results for "${$}"`))}B$();l$();e();import{writeFileSync as gD}from"fs";function f1($={}){let X=r();if(!X)console.error(`Error: project.faf not found
290
290
 
291
- Run 'faf init' to create one.`),process.exit(2);let J=$$(X),Q=o(X),q=U$(H$(Q)),Y={taf_version:"1.0.0",generated:new Date().toISOString(),source:X,project:J.project?.name??"unknown",faf_version:J.faf_version??"unknown",score:q.score,tier:q.tier.name,populated:q.populated,active:q.active,total:q.total,slots:q.slots},z=JSON.stringify(Y,null,2);if($.output)PD($.output,z,"utf-8"),console.log(`${A("◆")} taf receipt written to ${$.output}`);else console.log(z)}B$();B0();B0();l$();J0();e();import{createInterface as DO}from"readline";import{existsSync as R9,readFileSync as ZY,writeFileSync as EY,unlinkSync as OO}from"fs";import{join as SY}from"path";async function wO($,X){let J=process.env.ANTHROPIC_API_KEY;if(!J)return null;try{let{default:Q}=await Promise.resolve().then(() => (L9(),w9)),q=new Q({apiKey:J}),Y=`A developer described their project in one sentence: "${$}"
291
+ Run 'faf init' to create one.`),process.exit(2);let J=$$(X),Q=a(X),q=Y$(q$(Q)),Y={taf_version:"1.0.0",generated:new Date().toISOString(),source:X,project:J.project?.name??"unknown",faf_version:J.faf_version??"unknown",score:q.score,tier:q.tier.name,populated:q.populated,active:q.active,total:q.total,slots:q.slots},z=JSON.stringify(Y,null,2);if($.output)gD($.output,z,"utf-8"),console.log(`${A("◆")} taf receipt written to ${$.output}`);else console.log(z)}B$();K0();K0();l$();J0();m5();e();import{createInterface as _O}from"readline";import{existsSync as F9,readFileSync as PY,writeFileSync as CY,unlinkSync as FO}from"fs";import{join as fY}from"path";async function IO($,X){let J=process.env.ANTHROPIC_API_KEY;if(!J)return null;try{let{default:Q}=await Promise.resolve().then(() => (_9(),A9)),q=new Q({apiKey:J}),Y=`A developer described their project in one sentence: "${$}"
292
292
 
293
293
  Here is the project's detected stack context:
294
294
  ${X}
@@ -301,22 +301,22 @@ Based on this, extract the 6Ws as SHORT, specific values (one line each):
301
301
  - when: when was it started or what is the timeline?
302
302
  - how: how does it work technically? (use stack context)
303
303
 
304
- Respond ONLY with valid JSON mapping these 6 keys to string values. No markdown.`,G=(await q.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:512,messages:[{role:"user",content:Y}]})).content[0].text;return JSON.parse(G)}catch{return null}}var LO=".faf-session.json";function x$($,X){let J=X.split("."),Q=$;for(let q of J){if(Q===null||Q===void 0||typeof Q!=="object")return;Q=Q[q]}return Q}function d$($,X,J){let Q=X.split("."),q=$;for(let Y=0;Y<Q.length-1;Y++){if(!q[Q[Y]]||typeof q[Q[Y]]!=="object")q[Q[Y]]={};q=q[Q[Y]]}q[Q[Q.length-1]]=J}function RO($,X){let J=$.stack??{},Q=typeof J.hosting==="string"&&!D$(J.hosting)?J.hosting:"",q="",Y=SY(X,"package.json");if(R9(Y))try{let W=JSON.parse(ZY(Y,"utf-8"));if(W.version)q=`v${W.version}`}catch{}let z=[];if(typeof J.build==="string"&&!D$(J.build))z.push(J.build);if(typeof J.api_type==="string"&&!D$(J.api_type))z.push(J.api_type);let G=z.join(", ");return{where:Q,when:q,how:G}}function TY($,X){let J=$.human_context??{},Q=(q,Y)=>typeof q==="string"&&!D$(q)&&q?q:Y||O("—");console.log(`
304
+ Respond ONLY with valid JSON mapping these 6 keys to string values. No markdown.`,G=(await q.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:512,messages:[{role:"user",content:Y}]})).content[0].text;return JSON.parse(G)}catch{return null}}var EO=".faf-session.json";function x$($,X){let J=X.split("."),Q=$;for(let q of J){if(Q===null||Q===void 0||typeof Q!=="object")return;Q=Q[q]}return Q}function d$($,X,J){let Q=X.split("."),q=$;for(let Y=0;Y<Q.length-1;Y++){if(!q[Q[Y]]||typeof q[Q[Y]]!=="object")q[Q[Y]]={};q=q[Q[Y]]}q[Q[Q.length-1]]=J}function ZO($,X){let J=$.stack??{},Q=typeof J.hosting==="string"&&!D$(J.hosting)?J.hosting:"",q="",Y=fY(X,"package.json");if(F9(Y))try{let W=JSON.parse(PY(Y,"utf-8"));if(W.version)q=`v${W.version}`}catch{}let z=[];if(typeof J.build==="string"&&!D$(J.build))z.push(J.build);if(typeof J.api_type==="string"&&!D$(J.api_type))z.push(J.api_type);let G=z.join(", ");return{where:Q,when:q,how:G}}function bY($,X){let J=$.human_context??{},Q=(q,Y)=>typeof q==="string"&&!D$(q)&&q?q:Y||O("—");console.log(`
305
305
  ${S("6Ws")} ${O("— confirm or type a slot name to correct:")}
306
- `),console.log(` ${S("who")} ${Q(J.who,"")}`),console.log(` ${S("what")} ${Q(J.what,"")}`),console.log(` ${S("why")} ${Q(J.why,"")}`),console.log(` ${S("where")} ${Q(J.where,X.where)}`),console.log(` ${S("when")} ${Q(J.when,X.when)}`),console.log(` ${S("how")} ${Q(J.how,X.how)}`),console.log()}async function jY($={}){let X=r();if(!X)console.error(`Error: project.faf not found
306
+ `),console.log(` ${S("who")} ${Q(J.who,"")}`),console.log(` ${S("what")} ${Q(J.what,"")}`),console.log(` ${S("why")} ${Q(J.why,"")}`),console.log(` ${S("where")} ${Q(J.where,X.where)}`),console.log(` ${S("when")} ${Q(J.when,X.when)}`),console.log(` ${S("how")} ${Q(J.how,X.how)}`),console.log()}async function kY($={}){let X=r();if(!X)console.error(`Error: project.faf not found
307
307
 
308
- Run 'faf init' to create one.`),process.exit(2);let J=process.cwd(),Q=SY(J,LO),q=0;if($.resume&&R9(Q))try{q=JSON.parse(ZY(Q,"utf-8")).slotIndex,console.log(O(` resuming from slot #${q+1}`))}catch{}let Y=$$(X),G=E$.filter((N)=>{let L=x$(Y,N.path);return D$(L)&&L!=="slotignored"&&N.path!=="project.goal"}).filter((N)=>N.category!=="human"),H=["human_context.who","human_context.what","human_context.why","human_context.where","human_context.when","human_context.how"].some((N)=>D$(x$(Y,N))),U=D$(x$(Y,"project.goal"));if(!H&&!U&&G.length===0){console.log(`${A("◆")} go all slots populated`);let N=U$(H$(o(X)));N$(N,X);return}console.log(`${A("go")} ${O("— guided interview")}`);let V=DO({input:process.stdin,output:process.stdout}),B=(N)=>new Promise((L)=>V.question(N,L)),D=0;if(H&&q===0){console.log();let N=await B(` ${S("★")} In one sentence, what is this project designed to do? `);if(N.toLowerCase()==="quit"){EY(Q,JSON.stringify({slotIndex:0,fafPath:X}),"utf-8"),console.log(O(`
309
- session saved. Resume with: faf go --resume`)),V.close();return}if(N.toLowerCase()!=="skip"&&N.trim()!==""){let I=N.trim();console.log(O(" thinking..."));let Z=await wO(I,o(X)),y=["who","what","why","where","when","how"];if(Z){for(let l of y){let j=`human_context.${l}`;if(Z[l]&&D$(x$(Y,j)))d$(Y,j,Z[l]),D++}let x=Z.what||I,k=Z.why;if(D$(x$(Y,"project.goal")))d$(Y,"project.goal",k?`${x} — ${k}`:x),D++}else{if(D$(x$(Y,"human_context.what")))d$(Y,"human_context.what",I),D++;if(D$(x$(Y,"project.goal")))d$(Y,"project.goal",I),D++;let x=I.toLowerCase(),k=[[/\bdevs?\b|\bdevelopers?\b/,"developers"],[/\bengineers?\b/,"engineers"],[/\bteams?\b/,"engineering teams"],[/\busers?\b/,"end users"],[/\bdata scientists?\b/,"data scientists"],[/\bdesigners?\b/,"designers"]];for(let[l,j]of k)if(l.test(x)&&D$(x$(Y,"human_context.who"))){d$(Y,"human_context.who",j),D++;break}}}let L=RO(Y,J);if(L.where&&D$(x$(Y,"human_context.where")))d$(Y,"human_context.where",L.where),D++;if(L.when&&D$(x$(Y,"human_context.when")))d$(Y,"human_context.when",L.when),D++;if(L.how&&D$(x$(Y,"human_context.how")))d$(Y,"human_context.how",L.how),D++;TY(Y,L);while(!0){let I=await B(` ${O("[Enter to confirm, or type: who / what / why / where / when / how]")} `);if(I.trim()===""||I.toLowerCase()==="confirm")break;if(I.toLowerCase()==="quit"){V.close();return}let Z=I.trim().toLowerCase();if(["who","what","why","where","when","how"].includes(Z)){let x=await B(` ${S(Z)} → `);if(x.trim()){if(d$(Y,`human_context.${Z}`,x.trim()),Z==="what"||Z==="why"){let k=x$(Y,"human_context.what"),l=x$(Y,"human_context.why");if(k&&l)d$(Y,"project.goal",`${k} — ${l}`)}D++,TY(Y,L)}}}console.log()}let w=G.slice(q);if(w.length>0)console.log(O(` ${w.length} stack slot${w.length===1?"":"s"} remaining.
310
- `));for(let N=0;N<w.length;N++){let L=w[N],I=await B(` ${S(`#${L.index}`)} ${L.description} ${O(`(${L.path})`)}: `);if(I.toLowerCase()==="quit"){let Z={slotIndex:q+N,fafPath:X};EY(Q,JSON.stringify(Z),"utf-8"),console.log(O(`
308
+ Run 'faf init' to create one.`),process.exit(2);let J=process.cwd(),Q=fY(J,EO),q=0;if($.resume&&F9(Q))try{q=JSON.parse(PY(Q,"utf-8")).slotIndex,console.log(O(` resuming from slot #${q+1}`))}catch{}let Y=$$(X),G=E$.filter((N)=>{let L=x$(Y,N.path);return D$(L)&&L!=="slotignored"&&N.path!=="project.goal"}).filter((N)=>N.category!=="human"),H=["human_context.who","human_context.what","human_context.why","human_context.where","human_context.when","human_context.how"].some((N)=>D$(x$(Y,N))),U=D$(x$(Y,"project.goal"));if(!H&&!U&&G.length===0){console.log(`${A("◆")} go all slots populated`);let N=Y$(q$(a(X)));if(N$(N,X),N.score===100)q0("FAF: Trophy unlocked at 100%");return}console.log(`${A("go")} ${O("— guided interview")}`);let V=_O({input:process.stdin,output:process.stdout}),B=(N)=>new Promise((L)=>V.question(N,L)),D=0;if(H&&q===0){console.log();let N=await B(` ${S("★")} In one sentence, what is this project designed to do? `);if(N.toLowerCase()==="quit"){CY(Q,JSON.stringify({slotIndex:0,fafPath:X}),"utf-8"),console.log(O(`
309
+ session saved. Resume with: faf go --resume`)),V.close();return}if(N.toLowerCase()!=="skip"&&N.trim()!==""){let I=N.trim();console.log(O(" thinking..."));let T=await IO(I,a(X)),y=["who","what","why","where","when","how"];if(T){for(let l of y){let j=`human_context.${l}`;if(T[l]&&D$(x$(Y,j)))d$(Y,j,T[l]),D++}let x=T.what||I,k=T.why;if(D$(x$(Y,"project.goal")))d$(Y,"project.goal",k?`${x} — ${k}`:x),D++}else{if(D$(x$(Y,"human_context.what")))d$(Y,"human_context.what",I),D++;if(D$(x$(Y,"project.goal")))d$(Y,"project.goal",I),D++;let x=I.toLowerCase(),k=[[/\bdevs?\b|\bdevelopers?\b/,"developers"],[/\bengineers?\b/,"engineers"],[/\bteams?\b/,"engineering teams"],[/\busers?\b/,"end users"],[/\bdata scientists?\b/,"data scientists"],[/\bdesigners?\b/,"designers"]];for(let[l,j]of k)if(l.test(x)&&D$(x$(Y,"human_context.who"))){d$(Y,"human_context.who",j),D++;break}}}let L=ZO(Y,J);if(L.where&&D$(x$(Y,"human_context.where")))d$(Y,"human_context.where",L.where),D++;if(L.when&&D$(x$(Y,"human_context.when")))d$(Y,"human_context.when",L.when),D++;if(L.how&&D$(x$(Y,"human_context.how")))d$(Y,"human_context.how",L.how),D++;bY(Y,L);while(!0){let I=await B(` ${O("[Enter to confirm, or type: who / what / why / where / when / how]")} `);if(I.trim()===""||I.toLowerCase()==="confirm")break;if(I.toLowerCase()==="quit"){V.close();return}let T=I.trim().toLowerCase();if(["who","what","why","where","when","how"].includes(T)){let x=await B(` ${S(T)} → `);if(x.trim()){if(d$(Y,`human_context.${T}`,x.trim()),T==="what"||T==="why"){let k=x$(Y,"human_context.what"),l=x$(Y,"human_context.why");if(k&&l)d$(Y,"project.goal",`${k} — ${l}`)}D++,bY(Y,L)}}}console.log()}let w=G.slice(q);if(w.length>0)console.log(O(` ${w.length} stack slot${w.length===1?"":"s"} remaining.
310
+ `));for(let N=0;N<w.length;N++){let L=w[N],I=await B(` ${S(`#${L.index}`)} ${L.description} ${O(`(${L.path})`)}: `);if(I.toLowerCase()==="quit"){let T={slotIndex:q+N,fafPath:X};CY(Q,JSON.stringify(T),"utf-8"),console.log(O(`
311
311
  session saved. Resume with: faf go --resume`));break}if(I.toLowerCase()==="skip"||I.trim()==="")continue;d$(Y,L.path,I.trim()),D++}if(V.close(),D>0)Q$(X,Y),console.log(`
312
- ${A("◆")} go filled ${D} slot${D===1?"":"s"}`);let M=U$(H$(o(X)));if(N$(M,X),R9(Q))try{OO(Q)}catch{}}B$();B0();B0();l$();J0();e();function AO($,X){let J=X.split("."),Q=$;for(let q of J){if(Q===null||Q===void 0||typeof Q!=="object")return;Q=Q[q]}return Q}function _O($,X,J){let Q=X.split("."),q=$;for(let Y=0;Y<Q.length-1;Y++){if(!q[Q[Y]]||typeof q[Q[Y]]!=="object")q[Q[Y]]={};q=q[Q[Y]]}q[Q[Q.length-1]]=J}async function CY($){if($==="analyze")await IO();else if($==="enhance")await FO();else console.log(`${A("ai")} ${O("— AI-powered features")}
313
- `),console.log(` ${S("faf ai enhance")} ${O("— fill empty slots via Claude")}`),console.log(` ${S("faf ai analyze")} ${O("— get improvement suggestions")}`),console.log(""),console.log(O(" Requires ANTHROPIC_API_KEY environment variable."))}async function PY(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
312
+ ${A("◆")} go filled ${D} slot${D===1?"":"s"}`);let M=Y$(q$(a(X)));if(N$(M,X),M.score===100)q0("FAF: Trophy unlocked at 100%");else q0(`FAF: ${M.score}% ${M.tier.name} - go complete`);if(F9(Q))try{FO(Q)}catch{}}B$();K0();K0();l$();J0();e();function TO($,X){let J=X.split("."),Q=$;for(let q of J){if(Q===null||Q===void 0||typeof Q!=="object")return;Q=Q[q]}return Q}function SO($,X,J){let Q=X.split("."),q=$;for(let Y=0;Y<Q.length-1;Y++){if(!q[Q[Y]]||typeof q[Q[Y]]!=="object")q[Q[Y]]={};q=q[Q[Y]]}q[Q[Q.length-1]]=J}async function xY($){if($==="analyze")await CO();else if($==="enhance")await jO();else console.log(`${A("ai")} ${O("— AI-powered features")}
313
+ `),console.log(` ${S("faf ai enhance")} ${O("— fill empty slots via Claude")}`),console.log(` ${S("faf ai analyze")} ${O("— get improvement suggestions")}`),console.log(""),console.log(O(" Requires ANTHROPIC_API_KEY environment variable."))}async function yY(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
314
314
 
315
- export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:X}=await Promise.resolve().then(() => (L9(),w9));return new X({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
315
+ export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:X}=await Promise.resolve().then(() => (_9(),A9));return new X({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
316
316
 
317
- npm install @anthropic-ai/sdk`),process.exit(2)}}async function FO(){let $=r();if(!$)console.error(`Error: project.faf not found
317
+ npm install @anthropic-ai/sdk`),process.exit(2)}}async function jO(){let $=r();if(!$)console.error(`Error: project.faf not found
318
318
 
319
- Run 'faf init' to create one.`),process.exit(2);let X=$$($),J=o($),Q=E$.filter((W)=>{let H=AO(X,W.path);return D$(H)&&H!=="slotignored"});if(Q.length===0){console.log(`${A("◆")} ai enhance all slots populated`);return}console.log(`${A("ai")} enhance ${O(`filling ${Q.length} empty slots...`)}`);let q=await PY(),Y=Q.map((W)=>`- ${W.path}: ${W.description}`).join(`
319
+ Run 'faf init' to create one.`),process.exit(2);let X=$$($),J=a($),Q=E$.filter((W)=>{let H=TO(X,W.path);return D$(H)&&H!=="slotignored"});if(Q.length===0){console.log(`${A("◆")} ai enhance all slots populated`);return}console.log(`${A("ai")} enhance ${O(`filling ${Q.length} empty slots...`)}`);let q=await yY(),Y=Q.map((W)=>`- ${W.path}: ${W.description}`).join(`
320
320
  `),z=`Given this project .faf file:
321
321
 
322
322
  ${J}
@@ -326,18 +326,18 @@ Fill in these empty slots with reasonable values based on the project context. R
326
326
  Empty slots:
327
327
  ${Y}
328
328
 
329
- Respond with ONLY valid JSON, no markdown fences.`,G=await q.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:z}]});try{let W=G.content[0].text,H=JSON.parse(W),U=0;for(let V of Q){let B=H[V.path];if(B&&typeof B==="string")_O(X,V.path,B),console.log(` ${A("●")} ${V.path} ${O("←")} ${B}`),U++}if(U>0){Q$($,X),console.log(`
330
- ${A("◆")} ai enhance filled ${U} slot${U===1?"":"s"}`);let V=U$(H$(o($)));N$(V,$)}}catch{console.error("Error: Could not parse AI response.")}}async function IO(){let $=r();if(!$)console.error(`Error: project.faf not found
329
+ Respond with ONLY valid JSON, no markdown fences.`,G=await q.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:z}]});try{let W=G.content[0].text,H=JSON.parse(W),U=0;for(let V of Q){let B=H[V.path];if(B&&typeof B==="string")SO(X,V.path,B),console.log(` ${A("●")} ${V.path} ${O("←")} ${B}`),U++}if(U>0){Q$($,X),console.log(`
330
+ ${A("◆")} ai enhance filled ${U} slot${U===1?"":"s"}`);let V=Y$(q$(a($)));N$(V,$)}}catch{console.error("Error: Could not parse AI response.")}}async function CO(){let $=r();if(!$)console.error(`Error: project.faf not found
331
331
 
332
- Run 'faf init' to create one.`),process.exit(2);let X=o($);console.log(`${A("ai")} analyze ${O("getting suggestions...")}`);let Q=await(await PY()).messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:`Analyze this .faf project context file and provide 3-5 specific suggestions for improvement. Focus on completeness, accuracy, and best practices.
332
+ Run 'faf init' to create one.`),process.exit(2);let X=a($);console.log(`${A("ai")} analyze ${O("getting suggestions...")}`);let Q=await(await yY()).messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:`Analyze this .faf project context file and provide 3-5 specific suggestions for improvement. Focus on completeness, accuracy, and best practices.
333
333
 
334
334
  ${X}
335
335
 
336
- Be concise. One line per suggestion.`}]});console.log(""),console.log(Q.content[0].text)}B$();s4();e();import{existsSync as A9,readFileSync as _9,readdirSync as EO}from"fs";import{join as bY}from"path";function fY($,X){if($==="import")TO(X);else if($==="export")ZO();else console.log(`${A("conductor")} ${O("— conductor integration")}
337
- `),console.log(` ${S("faf conductor import <path>")} ${O("— import conductor config into .faf")}`),console.log(` ${S("faf conductor export")} ${O("— generate conductor config from .faf")}`)}function TO($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!A9($))console.error(`Error: path not found: ${$}`),process.exit(2);let X={faf_version:"3.0",project:{}};if(A9($)&&$.endsWith(".json")){let q=JSON.parse(_9($,"utf-8"));if(q.name)X.project.name=q.name;if(q.description)X.project.goal=q.description;if(q.language)X.project.main_language=q.language}else if(A9($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let q=p6(_9($,"utf-8"));if(q.name)X.project.name=q.name;if(q.description)X.project.goal=q.description;if(q.language)X.project.main_language=q.language}else try{let q=EO($);for(let Y of q){let z=bY($,Y);if(Y.endsWith(".json"))try{let G=JSON.parse(_9(z,"utf-8"));if(G.name&&!X.project.name)X.project.name=G.name;if(G.description&&!X.project.goal)X.project.goal=G.description}catch{}}}catch{console.error(`Error: could not read directory: ${$}`),process.exit(2)}let J=process.cwd(),Q=r(J);if(Q){let q=$$(Q);if(!q.project)q.project={};if(X.project.name&&!q.project.name)q.project.name=X.project.name;if(X.project.goal&&!q.project.goal)q.project.goal=X.project.goal;if(X.project.main_language&&!q.project.main_language)q.project.main_language=X.project.main_language;Q$(Q,q),console.log(`${A("◆")} conductor import merged into ${Q}`)}else{let q=bY(J,"project.faf");Q$(q,X),console.log(`${A("◆")} conductor import created ${q}`)}}function ZO(){let $=r();if(!$)console.error(`Error: project.faf not found
336
+ Be concise. One line per suggestion.`}]});console.log(""),console.log(Q.content[0].text)}B$();e4();e();import{existsSync as I9,readFileSync as E9,readdirSync as bO}from"fs";import{join as gY}from"path";function vY($,X){if($==="import")PO(X);else if($==="export")fO();else console.log(`${A("conductor")} ${O("— conductor integration")}
337
+ `),console.log(` ${S("faf conductor import <path>")} ${O("— import conductor config into .faf")}`),console.log(` ${S("faf conductor export")} ${O("— generate conductor config from .faf")}`)}function PO($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!I9($))console.error(`Error: path not found: ${$}`),process.exit(2);let X={faf_version:"3.0",project:{}};if(I9($)&&$.endsWith(".json")){let q=JSON.parse(E9($,"utf-8"));if(q.name)X.project.name=q.name;if(q.description)X.project.goal=q.description;if(q.language)X.project.main_language=q.language}else if(I9($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let q=i6(E9($,"utf-8"));if(q.name)X.project.name=q.name;if(q.description)X.project.goal=q.description;if(q.language)X.project.main_language=q.language}else try{let q=bO($);for(let Y of q){let z=gY($,Y);if(Y.endsWith(".json"))try{let G=JSON.parse(E9(z,"utf-8"));if(G.name&&!X.project.name)X.project.name=G.name;if(G.description&&!X.project.goal)X.project.goal=G.description}catch{}}}catch{console.error(`Error: could not read directory: ${$}`),process.exit(2)}let J=process.cwd(),Q=r(J);if(Q){let q=$$(Q);if(!q.project)q.project={};if(X.project.name&&!q.project.name)q.project.name=X.project.name;if(X.project.goal&&!q.project.goal)q.project.goal=X.project.goal;if(X.project.main_language&&!q.project.main_language)q.project.main_language=X.project.main_language;Q$(Q,q),console.log(`${A("◆")} conductor import merged into ${Q}`)}else{let q=gY(J,"project.faf");Q$(q,X),console.log(`${A("◆")} conductor import created ${q}`)}}function fO(){let $=r();if(!$)console.error(`Error: project.faf not found
338
338
 
339
- Run 'faf init' to create one.`),process.exit(2);let X=$$($),J={name:X.project?.name??"",description:X.project?.goal??"",language:X.project?.main_language??"",stack:X.stack??{}};console.log(JSON.stringify(J,null,2))}import{readFileSync as LX,writeFileSync as F9,existsSync as Q6,mkdirSync as kY}from"fs";import{join as i$,dirname as xY}from"path";import{fileURLToPath as yY}from"url";import{homedir as gY}from"os";class I9{skillsDir=i$(gY(),".config","claude-code","skills");fafSkillsDir=i$(this.skillsDir,"faf-commands");claudeSkillsDir=i$(gY(),".claude","skills","faf");async syncSkills(){await this.syncToLocation(this.fafSkillsDir),await this.syncToClaudeDir()}async syncToClaudeDir(){if(!Q6(this.claudeSkillsDir))return;let $=i$(this.claudeSkillsDir,"skills.json");if(!Q6($))return;let X=JSON.parse(LX($,"utf-8")),J=JSON.parse(LX(i$(xY(yY(import.meta.url)),"../../package.json"),"utf-8"));X.requirements["faf-cli"]=`>=${J.version}`,X.lastSync=new Date().toISOString(),F9($,JSON.stringify(X,null,2))}async syncToLocation($){if(!Q6($))kY($,{recursive:!0});let X=i$(xY(yY(import.meta.url)),"../../commands"),{readdirSync:J}=await import("fs"),Q=J(X).filter((Y)=>Y.startsWith("faf-")&&Y.endsWith(".md")),q={version:"1.0.0",skills:[],preferences:{conciseDescriptions:!0,functionalLanguage:!0,minimalEmojis:!0}};for(let Y of Q){let z=LX(i$(X,Y),"utf-8"),G=this.parseCommandFile(z,Y);if(G)q.skills.push(G),await this.createSkillFileInDir(G,z,$)}F9(i$($,"index.json"),JSON.stringify(q,null,2))}parseCommandFile($,X){let J=$.split(`
340
- `),Q="",q="";for(let z of J){if(z.startsWith("description:"))Q=z.replace("description:","").trim();if(z.startsWith("argument-hint:"))q=z.replace("argument-hint:","").trim()}if(!Q)return null;return{name:X.replace(".md",""),description:Q,...q&&q!=="None"?{"argument-hint":q}:{}}}async createSkillFileInDir($,X,J){let Q=i$(J,$.name);if(!Q6(Q))kY(Q,{recursive:!0});let Y=X.split("---").slice(2).join("---").trim(),z=`---
339
+ Run 'faf init' to create one.`),process.exit(2);let X=$$($),J={name:X.project?.name??"",description:X.project?.goal??"",language:X.project?.main_language??"",stack:X.stack??{}};console.log(JSON.stringify(J,null,2))}import{readFileSync as FX,writeFileSync as Z9,existsSync as Y6,mkdirSync as hY}from"fs";import{join as i$,dirname as uY}from"path";import{fileURLToPath as mY}from"url";import{homedir as lY}from"os";class T9{skillsDir=i$(lY(),".config","claude-code","skills");fafSkillsDir=i$(this.skillsDir,"faf-commands");claudeSkillsDir=i$(lY(),".claude","skills","faf");async syncSkills(){await this.syncToLocation(this.fafSkillsDir),await this.syncToClaudeDir()}async syncToClaudeDir(){if(!Y6(this.claudeSkillsDir))return;let $=i$(this.claudeSkillsDir,"skills.json");if(!Y6($))return;let X=JSON.parse(FX($,"utf-8")),J=JSON.parse(FX(i$(uY(mY(import.meta.url)),"../../package.json"),"utf-8"));X.requirements["faf-cli"]=`>=${J.version}`,X.lastSync=new Date().toISOString(),Z9($,JSON.stringify(X,null,2))}async syncToLocation($){if(!Y6($))hY($,{recursive:!0});let X=i$(uY(mY(import.meta.url)),"../../commands"),{readdirSync:J}=await import("fs"),Q=J(X).filter((Y)=>Y.startsWith("faf-")&&Y.endsWith(".md")),q={version:"1.0.0",skills:[],preferences:{conciseDescriptions:!0,functionalLanguage:!0,minimalEmojis:!0}};for(let Y of Q){let z=FX(i$(X,Y),"utf-8"),G=this.parseCommandFile(z,Y);if(G)q.skills.push(G),await this.createSkillFileInDir(G,z,$)}Z9(i$($,"index.json"),JSON.stringify(q,null,2))}parseCommandFile($,X){let J=$.split(`
340
+ `),Q="",q="";for(let z of J){if(z.startsWith("description:"))Q=z.replace("description:","").trim();if(z.startsWith("argument-hint:"))q=z.replace("argument-hint:","").trim()}if(!Q)return null;return{name:X.replace(".md",""),description:Q,...q&&q!=="None"?{"argument-hint":q}:{}}}async createSkillFileInDir($,X,J){let Q=i$(J,$.name);if(!Y6(Q))hY(Q,{recursive:!0});let Y=X.split("---").slice(2).join("---").trim(),z=`---
341
341
  name: ${$.name}
342
342
  description: ${$.description}${$["argument-hint"]?`
343
343
  argument-hint: ${$["argument-hint"]}`:""}
@@ -358,9 +358,9 @@ This skill is automatically synced from faf-cli v6 commands.
358
358
 
359
359
  ### Usage in Claude Code:
360
360
  \`\`\`
361
- /${$.name}${$["argument-hint"]&&$["argument-hint"]!=="None"?" ["+$["argument-hint"]+"]":""}
361
+ /${$.name}${$["argument-hint"]&&$["argument-hint"]!=="None"?` [${$["argument-hint"]}]`:""}
362
362
  \`\`\`
363
- `;F9(i$(Q,"SKILL.md"),z)}async checkIntegration(){if(!Q6(this.fafSkillsDir))return!1;let $=i$(this.fafSkillsDir,"index.json");if(!Q6($))return!1;try{let X=JSON.parse(LX($,"utf-8"));return X.version&&Array.isArray(X.skills)}catch{return!1}}getBestPractices(){return`
363
+ `;Z9(i$(Q,"SKILL.md"),z)}async checkIntegration(){if(!Y6(this.fafSkillsDir))return!1;let $=i$(this.fafSkillsDir,"index.json");if(!Y6($))return!1;try{let X=JSON.parse(FX($,"utf-8"));return X.version&&Array.isArray(X.skills)}catch{return!1}}getBestPractices(){return`
364
364
  Claude Code Integration Best Practices for faf-cli:
365
365
 
366
366
  1. **Command Descriptions**
@@ -392,11 +392,11 @@ Claude Code Integration Best Practices for faf-cli:
392
392
  - Version descriptions properly
393
393
  - Test in Claude Code after changes
394
394
  - Keep skills directory clean
395
- `}}e();function vY(){return new L8("claude-sync").description("Sync faf commands with Claude Code integration").option("--check","Check integration status only").option("--best-practices","Show Claude Code integration best practices").action(async($)=>{let X=new I9;if($.bestPractices){console.log(X.getBestPractices());return}if($.check){if(await X.checkIntegration())console.log(`${A("✓")} Claude Code integration is properly configured`);else console.log(`${A("◆")} Claude Code integration needs setup`),console.log(` Run ${S("faf claude-sync")} to configure`);return}console.log(`${A("◆")} Syncing with Claude Code...`);try{await X.syncSkills(),console.log(`${A("✓")} Skills synced to ~/.config/claude-code/skills/faf-commands/`),console.log(O(" Restart Claude Code to see updated slash commands"))}catch(J){console.error("Failed to sync:",J),process.exit(1)}})}e();import{spawn as SO}from"child_process";import{join as hY,dirname as jO}from"path";import{fileURLToPath as CO}from"url";function uY(){return new L8("bun-update").alias("update").description("Update Bun runtime and dependencies").action(async()=>{console.log(`${A("\uD83C\uDFCE️")} Running Bun update routine...`);let $=jO(CO(import.meta.url)),X=hY($,"../../scripts/bun-update.ts"),J=SO("bun",[X],{stdio:"inherit",cwd:hY($,"../..")});J.on("error",(Q)=>{console.error(`Failed to run update: ${Q.message}`),console.log(`
396
- Try running: ${S("bun scripts/bun-update.ts")}`),process.exit(1)}),J.on("exit",(Q)=>{if(Q!==0)process.exit(Q||1)})})}e();import{existsSync as mY,cpSync as PO}from"fs";import{join as RX}from"path";import{homedir as bO}from"os";import{fileURLToPath as fO}from"url";import{dirname as kO}from"path";async function lY(){let $=kO(fO(import.meta.url)),X,J=[RX($,"../../../skills/faf"),RX($,"../../skills/faf"),RX($,"../skills/faf")];for(let q of J)if(mY(q)){X=q;break}if(!X){console.log(`${O(" Skills package not found in distribution")}`),console.log(`${O(" Checked:")} ${J.join(", ")}`),console.log(`${O(" Run")} ${S("faf claude-sync")} ${O("to generate skills from commands")}`);return}let Q=RX(bO(),".claude","skills","faf");if(console.log(`${A("◆")} Installing FAF skills for Claude Code...`),mY(Q)){console.log(`${A("!")} FAF skills already installed at ${O(Q)}`),console.log(" To reinstall, first remove the existing directory");return}try{PO(X,Q,{recursive:!0}),console.log(`${A("✓")} Installed FAF skills to ~/.claude/skills/faf/`),console.log(""),console.log("Available skills:"),console.log(` ${S("/faf-champion")} - Achieve 100% AI-readiness score`),console.log(` ${S("/faf-quickstart")} - Initialize FAF context in seconds`),console.log(` ${S("/faf-sync-master")} - Keep .faf and CLAUDE.md in sync`),console.log(""),console.log(O(" Restart Claude Code to see the new skills"))}catch(q){console.error("Failed to install skills:",q),process.exit(1)}}class E9{tools=new Map;register($){if(this.tools.has($.name))throw Error(`Tool '${$.name}' already registered`);this.tools.set($.name,$)}get($){return this.tools.get($)}list(){return Array.from(this.tools.values())}listByPermission($){return this.list().filter((X)=>X.permission===$)}listByRisk($){return this.list().filter((X)=>X.risk===$)}}class V8{tags=["faf","ai-context"];validate($){let X=this.schema.safeParse($);if(!X.success)throw Error(`Invalid input for ${this.name}: ${X.error.message}`);return X.data}canExecute($){let X=["plan","standard","auto","bypass"],J=X.indexOf(this.permission);return X.indexOf($.permissionMode)>=J}}var A$={};SX(A$,{void:()=>ww,util:()=>d,unknown:()=>Dw,union:()=>_w,undefined:()=>Kw,tuple:()=>Ew,transformer:()=>xw,symbol:()=>Bw,string:()=>oY,strictObject:()=>Aw,setErrorMap:()=>gO,set:()=>Sw,record:()=>Tw,quotelessJson:()=>xO,promise:()=>kw,preprocess:()=>vw,pipeline:()=>hw,ostring:()=>uw,optional:()=>yw,onumber:()=>mw,oboolean:()=>lw,objectUtil:()=>T9,object:()=>Rw,number:()=>tY,nullable:()=>gw,null:()=>Mw,never:()=>Ow,nativeEnum:()=>fw,nan:()=>Hw,map:()=>Zw,makeIssue:()=>y2,literal:()=>Pw,lazy:()=>Cw,late:()=>Gw,isValid:()=>c0,isDirty:()=>_X,isAsync:()=>Y6,isAborted:()=>AX,intersection:()=>Iw,instanceof:()=>Ww,getParsedType:()=>z0,getErrorMap:()=>q6,function:()=>jw,enum:()=>bw,effect:()=>xw,discriminatedUnion:()=>Fw,defaultErrorMap:()=>L0,datetimeRegex:()=>rY,date:()=>Vw,custom:()=>aY,coerce:()=>cw,boolean:()=>eY,bigint:()=>Uw,array:()=>Lw,any:()=>Nw,addIssueToContext:()=>T,ZodVoid:()=>v2,ZodUnknown:()=>p0,ZodUnion:()=>V6,ZodUndefined:()=>H6,ZodType:()=>c,ZodTuple:()=>W0,ZodTransformer:()=>o$,ZodSymbol:()=>g2,ZodString:()=>n$,ZodSet:()=>N8,ZodSchema:()=>c,ZodRecord:()=>h2,ZodReadonly:()=>w6,ZodPromise:()=>D8,ZodPipeline:()=>l2,ZodParsedType:()=>F,ZodOptional:()=>s$,ZodObject:()=>z$,ZodNumber:()=>d0,ZodNullable:()=>A0,ZodNull:()=>U6,ZodNever:()=>G0,ZodNativeEnum:()=>N6,ZodNaN:()=>m2,ZodMap:()=>u2,ZodLiteral:()=>M6,ZodLazy:()=>K6,ZodIssueCode:()=>R,ZodIntersection:()=>B6,ZodFunction:()=>G6,ZodFirstPartyTypeKind:()=>h,ZodError:()=>Z$,ZodEnum:()=>n0,ZodEffects:()=>o$,ZodDiscriminatedUnion:()=>FX,ZodDefault:()=>D6,ZodDate:()=>K8,ZodCatch:()=>O6,ZodBranded:()=>IX,ZodBoolean:()=>W6,ZodBigInt:()=>i0,ZodArray:()=>r$,ZodAny:()=>M8,Schema:()=>c,ParseStatus:()=>F$,OK:()=>I$,NEVER:()=>pw,INVALID:()=>v,EMPTY_PATH:()=>vO,DIRTY:()=>B8,BRAND:()=>zw});var d;(function($){$.assertEqual=(q)=>{};function X(q){}$.assertIs=X;function J(q){throw Error()}$.assertNever=J,$.arrayToEnum=(q)=>{let Y={};for(let z of q)Y[z]=z;return Y},$.getValidEnumValues=(q)=>{let Y=$.objectKeys(q).filter((G)=>typeof q[q[G]]!=="number"),z={};for(let G of Y)z[G]=q[G];return $.objectValues(z)},$.objectValues=(q)=>{return $.objectKeys(q).map(function(Y){return q[Y]})},$.objectKeys=typeof Object.keys==="function"?(q)=>Object.keys(q):(q)=>{let Y=[];for(let z in q)if(Object.prototype.hasOwnProperty.call(q,z))Y.push(z);return Y},$.find=(q,Y)=>{for(let z of q)if(Y(z))return z;return},$.isInteger=typeof Number.isInteger==="function"?(q)=>Number.isInteger(q):(q)=>typeof q==="number"&&Number.isFinite(q)&&Math.floor(q)===q;function Q(q,Y=" | "){return q.map((z)=>typeof z==="string"?`'${z}'`:z).join(Y)}$.joinValues=Q,$.jsonStringifyReplacer=(q,Y)=>{if(typeof Y==="bigint")return Y.toString();return Y}})(d||(d={}));var T9;(function($){$.mergeShapes=(X,J)=>{return{...X,...J}}})(T9||(T9={}));var F=d.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),z0=($)=>{switch(typeof $){case"undefined":return F.undefined;case"string":return F.string;case"number":return Number.isNaN($)?F.nan:F.number;case"boolean":return F.boolean;case"function":return F.function;case"bigint":return F.bigint;case"symbol":return F.symbol;case"object":if(Array.isArray($))return F.array;if($===null)return F.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return F.promise;if(typeof Map<"u"&&$ instanceof Map)return F.map;if(typeof Set<"u"&&$ instanceof Set)return F.set;if(typeof Date<"u"&&$ instanceof Date)return F.date;return F.object;default:return F.unknown}};var R=d.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xO=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class Z$ extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(J)=>{this.issues=[...this.issues,J]},this.addIssues=(J=[])=>{this.issues=[...this.issues,...J]};let X=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,X);else this.__proto__=X;this.name="ZodError",this.issues=$}format($){let X=$||function(q){return q.message},J={_errors:[]},Q=(q)=>{for(let Y of q.issues)if(Y.code==="invalid_union")Y.unionErrors.map(Q);else if(Y.code==="invalid_return_type")Q(Y.returnTypeError);else if(Y.code==="invalid_arguments")Q(Y.argumentsError);else if(Y.path.length===0)J._errors.push(X(Y));else{let z=J,G=0;while(G<Y.path.length){let W=Y.path[G];if(G!==Y.path.length-1)z[W]=z[W]||{_errors:[]};else z[W]=z[W]||{_errors:[]},z[W]._errors.push(X(Y));z=z[W],G++}}};return Q(this),J}static assert($){if(!($ instanceof Z$))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,d.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(X)=>X.message){let X={},J=[];for(let Q of this.issues)if(Q.path.length>0){let q=Q.path[0];X[q]=X[q]||[],X[q].push($(Q))}else J.push($(Q));return{formErrors:J,fieldErrors:X}}get formErrors(){return this.flatten()}}Z$.create=($)=>{return new Z$($)};var yO=($,X)=>{let J;switch($.code){case R.invalid_type:if($.received===F.undefined)J="Required";else J=`Expected ${$.expected}, received ${$.received}`;break;case R.invalid_literal:J=`Invalid literal value, expected ${JSON.stringify($.expected,d.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:J=`Unrecognized key(s) in object: ${d.joinValues($.keys,", ")}`;break;case R.invalid_union:J="Invalid input";break;case R.invalid_union_discriminator:J=`Invalid discriminator value. Expected ${d.joinValues($.options)}`;break;case R.invalid_enum_value:J=`Invalid enum value. Expected ${d.joinValues($.options)}, received '${$.received}'`;break;case R.invalid_arguments:J="Invalid function arguments";break;case R.invalid_return_type:J="Invalid function return type";break;case R.invalid_date:J="Invalid date";break;case R.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(J=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")J=`${J} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)J=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)J=`Invalid input: must end with "${$.validation.endsWith}"`;else d.assertNever($.validation);else if($.validation!=="regex")J=`Invalid ${$.validation}`;else J="Invalid";break;case R.too_small:if($.type==="array")J=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")J=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")J=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")J=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")J=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else J="Invalid input";break;case R.too_big:if($.type==="array")J=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")J=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")J=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")J=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")J=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else J="Invalid input";break;case R.custom:J="Invalid input";break;case R.invalid_intersection_types:J="Intersection results could not be merged";break;case R.not_multiple_of:J=`Number must be a multiple of ${$.multipleOf}`;break;case R.not_finite:J="Number must be finite";break;default:J=X.defaultError,d.assertNever($)}return{message:J}},L0=yO;var cY=L0;function gO($){cY=$}function q6(){return cY}var y2=($)=>{let{data:X,path:J,errorMaps:Q,issueData:q}=$,Y=[...J,...q.path||[]],z={...q,path:Y};if(q.message!==void 0)return{...q,path:Y,message:q.message};let G="",W=Q.filter((H)=>!!H).slice().reverse();for(let H of W)G=H(z,{data:X,defaultError:G}).message;return{...q,path:Y,message:G}},vO=[];function T($,X){let J=q6(),Q=y2({issueData:X,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,J,J===L0?void 0:L0].filter((q)=>!!q)});$.common.issues.push(Q)}class F${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,X){let J=[];for(let Q of X){if(Q.status==="aborted")return v;if(Q.status==="dirty")$.dirty();J.push(Q.value)}return{status:$.value,value:J}}static async mergeObjectAsync($,X){let J=[];for(let Q of X){let q=await Q.key,Y=await Q.value;J.push({key:q,value:Y})}return F$.mergeObjectSync($,J)}static mergeObjectSync($,X){let J={};for(let Q of X){let{key:q,value:Y}=Q;if(q.status==="aborted")return v;if(Y.status==="aborted")return v;if(q.status==="dirty")$.dirty();if(Y.status==="dirty")$.dirty();if(q.value!=="__proto__"&&(typeof Y.value<"u"||Q.alwaysSet))J[q.value]=Y.value}return{status:$.value,value:J}}}var v=Object.freeze({status:"aborted"}),B8=($)=>({status:"dirty",value:$}),I$=($)=>({status:"valid",value:$}),AX=($)=>$.status==="aborted",_X=($)=>$.status==="dirty",c0=($)=>$.status==="valid",Y6=($)=>typeof Promise<"u"&&$ instanceof Promise;var f;(function($){$.errToObj=(X)=>typeof X==="string"?{message:X}:X||{},$.toString=(X)=>typeof X==="string"?X:X?.message})(f||(f={}));class a${constructor($,X,J,Q){this._cachedPath=[],this.parent=$,this.data=X,this._path=J,this._key=Q}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var pY=($,X)=>{if(c0(X))return{success:!0,data:X.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let J=new Z$($.common.issues);return this._error=J,this._error}}}};function m($){if(!$)return{};let{errorMap:X,invalid_type_error:J,required_error:Q,description:q}=$;if(X&&(J||Q))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(X)return{errorMap:X,description:q};return{errorMap:(z,G)=>{let{message:W}=$;if(z.code==="invalid_enum_value")return{message:W??G.defaultError};if(typeof G.data>"u")return{message:W??Q??G.defaultError};if(z.code!=="invalid_type")return{message:G.defaultError};return{message:W??J??G.defaultError}},description:q}}class c{get description(){return this._def.description}_getType($){return z0($.data)}_getOrReturnCtx($,X){return X||{common:$.parent.common,data:$.data,parsedType:z0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new F$,ctx:{common:$.parent.common,data:$.data,parsedType:z0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let X=this._parse($);if(Y6(X))throw Error("Synchronous parse encountered promise.");return X}_parseAsync($){let X=this._parse($);return Promise.resolve(X)}parse($,X){let J=this.safeParse($,X);if(J.success)return J.data;throw J.error}safeParse($,X){let J={common:{issues:[],async:X?.async??!1,contextualErrorMap:X?.errorMap},path:X?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:z0($)},Q=this._parseSync({data:$,path:J.path,parent:J});return pY(J,Q)}"~validate"($){let X={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:z0($)};if(!this["~standard"].async)try{let J=this._parseSync({data:$,path:[],parent:X});return c0(J)?{value:J.value}:{issues:X.common.issues}}catch(J){if(J?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;X.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:X}).then((J)=>c0(J)?{value:J.value}:{issues:X.common.issues})}async parseAsync($,X){let J=await this.safeParseAsync($,X);if(J.success)return J.data;throw J.error}async safeParseAsync($,X){let J={common:{issues:[],contextualErrorMap:X?.errorMap,async:!0},path:X?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:z0($)},Q=this._parse({data:$,path:J.path,parent:J}),q=await(Y6(Q)?Q:Promise.resolve(Q));return pY(J,q)}refine($,X){let J=(Q)=>{if(typeof X==="string"||typeof X>"u")return{message:X};else if(typeof X==="function")return X(Q);else return X};return this._refinement((Q,q)=>{let Y=$(Q),z=()=>q.addIssue({code:R.custom,...J(Q)});if(typeof Promise<"u"&&Y instanceof Promise)return Y.then((G)=>{if(!G)return z(),!1;else return!0});if(!Y)return z(),!1;else return!0})}refinement($,X){return this._refinement((J,Q)=>{if(!$(J))return Q.addIssue(typeof X==="function"?X(J,Q):X),!1;else return!0})}_refinement($){return new o$({schema:this,typeName:h.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(X)=>this["~validate"](X)}}optional(){return s$.create(this,this._def)}nullable(){return A0.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return r$.create(this)}promise(){return D8.create(this,this._def)}or($){return V6.create([this,$],this._def)}and($){return B6.create(this,$,this._def)}transform($){return new o$({...m(this._def),schema:this,typeName:h.ZodEffects,effect:{type:"transform",transform:$}})}default($){let X=typeof $==="function"?$:()=>$;return new D6({...m(this._def),innerType:this,defaultValue:X,typeName:h.ZodDefault})}brand(){return new IX({typeName:h.ZodBranded,type:this,...m(this._def)})}catch($){let X=typeof $==="function"?$:()=>$;return new O6({...m(this._def),innerType:this,catchValue:X,typeName:h.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return l2.create(this,$)}readonly(){return w6.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var hO=/^c[^\s-]{8,}$/i,uO=/^[0-9a-z]+$/,mO=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lO=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,cO=/^[a-z0-9_-]{21}$/i,pO=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dO=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,iO=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Z9,rO=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sO=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,aO=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,oO=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tO=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,eO=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,iY="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",$w=new RegExp(`^${iY}$`);function nY($){let X="[0-5]\\d";if($.precision)X=`${X}\\.\\d{${$.precision}}`;else if($.precision==null)X=`${X}(\\.\\d+)?`;let J=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${X})${J}`}function Xw($){return new RegExp(`^${nY($)}$`)}function rY($){let X=`${iY}T${nY($)}`,J=[];if(J.push($.local?"Z?":"Z"),$.offset)J.push("([+-]\\d{2}:?\\d{2})");return X=`${X}(${J.join("|")})`,new RegExp(`^${X}$`)}function Jw($,X){if((X==="v4"||!X)&&rO.test($))return!0;if((X==="v6"||!X)&&aO.test($))return!0;return!1}function Qw($,X){if(!pO.test($))return!1;try{let[J]=$.split(".");if(!J)return!1;let Q=J.replace(/-/g,"+").replace(/_/g,"/").padEnd(J.length+(4-J.length%4)%4,"="),q=JSON.parse(atob(Q));if(typeof q!=="object"||q===null)return!1;if("typ"in q&&q?.typ!=="JWT")return!1;if(!q.alg)return!1;if(X&&q.alg!==X)return!1;return!0}catch{return!1}}function qw($,X){if((X==="v4"||!X)&&sO.test($))return!0;if((X==="v6"||!X)&&oO.test($))return!0;return!1}class n$ extends c{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==F.string){let q=this._getOrReturnCtx($);return T(q,{code:R.invalid_type,expected:F.string,received:q.parsedType}),v}let J=new F$,Q=void 0;for(let q of this._def.checks)if(q.kind==="min"){if($.data.length<q.value)Q=this._getOrReturnCtx($,Q),T(Q,{code:R.too_small,minimum:q.value,type:"string",inclusive:!0,exact:!1,message:q.message}),J.dirty()}else if(q.kind==="max"){if($.data.length>q.value)Q=this._getOrReturnCtx($,Q),T(Q,{code:R.too_big,maximum:q.value,type:"string",inclusive:!0,exact:!1,message:q.message}),J.dirty()}else if(q.kind==="length"){let Y=$.data.length>q.value,z=$.data.length<q.value;if(Y||z){if(Q=this._getOrReturnCtx($,Q),Y)T(Q,{code:R.too_big,maximum:q.value,type:"string",inclusive:!0,exact:!0,message:q.message});else if(z)T(Q,{code:R.too_small,minimum:q.value,type:"string",inclusive:!0,exact:!0,message:q.message});J.dirty()}}else if(q.kind==="email"){if(!iO.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"email",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="emoji"){if(!Z9)Z9=new RegExp(nO,"u");if(!Z9.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"emoji",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="uuid"){if(!lO.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"uuid",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="nanoid"){if(!cO.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"nanoid",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="cuid"){if(!hO.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"cuid",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="cuid2"){if(!uO.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"cuid2",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="ulid"){if(!mO.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"ulid",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="url")try{new URL($.data)}catch{Q=this._getOrReturnCtx($,Q),T(Q,{validation:"url",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="regex"){if(q.regex.lastIndex=0,!q.regex.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"regex",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="trim")$.data=$.data.trim();else if(q.kind==="includes"){if(!$.data.includes(q.value,q.position))Q=this._getOrReturnCtx($,Q),T(Q,{code:R.invalid_string,validation:{includes:q.value,position:q.position},message:q.message}),J.dirty()}else if(q.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(q.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(q.kind==="startsWith"){if(!$.data.startsWith(q.value))Q=this._getOrReturnCtx($,Q),T(Q,{code:R.invalid_string,validation:{startsWith:q.value},message:q.message}),J.dirty()}else if(q.kind==="endsWith"){if(!$.data.endsWith(q.value))Q=this._getOrReturnCtx($,Q),T(Q,{code:R.invalid_string,validation:{endsWith:q.value},message:q.message}),J.dirty()}else if(q.kind==="datetime"){if(!rY(q).test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{code:R.invalid_string,validation:"datetime",message:q.message}),J.dirty()}else if(q.kind==="date"){if(!$w.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{code:R.invalid_string,validation:"date",message:q.message}),J.dirty()}else if(q.kind==="time"){if(!Xw(q).test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{code:R.invalid_string,validation:"time",message:q.message}),J.dirty()}else if(q.kind==="duration"){if(!dO.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"duration",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="ip"){if(!Jw($.data,q.version))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"ip",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="jwt"){if(!Qw($.data,q.alg))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"jwt",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="cidr"){if(!qw($.data,q.version))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"cidr",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="base64"){if(!tO.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"base64",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="base64url"){if(!eO.test($.data))Q=this._getOrReturnCtx($,Q),T(Q,{validation:"base64url",code:R.invalid_string,message:q.message}),J.dirty()}else d.assertNever(q);return{status:J.value,value:$.data}}_regex($,X,J){return this.refinement((Q)=>$.test(Q),{validation:X,code:R.invalid_string,...f.errToObj(J)})}_addCheck($){return new n$({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...f.errToObj($)})}url($){return this._addCheck({kind:"url",...f.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...f.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...f.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...f.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...f.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...f.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...f.errToObj($)})}base64($){return this._addCheck({kind:"base64",...f.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...f.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...f.errToObj($)})}ip($){return this._addCheck({kind:"ip",...f.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...f.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...f.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...f.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...f.errToObj($)})}regex($,X){return this._addCheck({kind:"regex",regex:$,...f.errToObj(X)})}includes($,X){return this._addCheck({kind:"includes",value:$,position:X?.position,...f.errToObj(X?.message)})}startsWith($,X){return this._addCheck({kind:"startsWith",value:$,...f.errToObj(X)})}endsWith($,X){return this._addCheck({kind:"endsWith",value:$,...f.errToObj(X)})}min($,X){return this._addCheck({kind:"min",value:$,...f.errToObj(X)})}max($,X){return this._addCheck({kind:"max",value:$,...f.errToObj(X)})}length($,X){return this._addCheck({kind:"length",value:$,...f.errToObj(X)})}nonempty($){return this.min(1,f.errToObj($))}trim(){return new n$({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n$({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n$({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxLength(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}}n$.create=($)=>{return new n$({checks:[],typeName:h.ZodString,coerce:$?.coerce??!1,...m($)})};function Yw($,X){let J=($.toString().split(".")[1]||"").length,Q=(X.toString().split(".")[1]||"").length,q=J>Q?J:Q,Y=Number.parseInt($.toFixed(q).replace(".","")),z=Number.parseInt(X.toFixed(q).replace(".",""));return Y%z/10**q}class d0 extends c{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==F.number){let q=this._getOrReturnCtx($);return T(q,{code:R.invalid_type,expected:F.number,received:q.parsedType}),v}let J=void 0,Q=new F$;for(let q of this._def.checks)if(q.kind==="int"){if(!d.isInteger($.data))J=this._getOrReturnCtx($,J),T(J,{code:R.invalid_type,expected:"integer",received:"float",message:q.message}),Q.dirty()}else if(q.kind==="min"){if(q.inclusive?$.data<q.value:$.data<=q.value)J=this._getOrReturnCtx($,J),T(J,{code:R.too_small,minimum:q.value,type:"number",inclusive:q.inclusive,exact:!1,message:q.message}),Q.dirty()}else if(q.kind==="max"){if(q.inclusive?$.data>q.value:$.data>=q.value)J=this._getOrReturnCtx($,J),T(J,{code:R.too_big,maximum:q.value,type:"number",inclusive:q.inclusive,exact:!1,message:q.message}),Q.dirty()}else if(q.kind==="multipleOf"){if(Yw($.data,q.value)!==0)J=this._getOrReturnCtx($,J),T(J,{code:R.not_multiple_of,multipleOf:q.value,message:q.message}),Q.dirty()}else if(q.kind==="finite"){if(!Number.isFinite($.data))J=this._getOrReturnCtx($,J),T(J,{code:R.not_finite,message:q.message}),Q.dirty()}else d.assertNever(q);return{status:Q.value,value:$.data}}gte($,X){return this.setLimit("min",$,!0,f.toString(X))}gt($,X){return this.setLimit("min",$,!1,f.toString(X))}lte($,X){return this.setLimit("max",$,!0,f.toString(X))}lt($,X){return this.setLimit("max",$,!1,f.toString(X))}setLimit($,X,J,Q){return new d0({...this._def,checks:[...this._def.checks,{kind:$,value:X,inclusive:J,message:f.toString(Q)}]})}_addCheck($){return new d0({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:f.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f.toString($)})}multipleOf($,X){return this._addCheck({kind:"multipleOf",value:$,message:f.toString(X)})}finite($){return this._addCheck({kind:"finite",message:f.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f.toString($)})}get minValue(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxValue(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&d.isInteger($.value))}get isFinite(){let $=null,X=null;for(let J of this._def.checks)if(J.kind==="finite"||J.kind==="int"||J.kind==="multipleOf")return!0;else if(J.kind==="min"){if(X===null||J.value>X)X=J.value}else if(J.kind==="max"){if($===null||J.value<$)$=J.value}return Number.isFinite(X)&&Number.isFinite($)}}d0.create=($)=>{return new d0({checks:[],typeName:h.ZodNumber,coerce:$?.coerce||!1,...m($)})};class i0 extends c{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==F.bigint)return this._getInvalidInput($);let J=void 0,Q=new F$;for(let q of this._def.checks)if(q.kind==="min"){if(q.inclusive?$.data<q.value:$.data<=q.value)J=this._getOrReturnCtx($,J),T(J,{code:R.too_small,type:"bigint",minimum:q.value,inclusive:q.inclusive,message:q.message}),Q.dirty()}else if(q.kind==="max"){if(q.inclusive?$.data>q.value:$.data>=q.value)J=this._getOrReturnCtx($,J),T(J,{code:R.too_big,type:"bigint",maximum:q.value,inclusive:q.inclusive,message:q.message}),Q.dirty()}else if(q.kind==="multipleOf"){if($.data%q.value!==BigInt(0))J=this._getOrReturnCtx($,J),T(J,{code:R.not_multiple_of,multipleOf:q.value,message:q.message}),Q.dirty()}else d.assertNever(q);return{status:Q.value,value:$.data}}_getInvalidInput($){let X=this._getOrReturnCtx($);return T(X,{code:R.invalid_type,expected:F.bigint,received:X.parsedType}),v}gte($,X){return this.setLimit("min",$,!0,f.toString(X))}gt($,X){return this.setLimit("min",$,!1,f.toString(X))}lte($,X){return this.setLimit("max",$,!0,f.toString(X))}lt($,X){return this.setLimit("max",$,!1,f.toString(X))}setLimit($,X,J,Q){return new i0({...this._def,checks:[...this._def.checks,{kind:$,value:X,inclusive:J,message:f.toString(Q)}]})}_addCheck($){return new i0({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f.toString($)})}multipleOf($,X){return this._addCheck({kind:"multipleOf",value:$,message:f.toString(X)})}get minValue(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxValue(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}}i0.create=($)=>{return new i0({checks:[],typeName:h.ZodBigInt,coerce:$?.coerce??!1,...m($)})};class W6 extends c{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==F.boolean){let J=this._getOrReturnCtx($);return T(J,{code:R.invalid_type,expected:F.boolean,received:J.parsedType}),v}return I$($.data)}}W6.create=($)=>{return new W6({typeName:h.ZodBoolean,coerce:$?.coerce||!1,...m($)})};class K8 extends c{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==F.date){let q=this._getOrReturnCtx($);return T(q,{code:R.invalid_type,expected:F.date,received:q.parsedType}),v}if(Number.isNaN($.data.getTime())){let q=this._getOrReturnCtx($);return T(q,{code:R.invalid_date}),v}let J=new F$,Q=void 0;for(let q of this._def.checks)if(q.kind==="min"){if($.data.getTime()<q.value)Q=this._getOrReturnCtx($,Q),T(Q,{code:R.too_small,message:q.message,inclusive:!0,exact:!1,minimum:q.value,type:"date"}),J.dirty()}else if(q.kind==="max"){if($.data.getTime()>q.value)Q=this._getOrReturnCtx($,Q),T(Q,{code:R.too_big,message:q.message,inclusive:!0,exact:!1,maximum:q.value,type:"date"}),J.dirty()}else d.assertNever(q);return{status:J.value,value:new Date($.data.getTime())}}_addCheck($){return new K8({...this._def,checks:[...this._def.checks,$]})}min($,X){return this._addCheck({kind:"min",value:$.getTime(),message:f.toString(X)})}max($,X){return this._addCheck({kind:"max",value:$.getTime(),message:f.toString(X)})}get minDate(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $!=null?new Date($):null}}K8.create=($)=>{return new K8({checks:[],coerce:$?.coerce||!1,typeName:h.ZodDate,...m($)})};class g2 extends c{_parse($){if(this._getType($)!==F.symbol){let J=this._getOrReturnCtx($);return T(J,{code:R.invalid_type,expected:F.symbol,received:J.parsedType}),v}return I$($.data)}}g2.create=($)=>{return new g2({typeName:h.ZodSymbol,...m($)})};class H6 extends c{_parse($){if(this._getType($)!==F.undefined){let J=this._getOrReturnCtx($);return T(J,{code:R.invalid_type,expected:F.undefined,received:J.parsedType}),v}return I$($.data)}}H6.create=($)=>{return new H6({typeName:h.ZodUndefined,...m($)})};class U6 extends c{_parse($){if(this._getType($)!==F.null){let J=this._getOrReturnCtx($);return T(J,{code:R.invalid_type,expected:F.null,received:J.parsedType}),v}return I$($.data)}}U6.create=($)=>{return new U6({typeName:h.ZodNull,...m($)})};class M8 extends c{constructor(){super(...arguments);this._any=!0}_parse($){return I$($.data)}}M8.create=($)=>{return new M8({typeName:h.ZodAny,...m($)})};class p0 extends c{constructor(){super(...arguments);this._unknown=!0}_parse($){return I$($.data)}}p0.create=($)=>{return new p0({typeName:h.ZodUnknown,...m($)})};class G0 extends c{_parse($){let X=this._getOrReturnCtx($);return T(X,{code:R.invalid_type,expected:F.never,received:X.parsedType}),v}}G0.create=($)=>{return new G0({typeName:h.ZodNever,...m($)})};class v2 extends c{_parse($){if(this._getType($)!==F.undefined){let J=this._getOrReturnCtx($);return T(J,{code:R.invalid_type,expected:F.void,received:J.parsedType}),v}return I$($.data)}}v2.create=($)=>{return new v2({typeName:h.ZodVoid,...m($)})};class r$ extends c{_parse($){let{ctx:X,status:J}=this._processInputParams($),Q=this._def;if(X.parsedType!==F.array)return T(X,{code:R.invalid_type,expected:F.array,received:X.parsedType}),v;if(Q.exactLength!==null){let Y=X.data.length>Q.exactLength.value,z=X.data.length<Q.exactLength.value;if(Y||z)T(X,{code:Y?R.too_big:R.too_small,minimum:z?Q.exactLength.value:void 0,maximum:Y?Q.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Q.exactLength.message}),J.dirty()}if(Q.minLength!==null){if(X.data.length<Q.minLength.value)T(X,{code:R.too_small,minimum:Q.minLength.value,type:"array",inclusive:!0,exact:!1,message:Q.minLength.message}),J.dirty()}if(Q.maxLength!==null){if(X.data.length>Q.maxLength.value)T(X,{code:R.too_big,maximum:Q.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Q.maxLength.message}),J.dirty()}if(X.common.async)return Promise.all([...X.data].map((Y,z)=>{return Q.type._parseAsync(new a$(X,Y,X.path,z))})).then((Y)=>{return F$.mergeArray(J,Y)});let q=[...X.data].map((Y,z)=>{return Q.type._parseSync(new a$(X,Y,X.path,z))});return F$.mergeArray(J,q)}get element(){return this._def.type}min($,X){return new r$({...this._def,minLength:{value:$,message:f.toString(X)}})}max($,X){return new r$({...this._def,maxLength:{value:$,message:f.toString(X)}})}length($,X){return new r$({...this._def,exactLength:{value:$,message:f.toString(X)}})}nonempty($){return this.min(1,$)}}r$.create=($,X)=>{return new r$({type:$,minLength:null,maxLength:null,exactLength:null,typeName:h.ZodArray,...m(X)})};function z6($){if($ instanceof z$){let X={};for(let J in $.shape){let Q=$.shape[J];X[J]=s$.create(z6(Q))}return new z$({...$._def,shape:()=>X})}else if($ instanceof r$)return new r$({...$._def,type:z6($.element)});else if($ instanceof s$)return s$.create(z6($.unwrap()));else if($ instanceof A0)return A0.create(z6($.unwrap()));else if($ instanceof W0)return W0.create($.items.map((X)=>z6(X)));else return $}class z$ extends c{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),X=d.objectKeys($);return this._cached={shape:$,keys:X},this._cached}_parse($){if(this._getType($)!==F.object){let W=this._getOrReturnCtx($);return T(W,{code:R.invalid_type,expected:F.object,received:W.parsedType}),v}let{status:J,ctx:Q}=this._processInputParams($),{shape:q,keys:Y}=this._getCached(),z=[];if(!(this._def.catchall instanceof G0&&this._def.unknownKeys==="strip")){for(let W in Q.data)if(!Y.includes(W))z.push(W)}let G=[];for(let W of Y){let H=q[W],U=Q.data[W];G.push({key:{status:"valid",value:W},value:H._parse(new a$(Q,U,Q.path,W)),alwaysSet:W in Q.data})}if(this._def.catchall instanceof G0){let W=this._def.unknownKeys;if(W==="passthrough")for(let H of z)G.push({key:{status:"valid",value:H},value:{status:"valid",value:Q.data[H]}});else if(W==="strict"){if(z.length>0)T(Q,{code:R.unrecognized_keys,keys:z}),J.dirty()}else if(W==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let W=this._def.catchall;for(let H of z){let U=Q.data[H];G.push({key:{status:"valid",value:H},value:W._parse(new a$(Q,U,Q.path,H)),alwaysSet:H in Q.data})}}if(Q.common.async)return Promise.resolve().then(async()=>{let W=[];for(let H of G){let U=await H.key,V=await H.value;W.push({key:U,value:V,alwaysSet:H.alwaysSet})}return W}).then((W)=>{return F$.mergeObjectSync(J,W)});else return F$.mergeObjectSync(J,G)}get shape(){return this._def.shape()}strict($){return f.errToObj,new z$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(X,J)=>{let Q=this._def.errorMap?.(X,J).message??J.defaultError;if(X.code==="unrecognized_keys")return{message:f.errToObj($).message??Q};return{message:Q}}}:{}})}strip(){return new z$({...this._def,unknownKeys:"strip"})}passthrough(){return new z$({...this._def,unknownKeys:"passthrough"})}extend($){return new z$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new z$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:h.ZodObject})}setKey($,X){return this.augment({[$]:X})}catchall($){return new z$({...this._def,catchall:$})}pick($){let X={};for(let J of d.objectKeys($))if($[J]&&this.shape[J])X[J]=this.shape[J];return new z$({...this._def,shape:()=>X})}omit($){let X={};for(let J of d.objectKeys(this.shape))if(!$[J])X[J]=this.shape[J];return new z$({...this._def,shape:()=>X})}deepPartial(){return z6(this)}partial($){let X={};for(let J of d.objectKeys(this.shape)){let Q=this.shape[J];if($&&!$[J])X[J]=Q;else X[J]=Q.optional()}return new z$({...this._def,shape:()=>X})}required($){let X={};for(let J of d.objectKeys(this.shape))if($&&!$[J])X[J]=this.shape[J];else{let q=this.shape[J];while(q instanceof s$)q=q._def.innerType;X[J]=q}return new z$({...this._def,shape:()=>X})}keyof(){return sY(d.objectKeys(this.shape))}}z$.create=($,X)=>{return new z$({shape:()=>$,unknownKeys:"strip",catchall:G0.create(),typeName:h.ZodObject,...m(X)})};z$.strictCreate=($,X)=>{return new z$({shape:()=>$,unknownKeys:"strict",catchall:G0.create(),typeName:h.ZodObject,...m(X)})};z$.lazycreate=($,X)=>{return new z$({shape:$,unknownKeys:"strip",catchall:G0.create(),typeName:h.ZodObject,...m(X)})};class V6 extends c{_parse($){let{ctx:X}=this._processInputParams($),J=this._def.options;function Q(q){for(let z of q)if(z.result.status==="valid")return z.result;for(let z of q)if(z.result.status==="dirty")return X.common.issues.push(...z.ctx.common.issues),z.result;let Y=q.map((z)=>new Z$(z.ctx.common.issues));return T(X,{code:R.invalid_union,unionErrors:Y}),v}if(X.common.async)return Promise.all(J.map(async(q)=>{let Y={...X,common:{...X.common,issues:[]},parent:null};return{result:await q._parseAsync({data:X.data,path:X.path,parent:Y}),ctx:Y}})).then(Q);else{let q=void 0,Y=[];for(let G of J){let W={...X,common:{...X.common,issues:[]},parent:null},H=G._parseSync({data:X.data,path:X.path,parent:W});if(H.status==="valid")return H;else if(H.status==="dirty"&&!q)q={result:H,ctx:W};if(W.common.issues.length)Y.push(W.common.issues)}if(q)return X.common.issues.push(...q.ctx.common.issues),q.result;let z=Y.map((G)=>new Z$(G));return T(X,{code:R.invalid_union,unionErrors:z}),v}}get options(){return this._def.options}}V6.create=($,X)=>{return new V6({options:$,typeName:h.ZodUnion,...m(X)})};var R0=($)=>{if($ instanceof K6)return R0($.schema);else if($ instanceof o$)return R0($.innerType());else if($ instanceof M6)return[$.value];else if($ instanceof n0)return $.options;else if($ instanceof N6)return d.objectValues($.enum);else if($ instanceof D6)return R0($._def.innerType);else if($ instanceof H6)return[void 0];else if($ instanceof U6)return[null];else if($ instanceof s$)return[void 0,...R0($.unwrap())];else if($ instanceof A0)return[null,...R0($.unwrap())];else if($ instanceof IX)return R0($.unwrap());else if($ instanceof w6)return R0($.unwrap());else if($ instanceof O6)return R0($._def.innerType);else return[]};class FX extends c{_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==F.object)return T(X,{code:R.invalid_type,expected:F.object,received:X.parsedType}),v;let J=this.discriminator,Q=X.data[J],q=this.optionsMap.get(Q);if(!q)return T(X,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[J]}),v;if(X.common.async)return q._parseAsync({data:X.data,path:X.path,parent:X});else return q._parseSync({data:X.data,path:X.path,parent:X})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,X,J){let Q=new Map;for(let q of X){let Y=R0(q.shape[$]);if(!Y.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let z of Y){if(Q.has(z))throw Error(`Discriminator property ${String($)} has duplicate value ${String(z)}`);Q.set(z,q)}}return new FX({typeName:h.ZodDiscriminatedUnion,discriminator:$,options:X,optionsMap:Q,...m(J)})}}function S9($,X){let J=z0($),Q=z0(X);if($===X)return{valid:!0,data:$};else if(J===F.object&&Q===F.object){let q=d.objectKeys(X),Y=d.objectKeys($).filter((G)=>q.indexOf(G)!==-1),z={...$,...X};for(let G of Y){let W=S9($[G],X[G]);if(!W.valid)return{valid:!1};z[G]=W.data}return{valid:!0,data:z}}else if(J===F.array&&Q===F.array){if($.length!==X.length)return{valid:!1};let q=[];for(let Y=0;Y<$.length;Y++){let z=$[Y],G=X[Y],W=S9(z,G);if(!W.valid)return{valid:!1};q.push(W.data)}return{valid:!0,data:q}}else if(J===F.date&&Q===F.date&&+$===+X)return{valid:!0,data:$};else return{valid:!1}}class B6 extends c{_parse($){let{status:X,ctx:J}=this._processInputParams($),Q=(q,Y)=>{if(AX(q)||AX(Y))return v;let z=S9(q.value,Y.value);if(!z.valid)return T(J,{code:R.invalid_intersection_types}),v;if(_X(q)||_X(Y))X.dirty();return{status:X.value,value:z.data}};if(J.common.async)return Promise.all([this._def.left._parseAsync({data:J.data,path:J.path,parent:J}),this._def.right._parseAsync({data:J.data,path:J.path,parent:J})]).then(([q,Y])=>Q(q,Y));else return Q(this._def.left._parseSync({data:J.data,path:J.path,parent:J}),this._def.right._parseSync({data:J.data,path:J.path,parent:J}))}}B6.create=($,X,J)=>{return new B6({left:$,right:X,typeName:h.ZodIntersection,...m(J)})};class W0 extends c{_parse($){let{status:X,ctx:J}=this._processInputParams($);if(J.parsedType!==F.array)return T(J,{code:R.invalid_type,expected:F.array,received:J.parsedType}),v;if(J.data.length<this._def.items.length)return T(J,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v;if(!this._def.rest&&J.data.length>this._def.items.length)T(J,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X.dirty();let q=[...J.data].map((Y,z)=>{let G=this._def.items[z]||this._def.rest;if(!G)return null;return G._parse(new a$(J,Y,J.path,z))}).filter((Y)=>!!Y);if(J.common.async)return Promise.all(q).then((Y)=>{return F$.mergeArray(X,Y)});else return F$.mergeArray(X,q)}get items(){return this._def.items}rest($){return new W0({...this._def,rest:$})}}W0.create=($,X)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new W0({items:$,typeName:h.ZodTuple,rest:null,...m(X)})};class h2 extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:X,ctx:J}=this._processInputParams($);if(J.parsedType!==F.object)return T(J,{code:R.invalid_type,expected:F.object,received:J.parsedType}),v;let Q=[],q=this._def.keyType,Y=this._def.valueType;for(let z in J.data)Q.push({key:q._parse(new a$(J,z,J.path,z)),value:Y._parse(new a$(J,J.data[z],J.path,z)),alwaysSet:z in J.data});if(J.common.async)return F$.mergeObjectAsync(X,Q);else return F$.mergeObjectSync(X,Q)}get element(){return this._def.valueType}static create($,X,J){if(X instanceof c)return new h2({keyType:$,valueType:X,typeName:h.ZodRecord,...m(J)});return new h2({keyType:n$.create(),valueType:$,typeName:h.ZodRecord,...m(X)})}}class u2 extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:X,ctx:J}=this._processInputParams($);if(J.parsedType!==F.map)return T(J,{code:R.invalid_type,expected:F.map,received:J.parsedType}),v;let Q=this._def.keyType,q=this._def.valueType,Y=[...J.data.entries()].map(([z,G],W)=>{return{key:Q._parse(new a$(J,z,J.path,[W,"key"])),value:q._parse(new a$(J,G,J.path,[W,"value"]))}});if(J.common.async){let z=new Map;return Promise.resolve().then(async()=>{for(let G of Y){let W=await G.key,H=await G.value;if(W.status==="aborted"||H.status==="aborted")return v;if(W.status==="dirty"||H.status==="dirty")X.dirty();z.set(W.value,H.value)}return{status:X.value,value:z}})}else{let z=new Map;for(let G of Y){let{key:W,value:H}=G;if(W.status==="aborted"||H.status==="aborted")return v;if(W.status==="dirty"||H.status==="dirty")X.dirty();z.set(W.value,H.value)}return{status:X.value,value:z}}}}u2.create=($,X,J)=>{return new u2({valueType:X,keyType:$,typeName:h.ZodMap,...m(J)})};class N8 extends c{_parse($){let{status:X,ctx:J}=this._processInputParams($);if(J.parsedType!==F.set)return T(J,{code:R.invalid_type,expected:F.set,received:J.parsedType}),v;let Q=this._def;if(Q.minSize!==null){if(J.data.size<Q.minSize.value)T(J,{code:R.too_small,minimum:Q.minSize.value,type:"set",inclusive:!0,exact:!1,message:Q.minSize.message}),X.dirty()}if(Q.maxSize!==null){if(J.data.size>Q.maxSize.value)T(J,{code:R.too_big,maximum:Q.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Q.maxSize.message}),X.dirty()}let q=this._def.valueType;function Y(G){let W=new Set;for(let H of G){if(H.status==="aborted")return v;if(H.status==="dirty")X.dirty();W.add(H.value)}return{status:X.value,value:W}}let z=[...J.data.values()].map((G,W)=>q._parse(new a$(J,G,J.path,W)));if(J.common.async)return Promise.all(z).then((G)=>Y(G));else return Y(z)}min($,X){return new N8({...this._def,minSize:{value:$,message:f.toString(X)}})}max($,X){return new N8({...this._def,maxSize:{value:$,message:f.toString(X)}})}size($,X){return this.min($,X).max($,X)}nonempty($){return this.min(1,$)}}N8.create=($,X)=>{return new N8({valueType:$,minSize:null,maxSize:null,typeName:h.ZodSet,...m(X)})};class G6 extends c{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==F.function)return T(X,{code:R.invalid_type,expected:F.function,received:X.parsedType}),v;function J(z,G){return y2({data:z,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,q6(),L0].filter((W)=>!!W),issueData:{code:R.invalid_arguments,argumentsError:G}})}function Q(z,G){return y2({data:z,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,q6(),L0].filter((W)=>!!W),issueData:{code:R.invalid_return_type,returnTypeError:G}})}let q={errorMap:X.common.contextualErrorMap},Y=X.data;if(this._def.returns instanceof D8){let z=this;return I$(async function(...G){let W=new Z$([]),H=await z._def.args.parseAsync(G,q).catch((B)=>{throw W.addIssue(J(G,B)),W}),U=await Reflect.apply(Y,this,H);return await z._def.returns._def.type.parseAsync(U,q).catch((B)=>{throw W.addIssue(Q(U,B)),W})})}else{let z=this;return I$(function(...G){let W=z._def.args.safeParse(G,q);if(!W.success)throw new Z$([J(G,W.error)]);let H=Reflect.apply(Y,this,W.data),U=z._def.returns.safeParse(H,q);if(!U.success)throw new Z$([Q(H,U.error)]);return U.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new G6({...this._def,args:W0.create($).rest(p0.create())})}returns($){return new G6({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,X,J){return new G6({args:$?$:W0.create([]).rest(p0.create()),returns:X||p0.create(),typeName:h.ZodFunction,...m(J)})}}class K6 extends c{get schema(){return this._def.getter()}_parse($){let{ctx:X}=this._processInputParams($);return this._def.getter()._parse({data:X.data,path:X.path,parent:X})}}K6.create=($,X)=>{return new K6({getter:$,typeName:h.ZodLazy,...m(X)})};class M6 extends c{_parse($){if($.data!==this._def.value){let X=this._getOrReturnCtx($);return T(X,{received:X.data,code:R.invalid_literal,expected:this._def.value}),v}return{status:"valid",value:$.data}}get value(){return this._def.value}}M6.create=($,X)=>{return new M6({value:$,typeName:h.ZodLiteral,...m(X)})};function sY($,X){return new n0({values:$,typeName:h.ZodEnum,...m(X)})}class n0 extends c{_parse($){if(typeof $.data!=="string"){let X=this._getOrReturnCtx($),J=this._def.values;return T(X,{expected:d.joinValues(J),received:X.parsedType,code:R.invalid_type}),v}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let X=this._getOrReturnCtx($),J=this._def.values;return T(X,{received:X.data,code:R.invalid_enum_value,options:J}),v}return I$($.data)}get options(){return this._def.values}get enum(){let $={};for(let X of this._def.values)$[X]=X;return $}get Values(){let $={};for(let X of this._def.values)$[X]=X;return $}get Enum(){let $={};for(let X of this._def.values)$[X]=X;return $}extract($,X=this._def){return n0.create($,{...this._def,...X})}exclude($,X=this._def){return n0.create(this.options.filter((J)=>!$.includes(J)),{...this._def,...X})}}n0.create=sY;class N6 extends c{_parse($){let X=d.getValidEnumValues(this._def.values),J=this._getOrReturnCtx($);if(J.parsedType!==F.string&&J.parsedType!==F.number){let Q=d.objectValues(X);return T(J,{expected:d.joinValues(Q),received:J.parsedType,code:R.invalid_type}),v}if(!this._cache)this._cache=new Set(d.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let Q=d.objectValues(X);return T(J,{received:J.data,code:R.invalid_enum_value,options:Q}),v}return I$($.data)}get enum(){return this._def.values}}N6.create=($,X)=>{return new N6({values:$,typeName:h.ZodNativeEnum,...m(X)})};class D8 extends c{unwrap(){return this._def.type}_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==F.promise&&X.common.async===!1)return T(X,{code:R.invalid_type,expected:F.promise,received:X.parsedType}),v;let J=X.parsedType===F.promise?X.data:Promise.resolve(X.data);return I$(J.then((Q)=>{return this._def.type.parseAsync(Q,{path:X.path,errorMap:X.common.contextualErrorMap})}))}}D8.create=($,X)=>{return new D8({type:$,typeName:h.ZodPromise,...m(X)})};class o$ extends c{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===h.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:X,ctx:J}=this._processInputParams($),Q=this._def.effect||null,q={addIssue:(Y)=>{if(T(J,Y),Y.fatal)X.abort();else X.dirty()},get path(){return J.path}};if(q.addIssue=q.addIssue.bind(q),Q.type==="preprocess"){let Y=Q.transform(J.data,q);if(J.common.async)return Promise.resolve(Y).then(async(z)=>{if(X.value==="aborted")return v;let G=await this._def.schema._parseAsync({data:z,path:J.path,parent:J});if(G.status==="aborted")return v;if(G.status==="dirty")return B8(G.value);if(X.value==="dirty")return B8(G.value);return G});else{if(X.value==="aborted")return v;let z=this._def.schema._parseSync({data:Y,path:J.path,parent:J});if(z.status==="aborted")return v;if(z.status==="dirty")return B8(z.value);if(X.value==="dirty")return B8(z.value);return z}}if(Q.type==="refinement"){let Y=(z)=>{let G=Q.refinement(z,q);if(J.common.async)return Promise.resolve(G);if(G instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return z};if(J.common.async===!1){let z=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(z.status==="aborted")return v;if(z.status==="dirty")X.dirty();return Y(z.value),{status:X.value,value:z.value}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then((z)=>{if(z.status==="aborted")return v;if(z.status==="dirty")X.dirty();return Y(z.value).then(()=>{return{status:X.value,value:z.value}})})}if(Q.type==="transform")if(J.common.async===!1){let Y=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(!c0(Y))return v;let z=Q.transform(Y.value,q);if(z instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:X.value,value:z}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then((Y)=>{if(!c0(Y))return v;return Promise.resolve(Q.transform(Y.value,q)).then((z)=>({status:X.value,value:z}))});d.assertNever(Q)}}o$.create=($,X,J)=>{return new o$({schema:$,typeName:h.ZodEffects,effect:X,...m(J)})};o$.createWithPreprocess=($,X,J)=>{return new o$({schema:X,effect:{type:"preprocess",transform:$},typeName:h.ZodEffects,...m(J)})};class s$ extends c{_parse($){if(this._getType($)===F.undefined)return I$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}s$.create=($,X)=>{return new s$({innerType:$,typeName:h.ZodOptional,...m(X)})};class A0 extends c{_parse($){if(this._getType($)===F.null)return I$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}A0.create=($,X)=>{return new A0({innerType:$,typeName:h.ZodNullable,...m(X)})};class D6 extends c{_parse($){let{ctx:X}=this._processInputParams($),J=X.data;if(X.parsedType===F.undefined)J=this._def.defaultValue();return this._def.innerType._parse({data:J,path:X.path,parent:X})}removeDefault(){return this._def.innerType}}D6.create=($,X)=>{return new D6({innerType:$,typeName:h.ZodDefault,defaultValue:typeof X.default==="function"?X.default:()=>X.default,...m(X)})};class O6 extends c{_parse($){let{ctx:X}=this._processInputParams($),J={...X,common:{...X.common,issues:[]}},Q=this._def.innerType._parse({data:J.data,path:J.path,parent:{...J}});if(Y6(Q))return Q.then((q)=>{return{status:"valid",value:q.status==="valid"?q.value:this._def.catchValue({get error(){return new Z$(J.common.issues)},input:J.data})}});else return{status:"valid",value:Q.status==="valid"?Q.value:this._def.catchValue({get error(){return new Z$(J.common.issues)},input:J.data})}}removeCatch(){return this._def.innerType}}O6.create=($,X)=>{return new O6({innerType:$,typeName:h.ZodCatch,catchValue:typeof X.catch==="function"?X.catch:()=>X.catch,...m(X)})};class m2 extends c{_parse($){if(this._getType($)!==F.nan){let J=this._getOrReturnCtx($);return T(J,{code:R.invalid_type,expected:F.nan,received:J.parsedType}),v}return{status:"valid",value:$.data}}}m2.create=($)=>{return new m2({typeName:h.ZodNaN,...m($)})};var zw=Symbol("zod_brand");class IX extends c{_parse($){let{ctx:X}=this._processInputParams($),J=X.data;return this._def.type._parse({data:J,path:X.path,parent:X})}unwrap(){return this._def.type}}class l2 extends c{_parse($){let{status:X,ctx:J}=this._processInputParams($);if(J.common.async)return(async()=>{let q=await this._def.in._parseAsync({data:J.data,path:J.path,parent:J});if(q.status==="aborted")return v;if(q.status==="dirty")return X.dirty(),B8(q.value);else return this._def.out._parseAsync({data:q.value,path:J.path,parent:J})})();else{let Q=this._def.in._parseSync({data:J.data,path:J.path,parent:J});if(Q.status==="aborted")return v;if(Q.status==="dirty")return X.dirty(),{status:"dirty",value:Q.value};else return this._def.out._parseSync({data:Q.value,path:J.path,parent:J})}}static create($,X){return new l2({in:$,out:X,typeName:h.ZodPipeline})}}class w6 extends c{_parse($){let X=this._def.innerType._parse($),J=(Q)=>{if(c0(Q))Q.value=Object.freeze(Q.value);return Q};return Y6(X)?X.then((Q)=>J(Q)):J(X)}unwrap(){return this._def.innerType}}w6.create=($,X)=>{return new w6({innerType:$,typeName:h.ZodReadonly,...m(X)})};function dY($,X){let J=typeof $==="function"?$(X):typeof $==="string"?{message:$}:$;return typeof J==="string"?{message:J}:J}function aY($,X={},J){if($)return M8.create().superRefine((Q,q)=>{let Y=$(Q);if(Y instanceof Promise)return Y.then((z)=>{if(!z){let G=dY(X,Q),W=G.fatal??J??!0;q.addIssue({code:"custom",...G,fatal:W})}});if(!Y){let z=dY(X,Q),G=z.fatal??J??!0;q.addIssue({code:"custom",...z,fatal:G})}return});return M8.create()}var Gw={object:z$.lazycreate},h;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(h||(h={}));var Ww=($,X={message:`Input not instance of ${$.name}`})=>aY((J)=>J instanceof $,X),oY=n$.create,tY=d0.create,Hw=m2.create,Uw=i0.create,eY=W6.create,Vw=K8.create,Bw=g2.create,Kw=H6.create,Mw=U6.create,Nw=M8.create,Dw=p0.create,Ow=G0.create,ww=v2.create,Lw=r$.create,Rw=z$.create,Aw=z$.strictCreate,_w=V6.create,Fw=FX.create,Iw=B6.create,Ew=W0.create,Tw=h2.create,Zw=u2.create,Sw=N8.create,jw=G6.create,Cw=K6.create,Pw=M6.create,bw=n0.create,fw=N6.create,kw=D8.create,xw=o$.create,yw=s$.create,gw=A0.create,vw=o$.createWithPreprocess,hw=l2.create,uw=()=>oY().optional(),mw=()=>tY().optional(),lw=()=>eY().optional(),cw={string:($)=>n$.create({...$,coerce:!0}),number:($)=>d0.create({...$,coerce:!0}),boolean:($)=>W6.create({...$,coerce:!0}),bigint:($)=>i0.create({...$,coerce:!0}),date:($)=>K8.create({...$,coerce:!0})};var pw=v;var dw=A$.object({file:A$.string().optional().describe("Path to .faf file to score (defaults to project.faf)"),verbose:A$.boolean().optional().default(!1).describe("Show detailed slot breakdown"),status:A$.boolean().optional().default(!1).describe("Compact one-liner output"),json:A$.boolean().optional().default(!1).describe("Output as JSON")});class j9 extends V8{name="faf_score";description="Score AI-readiness of .faf file (0-100%)";permission="plan";risk="safe";schema=dw;tags=["faf","ai-context","scoring","read-only"];async execute($,X){let J=Date.now();try{let Q="",q=null,Y=console.log,z=console.error;console.log=(...L)=>{Q+=L.join(" ")+`
397
- `},console.error=(...L)=>{Q+=L.join(" ")+`
398
- `};try{await n6($.file,{verbose:$.verbose,status:$.status,json:$.json})}finally{console.log=Y,console.error=z}let G=Q.match(/(\d+)%/),W=Q.match(/(RED|YELLOW|GREEN|SILVER|GOLD|TROPHY)/),H=Q.match(/(\d+)\/(\d+) slots/),U=G?parseInt(G[1]):0,V=W?W[1]:"UNKNOWN",B=H?parseInt(H[1]):0,D=H?parseInt(H[2]):0,w=[],M=[];if($.verbose&&Q.includes("empty")){let L=Q.split(`
399
- `);for(let I of L)if(I.includes("empty")&&I.includes("○")){let Z=I.match(/([a-z_]+\.[a-z_]+)/);if(Z)w.push(Z[1])}}let N={score:U,tier:V,populated:B,total:D,empty:w,ignored:M,file:$.file||"project.faf"};if($.json)N.raw=q;if(X.telemetry)console.log(`[MCP] faf_score executed in ${Date.now()-J}ms`);return N}catch(Q){throw Error(`Failed to score FAF file: ${Q instanceof Error?Q.message:String(Q)}`)}}canExecute($){return!0}}import{existsSync as $3}from"fs";import{join as X3}from"path";var iw=A$.object({yolo:A$.boolean().optional().default(!1).describe("Quick init with sensible defaults"),quick:A$.boolean().optional().default(!1).describe("Alias for --yolo"),force:A$.boolean().optional().default(!1).describe("Overwrite existing project.faf"),output:A$.string().optional().describe("Output path for generated .faf file")});class C9 extends V8{name="faf_init";description="Initialize .faf file for current project";permission="standard";risk="low";schema=iw;tags=["faf","ai-context","initialization","file-creation"];async execute($,X){let J=Date.now(),Q=$.output||X3(X.workingDirectory,"project.faf"),q=$3(Q);if(q&&!$.force&&!X.dryRun)throw Error(`File ${Q} already exists. Use force: true to overwrite.`);if(X.dryRun)return{created:!1,file:Q,score:0,overwritten:!1};try{let Y="",z=console.log;console.log=(...V)=>{Y+=V.join(" ")+`
400
- `};try{await r6({yolo:$.yolo||$.quick,force:$.force,output:$.output})}finally{console.log=z}let G=Y.includes("created"),W=Y.includes("updated"),H=Y.match(/(\d+)%/),U={created:G||!q,file:Q,score:H?parseInt(H[1]):0,overwritten:q&&$.force};if(Y.includes("TypeScript"))U.detectedLanguage="TypeScript";else if(Y.includes("JavaScript"))U.detectedLanguage="JavaScript";else if(Y.includes("Python"))U.detectedLanguage="Python";if(X.telemetry)console.log(`[MCP] faf_init executed in ${Date.now()-J}ms`);return U}catch(Y){throw Error(`Failed to initialize FAF file: ${Y instanceof Error?Y.message:String(Y)}`)}}canExecute($){if(!super.canExecute($))return!1;let X=X3($.workingDirectory,"project.faf");if($.permissionMode==="plan"&&$3(X))return!1;return!0}}var nw=A$.object({watch:A$.boolean().optional().default(!1).describe("Watch for changes and sync continuously"),direction:A$.enum(["auto","push","pull"]).optional().default("auto").describe("Force sync direction")});class P9 extends V8{name="faf_sync";description="Bi-directional sync between .faf and CLAUDE.md files";permission="auto";risk="low";schema=nw;tags=["faf","ai-context","synchronization","file-modification"];async execute($,X){let J=Date.now();if(X.dryRun)return{synced:!1,direction:"none",files:{faf:"project.faf",claude:"CLAUDE.md"},lastModified:{},changes:[],watchMode:!1};try{let Q="",q=console.log;console.log=(...B)=>{Q+=B.join(" ")+`
401
- `};try{await s6({watch:$.watch,direction:$.direction})}finally{console.log=q}let Y=Q.includes("→ CLAUDE.md"),z=Q.includes("← project.faf"),G=Q.includes("synced")||Q.includes("updated"),W="none";if(Y)W="push";else if(z)W="pull";let H=[],U=Q.split(`
402
- `);for(let B of U)if(B.includes("updated")||B.includes("created")||B.includes("synced"))H.push(B.trim());let V={synced:G,direction:W,files:{faf:"project.faf",claude:"CLAUDE.md"},lastModified:{},changes:H,watchMode:$.watch};if(X.telemetry)console.log(`[MCP] faf_sync executed in ${Date.now()-J}ms`);return V}catch(Q){throw Error(`Failed to sync FAF files: ${Q instanceof Error?Q.message:String(Q)}`)}}canExecute($){if(!super.canExecute($))return!1;if($.permissionMode==="plan")return!1;return!0}}class b9{registry=new E9;config;constructor($){this.config=$,this.initializeTools()}initializeTools(){let $=[new j9,new C9,new P9];for(let X of $)this.registry.register(X)}async listTools(){return this.registry.list().map(($)=>({name:$.name,description:$.description,inputSchema:$.schema,permissions:[$.permission,$.risk],tags:$.tags}))}async callTool($,X){let J=this.registry.get($);if(!J)return{content:[{type:"text",text:`Tool '${$}' not found`}],isError:!0};try{let Q={workingDirectory:this.config.workingDirectory,userId:this.config.userId,sessionId:this.config.sessionId,permissionMode:this.config.permissionMode,dryRun:this.config.dryRun,telemetry:this.config.telemetryEnabled};if(!J.canExecute(Q))return{content:[{type:"text",text:`Tool '${$}' cannot execute with current permissions (${this.config.permissionMode})`}],isError:!0};let q=J.validate(X),Y=await J.execute(q,Q);return{content:[{type:"text",text:JSON.stringify(Y,null,2)}]}}catch(Q){return{content:[{type:"text",text:`Error executing tool '${$}': ${Q instanceof Error?Q.message:String(Q)}`}],isError:!0}}}getToolsByPermission($){return this.registry.listByPermission($)}async getInfo(){let $=this.registry.list(),X=[...new Set($.map((G)=>G.permission))],{readFileSync:J}=await import("fs"),{dirname:Q,join:q}=await import("path"),{fileURLToPath:Y}=await import("url"),z="unknown";try{z=JSON.parse(J(q(Q(Y(import.meta.url)),"../../package.json"),"utf-8")).version}catch{z="dev"}return{name:"claude-faf-mcp",version:z,description:"Foundational AI-Context Format tools for Claude Code",tools:$.length,permissions:X}}async requestPermissionElevation($,X){let J=this.registry.get($);if(!J)return!1;if(J.risk==="safe"&&X<="standard")return!0;return!1}}class f9{static classify($,X={}){if(this.isReadOnly($,X))return{permission:"plan",risk:"safe",reasons:["Read-only operation","No file modifications"],allowAutoApproval:!0,requiresConfirmation:!1};if(this.isSafeConfig($,X))return{permission:"auto",risk:"low",reasons:["Safe configuration change","Limited scope"],allowAutoApproval:!0,requiresConfirmation:!1};if(this.isFileOperation($,X)){let J=X.force||X.overwrite;return{permission:"standard",risk:J?"medium":"low",reasons:["File operation",J?"May overwrite existing files":"Creates new files"],allowAutoApproval:!1,requiresConfirmation:!0}}if(this.isHighRisk($,X))return{permission:"bypass",risk:"high",reasons:["High-risk operation","Requires manual approval"],allowAutoApproval:!1,requiresConfirmation:!0};return{permission:"standard",risk:"medium",reasons:["Unknown operation type","Requires confirmation"],allowAutoApproval:!1,requiresConfirmation:!0}}static isReadOnly($,X){if(["faf_score","faf_info","faf_formats","faf_check","faf_validate"].includes($))return!0;if(X.dryRun||X.validate||X.check)return!0;return!1}static isSafeConfig($,X){if(["faf_sync","faf_export","faf_convert"].includes($))return!0;return!1}static isFileOperation($,X){if(["faf_init","faf_auto","faf_edit","faf_migrate"].includes($))return!0;if(X.output||X.write||X.save)return!0;return!1}static isHighRisk($,X){if(["faf_compile","faf_execute","faf_deploy"].includes($))return!0;if(X.execute||X.deploy||X.publish)return!0;if(X.force&&(X.overwrite||X.delete))return!0;return!1}static getRequiredPermission($,X){let J=$.permission;if(X.hasExistingFiles&&J==="standard")J="auto";if(X.isProduction&&J<"standard")J="standard";return J}static shouldConfirm($,X){if($.requiresConfirmation)return!0;let J=["plan","standard","auto","bypass"],Q=J.indexOf(X),q=J.indexOf($.permission);return Q<q}}class J3{handlers=new Map;register($,X){if(!this.handlers.has($))this.handlers.set($,[]);this.handlers.get($).push(X)}async execute($,X){let J=this.handlers.get($)||[];for(let Q of J){let q=await Q(X);if(q.action==="deny"||q.action==="ask")return q;if(q.action==="defer")continue;if(q.modifiedInput)X.input=q.modifiedInput}return{action:"allow"}}}class c2{static preToolUse=async($)=>{let X=f9.classify($.toolName,$.input),J=["plan","standard","auto","bypass"],Q=J.indexOf(X.permission);if(!(J.indexOf($.context.permissionMode)>=Q))return{action:"deny",reason:`Insufficient permissions. Required: ${X.permission}, Current: ${$.context.permissionMode}`};if(X.risk==="high"&&!$.context.dryRun)return{action:"ask",reason:`High-risk operation detected: ${X.reasons.join(", ")}`};if($.input.force&&$.toolName==="faf_init")return{action:"ask",reason:"This will overwrite existing project.faf file"};return{action:"allow"}};static postEdit=async($)=>{let X=[".ts",".js",".py",".md",".json",".yaml",".toml"],J=$.metadata?.fileName||"";if(!X.some((q)=>J.endsWith(q)))return{action:"allow"};if(J!=="project.faf"&&J!=="CLAUDE.md")try{return{action:"allow",additionalContext:"Triggered auto-sync of project context due to file changes"}}catch(q){return{action:"allow",reason:"Auto-sync failed but continuing"}}return{action:"allow"}};static sessionStart=async($)=>{let X=$.metadata?.hasProjectFaf||!1,J=$.metadata?.hasClaude||!1;if(!X&&!J)return{action:"allow",additionalContext:"No FAF context detected. Run /faf-quickstart to initialize AI-ready project context."};if(X&&J)return{action:"allow",additionalContext:"FAF bi-sync active. Context automatically synchronized between .faf and CLAUDE.md."};return{action:"allow"}};static sessionEnd=async($)=>{if($.metadata?.hasIncompleteInterview)return{action:"allow",additionalContext:'FAF interview state saved. Resume with "faf go --resume"'};return{action:"allow",additionalContext:"FAF session state preserved for next interaction"}}}function Q3(){let $=new J3;return $.register("pre-tool-use",c2.preToolUse),$.register("post-edit",c2.postEdit),$.register("session-start",c2.sessionStart),$.register("session-end",c2.sessionEnd),$}import{existsSync as q3}from"fs";import{join as Y3}from"path";class k9{server;hooks;config;constructor($){if(this.config={workingDirectory:$.workingDirectory,permissionMode:$.permissionMode||"standard",telemetryEnabled:$.telemetryEnabled??!0,sessionId:$.sessionId||this.generateSessionId(),userId:$.userId||"anonymous",dryRun:$.dryRun??!1,enableHooks:$.enableHooks??!0},this.server=new b9({permissionMode:this.config.permissionMode,telemetryEnabled:this.config.telemetryEnabled,workingDirectory:this.config.workingDirectory,sessionId:this.config.sessionId,userId:this.config.userId,dryRun:this.config.dryRun}),this.config.enableHooks)this.hooks=Q3(),this.initializeSession()}getServer(){return this.server}async executeTool($,X){if(this.hooks){let Q=await this.hooks.execute("pre-tool-use",{toolName:$,input:X,context:{workingDirectory:this.config.workingDirectory,permissionMode:this.config.permissionMode,telemetry:this.config.telemetryEnabled,sessionId:this.config.sessionId,userId:this.config.userId,dryRun:this.config.dryRun}});if(Q.action==="deny")throw Error(`Tool execution denied: ${Q.reason}`);if(Q.action==="ask")console.log(`⚠️ Confirmation required: ${Q.reason}`);if(Q.modifiedInput)X=Q.modifiedInput}let J=await this.server.callTool($,X);if(this.hooks&&!J.isError)await this.hooks.execute("post-tool-use",{toolName:$,input:X,context:{workingDirectory:this.config.workingDirectory,permissionMode:this.config.permissionMode,telemetry:this.config.telemetryEnabled,sessionId:this.config.sessionId,userId:this.config.userId,dryRun:this.config.dryRun},metadata:{result:J}});return J}async getAvailableTools(){return(await this.server.listTools()).filter((X)=>{let J=X.permissions[0];return this.hasPermission(J)})}hasPermission($){let X=["plan","standard","auto","bypass"],J=X.indexOf(this.config.permissionMode),Q=X.indexOf($);return J>=Q}async initializeSession(){if(!this.hooks)return;let $=q3(Y3(this.config.workingDirectory,"project.faf")),X=q3(Y3(this.config.workingDirectory,"CLAUDE.md"));await this.hooks.execute("session-start",{toolName:"session_init",input:{},context:{workingDirectory:this.config.workingDirectory,permissionMode:this.config.permissionMode,telemetry:this.config.telemetryEnabled,sessionId:this.config.sessionId,userId:this.config.userId,dryRun:this.config.dryRun},metadata:{hasProjectFaf:$,hasClaude:X}})}async finalizeSession(){if(!this.hooks)return;await this.hooks.execute("session-end",{toolName:"session_end",input:{},context:{workingDirectory:this.config.workingDirectory,permissionMode:this.config.permissionMode,telemetry:this.config.telemetryEnabled,sessionId:this.config.sessionId,userId:this.config.userId,dryRun:this.config.dryRun},metadata:{hasIncompleteInterview:!1}})}generateSessionId(){return`faf_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}async getStatus(){let $=await this.server.getInfo(),X=await this.getAvailableTools();return{server:$,hooks:!!this.hooks,permissions:this.config.permissionMode,tools:X.length,session:this.config.sessionId}}}e();async function z3($={}){let X=process.cwd(),J="standard";if($.permission)switch($.permission.toLowerCase()){case"plan":J="plan";break;case"standard":J="standard";break;case"auto":J="auto";break;case"bypass":J="bypass";break;default:console.log(`${A("!")} Unknown permission level: ${$.permission}`);return}console.log(`${A("◆")} Testing Claude Code MCP Native Integration...`),console.log(`${O(" Working Directory:")} ${X}`),console.log(`${O(" Permission Level:")} ${J}`),console.log("");let Q=new k9({workingDirectory:X,permissionMode:J,dryRun:$.dryRun||!1,enableHooks:$.hooks!==!1,telemetryEnabled:!0});try{if($.status){let q=await Q.getStatus();console.log(`${S("Integration Status:")}`),console.log(` Server: ${q.server.name} v${q.server.version}`),console.log(` Tools Available: ${q.tools}`),console.log(` Hooks Enabled: ${q.hooks?"Yes":"No"}`),console.log(` Permission Mode: ${q.permissions}`),console.log(` Session ID: ${q.session}`),console.log("")}if($.tool){console.log(`${S("Testing Tool:")} ${$.tool}`);let q={};if($.tool==="faf_score")q={verbose:!0};else if($.tool==="faf_init")q={yolo:!0,dryRun:$.dryRun};else if($.tool==="faf_sync")q={direction:"auto"};let Y=await Q.executeTool($.tool,q);if(Y.isError)console.log(`${A("✗")} Error: ${Y.content[0].text}`);else console.log(`${A("✓")} Success:`),console.log(Y.content[0].text);console.log("")}else{let q=await Q.getAvailableTools();console.log(`${S("Available Tools:")}`);for(let Y of q){let z=Y.permissions.join(", "),G=Y.tags.join(", ");console.log(` ${S(Y.name)} - ${Y.description}`),console.log(` ${O("Permissions:")} ${z}`),console.log(` ${O("Tags:")} ${G}`)}console.log("");for(let Y of q.slice(0,2)){console.log(`${A("→")} Testing ${Y.name}...`);try{let z={};if(Y.name==="faf_score")z={status:!0};else if(Y.name==="faf_init")z={yolo:!0,dryRun:!0};else if(Y.name==="faf_sync")z={direction:"auto"};let G=await Q.executeTool(Y.name,z);if(G.isError)console.log(` ${A("✗")} ${G.content[0].text.split("\\n")[0]}`);else console.log(` ${A("✓")} Success`)}catch(z){console.log(` ${A("✗")} ${z instanceof Error?z.message:String(z)}`)}}}await Q.finalizeSession(),console.log(`${A("✓")} MCP integration test completed`),console.log(""),console.log(`${O("Next steps:")}`),console.log(` • Run ${S("faf claude-sync")} to sync with Claude Code skills`),console.log(` • Use ${S("/faf-champion")} skill in Claude Code for guided setup`),console.log(` • Configure ${S("claude.json")} for team-wide MCP integration`)}catch(q){console.error(`${A("✗")} MCP test failed:`,q),process.exit(1)}}import{readFileSync as rw}from"fs";var{version:sw}=JSON.parse(rw(new URL("../package.json",import.meta.url),"utf8")),p=new L8;p.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(sw,"-v, --version");p.command("init").description("Create .faf from your project").option("--yolo","Quick init with sensible defaults").option("--quick","Alias for --yolo").option("--force","Overwrite existing project.faf").option("--output <path>","Output path").action(($)=>r6($));p.command("auto").description("Zero to 100% in one command").action(()=>X7());p.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>jY($));p.command("score [file]").description("Score a .faf file").option("--verbose","Show slot breakdown").option("--status","Compact one-liner output").option("--json","Output as JSON").action(($,X)=>n6($,X));p.command("sync").description(".faf ↔ CLAUDE.md (bi-sync, mtime auto-direction)").option("--watch","Watch for changes").option("--direction <dir>","Force direction: auto|push|pull","auto").action(($)=>s6($));p.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,X)=>l1($,X));p.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,X)=>c1($,X));p.command("git <url>").description("Instant .faf from any GitHub repo").option("--keep","Keep the cloned repo in cwd — enables faf auto to read README, Dockerfile, etc.").action(($,X)=>a1($,X));p.command("export").description("Export context files from .faf").option("--agents","Generate AGENTS.md").option("--cursor","Generate .cursorrules").option("--gemini","Generate GEMINI.md").option("--conductor","Generate conductor config").option("--all","Generate all formats").action(($)=>a6($));p.command("check [file]").description("Validate .faf file").option("--strict","Require 100% score").option("--fix","Auto-fix issues").option("--doctor","Full diagnostic").option("--trust","Verify trust chain").action(($,X)=>G7($,X));p.command("info").description("Show version and system info").option("--version","Show version").option("--faq","Show FAQ").option("--index","Show command index").option("--stacks","Show supported stacks").action(($)=>t1($));p.command("formats").description("Show supported formats").action(()=>e1());p.command("clear").description("Clear cached data").action(()=>$q());p.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>Xq($));p.command("context").description("Generate context output").action(()=>Jq());p.command("drift").description("Check context drift").action(()=>qq());p.command("edit <path> <value>").description("Edit .faf fields").action(($,X)=>Yq($,X));p.command("recover").description("Recover .faf from context files").action(()=>zq());p.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>Gq($));p.command("pro [subcommand]").description("Pro features & licensing").action(($)=>Fq($));p.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>Iq($));p.command("demo").description("Demo walkthrough").action(()=>Tq());p.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,X)=>Zq($,X));p.command("taf").description("Test Archive Format receipt").option("--output <path>","Write receipt to file").action(($)=>Sq($));p.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>CY($));p.command("conductor [subcommand] [path]").description("Conductor integration").action(($,X)=>fY($,X));p.addCommand(vY());p.addCommand(uY());p.command("skills-install").description("Install FAF skills package for Claude Code").action(()=>lY());p.command("mcp-test").description("Test Claude Code MCP native integration").option("--permission <level>","Permission level (plan|standard|auto|bypass)","standard").option("--tool <name>","Test specific tool").option("--dry-run","Dry run mode").option("--no-hooks","Disable hooks").option("--status","Show integration status").action(($)=>z3($));p.command("bi-sync",{hidden:!0}).action(()=>s6());p.command("status",{hidden:!0}).action(()=>n6(void 0,{status:!0}));p.command("agents",{hidden:!0}).action(()=>a6({agents:!0}));p.command("cursor",{hidden:!0}).action(()=>a6({cursor:!0}));p.command("gemini",{hidden:!0}).action(()=>a6({gemini:!0}));p.command("validate [file]",{hidden:!0}).action(($,X)=>G7($,X));p.command("yolo",{hidden:!0}).action(()=>r6({yolo:!0}));if(process.argv.length<=2){let{autoCommand:$}=await Promise.resolve().then(() => (J7(),f1));await $(),process.exit(0)}p.parse(process.argv);
395
+ `}}e();function cY(){return new R8("claude-sync").description("Sync faf commands with Claude Code integration").option("--check","Check integration status only").option("--best-practices","Show Claude Code integration best practices").action(async($)=>{let X=new T9;if($.bestPractices){console.log(X.getBestPractices());return}if($.check){if(await X.checkIntegration())console.log(`${A("✓")} Claude Code integration is properly configured`);else console.log(`${A("◆")} Claude Code integration needs setup`),console.log(` Run ${S("faf claude-sync")} to configure`);return}console.log(`${A("◆")} Syncing with Claude Code...`);try{await X.syncSkills(),console.log(`${A("✓")} Skills synced to ~/.config/claude-code/skills/faf-commands/`),console.log(O(" Restart Claude Code to see updated slash commands"))}catch(J){console.error("Failed to sync:",J),process.exit(1)}})}e();import{spawn as kO}from"child_process";import{join as pY,dirname as xO}from"path";import{fileURLToPath as yO}from"url";function dY(){return new R8("bun-update").alias("update").description("Update Bun runtime and dependencies").action(async()=>{console.log(`${A("\uD83C\uDFCE️")} Running Bun update routine...`);let $=xO(yO(import.meta.url)),X=pY($,"../../scripts/bun-update.ts"),J=kO("bun",[X],{stdio:"inherit",cwd:pY($,"../..")});J.on("error",(Q)=>{console.error(`Failed to run update: ${Q.message}`),console.log(`
396
+ Try running: ${S("bun scripts/bun-update.ts")}`),process.exit(1)}),J.on("exit",(Q)=>{if(Q!==0)process.exit(Q||1)})})}e();import{existsSync as iY,cpSync as gO}from"fs";import{join as IX}from"path";import{homedir as vO}from"os";import{fileURLToPath as hO}from"url";import{dirname as uO}from"path";async function nY(){let $=uO(hO(import.meta.url)),X,J=[IX($,"../../../skills/faf"),IX($,"../../skills/faf"),IX($,"../skills/faf")];for(let q of J)if(iY(q)){X=q;break}if(!X){console.log(`${O(" Skills package not found in distribution")}`),console.log(`${O(" Checked:")} ${J.join(", ")}`),console.log(`${O(" Run")} ${S("faf claude-sync")} ${O("to generate skills from commands")}`);return}let Q=IX(vO(),".claude","skills","faf");if(console.log(`${A("◆")} Installing FAF skills for Claude Code...`),iY(Q)){console.log(`${A("!")} FAF skills already installed at ${O(Q)}`),console.log(" To reinstall, first remove the existing directory");return}try{gO(X,Q,{recursive:!0}),console.log(`${A("✓")} Installed FAF skills to ~/.claude/skills/faf/`),console.log(""),console.log("Available skills:"),console.log(` ${S("/faf-champion")} - Achieve 100% AI-readiness score`),console.log(` ${S("/faf-quickstart")} - Initialize FAF context in seconds`),console.log(` ${S("/faf-sync-master")} - Keep .faf and CLAUDE.md in sync`),console.log(""),console.log(O(" Restart Claude Code to see the new skills"))}catch(q){console.error("Failed to install skills:",q),process.exit(1)}}class S9{tools=new Map;register($){if(this.tools.has($.name))throw Error(`Tool '${$.name}' already registered`);this.tools.set($.name,$)}get($){return this.tools.get($)}list(){return Array.from(this.tools.values())}listByPermission($){return this.list().filter((X)=>X.permission===$)}listByRisk($){return this.list().filter((X)=>X.risk===$)}}class B8{tags=["faf","ai-context"];validate($){let X=this.schema.safeParse($);if(!X.success)throw Error(`Invalid input for ${this.name}: ${X.error.message}`);return X.data}canExecute($){let X=["plan","standard","auto","bypass"],J=X.indexOf(this.permission);return X.indexOf($.permissionMode)>=J}}var A$={};PX(A$,{void:()=>Iw,util:()=>d,unknown:()=>_w,union:()=>Sw,undefined:()=>Lw,tuple:()=>bw,transformer:()=>mw,symbol:()=>ww,string:()=>J3,strictObject:()=>Tw,setErrorMap:()=>cO,set:()=>kw,record:()=>Pw,quotelessJson:()=>mO,promise:()=>uw,preprocess:()=>pw,pipeline:()=>dw,ostring:()=>iw,optional:()=>lw,onumber:()=>nw,oboolean:()=>rw,objectUtil:()=>j9,object:()=>Zw,number:()=>Q3,nullable:()=>cw,null:()=>Rw,never:()=>Fw,nativeEnum:()=>hw,nan:()=>Nw,map:()=>fw,makeIssue:()=>u2,literal:()=>gw,lazy:()=>yw,late:()=>Kw,isValid:()=>p0,isDirty:()=>ZX,isAsync:()=>G6,isAborted:()=>EX,intersection:()=>Cw,instanceof:()=>Mw,getParsedType:()=>G0,getErrorMap:()=>z6,function:()=>xw,enum:()=>vw,effect:()=>mw,discriminatedUnion:()=>jw,defaultErrorMap:()=>R0,datetimeRegex:()=>eY,date:()=>Ow,custom:()=>X3,coerce:()=>sw,boolean:()=>q3,bigint:()=>Dw,array:()=>Ew,any:()=>Aw,addIssueToContext:()=>Z,ZodVoid:()=>l2,ZodUnknown:()=>d0,ZodUnion:()=>K6,ZodUndefined:()=>V6,ZodType:()=>c,ZodTuple:()=>H0,ZodTransformer:()=>o$,ZodSymbol:()=>m2,ZodString:()=>n$,ZodSet:()=>D8,ZodSchema:()=>c,ZodRecord:()=>c2,ZodReadonly:()=>R6,ZodPromise:()=>O8,ZodPipeline:()=>i2,ZodParsedType:()=>F,ZodOptional:()=>s$,ZodObject:()=>W$,ZodNumber:()=>i0,ZodNullable:()=>_0,ZodNull:()=>B6,ZodNever:()=>W0,ZodNativeEnum:()=>O6,ZodNaN:()=>d2,ZodMap:()=>p2,ZodLiteral:()=>D6,ZodLazy:()=>N6,ZodIssueCode:()=>R,ZodIntersection:()=>M6,ZodFunction:()=>H6,ZodFirstPartyTypeKind:()=>h,ZodError:()=>T$,ZodEnum:()=>r0,ZodEffects:()=>o$,ZodDiscriminatedUnion:()=>TX,ZodDefault:()=>w6,ZodDate:()=>M8,ZodCatch:()=>L6,ZodBranded:()=>SX,ZodBoolean:()=>U6,ZodBigInt:()=>n0,ZodArray:()=>r$,ZodAny:()=>N8,Schema:()=>c,ParseStatus:()=>F$,OK:()=>I$,NEVER:()=>aw,INVALID:()=>v,EMPTY_PATH:()=>pO,DIRTY:()=>K8,BRAND:()=>Bw});var d;(function($){$.assertEqual=(q)=>{};function X(q){}$.assertIs=X;function J(q){throw Error()}$.assertNever=J,$.arrayToEnum=(q)=>{let Y={};for(let z of q)Y[z]=z;return Y},$.getValidEnumValues=(q)=>{let Y=$.objectKeys(q).filter((G)=>typeof q[q[G]]!=="number"),z={};for(let G of Y)z[G]=q[G];return $.objectValues(z)},$.objectValues=(q)=>{return $.objectKeys(q).map(function(Y){return q[Y]})},$.objectKeys=typeof Object.keys==="function"?(q)=>Object.keys(q):(q)=>{let Y=[];for(let z in q)if(Object.prototype.hasOwnProperty.call(q,z))Y.push(z);return Y},$.find=(q,Y)=>{for(let z of q)if(Y(z))return z;return},$.isInteger=typeof Number.isInteger==="function"?(q)=>Number.isInteger(q):(q)=>typeof q==="number"&&Number.isFinite(q)&&Math.floor(q)===q;function Q(q,Y=" | "){return q.map((z)=>typeof z==="string"?`'${z}'`:z).join(Y)}$.joinValues=Q,$.jsonStringifyReplacer=(q,Y)=>{if(typeof Y==="bigint")return Y.toString();return Y}})(d||(d={}));var j9;(function($){$.mergeShapes=(X,J)=>{return{...X,...J}}})(j9||(j9={}));var F=d.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),G0=($)=>{switch(typeof $){case"undefined":return F.undefined;case"string":return F.string;case"number":return Number.isNaN($)?F.nan:F.number;case"boolean":return F.boolean;case"function":return F.function;case"bigint":return F.bigint;case"symbol":return F.symbol;case"object":if(Array.isArray($))return F.array;if($===null)return F.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return F.promise;if(typeof Map<"u"&&$ instanceof Map)return F.map;if(typeof Set<"u"&&$ instanceof Set)return F.set;if(typeof Date<"u"&&$ instanceof Date)return F.date;return F.object;default:return F.unknown}};var R=d.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),mO=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class T$ extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(J)=>{this.issues=[...this.issues,J]},this.addIssues=(J=[])=>{this.issues=[...this.issues,...J]};let X=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,X);else this.__proto__=X;this.name="ZodError",this.issues=$}format($){let X=$||function(q){return q.message},J={_errors:[]},Q=(q)=>{for(let Y of q.issues)if(Y.code==="invalid_union")Y.unionErrors.map(Q);else if(Y.code==="invalid_return_type")Q(Y.returnTypeError);else if(Y.code==="invalid_arguments")Q(Y.argumentsError);else if(Y.path.length===0)J._errors.push(X(Y));else{let z=J,G=0;while(G<Y.path.length){let W=Y.path[G];if(G!==Y.path.length-1)z[W]=z[W]||{_errors:[]};else z[W]=z[W]||{_errors:[]},z[W]._errors.push(X(Y));z=z[W],G++}}};return Q(this),J}static assert($){if(!($ instanceof T$))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,d.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(X)=>X.message){let X={},J=[];for(let Q of this.issues)if(Q.path.length>0){let q=Q.path[0];X[q]=X[q]||[],X[q].push($(Q))}else J.push($(Q));return{formErrors:J,fieldErrors:X}}get formErrors(){return this.flatten()}}T$.create=($)=>{return new T$($)};var lO=($,X)=>{let J;switch($.code){case R.invalid_type:if($.received===F.undefined)J="Required";else J=`Expected ${$.expected}, received ${$.received}`;break;case R.invalid_literal:J=`Invalid literal value, expected ${JSON.stringify($.expected,d.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:J=`Unrecognized key(s) in object: ${d.joinValues($.keys,", ")}`;break;case R.invalid_union:J="Invalid input";break;case R.invalid_union_discriminator:J=`Invalid discriminator value. Expected ${d.joinValues($.options)}`;break;case R.invalid_enum_value:J=`Invalid enum value. Expected ${d.joinValues($.options)}, received '${$.received}'`;break;case R.invalid_arguments:J="Invalid function arguments";break;case R.invalid_return_type:J="Invalid function return type";break;case R.invalid_date:J="Invalid date";break;case R.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(J=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")J=`${J} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)J=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)J=`Invalid input: must end with "${$.validation.endsWith}"`;else d.assertNever($.validation);else if($.validation!=="regex")J=`Invalid ${$.validation}`;else J="Invalid";break;case R.too_small:if($.type==="array")J=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")J=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")J=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")J=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")J=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else J="Invalid input";break;case R.too_big:if($.type==="array")J=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")J=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")J=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")J=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")J=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else J="Invalid input";break;case R.custom:J="Invalid input";break;case R.invalid_intersection_types:J="Intersection results could not be merged";break;case R.not_multiple_of:J=`Number must be a multiple of ${$.multipleOf}`;break;case R.not_finite:J="Number must be finite";break;default:J=X.defaultError,d.assertNever($)}return{message:J}},R0=lO;var rY=R0;function cO($){rY=$}function z6(){return rY}var u2=($)=>{let{data:X,path:J,errorMaps:Q,issueData:q}=$,Y=[...J,...q.path||[]],z={...q,path:Y};if(q.message!==void 0)return{...q,path:Y,message:q.message};let G="",W=Q.filter((H)=>!!H).slice().reverse();for(let H of W)G=H(z,{data:X,defaultError:G}).message;return{...q,path:Y,message:G}},pO=[];function Z($,X){let J=z6(),Q=u2({issueData:X,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,J,J===R0?void 0:R0].filter((q)=>!!q)});$.common.issues.push(Q)}class F${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,X){let J=[];for(let Q of X){if(Q.status==="aborted")return v;if(Q.status==="dirty")$.dirty();J.push(Q.value)}return{status:$.value,value:J}}static async mergeObjectAsync($,X){let J=[];for(let Q of X){let q=await Q.key,Y=await Q.value;J.push({key:q,value:Y})}return F$.mergeObjectSync($,J)}static mergeObjectSync($,X){let J={};for(let Q of X){let{key:q,value:Y}=Q;if(q.status==="aborted")return v;if(Y.status==="aborted")return v;if(q.status==="dirty")$.dirty();if(Y.status==="dirty")$.dirty();if(q.value!=="__proto__"&&(typeof Y.value<"u"||Q.alwaysSet))J[q.value]=Y.value}return{status:$.value,value:J}}}var v=Object.freeze({status:"aborted"}),K8=($)=>({status:"dirty",value:$}),I$=($)=>({status:"valid",value:$}),EX=($)=>$.status==="aborted",ZX=($)=>$.status==="dirty",p0=($)=>$.status==="valid",G6=($)=>typeof Promise<"u"&&$ instanceof Promise;var f;(function($){$.errToObj=(X)=>typeof X==="string"?{message:X}:X||{},$.toString=(X)=>typeof X==="string"?X:X?.message})(f||(f={}));class a${constructor($,X,J,Q){this._cachedPath=[],this.parent=$,this.data=X,this._path=J,this._key=Q}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var sY=($,X)=>{if(p0(X))return{success:!0,data:X.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let J=new T$($.common.issues);return this._error=J,this._error}}}};function m($){if(!$)return{};let{errorMap:X,invalid_type_error:J,required_error:Q,description:q}=$;if(X&&(J||Q))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(X)return{errorMap:X,description:q};return{errorMap:(z,G)=>{let{message:W}=$;if(z.code==="invalid_enum_value")return{message:W??G.defaultError};if(typeof G.data>"u")return{message:W??Q??G.defaultError};if(z.code!=="invalid_type")return{message:G.defaultError};return{message:W??J??G.defaultError}},description:q}}class c{get description(){return this._def.description}_getType($){return G0($.data)}_getOrReturnCtx($,X){return X||{common:$.parent.common,data:$.data,parsedType:G0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new F$,ctx:{common:$.parent.common,data:$.data,parsedType:G0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let X=this._parse($);if(G6(X))throw Error("Synchronous parse encountered promise.");return X}_parseAsync($){let X=this._parse($);return Promise.resolve(X)}parse($,X){let J=this.safeParse($,X);if(J.success)return J.data;throw J.error}safeParse($,X){let J={common:{issues:[],async:X?.async??!1,contextualErrorMap:X?.errorMap},path:X?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:G0($)},Q=this._parseSync({data:$,path:J.path,parent:J});return sY(J,Q)}"~validate"($){let X={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:G0($)};if(!this["~standard"].async)try{let J=this._parseSync({data:$,path:[],parent:X});return p0(J)?{value:J.value}:{issues:X.common.issues}}catch(J){if(J?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;X.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:X}).then((J)=>p0(J)?{value:J.value}:{issues:X.common.issues})}async parseAsync($,X){let J=await this.safeParseAsync($,X);if(J.success)return J.data;throw J.error}async safeParseAsync($,X){let J={common:{issues:[],contextualErrorMap:X?.errorMap,async:!0},path:X?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:G0($)},Q=this._parse({data:$,path:J.path,parent:J}),q=await(G6(Q)?Q:Promise.resolve(Q));return sY(J,q)}refine($,X){let J=(Q)=>{if(typeof X==="string"||typeof X>"u")return{message:X};else if(typeof X==="function")return X(Q);else return X};return this._refinement((Q,q)=>{let Y=$(Q),z=()=>q.addIssue({code:R.custom,...J(Q)});if(typeof Promise<"u"&&Y instanceof Promise)return Y.then((G)=>{if(!G)return z(),!1;else return!0});if(!Y)return z(),!1;else return!0})}refinement($,X){return this._refinement((J,Q)=>{if(!$(J))return Q.addIssue(typeof X==="function"?X(J,Q):X),!1;else return!0})}_refinement($){return new o$({schema:this,typeName:h.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(X)=>this["~validate"](X)}}optional(){return s$.create(this,this._def)}nullable(){return _0.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return r$.create(this)}promise(){return O8.create(this,this._def)}or($){return K6.create([this,$],this._def)}and($){return M6.create(this,$,this._def)}transform($){return new o$({...m(this._def),schema:this,typeName:h.ZodEffects,effect:{type:"transform",transform:$}})}default($){let X=typeof $==="function"?$:()=>$;return new w6({...m(this._def),innerType:this,defaultValue:X,typeName:h.ZodDefault})}brand(){return new SX({typeName:h.ZodBranded,type:this,...m(this._def)})}catch($){let X=typeof $==="function"?$:()=>$;return new L6({...m(this._def),innerType:this,catchValue:X,typeName:h.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return i2.create(this,$)}readonly(){return R6.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var dO=/^c[^\s-]{8,}$/i,iO=/^[0-9a-z]+$/,nO=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rO=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,sO=/^[a-z0-9_-]{21}$/i,aO=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,oO=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tO=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",C9,$w=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Xw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Jw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Qw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Yw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,oY="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",zw=new RegExp(`^${oY}$`);function tY($){let X="[0-5]\\d";if($.precision)X=`${X}\\.\\d{${$.precision}}`;else if($.precision==null)X=`${X}(\\.\\d+)?`;let J=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${X})${J}`}function Gw($){return new RegExp(`^${tY($)}$`)}function eY($){let X=`${oY}T${tY($)}`,J=[];if(J.push($.local?"Z?":"Z"),$.offset)J.push("([+-]\\d{2}:?\\d{2})");return X=`${X}(${J.join("|")})`,new RegExp(`^${X}$`)}function Ww($,X){if((X==="v4"||!X)&&$w.test($))return!0;if((X==="v6"||!X)&&Jw.test($))return!0;return!1}function Hw($,X){if(!aO.test($))return!1;try{let[J]=$.split(".");if(!J)return!1;let Q=J.replace(/-/g,"+").replace(/_/g,"/").padEnd(J.length+(4-J.length%4)%4,"="),q=JSON.parse(atob(Q));if(typeof q!=="object"||q===null)return!1;if("typ"in q&&q?.typ!=="JWT")return!1;if(!q.alg)return!1;if(X&&q.alg!==X)return!1;return!0}catch{return!1}}function Uw($,X){if((X==="v4"||!X)&&Xw.test($))return!0;if((X==="v6"||!X)&&Qw.test($))return!0;return!1}class n$ extends c{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==F.string){let q=this._getOrReturnCtx($);return Z(q,{code:R.invalid_type,expected:F.string,received:q.parsedType}),v}let J=new F$,Q=void 0;for(let q of this._def.checks)if(q.kind==="min"){if($.data.length<q.value)Q=this._getOrReturnCtx($,Q),Z(Q,{code:R.too_small,minimum:q.value,type:"string",inclusive:!0,exact:!1,message:q.message}),J.dirty()}else if(q.kind==="max"){if($.data.length>q.value)Q=this._getOrReturnCtx($,Q),Z(Q,{code:R.too_big,maximum:q.value,type:"string",inclusive:!0,exact:!1,message:q.message}),J.dirty()}else if(q.kind==="length"){let Y=$.data.length>q.value,z=$.data.length<q.value;if(Y||z){if(Q=this._getOrReturnCtx($,Q),Y)Z(Q,{code:R.too_big,maximum:q.value,type:"string",inclusive:!0,exact:!0,message:q.message});else if(z)Z(Q,{code:R.too_small,minimum:q.value,type:"string",inclusive:!0,exact:!0,message:q.message});J.dirty()}}else if(q.kind==="email"){if(!tO.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"email",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="emoji"){if(!C9)C9=new RegExp(eO,"u");if(!C9.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"emoji",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="uuid"){if(!rO.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"uuid",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="nanoid"){if(!sO.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"nanoid",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="cuid"){if(!dO.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"cuid",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="cuid2"){if(!iO.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"cuid2",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="ulid"){if(!nO.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"ulid",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="url")try{new URL($.data)}catch{Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"url",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="regex"){if(q.regex.lastIndex=0,!q.regex.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"regex",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="trim")$.data=$.data.trim();else if(q.kind==="includes"){if(!$.data.includes(q.value,q.position))Q=this._getOrReturnCtx($,Q),Z(Q,{code:R.invalid_string,validation:{includes:q.value,position:q.position},message:q.message}),J.dirty()}else if(q.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(q.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(q.kind==="startsWith"){if(!$.data.startsWith(q.value))Q=this._getOrReturnCtx($,Q),Z(Q,{code:R.invalid_string,validation:{startsWith:q.value},message:q.message}),J.dirty()}else if(q.kind==="endsWith"){if(!$.data.endsWith(q.value))Q=this._getOrReturnCtx($,Q),Z(Q,{code:R.invalid_string,validation:{endsWith:q.value},message:q.message}),J.dirty()}else if(q.kind==="datetime"){if(!eY(q).test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{code:R.invalid_string,validation:"datetime",message:q.message}),J.dirty()}else if(q.kind==="date"){if(!zw.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{code:R.invalid_string,validation:"date",message:q.message}),J.dirty()}else if(q.kind==="time"){if(!Gw(q).test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{code:R.invalid_string,validation:"time",message:q.message}),J.dirty()}else if(q.kind==="duration"){if(!oO.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"duration",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="ip"){if(!Ww($.data,q.version))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"ip",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="jwt"){if(!Hw($.data,q.alg))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"jwt",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="cidr"){if(!Uw($.data,q.version))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"cidr",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="base64"){if(!qw.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"base64",code:R.invalid_string,message:q.message}),J.dirty()}else if(q.kind==="base64url"){if(!Yw.test($.data))Q=this._getOrReturnCtx($,Q),Z(Q,{validation:"base64url",code:R.invalid_string,message:q.message}),J.dirty()}else d.assertNever(q);return{status:J.value,value:$.data}}_regex($,X,J){return this.refinement((Q)=>$.test(Q),{validation:X,code:R.invalid_string,...f.errToObj(J)})}_addCheck($){return new n$({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...f.errToObj($)})}url($){return this._addCheck({kind:"url",...f.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...f.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...f.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...f.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...f.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...f.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...f.errToObj($)})}base64($){return this._addCheck({kind:"base64",...f.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...f.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...f.errToObj($)})}ip($){return this._addCheck({kind:"ip",...f.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...f.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...f.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...f.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...f.errToObj($)})}regex($,X){return this._addCheck({kind:"regex",regex:$,...f.errToObj(X)})}includes($,X){return this._addCheck({kind:"includes",value:$,position:X?.position,...f.errToObj(X?.message)})}startsWith($,X){return this._addCheck({kind:"startsWith",value:$,...f.errToObj(X)})}endsWith($,X){return this._addCheck({kind:"endsWith",value:$,...f.errToObj(X)})}min($,X){return this._addCheck({kind:"min",value:$,...f.errToObj(X)})}max($,X){return this._addCheck({kind:"max",value:$,...f.errToObj(X)})}length($,X){return this._addCheck({kind:"length",value:$,...f.errToObj(X)})}nonempty($){return this.min(1,f.errToObj($))}trim(){return new n$({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n$({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n$({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxLength(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}}n$.create=($)=>{return new n$({checks:[],typeName:h.ZodString,coerce:$?.coerce??!1,...m($)})};function Vw($,X){let J=($.toString().split(".")[1]||"").length,Q=(X.toString().split(".")[1]||"").length,q=J>Q?J:Q,Y=Number.parseInt($.toFixed(q).replace(".","")),z=Number.parseInt(X.toFixed(q).replace(".",""));return Y%z/10**q}class i0 extends c{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==F.number){let q=this._getOrReturnCtx($);return Z(q,{code:R.invalid_type,expected:F.number,received:q.parsedType}),v}let J=void 0,Q=new F$;for(let q of this._def.checks)if(q.kind==="int"){if(!d.isInteger($.data))J=this._getOrReturnCtx($,J),Z(J,{code:R.invalid_type,expected:"integer",received:"float",message:q.message}),Q.dirty()}else if(q.kind==="min"){if(q.inclusive?$.data<q.value:$.data<=q.value)J=this._getOrReturnCtx($,J),Z(J,{code:R.too_small,minimum:q.value,type:"number",inclusive:q.inclusive,exact:!1,message:q.message}),Q.dirty()}else if(q.kind==="max"){if(q.inclusive?$.data>q.value:$.data>=q.value)J=this._getOrReturnCtx($,J),Z(J,{code:R.too_big,maximum:q.value,type:"number",inclusive:q.inclusive,exact:!1,message:q.message}),Q.dirty()}else if(q.kind==="multipleOf"){if(Vw($.data,q.value)!==0)J=this._getOrReturnCtx($,J),Z(J,{code:R.not_multiple_of,multipleOf:q.value,message:q.message}),Q.dirty()}else if(q.kind==="finite"){if(!Number.isFinite($.data))J=this._getOrReturnCtx($,J),Z(J,{code:R.not_finite,message:q.message}),Q.dirty()}else d.assertNever(q);return{status:Q.value,value:$.data}}gte($,X){return this.setLimit("min",$,!0,f.toString(X))}gt($,X){return this.setLimit("min",$,!1,f.toString(X))}lte($,X){return this.setLimit("max",$,!0,f.toString(X))}lt($,X){return this.setLimit("max",$,!1,f.toString(X))}setLimit($,X,J,Q){return new i0({...this._def,checks:[...this._def.checks,{kind:$,value:X,inclusive:J,message:f.toString(Q)}]})}_addCheck($){return new i0({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:f.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f.toString($)})}multipleOf($,X){return this._addCheck({kind:"multipleOf",value:$,message:f.toString(X)})}finite($){return this._addCheck({kind:"finite",message:f.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f.toString($)})}get minValue(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxValue(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&d.isInteger($.value))}get isFinite(){let $=null,X=null;for(let J of this._def.checks)if(J.kind==="finite"||J.kind==="int"||J.kind==="multipleOf")return!0;else if(J.kind==="min"){if(X===null||J.value>X)X=J.value}else if(J.kind==="max"){if($===null||J.value<$)$=J.value}return Number.isFinite(X)&&Number.isFinite($)}}i0.create=($)=>{return new i0({checks:[],typeName:h.ZodNumber,coerce:$?.coerce||!1,...m($)})};class n0 extends c{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==F.bigint)return this._getInvalidInput($);let J=void 0,Q=new F$;for(let q of this._def.checks)if(q.kind==="min"){if(q.inclusive?$.data<q.value:$.data<=q.value)J=this._getOrReturnCtx($,J),Z(J,{code:R.too_small,type:"bigint",minimum:q.value,inclusive:q.inclusive,message:q.message}),Q.dirty()}else if(q.kind==="max"){if(q.inclusive?$.data>q.value:$.data>=q.value)J=this._getOrReturnCtx($,J),Z(J,{code:R.too_big,type:"bigint",maximum:q.value,inclusive:q.inclusive,message:q.message}),Q.dirty()}else if(q.kind==="multipleOf"){if($.data%q.value!==BigInt(0))J=this._getOrReturnCtx($,J),Z(J,{code:R.not_multiple_of,multipleOf:q.value,message:q.message}),Q.dirty()}else d.assertNever(q);return{status:Q.value,value:$.data}}_getInvalidInput($){let X=this._getOrReturnCtx($);return Z(X,{code:R.invalid_type,expected:F.bigint,received:X.parsedType}),v}gte($,X){return this.setLimit("min",$,!0,f.toString(X))}gt($,X){return this.setLimit("min",$,!1,f.toString(X))}lte($,X){return this.setLimit("max",$,!0,f.toString(X))}lt($,X){return this.setLimit("max",$,!1,f.toString(X))}setLimit($,X,J,Q){return new n0({...this._def,checks:[...this._def.checks,{kind:$,value:X,inclusive:J,message:f.toString(Q)}]})}_addCheck($){return new n0({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f.toString($)})}multipleOf($,X){return this._addCheck({kind:"multipleOf",value:$,message:f.toString(X)})}get minValue(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxValue(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}}n0.create=($)=>{return new n0({checks:[],typeName:h.ZodBigInt,coerce:$?.coerce??!1,...m($)})};class U6 extends c{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==F.boolean){let J=this._getOrReturnCtx($);return Z(J,{code:R.invalid_type,expected:F.boolean,received:J.parsedType}),v}return I$($.data)}}U6.create=($)=>{return new U6({typeName:h.ZodBoolean,coerce:$?.coerce||!1,...m($)})};class M8 extends c{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==F.date){let q=this._getOrReturnCtx($);return Z(q,{code:R.invalid_type,expected:F.date,received:q.parsedType}),v}if(Number.isNaN($.data.getTime())){let q=this._getOrReturnCtx($);return Z(q,{code:R.invalid_date}),v}let J=new F$,Q=void 0;for(let q of this._def.checks)if(q.kind==="min"){if($.data.getTime()<q.value)Q=this._getOrReturnCtx($,Q),Z(Q,{code:R.too_small,message:q.message,inclusive:!0,exact:!1,minimum:q.value,type:"date"}),J.dirty()}else if(q.kind==="max"){if($.data.getTime()>q.value)Q=this._getOrReturnCtx($,Q),Z(Q,{code:R.too_big,message:q.message,inclusive:!0,exact:!1,maximum:q.value,type:"date"}),J.dirty()}else d.assertNever(q);return{status:J.value,value:new Date($.data.getTime())}}_addCheck($){return new M8({...this._def,checks:[...this._def.checks,$]})}min($,X){return this._addCheck({kind:"min",value:$.getTime(),message:f.toString(X)})}max($,X){return this._addCheck({kind:"max",value:$.getTime(),message:f.toString(X)})}get minDate(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $!=null?new Date($):null}}M8.create=($)=>{return new M8({checks:[],coerce:$?.coerce||!1,typeName:h.ZodDate,...m($)})};class m2 extends c{_parse($){if(this._getType($)!==F.symbol){let J=this._getOrReturnCtx($);return Z(J,{code:R.invalid_type,expected:F.symbol,received:J.parsedType}),v}return I$($.data)}}m2.create=($)=>{return new m2({typeName:h.ZodSymbol,...m($)})};class V6 extends c{_parse($){if(this._getType($)!==F.undefined){let J=this._getOrReturnCtx($);return Z(J,{code:R.invalid_type,expected:F.undefined,received:J.parsedType}),v}return I$($.data)}}V6.create=($)=>{return new V6({typeName:h.ZodUndefined,...m($)})};class B6 extends c{_parse($){if(this._getType($)!==F.null){let J=this._getOrReturnCtx($);return Z(J,{code:R.invalid_type,expected:F.null,received:J.parsedType}),v}return I$($.data)}}B6.create=($)=>{return new B6({typeName:h.ZodNull,...m($)})};class N8 extends c{constructor(){super(...arguments);this._any=!0}_parse($){return I$($.data)}}N8.create=($)=>{return new N8({typeName:h.ZodAny,...m($)})};class d0 extends c{constructor(){super(...arguments);this._unknown=!0}_parse($){return I$($.data)}}d0.create=($)=>{return new d0({typeName:h.ZodUnknown,...m($)})};class W0 extends c{_parse($){let X=this._getOrReturnCtx($);return Z(X,{code:R.invalid_type,expected:F.never,received:X.parsedType}),v}}W0.create=($)=>{return new W0({typeName:h.ZodNever,...m($)})};class l2 extends c{_parse($){if(this._getType($)!==F.undefined){let J=this._getOrReturnCtx($);return Z(J,{code:R.invalid_type,expected:F.void,received:J.parsedType}),v}return I$($.data)}}l2.create=($)=>{return new l2({typeName:h.ZodVoid,...m($)})};class r$ extends c{_parse($){let{ctx:X,status:J}=this._processInputParams($),Q=this._def;if(X.parsedType!==F.array)return Z(X,{code:R.invalid_type,expected:F.array,received:X.parsedType}),v;if(Q.exactLength!==null){let Y=X.data.length>Q.exactLength.value,z=X.data.length<Q.exactLength.value;if(Y||z)Z(X,{code:Y?R.too_big:R.too_small,minimum:z?Q.exactLength.value:void 0,maximum:Y?Q.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Q.exactLength.message}),J.dirty()}if(Q.minLength!==null){if(X.data.length<Q.minLength.value)Z(X,{code:R.too_small,minimum:Q.minLength.value,type:"array",inclusive:!0,exact:!1,message:Q.minLength.message}),J.dirty()}if(Q.maxLength!==null){if(X.data.length>Q.maxLength.value)Z(X,{code:R.too_big,maximum:Q.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Q.maxLength.message}),J.dirty()}if(X.common.async)return Promise.all([...X.data].map((Y,z)=>{return Q.type._parseAsync(new a$(X,Y,X.path,z))})).then((Y)=>{return F$.mergeArray(J,Y)});let q=[...X.data].map((Y,z)=>{return Q.type._parseSync(new a$(X,Y,X.path,z))});return F$.mergeArray(J,q)}get element(){return this._def.type}min($,X){return new r$({...this._def,minLength:{value:$,message:f.toString(X)}})}max($,X){return new r$({...this._def,maxLength:{value:$,message:f.toString(X)}})}length($,X){return new r$({...this._def,exactLength:{value:$,message:f.toString(X)}})}nonempty($){return this.min(1,$)}}r$.create=($,X)=>{return new r$({type:$,minLength:null,maxLength:null,exactLength:null,typeName:h.ZodArray,...m(X)})};function W6($){if($ instanceof W$){let X={};for(let J in $.shape){let Q=$.shape[J];X[J]=s$.create(W6(Q))}return new W$({...$._def,shape:()=>X})}else if($ instanceof r$)return new r$({...$._def,type:W6($.element)});else if($ instanceof s$)return s$.create(W6($.unwrap()));else if($ instanceof _0)return _0.create(W6($.unwrap()));else if($ instanceof H0)return H0.create($.items.map((X)=>W6(X)));else return $}class W$ extends c{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),X=d.objectKeys($);return this._cached={shape:$,keys:X},this._cached}_parse($){if(this._getType($)!==F.object){let W=this._getOrReturnCtx($);return Z(W,{code:R.invalid_type,expected:F.object,received:W.parsedType}),v}let{status:J,ctx:Q}=this._processInputParams($),{shape:q,keys:Y}=this._getCached(),z=[];if(!(this._def.catchall instanceof W0&&this._def.unknownKeys==="strip")){for(let W in Q.data)if(!Y.includes(W))z.push(W)}let G=[];for(let W of Y){let H=q[W],U=Q.data[W];G.push({key:{status:"valid",value:W},value:H._parse(new a$(Q,U,Q.path,W)),alwaysSet:W in Q.data})}if(this._def.catchall instanceof W0){let W=this._def.unknownKeys;if(W==="passthrough")for(let H of z)G.push({key:{status:"valid",value:H},value:{status:"valid",value:Q.data[H]}});else if(W==="strict"){if(z.length>0)Z(Q,{code:R.unrecognized_keys,keys:z}),J.dirty()}else if(W==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let W=this._def.catchall;for(let H of z){let U=Q.data[H];G.push({key:{status:"valid",value:H},value:W._parse(new a$(Q,U,Q.path,H)),alwaysSet:H in Q.data})}}if(Q.common.async)return Promise.resolve().then(async()=>{let W=[];for(let H of G){let U=await H.key,V=await H.value;W.push({key:U,value:V,alwaysSet:H.alwaysSet})}return W}).then((W)=>{return F$.mergeObjectSync(J,W)});else return F$.mergeObjectSync(J,G)}get shape(){return this._def.shape()}strict($){return f.errToObj,new W$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(X,J)=>{let Q=this._def.errorMap?.(X,J).message??J.defaultError;if(X.code==="unrecognized_keys")return{message:f.errToObj($).message??Q};return{message:Q}}}:{}})}strip(){return new W$({...this._def,unknownKeys:"strip"})}passthrough(){return new W$({...this._def,unknownKeys:"passthrough"})}extend($){return new W$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new W$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:h.ZodObject})}setKey($,X){return this.augment({[$]:X})}catchall($){return new W$({...this._def,catchall:$})}pick($){let X={};for(let J of d.objectKeys($))if($[J]&&this.shape[J])X[J]=this.shape[J];return new W$({...this._def,shape:()=>X})}omit($){let X={};for(let J of d.objectKeys(this.shape))if(!$[J])X[J]=this.shape[J];return new W$({...this._def,shape:()=>X})}deepPartial(){return W6(this)}partial($){let X={};for(let J of d.objectKeys(this.shape)){let Q=this.shape[J];if($&&!$[J])X[J]=Q;else X[J]=Q.optional()}return new W$({...this._def,shape:()=>X})}required($){let X={};for(let J of d.objectKeys(this.shape))if($&&!$[J])X[J]=this.shape[J];else{let q=this.shape[J];while(q instanceof s$)q=q._def.innerType;X[J]=q}return new W$({...this._def,shape:()=>X})}keyof(){return $3(d.objectKeys(this.shape))}}W$.create=($,X)=>{return new W$({shape:()=>$,unknownKeys:"strip",catchall:W0.create(),typeName:h.ZodObject,...m(X)})};W$.strictCreate=($,X)=>{return new W$({shape:()=>$,unknownKeys:"strict",catchall:W0.create(),typeName:h.ZodObject,...m(X)})};W$.lazycreate=($,X)=>{return new W$({shape:$,unknownKeys:"strip",catchall:W0.create(),typeName:h.ZodObject,...m(X)})};class K6 extends c{_parse($){let{ctx:X}=this._processInputParams($),J=this._def.options;function Q(q){for(let z of q)if(z.result.status==="valid")return z.result;for(let z of q)if(z.result.status==="dirty")return X.common.issues.push(...z.ctx.common.issues),z.result;let Y=q.map((z)=>new T$(z.ctx.common.issues));return Z(X,{code:R.invalid_union,unionErrors:Y}),v}if(X.common.async)return Promise.all(J.map(async(q)=>{let Y={...X,common:{...X.common,issues:[]},parent:null};return{result:await q._parseAsync({data:X.data,path:X.path,parent:Y}),ctx:Y}})).then(Q);else{let q=void 0,Y=[];for(let G of J){let W={...X,common:{...X.common,issues:[]},parent:null},H=G._parseSync({data:X.data,path:X.path,parent:W});if(H.status==="valid")return H;else if(H.status==="dirty"&&!q)q={result:H,ctx:W};if(W.common.issues.length)Y.push(W.common.issues)}if(q)return X.common.issues.push(...q.ctx.common.issues),q.result;let z=Y.map((G)=>new T$(G));return Z(X,{code:R.invalid_union,unionErrors:z}),v}}get options(){return this._def.options}}K6.create=($,X)=>{return new K6({options:$,typeName:h.ZodUnion,...m(X)})};var A0=($)=>{if($ instanceof N6)return A0($.schema);else if($ instanceof o$)return A0($.innerType());else if($ instanceof D6)return[$.value];else if($ instanceof r0)return $.options;else if($ instanceof O6)return d.objectValues($.enum);else if($ instanceof w6)return A0($._def.innerType);else if($ instanceof V6)return[void 0];else if($ instanceof B6)return[null];else if($ instanceof s$)return[void 0,...A0($.unwrap())];else if($ instanceof _0)return[null,...A0($.unwrap())];else if($ instanceof SX)return A0($.unwrap());else if($ instanceof R6)return A0($.unwrap());else if($ instanceof L6)return A0($._def.innerType);else return[]};class TX extends c{_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==F.object)return Z(X,{code:R.invalid_type,expected:F.object,received:X.parsedType}),v;let J=this.discriminator,Q=X.data[J],q=this.optionsMap.get(Q);if(!q)return Z(X,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[J]}),v;if(X.common.async)return q._parseAsync({data:X.data,path:X.path,parent:X});else return q._parseSync({data:X.data,path:X.path,parent:X})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,X,J){let Q=new Map;for(let q of X){let Y=A0(q.shape[$]);if(!Y.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let z of Y){if(Q.has(z))throw Error(`Discriminator property ${String($)} has duplicate value ${String(z)}`);Q.set(z,q)}}return new TX({typeName:h.ZodDiscriminatedUnion,discriminator:$,options:X,optionsMap:Q,...m(J)})}}function b9($,X){let J=G0($),Q=G0(X);if($===X)return{valid:!0,data:$};else if(J===F.object&&Q===F.object){let q=d.objectKeys(X),Y=d.objectKeys($).filter((G)=>q.indexOf(G)!==-1),z={...$,...X};for(let G of Y){let W=b9($[G],X[G]);if(!W.valid)return{valid:!1};z[G]=W.data}return{valid:!0,data:z}}else if(J===F.array&&Q===F.array){if($.length!==X.length)return{valid:!1};let q=[];for(let Y=0;Y<$.length;Y++){let z=$[Y],G=X[Y],W=b9(z,G);if(!W.valid)return{valid:!1};q.push(W.data)}return{valid:!0,data:q}}else if(J===F.date&&Q===F.date&&+$===+X)return{valid:!0,data:$};else return{valid:!1}}class M6 extends c{_parse($){let{status:X,ctx:J}=this._processInputParams($),Q=(q,Y)=>{if(EX(q)||EX(Y))return v;let z=b9(q.value,Y.value);if(!z.valid)return Z(J,{code:R.invalid_intersection_types}),v;if(ZX(q)||ZX(Y))X.dirty();return{status:X.value,value:z.data}};if(J.common.async)return Promise.all([this._def.left._parseAsync({data:J.data,path:J.path,parent:J}),this._def.right._parseAsync({data:J.data,path:J.path,parent:J})]).then(([q,Y])=>Q(q,Y));else return Q(this._def.left._parseSync({data:J.data,path:J.path,parent:J}),this._def.right._parseSync({data:J.data,path:J.path,parent:J}))}}M6.create=($,X,J)=>{return new M6({left:$,right:X,typeName:h.ZodIntersection,...m(J)})};class H0 extends c{_parse($){let{status:X,ctx:J}=this._processInputParams($);if(J.parsedType!==F.array)return Z(J,{code:R.invalid_type,expected:F.array,received:J.parsedType}),v;if(J.data.length<this._def.items.length)return Z(J,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),v;if(!this._def.rest&&J.data.length>this._def.items.length)Z(J,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X.dirty();let q=[...J.data].map((Y,z)=>{let G=this._def.items[z]||this._def.rest;if(!G)return null;return G._parse(new a$(J,Y,J.path,z))}).filter((Y)=>!!Y);if(J.common.async)return Promise.all(q).then((Y)=>{return F$.mergeArray(X,Y)});else return F$.mergeArray(X,q)}get items(){return this._def.items}rest($){return new H0({...this._def,rest:$})}}H0.create=($,X)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new H0({items:$,typeName:h.ZodTuple,rest:null,...m(X)})};class c2 extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:X,ctx:J}=this._processInputParams($);if(J.parsedType!==F.object)return Z(J,{code:R.invalid_type,expected:F.object,received:J.parsedType}),v;let Q=[],q=this._def.keyType,Y=this._def.valueType;for(let z in J.data)Q.push({key:q._parse(new a$(J,z,J.path,z)),value:Y._parse(new a$(J,J.data[z],J.path,z)),alwaysSet:z in J.data});if(J.common.async)return F$.mergeObjectAsync(X,Q);else return F$.mergeObjectSync(X,Q)}get element(){return this._def.valueType}static create($,X,J){if(X instanceof c)return new c2({keyType:$,valueType:X,typeName:h.ZodRecord,...m(J)});return new c2({keyType:n$.create(),valueType:$,typeName:h.ZodRecord,...m(X)})}}class p2 extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:X,ctx:J}=this._processInputParams($);if(J.parsedType!==F.map)return Z(J,{code:R.invalid_type,expected:F.map,received:J.parsedType}),v;let Q=this._def.keyType,q=this._def.valueType,Y=[...J.data.entries()].map(([z,G],W)=>{return{key:Q._parse(new a$(J,z,J.path,[W,"key"])),value:q._parse(new a$(J,G,J.path,[W,"value"]))}});if(J.common.async){let z=new Map;return Promise.resolve().then(async()=>{for(let G of Y){let W=await G.key,H=await G.value;if(W.status==="aborted"||H.status==="aborted")return v;if(W.status==="dirty"||H.status==="dirty")X.dirty();z.set(W.value,H.value)}return{status:X.value,value:z}})}else{let z=new Map;for(let G of Y){let{key:W,value:H}=G;if(W.status==="aborted"||H.status==="aborted")return v;if(W.status==="dirty"||H.status==="dirty")X.dirty();z.set(W.value,H.value)}return{status:X.value,value:z}}}}p2.create=($,X,J)=>{return new p2({valueType:X,keyType:$,typeName:h.ZodMap,...m(J)})};class D8 extends c{_parse($){let{status:X,ctx:J}=this._processInputParams($);if(J.parsedType!==F.set)return Z(J,{code:R.invalid_type,expected:F.set,received:J.parsedType}),v;let Q=this._def;if(Q.minSize!==null){if(J.data.size<Q.minSize.value)Z(J,{code:R.too_small,minimum:Q.minSize.value,type:"set",inclusive:!0,exact:!1,message:Q.minSize.message}),X.dirty()}if(Q.maxSize!==null){if(J.data.size>Q.maxSize.value)Z(J,{code:R.too_big,maximum:Q.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Q.maxSize.message}),X.dirty()}let q=this._def.valueType;function Y(G){let W=new Set;for(let H of G){if(H.status==="aborted")return v;if(H.status==="dirty")X.dirty();W.add(H.value)}return{status:X.value,value:W}}let z=[...J.data.values()].map((G,W)=>q._parse(new a$(J,G,J.path,W)));if(J.common.async)return Promise.all(z).then((G)=>Y(G));else return Y(z)}min($,X){return new D8({...this._def,minSize:{value:$,message:f.toString(X)}})}max($,X){return new D8({...this._def,maxSize:{value:$,message:f.toString(X)}})}size($,X){return this.min($,X).max($,X)}nonempty($){return this.min(1,$)}}D8.create=($,X)=>{return new D8({valueType:$,minSize:null,maxSize:null,typeName:h.ZodSet,...m(X)})};class H6 extends c{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==F.function)return Z(X,{code:R.invalid_type,expected:F.function,received:X.parsedType}),v;function J(z,G){return u2({data:z,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,z6(),R0].filter((W)=>!!W),issueData:{code:R.invalid_arguments,argumentsError:G}})}function Q(z,G){return u2({data:z,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,z6(),R0].filter((W)=>!!W),issueData:{code:R.invalid_return_type,returnTypeError:G}})}let q={errorMap:X.common.contextualErrorMap},Y=X.data;if(this._def.returns instanceof O8){let z=this;return I$(async function(...G){let W=new T$([]),H=await z._def.args.parseAsync(G,q).catch((B)=>{throw W.addIssue(J(G,B)),W}),U=await Reflect.apply(Y,this,H);return await z._def.returns._def.type.parseAsync(U,q).catch((B)=>{throw W.addIssue(Q(U,B)),W})})}else{let z=this;return I$(function(...G){let W=z._def.args.safeParse(G,q);if(!W.success)throw new T$([J(G,W.error)]);let H=Reflect.apply(Y,this,W.data),U=z._def.returns.safeParse(H,q);if(!U.success)throw new T$([Q(H,U.error)]);return U.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new H6({...this._def,args:H0.create($).rest(d0.create())})}returns($){return new H6({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,X,J){return new H6({args:$?$:H0.create([]).rest(d0.create()),returns:X||d0.create(),typeName:h.ZodFunction,...m(J)})}}class N6 extends c{get schema(){return this._def.getter()}_parse($){let{ctx:X}=this._processInputParams($);return this._def.getter()._parse({data:X.data,path:X.path,parent:X})}}N6.create=($,X)=>{return new N6({getter:$,typeName:h.ZodLazy,...m(X)})};class D6 extends c{_parse($){if($.data!==this._def.value){let X=this._getOrReturnCtx($);return Z(X,{received:X.data,code:R.invalid_literal,expected:this._def.value}),v}return{status:"valid",value:$.data}}get value(){return this._def.value}}D6.create=($,X)=>{return new D6({value:$,typeName:h.ZodLiteral,...m(X)})};function $3($,X){return new r0({values:$,typeName:h.ZodEnum,...m(X)})}class r0 extends c{_parse($){if(typeof $.data!=="string"){let X=this._getOrReturnCtx($),J=this._def.values;return Z(X,{expected:d.joinValues(J),received:X.parsedType,code:R.invalid_type}),v}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let X=this._getOrReturnCtx($),J=this._def.values;return Z(X,{received:X.data,code:R.invalid_enum_value,options:J}),v}return I$($.data)}get options(){return this._def.values}get enum(){let $={};for(let X of this._def.values)$[X]=X;return $}get Values(){let $={};for(let X of this._def.values)$[X]=X;return $}get Enum(){let $={};for(let X of this._def.values)$[X]=X;return $}extract($,X=this._def){return r0.create($,{...this._def,...X})}exclude($,X=this._def){return r0.create(this.options.filter((J)=>!$.includes(J)),{...this._def,...X})}}r0.create=$3;class O6 extends c{_parse($){let X=d.getValidEnumValues(this._def.values),J=this._getOrReturnCtx($);if(J.parsedType!==F.string&&J.parsedType!==F.number){let Q=d.objectValues(X);return Z(J,{expected:d.joinValues(Q),received:J.parsedType,code:R.invalid_type}),v}if(!this._cache)this._cache=new Set(d.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let Q=d.objectValues(X);return Z(J,{received:J.data,code:R.invalid_enum_value,options:Q}),v}return I$($.data)}get enum(){return this._def.values}}O6.create=($,X)=>{return new O6({values:$,typeName:h.ZodNativeEnum,...m(X)})};class O8 extends c{unwrap(){return this._def.type}_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==F.promise&&X.common.async===!1)return Z(X,{code:R.invalid_type,expected:F.promise,received:X.parsedType}),v;let J=X.parsedType===F.promise?X.data:Promise.resolve(X.data);return I$(J.then((Q)=>{return this._def.type.parseAsync(Q,{path:X.path,errorMap:X.common.contextualErrorMap})}))}}O8.create=($,X)=>{return new O8({type:$,typeName:h.ZodPromise,...m(X)})};class o$ extends c{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===h.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:X,ctx:J}=this._processInputParams($),Q=this._def.effect||null,q={addIssue:(Y)=>{if(Z(J,Y),Y.fatal)X.abort();else X.dirty()},get path(){return J.path}};if(q.addIssue=q.addIssue.bind(q),Q.type==="preprocess"){let Y=Q.transform(J.data,q);if(J.common.async)return Promise.resolve(Y).then(async(z)=>{if(X.value==="aborted")return v;let G=await this._def.schema._parseAsync({data:z,path:J.path,parent:J});if(G.status==="aborted")return v;if(G.status==="dirty")return K8(G.value);if(X.value==="dirty")return K8(G.value);return G});else{if(X.value==="aborted")return v;let z=this._def.schema._parseSync({data:Y,path:J.path,parent:J});if(z.status==="aborted")return v;if(z.status==="dirty")return K8(z.value);if(X.value==="dirty")return K8(z.value);return z}}if(Q.type==="refinement"){let Y=(z)=>{let G=Q.refinement(z,q);if(J.common.async)return Promise.resolve(G);if(G instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return z};if(J.common.async===!1){let z=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(z.status==="aborted")return v;if(z.status==="dirty")X.dirty();return Y(z.value),{status:X.value,value:z.value}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then((z)=>{if(z.status==="aborted")return v;if(z.status==="dirty")X.dirty();return Y(z.value).then(()=>{return{status:X.value,value:z.value}})})}if(Q.type==="transform")if(J.common.async===!1){let Y=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(!p0(Y))return v;let z=Q.transform(Y.value,q);if(z instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:X.value,value:z}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then((Y)=>{if(!p0(Y))return v;return Promise.resolve(Q.transform(Y.value,q)).then((z)=>({status:X.value,value:z}))});d.assertNever(Q)}}o$.create=($,X,J)=>{return new o$({schema:$,typeName:h.ZodEffects,effect:X,...m(J)})};o$.createWithPreprocess=($,X,J)=>{return new o$({schema:X,effect:{type:"preprocess",transform:$},typeName:h.ZodEffects,...m(J)})};class s$ extends c{_parse($){if(this._getType($)===F.undefined)return I$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}s$.create=($,X)=>{return new s$({innerType:$,typeName:h.ZodOptional,...m(X)})};class _0 extends c{_parse($){if(this._getType($)===F.null)return I$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}_0.create=($,X)=>{return new _0({innerType:$,typeName:h.ZodNullable,...m(X)})};class w6 extends c{_parse($){let{ctx:X}=this._processInputParams($),J=X.data;if(X.parsedType===F.undefined)J=this._def.defaultValue();return this._def.innerType._parse({data:J,path:X.path,parent:X})}removeDefault(){return this._def.innerType}}w6.create=($,X)=>{return new w6({innerType:$,typeName:h.ZodDefault,defaultValue:typeof X.default==="function"?X.default:()=>X.default,...m(X)})};class L6 extends c{_parse($){let{ctx:X}=this._processInputParams($),J={...X,common:{...X.common,issues:[]}},Q=this._def.innerType._parse({data:J.data,path:J.path,parent:{...J}});if(G6(Q))return Q.then((q)=>{return{status:"valid",value:q.status==="valid"?q.value:this._def.catchValue({get error(){return new T$(J.common.issues)},input:J.data})}});else return{status:"valid",value:Q.status==="valid"?Q.value:this._def.catchValue({get error(){return new T$(J.common.issues)},input:J.data})}}removeCatch(){return this._def.innerType}}L6.create=($,X)=>{return new L6({innerType:$,typeName:h.ZodCatch,catchValue:typeof X.catch==="function"?X.catch:()=>X.catch,...m(X)})};class d2 extends c{_parse($){if(this._getType($)!==F.nan){let J=this._getOrReturnCtx($);return Z(J,{code:R.invalid_type,expected:F.nan,received:J.parsedType}),v}return{status:"valid",value:$.data}}}d2.create=($)=>{return new d2({typeName:h.ZodNaN,...m($)})};var Bw=Symbol("zod_brand");class SX extends c{_parse($){let{ctx:X}=this._processInputParams($),J=X.data;return this._def.type._parse({data:J,path:X.path,parent:X})}unwrap(){return this._def.type}}class i2 extends c{_parse($){let{status:X,ctx:J}=this._processInputParams($);if(J.common.async)return(async()=>{let q=await this._def.in._parseAsync({data:J.data,path:J.path,parent:J});if(q.status==="aborted")return v;if(q.status==="dirty")return X.dirty(),K8(q.value);else return this._def.out._parseAsync({data:q.value,path:J.path,parent:J})})();else{let Q=this._def.in._parseSync({data:J.data,path:J.path,parent:J});if(Q.status==="aborted")return v;if(Q.status==="dirty")return X.dirty(),{status:"dirty",value:Q.value};else return this._def.out._parseSync({data:Q.value,path:J.path,parent:J})}}static create($,X){return new i2({in:$,out:X,typeName:h.ZodPipeline})}}class R6 extends c{_parse($){let X=this._def.innerType._parse($),J=(Q)=>{if(p0(Q))Q.value=Object.freeze(Q.value);return Q};return G6(X)?X.then((Q)=>J(Q)):J(X)}unwrap(){return this._def.innerType}}R6.create=($,X)=>{return new R6({innerType:$,typeName:h.ZodReadonly,...m(X)})};function aY($,X){let J=typeof $==="function"?$(X):typeof $==="string"?{message:$}:$;return typeof J==="string"?{message:J}:J}function X3($,X={},J){if($)return N8.create().superRefine((Q,q)=>{let Y=$(Q);if(Y instanceof Promise)return Y.then((z)=>{if(!z){let G=aY(X,Q),W=G.fatal??J??!0;q.addIssue({code:"custom",...G,fatal:W})}});if(!Y){let z=aY(X,Q),G=z.fatal??J??!0;q.addIssue({code:"custom",...z,fatal:G})}return});return N8.create()}var Kw={object:W$.lazycreate},h;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(h||(h={}));var Mw=($,X={message:`Input not instance of ${$.name}`})=>X3((J)=>J instanceof $,X),J3=n$.create,Q3=i0.create,Nw=d2.create,Dw=n0.create,q3=U6.create,Ow=M8.create,ww=m2.create,Lw=V6.create,Rw=B6.create,Aw=N8.create,_w=d0.create,Fw=W0.create,Iw=l2.create,Ew=r$.create,Zw=W$.create,Tw=W$.strictCreate,Sw=K6.create,jw=TX.create,Cw=M6.create,bw=H0.create,Pw=c2.create,fw=p2.create,kw=D8.create,xw=H6.create,yw=N6.create,gw=D6.create,vw=r0.create,hw=O6.create,uw=O8.create,mw=o$.create,lw=s$.create,cw=_0.create,pw=o$.createWithPreprocess,dw=i2.create,iw=()=>J3().optional(),nw=()=>Q3().optional(),rw=()=>q3().optional(),sw={string:($)=>n$.create({...$,coerce:!0}),number:($)=>i0.create({...$,coerce:!0}),boolean:($)=>U6.create({...$,coerce:!0}),bigint:($)=>n0.create({...$,coerce:!0}),date:($)=>M8.create({...$,coerce:!0})};var aw=v;var ow=A$.object({file:A$.string().optional().describe("Path to .faf file to score (defaults to project.faf)"),verbose:A$.boolean().optional().default(!1).describe("Show detailed slot breakdown"),status:A$.boolean().optional().default(!1).describe("Compact one-liner output"),json:A$.boolean().optional().default(!1).describe("Output as JSON")});class P9 extends B8{name="faf_score";description="Score AI-readiness of .faf file (0-100%)";permission="plan";risk="safe";schema=ow;tags=["faf","ai-context","scoring","read-only"];async execute($,X){let J=Date.now();try{let Q="",q=null,Y=console.log,z=console.error;console.log=(...L)=>{Q+=`${L.join(" ")}
397
+ `},console.error=(...L)=>{Q+=`${L.join(" ")}
398
+ `};try{await o6($.file,{verbose:$.verbose,status:$.status,json:$.json})}finally{console.log=Y,console.error=z}let G=Q.match(/(\d+)%/),W=Q.match(/(RED|YELLOW|GREEN|SILVER|GOLD|TROPHY)/),H=Q.match(/(\d+)\/(\d+) slots/),U=G?parseInt(G[1]):0,V=W?W[1]:"UNKNOWN",B=H?parseInt(H[1]):0,D=H?parseInt(H[2]):0,w=[],M=[];if($.verbose&&Q.includes("empty")){let L=Q.split(`
399
+ `);for(let I of L)if(I.includes("empty")&&I.includes("○")){let T=I.match(/([a-z_]+\.[a-z_]+)/);if(T)w.push(T[1])}}let N={score:U,tier:V,populated:B,total:D,empty:w,ignored:M,file:$.file||"project.faf"};if($.json)N.raw=q;if(X.telemetry)console.log(`[MCP] faf_score executed in ${Date.now()-J}ms`);return N}catch(Q){throw Error(`Failed to score FAF file: ${Q instanceof Error?Q.message:String(Q)}`)}}canExecute($){return!0}}import{existsSync as Y3}from"fs";import{join as z3}from"path";var tw=A$.object({yolo:A$.boolean().optional().default(!1).describe("Quick init with sensible defaults"),quick:A$.boolean().optional().default(!1).describe("Alias for --yolo"),force:A$.boolean().optional().default(!1).describe("Overwrite existing project.faf"),output:A$.string().optional().describe("Output path for generated .faf file")});class f9 extends B8{name="faf_init";description="Initialize .faf file for current project";permission="standard";risk="low";schema=tw;tags=["faf","ai-context","initialization","file-creation"];async execute($,X){let J=Date.now(),Q=$.output||z3(X.workingDirectory,"project.faf"),q=Y3(Q);if(q&&!$.force&&!X.dryRun)throw Error(`File ${Q} already exists. Use force: true to overwrite.`);if(X.dryRun)return{created:!1,file:Q,score:0,overwritten:!1};try{let Y="",z=console.log;console.log=(...V)=>{Y+=`${V.join(" ")}
400
+ `};try{await t6({yolo:$.yolo||$.quick,force:$.force,output:$.output})}finally{console.log=z}let G=Y.includes("created"),W=Y.includes("updated"),H=Y.match(/(\d+)%/),U={created:G||!q,file:Q,score:H?parseInt(H[1]):0,overwritten:q&&$.force};if(Y.includes("TypeScript"))U.detectedLanguage="TypeScript";else if(Y.includes("JavaScript"))U.detectedLanguage="JavaScript";else if(Y.includes("Python"))U.detectedLanguage="Python";if(X.telemetry)console.log(`[MCP] faf_init executed in ${Date.now()-J}ms`);return U}catch(Y){throw Error(`Failed to initialize FAF file: ${Y instanceof Error?Y.message:String(Y)}`)}}canExecute($){if(!super.canExecute($))return!1;let X=z3($.workingDirectory,"project.faf");if($.permissionMode==="plan"&&Y3(X))return!1;return!0}}var ew=A$.object({watch:A$.boolean().optional().default(!1).describe("Watch for changes and sync continuously"),direction:A$.enum(["auto","push","pull"]).optional().default("auto").describe("Force sync direction")});class k9 extends B8{name="faf_sync";description="Bi-directional sync between .faf and CLAUDE.md files";permission="auto";risk="low";schema=ew;tags=["faf","ai-context","synchronization","file-modification"];async execute($,X){let J=Date.now();if(X.dryRun)return{synced:!1,direction:"none",files:{faf:"project.faf",claude:"CLAUDE.md"},lastModified:{},changes:[],watchMode:!1};try{let Q="",q=console.log;console.log=(...B)=>{Q+=`${B.join(" ")}
401
+ `};try{await e6({watch:$.watch,direction:$.direction})}finally{console.log=q}let Y=Q.includes("→ CLAUDE.md"),z=Q.includes("← project.faf"),G=Q.includes("synced")||Q.includes("updated"),W="none";if(Y)W="push";else if(z)W="pull";let H=[],U=Q.split(`
402
+ `);for(let B of U)if(B.includes("updated")||B.includes("created")||B.includes("synced"))H.push(B.trim());let V={synced:G,direction:W,files:{faf:"project.faf",claude:"CLAUDE.md"},lastModified:{},changes:H,watchMode:$.watch};if(X.telemetry)console.log(`[MCP] faf_sync executed in ${Date.now()-J}ms`);return V}catch(Q){throw Error(`Failed to sync FAF files: ${Q instanceof Error?Q.message:String(Q)}`)}}canExecute($){if(!super.canExecute($))return!1;if($.permissionMode==="plan")return!1;return!0}}class x9{registry=new S9;config;constructor($){this.config=$,this.initializeTools()}initializeTools(){let $=[new P9,new f9,new k9];for(let X of $)this.registry.register(X)}async listTools(){return this.registry.list().map(($)=>({name:$.name,description:$.description,inputSchema:$.schema,permissions:[$.permission,$.risk],tags:$.tags}))}async callTool($,X){let J=this.registry.get($);if(!J)return{content:[{type:"text",text:`Tool '${$}' not found`}],isError:!0};try{let Q={workingDirectory:this.config.workingDirectory,userId:this.config.userId,sessionId:this.config.sessionId,permissionMode:this.config.permissionMode,dryRun:this.config.dryRun,telemetry:this.config.telemetryEnabled};if(!J.canExecute(Q))return{content:[{type:"text",text:`Tool '${$}' cannot execute with current permissions (${this.config.permissionMode})`}],isError:!0};let q=J.validate(X),Y=await J.execute(q,Q);return{content:[{type:"text",text:JSON.stringify(Y,null,2)}]}}catch(Q){return{content:[{type:"text",text:`Error executing tool '${$}': ${Q instanceof Error?Q.message:String(Q)}`}],isError:!0}}}getToolsByPermission($){return this.registry.listByPermission($)}async getInfo(){let $=this.registry.list(),X=[...new Set($.map((G)=>G.permission))],{readFileSync:J}=await import("fs"),{dirname:Q,join:q}=await import("path"),{fileURLToPath:Y}=await import("url"),z="unknown";try{z=JSON.parse(J(q(Q(Y(import.meta.url)),"../../package.json"),"utf-8")).version}catch{z="dev"}return{name:"claude-faf-mcp",version:z,description:"Foundational AI-Context Format tools for Claude Code",tools:$.length,permissions:X}}async requestPermissionElevation($,X){let J=this.registry.get($);if(!J)return!1;if(J.risk==="safe"&&X<="standard")return!0;return!1}}class y9{static classify($,X={}){if(this.isReadOnly($,X))return{permission:"plan",risk:"safe",reasons:["Read-only operation","No file modifications"],allowAutoApproval:!0,requiresConfirmation:!1};if(this.isSafeConfig($,X))return{permission:"auto",risk:"low",reasons:["Safe configuration change","Limited scope"],allowAutoApproval:!0,requiresConfirmation:!1};if(this.isFileOperation($,X)){let J=X.force||X.overwrite;return{permission:"standard",risk:J?"medium":"low",reasons:["File operation",J?"May overwrite existing files":"Creates new files"],allowAutoApproval:!1,requiresConfirmation:!0}}if(this.isHighRisk($,X))return{permission:"bypass",risk:"high",reasons:["High-risk operation","Requires manual approval"],allowAutoApproval:!1,requiresConfirmation:!0};return{permission:"standard",risk:"medium",reasons:["Unknown operation type","Requires confirmation"],allowAutoApproval:!1,requiresConfirmation:!0}}static isReadOnly($,X){if(["faf_score","faf_info","faf_formats","faf_check","faf_validate"].includes($))return!0;if(X.dryRun||X.validate||X.check)return!0;return!1}static isSafeConfig($,X){if(["faf_sync","faf_export","faf_convert"].includes($))return!0;return!1}static isFileOperation($,X){if(["faf_init","faf_auto","faf_edit","faf_migrate"].includes($))return!0;if(X.output||X.write||X.save)return!0;return!1}static isHighRisk($,X){if(["faf_compile","faf_execute","faf_deploy"].includes($))return!0;if(X.execute||X.deploy||X.publish)return!0;if(X.force&&(X.overwrite||X.delete))return!0;return!1}static getRequiredPermission($,X){let J=$.permission;if(X.hasExistingFiles&&J==="standard")J="auto";if(X.isProduction&&J<"standard")J="standard";return J}static shouldConfirm($,X){if($.requiresConfirmation)return!0;let J=["plan","standard","auto","bypass"],Q=J.indexOf(X),q=J.indexOf($.permission);return Q<q}}class G3{handlers=new Map;register($,X){if(!this.handlers.has($))this.handlers.set($,[]);this.handlers.get($).push(X)}async execute($,X){let J=this.handlers.get($)||[];for(let Q of J){let q=await Q(X);if(q.action==="deny"||q.action==="ask")return q;if(q.action==="defer")continue;if(q.modifiedInput)X.input=q.modifiedInput}return{action:"allow"}}}class n2{static preToolUse=async($)=>{let X=y9.classify($.toolName,$.input),J=["plan","standard","auto","bypass"],Q=J.indexOf(X.permission);if(!(J.indexOf($.context.permissionMode)>=Q))return{action:"deny",reason:`Insufficient permissions. Required: ${X.permission}, Current: ${$.context.permissionMode}`};if(X.risk==="high"&&!$.context.dryRun)return{action:"ask",reason:`High-risk operation detected: ${X.reasons.join(", ")}`};if($.input.force&&$.toolName==="faf_init")return{action:"ask",reason:"This will overwrite existing project.faf file"};return{action:"allow"}};static postEdit=async($)=>{let X=[".ts",".js",".py",".md",".json",".yaml",".toml"],J=$.metadata?.fileName||"";if(!X.some((q)=>J.endsWith(q)))return{action:"allow"};if(J!=="project.faf"&&J!=="CLAUDE.md")try{return{action:"allow",additionalContext:"Triggered auto-sync of project context due to file changes"}}catch(q){return{action:"allow",reason:"Auto-sync failed but continuing"}}return{action:"allow"}};static sessionStart=async($)=>{let X=$.metadata?.hasProjectFaf||!1,J=$.metadata?.hasClaude||!1;if(!X&&!J)return{action:"allow",additionalContext:"No FAF context detected. Run /faf-quickstart to initialize AI-ready project context."};if(X&&J)return{action:"allow",additionalContext:"FAF bi-sync active. Context automatically synchronized between .faf and CLAUDE.md."};return{action:"allow"}};static sessionEnd=async($)=>{if($.metadata?.hasIncompleteInterview)return{action:"allow",additionalContext:'FAF interview state saved. Resume with "faf go --resume"'};return{action:"allow",additionalContext:"FAF session state preserved for next interaction"}}}function W3(){let $=new G3;return $.register("pre-tool-use",n2.preToolUse),$.register("post-edit",n2.postEdit),$.register("session-start",n2.sessionStart),$.register("session-end",n2.sessionEnd),$}import{existsSync as H3}from"fs";import{join as U3}from"path";class g9{server;hooks;config;constructor($){if(this.config={workingDirectory:$.workingDirectory,permissionMode:$.permissionMode||"standard",telemetryEnabled:$.telemetryEnabled??!0,sessionId:$.sessionId||this.generateSessionId(),userId:$.userId||"anonymous",dryRun:$.dryRun??!1,enableHooks:$.enableHooks??!0},this.server=new x9({permissionMode:this.config.permissionMode,telemetryEnabled:this.config.telemetryEnabled,workingDirectory:this.config.workingDirectory,sessionId:this.config.sessionId,userId:this.config.userId,dryRun:this.config.dryRun}),this.config.enableHooks)this.hooks=W3(),this.initializeSession()}getServer(){return this.server}async executeTool($,X){if(this.hooks){let Q=await this.hooks.execute("pre-tool-use",{toolName:$,input:X,context:{workingDirectory:this.config.workingDirectory,permissionMode:this.config.permissionMode,telemetry:this.config.telemetryEnabled,sessionId:this.config.sessionId,userId:this.config.userId,dryRun:this.config.dryRun}});if(Q.action==="deny")throw Error(`Tool execution denied: ${Q.reason}`);if(Q.action==="ask")console.log(`⚠️ Confirmation required: ${Q.reason}`);if(Q.modifiedInput)X=Q.modifiedInput}let J=await this.server.callTool($,X);if(this.hooks&&!J.isError)await this.hooks.execute("post-tool-use",{toolName:$,input:X,context:{workingDirectory:this.config.workingDirectory,permissionMode:this.config.permissionMode,telemetry:this.config.telemetryEnabled,sessionId:this.config.sessionId,userId:this.config.userId,dryRun:this.config.dryRun},metadata:{result:J}});return J}async getAvailableTools(){return(await this.server.listTools()).filter((X)=>{let J=X.permissions[0];return this.hasPermission(J)})}hasPermission($){let X=["plan","standard","auto","bypass"],J=X.indexOf(this.config.permissionMode),Q=X.indexOf($);return J>=Q}async initializeSession(){if(!this.hooks)return;let $=H3(U3(this.config.workingDirectory,"project.faf")),X=H3(U3(this.config.workingDirectory,"CLAUDE.md"));await this.hooks.execute("session-start",{toolName:"session_init",input:{},context:{workingDirectory:this.config.workingDirectory,permissionMode:this.config.permissionMode,telemetry:this.config.telemetryEnabled,sessionId:this.config.sessionId,userId:this.config.userId,dryRun:this.config.dryRun},metadata:{hasProjectFaf:$,hasClaude:X}})}async finalizeSession(){if(!this.hooks)return;await this.hooks.execute("session-end",{toolName:"session_end",input:{},context:{workingDirectory:this.config.workingDirectory,permissionMode:this.config.permissionMode,telemetry:this.config.telemetryEnabled,sessionId:this.config.sessionId,userId:this.config.userId,dryRun:this.config.dryRun},metadata:{hasIncompleteInterview:!1}})}generateSessionId(){return`faf_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}async getStatus(){let $=await this.server.getInfo(),X=await this.getAvailableTools();return{server:$,hooks:!!this.hooks,permissions:this.config.permissionMode,tools:X.length,session:this.config.sessionId}}}e();async function V3($={}){let X=process.cwd(),J="standard";if($.permission)switch($.permission.toLowerCase()){case"plan":J="plan";break;case"standard":J="standard";break;case"auto":J="auto";break;case"bypass":J="bypass";break;default:console.log(`${A("!")} Unknown permission level: ${$.permission}`);return}console.log(`${A("◆")} Testing Claude Code MCP Native Integration...`),console.log(`${O(" Working Directory:")} ${X}`),console.log(`${O(" Permission Level:")} ${J}`),console.log("");let Q=new g9({workingDirectory:X,permissionMode:J,dryRun:$.dryRun||!1,enableHooks:$.hooks!==!1,telemetryEnabled:!0});try{if($.status){let q=await Q.getStatus();console.log(`${S("Integration Status:")}`),console.log(` Server: ${q.server.name} v${q.server.version}`),console.log(` Tools Available: ${q.tools}`),console.log(` Hooks Enabled: ${q.hooks?"Yes":"No"}`),console.log(` Permission Mode: ${q.permissions}`),console.log(` Session ID: ${q.session}`),console.log("")}if($.tool){console.log(`${S("Testing Tool:")} ${$.tool}`);let q={};if($.tool==="faf_score")q={verbose:!0};else if($.tool==="faf_init")q={yolo:!0,dryRun:$.dryRun};else if($.tool==="faf_sync")q={direction:"auto"};let Y=await Q.executeTool($.tool,q);if(Y.isError)console.log(`${A("✗")} Error: ${Y.content[0].text}`);else console.log(`${A("✓")} Success:`),console.log(Y.content[0].text);console.log("")}else{let q=await Q.getAvailableTools();console.log(`${S("Available Tools:")}`);for(let Y of q){let z=Y.permissions.join(", "),G=Y.tags.join(", ");console.log(` ${S(Y.name)} - ${Y.description}`),console.log(` ${O("Permissions:")} ${z}`),console.log(` ${O("Tags:")} ${G}`)}console.log("");for(let Y of q.slice(0,2)){console.log(`${A("→")} Testing ${Y.name}...`);try{let z={};if(Y.name==="faf_score")z={status:!0};else if(Y.name==="faf_init")z={yolo:!0,dryRun:!0};else if(Y.name==="faf_sync")z={direction:"auto"};let G=await Q.executeTool(Y.name,z);if(G.isError)console.log(` ${A("✗")} ${G.content[0].text.split("\\n")[0]}`);else console.log(` ${A("✓")} Success`)}catch(z){console.log(` ${A("✗")} ${z instanceof Error?z.message:String(z)}`)}}}await Q.finalizeSession(),console.log(`${A("✓")} MCP integration test completed`),console.log(""),console.log(`${O("Next steps:")}`),console.log(` • Run ${S("faf claude-sync")} to sync with Claude Code skills`),console.log(` • Use ${S("/faf-champion")} skill in Claude Code for guided setup`),console.log(` • Configure ${S("claude.json")} for team-wide MCP integration`)}catch(q){console.error(`${A("✗")} MCP test failed:`,q),process.exit(1)}}import{readFileSync as $L}from"fs";var{version:XL}=JSON.parse($L(new URL("../package.json",import.meta.url),"utf8")),p=new R8;p.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(XL,"-v, --version");p.command("init").description("Create .faf from your project").option("--yolo","Quick init with sensible defaults").option("--quick","Alias for --yolo").option("--force","Overwrite existing project.faf").option("--output <path>","Output path").action(($)=>t6($));p.command("auto").description("Zero to 100% in one command").action(()=>q7());p.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>kY($));p.command("score [file]").description("Score a .faf file").option("--verbose","Show slot breakdown").option("--status","Compact one-liner output").option("--json","Output as JSON").action(($,X)=>o6($,X));p.command("sync").description(".faf ↔ CLAUDE.md (bi-sync, mtime auto-direction)").option("--watch","Watch for changes").option("--direction <dir>","Force direction: auto|push|pull","auto").action(($)=>e6($));p.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,X)=>nq($,X));p.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,X)=>rq($,X));p.command("git <url>").description("Instant .faf from any GitHub repo").option("--keep","Keep the cloned repo in cwd — enables faf auto to read README, Dockerfile, etc.").action(($,X)=>X1($,X));p.command("export").description("Export context files from .faf").option("--agents","Generate AGENTS.md").option("--cursor","Generate .cursorrules").option("--gemini","Generate GEMINI.md").option("--conductor","Generate conductor config").option("--all","Generate all formats").action(($)=>$2($));p.command("check [file]").description("Validate .faf file").option("--strict","Require 100% score").option("--fix","Auto-fix issues").option("--doctor","Full diagnostic").option("--trust","Verify trust chain").action(($,X)=>U7($,X));p.command("info").description("Show version and system info").option("--version","Show version").option("--faq","Show FAQ").option("--index","Show command index").option("--stacks","Show supported stacks").action(($)=>Q1($));p.command("formats").description("Show supported formats").action(()=>q1());p.command("clear").description("Clear cached data").action(()=>Y1());p.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>z1($));p.command("context").description("Generate context output").action(()=>G1());p.command("drift").description("Check context drift").action(()=>H1());p.command("edit <path> <value>").description("Edit .faf fields").action(($,X)=>U1($,X));p.command("recover").description("Recover .faf from context files").action(()=>V1());p.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>B1($));p.command("pro [subcommand]").description("Pro features & licensing").action(($)=>S1($));p.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>j1($));p.command("demo").description("Demo walkthrough").action(()=>b1());p.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,X)=>P1($,X));p.command("taf").description("Test Archive Format receipt").option("--output <path>","Write receipt to file").action(($)=>f1($));p.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>xY($));p.command("conductor [subcommand] [path]").description("Conductor integration").action(($,X)=>vY($,X));p.addCommand(cY());p.addCommand(dY());p.command("skills-install").description("Install FAF skills package for Claude Code").action(()=>nY());p.command("mcp-test").description("Test Claude Code MCP native integration").option("--permission <level>","Permission level (plan|standard|auto|bypass)","standard").option("--tool <name>","Test specific tool").option("--dry-run","Dry run mode").option("--no-hooks","Disable hooks").option("--status","Show integration status").action(($)=>V3($));p.command("bi-sync",{hidden:!0}).action(()=>e6());p.command("status",{hidden:!0}).action(()=>o6(void 0,{status:!0}));p.command("agents",{hidden:!0}).action(()=>$2({agents:!0}));p.command("cursor",{hidden:!0}).action(()=>$2({cursor:!0}));p.command("gemini",{hidden:!0}).action(()=>$2({gemini:!0}));p.command("validate [file]",{hidden:!0}).action(($,X)=>U7($,X));p.command("yolo",{hidden:!0}).action(()=>t6({yolo:!0}));if(process.argv.length<=2){let{autoCommand:$}=await Promise.resolve().then(() => (Y7(),vq));await $(),process.exit(0)}p.parse(process.argv);