@tsuga/cli 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +37 -37
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,57 +1,57 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var CO=Object.create;var bs=Object.defineProperty;var PO=Object.getOwnPropertyDescriptor;var UO=Object.getOwnPropertyNames;var NO=Object.getPrototypeOf,kO=Object.prototype.hasOwnProperty;var Gr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),It=(e,t)=>{for(var r in t)bs(e,r,{get:t[r],enumerable:!0})},LO=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of UO(t))!kO.call(e,i)&&i!==r&&bs(e,i,{get:()=>t[i],enumerable:!(o=PO(t,i))||o.enumerable});return e};var _u=(e,t,r)=>(r=e!=null?CO(NO(e)):{},LO(t||!e||!e.__esModule?bs(r,"default",{value:e,enumerable:!0}):r,e));var Ao=Gr(Cs=>{var Ji=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Rs=class extends Ji{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Cs.CommanderError=Ji;Cs.InvalidArgumentError=Rs});var ea=Gr(Us=>{var{InvalidArgumentError:MO}=Ao(),Ps=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new MO(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function wO(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Us.Argument=Ps;Us.humanReadableArgName=wO});var Ls=Gr(ks=>{var{humanReadableArgName:$O}=ea(),Ns=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(i=>!i._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((i,s)=>i.name().localeCompare(s.name())),r}compareOptions(t,r){let o=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(i=>!i.hidden),o=t._getHelpOption();if(o&&!o.hidden){let i=o.short&&t._findOption(o.short),s=o.long&&t._findOption(o.long);!i&&!s?r.push(o):o.long&&!s?r.push(t.createOption(o.long,o.description)):o.short&&!i&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let i=o.options.filter(s=>!s.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>$O(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let i=t.parent;i;i=i.parent)o=i.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];return t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0?`${t.description} (${r.join(", ")})`:t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatHelp(t,r){let o=r.padWidth(t,r),i=r.helpWidth??80;function s(I,C){return r.formatItem(I,o,C,r)}let m=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],u=r.commandDescription(t);u.length>0&&(m=m.concat([r.boxWrap(r.styleCommandDescription(u),i),""]));let l=r.visibleArguments(t).map(I=>s(r.styleArgumentTerm(r.argumentTerm(I)),r.styleArgumentDescription(r.argumentDescription(I))));l.length>0&&(m=m.concat([r.styleTitle("Arguments:"),...l,""]));let g=r.visibleOptions(t).map(I=>s(r.styleOptionTerm(r.optionTerm(I)),r.styleOptionDescription(r.optionDescription(I))));if(g.length>0&&(m=m.concat([r.styleTitle("Options:"),...g,""])),r.showGlobalOptions){let I=r.visibleGlobalOptions(t).map(C=>s(r.styleOptionTerm(r.optionTerm(C)),r.styleOptionDescription(r.optionDescription(C))));I.length>0&&(m=m.concat([r.styleTitle("Global Options:"),...I,""]))}let E=r.visibleCommands(t).map(I=>s(r.styleSubcommandTerm(r.subcommandTerm(I)),r.styleSubcommandDescription(r.subcommandDescription(I))));return E.length>0&&(m=m.concat([r.styleTitle("Commands:"),...E,""])),m.join(`
3
- `)}displayWidth(t){return Au(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,i){let m=" ".repeat(2);if(!o)return m+t;let u=t.padEnd(r+t.length-i.displayWidth(t)),l=2,E=(this.helpWidth??80)-r-l-2,I;return E<this.minWidthToWrap||i.preformatted(o)?I=o:I=i.boxWrap(o,E).replace(/\n/g,`
4
- `+" ".repeat(r+l)),m+u+" ".repeat(l)+I.replace(/\n/g,`
5
- ${m}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return o.forEach(m=>{let u=m.match(i);if(u===null){s.push("");return}let l=[u.shift()],g=this.displayWidth(l[0]);u.forEach(E=>{let I=this.displayWidth(E);if(g+I<=r){l.push(E),g+=I;return}s.push(l.join(""));let C=E.trimStart();l=[C],g=this.displayWidth(C)}),s.push(l.join(""))}),s.join(`
6
- `)}};function Au(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}ks.Help=Ns;ks.stripColor=Au});var Ds=Gr($s=>{var{InvalidArgumentError:DO}=Ao(),Ms=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=GO(t);this.short=o.shortFlag,this.long=o.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}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new DO(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?xu(this.name().replace(/^no-/,"")):xu(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ws=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let i=this.negativeOptions.get(o).presetArg,s=i!==void 0?i:!1;return r.negate===(s===t)}};function xu(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function GO(e){let t,r,o=/^-[^-]$/,i=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(o.test(s[0])&&(t=s.shift()),i.test(s[0])&&(r=s.shift()),!t&&o.test(s[0])&&(t=s.shift()),!t&&i.test(s[0])&&(t=r,r=s.shift()),s[0].startsWith("-")){let m=s[0],u=`option creation failed due to '${m}' in option flags '${e}'`;throw/^-[^-][^-]/.test(m)?new Error(`${u}
2
+ "use strict";var lx=Object.create;var Ks=Object.defineProperty;var dx=Object.getOwnPropertyDescriptor;var fx=Object.getOwnPropertyNames;var gx=Object.getPrototypeOf,yx=Object.prototype.hasOwnProperty;var Kr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ht=(e,t)=>{for(var r in t)Ks(e,r,{get:t[r],enumerable:!0})},Ex=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fx(t))!yx.call(e,i)&&i!==r&&Ks(e,i,{get:()=>t[i],enumerable:!(o=dx(t,i))||o.enumerable});return e};var $u=(e,t,r)=>(r=e!=null?lx(gx(e)):{},Ex(t||!e||!e.__esModule?Ks(r,"default",{value:e,enumerable:!0}):r,e));var Co=Kr(Vs=>{var ca=class extends Error{constructor(t,r,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},zs=class extends ca{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Vs.CommanderError=ca;Vs.InvalidArgumentError=zs});var ma=Kr(Qs=>{var{InvalidArgumentError:Ix}=Co(),Ys=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new Ix(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Tx(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Qs.Argument=Ys;Qs.humanReadableArgName=Tx});var Xs=Kr(Zs=>{var{humanReadableArgName:_x}=ma(),Ws=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(i=>!i._hidden),o=t._getHelpCommand();return o&&!o._hidden&&r.push(o),this.sortSubcommands&&r.sort((i,s)=>i.name().localeCompare(s.name())),r}compareOptions(t,r){let o=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return o(t).localeCompare(o(r))}visibleOptions(t){let r=t.options.filter(i=>!i.hidden),o=t._getHelpOption();if(o&&!o.hidden){let i=o.short&&t._findOption(o.short),s=o.long&&t._findOption(o.long);!i&&!s?r.push(o):o.long&&!s?r.push(t.createOption(o.long,o.description)):o.short&&!i&&r.push(t.createOption(o.short,o.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let o=t.parent;o;o=o.parent){let i=o.options.filter(s=>!s.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(o=>_x(o)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((o,i)=>Math.max(o,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let o="";for(let i=t.parent;i;i=i.parent)o=i.name()+" "+o;return o+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];return t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0?`${t.description} (${r.join(", ")})`:t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(o=>JSON.stringify(o)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let o=`(${r.join(", ")})`;return t.description?`${t.description} ${o}`:o}return t.description}formatHelp(t,r){let o=r.padWidth(t,r),i=r.helpWidth??80;function s(I,P){return r.formatItem(I,o,P,r)}let c=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],u=r.commandDescription(t);u.length>0&&(c=c.concat([r.boxWrap(r.styleCommandDescription(u),i),""]));let l=r.visibleArguments(t).map(I=>s(r.styleArgumentTerm(r.argumentTerm(I)),r.styleArgumentDescription(r.argumentDescription(I))));l.length>0&&(c=c.concat([r.styleTitle("Arguments:"),...l,""]));let g=r.visibleOptions(t).map(I=>s(r.styleOptionTerm(r.optionTerm(I)),r.styleOptionDescription(r.optionDescription(I))));if(g.length>0&&(c=c.concat([r.styleTitle("Options:"),...g,""])),r.showGlobalOptions){let I=r.visibleGlobalOptions(t).map(P=>s(r.styleOptionTerm(r.optionTerm(P)),r.styleOptionDescription(r.optionDescription(P))));I.length>0&&(c=c.concat([r.styleTitle("Global Options:"),...I,""]))}let E=r.visibleCommands(t).map(I=>s(r.styleSubcommandTerm(r.subcommandTerm(I)),r.styleSubcommandDescription(r.subcommandDescription(I))));return E.length>0&&(c=c.concat([r.styleTitle("Commands:"),...E,""])),c.join(`
3
+ `)}displayWidth(t){return Du(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,o,i){let c=" ".repeat(2);if(!o)return c+t;let u=t.padEnd(r+t.length-i.displayWidth(t)),l=2,E=(this.helpWidth??80)-r-l-2,I;return E<this.minWidthToWrap||i.preformatted(o)?I=o:I=i.boxWrap(o,E).replace(/\n/g,`
4
+ `+" ".repeat(r+l)),c+u+" ".repeat(l)+I.replace(/\n/g,`
5
+ ${c}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let o=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return o.forEach(c=>{let u=c.match(i);if(u===null){s.push("");return}let l=[u.shift()],g=this.displayWidth(l[0]);u.forEach(E=>{let I=this.displayWidth(E);if(g+I<=r){l.push(E),g+=I;return}s.push(l.join(""));let P=E.trimStart();l=[P],g=this.displayWidth(P)}),s.push(l.join(""))}),s.join(`
6
+ `)}};function Du(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Zs.Help=Ws;Zs.stripColor=Du});var rp=Kr(tp=>{var{InvalidArgumentError:hx}=Co(),Js=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let o=Ox(t);this.short=o.shortFlag,this.long=o.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}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,o)=>{if(!this.argChoices.includes(r))throw new hx(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,o):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Gu(this.name().replace(/^no-/,"")):Gu(this.name())}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ep=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,o)=>{this.positiveOptions.has(o)&&this.dualOptions.add(o)})}valueFromOption(t,r){let o=r.attributeName();if(!this.dualOptions.has(o))return!0;let i=this.negativeOptions.get(o).presetArg,s=i!==void 0?i:!1;return r.negate===(s===t)}};function Gu(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Ox(e){let t,r,o=/^-[^-]$/,i=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(o.test(s[0])&&(t=s.shift()),i.test(s[0])&&(r=s.shift()),!t&&o.test(s[0])&&(t=s.shift()),!t&&i.test(s[0])&&(t=r,r=s.shift()),s[0].startsWith("-")){let c=s[0],u=`option creation failed due to '${c}' in option flags '${e}'`;throw/^-[^-][^-]/.test(c)?new Error(`${u}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
- - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(m)?new Error(`${u}
10
- - too many short flags`):i.test(m)?new Error(`${u}
9
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):o.test(c)?new Error(`${u}
10
+ - too many short flags`):i.test(c)?new Error(`${u}
11
11
  - too many long flags`):new Error(`${u}
12
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}$s.Option=Ms;$s.DualOptions=ws});var Ou=Gr(Su=>{function vO(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let i=1;i<=e.length;i++){let s=1;e[i-1]===t[o-1]?s=0:s=1,r[i][o]=Math.min(r[i-1][o]+1,r[i][o-1]+1,r[i-1][o-1]+s),i>1&&o>1&&e[i-1]===t[o-2]&&e[i-2]===t[o-1]&&(r[i][o]=Math.min(r[i][o],r[i-2][o-2]+1))}return r[e.length][t.length]}function jO(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(m=>m.slice(2)));let o=[],i=3,s=.4;return t.forEach(m=>{if(m.length<=1)return;let u=vO(e,m),l=Math.max(e.length,m.length);(l-u)/l>s&&(u<i?(i=u,o=[m]):u===i&&o.push(m))}),o.sort((m,u)=>m.localeCompare(u)),r&&(o=o.map(m=>`--${m}`)),o.length>1?`
12
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}tp.Option=Js;tp.DualOptions=ep});var ju=Kr(vu=>{function Ax(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let o=0;o<=e.length;o++)r[o]=[o];for(let o=0;o<=t.length;o++)r[0][o]=o;for(let o=1;o<=t.length;o++)for(let i=1;i<=e.length;i++){let s=1;e[i-1]===t[o-1]?s=0:s=1,r[i][o]=Math.min(r[i-1][o]+1,r[i][o-1]+1,r[i-1][o-1]+s),i>1&&o>1&&e[i-1]===t[o-2]&&e[i-2]===t[o-1]&&(r[i][o]=Math.min(r[i][o],r[i-2][o-2]+1))}return r[e.length][t.length]}function Sx(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(c=>c.slice(2)));let o=[],i=3,s=.4;return t.forEach(c=>{if(c.length<=1)return;let u=Ax(e,c),l=Math.max(e.length,c.length);(l-u)/l>s&&(u<i?(i=u,o=[c]):u===i&&o.push(c))}),o.sort((c,u)=>c.localeCompare(u)),r&&(o=o.map(c=>`--${c}`)),o.length>1?`
13
13
  (Did you mean one of ${o.join(", ")}?)`:o.length===1?`
14
- (Did you mean ${o[0]}?)`:""}Su.suggestSimilar=jO});var Pu=Gr(Bs=>{var FO=require("node:events").EventEmitter,Gs=require("node:child_process"),zt=require("node:path"),ta=require("node:fs"),ne=require("node:process"),{Argument:BO,humanReadableArgName:qO}=ea(),{CommanderError:vs}=Ao(),{Help:HO,stripColor:KO}=Ls(),{Option:bu,DualOptions:zO}=Ds(),{suggestSimilar:Ru}=Ou(),js=class e extends FO{constructor(t){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=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>ne.stdout.write(r),writeErr:r=>ne.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>ne.stdout.isTTY?ne.stdout.columns:void 0,getErrHelpWidth:()=>ne.stderr.isTTY?ne.stderr.columns:void 0,getOutHasColors:()=>Fs()??(ne.stdout.isTTY&&ne.stdout.hasColors?.()),getErrHasColors:()=>Fs()??(ne.stderr.isTTY&&ne.stderr.hasColors?.()),stripColor:r=>KO(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let i=r,s=o;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,m,u]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(m);return i&&(l.description(i),l._executableHandler=!0),s.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(s.noHelp||s.hidden),l._executableFile=s.executableFile||null,u&&l.arguments(u),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new HO,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new BO(t,r)}argument(t,r,o,i){let s=this.createArgument(t,r);return typeof o=="function"?s.default(i).argParser(o):s.default(o),this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,this;t=t??"help [command]";let[,o,i]=t.match(/([^ ]+) *(.*)/),s=r??"display help for command",m=this.createCommand(o);return m.helpOption(!1),i&&m.arguments(i),s&&m.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=m,this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
- Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new vs(t,r,o)),ne.exit(t)}action(t){let r=o=>{let i=this.registeredArguments.length,s=o.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=r,this}createOption(t,r){return new bu(t,r)}_callParseArg(t,r,o,i){try{return t.parseArg(r,o)}catch(s){if(s.code==="commander.invalidArgument"){let m=`${i} ${s.message}`;this.error(m,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
17
- - already used by option '${r.flags}'`)}this.options.push(t)}_registerCommand(t){let r=i=>[i.name()].concat(i.aliases()),o=r(t).find(i=>this._findCommand(i));if(o){let i=r(this._findCommand(o)).join("|"),s=r(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();if(t.negate){let s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(o,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let i=(s,m,u)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let l=this.getOptionValue(o);s!==null&&t.parseArg?s=this._callParseArg(t,s,l,m):s!==null&&t.variadic&&(s=t._concatValue(s,l)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(o,s,u)};return this.on("option:"+r,s=>{let m=`error: option '${t.flags}' argument '${s}' is invalid.`;i(s,m,"cli")}),t.envVar&&this.on("optionEnv:"+r,s=>{let m=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;i(s,m,"env")}),this}_optionEx(t,r,o,i,s){if(typeof r=="object"&&r instanceof bu)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let m=this.createOption(r,o);if(m.makeOptionMandatory(!!t.mandatory),typeof i=="function")m.default(s).argParser(i);else if(i instanceof RegExp){let u=i;i=(l,g)=>{let E=u.exec(l);return E?E[0]:g},m.default(s).argParser(i)}else m.default(i);return this.addOption(m)}option(t,r,o,i){return this._optionEx({},t,r,o,i)}requiredOption(t,r,o,i){return this._optionEx({mandatory:!0},t,r,o,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){ne.versions?.electron&&(r.from="electron");let i=ne.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=ne.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":ne.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,o){if(ta.existsSync(t))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${t}' does not exist
14
+ (Did you mean ${o[0]}?)`:""}vu.suggestSimilar=Sx});var Hu=Kr(sp=>{var bx=require("node:events").EventEmitter,np=require("node:child_process"),Qt=require("node:path"),ua=require("node:fs"),ne=require("node:process"),{Argument:xx,humanReadableArgName:Rx}=ma(),{CommanderError:op}=Co(),{Help:Cx,stripColor:Px}=Xs(),{Option:Fu,DualOptions:Ux}=rp(),{suggestSimilar:Bu}=ju(),ip=class e extends bx{constructor(t){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=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>ne.stdout.write(r),writeErr:r=>ne.stderr.write(r),outputError:(r,o)=>o(r),getOutHelpWidth:()=>ne.stdout.isTTY?ne.stdout.columns:void 0,getErrHelpWidth:()=>ne.stderr.isTTY?ne.stderr.columns:void 0,getOutHasColors:()=>ap()??(ne.stdout.isTTY&&ne.stdout.hasColors?.()),getErrHasColors:()=>ap()??(ne.stderr.isTTY&&ne.stderr.hasColors?.()),stripColor:r=>Px(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,o){let i=r,s=o;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,c,u]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(c);return i&&(l.description(i),l._executableHandler=!0),s.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(s.noHelp||s.hidden),l._executableFile=s.executableFile||null,u&&l.arguments(u),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Cx,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new xx(t,r)}argument(t,r,o,i){let s=this.createArgument(t,r);return typeof o=="function"?s.default(i).argParser(o):s.default(o),this.addArgument(s),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,this;t=t??"help [command]";let[,o,i]=t.match(/([^ ]+) *(.*)/),s=r??"display help for command",c=this.createCommand(o);return c.helpOption(!1),i&&c.arguments(i),s&&c.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=c,this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let o=["preSubcommand","preAction","postAction"];if(!o.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
+ Expecting one of '${o.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,o){this._exitCallback&&this._exitCallback(new op(t,r,o)),ne.exit(t)}action(t){let r=o=>{let i=this.registeredArguments.length,s=o.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=r,this}createOption(t,r){return new Fu(t,r)}_callParseArg(t,r,o,i){try{return t.parseArg(r,o)}catch(s){if(s.code==="commander.invalidArgument"){let c=`${i} ${s.message}`;this.error(c,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let o=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${o}'
17
+ - already used by option '${r.flags}'`)}this.options.push(t)}_registerCommand(t){let r=i=>[i.name()].concat(i.aliases()),o=r(t).find(i=>this._findCommand(i));if(o){let i=r(this._findCommand(o)).join("|"),s=r(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),o=t.attributeName();if(t.negate){let s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(o,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(o,t.defaultValue,"default");let i=(s,c,u)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let l=this.getOptionValue(o);s!==null&&t.parseArg?s=this._callParseArg(t,s,l,c):s!==null&&t.variadic&&(s=t._concatValue(s,l)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(o,s,u)};return this.on("option:"+r,s=>{let c=`error: option '${t.flags}' argument '${s}' is invalid.`;i(s,c,"cli")}),t.envVar&&this.on("optionEnv:"+r,s=>{let c=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;i(s,c,"env")}),this}_optionEx(t,r,o,i,s){if(typeof r=="object"&&r instanceof Fu)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let c=this.createOption(r,o);if(c.makeOptionMandatory(!!t.mandatory),typeof i=="function")c.default(s).argParser(i);else if(i instanceof RegExp){let u=i;i=(l,g)=>{let E=u.exec(l);return E?E[0]:g},c.default(s).argParser(i)}else c.default(i);return this.addOption(c)}option(t,r,o,i){return this._optionEx({},t,r,o,i)}requiredOption(t,r,o,i){return this._optionEx({mandatory:!0},t,r,o,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,o){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=o,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(o=>{o.getOptionValueSource(t)!==void 0&&(r=o.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){ne.versions?.electron&&(r.from="electron");let i=ne.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=ne.argv),this.rawArgs=t.slice();let o;switch(r.from){case void 0:case"node":this._scriptPath=t[1],o=t.slice(2);break;case"electron":ne.defaultApp?(this._scriptPath=t[1],o=t.slice(2)):o=t.slice(1);break;case"user":o=t.slice(0);break;case"eval":o=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",o}parse(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return this._parseCommand([],o),this}async parseAsync(t,r){this._prepareForParse();let o=this._prepareUserArgs(t,r);return await this._parseCommand([],o),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,o){if(ua.existsSync(t))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${t}' does not exist
19
19
  - if '${o}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${i}`;throw new Error(s)}_executeSubCommand(t,r){r=r.slice();let o=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(E,I){let C=zt.resolve(E,I);if(ta.existsSync(C))return C;if(i.includes(zt.extname(I)))return;let Re=i.find(je=>ta.existsSync(`${C}${je}`));if(Re)return`${C}${Re}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let m=t._executableFile||`${this._name}-${t._name}`,u=this._executableDir||"";if(this._scriptPath){let E;try{E=ta.realpathSync(this._scriptPath)}catch{E=this._scriptPath}u=zt.resolve(zt.dirname(E),u)}if(u){let E=s(u,m);if(!E&&!t._executableFile&&this._scriptPath){let I=zt.basename(this._scriptPath,zt.extname(this._scriptPath));I!==this._name&&(E=s(u,`${I}-${t._name}`))}m=E||m}o=i.includes(zt.extname(m));let l;ne.platform!=="win32"?o?(r.unshift(m),r=Cu(ne.execArgv).concat(r),l=Gs.spawn(ne.argv[0],r,{stdio:"inherit"})):l=Gs.spawn(m,r,{stdio:"inherit"}):(this._checkForMissingExecutable(m,u,t._name),r.unshift(m),r=Cu(ne.execArgv).concat(r),l=Gs.spawn(ne.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(I=>{ne.on(I,()=>{l.killed===!1&&l.exitCode===null&&l.kill(I)})});let g=this._exitCallback;l.on("close",E=>{E=E??1,g?g(new vs(E,"commander.executeSubCommandAsync","(close)")):ne.exit(E)}),l.on("error",E=>{if(E.code==="ENOENT")this._checkForMissingExecutable(m,u,t._name);else if(E.code==="EACCES")throw new Error(`'${m}' not executable`);if(!g)ne.exit(1);else{let I=new vs(1,"commander.executeSubCommandAsync","(error)");I.nestedError=E,g(I)}}),this.runningCommand=l}_dispatchSubcommand(t,r,o){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(o));else return i._parseCommand(r,o)}),s}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,i,s)=>{let m=i;if(i!==null&&o.parseArg){let u=`error: command-argument value '${i}' is invalid for argument '${o.name()}'.`;m=this._callParseArg(o,i,s,u)}return m};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,i)=>{let s=o.defaultValue;o.variadic?i<this.args.length?(s=this.args.slice(i),o.parseArg&&(s=s.reduce((m,u)=>t(o,u,m),o.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],o.parseArg&&(s=t(o,s,o.defaultValue))),r[i]=s}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,i=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(m=>{i.push({hookedCommand:s,callback:m})})}),r==="postAction"&&i.reverse(),i.forEach(s=>{o=this._chainOrCall(o,()=>s.callback(s.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let i=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(s=>{i=this._chainOrCall(i,()=>s(this,r))}),i}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let m;return m=this._chainOrCallHooks(m,"preAction"),m=this._chainOrCall(m,()=>this._actionHandler(this.processedArgs)),this.parent&&(m=this._chainOrCall(m,()=>{this.parent.emit(s,t,r)})),m=this._chainOrCallHooks(m,"postAction"),m}if(this.parent&&this.parent.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let i=o.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let i=t.find(s=>o.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(o,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],i=r,s=t.slice();function m(l){return l.length>1&&l[0]==="-"}let u=null;for(;s.length;){let l=s.shift();if(l==="--"){i===o&&i.push(l),i.push(...s);break}if(u&&!m(l)){this.emit(`option:${u.name()}`,l);continue}if(u=null,m(l)){let g=this._findOption(l);if(g){if(g.required){let E=s.shift();E===void 0&&this.optionMissingArgument(g),this.emit(`option:${g.name()}`,E)}else if(g.optional){let E=null;s.length>0&&!m(s[0])&&(E=s.shift()),this.emit(`option:${g.name()}`,E)}else this.emit(`option:${g.name()}`);u=g.variadic?g:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let g=this._findOption(`-${l[1]}`);if(g){g.required||g.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${g.name()}`,l.slice(2)):(this.emit(`option:${g.name()}`),s.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let g=l.indexOf("="),E=this._findOption(l.slice(0,g));if(E&&(E.required||E.optional)){this.emit(`option:${E.name()}`,l.slice(g+1));continue}}if(m(l)&&(i=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(l)){r.push(l),s.length>0&&o.push(...s);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),s.length>0&&r.push(...s);break}else if(this._defaultCommandName){o.push(l),s.length>0&&o.push(...s);break}}if(this._passThroughOptions){i.push(l),s.length>0&&i.push(...s);break}i.push(l)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let i=this.options[o].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
21
+ - ${i}`;throw new Error(s)}_executeSubCommand(t,r){r=r.slice();let o=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(E,I){let P=Qt.resolve(E,I);if(ua.existsSync(P))return P;if(i.includes(Qt.extname(I)))return;let be=i.find(ve=>ua.existsSync(`${P}${ve}`));if(be)return`${P}${be}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let c=t._executableFile||`${this._name}-${t._name}`,u=this._executableDir||"";if(this._scriptPath){let E;try{E=ua.realpathSync(this._scriptPath)}catch{E=this._scriptPath}u=Qt.resolve(Qt.dirname(E),u)}if(u){let E=s(u,c);if(!E&&!t._executableFile&&this._scriptPath){let I=Qt.basename(this._scriptPath,Qt.extname(this._scriptPath));I!==this._name&&(E=s(u,`${I}-${t._name}`))}c=E||c}o=i.includes(Qt.extname(c));let l;ne.platform!=="win32"?o?(r.unshift(c),r=qu(ne.execArgv).concat(r),l=np.spawn(ne.argv[0],r,{stdio:"inherit"})):l=np.spawn(c,r,{stdio:"inherit"}):(this._checkForMissingExecutable(c,u,t._name),r.unshift(c),r=qu(ne.execArgv).concat(r),l=np.spawn(ne.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(I=>{ne.on(I,()=>{l.killed===!1&&l.exitCode===null&&l.kill(I)})});let g=this._exitCallback;l.on("close",E=>{E=E??1,g?g(new op(E,"commander.executeSubCommandAsync","(close)")):ne.exit(E)}),l.on("error",E=>{if(E.code==="ENOENT")this._checkForMissingExecutable(c,u,t._name);else if(E.code==="EACCES")throw new Error(`'${c}' not executable`);if(!g)ne.exit(1);else{let I=new op(1,"commander.executeSubCommandAsync","(error)");I.nestedError=E,g(I)}}),this.runningCommand=l}_dispatchSubcommand(t,r,o){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(o));else return i._parseCommand(r,o)}),s}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(o,i,s)=>{let c=i;if(i!==null&&o.parseArg){let u=`error: command-argument value '${i}' is invalid for argument '${o.name()}'.`;c=this._callParseArg(o,i,s,u)}return c};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((o,i)=>{let s=o.defaultValue;o.variadic?i<this.args.length?(s=this.args.slice(i),o.parseArg&&(s=s.reduce((c,u)=>t(o,u,c),o.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],o.parseArg&&(s=t(o,s,o.defaultValue))),r[i]=s}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let o=t,i=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(c=>{i.push({hookedCommand:s,callback:c})})}),r==="postAction"&&i.reverse(),i.forEach(s=>{o=this._chainOrCall(o,()=>s.callback(s.hookedCommand,this))}),o}_chainOrCallSubCommandHook(t,r,o){let i=t;return this._lifeCycleHooks[o]!==void 0&&this._lifeCycleHooks[o].forEach(s=>{i=this._chainOrCall(i,()=>s(this,r))}),i}_parseCommand(t,r){let o=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(o.operands),r=o.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(o.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{o.unknown.length>0&&this.unknownOption(o.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let c;return c=this._chainOrCallHooks(c,"preAction"),c=this._chainOrCall(c,()=>this._actionHandler(this.processedArgs)),this.parent&&(c=this._chainOrCall(c,()=>{this.parent.emit(s,t,r)})),c=this._chainOrCallHooks(c,"postAction"),c}if(this.parent&&this.parent.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(o=>{let i=o.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(o=>o.conflictsWith.length>0).forEach(o=>{let i=t.find(s=>o.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(o,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],o=[],i=r,s=t.slice();function c(l){return l.length>1&&l[0]==="-"}let u=null;for(;s.length;){let l=s.shift();if(l==="--"){i===o&&i.push(l),i.push(...s);break}if(u&&!c(l)){this.emit(`option:${u.name()}`,l);continue}if(u=null,c(l)){let g=this._findOption(l);if(g){if(g.required){let E=s.shift();E===void 0&&this.optionMissingArgument(g),this.emit(`option:${g.name()}`,E)}else if(g.optional){let E=null;s.length>0&&!c(s[0])&&(E=s.shift()),this.emit(`option:${g.name()}`,E)}else this.emit(`option:${g.name()}`);u=g.variadic?g:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let g=this._findOption(`-${l[1]}`);if(g){g.required||g.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${g.name()}`,l.slice(2)):(this.emit(`option:${g.name()}`),s.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let g=l.indexOf("="),E=this._findOption(l.slice(0,g));if(E&&(E.required||E.optional)){this.emit(`option:${E.name()}`,l.slice(g+1));continue}}if(c(l)&&(i=o),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&o.length===0){if(this._findCommand(l)){r.push(l),s.length>0&&o.push(...s);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),s.length>0&&r.push(...s);break}else if(this._defaultCommandName){o.push(l),s.length>0&&o.push(...s);break}}if(this._passThroughOptions){i.push(l),s.length>0&&i.push(...s);break}i.push(l)}return{operands:r,unknown:o}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let o=0;o<r;o++){let i=this.options[o].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0}));let o=r||{},i=o.exitCode||1,s=o.code||"commander.error";this._exit(i,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in ne.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,ne.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new zO(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,o.implied[i],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=m=>{let u=m.attributeName(),l=this.getOptionValue(u),g=this.options.find(I=>I.negate&&u===I.attributeName()),E=this.options.find(I=>!I.negate&&u===I.attributeName());return g&&(g.presetArg===void 0&&l===!1||g.presetArg!==void 0&&l===g.presetArg)?g:E||m},i=m=>{let u=o(m),l=u.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},s=`error: ${i(t)} cannot be used with ${i(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let m=s.createHelp().visibleOptions(s).filter(u=>u.long).map(u=>u.long);i=i.concat(m),s=s.parent}while(s&&!s._enablePositionalOptions);r=Ru(t,i)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${o} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),r=Ru(t,i)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let i=this.createOption(r,o);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
- `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>qO(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=zt.basename(t,zt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let i=r.formatHelp(this,r);return o.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let r=!!t.error,o,i,s;return r?(o=u=>this._outputConfiguration.writeErr(u),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(o=u=>this._outputConfiguration.writeOut(u),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:u=>(i||(u=this._outputConfiguration.stripColor(u)),o(u)),hasColors:i,helpWidth:s}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),i={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(m=>m.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let s=this.helpInformation({error:o.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(m=>m.emit("afterAllHelp",i))}helpOption(t,r){return typeof t=="boolean"?(t?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(t=t??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(t,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let r=Number(ne.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
- Expecting one of '${o.join("', '")}'`);let i=`${t}Help`;return this.on(i,s=>{let m;typeof r=="function"?m=r({error:s.error,command:s.command}):m=r,m&&s.write(`${m}
27
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Cu(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",i="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?i=s[3]:o=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],o=s[3],i=s[4]),r&&i!=="0"?`${r}=${o}:${parseInt(i)+1}`:t})}function Fs(){if(ne.env.NO_COLOR||ne.env.FORCE_COLOR==="0"||ne.env.FORCE_COLOR==="false")return!1;if(ne.env.FORCE_COLOR||ne.env.CLICOLOR_FORCE!==void 0)return!0}Bs.Command=js;Bs.useColor=Fs});var Lu=Gr(Tt=>{var{Argument:Uu}=ea(),{Command:qs}=Pu(),{CommanderError:YO,InvalidArgumentError:Nu}=Ao(),{Help:VO}=Ls(),{Option:ku}=Ds();Tt.program=new qs;Tt.createCommand=e=>new qs(e);Tt.createOption=(e,t)=>new ku(e,t);Tt.createArgument=(e,t)=>new Uu(e,t);Tt.Command=qs;Tt.Option=ku;Tt.Argument=Uu;Tt.Help=VO;Tt.CommanderError=YO;Tt.InvalidArgumentError=Nu;Tt.InvalidOptionArgumentError=Nu});var Mu=_u(Lu(),1),{program:pv,createCommand:mv,createArgument:cv,createOption:uv,CommanderError:lv,InvalidArgumentError:dv,InvalidOptionArgumentError:fv,Command:wu,Argument:gv,Option:yv,Help:Ev}=Mu.default;function Yt(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}var f={};It(f,{Assign:()=>WO,Clone:()=>So,Create:()=>Zb,Discard:()=>Xb,Metrics:()=>St,Update:()=>Jb});var St={assign:0,create:0,clone:0,discard:0,update:0};function WO(e,t){return St.assign+=1,{...e,...t}}var a={};It(a,{Entries:()=>Ib,EntriesRegExp:()=>Eb,Every:()=>fb,EveryAll:()=>gb,GraphemeCount:()=>ub,HasPropertyKey:()=>yb,IsArray:()=>vr,IsAsyncIterator:()=>tb,IsBigInt:()=>xo,IsBoolean:()=>Bu,IsClassInstance:()=>mb,IsConstructor:()=>rb,IsDeepEqual:()=>Ys,IsEqual:()=>Q,IsFunction:()=>qu,IsGreaterEqualThan:()=>Ku,IsGreaterThan:()=>ab,IsInteger:()=>Ks,IsIterator:()=>nb,IsLessEqualThan:()=>Hu,IsLessThan:()=>sb,IsMaxLength:()=>lb,IsMinLength:()=>db,IsMultipleOf:()=>pb,IsNull:()=>oa,IsNumber:()=>ia,IsObject:()=>jr,IsObjectNotArray:()=>ob,IsString:()=>cr,IsSymbol:()=>ib,IsUndefined:()=>zs,IsValueLike:()=>cb,Keys:()=>na,Symbols:()=>Tb,Values:()=>hb});function mr(e,t,r){return e>=t&&e<=r}function $u(e){return mr(e,127462,127487)}function QO(e){return mr(e,65024,65039)}function ZO(e){return mr(e,768,879)||mr(e,6832,6911)||mr(e,7616,7679)||mr(e,65056,65071)}function ra(e){return e>65535?2:1}function Du(e,t){for(;t<e.length;){let r=e.codePointAt(t);if(ZO(r)||QO(r))t+=ra(r);else break}return t}function Hs(e,t){let r=e.codePointAt(t),o=t+ra(r);for(o=Du(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+ra(i),o=Du(e,o)}return $u(r)&&o<e.length&&$u(e.codePointAt(o))&&(o+=ra(e.codePointAt(o))),o}function Gu(e){return mr(e,55296,56319)||mr(e,768,879)||e===8205}function vu(e){let t=0,r=0;for(;r<e.length;)r=Hs(e,r),t++;return t}function XO(e,t){let r=0,o=0;for(;o<e.length;)if(o=Hs(e,o),r++,r>=t)return!0;return!1}function JO(e,t){let r=0,o=0;for(;o<e.length;)if(o=Hs(e,o),r++,r>t)return!1;return!0}function ju(e,t){let r=0;for(;r<e.length;){if(Gu(e.charCodeAt(r)))return XO(e,t);if(r++,r>=t)return!0}return!1}function Fu(e,t){let r=0;for(;r<e.length;){if(Gu(e.charCodeAt(r)))return JO(e,t);if(r++,r>t)return!1}return!0}function vr(e){return Array.isArray(e)}function tb(e){return jr(e)&&Symbol.asyncIterator in e}function xo(e){return Q(typeof e,"bigint")}function Bu(e){return Q(typeof e,"boolean")}function rb(e){if(zs(e)||!qu(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function qu(e){return Q(typeof e,"function")}function Ks(e){return Number.isInteger(e)}function nb(e){return jr(e)&&Symbol.iterator in e}function oa(e){return Q(e,null)}function ia(e){return Number.isFinite(e)}function ob(e){return jr(e)&&!vr(e)}function jr(e){return Q(typeof e,"object")&&!oa(e)}function cr(e){return Q(typeof e,"string")}function ib(e){return Q(typeof e,"symbol")}function zs(e){return Q(e,void 0)}function Q(e,t){return e===t}function ab(e,t){return e>t}function sb(e,t){return e<t}function Hu(e,t){return e<=t}function Ku(e,t){return e>=t}function pb(e,t){if(xo(e)||xo(t))return BigInt(e)%BigInt(t)===0n;let r=1e-10;if(!ia(e)||Ks(e)&&1/t%1===0)return!0;let o=e%t;return Math.min(Math.abs(o),Math.abs(o-t))<r}function mb(e){if(!jr(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return oa(t)?!1:Q(typeof t.constructor,"function")&&!(Q(t.constructor,globalThis.Object)||Q(t.constructor.name,"Object"))}function cb(e){return xo(e)||Bu(e)||oa(e)||ia(e)||cr(e)||zs(e)}function ub(e){return vu(e)}function lb(e,t){return Fu(e,t)}function db(e,t){return ju(e,t)}function fb(e,t,r){for(let o=t;o<e.length;o++)if(!r(e[o],o))return!1;return!0}function gb(e,t,r){let o=!0;for(let i=t;i<e.length;i++)r(e[i],i)||(o=!1);return o}function yb(e,t){return Q(t,"__proto__")||Q(t,"constructor")?Object.prototype.hasOwnProperty.call(e,t):t in e}function Eb(e){return na(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function Ib(e){return Object.entries(e)}function na(e){return Object.getOwnPropertyNames(e)}function Tb(e){return Object.getOwnPropertySymbols(e)}function hb(e){return Object.values(e)}function _b(e,t){if(!jr(t))return!1;let r=na(e);return Q(r.length,na(t).length)&&r.every(o=>Ys(e[o],t[o]))}function Ab(e,t){return vr(t)&&Q(e.length,t.length)&&e.every((r,o)=>Ys(e[o],t[o]))}function Ys(e,t){return vr(e)?Ab(e,t):jr(e)?_b(e,t):Q(e,t)}var We={};It(We,{IsBigInt64Array:()=>$b,IsBigUint64Array:()=>Db,IsBoolean:()=>xb,IsDate:()=>vb,IsFloat32Array:()=>Mb,IsFloat64Array:()=>wb,IsInt16Array:()=>Ub,IsInt32Array:()=>kb,IsInt8Array:()=>Rb,IsMap:()=>Fb,IsNumber:()=>Sb,IsRegExp:()=>Gb,IsSet:()=>jb,IsString:()=>Ob,IsTypeArray:()=>bb,IsUint16Array:()=>Nb,IsUint32Array:()=>Lb,IsUint8Array:()=>Cb,IsUint8ClampedArray:()=>Pb});function xb(e){return e instanceof Boolean}function Sb(e){return e instanceof Number}function Ob(e){return e instanceof String}function bb(e){return globalThis.ArrayBuffer.isView(e)}function Rb(e){return e instanceof globalThis.Int8Array}function Cb(e){return e instanceof globalThis.Uint8Array}function Pb(e){return e instanceof globalThis.Uint8ClampedArray}function Ub(e){return e instanceof globalThis.Int16Array}function Nb(e){return e instanceof globalThis.Uint16Array}function kb(e){return e instanceof globalThis.Int32Array}function Lb(e){return e instanceof globalThis.Uint32Array}function Mb(e){return e instanceof globalThis.Float32Array}function wb(e){return e instanceof globalThis.Float64Array}function $b(e){return e instanceof globalThis.BigInt64Array}function Db(e){return e instanceof globalThis.BigUint64Array}function Gb(e){return e instanceof globalThis.RegExp}function vb(e){return e instanceof globalThis.Date}function jb(e){return e instanceof globalThis.Set}function Fb(e){return e instanceof globalThis.Map}function qb(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~guard")}function Hb(e){return e.map(t=>Vs(t))}function Kb(e){let t={},r=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(r)){let i=r[o];a.HasPropertyKey(i,"value")&&Object.defineProperty(t,o,{...i,value:Vs(i.value)})}return t}function zb(e){return new RegExp(e.source,e.flags)}function Vs(e){return e instanceof RegExp?zb(e):qb(e)?e:a.IsArray(e)?Hb(e):a.IsObject(e)?Kb(e):e}function So(e){return St.clone+=1,Vs(e)}var dt={};It(dt,{Get:()=>Wb,Reset:()=>Yb,Set:()=>Vb});var Fr={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function Yb(){Fr.immutableTypes=!1,Fr.maxErrors=8,Fr.useEval=!0,Fr.exactOptionalPropertyTypes=!1,Fr.enumerableKind=!1}function Vb(e){for(let t of a.Keys(e)){let r=e[t];r!==void 0&&Object.defineProperty(Fr,t,{value:r})}}function Wb(){return Fr}function Qb(e,t,r={}){for(let o of Object.keys(t))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:t[o]});return e}function zu(e,t){return{...e,...t}}function Zb(e,t,r={}){St.create+=1;let o=dt.Get(),i=zu(t,r),s=o.enumerableKind?zu(i,e):Qb(i,e);return o.immutableTypes?Object.freeze(s):s}function Xb(e,t){St.discard+=1;let r={},o=Object.getOwnPropertyDescriptors(So(e)),i=new Set(t);for(let s of Object.keys(o))i.has(s)||Object.defineProperty(r,s,o[s]);return r}function Jb(e,t,r){St.update+=1;let o=dt.Get(),i=So(e);for(let s of Object.keys(t))Object.defineProperty(i,s,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:t[s]});for(let s of Object.keys(r))Object.defineProperty(i,s,{configurable:!0,enumerable:!0,writable:!0,value:r[s]});return i}function _(e,t){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.IsEqual(e["~kind"],t)}function x(e){return a.IsObject(e)}function Yu(e){return f.Create({"~kind":"OptionalAddAction"},{type:e},{})}function Vu(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"OptionalAddAction")&&x(e.type)}function Wu(e){return f.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function Qu(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"OptionalRemoveAction")&&x(e.type)}function Zu(e){return f.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function Xu(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"ReadonlyAddAction")&&x(e.type)}function Ju(e){return f.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function el(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&x(e.type)}function b(e,t,r){return f.Create({"~kind":"Deferred"},{action:e,parameters:t,options:r},{})}function tl(e){return _(e,"Deferred")}function Ws(e){return f.Update(e,{"~immutable":!0},{})}function ur(e){return Ws(e)}function Br(e){return x(e)&&a.HasPropertyKey(e,"~immutable")}function Sn(e){return f.Discard(e,["~optional"])}function tt(e){return f.Update(e,{"~optional":!0},{})}function aa(e){return tt(e)}function Ce(e){return x(e)&&a.HasPropertyKey(e,"~optional")}function sa(e){return f.Discard(e,["~readonly"])}function rt(e){return f.Update(e,{"~readonly":!0},{})}function pa(e){return rt(e)}function qr(e){return x(e)&&a.HasPropertyKey(e,"~readonly")}function Ot(e,t){return f.Create({"~kind":"Array"},{type:"array",items:e},t)}function Z(e){return _(e,"Array")}function ma(e){return f.Discard(e,["~kind","type","items"])}function Nt(e,t){return f.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},t)}function Ye(e){return _(e,"AsyncIterator")}function rl(e){return f.Discard(e,["~kind","type","iteratorItems"])}function nl(e){return{enumerable:dt.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var ca=class{constructor(){globalThis.Object.defineProperty(this,"~kind",nl("Base")),globalThis.Object.defineProperty(this,"~guard",nl({check:t=>this.Check(t),errors:t=>this.Errors(t)}))}Check(t){return!0}Errors(t){return[]}Convert(t){return t}Clean(t){return t}Default(t){return t}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function ft(e){return _(e,"Base")}function lr(e,t,r={}){return f.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},r)}function Pe(e){return _(e,"Constructor")}function ol(e){return f.Discard(e,["~kind","type","parameters","instanceType"])}function dr(e,t,r={}){return f.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},r)}function Ue(e){return _(e,"Function")}function il(e){return f.Discard(e,["~kind","type","parameters","returnType"])}function Ae(e,t){return f.Create({"~kind":"Ref"},{$ref:e},t)}function oe(e){return _(e,"Ref")}function fr(e,t){return f.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function On(e){return _(e,"Generic")}var al="(?!)";function z(e){return f.Create({"~kind":"Never"},{not:{}},e)}function Vt(e){return _(e,"Never")}function eR(){return["(not-resolvable)",z()]}function tR(){return["(not-generic)",z()]}function rR(e,t,r){return[e,fr(t,r)]}function nR(e,t,r){return t in e?sl(e,t,e[t],r):eR()}function sl(e,t,r,o){return On(r)?rR(t,r.parameters,r.expression):oe(r)?nR(e,r.$ref,o):tR()}function pl(e,t,r){return sl(e,"(anonymous)",t,r)}function kt(e,t,r){let o=a.Keys(e).reduce((i,s)=>({...i,[s]:f.Update(e[s],{},{$id:s})}),{});return f.Create({"~kind":"Cyclic"},{$defs:o,$ref:t},r)}function ae(e){return _(e,"Cyclic")}var te={};It(te,{Match:()=>oR});function oR(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function Fe(e){return f.Create({"~kind":"Unknown"},{},e)}function nt(e){return _(e,"Unknown")}function Oo(...e){let[t,r]=te.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,Fe(),Fe()]});return f.Create({"~kind":"Infer"},{type:"infer",name:t,extends:r},{})}function Ie(e){return _(e,"Infer")}function bn(e){return f.Create({"~kind":"Any"},{},e)}function Qe(e){return _(e,"Any")}function ml(e){return a.IsObjectNotArray(e)}function cl(e){return a.Keys(e).filter(r=>isNaN(r)).reduce((r,o)=>[...r,e[o]],[])}function ul(e,t){let r=ml(e)?cl(e):e;return f.Create({"~kind":"Enum"},{enum:r},t)}function Te(e){return _(e,"Enum")}function gt(e,t={}){return f.Create({"~kind":"Intersect"},{allOf:e},t)}function P(e){return _(e,"Intersect")}function ll(e){return f.Discard(e,["~kind","allOf"])}function F(){throw new Error("Unreachable")}var yr={};It(yr,{Hash:()=>AR,HashCode:()=>Tl});function iR(e){let t=new Set,r=e;for(;r&&r!==Object.prototype;){for(let o of Reflect.ownKeys(r))o!=="constructor"&&typeof o!="symbol"&&t.add(o);r=Object.getPrototypeOf(r)}return[...t]}function aR(e){return typeof e=="number"}var Ze;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(Ze||(Ze={}));var Rn=BigInt("14695981039346656037"),[sR,pR]=[BigInt("1099511628211"),BigInt("18446744073709551616")],mR=Array.from({length:256}).map((e,t)=>BigInt(t)),yl=new Float64Array(1),El=new DataView(yl.buffer),Il=new Uint8Array(yl.buffer);function Be(e){Rn=Rn^mR[e],Rn=Rn*sR%pR}function cR(e){Be(Ze.Array);for(let t of e)gr(t)}function uR(e){Be(Ze.BigInt),El.setBigInt64(0,e);for(let t of Il)Be(t)}function fl(e){Be(Ze.Boolean),Be(e?1:0)}function lR(e){Be(Ze.Constructor),gr(e.toString())}function dR(e){Be(Ze.Date),gr(e.getTime())}function fR(e){Be(Ze.Function),gr(e.toString())}function gR(e){Be(Ze.Null)}function gl(e){Be(Ze.Number),El.setFloat64(0,e,!0);for(let t of Il)Be(t)}function yR(e){Be(Ze.Object);for(let t of iR(e).sort())gr(t),gr(e[t])}function ER(e){Be(Ze.RegExp),Qs(e.toString())}var IR=new TextEncoder;function Qs(e){Be(Ze.String);for(let t of IR.encode(e))Be(t)}function TR(e){Be(Ze.Symbol),gr(e.toString())}function hR(e){Be(Ze.TypeArray);let t=new Uint8Array(e.buffer);for(let r=0;r<t.length;r++)Be(t[r])}function _R(e){return Be(Ze.Undefined)}function gr(e){return We.IsTypeArray(e)?hR(e):We.IsDate(e)?dR(e):We.IsRegExp(e)?ER(e):We.IsBoolean(e)?fl(e.valueOf()):We.IsString(e)?Qs(e.valueOf()):We.IsNumber(e)?gl(e.valueOf()):aR(e)?gl(e):a.IsArray(e)?cR(e):a.IsBoolean(e)?fl(e):a.IsBigInt(e)?uR(e):a.IsConstructor(e)?lR(e):a.IsNull(e)?gR(e):a.IsObject(e)?yR(e):a.IsString(e)?Qs(e):a.IsSymbol(e)?TR(e):a.IsUndefined(e)?_R(e):a.IsFunction(e)?fR(e):F()}function Tl(e){return Rn=BigInt("14695981039346656037"),gr(e),Rn}function AR(e){return Tl(e).toString(16).padStart(16,"0")}function hl(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~guard":return"must match check function";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var xR=hl;function _l(){return xR}var bo=class{constructor(t,r){this.type=t,this.decode=r}Encode(t){let r=this.type,o=Hr(r)?m=>this.decode(r["~codec"].decode(m)):this.decode,i=Hr(r)?m=>r["~codec"].encode(t(m)):t,s={decode:o,encode:i};return f.Update(this.type,{"~codec":s},{})}},Ro=class{constructor(t){this.type=t}Decode(t){return new bo(this.type,t)}};function ua(e){return new Ro(e)}function xl(e,t){return ua(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function Sl(e,t){return ua(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function Hr(e){return x(e)&&a.HasPropertyKey(e,"~codec")&&a.IsObject(e["~codec"])&&a.HasPropertyKey(e["~codec"],"encode")&&a.HasPropertyKey(e["~codec"],"decode")}function OR(e,t){let r=la(e)?[...e["~refine"],t]:[t];return f.Update(e,{"~refine":r},{})}function Ol(e,t,r="error"){return OR(e,{refine:t,message:r})}function la(e){return x(e)&&a.HasPropertyKey(e,"~refine")}var bl="-?(?:0|[1-9][0-9]*)n";function Co(e){return f.Create({"~kind":"BigInt"},{type:"bigint"},e)}function st(e){return _(e,"BigInt")}function da(e){return f.Create({"~kind":"Boolean"},{type:"boolean"},e)}function Xe(e){return _(e,"Boolean")}function Po(e){return f.Create({"~kind":"Identifier"},{name:e})}function Rl(e){return _(e,"Identifier")}var fa="-?(?:0|[1-9][0-9]*)";function Kr(e){return f.Create({"~kind":"Integer"},{type:"integer"},e)}function Me(e){return _(e,"Integer")}function Lt(e,t){return f.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},t)}function Ve(e){return _(e,"Iterator")}function Cl(e){return f.Discard(e,["~kind","type","iteratorItems"])}var Zs=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function bR(e){return a.IsBigInt(e)?"bigint":a.IsBoolean(e)?"boolean":a.IsNumber(e)?"number":a.IsString(e)?"string":(()=>{throw new Zs(e)})()}function q(e,t){return f.Create({"~kind":"Literal"},{type:bR(e),const:e},t)}function ga(e){return a.IsBigInt(e)||a.IsBoolean(e)||a.IsNumber(e)||a.IsString(e)}function Pl(e){return Y(e)&&a.IsBigInt(e.const)}function Ul(e){return Y(e)&&a.IsBoolean(e.const)}function Cn(e){return Y(e)&&a.IsNumber(e.const)}function Pn(e){return Y(e)&&a.IsString(e.const)}function Y(e){return _(e,"Literal")}function Er(e){return f.Create({"~kind":"Null"},{type:"null"},e)}function Mt(e){return _(e,"Null")}var ya="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function yt(e){return f.Create({"~kind":"Number"},{type:"number"},e)}function le(e){return _(e,"Number")}function Un(e){return f.Create({"~kind":"Symbol"},{type:"symbol"},e)}function wt(e){return _(e,"Symbol")}function Nl(e){return a.Keys(e).filter(t=>!Ce(e[t]))}function kl(e){return a.Keys(e)}function Ea(e){return a.Values(e)}function RR(e,t={}){let r=Nl(e),o=r.length>0?{required:r}:{};return f.Create({"~kind":"Object"},{type:"object",...o,properties:e},t)}var N=RR;function M(e){return _(e,"Object")}function Ll(e){return f.Discard(e,["~kind","type","properties","required"])}function zr(...e){let[t,r,o]=te.Match(e,{3:(i,s,m)=>[i,s,m],2:(i,s)=>[i,s,s],1:i=>[i,Fe(),Fe()]});return f.Create({"~kind":"Parameter"},{name:t,extends:r,equals:o},{})}function Ml(e){return _(e,"Parameter")}function $t(e,t){return f.Create({"~kind":"Promise"},{type:"promise",item:e},t)}function qe(e){return _(e,"Promise")}function wl(e){return f.Discard(e,["~kind","type","item"])}var Ia=".*";function ot(e){return f.Create({"~kind":"String"},{type:"string"},e)}function xe(e){return _(e,"String")}function it(e,t){let r="object",o={[e]:t};return f.Create({"~kind":"Record"},{type:r,patternProperties:o})}var Nn=`^${fa}$`,kn=`^${ya}$`,Dt=`^${Ia}$`;function Uo(e,t,r={}){return b("Record",[e,t],r)}function CR(e,t,r={}){return O({},Uo(e,t,r))}function Ta(e,t,r={}){return CR(e,t,r)}function $l(e,t){return it(e,t)}function pt(e){return a.Keys(e.patternProperties)[0]}function Ln(e){let t=pt(e);return a.IsEqual(t,Nn)?Kr():a.IsEqual(t,kn)?yt():ot()}function He(e){return e.patternProperties[pt(e)]}function de(e){return _(e,"Record")}function Yr(e){return f.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function Ir(e){return _(e,"Rest")}function ha(e){return f.Create({"~kind":"This"},{$ref:"#"},e)}function Dl(e){return _(e,"This")}function we(e,t={}){let[r,o,i]=[e,e.length,!1];return f.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:r,minItems:o},t)}function H(e){return _(e,"Tuple")}function Gl(e){return f.Discard(e,["~kind","type","items","minItems","additionalItems"])}function Mn(e){return f.Create({"~kind":"Undefined"},{type:"undefined"},e)}function Gt(e){return _(e,"Undefined")}function G(e,t={}){return f.Create({"~kind":"Union"},{anyOf:e},t)}function A(e){return _(e,"Union")}function vl(e){return f.Discard(e,["~kind","anyOf"])}function jl(e){return f.Create({"~kind":"Unsafe"},{},e)}function Fl(e){return _(e,"Unsafe")}function _a(e){return f.Create({"~kind":"Void"},{type:"void"},e)}function mt(e){return _(e,"Void")}function UR(e,t){return a.IsEqual(e,"Array")?Ot(t[0]):a.IsEqual(e,"AsyncIterator")?Nt(t[0]):a.IsEqual(e,"Iterator")?Lt(t[0]):a.IsEqual(e,"Promise")?$t(t[0]):a.IsEqual(e,"Awaited")?Wo(t[0]):a.IsEqual(e,"Capitalize")?ko(t[0]):a.IsEqual(e,"ConstructorParameters")?Do(t[0]):a.IsEqual(e,"Evaluate")?Js(t[0]):a.IsEqual(e,"Exclude")?Go(t[0],t[1]):a.IsEqual(e,"Extract")?vo(t[0],t[1]):a.IsEqual(e,"Index")?Dn(t[0],t[1]):a.IsEqual(e,"InstanceType")?jo(t[0]):a.IsEqual(e,"Lowercase")?Lo(t[0]):a.IsEqual(e,"NonNullable")?Fo(t[0]):a.IsEqual(e,"Omit")?Bo(t[0],t[1]):a.IsEqual(e,"Options")?vn(t[0],t[1]):a.IsEqual(e,"Parameters")?qo(t[0]):a.IsEqual(e,"Partial")?Ho(t[0]):a.IsEqual(e,"Pick")?Ko(t[0],t[1]):a.IsEqual(e,"Readonly")?zo(t[0]):a.IsEqual(e,"KeyOf")?Gn(t[0]):a.IsEqual(e,"Record")?Uo(t[0],t[1]):a.IsEqual(e,"Required")?Yo(t[0]):a.IsEqual(e,"ReturnType")?Vo(t[0]):a.IsEqual(e,"Uncapitalize")?Mo(t[0]):a.IsEqual(e,"Uppercase")?wo(t[0]):Aa(Ae(e),t)}function Vr(){throw Error("Unreachable")}var NR=(e,t=[])=>e.reduce((r,o)=>a.IsArray(o)&&a.IsEqual(o.length,2)?[...r,o[0]]:[...r,o],[]),Wt=e=>{let[t,r]=e;return NR([...t,...r])};function zl(e){return zr(e[0],e[2],e[4])}function Yl(e){return zr(e[0],e[2],e[2])}function Vl(e){return zr(e[0],Fe(),e[2])}function Wl(e){return zr(e,Fe(),Fe())}function Ql(e){return Wt(e)}function Zl(e){return e[1]}function Xl(e){return Wt(e)}function Jl(e){return e[1]}function ed(e){return UR(e[0],e[1])}function td(e){return null}function rd(e){return ot()}function nd(e){return yt()}function od(e){return da()}function id(e){return Mn()}function ad(e){return Er()}function sd(e){return Kr()}function pd(e){return Co()}function md(e){return Fe()}function cd(e){return bn()}function ud(e){return N({})}function ld(e){return z()}function dd(e){return Un()}function fd(e){return _a()}function gd(e){return ha()}function yd(e){return e[1]}function Ed(e){return q(e)}function Id(e){return a.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function Td(e){return e[1]}function hd(e){return No(e)}function _d(e){return q(BigInt(e))}function Ad(e){return q(a.IsEqual(e,"true"))}function xd(e){return q(parseFloat(e))}function Sd(e){return q(e)}function Od(e){return e.length>0}function bd(e){return e.reduce((t,r)=>a.IsEqual(r.length,3)?[...t,[r[1]]]:[...t,[]],[])}function Rd(e){return a.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function Cd(e){return a.IsArray(e)&&a.IsEqual(e.length,3)?e[1]:e}var Bl=(e,t)=>t.reduceRight((r,o)=>{let i=o;return a.IsEqual(i.length,1)?Dn(r,i[0]):a.IsEqual(i.length,0)?Ot(r):Vr()},e),ql=(e,t)=>a.IsEqual(t.length,3)?$o(e,t[0],t[1],t[2]):e;function Pd(e){let[t,r,o,i]=e;return ql(t?Gn(Bl(r,o)):Bl(r,o),i)}function Xs(e,t){return a.IsEqual(t.length,3)?(()=>{let[r,o,i]=t,s=Xs(o,i);if(a.IsEqual(r,"&"))return P(s)?gt([e,...s.allOf]):gt([e,s]);if(a.IsEqual(r,"|"))return A(s)?G([e,...s.anyOf]):G([e,s]);Vr()})():e}function Ud(e){let[t,r]=e;return Xs(t,r)}function Nd(e){let[t,r]=e;return Xs(t,r)}function kd(e){return Ws(e[1])}function Ld(e){return e[1]}function Md(e){return fr(e[0],e[2])}function wd(e){return a.IsEqual(e.length,4)?Oo(e[1],e[3]):a.IsEqual(e.length,2)?Oo(e[1],Fe()):Vr()}function $d(e){return`${e}`}function Dd(e){return Me(e[3])?Nn:le(e[3])?kn:wt(e[3])?Dt:xe(e[3])?Dt:Vr()}function Gd(e){return e.length>0}function vd(e){return e.length>0}function jd(e){let[t,r,o,i,s]=e;return{[r]:t&&o?rt(tt(s)):t&&!o?rt(s):!t&&o?tt(s):s}}function Fd(e){return Wt(e)}function Bd(e){return e.reduce((t,r)=>a.HasPropertyKey(r,Nn)||a.HasPropertyKey(r,kn)||a.HasPropertyKey(r,Dt)?[t[0],f.Assign(t[1],r)]:[f.Assign(t[0],r),t[1]],[{},{}])}function qd(e){return Bd(e[1])}function Hd(e){let[t,r]=e,o=a.IsEqual(a.Keys(r).length,0)?{}:{patternProperties:r};return N(t,o)}function Kd(e){return a.IsEqual(e.length,5)?rt(tt(e[4])):a.IsEqual(e.length,3)?e[2]:a.IsEqual(e.length,4)?a.IsEqual(e[2],"readonly")?rt(e[3]):tt(e[3]):Vr()}function zd(e){return rt(tt(e[1]))}function Yd(e){return rt(e[1])}function Vd(e){return tt(e[0])}function Wd(e){return a.IsEqual(e.length,2)?Yr(e[1]):a.IsEqual(e.length,1)?e[0]:Vr()}function Qd(e){return Wt(e)}function Zd(e){return we(e[1])}function Xd(e){return rt(tt(e[4]))}function Jd(e){return rt(e[3])}function ef(e){return tt(e[3])}function tf(e){return e[2]}function rf(e){return a.IsEqual(e.length,2)?Yr(e[1]):a.IsEqual(e.length,1)?e[0]:Vr()}function nf(e){return Wt(e)}function of(e){return dr(e[1],e[4])}function af(e){return lr(e[2],e[5])}function Hl(e,t){return a.IsEqual(e,"remove")?Ju(t):a.IsEqual(e,"add")?Zu(t):t}function sf(e){return a.IsEqual(e.length,2)&&a.IsEqual(e[0],"-")?"remove":a.IsEqual(e.length,2)&&a.IsEqual(e[0],"+")||a.IsEqual(e.length,1)?"add":"none"}function Kl(e,t){return a.IsEqual(e,"remove")?Wu(t):a.IsEqual(e,"add")?Yu(t):t}function pf(e){return a.IsEqual(e.length,2)&&a.IsEqual(e[0],"-")?"remove":a.IsEqual(e.length,2)&&a.IsEqual(e[0],"+")||a.IsEqual(e.length,1)?"add":"none"}function mf(e){return a.IsEqual(e.length,2)?[e[1]]:[]}function cf(e){return a.IsArray(e[6])&&a.IsEqual(e[6].length,1)?wn(Po(e[3]),e[5],e[6][0],Hl(e[1],Kl(e[8],e[10]))):wn(Po(e[3]),e[5],Ae(e[3]),Hl(e[1],Kl(e[8],e[10])))}function uf(e){return Ae(e)}function lf(e){return vn(e[2],e[4])}function df(e){return parseFloat(e)}function ff(e){return a.IsEqual(e,"true")}function gf(e){return null}function yf(e){return{[e[0]]:e[2]}}function Ef(e){return Wt(e)}function kR(e){return e.reduce((t,r)=>f.Assign(t,r),{})}function If(e){return kR(e[1])}function Tf(e){return Wt(e)}function hf(e){return e[1]}function _f(e){return Co()}function Af(e){return ot()}function xf(e){return yt()}function Sf(e){return Kr()}function Of(e){return z()}function bf(e){return q(e)}function Rf(e){return G(e[1])}function Cf(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Pf(e){return[e[0],...e[1]]}function Uf(e){return e[1]}function Nf(e){return Wt(e)}function kf(e){return a.IsEqual(e.length,2)?e[1]:[]}function Lf(e){let t=e[2],r=e[3],[o,i]=e[4],s=a.IsEqual(a.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:fr(t,$n(r,o,s))}}function Mf(e){let t=e[2],[r,o]=e[3],i=a.IsEqual(a.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:$n(t,r,i)}}function wf(e){return{[e[1]]:fr(e[2],e[4])}}function $f(e){return{[e[1]]:e[3]}}function Df(e){return null}function Gf(e){return Bd(Wt(e))}function vf(e){return e[1]}function jf(e){let t=e[0],r=e[1];return ep(f.Assign(t,r[0]))}function re(e){return vr(e)&&Q(e.length,2)}function wR(e,t){return Q(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Ne(e,t){let[r,...o]=e;return cr(r)?(()=>{let i=wR(r,t);return Q(i.length,2)?i:Ne(o,t)})():[]}function tp(e,t){return Array.from({length:t-e+1},(r,o)=>String.fromCharCode(e+o))}var Ff=[...tp(97,122),...tp(65,90)],rp="0",np=tp(49,57),jn=[rp,...np],Bf=" ",Fn=`
28
- `;var Tr="_",xa=".",qf="$",Sa="-";var Hf="//",Kf="/*",DR="*/";function zf(e){let t=e.indexOf(DR);return Q(t,-1)?"":e.slice(t+2)}function Yf(e){let t=e.indexOf(Fn);return Q(t,-1)?"":e.slice(t)}function GR(e){return e.replace(/^[ \t\r\f\v]+/,"")}function Oa(e){let t=GR(e);return t.startsWith(Kf)?Oa(zf(t.slice(2))):t.startsWith(Hf)?Oa(Yf(t.slice(2))):t}function at(e){let t=e.trimStart();return t.startsWith(Kf)?at(zf(t.slice(2))):t.startsWith(Hf)?at(Yf(t.slice(2))):t}function vR(e,t){return e.includes(t)}function Bn(e,t,r,o=""){let i=Ne(e,r);return re(i)?vR(t,i[0])?Bn(e,t,i[1],o):Bn(e,t,i[1],`${o}${i[0]}`):[o,r]}function ba(e,t){let r=Ne([e],t);return re(r)?r:["",t]}function jR(e){return ba(Sa,e)}function FR(e){return Ne(np,e)}var BR=[...jn,Tr];function qR(e){return Bn(BR,[Tr],e)}function HR(e){let t=jR(e);return re(t)?(()=>{let r=Ne([rp],t[1]);return re(r)?[`${t[0]}${r[0]}`,r[1]]:(()=>{let o=FR(t[1]);return re(o)?(()=>{let i=qR(o[1]);return re(i)?[`${t[0]}${o[0]}${i[0]}`,i[1]]:[]})():[]})()})():[]}function Ra(e){return HR(at(e))}function KR(e){let t=Ra(e);return re(t)?(()=>{let r=Ne(["n"],t[1]);return re(r)?[`${t[0]}`,r[1]]:[]})():[]}function Vf(e){return KR(e)}function op(e,t){return Ne([e],t)}function y(e,t){return Q(e,"")?["",t]:e.startsWith(Fn)?op(e,Oa(t)):e.startsWith(Bf)?op(e,t):op(e,at(t))}var Wf=[...Ff,Tr,qf];function zR(e){return Ne(Wf,e)}var YR=[...Wf,...jn];function Qf(e,t=""){let r=Ne(YR,e);return re(r)?Qf(r[1],`${t}${r[0]}`):[t,e]}function VR(e){let t=zR(e);return re(t)?(()=>{let r=Qf(t[1]);return re(r)?[`${t[0]}${r[0]}`,r[1]]:[]})():[]}function fe(e){return VR(at(e))}var WR=[...jn,Tr];function QR(e){return ba(Sa,e)}function ZR(e){return re(Ne([xa],e))}function Zf(e){let t=Bn(WR,[Tr],e);return re(t)?Q(t[0],"")?[]:[t[0],t[1]]:[]}function XR(e,t){let r=Ne([xa],t);return re(r)?(()=>{let o=Zf(r[1]);return re(o)?[`${e}0${r[0]}${o[0]}`,o[1]]:[]})():[]}function JR(e,t){let r=Ra(t);return re(r)?(()=>{let o=Ne([xa],r[1]);return re(o)?(()=>{let i=Zf(o[1]);return re(i)?[`${e}${r[0]}${o[0]}${i[0]}`,i[1]]:[`${e}${r[0]}`,o[1]]})():[`${e}${r[0]}`,r[1]]})():[]}function eC(e){let t=QR(e);return re(t)?ZR(t[1])?XR(t[0],t[1]):JR(t[0],t[1]):[]}function Ca(e){return eC(at(e))}function Xf(e,t){let[r,...o]=e;return cr(r)?t.startsWith(r)?!0:Xf(o,t):!1}function hr(e,t,r=""){return Q(t,"")?[]:Xf(e,t)?[r,t]:(()=>{let[o,i]=[t.slice(0,1),t.slice(1)];return hr(e,i,`${r}${o}`)})()}function tC(e,t,r){return r.startsWith(e)?(()=>{let o=hr([t],r.slice(e.length));return re(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function rC(e,t,r){return r.startsWith(e)?(()=>{let o=hr([Fn,t],r.slice(e.length));return re(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function Jf(e,t,r,o){return r?tC(e,t,at(o)):rC(e,t,at(o))}function nC(e,t){return Ne(e,t)}function oC(e,t){return Jf(e,e,!1,t)}function iC(e,t){let r=nC(e,t);return re(r)?oC(r[0],`${r[0]}${r[1]}`):[]}function Pa(e,t){return iC(e,at(t))}function eg(e,t){let r=hr(e,t);return re(r)?Q(r[0],"")?[]:r:[]}var p=(e,t,r=()=>[])=>e.length===2?t(e):r(),sC=e=>p(p(fe(e),([t,r])=>p(y("extends",r),([o,i])=>p(V(i),([s,m])=>p(y("=",m),([u,l])=>p(V(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[zl(t),r]),pC=e=>p(p(fe(e),([t,r])=>p(y("extends",r),([o,i])=>p(V(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Yl(t),r]),mC=e=>p(p(fe(e),([t,r])=>p(y("=",r),([o,i])=>p(V(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Vl(t),r]),cC=e=>p(fe(e),([t,r])=>[Wl(t),r]),ng=e=>p(p(sC(e),([t,r])=>[t,r],()=>p(pC(e),([t,r])=>[t,r],()=>p(mC(e),([t,r])=>[t,r],()=>p(cC(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),og=(e,t=[])=>p(p(ng(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>og(o,[...t,r]),()=>[t,e]),uC=e=>p(p(og(e),([t,r])=>p(p(p(ng(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Ql(t),r]),sp=e=>p(p(y("<",e),([t,r])=>p(uC(r),([o,i])=>p(y(">",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Zl(t),r]),ig=(e,t=[])=>p(p(V(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>ig(o,[...t,r]),()=>[t,e]),lC=e=>p(p(ig(e),([t,r])=>p(p(p(V(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Xl(t),r]),dC=e=>p(p(y("<",e),([t,r])=>p(lC(r),([o,i])=>p(y(">",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Jl(t),r]),fC=e=>p(p(fe(e),([t,r])=>p(dC(r),([o,i])=>[[t,o],i])),([t,r])=>[ed(t),r]),ag=e=>p(p(p(y(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[td(t),r]),sg=e=>p(y("string",e),([t,r])=>[rd(t),r]),pg=e=>p(y("number",e),([t,r])=>[nd(t),r]),gC=e=>p(y("boolean",e),([t,r])=>[od(t),r]),yC=e=>p(y("undefined",e),([t,r])=>[id(t),r]),EC=e=>p(y("null",e),([t,r])=>[ad(t),r]),mg=e=>p(y("integer",e),([t,r])=>[sd(t),r]),IC=e=>p(y("bigint",e),([t,r])=>[pd(t),r]),TC=e=>p(y("unknown",e),([t,r])=>[md(t),r]),hC=e=>p(y("any",e),([t,r])=>[cd(t),r]),_C=e=>p(y("object",e),([t,r])=>[ud(t),r]),AC=e=>p(y("never",e),([t,r])=>[ld(t),r]),cg=e=>p(y("symbol",e),([t,r])=>[dd(t),r]),xC=e=>p(y("void",e),([t,r])=>[fd(t),r]),SC=e=>p(y("this",e),([t,r])=>[gd(t),r]),OC=e=>p(p(sg(e),([t,r])=>[t,r],()=>p(pg(e),([t,r])=>[t,r],()=>p(gC(e),([t,r])=>[t,r],()=>p(yC(e),([t,r])=>[t,r],()=>p(EC(e),([t,r])=>[t,r],()=>p(mg(e),([t,r])=>[t,r],()=>p(IC(e),([t,r])=>[t,r],()=>p(TC(e),([t,r])=>[t,r],()=>p(hC(e),([t,r])=>[t,r],()=>p(_C(e),([t,r])=>[t,r],()=>p(AC(e),([t,r])=>[t,r],()=>p(cg(e),([t,r])=>[t,r],()=>p(xC(e),([t,r])=>[t,r],()=>p(SC(e),([t,r])=>[t,r],()=>[])))))))))))))),([t,r])=>[t,r]),bC=e=>p(p(y("${",e),([t,r])=>p(V(r),([o,i])=>p(y("}",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[yd(t),r]),ip=e=>p(hr(["${","`"],e),([t,r])=>[Ed(t),r]),ug=e=>p(p(p(ip(e),([t,r])=>p(bC(r),([o,i])=>p(ug(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>p(p(ip(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(ip(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[Id(t),r]),pp=e=>p(p(y("`",e),([t,r])=>p(ug(r),([o,i])=>p(y("`",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Td(t),r]),RC=e=>p(pp(e),([t,r])=>[hd(t),r]),CC=e=>p(Vf(e),([t,r])=>[_d(t),r]),PC=e=>p(p(y("true",e),([t,r])=>[t,r],()=>p(y("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[Ad(t),r]),UC=e=>p(Ca(e),([t,r])=>[xd(t),r]),NC=e=>p(Pa(["'",'"'],e),([t,r])=>[Sd(t),r]),kC=e=>p(p(CC(e),([t,r])=>[t,r],()=>p(PC(e),([t,r])=>[t,r],()=>p(UC(e),([t,r])=>[t,r],()=>p(NC(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),LC=e=>p(p(p(y("keyof",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Od(t),r]),lg=(e,t=[])=>p(p(p(y("[",e),([r,o])=>p(V(o),([i,s])=>p(y("]",s),([m,u])=>[[r,i,m],u]))),([r,o])=>[r,o],()=>p(p(y("[",e),([r,o])=>p(y("]",o),([i,s])=>[[r,i],s])),([r,o])=>[r,o],()=>[])),([r,o])=>lg(o,[...t,r]),()=>[t,e]),MC=e=>p(lg(e),([t,r])=>[bd(t),r]),wC=e=>p(p(p(y("extends",e),([t,r])=>p(V(r),([o,i])=>p(y("?",i),([s,m])=>p(V(m),([u,l])=>p(y(":",l),([g,E])=>p(V(E),([I,C])=>[[t,o,s,u,g,I],C])))))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Rd(t),r]),$C=e=>p(p(p(y("(",e),([t,r])=>p(V(r),([o,i])=>p(y(")",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>p(OC(e),([t,r])=>[t,r],()=>p(VC(e),([t,r])=>[t,r],()=>p(eP(e),([t,r])=>[t,r],()=>p(RC(e),([t,r])=>[t,r],()=>p(kC(e),([t,r])=>[t,r],()=>p(aP(e),([t,r])=>[t,r],()=>p(iP(e),([t,r])=>[t,r],()=>p(cP(e),([t,r])=>[t,r],()=>p(lP(e),([t,r])=>[t,r],()=>p(fC(e),([t,r])=>[t,r],()=>p(uP(e),([t,r])=>[t,r],()=>[])))))))))))),([t,r])=>[Cd(t),r]),dg=e=>p(p(LC(e),([t,r])=>p($C(r),([o,i])=>p(MC(i),([s,m])=>p(wC(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[Pd(t),r]),fg=e=>p(p(p(y("&",e),([t,r])=>p(dg(r),([o,i])=>p(fg(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),gg=e=>p(p(dg(e),([t,r])=>p(fg(r),([o,i])=>[[t,o],i])),([t,r])=>[Ud(t),r]),yg=e=>p(p(p(y("|",e),([t,r])=>p(gg(r),([o,i])=>p(yg(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Ua=e=>p(p(gg(e),([t,r])=>p(yg(r),([o,i])=>[[t,o],i])),([t,r])=>[Nd(t),r]),DC=e=>p(p(y("readonly",e),([t,r])=>p(Ua(r),([o,i])=>[[t,o],i])),([t,r])=>[kd(t),r]),GC=e=>p(p(y("|",e),([t,r])=>p(Ua(r),([o,i])=>[[t,o],i])),([t,r])=>[Ld(t),r]),vC=e=>p(p(sp(e),([t,r])=>p(y("=",r),([o,i])=>p(V(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Md(t),r]),jC=e=>p(p(p(y("infer",e),([t,r])=>p(fe(r),([o,i])=>p(y("extends",i),([s,m])=>p(Ua(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[t,r],()=>p(p(y("infer",e),([t,r])=>p(fe(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>[])),([t,r])=>[wd(t),r]),V=e=>p(p(jC(e),([t,r])=>[t,r],()=>p(GC(e),([t,r])=>[t,r],()=>p(DC(e),([t,r])=>[t,r],()=>p(Ua(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),FC=e=>p(Ca(e),([t,r])=>[$d(t),r]),BC=e=>p(fe(e),([t,r])=>[t,r]),qC=e=>p(Pa(["'",'"'],e),([t,r])=>[t,r]),HC=e=>p(p(y("[",e),([t,r])=>p(fe(r),([o,i])=>p(y(":",i),([s,m])=>p(p(mg(m),([u,l])=>[u,l],()=>p(pg(m),([u,l])=>[u,l],()=>p(sg(m),([u,l])=>[u,l],()=>p(cg(m),([u,l])=>[u,l],()=>[])))),([u,l])=>p(y("]",l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[Dd(t),r]),Eg=e=>p(p(FC(e),([t,r])=>[t,r],()=>p(BC(e),([t,r])=>[t,r],()=>p(qC(e),([t,r])=>[t,r],()=>p(HC(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),KC=e=>p(p(p(y("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Gd(t),r]),zC=e=>p(p(p(y("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[vd(t),r]),Ig=e=>p(p(KC(e),([t,r])=>p(Eg(r),([o,i])=>p(zC(i),([s,m])=>p(y(":",m),([u,l])=>p(V(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[jd(t),r]),Tg=e=>p(p(p(y(",",e),([t,r])=>p(y(`
24
+ `),this.outputHelp({error:!0}));let o=r||{},i=o.exitCode||1,s=o.code||"commander.error";this._exit(i,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in ne.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,ne.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Ux(this.options),r=o=>this.getOptionValue(o)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(o));this.options.filter(o=>o.implied!==void 0&&r(o.attributeName())&&t.valueFromOption(this.getOptionValue(o.attributeName()),o)).forEach(o=>{Object.keys(o.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,o.implied[i],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let o=c=>{let u=c.attributeName(),l=this.getOptionValue(u),g=this.options.find(I=>I.negate&&u===I.attributeName()),E=this.options.find(I=>!I.negate&&u===I.attributeName());return g&&(g.presetArg===void 0&&l===!1||g.presetArg!==void 0&&l===g.presetArg)?g:E||c},i=c=>{let u=o(c),l=u.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},s=`error: ${i(t)} cannot be used with ${i(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let c=s.createHelp().visibleOptions(s).filter(u=>u.long).map(u=>u.long);i=i.concat(c),s=s.parent}while(s&&!s._enablePositionalOptions);r=Bu(t,i)}let o=`error: unknown option '${t}'${r}`;this.error(o,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,o=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${o} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),r=Bu(t,i)}let o=`error: unknown command '${t}'${r}`;this.error(o,{code:"commander.unknownCommand"})}version(t,r,o){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",o=o||"output the version number";let i=this.createOption(r,o);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
+ `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let o=this.parent?._findCommand(t);if(o){let i=[o.name()].concat(o.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(o=>Rx(o));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=Qt.basename(t,Qt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),o=this._getOutputContext(t);r.prepareContext({error:o.error,helpWidth:o.helpWidth,outputHasColors:o.hasColors});let i=r.formatHelp(this,r);return o.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let r=!!t.error,o,i,s;return r?(o=u=>this._outputConfiguration.writeErr(u),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(o=u=>this._outputConfiguration.writeOut(u),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:u=>(i||(u=this._outputConfiguration.stripColor(u)),o(u)),hasColors:i,helpWidth:s}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let o=this._getOutputContext(t),i={error:o.error,write:o.write,command:this};this._getCommandAndAncestors().reverse().forEach(c=>c.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let s=this.helpInformation({error:o.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");o.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(c=>c.emit("afterAllHelp",i))}helpOption(t,r){return typeof t=="boolean"?(t?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(t=t??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(t,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this}help(t){this.outputHelp(t);let r=Number(ne.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let o=["beforeAll","before","after","afterAll"];if(!o.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
+ Expecting one of '${o.join("', '")}'`);let i=`${t}Help`;return this.on(i,s=>{let c;typeof r=="function"?c=r({error:s.error,command:s.command}):c=r,c&&s.write(`${c}
27
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function qu(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,o="127.0.0.1",i="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?i=s[3]:o=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],o=s[3],i=s[4]),r&&i!=="0"?`${r}=${o}:${parseInt(i)+1}`:t})}function ap(){if(ne.env.NO_COLOR||ne.env.FORCE_COLOR==="0"||ne.env.FORCE_COLOR==="false")return!1;if(ne.env.FORCE_COLOR||ne.env.CLICOLOR_FORCE!==void 0)return!0}sp.Command=ip;sp.useColor=ap});var Yu=Kr(Ot=>{var{Argument:Ku}=ma(),{Command:pp}=Hu(),{CommanderError:Nx,InvalidArgumentError:zu}=Co(),{Help:Lx}=Xs(),{Option:Vu}=rp();Ot.program=new pp;Ot.createCommand=e=>new pp(e);Ot.createOption=(e,t)=>new Vu(e,t);Ot.createArgument=(e,t)=>new Ku(e,t);Ot.Command=pp;Ot.Option=Vu;Ot.Argument=Ku;Ot.Help=Lx;Ot.CommanderError=Nx;Ot.InvalidArgumentError=zu;Ot.InvalidOptionArgumentError=zu});var Qu=$u(Yu(),1),{program:sj,createCommand:pj,createArgument:cj,createOption:mj,CommanderError:uj,InvalidArgumentError:lj,InvalidOptionArgumentError:dj,Command:Wu,Argument:fj,Option:gj,Help:yj}=Qu.default;function xt(e){throw new Error(`assertUnreachable: ${JSON.stringify(e,null,2)}`)}var f={};ht(f,{Assign:()=>kx,Clone:()=>Uo,Create:()=>wR,Discard:()=>$R,Metrics:()=>Rt,Update:()=>DR});var Rt={assign:0,create:0,clone:0,discard:0,update:0};function kx(e,t){return Rt.assign+=1,{...e,...t}}var a={};ht(a,{Entries:()=>rR,EntriesRegExp:()=>tR,Every:()=>Xx,EveryAll:()=>Jx,GraphemeCount:()=>Qx,HasPropertyKey:()=>eR,IsArray:()=>zr,IsAsyncIterator:()=>vx,IsBigInt:()=>Po,IsBoolean:()=>nl,IsClassInstance:()=>Vx,IsConstructor:()=>jx,IsDeepEqual:()=>lp,IsEqual:()=>W,IsFunction:()=>ol,IsGreaterEqualThan:()=>al,IsGreaterThan:()=>Hx,IsInteger:()=>mp,IsIterator:()=>Fx,IsLessEqualThan:()=>il,IsLessThan:()=>Kx,IsMaxLength:()=>Wx,IsMinLength:()=>Zx,IsMultipleOf:()=>zx,IsNull:()=>fa,IsNumber:()=>ga,IsObject:()=>Vr,IsObjectNotArray:()=>Bx,IsString:()=>gr,IsSymbol:()=>qx,IsUndefined:()=>up,IsValueLike:()=>Yx,Keys:()=>da,Symbols:()=>nR,Values:()=>oR});function fr(e,t,r){return e>=t&&e<=r}function Zu(e){return fr(e,127462,127487)}function Mx(e){return fr(e,65024,65039)}function wx(e){return fr(e,768,879)||fr(e,6832,6911)||fr(e,7616,7679)||fr(e,65056,65071)}function la(e){return e>65535?2:1}function Xu(e,t){for(;t<e.length;){let r=e.codePointAt(t);if(wx(r)||Mx(r))t+=la(r);else break}return t}function cp(e,t){let r=e.codePointAt(t),o=t+la(r);for(o=Xu(e,o);o<e.length-1&&e[o]==="\u200D";){let i=e.codePointAt(o+1);o+=1+la(i),o=Xu(e,o)}return Zu(r)&&o<e.length&&Zu(e.codePointAt(o))&&(o+=la(e.codePointAt(o))),o}function Ju(e){return fr(e,55296,56319)||fr(e,768,879)||e===8205}function el(e){let t=0,r=0;for(;r<e.length;)r=cp(e,r),t++;return t}function $x(e,t){let r=0,o=0;for(;o<e.length;)if(o=cp(e,o),r++,r>=t)return!0;return!1}function Dx(e,t){let r=0,o=0;for(;o<e.length;)if(o=cp(e,o),r++,r>t)return!1;return!0}function tl(e,t){let r=0;for(;r<e.length;){if(Ju(e.charCodeAt(r)))return $x(e,t);if(r++,r>=t)return!0}return!1}function rl(e,t){let r=0;for(;r<e.length;){if(Ju(e.charCodeAt(r)))return Dx(e,t);if(r++,r>t)return!1}return!0}function zr(e){return Array.isArray(e)}function vx(e){return Vr(e)&&Symbol.asyncIterator in e}function Po(e){return W(typeof e,"bigint")}function nl(e){return W(typeof e,"boolean")}function jx(e){if(up(e)||!ol(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function ol(e){return W(typeof e,"function")}function mp(e){return Number.isInteger(e)}function Fx(e){return Vr(e)&&Symbol.iterator in e}function fa(e){return W(e,null)}function ga(e){return Number.isFinite(e)}function Bx(e){return Vr(e)&&!zr(e)}function Vr(e){return W(typeof e,"object")&&!fa(e)}function gr(e){return W(typeof e,"string")}function qx(e){return W(typeof e,"symbol")}function up(e){return W(e,void 0)}function W(e,t){return e===t}function Hx(e,t){return e>t}function Kx(e,t){return e<t}function il(e,t){return e<=t}function al(e,t){return e>=t}function zx(e,t){if(Po(e)||Po(t))return BigInt(e)%BigInt(t)===0n;let r=1e-10;if(!ga(e)||mp(e)&&1/t%1===0)return!0;let o=e%t;return Math.min(Math.abs(o),Math.abs(o-t))<r}function Vx(e){if(!Vr(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return fa(t)?!1:W(typeof t.constructor,"function")&&!(W(t.constructor,globalThis.Object)||W(t.constructor.name,"Object"))}function Yx(e){return Po(e)||nl(e)||fa(e)||ga(e)||gr(e)||up(e)}function Qx(e){return el(e)}function Wx(e,t){return rl(e,t)}function Zx(e,t){return tl(e,t)}function Xx(e,t,r){for(let o=t;o<e.length;o++)if(!r(e[o],o))return!1;return!0}function Jx(e,t,r){let o=!0;for(let i=t;i<e.length;i++)r(e[i],i)||(o=!1);return o}function eR(e,t){return W(t,"__proto__")||W(t,"constructor")?Object.prototype.hasOwnProperty.call(e,t):t in e}function tR(e){return da(e).map(t=>[new RegExp(`^${t}$`),e[t]])}function rR(e){return Object.entries(e)}function da(e){return Object.getOwnPropertyNames(e)}function nR(e){return Object.getOwnPropertySymbols(e)}function oR(e){return Object.values(e)}function iR(e,t){if(!Vr(t))return!1;let r=da(e);return W(r.length,da(t).length)&&r.every(o=>lp(e[o],t[o]))}function aR(e,t){return zr(t)&&W(e.length,t.length)&&e.every((r,o)=>lp(e[o],t[o]))}function lp(e,t){return zr(e)?aR(e,t):Vr(e)?iR(e,t):W(e,t)}var Qe={};ht(Qe,{IsBigInt64Array:()=>_R,IsBigUint64Array:()=>hR,IsBoolean:()=>sR,IsDate:()=>AR,IsFloat32Array:()=>IR,IsFloat64Array:()=>TR,IsInt16Array:()=>fR,IsInt32Array:()=>yR,IsInt8Array:()=>uR,IsMap:()=>bR,IsNumber:()=>pR,IsRegExp:()=>OR,IsSet:()=>SR,IsString:()=>cR,IsTypeArray:()=>mR,IsUint16Array:()=>gR,IsUint32Array:()=>ER,IsUint8Array:()=>lR,IsUint8ClampedArray:()=>dR});function sR(e){return e instanceof Boolean}function pR(e){return e instanceof Number}function cR(e){return e instanceof String}function mR(e){return globalThis.ArrayBuffer.isView(e)}function uR(e){return e instanceof globalThis.Int8Array}function lR(e){return e instanceof globalThis.Uint8Array}function dR(e){return e instanceof globalThis.Uint8ClampedArray}function fR(e){return e instanceof globalThis.Int16Array}function gR(e){return e instanceof globalThis.Uint16Array}function yR(e){return e instanceof globalThis.Int32Array}function ER(e){return e instanceof globalThis.Uint32Array}function IR(e){return e instanceof globalThis.Float32Array}function TR(e){return e instanceof globalThis.Float64Array}function _R(e){return e instanceof globalThis.BigInt64Array}function hR(e){return e instanceof globalThis.BigUint64Array}function OR(e){return e instanceof globalThis.RegExp}function AR(e){return e instanceof globalThis.Date}function SR(e){return e instanceof globalThis.Set}function bR(e){return e instanceof globalThis.Map}function RR(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~guard")}function CR(e){return e.map(t=>dp(t))}function PR(e){let t={},r=Object.getOwnPropertyDescriptors(e);for(let o of Object.keys(r)){let i=r[o];a.HasPropertyKey(i,"value")&&Object.defineProperty(t,o,{...i,value:dp(i.value)})}return t}function UR(e){return new RegExp(e.source,e.flags)}function dp(e){return e instanceof RegExp?UR(e):RR(e)?e:a.IsArray(e)?CR(e):a.IsObject(e)?PR(e):e}function Uo(e){return Rt.clone+=1,dp(e)}var yt={};ht(yt,{Get:()=>kR,Reset:()=>NR,Set:()=>LR});var Yr={immutableTypes:!1,maxErrors:8,useEval:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1};function NR(){Yr.immutableTypes=!1,Yr.maxErrors=8,Yr.useEval=!0,Yr.exactOptionalPropertyTypes=!1,Yr.enumerableKind=!1}function LR(e){for(let t of a.Keys(e)){let r=e[t];r!==void 0&&Object.defineProperty(Yr,t,{value:r})}}function kR(){return Yr}function MR(e,t,r={}){for(let o of Object.keys(t))Object.defineProperty(e,o,{configurable:!0,writable:!0,enumerable:!1,value:t[o]});return e}function sl(e,t){return{...e,...t}}function wR(e,t,r={}){Rt.create+=1;let o=yt.Get(),i=sl(t,r),s=o.enumerableKind?sl(i,e):MR(i,e);return o.immutableTypes?Object.freeze(s):s}function $R(e,t){Rt.discard+=1;let r={},o=Object.getOwnPropertyDescriptors(Uo(e)),i=new Set(t);for(let s of Object.keys(o))i.has(s)||Object.defineProperty(r,s,o[s]);return r}function DR(e,t,r){Rt.update+=1;let o=yt.Get(),i=Uo(e);for(let s of Object.keys(t))Object.defineProperty(i,s,{configurable:!0,writable:!0,enumerable:o.enumerableKind,value:t[s]});for(let s of Object.keys(r))Object.defineProperty(i,s,{configurable:!0,enumerable:!0,writable:!0,value:r[s]});return i}function h(e,t){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.IsEqual(e["~kind"],t)}function A(e){return a.IsObject(e)}function pl(e){return f.Create({"~kind":"OptionalAddAction"},{type:e},{})}function cl(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"OptionalAddAction")&&A(e.type)}function ml(e){return f.Create({"~kind":"OptionalRemoveAction"},{type:e},{})}function ul(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"OptionalRemoveAction")&&A(e.type)}function ll(e){return f.Create({"~kind":"ReadonlyAddAction"},{type:e},{})}function dl(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"ReadonlyAddAction")&&A(e.type)}function fl(e){return f.Create({"~kind":"ReadonlyRemoveAction"},{type:e},{})}function gl(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"ReadonlyRemoveAction")&&A(e.type)}function R(e,t,r){return f.Create({"~kind":"Deferred"},{action:e,parameters:t,options:r},{})}function yl(e){return h(e,"Deferred")}function fp(e){return f.Update(e,{"~immutable":!0},{})}function yr(e){return fp(e)}function Qr(e){return A(e)&&a.HasPropertyKey(e,"~immutable")}function Un(e){return f.Discard(e,["~optional"])}function nt(e){return f.Update(e,{"~optional":!0},{})}function ya(e){return nt(e)}function xe(e){return A(e)&&a.HasPropertyKey(e,"~optional")}function Ea(e){return f.Discard(e,["~readonly"])}function ot(e){return f.Update(e,{"~readonly":!0},{})}function Ia(e){return ot(e)}function Wr(e){return A(e)&&a.HasPropertyKey(e,"~readonly")}function Ct(e,t){return f.Create({"~kind":"Array"},{type:"array",items:e},t)}function Z(e){return h(e,"Array")}function Ta(e){return f.Discard(e,["~kind","type","items"])}function wt(e,t){return f.Create({"~kind":"AsyncIterator"},{type:"asyncIterator",iteratorItems:e},t)}function ze(e){return h(e,"AsyncIterator")}function El(e){return f.Discard(e,["~kind","type","iteratorItems"])}function Il(e){return{enumerable:yt.Get().enumerableKind,writable:!1,configurable:!1,value:e}}var _a=class{constructor(){globalThis.Object.defineProperty(this,"~kind",Il("Base")),globalThis.Object.defineProperty(this,"~guard",Il({check:t=>this.Check(t),errors:t=>this.Errors(t)}))}Check(t){return!0}Errors(t){return[]}Convert(t){return t}Clean(t){return t}Default(t){return t}Create(){throw new Error("Create not implemented")}Clone(){throw Error("Clone not implemented")}};function Et(e){return h(e,"Base")}function Er(e,t,r={}){return f.Create({"~kind":"Constructor"},{type:"constructor",parameters:e,instanceType:t},r)}function Re(e){return h(e,"Constructor")}function Tl(e){return f.Discard(e,["~kind","type","parameters","instanceType"])}function Ir(e,t,r={}){return f.Create({"~kind":"Function"},{type:"function",parameters:e,returnType:t},r)}function Ce(e){return h(e,"Function")}function _l(e){return f.Discard(e,["~kind","type","parameters","returnType"])}function he(e,t){return f.Create({"~kind":"Ref"},{$ref:e},t)}function oe(e){return h(e,"Ref")}function Tr(e,t){return f.Create({"~kind":"Generic"},{type:"generic",parameters:e,expression:t})}function Nn(e){return h(e,"Generic")}var hl="(?!)";function z(e){return f.Create({"~kind":"Never"},{not:{}},e)}function Wt(e){return h(e,"Never")}function GR(){return["(not-resolvable)",z()]}function vR(){return["(not-generic)",z()]}function jR(e,t,r){return[e,Tr(t,r)]}function FR(e,t,r){return t in e?Ol(e,t,e[t],r):GR()}function Ol(e,t,r,o){return Nn(r)?jR(t,r.parameters,r.expression):oe(r)?FR(e,r.$ref,o):vR()}function Al(e,t,r){return Ol(e,"(anonymous)",t,r)}function $t(e,t,r){let o=a.Keys(e).reduce((i,s)=>({...i,[s]:f.Update(e[s],{},{$id:s})}),{});return f.Create({"~kind":"Cyclic"},{$defs:o,$ref:t},r)}function ae(e){return h(e,"Cyclic")}var te={};ht(te,{Match:()=>BR});function BR(e,t){return t[e.length]?.(...e)??(()=>{throw Error("Invalid Arguments")})()}function je(e){return f.Create({"~kind":"Unknown"},{},e)}function it(e){return h(e,"Unknown")}function No(...e){let[t,r]=te.Match(e,{2:(o,i)=>[o,i,i],1:o=>[o,je(),je()]});return f.Create({"~kind":"Infer"},{type:"infer",name:t,extends:r},{})}function Ee(e){return h(e,"Infer")}function Ln(e){return f.Create({"~kind":"Any"},{},e)}function We(e){return h(e,"Any")}function Sl(e){return a.IsObjectNotArray(e)}function bl(e){return a.Keys(e).filter(r=>isNaN(r)).reduce((r,o)=>[...r,e[o]],[])}function xl(e,t){let r=Sl(e)?bl(e):e;return f.Create({"~kind":"Enum"},{enum:r},t)}function Ie(e){return h(e,"Enum")}function It(e,t={}){return f.Create({"~kind":"Intersect"},{allOf:e},t)}function U(e){return h(e,"Intersect")}function Rl(e){return f.Discard(e,["~kind","allOf"])}function F(){throw new Error("Unreachable")}var hr={};ht(hr,{Hash:()=>aC,HashCode:()=>Ml});function qR(e){let t=new Set,r=e;for(;r&&r!==Object.prototype;){for(let o of Reflect.ownKeys(r))o!=="constructor"&&typeof o!="symbol"&&t.add(o);r=Object.getPrototypeOf(r)}return[...t]}function HR(e){return typeof e=="number"}var Ze;(function(e){e[e.Array=0]="Array",e[e.BigInt=1]="BigInt",e[e.Boolean=2]="Boolean",e[e.Date=3]="Date",e[e.Constructor=4]="Constructor",e[e.Function=5]="Function",e[e.Null=6]="Null",e[e.Number=7]="Number",e[e.Object=8]="Object",e[e.RegExp=9]="RegExp",e[e.String=10]="String",e[e.Symbol=11]="Symbol",e[e.TypeArray=12]="TypeArray",e[e.Undefined=13]="Undefined"})(Ze||(Ze={}));var kn=BigInt("14695981039346656037"),[KR,zR]=[BigInt("1099511628211"),BigInt("18446744073709551616")],VR=Array.from({length:256}).map((e,t)=>BigInt(t)),Nl=new Float64Array(1),Ll=new DataView(Nl.buffer),kl=new Uint8Array(Nl.buffer);function Fe(e){kn=kn^VR[e],kn=kn*KR%zR}function YR(e){Fe(Ze.Array);for(let t of e)_r(t)}function QR(e){Fe(Ze.BigInt),Ll.setBigInt64(0,e);for(let t of kl)Fe(t)}function Pl(e){Fe(Ze.Boolean),Fe(e?1:0)}function WR(e){Fe(Ze.Constructor),_r(e.toString())}function ZR(e){Fe(Ze.Date),_r(e.getTime())}function XR(e){Fe(Ze.Function),_r(e.toString())}function JR(e){Fe(Ze.Null)}function Ul(e){Fe(Ze.Number),Ll.setFloat64(0,e,!0);for(let t of kl)Fe(t)}function eC(e){Fe(Ze.Object);for(let t of qR(e).sort())_r(t),_r(e[t])}function tC(e){Fe(Ze.RegExp),gp(e.toString())}var rC=new TextEncoder;function gp(e){Fe(Ze.String);for(let t of rC.encode(e))Fe(t)}function nC(e){Fe(Ze.Symbol),_r(e.toString())}function oC(e){Fe(Ze.TypeArray);let t=new Uint8Array(e.buffer);for(let r=0;r<t.length;r++)Fe(t[r])}function iC(e){return Fe(Ze.Undefined)}function _r(e){return Qe.IsTypeArray(e)?oC(e):Qe.IsDate(e)?ZR(e):Qe.IsRegExp(e)?tC(e):Qe.IsBoolean(e)?Pl(e.valueOf()):Qe.IsString(e)?gp(e.valueOf()):Qe.IsNumber(e)?Ul(e.valueOf()):HR(e)?Ul(e):a.IsArray(e)?YR(e):a.IsBoolean(e)?Pl(e):a.IsBigInt(e)?QR(e):a.IsConstructor(e)?WR(e):a.IsNull(e)?JR(e):a.IsObject(e)?eC(e):a.IsString(e)?gp(e):a.IsSymbol(e)?nC(e):a.IsUndefined(e)?iC(e):a.IsFunction(e)?XR(e):F()}function Ml(e){return kn=BigInt("14695981039346656037"),_r(e),kn}function aC(e){return Ml(e).toString(16).padStart(16,"0")}function wl(e){switch(e.keyword){case"additionalProperties":return"must not have additional properties";case"anyOf":return"must match a schema in anyOf";case"boolean":return"schema is false";case"const":return"must be equal to constant";case"contains":return"must contain at least 1 valid item";case"dependencies":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"dependentRequired":return`must have properties ${e.params.dependencies.join(", ")} when property ${e.params.property} is present`;case"enum":return"must be equal to one of the allowed values";case"exclusiveMaximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"exclusiveMinimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"format":return`must match format "${e.params.format}"`;case"if":return`must match "${e.params.failingKeyword}" schema`;case"maxItems":return`must not have more than ${e.params.limit} items`;case"maxLength":return`must not have more than ${e.params.limit} characters`;case"maxProperties":return`must not have more than ${e.params.limit} properties`;case"maximum":return`must be ${e.params.comparison} ${e.params.limit}`;case"minItems":return`must not have fewer than ${e.params.limit} items`;case"minLength":return`must not have fewer than ${e.params.limit} characters`;case"minProperties":return`must not have fewer than ${e.params.limit} properties`;case"minimum":return`must be ${e.params.comparison} ${e.params.limit}`;case"multipleOf":return`must be multiple of ${e.params.multipleOf}`;case"not":return"must not be valid";case"oneOf":return"must match exactly one schema in oneOf";case"pattern":return`must match pattern "${e.params.pattern}"`;case"propertyNames":return`property names ${e.params.propertyNames.join(", ")} are invalid`;case"required":return`must have required properties ${e.params.requiredProperties.join(", ")}`;case"type":return typeof e.params.type=="string"?`must be ${e.params.type}`:`must be either ${e.params.type.join(" or ")}`;case"unevaluatedItems":return"must not have unevaluated items";case"unevaluatedProperties":return"must not have unevaluated properties";case"uniqueItems":return"must not have duplicate items";case"~guard":return"must match check function";case"~refine":return e.params.message;default:return"an unknown validation error occurred"}}var sC=wl;function $l(){return sC}var Lo=class{constructor(t,r){this.type=t,this.decode=r}Encode(t){let r=this.type,o=Zr(r)?c=>this.decode(r["~codec"].decode(c)):this.decode,i=Zr(r)?c=>r["~codec"].encode(t(c)):t,s={decode:o,encode:i};return f.Update(this.type,{"~codec":s},{})}},ko=class{constructor(t){this.type=t}Decode(t){return new Lo(this.type,t)}};function ha(e){return new ko(e)}function Gl(e,t){return ha(e).Decode(t).Encode(()=>{throw Error("Encode not implemented")})}function vl(e,t){return ha(e).Decode(()=>{throw Error("Decode not implemented")}).Encode(t)}function Zr(e){return A(e)&&a.HasPropertyKey(e,"~codec")&&a.IsObject(e["~codec"])&&a.HasPropertyKey(e["~codec"],"encode")&&a.HasPropertyKey(e["~codec"],"decode")}function cC(e,t){let r=Oa(e)?[...e["~refine"],t]:[t];return f.Update(e,{"~refine":r},{})}function jl(e,t,r="error"){return cC(e,{refine:t,message:r})}function Oa(e){return A(e)&&a.HasPropertyKey(e,"~refine")}var Fl="-?(?:0|[1-9][0-9]*)n";function Mo(e){return f.Create({"~kind":"BigInt"},{type:"bigint"},e)}function mt(e){return h(e,"BigInt")}function Aa(e){return f.Create({"~kind":"Boolean"},{type:"boolean"},e)}function Xe(e){return h(e,"Boolean")}function wo(e){return f.Create({"~kind":"Identifier"},{name:e})}function Bl(e){return h(e,"Identifier")}var Sa="-?(?:0|[1-9][0-9]*)";function Xr(e){return f.Create({"~kind":"Integer"},{type:"integer"},e)}function ke(e){return h(e,"Integer")}function Dt(e,t){return f.Create({"~kind":"Iterator"},{type:"iterator",iteratorItems:e},t)}function Ve(e){return h(e,"Iterator")}function ql(e){return f.Discard(e,["~kind","type","iteratorItems"])}var yp=class extends Error{constructor(t){super("Invalid Literal value"),Object.defineProperty(this,"cause",{value:{value:t},writable:!1,configurable:!1,enumerable:!1})}};function mC(e){return a.IsBigInt(e)?"bigint":a.IsBoolean(e)?"boolean":a.IsNumber(e)?"number":a.IsString(e)?"string":(()=>{throw new yp(e)})()}function q(e,t){return f.Create({"~kind":"Literal"},{type:mC(e),const:e},t)}function ba(e){return a.IsBigInt(e)||a.IsBoolean(e)||a.IsNumber(e)||a.IsString(e)}function Hl(e){return V(e)&&a.IsBigInt(e.const)}function Kl(e){return V(e)&&a.IsBoolean(e.const)}function Mn(e){return V(e)&&a.IsNumber(e.const)}function wn(e){return V(e)&&a.IsString(e.const)}function V(e){return h(e,"Literal")}function Or(e){return f.Create({"~kind":"Null"},{type:"null"},e)}function Gt(e){return h(e,"Null")}var xa="-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";function Tt(e){return f.Create({"~kind":"Number"},{type:"number"},e)}function le(e){return h(e,"Number")}function $n(e){return f.Create({"~kind":"Symbol"},{type:"symbol"},e)}function vt(e){return h(e,"Symbol")}function zl(e){return a.Keys(e).filter(t=>!xe(e[t]))}function Vl(e){return a.Keys(e)}function Ra(e){return a.Values(e)}function uC(e,t={}){let r=zl(e),o=r.length>0?{required:r}:{};return f.Create({"~kind":"Object"},{type:"object",...o,properties:e},t)}var N=uC;function M(e){return h(e,"Object")}function Yl(e){return f.Discard(e,["~kind","type","properties","required"])}function Jr(...e){let[t,r,o]=te.Match(e,{3:(i,s,c)=>[i,s,c],2:(i,s)=>[i,s,s],1:i=>[i,je(),je()]});return f.Create({"~kind":"Parameter"},{name:t,extends:r,equals:o},{})}function Ql(e){return h(e,"Parameter")}function jt(e,t){return f.Create({"~kind":"Promise"},{type:"promise",item:e},t)}function Be(e){return h(e,"Promise")}function Wl(e){return f.Discard(e,["~kind","type","item"])}var Ca=".*";function at(e){return f.Create({"~kind":"String"},{type:"string"},e)}function Oe(e){return h(e,"String")}function st(e,t){let r="object",o={[e]:t};return f.Create({"~kind":"Record"},{type:r,patternProperties:o})}var Dn=`^${Sa}$`,Gn=`^${xa}$`,Ft=`^${Ca}$`;function $o(e,t,r={}){return R("Record",[e,t],r)}function lC(e,t,r={}){return x({},$o(e,t,r))}function Pa(e,t,r={}){return lC(e,t,r)}function Zl(e,t){return st(e,t)}function ut(e){return a.Keys(e.patternProperties)[0]}function vn(e){let t=ut(e);return a.IsEqual(t,Dn)?Xr():a.IsEqual(t,Gn)?Tt():at()}function qe(e){return e.patternProperties[ut(e)]}function de(e){return h(e,"Record")}function en(e){return f.Create({"~kind":"Rest"},{type:"rest",items:e},{})}function Ar(e){return h(e,"Rest")}function Ua(e){return f.Create({"~kind":"This"},{$ref:"#"},e)}function Xl(e){return h(e,"This")}function Me(e,t={}){let[r,o,i]=[e,e.length,!1];return f.Create({"~kind":"Tuple"},{type:"array",additionalItems:i,items:r,minItems:o},t)}function H(e){return h(e,"Tuple")}function Jl(e){return f.Discard(e,["~kind","type","items","minItems","additionalItems"])}function jn(e){return f.Create({"~kind":"Undefined"},{type:"undefined"},e)}function Bt(e){return h(e,"Undefined")}function G(e,t={}){return f.Create({"~kind":"Union"},{anyOf:e},t)}function O(e){return h(e,"Union")}function ed(e){return f.Discard(e,["~kind","anyOf"])}function td(e){return f.Create({"~kind":"Unsafe"},{},e)}function rd(e){return h(e,"Unsafe")}function Na(e){return f.Create({"~kind":"Void"},{type:"void"},e)}function lt(e){return h(e,"Void")}function fC(e,t){return a.IsEqual(e,"Array")?Ct(t[0]):a.IsEqual(e,"AsyncIterator")?wt(t[0]):a.IsEqual(e,"Iterator")?Dt(t[0]):a.IsEqual(e,"Promise")?jt(t[0]):a.IsEqual(e,"Awaited")?ti(t[0]):a.IsEqual(e,"Capitalize")?Go(t[0]):a.IsEqual(e,"ConstructorParameters")?qo(t[0]):a.IsEqual(e,"Evaluate")?Ip(t[0]):a.IsEqual(e,"Exclude")?Ho(t[0],t[1]):a.IsEqual(e,"Extract")?Ko(t[0],t[1]):a.IsEqual(e,"Index")?qn(t[0],t[1]):a.IsEqual(e,"InstanceType")?zo(t[0]):a.IsEqual(e,"Lowercase")?vo(t[0]):a.IsEqual(e,"NonNullable")?Vo(t[0]):a.IsEqual(e,"Omit")?Yo(t[0],t[1]):a.IsEqual(e,"Options")?Kn(t[0],t[1]):a.IsEqual(e,"Parameters")?Qo(t[0]):a.IsEqual(e,"Partial")?Wo(t[0]):a.IsEqual(e,"Pick")?Zo(t[0],t[1]):a.IsEqual(e,"Readonly")?Xo(t[0]):a.IsEqual(e,"KeyOf")?Hn(t[0]):a.IsEqual(e,"Record")?$o(t[0],t[1]):a.IsEqual(e,"Required")?Jo(t[0]):a.IsEqual(e,"ReturnType")?ei(t[0]):a.IsEqual(e,"Uncapitalize")?jo(t[0]):a.IsEqual(e,"Uppercase")?Fo(t[0]):La(he(e),t)}function tn(){throw Error("Unreachable")}var gC=(e,t=[])=>e.reduce((r,o)=>a.IsArray(o)&&a.IsEqual(o.length,2)?[...r,o[0]]:[...r,o],[]),Zt=e=>{let[t,r]=e;return gC([...t,...r])};function sd(e){return Jr(e[0],e[2],e[4])}function pd(e){return Jr(e[0],e[2],e[2])}function cd(e){return Jr(e[0],je(),e[2])}function md(e){return Jr(e,je(),je())}function ud(e){return Zt(e)}function ld(e){return e[1]}function dd(e){return Zt(e)}function fd(e){return e[1]}function gd(e){return fC(e[0],e[1])}function yd(e){return null}function Ed(e){return at()}function Id(e){return Tt()}function Td(e){return Aa()}function _d(e){return jn()}function hd(e){return Or()}function Od(e){return Xr()}function Ad(e){return Mo()}function Sd(e){return je()}function bd(e){return Ln()}function xd(e){return N({})}function Rd(e){return z()}function Cd(e){return $n()}function Pd(e){return Na()}function Ud(e){return Ua()}function Nd(e){return e[1]}function Ld(e){return q(e)}function kd(e){return a.IsEqual(e.length,3)?[e[0],e[1],...e[2]]:[e[0]]}function Md(e){return e[1]}function wd(e){return Do(e)}function $d(e){return q(BigInt(e))}function Dd(e){return q(a.IsEqual(e,"true"))}function Gd(e){return q(parseFloat(e))}function vd(e){return q(e)}function jd(e){return e.length>0}function Fd(e){return e.reduce((t,r)=>a.IsEqual(r.length,3)?[...t,[r[1]]]:[...t,[]],[])}function Bd(e){return a.IsEqual(e.length,6)?[e[1],e[3],e[5]]:[]}function qd(e){return a.IsArray(e)&&a.IsEqual(e.length,3)?e[1]:e}var nd=(e,t)=>t.reduceRight((r,o)=>{let i=o;return a.IsEqual(i.length,1)?qn(r,i[0]):a.IsEqual(i.length,0)?Ct(r):tn()},e),od=(e,t)=>a.IsEqual(t.length,3)?Bo(e,t[0],t[1],t[2]):e;function Hd(e){let[t,r,o,i]=e;return od(t?Hn(nd(r,o)):nd(r,o),i)}function Ep(e,t){return a.IsEqual(t.length,3)?(()=>{let[r,o,i]=t,s=Ep(o,i);if(a.IsEqual(r,"&"))return U(s)?It([e,...s.allOf]):It([e,s]);if(a.IsEqual(r,"|"))return O(s)?G([e,...s.anyOf]):G([e,s]);tn()})():e}function Kd(e){let[t,r]=e;return Ep(t,r)}function zd(e){let[t,r]=e;return Ep(t,r)}function Vd(e){return fp(e[1])}function Yd(e){return e[1]}function Qd(e){return Tr(e[0],e[2])}function Wd(e){return a.IsEqual(e.length,4)?No(e[1],e[3]):a.IsEqual(e.length,2)?No(e[1],je()):tn()}function Zd(e){return`${e}`}function Xd(e){return ke(e[3])?Dn:le(e[3])?Gn:vt(e[3])?Ft:Oe(e[3])?Ft:tn()}function Jd(e){return e.length>0}function ef(e){return e.length>0}function tf(e){let[t,r,o,i,s]=e;return{[r]:t&&o?ot(nt(s)):t&&!o?ot(s):!t&&o?nt(s):s}}function rf(e){return Zt(e)}function nf(e){return e.reduce((t,r)=>a.HasPropertyKey(r,Dn)||a.HasPropertyKey(r,Gn)||a.HasPropertyKey(r,Ft)?[t[0],f.Assign(t[1],r)]:[f.Assign(t[0],r),t[1]],[{},{}])}function of(e){return nf(e[1])}function af(e){let[t,r]=e,o=a.IsEqual(a.Keys(r).length,0)?{}:{patternProperties:r};return N(t,o)}function sf(e){return a.IsEqual(e.length,5)?ot(nt(e[4])):a.IsEqual(e.length,3)?e[2]:a.IsEqual(e.length,4)?a.IsEqual(e[2],"readonly")?ot(e[3]):nt(e[3]):tn()}function pf(e){return ot(nt(e[1]))}function cf(e){return ot(e[1])}function mf(e){return nt(e[0])}function uf(e){return a.IsEqual(e.length,2)?en(e[1]):a.IsEqual(e.length,1)?e[0]:tn()}function lf(e){return Zt(e)}function df(e){return Me(e[1])}function ff(e){return ot(nt(e[4]))}function gf(e){return ot(e[3])}function yf(e){return nt(e[3])}function Ef(e){return e[2]}function If(e){return a.IsEqual(e.length,2)?en(e[1]):a.IsEqual(e.length,1)?e[0]:tn()}function Tf(e){return Zt(e)}function _f(e){return Ir(e[1],e[4])}function hf(e){return Er(e[2],e[5])}function id(e,t){return a.IsEqual(e,"remove")?fl(t):a.IsEqual(e,"add")?ll(t):t}function Of(e){return a.IsEqual(e.length,2)&&a.IsEqual(e[0],"-")?"remove":a.IsEqual(e.length,2)&&a.IsEqual(e[0],"+")||a.IsEqual(e.length,1)?"add":"none"}function ad(e,t){return a.IsEqual(e,"remove")?ml(t):a.IsEqual(e,"add")?pl(t):t}function Af(e){return a.IsEqual(e.length,2)&&a.IsEqual(e[0],"-")?"remove":a.IsEqual(e.length,2)&&a.IsEqual(e[0],"+")||a.IsEqual(e.length,1)?"add":"none"}function Sf(e){return a.IsEqual(e.length,2)?[e[1]]:[]}function bf(e){return a.IsArray(e[6])&&a.IsEqual(e[6].length,1)?Fn(wo(e[3]),e[5],e[6][0],id(e[1],ad(e[8],e[10]))):Fn(wo(e[3]),e[5],he(e[3]),id(e[1],ad(e[8],e[10])))}function xf(e){return he(e)}function Rf(e){return Kn(e[2],e[4])}function Cf(e){return parseFloat(e)}function Pf(e){return a.IsEqual(e,"true")}function Uf(e){return null}function Nf(e){return{[e[0]]:e[2]}}function Lf(e){return Zt(e)}function yC(e){return e.reduce((t,r)=>f.Assign(t,r),{})}function kf(e){return yC(e[1])}function Mf(e){return Zt(e)}function wf(e){return e[1]}function $f(e){return Mo()}function Df(e){return at()}function Gf(e){return Tt()}function vf(e){return Xr()}function jf(e){return z()}function Ff(e){return q(e)}function Bf(e){return G(e[1])}function qf(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function Hf(e){return[e[0],...e[1]]}function Kf(e){return e[1]}function zf(e){return Zt(e)}function Vf(e){return a.IsEqual(e.length,2)?e[1]:[]}function Yf(e){let t=e[2],r=e[3],[o,i]=e[4],s=a.IsEqual(a.Keys(i).length,0)?{}:{patternProperties:i};return{[e[1]]:Tr(t,Bn(r,o,s))}}function Qf(e){let t=e[2],[r,o]=e[3],i=a.IsEqual(a.Keys(o).length,0)?{}:{patternProperties:o};return{[e[1]]:Bn(t,r,i)}}function Wf(e){return{[e[1]]:Tr(e[2],e[4])}}function Zf(e){return{[e[1]]:e[3]}}function Xf(e){return null}function Jf(e){return nf(Zt(e))}function eg(e){return e[1]}function tg(e){let t=e[0],r=e[1];return Tp(f.Assign(t,r[0]))}function re(e){return zr(e)&&W(e.length,2)}function TC(e,t){return W(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function Pe(e,t){let[r,...o]=e;return gr(r)?(()=>{let i=TC(r,t);return W(i.length,2)?i:Pe(o,t)})():[]}function _p(e,t){return Array.from({length:t-e+1},(r,o)=>String.fromCharCode(e+o))}var rg=[..._p(97,122),..._p(65,90)],hp="0",Op=_p(49,57),zn=[hp,...Op],ng=" ",Vn=`
28
+ `;var Sr="_",ka=".",og="$",Ma="-";var ig="//",ag="/*",hC="*/";function sg(e){let t=e.indexOf(hC);return W(t,-1)?"":e.slice(t+2)}function pg(e){let t=e.indexOf(Vn);return W(t,-1)?"":e.slice(t)}function OC(e){return e.replace(/^[ \t\r\f\v]+/,"")}function wa(e){let t=OC(e);return t.startsWith(ag)?wa(sg(t.slice(2))):t.startsWith(ig)?wa(pg(t.slice(2))):t}function pt(e){let t=e.trimStart();return t.startsWith(ag)?pt(sg(t.slice(2))):t.startsWith(ig)?pt(pg(t.slice(2))):t}function AC(e,t){return e.includes(t)}function Yn(e,t,r,o=""){let i=Pe(e,r);return re(i)?AC(t,i[0])?Yn(e,t,i[1],o):Yn(e,t,i[1],`${o}${i[0]}`):[o,r]}function $a(e,t){let r=Pe([e],t);return re(r)?r:["",t]}function SC(e){return $a(Ma,e)}function bC(e){return Pe(Op,e)}var xC=[...zn,Sr];function RC(e){return Yn(xC,[Sr],e)}function CC(e){let t=SC(e);return re(t)?(()=>{let r=Pe([hp],t[1]);return re(r)?[`${t[0]}${r[0]}`,r[1]]:(()=>{let o=bC(t[1]);return re(o)?(()=>{let i=RC(o[1]);return re(i)?[`${t[0]}${o[0]}${i[0]}`,i[1]]:[]})():[]})()})():[]}function Da(e){return CC(pt(e))}function PC(e){let t=Da(e);return re(t)?(()=>{let r=Pe(["n"],t[1]);return re(r)?[`${t[0]}`,r[1]]:[]})():[]}function cg(e){return PC(e)}function Ap(e,t){return Pe([e],t)}function y(e,t){return W(e,"")?["",t]:e.startsWith(Vn)?Ap(e,wa(t)):e.startsWith(ng)?Ap(e,t):Ap(e,pt(t))}var mg=[...rg,Sr,og];function UC(e){return Pe(mg,e)}var NC=[...mg,...zn];function ug(e,t=""){let r=Pe(NC,e);return re(r)?ug(r[1],`${t}${r[0]}`):[t,e]}function LC(e){let t=UC(e);return re(t)?(()=>{let r=ug(t[1]);return re(r)?[`${t[0]}${r[0]}`,r[1]]:[]})():[]}function fe(e){return LC(pt(e))}var kC=[...zn,Sr];function MC(e){return $a(Ma,e)}function wC(e){return re(Pe([ka],e))}function lg(e){let t=Yn(kC,[Sr],e);return re(t)?W(t[0],"")?[]:[t[0],t[1]]:[]}function $C(e,t){let r=Pe([ka],t);return re(r)?(()=>{let o=lg(r[1]);return re(o)?[`${e}0${r[0]}${o[0]}`,o[1]]:[]})():[]}function DC(e,t){let r=Da(t);return re(r)?(()=>{let o=Pe([ka],r[1]);return re(o)?(()=>{let i=lg(o[1]);return re(i)?[`${e}${r[0]}${o[0]}${i[0]}`,i[1]]:[`${e}${r[0]}`,o[1]]})():[`${e}${r[0]}`,r[1]]})():[]}function GC(e){let t=MC(e);return re(t)?wC(t[1])?$C(t[0],t[1]):DC(t[0],t[1]):[]}function Ga(e){return GC(pt(e))}function dg(e,t){let[r,...o]=e;return gr(r)?t.startsWith(r)?!0:dg(o,t):!1}function br(e,t,r=""){return W(t,"")?[]:dg(e,t)?[r,t]:(()=>{let[o,i]=[t.slice(0,1),t.slice(1)];return br(e,i,`${r}${o}`)})()}function vC(e,t,r){return r.startsWith(e)?(()=>{let o=br([t],r.slice(e.length));return re(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function jC(e,t,r){return r.startsWith(e)?(()=>{let o=br([Vn,t],r.slice(e.length));return re(o)?o[1].startsWith(t)?[`${o[0]}`,o[1].slice(t.length)]:[]:[]})():[]}function fg(e,t,r,o){return r?vC(e,t,pt(o)):jC(e,t,pt(o))}function FC(e,t){return Pe(e,t)}function BC(e,t){return fg(e,e,!1,t)}function qC(e,t){let r=FC(e,t);return re(r)?BC(r[0],`${r[0]}${r[1]}`):[]}function va(e,t){return qC(e,pt(t))}function gg(e,t){let r=br(e,t);return re(r)?W(r[0],"")?[]:r:[]}var p=(e,t,r=()=>[])=>e.length===2?t(e):r(),KC=e=>p(p(fe(e),([t,r])=>p(y("extends",r),([o,i])=>p(Y(i),([s,c])=>p(y("=",c),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[sd(t),r]),zC=e=>p(p(fe(e),([t,r])=>p(y("extends",r),([o,i])=>p(Y(i),([s,c])=>[[t,o,s],c]))),([t,r])=>[pd(t),r]),VC=e=>p(p(fe(e),([t,r])=>p(y("=",r),([o,i])=>p(Y(i),([s,c])=>[[t,o,s],c]))),([t,r])=>[cd(t),r]),YC=e=>p(fe(e),([t,r])=>[md(t),r]),Ig=e=>p(p(KC(e),([t,r])=>[t,r],()=>p(zC(e),([t,r])=>[t,r],()=>p(VC(e),([t,r])=>[t,r],()=>p(YC(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),Tg=(e,t=[])=>p(p(Ig(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>Tg(o,[...t,r]),()=>[t,e]),QC=e=>p(p(Tg(e),([t,r])=>p(p(p(Ig(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[ud(t),r]),xp=e=>p(p(y("<",e),([t,r])=>p(QC(r),([o,i])=>p(y(">",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[ld(t),r]),_g=(e,t=[])=>p(p(Y(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>_g(o,[...t,r]),()=>[t,e]),WC=e=>p(p(_g(e),([t,r])=>p(p(p(Y(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[dd(t),r]),ZC=e=>p(p(y("<",e),([t,r])=>p(WC(r),([o,i])=>p(y(">",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[fd(t),r]),XC=e=>p(p(fe(e),([t,r])=>p(ZC(r),([o,i])=>[[t,o],i])),([t,r])=>[gd(t),r]),hg=e=>p(p(p(y(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[yd(t),r]),Og=e=>p(y("string",e),([t,r])=>[Ed(t),r]),Ag=e=>p(y("number",e),([t,r])=>[Id(t),r]),JC=e=>p(y("boolean",e),([t,r])=>[Td(t),r]),eP=e=>p(y("undefined",e),([t,r])=>[_d(t),r]),tP=e=>p(y("null",e),([t,r])=>[hd(t),r]),Sg=e=>p(y("integer",e),([t,r])=>[Od(t),r]),rP=e=>p(y("bigint",e),([t,r])=>[Ad(t),r]),nP=e=>p(y("unknown",e),([t,r])=>[Sd(t),r]),oP=e=>p(y("any",e),([t,r])=>[bd(t),r]),iP=e=>p(y("object",e),([t,r])=>[xd(t),r]),aP=e=>p(y("never",e),([t,r])=>[Rd(t),r]),bg=e=>p(y("symbol",e),([t,r])=>[Cd(t),r]),sP=e=>p(y("void",e),([t,r])=>[Pd(t),r]),pP=e=>p(y("this",e),([t,r])=>[Ud(t),r]),cP=e=>p(p(Og(e),([t,r])=>[t,r],()=>p(Ag(e),([t,r])=>[t,r],()=>p(JC(e),([t,r])=>[t,r],()=>p(eP(e),([t,r])=>[t,r],()=>p(tP(e),([t,r])=>[t,r],()=>p(Sg(e),([t,r])=>[t,r],()=>p(rP(e),([t,r])=>[t,r],()=>p(nP(e),([t,r])=>[t,r],()=>p(oP(e),([t,r])=>[t,r],()=>p(iP(e),([t,r])=>[t,r],()=>p(aP(e),([t,r])=>[t,r],()=>p(bg(e),([t,r])=>[t,r],()=>p(sP(e),([t,r])=>[t,r],()=>p(pP(e),([t,r])=>[t,r],()=>[])))))))))))))),([t,r])=>[t,r]),mP=e=>p(p(y("${",e),([t,r])=>p(Y(r),([o,i])=>p(y("}",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[Nd(t),r]),Sp=e=>p(br(["${","`"],e),([t,r])=>[Ld(t),r]),xg=e=>p(p(p(Sp(e),([t,r])=>p(mP(r),([o,i])=>p(xg(i),([s,c])=>[[t,o,s],c]))),([t,r])=>[t,r],()=>p(p(Sp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(Sp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[kd(t),r]),Rp=e=>p(p(y("`",e),([t,r])=>p(xg(r),([o,i])=>p(y("`",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[Md(t),r]),uP=e=>p(Rp(e),([t,r])=>[wd(t),r]),lP=e=>p(cg(e),([t,r])=>[$d(t),r]),dP=e=>p(p(y("true",e),([t,r])=>[t,r],()=>p(y("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[Dd(t),r]),fP=e=>p(Ga(e),([t,r])=>[Gd(t),r]),gP=e=>p(va(["'",'"'],e),([t,r])=>[vd(t),r]),yP=e=>p(p(lP(e),([t,r])=>[t,r],()=>p(dP(e),([t,r])=>[t,r],()=>p(fP(e),([t,r])=>[t,r],()=>p(gP(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),EP=e=>p(p(p(y("keyof",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[jd(t),r]),Rg=(e,t=[])=>p(p(p(y("[",e),([r,o])=>p(Y(o),([i,s])=>p(y("]",s),([c,u])=>[[r,i,c],u]))),([r,o])=>[r,o],()=>p(p(y("[",e),([r,o])=>p(y("]",o),([i,s])=>[[r,i],s])),([r,o])=>[r,o],()=>[])),([r,o])=>Rg(o,[...t,r]),()=>[t,e]),IP=e=>p(Rg(e),([t,r])=>[Fd(t),r]),TP=e=>p(p(p(y("extends",e),([t,r])=>p(Y(r),([o,i])=>p(y("?",i),([s,c])=>p(Y(c),([u,l])=>p(y(":",l),([g,E])=>p(Y(E),([I,P])=>[[t,o,s,u,g,I],P])))))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Bd(t),r]),_P=e=>p(p(p(y("(",e),([t,r])=>p(Y(r),([o,i])=>p(y(")",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[t,r],()=>p(cP(e),([t,r])=>[t,r],()=>p(LP(e),([t,r])=>[t,r],()=>p(GP(e),([t,r])=>[t,r],()=>p(uP(e),([t,r])=>[t,r],()=>p(yP(e),([t,r])=>[t,r],()=>p(HP(e),([t,r])=>[t,r],()=>p(qP(e),([t,r])=>[t,r],()=>p(YP(e),([t,r])=>[t,r],()=>p(WP(e),([t,r])=>[t,r],()=>p(XC(e),([t,r])=>[t,r],()=>p(QP(e),([t,r])=>[t,r],()=>[])))))))))))),([t,r])=>[qd(t),r]),Cg=e=>p(p(EP(e),([t,r])=>p(_P(r),([o,i])=>p(IP(i),([s,c])=>p(TP(c),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[Hd(t),r]),Pg=e=>p(p(p(y("&",e),([t,r])=>p(Cg(r),([o,i])=>p(Pg(i),([s,c])=>[[t,o,s],c]))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Ug=e=>p(p(Cg(e),([t,r])=>p(Pg(r),([o,i])=>[[t,o],i])),([t,r])=>[Kd(t),r]),Ng=e=>p(p(p(y("|",e),([t,r])=>p(Ug(r),([o,i])=>p(Ng(i),([s,c])=>[[t,o,s],c]))),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),ja=e=>p(p(Ug(e),([t,r])=>p(Ng(r),([o,i])=>[[t,o],i])),([t,r])=>[zd(t),r]),hP=e=>p(p(y("readonly",e),([t,r])=>p(ja(r),([o,i])=>[[t,o],i])),([t,r])=>[Vd(t),r]),OP=e=>p(p(y("|",e),([t,r])=>p(ja(r),([o,i])=>[[t,o],i])),([t,r])=>[Yd(t),r]),AP=e=>p(p(xp(e),([t,r])=>p(y("=",r),([o,i])=>p(Y(i),([s,c])=>[[t,o,s],c]))),([t,r])=>[Qd(t),r]),SP=e=>p(p(p(y("infer",e),([t,r])=>p(fe(r),([o,i])=>p(y("extends",i),([s,c])=>p(ja(c),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[t,r],()=>p(p(y("infer",e),([t,r])=>p(fe(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>[])),([t,r])=>[Wd(t),r]),Y=e=>p(p(SP(e),([t,r])=>[t,r],()=>p(OP(e),([t,r])=>[t,r],()=>p(hP(e),([t,r])=>[t,r],()=>p(ja(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),bP=e=>p(Ga(e),([t,r])=>[Zd(t),r]),xP=e=>p(fe(e),([t,r])=>[t,r]),RP=e=>p(va(["'",'"'],e),([t,r])=>[t,r]),CP=e=>p(p(y("[",e),([t,r])=>p(fe(r),([o,i])=>p(y(":",i),([s,c])=>p(p(Sg(c),([u,l])=>[u,l],()=>p(Ag(c),([u,l])=>[u,l],()=>p(Og(c),([u,l])=>[u,l],()=>p(bg(c),([u,l])=>[u,l],()=>[])))),([u,l])=>p(y("]",l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[Xd(t),r]),Lg=e=>p(p(bP(e),([t,r])=>[t,r],()=>p(xP(e),([t,r])=>[t,r],()=>p(RP(e),([t,r])=>[t,r],()=>p(CP(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),PP=e=>p(p(p(y("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Jd(t),r]),UP=e=>p(p(p(y("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[ef(t),r]),kg=e=>p(p(PP(e),([t,r])=>p(Lg(r),([o,i])=>p(UP(i),([s,c])=>p(y(":",c),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[tf(t),r]),Mg=e=>p(p(p(y(",",e),([t,r])=>p(y(`
29
29
  `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y(";",e),([t,r])=>p(y(`
30
30
  `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y(",",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(y(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(y(`
31
- `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),hg=(e,t=[])=>p(p(Ig(e),([r,o])=>p(Tg(o),([i,s])=>[[r,i],s])),([r,o])=>hg(o,[...t,r]),()=>[t,e]),YC=e=>p(p(hg(e),([t,r])=>p(p(p(Ig(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Fd(t),r]),mp=e=>p(p(y("{",e),([t,r])=>p(YC(r),([o,i])=>p(y("}",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[qd(t),r]),VC=e=>p(mp(e),([t,r])=>[Hd(t),r]),WC=e=>p(p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,m])=>p(y("readonly",m),([u,l])=>p(V(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[t,r],()=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(y("readonly",i),([s,m])=>p(V(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[t,r],()=>p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,m])=>p(V(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[t,r],()=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(V(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>[])))),([t,r])=>[Kd(t),r]),QC=e=>p(p(y("readonly",e),([t,r])=>p(V(r),([o,i])=>p(y("?",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[zd(t),r]),ZC=e=>p(p(y("readonly",e),([t,r])=>p(V(r),([o,i])=>[[t,o],i])),([t,r])=>[Yd(t),r]),XC=e=>p(p(V(e),([t,r])=>p(y("?",r),([o,i])=>[[t,o],i])),([t,r])=>[Vd(t),r]),tg=e=>p(p(WC(e),([t,r])=>[t,r],()=>p(QC(e),([t,r])=>[t,r],()=>p(ZC(e),([t,r])=>[t,r],()=>p(XC(e),([t,r])=>[t,r],()=>p(V(e),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),_g=e=>p(p(p(y("...",e),([t,r])=>p(tg(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(tg(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[Wd(t),r]),Ag=(e,t=[])=>p(p(_g(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>Ag(o,[...t,r]),()=>[t,e]),JC=e=>p(p(Ag(e),([t,r])=>p(p(p(_g(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Qd(t),r]),eP=e=>p(p(y("[",e),([t,r])=>p(JC(r),([o,i])=>p(y("]",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Zd(t),r]),tP=e=>p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,m])=>p(y("readonly",m),([u,l])=>p(V(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[Xd(t),r]),rP=e=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(y("readonly",i),([s,m])=>p(V(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[Jd(t),r]),nP=e=>p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,m])=>p(V(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[ef(t),r]),oP=e=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(V(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[tf(t),r]),rg=e=>p(p(tP(e),([t,r])=>[t,r],()=>p(rP(e),([t,r])=>[t,r],()=>p(nP(e),([t,r])=>[t,r],()=>p(oP(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),xg=e=>p(p(p(y("...",e),([t,r])=>p(rg(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(rg(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[rf(t),r]),Sg=(e,t=[])=>p(p(xg(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>Sg(o,[...t,r]),()=>[t,e]),Og=e=>p(p(Sg(e),([t,r])=>p(p(p(xg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[nf(t),r]),iP=e=>p(p(y("(",e),([t,r])=>p(Og(r),([o,i])=>p(y(")",i),([s,m])=>p(y("=>",m),([u,l])=>p(V(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[of(t),r]),aP=e=>p(p(y("new",e),([t,r])=>p(y("(",r),([o,i])=>p(Og(i),([s,m])=>p(y(")",m),([u,l])=>p(y("=>",l),([g,E])=>p(V(E),([I,C])=>[[t,o,s,u,g,I],C])))))),([t,r])=>[af(t),r]),sP=e=>p(p(p(y("+",e),([t,r])=>p(y("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("-",e),([t,r])=>p(y("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[sf(t),r]),pP=e=>p(p(p(y("+",e),([t,r])=>p(y("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("-",e),([t,r])=>p(y("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[pf(t),r]),mP=e=>p(p(p(y("as",e),([t,r])=>p(V(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[mf(t),r]),cP=e=>p(p(y("{",e),([t,r])=>p(sP(r),([o,i])=>p(y("[",i),([s,m])=>p(fe(m),([u,l])=>p(y("in",l),([g,E])=>p(V(E),([I,C])=>p(mP(C),([Re,je])=>p(y("]",je),([_o,EO])=>p(pP(EO),([IO,TO])=>p(y(":",TO),([hO,_O])=>p(V(_O),([AO,xO])=>p(ag(xO),([SO,OO])=>p(y("}",OO),([bO,RO])=>[[t,o,s,u,g,I,Re,_o,IO,hO,AO,SO,bO],RO]))))))))))))),([t,r])=>[cf(t),r]),uP=e=>p(fe(e),([t,r])=>[uf(t),r]),lP=e=>p(p(y("Options",e),([t,r])=>p(y("<",r),([o,i])=>p(V(i),([s,m])=>p(y(",",m),([u,l])=>p(Cg(l),([g,E])=>p(y(">",E),([I,C])=>[[t,o,s,u,g,I],C])))))),([t,r])=>[lf(t),r]),dP=e=>p(Ca(e),([t,r])=>[df(t),r]),fP=e=>p(p(y("true",e),([t,r])=>[t,r],()=>p(y("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[ff(t),r]),gP=e=>p(Pa(['"',"'"],e),([t,r])=>[t,r]),yP=e=>p(y("null",e),([t,r])=>[gf(t),r]),bg=e=>p(p(Eg(e),([t,r])=>p(y(":",r),([o,i])=>p(cp(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[yf(t),r]),Rg=(e,t=[])=>p(p(bg(e),([r,o])=>p(Tg(o),([i,s])=>[[r,i],s])),([r,o])=>Rg(o,[...t,r]),()=>[t,e]),EP=e=>p(p(Rg(e),([t,r])=>p(p(p(bg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Ef(t),r]),Cg=e=>p(p(y("{",e),([t,r])=>p(EP(r),([o,i])=>p(y("}",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[If(t),r]),Pg=(e,t=[])=>p(p(cp(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>Pg(o,[...t,r]),()=>[t,e]),IP=e=>p(p(Pg(e),([t,r])=>p(p(p(cp(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Tf(t),r]),TP=e=>p(p(y("[",e),([t,r])=>p(IP(r),([o,i])=>p(y("]",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[hf(t),r]),cp=e=>p(p(dP(e),([t,r])=>[t,r],()=>p(fP(e),([t,r])=>[t,r],()=>p(gP(e),([t,r])=>[t,r],()=>p(yP(e),([t,r])=>[t,r],()=>p(Cg(e),([t,r])=>[t,r],()=>p(TP(e),([t,r])=>[t,r],()=>[])))))),([t,r])=>[t,r]),hP=e=>p(y("-?(?:0|[1-9][0-9]*)n",e),([t,r])=>[_f(t),r]),_P=e=>p(y(".*",e),([t,r])=>[Af(t),r]),AP=e=>p(y("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",e),([t,r])=>[xf(t),r]),xP=e=>p(y("-?(?:0|[1-9][0-9]*)",e),([t,r])=>[Sf(t),r]),SP=e=>p(y("(?!)",e),([t,r])=>[Of(t),r]),OP=e=>p(eg(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,r])=>[bf(t),r]),bP=e=>p(p(hP(e),([t,r])=>[t,r],()=>p(_P(e),([t,r])=>[t,r],()=>p(AP(e),([t,r])=>[t,r],()=>p(xP(e),([t,r])=>[t,r],()=>p(SP(e),([t,r])=>[t,r],()=>p(RP(e),([t,r])=>[t,r],()=>p(OP(e),([t,r])=>[t,r],()=>[]))))))),([t,r])=>[t,r]),RP=e=>p(p(y("(",e),([t,r])=>p(up(r),([o,i])=>p(y(")",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Rf(t),r]),Ug=e=>p(p(p(ap(e),([t,r])=>p(y("|",r),([o,i])=>p(Ug(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[t,r],()=>p(p(ap(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[]))),([t,r])=>[Cf(t),r]),ap=e=>p(p(bP(e),([t,r])=>p(up(r),([o,i])=>[[t,o],i])),([t,r])=>[Pf(t),r]),up=e=>p(p(Ug(e),([t,r])=>[t,r],()=>p(ap(e),([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),Ng=e=>p(p(y("^",e),([t,r])=>p(up(r),([o,i])=>p(y("$",i),([s,m])=>[[t,o,s],m]))),([t,r])=>[Uf(t),r]),kg=(e,t=[])=>p(p(V(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>kg(o,[...t,r]),()=>[t,e]),CP=e=>p(p(kg(e),([t,r])=>p(p(p(V(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Nf(t),r]),Lg=e=>p(p(p(y("extends",e),([t,r])=>p(CP(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[kf(t),r]),PP=e=>p(p(y("interface",e),([t,r])=>p(fe(r),([o,i])=>p(sp(i),([s,m])=>p(Lg(m),([u,l])=>p(mp(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[Lf(t),r]),UP=e=>p(p(y("interface",e),([t,r])=>p(fe(r),([o,i])=>p(Lg(i),([s,m])=>p(mp(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[Mf(t),r]),NP=e=>p(p(y("type",e),([t,r])=>p(fe(r),([o,i])=>p(sp(i),([s,m])=>p(y("=",m),([u,l])=>p(V(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[wf(t),r]),kP=e=>p(p(y("type",e),([t,r])=>p(fe(r),([o,i])=>p(y("=",i),([s,m])=>p(V(m),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[$f(t),r]),LP=e=>p(p(p(y("export",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Df(t),r]),MP=e=>p(p(p(y(";",e),([t,r])=>p(y(`
31
+ `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),wg=(e,t=[])=>p(p(kg(e),([r,o])=>p(Mg(o),([i,s])=>[[r,i],s])),([r,o])=>wg(o,[...t,r]),()=>[t,e]),NP=e=>p(p(wg(e),([t,r])=>p(p(p(kg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[rf(t),r]),Cp=e=>p(p(y("{",e),([t,r])=>p(NP(r),([o,i])=>p(y("}",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[of(t),r]),LP=e=>p(Cp(e),([t,r])=>[af(t),r]),kP=e=>p(p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,c])=>p(y("readonly",c),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[t,r],()=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(y("readonly",i),([s,c])=>p(Y(c),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[t,r],()=>p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,c])=>p(Y(c),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[t,r],()=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(Y(i),([s,c])=>[[t,o,s],c]))),([t,r])=>[t,r],()=>[])))),([t,r])=>[sf(t),r]),MP=e=>p(p(y("readonly",e),([t,r])=>p(Y(r),([o,i])=>p(y("?",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[pf(t),r]),wP=e=>p(p(y("readonly",e),([t,r])=>p(Y(r),([o,i])=>[[t,o],i])),([t,r])=>[cf(t),r]),$P=e=>p(p(Y(e),([t,r])=>p(y("?",r),([o,i])=>[[t,o],i])),([t,r])=>[mf(t),r]),yg=e=>p(p(kP(e),([t,r])=>[t,r],()=>p(MP(e),([t,r])=>[t,r],()=>p(wP(e),([t,r])=>[t,r],()=>p($P(e),([t,r])=>[t,r],()=>p(Y(e),([t,r])=>[t,r],()=>[]))))),([t,r])=>[t,r]),$g=e=>p(p(p(y("...",e),([t,r])=>p(yg(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(yg(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[uf(t),r]),Dg=(e,t=[])=>p(p($g(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>Dg(o,[...t,r]),()=>[t,e]),DP=e=>p(p(Dg(e),([t,r])=>p(p(p($g(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[lf(t),r]),GP=e=>p(p(y("[",e),([t,r])=>p(DP(r),([o,i])=>p(y("]",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[df(t),r]),vP=e=>p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,c])=>p(y("readonly",c),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[ff(t),r]),jP=e=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(y("readonly",i),([s,c])=>p(Y(c),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[gf(t),r]),FP=e=>p(p(fe(e),([t,r])=>p(y("?",r),([o,i])=>p(y(":",i),([s,c])=>p(Y(c),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[yf(t),r]),BP=e=>p(p(fe(e),([t,r])=>p(y(":",r),([o,i])=>p(Y(i),([s,c])=>[[t,o,s],c]))),([t,r])=>[Ef(t),r]),Eg=e=>p(p(vP(e),([t,r])=>[t,r],()=>p(jP(e),([t,r])=>[t,r],()=>p(FP(e),([t,r])=>[t,r],()=>p(BP(e),([t,r])=>[t,r],()=>[])))),([t,r])=>[t,r]),Gg=e=>p(p(p(y("...",e),([t,r])=>p(Eg(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(Eg(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[])),([t,r])=>[If(t),r]),vg=(e,t=[])=>p(p(Gg(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>vg(o,[...t,r]),()=>[t,e]),jg=e=>p(p(vg(e),([t,r])=>p(p(p(Gg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Tf(t),r]),qP=e=>p(p(y("(",e),([t,r])=>p(jg(r),([o,i])=>p(y(")",i),([s,c])=>p(y("=>",c),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[_f(t),r]),HP=e=>p(p(y("new",e),([t,r])=>p(y("(",r),([o,i])=>p(jg(i),([s,c])=>p(y(")",c),([u,l])=>p(y("=>",l),([g,E])=>p(Y(E),([I,P])=>[[t,o,s,u,g,I],P])))))),([t,r])=>[hf(t),r]),KP=e=>p(p(p(y("+",e),([t,r])=>p(y("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("-",e),([t,r])=>p(y("readonly",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("readonly",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[Of(t),r]),zP=e=>p(p(p(y("+",e),([t,r])=>p(y("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("-",e),([t,r])=>p(y("?",r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y("?",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])))),([t,r])=>[Af(t),r]),VP=e=>p(p(p(y("as",e),([t,r])=>p(Y(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Sf(t),r]),YP=e=>p(p(y("{",e),([t,r])=>p(KP(r),([o,i])=>p(y("[",i),([s,c])=>p(fe(c),([u,l])=>p(y("in",l),([g,E])=>p(Y(E),([I,P])=>p(VP(P),([be,ve])=>p(y("]",ve),([Ro,tx])=>p(zP(tx),([rx,nx])=>p(y(":",nx),([ox,ix])=>p(Y(ix),([ax,sx])=>p(hg(sx),([px,cx])=>p(y("}",cx),([mx,ux])=>[[t,o,s,u,g,I,be,Ro,rx,ox,ax,px,mx],ux]))))))))))))),([t,r])=>[bf(t),r]),QP=e=>p(fe(e),([t,r])=>[xf(t),r]),WP=e=>p(p(y("Options",e),([t,r])=>p(y("<",r),([o,i])=>p(Y(i),([s,c])=>p(y(",",c),([u,l])=>p(qg(l),([g,E])=>p(y(">",E),([I,P])=>[[t,o,s,u,g,I],P])))))),([t,r])=>[Rf(t),r]),ZP=e=>p(Ga(e),([t,r])=>[Cf(t),r]),XP=e=>p(p(y("true",e),([t,r])=>[t,r],()=>p(y("false",e),([t,r])=>[t,r],()=>[])),([t,r])=>[Pf(t),r]),JP=e=>p(va(['"',"'"],e),([t,r])=>[t,r]),eU=e=>p(y("null",e),([t,r])=>[Uf(t),r]),Fg=e=>p(p(Lg(e),([t,r])=>p(y(":",r),([o,i])=>p(Pp(i),([s,c])=>[[t,o,s],c]))),([t,r])=>[Nf(t),r]),Bg=(e,t=[])=>p(p(Fg(e),([r,o])=>p(Mg(o),([i,s])=>[[r,i],s])),([r,o])=>Bg(o,[...t,r]),()=>[t,e]),tU=e=>p(p(Bg(e),([t,r])=>p(p(p(Fg(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Lf(t),r]),qg=e=>p(p(y("{",e),([t,r])=>p(tU(r),([o,i])=>p(y("}",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[kf(t),r]),Hg=(e,t=[])=>p(p(Pp(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>Hg(o,[...t,r]),()=>[t,e]),rU=e=>p(p(Hg(e),([t,r])=>p(p(p(Pp(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Mf(t),r]),nU=e=>p(p(y("[",e),([t,r])=>p(rU(r),([o,i])=>p(y("]",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[wf(t),r]),Pp=e=>p(p(ZP(e),([t,r])=>[t,r],()=>p(XP(e),([t,r])=>[t,r],()=>p(JP(e),([t,r])=>[t,r],()=>p(eU(e),([t,r])=>[t,r],()=>p(qg(e),([t,r])=>[t,r],()=>p(nU(e),([t,r])=>[t,r],()=>[])))))),([t,r])=>[t,r]),oU=e=>p(y("-?(?:0|[1-9][0-9]*)n",e),([t,r])=>[$f(t),r]),iU=e=>p(y(".*",e),([t,r])=>[Df(t),r]),aU=e=>p(y("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",e),([t,r])=>[Gf(t),r]),sU=e=>p(y("-?(?:0|[1-9][0-9]*)",e),([t,r])=>[vf(t),r]),pU=e=>p(y("(?!)",e),([t,r])=>[jf(t),r]),cU=e=>p(gg(["-?(?:0|[1-9][0-9]*)n",".*","-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?","-?(?:0|[1-9][0-9]*)","(?!)","(",")","$","|"],e),([t,r])=>[Ff(t),r]),mU=e=>p(p(oU(e),([t,r])=>[t,r],()=>p(iU(e),([t,r])=>[t,r],()=>p(aU(e),([t,r])=>[t,r],()=>p(sU(e),([t,r])=>[t,r],()=>p(pU(e),([t,r])=>[t,r],()=>p(uU(e),([t,r])=>[t,r],()=>p(cU(e),([t,r])=>[t,r],()=>[]))))))),([t,r])=>[t,r]),uU=e=>p(p(y("(",e),([t,r])=>p(Up(r),([o,i])=>p(y(")",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[Bf(t),r]),Kg=e=>p(p(p(bp(e),([t,r])=>p(y("|",r),([o,i])=>p(Kg(i),([s,c])=>[[t,o,s],c]))),([t,r])=>[t,r],()=>p(p(bp(e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[]))),([t,r])=>[qf(t),r]),bp=e=>p(p(mU(e),([t,r])=>p(Up(r),([o,i])=>[[t,o],i])),([t,r])=>[Hf(t),r]),Up=e=>p(p(Kg(e),([t,r])=>[t,r],()=>p(bp(e),([t,r])=>[t,r],()=>[])),([t,r])=>[t,r]),zg=e=>p(p(y("^",e),([t,r])=>p(Up(r),([o,i])=>p(y("$",i),([s,c])=>[[t,o,s],c]))),([t,r])=>[Kf(t),r]),Vg=(e,t=[])=>p(p(Y(e),([r,o])=>p(y(",",o),([i,s])=>[[r,i],s])),([r,o])=>Vg(o,[...t,r]),()=>[t,e]),lU=e=>p(p(Vg(e),([t,r])=>p(p(p(Y(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[zf(t),r]),Yg=e=>p(p(p(y("extends",e),([t,r])=>p(lU(r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Vf(t),r]),dU=e=>p(p(y("interface",e),([t,r])=>p(fe(r),([o,i])=>p(xp(i),([s,c])=>p(Yg(c),([u,l])=>p(Cp(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[Yf(t),r]),fU=e=>p(p(y("interface",e),([t,r])=>p(fe(r),([o,i])=>p(Yg(i),([s,c])=>p(Cp(c),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[Qf(t),r]),gU=e=>p(p(y("type",e),([t,r])=>p(fe(r),([o,i])=>p(xp(i),([s,c])=>p(y("=",c),([u,l])=>p(Y(l),([g,E])=>[[t,o,s,u,g],E]))))),([t,r])=>[Wf(t),r]),yU=e=>p(p(y("type",e),([t,r])=>p(fe(r),([o,i])=>p(y("=",i),([s,c])=>p(Y(c),([u,l])=>[[t,o,s,u],l])))),([t,r])=>[Zf(t),r]),EU=e=>p(p(p(y("export",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p([[],e],([t,r])=>[t,r],()=>[])),([t,r])=>[Xf(t),r]),IU=e=>p(p(p(y(";",e),([t,r])=>p(y(`
32
32
  `,r),([o,i])=>[[t,o],i])),([t,r])=>[t,r],()=>p(p(y(";",e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>p(p(y(`
33
- `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]),Mg=(e,t=[])=>p(p(lp(e),([r,o])=>p(MP(o),([i,s])=>[[r,i],s])),([r,o])=>Mg(o,[...t,r]),()=>[t,e]),wP=e=>p(p(Mg(e),([t,r])=>p(p(p(lp(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Gf(t),r]),lp=e=>p(p(LP(e),([t,r])=>p(p(PP(r),([o,i])=>[o,i],()=>p(UP(r),([o,i])=>[o,i],()=>p(NP(r),([o,i])=>[o,i],()=>p(kP(r),([o,i])=>[o,i],()=>[])))),([o,i])=>p(ag(i),([s,m])=>[[t,o,s],m]))),([t,r])=>[vf(t),r]),$P=e=>p(p(lp(e),([t,r])=>p(wP(r),([o,i])=>[[t,o],i])),([t,r])=>[jf(t),r]),wg=e=>p(p($P(e),([t,r])=>[t,r],()=>p(vC(e),([t,r])=>[t,r],()=>p(V(e),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]);function $g(e){let t=pp(`\`${e}\``);return a.IsEqual(t.length,2)?t[0]:F()}function No(e,t={}){return b("TemplateLiteral",[e],t)}function Dg(e){return O({},No(e,{}))}function GP(e){let t=$g(e);return Dg(t)}function Gg(e,t={}){let r=a.IsString(e)?GP(e):Dg(e);return f.Update(r,{},t)}function he(e){return _(e,"TemplateLiteral")}var k={};It(k,{ExtendsFalse:()=>j,ExtendsTrue:()=>S,ExtendsUnion:()=>dp,IsExtendsFalse:()=>vP,IsExtendsTrue:()=>jg,IsExtendsTrueLike:()=>ge,IsExtendsUnion:()=>vg});function dp(e){return f.Create({"~kind":"ExtendsUnion"},{inferred:e})}function vg(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"inferred")&&a.IsEqual(e["~kind"],"ExtendsUnion")&&a.IsObject(e.inferred)}function S(e){return f.Create({"~kind":"ExtendsTrue"},{inferred:e})}function jg(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"inferred")&&a.IsEqual(e["~kind"],"ExtendsTrue")&&a.IsObject(e.inferred)}function j(){return f.Create({"~kind":"ExtendsFalse"},{})}function vP(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.IsEqual(e["~kind"],"ExtendsFalse")}function ge(e){return vg(e)||jg(e)}function Na(e){let t=Ng(e);return a.IsEqual(t.length,2)?t[0]:F()}function jP(e){return!0}function Fg(e){let[t,...r]=e;return x(t)?FP(t)?Fg(r):!1:!0}function Bg(e){return a.IsEqual(e.length,0)?!1:Fg(e)}function FP(e){return A(e)?Bg(e.anyOf):Y(e)?jP(e.const):!1}function ka(e){return Bg(e)}function qg(e,t,r=[]){let[o,...i]=e;return a.IsString(o)?qg(i,t,[...r,`${o}${t}`]):r}function BP(e,t){return a.IsEqual(e.length,0)?[`${t}`]:qg(e,t)}function Hg(e,t,r=[]){let[o,...i]=t;return x(o)?Hg(e,i,[...r,...Kg(e,o)]):r}function Kg(e,t){return A(t)?Hg(e,t.anyOf):Y(t)?BP(e,t.const):F()}function zg(e,t){let[r,...o]=t;return x(r)?zg(Kg(e,r),o):e}function qP(e){return e.map(t=>q(t))}function HP(e){let t=zg([],e),r=qP(t);return G(r)}function KP(e){return a.IsEqual(e.length,0)?F():a.IsEqual(e.length,1)&&Y(e[0])?e[0]:HP(e)}function Ke(e){let t=Na(e);return ka(t)?KP(t):ot()}function zP(e){return a.IsString(e)||a.IsNumber(e)?q(e):a.IsNull(e)?Er():z()}function bt(e){return e.map(r=>zP(r))}function Qo(e){let t=bt(e);return G(t)}function Wr(e){return Qo(e.enum)}function YP(e,t,r,o){let i=X(e,r,o);return ge(i)?S(f.Assign(f.Assign(e,i.inferred),{[t]:r})):j()}function VP(e,t){return S(e)}function WP(e,t,r){let o=Qo(r);return X(e,t,o)}function Yg(e,t,r){let[o,...i]=r;return x(o)?(()=>{let s=X(e,t,o);return ge(s)?Yg(s.inferred,t,i):j()})():S(e)}function QP(e,t,r){let o=Ke(r);return X(e,t,o)}function Vg(e,t,r){let[o,...i]=r;return x(o)?(()=>{let s=X(e,t,o);return ge(s)?S(s.inferred):Vg(e,t,i)})():j()}function B(e,t,r){return Qe(r)?VP(e,t):Te(r)?WP(e,t,r.enum):Ie(r)?YP(e,r.name,t,r.extends):P(r)?Yg(e,t,r.allOf):he(r)?QP(e,t,r.pattern):A(r)?Vg(e,t,r.anyOf):nt(r)?S(e):j()}function Wg(e,t,r){return Ie(r)?B(e,t,r):Qe(r)?S(e):nt(r)?S(e):dp(e)}function ZP(e,t){let r=Br(e),o=Br(t);return r&&o||!r&&o?!0:!(r&&!o)}function Qg(e,t,r,o){return Z(o)?ZP(t,o)?X(e,r,o.items):j():B(e,t,o)}function Zg(e,t,r){return Ye(r)?X(e,t,r.iteratorItems):B(e,Nt(t),r)}function Xg(e,t,r){return st(r)?S(e):B(e,t,r)}function Jg(e,t,r){return Xe(r)?S(e):B(e,t,r)}function XP(e,t,r,o,i){let s=Ie(o)?t:o,m=Ie(o)?o:t,u=Ce(t),l=Ce(o),g=X(e,s,m);return!u&&l?j():ge(g)?Zo(g.inferred,r,i):j()}function JP(e,t,r,o){let[i,...s]=o;return x(i)?XP(e,t,r,i,s):Ce(t)?S(e):j()}function eU(e,t,r){let[o,...i]=t;return x(o)?JP(e,o,i,r):S(e)}function Zo(e,t,r){return eU(e,t,r)}function La(e,t,r){return mt(r)?S(e):X(e,t,r)}function ey(e,t,r,o){return Pe(o)?(()=>{let i=Zo(e,t,o.parameters);return ge(i)?La(i.inferred,r,o.instanceType):j()})():j()}function ty(e,t,r){return X(e,Wr(t),r)}function ry(e,t,r,o){return Ue(o)?(()=>{let i=Zo(e,t,o.parameters);return ge(i)?La(i.inferred,r,o.returnType):j()})():j()}function ny(e,t,r){return Me(r)?S(e):le(r)?S(e):B(e,t,r)}var Xo="equal",tU="disjoint",Jo="left-inside",ei="right-inside";function ti(e,t){let r=[nt(e)?k.ExtendsFalse():ze({},e,t),nt(e)?k.ExtendsTrue({}):ze({},t,e)];return k.IsExtendsTrueLike(r[0])&&k.IsExtendsTrueLike(r[1])?Xo:k.IsExtendsTrueLike(r[0])&&k.IsExtendsFalse(r[1])?Jo:k.IsExtendsFalse(r[0])&&k.IsExtendsTrueLike(r[1])?ei:tU}function rU(e){return A(e)?vt(e.anyOf):[e]}function vt(e){return e.reduce((t,r)=>[...t,...rU(r)],[])}function fp(e){return e.reduceRight((r,o,i)=>({[i]:o,...r}),{})}function oy(e){let t=fp(e.items);return N(t)}function nU(e,t){return qr(e)?!!qr(t):!1}function oU(e,t){return Ce(e)?!!Ce(t):!1}function iU(e,t){let r=nU(e,t),o=oU(e,t),i=_e([e,t]),s=sa(Sn(i));return r&&o?rt(tt(s)):r&&!o?rt(s):!r&&o?tt(s):s}function aU(e,t,r){return r in e?r in t?iU(e[r],t[r]):e[r]:r in t?t[r]:z()}function sU(e,t){return[...new Set([...a.Keys(t),...a.Keys(e)])].reduce((o,i)=>({...o,[i]:aU(e,t,i)}),{})}function iy(e){return M(e)?e.properties:H(e)?fp(e.items):F()}function ay(e,t){let r=iy(e),o=iy(t),i=sU(r,o);return N(i)}function sy(e,t){let r=ti(e,t);return a.IsEqual(r,Jo)?e:a.IsEqual(r,ei)||a.IsEqual(r,Xo)?t:z()}function py(e){return M(e)||H(e)}function my(e){return P(e)?_e(e.allOf):e}function pU(e,t){let r=my(e),o=my(t),i=py(r),s=py(o);return i&&s?ay(_r(r),o):i&&!s?_r(r):!i&&s?o:sy(_r(r),o)}function cy(e,t,r=[]){let[o,...i]=t;return a.IsUndefined(o)?r.length===0?[e]:r:cy(e,i,[...r,pU(e,o)])}function uy(e,t,r=[]){let[o,...i]=e;return x(o)?uy(i,t,[...r,...ri([o],t)]):r}function ri(e,t=[]){let[r,...o]=e;return x(r)?A(r)?ri(o,uy(r.anyOf,t)):ri(o,cy(r,t)):t}function _e(e){let t=ri(e);return gp(t)}function Qt(e){return gp(e)}function _r(e){return P(e)?_e(e.allOf):A(e)?Qt(e.anyOf):e}function Qr(e){return a.IsEqual(e.length,1)?e[0]:a.IsEqual(e.length,0)?z():G(e)}function mU(e,t){return t.filter(r=>ti(e,r)!==ei)}function cU(e,t){let r=t.some(o=>{let i=ti(e,o);return a.IsEqual(i,Jo)||a.IsEqual(i,Xo)});return a.IsEqual(r,!1)}function uU(e,t){let r=_r(e);return Qe(r)?[r]:cU(r,t)?[...mU(r,t),r]:t}function yp(e,t=[]){let[r,...o]=e;return x(r)?M(r)?yp(o,[...t,r]):yp(o,uU(r,t)):t}function gp(e){let t=yp(e),r=vt(t);return r.length===0?z():r.length===1?r[0]:G(r)}function lU(e,t,r,o){let i=T(e,t,r);return f.Update(_r(i),{},o)}function ly(e,t,r,o){return lU(e,t,r,o)}function dy(e,t,r){let o=_e(t);return X(e,o,r)}function fy(e,t,r){return Ve(r)?X(e,t,r.iteratorItems):B(e,Lt(t),r)}function Ma(e,t,r){return t===r?S(e):j()}function dU(e,t,r){return Y(r)?Ma(e,t,r.const):st(r)?S(e):B(e,q(t),r)}function fU(e,t,r){return Y(r)?Ma(e,t,r.const):Xe(r)?S(e):B(e,q(t),r)}function gU(e,t,r){return Y(r)?Ma(e,t,r.const):le(r)?S(e):B(e,q(t),r)}function yU(e,t,r){return Y(r)?Ma(e,t,r.const):xe(r)?S(e):B(e,q(t),r)}function gy(e,t,r){return a.IsBigInt(t.const)?dU(e,t.const,r):a.IsBoolean(t.const)?fU(e,t.const,r):a.IsNumber(t.const)?gU(e,t.const,r):a.IsString(t.const)?yU(e,t.const,r):F()}function yy(e,t,r){return Ie(r)?B(e,t,r):S(e)}function Ey(e,t,r){return Mt(r)?S(e):B(e,t,r)}function Iy(e,t,r){return le(r)?S(e):B(e,t,r)}function EU(e,t,r){return Ce(t)?Ce(r)?S(e):j():S(e)}function IU(e,t,r){return Ie(r)&&Vt(r.extends)?j():(()=>{let o=X(e,t,r);return ge(o)?EU(o.inferred,t,r):j()})()}function TU(e,t){return e.reduce((r,o)=>o in t?ge(t[o])?{...r,...t[o].inferred}:F():F(),{})}function hU(e,t,r){let o={};for(let m of a.Keys(r))o[m]=m in t?IU({},t[m],r[m]):Ce(r[m])?Ie(r[m])?S(f.Assign(e,{[r[m].name]:r[m].extends})):S(e):j();let i=a.Values(o).every(m=>ge(m)),s=i?TU(a.Keys(o),o):{};return i?S(s):j()}function _U(e,t,r){let o=hU(e,t,r);return ge(o)?S(f.Assign(e,o.inferred)):j()}function AU(e,t,r){return _U(e,t,r)}function Ty(e,t,r){return M(r)?AU(e,t,r.properties):B(e,N(t),r)}function hy(e,t,r){return qe(r)?X(e,t,r.item):B(e,$t(t),r)}function _y(e,t,r){return xe(r)?S(e):B(e,t,r)}function Ay(e,t,r){return wt(r)?S(e):B(e,t,r)}function xy(e,t,r){let o=Ke(t);return X(e,o,r)}function Ep(e,t){return f.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function ni(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"name")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"Inferrable")&&a.IsString(e.name)&&a.IsObject(e.type)}function Ip(e){return Ir(e)?Ie(e.items)?Z(e.items.extends)?Ep(e.items.name,e.items.extends.items):nt(e.items.extends)?Ep(e.items.name,e.items.extends):void 0:F():void 0}function wa(e){return Ie(e)?Ep(e.name,e.extends):void 0}function Tp(e,t,r=[]){let[o,...i]=e;return x(o)?(()=>{let s=X({},o,t);return ge(s)?Tp(i,t,[...r,o]):void 0})():r}function Sy(e,t,r,o){let i=Tp(r,o);return a.IsArray(i)?S(f.Assign(e,{[t]:we(i)})):j()}function $a(e,t,r,o){let i=Tp(r,o);return a.IsArray(i)?S(f.Assign(e,{[t]:G(i)})):j()}function xU(e){return[...e].reverse()}function hp(e,t){return t?xU(e):e}function SU(e){let t=e.length>0?e[0]:void 0,r=x(t)?Ip(t):void 0;return x(r)}function OU(e,t,r,o,i,s){let m=X(e,r,i);return ge(m)?Oy(m.inferred,t,o,s):j()}function bU(e,t,r,o,i){let s=Ip(o);return ni(s)?Sy(e,s.name,hp(r,t),s.type):(()=>{let[m,...u]=r;return x(m)?OU(e,t,m,u,o,i):j()})()}function RU(e,t,r,o){let[i,...s]=o;return x(i)?bU(e,t,r,i,s):a.IsEqual(r.length,0)?S(e):j()}function Oy(e,t,r,o){return RU(e,t,r,o)}function CU(e,t,r){let o=Da(e,{callstack:[]},r),i=SU(o);return Oy(e,i,hp(t,i),hp(o,i))}function by(e,t,r){let o=wa(r);return ni(o)?$a(e,o.name,t,o.type):(()=>{let[i,...s]=t;return x(i)?(()=>{let m=X(e,i,r);return ge(m)?by(m.inferred,s,r):j()})():S(e)})()}function Ry(e,t,r){let o=Da(e,{callstack:[]},t);return H(r)?CU(e,o,r.items):Z(r)?by(e,o,r.items):B(e,we(o),r)}function Cy(e,t,r){return mt(r)?S(e):Gt(r)?S(e):B(e,t,r)}function Py(e,t,r){let[o,...i]=r;return x(o)?(()=>{let s=X(e,t,o);return ge(s)?S(s.inferred):Py(e,t,i)})():j()}function _p(e,t,r){let[o,...i]=t;return x(o)?(()=>{let s=Py(e,o,r);return ge(s)?_p(s.inferred,i,r):j()})():S(e)}function Uy(e,t,r){let o=wa(r);return ni(o)?$a(e,o.name,t,o.type):A(r)?_p(e,t,r.anyOf):_p(e,t,[r])}function Ny(e,t,r){return Ie(r)?B(e,t,r):Qe(r)?S(e):nt(r)?S(e):j()}function ky(e,t,r){return mt(r)?S(e):B(e,t,r)}function X(e,t,r){return Qe(t)?Wg(e,t,r):Z(t)?Qg(e,t,t.items,r):Ye(t)?Zg(e,t.iteratorItems,r):st(t)?Xg(e,t,r):Xe(t)?Jg(e,t,r):Pe(t)?ey(e,t.parameters,t.instanceType,r):Te(t)?ty(e,t,r):Ue(t)?ry(e,t.parameters,t.returnType,r):Me(t)?ny(e,t,r):P(t)?dy(e,t.allOf,r):Ve(t)?fy(e,t.iteratorItems,r):Y(t)?gy(e,t,r):Vt(t)?yy(e,t,r):Mt(t)?Ey(e,t,r):le(t)?Iy(e,t,r):M(t)?Ty(e,t.properties,r):qe(t)?hy(e,t.item,r):xe(t)?_y(e,t,r):wt(t)?Ay(e,t,r):he(t)?xy(e,t.pattern,r):H(t)?Ry(e,t.items,r):Gt(t)?Cy(e,t,r):A(t)?Uy(e,t.anyOf,r):nt(t)?Ny(e,t,r):mt(t)?ky(e,t,r):j()}function $n(e,t,r={}){return b("Interface",[e,t],r)}function qn(e){return x(e)&&a.HasPropertyKey(e,"action")&&a.IsEqual(e.action,"Interface")}function Ly(e,t,r={}){return O({},$n(e,t,r))}function PU(e,t,r){return e.includes(r)?!0:Ar([...e,r],t,t[r])}function My(e,t,r){let o=Ea(r);return Zr(e,t,o)}function Zr(e,t,r){let[o,...i]=r;return x(o)?Ar(e,t,o)?!0:Zr(e,t,i):!1}function Ar(e,t,r){return oe(r)?PU(e,t,r.$ref):Z(r)?Ar(e,t,r.items):Ye(r)?Ar(e,t,r.iteratorItems):Pe(r)?Zr(e,t,[...r.parameters,r.instanceType]):Ue(r)?Zr(e,t,[...r.parameters,r.returnType]):qn(r)?My(e,t,r.parameters[1]):P(r)?Zr(e,t,r.allOf):Ve(r)?Ar(e,t,r.iteratorItems):M(r)?My(e,t,r.properties):qe(r)?Ar(e,t,r.item):A(r)?Zr(e,t,r.anyOf):H(r)?Zr(e,t,r.items):de(r)?Ar(e,t,He(r)):!1}function Ga(e,t,r){return Ar(e,t,r)}function UU(e,t){return t.reduce((r,o)=>o in e?Ga([o],e,e[o])?[...r,o]:r:F(),[])}function wy(e){let t=kl(e);return UU(e,t)}function NU(e,t,r){return r.includes(t)?r:t in e?xr(e,e[t],[...r,t]):F()}function $y(e,t,r){let o=Ea(t);return Hn(e,o,r)}function Hn(e,t,r){return t.reduce((o,i)=>xr(e,i,o),r)}function xr(e,t,r){return oe(t)?NU(e,t.$ref,r):Z(t)?xr(e,t.items,r):Ye(t)?xr(e,t.iteratorItems,r):Pe(t)?Hn(e,[...t.parameters,t.instanceType],r):Ue(t)?Hn(e,[...t.parameters,t.returnType],r):qn(t)?$y(e,t.parameters[1],r):P(t)?Hn(e,t.allOf,r):Ve(t)?xr(e,t.iteratorItems,r):M(t)?$y(e,t.properties,r):qe(t)?xr(e,t.item,r):A(t)?Hn(e,t.anyOf,r):H(t)?Hn(e,t.items,r):de(t)?xr(e,He(t),r):r}function Dy(e,t,r){return xr(e,r,[t])}function kU(e){return bn()}function LU(e){return a.Keys(e).reduce((t,r)=>({...t,[r]:jt(e[r])}),{})}function oi(e){return e.reduce((t,r)=>[...t,jt(r)],[])}function jt(e){return oe(e)?kU(e.$ref):Z(e)?Ot(jt(e.items),ma(e)):Ye(e)?Nt(jt(e.iteratorItems)):Pe(e)?lr(oi(e.parameters),jt(e.instanceType)):Ue(e)?dr(oi(e.parameters),jt(e.returnType)):P(e)?gt(oi(e.allOf)):Ve(e)?Lt(jt(e.iteratorItems)):M(e)?N(LU(e.properties)):qe(e)?$t(jt(e.item)):de(e)?Ta(Ln(e),jt(He(e))):A(e)?G(oi(e.anyOf)):H(e)?we(oi(e.items)):e}function MU(e,t){return t in e?jt(e[t]):Fe()}function Gy(e){return MU(e.$defs,e.$ref)}function wU(e,t,r){let o=ct(e,{callstack:[]},t),i=ii({},{callstack:[]},r);return _e([...o,N(i)])}function $U(e,t){return a.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let s=e[i],m=qn(s)?wU(e,s.parameters[0],s.parameters[1]):s;return{...o,[i]:m}},{})}function vy(e,t,r){let o=Dy(e,t,r),i=$U(e,o);return kt(i,t)}function jy(e,t){return t in e?oe(e[t])?jy(e,e[t].$ref):e[t]:z()}function Ft(e,t){return jy(e,t)}function Fy(e){return ae(e)?Gy(e):e}function ze(e,t,r){let o=Fy(t),i=Fy(r);return X(e,o,i)}function DU(e,t,r){if(Ie(t)||Kn(t)||k.IsExtendsTrueLike(ze({},t,r)))return;let o={parameter:e,extends:r,received:t};throw new Error("Generic argument does not satify constraint",{cause:o})}function By(e,t,r,o,i){let s=T(e,t,i);return DU(r,s,o),f.Assign(e,{[r]:s})}function GU(e,t,r,o,i){let s=T(e,t,r.extends),m=T(e,t,r.equals),[u,...l]=i;return x(u)?Ap(By(e,t,r.name,s,u),t,o,l):Ap(By(e,t,r.name,s,m),t,o,[])}function Ap(e,t,r,o){let[i,...s]=r;return x(i)?GU(e,t,i,s,o):e}function qy(e,t,r,o){return Ap(e,t,r,o)}function vU(e){return a.IsGreaterThan(e.length,0)?e[0]:""}function Hy(e,t,r,o){let i=ct(e,t,o);return Aa(r,i)}function jU(e,t,r,o){return Hy(e,t,Ae(r),o)}function FU(e,t,r,o,i,s){let m=ct(e,t,s),u=qy(e,t,o,m),l=T(u,{callstack:[...t.callstack,r]},i);return T(e,t,l)}function va(e,t,r,o){let[i,s]=pl(e,r,o);return On(s)?a.IsEqual(vU(t.callstack),i)?jU(e,t,i,o):FU(e,t,i,s.parameters,s.expression,o):Hy(e,t,r,o)}function Aa(e,t){return f.Create({"~kind":"Call"},{target:e,arguments:t},{})}function Ky(e,t){return va({},{callstack:[]},e,t)}function Kn(e){return _(e,"Call")}function zy(e){return qe(e)?zy(e.item):e}function BU(e,t,r,o){let i=T(e,t,r);return f.Update(zy(i),{},o)}function Yy(e,t,r,o){return L(e,[r])?BU(e,t,r,o):Wo(r,o)}function Vy(e,t){return e(t)}function Wy(e,t){return a.IsString(t)?q(Vy(e,t)):q(t)}function Qy(e,t){let r=Ke(t);return Zt(e,r)}function Zy(e,t){let r=t.map(o=>Zt(e,o));return G(r)}function Zt(e,t){return Y(t)?Wy(e,t.const):he(t)?Qy(e,t.pattern):A(t)?Zy(e,t.anyOf):t}function ko(e,t={}){return b("Capitalize",[e],t)}function Xy(e,t={}){return O({},ko(e,t))}function Lo(e,t={}){return b("Lowercase",[e],t)}function Jy(e,t={}){return O({},Lo(e,t))}function Mo(e,t={}){return b("Uncapitalize",[e],t)}function eE(e,t={}){return O({},Mo(e,t))}function wo(e,t={}){return b("Uppercase",[e],t)}function tE(e,t={}){return O({},wo(e,t))}var qU=e=>e[0].toUpperCase()+e.slice(1),HU=e=>e.toLowerCase(),KU=e=>e[0].toLowerCase()+e.slice(1),zU=e=>e.toUpperCase();function YU(e,t,r,o){let i=T(e,t,r);return f.Update(Zt(qU,i),{},o)}function rE(e,t,r,o){return L(e,[r])?YU(e,t,r,o):ko(r,o)}function VU(e,t,r,o){let i=T(e,t,r);return f.Update(Zt(HU,i),{},o)}function nE(e,t,r,o){return L(e,[r])?VU(e,t,r,o):Lo(r,o)}function WU(e,t,r,o){let i=T(e,t,r);return f.Update(Zt(KU,i),{},o)}function oE(e,t,r,o){return L(e,[r])?WU(e,t,r,o):Mo(r,o)}function QU(e,t,r,o){let i=T(e,t,r);return f.Update(Zt(zU,i),{},o)}function iE(e,t,r,o){return L(e,[r])?QU(e,t,r,o):wo(r,o)}function $o(e,t,r,o,i={}){return b("Conditional",[e,t,r,o],i)}function aE(e,t,r,o,i={}){return O({},$o(e,t,r,o,i))}function ZU(e,t,r,o,i,s,m){let u=T(e,t,r),l=T(e,t,o),g=ze(e,u,l);return f.Update(k.IsExtendsUnion(g)?G([T(g.inferred,t,i),T(e,t,s)]):k.IsExtendsTrue(g)?T(g.inferred,t,i):T(e,t,s),{},m)}function sE(e,t,r,o,i,s,m){return L(e,[r,o])?ZU(e,t,r,o,i,s,m):$o(r,o,i,s,m)}function Do(e,t={}){return b("ConstructorParameters",[e],t)}function pE(e,t={}){return O({},Do(e,t))}function XU(e){return Pe(e)?T({},{callstack:[]},we(e.parameters)):z()}function JU(e,t,r,o){let i=T(e,t,r);return f.Update(XU(i),{},o)}function mE(e,t,r,o){return L(e,[r])?JU(e,t,r,o):Do(r,o)}function Go(e,t,r={}){return b("Exclude",[e,t],r)}function cE(e,t,r={}){return O({},Go(e,t,r))}function uE(e,t){return e.reduce((r,o)=>[...r,...lE(o,t)],[])}function lE(e,t){let r=ze({},e,t);return k.IsExtendsTrueLike(r)?[]:[e]}function eN(e,t){let r=Te(e)?uE(bt(e.enum),t):A(e)?uE(vt(e.anyOf),t):lE(e,t);return Qt(r)}function tN(e,t,r,o,i){let s=T(e,t,r),m=T(e,t,o);return f.Update(eN(s,m),{},i)}function ja(e,t,r,o,i){return L(e,[r,o])?tN(e,t,r,o,i):Go(r,o,i)}function vo(e,t,r={}){return b("Extract",[e,t],r)}function dE(e,t,r={}){return O({},vo(e,t,r))}function fE(e,t){return e.reduce((r,o)=>[...r,...gE(o,t)],[])}function gE(e,t){let r=ze({},e,t);return k.IsExtendsTrueLike(r)?[e]:[]}function rN(e,t){let r=Te(e)?fE(bt(e.enum),t):A(e)?fE(vt(e.anyOf),t):gE(e,t);return Qt(r)}function nN(e,t,r,o,i){let s=T(e,t,r),m=T(e,t,o);return f.Update(rN(s,m),{},i)}function yE(e,t,r,o,i){return L(e,[r,o])?nN(e,t,r,o,i):vo(r,o,i)}var oN=new RegExp("^(?:0|[1-9][0-9]*)$");function zn(e){let t=`${e}`;return oN.test(t)?parseInt(t):e}function iN(e){return q(zn(e))}function EE(e){return e.map(t=>IE(t))}function IE(e){return P(e)?gt(EE(e.allOf)):A(e)?G(EE(e.anyOf)):Y(e)?iN(e.const):e}function TE(e,t){let r=IE(t),o=ze({},r,yt());return k.IsExtendsTrueLike(o)?e:z()}function hE(e,t){let r=Ft(e,t);return Bt(r)}function Fa(e){return e.reduce((t,r)=>[...t,...Bt(r)],[])}function _E(e){let t=bt(e);return Fa(t)}function AE(e){let t=_e(e);return Bt(t)}function xE(e){return[`${e}`]}function SE(e){let t=Ke(e);return Bt(t)}function Bt(e){return ae(e)?hE(e.$defs,e.$ref):Te(e)?_E(e.enum):P(e)?AE(e.allOf):Y(e)?xE(e.const):he(e)?SE(e.pattern):A(e)?Fa(e.anyOf):[]}function Yn(e){return Bt(e)}function aN(e,t){return t in e?[e[t]]:[]}function sN(e,t){return t.reduce((r,o)=>[...r,...aN(e,o)],[])}function OE(e,t){let r=Yn(t),o=sN(e,r);return Qt(o)}function pN(e){return q(zn(e))}function bE(e){return e.map(t=>xp(t))}function xp(e){return P(e)?gt(bE(e.allOf)):A(e)?G(bE(e.anyOf)):Y(e)?pN(e.const):e}function mN(e,t){return e.reduceRight((r,o,i)=>{let s=ze({},q(i),t);return k.IsExtendsTrueLike(s)?[o,...r]:r},[])}function cN(e,t){let r=xp(t),o=mN(e,r);return Qr(o)}function uN(e){return Qr(e)}function RE(e,t){return le(t)||Me(t)?uN(e):cN(e,t)}function lN(e){return e.reduce((t,r)=>ga(r)?[...t,q(r)]:t,[])}function Vn(e){let t=lN(e);return G(t)}function Dn(e,t,r={}){return b("Index",[e,t],r)}function CE(e,t,r={}){let o=a.IsArray(t)?Vn(t):t;return O({},Dn(e,o,r))}function PE(e,t){let r=Ft(e,t);return Rt(r)}function dN(e,t){let r=a.Keys(e).filter(E=>!a.HasPropertyKey(t,E)),o=a.Keys(t).filter(E=>!a.HasPropertyKey(e,E)),i=a.Keys(e).filter(E=>a.HasPropertyKey(t,E)),s=r.reduce((E,I)=>({...E,[I]:e[I]}),{}),m=o.reduce((E,I)=>({...E,[I]:t[I]}),{}),u=i.reduce((E,I)=>({...E,[I]:_e([e[I],t[I]])}),{}),l=f.Assign(s,m);return f.Assign(l,u)}function UE(e){return e.reduce((t,r)=>dN(t,Rt(r)),{})}function NE(e){let t=oy(we(e));return Rt(t)}function fN(e,t){return a.Keys(e).filter(i=>i in t).reduce((i,s)=>({...i,[s]:Qt([e[s],t[s]])}),{})}function kE(e,t){let[r,...o]=e;return x(r)?kE(o,fN(t,Rt(r))):t}function LE(e){let[t,...r]=e;return x(t)?kE(r,Rt(t)):F()}function Rt(e){return ae(e)?PE(e.$defs,e.$ref):P(e)?UE(e.allOf):A(e)?LE(e.anyOf):H(e)?NE(e.items):M(e)?e.properties:{}}function Wn(e){let t=Rt(e);return N(t)}function gN(e){return ae(e)||P(e)||A(e)?Wn(e):e}function yN(e,t){let r=gN(e);return Z(r)?TE(r.items,t):M(r)?OE(r.properties,t):H(r)?RE(r.items,t):z()}function EN(e,t,r,o,i){let s=T(e,t,r),m=T(e,t,o);return f.Update(yN(s,m),{},i)}function ME(e,t,r,o,i){return L(e,[r,o])?EN(e,t,r,o,i):Dn(r,o,i)}function jo(e,t={}){return b("InstanceType",[e],t)}function wE(e,t={}){return O({},jo(e,t))}function IN(e){return Pe(e)?e.instanceType:z()}function TN(e,t,r,o){let i=T(e,t,r);return f.Update(IN(i),{},o)}function $E(e,t,r,o={}){return L(e,[r])?TN(e,t,r,o):jo(r,o)}function hN(e,t,r,o,i){let s=ct(e,{callstack:[]},r),m=ii(e,{callstack:[]},o),u=_e([...s,N(m)]);return f.Update(u,{},i)}function DE(e,t,r,o,i){return L(e,r)?hN(e,t,r,o,i):$n(r,o,i)}function Gn(e,t={}){return b("KeyOf",[e],t)}function GE(e,t={}){return O({},Gn(e,t))}function vE(){return G([yt(),ot(),Un()])}function jE(e){return yt()}function _N(e){return e.reduce((r,o)=>ga(o)?[...r,q(zn(o))]:F(),[])}function FE(e){let t=a.Keys(e),r=_N(t);return Qr(r)}function BE(e){return Ln(e)}function qE(e){let t=e.map((r,o)=>q(o));return Qr(t)}function AN(e){return ae(e)||P(e)||A(e)?Wn(e):e}function xN(e){let t=AN(e);return Qe(t)?vE():Z(t)?jE(t.items):M(t)?FE(t.properties):de(t)?BE(t):H(t)?qE(t.items):z()}function SN(e,t,r,o){let i=T(e,t,r);return f.Update(xN(i),{},o)}function HE(e,t,r,o){return L(e,[r])?SN(e,t,r,o):Gn(r,o)}function ON(e){let t=Ke(e);return Sp(t)}function KE(e){return e.reduce((t,r)=>[...t,...Sp(r)],[])}function Sp(e){return Te(e)?KE(bt(e.enum)):Pn(e)||Cn(e)?[e]:he(e)?ON(e.pattern):A(e)?KE(e.anyOf):[]}function zE(e){return Sp(e)}function wn(e,t,r,o,i={}){return b("Mapped",[e,t,r,o],i)}function YE(e,t,r,o,i={}){return O({},wn(e,t,r,o,i))}function bN(e,t,r,o,i){let s=f.Assign(e,{[r.name]:o}),m=T(s,t,i);return he(m)?Ke(m.pattern):m}function RN(e,t,r,o,i){let s=f.Assign(e,{[r.name]:o});return T(s,t,i)}function CN(e,t,r,o,i,s){let m=RN(e,t,r,o,s),u=bN(e,t,r,o,i);return Pn(u)||Cn(u)?{[u.const]:m}:{}}function PN(e,t,r,o,i,s){return o.reduce((m,u)=>({...m,...CN(e,t,r,u,i,s)}),{})}function UN(e,t,r,o,i,s){let m=zE(o),u=PN(e,t,r,m,i,s);return N(u)}function NN(e,t,r,o,i,s,m){let u=T(e,t,o);return f.Update(UN(e,t,r,u,i,s),{},m)}function VE(e,t,r,o,i,s,m){return L(e,[o])?NN(e,t,r,o,i,s,m):wn(r,o,i,s,m)}function kN(e,t){return a.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>({...o,[i]:vy(e,i,e[i])}),{})}function LN(e,t){return a.Keys(e).filter(o=>!t.includes(o)).reduce((o,i)=>({...o,[i]:T(e,{callstack:[]},e[i])}),{})}function MN(e,t){let r=wy(e),o=kN(e,r),i=LN(e,r),s={...o,...i};return f.Update(s,{},t)}function WE(e,t,r,o){let i=f.Assign(e,r);return MN(i,o)}function Fo(e,t={}){return b("NonNullable",[e],t)}function QE(e,t={}){return O({},Fo(e,t))}function wN(e){let t=G([Er(),Mn()]);return ja({},{callstack:[]},e,t,{})}function $N(e,t,r,o){let i=T(e,t,r);return f.Update(wN(i),{},o)}function ZE(e,t,r,o){return L(e,[r])?$N(e,t,r,o):Fo(r,o)}function Ba(e){let t=Wn(e);return M(t)?t.properties:F()}function Bo(e,t,r={}){return b("Omit",[e,t],r)}function XE(e,t,r={}){let o=a.IsArray(t)?Vn(t):t;return O({},Bo(e,o,r))}function DN(e,t){return a.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function GN(e,t){let r=Ba(e),o=Yn(t),i=DN(r,o);return N(i)}function vN(e,t,r,o,i){let s=T(e,t,r),m=T(e,t,o);return f.Update(GN(s,m),{},i)}function JE(e,t,r,o,i){return L(e,[r,o])?vN(e,t,r,o,i):Bo(r,o,i)}function vn(e,t){return b("Options",[e,t],{})}function qa(e,t){return O({},vn(e,t))}function jN(e,t,r,o){let i=T(e,t,r);return f.Update(i,{},o)}function eI(e,t,r,o){return L(e,[r])?jN(e,t,r,o):vn(r,o)}function qo(e,t={}){return b("Parameters",[e],t)}function tI(e,t={}){return O({},qo(e,t))}function FN(e){return Ue(e)?T({},{callstack:[]},we(e.parameters)):z()}function BN(e,t,r,o){let i=T(e,t,r);return f.Update(FN(i),{},o)}function rI(e,t,r,o){return L(e,[r])?BN(e,t,r,o):qo(r,o)}function Ho(e,t={}){return b("Partial",[e],t)}function nI(e,t={}){return O({},Ho(e,t))}function oI(e,t){let r=Ft(e,t),o=Sr(r);return kt(f.Assign(e,{[t]:o}),t)}function iI(e){let t=e.map(r=>Sr(r));return _e(t)}function aI(e){let t=e.map(r=>Sr(r));return G(t)}function sI(e){let t=a.Keys(e).reduce((o,i)=>({...o,[i]:aa(e[i])}),{});return N(t)}function Sr(e){return ae(e)?oI(e.$defs,e.$ref):P(e)?iI(e.allOf):A(e)?aI(e.anyOf):M(e)?sI(e.properties):N({})}function qN(e,t,r,o){let i=T(e,t,r);return f.Update(Sr(i),{},o)}function pI(e,t,r,o){return L(e,[r])?qN(e,t,r,o):Ho(r,o)}function Ko(e,t,r={}){return b("Pick",[e,t],r)}function mI(e,t,r={}){let o=a.IsArray(t)?Vn(t):t;return O({},Ko(e,o,r))}function HN(e,t){return a.Keys(e).reduce((o,i)=>t.includes(i)?f.Assign(o,{[i]:e[i]}):o,{})}function KN(e,t){let r=Ba(e),o=Yn(t),i=HN(r,o);return N(i)}function zN(e,t,r,o,i){let s=T(e,t,r),m=T(e,t,o);return f.Update(KN(s,m),{},i)}function cI(e,t,r,o,i){return L(e,[r,o])?zN(e,t,r,o,i):Ko(r,o,i)}function zo(e,t={}){return b("ReadonlyType",[e],t)}function uI(e,t={}){return O({},zo(e,t))}function lI(e){return ur(Ot(e))}function dI(e,t){let r=Ft(e,t),o=Or(r);return kt(f.Assign(e,{[t]:o}),t)}function fI(e){let t=e.map(r=>Or(r));return _e(t)}function gI(e){let t=a.Keys(e).reduce((o,i)=>({...o,[i]:pa(e[i])}),{});return N(t)}function yI(e){return ur(we(e))}function EI(e){let t=e.map(r=>Or(r));return G(t)}function Or(e){return Z(e)?lI(e.items):ae(e)?dI(e.$defs,e.$ref):P(e)?fI(e.allOf):M(e)?gI(e.properties):H(e)?yI(e.items):A(e)?EI(e.anyOf):e}function YN(e,t,r,o){let i=T(e,t,r);return f.Update(Or(i),{},o)}function II(e,t,r,o){return L(e,[r])?YN(e,t,r,o):zo(r,o)}function TI(e){return it(Dt,e)}function hI(e){return N({true:e,false:e})}function _I(e,t){let r=Qo(e);return br(r,t)}function AI(e,t){return it(Nn,t)}function xI(e,t){let r=_e(e);return br(r,t)}function SI(e,t){return a.IsString(e)||a.IsNumber(e)?N({[e]:t}):a.IsEqual(e,!1)?N({false:t}):a.IsEqual(e,!0)?N({true:t}):N({})}function OI(e,t){return it(kn,t)}function bI(e,t){return a.HasPropertyKey(e,"pattern")&&(a.IsString(e.pattern)||e.pattern instanceof RegExp)?it(e.pattern.toString(),t):it(Dt,t)}function RI(e,t){let r=Na(e);return ka(r)?br(Ke(e),t):it(e,t)}function VN(e){return e.some(t=>xe(t)||le(t)||Me(t))}function WN(e,t){return a.IsEqual(VN(e),!0)?it(Dt,t):void 0}function QN(e,t){return e.reduce((r,o)=>Y(o)&&(a.IsString(o.const)||a.IsNumber(o.const))?{...r,[o.const]:t}:r,{})}function ZN(e,t){let r=QN(e,t);return N(r)}function CI(e,t){let r=vt(e),o=WN(r,t);return x(o)?o:ZN(r,t)}function br(e,t){return Qe(e)?TI(t):Xe(e)?hI(t):Te(e)?_I(e.enum,t):Me(e)?AI(e,t):P(e)?xI(e.allOf,t):Y(e)?SI(e.const,t):le(e)?OI(e,t):A(e)?CI(e.anyOf,t):xe(e)?bI(e,t):he(e)?RI(e.pattern,t):N({})}function XN(e,t,r,o,i){let s=T(e,t,r),m=T(e,t,o);return f.Update(br(s,m),{},i)}function PI(e,t,r,o,i){return L(e,[r])?XN(e,t,r,o,i):Uo(r,o,i)}function UI(e,t,r){return r in e?Ga([r],e,e[r])?Ae(r):T(e,t,e[r]):Ae(r)}function NI(e,t){let r=Ft(e,t),o=Rr(r);return kt(f.Assign(e,{[t]:o}),t)}function kI(e){let t=e.map(r=>Rr(r));return _e(t)}function LI(e){let t=e.map(r=>Rr(r));return G(t)}function MI(e){let t=a.Keys(e).reduce((o,i)=>({...o,[i]:Sn(e[i])}),{});return N(t)}function Rr(e){return ae(e)?NI(e.$defs,e.$ref):P(e)?kI(e.allOf):A(e)?LI(e.anyOf):M(e)?MI(e.properties):N({})}function Yo(e,t={}){return b("Required",[e],t)}function wI(e,t={}){return O({},Yo(e,t))}function JN(e,t,r,o){let i=T(e,t,r);return f.Update(Rr(i),{},o)}function $I(e,t,r,o){return L(e,[r])?JN(e,t,r,o):Yo(r,o)}function Vo(e,t={}){return b("ReturnType",[e],t)}function DI(e,t={}){return O({},Vo(e,t))}function ek(e){return Ue(e)?e.returnType:z()}function tk(e,t,r,o){let i=T(e,t,r);return f.Update(ek(i),{},o)}function GI(e,t,r,o){return L(e,[r])?tk(e,t,r,o):Vo(r,o)}function vI(e){return f.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function rk(e){return e.join("|")}function nk(e){return e.slice(1,e.length-1)}function ok(e,t,r){return Cr(t,`${r}${e}`)}function ik(e,t){return Cr(e,`${t}${bl}`)}function ak(e,t){return Cr(e,`${t}${fa}`)}function sk(e,t){return Cr(e,`${t}${ya}`)}function pk(e,t){return bp(G([q("false"),q("true")]),e,t)}function mk(e,t){return Cr(e,`${t}${Ia}`)}function ck(e,t,r){return Cr(t,`${r}${nk(e)}`)}function uk(e,t,r,o=[]){let i=bt(e);return Op(i,t,r)}function Op(e,t,r,o=[]){let[i,...s]=e;return x(i)?Op(s,t,r,[...o,bp(i,[],"")]):Cr(t,`${r}(${rk(o)})`)}function bp(e,t,r){return Te(e)?uk(e.enum,t,r):Me(e)?ak(t,r):Y(e)?ok(e.const,t,r):st(e)?ik(t,r):Xe(e)?pk(t,r):le(e)?sk(t,r):xe(e)?mk(t,r):he(e)?ck(e.pattern,t,r):A(e)?Op(e.anyOf,t,r):al}function Cr(e,t){let[r,...o]=e;return x(r)?bp(r,o,t):t}function lk(e){return`^${Cr(e,"")}$`}function jI(e){let t=lk(e);return vI(t)}function dk(e,t,r,o){let i=ct(e,t,r);return f.Update(jI(i),{},o)}function FI(e,t,r,o){return L(e,r)?dk(e,t,r,o):No(r,o)}function fk(e){return Ir(e)?H(e.items)?Rp(e.items.items):Ie(e.items)?[e]:oe(e.items)?[e]:[z()]:[e]}function Rp(e){return e.reduce((r,o)=>[...r,...fk(o)],[])}function gk(e,t){return t in e}function yk(e,t){return P(t)?L(e,t.allOf):A(t)?L(e,t.anyOf):oe(t)?gk(e,t.$ref):!0}function L(e,t){let[r,...o]=t;return x(r)?yk(e,r)?L(e,o):!1:!0}function ai(e,t,r){return el(e)?ai(e.type,"remove",r):Qu(e)?ai(e.type,t,"remove"):Xu(e)?ai(e.type,"add",r):Vu(e)?ai(e.type,t,"add"):[e,t,r]}function Ek(e,t){return a.IsEqual(e,"remove")?sa(t):a.IsEqual(e,"add")?rt(t):t}function Ik(e,t){return a.IsEqual(e,"remove")?Sn(t):a.IsEqual(e,"add")?tt(t):t}function ii(e,t,r){return a.Keys(r).reduce((o,i)=>({...o,[i]:T(e,t,r[i])}),{})}function Da(e,t,r){let o=ct(e,t,r);return Rp(o)}function ct(e,t,r){return r.map(o=>T(e,t,o))}function Tk(e,t,r,o,i){return a.IsEqual(r,"Awaited")?Yy(e,t,o[0],i):a.IsEqual(r,"Capitalize")?rE(e,t,o[0],i):a.IsEqual(r,"Conditional")?sE(e,t,o[0],o[1],o[2],o[3],i):a.IsEqual(r,"ConstructorParameters")?mE(e,t,o[0],i):a.IsEqual(r,"Evaluate")?ly(e,t,o[0],i):a.IsEqual(r,"Exclude")?ja(e,t,o[0],o[1],i):a.IsEqual(r,"Extract")?yE(e,t,o[0],o[1],i):a.IsEqual(r,"Index")?ME(e,t,o[0],o[1],i):a.IsEqual(r,"InstanceType")?$E(e,t,o[0],i):a.IsEqual(r,"Interface")?DE(e,t,o[0],o[1],i):a.IsEqual(r,"KeyOf")?HE(e,t,o[0],i):a.IsEqual(r,"Lowercase")?nE(e,t,o[0],i):a.IsEqual(r,"Mapped")?VE(e,t,o[0],o[1],o[2],o[3],i):a.IsEqual(r,"Module")?WE(e,t,o[0],i):a.IsEqual(r,"NonNullable")?ZE(e,t,o[0],i):a.IsEqual(r,"Pick")?cI(e,t,o[0],o[1],i):a.IsEqual(r,"Options")?eI(e,t,o[0],o[1]):a.IsEqual(r,"Parameters")?rI(e,t,o[0],i):a.IsEqual(r,"Partial")?pI(e,t,o[0],i):a.IsEqual(r,"Omit")?JE(e,t,o[0],o[1],i):a.IsEqual(r,"ReadonlyType")?II(e,t,o[0],i):a.IsEqual(r,"Record")?PI(e,t,o[0],o[1],i):a.IsEqual(r,"Required")?$I(e,t,o[0],i):a.IsEqual(r,"ReturnType")?GI(e,t,o[0],i):a.IsEqual(r,"TemplateLiteral")?FI(e,t,o[0],i):a.IsEqual(r,"Uncapitalize")?oE(e,t,o[0],i):a.IsEqual(r,"Uppercase")?iE(e,t,o[0],i):b(r,o,i)}function T(e,t,r){let o=Br(r),i=ai(r,qr(r)?"add":"none",Ce(r)?"add":"none"),s=ft(i[0])?i[0].Clone():i[0],m=oe(s)?UI(e,t,s.$ref):Z(s)?Ot(T(e,t,s.items),ma(s)):Ye(s)?Nt(T(e,t,s.iteratorItems),rl(s)):Kn(s)?va(e,t,s.target,s.arguments):Pe(s)?lr(ct(e,t,s.parameters),T(e,t,s.instanceType),ol(s)):tl(s)?Tk(e,t,s.action,s.parameters,s.options):Ue(s)?dr(ct(e,t,s.parameters),T(e,t,s.returnType),il(s)):P(s)?gt(ct(e,t,s.allOf),ll(s)):Ve(s)?Lt(T(e,t,s.iteratorItems),Cl(s)):M(s)?N(ii(e,t,s.properties),Ll(s)):qe(s)?$t(T(e,t,s.item),wl(s)):de(s)?$l(pt(s),T(e,t,He(s))):Ir(s)?Yr(T(e,t,s.items)):H(s)?we(Da(e,t,s.items),Gl(s)):A(s)?G(ct(e,t,s.anyOf),vl(s)):s,u=o?ur(m):m;return Ek(i[1],Ik(i[2],u))}function O(e,t){return T(e,{callstack:[]},t)}function Wo(e,t={}){return b("Awaited",[e],t)}function BI(e,t={}){return O({},Wo(e,t))}function Js(e,t={}){return b("Evaluate",[e],t)}function Ct(e,t={}){return O({},Js(e,t))}function ep(e,t={}){return b("Module",[e],t)}function qI(e,t={}){return O({},ep(e,t))}function HI(...e){let[t,r,o]=te.Match(e,{2:(m,u)=>a.IsString(m)?[{},m,u]:[m,u,{}],3:(m,u,l)=>[m,u,l],1:m=>[{},m,{}]}),i=wg(r),s=a.IsArray(i)&&a.IsEqual(i.length,2)?T(t,{callstack:[]},i[0]):z();return f.Update(s,{},o)}var n={};It(n,{Any:()=>bn,Array:()=>Ot,AsyncIterator:()=>Nt,Awaited:()=>BI,Base:()=>ca,BigInt:()=>Co,Boolean:()=>da,Call:()=>Ky,Capitalize:()=>Xy,Codec:()=>ua,Conditional:()=>aE,Constructor:()=>lr,ConstructorParameters:()=>pE,Cyclic:()=>kt,Decode:()=>xl,DecodeBuilder:()=>Ro,Encode:()=>Sl,EncodeBuilder:()=>bo,Enum:()=>ul,Evaluate:()=>Ct,Exclude:()=>cE,Extends:()=>ze,ExtendsResult:()=>k,Extract:()=>dE,Function:()=>dr,Generic:()=>fr,Identifier:()=>Po,Immutable:()=>ur,Index:()=>CE,Infer:()=>Oo,InstanceType:()=>wE,Instantiate:()=>O,Integer:()=>Kr,Interface:()=>Ly,Intersect:()=>gt,IsAny:()=>Qe,IsArray:()=>Z,IsAsyncIterator:()=>Ye,IsBase:()=>ft,IsBigInt:()=>st,IsBoolean:()=>Xe,IsCall:()=>Kn,IsCodec:()=>Hr,IsConstructor:()=>Pe,IsCyclic:()=>ae,IsEnum:()=>Te,IsFunction:()=>Ue,IsGeneric:()=>On,IsIdentifier:()=>Rl,IsImmutable:()=>Br,IsInfer:()=>Ie,IsInteger:()=>Me,IsIntersect:()=>P,IsIterator:()=>Ve,IsKind:()=>_,IsLiteral:()=>Y,IsNever:()=>Vt,IsNull:()=>Mt,IsNumber:()=>le,IsObject:()=>M,IsOptional:()=>Ce,IsParameter:()=>Ml,IsPromise:()=>qe,IsReadonly:()=>qr,IsRecord:()=>de,IsRef:()=>oe,IsRefine:()=>la,IsRest:()=>Ir,IsSchema:()=>x,IsString:()=>xe,IsSymbol:()=>wt,IsTemplateLiteral:()=>he,IsThis:()=>Dl,IsTuple:()=>H,IsUndefined:()=>Gt,IsUnion:()=>A,IsUnknown:()=>nt,IsUnsafe:()=>Fl,IsVoid:()=>mt,Iterator:()=>Lt,KeyOf:()=>GE,Literal:()=>q,Lowercase:()=>Jy,Mapped:()=>YE,Module:()=>qI,Never:()=>z,NonNullable:()=>QE,Null:()=>Er,Number:()=>yt,Object:()=>N,Omit:()=>XE,Optional:()=>aa,Options:()=>qa,Parameter:()=>zr,Parameters:()=>tI,Partial:()=>nI,Pick:()=>mI,Promise:()=>$t,Readonly:()=>pa,ReadonlyType:()=>uI,Record:()=>Ta,RecordKey:()=>Ln,RecordKeyAsPattern:()=>pt,RecordValue:()=>He,Ref:()=>Ae,Refine:()=>Ol,Required:()=>wI,Rest:()=>Yr,ReturnType:()=>DI,Script:()=>HI,String:()=>ot,Symbol:()=>Un,TemplateLiteral:()=>Gg,This:()=>ha,Tuple:()=>we,Uncapitalize:()=>eE,Undefined:()=>Mn,Union:()=>G,Unknown:()=>Fe,Unsafe:()=>jl,Uppercase:()=>tE,Void:()=>_a});var Cp=["CLUSTER_DB_QUERY_INVALID_CONNECTION_PARAMS","CLUSTER_DB_QUERY_INVALID_CREDENTIALS","CLUSTER_DB_QUERY_PERMISSION_DENIED","CLUSTER_DB_QUERY_QUERY_SYNTAX_ERROR","CLUSTER_DB_QUERY_DATABASE_UNREACHABLE","CLUSTER_DB_QUERY_CONNECTION_FAILED","CLUSTER_DB_QUERY_QUERY_EXECUTION_FAILED","CLUSTER_DB_QUERY_QUERY_TIMEOUT"],dse=n.Enum(Cp),hk=["CLUSTER_AGGREGATION_STRUCTURE"],fse=n.Object({code:n.Enum(Cp),message:n.String()}),KI=[...Cp,...hk,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","ORG_NOT_FOUND_AUTHENTICATION_ERROR","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],zI=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var _k=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],Ak=[...KI,...zI,..._k],gse=n.Object({code:n.Optional(n.Enum(Ak,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),yse=n.Object({code:n.Optional(n.Enum(KI,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),Ese=n.Object({code:n.Optional(n.Enum(zI,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),Ise=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),Tse=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});var YI="lowercase-email",Pp="iana-timezone",Up="simple-time",Np="simple-date-time";var xk=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),Sk=/[a-zA-Z0-9-_]+/,Ok=/\./,_se=xk(Sk,Ok);var VI="lowercase-domain";var Ha="kebab-case";var WI="camel-case";var bk=new Set;function U(e,t,r={}){let o=t.map(i=>{let s=i;return s.$id?(bk.add(i),n.Ref(s.$id)):i});return n.Unsafe({...r,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}var Se={limit:n.Optional(n.Integer({minimum:1,maximum:1e3,description:"The maximum number of items to return"})),offset:n.Optional(n.Integer({minimum:0,description:"The offset of the first item to return"}))},Rk=n.Object({totalCount:n.Integer({minimum:0,description:"The total number of items matching the query"}),pageCount:n.Integer({minimum:0,description:"The total number of pages available"})}),bse=n.Object({pagination:Rk},{$id:"ResponseMetadata"});function h(e={}){return n.Unsafe({...e,type:"string",format:"date-time"})}function c({allowEmpty:e=!0,type:t="short",description:r}={}){let o=e?0:1;switch(t){case"camel-case":return n.String({format:WI,minLength:o,maxLength:250,description:r});case"kebab-case":return n.String({format:Ha,minLength:o,maxLength:250,description:r});case"email":return n.String({format:YI,minLength:o,maxLength:254,description:r,errorMessage:{format:"Must be a valid lowercase email address."}});case"lowercase-domain":return n.String({format:VI,minLength:o,maxLength:250,description:r});case"tsuga-query":return n.String({format:"tsuga-query",minLength:o,maxLength:1e4,description:r});case"tags-query":return n.String({format:"tags-query",minLength:o,maxLength:1e4,description:r,errorMessage:{format:"Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported. The query you provided is invalid: ${0}"}});case"date-time":return n.String({format:"date-time",description:r});case"uri":return n.String({format:"uri",description:r});case"user-password":return n.String({format:"user-password",minLength:12,maxLength:250,description:r});case"long":return n.String({minLength:o,maxLength:5e4,description:r});case"short":return n.String({minLength:o,maxLength:250,description:r});case"tsuga-formula":return n.String({format:"tsuga-formula",minLength:o,maxLength:250,description:r,errorMessage:{format:"Must be a simple mathematical formula, and all variables in it should refer to queries (q1, q2, etc.). The formula you provided is invalid: ${0}"}});case"time":return n.String({format:"time",description:r});case"readonly-sql-query":return n.String({format:"readonly-sql-query",minLength:o,maxLength:5e4,description:r,errorMessage:{format:"Must be a readonly SQL query (only SELECT statements are allowed). The SQL query you provided is not a readonly SQL query: ${0}."}});default:Yt(t)}}function d({body:e,description:t,method:r,operationId:o,params:i,tags:s,query:m,paginated:u,response:l,url:g}){return i?{body:e,buildUrl:I=>g.replace(/:[a-zA-Z_]+/g,C=>I[C.slice(1)]),description:t,method:r,operationId:o,params:i,query:m,paginated:u,response:l,tags:s,templateUrl:g}:{body:e,description:t,method:r,operationId:o,query:m,paginated:u,response:l,tags:s,url:g,templateUrl:g}}function QI(e,t){if(!t||typeof t!="object")return e;let r=new URLSearchParams;return Object.entries(t).forEach(([o,i])=>{Array.isArray(i)?i.length>0&&i.forEach(s=>{s!==void 0&&(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&r.append(o,String(s))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&r.append(o,String(i))}),`${e}?${r.toString()}`}var Ck="x-tsuga-session-id",kp="x-tsuga-source",Lp="x-tsuga-source-version",Mp="x-tsuga-source-commit",wp="x-tsuga-source-date",Pk="x-request-id",$se={[Ck]:"Session identifier for request correlation",[kp]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[Lp]:"SDK version",[Mp]:"SDK commit hash",[wp]:"SDK commit date",[Pk]:"Unique identifier for this API request, useful for debugging and support"};var Xr=class e extends Error{constructor(r,o,i,s){super(r);this.statusCode=o;this.code=i;this.requestId=s;this.name="CliError"}static fromErrorResponse(r,o){return new e(r.message,r.statusCode,r.code,o)}};function ZI(e){if(e instanceof Xr){let t=[`Error: ${e.message}`];return e.code&&t.push(`Code: ${e.code}`),e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),t.join(`
34
- `)}return e instanceof Error?`Error: ${e.message}`:String(e)}function XI(e,t,r){return async function(i,s={}){let{body:m,params:u,query:l}=s,g;if(i.url!==void 0)g=i.url;else if(i.buildUrl){if(!u)throw new Xr("Internal error: params required for this endpoint");g=i.buildUrl(u)}else throw new Xr("Internal error: endpoint has neither url nor buildUrl");let E=r===void 0?l:{clusterId:r,...l},I=QI(`${e}${g}`,E),C={Accept:"application/json",Authorization:`Bearer ${t}`,[kp]:"cli",[Lp]:"1.0.9",[Mp]:"c15f0dc",[wp]:"2026-05-15T09:03:17.572Z"};m&&(C["Content-Type"]="application/json");let je=await(await fetch(I,{method:i.method,headers:C,body:m?JSON.stringify(m):void 0})).json();if(je.error)throw Xr.fromErrorResponse(je.error,je.requestId);return je.data}}var v=n.Object({success:n.Literal(!0,{description:"Indicates the resource was deleted successfully"})},{$id:"DeleteResponse",example:{success:!0}});var Uk=["asset-change","cluster-integration-config","explorer-saved-view","crawler-integration-config","inventory","saml-config","sensitive-data-scanner-rule","service","team-remap-config","user-data","user-self","monitor-alert","monitor-debugging","retention-policy","org","allowed-domains","custom-usage-tag"],Nk=["ingestion-api-key","operation-api-key","audit-log","dashboard","dashboard-report","inventory-settings","log-route","monitor","notification-integration","notification-rule","notification-silence","quality-report","slo","tag-policy","team","team-members","user-invitation","user-permissions"],kk=["log","metric","trace"],Lk=[...Nk,...kk],Wse=[...Uk,...Lk];var za=["admin","public_editor","public_viewer","teams_only"],Qn=["admin","editor","viewer"];var Jr="/v0/team-membership",$p=n.Object({id:n.String(),userId:n.String(),teamId:n.String(),roleKey:n.Enum(Qn)}),JI=n.Object({userId:c({allowEmpty:!1}),teamId:c({allowEmpty:!1}),roleKey:n.Enum(Qn)}),Mk=n.Object({userId:c({allowEmpty:!1}),teamId:c({allowEmpty:!1})}),wk=n.Optional(n.Object({userId:n.Optional(c({allowEmpty:!1})),teamId:n.Optional(c({allowEmpty:!1}))})),Qse=d({tags:["access-control"],url:Jr,method:"GET",query:wk,response:n.Array($p)}),Zse=d({tags:["access-control"],url:Jr,method:"POST",body:JI,response:$p}),Xse=d({tags:["access-control"],url:Jr,method:"PUT",body:JI,response:$p}),Jse=d({tags:["access-control"],url:Jr,method:"DELETE",body:Mk,response:v}),Ka=500,$k=n.Object({teamId:c({allowEmpty:!1}),members:n.Array(n.Object({userId:n.Optional(c({allowEmpty:!1})),userEmail:n.Optional(c({allowEmpty:!1,type:"email"})),roleKey:n.Enum(Qn)},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:Ka})}),Dk=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["added","already_member","user_not_found"])}))}),epe=d({tags:["access-control"],url:`${Jr}/bulk-add`,method:"POST",body:$k,response:Dk}),tpe=d({tags:["access-control"],url:`${Jr}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(c({allowEmpty:!1}),{minItems:1,maxItems:Ka}),teamId:c({allowEmpty:!1}),role:n.Enum(Qn)}),response:n.Object({})}),Gk=n.Object({teamId:c({allowEmpty:!1}),userIds:n.Optional(n.Array(c({allowEmpty:!1}),{minItems:1,maxItems:Ka})),userEmails:n.Optional(n.Array(c({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:Ka}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}]}),vk=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["removed","not_member","user_not_found"])}))}),rpe=d({tags:["access-control"],url:`${Jr}/bulk-remove`,method:"DELETE",body:Gk,response:vk});var Ya="/v0/admin",$e=`${Ya}/clusters`,tT=n.Object({helmParameters:n.Record(n.String(),n.String()),helmVersion:n.String()}),eT=n.Record(n.String(),tT),vp=["eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3","us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-1","ap-southeast-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ap-southeast-7","ca-central-1","ca-west-1","il-central-1","me-central-1","me-south-1","mx-central-1","sa-east-1"],jp=["europe-west1","europe-west2","europe-west3","europe-west4","europe-west6","europe-west9","europe-central2","europe-north1","us-central1","us-east1","us-east4","us-west1","us-west2","us-west3","us-west4","northamerica-northeast1","southamerica-east1","asia-east1","asia-east2","asia-northeast1","asia-northeast2","asia-northeast3","asia-south1","asia-south2","asia-southeast1","asia-southeast2","australia-southeast1","australia-southeast2"],Fp=["australiacentral","australiacentral2","australiaeast","australiasoutheast","austriaeast","belgiumcentral","brazilsouth","brazilsoutheast","canadacentral","canadaeast","centralindia","centralus","chilecentral","eastasia","eastus","eastus2","francecentral","francesouth","germanynorth","germanywestcentral","indonesiacentral","israelcentral","italynorth","japaneast","japanwest","jioindiacentral","jioindiawest","koreacentral","koreasouth","malaysiawest","mexicocentral","newzealandnorth","northcentralus","northeurope","norwayeast","norwaywest","polandcentral","qatarcentral","southafricanorth","southafricawest","southcentralus","southeastasia","southindia","spaincentral","swedencentral","switzerlandnorth","switzerlandwest","uaecentral","uaenorth","uksouth","ukwest","westcentralus","westeurope","westindia","westus","westus2","westus3"],rT=["aws","gcp","azure"],si=["xs","s","m","l"],Bp=["1.0"],jk={id:n.String(),name:n.String(),createdAt:h(),clusterCertificateExpiresAt:h(),bridgeEndpoint:n.String(),deployerEndpoint:n.String(),targetConfiguration:eT,appliedConfiguration:n.Optional(eT),automaticallyDeployLatestVersion:n.Boolean(),automatedDeploymentDisabledBy:n.Optional(n.String()),automatedDeploymentDisabledReason:n.Optional(n.String()),automatedDeploymentDisabledAt:n.Optional(h()),soakTimeMin:n.Optional(n.Number()),clusterSize:n.Optional(n.Enum(si))},Dp={...jk,orgId:n.String(),orgName:n.String()},mpe=d({tags:["admin"],method:"GET",url:$e,query:n.Object({orgId:n.Optional(c())}),response:n.Array(U("clusterType",[n.Object({...Dp,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(Bp)),clusterRegion:n.Enum(vp)}),n.Object({...Dp,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(jp)}),n.Object({...Dp,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(Fp)})]))}),cpe=d({tags:["admin"],method:"PUT",url:`${$e}/create`,body:U("clusterType",[n.Object({clusterType:n.Literal("aws"),orgId:c(),name:c(),clusterSize:n.Enum(si),clusterAccountId:n.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:n.Enum(Bp),clusterRegion:n.Enum(vp)}),n.Object({clusterType:n.Literal("gcp"),orgId:c(),name:c(),clusterSize:n.Enum(si),clusterAccountId:c(),clusterRegion:n.Enum(jp)}),n.Object({clusterType:n.Literal("azure"),orgId:c(),name:c(),clusterSize:n.Enum(si),clusterTenantId:c(),clusterSubscriptionId:c(),clusterRegion:n.Enum(Fp)})]),response:n.Object({id:n.String(),bridgeEndpoint:n.String(),deployerEndpoint:n.String()})}),upe=d({tags:["admin"],method:"DELETE",url:`${$e}/:id`,params:n.Object({id:c()}),body:n.Object({orgId:c()}),response:v}),lpe=d({tags:["admin"],method:"PUT",url:`${$e}/add-inbounder-key`,body:n.Object({orgId:c(),clusterId:c()}),response:n.Object({orgId:c(),clusterId:c(),inbounderAuthenticationKey:n.String()})}),dpe=d({tags:["admin"],method:"PUT",url:`${$e}/replace-all-inbounder-keys`,body:n.Object({orgId:c(),clusterId:c()}),response:n.Object({orgId:c(),clusterId:c(),inbounderAuthenticationKey:n.String()})}),fpe=d({tags:["admin"],method:"PUT",url:`${$e}/replace-inbounder-key`,body:n.Object({orgId:c(),clusterId:c(),inbounderAuthenticationKeyToReplace:c()}),response:n.Object({orgId:c(),clusterId:c(),inbounderAuthenticationKey:n.String()})}),gpe=d({tags:["admin"],method:"PUT",url:`${$e}/delete-inbounder-key`,body:n.Object({orgId:c(),clusterId:c(),inbounderAuthenticationKeyToDelete:c()}),response:n.Object({orgId:c(),clusterId:c(),isKeyDeleted:n.Boolean()})}),ype=d({tags:["admin"],method:"PUT",url:`${$e}/rotate-deployer-key`,body:n.Object({orgId:c(),clusterId:c(),newKey:c()}),response:n.Object({orgId:c(),clusterId:c(),isKeyUpdated:n.Boolean()})}),Epe=d({tags:["admin"],method:"PUT",url:`${$e}/rotate-bridge-key`,body:n.Object({orgId:c(),clusterId:c(),newKey:c()}),response:n.Object({orgId:c(),clusterId:c(),isKeyUpdated:n.Boolean()})}),Gp={central:n.String(),ngrokBridgeDomain:n.String(),ngrokDeployerDomain:n.String(),clusterCertificateExpiresAt:h(),clusterName:n.String(),clusterSize:n.Optional(n.Enum(si)),secretBridgeAuthenticationKey:n.String(),secretDeployerAuthenticationKey:n.String(),secretOutbounderAuthenticationKey:n.String(),secretMonitoringApiKey:n.String(),slackChannelEmail:n.String()},Ipe=d({tags:["admin"],method:"POST",url:`${$e}/:id`,body:n.Object({orgId:c()}),params:n.Object({id:c()}),response:U("clusterType",[n.Object({...Gp,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(Bp)),clusterRegion:n.Enum(vp)}),n.Object({...Gp,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(jp)}),n.Object({...Gp,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(Fp)})])}),Tpe=d({tags:["admin"],method:"POST",url:`${$e}/configuration`,body:n.Object({id:c(),orgId:c(),installationName:c(),targetConfiguration:tT}),response:n.Object({status:n.String()})}),hpe=d({tags:["admin"],method:"POST",url:`${$e}/automation`,body:n.Object({id:c(),orgId:c(),enableAutomatedDeployment:n.Boolean(),disabledReason:n.Optional(c())}),response:n.Object({status:n.String()})}),_pe=d({tags:["admin"],method:"POST",url:`${$e}/soak-time`,body:n.Object({id:c(),orgId:c(),soakTimeMin:n.Optional(n.Number())}),response:n.Object({status:n.String()})}),Ape=d({tags:["admin"],method:"POST",url:`${$e}/deploy`,body:n.Object({orgId:c(),clusterId:c(),chartName:c(),toVersion:c()}),response:n.Object({id:n.String()})}),Fk=U("type",[n.Object({type:n.Literal("pending")}),n.Object({type:n.Literal("running")}),n.Object({type:n.Literal("cancelled")}),n.Object({type:n.Literal("timed_out")}),n.Object({type:n.Literal("success"),stateValue:n.Object({message:n.String()})}),n.Object({type:n.Literal("failure"),stateValue:n.Object({message:n.String()})})]),xpe=d({tags:["admin"],method:"GET",url:`${$e}/deploy`,query:n.Object({orgId:n.Optional(c()),clusterId:n.Optional(c())}),response:n.Array(n.Object({id:n.String(),orgId:n.String(),orgName:n.String(),clusterId:n.String(),clusterName:n.String(),fromVersion:n.Optional(n.String()),toVersion:n.String(),state:Fk,updatedAt:h(),createdAt:h(),installationName:n.String(),chartName:n.String(),isAutomated:n.Boolean(),createdBy:n.Optional(n.String()),createdByName:n.Optional(n.String()),createdByEmail:n.Optional(n.String())}))}),Bk=n.Object({installations:n.Array(n.Object({installationName:n.String(),parameters:n.Record(n.String(),n.String()),version:n.Union([n.String(),n.Null()]),resources:n.Array(n.Object({id:n.Object({kind:n.String(),name:n.String()}),status:n.String(),health:n.String(),rawDetails:n.Optional(n.Any()),liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())})),deployedAt:n.Optional(n.String()),syncStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String())}))}),Spe=d({tags:["admin"],method:"POST",url:`${$e}/status`,body:n.Object({orgId:n.Optional(c()),clusterId:n.Optional(c())}),response:n.Array(n.Object({orgId:n.String(),clusterId:n.String(),status:Bk}))}),Ope=d({tags:["admin"],method:"POST",url:`${$e}/argocd-cert-info`,body:n.Object({orgId:c(),clusterId:c()}),response:n.Object({certificateExpiresAt:n.String()})}),qk=n.Object({kind:n.String(),name:n.String()}),Hk=n.Object({id:qk,liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())}),bpe=d({tags:["admin"],method:"POST",url:`${$e}/resource-details`,body:n.Object({orgId:c(),clusterId:c(),installationName:c()}),response:n.Object({resources:n.Array(Hk)})}),Rpe=d({tags:["admin"],method:"GET",url:`${$e}/versions`,query:n.Object({chartName:n.Optional(c())}),response:n.Array(n.Object({id:n.String(),chartName:n.String(),locator:n.String(),version:n.String(),repositoryArn:n.String(),type:n.Optional(n.String()),commitHash:n.Optional(n.String()),lastPulledAt:n.Optional(h()),pushedAt:n.Optional(h())}))}),Kk=n.Object({id:n.Object({name:n.String(),kind:n.String()}),previewManifest:n.Optional(n.String())}),Cpe=d({tags:["admin"],method:"POST",url:`${$e}/versions/render`,body:n.Object({chartName:c(),version:c(),values:c({type:"long"}),installationName:c(),namespace:c()}),response:n.Array(Kk)}),Xt=`${Ya}/orgs`,Ppe=d({tags:["admin"],url:Xt,method:"GET",query:n.Object({onlyDeleted:n.Optional(n.Boolean())}),response:n.Array(n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String()),createdAt:h(),updatedAt:h()}))}),Upe=d({tags:["admin"],url:Xt,method:"POST",body:n.Object({emailDomains:n.Array(c({type:"lowercase-domain"}),{maxItems:20}),name:c()}),response:n.Object({id:n.String(),name:n.String()})}),Npe=d({tags:["admin"],url:`${Xt}/:id`,method:"PUT",params:n.Object({id:c()}),body:n.Object({allowedDomains:n.Optional(n.Array(c({type:"lowercase-domain"}),{maxItems:20}))}),response:n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String())})}),kpe=d({tags:["admin"],url:`${Xt}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),Lpe=d({tags:["admin"],url:`${Xt}/:id/restore`,method:"POST",params:n.Object({id:c()}),response:n.Object({success:n.Boolean()})}),Mpe=d({tags:["admin"],url:`${Xt}/:id/permanent-delete`,method:"DELETE",params:n.Object({id:c()}),response:n.Object({success:n.Boolean(),hasDeletedSecret:n.Boolean(),hasDeletedTenantDb:n.Boolean(),hasDeletedOrgRow:n.Boolean()})}),wpe=d({tags:["admin"],url:`${Xt}/synchronize-sds-rules`,method:"POST",response:n.Object({errorOrgs:n.Optional(n.Array(n.Object({id:n.String(),name:n.String()}))),synchronizedOrgsCount:n.Number()})}),zk=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],Yk=n.Enum(zk),$pe=d({tags:["admin"],url:`${Xt}/refresh-assets`,method:"POST",body:n.Object({assetTypes:n.Array(Yk,{minItems:1}),orgId:n.Optional(c({allowEmpty:!1}))}),response:n.Array(n.Object({orgId:n.String(),orgName:n.String(),results:n.Record(n.String(),n.Object({success:n.Boolean()}))}))}),Dpe=d({tags:["admin"],url:`${Xt}/sudo`,method:"POST",body:n.Object({orgId:c()}),response:n.Object({sudoToken:n.String()})}),Vk=`${Ya}/users`,Gpe=d({tags:["admin"],url:`${Vk}/invite`,method:"POST",body:n.Object({email:c({type:"email"}),orgId:c(),userRole:n.Enum(za)}),response:n.Array(n.Object({inviteId:n.String(),email:n.String(),result:n.Union([n.Literal("success"),n.Literal("email-failed")])}))});var vpe=d({tags:["admin"],url:`${Ya}/billing-data`,method:"GET",query:n.Object({orgId:c(),maxDaysFetched:n.Optional(n.Number({minimum:1,maximum:365}))}),response:n.Object({dataPoints:n.Array(n.Object({date:n.String(),telemetryKind:n.Union([n.Literal("logs"),n.Literal("metrics"),n.Literal("traces")]),totalBytes:n.Number(),clusterId:n.String(),apiKeyId:n.String(),apiKeyName:n.String(),teamName:n.String()})),availableFilters:n.Object({clusters:n.Array(n.Object({id:n.String(),name:n.String()})),apiKeys:n.Array(n.Object({id:n.String(),name:n.String()})),teamNames:n.Array(n.String())})})});var nT=n.Object({id:n.String({description:"Unique identifier of the Tsuga cluster containing your observability data"}),name:n.String({description:"Internal name of the Tsuga cluster"}),friendlyName:n.Optional(n.String({description:"Human-readable display name set by an operator"})),clusterType:n.Enum(rT,{description:"Cloud provider hosting the Tsuga cluster"}),clusterRegion:n.String({description:"Region where the Tsuga cluster is deployed"})},{$id:"Cluster",description:"A Tsuga cluster containing your observability data"}),Wk={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(nT,{examples:[Wk]});var oT=d({description:"Retrieve all clusters",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(nT)});var Jt=require("node:fs"),iT=require("node:os"),qp=require("node:path"),aT=(0,qp.join)((0,iT.homedir)(),".config","tsuga"),Zn=(0,qp.join)(aT,"config.json"),Qk="https://api.tsuga.com";function Pr(){if(!(0,Jt.existsSync)(Zn))return{};try{return JSON.parse((0,Jt.readFileSync)(Zn,"utf-8"))}catch{throw new Error(`Config file corrupted: ${Zn}
35
- Re-run: tsuga auth <token>`)}}function pi(e){(0,Jt.mkdirSync)(aT,{recursive:!0,mode:448}),(0,Jt.writeFileSync)(Zn,`${JSON.stringify(e,null,2)}
36
- `,{mode:384})}function Hp(e){let t=Pr(),r=e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY??t.operationApiKey,o=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||t.clusterId?.trim()||void 0;return{apiUrl:Qk,operationApiKey:r,clusterId:o}}function Kp(e){let t={};try{t=Pr()}catch{}pi({...t,...e})}function sT(){return(0,Jt.existsSync)(Zn)||!!process.env.TSUGA_OPERATION_API_KEY}function zp(){return Zn}var Yp={from:"-30m",to:"now",query:"*","max-results":"100"};function pT(){return Pr().defaults??{}}function er(e){return(Pr().defaults??{})[e]??Yp[e]}function mT(e,t){let r={};try{r=Pr()}catch{}let o={...r.defaults??{},[e]:t};pi({...r,defaults:o})}function cT(){let e={};try{e=Pr()}catch{}let{defaults:t,...r}=e;pi(r)}function Vp(e){let t=e?.trim()||void 0,r={};try{r=Pr()}catch{}if(t===void 0){let{clusterId:o,...i}=r;pi(i)}else pi({...r,clusterId:t})}function uT(){return Pr().lastUpdateCheck}function lT(e){Kp({lastUpdateCheck:e})}function Wp(e){process.stdout.write(`${e}
37
- `)}function ie(e){Wp(JSON.stringify(e,null,2))}var dT=["json","tsv","csv"];function fT(e){let t=dT.find(r=>r===e);if(t!==void 0)return t;throw new Error(`--output must be one of: ${dT.join(", ")} (got: ${e})`)}function gT(e){let t=e.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new Error("--fields must contain at least one field name");return t}function yT(e,t){let r=e;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function ET(e,t){let r=Object.create(null);for(let o of t){let i=yT(e,o);if(i===void 0)continue;let s=o.split("."),m=s.pop();if(m===void 0)continue;let u=r;for(let l of s)(typeof u[l]!="object"||u[l]===null)&&(u[l]=Object.create(null)),u=u[l];u[m]=i}return r}function IT(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var Zk={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function Xk(e){let t=IT(e);return t===null?"":t.replace(/[\\\t\r\n]/g,r=>Zk[r]??r)}function Jk(e){let t=IT(e);return t===null?"":/[,"\n\r]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function TT(e,t,r){if(t.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?Jk:Xk,s=r.map(u=>i(u)).join(o),m=t.map(u=>r.map(l=>i(yT(u,l))).join(o));return[s,...m].join(`
38
- `)}function hT(e,t){let r=e.command("cluster").description("Manage Tsuga cluster selection. A Tsuga cluster contains your observability data.");r.command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await t()(oT);ie(o)}),r.command("use <cluster-id>").description("Set the current Tsuga cluster (saved to ~/.config/tsuga/config.json)").action(o=>{Vp(o),process.stdout.write(`Current Tsuga cluster set to ${o}
39
- `)}),r.command("reset").description("Clear the saved current Tsuga cluster").action(()=>{Vp(void 0),process.stdout.write(`Current Tsuga cluster cleared
40
- `)})}var _T=`/${"v1"}/docs`,AT=n.Object({path:n.String(),title:n.String(),content:n.String({description:"Raw markdown content of the documentation page"})},{$id:"DocPage",description:"A documentation page with its raw markdown content"}),eL={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
41
- ...`};Object.assign(AT,{examples:[eL]});var xT=n.Object({path:n.String(),title:n.String(),score:n.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:n.String({description:"Short snippet of matching content"}),link:n.String({description:"URL to the documentation page in the Tsuga app"})},{$id:"DocSearchResult",description:"A documentation search result"}),tL={path:"getting-started/send-your-first-logs",title:"Send your first logs",score:.9,excerpt:"...send your first logs to Tsuga using the ingestion API...",link:"https://www.app.tsuga.com/documentation/getting-started/send-your-first-logs"};Object.assign(xT,{examples:[tL]});var ST=d({description:"Retrieve the raw markdown content of a documentation page by its path",operationId:"getDocPage",tags:["docs"],url:_T,method:"GET",query:n.Object({path:c({allowEmpty:!1})}),response:AT}),OT=d({description:"Full-text search across documentation pages",operationId:"searchDocs",tags:["docs"],url:`${_T}/search`,method:"GET",query:n.Object({query:c({allowEmpty:!1})}),response:n.Array(xT)});function bT(e,t){let r=e.command("docs").description("Browse and search documentation");r.command("get <path>").description("Get a documentation page by path (e.g. 'getting-started/send-your-first-logs')").action(async o=>{let i=await t()(ST,{query:{path:o}});ie(i)}),r.command("search <query>").description("Search documentation pages").action(async o=>{let i=await t()(OT,{query:{query:o}});ie(i)})}var W="context";var sme=`${W}.team`,pme=`${W}.env`,mme=`${W}.api_key_id`,cme=`${W}.service.name`,ume=`${W}.service.version`,rL=`${W}.host.name`,nL=`${W}.instance`,oL=`${W}.instanceid`,iL=`${W}.instance_name`,lme=`${W}.telemetry.sdk.language`,dme=`${W}.k8s.cluster.name`,fme=`${W}.k8s.cluster.uid`,gme=`${W}.k8s.namespace.name`,yme=`${W}.k8s.pod.name`,Eme=`${W}.k8s.pod.uid`,Ime=`${W}.k8s.container.name`,Tme=`${W}.k8s.node.name`,hme=`${W}.k8s.node.uid`,_me=`${W}.k8s.deployment.name`,Ame=`${W}.k8s.deployment.uid`,xme=`${W}.k8s.replicaset.name`,Sme=`${W}.k8s.replicaset.uid`,Ome=`${W}.k8s.statefulset.name`,bme=`${W}.k8s.statefulset.uid`,Rme=`${W}.k8s.daemonset.name`,Cme=`${W}.k8s.daemonset.uid`,Pme=`${W}.k8s.job.name`,Ume=`${W}.k8s.job.uid`,Nme=`${W}.k8s.cronjob.name`,kme=`${W}.k8s.cronjob.uid`;var Lme={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${W}.tag_policy_id`,dataSource:`${W}.data_source`}};var Mme={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${W}.batch_kind`,batchKindMetricsFilter:`${W}.batch_kind:metrics`,sourceApiKeyId:`${W}.source_api_key_id`,sourceEnv:`${W}.source_env`,sourceTeam:`${W}.source_team`}},aL="__tsuga_metadata__",wme=`${aL}.signature`;var CT=1456444800,PT=4927737600,sL=CT*1e3,pL=PT*1e3,Va=1704067200,Qp=Va*1e3,UT={title:"TimeRange",description:"Time range to query",examples:[{from:Va,to:Va}]},mL={title:"TimeRange",description:"Time range to query",examples:[{from:Qp,to:Qp}]},Wa=e=>n.Integer({description:e,examples:[Va],minimum:CT,maximum:PT,format:"int64"}),RT=e=>n.Integer({description:e,examples:[Qp],minimum:sL,maximum:pL,format:"int64"}),ut=n.Object({from:n.Optional(Wa("Start timestamp in seconds")),to:n.Optional(Wa("End timestamp in seconds"))},UT),ht=n.Object({from:Wa("Start timestamp in seconds"),to:Wa("End timestamp in seconds")},UT),NT=n.Object({from:RT("Start timestamp in milliseconds"),to:RT("End timestamp in milliseconds")},mL);var en="/v0/service-catalog";var kT=n.Object({team:n.String(),lastSeenAt:h()}),cL=n.Object({ingestionApiKey:n.String(),lastSeenAt:h()}),LT=n.Object({version:n.String(),firstSeenAt:h(),lastSeenAt:h(),faulty:n.Optional(n.Boolean())}),uL=n.Object({language:n.String(),lastSeenAt:h()}),Qa=n.Object({id:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(kT),ingestionApiKeys:n.Array(cL),versions:n.Array(LT),languages:n.Array(uL),lastSeenAt:h(),firstSeenAt:h(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),logsCount24h:n.Number(),errorLogsCount24h:n.Number(),tracesCount24h:n.Number(),errorTracesCount24h:n.Number(),createdAt:h(),updatedAt:h()}),Hme=d({tags:["service-catalog"],query:n.Object({...Se,clusterId:n.Optional(c())}),method:"GET",paginated:!0,url:`${en}/services`,response:n.Array(Qa)}),Kme=d({tags:["service-catalog"],method:"GET",url:`${en}/services/:serviceId`,params:n.Object({serviceId:c()}),response:Qa}),lL=n.Object({id:n.String(),endpointName:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(kT),versions:n.Array(LT),lastSeenAt:h(),firstSeenAt:h(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),createdAt:h(),updatedAt:h()}),zme=d({tags:["service-catalog"],method:"GET",url:`${en}/endpoints`,response:n.Array(lL)}),dL=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var MT=n.Object({id:n.String(),hostName:n.String(),env:n.Optional(n.String()),cpuUtilizationAverage:n.Number(),hostType:n.Enum(dL),teams:n.Array(n.String()),tags:n.Array(n.String()),firstSeenAt:h(),lastSeenAt:h(),clusterId:n.String()}),Yme=d({tags:["service-catalog"],method:"GET",url:`${en}/hosts`,response:n.Array(MT)}),Vme=d({tags:["service-catalog"],method:"GET",url:`${en}/hosts/:hostId`,params:n.Object({hostId:c()}),response:MT}),fL=n.Object({serviceName:n.String()}),gL=n.Object({from:n.String(),to:n.String(),count:n.Number()}),Wme=d({tags:["service-catalog"],url:`${en}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:c()}),query:n.Object({...ut.properties,query:n.Optional(c({type:"tsuga-query"}))}),response:n.Object({nodes:n.Array(fL),edges:n.Array(gL)})}),Qme=d({tags:["service-catalog"],method:"GET",url:`${en}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var Zp=`/${"v1"}/services`,Xp=n.Pick(Qa,["id","serviceName","serviceNamespace","env","teams","versions","languages","lastSeenAt","firstSeenAt","sources","logsCount24h","errorLogsCount24h","tracesCount24h","errorTracesCount24h"],{$id:"Service",description:"Observed telemetry service with metadata, activity stats and version signals"}),yL={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!1}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(Xp,{examples:[yL]});var wT=d({description:"Retrieve all services",operationId:"listServices",tags:["services"],url:Zp,method:"GET",paginated:!0,query:n.Object(Se),response:n.Array(Xp)}),$T=d({description:"Retrieve a service by its id",operationId:"getService",tags:["services"],url:`${Zp}/:serviceId`,method:"GET",params:n.Object({serviceId:c({allowEmpty:!1})}),response:Xp}),DT=d({description:"Retrieve the dependency graph for a service, showing which services call each other",operationId:"getServiceGraph",tags:["services"],url:`${Zp}/:serviceId/graph`,method:"GET",params:n.Object({serviceId:c({allowEmpty:!1})}),query:n.Object({...ut.properties,query:n.Optional(c({type:"tsuga-query"}))}),response:n.Object({nodes:n.Array(n.Object({serviceName:n.String()})),edges:n.Array(n.Object({from:n.String(),to:n.String(),count:n.Number()}))})});var ace=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));var yce=60*1e3;var Xce=1/1e6,AL=1e3,xL=60*AL,SL=60*xL,Xa=24*SL,Jce=7*Xa,eue=30*Xa;var em=["past-5-minutes","past-15-minutes","past-30-minutes","past-1-hour","past-2-hours","past-4-hours","past-6-hours","past-12-hours","past-24-hours","past-2-days","past-3-days","past-7-days","past-30-days","past-3-months","current-day","current-week","current-month","current-year","previous-day","previous-week","previous-month","previous-3-months","previous-year"];var OL={s:1,m:60,h:3600,d:86400};function vT(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<48||r>57)return!1}return!0}function jT(){return Math.floor(Date.now()/1e3)}function Ja(e){if(typeof e=="number")return e;if(e==="now")return jT();if(e.startsWith("-")&&e.length>=3){let r=e.at(-1),o=r?OL[r]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&vT(i))return jT()-parseInt(i,10)*o}}if(vT(e)&&e.length>0)return parseInt(e,10);let t=Date.parse(e);if(!Number.isNaN(t))return Math.floor(t/1e3);throw new Error(`Invalid time value: ${e}. Use unix seconds, relative (-30m, -1h), 'now', or ISO 8601.`)}function FT(e,t){let r=t??er(e);return r===void 0?void 0:Ja(r)}function tm(e){let t=er(e);return t===void 0?"":` (default: ${t})`}function BT(e,t){e.command("service-graph").description("Inspect service dependency graphs").command("get <serviceId>").description("Retrieve the dependency graph for a service").option("--from <timestamp>",`Start of time range${tm("from")}`).option("--to <timestamp>",`End of time range${tm("to")}`).option("--query <query>",`Search query${tm("query")}`).action(async(o,i)=>{let s={},m=FT("from",i.from),u=FT("to",i.to);m!==void 0&&(s.from=m),u!==void 0&&(s.to=u),i.query!==void 0&&(s.query=i.query);let l=await t()(DT,{params:{serviceId:o},query:s});ie(l)})}var qT=n.Object({type:n.Literal("number"),number:n.String()}),bL=n.Object({type:n.Literal("string"),string:n.String()}),RL=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),rm=U("type",[qT,bL,RL]),CL=n.Object({by:n.Record(n.String(),rm),computed:n.Record(n.String(),qT)}),PL=n.Object({type:n.Literal("buckets"),buckets:n.Array(CL)}),UL=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),HT=U("type",[PL,UL]);var NL="/v0/aggregation",kL=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),LL=n.Object({parallelism:n.Number(),engine:kL,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),Pt=["logs","metrics","traces"],ML={logs:"Logs",metrics:"Metrics",traces:"Traces"},wL=[...Pt,"connections"],hue={...ML,connections:"Connections"},_ue=n.Enum(wL,{description:"Data source being queried"}),Xn=n.Enum(Pt,{description:"Data source being queried for this aggregation"}),tn=c({description:"Attribute containing the values to aggregate"}),YT=U("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(tn)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:tn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:tn},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:tn},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:tn},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:tn},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:tn,percentile:n.Number()},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate"}),VT=U("type",[n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:c({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"FunctionLog",title:"Log"}),n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"FunctionTimeOffset",title:"TimeOffset"})],{title:"Function"});var KT=n.Object({min:n.Number(),max:n.Number()}),zT=n.Integer({minimum:1}),$L=U("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:c({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(c()),bucketCount:n.Optional(zT),bounds:n.Optional(KT),percentiles:n.Optional(n.Array(n.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:c({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(c()),bucketCount:n.Optional(zT),bounds:n.Optional(KT)},{title:"Heatmap",description:"Returns a distribution per time window"})]),nm=15,DL=["zero","null"],GL=n.Enum(DL),WT=n.Object({mode:n.Object({type:GL})}),vL={aggregate:YT,functions:n.Optional(n.Array(VT,{maxItems:10,description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(WT)},QT={maxItems:nm,description:"Aggregations that may be combined together in the same query"},mi=n.Array(n.Object({...vL,filter:n.Optional(c({type:"tsuga-query",description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),QT),Jn=n.Array(n.Object({aggregate:YT,functions:n.Optional(n.Array(VT,{maxItems:10,description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(WT),filter:c({type:"tsuga-query"})},{title:"MonitorAggregationQuery"}),QT);var ci=c({type:"tsuga-formula",description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),jL=n.Object({fields:n.Array(c(),{maxItems:1}),limit:n.Number()},{title:"AggregationGroupBy"}),FL=7;var eo=n.Array(jL,{maxItems:FL,description:"Fields used to group the results"}),Aue=d({tags:["aggregation"],url:`${NL}/multi-query`,method:"POST",body:n.Object({timeRange:NT,queries:mi,groupBy:n.Optional(eo),returnType:$L,dataSource:Xn,formula:ci,executionOptions:LL,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(c({allowEmpty:!1}))}),response:HT}),BL=["per-second","per-minute","per-hour","rate"],rn=n.Enum(BL),xue=U("type",[n.Object({type:n.Literal("count"),count:n.Object({field:n.Optional(c()),timeNormalization:n.Optional(rn)})}),n.Object({type:n.Literal("average"),average:n.Object({field:c(),timeNormalization:n.Optional(rn)})}),n.Object({type:n.Literal("min"),min:n.Object({field:c(),timeNormalization:n.Optional(rn)})}),n.Object({type:n.Literal("max"),max:n.Object({field:c(),timeNormalization:n.Optional(rn)})}),n.Object({type:n.Literal("sum"),sum:n.Object({field:c(),timeNormalization:n.Optional(rn)})}),n.Object({type:n.Literal("percentile"),percentile:n.Object({field:c(),percentile:n.Number(),timeNormalization:n.Optional(rn)})}),n.Object({type:n.Literal("uniqueCount"),uniqueCount:n.Object({field:c(),timeNormalization:n.Optional(rn)})})]),qL=n.Object({type:n.Literal("time"),time:n.Object({interval:c()})}),HL=n.Object({type:n.Literal("histogram"),histogram:n.Object({field:c(),interval:n.Number(),bounds:n.Optional(n.Object({min:n.Number(),max:n.Number()}))})}),KL=n.Object({type:n.Literal("topList"),topList:n.Object({field:c(),size:n.Number(),orderBy:n.Optional(n.Object({computeRef:c(),order:n.Union([n.Literal("asc"),n.Literal("desc")])}))})}),Sue=U("type",[qL,HL,KL]);var om=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],im=["light","dark"];var zL={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},ZT=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var bue=zL.light.red.background;var YL="^\\S(.*\\S)?$",VL=128,WL=256,QL=n.Object({key:n.String({maxLength:VL}),value:n.String({maxLength:WL,pattern:YL})},{title:"Tag"}),to=n.Array(QL,{title:"Tags",maxItems:50,description:"List of key/value tags applied to the resource"}),ye=n.Optional(to);var Ur="/v0/teams",ts=["public","private"],es={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},ZL=n.Enum([es.NAME,es.CREATED_AT,es.MEMBER_COUNT,es.VISIBILITY]),XT=n.Object({color:n.Enum(om),mode:n.Enum(im),iconName:n.Enum(ZT)}),am=n.Object({color:n.Enum(om),mode:n.Enum(im)}),XL=100,JL=250,ro=n.Object({id:n.String({description:"Identifier of the team"}),name:n.String({description:"Human readable team name displayed throughout the app"}),description:n.Optional(n.String()),visibility:n.Enum(ts,{description:"Controls whether the resources of the team are discoverable by users"}),tags:ye,createdAt:h(),updatedAt:h(),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),avatar:n.Optional(XT)}),rs=n.Object({name:n.String({minLength:1,maxLength:XL,description:"Name to assign to the team"}),description:n.Optional(n.String({maxLength:JL})),visibility:n.Enum(ts,{description:"Controls whether the resources of the team are discoverable by users"}),tags:ye,avatar:n.Optional(XT)}),e0=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum(Qn),joinedTeamAt:h(),orgRole:n.Enum(za),avatar:n.Optional(am)}),Due=d({tags:["teams"],url:Ur,method:"GET",paginated:!0,response:n.Array(ro),query:n.Object({...Se,includeMemberCount:n.Optional(n.Boolean()),searchQuery:n.Optional(c()),visibility:n.Optional(n.Enum(ts)),myTeamsOnly:n.Optional(n.Boolean()),sortBy:n.Optional(ZL),sortDirection:n.Optional(n.Enum(["asc","desc"]))})}),Gue=d({tags:["teams"],url:`${Ur}/:id`,method:"GET",params:n.Object({id:c()}),response:ro}),vue=d({tags:["teams"],url:`${Ur}/:id/members`,method:"GET",params:n.Object({id:c()}),response:n.Array(e0)}),jue=d({tags:["teams"],url:`${Ur}/:id/assets`,method:"GET",params:n.Object({id:c()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number()})}),Fue=d({tags:["teams"],url:Ur,method:"POST",body:rs,response:ro}),Bue=d({tags:["teams"],url:`${Ur}/:id`,method:"PUT",params:n.Object({id:c()}),body:rs,response:ro}),que=d({tags:["teams"],url:`${Ur}/bulk-update`,method:"POST",body:n.Object({teamIds:n.Array(c(),{maxItems:100}),config:n.Object({visibility:n.Enum(ts)})}),response:n.Object({})}),Hue=d({tags:["teams"],url:`${Ur}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v});var t0=n.Enum(["terraform-provider","web-frontend","mcp-server","cli"]),Oe=U("type",[n.Object({type:n.Literal("user"),id:n.String(),name:n.String(),avatar:n.Optional(am)}),n.Object({type:n.Literal("operation-api-key"),id:n.String(),name:n.String(),source:n.Optional(t0)})]);var Nr="/v0/dashboards",r0=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],n0=["timeseries","timeseries-connection","top-list","pie","query-value","bar","list","table"],ole=[...n0,"note"],o0=["ns","us","ms","s","m","h","days"];var i0=["B","KB","MB","GB","TB","PB"];var nn=U("type",[n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(o0,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:n.Enum(i0,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),n.Object({type:n.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"})],{title:"Normalizer"}),a0=n.Object({attribute:n.String({description:"Attribute displayed as a column in the log list"}),normalizer:n.Optional(nn)},{title:"WidgetListColumn"}),s0=["background","no-background"],p0=["table","legend-only","no-legend"];var m0=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],nh=["alert","warning","success"],JT=n.Object({operator:n.Enum(m0,{description:"Comparator used to evaluate the metric value"}),value:n.Number({description:"Threshold value used when evaluating the operator"}),color:n.Enum(nh,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),c0=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(nh,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),u0=["sec","min","hour","day"],eh=n.Object({time:n.Number({description:"Number of units that make up each bar bucket"}),metric:n.Enum(u0,{description:"Unit used to measure the bucket width"})});var th=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),l0=n.Object({formula:n.Optional(c({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),c({type:"short",description:"Optional alias for a query (only used for display in the UI)"})))}),mm={source:Xn,queries:mi,formula:n.Optional(ci),aliases:n.Optional(l0),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},ns={...mm,groupBy:n.Optional(eo)},ui=n.Enum(p0,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),no=n.Optional(n.Number({description:"Number of decimal places to display in the value"})),sm=n.Optional(n.Array(c0,{description:"Threshold markers displayed on the chart"})),d0=n.Object({name:c({description:"Display name of the table column"}),...mm,source:Xn,normalizer:n.Optional(nn),precision:no},{title:"TableColumn"}),f0=n.Array(n.Object({id:c({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),g0=n.Object({type:n.Literal("list",{description:"Displays matching logs or database rows in a tabular list"}),source:n.Union([n.Literal("logs",{description:"Indicates that the widget queries logs"}),n.Literal("connections",{description:"Indicates that the widget queries connections like PostgreSQL, BigQuery, etc."})]),query:c({type:"long",description:"Query that selects logs or database rows for the list"}),listColumns:n.Optional(n.Array(a0,{description:"Custom columns to display for each log or database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"}))),connectionId:n.Optional(c({description:"Identifier of the connection to query"}))}),y0=n.Unsafe({...g0,$id:"GraphVisualizationList",title:"List"}),rh=U("type",[n.Object({type:n.Literal("auto")}),n.Object({type:n.Literal("number"),value:n.Number()})]),pm=n.Object({min:rh,max:rh,scale:U("type",[n.Object({type:n.Literal("pow"),exponent:n.Number({minimum:0})}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()});var E0=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:c({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(c({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(ui),thresholds:sm,yAxisSettings:n.Optional(pm)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),I0=U("type",[E0,n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...ns,timeBucket:n.Optional(eh),normalizer:n.Optional(nn),precision:no,legendMode:n.Optional(ui),thresholds:sm,yAxisSettings:n.Optional(pm)},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...ns,normalizer:n.Optional(nn),precision:no,conditions:n.Optional(n.Array(JT,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...ns,normalizer:n.Optional(nn),precision:no,legendMode:n.Optional(ui)},{$id:"GraphVisualizationPie",title:"Pie"}),n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...mm,backgroundMode:n.Optional(n.Enum(s0,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(JT,{description:"Conditional formatting rules applied to the displayed value"})),precision:no,normalizer:n.Optional(nn),legendMode:n.Optional(ui)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...ns,timeBucket:n.Optional(eh),precision:no,normalizer:n.Optional(nn),thresholds:sm,legendMode:n.Optional(ui),yAxisSettings:n.Optional(pm)},{$id:"GraphVisualizationBar",title:"Bar"}),n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(d0,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(eo),defaultSorting:n.Optional(f0)},{$id:"GraphVisualizationTable",title:"Table"}),y0,n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(c({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(r0,{description:"Background color used to render the note"})),noteAlign:n.Optional(th),noteJustifyContent:n.Optional(th)},{$id:"GraphVisualizationNote",title:"Note"})]),on=n.Object({id:c({description:"Identifier of the graph widget"}),name:n.Optional(c({description:"Display name of the graph widget"})),description:n.Optional(n.String({minLength:1,maxLength:800,description:"Description of the graph widget"})),visualization:I0,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),T0=10,oh=n.Array(n.Object({key:c({description:"Filter key"}),values:n.Array(c({description:"Filter value"}))}),{maxItems:T0,description:"Filters applied to every widget on the dashboard"}),oo=n.Object({id:n.String({description:"Identifier of the dashboard"}),name:n.String({description:"Display name of the dashboard"}),owner:n.String({description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(on,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(oh),createdAt:h(),updatedAt:h(),creator:n.Optional(Oe),updater:n.Optional(Oe),tags:ye,timePreset:n.Optional(n.Enum(em))}),os=n.Object({name:c({description:"Display name of the dashboard"}),owner:c({allowEmpty:!1,description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(on,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(oh),tags:ye,timePreset:n.Optional(n.Enum(em))}),cm=n.Object({...Se,owners:n.Optional(n.Array(c({allowEmpty:!1}),{description:"Filter by owner team IDs"}))}),ile=d({tags:["dashboards"],url:Nr,method:"GET",query:cm,paginated:!0,response:n.Array(oo)}),ale=d({tags:["dashboards"],url:`${Nr}/:id`,method:"GET",params:n.Object({id:c()}),response:oo}),sle=d({tags:["dashboards"],url:Nr,method:"POST",body:os,response:oo}),ple=d({tags:["dashboards"],url:`${Nr}/:id`,method:"PUT",params:n.Object({id:c()}),body:n.Partial(os),response:oo}),mle=d({tags:["dashboards"],url:`${Nr}/bulk-update`,method:"PUT",body:n.Object({dashboardIds:n.Array(c()),owner:c({allowEmpty:!1})}),response:n.Object({})}),cle=d({tags:["dashboards"],url:`${Nr}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),ule=d({tags:["dashboards"],url:`${Nr}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:c({allowEmpty:!1}),graphId:c({allowEmpty:!1})}),body:n.Omit(on,["id"]),response:on}),lle=d({tags:["dashboards"],url:`${Nr}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(c())}),response:n.Object({})});var io=`/${"v1"}/dashboards`,li=n.Pick(oo,["id","name","owner","graphs","filters","tags","timePreset"],{$id:"Dashboard",description:"Visualization of telemetry data with customizable graphs and filters"}),h0={id:"123-456-abc",name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(li,{examples:[h0]});var _0=n.Pick(cm,["limit","offset","owners"]),ih=d({description:"Retrieve all dashboards",operationId:"listDashboards",tags:["dashboards"],url:io,method:"GET",paginated:!0,query:_0,response:n.Array(li)}),ah=d({description:"Retrieve a dashboard by its id",operationId:"getDashboard",tags:["dashboards"],url:`${io}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:li}),um=n.Pick(os,["name","owner","graphs","filters","tags","timePreset"]),A0={name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(um,{examples:[A0]});var sh=d({description:"Create a new dashboard",operationId:"createDashboard",tags:["dashboards"],url:io,method:"POST",body:um,response:li}),ph=d({description:"Update a dashboard by its id",operationId:"updateDashboard",tags:["dashboards"],url:`${io}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:n.Partial(um),response:li}),x0=n.Object({id:c({allowEmpty:!1,description:"The dashboard ID to delete"})}),mh=d({description:"Delete a dashboard by its id",operationId:"deleteDashboard",tags:["dashboards"],url:`${io}/:id`,method:"DELETE",params:x0,response:v}),hle=d({description:"Update a single graph within a dashboard by ID.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${io}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:c({allowEmpty:!1,description:"The dashboard ID containing the graph"}),graphId:c({allowEmpty:!1,description:"The graph ID to update"})}),body:n.Omit(on,["id"]),response:on});var S0=100,O0=3,ao=n.Object({id:n.String(),name:n.String(),keyLastCharacters:n.String(),owner:n.String(),tags:to,teamOverrideFields:n.Optional(n.Array(n.String())),updatedAt:h(),createdAt:h(),creator:n.Optional(Oe),updater:n.Optional(Oe),assetUpdatedAt:h()}),di=n.Object({name:n.String({format:Ha,minLength:1,maxLength:S0}),owner:c({allowEmpty:!1}),tags:to,teamOverrideFields:n.Optional(n.Array(c({allowEmpty:!1}),{minItems:1,maxItems:O0}))}),fi="/v0/ingestion-api-keys",Ple=d({tags:["ingestion-api-keys"],url:fi,method:"POST",body:di,response:n.Intersect([ao,n.Object({key:n.String()})])}),Ule=d({tags:["ingestion-api-keys"],url:fi,method:"GET",response:n.Array(ao)}),Nle=d({tags:["ingestion-api-keys"],url:`${fi}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:ao}),kle=d({tags:["ingestion-api-keys"],url:`${fi}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:di,response:ao}),Lle=d({tags:["ingestion-api-keys"],url:`${fi}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});var gi=`/${"v1"}/ingestion-api-keys`,yi=n.Pick(ao,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga"}),ch={id:"123-456-abc",name:"Production Logs Ingestion",keyLastCharacters:"x7Qm",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(yi,{examples:[ch]});var uh=n.Pick(di,["name","owner","tags","teamOverrideFields"],{$id:"CreateIngestionApiKeyRequest"}),lh=n.Pick(di,["name","owner","tags","teamOverrideFields"],{$id:"UpdateIngestionApiKeyRequest"}),dh={name:"Production Logs Ingestion",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(uh,{examples:[dh]});Object.assign(lh,{examples:[dh]});var b0={...ch,key:"tsuga_in:v1:abc123xyx7Qm"},fh=d({description:"Retrieve all ingestion API keys",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:gi,method:"GET",response:n.Array(yi)}),Fle=d({description:"Retrieve an ingestion API key by its id",operationId:"getIngestionApiKey",tags:["ingestion-api-keys"],url:`${gi}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:yi}),R0=n.Intersect([n.Pick(yi,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),n.Object({key:n.String({description:"The full API key value, returned only at creation time"})})],{title:"IngestionApiKeyCreated",example:b0}),gh=d({description:"Create a new ingestion API key",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:gi,method:"POST",body:uh,response:R0}),yh=d({description:"Update an ingestion API key by its id",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${gi}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:lh,response:yi}),Eh=d({description:"Delete an ingestion API key by its id",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${gi}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});var C0={application:{webService:["azure_web_app","gcp_app_engine_service"]},data:{bucket:["aws_s3_bucket","gcp_bucket","azure_blob_storage_container"],messagingService:["aws_kinesis_data_stream","aws_sqs_queue","aws_sns_topic","azure_service_bus_namespace","azure_service_bus_queue","gcp_pubsub_topic","azure_event_grid_topic","azure_event_hub_namespace","azure_event_hub"],fileSystem:["aws_efs","azure_file_share"],contentDeliveryNetwork:["aws_cloudfront_distribution","gcp_cloud_cdn_configuration"],database:["aws_dynamodb_table","aws_elasticache","aws_rds_instance","azure_database_for_mysql_server","azure_database_for_postgres_server","azure_sql_database_server","azure_sql_database","gcp_bigtable_instance","gcp_cloud_sql_instance","gcp_firestore_database","gcp_spanner_instance","azure_cosmos_db_account"],storageAccount:["azure_storage_account"],volume:["aws_ebs_volume","gcp_compute_disk","azure_disk"]},compute:{virtualMachine:["aws_ec2_instance","gcp_compute_instance","azure_compute_virtual_machine"],serverless:["aws_lambda_function","gcp_cloud_run_function","gcp_cloud_run_job","gcp_cloud_run_service","azure_function_app"]},container:{kubernetesCluster:["aws_eks_cluster","gcp_gke_cluster","azure_aks_cluster"],containerRepository:["aws_ecr_repository","gcp_artifact_registry_repository","azure_container_registry"],containerCluster:["aws_ecs_cluster"],containerServiceTask:["aws_ecs_task"],containerService:["aws_ecs_service","azure_container_instance_group"],containerImage:["aws_ecr_image","gcp_artifact_registry_docker_image","azure_container_registry_image"]},network:{virtualNetwork:["aws_vpc","gcp_vpc","azure_virtual_network"],loadBalancer:["aws_elastic_load_balancer","gcp_forwarding_rule","azure_load_balancer","azure_traffic_manager_profile"],targetGroup:["aws_target_group"],certificate:["aws_acm_certificate","gcp_certificate_manager_certificate","azure_app_service_certificate"]}},[Kle,zle,Yle]=P0(C0);function P0(e){let t=[],r=[],o=[],i=Object.keys(e);for(let s of i){t.push(s);let m=e[s];for(let u in m){r.push(u);let l=m[u];Array.isArray(l)&&o.push(...l)}}return[lm(t),lm(r),lm(o)]}function lm(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var dm=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),U0=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),N0=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),k0=n.Object({allocatedStorageGib:n.Optional(n.Number()),encryptedAtRest:n.Optional(n.Boolean()),engine:n.Optional(n.String()),dynamoDbItemCount:n.Optional(n.Number()),dynamoDbActualSizeGib:n.Optional(n.Number())}),L0=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),M0=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),w0=n.Object({status:n.Optional(n.String()),activeServices:n.Optional(n.Number()),pendingTasks:n.Optional(n.Number()),runningTasks:n.Optional(n.Number()),registeredContainerInstances:n.Optional(n.Number()),capacityProviders:n.Optional(n.Array(n.String()))}),$0=n.Object({status:n.Optional(n.String()),desiredStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String()),availabilityZone:n.Optional(n.String()),startedAt:n.Optional(h())}),D0=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),G0=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),v0=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(h()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),j0=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),F0=n.Object({runtime:n.Optional(n.String()),memoryAllocationMib:n.Optional(n.Number()),timeoutMs:n.Optional(n.Number()),codeSha256:n.Optional(n.String())}),B0=n.Object({kind:n.Optional(n.String())}),q0=n.Object({instanceId:n.String(),architecture:n.Optional(n.String()),instanceType:n.Optional(n.String()),operatingSystem:n.Optional(n.String()),memoryMib:n.Optional(n.Number()),vCpus:n.Optional(n.Number()),vpcId:n.Optional(n.String()),k8sClusterId:n.Optional(n.String())}),H0=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),K0=n.Object({protocol:n.Optional(dm),port:n.Optional(n.Number()),instanceProtocol:n.Optional(dm),instancePort:n.Optional(n.Number())}),z0=n.Object({protocol:n.Optional(n.String()),ports:n.Optional(n.Array(n.String())),portRange:n.Optional(n.String()),allPorts:n.Optional(n.Boolean())}),Y0=n.Object({name:n.String(),ip:n.Optional(n.String()),type:n.Enum(["public","private"])}),V0=n.Object({type:n.String(),name:n.String()}),W0=n.Object({frontendIp:n.Optional(Y0),backendIpPools:n.Array(V0)}),Q0=n.Object({targetId:n.String(),targetPort:n.Optional(n.Number()),targetType:n.Optional(n.Enum(["instance","ip","lambda","alb"])),healthState:n.Optional(n.String()),healthReason:n.Optional(n.String()),healthDescription:n.Optional(n.String()),availabilityZone:n.Optional(n.String())}),Z0=n.Object({protocol:n.Optional(dm),port:n.Optional(n.Number()),type:n.Optional(n.Enum(["alb","lambda","instance","ip"])),name:n.Optional(n.String()),targetGroupArn:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),healthCheckProtocol:n.Optional(n.String()),healthCheckPort:n.Optional(n.String()),healthCheckPath:n.Optional(n.String()),healthCheckIntervalSeconds:n.Optional(n.Number()),healthCheckTimeoutSeconds:n.Optional(n.Number()),healthyThresholdCount:n.Optional(n.Number()),unhealthyThresholdCount:n.Optional(n.Number()),targets:n.Optional(n.Array(Q0)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),X0=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),J0=n.Object({type:n.Optional(n.String()),name:n.Optional(n.String()),alwaysServe:n.Optional(n.Boolean()),subnets:n.Optional(n.Array(n.Union([n.Number(),X0]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),eM=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),tM=n.Object({loadBalancerType:n.Optional(n.String()),dnsName:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnetIds:n.Array(n.String()),scheme:n.Optional(n.String()),listeners:n.Optional(n.Union([n.Array(K0),n.Array(z0)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(eM),n.Array(J0)])),azureLoadBalancingRules:n.Optional(n.Array(W0))}),rM=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(h()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(h()),status:n.Optional(n.String()),type:n.Optional(n.String())}),nM=n.Object({state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:n.Optional(n.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),oM=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),iM=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),aM=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([nM,iM,oM])]),sM=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),is=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(sM)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(U0)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(j0)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(D0)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(N0)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(k0)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(B0)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(aM)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(q0)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(F0)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(L0)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(M0)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(w0)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerServiceTask"),attributes:n.Optional($0)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerService"),attributes:n.Optional(G0)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(v0)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(H0)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:tM}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(Z0)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(rM)})]);var Ei="/v0/inventory",fm=["aws","gcp","azure"],Ih=["scan_in_progress","success","failure"],gm=n.Object({id:n.String({description:"Identifier of the inventory resource"}),cloudPlatform:n.Enum(fm,{description:"Cloud platform that hosts this resource"}),cloudAccount:n.String({description:"Cloud-native account identifier the resource was discovered in"}),cloudRegion:n.Optional(n.String({description:"Cloud region the resource was discovered in, when applicable"})),fullyQualifiedResourceId:n.String({description:"Cloud-native unique identifier for this resource (for example an AWS ARN or GCP resource name)"}),displayName:n.String({description:"Human-readable name shown in the Tsuga UI"}),nativeResourceType:n.String({description:"Cloud-native resource type, for example aws_ec2_instance or gcp_bucket"}),resourceCreatedAt:n.Optional(h({description:"When the resource was created in the cloud, when known"})),resourceUpdatedAt:n.Optional(h({description:"When the resource was last updated in the cloud, when known"})),resourceLastSeenAt:h({description:"When this resource was last observed during an inventory scan"}),tags:ye,nativeAttributes:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),covered:n.Optional(n.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),tde=d({tags:["inventory"],method:"GET",url:`${Ei}/resources`,response:n.Array(n.Intersect([gm,is]))}),pM=n.Object({type:n.Literal("aws"),accountId:c(),externalId:c(),roleArn:c()}),mM=n.Object({type:n.Literal("gcp"),projectId:c(),serviceAccountId:c(),workloadIdentityProvider:c()}),cM=n.Object({type:n.Literal("azure"),clientId:c(),subscriptionId:c(),tenantId:c()}),ym=U("type",[pM,mM,cM]),as=n.Object({id:n.String(),cloudType:n.Enum(fm),cloudAccountId:n.String(),accountFriendlyName:n.Optional(n.String()),organizationId:n.Optional(n.String()),connectionSettings:ym,createdBy:n.Optional(n.String()),createdAt:h(),lastScanStartedAt:n.Optional(h()),lastScanFinishedAt:n.Optional(h()),lastScanStatus:n.Optional(n.Enum(Ih))}),uM=n.Object({cloudType:n.Enum(fm),cloudAccountId:c(),accountFriendlyName:n.Optional(c()),organizationId:n.Optional(c()),connectionSettings:ym,lastScanStatus:n.Optional(n.Enum(Ih))}),an=`${Ei}/cloud-accounts`,rde=d({tags:["inventory"],url:an,method:"GET",response:n.Array(as)}),nde=d({tags:["inventory"],url:`${an}/:id`,method:"GET",params:n.Object({id:c()}),response:as}),ode=d({tags:["inventory"],url:an,method:"POST",body:uM,response:as}),ide=d({tags:["inventory"],url:`${an}/:id`,method:"PUT",params:n.Object({id:c()}),body:n.Object({accountFriendlyName:c()}),response:as}),ade=d({tags:["inventory"],url:`${an}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),sde=d({tags:["inventory"],url:`${Ei}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),pde=d({tags:["inventory"],url:`${an}/azure/onboarding`,method:"POST",body:n.Object({tenantId:c()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),mde=d({tags:["inventory"],method:"POST",url:`${an}/validate/:type`,params:n.Object({type:c()}),body:n.Object({data:ym,id:n.Optional(c())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),Th=`${Ei}/settings`,cde=d({tags:["inventory"],url:Th,method:"GET",response:n.Object({settings:n.Optional(n.Object({id:n.String(),infrastructureIdentifiers:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))}))})}),ude=d({tags:["inventory"],url:Th,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:c({allowEmpty:!1}),value:n.Optional(c({allowEmpty:!1}))}),{maxItems:50})}),response:n.Object({})}),lde=d({tags:["inventory"],url:`${Ei}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var lM=`/${"v1"}/inventory`,dM=n.Omit(gm,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields of a cloud resource discovered by an inventory scan"}),hh=n.Intersect([dM,is],{$id:"InventoryResource",description:"A cloud resource discovered by an inventory scan, together with its category, type and category-specific attributes"}),fM={id:"123-456-abc",cloudPlatform:"aws",cloudAccount:"123456789012",cloudRegion:"us-east-1",fullyQualifiedResourceId:"arn:aws:s3:::tsuga-example-bucket",displayName:"tsuga-example-bucket",nativeResourceType:"aws_s3_bucket",resourceCreatedAt:"2024-01-01T08:00:00.000Z",resourceLastSeenAt:"2024-01-15T12:34:56.000Z",tags:[{key:"team",value:"platform"}],category:"data",resourceType:"bucket",attributes:{versioningStatus:"Enabled"}};Object.assign(hh,{examples:[fM]});var _h=d({description:"Retrieve all cloud resources discovered by inventory scans",operationId:"listInventoryResources",tags:["inventory"],url:`${lM}/resources`,method:"GET",response:n.Array(hh)});var gM={"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"crawler-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["admin"]},"asset-change":{read:["public_viewer","public_editor","admin"],write:[]},"inventory-settings":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]}},yM={"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"asset-change":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"crawler-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"inventory-settings":{read:["viewer","editor","admin"],write:["editor","admin"]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:[]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:["admin"],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]}},EM={user:gM,team:yM};function Em(e){return Ah(e,"team")}function Im(e){return Ah(e,"user")}function Ah(e,t){let r=[],o=EM[t];for(let[i,s]of Object.entries(o))for(let[m,u]of Object.entries(s))u.includes(e)&&r.push({actionType:m,resourceType:i});return r}var Sde={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:Im("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:Im("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:Im("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},Ode={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:Em("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:Em("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:Em("viewer"),roleKey:"viewer"}};var xh=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
33
+ `,e),([t,r])=>[[t],r]),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]),Qg=(e,t=[])=>p(p(Np(e),([r,o])=>p(IU(o),([i,s])=>[[r,i],s])),([r,o])=>Qg(o,[...t,r]),()=>[t,e]),TU=e=>p(p(Qg(e),([t,r])=>p(p(p(Np(r),([o,i])=>[[o],i]),([o,i])=>[o,i],()=>p([[],r],([o,i])=>[o,i],()=>[])),([o,i])=>[[t,o],i])),([t,r])=>[Jf(t),r]),Np=e=>p(p(EU(e),([t,r])=>p(p(dU(r),([o,i])=>[o,i],()=>p(fU(r),([o,i])=>[o,i],()=>p(gU(r),([o,i])=>[o,i],()=>p(yU(r),([o,i])=>[o,i],()=>[])))),([o,i])=>p(hg(i),([s,c])=>[[t,o,s],c]))),([t,r])=>[eg(t),r]),_U=e=>p(p(Np(e),([t,r])=>p(TU(r),([o,i])=>[[t,o],i])),([t,r])=>[tg(t),r]),Wg=e=>p(p(_U(e),([t,r])=>[t,r],()=>p(AP(e),([t,r])=>[t,r],()=>p(Y(e),([t,r])=>[t,r],()=>[]))),([t,r])=>[t,r]);function Zg(e){let t=Rp(`\`${e}\``);return a.IsEqual(t.length,2)?t[0]:F()}function Do(e,t={}){return R("TemplateLiteral",[e],t)}function Xg(e){return x({},Do(e,{}))}function OU(e){let t=Zg(e);return Xg(t)}function Jg(e,t={}){let r=a.IsString(e)?OU(e):Xg(e);return f.Update(r,{},t)}function Te(e){return h(e,"TemplateLiteral")}var L={};ht(L,{ExtendsFalse:()=>j,ExtendsTrue:()=>S,ExtendsUnion:()=>Lp,IsExtendsFalse:()=>AU,IsExtendsTrue:()=>ty,IsExtendsTrueLike:()=>ge,IsExtendsUnion:()=>ey});function Lp(e){return f.Create({"~kind":"ExtendsUnion"},{inferred:e})}function ey(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"inferred")&&a.IsEqual(e["~kind"],"ExtendsUnion")&&a.IsObject(e.inferred)}function S(e){return f.Create({"~kind":"ExtendsTrue"},{inferred:e})}function ty(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"inferred")&&a.IsEqual(e["~kind"],"ExtendsTrue")&&a.IsObject(e.inferred)}function j(){return f.Create({"~kind":"ExtendsFalse"},{})}function AU(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.IsEqual(e["~kind"],"ExtendsFalse")}function ge(e){return ey(e)||ty(e)}function Fa(e){let t=zg(e);return a.IsEqual(t.length,2)?t[0]:F()}function SU(e){return!0}function ry(e){let[t,...r]=e;return A(t)?bU(t)?ry(r):!1:!0}function ny(e){return a.IsEqual(e.length,0)?!1:ry(e)}function bU(e){return O(e)?ny(e.anyOf):V(e)?SU(e.const):!1}function Ba(e){return ny(e)}function oy(e,t,r=[]){let[o,...i]=e;return a.IsString(o)?oy(i,t,[...r,`${o}${t}`]):r}function xU(e,t){return a.IsEqual(e.length,0)?[`${t}`]:oy(e,t)}function iy(e,t,r=[]){let[o,...i]=t;return A(o)?iy(e,i,[...r,...ay(e,o)]):r}function ay(e,t){return O(t)?iy(e,t.anyOf):V(t)?xU(e,t.const):F()}function sy(e,t){let[r,...o]=t;return A(r)?sy(ay(e,r),o):e}function RU(e){return e.map(t=>q(t))}function CU(e){let t=sy([],e),r=RU(t);return G(r)}function PU(e){return a.IsEqual(e.length,0)?F():a.IsEqual(e.length,1)&&V(e[0])?e[0]:CU(e)}function He(e){let t=Fa(e);return Ba(t)?PU(t):at()}function UU(e){return a.IsString(e)||a.IsNumber(e)?q(e):a.IsNull(e)?Or():z()}function Pt(e){return e.map(r=>UU(r))}function ri(e){let t=Pt(e);return G(t)}function rn(e){return ri(e.enum)}function NU(e,t,r,o){let i=X(e,r,o);return ge(i)?S(f.Assign(f.Assign(e,i.inferred),{[t]:r})):j()}function LU(e,t){return S(e)}function kU(e,t,r){let o=ri(r);return X(e,t,o)}function py(e,t,r){let[o,...i]=r;return A(o)?(()=>{let s=X(e,t,o);return ge(s)?py(s.inferred,t,i):j()})():S(e)}function MU(e,t,r){let o=He(r);return X(e,t,o)}function cy(e,t,r){let[o,...i]=r;return A(o)?(()=>{let s=X(e,t,o);return ge(s)?S(s.inferred):cy(e,t,i)})():j()}function B(e,t,r){return We(r)?LU(e,t):Ie(r)?kU(e,t,r.enum):Ee(r)?NU(e,r.name,t,r.extends):U(r)?py(e,t,r.allOf):Te(r)?MU(e,t,r.pattern):O(r)?cy(e,t,r.anyOf):it(r)?S(e):j()}function my(e,t,r){return Ee(r)?B(e,t,r):We(r)?S(e):it(r)?S(e):Lp(e)}function wU(e,t){let r=Qr(e),o=Qr(t);return r&&o||!r&&o?!0:!(r&&!o)}function uy(e,t,r,o){return Z(o)?wU(t,o)?X(e,r,o.items):j():B(e,t,o)}function ly(e,t,r){return ze(r)?X(e,t,r.iteratorItems):B(e,wt(t),r)}function dy(e,t,r){return mt(r)?S(e):B(e,t,r)}function fy(e,t,r){return Xe(r)?S(e):B(e,t,r)}function $U(e,t,r,o,i){let s=Ee(o)?t:o,c=Ee(o)?o:t,u=xe(t),l=xe(o),g=X(e,s,c);return!u&&l?j():ge(g)?ni(g.inferred,r,i):j()}function DU(e,t,r,o){let[i,...s]=o;return A(i)?$U(e,t,r,i,s):xe(t)?S(e):j()}function GU(e,t,r){let[o,...i]=t;return A(o)?DU(e,o,i,r):S(e)}function ni(e,t,r){return GU(e,t,r)}function qa(e,t,r){return lt(r)?S(e):X(e,t,r)}function gy(e,t,r,o){return Re(o)?(()=>{let i=ni(e,t,o.parameters);return ge(i)?qa(i.inferred,r,o.instanceType):j()})():j()}function yy(e,t,r){return X(e,rn(t),r)}function Ey(e,t,r,o){return Ce(o)?(()=>{let i=ni(e,t,o.parameters);return ge(i)?qa(i.inferred,r,o.returnType):j()})():j()}function Iy(e,t,r){return ke(r)?S(e):le(r)?S(e):B(e,t,r)}var oi="equal",vU="disjoint",ii="left-inside",ai="right-inside";function si(e,t){let r=[it(e)?L.ExtendsFalse():Ke({},e,t),it(e)?L.ExtendsTrue({}):Ke({},t,e)];return L.IsExtendsTrueLike(r[0])&&L.IsExtendsTrueLike(r[1])?oi:L.IsExtendsTrueLike(r[0])&&L.IsExtendsFalse(r[1])?ii:L.IsExtendsFalse(r[0])&&L.IsExtendsTrueLike(r[1])?ai:vU}function jU(e){return O(e)?qt(e.anyOf):[e]}function qt(e){return e.reduce((t,r)=>[...t,...jU(r)],[])}function kp(e){return e.reduceRight((r,o,i)=>({[i]:o,...r}),{})}function Ty(e){let t=kp(e.items);return N(t)}function FU(e,t){return Wr(e)?!!Wr(t):!1}function BU(e,t){return xe(e)?!!xe(t):!1}function qU(e,t){let r=FU(e,t),o=BU(e,t),i=_e([e,t]),s=Ea(Un(i));return r&&o?ot(nt(s)):r&&!o?ot(s):!r&&o?nt(s):s}function HU(e,t,r){return r in e?r in t?qU(e[r],t[r]):e[r]:r in t?t[r]:z()}function KU(e,t){return[...new Set([...a.Keys(t),...a.Keys(e)])].reduce((o,i)=>({...o,[i]:HU(e,t,i)}),{})}function _y(e){return M(e)?e.properties:H(e)?kp(e.items):F()}function hy(e,t){let r=_y(e),o=_y(t),i=KU(r,o);return N(i)}function Oy(e,t){let r=si(e,t);return a.IsEqual(r,ii)?e:a.IsEqual(r,ai)||a.IsEqual(r,oi)?t:z()}function Ay(e){return M(e)||H(e)}function Sy(e){return U(e)?_e(e.allOf):e}function zU(e,t){let r=Sy(e),o=Sy(t),i=Ay(r),s=Ay(o);return i&&s?hy(xr(r),o):i&&!s?xr(r):!i&&s?o:Oy(xr(r),o)}function by(e,t,r=[]){let[o,...i]=t;return a.IsUndefined(o)?r.length===0?[e]:r:by(e,i,[...r,zU(e,o)])}function xy(e,t,r=[]){let[o,...i]=e;return A(o)?xy(i,t,[...r,...pi([o],t)]):r}function pi(e,t=[]){let[r,...o]=e;return A(r)?O(r)?pi(o,xy(r.anyOf,t)):pi(o,by(r,t)):t}function _e(e){let t=pi(e);return Mp(t)}function Xt(e){return Mp(e)}function xr(e){return U(e)?_e(e.allOf):O(e)?Xt(e.anyOf):e}function nn(e){return a.IsEqual(e.length,1)?e[0]:a.IsEqual(e.length,0)?z():G(e)}function VU(e,t){return t.filter(r=>si(e,r)!==ai)}function YU(e,t){let r=t.some(o=>{let i=si(e,o);return a.IsEqual(i,ii)||a.IsEqual(i,oi)});return a.IsEqual(r,!1)}function QU(e,t){let r=xr(e);return We(r)?[r]:YU(r,t)?[...VU(r,t),r]:t}function wp(e,t=[]){let[r,...o]=e;return A(r)?M(r)?wp(o,[...t,r]):wp(o,QU(r,t)):t}function Mp(e){let t=wp(e),r=qt(t);return r.length===0?z():r.length===1?r[0]:G(r)}function WU(e,t,r,o){let i=_(e,t,r);return f.Update(xr(i),{},o)}function Ry(e,t,r,o){return WU(e,t,r,o)}function Cy(e,t,r){let o=_e(t);return X(e,o,r)}function Py(e,t,r){return Ve(r)?X(e,t,r.iteratorItems):B(e,Dt(t),r)}function Ha(e,t,r){return t===r?S(e):j()}function ZU(e,t,r){return V(r)?Ha(e,t,r.const):mt(r)?S(e):B(e,q(t),r)}function XU(e,t,r){return V(r)?Ha(e,t,r.const):Xe(r)?S(e):B(e,q(t),r)}function JU(e,t,r){return V(r)?Ha(e,t,r.const):le(r)?S(e):B(e,q(t),r)}function eN(e,t,r){return V(r)?Ha(e,t,r.const):Oe(r)?S(e):B(e,q(t),r)}function Uy(e,t,r){return a.IsBigInt(t.const)?ZU(e,t.const,r):a.IsBoolean(t.const)?XU(e,t.const,r):a.IsNumber(t.const)?JU(e,t.const,r):a.IsString(t.const)?eN(e,t.const,r):F()}function Ny(e,t,r){return Ee(r)?B(e,t,r):S(e)}function Ly(e,t,r){return Gt(r)?S(e):B(e,t,r)}function ky(e,t,r){return le(r)?S(e):B(e,t,r)}function tN(e,t,r){return xe(t)?xe(r)?S(e):j():S(e)}function rN(e,t,r){return Ee(r)&&Wt(r.extends)?j():(()=>{let o=X(e,t,r);return ge(o)?tN(o.inferred,t,r):j()})()}function nN(e,t){return e.reduce((r,o)=>o in t?ge(t[o])?{...r,...t[o].inferred}:F():F(),{})}function oN(e,t,r){let o={};for(let c of a.Keys(r))o[c]=c in t?rN({},t[c],r[c]):xe(r[c])?Ee(r[c])?S(f.Assign(e,{[r[c].name]:r[c].extends})):S(e):j();let i=a.Values(o).every(c=>ge(c)),s=i?nN(a.Keys(o),o):{};return i?S(s):j()}function iN(e,t,r){let o=oN(e,t,r);return ge(o)?S(f.Assign(e,o.inferred)):j()}function aN(e,t,r){return iN(e,t,r)}function My(e,t,r){return M(r)?aN(e,t,r.properties):B(e,N(t),r)}function wy(e,t,r){return Be(r)?X(e,t,r.item):B(e,jt(t),r)}function $y(e,t,r){return Oe(r)?S(e):B(e,t,r)}function Dy(e,t,r){return vt(r)?S(e):B(e,t,r)}function Gy(e,t,r){let o=He(t);return X(e,o,r)}function $p(e,t){return f.Create({"~kind":"Inferrable"},{name:e,type:t},{})}function ci(e){return a.IsObject(e)&&a.HasPropertyKey(e,"~kind")&&a.HasPropertyKey(e,"name")&&a.HasPropertyKey(e,"type")&&a.IsEqual(e["~kind"],"Inferrable")&&a.IsString(e.name)&&a.IsObject(e.type)}function Dp(e){return Ar(e)?Ee(e.items)?Z(e.items.extends)?$p(e.items.name,e.items.extends.items):it(e.items.extends)?$p(e.items.name,e.items.extends):void 0:F():void 0}function Ka(e){return Ee(e)?$p(e.name,e.extends):void 0}function Gp(e,t,r=[]){let[o,...i]=e;return A(o)?(()=>{let s=X({},o,t);return ge(s)?Gp(i,t,[...r,o]):void 0})():r}function vy(e,t,r,o){let i=Gp(r,o);return a.IsArray(i)?S(f.Assign(e,{[t]:Me(i)})):j()}function za(e,t,r,o){let i=Gp(r,o);return a.IsArray(i)?S(f.Assign(e,{[t]:G(i)})):j()}function sN(e){return[...e].reverse()}function vp(e,t){return t?sN(e):e}function pN(e){let t=e.length>0?e[0]:void 0,r=A(t)?Dp(t):void 0;return A(r)}function cN(e,t,r,o,i,s){let c=X(e,r,i);return ge(c)?jy(c.inferred,t,o,s):j()}function mN(e,t,r,o,i){let s=Dp(o);return ci(s)?vy(e,s.name,vp(r,t),s.type):(()=>{let[c,...u]=r;return A(c)?cN(e,t,c,u,o,i):j()})()}function uN(e,t,r,o){let[i,...s]=o;return A(i)?mN(e,t,r,i,s):a.IsEqual(r.length,0)?S(e):j()}function jy(e,t,r,o){return uN(e,t,r,o)}function lN(e,t,r){let o=Va(e,{callstack:[]},r),i=pN(o);return jy(e,i,vp(t,i),vp(o,i))}function Fy(e,t,r){let o=Ka(r);return ci(o)?za(e,o.name,t,o.type):(()=>{let[i,...s]=t;return A(i)?(()=>{let c=X(e,i,r);return ge(c)?Fy(c.inferred,s,r):j()})():S(e)})()}function By(e,t,r){let o=Va(e,{callstack:[]},t);return H(r)?lN(e,o,r.items):Z(r)?Fy(e,o,r.items):B(e,Me(o),r)}function qy(e,t,r){return lt(r)?S(e):Bt(r)?S(e):B(e,t,r)}function Hy(e,t,r){let[o,...i]=r;return A(o)?(()=>{let s=X(e,t,o);return ge(s)?S(s.inferred):Hy(e,t,i)})():j()}function jp(e,t,r){let[o,...i]=t;return A(o)?(()=>{let s=Hy(e,o,r);return ge(s)?jp(s.inferred,i,r):j()})():S(e)}function Ky(e,t,r){let o=Ka(r);return ci(o)?za(e,o.name,t,o.type):O(r)?jp(e,t,r.anyOf):jp(e,t,[r])}function zy(e,t,r){return Ee(r)?B(e,t,r):We(r)?S(e):it(r)?S(e):j()}function Vy(e,t,r){return lt(r)?S(e):B(e,t,r)}function X(e,t,r){return We(t)?my(e,t,r):Z(t)?uy(e,t,t.items,r):ze(t)?ly(e,t.iteratorItems,r):mt(t)?dy(e,t,r):Xe(t)?fy(e,t,r):Re(t)?gy(e,t.parameters,t.instanceType,r):Ie(t)?yy(e,t,r):Ce(t)?Ey(e,t.parameters,t.returnType,r):ke(t)?Iy(e,t,r):U(t)?Cy(e,t.allOf,r):Ve(t)?Py(e,t.iteratorItems,r):V(t)?Uy(e,t,r):Wt(t)?Ny(e,t,r):Gt(t)?Ly(e,t,r):le(t)?ky(e,t,r):M(t)?My(e,t.properties,r):Be(t)?wy(e,t.item,r):Oe(t)?$y(e,t,r):vt(t)?Dy(e,t,r):Te(t)?Gy(e,t.pattern,r):H(t)?By(e,t.items,r):Bt(t)?qy(e,t,r):O(t)?Ky(e,t.anyOf,r):it(t)?zy(e,t,r):lt(t)?Vy(e,t,r):j()}function Bn(e,t,r={}){return R("Interface",[e,t],r)}function Qn(e){return A(e)&&a.HasPropertyKey(e,"action")&&a.IsEqual(e.action,"Interface")}function Yy(e,t,r={}){return x({},Bn(e,t,r))}function dN(e,t,r){return e.includes(r)?!0:Rr([...e,r],t,t[r])}function Qy(e,t,r){let o=Ra(r);return on(e,t,o)}function on(e,t,r){let[o,...i]=r;return A(o)?Rr(e,t,o)?!0:on(e,t,i):!1}function Rr(e,t,r){return oe(r)?dN(e,t,r.$ref):Z(r)?Rr(e,t,r.items):ze(r)?Rr(e,t,r.iteratorItems):Re(r)?on(e,t,[...r.parameters,r.instanceType]):Ce(r)?on(e,t,[...r.parameters,r.returnType]):Qn(r)?Qy(e,t,r.parameters[1]):U(r)?on(e,t,r.allOf):Ve(r)?Rr(e,t,r.iteratorItems):M(r)?Qy(e,t,r.properties):Be(r)?Rr(e,t,r.item):O(r)?on(e,t,r.anyOf):H(r)?on(e,t,r.items):de(r)?Rr(e,t,qe(r)):!1}function Ya(e,t,r){return Rr(e,t,r)}function fN(e,t){return t.reduce((r,o)=>o in e?Ya([o],e,e[o])?[...r,o]:r:F(),[])}function Wy(e){let t=Vl(e);return fN(e,t)}function gN(e,t,r){return r.includes(t)?r:t in e?Cr(e,e[t],[...r,t]):F()}function Zy(e,t,r){let o=Ra(t);return Wn(e,o,r)}function Wn(e,t,r){return t.reduce((o,i)=>Cr(e,i,o),r)}function Cr(e,t,r){return oe(t)?gN(e,t.$ref,r):Z(t)?Cr(e,t.items,r):ze(t)?Cr(e,t.iteratorItems,r):Re(t)?Wn(e,[...t.parameters,t.instanceType],r):Ce(t)?Wn(e,[...t.parameters,t.returnType],r):Qn(t)?Zy(e,t.parameters[1],r):U(t)?Wn(e,t.allOf,r):Ve(t)?Cr(e,t.iteratorItems,r):M(t)?Zy(e,t.properties,r):Be(t)?Cr(e,t.item,r):O(t)?Wn(e,t.anyOf,r):H(t)?Wn(e,t.items,r):de(t)?Cr(e,qe(t),r):r}function Xy(e,t,r){return Cr(e,r,[t])}function yN(e){return Ln()}function EN(e){return a.Keys(e).reduce((t,r)=>({...t,[r]:Ht(e[r])}),{})}function mi(e){return e.reduce((t,r)=>[...t,Ht(r)],[])}function Ht(e){return oe(e)?yN(e.$ref):Z(e)?Ct(Ht(e.items),Ta(e)):ze(e)?wt(Ht(e.iteratorItems)):Re(e)?Er(mi(e.parameters),Ht(e.instanceType)):Ce(e)?Ir(mi(e.parameters),Ht(e.returnType)):U(e)?It(mi(e.allOf)):Ve(e)?Dt(Ht(e.iteratorItems)):M(e)?N(EN(e.properties)):Be(e)?jt(Ht(e.item)):de(e)?Pa(vn(e),Ht(qe(e))):O(e)?G(mi(e.anyOf)):H(e)?Me(mi(e.items)):e}function IN(e,t){return t in e?Ht(e[t]):je()}function Jy(e){return IN(e.$defs,e.$ref)}function TN(e,t,r){let o=dt(e,{callstack:[]},t),i=ui({},{callstack:[]},r);return _e([...o,N(i)])}function _N(e,t){return a.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>{let s=e[i],c=Qn(s)?TN(e,s.parameters[0],s.parameters[1]):s;return{...o,[i]:c}},{})}function eE(e,t,r){let o=Xy(e,t,r),i=_N(e,o);return $t(i,t)}function tE(e,t){return t in e?oe(e[t])?tE(e,e[t].$ref):e[t]:z()}function Kt(e,t){return tE(e,t)}function rE(e){return ae(e)?Jy(e):e}function Ke(e,t,r){let o=rE(t),i=rE(r);return X(e,o,i)}function hN(e,t,r){if(Ee(t)||Zn(t)||L.IsExtendsTrueLike(Ke({},t,r)))return;let o={parameter:e,extends:r,received:t};throw new Error("Generic argument does not satify constraint",{cause:o})}function nE(e,t,r,o,i){let s=_(e,t,i);return hN(r,s,o),f.Assign(e,{[r]:s})}function ON(e,t,r,o,i){let s=_(e,t,r.extends),c=_(e,t,r.equals),[u,...l]=i;return A(u)?Fp(nE(e,t,r.name,s,u),t,o,l):Fp(nE(e,t,r.name,s,c),t,o,[])}function Fp(e,t,r,o){let[i,...s]=r;return A(i)?ON(e,t,i,s,o):e}function oE(e,t,r,o){return Fp(e,t,r,o)}function AN(e){return a.IsGreaterThan(e.length,0)?e[0]:""}function iE(e,t,r,o){let i=dt(e,t,o);return La(r,i)}function SN(e,t,r,o){return iE(e,t,he(r),o)}function bN(e,t,r,o,i,s){let c=dt(e,t,s),u=oE(e,t,o,c),l=_(u,{callstack:[...t.callstack,r]},i);return _(e,t,l)}function Qa(e,t,r,o){let[i,s]=Al(e,r,o);return Nn(s)?a.IsEqual(AN(t.callstack),i)?SN(e,t,i,o):bN(e,t,i,s.parameters,s.expression,o):iE(e,t,r,o)}function La(e,t){return f.Create({"~kind":"Call"},{target:e,arguments:t},{})}function aE(e,t){return Qa({},{callstack:[]},e,t)}function Zn(e){return h(e,"Call")}function sE(e){return Be(e)?sE(e.item):e}function xN(e,t,r,o){let i=_(e,t,r);return f.Update(sE(i),{},o)}function pE(e,t,r,o){return k(e,[r])?xN(e,t,r,o):ti(r,o)}function cE(e,t){return e(t)}function mE(e,t){return a.IsString(t)?q(cE(e,t)):q(t)}function uE(e,t){let r=He(t);return Jt(e,r)}function lE(e,t){let r=t.map(o=>Jt(e,o));return G(r)}function Jt(e,t){return V(t)?mE(e,t.const):Te(t)?uE(e,t.pattern):O(t)?lE(e,t.anyOf):t}function Go(e,t={}){return R("Capitalize",[e],t)}function dE(e,t={}){return x({},Go(e,t))}function vo(e,t={}){return R("Lowercase",[e],t)}function fE(e,t={}){return x({},vo(e,t))}function jo(e,t={}){return R("Uncapitalize",[e],t)}function gE(e,t={}){return x({},jo(e,t))}function Fo(e,t={}){return R("Uppercase",[e],t)}function yE(e,t={}){return x({},Fo(e,t))}var RN=e=>e[0].toUpperCase()+e.slice(1),CN=e=>e.toLowerCase(),PN=e=>e[0].toLowerCase()+e.slice(1),UN=e=>e.toUpperCase();function NN(e,t,r,o){let i=_(e,t,r);return f.Update(Jt(RN,i),{},o)}function EE(e,t,r,o){return k(e,[r])?NN(e,t,r,o):Go(r,o)}function LN(e,t,r,o){let i=_(e,t,r);return f.Update(Jt(CN,i),{},o)}function IE(e,t,r,o){return k(e,[r])?LN(e,t,r,o):vo(r,o)}function kN(e,t,r,o){let i=_(e,t,r);return f.Update(Jt(PN,i),{},o)}function TE(e,t,r,o){return k(e,[r])?kN(e,t,r,o):jo(r,o)}function MN(e,t,r,o){let i=_(e,t,r);return f.Update(Jt(UN,i),{},o)}function _E(e,t,r,o){return k(e,[r])?MN(e,t,r,o):Fo(r,o)}function Bo(e,t,r,o,i={}){return R("Conditional",[e,t,r,o],i)}function hE(e,t,r,o,i={}){return x({},Bo(e,t,r,o,i))}function wN(e,t,r,o,i,s,c){let u=_(e,t,r),l=_(e,t,o),g=Ke(e,u,l);return f.Update(L.IsExtendsUnion(g)?G([_(g.inferred,t,i),_(e,t,s)]):L.IsExtendsTrue(g)?_(g.inferred,t,i):_(e,t,s),{},c)}function OE(e,t,r,o,i,s,c){return k(e,[r,o])?wN(e,t,r,o,i,s,c):Bo(r,o,i,s,c)}function qo(e,t={}){return R("ConstructorParameters",[e],t)}function AE(e,t={}){return x({},qo(e,t))}function $N(e){return Re(e)?_({},{callstack:[]},Me(e.parameters)):z()}function DN(e,t,r,o){let i=_(e,t,r);return f.Update($N(i),{},o)}function SE(e,t,r,o){return k(e,[r])?DN(e,t,r,o):qo(r,o)}function Ho(e,t,r={}){return R("Exclude",[e,t],r)}function bE(e,t,r={}){return x({},Ho(e,t,r))}function xE(e,t){return e.reduce((r,o)=>[...r,...RE(o,t)],[])}function RE(e,t){let r=Ke({},e,t);return L.IsExtendsTrueLike(r)?[]:[e]}function GN(e,t){let r=Ie(e)?xE(Pt(e.enum),t):O(e)?xE(qt(e.anyOf),t):RE(e,t);return Xt(r)}function vN(e,t,r,o,i){let s=_(e,t,r),c=_(e,t,o);return f.Update(GN(s,c),{},i)}function Wa(e,t,r,o,i){return k(e,[r,o])?vN(e,t,r,o,i):Ho(r,o,i)}function Ko(e,t,r={}){return R("Extract",[e,t],r)}function CE(e,t,r={}){return x({},Ko(e,t,r))}function PE(e,t){return e.reduce((r,o)=>[...r,...UE(o,t)],[])}function UE(e,t){let r=Ke({},e,t);return L.IsExtendsTrueLike(r)?[e]:[]}function jN(e,t){let r=Ie(e)?PE(Pt(e.enum),t):O(e)?PE(qt(e.anyOf),t):UE(e,t);return Xt(r)}function FN(e,t,r,o,i){let s=_(e,t,r),c=_(e,t,o);return f.Update(jN(s,c),{},i)}function NE(e,t,r,o,i){return k(e,[r,o])?FN(e,t,r,o,i):Ko(r,o,i)}var BN=new RegExp("^(?:0|[1-9][0-9]*)$");function Xn(e){let t=`${e}`;return BN.test(t)?parseInt(t):e}function qN(e){return q(Xn(e))}function LE(e){return e.map(t=>kE(t))}function kE(e){return U(e)?It(LE(e.allOf)):O(e)?G(LE(e.anyOf)):V(e)?qN(e.const):e}function ME(e,t){let r=kE(t),o=Ke({},r,Tt());return L.IsExtendsTrueLike(o)?e:z()}function wE(e,t){let r=Kt(e,t);return zt(r)}function Za(e){return e.reduce((t,r)=>[...t,...zt(r)],[])}function $E(e){let t=Pt(e);return Za(t)}function DE(e){let t=_e(e);return zt(t)}function GE(e){return[`${e}`]}function vE(e){let t=He(e);return zt(t)}function zt(e){return ae(e)?wE(e.$defs,e.$ref):Ie(e)?$E(e.enum):U(e)?DE(e.allOf):V(e)?GE(e.const):Te(e)?vE(e.pattern):O(e)?Za(e.anyOf):[]}function Jn(e){return zt(e)}function HN(e,t){return t in e?[e[t]]:[]}function KN(e,t){return t.reduce((r,o)=>[...r,...HN(e,o)],[])}function jE(e,t){let r=Jn(t),o=KN(e,r);return Xt(o)}function zN(e){return q(Xn(e))}function FE(e){return e.map(t=>Bp(t))}function Bp(e){return U(e)?It(FE(e.allOf)):O(e)?G(FE(e.anyOf)):V(e)?zN(e.const):e}function VN(e,t){return e.reduceRight((r,o,i)=>{let s=Ke({},q(i),t);return L.IsExtendsTrueLike(s)?[o,...r]:r},[])}function YN(e,t){let r=Bp(t),o=VN(e,r);return nn(o)}function QN(e){return nn(e)}function BE(e,t){return le(t)||ke(t)?QN(e):YN(e,t)}function WN(e){return e.reduce((t,r)=>ba(r)?[...t,q(r)]:t,[])}function eo(e){let t=WN(e);return G(t)}function qn(e,t,r={}){return R("Index",[e,t],r)}function qE(e,t,r={}){let o=a.IsArray(t)?eo(t):t;return x({},qn(e,o,r))}function HE(e,t){let r=Kt(e,t);return Ut(r)}function ZN(e,t){let r=a.Keys(e).filter(E=>!a.HasPropertyKey(t,E)),o=a.Keys(t).filter(E=>!a.HasPropertyKey(e,E)),i=a.Keys(e).filter(E=>a.HasPropertyKey(t,E)),s=r.reduce((E,I)=>({...E,[I]:e[I]}),{}),c=o.reduce((E,I)=>({...E,[I]:t[I]}),{}),u=i.reduce((E,I)=>({...E,[I]:_e([e[I],t[I]])}),{}),l=f.Assign(s,c);return f.Assign(l,u)}function KE(e){return e.reduce((t,r)=>ZN(t,Ut(r)),{})}function zE(e){let t=Ty(Me(e));return Ut(t)}function XN(e,t){return a.Keys(e).filter(i=>i in t).reduce((i,s)=>({...i,[s]:Xt([e[s],t[s]])}),{})}function VE(e,t){let[r,...o]=e;return A(r)?VE(o,XN(t,Ut(r))):t}function YE(e){let[t,...r]=e;return A(t)?VE(r,Ut(t)):F()}function Ut(e){return ae(e)?HE(e.$defs,e.$ref):U(e)?KE(e.allOf):O(e)?YE(e.anyOf):H(e)?zE(e.items):M(e)?e.properties:{}}function to(e){let t=Ut(e);return N(t)}function JN(e){return ae(e)||U(e)||O(e)?to(e):e}function eL(e,t){let r=JN(e);return Z(r)?ME(r.items,t):M(r)?jE(r.properties,t):H(r)?BE(r.items,t):z()}function tL(e,t,r,o,i){let s=_(e,t,r),c=_(e,t,o);return f.Update(eL(s,c),{},i)}function QE(e,t,r,o,i){return k(e,[r,o])?tL(e,t,r,o,i):qn(r,o,i)}function zo(e,t={}){return R("InstanceType",[e],t)}function WE(e,t={}){return x({},zo(e,t))}function rL(e){return Re(e)?e.instanceType:z()}function nL(e,t,r,o){let i=_(e,t,r);return f.Update(rL(i),{},o)}function ZE(e,t,r,o={}){return k(e,[r])?nL(e,t,r,o):zo(r,o)}function oL(e,t,r,o,i){let s=dt(e,{callstack:[]},r),c=ui(e,{callstack:[]},o),u=_e([...s,N(c)]);return f.Update(u,{},i)}function XE(e,t,r,o,i){return k(e,r)?oL(e,t,r,o,i):Bn(r,o,i)}function Hn(e,t={}){return R("KeyOf",[e],t)}function JE(e,t={}){return x({},Hn(e,t))}function eI(){return G([Tt(),at(),$n()])}function tI(e){return Tt()}function iL(e){return e.reduce((r,o)=>ba(o)?[...r,q(Xn(o))]:F(),[])}function rI(e){let t=a.Keys(e),r=iL(t);return nn(r)}function nI(e){return vn(e)}function oI(e){let t=e.map((r,o)=>q(o));return nn(t)}function aL(e){return ae(e)||U(e)||O(e)?to(e):e}function sL(e){let t=aL(e);return We(t)?eI():Z(t)?tI(t.items):M(t)?rI(t.properties):de(t)?nI(t):H(t)?oI(t.items):z()}function pL(e,t,r,o){let i=_(e,t,r);return f.Update(sL(i),{},o)}function iI(e,t,r,o){return k(e,[r])?pL(e,t,r,o):Hn(r,o)}function cL(e){let t=He(e);return qp(t)}function aI(e){return e.reduce((t,r)=>[...t,...qp(r)],[])}function qp(e){return Ie(e)?aI(Pt(e.enum)):wn(e)||Mn(e)?[e]:Te(e)?cL(e.pattern):O(e)?aI(e.anyOf):[]}function sI(e){return qp(e)}function Fn(e,t,r,o,i={}){return R("Mapped",[e,t,r,o],i)}function pI(e,t,r,o,i={}){return x({},Fn(e,t,r,o,i))}function mL(e,t,r,o,i){let s=f.Assign(e,{[r.name]:o}),c=_(s,t,i);return Te(c)?He(c.pattern):c}function uL(e,t,r,o,i){let s=f.Assign(e,{[r.name]:o});return _(s,t,i)}function lL(e,t,r,o,i,s){let c=uL(e,t,r,o,s),u=mL(e,t,r,o,i);return wn(u)||Mn(u)?{[u.const]:c}:{}}function dL(e,t,r,o,i,s){return o.reduce((c,u)=>({...c,...lL(e,t,r,u,i,s)}),{})}function fL(e,t,r,o,i,s){let c=sI(o),u=dL(e,t,r,c,i,s);return N(u)}function gL(e,t,r,o,i,s,c){let u=_(e,t,o);return f.Update(fL(e,t,r,u,i,s),{},c)}function cI(e,t,r,o,i,s,c){return k(e,[o])?gL(e,t,r,o,i,s,c):Fn(r,o,i,s,c)}function yL(e,t){return a.Keys(e).filter(o=>t.includes(o)).reduce((o,i)=>({...o,[i]:eE(e,i,e[i])}),{})}function EL(e,t){return a.Keys(e).filter(o=>!t.includes(o)).reduce((o,i)=>({...o,[i]:_(e,{callstack:[]},e[i])}),{})}function IL(e,t){let r=Wy(e),o=yL(e,r),i=EL(e,r),s={...o,...i};return f.Update(s,{},t)}function mI(e,t,r,o){let i=f.Assign(e,r);return IL(i,o)}function Vo(e,t={}){return R("NonNullable",[e],t)}function uI(e,t={}){return x({},Vo(e,t))}function TL(e){let t=G([Or(),jn()]);return Wa({},{callstack:[]},e,t,{})}function _L(e,t,r,o){let i=_(e,t,r);return f.Update(TL(i),{},o)}function lI(e,t,r,o){return k(e,[r])?_L(e,t,r,o):Vo(r,o)}function Xa(e){let t=to(e);return M(t)?t.properties:F()}function Yo(e,t,r={}){return R("Omit",[e,t],r)}function dI(e,t,r={}){let o=a.IsArray(t)?eo(t):t;return x({},Yo(e,o,r))}function hL(e,t){return a.Keys(e).reduce((o,i)=>t.includes(i)?o:{...o,[i]:e[i]},{})}function OL(e,t){let r=Xa(e),o=Jn(t),i=hL(r,o);return N(i)}function AL(e,t,r,o,i){let s=_(e,t,r),c=_(e,t,o);return f.Update(OL(s,c),{},i)}function fI(e,t,r,o,i){return k(e,[r,o])?AL(e,t,r,o,i):Yo(r,o,i)}function Kn(e,t){return R("Options",[e,t],{})}function Ja(e,t){return x({},Kn(e,t))}function SL(e,t,r,o){let i=_(e,t,r);return f.Update(i,{},o)}function gI(e,t,r,o){return k(e,[r])?SL(e,t,r,o):Kn(r,o)}function Qo(e,t={}){return R("Parameters",[e],t)}function yI(e,t={}){return x({},Qo(e,t))}function bL(e){return Ce(e)?_({},{callstack:[]},Me(e.parameters)):z()}function xL(e,t,r,o){let i=_(e,t,r);return f.Update(bL(i),{},o)}function EI(e,t,r,o){return k(e,[r])?xL(e,t,r,o):Qo(r,o)}function Wo(e,t={}){return R("Partial",[e],t)}function II(e,t={}){return x({},Wo(e,t))}function TI(e,t){let r=Kt(e,t),o=Pr(r);return $t(f.Assign(e,{[t]:o}),t)}function _I(e){let t=e.map(r=>Pr(r));return _e(t)}function hI(e){let t=e.map(r=>Pr(r));return G(t)}function OI(e){let t=a.Keys(e).reduce((o,i)=>({...o,[i]:ya(e[i])}),{});return N(t)}function Pr(e){return ae(e)?TI(e.$defs,e.$ref):U(e)?_I(e.allOf):O(e)?hI(e.anyOf):M(e)?OI(e.properties):N({})}function RL(e,t,r,o){let i=_(e,t,r);return f.Update(Pr(i),{},o)}function AI(e,t,r,o){return k(e,[r])?RL(e,t,r,o):Wo(r,o)}function Zo(e,t,r={}){return R("Pick",[e,t],r)}function SI(e,t,r={}){let o=a.IsArray(t)?eo(t):t;return x({},Zo(e,o,r))}function CL(e,t){return a.Keys(e).reduce((o,i)=>t.includes(i)?f.Assign(o,{[i]:e[i]}):o,{})}function PL(e,t){let r=Xa(e),o=Jn(t),i=CL(r,o);return N(i)}function UL(e,t,r,o,i){let s=_(e,t,r),c=_(e,t,o);return f.Update(PL(s,c),{},i)}function bI(e,t,r,o,i){return k(e,[r,o])?UL(e,t,r,o,i):Zo(r,o,i)}function Xo(e,t={}){return R("ReadonlyType",[e],t)}function xI(e,t={}){return x({},Xo(e,t))}function RI(e){return yr(Ct(e))}function CI(e,t){let r=Kt(e,t),o=Ur(r);return $t(f.Assign(e,{[t]:o}),t)}function PI(e){let t=e.map(r=>Ur(r));return _e(t)}function UI(e){let t=a.Keys(e).reduce((o,i)=>({...o,[i]:Ia(e[i])}),{});return N(t)}function NI(e){return yr(Me(e))}function LI(e){let t=e.map(r=>Ur(r));return G(t)}function Ur(e){return Z(e)?RI(e.items):ae(e)?CI(e.$defs,e.$ref):U(e)?PI(e.allOf):M(e)?UI(e.properties):H(e)?NI(e.items):O(e)?LI(e.anyOf):e}function NL(e,t,r,o){let i=_(e,t,r);return f.Update(Ur(i),{},o)}function kI(e,t,r,o){return k(e,[r])?NL(e,t,r,o):Xo(r,o)}function MI(e){return st(Ft,e)}function wI(e){return N({true:e,false:e})}function $I(e,t){let r=ri(e);return Nr(r,t)}function DI(e,t){return st(Dn,t)}function GI(e,t){let r=_e(e);return Nr(r,t)}function vI(e,t){return a.IsString(e)||a.IsNumber(e)?N({[e]:t}):a.IsEqual(e,!1)?N({false:t}):a.IsEqual(e,!0)?N({true:t}):N({})}function jI(e,t){return st(Gn,t)}function FI(e,t){return a.HasPropertyKey(e,"pattern")&&(a.IsString(e.pattern)||e.pattern instanceof RegExp)?st(e.pattern.toString(),t):st(Ft,t)}function BI(e,t){let r=Fa(e);return Ba(r)?Nr(He(e),t):st(e,t)}function LL(e){return e.some(t=>Oe(t)||le(t)||ke(t))}function kL(e,t){return a.IsEqual(LL(e),!0)?st(Ft,t):void 0}function ML(e,t){return e.reduce((r,o)=>V(o)&&(a.IsString(o.const)||a.IsNumber(o.const))?{...r,[o.const]:t}:r,{})}function wL(e,t){let r=ML(e,t);return N(r)}function qI(e,t){let r=qt(e),o=kL(r,t);return A(o)?o:wL(r,t)}function Nr(e,t){return We(e)?MI(t):Xe(e)?wI(t):Ie(e)?$I(e.enum,t):ke(e)?DI(e,t):U(e)?GI(e.allOf,t):V(e)?vI(e.const,t):le(e)?jI(e,t):O(e)?qI(e.anyOf,t):Oe(e)?FI(e,t):Te(e)?BI(e.pattern,t):N({})}function $L(e,t,r,o,i){let s=_(e,t,r),c=_(e,t,o);return f.Update(Nr(s,c),{},i)}function HI(e,t,r,o,i){return k(e,[r])?$L(e,t,r,o,i):$o(r,o,i)}function KI(e,t,r){return r in e?Ya([r],e,e[r])?he(r):_(e,t,e[r]):he(r)}function zI(e,t){let r=Kt(e,t),o=Lr(r);return $t(f.Assign(e,{[t]:o}),t)}function VI(e){let t=e.map(r=>Lr(r));return _e(t)}function YI(e){let t=e.map(r=>Lr(r));return G(t)}function QI(e){let t=a.Keys(e).reduce((o,i)=>({...o,[i]:Un(e[i])}),{});return N(t)}function Lr(e){return ae(e)?zI(e.$defs,e.$ref):U(e)?VI(e.allOf):O(e)?YI(e.anyOf):M(e)?QI(e.properties):N({})}function Jo(e,t={}){return R("Required",[e],t)}function WI(e,t={}){return x({},Jo(e,t))}function DL(e,t,r,o){let i=_(e,t,r);return f.Update(Lr(i),{},o)}function ZI(e,t,r,o){return k(e,[r])?DL(e,t,r,o):Jo(r,o)}function ei(e,t={}){return R("ReturnType",[e],t)}function XI(e,t={}){return x({},ei(e,t))}function GL(e){return Ce(e)?e.returnType:z()}function vL(e,t,r,o){let i=_(e,t,r);return f.Update(GL(i),{},o)}function JI(e,t,r,o){return k(e,[r])?vL(e,t,r,o):ei(r,o)}function eT(e){return f.Create({"~kind":"TemplateLiteral"},{type:"string",pattern:e},{})}function jL(e){return e.join("|")}function FL(e){return e.slice(1,e.length-1)}function BL(e,t,r){return kr(t,`${r}${e}`)}function qL(e,t){return kr(e,`${t}${Fl}`)}function HL(e,t){return kr(e,`${t}${Sa}`)}function KL(e,t){return kr(e,`${t}${xa}`)}function zL(e,t){return Kp(G([q("false"),q("true")]),e,t)}function VL(e,t){return kr(e,`${t}${Ca}`)}function YL(e,t,r){return kr(t,`${r}${FL(e)}`)}function QL(e,t,r,o=[]){let i=Pt(e);return Hp(i,t,r)}function Hp(e,t,r,o=[]){let[i,...s]=e;return A(i)?Hp(s,t,r,[...o,Kp(i,[],"")]):kr(t,`${r}(${jL(o)})`)}function Kp(e,t,r){return Ie(e)?QL(e.enum,t,r):ke(e)?HL(t,r):V(e)?BL(e.const,t,r):mt(e)?qL(t,r):Xe(e)?zL(t,r):le(e)?KL(t,r):Oe(e)?VL(t,r):Te(e)?YL(e.pattern,t,r):O(e)?Hp(e.anyOf,t,r):hl}function kr(e,t){let[r,...o]=e;return A(r)?Kp(r,o,t):t}function WL(e){return`^${kr(e,"")}$`}function tT(e){let t=WL(e);return eT(t)}function ZL(e,t,r,o){let i=dt(e,t,r);return f.Update(tT(i),{},o)}function rT(e,t,r,o){return k(e,r)?ZL(e,t,r,o):Do(r,o)}function XL(e){return Ar(e)?H(e.items)?zp(e.items.items):Ee(e.items)?[e]:oe(e.items)?[e]:[z()]:[e]}function zp(e){return e.reduce((r,o)=>[...r,...XL(o)],[])}function JL(e,t){return t in e}function ek(e,t){return U(t)?k(e,t.allOf):O(t)?k(e,t.anyOf):oe(t)?JL(e,t.$ref):!0}function k(e,t){let[r,...o]=t;return A(r)?ek(e,r)?k(e,o):!1:!0}function li(e,t,r){return gl(e)?li(e.type,"remove",r):ul(e)?li(e.type,t,"remove"):dl(e)?li(e.type,"add",r):cl(e)?li(e.type,t,"add"):[e,t,r]}function tk(e,t){return a.IsEqual(e,"remove")?Ea(t):a.IsEqual(e,"add")?ot(t):t}function rk(e,t){return a.IsEqual(e,"remove")?Un(t):a.IsEqual(e,"add")?nt(t):t}function ui(e,t,r){return a.Keys(r).reduce((o,i)=>({...o,[i]:_(e,t,r[i])}),{})}function Va(e,t,r){let o=dt(e,t,r);return zp(o)}function dt(e,t,r){return r.map(o=>_(e,t,o))}function nk(e,t,r,o,i){return a.IsEqual(r,"Awaited")?pE(e,t,o[0],i):a.IsEqual(r,"Capitalize")?EE(e,t,o[0],i):a.IsEqual(r,"Conditional")?OE(e,t,o[0],o[1],o[2],o[3],i):a.IsEqual(r,"ConstructorParameters")?SE(e,t,o[0],i):a.IsEqual(r,"Evaluate")?Ry(e,t,o[0],i):a.IsEqual(r,"Exclude")?Wa(e,t,o[0],o[1],i):a.IsEqual(r,"Extract")?NE(e,t,o[0],o[1],i):a.IsEqual(r,"Index")?QE(e,t,o[0],o[1],i):a.IsEqual(r,"InstanceType")?ZE(e,t,o[0],i):a.IsEqual(r,"Interface")?XE(e,t,o[0],o[1],i):a.IsEqual(r,"KeyOf")?iI(e,t,o[0],i):a.IsEqual(r,"Lowercase")?IE(e,t,o[0],i):a.IsEqual(r,"Mapped")?cI(e,t,o[0],o[1],o[2],o[3],i):a.IsEqual(r,"Module")?mI(e,t,o[0],i):a.IsEqual(r,"NonNullable")?lI(e,t,o[0],i):a.IsEqual(r,"Pick")?bI(e,t,o[0],o[1],i):a.IsEqual(r,"Options")?gI(e,t,o[0],o[1]):a.IsEqual(r,"Parameters")?EI(e,t,o[0],i):a.IsEqual(r,"Partial")?AI(e,t,o[0],i):a.IsEqual(r,"Omit")?fI(e,t,o[0],o[1],i):a.IsEqual(r,"ReadonlyType")?kI(e,t,o[0],i):a.IsEqual(r,"Record")?HI(e,t,o[0],o[1],i):a.IsEqual(r,"Required")?ZI(e,t,o[0],i):a.IsEqual(r,"ReturnType")?JI(e,t,o[0],i):a.IsEqual(r,"TemplateLiteral")?rT(e,t,o[0],i):a.IsEqual(r,"Uncapitalize")?TE(e,t,o[0],i):a.IsEqual(r,"Uppercase")?_E(e,t,o[0],i):R(r,o,i)}function _(e,t,r){let o=Qr(r),i=li(r,Wr(r)?"add":"none",xe(r)?"add":"none"),s=Et(i[0])?i[0].Clone():i[0],c=oe(s)?KI(e,t,s.$ref):Z(s)?Ct(_(e,t,s.items),Ta(s)):ze(s)?wt(_(e,t,s.iteratorItems),El(s)):Zn(s)?Qa(e,t,s.target,s.arguments):Re(s)?Er(dt(e,t,s.parameters),_(e,t,s.instanceType),Tl(s)):yl(s)?nk(e,t,s.action,s.parameters,s.options):Ce(s)?Ir(dt(e,t,s.parameters),_(e,t,s.returnType),_l(s)):U(s)?It(dt(e,t,s.allOf),Rl(s)):Ve(s)?Dt(_(e,t,s.iteratorItems),ql(s)):M(s)?N(ui(e,t,s.properties),Yl(s)):Be(s)?jt(_(e,t,s.item),Wl(s)):de(s)?Zl(ut(s),_(e,t,qe(s))):Ar(s)?en(_(e,t,s.items)):H(s)?Me(Va(e,t,s.items),Jl(s)):O(s)?G(dt(e,t,s.anyOf),ed(s)):s,u=o?yr(c):c;return tk(i[1],rk(i[2],u))}function x(e,t){return _(e,{callstack:[]},t)}function ti(e,t={}){return R("Awaited",[e],t)}function nT(e,t={}){return x({},ti(e,t))}function Ip(e,t={}){return R("Evaluate",[e],t)}function Nt(e,t={}){return x({},Ip(e,t))}function Tp(e,t={}){return R("Module",[e],t)}function oT(e,t={}){return x({},Tp(e,t))}function iT(...e){let[t,r,o]=te.Match(e,{2:(c,u)=>a.IsString(c)?[{},c,u]:[c,u,{}],3:(c,u,l)=>[c,u,l],1:c=>[{},c,{}]}),i=Wg(r),s=a.IsArray(i)&&a.IsEqual(i.length,2)?_(t,{callstack:[]},i[0]):z();return f.Update(s,{},o)}var n={};ht(n,{Any:()=>Ln,Array:()=>Ct,AsyncIterator:()=>wt,Awaited:()=>nT,Base:()=>_a,BigInt:()=>Mo,Boolean:()=>Aa,Call:()=>aE,Capitalize:()=>dE,Codec:()=>ha,Conditional:()=>hE,Constructor:()=>Er,ConstructorParameters:()=>AE,Cyclic:()=>$t,Decode:()=>Gl,DecodeBuilder:()=>ko,Encode:()=>vl,EncodeBuilder:()=>Lo,Enum:()=>xl,Evaluate:()=>Nt,Exclude:()=>bE,Extends:()=>Ke,ExtendsResult:()=>L,Extract:()=>CE,Function:()=>Ir,Generic:()=>Tr,Identifier:()=>wo,Immutable:()=>yr,Index:()=>qE,Infer:()=>No,InstanceType:()=>WE,Instantiate:()=>x,Integer:()=>Xr,Interface:()=>Yy,Intersect:()=>It,IsAny:()=>We,IsArray:()=>Z,IsAsyncIterator:()=>ze,IsBase:()=>Et,IsBigInt:()=>mt,IsBoolean:()=>Xe,IsCall:()=>Zn,IsCodec:()=>Zr,IsConstructor:()=>Re,IsCyclic:()=>ae,IsEnum:()=>Ie,IsFunction:()=>Ce,IsGeneric:()=>Nn,IsIdentifier:()=>Bl,IsImmutable:()=>Qr,IsInfer:()=>Ee,IsInteger:()=>ke,IsIntersect:()=>U,IsIterator:()=>Ve,IsKind:()=>h,IsLiteral:()=>V,IsNever:()=>Wt,IsNull:()=>Gt,IsNumber:()=>le,IsObject:()=>M,IsOptional:()=>xe,IsParameter:()=>Ql,IsPromise:()=>Be,IsReadonly:()=>Wr,IsRecord:()=>de,IsRef:()=>oe,IsRefine:()=>Oa,IsRest:()=>Ar,IsSchema:()=>A,IsString:()=>Oe,IsSymbol:()=>vt,IsTemplateLiteral:()=>Te,IsThis:()=>Xl,IsTuple:()=>H,IsUndefined:()=>Bt,IsUnion:()=>O,IsUnknown:()=>it,IsUnsafe:()=>rd,IsVoid:()=>lt,Iterator:()=>Dt,KeyOf:()=>JE,Literal:()=>q,Lowercase:()=>fE,Mapped:()=>pI,Module:()=>oT,Never:()=>z,NonNullable:()=>uI,Null:()=>Or,Number:()=>Tt,Object:()=>N,Omit:()=>dI,Optional:()=>ya,Options:()=>Ja,Parameter:()=>Jr,Parameters:()=>yI,Partial:()=>II,Pick:()=>SI,Promise:()=>jt,Readonly:()=>Ia,ReadonlyType:()=>xI,Record:()=>Pa,RecordKey:()=>vn,RecordKeyAsPattern:()=>ut,RecordValue:()=>qe,Ref:()=>he,Refine:()=>jl,Required:()=>WI,Rest:()=>en,ReturnType:()=>XI,Script:()=>iT,String:()=>at,Symbol:()=>$n,TemplateLiteral:()=>Jg,This:()=>Ua,Tuple:()=>Me,Uncapitalize:()=>gE,Undefined:()=>jn,Union:()=>G,Unknown:()=>je,Unsafe:()=>td,Uppercase:()=>yE,Void:()=>Na});var Vp=["CLUSTER_DB_QUERY_INVALID_CONNECTION_PARAMS","CLUSTER_DB_QUERY_INVALID_CREDENTIALS","CLUSTER_DB_QUERY_PERMISSION_DENIED","CLUSTER_DB_QUERY_QUERY_SYNTAX_ERROR","CLUSTER_DB_QUERY_DATABASE_UNREACHABLE","CLUSTER_DB_QUERY_CONNECTION_FAILED","CLUSTER_DB_QUERY_QUERY_EXECUTION_FAILED","CLUSTER_DB_QUERY_QUERY_TIMEOUT"],lce=n.Enum(Vp),ok=["CLUSTER_AGGREGATION_STRUCTURE"],dce=n.Object({code:n.Enum(Vp),message:n.String()}),aT=[...Vp,...ok,"ABORT_ERROR","BAD_REQUEST","DUPLICATE_KEY_VIOLATION","FOREIGN_KEY_VIOLATION","FST_ERR_VALIDATION","INVALID_INPUT","FORBIDDEN","MISSING_PERMISSION","PRIVILEGE_ESCALATION","ORG_NOT_FOUND_AUTHENTICATION_ERROR","RATE_LIMITED","RESERVED_TAG_POLICY_ERROR","RESOURCE_NOT_FOUND","INVALID_INVITATION","TAG_POLICY_ALREADY_EXISTS_ERROR","TAG_POLICY_VALIDATION_ERROR","UNAUTHORIZED","URL_NOT_FOUND"],sT=["INTERNAL_ERROR","INVALID_QUERY_TO_CLUSTER"];var ik=["NETWORK_ERROR","RESPONSE_PARSE_ERROR"],ak=[...aT,...sT,...ik],fce=n.Object({code:n.Optional(n.Enum(ak,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ErrorResponse",description:"Standard envelope for API errors"}),gce=n.Object({code:n.Optional(n.Enum(aT,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ClientErrorResponse",description:"Standard envelope for client (4XX) API errors"}),yce=n.Object({code:n.Optional(n.Enum(sT,{description:"Machine readable error code describing what went wrong"})),message:n.String({description:"Human readable explanation of the error"}),statusCode:n.Number({description:"HTTP status code that was returned"})},{$id:"ServerErrorResponse",description:"Standard envelope for server (5XX) API errors"}),Ece=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ClientErrorResponse")},{$id:"ClientErrorEnvelope",description:"Standard envelope wrapping all client (4XX) error responses"}),Ice=n.Object({requestId:n.String({description:"Identifier used to trace the lifecycle of this API request"}),error:n.Ref("ServerErrorResponse")},{$id:"ServerErrorEnvelope",description:"Standard envelope wrapping all server (5XX) error responses"});var pT="lowercase-email",Yp="iana-timezone",Qp="simple-time",Wp="simple-date-time";var sk=(e,t)=>RegExp(`^${e.source}(${t.source}${e.source})*$`),pk=/[a-zA-Z0-9-_]+/,ck=/\./,_ce=sk(pk,ck);var cT="lowercase-domain";var es="kebab-case";var mT="camel-case";var mk=new Set;function b(e,t,r={}){let o=t.map(i=>{let s=i;return s.$id?(mk.add(i),n.Ref(s.$id)):i});return n.Unsafe({...r,type:"object",discriminator:{propertyName:e},required:[e],oneOf:o})}var Ue={limit:n.Optional(n.Integer({minimum:1,maximum:1e3,description:"The maximum number of items to return"})),offset:n.Optional(n.Integer({minimum:0,description:"The offset of the first item to return"}))},uk=n.Object({totalCount:n.Integer({description:"The total number of items matching the query"}),pageCount:n.Integer({description:"The total number of pages available"})}),bce=n.Object({pagination:uk},{$id:"ResponseMetadata"});function T(e={}){return n.Unsafe({...e,type:"string"})}function m({allowEmpty:e=!0,type:t="short",description:r}={}){let o=e?0:1,i=r===void 0?{}:{description:r};switch(t){case"camel-case":return n.String({format:mT,minLength:o,maxLength:250,...i});case"kebab-case":return n.String({format:es,minLength:o,maxLength:250,...i});case"email":return n.String({format:pT,minLength:o,maxLength:254,errorMessage:{format:"Must be a valid lowercase email address."},...i});case"lowercase-domain":return n.String({format:cT,minLength:o,maxLength:250,...i});case"tsuga-query":return n.String({format:"tsuga-query",minLength:o,maxLength:1e4,...i});case"tags-query":return n.String({format:"tags-query",minLength:o,maxLength:1e4,errorMessage:{format:"Must be a valid tags query: only tag:value searches (no wildcards), boolean operators, and parentheses are supported. The query you provided is invalid: ${0}"},...i});case"date-time":return n.String({format:"date-time",...i});case"uri":return n.String({format:"uri",...i});case"user-password":return n.String({format:"user-password",minLength:12,maxLength:250,...i});case"long":return n.String({minLength:o,maxLength:5e4,...i});case"short":return n.String({minLength:o,maxLength:250,...i});case"tsuga-formula":return n.String({format:"tsuga-formula",minLength:o,maxLength:250,errorMessage:{format:"Must be a simple mathematical formula, and all variables in it should refer to queries (q1, q2, etc.). The formula you provided is invalid: ${0}"},...i});case"time":return n.String({format:"time",...i});case"readonly-sql-query":return n.String({format:"readonly-sql-query",minLength:o,maxLength:5e4,errorMessage:{format:"Must be a readonly SQL query - only SELECT statements are allowed."},...i});default:xt(t)}}function d({body:e,description:t,method:r,operationId:o,params:i,tags:s,query:c,paginated:u,response:l,url:g}){return i?{buildUrl:I=>g.replace(/:[a-zA-Z_]+/g,P=>I[P.slice(1)]),method:r,params:i,response:l,templateUrl:g,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...u===void 0?{}:{paginated:u},...s===void 0?{}:{tags:s}}:{method:r,response:l,url:g,templateUrl:g,...e===void 0?{}:{body:e},...t===void 0?{}:{description:t},...o===void 0?{}:{operationId:o},...c===void 0?{}:{query:c},...u===void 0?{}:{paginated:u},...s===void 0?{}:{tags:s}}}function uT(e,t){if(!t||typeof t!="object")return e;let r=new URLSearchParams;return Object.entries(t).forEach(([o,i])=>{Array.isArray(i)?i.length>0&&i.forEach(s=>{s!==void 0&&(typeof s=="string"||typeof s=="number"||typeof s=="boolean")&&r.append(o,String(s))}):(typeof i=="boolean"||typeof i=="string"||typeof i=="number")&&r.append(o,String(i))}),`${e}?${r.toString()}`}var lk="x-tsuga-session-id",Zp="x-tsuga-source",Xp="x-tsuga-source-version",Jp="x-tsuga-source-commit",ec="x-tsuga-source-date",dk="x-request-id",wce={[lk]:"Session identifier for request correlation",[Zp]:"SDK or client source identifier (e.g., web-frontend, terraform-provider)",[Xp]:"SDK version",[Jp]:"SDK commit hash",[ec]:"SDK commit date",[dk]:"Unique identifier for this API request, useful for debugging and support"};var an=class e extends Error{constructor(r,o,i,s){super(r);this.statusCode=o;this.code=i;this.requestId=s;this.name="CliError"}static fromErrorResponse(r,o){return new e(r.message,r.statusCode,r.code,o)}};function lT(e){if(e instanceof an){let t=[`Error: ${e.message}`];return e.code&&t.push(`Code: ${e.code}`),e.statusCode&&t.push(`Status: ${e.statusCode}`),e.requestId&&t.push(`Request ID: ${e.requestId}`),t.join(`
34
+ `)}return e instanceof Error?`Error: ${e.message}`:String(e)}function dT(e,t,r){return async function(i,s={}){let{body:c,params:u,query:l}=s,g;if(i.url!==void 0)g=i.url;else if(i.buildUrl){if(!u)throw new an("Internal error: params required for this endpoint");g=i.buildUrl(u)}else throw new an("Internal error: endpoint has neither url nor buildUrl");let E=r===void 0?l:{clusterId:r,...l},I=uT(`${e}${g}`,E),P={Accept:"application/json",Authorization:`Bearer ${t}`,[Zp]:"cli",[Xp]:"1.0.10",[Jp]:"3664f0d",[ec]:"2026-05-22T13:59:10.148Z"};c&&(P["Content-Type"]="application/json");let ve=await(await fetch(I,{method:i.method,headers:P,body:c?JSON.stringify(c):null})).json();if(ve.error)throw an.fromErrorResponse(ve.error,ve.requestId);return ve.data}}var v=n.Object({success:n.Literal(!0,{description:"Indicates the resource was deleted successfully"})},{$id:"DeleteResponse",example:{success:!0}});var fk=["asset-change","cluster-integration-config","explorer-saved-view","crawler-integration-config","inventory","saml-config","sensitive-data-scanner-rule","service","team-remap-config","user-data","user-self","monitor-alert","monitor-debugging","retention-policy","org","allowed-domains","custom-usage-tag"],gk=["ingestion-api-key","operation-api-key","audit-log","dashboard","dashboard-report","inventory-settings","log-route","monitor","notification-integration","notification-rule","notification-silence","quality-report","slo","tag-policy","team","team-members","user-invitation","user-permissions"],yk=["log","metric","trace"],Ek=[...gk,...yk],Yce=[...fk,...Ek];var rs=["admin","public_editor","public_viewer","teams_only"],ro=["admin","editor","viewer"];var sn="/v0/team-membership",tc=n.Object({id:n.String(),userId:n.String(),teamId:n.String(),roleKey:n.Enum(ro)}),fT=n.Object({userId:m({allowEmpty:!1}),teamId:m({allowEmpty:!1}),roleKey:n.Enum(ro)}),Ik=n.Object({userId:m({allowEmpty:!1}),teamId:m({allowEmpty:!1})}),Tk=n.Optional(n.Object({userId:n.Optional(m({allowEmpty:!1})),teamId:n.Optional(m({allowEmpty:!1}))})),Qce=d({tags:["access-control"],url:sn,method:"GET",query:Tk,response:n.Array(tc)}),Wce=d({tags:["access-control"],url:sn,method:"POST",body:fT,response:tc}),Zce=d({tags:["access-control"],url:sn,method:"PUT",body:fT,response:tc}),Xce=d({tags:["access-control"],url:sn,method:"DELETE",body:Ik,response:v}),ts=500,_k=n.Object({teamId:m({allowEmpty:!1}),members:n.Array(n.Object({userId:n.Optional(m({allowEmpty:!1})),userEmail:n.Optional(m({allowEmpty:!1,type:"email"})),roleKey:n.Enum(ro)},{oneOf:[{required:["userId"]},{required:["userEmail"]}]}),{minItems:1,maxItems:ts})}),hk=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["added","already_member","user_not_found"])}))}),Jce=d({tags:["access-control"],url:`${sn}/bulk-add`,method:"POST",body:_k,response:hk}),eme=d({tags:["access-control"],url:`${sn}/bulk-update-user-roles`,method:"PUT",body:n.Object({userIds:n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:ts}),teamId:m({allowEmpty:!1}),role:n.Enum(ro)}),response:n.Object({})}),Ok=n.Object({teamId:m({allowEmpty:!1}),userIds:n.Optional(n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:ts})),userEmails:n.Optional(n.Array(m({allowEmpty:!1,type:"email"}),{minItems:1,maxItems:ts}))},{oneOf:[{required:["userIds"]},{required:["userEmails"]}]}),Ak=n.Object({results:n.Array(n.Object({userId:n.String(),status:n.Enum(["removed","not_member","user_not_found"])}))}),tme=d({tags:["access-control"],url:`${sn}/bulk-remove`,method:"DELETE",body:Ok,response:Ak});var ns="/v0/admin",we=`${ns}/clusters`,yT=n.Object({helmParameters:n.Record(n.String(),n.String()),helmVersion:n.String()}),gT=n.Record(n.String(),yT),oc=["eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3","us-east-1","us-east-2","us-west-1","us-west-2","af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-northeast-3","ap-south-1","ap-south-2","ap-southeast-1","ap-southeast-2","ap-southeast-3","ap-southeast-4","ap-southeast-5","ap-southeast-7","ca-central-1","ca-west-1","il-central-1","me-central-1","me-south-1","mx-central-1","sa-east-1"],ic=["europe-west1","europe-west2","europe-west3","europe-west4","europe-west6","europe-west9","europe-central2","europe-north1","us-central1","us-east1","us-east4","us-west1","us-west2","us-west3","us-west4","northamerica-northeast1","southamerica-east1","asia-east1","asia-east2","asia-northeast1","asia-northeast2","asia-northeast3","asia-south1","asia-south2","asia-southeast1","asia-southeast2","australia-southeast1","australia-southeast2"],ac=["australiacentral","australiacentral2","australiaeast","australiasoutheast","austriaeast","belgiumcentral","brazilsouth","brazilsoutheast","canadacentral","canadaeast","centralindia","centralus","chilecentral","eastasia","eastus","eastus2","francecentral","francesouth","germanynorth","germanywestcentral","indonesiacentral","israelcentral","italynorth","japaneast","japanwest","jioindiacentral","jioindiawest","koreacentral","koreasouth","malaysiawest","mexicocentral","newzealandnorth","northcentralus","northeurope","norwayeast","norwaywest","polandcentral","qatarcentral","southafricanorth","southafricawest","southcentralus","southeastasia","southindia","spaincentral","swedencentral","switzerlandnorth","switzerlandwest","uaecentral","uaenorth","uksouth","ukwest","westcentralus","westeurope","westindia","westus","westus2","westus3"],ET=["aws","gcp","azure"],di=["xs","s","m","l"],sc=["1.0"],Sk={id:n.String(),name:n.String(),createdAt:T(),clusterCertificateExpiresAt:T(),bridgeEndpoint:n.String(),deployerEndpoint:n.String(),targetConfiguration:gT,appliedConfiguration:n.Optional(gT),automaticallyDeployLatestVersion:n.Boolean(),automatedDeploymentDisabledBy:n.Optional(n.String()),automatedDeploymentDisabledReason:n.Optional(n.String()),automatedDeploymentDisabledAt:n.Optional(T()),soakTimeMin:n.Optional(n.Number()),clusterSize:n.Optional(n.Enum(di))},rc={...Sk,orgId:n.String(),orgName:n.String()},pme=d({tags:["admin"],method:"GET",url:we,query:n.Object({orgId:n.Optional(m())}),response:n.Array(b("clusterType",[n.Object({...rc,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(sc)),clusterRegion:n.Enum(oc)}),n.Object({...rc,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(ic)}),n.Object({...rc,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(ac)})]))}),cme=d({tags:["admin"],method:"PUT",url:`${we}/create`,body:b("clusterType",[n.Object({clusterType:n.Literal("aws"),orgId:m(),name:m(),clusterSize:n.Enum(di),clusterAccountId:n.String({minLength:12,maxLength:12}),clusterBuilderRoleVersion:n.Enum(sc),clusterRegion:n.Enum(oc)}),n.Object({clusterType:n.Literal("gcp"),orgId:m(),name:m(),clusterSize:n.Enum(di),clusterAccountId:m(),clusterRegion:n.Enum(ic)}),n.Object({clusterType:n.Literal("azure"),orgId:m(),name:m(),clusterSize:n.Enum(di),clusterTenantId:m(),clusterSubscriptionId:m(),clusterRegion:n.Enum(ac)})]),response:n.Object({id:n.String(),bridgeEndpoint:n.String(),deployerEndpoint:n.String()})}),mme=d({tags:["admin"],method:"DELETE",url:`${we}/:id`,params:n.Object({id:m()}),body:n.Object({orgId:m()}),response:v}),ume=d({tags:["admin"],method:"PUT",url:`${we}/add-inbounder-key`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),lme=d({tags:["admin"],method:"PUT",url:`${we}/replace-all-inbounder-keys`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),dme=d({tags:["admin"],method:"PUT",url:`${we}/replace-inbounder-key`,body:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToReplace:m()}),response:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKey:n.String()})}),fme=d({tags:["admin"],method:"PUT",url:`${we}/delete-inbounder-key`,body:n.Object({orgId:m(),clusterId:m(),inbounderAuthenticationKeyToDelete:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyDeleted:n.Boolean()})}),gme=d({tags:["admin"],method:"PUT",url:`${we}/rotate-deployer-key`,body:n.Object({orgId:m(),clusterId:m(),newKey:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyUpdated:n.Boolean()})}),yme=d({tags:["admin"],method:"PUT",url:`${we}/rotate-bridge-key`,body:n.Object({orgId:m(),clusterId:m(),newKey:m()}),response:n.Object({orgId:m(),clusterId:m(),isKeyUpdated:n.Boolean()})}),nc={central:n.String(),ngrokBridgeDomain:n.String(),ngrokDeployerDomain:n.String(),clusterCertificateExpiresAt:T(),clusterName:n.String(),clusterSize:n.Optional(n.Enum(di)),secretBridgeAuthenticationKey:n.String(),secretDeployerAuthenticationKey:n.String(),secretOutbounderAuthenticationKey:n.String(),secretMonitoringApiKey:n.String(),slackChannelEmail:n.String()},Eme=d({tags:["admin"],method:"POST",url:`${we}/:id`,body:n.Object({orgId:m()}),params:n.Object({id:m()}),response:b("clusterType",[n.Object({...nc,clusterType:n.Literal("aws"),clusterAccountId:n.String(),clusterBuilderRoleVersion:n.Optional(n.Enum(sc)),clusterRegion:n.Enum(oc)}),n.Object({...nc,clusterType:n.Literal("gcp"),clusterAccountId:n.String(),clusterRegion:n.Enum(ic)}),n.Object({...nc,clusterType:n.Literal("azure"),clusterTenantId:n.String(),clusterSubscriptionId:n.String(),clusterRegion:n.Enum(ac)})])}),Ime=d({tags:["admin"],method:"POST",url:`${we}/configuration`,body:n.Object({id:m(),orgId:m(),installationName:m(),targetConfiguration:yT}),response:n.Object({status:n.String()})}),Tme=d({tags:["admin"],method:"POST",url:`${we}/automation`,body:n.Object({id:m(),orgId:m(),enableAutomatedDeployment:n.Boolean(),disabledReason:n.Optional(m())}),response:n.Object({status:n.String()})}),_me=d({tags:["admin"],method:"POST",url:`${we}/soak-time`,body:n.Object({id:m(),orgId:m(),soakTimeMin:n.Optional(n.Number())}),response:n.Object({status:n.String()})}),hme=d({tags:["admin"],method:"POST",url:`${we}/deploy`,body:n.Object({orgId:m(),clusterId:m(),chartName:m(),toVersion:m()}),response:n.Object({id:n.String()})}),bk=b("type",[n.Object({type:n.Literal("pending")}),n.Object({type:n.Literal("running")}),n.Object({type:n.Literal("cancelled")}),n.Object({type:n.Literal("timed_out")}),n.Object({type:n.Literal("success"),stateValue:n.Object({message:n.String()})}),n.Object({type:n.Literal("failure"),stateValue:n.Object({message:n.String()})})]),Ome=d({tags:["admin"],method:"GET",url:`${we}/deploy`,query:n.Object({orgId:n.Optional(m()),clusterId:n.Optional(m())}),response:n.Array(n.Object({id:n.String(),orgId:n.String(),orgName:n.String(),clusterId:n.String(),clusterName:n.String(),fromVersion:n.Optional(n.String()),toVersion:n.String(),state:bk,updatedAt:T(),createdAt:T(),installationName:n.String(),chartName:n.String(),isAutomated:n.Boolean(),createdBy:n.Optional(n.String()),createdByName:n.Optional(n.String()),createdByEmail:n.Optional(n.String())}))}),xk=n.Object({installations:n.Array(n.Object({installationName:n.String(),parameters:n.Record(n.String(),n.String()),version:n.Union([n.String(),n.Null()]),resources:n.Array(n.Object({id:n.Object({kind:n.String(),name:n.String()}),status:n.String(),health:n.String(),rawDetails:n.Optional(n.Any()),liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())})),deployedAt:n.Optional(n.String()),syncStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String())}))}),Ame=d({tags:["admin"],method:"POST",url:`${we}/status`,body:n.Object({orgId:n.Optional(m()),clusterId:n.Optional(m())}),response:n.Array(n.Object({orgId:n.String(),clusterId:n.String(),status:xk}))}),Sme=d({tags:["admin"],method:"POST",url:`${we}/argocd-cert-info`,body:n.Object({orgId:m(),clusterId:m()}),response:n.Object({certificateExpiresAt:n.String()})}),Rk=n.Object({kind:n.String(),name:n.String()}),Ck=n.Object({id:Rk,liveManifest:n.Optional(n.String()),targetManifest:n.Optional(n.String())}),bme=d({tags:["admin"],method:"POST",url:`${we}/resource-details`,body:n.Object({orgId:m(),clusterId:m(),installationName:m()}),response:n.Object({resources:n.Array(Ck)})}),xme=d({tags:["admin"],method:"GET",url:`${we}/versions`,query:n.Object({chartName:n.Optional(m())}),response:n.Array(n.Object({id:n.String(),chartName:n.String(),locator:n.String(),version:n.String(),repositoryArn:n.String(),type:n.Optional(n.String()),commitHash:n.Optional(n.String()),lastPulledAt:n.Optional(T()),pushedAt:n.Optional(T())}))}),Pk=n.Object({id:n.Object({name:n.String(),kind:n.String()}),previewManifest:n.Optional(n.String())}),Rme=d({tags:["admin"],method:"POST",url:`${we}/versions/render`,body:n.Object({chartName:m(),version:m(),values:m({type:"long"}),installationName:m(),namespace:m()}),response:n.Array(Pk)}),er=`${ns}/orgs`,Cme=d({tags:["admin"],url:er,method:"GET",query:n.Object({onlyDeleted:n.Optional(n.Boolean())}),response:n.Array(n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String()),createdAt:T(),updatedAt:T()}))}),Pme=d({tags:["admin"],url:er,method:"POST",body:n.Object({emailDomains:n.Array(m({type:"lowercase-domain"}),{maxItems:20}),name:m()}),response:n.Object({id:n.String(),name:n.String()})}),Ume=d({tags:["admin"],url:`${er}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Object({allowedDomains:n.Optional(n.Array(m({type:"lowercase-domain"}),{maxItems:20}))}),response:n.Object({id:n.String(),name:n.String(),allowedDomains:n.Array(n.String())})}),Nme=d({tags:["admin"],url:`${er}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),Lme=d({tags:["admin"],url:`${er}/:id/restore`,method:"POST",params:n.Object({id:m()}),response:n.Object({success:n.Boolean()})}),kme=d({tags:["admin"],url:`${er}/:id/permanent-delete`,method:"DELETE",params:n.Object({id:m()}),response:n.Object({success:n.Boolean(),hasDeletedSecret:n.Boolean(),hasDeletedTenantDb:n.Boolean(),hasDeletedOrgRow:n.Boolean()})}),Mme=d({tags:["admin"],url:`${er}/synchronize-sds-rules`,method:"POST",response:n.Object({errorOrgs:n.Optional(n.Array(n.Object({id:n.String(),name:n.String()}))),synchronizedOrgsCount:n.Number()})}),Uk=["custom_usage_tag","ingestion_api_key","inventory_resource","monitor","retention_policy","route","sensitive_data_scanner_rule","tag_policy","team"],Nk=n.Enum(Uk),wme=d({tags:["admin"],url:`${er}/refresh-assets`,method:"POST",body:n.Object({assetTypes:n.Array(Nk,{minItems:1}),orgId:n.Optional(m({allowEmpty:!1}))}),response:n.Array(n.Object({orgId:n.String(),orgName:n.String(),results:n.Record(n.String(),n.Object({success:n.Boolean()}))}))}),$me=d({tags:["admin"],url:`${er}/sudo`,method:"POST",body:n.Object({orgId:m()}),response:n.Object({sudoToken:n.String()})}),Lk=`${ns}/users`,Dme=d({tags:["admin"],url:`${Lk}/invite`,method:"POST",body:n.Object({email:m({type:"email"}),orgId:m(),userRole:n.Enum(rs)}),response:n.Array(n.Object({inviteId:n.String(),email:n.String(),result:n.Union([n.Literal("success"),n.Literal("email-failed")])}))});var Gme=d({tags:["admin"],url:`${ns}/billing-data`,method:"GET",query:n.Object({orgId:m(),maxDaysFetched:n.Optional(n.Number({minimum:1,maximum:365}))}),response:n.Object({dataPoints:n.Array(n.Object({date:n.String(),telemetryKind:n.Union([n.Literal("logs"),n.Literal("metrics"),n.Literal("traces")]),totalBytes:n.Number(),clusterId:n.String(),apiKeyId:n.String(),apiKeyName:n.String(),teamName:n.String()})),availableFilters:n.Object({clusters:n.Array(n.Object({id:n.String(),name:n.String()})),apiKeys:n.Array(n.Object({id:n.String(),name:n.String()})),teamNames:n.Array(n.String())})})});var IT=n.Object({id:n.String({description:"Unique identifier of the Tsuga cluster containing your observability data"}),name:n.String({description:"Internal name of the Tsuga cluster"}),friendlyName:n.Optional(n.String({description:"Human-readable display name set by an operator"})),clusterType:n.Enum(ET,{description:"Cloud provider hosting the Tsuga cluster"}),clusterRegion:n.String({description:"Region where the Tsuga cluster is deployed"})},{$id:"Cluster",description:"A Tsuga cluster containing your observability data"}),kk={id:"abc-123-def",name:"production",friendlyName:"Production (US)",clusterType:"aws",clusterRegion:"us-east-1"};Object.assign(IT,{examples:[kk]});var TT=d({description:"Retrieve all clusters",operationId:"listClusters",tags:["clusters"],url:`/${"v1"}/clusters`,method:"GET",response:n.Array(IT)});var tr=require("node:fs"),_T=require("node:os"),pc=require("node:path"),hT=(0,pc.join)((0,_T.homedir)(),".config","tsuga"),no=(0,pc.join)(hT,"config.json"),Mk="https://api.tsuga.com";function Mr(){if(!(0,tr.existsSync)(no))return{};try{return JSON.parse((0,tr.readFileSync)(no,"utf-8"))}catch{throw new Error(`Config file corrupted: ${no}
35
+ Re-run: tsuga auth <token>`)}}function fi(e){(0,tr.mkdirSync)(hT,{recursive:!0,mode:448}),(0,tr.writeFileSync)(no,`${JSON.stringify(e,null,2)}
36
+ `,{mode:384})}function cc(e){let t=Mr(),r=e.operationApiKey??process.env.TSUGA_OPERATION_API_KEY??t.operationApiKey,o=e.clusterId?.trim()||process.env.TSUGA_CLUSTER_ID?.trim()||t.clusterId?.trim()||void 0;return{apiUrl:Mk,operationApiKey:r,clusterId:o}}function mc(e){let t={};try{t=Mr()}catch{}fi({...t,...e})}function OT(){return(0,tr.existsSync)(no)||!!process.env.TSUGA_OPERATION_API_KEY}function uc(){return no}var lc={from:"-30m",to:"now",query:"*","max-results":"100"};function AT(){return Mr().defaults??{}}function rr(e){return(Mr().defaults??{})[e]??lc[e]}function ST(e,t){let r={};try{r=Mr()}catch{}let o={...r.defaults??{},[e]:t};fi({...r,defaults:o})}function bT(){let e={};try{e=Mr()}catch{}let{defaults:t,...r}=e;fi(r)}function dc(e){let t=e?.trim()||void 0,r={};try{r=Mr()}catch{}if(t===void 0){let{clusterId:o,...i}=r;fi(i)}else fi({...r,clusterId:t})}function xT(){return Mr().lastUpdateCheck}function RT(e){mc({lastUpdateCheck:e})}function fc(e){process.stdout.write(`${e}
37
+ `)}function ie(e){fc(JSON.stringify(e,null,2))}var CT=["json","tsv","csv"];function PT(e){let t=CT.find(r=>r===e);if(t!==void 0)return t;throw new Error(`--output must be one of: ${CT.join(", ")} (got: ${e})`)}function UT(e){let t=e.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(t.length===0)throw new Error("--fields must contain at least one field name");return t}function NT(e,t){let r=e;for(let o of t.split(".")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function LT(e,t){let r=Object.create(null);for(let o of t){let i=NT(e,o);if(i===void 0)continue;let s=o.split("."),c=s.pop();if(c===void 0)continue;let u=r;for(let l of s)(typeof u[l]!="object"||u[l]===null)&&(u[l]=Object.create(null)),u=u[l];u[c]=i}return r}function kT(e){return e==null?null:typeof e=="string"?e:JSON.stringify(e)}var wk={"\\":"\\\\"," ":"\\t","\r":"\\r","\n":"\\n"};function $k(e){let t=kT(e);return t===null?"":t.replace(/[\\\t\r\n]/g,r=>wk[r]??r)}function Dk(e){let t=kT(e);return t===null?"":/[,"\n\r]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function MT(e,t,r){if(t.length===0)return"";let o=e==="csv"?",":" ",i=e==="csv"?Dk:$k,s=r.map(u=>i(u)).join(o),c=t.map(u=>r.map(l=>i(NT(u,l))).join(o));return[s,...c].join(`
38
+ `)}function wT(e,t){let r=e.command("cluster").description("Manage Tsuga cluster selection. A Tsuga cluster contains your observability data.");r.command("list").description("List all Tsuga clusters available to the operation API key").action(async()=>{let o=await t()(TT);ie(o)}),r.command("use <cluster-id>").description("Set the current Tsuga cluster (saved to ~/.config/tsuga/config.json)").action(o=>{dc(o),process.stdout.write(`Current Tsuga cluster set to ${o}
39
+ `)}),r.command("reset").description("Clear the saved current Tsuga cluster").action(()=>{dc(void 0),process.stdout.write(`Current Tsuga cluster cleared
40
+ `)})}var $T=`/${"v1"}/docs`,DT=n.Object({path:n.String(),title:n.String(),content:n.String({description:"Raw markdown content of the documentation page"})},{$id:"DocPage",description:"A documentation page with its raw markdown content"}),Gk={path:"getting-started/send-your-first-logs",title:"Send your first logs",content:`# Send your first logs
41
+ ...`};Object.assign(DT,{examples:[Gk]});var GT=n.Object({path:n.String(),title:n.String(),score:n.Number({description:"Relevance score between 0 and 1 (higher is more relevant)"}),excerpt:n.String({description:"Short snippet of matching content"}),link:n.String({description:"URL to the documentation page in the Tsuga app"})},{$id:"DocSearchResult",description:"A documentation search result"}),vk={path:"getting-started/send-your-first-logs",title:"Send your first logs",score:.9,excerpt:"...send your first logs to Tsuga using the ingestion API...",link:"https://www.app.tsuga.com/documentation/getting-started/send-your-first-logs"};Object.assign(GT,{examples:[vk]});var vT=d({description:"Retrieve the raw markdown content of a documentation page by its path",operationId:"getDocPage",tags:["docs"],url:$T,method:"GET",query:n.Object({path:m({allowEmpty:!1})}),response:DT}),jT=d({description:"Full-text search across documentation pages",operationId:"searchDocs",tags:["docs"],url:`${$T}/search`,method:"GET",query:n.Object({query:m({allowEmpty:!1})}),response:n.Array(GT)});function FT(e,t){let r=e.command("docs").description("Browse and search documentation");r.command("get <path>").description("Get a documentation page by path (e.g. 'getting-started/send-your-first-logs')").action(async o=>{let i=await t()(vT,{query:{path:o}});ie(i)}),r.command("search <query>").description("Search documentation pages").action(async o=>{let i=await t()(jT,{query:{query:o}});ie(i)})}var Q="context";var aue=`${Q}.team`,sue=`${Q}.env`,pue=`${Q}.api_key_id`,cue=`${Q}.service.name`,mue=`${Q}.service.version`;var jk=`${Q}.host.name`,Fk=`${Q}.instance`,Bk=`${Q}.instanceid`,qk=`${Q}.instance_name`,uue=`${Q}.telemetry.sdk.language`,lue=`${Q}.k8s.cluster.name`,due=`${Q}.k8s.cluster.uid`,fue=`${Q}.k8s.namespace.name`,gue=`${Q}.k8s.pod.name`,yue=`${Q}.k8s.pod.uid`,Eue=`${Q}.k8s.container.name`,Iue=`${Q}.k8s.node.name`,Tue=`${Q}.k8s.node.uid`,_ue=`${Q}.k8s.deployment.name`,hue=`${Q}.k8s.deployment.uid`,Oue=`${Q}.k8s.replicaset.name`,Aue=`${Q}.k8s.replicaset.uid`,Sue=`${Q}.k8s.statefulset.name`,bue=`${Q}.k8s.statefulset.uid`,xue=`${Q}.k8s.daemonset.name`,Rue=`${Q}.k8s.daemonset.uid`,Cue=`${Q}.k8s.job.name`,Pue=`${Q}.k8s.job.uid`,Uue=`${Q}.k8s.cronjob.name`,Nue=`${Q}.k8s.cronjob.uid`;var Lue={name:"tsuga.internal.processing_tag_policy_violations_total",attributes:{tagPolicyId:`${Q}.tag_policy_id`,dataSource:`${Q}.data_source`}};var kue={name:"tsuga.internal.event_size_bytes",attributes:{batchKind:`${Q}.batch_kind`,batchKindMetricsFilter:`${Q}.batch_kind:metrics`,sourceApiKeyId:`${Q}.source_api_key_id`,sourceEnv:`${Q}.source_env`,sourceTeam:`${Q}.source_team`}},Hk="__tsuga_metadata__",Mue=`${Hk}.signature`;var qT=1456444800,HT=4927737600,Kk=qT*1e3,zk=HT*1e3,os=1704067200,gc=os*1e3,KT={title:"TimeRange",description:"Time range to query",examples:[{from:os,to:os}]},zT={title:"TimeRange",description:"Time range to query",examples:[{from:gc,to:gc}]},is=e=>n.Integer({description:e,examples:[os],minimum:qT,maximum:HT,format:"int64"}),BT=e=>n.Integer({description:e,examples:[gc],minimum:Kk,maximum:zk,format:"int64"}),ft=n.Object({from:n.Optional(is("Start timestamp in seconds")),to:n.Optional(is("End timestamp in seconds"))},KT),At=n.Object({from:is("Start timestamp in seconds"),to:is("End timestamp in seconds")},KT),Due=n.Object({from:n.Integer({description:"Start timestamp in milliseconds"}),to:n.Integer({description:"End timestamp in milliseconds"})},zT),VT=n.Object({from:BT("Start timestamp in milliseconds"),to:BT("End timestamp in milliseconds")},zT);var pn="/v0/service-catalog";var YT=n.Object({team:n.String(),lastSeenAt:T()}),Vk=n.Object({ingestionApiKey:n.String(),lastSeenAt:T()}),QT=n.Object({version:n.String(),firstSeenAt:T(),lastSeenAt:T(),faulty:n.Optional(n.Boolean())}),Yk=n.Object({language:n.String(),lastSeenAt:T()}),as=n.Object({id:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(YT),ingestionApiKeys:n.Array(Vk),versions:n.Array(QT),languages:n.Array(Yk),lastSeenAt:T(),firstSeenAt:T(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),logsCount24h:n.Number(),errorLogsCount24h:n.Number(),tracesCount24h:n.Number(),errorTracesCount24h:n.Number(),createdAt:T(),updatedAt:T()}),Hue=d({tags:["service-catalog"],query:n.Object({...Ue,clusterId:n.Optional(m())}),method:"GET",paginated:!0,url:`${pn}/services`,response:n.Array(as)}),Kue=d({tags:["service-catalog"],method:"GET",url:`${pn}/services/:serviceId`,params:n.Object({serviceId:m()}),response:as}),Qk=n.Object({id:n.String(),endpointName:n.String(),serviceName:n.String(),serviceNamespace:n.Optional(n.String()),env:n.Optional(n.String()),teams:n.Array(YT),versions:n.Array(QT),lastSeenAt:T(),firstSeenAt:T(),sources:n.Array(n.String()),additionalUserFields:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),createdAt:T(),updatedAt:T()}),zue=d({tags:["service-catalog"],method:"GET",url:`${pn}/endpoints`,response:n.Array(Qk)}),Wk=["otel_kube","otel_host_kube","otel_host","prometheus","aws_ec2","gcp_compute_engine"];var WT=n.Object({id:n.String(),hostName:n.String(),env:n.Optional(n.String()),cpuUtilizationAverage:n.Number(),hostType:n.Enum(Wk),teams:n.Array(n.String()),tags:n.Array(n.String()),firstSeenAt:T(),lastSeenAt:T(),clusterId:n.String()}),Vue=d({tags:["service-catalog"],method:"GET",url:`${pn}/hosts`,response:n.Array(WT)}),Yue=d({tags:["service-catalog"],method:"GET",url:`${pn}/hosts/:hostId`,params:n.Object({hostId:m()}),response:WT}),Zk=n.Object({serviceName:n.String(),id:n.Union([n.String(),n.Null()]),namespace:n.Union([n.String(),n.Null()]),cluster:n.String(),env:n.Union([n.String(),n.Null()])}),Xk=n.Object({from:n.String(),to:n.String(),count:n.Number()}),Que=d({tags:["service-catalog"],url:`${pn}/services/:serviceId/graph`,method:"GET",params:n.Object({serviceId:m()}),query:n.Object({...ft.properties,query:n.Optional(m({type:"tsuga-query"}))}),response:n.Object({nodes:n.Array(Zk),edges:n.Array(Xk)})}),Wue=d({tags:["service-catalog"],method:"GET",url:`${pn}/services/by-api-keys`,response:n.Record(n.String(),n.Array(n.Object({serviceName:n.String(),serviceNamespace:n.Optional(n.String())})))});var yc=`/${"v1"}/services`,Ec=n.Pick(as,["id","serviceName","serviceNamespace","env","teams","versions","languages","lastSeenAt","firstSeenAt","sources","logsCount24h","errorLogsCount24h","tracesCount24h","errorTracesCount24h"],{$id:"Service",description:"Observed telemetry service with metadata, activity stats and version signals"}),Jk={id:"123-456-abc",serviceName:"api-gateway",serviceNamespace:"platform",env:"production",teams:[{team:"platform",lastSeenAt:"2024-01-15T12:34:56.000Z"}],versions:[{version:"1.2.3",firstSeenAt:"2024-01-01T08:00:00.000Z",lastSeenAt:"2024-01-15T12:34:56.000Z",faulty:!1}],languages:[{language:"go",lastSeenAt:"2024-01-15T12:34:56.000Z"}],lastSeenAt:"2024-01-15T12:34:56.000Z",firstSeenAt:"2024-01-01T08:00:00.000Z",sources:["logs","metrics","traces"],logsCount24h:12e3,errorLogsCount24h:42,tracesCount24h:8500,errorTracesCount24h:17};Object.assign(Ec,{examples:[Jk]});var ZT=d({description:"Retrieve all services",operationId:"listServices",tags:["services"],url:yc,method:"GET",paginated:!0,query:n.Object({...Ue,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:n.Array(Ec)}),XT=d({description:"Retrieve a service by its id",operationId:"getService",tags:["services"],url:`${yc}/:serviceId`,method:"GET",params:n.Object({serviceId:m({allowEmpty:!1})}),response:Ec}),eM=n.Object({serviceName:n.String({description:"Service name"}),id:n.Union([n.String(),n.Null()],{description:"Service ID from catalog, null if unknown"}),namespace:n.Union([n.String(),n.Null()],{description:"Service namespace from catalog, null if unknown"}),cluster:n.String({description:"Cluster ID"}),env:n.Union([n.String(),n.Null()],{description:"Environment observed from spans"})}),JT=d({description:"Retrieve the dependency graph for a service, showing which services call each other",operationId:"getServiceGraph",tags:["services"],url:`${yc}/:serviceId/graph`,method:"GET",params:n.Object({serviceId:m({allowEmpty:!1})}),query:n.Object({...ft.properties,query:n.Optional(m({type:"tsuga-query"}))}),response:n.Object({nodes:n.Array(eM),edges:n.Array(n.Object({from:n.String(),to:n.String(),count:n.Number()}))})});var ale=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));var yle=60*1e3;var Xle=1/1e6,aM=1e3,sM=60*aM,pM=60*sM,ps=24*pM,Jle=7*ps,ede=30*ps;var Tc=["past-5-minutes","past-15-minutes","past-30-minutes","past-1-hour","past-2-hours","past-4-hours","past-6-hours","past-12-hours","past-24-hours","past-2-days","past-3-days","past-7-days","past-30-days","past-3-months","current-day","current-week","current-month","current-year","previous-day","previous-week","previous-month","previous-3-months","previous-year"];var cM={s:1,m:60,h:3600,d:86400};function t_(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<48||r>57)return!1}return!0}function r_(){return Math.floor(Date.now()/1e3)}function cs(e){if(typeof e=="number")return e;if(e==="now")return r_();if(e.startsWith("-")&&e.length>=3){let r=e.at(-1),o=r?cM[r]:void 0;if(o){let i=e.slice(1,-1);if(i.length>0&&t_(i))return r_()-parseInt(i,10)*o}}if(t_(e)&&e.length>0)return parseInt(e,10);let t=Date.parse(e);if(!Number.isNaN(t))return Math.floor(t/1e3);throw new Error(`Invalid time value: ${e}. Use unix seconds, relative (-30m, -1h), 'now', or ISO 8601.`)}function n_(e,t){let r=t??rr(e);return r===void 0?void 0:cs(r)}function _c(e){let t=rr(e);return t===void 0?"":` (default: ${t})`}function o_(e,t){e.command("service-graph").description("Inspect service dependency graphs").command("get <serviceId>").description("Retrieve the dependency graph for a service").option("--from <timestamp>",`Start of time range${_c("from")}`).option("--to <timestamp>",`End of time range${_c("to")}`).option("--query <query>",`Search query${_c("query")}`).action(async(o,i)=>{let s={},c=n_("from",i.from),u=n_("to",i.to);c!==void 0&&(s.from=c),u!==void 0&&(s.to=u),i.query!==void 0&&(s.query=i.query);let l=await t()(JT,{params:{serviceId:o},query:s});ie(l)})}var i_=n.Object({type:n.Literal("number"),number:n.String()}),mM=n.Object({type:n.Literal("string"),string:n.String()}),uM=n.Object({type:n.Literal("timestamp"),timestamp:n.String()}),hc=b("type",[i_,mM,uM]),lM=n.Object({by:n.Record(n.String(),hc),computed:n.Record(n.String(),i_)}),dM=n.Object({type:n.Literal("buckets"),buckets:n.Array(lM)}),fM=n.Object({type:n.Literal("distribution"),bounds:n.Array(n.Number()),buckets:n.Array(n.Object({timestamp:n.Number(),counts:n.Array(n.Number())})),percentiles:n.Optional(n.Array(n.Number()))}),a_=b("type",[dM,fM]);var gM="/v0/aggregation",yM=n.Union([n.Literal("a"),n.Literal("d"),n.Literal("q"),n.Literal("w"),n.Literal("t")]),EM=n.Object({parallelism:n.Number(),engine:yM,recordBatchCache:n.Optional(n.Boolean()),includeNullGroups:n.Optional(n.Boolean()),restartAwareGaugeSum:n.Optional(n.Boolean())}),Lt=["logs","metrics","traces"],IM={logs:"Logs",metrics:"Metrics",traces:"Traces"},TM=[...Lt,"connections","log-patterns"],_de={...IM,connections:"Connections","log-patterns":"Log Patterns"},hde=n.Enum(TM,{description:"Data source being queried"}),wr=n.Enum(Lt,{description:"Data source being queried for this aggregation"}),cn=n.String({description:"Attribute containing the values to aggregate"}),mn=m({description:"Attribute containing the values to aggregate"}),_M=b("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(cn)},{$id:"AggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:cn},{$id:"AggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:cn},{$id:"AggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:cn},{$id:"AggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:cn},{$id:"AggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:cn},{$id:"AggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:cn,percentile:n.Number()},{$id:"AggregatePercentile",title:"Percentile"})],{title:"Aggregate"}),hM=b("type",[n.Object({type:n.Literal("count",{description:"Counts the total number of records"}),field:n.Optional(mn)},{$id:"InputAggregateCount",title:"Count"}),n.Object({type:n.Literal("unique-count",{description:"Counts the distinct values of the field"}),field:mn},{$id:"InputAggregateUniqueCount",title:"UniqueCount"}),n.Object({type:n.Literal("average",{description:"Calculates the average value of the selected field"}),field:mn},{$id:"InputAggregateAverage",title:"Average"}),n.Object({type:n.Literal("max",{description:"Finds the largest value of the field"}),field:mn},{$id:"InputAggregateMax",title:"Max"}),n.Object({type:n.Literal("min",{description:"Finds the smallest value of the field"}),field:mn},{$id:"InputAggregateMin",title:"Min"}),n.Object({type:n.Literal("sum",{description:"Sums the values of the selected field"}),field:mn},{$id:"InputAggregateSum",title:"Sum"}),n.Object({type:n.Literal("percentile",{description:"Calculates a percentile of the selected field"}),field:mn,percentile:n.Number()},{$id:"InputAggregatePercentile",title:"Percentile"})],{title:"InputAggregate"}),c_=n.Object({type:n.Literal("per-second",{description:"Normalizes the metric to events per second"})},{$id:"FunctionPerSecond",title:"PerSecond"}),m_=n.Object({type:n.Literal("per-minute",{description:"Normalizes the metric to events per minute"})},{$id:"FunctionPerMinute",title:"PerMinute"}),u_=n.Object({type:n.Literal("per-hour",{description:"Normalizes the metric to events per hour"})},{$id:"FunctionPerHour",title:"PerHour"}),l_=n.Object({type:n.Literal("rate",{description:"Calculates the rate of change"})},{$id:"FunctionRate",title:"Rate"}),d_=n.Object({type:n.Literal("increase",{description:"`Increase` is designed for cumulative metrics. It computes the increase of cumulative metrics by automatically handling counter resets. When used with an aggregation such as `sum` it combines all series without requiring an explicit group-by."})},{$id:"FunctionIncrease",title:"Increase"}),f_=n.Object({type:n.Literal("power",{description:"Raises values to a specified power"}),exponent:n.Integer({description:"The exponent to raise values to"})},{$id:"FunctionPower",title:"Power"}),g_=n.Object({type:n.Literal("sqrt",{description:"Applies a square root transformation to the values"})},{$id:"FunctionSqrt",title:"Sqrt"}),y_=n.Object({type:n.Literal("last",{description:"Takes the last value of the metric for the selected time frame"})},{$id:"FunctionLast",title:"Last"}),OM=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:n.String({description:"Duration of the rolling window"})},{$id:"FunctionRolling",title:"Rolling"}),AM=n.Object({type:n.Literal("rolling",{description:"Computes a rolling window aggregate"}),window:m({allowEmpty:!1,description:"Duration of the rolling window"})},{$id:"InputFunctionRolling",title:"Rolling"}),SM=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm"})},{$id:"FunctionLog",title:"Log"}),bM=n.Object({type:n.Literal("log",{description:"Applies a logarithm transformation to the values"}),base:n.Integer({description:"The base of the logarithm",minimum:2})},{$id:"InputFunctionLog",title:"Log"}),xM=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset"})},{$id:"FunctionTimeOffset",title:"TimeOffset"}),RM=n.Object({type:n.Literal("time-offset",{description:"Shifts a query's data backward by a specified duration for easy comparison over different periods of time."}),seconds:n.Integer({description:"Number of seconds to offset",minimum:1})},{$id:"InputFunctionTimeOffset",title:"TimeOffset"}),CM=b("type",[c_,m_,u_,l_,d_,OM,SM,f_,g_,y_,xM],{title:"Function"}),PM=b("type",[c_,m_,u_,l_,d_,AM,bM,f_,g_,y_,RM],{title:"InputFunction"});var s_=n.Object({min:n.Number(),max:n.Number()}),p_=n.Integer({minimum:1}),UM=b("type",[n.Object({type:n.Literal("scalar")},{title:"Scalar",description:"Returns a single value"}),n.Object({type:n.Literal("timeseries"),aggregationWindow:m({description:'Time bucket size for aggregation (e.g. "10s", "60s", "1m")'})},{title:"Timeseries",description:"Returns a time series"}),n.Object({type:n.Literal("histogram"),by:n.Optional(m()),bucketCount:n.Optional(p_),bounds:n.Optional(s_),percentiles:n.Optional(n.Array(n.Number({minimum:0,maximum:100,multipleOf:1}),{minItems:1}))},{title:"Histogram",description:"Returns a single distribution over the entire time range"}),n.Object({type:n.Literal("heatmap"),aggregationWindow:m({description:'Time bucket size for the heatmap (e.g. "10s", "60s", "1m")'}),by:n.Optional(m()),bucketCount:n.Optional(p_),bounds:n.Optional(s_)},{title:"Heatmap",description:"Returns a distribution per time window"})]),Oc=15,NM=["zero","null"],LM=n.Enum(NM),E_=n.Object({mode:n.Object({type:LM})}),I_={aggregate:_M,functions:n.Optional(n.Array(CM,{description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(E_)},T_={aggregate:hM,functions:n.Optional(n.Array(PM,{maxItems:10,description:"Post-processing functions applied to aggregation results"})),fill:n.Optional(E_)},kM={description:"Aggregations that may be combined together in the same query"},__={maxItems:Oc,description:"Aggregations that may be combined together in the same query"},h_=n.Array(n.Object({...I_,filter:n.Optional(n.String({description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),kM),gi=n.Array(n.Object({...T_,filter:n.Optional(m({type:"tsuga-query",description:"Filter to apply to the aggregation"}))},{title:"AggregationQuery"}),__),oo=n.Array(n.Object({...I_,filter:n.String({description:"Filter to apply to the aggregation"})},{title:"MonitorAggregationQuery"})),io=n.Array(n.Object({...T_,filter:m({type:"tsuga-query"})},{title:"MonitorAggregationQuery"}),__);var O_=n.String({description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),yi=m({type:"tsuga-formula",description:"Formula referencing query outputs (e.g. q1+q2) to compute derived series"}),MM=n.Object({fields:n.Array(n.String()),limit:n.Number()},{title:"AggregationGroupBy"}),wM=n.Object({fields:n.Array(m(),{maxItems:1}),limit:n.Number()},{title:"AggregationGroupBy"}),$M=7;var Ac=n.Array(MM,{description:"Fields used to group the results"}),ao=n.Array(wM,{maxItems:$M,description:"Fields used to group the results"}),Ode=d({tags:["aggregation"],url:`${gM}/multi-query`,method:"POST",body:n.Object({timeRange:VT,queries:gi,groupBy:n.Optional(ao),returnType:UM,dataSource:wr,formula:yi,executionOptions:EM,triggeredBy:n.Optional(n.Literal("refresh")),shouldStreamResults:n.Optional(n.Boolean()),clusterId:n.Optional(m({allowEmpty:!1}))}),response:a_}),DM=["per-second","per-minute","per-hour","rate"],un=n.Enum(DM),Ade=b("type",[n.Object({type:n.Literal("count"),count:n.Object({field:n.Optional(m()),timeNormalization:n.Optional(un)})}),n.Object({type:n.Literal("average"),average:n.Object({field:m(),timeNormalization:n.Optional(un)})}),n.Object({type:n.Literal("min"),min:n.Object({field:m(),timeNormalization:n.Optional(un)})}),n.Object({type:n.Literal("max"),max:n.Object({field:m(),timeNormalization:n.Optional(un)})}),n.Object({type:n.Literal("sum"),sum:n.Object({field:m(),timeNormalization:n.Optional(un)})}),n.Object({type:n.Literal("percentile"),percentile:n.Object({field:m(),percentile:n.Number(),timeNormalization:n.Optional(un)})}),n.Object({type:n.Literal("uniqueCount"),uniqueCount:n.Object({field:m(),timeNormalization:n.Optional(un)})})]),GM=n.Object({type:n.Literal("time"),time:n.Object({interval:m()})}),vM=n.Object({type:n.Literal("histogram"),histogram:n.Object({field:m(),interval:n.Number(),bounds:n.Optional(n.Object({min:n.Number(),max:n.Number()}))})}),jM=n.Object({type:n.Literal("topList"),topList:n.Object({field:m(),size:n.Number(),orderBy:n.Optional(n.Object({computeRef:m(),order:n.Union([n.Literal("asc"),n.Literal("desc")])}))})}),Sde=b("type",[GM,vM,jM]);var Sc=["red","orange","amber","yellow","green","emerald","teal","cyan","sky","blue","indigo","purple","pink"],bc=["light","dark"];var FM={light:{red:{text:"foreground.red",background:"avatar.background.red"},orange:{text:"foreground.orange",background:"avatar.background.orange"},amber:{text:"foreground.amber",background:"avatar.background.amber"},yellow:{text:"foreground.yellow",background:"avatar.background.yellow"},green:{text:"foreground.green",background:"avatar.background.green"},emerald:{text:"foreground.emerald",background:"avatar.background.emerald"},teal:{text:"foreground.teal",background:"avatar.background.teal"},cyan:{text:"foreground.cyan",background:"avatar.background.cyan"},sky:{text:"foreground.sky",background:"avatar.background.sky"},blue:{text:"foreground.blue",background:"avatar.background.blue"},indigo:{text:"foreground.indigo",background:"avatar.background.indigo"},purple:{text:"foreground.purple",background:"avatar.background.purple"},pink:{text:"foreground.pink",background:"avatar.background.pink"}},dark:{red:{text:"avatar.foreground.foreground",background:"avatar.solid-background.red"},orange:{text:"avatar.foreground.foreground",background:"avatar.solid-background.orange"},amber:{text:"avatar.foreground.foreground",background:"avatar.solid-background.amber"},yellow:{text:"avatar.foreground.foreground",background:"avatar.solid-background.yellow"},green:{text:"avatar.foreground.foreground",background:"avatar.solid-background.green"},emerald:{text:"avatar.foreground.foreground",background:"avatar.solid-background.emerald"},teal:{text:"avatar.foreground.foreground",background:"avatar.solid-background.teal"},cyan:{text:"avatar.foreground.foreground",background:"avatar.solid-background.cyan"},sky:{text:"avatar.foreground.foreground",background:"avatar.solid-background.sky"},blue:{text:"avatar.foreground.foreground",background:"avatar.solid-background.blue"},indigo:{text:"avatar.foreground.foreground",background:"avatar.solid-background.indigo"},purple:{text:"avatar.foreground.foreground",background:"avatar.solid-background.purple"},pink:{text:"avatar.foreground.foreground",background:"avatar.solid-background.pink"}},gradient:{red:"var(--chakra-colors-gradient-red)",orange:"var(--chakra-colors-gradient-orange)",amber:"var(--chakra-colors-gradient-amber)",yellow:"var(--chakra-colors-gradient-yellow)",green:"var(--chakra-colors-gradient-green)",emerald:"var(--chakra-colors-gradient-emerald)",teal:"var(--chakra-colors-gradient-teal)",cyan:"var(--chakra-colors-gradient-cyan)",sky:"var(--chakra-colors-gradient-sky)",blue:"var(--chakra-colors-gradient-blue)",indigo:"var(--chakra-colors-gradient-indigo)",purple:"var(--chakra-colors-gradient-purple)",pink:"var(--chakra-colors-gradient-pink)"}},A_=["activity-heart","activity","airplay","airpods","alarm-clock","anchor","annotation-dots","annotation-heart","annotation-question","annotation","announcement-03","asterisk-01","atom-01","atom-02","award-03","award-04","award-05","backpack","bank-note-01","bank-note-02","bank-note-03","battery-charging-01","beaker-01","beaker-02","bell-03","bell-04","bell-ringing-03","bell-ringing-04","bluetooth-connect","bluetooth-on","book-closed","book-open-01","book-open-02","bookmark","briefcase-01","briefcase-02","brush-01","brush-02","brush-03","building-01","building-02","building-03","building-08","bus","calculator","calendar-check-01","calendar-date","calendar-heart-01","calendar","camera-01","camera-lens","car-01","certificate-01","certificate-02","check-heart","clipboard-attachment","clipboard-check","clipboard-download","clipboard","clock-snooze","clock-stopwatch","cloud-01","cloud-lightning","cloud-moon","cloud-raining-01","cloud-raining-03","cloud-raining-05","cloud-raining-06","cloud-snowing-01","cloud-sun-01","cloud-sun-02","cloud-sun-03","code-browser","code-circle-01","code-circle-02","code-circle-03","code-square-01","code-square-02","coins-hand","coins-stacked-01","colors","compass-01","compass-02","compass-03","compass","credit-card-01","credit-card-02","cube-02","cube-04","cube-outline","currency-bitcoin-circle","currency-dollar-circle","currency-ethereum-circle","currency-euro-circle","currency-pound-circle","currency-ruble-circle","currency-rupee-circle","currency-yen-circle","cursor-click-01","cursor-click-02","diamond-01","diamond-02","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","disc-01","disc-02","droplets-01","droplets-02","droplets-03","dropper","face-content","face-frown","face-happy","face-neutral","face-sad","face-smile","face-wink","feather","file-02","file-05","file-06","file-heart-01","file-heart-02","file-search-01","file-search-02","file-search-03","film-01","film-02","fingerprint-03","fingerprint-04","flag-01","flag-04","flash-off","flash","gaming-pad-01","gaming-pad-02","gift-01","glasses-01","glasses-02","globe-03","globe-04","globe-05","globe-06","globe-slated-01","globe-slated-02","graduation-hat-01","graduation-hat-02","hash-01","hash-02","headphones-01","headphones-02","heart-circle","heart-hand","heart-hexagon","heart-octagon","heart-rounded","heart-square","hearts","hexagon-01","hexagon-02","home-03","home-smile","hourglass-01","hourglass-02","hourglass-03","hurricane-01","hurricane-02","hurricane-03","image-01","image-02","image-03","image-04","image-05","keyboard-01","laptop-01","life-buoy-01","life-buoy-02","lightbulb-02","lightbulb-03","lightbulb-04","lock-keyhole-circle","lock-keyhole-square","luggage-01","luggage-02","luggage-03","magic-wand-01","magic-wand-02","map-01","map-02","mark","marker-pin-01","marker-pin-04","marker-pin-05","marker-pin-06","medical-circle","medical-cross","medical-square","message-chat-square","message-notification-square","message-smile-square","message-text-square-02","microphone-01","microphone-02","microscope","modem-01","modem-02","monitor-03","monitor-04","monitor-05","moon-01","moon-eclipse","moon-star","music-note-01","music-note-02","music-note-plus","octagon","palette","paperclip","pentagon","phone-01","phone-02","phone-call-01","phone","piggy-bank-01","pin-01","pin-02","plane","play-circle","play-square","podcast","power-02","presentation-chart-01","printer","receipt","recording-01","recording-02","recording-03","rocket-01","rocket-02","roller-brush","rss-01","rss-02","ruler","scales-01","scales-02","server-06","shield-01","shield-02","shield-03","shield-dollar","shield-zap","shopping-bag-01","shopping-cart-01","signal-01","signal-02","signal-03","simcard","sliders-01","sliders-02","snowflake-01","snowflake-02","speaker-01","speaker-02","speaker-03","speedometer-01","speedometer-02","speedometer-03","speedometer-04","square","stand","star-03","star-07","sticker-circle","sticker-square","sun-setting-01","sun-setting-02","sun-setting-03","sun","sunrise","sunset","tablet-01","tag-01","tag-02","tag-03","target-01","target-02","target-03","target-04","target-05","terminal-browser","terminal-circle","terminal-square","thermometer-02","thermometer-03","thermometer-cold","thermometer-warm","thumbs-down","thumbs-up","ticket-01","tool-01","tool-02","train","tram","translate-01","triangle","trophy-01","trophy-02","truck-01","truck-02","tv-02","umbrella-01","umbrella-02","umbrella-03","virus","voicemail","wallet-01","wallet-02","wallet-05","watch-circle","watch-square","waves","webcam-01","webcam-02","wind-01","wind-02","wind-03","youtube","zap-circle","zap-fast","zap"];var xde=FM.light.red.background;var BM="^\\S(.*\\S)?$",qM=128,HM=256,KM=n.Object({key:n.String(),value:n.String()},{title:"Tag"}),zM=n.Object({key:n.String({maxLength:qM}),value:n.String({maxLength:HM,pattern:BM})},{title:"Tag"}),xc=n.Array(KM,{title:"Tags",description:"List of key/value tags applied to the resource"}),Ei=n.Array(zM,{title:"Tags",maxItems:50,description:"List of key/value tags applied to the resource"}),Ye=n.Optional(xc),ct=n.Optional(Ei);var $r="/v0/teams",us=["public","private"],ms={NAME:"name",CREATED_AT:"createdAt",MEMBER_COUNT:"memberCount",VISIBILITY:"visibility"},VM=n.Enum([ms.NAME,ms.CREATED_AT,ms.MEMBER_COUNT,ms.VISIBILITY]),S_=n.Object({color:n.Enum(Sc),mode:n.Enum(bc),iconName:n.Enum(A_)}),Rc=n.Object({color:n.Enum(Sc),mode:n.Enum(bc)}),YM=100,QM=250,so=n.Object({id:n.String({description:"Identifier of the team"}),name:n.String({description:"Human readable team name displayed throughout the app"}),description:n.Optional(n.String()),visibility:n.Enum(us,{description:"Controls whether the resources of the team are discoverable by users"}),tags:Ye,createdAt:T(),updatedAt:T(),memberCount:n.Optional(n.Number({description:"Number of members currently in the team"})),avatar:n.Optional(S_)}),ls=n.Object({name:n.String({minLength:1,maxLength:YM,description:"Name to assign to the team"}),description:n.Optional(n.String({maxLength:QM})),visibility:n.Enum(us,{description:"Controls whether the resources of the team are discoverable by users"}),tags:ct,avatar:n.Optional(S_)}),WM=n.Object({id:n.String(),name:n.String(),email:n.String(),role:n.Enum(ro),joinedTeamAt:T(),orgRole:n.Enum(rs),avatar:n.Optional(Rc)}),Dde=d({tags:["teams"],url:$r,method:"GET",paginated:!0,response:n.Array(so),query:n.Object({...Ue,includeMemberCount:n.Optional(n.Boolean()),searchQuery:n.Optional(m()),visibility:n.Optional(n.Enum(us)),myTeamsOnly:n.Optional(n.Boolean()),sortBy:n.Optional(VM),sortDirection:n.Optional(n.Enum(["asc","desc"]))})}),Gde=d({tags:["teams"],url:`${$r}/:id`,method:"GET",params:n.Object({id:m()}),response:so}),vde=d({tags:["teams"],url:`${$r}/:id/members`,method:"GET",params:n.Object({id:m()}),response:n.Array(WM)}),jde=d({tags:["teams"],url:`${$r}/:id/assets`,method:"GET",params:n.Object({id:m()}),response:n.Object({apiKeyCount:n.Number(),logRouteCount:n.Number(),monitorCount:n.Number(),notificationRuleCount:n.Number(),dashboardCount:n.Number()})}),Fde=d({tags:["teams"],url:$r,method:"POST",body:ls,response:so}),Bde=d({tags:["teams"],url:`${$r}/:id`,method:"PUT",params:n.Object({id:m()}),body:ls,response:so}),qde=d({tags:["teams"],url:`${$r}/bulk-update`,method:"POST",body:n.Object({teamIds:n.Array(m(),{maxItems:100}),config:n.Object({visibility:n.Enum(us)})}),response:n.Object({})}),Hde=d({tags:["teams"],url:`${$r}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v});var ZM=n.Enum(["terraform-provider","web-frontend","mcp-server","cli"]),Ae=b("type",[n.Object({type:n.Literal("user"),id:n.String(),name:n.String(),avatar:n.Optional(Rc)}),n.Object({type:n.Literal("operation-api-key"),id:n.String(),name:n.String(),source:n.Optional(ZM)})]);var Dr="/v0/dashboards",b_=["white","gray.100","amber.200","lime.200","emerald.200","cyan.200","blue.200","violet.200","fuchsia.200","pink.200","red.200"],XM=["bar","bar-connection","distribution","list-connection","list-log-patterns","list","pie","pie-connection","query-value","query-value-connection","table","timeseries-connection","timeseries","top-list-connection","top-list"],ife=[...XM,"note"];var JM=["ns","us","ms","s","m","h","days"];var e0=["B","KB","MB","GB","TB","PB"];var t0=20;var x_=n.Object({type:n.Literal("duration",{description:"Normalizes values as durations using standard time units"}),unit:n.Enum(JM,{description:"Time unit used to present the normalized values"})},{$id:"DataNormalizerDuration",title:"Duration"}),R_=n.Object({type:n.Literal("data",{description:"Normalizes values as data sizes using byte units"}),unit:n.Enum(e0,{description:"Data size unit used to present the normalized values"})},{$id:"DataNormalizerData",title:"Data"}),C_=n.Object({type:n.Literal("percent",{description:"Format values as percentages"})},{$id:"DataNormalizerPercent",title:"Percent"}),P_=n.Object({type:n.Literal("date",{description:"Formats values as calendar dates"})},{$id:"DataNormalizerDate",title:"Date"}),U_=n.Object({type:n.Literal("level",{description:"Displays values using their log level name"})},{$id:"DataNormalizerLevel",title:"Level"}),r0=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit"})},{$id:"DataNormalizerCustom",title:"Custom"}),n0=n.Object({type:n.Literal("custom",{description:"Normalizes values using a custom unit label"}),unit:n.String({description:"Text label describing the custom unit",maxLength:t0})},{$id:"InputDataNormalizerCustom",title:"Custom"}),nr=b("type",[x_,R_,C_,P_,U_,r0],{title:"Normalizer"}),or=b("type",[x_,R_,C_,P_,U_,n0],{title:"Normalizer"}),N_=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(nr)},{title:"WidgetListColumn"}),L_=n.Object({attribute:n.String({description:"Attribute (log field or database row column) displayed as a column in the list"}),normalizer:n.Optional(or)},{title:"WidgetListColumn"}),gs=["background","no-background"],o0=["table","legend-only","no-legend"];var i0=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"],k_=["alert","warning","success"],po=n.Object({operator:n.Enum(i0,{description:"Comparator used to evaluate the metric value"}),value:n.Number({description:"Threshold value used when evaluating the operator"}),color:n.Enum(k_,{description:"Color applied when the condition is met"})},{title:"ConditionalFormatting"}),a0=n.Object({value:n.Number({description:"Y-axis value where the threshold marker is placed"}),level:n.Enum(k_,{description:"Level applied to the threshold marker"})},{title:"ThresholdMarker"}),s0=["sec","min","hour","day"],ys=n.Object({time:n.Number({description:"Number of units that make up each bar bucket"}),metric:n.Enum(s0,{description:"Unit used to measure the bucket width"})});var ds=n.Enum(["flex-start","center","flex-end"],{description:"Flex alignment keyword used for widget layout"}),p0=n.Object({formula:n.Optional(n.String({description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),n.String({description:"Optional alias for a query (only used for display in the UI)"})))}),c0=n.Object({formula:n.Optional(m({type:"short",description:"Optional alias for formula (only used for display in the UI)"})),queries:n.Optional(n.Record(n.String(),m({type:"short",description:"Optional alias for a query (only used for display in the UI)"})))}),Cc={source:wr,queries:h_,formula:n.Optional(O_),aliases:n.Optional(p0),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Pc={source:wr,queries:gi,formula:n.Optional(yi),aliases:n.Optional(c0),visibleSeries:n.Optional(n.Array(n.Boolean(),{description:"Flags indicating whether each query or formula series is visible"}))},Ii={...Cc,groupBy:n.Optional(Ac)},Ti={...Pc,groupBy:n.Optional(ao)},Je=n.Enum(o0,{description:"Controls whether and how the widget displays legend or series details (e.g. table, legend-only, or no legend)"}),et=n.Optional(n.Number({description:"Number of decimal places to display in the value"})),Gr=n.Optional(n.Array(a0,{description:"Threshold markers displayed on the chart"})),m0=n.Object({name:n.String({description:"Display name of the table column"}),...Cc,source:wr,normalizer:n.Optional(nr),precision:et},{title:"TableColumn"}),u0=n.Object({name:m({description:"Display name of the table column"}),...Pc,source:wr,normalizer:n.Optional(or),precision:et},{title:"TableColumn"}),l0=n.Array(n.Object({id:n.String({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),d0=n.Array(n.Object({id:m({description:"ID of the column to sort by"}),desc:n.Boolean({description:"Whether the sort is descending"})},{title:"TableDefaultSorting"})),M_=["horizontal","vertical"],f0=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:n.String({description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(N_,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationList",title:"List"}),g0=n.Object({type:n.Literal("list",{description:"Displays matching logs in a tabular list"}),query:m({type:"tsuga-query",description:"Query that selects logs for the list"}),listColumns:n.Optional(n.Array(L_,{description:"Custom columns to display for each log"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationList",title:"List"}),fs=b("type",[n.Object({type:n.Literal("auto")}),n.Object({type:n.Literal("number"),value:n.Number()})]),Es=n.Object({min:fs,max:fs,scale:b("type",[n.Object({type:n.Literal("pow"),exponent:n.Number()}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),Is=n.Object({min:fs,max:fs,scale:b("type",[n.Object({type:n.Literal("pow"),exponent:n.Number({minimum:0})}),n.Object({type:n.Enum(["linear","log","sqrt"])})]),alwaysIncludeZero:n.Boolean()}),y0=n.Array(n.Integer({description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"}),E0=n.Array(n.Integer({minimum:0,maximum:100,description:"Marker value expressed as a percentage between 0 and 100"}),{description:"Percentile markers displayed on top of the distribution chart"});var I0=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(Je),thresholds:Gr,yAxisSettings:n.Optional(Es)},{$id:"GraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),T0=n.Object({type:n.Literal("timeseries-connection",{description:"Displays the database rows-based aggregation as a time series chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(Je),thresholds:Gr,yAxisSettings:n.Optional(Is)},{$id:"InputGraphVisualizationTimeseriesConnection",title:"TimeseriesConnection"}),_0=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),query:n.String({description:"The read-only SQL query to execute against the connection."}),listColumns:n.Optional(n.Array(N_,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"GraphVisualizationListConnection",title:"ListConnection"}),h0=n.Object({type:n.Literal("list-connection",{description:"Displays database rows as a tabular list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),query:m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),listColumns:n.Optional(n.Array(L_,{description:"Custom columns to display for each database row"})),listColumnsSize:n.Optional(n.Record(n.String(),n.Number({description:"List column width by column id"})))},{$id:"InputGraphVisualizationListConnection",title:"ListConnection"}),O0=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."}))},{$id:"GraphVisualizationTopListConnection",title:"TopListConnection"}),A0=n.Object({type:n.Literal("top-list-connection",{description:"Displays the database rows-based aggregation as a ranked top list"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1})},{$id:"InputGraphVisualizationTopListConnection",title:"TopListConnection"}),S0=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(Je)},{$id:"GraphVisualizationPieConnection",title:"PieConnection"}),b0=n.Object({type:n.Literal("pie-connection",{description:"Displays the database rows-based aggregation as a pie chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(Je)},{$id:"InputGraphVisualizationPieConnection",title:"PieConnection"}),x0=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),legendMode:n.Optional(Je),thresholds:Gr,yAxisSettings:n.Optional(Es)},{$id:"GraphVisualizationBarConnection",title:"BarConnection"}),R0=n.Object({type:n.Literal("bar-connection",{description:"Displays the database rows-based aggregation as a bar chart"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),legendMode:n.Optional(Je),thresholds:Gr,yAxisSettings:n.Optional(Is)},{$id:"InputGraphVisualizationBarConnection",title:"BarConnection"}),C0=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:n.String({description:"The ID of the connection to use to query the datastore."}),queries:n.Array(n.String({description:"The read-only SQL query to execute against the connection."})),backgroundMode:n.Optional(n.Enum(gs,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(po,{description:"Conditional formatting rules applied to the displayed value"})),precision:et,normalizer:n.Optional(nr),legendMode:n.Optional(Je)},{$id:"GraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),P0=n.Object({type:n.Literal("query-value-connection",{description:"Displays a single value computed by a SQL query against a database connection"}),connectionId:m({allowEmpty:!1,description:"The ID of the connection to use to query the datastore."}),queries:n.Array(m({allowEmpty:!1,description:"The read-only SQL query to execute against the connection.",type:"readonly-sql-query"}),{minItems:1}),backgroundMode:n.Optional(n.Enum(gs,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(po,{description:"Conditional formatting rules applied to the displayed value"})),precision:et,normalizer:n.Optional(or),legendMode:n.Optional(Je)},{$id:"InputGraphVisualizationQueryValueConnection",title:"QueryValueConnection"}),U0=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:n.String({description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(M_,{description:"Layout used to render log patterns"}))},{$id:"GraphVisualizationListLogPatterns",title:"ListLogPatterns"}),N0=n.Object({type:n.Literal("list-log-patterns",{description:"Displays log patterns clustered from logs matching the query"}),query:m({type:"tsuga-query",description:"Tsuga query that selects logs to cluster into patterns"}),layout:n.Optional(n.Enum(M_,{description:"Layout used to render log patterns"}))},{$id:"InputGraphVisualizationListLogPatterns",title:"ListLogPatterns"}),L0=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Ii,timeBucket:n.Optional(ys),normalizer:n.Optional(nr),precision:et,legendMode:n.Optional(Je),thresholds:Gr,yAxisSettings:n.Optional(Es)},{$id:"GraphVisualizationTimeseries",title:"Timeseries"}),k0=n.Object({type:n.Literal("timeseries",{description:"Displays the aggregation as a time series chart"}),...Ti,timeBucket:n.Optional(ys),normalizer:n.Optional(or),precision:et,legendMode:n.Optional(Je),thresholds:Gr,yAxisSettings:n.Optional(Is)},{$id:"InputGraphVisualizationTimeseries",title:"Timeseries"}),M0=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Ii,normalizer:n.Optional(nr),precision:et,conditions:n.Optional(n.Array(po,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"GraphVisualizationTopList",title:"TopList"}),w0=n.Object({type:n.Literal("top-list",{description:"Displays the aggregation as a ranked list of top results"}),...Ti,normalizer:n.Optional(or),precision:et,conditions:n.Optional(n.Array(po,{description:"Conditional formatting rules applied to the displayed value"}))},{$id:"InputGraphVisualizationTopList",title:"TopList"}),$0=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Ii,normalizer:n.Optional(nr),precision:et,legendMode:n.Optional(Je)},{$id:"GraphVisualizationPie",title:"Pie"}),D0=n.Object({type:n.Literal("pie",{description:"Displays the aggregation as a pie chart"}),...Ti,normalizer:n.Optional(or),precision:et,legendMode:n.Optional(Je)},{$id:"InputGraphVisualizationPie",title:"Pie"}),G0=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...Cc,backgroundMode:n.Optional(n.Enum(gs,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(po,{description:"Conditional formatting rules applied to the displayed value"})),precision:et,normalizer:n.Optional(nr),legendMode:n.Optional(Je)},{$id:"GraphVisualizationQueryValue",title:"QueryValue"}),v0=n.Object({type:n.Literal("query-value",{description:"Displays the aggregation as a single value"}),...Pc,backgroundMode:n.Optional(n.Enum(gs,{description:"Controls whether the widget uses a solid or transparent background"})),conditions:n.Optional(n.Array(po,{description:"Conditional formatting rules applied to the displayed value"})),precision:et,normalizer:n.Optional(or),legendMode:n.Optional(Je)},{$id:"InputGraphVisualizationQueryValue",title:"QueryValue"}),j0=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Ii,timeBucket:n.Optional(ys),precision:et,normalizer:n.Optional(nr),thresholds:Gr,legendMode:n.Optional(Je),yAxisSettings:n.Optional(Es)},{$id:"GraphVisualizationBar",title:"Bar"}),F0=n.Object({type:n.Literal("bar",{description:"Displays the aggregation as a bar chart"}),...Ti,timeBucket:n.Optional(ys),precision:et,normalizer:n.Optional(or),thresholds:Gr,legendMode:n.Optional(Je),yAxisSettings:n.Optional(Is)},{$id:"InputGraphVisualizationBar",title:"Bar"}),B0=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Ii,precision:et,normalizer:n.Optional(nr),percentileMarkers:n.Optional(y0)},{$id:"GraphVisualizationDistribution",title:"Distribution"}),q0=n.Object({type:n.Literal("distribution",{description:"Displays the aggregation as a distribution chart"}),...Ti,precision:et,normalizer:n.Optional(or),percentileMarkers:n.Optional(E0)},{$id:"InputGraphVisualizationDistribution",title:"Distribution"}),H0=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(m0,{description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(Ac),defaultSorting:n.Optional(l0)},{$id:"GraphVisualizationTable",title:"Table"}),K0=n.Object({type:n.Literal("table",{description:"Displays the aggregation as a table with multi-level grouping"}),columns:n.Array(u0,{minItems:1,description:"Each column defines an independent aggregation displayed as a table column"}),groupBy:n.Optional(ao),defaultSorting:n.Optional(d0)},{$id:"InputGraphVisualizationTable",title:"Table"}),z0=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(n.String({description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(b_,{description:"Background color used to render the note"})),noteAlign:n.Optional(ds),noteJustifyContent:n.Optional(ds)},{$id:"GraphVisualizationNote",title:"Note"}),V0=n.Object({type:n.Literal("note",{description:"Displays static text on the dashboard"}),note:n.Optional(m({type:"long",description:"Markdown-compatible text shown in the note"})),noteColor:n.Optional(n.Enum(b_,{description:"Background color used to render the note"})),noteAlign:n.Optional(ds),noteJustifyContent:n.Optional(ds)},{$id:"InputGraphVisualizationNote",title:"Note"}),Y0=b("type",[I0,_0,O0,S0,x0,C0,L0,M0,$0,G0,j0,B0,H0,f0,z0,U0]),Q0=b("type",[T0,h0,A0,b0,R0,P0,k0,w0,D0,v0,F0,q0,K0,g0,V0,N0]),Ts=n.Object({id:n.String({description:"Identifier of the graph widget"}),name:n.Optional(n.String({description:"Display name of the graph widget"})),description:n.Optional(n.String({description:"Description of the graph widget"})),visualization:Y0,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),_s=n.Object({id:m({description:"Identifier of the graph widget"}),name:n.Optional(m({description:"Display name of the graph widget"})),description:n.Optional(n.String({minLength:1,maxLength:800,description:"Description of the graph widget"})),visualization:Q0,layout:n.Optional(n.Object({x:n.Number({description:"Horizontal grid position of the widget"}),y:n.Number({description:"Vertical grid position of the widget"}),w:n.Number({description:"Width of the widget in grid units"}),h:n.Number({description:"Height of the widget in grid units"})},{description:"Grid layout coordinates for this widget"}))},{title:"Graph"}),W0=10,Z0=n.Array(n.Object({key:n.String({description:"Filter key"}),values:n.Array(n.String({description:"Filter value"}))}),{description:"Filters applied to every widget on the dashboard"}),X0=n.Array(n.Object({key:m({description:"Filter key"}),values:n.Array(m({description:"Filter value"}))}),{maxItems:W0,description:"Filters applied to every widget on the dashboard"}),co=n.Object({id:n.String({description:"Identifier of the dashboard"}),name:n.String({description:"Display name of the dashboard"}),owner:n.String({description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(Ts,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(Z0),createdAt:T(),updatedAt:T(),creator:n.Optional(Ae),updater:n.Optional(Ae),tags:Ye,timePreset:n.Optional(n.Enum(Tc))}),hs=n.Object({name:m({description:"Display name of the dashboard"}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the dashboard"}),graphs:n.Array(_s,{description:"Ordered widgets that compose the dashboard"}),filters:n.Optional(X0),tags:ct,timePreset:n.Optional(n.Enum(Tc))}),Uc=n.Object({...Ue,owners:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Filter by owner team IDs"}))}),afe=d({tags:["dashboards"],url:Dr,method:"GET",query:Uc,paginated:!0,response:n.Array(co)}),sfe=d({tags:["dashboards"],url:`${Dr}/:id`,method:"GET",params:n.Object({id:m()}),response:co}),pfe=d({tags:["dashboards"],url:Dr,method:"POST",body:hs,response:co}),cfe=d({tags:["dashboards"],url:`${Dr}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Partial(hs),response:co}),mfe=d({tags:["dashboards"],url:`${Dr}/bulk-update`,method:"PUT",body:n.Object({dashboardIds:n.Array(m()),owner:m({allowEmpty:!1})}),response:n.Object({})}),ufe=d({tags:["dashboards"],url:`${Dr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),lfe=d({tags:["dashboards"],url:`${Dr}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:m({allowEmpty:!1}),graphId:m({allowEmpty:!1})}),body:n.Omit(_s,["id"]),response:Ts}),dfe=d({tags:["dashboards"],url:`${Dr}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(m())}),response:n.Object({})});var mo=`/${"v1"}/dashboards`,_i=n.Pick(co,["id","name","owner","graphs","filters","tags","timePreset"],{$id:"Dashboard",description:"Visualization of telemetry data with customizable graphs and filters"}),J0={id:"123-456-abc",name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(_i,{examples:[J0]});var ew=n.Pick(Uc,["limit","offset","owners"]),w_=d({description:"Retrieve all dashboards",operationId:"listDashboards",tags:["dashboards"],url:mo,method:"GET",paginated:!0,query:ew,response:n.Array(_i)}),$_=d({description:"Retrieve a dashboard by its id",operationId:"getDashboard",tags:["dashboards"],url:`${mo}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:_i}),Nc=n.Pick(hs,["name","owner","graphs","filters","tags","timePreset"]),tw={name:"API Performance Overview",owner:"abc-123-def",graphs:[{id:"789-abc-def",name:"Request Latency P99",visualization:{type:"timeseries",source:"metrics",queries:[{aggregate:{type:"percentile",field:"duration",percentile:99},filter:"service:api-gateway"}]},layout:{x:0,y:0,w:6,h:4}}],filters:[{key:"env",values:["production"]}],tags:[{key:"team",value:"platform"}],timePreset:"past-1-hour"};Object.assign(Nc,{examples:[tw]});var D_=d({description:"Create a new dashboard",operationId:"createDashboard",tags:["dashboards"],url:mo,method:"POST",body:Nc,response:_i}),G_=d({description:"Update a dashboard by its id",operationId:"updateDashboard",tags:["dashboards"],url:`${mo}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:n.Partial(Nc),response:_i}),rw=n.Object({id:m({allowEmpty:!1,description:"The dashboard ID to delete"})}),v_=d({description:"Delete a dashboard by its id",operationId:"deleteDashboard",tags:["dashboards"],url:`${mo}/:id`,method:"DELETE",params:rw,response:v}),hfe=d({description:"Update a single graph within a dashboard by ID.",operationId:"updateDashboardGraph",tags:["dashboards"],url:`${mo}/:id/graphs/:graphId`,method:"PUT",params:n.Object({id:m({allowEmpty:!1,description:"The dashboard ID containing the graph"}),graphId:m({allowEmpty:!1,description:"The graph ID to update"})}),body:n.Omit(_s,["id"]),response:Ts});var nw=100,ow=3,uo=n.Object({id:n.String(),name:n.String(),keyLastCharacters:n.String(),owner:n.String(),tags:xc,teamOverrideFields:n.Optional(n.Array(n.String())),updatedAt:T(),createdAt:T(),creator:n.Optional(Ae),updater:n.Optional(Ae),assetUpdatedAt:T()}),hi=n.Object({name:n.String({format:es,minLength:1,maxLength:nw}),owner:m({allowEmpty:!1}),tags:Ei,teamOverrideFields:n.Optional(n.Array(m({allowEmpty:!1}),{minItems:1,maxItems:ow}))}),Oi="/v0/ingestion-api-keys",Ufe=d({tags:["ingestion-api-keys"],url:Oi,method:"POST",body:hi,response:n.Intersect([uo,n.Object({key:n.String()})])}),Nfe=d({tags:["ingestion-api-keys"],url:Oi,method:"GET",response:n.Array(uo)}),Lfe=d({tags:["ingestion-api-keys"],url:`${Oi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:uo}),kfe=d({tags:["ingestion-api-keys"],url:`${Oi}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:hi,response:uo}),Mfe=d({tags:["ingestion-api-keys"],url:`${Oi}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var Ai=`/${"v1"}/ingestion-api-keys`,Si=n.Pick(uo,["id","name","owner","tags","teamOverrideFields","keyLastCharacters"],{$id:"IngestionApiKey",description:"API key used to send telemetry data to Tsuga"}),j_={id:"123-456-abc",name:"Production Logs Ingestion",keyLastCharacters:"x7Qm",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(Si,{examples:[j_]});var F_=n.Pick(hi,["name","owner","tags","teamOverrideFields"],{$id:"CreateIngestionApiKeyRequest"}),B_=n.Pick(hi,["name","owner","tags","teamOverrideFields"],{$id:"UpdateIngestionApiKeyRequest"}),q_={name:"Production Logs Ingestion",owner:"abc-123-def",tags:[{key:"env",value:"production"}],teamOverrideFields:["service"]};Object.assign(F_,{examples:[q_]});Object.assign(B_,{examples:[q_]});var iw={...j_,key:"tsuga_in:v1:abc123xyx7Qm"},H_=d({description:"Retrieve all ingestion API keys",operationId:"listIngestionApiKeys",tags:["ingestion-api-keys"],url:Ai,method:"GET",response:n.Array(Si)}),Bfe=d({description:"Retrieve an ingestion API key by its id",operationId:"getIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ai}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Si}),aw=n.Intersect([n.Pick(Si,["id","name","keyLastCharacters","owner","tags","teamOverrideFields"]),n.Object({key:n.String({description:"The full API key value, returned only at creation time"})})],{title:"IngestionApiKeyCreated",example:iw}),K_=d({description:"Create a new ingestion API key",operationId:"createIngestionApiKey",tags:["ingestion-api-keys"],url:Ai,method:"POST",body:F_,response:aw}),z_=d({description:"Update an ingestion API key by its id",operationId:"updateIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ai}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:B_,response:Si}),V_=d({description:"Delete an ingestion API key by its id",operationId:"deleteIngestionApiKey",tags:["ingestion-api-keys"],url:`${Ai}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var sw={application:{webService:["azure_web_app","gcp_app_engine_service"]},data:{bucket:["aws_s3_bucket","gcp_bucket","azure_blob_storage_container"],messagingService:["aws_kinesis_data_stream","aws_sqs_queue","aws_sns_topic","azure_service_bus_namespace","azure_service_bus_queue","gcp_pubsub_topic","azure_event_grid_topic","azure_event_hub_namespace","azure_event_hub"],fileSystem:["aws_efs","azure_file_share"],contentDeliveryNetwork:["aws_cloudfront_distribution","gcp_cloud_cdn_configuration"],database:["aws_dynamodb_table","aws_elasticache","aws_rds_instance","azure_database_for_mysql_server","azure_database_for_postgres_server","azure_sql_database_server","azure_sql_database","gcp_bigtable_instance","gcp_cloud_sql_instance","gcp_firestore_database","gcp_spanner_instance","azure_cosmos_db_account"],storageAccount:["azure_storage_account"],volume:["aws_ebs_volume","gcp_compute_disk","azure_disk"]},compute:{virtualMachine:["aws_ec2_instance","gcp_compute_instance","azure_compute_virtual_machine"],serverless:["aws_lambda_function","gcp_cloud_run_function","gcp_cloud_run_job","gcp_cloud_run_service","azure_function_app"]},container:{kubernetesCluster:["aws_eks_cluster","gcp_gke_cluster","azure_aks_cluster"],containerRepository:["aws_ecr_repository","gcp_artifact_registry_repository","azure_container_registry"],containerCluster:["aws_ecs_cluster"],containerServiceTask:["aws_ecs_task"],containerService:["aws_ecs_service","azure_container_instance_group"],containerImage:["aws_ecr_image","gcp_artifact_registry_docker_image","azure_container_registry_image"]},network:{virtualNetwork:["aws_vpc","gcp_vpc","azure_virtual_network"],loadBalancer:["aws_elastic_load_balancer","gcp_forwarding_rule","azure_load_balancer","azure_traffic_manager_profile"],targetGroup:["aws_target_group"],certificate:["aws_acm_certificate","gcp_certificate_manager_certificate","azure_app_service_certificate"]}},[zfe,Vfe,Yfe]=pw(sw);function pw(e){let t=[],r=[],o=[],i=Object.keys(e);for(let s of i){t.push(s);let c=e[s];for(let u in c){r.push(u);let l=c[u];Array.isArray(l)&&o.push(...l)}}return[Lc(t),Lc(r),Lc(o)]}function Lc(e){if(e.length===0)throw new Error("Array must have at least one element.");return e}var kc=n.Enum(["HTTP","HTTPS","TCP","UDP","GENEVE","TLS","TLS_QUIC","TCP_UDP","TCP_QUIC","QUIC"]),cw=n.Object({versioningStatus:n.Optional(n.Enum(["Enabled","Disabled","Suspended","Not configured"]))}),mw=n.Object({domainName:n.Optional(n.String()),origins:n.Optional(n.Array(n.String()))}),uw=n.Object({allocatedStorageGib:n.Optional(n.Number()),encryptedAtRest:n.Optional(n.Boolean()),engine:n.Optional(n.String()),dynamoDbItemCount:n.Optional(n.Number()),dynamoDbActualSizeGib:n.Optional(n.Number())}),lw=n.Object({version:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnets:n.Optional(n.Array(n.String()))}),dw=n.Object({artifactRegistryFormat:n.Optional(n.Enum(["FORMAT_UNSPECIFIED","DOCKER","MAVEN","NPM","APT","YUM","PYTHON","KFP","GO","GENERIC"])),uri:n.Optional(n.String()),tagMutability:n.Optional(n.Enum(["MUTABLE","IMMUTABLE"])),scanOnPush:n.Optional(n.Boolean()),encryptionType:n.Optional(n.String())}),fw=n.Object({status:n.Optional(n.String()),activeServices:n.Optional(n.Number()),pendingTasks:n.Optional(n.Number()),runningTasks:n.Optional(n.Number()),registeredContainerInstances:n.Optional(n.Number()),capacityProviders:n.Optional(n.Array(n.String()))}),gw=n.Object({status:n.Optional(n.String()),desiredStatus:n.Optional(n.String()),healthStatus:n.Optional(n.String()),availabilityZone:n.Optional(n.String()),startedAt:n.Optional(T())}),yw=n.Object({isEncrypted:n.Optional(n.Boolean()),ownerId:n.Optional(n.String()),state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","updating"]))}),Ew=n.Object({type:n.Optional(n.String()),osType:n.Optional(n.String()),subnetIds:n.Optional(n.Array(n.String())),nbContainers:n.Optional(n.Number())}),Iw=n.Object({digest:n.String(),imageTags:n.Array(n.String()),imageSizeBytes:n.Optional(n.Number()),imagePushedAt:n.Optional(T()),mediaType:n.Optional(n.String()),repositoryName:n.String(),repositoryId:n.Optional(n.String()),scanStatus:n.Optional(n.String())}),Tw=n.Object({url:n.Optional(n.String()),maxMessageSizeBytes:n.Optional(n.Number()),messageRetentionHours:n.Optional(n.Number())}),_w=n.Object({runtime:n.Optional(n.String()),memoryAllocationMib:n.Optional(n.Number()),timeoutMs:n.Optional(n.Number()),codeSha256:n.Optional(n.String())}),hw=n.Object({kind:n.Optional(n.String())}),Ow=n.Object({instanceId:n.String(),architecture:n.Optional(n.String()),instanceType:n.Optional(n.String()),operatingSystem:n.Optional(n.String()),memoryMib:n.Optional(n.Number()),vCpus:n.Optional(n.Number()),vpcId:n.Optional(n.String()),k8sClusterId:n.Optional(n.String())}),Aw=n.Object({id:n.Optional(n.String()),ipCidrBlocks:n.Array(n.String())}),Sw=n.Object({protocol:n.Optional(kc),port:n.Optional(n.Number()),instanceProtocol:n.Optional(kc),instancePort:n.Optional(n.Number())}),bw=n.Object({protocol:n.Optional(n.String()),ports:n.Optional(n.Array(n.String())),portRange:n.Optional(n.String()),allPorts:n.Optional(n.Boolean())}),xw=n.Object({name:n.String(),ip:n.Optional(n.String()),type:n.Enum(["public","private"])}),Rw=n.Object({type:n.String(),name:n.String()}),Cw=n.Object({frontendIp:n.Optional(xw),backendIpPools:n.Array(Rw)}),Pw=n.Object({targetId:n.String(),targetPort:n.Optional(n.Number()),targetType:n.Optional(n.Enum(["instance","ip","lambda","alb"])),healthState:n.Optional(n.String()),healthReason:n.Optional(n.String()),healthDescription:n.Optional(n.String()),availabilityZone:n.Optional(n.String())}),Uw=n.Object({protocol:n.Optional(kc),port:n.Optional(n.Number()),type:n.Optional(n.Enum(["alb","lambda","instance","ip"])),name:n.Optional(n.String()),targetGroupArn:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),healthCheckProtocol:n.Optional(n.String()),healthCheckPort:n.Optional(n.String()),healthCheckPath:n.Optional(n.String()),healthCheckIntervalSeconds:n.Optional(n.Number()),healthCheckTimeoutSeconds:n.Optional(n.Number()),healthyThresholdCount:n.Optional(n.Number()),unhealthyThresholdCount:n.Optional(n.Number()),targets:n.Optional(n.Array(Pw)),targetCount:n.Optional(n.Number()),healthyTargetCount:n.Optional(n.Number()),loadBalancerArns:n.Optional(n.Array(n.String()))}),Nw=n.Object({first:n.Optional(n.String()),last:n.Optional(n.String()),scope:n.Optional(n.Number())}),Lw=n.Object({type:n.Optional(n.String()),name:n.Optional(n.String()),alwaysServe:n.Optional(n.Boolean()),subnets:n.Optional(n.Array(n.Union([n.Number(),Nw]))),target:n.Optional(n.String()),weight:n.Optional(n.Number()),priority:n.Optional(n.Number()),status:n.Optional(n.String())}),kw=n.Object({instanceId:n.Optional(n.String()),state:n.Optional(n.String()),reasonCode:n.Optional(n.String()),description:n.Optional(n.String())}),Mw=n.Object({loadBalancerType:n.Optional(n.String()),dnsName:n.Optional(n.String()),virtualNetworkId:n.Optional(n.String()),subnetIds:n.Array(n.String()),scheme:n.Optional(n.String()),listeners:n.Optional(n.Union([n.Array(Sw),n.Array(bw)])),targets:n.Optional(n.Union([n.Array(n.String()),n.Array(kw),n.Array(Lw)])),azureLoadBalancingRules:n.Optional(n.Array(Cw))}),ww=n.Object({domainName:n.Optional(n.String()),expiresAt:n.Optional(T()),inUseBy:n.Optional(n.Array(n.String())),renewalEligibility:n.Optional(n.String()),revokedAt:n.Optional(T()),status:n.Optional(n.String()),type:n.Optional(n.String())}),$w=n.Object({state:n.Optional(n.Enum(["creating","available","deleting","deleted","error","in-use"])),volumeType:n.Optional(n.Enum(["gp2","gp3","io1","io2","st1","sc1","standard"]))}),Dw=n.Object({osType:n.Optional(n.Enum(["Windows","Linux"]))}),Gw=n.Object({state:n.Optional(n.String()),volumeType:n.Optional(n.String())}),vw=n.Intersect([n.Object({isEncrypted:n.Optional(n.Boolean()),sizeGib:n.Optional(n.Number())}),n.Union([$w,Gw,Dw])]),jw=n.Object({instanceCount:n.Optional(n.Number()),hostnames:n.Optional(n.Array(n.String())),runtime:n.Optional(n.String())}),Os=n.Union([n.Object({category:n.Literal("application"),resourceType:n.Literal("webService"),attributes:n.Optional(jw)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("bucket"),attributes:n.Optional(cw)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("messagingService"),attributes:n.Optional(Tw)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("fileSystem"),attributes:n.Optional(yw)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("contentDeliveryNetwork"),attributes:n.Optional(mw)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("database"),attributes:n.Optional(uw)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("storageAccount"),attributes:n.Optional(hw)}),n.Object({category:n.Literal("data"),resourceType:n.Literal("volume"),attributes:n.Optional(vw)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("virtualMachine"),attributes:n.Optional(Ow)}),n.Object({category:n.Literal("compute"),resourceType:n.Literal("serverless"),attributes:n.Optional(_w)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("kubernetesCluster"),attributes:n.Optional(lw)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerRepository"),attributes:n.Optional(dw)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerCluster"),attributes:n.Optional(fw)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerServiceTask"),attributes:n.Optional(gw)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerService"),attributes:n.Optional(Ew)}),n.Object({category:n.Literal("container"),resourceType:n.Literal("containerImage"),attributes:n.Optional(Iw)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("virtualNetwork"),attributes:n.Optional(Aw)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("loadBalancer"),attributes:Mw}),n.Object({category:n.Literal("network"),resourceType:n.Literal("targetGroup"),attributes:n.Optional(Uw)}),n.Object({category:n.Literal("network"),resourceType:n.Literal("certificate"),attributes:n.Optional(ww)})]);var bi="/v0/inventory",Mc=["aws","gcp","azure"],Y_=["scan_in_progress","success","failure"],wc=n.Object({id:n.String({description:"Identifier of the inventory resource"}),cloudPlatform:n.Enum(Mc,{description:"Cloud platform that hosts this resource"}),cloudAccount:n.String({description:"Cloud-native account identifier the resource was discovered in"}),cloudRegion:n.Optional(n.String({description:"Cloud region the resource was discovered in, when applicable"})),fullyQualifiedResourceId:n.String({description:"Cloud-native unique identifier for this resource (for example an AWS ARN or GCP resource name)"}),displayName:n.String({description:"Human-readable name shown in the Tsuga UI"}),nativeResourceType:n.String({description:"Cloud-native resource type, for example aws_ec2_instance or gcp_bucket"}),resourceCreatedAt:n.Optional(T({description:"When the resource was created in the cloud, when known"})),resourceUpdatedAt:n.Optional(T({description:"When the resource was last updated in the cloud, when known"})),resourceLastSeenAt:T({description:"When this resource was last observed during an inventory scan"}),tags:Ye,nativeAttributes:n.Optional(n.Unsafe({type:"object",additionalProperties:!0})),covered:n.Optional(n.Boolean({description:"Whether the resource is covered by the configured infrastructure-as-code identifiers"}))}),rge=d({tags:["inventory"],method:"GET",url:`${bi}/resources`,response:n.Array(n.Intersect([wc,Os]))}),Fw=b("type",[n.Object({type:n.Literal("aws"),accountId:n.String(),externalId:n.String(),roleArn:n.String()}),n.Object({type:n.Literal("gcp"),projectId:n.String(),serviceAccountId:n.String(),workloadIdentityProvider:n.String()}),n.Object({type:n.Literal("azure"),clientId:n.String(),subscriptionId:n.String(),tenantId:n.String()})]),Bw=n.Object({type:n.Literal("aws"),accountId:m(),externalId:m(),roleArn:m()}),qw=n.Object({type:n.Literal("gcp"),projectId:m(),serviceAccountId:m(),workloadIdentityProvider:m()}),Hw=n.Object({type:n.Literal("azure"),clientId:m(),subscriptionId:m(),tenantId:m()}),Q_=b("type",[Bw,qw,Hw]),As=n.Object({id:n.String(),cloudType:n.Enum(Mc),cloudAccountId:n.String(),accountFriendlyName:n.Optional(n.String()),organizationId:n.Optional(n.String()),connectionSettings:Fw,createdBy:n.Optional(n.String()),createdAt:T(),lastScanStartedAt:n.Optional(T()),lastScanFinishedAt:n.Optional(T()),lastScanStatus:n.Optional(n.Enum(Y_))}),Kw=n.Object({cloudType:n.Enum(Mc),cloudAccountId:m(),accountFriendlyName:n.Optional(m()),organizationId:n.Optional(m()),connectionSettings:Q_,lastScanStatus:n.Optional(n.Enum(Y_))}),ln=`${bi}/cloud-accounts`,nge=d({tags:["inventory"],url:ln,method:"GET",response:n.Array(As)}),oge=d({tags:["inventory"],url:`${ln}/:id`,method:"GET",params:n.Object({id:m()}),response:As}),ige=d({tags:["inventory"],url:ln,method:"POST",body:Kw,response:As}),age=d({tags:["inventory"],url:`${ln}/:id`,method:"PUT",params:n.Object({id:m()}),body:n.Object({accountFriendlyName:m()}),response:As}),sge=d({tags:["inventory"],url:`${ln}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),pge=d({tags:["inventory"],url:`${bi}/trigger-scan`,method:"POST",body:n.Object({}),response:n.Object({success:n.Literal(!0)})}),cge=d({tags:["inventory"],url:`${ln}/azure/onboarding`,method:"POST",body:n.Object({tenantId:m()}),response:n.Object({subjectId:n.String(),audience:n.String()})}),mge=d({tags:["inventory"],method:"POST",url:`${ln}/validate/:type`,params:n.Object({type:m()}),body:n.Object({data:Q_,id:n.Optional(m())}),response:n.Object({areAccountSettingsValid:n.Boolean(),message:n.Optional(n.String())})}),W_=`${bi}/settings`,uge=d({tags:["inventory"],url:W_,method:"GET",response:n.Object({settings:n.Optional(n.Object({id:n.String(),infrastructureIdentifiers:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))}))})}),lge=d({tags:["inventory"],url:W_,method:"POST",body:n.Object({infrastructureIdentifiers:n.Array(n.Object({name:m({allowEmpty:!1}),value:n.Optional(m({allowEmpty:!1}))}),{maxItems:50})}),response:n.Object({})}),dge=d({tags:["inventory"],url:`${bi}/iac-tags-proposal`,method:"GET",response:n.Array(n.Object({name:n.String(),value:n.Optional(n.String())}))});var zw=`/${"v1"}/inventory`,Vw=n.Omit(wc,["nativeAttributes","covered"],{$id:"InventoryResourceBase",description:"Base fields of a cloud resource discovered by an inventory scan"}),Z_=n.Intersect([Vw,Os],{$id:"InventoryResource",description:"A cloud resource discovered by an inventory scan, together with its category, type and category-specific attributes"}),Yw={id:"123-456-abc",cloudPlatform:"aws",cloudAccount:"123456789012",cloudRegion:"us-east-1",fullyQualifiedResourceId:"arn:aws:s3:::tsuga-example-bucket",displayName:"tsuga-example-bucket",nativeResourceType:"aws_s3_bucket",resourceCreatedAt:"2024-01-01T08:00:00.000Z",resourceLastSeenAt:"2024-01-15T12:34:56.000Z",tags:[{key:"team",value:"platform"}],category:"data",resourceType:"bucket",attributes:{versioningStatus:"Enabled"}};Object.assign(Z_,{examples:[Yw]});var X_=d({description:"Retrieve all cloud resources discovered by inventory scans",operationId:"listInventoryResources",tags:["inventory"],url:`${zw}/resources`,method:"GET",response:n.Array(Z_)});var Qw={"ingestion-api-key":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"audit-log":{read:["public_viewer","public_editor","admin"],write:[]},"custom-usage-tag":{read:["public_viewer","public_editor","admin"],write:["admin"]},"cluster-integration-config":{read:["admin"],write:["admin"]},"crawler-integration-config":{read:["admin"],write:["admin"]},"explorer-saved-view":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]},"operation-api-key":{read:["public_viewer","public_editor","admin"],write:["admin"]},"asset-change":{read:["public_viewer","public_editor","admin"],write:[]},"inventory-settings":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},dashboard:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"dashboard-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},inventory:{read:["public_viewer","public_editor","admin"],write:[]},log:{read:["public_viewer","public_editor","admin"],write:[]},"log-route":{read:["public_viewer","public_editor","admin"],write:["admin","public_editor"]},metric:{read:["public_viewer","public_editor","admin"],write:[]},trace:{read:["public_viewer","public_editor","admin"],write:[]},monitor:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"monitor-alert":{read:["public_viewer","public_editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-rule":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"notification-silence":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"saml-config":{read:["admin"],write:["admin"]},org:{read:["public_viewer","public_editor","admin"],write:["admin"]},"allowed-domains":{read:["public_viewer","public_editor","admin"],write:["admin"]},"quality-report":{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"sensitive-data-scanner-rule":{read:["public_viewer","public_editor","admin"],write:["admin"]},slo:{read:["public_viewer","public_editor","admin"],write:["public_editor","admin"]},"retention-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},service:{read:["public_viewer","public_editor","admin"],write:[]},"tag-policy":{read:["public_viewer","public_editor","admin"],write:["admin"]},team:{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-members":{read:["public_viewer","public_editor","admin"],write:["admin"]},"team-remap-config":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-data":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-invitation":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-permissions":{read:["public_viewer","public_editor","admin"],write:["admin"]},"user-self":{read:["public_viewer","public_editor","admin"],write:["public_viewer","public_editor","admin"]}},Ww={"ingestion-api-key":{read:["viewer","editor","admin"],write:["editor","admin"]},"audit-log":{read:["viewer","editor","admin"],write:[]},"asset-change":{read:["viewer","editor","admin"],write:[]},"custom-usage-tag":{read:[],write:[]},"cluster-integration-config":{read:[],write:[]},"crawler-integration-config":{read:[],write:[]},"explorer-saved-view":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]},"operation-api-key":{read:["viewer","editor","admin"],write:["admin"]},"inventory-settings":{read:["viewer","editor","admin"],write:["editor","admin"]},dashboard:{read:["viewer","editor","admin"],write:["editor","admin"]},"dashboard-report":{read:["viewer","editor","admin"],write:[]},inventory:{read:["viewer","editor","admin"],write:[]},log:{read:["viewer","editor","admin"],write:[]},"log-route":{read:["viewer","editor","admin"],write:["editor","admin"]},metric:{read:["viewer","editor","admin"],write:[]},trace:{read:["viewer","editor","admin"],write:[]},monitor:{read:["viewer","editor","admin"],write:["editor","admin"]},"monitor-alert":{read:["viewer","editor","admin"],write:[]},"monitor-debugging":{read:["admin"],write:[]},"notification-integration":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-rule":{read:["viewer","editor","admin"],write:["editor","admin"]},"notification-silence":{read:["viewer","editor","admin"],write:["editor","admin"]},"saml-config":{read:["admin"],write:[]},org:{read:["viewer","editor","admin"],write:[]},"allowed-domains":{read:["viewer","editor","admin"],write:[]},"quality-report":{read:["viewer","editor","admin"],write:["editor","admin"]},"sensitive-data-scanner-rule":{read:["viewer","editor","admin"],write:[]},slo:{read:["viewer","editor","admin"],write:["editor","admin"]},"retention-policy":{read:[],write:[]},service:{read:["viewer","editor","admin"],write:[]},"tag-policy":{read:[],write:[]},team:{read:["viewer","editor","admin"],write:["admin"]},"team-members":{read:["viewer","editor","admin"],write:["admin"]},"team-remap-config":{read:[],write:[]},"user-data":{read:["viewer","editor","admin"],write:["admin"]},"user-invitation":{read:["viewer","editor","admin"],write:["admin"]},"user-permissions":{read:["viewer","editor","admin"],write:[]},"user-self":{read:["viewer","editor","admin"],write:["viewer","editor","admin"]}},Zw={user:Qw,team:Ww};function $c(e){return J_(e,"team")}function Dc(e){return J_(e,"user")}function J_(e,t){let r=[],o=Zw[t];for(let[i,s]of Object.entries(o))for(let[c,u]of Object.entries(s))u.includes(e)&&r.push({actionType:c,resourceType:i});return r}var bge={admin:{name:"Global admin",description:"Full control across the organization. Can view and modify everything, including private teams.",permissions:Dc("admin"),roleKey:"admin"},public_editor:{name:"Public editor",description:"Can view and edit assets in public teams, but not access private teams or critical settings.",permissions:Dc("public_editor"),roleKey:"public_editor"},public_viewer:{name:"Public viewer",description:"Read-only access to public team data. Cannot make changes.",permissions:Dc("public_viewer"),roleKey:"public_viewer"},teams_only:{name:"Teams only",description:"Only access data and assets in their own teams.",permissions:[],roleKey:"teams_only"}},xge={admin:{name:"Team admin",description:"Full team control, manage assets, members, and settings.",permissions:$c("admin"),roleKey:"admin"},editor:{name:"Team editor",description:"Can view and update most assets (like dashboards, monitors).",permissions:$c("editor"),roleKey:"editor"},viewer:{name:"Team viewer",description:"Can view all team data but cannot make changes.",permissions:$c("viewer"),roleKey:"viewer"}};var eh=[{key:"amex15_digits",name:"American Express card (1x15 digits)",category:"financial-data",example:"378282246310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex4443_digits",name:"American Express card (4+4+4+3 digits)",category:"financial-data",example:"3782 8224 6310 005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex465_digits",name:"American Express card (4+6+5 digits)",category:"financial-data",example:"3782 822463 10005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"amex87_digits",name:"American Express card (8+7 digits)",category:"financial-data",example:"37828224 6310005",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card14_digits",name:"Diners card (1x14 digits)",category:"financial-data",example:"30569309025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card4442_digits",name:"Diners card (4+4+4+2 digits)",category:"financial-data",example:"3056 9309 0259 04",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card464_digits",name:"Diners card (4+6+4 digits)",category:"financial-data",example:"3056 930902 5904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"diners_card86_digits",name:"Diners card (8+6 digits)",category:"financial-data",example:"30569309 025904",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card16_digits",name:"Discover card (1x16 digits)",category:"financial-data",example:"6011111111111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card88_digits",name:"Discover card (2x8 digits)",category:"financial-data",example:"60111111 11111117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"discover_card4444_digits",name:"Discover card (4x4 digits)",category:"financial-data",example:"6011 1111 1111 1117",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card16_digits",name:"JCB card (1x16 digits)",category:"financial-data",example:"3530111333300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card88_digits",name:"JCB card (2x8 digits)",category:"financial-data",example:"35301113 33300000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"jcb_card4444_digits",name:"JCB card (4x4 digits)",category:"financial-data",example:"3530 1113 3330 0000",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card16_digits",name:"Maestro card (1x16 digits)",category:"financial-data",example:"6759649826438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card88_digits",name:"Maestro card (2x8 digits)",category:"financial-data",example:"67596498 26438453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"maestro_card4444_digits",name:"Maestro card (4x4 digits)",category:"financial-data",example:"6759 6498 2643 8453",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard16_digits",name:"Mastercard (1x16 digits)",category:"financial-data",example:"5555555555554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard88_digits",name:"MasterCard (2x8 digits)",category:"financial-data",example:"55555555 55554444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"mastercard4444_digits",name:"MasterCard (4x4 digits)",category:"financial-data",example:"5555 5555 5555 4444",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa16_digits",name:"Visa (1x16 digits)",category:"financial-data",example:"4111111111111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa19_digits",name:"Visa (1x19 digits)",category:"financial-data",example:"4111111111111111151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa88_digits",name:"Visa (2x8 digits)",category:"financial-data",example:"41111111 11111111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa883_digits",name:"Visa (8+8+3 digits)",category:"financial-data",example:"41111111 11111111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa4444_digits",name:"Visa (4x4 digits)",category:"financial-data",example:"4111 1111 1111 1111",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"visa44443_digits",name:"Visa (4+4+4+4+3 digits)",category:"financial-data",example:"4111 1111 1111 1111 151",isUsingLuhnAlgorithm:!0,regexp:"(?-u:\\\\b)[02-9]([-\\\\s_]*\\d){12,18}(?-u:\\\\b)"},{key:"dropbox_long_lived_api_token",name:"Dropbox long lived API token",category:"credential",example:"767cb868836AAAAAAAAAAszri2cnmzu5tr0yf-nvclmwfyiswl67qyqw-uzn-scg",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\\-_=]{43})"},{key:"dropbox_short_lived_api_token",name:"Dropbox short lived API token",category:"credential",example:"sl.nu0yvsrposcjeyjcpmbfrmqygllrxpahrgbt8flml9xroifbic",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:sl\\.[a-z0-9\\-=_]{50})"},{key:"french_nirpp",name:"French social security number (NIRPP)",category:"personal-information",example:"188073512757119",isUsingLuhnAlgorithm:!1,regexp:"([12])\\s*[0-9]{2}\\s*(0[1-9]|1[0-2])\\s*(2[AB]|[0-9]{2})\\s*([0-9]{3})\\s*([0-9]{3})(\\s*[0-9]{2})?"},{key:"ip_address",name:"IP address",category:"device-identifier",example:"81.55.13.53",isUsingLuhnAlgorithm:!1,regexp:""},{key:"social_security_number",name:"Social security number (XXX-XX-XXXX)",category:"personal-information",example:"437-02-2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])-(?:0[1-9]|[1-9]0|[1-9][1-9])-(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_space",name:"Social security number (XXX XX XXXX)",category:"personal-information",example:"437 02 2223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])\\s+(?:0[1-9]|[1-9]0|[1-9][1-9])\\s+(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"social_security_number_digits",name:"Social security number (9 digits)",category:"personal-information",example:"437022223",isUsingLuhnAlgorithm:!1,regexp:"(?x)(?-u:\\b)(?:00[1-9]|0[1-9][0-9]|[1-578][0-9]{2}|6[0-57-9][0-9]|66[0-57-9])(?:0[1-9]|[1-9]0|[1-9][1-9])(?:000[1-9]|00[1-9]0|0[1-9]00|[1-9]000|[1-9]{4})(?-u:\\b)"},{key:"email",name:"Email",category:"credential",example:"admin@tsuga.com",isUsingLuhnAlgorithm:!1,regexp:"[a-zA-Z0-9-_.]*[a-zA-Z0-9_](@[a-zA-Z0-9_]+)(\\.[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)?[a-zA-Z])(?-u:\\b)"},{key:"one_password_secret_key",name:"1Password secret key",category:"credential",example:"A3-O28NKC-F58GULWCN72-4NIKS-KGY7V-U7FAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}(?-u:\\b)"},{key:"one_password_service_account_token",name:"1Password service account token",category:"credential",example:"ops_eyJdAZ/FoIyz0jAXpEQOrRdIE8ydVaYfAXeZXGFqHWfBOjnE/Vgf5kHIbwrNAp2WeFNPeFiVJPlLv1hmaTVums0ldq1Kv8JEglMqP3f0ATBuX/WRbKqXYS3Z1wSzxg6S0krW4df7ZplvK04+JhJimejyTEH5dYaxqsYDBSLxjeEq7JWsmHEuXj6WP5qQi7FB+5s+CwhWPWY/jDhUMB3fdowXbfv5VnWri3iYrfBh+bFeRe9KURhXGHRDE9hgs",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ops_eyJ[a-zA-Z0-9+/]{50}"},{key:"adafruit_api_key",name:"Adafruit API key",category:"credential",example:"jb9pb4unb2bhe7xqepmgwtl2jg7ti101",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{32})"},{key:"adobe_client_id",name:"Adobe client ID",category:"credential",example:"c4166853dfd2897ebe706d49ef13fe63",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"adobe_client_secret",name:"Adobe client secret",category:"credential",example:"p8e-bb6e1614324ae48e507d33af176db3b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:p8e-[a-z0-9]{32})"},{key:"age_secret_key",name:"Age secret key",category:"credential",example:"AGE-SECRET-KEY-1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}"},{key:"airtable_api_key",name:"Airtable API key",category:"credential",example:"19b73hbi0tc5cdy4w",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{17})"},{key:"algolia_api_key",name:"Algolia API key",category:"credential",example:"346155deb68d31c4018d73de73452947",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"alibaba_access_key_id",name:"Alibaba Cloud AccessKey ID",category:"credential",example:"LTAI7cc6804e4c2155cd52bd",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:LTAI[a-z0-9]{20})"},{key:"alibaba_secret_key",name:"Alibaba Cloud secret key",category:"credential",example:"suwixirhh10xhnko9bv0vfg2971u9p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"anthropic_admin_api_key",name:"Anthropic admin API key",category:"credential",example:"sk-ant-admin01-abc12fake-456def789ghij-klmnopqrstuvwx-3456yza789bcde-12fakehijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-admin01-[a-zA-Z0-9_-]{93}AA)"},{key:"anthropic_api_key",name:"Anthropic API key",category:"credential",example:"sk-ant-api03-abc123xyz-456def789ghij-klmnopqrstuvwx-3456yza789bcde-1234fghijklmnopby56aaaogaopaaaabc123xyzAA",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-ant-api03-[a-zA-Z0-9_-]{93}AA)"},{key:"artifactory_api_key",name:"Artifactory API key",category:"credential",example:"AKCpt771klpkqllt647fdf36fq43radbz2w2nyetvx4l90qyeef8kbgkmke63ul5vf6mqsy82",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AKCp[A-Za-z0-9]{69}(?-u:\\b)"},{key:"artifactory_reference_token",name:"Artifactory reference token",category:"credential",example:"cmVmdc6i6888t9viuobfd88e46pdonjjsvmme6np82qti7wzbj7l9m1ygtyl9wik",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)cmVmd[A-Za-z0-9]{59}(?-u:\\b)"},{key:"asana_client_id",name:"Asana client ID",category:"credential",example:"9760134337886314",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{16})"},{key:"asana_client_secret",name:"Asana client secret",category:"credential",example:"tcnc8mjrf5bad359nnz3j1z90gow67ji",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"atlassian_api_token",name:"Atlassian API token",category:"credential",example:"fdo4scsa4kh53jnenkfp5fbe",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:[a-z0-9]{20}[a-f0-9]{4})|(?-u:\\b)(?:ATATT3[A-Za-z0-9_-=]{50})"},{key:"authress_service_client_access_key",name:"Authress service client access key",category:"credential",example:"sc_scmz00n9xj.0ykp.acc_2k5vtnrec4.55vc9459s-gc5qlia7a67jvzm0bobn3g0ezimd3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\\.[a-z0-9]{4,6}\\.(?-i:acc)[_-][a-z0-9-]{10,32}\\.[a-z0-9+/_=-]{30})"},{key:"aws_access_token",name:"AWS access token",category:"credential",example:"AKIALALEMEL33243OLIB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z2-7]{16})(?-u:\\b)"},{key:"azure_ad_client_secret",name:"Azure AD client secret",category:"credential",example:"bP88Q~rcBcYjzzOhg1Hnn76Wm3jGgakZiZ.8vMgR",isUsingLuhnAlgorithm:!1,regexp:"(?:^|[\\\\'\"` \\r\\n\\t\\f\\v>=:(?:,)])(?:[a-zA-Z0-9_~.]{3}[0-9]Q~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'\"` \\r\\n\\t\\f\\v<),])"},{key:"bitbucket_client_id",name:"Bitbucket client ID",category:"credential",example:"yyxmjnl3kahirvct7sat2082pzqdyf09",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"bitbucket_client_secret",name:"Bitbucket client secret",category:"credential",example:"fylw1pominwz91e5guqjiugw6srutpl64vzch5rnt8xnt31ka7so9va73fscz836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{64})"},{key:"beamer_api_token",name:"Beamer API token",category:"credential",example:"b_zhy-phuoqk13asco6az4u_0yhtklgswm4umkv95nv4gu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:b_[a-z0-9=_\\-]{44})"},{key:"codecov_access_token",name:"Codecov access token",category:"credential",example:"r93iopllonuphk41qglet20y8cb83thm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"clickhouse_cloud_api_secret_key",name:"ClickHouse Cloud API secret key",category:"credential",example:"4b1dbRdW3rOcB7xLthrM4BTBGK1qPLkHigpN1bXD6z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:4b1d[A-Za-z0-9]{38})(?-u:\\b)"},{key:"clojars_api_token",name:"Clojars API token",category:"credential",example:"CLOJARS_d1vd7t0blxaarzx25dxoda4hm5ox86st6o5ww7tnzsfz07wvu223bf0fmgim",isUsingLuhnAlgorithm:!1,regexp:"CLOJARS_[a-z0-9]{60}"},{key:"cloudflare_api_key",name:"Cloudflare API key",category:"credential",example:"ckg0h_dzkxnl627gy3nskpq9wzm4d5hc_vxk272h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"cloudflare_global_api_key",name:"Cloudflare global API key",category:"credential",example:"1d003bb65ec73ad2691fb76631b6496e3c9d9",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{37})"},{key:"cloudflare_origin_ca_key",name:"Cloudflare Origin CA key",category:"credential",example:"v1.0-aaa334dc886f30631ba0a610-0d98ef66290d7e50aac7c27b5986c99e6f3f1084c881d8ac0eae5de1d1aa0644076ff57022069b3237d19afe60ad045f207ef2b16387ee37b749441b2ae2e9ebe5b4606e846475d4a5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:v1\\.0-[a-f0-9]{24}-[a-f0-9]{50})"},{key:"cohere_api_token",name:"Cohere API token",category:"credential",example:"lpn59BQ4FNUabVJh1vCpIqZpQbaViELQrTa14p9D",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-zA-Z0-9]{40})"},{key:"confluent_access_token",name:"Confluent access token",category:"credential",example:"kkat92sclkukwvr2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"confluent_secret_key",name:"Confluent secret key",category:"credential",example:"64d4ppp37l9fjhadm8vv0awie6wjo4d6ourfcqvi2bcs2tm95x4f0e8gyb8z8usj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"contentful_delivery_api_token",name:"Contentful delivery API token",category:"credential",example:"eumospigka64wiwpavfmmblrq7x1hm6gz84wiiw2ff3",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{43})"},{key:"curl_auth_header",name:"Curl authorization header",category:"credential",example:"curl --header 'Authorization: 5eb4223e-5008-46e5-be67-c7b8f2732305'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*?|.*?(?:[\\r\\n]{1,2}.*?){1,5})[ \\t\\n\\r](?:-H|--header)(?:=|[ \\t]{0,5})(?:"(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))"|'(?:Authorization:[ \\t]{0,5}(?:Basic[ \\t](?:[a-z0-9+/]{8,}={0,3})|(?:Bearer|(?:Api-)?Token)[ \\t](?:[a-zA-Z0-9_=~@.+/-]{8,})|(?:[a-zA-Z0-9_=~@.+/-]{8,}))|(?:(?:X-(?:[a-z]+-)?)?(?:Api-?)?(?:Key|Token)):[ \\t]{0,5}(?:[a-zA-Z0-9_=~@.+/-]{8,}))')(?:(?-u:\\B)|[ \\r\\n\\t\\f\\v]|\\z)`},{key:"curl_auth_user",name:"Curl basic authentication",category:"credential",example:"curl -u elastic:P@ssw0rd$1",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)curl(?-u:\\b)(?:.*|.*(?:[\\r\\n]{1,2}.*){1,5})[ \\t\\n\\r](?:-u|--user)(?:=|[ \\t]{0,5})(?:"(:[^"]{3,}|[^:"]{3,}:|[^:"]{3,}:[^"]{3,})"|'(?:[^:']{3,}:[^']{3,})'|(?:(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_$@.-]+):(?:"[^"]{3,}"|'[^']{3,}'|[a-zA-Z0-9_\${}@.-]+)))(?:[ \\r\\n\\t\\f\\v]|\\z)`},{key:"databricks_api_token",name:"Databricks API token",category:"credential",example:"dapia2553f815d29a193fd09c2bb55201895",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dapi[a-f0-9]{32}(?:-[0-9])?)"},{key:"datadog_access_token",name:"Datadog access token",category:"credential",example:"ljgbhjnca2hy5yc2nv7cag1ag7ehx2hc6geparov",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"defined_networking_api_token",name:"Defined Networking API token",category:"credential",example:"dnkey-nowf_nwyqhvqt1gi66xnuuf2rb-bfxnr9_qydyxnxn1y8uijvhhp9owllbg-2czoe-7qs5_w5650xei",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:-[a-z0-9=_\\-]{26}-[a-z0-9=_\\-]{52})"},{key:"digitalocean_pat",name:"DigitalOcean personal access token",category:"credential",example:"dop_v1_ec8f4a856c1459bd442a275461e2f709506347de30b180851cde71f696e9fcc8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dop_v1_[a-f0-9]{64})"},{key:"digitalocean_access_token",name:"DigitalOcean OAuth access token",category:"credential",example:"doo_v1_42b8ea6c4b0c373f88aff9d3fa87e123ab23b0d3c22ac6d4361a4e9c1e89eaa6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:doo_v1_[a-f0-9]{64})"},{key:"digitalocean_refresh_token",name:"DigitalOcean OAuth refresh token",category:"credential",example:"dor_v1_4d9b3e6fbe65ab472e464dfa6377d702e80164442acdfbeb3ef032d917cb9984",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:dor_v1_[a-f0-9]{64})"},{key:"discord_api_token",name:"Discord API token",category:"credential",example:"7eb855d9a40747182d0b0ea74df27aee31d05756a9933a815a3ccb5a46b2d61d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"discord_client_id",name:"Discord client ID",category:"credential",example:"763721114261247538",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{18})"},{key:"discord_client_secret",name:"Discord client secret",category:"credential",example:"13641266018325206246161633988007",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"doppler_api_token",name:"Doppler API token",category:"credential",example:"dp.pt.vgin8wwjy7sx66fyq99tavkm3y5g2jdxmsufh257dhj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dp\\.pt\\.[a-z0-9]{43}"},{key:"dropbox_api_token",name:"Dropbox API token",category:"credential",example:"rdlztoij88rzrsk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{15})"},{key:"droneci_access_token",name:"DroneCI access token",category:"credential",example:"v26gffr903rbti5v7m392ba0u7oarz36",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"duffel_api_token",name:"Duffel API token",category:"credential",example:"duffel_test_-yd6b3pc4jy593pt5kr2l3ynzkb5b_f619dshefiz=v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)duffel_(?:test|live)_[a-z0-9_\\-=]{43}"},{key:"dynatrace_api_token",name:"Dynatrace API token",category:"credential",example:"dt0c01.ben820rdpb1so4kasfx3yn4a.zkje7lawif35udsin5t1mi1m1sne7wdzphlzrmdnu3j69gr4kgf5dwg4x5lb30zg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)dt0c01\\.[a-z0-9]{24}\\.[a-z0-9]{64}"},{key:"easypost_api_token",name:"EasyPost API token",category:"credential",example:"EZAKBVScDZwZFv0nJXHBcxPGil7eztnPJOSmDFf2NGKQk6Dn7VqULciSRm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZAK[a-z0-9]{54}(?-u:\\b)"},{key:"easypost_test_api_token",name:"EasyPost test API token",category:"credential",example:"EZTKuxUXVU5HBS1K2iyh165t3VtivpdxMgIf5Y2P1oJxeFeaJGcwzVexds",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)EZTK[a-z0-9]{54}(?-u:\\b)"},{key:"etsy_access_token",name:"Etsy access token",category:"credential",example:"8ssp35lhprxpb3sjyergcz5z",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"facebook_secret",name:"Facebook secret",category:"credential",example:"c41c21ba4fb5ee05398db86ca83f06db",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"facebook_access_token",name:"Facebook access token",category:"credential",example:"911602140448729|AY-lRJZq9BoDLobvAiP25L7RcMg",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[0-9]{15,16}(\\||%)[0-9a-z\\-_]{27,40})"},{key:"facebook_page_access_token",name:"Facebook page access token",category:"credential",example:"EAAM9GOnCB9kBO2frzOAWGN2zMnZClQshlWydZCrBNdodesbwimx1mfVJgqZBP5RSpMfUzWhtjTTXHG5I1UlvlwRZCgjm3ZBVGeTYiqAAoxyED6HaUdhpGVNoPUwAuAWWFsi9OvyYBQt22DGLqMIgD7VktuCTTZCWKasz81Q822FPhMTB9VFFyClNzQ0NLZClt9zxpsMMrUZCo1VU1rL3CKavir5QTfBjfCEzHNlWAUDUV2YZD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:EAA[MC][a-z0-9]{50})"},{key:"fastly_api_token",name:"Fastly API token",category:"credential",example:"im7_ux24tyyxz_4y4mvzj22akpid830c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"finicity_client_secret",name:"Finicity client secret",category:"credential",example:"roepymyr0ce7wxhjvgb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"finicity_api_token",name:"Finicity API token",category:"credential",example:'= "cce089057c8b7fe7f2a8474b9a050816',isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"flickr_access_token",name:"Flickr access token",category:"credential",example:"damvt93tudulk6wrfp36sawndc9pa7bb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"finnhub_access_token",name:"Finnhub access token",category:"credential",example:"x01lnfp13spcbsa0at32",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{20})"},{key:"flutterwave_public_key",name:"Flutterwave public key",category:"credential",example:"FLWPUBK_TEST-99484d505b4ee5c1181a2884f5fe3852-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWPUBK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_secret_key",name:"Flutterwave secret key",category:"credential",example:"FLWSECK_TEST-66187ac83488c2245f0d7e95fa37e833-X",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{32}-X"},{key:"flutterwave_encryption_key",name:"Flutterwave encryption key",category:"credential",example:"FLWSECK_TEST-6262214a02e7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)FLWSECK_TEST-[a-h0-9]{12}"},{key:"flyio_access_token",name:"Fly.io access token",category:"credential",example:"fo1_m-HT0NHLBSPwMJ2hIer4v3lxtWEC7grXNidQxJMrVVE",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:fo1_[a-zA-Z0-9_-]{43}|fm1[ar]_[a-zA-Z0-9+\\/]{50}))"},{key:"frameio_api_token",name:"Frame.io API token",category:"credential",example:"fio-u-4ov9vjtr2wwj8j1gob-8xrx2-1=z818psmitskgoq4=p-_k77d54034z55xk-lqh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)fio-u-[a-z0-9\\-_=]{64}"},{key:"freshbooks_access_token",name:"FreshBooks access token",category:"credential",example:"gqw118uwne1nddlt4yruvvs4jr9s0vrj5mxaswgb2amacod8lgnmrknsvbovsx1g",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"gocardless_api_token",name:"GoCardless API token",category:"credential",example:"live_-z4lwtrrk6p6=-v1ig_y_4ceplziwek0lw=oz-eu",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:live_[a-z0-9\\-_=]{40})"},{key:"gcp_api_key",name:"GCP API key",category:"credential",example:"AIzaYpvGqEzpgB7R353HD9CxN8LuhZ6d6UfuXLL",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:AIza[a-zA-Z0-9_-]{35})"},{key:"github_pat",name:"GitHub personal access token",category:"credential",example:"ghp_t7i9llxuukeb7apn4zlnyeyz5b0007rsfs54",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghp_[0-9a-zA-Z]{36}"},{key:"github_fine_grained_pat",name:"GitHub fine-grained personal access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)github_pat_[a-zA-Z0-9_]{82}"},{key:"github_oauth",name:"GitHub OAuth token",category:"credential",example:"gho_anlrm6zqscqityoqozv503by66dobnem4yxh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gho_[0-9a-zA-Z]{36}"},{key:"github_app_token",name:"GitHub app token",category:"credential",example:"ghs_0zleityj4n1ulz178o9in1w97q1ifw8u3y8h",isUsingLuhnAlgorithm:!1,regexp:"(?:ghu|ghs)_[0-9a-zA-Z]{36}"},{key:"github_refresh_token",name:"GitHub refresh token",category:"credential",example:"ghr_inu1aa7qbgi46cf8nprbgh4kn03d0zk35raj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ghr_[0-9a-zA-Z]{36}"},{key:"gitlab_cicd_job_token",name:"GitLab CI/CD job token",category:"credential",example:"glcbt-7h2nr_6jmho0uoqkb1ww431kfl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glcbt-[0-9a-zA-Z]{1,5}_[0-9a-zA-Z_-]{20}"},{key:"gitlab_deploy_token",name:"GitLab deploy token",category:"credential",example:"gldt-7a3o70gqa8zkal0zdp4x",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gldt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feature_flag_client_token",name:"GitLab feature flag client token",category:"credential",example:"glffct-dsct62ndnvcj7alw5nas",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glffct-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_feed_token",name:"GitLab feed token",category:"credential",example:"glft-13956nvy00289v6xu0di",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glft-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_incoming_mail_token",name:"GitLab incoming mail token",category:"credential",example:"glimt-fcdt1a5jvj01si61jgkse2r20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glimt-[0-9a-zA-Z_\\-]{25}"},{key:"gitlab_kubernetes_agent_token",name:"GitLab Kubernetes agent token",category:"credential",example:"glagent-8wxkulkbbuk7u6r3nvrefswdfw5o0v7vy81y4oky8rnfogm826",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glagent-[0-9a-zA-Z_\\-]{50}"},{key:"gitlab_oauth_app_secret",name:"GitLab OAuth app secret",category:"credential",example:"gloas-vawws2nw5kf6rizn49g41jc3jiy4xqioaihrwm1msltbdt4cbmo4x52tygcic7af",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)gloas-[0-9a-zA-Z_\\-]{64}"},{key:"gitlab_pat",name:"GitLab personal access token",category:"credential",example:"glpat-2gl3ku1497ms4gzyv16i",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[a-zA-Z0-9_-]{20}"},{key:"gitlab_pat_routable",name:"GitLab personal access token (routable)",category:"credential",example:"glpat-2hf7vebpux9j56tdcqqsvap7vxc.chvjof35u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glpat-[0-9a-zA-Z_-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_ptt",name:"GitLab personal access token (temporary)",category:"credential",example:"glptt-b54e8b7b90cf006b79af110baa9b8d9183fd7048",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glptt-[0-9a-f]{40}"},{key:"gitlab_rrt",name:"GitLab registration token",category:"credential",example:"GR1348941vnauzmn2hj0zncvt0nfe",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)GR1348941[a-zA-Z0-9_-]{20}"},{key:"gitlab_runner_authentication_token",name:"GitLab runner authentication token",category:"credential",example:"glrt-xbd1w7c9clbxm52zdxkm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_runner_authentication_token_routable",name:"GitLab runner authentication token (routable)",category:"credential",example:"glrt-t5_8d8ugbkfzddae0dw06tvm0x7qxc.mwcd1a7cn",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glrt-t[0-9]_[0-9a-zA-Z_\\-]{27}\\.[0-9a-z]{2}[0-9a-z]{7}(?-u:\\b)"},{key:"gitlab_scim_token",name:"GitLab SCIM token",category:"credential",example:"glsoat-9jb5zk1nvy800c1uqhh0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)glsoat-[0-9a-zA-Z_\\-]{20}"},{key:"gitlab_session_cookie",name:"GitLab session cookie",category:"credential",example:"_gitlab_session=yjhub6vtrp60djn6rszuemeacsoqox97",isUsingLuhnAlgorithm:!1,regexp:"_gitlab_session=[0-9a-z]{32}"},{key:"gitter_access_token",name:"Gitter access token",category:"credential",example:"uazubes6trcd_1gym09opuf_8gj1rmvj6jwber4a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{40})"},{key:"grafana_api_key",name:"Grafana API key",category:"credential",example:"eyJrIjoiyl5shjvqja0xkfbu38m24vn5httsipr1h9fgjhodxzlkpravuiy8h7hom5kt8gtwuguh2v",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:eyJrIjoi[A-Za-z0-9]{70}={0,3})"},{key:"grafana_cloud_api_token",name:"Grafana cloud API token",category:"credential",example:"glc_cb7p4j2g1qu0sy84me72ufmn1z8mqk8y",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glc_[A-Za-z0-9+/]{32}={0,3})"},{key:"grafana_service_account_token",name:"Grafana service account token",category:"credential",example:"glsa_rm3sadbwl8o2c13v4ipgkz04h66kiy6t_edaea401",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})"},{key:"harness_api_key",name:"Harness API key",category:"credential",example:"pat.vzcxr183pymw194fdq1q0v.qjqjarqkd9ydxqagjmq3f5iq.8nn5nyaow3h5mmgjh053",isUsingLuhnAlgorithm:!1,regexp:"(?:pat|sat)\\.[a-zA-Z0-9_-]{22}\\.[a-zA-Z0-9]{24}\\.[a-zA-Z0-9]{20}"},{key:"hashicorp_tf_api_token",name:"HashiCorp Terraform API token",category:"credential",example:"984d8033429986.atlasv1.799k5cihj_807yc1e8afvla8ackd1khsb50nfeswbxbr1re54y0wpzs2tjy=",isUsingLuhnAlgorithm:!1,regexp:"[a-z0-9]{14}\\.(?-i:atlasv1)\\.[a-z0-9\\-_=]{60,70}"},{key:"heroku_api_key",name:"Heroku API key",category:"credential",example:"9127f65b-8b3f-c0b7-a336-a4347e71bc51",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"heroku_api_key_v2",name:"Heroku API key v2",category:"credential",example:"HRKU-AAxPYvV6l2R3DvF0w9VJ4m8cz9oaygOHxpQvcw--iD51MszQZeakD9DZsclX",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(HRKU-AA[0-9a-zA-Z_-]{58}))"},{key:"hubspot_api_key",name:"HubSpot API key",category:"credential",example:"86cb6664-b191-db72-95a7-49adebe84b74",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})"},{key:"huggingface_access_token",name:"HuggingFace access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hf_(?i:[a-z]{34}))"},{key:"huggingface_organization_api_token",name:"HuggingFace organization API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:api_org_(?i:[a-z]{34}))"},{key:"intercom_api_key",name:"Intercom API key",category:"credential",example:"zuc5c=ykf5gcwesqvmh2pji6k3extx0rbalsznte3sdo7iu7f-lumol2npfk",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{60})"},{key:"intra42_client_secret",name:"Intra42 client secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:s-s4t2(?:ud|af)-[abcdef0123456789]{64})"},{key:"jfrog_api_key",name:"JFrog API key",category:"credential",example:"lj7nrgoo0kr04kw312zvly7l0olsn37vhto5wdn3yqi5srxnc2axstp7a1kewkxi717w295kh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{73})"},{key:"jfrog_identity_token",name:"JFrog identity token",category:"credential",example:"xh0x2upbtkkg1pseg7ezmcyw2c3kt0bt05l5v8ynvkro6wagolhch0f7kppplt8b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"jwt",name:"JSON web token",category:"credential",example:"ey7gzQUpN8Kz7XY6Yin.ey1o36_XrBphAG8WMHQ.",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ey[a-zA-Z0-9]{17,}\\.ey[a-zA-Z0-9\\/\\\\_-]{17,}\\.(?:[a-zA-Z0-9\\/\\\\_-]{10,}={0,2})?)"},{key:"jwt_base64",name:"JSON web token base64",category:"credential",example:"ZXlKNE5YUWpVekkxTmlJNklsUjFUM0pDZVRKT1kxUnNSbE5YZFZvNFMyZzRWemhCYWxGaFoySTBabTVtVURGVGJFdE5Uemd0VTI4aWZRLmV5SnBjM01pT2lKcWIyVWlMQTBLSUNKbGVIQWlPakV6TURBNE1Ua3pPREFzRFFvZ0ltaDBkSEE2THk5bGVHRnRjR3hsTG1OdmJTOXBjMTl5YjI5MElqcDBjblZsZlEuZEJqZnRKZVo0Q1ZQLW1COTJLMjd1aGJVSlUxcDFyX3dXMWdGV0ZPRWpYaw==",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)ZXlK(?:(?P<alg>aGJHY2lPaU)|(?P<apu>aGNIVWlPaU)|(?P<apv>aGNIWWlPaU)|(?P<aud>aGRXUWlPaU)|(?P<b64>aU5qUWlP)|(?P<crit>amNtbDBJanBi)|(?P<cty>amRIa2lPaU)|(?P<epk>bGNHc2lPbn)|(?P<enc>bGJtTWlPaU)|(?P<jku>cWEzVWlPaU)|(?P<jwk>cWQyc2lPb)|(?P<iss>cGMzTWlPaU)|(?P<iv>cGRpSTZJ)|(?P<kid>cmFXUWlP)|(?P<key_ops>clpYbGZiM0J6SWpwY)|(?P<kty>cmRIa2lPaUp)|(?P<nonce>dWIyNWpaU0k2)|(?P<p2c>d01tTWlP)|(?P<p2s>d01uTWlPaU)|(?P<ppt>d2NIUWlPaU)|(?P<sub>emRXSWlPaU)|(?P<svt>emRuUWlP)|(?P<tag>MFlXY2lPaU)|(?P<typ>MGVYQWlPaUp)|(?P<url>MWNtd2l)|(?P<use>MWMyVWlPaUp)|(?P<ver>MlpYSWlPaU)|(?P<version>MlpYSnphVzl1SWpv)|(?P<x>NElqb2)|(?P<x5c>NE5XTWlP)|(?P<x5t>NE5YUWlPaU)|(?P<x5ts256>NE5YUWpVekkxTmlJNkl)|(?P<x5u>NE5YVWlPaU)|(?P<zip>NmFYQWlPaU))[a-zA-Z0-9\\/\\\\_+\\-\\r\\n]{40,}={0,2}"},{key:"launchdarkly_access_token",name:"LaunchDarkly access token",category:"credential",example:"ezmej9s6yv4qwk2=yeb4kfi162p33b_2hzm7tr-0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40})"},{key:"linear_api_key",name:"Linear API key",category:"credential",example:"lin_api_0n5n0k26vb4ka9je9dqdcwl1dae5mbpfhb48xio6",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)lin_api_[a-z0-9]{40}"},{key:"linear_client_secret",name:"Linear client secret",category:"credential",example:"7b956760f09b81684ed833c524f081de",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32})"},{key:"linkedin_client_id",name:"LinkedIn client ID",category:"credential",example:"18u930hak0em0r",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{14})"},{key:"linkedin_client_secret",name:"LinkedIn client secret",category:"credential",example:"uvkxd9rw41ylk1zj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{16})"},{key:"lob_api_key",name:"Lob API key",category:"credential",example:"test_02efbb923a38370aac769e3bedc4d3398be",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(live|test)_[a-f0-9]{35})"},{key:"lob_pub_api_key",name:"Lob publishable API key",category:"credential",example:"test_pub_df170d9f5be9244959713dfee686c42",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:(test|live)_pub_[a-f0-9]{31})"},{key:"mailchimp_api_key",name:"MailChimp API key",category:"credential",example:"81277fbbe2dd9c5e18d5f28cebcc558c-us20",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{32}-us[0-9][0-9])"},{key:"mailgun_pub_key",name:"Mailgun public validation key",category:"credential",example:"pubkey-5011bae1a4b57dfa83762c24b0e1299d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pubkey-[a-f0-9]{32})"},{key:"mailgun_private_api_token",name:"Mailgun private API token",category:"credential",example:"key-176f7ef066471ac351adab734d2c9fb2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:key-[a-f0-9]{32})"},{key:"mailgun_signing_key",name:"Mailgun webhook signing key",category:"credential",example:"24564bd3d54a469601d5ac5daecb9ad2-00001111-22223333",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})"},{key:"mapbox_api_token",name:"MapBox API token",category:"credential",example:"pk.5ko18udoy3cilkpgyedje9limykwj8n7wmhug4967o9wze284mmpuuhjzgig.edjzuv7jwhc6lnv5b3p9nc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:pk\\.[a-z0-9]{60}\\.[a-z0-9]{22})"},{key:"mattermost_access_token",name:"Mattermost access token",category:"credential",example:"rtw2hncbfhpbyyri90d3q2mo1m",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{26})"},{key:"maxmind_license_key",name:"MaxMind license key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:[A-Za-z0-9]{6}_[A-Za-z0-9]{29}_mmk)"},{key:"cisco_meraki_api_key",name:"Cisco Meraki API key",category:"credential",example:"acea14a1470f7cf443a031dde64065ce81c77b2b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[0-9a-f]{40})"},{key:"messagebird_api_token",name:"MessageBird API token",category:"credential",example:"448q6im7yxutswabdko1n69ry",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"messagebird_client_id",name:"MessageBird client ID",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"netlify_access_token",name:"Netlify access token",category:"credential",example:"3j1sa0o20v0k-cjbjn3vh_4uqnkvb3w_px5no2in",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{40,46})"},{key:"new_relic_user_api_key",name:"New Relic user API key",category:"credential",example:"NRAK-zozcnrh45ornsbl1duyfhell59u",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRAK-[a-z0-9]{27})"},{key:"new_relic_user_api_id",name:"New Relic user API ID",category:"credential",example:"k0jze7delork84k8ke1z1dm275yw2aqf5uu2cy7x1uiloll3xab5203hiz9tx9xx",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"new_relic_browser_api_token",name:"New Relic browser API token",category:"credential",example:"NRJS-c7fa1261a97506e4a45",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRJS-[a-f0-9]{19})"},{key:"new_relic_insert_key",name:"New Relic insight insert key",category:"credential",example:"NRII-4168ab7eb2e051f37144ad884d32ab34",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:NRII-[a-z0-9-]{32})"},{key:"notion_api_token",name:"Notion API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ntn_[0-9]{11}[A-Za-z0-9]{32}[A-Za-z0-9]{3})"},{key:"npm_access_token",name:"npm access token",category:"credential",example:"npm_vz9e7fvsn7o2n2tddg6b01gs7g9wldlys4vm",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:npm_[a-z0-9]{36})"},{key:"nytimes_access_token",name:"NYTimes access token",category:"credential",example:"ako7xzi0mx7w15ogdkew7ilq7h13x8rl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9=_\\-]{32})"},{key:"octopus_deploy_api_key",name:"Octopus Deploy API key",category:"credential",example:"API-NFWN6F7X32BYDBU94IGY3V5ZQY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:API-[A-Z0-9]{26})"},{key:"okta_access_token",name:"Okta access token",category:"credential",example:"003cKkRNNMy4ul7V8UDHEjEBGbnsQ6tejSHzfeBtcp",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:00[a-zA-Z0-9_=\\-]{40})"},{key:"openai_api_key",name:"OpenAI API key",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})(?-u:\\b)|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})"},{key:"openshift_user_token",name:"OpenShift user token",category:"credential",example:"sha256~OFL-TnR3jyLteu_rAuff3PUYNELVvByMRFYCcAkaJSR",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sha256~[a-zA-Z0-9_-]{43})(?:[^a-zA-Z0-9_-]|\\z)"},{key:"perplexity_api_key",name:"Perplexity API key",category:"credential",example:"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'",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pplx-[a-zA-Z0-9]{48})(?:[`'\" \\r\\n\\t\\f\\v;]|\\\\[nr]|$|(?-u:\\b))"},{key:"pgpassword_shell_assignment",name:"PGPASSWORD shell assignment",category:"credential",example:"PGPASSWORD='supersecret'",isUsingLuhnAlgorithm:!1,regexp:`(?-u:\\b)PGPASSWORD=(?:"[^"\\r\\n]+"|'[^'\\r\\n]+'|[^\\s'"]+)`},{key:"plaid_api_token",name:"Plaid API token",category:"credential",example:"access-development-4b0f8c31-83fe-e4c5-3d02-91e487b69d2d",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"plaid_client_id",name:"Plaid client ID",category:"credential",example:"TTPjxpFNiwOct5XLdxjXD0Ta",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{24})"},{key:"plaid_secret_key",name:"Plaid secret key",category:"credential",example:"ikhqm7a9k76l8f544dl0v8kxvm2w55",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"planetscale_password",name:"PlanetScale password",category:"credential",example:"pscale_pw_9gvu8z79m4b814z0vv8266w70h3i7jlq",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_pw_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_api_token",name:"PlanetScale API token",category:"credential",example:"pscale_tkn_nwy9jkjgnry96ftecsx_=jrxc6pkmmew",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_tkn_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"planetscale_oauth_token",name:"PlanetScale OAuth token",category:"credential",example:"pscale_oauth_zx8v3gzfnfxbymj__l629i68jnz5gnff",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pscale_oauth_[a-zA-Z0-9_=\\.-]{32,64})"},{key:"postman_api_token",name:"Postman API token",category:"credential",example:"PMAK-525b84aa46e2c588620d8123-06f9ca36c4aad4305baafbe00716b7bc8f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:PMAK-[a-f0-9]{24}\\-[a-f0-9]{34})"},{key:"prefect_api_token",name:"Prefect API token",category:"credential",example:"pnu_kttbffyfgffu2sfbxzxw8mbpgvvtxjljwe1p",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pnu_[a-zA-Z0-9]{36})"},{key:"privateai_api_token",name:"PrivateAI API token",category:"credential",example:"iwuxqzqilzbfnccncvjz6px23dnej11h",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:[a-z0-9]{32})"},{key:"private_key",name:"Private key",category:"credential",example:`-----BEGIN PRIVATE KEY-----
42
42
  MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAC4AWkdwKYSd8
43
43
  Ks14IReLcYgADhoXk56ZzXI=
44
- -----END PRIVATE KEY-----`,isUsingLuhnAlgorithm:!1,regexp:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[ \\r\\n\\t\\f\\v\\S-]{64,}?KEY(?: BLOCK)?-----"},{key:"pulumi_api_token",name:"Pulumi API token",category:"credential",example:"pul-b77e6bff9fddebbc2bb8eca94e3f29a41f6da70a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pul-[a-f0-9]{40})"},{key:"pypi_upload_token",name:"PyPI upload token",category:"credential",example:"pypi-AgEIcHlwaS5vcmc128fd9e0b47dde39cfecad3a997273458e6392f6aac649ae38864bdd7ff12836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)pypi-AgEIcHlwaS5vcmc[a-zA-Z0-9_-]{50}"},{key:"rapidapi_access_token",name:"RapidAPI access token",category:"credential",example:"g4x40h94pi_-zlklfz3-qvhiiu5zankyrqqwmsl60decihbqvl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{50})"},{key:"readme_api_token",name:"ReadMe API token",category:"credential",example:"rdme_k38kau741xa5lw03mdkvcd4vn6s6hdhvhg1wxa4ls7dp8h58r0yxq65nsqwndn056pxsc4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rdme_[a-z0-9]{70})"},{key:"rubygems_api_token",name:"RubyGems API token",category:"credential",example:"rubygems_7790aaa8102395704a64594a11f6de4941a27f86bc3fc9d4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rubygems_[a-f0-9]{48})"},{key:"scalingo_api_token",name:"Scalingo API token",category:"credential",example:"tk-us-4fhmqrg-rl4416b3oij_qx3q284wbhbqpk7r3te4r14lafou",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:tk-us-[a-zA-Z0-9_-]{48})"},{key:"sendbird_access_id",name:"SendBird access ID",category:"credential",example:"7e7801fd-c25d-50ab-a723-01b94c8d6c5f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sendbird_access_token",name:"SendBird access token",category:"credential",example:"305f75f04e3afa65360c25d9944fdae91138328d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{40})"},{key:"sendgrid_api_token",name:"SendGrid API token",category:"credential",example:"SG.--ed-fvdeffijnle7575jp1sh24wq_9y9hcjua5w3dnqh5-wyegkpzenziy1_qr=hf",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:SG\\.[a-z0-9=_\\-\\.]{66})"},{key:"sendinblue_api_token",name:"Sendinblue API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:xkeysib-[a-f0-9]{64}\\-[a-z0-9]{16})"},{key:"sentry_access_token",name:"Sentry access token",category:"credential",example:"1ad463398f40a52bb94a3795762f4003d51b03b8a788cba55e3a81de81c72940",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"sentry_org_token",name:"Sentry org token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)sntrys_eyJpYXQiO[a-zA-Z0-9+/]{10}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)"},{key:"sentry_user_token",name:"Sentry user token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sntryu_[a-f0-9]{64})"},{key:"settlemint_application_access_token",name:"Settlemint application access token",category:"credential",example:"sm_aat_gshgzsv353m5yb9s",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_aat_[a-zA-Z0-9]{16})"},{key:"settlemint_personal_access_token",name:"Settlemint personal access token",category:"credential",example:"sm_pat_1yhza49gsle0trg8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_pat_[a-zA-Z0-9]{16})"},{key:"settlemint_service_access_token",name:"Settlemint service access token",category:"credential",example:"sm_sat_cha543e6lb19llli",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_sat_[a-zA-Z0-9]{16})"},{key:"shippo_api_token",name:"Shippo API token",category:"credential",example:"shippo_live_1d0f80d04e7788c1edb8fc2b8076bbf8f59b84b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:shippo_(?:live|test)_[a-fA-F0-9]{40})"},{key:"shopify_access_token",name:"Shopify access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpat_[a-fA-F0-9]{32}"},{key:"shopify_custom_access_token",name:"Shopify custom access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpca_[a-fA-F0-9]{32}"},{key:"shopify_private_app_access_token",name:"Shopify private app access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shppa_[a-fA-F0-9]{32}"},{key:"shopify_shared_secret",name:"Shopify shared secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpss_[a-fA-F0-9]{32}"},{key:"sidekiq_secret",name:"Sidekiq secret",category:"credential",example:"aa8d3915:64fb5cb5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{8}:[a-f0-9]{8})"},{key:"sidekiq_sensitive_url",name:"Sidekiq sensitive URL",category:"credential",example:"https://cafebabe:deadbeef@gems.contribsys.com/",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https?://(?:[a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)"},{key:"slack_bot_token",name:"Slack bot token",category:"credential",example:"xoxb-781236542736-2364535789652-GkwFDQoHqzXDVsC6GzqYUypD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*"},{key:"slack_user_token",name:"Slack user token",category:"credential",example:"xoxp-41684372915-1320496754-45609968301-e708ba56e1517a99f6b5fb07349476ef",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}"},{key:"slack_app_token",name:"Slack app token",category:"credential",example:"xapp-1-A052FGTS2DL-5171572773297-610b6a11f4b7eb819e87b767d80e6575a3634791acb9a9ead051da879eb5b55e",isUsingLuhnAlgorithm:!1,regexp:"xapp-[0-9]-[A-Z0-9]+-[0-9]+-[a-z0-9]+"},{key:"slack_config_access_token",name:"Slack config access token",category:"credential",example:"xoxe.xoxp-1-Mi0yLTM0MTQwNDE0MDE3Ni0zNjU5NDY0Njg4MTctNTE4MjA3NTQ5NjA4MC01NDEyOTYyODY5NzUxLThhMTBjZmI1ZWIzMGIwNTg0ZDdmMDI5Y2UxNzVlZWVhYzU2ZWQyZTZiODNjNDZiMGUxMzRlNmNjNDEwYmQxMjQ",isUsingLuhnAlgorithm:!1,regexp:"xoxe.xox[bp]-[0-9]-[A-Z0-9]{50}"},{key:"slack_config_refresh_token",name:"Slack config refresh token",category:"credential",example:"xoxe-1-My0xLTMxNzcwMjQ0MTcxMy01MTU4MTUyNjkxNzE0LTUxODE4NDI0MDY3MzYtMjA5MGFkOTFlZThkZWE2OGFlZDYwYWJjODNhYzAxYjA5ZjVmODBhYjgzN2QyNDdjOTNlOGY5NTg2YWM1OGM4Mg",isUsingLuhnAlgorithm:!1,regexp:"xoxe-[0-9]-[A-Z0-9]{50}"},{key:"slack_legacy_bot_token",name:"Slack legacy bot token",category:"credential",example:"xoxb-263594206564-FGqddMF8t08v8N7Oq4i57vs1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}"},{key:"slack_legacy_workspace_token",name:"Slack legacy workspace token",category:"credential",example:"xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[ar]-(?:[0-9]-)?[0-9a-zA-Z]{8,48}"},{key:"slack_legacy_token",name:"Slack legacy token",category:"credential",example:"xoxs-416843729158-132049654-5609968301-e708ba56e1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[os]-[0-9]+-[0-9]+-[0-9]+-[a-fA-F0-9]+"},{key:"slack_webhook_url",name:"Slack webhook URL",category:"credential",example:"hooks.slack.com/services/z6cvbfngk3h7i0vts4akmbxidtb8o3b4pq2sbbd6o86g",isUsingLuhnAlgorithm:!1,regexp:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}"},{key:"snyk_api_token",name:"Snyk API token",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sonar_api_token",name:"Sonar API token",category:"credential",example:"12345678ABCDEFH1234567890ABCDEFH12345678",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:(?:squ_|sqp_|sqa_)?[a-z0-9=_-]{40})"},{key:"stripe_access_token",name:"Stripe access token",category:"credential",example:"sk_test_cyge9m4s1kxiqdkszz0a57nyx6wk73",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})"},{key:"square_access_token",name:"Square access token",category:"credential",example:"sq0atp-OQUxovdrj3tfFpSd66r3sY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:EAAA|sq0atp-)[a-zA-Z0-9_-]{22,60})"},{key:"squarespace_access_token",name:"Squarespace access token",category:"credential",example:"86447eab-140f-2563-3572-bb016dafd692",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sumologic_access_id",name:"SumoLogic access ID",category:"credential",example:"suJS4ZsaD5bQTt",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:su[a-zA-Z0-9]{12})"},{key:"sumologic_access_token",name:"SumoLogic access token",category:"credential",example:"1xohkwr8lpvm4osygkpe5zbd16c3376ver2qed1bssuko4uy4tij1bnf4dnwy7o4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"microsoft_teams_webhook",name:"Microsoft Teams webhook URL",category:"credential",example:"https://mycompany.webhook.office.com/webhookb2/767lrnj6-okh8-dnh8-jey2-y2iteohrwz75@6igi6oz6-ud9w-wior-2zva-5vx0wp6wuiqk/IncomingWebhook/o1zox92ssprrppjtnvcjqq0q09k2wnc3/qwox5p9d-x4zr-3yis-t1on-s67zj50tmyht",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}"},{key:"telegram_bot_api_token",name:"Telegram bot API token",category:"credential",example:"59015865:A12o5wu6f78zofs0udypf9ti23u82g-qkfz",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})"},{key:"travisci_access_token",name:"Travis CI access token",category:"credential",example:"zjgfo5fhshd5c60hpz22wh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{22})"},{key:"twilio_api_key",name:"Twilio API key",category:"credential",example:"SKa585fd034fcd16cdd741f7df9b57fb3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)SK[0-9a-fA-F]{32}"},{key:"twitch_api_token",name:"Twitch API token",category:"credential",example:"1hm9gcychlkpf93jdjnwdu0uaamu6d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"twitter_api_key",name:"Twitter API key",category:"credential",example:"m8zqu4etx07bjt7tyeacc6pox",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"twitter_api_secret",name:"Twitter API secret",category:"credential",example:"7f4gxkubw9qs346ik99zk3z8b6kk3d7g8toi7zujgvgbt8q0yv",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{50})"},{key:"twitter_access_token",name:"Twitter access token",category:"credential",example:"465616696186918-96B1NCD5CH0uyi7zUHiS",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{15,25}-[a-zA-Z0-9]{20,40})"},{key:"twitter_access_secret",name:"Twitter access secret",category:"credential",example:"vyuo5peybdzznr7z0ua5wamhogusans4m29uzi25w4jgj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{45})"},{key:"twitter_bearer_token",name:"Twitter bearer token",category:"credential",example:"AAAAAAAAAAAAAAAAAAAAAAWRGWFGlfwyqNrrIa3pewqNNLX0jQMj2sR6M2cZUfBdqXDtkt7Nsb56F4tCz7Pt8ujbosrLxnRqYgwI0b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:A{22}[a-zA-Z0-9%]{80})"},{key:"typeform_api_token",name:"Typeform API token",category:"credential",example:"tfp_o-nsn=6eg2ios=4g652xhf933qor4jj7ort2qh_uw_5jdsuffp31ln=e-2a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:tfp_[a-z0-9\\-_\\.=]{59})"},{key:"vault_batch_token",name:"Vault batch token",category:"credential",example:"hvb.x84j4cl53mzvhvb1nfc3mfi721gh5i-92f96lt0gns5lpksfu5f0199j-gw4ycxg6au4ser86mczcr_nx6ur2elbpazfrybo80fxjv3bghxshml3g261l6qi03yrz03qup84jk-fc2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hvb\\.[a-zA-Z0-9_-]{50})"},{key:"vault_service_token",name:"Vault service token",category:"credential",example:"s.8QH9knZV94f0IjBZismfOPD0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:hvs\\.[a-zA-Z0-9_-]{90}|s\\.(?i:[a-z0-9]{24})))"},{key:"yandex_api_key",name:"Yandex API key",category:"credential",example:"AQVN9wiAh8pyz3lmB5WTo_KUuPDXlxtzkA5-YFG",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:AQVN[A-Za-z0-9_\\-]{35,38})"},{key:"yandex_aws_access_token",name:"Yandex AWS access token",category:"credential",example:"YCZ6DHVrZONPNtgwWLZPrIGyviSrudRVSr8w0b1S",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:YC[a-zA-Z0-9_\\-]{38})"},{key:"yandex_access_token",name:"Yandex access token",category:"credential",example:"t1.L=.WJ9CYVI5eeLkTOrMM_dgaPgdmpen48R8RYsL4VJqelVKDmrqYsSHkH6QyVVhJkuHSQFTd0NOhClEDyCz7eEbh5=",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})"},{key:"zendesk_secret_key",name:"Zendesk secret key",category:"credential",example:"iydgm2jofftb2xu7niv55qnfxdwbwmqt2s561bgc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"infracost_api_token",name:"Infracost API token",category:"credential",example:"ico-fNZw8jjy6TugMUHKWX4l9iSP3i95SPNH",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ico-[a-zA-Z0-9]{32})"},{key:"iban",name:"Iban",category:"financial-data",example:"FR7630006000011234567890189",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}(?-u:\\b)"},{key:"aikido_token",name:"Aikido token",category:"credential",example:"AIK_SECRET_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_SECRET_[A-Za-z0-9]{64}"},{key:"aikido_ci_token",name:"Aikido CI secret",category:"credential",example:"AIK_CI_US_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_CI_(US_|ME_)?[A-Za-z0-9]{64}"},{key:"tsuga_ingestion_key",name:"Tsuga ingestion key",category:"credential",example:"tsuga_in:v1:OUvrwavCG//ixL08HEds9OAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_in:v1:[A-Za-z0-9+/]{24}"},{key:"tsuga_operation_key",name:"Tsuga operation key",category:"credential",example:"tsuga_op:v1:zz3-LWv-sLy:0k7Skt255M0yXe/ZLBoiSamb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_op:v1:[A-Za-z0-9_-]+:[A-Za-z0-9+/]{24}"}],IM=xh.map(e=>e.key),$de=new Set(IM),Dde=xh.map(e=>e.key);function Sh(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var TM=["all","owning-team-and-public","owning-team-only"],Tm=n.Enum(TM,{description:"This controls which data the resource can see"});var At="/v0/monitors",hm=["alert","resolve","keep_last_status","consider_zero"],bh=["alert","resolve","keep_last_status"];var hM=["no_aggregation","all","any","each","proportion"],_M=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var AM=n.Object({formula:c({type:"tsuga-formula"}),operator:n.Enum(_M),threshold:n.Number()}),_m=n.Array(AM),Rh=n.Object({formula:c({type:"tsuga-formula"}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"])}),Yfe=n.Enum(["rate","error","cpu","general"]),_t=[1,2,3,4,5];var Ii={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(c(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{maxItems:1,description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(hM)),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99}))},Am=n.Object({type:n.Literal("metric"),conditions:_m,noDataBehavior:n.Enum(hm),...Ii,queries:Jn},{$id:"MonitorConfigurationMetric"}),xm=n.Object({type:n.Literal("log"),conditions:_m,noDataBehavior:n.Enum(hm),...Ii,queries:Jn},{$id:"MonitorConfigurationLog"}),Ch=n.Object({type:n.Literal("trace"),conditions:_m,noDataBehavior:n.Enum(hm),...Ii,queries:Jn},{$id:"MonitorConfigurationTrace"}),Sm=n.Object({type:n.Literal("anomaly-log"),condition:Rh,noDataBehavior:n.Enum(bh),...Ii,queries:Jn},{$id:"MonitorConfigurationAnomalyLog"}),Om=n.Object({type:n.Literal("anomaly-metric"),condition:Rh,noDataBehavior:n.Enum(bh),...Ii,queries:Jn},{$id:"MonitorConfigurationAnomalyMetric"}),Ph=n.Object({type:n.Literal("certificate-expiry"),warnBeforeInDays:n.Integer({minimum:1,maximum:365}),cloudAccounts:n.Optional(n.Array(n.String(),{minItems:1})),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("resolve")},{$id:"MonitorConfigurationCertificateExpiry"}),xM=n.Object({type:n.Literal("log-error-pattern"),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("keep_last_status"),filter:n.Object({teamIds:n.Array(n.String()),env:n.String(),service:n.Optional(n.String())})},{$id:"MonitorConfigurationLogErrorPattern"}),Uh=U("type",[Am,xm,Ch,Sm,Om,xM,Ph]);var qt=n.Object({id:n.String({description:"Identifier of the monitor"}),name:n.String({description:"Display name of the monitor"}),owner:n.String({description:"Team ID that owns and manages the monitor"}),message:n.Optional(n.String({description:"Message to be displayed if a notification is triggered"})),tags:ye,configuration:Uh,priority:n.Enum(_t,{description:"Priority of the monitor"}),permissions:Tm,dashboardId:n.Optional(n.String({description:"Identifier of a dashboard related to the monitor"})),pauseUntil:n.Optional(h()),creator:n.Optional(Oe),updater:n.Optional(Oe),createdAt:h(),updatedAt:h(),assetUpdatedAt:h(),clusterIds:n.Array(n.String())},{title:"Monitor"}),SM=U("type",[Am,xm,Ch,Sm,Om,Ph]),Vfe=n.Object({...qt.properties,configuration:SM},{title:"Monitor"}),Wfe=n.Object({...qt.properties,configuration:U("type",[Am,xm,Sm,Om])},{title:"Monitor"}),Ti=n.Object({name:c(),message:n.Optional(c({type:"long"})),tags:ye,configuration:Uh,priority:n.Enum(_t),owner:c({allowEmpty:!1}),dashboardId:n.Optional(c()),pauseUntil:n.Optional(c({allowEmpty:!1,type:"date-time"})),permissions:Tm,clusterIds:n.Optional(n.Array(c({allowEmpty:!1})))}),Oh=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],kr={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};var Qfe=d({tags:["monitors"],url:At,method:"GET",paginated:!0,response:n.Array(qt),query:n.Object({...Se,owners:n.Optional(n.Array(c({allowEmpty:!1})))})}),bm=n.Partial(n.Object({...Se,filters:n.Partial(n.Object({owners:n.Array(c({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:c({allowEmpty:!1,description:"Substring matched against monitor name and configuration"}),tags:n.Array(to.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:n.Array(n.Enum(_t),{description:"Restrict results to monitors with one of these priorities",maxItems:_t.length}),types:n.Array(n.Enum(Oh),{description:"Restrict results to monitors with these types",maxItems:Oh.length}),activity:n.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:n.Array(c({allowEmpty:!1}),{description:"Restrict results to monitors deployed to any of these cluster IDs (monitors with no cluster restriction are always included)",maxItems:50})},{description:"Optional filters applied to narrow the returned monitors"})),sort:n.Object({by:n.Enum([kr.PRIORITY,kr.TYPE,kr.NAME,kr.OWNER,kr.TAGS,kr.CLUSTER_IDS,kr.PAUSE_UNTIL,kr.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned monitors"})})),Zfe=d({tags:["monitors"],url:`${At}/query`,method:"POST",paginated:!0,response:n.Array(qt),body:n.Optional(bm)}),Xfe=d({tags:["monitors"],url:`${At}/:id`,method:"GET",params:n.Object({id:c()}),response:qt}),Jfe=d({tags:["monitors"],url:At,method:"POST",body:Ti,response:qt}),ege=d({tags:["monitors"],url:`${At}/:id`,method:"PUT",params:n.Object({id:c()}),body:Ti,response:qt}),tge=d({tags:["monitors"],url:`${At}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),rge=d({tags:["monitors"],url:`${At}/:id/snooze`,method:"POST",params:n.Object({id:c()}),body:n.Object({pauseUntil:c({allowEmpty:!1,type:"date-time"})}),response:qt}),OM=["alert","ok","alert_consider_zero","ok_consider_zero","alert_no_data","ok_no_data","keep_last_status_ok","keep_last_status_alert"],sn=n.Enum(OM),bM=U("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([sn,n.Null()]),lastChangedAt:h()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(sn)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(sn)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(sn)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(sn)})]),RM=n.Object({monitorId:n.String(),currentState:bM,lastChangedAt:n.Optional(h())}),nge=d({tags:["monitors"],url:`${At}/states/:id`,method:"GET",params:n.Object({id:c()}),response:RM}),oge=d({tags:["monitors"],url:`${At}/:id/transitions`,method:"GET",params:n.Object({id:c()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:h(),fromState:n.Optional(sn),toState:n.Optional(sn),dimension:n.Optional(n.String())}))}),CM=["unprocessed","processed","failed-to-process"],ige=d({tags:["monitors"],url:`${At}/:id/results`,method:"GET",params:n.Object({id:c()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:h(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),rm),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:h(),status:n.Enum(CM)}))})});var hi=`/${"v1"}/monitors`,_i=n.Pick(qt,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],{$id:"Monitor",description:"Monitor allowing to send alerts based on telemetry data"}),PM={id:"123-456-abc",name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},UM={id:"456-789-def",name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(_i,{examples:[PM,UM]});var Nh=n.Pick(bm,["filters","sort","limit","offset"]),NM={filters:{owners:["team-123-abc"],searchQuery:"service:api-gateway",tags:[{key:"paging",value:"true"}],priorities:[1]},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Nh,{examples:[NM]});var kh=d({description:"Query monitors with filters, sorting, and pagination",operationId:"queryMonitors",tags:["monitors"],url:`${hi}/query`,method:"POST",paginated:!0,body:n.Optional(Nh),response:n.Array(_i)}),Lh=d({description:"Retrieve a monitor by its id",operationId:"getMonitor",tags:["monitors"],url:`${hi}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:_i}),Mh=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],wh=n.Pick(Ti,Mh,{$id:"CreateMonitorRequest"}),$h=n.Pick(Ti,Mh,{$id:"UpdateMonitorRequest"}),Dh={name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},Gh={name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(wh,{examples:[Dh,Gh]});Object.assign($h,{examples:[Dh,Gh]});var vh=d({description:"Create a new monitor",operationId:"createMonitor",tags:["monitors"],url:hi,method:"POST",body:wh,response:_i}),jh=d({description:"Update a monitor by its id",operationId:"updateMonitor",tags:["monitors"],url:`${hi}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:$h,response:_i}),kM=n.Object({id:c({allowEmpty:!1,description:"The monitor ID to delete"})}),Fh=d({description:"Delete a monitor by its id",operationId:"deleteMonitor",tags:["monitors"],url:`${hi}/:id`,method:"DELETE",params:kM,response:v});var Ai="/v0/notifications",mn=`${Ai}/rules`,Bh=`${Ai}/slack/setup`,ss=`${Ai}/integrations`,pn=["triggered","resolved","no-data"],LM=["sent","stale","pending","rate-limited","failed","silenced"],qh=n.Optional(n.Object({maxMessages:n.Integer({minimum:1,description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({minimum:1,description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),Hh=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({minimum:1,description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),MM=n.Object({id:c({description:"Identifier of the notification target"}),rateLimit:qh,config:U("type",[n.Object({type:n.Literal("slack"),channel:c({description:"Slack channel ID that receives the notification"}),integrationId:c({description:"Slack workspace ID that receives the notification"})},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:c({description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty"),integrationId:c({description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),n.Object({type:n.Literal("email"),addresses:n.Array(c({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:c({description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:c({description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:c({description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:c({description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:c({description:"Identifier of the Google Chat integration to use"})},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:c({description:"Identifier of the Squadcast integration to use"})},{$id:"RuleTargetInputSquadcast"})],{description:"Configuration describing how the alert should be delivered"}),renotifyConfig:Hh}),wM=n.Object({id:n.String({description:"Identifier of the notification target"}),rateLimit:qh,renotifyConfig:Hh,config:U("type",[n.Object({type:n.Literal("slack"),channel:n.String({description:"Slack channel ID that receives the notification"}),integrationId:n.String({description:"Slack workspace ID that receives the notification"}),integrationName:n.String({description:"Human readable name of the Slack integration"})},{$id:"RuleTargetConfigSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:n.String({description:"Identifier of the incident.io integration to use"}),integrationName:n.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),n.Object({type:n.Literal("email"),addresses:n.Array(n.String({format:"email"}),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:n.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:n.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),n.Object({type:n.Literal("pagerduty"),integrationId:n.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:n.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:n.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:n.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:n.String({description:"Identifier of the webhook integration to use"}),integrationName:n.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:n.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:n.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:n.String({description:"Identifier of the Google Chat integration to use"}),integrationName:n.String({description:"Human readable name of the Google Chat integration"})},{$id:"RuleTargetConfigGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:n.String({description:"Identifier of the Squadcast integration to use"}),integrationName:n.String({description:"Human readable name of the Squadcast integration"})},{$id:"RuleTargetConfigSquadcast"})],{description:"Configuration describing how the alert was delivered"})}),Rm=U("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(c(),{minItems:1,maxItems:100,description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),xi=n.Object({name:c({description:"Display name of the notification rule"}),queryString:n.Optional(c({type:"tags-query",description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:Rm,prioritiesFilter:n.Array(n.Enum(_t),{maxItems:_t.length,description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(pn),{maxItems:pn.length,description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Optional(n.Array(c({allowEmpty:!1}),{description:"Cluster IDs that can trigger a notification"})),owner:c({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:ye,isActive:n.Boolean(),targets:n.Array(MM,{minItems:1,description:"Notification targets that can receive notifications when the rule matches"})}),Cm=U("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(n.String(),{description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),so=n.Object({id:n.String({description:"Identifier of the notification rule"}),name:n.String({description:"Display name of the notification rule"}),queryString:n.Optional(n.String({description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:Cm,prioritiesFilter:n.Array(n.Enum(_t),{description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(pn),{description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Array(n.String(),{description:"Cluster IDs that can trigger a notification"}),owner:n.String({description:"Team ID that owns and manages the rule"}),createdAt:h(),updatedAt:h(),isActive:n.Boolean(),tags:ye,targets:n.Array(wM,{description:"Notification targets that can receive notifications when the rule matches"}),creator:n.Optional(Oe),updater:n.Optional(Oe)}),_ge=d({tags:["notification-rules"],url:mn,method:"GET",paginated:!0,query:n.Object(Se),response:n.Array(so)}),Age=d({tags:["notification-rules"],url:`${mn}/:id`,params:n.Object({id:c()}),method:"GET",response:so}),xge=d({tags:["notification-rules"],url:mn,method:"POST",body:xi,response:so}),Sge=d({tags:["notification-rules"],url:`${mn}/:id`,method:"PUT",params:n.Object({id:c()}),body:xi,response:so}),Oge=d({tags:["notification-rules"],url:`${mn}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),bge=d({tags:["notification-integrations"],url:`${Bh}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),$M=n.Object({id:n.String(),name:n.String(),type:n.Enum(["slack","incident-io","grafana-irm","pagerduty","microsoft-teams","webhook","servicenow","google-chat","squadcast"]),createdAt:h(),ruleCount:n.Number(),creator:n.Optional(Oe)}),Rge=d({tags:["notification-integrations"],url:`${mn}/integrations`,method:"GET",paginated:!0,query:n.Object(Se),response:n.Array($M)}),Cge=d({tags:["notification-integrations"],url:`${Bh}/callback`,method:"GET",query:n.Object({code:c()}),response:n.Object({success:n.Boolean()})}),Pm=["POST","PUT"],DM=n.Record(n.String(),n.String()),GM=n.Record(n.String(),n.Unknown()),vM=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),jM=U("type",[n.Object({type:n.Literal("json"),value:GM}),n.Object({type:n.Literal("form"),value:vM})]),FM=n.Object({ok:n.String(),alert:n.String()}),Um=n.Object({id:n.String(),name:n.String(),setting:U("type",[n.Object({type:n.Literal("incident-io"),alertSourceConfigId:n.String(),tokenLastChars:n.String()}),n.Object({type:n.Literal("grafana-irm"),urlLastChars:n.String()}),n.Object({type:n.Literal("pagerduty"),integrationKeyLastChars:n.String()}),n.Object({type:n.Literal("microsoft-teams"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("webhook"),urlLastChars:n.String(),method:n.Enum(Pm),authentication:U("type",[n.Object({type:n.Literal("bearer"),tokenLastChars:n.String()}),n.Object({type:n.Literal("basic"),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("custom-header"),key:n.String(),valueLastChars:n.String()}),n.Object({type:n.Literal("none")})]),customHeaders:n.Optional(DM),payloadTemplate:jM,eventNameMapping:n.Optional(FM)}),n.Object({type:n.Literal("servicenow"),instanceName:n.String(),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("google-chat"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("squadcast"),webhookUrlLastChars:n.String()})]),tags:ye}),BM=n.Object({type:n.Literal("webhook"),url:c({type:"uri"}),method:n.Enum(Pm),authentication:U("type",[n.Object({type:n.Literal("bearer"),token:c({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:c({allowEmpty:!1}),password:c({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:c({allowEmpty:!1}),value:c({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),customHeaders:n.Record(c({allowEmpty:!1}),c()),payloadTemplate:U("type",[n.Object({type:n.Literal("json"),value:n.Record(c({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(c({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})]),eventNameMapping:n.Optional(n.Object({ok:c({allowEmpty:!1}),alert:c({allowEmpty:!1})}))}),Kh=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:c(),token:c()}),zh=n.Object({type:n.Literal("grafana-irm"),url:c({type:"uri"})}),Yh=n.Object({type:n.Literal("pagerduty"),integrationKey:c()}),Vh=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:c({type:"uri"})}),qM=n.Object({type:n.Literal("servicenow"),instanceName:c({allowEmpty:!1,description:'Instance name of the ServiceNow instance. This corresponds to the subdomain part of the instance URL, like "my-instance" in "my-instance.service-now.com"'}),username:c({allowEmpty:!1}),password:c({allowEmpty:!1})}),HM=n.Object({type:n.Literal("google-chat"),webhookUrl:c({type:"uri"})}),KM=n.Object({type:n.Literal("squadcast"),webhookUrl:c({type:"uri"})}),zM=n.Object({name:c(),setting:U("type",[Kh,zh,Yh,Vh,BM,qM,HM,KM]),tags:ye}),YM=n.Object({type:n.Literal("webhook"),url:n.Optional(c({type:"uri"})),method:n.Optional(n.Enum(Pm)),authentication:n.Optional(U("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(c({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(c({allowEmpty:!1})),password:n.Optional(c({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(c({allowEmpty:!1})),value:n.Optional(c({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})])),customHeaders:n.Optional(n.Record(c({allowEmpty:!1}),c())),payloadTemplate:n.Optional(U("type",[n.Object({type:n.Literal("json"),value:n.Record(c({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(c({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:n.Optional(n.Object({ok:n.Optional(c({allowEmpty:!1})),alert:n.Optional(c({allowEmpty:!1}))}))}),VM=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(c({allowEmpty:!1})),username:n.Optional(c({allowEmpty:!1})),password:n.Optional(c({allowEmpty:!1}))}),WM=n.Object({type:n.Literal("google-chat"),webhookUrl:c({type:"uri"})}),QM=n.Object({type:n.Literal("squadcast"),webhookUrl:c({type:"uri"})}),ZM=n.Object({name:n.Optional(c()),setting:n.Optional(U("type",[Kh,zh,Yh,Vh,YM,VM,WM,QM]))}),Pge=d({tags:["notification-integrations"],url:ss,method:"POST",body:zM,response:Um}),Uge=d({tags:["notification-integrations"],url:`${ss}/:id`,method:"GET",params:n.Object({id:c()}),response:Um}),Nge=d({tags:["notification-integrations"],url:`${ss}/:id`,method:"PUT",params:n.Object({id:c()}),body:ZM,response:Um}),kge=d({tags:["notification-integrations"],url:`${ss}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),Lge=d({tags:["notification-rules"],url:`${At}/:id/notifications`,method:"GET",params:n.Object({id:c()}),query:n.Optional(n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number())})),response:n.Object({notifications:n.Array(n.Object({id:n.String(),monitorId:n.String(),monitorResultId:n.String(),ruleId:n.Optional(n.String()),targetId:n.Optional(n.String()),status:n.Enum(LM),tryCount:n.Number(),nextTryAt:h(),createdAt:h(),updatedAt:h(),sentAt:n.Optional(h())})),isTruncated:n.Boolean()})}),XM=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast"],Mge=d({tags:["notification-rules"],url:`${mn}/test`,method:"POST",body:n.Object({notificationRule:xi,targetIds:n.Optional(n.Array(c({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:U("success",[n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(XM,{description:"The type of the target (e.g., slack, webhook)"}),status:n.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:n.Optional(n.String({description:"Message if the notification failed for this specific target"}))}))})])});var Si=`/${"v1"}/notification-rules`,Oi=n.Pick(so,["id","name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Rules to trigger notifications to targets based on alert events"}),JM={id:"123-456-abc",name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(Oi,{examples:[JM]});var Wh=d({description:"Retrieve all notification rules",operationId:"listNotificationRules",tags:["notification-rules"],url:Si,method:"GET",paginated:!0,query:n.Object(Se),response:n.Array(Oi)}),Qh=d({description:"Retrieve a notification rule by its id",operationId:"getNotificationRule",tags:["notification-rules"],url:`${Si}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:Oi}),Nm=n.Pick(xi,["name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"]),ew={name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(Nm,{examples:[ew]});var Zh=d({description:"Create a new notification rule",operationId:"createNotificationRule",tags:["notification-rules"],url:Si,method:"POST",body:Nm,response:Oi}),Xh=d({description:"Update a notification rule by its id",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${Si}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:Nm,response:Oi}),tw=n.Object({id:c({allowEmpty:!1,description:"The notification rule ID to delete"})}),Jh=d({description:"Delete a notification rule by its id",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${Si}/:id`,method:"DELETE",params:tw,response:v});var po=`${Ai}/silences`,e_=n.Union([n.Literal("monday"),n.Literal("tuesday"),n.Literal("wednesday"),n.Literal("thursday"),n.Literal("friday"),n.Literal("saturday"),n.Literal("sunday")]),rw=n.Partial(n.Record(e_,n.Array(n.Object({startTime:n.String({format:Up}),endTime:n.String({format:Up})},{title:"SilenceTimeRange"}),{minItems:1,description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),nw=n.Partial(n.Record(e_,n.Array(n.Object({startTime:n.String(),endTime:n.String()},{title:"SilenceTimeRange"}),{description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),ps='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',t_="One-time silence schedule with specific start and end times",r_="Recurring weekly silence schedule",ow=U("type",[n.Object({type:n.Literal("one-time"),startTime:n.String({format:Np}),endTime:n.String({format:Np}),timeZone:n.Optional(n.String({format:Pp,description:ps}))},{$id:"InputSilenceScheduleOneTime",description:t_}),n.Object({type:n.Literal("recurring"),weeklySchedule:rw,timeZone:n.Optional(n.String({format:Pp,description:ps}))},{$id:"InputSilenceScheduleRecurring",description:r_})],{description:"Schedule defining when the silence is active"}),iw=U("type",[n.Object({type:n.Literal("one-time"),startTime:n.String(),endTime:n.String(),timeZone:n.Optional(n.String({description:ps}))},{$id:"OutputSilenceScheduleOneTime",description:t_}),n.Object({type:n.Literal("recurring"),weeklySchedule:nw,timeZone:n.Optional(n.String({description:ps}))},{$id:"OutputSilenceScheduleRecurring",description:r_})],{description:"Schedule defining when the silence is active"}),ms=n.Object({name:c({description:"Display name of the silence"}),reason:c({allowEmpty:!1,description:"Reason for the silence"}),owner:c({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:ye,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:ow,notificationRuleIds:n.Optional(n.Array(c(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(c({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:Rm,prioritiesFilter:n.Array(n.Enum(_t),{maxItems:_t.length,description:"Monitor priorities to filter which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(pn),{maxItems:pn.length,description:"Transition types to filter which alerts this silence applies to"})}),mo=n.Object({id:n.String({description:"Unique identifier of the silence"}),name:n.String({description:"Display name of the silence"}),reason:n.String({description:"Reason for the silence"}),owner:n.String({description:"Team ID that owns and manages the silence"}),tags:ye,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:iw,notificationRuleIds:n.Optional(n.Array(n.String(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(n.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:Cm,prioritiesFilter:n.Array(n.Enum(_t),{description:"Monitor priorities filtering which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(pn),{description:"Transition types filtering which alerts this silence applies to"}),createdAt:h(),updatedAt:h(),creator:n.Optional(Oe),updater:n.Optional(Oe)}),Xge=d({tags:["notification-silences"],url:po,method:"GET",response:n.Array(mo)}),Jge=d({tags:["notification-silences"],url:`${po}/:id`,params:n.Object({id:c()}),method:"GET",response:mo}),eye=d({tags:["notification-silences"],url:po,method:"POST",body:ms,response:mo}),tye=d({tags:["notification-silences"],url:`${po}/:id`,method:"PUT",params:n.Object({id:c()}),body:ms,response:mo}),rye=d({tags:["notification-silences"],url:`${po}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),nye=d({tags:["notification-silences"],url:`${po}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(c())}),response:n.Object({})});var bi=`/${"v1"}/notification-silences`,cs=n.Pick(mo,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Silences to suppress notifications based on schedules and filters"}),n_=d({description:"Retrieve all notification silences",operationId:"listNotificationSilences",tags:["notification-silences"],url:bi,method:"GET",response:n.Array(cs)}),o_=d({description:"Retrieve a notification silence by its id",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${bi}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:cs}),i_=n.Pick(ms,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"]),a_=d({description:"Create a new notification silence",operationId:"createNotificationSilence",tags:["notification-silences"],url:bi,method:"POST",body:i_,response:cs}),s_=d({description:"Update a notification silence by its id",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${bi}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:i_,response:cs}),aw=n.Object({id:c({allowEmpty:!1,description:"The notification silence ID to delete"})}),p_=d({description:"Delete a notification silence by its id",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${bi}/:id`,method:"DELETE",params:aw,response:v});var sw=["passed","failed","ignored"],pw=n.Enum(sw),m_=["unrouted-logs","team-has-route","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","no-casing-drift","no-duplicate-attr-values","no-debug-logs-in-prod","no-multiline-logs","no-empty-dashboards","monitor-has-notification","no-future-dated-logs","metric-usage","no-stale-dashboards","no-unused-dashboards","no-orphan-monitors","no-flapping-monitors","no-noisy-group-monitors","no-long-alert-monitors","no-redundant-monitors","no-absent-log-fields","k8s-recommended-attributes","k8s-recommended-metrics","k8s-recommended-change-events"],mw=n.Enum(m_),cw=["log","metric","resource","span"],uw=["team","global"],km=n.Object({key:n.Enum(m_),title:n.String(),summary:n.String(),rationale:n.String(),objectType:n.Enum(cw),category:n.Enum(["hygiene","routing","integrity","consistency","redundancy","cost"]),impact:n.Object({label:n.Enum(["critical","important","normal"]),weight:n.Number({minimum:0})}),recommendation:n.String(),scope:n.Optional(n.Enum(uw))}),Lm=n.Intersect([km,n.Object({status:pw,normalizedScore:n.Number({minimum:0,maximum:1}),details:n.Optional(n.Record(n.String(),n.Unknown())),recommendation:n.Optional(n.String()),examples:n.Optional(n.Array(n.Object({type:n.String(),label:n.String(),link:n.Object({to:n.String(),search:n.Optional(n.Unknown()),params:n.Optional(n.Unknown())})})))})]),lw=n.Object({teamId:n.String(),teamName:n.String(),teamWeight:n.Number({minimum:0}),score:n.Number({minimum:0,maximum:1}),weightedScore:n.Number({minimum:0}),totalWeight:n.Number({minimum:0}),ruleResults:n.Array(Lm)}),dw=n.Object({score:n.Optional(n.Number({minimum:0,maximum:1})),ruleResults:n.Array(Lm)}),us=n.Object({generatedAt:n.String({format:"date-time"}),overallScore:n.Optional(n.Number({minimum:0,maximum:1})),rules:n.Array(km),teamResults:n.Array(lw),globalResults:n.Optional(dw)}),gye=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:us}),yye=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:n.Object({clusterId:n.Optional(c({allowEmpty:!1}))}),response:n.Object({report:n.Optional(us)})}),Eye=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:n.Object({ruleKey:mw,teamId:c(),lookbackMinutes:n.Optional(n.Integer({minimum:1,maximum:60})),clusterId:n.Optional(c({allowEmpty:!1}))}),response:n.Object({rule:km,result:Lm,teamId:n.String(),teamName:n.String()})});var fw=`/${"v1"}/quality-reports`,c_=n.Pick(us,["generatedAt","overallScore","rules","teamResults","globalResults"],{$id:"QualityReport",description:"Aggregated quality report with per-team rule evaluations and scores"}),gw={generatedAt:"2026-02-26T12:00:00.000Z",overallScore:.85,rules:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."}],teamResults:[{teamId:"abc-123-def",teamName:"platform",teamWeight:1,score:.85,weightedScore:.85,totalWeight:2,ruleResults:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value.",status:"passed",normalizedScore:1}]}]};Object.assign(c_,{examples:[gw]});var yw=n.Object({clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),u_=d({description:"Retrieve the latest quality report",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${fw}/latest`,method:"GET",query:yw,response:n.Object({report:n.Optional(c_)})});var Ri="/v0/admin-center";var Ht=`${Ri}/retention-policies`,Ew=3650,Mm=n.Integer({minimum:1,maximum:Ew}),tr=n.Object({id:n.String(),env:n.Optional(n.String()),teamId:n.Optional(n.String()),dataSource:n.Enum(Pt),durationDays:Mm,isEnabled:n.Boolean(),createdAt:h(),updatedAt:h()}),ls=n.Object({env:n.Optional(c()),teamId:n.Optional(c()),dataSource:n.Enum(Pt),durationDays:Mm,isEnabled:n.Boolean()}),l_=n.Array(n.Object({env:c(),dataSource:n.Enum(Pt),durationDays:n.Union([Mm,n.Null()]),isEnabled:n.Boolean()})),d_=n.Object({inserted:n.Array(tr),updated:n.Array(tr),deleted:n.Array(tr)}),kye=d({tags:["retention-policies"],url:Ht,method:"POST",body:ls,response:tr}),Lye=d({tags:["retention-policies"],url:Ht,method:"GET",response:n.Array(tr)}),Mye=d({tags:["retention-policies"],url:`${Ht}/:id`,method:"GET",params:n.Object({id:c()}),response:tr}),wye=d({tags:["retention-policies"],url:`${Ht}/:id`,method:"PUT",params:n.Object({id:c()}),body:ls,response:tr}),$ye=d({tags:["retention-policies"],url:`${Ht}/bulk-update`,method:"POST",body:l_,response:d_}),Dye=d({tags:["retention-policies"],url:`${Ht}/bulk-update-for-team`,method:"POST",body:n.Object({teamId:c(),policies:l_}),response:d_}),Gye=d({tags:["retention-policies"],url:`${Ht}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),Ci=["past-24-hours","past-7-days","past-30-days"],vye=d({tags:["retention-policies"],url:`${Ht}/requested-history-percentile/:teamId`,method:"POST",params:n.Object({teamId:c()}),body:n.Object({percentile:n.Number({minimum:0,maximum:1}),observationWindow:n.Enum(Ci),dataSource:n.Enum(Pt)}),response:n.Object({percentile:n.Number({minimum:0,maximum:1}),observationWindow:n.Enum(Ci),dataSource:n.Enum(Pt),teamId:n.String(),requestedHistoryDays:n.Number()})}),Iw=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var Tw=n.Array(n.Object({bucket:n.Enum(Iw),count:n.Number()})),jye=d({tags:["retention-policies"],url:`${Ht}/requested-history-histogram/:teamId`,method:"POST",params:n.Object({teamId:c()}),body:n.Object({observationWindow:n.Enum(Ci),dataSource:n.Enum(Pt)}),response:n.Object({observationWindow:n.Enum(Ci),dataSource:n.Enum(Pt),teamId:n.String(),histogram:Tw})}),Fye=d({tags:["retention-policies"],url:`${Ht}/top-teams-with-retention-surplus`,method:"POST",body:n.Object({dataSource:n.Enum(Pt),observationWindow:n.Enum(Ci),percentile:n.Number({minimum:0,maximum:1}),topN:n.Optional(n.Number({minimum:1,maximum:20}))}),response:n.Array(n.Object({teamId:n.String(),retentionSurplusDays:n.Number()}))});var Pi=`/${"v1"}/retention-policies`,Ui=n.Pick(tr,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Data retention rule for a data source within an environment"}),hw={id:"123-456-abc",env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(Ui,{examples:[hw]});var f_=d({description:"Retrieve all retention policies",operationId:"listRetentionPolicies",tags:["retention-policies"],url:Pi,method:"GET",response:n.Array(Ui)}),g_=d({description:"Retrieve a retention policy by its id",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${Pi}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:Ui}),wm=n.Pick(ls,["env","teamId","dataSource","durationDays","isEnabled"]),_w={env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(wm,{examples:[_w]});var y_=d({description:"Create a new retention policy",operationId:"createRetentionPolicy",tags:["retention-policies"],url:Pi,method:"POST",body:wm,response:Ui}),E_=d({description:"Update a retention policy by its id",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${Pi}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:wm,response:Ui}),I_=d({description:"Delete a retention policy by its id",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${Pi}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});var ds={id:c({allowEmpty:!1,description:"Identifier of the processor"}),description:n.Optional(c({type:"long"})),tags:ye,updatedAt:n.Optional(h())},Aw={...ds,type:n.Literal("creator")},xw=U("subtype",[n.Object({targetAttribute:c({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:c({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:c({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:c({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorMathFormula"})]),Sw=n.Object({...Aw,params:xw}),Ow={...ds,type:n.Literal("mapper")},bw=U("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:c({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:c({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")},{$id:"ProcessorParamsMapperMapAttributes"}),n.Object({attributeName:c({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"ProcessorParamsMapperMapLevel"}),n.Object({attributeName:c({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"ProcessorParamsMapperMapTimestamp"})]),Rw=n.Object({...Ow,params:bw}),Cw={...ds,type:n.Literal("parse-attribute")},Pw=5,Uw=U("subtype",[n.Object({attributeName:c({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(c({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text"}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(c({type:"long"}),{maxItems:Pw,description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:c({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:c({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:c({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:c({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:c({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:c({allowEmpty:!0,description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean(),subtype:n.Literal("key-value")})]),Nw=n.Object({...Cw,params:Uw}),kw=11,$m=n.Cyclic({Processor:n.Union([Rw,Nw,Sw,n.Object({...ds,params:n.Object({items:n.Array(n.Object({query:c({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("Processor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:kw,description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split")})])},"Processor",{description:"Processing step executed sequentially on route logs"});var Lw="/v0/logs",Lr=`${Lw}/routes`,cn=n.Object({id:n.String({description:"Identifier of the log route"}),name:n.String({description:"Human readable name shown for the route"}),description:n.Optional(n.String()),isEnabled:n.Boolean(),query:n.String({description:"Query that selects which logs should enter the route"}),rank:n.Number(),tags:ye,owner:n.String({description:"Team ID owning and managing the route"}),processors:n.Array($m,{description:"Ordered processors applied to logs that match the route"}),creator:n.Optional(Oe),updater:n.Optional(Oe),updatedAt:h(),createdAt:h(),assetUpdatedAt:h()},{title:"Route"}),Ni=n.Object({name:c({allowEmpty:!1,description:"Human readable name shown for the route"}),description:n.Optional(c({type:"long"})),isEnabled:n.Boolean(),query:c({type:"tsuga-query",description:"Query that selects which logs should enter the route"}),tags:ye,owner:c({allowEmpty:!1,description:"Team ID owning and managing the route"}),processors:n.Array($m,{maxItems:50,description:"Ordered processors applied to logs that match the route"})}),pEe=d({tags:["routes"],url:Lr,method:"GET",paginated:!0,query:n.Object(Se),response:n.Array(cn)}),mEe=d({tags:["routes"],url:`${Lr}/:id`,params:n.Object({id:c()}),method:"GET",response:cn}),cEe=d({tags:["routes"],url:Lr,method:"POST",body:Ni,response:cn}),uEe=d({tags:["routes"],url:`${Lr}/:id`,method:"PUT",body:Ni,params:n.Object({id:c()}),response:cn}),lEe=d({tags:["routes"],url:`${Lr}/:id/clone`,method:"POST",params:n.Object({id:c()}),body:Ni,response:cn}),dEe=d({tags:["routes"],url:`${Lr}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),fEe=d({tags:["routes"],url:`${Lr}/:id/modify-ranking`,method:"PUT",params:n.Object({id:c()}),body:n.Object({rank:n.Number()}),response:n.Object({})}),gEe=d({tags:["routes"],url:`${Lr}/:id/enable`,method:"PUT",params:n.Object({id:c()}),body:n.Object({enable:n.Boolean()}),response:n.Object({})});var ki=`/${"v1"}/routes`,Li=n.Pick(cn,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Log route allowing to standardize logs and enrich them with additional data"}),Mw={id:"123-456-abc",name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(Li,{examples:[Mw]});var T_=d({description:"Retrieve all routes",operationId:"listRoutes",tags:["routes"],url:ki,method:"GET",paginated:!0,query:n.Object(Se),response:n.Array(Li)}),h_=d({description:"Retrieve a route by its id",operationId:"getRoute",tags:["routes"],url:`${ki}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:Li}),Dm=n.Pick(Ni,["name","description","isEnabled","query","tags","owner","processors"]),ww={name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(Dm,{examples:[ww]});var __=d({description:"Create a new route",operationId:"createRoute",tags:["routes"],url:ki,method:"POST",body:Dm,response:Li}),A_=d({description:"Update a route by its id",operationId:"updateRoute",tags:["routes"],url:`${ki}/:id`,method:"PUT",body:Dm,params:n.Object({id:c({allowEmpty:!1})}),response:Li}),x_=d({description:"Delete a route by its id",operationId:"deleteRoute",tags:["routes"],url:`${ki}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});var un=`${Ri}/tag-policies`;var S_=["ingestion-api-key","operation-api-key","dashboard","log-route","monitor","notification-rule","notification-silence","slo"],$w=["logs","metrics","traces"],O_=n.Array(n.Enum(S_)),b_=n.Array(n.Enum($w)),Dw=n.Union([O_,b_]),R_=n.Object({teamIds:n.Array(c(),{minItems:1,maxItems:100}),mode:n.Enum(["include","exclude"])}),C_=U("type",[n.Object({type:n.Literal("telemetry"),assetTypes:b_,shouldInsertWarning:n.Boolean(),dropSample:n.Optional(n.Number({minimum:0,maximum:100}))}),n.Object({type:n.Literal("tsuga_asset"),assetTypes:O_})]),co=n.Object({id:n.String(),name:n.String(),description:n.Optional(n.String()),isActive:n.Boolean(),tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean(),teamScope:n.Optional(R_),configuration:C_,creator:n.Optional(Oe),updater:n.Optional(Oe),owner:n.Optional(n.String()),createdAt:h(),updatedAt:h(),assetUpdatedAt:h()});var Mi=n.Object({name:c(),description:n.Optional(c()),isActive:n.Boolean(),tagKey:c({allowEmpty:!1}),allowedTagValues:n.Array(c({allowEmpty:!1}),{maxItems:1e3}),isRequired:n.Boolean(),teamScope:n.Optional(R_),configuration:C_,owner:c({allowEmpty:!1})}),UEe=d({tags:["tag-policies"],url:un,method:"GET",query:n.Object({teamIds:n.Optional(n.Array(c(),{maxItems:100})),assetTypes:n.Optional(Dw),searchQuery:n.Optional(c())}),response:n.Array(co)}),NEe=d({tags:["tag-policies"],url:`${un}/:id`,method:"GET",params:n.Object({id:c()}),response:co}),kEe=d({tags:["tag-policies"],url:un,method:"POST",body:Mi,response:co}),LEe=d({tags:["tag-policies"],url:`${un}/:id`,method:"PUT",params:n.Object({id:c()}),body:Mi,response:co}),MEe=d({tags:["tag-policies"],url:`${un}/:id`,method:"DELETE",params:n.Object({id:c()}),response:v}),wEe=d({tags:["tag-policies"],url:`${Ri}/applicable-tag-rules`,method:"GET",query:n.Object({assetType:n.Enum(S_),teamId:c()}),response:n.Array(n.Object({tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean()}))}),P_=n.Object({total:n.Number(),totalNonCompliant:n.Number(),idsNonCompliant:n.Array(c())}),U_=n.Union([n.Literal("ingestion-api-key"),n.Literal("operation-api-key"),n.Literal("dashboard"),n.Literal("log-route"),n.Literal("monitor"),n.Literal("notification-rule"),n.Literal("notification-silence"),n.Literal("slo")]),Gw=n.Object({total:n.Number(),totalNonCompliant:n.Number(),byAssetType:n.Record(U_,P_)}),vw=n.Omit(P_,["total"]),jw=n.Object({totalNonCompliant:n.Number(),byAssetType:n.Record(U_,vw)}),N_=n.Object({totals:Gw,byTeam:n.Record(n.String(),jw)}),$Ee=d({tags:["tag-policies"],url:`${un}/:id/stats`,method:"GET",params:n.Object({id:c()}),response:N_}),DEe=d({tags:["tag-policies"],url:`${un}/new-policy-stats`,method:"POST",body:Mi,response:N_});var wi=`/${"v1"}/tag-policies`,fs=n.Pick(co,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga assets or telemetry data"}),k_=n.Pick(Mi,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"]),L_=d({description:"Retrieve all tag policies",operationId:"listTagPolicies",tags:["tag-policies"],url:wi,method:"GET",response:n.Array(fs)}),M_=d({description:"Retrieve a tag policy by its id",operationId:"getTagPolicy",tags:["tag-policies"],url:`${wi}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:fs}),w_=d({description:"Create a new tag policy",operationId:"createTagPolicy",tags:["tag-policies"],url:wi,method:"POST",body:k_,response:fs}),$_=d({description:"Update a tag policy by its id",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${wi}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:k_,response:fs}),D_=d({description:"Delete a tag policy by its id",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${wi}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});var $i=`/${"v1"}/teams`,Di=n.Pick(ro,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership and access to resources"}),Fw={id:"abc-123-def",name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(Di,{examples:[Fw]});var G_=d({description:"Retrieve all teams",operationId:"listTeams",tags:["teams"],url:$i,method:"GET",paginated:!0,query:n.Object(Se),response:n.Array(Di)}),v_=d({description:"Retrieve a team by its id",operationId:"getTeam",tags:["teams"],url:`${$i}/:id`,method:"GET",params:n.Object({id:c({allowEmpty:!1})}),response:Di}),Gm=n.Pick(rs,["name","description","visibility","tags"]),Bw={name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(Gm,{examples:[Bw]});var j_=d({description:"Create a new team",operationId:"createTeam",tags:["teams"],url:$i,method:"POST",body:Gm,response:Di}),F_=d({description:"Update a team by its id",operationId:"updateTeam",tags:["teams"],url:`${$i}/:id`,method:"PUT",params:n.Object({id:c({allowEmpty:!1})}),body:Gm,response:Di}),B_=d({description:"Delete a team by its id",operationId:"deleteTeam",tags:["teams"],url:`${$i}/:id`,method:"DELETE",params:n.Object({id:c({allowEmpty:!1})}),response:v});function qw(e){return a.IsObject(e)&&a.HasPropertyKey(e,"check")&&a.HasPropertyKey(e,"errors")&&a.IsFunction(e.check)&&a.IsFunction(e.errors)}function vm(e){return a.HasPropertyKey(e,"~guard")&&qw(e["~guard"])}function jm(e){return a.HasPropertyKey(e,"~refine")&&a.IsArray(e["~refine"])&&a.Every(e["~refine"],0,t=>a.IsObject(t)&&a.HasPropertyKey(t,"refine")&&a.HasPropertyKey(t,"message")&&a.IsFunction(t.refine)&&a.IsString(t.message))}function rr(e){return a.IsObject(e)&&!a.IsArray(e)}function gs(e){return a.IsBoolean(e)}function D(e){return rr(e)||gs(e)}function Fm(e){return a.HasPropertyKey(e,"additionalItems")&&D(e.additionalItems)}function nr(e){return a.HasPropertyKey(e,"additionalProperties")&&D(e.additionalProperties)}function Bm(e){return a.HasPropertyKey(e,"allOf")&&a.IsArray(e.allOf)&&e.allOf.every(t=>D(t))}function Gi(e){return a.HasPropertyKey(e,"$anchor")&&a.IsString(e.$anchor)}function qm(e){return a.HasPropertyKey(e,"anyOf")&&a.IsArray(e.anyOf)&&e.anyOf.every(t=>D(t))}function Hm(e){return a.HasPropertyKey(e,"const")}function ln(e){return a.HasPropertyKey(e,"contains")&&D(e.contains)}function Et(e){return a.HasPropertyKey(e,"default")}function Km(e){return a.HasPropertyKey(e,"dependencies")&&a.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>D(t)||a.IsArray(t)&&t.every(r=>a.IsString(r)))}function zm(e){return a.HasPropertyKey(e,"dependentRequired")&&a.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>a.IsArray(t)&&t.every(r=>a.IsString(r)))}function Ym(e){return a.HasPropertyKey(e,"dependentSchemas")&&a.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>D(t))}function Vm(e){return a.HasPropertyKey(e,"$dynamicAnchor")&&a.IsString(e.$dynamicAnchor)}function Wm(e){return a.HasPropertyKey(e,"else")&&D(e.else)}function Qm(e){return a.HasPropertyKey(e,"enum")&&a.IsArray(e.enum)}function Zm(e){return a.HasPropertyKey(e,"exclusiveMaximum")&&(a.IsNumber(e.exclusiveMaximum)||a.IsBigInt(e.exclusiveMaximum))}function or(e){return a.HasPropertyKey(e,"exclusiveMinimum")&&(a.IsNumber(e.exclusiveMinimum)||a.IsBigInt(e.exclusiveMinimum))}function vi(e){return a.HasPropertyKey(e,"format")&&a.IsString(e.format)}function dn(e){return a.HasPropertyKey(e,"$id")&&a.IsString(e.$id)}function Xm(e){return a.HasPropertyKey(e,"if")&&D(e.if)}function uo(e){return a.HasPropertyKey(e,"items")&&(D(e.items)||a.IsArray(e.items)&&e.items.every(t=>D(t)))}function Jm(e){return uo(e)&&a.IsArray(e.items)}function ec(e){return a.HasPropertyKey(e,"maximum")&&(a.IsNumber(e.maximum)||a.IsBigInt(e.maximum))}function tc(e){return a.HasPropertyKey(e,"maxContains")&&a.IsNumber(e.maxContains)}function ys(e){return a.HasPropertyKey(e,"maxItems")&&a.IsNumber(e.maxItems)}function rc(e){return a.HasPropertyKey(e,"maxLength")&&a.IsNumber(e.maxLength)}function nc(e){return a.HasPropertyKey(e,"maxProperties")&&a.IsNumber(e.maxProperties)}function ir(e){return a.HasPropertyKey(e,"minimum")&&(a.IsNumber(e.minimum)||a.IsBigInt(e.minimum))}function fn(e){return a.HasPropertyKey(e,"minContains")&&a.IsNumber(e.minContains)}function lo(e){return a.HasPropertyKey(e,"minItems")&&a.IsNumber(e.minItems)}function ji(e){return a.HasPropertyKey(e,"minLength")&&a.IsNumber(e.minLength)}function Fi(e){return a.HasPropertyKey(e,"minProperties")&&a.IsNumber(e.minProperties)}function oc(e){return a.HasPropertyKey(e,"multipleOf")&&(a.IsNumber(e.multipleOf)||a.IsBigInt(e.multipleOf))}function ic(e){return a.HasPropertyKey(e,"not")&&D(e.not)}function ac(e){return a.HasPropertyKey(e,"oneOf")&&a.IsArray(e.oneOf)&&e.oneOf.every(t=>D(t))}function Bi(e){return a.HasPropertyKey(e,"pattern")&&(a.IsString(e.pattern)||e.pattern instanceof RegExp)}function qi(e){return a.HasPropertyKey(e,"patternProperties")&&a.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>D(t))}function fo(e){return a.HasPropertyKey(e,"prefixItems")&&a.IsArray(e.prefixItems)&&e.prefixItems.every(t=>D(t))}function Hi(e){return a.HasPropertyKey(e,"properties")&&a.IsObject(e.properties)&&Object.values(e.properties).every(t=>D(t))}function sc(e){return a.HasPropertyKey(e,"propertyNames")&&(a.IsObject(e.propertyNames)||D(e.propertyNames))}function Hw(e){return a.HasPropertyKey(e,"$recursiveAnchor")&&a.IsBoolean(e.$recursiveAnchor)}function Es(e){return Hw(e)&&a.IsEqual(e.$recursiveAnchor,!0)}function pc(e){return a.HasPropertyKey(e,"$recursiveRef")&&a.IsString(e.$recursiveRef)}function mc(e){return a.HasPropertyKey(e,"$ref")&&a.IsString(e.$ref)}function gn(e){return a.HasPropertyKey(e,"required")&&a.IsArray(e.required)&&e.required.every(t=>a.IsString(t))}function cc(e){return a.HasPropertyKey(e,"then")&&D(e.then)}function uc(e){return a.HasPropertyKey(e,"type")&&(a.IsString(e.type)||a.IsArray(e.type)&&e.type.every(t=>a.IsString(t)))}function go(e){return a.HasPropertyKey(e,"uniqueItems")&&a.IsBoolean(e.uniqueItems)}function Is(e){return a.HasPropertyKey(e,"unevaluatedItems")&&D(e.unevaluatedItems)}function Ts(e){return a.HasPropertyKey(e,"unevaluatedProperties")&&D(e.unevaluatedProperties)}var et=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(t){return this.indices.add(t),!0}AddKey(t){return this.keys.add(t),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(t){for(let r of t)r.indices.forEach(o=>this.indices.add(o)),r.keys.forEach(o=>this.keys.add(o));return!0}},Ki=class extends et{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},De=class extends Ki{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};var Kw="external_",zw=0,A_e={identifier:`${Kw}${zw}`,variables:[]};function q_(e,t,r,o){return r["~guard"].check(o)}function H_(e,t,r,o,i,s){return i["~guard"].check(s)||t.AddError({keyword:"~guard",schemaPath:r,instancePath:o,params:{errors:i["~guard"].errors(s)}})}function K_(e,t,r,o){return a.Every(r["~refine"],0,(i,s)=>i.refine(o))}function z_(e,t,r,o,i,s){return a.EveryAll(i["~refine"],0,(m,u)=>m.refine(s)||t.AddError({keyword:"~refine",schemaPath:r,instancePath:o,params:{index:u,message:m.message}}))}function Y_(e){return uo(e)&&a.IsArray(e.items)}function V_(e,t,r,o){return Y_(r)?o.every((s,m)=>a.IsLessThan(m,r.items.length)||$(e,t,r.additionalItems,s)&&t.AddIndex(m)):!0}function W_(e,t,r,o,i,s){return Y_(i)?s.every((u,l)=>{let g=`${r}/additionalItems`,E=`${o}/${l}`;return a.IsLessThan(l,i.items.length)||K(e,t,g,E,i.additionalItems,u)&&t.AddIndex(l)}):!0}function Yw(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function Q_(e){let t=[];return qi(e)&&t.push(...a.Keys(e.patternProperties)),Hi(e)&&t.push(...a.Keys(e.properties).map(Yw)),a.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function Z_(e,t,r,o){let i=new RegExp(Q_(r));return a.Every(a.Keys(o),0,(m,u)=>i.test(m)||$(e,t,r.additionalProperties,o[m])&&t.AddKey(m))}function X_(e,t,r,o,i,s){let m=new RegExp(Q_(i)),u=[];return a.EveryAll(a.Keys(s),0,(g,E)=>{let I=`${r}/additionalProperties`,C=`${o}/${g}`,Re=new De,je=m.test(g)||K(e,Re,I,C,i.additionalProperties,s[g])&&t.AddKey(g);return je||u.push(g),je})||t.AddError({keyword:"additionalProperties",schemaPath:r,instancePath:o,params:{additionalProperties:u}})}function J_(e,t,r,o){let i=r.allOf.reduce((s,m)=>{let u=new et;return $(e,u,m,o)?[...s,u]:s},[]);return a.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function eA(e,t,r,o,i,s){let m=[],u=i.allOf.reduce((g,E,I)=>{let C=`${r}/allOf/${I}`,Re=new De,je=K(e,Re,C,o,E,s);return je||m.push(Re),je?[...g,Re]:g},[]),l=a.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return l||m.forEach(g=>g.GetErrors().forEach(E=>t.AddError(E))),l}function tA(e,t,r,o){let i=r.anyOf.reduce((s,m,u)=>{let l=new et;return $(e,l,m,o)?[...s,l]:s},[]);return a.IsGreaterThan(i.length,0)&&t.Merge(i)}function rA(e,t,r,o,i,s){let m=[],u=i.anyOf.reduce((g,E,I)=>{let C=new De,Re=`${r}/anyOf/${I}`,je=K(e,C,Re,o,E,s);return je||m.push(C),je?[...g,C]:g},[]),l=a.IsGreaterThan(u.length,0)&&t.Merge(u);return l||m.forEach(g=>g.GetErrors().forEach(E=>t.AddError(E))),l||t.AddError({keyword:"anyOf",schemaPath:r,instancePath:o,params:{}})}function dc(e,t,r,o){return r}function nA(e,t,r,o,i,s){return dc(e,t,i,s)||t.AddError({keyword:"boolean",schemaPath:r,instancePath:o,params:{}})}function fc(e,t,r,o){return a.IsValueLike(r.const)?a.IsEqual(o,r.const):a.IsDeepEqual(o,r.const)}function oA(e,t,r,o,i,s){return fc(e,t,i,s)||t.AddError({keyword:"const",schemaPath:r,instancePath:o,params:{allowedValue:i.const}})}function Vw(e){return!(fn(e)&&a.IsEqual(e.minContains,0))}function gc(e,t,r,o){return Vw(r)?!a.IsEqual(o.length,0)&&o.some(i=>$(e,t,r.contains,i)):!0}function iA(e,t,r,o,i,s){return gc(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:1}})}function aA(e,t,r,o){let i=a.IsEqual(a.Keys(o).length,0),s=a.Every(a.Entries(r.dependencies),0,([m,u])=>!a.HasPropertyKey(o,m)||(a.IsArray(u)?u.every(l=>a.HasPropertyKey(o,l)):$(e,t,u,o)));return i||s}function sA(e,t,r,o,i,s){let m=a.IsEqual(a.Keys(s).length,0),u=a.EveryAll(a.Entries(i.dependencies),0,([l,g])=>{let E=`${r}/dependencies/${l}`;return!a.HasPropertyKey(s,l)||(a.IsArray(g)?g.every(I=>a.HasPropertyKey(s,I)||t.AddError({keyword:"dependencies",schemaPath:r,instancePath:o,params:{property:l,dependencies:g}})):K(e,t,E,o,g,s))});return m||u}function pA(e,t,r,o){let i=a.IsEqual(a.Keys(o).length,0),s=a.Every(a.Entries(r.dependentRequired),0,([m,u])=>!a.HasPropertyKey(o,m)||u.every(l=>a.HasPropertyKey(o,l)));return i||s}function mA(e,t,r,o,i,s){let m=a.IsEqual(a.Keys(s).length,0),u=a.EveryAll(a.Entries(i.dependentRequired),0,([l,g])=>!a.HasPropertyKey(s,l)||a.EveryAll(g,0,E=>a.HasPropertyKey(s,E)||t.AddError({keyword:"dependentRequired",schemaPath:r,instancePath:o,params:{property:l,dependencies:g}})));return m||u}function cA(e,t,r,o){let i=a.IsEqual(a.Keys(o).length,0),s=a.Every(a.Entries(r.dependentSchemas),0,([m,u])=>!a.HasPropertyKey(o,m)||$(e,t,u,o));return i||s}function uA(e,t,r,o,i,s){let m=a.IsEqual(a.Keys(s).length,0),u=a.EveryAll(a.Entries(i.dependentSchemas),0,([l,g])=>{let E=`${r}/dependentSchemas/${l}`;return!a.HasPropertyKey(s,l)||K(e,t,E,o,g,s)});return m||u}function yc(e,t,r,o){return r.enum.some(i=>a.IsValueLike(i)?a.IsEqual(o,i):a.IsDeepEqual(o,i))}function lA(e,t,r,o,i,s){return yc(e,t,i,s)||t.AddError({keyword:"enum",schemaPath:r,instancePath:o,params:{allowedValues:i.enum}})}function Ec(e,t,r,o){return a.IsLessThan(o,r.exclusiveMaximum)}function dA(e,t,r,o,i,s){return Ec(e,t,i,s)||t.AddError({keyword:"exclusiveMaximum",schemaPath:r,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function Ic(e,t,r,o){return a.IsGreaterThan(o,r.exclusiveMinimum)}function fA(e,t,r,o,i,s){return Ic(e,t,i,s)||t.AddError({keyword:"exclusiveMinimum",schemaPath:r,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var Eo={};It(Eo,{Clear:()=>yA,Entries:()=>d$,Get:()=>y$,Has:()=>g$,IsDate:()=>zi,IsDateTime:()=>Tc,IsDuration:()=>hc,IsEmail:()=>_c,IsHostname:()=>Ac,IsIPv4:()=>bc,IsIPv6:()=>Rc,IsIdnEmail:()=>xc,IsIdnHostname:()=>Oc,IsIri:()=>Pc,IsIriReference:()=>Cc,IsJsonPointer:()=>Nc,IsJsonPointerUriFragment:()=>Uc,IsRegex:()=>kc,IsRelativeJsonPointer:()=>Lc,IsTime:()=>Yi,IsUri:()=>$c,IsUriReference:()=>Mc,IsUriTemplate:()=>wc,IsUrl:()=>Dc,IsUuid:()=>Gc,Reset:()=>EA,Set:()=>f$,Test:()=>E$});var Ww=[0,31,28,31,30,31,30,31,31,30,31,30,31],Qw=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Zw(e){return e%4===0&&(e%100!==0||e%400===0)}function zi(e){let t=Qw.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&Zw(r)?29:Ww[o])}var Xw=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function Yi(e,t=!0){let r=Xw.exec(e);if(!r)return!1;let o=+r[1],i=+r[2],s=+r[3],m=r[4]==="-"?-1:1,u=+(r[5]||0),l=+(r[6]||0);if(u>23||l>59||t&&!r[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&s<60)return!0;let g=i-l*m,E=o-u*m-(g<0?1:0);return(E===23||E===-1)&&(g===59||g===-1)&&s<61}function Tc(e,t=!0){let r=e.split(/T/i);return r.length===2&&zi(r[0])&&Yi(r[1],t)}var Jw=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function hc(e){return Jw.test(e)}var e$=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[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;function _c(e){return e$.test(e)}var t$=/^(?=.{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;function Ac(e){return t$.test(e)}var r$=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function xc(e){return r$.test(e)}function Sc(e){let t=e.codePointAt(0);return t===void 0?!1:t>=12352&&t<=12447||t>=12448&&t<=12543&&t!==12539||t>=19968&&t<=40959}function Oc(e){if(e.length===0||e.includes(" "))return!1;let t=/[\u002E\u3002\uFF0E\uFF61]/g,r=e.normalize("NFC").replace(t,".");if(r.length>253)return!1;let o=r.split(".");if(o.some(i=>i.length===0))return!1;for(let i of o){if(i.length>63||i.startsWith("-")||i.endsWith("-"))return!1;if(/^xn--/i.test(i)){let l=i.slice(4);if(l.length<2||l.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(i))return!1;let s=i.charAt(0);if(/[\u0903\u0300\u0488]/.test(s))return!1;for(let l=0;l<i.length;l++){let g=i.charAt(l);if(g==="\xB7"){if(l===0||l===i.length-1)return!1;let E=i.charAt(l-1),I=i.charAt(l+1);if(!/^[lL]$/.test(E)||!/^[lL]$/.test(I))return!1}if(g==="\u30FB"){if(i.length===1)return!1;if(l===0){let E=i.charAt(l+1);if(!Sc(E))return!1}else{let E=i.charAt(l-1),I=i.charAt(l+1);if(!Sc(E)||!Sc(I))return!1}}if(g==="\u0375"){if(l===i.length-1)return!1;let E=i.charAt(l+1);if(!/[\u0370-\u03FF]/.test(E))return!1}if(g==="\u05F3"||g==="\u05F4"){if(l===0)return!1;let E=i.charAt(l-1);if(!/[\u05D0-\u05EA]/.test(E))return!1}if(g==="\u200D"&&(l===0||i.charAt(l-1)!=="\u094D"))return!1}let m=!1,u=!1;for(let l=0;l<i.length;l++){let g=i.charAt(l);/[\u0660-\u0669]/.test(g)&&(m=!0),/[\u06F0-\u06F9]/.test(g)&&(u=!0)}if(m&&u)return!1}return!0}var n$=/^(?:(?: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)$/;function bc(e){return n$.test(e)}var o$=/^((([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;function Rc(e){return o$.test(e)}function gA(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function Cc(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;let t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?gA(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:gA(e)}function Pc(e){try{return new URL(e),!0}catch{return!1}}var i$=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Uc(e){return i$.test(e)}var a$=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function Nc(e){return a$.test(e)}function kc(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var s$=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Lc(e){return s$.test(e)}var p$=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function Mc(e){return p$.test(e)}var m$=/^(?:(?:[^\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;function wc(e){return m$.test(e)}var c$=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function $c(e){return c$.test(e)}var u$=/^(?: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;function Dc(e){return u$.test(e)}var l$=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Gc(e){return l$.test(e)}var me=new Map;function yA(){me.clear()}function d$(){return[...me.entries()]}function f$(e,t){me.set(e,t)}function g$(e){return me.has(e)}function y$(e){return me.get(e)}function E$(e,t){return me.get(e)?.(t)??!0}function EA(){yA(),me.set("date-time",Tc),me.set("date",zi),me.set("duration",hc),me.set("email",_c),me.set("hostname",Ac),me.set("idn-email",xc),me.set("idn-hostname",Oc),me.set("ipv4",bc),me.set("ipv6",Rc),me.set("iri-reference",Cc),me.set("iri",Pc),me.set("json-pointer-uri-fragment",Uc),me.set("json-pointer",Nc),me.set("regex",kc),me.set("relative-json-pointer",Lc),me.set("time",Yi),me.set("uri-reference",Mc),me.set("uri-template",wc),me.set("uri",$c),me.set("url",Dc),me.set("uuid",Gc)}EA();function vc(e,t,r,o){return Eo.Test(r.format,o)}function IA(e,t,r,o,i,s){return vc(e,t,i,s)||t.AddError({keyword:"format",schemaPath:r,instancePath:o,params:{format:i.format}})}function TA(e,t,r,o){let i=cc(r)?r.then:!0,s=Wm(r)?r.else:!0;return $(e,t,r.if,o)?$(e,t,i,o):$(e,t,s,o)}function hA(e,t,r,o,i,s){let m=cc(i)?i.then:!0,u=Wm(i)?i.else:!0,l=new De,g=K(e,l,`${r}/if`,o,i.if,s)?K(e,l,`${r}/then`,o,m,s)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"then"}}):K(e,t,`${r}/else`,o,u,s)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"else"}});return g&&t.Merge([l]),g}function I$(e,t,r,o){return a.Every(r.items,0,(i,s)=>a.IsLessEqualThan(o.length,s)||$(e,t,i,o[s])&&t.AddIndex(s))}function T$(e,t,r,o,i,s){return a.EveryAll(i.items,0,(m,u)=>{let l=`${r}/items/${u}`,g=`${o}/${u}`;return a.IsLessEqualThan(s.length,u)||K(e,t,l,g,m,s[u])&&t.AddIndex(u)})}function h$(e,t,r,o){let i=fo(r)?r.prefixItems.length:0;return a.Every(o,i,(s,m)=>$(e,t,r.items,s)&&t.AddIndex(m))}function _$(e,t,r,o,i,s){let m=fo(i)?i.prefixItems.length:0;return a.EveryAll(s,m,(u,l)=>{let g=`${r}/items`,E=`${o}/${l}`;return K(e,t,g,E,i.items,u)&&t.AddIndex(l)})}function _A(e,t,r,o){return Jm(r)?I$(e,t,r,o):h$(e,t,r,o)}function AA(e,t,r,o,i,s){return Jm(i)?T$(e,t,r,o,i,s):_$(e,t,r,o,i,s)}function A$(e){return ln(e)}function jc(e,t,r,o){if(!A$(r))return!0;let i=o.reduce((s,m)=>$(e,t,r.contains,m)?++s:s,0);return a.IsLessEqualThan(i,r.maxContains)}function xA(e,t,r,o,i,s){let m=fn(i)?i.minContains:1;return jc(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:m,maxContains:i.maxContains}})}function Fc(e,t,r,o){return a.IsLessEqualThan(o,r.maximum)}function SA(e,t,r,o,i,s){return Fc(e,t,i,s)||t.AddError({keyword:"maximum",schemaPath:r,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function Bc(e,t,r,o){return a.IsLessEqualThan(o.length,r.maxItems)}function OA(e,t,r,o,i,s){return Bc(e,t,i,s)||t.AddError({keyword:"maxItems",schemaPath:r,instancePath:o,params:{limit:i.maxItems}})}function qc(e,t,r,o){return a.IsMaxLength(o,r.maxLength)}function bA(e,t,r,o,i,s){return qc(e,t,i,s)||t.AddError({keyword:"maxLength",schemaPath:r,instancePath:o,params:{limit:i.maxLength}})}function Hc(e,t,r,o){return a.IsLessEqualThan(a.Keys(o).length,r.maxProperties)}function RA(e,t,r,o,i,s){return Hc(e,t,i,s)||t.AddError({keyword:"maxProperties",schemaPath:r,instancePath:o,params:{limit:i.maxProperties}})}function x$(e){return ln(e)}function Kc(e,t,r,o){if(!x$(r))return!0;let i=o.reduce((s,m)=>$(e,t,r.contains,m)?++s:s,0);return a.IsGreaterEqualThan(i,r.minContains)}function CA(e,t,r,o,i,s){return Kc(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:i.minContains}})}function zc(e,t,r,o){return a.IsGreaterEqualThan(o,r.minimum)}function PA(e,t,r,o,i,s){return zc(e,t,i,s)||t.AddError({keyword:"minimum",schemaPath:r,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function Yc(e,t,r,o){return a.IsGreaterEqualThan(o.length,r.minItems)}function UA(e,t,r,o,i,s){return Yc(e,t,i,s)||t.AddError({keyword:"minItems",schemaPath:r,instancePath:o,params:{limit:i.minItems}})}function Vc(e,t,r,o){return a.IsMinLength(o,r.minLength)}function NA(e,t,r,o,i,s){return Vc(e,t,i,s)||t.AddError({keyword:"minLength",schemaPath:r,instancePath:o,params:{limit:i.minLength}})}function Wc(e,t,r,o){return a.IsGreaterEqualThan(a.Keys(o).length,r.minProperties)}function kA(e,t,r,o,i,s){return Wc(e,t,i,s)||t.AddError({keyword:"minProperties",schemaPath:r,instancePath:o,params:{limit:i.minProperties}})}function Qc(e,t,r,o){return a.IsMultipleOf(o,r.multipleOf)}function LA(e,t,r,o,i,s){return Qc(e,t,i,s)||t.AddError({keyword:"multipleOf",schemaPath:r,instancePath:o,params:{multipleOf:i.multipleOf}})}function Zc(e,t,r,o){let i=new et;return!$(e,i,r.not,o)&&t.Merge([i])}function MA(e,t,r,o,i,s){return Zc(e,t,i,s)||t.AddError({keyword:"not",schemaPath:r,instancePath:o,params:{}})}function wA(e,t,r,o){let i=r.oneOf.reduce((s,m)=>{let u=new et;return $(e,u,m,o)?[...s,u]:s},[]);return a.IsEqual(i.length,1)&&t.Merge(i)}function $A(e,t,r,o,i,s){let m=[],u=[],l=i.oneOf.reduce((E,I,C)=>{let Re=new De,je=`${r}/oneOf/${C}`,_o=K(e,Re,je,o,I,s);return _o&&u.push(C),_o||m.push(Re),_o?[...E,Re]:E},[]),g=a.IsEqual(l.length,1)&&t.Merge(l);return!g&&a.IsEqual(u.length,0)&&m.forEach(E=>E.GetErrors().forEach(I=>t.AddError(I))),g||t.AddError({keyword:"oneOf",schemaPath:r,instancePath:o,params:{passingSchemas:u}})}function Xc(e,t,r,o){return(a.IsString(r.pattern)?new RegExp(r.pattern):r.pattern).test(o)}function DA(e,t,r,o,i,s){return Xc(e,t,i,s)||t.AddError({keyword:"pattern",schemaPath:r,instancePath:o,params:{pattern:i.pattern}})}function GA(e,t,r,o){return a.Every(a.Entries(r.patternProperties),0,([i,s])=>{let m=new RegExp(i);return a.Every(a.Entries(o),0,([u,l])=>!m.test(u)||$(e,t,s,l)&&t.AddKey(u))})}function vA(e,t,r,o,i,s){return a.EveryAll(a.Entries(i.patternProperties),0,([m,u])=>{let l=`${r}/patternProperties/${m}`,g=new RegExp(m);return a.EveryAll(a.Entries(s),0,([E,I])=>{let C=`${o}/${E}`;return!g.test(E)||K(e,t,l,C,u,I)&&t.AddKey(E)})})}function jA(e,t,r,o){return a.IsEqual(o.length,0)||a.Every(r.prefixItems,0,(i,s)=>a.IsLessEqualThan(o.length,s)||$(e,t,i,o[s])&&t.AddIndex(s))}function FA(e,t,r,o,i,s){return a.IsEqual(s.length,0)||a.EveryAll(i.prefixItems,0,(m,u)=>{let l=`${r}/prefixItems/${u}`,g=`${o}/${u}`;return a.IsLessEqualThan(s.length,u)||K(e,t,l,g,m,s[u])&&t.AddIndex(u)})}function Jc(e,t){return e.includes(t)||dt.Get().exactOptionalPropertyTypes}function eu(e,t){return a.IsUndefined(e[t])}function BA(e,t,r,o){let i=gn(r)?r.required:[];return a.Every(a.Entries(r.properties),0,([m,u])=>{let l=!a.HasPropertyKey(o,m)||$(e,t,u,o[m])&&t.AddKey(m);return Jc(i,m)?l:eu(o,m)||l})}function qA(e,t,r,o,i,s){let m=gn(i)?i.required:[];return a.EveryAll(a.Entries(i.properties),0,([l,g])=>{let E=`${r}/properties/${l}`,I=`${o}/${l}`,C=()=>!a.HasPropertyKey(s,l)||K(e,t,E,I,g,s[l])&&t.AddKey(l);return Jc(m,l)?C():eu(s,l)||C()})}function HA(e,t,r,o){return a.Every(a.Keys(o),0,(i,s)=>$(e,t,r.propertyNames,i))}function KA(e,t,r,o,i,s){let m=[];return a.EveryAll(a.Keys(s),0,(l,g)=>{let E=`${o}/${l}`,I=`${r}/propertyNames`,C=new De,Re=K(e,C,I,E,i.propertyNames,l);return Re||m.push(l),Re})||t.AddError({keyword:"propertyNames",schemaPath:r,instancePath:o,params:{propertyNames:m}})}function zA(e,t,r,o){let i=e.RecursiveRef(r.$recursiveRef)??!1;return D(i)&&$(e,t,i,o)}function YA(e,t,r,o,i,s){let m=e.RecursiveRef(i.$recursiveRef)??!1;return D(m)&&K(e,t,"#",o,m,s)}function QA(e,t,r,o){let i=e.Ref(r.$ref)??!1,s=new et,m=D(i)&&$(e,s,i,o);return m&&t.Merge([s]),m}function ZA(e,t,r,o,i,s){let m=e.Ref(i.$ref)??!1,u=new De,l=D(m)&&K(e,u,"#",o,m,s);return l&&t.Merge([u]),l||u.GetErrors().forEach(g=>t.AddError(g)),l}function XA(e,t,r,o){return a.Every(r.required,0,i=>a.HasPropertyKey(o,i))}function JA(e,t,r,o,i,s){let m=[];return a.EveryAll(i.required,0,l=>{let g=a.HasPropertyKey(s,l);return g||m.push(l),g})||t.AddError({keyword:"required",schemaPath:r,instancePath:o,params:{requiredProperties:m}})}function tu(e,t,r,o,i){return a.IsEqual(r,"object")?a.IsObjectNotArray(i):a.IsEqual(r,"array")?a.IsArray(i):a.IsEqual(r,"boolean")?a.IsBoolean(i):a.IsEqual(r,"integer")?a.IsInteger(i):a.IsEqual(r,"number")?a.IsNumber(i):a.IsEqual(r,"null")?a.IsNull(i):a.IsEqual(r,"string")?a.IsString(i):a.IsEqual(r,"asyncIterator")?a.IsAsyncIterator(i):a.IsEqual(r,"bigint")?a.IsBigInt(i):a.IsEqual(r,"constructor")?a.IsConstructor(i):a.IsEqual(r,"function")?a.IsFunction(i):a.IsEqual(r,"iterator")?a.IsIterator(i):a.IsEqual(r,"symbol")?a.IsSymbol(i):a.IsEqual(r,"undefined")?a.IsUndefined(i):a.IsEqual(r,"void")?a.IsUndefined(i):!0}function ex(e,t,r,o,i){return r.some(s=>tu(e,t,s,o,i))}function tx(e,t,r,o){return a.IsArray(r.type)?ex(e,t,r.type,r,o):tu(e,t,r.type,r,o)}function rx(e,t,r,o,i,s){return(a.IsArray(i.type)?ex(e,t,i.type,i,s):tu(e,t,i.type,i,s))||t.AddError({keyword:"type",schemaPath:r,instancePath:o,params:{type:i.type}})}function nx(e,t,r,o){let i=t.GetIndices();return a.Every(o,0,(s,m)=>(i.has(m)||$(e,t,r.unevaluatedItems,s))&&t.AddIndex(m))}function ox(e,t,r,o,i,s){let m=t.GetIndices(),u=[];return a.EveryAll(s,0,(g,E)=>{let I=new De,C=(m.has(E)||K(e,I,r,o,i.unevaluatedItems,g))&&t.AddIndex(E);return C||u.push(E),C})||t.AddError({keyword:"unevaluatedItems",schemaPath:r,instancePath:o,params:{unevaluatedItems:u}})}function ix(e,t,r,o){let i=t.GetKeys();return a.Every(a.Entries(o),0,([s,m])=>i.has(s)||$(e,t,r.unevaluatedProperties,m)&&t.AddKey(s))}function ax(e,t,r,o,i,s){let m=t.GetKeys(),u=[];return a.EveryAll(a.Entries(s),0,([g,E])=>{let I=new De,C=m.has(g)||K(e,I,r,o,i.unevaluatedProperties,E)&&t.AddKey(g);return C||u.push(g),C})||t.AddError({keyword:"unevaluatedProperties",schemaPath:r,instancePath:o,params:{unevaluatedProperties:u}})}function sx(e){return!a.IsEqual(e.uniqueItems,!1)}function px(e,t,r,o){if(!sx(r))return!0;let i=new Set(o.map(yr.Hash)).size,s=o.length;return a.IsEqual(i,s)}function mx(e,t,r,o,i,s){if(!sx(i))return!0;let m=new Set,u=s.reduce((g,E,I)=>{let C=yr.Hash(E);return m.has(C)?[...g,I]:(m.add(C),g)},[]);return a.IsEqual(u.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:r,instancePath:o,params:{duplicateItems:u}})}function $(e,t,r,o){e.Push(r);let i=gs(r)?dc(e,t,r,o):(!uc(r)||tx(e,t,r,o))&&(!(a.IsObject(o)&&!a.IsArray(o))||(!gn(r)||XA(e,t,r,o))&&(!nr(r)||Z_(e,t,r,o))&&(!Km(r)||aA(e,t,r,o))&&(!zm(r)||pA(e,t,r,o))&&(!Ym(r)||cA(e,t,r,o))&&(!qi(r)||GA(e,t,r,o))&&(!Hi(r)||BA(e,t,r,o))&&(!sc(r)||HA(e,t,r,o))&&(!Fi(r)||Wc(e,t,r,o))&&(!nc(r)||Hc(e,t,r,o)))&&(!a.IsArray(o)||(!Fm(r)||V_(e,t,r,o))&&(!ln(r)||gc(e,t,r,o))&&(!uo(r)||_A(e,t,r,o))&&(!tc(r)||jc(e,t,r,o))&&(!ys(r)||Bc(e,t,r,o))&&(!fn(r)||Kc(e,t,r,o))&&(!lo(r)||Yc(e,t,r,o))&&(!fo(r)||jA(e,t,r,o))&&(!go(r)||px(e,t,r,o)))&&(!a.IsString(o)||(!vi(r)||vc(e,t,r,o))&&(!rc(r)||qc(e,t,r,o))&&(!ji(r)||Vc(e,t,r,o))&&(!Bi(r)||Xc(e,t,r,o)))&&(!(a.IsNumber(o)||a.IsBigInt(o))||(!Zm(r)||Ec(e,t,r,o))&&(!or(r)||Ic(e,t,r,o))&&(!ec(r)||Fc(e,t,r,o))&&(!ir(r)||zc(e,t,r,o))&&(!oc(r)||Qc(e,t,r,o)))&&(!pc(r)||zA(e,t,r,o))&&(!mc(r)||QA(e,t,r,o))&&(!vm(r)||q_(e,t,r,o))&&(!Hm(r)||fc(e,t,r,o))&&(!Qm(r)||yc(e,t,r,o))&&(!Xm(r)||TA(e,t,r,o))&&(!ic(r)||Zc(e,t,r,o))&&(!Bm(r)||J_(e,t,r,o))&&(!qm(r)||tA(e,t,r,o))&&(!ac(r)||wA(e,t,r,o))&&(!Is(r)||!a.IsArray(o)||nx(e,t,r,o))&&(!Ts(r)||!a.IsObject(o)||ix(e,t,r,o))&&(!jm(r)||K_(e,t,r,o));return e.Pop(r),i}function K(e,t,r,o,i,s){e.Push(i);let m=gs(i)?nA(e,t,r,o,i,s):!!(+(!uc(i)||rx(e,t,r,o,i,s))&+(!(a.IsObject(s)&&!a.IsArray(s))||!!(+(!gn(i)||JA(e,t,r,o,i,s))&+(!nr(i)||X_(e,t,r,o,i,s))&+(!Km(i)||sA(e,t,r,o,i,s))&+(!zm(i)||mA(e,t,r,o,i,s))&+(!Ym(i)||uA(e,t,r,o,i,s))&+(!qi(i)||vA(e,t,r,o,i,s))&+(!Hi(i)||qA(e,t,r,o,i,s))&+(!sc(i)||KA(e,t,r,o,i,s))&+(!Fi(i)||kA(e,t,r,o,i,s))&+(!nc(i)||RA(e,t,r,o,i,s))))&+(!a.IsArray(s)||!!(+(!Fm(i)||W_(e,t,r,o,i,s))&+(!ln(i)||iA(e,t,r,o,i,s))&+(!uo(i)||AA(e,t,r,o,i,s))&+(!tc(i)||xA(e,t,r,o,i,s))&+(!ys(i)||OA(e,t,r,o,i,s))&+(!fn(i)||CA(e,t,r,o,i,s))&+(!lo(i)||UA(e,t,r,o,i,s))&+(!fo(i)||FA(e,t,r,o,i,s))&+(!go(i)||mx(e,t,r,o,i,s))))&+(!a.IsString(s)||!!(+(!vi(i)||IA(e,t,r,o,i,s))&+(!rc(i)||bA(e,t,r,o,i,s))&+(!ji(i)||NA(e,t,r,o,i,s))&+(!Bi(i)||DA(e,t,r,o,i,s))))&+(!(a.IsNumber(s)||a.IsBigInt(s))||!!(+(!Zm(i)||dA(e,t,r,o,i,s))&+(!or(i)||fA(e,t,r,o,i,s))&+(!ec(i)||SA(e,t,r,o,i,s))&+(!ir(i)||PA(e,t,r,o,i,s))&+(!oc(i)||LA(e,t,r,o,i,s))))&+(!pc(i)||YA(e,t,r,o,i,s))&+(!mc(i)||ZA(e,t,r,o,i,s))&+(!vm(i)||H_(e,t,r,o,i,s))&+(!Hm(i)||oA(e,t,r,o,i,s))&+(!Qm(i)||lA(e,t,r,o,i,s))&+(!Xm(i)||hA(e,t,r,o,i,s))&+(!ic(i)||MA(e,t,r,o,i,s))&+(!Bm(i)||eA(e,t,r,o,i,s))&+(!qm(i)||rA(e,t,r,o,i,s))&+(!ac(i)||$A(e,t,r,o,i,s))&+(!Is(i)||!a.IsArray(s)||ox(e,t,r,o,i,s))&+(!Ts(i)||!a.IsObject(s)||ax(e,t,r,o,i,s)))&&(!jm(i)||z_(e,t,r,o,i,s));return e.Pop(i),m}var En={};It(En,{Ref:()=>$$});var ar={};It(ar,{Delete:()=>U$,Get:()=>C$,Has:()=>R$,Indices:()=>Vi,Set:()=>P$});function cx(e){if(e.length===0)throw Error("Cannot set root")}function ux(e){if(!a.IsObject(e))throw Error("Cannot set value")}function S$(e){return/^(0|[1-9]\d*)$/.test(e)}function lx(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function O$(e,t){return a.IsObject(t)&&a.HasPropertyKey(t,e)}function b$(e,t){return a.IsObject(t)?t[e]:void 0}function ru(e,t){return e.reduce((r,o)=>b$(o,r),t)}function Vi(e){if(a.IsEqual(e.length,0))return[];let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function R$(e,t){let r=e;return Vi(t).every(o=>O$(o,r)?(r=r[o],!0):!1)}function C$(e,t){let r=Vi(t);return ru(r,e)}function P$(e,t,r){let o=Vi(t);cx(o);let[i,s]=lx(o),m=ru(i,e);return ux(m),m[s]=r,e}function U$(e,t){let r=Vi(t);cx(r);let[o,i]=lx(r),s=ru(o,e);return ux(s),a.IsArray(s)&&S$(i)?s.splice(+i,1):delete s[i],e}function N$(e,t,r){if(e.$id===r.hash)return e;let o=new URL(e.$id,t.href),i=new URL(r.href,t.href);if(a.IsEqual(o.pathname,i.pathname))return r.hash.startsWith("#")?dx(e,t,r):e}function k$(e,t,r){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);if(a.IsEqual(o.href,i.href))return e}function dx(e,t,r){return r.href.endsWith("#")?e:r.hash.startsWith("#")?ar.Get(e,decodeURIComponent(r.hash.slice(1))):void 0}function L$(e,t,r){if(dn(e)){let o=N$(e,t,r);if(!a.IsUndefined(o))return o}if(Gi(e)){let o=k$(e,t,r);if(!a.IsUndefined(o))return o}return dx(e,t,r)}function M$(e,t,r){return e.reduce((o,i)=>{let s=nu(i,t,r);return a.IsUndefined(s)?o:s},void 0)}function w$(e,t,r){return a.Keys(e).reduce((o,i)=>{let s=nu(e[i],t,r);return a.IsUndefined(s)?o:s},void 0)}function nu(e,t,r){if(t=rr(e)&&dn(e)?new URL(e.$id,t.href):t,rr(e)){let o=L$(e,t,r);if(!a.IsUndefined(o))return o}if(a.IsArray(e))return M$(e,t,r);if(a.IsObject(e))return w$(e,t,r)}function $$(e,t){let r=new URL("http://unknown"),o=dn(e)?new URL(e.$id,r.href):r,i=new URL(t,o.href);return nu(e,o,i)}var In=class{constructor(t,r){this.context=t,this.schema=r,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,r)=>new URL(r.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){rr(t)&&(dn(t)&&this.ids.push(t),Gi(t)&&this.anchors.push(t),Es(t)&&this.recursiveAnchors.push(t),Vm(t)&&this.dynamicAnchors.push(t))}Pop(t){rr(t)&&(dn(t)&&this.ids.pop(),Gi(t)&&this.anchors.pop(),Es(t)&&this.recursiveAnchors.pop(),Vm(t)&&this.dynamicAnchors.pop())}FromContext(t){return a.HasPropertyKey(this.context,t)?this.context[t]:void 0}FromRef(t){return t.startsWith("#")?En.Ref(this.Base(),t):En.Ref(this.schema,t)}Ref(t){return this.FromContext(t)??this.FromRef(t)}RecursiveRef(t){return Es(this.Base())?En.Ref(this.recursiveAnchors[0],t):En.Ref(this.Base(),t)}};function fx(...e){let[t,r,o]=te.Match(e,{3:(m,u,l)=>[m,u,l],2:(m,u)=>[{},m,u]}),i=new In(t,r),s=new et;return $(i,s,r,o)}function gx(...e){let[t,r,o]=te.Match(e,{3:(E,I,C)=>[E,I,C],2:(E,I)=>[{},E,I]}),i=dt.Get(),s=_l(),m=[],u=new In(t,r),l=new Ki(E=>{if(!a.IsGreaterEqualThan(m.length,i.maxErrors))return m.push({...E,message:s(E)})});return[K(u,l,"#","",r,o),m]}function se(...e){let[t,r,o]=te.Match(e,{3:(i,s,m)=>[i,s,m],2:(i,s)=>[{},i,s]});return fx(t,r,o)}function wr(...e){let[t,r,o]=te.Match(e,{3:(m,u,l)=>[m,u,l],2:(m,u)=>[{},m,u]}),[i,s]=gx(t,r,o);return s}var $r=class extends Error{constructor(t,r,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:r},writable:!1,configurable:!1,enumerable:!1})}};function yx(e,t,r){return a.IsArray(r)?r.map(o=>ve(e,t.items,o)):r}function Ex(e,t,r){return t.Clean(r)}function Ix(e,t,r){return ve({...e,...t.$defs},Ae(t.$ref),r)}function G$(e){let t=a.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},r=Ct(e);return M(r)?qa(r,t):r}function Tx(e,t,r){let o=G$(t);return ve(e,o,r)}function hs(e){return a.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function hx(e,t,r){if(!a.IsObject(r)||a.IsArray(r))return r;let o=hs(t);for(let i of a.Keys(r)){if(a.HasPropertyKey(t.properties,i)){r[i]=ve(e,t.properties[i],r[i]);continue}if(a.IsBoolean(o)&&a.IsEqual(o,!0)||x(o)&&se(e,o,r[i])){r[i]=ve(e,o,r[i]);continue}delete r[i]}return r}function _x(e,t,r){if(!a.IsObject(r))return r;let o=hs(t),[i,s]=[new RegExp(pt(t)),He(t)];for(let m of a.Keys(r)){if(i.test(m)){r[m]=ve(e,s,r[m]);continue}if(a.IsBoolean(o)&&a.IsEqual(o,!0)||x(o)&&se(e,o,r[m])){r[m]=ve(e,o,r[m]);continue}delete r[m]}return r}function Ax(e,t,r){return a.HasPropertyKey(e,t.$ref)?ve(e,e[t.$ref],r):r}function xx(e,t,r){if(!a.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=ve(e,t.items[i],r[i]);return a.IsGreaterThan(r.length,o)?r.slice(0,o):r}function v$(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=pe(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=pe(e[r]);return t}function j$(e){return a.IsClassInstance(e)?e:v$(e)}function F$(e){return e.map(t=>pe(t))}function B$(e){return e.slice()}function q$(e){return new Map(pe([...e.entries()]))}function H$(e){return new Set(pe([...e.values()]))}function pe(e){return We.IsTypeArray(e)?B$(e):We.IsMap(e)?q$(e):We.IsSet(e)?H$(e):a.IsArray(e)?F$(e):a.IsObject(e)?j$(e):e}function Sx(e,t,r){for(let o of t.anyOf){let i=ve(e,o,pe(r));if(se(e,o,i))return i}return r}function ve(e,t,r){return Z(t)?yx(e,t,r):ft(t)?Ex(e,t,r):ae(t)?Ix(e,t,r):P(t)?Tx(e,t,r):M(t)?hx(e,t,r):de(t)?_x(e,t,r):oe(t)?Ax(e,t,r):H(t)?xx(e,t,r):A(t)?Sx(e,t,r):r}function hn(...e){let[t,r,o]=te.Match(e,{3:(i,s,m)=>[i,s,m],2:(i,s)=>[{},i,s]});return ve(t,r,o)}function Ox(e,t,r){return a.IsArray(r)?r.map(o=>be(e,t.items,o)):r}function bx(e,t,r){return t.Convert(r)}var ee={};It(ee,{Fail:()=>_n,IsOk:()=>iu,Ok:()=>R,TryBigInt:()=>au,TryBoolean:()=>mD,TryNull:()=>yD,TryNumber:()=>OD,TryString:()=>kD,TryUndefined:()=>vD});function iu(e){return a.IsObject(e)&&a.HasPropertyKey(e,"value")}function R(e){return{value:e}}function _n(){}function K$(e){return R(e)}function z$(e){return a.IsEqual(e,!0)?R(BigInt(1)):R(BigInt(0))}function Y$(e){return R(BigInt(Math.trunc(e)))}function V$(e){return R(BigInt(0))}var W$=/^-?(0|[1-9]\d*)n$/,Q$=/^-?(0|[1-9]\d*)\.\d+$/,Z$=/^-?(0|[1-9]\d*)$/;function X$(e){return W$.test(e)}function J$(e){return Q$.test(e)}function eD(e){return Z$.test(e)}function tD(e){let t=e.toLowerCase();return X$(e)?R(BigInt(e.slice(0,e.length-1))):J$(e)?R(BigInt(e.split(".")[0])):eD(e)?R(BigInt(e)):a.IsEqual(t,"false")?R(BigInt(0)):a.IsEqual(t,"true")?R(BigInt(1)):void 0}function rD(e){return R(BigInt(0))}function au(e){return a.IsBigInt(e)?K$(e):a.IsBoolean(e)?z$(e):a.IsNumber(e)?Y$(e):a.IsNull(e)?V$(e):a.IsString(e)?tD(e):a.IsUndefined(e)?rD(e):void 0}function nD(e){return a.IsEqual(e,BigInt(0))?R(!1):a.IsEqual(e,BigInt(1))?R(!0):void 0}function oD(e){return R(e)}function iD(e){return a.IsEqual(e,0)?R(!1):a.IsEqual(e,1)?R(!0):void 0}function aD(e){return R(!1)}function sD(e){return a.IsEqual(e.toLowerCase(),"false")?R(!1):a.IsEqual(e.toLowerCase(),"true")?R(!0):a.IsEqual(e,"0")?R(!1):a.IsEqual(e,"1")?R(!0):void 0}function pD(e){return R(!1)}function mD(e){return a.IsBigInt(e)?nD(e):a.IsBoolean(e)?oD(e):a.IsNumber(e)?iD(e):a.IsNull(e)?aD(e):a.IsString(e)?sD(e):a.IsUndefined(e)?pD(e):void 0}function cD(e){return a.IsEqual(e,BigInt(0))?R(null):void 0}function uD(e){return a.IsEqual(e,!1)?R(null):void 0}function lD(e){return a.IsEqual(e,0)?R(null):void 0}function dD(e){return R(null)}function fD(e){let t=e.toLowerCase();return a.IsEqual(t,"undefined")||a.IsEqual(t,"null")||a.IsEqual(e,"")||a.IsEqual(e,"0")?R(null):void 0}function gD(e){return R(null)}function yD(e){return a.IsBigInt(e)?cD(e):a.IsBoolean(e)?uD(e):a.IsNumber(e)?lD(e):a.IsNull(e)?dD(e):a.IsString(e)?fD(e):a.IsUndefined(e)?gD(e):void 0}var ED=BigInt(Number.MAX_SAFE_INTEGER),ID=BigInt(Number.MIN_SAFE_INTEGER);function TD(e){return e<=ED&&e>=ID}function Rx(e){return TD(e)?R(Number(e)):void 0}function hD(e){return e?R(1):R(0)}function _D(e){return R(e)}function AD(e){return R(0)}function xD(e){let t=+e;if(a.IsNumber(t))return R(t);let r=e.toLowerCase();if(a.IsEqual(r,"false"))return R(0);if(a.IsEqual(r,"true"))return R(1);let o=au(e);return iu(o)?Rx(o.value):void 0}function SD(e){return R(0)}function OD(e){return a.IsBigInt(e)?Rx(e):a.IsBoolean(e)?hD(e):a.IsNumber(e)?_D(e):a.IsNull(e)?AD(e):a.IsString(e)?xD(e):a.IsUndefined(e)?SD(e):void 0}function bD(e){return R(e.toString())}function RD(e){return R(e.toString())}function CD(e){return R(e.toString())}function PD(e){return R("null")}function UD(e){return R(e)}function ND(e){return R("")}function kD(e){return a.IsBigInt(e)?bD(e):a.IsBoolean(e)?RD(e):a.IsNumber(e)?CD(e):a.IsNull(e)?PD(e):a.IsString(e)?UD(e):a.IsUndefined(e)?ND(e):void 0}function LD(e){return a.IsEqual(e,BigInt(0))?R(void 0):void 0}function MD(e){return a.IsEqual(e,!1)?R(void 0):void 0}function wD(e){return a.IsEqual(e,0)?R(void 0):void 0}function $D(e){return R(void 0)}function DD(e){let t=e.toLowerCase();return a.IsEqual(t,"undefined")||a.IsEqual(t,"null")||a.IsEqual(e,"")||a.IsEqual(e,"0")?R(void 0):void 0}function GD(e){return R(void 0)}function vD(e){return a.IsBigInt(e)?LD(e):a.IsBoolean(e)?MD(e):a.IsNumber(e)?wD(e):a.IsNull(e)?$D(e):a.IsString(e)?DD(e):a.IsUndefined(e)?GD(e):void 0}function Cx(e,t,r){if(a.IsBigInt(r))return r;let o=ee.TryBigInt(r);return ee.IsOk(o)?o.value:r}function Px(e,t,r){if(a.IsBoolean(r))return r;let o=ee.TryBoolean(r);return ee.IsOk(o)?o.value:r}function Ux(e,t,r){return be({...e,...t.$defs},Ae(t.$ref),r)}function _s(e,t,r){if(t.anyOf.some(m=>se(e,m,r)))return r;let s=t.anyOf.map(m=>be(e,m,pe(r))).find(m=>se(e,t,m));return a.IsUndefined(s)?r:s}function Nx(e,t,r){let o=Wr(t);return _s(e,o,r)}function kx(e,t,r){if(a.IsInteger(r))return r;let o=ee.TryNumber(r);return ee.IsOk(o)?Math.trunc(o.value):r}function Lx(e,t,r){let o=Ct(t);return be(e,o,r)}function jD(e,t,r){let o=ee.TryBigInt(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function FD(e,t,r){let o=ee.TryBoolean(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function BD(e,t,r){let o=ee.TryNumber(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function qD(e,t,r){let o=ee.TryString(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function Mx(e,t,r){return a.IsEqual(t.const,r)?r:Pl(t)?jD(e,t,r):Ul(t)?FD(e,t,r):Cn(t)?BD(e,t,r):Pn(t)?qD(e,t,r):F()}function wx(e,t,r){if(a.IsNull(r))return r;let o=ee.TryNull(r);return ee.IsOk(o)?o.value:r}function $x(e,t,r){if(a.IsNumber(r))return r;let o=ee.TryNumber(r);return ee.IsOk(o)?o.value:r}function As(e,t,r,o){let i=a.Keys(o);for(let[s,m]of t)for(let u of i)s.test(u)||(o[u]=be(e,r,o[u]));return o}function Wi(e,t,r){return Ce(e)&&a.IsUndefined(r[t])}function HD(e,t,r){let o=a.EntriesRegExp(t.properties),i=a.Keys(r);for(let[s,m]of o)for(let u of i)!s.test(u)||Wi(m,u,r)||(r[u]=be(e,m,r[u]));return a.HasPropertyKey(t,"additionalProperties")&&a.IsObject(t.additionalProperties)?As(e,o,t.additionalProperties,r):r}function Dx(e,t,r){return a.IsObjectNotArray(r)?HD(e,t,r):r}function KD(e,t,r){let o=a.EntriesRegExp(t.patternProperties),i=a.Keys(r);for(let[s,m]of o)for(let u of i)s.test(u)&&(r[u]=be(e,m,r[u]));return a.HasPropertyKey(t,"additionalProperties")&&a.IsObject(t.additionalProperties)?As(e,o,t.additionalProperties,r):r}function Gx(e,t,r){return a.IsObjectNotArray(r)?KD(e,t,r):r}function vx(e,t,r){return a.HasPropertyKey(e,t.$ref)?be(e,e[t.$ref],r):r}function jx(e,t,r){if(a.IsString(r))return r;let o=ee.TryString(r);return ee.IsOk(o)?o.value:r}function Fx(e,t,r){let o=Ke(t.pattern);return be(e,o,r)}function Bx(e,t,r){if(!a.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=be(e,t.items[o],r[o]);return r}function qx(e,t,r){if(a.IsUndefined(r))return r;let o=ee.TryUndefined(r);return ee.IsOk(o)?o.value:r}function Hx(e,t,r){if(a.IsUndefined(r))return r;let o=ee.TryUndefined(r);return ee.IsOk(o)?void 0:r}function be(e,t,r){return Z(t)?Ox(e,t,r):ft(t)?bx(e,t,r):st(t)?Cx(e,t,r):Xe(t)?Px(e,t,r):ae(t)?Ux(e,t,r):Te(t)?Nx(e,t,r):Me(t)?kx(e,t,r):P(t)?Lx(e,t,r):Y(t)?Mx(e,t,r):Mt(t)?wx(e,t,r):le(t)?$x(e,t,r):M(t)?Dx(e,t,r):de(t)?Gx(e,t,r):oe(t)?vx(e,t,r):xe(t)?jx(e,t,r):he(t)?Fx(e,t,r):H(t)?Bx(e,t,r):Gt(t)?qx(e,t,r):A(t)?_s(e,t,r):mt(t)?Hx(e,t,r):r}function Dr(...e){let[t,r,o]=te.Match(e,{3:(i,s,m)=>[i,s,m],2:(i,s)=>[{},i,s]});return be(t,r,o)}function Kx(e,t,r){if(!a.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=ke(e,t.items,r[o]);return r}function zx(e,t,r){return t.Default(r)}function Yx(e,t,r){return ke({...e,...t.$defs},Ae(t.$ref),r)}function Vx(e,t){return a.IsUndefined(t)?a.IsFunction(e.default)?e.default():pe(e.default):t}function Wx(e,t,r){let o=Ct(t);return ke(e,o,r)}function Qx(e,t,r){if(!a.IsObject(r))return r;let o=a.Keys(t.properties);for(let i of o){let s=ke(e,t.properties[i],r[i]);a.IsUndefined(s)&&(Ce(t.properties[i])||!a.HasPropertyKey(t.properties[i],"default"))||(r[i]=ke(e,t.properties[i],r[i]))}if(!nr(t)||a.IsBoolean(t.additionalProperties))return r;for(let i of a.Keys(r))o.includes(i)||(r[i]=ke(e,t.additionalProperties,r[i]));return r}function Zx(e,t,r){if(!a.IsObject(r))return r;let[o,i]=[new RegExp(pt(t)),He(t)];for(let s of a.Keys(r))o.test(s)&&Et(i)&&(r[s]=ke(e,i,r[s]));if(!nr(t))return r;for(let s of a.Keys(r))o.test(s)||(r[s]=ke(e,t.additionalProperties,r[s]));return r}function Xx(e,t,r){return a.HasPropertyKey(e,t.$ref)?ke(e,e[t.$ref],r):r}function Jx(e,t,r){if(!a.IsArray(r))return r;let[o,i]=[t.items,Math.max(t.items.length,r.length)];for(let s=0;s<i;s++)s<o.length&&(r[s]=ke(e,o[s],r[s]));return r}function eS(e,t,r){for(let o of t.anyOf){let i=ke(e,o,pe(r));if(se(e,o,i))return i}return r}function ke(e,t,r){let o=Et(t)?Vx(t,r):r;return Z(t)?Kx(e,t,o):ft(t)?zx(e,t,o):ae(t)?Yx(e,t,o):P(t)?Wx(e,t,o):M(t)?Qx(e,t,o):de(t)?Zx(e,t,o):oe(t)?Xx(e,t,o):H(t)?Jx(e,t,o):A(t)?eS(e,t,o):o}function An(...e){let[t,r,o]=te.Match(e,{3:(i,s,m)=>[i,s,m],2:(i,s)=>[{},i,s]});return ke(t,r,o)}function Io(e){return(...t)=>{let[r,o,i]=te.Match(t,{3:(s,m,u)=>[s,m,u],2:(s,m)=>[{},s,m]});return e.reduce((s,m)=>m(r,o,s),i)}}function zD(e,t,r){return t["~codec"].decode(r)}function YD(e,t,r){return t["~codec"].encode(r)}function Ee(e,t,r,o){return Hr(r)?a.IsEqual(e,"Decode")?zD(t,r,o):YD(t,r,o):o}function VD(e,t,r,o){if(!a.IsArray(o))return F();for(let i=0;i<o.length;i++)o[i]=ce(e,t,r.items,o[i]);return Ee(e,t,r,o)}function WD(e,t,r,o){let i=Ee(e,t,r,o);if(!a.IsArray(i))return i;for(let s=0;s<i.length;s++)i[s]=ce(e,t,r.items,i[s]);return i}function tS(e,t,r,o){return a.IsEqual(e,"Decode")?VD(e,t,r,o):WD(e,t,r,o)}function rS(e,t,r,o){return o=ce(e,{...t,...r.$defs},Ae(r.$ref),o),Ee(e,t,r,o)}function QD(e,t,r,o){for(let i of r.allOf)o=ce(e,t,i,o);return Ee(e,t,r,o)}function ZD(e,t,r,o){let i=Ee(e,t,r,o);for(let s of r.allOf)i=ce(e,t,s,i);return i}function nS(e,t,r,o){return a.IsEqual(e,"Decode")?QD(e,t,r,o):ZD(e,t,r,o)}function XD(e,t,r,o){if(!a.IsObjectNotArray(o))return F();for(let i of a.Keys(r.properties))!a.HasPropertyKey(o,i)||Wi(r.properties[i],i,o)||(o[i]=ce(e,t,r.properties[i],o[i]));return Ee(e,t,r,o)}function JD(e,t,r,o){let i=Ee(e,t,r,o);if(!a.IsObjectNotArray(i))return i;for(let s of a.Keys(r.properties))!a.HasPropertyKey(i,s)||Wi(r.properties[s],s,i)||(i[s]=ce(e,t,r.properties[s],i[s]));return i}function oS(e,t,r,o){return a.IsEqual(e,"Decode")?XD(e,t,r,o):JD(e,t,r,o)}function eG(e,t,r,o){if(!a.IsObjectNotArray(o))return F();let i=new RegExp(pt(r));for(let s of a.Keys(o))i.test(s)||F(),o[s]=ce(e,t,He(r),o[s]);return Ee(e,t,r,o)}function tG(e,t,r,o){let i=Ee(e,t,r,o);if(!a.IsObjectNotArray(i))return i;let s=new RegExp(pt(r));for(let m of a.Keys(i))s.test(m)&&(i[m]=ce(e,t,He(r),i[m]));return i}function iS(e,t,r,o){return a.IsEqual(e,"Decode")?eG(e,t,r,o):tG(e,t,r,o)}function aS(e,t,r,o){return o=a.HasPropertyKey(t,r.$ref)?ce(e,t,t[r.$ref],o):o,Ee(e,t,r,o)}function rG(e,t,r,o){if(!a.IsArray(o))return F();for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=ce(e,t,r.items[i],o[i]);return Ee(e,t,r,o)}function nG(e,t,r,o){let i=Ee(e,t,r,o);if(!a.IsArray(i))return o;for(let s=0;s<Math.min(r.items.length,i.length);s++)i[s]=ce(e,t,r.items[s],i[s]);return i}function sS(e,t,r,o){return a.IsEqual(e,"Decode")?rG(e,t,r,o):nG(e,t,r,o)}function oG(e,t,r,o){for(let i of r.anyOf){if(!se(t,i,o))continue;let s=ce(e,t,i,o);return Ee(e,t,r,s)}return F()}function iG(e,t,r,o){let i=Ee(e,t,r,o);for(let s of r.anyOf){let m=ce(e,t,s,pe(i));if(se(t,s,m))return m}return i}function pS(e,t,r,o){return a.IsEqual(e,"Decode")?oG(e,t,r,o):iG(e,t,r,o)}function ce(e,t,r,o){return Z(r)?tS(e,t,r,o):ae(r)?rS(e,t,r,o):P(r)?nS(e,t,r,o):M(r)?oS(e,t,r,o):de(r)?iS(e,t,r,o):oe(r)?aS(e,t,r,o):H(r)?sS(e,t,r,o):A(r)?pS(e,t,r,o):Ee(e,t,r,o)}var su=class extends $r{constructor(t,r){super("Decode",t,r)}};function aG(e,t,r){if(!se(e,t,r))throw new su(r,wr(e,t,r));return r}function sG(e,t,r){return ce("Decode",e,t,r)}var N0e=Io([(e,t,r)=>pe(r),(e,t,r)=>An(e,t,r),(e,t,r)=>Dr(e,t,r),(e,t,r)=>hn(e,t,r),(e,t,r)=>aG(e,t,r),(e,t,r)=>sG(e,t,r)]);var pu=class extends $r{constructor(t,r){super("Encode",t,r)}};function pG(e,t,r){if(!se(e,t,r))throw new pu(r,wr(e,t,r));return r}function mG(e,t,r){return ce("Encode",e,t,r)}var q0e=Io([(e,t,r)=>pe(r),(e,t,r)=>mG(e,t,r),(e,t,r)=>An(e,t,r),(e,t,r)=>Dr(e,t,r),(e,t,r)=>hn(e,t,r),(e,t,r)=>pG(e,t,r)]);var xt=class extends Error{constructor(t,r){super(r),this.type=t}};function mS(e,t){return a.IsFunction(t.default)?t.default(t):a.IsObject(t.default)?pe(t.default):t.default}function cS(e,t){if(go(t)&&!Et(t))throw new xt(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=lo(t)?t.minItems:0;return Array.from({length:r},()=>ue(e,t.items))}async function*cG(){}function uS(e,t){return cG()}function lS(e,t){return t.Create()}function dS(e,t){return or(t)?BigInt(t.exclusiveMinimum)+BigInt(1):ir(t)?BigInt(t.minimum):BigInt(0)}function fS(e,t){return!1}function gS(e,t){let r=ue(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function yS(e,t){return ue({...e,...t.$defs},Ae(t.$ref))}function ES(e,t){return ue(e,Wr(t))}function IS(e,t){let r=ue(e,t.returnType);return()=>r}function TS(e,t){return or(t)&&a.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:ir(t)?t.minimum:0}function hS(e,t){return ue(e,Ct(t))}function*uG(){}function _S(e,t){return uG()}function AS(e,t){return t.const}function xS(e,t){throw new xt(t,"Cannot create TNever types")}function SS(e,t){return null}function OS(e,t){return or(t)&&a.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:ir(t)?t.minimum:0}function bS(e,t){return(a.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:ue(e,t.properties[i])}),{})}function RS(e,t){return Promise.resolve(ue(e,t.item))}function CS(e,t){if(Fi(t)&&!Et(t))throw new xt(t,"Record with the minProperties constraint must have a default annotation");return{}}function PS(e,t){return a.HasPropertyKey(e,t.$ref)?ue(e,e[t.$ref]):(()=>{throw new xt(t,"Unable to deref Ref")})()}function US(e,t){if((Bi(t)||vi(t))&&!Et(t))throw Error("Strings with format or pattern constraints must specify default");let o=ji(t)?t.minLength:0;return"".padEnd(o)}function NS(e,t){return Symbol()}function kS(e,t){let r=Ke(t.pattern);if(xe(r))throw new xt(t,"Unable to create TemplateLiteral due to infinite type expansion");return ue(e,r)}function LS(e,t){return Array.from({length:t.minItems},(r,o)=>ue(e,t.items[o]))}function MS(e,t){if(a.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return ue(e,t.anyOf[0])}function ue(e,t){return Et(t)?mS(e,t):Z(t)?cS(e,t):Ye(t)?uS(e,t):ft(t)?lS(e,t):st(t)?dS(e,t):Xe(t)?fS(e,t):Pe(t)?gS(e,t):ae(t)?yS(e,t):Te(t)?ES(e,t):Ue(t)?IS(e,t):Me(t)?TS(e,t):P(t)?hS(e,t):Ve(t)?_S(e,t):Y(t)?AS(e,t):Vt(t)?xS(e,t):Mt(t)?SS(e,t):le(t)?OS(e,t):M(t)?bS(e,t):qe(t)?RS(e,t):de(t)?CS(e,t):oe(t)?PS(e,t):xe(t)?US(e,t):wt(t)?NS(e,t):he(t)?kS(e,t):H(t)?LS(e,t):Gt(t)?void 0:A(t)?MS(e,t):mt(t)?void 0:void 0}function Kt(...e){let[t,r]=te.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return ue(t,r)}var mu=class extends $r{constructor(t,r){super("Parse",t,r)}};function lG(e,t,r){if(!se(e,t,r))throw new mu(r,wr(e,t,r));return r}var V$e=Io([(e,t,r)=>pe(r),(e,t,r)=>An(e,t,r),(e,t,r)=>Dr(e,t,r),(e,t,r)=>hn(e,t,r),(e,t,r)=>lG(e,t,r)]);var fG=N({type:q("insert"),path:ot(),value:Fe()}),gG=Object({type:q("update"),path:ot(),value:Fe()}),yG=N({type:q("delete"),path:ot()}),tDe=G([fG,gG,yG]);function To(e){if(!e.body)throw new Error("This command does not accept a request body");let t=e.body;return t.examples?.length?t.examples[0]:Kt(t)}var DS=_u(require("node:fs"));function ho(e){if(e.file){let t=DS.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(t)}if(e.data)return JSON.parse(e.data);throw new Error("Provide a request body with -f <file> or -d <json>. Use --generate-skeleton to get a template.")}function uu(e){let t=e.params;if(t?.properties){let r=Object.keys(t.properties);if(r.length===1&&r[0])return r[0]}return"id"}function GS(e,t,r){let o=e.command(t.commandName).description(t.description),i=Sh(t.commandName).replace(/-/g," "),s=o.command("list").description(`List all ${t.commandName}`);if(t.listOptions)for(let m of t.listOptions)s.option(m.flag,m.description);if(t.enableListBody?s.option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async m=>{if(m.generateSkeleton){ie(To(t.endpoints.list));return}let u=await r()(t.endpoints.list,m.data?{body:ho({data:m.data})}:void 0);ie(u)}):s.action(async m=>{let u={};if(t.listOptions)for(let g of t.listOptions){let E=m[g.queryParam];E!==void 0&&(u[g.queryParam]=E)}let l=await r()(t.endpoints.list,Object.keys(u).length>0?{query:u}:void 0);ie(l)}),t.endpoints.get){let m=t.endpoints.get,u=uu(m);o.command("get <id>").description(`Get a ${i} by ID`).action(async l=>{let g=await r()(m,{params:{[u]:l}});ie(g)})}if(t.endpoints.create){let m=t.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async u=>{if(u.generateSkeleton){ie(To(m));return}let l=ho(u),g=await r()(m,{body:l});ie(g)})}if(t.endpoints.update){let m=t.endpoints.update,u=uu(m);o.command("update <id>").description(`Update a ${i} by ID`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(l,g)=>{if(g.generateSkeleton){ie(To(m));return}let E=ho(g),I=await r()(m,{params:{[u]:l},body:E});ie(I)})}if(t.endpoints.delete){let m=t.endpoints.delete,u=uu(m);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async l=>{let g=await r()(m,{params:{[u]:l}});ie(g)})}}var hG=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:_h}},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:ih,get:ah,create:sh,update:ph,delete:mh},listOptions:[{flag:"--owners <ids...>",description:"Filter by owner team IDs",queryParam:"owners"}]},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:fh,create:gh,update:yh,delete:Eh}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:kh,get:Lh,create:vh,update:jh,delete:Fh},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:Wh,get:Qh,create:Zh,update:Xh,delete:Jh}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:n_,get:o_,create:a_,update:s_,delete:p_}},{commandName:"quality-reports",description:"Manage quality reports",endpoints:{list:u_}},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:f_,get:g_,create:y_,update:E_,delete:I_}},{commandName:"routes",description:"Manage routes",endpoints:{list:T_,get:h_,create:__,update:A_,delete:x_}},{commandName:"services",description:"Manage services",endpoints:{list:wT,get:$T}},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:L_,get:M_,create:w_,update:$_,delete:D_}},{commandName:"teams",description:"Manage teams",endpoints:{list:G_,get:v_,create:j_,update:F_,delete:B_}}];function vS(e,t){for(let r of hG)GS(e,r,t)}var jS=`/${"v1"}/aggregation`,FS=n.Object({id:n.String({description:'Query identifier (q1, q2, ...) or "formula" for formula'}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values"})}),_G={results:[{id:"q1",group:{host:"server-1"},value:123.45}]},BS=n.Object({results:n.Array(n.Object({...FS.properties,value:n.Number({description:"Aggregated value"})},{title:"ScalarResult"}),{description:"Aggregated results per query and group"})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with single values"});Object.assign(BS,{examples:[_G]});var AG={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]},qS=n.Object({series:n.Array(n.Object({...FS.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Timestamp in milliseconds"}),value:n.Number({description:"Value"})}),{description:"Array of data points"})},{title:"Series"}),{description:"Time series data per query and group"})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with points over time"});Object.assign(qS,{examples:[AG]});var HS={timeRange:ht,queries:n.Array(n.Omit(mi.items,["fill"],{title:"AggregationQuery"}),{maxItems:nm,description:"Aggregations that may be combined together in the same query"}),groupBy:n.Optional(eo),dataSource:Xn,formula:n.Optional(ci),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))},xG=n.Object(HS),KS=d({description:"Run aggregation queries and return scalar results",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${jS}/multi-query/scalar`,method:"POST",body:xG,response:BS}),SG=n.Object({...HS,aggregationWindow:c({description:'Time bucket size for aggregation (e.g. "10s", "1m", "1h")'})}),zS=d({description:"Run aggregation queries and return timeseries results",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${jS}/multi-query/timeseries`,method:"POST",body:SG,response:qS});var xs="/v0/logs";var Qi=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var OG=0,bG=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String()),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String()))},{additionalProperties:!0})),message:n.Optional(n.Unknown()),timestamp:n.Number(),level:n.Enum(Qi)},{additionalProperties:!0});var RG="log_timestamp",CG=n.Union([n.Literal(RG)]),xn={...ut.properties,query:n.Optional(c({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e3})),shouldRecommendAttributes:n.Optional(n.Boolean()),defaultAttributesToHighlight:n.Optional(n.Array(c(),{maxItems:50})),triggeredBy:n.Optional(n.Literal("refresh")),startOffset:n.Optional(n.Number({minimum:OG})),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."})),sortBy:n.Optional(CG),sortDirection:n.Optional(n.Union([n.Literal("asc"),n.Literal("desc")]))},u1e=d({tags:["logs"],url:`${xs}/count`,method:"GET",query:n.Pick(n.Object(xn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),lu=n.Object({value:n.String(),priority:n.Number({minimum:0,maximum:1})}),l1e=d({tags:["logs"],url:`${xs}/search`,method:"GET",query:n.Object(xn),response:n.Object({logs:n.Optional(n.Array(bG)),attributesToHighlight:n.Optional(n.Array(lu))},{additionalProperties:!0})}),du=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),PG=n.Object({id:n.String(),pattern:n.Array(du),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),d1e=d({tags:["logs"],url:`${xs}/patterns`,method:"GET",query:n.Object({...ut.properties,query:c({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(c({allowEmpty:!1}))}),response:n.Object({patterns:n.Array(PG),sampleSize:n.Number()})}),f1e=d({tags:["logs"],url:`${xs}/attributes`,method:"GET",query:n.Object({...ut.properties,clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({attributes:n.Array(n.String())})});var Zi=`/${"v1"}/logs`,fu=n.Object({context:n.Optional(n.Object({team:n.Optional(n.String())},{additionalProperties:!0,$id:"LogContext"})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(Qi)},{additionalProperties:!0,$id:"LogEvent"}),UG={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(fu,{examples:[UG]});var NG={query:"level:ERROR",maxResults:100,from:1704067200,to:1704067200},YS=n.Object({...n.Pick(n.Object(xn),["query","maxResults","clusterId"]).properties,...ht.properties});Object.assign(YS,{examples:[NG]});var VS=d({description:"Search logs",operationId:"searchLogs",tags:["public","logs"],url:`${Zi}/search`,method:"GET",query:YS,response:n.Object({logs:n.Array(fu)})}),kG=n.Object({pattern:n.Array(du),size:n.Integer({description:"Number of logs that matched the pattern"}),groups:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),WS=n.Object({patterns:n.Array(kG),sampleSize:n.Number()}),LG={patterns:[{pattern:[{type:"text",value:"Resolved"},{type:"text",value:" "},{type:"text",value:"segment"},{type:"text",value:" "},{type:"text",value:"SegmentId("},{type:"range",min:0,max:1},{type:"text",value:")"},{type:"text",value:" "},{type:"text",value:"from"},{type:"text",value:" "},{type:"text",value:"cache"}],size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(WS,{examples:[LG]});var QS=d({description:"Get log patterns",operationId:"getLogPatterns",tags:["public","logs"],url:`${Zi}/patterns`,method:"GET",query:n.Object({...ht.properties,query:c({type:"tsuga-query"}),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:WS}),MG=n.Object({exampleLog:n.Optional(fu),team:n.String(),env:n.String(),service:n.String(),firstSeen:n.Number({description:"Timestamp in milliseconds when this pattern was first seen"}),lastSeen:n.Number({description:"Timestamp in milliseconds when this pattern was last seen"})}),ZS=n.Object({newErrorPatterns:n.Array(MG)}),wG={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:17040672e5,lastSeen:17041536e5,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(ZS,{examples:[wG]});var XS=d({description:"Get new error patterns",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${Zi}/patterns/new`,method:"GET",query:n.Object({...ht.properties,team:n.Optional(c()),env:n.Optional(c()),service:n.Optional(c()),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:ZS}),$G=n.Object({team:n.String(),env:n.String(),pattern:n.String({description:"The error pattern formatted"}),increaseTimestamps:n.Array(n.Number({description:"Timestamps in milliseconds when there were increases in this pattern"}))}),JS=n.Object({errorPatternIncreases:n.Array($G)}),DG={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(JS,{examples:[DG]});var eO=d({description:"Get error pattern increases for a given team",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${Zi}/patterns/increase`,method:"GET",query:n.Object({...ht.properties,team:c(),env:n.Optional(c()),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:JS}),tO=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})}),GG={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(tO,{examples:[GG]});var vG=n.Object({...ht.properties,clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),rO=d({description:"Get log attributes",operationId:"getLogAttributes",tags:["public","logs"],url:`${Zi}/attributes`,method:"GET",query:vG,response:tO});var pr="/v0/metrics",jG=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(Qi)},{additionalProperties:!0}),C1e=d({tags:["metrics"],url:`${pr}/count`,method:"GET",query:n.Pick(n.Object(xn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),P1e=d({tags:["metrics"],url:`${pr}/search`,method:"GET",query:n.Object(xn),response:n.Object({logs:n.Optional(n.Array(jG)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(lu))},{additionalProperties:!0})}),Ss=n.Enum(["counter","gauge","histogram","summary"]),gu=n.Enum(["delta","cumulative","none"]),FG=n.Object({capabilities:n.Optional(n.Array(n.String())),description:n.Optional(n.String()),tags:n.Optional(n.Array(n.String())),temporality:n.Optional(gu),type:n.Optional(Ss),unit:n.Optional(n.String())}),U1e=d({url:`${pr}/metadata`,method:"GET",query:n.Object({...ut.properties,metricName:c({allowEmpty:!1}),clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:FG}),N1e=d({tags:["metrics"],url:pr,method:"GET",query:n.Object({...ut.properties,clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),yu=n.Array(n.Object({name:n.String(),type:Ss}),{description:"List of metric names and their types"}),k1e=d({tags:["metrics"],url:`${pr}/names-and-types`,method:"GET",query:n.Object({...ut.properties,clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:yu}),Os=n.Array(n.String(),{description:"List of attribute names"}),L1e=d({tags:["metrics"],url:`${pr}/attributes`,method:"GET",query:n.Object({...ut.properties,metricName:c({allowEmpty:!1}),clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:Os}),M1e=d({tags:["metrics"],url:`${pr}/attributes/batch`,method:"GET",query:n.Object({...ut.properties,metricNames:n.Array(c({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(c({allowEmpty:!1,description:"Cluster ID"}))}),response:Os}),Eu=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"]),id:n.String(),name:n.String(),owner:n.String()},{description:"An asset that uses a metric"}),{description:"List of assets (dashboards and monitors) using this metric"})}),w1e=d({tags:["metrics"],url:`${pr}/assets-usage`,method:"GET",query:n.Object({metricName:c({allowEmpty:!1})}),response:Eu}),$1e=d({url:`${pr}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:c(),clusterId:n.Optional(c({allowEmpty:!1}))}),response:n.Array(n.String())});var Iu=`/${"v1"}/metrics`,BG=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(yu,{examples:[BG]});var Tu=n.Object({name:n.String({description:"Name of the metric"}),type:Ss,description:n.Optional(n.String({description:"Human-readable description of the metric"})),unit:n.Optional(n.String({description:"Unit of the metric"})),temporality:n.Optional(gu),capabilities:n.Optional(n.Array(n.String(),{description:"Supported capabilities, an empty array means all capabilities are supported"})),attributes:n.Optional(n.Array(n.String(),{description:"Metric attributes"}))}),qG={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"]};Object.assign(Tu,{examples:[qG]});var nO=n.Object({...ht.properties,clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),oO=d({description:"Get all metrics with their metadata",operationId:"listMetrics",tags:["public","metrics"],url:Iu,method:"GET",query:nO,response:n.Array(Tu)}),iO=d({description:"Retrieve a metric by name with its metadata",operationId:"getMetric",tags:["public","metrics"],url:`${Iu}/:name`,method:"GET",params:n.Object({name:c({allowEmpty:!1,description:"The metric name"})}),query:nO,response:Tu}),HG=["service","env","host","method","status_code"];Object.assign(Os,{examples:[HG]});var aO=n.Pick(Eu,["assets"]),KG={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"user-456-def"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"user-456-def"}]};Object.assign(aO,{examples:[KG]});var sO=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${Iu}/assets-usage`,method:"GET",query:n.Object({metricName:c({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:aO});var zG=`/${"v1"}/traces`,pO=n.Object({context:n.Optional(n.Object({service:n.Optional(n.Object({name:n.Optional(n.String()),version:n.Optional(n.String())},{additionalProperties:!0}))},{additionalProperties:!0})),parentSpanId:n.Optional(n.String()),resourceAttributes:n.Object({},{additionalProperties:!0}),spanAttributes:n.Object({},{additionalProperties:!0}),duration:n.Number({description:"In milliseconds."}),startTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),endTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:n.Optional(n.Object({message:n.String()})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0}),event_name:n.String(),event_timestamp_nanos:n.String()}))),spanId:n.String(),span:n.Object({kind:n.String(),name:n.String()}),statusCode:n.Optional(n.String()),traceId:n.String()},{additionalProperties:!0,$id:"SpanEvent"}),YG={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(pO,{examples:[YG]});var VG={from:1704067200,to:1704067200,query:"context.service.name:my-service",maxResults:100},mO=n.Object({...ht.properties,query:n.Optional(c({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),clusterId:n.Optional(c({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))});Object.assign(mO,{examples:[VG]});var cO=d({description:"Search spans",operationId:"searchSpans",tags:["public","traces"],url:`${zG}/search`,method:"GET",query:mO,response:n.Object({spans:n.Array(pO)})});var dO=["timestamp","level","message"];function lt(e,t){let r=t??er(e);if(!r)throw new Error(`--${e} is required`);return Ja(r)}function uO(e){let t={from:lt("from",e.from),to:lt("to",e.to)},r=e.query??er("query");r!==void 0&&(t.query=r);let o=e.maxResults??er("max-results");if(o!==void 0){let i=Number(o);if(Number.isNaN(i))throw new Error(`--max-results must be a number (got: ${o})`);t.maxResults=i}return t}function lO(e,t,r,o,i){e.command(t).description(r).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async s=>{if(s.generateSkeleton){ie(To(o));return}let m=ho(s),u=await i()(o,{body:m});ie(u)})}function Le(e){let t=er(e);return t===void 0?"":` (default: ${t})`}function WG(e){let t=fT(e.output),r=e.fields===void 0?void 0:gT(e.fields);return t==="json"?{format:t,fields:r}:{format:t,fields:r??dO}}function QG(e,t){if(t.format==="json"){if(t.fields===void 0){ie(e);return}let{fields:o}=t;ie({logs:e.logs.map(i=>ET(i,o))});return}let r=TT(t.format,e.logs,t.fields);r.length>0&&Wp(r)}function fO(e,t){let r=e.command("logs").description("Search and analyze logs");r.command("search").description("Search logs").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--query <query>",`Search query${Le("query")}`).option("--max-results <n>",`Maximum number of results${Le("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${dO.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async m=>{let u=WG(m),l=await t()(VS,{query:uO(m)});QG(l,u)}),r.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).action(async m=>{let u=await t()(rO,{query:{from:lt("from",m.from),to:lt("to",m.to)}});ie(u)}),r.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--query <query>",`Search query${Le("query")}`).action(async m=>{let u={from:lt("from",m.from),to:lt("to",m.to)},l=m.query??er("query");l!==void 0&&(u.query=l);let g=await t()(QS,{query:u});ie(g)}),r.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--team <team>","Filter by team").option("--env <env>","Filter by environment").option("--service <service>","Filter by service").action(async m=>{let u={from:lt("from",m.from),to:lt("to",m.to)};m.team!==void 0&&(u.team=m.team),m.env!==void 0&&(u.env=m.env),m.service!==void 0&&(u.service=m.service);let l=await t()(XS,{query:u});ie(l)}),r.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async m=>{let u={from:lt("from",m.from),to:lt("to",m.to),team:m.team};m.env!==void 0&&(u.env=m.env);let l=await t()(eO,{query:u});ie(l)});let o=e.command("metrics").description("List and inspect metrics");o.command("list").description("List all metrics with their metadata").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).action(async m=>{let u=await t()(oO,{query:{from:lt("from",m.from),to:lt("to",m.to)}});ie(u)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).action(async(m,u)=>{let l=await t()(iO,{params:{name:m},query:{from:lt("from",u.from),to:lt("to",u.to)}});ie(l)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async m=>{let u=await t()(sO,{query:{metricName:m}});ie(u)}),e.command("traces").description("Search traces").command("search").description("Search spans").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--query <query>",`Search query${Le("query")}`).option("--max-results <n>",`Maximum number of results${Le("max-results")}`).action(async m=>{let u=await t()(cO,{query:uO(m)});ie(u)});let s=e.command("aggregation").description("Run aggregation queries");lO(s,"scalar","Run aggregation queries and return scalar results",KS,t),lO(s,"timeseries","Run aggregation queries and return timeseries results",zS,t)}var ZG=3e3,XG="https://registry.npmjs.org/@tsuga/cli/latest";function JG(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,o.length);i++){let s=r[i]??0,m=o[i]??0;if(s>m)return!0;if(s<m)return!1}return!1}async function gO(e){try{let t=uT();if(t&&Date.now()-t<Xa)return;let r=await fetch(XG,{signal:AbortSignal.timeout(ZG)});if(!r.ok)return;let i=(await r.json()).version;JG(i,e)&&(process.stderr.write(`
44
+ -----END PRIVATE KEY-----`,isUsingLuhnAlgorithm:!1,regexp:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[ \\r\\n\\t\\f\\v\\S-]{64,}?KEY(?: BLOCK)?-----"},{key:"pulumi_api_token",name:"Pulumi API token",category:"credential",example:"pul-b77e6bff9fddebbc2bb8eca94e3f29a41f6da70a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:pul-[a-f0-9]{40})"},{key:"pypi_upload_token",name:"PyPI upload token",category:"credential",example:"pypi-AgEIcHlwaS5vcmc128fd9e0b47dde39cfecad3a997273458e6392f6aac649ae38864bdd7ff12836",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)pypi-AgEIcHlwaS5vcmc[a-zA-Z0-9_-]{50}"},{key:"rapidapi_access_token",name:"RapidAPI access token",category:"credential",example:"g4x40h94pi_-zlklfz3-qvhiiu5zankyrqqwmsl60decihbqvl",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9_-]{50})"},{key:"readme_api_token",name:"ReadMe API token",category:"credential",example:"rdme_k38kau741xa5lw03mdkvcd4vn6s6hdhvhg1wxa4ls7dp8h58r0yxq65nsqwndn056pxsc4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rdme_[a-z0-9]{70})"},{key:"rubygems_api_token",name:"RubyGems API token",category:"credential",example:"rubygems_7790aaa8102395704a64594a11f6de4941a27f86bc3fc9d4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:rubygems_[a-f0-9]{48})"},{key:"scalingo_api_token",name:"Scalingo API token",category:"credential",example:"tk-us-4fhmqrg-rl4416b3oij_qx3q284wbhbqpk7r3te4r14lafou",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:tk-us-[a-zA-Z0-9_-]{48})"},{key:"sendbird_access_id",name:"SendBird access ID",category:"credential",example:"7e7801fd-c25d-50ab-a723-01b94c8d6c5f",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sendbird_access_token",name:"SendBird access token",category:"credential",example:"305f75f04e3afa65360c25d9944fdae91138328d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{40})"},{key:"sendgrid_api_token",name:"SendGrid API token",category:"credential",example:"SG.--ed-fvdeffijnle7575jp1sh24wq_9y9hcjua5w3dnqh5-wyegkpzenziy1_qr=hf",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:SG\\.[a-z0-9=_\\-\\.]{66})"},{key:"sendinblue_api_token",name:"Sendinblue API token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:xkeysib-[a-f0-9]{64}\\-[a-z0-9]{16})"},{key:"sentry_access_token",name:"Sentry access token",category:"credential",example:"1ad463398f40a52bb94a3795762f4003d51b03b8a788cba55e3a81de81c72940",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{64})"},{key:"sentry_org_token",name:"Sentry org token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)sntrys_eyJpYXQiO[a-zA-Z0-9+/]{10}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10}={0,2}_[a-zA-Z0-9+/]{43}(?:[^a-zA-Z0-9+/]|\\z)"},{key:"sentry_user_token",name:"Sentry user token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sntryu_[a-f0-9]{64})"},{key:"settlemint_application_access_token",name:"Settlemint application access token",category:"credential",example:"sm_aat_gshgzsv353m5yb9s",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_aat_[a-zA-Z0-9]{16})"},{key:"settlemint_personal_access_token",name:"Settlemint personal access token",category:"credential",example:"sm_pat_1yhza49gsle0trg8",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_pat_[a-zA-Z0-9]{16})"},{key:"settlemint_service_access_token",name:"Settlemint service access token",category:"credential",example:"sm_sat_cha543e6lb19llli",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:sm_sat_[a-zA-Z0-9]{16})"},{key:"shippo_api_token",name:"Shippo API token",category:"credential",example:"shippo_live_1d0f80d04e7788c1edb8fc2b8076bbf8f59b84b7",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:shippo_(?:live|test)_[a-fA-F0-9]{40})"},{key:"shopify_access_token",name:"Shopify access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpat_[a-fA-F0-9]{32}"},{key:"shopify_custom_access_token",name:"Shopify custom access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpca_[a-fA-F0-9]{32}"},{key:"shopify_private_app_access_token",name:"Shopify private app access token",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shppa_[a-fA-F0-9]{32}"},{key:"shopify_shared_secret",name:"Shopify shared secret",category:"credential",example:"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",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)shpss_[a-fA-F0-9]{32}"},{key:"sidekiq_secret",name:"Sidekiq secret",category:"credential",example:"aa8d3915:64fb5cb5",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-f0-9]{8}:[a-f0-9]{8})"},{key:"sidekiq_sensitive_url",name:"Sidekiq sensitive URL",category:"credential",example:"https://cafebabe:deadbeef@gems.contribsys.com/",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https?://(?:[a-f0-9]{8}:[a-f0-9]{8})@(?:gems.contribsys.com|enterprise.contribsys.com)(?:[\\/|\\#|\\?|:]|$)"},{key:"slack_bot_token",name:"Slack bot token",category:"credential",example:"xoxb-781236542736-2364535789652-GkwFDQoHqzXDVsC6GzqYUypD",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*"},{key:"slack_user_token",name:"Slack user token",category:"credential",example:"xoxp-41684372915-1320496754-45609968301-e708ba56e1517a99f6b5fb07349476ef",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}"},{key:"slack_app_token",name:"Slack app token",category:"credential",example:"xapp-1-A052FGTS2DL-5171572773297-610b6a11f4b7eb819e87b767d80e6575a3634791acb9a9ead051da879eb5b55e",isUsingLuhnAlgorithm:!1,regexp:"xapp-[0-9]-[A-Z0-9]+-[0-9]+-[a-z0-9]+"},{key:"slack_config_access_token",name:"Slack config access token",category:"credential",example:"xoxe.xoxp-1-Mi0yLTM0MTQwNDE0MDE3Ni0zNjU5NDY0Njg4MTctNTE4MjA3NTQ5NjA4MC01NDEyOTYyODY5NzUxLThhMTBjZmI1ZWIzMGIwNTg0ZDdmMDI5Y2UxNzVlZWVhYzU2ZWQyZTZiODNjNDZiMGUxMzRlNmNjNDEwYmQxMjQ",isUsingLuhnAlgorithm:!1,regexp:"xoxe.xox[bp]-[0-9]-[A-Z0-9]{50}"},{key:"slack_config_refresh_token",name:"Slack config refresh token",category:"credential",example:"xoxe-1-My0xLTMxNzcwMjQ0MTcxMy01MTU4MTUyNjkxNzE0LTUxODE4NDI0MDY3MzYtMjA5MGFkOTFlZThkZWE2OGFlZDYwYWJjODNhYzAxYjA5ZjVmODBhYjgzN2QyNDdjOTNlOGY5NTg2YWM1OGM4Mg",isUsingLuhnAlgorithm:!1,regexp:"xoxe-[0-9]-[A-Z0-9]{50}"},{key:"slack_legacy_bot_token",name:"Slack legacy bot token",category:"credential",example:"xoxb-263594206564-FGqddMF8t08v8N7Oq4i57vs1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xoxb-[0-9]{8,14}-[a-zA-Z0-9]{18,26}"},{key:"slack_legacy_workspace_token",name:"Slack legacy workspace token",category:"credential",example:"xoxa-2-511111111-31111111111-3111111111111-e039d02840a0b9379c",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[ar]-(?:[0-9]-)?[0-9a-zA-Z]{8,48}"},{key:"slack_legacy_token",name:"Slack legacy token",category:"credential",example:"xoxs-416843729158-132049654-5609968301-e708ba56e1",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)xox[os]-[0-9]+-[0-9]+-[0-9]+-[a-fA-F0-9]+"},{key:"slack_webhook_url",name:"Slack webhook URL",category:"credential",example:"hooks.slack.com/services/z6cvbfngk3h7i0vts4akmbxidtb8o3b4pq2sbbd6o86g",isUsingLuhnAlgorithm:!1,regexp:"(?:https?://)?hooks.slack.com/(?:services|workflows|triggers)/[A-Za-z0-9+/]{43,56}"},{key:"snyk_api_token",name:"Snyk API token",category:"credential",example:"12345678-ABCD-ABCD-ABCD-1234567890AB",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sonar_api_token",name:"Sonar API token",category:"credential",example:"12345678ABCDEFH1234567890ABCDEFH12345678",isUsingLuhnAlgorithm:!1,regexp:"(?i)(?-u:\\b).*(?:(?:squ_|sqp_|sqa_)?[a-z0-9=_-]{40})"},{key:"stripe_access_token",name:"Stripe access token",category:"credential",example:"sk_test_cyge9m4s1kxiqdkszz0a57nyx6wk73",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})"},{key:"square_access_token",name:"Square access token",category:"credential",example:"sq0atp-OQUxovdrj3tfFpSd66r3sY",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:EAAA|sq0atp-)[a-zA-Z0-9_-]{22,60})"},{key:"squarespace_access_token",name:"Squarespace access token",category:"credential",example:"86447eab-140f-2563-3572-bb016dafd692",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"},{key:"sumologic_access_id",name:"SumoLogic access ID",category:"credential",example:"suJS4ZsaD5bQTt",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?-u:\\b).*(?:su[a-zA-Z0-9]{12})"},{key:"sumologic_access_token",name:"SumoLogic access token",category:"credential",example:"1xohkwr8lpvm4osygkpe5zbd16c3376ver2qed1bssuko4uy4tij1bnf4dnwy7o4",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{64})"},{key:"microsoft_teams_webhook",name:"Microsoft Teams webhook URL",category:"credential",example:"https://mycompany.webhook.office.com/webhookb2/767lrnj6-okh8-dnh8-jey2-y2iteohrwz75@6igi6oz6-ud9w-wior-2zva-5vx0wp6wuiqk/IncomingWebhook/o1zox92ssprrppjtnvcjqq0q09k2wnc3/qwox5p9d-x4zr-3yis-t1on-s67zj50tmyht",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)https://[a-z0-9]+\\.webhook\\.office\\.com/webhookb2/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}@[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}/IncomingWebhook/[a-z0-9]{32}/[a-z0-9]{8}-(?:[a-z0-9]{4}-){3}[a-z0-9]{12}"},{key:"telegram_bot_api_token",name:"Telegram bot API token",category:"credential",example:"59015865:A12o5wu6f78zofs0udypf9ti23u82g-qkfz",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{5,16}:(?-i:A)[a-z0-9_\\-]{34})"},{key:"travisci_access_token",name:"Travis CI access token",category:"credential",example:"zjgfo5fhshd5c60hpz22wh",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{22})"},{key:"twilio_api_key",name:"Twilio API key",category:"credential",example:"SKa585fd034fcd16cdd741f7df9b57fb3b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)SK[0-9a-fA-F]{32}"},{key:"twitch_api_token",name:"Twitch API token",category:"credential",example:"1hm9gcychlkpf93jdjnwdu0uaamu6d",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{30})"},{key:"twitter_api_key",name:"Twitter API key",category:"credential",example:"m8zqu4etx07bjt7tyeacc6pox",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{25})"},{key:"twitter_api_secret",name:"Twitter API secret",category:"credential",example:"7f4gxkubw9qs346ik99zk3z8b6kk3d7g8toi7zujgvgbt8q0yv",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{50})"},{key:"twitter_access_token",name:"Twitter access token",category:"credential",example:"465616696186918-96B1NCD5CH0uyi7zUHiS",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[0-9]{15,25}-[a-zA-Z0-9]{20,40})"},{key:"twitter_access_secret",name:"Twitter access secret",category:"credential",example:"vyuo5peybdzznr7z0ua5wamhogusans4m29uzi25w4jgj",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{45})"},{key:"twitter_bearer_token",name:"Twitter bearer token",category:"credential",example:"AAAAAAAAAAAAAAAAAAAAAAWRGWFGlfwyqNrrIa3pewqNNLX0jQMj2sR6M2cZUfBdqXDtkt7Nsb56F4tCz7Pt8ujbosrLxnRqYgwI0b",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:A{22}[a-zA-Z0-9%]{80})"},{key:"typeform_api_token",name:"Typeform API token",category:"credential",example:"tfp_o-nsn=6eg2ios=4g652xhf933qor4jj7ort2qh_uw_5jdsuffp31ln=e-2a",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:tfp_[a-z0-9\\-_\\.=]{59})"},{key:"vault_batch_token",name:"Vault batch token",category:"credential",example:"hvb.x84j4cl53mzvhvb1nfc3mfi721gh5i-92f96lt0gns5lpksfu5f0199j-gw4ycxg6au4ser86mczcr_nx6ur2elbpazfrybo80fxjv3bghxshml3g261l6qi03yrz03qup84jk-fc2",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:hvb\\.[a-zA-Z0-9_-]{50})"},{key:"vault_service_token",name:"Vault service token",category:"credential",example:"s.8QH9knZV94f0IjBZismfOPD0",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:(?:hvs\\.[a-zA-Z0-9_-]{90}|s\\.(?i:[a-z0-9]{24})))"},{key:"yandex_api_key",name:"Yandex API key",category:"credential",example:"AQVN9wiAh8pyz3lmB5WTo_KUuPDXlxtzkA5-YFG",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:AQVN[A-Za-z0-9_\\-]{35,38})"},{key:"yandex_aws_access_token",name:"Yandex AWS access token",category:"credential",example:"YCZ6DHVrZONPNtgwWLZPrIGyviSrudRVSr8w0b1S",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:YC[a-zA-Z0-9_\\-]{38})"},{key:"yandex_access_token",name:"Yandex access token",category:"credential",example:"t1.L=.WJ9CYVI5eeLkTOrMM_dgaPgdmpen48R8RYsL4VJqelVKDmrqYsSHkH6QyVVhJkuHSQFTd0NOhClEDyCz7eEbh5=",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:t1\\.[A-Z0-9a-z_-]+[=]{0,2}\\.[A-Z0-9a-z_-]{86}[=]{0,2})"},{key:"zendesk_secret_key",name:"Zendesk secret key",category:"credential",example:"iydgm2jofftb2xu7niv55qnfxdwbwmqt2s561bgc",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b).*(?:[a-z0-9]{40})"},{key:"infracost_api_token",name:"Infracost API token",category:"credential",example:"ico-fNZw8jjy6TugMUHKWX4l9iSP3i95SPNH",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)(?:ico-[a-zA-Z0-9]{32})"},{key:"iban",name:"Iban",category:"financial-data",example:"FR7630006000011234567890189",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}(?-u:\\b)"},{key:"aikido_token",name:"Aikido token",category:"credential",example:"AIK_SECRET_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_SECRET_[A-Za-z0-9]{64}"},{key:"aikido_ci_token",name:"Aikido CI secret",category:"credential",example:"AIK_CI_US_XU28CmBY7Kxk3RPrqfHk9n6p5QX4p1tXzvJ7J1B3RPrqfHk9n6p5QX4p1tXzvJ7J",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)AIK_CI_(US_|ME_)?[A-Za-z0-9]{64}"},{key:"tsuga_ingestion_key",name:"Tsuga ingestion key",category:"credential",example:"tsuga_in:v1:OUvrwavCG//ixL08HEds9OAT",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_in:v1:[A-Za-z0-9+/]{24}"},{key:"tsuga_operation_key",name:"Tsuga operation key",category:"credential",example:"tsuga_op:v1:zz3-LWv-sLy:0k7Skt255M0yXe/ZLBoiSamb",isUsingLuhnAlgorithm:!1,regexp:"(?-u:\\b)tsuga_op:v1:[A-Za-z0-9_-]+:[A-Za-z0-9+/]{24}"}],Xw=eh.map(e=>e.key),Gge=new Set(Xw),vge=eh.map(e=>e.key);function th(e){return e.replace(/ies$/,"y").replace(/s$/,"")}var Jw=["alert_cluster","alert_conditions","alert_data_url","alert_id","alert_owner","alert_previous_status","alert_priority","alert_query","alert_start_time","alert_status","alert_tags","alert_threshold","alert_timeframe","alert_title","alert_transition","alert_triggered_by","alert_value","dashboard_url","monitor_url"],e$=["alert_event_name","alert_message"],sye=[...Jw,...e$];var t$=["all","owning-team-and-public","owning-team-only"],Gc=n.Enum(t$,{description:"This controls which data the resource can see"});var kt="/v0/monitors",lo=["alert","resolve","keep_last_status","consider_zero"],Ss=["alert","resolve","keep_last_status"];var nh=["no_aggregation","all","any","each","proportion"],oh=["greater_than","less_than","equal","not_equal","greater_than_or_equal","less_than_or_equal"];var r$=n.Object({formula:n.String(),operator:n.Enum(oh),threshold:n.Number()}),n$=n.Object({formula:m({type:"tsuga-formula"}),operator:n.Enum(oh),threshold:n.Number()}),vc=n.Array(r$),jc=n.Array(n$),ih=n.Object({formula:n.String(),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"])}),ah=n.Object({formula:m({type:"tsuga-formula"}),conditionType:n.Enum(["rate","error","cpu","general","to_be_set"])}),Wye=n.Enum(["rate","error","cpu","general"]),St=[1,2,3,4,5];var Ri={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(n.String(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(nh)),proportionAlertThreshold:n.Optional(n.Integer())},Ci={timeframe:n.Number({description:"Timeframe of the monitor in minutes"}),groupByFields:n.Array(n.Object({fields:n.Array(m(),{description:"Fields used by the monitor group by."}),limit:n.Number({description:"Configured limit for this group by. Warning! This setting is currently ignored. Monitor evaluation will instead apply a fixed limit of 100 groups per field."})}),{maxItems:1,description:"Monitor group by configuration. Warning! Note that the limit setting is currently ignored."}),aggregationAlertLogic:n.Optional(n.Enum(nh)),proportionAlertThreshold:n.Optional(n.Integer({minimum:1,maximum:99}))},sh=n.Object({type:n.Literal("metric"),conditions:vc,noDataBehavior:n.Enum(lo),...Ri,queries:oo},{$id:"MonitorConfigurationMetric"}),ph=n.Object({type:n.Literal("metric"),conditions:jc,noDataBehavior:n.Enum(lo),...Ci,queries:io},{$id:"InputMonitorConfigurationMetric"}),ch=n.Object({type:n.Literal("log"),conditions:vc,noDataBehavior:n.Enum(lo),...Ri,queries:oo},{$id:"MonitorConfigurationLog"}),mh=n.Object({type:n.Literal("log"),conditions:jc,noDataBehavior:n.Enum(lo),...Ci,queries:io},{$id:"InputMonitorConfigurationLog"}),uh=n.Object({type:n.Literal("trace"),conditions:vc,noDataBehavior:n.Enum(lo),...Ri,queries:oo},{$id:"MonitorConfigurationTrace"}),o$=n.Object({type:n.Literal("trace"),conditions:jc,noDataBehavior:n.Enum(lo),...Ci,queries:io},{$id:"InputMonitorConfigurationTrace"}),lh=n.Object({type:n.Literal("anomaly-log"),condition:ih,noDataBehavior:n.Enum(Ss),...Ri,queries:oo},{$id:"MonitorConfigurationAnomalyLog"}),dh=n.Object({type:n.Literal("anomaly-log"),condition:ah,noDataBehavior:n.Enum(Ss),...Ci,queries:io},{$id:"InputMonitorConfigurationAnomalyLog"}),fh=n.Object({type:n.Literal("anomaly-metric"),condition:ih,noDataBehavior:n.Enum(Ss),...Ri,queries:oo},{$id:"MonitorConfigurationAnomalyMetric"}),gh=n.Object({type:n.Literal("anomaly-metric"),condition:ah,noDataBehavior:n.Enum(Ss),...Ci,queries:io},{$id:"InputMonitorConfigurationAnomalyMetric"}),yh=n.Object({type:n.Literal("certificate-expiry"),warnBeforeInDays:n.Integer(),cloudAccounts:n.Optional(n.Array(n.String())),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("resolve")},{$id:"MonitorConfigurationCertificateExpiry"}),i$=n.Object({type:n.Literal("certificate-expiry"),warnBeforeInDays:n.Integer({minimum:1,maximum:365}),cloudAccounts:n.Optional(n.Array(n.String(),{minItems:1})),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("resolve")},{$id:"InputMonitorConfigurationCertificateExpiry"}),Eh=n.Object({type:n.Literal("log-error-pattern"),aggregationAlertLogic:n.Literal("each"),noDataBehavior:n.Literal("keep_last_status"),filter:n.Object({teamIds:n.Array(n.String()),env:n.String(),service:n.Optional(n.String())})},{$id:"MonitorConfigurationLogErrorPattern"}),a$=b("type",[sh,ch,uh,lh,fh,Eh,yh]),s$=b("type",[ph,mh,o$,dh,gh,Eh,i$]);var ir=n.Object({id:n.String({description:"Identifier of the monitor"}),name:n.String({description:"Display name of the monitor"}),owner:n.String({description:"Team ID that owns and manages the monitor"}),message:n.Optional(n.String({description:"Message to be displayed if a notification is triggered"})),tags:Ye,configuration:a$,priority:n.Enum(St,{description:"Priority of the monitor"}),permissions:Gc,dashboardId:n.Optional(n.String({description:"Identifier of a dashboard related to the monitor"})),pauseUntil:n.Optional(T()),creator:n.Optional(Ae),updater:n.Optional(Ae),createdAt:T(),updatedAt:T(),assetUpdatedAt:T(),clusterIds:n.Array(n.String())},{title:"Monitor"}),p$=b("type",[sh,ch,uh,lh,fh,yh]),Zye=n.Object({...ir.properties,configuration:p$},{title:"Monitor"}),Xye=n.Object({...ir.properties,configuration:b("type",[ph,mh,dh,gh])},{title:"Monitor"}),Pi=n.Object({name:m(),message:n.Optional(m({type:"long"})),tags:ct,configuration:s$,priority:n.Enum(St),owner:m({allowEmpty:!1}),dashboardId:n.Optional(m()),pauseUntil:n.Optional(m({allowEmpty:!1,type:"date-time"})),permissions:Gc,clusterIds:n.Optional(n.Array(m({allowEmpty:!1})))}),rh=["threshold","certificate-expiry","anomaly-detection","log-error-pattern"],vr={PRIORITY:"priority",TYPE:"type",NAME:"name",OWNER:"owner",TAGS:"tags",CLUSTER_IDS:"clusterIds",PAUSE_UNTIL:"pauseUntil",ASSET_UPDATED_AT:"assetUpdatedAt"};function xi(e,t){return n.Object({values:n.Array(e,{maxItems:t.maxItems}),exclude:n.Optional(n.Boolean({description:"If true, exclude monitors matching these values instead of including them"}))},{description:t.description})}var Fc=n.Partial(n.Object({...Ue,filters:n.Partial(n.Object({owners:xi(m({allowEmpty:!1}),{description:"Restrict results to monitors owned by any of these team IDs",maxItems:50}),searchQuery:n.Object({value:m({allowEmpty:!1}),exclude:n.Optional(n.Boolean({description:"If true, exclude monitors matching this value instead of including them"}))},{description:"Substring matched against monitor name and configuration"}),tags:xi(Ei.items,{description:"Restrict results to monitors that have at least one of the listed key/value tags",maxItems:50}),priorities:xi(n.Enum(St),{description:"Restrict results to monitors with one of these priorities",maxItems:St.length}),types:xi(n.Enum(rh),{description:"Restrict results to monitors with these types",maxItems:rh.length}),activity:n.Enum(["active","snoozed"],{description:"Restrict results by activity status: active monitors or currently snoozed monitors"}),clusterIds:xi(m({allowEmpty:!1}),{description:"Restrict results to monitors deployed to any of these cluster IDs (monitors with no cluster restriction are always included)",maxItems:50})},{description:"Optional filters applied to narrow the returned monitors"})),sort:n.Object({by:n.Enum([vr.PRIORITY,vr.TYPE,vr.NAME,vr.OWNER,vr.TAGS,vr.CLUSTER_IDS,vr.PAUSE_UNTIL,vr.ASSET_UPDATED_AT],{description:"Field to sort the returned monitors by"}),direction:n.Enum(["asc","desc"],{description:"Sort direction: ascending or descending"})},{description:"Optional sorting applied to the returned monitors"})})),Jye=d({tags:["monitors"],url:`${kt}/query`,method:"POST",paginated:!0,response:n.Array(ir),body:Fc}),eEe=d({tags:["monitors"],url:`${kt}/:id`,method:"GET",params:n.Object({id:m()}),response:ir}),tEe=d({tags:["monitors"],url:kt,method:"POST",body:Pi,response:ir}),rEe=d({tags:["monitors"],url:`${kt}/:id`,method:"PUT",params:n.Object({id:m()}),body:Pi,response:ir}),nEe=d({tags:["monitors"],url:`${kt}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),oEe=d({tags:["monitors"],url:`${kt}/:id/snooze`,method:"POST",params:n.Object({id:m()}),body:n.Object({pauseUntil:m({allowEmpty:!1,type:"date-time"})}),response:ir}),c$=["alert","ok","alert_consider_zero","ok_consider_zero","alert_no_data","ok_no_data","keep_last_status_ok","keep_last_status_alert"],dn=n.Enum(c$),m$=b("type",[n.Object({type:n.Literal("each"),subStates:n.Record(n.String(),n.Object({stateValue:n.Union([dn,n.Null()]),lastChangedAt:T()}))}),n.Object({type:n.Literal("no_aggregation"),stateValue:n.Optional(dn)}),n.Object({type:n.Literal("any"),stateValue:n.Optional(dn)}),n.Object({type:n.Literal("all"),stateValue:n.Optional(dn)}),n.Object({type:n.Literal("proportion"),stateValue:n.Optional(dn)})]),u$=n.Object({monitorId:n.String(),currentState:m$,lastChangedAt:n.Optional(T())}),iEe=d({tags:["monitors"],url:`${kt}/states/:id`,method:"GET",params:n.Object({id:m()}),response:u$}),aEe=d({tags:["monitors"],url:`${kt}/:id/transitions`,method:"GET",params:n.Object({id:m()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Array(n.Object({id:n.String(),createdAt:T(),fromState:n.Optional(dn),toState:n.Optional(dn),dimension:n.Optional(n.String())}))}),l$=["unprocessed","processed","failed-to-process"],sEe=d({tags:["monitors"],url:`${kt}/:id/results`,method:"GET",params:n.Object({id:m()}),query:n.Object({from:n.Number(),to:n.Number()}),response:n.Object({isTruncated:n.Boolean(),results:n.Array(n.Object({id:n.String(),evaluationAt:T(),formulaResult:n.Object({groups:n.Array(n.Object({groupKey:n.Record(n.String(),hc),results:n.Array(n.Union([n.Number(),n.Null()])),conditionMet:n.Enum(["true","false","nan-no-data"])}))}),createdAt:T(),status:n.Enum(l$)}))})});var Ui=`/${"v1"}/monitors`,Ni=n.Pick(ir,["id","name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],{$id:"Monitor",description:"Monitor allowing to send alerts based on telemetry data"}),d$={id:"123-456-abc",name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},f$={id:"456-789-def",name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(Ni,{examples:[d$,f$]});var Ih=n.Pick(Fc,["filters","sort","limit","offset"]),g$={filters:{owners:{values:["team-123-abc"]},searchQuery:{value:"service:api-gateway"},tags:{values:[{key:"paging",value:"true"}]},priorities:{values:[4,5],exclude:!0}},sort:{by:"name",direction:"asc"},limit:10,offset:0};Object.assign(Ih,{examples:[g$]});var Th=d({description:"Query monitors with filters, sorting, and pagination",operationId:"queryMonitors",tags:["monitors"],url:`${Ui}/query`,method:"POST",paginated:!0,body:Ih,response:n.Array(Ni)}),_h=d({description:"Retrieve a monitor by its id",operationId:"getMonitor",tags:["monitors"],url:`${Ui}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Ni}),hh=["name","message","tags","configuration","priority","owner","dashboardId","permissions","clusterIds"],Oh=n.Pick(Pi,hh,{$id:"CreateMonitorRequest"}),Ah=n.Pick(Pi,hh,{$id:"UpdateMonitorRequest"}),Sh={name:"High Error Rate Alert",message:"Error rate exceeded threshold. Check the API gateway logs.",tags:[{key:"severity",value:"critical"}],configuration:{type:"log",timeframe:5,groupByFields:[],queries:[{aggregate:{type:"count"},filter:"level:ERROR service:api-gateway"}],conditions:[{formula:"q1",operator:"greater_than",threshold:100}],noDataBehavior:"resolve"},priority:1,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]},bh={name:"New Error Pattern Detector",message:"A new error pattern was detected in the logs.",tags:[{key:"team",value:"platform"}],configuration:{type:"log-error-pattern",aggregationAlertLogic:"each",noDataBehavior:"keep_last_status",filter:{teamIds:["abc-123-def"],env:"production",service:"api-gateway"}},priority:2,owner:"abc-123-def",dashboardId:"789-abc-def",permissions:"all",clusterIds:[]};Object.assign(Oh,{examples:[Sh,bh]});Object.assign(Ah,{examples:[Sh,bh]});var xh=d({description:"Create a new monitor",operationId:"createMonitor",tags:["monitors"],url:Ui,method:"POST",body:Oh,response:Ni}),Rh=d({description:"Update a monitor by its id",operationId:"updateMonitor",tags:["monitors"],url:`${Ui}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Ah,response:Ni}),y$=n.Object({id:m({allowEmpty:!1,description:"The monitor ID to delete"})}),Ch=d({description:"Delete a monitor by its id",operationId:"deleteMonitor",tags:["monitors"],url:`${Ui}/:id`,method:"DELETE",params:y$,response:v});var Li="/v0/notifications",gn=`${Li}/rules`,Ph=`${Li}/slack/setup`,bs=`${Li}/integrations`,fn=["triggered","resolved","no-data"],E$=["sent","stale","pending","rate-limited","failed","silenced"],I$=n.Optional(n.Object({maxMessages:n.Integer({description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),T$=n.Optional(n.Object({maxMessages:n.Integer({minimum:1,description:"Maximum number of messages allowed during the rate-limiting window"}),minutes:n.Integer({minimum:1,description:"Length of the rate-limiting window in minutes"})},{description:"Per-target rate-limiting configuration"})),_$=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),h$=n.Optional(n.Object({mode:n.Literal("each"),renotificationStates:n.Array(n.Enum(["alert","alert_no_data"]),{description:"Alert states that will trigger a renotification"}),renotifyIntervalMinutes:n.Integer({minimum:1,description:"Minimum number of minutes to wait before renotifying"})},{description:"Configuration for repeating notifications over time"})),O$=n.Object({id:n.String({description:"Identifier of the notification target"}),rateLimit:I$,renotifyConfig:_$,config:b("type",[n.Object({type:n.Literal("slack"),channel:n.String({description:"Slack channel ID that receives the notification"}),integrationId:n.String({description:"Slack workspace ID that receives the notification"}),integrationName:n.String({description:"Human readable name of the Slack integration"})},{$id:"RuleTargetConfigSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:n.String({description:"Identifier of the incident.io integration to use"}),integrationName:n.String({description:"Human readable name of the incident.io integration"})},{$id:"RuleTargetConfigIncidentIo"}),n.Object({type:n.Literal("email"),addresses:n.Array(n.String(),{description:"Email addresses that will receive the alert"})},{$id:"RuleTargetConfigEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:n.String({description:"Identifier of the Grafana IRM integration to use"}),integrationName:n.String({description:"Human readable name of the Grafana IRM integration"})},{$id:"RuleTargetConfigGrafanaIrm"}),n.Object({type:n.Literal("pagerduty"),integrationId:n.String({description:"Identifier of the PagerDuty integration to use"}),integrationName:n.String({description:"Human readable name of the PagerDuty integration"})},{$id:"RuleTargetConfigPagerDuty"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:n.String({description:"Identifier of the Microsoft Teams integration to use"}),integrationName:n.String({description:"Human readable name of the Microsoft Teams integration"})},{$id:"RuleTargetConfigMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:n.String({description:"Identifier of the webhook integration to use"}),integrationName:n.String({description:"Human readable name of the webhook integration"})},{$id:"RuleTargetConfigWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:n.String({description:"Identifier of the ServiceNow integration to use"}),integrationName:n.String({description:"Human readable name of the ServiceNow integration"})},{$id:"RuleTargetConfigServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:n.String({description:"Identifier of the Google Chat integration to use"}),integrationName:n.String({description:"Human readable name of the Google Chat integration"})},{$id:"RuleTargetConfigGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:n.String({description:"Identifier of the Squadcast integration to use"}),integrationName:n.String({description:"Human readable name of the Squadcast integration"})},{$id:"RuleTargetConfigSquadcast"})],{description:"Configuration describing how the alert was delivered"})}),A$=n.Object({id:m({description:"Identifier of the notification target"}),rateLimit:T$,config:b("type",[n.Object({type:n.Literal("slack"),channel:m({allowEmpty:!1,description:"Slack channel ID that receives the notification"}),integrationId:m({allowEmpty:!1,description:"Slack workspace ID that receives the notification"})},{$id:"RuleTargetInputSlack"}),n.Object({type:n.Literal("incident-io"),integrationId:m({allowEmpty:!1,description:"Identifier of the incident.io integration to use"})},{$id:"RuleTargetInputIncidentIo"}),n.Object({type:n.Literal("pagerduty"),integrationId:m({allowEmpty:!1,description:"Identifier of the PagerDuty integration to use"})},{$id:"RuleTargetInputPagerDuty"}),n.Object({type:n.Literal("email"),addresses:n.Array(m({type:"email"}),{minItems:1,maxItems:20,description:"Email addresses that will receive the alert"})},{$id:"RuleTargetInputEmail"}),n.Object({type:n.Literal("grafana-irm"),integrationId:m({allowEmpty:!1,description:"Identifier of the Grafana IRM integration to use"})},{$id:"RuleTargetInputGrafanaIrm"}),n.Object({type:n.Literal("microsoft-teams"),integrationId:m({allowEmpty:!1,description:"Identifier of the Microsoft Teams integration to use"})},{$id:"RuleTargetInputMicrosoftTeams"}),n.Object({type:n.Literal("webhook"),integrationId:m({allowEmpty:!1,description:"Identifier of the webhook integration to use"})},{$id:"RuleTargetInputWebhook"}),n.Object({type:n.Literal("servicenow"),integrationId:m({allowEmpty:!1,description:"Identifier of the ServiceNow integration to use"})},{$id:"RuleTargetInputServiceNow"}),n.Object({type:n.Literal("google-chat"),integrationId:m({allowEmpty:!1,description:"Identifier of the Google Chat integration to use"})},{$id:"RuleTargetInputGoogleChat"}),n.Object({type:n.Literal("squadcast"),integrationId:m({allowEmpty:!1,description:"Identifier of the Squadcast integration to use"})},{$id:"RuleTargetInputSquadcast"})],{description:"Configuration describing how the alert should be delivered"}),renotifyConfig:h$}),Bc=b("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(n.String(),{description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),qc=b("type",[n.Object({type:n.Literal("specific-teams"),teams:n.Array(m(),{minItems:1,maxItems:100,description:"Team IDs to select"})}),n.Object({type:n.Literal("all-teams")}),n.Object({type:n.Literal("all-public-teams")})]),fo=n.Object({id:n.String({description:"Identifier of the notification rule"}),name:n.String({description:"Display name of the notification rule"}),queryString:n.Optional(n.String({description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:Bc,prioritiesFilter:n.Array(n.Enum(St),{description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(fn),{description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Array(n.String(),{description:"Cluster IDs that can trigger a notification"}),owner:n.String({description:"Team ID that owns and manages the rule"}),createdAt:T(),updatedAt:T(),isActive:n.Boolean(),tags:Ye,targets:n.Array(O$,{description:"Notification targets that can receive notifications when the rule matches"}),creator:n.Optional(Ae),updater:n.Optional(Ae)}),ki=n.Object({name:m({description:"Display name of the notification rule"}),queryString:n.Optional(m({type:"tags-query",description:"Query string that narrows down which alerts trigger the rule"})),teamsFilter:qc,prioritiesFilter:n.Array(n.Enum(St),{maxItems:St.length,description:"Priorities that narrow down the alerts that can trigger a notification"}),transitionTypesFilter:n.Array(n.Enum(fn),{maxItems:fn.length,description:"Alert state transitions that can trigger a notification"}),clusterIdsFilter:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Cluster IDs that can trigger a notification"})),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the rule"}),tags:ct,isActive:n.Boolean(),targets:n.Array(A$,{minItems:1,description:"Notification targets that can receive notifications when the rule matches"})}),AEe=d({tags:["notification-rules"],url:gn,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(fo)}),SEe=d({tags:["notification-rules"],url:`${gn}/:id`,params:n.Object({id:m()}),method:"GET",response:fo}),bEe=d({tags:["notification-rules"],url:gn,method:"POST",body:ki,response:fo}),xEe=d({tags:["notification-rules"],url:`${gn}/:id`,method:"PUT",params:n.Object({id:m()}),body:ki,response:fo}),REe=d({tags:["notification-rules"],url:`${gn}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),CEe=d({tags:["notification-integrations"],url:`${Ph}/start`,method:"POST",response:n.Object({redirectUrl:n.String()})}),S$=n.Object({id:n.String(),name:n.String(),type:n.Enum(["slack","incident-io","grafana-irm","pagerduty","microsoft-teams","webhook","servicenow","google-chat","squadcast"]),createdAt:T(),ruleCount:n.Number(),creator:n.Optional(Ae)}),PEe=d({tags:["notification-integrations"],url:`${gn}/integrations`,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(S$)}),UEe=d({tags:["notification-integrations"],url:`${Ph}/callback`,method:"GET",query:n.Object({code:m()}),response:n.Object({success:n.Boolean()})}),Hc=["POST","PUT"],b$=n.Record(n.String(),n.String()),x$=n.Record(n.String(),n.Unknown()),R$=n.Record(n.String(),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))])),C$=b("type",[n.Object({type:n.Literal("json"),value:x$}),n.Object({type:n.Literal("form"),value:R$})]),P$=n.Object({ok:n.String(),alert:n.String()}),Kc=n.Object({id:n.String(),name:n.String(),setting:b("type",[n.Object({type:n.Literal("incident-io"),alertSourceConfigId:n.String(),tokenLastChars:n.String()}),n.Object({type:n.Literal("grafana-irm"),urlLastChars:n.String()}),n.Object({type:n.Literal("pagerduty"),integrationKeyLastChars:n.String()}),n.Object({type:n.Literal("microsoft-teams"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("webhook"),urlLastChars:n.String(),method:n.Enum(Hc),authentication:b("type",[n.Object({type:n.Literal("bearer"),tokenLastChars:n.String()}),n.Object({type:n.Literal("basic"),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("custom-header"),key:n.String(),valueLastChars:n.String()}),n.Object({type:n.Literal("none")})]),customHeaders:n.Optional(b$),payloadTemplate:C$,eventNameMapping:n.Optional(P$)}),n.Object({type:n.Literal("servicenow"),instanceName:n.String(),username:n.String(),passwordLastChars:n.String()}),n.Object({type:n.Literal("google-chat"),webhookUrlLastChars:n.String()}),n.Object({type:n.Literal("squadcast"),webhookUrlLastChars:n.String()})]),tags:Ye}),U$=n.Object({type:n.Literal("webhook"),url:m({type:"uri"}),method:n.Enum(Hc),authentication:b("type",[n.Object({type:n.Literal("bearer"),token:m({allowEmpty:!1})}),n.Object({type:n.Literal("basic"),username:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),n.Object({type:n.Literal("custom-header"),key:m({allowEmpty:!1}),value:m({allowEmpty:!1})}),n.Object({type:n.Literal("none")})]),customHeaders:n.Record(m({allowEmpty:!1}),m()),payloadTemplate:b("type",[n.Object({type:n.Literal("json"),value:n.Record(m({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(m({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})]),eventNameMapping:n.Optional(n.Object({ok:m({allowEmpty:!1}),alert:m({allowEmpty:!1})}))}),Uh=n.Object({type:n.Literal("incident-io"),alertSourceConfigId:m(),token:m()}),Nh=n.Object({type:n.Literal("grafana-irm"),url:m({type:"uri"})}),Lh=n.Object({type:n.Literal("pagerduty"),integrationKey:m()}),kh=n.Object({type:n.Literal("microsoft-teams"),webhookUrl:m({type:"uri"})}),N$=n.Object({type:n.Literal("servicenow"),instanceName:m({allowEmpty:!1,description:'Instance name of the ServiceNow instance. This corresponds to the subdomain part of the instance URL, like "my-instance" in "my-instance.service-now.com"'}),username:m({allowEmpty:!1}),password:m({allowEmpty:!1})}),L$=n.Object({type:n.Literal("google-chat"),webhookUrl:m({type:"uri"})}),k$=n.Object({type:n.Literal("squadcast"),webhookUrl:m({type:"uri"})}),M$=n.Object({name:m(),setting:b("type",[Uh,Nh,Lh,kh,U$,N$,L$,k$]),tags:ct}),w$=n.Object({type:n.Literal("webhook"),url:n.Optional(m({type:"uri"})),method:n.Optional(n.Enum(Hc)),authentication:n.Optional(b("type",[n.Object({type:n.Literal("bearer"),token:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("basic"),username:n.Optional(m({allowEmpty:!1})),password:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("custom-header"),key:n.Optional(m({allowEmpty:!1})),value:n.Optional(m({allowEmpty:!1}))}),n.Object({type:n.Literal("none")})])),customHeaders:n.Optional(n.Record(m({allowEmpty:!1}),m())),payloadTemplate:n.Optional(b("type",[n.Object({type:n.Literal("json"),value:n.Record(m({allowEmpty:!1}),n.Unknown())}),n.Object({type:n.Literal("form"),value:n.Record(m({allowEmpty:!1}),n.Union([n.String(),n.Number(),n.Boolean(),n.Null(),n.Array(n.Union([n.String(),n.Number(),n.Boolean()]))]))})])),eventNameMapping:n.Optional(n.Object({ok:n.Optional(m({allowEmpty:!1})),alert:n.Optional(m({allowEmpty:!1}))}))}),$$=n.Object({type:n.Literal("servicenow"),instanceName:n.Optional(m({allowEmpty:!1})),username:n.Optional(m({allowEmpty:!1})),password:n.Optional(m({allowEmpty:!1}))}),D$=n.Object({type:n.Literal("google-chat"),webhookUrl:m({type:"uri"})}),G$=n.Object({type:n.Literal("squadcast"),webhookUrl:m({type:"uri"})}),v$=n.Object({name:n.Optional(m()),setting:n.Optional(b("type",[Uh,Nh,Lh,kh,w$,$$,D$,G$]))}),NEe=d({tags:["notification-integrations"],url:bs,method:"POST",body:M$,response:Kc}),LEe=d({tags:["notification-integrations"],url:`${bs}/:id`,method:"GET",params:n.Object({id:m()}),response:Kc}),kEe=d({tags:["notification-integrations"],url:`${bs}/:id`,method:"PUT",params:n.Object({id:m()}),body:v$,response:Kc}),MEe=d({tags:["notification-integrations"],url:`${bs}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),wEe=d({tags:["notification-rules"],url:`${kt}/:id/notifications`,method:"GET",params:n.Object({id:m()}),query:n.Optional(n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number())})),response:n.Object({notifications:n.Array(n.Object({id:n.String(),monitorId:n.String(),monitorResultId:n.String(),ruleId:n.Optional(n.String()),targetId:n.Optional(n.String()),status:n.Enum(E$),tryCount:n.Number(),nextTryAt:T(),createdAt:T(),updatedAt:T(),sentAt:n.Optional(T())})),isTruncated:n.Boolean()})}),j$=["slack","incident-io","pagerduty","email","grafana-irm","microsoft-teams","webhook","servicenow","google-chat","squadcast"],$Ee=d({tags:["notification-rules"],url:`${gn}/test`,method:"POST",body:n.Object({notificationRule:ki,targetIds:n.Optional(n.Array(m({allowEmpty:!1}),{description:"Target IDs to test specific targets",minItems:1,maxItems:10}))}),response:n.Union([n.Object({success:n.Literal(!1),overallMessage:n.String({description:"Message when there is an overall error"})}),n.Object({success:n.Boolean(),results:n.Array(n.Object({targetId:n.String({description:"The ID of the target that was tested"}),targetType:n.Enum(j$,{description:"The type of the target (e.g., slack, webhook)"}),status:n.Enum(["success","failure"],{description:"Whether the test notification was sent successfully"}),message:n.Optional(n.String({description:"Message if the notification failed for this specific target"}))}))})])});var Mi=`/${"v1"}/notification-rules`,wi=n.Pick(fo,["id","name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","isActive","tags","targets"],{$id:"Rule",description:"Rules to trigger notifications to targets based on alert events"}),F$={id:"123-456-abc",name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(wi,{examples:[F$]});var Mh=d({description:"Retrieve all notification rules",operationId:"listNotificationRules",tags:["notification-rules"],url:Mi,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(wi)}),wh=d({description:"Retrieve a notification rule by its id",operationId:"getNotificationRule",tags:["notification-rules"],url:`${Mi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:wi}),zc=n.Pick(ki,["name","teamsFilter","prioritiesFilter","transitionTypesFilter","clusterIdsFilter","owner","tags","isActive","targets"]),B$={name:"Critical Alerts",teamsFilter:{type:"all-teams"},prioritiesFilter:[1,2],transitionTypesFilter:["triggered","resolved"],clusterIdsFilter:[],owner:"abc-123-def",isActive:!0,tags:[{key:"channel",value:"alerts"}],targets:[{id:"789-abc-def",config:{type:"email",addresses:["oncall@example.com"]}}]};Object.assign(zc,{examples:[B$]});var $h=d({description:"Create a new notification rule",operationId:"createNotificationRule",tags:["notification-rules"],url:Mi,method:"POST",body:zc,response:wi}),Dh=d({description:"Update a notification rule by its id",operationId:"updateNotificationRule",tags:["notification-rules"],url:`${Mi}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:zc,response:wi}),q$=n.Object({id:m({allowEmpty:!1,description:"The notification rule ID to delete"})}),Gh=d({description:"Delete a notification rule by its id",operationId:"deleteNotificationRule",tags:["notification-rules"],url:`${Mi}/:id`,method:"DELETE",params:q$,response:v});var go=`${Li}/silences`,vh=n.Union([n.Literal("monday"),n.Literal("tuesday"),n.Literal("wednesday"),n.Literal("thursday"),n.Literal("friday"),n.Literal("saturday"),n.Literal("sunday")]),H$=n.Partial(n.Record(vh,n.Array(n.Object({startTime:n.String({format:Qp}),endTime:n.String({format:Qp})},{title:"SilenceTimeRange"}),{minItems:1,description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),K$=n.Partial(n.Record(vh,n.Array(n.Object({startTime:n.String(),endTime:n.String()},{title:"SilenceTimeRange"}),{description:"Time ranges for this day"}),{description:"Weekly schedule mapping day of week to time ranges"})),xs='IANA timezone identifier (e.g. "America/New_York"). Defaults to UTC if omitted.',jh="One-time silence schedule with specific start and end times",Fh="Recurring weekly silence schedule",z$=b("type",[n.Object({type:n.Literal("one-time"),startTime:n.String({format:Wp}),endTime:n.String({format:Wp}),timeZone:n.Optional(n.String({format:Yp,description:xs}))},{$id:"InputSilenceScheduleOneTime",description:jh}),n.Object({type:n.Literal("recurring"),weeklySchedule:H$,timeZone:n.Optional(n.String({format:Yp,description:xs}))},{$id:"InputSilenceScheduleRecurring",description:Fh})],{description:"Schedule defining when the silence is active"}),V$=b("type",[n.Object({type:n.Literal("one-time"),startTime:n.String(),endTime:n.String(),timeZone:n.Optional(n.String({description:xs}))},{$id:"OutputSilenceScheduleOneTime",description:jh}),n.Object({type:n.Literal("recurring"),weeklySchedule:K$,timeZone:n.Optional(n.String({description:xs}))},{$id:"OutputSilenceScheduleRecurring",description:Fh})],{description:"Schedule defining when the silence is active"}),Rs=n.Object({name:m({description:"Display name of the silence"}),reason:m({allowEmpty:!1,description:"Reason for the silence"}),owner:m({allowEmpty:!1,description:"Team ID that owns and manages the silence"}),tags:ct,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:z$,notificationRuleIds:n.Optional(n.Array(m(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(m({type:"tags-query",description:"Query string to filter which alerts this silence applies to"})),teamsFilter:qc,prioritiesFilter:n.Array(n.Enum(St),{maxItems:St.length,description:"Monitor priorities to filter which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(fn),{maxItems:fn.length,description:"Transition types to filter which alerts this silence applies to"})}),yo=n.Object({id:n.String({description:"Unique identifier of the silence"}),name:n.String({description:"Display name of the silence"}),reason:n.String({description:"Reason for the silence"}),owner:n.String({description:"Team ID that owns and manages the silence"}),tags:Ye,isActive:n.Boolean({description:"Whether the silence is currently enabled"}),schedule:V$,notificationRuleIds:n.Optional(n.Array(n.String(),{description:"Notification rule IDs this silence applies to"})),queryString:n.Optional(n.String({description:"Query string filtering which alerts this silence applies to"})),teamsFilter:Bc,prioritiesFilter:n.Array(n.Enum(St),{description:"Monitor priorities filtering which alerts this silence applies to"}),transitionTypesFilter:n.Array(n.Enum(fn),{description:"Transition types filtering which alerts this silence applies to"}),createdAt:T(),updatedAt:T(),creator:n.Optional(Ae),updater:n.Optional(Ae)}),eIe=d({tags:["notification-silences"],url:go,method:"GET",response:n.Array(yo)}),tIe=d({tags:["notification-silences"],url:`${go}/:id`,params:n.Object({id:m()}),method:"GET",response:yo}),rIe=d({tags:["notification-silences"],url:go,method:"POST",body:Rs,response:yo}),nIe=d({tags:["notification-silences"],url:`${go}/:id`,method:"PUT",params:n.Object({id:m()}),body:Rs,response:yo}),oIe=d({tags:["notification-silences"],url:`${go}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),iIe=d({tags:["notification-silences"],url:`${go}/bulk-delete`,method:"DELETE",body:n.Object({ids:n.Array(m())}),response:n.Object({})});var $i=`/${"v1"}/notification-silences`,Cs=n.Pick(yo,["id","name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"],{$id:"NotificationSilence",description:"Silences to suppress notifications based on schedules and filters"}),Bh=d({description:"Retrieve all notification silences",operationId:"listNotificationSilences",tags:["notification-silences"],url:$i,method:"GET",response:n.Array(Cs)}),qh=d({description:"Retrieve a notification silence by its id",operationId:"getNotificationSilence",tags:["notification-silences"],url:`${$i}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Cs}),Hh=n.Pick(Rs,["name","reason","owner","tags","isActive","schedule","notificationRuleIds","queryString","teamsFilter","prioritiesFilter","transitionTypesFilter"]),Kh=d({description:"Create a new notification silence",operationId:"createNotificationSilence",tags:["notification-silences"],url:$i,method:"POST",body:Hh,response:Cs}),zh=d({description:"Update a notification silence by its id",operationId:"updateNotificationSilence",tags:["notification-silences"],url:`${$i}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Hh,response:Cs}),Y$=n.Object({id:m({allowEmpty:!1,description:"The notification silence ID to delete"})}),Vh=d({description:"Delete a notification silence by its id",operationId:"deleteNotificationSilence",tags:["notification-silences"],url:`${$i}/:id`,method:"DELETE",params:Y$,response:v});var Q$=["passed","failed","ignored"],W$=n.Enum(Q$),Yh=["unrouted-logs","team-has-route","service-name-present","no-orphan-spans","metric-unit-consistency","host-name-present","inconsistent-attribute-naming","no-duplicate-attr-values","no-debug-logs-in-prod","no-multiline-logs","no-empty-dashboards","monitor-has-notification","no-future-dated-logs","metric-usage","no-stale-dashboards","no-unused-dashboards","no-orphan-monitors","no-flapping-monitors","no-noisy-group-monitors","no-long-alert-monitors","no-redundant-monitors","no-absent-log-fields","k8s-recommended-attributes","k8s-recommended-metrics","k8s-recommended-change-events","use-standard-attributes","no-unused-operation-api-keys","no-unused-ingestion-api-keys"],Z$=n.Enum(Yh),X$=["log","metric","resource","span"],J$=["team","global"],Yc=n.Object({key:n.Enum(Yh),title:n.String(),summary:n.String(),rationale:n.String(),objectType:n.Enum(X$),category:n.Enum(["hygiene","routing","integrity","consistency","redundancy","cost"]),impact:n.Object({label:n.Enum(["critical","important","normal"]),weight:n.Number()}),recommendation:n.String(),scope:n.Optional(n.Enum(J$))}),Vc=n.Intersect([Yc,n.Object({status:W$,normalizedScore:n.Number(),details:n.Optional(n.Record(n.String(),n.Unknown())),recommendation:n.Optional(n.String()),examples:n.Optional(n.Array(n.Object({type:n.String(),label:n.String(),link:n.Object({to:n.String(),search:n.Optional(n.Unknown()),params:n.Optional(n.Unknown())})})))})]),Ps=n.Object({generatedAt:n.String(),overallScore:n.Optional(n.Number()),rules:n.Array(Yc),teamResults:n.Array(n.Object({teamId:n.String(),teamName:n.String(),teamWeight:n.Number(),score:n.Number(),weightedScore:n.Number(),totalWeight:n.Number(),ruleResults:n.Array(Vc)})),globalResults:n.Optional(n.Object({score:n.Optional(n.Number()),ruleResults:n.Array(Vc)}))}),EIe=d({tags:["quality-reports"],url:"/v0/quality-reports",method:"POST",response:Ps}),IIe=d({tags:["quality-reports"],url:"/v0/quality-reports/latest",method:"GET",query:n.Object({clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({report:n.Optional(Ps)})}),TIe=d({tags:["quality-reports"],url:"/v0/quality-reports/preview",method:"POST",body:n.Object({ruleKey:Z$,teamId:m(),lookbackMinutes:n.Optional(n.Integer({minimum:1,maximum:60})),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({rule:Yc,result:Vc,teamId:n.String(),teamName:n.String()})});var eD=`/${"v1"}/quality-reports`,Qh=n.Pick(Ps,["generatedAt","overallScore","rules","teamResults","globalResults"],{$id:"QualityReport",description:"Aggregated quality report with per-team rule evaluations and scores"}),tD={generatedAt:"2026-02-26T12:00:00.000Z",overallScore:.85,rules:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value."}],teamResults:[{teamId:"abc-123-def",teamName:"platform",teamWeight:1,score:.85,weightedScore:.85,totalWeight:2,ruleResults:[{key:"team-has-route",title:"\u22651 route per team",summary:"Each team owns at least one active route.",rationale:"Provides clear governance boundaries for routing and enrichment.",objectType:"resource",category:"routing",impact:{label:"important",weight:2},recommendation:"Ensure every team manages a dedicated route scoped to its context.team value.",status:"passed",normalizedScore:1}]}]};Object.assign(Qh,{examples:[tD]});var rD=n.Object({clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),Wh=d({description:"Retrieve the latest quality report",operationId:"getLatestQualityReport",tags:["quality-reports"],url:`${eD}/latest`,method:"GET",query:rD,response:n.Object({report:n.Optional(Qh)})});var Di="/v0/admin-center";var Vt=`${Di}/retention-policies`,nD=3650,oD=n.Integer(),Zh=n.Integer({minimum:1,maximum:nD}),ar=n.Object({id:n.String(),env:n.Optional(n.String()),teamId:n.Optional(n.String()),dataSource:n.Enum(Lt),durationDays:oD,isEnabled:n.Boolean(),createdAt:T(),updatedAt:T()}),Us=n.Object({env:n.Optional(m()),teamId:n.Optional(m()),dataSource:n.Enum(Lt),durationDays:Zh,isEnabled:n.Boolean()}),Xh=n.Array(n.Object({env:m(),dataSource:n.Enum(Lt),durationDays:n.Union([Zh,n.Null()]),isEnabled:n.Boolean()})),Jh=n.Object({inserted:n.Array(ar),updated:n.Array(ar),deleted:n.Array(ar)}),MIe=d({tags:["retention-policies"],url:Vt,method:"POST",body:Us,response:ar}),wIe=d({tags:["retention-policies"],url:Vt,method:"GET",response:n.Array(ar)}),$Ie=d({tags:["retention-policies"],url:`${Vt}/:id`,method:"GET",params:n.Object({id:m()}),response:ar}),DIe=d({tags:["retention-policies"],url:`${Vt}/:id`,method:"PUT",params:n.Object({id:m()}),body:Us,response:ar}),GIe=d({tags:["retention-policies"],url:`${Vt}/bulk-update`,method:"POST",body:Xh,response:Jh}),vIe=d({tags:["retention-policies"],url:`${Vt}/bulk-update-for-team`,method:"POST",body:n.Object({teamId:m(),policies:Xh}),response:Jh}),jIe=d({tags:["retention-policies"],url:`${Vt}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),Gi=["past-24-hours","past-7-days","past-30-days"],FIe=d({tags:["retention-policies"],url:`${Vt}/requested-history-percentile/:teamId`,method:"POST",params:n.Object({teamId:m()}),body:n.Object({percentile:n.Number({minimum:0,maximum:1}),observationWindow:n.Enum(Gi),dataSource:n.Enum(Lt)}),response:n.Object({percentile:n.Number(),observationWindow:n.Enum(Gi),dataSource:n.Enum(Lt),teamId:n.String(),requestedHistoryDays:n.Number()})}),iD=["1-day","3-days","7-days","1-month","6-months","more-than-6-months"];var aD=n.Array(n.Object({bucket:n.Enum(iD),count:n.Number()})),BIe=d({tags:["retention-policies"],url:`${Vt}/requested-history-histogram/:teamId`,method:"POST",params:n.Object({teamId:m()}),body:n.Object({observationWindow:n.Enum(Gi),dataSource:n.Enum(Lt)}),response:n.Object({observationWindow:n.Enum(Gi),dataSource:n.Enum(Lt),teamId:n.String(),histogram:aD})}),qIe=d({tags:["retention-policies"],url:`${Vt}/top-teams-with-retention-surplus`,method:"POST",body:n.Object({dataSource:n.Enum(Lt),observationWindow:n.Enum(Gi),percentile:n.Number({minimum:0,maximum:1}),topN:n.Optional(n.Number({minimum:1,maximum:20}))}),response:n.Array(n.Object({teamId:n.String(),retentionSurplusDays:n.Number()}))});var vi=`/${"v1"}/retention-policies`,ji=n.Pick(ar,["id","env","teamId","dataSource","durationDays","isEnabled"],{$id:"RetentionPolicy",description:"Data retention rule for a data source within an environment"}),sD={id:"123-456-abc",env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(ji,{examples:[sD]});var eO=d({description:"Retrieve all retention policies",operationId:"listRetentionPolicies",tags:["retention-policies"],url:vi,method:"GET",response:n.Array(ji)}),tO=d({description:"Retrieve a retention policy by its id",operationId:"getRetentionPolicy",tags:["retention-policies"],url:`${vi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:ji}),Qc=n.Pick(Us,["env","teamId","dataSource","durationDays","isEnabled"]),pD={env:"production",teamId:"abc-123-def",dataSource:"logs",durationDays:30,isEnabled:!0};Object.assign(Qc,{examples:[pD]});var rO=d({description:"Create a new retention policy",operationId:"createRetentionPolicy",tags:["retention-policies"],url:vi,method:"POST",body:Qc,response:ji}),nO=d({description:"Update a retention policy by its id",operationId:"updateRetentionPolicy",tags:["retention-policies"],url:`${vi}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Qc,response:ji}),oO=d({description:"Delete a retention policy by its id",operationId:"deleteRetentionPolicy",tags:["retention-policies"],url:`${vi}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var Ns={id:n.String({description:"Identifier of the processor"}),description:n.Optional(n.String()),tags:Ye,updatedAt:n.Optional(T())},Ls={id:m({allowEmpty:!1,description:"Identifier of the processor"}),description:n.Optional(m({type:"long"})),tags:ct,updatedAt:n.Optional(T())},cD={...Ns,type:n.Literal("creator")},mD={...Ls,type:n.Literal("creator")},uD=b("subtype",[n.Object({targetAttribute:n.String({description:"Attribute that will receive the formatted value"}),formatString:n.String({description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean()),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:n.String({description:"Attribute that will receive the computed value"}),formula:n.String({description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean()),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean())},{$id:"ProcessorParamsCreatorMathFormula"})]),lD=b("subtype",[n.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the formatted value"}),formatString:m({allowEmpty:!1,type:"long",description:"Template string used to build the target attribute value"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("format-string"),replaceMissingByEmpty:n.Optional(n.Boolean())},{$id:"InputProcessorParamsCreatorFormatString"}),n.Object({targetAttribute:m({allowEmpty:!1,description:"Attribute that will receive the computed value"}),formula:m({allowEmpty:!1,type:"long",description:"Mathematical formula evaluated to populate the target attribute"}),overrideTarget:n.Optional(n.Boolean({description:"Set to true to overwrite an existing target attribute value (defaults to true)"})),subtype:n.Literal("math-formula"),replaceMissingBy0:n.Optional(n.Boolean())},{$id:"InputProcessorParamsCreatorMathFormula"})]),dD=n.Object({...cD,params:uD}),fD=n.Object({...mD,params:lD}),gD={...Ns,type:n.Literal("mapper")},yD={...Ls,type:n.Literal("mapper")},ED=b("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:n.String({description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean()),overrideTarget:n.Optional(n.Boolean()),targetAttribute:n.String({description:"Attribute name that will receive the mapped value"})}),{description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")},{$id:"ProcessorParamsMapperMapAttributes"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"ProcessorParamsMapperMapLevel"}),n.Object({attributeName:n.String({description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"ProcessorParamsMapperMapTimestamp"})]),ID=b("subtype",[n.Object({attributes:n.Array(n.Object({originAttribute:m({allowEmpty:!1,description:"Attribute name to map to the target attribute"}),keepOrigin:n.Optional(n.Boolean({description:"Preserve the source attribute after mapping (defaults to false)"})),overrideTarget:n.Optional(n.Boolean({description:"Overwrite the target attribute when it already exists (defaults to true)"})),targetAttribute:m({allowEmpty:!1,description:"Attribute name that will receive the mapped value"})}),{minItems:1,maxItems:50,description:"Mappings that map individual attributes to new targets"}),subtype:n.Literal("map-attributes")},{$id:"InputProcessorParamsMapperMapAttributes"}),n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log level"}),subtype:n.Literal("map-level")},{$id:"InputProcessorParamsMapperMapLevel"}),n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will determine the log timestamp"}),subtype:n.Literal("map-timestamp")},{$id:"InputProcessorParamsMapperMapTimestamp"})]),TD=n.Object({...yD,params:ID}),_D=n.Object({...gD,params:ED}),hD={...Ns,type:n.Literal("parse-attribute")},OD={...Ls,type:n.Literal("parse-attribute")},AD=5,SD=b("subtype",[n.Object({attributeName:n.String({description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(n.String({description:"Grok rule applied to parse text"}),{description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(n.String(),{description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:n.String({description:"Attribute containing the key/value string segment to parse"}),targetAttribute:n.String({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:n.String({description:"Delimiter separating keys from values in the source string"}),pairsSplitter:n.String({description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean(),subtype:n.Literal("key-value")})]),bD=b("subtype",[n.Object({attributeName:m({allowEmpty:!1,description:"Attribute whose value will be parsed with Grok rules"}),rules:n.Array(m({allowEmpty:!1,type:"long",description:"Grok rule applied to parse text"}),{minItems:1,maxItems:5,description:"Ordered Grok rules evaluated until one matches"}),samples:n.Optional(n.Array(m({type:"long"}),{maxItems:AD,description:"Example log lines for validation"})),subtype:n.Literal("grok")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the URL to parse"}),subtype:n.Literal("url")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the user agent string to parse"}),subtype:n.Literal("user-agent")}),n.Object({sourceAttribute:m({allowEmpty:!1,description:"Attribute containing the key/value string segment to parse"}),targetAttribute:m({description:"Attribute prefix where extracted key/value pairs will be written"}),keyValueSplitter:m({allowEmpty:!1,description:"Delimiter separating keys from values in the source string"}),pairsSplitter:m({allowEmpty:!0,description:"Delimiter separating each key/value pair. Will default to whitespace if not set."}),acceptStandaloneKey:n.Boolean(),subtype:n.Literal("key-value")})]),xD=n.Object({...hD,params:SD}),RD=n.Object({...OD,params:bD}),CD=11,iO=n.Cyclic({OutputProcessor:n.Union([_D,xD,dD,n.Object({...Ns,params:n.Object({items:n.Array(n.Object({query:n.String({description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("OutputProcessor"),{description:"Processors executed when the branch query matches"})}),{description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split")})])},"OutputProcessor",{description:"Processing step executed sequentially on route logs"}),aO=n.Cyclic({InputProcessor:n.Union([TD,RD,fD,n.Object({...Ls,params:n.Object({items:n.Array(n.Object({query:m({type:"tsuga-query",description:"Query that determines whether logs enter this branch"}),processors:n.Array(n.Ref("InputProcessor"),{maxItems:50,description:"Processors executed when the branch query matches"})}),{minItems:2,maxItems:CD,description:"Conditional branches evaluated in order before falling back to the default"})}),type:n.Literal("split")})])},"InputProcessor",{description:"Processing step executed sequentially on route logs"});var PD="/v0/logs",jr=`${PD}/routes`,yn=n.Object({id:n.String({description:"Identifier of the log route"}),name:n.String({description:"Human readable name shown for the route"}),description:n.Optional(n.String()),isEnabled:n.Boolean(),query:n.String({description:"Query that selects which logs should enter the route"}),rank:n.Number(),tags:Ye,owner:n.String({description:"Team ID owning and managing the route"}),processors:n.Array(iO,{description:"Ordered processors applied to logs that match the route"}),creator:n.Optional(Ae),updater:n.Optional(Ae),updatedAt:T(),createdAt:T(),assetUpdatedAt:T()},{title:"Route"}),Fi=n.Object({name:m({allowEmpty:!1,description:"Human readable name shown for the route"}),description:n.Optional(m({type:"long"})),isEnabled:n.Boolean(),query:m({type:"tsuga-query",description:"Query that selects which logs should enter the route"}),tags:ct,owner:m({allowEmpty:!1,description:"Team ID owning and managing the route"}),processors:n.Array(aO,{maxItems:50,description:"Ordered processors applied to logs that match the route"})}),mTe=d({tags:["routes"],url:jr,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(yn)}),uTe=d({tags:["routes"],url:`${jr}/:id`,params:n.Object({id:m()}),method:"GET",response:yn}),lTe=d({tags:["routes"],url:jr,method:"POST",body:Fi,response:yn}),dTe=d({tags:["routes"],url:`${jr}/:id`,method:"PUT",body:Fi,params:n.Object({id:m()}),response:yn}),fTe=d({tags:["routes"],url:`${jr}/:id/clone`,method:"POST",params:n.Object({id:m()}),body:Fi,response:yn}),gTe=d({tags:["routes"],url:`${jr}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),yTe=d({tags:["routes"],url:`${jr}/:id/modify-ranking`,method:"PUT",params:n.Object({id:m()}),body:n.Object({rank:n.Number()}),response:n.Object({})}),ETe=d({tags:["routes"],url:`${jr}/:id/enable`,method:"PUT",params:n.Object({id:m()}),body:n.Object({enable:n.Boolean()}),response:n.Object({})});var Bi=`/${"v1"}/routes`,qi=n.Pick(yn,["id","name","description","isEnabled","query","tags","owner","processors"],{$id:"Route",description:"Log route allowing to standardize logs and enrich them with additional data"}),UD={id:"123-456-abc",name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(qi,{examples:[UD]});var sO=d({description:"Retrieve all routes",operationId:"listRoutes",tags:["routes"],url:Bi,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(qi)}),pO=d({description:"Retrieve a route by its id",operationId:"getRoute",tags:["routes"],url:`${Bi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:qi}),Wc=n.Pick(Fi,["name","description","isEnabled","query","tags","owner","processors"]),ND={name:"Enrich API Gateway Logs",description:"Adds service metadata and normalizes log format",isEnabled:!0,query:"service:api-gateway",tags:[{key:"category",value:"enrichment"}],owner:"abc-123-def",processors:[{id:"789-abc-def",type:"parse-attribute",tags:[],params:{subtype:"grok",attributeName:"message",rules:["%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} %{GREEDYDATA:msg}"]}}]};Object.assign(Wc,{examples:[ND]});var cO=d({description:"Create a new route",operationId:"createRoute",tags:["routes"],url:Bi,method:"POST",body:Wc,response:qi}),mO=d({description:"Update a route by its id",operationId:"updateRoute",tags:["routes"],url:`${Bi}/:id`,method:"PUT",body:Wc,params:n.Object({id:m({allowEmpty:!1})}),response:qi}),uO=d({description:"Delete a route by its id",operationId:"deleteRoute",tags:["routes"],url:`${Bi}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var En=`${Di}/tag-policies`;var lO=["ingestion-api-key","operation-api-key","dashboard","log-route","monitor","notification-rule","notification-silence","slo"],LD=["logs","metrics","traces"],Zc=n.Array(n.Enum(lO)),Xc=n.Array(n.Enum(LD)),kD=n.Union([Zc,Xc]),MD=n.Object({teamIds:n.Array(n.String()),mode:n.Enum(["include","exclude"])}),wD=b("type",[n.Object({type:n.Literal("telemetry"),assetTypes:Xc,shouldInsertWarning:n.Boolean(),dropSample:n.Optional(n.Number())}),n.Object({type:n.Literal("tsuga_asset"),assetTypes:Zc})]),$D=b("type",[n.Object({type:n.Literal("telemetry"),assetTypes:Xc,shouldInsertWarning:n.Boolean(),dropSample:n.Optional(n.Number({minimum:0,maximum:100}))}),n.Object({type:n.Literal("tsuga_asset"),assetTypes:Zc})]),Eo=n.Object({id:n.String(),name:n.String(),description:n.Optional(n.String()),isActive:n.Boolean(),tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean(),teamScope:n.Optional(MD),configuration:wD,creator:n.Optional(Ae),updater:n.Optional(Ae),owner:n.Optional(n.String()),createdAt:T(),updatedAt:T(),assetUpdatedAt:T()});var Hi=n.Object({name:m(),description:n.Optional(m()),isActive:n.Boolean(),tagKey:m({allowEmpty:!1}),allowedTagValues:n.Array(m({allowEmpty:!1}),{maxItems:1e3}),isRequired:n.Boolean(),teamScope:n.Optional(n.Object({teamIds:n.Array(m(),{minItems:1,maxItems:100}),mode:n.Enum(["include","exclude"])})),configuration:$D,owner:m({allowEmpty:!1})}),LTe=d({tags:["tag-policies"],url:En,method:"GET",query:n.Object({teamIds:n.Optional(n.Array(m(),{maxItems:100})),assetTypes:n.Optional(kD),searchQuery:n.Optional(m())}),response:n.Array(Eo)}),kTe=d({tags:["tag-policies"],url:`${En}/:id`,method:"GET",params:n.Object({id:m()}),response:Eo}),MTe=d({tags:["tag-policies"],url:En,method:"POST",body:Hi,response:Eo}),wTe=d({tags:["tag-policies"],url:`${En}/:id`,method:"PUT",params:n.Object({id:m()}),body:Hi,response:Eo}),$Te=d({tags:["tag-policies"],url:`${En}/:id`,method:"DELETE",params:n.Object({id:m()}),response:v}),DTe=d({tags:["tag-policies"],url:`${Di}/applicable-tag-rules`,method:"GET",query:n.Object({assetType:n.Enum(lO),teamId:m()}),response:n.Array(n.Object({tagKey:n.String(),allowedTagValues:n.Array(n.String()),isRequired:n.Boolean()}))}),dO=n.Object({total:n.Number(),totalNonCompliant:n.Number(),idsNonCompliant:n.Array(n.String())}),fO=n.Union([n.Literal("ingestion-api-key"),n.Literal("operation-api-key"),n.Literal("dashboard"),n.Literal("log-route"),n.Literal("monitor"),n.Literal("notification-rule"),n.Literal("notification-silence"),n.Literal("slo")]),DD=n.Object({total:n.Number(),totalNonCompliant:n.Number(),byAssetType:n.Record(fO,dO)}),GD=n.Omit(dO,["total"]),vD=n.Object({totalNonCompliant:n.Number(),byAssetType:n.Record(fO,GD)}),gO=n.Object({totals:DD,byTeam:n.Record(n.String(),vD)}),GTe=d({tags:["tag-policies"],url:`${En}/:id/stats`,method:"GET",params:n.Object({id:m()}),response:gO}),vTe=d({tags:["tag-policies"],url:`${En}/new-policy-stats`,method:"POST",body:Hi,response:gO});var Ki=`/${"v1"}/tag-policies`,ks=n.Pick(Eo,["id","name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"],{$id:"TagPolicy",description:"Policy that enforces tag requirements on Tsuga assets or telemetry data"}),yO=n.Pick(Hi,["name","description","isActive","tagKey","allowedTagValues","isRequired","teamScope","configuration","owner"]),EO=d({description:"Retrieve all tag policies",operationId:"listTagPolicies",tags:["tag-policies"],url:Ki,method:"GET",response:n.Array(ks)}),IO=d({description:"Retrieve a tag policy by its id",operationId:"getTagPolicy",tags:["tag-policies"],url:`${Ki}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:ks}),TO=d({description:"Create a new tag policy",operationId:"createTagPolicy",tags:["tag-policies"],url:Ki,method:"POST",body:yO,response:ks}),_O=d({description:"Update a tag policy by its id",operationId:"updateTagPolicy",tags:["tag-policies"],url:`${Ki}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:yO,response:ks}),hO=d({description:"Delete a tag policy by its id",operationId:"deleteTagPolicy",tags:["tag-policies"],url:`${Ki}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});var zi=`/${"v1"}/teams`,Vi=n.Pick(so,["id","name","description","visibility","tags"],{$id:"Team",description:"Collection of users used to manage ownership and access to resources"}),jD={id:"abc-123-def",name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(Vi,{examples:[jD]});var OO=d({description:"Retrieve all teams",operationId:"listTeams",tags:["teams"],url:zi,method:"GET",paginated:!0,query:n.Object(Ue),response:n.Array(Vi)}),AO=d({description:"Retrieve a team by its id",operationId:"getTeam",tags:["teams"],url:`${zi}/:id`,method:"GET",params:n.Object({id:m({allowEmpty:!1})}),response:Vi}),Jc=n.Pick(ls,["name","description","visibility","tags"]),FD={name:"Platform Engineering",description:"Responsible for internal developer tooling and infrastructure",visibility:"public",tags:[{key:"department",value:"engineering"}]};Object.assign(Jc,{examples:[FD]});var SO=d({description:"Create a new team",operationId:"createTeam",tags:["teams"],url:zi,method:"POST",body:Jc,response:Vi}),bO=d({description:"Update a team by its id",operationId:"updateTeam",tags:["teams"],url:`${zi}/:id`,method:"PUT",params:n.Object({id:m({allowEmpty:!1})}),body:Jc,response:Vi}),xO=d({description:"Delete a team by its id",operationId:"deleteTeam",tags:["teams"],url:`${zi}/:id`,method:"DELETE",params:n.Object({id:m({allowEmpty:!1})}),response:v});function BD(e){return a.IsObject(e)&&a.HasPropertyKey(e,"check")&&a.HasPropertyKey(e,"errors")&&a.IsFunction(e.check)&&a.IsFunction(e.errors)}function em(e){return a.HasPropertyKey(e,"~guard")&&BD(e["~guard"])}function tm(e){return a.HasPropertyKey(e,"~refine")&&a.IsArray(e["~refine"])&&a.Every(e["~refine"],0,t=>a.IsObject(t)&&a.HasPropertyKey(t,"refine")&&a.HasPropertyKey(t,"message")&&a.IsFunction(t.refine)&&a.IsString(t.message))}function sr(e){return a.IsObject(e)&&!a.IsArray(e)}function Ms(e){return a.IsBoolean(e)}function D(e){return sr(e)||Ms(e)}function rm(e){return a.HasPropertyKey(e,"additionalItems")&&D(e.additionalItems)}function pr(e){return a.HasPropertyKey(e,"additionalProperties")&&D(e.additionalProperties)}function nm(e){return a.HasPropertyKey(e,"allOf")&&a.IsArray(e.allOf)&&e.allOf.every(t=>D(t))}function Yi(e){return a.HasPropertyKey(e,"$anchor")&&a.IsString(e.$anchor)}function om(e){return a.HasPropertyKey(e,"anyOf")&&a.IsArray(e.anyOf)&&e.anyOf.every(t=>D(t))}function im(e){return a.HasPropertyKey(e,"const")}function In(e){return a.HasPropertyKey(e,"contains")&&D(e.contains)}function _t(e){return a.HasPropertyKey(e,"default")}function am(e){return a.HasPropertyKey(e,"dependencies")&&a.IsObject(e.dependencies)&&Object.values(e.dependencies).every(t=>D(t)||a.IsArray(t)&&t.every(r=>a.IsString(r)))}function sm(e){return a.HasPropertyKey(e,"dependentRequired")&&a.IsObject(e.dependentRequired)&&Object.values(e.dependentRequired).every(t=>a.IsArray(t)&&t.every(r=>a.IsString(r)))}function pm(e){return a.HasPropertyKey(e,"dependentSchemas")&&a.IsObject(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(t=>D(t))}function cm(e){return a.HasPropertyKey(e,"$dynamicAnchor")&&a.IsString(e.$dynamicAnchor)}function mm(e){return a.HasPropertyKey(e,"else")&&D(e.else)}function um(e){return a.HasPropertyKey(e,"enum")&&a.IsArray(e.enum)}function lm(e){return a.HasPropertyKey(e,"exclusiveMaximum")&&(a.IsNumber(e.exclusiveMaximum)||a.IsBigInt(e.exclusiveMaximum))}function cr(e){return a.HasPropertyKey(e,"exclusiveMinimum")&&(a.IsNumber(e.exclusiveMinimum)||a.IsBigInt(e.exclusiveMinimum))}function Qi(e){return a.HasPropertyKey(e,"format")&&a.IsString(e.format)}function Tn(e){return a.HasPropertyKey(e,"$id")&&a.IsString(e.$id)}function dm(e){return a.HasPropertyKey(e,"if")&&D(e.if)}function Io(e){return a.HasPropertyKey(e,"items")&&(D(e.items)||a.IsArray(e.items)&&e.items.every(t=>D(t)))}function fm(e){return Io(e)&&a.IsArray(e.items)}function gm(e){return a.HasPropertyKey(e,"maximum")&&(a.IsNumber(e.maximum)||a.IsBigInt(e.maximum))}function ym(e){return a.HasPropertyKey(e,"maxContains")&&a.IsNumber(e.maxContains)}function ws(e){return a.HasPropertyKey(e,"maxItems")&&a.IsNumber(e.maxItems)}function Em(e){return a.HasPropertyKey(e,"maxLength")&&a.IsNumber(e.maxLength)}function Im(e){return a.HasPropertyKey(e,"maxProperties")&&a.IsNumber(e.maxProperties)}function mr(e){return a.HasPropertyKey(e,"minimum")&&(a.IsNumber(e.minimum)||a.IsBigInt(e.minimum))}function _n(e){return a.HasPropertyKey(e,"minContains")&&a.IsNumber(e.minContains)}function To(e){return a.HasPropertyKey(e,"minItems")&&a.IsNumber(e.minItems)}function Wi(e){return a.HasPropertyKey(e,"minLength")&&a.IsNumber(e.minLength)}function Zi(e){return a.HasPropertyKey(e,"minProperties")&&a.IsNumber(e.minProperties)}function Tm(e){return a.HasPropertyKey(e,"multipleOf")&&(a.IsNumber(e.multipleOf)||a.IsBigInt(e.multipleOf))}function _m(e){return a.HasPropertyKey(e,"not")&&D(e.not)}function hm(e){return a.HasPropertyKey(e,"oneOf")&&a.IsArray(e.oneOf)&&e.oneOf.every(t=>D(t))}function Xi(e){return a.HasPropertyKey(e,"pattern")&&(a.IsString(e.pattern)||e.pattern instanceof RegExp)}function Ji(e){return a.HasPropertyKey(e,"patternProperties")&&a.IsObject(e.patternProperties)&&Object.values(e.patternProperties).every(t=>D(t))}function _o(e){return a.HasPropertyKey(e,"prefixItems")&&a.IsArray(e.prefixItems)&&e.prefixItems.every(t=>D(t))}function ea(e){return a.HasPropertyKey(e,"properties")&&a.IsObject(e.properties)&&Object.values(e.properties).every(t=>D(t))}function Om(e){return a.HasPropertyKey(e,"propertyNames")&&(a.IsObject(e.propertyNames)||D(e.propertyNames))}function qD(e){return a.HasPropertyKey(e,"$recursiveAnchor")&&a.IsBoolean(e.$recursiveAnchor)}function $s(e){return qD(e)&&a.IsEqual(e.$recursiveAnchor,!0)}function Am(e){return a.HasPropertyKey(e,"$recursiveRef")&&a.IsString(e.$recursiveRef)}function Sm(e){return a.HasPropertyKey(e,"$ref")&&a.IsString(e.$ref)}function hn(e){return a.HasPropertyKey(e,"required")&&a.IsArray(e.required)&&e.required.every(t=>a.IsString(t))}function bm(e){return a.HasPropertyKey(e,"then")&&D(e.then)}function xm(e){return a.HasPropertyKey(e,"type")&&(a.IsString(e.type)||a.IsArray(e.type)&&e.type.every(t=>a.IsString(t)))}function ho(e){return a.HasPropertyKey(e,"uniqueItems")&&a.IsBoolean(e.uniqueItems)}function Ds(e){return a.HasPropertyKey(e,"unevaluatedItems")&&D(e.unevaluatedItems)}function Gs(e){return a.HasPropertyKey(e,"unevaluatedProperties")&&D(e.unevaluatedProperties)}var rt=class{constructor(){this.indices=new Set,this.keys=new Set}AddIndex(t){return this.indices.add(t),!0}AddKey(t){return this.keys.add(t),!0}GetIndices(){return this.indices}GetKeys(){return this.keys}Merge(t){for(let r of t)r.indices.forEach(o=>this.indices.add(o)),r.keys.forEach(o=>this.keys.add(o));return!0}},ta=class extends rt{constructor(t){super(),this.callback=t}AddError(t){return this.callback(t),!1}},$e=class extends ta{constructor(){super(t=>this.errors.push(t)),this.errors=[]}AddError(t){return this.errors.push(t),!1}GetErrors(){return this.errors}};var HD="external_",KD=0,SAe={identifier:`${HD}${KD}`,variables:[]};function RO(e,t,r,o){return r["~guard"].check(o)}function CO(e,t,r,o,i,s){return i["~guard"].check(s)||t.AddError({keyword:"~guard",schemaPath:r,instancePath:o,params:{errors:i["~guard"].errors(s)}})}function PO(e,t,r,o){return a.Every(r["~refine"],0,(i,s)=>i.refine(o))}function UO(e,t,r,o,i,s){return a.EveryAll(i["~refine"],0,(c,u)=>c.refine(s)||t.AddError({keyword:"~refine",schemaPath:r,instancePath:o,params:{index:u,message:c.message}}))}function NO(e){return Io(e)&&a.IsArray(e.items)}function LO(e,t,r,o){return NO(r)?o.every((s,c)=>a.IsLessThan(c,r.items.length)||$(e,t,r.additionalItems,s)&&t.AddIndex(c)):!0}function kO(e,t,r,o,i,s){return NO(i)?s.every((u,l)=>{let g=`${r}/additionalItems`,E=`${o}/${l}`;return a.IsLessThan(l,i.items.length)||K(e,t,g,E,i.additionalItems,u)&&t.AddIndex(l)}):!0}function zD(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`}function MO(e){let t=[];return Ji(e)&&t.push(...a.Keys(e.patternProperties)),ea(e)&&t.push(...a.Keys(e.properties).map(zD)),a.IsEqual(t.length,0)?"(?!)":`(${t.join("|")})`}function wO(e,t,r,o){let i=new RegExp(MO(r));return a.Every(a.Keys(o),0,(c,u)=>i.test(c)||$(e,t,r.additionalProperties,o[c])&&t.AddKey(c))}function $O(e,t,r,o,i,s){let c=new RegExp(MO(i)),u=[];return a.EveryAll(a.Keys(s),0,(g,E)=>{let I=`${r}/additionalProperties`,P=`${o}/${g}`,be=new $e,ve=c.test(g)||K(e,be,I,P,i.additionalProperties,s[g])&&t.AddKey(g);return ve||u.push(g),ve})||t.AddError({keyword:"additionalProperties",schemaPath:r,instancePath:o,params:{additionalProperties:u}})}function DO(e,t,r,o){let i=r.allOf.reduce((s,c)=>{let u=new rt;return $(e,u,c,o)?[...s,u]:s},[]);return a.IsEqual(i.length,r.allOf.length)&&t.Merge(i)}function GO(e,t,r,o,i,s){let c=[],u=i.allOf.reduce((g,E,I)=>{let P=`${r}/allOf/${I}`,be=new $e,ve=K(e,be,P,o,E,s);return ve||c.push(be),ve?[...g,be]:g},[]),l=a.IsEqual(u.length,i.allOf.length)&&t.Merge(u);return l||c.forEach(g=>g.GetErrors().forEach(E=>t.AddError(E))),l}function vO(e,t,r,o){let i=r.anyOf.reduce((s,c,u)=>{let l=new rt;return $(e,l,c,o)?[...s,l]:s},[]);return a.IsGreaterThan(i.length,0)&&t.Merge(i)}function jO(e,t,r,o,i,s){let c=[],u=i.anyOf.reduce((g,E,I)=>{let P=new $e,be=`${r}/anyOf/${I}`,ve=K(e,P,be,o,E,s);return ve||c.push(P),ve?[...g,P]:g},[]),l=a.IsGreaterThan(u.length,0)&&t.Merge(u);return l||c.forEach(g=>g.GetErrors().forEach(E=>t.AddError(E))),l||t.AddError({keyword:"anyOf",schemaPath:r,instancePath:o,params:{}})}function Cm(e,t,r,o){return r}function FO(e,t,r,o,i,s){return Cm(e,t,i,s)||t.AddError({keyword:"boolean",schemaPath:r,instancePath:o,params:{}})}function Pm(e,t,r,o){return a.IsValueLike(r.const)?a.IsEqual(o,r.const):a.IsDeepEqual(o,r.const)}function BO(e,t,r,o,i,s){return Pm(e,t,i,s)||t.AddError({keyword:"const",schemaPath:r,instancePath:o,params:{allowedValue:i.const}})}function VD(e){return!(_n(e)&&a.IsEqual(e.minContains,0))}function Um(e,t,r,o){return VD(r)?!a.IsEqual(o.length,0)&&o.some(i=>$(e,t,r.contains,i)):!0}function qO(e,t,r,o,i,s){return Um(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:1}})}function HO(e,t,r,o){let i=a.IsEqual(a.Keys(o).length,0),s=a.Every(a.Entries(r.dependencies),0,([c,u])=>!a.HasPropertyKey(o,c)||(a.IsArray(u)?u.every(l=>a.HasPropertyKey(o,l)):$(e,t,u,o)));return i||s}function KO(e,t,r,o,i,s){let c=a.IsEqual(a.Keys(s).length,0),u=a.EveryAll(a.Entries(i.dependencies),0,([l,g])=>{let E=`${r}/dependencies/${l}`;return!a.HasPropertyKey(s,l)||(a.IsArray(g)?g.every(I=>a.HasPropertyKey(s,I)||t.AddError({keyword:"dependencies",schemaPath:r,instancePath:o,params:{property:l,dependencies:g}})):K(e,t,E,o,g,s))});return c||u}function zO(e,t,r,o){let i=a.IsEqual(a.Keys(o).length,0),s=a.Every(a.Entries(r.dependentRequired),0,([c,u])=>!a.HasPropertyKey(o,c)||u.every(l=>a.HasPropertyKey(o,l)));return i||s}function VO(e,t,r,o,i,s){let c=a.IsEqual(a.Keys(s).length,0),u=a.EveryAll(a.Entries(i.dependentRequired),0,([l,g])=>!a.HasPropertyKey(s,l)||a.EveryAll(g,0,E=>a.HasPropertyKey(s,E)||t.AddError({keyword:"dependentRequired",schemaPath:r,instancePath:o,params:{property:l,dependencies:g}})));return c||u}function YO(e,t,r,o){let i=a.IsEqual(a.Keys(o).length,0),s=a.Every(a.Entries(r.dependentSchemas),0,([c,u])=>!a.HasPropertyKey(o,c)||$(e,t,u,o));return i||s}function QO(e,t,r,o,i,s){let c=a.IsEqual(a.Keys(s).length,0),u=a.EveryAll(a.Entries(i.dependentSchemas),0,([l,g])=>{let E=`${r}/dependentSchemas/${l}`;return!a.HasPropertyKey(s,l)||K(e,t,E,o,g,s)});return c||u}function Nm(e,t,r,o){return r.enum.some(i=>a.IsValueLike(i)?a.IsEqual(o,i):a.IsDeepEqual(o,i))}function WO(e,t,r,o,i,s){return Nm(e,t,i,s)||t.AddError({keyword:"enum",schemaPath:r,instancePath:o,params:{allowedValues:i.enum}})}function Lm(e,t,r,o){return a.IsLessThan(o,r.exclusiveMaximum)}function ZO(e,t,r,o,i,s){return Lm(e,t,i,s)||t.AddError({keyword:"exclusiveMaximum",schemaPath:r,instancePath:o,params:{comparison:"<",limit:i.exclusiveMaximum}})}function km(e,t,r,o){return a.IsGreaterThan(o,r.exclusiveMinimum)}function XO(e,t,r,o,i,s){return km(e,t,i,s)||t.AddError({keyword:"exclusiveMinimum",schemaPath:r,instancePath:o,params:{comparison:">",limit:i.exclusiveMinimum}})}var Ao={};ht(Ao,{Clear:()=>eA,Entries:()=>lG,Get:()=>gG,Has:()=>fG,IsDate:()=>ra,IsDateTime:()=>Mm,IsDuration:()=>wm,IsEmail:()=>$m,IsHostname:()=>Dm,IsIPv4:()=>Fm,IsIPv6:()=>Bm,IsIdnEmail:()=>Gm,IsIdnHostname:()=>jm,IsIri:()=>Hm,IsIriReference:()=>qm,IsJsonPointer:()=>zm,IsJsonPointerUriFragment:()=>Km,IsRegex:()=>Vm,IsRelativeJsonPointer:()=>Ym,IsTime:()=>na,IsUri:()=>Zm,IsUriReference:()=>Qm,IsUriTemplate:()=>Wm,IsUrl:()=>Xm,IsUuid:()=>Jm,Reset:()=>tA,Set:()=>dG,Test:()=>yG});var YD=[0,31,28,31,30,31,30,31,31,30,31,30,31],QD=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function WD(e){return e%4===0&&(e%100!==0||e%400===0)}function ra(e){let t=QD.exec(e);if(!t)return!1;let r=+t[1],o=+t[2],i=+t[3];return o>=1&&o<=12&&i>=1&&i<=(o===2&&WD(r)?29:YD[o])}var ZD=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(?:Z|([+-])(\d\d):(\d\d))?$/i;function na(e,t=!0){let r=ZD.exec(e);if(!r)return!1;let o=+r[1],i=+r[2],s=+r[3],c=r[4]==="-"?-1:1,u=+(r[5]||0),l=+(r[6]||0);if(u>23||l>59||t&&!r[4]&&e.toLowerCase().indexOf("z")===-1)return!1;if(o<=23&&i<=59&&s<60)return!0;let g=i-l*c,E=o-u*c-(g<0?1:0);return(E===23||E===-1)&&(g===59||g===-1)&&s<61}function Mm(e,t=!0){let r=e.split(/T/i);return r.length===2&&ra(r[0])&&na(r[1],t)}var XD=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/;function wm(e){return XD.test(e)}var JD=/^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[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;function $m(e){return JD.test(e)}var eG=/^(?=.{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;function Dm(e){return eG.test(e)}var tG=/^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;function Gm(e){return tG.test(e)}function vm(e){let t=e.codePointAt(0);return t===void 0?!1:t>=12352&&t<=12447||t>=12448&&t<=12543&&t!==12539||t>=19968&&t<=40959}function jm(e){if(e.length===0||e.includes(" "))return!1;let t=/[\u002E\u3002\uFF0E\uFF61]/g,r=e.normalize("NFC").replace(t,".");if(r.length>253)return!1;let o=r.split(".");if(o.some(i=>i.length===0))return!1;for(let i of o){if(i.length>63||i.startsWith("-")||i.endsWith("-"))return!1;if(/^xn--/i.test(i)){let l=i.slice(4);if(l.length<2||l.includes("---"))return!1;continue}if(/[\u302E\u302F\u3031\u3032\u3033\u3034\u3035\u303B\u0640\u07FA]/.test(i))return!1;let s=i.charAt(0);if(/[\u0903\u0300\u0488]/.test(s))return!1;for(let l=0;l<i.length;l++){let g=i.charAt(l);if(g==="\xB7"){if(l===0||l===i.length-1)return!1;let E=i.charAt(l-1),I=i.charAt(l+1);if(!/^[lL]$/.test(E)||!/^[lL]$/.test(I))return!1}if(g==="\u30FB"){if(i.length===1)return!1;if(l===0){let E=i.charAt(l+1);if(!vm(E))return!1}else{let E=i.charAt(l-1),I=i.charAt(l+1);if(!vm(E)||!vm(I))return!1}}if(g==="\u0375"){if(l===i.length-1)return!1;let E=i.charAt(l+1);if(!/[\u0370-\u03FF]/.test(E))return!1}if(g==="\u05F3"||g==="\u05F4"){if(l===0)return!1;let E=i.charAt(l-1);if(!/[\u05D0-\u05EA]/.test(E))return!1}if(g==="\u200D"&&(l===0||i.charAt(l-1)!=="\u094D"))return!1}let c=!1,u=!1;for(let l=0;l<i.length;l++){let g=i.charAt(l);/[\u0660-\u0669]/.test(g)&&(c=!0),/[\u06F0-\u06F9]/.test(g)&&(u=!0)}if(c&&u)return!1}return!0}var rG=/^(?:(?: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)$/;function Fm(e){return rG.test(e)}var nG=/^((([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;function Bm(e){return nG.test(e)}function JO(e){try{return new URL(e,"http://example.com"),!0}catch{return!1}}function qm(e){if(e.includes(" ")||e.includes("\\")||/[\x00-\x1F\x7F]/.test(e)||/%(?![0-9a-fA-F]{2})/.test(e))return!1;if(e==="")return!0;let t=e.indexOf(":");return t>0&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e.substring(0,t))?JO(e):e.match(/^([a-zA-Z][a-zA-Z0-9+\-.]*)(\/\/)/)&&t===-1?!1:JO(e)}function Hm(e){try{return new URL(e),!0}catch{return!1}}var oG=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function Km(e){return oG.test(e)}var iG=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function zm(e){return iG.test(e)}function Vm(e){if(e.length===0)return!1;try{return new RegExp(e),!0}catch{return!1}}var aG=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function Ym(e){return aG.test(e)}var sG=/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i;function Qm(e){return sG.test(e)}var pG=/^(?:(?:[^\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;function Wm(e){return pG.test(e)}var cG=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i;function Zm(e){return cG.test(e)}var mG=/^(?: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;function Xm(e){return mG.test(e)}var uG=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function Jm(e){return uG.test(e)}var ce=new Map;function eA(){ce.clear()}function lG(){return[...ce.entries()]}function dG(e,t){ce.set(e,t)}function fG(e){return ce.has(e)}function gG(e){return ce.get(e)}function yG(e,t){return ce.get(e)?.(t)??!0}function tA(){eA(),ce.set("date-time",Mm),ce.set("date",ra),ce.set("duration",wm),ce.set("email",$m),ce.set("hostname",Dm),ce.set("idn-email",Gm),ce.set("idn-hostname",jm),ce.set("ipv4",Fm),ce.set("ipv6",Bm),ce.set("iri-reference",qm),ce.set("iri",Hm),ce.set("json-pointer-uri-fragment",Km),ce.set("json-pointer",zm),ce.set("regex",Vm),ce.set("relative-json-pointer",Ym),ce.set("time",na),ce.set("uri-reference",Qm),ce.set("uri-template",Wm),ce.set("uri",Zm),ce.set("url",Xm),ce.set("uuid",Jm)}tA();function eu(e,t,r,o){return Ao.Test(r.format,o)}function rA(e,t,r,o,i,s){return eu(e,t,i,s)||t.AddError({keyword:"format",schemaPath:r,instancePath:o,params:{format:i.format}})}function nA(e,t,r,o){let i=bm(r)?r.then:!0,s=mm(r)?r.else:!0;return $(e,t,r.if,o)?$(e,t,i,o):$(e,t,s,o)}function oA(e,t,r,o,i,s){let c=bm(i)?i.then:!0,u=mm(i)?i.else:!0,l=new $e,g=K(e,l,`${r}/if`,o,i.if,s)?K(e,l,`${r}/then`,o,c,s)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"then"}}):K(e,t,`${r}/else`,o,u,s)||t.AddError({keyword:"if",schemaPath:r,instancePath:o,params:{failingKeyword:"else"}});return g&&t.Merge([l]),g}function EG(e,t,r,o){return a.Every(r.items,0,(i,s)=>a.IsLessEqualThan(o.length,s)||$(e,t,i,o[s])&&t.AddIndex(s))}function IG(e,t,r,o,i,s){return a.EveryAll(i.items,0,(c,u)=>{let l=`${r}/items/${u}`,g=`${o}/${u}`;return a.IsLessEqualThan(s.length,u)||K(e,t,l,g,c,s[u])&&t.AddIndex(u)})}function TG(e,t,r,o){let i=_o(r)?r.prefixItems.length:0;return a.Every(o,i,(s,c)=>$(e,t,r.items,s)&&t.AddIndex(c))}function _G(e,t,r,o,i,s){let c=_o(i)?i.prefixItems.length:0;return a.EveryAll(s,c,(u,l)=>{let g=`${r}/items`,E=`${o}/${l}`;return K(e,t,g,E,i.items,u)&&t.AddIndex(l)})}function iA(e,t,r,o){return fm(r)?EG(e,t,r,o):TG(e,t,r,o)}function aA(e,t,r,o,i,s){return fm(i)?IG(e,t,r,o,i,s):_G(e,t,r,o,i,s)}function hG(e){return In(e)}function tu(e,t,r,o){if(!hG(r))return!0;let i=o.reduce((s,c)=>$(e,t,r.contains,c)?++s:s,0);return a.IsLessEqualThan(i,r.maxContains)}function sA(e,t,r,o,i,s){let c=_n(i)?i.minContains:1;return tu(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:c,maxContains:i.maxContains}})}function ru(e,t,r,o){return a.IsLessEqualThan(o,r.maximum)}function pA(e,t,r,o,i,s){return ru(e,t,i,s)||t.AddError({keyword:"maximum",schemaPath:r,instancePath:o,params:{comparison:"<=",limit:i.maximum}})}function nu(e,t,r,o){return a.IsLessEqualThan(o.length,r.maxItems)}function cA(e,t,r,o,i,s){return nu(e,t,i,s)||t.AddError({keyword:"maxItems",schemaPath:r,instancePath:o,params:{limit:i.maxItems}})}function ou(e,t,r,o){return a.IsMaxLength(o,r.maxLength)}function mA(e,t,r,o,i,s){return ou(e,t,i,s)||t.AddError({keyword:"maxLength",schemaPath:r,instancePath:o,params:{limit:i.maxLength}})}function iu(e,t,r,o){return a.IsLessEqualThan(a.Keys(o).length,r.maxProperties)}function uA(e,t,r,o,i,s){return iu(e,t,i,s)||t.AddError({keyword:"maxProperties",schemaPath:r,instancePath:o,params:{limit:i.maxProperties}})}function OG(e){return In(e)}function au(e,t,r,o){if(!OG(r))return!0;let i=o.reduce((s,c)=>$(e,t,r.contains,c)?++s:s,0);return a.IsGreaterEqualThan(i,r.minContains)}function lA(e,t,r,o,i,s){return au(e,t,i,s)||t.AddError({keyword:"contains",schemaPath:r,instancePath:o,params:{minContains:i.minContains}})}function su(e,t,r,o){return a.IsGreaterEqualThan(o,r.minimum)}function dA(e,t,r,o,i,s){return su(e,t,i,s)||t.AddError({keyword:"minimum",schemaPath:r,instancePath:o,params:{comparison:">=",limit:i.minimum}})}function pu(e,t,r,o){return a.IsGreaterEqualThan(o.length,r.minItems)}function fA(e,t,r,o,i,s){return pu(e,t,i,s)||t.AddError({keyword:"minItems",schemaPath:r,instancePath:o,params:{limit:i.minItems}})}function cu(e,t,r,o){return a.IsMinLength(o,r.minLength)}function gA(e,t,r,o,i,s){return cu(e,t,i,s)||t.AddError({keyword:"minLength",schemaPath:r,instancePath:o,params:{limit:i.minLength}})}function mu(e,t,r,o){return a.IsGreaterEqualThan(a.Keys(o).length,r.minProperties)}function yA(e,t,r,o,i,s){return mu(e,t,i,s)||t.AddError({keyword:"minProperties",schemaPath:r,instancePath:o,params:{limit:i.minProperties}})}function uu(e,t,r,o){return a.IsMultipleOf(o,r.multipleOf)}function EA(e,t,r,o,i,s){return uu(e,t,i,s)||t.AddError({keyword:"multipleOf",schemaPath:r,instancePath:o,params:{multipleOf:i.multipleOf}})}function lu(e,t,r,o){let i=new rt;return!$(e,i,r.not,o)&&t.Merge([i])}function IA(e,t,r,o,i,s){return lu(e,t,i,s)||t.AddError({keyword:"not",schemaPath:r,instancePath:o,params:{}})}function TA(e,t,r,o){let i=r.oneOf.reduce((s,c)=>{let u=new rt;return $(e,u,c,o)?[...s,u]:s},[]);return a.IsEqual(i.length,1)&&t.Merge(i)}function _A(e,t,r,o,i,s){let c=[],u=[],l=i.oneOf.reduce((E,I,P)=>{let be=new $e,ve=`${r}/oneOf/${P}`,Ro=K(e,be,ve,o,I,s);return Ro&&u.push(P),Ro||c.push(be),Ro?[...E,be]:E},[]),g=a.IsEqual(l.length,1)&&t.Merge(l);return!g&&a.IsEqual(u.length,0)&&c.forEach(E=>E.GetErrors().forEach(I=>t.AddError(I))),g||t.AddError({keyword:"oneOf",schemaPath:r,instancePath:o,params:{passingSchemas:u}})}function du(e,t,r,o){return(a.IsString(r.pattern)?new RegExp(r.pattern):r.pattern).test(o)}function hA(e,t,r,o,i,s){return du(e,t,i,s)||t.AddError({keyword:"pattern",schemaPath:r,instancePath:o,params:{pattern:i.pattern}})}function OA(e,t,r,o){return a.Every(a.Entries(r.patternProperties),0,([i,s])=>{let c=new RegExp(i);return a.Every(a.Entries(o),0,([u,l])=>!c.test(u)||$(e,t,s,l)&&t.AddKey(u))})}function AA(e,t,r,o,i,s){return a.EveryAll(a.Entries(i.patternProperties),0,([c,u])=>{let l=`${r}/patternProperties/${c}`,g=new RegExp(c);return a.EveryAll(a.Entries(s),0,([E,I])=>{let P=`${o}/${E}`;return!g.test(E)||K(e,t,l,P,u,I)&&t.AddKey(E)})})}function SA(e,t,r,o){return a.IsEqual(o.length,0)||a.Every(r.prefixItems,0,(i,s)=>a.IsLessEqualThan(o.length,s)||$(e,t,i,o[s])&&t.AddIndex(s))}function bA(e,t,r,o,i,s){return a.IsEqual(s.length,0)||a.EveryAll(i.prefixItems,0,(c,u)=>{let l=`${r}/prefixItems/${u}`,g=`${o}/${u}`;return a.IsLessEqualThan(s.length,u)||K(e,t,l,g,c,s[u])&&t.AddIndex(u)})}function fu(e,t){return e.includes(t)||yt.Get().exactOptionalPropertyTypes}function gu(e,t){return a.IsUndefined(e[t])}function xA(e,t,r,o){let i=hn(r)?r.required:[];return a.Every(a.Entries(r.properties),0,([c,u])=>{let l=!a.HasPropertyKey(o,c)||$(e,t,u,o[c])&&t.AddKey(c);return fu(i,c)?l:gu(o,c)||l})}function RA(e,t,r,o,i,s){let c=hn(i)?i.required:[];return a.EveryAll(a.Entries(i.properties),0,([l,g])=>{let E=`${r}/properties/${l}`,I=`${o}/${l}`,P=()=>!a.HasPropertyKey(s,l)||K(e,t,E,I,g,s[l])&&t.AddKey(l);return fu(c,l)?P():gu(s,l)||P()})}function CA(e,t,r,o){return a.Every(a.Keys(o),0,(i,s)=>$(e,t,r.propertyNames,i))}function PA(e,t,r,o,i,s){let c=[];return a.EveryAll(a.Keys(s),0,(l,g)=>{let E=`${o}/${l}`,I=`${r}/propertyNames`,P=new $e,be=K(e,P,I,E,i.propertyNames,l);return be||c.push(l),be})||t.AddError({keyword:"propertyNames",schemaPath:r,instancePath:o,params:{propertyNames:c}})}function UA(e,t,r,o){let i=e.RecursiveRef(r.$recursiveRef)??!1;return D(i)&&$(e,t,i,o)}function NA(e,t,r,o,i,s){let c=e.RecursiveRef(i.$recursiveRef)??!1;return D(c)&&K(e,t,"#",o,c,s)}function MA(e,t,r,o){let i=e.Ref(r.$ref)??!1,s=new rt,c=D(i)&&$(e,s,i,o);return c&&t.Merge([s]),c}function wA(e,t,r,o,i,s){let c=e.Ref(i.$ref)??!1,u=new $e,l=D(c)&&K(e,u,"#",o,c,s);return l&&t.Merge([u]),l||u.GetErrors().forEach(g=>t.AddError(g)),l}function $A(e,t,r,o){return a.Every(r.required,0,i=>a.HasPropertyKey(o,i))}function DA(e,t,r,o,i,s){let c=[];return a.EveryAll(i.required,0,l=>{let g=a.HasPropertyKey(s,l);return g||c.push(l),g})||t.AddError({keyword:"required",schemaPath:r,instancePath:o,params:{requiredProperties:c}})}function yu(e,t,r,o,i){return a.IsEqual(r,"object")?a.IsObjectNotArray(i):a.IsEqual(r,"array")?a.IsArray(i):a.IsEqual(r,"boolean")?a.IsBoolean(i):a.IsEqual(r,"integer")?a.IsInteger(i):a.IsEqual(r,"number")?a.IsNumber(i):a.IsEqual(r,"null")?a.IsNull(i):a.IsEqual(r,"string")?a.IsString(i):a.IsEqual(r,"asyncIterator")?a.IsAsyncIterator(i):a.IsEqual(r,"bigint")?a.IsBigInt(i):a.IsEqual(r,"constructor")?a.IsConstructor(i):a.IsEqual(r,"function")?a.IsFunction(i):a.IsEqual(r,"iterator")?a.IsIterator(i):a.IsEqual(r,"symbol")?a.IsSymbol(i):a.IsEqual(r,"undefined")?a.IsUndefined(i):a.IsEqual(r,"void")?a.IsUndefined(i):!0}function GA(e,t,r,o,i){return r.some(s=>yu(e,t,s,o,i))}function vA(e,t,r,o){return a.IsArray(r.type)?GA(e,t,r.type,r,o):yu(e,t,r.type,r,o)}function jA(e,t,r,o,i,s){return(a.IsArray(i.type)?GA(e,t,i.type,i,s):yu(e,t,i.type,i,s))||t.AddError({keyword:"type",schemaPath:r,instancePath:o,params:{type:i.type}})}function FA(e,t,r,o){let i=t.GetIndices();return a.Every(o,0,(s,c)=>(i.has(c)||$(e,t,r.unevaluatedItems,s))&&t.AddIndex(c))}function BA(e,t,r,o,i,s){let c=t.GetIndices(),u=[];return a.EveryAll(s,0,(g,E)=>{let I=new $e,P=(c.has(E)||K(e,I,r,o,i.unevaluatedItems,g))&&t.AddIndex(E);return P||u.push(E),P})||t.AddError({keyword:"unevaluatedItems",schemaPath:r,instancePath:o,params:{unevaluatedItems:u}})}function qA(e,t,r,o){let i=t.GetKeys();return a.Every(a.Entries(o),0,([s,c])=>i.has(s)||$(e,t,r.unevaluatedProperties,c)&&t.AddKey(s))}function HA(e,t,r,o,i,s){let c=t.GetKeys(),u=[];return a.EveryAll(a.Entries(s),0,([g,E])=>{let I=new $e,P=c.has(g)||K(e,I,r,o,i.unevaluatedProperties,E)&&t.AddKey(g);return P||u.push(g),P})||t.AddError({keyword:"unevaluatedProperties",schemaPath:r,instancePath:o,params:{unevaluatedProperties:u}})}function KA(e){return!a.IsEqual(e.uniqueItems,!1)}function zA(e,t,r,o){if(!KA(r))return!0;let i=new Set(o.map(hr.Hash)).size,s=o.length;return a.IsEqual(i,s)}function VA(e,t,r,o,i,s){if(!KA(i))return!0;let c=new Set,u=s.reduce((g,E,I)=>{let P=hr.Hash(E);return c.has(P)?[...g,I]:(c.add(P),g)},[]);return a.IsEqual(u.length,0)||t.AddError({keyword:"uniqueItems",schemaPath:r,instancePath:o,params:{duplicateItems:u}})}function $(e,t,r,o){e.Push(r);let i=Ms(r)?Cm(e,t,r,o):(!xm(r)||vA(e,t,r,o))&&(!(a.IsObject(o)&&!a.IsArray(o))||(!hn(r)||$A(e,t,r,o))&&(!pr(r)||wO(e,t,r,o))&&(!am(r)||HO(e,t,r,o))&&(!sm(r)||zO(e,t,r,o))&&(!pm(r)||YO(e,t,r,o))&&(!Ji(r)||OA(e,t,r,o))&&(!ea(r)||xA(e,t,r,o))&&(!Om(r)||CA(e,t,r,o))&&(!Zi(r)||mu(e,t,r,o))&&(!Im(r)||iu(e,t,r,o)))&&(!a.IsArray(o)||(!rm(r)||LO(e,t,r,o))&&(!In(r)||Um(e,t,r,o))&&(!Io(r)||iA(e,t,r,o))&&(!ym(r)||tu(e,t,r,o))&&(!ws(r)||nu(e,t,r,o))&&(!_n(r)||au(e,t,r,o))&&(!To(r)||pu(e,t,r,o))&&(!_o(r)||SA(e,t,r,o))&&(!ho(r)||zA(e,t,r,o)))&&(!a.IsString(o)||(!Qi(r)||eu(e,t,r,o))&&(!Em(r)||ou(e,t,r,o))&&(!Wi(r)||cu(e,t,r,o))&&(!Xi(r)||du(e,t,r,o)))&&(!(a.IsNumber(o)||a.IsBigInt(o))||(!lm(r)||Lm(e,t,r,o))&&(!cr(r)||km(e,t,r,o))&&(!gm(r)||ru(e,t,r,o))&&(!mr(r)||su(e,t,r,o))&&(!Tm(r)||uu(e,t,r,o)))&&(!Am(r)||UA(e,t,r,o))&&(!Sm(r)||MA(e,t,r,o))&&(!em(r)||RO(e,t,r,o))&&(!im(r)||Pm(e,t,r,o))&&(!um(r)||Nm(e,t,r,o))&&(!dm(r)||nA(e,t,r,o))&&(!_m(r)||lu(e,t,r,o))&&(!nm(r)||DO(e,t,r,o))&&(!om(r)||vO(e,t,r,o))&&(!hm(r)||TA(e,t,r,o))&&(!Ds(r)||!a.IsArray(o)||FA(e,t,r,o))&&(!Gs(r)||!a.IsObject(o)||qA(e,t,r,o))&&(!tm(r)||PO(e,t,r,o));return e.Pop(r),i}function K(e,t,r,o,i,s){e.Push(i);let c=Ms(i)?FO(e,t,r,o,i,s):!!(+(!xm(i)||jA(e,t,r,o,i,s))&+(!(a.IsObject(s)&&!a.IsArray(s))||!!(+(!hn(i)||DA(e,t,r,o,i,s))&+(!pr(i)||$O(e,t,r,o,i,s))&+(!am(i)||KO(e,t,r,o,i,s))&+(!sm(i)||VO(e,t,r,o,i,s))&+(!pm(i)||QO(e,t,r,o,i,s))&+(!Ji(i)||AA(e,t,r,o,i,s))&+(!ea(i)||RA(e,t,r,o,i,s))&+(!Om(i)||PA(e,t,r,o,i,s))&+(!Zi(i)||yA(e,t,r,o,i,s))&+(!Im(i)||uA(e,t,r,o,i,s))))&+(!a.IsArray(s)||!!(+(!rm(i)||kO(e,t,r,o,i,s))&+(!In(i)||qO(e,t,r,o,i,s))&+(!Io(i)||aA(e,t,r,o,i,s))&+(!ym(i)||sA(e,t,r,o,i,s))&+(!ws(i)||cA(e,t,r,o,i,s))&+(!_n(i)||lA(e,t,r,o,i,s))&+(!To(i)||fA(e,t,r,o,i,s))&+(!_o(i)||bA(e,t,r,o,i,s))&+(!ho(i)||VA(e,t,r,o,i,s))))&+(!a.IsString(s)||!!(+(!Qi(i)||rA(e,t,r,o,i,s))&+(!Em(i)||mA(e,t,r,o,i,s))&+(!Wi(i)||gA(e,t,r,o,i,s))&+(!Xi(i)||hA(e,t,r,o,i,s))))&+(!(a.IsNumber(s)||a.IsBigInt(s))||!!(+(!lm(i)||ZO(e,t,r,o,i,s))&+(!cr(i)||XO(e,t,r,o,i,s))&+(!gm(i)||pA(e,t,r,o,i,s))&+(!mr(i)||dA(e,t,r,o,i,s))&+(!Tm(i)||EA(e,t,r,o,i,s))))&+(!Am(i)||NA(e,t,r,o,i,s))&+(!Sm(i)||wA(e,t,r,o,i,s))&+(!em(i)||CO(e,t,r,o,i,s))&+(!im(i)||BO(e,t,r,o,i,s))&+(!um(i)||WO(e,t,r,o,i,s))&+(!dm(i)||oA(e,t,r,o,i,s))&+(!_m(i)||IA(e,t,r,o,i,s))&+(!nm(i)||GO(e,t,r,o,i,s))&+(!om(i)||jO(e,t,r,o,i,s))&+(!hm(i)||_A(e,t,r,o,i,s))&+(!Ds(i)||!a.IsArray(s)||BA(e,t,r,o,i,s))&+(!Gs(i)||!a.IsObject(s)||HA(e,t,r,o,i,s)))&&(!tm(i)||UO(e,t,r,o,i,s));return e.Pop(i),c}var An={};ht(An,{Ref:()=>wG});var ur={};ht(ur,{Delete:()=>PG,Get:()=>RG,Has:()=>xG,Indices:()=>oa,Set:()=>CG});function YA(e){if(e.length===0)throw Error("Cannot set root")}function QA(e){if(!a.IsObject(e))throw Error("Cannot set value")}function AG(e){return/^(0|[1-9]\d*)$/.test(e)}function WA(e){return[e.slice(0,e.length-1),e.slice(e.length-1)[0]]}function SG(e,t){return a.IsObject(t)&&a.HasPropertyKey(t,e)}function bG(e,t){return a.IsObject(t)?t[e]:void 0}function Eu(e,t){return e.reduce((r,o)=>bG(o,r),t)}function oa(e){if(a.IsEqual(e.length,0))return[];let t=e.split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));return t.length>0&&t[0]===""?t.slice(1):t}function xG(e,t){let r=e;return oa(t).every(o=>SG(o,r)?(r=r[o],!0):!1)}function RG(e,t){let r=oa(t);return Eu(r,e)}function CG(e,t,r){let o=oa(t);YA(o);let[i,s]=WA(o),c=Eu(i,e);return QA(c),c[s]=r,e}function PG(e,t){let r=oa(t);YA(r);let[o,i]=WA(r),s=Eu(o,e);return QA(s),a.IsArray(s)&&AG(i)?s.splice(+i,1):delete s[i],e}function UG(e,t,r){if(e.$id===r.hash)return e;let o=new URL(e.$id,t.href),i=new URL(r.href,t.href);if(a.IsEqual(o.pathname,i.pathname))return r.hash.startsWith("#")?ZA(e,t,r):e}function NG(e,t,r){let o=new URL(`#${e.$anchor}`,t.href),i=new URL(r.href,t.href);if(a.IsEqual(o.href,i.href))return e}function ZA(e,t,r){return r.href.endsWith("#")?e:r.hash.startsWith("#")?ur.Get(e,decodeURIComponent(r.hash.slice(1))):void 0}function LG(e,t,r){if(Tn(e)){let o=UG(e,t,r);if(!a.IsUndefined(o))return o}if(Yi(e)){let o=NG(e,t,r);if(!a.IsUndefined(o))return o}return ZA(e,t,r)}function kG(e,t,r){return e.reduce((o,i)=>{let s=Iu(i,t,r);return a.IsUndefined(s)?o:s},void 0)}function MG(e,t,r){return a.Keys(e).reduce((o,i)=>{let s=Iu(e[i],t,r);return a.IsUndefined(s)?o:s},void 0)}function Iu(e,t,r){if(t=sr(e)&&Tn(e)?new URL(e.$id,t.href):t,sr(e)){let o=LG(e,t,r);if(!a.IsUndefined(o))return o}if(a.IsArray(e))return kG(e,t,r);if(a.IsObject(e))return MG(e,t,r)}function wG(e,t){let r=new URL("http://unknown"),o=Tn(e)?new URL(e.$id,r.href):r,i=new URL(t,o.href);return Iu(e,o,i)}var Sn=class{constructor(t,r){this.context=t,this.schema=r,this.ids=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[]}BaseURL(){return this.ids.reduce((t,r)=>new URL(r.$id,t),new URL("http://unknown"))}Base(){return this.ids[this.ids.length-1]??this.schema}Push(t){sr(t)&&(Tn(t)&&this.ids.push(t),Yi(t)&&this.anchors.push(t),$s(t)&&this.recursiveAnchors.push(t),cm(t)&&this.dynamicAnchors.push(t))}Pop(t){sr(t)&&(Tn(t)&&this.ids.pop(),Yi(t)&&this.anchors.pop(),$s(t)&&this.recursiveAnchors.pop(),cm(t)&&this.dynamicAnchors.pop())}FromContext(t){return a.HasPropertyKey(this.context,t)?this.context[t]:void 0}FromRef(t){return t.startsWith("#")?An.Ref(this.Base(),t):An.Ref(this.schema,t)}Ref(t){return this.FromContext(t)??this.FromRef(t)}RecursiveRef(t){return $s(this.Base())?An.Ref(this.recursiveAnchors[0],t):An.Ref(this.Base(),t)}};function XA(...e){let[t,r,o]=te.Match(e,{3:(c,u,l)=>[c,u,l],2:(c,u)=>[{},c,u]}),i=new Sn(t,r),s=new rt;return $(i,s,r,o)}function JA(...e){let[t,r,o]=te.Match(e,{3:(E,I,P)=>[E,I,P],2:(E,I)=>[{},E,I]}),i=yt.Get(),s=$l(),c=[],u=new Sn(t,r),l=new ta(E=>{if(!a.IsGreaterEqualThan(c.length,i.maxErrors))return c.push({...E,message:s(E)})});return[K(u,l,"#","",r,o),c]}function se(...e){let[t,r,o]=te.Match(e,{3:(i,s,c)=>[i,s,c],2:(i,s)=>[{},i,s]});return XA(t,r,o)}function Br(...e){let[t,r,o]=te.Match(e,{3:(c,u,l)=>[c,u,l],2:(c,u)=>[{},c,u]}),[i,s]=JA(t,r,o);return s}var qr=class extends Error{constructor(t,r,o){super(t),Object.defineProperty(this,"cause",{value:{source:t,errors:o,value:r},writable:!1,configurable:!1,enumerable:!1})}};function eS(e,t,r){return a.IsArray(r)?r.map(o=>Ge(e,t.items,o)):r}function tS(e,t,r){return t.Clean(r)}function rS(e,t,r){return Ge({...e,...t.$defs},he(t.$ref),r)}function DG(e){let t=a.HasPropertyKey(e,"unevaluatedProperties")?{additionalProperties:e.unevaluatedProperties}:{},r=Nt(e);return M(r)?Ja(r,t):r}function nS(e,t,r){let o=DG(t);return Ge(e,o,r)}function vs(e){return a.HasPropertyKey(e,"additionalProperties")?e.additionalProperties:void 0}function oS(e,t,r){if(!a.IsObject(r)||a.IsArray(r))return r;let o=vs(t);for(let i of a.Keys(r)){if(a.HasPropertyKey(t.properties,i)){r[i]=Ge(e,t.properties[i],r[i]);continue}if(a.IsBoolean(o)&&a.IsEqual(o,!0)||A(o)&&se(e,o,r[i])){r[i]=Ge(e,o,r[i]);continue}delete r[i]}return r}function iS(e,t,r){if(!a.IsObject(r))return r;let o=vs(t),[i,s]=[new RegExp(ut(t)),qe(t)];for(let c of a.Keys(r)){if(i.test(c)){r[c]=Ge(e,s,r[c]);continue}if(a.IsBoolean(o)&&a.IsEqual(o,!0)||A(o)&&se(e,o,r[c])){r[c]=Ge(e,o,r[c]);continue}delete r[c]}return r}function aS(e,t,r){return a.HasPropertyKey(e,t.$ref)?Ge(e,e[t.$ref],r):r}function sS(e,t,r){if(!a.IsArray(r))return r;let o=Math.min(r.length,t.items.length);for(let i=0;i<o;i++)r[i]=Ge(e,t.items[i],r[i]);return a.IsGreaterThan(r.length,o)?r.slice(0,o):r}function GG(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=pe(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=pe(e[r]);return t}function vG(e){return a.IsClassInstance(e)?e:GG(e)}function jG(e){return e.map(t=>pe(t))}function FG(e){return e.slice()}function BG(e){return new Map(pe([...e.entries()]))}function qG(e){return new Set(pe([...e.values()]))}function pe(e){return Qe.IsTypeArray(e)?FG(e):Qe.IsMap(e)?BG(e):Qe.IsSet(e)?qG(e):a.IsArray(e)?jG(e):a.IsObject(e)?vG(e):e}function pS(e,t,r){for(let o of t.anyOf){let i=Ge(e,o,pe(r));if(se(e,o,i))return i}return r}function Ge(e,t,r){return Z(t)?eS(e,t,r):Et(t)?tS(e,t,r):ae(t)?rS(e,t,r):U(t)?nS(e,t,r):M(t)?oS(e,t,r):de(t)?iS(e,t,r):oe(t)?aS(e,t,r):H(t)?sS(e,t,r):O(t)?pS(e,t,r):r}function xn(...e){let[t,r,o]=te.Match(e,{3:(i,s,c)=>[i,s,c],2:(i,s)=>[{},i,s]});return Ge(t,r,o)}function cS(e,t,r){return a.IsArray(r)?r.map(o=>Se(e,t.items,o)):r}function mS(e,t,r){return t.Convert(r)}var ee={};ht(ee,{Fail:()=>Rn,IsOk:()=>_u,Ok:()=>C,TryBigInt:()=>hu,TryBoolean:()=>pv,TryNull:()=>gv,TryNumber:()=>Sv,TryString:()=>Nv,TryUndefined:()=>Gv});function _u(e){return a.IsObject(e)&&a.HasPropertyKey(e,"value")}function C(e){return{value:e}}function Rn(){}function HG(e){return C(e)}function KG(e){return a.IsEqual(e,!0)?C(BigInt(1)):C(BigInt(0))}function zG(e){return C(BigInt(Math.trunc(e)))}function VG(e){return C(BigInt(0))}var YG=/^-?(0|[1-9]\d*)n$/,QG=/^-?(0|[1-9]\d*)\.\d+$/,WG=/^-?(0|[1-9]\d*)$/;function ZG(e){return YG.test(e)}function XG(e){return QG.test(e)}function JG(e){return WG.test(e)}function ev(e){let t=e.toLowerCase();return ZG(e)?C(BigInt(e.slice(0,e.length-1))):XG(e)?C(BigInt(e.split(".")[0])):JG(e)?C(BigInt(e)):a.IsEqual(t,"false")?C(BigInt(0)):a.IsEqual(t,"true")?C(BigInt(1)):void 0}function tv(e){return C(BigInt(0))}function hu(e){return a.IsBigInt(e)?HG(e):a.IsBoolean(e)?KG(e):a.IsNumber(e)?zG(e):a.IsNull(e)?VG(e):a.IsString(e)?ev(e):a.IsUndefined(e)?tv(e):void 0}function rv(e){return a.IsEqual(e,BigInt(0))?C(!1):a.IsEqual(e,BigInt(1))?C(!0):void 0}function nv(e){return C(e)}function ov(e){return a.IsEqual(e,0)?C(!1):a.IsEqual(e,1)?C(!0):void 0}function iv(e){return C(!1)}function av(e){return a.IsEqual(e.toLowerCase(),"false")?C(!1):a.IsEqual(e.toLowerCase(),"true")?C(!0):a.IsEqual(e,"0")?C(!1):a.IsEqual(e,"1")?C(!0):void 0}function sv(e){return C(!1)}function pv(e){return a.IsBigInt(e)?rv(e):a.IsBoolean(e)?nv(e):a.IsNumber(e)?ov(e):a.IsNull(e)?iv(e):a.IsString(e)?av(e):a.IsUndefined(e)?sv(e):void 0}function cv(e){return a.IsEqual(e,BigInt(0))?C(null):void 0}function mv(e){return a.IsEqual(e,!1)?C(null):void 0}function uv(e){return a.IsEqual(e,0)?C(null):void 0}function lv(e){return C(null)}function dv(e){let t=e.toLowerCase();return a.IsEqual(t,"undefined")||a.IsEqual(t,"null")||a.IsEqual(e,"")||a.IsEqual(e,"0")?C(null):void 0}function fv(e){return C(null)}function gv(e){return a.IsBigInt(e)?cv(e):a.IsBoolean(e)?mv(e):a.IsNumber(e)?uv(e):a.IsNull(e)?lv(e):a.IsString(e)?dv(e):a.IsUndefined(e)?fv(e):void 0}var yv=BigInt(Number.MAX_SAFE_INTEGER),Ev=BigInt(Number.MIN_SAFE_INTEGER);function Iv(e){return e<=yv&&e>=Ev}function uS(e){return Iv(e)?C(Number(e)):void 0}function Tv(e){return e?C(1):C(0)}function _v(e){return C(e)}function hv(e){return C(0)}function Ov(e){let t=+e;if(a.IsNumber(t))return C(t);let r=e.toLowerCase();if(a.IsEqual(r,"false"))return C(0);if(a.IsEqual(r,"true"))return C(1);let o=hu(e);return _u(o)?uS(o.value):void 0}function Av(e){return C(0)}function Sv(e){return a.IsBigInt(e)?uS(e):a.IsBoolean(e)?Tv(e):a.IsNumber(e)?_v(e):a.IsNull(e)?hv(e):a.IsString(e)?Ov(e):a.IsUndefined(e)?Av(e):void 0}function bv(e){return C(e.toString())}function xv(e){return C(e.toString())}function Rv(e){return C(e.toString())}function Cv(e){return C("null")}function Pv(e){return C(e)}function Uv(e){return C("")}function Nv(e){return a.IsBigInt(e)?bv(e):a.IsBoolean(e)?xv(e):a.IsNumber(e)?Rv(e):a.IsNull(e)?Cv(e):a.IsString(e)?Pv(e):a.IsUndefined(e)?Uv(e):void 0}function Lv(e){return a.IsEqual(e,BigInt(0))?C(void 0):void 0}function kv(e){return a.IsEqual(e,!1)?C(void 0):void 0}function Mv(e){return a.IsEqual(e,0)?C(void 0):void 0}function wv(e){return C(void 0)}function $v(e){let t=e.toLowerCase();return a.IsEqual(t,"undefined")||a.IsEqual(t,"null")||a.IsEqual(e,"")||a.IsEqual(e,"0")?C(void 0):void 0}function Dv(e){return C(void 0)}function Gv(e){return a.IsBigInt(e)?Lv(e):a.IsBoolean(e)?kv(e):a.IsNumber(e)?Mv(e):a.IsNull(e)?wv(e):a.IsString(e)?$v(e):a.IsUndefined(e)?Dv(e):void 0}function lS(e,t,r){if(a.IsBigInt(r))return r;let o=ee.TryBigInt(r);return ee.IsOk(o)?o.value:r}function dS(e,t,r){if(a.IsBoolean(r))return r;let o=ee.TryBoolean(r);return ee.IsOk(o)?o.value:r}function fS(e,t,r){return Se({...e,...t.$defs},he(t.$ref),r)}function js(e,t,r){if(t.anyOf.some(c=>se(e,c,r)))return r;let s=t.anyOf.map(c=>Se(e,c,pe(r))).find(c=>se(e,t,c));return a.IsUndefined(s)?r:s}function gS(e,t,r){let o=rn(t);return js(e,o,r)}function yS(e,t,r){if(a.IsInteger(r))return r;let o=ee.TryNumber(r);return ee.IsOk(o)?Math.trunc(o.value):r}function ES(e,t,r){let o=Nt(t);return Se(e,o,r)}function vv(e,t,r){let o=ee.TryBigInt(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function jv(e,t,r){let o=ee.TryBoolean(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function Fv(e,t,r){let o=ee.TryNumber(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function Bv(e,t,r){let o=ee.TryString(r);return ee.IsOk(o)&&a.IsEqual(t.const,o.value)?o.value:r}function IS(e,t,r){return a.IsEqual(t.const,r)?r:Hl(t)?vv(e,t,r):Kl(t)?jv(e,t,r):Mn(t)?Fv(e,t,r):wn(t)?Bv(e,t,r):F()}function TS(e,t,r){if(a.IsNull(r))return r;let o=ee.TryNull(r);return ee.IsOk(o)?o.value:r}function _S(e,t,r){if(a.IsNumber(r))return r;let o=ee.TryNumber(r);return ee.IsOk(o)?o.value:r}function Fs(e,t,r,o){let i=a.Keys(o);for(let[s,c]of t)for(let u of i)s.test(u)||(o[u]=Se(e,r,o[u]));return o}function ia(e,t,r){return xe(e)&&a.IsUndefined(r[t])}function qv(e,t,r){let o=a.EntriesRegExp(t.properties),i=a.Keys(r);for(let[s,c]of o)for(let u of i)!s.test(u)||ia(c,u,r)||(r[u]=Se(e,c,r[u]));return a.HasPropertyKey(t,"additionalProperties")&&a.IsObject(t.additionalProperties)?Fs(e,o,t.additionalProperties,r):r}function hS(e,t,r){return a.IsObjectNotArray(r)?qv(e,t,r):r}function Hv(e,t,r){let o=a.EntriesRegExp(t.patternProperties),i=a.Keys(r);for(let[s,c]of o)for(let u of i)s.test(u)&&(r[u]=Se(e,c,r[u]));return a.HasPropertyKey(t,"additionalProperties")&&a.IsObject(t.additionalProperties)?Fs(e,o,t.additionalProperties,r):r}function OS(e,t,r){return a.IsObjectNotArray(r)?Hv(e,t,r):r}function AS(e,t,r){return a.HasPropertyKey(e,t.$ref)?Se(e,e[t.$ref],r):r}function SS(e,t,r){if(a.IsString(r))return r;let o=ee.TryString(r);return ee.IsOk(o)?o.value:r}function bS(e,t,r){let o=He(t.pattern);return Se(e,o,r)}function xS(e,t,r){if(!a.IsArray(r))return r;for(let o=0;o<Math.min(t.items.length,r.length);o++)r[o]=Se(e,t.items[o],r[o]);return r}function RS(e,t,r){if(a.IsUndefined(r))return r;let o=ee.TryUndefined(r);return ee.IsOk(o)?o.value:r}function CS(e,t,r){if(a.IsUndefined(r))return r;let o=ee.TryUndefined(r);return ee.IsOk(o)?void 0:r}function Se(e,t,r){return Z(t)?cS(e,t,r):Et(t)?mS(e,t,r):mt(t)?lS(e,t,r):Xe(t)?dS(e,t,r):ae(t)?fS(e,t,r):Ie(t)?gS(e,t,r):ke(t)?yS(e,t,r):U(t)?ES(e,t,r):V(t)?IS(e,t,r):Gt(t)?TS(e,t,r):le(t)?_S(e,t,r):M(t)?hS(e,t,r):de(t)?OS(e,t,r):oe(t)?AS(e,t,r):Oe(t)?SS(e,t,r):Te(t)?bS(e,t,r):H(t)?xS(e,t,r):Bt(t)?RS(e,t,r):O(t)?js(e,t,r):lt(t)?CS(e,t,r):r}function Hr(...e){let[t,r,o]=te.Match(e,{3:(i,s,c)=>[i,s,c],2:(i,s)=>[{},i,s]});return Se(t,r,o)}function PS(e,t,r){if(!a.IsArray(r))return r;for(let o=0;o<r.length;o++)r[o]=Ne(e,t.items,r[o]);return r}function US(e,t,r){return t.Default(r)}function NS(e,t,r){return Ne({...e,...t.$defs},he(t.$ref),r)}function LS(e,t){return a.IsUndefined(t)?a.IsFunction(e.default)?e.default():pe(e.default):t}function kS(e,t,r){let o=Nt(t);return Ne(e,o,r)}function MS(e,t,r){if(!a.IsObject(r))return r;let o=a.Keys(t.properties);for(let i of o){let s=Ne(e,t.properties[i],r[i]);a.IsUndefined(s)&&(xe(t.properties[i])||!a.HasPropertyKey(t.properties[i],"default"))||(r[i]=Ne(e,t.properties[i],r[i]))}if(!pr(t)||a.IsBoolean(t.additionalProperties))return r;for(let i of a.Keys(r))o.includes(i)||(r[i]=Ne(e,t.additionalProperties,r[i]));return r}function wS(e,t,r){if(!a.IsObject(r))return r;let[o,i]=[new RegExp(ut(t)),qe(t)];for(let s of a.Keys(r))o.test(s)&&_t(i)&&(r[s]=Ne(e,i,r[s]));if(!pr(t))return r;for(let s of a.Keys(r))o.test(s)||(r[s]=Ne(e,t.additionalProperties,r[s]));return r}function $S(e,t,r){return a.HasPropertyKey(e,t.$ref)?Ne(e,e[t.$ref],r):r}function DS(e,t,r){if(!a.IsArray(r))return r;let[o,i]=[t.items,Math.max(t.items.length,r.length)];for(let s=0;s<i;s++)s<o.length&&(r[s]=Ne(e,o[s],r[s]));return r}function GS(e,t,r){for(let o of t.anyOf){let i=Ne(e,o,pe(r));if(se(e,o,i))return i}return r}function Ne(e,t,r){let o=_t(t)?LS(t,r):r;return Z(t)?PS(e,t,o):Et(t)?US(e,t,o):ae(t)?NS(e,t,o):U(t)?kS(e,t,o):M(t)?MS(e,t,o):de(t)?wS(e,t,o):oe(t)?$S(e,t,o):H(t)?DS(e,t,o):O(t)?GS(e,t,o):o}function Cn(...e){let[t,r,o]=te.Match(e,{3:(i,s,c)=>[i,s,c],2:(i,s)=>[{},i,s]});return Ne(t,r,o)}function So(e){return(...t)=>{let[r,o,i]=te.Match(t,{3:(s,c,u)=>[s,c,u],2:(s,c)=>[{},s,c]});return e.reduce((s,c)=>c(r,o,s),i)}}function Kv(e,t,r){return t["~codec"].decode(r)}function zv(e,t,r){return t["~codec"].encode(r)}function ye(e,t,r,o){return Zr(r)?a.IsEqual(e,"Decode")?Kv(t,r,o):zv(t,r,o):o}function Vv(e,t,r,o){if(!a.IsArray(o))return F();for(let i=0;i<o.length;i++)o[i]=me(e,t,r.items,o[i]);return ye(e,t,r,o)}function Yv(e,t,r,o){let i=ye(e,t,r,o);if(!a.IsArray(i))return i;for(let s=0;s<i.length;s++)i[s]=me(e,t,r.items,i[s]);return i}function vS(e,t,r,o){return a.IsEqual(e,"Decode")?Vv(e,t,r,o):Yv(e,t,r,o)}function jS(e,t,r,o){return o=me(e,{...t,...r.$defs},he(r.$ref),o),ye(e,t,r,o)}function Qv(e,t,r,o){for(let i of r.allOf)o=me(e,t,i,o);return ye(e,t,r,o)}function Wv(e,t,r,o){let i=ye(e,t,r,o);for(let s of r.allOf)i=me(e,t,s,i);return i}function FS(e,t,r,o){return a.IsEqual(e,"Decode")?Qv(e,t,r,o):Wv(e,t,r,o)}function Zv(e,t,r,o){if(!a.IsObjectNotArray(o))return F();for(let i of a.Keys(r.properties))!a.HasPropertyKey(o,i)||ia(r.properties[i],i,o)||(o[i]=me(e,t,r.properties[i],o[i]));return ye(e,t,r,o)}function Xv(e,t,r,o){let i=ye(e,t,r,o);if(!a.IsObjectNotArray(i))return i;for(let s of a.Keys(r.properties))!a.HasPropertyKey(i,s)||ia(r.properties[s],s,i)||(i[s]=me(e,t,r.properties[s],i[s]));return i}function BS(e,t,r,o){return a.IsEqual(e,"Decode")?Zv(e,t,r,o):Xv(e,t,r,o)}function Jv(e,t,r,o){if(!a.IsObjectNotArray(o))return F();let i=new RegExp(ut(r));for(let s of a.Keys(o))i.test(s)||F(),o[s]=me(e,t,qe(r),o[s]);return ye(e,t,r,o)}function e1(e,t,r,o){let i=ye(e,t,r,o);if(!a.IsObjectNotArray(i))return i;let s=new RegExp(ut(r));for(let c of a.Keys(i))s.test(c)&&(i[c]=me(e,t,qe(r),i[c]));return i}function qS(e,t,r,o){return a.IsEqual(e,"Decode")?Jv(e,t,r,o):e1(e,t,r,o)}function HS(e,t,r,o){return o=a.HasPropertyKey(t,r.$ref)?me(e,t,t[r.$ref],o):o,ye(e,t,r,o)}function t1(e,t,r,o){if(!a.IsArray(o))return F();for(let i=0;i<Math.min(r.items.length,o.length);i++)o[i]=me(e,t,r.items[i],o[i]);return ye(e,t,r,o)}function r1(e,t,r,o){let i=ye(e,t,r,o);if(!a.IsArray(i))return o;for(let s=0;s<Math.min(r.items.length,i.length);s++)i[s]=me(e,t,r.items[s],i[s]);return i}function KS(e,t,r,o){return a.IsEqual(e,"Decode")?t1(e,t,r,o):r1(e,t,r,o)}function n1(e,t,r,o){for(let i of r.anyOf){if(!se(t,i,o))continue;let s=me(e,t,i,o);return ye(e,t,r,s)}return F()}function o1(e,t,r,o){let i=ye(e,t,r,o);for(let s of r.anyOf){let c=me(e,t,s,pe(i));if(se(t,s,c))return c}return i}function zS(e,t,r,o){return a.IsEqual(e,"Decode")?n1(e,t,r,o):o1(e,t,r,o)}function me(e,t,r,o){return Z(r)?vS(e,t,r,o):ae(r)?jS(e,t,r,o):U(r)?FS(e,t,r,o):M(r)?BS(e,t,r,o):de(r)?qS(e,t,r,o):oe(r)?HS(e,t,r,o):H(r)?KS(e,t,r,o):O(r)?zS(e,t,r,o):ye(e,t,r,o)}var Ou=class extends qr{constructor(t,r){super("Decode",t,r)}};function i1(e,t,r){if(!se(e,t,r))throw new Ou(r,Br(e,t,r));return r}function a1(e,t,r){return me("Decode",e,t,r)}var kwe=So([(e,t,r)=>pe(r),(e,t,r)=>Cn(e,t,r),(e,t,r)=>Hr(e,t,r),(e,t,r)=>xn(e,t,r),(e,t,r)=>i1(e,t,r),(e,t,r)=>a1(e,t,r)]);var Au=class extends qr{constructor(t,r){super("Encode",t,r)}};function s1(e,t,r){if(!se(e,t,r))throw new Au(r,Br(e,t,r));return r}function p1(e,t,r){return me("Encode",e,t,r)}var Kwe=So([(e,t,r)=>pe(r),(e,t,r)=>p1(e,t,r),(e,t,r)=>Cn(e,t,r),(e,t,r)=>Hr(e,t,r),(e,t,r)=>xn(e,t,r),(e,t,r)=>s1(e,t,r)]);var bt=class extends Error{constructor(t,r){super(r),this.type=t}};function VS(e,t){return a.IsFunction(t.default)?t.default(t):a.IsObject(t.default)?pe(t.default):t.default}function YS(e,t){if(ho(t)&&!_t(t))throw new bt(t,"Arrays with uniqueItems constraints must specify a default annotation");let r=To(t)?t.minItems:0;return Array.from({length:r},()=>ue(e,t.items))}async function*c1(){}function QS(e,t){return c1()}function WS(e,t){return t.Create()}function ZS(e,t){return cr(t)?BigInt(t.exclusiveMinimum)+BigInt(1):mr(t)?BigInt(t.minimum):BigInt(0)}function XS(e,t){return!1}function JS(e,t){let r=ue(e,t.instanceType);return class{constructor(){Object.assign(this,r)}}}function eb(e,t){return ue({...e,...t.$defs},he(t.$ref))}function tb(e,t){return ue(e,rn(t))}function rb(e,t){let r=ue(e,t.returnType);return()=>r}function nb(e,t){return cr(t)&&a.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:mr(t)?t.minimum:0}function ob(e,t){return ue(e,Nt(t))}function*m1(){}function ib(e,t){return m1()}function ab(e,t){return t.const}function sb(e,t){throw new bt(t,"Cannot create TNever types")}function pb(e,t){return null}function cb(e,t){return cr(t)&&a.IsNumber(t.exclusiveMinimum)?t.exclusiveMinimum+1:mr(t)?t.minimum:0}function mb(e,t){return(a.IsUndefined(t.required)?[]:t.required).reduce((o,i)=>({...o,[i]:ue(e,t.properties[i])}),{})}function ub(e,t){return Promise.resolve(ue(e,t.item))}function lb(e,t){if(Zi(t)&&!_t(t))throw new bt(t,"Record with the minProperties constraint must have a default annotation");return{}}function db(e,t){return a.HasPropertyKey(e,t.$ref)?ue(e,e[t.$ref]):(()=>{throw new bt(t,"Unable to deref Ref")})()}function fb(e,t){if((Xi(t)||Qi(t))&&!_t(t))throw Error("Strings with format or pattern constraints must specify default");let o=Wi(t)?t.minLength:0;return"".padEnd(o)}function gb(e,t){return Symbol()}function yb(e,t){let r=He(t.pattern);if(Oe(r))throw new bt(t,"Unable to create TemplateLiteral due to infinite type expansion");return ue(e,r)}function Eb(e,t){return Array.from({length:t.minItems},(r,o)=>ue(e,t.items[o]))}function Ib(e,t){if(a.IsEqual(t.anyOf.length,0))throw Error("Unable to create Union with no variants");return ue(e,t.anyOf[0])}function ue(e,t){return _t(t)?VS(e,t):Z(t)?YS(e,t):ze(t)?QS(e,t):Et(t)?WS(e,t):mt(t)?ZS(e,t):Xe(t)?XS(e,t):Re(t)?JS(e,t):ae(t)?eb(e,t):Ie(t)?tb(e,t):Ce(t)?rb(e,t):ke(t)?nb(e,t):U(t)?ob(e,t):Ve(t)?ib(e,t):V(t)?ab(e,t):Wt(t)?sb(e,t):Gt(t)?pb(e,t):le(t)?cb(e,t):M(t)?mb(e,t):Be(t)?ub(e,t):de(t)?lb(e,t):oe(t)?db(e,t):Oe(t)?fb(e,t):vt(t)?gb(e,t):Te(t)?yb(e,t):H(t)?Eb(e,t):Bt(t)?void 0:O(t)?Ib(e,t):lt(t)?void 0:void 0}function Yt(...e){let[t,r]=te.Match(e,{2:(o,i)=>[o,i],1:o=>[{},o]});return ue(t,r)}var Su=class extends qr{constructor(t,r){super("Parse",t,r)}};function u1(e,t,r){if(!se(e,t,r))throw new Su(r,Br(e,t,r));return r}var WGe=So([(e,t,r)=>pe(r),(e,t,r)=>Cn(e,t,r),(e,t,r)=>Hr(e,t,r),(e,t,r)=>xn(e,t,r),(e,t,r)=>u1(e,t,r)]);var d1=N({type:q("insert"),path:at(),value:je()}),f1=Object({type:q("update"),path:at(),value:je()}),g1=N({type:q("delete"),path:at()}),nve=G([d1,f1,g1]);function bo(e){if(!e.body)throw new Error("This command does not accept a request body");let t=e.body;return t.examples?.length?t.examples[0]:Yt(t)}var hb=$u(require("node:fs"));function xo(e){if(e.file){let t=hb.default.readFileSync(e.file==="-"?0:e.file,"utf-8");return JSON.parse(t)}if(e.data)return JSON.parse(e.data);throw new Error("Provide a request body with -f <file> or -d <json>. Use --generate-skeleton to get a template.")}function xu(e){let t=e.params;if(t?.properties){let r=Object.keys(t.properties);if(r.length===1&&r[0])return r[0]}return"id"}function Ob(e,t,r){let o=e.command(t.commandName).description(t.description),i=th(t.commandName).replace(/-/g," "),s=o.command("list").description(`List all ${t.commandName}`);if(t.listOptions)for(let c of t.listOptions)s.option(c.flag,c.description);if(t.enableListBody?s.option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async c=>{if(c.generateSkeleton){ie(bo(t.endpoints.list));return}let u=await r()(t.endpoints.list,{body:c.data?xo({data:c.data}):{}});ie(u)}):s.action(async c=>{let u={};if(t.listOptions)for(let g of t.listOptions){let E=c[g.queryParam];E!==void 0&&(u[g.queryParam]=E)}let l=await r()(t.endpoints.list,Object.keys(u).length>0?{query:u}:void 0);ie(l)}),t.endpoints.get){let c=t.endpoints.get,u=xu(c);o.command("get <id>").description(`Get a ${i} by ID`).action(async l=>{let g=await r()(c,{params:{[u]:l}});ie(g)})}if(t.endpoints.create){let c=t.endpoints.create;o.command("create").description(`Create a new ${i}`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async u=>{if(u.generateSkeleton){ie(bo(c));return}let l=xo(u),g=await r()(c,{body:l});ie(g)})}if(t.endpoints.update){let c=t.endpoints.update,u=xu(c);o.command("update <id>").description(`Update a ${i} by ID`).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async(l,g)=>{if(g.generateSkeleton){ie(bo(c));return}let E=xo(g),I=await r()(c,{params:{[u]:l},body:E});ie(I)})}if(t.endpoints.delete){let c=t.endpoints.delete,u=xu(c);o.command("delete <id>").description(`Delete a ${i} by ID`).action(async l=>{let g=await r()(c,{params:{[u]:l}});ie(g)})}}var T1=[{commandName:"cloud-resources",description:"List cloud resources discovered by inventory scans",endpoints:{list:X_}},{commandName:"dashboards",description:"Manage dashboards",endpoints:{list:w_,get:$_,create:D_,update:G_,delete:v_},listOptions:[{flag:"--owners <ids...>",description:"Filter by owner team IDs",queryParam:"owners"}]},{commandName:"ingestion-api-keys",description:"Manage ingestion API keys",endpoints:{list:H_,create:K_,update:z_,delete:V_}},{commandName:"monitors",description:"Manage monitors",endpoints:{list:Th,get:_h,create:xh,update:Rh,delete:Ch},enableListBody:!0},{commandName:"notification-rules",description:"Manage notification rules",endpoints:{list:Mh,get:wh,create:$h,update:Dh,delete:Gh}},{commandName:"notification-silences",description:"Manage notification silences",endpoints:{list:Bh,get:qh,create:Kh,update:zh,delete:Vh}},{commandName:"quality-reports",description:"Manage quality reports",endpoints:{list:Wh}},{commandName:"retention-policies",description:"Manage retention policies",endpoints:{list:eO,get:tO,create:rO,update:nO,delete:oO}},{commandName:"routes",description:"Manage routes",endpoints:{list:sO,get:pO,create:cO,update:mO,delete:uO}},{commandName:"services",description:"Manage services",endpoints:{list:ZT,get:XT}},{commandName:"tag-policies",description:"Manage tag policies",endpoints:{list:EO,get:IO,create:TO,update:_O,delete:hO}},{commandName:"teams",description:"Manage teams",endpoints:{list:OO,get:AO,create:SO,update:bO,delete:xO}}];function Ab(e,t){for(let r of T1)Ob(e,r,t)}var Sb=`/${"v1"}/aggregation`,bb=n.Object({id:n.String({description:'Query identifier (q1, q2, ...) or "formula" for formula'}),group:n.Record(n.String(),n.Union([n.String(),n.Number()]),{description:"Group-by field values"})}),_1={results:[{id:"q1",group:{host:"server-1"},value:123.45}]},xb=n.Object({results:n.Array(n.Object({...bb.properties,value:n.Number({description:"Aggregated value"})},{title:"ScalarResult"}),{description:"Aggregated results per query and group"})},{$id:"ScalarAggregationResponse",title:"ScalarAggregationResponse",description:"Scalar aggregation response with single values"});Object.assign(xb,{examples:[_1]});var h1={series:[{id:"q1",group:{host:"server-1"},points:[{timestamp:16094592e5,value:123.45},{timestamp:160945926e4,value:456.78}]}]},Rb=n.Object({series:n.Array(n.Object({...bb.properties,points:n.Array(n.Object({timestamp:n.Integer({description:"Timestamp in milliseconds"}),value:n.Number({description:"Value"})}),{description:"Array of data points"})},{title:"Series"}),{description:"Time series data per query and group"})},{$id:"TimeseriesAggregationResponse",title:"TimeseriesAggregationResponse",description:"Timeseries aggregation response with points over time"});Object.assign(Rb,{examples:[h1]});var Cb={timeRange:At,queries:n.Array(n.Omit(gi.items,["fill"],{title:"AggregationQuery"}),{maxItems:Oc,description:"Aggregations that may be combined together in the same query"}),groupBy:n.Optional(ao),dataSource:wr,formula:n.Optional(yi),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))},O1=n.Object(Cb),Pb=d({description:"Run aggregation queries and return scalar results",operationId:"aggregateScalar",tags:["public","aggregation"],url:`${Sb}/multi-query/scalar`,method:"POST",body:O1,response:xb}),A1=n.Object({...Cb,aggregationWindow:m({description:'Time bucket size for aggregation (e.g. "10s", "1m", "1h")'})}),Ub=d({description:"Run aggregation queries and return timeseries results",operationId:"aggregateTimeseries",tags:["public","aggregation"],url:`${Sb}/multi-query/timeseries`,method:"POST",body:A1,response:Rb});var Bs="/v0/logs";var aa=["CRITICAL","ERROR","WARN","NOTICE","INFO","DEBUG","TRACE"];var S1=0,b1=n.Object({__tsuga_metadata__:n.Object({id:n.String(),source:n.Optional(n.String())},{additionalProperties:!0}),context:n.Optional(n.Object({team:n.Optional(n.String()),tag_policy_warnings:n.Optional(n.Record(n.String(),n.String()))},{additionalProperties:!0})),message:n.Optional(n.Unknown()),timestamp:n.Number(),level:n.Enum(aa)},{additionalProperties:!0});var x1="log_timestamp",R1=n.Union([n.Literal(x1)]),Pn={...ft.properties,query:n.Optional(m({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e3})),shouldRecommendAttributes:n.Optional(n.Boolean()),defaultAttributesToHighlight:n.Optional(n.Array(m(),{maxItems:50})),triggeredBy:n.Optional(n.Literal("refresh")),startOffset:n.Optional(n.Number({minimum:S1})),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."})),sortBy:n.Optional(R1),sortDirection:n.Optional(n.Union([n.Literal("asc"),n.Literal("desc")]))},dFe=d({tags:["logs"],url:`${Bs}/count`,method:"GET",query:n.Pick(n.Object(Pn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),Ru=n.Object({value:n.String(),priority:n.Number()}),fFe=d({tags:["logs"],url:`${Bs}/search`,method:"GET",query:n.Object(Pn),response:n.Object({logs:n.Optional(n.Array(b1)),attributesToHighlight:n.Optional(n.Array(Ru))},{additionalProperties:!0})}),Cu=n.Cyclic({TokenOutput:n.Union([n.Object({type:n.Literal("top"),values:n.Array(n.String())}),n.Object({type:n.Literal("ip"),value:n.String()}),n.Object({type:n.Literal("range"),min:n.Number(),max:n.Number()}),n.Object({type:n.Literal("variable"),value:n.String()}),n.Object({type:n.Literal("text"),value:n.String()}),n.Object({type:n.Literal("date"),value:n.String()}),n.Object({type:n.Literal("url"),value:n.String()}),n.Object({type:n.Literal("structure"),key:n.Array(n.String()),value:n.Array(n.Ref("TokenOutput"))})])},"TokenOutput",{description:"A token identified as part of the pattern"}),C1=n.Object({id:n.String(),pattern:n.Array(Cu),size:n.Integer({description:"Number of logs that matched the pattern"}),examples:n.Array(n.Object({id:n.String(),timestampUnix:n.Number()})),timeDistribution:n.Array(n.Number()),staticFeatures:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),gFe=d({tags:["logs"],url:`${Bs}/patterns`,method:"GET",query:n.Object({...ft.properties,query:m({type:"tsuga-query"}),clusteringThreshold:n.Optional(n.Number()),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Object({patterns:n.Array(C1),sampleSize:n.Number()})}),yFe=d({tags:["logs"],url:`${Bs}/attributes`,method:"GET",query:n.Object({...ft.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Object({attributes:n.Array(n.String())})});var sa=`/${"v1"}/logs`,Pu=n.Object({context:n.Optional(n.Object({team:n.Optional(n.String())},{additionalProperties:!0,$id:"LogContext"})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(aa)},{additionalProperties:!0,$id:"LogEvent"}),P1={context:{team:"platform"},message:"Request completed successfully",timestamp:17040672e5,level:"INFO"};Object.assign(Pu,{examples:[P1]});var U1={query:"level:ERROR",maxResults:100,from:1704067200,to:1704067200},Nb=n.Object({...n.Pick(n.Object(Pn),["query","maxResults","clusterId"]).properties,...At.properties});Object.assign(Nb,{examples:[U1]});var Lb=d({description:"Search logs",operationId:"searchLogs",tags:["public","logs"],url:`${sa}/search`,method:"GET",query:Nb,response:n.Object({logs:n.Array(Pu)})}),N1=n.Object({pattern:n.Array(Cu),size:n.Integer({description:"Number of logs that matched the pattern"}),groups:n.Array(n.Object({key:n.String(),value:n.String()},{description:"Fixed groups present in all logs matching the pattern"}))}),kb=n.Object({patterns:n.Array(N1),sampleSize:n.Number()}),L1={patterns:[{pattern:[{type:"text",value:"Resolved"},{type:"text",value:" "},{type:"text",value:"segment"},{type:"text",value:" "},{type:"text",value:"SegmentId("},{type:"range",min:0,max:1},{type:"text",value:")"},{type:"text",value:" "},{type:"text",value:"from"},{type:"text",value:" "},{type:"text",value:"cache"}],size:37004,groups:[{key:"level",value:"DEBUG"},{key:"context.team",value:"infra"}]}],sampleSize:100};Object.assign(kb,{examples:[L1]});var Mb=d({description:"Get log patterns",operationId:"getLogPatterns",tags:["public","logs"],url:`${sa}/patterns`,method:"GET",query:n.Object({...At.properties,query:m({type:"tsuga-query"}),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:kb}),k1=n.Object({exampleLog:n.Optional(Pu),team:n.String(),env:n.String(),service:n.String(),firstSeen:n.Number({description:"Timestamp in milliseconds when this pattern was first seen"}),lastSeen:n.Number({description:"Timestamp in milliseconds when this pattern was last seen"})}),wb=n.Object({newErrorPatterns:n.Array(k1)}),M1={newErrorPatterns:[{team:"platform",env:"production",service:"api-gateway",firstSeen:17040672e5,lastSeen:17041536e5,exampleLog:{message:"ConnectionError: Failed to connect to database",timestamp:17041536e5,level:"ERROR"}}]};Object.assign(wb,{examples:[M1]});var $b=d({description:"Get new error patterns",operationId:"getNewErrorPatterns",tags:["public","logs"],url:`${sa}/patterns/new`,method:"GET",query:n.Object({...At.properties,team:n.Optional(m()),env:n.Optional(m()),service:n.Optional(m()),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:wb}),w1=n.Object({team:n.String(),env:n.String(),pattern:n.String({description:"The error pattern formatted"}),increaseTimestamps:n.Array(n.Number({description:"Timestamps in milliseconds when there were increases in this pattern"}))}),Db=n.Object({errorPatternIncreases:n.Array(w1)}),$1={errorPatternIncreases:[{team:"platform",env:"production",pattern:"Non-resolved segment SegmentId(*) from cache",increaseTimestamps:[17041536e5,17042392e5]}]};Object.assign(Db,{examples:[$1]});var Gb=d({description:"Get error pattern increases for a given team",operationId:"getErrorPatternIncrease",tags:["public","logs"],url:`${sa}/patterns/increase`,method:"GET",query:n.Object({...At.properties,team:m(),env:n.Optional(m()),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),response:Db}),vb=n.Object({attributes:n.Array(n.String(),{description:"Log attribute dot-paths observed in the time range"})}),D1={attributes:["context.env","context.k8s.pod.name","context.service.name","context.team","level","message","timestamp"]};Object.assign(vb,{examples:[D1]});var G1=n.Object({...At.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),jb=d({description:"Get log attributes",operationId:"getLogAttributes",tags:["public","logs"],url:`${sa}/attributes`,method:"GET",query:G1,response:vb});var dr="/v0/metrics",v1=n.Object({__tsuga_metadata__:n.Object({},{additionalProperties:!0}),context:n.Optional(n.Object({},{additionalProperties:!0})),message:n.Optional(n.String()),timestamp:n.Number(),level:n.Enum(aa)},{additionalProperties:!0}),UFe=d({tags:["metrics"],url:`${dr}/count`,method:"GET",query:n.Pick(n.Object(Pn),["from","to","query","clusterId"]),response:n.Object({count:n.Number()})}),NFe=d({tags:["metrics"],url:`${dr}/search`,method:"GET",query:n.Object(Pn),response:n.Object({logs:n.Optional(n.Array(v1)),totalHits:n.Optional(n.Number()),attributesToHighlight:n.Optional(n.Array(Ru))},{additionalProperties:!0})}),qs=n.Enum(["counter","gauge","histogram","summary"]),Uu=n.Enum(["delta","cumulative","none"]),j1=n.Object({capabilities:n.Optional(n.Array(n.String())),description:n.Optional(n.String()),tags:n.Optional(n.Array(n.String())),temporality:n.Optional(Uu),type:n.Optional(qs),unit:n.Optional(n.String())}),LFe=d({url:`${dr}/metadata`,method:"GET",query:n.Object({...ft.properties,metricName:m({allowEmpty:!1}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:j1}),kFe=d({tags:["metrics"],url:dr,method:"GET",query:n.Object({...ft.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:n.Array(n.String())}),Nu=n.Array(n.Object({name:n.String(),type:qs}),{description:"List of metric names and their types"}),MFe=d({tags:["metrics"],url:`${dr}/names-and-types`,method:"GET",query:n.Object({...ft.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:Nu}),Hs=n.Array(n.String(),{description:"List of attribute names"}),wFe=d({tags:["metrics"],url:`${dr}/attributes`,method:"GET",query:n.Object({...ft.properties,metricName:m({allowEmpty:!1}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:Hs}),$Fe=d({tags:["metrics"],url:`${dr}/attributes/batch`,method:"GET",query:n.Object({...ft.properties,metricNames:n.Array(m({allowEmpty:!1}),{minItems:1,description:"Metric names to fetch attributes for"}),clusterId:n.Optional(m({allowEmpty:!1,description:"Cluster ID"}))}),response:Hs}),Lu=n.Object({assets:n.Array(n.Object({type:n.Enum(["dashboard","monitor"]),id:n.String(),name:n.String(),owner:n.String()},{description:"An asset that uses a metric"}),{description:"List of assets (dashboards and monitors) using this metric"})}),DFe=d({tags:["metrics"],url:`${dr}/assets-usage`,method:"GET",query:n.Object({metricName:m({allowEmpty:!1})}),response:Lu}),GFe=d({url:`${dr}/per-attribute`,method:"GET",query:n.Object({from:n.Optional(n.Number()),to:n.Optional(n.Number()),attribute:m(),clusterId:n.Optional(m({allowEmpty:!1}))}),response:n.Array(n.String())});var ku=`/${"v1"}/metrics`,F1=[{name:"http.server.request.duration",type:"histogram"},{name:"http.server.active_requests",type:"gauge"},{name:"http.server.request.count",type:"counter"}];Object.assign(Nu,{examples:[F1]});var Mu=n.Object({name:n.String({description:"Name of the metric"}),type:qs,description:n.Optional(n.String({description:"Human-readable description of the metric"})),unit:n.Optional(n.String({description:"Unit of the metric"})),temporality:n.Optional(Uu),capabilities:n.Optional(n.Array(n.String(),{description:"Supported capabilities, an empty array means all capabilities are supported"})),attributes:n.Optional(n.Array(n.String(),{description:"Metric attributes"}))}),B1={name:"http.server.request.duration",type:"histogram",description:"Duration of HTTP server requests",unit:"ms",temporality:"delta",capabilities:["max","min","sum"],attributes:["context.team","context.environment","context.region"]};Object.assign(Mu,{examples:[B1]});var Fb=n.Object({...At.properties,clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))}),Bb=d({description:"Get all metrics with their metadata",operationId:"listMetrics",tags:["public","metrics"],url:ku,method:"GET",query:Fb,response:n.Array(Mu)}),qb=d({description:"Retrieve a metric by name with its metadata",operationId:"getMetric",tags:["public","metrics"],url:`${ku}/:name`,method:"GET",params:n.Object({name:m({allowEmpty:!1,description:"The metric name"})}),query:Fb,response:Mu}),q1=["service","env","host","method","status_code"];Object.assign(Hs,{examples:[q1]});var Hb=n.Pick(Lu,["assets"]),H1={assets:[{type:"dashboard",id:"dash-123-abc",name:"API Performance Overview",owner:"user-456-def"},{type:"monitor",id:"mon-789-ghi",name:"High Latency Alert",owner:"user-456-def"}]};Object.assign(Hb,{examples:[H1]});var Kb=d({description:"Retrieve dashboards and monitors that use a specific metric",operationId:"getMetricAssetsUsage",tags:["private"],url:`${ku}/assets-usage`,method:"GET",query:n.Object({metricName:m({allowEmpty:!1,description:"The name of the metric to find usage for"})}),response:Hb});var K1=`/${"v1"}/traces`,zb=n.Object({context:n.Optional(n.Object({service:n.Optional(n.Object({name:n.Optional(n.String()),version:n.Optional(n.String())},{additionalProperties:!0}))},{additionalProperties:!0})),parentSpanId:n.Optional(n.String()),resourceAttributes:n.Object({},{additionalProperties:!0}),spanAttributes:n.Object({},{additionalProperties:!0}),duration:n.Number({description:"In milliseconds."}),startTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),endTime:n.String({description:"In nanoseconds. Transmitted as a string to avoid losing precision, as BigInt is not JSON-compatible."}),error:n.Optional(n.Object({message:n.String()})),events:n.Optional(n.Array(n.Object({event_attributes:n.Object({},{additionalProperties:!0}),event_name:n.String(),event_timestamp_nanos:n.String()}))),spanId:n.String(),span:n.Object({kind:n.String(),name:n.String()}),statusCode:n.Optional(n.String()),traceId:n.String()},{additionalProperties:!0,$id:"SpanEvent"}),z1={context:{service:{name:"my-service",version:"1.0.0"}},parentSpanId:"187a47da1b2560f8",resourceAttributes:{},spanAttributes:{busyNs:374640,code:{file:{path:"src/queue/sqs.rs"},line:{number:162},module:{name:"queue::sqs"}},idleNs:23621445,maxMessages:"1",target:"queue::sqs",thread:{id:2,name:"tokio-runtime-worker"}},duration:23,startTime:"1770923469995353600",endTime:"1770923470019349500",spanId:"3df8cc3449378f66",span:{kind:"internal",name:"receive_messages"},statusCode:"ok",traceId:"78c99c5bb1e4a30297fa134b9dbec64f"};Object.assign(zb,{examples:[z1]});var V1={from:1704067200,to:1704067200,query:"context.service.name:my-service",maxResults:100},Vb=n.Object({...At.properties,query:n.Optional(m({type:"tsuga-query"})),maxResults:n.Optional(n.Integer({minimum:1,maximum:1e4})),clusterId:n.Optional(m({allowEmpty:!1,description:"ID of the cluster to target. Omit to use the default cluster."}))});Object.assign(Vb,{examples:[V1]});var Yb=d({description:"Search spans",operationId:"searchSpans",tags:["public","traces"],url:`${K1}/search`,method:"GET",query:Vb,response:n.Object({spans:n.Array(zb)})});var Zb=["timestamp","level","message"];function gt(e,t){let r=t??rr(e);if(!r)throw new Error(`--${e} is required`);return cs(r)}function Qb(e){let t={from:gt("from",e.from),to:gt("to",e.to)},r=e.query??rr("query");r!==void 0&&(t.query=r);let o=e.maxResults??rr("max-results");if(o!==void 0){let i=Number(o);if(Number.isNaN(i))throw new Error(`--max-results must be a number (got: ${o})`);t.maxResults=i}return t}function Wb(e,t,r,o,i){e.command(t).description(r).option("-f, --file <path>","Read body from file (use - for stdin)").option("-d, --data <json>","Inline JSON body").option("--generate-skeleton","Print a JSON skeleton for the request body and exit").action(async s=>{if(s.generateSkeleton){ie(bo(o));return}let c=xo(s),u=await i()(o,{body:c});ie(u)})}function Le(e){let t=rr(e);return t===void 0?"":` (default: ${t})`}function Y1(e){let t=PT(e.output),r=e.fields===void 0?void 0:UT(e.fields);return t==="json"?{format:t,fields:r}:{format:t,fields:r??Zb}}function Q1(e,t){if(t.format==="json"){if(t.fields===void 0){ie(e);return}let{fields:o}=t;ie({logs:e.logs.map(i=>LT(i,o))});return}let r=MT(t.format,e.logs,t.fields);r.length>0&&fc(r)}function Xb(e,t){let r=e.command("logs").description("Search and analyze logs");r.command("search").description("Search logs").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--query <query>",`Search query${Le("query")}`).option("--max-results <n>",`Maximum number of results${Le("max-results")}`).option("--fields <fields>",`Comma-separated dot-paths to project from each log (default for --output=tsv|csv: ${Zb.join(",")})`).option("-o, --output <format>","Output format: json | tsv | csv","json").action(async c=>{let u=Y1(c),l=await t()(Lb,{query:Qb(c)});Q1(l,u)}),r.command("attributes").description("List log attribute dot-paths observed in the time range").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).action(async c=>{let u=await t()(jb,{query:{from:gt("from",c.from),to:gt("to",c.to)}});ie(u)}),r.command("patterns").description("List log patterns").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--query <query>",`Search query${Le("query")}`).action(async c=>{let u={from:gt("from",c.from),to:gt("to",c.to)},l=c.query??rr("query");l!==void 0&&(u.query=l);let g=await t()(Mb,{query:u});ie(g)}),r.command("new-error-patterns").description("List new error patterns").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--team <team>","Filter by team").option("--env <env>","Filter by environment").option("--service <service>","Filter by service").action(async c=>{let u={from:gt("from",c.from),to:gt("to",c.to)};c.team!==void 0&&(u.team=c.team),c.env!==void 0&&(u.env=c.env),c.service!==void 0&&(u.service=c.service);let l=await t()($b,{query:u});ie(l)}),r.command("error-pattern-increases").description("List error pattern increases for a given team").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).requiredOption("--team <team>","Team to query").option("--env <env>","Filter by environment").action(async c=>{let u={from:gt("from",c.from),to:gt("to",c.to),team:c.team};c.env!==void 0&&(u.env=c.env);let l=await t()(Gb,{query:u});ie(l)});let o=e.command("metrics").description("List and inspect metrics");o.command("list").description("List all metrics with their metadata").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).action(async c=>{let u=await t()(Bb,{query:{from:gt("from",c.from),to:gt("to",c.to)}});ie(u)}),o.command("get <name>").description("Retrieve a metric by name with its metadata").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).action(async(c,u)=>{let l=await t()(qb,{params:{name:c},query:{from:gt("from",u.from),to:gt("to",u.to)}});ie(l)}),o.command("assets-usage <name>").description("List dashboards and monitors that use a specific metric").action(async c=>{let u=await t()(Kb,{query:{metricName:c}});ie(u)}),e.command("traces").description("Search traces").command("search").description("Search spans").option("--from <timestamp>",`Start of time range${Le("from")}`).option("--to <timestamp>",`End of time range${Le("to")}`).option("--query <query>",`Search query${Le("query")}`).option("--max-results <n>",`Maximum number of results${Le("max-results")}`).action(async c=>{let u=await t()(Yb,{query:Qb(c)});ie(u)});let s=e.command("aggregation").description("Run aggregation queries");Wb(s,"scalar","Run aggregation queries and return scalar results",Pb,t),Wb(s,"timeseries","Run aggregation queries and return timeseries results",Ub,t)}var W1=3e3,Z1="https://registry.npmjs.org/@tsuga/cli/latest";function X1(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,o.length);i++){let s=r[i]??0,c=o[i]??0;if(s>c)return!0;if(s<c)return!1}return!1}async function Jb(e){try{let t=xT();if(t&&Date.now()-t<ps)return;let r=await fetch(Z1,{signal:AbortSignal.timeout(W1)});if(!r.ok)return;let i=(await r.json()).version;X1(i,e)&&(process.stderr.write(`
45
45
  Update available: ${e} \u2192 ${i}
46
- `),process.stderr.write("Run `npm install -g @tsuga/cli` to update\n")),lT(Date.now())}catch{}}var Ut=new wu().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.0.9").option("--operation-api-key <operation-api-key>","Operation API key").option("--cluster <cluster-id>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),hu;function Xi(){if(!hu){let e=Ut.opts(),t=Hp({operationApiKey:e.operationApiKey,clusterId:e.cluster});t.operationApiKey||(console.error("Error: Operation API key is required. Set it with one of:"),console.error(" tsuga auth <operation-api-key>"),console.error(" export TSUGA_OPERATION_API_KEY=<operation-api-key>"),console.error(" tsuga --operation-api-key <operation-api-key> <command>"),process.exit(1)),hu=XI(t.apiUrl,t.operationApiKey,t.clusterId)}return hu}Ut.command("auth <operation-api-key>").description("Save Operation API key to ~/.config/tsuga/config.json").action(e=>{Kp({operationApiKey:e}),process.stdout.write(`Operation API key saved to ${zp()}
47
- `)});Ut.command("config").description("Show current configuration").action(()=>{if(!sT()){process.stdout.write(`No config found. Run: tsuga auth <operation-api-key>
48
- `);return}let e=Ut.opts(),t=Hp({operationApiKey:e.operationApiKey,clusterId:e.cluster}),r=[`API URL: ${t.apiUrl}`];t.operationApiKey?r.push(`Operation API key: ${t.operationApiKey.slice(0,12)}...${t.operationApiKey.slice(-4)}`):r.push("Operation API key: (not set)"),r.push(`Cluster: ${t.clusterId??"(not set)"}`),r.push(`Config: ${zp()}`),process.stdout.write(`${r.join(`
46
+ `),process.stderr.write("Run `npm install -g @tsuga/cli` to update\n")),RT(Date.now())}catch{}}var Mt=new Wu().name("tsuga").description("Tsuga CLI - manage resources from the command line").version("1.0.10").option("--operation-api-key <operation-api-key>","Operation API key").option("--cluster <cluster-id>","Target cluster (overrides config and TSUGA_CLUSTER_ID)"),wu;function pa(){if(!wu){let e=Mt.opts(),t=cc({operationApiKey:e.operationApiKey,clusterId:e.cluster});t.operationApiKey||(console.error("Error: Operation API key is required. Set it with one of:"),console.error(" tsuga auth <operation-api-key>"),console.error(" export TSUGA_OPERATION_API_KEY=<operation-api-key>"),console.error(" tsuga --operation-api-key <operation-api-key> <command>"),process.exit(1)),wu=dT(t.apiUrl,t.operationApiKey,t.clusterId)}return wu}Mt.command("auth <operation-api-key>").description("Save Operation API key to ~/.config/tsuga/config.json").action(e=>{mc({operationApiKey:e}),process.stdout.write(`Operation API key saved to ${uc()}
47
+ `)});Mt.command("config").description("Show current configuration").action(()=>{if(!OT()){process.stdout.write(`No config found. Run: tsuga auth <operation-api-key>
48
+ `);return}let e=Mt.opts(),t=cc({operationApiKey:e.operationApiKey,clusterId:e.cluster}),r=[`API URL: ${t.apiUrl}`];t.operationApiKey?r.push(`Operation API key: ${t.operationApiKey.slice(0,12)}...${t.operationApiKey.slice(-4)}`):r.push("Operation API key: (not set)"),r.push(`Cluster: ${t.clusterId??"(not set)"}`),r.push(`Config: ${uc()}`),process.stdout.write(`${r.join(`
49
49
  `)}
50
- `)});var yO=Ut.command("defaults").description("Show or manage default values for command flags").action(()=>{let e=pT(),t={...Yp,...e},r=["Defaults (custom overrides marked with *):"];for(let[o,i]of Object.entries(t)){let s=o in e?" *":"";r.push(` ${o}: ${i}${s}`)}process.stdout.write(`${r.join(`
50
+ `)});var ex=Mt.command("defaults").description("Show or manage default values for command flags").action(()=>{let e=AT(),t={...lc,...e},r=["Defaults (custom overrides marked with *):"];for(let[o,i]of Object.entries(t)){let s=o in e?" *":"";r.push(` ${o}: ${i}${s}`)}process.stdout.write(`${r.join(`
51
51
  `)}
52
- `)});yO.command("set <key> <value>").description("Set a custom default value").action((e,t)=>{mT(e,t),process.stdout.write(`Default set: ${e} = ${t}
53
- `)});yO.command("reset").description("Clear all custom defaults").action(()=>{cT(),process.stdout.write(`Custom defaults cleared
54
- `)});vS(Ut,Xi);fO(Ut,Xi);BT(Ut,Xi);bT(Ut,Xi);hT(Ut,Xi);Ut.parseAsync().then(()=>gO("1.0.9")).catch(e=>{console.error(ZI(e)),process.exitCode=1});
52
+ `)});ex.command("set <key> <value>").description("Set a custom default value").action((e,t)=>{ST(e,t),process.stdout.write(`Default set: ${e} = ${t}
53
+ `)});ex.command("reset").description("Clear all custom defaults").action(()=>{bT(),process.stdout.write(`Custom defaults cleared
54
+ `)});Ab(Mt,pa);Xb(Mt,pa);o_(Mt,pa);FT(Mt,pa);wT(Mt,pa);Mt.parseAsync().then(()=>Jb("1.0.10")).catch(e=>{console.error(lT(e)),process.exitCode=1});
55
55
  /**
56
56
  * The following is a list of HTTP status codes and their meanings.
57
57
  *