@pickled-dev/cli 0.8.0 → 0.9.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.
- package/dist/index.js +183 -225
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,245 +1,203 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var
|
|
4
|
-
`)}displayWidth(
|
|
5
|
-
`+" ".repeat(Q
|
|
6
|
-
${
|
|
7
|
-
`)}}function
|
|
3
|
+
var s4=Object.create;var{getPrototypeOf:r4,defineProperty:s1,getOwnPropertyNames:n4}=Object;var o4=Object.prototype.hasOwnProperty;function t4(q){return this[q]}var e4,q5,r1=(q,$,X)=>{var Z=q!=null&&typeof q==="object";if(Z){var H=$?e4??=new WeakMap:q5??=new WeakMap,z=H.get(q);if(z)return z}X=q!=null?s4(r4(q)):{};let U=$||!q||!q.__esModule?s1(X,"default",{value:q,enumerable:!0}):X;for(let Q of n4(q))if(!o4.call(U,Q))s1(U,Q,{get:t4.bind(q,Q),enumerable:!0});if(Z)H.set(q,U);return U};var I=(q,$)=>()=>($||q(($={exports:{}}).exports,$),$.exports);var c=import.meta.require;var E0=I(($5)=>{class J$ extends Error{constructor(q,$,X){super(X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=$,this.exitCode=q,this.nestedError=void 0}}class n1 extends J${constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}$5.CommanderError=J$;$5.InvalidArgumentError=n1});var Hq=I((U5)=>{var{InvalidArgumentError:H5}=E0();class o1{constructor(q,$){switch(this.description=$||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(q,$){if($===this.defaultValue||!Array.isArray($))return[q];return $.push(q),$}default(q,$){return this.defaultValue=q,this.defaultValueDescription=$,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=($,X)=>{if(!this.argChoices.includes($))throw new H5(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,X);return $},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function z5(q){let $=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+$+">":"["+$+"]"}U5.Argument=o1;U5.humanReadableArgName=z5});var T$=I((T5)=>{var{humanReadableArgName:J5}=Hq();class t1{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let $=q.commands.filter((Z)=>!Z._hidden),X=q._getHelpCommand();if(X&&!X._hidden)$.push(X);if(this.sortSubcommands)$.sort((Z,H)=>{return Z.name().localeCompare(H.name())});return $}compareOptions(q,$){let X=(Z)=>{return Z.short?Z.short.replace(/^-/,""):Z.long.replace(/^--/,"")};return X(q).localeCompare(X($))}visibleOptions(q){let $=q.options.filter((Z)=>!Z.hidden),X=q._getHelpOption();if(X&&!X.hidden){let Z=X.short&&q._findOption(X.short),H=X.long&&q._findOption(X.long);if(!Z&&!H)$.push(X);else if(X.long&&!H)$.push(q.createOption(X.long,X.description));else if(X.short&&!Z)$.push(q.createOption(X.short,X.description))}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let $=[];for(let X=q.parent;X;X=X.parent){let Z=X.options.filter((H)=>!H.hidden);$.push(...Z)}if(this.sortOptions)$.sort(this.compareOptions);return $}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach(($)=>{$.description=$.description||q._argsDescription[$.name()]||""});if(q.registeredArguments.find(($)=>$.description))return q.registeredArguments;return[]}subcommandTerm(q){let $=q.registeredArguments.map((X)=>J5(X)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+($?" "+$:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,$){return $.visibleCommands(q).reduce((X,Z)=>{return Math.max(X,this.displayWidth($.styleSubcommandTerm($.subcommandTerm(Z))))},0)}longestOptionTermLength(q,$){return $.visibleOptions(q).reduce((X,Z)=>{return Math.max(X,this.displayWidth($.styleOptionTerm($.optionTerm(Z))))},0)}longestGlobalOptionTermLength(q,$){return $.visibleGlobalOptions(q).reduce((X,Z)=>{return Math.max(X,this.displayWidth($.styleOptionTerm($.optionTerm(Z))))},0)}longestArgumentTermLength(q,$){return $.visibleArguments(q).reduce((X,Z)=>{return Math.max(X,this.displayWidth($.styleArgumentTerm($.argumentTerm(Z))))},0)}commandUsage(q){let $=q._name;if(q._aliases[0])$=$+"|"+q._aliases[0];let X="";for(let Z=q.parent;Z;Z=Z.parent)X=Z.name()+" "+X;return X+$+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let $=[];if(q.argChoices)$.push(`choices: ${q.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")$.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)$.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)$.push(`env: ${q.envVar}`);if($.length>0){let X=`(${$.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}argumentDescription(q){let $=[];if(q.argChoices)$.push(`choices: ${q.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if(q.defaultValue!==void 0)$.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if($.length>0){let X=`(${$.join(", ")})`;if(q.description)return`${q.description} ${X}`;return X}return q.description}formatItemList(q,$,X){if($.length===0)return[];return[X.styleTitle(q),...$,""]}groupItems(q,$,X){let Z=new Map;return q.forEach((H)=>{let z=X(H);if(!Z.has(z))Z.set(z,[])}),$.forEach((H)=>{let z=X(H);if(!Z.has(z))Z.set(z,[]);Z.get(z).push(H)}),Z}formatHelp(q,$){let X=$.padWidth(q,$),Z=$.helpWidth??80;function H(Y,T){return $.formatItem(Y,X,T,$)}let z=[`${$.styleTitle("Usage:")} ${$.styleUsage($.commandUsage(q))}`,""],U=$.commandDescription(q);if(U.length>0)z=z.concat([$.boxWrap($.styleCommandDescription(U),Z),""]);let Q=$.visibleArguments(q).map((Y)=>{return H($.styleArgumentTerm($.argumentTerm(Y)),$.styleArgumentDescription($.argumentDescription(Y)))});if(z=z.concat(this.formatItemList("Arguments:",Q,$)),this.groupItems(q.options,$.visibleOptions(q),(Y)=>Y.helpGroupHeading??"Options:").forEach((Y,T)=>{let L=Y.map((_)=>{return H($.styleOptionTerm($.optionTerm(_)),$.styleOptionDescription($.optionDescription(_)))});z=z.concat(this.formatItemList(T,L,$))}),$.showGlobalOptions){let Y=$.visibleGlobalOptions(q).map((T)=>{return H($.styleOptionTerm($.optionTerm(T)),$.styleOptionDescription($.optionDescription(T)))});z=z.concat(this.formatItemList("Global Options:",Y,$))}return this.groupItems(q.commands,$.visibleCommands(q),(Y)=>Y.helpGroup()||"Commands:").forEach((Y,T)=>{let L=Y.map((_)=>{return H($.styleSubcommandTerm($.subcommandTerm(_)),$.styleSubcommandDescription($.subcommandDescription(_)))});z=z.concat(this.formatItemList(T,L,$))}),z.join(`
|
|
4
|
+
`)}displayWidth(q){return e1(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map(($)=>{if($==="[options]")return this.styleOptionText($);if($==="[command]")return this.styleSubcommandText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleCommandText($)}).join(" ")}styleCommandDescription(q){return this.styleDescriptionText(q)}styleOptionDescription(q){return this.styleDescriptionText(q)}styleSubcommandDescription(q){return this.styleDescriptionText(q)}styleArgumentDescription(q){return this.styleDescriptionText(q)}styleDescriptionText(q){return q}styleOptionTerm(q){return this.styleOptionText(q)}styleSubcommandTerm(q){return q.split(" ").map(($)=>{if($==="[options]")return this.styleOptionText($);if($[0]==="["||$[0]==="<")return this.styleArgumentText($);return this.styleSubcommandText($)}).join(" ")}styleArgumentTerm(q){return this.styleArgumentText(q)}styleOptionText(q){return q}styleArgumentText(q){return q}styleSubcommandText(q){return q}styleCommandText(q){return q}padWidth(q,$){return Math.max($.longestOptionTermLength(q,$),$.longestGlobalOptionTermLength(q,$),$.longestSubcommandTermLength(q,$),$.longestArgumentTermLength(q,$))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,$,X,Z){let z=" ".repeat(2);if(!X)return z+q;let U=q.padEnd($+q.length-Z.displayWidth(q)),Q=2,G=(this.helpWidth??80)-$-Q-2,Y;if(G<this.minWidthToWrap||Z.preformatted(X))Y=X;else Y=Z.boxWrap(X,G).replace(/\n/g,`
|
|
5
|
+
`+" ".repeat($+Q));return z+U+" ".repeat(Q)+Y.replace(/\n/g,`
|
|
6
|
+
${z}`)}boxWrap(q,$){if($<this.minWidthToWrap)return q;let X=q.split(/\r\n|\n/),Z=/[\s]*[^\s]+/g,H=[];return X.forEach((z)=>{let U=z.match(Z);if(U===null){H.push("");return}let Q=[U.shift()],J=this.displayWidth(Q[0]);U.forEach((G)=>{let Y=this.displayWidth(G);if(J+Y<=$){Q.push(G),J+=Y;return}H.push(Q.join(""));let T=G.trimStart();Q=[T],J=this.displayWidth(T)}),H.push(Q.join(""))}),H.join(`
|
|
7
|
+
`)}}function e1(q){let $=/\x1b\[\d*(;\d*)*m/g;return q.replace($,"")}T5.Help=t1;T5.stripColor=e1});var Y$=I((W5)=>{var{InvalidArgumentError:B5}=E0();class $2{constructor(q,$){this.flags=q,this.description=$||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let X=_5(q);if(this.short=X.shortFlag,this.long=X.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(q,$){return this.defaultValue=q,this.defaultValueDescription=$,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let $=q;if(typeof q==="string")$={[q]:!0};return this.implied=Object.assign(this.implied||{},$),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_collectValue(q,$){if($===this.defaultValue||!Array.isArray($))return[q];return $.push(q),$}choices(q){return this.argChoices=q.slice(),this.parseArg=($,X)=>{if(!this.argChoices.includes($))throw new B5(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue($,X);return $},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return q2(this.name().replace(/^no-/,""));return q2(this.name())}helpGroup(q){return this.helpGroupHeading=q,this}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class X2{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach(($)=>{if($.negate)this.negativeOptions.set($.attributeName(),$);else this.positiveOptions.set($.attributeName(),$)}),this.negativeOptions.forEach(($,X)=>{if(this.positiveOptions.has(X))this.dualOptions.add(X)})}valueFromOption(q,$){let X=$.attributeName();if(!this.dualOptions.has(X))return!0;let Z=this.negativeOptions.get(X).presetArg,H=Z!==void 0?Z:!1;return $.negate===(H===q)}}function q2(q){return q.split("-").reduce(($,X)=>{return $+X[0].toUpperCase()+X.slice(1)})}function _5(q){let $,X,Z=/^-[^-]$/,H=/^--[^-]/,z=q.split(/[ |,]+/).concat("guard");if(Z.test(z[0]))$=z.shift();if(H.test(z[0]))X=z.shift();if(!$&&Z.test(z[0]))$=z.shift();if(!$&&H.test(z[0]))$=X,X=z.shift();if(z[0].startsWith("-")){let U=z[0],Q=`option creation failed due to '${U}' in option flags '${q}'`;if(/^-[^-][^-]/.test(U))throw Error(`${Q}
|
|
8
8
|
- a short flag is a single dash and a single character
|
|
9
9
|
- either use a single dash and a single character (for a short flag)
|
|
10
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(
|
|
11
|
-
- too many short flags`);if(
|
|
12
|
-
- too many long flags`);throw Error(`${
|
|
13
|
-
- unrecognised flag format`)}if(
|
|
14
|
-
(Did you mean one of ${
|
|
15
|
-
(Did you mean ${
|
|
16
|
-
- specify the name in Command constructor or using .name()`);if(
|
|
17
|
-
Expecting one of '${
|
|
18
|
-
- already used by option '${
|
|
19
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(X
|
|
20
|
-
- if '${
|
|
10
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(Z.test(U))throw Error(`${Q}
|
|
11
|
+
- too many short flags`);if(H.test(U))throw Error(`${Q}
|
|
12
|
+
- too many long flags`);throw Error(`${Q}
|
|
13
|
+
- unrecognised flag format`)}if($===void 0&&X===void 0)throw Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:$,longFlag:X}}W5.Option=$2;W5.DualOptions=X2});var Z2=I((P5)=>{function D5(q,$){if(Math.abs(q.length-$.length)>3)return Math.max(q.length,$.length);let X=[];for(let Z=0;Z<=q.length;Z++)X[Z]=[Z];for(let Z=0;Z<=$.length;Z++)X[0][Z]=Z;for(let Z=1;Z<=$.length;Z++)for(let H=1;H<=q.length;H++){let z=1;if(q[H-1]===$[Z-1])z=0;else z=1;if(X[H][Z]=Math.min(X[H-1][Z]+1,X[H][Z-1]+1,X[H-1][Z-1]+z),H>1&&Z>1&&q[H-1]===$[Z-2]&&q[H-2]===$[Z-1])X[H][Z]=Math.min(X[H][Z],X[H-2][Z-2]+1)}return X[q.length][$.length]}function R5(q,$){if(!$||$.length===0)return"";$=Array.from(new Set($));let X=q.startsWith("--");if(X)q=q.slice(2),$=$.map((U)=>U.slice(2));let Z=[],H=3,z=0.4;if($.forEach((U)=>{if(U.length<=1)return;let Q=D5(q,U),J=Math.max(q.length,U.length);if((J-Q)/J>z){if(Q<H)H=Q,Z=[U];else if(Q===H)Z.push(U)}}),Z.sort((U,Q)=>U.localeCompare(Q)),X)Z=Z.map((U)=>`--${U}`);if(Z.length>1)return`
|
|
14
|
+
(Did you mean one of ${Z.join(", ")}?)`;if(Z.length===1)return`
|
|
15
|
+
(Did you mean ${Z[0]}?)`;return""}P5.suggestSimilar=R5});var Q2=I((j5)=>{var K5=c("events").EventEmitter,L$=c("child_process"),i=c("path"),zq=c("fs"),S=c("process"),{Argument:w5,humanReadableArgName:F5}=Hq(),{CommanderError:B$}=E0(),{Help:O5,stripColor:A5}=T$(),{Option:H2,DualOptions:S5}=Y$(),{suggestSimilar:z2}=Z2();class W$ extends K5{constructor(q){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=q||"",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:($)=>S.stdout.write($),writeErr:($)=>S.stderr.write($),outputError:($,X)=>X($),getOutHelpWidth:()=>S.stdout.isTTY?S.stdout.columns:void 0,getErrHelpWidth:()=>S.stderr.isTTY?S.stderr.columns:void 0,getOutHasColors:()=>_$()??(S.stdout.isTTY&&S.stdout.hasColors?.()),getErrHasColors:()=>_$()??(S.stderr.isTTY&&S.stderr.hasColors?.()),stripColor:($)=>A5($)},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(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let $=this;$;$=$.parent)q.push($);return q}command(q,$,X){let Z=$,H=X;if(typeof Z==="object"&&Z!==null)H=Z,Z=null;H=H||{};let[,z,U]=q.match(/([^ ]+) *(.*)/),Q=this.createCommand(z);if(Z)Q.description(Z),Q._executableHandler=!0;if(H.isDefault)this._defaultCommandName=Q._name;if(Q._hidden=!!(H.noHelp||H.hidden),Q._executableFile=H.executableFile||null,U)Q.arguments(U);if(this._registerCommand(Q),Q.parent=this,Q.copyInheritedSettings(this),Z)return this;return Q}createCommand(q){return new W$(q)}createHelp(){return Object.assign(new O5,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...q},this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,$){if(!q._name)throw Error(`Command passed to .addCommand() must have a name
|
|
16
|
+
- specify the name in Command constructor or using .name()`);if($=$||{},$.isDefault)this._defaultCommandName=q._name;if($.noHelp||$.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,$){return new w5(q,$)}argument(q,$,X,Z){let H=this.createArgument(q,$);if(typeof X==="function")H.default(Z).argParser(X);else H.default(X);return this.addArgument(H),this}arguments(q){return q.trim().split(/ +/).forEach(($)=>{this.argument($)}),this}addArgument(q){let $=this.registeredArguments.slice(-1)[0];if($?.variadic)throw Error(`only the last argument can be variadic '${$.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,$){if(typeof q==="boolean"){if(this._addImplicitHelpCommand=q,q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let X=q??"help [command]",[,Z,H]=X.match(/([^ ]+) *(.*)/),z=$??"display help for command",U=this.createCommand(Z);if(U.helpOption(!1),H)U.arguments(H);if(z)U.description(z);if(this._addImplicitHelpCommand=!0,this._helpCommand=U,q||$)this._initCommandGroup(U);return this}addHelpCommand(q,$){if(typeof q!=="object")return this.helpCommand(q,$),this;return this._addImplicitHelpCommand=!0,this._helpCommand=q,this._initCommandGroup(q),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(q,$){let X=["preSubcommand","preAction","postAction"];if(!X.includes(q))throw Error(`Unexpected value for event passed to hook : '${q}'.
|
|
17
|
+
Expecting one of '${X.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push($);else this._lifeCycleHooks[q]=[$];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=($)=>{if($.code!=="commander.executeSubCommandAsync")throw $};return this}_exit(q,$,X){if(this._exitCallback)this._exitCallback(new B$(q,$,X));S.exit(q)}action(q){let $=(X)=>{let Z=this.registeredArguments.length,H=X.slice(0,Z);if(this._storeOptionsAsProperties)H[Z]=this;else H[Z]=this.opts();return H.push(this),q.apply(this,H)};return this._actionHandler=$,this}createOption(q,$){return new H2(q,$)}_callParseArg(q,$,X,Z){try{return q.parseArg($,X)}catch(H){if(H.code==="commander.invalidArgument"){let z=`${Z} ${H.message}`;this.error(z,{exitCode:H.exitCode,code:H.code})}throw H}}_registerOption(q){let $=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if($){let X=q.long&&this._findOption(q.long)?q.long:q.short;throw Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${X}'
|
|
18
|
+
- already used by option '${$.flags}'`)}this._initOptionGroup(q),this.options.push(q)}_registerCommand(q){let $=(Z)=>{return[Z.name()].concat(Z.aliases())},X=$(q).find((Z)=>this._findCommand(Z));if(X){let Z=$(this._findCommand(X)).join("|"),H=$(q).join("|");throw Error(`cannot add command '${H}' as already have command '${Z}'`)}this._initCommandGroup(q),this.commands.push(q)}addOption(q){this._registerOption(q);let $=q.name(),X=q.attributeName();if(q.negate){let H=q.long.replace(/^--no-/,"--");if(!this._findOption(H))this.setOptionValueWithSource(X,q.defaultValue===void 0?!0:q.defaultValue,"default")}else if(q.defaultValue!==void 0)this.setOptionValueWithSource(X,q.defaultValue,"default");let Z=(H,z,U)=>{if(H==null&&q.presetArg!==void 0)H=q.presetArg;let Q=this.getOptionValue(X);if(H!==null&&q.parseArg)H=this._callParseArg(q,H,Q,z);else if(H!==null&&q.variadic)H=q._collectValue(H,Q);if(H==null)if(q.negate)H=!1;else if(q.isBoolean()||q.optional)H=!0;else H="";this.setOptionValueWithSource(X,H,U)};if(this.on("option:"+$,(H)=>{let z=`error: option '${q.flags}' argument '${H}' is invalid.`;Z(H,z,"cli")}),q.envVar)this.on("optionEnv:"+$,(H)=>{let z=`error: option '${q.flags}' value '${H}' from env '${q.envVar}' is invalid.`;Z(H,z,"env")});return this}_optionEx(q,$,X,Z,H){if(typeof $==="object"&&$ instanceof H2)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let z=this.createOption($,X);if(z.makeOptionMandatory(!!q.mandatory),typeof Z==="function")z.default(H).argParser(Z);else if(Z instanceof RegExp){let U=Z;Z=(Q,J)=>{let G=U.exec(Q);return G?G[0]:J},z.default(H).argParser(Z)}else z.default(Z);return this.addOption(z)}option(q,$,X,Z){return this._optionEx({},q,$,X,Z)}requiredOption(q,$,X,Z){return this._optionEx({mandatory:!0},q,$,X,Z)}combineFlagAndOptionalValue(q=!0){return this._combineFlagAndOptionalValue=!!q,this}allowUnknownOption(q=!0){return this._allowUnknownOption=!!q,this}allowExcessArguments(q=!0){return this._allowExcessArguments=!!q,this}enablePositionalOptions(q=!0){return this._enablePositionalOptions=!!q,this}passThroughOptions(q=!0){return this._passThroughOptions=!!q,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(q=!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=!!q,this}getOptionValue(q){if(this._storeOptionsAsProperties)return this[q];return this._optionValues[q]}setOptionValue(q,$){return this.setOptionValueWithSource(q,$,void 0)}setOptionValueWithSource(q,$,X){if(this._storeOptionsAsProperties)this[q]=$;else this._optionValues[q]=$;return this._optionValueSources[q]=X,this}getOptionValueSource(q){return this._optionValueSources[q]}getOptionValueSourceWithGlobals(q){let $;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource(q)!==void 0)$=X.getOptionValueSource(q)}),$}_prepareUserArgs(q,$){if(q!==void 0&&!Array.isArray(q))throw Error("first parameter to parse must be array or undefined");if($=$||{},q===void 0&&$.from===void 0){if(S.versions?.electron)$.from="electron";let Z=S.execArgv??[];if(Z.includes("-e")||Z.includes("--eval")||Z.includes("-p")||Z.includes("--print"))$.from="eval"}if(q===void 0)q=S.argv;this.rawArgs=q.slice();let X;switch($.from){case void 0:case"node":this._scriptPath=q[1],X=q.slice(2);break;case"electron":if(S.defaultApp)this._scriptPath=q[1],X=q.slice(2);else X=q.slice(1);break;case"user":X=q.slice(0);break;case"eval":X=q.slice(1);break;default:throw Error(`unexpected parse option { from: '${$.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",X}parse(q,$){this._prepareForParse();let X=this._prepareUserArgs(q,$);return this._parseCommand([],X),this}async parseAsync(q,$){this._prepareForParse();let X=this._prepareUserArgs(q,$);return await this._parseCommand([],X),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
19
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(q,$,X){if(zq.existsSync(q))return;let Z=$?`searched for local subcommand relative to directory '${$}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",H=`'${q}' does not exist
|
|
20
|
+
- if '${X}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
21
21
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
22
|
-
- ${
|
|
22
|
+
- ${Z}`;throw Error(H)}_executeSubCommand(q,$){$=$.slice();let X=!1,Z=[".js",".ts",".tsx",".mjs",".cjs"];function H(G,Y){let T=i.resolve(G,Y);if(zq.existsSync(T))return T;if(Z.includes(i.extname(Y)))return;let L=Z.find((_)=>zq.existsSync(`${T}${_}`));if(L)return`${T}${L}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let z=q._executableFile||`${this._name}-${q._name}`,U=this._executableDir||"";if(this._scriptPath){let G;try{G=zq.realpathSync(this._scriptPath)}catch{G=this._scriptPath}U=i.resolve(i.dirname(G),U)}if(U){let G=H(U,z);if(!G&&!q._executableFile&&this._scriptPath){let Y=i.basename(this._scriptPath,i.extname(this._scriptPath));if(Y!==this._name)G=H(U,`${Y}-${q._name}`)}z=G||z}X=Z.includes(i.extname(z));let Q;if(S.platform!=="win32")if(X)$.unshift(z),$=U2(S.execArgv).concat($),Q=L$.spawn(S.argv[0],$,{stdio:"inherit"});else Q=L$.spawn(z,$,{stdio:"inherit"});else this._checkForMissingExecutable(z,U,q._name),$.unshift(z),$=U2(S.execArgv).concat($),Q=L$.spawn(S.execPath,$,{stdio:"inherit"});if(!Q.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((Y)=>{S.on(Y,()=>{if(Q.killed===!1&&Q.exitCode===null)Q.kill(Y)})});let J=this._exitCallback;Q.on("close",(G)=>{if(G=G??1,!J)S.exit(G);else J(new B$(G,"commander.executeSubCommandAsync","(close)"))}),Q.on("error",(G)=>{if(G.code==="ENOENT")this._checkForMissingExecutable(z,U,q._name);else if(G.code==="EACCES")throw Error(`'${z}' not executable`);if(!J)S.exit(1);else{let Y=new B$(1,"commander.executeSubCommandAsync","(error)");Y.nestedError=G,J(Y)}}),this.runningCommand=Q}_dispatchSubcommand(q,$,X){let Z=this._findCommand(q);if(!Z)this.help({error:!0});Z._prepareForParse();let H;return H=this._chainOrCallSubCommandHook(H,Z,"preSubcommand"),H=this._chainOrCall(H,()=>{if(Z._executableHandler)this._executeSubCommand(Z,$.concat(X));else return Z._parseCommand($,X)}),H}_dispatchHelpCommand(q){if(!q)this.help();let $=this._findCommand(q);if($&&!$._executableHandler)$.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,$)=>{if(q.required&&this.args[$]==null)this.missingArgument(q.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 q=(X,Z,H)=>{let z=Z;if(Z!==null&&X.parseArg){let U=`error: command-argument value '${Z}' is invalid for argument '${X.name()}'.`;z=this._callParseArg(X,Z,H,U)}return z};this._checkNumberOfArguments();let $=[];this.registeredArguments.forEach((X,Z)=>{let H=X.defaultValue;if(X.variadic){if(Z<this.args.length){if(H=this.args.slice(Z),X.parseArg)H=H.reduce((z,U)=>{return q(X,U,z)},X.defaultValue)}else if(H===void 0)H=[]}else if(Z<this.args.length){if(H=this.args[Z],X.parseArg)H=q(X,H,X.defaultValue)}$[Z]=H}),this.processedArgs=$}_chainOrCall(q,$){if(q?.then&&typeof q.then==="function")return q.then(()=>$());return $()}_chainOrCallHooks(q,$){let X=q,Z=[];if(this._getCommandAndAncestors().reverse().filter((H)=>H._lifeCycleHooks[$]!==void 0).forEach((H)=>{H._lifeCycleHooks[$].forEach((z)=>{Z.push({hookedCommand:H,callback:z})})}),$==="postAction")Z.reverse();return Z.forEach((H)=>{X=this._chainOrCall(X,()=>{return H.callback(H.hookedCommand,this)})}),X}_chainOrCallSubCommandHook(q,$,X){let Z=q;if(this._lifeCycleHooks[X]!==void 0)this._lifeCycleHooks[X].forEach((H)=>{Z=this._chainOrCall(Z,()=>{return H(this,$)})});return Z}_parseCommand(q,$){let X=this.parseOptions($);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(X.operands),$=X.unknown,this.args=q.concat($),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),$);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested($),this._dispatchSubcommand(this._defaultCommandName,q,$);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(X.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let Z=()=>{if(X.unknown.length>0)this.unknownOption(X.unknown[0])},H=`command:${this.name()}`;if(this._actionHandler){Z(),this._processArguments();let z;if(z=this._chainOrCallHooks(z,"preAction"),z=this._chainOrCall(z,()=>this._actionHandler(this.processedArgs)),this.parent)z=this._chainOrCall(z,()=>{this.parent.emit(H,q,$)});return z=this._chainOrCallHooks(z,"postAction"),z}if(this.parent?.listenerCount(H))Z(),this._processArguments(),this.parent.emit(H,q,$);else if(q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",q,$);if(this.listenerCount("command:*"))this.emit("command:*",q,$);else if(this.commands.length)this.unknownCommand();else Z(),this._processArguments()}else if(this.commands.length)Z(),this.help({error:!0});else Z(),this._processArguments()}_findCommand(q){if(!q)return;return this.commands.find(($)=>$._name===q||$._aliases.includes(q))}_findOption(q){return this.options.find(($)=>$.is(q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((q)=>{q.options.forEach(($)=>{if($.mandatory&&q.getOptionValue($.attributeName())===void 0)q.missingMandatoryOptionValue($)})})}_checkForConflictingLocalOptions(){let q=this.options.filter((X)=>{let Z=X.attributeName();if(this.getOptionValue(Z)===void 0)return!1;return this.getOptionValueSource(Z)!=="default"});q.filter((X)=>X.conflictsWith.length>0).forEach((X)=>{let Z=q.find((H)=>X.conflictsWith.includes(H.attributeName()));if(Z)this._conflictingOption(X,Z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((q)=>{q._checkForConflictingLocalOptions()})}parseOptions(q){let $=[],X=[],Z=$;function H(G){return G.length>1&&G[0]==="-"}let z=(G)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(G))return!1;return!this._getCommandAndAncestors().some((Y)=>Y.options.map((T)=>T.short).some((T)=>/^-\d$/.test(T)))},U=null,Q=null,J=0;while(J<q.length||Q){let G=Q??q[J++];if(Q=null,G==="--"){if(Z===X)Z.push(G);Z.push(...q.slice(J));break}if(U&&(!H(G)||z(G))){this.emit(`option:${U.name()}`,G);continue}if(U=null,H(G)){let Y=this._findOption(G);if(Y){if(Y.required){let T=q[J++];if(T===void 0)this.optionMissingArgument(Y);this.emit(`option:${Y.name()}`,T)}else if(Y.optional){let T=null;if(J<q.length&&(!H(q[J])||z(q[J])))T=q[J++];this.emit(`option:${Y.name()}`,T)}else this.emit(`option:${Y.name()}`);U=Y.variadic?Y:null;continue}}if(G.length>2&&G[0]==="-"&&G[1]!=="-"){let Y=this._findOption(`-${G[1]}`);if(Y){if(Y.required||Y.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${Y.name()}`,G.slice(2));else this.emit(`option:${Y.name()}`),Q=`-${G.slice(2)}`;continue}}if(/^--[^=]+=/.test(G)){let Y=G.indexOf("="),T=this._findOption(G.slice(0,Y));if(T&&(T.required||T.optional)){this.emit(`option:${T.name()}`,G.slice(Y+1));continue}}if(Z===$&&H(G)&&!(this.commands.length===0&&z(G)))Z=X;if((this._enablePositionalOptions||this._passThroughOptions)&&$.length===0&&X.length===0){if(this._findCommand(G)){$.push(G),X.push(...q.slice(J));break}else if(this._getHelpCommand()&&G===this._getHelpCommand().name()){$.push(G,...q.slice(J));break}else if(this._defaultCommandName){X.push(G,...q.slice(J));break}}if(this._passThroughOptions){Z.push(G,...q.slice(J));break}Z.push(G)}return{operands:$,unknown:X}}opts(){if(this._storeOptionsAsProperties){let q={},$=this.options.length;for(let X=0;X<$;X++){let Z=this.options[X].attributeName();q[Z]=Z===this._versionOptionName?this._version:this[Z]}return q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((q,$)=>Object.assign(q,$.opts()),{})}error(q,$){if(this._outputConfiguration.outputError(`${q}
|
|
23
23
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
24
24
|
`);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
|
|
25
|
-
`),this.outputHelp({error:!0});let
|
|
26
|
-
`),this._exit(0,"commander.version",
|
|
27
|
-
Expecting one of '${
|
|
28
|
-
`)}),this}_outputHelpIfRequested(
|
|
29
|
-
`)}}
|
|
30
|
-
`)?
|
|
25
|
+
`),this.outputHelp({error:!0});let X=$||{},Z=X.exitCode||1,H=X.code||"commander.error";this._exit(Z,H,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in S.env){let $=q.attributeName();if(this.getOptionValue($)===void 0||["default","config","env"].includes(this.getOptionValueSource($)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,S.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new S5(this.options),$=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&$(X.attributeName())&&q.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((Z)=>!$(Z)).forEach((Z)=>{this.setOptionValueWithSource(Z,X.implied[Z],"implied")})})}missingArgument(q){let $=`error: missing required argument '${q}'`;this.error($,{code:"commander.missingArgument"})}optionMissingArgument(q){let $=`error: option '${q.flags}' argument missing`;this.error($,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let $=`error: required option '${q.flags}' not specified`;this.error($,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,$){let X=(z)=>{let U=z.attributeName(),Q=this.getOptionValue(U),J=this.options.find((Y)=>Y.negate&&U===Y.attributeName()),G=this.options.find((Y)=>!Y.negate&&U===Y.attributeName());if(J&&(J.presetArg===void 0&&Q===!1||J.presetArg!==void 0&&Q===J.presetArg))return J;return G||z},Z=(z)=>{let U=X(z),Q=U.attributeName();if(this.getOptionValueSource(Q)==="env")return`environment variable '${U.envVar}'`;return`option '${U.flags}'`},H=`error: ${Z(q)} cannot be used with ${Z($)}`;this.error(H,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let $="";if(q.startsWith("--")&&this._showSuggestionAfterError){let Z=[],H=this;do{let z=H.createHelp().visibleOptions(H).filter((U)=>U.long).map((U)=>U.long);Z=Z.concat(z),H=H.parent}while(H&&!H._enablePositionalOptions);$=z2(q,Z)}let X=`error: unknown option '${q}'${$}`;this.error(X,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let $=this.registeredArguments.length,X=$===1?"":"s",H=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${$} argument${X} but got ${q.length}.`;this.error(H,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],$="";if(this._showSuggestionAfterError){let Z=[];this.createHelp().visibleCommands(this).forEach((H)=>{if(Z.push(H.name()),H.alias())Z.push(H.alias())}),$=z2(q,Z)}let X=`error: unknown command '${q}'${$}`;this.error(X,{code:"commander.unknownCommand"})}version(q,$,X){if(q===void 0)return this._version;this._version=q,$=$||"-V, --version",X=X||"output the version number";let Z=this.createOption($,X);return this._versionOptionName=Z.attributeName(),this._registerOption(Z),this.on("option:"+Z.name(),()=>{this._outputConfiguration.writeOut(`${q}
|
|
26
|
+
`),this._exit(0,"commander.version",q)}),this}description(q,$){if(q===void 0&&$===void 0)return this._description;if(this._description=q,$)this._argsDescription=$;return this}summary(q){if(q===void 0)return this._summary;return this._summary=q,this}alias(q){if(q===void 0)return this._aliases[0];let $=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)$=this.commands[this.commands.length-1];if(q===$._name)throw Error("Command alias can't be the same as its name");let X=this.parent?._findCommand(q);if(X){let Z=[X.name()].concat(X.aliases()).join("|");throw Error(`cannot add alias '${q}' to command '${this.name()}' as already have command '${Z}'`)}return $._aliases.push(q),this}aliases(q){if(q===void 0)return this._aliases;return q.forEach(($)=>this.alias($)),this}usage(q){if(q===void 0){if(this._usage)return this._usage;let $=this.registeredArguments.map((X)=>{return F5(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?$:[]).join(" ")}return this._usage=q,this}name(q){if(q===void 0)return this._name;return this._name=q,this}helpGroup(q){if(q===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=q,this}commandsGroup(q){if(q===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=q,this}optionsGroup(q){if(q===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=q,this}_initOptionGroup(q){if(this._defaultOptionGroup&&!q.helpGroupHeading)q.helpGroup(this._defaultOptionGroup)}_initCommandGroup(q){if(this._defaultCommandGroup&&!q.helpGroup())q.helpGroup(this._defaultCommandGroup)}nameFromFilename(q){return this._name=i.basename(q,i.extname(q)),this}executableDir(q){if(q===void 0)return this._executableDir;return this._executableDir=q,this}helpInformation(q){let $=this.createHelp(),X=this._getOutputContext(q);$.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let Z=$.formatHelp(this,$);if(X.hasColors)return Z;return this._outputConfiguration.stripColor(Z)}_getOutputContext(q){q=q||{};let $=!!q.error,X,Z,H;if($)X=(U)=>this._outputConfiguration.writeErr(U),Z=this._outputConfiguration.getErrHasColors(),H=this._outputConfiguration.getErrHelpWidth();else X=(U)=>this._outputConfiguration.writeOut(U),Z=this._outputConfiguration.getOutHasColors(),H=this._outputConfiguration.getOutHelpWidth();return{error:$,write:(U)=>{if(!Z)U=this._outputConfiguration.stripColor(U);return X(U)},hasColors:Z,helpWidth:H}}outputHelp(q){let $;if(typeof q==="function")$=q,q=void 0;let X=this._getOutputContext(q),Z={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((z)=>z.emit("beforeAllHelp",Z)),this.emit("beforeHelp",Z);let H=this.helpInformation({error:X.error});if($){if(H=$(H),typeof H!=="string"&&!Buffer.isBuffer(H))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write(H),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",Z),this._getCommandAndAncestors().forEach((z)=>z.emit("afterAllHelp",Z))}helpOption(q,$){if(typeof q==="boolean"){if(q){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(q??"-h, --help",$??"display help for command"),q||$)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(q){return this._helpOption=q,this._initOptionGroup(q),this}help(q){this.outputHelp(q);let $=Number(S.exitCode??0);if($===0&&q&&typeof q!=="function"&&q.error)$=1;this._exit($,"commander.help","(outputHelp)")}addHelpText(q,$){let X=["beforeAll","before","after","afterAll"];if(!X.includes(q))throw Error(`Unexpected value for position to addHelpText.
|
|
27
|
+
Expecting one of '${X.join("', '")}'`);let Z=`${q}Help`;return this.on(Z,(H)=>{let z;if(typeof $==="function")z=$({error:H.error,command:H.command});else z=$;if(z)H.write(`${z}
|
|
28
|
+
`)}),this}_outputHelpIfRequested(q){let $=this._getHelpOption();if($&&q.find((Z)=>$.is(Z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function U2(q){return q.map(($)=>{if(!$.startsWith("--inspect"))return $;let X,Z="127.0.0.1",H="9229",z;if((z=$.match(/^(--inspect(-brk)?)$/))!==null)X=z[1];else if((z=$.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=z[1],/^\d+$/.test(z[3]))H=z[3];else Z=z[3];else if((z=$.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=z[1],Z=z[3],H=z[4];if(X&&H!=="0")return`${X}=${Z}:${parseInt(H)+1}`;return $})}function _$(){if(S.env.NO_COLOR||S.env.FORCE_COLOR==="0"||S.env.FORCE_COLOR==="false")return!1;if(S.env.FORCE_COLOR||S.env.CLICOLOR_FORCE!==void 0)return!0;return}j5.Command=W$;j5.useColor=_$});var Y2=I((y5)=>{var{Argument:G2}=Hq(),{Command:V$}=Q2(),{CommanderError:b5,InvalidArgumentError:J2}=E0(),{Help:C5}=T$(),{Option:T2}=Y$();y5.program=new V$;y5.createCommand=(q)=>new V$(q);y5.createOption=(q,$)=>new T2(q,$);y5.createArgument=(q,$)=>new G2(q,$);y5.Command=V$;y5.Option=T2;y5.Argument=G2;y5.Help=C5;y5.CommanderError=b5;y5.InvalidArgumentError=J2;y5.InvalidOptionArgumentError=J2});var A=I((e5)=>{var P$=Symbol.for("yaml.alias"),_2=Symbol.for("yaml.document"),Uq=Symbol.for("yaml.map"),W2=Symbol.for("yaml.pair"),M$=Symbol.for("yaml.scalar"),Qq=Symbol.for("yaml.seq"),a=Symbol.for("yaml.node.type"),i5=(q)=>!!q&&typeof q==="object"&&q[a]===P$,a5=(q)=>!!q&&typeof q==="object"&&q[a]===_2,s5=(q)=>!!q&&typeof q==="object"&&q[a]===Uq,r5=(q)=>!!q&&typeof q==="object"&&q[a]===W2,V2=(q)=>!!q&&typeof q==="object"&&q[a]===M$,n5=(q)=>!!q&&typeof q==="object"&&q[a]===Qq;function I2(q){if(q&&typeof q==="object")switch(q[a]){case Uq:case Qq:return!0}return!1}function o5(q){if(q&&typeof q==="object")switch(q[a]){case P$:case Uq:case M$:case Qq:return!0}return!1}var t5=(q)=>(V2(q)||I2(q))&&!!q.anchor;e5.ALIAS=P$;e5.DOC=_2;e5.MAP=Uq;e5.NODE_TYPE=a;e5.PAIR=W2;e5.SCALAR=M$;e5.SEQ=Qq;e5.hasAnchor=t5;e5.isAlias=i5;e5.isCollection=I2;e5.isDocument=a5;e5.isMap=s5;e5.isNode=o5;e5.isPair=r5;e5.isScalar=V2;e5.isSeq=n5});var b0=I((V8)=>{var f=A(),x=Symbol("break visit"),D2=Symbol("skip children"),p=Symbol("remove node");function Gq(q,$){let X=R2($);if(f.isDocument(q)){if(_0(null,q.contents,X,Object.freeze([q]))===p)q.contents=null}else _0(null,q,X,Object.freeze([]))}Gq.BREAK=x;Gq.SKIP=D2;Gq.REMOVE=p;function _0(q,$,X,Z){let H=P2(q,$,X,Z);if(f.isNode(H)||f.isPair(H))return M2(q,Z,H),_0(q,H,X,Z);if(typeof H!=="symbol"){if(f.isCollection($)){Z=Object.freeze(Z.concat($));for(let z=0;z<$.items.length;++z){let U=_0(z,$.items[z],X,Z);if(typeof U==="number")z=U-1;else if(U===x)return x;else if(U===p)$.items.splice(z,1),z-=1}}else if(f.isPair($)){Z=Object.freeze(Z.concat($));let z=_0("key",$.key,X,Z);if(z===x)return x;else if(z===p)$.key=null;let U=_0("value",$.value,X,Z);if(U===x)return x;else if(U===p)$.value=null}}return H}async function Jq(q,$){let X=R2($);if(f.isDocument(q)){if(await W0(null,q.contents,X,Object.freeze([q]))===p)q.contents=null}else await W0(null,q,X,Object.freeze([]))}Jq.BREAK=x;Jq.SKIP=D2;Jq.REMOVE=p;async function W0(q,$,X,Z){let H=await P2(q,$,X,Z);if(f.isNode(H)||f.isPair(H))return M2(q,Z,H),W0(q,H,X,Z);if(typeof H!=="symbol"){if(f.isCollection($)){Z=Object.freeze(Z.concat($));for(let z=0;z<$.items.length;++z){let U=await W0(z,$.items[z],X,Z);if(typeof U==="number")z=U-1;else if(U===x)return x;else if(U===p)$.items.splice(z,1),z-=1}}else if(f.isPair($)){Z=Object.freeze(Z.concat($));let z=await W0("key",$.key,X,Z);if(z===x)return x;else if(z===p)$.key=null;let U=await W0("value",$.value,X,Z);if(U===x)return x;else if(U===p)$.value=null}}return H}function R2(q){if(typeof q==="object"&&(q.Collection||q.Node||q.Value))return Object.assign({Alias:q.Node,Map:q.Node,Scalar:q.Node,Seq:q.Node},q.Value&&{Map:q.Value,Scalar:q.Value,Seq:q.Value},q.Collection&&{Map:q.Collection,Seq:q.Collection},q);return q}function P2(q,$,X,Z){if(typeof X==="function")return X(q,$,Z);if(f.isMap($))return X.Map?.(q,$,Z);if(f.isSeq($))return X.Seq?.(q,$,Z);if(f.isPair($))return X.Pair?.(q,$,Z);if(f.isScalar($))return X.Scalar?.(q,$,Z);if(f.isAlias($))return X.Alias?.(q,$,Z);return}function M2(q,$,X){let Z=$[$.length-1];if(f.isCollection(Z))Z.items[q]=X;else if(f.isPair(Z))if(q==="key")Z.key=X;else Z.value=X;else if(f.isDocument(Z))Z.contents=X;else{let H=f.isAlias(Z)?"alias":"scalar";throw Error(`Cannot replace node with ${H} parent`)}}V8.visit=Gq;V8.visitAsync=Jq});var K$=I((K8)=>{var K2=A(),R8=b0(),P8={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},M8=(q)=>q.replace(/[!,[\]{}]/g,($)=>P8[$]);class k{constructor(q,$){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},k.defaultYaml,q),this.tags=Object.assign({},k.defaultTags,$)}clone(){let q=new k(this.yaml,this.tags);return q.docStart=this.docStart,q}atDocument(){let q=new k(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:k.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},k.defaultTags);break}return q}add(q,$){if(this.atNextDocument)this.yaml={explicit:k.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},k.defaultTags),this.atNextDocument=!1;let X=q.trim().split(/[ \t]+/),Z=X.shift();switch(Z){case"%TAG":{if(X.length!==2){if($(0,"%TAG directive should contain exactly two parts"),X.length<2)return!1}let[H,z]=X;return this.tags[H]=z,!0}case"%YAML":{if(this.yaml.explicit=!0,X.length!==1)return $(0,"%YAML directive should contain exactly one part"),!1;let[H]=X;if(H==="1.1"||H==="1.2")return this.yaml.version=H,!0;else{let z=/^\d+\.\d+$/.test(H);return $(6,`Unsupported YAML version ${H}`,z),!1}}default:return $(0,`Unknown directive ${Z}`,!0),!1}}tagName(q,$){if(q==="!")return"!";if(q[0]!=="!")return $(`Not a valid tag: ${q}`),null;if(q[1]==="<"){let z=q.slice(2,-1);if(z==="!"||z==="!!")return $(`Verbatim tags aren't resolved, so ${q} is invalid.`),null;if(q[q.length-1]!==">")$("Verbatim tags must end with a >");return z}let[,X,Z]=q.match(/^(.*!)([^!]*)$/s);if(!Z)$(`The ${q} tag has no suffix`);let H=this.tags[X];if(H)try{return H+decodeURIComponent(Z)}catch(z){return $(String(z)),null}if(X==="!")return q;return $(`Could not resolve tag: ${q}`),null}tagString(q){for(let[$,X]of Object.entries(this.tags))if(q.startsWith(X))return $+M8(q.substring(X.length));return q[0]==="!"?q:`!<${q}>`}toString(q){let $=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],X=Object.entries(this.tags),Z;if(q&&X.length>0&&K2.isNode(q.contents)){let H={};R8.visit(q.contents,(z,U)=>{if(K2.isNode(U)&&U.tag)H[U.tag]=!0}),Z=Object.keys(H)}else Z=[];for(let[H,z]of X){if(H==="!!"&&z==="tag:yaml.org,2002:")continue;if(!q||Z.some((U)=>U.startsWith(z)))$.push(`%TAG ${H} ${z}`)}return $.join(`
|
|
29
|
+
`)}}k.defaultYaml={explicit:!1,version:"1.2"};k.defaultTags={"!!":"tag:yaml.org,2002:"};K8.Directives=k});var Tq=I((S8)=>{var w2=A(),F8=b0();function O8(q){if(/[\x00-\x19\s,[\]{}]/.test(q)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify(q)}`;throw Error(X)}return!0}function F2(q){let $=new Set;return F8.visit(q,{Value(X,Z){if(Z.anchor)$.add(Z.anchor)}}),$}function O2(q,$){for(let X=1;;++X){let Z=`${q}${X}`;if(!$.has(Z))return Z}}function A8(q,$){let X=[],Z=new Map,H=null;return{onAnchor:(z)=>{X.push(z),H??(H=F2(q));let U=O2($,H);return H.add(U),U},setAnchors:()=>{for(let z of X){let U=Z.get(z);if(typeof U==="object"&&U.anchor&&(w2.isScalar(U.node)||w2.isCollection(U.node)))U.node.anchor=U.anchor;else{let Q=Error("Failed to resolve repeated object (this should not happen)");throw Q.source=z,Q}}},sourceObjects:Z}}S8.anchorIsValid=O8;S8.anchorNames=F2;S8.createNodeAnchors=A8;S8.findNewAnchor=O2});var w$=I((C8)=>{function C0(q,$,X,Z){if(Z&&typeof Z==="object")if(Array.isArray(Z))for(let H=0,z=Z.length;H<z;++H){let U=Z[H],Q=C0(q,Z,String(H),U);if(Q===void 0)delete Z[H];else if(Q!==U)Z[H]=Q}else if(Z instanceof Map)for(let H of Array.from(Z.keys())){let z=Z.get(H),U=C0(q,Z,H,z);if(U===void 0)Z.delete(H);else if(U!==z)Z.set(H,U)}else if(Z instanceof Set)for(let H of Array.from(Z)){let z=C0(q,Z,H,H);if(z===void 0)Z.delete(H);else if(z!==H)Z.delete(H),Z.add(z)}else for(let[H,z]of Object.entries(Z)){let U=C0(q,Z,H,z);if(U===void 0)delete Z[H];else if(U!==z)Z[H]=U}return q.call($,X,Z)}C8.applyReviver=C0});var n=I((x8)=>{var f8=A();function A2(q,$,X){if(Array.isArray(q))return q.map((Z,H)=>A2(Z,String(H),X));if(q&&typeof q.toJSON==="function"){if(!X||!f8.hasAnchor(q))return q.toJSON($,X);let Z={aliasCount:0,count:1,res:void 0};X.anchors.set(q,Z),X.onCreate=(z)=>{Z.res=z,delete X.onCreate};let H=q.toJSON($,X);if(X.onCreate)X.onCreate(H);return H}if(typeof q==="bigint"&&!X?.keep)return Number(q);return q}x8.toJS=A2});var Yq=I((u8)=>{var h8=w$(),S2=A(),g8=n();class j2{constructor(q){Object.defineProperty(this,S2.NODE_TYPE,{value:q})}clone(){let q=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)q.range=this.range.slice();return q}toJS(q,{mapAsMap:$,maxAliasCount:X,onAnchor:Z,reviver:H}={}){if(!S2.isDocument(q))throw TypeError("A document argument is required");let z={anchors:new Map,doc:q,keep:!0,mapAsMap:$===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},U=g8.toJS(this,"",z);if(typeof Z==="function")for(let{count:Q,res:J}of z.anchors.values())Z(J,Q);return typeof H==="function"?h8.applyReviver(H,{"":U},"",U):U}}u8.NodeBase=j2});var y0=I((c8)=>{var m8=Tq(),d8=b0(),V0=A(),p8=Yq(),l8=n();class N2 extends p8.NodeBase{constructor(q){super(V0.ALIAS);this.source=q,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(q,$){let X;if($?.aliasResolveCache)X=$.aliasResolveCache;else if(X=[],d8.visit(q,{Node:(H,z)=>{if(V0.isAlias(z)||V0.hasAnchor(z))X.push(z)}}),$)$.aliasResolveCache=X;let Z=void 0;for(let H of X){if(H===this)break;if(H.anchor===this.source)Z=H}return Z}toJSON(q,$){if(!$)return{source:this.source};let{anchors:X,doc:Z,maxAliasCount:H}=$,z=this.resolve(Z,$);if(!z){let Q=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Q)}let U=X.get(z);if(!U)l8.toJS(z,null,$),U=X.get(z);if(U?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(H>=0){if(U.count+=1,U.aliasCount===0)U.aliasCount=Lq(Z,z,X);if(U.count*U.aliasCount>H)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return U.res}toString(q,$,X){let Z=`*${this.source}`;if(q){if(m8.anchorIsValid(this.source),q.options.verifyAliasOrder&&!q.anchors.has(this.source)){let H=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(H)}if(q.implicitKey)return`${Z} `}return Z}}function Lq(q,$,X){if(V0.isAlias($)){let Z=$.resolve(q),H=X&&Z&&X.get(Z);return H?H.count*H.aliasCount:0}else if(V0.isCollection($)){let Z=0;for(let H of $.items){let z=Lq(q,H,X);if(z>Z)Z=z}return Z}else if(V0.isPair($)){let Z=Lq(q,$.key,X),H=Lq(q,$.value,X);return Math.max(Z,H)}return 1}c8.Alias=N2});var b=I((o8)=>{var a8=A(),s8=Yq(),r8=n(),n8=(q)=>!q||typeof q!=="function"&&typeof q!=="object";class z0 extends s8.NodeBase{constructor(q){super(a8.SCALAR);this.value=q}toJSON(q,$){return $?.keep?this.value:r8.toJS(this.value,q,$)}toString(){return String(this.value)}}z0.BLOCK_FOLDED="BLOCK_FOLDED";z0.BLOCK_LITERAL="BLOCK_LITERAL";z0.PLAIN="PLAIN";z0.QUOTE_DOUBLE="QUOTE_DOUBLE";z0.QUOTE_SINGLE="QUOTE_SINGLE";o8.Scalar=z0;o8.isScalarValue=n8});var f0=I((HX)=>{var qX=y0(),U0=A(),E2=b(),$X="tag:yaml.org,2002:";function XX(q,$,X){if($){let Z=X.filter((z)=>z.tag===$),H=Z.find((z)=>!z.format)??Z[0];if(!H)throw Error(`Tag ${$} not found`);return H}return X.find((Z)=>Z.identify?.(q)&&!Z.format)}function ZX(q,$,X){if(U0.isDocument(q))q=q.contents;if(U0.isNode(q))return q;if(U0.isPair(q)){let T=X.schema[U0.MAP].createNode?.(X.schema,null,X);return T.items.push(q),T}if(q instanceof String||q instanceof Number||q instanceof Boolean||typeof BigInt<"u"&&q instanceof BigInt)q=q.valueOf();let{aliasDuplicateObjects:Z,onAnchor:H,onTagObj:z,schema:U,sourceObjects:Q}=X,J=void 0;if(Z&&q&&typeof q==="object")if(J=Q.get(q),J)return J.anchor??(J.anchor=H(q)),new qX.Alias(J.anchor);else J={anchor:null,node:null},Q.set(q,J);if($?.startsWith("!!"))$=$X+$.slice(2);let G=XX(q,$,U.tags);if(!G){if(q&&typeof q.toJSON==="function")q=q.toJSON();if(!q||typeof q!=="object"){let T=new E2.Scalar(q);if(J)J.node=T;return T}G=q instanceof Map?U[U0.MAP]:(Symbol.iterator in Object(q))?U[U0.SEQ]:U[U0.MAP]}if(z)z(G),delete X.onTagObj;let Y=G?.createNode?G.createNode(X.schema,q,X):typeof G?.nodeClass?.from==="function"?G.nodeClass.from(X.schema,q,X):new E2.Scalar(q);if($)Y.tag=$;else if(!G.default)Y.tag=G.tag;if(J)J.node=Y;return Y}HX.createNode=ZX});var Bq=I((GX)=>{var UX=f0(),l=A(),QX=Yq();function F$(q,$,X){let Z=X;for(let H=$.length-1;H>=0;--H){let z=$[H];if(typeof z==="number"&&Number.isInteger(z)&&z>=0){let U=[];U[z]=Z,Z=U}else Z=new Map([[z,Z]])}return UX.createNode(Z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:q,sourceObjects:new Map})}var b2=(q)=>q==null||typeof q==="object"&&!!q[Symbol.iterator]().next().done;class C2 extends QX.NodeBase{constructor(q,$){super(q);Object.defineProperty(this,"schema",{value:$,configurable:!0,enumerable:!1,writable:!0})}clone(q){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(q)$.schema=q;if($.items=$.items.map((X)=>l.isNode(X)||l.isPair(X)?X.clone(q):X),this.range)$.range=this.range.slice();return $}addIn(q,$){if(b2(q))this.add($);else{let[X,...Z]=q,H=this.get(X,!0);if(l.isCollection(H))H.addIn(Z,$);else if(H===void 0&&this.schema)this.set(X,F$(this.schema,Z,$));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${Z}`)}}deleteIn(q){let[$,...X]=q;if(X.length===0)return this.delete($);let Z=this.get($,!0);if(l.isCollection(Z))return Z.deleteIn(X);else throw Error(`Expected YAML collection at ${$}. Remaining path: ${X}`)}getIn(q,$){let[X,...Z]=q,H=this.get(X,!0);if(Z.length===0)return!$&&l.isScalar(H)?H.value:H;else return l.isCollection(H)?H.getIn(Z,$):void 0}hasAllNullValues(q){return this.items.every(($)=>{if(!l.isPair($))return!1;let X=$.value;return X==null||q&&l.isScalar(X)&&X.value==null&&!X.commentBefore&&!X.comment&&!X.tag})}hasIn(q){let[$,...X]=q;if(X.length===0)return this.has($);let Z=this.get($,!0);return l.isCollection(Z)?Z.hasIn(X):!1}setIn(q,$){let[X,...Z]=q;if(Z.length===0)this.set(X,$);else{let H=this.get(X,!0);if(l.isCollection(H))H.setIn(Z,$);else if(H===void 0&&this.schema)this.set(X,F$(this.schema,Z,$));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${Z}`)}}}GX.Collection=C2;GX.collectionFromPath=F$;GX.isEmptyPath=b2});var x0=I((_X)=>{var LX=(q)=>q.replace(/^(?!$)(?: $)?/gm,"#");function O$(q,$){if(/^\n+$/.test(q))return q.substring(1);return $?q.replace(/^(?! *$)/gm,$):q}var BX=(q,$,X)=>q.endsWith(`
|
|
30
|
+
`)?O$(X,$):X.includes(`
|
|
31
31
|
`)?`
|
|
32
|
-
`+
|
|
33
|
-
`){if(
|
|
34
|
-
`&&
|
|
35
|
-
`&&
|
|
36
|
-
${
|
|
37
|
-
${
|
|
38
|
-
`);
|
|
39
|
-
`){if(
|
|
40
|
-
|
|
41
|
-
`;while(
|
|
42
|
-
`,
|
|
43
|
-
`)||/[ \t]\n|\n[ \t]/.test(
|
|
44
|
-
${
|
|
32
|
+
`+O$(X,$):(q.endsWith(" ")?"":" ")+X;_X.indentComment=O$;_X.lineComment=BX;_X.stringifyComment=LX});var f2=I((RX)=>{function DX(q,$,X="flow",{indentAtStart:Z,lineWidth:H=80,minContentWidth:z=20,onFold:U,onOverflow:Q}={}){if(!H||H<0)return q;if(H<z)z=0;let J=Math.max(1+z,1+H-$.length);if(q.length<=J)return q;let G=[],Y={},T=H-$.length;if(typeof Z==="number")if(Z>H-Math.max(2,z))G.push(0);else T=H-Z;let L=void 0,_=void 0,V=!1,B=-1,W=-1,D=-1;if(X==="block"){if(B=y2(q,B,$.length),B!==-1)T=B+J}for(let K;K=q[B+=1];){if(X==="quoted"&&K==="\\"){switch(W=B,q[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}D=B}if(K===`
|
|
33
|
+
`){if(X==="block")B=y2(q,B,$.length);T=B+$.length+J,L=void 0}else{if(K===" "&&_&&_!==" "&&_!==`
|
|
34
|
+
`&&_!=="\t"){let w=q[B+1];if(w&&w!==" "&&w!==`
|
|
35
|
+
`&&w!=="\t")L=B}if(B>=T)if(L)G.push(L),T=L+J,L=void 0;else if(X==="quoted"){while(_===" "||_==="\t")_=K,K=q[B+=1],V=!0;let w=B>D+1?B-2:W-1;if(Y[w])return q;G.push(w),Y[w]=!0,T=w+J,L=void 0}else V=!0}_=K}if(V&&Q)Q();if(G.length===0)return q;if(U)U();let R=q.slice(0,G[0]);for(let K=0;K<G.length;++K){let w=G[K],F=G[K+1]||q.length;if(w===0)R=`
|
|
36
|
+
${$}${q.slice(0,F)}`;else{if(X==="quoted"&&Y[w])R+=`${q[w]}\\`;R+=`
|
|
37
|
+
${$}${q.slice(w+1,F)}`}}return R}function y2(q,$,X){let Z=$,H=$+1,z=q[H];while(z===" "||z==="\t")if($<H+X)z=q[++$];else{do z=q[++$];while(z&&z!==`
|
|
38
|
+
`);Z=$,H=$+1,z=q[H]}return Z}RX.FOLD_BLOCK="block";RX.FOLD_FLOW="flow";RX.FOLD_QUOTED="quoted";RX.foldFlowLines=DX});var h0=I((SX)=>{var u=b(),o=f2(),Wq=(q,$)=>({indentAtStart:$?q.indent.length:q.indentAtStart,lineWidth:q.options.lineWidth,minContentWidth:q.options.minContentWidth}),Vq=(q)=>/^(%|---|\.\.\.)/m.test(q);function FX(q,$,X){if(!$||$<0)return!1;let Z=$-X,H=q.length;if(H<=Z)return!1;for(let z=0,U=0;z<H;++z)if(q[z]===`
|
|
39
|
+
`){if(z-U>Z)return!0;if(U=z+1,H-U<=Z)return!1}return!0}function k0(q,$){let X=JSON.stringify(q);if($.options.doubleQuotedAsJSON)return X;let{implicitKey:Z}=$,H=$.options.doubleQuotedMinMultiLineLength,z=$.indent||(Vq(q)?" ":""),U="",Q=0;for(let J=0,G=X[J];G;G=X[++J]){if(G===" "&&X[J+1]==="\\"&&X[J+2]==="n")U+=X.slice(Q,J)+"\\ ",J+=1,Q=J,G="\\";if(G==="\\")switch(X[J+1]){case"u":{U+=X.slice(Q,J);let Y=X.substr(J+2,4);switch(Y){case"0000":U+="\\0";break;case"0007":U+="\\a";break;case"000b":U+="\\v";break;case"001b":U+="\\e";break;case"0085":U+="\\N";break;case"00a0":U+="\\_";break;case"2028":U+="\\L";break;case"2029":U+="\\P";break;default:if(Y.substr(0,2)==="00")U+="\\x"+Y.substr(2);else U+=X.substr(J,6)}J+=5,Q=J+1}break;case"n":if(Z||X[J+2]==='"'||X.length<H)J+=1;else{U+=X.slice(Q,J)+`
|
|
40
|
+
|
|
41
|
+
`;while(X[J+2]==="\\"&&X[J+3]==="n"&&X[J+4]!=='"')U+=`
|
|
42
|
+
`,J+=2;if(U+=z,X[J+2]===" ")U+="\\";J+=1,Q=J+1}break;default:J+=1}}return U=Q?U+X.slice(Q):X,Z?U:o.foldFlowLines(U,z,o.FOLD_QUOTED,Wq($,!1))}function A$(q,$){if($.options.singleQuote===!1||$.implicitKey&&q.includes(`
|
|
43
|
+
`)||/[ \t]\n|\n[ \t]/.test(q))return k0(q,$);let X=$.indent||(Vq(q)?" ":""),Z="'"+q.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
44
|
+
${X}`)+"'";return $.implicitKey?Z:o.foldFlowLines(Z,X,o.FOLD_FLOW,Wq($,!1))}function I0(q,$){let{singleQuote:X}=$.options,Z;if(X===!1)Z=k0;else{let H=q.includes('"'),z=q.includes("'");if(H&&!z)Z=A$;else if(z&&!H)Z=k0;else Z=X?A$:k0}return Z(q,$)}var S$;try{S$=new RegExp(`(^|(?<!
|
|
45
45
|
))
|
|
46
46
|
+(?!
|
|
47
|
-
|$)`,"g")}catch{
|
|
47
|
+
|$)`,"g")}catch{S$=/\n+(?!\n|$)/g}function _q({comment:q,type:$,value:X},Z,H,z){let{blockQuote:U,commentString:Q,lineWidth:J}=Z.options;if(!U||/\n[\t ]+$/.test(X))return I0(X,Z);let G=Z.indent||(Z.forceBlockIndent||Vq(X)?" ":""),Y=U==="literal"?!0:U==="folded"||$===u.Scalar.BLOCK_FOLDED?!1:$===u.Scalar.BLOCK_LITERAL?!0:!FX(X,J,G.length);if(!X)return Y?`|
|
|
48
48
|
`:`>
|
|
49
|
-
`;let
|
|
50
|
-
`&&
|
|
51
|
-
`);if(
|
|
52
|
-
`)
|
|
53
|
-
`)
|
|
54
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${
|
|
55
|
-
${
|
|
56
|
-
${
|
|
57
|
-
`)||
|
|
58
|
-
`)?
|
|
59
|
-
`))return
|
|
60
|
-
${
|
|
61
|
-
${
|
|
62
|
-
${
|
|
63
|
-
`:"",
|
|
64
|
-
${
|
|
49
|
+
`;let T,L;for(L=X.length;L>0;--L){let F=X[L-1];if(F!==`
|
|
50
|
+
`&&F!=="\t"&&F!==" ")break}let _=X.substring(L),V=_.indexOf(`
|
|
51
|
+
`);if(V===-1)T="-";else if(X===_||V!==_.length-1){if(T="+",z)z()}else T="";if(_){if(X=X.slice(0,-_.length),_[_.length-1]===`
|
|
52
|
+
`)_=_.slice(0,-1);_=_.replace(S$,`$&${G}`)}let B=!1,W,D=-1;for(W=0;W<X.length;++W){let F=X[W];if(F===" ")B=!0;else if(F===`
|
|
53
|
+
`)D=W;else break}let R=X.substring(0,D<W?D+1:W);if(R)X=X.substring(R.length),R=R.replace(/\n+/g,`$&${G}`);let w=(B?G?"2":"1":"")+T;if(q){if(w+=" "+Q(q.replace(/ ?[\r\n]+/g," ")),H)H()}if(!Y){let F=X.replace(/\n+/g,`
|
|
54
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${G}`),O=!1,j=Wq(Z,!0);if(U!=="folded"&&$!==u.Scalar.BLOCK_FOLDED)j.onOverflow=()=>{O=!0};let P=o.foldFlowLines(`${R}${F}${_}`,G,o.FOLD_BLOCK,j);if(!O)return`>${w}
|
|
55
|
+
${G}${P}`}return X=X.replace(/\n+/g,`$&${G}`),`|${w}
|
|
56
|
+
${G}${R}${X}${_}`}function OX(q,$,X,Z){let{type:H,value:z}=q,{actualString:U,implicitKey:Q,indent:J,indentStep:G,inFlow:Y}=$;if(Q&&z.includes(`
|
|
57
|
+
`)||Y&&/[[\]{},]/.test(z))return I0(z,$);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(z))return Q||Y||!z.includes(`
|
|
58
|
+
`)?I0(z,$):_q(q,$,X,Z);if(!Q&&!Y&&H!==u.Scalar.PLAIN&&z.includes(`
|
|
59
|
+
`))return _q(q,$,X,Z);if(Vq(z)){if(J==="")return $.forceBlockIndent=!0,_q(q,$,X,Z);else if(Q&&J===G)return I0(z,$)}let T=z.replace(/\n+/g,`$&
|
|
60
|
+
${J}`);if(U){let L=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(T),{compat:_,tags:V}=$.doc.schema;if(V.some(L)||_?.some(L))return I0(z,$)}return Q?T:o.foldFlowLines(T,J,o.FOLD_FLOW,Wq($,!1))}function AX(q,$,X,Z){let{implicitKey:H,inFlow:z}=$,U=typeof q.value==="string"?q:Object.assign({},q,{value:String(q.value)}),{type:Q}=q;if(Q!==u.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(U.value))Q=u.Scalar.QUOTE_DOUBLE}let J=(Y)=>{switch(Y){case u.Scalar.BLOCK_FOLDED:case u.Scalar.BLOCK_LITERAL:return H||z?I0(U.value,$):_q(U,$,X,Z);case u.Scalar.QUOTE_DOUBLE:return k0(U.value,$);case u.Scalar.QUOTE_SINGLE:return A$(U.value,$);case u.Scalar.PLAIN:return OX(U,$,X,Z);default:return null}},G=J(Q);if(G===null){let{defaultKeyType:Y,defaultStringType:T}=$.options,L=H&&Y||T;if(G=J(L),G===null)throw Error(`Unsupported default string type ${L}`)}return G}SX.stringifyString=AX});var g0=I((kX)=>{var NX=Tq(),t=A(),EX=x0(),bX=h0();function CX(q,$){let X=Object.assign({blockQuote:!0,commentString:EX.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},q.schema.toStringOptions,$),Z;switch(X.collectionStyle){case"block":Z=!1;break;case"flow":Z=!0;break;default:Z=null}return{anchors:new Set,doc:q,flowCollectionPadding:X.flowCollectionPadding?" ":"",indent:"",indentStep:typeof X.indent==="number"?" ".repeat(X.indent):" ",inFlow:Z,options:X}}function yX(q,$){if($.tag){let H=q.filter((z)=>z.tag===$.tag);if(H.length>0)return H.find((z)=>z.format===$.format)??H[0]}let X=void 0,Z;if(t.isScalar($)){Z=$.value;let H=q.filter((z)=>z.identify?.(Z));if(H.length>1){let z=H.filter((U)=>U.test);if(z.length>0)H=z}X=H.find((z)=>z.format===$.format)??H.find((z)=>!z.format)}else Z=$,X=q.find((H)=>H.nodeClass&&Z instanceof H.nodeClass);if(!X){let H=Z?.constructor?.name??(Z===null?"null":typeof Z);throw Error(`Tag not resolved for ${H} value`)}return X}function fX(q,$,{anchors:X,doc:Z}){if(!Z.directives)return"";let H=[],z=(t.isScalar(q)||t.isCollection(q))&&q.anchor;if(z&&NX.anchorIsValid(z))X.add(z),H.push(`&${z}`);let U=q.tag??($.default?null:$.tag);if(U)H.push(Z.directives.tagString(U));return H.join(" ")}function xX(q,$,X,Z){if(t.isPair(q))return q.toString($,X,Z);if(t.isAlias(q)){if($.doc.directives)return q.toString($);if($.resolvedAliases?.has(q))throw TypeError("Cannot stringify circular structure without alias nodes");else{if($.resolvedAliases)$.resolvedAliases.add(q);else $.resolvedAliases=new Set([q]);q=q.resolve($.doc)}}let H=void 0,z=t.isNode(q)?q:$.doc.createNode(q,{onTagObj:(J)=>H=J});H??(H=yX($.doc.schema.tags,z));let U=fX(z,H,$);if(U.length>0)$.indentAtStart=($.indentAtStart??0)+U.length+1;let Q=typeof H.stringify==="function"?H.stringify(z,$,X,Z):t.isScalar(z)?bX.stringifyString(z,$,X,Z):z.toString($,X,Z);if(!U)return Q;return t.isScalar(z)||Q[0]==="{"||Q[0]==="["?`${U} ${Q}`:`${U}
|
|
61
|
+
${$.indent}${Q}`}kX.createStringifyContext=CX;kX.stringify=xX});var h2=I((vX)=>{var s=A(),x2=b(),k2=g0(),u0=x0();function uX({key:q,value:$},X,Z,H){let{allNullValues:z,doc:U,indent:Q,indentStep:J,options:{commentString:G,indentSeq:Y,simpleKeys:T}}=X,L=s.isNode(q)&&q.comment||null;if(T){if(L)throw Error("With simple keys, key nodes cannot have comments");if(s.isCollection(q)||!s.isNode(q)&&typeof q==="object")throw Error("With simple keys, collection cannot be used as a key value")}let _=!T&&(!q||L&&$==null&&!X.inFlow||s.isCollection(q)||(s.isScalar(q)?q.type===x2.Scalar.BLOCK_FOLDED||q.type===x2.Scalar.BLOCK_LITERAL:typeof q==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!_&&(T||!z),indent:Q+J});let V=!1,B=!1,W=k2.stringify(q,X,()=>V=!0,()=>B=!0);if(!_&&!X.inFlow&&W.length>1024){if(T)throw Error("With simple keys, single line scalar must not span more than 1024 characters");_=!0}if(X.inFlow){if(z||$==null){if(V&&Z)Z();return W===""?"?":_?`? ${W}`:W}}else if(z&&!T||$==null&&_){if(W=`? ${W}`,L&&!V)W+=u0.lineComment(W,X.indent,G(L));else if(B&&H)H();return W}if(V)L=null;if(_){if(L)W+=u0.lineComment(W,X.indent,G(L));W=`? ${W}
|
|
62
|
+
${Q}:`}else if(W=`${W}:`,L)W+=u0.lineComment(W,X.indent,G(L));let D,R,K;if(s.isNode($))D=!!$.spaceBefore,R=$.commentBefore,K=$.comment;else if(D=!1,R=null,K=null,$&&typeof $==="object")$=U.createNode($);if(X.implicitKey=!1,!_&&!L&&s.isScalar($))X.indentAtStart=W.length+1;if(B=!1,!Y&&J.length>=2&&!X.inFlow&&!_&&s.isSeq($)&&!$.flow&&!$.tag&&!$.anchor)X.indent=X.indent.substring(2);let w=!1,F=k2.stringify($,X,()=>w=!0,()=>B=!0),O=" ";if(L||D||R){if(O=D?`
|
|
63
|
+
`:"",R){let j=G(R);O+=`
|
|
64
|
+
${u0.indentComment(j,X.indent)}`}if(F===""&&!X.inFlow){if(O===`
|
|
65
65
|
`&&K)O=`
|
|
66
66
|
|
|
67
67
|
`}else O+=`
|
|
68
|
-
${
|
|
69
|
-
`),
|
|
70
|
-
${
|
|
71
|
-
`)O="";if(
|
|
72
|
-
${
|
|
73
|
-
`}}if(
|
|
74
|
-
|
|
75
|
-
`)))
|
|
76
|
-
${
|
|
77
|
-
`;return`${
|
|
78
|
-
${
|
|
79
|
-
`:" ")}return
|
|
80
|
-
${
|
|
81
|
-
${J.comment}`:Y.comment}Y=G}X.items[$]=B6.isPair(Y)?Y:new GQ.Pair(Y)}else Q("Expected a sequence for this tag");return X}function $5(X,Q,$){let{replacer:Y}=$,G=new YB.YAMLSeq(X);G.tag="tag:yaml.org,2002:pairs";let J=0;if(Q&&Symbol.iterator in Object(Q))for(let H of Q){if(typeof Y==="function")H=Y.call(Q,String(J++),H);let W,U;if(Array.isArray(H))if(H.length===2)W=H[0],U=H[1];else throw TypeError(`Expected [key, value] tuple: ${H}`);else if(H&&H instanceof Object){let z=Object.keys(H);if(z.length===1)W=z[0],U=H[W];else throw TypeError(`Expected tuple with one key, not ${z.length} keys`)}else W=H;G.items.push(GQ.createPair(W,U,$))}return G}var GB={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Q5,createNode:$5};JB.createPairs=$5;JB.pairs=GB;JB.resolvePairs=Q5});var HQ=p((LB)=>{var Y5=V0(),JQ=_1(),e9=g1(),zB=h1(),G5=L6();class o1 extends zB.YAMLSeq{constructor(){super();this.add=e9.YAMLMap.prototype.add.bind(this),this.delete=e9.YAMLMap.prototype.delete.bind(this),this.get=e9.YAMLMap.prototype.get.bind(this),this.has=e9.YAMLMap.prototype.has.bind(this),this.set=e9.YAMLMap.prototype.set.bind(this),this.tag=o1.tag}toJSON(X,Q){if(!Q)return super.toJSON(X);let $=new Map;if(Q?.onCreate)Q.onCreate($);for(let Y of this.items){let G,J;if(Y5.isPair(Y))G=JQ.toJS(Y.key,"",Q),J=JQ.toJS(Y.value,G,Q);else G=JQ.toJS(Y,"",Q);if($.has(G))throw Error("Ordered maps must not include duplicate keys");$.set(G,J)}return $}static from(X,Q,$){let Y=G5.createPairs(X,Q,$),G=new this;return G.items=Y.items,G}}o1.tag="tag:yaml.org,2002:omap";var BB={collection:"seq",identify:(X)=>X instanceof Map,nodeClass:o1,default:!1,tag:"tag:yaml.org,2002:omap",resolve(X,Q){let $=G5.resolvePairs(X,Q),Y=[];for(let{key:G}of $.items)if(Y5.isScalar(G))if(Y.includes(G.value))Q(`Ordered maps must not include duplicate keys: ${G.value}`);else Y.push(G.value);return Object.assign(new o1,$)},createNode:(X,Q,$)=>o1.from(X,Q,$)};LB.YAMLOMap=o1;LB.omap=BB});var z5=p((VB)=>{var J5=k0();function H5({value:X,source:Q},$){if(Q&&(X?W5:U5).test.test(Q))return Q;return X?$.options.trueStr:$.options.falseStr}var W5={identify:(X)=>X===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new J5.Scalar(!0),stringify:H5},U5={identify:(X)=>X===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new J5.Scalar(!1),stringify:H5};VB.falseTag=U5;VB.trueTag=W5});var B5=p((NB)=>{var DB=k0(),WQ=q9(),OB={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(X)=>X.slice(-3).toLowerCase()==="nan"?NaN:X[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:WQ.stringifyNumber},ZB={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(X)=>parseFloat(X.replace(/_/g,"")),stringify(X){let Q=Number(X.value);return isFinite(Q)?Q.toExponential():WQ.stringifyNumber(X)}},AB={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(X){let Q=new DB.Scalar(parseFloat(X.replace(/_/g,""))),$=X.indexOf(".");if($!==-1){let Y=X.substring($+1).replace(/_/g,"");if(Y[Y.length-1]==="0")Q.minFractionDigits=Y.length}return Q},stringify:WQ.stringifyNumber};NB.float=AB;NB.floatExp=ZB;NB.floatNaN=OB});var q5=p((EB)=>{var L5=q9(),X8=(X)=>typeof X==="bigint"||Number.isInteger(X);function q6(X,Q,$,{intAsBigInt:Y}){let G=X[0];if(G==="-"||G==="+")Q+=1;if(X=X.substring(Q).replace(/_/g,""),Y){switch($){case 2:X=`0b${X}`;break;case 8:X=`0o${X}`;break;case 16:X=`0x${X}`;break}let H=BigInt(X);return G==="-"?BigInt(-1)*H:H}let J=parseInt(X,$);return G==="-"?-1*J:J}function UQ(X,Q,$){let{value:Y}=X;if(X8(Y)){let G=Y.toString(Q);return Y<0?"-"+$+G.substr(1):$+G}return L5.stringifyNumber(X)}var jB={identify:X8,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(X,Q,$)=>q6(X,2,2,$),stringify:(X)=>UQ(X,2,"0b")},PB={identify:X8,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(X,Q,$)=>q6(X,1,8,$),stringify:(X)=>UQ(X,8,"0")},TB={identify:X8,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(X,Q,$)=>q6(X,0,10,$),stringify:L5.stringifyNumber},SB={identify:X8,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(X,Q,$)=>q6(X,2,16,$),stringify:(X)=>UQ(X,16,"0x")};EB.int=TB;EB.intBin=jB;EB.intHex=SB;EB.intOct=PB});var zQ=p((yB)=>{var K6=V0(),F6=y1(),V6=g1();class a1 extends V6.YAMLMap{constructor(X){super(X);this.tag=a1.tag}add(X){let Q;if(K6.isPair(X))Q=X;else if(X&&typeof X==="object"&&"key"in X&&"value"in X&&X.value===null)Q=new F6.Pair(X.key,null);else Q=new F6.Pair(X,null);if(!V6.findPair(this.items,Q.key))this.items.push(Q)}get(X,Q){let $=V6.findPair(this.items,X);return!Q&&K6.isPair($)?K6.isScalar($.key)?$.key.value:$.key:$}set(X,Q){if(typeof Q!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Q}`);let $=V6.findPair(this.items,X);if($&&!Q)this.items.splice(this.items.indexOf($),1);else if(!$&&Q)this.items.push(new F6.Pair(X))}toJSON(X,Q){return super.toJSON(X,Q,Set)}toString(X,Q,$){if(!X)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},X,{allNullValues:!0}),Q,$);else throw Error("Set items must all have null values")}static from(X,Q,$){let{replacer:Y}=$,G=new this(X);if(Q&&Symbol.iterator in Object(Q))for(let J of Q){if(typeof Y==="function")J=Y.call(Q,J,J);G.items.push(F6.createPair(J,null,$))}return G}}a1.tag="tag:yaml.org,2002:set";var vB={collection:"map",identify:(X)=>X instanceof Set,nodeClass:a1,default:!1,tag:"tag:yaml.org,2002:set",createNode:(X,Q,$)=>a1.from(X,Q,$),resolve(X,Q){if(K6.isMap(X))if(X.hasAllNullValues(!0))return Object.assign(new a1,X);else Q("Set items must all have null values");else Q("Expected a mapping for this tag");return X}};yB.YAMLSet=a1;yB.set=vB});var LQ=p((mB)=>{var hB=q9();function BQ(X,Q){let $=X[0],Y=$==="-"||$==="+"?X.substring(1):X,G=(H)=>Q?BigInt(H):Number(H),J=Y.replace(/_/g,"").split(":").reduce((H,W)=>H*G(60)+G(W),G(0));return $==="-"?G(-1)*J:J}function F5(X){let{value:Q}=X,$=(H)=>H;if(typeof Q==="bigint")$=(H)=>BigInt(H);else if(isNaN(Q)||!isFinite(Q))return hB.stringifyNumber(X);let Y="";if(Q<0)Y="-",Q*=$(-1);let G=$(60),J=[Q%G];if(Q<60)J.unshift(0);else if(Q=(Q-J[0])/G,J.unshift(Q%G),Q>=60)Q=(Q-J[0])/G,J.unshift(Q);return Y+J.map((H)=>String(H).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var fB={identify:(X)=>typeof X==="bigint"||Number.isInteger(X),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(X,Q,{intAsBigInt:$})=>BQ(X,$),stringify:F5},uB={identify:(X)=>typeof X==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(X)=>BQ(X,!1),stringify:F5},V5={identify:(X)=>X 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(X){let Q=X.match(V5.test);if(!Q)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,$,Y,G,J,H,W]=Q.map(Number),U=Q[7]?Number((Q[7]+"00").substr(1,3)):0,z=Date.UTC($,Y-1,G,J||0,H||0,W||0,U),L=Q[8];if(L&&L!=="Z"){let B=BQ(L,!1);if(Math.abs(B)<30)B*=60;z-=60000*B}return new Date(z)},stringify:({value:X})=>X?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};mB.floatTime=uB;mB.intTime=fB;mB.timestamp=V5});var M5=p((QL)=>{var dB=B9(),iB=W6(),nB=L9(),rB=s9(),oB=YQ(),K5=z5(),qQ=B5(),M6=q5(),aB=e8(),sB=HQ(),tB=L6(),eB=zQ(),FQ=LQ(),XL=[dB.map,nB.seq,rB.string,iB.nullTag,K5.trueTag,K5.falseTag,M6.intBin,M6.intOct,M6.int,M6.intHex,qQ.floatNaN,qQ.floatExp,qQ.float,oB.binary,aB.merge,sB.omap,tB.pairs,eB.set,FQ.intTime,FQ.floatTime,FQ.timestamp];QL.schema=XL});var P5=p((BL)=>{var A5=B9(),YL=W6(),N5=L9(),GL=s9(),JL=oX(),VQ=sX(),KQ=eX(),HL=t4(),WL=X5(),R5=YQ(),Q8=e8(),w5=HQ(),I5=L6(),D5=M5(),j5=zQ(),D6=LQ(),O5=new Map([["core",HL.schema],["failsafe",[A5.map,N5.seq,GL.string]],["json",WL.schema],["yaml11",D5.schema],["yaml-1.1",D5.schema]]),Z5={binary:R5.binary,bool:JL.boolTag,float:VQ.float,floatExp:VQ.floatExp,floatNaN:VQ.floatNaN,floatTime:D6.floatTime,int:KQ.int,intHex:KQ.intHex,intOct:KQ.intOct,intTime:D6.intTime,map:A5.map,merge:Q8.merge,null:YL.nullTag,omap:w5.omap,pairs:I5.pairs,seq:N5.seq,set:j5.set,timestamp:D6.timestamp},UL={"tag:yaml.org,2002:binary":R5.binary,"tag:yaml.org,2002:merge":Q8.merge,"tag:yaml.org,2002:omap":w5.omap,"tag:yaml.org,2002:pairs":I5.pairs,"tag:yaml.org,2002:set":j5.set,"tag:yaml.org,2002:timestamp":D6.timestamp};function zL(X,Q,$){let Y=O5.get(Q);if(Y&&!X)return $&&!Y.includes(Q8.merge)?Y.concat(Q8.merge):Y.slice();let G=Y;if(!G)if(Array.isArray(X))G=[];else{let J=Array.from(O5.keys()).filter((H)=>H!=="yaml11").map((H)=>JSON.stringify(H)).join(", ");throw Error(`Unknown schema "${Q}"; use one of ${J} or define customTags array`)}if(Array.isArray(X))for(let J of X)G=G.concat(J);else if(typeof X==="function")G=X(G.slice());if($)G=G.concat(Q8.merge);return G.reduce((J,H)=>{let W=typeof H==="string"?Z5[H]:H;if(!W){let U=JSON.stringify(H),z=Object.keys(Z5).map((L)=>JSON.stringify(L)).join(", ");throw Error(`Unknown custom tag ${U}; use one of ${z}`)}if(!J.includes(W))J.push(W);return J},[])}BL.coreKnownTags=UL;BL.getTags=zL});var OQ=p((DL)=>{var MQ=V0(),FL=B9(),VL=L9(),KL=s9(),O6=P5(),ML=(X,Q)=>X.key<Q.key?-1:X.key>Q.key?1:0;class DQ{constructor({compat:X,customTags:Q,merge:$,resolveKnownTags:Y,schema:G,sortMapEntries:J,toStringDefaults:H}){this.compat=Array.isArray(X)?O6.getTags(X,"compat"):X?O6.getTags(null,X):null,this.name=typeof G==="string"&&G||"core",this.knownTags=Y?O6.coreKnownTags:{},this.tags=O6.getTags(Q,this.name,$),this.toStringOptions=H??null,Object.defineProperty(this,MQ.MAP,{value:FL.map}),Object.defineProperty(this,MQ.SCALAR,{value:KL.string}),Object.defineProperty(this,MQ.SEQ,{value:VL.seq}),this.sortMapEntries=typeof J==="function"?J:J===!0?ML:null}clone(){let X=Object.create(DQ.prototype,Object.getOwnPropertyDescriptors(this));return X.tags=this.tags.slice(),X}}DL.Schema=DQ});var T5=p((NL)=>{var ZL=V0(),ZQ=n9(),$8=p9();function AL(X,Q){let $=[],Y=Q.directives===!0;if(Q.directives!==!1&&X.directives){let U=X.directives.toString(X);if(U)$.push(U),Y=!0;else if(X.directives.docStart)Y=!0}if(Y)$.push("---");let G=ZQ.createStringifyContext(X,Q),{commentString:J}=G.options;if(X.commentBefore){if($.length!==1)$.unshift("");let U=J(X.commentBefore);$.unshift($8.indentComment(U,""))}let H=!1,W=null;if(X.contents){if(ZL.isNode(X.contents)){if(X.contents.spaceBefore&&Y)$.push("");if(X.contents.commentBefore){let L=J(X.contents.commentBefore);$.push($8.indentComment(L,""))}G.forceBlockIndent=!!X.comment,W=X.contents.comment}let U=W?void 0:()=>H=!0,z=ZQ.stringify(X.contents,G,()=>W=null,U);if(W)z+=$8.lineComment(z,"",J(W));if((z[0]==="|"||z[0]===">")&&$[$.length-1]==="---")$[$.length-1]=`--- ${z}`;else $.push(z)}else $.push(ZQ.stringify(X.contents,G));if(X.directives?.docEnd)if(X.comment){let U=J(X.comment);if(U.includes(`
|
|
82
|
-
`))
|
|
68
|
+
${X.indent}`}else if(!_&&s.isCollection($)){let j=F[0],P=F.indexOf(`
|
|
69
|
+
`),C=P!==-1,r=X.inFlow??$.flow??$.items.length===0;if(C||!r){let L0=!1;if(C&&(j==="&"||j==="!")){let y=F.indexOf(" ");if(j==="&"&&y!==-1&&y<P&&F[y+1]==="!")y=F.indexOf(" ",y+1);if(y===-1||P<y)L0=!0}if(!L0)O=`
|
|
70
|
+
${X.indent}`}}else if(F===""||F[0]===`
|
|
71
|
+
`)O="";if(W+=O+F,X.inFlow){if(w&&Z)Z()}else if(K&&!w)W+=u0.lineComment(W,X.indent,G(K));else if(B&&H)H();return W}vX.stringifyPair=uX});var j$=I((lX)=>{var g2=c("process");function dX(q,...$){if(q==="debug")console.log(...$)}function pX(q,$){if(q==="debug"||q==="warn")if(typeof g2.emitWarning==="function")g2.emitWarning($);else console.warn($)}lX.debug=dX;lX.warn=pX});var Rq=I((sX)=>{var v0=A(),u2=b(),Iq="<<",Dq={identify:(q)=>q===Iq||typeof q==="symbol"&&q.description===Iq,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new u2.Scalar(Symbol(Iq)),{addToJSMap:v2}),stringify:()=>Iq},aX=(q,$)=>(Dq.identify($)||v0.isScalar($)&&(!$.type||$.type===u2.Scalar.PLAIN)&&Dq.identify($.value))&&q?.doc.schema.tags.some((X)=>X.tag===Dq.tag&&X.default);function v2(q,$,X){if(X=q&&v0.isAlias(X)?X.resolve(q.doc):X,v0.isSeq(X))for(let Z of X.items)N$(q,$,Z);else if(Array.isArray(X))for(let Z of X)N$(q,$,Z);else N$(q,$,X)}function N$(q,$,X){let Z=q&&v0.isAlias(X)?X.resolve(q.doc):X;if(!v0.isMap(Z))throw Error("Merge sources must be maps or map aliases");let H=Z.toJSON(null,q,Map);for(let[z,U]of H)if($ instanceof Map){if(!$.has(z))$.set(z,U)}else if($ instanceof Set)$.add(z);else if(!Object.prototype.hasOwnProperty.call($,z))Object.defineProperty($,z,{value:U,writable:!0,enumerable:!0,configurable:!0});return $}sX.addMergeToJSMap=v2;sX.isMergeKey=aX;sX.merge=Dq});var b$=I((XZ)=>{var tX=j$(),m2=Rq(),eX=g0(),d2=A(),E$=n();function qZ(q,$,{key:X,value:Z}){if(d2.isNode(X)&&X.addToJSMap)X.addToJSMap(q,$,Z);else if(m2.isMergeKey(q,X))m2.addMergeToJSMap(q,$,Z);else{let H=E$.toJS(X,"",q);if($ instanceof Map)$.set(H,E$.toJS(Z,H,q));else if($ instanceof Set)$.add(H);else{let z=$Z(X,H,q),U=E$.toJS(Z,z,q);if(z in $)Object.defineProperty($,z,{value:U,writable:!0,enumerable:!0,configurable:!0});else $[z]=U}}return $}function $Z(q,$,X){if($===null)return"";if(typeof $!=="object")return String($);if(d2.isNode(q)&&X?.doc){let Z=eX.createStringifyContext(X.doc,{});Z.anchors=new Set;for(let z of X.anchors.keys())Z.anchors.add(z.anchor);Z.inFlow=!0,Z.inStringifyKey=!0;let H=q.toString(Z);if(!X.mapKeyWarned){let z=JSON.stringify(H);if(z.length>40)z=z.substring(0,36)+'..."';tX.warn(X.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${z}. Set mapAsMap: true to use object keys.`),X.mapKeyWarned=!0}return H}return JSON.stringify($)}XZ.addPairToJSMap=qZ});var e=I((QZ)=>{var p2=f0(),HZ=h2(),zZ=b$(),Pq=A();function UZ(q,$,X){let Z=p2.createNode(q,void 0,X),H=p2.createNode($,void 0,X);return new Mq(Z,H)}class Mq{constructor(q,$=null){Object.defineProperty(this,Pq.NODE_TYPE,{value:Pq.PAIR}),this.key=q,this.value=$}clone(q){let{key:$,value:X}=this;if(Pq.isNode($))$=$.clone(q);if(Pq.isNode(X))X=X.clone(q);return new Mq($,X)}toJSON(q,$){let X=$?.mapAsMap?new Map:{};return zZ.addPairToJSMap($,X,this)}toString(q,$,X){return q?.doc?HZ.stringifyPair(this,q,$,X):JSON.stringify(this)}}QZ.Pair=Mq;QZ.createPair=UZ});var C$=I((BZ)=>{var Q0=A(),l2=g0(),Kq=x0();function TZ(q,$,X){return($.inFlow??q.flow?LZ:YZ)(q,$,X)}function YZ({comment:q,items:$},X,{blockItemPrefix:Z,flowChars:H,itemIndent:z,onChompKeep:U,onComment:Q}){let{indent:J,options:{commentString:G}}=X,Y=Object.assign({},X,{indent:z,type:null}),T=!1,L=[];for(let V=0;V<$.length;++V){let B=$[V],W=null;if(Q0.isNode(B)){if(!T&&B.spaceBefore)L.push("");if(wq(X,L,B.commentBefore,T),B.comment)W=B.comment}else if(Q0.isPair(B)){let R=Q0.isNode(B.key)?B.key:null;if(R){if(!T&&R.spaceBefore)L.push("");wq(X,L,R.commentBefore,T)}}T=!1;let D=l2.stringify(B,Y,()=>W=null,()=>T=!0);if(W)D+=Kq.lineComment(D,z,G(W));if(T&&W)T=!1;L.push(Z+D)}let _;if(L.length===0)_=H.start+H.end;else{_=L[0];for(let V=1;V<L.length;++V){let B=L[V];_+=B?`
|
|
72
|
+
${J}${B}`:`
|
|
73
|
+
`}}if(q){if(_+=`
|
|
74
|
+
`+Kq.indentComment(G(q),J),Q)Q()}else if(T&&U)U();return _}function LZ({items:q},$,{flowChars:X,itemIndent:Z}){let{indent:H,indentStep:z,flowCollectionPadding:U,options:{commentString:Q}}=$;Z+=z;let J=Object.assign({},$,{indent:Z,inFlow:!0,type:null}),G=!1,Y=0,T=[];for(let V=0;V<q.length;++V){let B=q[V],W=null;if(Q0.isNode(B)){if(B.spaceBefore)T.push("");if(wq($,T,B.commentBefore,!1),B.comment)W=B.comment}else if(Q0.isPair(B)){let R=Q0.isNode(B.key)?B.key:null;if(R){if(R.spaceBefore)T.push("");if(wq($,T,R.commentBefore,!1),R.comment)G=!0}let K=Q0.isNode(B.value)?B.value:null;if(K){if(K.comment)W=K.comment;if(K.commentBefore)G=!0}else if(B.value==null&&R?.comment)W=R.comment}if(W)G=!0;let D=l2.stringify(B,J,()=>W=null);if(V<q.length-1)D+=",";if(W)D+=Kq.lineComment(D,Z,Q(W));if(!G&&(T.length>Y||D.includes(`
|
|
75
|
+
`)))G=!0;T.push(D),Y=T.length}let{start:L,end:_}=X;if(T.length===0)return L+_;else{if(!G){let V=T.reduce((B,W)=>B+W.length+2,2);G=$.options.lineWidth>0&&V>$.options.lineWidth}if(G){let V=L;for(let B of T)V+=B?`
|
|
76
|
+
${z}${H}${B}`:`
|
|
77
|
+
`;return`${V}
|
|
78
|
+
${H}${_}`}else return`${L}${U}${T.join(" ")}${U}${_}`}}function wq({indent:q,options:{commentString:$}},X,Z,H){if(Z&&H)Z=Z.replace(/^\n+/,"");if(Z){let z=Kq.indentComment($(Z),q);X.push(z.trimStart())}}BZ.stringifyCollection=TZ});var $0=I((RZ)=>{var WZ=C$(),VZ=b$(),IZ=Bq(),q0=A(),Fq=e(),DZ=b();function m0(q,$){let X=q0.isScalar($)?$.value:$;for(let Z of q)if(q0.isPair(Z)){if(Z.key===$||Z.key===X)return Z;if(q0.isScalar(Z.key)&&Z.key.value===X)return Z}return}class c2 extends IZ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(q){super(q0.MAP,q);this.items=[]}static from(q,$,X){let{keepUndefined:Z,replacer:H}=X,z=new this(q),U=(Q,J)=>{if(typeof H==="function")J=H.call($,Q,J);else if(Array.isArray(H)&&!H.includes(Q))return;if(J!==void 0||Z)z.items.push(Fq.createPair(Q,J,X))};if($ instanceof Map)for(let[Q,J]of $)U(Q,J);else if($&&typeof $==="object")for(let Q of Object.keys($))U(Q,$[Q]);if(typeof q.sortMapEntries==="function")z.items.sort(q.sortMapEntries);return z}add(q,$){let X;if(q0.isPair(q))X=q;else if(!q||typeof q!=="object"||!("key"in q))X=new Fq.Pair(q,q?.value);else X=new Fq.Pair(q.key,q.value);let Z=m0(this.items,X.key),H=this.schema?.sortMapEntries;if(Z){if(!$)throw Error(`Key ${X.key} already set`);if(q0.isScalar(Z.value)&&DZ.isScalarValue(X.value))Z.value.value=X.value;else Z.value=X.value}else if(H){let z=this.items.findIndex((U)=>H(X,U)<0);if(z===-1)this.items.push(X);else this.items.splice(z,0,X)}else this.items.push(X)}delete(q){let $=m0(this.items,q);if(!$)return!1;return this.items.splice(this.items.indexOf($),1).length>0}get(q,$){let Z=m0(this.items,q)?.value;return(!$&&q0.isScalar(Z)?Z.value:Z)??void 0}has(q){return!!m0(this.items,q)}set(q,$){this.add(new Fq.Pair(q,$),!0)}toJSON(q,$,X){let Z=X?new X:$?.mapAsMap?new Map:{};if($?.onCreate)$.onCreate(Z);for(let H of this.items)VZ.addPairToJSMap($,Z,H);return Z}toString(q,$,X){if(!q)return JSON.stringify(this);for(let Z of this.items)if(!q0.isPair(Z))throw Error(`Map items must all be pairs; found ${JSON.stringify(Z)} instead`);if(!q.allNullValues&&this.hasAllNullValues(!1))q=Object.assign({},q,{allNullValues:!0});return WZ.stringifyCollection(this,q,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:q.indent||"",onChompKeep:X,onComment:$})}}RZ.YAMLMap=c2;RZ.findPair=m0});var D0=I((FZ)=>{var KZ=A(),i2=$0(),wZ={collection:"map",default:!0,nodeClass:i2.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(q,$){if(!KZ.isMap(q))$("Expected a mapping for this tag");return q},createNode:(q,$,X)=>i2.YAMLMap.from(q,$,X)};FZ.map=wZ});var X0=I((bZ)=>{var AZ=f0(),SZ=C$(),jZ=Bq(),Aq=A(),NZ=b(),EZ=n();class a2 extends jZ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(q){super(Aq.SEQ,q);this.items=[]}add(q){this.items.push(q)}delete(q){let $=Oq(q);if(typeof $!=="number")return!1;return this.items.splice($,1).length>0}get(q,$){let X=Oq(q);if(typeof X!=="number")return;let Z=this.items[X];return!$&&Aq.isScalar(Z)?Z.value:Z}has(q){let $=Oq(q);return typeof $==="number"&&$<this.items.length}set(q,$){let X=Oq(q);if(typeof X!=="number")throw Error(`Expected a valid index, not ${q}.`);let Z=this.items[X];if(Aq.isScalar(Z)&&NZ.isScalarValue($))Z.value=$;else this.items[X]=$}toJSON(q,$){let X=[];if($?.onCreate)$.onCreate(X);let Z=0;for(let H of this.items)X.push(EZ.toJS(H,String(Z++),$));return X}toString(q,$,X){if(!q)return JSON.stringify(this);return SZ.stringifyCollection(this,q,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(q.indent||"")+" ",onChompKeep:X,onComment:$})}static from(q,$,X){let{replacer:Z}=X,H=new this(q);if($&&Symbol.iterator in Object($)){let z=0;for(let U of $){if(typeof Z==="function"){let Q=$ instanceof Set?U:String(z++);U=Z.call($,Q,U)}H.items.push(AZ.createNode(U,void 0,X))}}return H}}function Oq(q){let $=Aq.isScalar(q)?q.value:q;if($&&typeof $==="string")$=Number($);return typeof $==="number"&&Number.isInteger($)&&$>=0?$:null}bZ.YAMLSeq=a2});var R0=I((xZ)=>{var yZ=A(),s2=X0(),fZ={collection:"seq",default:!0,nodeClass:s2.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(q,$){if(!yZ.isSeq(q))$("Expected a sequence for this tag");return q},createNode:(q,$,X)=>s2.YAMLSeq.from(q,$,X)};xZ.seq=fZ});var d0=I((uZ)=>{var hZ=h0(),gZ={identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify(q,$,X,Z){return $=Object.assign({actualString:!0},$),hZ.stringifyString(q,$,X,Z)}};uZ.string=gZ});var Sq=I((mZ)=>{var r2=b(),n2={identify:(q)=>q==null,createNode:()=>new r2.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new r2.Scalar(null),stringify:({source:q},$)=>typeof q==="string"&&n2.test.test(q)?q:$.options.nullStr};mZ.nullTag=n2});var y$=I((lZ)=>{var pZ=b(),o2={identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(q)=>new pZ.Scalar(q[0]==="t"||q[0]==="T"),stringify({source:q,value:$},X){if(q&&o2.test.test(q)){let Z=q[0]==="t"||q[0]==="T";if($===Z)return q}return $?X.options.trueStr:X.options.falseStr}};lZ.boolTag=o2});var P0=I((aZ)=>{function iZ({format:q,minFractionDigits:$,tag:X,value:Z}){if(typeof Z==="bigint")return String(Z);let H=typeof Z==="number"?Z:Number(Z);if(!isFinite(H))return isNaN(H)?".nan":H<0?"-.inf":".inf";let z=Object.is(Z,-0)?"-0":JSON.stringify(Z);if(!q&&$&&(!X||X==="tag:yaml.org,2002:float")&&/^\d/.test(z)){let U=z.indexOf(".");if(U<0)U=z.length,z+=".";let Q=$-(z.length-U-1);while(Q-- >0)z+="0"}return z}aZ.stringifyNumber=iZ});var x$=I((eZ)=>{var rZ=b(),f$=P0(),nZ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:f$.stringifyNumber},oZ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():f$.stringifyNumber(q)}},tZ={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(q){let $=new rZ.Scalar(parseFloat(q)),X=q.indexOf(".");if(X!==-1&&q[q.length-1]==="0")$.minFractionDigits=q.length-X-1;return $},stringify:f$.stringifyNumber};eZ.float=tZ;eZ.floatExp=oZ;eZ.floatNaN=nZ});var h$=I((U6)=>{var t2=P0(),jq=(q)=>typeof q==="bigint"||Number.isInteger(q),k$=(q,$,X,{intAsBigInt:Z})=>Z?BigInt(q):parseInt(q.substring($),X);function e2(q,$,X){let{value:Z}=q;if(jq(Z)&&Z>=0)return X+Z.toString($);return t2.stringifyNumber(q)}var Z6={identify:(q)=>jq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(q,$,X)=>k$(q,2,8,X),stringify:(q)=>e2(q,8,"0o")},H6={identify:jq,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(q,$,X)=>k$(q,0,10,X),stringify:t2.stringifyNumber},z6={identify:(q)=>jq(q)&&q>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(q,$,X)=>k$(q,2,16,X),stringify:(q)=>e2(q,16,"0x")};U6.int=H6;U6.intHex=z6;U6.intOct=Z6});var q9=I((V6)=>{var T6=D0(),Y6=Sq(),L6=R0(),B6=d0(),_6=y$(),g$=x$(),u$=h$(),W6=[T6.map,L6.seq,B6.string,Y6.nullTag,_6.boolTag,u$.intOct,u$.int,u$.intHex,g$.floatNaN,g$.floatExp,g$.float];V6.schema=W6});var X9=I((F6)=>{var D6=b(),R6=D0(),P6=R0();function $9(q){return typeof q==="bigint"||Number.isInteger(q)}var Nq=({value:q})=>JSON.stringify(q),M6=[{identify:(q)=>typeof q==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(q)=>q,stringify:Nq},{identify:(q)=>q==null,createNode:()=>new D6.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Nq},{identify:(q)=>typeof q==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(q)=>q==="true",stringify:Nq},{identify:$9,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(q,$,{intAsBigInt:X})=>X?BigInt(q):parseInt(q,10),stringify:({value:q})=>$9(q)?q.toString():JSON.stringify(q)},{identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(q)=>parseFloat(q),stringify:Nq}],K6={default:!0,tag:"",test:/^/,resolve(q,$){return $(`Unresolved plain scalar ${JSON.stringify(q)}`),q}},w6=[R6.map,P6.seq].concat(M6,K6);F6.schema=w6});var m$=I((j6)=>{var p0=c("buffer"),v$=b(),A6=h0(),S6={identify:(q)=>q instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(q,$){if(typeof p0.Buffer==="function")return p0.Buffer.from(q,"base64");else if(typeof atob==="function"){let X=atob(q.replace(/[\n\r]/g,"")),Z=new Uint8Array(X.length);for(let H=0;H<X.length;++H)Z[H]=X.charCodeAt(H);return Z}else return $("This environment does not support reading binary tags; either Buffer or atob is required"),q},stringify({comment:q,type:$,value:X},Z,H,z){if(!X)return"";let U=X,Q;if(typeof p0.Buffer==="function")Q=U instanceof p0.Buffer?U.toString("base64"):p0.Buffer.from(U.buffer).toString("base64");else if(typeof btoa==="function"){let J="";for(let G=0;G<U.length;++G)J+=String.fromCharCode(U[G]);Q=btoa(J)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if($??($=v$.Scalar.BLOCK_LITERAL),$!==v$.Scalar.QUOTE_DOUBLE){let J=Math.max(Z.options.lineWidth-Z.indent.length,Z.options.minContentWidth),G=Math.ceil(Q.length/J),Y=Array(G);for(let T=0,L=0;T<G;++T,L+=J)Y[T]=Q.substr(L,J);Q=Y.join($===v$.Scalar.BLOCK_LITERAL?`
|
|
79
|
+
`:" ")}return A6.stringifyString({comment:q,type:$,value:Q},Z,H,z)}};j6.binary=S6});var bq=I((y6)=>{var Eq=A(),d$=e(),E6=b(),b6=X0();function Z9(q,$){if(Eq.isSeq(q))for(let X=0;X<q.items.length;++X){let Z=q.items[X];if(Eq.isPair(Z))continue;else if(Eq.isMap(Z)){if(Z.items.length>1)$("Each pair must have its own sequence indicator");let H=Z.items[0]||new d$.Pair(new E6.Scalar(null));if(Z.commentBefore)H.key.commentBefore=H.key.commentBefore?`${Z.commentBefore}
|
|
80
|
+
${H.key.commentBefore}`:Z.commentBefore;if(Z.comment){let z=H.value??H.key;z.comment=z.comment?`${Z.comment}
|
|
81
|
+
${z.comment}`:Z.comment}Z=H}q.items[X]=Eq.isPair(Z)?Z:new d$.Pair(Z)}else $("Expected a sequence for this tag");return q}function H9(q,$,X){let{replacer:Z}=X,H=new b6.YAMLSeq(q);H.tag="tag:yaml.org,2002:pairs";let z=0;if($&&Symbol.iterator in Object($))for(let U of $){if(typeof Z==="function")U=Z.call($,String(z++),U);let Q,J;if(Array.isArray(U))if(U.length===2)Q=U[0],J=U[1];else throw TypeError(`Expected [key, value] tuple: ${U}`);else if(U&&U instanceof Object){let G=Object.keys(U);if(G.length===1)Q=G[0],J=U[Q];else throw TypeError(`Expected tuple with one key, not ${G.length} keys`)}else Q=U;H.items.push(d$.createPair(Q,J,X))}return H}var C6={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Z9,createNode:H9};y6.createPairs=H9;y6.pairs=C6;y6.resolvePairs=Z9});var l$=I((u6)=>{var z9=A(),p$=n(),l0=$0(),h6=X0(),U9=bq();class G0 extends h6.YAMLSeq{constructor(){super();this.add=l0.YAMLMap.prototype.add.bind(this),this.delete=l0.YAMLMap.prototype.delete.bind(this),this.get=l0.YAMLMap.prototype.get.bind(this),this.has=l0.YAMLMap.prototype.has.bind(this),this.set=l0.YAMLMap.prototype.set.bind(this),this.tag=G0.tag}toJSON(q,$){if(!$)return super.toJSON(q);let X=new Map;if($?.onCreate)$.onCreate(X);for(let Z of this.items){let H,z;if(z9.isPair(Z))H=p$.toJS(Z.key,"",$),z=p$.toJS(Z.value,H,$);else H=p$.toJS(Z,"",$);if(X.has(H))throw Error("Ordered maps must not include duplicate keys");X.set(H,z)}return X}static from(q,$,X){let Z=U9.createPairs(q,$,X),H=new this;return H.items=Z.items,H}}G0.tag="tag:yaml.org,2002:omap";var g6={collection:"seq",identify:(q)=>q instanceof Map,nodeClass:G0,default:!1,tag:"tag:yaml.org,2002:omap",resolve(q,$){let X=U9.resolvePairs(q,$),Z=[];for(let{key:H}of X.items)if(z9.isScalar(H))if(Z.includes(H.value))$(`Ordered maps must not include duplicate keys: ${H.value}`);else Z.push(H.value);return Object.assign(new G0,X)},createNode:(q,$,X)=>G0.from(q,$,X)};u6.YAMLOMap=G0;u6.omap=g6});var Y9=I((d6)=>{var Q9=b();function G9({value:q,source:$},X){if($&&(q?J9:T9).test.test($))return $;return q?X.options.trueStr:X.options.falseStr}var J9={identify:(q)=>q===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Q9.Scalar(!0),stringify:G9},T9={identify:(q)=>q===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Q9.Scalar(!1),stringify:G9};d6.falseTag=T9;d6.trueTag=J9});var L9=I((r6)=>{var c6=b(),c$=P0(),i6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(q)=>q.slice(-3).toLowerCase()==="nan"?NaN:q[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:c$.stringifyNumber},a6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(q)=>parseFloat(q.replace(/_/g,"")),stringify(q){let $=Number(q.value);return isFinite($)?$.toExponential():c$.stringifyNumber(q)}},s6={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(q){let $=new c6.Scalar(parseFloat(q.replace(/_/g,""))),X=q.indexOf(".");if(X!==-1){let Z=q.substring(X+1).replace(/_/g,"");if(Z[Z.length-1]==="0")$.minFractionDigits=Z.length}return $},stringify:c$.stringifyNumber};r6.float=s6;r6.floatExp=a6;r6.floatNaN=i6});var _9=I((ZH)=>{var B9=P0(),c0=(q)=>typeof q==="bigint"||Number.isInteger(q);function Cq(q,$,X,{intAsBigInt:Z}){let H=q[0];if(H==="-"||H==="+")$+=1;if(q=q.substring($).replace(/_/g,""),Z){switch(X){case 2:q=`0b${q}`;break;case 8:q=`0o${q}`;break;case 16:q=`0x${q}`;break}let U=BigInt(q);return H==="-"?BigInt(-1)*U:U}let z=parseInt(q,X);return H==="-"?-1*z:z}function i$(q,$,X){let{value:Z}=q;if(c0(Z)){let H=Z.toString($);return Z<0?"-"+X+H.substr(1):X+H}return B9.stringifyNumber(q)}var e6={identify:c0,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(q,$,X)=>Cq(q,2,2,X),stringify:(q)=>i$(q,2,"0b")},qH={identify:c0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(q,$,X)=>Cq(q,1,8,X),stringify:(q)=>i$(q,8,"0")},$H={identify:c0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(q,$,X)=>Cq(q,0,10,X),stringify:B9.stringifyNumber},XH={identify:c0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(q,$,X)=>Cq(q,2,16,X),stringify:(q)=>i$(q,16,"0x")};ZH.int=$H;ZH.intBin=e6;ZH.intHex=XH;ZH.intOct=qH});var a$=I((JH)=>{var xq=A(),yq=e(),fq=$0();class J0 extends fq.YAMLMap{constructor(q){super(q);this.tag=J0.tag}add(q){let $;if(xq.isPair(q))$=q;else if(q&&typeof q==="object"&&"key"in q&&"value"in q&&q.value===null)$=new yq.Pair(q.key,null);else $=new yq.Pair(q,null);if(!fq.findPair(this.items,$.key))this.items.push($)}get(q,$){let X=fq.findPair(this.items,q);return!$&&xq.isPair(X)?xq.isScalar(X.key)?X.key.value:X.key:X}set(q,$){if(typeof $!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof $}`);let X=fq.findPair(this.items,q);if(X&&!$)this.items.splice(this.items.indexOf(X),1);else if(!X&&$)this.items.push(new yq.Pair(q))}toJSON(q,$){return super.toJSON(q,$,Set)}toString(q,$,X){if(!q)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},q,{allNullValues:!0}),$,X);else throw Error("Set items must all have null values")}static from(q,$,X){let{replacer:Z}=X,H=new this(q);if($&&Symbol.iterator in Object($))for(let z of $){if(typeof Z==="function")z=Z.call($,z,z);H.items.push(yq.createPair(z,null,X))}return H}}J0.tag="tag:yaml.org,2002:set";var GH={collection:"map",identify:(q)=>q instanceof Set,nodeClass:J0,default:!1,tag:"tag:yaml.org,2002:set",createNode:(q,$,X)=>J0.from(q,$,X),resolve(q,$){if(xq.isMap(q))if(q.hasAllNullValues(!0))return Object.assign(new J0,q);else $("Set items must all have null values");else $("Expected a mapping for this tag");return q}};JH.YAMLSet=J0;JH.set=GH});var r$=I((WH)=>{var LH=P0();function s$(q,$){let X=q[0],Z=X==="-"||X==="+"?q.substring(1):q,H=(U)=>$?BigInt(U):Number(U),z=Z.replace(/_/g,"").split(":").reduce((U,Q)=>U*H(60)+H(Q),H(0));return X==="-"?H(-1)*z:z}function W9(q){let{value:$}=q,X=(U)=>U;if(typeof $==="bigint")X=(U)=>BigInt(U);else if(isNaN($)||!isFinite($))return LH.stringifyNumber(q);let Z="";if($<0)Z="-",$*=X(-1);let H=X(60),z=[$%H];if($<60)z.unshift(0);else if($=($-z[0])/H,z.unshift($%H),$>=60)$=($-z[0])/H,z.unshift($);return Z+z.map((U)=>String(U).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var BH={identify:(q)=>typeof q==="bigint"||Number.isInteger(q),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(q,$,{intAsBigInt:X})=>s$(q,X),stringify:W9},_H={identify:(q)=>typeof q==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(q)=>s$(q,!1),stringify:W9},V9={identify:(q)=>q 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(q){let $=q.match(V9.test);if(!$)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,Z,H,z,U,Q]=$.map(Number),J=$[7]?Number(($[7]+"00").substr(1,3)):0,G=Date.UTC(X,Z-1,H,z||0,U||0,Q||0,J),Y=$[8];if(Y&&Y!=="Z"){let T=s$(Y,!1);if(Math.abs(T)<30)T*=60;G-=60000*T}return new Date(G)},stringify:({value:q})=>q?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};WH.floatTime=_H;WH.intTime=BH;WH.timestamp=V9});var D9=I((NH)=>{var RH=D0(),PH=Sq(),MH=R0(),KH=d0(),wH=m$(),I9=Y9(),n$=L9(),kq=_9(),FH=Rq(),OH=l$(),AH=bq(),SH=a$(),o$=r$(),jH=[RH.map,MH.seq,KH.string,PH.nullTag,I9.trueTag,I9.falseTag,kq.intBin,kq.intOct,kq.int,kq.intHex,n$.floatNaN,n$.floatExp,n$.float,wH.binary,FH.merge,OH.omap,AH.pairs,SH.set,o$.intTime,o$.floatTime,o$.timestamp];NH.schema=jH});var j9=I((gH)=>{var K9=D0(),bH=Sq(),w9=R0(),CH=d0(),yH=y$(),t$=x$(),e$=h$(),fH=q9(),xH=X9(),F9=m$(),i0=Rq(),O9=l$(),A9=bq(),R9=D9(),S9=a$(),hq=r$(),P9=new Map([["core",fH.schema],["failsafe",[K9.map,w9.seq,CH.string]],["json",xH.schema],["yaml11",R9.schema],["yaml-1.1",R9.schema]]),M9={binary:F9.binary,bool:yH.boolTag,float:t$.float,floatExp:t$.floatExp,floatNaN:t$.floatNaN,floatTime:hq.floatTime,int:e$.int,intHex:e$.intHex,intOct:e$.intOct,intTime:hq.intTime,map:K9.map,merge:i0.merge,null:bH.nullTag,omap:O9.omap,pairs:A9.pairs,seq:w9.seq,set:S9.set,timestamp:hq.timestamp},kH={"tag:yaml.org,2002:binary":F9.binary,"tag:yaml.org,2002:merge":i0.merge,"tag:yaml.org,2002:omap":O9.omap,"tag:yaml.org,2002:pairs":A9.pairs,"tag:yaml.org,2002:set":S9.set,"tag:yaml.org,2002:timestamp":hq.timestamp};function hH(q,$,X){let Z=P9.get($);if(Z&&!q)return X&&!Z.includes(i0.merge)?Z.concat(i0.merge):Z.slice();let H=Z;if(!H)if(Array.isArray(q))H=[];else{let z=Array.from(P9.keys()).filter((U)=>U!=="yaml11").map((U)=>JSON.stringify(U)).join(", ");throw Error(`Unknown schema "${$}"; use one of ${z} or define customTags array`)}if(Array.isArray(q))for(let z of q)H=H.concat(z);else if(typeof q==="function")H=q(H.slice());if(X)H=H.concat(i0.merge);return H.reduce((z,U)=>{let Q=typeof U==="string"?M9[U]:U;if(!Q){let J=JSON.stringify(U),G=Object.keys(M9).map((Y)=>JSON.stringify(Y)).join(", ");throw Error(`Unknown custom tag ${J}; use one of ${G}`)}if(!z.includes(Q))z.push(Q);return z},[])}gH.coreKnownTags=kH;gH.getTags=hH});var X1=I((cH)=>{var q1=A(),mH=D0(),dH=R0(),pH=d0(),gq=j9(),lH=(q,$)=>q.key<$.key?-1:q.key>$.key?1:0;class $1{constructor({compat:q,customTags:$,merge:X,resolveKnownTags:Z,schema:H,sortMapEntries:z,toStringDefaults:U}){this.compat=Array.isArray(q)?gq.getTags(q,"compat"):q?gq.getTags(null,q):null,this.name=typeof H==="string"&&H||"core",this.knownTags=Z?gq.coreKnownTags:{},this.tags=gq.getTags($,this.name,X),this.toStringOptions=U??null,Object.defineProperty(this,q1.MAP,{value:mH.map}),Object.defineProperty(this,q1.SCALAR,{value:pH.string}),Object.defineProperty(this,q1.SEQ,{value:dH.seq}),this.sortMapEntries=typeof z==="function"?z:z===!0?lH:null}clone(){let q=Object.create($1.prototype,Object.getOwnPropertyDescriptors(this));return q.tags=this.tags.slice(),q}}cH.Schema=$1});var N9=I((rH)=>{var aH=A(),Z1=g0(),a0=x0();function sH(q,$){let X=[],Z=$.directives===!0;if($.directives!==!1&&q.directives){let J=q.directives.toString(q);if(J)X.push(J),Z=!0;else if(q.directives.docStart)Z=!0}if(Z)X.push("---");let H=Z1.createStringifyContext(q,$),{commentString:z}=H.options;if(q.commentBefore){if(X.length!==1)X.unshift("");let J=z(q.commentBefore);X.unshift(a0.indentComment(J,""))}let U=!1,Q=null;if(q.contents){if(aH.isNode(q.contents)){if(q.contents.spaceBefore&&Z)X.push("");if(q.contents.commentBefore){let Y=z(q.contents.commentBefore);X.push(a0.indentComment(Y,""))}H.forceBlockIndent=!!q.comment,Q=q.contents.comment}let J=Q?void 0:()=>U=!0,G=Z1.stringify(q.contents,H,()=>Q=null,J);if(Q)G+=a0.lineComment(G,"",z(Q));if((G[0]==="|"||G[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${G}`;else X.push(G)}else X.push(Z1.stringify(q.contents,H));if(q.directives?.docEnd)if(q.comment){let J=z(q.comment);if(J.includes(`
|
|
82
|
+
`))X.push("..."),X.push(a0.indentComment(J,""));else X.push(`... ${J}`)}else X.push("...");else{let J=q.comment;if(J&&U)J=J.replace(/^\n+/,"");if(J){if((!U||Q)&&X[X.length-1]!=="")X.push("");X.push(a0.indentComment(z(J),""))}}return X.join(`
|
|
83
83
|
`)+`
|
|
84
|
-
`}
|
|
85
|
-
`;
|
|
86
|
-
|
|
87
|
-
${H}
|
|
88
|
-
${z}
|
|
89
|
-
`}};kL.YAMLError=Z6;kL.YAMLParseError=S5;kL.YAMLWarning=E5;kL.prettifyError=_L});var J8=p((fL)=>{function hL(X,{flow:Q,indicator:$,next:Y,offset:G,onError:J,parentIndent:H,startOnNewline:W}){let U=!1,z=W,L=W,B="",F="",Z=!1,I=!1,A=null,D=null,q=null,M=null,K=null,V=null,N=null;for(let j of X){if(I){if(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma")J(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");I=!1}if(A){if(z&&j.type!=="comment"&&j.type!=="newline")J(A,"TAB_AS_INDENT","Tabs are not allowed as indentation");A=null}switch(j.type){case"space":if(!Q&&($!=="doc-start"||Y?.type!=="flow-collection")&&j.source.includes("\t"))A=j;L=!0;break;case"comment":{if(!L)J(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let E=j.source.substring(1)||" ";if(!B)B=E;else B+=F+E;F="",z=!1;break}case"newline":if(z){if(B)B+=j.source;else if(!V||$!=="seq-item-ind")U=!0}else F+=j.source;if(z=!0,Z=!0,D||q)M=j;L=!0;break;case"anchor":if(D)J(j,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(j.source.endsWith(":"))J(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);D=j,N??(N=j.offset),z=!1,L=!1,I=!0;break;case"tag":{if(q)J(j,"MULTIPLE_TAGS","A node can have at most one tag");q=j,N??(N=j.offset),z=!1,L=!1,I=!0;break}case $:if(D||q)J(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`);if(V)J(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${Q??"collection"}`);V=j,z=$==="seq-item-ind"||$==="explicit-key-ind",L=!1;break;case"comma":if(Q){if(K)J(j,"UNEXPECTED_TOKEN",`Unexpected , in ${Q}`);K=j,z=!1,L=!1;break}default:J(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),z=!1,L=!1}}let O=X[X.length-1],w=O?O.offset+O.source.length:G;if(I&&Y&&Y.type!=="space"&&Y.type!=="newline"&&Y.type!=="comma"&&(Y.type!=="scalar"||Y.source!==""))J(Y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(A&&(z&&A.indent<=H||Y?.type==="block-map"||Y?.type==="block-seq"))J(A,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:K,found:V,spaceBefore:U,comment:B,hasNewline:Z,anchor:D,tag:q,newlineAfterProp:M,end:w,start:N??w}}fL.resolveProps=hL});var A6=p((mL)=>{function wQ(X){if(!X)return null;switch(X.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(X.source.includes(`
|
|
90
|
-
`))return!0;if(X.end){for(let Q of X.end)if(Q.type==="newline")return!0}return!1;case"flow-collection":for(let Q of X.items){for(let $ of Q.start)if($.type==="newline")return!0;if(Q.sep){for(let $ of Q.sep)if($.type==="newline")return!0}if(wQ(Q.key)||wQ(Q.value))return!0}return!1;default:return!0}}mL.containsNewline=wQ});var IQ=p((dL)=>{var cL=A6();function pL(X,Q,$){if(Q?.type==="flow-collection"){let Y=Q.end[0];if(Y.indent===X&&(Y.source==="]"||Y.source==="}")&&cL.containsNewline(Q))$(Y,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}dL.flowIndentCheck=pL});var jQ=p((rL)=>{var b5=V0();function nL(X,Q,$){let{uniqueKeys:Y}=X.options;if(Y===!1)return!1;let G=typeof Y==="function"?Y:(J,H)=>J===H||b5.isScalar(J)&&b5.isScalar(H)&&J.value===H.value;return Q.some((J)=>G(J.key,$))}rL.mapIncludes=nL});var y5=p((Xq)=>{var C5=y1(),aL=g1(),_5=J8(),sL=A6(),k5=IQ(),tL=jQ(),v5="All mapping items must start at the same column";function eL({composeNode:X,composeEmptyNode:Q},$,Y,G,J){let W=new(J?.nodeClass??aL.YAMLMap)($.schema);if($.atRoot)$.atRoot=!1;let U=Y.offset,z=null;for(let L of Y.items){let{start:B,key:F,sep:Z,value:I}=L,A=_5.resolveProps(B,{indicator:"explicit-key-ind",next:F??Z?.[0],offset:U,onError:G,parentIndent:Y.indent,startOnNewline:!0}),D=!A.found;if(D){if(F){if(F.type==="block-seq")G(U,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in F&&F.indent!==Y.indent)G(U,"BAD_INDENT",v5)}if(!A.anchor&&!A.tag&&!Z){if(z=A.end,A.comment)if(W.comment)W.comment+=`
|
|
91
|
-
`+A.comment;else W.comment=A.comment;continue}if(A.newlineAfterProp||sL.containsNewline(F))G(F??B[B.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(A.found?.indent!==Y.indent)G(U,"BAD_INDENT",v5);$.atKey=!0;let q=A.end,M=F?X($,F,A,G):Q($,q,B,null,A,G);if($.schema.compat)k5.flowIndentCheck(Y.indent,F,G);if($.atKey=!1,tL.mapIncludes($,W.items,M))G(q,"DUPLICATE_KEY","Map keys must be unique");let K=_5.resolveProps(Z??[],{indicator:"map-value-ind",next:I,offset:M.range[2],onError:G,parentIndent:Y.indent,startOnNewline:!F||F.type==="block-scalar"});if(U=K.end,K.found){if(D){if(I?.type==="block-map"&&!K.hasNewline)G(U,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if($.options.strict&&A.start<K.found.offset-1024)G(M.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let V=I?X($,I,K,G):Q($,U,Z,null,K,G);if($.schema.compat)k5.flowIndentCheck(Y.indent,I,G);U=V.range[2];let N=new C5.Pair(M,V);if($.options.keepSourceTokens)N.srcToken=L;W.items.push(N)}else{if(D)G(M.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(K.comment)if(M.comment)M.comment+=`
|
|
92
|
-
`+K.comment;else M.comment=K.comment;let V=new C5.Pair(M);if($.options.keepSourceTokens)V.srcToken=L;W.items.push(V)}}if(z&&z<U)G(z,"IMPOSSIBLE","Map comment with trailing content");return W.range=[Y.offset,U,z??U],W}Xq.resolveBlockMap=eL});var x5=p((Hq)=>{var $q=h1(),Yq=J8(),Gq=IQ();function Jq({composeNode:X,composeEmptyNode:Q},$,Y,G,J){let W=new(J?.nodeClass??$q.YAMLSeq)($.schema);if($.atRoot)$.atRoot=!1;if($.atKey)$.atKey=!1;let U=Y.offset,z=null;for(let{start:L,value:B}of Y.items){let F=Yq.resolveProps(L,{indicator:"seq-item-ind",next:B,offset:U,onError:G,parentIndent:Y.indent,startOnNewline:!0});if(!F.found)if(F.anchor||F.tag||B)if(B?.type==="block-seq")G(F.end,"BAD_INDENT","All sequence items must start at the same column");else G(U,"MISSING_CHAR","Sequence item without - indicator");else{if(z=F.end,F.comment)W.comment=F.comment;continue}let Z=B?X($,B,F,G):Q($,F.end,L,null,F,G);if($.schema.compat)Gq.flowIndentCheck(Y.indent,B,G);U=Z.range[2],W.items.push(Z)}return W.range=[Y.offset,U,z??U],W}Hq.resolveBlockSeq=Jq});var K9=p((zq)=>{function Uq(X,Q,$,Y){let G="";if(X){let J=!1,H="";for(let W of X){let{source:U,type:z}=W;switch(z){case"space":J=!0;break;case"comment":{if($&&!J)Y(W,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let L=U.substring(1)||" ";if(!G)G=L;else G+=H+L;H="";break}case"newline":if(G)H+=U;J=!0;break;default:Y(W,"UNEXPECTED_TOKEN",`Unexpected ${z} at node end`)}Q+=U.length}}return{comment:G,offset:Q}}zq.resolveEnd=Uq});var f5=p((Oq)=>{var Lq=V0(),qq=y1(),g5=g1(),Fq=h1(),Vq=K9(),h5=J8(),Kq=A6(),Mq=jQ(),PQ="Block collections are not allowed within flow collections",TQ=(X)=>X&&(X.type==="block-map"||X.type==="block-seq");function Dq({composeNode:X,composeEmptyNode:Q},$,Y,G,J){let H=Y.start.source==="{",W=H?"flow map":"flow sequence",z=new(J?.nodeClass??(H?g5.YAMLMap:Fq.YAMLSeq))($.schema);z.flow=!0;let L=$.atRoot;if(L)$.atRoot=!1;if($.atKey)$.atKey=!1;let B=Y.offset+Y.start.source.length;for(let D=0;D<Y.items.length;++D){let q=Y.items[D],{start:M,key:K,sep:V,value:N}=q,O=h5.resolveProps(M,{flow:W,indicator:"explicit-key-ind",next:K??V?.[0],offset:B,onError:G,parentIndent:Y.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!V&&!N){if(D===0&&O.comma)G(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${W}`);else if(D<Y.items.length-1)G(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${W}`);if(O.comment)if(z.comment)z.comment+=`
|
|
93
|
-
`+O.comment;else z.comment=O.comment;B=O.end;continue}if(!H&&$.options.strict&&Kq.containsNewline(K))G(K,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0){if(O.comma)G(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${W}`)}else{if(!O.comma)G(O.start,"MISSING_CHAR",`Missing , between ${W} items`);if(O.comment){let w="";X:for(let j of M)switch(j.type){case"comma":case"space":break;case"comment":w=j.source.substring(1);break X;default:break X}if(w){let j=z.items[z.items.length-1];if(Lq.isPair(j))j=j.value??j.key;if(j.comment)j.comment+=`
|
|
94
|
-
`+w;else j.comment=w;O.comment=O.comment.substring(w.length+1)}}}if(!H&&!V&&!O.found){let w=N?X($,N,O,G):Q($,O.end,V,null,O,G);if(z.items.push(w),B=w.range[2],TQ(N))G(w.range,"BLOCK_IN_FLOW",PQ)}else{$.atKey=!0;let w=O.end,j=K?X($,K,O,G):Q($,w,M,null,O,G);if(TQ(K))G(j.range,"BLOCK_IN_FLOW",PQ);$.atKey=!1;let E=h5.resolveProps(V??[],{flow:W,indicator:"map-value-ind",next:N,offset:j.range[2],onError:G,parentIndent:Y.indent,startOnNewline:!1});if(E.found){if(!H&&!O.found&&$.options.strict){if(V)for(let x of V){if(x===E.found)break;if(x.type==="newline"){G(x,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(O.start<E.found.offset-1024)G(E.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(N)if("source"in N&&N.source?.[0]===":")G(N,"MISSING_CHAR",`Missing space after : in ${W}`);else G(E.start,"MISSING_CHAR",`Missing , or : between ${W} items`);let g=N?X($,N,E,G):E.found?Q($,E.end,V,null,E,G):null;if(g){if(TQ(N))G(g.range,"BLOCK_IN_FLOW",PQ)}else if(E.comment)if(j.comment)j.comment+=`
|
|
95
|
-
`+E.comment;else j.comment=E.comment;let k=new qq.Pair(j,g);if($.options.keepSourceTokens)k.srcToken=q;if(H){let x=z;if(Mq.mapIncludes($,x.items,j))G(w,"DUPLICATE_KEY","Map keys must be unique");x.items.push(k)}else{let x=new g5.YAMLMap($.schema);x.flow=!0,x.items.push(k);let u=(g??j).range;x.range=[j.range[0],u[1],u[2]],z.items.push(x)}B=g?g.range[2]:E.end}}let F=H?"}":"]",[Z,...I]=Y.end,A=B;if(Z?.source===F)A=Z.offset+Z.source.length;else{let D=W[0].toUpperCase()+W.substring(1),q=L?`${D} must end with a ${F}`:`${D} in block collection must be sufficiently indented and end with a ${F}`;if(G(B,L?"MISSING_CHAR":"BAD_INDENT",q),Z&&Z.source.length!==1)I.unshift(Z)}if(I.length>0){let D=Vq.resolveEnd(I,A,$.options.strict,G);if(D.comment)if(z.comment)z.comment+=`
|
|
96
|
-
`+D.comment;else z.comment=D.comment;z.range=[Y.offset,A,D.offset]}else z.range=[Y.offset,A,A];return z}Oq.resolveFlowCollection=Dq});var u5=p((Sq)=>{var Aq=V0(),Nq=k0(),Rq=g1(),wq=h1(),Iq=y5(),jq=x5(),Pq=f5();function SQ(X,Q,$,Y,G,J){let H=$.type==="block-map"?Iq.resolveBlockMap(X,Q,$,Y,J):$.type==="block-seq"?jq.resolveBlockSeq(X,Q,$,Y,J):Pq.resolveFlowCollection(X,Q,$,Y,J),W=H.constructor;if(G==="!"||G===W.tagName)return H.tag=W.tagName,H;if(G)H.tag=G;return H}function Tq(X,Q,$,Y,G){let J=Y.tag,H=!J?null:Q.directives.tagName(J.source,(F)=>G(J,"TAG_RESOLVE_FAILED",F));if($.type==="block-seq"){let{anchor:F,newlineAfterProp:Z}=Y,I=F&&J?F.offset>J.offset?F:J:F??J;if(I&&(!Z||Z.offset<I.offset))G(I,"MISSING_CHAR","Missing newline after block sequence props")}let W=$.type==="block-map"?"map":$.type==="block-seq"?"seq":$.start.source==="{"?"map":"seq";if(!J||!H||H==="!"||H===Rq.YAMLMap.tagName&&W==="map"||H===wq.YAMLSeq.tagName&&W==="seq")return SQ(X,Q,$,G,H);let U=Q.schema.tags.find((F)=>F.tag===H&&F.collection===W);if(!U){let F=Q.schema.knownTags[H];if(F?.collection===W)Q.schema.tags.push(Object.assign({},F,{default:!1})),U=F;else{if(F)G(J,"BAD_COLLECTION_TYPE",`${F.tag} used for ${W} collection, but expects ${F.collection??"scalar"}`,!0);else G(J,"TAG_RESOLVE_FAILED",`Unresolved tag: ${H}`,!0);return SQ(X,Q,$,G,H)}}let z=SQ(X,Q,$,G,H,U),L=U.resolve?.(z,(F)=>G(J,"TAG_RESOLVE_FAILED",F),Q.options)??z,B=Aq.isNode(L)?L:new Nq.Scalar(L);if(B.range=z.range,B.tag=H,U?.format)B.format=U.format;return B}Sq.composeCollection=Tq});var bQ=p((kq)=>{var EQ=k0();function bq(X,Q,$){let Y=Q.offset,G=Cq(Q,X.options.strict,$);if(!G)return{value:"",type:null,comment:"",range:[Y,Y,Y]};let J=G.mode===">"?EQ.Scalar.BLOCK_FOLDED:EQ.Scalar.BLOCK_LITERAL,H=Q.source?_q(Q.source):[],W=H.length;for(let A=H.length-1;A>=0;--A){let D=H[A][1];if(D===""||D==="\r")W=A;else break}if(W===0){let A=G.chomp==="+"&&H.length>0?`
|
|
97
|
-
`.repeat(Math.max(1,H.length-1)):"",D=Y+G.length;if(Q.source)D+=Q.source.length;return{value:A,type:J,comment:G.comment,range:[Y,D,D]}}let U=Q.indent+G.indent,z=Q.offset+G.length,L=0;for(let A=0;A<W;++A){let[D,q]=H[A];if(q===""||q==="\r"){if(G.indent===0&&D.length>U)U=D.length}else{if(D.length<U)$(z+D.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(G.indent===0)U=D.length;if(L=A,U===0&&!X.atRoot)$(z,"BAD_INDENT","Block scalar values in collections must be indented");break}z+=D.length+q.length+1}for(let A=H.length-1;A>=W;--A)if(H[A][0].length>U)W=A+1;let B="",F="",Z=!1;for(let A=0;A<L;++A)B+=H[A][0].slice(U)+`
|
|
98
|
-
`;for(let A=L;A<W;++A){let[D,q]=H[A];z+=D.length+q.length+1;let M=q[q.length-1]==="\r";if(M)q=q.slice(0,-1);if(q&&D.length<U){let V=`Block scalar lines must not be less indented than their ${G.indent?"explicit indentation indicator":"first line"}`;$(z-q.length-(M?2:1),"BAD_INDENT",V),D=""}if(J===EQ.Scalar.BLOCK_LITERAL)B+=F+D.slice(U)+q,F=`
|
|
99
|
-
`;else if(D.length>U||q[0]==="\t"){if(F===" ")F=`
|
|
100
|
-
`;else if(!Z&&F===`
|
|
101
|
-
`)F=`
|
|
84
|
+
`}rH.stringifyDocument=sH});var s0=I((Hz)=>{var oH=y0(),M0=Bq(),h=A(),tH=e(),eH=n(),qz=X1(),$z=N9(),H1=Tq(),Xz=w$(),Zz=f0(),z1=K$();class U1{constructor(q,$,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,h.NODE_TYPE,{value:h.DOC});let Z=null;if(typeof $==="function"||Array.isArray($))Z=$;else if(X===void 0&&$)X=$,$=void 0;let H=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},X);this.options=H;let{version:z}=H;if(X?._directives){if(this.directives=X._directives.atDocument(),this.directives.yaml.explicit)z=this.directives.yaml.version}else this.directives=new z1.Directives({version:z});this.setSchema(z,X),this.contents=q===void 0?null:this.createNode(q,Z,X)}clone(){let q=Object.create(U1.prototype,{[h.NODE_TYPE]:{value:h.DOC}});if(q.commentBefore=this.commentBefore,q.comment=this.comment,q.errors=this.errors.slice(),q.warnings=this.warnings.slice(),q.options=Object.assign({},this.options),this.directives)q.directives=this.directives.clone();if(q.schema=this.schema.clone(),q.contents=h.isNode(this.contents)?this.contents.clone(q.schema):this.contents,this.range)q.range=this.range.slice();return q}add(q){if(K0(this.contents))this.contents.add(q)}addIn(q,$){if(K0(this.contents))this.contents.addIn(q,$)}createAlias(q,$){if(!q.anchor){let X=H1.anchorNames(this);q.anchor=!$||X.has($)?H1.findNewAnchor($||"a",X):$}return new oH.Alias(q.anchor)}createNode(q,$,X){let Z=void 0;if(typeof $==="function")q=$.call({"":q},"",q),Z=$;else if(Array.isArray($)){let B=(D)=>typeof D==="number"||D instanceof String||D instanceof Number,W=$.filter(B).map(String);if(W.length>0)$=$.concat(W);Z=$}else if(X===void 0&&$)X=$,$=void 0;let{aliasDuplicateObjects:H,anchorPrefix:z,flow:U,keepUndefined:Q,onTagObj:J,tag:G}=X??{},{onAnchor:Y,setAnchors:T,sourceObjects:L}=H1.createNodeAnchors(this,z||"a"),_={aliasDuplicateObjects:H??!0,keepUndefined:Q??!1,onAnchor:Y,onTagObj:J,replacer:Z,schema:this.schema,sourceObjects:L},V=Zz.createNode(q,G,_);if(U&&h.isCollection(V))V.flow=!0;return T(),V}createPair(q,$,X={}){let Z=this.createNode(q,null,X),H=this.createNode($,null,X);return new tH.Pair(Z,H)}delete(q){return K0(this.contents)?this.contents.delete(q):!1}deleteIn(q){if(M0.isEmptyPath(q)){if(this.contents==null)return!1;return this.contents=null,!0}return K0(this.contents)?this.contents.deleteIn(q):!1}get(q,$){return h.isCollection(this.contents)?this.contents.get(q,$):void 0}getIn(q,$){if(M0.isEmptyPath(q))return!$&&h.isScalar(this.contents)?this.contents.value:this.contents;return h.isCollection(this.contents)?this.contents.getIn(q,$):void 0}has(q){return h.isCollection(this.contents)?this.contents.has(q):!1}hasIn(q){if(M0.isEmptyPath(q))return this.contents!==void 0;return h.isCollection(this.contents)?this.contents.hasIn(q):!1}set(q,$){if(this.contents==null)this.contents=M0.collectionFromPath(this.schema,[q],$);else if(K0(this.contents))this.contents.set(q,$)}setIn(q,$){if(M0.isEmptyPath(q))this.contents=$;else if(this.contents==null)this.contents=M0.collectionFromPath(this.schema,Array.from(q),$);else if(K0(this.contents))this.contents.setIn(q,$)}setSchema(q,$={}){if(typeof q==="number")q=String(q);let X;switch(q){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new z1.Directives({version:"1.1"});X={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=q;else this.directives=new z1.Directives({version:q});X={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;X=null;break;default:{let Z=JSON.stringify(q);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${Z}`)}}if($.schema instanceof Object)this.schema=$.schema;else if(X)this.schema=new qz.Schema(Object.assign(X,$));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:q,jsonArg:$,mapAsMap:X,maxAliasCount:Z,onAnchor:H,reviver:z}={}){let U={anchors:new Map,doc:this,keep:!q,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof Z==="number"?Z:100},Q=eH.toJS(this.contents,$??"",U);if(typeof H==="function")for(let{count:J,res:G}of U.anchors.values())H(G,J);return typeof z==="function"?Xz.applyReviver(z,{"":Q},"",Q):Q}toJSON(q,$){return this.toJS({json:!0,jsonArg:q,mapAsMap:!1,onAnchor:$})}toString(q={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in q&&(!Number.isInteger(q.indent)||Number(q.indent)<=0)){let $=JSON.stringify(q.indent);throw Error(`"indent" option must be a positive integer, not ${$}`)}return $z.stringifyDocument(this,q)}}function K0(q){if(h.isCollection(q))return!0;throw Error("Expected a YAML collection as document contents")}Hz.Document=U1});var r0=I((Qz)=>{class uq extends Error{constructor(q,$,X,Z){super();this.name=q,this.code=X,this.message=Z,this.pos=$}}class E9 extends uq{constructor(q,$,X){super("YAMLParseError",q,$,X)}}class b9 extends uq{constructor(q,$,X){super("YAMLWarning",q,$,X)}}var Uz=(q,$)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((Q)=>$.linePos(Q));let{line:Z,col:H}=X.linePos[0];X.message+=` at line ${Z}, column ${H}`;let z=H-1,U=q.substring($.lineStarts[Z-1],$.lineStarts[Z]).replace(/[\n\r]+$/,"");if(z>=60&&U.length>80){let Q=Math.min(z-39,U.length-79);U="\u2026"+U.substring(Q),z-=Q-1}if(U.length>80)U=U.substring(0,79)+"\u2026";if(Z>1&&/^ *$/.test(U.substring(0,z))){let Q=q.substring($.lineStarts[Z-2],$.lineStarts[Z-1]);if(Q.length>80)Q=Q.substring(0,79)+`\u2026
|
|
85
|
+
`;U=Q+U}if(/[^ ]/.test(U)){let Q=1,J=X.linePos[1];if(J?.line===Z&&J.col>H)Q=Math.max(1,Math.min(J.col-H,80-z));let G=" ".repeat(z)+"^".repeat(Q);X.message+=`:
|
|
102
86
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
`)B
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
`+H[
|
|
109
|
-
`)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
`;else
|
|
116
|
-
|
|
117
|
-
`)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
`)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
87
|
+
${U}
|
|
88
|
+
${G}
|
|
89
|
+
`}};Qz.YAMLError=uq;Qz.YAMLParseError=E9;Qz.YAMLWarning=b9;Qz.prettifyError=Uz});var n0=I((Bz)=>{function Lz(q,{flow:$,indicator:X,next:Z,offset:H,onError:z,parentIndent:U,startOnNewline:Q}){let J=!1,G=Q,Y=Q,T="",L="",_=!1,V=!1,B=null,W=null,D=null,R=null,K=null,w=null,F=null;for(let P of q){if(V){if(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma")z(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");V=!1}if(B){if(G&&P.type!=="comment"&&P.type!=="newline")z(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(P.type){case"space":if(!$&&(X!=="doc-start"||Z?.type!=="flow-collection")&&P.source.includes("\t"))B=P;Y=!0;break;case"comment":{if(!Y)z(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=P.source.substring(1)||" ";if(!T)T=C;else T+=L+C;L="",G=!1;break}case"newline":if(G){if(T)T+=P.source;else if(!w||X!=="seq-item-ind")J=!0}else L+=P.source;if(G=!0,_=!0,W||D)R=P;Y=!0;break;case"anchor":if(W)z(P,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(P.source.endsWith(":"))z(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);W=P,F??(F=P.offset),G=!1,Y=!1,V=!0;break;case"tag":{if(D)z(P,"MULTIPLE_TAGS","A node can have at most one tag");D=P,F??(F=P.offset),G=!1,Y=!1,V=!0;break}case X:if(W||D)z(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`);if(w)z(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${$??"collection"}`);w=P,G=X==="seq-item-ind"||X==="explicit-key-ind",Y=!1;break;case"comma":if($){if(K)z(P,"UNEXPECTED_TOKEN",`Unexpected , in ${$}`);K=P,G=!1,Y=!1;break}default:z(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),G=!1,Y=!1}}let O=q[q.length-1],j=O?O.offset+O.source.length:H;if(V&&Z&&Z.type!=="space"&&Z.type!=="newline"&&Z.type!=="comma"&&(Z.type!=="scalar"||Z.source!==""))z(Z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(G&&B.indent<=U||Z?.type==="block-map"||Z?.type==="block-seq"))z(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:K,found:w,spaceBefore:J,comment:T,hasNewline:_,anchor:W,tag:D,newlineAfterProp:R,end:j,start:F??j}}Bz.resolveProps=Lz});var vq=I((Wz)=>{function Q1(q){if(!q)return null;switch(q.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(q.source.includes(`
|
|
90
|
+
`))return!0;if(q.end){for(let $ of q.end)if($.type==="newline")return!0}return!1;case"flow-collection":for(let $ of q.items){for(let X of $.start)if(X.type==="newline")return!0;if($.sep){for(let X of $.sep)if(X.type==="newline")return!0}if(Q1($.key)||Q1($.value))return!0}return!1;default:return!0}}Wz.containsNewline=Q1});var G1=I((Rz)=>{var Iz=vq();function Dz(q,$,X){if($?.type==="flow-collection"){let Z=$.end[0];if(Z.indent===q&&(Z.source==="]"||Z.source==="}")&&Iz.containsNewline($))X(Z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Rz.flowIndentCheck=Dz});var J1=I((Kz)=>{var C9=A();function Mz(q,$,X){let{uniqueKeys:Z}=q.options;if(Z===!1)return!1;let H=typeof Z==="function"?Z:(z,U)=>z===U||C9.isScalar(z)&&C9.isScalar(U)&&z.value===U.value;return $.some((z)=>H(z.key,X))}Kz.mapIncludes=Mz});var h9=I((jz)=>{var y9=e(),Fz=$0(),f9=n0(),Oz=vq(),x9=G1(),Az=J1(),k9="All mapping items must start at the same column";function Sz({composeNode:q,composeEmptyNode:$},X,Z,H,z){let Q=new(z?.nodeClass??Fz.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let J=Z.offset,G=null;for(let Y of Z.items){let{start:T,key:L,sep:_,value:V}=Y,B=f9.resolveProps(T,{indicator:"explicit-key-ind",next:L??_?.[0],offset:J,onError:H,parentIndent:Z.indent,startOnNewline:!0}),W=!B.found;if(W){if(L){if(L.type==="block-seq")H(J,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in L&&L.indent!==Z.indent)H(J,"BAD_INDENT",k9)}if(!B.anchor&&!B.tag&&!_){if(G=B.end,B.comment)if(Q.comment)Q.comment+=`
|
|
91
|
+
`+B.comment;else Q.comment=B.comment;continue}if(B.newlineAfterProp||Oz.containsNewline(L))H(L??T[T.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==Z.indent)H(J,"BAD_INDENT",k9);X.atKey=!0;let D=B.end,R=L?q(X,L,B,H):$(X,D,T,null,B,H);if(X.schema.compat)x9.flowIndentCheck(Z.indent,L,H);if(X.atKey=!1,Az.mapIncludes(X,Q.items,R))H(D,"DUPLICATE_KEY","Map keys must be unique");let K=f9.resolveProps(_??[],{indicator:"map-value-ind",next:V,offset:R.range[2],onError:H,parentIndent:Z.indent,startOnNewline:!L||L.type==="block-scalar"});if(J=K.end,K.found){if(W){if(V?.type==="block-map"&&!K.hasNewline)H(J,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&B.start<K.found.offset-1024)H(R.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let w=V?q(X,V,K,H):$(X,J,_,null,K,H);if(X.schema.compat)x9.flowIndentCheck(Z.indent,V,H);J=w.range[2];let F=new y9.Pair(R,w);if(X.options.keepSourceTokens)F.srcToken=Y;Q.items.push(F)}else{if(W)H(R.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(K.comment)if(R.comment)R.comment+=`
|
|
92
|
+
`+K.comment;else R.comment=K.comment;let w=new y9.Pair(R);if(X.options.keepSourceTokens)w.srcToken=Y;Q.items.push(w)}}if(G&&G<J)H(G,"IMPOSSIBLE","Map comment with trailing content");return Q.range=[Z.offset,J,G??J],Q}jz.resolveBlockMap=Sz});var g9=I((fz)=>{var Ez=X0(),bz=n0(),Cz=G1();function yz({composeNode:q,composeEmptyNode:$},X,Z,H,z){let Q=new(z?.nodeClass??Ez.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let J=Z.offset,G=null;for(let{start:Y,value:T}of Z.items){let L=bz.resolveProps(Y,{indicator:"seq-item-ind",next:T,offset:J,onError:H,parentIndent:Z.indent,startOnNewline:!0});if(!L.found)if(L.anchor||L.tag||T)if(T?.type==="block-seq")H(L.end,"BAD_INDENT","All sequence items must start at the same column");else H(J,"MISSING_CHAR","Sequence item without - indicator");else{if(G=L.end,L.comment)Q.comment=L.comment;continue}let _=T?q(X,T,L,H):$(X,L.end,Y,null,L,H);if(X.schema.compat)Cz.flowIndentCheck(Z.indent,T,H);J=_.range[2],Q.items.push(_)}return Q.range=[Z.offset,J,G??J],Q}fz.resolveBlockSeq=yz});var w0=I((hz)=>{function kz(q,$,X,Z){let H="";if(q){let z=!1,U="";for(let Q of q){let{source:J,type:G}=Q;switch(G){case"space":z=!0;break;case"comment":{if(X&&!z)Z(Q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let Y=J.substring(1)||" ";if(!H)H=Y;else H+=U+Y;U="";break}case"newline":if(H)U+=J;z=!0;break;default:Z(Q,"UNEXPECTED_TOKEN",`Unexpected ${G} at node end`)}$+=J.length}}return{comment:H,offset:$}}hz.resolveEnd=kz});var m9=I((iz)=>{var uz=A(),vz=e(),u9=$0(),mz=X0(),dz=w0(),v9=n0(),pz=vq(),lz=J1(),T1="Block collections are not allowed within flow collections",Y1=(q)=>q&&(q.type==="block-map"||q.type==="block-seq");function cz({composeNode:q,composeEmptyNode:$},X,Z,H,z){let U=Z.start.source==="{",Q=U?"flow map":"flow sequence",G=new(z?.nodeClass??(U?u9.YAMLMap:mz.YAMLSeq))(X.schema);G.flow=!0;let Y=X.atRoot;if(Y)X.atRoot=!1;if(X.atKey)X.atKey=!1;let T=Z.offset+Z.start.source.length;for(let W=0;W<Z.items.length;++W){let D=Z.items[W],{start:R,key:K,sep:w,value:F}=D,O=v9.resolveProps(R,{flow:Q,indicator:"explicit-key-ind",next:K??w?.[0],offset:T,onError:H,parentIndent:Z.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!w&&!F){if(W===0&&O.comma)H(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Q}`);else if(W<Z.items.length-1)H(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${Q}`);if(O.comment)if(G.comment)G.comment+=`
|
|
93
|
+
`+O.comment;else G.comment=O.comment;T=O.end;continue}if(!U&&X.options.strict&&pz.containsNewline(K))H(K,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(W===0){if(O.comma)H(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Q}`)}else{if(!O.comma)H(O.start,"MISSING_CHAR",`Missing , between ${Q} items`);if(O.comment){let j="";q:for(let P of R)switch(P.type){case"comma":case"space":break;case"comment":j=P.source.substring(1);break q;default:break q}if(j){let P=G.items[G.items.length-1];if(uz.isPair(P))P=P.value??P.key;if(P.comment)P.comment+=`
|
|
94
|
+
`+j;else P.comment=j;O.comment=O.comment.substring(j.length+1)}}}if(!U&&!w&&!O.found){let j=F?q(X,F,O,H):$(X,O.end,w,null,O,H);if(G.items.push(j),T=j.range[2],Y1(F))H(j.range,"BLOCK_IN_FLOW",T1)}else{X.atKey=!0;let j=O.end,P=K?q(X,K,O,H):$(X,j,R,null,O,H);if(Y1(K))H(P.range,"BLOCK_IN_FLOW",T1);X.atKey=!1;let C=v9.resolveProps(w??[],{flow:Q,indicator:"map-value-ind",next:F,offset:P.range[2],onError:H,parentIndent:Z.indent,startOnNewline:!1});if(C.found){if(!U&&!O.found&&X.options.strict){if(w)for(let y of w){if(y===C.found)break;if(y.type==="newline"){H(y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(O.start<C.found.offset-1024)H(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(F)if("source"in F&&F.source?.[0]===":")H(F,"MISSING_CHAR",`Missing space after : in ${Q}`);else H(C.start,"MISSING_CHAR",`Missing , or : between ${Q} items`);let r=F?q(X,F,C,H):C.found?$(X,C.end,w,null,C,H):null;if(r){if(Y1(F))H(r.range,"BLOCK_IN_FLOW",T1)}else if(C.comment)if(P.comment)P.comment+=`
|
|
95
|
+
`+C.comment;else P.comment=C.comment;let L0=new vz.Pair(P,r);if(X.options.keepSourceTokens)L0.srcToken=D;if(U){let y=G;if(lz.mapIncludes(X,y.items,P))H(j,"DUPLICATE_KEY","Map keys must be unique");y.items.push(L0)}else{let y=new u9.YAMLMap(X.schema);y.flow=!0,y.items.push(L0);let a1=(r??P).range;y.range=[P.range[0],a1[1],a1[2]],G.items.push(y)}T=r?r.range[2]:C.end}}let L=U?"}":"]",[_,...V]=Z.end,B=T;if(_?.source===L)B=_.offset+_.source.length;else{let W=Q[0].toUpperCase()+Q.substring(1),D=Y?`${W} must end with a ${L}`:`${W} in block collection must be sufficiently indented and end with a ${L}`;if(H(T,Y?"MISSING_CHAR":"BAD_INDENT",D),_&&_.source.length!==1)V.unshift(_)}if(V.length>0){let W=dz.resolveEnd(V,B,X.options.strict,H);if(W.comment)if(G.comment)G.comment+=`
|
|
96
|
+
`+W.comment;else G.comment=W.comment;G.range=[Z.offset,B,W.offset]}else G.range=[Z.offset,B,B];return G}iz.resolveFlowCollection=cz});var d9=I((XU)=>{var sz=A(),rz=b(),nz=$0(),oz=X0(),tz=h9(),ez=g9(),qU=m9();function L1(q,$,X,Z,H,z){let U=X.type==="block-map"?tz.resolveBlockMap(q,$,X,Z,z):X.type==="block-seq"?ez.resolveBlockSeq(q,$,X,Z,z):qU.resolveFlowCollection(q,$,X,Z,z),Q=U.constructor;if(H==="!"||H===Q.tagName)return U.tag=Q.tagName,U;if(H)U.tag=H;return U}function $U(q,$,X,Z,H){let z=Z.tag,U=!z?null:$.directives.tagName(z.source,(L)=>H(z,"TAG_RESOLVE_FAILED",L));if(X.type==="block-seq"){let{anchor:L,newlineAfterProp:_}=Z,V=L&&z?L.offset>z.offset?L:z:L??z;if(V&&(!_||_.offset<V.offset))H(V,"MISSING_CHAR","Missing newline after block sequence props")}let Q=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!z||!U||U==="!"||U===nz.YAMLMap.tagName&&Q==="map"||U===oz.YAMLSeq.tagName&&Q==="seq")return L1(q,$,X,H,U);let J=$.schema.tags.find((L)=>L.tag===U&&L.collection===Q);if(!J){let L=$.schema.knownTags[U];if(L?.collection===Q)$.schema.tags.push(Object.assign({},L,{default:!1})),J=L;else{if(L)H(z,"BAD_COLLECTION_TYPE",`${L.tag} used for ${Q} collection, but expects ${L.collection??"scalar"}`,!0);else H(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${U}`,!0);return L1(q,$,X,H,U)}}let G=L1(q,$,X,H,U,J),Y=J.resolve?.(G,(L)=>H(z,"TAG_RESOLVE_FAILED",L),$.options)??G,T=sz.isNode(Y)?Y:new rz.Scalar(Y);if(T.range=G.range,T.tag=U,J?.format)T.format=J.format;return T}XU.composeCollection=$U});var _1=I((QU)=>{var B1=b();function HU(q,$,X){let Z=$.offset,H=zU($,q.options.strict,X);if(!H)return{value:"",type:null,comment:"",range:[Z,Z,Z]};let z=H.mode===">"?B1.Scalar.BLOCK_FOLDED:B1.Scalar.BLOCK_LITERAL,U=$.source?UU($.source):[],Q=U.length;for(let B=U.length-1;B>=0;--B){let W=U[B][1];if(W===""||W==="\r")Q=B;else break}if(Q===0){let B=H.chomp==="+"&&U.length>0?`
|
|
97
|
+
`.repeat(Math.max(1,U.length-1)):"",W=Z+H.length;if($.source)W+=$.source.length;return{value:B,type:z,comment:H.comment,range:[Z,W,W]}}let J=$.indent+H.indent,G=$.offset+H.length,Y=0;for(let B=0;B<Q;++B){let[W,D]=U[B];if(D===""||D==="\r"){if(H.indent===0&&W.length>J)J=W.length}else{if(W.length<J)X(G+W.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(H.indent===0)J=W.length;if(Y=B,J===0&&!q.atRoot)X(G,"BAD_INDENT","Block scalar values in collections must be indented");break}G+=W.length+D.length+1}for(let B=U.length-1;B>=Q;--B)if(U[B][0].length>J)Q=B+1;let T="",L="",_=!1;for(let B=0;B<Y;++B)T+=U[B][0].slice(J)+`
|
|
98
|
+
`;for(let B=Y;B<Q;++B){let[W,D]=U[B];G+=W.length+D.length+1;let R=D[D.length-1]==="\r";if(R)D=D.slice(0,-1);if(D&&W.length<J){let w=`Block scalar lines must not be less indented than their ${H.indent?"explicit indentation indicator":"first line"}`;X(G-D.length-(R?2:1),"BAD_INDENT",w),W=""}if(z===B1.Scalar.BLOCK_LITERAL)T+=L+W.slice(J)+D,L=`
|
|
99
|
+
`;else if(W.length>J||D[0]==="\t"){if(L===" ")L=`
|
|
100
|
+
`;else if(!_&&L===`
|
|
101
|
+
`)L=`
|
|
102
|
+
|
|
103
|
+
`;T+=L+W.slice(J)+D,L=`
|
|
104
|
+
`,_=!0}else if(D==="")if(L===`
|
|
105
|
+
`)T+=`
|
|
106
|
+
`;else L=`
|
|
107
|
+
`;else T+=L+D,L=" ",_=!1}switch(H.chomp){case"-":break;case"+":for(let B=Q;B<U.length;++B)T+=`
|
|
108
|
+
`+U[B][0].slice(J);if(T[T.length-1]!==`
|
|
109
|
+
`)T+=`
|
|
110
|
+
`;break;default:T+=`
|
|
111
|
+
`}let V=Z+H.length+$.source.length;return{value:T,type:z,comment:H.comment,range:[Z,V,V]}}function zU({offset:q,props:$},X,Z){if($[0].type!=="block-scalar-header")return Z($[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:H}=$[0],z=H[0],U=0,Q="",J=-1;for(let L=1;L<H.length;++L){let _=H[L];if(!Q&&(_==="-"||_==="+"))Q=_;else{let V=Number(_);if(!U&&V)U=V;else if(J===-1)J=q+L}}if(J!==-1)Z(J,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${H}`);let G=!1,Y="",T=H.length;for(let L=1;L<$.length;++L){let _=$[L];switch(_.type){case"space":G=!0;case"newline":T+=_.source.length;break;case"comment":if(X&&!G)Z(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");T+=_.source.length,Y=_.source.substring(1);break;case"error":Z(_,"UNEXPECTED_TOKEN",_.message),T+=_.source.length;break;default:{let V=`Unexpected token in block scalar header: ${_.type}`;Z(_,"UNEXPECTED_TOKEN",V);let B=_.source;if(B&&typeof B==="string")T+=B.length}}}return{mode:z,indent:U,chomp:Q,comment:Y,length:T}}function UU(q){let $=q.split(/\n( *)/),X=$[0],Z=X.match(/^( *)/),z=[Z?.[1]?[Z[1],X.slice(Z[1].length)]:["",X]];for(let U=1;U<$.length;U+=2)z.push([$[U],$[U+1]]);return z}QU.resolveBlockScalar=HU});var V1=I((IU)=>{var W1=b(),JU=w0();function TU(q,$,X){let{offset:Z,type:H,source:z,end:U}=q,Q,J,G=(L,_,V)=>X(Z+L,_,V);switch(H){case"scalar":Q=W1.Scalar.PLAIN,J=YU(z,G);break;case"single-quoted-scalar":Q=W1.Scalar.QUOTE_SINGLE,J=LU(z,G);break;case"double-quoted-scalar":Q=W1.Scalar.QUOTE_DOUBLE,J=BU(z,G);break;default:return X(q,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${H}`),{value:"",type:null,comment:"",range:[Z,Z+z.length,Z+z.length]}}let Y=Z+z.length,T=JU.resolveEnd(U,Y,$,X);return{value:J,type:Q,comment:T.comment,range:[Z,Y,T.offset]}}function YU(q,$){let X="";switch(q[0]){case"\t":X="a tab character";break;case",":X="flow indicator character ,";break;case"%":X="directive indicator character %";break;case"|":case">":{X=`block scalar indicator ${q[0]}`;break}case"@":case"`":{X=`reserved character ${q[0]}`;break}}if(X)$(0,"BAD_SCALAR_START",`Plain value cannot start with ${X}`);return p9(q)}function LU(q,$){if(q[q.length-1]!=="'"||q.length===1)$(q.length,"MISSING_CHAR","Missing closing 'quote");return p9(q.slice(1,-1)).replace(/''/g,"'")}function p9(q){let $,X;try{$=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
112
|
+
`,"sy"),X=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
113
|
+
`,"sy")}catch{$=/(.*?)[ \t]*\r?\n/sy,X=/[ \t]*(.*?)[ \t]*\r?\n/sy}let Z=$.exec(q);if(!Z)return q;let H=Z[1],z=" ",U=$.lastIndex;X.lastIndex=U;while(Z=X.exec(q)){if(Z[1]==="")if(z===`
|
|
114
|
+
`)H+=z;else z=`
|
|
115
|
+
`;else H+=z+Z[1],z=" ";U=X.lastIndex}let Q=/[ \t]*(.*)/sy;return Q.lastIndex=U,Z=Q.exec(q),H+z+(Z?.[1]??"")}function BU(q,$){let X="";for(let Z=1;Z<q.length-1;++Z){let H=q[Z];if(H==="\r"&&q[Z+1]===`
|
|
116
|
+
`)continue;if(H===`
|
|
117
|
+
`){let{fold:z,offset:U}=_U(q,Z);X+=z,Z=U}else if(H==="\\"){let z=q[++Z],U=WU[z];if(U)X+=U;else if(z===`
|
|
118
|
+
`){z=q[Z+1];while(z===" "||z==="\t")z=q[++Z+1]}else if(z==="\r"&&q[Z+1]===`
|
|
119
|
+
`){z=q[++Z+1];while(z===" "||z==="\t")z=q[++Z+1]}else if(z==="x"||z==="u"||z==="U"){let Q={x:2,u:4,U:8}[z];X+=VU(q,Z+1,Q,$),Z+=Q}else{let Q=q.substr(Z-1,2);$(Z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Q}`),X+=Q}}else if(H===" "||H==="\t"){let z=Z,U=q[Z+1];while(U===" "||U==="\t")U=q[++Z+1];if(U!==`
|
|
120
|
+
`&&!(U==="\r"&&q[Z+2]===`
|
|
121
|
+
`))X+=Z>z?q.slice(z,Z+1):H}else X+=H}if(q[q.length-1]!=='"'||q.length===1)$(q.length,"MISSING_CHAR",'Missing closing "quote');return X}function _U(q,$){let X="",Z=q[$+1];while(Z===" "||Z==="\t"||Z===`
|
|
122
|
+
`||Z==="\r"){if(Z==="\r"&&q[$+2]!==`
|
|
123
|
+
`)break;if(Z===`
|
|
124
|
+
`)X+=`
|
|
125
|
+
`;$+=1,Z=q[$+1]}if(!X)X=" ";return{fold:X,offset:$}}var WU={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
126
|
+
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function VU(q,$,X,Z){let H=q.substr($,X),U=H.length===X&&/^[0-9a-fA-F]+$/.test(H)?parseInt(H,16):NaN;if(isNaN(U)){let Q=q.substr($-2,X+2);return Z($-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Q}`),Q}return String.fromCodePoint(U)}IU.resolveFlowScalar=TU});var c9=I((FU)=>{var T0=A(),l9=b(),RU=_1(),PU=V1();function MU(q,$,X,Z){let{value:H,type:z,comment:U,range:Q}=$.type==="block-scalar"?RU.resolveBlockScalar(q,$,Z):PU.resolveFlowScalar($,q.options.strict,Z),J=X?q.directives.tagName(X.source,(T)=>Z(X,"TAG_RESOLVE_FAILED",T)):null,G;if(q.options.stringKeys&&q.atKey)G=q.schema[T0.SCALAR];else if(J)G=KU(q.schema,H,J,X,Z);else if($.type==="scalar")G=wU(q,H,$,Z);else G=q.schema[T0.SCALAR];let Y;try{let T=G.resolve(H,(L)=>Z(X??$,"TAG_RESOLVE_FAILED",L),q.options);Y=T0.isScalar(T)?T:new l9.Scalar(T)}catch(T){let L=T instanceof Error?T.message:String(T);Z(X??$,"TAG_RESOLVE_FAILED",L),Y=new l9.Scalar(H)}if(Y.range=Q,Y.source=H,z)Y.type=z;if(J)Y.tag=J;if(G.format)Y.format=G.format;if(U)Y.comment=U;return Y}function KU(q,$,X,Z,H){if(X==="!")return q[T0.SCALAR];let z=[];for(let Q of q.tags)if(!Q.collection&&Q.tag===X)if(Q.default&&Q.test)z.push(Q);else return Q;for(let Q of z)if(Q.test?.test($))return Q;let U=q.knownTags[X];if(U&&!U.collection)return q.tags.push(Object.assign({},U,{default:!1,test:void 0})),U;return H(Z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,X!=="tag:yaml.org,2002:str"),q[T0.SCALAR]}function wU({atKey:q,directives:$,schema:X},Z,H,z){let U=X.tags.find((Q)=>(Q.default===!0||q&&Q.default==="key")&&Q.test?.test(Z))||X[T0.SCALAR];if(X.compat){let Q=X.compat.find((J)=>J.default&&J.test?.test(Z))??X[T0.SCALAR];if(U.tag!==Q.tag){let J=$.tagString(U.tag),G=$.tagString(Q.tag),Y=`Value may be parsed as either ${J} or ${G}`;z(H,"TAG_RESOLVE_FAILED",Y,!0)}}return U}FU.composeScalar=MU});var i9=I((SU)=>{function AU(q,$,X){if($){X??(X=$.length);for(let Z=X-1;Z>=0;--Z){let H=$[Z];switch(H.type){case"space":case"comment":case"newline":q-=H.source.length;continue}H=$[++Z];while(H?.type==="space")q+=H.source.length,H=$[++Z];break}}return q}SU.emptyScalarPosition=AU});var r9=I((kU)=>{var NU=y0(),EU=A(),bU=d9(),a9=c9(),CU=w0(),yU=i9(),fU={composeNode:s9,composeEmptyNode:I1};function s9(q,$,X,Z){let H=q.atKey,{spaceBefore:z,comment:U,anchor:Q,tag:J}=X,G,Y=!0;switch($.type){case"alias":if(G=xU(q,$,Z),Q||J)Z($,"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(G=a9.composeScalar(q,$,J,Z),Q)G.anchor=Q.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(G=bU.composeCollection(fU,q,$,X,Z),Q)G.anchor=Q.source.substring(1);break;default:{let T=$.type==="error"?$.message:`Unsupported token (type: ${$.type})`;Z($,"UNEXPECTED_TOKEN",T),G=I1(q,$.offset,void 0,null,X,Z),Y=!1}}if(Q&&G.anchor==="")Z(Q,"BAD_ALIAS","Anchor cannot be an empty string");if(H&&q.options.stringKeys&&(!EU.isScalar(G)||typeof G.value!=="string"||G.tag&&G.tag!=="tag:yaml.org,2002:str"))Z(J??$,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(z)G.spaceBefore=!0;if(U)if($.type==="scalar"&&$.source==="")G.comment=U;else G.commentBefore=U;if(q.options.keepSourceTokens&&Y)G.srcToken=$;return G}function I1(q,$,X,Z,{spaceBefore:H,comment:z,anchor:U,tag:Q,end:J},G){let Y={type:"scalar",offset:yU.emptyScalarPosition($,X,Z),indent:-1,source:""},T=a9.composeScalar(q,Y,Q,G);if(U){if(T.anchor=U.source.substring(1),T.anchor==="")G(U,"BAD_ALIAS","Anchor cannot be an empty string")}if(H)T.spaceBefore=!0;if(z)T.comment=z,T.range[2]=J;return T}function xU({options:q},{offset:$,source:X,end:Z},H){let z=new NU.Alias(X.substring(1));if(z.source==="")H($,"BAD_ALIAS","Alias cannot be an empty string");if(z.source.endsWith(":"))H($+X.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let U=$+X.length,Q=CU.resolveEnd(Z,U,q.strict,H);if(z.range=[$,U,Q.offset],Q.comment)z.comment=Q.comment;return z}kU.composeEmptyNode=I1;kU.composeNode=s9});var o9=I((pU)=>{var uU=s0(),n9=r9(),vU=w0(),mU=n0();function dU(q,$,{offset:X,start:Z,value:H,end:z},U){let Q=Object.assign({_directives:$},q),J=new uU.Document(void 0,Q),G={atKey:!1,atRoot:!0,directives:J.directives,options:J.options,schema:J.schema},Y=mU.resolveProps(Z,{indicator:"doc-start",next:H??z?.[0],offset:X,onError:U,parentIndent:0,startOnNewline:!0});if(Y.found){if(J.directives.docStart=!0,H&&(H.type==="block-map"||H.type==="block-seq")&&!Y.hasNewline)U(Y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}J.contents=H?n9.composeNode(G,H,Y,U):n9.composeEmptyNode(G,Y.end,Z,null,Y,U);let T=J.contents.range[2],L=vU.resolveEnd(z,T,!1,U);if(L.comment)J.comment=L.comment;return J.range=[X,T,L.offset],J}pU.composeDoc=dU});var D1=I((nU)=>{var cU=c("process"),iU=K$(),aU=s0(),o0=r0(),t9=A(),sU=o9(),rU=w0();function t0(q){if(typeof q==="number")return[q,q+1];if(Array.isArray(q))return q.length===2?q:[q[0],q[1]];let{offset:$,source:X}=q;return[$,$+(typeof X==="string"?X.length:1)]}function e9(q){let $="",X=!1,Z=!1;for(let H=0;H<q.length;++H){let z=q[H];switch(z[0]){case"#":$+=($===""?"":Z?`
|
|
127
127
|
|
|
128
128
|
`:`
|
|
129
|
-
`)+(
|
|
130
|
-
${
|
|
131
|
-
${
|
|
132
|
-
${
|
|
133
|
-
${
|
|
134
|
-
`}];switch(
|
|
135
|
-
`),
|
|
136
|
-
`,
|
|
137
|
-
`});return{type:"block-scalar",offset:
|
|
138
|
-
`),
|
|
139
|
-
`;if(
|
|
140
|
-
`});for(let
|
|
141
|
-
`};delete
|
|
129
|
+
`)+(z.substring(1)||" "),X=!0,Z=!1;break;case"%":if(q[H+1]?.[0]!=="#")H+=1;X=!1;break;default:if(!X)Z=!0;X=!1}}return{comment:$,afterEmptyLine:Z}}class q4{constructor(q={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=($,X,Z,H)=>{let z=t0($);if(H)this.warnings.push(new o0.YAMLWarning(z,X,Z));else this.errors.push(new o0.YAMLParseError(z,X,Z))},this.directives=new iU.Directives({version:q.version||"1.2"}),this.options=q}decorate(q,$){let{comment:X,afterEmptyLine:Z}=e9(this.prelude);if(X){let H=q.contents;if($)q.comment=q.comment?`${q.comment}
|
|
130
|
+
${X}`:X;else if(Z||q.directives.docStart||!H)q.commentBefore=X;else if(t9.isCollection(H)&&!H.flow&&H.items.length>0){let z=H.items[0];if(t9.isPair(z))z=z.key;let U=z.commentBefore;z.commentBefore=U?`${X}
|
|
131
|
+
${U}`:X}else{let z=H.commentBefore;H.commentBefore=z?`${X}
|
|
132
|
+
${z}`:X}}if($)Array.prototype.push.apply(q.errors,this.errors),Array.prototype.push.apply(q.warnings,this.warnings);else q.errors=this.errors,q.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:e9(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(q,$=!1,X=-1){for(let Z of q)yield*this.next(Z);yield*this.end($,X)}*next(q){if(cU.env.LOG_STREAM)console.dir(q,{depth:null});switch(q.type){case"directive":this.directives.add(q.source,($,X,Z)=>{let H=t0(q);H[0]+=$,this.onError(H,"BAD_DIRECTIVE",X,Z)}),this.prelude.push(q.source),this.atDirectives=!0;break;case"document":{let $=sU.composeDoc(this.options,this.directives,q,this.onError);if(this.atDirectives&&!$.directives.docStart)this.onError(q,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate($,!1),this.doc)yield this.doc;this.doc=$,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(q.source);break;case"error":{let $=q.source?`${q.message}: ${JSON.stringify(q.source)}`:q.message,X=new o0.YAMLParseError(t0(q),"UNEXPECTED_TOKEN",$);if(this.atDirectives||!this.doc)this.errors.push(X);else this.doc.errors.push(X);break}case"doc-end":{if(!this.doc){this.errors.push(new o0.YAMLParseError(t0(q),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let $=rU.resolveEnd(q.end,q.offset+q.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),$.comment){let X=this.doc.comment;this.doc.comment=X?`${X}
|
|
133
|
+
${$.comment}`:$.comment}this.doc.range[2]=$.offset;break}default:this.errors.push(new o0.YAMLParseError(t0(q),"UNEXPECTED_TOKEN",`Unsupported token ${q.type}`))}}*end(q=!1,$=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(q){let X=Object.assign({_directives:this.directives},this.options),Z=new aU.Document(void 0,X);if(this.atDirectives)this.onError($,"MISSING_CHAR","Missing directives-end indicator line");Z.range=[0,$,$],this.decorate(Z,!1),yield Z}}}nU.Composer=q4});var Z4=I((z3)=>{var tU=_1(),eU=V1(),q3=r0(),$4=h0();function $3(q,$=!0,X){if(q){let Z=(H,z,U)=>{let Q=typeof H==="number"?H:Array.isArray(H)?H[0]:H.offset;if(X)X(Q,z,U);else throw new q3.YAMLParseError([Q,Q+1],z,U)};switch(q.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return eU.resolveFlowScalar(q,$,Z);case"block-scalar":return tU.resolveBlockScalar({options:{strict:$}},q,Z)}}return null}function X3(q,$){let{implicitKey:X=!1,indent:Z,inFlow:H=!1,offset:z=-1,type:U="PLAIN"}=$,Q=$4.stringifyString({type:U,value:q},{implicitKey:X,indent:Z>0?" ".repeat(Z):"",inFlow:H,options:{blockQuote:!0,lineWidth:-1}}),J=$.end??[{type:"newline",offset:-1,indent:Z,source:`
|
|
134
|
+
`}];switch(Q[0]){case"|":case">":{let G=Q.indexOf(`
|
|
135
|
+
`),Y=Q.substring(0,G),T=Q.substring(G+1)+`
|
|
136
|
+
`,L=[{type:"block-scalar-header",offset:z,indent:Z,source:Y}];if(!X4(L,J))L.push({type:"newline",offset:-1,indent:Z,source:`
|
|
137
|
+
`});return{type:"block-scalar",offset:z,indent:Z,props:L,source:T}}case'"':return{type:"double-quoted-scalar",offset:z,indent:Z,source:Q,end:J};case"'":return{type:"single-quoted-scalar",offset:z,indent:Z,source:Q,end:J};default:return{type:"scalar",offset:z,indent:Z,source:Q,end:J}}}function Z3(q,$,X={}){let{afterKey:Z=!1,implicitKey:H=!1,inFlow:z=!1,type:U}=X,Q="indent"in q?q.indent:null;if(Z&&typeof Q==="number")Q+=2;if(!U)switch(q.type){case"single-quoted-scalar":U="QUOTE_SINGLE";break;case"double-quoted-scalar":U="QUOTE_DOUBLE";break;case"block-scalar":{let G=q.props[0];if(G.type!=="block-scalar-header")throw Error("Invalid block scalar header");U=G.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:U="PLAIN"}let J=$4.stringifyString({type:U,value:$},{implicitKey:H||Q===null,indent:Q!==null&&Q>0?" ".repeat(Q):"",inFlow:z,options:{blockQuote:!0,lineWidth:-1}});switch(J[0]){case"|":case">":H3(q,J);break;case'"':R1(q,J,"double-quoted-scalar");break;case"'":R1(q,J,"single-quoted-scalar");break;default:R1(q,J,"scalar")}}function H3(q,$){let X=$.indexOf(`
|
|
138
|
+
`),Z=$.substring(0,X),H=$.substring(X+1)+`
|
|
139
|
+
`;if(q.type==="block-scalar"){let z=q.props[0];if(z.type!=="block-scalar-header")throw Error("Invalid block scalar header");z.source=Z,q.source=H}else{let{offset:z}=q,U="indent"in q?q.indent:-1,Q=[{type:"block-scalar-header",offset:z,indent:U,source:Z}];if(!X4(Q,"end"in q?q.end:void 0))Q.push({type:"newline",offset:-1,indent:U,source:`
|
|
140
|
+
`});for(let J of Object.keys(q))if(J!=="type"&&J!=="offset")delete q[J];Object.assign(q,{type:"block-scalar",indent:U,props:Q,source:H})}}function X4(q,$){if($)for(let X of $)switch(X.type){case"space":case"comment":q.push(X);break;case"newline":return q.push(X),!0}return!1}function R1(q,$,X){switch(q.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":q.type=X,q.source=$;break;case"block-scalar":{let Z=q.props.slice(1),H=$.length;if(q.props[0].type==="block-scalar-header")H-=q.props[0].source.length;for(let z of Z)z.offset+=H;delete q.props,Object.assign(q,{type:X,source:$,end:Z});break}case"block-map":case"block-seq":{let H={type:"newline",offset:q.offset+$.length,indent:q.indent,source:`
|
|
141
|
+
`};delete q.items,Object.assign(q,{type:X,source:$,end:[H]});break}default:{let Z="indent"in q?q.indent:-1,H="end"in q&&Array.isArray(q.end)?q.end.filter((z)=>z.type==="space"||z.type==="comment"||z.type==="newline"):[];for(let z of Object.keys(q))if(z!=="type"&&z!=="offset")delete q[z];Object.assign(q,{type:X,indent:Z,source:$,end:H})}}}z3.createScalarToken=X3;z3.resolveAsScalar=$3;z3.setScalarValue=Z3});var H4=I((T3)=>{var J3=(q)=>("type"in q)?dq(q):mq(q);function dq(q){switch(q.type){case"block-scalar":{let $="";for(let X of q.props)$+=dq(X);return $+q.source}case"block-map":case"block-seq":{let $="";for(let X of q.items)$+=mq(X);return $}case"flow-collection":{let $=q.start.source;for(let X of q.items)$+=mq(X);for(let X of q.end)$+=X.source;return $}case"document":{let $=mq(q);if(q.end)for(let X of q.end)$+=X.source;return $}default:{let $=q.source;if("end"in q&&q.end)for(let X of q.end)$+=X.source;return $}}}function mq({start:q,key:$,sep:X,value:Z}){let H="";for(let z of q)H+=z.source;if($)H+=dq($);if(X)for(let z of X)H+=z.source;if(Z)H+=dq(Z);return H}T3.stringify=J3});var Q4=I((B3)=>{var P1=Symbol("break visit"),L3=Symbol("skip children"),z4=Symbol("remove item");function Y0(q,$){if("type"in q&&q.type==="document")q={start:q.start,value:q.value};U4(Object.freeze([]),q,$)}Y0.BREAK=P1;Y0.SKIP=L3;Y0.REMOVE=z4;Y0.itemAtPath=(q,$)=>{let X=q;for(let[Z,H]of $){let z=X?.[Z];if(z&&"items"in z)X=z.items[H];else return}return X};Y0.parentCollection=(q,$)=>{let X=Y0.itemAtPath(q,$.slice(0,-1)),Z=$[$.length-1][0],H=X?.[Z];if(H&&"items"in H)return H;throw Error("Parent collection not found")};function U4(q,$,X){let Z=X($,q);if(typeof Z==="symbol")return Z;for(let H of["key","value"]){let z=$[H];if(z&&"items"in z){for(let U=0;U<z.items.length;++U){let Q=U4(Object.freeze(q.concat([[H,U]])),z.items[U],X);if(typeof Q==="number")U=Q-1;else if(Q===P1)return P1;else if(Q===z4)z.items.splice(U,1),U-=1}if(typeof Z==="function"&&H==="key")Z=Z($,q)}}return typeof Z==="function"?Z($,q):Z}B3.visit=Y0});var pq=I((M3)=>{var M1=Z4(),W3=H4(),V3=Q4(),K1="\uFEFF",w1="\x02",F1="\x18",O1="\x1F",I3=(q)=>!!q&&("items"in q),D3=(q)=>!!q&&(q.type==="scalar"||q.type==="single-quoted-scalar"||q.type==="double-quoted-scalar"||q.type==="block-scalar");function R3(q){switch(q){case K1:return"<BOM>";case w1:return"<DOC>";case F1:return"<FLOW_END>";case O1:return"<SCALAR>";default:return JSON.stringify(q)}}function P3(q){switch(q){case K1:return"byte-order-mark";case w1:return"doc-mode";case F1:return"flow-error-end";case O1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
142
142
|
`:case`\r
|
|
143
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(
|
|
144
|
-
`:case"\r":case"\t":return!0;default:return!1}}var
|
|
145
|
-
\r `),
|
|
146
|
-
`)return!0;if(
|
|
147
|
-
`;return!1}charAt(
|
|
148
|
-
`||!
|
|
149
|
-
|
|
150
|
-
`,this.pos),this.lineEndPos=
|
|
151
|
-
`,this.pos);if(
|
|
152
|
-
`,
|
|
153
|
-
`:
|
|
154
|
-
`)break}default:break
|
|
155
|
-
`,
|
|
156
|
-
`)
|
|
157
|
-
`&&
|
|
158
|
-
`)
|
|
159
|
-
`,
|
|
160
|
-
`){let
|
|
161
|
-
`)return yield*this.pushCount(1);else if(
|
|
162
|
-
`)return yield*this.pushCount(2);else return 0}*pushSpaces(
|
|
163
|
-
`)+1;while(
|
|
164
|
-
|
|
165
|
-
`)+1;while(
|
|
166
|
-
|
|
167
|
-
`),
|
|
168
|
-
`),
|
|
169
|
-
`)
|
|
170
|
-
`);else{
|
|
171
|
-
`),
|
|
172
|
-
`);else{
|
|
173
|
-
`),
|
|
174
|
-
`);else for(let
|
|
175
|
-
`),
|
|
176
|
-
`),
|
|
177
|
-
`);else for(let
|
|
178
|
-
`);for(let
|
|
179
|
-
`),
|
|
180
|
-
`);else for(let
|
|
181
|
-
`),
|
|
182
|
-
`),
|
|
183
|
-
`)}function
|
|
184
|
-
`)}function
|
|
185
|
-
`)?
|
|
186
|
-
`),$=[],Y=null;if(Q.forEach((G,J)=>{if(/^##\s+/.test(G)){if(Y)$.push({header:Y.header,lines:J-Y.start});Y={header:G.replace(/^##\s+/,"").trim(),start:J}}}),Y){let G=Y;$.push({header:G.header,lines:Q.length-G.start})}return $.sort((G,J)=>J.lines-G.lines)}function xK(X){if(X.length===0||X.length>160)return!1;if(!X.includes("/"))return!1;if(/\s/.test(X))return!1;if(/^https?:\/\//.test(X))return!1;if(/[*?{}[\]<>]/.test(X))return!1;if(X.startsWith("@"))return!1;if(X.startsWith("~/"))return!1;if(/^[a-z]+:\/\//i.test(X))return!1;if(/^cdn\./.test(X)||/^unpkg\./.test(X)||/^npm\./.test(X))return!1;if(/^\/[a-z]/.test(X)&&/(?:icon|image|img|asset|file|path)/i.test(X))return!1;if(/^(cd|pnpm|npm|yarn|bun|node|git|ls|cat|grep|find|sed|awk|mkdir|rm|mv|cp|echo|export|source|sudo|brew|docker|curl|wget)\b/.test(X))return!1;return/[a-zA-Z0-9_.-]\/[a-zA-Z0-9_.-]/.test(X)}function gK(X){return X.replace(/```[\s\S]*?```/g,"")}function hK(X,Q){let $=new Map;for(let J of X){let H=J.relPath.split("/").pop()??"";if(H!=="AGENTS.md"&&H!=="CLAUDE.md")continue;let W=v6(J.relPath),U=$.get(W)??{};if(H==="AGENTS.md")U.agents=J;if(H==="CLAUDE.md")U.claude=J;$.set(W,U)}let Y=new Set(Q.intentionalDifferentPairs),G=[];for(let[J,H]of $){let W=!!H.agents,U=!!H.claude;if(!W&&!U)continue;if(!W||!U){G.push({dir:J,agentsExists:W,claudeExists:U,classification:"single",detail:W?"only AGENTS.md":"only CLAUDE.md"});continue}let{agents:z,claude:L}=H,B=`${z.relPath}:${L.relPath}`,F=`${L.relPath}:${z.relPath}`;if(Y.has(B)||Y.has(F)){G.push({dir:J,agentsExists:W,claudeExists:U,classification:"intentional-different",detail:`allowlisted: ${z.lineCount}L vs ${L.lineCount}L`});continue}if(z.isSymlink&&z.symlinkTarget===L.absPath||L.isSymlink&&L.symlinkTarget===z.absPath){let D=z.isSymlink?"CLAUDE.md":"AGENTS.md";G.push({dir:J,agentsExists:W,claudeExists:U,classification:"linked",detail:`canonical: ${D}`});continue}let I=k6(z.absPath,"utf8"),A=k6(L.absPath,"utf8");if(I===A)G.push({dir:J,agentsExists:W,claudeExists:U,classification:"unexpected-duplicate",detail:`byte-for-byte duplicate (${z.lineCount}L), not symlinked`});else G.push({dir:J,agentsExists:W,claudeExists:U,classification:"unexpected-duplicate",detail:`divergent (${z.lineCount}L vs ${L.lineCount}L), not in intentional-different allowlist`})}return G.sort((J,H)=>J.dir.localeCompare(H.dir)),G}function fK(X,Q,$){let Y=[];for(let G of X){if(G.isSymlink)continue;for(let W of G.brokenImports)Y.push({severity:"error",category:"broken-import",file:G.relPath,message:`broken @-import: ${W}`});for(let W of G.brokenPathRefs)Y.push({severity:"error",category:"broken-path-ref",file:G.relPath,message:`broken path reference: ${W}`});for(let W of G.unresolvedCommands)Y.push({severity:"warning",category:"unresolved-command",file:G.relPath,message:`unresolved command: ${W}`});let J=!G.relPath.includes("/"),H=J?$.budgets.rootLines:$.budgets.nestedWarnLines;if(G.lineCount>H)Y.push({severity:"warning",category:"over-budget",file:G.relPath,message:`${G.lineCount} lines exceeds ${J?"root":"nested"} budget of ${H}`})}for(let G of Q)if(G.classification==="unexpected-duplicate"){let J=G.detail.startsWith("divergent")?"error":"warning";Y.push({severity:J,category:J==="error"?"divergent-pair":"duplicate-pair",file:G.dir||"(root)",message:`AGENTS.md / CLAUDE.md ${G.detail}`})}return Y}function B8(X){let Q=X.confidence;if(X.error)return{icon:"\u2717",label:"Error",confidence:Q,tone:"error"};if(X.traps.fired.length>0)return{icon:"\u2717",label:"Trap fired",confidence:Q,tone:"error"};if(X.answerable==="YES")return{icon:"\u2713",label:Q>=90?"Well grounded":"Grounded",confidence:Q,tone:"success"};if(X.answerable==="PARTIAL")return{icon:"\u26A0",label:"Partially grounded",confidence:Q,tone:"warning"};return{icon:"\u2717",label:"Ungrounded",confidence:Q,tone:"error"}}function aQ(X){let Q=uK(X);if(Q===null)return[];let $=[],Y=/^\s*-\s+\[([^\]]+)\]\s*(.*)$/gm,G=Y.exec(Q);while(G!==null)$.push({id:G[1].trim(),note:G[2].trim()||void 0}),G=Y.exec(Q);return $}function uK(X){let $=/^##\s+Sources\s*$/im.exec(X);if(!$)return null;let Y=$.index+$[0].length,G=X.slice(Y),J=/^##\s+/m.exec(G);return J?G.slice(0,J.index):G}function x6(X){let Q=aQ(X.response),$=new Set(Q.map((F)=>F.id)),Y=new Set(X.registeredIds),G=new Set(X.requiredSources),J=[...$],H=[...G].filter((F)=>!$.has(F)),W=[...$].filter((F)=>!Y.has(F)),U=[...G],z,L,B;if(J.length===0)z="NO",L=0,B="No citations in response";else if(W.length===J.length)z="NO",L=0,B=`All cited sources are unknown: ${W.join(", ")}`;else if(H.length===0&&W.length===0)z="YES",L=100,B=U.length>0?`All required sources cited: ${U.join(", ")}`:`Cited registered sources: ${J.join(", ")}`;else{z="PARTIAL";let F=U.length>0?U.length:1,Z=U.length-H.length,I=U.length>0?Z/F*100:60,A=W.length*15;L=Math.max(0,Math.min(100,Math.round(I-A)));let D=[];if(H.length>0)D.push(`missing: ${H.join(", ")}`);if(W.length>0)D.push(`unknown: ${W.join(", ")}`);B=D.join("; ")}return{answerable:z,confidence:L,reason:B,citations:{cited:J,required:U,missing:H,unknown:W}}}function g6(X){let Q=[],$=[];for(let Y of X.traps){let G=mK(X.response,Y);if(G)Q.push(G);else $.push(Y.id)}return{fired:Q,avoided:$}}function mK(X,Q){if(Q.match!==void 0){let $=X.indexOf(Q.match);if($===-1)return null;return{id:Q.id,reason:Q.reason,matched:Q.match,snippet:j7(X,$,Q.match.length)}}if(Q.pattern!==void 0){let Y=new RegExp(Q.pattern,Q.flags??"").exec(X);if(!Y)return null;return{id:Q.id,reason:Q.reason,matched:Y[0],snippet:j7(X,Y.index,Y[0].length)}}return null}function j7(X,Q,$){let Y=Math.max(0,Q-40),G=Math.min(X.length,Q+$+40),J=X.slice(Y,G).replace(/\s+/g," ").trim();if(Y>0)J=`...${J}`;if(G<X.length)J=`${J}...`;return J}import sQ from"path";function lK(X){return X.startsWith("http://")||X.startsWith("https://")}async function cK(X,Q){let $=await fetch(Q);if(!$.ok)throw Error(`Failed to fetch source "${X}" from ${Q}: ${$.status} ${$.statusText}`);let Y=await $.text();return{id:X,source:Q,content:Y,name:new URL(Q).hostname+new URL(Q).pathname,type:"url"}}async function pK(X,Q,$){let Y=sQ.isAbsolute(Q)?Q:sQ.resolve($,Q),G=Bun.file(Y);if(!await G.exists())throw Error(`Source "${X}" not found at ${Y}`);let J=await G.text();return{id:X,source:Q,content:J,name:sQ.basename(Y),type:"file"}}async function P7(X,Q,$){if(lK(Q))return cK(X,Q);return pK(X,Q,$)}async function tQ(X,Q){let $=Object.entries(X);return await Promise.all($.map(([G,J])=>P7(G,J,Q)))}import{join as S7}from"path";import{fileURLToPath as iM}from"url";import{setMaxListeners as nM}from"events";import{spawn as oM}from"child_process";import{createInterface as aM}from"readline";import*as W0 from"fs";import{stat as sM,open as k2}from"fs/promises";import{join as mO}from"path";import{homedir as lO}from"os";import{dirname as J$,join as RY}from"path";import{cwd as cO}from"process";import{realpathSync as pO}from"fs";import{randomUUID as dO}from"crypto";import{randomUUID as UZ}from"crypto";import{appendFileSync as zZ,existsSync as BZ,mkdirSync as LZ}from"fs";import{join as x7}from"path";import{randomUUID as KZ}from"crypto";var{create:dK,getPrototypeOf:iK,defineProperty:G$,getOwnPropertyNames:nK}=Object,rK=Object.prototype.hasOwnProperty,WY=(X,Q,$)=>{$=X!=null?dK(iK(X)):{};let Y=Q||!X||!X.__esModule?G$($,"default",{value:X,enumerable:!0}):$;for(let G of nK(X))if(!rK.call(Y,G))G$(Y,G,{get:()=>X[G],enumerable:!0});return Y},i=(X,Q)=>()=>(Q||X((Q={exports:{}}).exports,Q),Q.exports),UY=(X,Q)=>{for(var $ in Q)G$(X,$,{get:Q[$],enumerable:!0,configurable:!0,set:(Y)=>Q[$]=()=>Y})};var p6=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.regexpCode=X.getEsmExportName=X.getProperty=X.safeStringify=X.stringify=X.strConcat=X.addCodeArg=X.str=X._=X.nil=X._Code=X.Name=X.IDENTIFIER=X._CodeOrName=void 0;class Q{}X._CodeOrName=Q,X.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class $ extends Q{constructor(q){super();if(!X.IDENTIFIER.test(q))throw Error("CodeGen: name must be a valid identifier");this.str=q}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}X.Name=$;class Y extends Q{constructor(q){super();this._items=typeof q==="string"?[q]:q}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let q=this._items[0];return q===""||q==='""'}get str(){var q;return(q=this._str)!==null&&q!==void 0?q:this._str=this._items.reduce((M,K)=>`${M}${K}`,"")}get names(){var q;return(q=this._names)!==null&&q!==void 0?q:this._names=this._items.reduce((M,K)=>{if(K instanceof $)M[K.str]=(M[K.str]||0)+1;return M},{})}}X._Code=Y,X.nil=new Y("");function G(q,...M){let K=[q[0]],V=0;while(V<M.length)W(K,M[V]),K.push(q[++V]);return new Y(K)}X._=G;var J=new Y("+");function H(q,...M){let K=[Z(q[0])],V=0;while(V<M.length)K.push(J),W(K,M[V]),K.push(J,Z(q[++V]));return U(K),new Y(K)}X.str=H;function W(q,M){if(M instanceof Y)q.push(...M._items);else if(M instanceof $)q.push(M);else q.push(B(M))}X.addCodeArg=W;function U(q){let M=1;while(M<q.length-1){if(q[M]===J){let K=z(q[M-1],q[M+1]);if(K!==void 0){q.splice(M-1,3,K);continue}q[M++]="+"}M++}}function z(q,M){if(M==='""')return q;if(q==='""')return M;if(typeof q=="string"){if(M instanceof $||q[q.length-1]!=='"')return;if(typeof M!="string")return`${q.slice(0,-1)}${M}"`;if(M[0]==='"')return q.slice(0,-1)+M.slice(1);return}if(typeof M=="string"&&M[0]==='"'&&!(q instanceof $))return`"${q}${M.slice(1)}`;return}function L(q,M){return M.emptyStr()?q:q.emptyStr()?M:H`${q}${M}`}X.strConcat=L;function B(q){return typeof q=="number"||typeof q=="boolean"||q===null?q:Z(Array.isArray(q)?q.join(","):q)}function F(q){return new Y(Z(q))}X.stringify=F;function Z(q){return JSON.stringify(q).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}X.safeStringify=Z;function I(q){return typeof q=="string"&&X.IDENTIFIER.test(q)?new Y(`.${q}`):G`[${q}]`}X.getProperty=I;function A(q){if(typeof q=="string"&&X.IDENTIFIER.test(q))return new Y(`${q}`);throw Error(`CodeGen: invalid export name: ${q}, use explicit $id name mapping`)}X.getEsmExportName=A;function D(q){return new Y(q.toString())}X.regexpCode=D}),T7=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.ValueScope=X.ValueScopeName=X.Scope=X.varKinds=X.UsedValueState=void 0;var Q=p6();class $ extends Error{constructor(U){super(`CodeGen: "code" for ${U} not defined`);this.value=U.value}}var Y;(function(U){U[U.Started=0]="Started",U[U.Completed=1]="Completed"})(Y||(X.UsedValueState=Y={})),X.varKinds={const:new Q.Name("const"),let:new Q.Name("let"),var:new Q.Name("var")};class G{constructor({prefixes:U,parent:z}={}){this._names={},this._prefixes=U,this._parent=z}toName(U){return U instanceof Q.Name?U:this.name(U)}name(U){return new Q.Name(this._newName(U))}_newName(U){let z=this._names[U]||this._nameGroup(U);return`${U}${z.index++}`}_nameGroup(U){var z,L;if(((L=(z=this._parent)===null||z===void 0?void 0:z._prefixes)===null||L===void 0?void 0:L.has(U))||this._prefixes&&!this._prefixes.has(U))throw Error(`CodeGen: prefix "${U}" is not allowed in this scope`);return this._names[U]={prefix:U,index:0}}}X.Scope=G;class J extends Q.Name{constructor(U,z){super(z);this.prefix=U}setValue(U,{property:z,itemIndex:L}){this.value=U,this.scopePath=Q._`.${new Q.Name(z)}[${L}]`}}X.ValueScopeName=J;var H=Q._`\n`;class W extends G{constructor(U){super(U);this._values={},this._scope=U.scope,this.opts={...U,_n:U.lines?H:Q.nil}}get(){return this._scope}name(U){return new J(U,this._newName(U))}value(U,z){var L;if(z.ref===void 0)throw Error("CodeGen: ref must be passed in value");let B=this.toName(U),{prefix:F}=B,Z=(L=z.key)!==null&&L!==void 0?L:z.ref,I=this._values[F];if(I){let q=I.get(Z);if(q)return q}else I=this._values[F]=new Map;I.set(Z,B);let A=this._scope[F]||(this._scope[F]=[]),D=A.length;return A[D]=z.ref,B.setValue(z,{property:F,itemIndex:D}),B}getValue(U,z){let L=this._values[U];if(!L)return;return L.get(z)}scopeRefs(U,z=this._values){return this._reduceValues(z,(L)=>{if(L.scopePath===void 0)throw Error(`CodeGen: name "${L}" has no value`);return Q._`${U}${L.scopePath}`})}scopeCode(U=this._values,z,L){return this._reduceValues(U,(B)=>{if(B.value===void 0)throw Error(`CodeGen: name "${B}" has no value`);return B.value.code},z,L)}_reduceValues(U,z,L={},B){let F=Q.nil;for(let Z in U){let I=U[Z];if(!I)continue;let A=L[Z]=L[Z]||new Map;I.forEach((D)=>{if(A.has(D))return;A.set(D,Y.Started);let q=z(D);if(q){let M=this.opts.es5?X.varKinds.var:X.varKinds.const;F=Q._`${F}${M} ${D} = ${q};${this.opts._n}`}else if(q=B===null||B===void 0?void 0:B(D))F=Q._`${F}${q}${this.opts._n}`;else throw new $(D);A.set(D,Y.Completed)})}return F}}X.ValueScope=W}),B0=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.or=X.and=X.not=X.CodeGen=X.operators=X.varKinds=X.ValueScopeName=X.ValueScope=X.Scope=X.Name=X.regexpCode=X.stringify=X.getProperty=X.nil=X.strConcat=X.str=X._=void 0;var Q=p6(),$=T7(),Y=p6();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return Y._}}),Object.defineProperty(X,"str",{enumerable:!0,get:function(){return Y.str}}),Object.defineProperty(X,"strConcat",{enumerable:!0,get:function(){return Y.strConcat}}),Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return Y.nil}}),Object.defineProperty(X,"getProperty",{enumerable:!0,get:function(){return Y.getProperty}}),Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return Y.stringify}}),Object.defineProperty(X,"regexpCode",{enumerable:!0,get:function(){return Y.regexpCode}}),Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return Y.Name}});var G=T7();Object.defineProperty(X,"Scope",{enumerable:!0,get:function(){return G.Scope}}),Object.defineProperty(X,"ValueScope",{enumerable:!0,get:function(){return G.ValueScope}}),Object.defineProperty(X,"ValueScopeName",{enumerable:!0,get:function(){return G.ValueScopeName}}),Object.defineProperty(X,"varKinds",{enumerable:!0,get:function(){return G.varKinds}}),X.operators={GT:new Q._Code(">"),GTE:new Q._Code(">="),LT:new Q._Code("<"),LTE:new Q._Code("<="),EQ:new Q._Code("==="),NEQ:new Q._Code("!=="),NOT:new Q._Code("!"),OR:new Q._Code("||"),AND:new Q._Code("&&"),ADD:new Q._Code("+")};class J{optimizeNodes(){return this}optimizeNames(R,T){return this}}class H extends J{constructor(R,T,C){super();this.varKind=R,this.name=T,this.rhs=C}render({es5:R,_n:T}){let C=R?$.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${r};`+T}optimizeNames(R,T){if(!R[this.name.str])return;if(this.rhs)this.rhs=l(this.rhs,R,T);return this}get names(){return this.rhs instanceof Q._CodeOrName?this.rhs.names:{}}}class W extends J{constructor(R,T,C){super();this.lhs=R,this.rhs=T,this.sideEffects=C}render({_n:R}){return`${this.lhs} = ${this.rhs};`+R}optimizeNames(R,T){if(this.lhs instanceof Q.Name&&!R[this.lhs.str]&&!this.sideEffects)return;return this.rhs=l(this.rhs,R,T),this}get names(){let R=this.lhs instanceof Q.Name?{}:{...this.lhs.names};return u(R,this.rhs)}}class U extends W{constructor(R,T,C,r){super(R,C,r);this.op=T}render({_n:R}){return`${this.lhs} ${this.op}= ${this.rhs};`+R}}class z extends J{constructor(R){super();this.label=R,this.names={}}render({_n:R}){return`${this.label}:`+R}}class L extends J{constructor(R){super();this.label=R,this.names={}}render({_n:R}){return`break${this.label?` ${this.label}`:""};`+R}}class B extends J{constructor(R){super();this.error=R}render({_n:R}){return`throw ${this.error};`+R}get names(){return this.error.names}}class F extends J{constructor(R){super();this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,T){return this.code=l(this.code,R,T),this}get names(){return this.code instanceof Q._CodeOrName?this.code.names:{}}}class Z extends J{constructor(R=[]){super();this.nodes=R}render(R){return this.nodes.reduce((T,C)=>T+C.render(R),"")}optimizeNodes(){let{nodes:R}=this,T=R.length;while(T--){let C=R[T].optimizeNodes();if(Array.isArray(C))R.splice(T,1,...C);else if(C)R[T]=C;else R.splice(T,1)}return R.length>0?this:void 0}optimizeNames(R,T){let{nodes:C}=this,r=C.length;while(r--){let X0=C[r];if(X0.optimizeNames(R,T))continue;G0(R,X0.names),C.splice(r,1)}return C.length>0?this:void 0}get names(){return this.nodes.reduce((R,T)=>x(R,T.names),{})}}class I extends Z{render(R){return"{"+R._n+super.render(R)+"}"+R._n}}class A extends Z{}class D extends I{}D.kind="else";class q extends I{constructor(R,T){super(T);this.condition=R}render(R){let T=`if(${this.condition})`+super.render(R);if(this.else)T+="else "+this.else.render(R);return T}optimizeNodes(){super.optimizeNodes();let R=this.condition;if(R===!0)return this.nodes;let T=this.else;if(T){let C=T.optimizeNodes();T=this.else=Array.isArray(C)?new D(C):C}if(T){if(R===!1)return T instanceof q?T:T.nodes;if(this.nodes.length)return this;return new q(Z0(R),T instanceof q?[T]:T.nodes)}if(R===!1||!this.nodes.length)return;return this}optimizeNames(R,T){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(R,T),!(super.optimizeNames(R,T)||this.else))return;return this.condition=l(this.condition,R,T),this}get names(){let R=super.names;if(u(R,this.condition),this.else)x(R,this.else.names);return R}}q.kind="if";class M extends I{}M.kind="for";class K extends M{constructor(R){super();this.iteration=R}render(R){return`for(${this.iteration})`+super.render(R)}optimizeNames(R,T){if(!super.optimizeNames(R,T))return;return this.iteration=l(this.iteration,R,T),this}get names(){return x(super.names,this.iteration.names)}}class V extends M{constructor(R,T,C,r){super();this.varKind=R,this.name=T,this.from=C,this.to=r}render(R){let T=R.es5?$.varKinds.var:this.varKind,{name:C,from:r,to:X0}=this;return`for(${T} ${C}=${r}; ${C}<${X0}; ${C}++)`+super.render(R)}get names(){let R=u(super.names,this.from);return u(R,this.to)}}class N extends M{constructor(R,T,C,r){super();this.loop=R,this.varKind=T,this.name=C,this.iterable=r}render(R){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(R)}optimizeNames(R,T){if(!super.optimizeNames(R,T))return;return this.iterable=l(this.iterable,R,T),this}get names(){return x(super.names,this.iterable.names)}}class O extends I{constructor(R,T,C){super();this.name=R,this.args=T,this.async=C}render(R){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(R)}}O.kind="func";class w extends Z{render(R){return"return "+super.render(R)}}w.kind="return";class j extends I{render(R){let T="try"+super.render(R);if(this.catch)T+=this.catch.render(R);if(this.finally)T+=this.finally.render(R);return T}optimizeNodes(){var R,T;return super.optimizeNodes(),(R=this.catch)===null||R===void 0||R.optimizeNodes(),(T=this.finally)===null||T===void 0||T.optimizeNodes(),this}optimizeNames(R,T){var C,r;return super.optimizeNames(R,T),(C=this.catch)===null||C===void 0||C.optimizeNames(R,T),(r=this.finally)===null||r===void 0||r.optimizeNames(R,T),this}get names(){let R=super.names;if(this.catch)x(R,this.catch.names);if(this.finally)x(R,this.finally.names);return R}}class E extends I{constructor(R){super();this.error=R}render(R){return`catch(${this.error})`+super.render(R)}}E.kind="catch";class g extends I{render(R){return"finally"+super.render(R)}}g.kind="finally";class k{constructor(R,T={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...T,_n:T.lines?`
|
|
187
|
-
`:""},this._extScope=R,this._scope=new $.Scope({parent:R}),this._nodes=[new A]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,T){let C=this._extScope.value(R,T);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(R,T){return this._extScope.getValue(R,T)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,T,C,r){let X0=this._scope.toName(T);if(C!==void 0&&r)this._constants[X0.str]=C;return this._leafNode(new H(R,X0,C)),X0}const(R,T,C){return this._def($.varKinds.const,R,T,C)}let(R,T,C){return this._def($.varKinds.let,R,T,C)}var(R,T,C){return this._def($.varKinds.var,R,T,C)}assign(R,T,C){return this._leafNode(new W(R,T,C))}add(R,T){return this._leafNode(new U(R,X.operators.ADD,T))}code(R){if(typeof R=="function")R();else if(R!==Q.nil)this._leafNode(new F(R));return this}object(...R){let T=["{"];for(let[C,r]of R){if(T.length>1)T.push(",");if(T.push(C),C!==r||this.opts.es5)T.push(":"),(0,Q.addCodeArg)(T,r)}return T.push("}"),new Q._Code(T)}if(R,T,C){if(this._blockNode(new q(R)),T&&C)this.code(T).else().code(C).endIf();else if(T)this.code(T).endIf();else if(C)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new q(R))}else(){return this._elseNode(new D)}endIf(){return this._endBlockNode(q,D)}_for(R,T){if(this._blockNode(R),T)this.code(T).endFor();return this}for(R,T){return this._for(new K(R),T)}forRange(R,T,C,r,X0=this.opts.es5?$.varKinds.var:$.varKinds.let){let z0=this._scope.toName(R);return this._for(new V(X0,z0,T,C),()=>r(z0))}forOf(R,T,C,r=$.varKinds.const){let X0=this._scope.toName(R);if(this.opts.es5){let z0=T instanceof Q.Name?T:this.var("_arr",T);return this.forRange("_i",0,Q._`${z0}.length`,(Q0)=>{this.var(X0,Q._`${z0}[${Q0}]`),C(X0)})}return this._for(new N("of",r,X0,T),()=>C(X0))}forIn(R,T,C,r=this.opts.es5?$.varKinds.var:$.varKinds.const){if(this.opts.ownProperties)return this.forOf(R,Q._`Object.keys(${T})`,C);let X0=this._scope.toName(R);return this._for(new N("in",r,X0,T),()=>C(X0))}endFor(){return this._endBlockNode(M)}label(R){return this._leafNode(new z(R))}break(R){return this._leafNode(new L(R))}return(R){let T=new w;if(this._blockNode(T),this.code(R),T.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(w)}try(R,T,C){if(!T&&!C)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new j;if(this._blockNode(r),this.code(R),T){let X0=this.name("e");this._currNode=r.catch=new E(X0),T(X0)}if(C)this._currNode=r.finally=new g,this.code(C);return this._endBlockNode(E,g)}throw(R){return this._leafNode(new B(R))}block(R,T){if(this._blockStarts.push(this._nodes.length),R)this.code(R).endBlock(T);return this}endBlock(R){let T=this._blockStarts.pop();if(T===void 0)throw Error("CodeGen: not in self-balancing block");let C=this._nodes.length-T;if(C<0||R!==void 0&&C!==R)throw Error(`CodeGen: wrong number of nodes: ${C} vs ${R} expected`);return this._nodes.length=T,this}func(R,T=Q.nil,C,r){if(this._blockNode(new O(R,T,C)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(O)}optimize(R=1){while(R-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,T){let C=this._currNode;if(C instanceof R||T&&C instanceof T)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${T?`${R.kind}/${T.kind}`:R.kind}"`)}_elseNode(R){let T=this._currNode;if(!(T instanceof q))throw Error('CodeGen: "else" without "if"');return this._currNode=T.else=R,this}get _root(){return this._nodes[0]}get _currNode(){let R=this._nodes;return R[R.length-1]}set _currNode(R){let T=this._nodes;T[T.length-1]=R}}X.CodeGen=k;function x(R,T){for(let C in T)R[C]=(R[C]||0)+(T[C]||0);return R}function u(R,T){return T instanceof Q._CodeOrName?x(R,T.names):R}function l(R,T,C){if(R instanceof Q.Name)return r(R);if(!X0(R))return R;return new Q._Code(R._items.reduce((z0,Q0)=>{if(Q0 instanceof Q.Name)Q0=r(Q0);if(Q0 instanceof Q._Code)z0.push(...Q0._items);else z0.push(Q0);return z0},[]));function r(z0){let Q0=C[z0.str];if(Q0===void 0||T[z0.str]!==1)return z0;return delete T[z0.str],Q0}function X0(z0){return z0 instanceof Q._Code&&z0._items.some((Q0)=>Q0 instanceof Q.Name&&T[Q0.str]===1&&C[Q0.str]!==void 0)}}function G0(R,T){for(let C in T)R[C]=(R[C]||0)-(T[C]||0)}function Z0(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:Q._`!${f(R)}`}X.not=Z0;var _0=b(X.operators.AND);function h0(...R){return R.reduce(_0)}X.and=h0;var F0=b(X.operators.OR);function S(...R){return R.reduce(F0)}X.or=S;function b(R){return(T,C)=>T===Q.nil?C:C===Q.nil?T:Q._`${f(T)} ${R} ${f(C)}`}function f(R){return R instanceof Q.Name?R:Q._`(${R})`}}),D0=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.checkStrictMode=X.getErrorPath=X.Type=X.useFunc=X.setEvaluated=X.evaluatedPropsToName=X.mergeEvaluated=X.eachItem=X.unescapeJsonPointer=X.escapeJsonPointer=X.escapeFragment=X.unescapeFragment=X.schemaRefOrVal=X.schemaHasRulesButRef=X.schemaHasRules=X.checkUnknownRules=X.alwaysValidSchema=X.toHash=void 0;var Q=B0(),$=p6();function Y(O){let w={};for(let j of O)w[j]=!0;return w}X.toHash=Y;function G(O,w){if(typeof w=="boolean")return w;if(Object.keys(w).length===0)return!0;return J(O,w),!H(w,O.self.RULES.all)}X.alwaysValidSchema=G;function J(O,w=O.schema){let{opts:j,self:E}=O;if(!j.strictSchema)return;if(typeof w==="boolean")return;let g=E.RULES.keywords;for(let k in w)if(!g[k])N(O,`unknown keyword: "${k}"`)}X.checkUnknownRules=J;function H(O,w){if(typeof O=="boolean")return!O;for(let j in O)if(w[j])return!0;return!1}X.schemaHasRules=H;function W(O,w){if(typeof O=="boolean")return!O;for(let j in O)if(j!=="$ref"&&w.all[j])return!0;return!1}X.schemaHasRulesButRef=W;function U({topSchemaRef:O,schemaPath:w},j,E,g){if(!g){if(typeof j=="number"||typeof j=="boolean")return j;if(typeof j=="string")return Q._`${j}`}return Q._`${O}${w}${(0,Q.getProperty)(E)}`}X.schemaRefOrVal=U;function z(O){return F(decodeURIComponent(O))}X.unescapeFragment=z;function L(O){return encodeURIComponent(B(O))}X.escapeFragment=L;function B(O){if(typeof O=="number")return`${O}`;return O.replace(/~/g,"~0").replace(/\//g,"~1")}X.escapeJsonPointer=B;function F(O){return O.replace(/~1/g,"/").replace(/~0/g,"~")}X.unescapeJsonPointer=F;function Z(O,w){if(Array.isArray(O))for(let j of O)w(j);else w(O)}X.eachItem=Z;function I({mergeNames:O,mergeToName:w,mergeValues:j,resultToName:E}){return(g,k,x,u)=>{let l=x===void 0?k:x instanceof Q.Name?(k instanceof Q.Name?O(g,k,x):w(g,k,x),x):k instanceof Q.Name?(w(g,x,k),k):j(k,x);return u===Q.Name&&!(l instanceof Q.Name)?E(g,l):l}}X.mergeEvaluated={props:I({mergeNames:(O,w,j)=>O.if(Q._`${j} !== true && ${w} !== undefined`,()=>{O.if(Q._`${w} === true`,()=>O.assign(j,!0),()=>O.assign(j,Q._`${j} || {}`).code(Q._`Object.assign(${j}, ${w})`))}),mergeToName:(O,w,j)=>O.if(Q._`${j} !== true`,()=>{if(w===!0)O.assign(j,!0);else O.assign(j,Q._`${j} || {}`),D(O,j,w)}),mergeValues:(O,w)=>O===!0?!0:{...O,...w},resultToName:A}),items:I({mergeNames:(O,w,j)=>O.if(Q._`${j} !== true && ${w} !== undefined`,()=>O.assign(j,Q._`${w} === true ? true : ${j} > ${w} ? ${j} : ${w}`)),mergeToName:(O,w,j)=>O.if(Q._`${j} !== true`,()=>O.assign(j,w===!0?!0:Q._`${j} > ${w} ? ${j} : ${w}`)),mergeValues:(O,w)=>O===!0?!0:Math.max(O,w),resultToName:(O,w)=>O.var("items",w)})};function A(O,w){if(w===!0)return O.var("props",!0);let j=O.var("props",Q._`{}`);if(w!==void 0)D(O,j,w);return j}X.evaluatedPropsToName=A;function D(O,w,j){Object.keys(j).forEach((E)=>O.assign(Q._`${w}${(0,Q.getProperty)(E)}`,!0))}X.setEvaluated=D;var q={};function M(O,w){return O.scopeValue("func",{ref:w,code:q[w.code]||(q[w.code]=new $._Code(w.code))})}X.useFunc=M;var K;(function(O){O[O.Num=0]="Num",O[O.Str=1]="Str"})(K||(X.Type=K={}));function V(O,w,j){if(O instanceof Q.Name){let E=w===K.Num;return j?E?Q._`"[" + ${O} + "]"`:Q._`"['" + ${O} + "']"`:E?Q._`"/" + ${O}`:Q._`"/" + ${O}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return j?(0,Q.getProperty)(O).toString():"/"+B(O)}X.getErrorPath=V;function N(O,w,j=O.opts.strictSchema){if(!j)return;if(w=`strict mode: ${w}`,j===!0)throw Error(w);O.self.logger.warn(w)}X.checkStrictMode=N}),p1=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$={data:new Q.Name("data"),valCxt:new Q.Name("valCxt"),instancePath:new Q.Name("instancePath"),parentData:new Q.Name("parentData"),parentDataProperty:new Q.Name("parentDataProperty"),rootData:new Q.Name("rootData"),dynamicAnchors:new Q.Name("dynamicAnchors"),vErrors:new Q.Name("vErrors"),errors:new Q.Name("errors"),this:new Q.Name("this"),self:new Q.Name("self"),scope:new Q.Name("scope"),json:new Q.Name("json"),jsonPos:new Q.Name("jsonPos"),jsonLen:new Q.Name("jsonLen"),jsonPart:new Q.Name("jsonPart")};X.default=$}),YX=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.extendErrors=X.resetErrorsCount=X.reportExtraError=X.reportError=X.keyword$DataError=X.keywordError=void 0;var Q=B0(),$=D0(),Y=p1();X.keywordError={message:({keyword:D})=>Q.str`must pass "${D}" keyword validation`},X.keyword$DataError={message:({keyword:D,schemaType:q})=>q?Q.str`"${D}" keyword must be ${q} ($data)`:Q.str`"${D}" keyword is invalid ($data)`};function G(D,q=X.keywordError,M,K){let{it:V}=D,{gen:N,compositeRule:O,allErrors:w}=V,j=B(D,q,M);if(K!==null&&K!==void 0?K:O||w)U(N,j);else z(V,Q._`[${j}]`)}X.reportError=G;function J(D,q=X.keywordError,M){let{it:K}=D,{gen:V,compositeRule:N,allErrors:O}=K,w=B(D,q,M);if(U(V,w),!(N||O))z(K,Y.default.vErrors)}X.reportExtraError=J;function H(D,q){D.assign(Y.default.errors,q),D.if(Q._`${Y.default.vErrors} !== null`,()=>D.if(q,()=>D.assign(Q._`${Y.default.vErrors}.length`,q),()=>D.assign(Y.default.vErrors,null)))}X.resetErrorsCount=H;function W({gen:D,keyword:q,schemaValue:M,data:K,errsCount:V,it:N}){if(V===void 0)throw Error("ajv implementation error");let O=D.name("err");D.forRange("i",V,Y.default.errors,(w)=>{if(D.const(O,Q._`${Y.default.vErrors}[${w}]`),D.if(Q._`${O}.instancePath === undefined`,()=>D.assign(Q._`${O}.instancePath`,(0,Q.strConcat)(Y.default.instancePath,N.errorPath))),D.assign(Q._`${O}.schemaPath`,Q.str`${N.errSchemaPath}/${q}`),N.opts.verbose)D.assign(Q._`${O}.schema`,M),D.assign(Q._`${O}.data`,K)})}X.extendErrors=W;function U(D,q){let M=D.const("err",q);D.if(Q._`${Y.default.vErrors} === null`,()=>D.assign(Y.default.vErrors,Q._`[${M}]`),Q._`${Y.default.vErrors}.push(${M})`),D.code(Q._`${Y.default.errors}++`)}function z(D,q){let{gen:M,validateName:K,schemaEnv:V}=D;if(V.$async)M.throw(Q._`new ${D.ValidationError}(${q})`);else M.assign(Q._`${K}.errors`,q),M.return(!1)}var L={keyword:new Q.Name("keyword"),schemaPath:new Q.Name("schemaPath"),params:new Q.Name("params"),propertyName:new Q.Name("propertyName"),message:new Q.Name("message"),schema:new Q.Name("schema"),parentSchema:new Q.Name("parentSchema")};function B(D,q,M){let{createErrors:K}=D.it;if(K===!1)return Q._`{}`;return F(D,q,M)}function F(D,q,M={}){let{gen:K,it:V}=D,N=[Z(V,M),I(D,M)];return A(D,q,N),K.object(...N)}function Z({errorPath:D},{instancePath:q}){let M=q?Q.str`${D}${(0,$.getErrorPath)(q,$.Type.Str)}`:D;return[Y.default.instancePath,(0,Q.strConcat)(Y.default.instancePath,M)]}function I({keyword:D,it:{errSchemaPath:q}},{schemaPath:M,parentSchema:K}){let V=K?q:Q.str`${q}/${D}`;if(M)V=Q.str`${V}${(0,$.getErrorPath)(M,$.Type.Str)}`;return[L.schemaPath,V]}function A(D,{params:q,message:M},K){let{keyword:V,data:N,schemaValue:O,it:w}=D,{opts:j,propertyName:E,topSchemaRef:g,schemaPath:k}=w;if(K.push([L.keyword,V],[L.params,typeof q=="function"?q(D):q||Q._`{}`]),j.messages)K.push([L.message,typeof M=="function"?M(D):M]);if(j.verbose)K.push([L.schema,O],[L.parentSchema,Q._`${g}${k}`],[Y.default.data,N]);if(E)K.push([L.propertyName,E])}}),oK=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.boolOrEmptySchema=X.topBoolOrEmptySchema=void 0;var Q=YX(),$=B0(),Y=p1(),G={message:"boolean schema is false"};function J(U){let{gen:z,schema:L,validateName:B}=U;if(L===!1)W(U,!1);else if(typeof L=="object"&&L.$async===!0)z.return(Y.default.data);else z.assign($._`${B}.errors`,null),z.return(!0)}X.topBoolOrEmptySchema=J;function H(U,z){let{gen:L,schema:B}=U;if(B===!1)L.var(z,!1),W(U);else L.var(z,!0)}X.boolOrEmptySchema=H;function W(U,z){let{gen:L,data:B}=U,F={gen:L,keyword:"false schema",data:B,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:U};(0,Q.reportError)(F,G,void 0,z)}}),zY=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.getRules=X.isJSONType=void 0;var Q=["string","number","integer","boolean","null","object","array"],$=new Set(Q);function Y(J){return typeof J=="string"&&$.has(J)}X.isJSONType=Y;function G(){let J={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...J,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},J.number,J.string,J.array,J.object],post:{rules:[]},all:{},keywords:{}}}X.getRules=G}),BY=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.shouldUseRule=X.shouldUseGroup=X.schemaHasRulesForType=void 0;function Q({schema:G,self:J},H){let W=J.RULES.types[H];return W&&W!==!0&&$(G,W)}X.schemaHasRulesForType=Q;function $(G,J){return J.rules.some((H)=>Y(G,H))}X.shouldUseGroup=$;function Y(G,J){var H;return G[J.keyword]!==void 0||((H=J.definition.implements)===null||H===void 0?void 0:H.some((W)=>G[W]!==void 0))}X.shouldUseRule=Y}),d6=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.reportTypeError=X.checkDataTypes=X.checkDataType=X.coerceAndCheckDataType=X.getJSONTypes=X.getSchemaTypes=X.DataType=void 0;var Q=zY(),$=BY(),Y=YX(),G=B0(),J=D0(),H;(function(K){K[K.Correct=0]="Correct",K[K.Wrong=1]="Wrong"})(H||(X.DataType=H={}));function W(K){let V=U(K.type);if(V.includes("null")){if(K.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!V.length&&K.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(K.nullable===!0)V.push("null")}return V}X.getSchemaTypes=W;function U(K){let V=Array.isArray(K)?K:K?[K]:[];if(V.every(Q.isJSONType))return V;throw Error("type must be JSONType or JSONType[]: "+V.join(","))}X.getJSONTypes=U;function z(K,V){let{gen:N,data:O,opts:w}=K,j=B(V,w.coerceTypes),E=V.length>0&&!(j.length===0&&V.length===1&&(0,$.schemaHasRulesForType)(K,V[0]));if(E){let g=A(V,O,w.strictNumbers,H.Wrong);N.if(g,()=>{if(j.length)F(K,V,j);else q(K)})}return E}X.coerceAndCheckDataType=z;var L=new Set(["string","number","integer","boolean","null"]);function B(K,V){return V?K.filter((N)=>L.has(N)||V==="array"&&N==="array"):[]}function F(K,V,N){let{gen:O,data:w,opts:j}=K,E=O.let("dataType",G._`typeof ${w}`),g=O.let("coerced",G._`undefined`);if(j.coerceTypes==="array")O.if(G._`${E} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>O.assign(w,G._`${w}[0]`).assign(E,G._`typeof ${w}`).if(A(V,w,j.strictNumbers),()=>O.assign(g,w)));O.if(G._`${g} !== undefined`);for(let x of N)if(L.has(x)||x==="array"&&j.coerceTypes==="array")k(x);O.else(),q(K),O.endIf(),O.if(G._`${g} !== undefined`,()=>{O.assign(w,g),Z(K,g)});function k(x){switch(x){case"string":O.elseIf(G._`${E} == "number" || ${E} == "boolean"`).assign(g,G._`"" + ${w}`).elseIf(G._`${w} === null`).assign(g,G._`""`);return;case"number":O.elseIf(G._`${E} == "boolean" || ${w} === null
|
|
188
|
-
|
|
189
|
-
|| (${E} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(g,G._`+${w}`);return;case"boolean":O.elseIf(G._`${w} === "false" || ${w} === 0 || ${w} === null`).assign(g,!1).elseIf(G._`${w} === "true" || ${w} === 1`).assign(g,!0);return;case"null":O.elseIf(G._`${w} === "" || ${w} === 0 || ${w} === false`),O.assign(g,null);return;case"array":O.elseIf(G._`${E} === "string" || ${E} === "number"
|
|
190
|
-
|| ${E} === "boolean" || ${w} === null`).assign(g,G._`[${w}]`)}}}function Z({gen:K,parentData:V,parentDataProperty:N},O){K.if(G._`${V} !== undefined`,()=>K.assign(G._`${V}[${N}]`,O))}function I(K,V,N,O=H.Correct){let w=O===H.Correct?G.operators.EQ:G.operators.NEQ,j;switch(K){case"null":return G._`${V} ${w} null`;case"array":j=G._`Array.isArray(${V})`;break;case"object":j=G._`${V} && typeof ${V} == "object" && !Array.isArray(${V})`;break;case"integer":j=E(G._`!(${V} % 1) && !isNaN(${V})`);break;case"number":j=E();break;default:return G._`typeof ${V} ${w} ${K}`}return O===H.Correct?j:(0,G.not)(j);function E(g=G.nil){return(0,G.and)(G._`typeof ${V} == "number"`,g,N?G._`isFinite(${V})`:G.nil)}}X.checkDataType=I;function A(K,V,N,O){if(K.length===1)return I(K[0],V,N,O);let w,j=(0,J.toHash)(K);if(j.array&&j.object){let E=G._`typeof ${V} != "object"`;w=j.null?E:G._`!${V} || ${E}`,delete j.null,delete j.array,delete j.object}else w=G.nil;if(j.number)delete j.integer;for(let E in j)w=(0,G.and)(w,I(E,V,N,O));return w}X.checkDataTypes=A;var D={message:({schema:K})=>`must be ${K}`,params:({schema:K,schemaValue:V})=>typeof K=="string"?G._`{type: ${K}}`:G._`{type: ${V}}`};function q(K){let V=M(K);(0,Y.reportError)(V,D)}X.reportTypeError=q;function M(K){let{gen:V,data:N,schema:O}=K,w=(0,J.schemaRefOrVal)(K,O,"type");return{gen:V,keyword:"type",data:N,schema:O.type,schemaCode:w,schemaValue:w,parentSchema:O,params:{},it:K}}}),aK=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.assignDefaults=void 0;var Q=B0(),$=D0();function Y(J,H){let{properties:W,items:U}=J.schema;if(H==="object"&&W)for(let z in W)G(J,z,W[z].default);else if(H==="array"&&Array.isArray(U))U.forEach((z,L)=>G(J,L,z.default))}X.assignDefaults=Y;function G(J,H,W){let{gen:U,compositeRule:z,data:L,opts:B}=J;if(W===void 0)return;let F=Q._`${L}${(0,Q.getProperty)(H)}`;if(z){(0,$.checkStrictMode)(J,`default is ignored for: ${F}`);return}let Z=Q._`${F} === undefined`;if(B.useDefaults==="empty")Z=Q._`${Z} || ${F} === null || ${F} === ""`;U.if(Z,Q._`${F} = ${(0,Q.stringify)(W)}`)}}),z1=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;var Q=B0(),$=D0(),Y=p1(),G=D0();function J(K,V){let{gen:N,data:O,it:w}=K;N.if(B(N,O,V,w.opts.ownProperties),()=>{K.setParams({missingProperty:Q._`${V}`},!0),K.error()})}X.checkReportMissingProp=J;function H({gen:K,data:V,it:{opts:N}},O,w){return(0,Q.or)(...O.map((j)=>(0,Q.and)(B(K,V,j,N.ownProperties),Q._`${w} = ${j}`)))}X.checkMissingProp=H;function W(K,V){K.setParams({missingProperty:V},!0),K.error()}X.reportMissingProp=W;function U(K){return K.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Q._`Object.prototype.hasOwnProperty`})}X.hasPropFunc=U;function z(K,V,N){return Q._`${U(K)}.call(${V}, ${N})`}X.isOwnProperty=z;function L(K,V,N,O){let w=Q._`${V}${(0,Q.getProperty)(N)} !== undefined`;return O?Q._`${w} && ${z(K,V,N)}`:w}X.propertyInData=L;function B(K,V,N,O){let w=Q._`${V}${(0,Q.getProperty)(N)} === undefined`;return O?(0,Q.or)(w,(0,Q.not)(z(K,V,N))):w}X.noPropertyInData=B;function F(K){return K?Object.keys(K).filter((V)=>V!=="__proto__"):[]}X.allSchemaProperties=F;function Z(K,V){return F(V).filter((N)=>!(0,$.alwaysValidSchema)(K,V[N]))}X.schemaProperties=Z;function I({schemaCode:K,data:V,it:{gen:N,topSchemaRef:O,schemaPath:w,errorPath:j},it:E},g,k,x){let u=x?Q._`${K}, ${V}, ${O}${w}`:V,l=[[Y.default.instancePath,(0,Q.strConcat)(Y.default.instancePath,j)],[Y.default.parentData,E.parentData],[Y.default.parentDataProperty,E.parentDataProperty],[Y.default.rootData,Y.default.rootData]];if(E.opts.dynamicRef)l.push([Y.default.dynamicAnchors,Y.default.dynamicAnchors]);let G0=Q._`${u}, ${N.object(...l)}`;return k!==Q.nil?Q._`${g}.call(${k}, ${G0})`:Q._`${g}(${G0})`}X.callValidateCode=I;var A=Q._`new RegExp`;function D({gen:K,it:{opts:V}},N){let O=V.unicodeRegExp?"u":"",{regExp:w}=V.code,j=w(N,O);return K.scopeValue("pattern",{key:j.toString(),ref:j,code:Q._`${w.code==="new RegExp"?A:(0,G.useFunc)(K,w)}(${N}, ${O})`})}X.usePattern=D;function q(K){let{gen:V,data:N,keyword:O,it:w}=K,j=V.name("valid");if(w.allErrors){let g=V.let("valid",!0);return E(()=>V.assign(g,!1)),g}return V.var(j,!0),E(()=>V.break()),j;function E(g){let k=V.const("len",Q._`${N}.length`);V.forRange("i",0,k,(x)=>{K.subschema({keyword:O,dataProp:x,dataPropType:$.Type.Num},j),V.if((0,Q.not)(j),g)})}}X.validateArray=q;function M(K){let{gen:V,schema:N,keyword:O,it:w}=K;if(!Array.isArray(N))throw Error("ajv implementation error");if(N.some((k)=>(0,$.alwaysValidSchema)(w,k))&&!w.opts.unevaluated)return;let E=V.let("valid",!1),g=V.name("_valid");V.block(()=>N.forEach((k,x)=>{let u=K.subschema({keyword:O,schemaProp:x,compositeRule:!0},g);if(V.assign(E,Q._`${E} || ${g}`),!K.mergeValidEvaluated(u,g))V.if((0,Q.not)(E))})),K.result(E,()=>K.reset(),()=>K.error(!0))}X.validateUnion=M}),sK=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateKeywordUsage=X.validSchemaType=X.funcKeywordCode=X.macroKeywordCode=void 0;var Q=B0(),$=p1(),Y=z1(),G=YX();function J(Z,I){let{gen:A,keyword:D,schema:q,parentSchema:M,it:K}=Z,V=I.macro.call(K.self,q,M,K),N=L(A,D,V);if(K.opts.validateSchema!==!1)K.self.validateSchema(V,!0);let O=A.name("valid");Z.subschema({schema:V,schemaPath:Q.nil,errSchemaPath:`${K.errSchemaPath}/${D}`,topSchemaRef:N,compositeRule:!0},O),Z.pass(O,()=>Z.error(!0))}X.macroKeywordCode=J;function H(Z,I){var A;let{gen:D,keyword:q,schema:M,parentSchema:K,$data:V,it:N}=Z;z(N,I);let O=!V&&I.compile?I.compile.call(N.self,M,K,N):I.validate,w=L(D,q,O),j=D.let("valid");Z.block$data(j,E),Z.ok((A=I.valid)!==null&&A!==void 0?A:j);function E(){if(I.errors===!1){if(x(),I.modifying)W(Z);u(()=>Z.error())}else{let l=I.async?g():k();if(I.modifying)W(Z);u(()=>U(Z,l))}}function g(){let l=D.let("ruleErrs",null);return D.try(()=>x(Q._`await `),(G0)=>D.assign(j,!1).if(Q._`${G0} instanceof ${N.ValidationError}`,()=>D.assign(l,Q._`${G0}.errors`),()=>D.throw(G0))),l}function k(){let l=Q._`${w}.errors`;return D.assign(l,null),x(Q.nil),l}function x(l=I.async?Q._`await `:Q.nil){let G0=N.opts.passContext?$.default.this:$.default.self,Z0=!(("compile"in I)&&!V||I.schema===!1);D.assign(j,Q._`${l}${(0,Y.callValidateCode)(Z,w,G0,Z0)}`,I.modifying)}function u(l){var G0;D.if((0,Q.not)((G0=I.valid)!==null&&G0!==void 0?G0:j),l)}}X.funcKeywordCode=H;function W(Z){let{gen:I,data:A,it:D}=Z;I.if(D.parentData,()=>I.assign(A,Q._`${D.parentData}[${D.parentDataProperty}]`))}function U(Z,I){let{gen:A}=Z;A.if(Q._`Array.isArray(${I})`,()=>{A.assign($.default.vErrors,Q._`${$.default.vErrors} === null ? ${I} : ${$.default.vErrors}.concat(${I})`).assign($.default.errors,Q._`${$.default.vErrors}.length`),(0,G.extendErrors)(Z)},()=>Z.error())}function z({schemaEnv:Z},I){if(I.async&&!Z.$async)throw Error("async keyword in sync schema")}function L(Z,I,A){if(A===void 0)throw Error(`keyword "${I}" failed to compile`);return Z.scopeValue("keyword",typeof A=="function"?{ref:A}:{ref:A,code:(0,Q.stringify)(A)})}function B(Z,I,A=!1){return!I.length||I.some((D)=>D==="array"?Array.isArray(Z):D==="object"?Z&&typeof Z=="object"&&!Array.isArray(Z):typeof Z==D||A&&typeof Z>"u")}X.validSchemaType=B;function F({schema:Z,opts:I,self:A,errSchemaPath:D},q,M){if(Array.isArray(q.keyword)?!q.keyword.includes(M):q.keyword!==M)throw Error("ajv implementation error");let K=q.dependencies;if(K===null||K===void 0?void 0:K.some((V)=>!Object.prototype.hasOwnProperty.call(Z,V)))throw Error(`parent schema must have dependencies of ${M}: ${K.join(",")}`);if(q.validateSchema){if(!q.validateSchema(Z[M])){let N=`keyword "${M}" value is invalid at path "${D}": `+A.errorsText(q.validateSchema.errors);if(I.validateSchema==="log")A.logger.error(N);else throw Error(N)}}}X.validateKeywordUsage=F}),tK=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.extendSubschemaMode=X.extendSubschemaData=X.getSubschema=void 0;var Q=B0(),$=D0();function Y(H,{keyword:W,schemaProp:U,schema:z,schemaPath:L,errSchemaPath:B,topSchemaRef:F}){if(W!==void 0&&z!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(W!==void 0){let Z=H.schema[W];return U===void 0?{schema:Z,schemaPath:Q._`${H.schemaPath}${(0,Q.getProperty)(W)}`,errSchemaPath:`${H.errSchemaPath}/${W}`}:{schema:Z[U],schemaPath:Q._`${H.schemaPath}${(0,Q.getProperty)(W)}${(0,Q.getProperty)(U)}`,errSchemaPath:`${H.errSchemaPath}/${W}/${(0,$.escapeFragment)(U)}`}}if(z!==void 0){if(L===void 0||B===void 0||F===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:z,schemaPath:L,topSchemaRef:F,errSchemaPath:B}}throw Error('either "keyword" or "schema" must be passed')}X.getSubschema=Y;function G(H,W,{dataProp:U,dataPropType:z,data:L,dataTypes:B,propertyName:F}){if(L!==void 0&&U!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:Z}=W;if(U!==void 0){let{errorPath:A,dataPathArr:D,opts:q}=W,M=Z.let("data",Q._`${W.data}${(0,Q.getProperty)(U)}`,!0);I(M),H.errorPath=Q.str`${A}${(0,$.getErrorPath)(U,z,q.jsPropertySyntax)}`,H.parentDataProperty=Q._`${U}`,H.dataPathArr=[...D,H.parentDataProperty]}if(L!==void 0){let A=L instanceof Q.Name?L:Z.let("data",L,!0);if(I(A),F!==void 0)H.propertyName=F}if(B)H.dataTypes=B;function I(A){H.data=A,H.dataLevel=W.dataLevel+1,H.dataTypes=[],W.definedProperties=new Set,H.parentData=W.data,H.dataNames=[...W.dataNames,A]}}X.extendSubschemaData=G;function J(H,{jtdDiscriminator:W,jtdMetadata:U,compositeRule:z,createErrors:L,allErrors:B}){if(z!==void 0)H.compositeRule=z;if(L!==void 0)H.createErrors=L;if(B!==void 0)H.allErrors=B;H.jtdDiscriminator=W,H.jtdMetadata=U}X.extendSubschemaMode=J}),LY=i((X,Q)=>{Q.exports=function $(Y,G){if(Y===G)return!0;if(Y&&G&&typeof Y=="object"&&typeof G=="object"){if(Y.constructor!==G.constructor)return!1;var J,H,W;if(Array.isArray(Y)){if(J=Y.length,J!=G.length)return!1;for(H=J;H--!==0;)if(!$(Y[H],G[H]))return!1;return!0}if(Y.constructor===RegExp)return Y.source===G.source&&Y.flags===G.flags;if(Y.valueOf!==Object.prototype.valueOf)return Y.valueOf()===G.valueOf();if(Y.toString!==Object.prototype.toString)return Y.toString()===G.toString();if(W=Object.keys(Y),J=W.length,J!==Object.keys(G).length)return!1;for(H=J;H--!==0;)if(!Object.prototype.hasOwnProperty.call(G,W[H]))return!1;for(H=J;H--!==0;){var U=W[H];if(!$(Y[U],G[U]))return!1}return!0}return Y!==Y&&G!==G}}),eK=i((X,Q)=>{var $=Q.exports=function(J,H,W){if(typeof H=="function")W=H,H={};W=H.cb||W;var U=typeof W=="function"?W:W.pre||function(){},z=W.post||function(){};Y(H,U,z,J,"",J)};$.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},$.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},$.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},$.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Y(J,H,W,U,z,L,B,F,Z,I){if(U&&typeof U=="object"&&!Array.isArray(U)){H(U,z,L,B,F,Z,I);for(var A in U){var D=U[A];if(Array.isArray(D)){if(A in $.arrayKeywords)for(var q=0;q<D.length;q++)Y(J,H,W,D[q],z+"/"+A+"/"+q,L,z,A,U,q)}else if(A in $.propsKeywords){if(D&&typeof D=="object")for(var M in D)Y(J,H,W,D[M],z+"/"+A+"/"+G(M),L,z,A,U,M)}else if(A in $.keywords||J.allKeys&&!(A in $.skipKeywords))Y(J,H,W,D,z+"/"+A,L,z,A,U)}W(U,z,L,B,F,Z,I)}}function G(J){return J.replace(/~/g,"~0").replace(/\//g,"~1")}}),GX=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.getSchemaRefs=X.resolveUrl=X.normalizeId=X._getFullPath=X.getFullPath=X.inlineRef=void 0;var Q=D0(),$=LY(),Y=eK(),G=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function J(D,q=!0){if(typeof D=="boolean")return!0;if(q===!0)return!W(D);if(!q)return!1;return U(D)<=q}X.inlineRef=J;var H=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function W(D){for(let q in D){if(H.has(q))return!0;let M=D[q];if(Array.isArray(M)&&M.some(W))return!0;if(typeof M=="object"&&W(M))return!0}return!1}function U(D){let q=0;for(let M in D){if(M==="$ref")return 1/0;if(q++,G.has(M))continue;if(typeof D[M]=="object")(0,Q.eachItem)(D[M],(K)=>q+=U(K));if(q===1/0)return 1/0}return q}function z(D,q="",M){if(M!==!1)q=F(q);let K=D.parse(q);return L(D,K)}X.getFullPath=z;function L(D,q){return D.serialize(q).split("#")[0]+"#"}X._getFullPath=L;var B=/#\/?$/;function F(D){return D?D.replace(B,""):""}X.normalizeId=F;function Z(D,q,M){return M=F(M),D.resolve(q,M)}X.resolveUrl=Z;var I=/^[a-z_][-a-z0-9._]*$/i;function A(D,q){if(typeof D=="boolean")return{};let{schemaId:M,uriResolver:K}=this.opts,V=F(D[M]||q),N={"":V},O=z(K,V,!1),w={},j=new Set;return Y(D,{allKeys:!0},(k,x,u,l)=>{if(l===void 0)return;let G0=O+x,Z0=N[l];if(typeof k[M]=="string")Z0=_0.call(this,k[M]);h0.call(this,k.$anchor),h0.call(this,k.$dynamicAnchor),N[x]=Z0;function _0(F0){let S=this.opts.uriResolver.resolve;if(F0=F(Z0?S(Z0,F0):F0),j.has(F0))throw g(F0);j.add(F0);let b=this.refs[F0];if(typeof b=="string")b=this.refs[b];if(typeof b=="object")E(k,b.schema,F0);else if(F0!==F(G0))if(F0[0]==="#")E(k,w[F0],F0),w[F0]=k;else this.refs[F0]=G0;return F0}function h0(F0){if(typeof F0=="string"){if(!I.test(F0))throw Error(`invalid anchor "${F0}"`);_0.call(this,`#${F0}`)}}}),w;function E(k,x,u){if(x!==void 0&&!$(k,x))throw g(u)}function g(k){return Error(`reference "${k}" resolves to more than one schema`)}}X.getSchemaRefs=A}),JX=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.getData=X.KeywordCxt=X.validateFunctionCode=void 0;var Q=oK(),$=d6(),Y=BY(),G=d6(),J=aK(),H=sK(),W=tK(),U=B0(),z=p1(),L=GX(),B=D0(),F=YX();function Z(P){if(O(P)){if(j(P),N(P)){q(P);return}}I(P,()=>(0,Q.topBoolOrEmptySchema)(P))}X.validateFunctionCode=Z;function I({gen:P,validateName:_,schema:h,schemaEnv:a,opts:e},L0){if(e.code.es5)P.func(_,U._`${z.default.data}, ${z.default.valCxt}`,a.$async,()=>{P.code(U._`"use strict"; ${K(h,e)}`),D(P,e),P.code(L0)});else P.func(_,U._`${z.default.data}, ${A(e)}`,a.$async,()=>P.code(K(h,e)).code(L0))}function A(P){return U._`{${z.default.instancePath}="", ${z.default.parentData}, ${z.default.parentDataProperty}, ${z.default.rootData}=${z.default.data}${P.dynamicRef?U._`, ${z.default.dynamicAnchors}={}`:U.nil}}={}`}function D(P,_){P.if(z.default.valCxt,()=>{if(P.var(z.default.instancePath,U._`${z.default.valCxt}.${z.default.instancePath}`),P.var(z.default.parentData,U._`${z.default.valCxt}.${z.default.parentData}`),P.var(z.default.parentDataProperty,U._`${z.default.valCxt}.${z.default.parentDataProperty}`),P.var(z.default.rootData,U._`${z.default.valCxt}.${z.default.rootData}`),_.dynamicRef)P.var(z.default.dynamicAnchors,U._`${z.default.valCxt}.${z.default.dynamicAnchors}`)},()=>{if(P.var(z.default.instancePath,U._`""`),P.var(z.default.parentData,U._`undefined`),P.var(z.default.parentDataProperty,U._`undefined`),P.var(z.default.rootData,z.default.data),_.dynamicRef)P.var(z.default.dynamicAnchors,U._`{}`)})}function q(P){let{schema:_,opts:h,gen:a}=P;I(P,()=>{if(h.$comment&&_.$comment)l(P);if(k(P),a.let(z.default.vErrors,null),a.let(z.default.errors,0),h.unevaluated)M(P);E(P),G0(P)});return}function M(P){let{gen:_,validateName:h}=P;P.evaluated=_.const("evaluated",U._`${h}.evaluated`),_.if(U._`${P.evaluated}.dynamicProps`,()=>_.assign(U._`${P.evaluated}.props`,U._`undefined`)),_.if(U._`${P.evaluated}.dynamicItems`,()=>_.assign(U._`${P.evaluated}.items`,U._`undefined`))}function K(P,_){let h=typeof P=="object"&&P[_.schemaId];return h&&(_.code.source||_.code.process)?U._`/*# sourceURL=${h} */`:U.nil}function V(P,_){if(O(P)){if(j(P),N(P)){w(P,_);return}}(0,Q.boolOrEmptySchema)(P,_)}function N({schema:P,self:_}){if(typeof P=="boolean")return!P;for(let h in P)if(_.RULES.all[h])return!0;return!1}function O(P){return typeof P.schema!="boolean"}function w(P,_){let{schema:h,gen:a,opts:e}=P;if(e.$comment&&h.$comment)l(P);x(P),u(P);let L0=a.const("_errs",z.default.errors);E(P,L0),a.var(_,U._`${L0} === ${z.default.errors}`)}function j(P){(0,B.checkUnknownRules)(P),g(P)}function E(P,_){if(P.opts.jtd)return _0(P,[],!1,_);let h=(0,$.getSchemaTypes)(P.schema),a=(0,$.coerceAndCheckDataType)(P,h);_0(P,h,!a,_)}function g(P){let{schema:_,errSchemaPath:h,opts:a,self:e}=P;if(_.$ref&&a.ignoreKeywordsWithRef&&(0,B.schemaHasRulesButRef)(_,e.RULES))e.logger.warn(`$ref: keywords ignored in schema at path "${h}"`)}function k(P){let{schema:_,opts:h}=P;if(_.default!==void 0&&h.useDefaults&&h.strictSchema)(0,B.checkStrictMode)(P,"default is ignored in the schema root")}function x(P){let _=P.schema[P.opts.schemaId];if(_)P.baseId=(0,L.resolveUrl)(P.opts.uriResolver,P.baseId,_)}function u(P){if(P.schema.$async&&!P.schemaEnv.$async)throw Error("async schema in sync schema")}function l({gen:P,schemaEnv:_,schema:h,errSchemaPath:a,opts:e}){let L0=h.$comment;if(e.$comment===!0)P.code(U._`${z.default.self}.logger.log(${L0})`);else if(typeof e.$comment=="function"){let p0=U.str`${a}/$comment`,s0=P.scopeValue("root",{ref:_.root});P.code(U._`${z.default.self}.opts.$comment(${L0}, ${p0}, ${s0}.schema)`)}}function G0(P){let{gen:_,schemaEnv:h,validateName:a,ValidationError:e,opts:L0}=P;if(h.$async)_.if(U._`${z.default.errors} === 0`,()=>_.return(z.default.data),()=>_.throw(U._`new ${e}(${z.default.vErrors})`));else{if(_.assign(U._`${a}.errors`,z.default.vErrors),L0.unevaluated)Z0(P);_.return(U._`${z.default.errors} === 0`)}}function Z0({gen:P,evaluated:_,props:h,items:a}){if(h instanceof U.Name)P.assign(U._`${_}.props`,h);if(a instanceof U.Name)P.assign(U._`${_}.items`,a)}function _0(P,_,h,a){let{gen:e,schema:L0,data:p0,allErrors:s0,opts:L1,self:i0}=P,{RULES:f0}=i0;if(L0.$ref&&(L1.ignoreKeywordsWithRef||!(0,B.schemaHasRulesButRef)(L0,f0))){e.block(()=>z0(P,"$ref",f0.all.$ref.definition));return}if(!L1.jtd)F0(P,_);e.block(()=>{for(let t0 of f0.rules)G9(t0);G9(f0.post)});function G9(t0){if(!(0,Y.shouldUseGroup)(L0,t0))return;if(t0.type){if(e.if((0,G.checkDataType)(t0.type,p0,L1.strictNumbers)),h0(P,t0),_.length===1&&_[0]===t0.type&&h)e.else(),(0,G.reportTypeError)(P);e.endIf()}else h0(P,t0);if(!s0)e.if(U._`${z.default.errors} === ${a||0}`)}}function h0(P,_){let{gen:h,schema:a,opts:{useDefaults:e}}=P;if(e)(0,J.assignDefaults)(P,_.type);h.block(()=>{for(let L0 of _.rules)if((0,Y.shouldUseRule)(a,L0))z0(P,L0.keyword,L0.definition,_.type)})}function F0(P,_){if(P.schemaEnv.meta||!P.opts.strictTypes)return;if(S(P,_),!P.opts.allowUnionTypes)b(P,_);f(P,P.dataTypes)}function S(P,_){if(!_.length)return;if(!P.dataTypes.length){P.dataTypes=_;return}_.forEach((h)=>{if(!T(P.dataTypes,h))r(P,`type "${h}" not allowed by context "${P.dataTypes.join(",")}"`)}),C(P,_)}function b(P,_){if(_.length>1&&!(_.length===2&&_.includes("null")))r(P,"use allowUnionTypes to allow union type keyword")}function f(P,_){let h=P.self.RULES.all;for(let a in h){let e=h[a];if(typeof e=="object"&&(0,Y.shouldUseRule)(P.schema,e)){let{type:L0}=e.definition;if(L0.length&&!L0.some((p0)=>R(_,p0)))r(P,`missing type "${L0.join(",")}" for keyword "${a}"`)}}}function R(P,_){return P.includes(_)||_==="number"&&P.includes("integer")}function T(P,_){return P.includes(_)||_==="integer"&&P.includes("number")}function C(P,_){let h=[];for(let a of P.dataTypes)if(T(_,a))h.push(a);else if(_.includes("integer")&&a==="number")h.push("integer");P.dataTypes=h}function r(P,_){let h=P.schemaEnv.baseId+P.errSchemaPath;_+=` at "${h}" (strictTypes)`,(0,B.checkStrictMode)(P,_,P.opts.strictTypes)}class X0{constructor(P,_,h){if((0,H.validateKeywordUsage)(P,_,h),this.gen=P.gen,this.allErrors=P.allErrors,this.keyword=h,this.data=P.data,this.schema=P.schema[h],this.$data=_.$data&&P.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,B.schemaRefOrVal)(P,this.schema,h,this.$data),this.schemaType=_.schemaType,this.parentSchema=P.schema,this.params={},this.it=P,this.def=_,this.$data)this.schemaCode=P.gen.const("vSchema",G1(this.$data,P));else if(this.schemaCode=this.schemaValue,!(0,H.validSchemaType)(this.schema,_.schemaType,_.allowUndefined))throw Error(`${h} value must be ${JSON.stringify(_.schemaType)}`);if("code"in _?_.trackErrors:_.errors!==!1)this.errsCount=P.gen.const("_errs",z.default.errors)}result(P,_,h){this.failResult((0,U.not)(P),_,h)}failResult(P,_,h){if(this.gen.if(P),h)h();else this.error();if(_){if(this.gen.else(),_(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(P,_){this.failResult((0,U.not)(P),void 0,_)}fail(P){if(P===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(P),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(P){if(!this.$data)return this.fail(P);let{schemaCode:_}=this;this.fail(U._`${_} !== undefined && (${(0,U.or)(this.invalid$data(),P)})`)}error(P,_,h){if(_){this.setParams(_),this._error(P,h),this.setParams({});return}this._error(P,h)}_error(P,_){(P?F.reportExtraError:F.reportError)(this,this.def.error,_)}$dataError(){(0,F.reportError)(this,this.def.$dataError||F.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,F.resetErrorsCount)(this.gen,this.errsCount)}ok(P){if(!this.allErrors)this.gen.if(P)}setParams(P,_){if(_)Object.assign(this.params,P);else this.params=P}block$data(P,_,h=U.nil){this.gen.block(()=>{this.check$data(P,h),_()})}check$data(P=U.nil,_=U.nil){if(!this.$data)return;let{gen:h,schemaCode:a,schemaType:e,def:L0}=this;if(h.if((0,U.or)(U._`${a} === undefined`,_)),P!==U.nil)h.assign(P,!0);if(e.length||L0.validateSchema){if(h.elseIf(this.invalid$data()),this.$dataError(),P!==U.nil)h.assign(P,!1)}h.else()}invalid$data(){let{gen:P,schemaCode:_,schemaType:h,def:a,it:e}=this;return(0,U.or)(L0(),p0());function L0(){if(h.length){if(!(_ instanceof U.Name))throw Error("ajv implementation error");let s0=Array.isArray(h)?h:[h];return U._`${(0,G.checkDataTypes)(s0,_,e.opts.strictNumbers,G.DataType.Wrong)}`}return U.nil}function p0(){if(a.validateSchema){let s0=P.scopeValue("validate$data",{ref:a.validateSchema});return U._`!${s0}(${_})`}return U.nil}}subschema(P,_){let h=(0,W.getSubschema)(this.it,P);(0,W.extendSubschemaData)(h,this.it,P),(0,W.extendSubschemaMode)(h,P);let a={...this.it,...h,items:void 0,props:void 0};return V(a,_),a}mergeEvaluated(P,_){let{it:h,gen:a}=this;if(!h.opts.unevaluated)return;if(h.props!==!0&&P.props!==void 0)h.props=B.mergeEvaluated.props(a,P.props,h.props,_);if(h.items!==!0&&P.items!==void 0)h.items=B.mergeEvaluated.items(a,P.items,h.items,_)}mergeValidEvaluated(P,_){let{it:h,gen:a}=this;if(h.opts.unevaluated&&(h.props!==!0||h.items!==!0))return a.if(_,()=>this.mergeEvaluated(P,U.Name)),!0}}X.KeywordCxt=X0;function z0(P,_,h,a){let e=new X0(P,h,_);if("code"in h)h.code(e,a);else if(e.$data&&h.validate)(0,H.funcKeywordCode)(e,h);else if("macro"in h)(0,H.macroKeywordCode)(e,h);else if(h.compile||h.validate)(0,H.funcKeywordCode)(e,h)}var Q0=/^\/(?:[^~]|~0|~1)*$/,S0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function G1(P,{dataLevel:_,dataNames:h,dataPathArr:a}){let e,L0;if(P==="")return z.default.rootData;if(P[0]==="/"){if(!Q0.test(P))throw Error(`Invalid JSON-pointer: ${P}`);e=P,L0=z.default.rootData}else{let i0=S0.exec(P);if(!i0)throw Error(`Invalid JSON-pointer: ${P}`);let f0=+i0[1];if(e=i0[2],e==="#"){if(f0>=_)throw Error(L1("property/index",f0));return a[_-f0]}if(f0>_)throw Error(L1("data",f0));if(L0=h[_-f0],!e)return L0}let p0=L0,s0=e.split("/");for(let i0 of s0)if(i0)L0=U._`${L0}${(0,U.getProperty)((0,B.unescapeJsonPointer)(i0))}`,p0=U._`${p0} && ${L0}`;return p0;function L1(i0,f0){return`Cannot access ${i0} ${f0} levels up, current level is ${_}`}}X.getData=G1}),V$=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});class Q extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}X.default=Q}),HX=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=GX();class $ extends Error{constructor(Y,G,J,H){super(H||`can't resolve reference ${J} from id ${G}`);this.missingRef=(0,Q.resolveUrl)(Y,G,J),this.missingSchema=(0,Q.normalizeId)((0,Q.getFullPath)(Y,this.missingRef))}}X.default=$}),K$=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.resolveSchema=X.getCompilingSchema=X.resolveRef=X.compileSchema=X.SchemaEnv=void 0;var Q=B0(),$=V$(),Y=p1(),G=GX(),J=D0(),H=JX();class W{constructor(q){var M;this.refs={},this.dynamicAnchors={};let K;if(typeof q.schema=="object")K=q.schema;this.schema=q.schema,this.schemaId=q.schemaId,this.root=q.root||this,this.baseId=(M=q.baseId)!==null&&M!==void 0?M:(0,G.normalizeId)(K===null||K===void 0?void 0:K[q.schemaId||"$id"]),this.schemaPath=q.schemaPath,this.localRefs=q.localRefs,this.meta=q.meta,this.$async=K===null||K===void 0?void 0:K.$async,this.refs={}}}X.SchemaEnv=W;function U(q){let M=B.call(this,q);if(M)return M;let K=(0,G.getFullPath)(this.opts.uriResolver,q.root.baseId),{es5:V,lines:N}=this.opts.code,{ownProperties:O}=this.opts,w=new Q.CodeGen(this.scope,{es5:V,lines:N,ownProperties:O}),j;if(q.$async)j=w.scopeValue("Error",{ref:$.default,code:Q._`require("ajv/dist/runtime/validation_error").default`});let E=w.scopeName("validate");q.validateName=E;let g={gen:w,allErrors:this.opts.allErrors,data:Y.default.data,parentData:Y.default.parentData,parentDataProperty:Y.default.parentDataProperty,dataNames:[Y.default.data],dataPathArr:[Q.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:q.schema,code:(0,Q.stringify)(q.schema)}:{ref:q.schema}),validateName:E,ValidationError:j,schema:q.schema,schemaEnv:q,rootId:K,baseId:q.baseId||K,schemaPath:Q.nil,errSchemaPath:q.schemaPath||(this.opts.jtd?"":"#"),errorPath:Q._`""`,opts:this.opts,self:this},k;try{this._compilations.add(q),(0,H.validateFunctionCode)(g),w.optimize(this.opts.code.optimize);let x=w.toString();if(k=`${w.scopeRefs(Y.default.scope)}return ${x}`,this.opts.code.process)k=this.opts.code.process(k,q);let l=Function(`${Y.default.self}`,`${Y.default.scope}`,k)(this,this.scope.get());if(this.scope.value(E,{ref:l}),l.errors=null,l.schema=q.schema,l.schemaEnv=q,q.$async)l.$async=!0;if(this.opts.code.source===!0)l.source={validateName:E,validateCode:x,scopeValues:w._values};if(this.opts.unevaluated){let{props:G0,items:Z0}=g;if(l.evaluated={props:G0 instanceof Q.Name?void 0:G0,items:Z0 instanceof Q.Name?void 0:Z0,dynamicProps:G0 instanceof Q.Name,dynamicItems:Z0 instanceof Q.Name},l.source)l.source.evaluated=(0,Q.stringify)(l.evaluated)}return q.validate=l,q}catch(x){if(delete q.validate,delete q.validateName,k)this.logger.error("Error compiling schema, function code:",k);throw x}finally{this._compilations.delete(q)}}X.compileSchema=U;function z(q,M,K){var V;K=(0,G.resolveUrl)(this.opts.uriResolver,M,K);let N=q.refs[K];if(N)return N;let O=Z.call(this,q,K);if(O===void 0){let w=(V=q.localRefs)===null||V===void 0?void 0:V[K],{schemaId:j}=this.opts;if(w)O=new W({schema:w,schemaId:j,root:q,baseId:M})}if(O===void 0)return;return q.refs[K]=L.call(this,O)}X.resolveRef=z;function L(q){if((0,G.inlineRef)(q.schema,this.opts.inlineRefs))return q.schema;return q.validate?q:U.call(this,q)}function B(q){for(let M of this._compilations)if(F(M,q))return M}X.getCompilingSchema=B;function F(q,M){return q.schema===M.schema&&q.root===M.root&&q.baseId===M.baseId}function Z(q,M){let K;while(typeof(K=this.refs[M])=="string")M=K;return K||this.schemas[M]||I.call(this,q,M)}function I(q,M){let K=this.opts.uriResolver.parse(M),V=(0,G._getFullPath)(this.opts.uriResolver,K),N=(0,G.getFullPath)(this.opts.uriResolver,q.baseId,void 0);if(Object.keys(q.schema).length>0&&V===N)return D.call(this,K,q);let O=(0,G.normalizeId)(V),w=this.refs[O]||this.schemas[O];if(typeof w=="string"){let j=I.call(this,q,w);if(typeof(j===null||j===void 0?void 0:j.schema)!=="object")return;return D.call(this,K,j)}if(typeof(w===null||w===void 0?void 0:w.schema)!=="object")return;if(!w.validate)U.call(this,w);if(O===(0,G.normalizeId)(M)){let{schema:j}=w,{schemaId:E}=this.opts,g=j[E];if(g)N=(0,G.resolveUrl)(this.opts.uriResolver,N,g);return new W({schema:j,schemaId:E,root:q,baseId:N})}return D.call(this,K,w)}X.resolveSchema=I;var A=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function D(q,{baseId:M,schema:K,root:V}){var N;if(((N=q.fragment)===null||N===void 0?void 0:N[0])!=="/")return;for(let j of q.fragment.slice(1).split("/")){if(typeof K==="boolean")return;let E=K[(0,J.unescapeFragment)(j)];if(E===void 0)return;K=E;let g=typeof K==="object"&&K[this.opts.schemaId];if(!A.has(j)&&g)M=(0,G.resolveUrl)(this.opts.uriResolver,M,g)}let O;if(typeof K!="boolean"&&K.$ref&&!(0,J.schemaHasRulesButRef)(K,this.RULES)){let j=(0,G.resolveUrl)(this.opts.uriResolver,M,K.$ref);O=I.call(this,V,j)}let{schemaId:w}=this.opts;if(O=O||new W({schema:K,schemaId:w,root:V,baseId:M}),O.schema!==O.root.schema)return O;return}}),XM=i((X,Q)=>{Q.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),QM=i((X,Q)=>{var $={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Q.exports={HEX:$}}),$M=i((X,Q)=>{var{HEX:$}=QM(),Y=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function G(q){if(z(q,".")<3)return{host:q,isIPV4:!1};let M=q.match(Y)||[],[K]=M;if(K)return{host:U(K,"."),isIPV4:!0};else return{host:q,isIPV4:!1}}function J(q,M=!1){let K="",V=!0;for(let N of q){if($[N]===void 0)return;if(N!=="0"&&V===!0)V=!1;if(!V)K+=N}if(M&&K.length===0)K="0";return K}function H(q){let M=0,K={error:!1,address:"",zone:""},V=[],N=[],O=!1,w=!1,j=!1;function E(){if(N.length){if(O===!1){let g=J(N);if(g!==void 0)V.push(g);else return K.error=!0,!1}N.length=0}return!0}for(let g=0;g<q.length;g++){let k=q[g];if(k==="["||k==="]")continue;if(k===":"){if(w===!0)j=!0;if(!E())break;if(M++,V.push(":"),M>7){K.error=!0;break}if(g-1>=0&&q[g-1]===":")w=!0;continue}else if(k==="%"){if(!E())break;O=!0}else{N.push(k);continue}}if(N.length)if(O)K.zone=N.join("");else if(j)V.push(N.join(""));else V.push(J(N));return K.address=V.join(""),K}function W(q){if(z(q,":")<2)return{host:q,isIPV6:!1};let M=H(q);if(!M.error){let{address:K,address:V}=M;if(M.zone)K+="%"+M.zone,V+="%25"+M.zone;return{host:K,escapedHost:V,isIPV6:!0}}else return{host:q,isIPV6:!1}}function U(q,M){let K="",V=!0,N=q.length;for(let O=0;O<N;O++){let w=q[O];if(w==="0"&&V){if(O+1<=N&&q[O+1]===M||O+1===N)K+=w,V=!1}else{if(w===M)V=!0;else V=!1;K+=w}}return K}function z(q,M){let K=0;for(let V=0;V<q.length;V++)if(q[V]===M)K++;return K}var L=/^\.\.?\//u,B=/^\/\.(?:\/|$)/u,F=/^\/\.\.(?:\/|$)/u,Z=/^\/?(?:.|\n)*?(?=\/|$)/u;function I(q){let M=[];while(q.length)if(q.match(L))q=q.replace(L,"");else if(q.match(B))q=q.replace(B,"/");else if(q.match(F))q=q.replace(F,"/"),M.pop();else if(q==="."||q==="..")q="";else{let K=q.match(Z);if(K){let V=K[0];q=q.slice(V.length),M.push(V)}else throw Error("Unexpected dot segment condition")}return M.join("")}function A(q,M){let K=M!==!0?escape:unescape;if(q.scheme!==void 0)q.scheme=K(q.scheme);if(q.userinfo!==void 0)q.userinfo=K(q.userinfo);if(q.host!==void 0)q.host=K(q.host);if(q.path!==void 0)q.path=K(q.path);if(q.query!==void 0)q.query=K(q.query);if(q.fragment!==void 0)q.fragment=K(q.fragment);return q}function D(q){let M=[];if(q.userinfo!==void 0)M.push(q.userinfo),M.push("@");if(q.host!==void 0){let K=unescape(q.host),V=G(K);if(V.isIPV4)K=V.host;else{let N=W(V.host);if(N.isIPV6===!0)K=`[${N.escapedHost}]`;else K=q.host}M.push(K)}if(typeof q.port==="number"||typeof q.port==="string")M.push(":"),M.push(String(q.port));return M.length?M.join(""):void 0}Q.exports={recomposeAuthority:D,normalizeComponentEncoding:A,removeDotSegments:I,normalizeIPv4:G,normalizeIPv6:W,stringArrayToHexStripped:J}}),YM=i((X,Q)=>{var $=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,Y=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function G(V){return typeof V.secure==="boolean"?V.secure:String(V.scheme).toLowerCase()==="wss"}function J(V){if(!V.host)V.error=V.error||"HTTP URIs must have a host.";return V}function H(V){let N=String(V.scheme).toLowerCase()==="https";if(V.port===(N?443:80)||V.port==="")V.port=void 0;if(!V.path)V.path="/";return V}function W(V){return V.secure=G(V),V.resourceName=(V.path||"/")+(V.query?"?"+V.query:""),V.path=void 0,V.query=void 0,V}function U(V){if(V.port===(G(V)?443:80)||V.port==="")V.port=void 0;if(typeof V.secure==="boolean")V.scheme=V.secure?"wss":"ws",V.secure=void 0;if(V.resourceName){let[N,O]=V.resourceName.split("?");V.path=N&&N!=="/"?N:void 0,V.query=O,V.resourceName=void 0}return V.fragment=void 0,V}function z(V,N){if(!V.path)return V.error="URN can not be parsed",V;let O=V.path.match(Y);if(O){let w=N.scheme||V.scheme||"urn";V.nid=O[1].toLowerCase(),V.nss=O[2];let j=`${w}:${N.nid||V.nid}`,E=K[j];if(V.path=void 0,E)V=E.parse(V,N)}else V.error=V.error||"URN can not be parsed.";return V}function L(V,N){let O=N.scheme||V.scheme||"urn",w=V.nid.toLowerCase(),j=`${O}:${N.nid||w}`,E=K[j];if(E)V=E.serialize(V,N);let g=V,k=V.nss;return g.path=`${w||N.nid}:${k}`,N.skipEscape=!0,g}function B(V,N){let O=V;if(O.uuid=O.nss,O.nss=void 0,!N.tolerant&&(!O.uuid||!$.test(O.uuid)))O.error=O.error||"UUID is not valid.";return O}function F(V){let N=V;return N.nss=(V.uuid||"").toLowerCase(),N}var Z={scheme:"http",domainHost:!0,parse:J,serialize:H},I={scheme:"https",domainHost:Z.domainHost,parse:J,serialize:H},A={scheme:"ws",domainHost:!0,parse:W,serialize:U},D={scheme:"wss",domainHost:A.domainHost,parse:A.parse,serialize:A.serialize},q={scheme:"urn",parse:z,serialize:L,skipNormalize:!0},M={scheme:"urn:uuid",parse:B,serialize:F,skipNormalize:!0},K={http:Z,https:I,ws:A,wss:D,urn:q,"urn:uuid":M};Q.exports=K}),GM=i((X,Q)=>{var{normalizeIPv6:$,normalizeIPv4:Y,removeDotSegments:G,recomposeAuthority:J,normalizeComponentEncoding:H}=$M(),W=YM();function U(M,K){if(typeof M==="string")M=F(D(M,K),K);else if(typeof M==="object")M=D(F(M,K),K);return M}function z(M,K,V){let N=Object.assign({scheme:"null"},V),O=L(D(M,N),D(K,N),N,!0);return F(O,{...N,skipEscape:!0})}function L(M,K,V,N){let O={};if(!N)M=D(F(M,V),V),K=D(F(K,V),V);if(V=V||{},!V.tolerant&&K.scheme)O.scheme=K.scheme,O.userinfo=K.userinfo,O.host=K.host,O.port=K.port,O.path=G(K.path||""),O.query=K.query;else{if(K.userinfo!==void 0||K.host!==void 0||K.port!==void 0)O.userinfo=K.userinfo,O.host=K.host,O.port=K.port,O.path=G(K.path||""),O.query=K.query;else{if(!K.path)if(O.path=M.path,K.query!==void 0)O.query=K.query;else O.query=M.query;else{if(K.path.charAt(0)==="/")O.path=G(K.path);else{if((M.userinfo!==void 0||M.host!==void 0||M.port!==void 0)&&!M.path)O.path="/"+K.path;else if(!M.path)O.path=K.path;else O.path=M.path.slice(0,M.path.lastIndexOf("/")+1)+K.path;O.path=G(O.path)}O.query=K.query}O.userinfo=M.userinfo,O.host=M.host,O.port=M.port}O.scheme=M.scheme}return O.fragment=K.fragment,O}function B(M,K,V){if(typeof M==="string")M=unescape(M),M=F(H(D(M,V),!0),{...V,skipEscape:!0});else if(typeof M==="object")M=F(H(M,!0),{...V,skipEscape:!0});if(typeof K==="string")K=unescape(K),K=F(H(D(K,V),!0),{...V,skipEscape:!0});else if(typeof K==="object")K=F(H(K,!0),{...V,skipEscape:!0});return M.toLowerCase()===K.toLowerCase()}function F(M,K){let V={host:M.host,scheme:M.scheme,userinfo:M.userinfo,port:M.port,path:M.path,query:M.query,nid:M.nid,nss:M.nss,uuid:M.uuid,fragment:M.fragment,reference:M.reference,resourceName:M.resourceName,secure:M.secure,error:""},N=Object.assign({},K),O=[],w=W[(N.scheme||V.scheme||"").toLowerCase()];if(w&&w.serialize)w.serialize(V,N);if(V.path!==void 0)if(!N.skipEscape){if(V.path=escape(V.path),V.scheme!==void 0)V.path=V.path.split("%3A").join(":")}else V.path=unescape(V.path);if(N.reference!=="suffix"&&V.scheme)O.push(V.scheme,":");let j=J(V);if(j!==void 0){if(N.reference!=="suffix")O.push("//");if(O.push(j),V.path&&V.path.charAt(0)!=="/")O.push("/")}if(V.path!==void 0){let E=V.path;if(!N.absolutePath&&(!w||!w.absolutePath))E=G(E);if(j===void 0)E=E.replace(/^\/\//u,"/%2F");O.push(E)}if(V.query!==void 0)O.push("?",V.query);if(V.fragment!==void 0)O.push("#",V.fragment);return O.join("")}var Z=Array.from({length:127},(M,K)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(K)));function I(M){let K=0;for(let V=0,N=M.length;V<N;++V)if(K=M.charCodeAt(V),K>126||Z[K])return!0;return!1}var A=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function D(M,K){let V=Object.assign({},K),N={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},O=M.indexOf("%")!==-1,w=!1;if(V.reference==="suffix")M=(V.scheme?V.scheme+":":"")+"//"+M;let j=M.match(A);if(j){if(N.scheme=j[1],N.userinfo=j[3],N.host=j[4],N.port=parseInt(j[5],10),N.path=j[6]||"",N.query=j[7],N.fragment=j[8],isNaN(N.port))N.port=j[5];if(N.host){let g=Y(N.host);if(g.isIPV4===!1){let k=$(g.host);N.host=k.host.toLowerCase(),w=k.isIPV6}else N.host=g.host,w=!0}if(N.scheme===void 0&&N.userinfo===void 0&&N.host===void 0&&N.port===void 0&&N.query===void 0&&!N.path)N.reference="same-document";else if(N.scheme===void 0)N.reference="relative";else if(N.fragment===void 0)N.reference="absolute";else N.reference="uri";if(V.reference&&V.reference!=="suffix"&&V.reference!==N.reference)N.error=N.error||"URI is not a "+V.reference+" reference.";let E=W[(V.scheme||N.scheme||"").toLowerCase()];if(!V.unicodeSupport&&(!E||!E.unicodeSupport)){if(N.host&&(V.domainHost||E&&E.domainHost)&&w===!1&&I(N.host))try{N.host=URL.domainToASCII(N.host.toLowerCase())}catch(g){N.error=N.error||"Host's domain name can not be converted to ASCII: "+g}}if(!E||E&&!E.skipNormalize){if(O&&N.scheme!==void 0)N.scheme=unescape(N.scheme);if(O&&N.host!==void 0)N.host=unescape(N.host);if(N.path)N.path=escape(unescape(N.path));if(N.fragment)N.fragment=encodeURI(decodeURIComponent(N.fragment))}if(E&&E.parse)E.parse(N,V)}else N.error=N.error||"URI can not be parsed.";return N}var q={SCHEMES:W,normalize:U,resolve:z,resolveComponents:L,equal:B,serialize:F,parse:D};Q.exports=q,Q.exports.default=q,Q.exports.fastUri=q}),JM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=GM();Q.code='require("ajv/dist/runtime/uri").default',X.default=Q}),HM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.CodeGen=X.Name=X.nil=X.stringify=X.str=X._=X.KeywordCxt=void 0;var Q=JX();Object.defineProperty(X,"KeywordCxt",{enumerable:!0,get:function(){return Q.KeywordCxt}});var $=B0();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return $._}}),Object.defineProperty(X,"str",{enumerable:!0,get:function(){return $.str}}),Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return $.stringify}}),Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return $.nil}}),Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return $.Name}}),Object.defineProperty(X,"CodeGen",{enumerable:!0,get:function(){return $.CodeGen}});var Y=V$(),G=HX(),J=zY(),H=K$(),W=B0(),U=GX(),z=d6(),L=D0(),B=XM(),F=JM(),Z=(S,b)=>new RegExp(S,b);Z.code="new RegExp";var I=["removeAdditional","useDefaults","coerceTypes"],A=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),D={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},q={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},M=200;function K(S){var b,f,R,T,C,r,X0,z0,Q0,S0,G1,P,_,h,a,e,L0,p0,s0,L1,i0,f0,G9,t0,wX;let h9=S.strict,IX=(b=S.code)===null||b===void 0?void 0:b.optimize,p$=IX===!0||IX===void 0?1:IX||0,d$=(R=(f=S.code)===null||f===void 0?void 0:f.regExp)!==null&&R!==void 0?R:Z,ZJ=(T=S.uriResolver)!==null&&T!==void 0?T:F.default;return{strictSchema:(r=(C=S.strictSchema)!==null&&C!==void 0?C:h9)!==null&&r!==void 0?r:!0,strictNumbers:(z0=(X0=S.strictNumbers)!==null&&X0!==void 0?X0:h9)!==null&&z0!==void 0?z0:!0,strictTypes:(S0=(Q0=S.strictTypes)!==null&&Q0!==void 0?Q0:h9)!==null&&S0!==void 0?S0:"log",strictTuples:(P=(G1=S.strictTuples)!==null&&G1!==void 0?G1:h9)!==null&&P!==void 0?P:"log",strictRequired:(h=(_=S.strictRequired)!==null&&_!==void 0?_:h9)!==null&&h!==void 0?h:!1,code:S.code?{...S.code,optimize:p$,regExp:d$}:{optimize:p$,regExp:d$},loopRequired:(a=S.loopRequired)!==null&&a!==void 0?a:M,loopEnum:(e=S.loopEnum)!==null&&e!==void 0?e:M,meta:(L0=S.meta)!==null&&L0!==void 0?L0:!0,messages:(p0=S.messages)!==null&&p0!==void 0?p0:!0,inlineRefs:(s0=S.inlineRefs)!==null&&s0!==void 0?s0:!0,schemaId:(L1=S.schemaId)!==null&&L1!==void 0?L1:"$id",addUsedSchema:(i0=S.addUsedSchema)!==null&&i0!==void 0?i0:!0,validateSchema:(f0=S.validateSchema)!==null&&f0!==void 0?f0:!0,validateFormats:(G9=S.validateFormats)!==null&&G9!==void 0?G9:!0,unicodeRegExp:(t0=S.unicodeRegExp)!==null&&t0!==void 0?t0:!0,int32range:(wX=S.int32range)!==null&&wX!==void 0?wX:!0,uriResolver:ZJ}}class V{constructor(S={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,S=this.opts={...S,...K(S)};let{es5:b,lines:f}=this.opts.code;this.scope=new W.ValueScope({scope:{},prefixes:A,es5:b,lines:f}),this.logger=x(S.logger);let R=S.validateFormats;if(S.validateFormats=!1,this.RULES=(0,J.getRules)(),N.call(this,D,S,"NOT SUPPORTED"),N.call(this,q,S,"DEPRECATED","warn"),this._metaOpts=g.call(this),S.formats)j.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),S.keywords)E.call(this,S.keywords);if(typeof S.meta=="object")this.addMetaSchema(S.meta);w.call(this),S.validateFormats=R}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:S,meta:b,schemaId:f}=this.opts,R=B;if(f==="id")R={...B},R.id=R.$id,delete R.$id;if(b&&S)this.addMetaSchema(R,R[f],!1)}defaultMeta(){let{meta:S,schemaId:b}=this.opts;return this.opts.defaultMeta=typeof S=="object"?S[b]||S:void 0}validate(S,b){let f;if(typeof S=="string"){if(f=this.getSchema(S),!f)throw Error(`no schema with key or ref "${S}"`)}else f=this.compile(S);let R=f(b);if(!("$async"in f))this.errors=f.errors;return R}compile(S,b){let f=this._addSchema(S,b);return f.validate||this._compileSchemaEnv(f)}compileAsync(S,b){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:f}=this.opts;return R.call(this,S,b);async function R(Q0,S0){await T.call(this,Q0.$schema);let G1=this._addSchema(Q0,S0);return G1.validate||C.call(this,G1)}async function T(Q0){if(Q0&&!this.getSchema(Q0))await R.call(this,{$ref:Q0},!0)}async function C(Q0){try{return this._compileSchemaEnv(Q0)}catch(S0){if(!(S0 instanceof G.default))throw S0;return r.call(this,S0),await X0.call(this,S0.missingSchema),C.call(this,Q0)}}function r({missingSchema:Q0,missingRef:S0}){if(this.refs[Q0])throw Error(`AnySchema ${Q0} is loaded but ${S0} cannot be resolved`)}async function X0(Q0){let S0=await z0.call(this,Q0);if(!this.refs[Q0])await T.call(this,S0.$schema);if(!this.refs[Q0])this.addSchema(S0,Q0,b)}async function z0(Q0){let S0=this._loading[Q0];if(S0)return S0;try{return await(this._loading[Q0]=f(Q0))}finally{delete this._loading[Q0]}}}addSchema(S,b,f,R=this.opts.validateSchema){if(Array.isArray(S)){for(let C of S)this.addSchema(C,void 0,f,R);return this}let T;if(typeof S==="object"){let{schemaId:C}=this.opts;if(T=S[C],T!==void 0&&typeof T!="string")throw Error(`schema ${C} must be string`)}return b=(0,U.normalizeId)(b||T),this._checkUnique(b),this.schemas[b]=this._addSchema(S,f,b,R,!0),this}addMetaSchema(S,b,f=this.opts.validateSchema){return this.addSchema(S,b,!0,f),this}validateSchema(S,b){if(typeof S=="boolean")return!0;let f;if(f=S.$schema,f!==void 0&&typeof f!="string")throw Error("$schema must be a string");if(f=f||this.opts.defaultMeta||this.defaultMeta(),!f)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let R=this.validate(f,S);if(!R&&b){let T="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(T);else throw Error(T)}return R}getSchema(S){let b;while(typeof(b=O.call(this,S))=="string")S=b;if(b===void 0){let{schemaId:f}=this.opts,R=new H.SchemaEnv({schema:{},schemaId:f});if(b=H.resolveSchema.call(this,R,S),!b)return;this.refs[S]=b}return b.validate||this._compileSchemaEnv(b)}removeSchema(S){if(S instanceof RegExp)return this._removeAllSchemas(this.schemas,S),this._removeAllSchemas(this.refs,S),this;switch(typeof S){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let b=O.call(this,S);if(typeof b=="object")this._cache.delete(b.schema);return delete this.schemas[S],delete this.refs[S],this}case"object":{let b=S;this._cache.delete(b);let f=S[this.opts.schemaId];if(f)f=(0,U.normalizeId)(f),delete this.schemas[f],delete this.refs[f];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(S){for(let b of S)this.addKeyword(b);return this}addKeyword(S,b){let f;if(typeof S=="string"){if(f=S,typeof b=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),b.keyword=f}else if(typeof S=="object"&&b===void 0){if(b=S,f=b.keyword,Array.isArray(f)&&!f.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(l.call(this,f,b),!b)return(0,L.eachItem)(f,(T)=>G0.call(this,T)),this;_0.call(this,b);let R={...b,type:(0,z.getJSONTypes)(b.type),schemaType:(0,z.getJSONTypes)(b.schemaType)};return(0,L.eachItem)(f,R.type.length===0?(T)=>G0.call(this,T,R):(T)=>R.type.forEach((C)=>G0.call(this,T,R,C))),this}getKeyword(S){let b=this.RULES.all[S];return typeof b=="object"?b.definition:!!b}removeKeyword(S){let{RULES:b}=this;delete b.keywords[S],delete b.all[S];for(let f of b.rules){let R=f.rules.findIndex((T)=>T.keyword===S);if(R>=0)f.rules.splice(R,1)}return this}addFormat(S,b){if(typeof b=="string")b=new RegExp(b);return this.formats[S]=b,this}errorsText(S=this.errors,{separator:b=", ",dataVar:f="data"}={}){if(!S||S.length===0)return"No errors";return S.map((R)=>`${f}${R.instancePath} ${R.message}`).reduce((R,T)=>R+b+T)}$dataMetaSchema(S,b){let f=this.RULES.all;S=JSON.parse(JSON.stringify(S));for(let R of b){let T=R.split("/").slice(1),C=S;for(let r of T)C=C[r];for(let r in f){let X0=f[r];if(typeof X0!="object")continue;let{$data:z0}=X0.definition,Q0=C[r];if(z0&&Q0)C[r]=F0(Q0)}}return S}_removeAllSchemas(S,b){for(let f in S){let R=S[f];if(!b||b.test(f)){if(typeof R=="string")delete S[f];else if(R&&!R.meta)this._cache.delete(R.schema),delete S[f]}}}_addSchema(S,b,f,R=this.opts.validateSchema,T=this.opts.addUsedSchema){let C,{schemaId:r}=this.opts;if(typeof S=="object")C=S[r];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof S!="boolean")throw Error("schema must be object or boolean");let X0=this._cache.get(S);if(X0!==void 0)return X0;f=(0,U.normalizeId)(C||f);let z0=U.getSchemaRefs.call(this,S,f);if(X0=new H.SchemaEnv({schema:S,schemaId:r,meta:b,baseId:f,localRefs:z0}),this._cache.set(X0.schema,X0),T&&!f.startsWith("#")){if(f)this._checkUnique(f);this.refs[f]=X0}if(R)this.validateSchema(S,!0);return X0}_checkUnique(S){if(this.schemas[S]||this.refs[S])throw Error(`schema with key or id "${S}" already exists`)}_compileSchemaEnv(S){if(S.meta)this._compileMetaSchema(S);else H.compileSchema.call(this,S);if(!S.validate)throw Error("ajv implementation error");return S.validate}_compileMetaSchema(S){let b=this.opts;this.opts=this._metaOpts;try{H.compileSchema.call(this,S)}finally{this.opts=b}}}V.ValidationError=Y.default,V.MissingRefError=G.default,X.default=V;function N(S,b,f,R="error"){for(let T in S){let C=T;if(C in b)this.logger[R](`${f}: option ${T}. ${S[C]}`)}}function O(S){return S=(0,U.normalizeId)(S),this.schemas[S]||this.refs[S]}function w(){let S=this.opts.schemas;if(!S)return;if(Array.isArray(S))this.addSchema(S);else for(let b in S)this.addSchema(S[b],b)}function j(){for(let S in this.opts.formats){let b=this.opts.formats[S];if(b)this.addFormat(S,b)}}function E(S){if(Array.isArray(S)){this.addVocabulary(S);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let b in S){let f=S[b];if(!f.keyword)f.keyword=b;this.addKeyword(f)}}function g(){let S={...this.opts};for(let b of I)delete S[b];return S}var k={log(){},warn(){},error(){}};function x(S){if(S===!1)return k;if(S===void 0)return console;if(S.log&&S.warn&&S.error)return S;throw Error("logger must implement log, warn and error methods")}var u=/^[a-z_$][a-z0-9_$:-]*$/i;function l(S,b){let{RULES:f}=this;if((0,L.eachItem)(S,(R)=>{if(f.keywords[R])throw Error(`Keyword ${R} is already defined`);if(!u.test(R))throw Error(`Keyword ${R} has invalid name`)}),!b)return;if(b.$data&&!(("code"in b)||("validate"in b)))throw Error('$data keyword must have "code" or "validate" function')}function G0(S,b,f){var R;let T=b===null||b===void 0?void 0:b.post;if(f&&T)throw Error('keyword with "post" flag cannot have "type"');let{RULES:C}=this,r=T?C.post:C.rules.find(({type:z0})=>z0===f);if(!r)r={type:f,rules:[]},C.rules.push(r);if(C.keywords[S]=!0,!b)return;let X0={keyword:S,definition:{...b,type:(0,z.getJSONTypes)(b.type),schemaType:(0,z.getJSONTypes)(b.schemaType)}};if(b.before)Z0.call(this,r,X0,b.before);else r.rules.push(X0);C.all[S]=X0,(R=b.implements)===null||R===void 0||R.forEach((z0)=>this.addKeyword(z0))}function Z0(S,b,f){let R=S.rules.findIndex((T)=>T.keyword===f);if(R>=0)S.rules.splice(R,0,b);else S.rules.push(b),this.logger.warn(`rule ${f} is not defined`)}function _0(S){let{metaSchema:b}=S;if(b===void 0)return;if(S.$data&&this.opts.$data)b=F0(b);S.validateSchema=this.compile(b,!0)}var h0={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function F0(S){return{anyOf:[S,h0]}}}),WM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};X.default=Q}),UM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.callRef=X.getValidate=void 0;var Q=HX(),$=z1(),Y=B0(),G=p1(),J=K$(),H=D0(),W={keyword:"$ref",schemaType:"string",code(L){let{gen:B,schema:F,it:Z}=L,{baseId:I,schemaEnv:A,validateName:D,opts:q,self:M}=Z,{root:K}=A;if((F==="#"||F==="#/")&&I===K.baseId)return N();let V=J.resolveRef.call(M,K,I,F);if(V===void 0)throw new Q.default(Z.opts.uriResolver,I,F);if(V instanceof J.SchemaEnv)return O(V);return w(V);function N(){if(A===K)return z(L,D,A,A.$async);let j=B.scopeValue("root",{ref:K});return z(L,Y._`${j}.validate`,K,K.$async)}function O(j){let E=U(L,j);z(L,E,j,j.$async)}function w(j){let E=B.scopeValue("schema",q.code.source===!0?{ref:j,code:(0,Y.stringify)(j)}:{ref:j}),g=B.name("valid"),k=L.subschema({schema:j,dataTypes:[],schemaPath:Y.nil,topSchemaRef:E,errSchemaPath:F},g);L.mergeEvaluated(k),L.ok(g)}}};function U(L,B){let{gen:F}=L;return B.validate?F.scopeValue("validate",{ref:B.validate}):Y._`${F.scopeValue("wrapper",{ref:B})}.validate`}X.getValidate=U;function z(L,B,F,Z){let{gen:I,it:A}=L,{allErrors:D,schemaEnv:q,opts:M}=A,K=M.passContext?G.default.this:Y.nil;if(Z)V();else N();function V(){if(!q.$async)throw Error("async schema referenced by sync schema");let j=I.let("valid");I.try(()=>{if(I.code(Y._`await ${(0,$.callValidateCode)(L,B,K)}`),w(B),!D)I.assign(j,!0)},(E)=>{if(I.if(Y._`!(${E} instanceof ${A.ValidationError})`,()=>I.throw(E)),O(E),!D)I.assign(j,!1)}),L.ok(j)}function N(){L.result((0,$.callValidateCode)(L,B,K),()=>w(B),()=>O(B))}function O(j){let E=Y._`${j}.errors`;I.assign(G.default.vErrors,Y._`${G.default.vErrors} === null ? ${E} : ${G.default.vErrors}.concat(${E})`),I.assign(G.default.errors,Y._`${G.default.vErrors}.length`)}function w(j){var E;if(!A.opts.unevaluated)return;let g=(E=F===null||F===void 0?void 0:F.validate)===null||E===void 0?void 0:E.evaluated;if(A.props!==!0)if(g&&!g.dynamicProps){if(g.props!==void 0)A.props=H.mergeEvaluated.props(I,g.props,A.props)}else{let k=I.var("props",Y._`${j}.evaluated.props`);A.props=H.mergeEvaluated.props(I,k,A.props,Y.Name)}if(A.items!==!0)if(g&&!g.dynamicItems){if(g.items!==void 0)A.items=H.mergeEvaluated.items(I,g.items,A.items)}else{let k=I.var("items",Y._`${j}.evaluated.items`);A.items=H.mergeEvaluated.items(I,k,A.items,Y.Name)}}}X.callRef=z,X.default=W}),zM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=WM(),$=UM(),Y=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Q.default,$.default];X.default=Y}),BM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$=Q.operators,Y={maximum:{okStr:"<=",ok:$.LTE,fail:$.GT},minimum:{okStr:">=",ok:$.GTE,fail:$.LT},exclusiveMaximum:{okStr:"<",ok:$.LT,fail:$.GTE},exclusiveMinimum:{okStr:">",ok:$.GT,fail:$.LTE}},G={message:({keyword:H,schemaCode:W})=>Q.str`must be ${Y[H].okStr} ${W}`,params:({keyword:H,schemaCode:W})=>Q._`{comparison: ${Y[H].okStr}, limit: ${W}}`},J={keyword:Object.keys(Y),type:"number",schemaType:"number",$data:!0,error:G,code(H){let{keyword:W,data:U,schemaCode:z}=H;H.fail$data(Q._`${U} ${Y[W].fail} ${z} || isNaN(${U})`)}};X.default=J}),LM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$={message:({schemaCode:G})=>Q.str`must be multiple of ${G}`,params:({schemaCode:G})=>Q._`{multipleOf: ${G}}`},Y={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:$,code(G){let{gen:J,data:H,schemaCode:W,it:U}=G,z=U.opts.multipleOfPrecision,L=J.let("res"),B=z?Q._`Math.abs(Math.round(${L}) - ${L}) > 1e-${z}`:Q._`${L} !== parseInt(${L})`;G.fail$data(Q._`(${W} === 0 || (${L} = ${H}/${W}, ${B}))`)}};X.default=Y}),qM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});function Q($){let Y=$.length,G=0,J=0,H;while(J<Y)if(G++,H=$.charCodeAt(J++),H>=55296&&H<=56319&&J<Y){if(H=$.charCodeAt(J),(H&64512)===56320)J++}return G}X.default=Q,Q.code='require("ajv/dist/runtime/ucs2length").default'}),FM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$=D0(),Y=qM(),G={message({keyword:H,schemaCode:W}){let U=H==="maxLength"?"more":"fewer";return Q.str`must NOT have ${U} than ${W} characters`},params:({schemaCode:H})=>Q._`{limit: ${H}}`},J={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:G,code(H){let{keyword:W,data:U,schemaCode:z,it:L}=H,B=W==="maxLength"?Q.operators.GT:Q.operators.LT,F=L.opts.unicode===!1?Q._`${U}.length`:Q._`${(0,$.useFunc)(H.gen,Y.default)}(${U})`;H.fail$data(Q._`${F} ${B} ${z}`)}};X.default=J}),VM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z1(),$=B0(),Y={message:({schemaCode:J})=>$.str`must match pattern "${J}"`,params:({schemaCode:J})=>$._`{pattern: ${J}}`},G={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Y,code(J){let{data:H,$data:W,schema:U,schemaCode:z,it:L}=J,B=L.opts.unicodeRegExp?"u":"",F=W?$._`(new RegExp(${z}, ${B}))`:(0,Q.usePattern)(J,U);J.fail$data($._`!${F}.test(${H})`)}};X.default=G}),KM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$={message({keyword:G,schemaCode:J}){let H=G==="maxProperties"?"more":"fewer";return Q.str`must NOT have ${H} than ${J} properties`},params:({schemaCode:G})=>Q._`{limit: ${G}}`},Y={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:$,code(G){let{keyword:J,data:H,schemaCode:W}=G,U=J==="maxProperties"?Q.operators.GT:Q.operators.LT;G.fail$data(Q._`Object.keys(${H}).length ${U} ${W}`)}};X.default=Y}),MM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z1(),$=B0(),Y=D0(),G={message:({params:{missingProperty:H}})=>$.str`must have required property '${H}'`,params:({params:{missingProperty:H}})=>$._`{missingProperty: ${H}}`},J={keyword:"required",type:"object",schemaType:"array",$data:!0,error:G,code(H){let{gen:W,schema:U,schemaCode:z,data:L,$data:B,it:F}=H,{opts:Z}=F;if(!B&&U.length===0)return;let I=U.length>=Z.loopRequired;if(F.allErrors)A();else D();if(Z.strictRequired){let K=H.parentSchema.properties,{definedProperties:V}=H.it;for(let N of U)if((K===null||K===void 0?void 0:K[N])===void 0&&!V.has(N)){let O=F.schemaEnv.baseId+F.errSchemaPath,w=`required property "${N}" is not defined at "${O}" (strictRequired)`;(0,Y.checkStrictMode)(F,w,F.opts.strictRequired)}}function A(){if(I||B)H.block$data($.nil,q);else for(let K of U)(0,Q.checkReportMissingProp)(H,K)}function D(){let K=W.let("missing");if(I||B){let V=W.let("valid",!0);H.block$data(V,()=>M(K,V)),H.ok(V)}else W.if((0,Q.checkMissingProp)(H,U,K)),(0,Q.reportMissingProp)(H,K),W.else()}function q(){W.forOf("prop",z,(K)=>{H.setParams({missingProperty:K}),W.if((0,Q.noPropertyInData)(W,L,K,Z.ownProperties),()=>H.error())})}function M(K,V){H.setParams({missingProperty:K}),W.forOf(K,z,()=>{W.assign(V,(0,Q.propertyInData)(W,L,K,Z.ownProperties)),W.if((0,$.not)(V),()=>{H.error(),W.break()})},$.nil)}}};X.default=J}),DM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$={message({keyword:G,schemaCode:J}){let H=G==="maxItems"?"more":"fewer";return Q.str`must NOT have ${H} than ${J} items`},params:({schemaCode:G})=>Q._`{limit: ${G}}`},Y={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:$,code(G){let{keyword:J,data:H,schemaCode:W}=G,U=J==="maxItems"?Q.operators.GT:Q.operators.LT;G.fail$data(Q._`${H}.length ${U} ${W}`)}};X.default=Y}),M$=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=LY();Q.code='require("ajv/dist/runtime/equal").default',X.default=Q}),OM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=d6(),$=B0(),Y=D0(),G=M$(),J={message:({params:{i:W,j:U}})=>$.str`must NOT have duplicate items (items ## ${U} and ${W} are identical)`,params:({params:{i:W,j:U}})=>$._`{i: ${W}, j: ${U}}`},H={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:J,code(W){let{gen:U,data:z,$data:L,schema:B,parentSchema:F,schemaCode:Z,it:I}=W;if(!L&&!B)return;let A=U.let("valid"),D=F.items?(0,Q.getSchemaTypes)(F.items):[];W.block$data(A,q,$._`${Z} === false`),W.ok(A);function q(){let N=U.let("i",$._`${z}.length`),O=U.let("j");W.setParams({i:N,j:O}),U.assign(A,!0),U.if($._`${N} > 1`,()=>(M()?K:V)(N,O))}function M(){return D.length>0&&!D.some((N)=>N==="object"||N==="array")}function K(N,O){let w=U.name("item"),j=(0,Q.checkDataTypes)(D,w,I.opts.strictNumbers,Q.DataType.Wrong),E=U.const("indices",$._`{}`);U.for($._`;${N}--;`,()=>{if(U.let(w,$._`${z}[${N}]`),U.if(j,$._`continue`),D.length>1)U.if($._`typeof ${w} == "string"`,$._`${w} += "_"`);U.if($._`typeof ${E}[${w}] == "number"`,()=>{U.assign(O,$._`${E}[${w}]`),W.error(),U.assign(A,!1).break()}).code($._`${E}[${w}] = ${N}`)})}function V(N,O){let w=(0,Y.useFunc)(U,G.default),j=U.name("outer");U.label(j).for($._`;${N}--;`,()=>U.for($._`${O} = ${N}; ${O}--;`,()=>U.if($._`${w}(${z}[${N}], ${z}[${O}])`,()=>{W.error(),U.assign(A,!1).break(j)})))}}};X.default=H}),ZM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$=D0(),Y=M$(),G={message:"must be equal to constant",params:({schemaCode:H})=>Q._`{allowedValue: ${H}}`},J={keyword:"const",$data:!0,error:G,code(H){let{gen:W,data:U,$data:z,schemaCode:L,schema:B}=H;if(z||B&&typeof B=="object")H.fail$data(Q._`!${(0,$.useFunc)(W,Y.default)}(${U}, ${L})`);else H.fail(Q._`${B} !== ${U}`)}};X.default=J}),AM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$=D0(),Y=M$(),G={message:"must be equal to one of the allowed values",params:({schemaCode:H})=>Q._`{allowedValues: ${H}}`},J={keyword:"enum",schemaType:"array",$data:!0,error:G,code(H){let{gen:W,data:U,$data:z,schema:L,schemaCode:B,it:F}=H;if(!z&&L.length===0)throw Error("enum must have non-empty array");let Z=L.length>=F.opts.loopEnum,I,A=()=>I!==null&&I!==void 0?I:I=(0,$.useFunc)(W,Y.default),D;if(Z||z)D=W.let("valid"),H.block$data(D,q);else{if(!Array.isArray(L))throw Error("ajv implementation error");let K=W.const("vSchema",B);D=(0,Q.or)(...L.map((V,N)=>M(K,N)))}H.pass(D);function q(){W.assign(D,!1),W.forOf("v",B,(K)=>W.if(Q._`${A()}(${U}, ${K})`,()=>W.assign(D,!0).break()))}function M(K,V){let N=L[V];return typeof N==="object"&&N!==null?Q._`${A()}(${U}, ${K}[${V}])`:Q._`${U} === ${N}`}}};X.default=J}),NM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=BM(),$=LM(),Y=FM(),G=VM(),J=KM(),H=MM(),W=DM(),U=OM(),z=ZM(),L=AM(),B=[Q.default,$.default,Y.default,G.default,J.default,H.default,W.default,U.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},z.default,L.default];X.default=B}),qY=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateAdditionalItems=void 0;var Q=B0(),$=D0(),Y={message:({params:{len:H}})=>Q.str`must NOT have more than ${H} items`,params:({params:{len:H}})=>Q._`{limit: ${H}}`},G={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Y,code(H){let{parentSchema:W,it:U}=H,{items:z}=W;if(!Array.isArray(z)){(0,$.checkStrictMode)(U,'"additionalItems" is ignored when "items" is not an array of schemas');return}J(H,z)}};function J(H,W){let{gen:U,schema:z,data:L,keyword:B,it:F}=H;F.items=!0;let Z=U.const("len",Q._`${L}.length`);if(z===!1)H.setParams({len:W.length}),H.pass(Q._`${Z} <= ${W.length}`);else if(typeof z=="object"&&!(0,$.alwaysValidSchema)(F,z)){let A=U.var("valid",Q._`${Z} <= ${W.length}`);U.if((0,Q.not)(A),()=>I(A)),H.ok(A)}function I(A){U.forRange("i",W.length,Z,(D)=>{if(H.subschema({keyword:B,dataProp:D,dataPropType:$.Type.Num},A),!F.allErrors)U.if((0,Q.not)(A),()=>U.break())})}}X.validateAdditionalItems=J,X.default=G}),FY=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateTuple=void 0;var Q=B0(),$=D0(),Y=z1(),G={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(H){let{schema:W,it:U}=H;if(Array.isArray(W))return J(H,"additionalItems",W);if(U.items=!0,(0,$.alwaysValidSchema)(U,W))return;H.ok((0,Y.validateArray)(H))}};function J(H,W,U=H.schema){let{gen:z,parentSchema:L,data:B,keyword:F,it:Z}=H;if(D(L),Z.opts.unevaluated&&U.length&&Z.items!==!0)Z.items=$.mergeEvaluated.items(z,U.length,Z.items);let I=z.name("valid"),A=z.const("len",Q._`${B}.length`);U.forEach((q,M)=>{if((0,$.alwaysValidSchema)(Z,q))return;z.if(Q._`${A} > ${M}`,()=>H.subschema({keyword:F,schemaProp:M,dataProp:M},I)),H.ok(I)});function D(q){let{opts:M,errSchemaPath:K}=Z,V=U.length,N=V===q.minItems&&(V===q.maxItems||q[W]===!1);if(M.strictTuples&&!N){let O=`"${F}" is ${V}-tuple, but minItems or maxItems/${W} are not specified or different at path "${K}"`;(0,$.checkStrictMode)(Z,O,M.strictTuples)}}}X.validateTuple=J,X.default=G}),RM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=FY(),$={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Y)=>(0,Q.validateTuple)(Y,"items")};X.default=$}),wM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$=D0(),Y=z1(),G=qY(),J={message:({params:{len:W}})=>Q.str`must NOT have more than ${W} items`,params:({params:{len:W}})=>Q._`{limit: ${W}}`},H={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:J,code(W){let{schema:U,parentSchema:z,it:L}=W,{prefixItems:B}=z;if(L.items=!0,(0,$.alwaysValidSchema)(L,U))return;if(B)(0,G.validateAdditionalItems)(W,B);else W.ok((0,Y.validateArray)(W))}};X.default=H}),IM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$=D0(),Y={message:({params:{min:J,max:H}})=>H===void 0?Q.str`must contain at least ${J} valid item(s)`:Q.str`must contain at least ${J} and no more than ${H} valid item(s)`,params:({params:{min:J,max:H}})=>H===void 0?Q._`{minContains: ${J}}`:Q._`{minContains: ${J}, maxContains: ${H}}`},G={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Y,code(J){let{gen:H,schema:W,parentSchema:U,data:z,it:L}=J,B,F,{minContains:Z,maxContains:I}=U;if(L.opts.next)B=Z===void 0?1:Z,F=I;else B=1;let A=H.const("len",Q._`${z}.length`);if(J.setParams({min:B,max:F}),F===void 0&&B===0){(0,$.checkStrictMode)(L,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(F!==void 0&&B>F){(0,$.checkStrictMode)(L,'"minContains" > "maxContains" is always invalid'),J.fail();return}if((0,$.alwaysValidSchema)(L,W)){let V=Q._`${A} >= ${B}`;if(F!==void 0)V=Q._`${V} && ${A} <= ${F}`;J.pass(V);return}L.items=!0;let D=H.name("valid");if(F===void 0&&B===1)M(D,()=>H.if(D,()=>H.break()));else if(B===0){if(H.let(D,!0),F!==void 0)H.if(Q._`${z}.length > 0`,q)}else H.let(D,!1),q();J.result(D,()=>J.reset());function q(){let V=H.name("_valid"),N=H.let("count",0);M(V,()=>H.if(V,()=>K(N)))}function M(V,N){H.forRange("i",0,A,(O)=>{J.subschema({keyword:"contains",dataProp:O,dataPropType:$.Type.Num,compositeRule:!0},V),N()})}function K(V){if(H.code(Q._`${V}++`),F===void 0)H.if(Q._`${V} >= ${B}`,()=>H.assign(D,!0).break());else if(H.if(Q._`${V} > ${F}`,()=>H.assign(D,!1).break()),B===1)H.assign(D,!0);else H.if(Q._`${V} >= ${B}`,()=>H.assign(D,!0))}}};X.default=G}),jM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.validateSchemaDeps=X.validatePropertyDeps=X.error=void 0;var Q=B0(),$=D0(),Y=z1();X.error={message:({params:{property:U,depsCount:z,deps:L}})=>{let B=z===1?"property":"properties";return Q.str`must have ${B} ${L} when property ${U} is present`},params:({params:{property:U,depsCount:z,deps:L,missingProperty:B}})=>Q._`{property: ${U},
|
|
191
|
-
missingProperty: ${B},
|
|
192
|
-
depsCount: ${z},
|
|
193
|
-
deps: ${L}}`};var G={keyword:"dependencies",type:"object",schemaType:"object",error:X.error,code(U){let[z,L]=J(U);H(U,z),W(U,L)}};function J({schema:U}){let z={},L={};for(let B in U){if(B==="__proto__")continue;let F=Array.isArray(U[B])?z:L;F[B]=U[B]}return[z,L]}function H(U,z=U.schema){let{gen:L,data:B,it:F}=U;if(Object.keys(z).length===0)return;let Z=L.let("missing");for(let I in z){let A=z[I];if(A.length===0)continue;let D=(0,Y.propertyInData)(L,B,I,F.opts.ownProperties);if(U.setParams({property:I,depsCount:A.length,deps:A.join(", ")}),F.allErrors)L.if(D,()=>{for(let q of A)(0,Y.checkReportMissingProp)(U,q)});else L.if(Q._`${D} && (${(0,Y.checkMissingProp)(U,A,Z)})`),(0,Y.reportMissingProp)(U,Z),L.else()}}X.validatePropertyDeps=H;function W(U,z=U.schema){let{gen:L,data:B,keyword:F,it:Z}=U,I=L.name("valid");for(let A in z){if((0,$.alwaysValidSchema)(Z,z[A]))continue;L.if((0,Y.propertyInData)(L,B,A,Z.opts.ownProperties),()=>{let D=U.subschema({keyword:F,schemaProp:A},I);U.mergeValidEvaluated(D,I)},()=>L.var(I,!0)),U.ok(I)}}X.validateSchemaDeps=W,X.default=G}),PM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$=D0(),Y={message:"property name must be valid",params:({params:J})=>Q._`{propertyName: ${J.propertyName}}`},G={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Y,code(J){let{gen:H,schema:W,data:U,it:z}=J;if((0,$.alwaysValidSchema)(z,W))return;let L=H.name("valid");H.forIn("key",U,(B)=>{J.setParams({propertyName:B}),J.subschema({keyword:"propertyNames",data:B,dataTypes:["string"],propertyName:B,compositeRule:!0},L),H.if((0,Q.not)(L),()=>{if(J.error(!0),!z.allErrors)H.break()})}),J.ok(L)}};X.default=G}),VY=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z1(),$=B0(),Y=p1(),G=D0(),J={message:"must NOT have additional properties",params:({params:W})=>$._`{additionalProperty: ${W.additionalProperty}}`},H={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:J,code(W){let{gen:U,schema:z,parentSchema:L,data:B,errsCount:F,it:Z}=W;if(!F)throw Error("ajv implementation error");let{allErrors:I,opts:A}=Z;if(Z.props=!0,A.removeAdditional!=="all"&&(0,G.alwaysValidSchema)(Z,z))return;let D=(0,Q.allSchemaProperties)(L.properties),q=(0,Q.allSchemaProperties)(L.patternProperties);M(),W.ok($._`${F} === ${Y.default.errors}`);function M(){U.forIn("key",B,(w)=>{if(!D.length&&!q.length)N(w);else U.if(K(w),()=>N(w))})}function K(w){let j;if(D.length>8){let E=(0,G.schemaRefOrVal)(Z,L.properties,"properties");j=(0,Q.isOwnProperty)(U,E,w)}else if(D.length)j=(0,$.or)(...D.map((E)=>$._`${w} === ${E}`));else j=$.nil;if(q.length)j=(0,$.or)(j,...q.map((E)=>$._`${(0,Q.usePattern)(W,E)}.test(${w})`));return(0,$.not)(j)}function V(w){U.code($._`delete ${B}[${w}]`)}function N(w){if(A.removeAdditional==="all"||A.removeAdditional&&z===!1){V(w);return}if(z===!1){if(W.setParams({additionalProperty:w}),W.error(),!I)U.break();return}if(typeof z=="object"&&!(0,G.alwaysValidSchema)(Z,z)){let j=U.name("valid");if(A.removeAdditional==="failing")O(w,j,!1),U.if((0,$.not)(j),()=>{W.reset(),V(w)});else if(O(w,j),!I)U.if((0,$.not)(j),()=>U.break())}}function O(w,j,E){let g={keyword:"additionalProperties",dataProp:w,dataPropType:G.Type.Str};if(E===!1)Object.assign(g,{compositeRule:!0,createErrors:!1,allErrors:!1});W.subschema(g,j)}}};X.default=H}),TM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=JX(),$=z1(),Y=D0(),G=VY(),J={keyword:"properties",type:"object",schemaType:"object",code(H){let{gen:W,schema:U,parentSchema:z,data:L,it:B}=H;if(B.opts.removeAdditional==="all"&&z.additionalProperties===void 0)G.default.code(new Q.KeywordCxt(B,G.default,"additionalProperties"));let F=(0,$.allSchemaProperties)(U);for(let q of F)B.definedProperties.add(q);if(B.opts.unevaluated&&F.length&&B.props!==!0)B.props=Y.mergeEvaluated.props(W,(0,Y.toHash)(F),B.props);let Z=F.filter((q)=>!(0,Y.alwaysValidSchema)(B,U[q]));if(Z.length===0)return;let I=W.name("valid");for(let q of Z){if(A(q))D(q);else{if(W.if((0,$.propertyInData)(W,L,q,B.opts.ownProperties)),D(q),!B.allErrors)W.else().var(I,!0);W.endIf()}H.it.definedProperties.add(q),H.ok(I)}function A(q){return B.opts.useDefaults&&!B.compositeRule&&U[q].default!==void 0}function D(q){H.subschema({keyword:"properties",schemaProp:q,dataProp:q},I)}}};X.default=J}),SM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z1(),$=B0(),Y=D0(),G=D0(),J={keyword:"patternProperties",type:"object",schemaType:"object",code(H){let{gen:W,schema:U,data:z,parentSchema:L,it:B}=H,{opts:F}=B,Z=(0,Q.allSchemaProperties)(U),I=Z.filter((N)=>(0,Y.alwaysValidSchema)(B,U[N]));if(Z.length===0||I.length===Z.length&&(!B.opts.unevaluated||B.props===!0))return;let A=F.strictSchema&&!F.allowMatchingProperties&&L.properties,D=W.name("valid");if(B.props!==!0&&!(B.props instanceof $.Name))B.props=(0,G.evaluatedPropsToName)(W,B.props);let{props:q}=B;M();function M(){for(let N of Z){if(A)K(N);if(B.allErrors)V(N);else W.var(D,!0),V(N),W.if(D)}}function K(N){for(let O in A)if(new RegExp(N).test(O))(0,Y.checkStrictMode)(B,`property ${O} matches pattern ${N} (use allowMatchingProperties)`)}function V(N){W.forIn("key",z,(O)=>{W.if($._`${(0,Q.usePattern)(H,N)}.test(${O})`,()=>{let w=I.includes(N);if(!w)H.subschema({keyword:"patternProperties",schemaProp:N,dataProp:O,dataPropType:G.Type.Str},D);if(B.opts.unevaluated&&q!==!0)W.assign($._`${q}[${O}]`,!0);else if(!w&&!B.allErrors)W.if((0,$.not)(D),()=>W.break())})})}}};X.default=J}),EM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=D0(),$={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Y){let{gen:G,schema:J,it:H}=Y;if((0,Q.alwaysValidSchema)(H,J)){Y.fail();return}let W=G.name("valid");Y.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},W),Y.failResult(W,()=>Y.reset(),()=>Y.error())},error:{message:"must NOT be valid"}};X.default=$}),bM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=z1(),$={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Q.validateUnion,error:{message:"must match a schema in anyOf"}};X.default=$}),CM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$=D0(),Y={message:"must match exactly one schema in oneOf",params:({params:J})=>Q._`{passingSchemas: ${J.passing}}`},G={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Y,code(J){let{gen:H,schema:W,parentSchema:U,it:z}=J;if(!Array.isArray(W))throw Error("ajv implementation error");if(z.opts.discriminator&&U.discriminator)return;let L=W,B=H.let("valid",!1),F=H.let("passing",null),Z=H.name("_valid");J.setParams({passing:F}),H.block(I),J.result(B,()=>J.reset(),()=>J.error(!0));function I(){L.forEach((A,D)=>{let q;if((0,$.alwaysValidSchema)(z,A))H.var(Z,!0);else q=J.subschema({keyword:"oneOf",schemaProp:D,compositeRule:!0},Z);if(D>0)H.if(Q._`${Z} && ${B}`).assign(B,!1).assign(F,Q._`[${F}, ${D}]`).else();H.if(Z,()=>{if(H.assign(B,!0),H.assign(F,D),q)J.mergeEvaluated(q,Q.Name)})})}}};X.default=G}),_M=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=D0(),$={keyword:"allOf",schemaType:"array",code(Y){let{gen:G,schema:J,it:H}=Y;if(!Array.isArray(J))throw Error("ajv implementation error");let W=G.name("valid");J.forEach((U,z)=>{if((0,Q.alwaysValidSchema)(H,U))return;let L=Y.subschema({keyword:"allOf",schemaProp:z},W);Y.ok(W),Y.mergeEvaluated(L)})}};X.default=$}),kM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$=D0(),Y={message:({params:H})=>Q.str`must match "${H.ifClause}" schema`,params:({params:H})=>Q._`{failingKeyword: ${H.ifClause}}`},G={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Y,code(H){let{gen:W,parentSchema:U,it:z}=H;if(U.then===void 0&&U.else===void 0)(0,$.checkStrictMode)(z,'"if" without "then" and "else" is ignored');let L=J(z,"then"),B=J(z,"else");if(!L&&!B)return;let F=W.let("valid",!0),Z=W.name("_valid");if(I(),H.reset(),L&&B){let D=W.let("ifClause");H.setParams({ifClause:D}),W.if(Z,A("then",D),A("else",D))}else if(L)W.if(Z,A("then"));else W.if((0,Q.not)(Z),A("else"));H.pass(F,()=>H.error(!0));function I(){let D=H.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Z);H.mergeEvaluated(D)}function A(D,q){return()=>{let M=H.subschema({keyword:D},Z);if(W.assign(F,Z),H.mergeValidEvaluated(M,F),q)W.assign(q,Q._`${D}`);else H.setParams({ifClause:D})}}}};function J(H,W){let U=H.schema[W];return U!==void 0&&!(0,$.alwaysValidSchema)(H,U)}X.default=G}),vM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=D0(),$={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Y,parentSchema:G,it:J}){if(G.if===void 0)(0,Q.checkStrictMode)(J,`"${Y}" without "if" is ignored`)}};X.default=$}),yM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=qY(),$=RM(),Y=FY(),G=wM(),J=IM(),H=jM(),W=PM(),U=VY(),z=TM(),L=SM(),B=EM(),F=bM(),Z=CM(),I=_M(),A=kM(),D=vM();function q(M=!1){let K=[B.default,F.default,Z.default,I.default,A.default,D.default,W.default,U.default,H.default,z.default,L.default];if(M)K.push($.default,G.default);else K.push(Q.default,Y.default);return K.push(J.default),K}X.default=q}),xM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$={message:({schemaCode:G})=>Q.str`must match format "${G}"`,params:({schemaCode:G})=>Q._`{format: ${G}}`},Y={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:$,code(G,J){let{gen:H,data:W,$data:U,schema:z,schemaCode:L,it:B}=G,{opts:F,errSchemaPath:Z,schemaEnv:I,self:A}=B;if(!F.validateFormats)return;if(U)D();else q();function D(){let M=H.scopeValue("formats",{ref:A.formats,code:F.code.formats}),K=H.const("fDef",Q._`${M}[${L}]`),V=H.let("fType"),N=H.let("format");H.if(Q._`typeof ${K} == "object" && !(${K} instanceof RegExp)`,()=>H.assign(V,Q._`${K}.type || "string"`).assign(N,Q._`${K}.validate`),()=>H.assign(V,Q._`"string"`).assign(N,K)),G.fail$data((0,Q.or)(O(),w()));function O(){if(F.strictSchema===!1)return Q.nil;return Q._`${L} && !${N}`}function w(){let j=I.$async?Q._`(${K}.async ? await ${N}(${W}) : ${N}(${W}))`:Q._`${N}(${W})`,E=Q._`(typeof ${N} == "function" ? ${j} : ${N}.test(${W}))`;return Q._`${N} && ${N} !== true && ${V} === ${J} && !${E}`}}function q(){let M=A.formats[z];if(!M){O();return}if(M===!0)return;let[K,V,N]=w(M);if(K===J)G.pass(j());function O(){if(F.strictSchema===!1){A.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${z}" ignored in schema at path "${Z}"`}}function w(E){let g=E instanceof RegExp?(0,Q.regexpCode)(E):F.code.formats?Q._`${F.code.formats}${(0,Q.getProperty)(z)}`:void 0,k=H.scopeValue("formats",{key:z,ref:E,code:g});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,Q._`${k}.validate`];return["string",E,k]}function j(){if(typeof M=="object"&&!(M instanceof RegExp)&&M.async){if(!I.$async)throw Error("async format in sync schema");return Q._`await ${N}(${W})`}return typeof V=="function"?Q._`${N}(${W})`:Q._`${N}.test(${W})`}}}};X.default=Y}),gM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=xM(),$=[Q.default];X.default=$}),hM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.contentVocabulary=X.metadataVocabulary=void 0,X.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],X.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),fM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=zM(),$=NM(),Y=yM(),G=gM(),J=hM(),H=[Q.default,$.default,(0,Y.default)(),G.default,J.metadataVocabulary,J.contentVocabulary];X.default=H}),uM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.DiscrError=void 0;var Q;(function($){$.Tag="tag",$.Mapping="mapping"})(Q||(X.DiscrError=Q={}))}),mM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0});var Q=B0(),$=uM(),Y=K$(),G=HX(),J=D0(),H={message:({params:{discrError:U,tagName:z}})=>U===$.DiscrError.Tag?`tag "${z}" must be string`:`value of tag "${z}" must be in oneOf`,params:({params:{discrError:U,tag:z,tagName:L}})=>Q._`{error: ${U}, tag: ${L}, tagValue: ${z}}`},W={keyword:"discriminator",type:"object",schemaType:"object",error:H,code(U){let{gen:z,data:L,schema:B,parentSchema:F,it:Z}=U,{oneOf:I}=F;if(!Z.opts.discriminator)throw Error("discriminator: requires discriminator option");let A=B.propertyName;if(typeof A!="string")throw Error("discriminator: requires propertyName");if(B.mapping)throw Error("discriminator: mapping is not supported");if(!I)throw Error("discriminator: requires oneOf keyword");let D=z.let("valid",!1),q=z.const("tag",Q._`${L}${(0,Q.getProperty)(A)}`);z.if(Q._`typeof ${q} == "string"`,()=>M(),()=>U.error(!1,{discrError:$.DiscrError.Tag,tag:q,tagName:A})),U.ok(D);function M(){let N=V();z.if(!1);for(let O in N)z.elseIf(Q._`${q} === ${O}`),z.assign(D,K(N[O]));z.else(),U.error(!1,{discrError:$.DiscrError.Mapping,tag:q,tagName:A}),z.endIf()}function K(N){let O=z.name("valid"),w=U.subschema({keyword:"oneOf",schemaProp:N},O);return U.mergeEvaluated(w,Q.Name),O}function V(){var N;let O={},w=E(F),j=!0;for(let x=0;x<I.length;x++){let u=I[x];if((u===null||u===void 0?void 0:u.$ref)&&!(0,J.schemaHasRulesButRef)(u,Z.self.RULES)){let G0=u.$ref;if(u=Y.resolveRef.call(Z.self,Z.schemaEnv.root,Z.baseId,G0),u instanceof Y.SchemaEnv)u=u.schema;if(u===void 0)throw new G.default(Z.opts.uriResolver,Z.baseId,G0)}let l=(N=u===null||u===void 0?void 0:u.properties)===null||N===void 0?void 0:N[A];if(typeof l!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${A}"`);j=j&&(w||E(u)),g(l,x)}if(!j)throw Error(`discriminator: "${A}" must be required`);return O;function E({required:x}){return Array.isArray(x)&&x.includes(A)}function g(x,u){if(x.const)k(x.const,u);else if(x.enum)for(let l of x.enum)k(l,u);else throw Error(`discriminator: "properties/${A}" must have "const" or "enum"`)}function k(x,u){if(typeof x!="string"||x in O)throw Error(`discriminator: "${A}" values must be unique strings`);O[x]=u}}}};X.default=W}),lM=i((X,Q)=>{Q.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),KY=i((X,Q)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.MissingRefError=X.ValidationError=X.CodeGen=X.Name=X.nil=X.stringify=X.str=X._=X.KeywordCxt=X.Ajv=void 0;var $=HM(),Y=fM(),G=mM(),J=lM(),H=["/properties"],W="http://json-schema.org/draft-07/schema";class U extends $.default{_addVocabularies(){if(super._addVocabularies(),Y.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(G.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let Z=this.opts.$data?this.$dataMetaSchema(J,H):J;this.addMetaSchema(Z,W,!1),this.refs["http://json-schema.org/schema"]=W}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(W)?W:void 0)}}X.Ajv=U,Q.exports=X=U,Q.exports.Ajv=U,Object.defineProperty(X,"__esModule",{value:!0}),X.default=U;var z=JX();Object.defineProperty(X,"KeywordCxt",{enumerable:!0,get:function(){return z.KeywordCxt}});var L=B0();Object.defineProperty(X,"_",{enumerable:!0,get:function(){return L._}}),Object.defineProperty(X,"str",{enumerable:!0,get:function(){return L.str}}),Object.defineProperty(X,"stringify",{enumerable:!0,get:function(){return L.stringify}}),Object.defineProperty(X,"nil",{enumerable:!0,get:function(){return L.nil}}),Object.defineProperty(X,"Name",{enumerable:!0,get:function(){return L.Name}}),Object.defineProperty(X,"CodeGen",{enumerable:!0,get:function(){return L.CodeGen}});var B=V$();Object.defineProperty(X,"ValidationError",{enumerable:!0,get:function(){return B.default}});var F=HX();Object.defineProperty(X,"MissingRefError",{enumerable:!0,get:function(){return F.default}})}),cM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.formatNames=X.fastFormats=X.fullFormats=void 0;function Q(k,x){return{validate:k,compare:x}}X.fullFormats={date:Q(J,H),time:Q(U(!0),z),"date-time":Q(F(!0),Z),"iso-time":Q(U(),L),"iso-date-time":Q(F(),I),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:q,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:g,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:K,int32:{type:"number",validate:O},int64:{type:"number",validate:w},float:{type:"number",validate:j},double:{type:"number",validate:j},password:!0,binary:!0},X.fastFormats={...X.fullFormats,date:Q(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,H),time:Q(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,z),"date-time":Q(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Z),"iso-time":Q(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,L),"iso-date-time":Q(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,I),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},X.formatNames=Object.keys(X.fullFormats);function $(k){return k%4===0&&(k%100!==0||k%400===0)}var Y=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,G=[0,31,28,31,30,31,30,31,31,30,31,30,31];function J(k){let x=Y.exec(k);if(!x)return!1;let u=+x[1],l=+x[2],G0=+x[3];return l>=1&&l<=12&&G0>=1&&G0<=(l===2&&$(u)?29:G[l])}function H(k,x){if(!(k&&x))return;if(k>x)return 1;if(k<x)return-1;return 0}var W=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function U(k){return function(u){let l=W.exec(u);if(!l)return!1;let G0=+l[1],Z0=+l[2],_0=+l[3],h0=l[4],F0=l[5]==="-"?-1:1,S=+(l[6]||0),b=+(l[7]||0);if(S>23||b>59||k&&!h0)return!1;if(G0<=23&&Z0<=59&&_0<60)return!0;let f=Z0-b*F0,R=G0-S*F0-(f<0?1:0);return(R===23||R===-1)&&(f===59||f===-1)&&_0<61}}function z(k,x){if(!(k&&x))return;let u=new Date("2020-01-01T"+k).valueOf(),l=new Date("2020-01-01T"+x).valueOf();if(!(u&&l))return;return u-l}function L(k,x){if(!(k&&x))return;let u=W.exec(k),l=W.exec(x);if(!(u&&l))return;if(k=u[1]+u[2]+u[3],x=l[1]+l[2]+l[3],k>x)return 1;if(k<x)return-1;return 0}var B=/t|\s/i;function F(k){let x=U(k);return function(l){let G0=l.split(B);return G0.length===2&&J(G0[0])&&x(G0[1])}}function Z(k,x){if(!(k&&x))return;let u=new Date(k).valueOf(),l=new Date(x).valueOf();if(!(u&&l))return;return u-l}function I(k,x){if(!(k&&x))return;let[u,l]=k.split(B),[G0,Z0]=x.split(B),_0=H(u,G0);if(_0===void 0)return;return _0||z(l,Z0)}var A=/\/|:/,D=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function q(k){return A.test(k)&&D.test(k)}var M=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function K(k){return M.lastIndex=0,M.test(k)}var V=-2147483648,N=2147483647;function O(k){return Number.isInteger(k)&&k<=N&&k>=V}function w(k){return Number.isInteger(k)}function j(){return!0}var E=/[^\\]\\Z/;function g(k){if(E.test(k))return!1;try{return new RegExp(k),!0}catch(x){return!1}}}),pM=i((X)=>{Object.defineProperty(X,"__esModule",{value:!0}),X.formatLimitDefinition=void 0;var Q=KY(),$=B0(),Y=$.operators,G={formatMaximum:{okStr:"<=",ok:Y.LTE,fail:Y.GT},formatMinimum:{okStr:">=",ok:Y.GTE,fail:Y.LT},formatExclusiveMaximum:{okStr:"<",ok:Y.LT,fail:Y.GTE},formatExclusiveMinimum:{okStr:">",ok:Y.GT,fail:Y.LTE}},J={message:({keyword:W,schemaCode:U})=>$.str`should be ${G[W].okStr} ${U}`,params:({keyword:W,schemaCode:U})=>$._`{comparison: ${G[W].okStr}, limit: ${U}}`};X.formatLimitDefinition={keyword:Object.keys(G),type:"string",schemaType:"string",$data:!0,error:J,code(W){let{gen:U,data:z,schemaCode:L,keyword:B,it:F}=W,{opts:Z,self:I}=F;if(!Z.validateFormats)return;let A=new Q.KeywordCxt(F,I.RULES.all.format.definition,"format");if(A.$data)D();else q();function D(){let K=U.scopeValue("formats",{ref:I.formats,code:Z.code.formats}),V=U.const("fmt",$._`${K}[${A.schemaCode}]`);W.fail$data((0,$.or)($._`typeof ${V} != "object"`,$._`${V} instanceof RegExp`,$._`typeof ${V}.compare != "function"`,M(V)))}function q(){let K=A.schema,V=I.formats[K];if(!V||V===!0)return;if(typeof V!="object"||V instanceof RegExp||typeof V.compare!="function")throw Error(`"${B}": format "${K}" does not define "compare" function`);let N=U.scopeValue("formats",{key:K,ref:V,code:Z.code.formats?$._`${Z.code.formats}${(0,$.getProperty)(K)}`:void 0});W.fail$data(M(N))}function M(K){return $._`${K}.compare(${z}, ${L}) ${G[B].fail} 0`}},dependencies:["format"]};var H=(W)=>{return W.addKeyword(X.formatLimitDefinition),W};X.default=H}),dM=i((X,Q)=>{Object.defineProperty(X,"__esModule",{value:!0});var $=cM(),Y=pM(),G=B0(),J=new G.Name("fullFormats"),H=new G.Name("fastFormats"),W=(z,L={keywords:!0})=>{if(Array.isArray(L))return U(z,L,$.fullFormats,J),z;let[B,F]=L.mode==="fast"?[$.fastFormats,H]:[$.fullFormats,J],Z=L.formats||$.formatNames;if(U(z,Z,B,F),L.keywords)(0,Y.default)(z);return z};W.get=(z,L="full")=>{let F=(L==="fast"?$.fastFormats:$.fullFormats)[z];if(!F)throw Error(`Unknown format "${z}"`);return F};function U(z,L,B,F){var Z,I;(Z=(I=z.opts.code).formats)!==null&&Z!==void 0||(I.formats=G._`require("ajv-formats/dist/formats").${F}`);for(let A of L)z.addFormat(A,B[A])}Q.exports=X=W,Object.defineProperty(X,"__esModule",{value:!0}),X.default=W}),rM=50;function MY(X=rM){let Q=new AbortController;return nM(X,Q.signal),Q}var tM=typeof global=="object"&&global&&global.Object===Object&&global,eM=tM,XD=typeof self=="object"&&self&&self.Object===Object&&self,QD=eM||XD||Function("return this")(),D$=QD,$D=D$.Symbol,i6=$D,DY=Object.prototype,YD=DY.hasOwnProperty,GD=DY.toString,L8=i6?i6.toStringTag:void 0;function JD(X){var Q=YD.call(X,L8),$=X[L8];try{X[L8]=void 0;var Y=!0}catch(J){}var G=GD.call(X);if(Y)if(Q)X[L8]=$;else delete X[L8];return G}var HD=JD,WD=Object.prototype,UD=WD.toString;function zD(X){return UD.call(X)}var BD=zD,LD="[object Null]",qD="[object Undefined]",E7=i6?i6.toStringTag:void 0;function FD(X){if(X==null)return X===void 0?qD:LD;return E7&&E7 in Object(X)?HD(X):BD(X)}var VD=FD;function KD(X){var Q=typeof X;return X!=null&&(Q=="object"||Q=="function")}var OY=KD,MD="[object AsyncFunction]",DD="[object Function]",OD="[object GeneratorFunction]",ZD="[object Proxy]";function AD(X){if(!OY(X))return!1;var Q=VD(X);return Q==DD||Q==OD||Q==MD||Q==ZD}var ND=AD,RD=D$["__core-js_shared__"],eQ=RD,b7=function(){var X=/[^.]+$/.exec(eQ&&eQ.keys&&eQ.keys.IE_PROTO||"");return X?"Symbol(src)_1."+X:""}();function wD(X){return!!b7&&b7 in X}var ID=wD,jD=Function.prototype,PD=jD.toString;function TD(X){if(X!=null){try{return PD.call(X)}catch(Q){}try{return X+""}catch(Q){}}return""}var SD=TD,ED=/[\\^$.*+?()[\]{}|]/g,bD=/^\[object .+?Constructor\]$/,CD=Function.prototype,_D=Object.prototype,kD=CD.toString,vD=_D.hasOwnProperty,yD=RegExp("^"+kD.call(vD).replace(ED,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xD(X){if(!OY(X)||ID(X))return!1;var Q=ND(X)?yD:bD;return Q.test(SD(X))}var gD=xD;function hD(X,Q){return X==null?void 0:X[Q]}var fD=hD;function uD(X,Q){var $=fD(X,Q);return gD($)?$:void 0}var ZY=uD,mD=ZY(Object,"create"),K8=mD;function lD(){this.__data__=K8?K8(null):{},this.size=0}var cD=lD;function pD(X){var Q=this.has(X)&&delete this.__data__[X];return this.size-=Q?1:0,Q}var dD=pD,iD="__lodash_hash_undefined__",nD=Object.prototype,rD=nD.hasOwnProperty;function oD(X){var Q=this.__data__;if(K8){var $=Q[X];return $===iD?void 0:$}return rD.call(Q,X)?Q[X]:void 0}var aD=oD,sD=Object.prototype,tD=sD.hasOwnProperty;function eD(X){var Q=this.__data__;return K8?Q[X]!==void 0:tD.call(Q,X)}var XO=eD,QO="__lodash_hash_undefined__";function $O(X,Q){var $=this.__data__;return this.size+=this.has(X)?0:1,$[X]=K8&&Q===void 0?QO:Q,this}var YO=$O;function b9(X){var Q=-1,$=X==null?0:X.length;this.clear();while(++Q<$){var Y=X[Q];this.set(Y[0],Y[1])}}b9.prototype.clear=cD;b9.prototype.delete=dD;b9.prototype.get=aD;b9.prototype.has=XO;b9.prototype.set=YO;var C7=b9;function GO(){this.__data__=[],this.size=0}var JO=GO;function HO(X,Q){return X===Q||X!==X&&Q!==Q}var WO=HO;function UO(X,Q){var $=X.length;while($--)if(WO(X[$][0],Q))return $;return-1}var WX=UO,zO=Array.prototype,BO=zO.splice;function LO(X){var Q=this.__data__,$=WX(Q,X);if($<0)return!1;var Y=Q.length-1;if($==Y)Q.pop();else BO.call(Q,$,1);return--this.size,!0}var qO=LO;function FO(X){var Q=this.__data__,$=WX(Q,X);return $<0?void 0:Q[$][1]}var VO=FO;function KO(X){return WX(this.__data__,X)>-1}var MO=KO;function DO(X,Q){var $=this.__data__,Y=WX($,X);if(Y<0)++this.size,$.push([X,Q]);else $[Y][1]=Q;return this}var OO=DO;function C9(X){var Q=-1,$=X==null?0:X.length;this.clear();while(++Q<$){var Y=X[Q];this.set(Y[0],Y[1])}}C9.prototype.clear=JO;C9.prototype.delete=qO;C9.prototype.get=VO;C9.prototype.has=MO;C9.prototype.set=OO;var ZO=C9,AO=ZY(D$,"Map"),NO=AO;function RO(){this.size=0,this.__data__={hash:new C7,map:new(NO||ZO),string:new C7}}var wO=RO;function IO(X){var Q=typeof X;return Q=="string"||Q=="number"||Q=="symbol"||Q=="boolean"?X!=="__proto__":X===null}var jO=IO;function PO(X,Q){var $=X.__data__;return jO(Q)?$[typeof Q=="string"?"string":"hash"]:$.map}var UX=PO;function TO(X){var Q=UX(this,X).delete(X);return this.size-=Q?1:0,Q}var SO=TO;function EO(X){return UX(this,X).get(X)}var bO=EO;function CO(X){return UX(this,X).has(X)}var _O=CO;function kO(X,Q){var $=UX(this,X),Y=$.size;return $.set(X,Q),this.size+=$.size==Y?0:1,this}var vO=kO;function _9(X){var Q=-1,$=X==null?0:X.length;this.clear();while(++Q<$){var Y=X[Q];this.set(Y[0],Y[1])}}_9.prototype.clear=wO;_9.prototype.delete=SO;_9.prototype.get=bO;_9.prototype.has=_O;_9.prototype.set=vO;var AY=_9,yO="Expected a function";function O$(X,Q){if(typeof X!="function"||Q!=null&&typeof Q!="function")throw TypeError(yO);var $=function(){var Y=arguments,G=Q?Q.apply(this,Y):Y[0],J=$.cache;if(J.has(G))return J.get(G);var H=X.apply(this,Y);return $.cache=J.set(G,H)||J,H};return $.cache=new(O$.Cache||AY),$}O$.Cache=AY;var b8=O$,_7=2000;function xO(X){if(process.stderr.destroyed)return;for(let Q=0;Q<X.length;Q+=_7)process.stderr.write(X.substring(Q,Q+_7))}var gO=b8((X)=>{if(!X||X.trim()==="")return null;let Q=X.split(",").map((J)=>J.trim()).filter(Boolean);if(Q.length===0)return null;let $=Q.some((J)=>J.startsWith("!")),Y=Q.some((J)=>!J.startsWith("!"));if($&&Y)return null;let G=Q.map((J)=>J.replace(/^!/,"").toLowerCase());return{include:$?[]:G,exclude:$?G:[],isExclusive:$}});function hO(X){let Q=[],$=X.match(/^MCP server ["']([^"']+)["']/);if($&&$[1])Q.push("mcp"),Q.push($[1].toLowerCase());else{let J=X.match(/^([^:[]+):/);if(J&&J[1])Q.push(J[1].trim().toLowerCase())}let Y=X.match(/^\[([^\]]+)]/);if(Y&&Y[1])Q.push(Y[1].trim().toLowerCase());if(X.toLowerCase().includes("statsig event:"))Q.push("statsig");let G=X.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(G&&G[1]){let J=G[1].trim().toLowerCase();if(J.length<30&&!J.includes(" "))Q.push(J)}return Array.from(new Set(Q))}function fO(X,Q){if(!Q)return!0;if(X.length===0)return!1;if(Q.isExclusive)return!X.some(($)=>Q.exclude.includes($));else return X.some(($)=>Q.include.includes($))}function uO(X,Q){if(!Q)return!0;let $=hO(X);return fO($,Q)}function NY(){return process.env.CLAUDE_CONFIG_DIR??mO(lO(),".claude")}function k7(X){if(!X)return!1;if(typeof X==="boolean")return X;let Q=X.toLowerCase().trim();return["1","true","yes","on"].includes(Q)}var X$=150000,h6=30000;function wY(X){return{name:X,default:h6,validate:(Q)=>{if(!Q)return{effective:h6,status:"valid"};let $=parseInt(Q,10);if(isNaN($)||$<=0)return{effective:h6,status:"invalid",message:`Invalid value "${Q}" (using default: ${h6})`};if($>X$)return{effective:X$,status:"capped",message:`Capped from ${$} to ${X$}`};return{effective:$,status:"valid"}}}}var iO=wY("BASH_MAX_OUTPUT_LENGTH"),u2=wY("TASK_MAX_OUTPUT_LENGTH"),nO={name:"CLAUDE_CODE_MAX_OUTPUT_TOKENS",default:32000,validate:(X)=>{if(!X)return{effective:32000,status:"valid"};let Y=parseInt(X,10);if(isNaN(Y)||Y<=0)return{effective:32000,status:"invalid",message:`Invalid value "${X}" (using default: 32000)`};if(Y>64000)return{effective:64000,status:"capped",message:`Capped from ${Y} to 64000`};return{effective:Y,status:"valid"}}};function rO(){let X="";if(typeof process<"u"&&typeof process.cwd==="function")X=pO(cO());return{originalCwd:X,totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:X,modelUsage:{},mainLoopModelOverride:void 0,initialMainLoopModel:null,modelStrings:null,isInteractive:!1,clientType:"cli",sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,sessionId:dO(),loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,envVarValidators:[iO,nO],lastAPIRequest:null,inMemoryErrorLog:[],inlinePlugins:[],sessionBypassPermissionsMode:!1,sessionPersistenceDisabled:!1,hasExitedPlanMode:!1,needsPlanModeExitAttachment:!1,hasExitedDelegateMode:!1,needsDelegateModeExitAttachment:!1,lspRecommendationShownThisSession:!1,initJsonSchema:null,registeredHooks:null,planSlugCache:new Map,teleportedSessionInfo:null,invokedSkills:new Map,slowOperations:[],sdkBetas:void 0}}var X9=rO();function oO(){return X9.sessionId}var v7=10,aO=1e4;function IY(X,Q){return}function sO({writeFn:X,flushIntervalMs:Q=1000,maxBufferSize:$=100,immediateMode:Y=!1}){let G=[],J=null;function H(){if(J)clearTimeout(J),J=null}function W(){if(G.length===0)return;X(G.join("")),G=[],H()}function U(){if(!J)J=setTimeout(W,Q)}return{write(z){if(Y){X(z);return}if(G.push(z),U(),G.length>=$)W()},flush:W,dispose(){W()}}}var y7=new Set;function tO(X){return y7.add(X),()=>y7.delete(X)}var jY=1/0;function eO(X){if(X===null)return"null";if(X===void 0)return"undefined";if(Array.isArray(X))return`Array[${X.length}]`;if(typeof X==="object")return`Object{${Object.keys(X).length} keys}`;if(typeof X==="string")return`string(${X.length} chars)`;return typeof X}function PY(X,Q){let $=performance.now();try{return Q()}finally{let Y=performance.now()-$;if(Y>jY)j1(`[SLOW OPERATION DETECTED] ${X} (${Y.toFixed(1)}ms)`),IY(X,Y)}}function K1(X,Q,$){let Y=eO(X);return PY(`JSON.stringify(${Y})`,()=>JSON.stringify(X,Q,$))}var TY=(X,Q)=>{let $=typeof X==="string"?X.length:0;return PY(`JSON.parse(${$} chars)`,()=>JSON.parse(X,Q))},XZ=b8(()=>{return k7(process.env.DEBUG)||k7(process.env.DEBUG_SDK)||process.argv.includes("--debug")||process.argv.includes("-d")||SY()||process.argv.some((X)=>X.startsWith("--debug="))}),QZ=b8(()=>{let X=process.argv.find(($)=>$.startsWith("--debug="));if(!X)return null;let Q=X.substring(8);return gO(Q)}),SY=b8(()=>{return process.argv.includes("--debug-to-stderr")||process.argv.includes("-d2e")});function $Z(X){if(typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let Q=QZ();return uO(X,Q)}var YZ=!1,f6=null;function GZ(){if(!f6)f6=sO({writeFn:(X)=>{let Q=EY();if(!P1().existsSync(J$(Q)))P1().mkdirSync(J$(Q));P1().appendFileSync(Q,X),JZ()},flushIntervalMs:1000,maxBufferSize:100,immediateMode:XZ()}),tO(async()=>f6?.dispose());return f6}function j1(X,{level:Q}={level:"debug"}){if(!$Z(X))return;if(YZ&&X.includes(`
|
|
194
|
-
`))X=K1(X);let Y=`${new Date().toISOString()} [${Q.toUpperCase()}] ${X.trim()}
|
|
195
|
-
`;if(SY()){xO(Y);return}GZ().write(Y)}function EY(){return process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??RY(NY(),"debug",`${oO()}.txt`)}var JZ=b8(()=>{if(process.argv[2]==="--ripgrep")return;try{let X=EY(),Q=J$(X),$=RY(Q,"latest");if(!P1().existsSync(Q))P1().mkdirSync(Q);if(P1().existsSync($))try{P1().unlinkSync($)}catch{}P1().symlinkSync(X,$)}catch{}});function v0(X,Q){let $=performance.now();try{return Q()}finally{let Y=performance.now()-$;if(Y>jY)j1(`[SLOW OPERATION DETECTED] fs.${X} (${Y.toFixed(1)}ms)`),IY(`fs.${X}`,Y)}}var HZ={cwd(){return process.cwd()},existsSync(X){return v0(`existsSync(${X})`,()=>W0.existsSync(X))},async stat(X){return sM(X)},statSync(X){return v0(`statSync(${X})`,()=>W0.statSync(X))},lstatSync(X){return v0(`lstatSync(${X})`,()=>W0.lstatSync(X))},readFileSync(X,Q){return v0(`readFileSync(${X})`,()=>W0.readFileSync(X,{encoding:Q.encoding}))},readFileBytesSync(X){return v0(`readFileBytesSync(${X})`,()=>W0.readFileSync(X))},readSync(X,Q){return v0(`readSync(${X}, ${Q.length} bytes)`,()=>{let $=void 0;try{$=W0.openSync(X,"r");let Y=Buffer.alloc(Q.length),G=W0.readSync($,Y,0,Q.length,0);return{buffer:Y,bytesRead:G}}finally{if($)W0.closeSync($)}})},appendFileSync(X,Q,$){return v0(`appendFileSync(${X}, ${Q.length} chars)`,()=>{if(!W0.existsSync(X)&&$?.mode!==void 0){let Y=W0.openSync(X,"a",$.mode);try{W0.appendFileSync(Y,Q)}finally{W0.closeSync(Y)}}else W0.appendFileSync(X,Q)})},copyFileSync(X,Q){return v0(`copyFileSync(${X} \u2192 ${Q})`,()=>W0.copyFileSync(X,Q))},unlinkSync(X){return v0(`unlinkSync(${X})`,()=>W0.unlinkSync(X))},renameSync(X,Q){return v0(`renameSync(${X} \u2192 ${Q})`,()=>W0.renameSync(X,Q))},linkSync(X,Q){return v0(`linkSync(${X} \u2192 ${Q})`,()=>W0.linkSync(X,Q))},symlinkSync(X,Q){return v0(`symlinkSync(${X} \u2192 ${Q})`,()=>W0.symlinkSync(X,Q))},readlinkSync(X){return v0(`readlinkSync(${X})`,()=>W0.readlinkSync(X))},realpathSync(X){return v0(`realpathSync(${X})`,()=>W0.realpathSync(X))},mkdirSync(X,Q){return v0(`mkdirSync(${X})`,()=>{if(!W0.existsSync(X)){let $={recursive:!0};if(Q?.mode!==void 0)$.mode=Q.mode;W0.mkdirSync(X,$)}})},readdirSync(X){return v0(`readdirSync(${X})`,()=>W0.readdirSync(X,{withFileTypes:!0}))},readdirStringSync(X){return v0(`readdirStringSync(${X})`,()=>W0.readdirSync(X))},isDirEmptySync(X){return v0(`isDirEmptySync(${X})`,()=>{return this.readdirSync(X).length===0})},rmdirSync(X){return v0(`rmdirSync(${X})`,()=>W0.rmdirSync(X))},rmSync(X,Q){return v0(`rmSync(${X})`,()=>W0.rmSync(X,Q))},createWriteStream(X){return W0.createWriteStream(X)}},WZ=HZ;function P1(){return WZ}class N9 extends Error{}function bY(){return process.versions.bun!==void 0}var u6=null,g7=!1;function qZ(){if(g7)return u6;if(g7=!0,!process.env.DEBUG_CLAUDE_AGENT_SDK)return null;let X=x7(NY(),"debug");if(u6=x7(X,`sdk-${UZ()}.txt`),!BZ(X))LZ(X,{recursive:!0});return process.stderr.write(`SDK debug logs: ${u6}
|
|
196
|
-
`),u6}function e1(X){let Q=qZ();if(!Q)return;let Y=`${new Date().toISOString()} ${X}
|
|
197
|
-
`;zZ(Q,Y)}function FZ(X,Q){let $={...X};if(Q){let Y={sandbox:Q};if($.settings)try{Y={...TY($.settings),sandbox:Q}}catch{}$.settings=K1(Y)}return $}class CY{options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(X){this.options=X,this.abortController=X.abortController||MY(),this.initialize()}getDefaultExecutable(){return bY()?"bun":"node"}spawnLocalProcess(X){let{command:Q,args:$,cwd:Y,env:G,signal:J}=X,H=G.DEBUG_CLAUDE_AGENT_SDK||this.options.stderr?"pipe":"ignore",W=oM(Q,$,{cwd:Y,stdio:["pipe","pipe",H],signal:J,env:G,windowsHide:!0});if(G.DEBUG_CLAUDE_AGENT_SDK||this.options.stderr)W.stderr.on("data",(z)=>{let L=z.toString();if(e1(L),this.options.stderr)this.options.stderr(L)});return{stdin:W.stdin,stdout:W.stdout,get killed(){return W.killed},get exitCode(){return W.exitCode},kill:W.kill.bind(W),on:W.on.bind(W),once:W.once.bind(W),off:W.off.bind(W)}}initialize(){try{let{additionalDirectories:X=[],betas:Q,cwd:$,executable:Y=this.getDefaultExecutable(),executableArgs:G=[],extraArgs:J={},pathToClaudeCodeExecutable:H,env:W={...process.env},maxThinkingTokens:U,maxTurns:z,maxBudgetUsd:L,model:B,fallbackModel:F,jsonSchema:Z,permissionMode:I,allowDangerouslySkipPermissions:A,permissionPromptToolName:D,continueConversation:q,resume:M,settingSources:K,allowedTools:V=[],disallowedTools:N=[],tools:O,mcpServers:w,strictMcpConfig:j,canUseTool:E,includePartialMessages:g,plugins:k,sandbox:x}=this.options,u=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(U!==void 0)u.push("--max-thinking-tokens",U.toString());if(z)u.push("--max-turns",z.toString());if(L!==void 0)u.push("--max-budget-usd",L.toString());if(B)u.push("--model",B);if(Q&&Q.length>0)u.push("--betas",Q.join(","));if(Z)u.push("--json-schema",K1(Z));if(W.DEBUG_CLAUDE_AGENT_SDK)u.push("--debug-to-stderr");if(E){if(D)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");u.push("--permission-prompt-tool","stdio")}else if(D)u.push("--permission-prompt-tool",D);if(q)u.push("--continue");if(M)u.push("--resume",M);if(V.length>0)u.push("--allowedTools",V.join(","));if(N.length>0)u.push("--disallowedTools",N.join(","));if(O!==void 0)if(Array.isArray(O))if(O.length===0)u.push("--tools","");else u.push("--tools",O.join(","));else u.push("--tools","default");if(w&&Object.keys(w).length>0)u.push("--mcp-config",K1({mcpServers:w}));if(K)u.push("--setting-sources",K.join(","));if(j)u.push("--strict-mcp-config");if(I)u.push("--permission-mode",I);if(A)u.push("--allow-dangerously-skip-permissions");if(F){if(B&&F===B)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");u.push("--fallback-model",F)}if(g)u.push("--include-partial-messages");for(let S of X)u.push("--add-dir",S);if(k&&k.length>0)for(let S of k)if(S.type==="local")u.push("--plugin-dir",S.path);else throw Error(`Unsupported plugin type: ${S.type}`);if(this.options.forkSession)u.push("--fork-session");if(this.options.resumeSessionAt)u.push("--resume-session-at",this.options.resumeSessionAt);if(this.options.persistSession===!1)u.push("--no-session-persistence");let l=FZ(J??{},x);for(let[S,b]of Object.entries(l))if(b===null)u.push(`--${S}`);else u.push(`--${S}`,b);if(!W.CLAUDE_CODE_ENTRYPOINT)W.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(delete W.NODE_OPTIONS,W.DEBUG_CLAUDE_AGENT_SDK)W.DEBUG="1";else delete W.DEBUG;let G0=VZ(H),Z0=G0?H:Y,_0=G0?[...G,...u]:[...G,H,...u],h0={command:Z0,args:_0,cwd:$,env:W,signal:this.abortController.signal};if(this.options.spawnClaudeCodeProcess)e1(`Spawning Claude Code (custom): ${Z0} ${_0.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(h0);else{if(!P1().existsSync(H)){let b=G0?`Claude Code native binary not found at ${H}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${H}. Is options.pathToClaudeCodeExecutable set?`;throw ReferenceError(b)}e1(`Spawning Claude Code: ${Z0} ${_0.join(" ")}`),this.process=this.spawnLocalProcess(h0)}this.processStdin=this.process.stdin,this.processStdout=this.process.stdout;let F0=()=>{if(this.process&&!this.process.killed)this.process.kill("SIGTERM")};this.processExitHandler=F0,this.abortHandler=F0,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.process.on("error",(S)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new N9("Claude Code process aborted by user");else this.exitError=Error(`Failed to spawn Claude Code process: ${S.message}`),e1(this.exitError.message)}),this.process.on("exit",(S,b)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new N9("Claude Code process aborted by user");else{let f=this.getProcessExitError(S,b);if(f)this.exitError=f,e1(f.message)}}),this.ready=!0}catch(X){throw this.ready=!1,X}}getProcessExitError(X,Q){if(X!==0&&X!==null)return Error(`Claude Code process exited with code ${X}`);else if(Q)return Error(`Claude Code process terminated by signal ${Q}`);return}write(X){if(this.abortController.signal.aborted)throw new N9("Operation aborted");if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);e1(`[ProcessTransport] Writing to stdin: ${X.substring(0,100)}`);try{if(!this.processStdin.write(X))e1("[ProcessTransport] Write buffer full, data queued")}catch(Q){throw this.ready=!1,Error(`Failed to write to process stdin: ${Q.message}`)}}close(){if(this.processStdin)this.processStdin.end(),this.processStdin=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;for(let{handler:X}of this.exitListeners)this.process?.off("exit",X);if(this.exitListeners=[],this.process&&!this.process.killed)this.process.kill("SIGTERM"),setTimeout(()=>{if(this.process&&!this.process.killed)this.process.kill("SIGKILL")},5000);if(this.ready=!1,this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0}isReady(){return this.ready}async*readMessages(){if(!this.processStdout)throw Error("ProcessTransport output stream not available");let X=aM({input:this.processStdout});try{for await(let Q of X)if(Q.trim())yield TY(Q);await this.waitForExit()}catch(Q){throw Q}finally{X.close()}}endInput(){if(this.processStdin)this.processStdin.end()}getInputStream(){return this.processStdin}onExit(X){if(!this.process)return()=>{};let Q=($,Y)=>{let G=this.getProcessExitError($,Y);X(G)};return this.process.on("exit",Q),this.exitListeners.push({callback:X,handler:Q}),()=>{if(this.process)this.process.off("exit",Q);let $=this.exitListeners.findIndex((Y)=>Y.handler===Q);if($!==-1)this.exitListeners.splice($,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed){if(this.exitError)throw this.exitError;return}return new Promise((X,Q)=>{let $=(G,J)=>{if(this.abortController.signal.aborted){Q(new N9("Operation aborted"));return}let H=this.getProcessExitError(G,J);if(H)Q(H);else X()};this.process.once("exit",$);let Y=(G)=>{this.process.off("exit",$),Q(G)};this.process.once("error",Y),this.process.once("exit",()=>{this.process.off("error",Y)})})}}function VZ(X){return![".js",".mjs",".tsx",".ts",".jsx"].some(($)=>X.endsWith($))}class _Y{returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(X){this.returned=X}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){if(this.queue.length>0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((X,Q)=>{this.readResolve=X,this.readReject=Q})}enqueue(X){if(this.readResolve){let Q=this.readResolve;this.readResolve=void 0,this.readReject=void 0,Q({done:!1,value:X})}else this.queue.push(X)}done(){if(this.isDone=!0,this.readResolve){let X=this.readResolve;this.readResolve=void 0,this.readReject=void 0,X({done:!0,value:void 0})}}error(X){if(this.hasError=X,this.readReject){let Q=this.readReject;this.readResolve=void 0,this.readReject=void 0,Q(X)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}}class kY{sendMcpMessage;isClosed=!1;constructor(X){this.sendMcpMessage=X}onclose;onerror;onmessage;async start(){}async send(X){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(X)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}class vY{transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new _Y;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0}constructor(X,Q,$,Y,G,J=new Map,H,W){this.transport=X,this.isSingleUserTurn=Q,this.canUseTool=$,this.hooks=Y,this.abortController=G,this.jsonSchema=H,this.initConfig=W;for(let[U,z]of J)this.connectSdkMcpServer(U,z);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(X){this.inputStream.error(X)}cleanup(X){if(this.cleanupPerformed)return;this.cleanupPerformed=!0;try{this.transport.close(),this.pendingControlResponses.clear(),this.pendingMcpResponses.clear(),this.cancelControllers.clear(),this.hookCallbacks.clear();for(let Q of this.sdkMcpTransports.values())try{Q.close()}catch{}if(this.sdkMcpTransports.clear(),X)this.inputStream.error(X);else this.inputStream.done()}catch(Q){}}next(...[X]){return this.sdkMessages.next(...[X])}return(X){return this.sdkMessages.return(X)}throw(X){return this.sdkMessages.throw(X)}[Symbol.asyncIterator](){return this.sdkMessages}[Symbol.asyncDispose](){return this.sdkMessages[Symbol.asyncDispose]()}async readMessages(){try{for await(let X of this.transport.readMessages()){if(X.type==="control_response"){let Q=this.pendingControlResponses.get(X.response.request_id);if(Q)Q(X.response);continue}else if(X.type==="control_request"){this.handleControlRequest(X);continue}else if(X.type==="control_cancel_request"){this.handleControlCancelRequest(X);continue}else if(X.type==="keep_alive")continue;if(X.type==="result"){if(this.firstResultReceived=!0,this.firstResultReceivedResolve)this.firstResultReceivedResolve();if(this.isSingleUserTurn)j1("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput()}this.inputStream.enqueue(X)}if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.done(),this.cleanup()}catch(X){if(this.firstResultReceivedResolve)this.firstResultReceivedResolve();this.inputStream.error(X),this.cleanup(X)}}async handleControlRequest(X){let Q=new AbortController;this.cancelControllers.set(X.request_id,Q);try{let $=await this.processControlRequest(X,Q.signal),Y={type:"control_response",response:{subtype:"success",request_id:X.request_id,response:$}};await Promise.resolve(this.transport.write(K1(Y)+`
|
|
198
|
-
`))}catch($){let Y={type:"control_response",response:{subtype:"error",request_id:X.request_id,error:$.message||String($)}};await Promise.resolve(this.transport.write(K1(Y)+`
|
|
199
|
-
`))}finally{this.cancelControllers.delete(X.request_id)}}handleControlCancelRequest(X){let Q=this.cancelControllers.get(X.request_id);if(Q)Q.abort(),this.cancelControllers.delete(X.request_id)}async processControlRequest(X,Q){if(X.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(X.request.tool_name,X.request.input,{signal:Q,suggestions:X.request.permission_suggestions,blockedPath:X.request.blocked_path,decisionReason:X.request.decision_reason,toolUseID:X.request.tool_use_id,agentID:X.request.agent_id}),toolUseID:X.request.tool_use_id}}else if(X.request.subtype==="hook_callback")return await this.handleHookCallbacks(X.request.callback_id,X.request.input,X.request.tool_use_id,Q);else if(X.request.subtype==="mcp_message"){let $=X.request,Y=this.sdkMcpTransports.get($.server_name);if(!Y)throw Error(`SDK MCP server not found: ${$.server_name}`);if("method"in $.message&&"id"in $.message&&$.message.id!==null)return{mcp_response:await this.handleMcpControlRequest($.server_name,$,Y)};else{if(Y.onmessage)Y.onmessage($.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}throw Error("Unsupported control request subtype: "+X.request.subtype)}async*readSdkMessages(){for await(let X of this.inputStream)yield X}async initialize(){let X;if(this.hooks){X={};for(let[G,J]of Object.entries(this.hooks))if(J.length>0)X[G]=J.map((H)=>{let W=[];for(let U of H.hooks){let z=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(z,U),W.push(z)}return{matcher:H.matcher,hookCallbackIds:W,timeout:H.timeout}})}let Q=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,$={subtype:"initialize",hooks:X,sdkMcpServers:Q,jsonSchema:this.jsonSchema,systemPrompt:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,agents:this.initConfig?.agents};return(await this.request($)).response}async interrupt(){await this.request({subtype:"interrupt"})}async setPermissionMode(X){await this.request({subtype:"set_permission_mode",mode:X})}async setModel(X){await this.request({subtype:"set_model",model:X})}async setMaxThinkingTokens(X){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:X})}async rewindFiles(X,Q){return(await this.request({subtype:"rewind_files",user_message_id:X,dry_run:Q?.dryRun})).response}async processPendingPermissionRequests(X){for(let Q of X)if(Q.request.subtype==="can_use_tool")this.handleControlRequest(Q).catch(()=>{})}request(X){let Q=Math.random().toString(36).substring(2,15),$={request_id:Q,type:"control_request",request:X};return new Promise((Y,G)=>{this.pendingControlResponses.set(Q,(J)=>{if(J.subtype==="success")Y(J);else if(G(Error(J.error)),J.pending_permission_requests)this.processPendingPermissionRequests(J.pending_permission_requests)}),Promise.resolve(this.transport.write(K1($)+`
|
|
200
|
-
`))})}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async setMcpServers(X){let Q={},$={};for(let[W,U]of Object.entries(X))if(U.type==="sdk"&&"instance"in U)Q[W]=U.instance;else $[W]=U;let Y=new Set(this.sdkMcpServerInstances.keys()),G=new Set(Object.keys(Q));for(let W of Y)if(!G.has(W))await this.disconnectSdkMcpServer(W);for(let[W,U]of Object.entries(Q))if(!Y.has(W))this.connectSdkMcpServer(W,U);let J={};for(let W of Object.keys(Q))J[W]={type:"sdk",name:W};return(await this.request({subtype:"mcp_set_servers",servers:{...$,...J}})).response}async accountInfo(){return(await this.initialization).account}async streamInput(X){j1("[Query.streamInput] Starting to process input stream");try{let Q=0;for await(let $ of X){if(Q++,j1(`[Query.streamInput] Processing message ${Q}: ${$.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(K1($)+`
|
|
201
|
-
`))}if(j1(`[Query.streamInput] Finished processing ${Q} messages from input stream`),Q>0&&this.hasBidirectionalNeeds())j1("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult();j1("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(Q){if(!(Q instanceof N9))throw Q}}waitForFirstResult(){if(this.firstResultReceived)return j1("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve();return new Promise((X)=>{if(this.abortController?.signal.aborted){X();return}this.abortController?.signal.addEventListener("abort",()=>X(),{once:!0}),this.firstResultReceivedResolve=X})}handleHookCallbacks(X,Q,$,Y){let G=this.hookCallbacks.get(X);if(!G)throw Error(`No hook callback found for ID: ${X}`);return G(Q,$,{signal:Y})}connectSdkMcpServer(X,Q){let $=new kY((Y)=>this.sendMcpServerMessageToCli(X,Y));this.sdkMcpTransports.set(X,$),this.sdkMcpServerInstances.set(X,Q),Q.connect($)}async disconnectSdkMcpServer(X){let Q=this.sdkMcpTransports.get(X);if(Q)await Q.close(),this.sdkMcpTransports.delete(X);this.sdkMcpServerInstances.delete(X)}sendMcpServerMessageToCli(X,Q){if("id"in Q&&Q.id!==null&&Q.id!==void 0){let Y=`${X}:${Q.id}`,G=this.pendingMcpResponses.get(Y);if(G){G.resolve(Q),this.pendingMcpResponses.delete(Y);return}}let $={type:"control_request",request_id:KZ(),request:{subtype:"mcp_message",server_name:X,message:Q}};this.transport.write(K1($)+`
|
|
202
|
-
`)}handleMcpControlRequest(X,Q,$){let Y="id"in Q.message?Q.message.id:null,G=`${X}:${Y}`;return new Promise((J,H)=>{let W=()=>{this.pendingMcpResponses.delete(G)},U=(L)=>{W(),J(L)},z=(L)=>{W(),H(L)};if(this.pendingMcpResponses.set(G,{resolve:U,reject:z}),$.onmessage)$.onmessage(Q.message);else{W(),H(Error("No message handler registered"));return}})}}var M0;(function(X){X.assertEqual=(G)=>{};function Q(G){}X.assertIs=Q;function $(G){throw Error()}X.assertNever=$,X.arrayToEnum=(G)=>{let J={};for(let H of G)J[H]=H;return J},X.getValidEnumValues=(G)=>{let J=X.objectKeys(G).filter((W)=>typeof G[G[W]]!=="number"),H={};for(let W of J)H[W]=G[W];return X.objectValues(H)},X.objectValues=(G)=>{return X.objectKeys(G).map(function(J){return G[J]})},X.objectKeys=typeof Object.keys==="function"?(G)=>Object.keys(G):(G)=>{let J=[];for(let H in G)if(Object.prototype.hasOwnProperty.call(G,H))J.push(H);return J},X.find=(G,J)=>{for(let H of G)if(J(H))return H;return},X.isInteger=typeof Number.isInteger==="function"?(G)=>Number.isInteger(G):(G)=>typeof G==="number"&&Number.isFinite(G)&&Math.floor(G)===G;function Y(G,J=" | "){return G.map((H)=>typeof H==="string"?`'${H}'`:H).join(J)}X.joinValues=Y,X.jsonStringifyReplacer=(G,J)=>{if(typeof J==="bigint")return J.toString();return J}})(M0||(M0={}));var h7;(function(X){X.mergeShapes=(Q,$)=>{return{...Q,...$}}})(h7||(h7={}));var n=M0.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),m1=(X)=>{switch(typeof X){case"undefined":return n.undefined;case"string":return n.string;case"number":return Number.isNaN(X)?n.nan:n.number;case"boolean":return n.boolean;case"function":return n.function;case"bigint":return n.bigint;case"symbol":return n.symbol;case"object":if(Array.isArray(X))return n.array;if(X===null)return n.null;if(X.then&&typeof X.then==="function"&&X.catch&&typeof X.catch==="function")return n.promise;if(typeof Map<"u"&&X instanceof Map)return n.map;if(typeof Set<"u"&&X instanceof Set)return n.set;if(typeof Date<"u"&&X instanceof Date)return n.date;return n.object;default:return n.unknown}},m=M0.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"]);class Q1 extends Error{get errors(){return this.issues}constructor(X){super();this.issues=[],this.addIssue=($)=>{this.issues=[...this.issues,$]},this.addIssues=($=[])=>{this.issues=[...this.issues,...$]};let Q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,Q);else this.__proto__=Q;this.name="ZodError",this.issues=X}format(X){let Q=X||function(G){return G.message},$={_errors:[]},Y=(G)=>{for(let J of G.issues)if(J.code==="invalid_union")J.unionErrors.map(Y);else if(J.code==="invalid_return_type")Y(J.returnTypeError);else if(J.code==="invalid_arguments")Y(J.argumentsError);else if(J.path.length===0)$._errors.push(Q(J));else{let H=$,W=0;while(W<J.path.length){let U=J.path[W];if(W!==J.path.length-1)H[U]=H[U]||{_errors:[]};else H[U]=H[U]||{_errors:[]},H[U]._errors.push(Q(J));H=H[U],W++}}};return Y(this),$}static assert(X){if(!(X instanceof Q1))throw Error(`Not a ZodError: ${X}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M0.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(X=(Q)=>Q.message){let Q={},$=[];for(let Y of this.issues)if(Y.path.length>0){let G=Y.path[0];Q[G]=Q[G]||[],Q[G].push(X(Y))}else $.push(X(Y));return{formErrors:$,fieldErrors:Q}}get formErrors(){return this.flatten()}}Q1.create=(X)=>{return new Q1(X)};var MZ=(X,Q)=>{let $;switch(X.code){case m.invalid_type:if(X.received===n.undefined)$="Required";else $=`Expected ${X.expected}, received ${X.received}`;break;case m.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(X.expected,M0.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:$=`Unrecognized key(s) in object: ${M0.joinValues(X.keys,", ")}`;break;case m.invalid_union:$="Invalid input";break;case m.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${M0.joinValues(X.options)}`;break;case m.invalid_enum_value:$=`Invalid enum value. Expected ${M0.joinValues(X.options)}, received '${X.received}'`;break;case m.invalid_arguments:$="Invalid function arguments";break;case m.invalid_return_type:$="Invalid function return type";break;case m.invalid_date:$="Invalid date";break;case m.invalid_string:if(typeof X.validation==="object")if("includes"in X.validation){if($=`Invalid input: must include "${X.validation.includes}"`,typeof X.validation.position==="number")$=`${$} at one or more positions greater than or equal to ${X.validation.position}`}else if("startsWith"in X.validation)$=`Invalid input: must start with "${X.validation.startsWith}"`;else if("endsWith"in X.validation)$=`Invalid input: must end with "${X.validation.endsWith}"`;else M0.assertNever(X.validation);else if(X.validation!=="regex")$=`Invalid ${X.validation}`;else $="Invalid";break;case m.too_small:if(X.type==="array")$=`Array must contain ${X.exact?"exactly":X.inclusive?"at least":"more than"} ${X.minimum} element(s)`;else if(X.type==="string")$=`String must contain ${X.exact?"exactly":X.inclusive?"at least":"over"} ${X.minimum} character(s)`;else if(X.type==="number")$=`Number must be ${X.exact?"exactly equal to ":X.inclusive?"greater than or equal to ":"greater than "}${X.minimum}`;else if(X.type==="bigint")$=`Number must be ${X.exact?"exactly equal to ":X.inclusive?"greater than or equal to ":"greater than "}${X.minimum}`;else if(X.type==="date")$=`Date must be ${X.exact?"exactly equal to ":X.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(X.minimum))}`;else $="Invalid input";break;case m.too_big:if(X.type==="array")$=`Array must contain ${X.exact?"exactly":X.inclusive?"at most":"less than"} ${X.maximum} element(s)`;else if(X.type==="string")$=`String must contain ${X.exact?"exactly":X.inclusive?"at most":"under"} ${X.maximum} character(s)`;else if(X.type==="number")$=`Number must be ${X.exact?"exactly":X.inclusive?"less than or equal to":"less than"} ${X.maximum}`;else if(X.type==="bigint")$=`BigInt must be ${X.exact?"exactly":X.inclusive?"less than or equal to":"less than"} ${X.maximum}`;else if(X.type==="date")$=`Date must be ${X.exact?"exactly":X.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(X.maximum))}`;else $="Invalid input";break;case m.custom:$="Invalid input";break;case m.invalid_intersection_types:$="Intersection results could not be merged";break;case m.not_multiple_of:$=`Number must be a multiple of ${X.multipleOf}`;break;case m.not_finite:$="Number must be finite";break;default:$=Q.defaultError,M0.assertNever(X)}return{message:$}},M8=MZ,DZ=M8;function H$(){return DZ}var W$=(X)=>{let{data:Q,path:$,errorMaps:Y,issueData:G}=X,J=[...$,...G.path||[]],H={...G,path:J};if(G.message!==void 0)return{...G,path:J,message:G.message};let W="",U=Y.filter((z)=>!!z).slice().reverse();for(let z of U)W=z(H,{data:Q,defaultError:W}).message;return{...G,path:J,message:W}};function d(X,Q){let $=H$(),Y=W$({issueData:Q,data:X.data,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,$,$===M8?void 0:M8].filter((G)=>!!G)});X.common.issues.push(Y)}class d0{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(X,Q){let $=[];for(let Y of Q){if(Y.status==="aborted")return J0;if(Y.status==="dirty")X.dirty();$.push(Y.value)}return{status:X.value,value:$}}static async mergeObjectAsync(X,Q){let $=[];for(let Y of Q){let G=await Y.key,J=await Y.value;$.push({key:G,value:J})}return d0.mergeObjectSync(X,$)}static mergeObjectSync(X,Q){let $={};for(let Y of Q){let{key:G,value:J}=Y;if(G.status==="aborted")return J0;if(J.status==="aborted")return J0;if(G.status==="dirty")X.dirty();if(J.status==="dirty")X.dirty();if(G.value!=="__proto__"&&(typeof J.value<"u"||Y.alwaysSet))$[G.value]=J.value}return{status:X.value,value:$}}}var J0=Object.freeze({status:"aborted"}),q8=(X)=>({status:"dirty",value:X}),r0=(X)=>({status:"valid",value:X}),f7=(X)=>X.status==="aborted",u7=(X)=>X.status==="dirty",w9=(X)=>X.status==="valid",n6=(X)=>typeof Promise<"u"&&X instanceof Promise,o;(function(X){X.errToObj=(Q)=>typeof Q==="string"?{message:Q}:Q||{},X.toString=(Q)=>typeof Q==="string"?Q:Q?.message})(o||(o={}));class W1{constructor(X,Q,$,Y){this._cachedPath=[],this.parent=X,this.data=Q,this._path=$,this._key=Y}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 m7=(X,Q)=>{if(w9(Q))return{success:!0,data:Q.value};else{if(!X.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let $=new Q1(X.common.issues);return this._error=$,this._error}}}};function U0(X){if(!X)return{};let{errorMap:Q,invalid_type_error:$,required_error:Y,description:G}=X;if(Q&&($||Y))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(Q)return{errorMap:Q,description:G};return{errorMap:(H,W)=>{let{message:U}=X;if(H.code==="invalid_enum_value")return{message:U??W.defaultError};if(typeof W.data>"u")return{message:U??Y??W.defaultError};if(H.code!=="invalid_type")return{message:W.defaultError};return{message:U??$??W.defaultError}},description:G}}class q0{get description(){return this._def.description}_getType(X){return m1(X.data)}_getOrReturnCtx(X,Q){return Q||{common:X.parent.common,data:X.data,parsedType:m1(X.data),schemaErrorMap:this._def.errorMap,path:X.path,parent:X.parent}}_processInputParams(X){return{status:new d0,ctx:{common:X.parent.common,data:X.data,parsedType:m1(X.data),schemaErrorMap:this._def.errorMap,path:X.path,parent:X.parent}}}_parseSync(X){let Q=this._parse(X);if(n6(Q))throw Error("Synchronous parse encountered promise.");return Q}_parseAsync(X){let Q=this._parse(X);return Promise.resolve(Q)}parse(X,Q){let $=this.safeParse(X,Q);if($.success)return $.data;throw $.error}safeParse(X,Q){let $={common:{issues:[],async:Q?.async??!1,contextualErrorMap:Q?.errorMap},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:m1(X)},Y=this._parseSync({data:X,path:$.path,parent:$});return m7($,Y)}"~validate"(X){let Q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:m1(X)};if(!this["~standard"].async)try{let $=this._parseSync({data:X,path:[],parent:Q});return w9($)?{value:$.value}:{issues:Q.common.issues}}catch($){if($?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;Q.common={issues:[],async:!0}}return this._parseAsync({data:X,path:[],parent:Q}).then(($)=>w9($)?{value:$.value}:{issues:Q.common.issues})}async parseAsync(X,Q){let $=await this.safeParseAsync(X,Q);if($.success)return $.data;throw $.error}async safeParseAsync(X,Q){let $={common:{issues:[],contextualErrorMap:Q?.errorMap,async:!0},path:Q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:X,parsedType:m1(X)},Y=this._parse({data:X,path:$.path,parent:$}),G=await(n6(Y)?Y:Promise.resolve(Y));return m7($,G)}refine(X,Q){let $=(Y)=>{if(typeof Q==="string"||typeof Q>"u")return{message:Q};else if(typeof Q==="function")return Q(Y);else return Q};return this._refinement((Y,G)=>{let J=X(Y),H=()=>G.addIssue({code:m.custom,...$(Y)});if(typeof Promise<"u"&&J instanceof Promise)return J.then((W)=>{if(!W)return H(),!1;else return!0});if(!J)return H(),!1;else return!0})}refinement(X,Q){return this._refinement(($,Y)=>{if(!X($))return Y.addIssue(typeof Q==="function"?Q($,Y):Q),!1;else return!0})}_refinement(X){return new Z1({schema:this,typeName:H0.ZodEffects,effect:{type:"refinement",refinement:X}})}superRefine(X){return this._refinement(X)}constructor(X){this.spa=this.safeParseAsync,this._def=X,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:(Q)=>this["~validate"](Q)}}optional(){return D1.create(this,this._def)}nullable(){return c1.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return M1.create(this)}promise(){return T9.create(this,this._def)}or(X){return A8.create([this,X],this._def)}and(X){return N8.create(this,X,this._def)}transform(X){return new Z1({...U0(this._def),schema:this,typeName:H0.ZodEffects,effect:{type:"transform",transform:X}})}default(X){let Q=typeof X==="function"?X:()=>X;return new j8({...U0(this._def),innerType:this,defaultValue:Q,typeName:H0.ZodDefault})}brand(){return new A$({typeName:H0.ZodBranded,type:this,...U0(this._def)})}catch(X){let Q=typeof X==="function"?X:()=>X;return new P8({...U0(this._def),innerType:this,catchValue:Q,typeName:H0.ZodCatch})}describe(X){return new this.constructor({...this._def,description:X})}pipe(X){return zX.create(this,X)}readonly(){return T8.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var OZ=/^c[^\s-]{8,}$/i,ZZ=/^[0-9a-z]+$/,AZ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,NZ=/^[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,RZ=/^[a-z0-9_-]{21}$/i,wZ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,IZ=/^[-+]?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)?)??$/,jZ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Q$,TZ=/^(?:(?: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])$/,SZ=/^(?:(?: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])$/,EZ=/^(([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]))$/,bZ=/^(([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])$/,CZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_Z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,yY="((\\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])))",kZ=new RegExp(`^${yY}$`);function xY(X){let Q="[0-5]\\d";if(X.precision)Q=`${Q}\\.\\d{${X.precision}}`;else if(X.precision==null)Q=`${Q}(\\.\\d+)?`;let $=X.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${Q})${$}`}function vZ(X){return new RegExp(`^${xY(X)}$`)}function yZ(X){let Q=`${yY}T${xY(X)}`,$=[];if($.push(X.local?"Z?":"Z"),X.offset)$.push("([+-]\\d{2}:?\\d{2})");return Q=`${Q}(${$.join("|")})`,new RegExp(`^${Q}$`)}function xZ(X,Q){if((Q==="v4"||!Q)&&TZ.test(X))return!0;if((Q==="v6"||!Q)&&EZ.test(X))return!0;return!1}function gZ(X,Q){if(!wZ.test(X))return!1;try{let[$]=X.split(".");if(!$)return!1;let Y=$.replace(/-/g,"+").replace(/_/g,"/").padEnd($.length+(4-$.length%4)%4,"="),G=JSON.parse(atob(Y));if(typeof G!=="object"||G===null)return!1;if("typ"in G&&G?.typ!=="JWT")return!1;if(!G.alg)return!1;if(Q&&G.alg!==Q)return!1;return!0}catch{return!1}}function hZ(X,Q){if((Q==="v4"||!Q)&&SZ.test(X))return!0;if((Q==="v6"||!Q)&&bZ.test(X))return!0;return!1}class T1 extends q0{_parse(X){if(this._def.coerce)X.data=String(X.data);if(this._getType(X)!==n.string){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_type,expected:n.string,received:G.parsedType}),J0}let $=new d0,Y=void 0;for(let G of this._def.checks)if(G.kind==="min"){if(X.data.length<G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_small,minimum:G.value,type:"string",inclusive:!0,exact:!1,message:G.message}),$.dirty()}else if(G.kind==="max"){if(X.data.length>G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_big,maximum:G.value,type:"string",inclusive:!0,exact:!1,message:G.message}),$.dirty()}else if(G.kind==="length"){let J=X.data.length>G.value,H=X.data.length<G.value;if(J||H){if(Y=this._getOrReturnCtx(X,Y),J)d(Y,{code:m.too_big,maximum:G.value,type:"string",inclusive:!0,exact:!0,message:G.message});else if(H)d(Y,{code:m.too_small,minimum:G.value,type:"string",inclusive:!0,exact:!0,message:G.message});$.dirty()}}else if(G.kind==="email"){if(!jZ.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"email",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="emoji"){if(!Q$)Q$=new RegExp(PZ,"u");if(!Q$.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"emoji",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="uuid"){if(!NZ.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"uuid",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="nanoid"){if(!RZ.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"nanoid",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="cuid"){if(!OZ.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"cuid",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="cuid2"){if(!ZZ.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"cuid2",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="ulid"){if(!AZ.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"ulid",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="url")try{new URL(X.data)}catch{Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"url",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="regex"){if(G.regex.lastIndex=0,!G.regex.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"regex",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="trim")X.data=X.data.trim();else if(G.kind==="includes"){if(!X.data.includes(G.value,G.position))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:{includes:G.value,position:G.position},message:G.message}),$.dirty()}else if(G.kind==="toLowerCase")X.data=X.data.toLowerCase();else if(G.kind==="toUpperCase")X.data=X.data.toUpperCase();else if(G.kind==="startsWith"){if(!X.data.startsWith(G.value))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:{startsWith:G.value},message:G.message}),$.dirty()}else if(G.kind==="endsWith"){if(!X.data.endsWith(G.value))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:{endsWith:G.value},message:G.message}),$.dirty()}else if(G.kind==="datetime"){if(!yZ(G).test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:"datetime",message:G.message}),$.dirty()}else if(G.kind==="date"){if(!kZ.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:"date",message:G.message}),$.dirty()}else if(G.kind==="time"){if(!vZ(G).test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.invalid_string,validation:"time",message:G.message}),$.dirty()}else if(G.kind==="duration"){if(!IZ.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"duration",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="ip"){if(!xZ(X.data,G.version))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"ip",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="jwt"){if(!gZ(X.data,G.alg))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"jwt",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="cidr"){if(!hZ(X.data,G.version))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"cidr",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="base64"){if(!CZ.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"base64",code:m.invalid_string,message:G.message}),$.dirty()}else if(G.kind==="base64url"){if(!_Z.test(X.data))Y=this._getOrReturnCtx(X,Y),d(Y,{validation:"base64url",code:m.invalid_string,message:G.message}),$.dirty()}else M0.assertNever(G);return{status:$.value,value:X.data}}_regex(X,Q,$){return this.refinement((Y)=>X.test(Y),{validation:Q,code:m.invalid_string,...o.errToObj($)})}_addCheck(X){return new T1({...this._def,checks:[...this._def.checks,X]})}email(X){return this._addCheck({kind:"email",...o.errToObj(X)})}url(X){return this._addCheck({kind:"url",...o.errToObj(X)})}emoji(X){return this._addCheck({kind:"emoji",...o.errToObj(X)})}uuid(X){return this._addCheck({kind:"uuid",...o.errToObj(X)})}nanoid(X){return this._addCheck({kind:"nanoid",...o.errToObj(X)})}cuid(X){return this._addCheck({kind:"cuid",...o.errToObj(X)})}cuid2(X){return this._addCheck({kind:"cuid2",...o.errToObj(X)})}ulid(X){return this._addCheck({kind:"ulid",...o.errToObj(X)})}base64(X){return this._addCheck({kind:"base64",...o.errToObj(X)})}base64url(X){return this._addCheck({kind:"base64url",...o.errToObj(X)})}jwt(X){return this._addCheck({kind:"jwt",...o.errToObj(X)})}ip(X){return this._addCheck({kind:"ip",...o.errToObj(X)})}cidr(X){return this._addCheck({kind:"cidr",...o.errToObj(X)})}datetime(X){if(typeof X==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:X});return this._addCheck({kind:"datetime",precision:typeof X?.precision>"u"?null:X?.precision,offset:X?.offset??!1,local:X?.local??!1,...o.errToObj(X?.message)})}date(X){return this._addCheck({kind:"date",message:X})}time(X){if(typeof X==="string")return this._addCheck({kind:"time",precision:null,message:X});return this._addCheck({kind:"time",precision:typeof X?.precision>"u"?null:X?.precision,...o.errToObj(X?.message)})}duration(X){return this._addCheck({kind:"duration",...o.errToObj(X)})}regex(X,Q){return this._addCheck({kind:"regex",regex:X,...o.errToObj(Q)})}includes(X,Q){return this._addCheck({kind:"includes",value:X,position:Q?.position,...o.errToObj(Q?.message)})}startsWith(X,Q){return this._addCheck({kind:"startsWith",value:X,...o.errToObj(Q)})}endsWith(X,Q){return this._addCheck({kind:"endsWith",value:X,...o.errToObj(Q)})}min(X,Q){return this._addCheck({kind:"min",value:X,...o.errToObj(Q)})}max(X,Q){return this._addCheck({kind:"max",value:X,...o.errToObj(Q)})}length(X,Q){return this._addCheck({kind:"length",value:X,...o.errToObj(Q)})}nonempty(X){return this.min(1,o.errToObj(X))}trim(){return new T1({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new T1({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new T1({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((X)=>X.kind==="datetime")}get isDate(){return!!this._def.checks.find((X)=>X.kind==="date")}get isTime(){return!!this._def.checks.find((X)=>X.kind==="time")}get isDuration(){return!!this._def.checks.find((X)=>X.kind==="duration")}get isEmail(){return!!this._def.checks.find((X)=>X.kind==="email")}get isURL(){return!!this._def.checks.find((X)=>X.kind==="url")}get isEmoji(){return!!this._def.checks.find((X)=>X.kind==="emoji")}get isUUID(){return!!this._def.checks.find((X)=>X.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((X)=>X.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((X)=>X.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((X)=>X.kind==="cuid2")}get isULID(){return!!this._def.checks.find((X)=>X.kind==="ulid")}get isIP(){return!!this._def.checks.find((X)=>X.kind==="ip")}get isCIDR(){return!!this._def.checks.find((X)=>X.kind==="cidr")}get isBase64(){return!!this._def.checks.find((X)=>X.kind==="base64")}get isBase64url(){return!!this._def.checks.find((X)=>X.kind==="base64url")}get minLength(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X}get maxLength(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X}}T1.create=(X)=>{return new T1({checks:[],typeName:H0.ZodString,coerce:X?.coerce??!1,...U0(X)})};function fZ(X,Q){let $=(X.toString().split(".")[1]||"").length,Y=(Q.toString().split(".")[1]||"").length,G=$>Y?$:Y,J=Number.parseInt(X.toFixed(G).replace(".","")),H=Number.parseInt(Q.toFixed(G).replace(".",""));return J%H/10**G}class I9 extends q0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(X){if(this._def.coerce)X.data=Number(X.data);if(this._getType(X)!==n.number){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_type,expected:n.number,received:G.parsedType}),J0}let $=void 0,Y=new d0;for(let G of this._def.checks)if(G.kind==="int"){if(!M0.isInteger(X.data))$=this._getOrReturnCtx(X,$),d($,{code:m.invalid_type,expected:"integer",received:"float",message:G.message}),Y.dirty()}else if(G.kind==="min"){if(G.inclusive?X.data<G.value:X.data<=G.value)$=this._getOrReturnCtx(X,$),d($,{code:m.too_small,minimum:G.value,type:"number",inclusive:G.inclusive,exact:!1,message:G.message}),Y.dirty()}else if(G.kind==="max"){if(G.inclusive?X.data>G.value:X.data>=G.value)$=this._getOrReturnCtx(X,$),d($,{code:m.too_big,maximum:G.value,type:"number",inclusive:G.inclusive,exact:!1,message:G.message}),Y.dirty()}else if(G.kind==="multipleOf"){if(fZ(X.data,G.value)!==0)$=this._getOrReturnCtx(X,$),d($,{code:m.not_multiple_of,multipleOf:G.value,message:G.message}),Y.dirty()}else if(G.kind==="finite"){if(!Number.isFinite(X.data))$=this._getOrReturnCtx(X,$),d($,{code:m.not_finite,message:G.message}),Y.dirty()}else M0.assertNever(G);return{status:Y.value,value:X.data}}gte(X,Q){return this.setLimit("min",X,!0,o.toString(Q))}gt(X,Q){return this.setLimit("min",X,!1,o.toString(Q))}lte(X,Q){return this.setLimit("max",X,!0,o.toString(Q))}lt(X,Q){return this.setLimit("max",X,!1,o.toString(Q))}setLimit(X,Q,$,Y){return new I9({...this._def,checks:[...this._def.checks,{kind:X,value:Q,inclusive:$,message:o.toString(Y)}]})}_addCheck(X){return new I9({...this._def,checks:[...this._def.checks,X]})}int(X){return this._addCheck({kind:"int",message:o.toString(X)})}positive(X){return this._addCheck({kind:"min",value:0,inclusive:!1,message:o.toString(X)})}negative(X){return this._addCheck({kind:"max",value:0,inclusive:!1,message:o.toString(X)})}nonpositive(X){return this._addCheck({kind:"max",value:0,inclusive:!0,message:o.toString(X)})}nonnegative(X){return this._addCheck({kind:"min",value:0,inclusive:!0,message:o.toString(X)})}multipleOf(X,Q){return this._addCheck({kind:"multipleOf",value:X,message:o.toString(Q)})}finite(X){return this._addCheck({kind:"finite",message:o.toString(X)})}safe(X){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:o.toString(X)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:o.toString(X)})}get minValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X}get maxValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X}get isInt(){return!!this._def.checks.find((X)=>X.kind==="int"||X.kind==="multipleOf"&&M0.isInteger(X.value))}get isFinite(){let X=null,Q=null;for(let $ of this._def.checks)if($.kind==="finite"||$.kind==="int"||$.kind==="multipleOf")return!0;else if($.kind==="min"){if(Q===null||$.value>Q)Q=$.value}else if($.kind==="max"){if(X===null||$.value<X)X=$.value}return Number.isFinite(Q)&&Number.isFinite(X)}}I9.create=(X)=>{return new I9({checks:[],typeName:H0.ZodNumber,coerce:X?.coerce||!1,...U0(X)})};class j9 extends q0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(X){if(this._def.coerce)try{X.data=BigInt(X.data)}catch{return this._getInvalidInput(X)}if(this._getType(X)!==n.bigint)return this._getInvalidInput(X);let $=void 0,Y=new d0;for(let G of this._def.checks)if(G.kind==="min"){if(G.inclusive?X.data<G.value:X.data<=G.value)$=this._getOrReturnCtx(X,$),d($,{code:m.too_small,type:"bigint",minimum:G.value,inclusive:G.inclusive,message:G.message}),Y.dirty()}else if(G.kind==="max"){if(G.inclusive?X.data>G.value:X.data>=G.value)$=this._getOrReturnCtx(X,$),d($,{code:m.too_big,type:"bigint",maximum:G.value,inclusive:G.inclusive,message:G.message}),Y.dirty()}else if(G.kind==="multipleOf"){if(X.data%G.value!==BigInt(0))$=this._getOrReturnCtx(X,$),d($,{code:m.not_multiple_of,multipleOf:G.value,message:G.message}),Y.dirty()}else M0.assertNever(G);return{status:Y.value,value:X.data}}_getInvalidInput(X){let Q=this._getOrReturnCtx(X);return d(Q,{code:m.invalid_type,expected:n.bigint,received:Q.parsedType}),J0}gte(X,Q){return this.setLimit("min",X,!0,o.toString(Q))}gt(X,Q){return this.setLimit("min",X,!1,o.toString(Q))}lte(X,Q){return this.setLimit("max",X,!0,o.toString(Q))}lt(X,Q){return this.setLimit("max",X,!1,o.toString(Q))}setLimit(X,Q,$,Y){return new j9({...this._def,checks:[...this._def.checks,{kind:X,value:Q,inclusive:$,message:o.toString(Y)}]})}_addCheck(X){return new j9({...this._def,checks:[...this._def.checks,X]})}positive(X){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:o.toString(X)})}negative(X){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:o.toString(X)})}nonpositive(X){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:o.toString(X)})}nonnegative(X){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:o.toString(X)})}multipleOf(X,Q){return this._addCheck({kind:"multipleOf",value:X,message:o.toString(Q)})}get minValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X}get maxValue(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X}}j9.create=(X)=>{return new j9({checks:[],typeName:H0.ZodBigInt,coerce:X?.coerce??!1,...U0(X)})};class r6 extends q0{_parse(X){if(this._def.coerce)X.data=Boolean(X.data);if(this._getType(X)!==n.boolean){let $=this._getOrReturnCtx(X);return d($,{code:m.invalid_type,expected:n.boolean,received:$.parsedType}),J0}return r0(X.data)}}r6.create=(X)=>{return new r6({typeName:H0.ZodBoolean,coerce:X?.coerce||!1,...U0(X)})};class D8 extends q0{_parse(X){if(this._def.coerce)X.data=new Date(X.data);if(this._getType(X)!==n.date){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_type,expected:n.date,received:G.parsedType}),J0}if(Number.isNaN(X.data.getTime())){let G=this._getOrReturnCtx(X);return d(G,{code:m.invalid_date}),J0}let $=new d0,Y=void 0;for(let G of this._def.checks)if(G.kind==="min"){if(X.data.getTime()<G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_small,message:G.message,inclusive:!0,exact:!1,minimum:G.value,type:"date"}),$.dirty()}else if(G.kind==="max"){if(X.data.getTime()>G.value)Y=this._getOrReturnCtx(X,Y),d(Y,{code:m.too_big,message:G.message,inclusive:!0,exact:!1,maximum:G.value,type:"date"}),$.dirty()}else M0.assertNever(G);return{status:$.value,value:new Date(X.data.getTime())}}_addCheck(X){return new D8({...this._def,checks:[...this._def.checks,X]})}min(X,Q){return this._addCheck({kind:"min",value:X.getTime(),message:o.toString(Q)})}max(X,Q){return this._addCheck({kind:"max",value:X.getTime(),message:o.toString(Q)})}get minDate(){let X=null;for(let Q of this._def.checks)if(Q.kind==="min"){if(X===null||Q.value>X)X=Q.value}return X!=null?new Date(X):null}get maxDate(){let X=null;for(let Q of this._def.checks)if(Q.kind==="max"){if(X===null||Q.value<X)X=Q.value}return X!=null?new Date(X):null}}D8.create=(X)=>{return new D8({checks:[],coerce:X?.coerce||!1,typeName:H0.ZodDate,...U0(X)})};class o6 extends q0{_parse(X){if(this._getType(X)!==n.symbol){let $=this._getOrReturnCtx(X);return d($,{code:m.invalid_type,expected:n.symbol,received:$.parsedType}),J0}return r0(X.data)}}o6.create=(X)=>{return new o6({typeName:H0.ZodSymbol,...U0(X)})};class O8 extends q0{_parse(X){if(this._getType(X)!==n.undefined){let $=this._getOrReturnCtx(X);return d($,{code:m.invalid_type,expected:n.undefined,received:$.parsedType}),J0}return r0(X.data)}}O8.create=(X)=>{return new O8({typeName:H0.ZodUndefined,...U0(X)})};class Z8 extends q0{_parse(X){if(this._getType(X)!==n.null){let $=this._getOrReturnCtx(X);return d($,{code:m.invalid_type,expected:n.null,received:$.parsedType}),J0}return r0(X.data)}}Z8.create=(X)=>{return new Z8({typeName:H0.ZodNull,...U0(X)})};class a6 extends q0{constructor(){super(...arguments);this._any=!0}_parse(X){return r0(X.data)}}a6.create=(X)=>{return new a6({typeName:H0.ZodAny,...U0(X)})};class Q9 extends q0{constructor(){super(...arguments);this._unknown=!0}_parse(X){return r0(X.data)}}Q9.create=(X)=>{return new Q9({typeName:H0.ZodUnknown,...U0(X)})};class S1 extends q0{_parse(X){let Q=this._getOrReturnCtx(X);return d(Q,{code:m.invalid_type,expected:n.never,received:Q.parsedType}),J0}}S1.create=(X)=>{return new S1({typeName:H0.ZodNever,...U0(X)})};class s6 extends q0{_parse(X){if(this._getType(X)!==n.undefined){let $=this._getOrReturnCtx(X);return d($,{code:m.invalid_type,expected:n.void,received:$.parsedType}),J0}return r0(X.data)}}s6.create=(X)=>{return new s6({typeName:H0.ZodVoid,...U0(X)})};class M1 extends q0{_parse(X){let{ctx:Q,status:$}=this._processInputParams(X),Y=this._def;if(Q.parsedType!==n.array)return d(Q,{code:m.invalid_type,expected:n.array,received:Q.parsedType}),J0;if(Y.exactLength!==null){let J=Q.data.length>Y.exactLength.value,H=Q.data.length<Y.exactLength.value;if(J||H)d(Q,{code:J?m.too_big:m.too_small,minimum:H?Y.exactLength.value:void 0,maximum:J?Y.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Y.exactLength.message}),$.dirty()}if(Y.minLength!==null){if(Q.data.length<Y.minLength.value)d(Q,{code:m.too_small,minimum:Y.minLength.value,type:"array",inclusive:!0,exact:!1,message:Y.minLength.message}),$.dirty()}if(Y.maxLength!==null){if(Q.data.length>Y.maxLength.value)d(Q,{code:m.too_big,maximum:Y.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Y.maxLength.message}),$.dirty()}if(Q.common.async)return Promise.all([...Q.data].map((J,H)=>{return Y.type._parseAsync(new W1(Q,J,Q.path,H))})).then((J)=>{return d0.mergeArray($,J)});let G=[...Q.data].map((J,H)=>{return Y.type._parseSync(new W1(Q,J,Q.path,H))});return d0.mergeArray($,G)}get element(){return this._def.type}min(X,Q){return new M1({...this._def,minLength:{value:X,message:o.toString(Q)}})}max(X,Q){return new M1({...this._def,maxLength:{value:X,message:o.toString(Q)}})}length(X,Q){return new M1({...this._def,exactLength:{value:X,message:o.toString(Q)}})}nonempty(X){return this.min(1,X)}}M1.create=(X,Q)=>{return new M1({type:X,minLength:null,maxLength:null,exactLength:null,typeName:H0.ZodArray,...U0(Q)})};function Z9(X){if(X instanceof C0){let Q={};for(let $ in X.shape){let Y=X.shape[$];Q[$]=D1.create(Z9(Y))}return new C0({...X._def,shape:()=>Q})}else if(X instanceof M1)return new M1({...X._def,type:Z9(X.element)});else if(X instanceof D1)return D1.create(Z9(X.unwrap()));else if(X instanceof c1)return c1.create(Z9(X.unwrap()));else if(X instanceof E1)return E1.create(X.items.map((Q)=>Z9(Q)));else return X}class C0 extends q0{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let X=this._def.shape(),Q=M0.objectKeys(X);return this._cached={shape:X,keys:Q},this._cached}_parse(X){if(this._getType(X)!==n.object){let U=this._getOrReturnCtx(X);return d(U,{code:m.invalid_type,expected:n.object,received:U.parsedType}),J0}let{status:$,ctx:Y}=this._processInputParams(X),{shape:G,keys:J}=this._getCached(),H=[];if(!(this._def.catchall instanceof S1&&this._def.unknownKeys==="strip")){for(let U in Y.data)if(!J.includes(U))H.push(U)}let W=[];for(let U of J){let z=G[U],L=Y.data[U];W.push({key:{status:"valid",value:U},value:z._parse(new W1(Y,L,Y.path,U)),alwaysSet:U in Y.data})}if(this._def.catchall instanceof S1){let U=this._def.unknownKeys;if(U==="passthrough")for(let z of H)W.push({key:{status:"valid",value:z},value:{status:"valid",value:Y.data[z]}});else if(U==="strict"){if(H.length>0)d(Y,{code:m.unrecognized_keys,keys:H}),$.dirty()}else if(U==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let U=this._def.catchall;for(let z of H){let L=Y.data[z];W.push({key:{status:"valid",value:z},value:U._parse(new W1(Y,L,Y.path,z)),alwaysSet:z in Y.data})}}if(Y.common.async)return Promise.resolve().then(async()=>{let U=[];for(let z of W){let L=await z.key,B=await z.value;U.push({key:L,value:B,alwaysSet:z.alwaysSet})}return U}).then((U)=>{return d0.mergeObjectSync($,U)});else return d0.mergeObjectSync($,W)}get shape(){return this._def.shape()}strict(X){return o.errToObj,new C0({...this._def,unknownKeys:"strict",...X!==void 0?{errorMap:(Q,$)=>{let Y=this._def.errorMap?.(Q,$).message??$.defaultError;if(Q.code==="unrecognized_keys")return{message:o.errToObj(X).message??Y};return{message:Y}}}:{}})}strip(){return new C0({...this._def,unknownKeys:"strip"})}passthrough(){return new C0({...this._def,unknownKeys:"passthrough"})}extend(X){return new C0({...this._def,shape:()=>({...this._def.shape(),...X})})}merge(X){return new C0({unknownKeys:X._def.unknownKeys,catchall:X._def.catchall,shape:()=>({...this._def.shape(),...X._def.shape()}),typeName:H0.ZodObject})}setKey(X,Q){return this.augment({[X]:Q})}catchall(X){return new C0({...this._def,catchall:X})}pick(X){let Q={};for(let $ of M0.objectKeys(X))if(X[$]&&this.shape[$])Q[$]=this.shape[$];return new C0({...this._def,shape:()=>Q})}omit(X){let Q={};for(let $ of M0.objectKeys(this.shape))if(!X[$])Q[$]=this.shape[$];return new C0({...this._def,shape:()=>Q})}deepPartial(){return Z9(this)}partial(X){let Q={};for(let $ of M0.objectKeys(this.shape)){let Y=this.shape[$];if(X&&!X[$])Q[$]=Y;else Q[$]=Y.optional()}return new C0({...this._def,shape:()=>Q})}required(X){let Q={};for(let $ of M0.objectKeys(this.shape))if(X&&!X[$])Q[$]=this.shape[$];else{let G=this.shape[$];while(G instanceof D1)G=G._def.innerType;Q[$]=G}return new C0({...this._def,shape:()=>Q})}keyof(){return gY(M0.objectKeys(this.shape))}}C0.create=(X,Q)=>{return new C0({shape:()=>X,unknownKeys:"strip",catchall:S1.create(),typeName:H0.ZodObject,...U0(Q)})};C0.strictCreate=(X,Q)=>{return new C0({shape:()=>X,unknownKeys:"strict",catchall:S1.create(),typeName:H0.ZodObject,...U0(Q)})};C0.lazycreate=(X,Q)=>{return new C0({shape:X,unknownKeys:"strip",catchall:S1.create(),typeName:H0.ZodObject,...U0(Q)})};class A8 extends q0{_parse(X){let{ctx:Q}=this._processInputParams(X),$=this._def.options;function Y(G){for(let H of G)if(H.result.status==="valid")return H.result;for(let H of G)if(H.result.status==="dirty")return Q.common.issues.push(...H.ctx.common.issues),H.result;let J=G.map((H)=>new Q1(H.ctx.common.issues));return d(Q,{code:m.invalid_union,unionErrors:J}),J0}if(Q.common.async)return Promise.all($.map(async(G)=>{let J={...Q,common:{...Q.common,issues:[]},parent:null};return{result:await G._parseAsync({data:Q.data,path:Q.path,parent:J}),ctx:J}})).then(Y);else{let G=void 0,J=[];for(let W of $){let U={...Q,common:{...Q.common,issues:[]},parent:null},z=W._parseSync({data:Q.data,path:Q.path,parent:U});if(z.status==="valid")return z;else if(z.status==="dirty"&&!G)G={result:z,ctx:U};if(U.common.issues.length)J.push(U.common.issues)}if(G)return Q.common.issues.push(...G.ctx.common.issues),G.result;let H=J.map((W)=>new Q1(W));return d(Q,{code:m.invalid_union,unionErrors:H}),J0}}get options(){return this._def.options}}A8.create=(X,Q)=>{return new A8({options:X,typeName:H0.ZodUnion,...U0(Q)})};var I1=(X)=>{if(X instanceof R8)return I1(X.schema);else if(X instanceof Z1)return I1(X.innerType());else if(X instanceof w8)return[X.value];else if(X instanceof $9)return X.options;else if(X instanceof I8)return M0.objectValues(X.enum);else if(X instanceof j8)return I1(X._def.innerType);else if(X instanceof O8)return[void 0];else if(X instanceof Z8)return[null];else if(X instanceof D1)return[void 0,...I1(X.unwrap())];else if(X instanceof c1)return[null,...I1(X.unwrap())];else if(X instanceof A$)return I1(X.unwrap());else if(X instanceof T8)return I1(X.unwrap());else if(X instanceof P8)return I1(X._def.innerType);else return[]};class Z$ extends q0{_parse(X){let{ctx:Q}=this._processInputParams(X);if(Q.parsedType!==n.object)return d(Q,{code:m.invalid_type,expected:n.object,received:Q.parsedType}),J0;let $=this.discriminator,Y=Q.data[$],G=this.optionsMap.get(Y);if(!G)return d(Q,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[$]}),J0;if(Q.common.async)return G._parseAsync({data:Q.data,path:Q.path,parent:Q});else return G._parseSync({data:Q.data,path:Q.path,parent:Q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(X,Q,$){let Y=new Map;for(let G of Q){let J=I1(G.shape[X]);if(!J.length)throw Error(`A discriminator value for key \`${X}\` could not be extracted from all schema options`);for(let H of J){if(Y.has(H))throw Error(`Discriminator property ${String(X)} has duplicate value ${String(H)}`);Y.set(H,G)}}return new Z$({typeName:H0.ZodDiscriminatedUnion,discriminator:X,options:Q,optionsMap:Y,...U0($)})}}function U$(X,Q){let $=m1(X),Y=m1(Q);if(X===Q)return{valid:!0,data:X};else if($===n.object&&Y===n.object){let G=M0.objectKeys(Q),J=M0.objectKeys(X).filter((W)=>G.indexOf(W)!==-1),H={...X,...Q};for(let W of J){let U=U$(X[W],Q[W]);if(!U.valid)return{valid:!1};H[W]=U.data}return{valid:!0,data:H}}else if($===n.array&&Y===n.array){if(X.length!==Q.length)return{valid:!1};let G=[];for(let J=0;J<X.length;J++){let H=X[J],W=Q[J],U=U$(H,W);if(!U.valid)return{valid:!1};G.push(U.data)}return{valid:!0,data:G}}else if($===n.date&&Y===n.date&&+X===+Q)return{valid:!0,data:X};else return{valid:!1}}class N8 extends q0{_parse(X){let{status:Q,ctx:$}=this._processInputParams(X),Y=(G,J)=>{if(f7(G)||f7(J))return J0;let H=U$(G.value,J.value);if(!H.valid)return d($,{code:m.invalid_intersection_types}),J0;if(u7(G)||u7(J))Q.dirty();return{status:Q.value,value:H.data}};if($.common.async)return Promise.all([this._def.left._parseAsync({data:$.data,path:$.path,parent:$}),this._def.right._parseAsync({data:$.data,path:$.path,parent:$})]).then(([G,J])=>Y(G,J));else return Y(this._def.left._parseSync({data:$.data,path:$.path,parent:$}),this._def.right._parseSync({data:$.data,path:$.path,parent:$}))}}N8.create=(X,Q,$)=>{return new N8({left:X,right:Q,typeName:H0.ZodIntersection,...U0($)})};class E1 extends q0{_parse(X){let{status:Q,ctx:$}=this._processInputParams(X);if($.parsedType!==n.array)return d($,{code:m.invalid_type,expected:n.array,received:$.parsedType}),J0;if($.data.length<this._def.items.length)return d($,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J0;if(!this._def.rest&&$.data.length>this._def.items.length)d($,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q.dirty();let G=[...$.data].map((J,H)=>{let W=this._def.items[H]||this._def.rest;if(!W)return null;return W._parse(new W1($,J,$.path,H))}).filter((J)=>!!J);if($.common.async)return Promise.all(G).then((J)=>{return d0.mergeArray(Q,J)});else return d0.mergeArray(Q,G)}get items(){return this._def.items}rest(X){return new E1({...this._def,rest:X})}}E1.create=(X,Q)=>{if(!Array.isArray(X))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new E1({items:X,typeName:H0.ZodTuple,rest:null,...U0(Q)})};class t6 extends q0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(X){let{status:Q,ctx:$}=this._processInputParams(X);if($.parsedType!==n.object)return d($,{code:m.invalid_type,expected:n.object,received:$.parsedType}),J0;let Y=[],G=this._def.keyType,J=this._def.valueType;for(let H in $.data)Y.push({key:G._parse(new W1($,H,$.path,H)),value:J._parse(new W1($,$.data[H],$.path,H)),alwaysSet:H in $.data});if($.common.async)return d0.mergeObjectAsync(Q,Y);else return d0.mergeObjectSync(Q,Y)}get element(){return this._def.valueType}static create(X,Q,$){if(Q instanceof q0)return new t6({keyType:X,valueType:Q,typeName:H0.ZodRecord,...U0($)});return new t6({keyType:T1.create(),valueType:X,typeName:H0.ZodRecord,...U0(Q)})}}class e6 extends q0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(X){let{status:Q,ctx:$}=this._processInputParams(X);if($.parsedType!==n.map)return d($,{code:m.invalid_type,expected:n.map,received:$.parsedType}),J0;let Y=this._def.keyType,G=this._def.valueType,J=[...$.data.entries()].map(([H,W],U)=>{return{key:Y._parse(new W1($,H,$.path,[U,"key"])),value:G._parse(new W1($,W,$.path,[U,"value"]))}});if($.common.async){let H=new Map;return Promise.resolve().then(async()=>{for(let W of J){let U=await W.key,z=await W.value;if(U.status==="aborted"||z.status==="aborted")return J0;if(U.status==="dirty"||z.status==="dirty")Q.dirty();H.set(U.value,z.value)}return{status:Q.value,value:H}})}else{let H=new Map;for(let W of J){let{key:U,value:z}=W;if(U.status==="aborted"||z.status==="aborted")return J0;if(U.status==="dirty"||z.status==="dirty")Q.dirty();H.set(U.value,z.value)}return{status:Q.value,value:H}}}}e6.create=(X,Q,$)=>{return new e6({valueType:Q,keyType:X,typeName:H0.ZodMap,...U0($)})};class P9 extends q0{_parse(X){let{status:Q,ctx:$}=this._processInputParams(X);if($.parsedType!==n.set)return d($,{code:m.invalid_type,expected:n.set,received:$.parsedType}),J0;let Y=this._def;if(Y.minSize!==null){if($.data.size<Y.minSize.value)d($,{code:m.too_small,minimum:Y.minSize.value,type:"set",inclusive:!0,exact:!1,message:Y.minSize.message}),Q.dirty()}if(Y.maxSize!==null){if($.data.size>Y.maxSize.value)d($,{code:m.too_big,maximum:Y.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Y.maxSize.message}),Q.dirty()}let G=this._def.valueType;function J(W){let U=new Set;for(let z of W){if(z.status==="aborted")return J0;if(z.status==="dirty")Q.dirty();U.add(z.value)}return{status:Q.value,value:U}}let H=[...$.data.values()].map((W,U)=>G._parse(new W1($,W,$.path,U)));if($.common.async)return Promise.all(H).then((W)=>J(W));else return J(H)}min(X,Q){return new P9({...this._def,minSize:{value:X,message:o.toString(Q)}})}max(X,Q){return new P9({...this._def,maxSize:{value:X,message:o.toString(Q)}})}size(X,Q){return this.min(X,Q).max(X,Q)}nonempty(X){return this.min(1,X)}}P9.create=(X,Q)=>{return new P9({valueType:X,minSize:null,maxSize:null,typeName:H0.ZodSet,...U0(Q)})};class V8 extends q0{constructor(){super(...arguments);this.validate=this.implement}_parse(X){let{ctx:Q}=this._processInputParams(X);if(Q.parsedType!==n.function)return d(Q,{code:m.invalid_type,expected:n.function,received:Q.parsedType}),J0;function $(H,W){return W$({data:H,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,H$(),M8].filter((U)=>!!U),issueData:{code:m.invalid_arguments,argumentsError:W}})}function Y(H,W){return W$({data:H,path:Q.path,errorMaps:[Q.common.contextualErrorMap,Q.schemaErrorMap,H$(),M8].filter((U)=>!!U),issueData:{code:m.invalid_return_type,returnTypeError:W}})}let G={errorMap:Q.common.contextualErrorMap},J=Q.data;if(this._def.returns instanceof T9){let H=this;return r0(async function(...W){let U=new Q1([]),z=await H._def.args.parseAsync(W,G).catch((F)=>{throw U.addIssue($(W,F)),U}),L=await Reflect.apply(J,this,z);return await H._def.returns._def.type.parseAsync(L,G).catch((F)=>{throw U.addIssue(Y(L,F)),U})})}else{let H=this;return r0(function(...W){let U=H._def.args.safeParse(W,G);if(!U.success)throw new Q1([$(W,U.error)]);let z=Reflect.apply(J,this,U.data),L=H._def.returns.safeParse(z,G);if(!L.success)throw new Q1([Y(z,L.error)]);return L.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...X){return new V8({...this._def,args:E1.create(X).rest(Q9.create())})}returns(X){return new V8({...this._def,returns:X})}implement(X){return this.parse(X)}strictImplement(X){return this.parse(X)}static create(X,Q,$){return new V8({args:X?X:E1.create([]).rest(Q9.create()),returns:Q||Q9.create(),typeName:H0.ZodFunction,...U0($)})}}class R8 extends q0{get schema(){return this._def.getter()}_parse(X){let{ctx:Q}=this._processInputParams(X);return this._def.getter()._parse({data:Q.data,path:Q.path,parent:Q})}}R8.create=(X,Q)=>{return new R8({getter:X,typeName:H0.ZodLazy,...U0(Q)})};class w8 extends q0{_parse(X){if(X.data!==this._def.value){let Q=this._getOrReturnCtx(X);return d(Q,{received:Q.data,code:m.invalid_literal,expected:this._def.value}),J0}return{status:"valid",value:X.data}}get value(){return this._def.value}}w8.create=(X,Q)=>{return new w8({value:X,typeName:H0.ZodLiteral,...U0(Q)})};function gY(X,Q){return new $9({values:X,typeName:H0.ZodEnum,...U0(Q)})}class $9 extends q0{_parse(X){if(typeof X.data!=="string"){let Q=this._getOrReturnCtx(X),$=this._def.values;return d(Q,{expected:M0.joinValues($),received:Q.parsedType,code:m.invalid_type}),J0}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(X.data)){let Q=this._getOrReturnCtx(X),$=this._def.values;return d(Q,{received:Q.data,code:m.invalid_enum_value,options:$}),J0}return r0(X.data)}get options(){return this._def.values}get enum(){let X={};for(let Q of this._def.values)X[Q]=Q;return X}get Values(){let X={};for(let Q of this._def.values)X[Q]=Q;return X}get Enum(){let X={};for(let Q of this._def.values)X[Q]=Q;return X}extract(X,Q=this._def){return $9.create(X,{...this._def,...Q})}exclude(X,Q=this._def){return $9.create(this.options.filter(($)=>!X.includes($)),{...this._def,...Q})}}$9.create=gY;class I8 extends q0{_parse(X){let Q=M0.getValidEnumValues(this._def.values),$=this._getOrReturnCtx(X);if($.parsedType!==n.string&&$.parsedType!==n.number){let Y=M0.objectValues(Q);return d($,{expected:M0.joinValues(Y),received:$.parsedType,code:m.invalid_type}),J0}if(!this._cache)this._cache=new Set(M0.getValidEnumValues(this._def.values));if(!this._cache.has(X.data)){let Y=M0.objectValues(Q);return d($,{received:$.data,code:m.invalid_enum_value,options:Y}),J0}return r0(X.data)}get enum(){return this._def.values}}I8.create=(X,Q)=>{return new I8({values:X,typeName:H0.ZodNativeEnum,...U0(Q)})};class T9 extends q0{unwrap(){return this._def.type}_parse(X){let{ctx:Q}=this._processInputParams(X);if(Q.parsedType!==n.promise&&Q.common.async===!1)return d(Q,{code:m.invalid_type,expected:n.promise,received:Q.parsedType}),J0;let $=Q.parsedType===n.promise?Q.data:Promise.resolve(Q.data);return r0($.then((Y)=>{return this._def.type.parseAsync(Y,{path:Q.path,errorMap:Q.common.contextualErrorMap})}))}}T9.create=(X,Q)=>{return new T9({type:X,typeName:H0.ZodPromise,...U0(Q)})};class Z1 extends q0{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H0.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(X){let{status:Q,ctx:$}=this._processInputParams(X),Y=this._def.effect||null,G={addIssue:(J)=>{if(d($,J),J.fatal)Q.abort();else Q.dirty()},get path(){return $.path}};if(G.addIssue=G.addIssue.bind(G),Y.type==="preprocess"){let J=Y.transform($.data,G);if($.common.async)return Promise.resolve(J).then(async(H)=>{if(Q.value==="aborted")return J0;let W=await this._def.schema._parseAsync({data:H,path:$.path,parent:$});if(W.status==="aborted")return J0;if(W.status==="dirty")return q8(W.value);if(Q.value==="dirty")return q8(W.value);return W});else{if(Q.value==="aborted")return J0;let H=this._def.schema._parseSync({data:J,path:$.path,parent:$});if(H.status==="aborted")return J0;if(H.status==="dirty")return q8(H.value);if(Q.value==="dirty")return q8(H.value);return H}}if(Y.type==="refinement"){let J=(H)=>{let W=Y.refinement(H,G);if($.common.async)return Promise.resolve(W);if(W instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return H};if($.common.async===!1){let H=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(H.status==="aborted")return J0;if(H.status==="dirty")Q.dirty();return J(H.value),{status:Q.value,value:H.value}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((H)=>{if(H.status==="aborted")return J0;if(H.status==="dirty")Q.dirty();return J(H.value).then(()=>{return{status:Q.value,value:H.value}})})}if(Y.type==="transform")if($.common.async===!1){let J=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(!w9(J))return J0;let H=Y.transform(J.value,G);if(H instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:Q.value,value:H}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((J)=>{if(!w9(J))return J0;return Promise.resolve(Y.transform(J.value,G)).then((H)=>({status:Q.value,value:H}))});M0.assertNever(Y)}}Z1.create=(X,Q,$)=>{return new Z1({schema:X,typeName:H0.ZodEffects,effect:Q,...U0($)})};Z1.createWithPreprocess=(X,Q,$)=>{return new Z1({schema:Q,effect:{type:"preprocess",transform:X},typeName:H0.ZodEffects,...U0($)})};class D1 extends q0{_parse(X){if(this._getType(X)===n.undefined)return r0(void 0);return this._def.innerType._parse(X)}unwrap(){return this._def.innerType}}D1.create=(X,Q)=>{return new D1({innerType:X,typeName:H0.ZodOptional,...U0(Q)})};class c1 extends q0{_parse(X){if(this._getType(X)===n.null)return r0(null);return this._def.innerType._parse(X)}unwrap(){return this._def.innerType}}c1.create=(X,Q)=>{return new c1({innerType:X,typeName:H0.ZodNullable,...U0(Q)})};class j8 extends q0{_parse(X){let{ctx:Q}=this._processInputParams(X),$=Q.data;if(Q.parsedType===n.undefined)$=this._def.defaultValue();return this._def.innerType._parse({data:$,path:Q.path,parent:Q})}removeDefault(){return this._def.innerType}}j8.create=(X,Q)=>{return new j8({innerType:X,typeName:H0.ZodDefault,defaultValue:typeof Q.default==="function"?Q.default:()=>Q.default,...U0(Q)})};class P8 extends q0{_parse(X){let{ctx:Q}=this._processInputParams(X),$={...Q,common:{...Q.common,issues:[]}},Y=this._def.innerType._parse({data:$.data,path:$.path,parent:{...$}});if(n6(Y))return Y.then((G)=>{return{status:"valid",value:G.status==="valid"?G.value:this._def.catchValue({get error(){return new Q1($.common.issues)},input:$.data})}});else return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new Q1($.common.issues)},input:$.data})}}removeCatch(){return this._def.innerType}}P8.create=(X,Q)=>{return new P8({innerType:X,typeName:H0.ZodCatch,catchValue:typeof Q.catch==="function"?Q.catch:()=>Q.catch,...U0(Q)})};class XX extends q0{_parse(X){if(this._getType(X)!==n.nan){let $=this._getOrReturnCtx(X);return d($,{code:m.invalid_type,expected:n.nan,received:$.parsedType}),J0}return{status:"valid",value:X.data}}}XX.create=(X)=>{return new XX({typeName:H0.ZodNaN,...U0(X)})};var d2=Symbol("zod_brand");class A$ extends q0{_parse(X){let{ctx:Q}=this._processInputParams(X),$=Q.data;return this._def.type._parse({data:$,path:Q.path,parent:Q})}unwrap(){return this._def.type}}class zX extends q0{_parse(X){let{status:Q,ctx:$}=this._processInputParams(X);if($.common.async)return(async()=>{let G=await this._def.in._parseAsync({data:$.data,path:$.path,parent:$});if(G.status==="aborted")return J0;if(G.status==="dirty")return Q.dirty(),q8(G.value);else return this._def.out._parseAsync({data:G.value,path:$.path,parent:$})})();else{let Y=this._def.in._parseSync({data:$.data,path:$.path,parent:$});if(Y.status==="aborted")return J0;if(Y.status==="dirty")return Q.dirty(),{status:"dirty",value:Y.value};else return this._def.out._parseSync({data:Y.value,path:$.path,parent:$})}}static create(X,Q){return new zX({in:X,out:Q,typeName:H0.ZodPipeline})}}class T8 extends q0{_parse(X){let Q=this._def.innerType._parse(X),$=(Y)=>{if(w9(Y))Y.value=Object.freeze(Y.value);return Y};return n6(Q)?Q.then((Y)=>$(Y)):$(Q)}unwrap(){return this._def.innerType}}T8.create=(X,Q)=>{return new T8({innerType:X,typeName:H0.ZodReadonly,...U0(Q)})};var i2={object:C0.lazycreate},H0;(function(X){X.ZodString="ZodString",X.ZodNumber="ZodNumber",X.ZodNaN="ZodNaN",X.ZodBigInt="ZodBigInt",X.ZodBoolean="ZodBoolean",X.ZodDate="ZodDate",X.ZodSymbol="ZodSymbol",X.ZodUndefined="ZodUndefined",X.ZodNull="ZodNull",X.ZodAny="ZodAny",X.ZodUnknown="ZodUnknown",X.ZodNever="ZodNever",X.ZodVoid="ZodVoid",X.ZodArray="ZodArray",X.ZodObject="ZodObject",X.ZodUnion="ZodUnion",X.ZodDiscriminatedUnion="ZodDiscriminatedUnion",X.ZodIntersection="ZodIntersection",X.ZodTuple="ZodTuple",X.ZodRecord="ZodRecord",X.ZodMap="ZodMap",X.ZodSet="ZodSet",X.ZodFunction="ZodFunction",X.ZodLazy="ZodLazy",X.ZodLiteral="ZodLiteral",X.ZodEnum="ZodEnum",X.ZodEffects="ZodEffects",X.ZodNativeEnum="ZodNativeEnum",X.ZodOptional="ZodOptional",X.ZodNullable="ZodNullable",X.ZodDefault="ZodDefault",X.ZodCatch="ZodCatch",X.ZodPromise="ZodPromise",X.ZodBranded="ZodBranded",X.ZodPipeline="ZodPipeline",X.ZodReadonly="ZodReadonly"})(H0||(H0={}));var n2=T1.create,r2=I9.create,o2=XX.create,a2=j9.create,s2=r6.create,t2=D8.create,e2=o6.create,XS=O8.create,QS=Z8.create,$S=a6.create,YS=Q9.create,GS=S1.create,JS=s6.create,HS=M1.create,WS=C0.create,US=C0.strictCreate,zS=A8.create,BS=Z$.create,LS=N8.create,qS=E1.create,FS=t6.create,VS=e6.create,KS=P9.create,MS=V8.create,DS=R8.create,OS=w8.create,ZS=$9.create,AS=I8.create,NS=T9.create,RS=Z1.create,wS=D1.create,IS=c1.create,jS=Z1.createWithPreprocess,PS=zX.create,TS=Object.freeze({status:"aborted"});function y(X,Q,$){function Y(W,U){var z;Object.defineProperty(W,"_zod",{value:W._zod??{},enumerable:!1}),(z=W._zod).traits??(z.traits=new Set),W._zod.traits.add(X),Q(W,U);for(let L in H.prototype)if(!(L in W))Object.defineProperty(W,L,{value:H.prototype[L].bind(W)});W._zod.constr=H,W._zod.def=U}let G=$?.Parent??Object;class J extends G{}Object.defineProperty(J,"name",{value:X});function H(W){var U;let z=$?.Parent?new J:this;Y(z,W),(U=z._zod).deferred??(U.deferred=[]);for(let L of z._zod.deferred)L();return z}return Object.defineProperty(H,"init",{value:Y}),Object.defineProperty(H,Symbol.hasInstance,{value:(W)=>{if($?.Parent&&W instanceof $.Parent)return!0;return W?._zod?.traits?.has(X)}}),Object.defineProperty(H,"name",{value:X}),H}var SS=Symbol("zod_brand");class S9 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var z$={};function b1(X){if(X)Object.assign(z$,X);return z$}var N0={};UY(N0,{unwrapMessage:()=>F8,stringifyPrimitive:()=>w$,required:()=>GA,randomString:()=>nZ,propertyKeyTypes:()=>lY,promiseAllObject:()=>iZ,primitiveTypes:()=>aZ,prefixIssues:()=>l1,pick:()=>eZ,partial:()=>YA,optionalKeys:()=>cY,omit:()=>XA,numKeys:()=>rZ,nullish:()=>LX,normalizeParams:()=>$0,merge:()=>$A,jsonStringifyReplacer:()=>fY,joinValues:()=>B$,issue:()=>dY,isPlainObject:()=>E8,isObject:()=>S8,getSizableOrigin:()=>JA,getParsedType:()=>oZ,getLengthableOrigin:()=>FX,getEnumValues:()=>hY,getElementAtPath:()=>dZ,floatSafeRemainder:()=>uY,finalizeIssue:()=>C1,extend:()=>QA,escapeRegex:()=>k9,esc:()=>A9,defineLazy:()=>R0,createTransparentProxy:()=>sZ,clone:()=>d1,cleanRegex:()=>qX,cleanEnum:()=>HA,captureStackTrace:()=>R$,cached:()=>BX,assignProp:()=>N$,assertNotEqual:()=>mZ,assertNever:()=>cZ,assertIs:()=>lZ,assertEqual:()=>uZ,assert:()=>pZ,allowsEval:()=>mY,aborted:()=>R9,NUMBER_FORMAT_RANGES:()=>pY,Class:()=>iY,BIGINT_FORMAT_RANGES:()=>tZ});function uZ(X){return X}function mZ(X){return X}function lZ(X){}function cZ(X){throw Error()}function pZ(X){}function hY(X){let Q=Object.values(X).filter((Y)=>typeof Y==="number");return Object.entries(X).filter(([Y,G])=>Q.indexOf(+Y)===-1).map(([Y,G])=>G)}function B$(X,Q="|"){return X.map(($)=>w$($)).join(Q)}function fY(X,Q){if(typeof Q==="bigint")return Q.toString();return Q}function BX(X){return{get value(){{let $=X();return Object.defineProperty(this,"value",{value:$}),$}throw Error("cached value already set")}}}function LX(X){return X===null||X===void 0}function qX(X){let Q=X.startsWith("^")?1:0,$=X.endsWith("$")?X.length-1:X.length;return X.slice(Q,$)}function uY(X,Q){let $=(X.toString().split(".")[1]||"").length,Y=(Q.toString().split(".")[1]||"").length,G=$>Y?$:Y,J=Number.parseInt(X.toFixed(G).replace(".","")),H=Number.parseInt(Q.toFixed(G).replace(".",""));return J%H/10**G}function R0(X,Q,$){Object.defineProperty(X,Q,{get(){{let G=$();return X[Q]=G,G}throw Error("cached value already set")},set(G){Object.defineProperty(X,Q,{value:G})},configurable:!0})}function N$(X,Q,$){Object.defineProperty(X,Q,{value:$,writable:!0,enumerable:!0,configurable:!0})}function dZ(X,Q){if(!Q)return X;return Q.reduce(($,Y)=>$?.[Y],X)}function iZ(X){let Q=Object.keys(X),$=Q.map((Y)=>X[Y]);return Promise.all($).then((Y)=>{let G={};for(let J=0;J<Q.length;J++)G[Q[J]]=Y[J];return G})}function nZ(X=10){let $="";for(let Y=0;Y<X;Y++)$+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return $}function A9(X){return JSON.stringify(X)}var R$=Error.captureStackTrace?Error.captureStackTrace:(...X)=>{};function S8(X){return typeof X==="object"&&X!==null&&!Array.isArray(X)}var mY=BX(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(X){return!1}});function E8(X){if(S8(X)===!1)return!1;let Q=X.constructor;if(Q===void 0)return!0;let $=Q.prototype;if(S8($)===!1)return!1;if(Object.prototype.hasOwnProperty.call($,"isPrototypeOf")===!1)return!1;return!0}function rZ(X){let Q=0;for(let $ in X)if(Object.prototype.hasOwnProperty.call(X,$))Q++;return Q}var oZ=(X)=>{let Q=typeof X;switch(Q){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(X)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(X))return"array";if(X===null)return"null";if(X.then&&typeof X.then==="function"&&X.catch&&typeof X.catch==="function")return"promise";if(typeof Map<"u"&&X instanceof Map)return"map";if(typeof Set<"u"&&X instanceof Set)return"set";if(typeof Date<"u"&&X instanceof Date)return"date";if(typeof File<"u"&&X instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${Q}`)}},lY=new Set(["string","number","symbol"]),aZ=new Set(["string","number","bigint","boolean","symbol","undefined"]);function k9(X){return X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d1(X,Q,$){let Y=new X._zod.constr(Q??X._zod.def);if(!Q||$?.parent)Y._zod.parent=X;return Y}function $0(X){let Q=X;if(!Q)return{};if(typeof Q==="string")return{error:()=>Q};if(Q?.message!==void 0){if(Q?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");Q.error=Q.message}if(delete Q.message,typeof Q.error==="string")return{...Q,error:()=>Q.error};return Q}function sZ(X){let Q;return new Proxy({},{get($,Y,G){return Q??(Q=X()),Reflect.get(Q,Y,G)},set($,Y,G,J){return Q??(Q=X()),Reflect.set(Q,Y,G,J)},has($,Y){return Q??(Q=X()),Reflect.has(Q,Y)},deleteProperty($,Y){return Q??(Q=X()),Reflect.deleteProperty(Q,Y)},ownKeys($){return Q??(Q=X()),Reflect.ownKeys(Q)},getOwnPropertyDescriptor($,Y){return Q??(Q=X()),Reflect.getOwnPropertyDescriptor(Q,Y)},defineProperty($,Y,G){return Q??(Q=X()),Reflect.defineProperty(Q,Y,G)}})}function w$(X){if(typeof X==="bigint")return X.toString()+"n";if(typeof X==="string")return`"${X}"`;return`${X}`}function cY(X){return Object.keys(X).filter((Q)=>{return X[Q]._zod.optin==="optional"&&X[Q]._zod.optout==="optional"})}var pY={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},tZ={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function eZ(X,Q){let $={},Y=X._zod.def;for(let G in Q){if(!(G in Y.shape))throw Error(`Unrecognized key: "${G}"`);if(!Q[G])continue;$[G]=Y.shape[G]}return d1(X,{...X._zod.def,shape:$,checks:[]})}function XA(X,Q){let $={...X._zod.def.shape},Y=X._zod.def;for(let G in Q){if(!(G in Y.shape))throw Error(`Unrecognized key: "${G}"`);if(!Q[G])continue;delete $[G]}return d1(X,{...X._zod.def,shape:$,checks:[]})}function QA(X,Q){if(!E8(Q))throw Error("Invalid input to extend: expected a plain object");let $={...X._zod.def,get shape(){let Y={...X._zod.def.shape,...Q};return N$(this,"shape",Y),Y},checks:[]};return d1(X,$)}function $A(X,Q){return d1(X,{...X._zod.def,get shape(){let $={...X._zod.def.shape,...Q._zod.def.shape};return N$(this,"shape",$),$},catchall:Q._zod.def.catchall,checks:[]})}function YA(X,Q,$){let Y=Q._zod.def.shape,G={...Y};if($)for(let J in $){if(!(J in Y))throw Error(`Unrecognized key: "${J}"`);if(!$[J])continue;G[J]=X?new X({type:"optional",innerType:Y[J]}):Y[J]}else for(let J in Y)G[J]=X?new X({type:"optional",innerType:Y[J]}):Y[J];return d1(Q,{...Q._zod.def,shape:G,checks:[]})}function GA(X,Q,$){let Y=Q._zod.def.shape,G={...Y};if($)for(let J in $){if(!(J in G))throw Error(`Unrecognized key: "${J}"`);if(!$[J])continue;G[J]=new X({type:"nonoptional",innerType:Y[J]})}else for(let J in Y)G[J]=new X({type:"nonoptional",innerType:Y[J]});return d1(Q,{...Q._zod.def,shape:G,checks:[]})}function R9(X,Q=0){for(let $=Q;$<X.issues.length;$++)if(X.issues[$]?.continue!==!0)return!0;return!1}function l1(X,Q){return Q.map(($)=>{var Y;return(Y=$).path??(Y.path=[]),$.path.unshift(X),$})}function F8(X){return typeof X==="string"?X:X?.message}function C1(X,Q,$){let Y={...X,path:X.path??[]};if(!X.message){let G=F8(X.inst?._zod.def?.error?.(X))??F8(Q?.error?.(X))??F8($.customError?.(X))??F8($.localeError?.(X))??"Invalid input";Y.message=G}if(delete Y.inst,delete Y.continue,!Q?.reportInput)delete Y.input;return Y}function JA(X){if(X instanceof Set)return"set";if(X instanceof Map)return"map";if(X instanceof File)return"file";return"unknown"}function FX(X){if(Array.isArray(X))return"array";if(typeof X==="string")return"string";return"unknown"}function dY(...X){let[Q,$,Y]=X;if(typeof Q==="string")return{message:Q,code:"custom",input:$,inst:Y};return{...Q}}function HA(X){return Object.entries(X).filter(([Q,$])=>{return Number.isNaN(Number.parseInt(Q,10))}).map((Q)=>Q[1])}class iY{constructor(...X){}}var nY=(X,Q)=>{X.name="$ZodError",Object.defineProperty(X,"_zod",{value:X._zod,enumerable:!1}),Object.defineProperty(X,"issues",{value:Q,enumerable:!1}),Object.defineProperty(X,"message",{get(){return JSON.stringify(Q,fY,2)},enumerable:!0})},rY=y("$ZodError",nY),oY=y("$ZodError",nY,{Parent:Error});function WA(X,Q=($)=>$.message){let $={},Y=[];for(let G of X.issues)if(G.path.length>0)$[G.path[0]]=$[G.path[0]]||[],$[G.path[0]].push(Q(G));else Y.push(Q(G));return{formErrors:Y,fieldErrors:$}}function UA(X,Q){let $=Q||function(J){return J.message},Y={_errors:[]},G=(J)=>{for(let H of J.issues)if(H.code==="invalid_union"&&H.errors.length)H.errors.map((W)=>G({issues:W}));else if(H.code==="invalid_key")G({issues:H.issues});else if(H.code==="invalid_element")G({issues:H.issues});else if(H.path.length===0)Y._errors.push($(H));else{let W=Y,U=0;while(U<H.path.length){let z=H.path[U];if(U!==H.path.length-1)W[z]=W[z]||{_errors:[]};else W[z]=W[z]||{_errors:[]},W[z]._errors.push($(H));W=W[z],U++}}};return G(X),Y}var zA=(X)=>(Q,$,Y,G)=>{let J=Y?Object.assign(Y,{async:!1}):{async:!1},H=Q._zod.run({value:$,issues:[]},J);if(H instanceof Promise)throw new S9;if(H.issues.length){let W=new(G?.Err??X)(H.issues.map((U)=>C1(U,J,b1())));throw R$(W,G?.callee),W}return H.value};var BA=(X)=>async(Q,$,Y,G)=>{let J=Y?Object.assign(Y,{async:!0}):{async:!0},H=Q._zod.run({value:$,issues:[]},J);if(H instanceof Promise)H=await H;if(H.issues.length){let W=new(G?.Err??X)(H.issues.map((U)=>C1(U,J,b1())));throw R$(W,G?.callee),W}return H.value};var aY=(X)=>(Q,$,Y)=>{let G=Y?{...Y,async:!1}:{async:!1},J=Q._zod.run({value:$,issues:[]},G);if(J instanceof Promise)throw new S9;return J.issues.length?{success:!1,error:new(X??rY)(J.issues.map((H)=>C1(H,G,b1())))}:{success:!0,data:J.value}},LA=aY(oY),sY=(X)=>async(Q,$,Y)=>{let G=Y?Object.assign(Y,{async:!0}):{async:!0},J=Q._zod.run({value:$,issues:[]},G);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new X(J.issues.map((H)=>C1(H,G,b1())))}:{success:!0,data:J.value}},qA=sY(oY),FA=/^[cC][^\s-]{8,}$/,VA=/^[0-9a-z]+$/,KA=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,MA=/^[0-9a-vA-V]{20}$/,DA=/^[A-Za-z0-9]{27}$/,OA=/^[a-zA-Z0-9_-]{21}$/,ZA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,AA=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,l7=(X)=>{if(!X)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${X}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},NA=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,RA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function wA(){return new RegExp(RA,"u")}var IA=/^(?:(?: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])$/,jA=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,PA=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,TA=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,SA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tY=/^[A-Za-z0-9_-]*$/,EA=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,bA=/^\+(?:[0-9]){6,14}[0-9]$/,eY="(?:(?:\\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])))",CA=new RegExp(`^${eY}$`);function XG(X){return typeof X.precision==="number"?X.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":X.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${X.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function _A(X){return new RegExp(`^${XG(X)}$`)}function kA(X){let Q=XG({precision:X.precision}),$=["Z"];if(X.local)$.push("");if(X.offset)$.push("([+-]\\d{2}:\\d{2})");let Y=`${Q}(?:${$.join("|")})`;return new RegExp(`^${eY}T(?:${Y})$`)}var vA=(X)=>{let Q=X?`[\\s\\S]{${X?.minimum??0},${X?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Q}$`)},yA=/^\d+$/,xA=/^-?\d+(?:\.\d+)?/i,gA=/true|false/i,hA=/null/i,fA=/^[^A-Z]*$/,uA=/^[^a-z]*$/,o0=y("$ZodCheck",(X,Q)=>{var $;X._zod??(X._zod={}),X._zod.def=Q,($=X._zod).onattach??($.onattach=[])}),QG={number:"number",bigint:"bigint",object:"date"},$G=y("$ZodCheckLessThan",(X,Q)=>{o0.init(X,Q);let $=QG[typeof Q.value];X._zod.onattach.push((Y)=>{let G=Y._zod.bag,J=(Q.inclusive?G.maximum:G.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(Q.value<J)if(Q.inclusive)G.maximum=Q.value;else G.exclusiveMaximum=Q.value}),X._zod.check=(Y)=>{if(Q.inclusive?Y.value<=Q.value:Y.value<Q.value)return;Y.issues.push({origin:$,code:"too_big",maximum:Q.value,input:Y.value,inclusive:Q.inclusive,inst:X,continue:!Q.abort})}}),YG=y("$ZodCheckGreaterThan",(X,Q)=>{o0.init(X,Q);let $=QG[typeof Q.value];X._zod.onattach.push((Y)=>{let G=Y._zod.bag,J=(Q.inclusive?G.minimum:G.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(Q.value>J)if(Q.inclusive)G.minimum=Q.value;else G.exclusiveMinimum=Q.value}),X._zod.check=(Y)=>{if(Q.inclusive?Y.value>=Q.value:Y.value>Q.value)return;Y.issues.push({origin:$,code:"too_small",minimum:Q.value,input:Y.value,inclusive:Q.inclusive,inst:X,continue:!Q.abort})}}),mA=y("$ZodCheckMultipleOf",(X,Q)=>{o0.init(X,Q),X._zod.onattach.push(($)=>{var Y;(Y=$._zod.bag).multipleOf??(Y.multipleOf=Q.value)}),X._zod.check=($)=>{if(typeof $.value!==typeof Q.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof $.value==="bigint"?$.value%Q.value===BigInt(0):uY($.value,Q.value)===0)return;$.issues.push({origin:typeof $.value,code:"not_multiple_of",divisor:Q.value,input:$.value,inst:X,continue:!Q.abort})}}),lA=y("$ZodCheckNumberFormat",(X,Q)=>{o0.init(X,Q),Q.format=Q.format||"float64";let $=Q.format?.includes("int"),Y=$?"int":"number",[G,J]=pY[Q.format];X._zod.onattach.push((H)=>{let W=H._zod.bag;if(W.format=Q.format,W.minimum=G,W.maximum=J,$)W.pattern=yA}),X._zod.check=(H)=>{let W=H.value;if($){if(!Number.isInteger(W)){H.issues.push({expected:Y,format:Q.format,code:"invalid_type",input:W,inst:X});return}if(!Number.isSafeInteger(W)){if(W>0)H.issues.push({input:W,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:X,origin:Y,continue:!Q.abort});else H.issues.push({input:W,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:X,origin:Y,continue:!Q.abort});return}}if(W<G)H.issues.push({origin:"number",input:W,code:"too_small",minimum:G,inclusive:!0,inst:X,continue:!Q.abort});if(W>J)H.issues.push({origin:"number",input:W,code:"too_big",maximum:J,inst:X})}}),cA=y("$ZodCheckMaxLength",(X,Q)=>{o0.init(X,Q),X._zod.when=($)=>{let Y=$.value;return!LX(Y)&&Y.length!==void 0},X._zod.onattach.push(($)=>{let Y=$._zod.bag.maximum??Number.POSITIVE_INFINITY;if(Q.maximum<Y)$._zod.bag.maximum=Q.maximum}),X._zod.check=($)=>{let Y=$.value;if(Y.length<=Q.maximum)return;let J=FX(Y);$.issues.push({origin:J,code:"too_big",maximum:Q.maximum,inclusive:!0,input:Y,inst:X,continue:!Q.abort})}}),pA=y("$ZodCheckMinLength",(X,Q)=>{o0.init(X,Q),X._zod.when=($)=>{let Y=$.value;return!LX(Y)&&Y.length!==void 0},X._zod.onattach.push(($)=>{let Y=$._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(Q.minimum>Y)$._zod.bag.minimum=Q.minimum}),X._zod.check=($)=>{let Y=$.value;if(Y.length>=Q.minimum)return;let J=FX(Y);$.issues.push({origin:J,code:"too_small",minimum:Q.minimum,inclusive:!0,input:Y,inst:X,continue:!Q.abort})}}),dA=y("$ZodCheckLengthEquals",(X,Q)=>{o0.init(X,Q),X._zod.when=($)=>{let Y=$.value;return!LX(Y)&&Y.length!==void 0},X._zod.onattach.push(($)=>{let Y=$._zod.bag;Y.minimum=Q.length,Y.maximum=Q.length,Y.length=Q.length}),X._zod.check=($)=>{let Y=$.value,G=Y.length;if(G===Q.length)return;let J=FX(Y),H=G>Q.length;$.issues.push({origin:J,...H?{code:"too_big",maximum:Q.length}:{code:"too_small",minimum:Q.length},inclusive:!0,exact:!0,input:$.value,inst:X,continue:!Q.abort})}}),VX=y("$ZodCheckStringFormat",(X,Q)=>{var $,Y;if(o0.init(X,Q),X._zod.onattach.push((G)=>{let J=G._zod.bag;if(J.format=Q.format,Q.pattern)J.patterns??(J.patterns=new Set),J.patterns.add(Q.pattern)}),Q.pattern)($=X._zod).check??($.check=(G)=>{if(Q.pattern.lastIndex=0,Q.pattern.test(G.value))return;G.issues.push({origin:"string",code:"invalid_format",format:Q.format,input:G.value,...Q.pattern?{pattern:Q.pattern.toString()}:{},inst:X,continue:!Q.abort})});else(Y=X._zod).check??(Y.check=()=>{})}),iA=y("$ZodCheckRegex",(X,Q)=>{VX.init(X,Q),X._zod.check=($)=>{if(Q.pattern.lastIndex=0,Q.pattern.test($.value))return;$.issues.push({origin:"string",code:"invalid_format",format:"regex",input:$.value,pattern:Q.pattern.toString(),inst:X,continue:!Q.abort})}}),nA=y("$ZodCheckLowerCase",(X,Q)=>{Q.pattern??(Q.pattern=fA),VX.init(X,Q)}),rA=y("$ZodCheckUpperCase",(X,Q)=>{Q.pattern??(Q.pattern=uA),VX.init(X,Q)}),oA=y("$ZodCheckIncludes",(X,Q)=>{o0.init(X,Q);let $=k9(Q.includes),Y=new RegExp(typeof Q.position==="number"?`^.{${Q.position}}${$}`:$);Q.pattern=Y,X._zod.onattach.push((G)=>{let J=G._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(Y)}),X._zod.check=(G)=>{if(G.value.includes(Q.includes,Q.position))return;G.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:Q.includes,input:G.value,inst:X,continue:!Q.abort})}}),aA=y("$ZodCheckStartsWith",(X,Q)=>{o0.init(X,Q);let $=new RegExp(`^${k9(Q.prefix)}.*`);Q.pattern??(Q.pattern=$),X._zod.onattach.push((Y)=>{let G=Y._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add($)}),X._zod.check=(Y)=>{if(Y.value.startsWith(Q.prefix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:Q.prefix,input:Y.value,inst:X,continue:!Q.abort})}}),sA=y("$ZodCheckEndsWith",(X,Q)=>{o0.init(X,Q);let $=new RegExp(`.*${k9(Q.suffix)}$`);Q.pattern??(Q.pattern=$),X._zod.onattach.push((Y)=>{let G=Y._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add($)}),X._zod.check=(Y)=>{if(Y.value.endsWith(Q.suffix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:Q.suffix,input:Y.value,inst:X,continue:!Q.abort})}}),tA=y("$ZodCheckOverwrite",(X,Q)=>{o0.init(X,Q),X._zod.check=($)=>{$.value=Q.tx($.value)}});class GG{constructor(X=[]){if(this.content=[],this.indent=0,this)this.args=X}indented(X){this.indent+=1,X(this),this.indent-=1}write(X){if(typeof X==="function"){X(this,{execution:"sync"}),X(this,{execution:"async"});return}let $=X.split(`
|
|
203
|
-
`).filter((J)=>J),Y=Math.min(...$.map((J)=>J.length-J.trimStart().length)),G=$.map((J)=>J.slice(Y)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of G)this.content.push(J)}compile(){let X=Function,Q=this?.args,Y=[...(this?.content??[""]).map((G)=>` ${G}`)];return new X(...Q,Y.join(`
|
|
204
|
-
`))}}var eA={major:4,minor:0,patch:0},w0=y("$ZodType",(X,Q)=>{var $;X??(X={}),X._zod.def=Q,X._zod.bag=X._zod.bag||{},X._zod.version=eA;let Y=[...X._zod.def.checks??[]];if(X._zod.traits.has("$ZodCheck"))Y.unshift(X);for(let G of Y)for(let J of G._zod.onattach)J(X);if(Y.length===0)($=X._zod).deferred??($.deferred=[]),X._zod.deferred?.push(()=>{X._zod.run=X._zod.parse});else{let G=(J,H,W)=>{let U=R9(J),z;for(let L of H){if(L._zod.when){if(!L._zod.when(J))continue}else if(U)continue;let B=J.issues.length,F=L._zod.check(J);if(F instanceof Promise&&W?.async===!1)throw new S9;if(z||F instanceof Promise)z=(z??Promise.resolve()).then(async()=>{if(await F,J.issues.length===B)return;if(!U)U=R9(J,B)});else{if(J.issues.length===B)continue;if(!U)U=R9(J,B)}}if(z)return z.then(()=>{return J});return J};X._zod.run=(J,H)=>{let W=X._zod.parse(J,H);if(W instanceof Promise){if(H.async===!1)throw new S9;return W.then((U)=>G(U,Y,H))}return G(W,Y,H)}}X["~standard"]={validate:(G)=>{try{let J=LA(X,G);return J.success?{value:J.data}:{issues:J.error?.issues}}catch(J){return qA(X,G).then((H)=>H.success?{value:H.data}:{issues:H.error?.issues})}},vendor:"zod",version:1}}),I$=y("$ZodString",(X,Q)=>{w0.init(X,Q),X._zod.pattern=[...X?._zod.bag?.patterns??[]].pop()??vA(X._zod.bag),X._zod.parse=($,Y)=>{if(Q.coerce)try{$.value=String($.value)}catch(G){}if(typeof $.value==="string")return $;return $.issues.push({expected:"string",code:"invalid_type",input:$.value,inst:X}),$}}),I0=y("$ZodStringFormat",(X,Q)=>{VX.init(X,Q),I$.init(X,Q)}),XN=y("$ZodGUID",(X,Q)=>{Q.pattern??(Q.pattern=AA),I0.init(X,Q)}),QN=y("$ZodUUID",(X,Q)=>{if(Q.version){let Y={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[Q.version];if(Y===void 0)throw Error(`Invalid UUID version: "${Q.version}"`);Q.pattern??(Q.pattern=l7(Y))}else Q.pattern??(Q.pattern=l7());I0.init(X,Q)}),$N=y("$ZodEmail",(X,Q)=>{Q.pattern??(Q.pattern=NA),I0.init(X,Q)}),YN=y("$ZodURL",(X,Q)=>{I0.init(X,Q),X._zod.check=($)=>{try{let Y=$.value,G=new URL(Y),J=G.href;if(Q.hostname){if(Q.hostname.lastIndex=0,!Q.hostname.test(G.hostname))$.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:EA.source,input:$.value,inst:X,continue:!Q.abort})}if(Q.protocol){if(Q.protocol.lastIndex=0,!Q.protocol.test(G.protocol.endsWith(":")?G.protocol.slice(0,-1):G.protocol))$.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:Q.protocol.source,input:$.value,inst:X,continue:!Q.abort})}if(!Y.endsWith("/")&&J.endsWith("/"))$.value=J.slice(0,-1);else $.value=J;return}catch(Y){$.issues.push({code:"invalid_format",format:"url",input:$.value,inst:X,continue:!Q.abort})}}}),GN=y("$ZodEmoji",(X,Q)=>{Q.pattern??(Q.pattern=wA()),I0.init(X,Q)}),JN=y("$ZodNanoID",(X,Q)=>{Q.pattern??(Q.pattern=OA),I0.init(X,Q)}),HN=y("$ZodCUID",(X,Q)=>{Q.pattern??(Q.pattern=FA),I0.init(X,Q)}),WN=y("$ZodCUID2",(X,Q)=>{Q.pattern??(Q.pattern=VA),I0.init(X,Q)}),UN=y("$ZodULID",(X,Q)=>{Q.pattern??(Q.pattern=KA),I0.init(X,Q)}),zN=y("$ZodXID",(X,Q)=>{Q.pattern??(Q.pattern=MA),I0.init(X,Q)}),BN=y("$ZodKSUID",(X,Q)=>{Q.pattern??(Q.pattern=DA),I0.init(X,Q)}),LN=y("$ZodISODateTime",(X,Q)=>{Q.pattern??(Q.pattern=kA(Q)),I0.init(X,Q)}),qN=y("$ZodISODate",(X,Q)=>{Q.pattern??(Q.pattern=CA),I0.init(X,Q)}),FN=y("$ZodISOTime",(X,Q)=>{Q.pattern??(Q.pattern=_A(Q)),I0.init(X,Q)}),VN=y("$ZodISODuration",(X,Q)=>{Q.pattern??(Q.pattern=ZA),I0.init(X,Q)}),KN=y("$ZodIPv4",(X,Q)=>{Q.pattern??(Q.pattern=IA),I0.init(X,Q),X._zod.onattach.push(($)=>{let Y=$._zod.bag;Y.format="ipv4"})}),MN=y("$ZodIPv6",(X,Q)=>{Q.pattern??(Q.pattern=jA),I0.init(X,Q),X._zod.onattach.push(($)=>{let Y=$._zod.bag;Y.format="ipv6"}),X._zod.check=($)=>{try{new URL(`http://[${$.value}]`)}catch{$.issues.push({code:"invalid_format",format:"ipv6",input:$.value,inst:X,continue:!Q.abort})}}}),DN=y("$ZodCIDRv4",(X,Q)=>{Q.pattern??(Q.pattern=PA),I0.init(X,Q)}),ON=y("$ZodCIDRv6",(X,Q)=>{Q.pattern??(Q.pattern=TA),I0.init(X,Q),X._zod.check=($)=>{let[Y,G]=$.value.split("/");try{if(!G)throw Error();let J=Number(G);if(`${J}`!==G)throw Error();if(J<0||J>128)throw Error();new URL(`http://[${Y}]`)}catch{$.issues.push({code:"invalid_format",format:"cidrv6",input:$.value,inst:X,continue:!Q.abort})}}});function JG(X){if(X==="")return!0;if(X.length%4!==0)return!1;try{return atob(X),!0}catch{return!1}}var ZN=y("$ZodBase64",(X,Q)=>{Q.pattern??(Q.pattern=SA),I0.init(X,Q),X._zod.onattach.push(($)=>{$._zod.bag.contentEncoding="base64"}),X._zod.check=($)=>{if(JG($.value))return;$.issues.push({code:"invalid_format",format:"base64",input:$.value,inst:X,continue:!Q.abort})}});function AN(X){if(!tY.test(X))return!1;let Q=X.replace(/[-_]/g,(Y)=>Y==="-"?"+":"/"),$=Q.padEnd(Math.ceil(Q.length/4)*4,"=");return JG($)}var NN=y("$ZodBase64URL",(X,Q)=>{Q.pattern??(Q.pattern=tY),I0.init(X,Q),X._zod.onattach.push(($)=>{$._zod.bag.contentEncoding="base64url"}),X._zod.check=($)=>{if(AN($.value))return;$.issues.push({code:"invalid_format",format:"base64url",input:$.value,inst:X,continue:!Q.abort})}}),RN=y("$ZodE164",(X,Q)=>{Q.pattern??(Q.pattern=bA),I0.init(X,Q)});function wN(X,Q=null){try{let $=X.split(".");if($.length!==3)return!1;let[Y]=$;if(!Y)return!1;let G=JSON.parse(atob(Y));if("typ"in G&&G?.typ!=="JWT")return!1;if(!G.alg)return!1;if(Q&&(!("alg"in G)||G.alg!==Q))return!1;return!0}catch{return!1}}var IN=y("$ZodJWT",(X,Q)=>{I0.init(X,Q),X._zod.check=($)=>{if(wN($.value,Q.alg))return;$.issues.push({code:"invalid_format",format:"jwt",input:$.value,inst:X,continue:!Q.abort})}}),HG=y("$ZodNumber",(X,Q)=>{w0.init(X,Q),X._zod.pattern=X._zod.bag.pattern??xA,X._zod.parse=($,Y)=>{if(Q.coerce)try{$.value=Number($.value)}catch(H){}let G=$.value;if(typeof G==="number"&&!Number.isNaN(G)&&Number.isFinite(G))return $;let J=typeof G==="number"?Number.isNaN(G)?"NaN":!Number.isFinite(G)?"Infinity":void 0:void 0;return $.issues.push({expected:"number",code:"invalid_type",input:G,inst:X,...J?{received:J}:{}}),$}}),jN=y("$ZodNumber",(X,Q)=>{lA.init(X,Q),HG.init(X,Q)}),PN=y("$ZodBoolean",(X,Q)=>{w0.init(X,Q),X._zod.pattern=gA,X._zod.parse=($,Y)=>{if(Q.coerce)try{$.value=Boolean($.value)}catch(J){}let G=$.value;if(typeof G==="boolean")return $;return $.issues.push({expected:"boolean",code:"invalid_type",input:G,inst:X}),$}}),TN=y("$ZodNull",(X,Q)=>{w0.init(X,Q),X._zod.pattern=hA,X._zod.values=new Set([null]),X._zod.parse=($,Y)=>{let G=$.value;if(G===null)return $;return $.issues.push({expected:"null",code:"invalid_type",input:G,inst:X}),$}}),SN=y("$ZodUnknown",(X,Q)=>{w0.init(X,Q),X._zod.parse=($)=>$}),EN=y("$ZodNever",(X,Q)=>{w0.init(X,Q),X._zod.parse=($,Y)=>{return $.issues.push({expected:"never",code:"invalid_type",input:$.value,inst:X}),$}});function c7(X,Q,$){if(X.issues.length)Q.issues.push(...l1($,X.issues));Q.value[$]=X.value}var bN=y("$ZodArray",(X,Q)=>{w0.init(X,Q),X._zod.parse=($,Y)=>{let G=$.value;if(!Array.isArray(G))return $.issues.push({expected:"array",code:"invalid_type",input:G,inst:X}),$;$.value=Array(G.length);let J=[];for(let H=0;H<G.length;H++){let W=G[H],U=Q.element._zod.run({value:W,issues:[]},Y);if(U instanceof Promise)J.push(U.then((z)=>c7(z,$,H)));else c7(U,$,H)}if(J.length)return Promise.all(J).then(()=>$);return $}});function m6(X,Q,$){if(X.issues.length)Q.issues.push(...l1($,X.issues));Q.value[$]=X.value}function p7(X,Q,$,Y){if(X.issues.length)if(Y[$]===void 0)if($ in Y)Q.value[$]=void 0;else Q.value[$]=X.value;else Q.issues.push(...l1($,X.issues));else if(X.value===void 0){if($ in Y)Q.value[$]=void 0}else Q.value[$]=X.value}var CN=y("$ZodObject",(X,Q)=>{w0.init(X,Q);let $=BX(()=>{let B=Object.keys(Q.shape);for(let Z of B)if(!(Q.shape[Z]instanceof w0))throw Error(`Invalid element at key "${Z}": expected a Zod schema`);let F=cY(Q.shape);return{shape:Q.shape,keys:B,keySet:new Set(B),numKeys:B.length,optionalKeys:new Set(F)}});R0(X._zod,"propValues",()=>{let B=Q.shape,F={};for(let Z in B){let I=B[Z]._zod;if(I.values){F[Z]??(F[Z]=new Set);for(let A of I.values)F[Z].add(A)}}return F});let Y=(B)=>{let F=new GG(["shape","payload","ctx"]),Z=$.value,I=(M)=>{let K=A9(M);return`shape[${K}]._zod.run({ value: input[${K}], issues: [] }, ctx)`};F.write("const input = payload.value;");let A=Object.create(null),D=0;for(let M of Z.keys)A[M]=`key_${D++}`;F.write("const newResult = {}");for(let M of Z.keys)if(Z.optionalKeys.has(M)){let K=A[M];F.write(`const ${K} = ${I(M)};`);let V=A9(M);F.write(`
|
|
205
|
-
if (${K}.issues.length) {
|
|
206
|
-
if (input[${V}] === undefined) {
|
|
207
|
-
if (${V} in input) {
|
|
208
|
-
newResult[${V}] = undefined;
|
|
209
|
-
}
|
|
210
|
-
} else {
|
|
211
|
-
payload.issues = payload.issues.concat(
|
|
212
|
-
${K}.issues.map((iss) => ({
|
|
213
|
-
...iss,
|
|
214
|
-
path: iss.path ? [${V}, ...iss.path] : [${V}],
|
|
215
|
-
}))
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
} else if (${K}.value === undefined) {
|
|
219
|
-
if (${V} in input) newResult[${V}] = undefined;
|
|
220
|
-
} else {
|
|
221
|
-
newResult[${V}] = ${K}.value;
|
|
222
|
-
}
|
|
223
|
-
`)}else{let K=A[M];F.write(`const ${K} = ${I(M)};`),F.write(`
|
|
224
|
-
if (${K}.issues.length) payload.issues = payload.issues.concat(${K}.issues.map(iss => ({
|
|
225
|
-
...iss,
|
|
226
|
-
path: iss.path ? [${A9(M)}, ...iss.path] : [${A9(M)}]
|
|
227
|
-
})));`),F.write(`newResult[${A9(M)}] = ${K}.value`)}F.write("payload.value = newResult;"),F.write("return payload;");let q=F.compile();return(M,K)=>q(B,M,K)},G,J=S8,H=!z$.jitless,U=H&&mY.value,z=Q.catchall,L;X._zod.parse=(B,F)=>{L??(L=$.value);let Z=B.value;if(!J(Z))return B.issues.push({expected:"object",code:"invalid_type",input:Z,inst:X}),B;let I=[];if(H&&U&&F?.async===!1&&F.jitless!==!0){if(!G)G=Y(Q.shape);B=G(B,F)}else{B.value={};let K=L.shape;for(let V of L.keys){let N=K[V],O=N._zod.run({value:Z[V],issues:[]},F),w=N._zod.optin==="optional"&&N._zod.optout==="optional";if(O instanceof Promise)I.push(O.then((j)=>w?p7(j,B,V,Z):m6(j,B,V)));else if(w)p7(O,B,V,Z);else m6(O,B,V)}}if(!z)return I.length?Promise.all(I).then(()=>B):B;let A=[],D=L.keySet,q=z._zod,M=q.def.type;for(let K of Object.keys(Z)){if(D.has(K))continue;if(M==="never"){A.push(K);continue}let V=q.run({value:Z[K],issues:[]},F);if(V instanceof Promise)I.push(V.then((N)=>m6(N,B,K)));else m6(V,B,K)}if(A.length)B.issues.push({code:"unrecognized_keys",keys:A,input:Z,inst:X});if(!I.length)return B;return Promise.all(I).then(()=>{return B})}});function d7(X,Q,$,Y){for(let G of X)if(G.issues.length===0)return Q.value=G.value,Q;return Q.issues.push({code:"invalid_union",input:Q.value,inst:$,errors:X.map((G)=>G.issues.map((J)=>C1(J,Y,b1())))}),Q}var WG=y("$ZodUnion",(X,Q)=>{w0.init(X,Q),R0(X._zod,"optin",()=>Q.options.some(($)=>$._zod.optin==="optional")?"optional":void 0),R0(X._zod,"optout",()=>Q.options.some(($)=>$._zod.optout==="optional")?"optional":void 0),R0(X._zod,"values",()=>{if(Q.options.every(($)=>$._zod.values))return new Set(Q.options.flatMap(($)=>Array.from($._zod.values)));return}),R0(X._zod,"pattern",()=>{if(Q.options.every(($)=>$._zod.pattern)){let $=Q.options.map((Y)=>Y._zod.pattern);return new RegExp(`^(${$.map((Y)=>qX(Y.source)).join("|")})$`)}return}),X._zod.parse=($,Y)=>{let G=!1,J=[];for(let H of Q.options){let W=H._zod.run({value:$.value,issues:[]},Y);if(W instanceof Promise)J.push(W),G=!0;else{if(W.issues.length===0)return W;J.push(W)}}if(!G)return d7(J,$,X,Y);return Promise.all(J).then((H)=>{return d7(H,$,X,Y)})}}),_N=y("$ZodDiscriminatedUnion",(X,Q)=>{WG.init(X,Q);let $=X._zod.parse;R0(X._zod,"propValues",()=>{let G={};for(let J of Q.options){let H=J._zod.propValues;if(!H||Object.keys(H).length===0)throw Error(`Invalid discriminated union option at index "${Q.options.indexOf(J)}"`);for(let[W,U]of Object.entries(H)){if(!G[W])G[W]=new Set;for(let z of U)G[W].add(z)}}return G});let Y=BX(()=>{let G=Q.options,J=new Map;for(let H of G){let W=H._zod.propValues[Q.discriminator];if(!W||W.size===0)throw Error(`Invalid discriminated union option at index "${Q.options.indexOf(H)}"`);for(let U of W){if(J.has(U))throw Error(`Duplicate discriminator value "${String(U)}"`);J.set(U,H)}}return J});X._zod.parse=(G,J)=>{let H=G.value;if(!S8(H))return G.issues.push({code:"invalid_type",expected:"object",input:H,inst:X}),G;let W=Y.value.get(H?.[Q.discriminator]);if(W)return W._zod.run(G,J);if(Q.unionFallback)return $(G,J);return G.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:H,path:[Q.discriminator],inst:X}),G}}),kN=y("$ZodIntersection",(X,Q)=>{w0.init(X,Q),X._zod.parse=($,Y)=>{let G=$.value,J=Q.left._zod.run({value:G,issues:[]},Y),H=Q.right._zod.run({value:G,issues:[]},Y);if(J instanceof Promise||H instanceof Promise)return Promise.all([J,H]).then(([U,z])=>{return i7($,U,z)});return i7($,J,H)}});function L$(X,Q){if(X===Q)return{valid:!0,data:X};if(X instanceof Date&&Q instanceof Date&&+X===+Q)return{valid:!0,data:X};if(E8(X)&&E8(Q)){let $=Object.keys(Q),Y=Object.keys(X).filter((J)=>$.indexOf(J)!==-1),G={...X,...Q};for(let J of Y){let H=L$(X[J],Q[J]);if(!H.valid)return{valid:!1,mergeErrorPath:[J,...H.mergeErrorPath]};G[J]=H.data}return{valid:!0,data:G}}if(Array.isArray(X)&&Array.isArray(Q)){if(X.length!==Q.length)return{valid:!1,mergeErrorPath:[]};let $=[];for(let Y=0;Y<X.length;Y++){let G=X[Y],J=Q[Y],H=L$(G,J);if(!H.valid)return{valid:!1,mergeErrorPath:[Y,...H.mergeErrorPath]};$.push(H.data)}return{valid:!0,data:$}}return{valid:!1,mergeErrorPath:[]}}function i7(X,Q,$){if(Q.issues.length)X.issues.push(...Q.issues);if($.issues.length)X.issues.push(...$.issues);if(R9(X))return X;let Y=L$(Q.value,$.value);if(!Y.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);return X.value=Y.data,X}var vN=y("$ZodRecord",(X,Q)=>{w0.init(X,Q),X._zod.parse=($,Y)=>{let G=$.value;if(!E8(G))return $.issues.push({expected:"record",code:"invalid_type",input:G,inst:X}),$;let J=[];if(Q.keyType._zod.values){let H=Q.keyType._zod.values;$.value={};for(let U of H)if(typeof U==="string"||typeof U==="number"||typeof U==="symbol"){let z=Q.valueType._zod.run({value:G[U],issues:[]},Y);if(z instanceof Promise)J.push(z.then((L)=>{if(L.issues.length)$.issues.push(...l1(U,L.issues));$.value[U]=L.value}));else{if(z.issues.length)$.issues.push(...l1(U,z.issues));$.value[U]=z.value}}let W;for(let U in G)if(!H.has(U))W=W??[],W.push(U);if(W&&W.length>0)$.issues.push({code:"unrecognized_keys",input:G,inst:X,keys:W})}else{$.value={};for(let H of Reflect.ownKeys(G)){if(H==="__proto__")continue;let W=Q.keyType._zod.run({value:H,issues:[]},Y);if(W instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(W.issues.length){$.issues.push({origin:"record",code:"invalid_key",issues:W.issues.map((z)=>C1(z,Y,b1())),input:H,path:[H],inst:X}),$.value[W.value]=W.value;continue}let U=Q.valueType._zod.run({value:G[H],issues:[]},Y);if(U instanceof Promise)J.push(U.then((z)=>{if(z.issues.length)$.issues.push(...l1(H,z.issues));$.value[W.value]=z.value}));else{if(U.issues.length)$.issues.push(...l1(H,U.issues));$.value[W.value]=U.value}}}if(J.length)return Promise.all(J).then(()=>$);return $}}),yN=y("$ZodEnum",(X,Q)=>{w0.init(X,Q);let $=hY(Q.entries);X._zod.values=new Set($),X._zod.pattern=new RegExp(`^(${$.filter((Y)=>lY.has(typeof Y)).map((Y)=>typeof Y==="string"?k9(Y):Y.toString()).join("|")})$`),X._zod.parse=(Y,G)=>{let J=Y.value;if(X._zod.values.has(J))return Y;return Y.issues.push({code:"invalid_value",values:$,input:J,inst:X}),Y}}),xN=y("$ZodLiteral",(X,Q)=>{w0.init(X,Q),X._zod.values=new Set(Q.values),X._zod.pattern=new RegExp(`^(${Q.values.map(($)=>typeof $==="string"?k9($):$?$.toString():String($)).join("|")})$`),X._zod.parse=($,Y)=>{let G=$.value;if(X._zod.values.has(G))return $;return $.issues.push({code:"invalid_value",values:Q.values,input:G,inst:X}),$}}),gN=y("$ZodTransform",(X,Q)=>{w0.init(X,Q),X._zod.parse=($,Y)=>{let G=Q.transform($.value,$);if(Y.async)return(G instanceof Promise?G:Promise.resolve(G)).then((H)=>{return $.value=H,$});if(G instanceof Promise)throw new S9;return $.value=G,$}}),hN=y("$ZodOptional",(X,Q)=>{w0.init(X,Q),X._zod.optin="optional",X._zod.optout="optional",R0(X._zod,"values",()=>{return Q.innerType._zod.values?new Set([...Q.innerType._zod.values,void 0]):void 0}),R0(X._zod,"pattern",()=>{let $=Q.innerType._zod.pattern;return $?new RegExp(`^(${qX($.source)})?$`):void 0}),X._zod.parse=($,Y)=>{if(Q.innerType._zod.optin==="optional")return Q.innerType._zod.run($,Y);if($.value===void 0)return $;return Q.innerType._zod.run($,Y)}}),fN=y("$ZodNullable",(X,Q)=>{w0.init(X,Q),R0(X._zod,"optin",()=>Q.innerType._zod.optin),R0(X._zod,"optout",()=>Q.innerType._zod.optout),R0(X._zod,"pattern",()=>{let $=Q.innerType._zod.pattern;return $?new RegExp(`^(${qX($.source)}|null)$`):void 0}),R0(X._zod,"values",()=>{return Q.innerType._zod.values?new Set([...Q.innerType._zod.values,null]):void 0}),X._zod.parse=($,Y)=>{if($.value===null)return $;return Q.innerType._zod.run($,Y)}}),uN=y("$ZodDefault",(X,Q)=>{w0.init(X,Q),X._zod.optin="optional",R0(X._zod,"values",()=>Q.innerType._zod.values),X._zod.parse=($,Y)=>{if($.value===void 0)return $.value=Q.defaultValue,$;let G=Q.innerType._zod.run($,Y);if(G instanceof Promise)return G.then((J)=>n7(J,Q));return n7(G,Q)}});function n7(X,Q){if(X.value===void 0)X.value=Q.defaultValue;return X}var mN=y("$ZodPrefault",(X,Q)=>{w0.init(X,Q),X._zod.optin="optional",R0(X._zod,"values",()=>Q.innerType._zod.values),X._zod.parse=($,Y)=>{if($.value===void 0)$.value=Q.defaultValue;return Q.innerType._zod.run($,Y)}}),lN=y("$ZodNonOptional",(X,Q)=>{w0.init(X,Q),R0(X._zod,"values",()=>{let $=Q.innerType._zod.values;return $?new Set([...$].filter((Y)=>Y!==void 0)):void 0}),X._zod.parse=($,Y)=>{let G=Q.innerType._zod.run($,Y);if(G instanceof Promise)return G.then((J)=>r7(J,X));return r7(G,X)}});function r7(X,Q){if(!X.issues.length&&X.value===void 0)X.issues.push({code:"invalid_type",expected:"nonoptional",input:X.value,inst:Q});return X}var cN=y("$ZodCatch",(X,Q)=>{w0.init(X,Q),X._zod.optin="optional",R0(X._zod,"optout",()=>Q.innerType._zod.optout),R0(X._zod,"values",()=>Q.innerType._zod.values),X._zod.parse=($,Y)=>{let G=Q.innerType._zod.run($,Y);if(G instanceof Promise)return G.then((J)=>{if($.value=J.value,J.issues.length)$.value=Q.catchValue({...$,error:{issues:J.issues.map((H)=>C1(H,Y,b1()))},input:$.value}),$.issues=[];return $});if($.value=G.value,G.issues.length)$.value=Q.catchValue({...$,error:{issues:G.issues.map((J)=>C1(J,Y,b1()))},input:$.value}),$.issues=[];return $}}),pN=y("$ZodPipe",(X,Q)=>{w0.init(X,Q),R0(X._zod,"values",()=>Q.in._zod.values),R0(X._zod,"optin",()=>Q.in._zod.optin),R0(X._zod,"optout",()=>Q.out._zod.optout),X._zod.parse=($,Y)=>{let G=Q.in._zod.run($,Y);if(G instanceof Promise)return G.then((J)=>o7(J,Q,Y));return o7(G,Q,Y)}});function o7(X,Q,$){if(R9(X))return X;return Q.out._zod.run({value:X.value,issues:X.issues},$)}var dN=y("$ZodReadonly",(X,Q)=>{w0.init(X,Q),R0(X._zod,"propValues",()=>Q.innerType._zod.propValues),R0(X._zod,"values",()=>Q.innerType._zod.values),R0(X._zod,"optin",()=>Q.innerType._zod.optin),R0(X._zod,"optout",()=>Q.innerType._zod.optout),X._zod.parse=($,Y)=>{let G=Q.innerType._zod.run($,Y);if(G instanceof Promise)return G.then(a7);return a7(G)}});function a7(X){return X.value=Object.freeze(X.value),X}var iN=y("$ZodCustom",(X,Q)=>{o0.init(X,Q),w0.init(X,Q),X._zod.parse=($,Y)=>{return $},X._zod.check=($)=>{let Y=$.value,G=Q.fn(Y);if(G instanceof Promise)return G.then((J)=>s7(J,$,Y,X));s7(G,$,Y,X);return}});function s7(X,Q,$,Y){if(!X){let G={code:"custom",input:$,inst:Y,path:[...Y._zod.def.path??[]],continue:!Y._zod.def.abort};if(Y._zod.def.params)G.params=Y._zod.def.params;Q.issues.push(dY(G))}}var nN=(X)=>{let Q=typeof X;switch(Q){case"number":return Number.isNaN(X)?"NaN":"number";case"object":{if(Array.isArray(X))return"array";if(X===null)return"null";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name}}return Q},rN=()=>{let X={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function Q(Y){return X[Y]??null}let $={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(Y)=>{switch(Y.code){case"invalid_type":return`Invalid input: expected ${Y.expected}, received ${nN(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`Invalid input: expected ${w$(Y.values[0])}`;return`Invalid option: expected one of ${B$(Y.values,"|")}`;case"too_big":{let G=Y.inclusive?"<=":"<",J=Q(Y.origin);if(J)return`Too big: expected ${Y.origin??"value"} to have ${G}${Y.maximum.toString()} ${J.unit??"elements"}`;return`Too big: expected ${Y.origin??"value"} to be ${G}${Y.maximum.toString()}`}case"too_small":{let G=Y.inclusive?">=":">",J=Q(Y.origin);if(J)return`Too small: expected ${Y.origin} to have ${G}${Y.minimum.toString()} ${J.unit}`;return`Too small: expected ${Y.origin} to be ${G}${Y.minimum.toString()}`}case"invalid_format":{let G=Y;if(G.format==="starts_with")return`Invalid string: must start with "${G.prefix}"`;if(G.format==="ends_with")return`Invalid string: must end with "${G.suffix}"`;if(G.format==="includes")return`Invalid string: must include "${G.includes}"`;if(G.format==="regex")return`Invalid string: must match pattern ${G.pattern}`;return`Invalid ${$[G.format]??Y.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${Y.divisor}`;case"unrecognized_keys":return`Unrecognized key${Y.keys.length>1?"s":""}: ${B$(Y.keys,", ")}`;case"invalid_key":return`Invalid key in ${Y.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${Y.origin}`;default:return"Invalid input"}}};function oN(){return{localeError:rN()}}var ES=Symbol("ZodOutput"),bS=Symbol("ZodInput");class UG{constructor(){this._map=new WeakMap,this._idmap=new Map}add(X,...Q){let $=Q[0];if(this._map.set(X,$),$&&typeof $==="object"&&"id"in $){if(this._idmap.has($.id))throw Error(`ID ${$.id} already exists in the registry`);this._idmap.set($.id,X)}return this}remove(X){return this._map.delete(X),this}get(X){let Q=X._zod.parent;if(Q){let $={...this.get(Q)??{}};return delete $.id,{...$,...this._map.get(X)}}return this._map.get(X)}has(X){return this._map.has(X)}}function aN(){return new UG}var l6=aN();function sN(X,Q){return new X({type:"string",...$0(Q)})}function tN(X,Q){return new X({type:"string",format:"email",check:"string_format",abort:!1,...$0(Q)})}function t7(X,Q){return new X({type:"string",format:"guid",check:"string_format",abort:!1,...$0(Q)})}function eN(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,...$0(Q)})}function XR(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$0(Q)})}function QR(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$0(Q)})}function $R(X,Q){return new X({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$0(Q)})}function YR(X,Q){return new X({type:"string",format:"url",check:"string_format",abort:!1,...$0(Q)})}function GR(X,Q){return new X({type:"string",format:"emoji",check:"string_format",abort:!1,...$0(Q)})}function JR(X,Q){return new X({type:"string",format:"nanoid",check:"string_format",abort:!1,...$0(Q)})}function HR(X,Q){return new X({type:"string",format:"cuid",check:"string_format",abort:!1,...$0(Q)})}function WR(X,Q){return new X({type:"string",format:"cuid2",check:"string_format",abort:!1,...$0(Q)})}function UR(X,Q){return new X({type:"string",format:"ulid",check:"string_format",abort:!1,...$0(Q)})}function zR(X,Q){return new X({type:"string",format:"xid",check:"string_format",abort:!1,...$0(Q)})}function BR(X,Q){return new X({type:"string",format:"ksuid",check:"string_format",abort:!1,...$0(Q)})}function LR(X,Q){return new X({type:"string",format:"ipv4",check:"string_format",abort:!1,...$0(Q)})}function qR(X,Q){return new X({type:"string",format:"ipv6",check:"string_format",abort:!1,...$0(Q)})}function FR(X,Q){return new X({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$0(Q)})}function VR(X,Q){return new X({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$0(Q)})}function KR(X,Q){return new X({type:"string",format:"base64",check:"string_format",abort:!1,...$0(Q)})}function MR(X,Q){return new X({type:"string",format:"base64url",check:"string_format",abort:!1,...$0(Q)})}function DR(X,Q){return new X({type:"string",format:"e164",check:"string_format",abort:!1,...$0(Q)})}function OR(X,Q){return new X({type:"string",format:"jwt",check:"string_format",abort:!1,...$0(Q)})}function ZR(X,Q){return new X({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$0(Q)})}function AR(X,Q){return new X({type:"string",format:"date",check:"string_format",...$0(Q)})}function NR(X,Q){return new X({type:"string",format:"time",check:"string_format",precision:null,...$0(Q)})}function RR(X,Q){return new X({type:"string",format:"duration",check:"string_format",...$0(Q)})}function wR(X,Q){return new X({type:"number",checks:[],...$0(Q)})}function IR(X,Q){return new X({type:"number",check:"number_format",abort:!1,format:"safeint",...$0(Q)})}function jR(X,Q){return new X({type:"boolean",...$0(Q)})}function PR(X,Q){return new X({type:"null",...$0(Q)})}function TR(X){return new X({type:"unknown"})}function SR(X,Q){return new X({type:"never",...$0(Q)})}function e7(X,Q){return new $G({check:"less_than",...$0(Q),value:X,inclusive:!1})}function $$(X,Q){return new $G({check:"less_than",...$0(Q),value:X,inclusive:!0})}function XY(X,Q){return new YG({check:"greater_than",...$0(Q),value:X,inclusive:!1})}function Y$(X,Q){return new YG({check:"greater_than",...$0(Q),value:X,inclusive:!0})}function QY(X,Q){return new mA({check:"multiple_of",...$0(Q),value:X})}function zG(X,Q){return new cA({check:"max_length",...$0(Q),maximum:X})}function QX(X,Q){return new pA({check:"min_length",...$0(Q),minimum:X})}function BG(X,Q){return new dA({check:"length_equals",...$0(Q),length:X})}function ER(X,Q){return new iA({check:"string_format",format:"regex",...$0(Q),pattern:X})}function bR(X){return new nA({check:"string_format",format:"lowercase",...$0(X)})}function CR(X){return new rA({check:"string_format",format:"uppercase",...$0(X)})}function _R(X,Q){return new oA({check:"string_format",format:"includes",...$0(Q),includes:X})}function kR(X,Q){return new aA({check:"string_format",format:"starts_with",...$0(Q),prefix:X})}function vR(X,Q){return new sA({check:"string_format",format:"ends_with",...$0(Q),suffix:X})}function C8(X){return new tA({check:"overwrite",tx:X})}function yR(X){return C8((Q)=>Q.normalize(X))}function xR(){return C8((X)=>X.trim())}function gR(){return C8((X)=>X.toLowerCase())}function hR(){return C8((X)=>X.toUpperCase())}function fR(X,Q,$){return new X({type:"array",element:Q,...$0($)})}function uR(X,Q,$){let Y=$0($);return Y.abort??(Y.abort=!0),new X({type:"custom",check:"custom",fn:Q,...Y})}function mR(X,Q,$){return new X({type:"custom",check:"custom",fn:Q,...$0($)})}var LG={};UY(LG,{time:()=>DG,duration:()=>ZG,datetime:()=>FG,date:()=>KG,ZodISOTime:()=>MG,ZodISODuration:()=>OG,ZodISODateTime:()=>qG,ZodISODate:()=>VG});var qG=y("ZodISODateTime",(X,Q)=>{LN.init(X,Q),b0.init(X,Q)});function FG(X){return ZR(qG,X)}var VG=y("ZodISODate",(X,Q)=>{qN.init(X,Q),b0.init(X,Q)});function KG(X){return AR(VG,X)}var MG=y("ZodISOTime",(X,Q)=>{FN.init(X,Q),b0.init(X,Q)});function DG(X){return NR(MG,X)}var OG=y("ZodISODuration",(X,Q)=>{VN.init(X,Q),b0.init(X,Q)});function ZG(X){return RR(OG,X)}var AG=(X,Q)=>{rY.init(X,Q),X.name="ZodError",Object.defineProperties(X,{format:{value:($)=>UA(X,$)},flatten:{value:($)=>WA(X,$)},addIssue:{value:($)=>X.issues.push($)},addIssues:{value:($)=>X.issues.push(...$)},isEmpty:{get(){return X.issues.length===0}}})},CS=y("ZodError",AG),KX=y("ZodError",AG,{Parent:Error}),lR=zA(KX),cR=BA(KX),pR=aY(KX),dR=sY(KX),E0=y("ZodType",(X,Q)=>{return w0.init(X,Q),X.def=Q,Object.defineProperty(X,"_def",{value:Q}),X.check=(...$)=>{return X.clone({...Q,checks:[...Q.checks??[],...$.map((Y)=>typeof Y==="function"?{_zod:{check:Y,def:{check:"custom"},onattach:[]}}:Y)]})},X.clone=($,Y)=>d1(X,$,Y),X.brand=()=>X,X.register=($,Y)=>{return $.add(X,Y),X},X.parse=($,Y)=>lR(X,$,Y,{callee:X.parse}),X.safeParse=($,Y)=>pR(X,$,Y),X.parseAsync=async($,Y)=>cR(X,$,Y,{callee:X.parseAsync}),X.safeParseAsync=async($,Y)=>dR(X,$,Y),X.spa=X.safeParseAsync,X.refine=($,Y)=>X.check(yw($,Y)),X.superRefine=($)=>X.check(xw($)),X.overwrite=($)=>X.check(C8($)),X.optional=()=>s(X),X.nullable=()=>GY(X),X.nullish=()=>s(GY(X)),X.nonoptional=($)=>Tw(X,$),X.array=()=>K0(X),X.or=($)=>j0([X,$]),X.and=($)=>j$(X,$),X.transform=($)=>F$(X,TG($)),X.default=($)=>Iw(X,$),X.prefault=($)=>Pw(X,$),X.catch=($)=>Ew(X,$),X.pipe=($)=>F$(X,$),X.readonly=()=>_w(X),X.describe=($)=>{let Y=X.clone();return l6.add(Y,{description:$}),Y},Object.defineProperty(X,"description",{get(){return l6.get(X)?.description},configurable:!0}),X.meta=(...$)=>{if($.length===0)return l6.get(X);let Y=X.clone();return l6.add(Y,$[0]),Y},X.isOptional=()=>X.safeParse(void 0).success,X.isNullable=()=>X.safeParse(null).success,X}),NG=y("_ZodString",(X,Q)=>{I$.init(X,Q),E0.init(X,Q);let $=X._zod.bag;X.format=$.format??null,X.minLength=$.minimum??null,X.maxLength=$.maximum??null,X.regex=(...Y)=>X.check(ER(...Y)),X.includes=(...Y)=>X.check(_R(...Y)),X.startsWith=(...Y)=>X.check(kR(...Y)),X.endsWith=(...Y)=>X.check(vR(...Y)),X.min=(...Y)=>X.check(QX(...Y)),X.max=(...Y)=>X.check(zG(...Y)),X.length=(...Y)=>X.check(BG(...Y)),X.nonempty=(...Y)=>X.check(QX(1,...Y)),X.lowercase=(Y)=>X.check(bR(Y)),X.uppercase=(Y)=>X.check(CR(Y)),X.trim=()=>X.check(xR()),X.normalize=(...Y)=>X.check(yR(...Y)),X.toLowerCase=()=>X.check(gR()),X.toUpperCase=()=>X.check(hR())}),iR=y("ZodString",(X,Q)=>{I$.init(X,Q),NG.init(X,Q),X.email=($)=>X.check(tN(nR,$)),X.url=($)=>X.check(YR(rR,$)),X.jwt=($)=>X.check(OR(zw,$)),X.emoji=($)=>X.check(GR(oR,$)),X.guid=($)=>X.check(t7($Y,$)),X.uuid=($)=>X.check(eN(c6,$)),X.uuidv4=($)=>X.check(XR(c6,$)),X.uuidv6=($)=>X.check(QR(c6,$)),X.uuidv7=($)=>X.check($R(c6,$)),X.nanoid=($)=>X.check(JR(aR,$)),X.guid=($)=>X.check(t7($Y,$)),X.cuid=($)=>X.check(HR(sR,$)),X.cuid2=($)=>X.check(WR(tR,$)),X.ulid=($)=>X.check(UR(eR,$)),X.base64=($)=>X.check(KR(Hw,$)),X.base64url=($)=>X.check(MR(Ww,$)),X.xid=($)=>X.check(zR(Xw,$)),X.ksuid=($)=>X.check(BR(Qw,$)),X.ipv4=($)=>X.check(LR($w,$)),X.ipv6=($)=>X.check(qR(Yw,$)),X.cidrv4=($)=>X.check(FR(Gw,$)),X.cidrv6=($)=>X.check(VR(Jw,$)),X.e164=($)=>X.check(DR(Uw,$)),X.datetime=($)=>X.check(FG($)),X.date=($)=>X.check(KG($)),X.time=($)=>X.check(DG($)),X.duration=($)=>X.check(ZG($))});function v(X){return sN(iR,X)}var b0=y("ZodStringFormat",(X,Q)=>{I0.init(X,Q),NG.init(X,Q)}),nR=y("ZodEmail",(X,Q)=>{$N.init(X,Q),b0.init(X,Q)}),$Y=y("ZodGUID",(X,Q)=>{XN.init(X,Q),b0.init(X,Q)}),c6=y("ZodUUID",(X,Q)=>{QN.init(X,Q),b0.init(X,Q)}),rR=y("ZodURL",(X,Q)=>{YN.init(X,Q),b0.init(X,Q)}),oR=y("ZodEmoji",(X,Q)=>{GN.init(X,Q),b0.init(X,Q)}),aR=y("ZodNanoID",(X,Q)=>{JN.init(X,Q),b0.init(X,Q)}),sR=y("ZodCUID",(X,Q)=>{HN.init(X,Q),b0.init(X,Q)}),tR=y("ZodCUID2",(X,Q)=>{WN.init(X,Q),b0.init(X,Q)}),eR=y("ZodULID",(X,Q)=>{UN.init(X,Q),b0.init(X,Q)}),Xw=y("ZodXID",(X,Q)=>{zN.init(X,Q),b0.init(X,Q)}),Qw=y("ZodKSUID",(X,Q)=>{BN.init(X,Q),b0.init(X,Q)}),$w=y("ZodIPv4",(X,Q)=>{KN.init(X,Q),b0.init(X,Q)}),Yw=y("ZodIPv6",(X,Q)=>{MN.init(X,Q),b0.init(X,Q)}),Gw=y("ZodCIDRv4",(X,Q)=>{DN.init(X,Q),b0.init(X,Q)}),Jw=y("ZodCIDRv6",(X,Q)=>{ON.init(X,Q),b0.init(X,Q)}),Hw=y("ZodBase64",(X,Q)=>{ZN.init(X,Q),b0.init(X,Q)}),Ww=y("ZodBase64URL",(X,Q)=>{NN.init(X,Q),b0.init(X,Q)}),Uw=y("ZodE164",(X,Q)=>{RN.init(X,Q),b0.init(X,Q)}),zw=y("ZodJWT",(X,Q)=>{IN.init(X,Q),b0.init(X,Q)}),RG=y("ZodNumber",(X,Q)=>{HG.init(X,Q),E0.init(X,Q),X.gt=(Y,G)=>X.check(XY(Y,G)),X.gte=(Y,G)=>X.check(Y$(Y,G)),X.min=(Y,G)=>X.check(Y$(Y,G)),X.lt=(Y,G)=>X.check(e7(Y,G)),X.lte=(Y,G)=>X.check($$(Y,G)),X.max=(Y,G)=>X.check($$(Y,G)),X.int=(Y)=>X.check(YY(Y)),X.safe=(Y)=>X.check(YY(Y)),X.positive=(Y)=>X.check(XY(0,Y)),X.nonnegative=(Y)=>X.check(Y$(0,Y)),X.negative=(Y)=>X.check(e7(0,Y)),X.nonpositive=(Y)=>X.check($$(0,Y)),X.multipleOf=(Y,G)=>X.check(QY(Y,G)),X.step=(Y,G)=>X.check(QY(Y,G)),X.finite=()=>X;let $=X._zod.bag;X.minValue=Math.max($.minimum??Number.NEGATIVE_INFINITY,$.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,X.maxValue=Math.min($.maximum??Number.POSITIVE_INFINITY,$.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,X.isInt=($.format??"").includes("int")||Number.isSafeInteger($.multipleOf??0.5),X.isFinite=!0,X.format=$.format??null});function A0(X){return wR(RG,X)}var Bw=y("ZodNumberFormat",(X,Q)=>{jN.init(X,Q),RG.init(X,Q)});function YY(X){return IR(Bw,X)}var Lw=y("ZodBoolean",(X,Q)=>{PN.init(X,Q),E0.init(X,Q)});function m0(X){return jR(Lw,X)}var qw=y("ZodNull",(X,Q)=>{TN.init(X,Q),E0.init(X,Q)});function wG(X){return PR(qw,X)}var Fw=y("ZodUnknown",(X,Q)=>{SN.init(X,Q),E0.init(X,Q)});function x0(){return TR(Fw)}var Vw=y("ZodNever",(X,Q)=>{EN.init(X,Q),E0.init(X,Q)});function Kw(X){return SR(Vw,X)}var Mw=y("ZodArray",(X,Q)=>{bN.init(X,Q),E0.init(X,Q),X.element=Q.element,X.min=($,Y)=>X.check(QX($,Y)),X.nonempty=($)=>X.check(QX(1,$)),X.max=($,Y)=>X.check(zG($,Y)),X.length=($,Y)=>X.check(BG($,Y)),X.unwrap=()=>X.element});function K0(X,Q){return fR(Mw,X,Q)}var IG=y("ZodObject",(X,Q)=>{CN.init(X,Q),E0.init(X,Q),N0.defineLazy(X,"shape",()=>Q.shape),X.keyof=()=>l0(Object.keys(X._zod.def.shape)),X.catchall=($)=>X.clone({...X._zod.def,catchall:$}),X.passthrough=()=>X.clone({...X._zod.def,catchall:x0()}),X.loose=()=>X.clone({...X._zod.def,catchall:x0()}),X.strict=()=>X.clone({...X._zod.def,catchall:Kw()}),X.strip=()=>X.clone({...X._zod.def,catchall:void 0}),X.extend=($)=>{return N0.extend(X,$)},X.merge=($)=>N0.merge(X,$),X.pick=($)=>N0.pick(X,$),X.omit=($)=>N0.omit(X,$),X.partial=(...$)=>N0.partial(SG,X,$[0]),X.required=(...$)=>N0.required(EG,X,$[0])});function c(X,Q){let $={type:"object",get shape(){return N0.assignProp(this,"shape",{...X}),this.shape},...N0.normalizeParams(Q)};return new IG($)}function U1(X,Q){return new IG({type:"object",get shape(){return N0.assignProp(this,"shape",{...X}),this.shape},catchall:x0(),...N0.normalizeParams(Q)})}var jG=y("ZodUnion",(X,Q)=>{WG.init(X,Q),E0.init(X,Q),X.options=Q.options});function j0(X,Q){return new jG({type:"union",options:X,...N0.normalizeParams(Q)})}var Dw=y("ZodDiscriminatedUnion",(X,Q)=>{jG.init(X,Q),_N.init(X,Q)});function PG(X,Q,$){return new Dw({type:"union",options:Q,discriminator:X,...N0.normalizeParams($)})}var Ow=y("ZodIntersection",(X,Q)=>{kN.init(X,Q),E0.init(X,Q)});function j$(X,Q){return new Ow({type:"intersection",left:X,right:Q})}var Zw=y("ZodRecord",(X,Q)=>{vN.init(X,Q),E0.init(X,Q),X.keyType=Q.keyType,X.valueType=Q.valueType});function g0(X,Q,$){return new Zw({type:"record",keyType:X,valueType:Q,...N0.normalizeParams($)})}var q$=y("ZodEnum",(X,Q)=>{yN.init(X,Q),E0.init(X,Q),X.enum=Q.entries,X.options=Object.values(Q.entries);let $=new Set(Object.keys(Q.entries));X.extract=(Y,G)=>{let J={};for(let H of Y)if($.has(H))J[H]=Q.entries[H];else throw Error(`Key ${H} not found in enum`);return new q$({...Q,checks:[],...N0.normalizeParams(G),entries:J})},X.exclude=(Y,G)=>{let J={...Q.entries};for(let H of Y)if($.has(H))delete J[H];else throw Error(`Key ${H} not found in enum`);return new q$({...Q,checks:[],...N0.normalizeParams(G),entries:J})}});function l0(X,Q){let $=Array.isArray(X)?Object.fromEntries(X.map((Y)=>[Y,Y])):X;return new q$({type:"enum",entries:$,...N0.normalizeParams(Q)})}var Aw=y("ZodLiteral",(X,Q)=>{xN.init(X,Q),E0.init(X,Q),X.values=new Set(Q.values),Object.defineProperty(X,"value",{get(){if(Q.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return Q.values[0]}})});function t(X,Q){return new Aw({type:"literal",values:Array.isArray(X)?X:[X],...N0.normalizeParams(Q)})}var Nw=y("ZodTransform",(X,Q)=>{gN.init(X,Q),E0.init(X,Q),X._zod.parse=($,Y)=>{$.addIssue=(J)=>{if(typeof J==="string")$.issues.push(N0.issue(J,$.value,Q));else{let H=J;if(H.fatal)H.continue=!1;H.code??(H.code="custom"),H.input??(H.input=$.value),H.inst??(H.inst=X),H.continue??(H.continue=!0),$.issues.push(N0.issue(H))}};let G=Q.transform($.value,$);if(G instanceof Promise)return G.then((J)=>{return $.value=J,$});return $.value=G,$}});function TG(X){return new Nw({type:"transform",transform:X})}var SG=y("ZodOptional",(X,Q)=>{hN.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function s(X){return new SG({type:"optional",innerType:X})}var Rw=y("ZodNullable",(X,Q)=>{fN.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function GY(X){return new Rw({type:"nullable",innerType:X})}var ww=y("ZodDefault",(X,Q)=>{uN.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType,X.removeDefault=X.unwrap});function Iw(X,Q){return new ww({type:"default",innerType:X,get defaultValue(){return typeof Q==="function"?Q():Q}})}var jw=y("ZodPrefault",(X,Q)=>{mN.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function Pw(X,Q){return new jw({type:"prefault",innerType:X,get defaultValue(){return typeof Q==="function"?Q():Q}})}var EG=y("ZodNonOptional",(X,Q)=>{lN.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType});function Tw(X,Q){return new EG({type:"nonoptional",innerType:X,...N0.normalizeParams(Q)})}var Sw=y("ZodCatch",(X,Q)=>{cN.init(X,Q),E0.init(X,Q),X.unwrap=()=>X._zod.def.innerType,X.removeCatch=X.unwrap});function Ew(X,Q){return new Sw({type:"catch",innerType:X,catchValue:typeof Q==="function"?Q:()=>Q})}var bw=y("ZodPipe",(X,Q)=>{pN.init(X,Q),E0.init(X,Q),X.in=Q.in,X.out=Q.out});function F$(X,Q){return new bw({type:"pipe",in:X,out:Q})}var Cw=y("ZodReadonly",(X,Q)=>{dN.init(X,Q),E0.init(X,Q)});function _w(X){return new Cw({type:"readonly",innerType:X})}var bG=y("ZodCustom",(X,Q)=>{iN.init(X,Q),E0.init(X,Q)});function kw(X,Q){let $=new o0({check:"custom",...N0.normalizeParams(Q)});return $._zod.check=X,$}function vw(X,Q){return uR(bG,X??(()=>!0),Q)}function yw(X,Q={}){return mR(bG,X,Q)}function xw(X,Q){let $=kw((Y)=>{return Y.addIssue=(G)=>{if(typeof G==="string")Y.issues.push(N0.issue(G,Y.value,$._zod.def));else{let J=G;if(J.fatal)J.continue=!1;J.code??(J.code="custom"),J.input??(J.input=Y.value),J.inst??(J.inst=$),J.continue??(J.continue=!$._zod.def.abort),Y.issues.push(N0.issue(J))}},X(Y.value,Y)},Q);return $}function CG(X,Q){return F$(TG(X),Q)}b1(oN());var P$="io.modelcontextprotocol/related-task",MX="2.0",O1=vw((X)=>X!==null&&(typeof X==="object"||typeof X==="function")),_G=j0([v(),A0().int()]),kG=v(),gw=U1({ttl:j0([A0(),wG()]).optional(),pollInterval:A0().optional()}),T$=U1({taskId:v()}),hw=U1({progressToken:_G.optional(),[P$]:T$.optional()}),a0=U1({task:gw.optional(),_meta:hw.optional()}),u0=c({method:v(),params:a0.optional()}),Y9=U1({_meta:c({[P$]:s(T$)}).passthrough().optional()}),$1=c({method:v(),params:Y9.optional()}),c0=U1({_meta:U1({[P$]:T$.optional()}).optional()}),DX=j0([v(),A0().int()]),fw=c({jsonrpc:t(MX),id:DX,...u0.shape}).strict();var uw=c({jsonrpc:t(MX),...$1.shape}).strict();var mw=c({jsonrpc:t(MX),id:DX,result:c0}).strict();var JY;(function(X){X[X.ConnectionClosed=-32000]="ConnectionClosed",X[X.RequestTimeout=-32001]="RequestTimeout",X[X.ParseError=-32700]="ParseError",X[X.InvalidRequest=-32600]="InvalidRequest",X[X.MethodNotFound=-32601]="MethodNotFound",X[X.InvalidParams=-32602]="InvalidParams",X[X.InternalError=-32603]="InternalError",X[X.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(JY||(JY={}));var lw=c({jsonrpc:t(MX),id:DX,error:c({code:A0().int(),message:v(),data:s(x0())})}).strict();var _S=j0([fw,uw,mw,lw]),vG=c0.strict(),cw=Y9.extend({requestId:DX,reason:v().optional()}),yG=$1.extend({method:t("notifications/cancelled"),params:cw}),pw=c({src:v(),mimeType:v().optional(),sizes:K0(v()).optional()}),_8=c({icons:K0(pw).optional()}),E9=c({name:v(),title:v().optional()}),xG=E9.extend({...E9.shape,..._8.shape,version:v(),websiteUrl:v().optional()}),dw=j$(c({applyDefaults:m0().optional()}),g0(v(),x0())),iw=CG((X)=>{if(X&&typeof X==="object"&&!Array.isArray(X)){if(Object.keys(X).length===0)return{form:{}}}return X},j$(c({form:dw.optional(),url:O1.optional()}),g0(v(),x0()).optional())),nw=c({list:s(c({}).passthrough()),cancel:s(c({}).passthrough()),requests:s(c({sampling:s(c({createMessage:s(c({}).passthrough())}).passthrough()),elicitation:s(c({create:s(c({}).passthrough())}).passthrough())}).passthrough())}).passthrough(),rw=c({list:s(c({}).passthrough()),cancel:s(c({}).passthrough()),requests:s(c({tools:s(c({call:s(c({}).passthrough())}).passthrough())}).passthrough())}).passthrough(),ow=c({experimental:g0(v(),O1).optional(),sampling:c({context:O1.optional(),tools:O1.optional()}).optional(),elicitation:iw.optional(),roots:c({listChanged:m0().optional()}).optional(),tasks:s(nw)}),aw=a0.extend({protocolVersion:v(),capabilities:ow,clientInfo:xG}),sw=u0.extend({method:t("initialize"),params:aw}),tw=c({experimental:g0(v(),O1).optional(),logging:O1.optional(),completions:O1.optional(),prompts:s(c({listChanged:s(m0())})),resources:c({subscribe:m0().optional(),listChanged:m0().optional()}).optional(),tools:c({listChanged:m0().optional()}).optional(),tasks:s(rw)}).passthrough(),ew=c0.extend({protocolVersion:v(),capabilities:tw,serverInfo:xG,instructions:v().optional()}),XI=$1.extend({method:t("notifications/initialized")}),gG=u0.extend({method:t("ping")}),QI=c({progress:A0(),total:s(A0()),message:s(v())}),$I=c({...Y9.shape,...QI.shape,progressToken:_G}),hG=$1.extend({method:t("notifications/progress"),params:$I}),YI=a0.extend({cursor:kG.optional()}),k8=u0.extend({params:YI.optional()}),v8=c0.extend({nextCursor:s(kG)}),y8=c({taskId:v(),status:l0(["working","input_required","completed","failed","cancelled"]),ttl:j0([A0(),wG()]),createdAt:v(),lastUpdatedAt:v(),pollInterval:s(A0()),statusMessage:s(v())}),fG=c0.extend({task:y8}),GI=Y9.merge(y8),uG=$1.extend({method:t("notifications/tasks/status"),params:GI}),mG=u0.extend({method:t("tasks/get"),params:a0.extend({taskId:v()})}),lG=c0.merge(y8),cG=u0.extend({method:t("tasks/result"),params:a0.extend({taskId:v()})}),pG=k8.extend({method:t("tasks/list")}),dG=v8.extend({tasks:K0(y8)}),kS=u0.extend({method:t("tasks/cancel"),params:a0.extend({taskId:v()})}),vS=c0.merge(y8),iG=c({uri:v(),mimeType:s(v()),_meta:g0(v(),x0()).optional()}),nG=iG.extend({text:v()}),S$=v().refine((X)=>{try{return atob(X),!0}catch(Q){return!1}},{message:"Invalid Base64 string"}),rG=iG.extend({blob:S$}),v9=c({audience:K0(l0(["user","assistant"])).optional(),priority:A0().min(0).max(1).optional(),lastModified:LG.datetime({offset:!0}).optional()}),oG=c({...E9.shape,..._8.shape,uri:v(),description:s(v()),mimeType:s(v()),annotations:v9.optional(),_meta:s(U1({}))}),JI=c({...E9.shape,..._8.shape,uriTemplate:v(),description:s(v()),mimeType:s(v()),annotations:v9.optional(),_meta:s(U1({}))}),HI=k8.extend({method:t("resources/list")}),WI=v8.extend({resources:K0(oG)}),UI=k8.extend({method:t("resources/templates/list")}),zI=v8.extend({resourceTemplates:K0(JI)}),E$=a0.extend({uri:v()}),BI=E$,LI=u0.extend({method:t("resources/read"),params:BI}),qI=c0.extend({contents:K0(j0([nG,rG]))}),FI=$1.extend({method:t("notifications/resources/list_changed")}),VI=E$,KI=u0.extend({method:t("resources/subscribe"),params:VI}),MI=E$,DI=u0.extend({method:t("resources/unsubscribe"),params:MI}),OI=Y9.extend({uri:v()}),ZI=$1.extend({method:t("notifications/resources/updated"),params:OI}),AI=c({name:v(),description:s(v()),required:s(m0())}),NI=c({...E9.shape,..._8.shape,description:s(v()),arguments:s(K0(AI)),_meta:s(U1({}))}),RI=k8.extend({method:t("prompts/list")}),wI=v8.extend({prompts:K0(NI)}),II=a0.extend({name:v(),arguments:g0(v(),v()).optional()}),jI=u0.extend({method:t("prompts/get"),params:II}),b$=c({type:t("text"),text:v(),annotations:v9.optional(),_meta:g0(v(),x0()).optional()}),C$=c({type:t("image"),data:S$,mimeType:v(),annotations:v9.optional(),_meta:g0(v(),x0()).optional()}),_$=c({type:t("audio"),data:S$,mimeType:v(),annotations:v9.optional(),_meta:g0(v(),x0()).optional()}),PI=c({type:t("tool_use"),name:v(),id:v(),input:c({}).passthrough(),_meta:s(c({}).passthrough())}).passthrough(),TI=c({type:t("resource"),resource:j0([nG,rG]),annotations:v9.optional(),_meta:g0(v(),x0()).optional()}),SI=oG.extend({type:t("resource_link")}),k$=j0([b$,C$,_$,SI,TI]),EI=c({role:l0(["user","assistant"]),content:k$}),bI=c0.extend({description:s(v()),messages:K0(EI)}),CI=$1.extend({method:t("notifications/prompts/list_changed")}),_I=c({title:v().optional(),readOnlyHint:m0().optional(),destructiveHint:m0().optional(),idempotentHint:m0().optional(),openWorldHint:m0().optional()}),kI=c({taskSupport:l0(["required","optional","forbidden"]).optional()}),aG=c({...E9.shape,..._8.shape,description:v().optional(),inputSchema:c({type:t("object"),properties:g0(v(),O1).optional(),required:K0(v()).optional()}).catchall(x0()),outputSchema:c({type:t("object"),properties:g0(v(),O1).optional(),required:K0(v()).optional()}).catchall(x0()).optional(),annotations:s(_I),execution:s(kI),_meta:g0(v(),x0()).optional()}),vI=k8.extend({method:t("tools/list")}),yI=v8.extend({tools:K0(aG)}),sG=c0.extend({content:K0(k$).default([]),structuredContent:g0(v(),x0()).optional(),isError:s(m0())}),yS=sG.or(c0.extend({toolResult:x0()})),xI=a0.extend({name:v(),arguments:s(g0(v(),x0()))}),gI=u0.extend({method:t("tools/call"),params:xI}),hI=$1.extend({method:t("notifications/tools/list_changed")}),tG=l0(["debug","info","notice","warning","error","critical","alert","emergency"]),fI=a0.extend({level:tG}),uI=u0.extend({method:t("logging/setLevel"),params:fI}),mI=Y9.extend({level:tG,logger:v().optional(),data:x0()}),lI=$1.extend({method:t("notifications/message"),params:mI}),cI=c({name:v().optional()}),pI=c({hints:s(K0(cI)),costPriority:s(A0().min(0).max(1)),speedPriority:s(A0().min(0).max(1)),intelligencePriority:s(A0().min(0).max(1))}),dI=c({mode:s(l0(["auto","required","none"]))}),iI=c({type:t("tool_result"),toolUseId:v().describe("The unique identifier for the corresponding tool call."),content:K0(k$).default([]),structuredContent:c({}).passthrough().optional(),isError:s(m0()),_meta:s(c({}).passthrough())}).passthrough(),nI=PG("type",[b$,C$,_$]),$X=PG("type",[b$,C$,_$,PI,iI]),rI=c({role:l0(["user","assistant"]),content:j0([$X,K0($X)]),_meta:s(c({}).passthrough())}).passthrough(),oI=a0.extend({messages:K0(rI),modelPreferences:pI.optional(),systemPrompt:v().optional(),includeContext:l0(["none","thisServer","allServers"]).optional(),temperature:A0().optional(),maxTokens:A0().int(),stopSequences:K0(v()).optional(),metadata:O1.optional(),tools:s(K0(aG)),toolChoice:s(dI)}),aI=u0.extend({method:t("sampling/createMessage"),params:oI}),sI=c0.extend({model:v(),stopReason:s(l0(["endTurn","stopSequence","maxTokens"]).or(v())),role:l0(["user","assistant"]),content:nI}),tI=c0.extend({model:v(),stopReason:s(l0(["endTurn","stopSequence","maxTokens","toolUse"]).or(v())),role:l0(["user","assistant"]),content:j0([$X,K0($X)])}),eI=c({type:t("boolean"),title:v().optional(),description:v().optional(),default:m0().optional()}),Xj=c({type:t("string"),title:v().optional(),description:v().optional(),minLength:A0().optional(),maxLength:A0().optional(),format:l0(["email","uri","date","date-time"]).optional(),default:v().optional()}),Qj=c({type:l0(["number","integer"]),title:v().optional(),description:v().optional(),minimum:A0().optional(),maximum:A0().optional(),default:A0().optional()}),$j=c({type:t("string"),title:v().optional(),description:v().optional(),enum:K0(v()),default:v().optional()}),Yj=c({type:t("string"),title:v().optional(),description:v().optional(),oneOf:K0(c({const:v(),title:v()})),default:v().optional()}),Gj=c({type:t("string"),title:v().optional(),description:v().optional(),enum:K0(v()),enumNames:K0(v()).optional(),default:v().optional()}),Jj=j0([$j,Yj]),Hj=c({type:t("array"),title:v().optional(),description:v().optional(),minItems:A0().optional(),maxItems:A0().optional(),items:c({type:t("string"),enum:K0(v())}),default:K0(v()).optional()}),Wj=c({type:t("array"),title:v().optional(),description:v().optional(),minItems:A0().optional(),maxItems:A0().optional(),items:c({anyOf:K0(c({const:v(),title:v()}))}),default:K0(v()).optional()}),Uj=j0([Hj,Wj]),zj=j0([Gj,Jj,Uj]),Bj=j0([zj,eI,Xj,Qj]),Lj=a0.extend({mode:t("form").optional(),message:v(),requestedSchema:c({type:t("object"),properties:g0(v(),Bj),required:K0(v()).optional()})}),qj=a0.extend({mode:t("url"),message:v(),elicitationId:v(),url:v().url()}),Fj=j0([Lj,qj]),Vj=u0.extend({method:t("elicitation/create"),params:Fj}),Kj=Y9.extend({elicitationId:v()}),Mj=$1.extend({method:t("notifications/elicitation/complete"),params:Kj}),Dj=c0.extend({action:l0(["accept","decline","cancel"]),content:CG((X)=>X===null?void 0:X,g0(v(),j0([v(),A0(),m0(),K0(v())])).optional())}),Oj=c({type:t("ref/resource"),uri:v()}),Zj=c({type:t("ref/prompt"),name:v()}),Aj=a0.extend({ref:j0([Zj,Oj]),argument:c({name:v(),value:v()}),context:c({arguments:g0(v(),v()).optional()}).optional()}),Nj=u0.extend({method:t("completion/complete"),params:Aj});var Rj=c0.extend({completion:U1({values:K0(v()).max(100),total:s(A0().int()),hasMore:s(m0())})}),wj=c({uri:v().startsWith("file://"),name:v().optional(),_meta:g0(v(),x0()).optional()}),Ij=u0.extend({method:t("roots/list")}),jj=c0.extend({roots:K0(wj)}),Pj=$1.extend({method:t("notifications/roots/list_changed")}),xS=j0([gG,sw,Nj,uI,jI,RI,HI,UI,LI,KI,DI,gI,vI,mG,cG,pG]),gS=j0([yG,hG,XI,Pj,uG]),hS=j0([vG,sI,tI,Dj,jj,lG,dG,fG]),fS=j0([gG,aI,Vj,Ij,mG,cG,pG]),uS=j0([yG,hG,lI,ZI,FI,hI,CI,uG,Mj]),mS=j0([vG,ew,Rj,bI,wI,WI,zI,qI,sG,yI,lG,dG,fG]);var lS=Symbol("Let zodToJsonSchema decide on which parser to use");var cS=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var pS=WY(KY(),1),dS=WY(dM(),1);var HY;(function(X){X.Completable="McpCompletable"})(HY||(HY={}));function eG({prompt:X,options:Q}){let{systemPrompt:$,settingSources:Y,sandbox:G,...J}=Q??{},H,W;if($===void 0)H="";else if(typeof $==="string")H=$;else if($.type==="preset")W=$.append;let U=J.pathToClaudeCodeExecutable;if(!U){let a=iM(import.meta.url),e=S7(a,"..");U=S7(e,"cli.js")}process.env.CLAUDE_AGENT_SDK_VERSION="0.2.1";let{abortController:z=MY(),additionalDirectories:L=[],agents:B,allowedTools:F=[],betas:Z,canUseTool:I,continue:A,cwd:D,disallowedTools:q=[],tools:M,env:K,executable:V=bY()?"bun":"node",executableArgs:N=[],extraArgs:O={},fallbackModel:w,enableFileCheckpointing:j,forkSession:E,hooks:g,includePartialMessages:k,persistSession:x,maxThinkingTokens:u,maxTurns:l,maxBudgetUsd:G0,mcpServers:Z0,model:_0,outputFormat:h0,permissionMode:F0="default",allowDangerouslySkipPermissions:S=!1,permissionPromptToolName:b,plugins:f,resume:R,resumeSessionAt:T,stderr:C,strictMcpConfig:r}=J,X0=h0?.type==="json_schema"?h0.schema:void 0,z0=K;if(!z0)z0={...process.env};if(!z0.CLAUDE_CODE_ENTRYPOINT)z0.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(j)z0.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true";if(!U)throw Error("pathToClaudeCodeExecutable is required");let Q0={},S0=new Map;if(Z0)for(let[a,e]of Object.entries(Z0))if(e.type==="sdk"&&"instance"in e)S0.set(a,e.instance),Q0[a]={type:"sdk",name:a};else Q0[a]=e;let G1=typeof X==="string",P=new CY({abortController:z,additionalDirectories:L,betas:Z,cwd:D,executable:V,executableArgs:N,extraArgs:O,pathToClaudeCodeExecutable:U,env:z0,forkSession:E,stderr:C,maxThinkingTokens:u,maxTurns:l,maxBudgetUsd:G0,model:_0,fallbackModel:w,jsonSchema:X0,permissionMode:F0,allowDangerouslySkipPermissions:S,permissionPromptToolName:b,continueConversation:A,resume:R,resumeSessionAt:T,settingSources:Y??[],allowedTools:F,disallowedTools:q,tools:M,mcpServers:Q0,strictMcpConfig:r,canUseTool:!!I,hooks:!!g,includePartialMessages:k,persistSession:x,plugins:f,sandbox:G,spawnClaudeCodeProcess:J.spawnClaudeCodeProcess}),h=new vY(P,G1,I,g,z,S0,X0,{systemPrompt:H,appendSystemPrompt:W,agents:B});if(typeof X==="string")P.write(K1({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:X}]},parent_tool_use_id:null})+`
|
|
228
|
-
`);else h.streamInput(X);return h}function OX(X,Q,$){let Y=Q.length>0?Q.map((H)=>`- ${H.id}: ${H.name} (${H.source})`).join(`
|
|
229
|
-
`):"(no sources provided)",G=Q.map((H)=>`<source id="${H.id}">
|
|
230
|
-
${H.content.trimEnd()}
|
|
143
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(q[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}M3.createScalarToken=M1.createScalarToken;M3.resolveAsScalar=M1.resolveAsScalar;M3.setScalarValue=M1.setScalarValue;M3.stringify=W3.stringify;M3.visit=V3.visit;M3.BOM=K1;M3.DOCUMENT=w1;M3.FLOW_END=F1;M3.SCALAR=O1;M3.isCollection=I3;M3.isScalar=D3;M3.prettyToken=R3;M3.tokenType=P3});var S1=I((h3)=>{var e0=pq();function v(q){switch(q){case void 0:case" ":case`
|
|
144
|
+
`:case"\r":case"\t":return!0;default:return!1}}var G4=new Set("0123456789ABCDEFabcdef"),x3=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),lq=new Set(",[]{}"),k3=new Set(` ,[]{}
|
|
145
|
+
\r `),A1=(q)=>!q||k3.has(q);class J4{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(q,$=!1){if(q){if(typeof q!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+q:q,this.lineEndPos=null}this.atEnd=!$;let X=this.next??"stream";while(X&&($||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let q=this.pos,$=this.buffer[q];while($===" "||$==="\t")$=this.buffer[++q];if(!$||$==="#"||$===`
|
|
146
|
+
`)return!0;if($==="\r")return this.buffer[q+1]===`
|
|
147
|
+
`;return!1}charAt(q){return this.buffer[this.pos+q]}continueScalar(q){let $=this.buffer[q];if(this.indentNext>0){let X=0;while($===" ")$=this.buffer[++X+q];if($==="\r"){let Z=this.buffer[X+q+1];if(Z===`
|
|
148
|
+
`||!Z&&!this.atEnd)return q+X+1}return $===`
|
|
149
|
+
`||X>=this.indentNext||!$&&!this.atEnd?q+X:-1}if($==="-"||$==="."){let X=this.buffer.substr(q,3);if((X==="---"||X==="...")&&v(this.buffer[q+3]))return-1}return q}getLine(){let q=this.lineEndPos;if(typeof q!=="number"||q!==-1&&q<this.pos)q=this.buffer.indexOf(`
|
|
150
|
+
`,this.pos),this.lineEndPos=q;if(q===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[q-1]==="\r")q-=1;return this.buffer.substring(this.pos,q)}hasChars(q){return this.pos+q<=this.buffer.length}setNext(q){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=q,null}peek(q){return this.buffer.substr(this.pos,q)}*parseNext(q){switch(q){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 q=this.getLine();if(q===null)return this.setNext("stream");if(q[0]===e0.BOM)yield*this.pushCount(1),q=q.substring(1);if(q[0]==="%"){let $=q.length,X=q.indexOf("#");while(X!==-1){let H=q[X-1];if(H===" "||H==="\t"){$=X-1;break}else X=q.indexOf("#",X+1)}while(!0){let H=q[$-1];if(H===" "||H==="\t")$-=1;else break}let Z=(yield*this.pushCount($))+(yield*this.pushSpaces(!0));return yield*this.pushCount(q.length-Z),this.pushNewline(),"stream"}if(this.atLineEnd()){let $=yield*this.pushSpaces(!0);return yield*this.pushCount(q.length-$),yield*this.pushNewline(),"stream"}return yield e0.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let q=this.charAt(0);if(!q&&!this.atEnd)return this.setNext("line-start");if(q==="-"||q==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let $=this.peek(3);if(($==="---"||$==="...")&&v(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,$==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!v(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[q,$]=this.peek(2);if(!$&&!this.atEnd)return this.setNext("block-start");if((q==="-"||q==="?"||q===":")&&v($)){let X=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=X,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let q=this.getLine();if(q===null)return this.setNext("doc");let $=yield*this.pushIndicators();switch(q[$]){case"#":yield*this.pushCount(q.length-$);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(A1),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return $+=yield*this.parseBlockScalarHeader(),$+=yield*this.pushSpaces(!0),yield*this.pushCount(q.length-$),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let q,$,X=-1;do{if(q=yield*this.pushNewline(),q>0)$=yield*this.pushSpaces(!1),this.indentValue=X=$;else $=0;$+=yield*this.pushSpaces(!0)}while(q+$>0);let Z=this.getLine();if(Z===null)return this.setNext("flow");if(X!==-1&&X<this.indentNext&&Z[0]!=="#"||X===0&&(Z.startsWith("---")||Z.startsWith("..."))&&v(Z[3])){if(!(X===this.indentNext-1&&this.flowLevel===1&&(Z[0]==="]"||Z[0]==="}")))return this.flowLevel=0,yield e0.FLOW_END,yield*this.parseLineStart()}let H=0;while(Z[H]===",")H+=yield*this.pushCount(1),H+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(H+=yield*this.pushIndicators(),Z[H]){case void 0:return"flow";case"#":return yield*this.pushCount(Z.length-H),"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(A1),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let z=this.charAt(1);if(this.flowKey||v(z)||z===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let q=this.charAt(0),$=this.buffer.indexOf(q,this.pos+1);if(q==="'")while($!==-1&&this.buffer[$+1]==="'")$=this.buffer.indexOf("'",$+2);else while($!==-1){let H=0;while(this.buffer[$-1-H]==="\\")H+=1;if(H%2===0)break;$=this.buffer.indexOf('"',$+1)}let X=this.buffer.substring(0,$),Z=X.indexOf(`
|
|
151
|
+
`,this.pos);if(Z!==-1){while(Z!==-1){let H=this.continueScalar(Z+1);if(H===-1)break;Z=X.indexOf(`
|
|
152
|
+
`,H)}if(Z!==-1)$=Z-(X[Z-1]==="\r"?2:1)}if($===-1){if(!this.atEnd)return this.setNext("quoted-scalar");$=this.buffer.length}return yield*this.pushToIndex($+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let q=this.pos;while(!0){let $=this.buffer[++q];if($==="+")this.blockScalarKeep=!0;else if($>"0"&&$<="9")this.blockScalarIndent=Number($)-1;else if($!=="-")break}return yield*this.pushUntil(($)=>v($)||$==="#")}*parseBlockScalar(){let q=this.pos-1,$=0,X;q:for(let H=this.pos;X=this.buffer[H];++H)switch(X){case" ":$+=1;break;case`
|
|
153
|
+
`:q=H,$=0;break;case"\r":{let z=this.buffer[H+1];if(!z&&!this.atEnd)return this.setNext("block-scalar");if(z===`
|
|
154
|
+
`)break}default:break q}if(!X&&!this.atEnd)return this.setNext("block-scalar");if($>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=$;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let H=this.continueScalar(q+1);if(H===-1)break;q=this.buffer.indexOf(`
|
|
155
|
+
`,H)}while(q!==-1);if(q===-1){if(!this.atEnd)return this.setNext("block-scalar");q=this.buffer.length}}let Z=q+1;X=this.buffer[Z];while(X===" ")X=this.buffer[++Z];if(X==="\t"){while(X==="\t"||X===" "||X==="\r"||X===`
|
|
156
|
+
`)X=this.buffer[++Z];q=Z-1}else if(!this.blockScalarKeep)do{let H=q-1,z=this.buffer[H];if(z==="\r")z=this.buffer[--H];let U=H;while(z===" ")z=this.buffer[--H];if(z===`
|
|
157
|
+
`&&H>=this.pos&&H+1+$>U)q=H;else break}while(!0);return yield e0.SCALAR,yield*this.pushToIndex(q+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let q=this.flowLevel>0,$=this.pos-1,X=this.pos-1,Z;while(Z=this.buffer[++X])if(Z===":"){let H=this.buffer[X+1];if(v(H)||q&&lq.has(H))break;$=X}else if(v(Z)){let H=this.buffer[X+1];if(Z==="\r")if(H===`
|
|
158
|
+
`)X+=1,Z=`
|
|
159
|
+
`,H=this.buffer[X+1];else $=X;if(H==="#"||q&&lq.has(H))break;if(Z===`
|
|
160
|
+
`){let z=this.continueScalar(X+1);if(z===-1)break;X=Math.max(X,z-2)}}else{if(q&&lq.has(Z))break;$=X}if(!Z&&!this.atEnd)return this.setNext("plain-scalar");return yield e0.SCALAR,yield*this.pushToIndex($+1,!0),q?"flow":"doc"}*pushCount(q){if(q>0)return yield this.buffer.substr(this.pos,q),this.pos+=q,q;return 0}*pushToIndex(q,$){let X=this.buffer.slice(this.pos,q);if(X)return yield X,this.pos+=X.length,X.length;else if($)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(A1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let q=this.flowLevel>0,$=this.charAt(1);if(v($)||q&&lq.has($)){if(!q)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 q=this.pos+2,$=this.buffer[q];while(!v($)&&$!==">")$=this.buffer[++q];return yield*this.pushToIndex($===">"?q+1:q,!1)}else{let q=this.pos+1,$=this.buffer[q];while($)if(x3.has($))$=this.buffer[++q];else if($==="%"&&G4.has(this.buffer[q+1])&&G4.has(this.buffer[q+2]))$=this.buffer[q+=3];else break;return yield*this.pushToIndex(q,!1)}}*pushNewline(){let q=this.buffer[this.pos];if(q===`
|
|
161
|
+
`)return yield*this.pushCount(1);else if(q==="\r"&&this.charAt(1)===`
|
|
162
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(q){let $=this.pos-1,X;do X=this.buffer[++$];while(X===" "||q&&X==="\t");let Z=$-this.pos;if(Z>0)yield this.buffer.substr(this.pos,Z),this.pos=$;return Z}*pushUntil(q){let $=this.pos,X=this.buffer[$];while(!q(X))X=this.buffer[++$];return yield*this.pushToIndex($,!1)}}h3.Lexer=J4});var j1=I((u3)=>{class T4{constructor(){this.lineStarts=[],this.addNewLine=(q)=>this.lineStarts.push(q),this.linePos=(q)=>{let $=0,X=this.lineStarts.length;while($<X){let H=$+X>>1;if(this.lineStarts[H]<q)$=H+1;else X=H}if(this.lineStarts[$]===q)return{line:$+1,col:1};if($===0)return{line:0,col:q};let Z=this.lineStarts[$-1];return{line:$,col:q-Z+1}}}}u3.LineCounter=T4});var N1=I((p3)=>{var m3=c("process"),Y4=pq(),d3=S1();function Z0(q,$){for(let X=0;X<q.length;++X)if(q[X].type===$)return!0;return!1}function L4(q){for(let $=0;$<q.length;++$)switch(q[$].type){case"space":case"comment":case"newline":break;default:return $}return-1}function _4(q){switch(q?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function cq(q){switch(q.type){case"document":return q.start;case"block-map":{let $=q.items[q.items.length-1];return $.sep??$.start}case"block-seq":return q.items[q.items.length-1].start;default:return[]}}function F0(q){if(q.length===0)return[];let $=q.length;q:while(--$>=0)switch(q[$].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break q}while(q[++$]?.type==="space");return q.splice($,q.length)}function B4(q){if(q.start.type==="flow-seq-start"){for(let $ of q.items)if($.sep&&!$.value&&!Z0($.start,"explicit-key-ind")&&!Z0($.sep,"map-value-ind")){if($.key)$.value=$.key;if(delete $.key,_4($.value))if($.value.end)Array.prototype.push.apply($.value.end,$.sep);else $.value.end=$.sep;else Array.prototype.push.apply($.start,$.sep);delete $.sep}}}class W4{constructor(q){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new d3.Lexer,this.onNewLine=q}*parse(q,$=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let X of this.lexer.lex(q,$))yield*this.next(X);if(!$)yield*this.end()}*next(q){if(this.source=q,m3.env.LOG_TOKENS)console.log("|",Y4.prettyToken(q));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=q.length;return}let $=Y4.tokenType(q);if(!$){let X=`Not a YAML token: ${q}`;yield*this.pop({type:"error",offset:this.offset,message:X,source:q}),this.offset+=q.length}else if($==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=$,yield*this.step(),$){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+q.length);break;case"space":if(this.atNewLine&&q[0]===" ")this.indent+=q.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=q.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=q.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 q=this.peek(1);if(this.type==="doc-end"&&q?.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(!q)return yield*this.stream();switch(q.type){case"document":return yield*this.document(q);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(q);case"block-scalar":return yield*this.blockScalar(q);case"block-map":return yield*this.blockMap(q);case"block-seq":return yield*this.blockSequence(q);case"flow-collection":return yield*this.flowCollection(q);case"doc-end":return yield*this.documentEnd(q)}yield*this.pop()}peek(q){return this.stack[this.stack.length-q]}*pop(q){let $=q??this.stack.pop();if(!$)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield $;else{let X=this.peek(1);if($.type==="block-scalar")$.indent="indent"in X?X.indent:0;else if($.type==="flow-collection"&&X.type==="document")$.indent=0;if($.type==="flow-collection")B4($);switch(X.type){case"document":X.value=$;break;case"block-scalar":X.props.push($);break;case"block-map":{let Z=X.items[X.items.length-1];if(Z.value){X.items.push({start:[],key:$,sep:[]}),this.onKeyLine=!0;return}else if(Z.sep)Z.value=$;else{Object.assign(Z,{key:$,sep:[]}),this.onKeyLine=!Z.explicitKey;return}break}case"block-seq":{let Z=X.items[X.items.length-1];if(Z.value)X.items.push({start:[],value:$});else Z.value=$;break}case"flow-collection":{let Z=X.items[X.items.length-1];if(!Z||Z.value)X.items.push({start:[],key:$,sep:[]});else if(Z.sep)Z.value=$;else Object.assign(Z,{key:$,sep:[]});return}default:yield*this.pop(),yield*this.pop($)}if((X.type==="document"||X.type==="block-map"||X.type==="block-seq")&&($.type==="block-map"||$.type==="block-seq")){let Z=$.items[$.items.length-1];if(Z&&!Z.sep&&!Z.value&&Z.start.length>0&&L4(Z.start)===-1&&($.indent===0||Z.start.every((H)=>H.type!=="comment"||H.indent<$.indent))){if(X.type==="document")X.end=Z.start;else X.items.push({start:Z.start});$.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 q={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")q.start.push(this.sourceToken);this.stack.push(q);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(q){if(q.value)return yield*this.lineEnd(q);switch(this.type){case"doc-start":{if(L4(q.start)!==-1)yield*this.pop(),yield*this.step();else q.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":q.start.push(this.sourceToken);return}let $=this.startBlockValue(q);if($)this.stack.push($);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(q){if(this.type==="map-value-ind"){let $=cq(this.peek(2)),X=F0($),Z;if(q.end)Z=q.end,Z.push(this.sourceToken),delete q.end;else Z=[this.sourceToken];let H={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:X,key:q,sep:Z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=H}else yield*this.lineEnd(q)}*blockScalar(q){switch(this.type){case"space":case"comment":case"newline":q.props.push(this.sourceToken);return;case"scalar":if(q.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let $=this.source.indexOf(`
|
|
163
|
+
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
164
|
+
`,$)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,$.value){let X="end"in $.value?$.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else{if(this.atIndentedComment($.start,q.indent)){let Z=q.items[q.items.length-2]?.value?.end;if(Array.isArray(Z)){Array.prototype.push.apply(Z,$.start),Z.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return}if(this.indent>=q.indent){let X=!this.onKeyLine&&this.indent===q.indent,Z=X&&($.sep||$.explicitKey)&&this.type!=="seq-item-ind",H=[];if(Z&&$.sep&&!$.value){let z=[];for(let U=0;U<$.sep.length;++U){let Q=$.sep[U];switch(Q.type){case"newline":z.push(U);break;case"space":break;case"comment":if(Q.indent>q.indent)z.length=0;break;default:z.length=0}}if(z.length>=2)H=$.sep.splice(z[1])}switch(this.type){case"anchor":case"tag":if(Z||$.value)H.push(this.sourceToken),q.items.push({start:H}),this.onKeyLine=!0;else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"explicit-key-ind":if(!$.sep&&!$.explicitKey)$.start.push(this.sourceToken),$.explicitKey=!0;else if(Z||$.value)H.push(this.sourceToken),q.items.push({start:H,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($.explicitKey)if(!$.sep)if(Z0($.start,"newline"))Object.assign($,{key:null,sep:[this.sourceToken]});else{let z=F0($.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:null,sep:[this.sourceToken]}]})}else if($.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:H,key:null,sep:[this.sourceToken]}]});else if(_4($.key)&&!Z0($.sep,"newline")){let z=F0($.start),U=$.key,Q=$.sep;Q.push(this.sourceToken),delete $.key,delete $.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:z,key:U,sep:Q}]})}else if(H.length>0)$.sep=$.sep.concat(H,this.sourceToken);else $.sep.push(this.sourceToken);else if(!$.sep)Object.assign($,{key:null,sep:[this.sourceToken]});else if($.value||Z)q.items.push({start:H,key:null,sep:[this.sourceToken]});else if(Z0($.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else $.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(Z||$.value)q.items.push({start:H,key:z,sep:[]}),this.onKeyLine=!0;else if($.sep)this.stack.push(z);else Object.assign($,{key:z,sep:[]}),this.onKeyLine=!0;return}default:{let z=this.startBlockValue(q);if(z){if(z.type==="block-seq"){if(!$.explicitKey&&$.sep&&!Z0($.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(X)q.items.push({start:H});this.stack.push(z);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(q){let $=q.items[q.items.length-1];switch(this.type){case"newline":if($.value){let X="end"in $.value?$.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else q.items.push({start:[this.sourceToken]})}else $.start.push(this.sourceToken);return;case"space":case"comment":if($.value)q.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment($.start,q.indent)){let Z=q.items[q.items.length-2]?.value?.end;if(Array.isArray(Z)){Array.prototype.push.apply(Z,$.start),Z.push(this.sourceToken),q.items.pop();return}}$.start.push(this.sourceToken)}return;case"anchor":case"tag":if($.value||this.indent<=q.indent)break;$.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==q.indent)break;if($.value||Z0($.start,"seq-item-ind"))q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return}if(this.indent>q.indent){let X=this.startBlockValue(q);if(X){this.stack.push(X);return}}yield*this.pop(),yield*this.step()}*flowCollection(q){let $=q.items[q.items.length-1];if(this.type==="flow-error-end"){let X;do yield*this.pop(),X=this.peek(1);while(X?.type==="flow-collection")}else if(q.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!$||$.sep)q.items.push({start:[this.sourceToken]});else $.start.push(this.sourceToken);return;case"map-value-ind":if(!$||$.value)q.items.push({start:[],key:null,sep:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else Object.assign($,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!$||$.value)q.items.push({start:[this.sourceToken]});else if($.sep)$.sep.push(this.sourceToken);else $.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let Z=this.flowScalar(this.type);if(!$||$.value)q.items.push({start:[],key:Z,sep:[]});else if($.sep)this.stack.push(Z);else Object.assign($,{key:Z,sep:[]});return}case"flow-map-end":case"flow-seq-end":q.end.push(this.sourceToken);return}let X=this.startBlockValue(q);if(X)this.stack.push(X);else yield*this.pop(),yield*this.step()}else{let X=this.peek(2);if(X.type==="block-map"&&(this.type==="map-value-ind"&&X.indent===q.indent||this.type==="newline"&&!X.items[X.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&X.type!=="flow-collection"){let Z=cq(X),H=F0(Z);B4(q);let z=q.end.splice(1,q.end.length);z.push(this.sourceToken);let U={type:"block-map",offset:q.offset,indent:q.indent,items:[{start:H,key:q,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=U}else yield*this.lineEnd(q)}}flowScalar(q){if(this.onNewLine){let $=this.source.indexOf(`
|
|
165
|
+
`)+1;while($!==0)this.onNewLine(this.offset+$),$=this.source.indexOf(`
|
|
166
|
+
`,$)+1}return{type:q,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(q){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 $=cq(q),X=F0($);return X.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let $=cq(q),X=F0($);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(q,$){if(this.type!=="comment")return!1;if(this.indent<=$)return!1;return q.every((X)=>X.type==="newline"||X.type==="space")}*documentEnd(q){if(this.type!=="doc-mode"){if(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(q){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(q.end)q.end.push(this.sourceToken);else q.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}p3.Parser=W4});var P4=I((t3)=>{var V4=D1(),c3=s0(),qq=r0(),i3=j$(),a3=A(),s3=j1(),I4=N1();function D4(q){let $=q.prettyErrors!==!1;return{lineCounter:q.lineCounter||$&&new s3.LineCounter||null,prettyErrors:$}}function r3(q,$={}){let{lineCounter:X,prettyErrors:Z}=D4($),H=new I4.Parser(X?.addNewLine),z=new V4.Composer($),U=Array.from(z.compose(H.parse(q)));if(Z&&X)for(let Q of U)Q.errors.forEach(qq.prettifyError(q,X)),Q.warnings.forEach(qq.prettifyError(q,X));if(U.length>0)return U;return Object.assign([],{empty:!0},z.streamInfo())}function R4(q,$={}){let{lineCounter:X,prettyErrors:Z}=D4($),H=new I4.Parser(X?.addNewLine),z=new V4.Composer($),U=null;for(let Q of z.compose(H.parse(q),!0,q.length))if(!U)U=Q;else if(U.options.logLevel!=="silent"){U.errors.push(new qq.YAMLParseError(Q.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(Z&&X)U.errors.forEach(qq.prettifyError(q,X)),U.warnings.forEach(qq.prettifyError(q,X));return U}function n3(q,$,X){let Z=void 0;if(typeof $==="function")Z=$;else if(X===void 0&&$&&typeof $==="object")X=$;let H=R4(q,X);if(!H)return null;if(H.warnings.forEach((z)=>i3.warn(H.options.logLevel,z)),H.errors.length>0)if(H.options.logLevel!=="silent")throw H.errors[0];else H.errors=[];return H.toJS(Object.assign({reviver:Z},X))}function o3(q,$,X){let Z=null;if(typeof $==="function"||Array.isArray($))Z=$;else if(X===void 0&&$)X=$;if(typeof X==="string")X=X.length;if(typeof X==="number"){let H=Math.round(X);X=H<1?void 0:H>8?{indent:8}:{indent:H}}if(q===void 0){let{keepUndefined:H}=X??$??{};if(!H)return}if(a3.isDocument(q)&&!Z)return q.toString(X);return new c3.Document(q,Z,X).toString(X)}t3.parse=n3;t3.parseAllDocuments=r3;t3.parseDocument=R4;t3.stringify=o3});var K4=I((WQ)=>{var ZQ=D1(),HQ=s0(),zQ=X1(),E1=r0(),UQ=y0(),H0=A(),QQ=e(),GQ=b(),JQ=$0(),TQ=X0(),YQ=pq(),LQ=S1(),BQ=j1(),_Q=N1(),iq=P4(),M4=b0();WQ.Composer=ZQ.Composer;WQ.Document=HQ.Document;WQ.Schema=zQ.Schema;WQ.YAMLError=E1.YAMLError;WQ.YAMLParseError=E1.YAMLParseError;WQ.YAMLWarning=E1.YAMLWarning;WQ.Alias=UQ.Alias;WQ.isAlias=H0.isAlias;WQ.isCollection=H0.isCollection;WQ.isDocument=H0.isDocument;WQ.isMap=H0.isMap;WQ.isNode=H0.isNode;WQ.isPair=H0.isPair;WQ.isScalar=H0.isScalar;WQ.isSeq=H0.isSeq;WQ.Pair=QQ.Pair;WQ.Scalar=GQ.Scalar;WQ.YAMLMap=JQ.YAMLMap;WQ.YAMLSeq=TQ.YAMLSeq;WQ.CST=YQ;WQ.Lexer=LQ.Lexer;WQ.LineCounter=BQ.LineCounter;WQ.Parser=_Q.Parser;WQ.parse=iq.parse;WQ.parseAllDocuments=iq.parseAllDocuments;WQ.parseDocument=iq.parseDocument;WQ.stringify=iq.stringify;WQ.visit=M4.visit;WQ.visitAsync=M4.visitAsync});var L2=r1(Y2(),1),{program:B0,createCommand:RG,createArgument:PG,createOption:MG,CommanderError:KG,InvalidArgumentError:wG,InvalidOptionArgumentError:FG,Command:OG,Argument:AG,Option:I$,Help:SG}=L2.default;var B2={name:"@pickled-dev/cli",version:"0.8.1",description:"Test what agents actually understand about your product",module:"dist/index.js",type:"module",bin:{pickled:"./dist/index.js"},files:["dist"],scripts:{dev:"bun run ./src/index.ts",build:"bun build ./src/index.ts --outdir ./dist --target bun --minify --external @anthropic-ai/claude-agent-sdk",release:"semantic-release"},dependencies:{commander:"^14.0.2",chalk:"^5.6.2","@anthropic-ai/claude-agent-sdk":"^0.3.0"},devDependencies:{"@pickled-dev/config":"workspace:*","@pickled-dev/core":"workspace:*","semantic-release":"^25.0.2","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/exec":"^7.1.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.2","semantic-release-ai-notes":"^0.3.0"}};import HG from"path";var d={category:"cli",provider:"claude-code",model:"sonnet"},D$=["Read","Glob","Grep","Bash"],R$=["Edit","MultiEdit","Write","NotebookEdit"];var w4=r1(K4(),1);async function aq(q){let $=`${q}/pickled.yml`,X=Bun.file($);if(!await X.exists())throw Error(`pickled.yml not found in ${q}`);let Z;try{let H=await X.text();Z=w4.default.parse(H)}catch(H){throw Error(`Failed to parse pickled.yml: ${H}`)}return cQ(Z),Z}function cQ(q){if(!q.tool?.name)throw Error("pickled.yml: 'tool.name' is required");if(!Array.isArray(q.scenarios)||q.scenarios.length===0)throw Error("pickled.yml: 'scenarios' must be a non-empty array");if(q.docs?.sources){for(let[X,Z]of Object.entries(q.docs.sources))if(typeof Z!=="string"||Z.length===0)throw Error(`pickled.yml: docs.sources["${X}"] must be a non-empty string (file path or URL)`)}if(q.targets)for(let[X,Z]of Object.entries(q.targets)){if(Z.systemPrompt!==void 0)throw Error(`pickled.yml: target "${X}" sets 'systemPrompt', which bypasses the citation contract. Remove it; custom prompts are not supported in citation mode.`);if(Z.provider==="codex-cli"){if(!Z.model)throw Error(`pickled.yml: target "${X}" (codex-cli) requires an explicit 'model' field. Codex's default model can change without notice; pin it for reproducible evals.`);if(Z.maxTurns!==void 0)throw Error(`pickled.yml: target "${X}" (codex-cli) sets 'maxTurns', but the codex CLI does not support a turn cap. Remove the field.`)}}let $=new Set(Object.keys(q.docs?.sources??{}));for(let X of q.scenarios){if(!X.name||!X.prompt)throw Error("pickled.yml: every scenario needs 'name' and 'prompt'");if(!Array.isArray(X.requiredSources))throw Error(`pickled.yml: scenario "${X.name}" is missing 'requiredSources' (use [] to allow any citation)`);for(let Z of X.requiredSources)if(!$.has(Z))throw Error(`pickled.yml: scenario "${X.name}" references unknown source "${Z}". Declared sources: ${[...$].join(", ")||"(none)"}`);sQ(X.name,X.traps)}}var iQ=new Set(["g","y"]),aQ=new Set(["i","m","s","u","v"]);function sQ(q,$){if($===void 0)return;if(!Array.isArray($))throw Error(`pickled.yml: scenario "${q}" has non-array 'traps'`);let X=new Set;for(let Z of $){if(!Z.id||typeof Z.id!=="string")throw Error(`pickled.yml: scenario "${q}" has a trap missing 'id'`);if(X.has(Z.id))throw Error(`pickled.yml: scenario "${q}" has duplicate trap id "${Z.id}"`);if(X.add(Z.id),!Z.reason||typeof Z.reason!=="string")throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" requires non-empty 'reason'`);let H=typeof Z.match==="string",z=typeof Z.pattern==="string";if(H===z)throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" must set exactly one of 'match' or 'pattern'`);if(H){if(Z.match==="")throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" has empty 'match'`);if(Z.flags!==void 0)throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" sets 'flags' without 'pattern'`)}else{let U=Z.pattern;if(typeof U!=="string")throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" must set 'pattern'`);if(U==="")throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" has empty 'pattern'`);if(Z.flags!==void 0){if(typeof Z.flags!=="string")throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" has non-string 'flags'`);for(let Q of Z.flags){if(iQ.has(Q))throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" uses forbidden regex flag "${Q}" (g and y are not allowed)`);if(!aQ.has(Q))throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" uses unsupported regex flag "${Q}"`)}}try{new RegExp(U,Z.flags??"")}catch(Q){throw Error(`pickled.yml: scenario "${q}" trap "${Z.id}" has invalid regex pattern: ${Q instanceof Error?Q.message:Q}`)}}}}function b1(q,$){let X=new Set([...Object.keys(q.targets??{}),"default"]);if(!X.has($)){let Z=[...X].sort().join(", ");throw Error(`Unknown target: "${$}". Available targets: ${Z}`)}return{...q,matrix:{...q.matrix,target:[$]},scenarios:q.scenarios.filter((Z)=>!Z.target||Z.target===$)}}function sq(q){let{config:$,files:X,pairs:Z,findings:H}=q,z=[],U=H.filter((T)=>T.severity==="error").length,Q=H.filter((T)=>T.severity==="warning").length;if(z.push(`# Agent-context audit
|
|
167
|
+
`),z.push(`Target: \`${$.targetRepo}\``),z.push(`Budgets: root \u2264 ${$.budgets.rootLines} lines, nested warn at ${$.budgets.nestedWarnLines} lines.`),z.push(`Found ${X.length} agent-doc files. ${U} error(s), ${Q} warning(s).
|
|
168
|
+
`),z.push(`## Inventory
|
|
169
|
+
`),X.length===0)z.push(`No agent-doc files found.
|
|
170
|
+
`);else{z.push("| File | Lines | Kind | Notes |"),z.push("|---|---|---|---|");let T=[...X].sort((L,_)=>_.lineCount-L.lineCount);for(let L of T){let _=!L.relPath.includes("/"),V=F4(L.lineCount,_,$),B=L.isSymlink?`symlink \u2192 ${L.symlinkTarget?.replace(`${$.targetRepo}/`,"")??"?"}`:"file";z.push(`| \`${L.relPath}\` | ${L.lineCount} | ${B} | ${V} |`)}z.push("")}if(z.push(`## AGENTS.md / CLAUDE.md pairs
|
|
171
|
+
`),Z.length===0)z.push(`No pairs found.
|
|
172
|
+
`);else{z.push("| Directory | A | C | Class | Detail |"),z.push("|---|---|---|---|---|");for(let T of Z)z.push(`| \`${T.dir||"(root)"}\` | ${T.agentsExists?"\u2713":"\xB7"} | ${T.claudeExists?"\u2713":"\xB7"} | ${T.classification} | ${T.detail} |`);z.push("")}let J=X.filter((T)=>!T.isSymlink&&T.brokenPathRefs.length+T.brokenImports.length>0);if(z.push(`## Broken references
|
|
173
|
+
`),J.length===0)z.push(`None detected.
|
|
174
|
+
`);else for(let T of J){if(z.push(`### \`${T.relPath}\`
|
|
175
|
+
`),T.brokenPathRefs.length>0){z.push("Broken path references:");for(let L of T.brokenPathRefs)z.push(` - \`${L}\``);z.push("")}if(T.brokenImports.length>0){z.push("Broken `@`-imports:");for(let L of T.brokenImports)z.push(` - \`${L}\``);z.push("")}}let G=X.filter((T)=>!T.isSymlink&&T.unresolvedCommands.length>0);if(z.push(`## Unresolved package-manager commands (advisory)
|
|
176
|
+
`),z.push("Looks like a script command in markdown that did not match anything in the target `package.json` `scripts` or the `knownCommands` allowlist. Workspace-filtered commands check against root scripts, so false positives are expected. Review, do not fail CI on this.\n"),G.length===0)z.push(`None flagged.
|
|
177
|
+
`);else for(let T of G){z.push(`### \`${T.relPath}\`
|
|
178
|
+
`);for(let L of T.unresolvedCommands)z.push(` - \`${L}\``);z.push("")}let Y=X.filter((T)=>{if(T.isSymlink)return!1;return!T.relPath.includes("/")?T.lineCount>$.budgets.rootLines:T.lineCount>$.budgets.nestedWarnLines});if(z.push(`## Section breakdown for files over budget
|
|
179
|
+
`),Y.length===0)z.push(`All files within budget.
|
|
180
|
+
`);else for(let T of Y){z.push(`### \`${T.relPath}\` (${T.lineCount} lines)
|
|
181
|
+
`),z.push(`Largest H2 sections (lines including any subsections):
|
|
182
|
+
`),z.push("| Section | Lines |"),z.push("|---|---|");for(let L of T.sections.slice(0,10))z.push(`| ${L.header} | ${L.lines} |`);z.push("")}return z.join(`
|
|
183
|
+
`)}function rq(q){return JSON.stringify(q,null,2)}function nq(q){let{config:$,files:X,pairs:Z,findings:H}=q,z=[],U=H.filter((T)=>T.severity==="error").length,Q=H.filter((T)=>T.severity==="warning").length;if(z.push("pickled audit"),z.push(`Target: ${$.targetRepo}`),z.push(`Budgets: root \u2264 ${$.budgets.rootLines} lines, nested warn at ${$.budgets.nestedWarnLines} lines.`),z.push(`Found: ${X.length} agent-doc file(s) \xB7 ${U} error(s) \xB7 ${Q} warning(s)`),z.push(""),z.push("Inventory"),X.length===0)z.push(" none");else{let T=[...X].sort((_,V)=>V.lineCount-_.lineCount),L=Math.max(...T.map((_)=>_.relPath.length));for(let _ of T){let V=!_.relPath.includes("/"),B=F4(_.lineCount,V,$),W=_.isSymlink?`symlink \u2192 ${_.symlinkTarget?.replace(`${$.targetRepo}/`,"")??"?"}`:"file",D=`${_.lineCount}`.padStart(4),R=_.relPath.padEnd(L),K=B?` (${B})`:"";z.push(` ${R} ${D} lines ${W}${K}`)}}if(z.push(""),z.push("AGENTS.md / CLAUDE.md pairs"),Z.length===0)z.push(" none");else for(let T of Z){let L=T.dir||"(root)";z.push(` ${L}: ${T.classification} \xB7 ${T.detail}`)}z.push("");let J=X.filter((T)=>!T.isSymlink&&T.brokenPathRefs.length+T.brokenImports.length>0);if(z.push("Broken references"),J.length===0)z.push(" none");else for(let T of J){z.push(` ${T.relPath}:`);for(let L of T.brokenPathRefs)z.push(` path: ${L}`);for(let L of T.brokenImports)z.push(` @-import: ${L}`)}z.push("");let G=X.filter((T)=>!T.isSymlink&&T.unresolvedCommands.length>0);if(z.push("Unresolved package-manager commands (advisory)"),G.length===0)z.push(" none");else for(let T of G){z.push(` ${T.relPath}:`);for(let L of T.unresolvedCommands)z.push(` ${L}`)}z.push("");let Y=X.filter((T)=>{if(T.isSymlink)return!1;return!T.relPath.includes("/")?T.lineCount>$.budgets.rootLines:T.lineCount>$.budgets.nestedWarnLines});if(z.push("Section breakdown for files over budget"),Y.length===0)z.push(" all files within budget");else for(let T of Y){z.push(` ${T.relPath} (${T.lineCount} lines):`);for(let L of T.sections.slice(0,10))z.push(` ${L.header.padEnd(40)} ${L.lines} lines`)}return z.join(`
|
|
184
|
+
`)}function F4(q,$,X){if($&&q>X.budgets.rootLines)return`over root budget (${q} > ${X.budgets.rootLines})`;if(!$&&q>X.budgets.nestedWarnLines)return`over nested-warn (${q} > ${X.budgets.nestedWarnLines})`;return""}import{existsSync as A0,lstatSync as A4,readFileSync as eq,readlinkSync as rQ,statSync as nQ}from"fs";import{dirname as q$,isAbsolute as oQ,join as C1,relative as tQ,resolve as y1}from"path";var{Glob:O4}=globalThis.Bun;var oq=["node_modules/**","**/node_modules/**",".git/**","**/.git/**","dist/**","**/dist/**","build/**","**/build/**",".next/**","**/.next/**",".turbo/**","**/.turbo/**",".cache/**","**/.cache/**",".runs/**","**/.runs/**","coverage/**","**/coverage/**","**/__fixtures__/**","**/tests/**/fixture/**","**/tests/**/fixtures/**","**/test/**/fixture/**","**/test/**/fixtures/**"],O0={targetRepo:".",budgets:{rootLines:120,nestedWarnLines:200},ignore:oq,intentionalDifferentPairs:[],knownCommands:[]};function tq(q){if(!q)return O0;return{targetRepo:q.targetRepo??O0.targetRepo,budgets:{rootLines:q.budgets?.rootLines??O0.budgets.rootLines,nestedWarnLines:q.budgets?.nestedWarnLines??O0.budgets.nestedWarnLines},ignore:q.ignore??oq,intentionalDifferentPairs:q.intentionalDifferentPairs??[],knownCommands:q.knownCommands??[]}}var eQ=["AGENTS.md","CLAUDE.md","CLAUDE.local.md","llms.txt","llms-full.txt",".claude/CLAUDE.md",".claude/rules/*.md","**/AGENTS.md","**/CLAUDE.md","**/CLAUDE.local.md","**/llms.txt","**/llms-full.txt","**/.claude/CLAUDE.md","**/.claude/rules/*.md"];async function $$(q){let $=tq(q),X=y1($.targetRepo);if(!A0(X))throw Error(`targetRepo does not exist: ${X}`);let Z=new Set;for(let Q of eQ){let J=new O4(Q);for await(let G of J.scan({cwd:X,dot:!0,onlyFiles:!1,followSymlinks:!1})){if($.ignore.some((L)=>new O4(L).match(G)))continue;let Y=C1(X,G),T=A4(Y);if(T.isFile()){Z.add(G);continue}if(T.isSymbolicLink())try{if(nQ(Y).isFile())Z.add(G)}catch{}}}let H=[];for(let Q of[...Z].sort())H.push(await q7(X,Q,C1(X,Q),$));let z=L7(H,$),U=B7(H,z,$);return{config:$,files:H,pairs:z,findings:U}}async function q7(q,$,X,Z){let z=A4(X).isSymbolicLink(),U=null,Q=$;if(z){let L=rQ(X),_=oQ(L)?L:y1(q$(X),L);if(U=_,A0(_))Q=tQ(q,_)}let J=z&&U&&A0(U)?U:X,G=eq(J,"utf8"),Y=(G.match(/\n/g)??[]).length,T=G.endsWith(`
|
|
185
|
+
`)?Y:Y+1;return{relPath:$,absPath:X,isSymlink:z,symlinkTarget:U,realRelPath:Q,lineCount:T,brokenPathRefs:X7(G,q,$),brokenImports:H7(G,q$(X)),unresolvedCommands:G7(G,q,Z.knownCommands),sections:J7(G)}}function $7(q){let $=q.split("/");if($.length<2)return null;if($[0]==="packages"||$[0]==="apps"||$[0]==="shared")return`${$[0]}/${$[1]}`;if($[0]==="tests")return $.slice(0,2).join("/");return null}function X7(q,$,X){let Z=Y7(q),H=q$(X),z=$7(X),U=new Set,Q=/`([^`\n]{2,200})`/g,J;J=Q.exec(Z);while(J!==null){let G=J[1].trim().replace(/[#?].*$/,"");if(T7(G)&&!Z7($,G,H,z).found)U.add(G);J=Q.exec(Z)}return[...U].sort()}function Z7(q,$,X,Z){let H=[$];if(X&&X!==".")H.push(`${X}/${$}`);if(Z)H.push(`${Z}/${$}`);H.push(`packages/${$}`,`apps/${$}`,`shared/${$}`);for(let z of H){let U=z.replace(/\/+/g,"/");if(A0(`${q}/${U}`))return{found:!0,resolvedAs:U}}return{found:!1}}function H7(q,$){let X=new Set,Z=/@([\w./@~-]+\.md)/g,H;H=Z.exec(q);while(H!==null){let z=H[1];if(z.startsWith("~/")){H=Z.exec(q);continue}let U=z.startsWith("/")?z:y1($,z);if(!A0(U))X.add(z);H=Z.exec(q)}return[...X].sort()}var z7=["bun","pnpm","npm","yarn"],U7=new Set(["install","add","remove","update","i","audit","list","ls","why","outdated","exec","run","create","init","x"]),Q7={bun:new Set(["build","test","link","unlink","upgrade"])};function G7(q,$,X){let Z=new Set,H=C1($,"package.json"),z=new Set;if(A0(H))try{let Q=JSON.parse(eq(H,"utf8"));z=new Set(Object.keys(Q.scripts??{}))}catch{}let U=new Set(X.map((Q)=>Q.trim()));for(let Q of z7){let J=new RegExp(`\\b${Q}\\s+(?:run\\s+|--filter\\s+\\S+\\s+(?:run\\s+)?)?([a-zA-Z][\\w:.\\-]*)`,"g"),G;G=J.exec(q);while(G!==null){let Y=G[1];if(!z.has(Y)&&!U.has(`${Q} ${Y}`)&&!U.has(`${Q} run ${Y}`)&&!U7.has(Y)&&!Q7[Q]?.has(Y))Z.add(`${Q} ${Y}`);G=J.exec(q)}}return[...Z].sort()}function J7(q){let $=q.split(`
|
|
186
|
+
`),X=[],Z=null;if($.forEach((H,z)=>{if(/^##\s+/.test(H)){if(Z)X.push({header:Z.header,lines:z-Z.start});Z={header:H.replace(/^##\s+/,"").trim(),start:z}}}),Z){let H=Z;X.push({header:H.header,lines:$.length-H.start})}return X.sort((H,z)=>z.lines-H.lines)}function T7(q){if(q.length===0||q.length>160)return!1;if(!q.includes("/"))return!1;if(/\s/.test(q))return!1;if(/^https?:\/\//.test(q))return!1;if(/[*?{}[\]<>]/.test(q))return!1;if(q.startsWith("@"))return!1;if(q.startsWith("~/"))return!1;if(/^[a-z]+:\/\//i.test(q))return!1;if(/^cdn\./.test(q)||/^unpkg\./.test(q)||/^npm\./.test(q))return!1;if(/^\/[a-z]/.test(q)&&/(?:icon|image|img|asset|file|path)/i.test(q))return!1;if(/^(cd|pnpm|npm|yarn|bun|node|git|ls|cat|grep|find|sed|awk|mkdir|rm|mv|cp|echo|export|source|sudo|brew|docker|curl|wget)\b/.test(q))return!1;return/[a-zA-Z0-9_.-]\/[a-zA-Z0-9_.-]/.test(q)}function Y7(q){return q.replace(/```[\s\S]*?```/g,"")}function L7(q,$){let X=new Map;for(let z of q){let U=z.relPath.split("/").pop()??"";if(U!=="AGENTS.md"&&U!=="CLAUDE.md")continue;let Q=q$(z.relPath),J=X.get(Q)??{};if(U==="AGENTS.md")J.agents=z;if(U==="CLAUDE.md")J.claude=z;X.set(Q,J)}let Z=new Set($.intentionalDifferentPairs),H=[];for(let[z,U]of X){let Q=!!U.agents,J=!!U.claude;if(!Q&&!J)continue;if(!Q||!J){H.push({dir:z,agentsExists:Q,claudeExists:J,classification:"single",detail:Q?"only AGENTS.md":"only CLAUDE.md"});continue}let{agents:G,claude:Y}=U,T=`${G.relPath}:${Y.relPath}`,L=`${Y.relPath}:${G.relPath}`;if(Z.has(T)||Z.has(L)){H.push({dir:z,agentsExists:Q,claudeExists:J,classification:"intentional-different",detail:`allowlisted: ${G.lineCount}L vs ${Y.lineCount}L`});continue}if(G.isSymlink&&G.symlinkTarget===Y.absPath||Y.isSymlink&&Y.symlinkTarget===G.absPath){let W=G.isSymlink?"CLAUDE.md":"AGENTS.md";H.push({dir:z,agentsExists:Q,claudeExists:J,classification:"linked",detail:`canonical: ${W}`});continue}let V=eq(G.absPath,"utf8"),B=eq(Y.absPath,"utf8");if(V===B)H.push({dir:z,agentsExists:Q,claudeExists:J,classification:"unexpected-duplicate",detail:`byte-for-byte duplicate (${G.lineCount}L), not symlinked`});else H.push({dir:z,agentsExists:Q,claudeExists:J,classification:"unexpected-duplicate",detail:`divergent (${G.lineCount}L vs ${Y.lineCount}L), not in intentional-different allowlist`})}return H.sort((z,U)=>z.dir.localeCompare(U.dir)),H}function B7(q,$,X){let Z=[];for(let H of q){if(H.isSymlink)continue;for(let Q of H.brokenImports)Z.push({severity:"error",category:"broken-import",file:H.relPath,message:`broken @-import: ${Q}`});for(let Q of H.brokenPathRefs)Z.push({severity:"error",category:"broken-path-ref",file:H.relPath,message:`broken path reference: ${Q}`});for(let Q of H.unresolvedCommands)Z.push({severity:"warning",category:"unresolved-command",file:H.relPath,message:`unresolved command: ${Q}`});let z=!H.relPath.includes("/"),U=z?X.budgets.rootLines:X.budgets.nestedWarnLines;if(H.lineCount>U)Z.push({severity:"warning",category:"over-budget",file:H.relPath,message:`${H.lineCount} lines exceeds ${z?"root":"nested"} budget of ${U}`})}for(let H of $)if(H.classification==="unexpected-duplicate"){let z=H.detail.startsWith("divergent")?"error":"warning";Z.push({severity:z,category:z==="error"?"divergent-pair":"duplicate-pair",file:H.dir||"(root)",message:`AGENTS.md / CLAUDE.md ${H.detail}`})}return Z}function $q(q){let $=q.confidence;if(q.error)return{icon:"\u2717",label:"Error",confidence:$,tone:"error"};if(q.traps.fired.length>0)return{icon:"\u2717",label:"Trap fired",confidence:$,tone:"error"};if(q.answerable==="YES")return{icon:"\u2713",label:$>=90?"Well grounded":"Grounded",confidence:$,tone:"success"};if(q.answerable==="PARTIAL")return{icon:"\u26A0",label:"Partially grounded",confidence:$,tone:"warning"};return{icon:"\u2717",label:"Ungrounded",confidence:$,tone:"error"}}function f1(q){let $=_7(q);if($===null)return[];let X=[],Z=/^\s*-\s+\[([^\]]+)\]\s*(.*)$/gm,H=Z.exec($);while(H!==null)X.push({id:H[1].trim(),note:H[2].trim()||void 0}),H=Z.exec($);return X}function _7(q){let X=/^##\s+Sources\s*$/im.exec(q);if(!X)return null;let Z=X.index+X[0].length,H=q.slice(Z),z=/^##\s+/m.exec(H);return z?H.slice(0,z.index):H}function X$(q){let $=f1(q.response),X=new Set($.map((L)=>L.id)),Z=new Set(q.registeredIds),H=new Set(q.requiredSources),z=[...X],U=[...H].filter((L)=>!X.has(L)),Q=[...X].filter((L)=>!Z.has(L)),J=[...H],G,Y,T;if(z.length===0)G="NO",Y=0,T="No citations in response";else if(Q.length===z.length)G="NO",Y=0,T=`All cited sources are unknown: ${Q.join(", ")}`;else if(U.length===0&&Q.length===0)G="YES",Y=100,T=J.length>0?`All required sources cited: ${J.join(", ")}`:`Cited registered sources: ${z.join(", ")}`;else{G="PARTIAL";let L=J.length>0?J.length:1,_=J.length-U.length,V=J.length>0?_/L*100:60,B=Q.length*15;Y=Math.max(0,Math.min(100,Math.round(V-B)));let W=[];if(U.length>0)W.push(`missing: ${U.join(", ")}`);if(Q.length>0)W.push(`unknown: ${Q.join(", ")}`);T=W.join("; ")}return{answerable:G,confidence:Y,reason:T,citations:{cited:z,required:J,missing:U,unknown:Q}}}function Z$(q){let $=[],X=[];for(let Z of q.traps){let H=W7(q.response,Z);if(H)$.push(H);else X.push(Z.id)}return{fired:$,avoided:X}}function W7(q,$){if($.match!==void 0){let X=q.indexOf($.match);if(X===-1)return null;return{id:$.id,reason:$.reason,matched:$.match,snippet:S4(q,X,$.match.length)}}if($.pattern!==void 0){let Z=new RegExp($.pattern,$.flags??"").exec(q);if(!Z)return null;return{id:$.id,reason:$.reason,matched:Z[0],snippet:S4(q,Z.index,Z[0].length)}}return null}function S4(q,$,X){let Z=Math.max(0,$-40),H=Math.min(q.length,$+X+40),z=q.slice(Z,H).replace(/\s+/g," ").trim();if(Z>0)z=`...${z}`;if(H<q.length)z=`${z}...`;return z}import x1 from"path";function V7(q){return q.startsWith("http://")||q.startsWith("https://")}async function I7(q,$){let X=await fetch($);if(!X.ok)throw Error(`Failed to fetch source "${q}" from ${$}: ${X.status} ${X.statusText}`);let Z=await X.text();return{id:q,source:$,content:Z,name:new URL($).hostname+new URL($).pathname,type:"url"}}async function D7(q,$,X){let Z=x1.isAbsolute($)?$:x1.resolve(X,$),H=Bun.file(Z);if(!await H.exists())throw Error(`Source "${q}" not found at ${Z}`);let z=await H.text();return{id:q,source:$,content:z,name:x1.basename(Z),type:"file"}}async function j4(q,$,X){if(V7($))return I7(q,$);return D7(q,$,X)}async function k1(q,$){let X=Object.entries(q);return await Promise.all(X.map(([H,z])=>j4(H,z,$)))}import{query as R7}from"@anthropic-ai/claude-agent-sdk";function H$(q,$,X){let Z=$.length>0?$.map((U)=>`- ${U.id}: ${U.name} (${U.source})`).join(`
|
|
187
|
+
`):"(no sources provided)",H=$.map((U)=>`<source id="${U.id}">
|
|
188
|
+
${U.content.trimEnd()}
|
|
231
189
|
</source>`).join(`
|
|
232
190
|
|
|
233
|
-
`),
|
|
191
|
+
`),z=X.length>0?`The scenario REQUIRES citations from: ${X.join(", ")}.`:"No specific source is required, but every claim must cite a registered source.";return`You are answering a question about the tool "${q.name}": ${q.description}.
|
|
234
192
|
|
|
235
193
|
Answer using ONLY information from the provided sources below. Do not draw on general knowledge.
|
|
236
194
|
|
|
237
195
|
Available sources:
|
|
238
|
-
${
|
|
196
|
+
${Z}
|
|
239
197
|
|
|
240
|
-
${
|
|
198
|
+
${H}
|
|
241
199
|
|
|
242
|
-
${
|
|
200
|
+
${z}
|
|
243
201
|
|
|
244
202
|
End your response with a "## Sources" section that lists every source you actually used. Use this exact format:
|
|
245
203
|
|
|
@@ -250,19 +208,19 @@ End your response with a "## Sources" section that lists every source you actual
|
|
|
250
208
|
Rules:
|
|
251
209
|
- Only cite IDs that appear in the inventory above. Do not invent IDs.
|
|
252
210
|
- If you cannot answer from the provided sources, say so explicitly and write an empty "## Sources" section (just the heading, no bullets).
|
|
253
|
-
- The "## Sources" heading must be the last heading in your response.`}class
|
|
211
|
+
- The "## Sources" heading must be the last heading in your response.`}class h1{category="cli";provider="claude-code";name;config;constructor(q,$){this.name=q,this.config=$}async run(q,$){let{tool:X,cwd:Z,context:H,docs:z,requiredSources:U}=$,Q=[],J=[],G=H$(X,z,U),Y={cwd:Z,model:this.config.model??"sonnet",systemPrompt:G,allowedTools:H?.allowedTools??this.config.allowedTools??D$,disallowedTools:H?.disallowedTools??this.config.disallowedTools??R$,permissionMode:this.config.permissionMode??"acceptEdits",maxTurns:this.config.maxTurns??10,maxThinkingTokens:this.config.maxThinkingTokens,maxBudgetUsd:this.config.maxBudgetUsd,mcpServers:H?.mcpServers??this.config.mcpServers,settingSources:[]},T=[],L="",_="";for await(let V of R7({prompt:q,options:Y})){if(V.type==="assistant"){let B=V.message?.content;if(Array.isArray(B)){let W="";for(let D of B){if(D.type==="text")W+=D.text;if(D.type==="tool_use"){let R=D;if(!Q.includes(R.name))Q.push(R.name)}}if(W){let D=T.length===0?"initial":"intermediate";T.push({type:D,text:W}),L=W}}}if(V.type==="result"){let B=V;if(B.result)_=B.result}}if(T.length>0)T[T.length-1].type="final";return{response:_||L,allResponses:T,toolsUsed:Q,sources:J,metadata:{model:this.config.model??"sonnet",category:this.category,provider:this.provider,target:this.name}}}}import{randomUUID as P7}from"crypto";import{rm as M7}from"fs/promises";import{tmpdir as K7}from"os";import{join as w7}from"path";var F7="codex";class g1{category="cli";provider="codex-cli";name;config;spawnFn;readFileFn;binary;constructor(q,$,X={}){this.name=q,this.config=$,this.spawnFn=X.spawn??j7,this.readFileFn=X.readFile??N7,this.binary=X.binary??F7}async run(q,$){let{tool:X,cwd:Z,docs:H,requiredSources:z}=$,U=this.config.model;if(!U)throw Error(`CodexCliTarget "${this.name}" requires an explicit model. Validation should have caught this at config load.`);let J=`${H$(X,H,z)}
|
|
254
212
|
|
|
255
213
|
---
|
|
256
214
|
|
|
257
|
-
${
|
|
258
|
-
`)){let
|
|
215
|
+
${q}`,G=w7(K7(),`pickled-codex-${P7()}.txt`),Y=["--ask-for-approval","never","exec","--json","--sandbox","read-only","--ignore-user-config","--ignore-rules","--ephemeral","--skip-git-repo-check","--cd",Z,"--model",U,"--output-last-message",G,"-"];try{let T=await this.spawnFn(this.binary,Y,{cwd:Z,stdin:J}),{allResponses:L,toolsUsed:_}=O7(T.stdout);if(T.exitCode!==0)throw Error(`codex exec failed (exit ${T.exitCode}): ${T.stderr.trim()||"no stderr output"}`);let V="";try{V=(await this.readFileFn(G)).trim()}catch{V=L.length>0?L[L.length-1].text:""}if(L.length>0)L[L.length-1].type="final";return{response:V,allResponses:L,toolsUsed:_,sources:[],metadata:{model:U,category:this.category,provider:this.provider,target:this.name}}}finally{await M7(G,{force:!0})}}}function O7(q){let $=[],X=[];for(let Z of q.split(`
|
|
216
|
+
`)){let H=Z.trim();if(!H)continue;let z;try{z=JSON.parse(H)}catch{continue}let U=A7(z);if(U){let J=$.length===0?"initial":"intermediate";$.push({type:J,text:U})}let Q=S7(z);if(Q&&!X.includes(Q))X.push(Q)}return{allResponses:$,toolsUsed:X}}function A7(q){if(!q||typeof q!=="object")return null;let $=q;if(typeof $.message==="string")return $.message;if(typeof $.content==="string")return $.content;if(typeof $.type==="string"&&($.type==="assistant_message"||$.type==="agent_message")&&typeof $.text==="string")return $.text;if($.type==="message"&&typeof $.text==="string")return $.text;return null}function S7(q){if(!q||typeof q!=="object")return null;let $=q;if(typeof $.tool==="string")return $.tool;if(typeof $.type==="string"&&($.type==="tool_call"||$.type==="function_call")&&typeof $.name==="string")return $.name;return null}var j7=async(q,$,X)=>{let Z=Bun.spawn([q,...$],{cwd:X.cwd,stdin:"pipe",stdout:"pipe",stderr:"pipe"});Z.stdin.write(X.stdin),await Z.stdin.end();let[H,z,U]=await Promise.all([new Response(Z.stdout).text(),new Response(Z.stderr).text(),Z.exited]);return{exitCode:U,stdout:H,stderr:z}},N7=async(q)=>{let $=Bun.file(q);if(!await $.exists())throw Error(`Last-message file not found: ${q}`);return $.text()};function u1(q,$){let X=$??d;switch(X.category){case"cli":return E7(q,X);case"api":throw Error("API targets not yet implemented. Coming soon!");case"ide":throw Error("IDE targets not yet implemented. Coming soon!");default:throw Error(`Unknown target category: ${X.category}`)}}function E7(q,$){switch($.provider){case"claude-code":return new h1(q,$);case"codex-cli":return new g1(q,$);case"gemini-cli":throw Error("Gemini CLI target not yet implemented. Coming soon!");case"amazon-q":throw Error("Amazon Q target not yet implemented. Coming soon!");default:throw Error(`Unknown CLI provider: ${$.provider}`)}}var S0="default";function v1(q,$){if(!q||q===S0)return{name:S0,config:d};if($?.[q])return{name:q,config:$[q]};return console.warn(`Target "${q}" not found, using default`),{name:S0,config:d}}function N4(q,$){if(!q||q===S0)return{name:S0,config:{}};if($?.[q])return{name:q,config:$[q]};return console.warn(`Context "${q}" not found, using default`),{name:S0,config:{}}}function b7(q){let $=[],X=q.matrix?.target??["default"],Z=q.matrix?.context??["default"];for(let H of q.scenarios){let z=H.target?[H.target]:X,U=H.context?[H.context]:Z;for(let Q of z)for(let J of U)$.push({scenario:H,targetName:Q,contextName:J})}return $}async function m1(q,$,X={}){let{onProgress:Z}=X,H=[];if($.scenarios.length===0)throw Error("No scenarios defined in config");let z=$.docs?.sources??{},U=[];if(Object.keys(z).length>0){Z?.("Loading sources..."),U=await k1(z,q.path);for(let Y of U)Z?.(` [${Y.id}] ${Y.name}`);Z?.("")}let Q=U.map((Y)=>Y.id),J=b7($),G="";for(let{scenario:Y,targetName:T,contextName:L}of J){let _=C7(T,L);if(Y.name!==G){if(G)Z?.("");Z?.(`"${Y.name}"`),G=Y.name}try{let V=await y7(Y,T,L,q,$,U,Q,X);H.push(V);let B=_?_.padEnd(18):"",W=$q(V);Z?.(` ${B} ${W.icon} ${W.label} (${W.confidence}%)`)}catch(V){let B=T==="default"?d:$.targets?.[T]??d,W={scenario:Y,answerable:"NO",confidence:0,response:"",reason:"Error during run",citations:{cited:[],required:Y.requiredSources,missing:Y.requiredSources,unknown:[]},traps:{fired:[],avoided:(Y.traps??[]).map((R)=>R.id)},error:V instanceof Error?V.message:String(V),target:{target:T,category:B.category,provider:B.provider,model:B.model??"unknown"},context:{name:L}};H.push(W);let D=_?_.padEnd(18):"";Z?.(` ${D} \u2717 Error`)}}return Z?.(""),f7(q,U,H)}function C7(q,$){if(q==="default"&&$==="default")return"";if($==="default")return`[${q}]`;return`[${q}/${$}]`}async function y7(q,$,X,Z,H,z,U,Q){let{config:J}=v1($,H.targets),{config:G}=N4(X,H.contexts),T=await(Q.targetFactory?Q.targetFactory($,J):u1($,J)).run(q.prompt,{tool:Z,cwd:Z.path,context:G,docs:z,requiredSources:q.requiredSources,onProgress:Q.onProgress}),L=X$({response:T.response,requiredSources:q.requiredSources,registeredIds:U}),_=Z$({response:T.response,traps:q.traps??[]}),V=_.fired.length>0,B=V?"NO":L.answerable,W=V?0:L.confidence,D=V?`Trap fired: ${_.fired.map((R)=>`"${R.id}" (${R.reason})`).join("; ")}`:L.reason;return{scenario:q,answerable:B,confidence:W,response:T.response,reason:D,citations:L.citations,traps:_,target:T.metadata,context:{name:X},toolsUsed:T.toolsUsed,sources:T.sources,allResponses:T.allResponses}}function f7(q,$,X){let Z=X.length,H=X.filter((U)=>U.answerable==="YES"||U.answerable==="PARTIAL").length,z=Z>0?Math.round(X.reduce((U,Q)=>{if(Q.answerable==="YES")return U+Q.confidence;if(Q.answerable==="PARTIAL")return U+Q.confidence*0.5;return U},0)/Z):0;return{tool:{name:q.name,description:q.description,path:q.path},docs:$,scenarios:X,summary:{total:Z,answered:H,unanswered:Z-H,score:z}}}var E4=(q=0)=>($)=>`\x1B[${$+q}m`,b4=(q=0)=>($)=>`\x1B[${38+q};5;${$}m`,C4=(q=0)=>($,X,Z)=>`\x1B[${38+q};2;${$};${X};${Z}m`,N={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},mT=Object.keys(N.modifier),x7=Object.keys(N.color),k7=Object.keys(N.bgColor),dT=[...x7,...k7];function h7(){let q=new Map;for(let[$,X]of Object.entries(N)){for(let[Z,H]of Object.entries(X))N[Z]={open:`\x1B[${H[0]}m`,close:`\x1B[${H[1]}m`},X[Z]=N[Z],q.set(H[0],H[1]);Object.defineProperty(N,$,{value:X,enumerable:!1})}return Object.defineProperty(N,"codes",{value:q,enumerable:!1}),N.color.close="\x1B[39m",N.bgColor.close="\x1B[49m",N.color.ansi=E4(),N.color.ansi256=b4(),N.color.ansi16m=C4(),N.bgColor.ansi=E4(10),N.bgColor.ansi256=b4(10),N.bgColor.ansi16m=C4(10),Object.defineProperties(N,{rgbToAnsi256:{value($,X,Z){if($===X&&X===Z){if($<8)return 16;if($>248)return 231;return Math.round(($-8)/247*24)+232}return 16+36*Math.round($/255*5)+6*Math.round(X/255*5)+Math.round(Z/255*5)},enumerable:!1},hexToRgb:{value($){let X=/[a-f\d]{6}|[a-f\d]{3}/i.exec($.toString(16));if(!X)return[0,0,0];let[Z]=X;if(Z.length===3)Z=[...Z].map((z)=>z+z).join("");let H=Number.parseInt(Z,16);return[H>>16&255,H>>8&255,H&255]},enumerable:!1},hexToAnsi256:{value:($)=>N.rgbToAnsi256(...N.hexToRgb($)),enumerable:!1},ansi256ToAnsi:{value($){if($<8)return 30+$;if($<16)return 90+($-8);let X,Z,H;if($>=232)X=(($-232)*10+8)/255,Z=X,H=X;else{$-=16;let Q=$%36;X=Math.floor($/36)/5,Z=Math.floor(Q/6)/5,H=Q%6/5}let z=Math.max(X,Z,H)*2;if(z===0)return 30;let U=30+(Math.round(H)<<2|Math.round(Z)<<1|Math.round(X));if(z===2)U+=60;return U},enumerable:!1},rgbToAnsi:{value:($,X,Z)=>N.ansi256ToAnsi(N.rgbToAnsi256($,X,Z)),enumerable:!1},hexToAnsi:{value:($)=>N.ansi256ToAnsi(N.hexToAnsi256($)),enumerable:!1}}),N}var g7=h7(),m=g7;import d1 from"process";import u7 from"os";import y4 from"tty";function g(q,$=globalThis.Deno?globalThis.Deno.args:d1.argv){let X=q.startsWith("-")?"":q.length===1?"-":"--",Z=$.indexOf(X+q),H=$.indexOf("--");return Z!==-1&&(H===-1||Z<H)}var{env:E}=d1,z$;if(g("no-color")||g("no-colors")||g("color=false")||g("color=never"))z$=0;else if(g("color")||g("colors")||g("color=true")||g("color=always"))z$=1;function v7(){if("FORCE_COLOR"in E){if(E.FORCE_COLOR==="true")return 1;if(E.FORCE_COLOR==="false")return 0;return E.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(E.FORCE_COLOR,10),3)}}function m7(q){if(q===0)return!1;return{level:q,hasBasic:!0,has256:q>=2,has16m:q>=3}}function d7(q,{streamIsTTY:$,sniffFlags:X=!0}={}){let Z=v7();if(Z!==void 0)z$=Z;let H=X?z$:Z;if(H===0)return 0;if(X){if(g("color=16m")||g("color=full")||g("color=truecolor"))return 3;if(g("color=256"))return 2}if("TF_BUILD"in E&&"AGENT_NAME"in E)return 1;if(q&&!$&&H===void 0)return 0;let z=H||0;if(E.TERM==="dumb")return z;if(d1.platform==="win32"){let U=u7.release().split(".");if(Number(U[0])>=10&&Number(U[2])>=10586)return Number(U[2])>=14931?3:2;return 1}if("CI"in E){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((U)=>(U in E)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((U)=>(U in E))||E.CI_NAME==="codeship")return 1;return z}if("TEAMCITY_VERSION"in E)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(E.TEAMCITY_VERSION)?1:0;if(E.COLORTERM==="truecolor")return 3;if(E.TERM==="xterm-kitty")return 3;if(E.TERM==="xterm-ghostty")return 3;if(E.TERM==="wezterm")return 3;if("TERM_PROGRAM"in E){let U=Number.parseInt((E.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(E.TERM_PROGRAM){case"iTerm.app":return U>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(E.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(E.TERM))return 1;if("COLORTERM"in E)return 1;return z}function f4(q,$={}){let X=d7(q,{streamIsTTY:q&&q.isTTY,...$});return m7(X)}var p7={stdout:f4({isTTY:y4.isatty(1)}),stderr:f4({isTTY:y4.isatty(2)})},x4=p7;function k4(q,$,X){let Z=q.indexOf($);if(Z===-1)return q;let H=$.length,z=0,U="";do U+=q.slice(z,Z)+$+X,z=Z+H,Z=q.indexOf($,z);while(Z!==-1);return U+=q.slice(z),U}function h4(q,$,X,Z){let H=0,z="";do{let U=q[Z-1]==="\r";z+=q.slice(H,U?Z-1:Z)+$+(U?`\r
|
|
259
217
|
`:`
|
|
260
|
-
`)
|
|
261
|
-
`,
|
|
262
|
-
`);if(
|
|
263
|
-
`)}function
|
|
264
|
-
`);let
|
|
265
|
-
`);else
|
|
218
|
+
`)+X,H=Z+1,Z=q.indexOf(`
|
|
219
|
+
`,H)}while(Z!==-1);return z+=q.slice(H),z}var{stdout:g4,stderr:u4}=x4,p1=Symbol("GENERATOR"),j0=Symbol("STYLER"),Xq=Symbol("IS_EMPTY"),v4=["ansi","ansi","ansi256","ansi16m"],N0=Object.create(null),l7=(q,$={})=>{if($.level&&!(Number.isInteger($.level)&&$.level>=0&&$.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let X=g4?g4.level:0;q.level=$.level===void 0?X:$.level};var c7=(q)=>{let $=(...X)=>X.join(" ");return l7($,q),Object.setPrototypeOf($,Zq.prototype),$};function Zq(q){return c7(q)}Object.setPrototypeOf(Zq.prototype,Function.prototype);for(let[q,$]of Object.entries(m))N0[q]={get(){let X=U$(this,c1($.open,$.close,this[j0]),this[Xq]);return Object.defineProperty(this,q,{value:X}),X}};N0.visible={get(){let q=U$(this,this[j0],!0);return Object.defineProperty(this,"visible",{value:q}),q}};var l1=(q,$,X,...Z)=>{if(q==="rgb"){if($==="ansi16m")return m[X].ansi16m(...Z);if($==="ansi256")return m[X].ansi256(m.rgbToAnsi256(...Z));return m[X].ansi(m.rgbToAnsi(...Z))}if(q==="hex")return l1("rgb",$,X,...m.hexToRgb(...Z));return m[X][q](...Z)},i7=["rgb","hex","ansi256"];for(let q of i7){N0[q]={get(){let{level:X}=this;return function(...Z){let H=c1(l1(q,v4[X],"color",...Z),m.color.close,this[j0]);return U$(this,H,this[Xq])}}};let $="bg"+q[0].toUpperCase()+q.slice(1);N0[$]={get(){let{level:X}=this;return function(...Z){let H=c1(l1(q,v4[X],"bgColor",...Z),m.bgColor.close,this[j0]);return U$(this,H,this[Xq])}}}}var a7=Object.defineProperties(()=>{},{...N0,level:{enumerable:!0,get(){return this[p1].level},set(q){this[p1].level=q}}}),c1=(q,$,X)=>{let Z,H;if(X===void 0)Z=q,H=$;else Z=X.openAll+q,H=$+X.closeAll;return{open:q,close:$,openAll:Z,closeAll:H,parent:X}},U$=(q,$,X)=>{let Z=(...H)=>s7(Z,H.length===1?""+H[0]:H.join(" "));return Object.setPrototypeOf(Z,a7),Z[p1]=q,Z[j0]=$,Z[Xq]=X,Z},s7=(q,$)=>{if(q.level<=0||!$)return q[Xq]?"":$;let X=q[j0];if(X===void 0)return $;let{openAll:Z,closeAll:H}=X;if($.includes("\x1B"))while(X!==void 0)$=k4($,X.close,X.open),X=X.parent;let z=$.indexOf(`
|
|
220
|
+
`);if(z!==-1)$=h4($,H,Z,z);return Z+$+H};Object.defineProperties(Zq.prototype,N0);var r7=Zq(),tT=Zq({level:u4?u4.level:0});var M=r7;var m4="\u2500".repeat(55);function n7(q){if(q==="success")return M.green;if(q==="warning")return M.yellow;return M.red}function o7(q){if(q>=70)return M.green;if(q>=50)return M.yellow;return M.red}function t7(q){if(q.label==="Error")return q.label;return`${q.label} (${q.confidence}%)`}function e7(q){let $=$q(q),X=n7($.tone);return{icon:X($.icon),status:t7($),color:X}}function qG(q){let $=q.target?.target??"default",X=q.context?.name??"default";if($==="default"&&X==="default")return"";if(X==="default")return M.dim(`[${$}]`);return M.dim(`[${$}/${X}]`)}function $G(q){let $=q.map((X)=>X.scenario.name);return new Set($).size!==$.length}function Q$(q){return q.map(($)=>`[${$}]`).join(", ")}function d4(q,$){let X=[];if(q.error)return X.push(M.dim(`${$}error: ${q.error}`)),X;if(q.traps.fired.length>0)for(let Z of q.traps.fired)X.push(M.red(`${$}trap: ${Z.id}`)),X.push(M.dim(`${$}reason: ${Z.reason}`)),X.push(M.dim(`${$}match: "${Z.matched}"`));else if(q.reason&&q.answerable!=="YES")X.push(M.dim(`${$}reason: ${q.reason}`));if(q.citations.cited.length>0)X.push(M.dim(`${$}cited: ${Q$(q.citations.cited)}`));if(q.citations.missing.length>0)X.push(M.dim(`${$}missing: ${Q$(q.citations.missing)}`));if(q.citations.unknown.length>0)X.push(M.dim(`${$}unknown: ${Q$(q.citations.unknown)}`));return X}function p4(q){let{icon:$,status:X,color:Z}=e7(q),H=qG(q),z=`${$} ${X}`;return H?`${H} ${Z(z)}`:Z(z)}function XG(q){let $=q.reduce((H,z)=>{return H+z.traps.fired.length},0),X=q.reduce((H,z)=>{return H+z.citations.missing.length},0),Z=q.reduce((H,z)=>{return H+z.citations.unknown.length},0);if($>0&&X+Z>0)return"Review fired traps and citation gaps.";if($>0)return"Review fired traps before trusting this surface.";if(X+Z>0)return"Review missing and unknown citations.";return"Citations hold. No declared traps fired."}function ZG(q,$){let X=q.summary.score,H=`Overall: ${o7(X)(`${X}`)} / 100`;if($===void 0||$<=0)return H;let U=X>=$?M.green("run passes"):M.red("run fails");return`${H} \xB7 threshold ${$} \xB7 ${U}`}function l4(q,$={}){let{tool:X,scenarios:Z,summary:H}=q,z=Z,U=[];if(U.push(M.bold("pickled check")),U.push(m4),U.push(`Tool: ${M.cyan(X.name)}`),q.docs.length>0)U.push(`Sources: ${M.dim(Q$(q.docs.map((Q)=>Q.id)))}`);else U.push(`Sources: ${M.dim("none registered")}`);if(U.push(`Scenarios: ${M.dim(String(H.total))}`),U.push(""),$G(z)){let Q=new Map;for(let J of z){let G=J.scenario.name;if(!Q.has(G))Q.set(G,[]);Q.get(G)?.push(J)}for(let[J,G]of Q){U.push(`Scenario: ${J}`);for(let Y of G)U.push(` ${p4(Y)}`),U.push(...d4(Y," "));U.push("")}}else for(let Q of z)U.push(`Scenario: ${Q.scenario.name}`),U.push(` ${p4(Q)}`),U.push(...d4(Q," ")),U.push("");return U.push(m4),U.push(ZG(q,$.threshold)),U.push(M.dim(XG(Z))),U.join(`
|
|
221
|
+
`)}function i1(q,$={}){console.log(l4(q,$)),console.log()}function G$(q,$={}){if($.verbose)return JSON.stringify(q,null,2);let X={...q,docs:q.docs.map((Z)=>({...Z,content:""})),scenarios:q.scenarios.map((Z)=>{let{allResponses:H,...z}=Z;return z})};return JSON.stringify(X,null,2)}function zG(q){if(q.format&&q.format!=="terminal")return q.format;if(q.json)return"json";return q.format??"terminal"}async function c4(q,$){let{output:X}=$,Z=zG($),H=HG.resolve(q),z;try{z=await $$({targetRepo:H})}catch(T){console.error(M.red(T instanceof Error?T.message:T)),process.exit(1)}let U;if(Z==="json")U=rq(z);else if(Z==="markdown")U=sq(z);else U=nq(z);if(X)await Bun.write(X,U);else await UG(`${U}
|
|
222
|
+
`);let Q=z.findings.filter((T)=>T.severity==="error").length,J=z.findings.filter((T)=>T.severity==="warning").length;if(Z!=="json"&&!X)if(console.log(),Q===0&&J===0)console.log(M.green("Audit clean. No issues found."));else{let T=Q>0?M.red:M.yellow;console.log(T(`Audit found ${Q} error(s), ${J} warning(s).`))}if(($.failOn??"error")==="warning"?Q+J>0:Q>0)process.exit(1)}function UG(q){return new Promise(($,X)=>{process.stdout.write(q,(Z)=>{if(Z)X(Z);else $()})})}import QG from"path";async function i4(q,$){let{json:X,output:Z,verbose:H}=$,z=(L)=>!X&&console.log(L),U=QG.resolve(q),Q;try{Q=await aq(U)}catch(L){console.error(M.red(L instanceof Error?L.message:L)),console.error(),console.error(M.dim("Run `pickled init` to create a config file")),process.exit(1)}if($.target){let L=Q.scenarios.length;try{Q=b1(Q,$.target)}catch(V){console.error(M.red(V instanceof Error?V.message:String(V))),process.exit(1)}let _=L-Q.scenarios.length;if(_>0&&!X)z(M.dim(`Skipping ${_} scenario(s) with explicit target != "${$.target}"`))}let J={name:Q.tool.name,description:Q.tool.description,path:U};if(H){z(M.bold("pickled check")),z(""),z(M.dim(` Tool: ${J.name}`)),z(M.dim(` Scenarios: ${Q.scenarios.length}`));for(let L of Q.scenarios)z(M.dim(` - ${L.name}`))}let G=await m1(J,Q,{onProgress:H?(L)=>{if(!X)z(M.dim(` ${L}`))}:void 0}),Y=$.threshold?parseInt($.threshold,10):Q.threshold??0,T=Y>0&&G.summary.score<Y;if(Z)await Bun.write(Z,G$(G,{verbose:H}));else if(X)await GG(`${G$(G,{verbose:H})}
|
|
223
|
+
`);else i1(G,{threshold:Y});if(T){if(X||Z)console.error(M.red(`Overall: ${G.summary.score} / 100 \xB7 threshold ${Y} \xB7 run fails`)),console.error(M.dim("Review failed scenarios before trusting this surface."));process.exit(1)}}function GG(q){return new Promise(($,X)=>{process.stdout.write(q,(Z)=>{if(Z)X(Z);else $()})})}import JG from"path";var TG=`# pickled.yml - Agent legibility check for your product
|
|
266
224
|
|
|
267
225
|
tool:
|
|
268
226
|
name: "your-product"
|
|
@@ -284,4 +242,4 @@ scenarios:
|
|
|
284
242
|
|
|
285
243
|
# Optional: fail CI if score falls below threshold
|
|
286
244
|
# threshold: 80
|
|
287
|
-
`;async function
|
|
245
|
+
`;async function a4(q){let X=`${JG.resolve(q)}/pickled.yml`;if(await Bun.file(X).exists())console.error(M.red("pickled.yml already exists")),process.exit(1);await Bun.write(X,TG),console.log(M.green("Created pickled.yml")),console.log(),console.log(M.dim("Next steps:")),console.log(M.dim(" 1. Edit pickled.yml: list your sources and scenarios")),console.log(M.dim(" 2. Run: pickled check")),console.log()}B0.name("pickled").description("Test what agents actually understand about your product").version(B2.version);B0.command("init").description("Create a pickled.yml config file").argument("[path]","Path to your project (default: current directory)",".").action(a4);B0.command("audit").description("Static scan of agent-context files (CLAUDE.md, AGENTS.md, llms.txt). No LLM calls.").argument("[path]","Path to your project (default: current directory)",".").addOption(new I$("--format <name>","Output format").choices(["terminal","markdown","json"]).default("terminal")).option("--json","Shorthand for --format json").option("-o, --output <file>","Save report to file").addOption(new I$("--fail-on <level>","Exit non-zero on this severity or higher").choices(["error","warning"]).default("error")).action(c4);B0.command("check").description("Run agent scenarios against registered sources").argument("[path]","Path to your project (default: current directory)",".").option("--json","Output as JSON").option("-o, --output <file>","Save report to file").option("-v, --verbose","Show detailed progress").option("-t, --threshold <percent>","Minimum score % to pass (overrides config)").option("--target <name>","Run only the named target (overrides matrix.target)").action(i4);await B0.parseAsync();
|