@datadog/create-apps 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +39 -35
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright 2019-Present Datadog, Inc.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
"use strict";var ui=Object.create;var Nt=Object.defineProperty;var
|
|
7
|
+
"use strict";var ui=Object.create;var Nt=Object.defineProperty;var di=Object.getOwnPropertyDescriptor;var ci=Object.getOwnPropertyNames;var li=Object.getPrototypeOf,pi=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),S=(e,t)=>{for(var n in t)Nt(e,n,{get:t[n],enumerable:!0})},Di=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ci(t))!pi.call(e,o)&&o!==n&&Nt(e,o,{get:()=>t[o],enumerable:!(r=di(t,o))||r.enumerable});return e};var Q=(e,t,n)=>(n=e!=null?ui(li(e)):{},Di(t||!e||!e.__esModule?Nt(n,"default",{value:e,enumerable:!0}):n,e));var tt=w(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});(function(e){e.StartOfInput="\0",e.EndOfInput="",e.EndOfPartialInput=""})(Y.SpecialToken||(Y.SpecialToken={}));(function(e){e[e.InitialNode=0]="InitialNode",e[e.SuccessNode=1]="SuccessNode",e[e.ErrorNode=2]="ErrorNode",e[e.CustomNode=3]="CustomNode"})(Y.NodeType||(Y.NodeType={}));var fi=-1,hi=/^(-h|--help)(?:=([0-9]+))?$/,mi=/^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/,gi=/^-[a-zA-Z]{2,}$/,Ai=/^([^=]+)=([\s\S]*)$/,Fi=process.env.DEBUG_CLI==="1";Y.BATCH_REGEX=gi;Y.BINDING_REGEX=Ai;Y.HELP_COMMAND_INDEX=fi;Y.HELP_REGEX=hi;Y.IS_DEBUG=Fi;Y.OPTION_REGEX=mi});var nt=w(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});var io=tt(),Rt=class extends Error{constructor(t){super(t),this.clipanion={type:"usage"},this.name="UsageError"}},jt=class extends Error{constructor(t,n){if(super(),this.input=t,this.candidates=n,this.clipanion={type:"none"},this.name="UnknownSyntaxError",this.candidates.length===0)this.message="Command not found, but we're not sure what's the alternative.";else if(this.candidates.every(r=>r.reason!==null&&r.reason===n[0].reason)){let[{reason:r}]=this.candidates;this.message=`${r}
|
|
8
8
|
|
|
9
9
|
${this.candidates.map(({usage:o})=>`$ ${o}`).join(`
|
|
10
10
|
`)}`}else if(this.candidates.length===1){let[{usage:r}]=this.candidates;this.message=`Command not found; did you mean:
|
|
@@ -32,34 +32,34 @@ ${Mt(t)}`}},Mt=e=>`While running ${e.filter(t=>t!==io.SpecialToken.EndOfInput&&t
|
|
|
32
32
|
`)),e=e.replace(/(`+)((?:.|[\n])*?)\1/g,(r,o,i)=>t.code(o+i+o)),e=e.replace(/(\*\*)((?:.|[\n])*?)\1/g,(r,o,i)=>t.bold(o+i+o)),e?`${e}
|
|
33
33
|
`:""}Re.formatMarkdownish=bi;Re.richFormat=Ei;Re.textFormat=Ci});var $=w(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});var ao=nt(),uo=Symbol("clipanion/isOption");function vi(e){return{...e,[uo]:!0}}function wi(e,t){return typeof e>"u"?[e,t]:typeof e=="object"&&e!==null&&!Array.isArray(e)?[void 0,e]:[e,t]}function Ut(e,{mergeName:t=!1}={}){let n=e.match(/^([^:]+): (.*)$/m);if(!n)return"validation failed";let[,r,o]=n;return t&&(o=o[0].toLowerCase()+o.slice(1)),o=r!=="."||!t?`${r.replace(/^\.(\[|$)/,"$1")}: ${o}`:`: ${o}`,o}function co(e,t){return t.length===1?new ao.UsageError(`${e}${Ut(t[0],{mergeName:!0})}`):new ao.UsageError(`${e}:
|
|
34
34
|
${t.map(n=>`
|
|
35
|
-
- ${Ut(n)}`).join("")}`)}function Bi(e,t,n){if(typeof n>"u")return t;let r=[],o=[],i=s=>{let u=t;return t=s,i.bind(null,u)};if(!n(t,{errors:r,coercions:o,coercion:i}))throw co(`Invalid value for ${e}`,r);for(let[,s]of o)s();return t}ie.applyValidator=Bi;ie.cleanValidationError=Ut;ie.formatError=co;ie.isOptionSymbol=uo;ie.makeCommandOption=vi;ie.rerouteArguments=wi});var Ao=w(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});var xi=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function b(e){return e===null?"null":e===void 0?"undefined":e===""?"an empty string":typeof e=="symbol"?`<${e.toString()}>`:Array.isArray(e)?"an array":JSON.stringify(e)}function ye(e,t){if(e.length===0)return"nothing";if(e.length===1)return b(e[0]);let n=e.slice(0,-1),r=e[e.length-1],o=e.length>2?`, ${t} `:` ${t} `;return`${n.map(i=>b(i)).join(", ")}${o}${b(r)}`}function se(e,t){var n,r,o;return typeof t=="number"?`${(n=e?.p)!==null&&n!==void 0?n:"."}[${t}]`:xi.test(t)?`${(r=e?.p)!==null&&r!==void 0?r:""}.${t}`:`${(o=e?.p)!==null&&o!==void 0?o:"."}[${JSON.stringify(t)}]`}function zt(e,t,n){return e===1?t:n}var ki=/^#[0-9a-f]{6}$/i,Pi=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,Oi=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Si=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,lo=/^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/;function m({errors:e,p:t}={},n){return e?.push(`${t??"."}: ${n}`),!1}function Ii(e,t){return n=>{e[t]=n}}function Z(e,t){return n=>{let r=e[t];return e[t]=n,Z(e,t).bind(null,r)}}function je(e,t,n){let r=()=>(e(n()),o),o=()=>(e(t),r);return r}function qt(){return E({test:(e,t)=>!0})}function po(e){return E({test:(t,n)=>t!==e?m(n,`Expected ${b(e)} (got ${b(t)})`):!0})}function Do(){return E({test:(e,t)=>typeof e!="string"?m(t,`Expected a string (got ${b(e)})`):!0})}function Ti(e){let t=Array.isArray(e)?e:Object.values(e),n=t.every(o=>typeof o=="string"||typeof o=="number"),r=new Set(t);return r.size===1?po([...r][0]):E({test:(o,i)=>r.has(o)?!0:n?m(i,`Expected one of ${ye(t,"or")} (got ${b(o)})`):m(i,`Expected a valid enumeration value (got ${b(o)})`)})}var Ni=new Map([["true",!0],["True",!0],["1",!0],[1,!0],["false",!1],["False",!1],["0",!1],[0,!1]]);function Ri(){return E({test:(e,t)=>{var n;if(typeof e!="boolean"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return m(t,"Unbound coercion result");let r=Ni.get(e);if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return m(t,`Expected a boolean (got ${b(e)})`)}return!0}})}function ji(){return E({test:(e,t)=>{var n;if(typeof e!="number"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return m(t,"Unbound coercion result");let r;if(typeof e=="string"){let o;try{o=JSON.parse(e)}catch{}if(typeof o=="number")if(JSON.stringify(o)===e)r=o;else return m(t,`Received a number that can't be safely represented by the runtime (${e})`)}if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return m(t,`Expected a number (got ${b(e)})`)}return!0}})}function Li(e){return E({test:(t,n)=>{var r;if(typeof n?.coercions>"u")return m(n,"The isPayload predicate can only be used with coercion enabled");if(typeof n.coercion>"u")return m(n,"Unbound coercion result");if(typeof t!="string")return m(n,`Expected a string (got ${b(t)})`);let o;try{o=JSON.parse(t)}catch{return m(n,`Expected a JSON string (got ${b(t)})`)}let i={value:o};return e(o,Object.assign(Object.assign({},n),{coercion:Z(i,"value")}))?(n.coercions.push([(r=n.p)!==null&&r!==void 0?r:".",n.coercion.bind(null,i.value)]),!0):!1}})}function Mi(){return E({test:(e,t)=>{var n;if(!(e instanceof Date)){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return m(t,"Unbound coercion result");let r;if(typeof e=="string"&&lo.test(e))r=new Date(e);else{let o;if(typeof e=="string"){let i;try{i=JSON.parse(e)}catch{}typeof i=="number"&&(o=i)}else typeof e=="number"&&(o=e);if(typeof o<"u")if(Number.isSafeInteger(o)||!Number.isSafeInteger(o*1e3))r=new Date(o*1e3);else return m(t,`Received a timestamp that can't be safely represented by the runtime (${e})`)}if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return m(t,`Expected a date (got ${b(e)})`)}return!0}})}function ot(e,{delimiter:t}={}){return E({test:(n,r)=>{var o;let i=n;if(typeof n=="string"&&typeof t<"u"&&typeof r?.coercions<"u"){if(typeof r?.coercion>"u")return m(r,"Unbound coercion result");n=n.split(t)}if(!Array.isArray(n))return m(r,`Expected an array (got ${b(n)})`);let a=!0;for(let s=0,u=n.length;s<u&&(a=e(n[s],Object.assign(Object.assign({},r),{p:se(r,s),coercion:Z(n,s)}))&&a,!(!a&&r?.errors==null));++s);return n!==i&&r.coercions.push([(o=r.p)!==null&&o!==void 0?o:".",r.coercion.bind(null,n)]),a}})}function Hi(e,{delimiter:t}={}){let n=ot(e,{delimiter:t});return E({test:(r,o)=>{var i,a;if(Object.getPrototypeOf(r).toString()==="[object Set]")if(typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return m(o,"Unbound coercion result");let s=[...r],u=[...r];if(!n(u,Object.assign(Object.assign({},o),{coercion:void 0})))return!1;let c=()=>u.some((l,d)=>l!==s[d])?new Set(u):r;return o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",je(o.coercion,r,c)]),!0}else{let s=!0;for(let u of r)if(s=e(u,Object.assign({},o))&&s,!s&&o?.errors==null)break;return s}if(typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return m(o,"Unbound coercion result");let s={value:r};return n(r,Object.assign(Object.assign({},o),{coercion:Z(s,"value")}))?(o.coercions.push([(a=o.p)!==null&&a!==void 0?a:".",je(o.coercion,r,()=>new Set(s.value))]),!0):!1}return m(o,`Expected a set (got ${b(r)})`)}})}function Gi(e,t){let n=ot(rt([e,t])),r=it(t,{keys:e});return E({test:(o,i)=>{var a,s,u;if(Object.getPrototypeOf(o).toString()==="[object Map]")if(typeof i?.coercions<"u"){if(typeof i?.coercion>"u")return m(i,"Unbound coercion result");let c=[...o],l=[...o];if(!n(l,Object.assign(Object.assign({},i),{coercion:void 0})))return!1;let d=()=>l.some((p,D)=>p[0]!==c[D][0]||p[1]!==c[D][1])?new Map(l):o;return i.coercions.push([(a=i.p)!==null&&a!==void 0?a:".",je(i.coercion,o,d)]),!0}else{let c=!0;for(let[l,d]of o)if(c=e(l,Object.assign({},i))&&c,!c&&i?.errors==null||(c=t(d,Object.assign(Object.assign({},i),{p:se(i,l)}))&&c,!c&&i?.errors==null))break;return c}if(typeof i?.coercions<"u"){if(typeof i?.coercion>"u")return m(i,"Unbound coercion result");let c={value:o};return Array.isArray(o)?n(o,Object.assign(Object.assign({},i),{coercion:void 0}))?(i.coercions.push([(s=i.p)!==null&&s!==void 0?s:".",je(i.coercion,o,()=>new Map(c.value))]),!0):!1:r(o,Object.assign(Object.assign({},i),{coercion:Z(c,"value")}))?(i.coercions.push([(u=i.p)!==null&&u!==void 0?u:".",je(i.coercion,o,()=>new Map(Object.entries(c.value)))]),!0):!1}return m(i,`Expected a map (got ${b(o)})`)}})}function rt(e,{delimiter:t}={}){let n=go(e.length);return E({test:(r,o)=>{var i;if(typeof r=="string"&&typeof t<"u"&&typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return m(o,"Unbound coercion result");r=r.split(t),o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,r)])}if(!Array.isArray(r))return m(o,`Expected a tuple (got ${b(r)})`);let a=n(r,Object.assign({},o));for(let s=0,u=r.length;s<u&&s<e.length&&(a=e[s](r[s],Object.assign(Object.assign({},o),{p:se(o,s),coercion:Z(r,s)}))&&a,!(!a&&o?.errors==null));++s);return a}})}function it(e,{keys:t=null}={}){let n=ot(rt([t??Do(),e]));return E({test:(r,o)=>{var i;if(Array.isArray(r)&&typeof o?.coercions<"u")return typeof o?.coercion>"u"?m(o,"Unbound coercion result"):n(r,Object.assign(Object.assign({},o),{coercion:void 0}))?(r=Object.fromEntries(r),o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,r)]),!0):!1;if(typeof r!="object"||r===null)return m(o,`Expected an object (got ${b(r)})`);let a=Object.keys(r),s=!0;for(let u=0,c=a.length;u<c&&(s||o?.errors!=null);++u){let l=a[u],d=r[l];if(l==="__proto__"||l==="constructor"){s=m(Object.assign(Object.assign({},o),{p:se(o,l)}),"Unsafe property name");continue}if(t!==null&&!t(l,o)){s=!1;continue}if(!e(d,Object.assign(Object.assign({},o),{p:se(o,l),coercion:Z(r,l)}))){s=!1;continue}}return s}})}function Ui(e,t={}){return it(e,t)}function fo(e,{extra:t=null}={}){let n=Object.keys(e),r=E({test:(o,i)=>{if(typeof o!="object"||o===null)return m(i,`Expected an object (got ${b(o)})`);let a=new Set([...n,...Object.keys(o)]),s={},u=!0;for(let c of a){if(c==="constructor"||c==="__proto__")u=m(Object.assign(Object.assign({},i),{p:se(i,c)}),"Unsafe property name");else{let l=Object.prototype.hasOwnProperty.call(e,c)?e[c]:void 0,d=Object.prototype.hasOwnProperty.call(o,c)?o[c]:void 0;typeof l<"u"?u=l(d,Object.assign(Object.assign({},i),{p:se(i,c),coercion:Z(o,c)}))&&u:t===null?u=m(Object.assign(Object.assign({},i),{p:se(i,c)}),`Extraneous property (got ${b(d)})`):Object.defineProperty(s,c,{enumerable:!0,get:()=>d,set:Ii(o,c)})}if(!u&&i?.errors==null)break}return t!==null&&(u||i?.errors!=null)&&(u=t(s,i)&&u),u}});return Object.assign(r,{properties:e})}function zi(e){return fo(e,{extra:it(qt())})}var qi=e=>E({test:(t,n)=>t instanceof e?!0:m(n,`Expected an instance of ${e.name} (got ${b(t)})`)}),Qi=(e,{exclusive:t=!1}={})=>E({test:(n,r)=>{var o,i,a;let s=[],u=typeof r?.errors<"u"?[]:void 0;for(let c=0,l=e.length;c<l;++c){let d=typeof r?.errors<"u"?[]:void 0,p=typeof r?.coercions<"u"?[]:void 0;if(e[c](n,Object.assign(Object.assign({},r),{errors:d,coercions:p,p:`${(o=r?.p)!==null&&o!==void 0?o:"."}#${c+1}`}))){if(s.push([`#${c+1}`,p]),!t)break}else u?.push(d[0])}if(s.length===1){let[,c]=s[0];return typeof c<"u"&&((i=r?.coercions)===null||i===void 0||i.push(...c)),!0}return s.length>1?m(r,`Expected to match exactly a single predicate (matched ${s.join(", ")})`):(a=r?.errors)===null||a===void 0||a.push(...u),!1}});function ho(e){return()=>e}function E({test:e}){return ho(e)()}var ae=class extends Error{constructor({errors:t}={}){let n="Type mismatch";if(t&&t.length>0){n+=`
|
|
35
|
+
- ${Ut(n)}`).join("")}`)}function Bi(e,t,n){if(typeof n>"u")return t;let r=[],o=[],i=s=>{let u=t;return t=s,i.bind(null,u)};if(!n(t,{errors:r,coercions:o,coercion:i}))throw co(`Invalid value for ${e}`,r);for(let[,s]of o)s();return t}ie.applyValidator=Bi;ie.cleanValidationError=Ut;ie.formatError=co;ie.isOptionSymbol=uo;ie.makeCommandOption=vi;ie.rerouteArguments=wi});var Ao=w(m=>{"use strict";Object.defineProperty(m,"__esModule",{value:!0});var xi=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function b(e){return e===null?"null":e===void 0?"undefined":e===""?"an empty string":typeof e=="symbol"?`<${e.toString()}>`:Array.isArray(e)?"an array":JSON.stringify(e)}function ye(e,t){if(e.length===0)return"nothing";if(e.length===1)return b(e[0]);let n=e.slice(0,-1),r=e[e.length-1],o=e.length>2?`, ${t} `:` ${t} `;return`${n.map(i=>b(i)).join(", ")}${o}${b(r)}`}function se(e,t){var n,r,o;return typeof t=="number"?`${(n=e?.p)!==null&&n!==void 0?n:"."}[${t}]`:xi.test(t)?`${(r=e?.p)!==null&&r!==void 0?r:""}.${t}`:`${(o=e?.p)!==null&&o!==void 0?o:"."}[${JSON.stringify(t)}]`}function zt(e,t,n){return e===1?t:n}var ki=/^#[0-9a-f]{6}$/i,Pi=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,Oi=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Si=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,lo=/^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/;function g({errors:e,p:t}={},n){return e?.push(`${t??"."}: ${n}`),!1}function Ii(e,t){return n=>{e[t]=n}}function Z(e,t){return n=>{let r=e[t];return e[t]=n,Z(e,t).bind(null,r)}}function je(e,t,n){let r=()=>(e(n()),o),o=()=>(e(t),r);return r}function qt(){return E({test:(e,t)=>!0})}function po(e){return E({test:(t,n)=>t!==e?g(n,`Expected ${b(e)} (got ${b(t)})`):!0})}function Do(){return E({test:(e,t)=>typeof e!="string"?g(t,`Expected a string (got ${b(e)})`):!0})}function Ti(e){let t=Array.isArray(e)?e:Object.values(e),n=t.every(o=>typeof o=="string"||typeof o=="number"),r=new Set(t);return r.size===1?po([...r][0]):E({test:(o,i)=>r.has(o)?!0:n?g(i,`Expected one of ${ye(t,"or")} (got ${b(o)})`):g(i,`Expected a valid enumeration value (got ${b(o)})`)})}var Ni=new Map([["true",!0],["True",!0],["1",!0],[1,!0],["false",!1],["False",!1],["0",!1],[0,!1]]);function Ri(){return E({test:(e,t)=>{var n;if(typeof e!="boolean"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return g(t,"Unbound coercion result");let r=Ni.get(e);if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return g(t,`Expected a boolean (got ${b(e)})`)}return!0}})}function ji(){return E({test:(e,t)=>{var n;if(typeof e!="number"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return g(t,"Unbound coercion result");let r;if(typeof e=="string"){let o;try{o=JSON.parse(e)}catch{}if(typeof o=="number")if(JSON.stringify(o)===e)r=o;else return g(t,`Received a number that can't be safely represented by the runtime (${e})`)}if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return g(t,`Expected a number (got ${b(e)})`)}return!0}})}function Li(e){return E({test:(t,n)=>{var r;if(typeof n?.coercions>"u")return g(n,"The isPayload predicate can only be used with coercion enabled");if(typeof n.coercion>"u")return g(n,"Unbound coercion result");if(typeof t!="string")return g(n,`Expected a string (got ${b(t)})`);let o;try{o=JSON.parse(t)}catch{return g(n,`Expected a JSON string (got ${b(t)})`)}let i={value:o};return e(o,Object.assign(Object.assign({},n),{coercion:Z(i,"value")}))?(n.coercions.push([(r=n.p)!==null&&r!==void 0?r:".",n.coercion.bind(null,i.value)]),!0):!1}})}function Mi(){return E({test:(e,t)=>{var n;if(!(e instanceof Date)){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return g(t,"Unbound coercion result");let r;if(typeof e=="string"&&lo.test(e))r=new Date(e);else{let o;if(typeof e=="string"){let i;try{i=JSON.parse(e)}catch{}typeof i=="number"&&(o=i)}else typeof e=="number"&&(o=e);if(typeof o<"u")if(Number.isSafeInteger(o)||!Number.isSafeInteger(o*1e3))r=new Date(o*1e3);else return g(t,`Received a timestamp that can't be safely represented by the runtime (${e})`)}if(typeof r<"u")return t.coercions.push([(n=t.p)!==null&&n!==void 0?n:".",t.coercion.bind(null,r)]),!0}return g(t,`Expected a date (got ${b(e)})`)}return!0}})}function ot(e,{delimiter:t}={}){return E({test:(n,r)=>{var o;let i=n;if(typeof n=="string"&&typeof t<"u"&&typeof r?.coercions<"u"){if(typeof r?.coercion>"u")return g(r,"Unbound coercion result");n=n.split(t)}if(!Array.isArray(n))return g(r,`Expected an array (got ${b(n)})`);let a=!0;for(let s=0,u=n.length;s<u&&(a=e(n[s],Object.assign(Object.assign({},r),{p:se(r,s),coercion:Z(n,s)}))&&a,!(!a&&r?.errors==null));++s);return n!==i&&r.coercions.push([(o=r.p)!==null&&o!==void 0?o:".",r.coercion.bind(null,n)]),a}})}function Hi(e,{delimiter:t}={}){let n=ot(e,{delimiter:t});return E({test:(r,o)=>{var i,a;if(Object.getPrototypeOf(r).toString()==="[object Set]")if(typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return g(o,"Unbound coercion result");let s=[...r],u=[...r];if(!n(u,Object.assign(Object.assign({},o),{coercion:void 0})))return!1;let d=()=>u.some((l,c)=>l!==s[c])?new Set(u):r;return o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",je(o.coercion,r,d)]),!0}else{let s=!0;for(let u of r)if(s=e(u,Object.assign({},o))&&s,!s&&o?.errors==null)break;return s}if(typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return g(o,"Unbound coercion result");let s={value:r};return n(r,Object.assign(Object.assign({},o),{coercion:Z(s,"value")}))?(o.coercions.push([(a=o.p)!==null&&a!==void 0?a:".",je(o.coercion,r,()=>new Set(s.value))]),!0):!1}return g(o,`Expected a set (got ${b(r)})`)}})}function Gi(e,t){let n=ot(rt([e,t])),r=it(t,{keys:e});return E({test:(o,i)=>{var a,s,u;if(Object.getPrototypeOf(o).toString()==="[object Map]")if(typeof i?.coercions<"u"){if(typeof i?.coercion>"u")return g(i,"Unbound coercion result");let d=[...o],l=[...o];if(!n(l,Object.assign(Object.assign({},i),{coercion:void 0})))return!1;let c=()=>l.some((p,D)=>p[0]!==d[D][0]||p[1]!==d[D][1])?new Map(l):o;return i.coercions.push([(a=i.p)!==null&&a!==void 0?a:".",je(i.coercion,o,c)]),!0}else{let d=!0;for(let[l,c]of o)if(d=e(l,Object.assign({},i))&&d,!d&&i?.errors==null||(d=t(c,Object.assign(Object.assign({},i),{p:se(i,l)}))&&d,!d&&i?.errors==null))break;return d}if(typeof i?.coercions<"u"){if(typeof i?.coercion>"u")return g(i,"Unbound coercion result");let d={value:o};return Array.isArray(o)?n(o,Object.assign(Object.assign({},i),{coercion:void 0}))?(i.coercions.push([(s=i.p)!==null&&s!==void 0?s:".",je(i.coercion,o,()=>new Map(d.value))]),!0):!1:r(o,Object.assign(Object.assign({},i),{coercion:Z(d,"value")}))?(i.coercions.push([(u=i.p)!==null&&u!==void 0?u:".",je(i.coercion,o,()=>new Map(Object.entries(d.value)))]),!0):!1}return g(i,`Expected a map (got ${b(o)})`)}})}function rt(e,{delimiter:t}={}){let n=mo(e.length);return E({test:(r,o)=>{var i;if(typeof r=="string"&&typeof t<"u"&&typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return g(o,"Unbound coercion result");r=r.split(t),o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,r)])}if(!Array.isArray(r))return g(o,`Expected a tuple (got ${b(r)})`);let a=n(r,Object.assign({},o));for(let s=0,u=r.length;s<u&&s<e.length&&(a=e[s](r[s],Object.assign(Object.assign({},o),{p:se(o,s),coercion:Z(r,s)}))&&a,!(!a&&o?.errors==null));++s);return a}})}function it(e,{keys:t=null}={}){let n=ot(rt([t??Do(),e]));return E({test:(r,o)=>{var i;if(Array.isArray(r)&&typeof o?.coercions<"u")return typeof o?.coercion>"u"?g(o,"Unbound coercion result"):n(r,Object.assign(Object.assign({},o),{coercion:void 0}))?(r=Object.fromEntries(r),o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,r)]),!0):!1;if(typeof r!="object"||r===null)return g(o,`Expected an object (got ${b(r)})`);let a=Object.keys(r),s=!0;for(let u=0,d=a.length;u<d&&(s||o?.errors!=null);++u){let l=a[u],c=r[l];if(l==="__proto__"||l==="constructor"){s=g(Object.assign(Object.assign({},o),{p:se(o,l)}),"Unsafe property name");continue}if(t!==null&&!t(l,o)){s=!1;continue}if(!e(c,Object.assign(Object.assign({},o),{p:se(o,l),coercion:Z(r,l)}))){s=!1;continue}}return s}})}function Ui(e,t={}){return it(e,t)}function fo(e,{extra:t=null}={}){let n=Object.keys(e),r=E({test:(o,i)=>{if(typeof o!="object"||o===null)return g(i,`Expected an object (got ${b(o)})`);let a=new Set([...n,...Object.keys(o)]),s={},u=!0;for(let d of a){if(d==="constructor"||d==="__proto__")u=g(Object.assign(Object.assign({},i),{p:se(i,d)}),"Unsafe property name");else{let l=Object.prototype.hasOwnProperty.call(e,d)?e[d]:void 0,c=Object.prototype.hasOwnProperty.call(o,d)?o[d]:void 0;typeof l<"u"?u=l(c,Object.assign(Object.assign({},i),{p:se(i,d),coercion:Z(o,d)}))&&u:t===null?u=g(Object.assign(Object.assign({},i),{p:se(i,d)}),`Extraneous property (got ${b(c)})`):Object.defineProperty(s,d,{enumerable:!0,get:()=>c,set:Ii(o,d)})}if(!u&&i?.errors==null)break}return t!==null&&(u||i?.errors!=null)&&(u=t(s,i)&&u),u}});return Object.assign(r,{properties:e})}function zi(e){return fo(e,{extra:it(qt())})}var qi=e=>E({test:(t,n)=>t instanceof e?!0:g(n,`Expected an instance of ${e.name} (got ${b(t)})`)}),Qi=(e,{exclusive:t=!1}={})=>E({test:(n,r)=>{var o,i,a;let s=[],u=typeof r?.errors<"u"?[]:void 0;for(let d=0,l=e.length;d<l;++d){let c=typeof r?.errors<"u"?[]:void 0,p=typeof r?.coercions<"u"?[]:void 0;if(e[d](n,Object.assign(Object.assign({},r),{errors:c,coercions:p,p:`${(o=r?.p)!==null&&o!==void 0?o:"."}#${d+1}`}))){if(s.push([`#${d+1}`,p]),!t)break}else u?.push(c[0])}if(s.length===1){let[,d]=s[0];return typeof d<"u"&&((i=r?.coercions)===null||i===void 0||i.push(...d)),!0}return s.length>1?g(r,`Expected to match exactly a single predicate (matched ${s.join(", ")})`):(a=r?.errors)===null||a===void 0||a.push(...u),!1}});function ho(e){return()=>e}function E({test:e}){return ho(e)()}var ae=class extends Error{constructor({errors:t}={}){let n="Type mismatch";if(t&&t.length>0){n+=`
|
|
36
36
|
`;for(let r of t)n+=`
|
|
37
|
-
- ${r}`}super(n)}};function Yi(e,t){if(!t(e))throw new ae}function Ki(e,t){let n=[];if(!t(e,{errors:n}))throw new ae({errors:n})}function Wi(e,t){}function Vi(e,t,{coerce:n=!1,errors:r,throw:o}={}){let i=r?[]:void 0;if(!n){if(t(e,{errors:i}))return o?e:{value:e,errors:void 0};if(o)throw new ae({errors:i});return{value:void 0,errors:i??!0}}let a={value:e},s=Z(a,"value"),u=[];if(!t(e,{errors:i,coercion:s,coercions:u})){if(o)throw new ae({errors:i});return{value:void 0,errors:i??!0}}for(let[,c]of u)c();return o?a.value:{value:a.value,errors:void 0}}function Zi(e,t){let n=rt(e);return((...r)=>{if(!n(r))throw new ae;return t(...r)})}function Xi(e){return E({test:(t,n)=>t.length>=e?!0:m(n,`Expected to have a length of at least ${e} elements (got ${t.length})`)})}function Ji(e){return E({test:(t,n)=>t.length<=e?!0:m(n,`Expected to have a length of at most ${e} elements (got ${t.length})`)})}function go(e){return E({test:(t,n)=>t.length!==e?m(n,`Expected to have a length of exactly ${e} elements (got ${t.length})`):!0})}function _i({map:e}={}){return E({test:(t,n)=>{let r=new Set,o=new Set;for(let i=0,a=t.length;i<a;++i){let s=t[i],u=typeof e<"u"?e(s):s;if(r.has(u)){if(o.has(u))continue;m(n,`Expected to contain unique elements; got a duplicate with ${b(t)}`),o.add(u)}else r.add(u)}return o.size===0}})}function $i(){return E({test:(e,t)=>e<=0?!0:m(t,`Expected to be negative (got ${e})`)})}function es(){return E({test:(e,t)=>e>=0?!0:m(t,`Expected to be positive (got ${e})`)})}function ts(e){return E({test:(t,n)=>t>=e?!0:m(n,`Expected to be at least ${e} (got ${t})`)})}function ns(e){return E({test:(t,n)=>t<=e?!0:m(n,`Expected to be at most ${e} (got ${t})`)})}function os(e,t){return E({test:(n,r)=>n>=e&&n<=t?!0:m(r,`Expected to be in the [${e}; ${t}] range (got ${n})`)})}function rs(e,t){return E({test:(n,r)=>n>=e&&n<t?!0:m(r,`Expected to be in the [${e}; ${t}[ range (got ${n})`)})}function is({unsafe:e=!1}={}){return E({test:(t,n)=>t!==Math.round(t)?m(n,`Expected to be an integer (got ${t})`):!e&&!Number.isSafeInteger(t)?m(n,`Expected to be a safe integer (got ${t})`):!0})}function ss(e){return E({test:(t,n)=>e.test(t)?!0:m(n,`Expected to match the pattern ${e.toString()} (got ${b(t)})`)})}function as(){return E({test:(e,t)=>e!==e.toLowerCase()?m(t,`Expected to be all-lowercase (got ${e})`):!0})}function us(){return E({test:(e,t)=>e!==e.toUpperCase()?m(t,`Expected to be all-uppercase (got ${e})`):!0})}function cs(){return E({test:(e,t)=>Si.test(e)?!0:m(t,`Expected to be a valid UUID v4 (got ${b(e)})`)})}function ds(){return E({test:(e,t)=>lo.test(e)?!0:m(t,`Expected to be a valid ISO 8601 date string (got ${b(e)})`)})}function ls({alpha:e=!1}){return E({test:(t,n)=>(e?ki.test(t):Pi.test(t))?!0:m(n,`Expected to be a valid hexadecimal color string (got ${b(t)})`)})}function ps(){return E({test:(e,t)=>Oi.test(e)?!0:m(t,`Expected to be a valid base 64 string (got ${b(e)})`)})}function Ds(e=qt()){return E({test:(t,n)=>{let r;try{r=JSON.parse(t)}catch{return m(n,`Expected to be a valid JSON string (got ${b(t)})`)}return e(r,n)}})}function mo(e,...t){let n=Array.isArray(t[0])?t[0]:t;return E({test:(r,o)=>{var i,a;let s={value:r},u=typeof o?.coercions<"u"?Z(s,"value"):void 0,c=typeof o?.coercions<"u"?[]:void 0;if(!e(r,Object.assign(Object.assign({},o),{coercion:u,coercions:c})))return!1;let l=[];if(typeof c<"u")for(let[,d]of c)l.push(d());try{if(typeof o?.coercions<"u"){if(s.value!==r){if(typeof o?.coercion>"u")return m(o,"Unbound coercion result");o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,s.value)])}(a=o?.coercions)===null||a===void 0||a.push(...c)}return n.every(d=>d(s.value,o))}finally{for(let d of l)d()}}})}function fs(e,...t){let n=Array.isArray(t[0])?t[0]:t;return mo(e,n)}function hs(e){return E({test:(t,n)=>typeof t>"u"?!0:e(t,n)})}function gs(e){return E({test:(t,n)=>t===null?!0:e(t,n)})}var st={missing:(e,t)=>e.has(t),undefined:(e,t,n)=>e.has(t)&&typeof n[t]<"u",nil:(e,t,n)=>e.has(t)&&n[t]!=null,falsy:(e,t,n)=>e.has(t)&&!!n[t]};function ms(e,t){var n;let r=new Set(e),o=st[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,a)=>{let s=new Set(Object.keys(i)),u=[];for(let c of r)o(s,c,i)||u.push(c);return u.length>0?m(a,`Missing required ${zt(u.length,"property","properties")} ${ye(u,"and")}`):!0}})}function As(e,t){var n;let r=new Set(e),o=st[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,a)=>Object.keys(i).some(c=>o(r,c,i))?!0:m(a,`Missing at least one property from ${ye(Array.from(r),"or")}`)})}function Fs(e,t){var n;let r=new Set(e),o=st[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,a)=>{let s=new Set(Object.keys(i)),u=[];for(let c of r)o(s,c,i)&&u.push(c);return u.length>0?m(a,`Forbidden ${zt(u.length,"property","properties")} ${ye(u,"and")}`):!0}})}function Es(e,t){var n;let r=new Set(e),o=st[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,a)=>{let s=new Set(Object.keys(i)),u=[];for(let c of r)o(s,c,i)&&u.push(c);return u.length>1?m(a,`Mutually exclusive properties ${ye(u,"and")}`):!0}})}(function(e){e.Forbids="Forbids",e.Requires="Requires"})(g.KeyRelationship||(g.KeyRelationship={}));var Cs={[g.KeyRelationship.Forbids]:{expect:!1,message:"forbids using"},[g.KeyRelationship.Requires]:{expect:!0,message:"requires using"}};function ys(e,t,n,{ignore:r=[]}={}){let o=new Set(r),i=new Set(n),a=Cs[t],s=t===g.KeyRelationship.Forbids?"or":"and";return E({test:(u,c)=>{let l=new Set(Object.keys(u));if(!l.has(e)||o.has(u[e]))return!0;let d=[];for(let p of i)(l.has(p)&&!o.has(u[p]))!==a.expect&&d.push(p);return d.length>=1?m(c,`Property "${e}" ${a.message} ${zt(d.length,"property","properties")} ${ye(d,s)}`):!0}})}g.TypeAssertionError=ae;g.applyCascade=fs;g.as=Vi;g.assert=Yi;g.assertWithErrors=Ki;g.cascade=mo;g.fn=Zi;g.hasAtLeastOneKey=As;g.hasExactLength=go;g.hasForbiddenKeys=Fs;g.hasKeyRelationship=ys;g.hasMaxLength=Ji;g.hasMinLength=Xi;g.hasMutuallyExclusiveKeys=Es;g.hasRequiredKeys=ms;g.hasUniqueItems=_i;g.isArray=ot;g.isAtLeast=ts;g.isAtMost=ns;g.isBase64=ps;g.isBoolean=Ri;g.isDate=Mi;g.isDict=Ui;g.isEnum=Ti;g.isHexColor=ls;g.isISO8601=ds;g.isInExclusiveRange=rs;g.isInInclusiveRange=os;g.isInstanceOf=qi;g.isInteger=is;g.isJSON=Ds;g.isLiteral=po;g.isLowerCase=as;g.isMap=Gi;g.isNegative=$i;g.isNullable=gs;g.isNumber=ji;g.isObject=fo;g.isOneOf=Qi;g.isOptional=hs;g.isPartial=zi;g.isPayload=Li;g.isPositive=es;g.isRecord=it;g.isSet=Hi;g.isString=Do;g.isTuple=rt;g.isUUID4=cs;g.isUnknown=qt;g.isUpperCase=us;g.makeTrait=ho;g.makeValidator=E;g.matchesRegExp=ss;g.softAssert=Wi});var ue=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});var Fo=$();function bs(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var Le=class{constructor(){this.help=!1}static Usage(t){return t}async catch(t){throw t}async validateAndExecute(){let n=this.constructor.schema;if(Array.isArray(n)){let{isDict:o,isUnknown:i,applyCascade:a}=await Promise.resolve().then(function(){return bs(Ao())}),s=a(o(i()),n),u=[],c=[];if(!s(this,{errors:u,coercions:c}))throw Fo.formatError("Invalid option schema",u);for(let[,d]of c)d()}else if(n!=null)throw new Error("Invalid command schema");let r=await this.execute();return typeof r<"u"?r:0}};Le.isOption=Fo.isOptionSymbol;Le.Default=[];Qt.Command=Le});var lt=w(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});var f=tt(),ct=nt();function R(e){f.IS_DEBUG&&console.log(e)}var Eo={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:f.HELP_COMMAND_INDEX,tokens:[]};function Kt(){let e={nodes:[]};for(let t=0;t<f.NodeType.CustomNode;++t)e.nodes.push(j());return e}function Co(e){let t=Kt(),n=[],r=t.nodes.length;for(let o of e){n.push(r);for(let i=0;i<o.nodes.length;++i)Wt(i)||t.nodes.push(Po(o.nodes[i],r));r+=o.nodes.length-f.NodeType.CustomNode+1}for(let o of n)le(t,f.NodeType.InitialNode,o);return t}function G(e,t){return e.nodes.push(t),e.nodes.length-1}function yo(e){let t=new Set,n=r=>{if(t.has(r))return;t.add(r);let o=e.nodes[r];for(let a of Object.values(o.statics))for(let{to:s}of a)n(s);for(let[,{to:a}]of o.dynamics)n(a);for(let{to:a}of o.shortcuts)n(a);let i=new Set(o.shortcuts.map(({to:a})=>a));for(;o.shortcuts.length>0;){let{to:a}=o.shortcuts.shift(),s=e.nodes[a];for(let[u,c]of Object.entries(s.statics)){let l=Object.prototype.hasOwnProperty.call(o.statics,u)?o.statics[u]:o.statics[u]=[];for(let d of c)l.some(({to:p})=>d.to===p)||l.push(d)}for(let[u,c]of s.dynamics)o.dynamics.some(([l,{to:d}])=>u===l&&c.to===d)||o.dynamics.push([u,c]);for(let u of s.shortcuts)i.has(u.to)||(o.shortcuts.push(u),i.add(u.to))}};n(f.NodeType.InitialNode)}function bo(e,{prefix:t=""}={}){if(f.IS_DEBUG){R(`${t}Nodes are:`);for(let n=0;n<e.nodes.length;++n)R(`${t} ${n}: ${JSON.stringify(e.nodes[n])}`)}}function vo(e,t,n=!1){R(`Running a vm on ${JSON.stringify(t)}`);let r=[{node:f.NodeType.InitialNode,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null,tokens:[]}}];bo(e,{prefix:" "});let o=[f.SpecialToken.StartOfInput,...t];for(let i=0;i<o.length;++i){let a=o[i],s=a===f.SpecialToken.EndOfInput||a===f.SpecialToken.EndOfPartialInput,u=i-1;R(` Processing ${JSON.stringify(a)}`);let c=[];for(let{node:l,state:d}of r){R(` Current node is ${l}`);let p=e.nodes[l];if(l===f.NodeType.ErrorNode){c.push({node:l,state:d});continue}console.assert(p.shortcuts.length===0,"Shortcuts should have been eliminated by now");let D=Object.prototype.hasOwnProperty.call(p.statics,a);if(!n||i<o.length-1||D)if(D){let h=p.statics[a];for(let{to:A,reducer:F}of h)c.push({node:A,state:typeof F<"u"?Me(ut,F,d,a,u):d}),R(` Static transition to ${A} found`)}else R(" No static transition found");else{let h=!1;for(let A of Object.keys(p.statics))if(A.startsWith(a)){if(a===A)for(let{to:F,reducer:C}of p.statics[A])c.push({node:F,state:typeof C<"u"?Me(ut,C,d,a,u):d}),R(` Static transition to ${F} found`);else for(let{to:F}of p.statics[A])c.push({node:F,state:{...d,remainder:A.slice(a.length)}}),R(` Static transition to ${F} found (partial match)`);h=!0}h||R(" No partial static transition found")}if(!s)for(let[h,{to:A,reducer:F}]of p.dynamics)Me(Oo,h,d,a,u)&&(c.push({node:A,state:typeof F<"u"?Me(ut,F,d,a,u):d}),R(` Dynamic transition to ${A} found (via ${h})`))}if(c.length===0&&s&&t.length===1)return[{node:f.NodeType.InitialNode,state:Eo}];if(c.length===0)throw new ct.UnknownSyntaxError(t,r.filter(({node:l})=>l!==f.NodeType.ErrorNode).map(({state:l})=>({usage:l.candidateUsage,reason:null})));if(c.every(({node:l})=>l===f.NodeType.ErrorNode))throw new ct.UnknownSyntaxError(t,c.map(({state:l})=>({usage:l.candidateUsage,reason:l.errorMessage})));r=wo(c)}if(r.length>0){R(" Results:");for(let i of r)R(` - ${i.node} -> ${JSON.stringify(i.state)}`)}else R(" No results");return r}function vs(e,t,{endToken:n=f.SpecialToken.EndOfInput}={}){let r=vo(e,[...t,n]);return Bo(t,r.map(({state:o})=>o))}function wo(e){let t=0;for(let{state:n}of e)n.path.length>t&&(t=n.path.length);return e.filter(({state:n})=>n.path.length===t)}function Bo(e,t){let n=t.filter(d=>d.selectedIndex!==null);if(n.length===0)throw new Error;let r=n.filter(d=>d.selectedIndex===f.HELP_COMMAND_INDEX||d.requiredOptions.every(p=>p.some(D=>d.options.find(h=>h.name===D))));if(r.length===0)throw new ct.UnknownSyntaxError(e,n.map(d=>({usage:d.candidateUsage,reason:null})));let o=0;for(let d of r)d.path.length>o&&(o=d.path.length);let i=r.filter(d=>d.path.length===o),a=d=>d.positionals.filter(({extra:p})=>!p).length+d.options.length,s=i.map(d=>({state:d,positionalCount:a(d)})),u=0;for(let{positionalCount:d}of s)d>u&&(u=d);let c=s.filter(({positionalCount:d})=>d===u).map(({state:d})=>d),l=xo(c);if(l.length>1)throw new ct.AmbiguousSyntaxError(e,l.map(d=>d.candidateUsage));return l[0]}function xo(e){let t=[],n=[];for(let r of e)r.selectedIndex===f.HELP_COMMAND_INDEX?n.push(r):t.push(r);return n.length>0&&t.push({...Eo,path:ko(...n.map(r=>r.path)),options:n.reduce((r,o)=>r.concat(o.options),[])}),t}function ko(e,t,...n){return t===void 0?Array.from(e):ko(e.filter((r,o)=>r===t[o]),...n)}function j(){return{dynamics:[],shortcuts:[],statics:{}}}function Wt(e){return e===f.NodeType.SuccessNode||e===f.NodeType.ErrorNode}function at(e,t=0){return{to:Wt(e.to)?e.to:e.to>=f.NodeType.CustomNode?e.to+t-f.NodeType.CustomNode+1:e.to+t,reducer:e.reducer}}function Po(e,t=0){let n=j();for(let[r,o]of e.dynamics)n.dynamics.push([r,at(o,t)]);for(let r of e.shortcuts)n.shortcuts.push(at(r,t));for(let[r,o]of Object.entries(e.statics))n.statics[r]=o.map(i=>at(i,t));return n}function O(e,t,n,r,o){e.nodes[t].dynamics.push([n,{to:r,reducer:o}])}function le(e,t,n,r){e.nodes[t].shortcuts.push({to:n,reducer:r})}function I(e,t,n,r,o){(Object.prototype.hasOwnProperty.call(e.nodes[t].statics,n)?e.nodes[t].statics[n]:e.nodes[t].statics[n]=[]).push({to:r,reducer:o})}function Me(e,t,n,r,o){if(Array.isArray(t)){let[i,...a]=t;return e[i](n,r,o,...a)}else return e[t](n,r,o)}var Oo={always:()=>!0,isOptionLike:(e,t)=>!e.ignoreOptions&&t!=="-"&&t.startsWith("-"),isNotOptionLike:(e,t)=>e.ignoreOptions||t==="-"||!t.startsWith("-"),isOption:(e,t,n,r)=>!e.ignoreOptions&&t===r,isBatchOption:(e,t,n,r)=>!e.ignoreOptions&&f.BATCH_REGEX.test(t)&&[...t.slice(1)].every(o=>r.has(`-${o}`)),isBoundOption:(e,t,n,r,o)=>{let i=t.match(f.BINDING_REGEX);return!e.ignoreOptions&&!!i&&f.OPTION_REGEX.test(i[1])&&r.has(i[1])&&o.filter(a=>a.nameSet.includes(i[1])).every(a=>a.allowBinding)},isNegatedOption:(e,t,n,r)=>!e.ignoreOptions&&t===`--no-${r.slice(2)}`,isHelp:(e,t)=>!e.ignoreOptions&&f.HELP_REGEX.test(t),isUnsupportedOption:(e,t,n,r)=>!e.ignoreOptions&&t.startsWith("-")&&f.OPTION_REGEX.test(t)&&!r.has(t),isInvalidOption:(e,t)=>!e.ignoreOptions&&t.startsWith("-")&&!f.OPTION_REGEX.test(t)},ut={setCandidateState:(e,t,n,r)=>({...e,...r}),setSelectedIndex:(e,t,n,r)=>({...e,selectedIndex:r}),pushBatch:(e,t,n,r)=>{let o=e.options.slice(),i=e.tokens.slice();for(let a=1;a<t.length;++a){let s=r.get(`-${t[a]}`),u=a===1?[0,2]:[a,a+1];o.push({name:s,value:!0}),i.push({segmentIndex:n,type:"option",option:s,slice:u})}return{...e,options:o,tokens:i}},pushBound:(e,t,n)=>{let[,r,o]=t.match(f.BINDING_REGEX),i=e.options.concat({name:r,value:o}),a=e.tokens.concat([{segmentIndex:n,type:"option",slice:[0,r.length],option:r},{segmentIndex:n,type:"assign",slice:[r.length,r.length+1]},{segmentIndex:n,type:"value",slice:[r.length+1,r.length+o.length+1]}]);return{...e,options:i,tokens:a}},pushPath:(e,t,n)=>{let r=e.path.concat(t),o=e.tokens.concat({segmentIndex:n,type:"path"});return{...e,path:r,tokens:o}},pushPositional:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:!1}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushExtra:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:!0}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushExtraNoLimits:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:X}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushTrue:(e,t,n,r)=>{let o=e.options.concat({name:r,value:!0}),i=e.tokens.concat({segmentIndex:n,type:"option",option:r});return{...e,options:o,tokens:i}},pushFalse:(e,t,n,r)=>{let o=e.options.concat({name:r,value:!1}),i=e.tokens.concat({segmentIndex:n,type:"option",option:r});return{...e,options:o,tokens:i}},pushUndefined:(e,t,n,r)=>{let o=e.options.concat({name:t,value:void 0}),i=e.tokens.concat({segmentIndex:n,type:"option",option:t});return{...e,options:o,tokens:i}},pushStringValue:(e,t,n)=>{var r;let o=e.options[e.options.length-1],i=e.options.slice(),a=e.tokens.concat({segmentIndex:n,type:"value"});return o.value=((r=o.value)!==null&&r!==void 0?r:[]).concat([t]),{...e,options:i,tokens:a}},setStringValue:(e,t,n)=>{let r=e.options[e.options.length-1],o=e.options.slice(),i=e.tokens.concat({segmentIndex:n,type:"value"});return r.value=t,{...e,options:o,tokens:i}},inhibateOptions:e=>({...e,ignoreOptions:!0}),useHelp:(e,t,n,r)=>{let[,,o]=t.match(f.HELP_REGEX);return typeof o<"u"?{...e,options:[{name:"-c",value:String(r)},{name:"-i",value:o}]}:{...e,options:[{name:"-c",value:String(r)}]}},setError:(e,t,n,r)=>t===f.SpecialToken.EndOfInput||t===f.SpecialToken.EndOfPartialInput?{...e,errorMessage:`${r}.`}:{...e,errorMessage:`${r} ("${t}").`},setOptionArityError:(e,t)=>{let n=e.options[e.options.length-1];return{...e,errorMessage:`Not enough arguments to option ${n.name}.`}}},X=Symbol(),dt=class{constructor(t,n){this.allOptionNames=new Map,this.arity={leading:[],trailing:[],extra:[],proxy:!1},this.options=[],this.paths=[],this.cliIndex=t,this.cliOpts=n}addPath(t){this.paths.push(t)}setArity({leading:t=this.arity.leading,trailing:n=this.arity.trailing,extra:r=this.arity.extra,proxy:o=this.arity.proxy}){Object.assign(this.arity,{leading:t,trailing:n,extra:r,proxy:o})}addPositional({name:t="arg",required:n=!0}={}){if(!n&&this.arity.extra===X)throw new Error("Optional parameters cannot be declared when using .rest() or .proxy()");if(!n&&this.arity.trailing.length>0)throw new Error("Optional parameters cannot be declared after the required trailing positional arguments");!n&&this.arity.extra!==X?this.arity.extra.push(t):this.arity.extra!==X&&this.arity.extra.length===0?this.arity.leading.push(t):this.arity.trailing.push(t)}addRest({name:t="arg",required:n=0}={}){if(this.arity.extra===X)throw new Error("Infinite lists cannot be declared multiple times in the same command");if(this.arity.trailing.length>0)throw new Error("Infinite lists cannot be declared after the required trailing positional arguments");for(let r=0;r<n;++r)this.addPositional({name:t});this.arity.extra=X}addProxy({required:t=0}={}){this.addRest({required:t}),this.arity.proxy=!0}addOption({names:t,description:n,arity:r=0,hidden:o=!1,required:i=!1,allowBinding:a=!0}){if(!a&&r>1)throw new Error("The arity cannot be higher than 1 when the option only supports the --arg=value syntax");if(!Number.isInteger(r))throw new Error(`The arity must be an integer, got ${r}`);if(r<0)throw new Error(`The arity must be positive, got ${r}`);let s=t.reduce((u,c)=>c.length>u.length?c:u,"");for(let u of t)this.allOptionNames.set(u,s);this.options.push({preferredName:s,nameSet:t,description:n,arity:r,hidden:o,required:i,allowBinding:a})}setContext(t){this.context=t}usage({detailed:t=!0,inlineOptions:n=!0}={}){let r=[this.cliOpts.binaryName],o=[];if(this.paths.length>0&&r.push(...this.paths[0]),t){for(let{preferredName:a,nameSet:s,arity:u,hidden:c,description:l,required:d}of this.options){if(c)continue;let p=[];for(let h=0;h<u;++h)p.push(` #${h}`);let D=`${s.join(",")}${p.join("")}`;!n&&l?o.push({preferredName:a,nameSet:s,definition:D,description:l,required:d}):r.push(d?`<${D}>`:`[${D}]`)}r.push(...this.arity.leading.map(a=>`<${a}>`)),this.arity.extra===X?r.push("..."):r.push(...this.arity.extra.map(a=>`[${a}]`)),r.push(...this.arity.trailing.map(a=>`<${a}>`))}return{usage:r.join(" "),options:o}}compile(){if(typeof this.context>"u")throw new Error("Assertion failed: No context attached");let t=Kt(),n=f.NodeType.InitialNode,r=this.usage().usage,o=this.options.filter(s=>s.required).map(s=>s.nameSet);n=G(t,j()),I(t,f.NodeType.InitialNode,f.SpecialToken.StartOfInput,n,["setCandidateState",{candidateUsage:r,requiredOptions:o}]);let i=this.arity.proxy?"always":"isNotOptionLike",a=this.paths.length>0?this.paths:[[]];for(let s of a){let u=n;if(s.length>0){let p=G(t,j());le(t,u,p),this.registerOptions(t,p),u=p}for(let p=0;p<s.length;++p){let D=G(t,j());if(I(t,u,s[p],D,"pushPath"),u=D,p+1<s.length){let h=G(t,j());O(t,u,"isHelp",h,["useHelp",this.cliIndex]),I(t,h,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",f.HELP_COMMAND_INDEX])}}if(this.arity.leading.length>0||!this.arity.proxy){let p=G(t,j());O(t,u,"isHelp",p,["useHelp",this.cliIndex]),O(t,p,"always",p,"pushExtra"),I(t,p,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",f.HELP_COMMAND_INDEX]),this.registerOptions(t,u)}this.arity.leading.length>0&&(I(t,u,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,u,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]));let c=u;for(let p=0;p<this.arity.leading.length;++p){let D=G(t,j());(!this.arity.proxy||p+1!==this.arity.leading.length)&&this.registerOptions(t,D),(this.arity.trailing.length>0||p+1!==this.arity.leading.length)&&(I(t,D,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,D,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])),O(t,c,"isNotOptionLike",D,"pushPositional"),c=D}let l=c;if(this.arity.extra===X||this.arity.extra.length>0){let p=G(t,j());if(le(t,c,p),this.arity.extra===X){let D=G(t,j());this.arity.proxy||this.registerOptions(t,D),O(t,c,i,D,"pushExtraNoLimits"),O(t,D,i,D,"pushExtraNoLimits"),le(t,D,p)}else for(let D=0;D<this.arity.extra.length;++D){let h=G(t,j());(!this.arity.proxy||D>0)&&this.registerOptions(t,h),O(t,l,i,h,"pushExtra"),le(t,h,p),l=h}l=p}this.arity.trailing.length>0&&(I(t,l,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,l,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]));let d=l;for(let p=0;p<this.arity.trailing.length;++p){let D=G(t,j());this.arity.proxy||this.registerOptions(t,D),p+1<this.arity.trailing.length&&(I(t,D,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,D,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])),O(t,d,"isNotOptionLike",D,"pushPositional"),d=D}O(t,d,i,f.NodeType.ErrorNode,["setError","Extraneous positional argument"]),I(t,d,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]),I(t,d,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])}return{machine:t,context:this.context}}registerOptions(t,n){O(t,n,["isOption","--"],n,"inhibateOptions"),O(t,n,["isBatchOption",this.allOptionNames],n,["pushBatch",this.allOptionNames]),O(t,n,["isBoundOption",this.allOptionNames,this.options],n,"pushBound"),O(t,n,["isUnsupportedOption",this.allOptionNames],f.NodeType.ErrorNode,["setError","Unsupported option name"]),O(t,n,["isInvalidOption"],f.NodeType.ErrorNode,["setError","Invalid option name"]);for(let r of this.options)if(r.arity===0)for(let o of r.nameSet)O(t,n,["isOption",o],n,["pushTrue",r.preferredName]),o.startsWith("--")&&!o.startsWith("--no-")&&O(t,n,["isNegatedOption",o],n,["pushFalse",r.preferredName]);else{let o=G(t,j());for(let i of r.nameSet)O(t,n,["isOption",i],o,["pushUndefined",r.preferredName]);for(let i=0;i<r.arity;++i){let a=G(t,j());I(t,o,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,"setOptionArityError"),I(t,o,f.SpecialToken.EndOfPartialInput,f.NodeType.ErrorNode,"setOptionArityError"),O(t,o,"isOptionLike",f.NodeType.ErrorNode,"setOptionArityError");let s=r.arity===1?"setStringValue":"pushStringValue";O(t,o,"isNotOptionLike",a,s),o=a}le(t,o,n)}}},Yt=class e{constructor({binaryName:t="..."}={}){this.builders=[],this.opts={binaryName:t}}static build(t,n={}){return new e(n).commands(t).compile()}getBuilderByIndex(t){if(!(t>=0&&t<this.builders.length))throw new Error(`Assertion failed: Out-of-bound command index (${t})`);return this.builders[t]}commands(t){for(let n of t)n(this.command());return this}command(){let t=new dt(this.builders.length,this.opts);return this.builders.push(t),t}compile(){let t=[],n=[];for(let o of this.builders){let{machine:i,context:a}=o.compile();t.push(i),n.push(a)}let r=Co(t);return yo(r),{machine:r,contexts:n,process:(o,{partial:i}={})=>{let a=i?f.SpecialToken.EndOfPartialInput:f.SpecialToken.EndOfInput;return vs(r,o,{endToken:a})}}}};B.CliBuilder=Yt;B.CommandBuilder=dt;B.NoLimits=X;B.aggregateHelpStates=xo;B.cloneNode=Po;B.cloneTransition=at;B.debug=R;B.debugMachine=bo;B.execute=Me;B.injectNode=G;B.isTerminalNode=Wt;B.makeAnyOfMachine=Co;B.makeNode=j;B.makeStateMachine=Kt;B.reducers=ut;B.registerDynamic=O;B.registerShortcut=le;B.registerStatic=I;B.runMachineInternal=vo;B.selectBestState=Bo;B.simplifyMachine=yo;B.tests=Oo;B.trimSmallerBranches=wo});var Io=w(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});var ws=require("tty");function Bs(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var Vt=Bs(ws);function xs(){return Vt.default&&"getColorDepth"in Vt.default.WriteStream.prototype?Vt.default.WriteStream.prototype.getColorDepth():process.env.FORCE_COLOR==="0"?1:process.env.FORCE_COLOR==="1"||typeof process.stdout<"u"&&process.stdout.isTTY?8:1}var So;function ks(e){let t=So;if(typeof t>"u"){if(e.stdout===process.stdout&&e.stderr===process.stderr)return null;let{AsyncLocalStorage:n}=require("async_hooks");t=So=new n;let r=process.stdout._write;process.stdout._write=function(i,a,s){let u=t.getStore();return typeof u>"u"?r.call(this,i,a,s):u.stdout.write(i,a,s)};let o=process.stderr._write;process.stderr._write=function(i,a,s){let u=t.getStore();return typeof u>"u"?o.call(this,i,a,s):u.stderr.write(i,a,s)}}return n=>t.run(e,n)}pt.getCaptureActivator=ks;pt.getDefaultColorDepth=xs});var To=w(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});var Ps=ue(),Zt=class e extends Ps.Command{constructor(t){super(),this.contexts=t,this.commands=[]}static from(t,n){let r=new e(n);r.path=t.path;for(let o of t.options)switch(o.name){case"-c":r.commands.push(Number(o.value));break;case"-i":r.index=Number(o.value);break}return r}async execute(){let t=this.commands;if(typeof this.index<"u"&&this.index>=0&&this.index<t.length&&(t=[t[this.index]]),t.length===0)this.context.stdout.write(this.cli.usage());else if(t.length===1)this.context.stdout.write(this.cli.usage(this.contexts[t[0]].commandClass,{detailed:!0}));else if(t.length>1){this.context.stdout.write(`Multiple commands match your selection:
|
|
37
|
+
- ${r}`}super(n)}};function Yi(e,t){if(!t(e))throw new ae}function Ki(e,t){let n=[];if(!t(e,{errors:n}))throw new ae({errors:n})}function Wi(e,t){}function Vi(e,t,{coerce:n=!1,errors:r,throw:o}={}){let i=r?[]:void 0;if(!n){if(t(e,{errors:i}))return o?e:{value:e,errors:void 0};if(o)throw new ae({errors:i});return{value:void 0,errors:i??!0}}let a={value:e},s=Z(a,"value"),u=[];if(!t(e,{errors:i,coercion:s,coercions:u})){if(o)throw new ae({errors:i});return{value:void 0,errors:i??!0}}for(let[,d]of u)d();return o?a.value:{value:a.value,errors:void 0}}function Zi(e,t){let n=rt(e);return((...r)=>{if(!n(r))throw new ae;return t(...r)})}function Xi(e){return E({test:(t,n)=>t.length>=e?!0:g(n,`Expected to have a length of at least ${e} elements (got ${t.length})`)})}function Ji(e){return E({test:(t,n)=>t.length<=e?!0:g(n,`Expected to have a length of at most ${e} elements (got ${t.length})`)})}function mo(e){return E({test:(t,n)=>t.length!==e?g(n,`Expected to have a length of exactly ${e} elements (got ${t.length})`):!0})}function _i({map:e}={}){return E({test:(t,n)=>{let r=new Set,o=new Set;for(let i=0,a=t.length;i<a;++i){let s=t[i],u=typeof e<"u"?e(s):s;if(r.has(u)){if(o.has(u))continue;g(n,`Expected to contain unique elements; got a duplicate with ${b(t)}`),o.add(u)}else r.add(u)}return o.size===0}})}function $i(){return E({test:(e,t)=>e<=0?!0:g(t,`Expected to be negative (got ${e})`)})}function es(){return E({test:(e,t)=>e>=0?!0:g(t,`Expected to be positive (got ${e})`)})}function ts(e){return E({test:(t,n)=>t>=e?!0:g(n,`Expected to be at least ${e} (got ${t})`)})}function ns(e){return E({test:(t,n)=>t<=e?!0:g(n,`Expected to be at most ${e} (got ${t})`)})}function os(e,t){return E({test:(n,r)=>n>=e&&n<=t?!0:g(r,`Expected to be in the [${e}; ${t}] range (got ${n})`)})}function rs(e,t){return E({test:(n,r)=>n>=e&&n<t?!0:g(r,`Expected to be in the [${e}; ${t}[ range (got ${n})`)})}function is({unsafe:e=!1}={}){return E({test:(t,n)=>t!==Math.round(t)?g(n,`Expected to be an integer (got ${t})`):!e&&!Number.isSafeInteger(t)?g(n,`Expected to be a safe integer (got ${t})`):!0})}function ss(e){return E({test:(t,n)=>e.test(t)?!0:g(n,`Expected to match the pattern ${e.toString()} (got ${b(t)})`)})}function as(){return E({test:(e,t)=>e!==e.toLowerCase()?g(t,`Expected to be all-lowercase (got ${e})`):!0})}function us(){return E({test:(e,t)=>e!==e.toUpperCase()?g(t,`Expected to be all-uppercase (got ${e})`):!0})}function ds(){return E({test:(e,t)=>Si.test(e)?!0:g(t,`Expected to be a valid UUID v4 (got ${b(e)})`)})}function cs(){return E({test:(e,t)=>lo.test(e)?!0:g(t,`Expected to be a valid ISO 8601 date string (got ${b(e)})`)})}function ls({alpha:e=!1}){return E({test:(t,n)=>(e?ki.test(t):Pi.test(t))?!0:g(n,`Expected to be a valid hexadecimal color string (got ${b(t)})`)})}function ps(){return E({test:(e,t)=>Oi.test(e)?!0:g(t,`Expected to be a valid base 64 string (got ${b(e)})`)})}function Ds(e=qt()){return E({test:(t,n)=>{let r;try{r=JSON.parse(t)}catch{return g(n,`Expected to be a valid JSON string (got ${b(t)})`)}return e(r,n)}})}function go(e,...t){let n=Array.isArray(t[0])?t[0]:t;return E({test:(r,o)=>{var i,a;let s={value:r},u=typeof o?.coercions<"u"?Z(s,"value"):void 0,d=typeof o?.coercions<"u"?[]:void 0;if(!e(r,Object.assign(Object.assign({},o),{coercion:u,coercions:d})))return!1;let l=[];if(typeof d<"u")for(let[,c]of d)l.push(c());try{if(typeof o?.coercions<"u"){if(s.value!==r){if(typeof o?.coercion>"u")return g(o,"Unbound coercion result");o.coercions.push([(i=o.p)!==null&&i!==void 0?i:".",o.coercion.bind(null,s.value)])}(a=o?.coercions)===null||a===void 0||a.push(...d)}return n.every(c=>c(s.value,o))}finally{for(let c of l)c()}}})}function fs(e,...t){let n=Array.isArray(t[0])?t[0]:t;return go(e,n)}function hs(e){return E({test:(t,n)=>typeof t>"u"?!0:e(t,n)})}function ms(e){return E({test:(t,n)=>t===null?!0:e(t,n)})}var st={missing:(e,t)=>e.has(t),undefined:(e,t,n)=>e.has(t)&&typeof n[t]<"u",nil:(e,t,n)=>e.has(t)&&n[t]!=null,falsy:(e,t,n)=>e.has(t)&&!!n[t]};function gs(e,t){var n;let r=new Set(e),o=st[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,a)=>{let s=new Set(Object.keys(i)),u=[];for(let d of r)o(s,d,i)||u.push(d);return u.length>0?g(a,`Missing required ${zt(u.length,"property","properties")} ${ye(u,"and")}`):!0}})}function As(e,t){var n;let r=new Set(e),o=st[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,a)=>Object.keys(i).some(d=>o(r,d,i))?!0:g(a,`Missing at least one property from ${ye(Array.from(r),"or")}`)})}function Fs(e,t){var n;let r=new Set(e),o=st[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,a)=>{let s=new Set(Object.keys(i)),u=[];for(let d of r)o(s,d,i)&&u.push(d);return u.length>0?g(a,`Forbidden ${zt(u.length,"property","properties")} ${ye(u,"and")}`):!0}})}function Es(e,t){var n;let r=new Set(e),o=st[(n=t?.missingIf)!==null&&n!==void 0?n:"missing"];return E({test:(i,a)=>{let s=new Set(Object.keys(i)),u=[];for(let d of r)o(s,d,i)&&u.push(d);return u.length>1?g(a,`Mutually exclusive properties ${ye(u,"and")}`):!0}})}(function(e){e.Forbids="Forbids",e.Requires="Requires"})(m.KeyRelationship||(m.KeyRelationship={}));var Cs={[m.KeyRelationship.Forbids]:{expect:!1,message:"forbids using"},[m.KeyRelationship.Requires]:{expect:!0,message:"requires using"}};function ys(e,t,n,{ignore:r=[]}={}){let o=new Set(r),i=new Set(n),a=Cs[t],s=t===m.KeyRelationship.Forbids?"or":"and";return E({test:(u,d)=>{let l=new Set(Object.keys(u));if(!l.has(e)||o.has(u[e]))return!0;let c=[];for(let p of i)(l.has(p)&&!o.has(u[p]))!==a.expect&&c.push(p);return c.length>=1?g(d,`Property "${e}" ${a.message} ${zt(c.length,"property","properties")} ${ye(c,s)}`):!0}})}m.TypeAssertionError=ae;m.applyCascade=fs;m.as=Vi;m.assert=Yi;m.assertWithErrors=Ki;m.cascade=go;m.fn=Zi;m.hasAtLeastOneKey=As;m.hasExactLength=mo;m.hasForbiddenKeys=Fs;m.hasKeyRelationship=ys;m.hasMaxLength=Ji;m.hasMinLength=Xi;m.hasMutuallyExclusiveKeys=Es;m.hasRequiredKeys=gs;m.hasUniqueItems=_i;m.isArray=ot;m.isAtLeast=ts;m.isAtMost=ns;m.isBase64=ps;m.isBoolean=Ri;m.isDate=Mi;m.isDict=Ui;m.isEnum=Ti;m.isHexColor=ls;m.isISO8601=cs;m.isInExclusiveRange=rs;m.isInInclusiveRange=os;m.isInstanceOf=qi;m.isInteger=is;m.isJSON=Ds;m.isLiteral=po;m.isLowerCase=as;m.isMap=Gi;m.isNegative=$i;m.isNullable=ms;m.isNumber=ji;m.isObject=fo;m.isOneOf=Qi;m.isOptional=hs;m.isPartial=zi;m.isPayload=Li;m.isPositive=es;m.isRecord=it;m.isSet=Hi;m.isString=Do;m.isTuple=rt;m.isUUID4=ds;m.isUnknown=qt;m.isUpperCase=us;m.makeTrait=ho;m.makeValidator=E;m.matchesRegExp=ss;m.softAssert=Wi});var ue=w(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});var Fo=$();function bs(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if(n!=="default"){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var Le=class{constructor(){this.help=!1}static Usage(t){return t}async catch(t){throw t}async validateAndExecute(){let n=this.constructor.schema;if(Array.isArray(n)){let{isDict:o,isUnknown:i,applyCascade:a}=await Promise.resolve().then(function(){return bs(Ao())}),s=a(o(i()),n),u=[],d=[];if(!s(this,{errors:u,coercions:d}))throw Fo.formatError("Invalid option schema",u);for(let[,c]of d)c()}else if(n!=null)throw new Error("Invalid command schema");let r=await this.execute();return typeof r<"u"?r:0}};Le.isOption=Fo.isOptionSymbol;Le.Default=[];Qt.Command=Le});var lt=w(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});var f=tt(),dt=nt();function R(e){f.IS_DEBUG&&console.log(e)}var Eo={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:f.HELP_COMMAND_INDEX,tokens:[]};function Kt(){let e={nodes:[]};for(let t=0;t<f.NodeType.CustomNode;++t)e.nodes.push(j());return e}function Co(e){let t=Kt(),n=[],r=t.nodes.length;for(let o of e){n.push(r);for(let i=0;i<o.nodes.length;++i)Wt(i)||t.nodes.push(Po(o.nodes[i],r));r+=o.nodes.length-f.NodeType.CustomNode+1}for(let o of n)le(t,f.NodeType.InitialNode,o);return t}function G(e,t){return e.nodes.push(t),e.nodes.length-1}function yo(e){let t=new Set,n=r=>{if(t.has(r))return;t.add(r);let o=e.nodes[r];for(let a of Object.values(o.statics))for(let{to:s}of a)n(s);for(let[,{to:a}]of o.dynamics)n(a);for(let{to:a}of o.shortcuts)n(a);let i=new Set(o.shortcuts.map(({to:a})=>a));for(;o.shortcuts.length>0;){let{to:a}=o.shortcuts.shift(),s=e.nodes[a];for(let[u,d]of Object.entries(s.statics)){let l=Object.prototype.hasOwnProperty.call(o.statics,u)?o.statics[u]:o.statics[u]=[];for(let c of d)l.some(({to:p})=>c.to===p)||l.push(c)}for(let[u,d]of s.dynamics)o.dynamics.some(([l,{to:c}])=>u===l&&d.to===c)||o.dynamics.push([u,d]);for(let u of s.shortcuts)i.has(u.to)||(o.shortcuts.push(u),i.add(u.to))}};n(f.NodeType.InitialNode)}function bo(e,{prefix:t=""}={}){if(f.IS_DEBUG){R(`${t}Nodes are:`);for(let n=0;n<e.nodes.length;++n)R(`${t} ${n}: ${JSON.stringify(e.nodes[n])}`)}}function vo(e,t,n=!1){R(`Running a vm on ${JSON.stringify(t)}`);let r=[{node:f.NodeType.InitialNode,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null,tokens:[]}}];bo(e,{prefix:" "});let o=[f.SpecialToken.StartOfInput,...t];for(let i=0;i<o.length;++i){let a=o[i],s=a===f.SpecialToken.EndOfInput||a===f.SpecialToken.EndOfPartialInput,u=i-1;R(` Processing ${JSON.stringify(a)}`);let d=[];for(let{node:l,state:c}of r){R(` Current node is ${l}`);let p=e.nodes[l];if(l===f.NodeType.ErrorNode){d.push({node:l,state:c});continue}console.assert(p.shortcuts.length===0,"Shortcuts should have been eliminated by now");let D=Object.prototype.hasOwnProperty.call(p.statics,a);if(!n||i<o.length-1||D)if(D){let h=p.statics[a];for(let{to:A,reducer:F}of h)d.push({node:A,state:typeof F<"u"?Me(ut,F,c,a,u):c}),R(` Static transition to ${A} found`)}else R(" No static transition found");else{let h=!1;for(let A of Object.keys(p.statics))if(A.startsWith(a)){if(a===A)for(let{to:F,reducer:C}of p.statics[A])d.push({node:F,state:typeof C<"u"?Me(ut,C,c,a,u):c}),R(` Static transition to ${F} found`);else for(let{to:F}of p.statics[A])d.push({node:F,state:{...c,remainder:A.slice(a.length)}}),R(` Static transition to ${F} found (partial match)`);h=!0}h||R(" No partial static transition found")}if(!s)for(let[h,{to:A,reducer:F}]of p.dynamics)Me(Oo,h,c,a,u)&&(d.push({node:A,state:typeof F<"u"?Me(ut,F,c,a,u):c}),R(` Dynamic transition to ${A} found (via ${h})`))}if(d.length===0&&s&&t.length===1)return[{node:f.NodeType.InitialNode,state:Eo}];if(d.length===0)throw new dt.UnknownSyntaxError(t,r.filter(({node:l})=>l!==f.NodeType.ErrorNode).map(({state:l})=>({usage:l.candidateUsage,reason:null})));if(d.every(({node:l})=>l===f.NodeType.ErrorNode))throw new dt.UnknownSyntaxError(t,d.map(({state:l})=>({usage:l.candidateUsage,reason:l.errorMessage})));r=wo(d)}if(r.length>0){R(" Results:");for(let i of r)R(` - ${i.node} -> ${JSON.stringify(i.state)}`)}else R(" No results");return r}function vs(e,t,{endToken:n=f.SpecialToken.EndOfInput}={}){let r=vo(e,[...t,n]);return Bo(t,r.map(({state:o})=>o))}function wo(e){let t=0;for(let{state:n}of e)n.path.length>t&&(t=n.path.length);return e.filter(({state:n})=>n.path.length===t)}function Bo(e,t){let n=t.filter(c=>c.selectedIndex!==null);if(n.length===0)throw new Error;let r=n.filter(c=>c.selectedIndex===f.HELP_COMMAND_INDEX||c.requiredOptions.every(p=>p.some(D=>c.options.find(h=>h.name===D))));if(r.length===0)throw new dt.UnknownSyntaxError(e,n.map(c=>({usage:c.candidateUsage,reason:null})));let o=0;for(let c of r)c.path.length>o&&(o=c.path.length);let i=r.filter(c=>c.path.length===o),a=c=>c.positionals.filter(({extra:p})=>!p).length+c.options.length,s=i.map(c=>({state:c,positionalCount:a(c)})),u=0;for(let{positionalCount:c}of s)c>u&&(u=c);let d=s.filter(({positionalCount:c})=>c===u).map(({state:c})=>c),l=xo(d);if(l.length>1)throw new dt.AmbiguousSyntaxError(e,l.map(c=>c.candidateUsage));return l[0]}function xo(e){let t=[],n=[];for(let r of e)r.selectedIndex===f.HELP_COMMAND_INDEX?n.push(r):t.push(r);return n.length>0&&t.push({...Eo,path:ko(...n.map(r=>r.path)),options:n.reduce((r,o)=>r.concat(o.options),[])}),t}function ko(e,t,...n){return t===void 0?Array.from(e):ko(e.filter((r,o)=>r===t[o]),...n)}function j(){return{dynamics:[],shortcuts:[],statics:{}}}function Wt(e){return e===f.NodeType.SuccessNode||e===f.NodeType.ErrorNode}function at(e,t=0){return{to:Wt(e.to)?e.to:e.to>=f.NodeType.CustomNode?e.to+t-f.NodeType.CustomNode+1:e.to+t,reducer:e.reducer}}function Po(e,t=0){let n=j();for(let[r,o]of e.dynamics)n.dynamics.push([r,at(o,t)]);for(let r of e.shortcuts)n.shortcuts.push(at(r,t));for(let[r,o]of Object.entries(e.statics))n.statics[r]=o.map(i=>at(i,t));return n}function O(e,t,n,r,o){e.nodes[t].dynamics.push([n,{to:r,reducer:o}])}function le(e,t,n,r){e.nodes[t].shortcuts.push({to:n,reducer:r})}function I(e,t,n,r,o){(Object.prototype.hasOwnProperty.call(e.nodes[t].statics,n)?e.nodes[t].statics[n]:e.nodes[t].statics[n]=[]).push({to:r,reducer:o})}function Me(e,t,n,r,o){if(Array.isArray(t)){let[i,...a]=t;return e[i](n,r,o,...a)}else return e[t](n,r,o)}var Oo={always:()=>!0,isOptionLike:(e,t)=>!e.ignoreOptions&&t!=="-"&&t.startsWith("-"),isNotOptionLike:(e,t)=>e.ignoreOptions||t==="-"||!t.startsWith("-"),isOption:(e,t,n,r)=>!e.ignoreOptions&&t===r,isBatchOption:(e,t,n,r)=>!e.ignoreOptions&&f.BATCH_REGEX.test(t)&&[...t.slice(1)].every(o=>r.has(`-${o}`)),isBoundOption:(e,t,n,r,o)=>{let i=t.match(f.BINDING_REGEX);return!e.ignoreOptions&&!!i&&f.OPTION_REGEX.test(i[1])&&r.has(i[1])&&o.filter(a=>a.nameSet.includes(i[1])).every(a=>a.allowBinding)},isNegatedOption:(e,t,n,r)=>!e.ignoreOptions&&t===`--no-${r.slice(2)}`,isHelp:(e,t)=>!e.ignoreOptions&&f.HELP_REGEX.test(t),isUnsupportedOption:(e,t,n,r)=>!e.ignoreOptions&&t.startsWith("-")&&f.OPTION_REGEX.test(t)&&!r.has(t),isInvalidOption:(e,t)=>!e.ignoreOptions&&t.startsWith("-")&&!f.OPTION_REGEX.test(t)},ut={setCandidateState:(e,t,n,r)=>({...e,...r}),setSelectedIndex:(e,t,n,r)=>({...e,selectedIndex:r}),pushBatch:(e,t,n,r)=>{let o=e.options.slice(),i=e.tokens.slice();for(let a=1;a<t.length;++a){let s=r.get(`-${t[a]}`),u=a===1?[0,2]:[a,a+1];o.push({name:s,value:!0}),i.push({segmentIndex:n,type:"option",option:s,slice:u})}return{...e,options:o,tokens:i}},pushBound:(e,t,n)=>{let[,r,o]=t.match(f.BINDING_REGEX),i=e.options.concat({name:r,value:o}),a=e.tokens.concat([{segmentIndex:n,type:"option",slice:[0,r.length],option:r},{segmentIndex:n,type:"assign",slice:[r.length,r.length+1]},{segmentIndex:n,type:"value",slice:[r.length+1,r.length+o.length+1]}]);return{...e,options:i,tokens:a}},pushPath:(e,t,n)=>{let r=e.path.concat(t),o=e.tokens.concat({segmentIndex:n,type:"path"});return{...e,path:r,tokens:o}},pushPositional:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:!1}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushExtra:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:!0}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushExtraNoLimits:(e,t,n)=>{let r=e.positionals.concat({value:t,extra:X}),o=e.tokens.concat({segmentIndex:n,type:"positional"});return{...e,positionals:r,tokens:o}},pushTrue:(e,t,n,r)=>{let o=e.options.concat({name:r,value:!0}),i=e.tokens.concat({segmentIndex:n,type:"option",option:r});return{...e,options:o,tokens:i}},pushFalse:(e,t,n,r)=>{let o=e.options.concat({name:r,value:!1}),i=e.tokens.concat({segmentIndex:n,type:"option",option:r});return{...e,options:o,tokens:i}},pushUndefined:(e,t,n,r)=>{let o=e.options.concat({name:t,value:void 0}),i=e.tokens.concat({segmentIndex:n,type:"option",option:t});return{...e,options:o,tokens:i}},pushStringValue:(e,t,n)=>{var r;let o=e.options[e.options.length-1],i=e.options.slice(),a=e.tokens.concat({segmentIndex:n,type:"value"});return o.value=((r=o.value)!==null&&r!==void 0?r:[]).concat([t]),{...e,options:i,tokens:a}},setStringValue:(e,t,n)=>{let r=e.options[e.options.length-1],o=e.options.slice(),i=e.tokens.concat({segmentIndex:n,type:"value"});return r.value=t,{...e,options:o,tokens:i}},inhibateOptions:e=>({...e,ignoreOptions:!0}),useHelp:(e,t,n,r)=>{let[,,o]=t.match(f.HELP_REGEX);return typeof o<"u"?{...e,options:[{name:"-c",value:String(r)},{name:"-i",value:o}]}:{...e,options:[{name:"-c",value:String(r)}]}},setError:(e,t,n,r)=>t===f.SpecialToken.EndOfInput||t===f.SpecialToken.EndOfPartialInput?{...e,errorMessage:`${r}.`}:{...e,errorMessage:`${r} ("${t}").`},setOptionArityError:(e,t)=>{let n=e.options[e.options.length-1];return{...e,errorMessage:`Not enough arguments to option ${n.name}.`}}},X=Symbol(),ct=class{constructor(t,n){this.allOptionNames=new Map,this.arity={leading:[],trailing:[],extra:[],proxy:!1},this.options=[],this.paths=[],this.cliIndex=t,this.cliOpts=n}addPath(t){this.paths.push(t)}setArity({leading:t=this.arity.leading,trailing:n=this.arity.trailing,extra:r=this.arity.extra,proxy:o=this.arity.proxy}){Object.assign(this.arity,{leading:t,trailing:n,extra:r,proxy:o})}addPositional({name:t="arg",required:n=!0}={}){if(!n&&this.arity.extra===X)throw new Error("Optional parameters cannot be declared when using .rest() or .proxy()");if(!n&&this.arity.trailing.length>0)throw new Error("Optional parameters cannot be declared after the required trailing positional arguments");!n&&this.arity.extra!==X?this.arity.extra.push(t):this.arity.extra!==X&&this.arity.extra.length===0?this.arity.leading.push(t):this.arity.trailing.push(t)}addRest({name:t="arg",required:n=0}={}){if(this.arity.extra===X)throw new Error("Infinite lists cannot be declared multiple times in the same command");if(this.arity.trailing.length>0)throw new Error("Infinite lists cannot be declared after the required trailing positional arguments");for(let r=0;r<n;++r)this.addPositional({name:t});this.arity.extra=X}addProxy({required:t=0}={}){this.addRest({required:t}),this.arity.proxy=!0}addOption({names:t,description:n,arity:r=0,hidden:o=!1,required:i=!1,allowBinding:a=!0}){if(!a&&r>1)throw new Error("The arity cannot be higher than 1 when the option only supports the --arg=value syntax");if(!Number.isInteger(r))throw new Error(`The arity must be an integer, got ${r}`);if(r<0)throw new Error(`The arity must be positive, got ${r}`);let s=t.reduce((u,d)=>d.length>u.length?d:u,"");for(let u of t)this.allOptionNames.set(u,s);this.options.push({preferredName:s,nameSet:t,description:n,arity:r,hidden:o,required:i,allowBinding:a})}setContext(t){this.context=t}usage({detailed:t=!0,inlineOptions:n=!0}={}){let r=[this.cliOpts.binaryName],o=[];if(this.paths.length>0&&r.push(...this.paths[0]),t){for(let{preferredName:a,nameSet:s,arity:u,hidden:d,description:l,required:c}of this.options){if(d)continue;let p=[];for(let h=0;h<u;++h)p.push(` #${h}`);let D=`${s.join(",")}${p.join("")}`;!n&&l?o.push({preferredName:a,nameSet:s,definition:D,description:l,required:c}):r.push(c?`<${D}>`:`[${D}]`)}r.push(...this.arity.leading.map(a=>`<${a}>`)),this.arity.extra===X?r.push("..."):r.push(...this.arity.extra.map(a=>`[${a}]`)),r.push(...this.arity.trailing.map(a=>`<${a}>`))}return{usage:r.join(" "),options:o}}compile(){if(typeof this.context>"u")throw new Error("Assertion failed: No context attached");let t=Kt(),n=f.NodeType.InitialNode,r=this.usage().usage,o=this.options.filter(s=>s.required).map(s=>s.nameSet);n=G(t,j()),I(t,f.NodeType.InitialNode,f.SpecialToken.StartOfInput,n,["setCandidateState",{candidateUsage:r,requiredOptions:o}]);let i=this.arity.proxy?"always":"isNotOptionLike",a=this.paths.length>0?this.paths:[[]];for(let s of a){let u=n;if(s.length>0){let p=G(t,j());le(t,u,p),this.registerOptions(t,p),u=p}for(let p=0;p<s.length;++p){let D=G(t,j());if(I(t,u,s[p],D,"pushPath"),u=D,p+1<s.length){let h=G(t,j());O(t,u,"isHelp",h,["useHelp",this.cliIndex]),I(t,h,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",f.HELP_COMMAND_INDEX])}}if(this.arity.leading.length>0||!this.arity.proxy){let p=G(t,j());O(t,u,"isHelp",p,["useHelp",this.cliIndex]),O(t,p,"always",p,"pushExtra"),I(t,p,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",f.HELP_COMMAND_INDEX]),this.registerOptions(t,u)}this.arity.leading.length>0&&(I(t,u,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,u,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]));let d=u;for(let p=0;p<this.arity.leading.length;++p){let D=G(t,j());(!this.arity.proxy||p+1!==this.arity.leading.length)&&this.registerOptions(t,D),(this.arity.trailing.length>0||p+1!==this.arity.leading.length)&&(I(t,D,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,D,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])),O(t,d,"isNotOptionLike",D,"pushPositional"),d=D}let l=d;if(this.arity.extra===X||this.arity.extra.length>0){let p=G(t,j());if(le(t,d,p),this.arity.extra===X){let D=G(t,j());this.arity.proxy||this.registerOptions(t,D),O(t,d,i,D,"pushExtraNoLimits"),O(t,D,i,D,"pushExtraNoLimits"),le(t,D,p)}else for(let D=0;D<this.arity.extra.length;++D){let h=G(t,j());(!this.arity.proxy||D>0)&&this.registerOptions(t,h),O(t,l,i,h,"pushExtra"),le(t,h,p),l=h}l=p}this.arity.trailing.length>0&&(I(t,l,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,l,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]));let c=l;for(let p=0;p<this.arity.trailing.length;++p){let D=G(t,j());this.arity.proxy||this.registerOptions(t,D),p+1<this.arity.trailing.length&&(I(t,D,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,["setError","Not enough positional arguments"]),I(t,D,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])),O(t,c,"isNotOptionLike",D,"pushPositional"),c=D}O(t,c,i,f.NodeType.ErrorNode,["setError","Extraneous positional argument"]),I(t,c,f.SpecialToken.EndOfInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex]),I(t,c,f.SpecialToken.EndOfPartialInput,f.NodeType.SuccessNode,["setSelectedIndex",this.cliIndex])}return{machine:t,context:this.context}}registerOptions(t,n){O(t,n,["isOption","--"],n,"inhibateOptions"),O(t,n,["isBatchOption",this.allOptionNames],n,["pushBatch",this.allOptionNames]),O(t,n,["isBoundOption",this.allOptionNames,this.options],n,"pushBound"),O(t,n,["isUnsupportedOption",this.allOptionNames],f.NodeType.ErrorNode,["setError","Unsupported option name"]),O(t,n,["isInvalidOption"],f.NodeType.ErrorNode,["setError","Invalid option name"]);for(let r of this.options)if(r.arity===0)for(let o of r.nameSet)O(t,n,["isOption",o],n,["pushTrue",r.preferredName]),o.startsWith("--")&&!o.startsWith("--no-")&&O(t,n,["isNegatedOption",o],n,["pushFalse",r.preferredName]);else{let o=G(t,j());for(let i of r.nameSet)O(t,n,["isOption",i],o,["pushUndefined",r.preferredName]);for(let i=0;i<r.arity;++i){let a=G(t,j());I(t,o,f.SpecialToken.EndOfInput,f.NodeType.ErrorNode,"setOptionArityError"),I(t,o,f.SpecialToken.EndOfPartialInput,f.NodeType.ErrorNode,"setOptionArityError"),O(t,o,"isOptionLike",f.NodeType.ErrorNode,"setOptionArityError");let s=r.arity===1?"setStringValue":"pushStringValue";O(t,o,"isNotOptionLike",a,s),o=a}le(t,o,n)}}},Yt=class e{constructor({binaryName:t="..."}={}){this.builders=[],this.opts={binaryName:t}}static build(t,n={}){return new e(n).commands(t).compile()}getBuilderByIndex(t){if(!(t>=0&&t<this.builders.length))throw new Error(`Assertion failed: Out-of-bound command index (${t})`);return this.builders[t]}commands(t){for(let n of t)n(this.command());return this}command(){let t=new ct(this.builders.length,this.opts);return this.builders.push(t),t}compile(){let t=[],n=[];for(let o of this.builders){let{machine:i,context:a}=o.compile();t.push(i),n.push(a)}let r=Co(t);return yo(r),{machine:r,contexts:n,process:(o,{partial:i}={})=>{let a=i?f.SpecialToken.EndOfPartialInput:f.SpecialToken.EndOfInput;return vs(r,o,{endToken:a})}}}};B.CliBuilder=Yt;B.CommandBuilder=ct;B.NoLimits=X;B.aggregateHelpStates=xo;B.cloneNode=Po;B.cloneTransition=at;B.debug=R;B.debugMachine=bo;B.execute=Me;B.injectNode=G;B.isTerminalNode=Wt;B.makeAnyOfMachine=Co;B.makeNode=j;B.makeStateMachine=Kt;B.reducers=ut;B.registerDynamic=O;B.registerShortcut=le;B.registerStatic=I;B.runMachineInternal=vo;B.selectBestState=Bo;B.simplifyMachine=yo;B.tests=Oo;B.trimSmallerBranches=wo});var Io=w(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});var ws=require("tty");function Bs(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var Vt=Bs(ws);function xs(){return Vt.default&&"getColorDepth"in Vt.default.WriteStream.prototype?Vt.default.WriteStream.prototype.getColorDepth():process.env.FORCE_COLOR==="0"?1:process.env.FORCE_COLOR==="1"||typeof process.stdout<"u"&&process.stdout.isTTY?8:1}var So;function ks(e){let t=So;if(typeof t>"u"){if(e.stdout===process.stdout&&e.stderr===process.stderr)return null;let{AsyncLocalStorage:n}=require("async_hooks");t=So=new n;let r=process.stdout._write;process.stdout._write=function(i,a,s){let u=t.getStore();return typeof u>"u"?r.call(this,i,a,s):u.stdout.write(i,a,s)};let o=process.stderr._write;process.stderr._write=function(i,a,s){let u=t.getStore();return typeof u>"u"?o.call(this,i,a,s):u.stderr.write(i,a,s)}}return n=>t.run(e,n)}pt.getCaptureActivator=ks;pt.getDefaultColorDepth=xs});var To=w(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});var Ps=ue(),Zt=class e extends Ps.Command{constructor(t){super(),this.contexts=t,this.commands=[]}static from(t,n){let r=new e(n);r.path=t.path;for(let o of t.options)switch(o.name){case"-c":r.commands.push(Number(o.value));break;case"-i":r.index=Number(o.value);break}return r}async execute(){let t=this.commands;if(typeof this.index<"u"&&this.index>=0&&this.index<t.length&&(t=[t[this.index]]),t.length===0)this.context.stdout.write(this.cli.usage());else if(t.length===1)this.context.stdout.write(this.cli.usage(this.contexts[t[0]].commandClass,{detailed:!0}));else if(t.length>1){this.context.stdout.write(`Multiple commands match your selection:
|
|
38
38
|
`),this.context.stdout.write(`
|
|
39
39
|
`);let n=0;for(let r of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[r].commandClass,{prefix:`${n++}. `.padStart(5)}));this.context.stdout.write(`
|
|
40
40
|
`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.
|
|
41
|
-
`)}}};Xt.HelpCommand=Zt});var Mo=w(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});var Os=tt(),Ss=lt(),U=Gt(),jo=Io(),Dt=ue(),Is=To(),No=Symbol("clipanion/errorCommand");async function Ts(...e){let{resolvedOptions:t,resolvedCommandClasses:n,resolvedArgv:r,resolvedContext:o}=Lo(e);return be.from(n,t).runExit(r,o)}async function Ns(...e){let{resolvedOptions:t,resolvedCommandClasses:n,resolvedArgv:r,resolvedContext:o}=Lo(e);return be.from(n,t).run(r,o)}function Lo(e){let t,n,r,o;switch(typeof process<"u"&&typeof process.argv<"u"&&(r=process.argv.slice(2)),e.length){case 1:n=e[0];break;case 2:e[0]&&e[0].prototype instanceof Dt.Command||Array.isArray(e[0])?(n=e[0],Array.isArray(e[1])?r=e[1]:o=e[1]):(t=e[0],n=e[1]);break;case 3:Array.isArray(e[2])?(t=e[0],n=e[1],r=e[2]):e[0]&&e[0].prototype instanceof Dt.Command||Array.isArray(e[0])?(n=e[0],r=e[1],o=e[2]):(t=e[0],n=e[1],o=e[2]);break;default:t=e[0],n=e[1],r=e[2],o=e[3];break}if(typeof r>"u")throw new Error("The argv parameter must be provided when running Clipanion outside of a Node context");return{resolvedOptions:t,resolvedCommandClasses:n,resolvedArgv:r,resolvedContext:o}}var be=class e{constructor({binaryLabel:t,binaryName:n="...",binaryVersion:r,enableCapture:o=!1,enableColors:i}={}){this.registrations=new Map,this.builder=new Ss.CliBuilder({binaryName:n}),this.binaryLabel=t,this.binaryName=n,this.binaryVersion=r,this.enableCapture=o,this.enableColors=i}static from(t,n={}){let r=new e(n),o=Array.isArray(t)?t:[t];for(let i of o)r.register(i);return r}register(t){var n;let r=new Map,o=new t;for(let u in o){let
|
|
42
|
-
`),(
|
|
41
|
+
`)}}};Xt.HelpCommand=Zt});var Mo=w(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});var Os=tt(),Ss=lt(),U=Gt(),jo=Io(),Dt=ue(),Is=To(),No=Symbol("clipanion/errorCommand");async function Ts(...e){let{resolvedOptions:t,resolvedCommandClasses:n,resolvedArgv:r,resolvedContext:o}=Lo(e);return be.from(n,t).runExit(r,o)}async function Ns(...e){let{resolvedOptions:t,resolvedCommandClasses:n,resolvedArgv:r,resolvedContext:o}=Lo(e);return be.from(n,t).run(r,o)}function Lo(e){let t,n,r,o;switch(typeof process<"u"&&typeof process.argv<"u"&&(r=process.argv.slice(2)),e.length){case 1:n=e[0];break;case 2:e[0]&&e[0].prototype instanceof Dt.Command||Array.isArray(e[0])?(n=e[0],Array.isArray(e[1])?r=e[1]:o=e[1]):(t=e[0],n=e[1]);break;case 3:Array.isArray(e[2])?(t=e[0],n=e[1],r=e[2]):e[0]&&e[0].prototype instanceof Dt.Command||Array.isArray(e[0])?(n=e[0],r=e[1],o=e[2]):(t=e[0],n=e[1],o=e[2]);break;default:t=e[0],n=e[1],r=e[2],o=e[3];break}if(typeof r>"u")throw new Error("The argv parameter must be provided when running Clipanion outside of a Node context");return{resolvedOptions:t,resolvedCommandClasses:n,resolvedArgv:r,resolvedContext:o}}var be=class e{constructor({binaryLabel:t,binaryName:n="...",binaryVersion:r,enableCapture:o=!1,enableColors:i}={}){this.registrations=new Map,this.builder=new Ss.CliBuilder({binaryName:n}),this.binaryLabel=t,this.binaryName=n,this.binaryVersion=r,this.enableCapture=o,this.enableColors=i}static from(t,n={}){let r=new e(n),o=Array.isArray(t)?t:[t];for(let i of o)r.register(i);return r}register(t){var n;let r=new Map,o=new t;for(let u in o){let d=o[u];typeof d=="object"&&d!==null&&d[Dt.Command.isOption]&&r.set(u,d)}let i=this.builder.command(),a=i.cliIndex,s=(n=t.paths)!==null&&n!==void 0?n:o.paths;if(typeof s<"u")for(let u of s)i.addPath(u);this.registrations.set(t,{specs:r,builder:i,index:a});for(let[u,{definition:d}]of r.entries())d(i,u);i.setContext({commandClass:t})}process(t,n){let{input:r,context:o,partial:i}=typeof t=="object"&&Array.isArray(t)?{input:t,context:n}:t,{contexts:a,process:s}=this.builder.compile(),u=s(r,{partial:i}),d={...e.defaultContext,...o};switch(u.selectedIndex){case Os.HELP_COMMAND_INDEX:{let l=Is.HelpCommand.from(u,a);return l.context=d,l.tokens=u.tokens,l}default:{let{commandClass:l}=a[u.selectedIndex],c=this.registrations.get(l);if(typeof c>"u")throw new Error("Assertion failed: Expected the command class to have been registered.");let p=new l;p.context=d,p.tokens=u.tokens,p.path=u.path;try{for(let[D,{transformer:h}]of c.specs.entries())p[D]=h(c.builder,D,u,d);return p}catch(D){throw D[No]=p,D}}break}}async run(t,n){var r,o;let i,a={...e.defaultContext,...n},s=(r=this.enableColors)!==null&&r!==void 0?r:a.colorDepth>1;if(!Array.isArray(t))i=t;else try{i=this.process(t,a)}catch(l){return a.stdout.write(this.error(l,{colored:s})),1}if(i.help)return a.stdout.write(this.usage(i,{colored:s,detailed:!0})),0;i.context=a,i.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),definition:l=>this.definition(l),error:(l,c)=>this.error(l,c),format:l=>this.format(l),process:(l,c)=>this.process(l,{...a,...c}),run:(l,c)=>this.run(l,{...a,...c}),usage:(l,c)=>this.usage(l,c)};let u=this.enableCapture&&(o=jo.getCaptureActivator(a))!==null&&o!==void 0?o:Ro,d;try{d=await u(()=>i.validateAndExecute().catch(l=>i.catch(l).then(()=>0)))}catch(l){return a.stdout.write(this.error(l,{colored:s,command:i})),1}return d}async runExit(t,n){process.exitCode=await this.run(t,n)}definition(t,{colored:n=!1}={}){if(!t.usage)return null;let{usage:r}=this.getUsageByRegistration(t,{detailed:!1}),{usage:o,options:i}=this.getUsageByRegistration(t,{detailed:!0,inlineOptions:!1}),a=typeof t.usage.category<"u"?U.formatMarkdownish(t.usage.category,{format:this.format(n),paragraphs:!1}):void 0,s=typeof t.usage.description<"u"?U.formatMarkdownish(t.usage.description,{format:this.format(n),paragraphs:!1}):void 0,u=typeof t.usage.details<"u"?U.formatMarkdownish(t.usage.details,{format:this.format(n),paragraphs:!0}):void 0,d=typeof t.usage.examples<"u"?t.usage.examples.map(([l,c])=>[U.formatMarkdownish(l,{format:this.format(n),paragraphs:!1}),c.replace(/\$0/g,this.binaryName)]):void 0;return{path:r,usage:o,category:a,description:s,details:u,examples:d,options:i}}definitions({colored:t=!1}={}){let n=[];for(let r of this.registrations.keys()){let o=this.definition(r,{colored:t});o&&n.push(o)}return n}usage(t=null,{colored:n,detailed:r=!1,prefix:o="$ "}={}){var i;if(t===null){for(let u of this.registrations.keys()){let d=u.paths,l=typeof u.usage<"u";if(!d||d.length===0||d.length===1&&d[0].length===0||((i=d?.some(D=>D.length===0))!==null&&i!==void 0?i:!1))if(t){t=null;break}else t=u;else if(l){t=null;continue}}t&&(r=!0)}let a=t!==null&&t instanceof Dt.Command?t.constructor:t,s="";if(a)if(r){let{description:u="",details:d="",examples:l=[]}=a.usage||{};u!==""&&(s+=U.formatMarkdownish(u,{format:this.format(n),paragraphs:!1}).replace(/^./,D=>D.toUpperCase()),s+=`
|
|
42
|
+
`),(d!==""||l.length>0)&&(s+=`${this.format(n).header("Usage")}
|
|
43
43
|
`,s+=`
|
|
44
|
-
`);let{usage:
|
|
44
|
+
`);let{usage:c,options:p}=this.getUsageByRegistration(a,{inlineOptions:!1});if(s+=`${this.format(n).bold(o)}${c}
|
|
45
45
|
`,p.length>0){s+=`
|
|
46
46
|
`,s+=`${this.format(n).header("Options")}
|
|
47
47
|
`;let D=p.reduce((h,A)=>Math.max(h,A.definition.length),0);s+=`
|
|
48
|
-
`;for(let{definition:h,description:A}of p)s+=` ${this.format(n).bold(h.padEnd(D))} ${U.formatMarkdownish(A,{format:this.format(n),paragraphs:!1})}`}if(
|
|
48
|
+
`;for(let{definition:h,description:A}of p)s+=` ${this.format(n).bold(h.padEnd(D))} ${U.formatMarkdownish(A,{format:this.format(n),paragraphs:!1})}`}if(d!==""&&(s+=`
|
|
49
49
|
`,s+=`${this.format(n).header("Details")}
|
|
50
50
|
`,s+=`
|
|
51
|
-
`,s+=U.formatMarkdownish(
|
|
51
|
+
`,s+=U.formatMarkdownish(d,{format:this.format(n),paragraphs:!0})),l.length>0){s+=`
|
|
52
52
|
`,s+=`${this.format(n).header("Examples")}
|
|
53
53
|
`;for(let[D,h]of l)s+=`
|
|
54
54
|
`,s+=U.formatMarkdownish(D,{format:this.format(n),paragraphs:!1}),s+=`${h.replace(/^/m,` ${this.format(n).bold(o)}`).replace(/\$0/g,this.binaryName)}
|
|
55
55
|
`}}else{let{usage:u}=this.getUsageByRegistration(a);s+=`${this.format(n).bold(o)}${u}
|
|
56
|
-
`}else{let u=new Map;for(let[p,{index:D}]of this.registrations.entries()){if(typeof p.usage>"u")continue;let h=typeof p.usage.category<"u"?U.formatMarkdownish(p.usage.category,{format:this.format(n),paragraphs:!1}):null,A=u.get(h);typeof A>"u"&&u.set(h,A=[]);let{usage:F}=this.getUsageByIndex(D);A.push({commandClass:p,usage:F})}let
|
|
56
|
+
`}else{let u=new Map;for(let[p,{index:D}]of this.registrations.entries()){if(typeof p.usage>"u")continue;let h=typeof p.usage.category<"u"?U.formatMarkdownish(p.usage.category,{format:this.format(n),paragraphs:!1}):null,A=u.get(h);typeof A>"u"&&u.set(h,A=[]);let{usage:F}=this.getUsageByIndex(D);A.push({commandClass:p,usage:F})}let d=Array.from(u.keys()).sort((p,D)=>p===null?-1:D===null?1:p.localeCompare(D,"en",{usage:"sort",caseFirst:"upper"})),l=typeof this.binaryLabel<"u",c=typeof this.binaryVersion<"u";l||c?(l&&c?s+=`${this.format(n).header(`${this.binaryLabel} - ${this.binaryVersion}`)}
|
|
57
57
|
|
|
58
58
|
`:l?s+=`${this.format(n).header(`${this.binaryLabel}`)}
|
|
59
59
|
`:s+=`${this.format(n).header(`${this.binaryVersion}`)}
|
|
60
60
|
`,s+=` ${this.format(n).bold(o)}${this.binaryName} <command>
|
|
61
61
|
`):s+=`${this.format(n).bold(o)}${this.binaryName} <command>
|
|
62
|
-
`;for(let p of
|
|
62
|
+
`;for(let p of d){let D=u.get(p).slice().sort((A,F)=>A.usage.localeCompare(F.usage,"en",{usage:"sort",caseFirst:"upper"})),h=p!==null?p.trim():"General commands";s+=`
|
|
63
63
|
`,s+=`${this.format(n).header(`${h}`)}
|
|
64
64
|
`;for(let{commandClass:A,usage:F}of D){let C=A.usage.description||"undocumented";s+=`
|
|
65
65
|
`,s+=` ${this.format(n).bold(F)}
|
|
@@ -68,9 +68,9 @@ ${t.map(n=>`
|
|
|
68
68
|
`;let u=t.clipanion;return typeof u<"u"?u.type==="usage"&&(a+=`
|
|
69
69
|
`,a+=this.usage(i)):t.stack&&(a+=`${t.stack.replace(/^.*\n/,"")}
|
|
70
70
|
`),a}format(t){var n;return((n=t??this.enableColors)!==null&&n!==void 0?n:e.defaultContext.colorDepth>1)?U.richFormat:U.textFormat}getUsageByRegistration(t,n){let r=this.registrations.get(t);if(typeof r>"u")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(r.index,n)}getUsageByIndex(t,n){return this.builder.getBuilderByIndex(t).usage(n)}};be.defaultContext={env:process.env,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:jo.getDefaultColorDepth()};function Ro(e){return e()}He.Cli=be;He.run=Ns;He.runExit=Ts});var Ho=w(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});var Rs=ue(),ft=class extends Rs.Command{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
|
|
71
|
-
`)}};ft.paths=[["--clipanion=definitions"]];Jt.DefinitionsCommand=ft});var Go=w(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});var js=ue(),ht=class extends js.Command{async execute(){this.context.stdout.write(this.cli.usage())}};ht.paths=[["-h"],["--help"]];_t.HelpCommand=ht});var en=w($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});var Ls=$();function Ms(e={}){return Ls.makeCommandOption({definition(t,n){var r;t.addProxy({name:(r=e.name)!==null&&r!==void 0?r:n,required:e.required})},transformer(t,n,r){return r.positionals.map(({value:o})=>o)}})}$t.Proxy=Ms});var Uo=w(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});var Hs=ue(),Gs=en(),
|
|
72
|
-
`)}};
|
|
73
|
-
`)}};mt.paths=[["-v"],["--version"]];nn.VersionCommand=mt});var qo=w(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});var zs=Ho(),qs=Go(),Qs=Uo(),Ys=zo();ve.DefinitionsCommand=zs.DefinitionsCommand;ve.HelpCommand=qs.HelpCommand;ve.TokensCommand=Qs.TokensCommand;ve.VersionCommand=Ys.VersionCommand});var Qo=w(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});var on=$();function Ks(e,t,n){let[r,o]=on.rerouteArguments(t,n??{}),{arity:i=1}=o,a=e.split(","),s=new Set(a);return on.makeCommandOption({definition(u){u.addOption({names:a,arity:i,hidden:o?.hidden,description:o?.description,required:o.required})},transformer(u,c,l){let d,p=typeof r<"u"?[...r]:void 0;for(let{name:D,value:h}of l.options)s.has(D)&&(d=D,p=p??[],p.push(h));return typeof p<"u"?on.applyValidator(d??c,p,o.validator):p}})}rn.Array=Ks});var Ko=w(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});var Yo=$();function Ws(e,t,n){let[r,o]=Yo.rerouteArguments(t,n??{}),i=e.split(","),a=new Set(i);return Yo.makeCommandOption({definition(s){s.addOption({names:i,allowBinding:!1,arity:0,hidden:o.hidden,description:o.description,required:o.required})},transformer(s,u,c){let l=r;for(let{name:d,value:p}of c.options)a.has(d)&&(l=p);return l}})}sn.Boolean=Ws});var Vo=w(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});var Wo=$();function Vs(e,t,n){let[r,o]=Wo.rerouteArguments(t,n??{}),i=e.split(","),a=new Set(i);return Wo.makeCommandOption({definition(s){s.addOption({names:i,allowBinding:!1,arity:0,hidden:o.hidden,description:o.description,required:o.required})},transformer(s,u,c){let l=r;for(let{name:d,value:p}of c.options)a.has(d)&&(l??(l=0),p?l+=1:l=0);return l}})}an.Counter=Vs});var Zo=w(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});var Zs=lt(),Xs=$();function Js(e={}){return Xs.makeCommandOption({definition(t,n){var r;t.addRest({name:(r=e.name)!==null&&r!==void 0?r:n,required:e.required})},transformer(t,n,r){let o=a=>{let s=r.positionals[a];return s.extra===Zs.NoLimits||s.extra===!1&&a<t.arity.leading.length},i=0;for(;i<r.positionals.length&&o(i);)i+=1;return r.positionals.splice(0,i).map(({value:a})=>a)}})}un.Rest=Js});var Xo=w(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});var _s=lt(),Ge=$();function $s(e,t,n){let[r,o]=Ge.rerouteArguments(t,n??{}),{arity:i=1}=o,a=e.split(","),s=new Set(a);return Ge.makeCommandOption({definition(u){u.addOption({names:a,arity:o.tolerateBoolean?0:i,hidden:o.hidden,description:o.description,required:o.required})},transformer(u,c,l,d){let p,D=r;typeof o.env<"u"&&d.env[o.env]&&(p=o.env,D=d.env[o.env]);for(let{name:h,value:A}of l.options)s.has(h)&&(p=h,D=A);return typeof D=="string"?Ge.applyValidator(p??c,D,o.validator):D}})}function ea(e={}){let{required:t=!0}=e;return Ge.makeCommandOption({definition(n,r){var o;n.addPositional({name:(o=e.name)!==null&&o!==void 0?o:r,required:e.required})},transformer(n,r,o){var i;for(let a=0;a<o.positionals.length;++a){if(o.positionals[a].extra===_s.NoLimits||t&&o.positionals[a].extra===!0||!t&&o.positionals[a].extra===!1)continue;let[s]=o.positionals.splice(a,1);return Ge.applyValidator((i=e.name)!==null&&i!==void 0?i:r,s.value,e.validator)}}})}function ta(e,...t){return typeof e=="string"?$s(e,...t):ea(e)}cn.String=ta});var Jo=w(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});var we=$(),na=en(),oa=Qo(),ra=Ko(),ia=Vo(),sa=Zo(),aa=Xo();L.applyValidator=we.applyValidator;L.cleanValidationError=we.cleanValidationError;L.formatError=we.formatError;L.isOptionSymbol=we.isOptionSymbol;L.makeCommandOption=we.makeCommandOption;L.rerouteArguments=we.rerouteArguments;L.Proxy=na.Proxy;L.Array=oa.Array;L.Boolean=ra.Boolean;L.Counter=ia.Counter;L.Rest=sa.Rest;L.String=aa.String});var ln=w(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});var ua=nt(),ca=Gt(),da=ue(),dn=Mo(),la=qo(),pa=Jo();J.UsageError=ua.UsageError;J.formatMarkdownish=ca.formatMarkdownish;J.Command=da.Command;J.Cli=dn.Cli;J.run=dn.run;J.runExit=dn.runExit;J.Builtins=la;J.Option=pa});var Dr=w((Uc,pr)=>{"use strict";pr.exports=Ca;function Ea(e){let t={defaultWidth:0,output:process.stdout,tty:require("tty")};return e?(Object.keys(t).forEach(function(n){e[n]||(e[n]=t[n])}),e):t}function Ca(e){let t=Ea(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let n=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(n)&&n!==0)return n}return t.defaultWidth}});var Fr=w((Zc,Ar)=>{Ar.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Sr=w((pd,Or)=>{var ja=require("stream"),yn=class extends ja{#n=null;constructor(t={}){super(t),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=t.replace,this._prompt=t.prompt||null,this._hadControl=!1}#t(t,n){return this._dest?this._dest[t]:this._src?this._src[t]:n}#e(t,...n){typeof this._dest?.[t]=="function"&&this._dest[t](...n),typeof this._src?.[t]=="function"&&this._src[t](...n)}get isTTY(){return this.#n!==null?this.#n:this.#t("isTTY",!1)}set isTTY(t){this.#n=t}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(t){this._src=t}pipe(t,n){return this._dest=t,super.pipe(t,n)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(t){if(this.muted){if(!this.replace)return!0;if(t.match(/^\u001b/))return t.indexOf(this._prompt)===0&&(t=t.slice(this._prompt.length),t=t.replace(/./g,this.replace),t=this._prompt+t),this._hadControl=!0,this.emit("data",t);this._prompt&&this._hadControl&&t.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),t=t.slice(this._prompt.length)),t=t.toString().replace(/./g,this.replace)}this.emit("data",t)}end(t){this.muted&&(t&&this.replace?t=t.toString().replace(/./g,this.replace):t=null),t&&this.emit("data",t),this.emit("end")}destroy(...t){return this.#e("destroy",...t)}destroySoon(...t){return this.#e("destroySoon",...t)}close(...t){return this.#e("close",...t)}};Or.exports=yn});var _e=Q(ln());var z=Q(ln()),si=Q(require("node:path"));var Be=require("node:util");var ce=require("node:util"),ee=e=>(0,ce.styleText)(["bgMagenta","white","bold"],e),T=e=>(0,ce.styleText)(["dim"],e),_o=e=>(0,ce.styleText)(["bold"],e),pn=e=>(0,ce.styleText)(["bold","green"],e),pe=e=>(0,ce.styleText)(["bold","red"],e),M=e=>(0,ce.styleText)(["bold","cyan"],e),v=e=>(0,ce.styleText)(["magentaBright","bold"],e);var $o=`
|
|
71
|
+
`)}};ft.paths=[["--clipanion=definitions"]];Jt.DefinitionsCommand=ft});var Go=w(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});var js=ue(),ht=class extends js.Command{async execute(){this.context.stdout.write(this.cli.usage())}};ht.paths=[["-h"],["--help"]];_t.HelpCommand=ht});var en=w($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});var Ls=$();function Ms(e={}){return Ls.makeCommandOption({definition(t,n){var r;t.addProxy({name:(r=e.name)!==null&&r!==void 0?r:n,required:e.required})},transformer(t,n,r){return r.positionals.map(({value:o})=>o)}})}$t.Proxy=Ms});var Uo=w(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});var Hs=ue(),Gs=en(),mt=class extends Hs.Command{constructor(){super(...arguments),this.args=Gs.Proxy()}async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.process(this.args).tokens,null,2)}
|
|
72
|
+
`)}};mt.paths=[["--clipanion=tokens"]];tn.TokensCommand=mt});var zo=w(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});var Us=ue(),gt=class extends Us.Command{async execute(){var t;this.context.stdout.write(`${(t=this.cli.binaryVersion)!==null&&t!==void 0?t:"<unknown>"}
|
|
73
|
+
`)}};gt.paths=[["-v"],["--version"]];nn.VersionCommand=gt});var qo=w(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});var zs=Ho(),qs=Go(),Qs=Uo(),Ys=zo();ve.DefinitionsCommand=zs.DefinitionsCommand;ve.HelpCommand=qs.HelpCommand;ve.TokensCommand=Qs.TokensCommand;ve.VersionCommand=Ys.VersionCommand});var Qo=w(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});var on=$();function Ks(e,t,n){let[r,o]=on.rerouteArguments(t,n??{}),{arity:i=1}=o,a=e.split(","),s=new Set(a);return on.makeCommandOption({definition(u){u.addOption({names:a,arity:i,hidden:o?.hidden,description:o?.description,required:o.required})},transformer(u,d,l){let c,p=typeof r<"u"?[...r]:void 0;for(let{name:D,value:h}of l.options)s.has(D)&&(c=D,p=p??[],p.push(h));return typeof p<"u"?on.applyValidator(c??d,p,o.validator):p}})}rn.Array=Ks});var Ko=w(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});var Yo=$();function Ws(e,t,n){let[r,o]=Yo.rerouteArguments(t,n??{}),i=e.split(","),a=new Set(i);return Yo.makeCommandOption({definition(s){s.addOption({names:i,allowBinding:!1,arity:0,hidden:o.hidden,description:o.description,required:o.required})},transformer(s,u,d){let l=r;for(let{name:c,value:p}of d.options)a.has(c)&&(l=p);return l}})}sn.Boolean=Ws});var Vo=w(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});var Wo=$();function Vs(e,t,n){let[r,o]=Wo.rerouteArguments(t,n??{}),i=e.split(","),a=new Set(i);return Wo.makeCommandOption({definition(s){s.addOption({names:i,allowBinding:!1,arity:0,hidden:o.hidden,description:o.description,required:o.required})},transformer(s,u,d){let l=r;for(let{name:c,value:p}of d.options)a.has(c)&&(l??(l=0),p?l+=1:l=0);return l}})}an.Counter=Vs});var Zo=w(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});var Zs=lt(),Xs=$();function Js(e={}){return Xs.makeCommandOption({definition(t,n){var r;t.addRest({name:(r=e.name)!==null&&r!==void 0?r:n,required:e.required})},transformer(t,n,r){let o=a=>{let s=r.positionals[a];return s.extra===Zs.NoLimits||s.extra===!1&&a<t.arity.leading.length},i=0;for(;i<r.positionals.length&&o(i);)i+=1;return r.positionals.splice(0,i).map(({value:a})=>a)}})}un.Rest=Js});var Xo=w(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});var _s=lt(),Ge=$();function $s(e,t,n){let[r,o]=Ge.rerouteArguments(t,n??{}),{arity:i=1}=o,a=e.split(","),s=new Set(a);return Ge.makeCommandOption({definition(u){u.addOption({names:a,arity:o.tolerateBoolean?0:i,hidden:o.hidden,description:o.description,required:o.required})},transformer(u,d,l,c){let p,D=r;typeof o.env<"u"&&c.env[o.env]&&(p=o.env,D=c.env[o.env]);for(let{name:h,value:A}of l.options)s.has(h)&&(p=h,D=A);return typeof D=="string"?Ge.applyValidator(p??d,D,o.validator):D}})}function ea(e={}){let{required:t=!0}=e;return Ge.makeCommandOption({definition(n,r){var o;n.addPositional({name:(o=e.name)!==null&&o!==void 0?o:r,required:e.required})},transformer(n,r,o){var i;for(let a=0;a<o.positionals.length;++a){if(o.positionals[a].extra===_s.NoLimits||t&&o.positionals[a].extra===!0||!t&&o.positionals[a].extra===!1)continue;let[s]=o.positionals.splice(a,1);return Ge.applyValidator((i=e.name)!==null&&i!==void 0?i:r,s.value,e.validator)}}})}function ta(e,...t){return typeof e=="string"?$s(e,...t):ea(e)}dn.String=ta});var Jo=w(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});var we=$(),na=en(),oa=Qo(),ra=Ko(),ia=Vo(),sa=Zo(),aa=Xo();L.applyValidator=we.applyValidator;L.cleanValidationError=we.cleanValidationError;L.formatError=we.formatError;L.isOptionSymbol=we.isOptionSymbol;L.makeCommandOption=we.makeCommandOption;L.rerouteArguments=we.rerouteArguments;L.Proxy=na.Proxy;L.Array=oa.Array;L.Boolean=ra.Boolean;L.Counter=ia.Counter;L.Rest=sa.Rest;L.String=aa.String});var ln=w(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});var ua=nt(),da=Gt(),ca=ue(),cn=Mo(),la=qo(),pa=Jo();J.UsageError=ua.UsageError;J.formatMarkdownish=da.formatMarkdownish;J.Command=ca.Command;J.Cli=cn.Cli;J.run=cn.run;J.runExit=cn.runExit;J.Builtins=la;J.Option=pa});var Dr=w((Ud,pr)=>{"use strict";pr.exports=Ca;function Ea(e){let t={defaultWidth:0,output:process.stdout,tty:require("tty")};return e?(Object.keys(t).forEach(function(n){e[n]||(e[n]=t[n])}),e):t}function Ca(e){let t=Ea(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let n=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(n)&&n!==0)return n}return t.defaultWidth}});var Fr=w((Zd,Ar)=>{Ar.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Sr=w((pc,Or)=>{var ja=require("stream"),yn=class extends ja{#n=null;constructor(t={}){super(t),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=t.replace,this._prompt=t.prompt||null,this._hadControl=!1}#t(t,n){return this._dest?this._dest[t]:this._src?this._src[t]:n}#e(t,...n){typeof this._dest?.[t]=="function"&&this._dest[t](...n),typeof this._src?.[t]=="function"&&this._src[t](...n)}get isTTY(){return this.#n!==null?this.#n:this.#t("isTTY",!1)}set isTTY(t){this.#n=t}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(t){this._src=t}pipe(t,n){return this._dest=t,super.pipe(t,n)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(t){if(this.muted){if(!this.replace)return!0;if(t.match(/^\u001b/))return t.indexOf(this._prompt)===0&&(t=t.slice(this._prompt.length),t=t.replace(/./g,this.replace),t=this._prompt+t),this._hadControl=!0,this.emit("data",t);this._prompt&&this._hadControl&&t.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),t=t.slice(this._prompt.length)),t=t.toString().replace(/./g,this.replace)}this.emit("data",t)}end(t){this.muted&&(t&&this.replace?t=t.toString().replace(/./g,this.replace):t=null),t&&this.emit("data",t),this.emit("end")}destroy(...t){return this.#e("destroy",...t)}destroySoon(...t){return this.#e("destroySoon",...t)}close(...t){return this.#e("close",...t)}};Or.exports=yn});var _e=Q(ln());var z=Q(ln()),si=Q(require("node:path"));var Be=require("node:util");var de=require("node:util"),ee=e=>(0,de.styleText)(["bgMagenta","white","bold"],e),T=e=>(0,de.styleText)(["dim"],e),_o=e=>(0,de.styleText)(["bold"],e),pn=e=>(0,de.styleText)(["bold","green"],e),pe=e=>(0,de.styleText)(["bold","red"],e),M=e=>(0,de.styleText)(["bold","cyan"],e),v=e=>(0,de.styleText)(["magentaBright","bold"],e);var $o=`
|
|
74
74
|
${ee(" ")}
|
|
75
75
|
${ee(" \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 ")}
|
|
76
76
|
${ee(" \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588 ")}
|
|
@@ -86,11 +86,11 @@ ${ee("
|
|
|
86
86
|
${M("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551")}
|
|
87
87
|
${M("\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551")}
|
|
88
88
|
${M("\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D")}
|
|
89
|
-
`;function er(e,t=2,n=1){let o=Math.max(...e.map(s=>(0,Be.stripVTControlCharacters)(s).length))+t*2,i=`|${" ".repeat(o+2)}|`,a=[` .\xB7${"\xAF".repeat(o-4)}\xB7. `];for(let s=0;s<n-1;s++)a.push(i);for(let[s,u]of e.entries()){let
|
|
89
|
+
`;function er(e,t=2,n=1){let o=Math.max(...e.map(s=>(0,Be.stripVTControlCharacters)(s).length))+t*2,i=`|${" ".repeat(o+2)}|`,a=[` .\xB7${"\xAF".repeat(o-4)}\xB7. `];for(let s=0;s<n-1;s++)a.push(i);for(let[s,u]of e.entries()){let d=(0,Be.stripVTControlCharacters)(u).length,l=o-t-d,c=s===0?"/":s===e.length-1?"\\":"|",p=s===0?"\\":s===e.length-1?"/":"|";a.push(`${c}${" ".repeat(t)}${u}${" ".repeat(l)}${p}`)}for(let s=0;s<n-1;s++)a.push(i);return a.push(` \xB7.${"_".repeat(o-4)}.\xB7 `),a}var Dn=()=>{let e=["",M(" Good Bye!"),"\u{1F44B} until next time!",""],t=er(e);return nr(t)},tr=e=>{let t=[`${M(e.name)} is ready!`,"","Next steps:",` 1. ${pn(`cd ${e.directory}`)}`,` 2. ${pn("npm run dev")}`],n=er(t);return nr(n)},nr=e=>{let t=[` ${v("___")}`,` ${v("___ (DATADOG\\")}`,` ${v("/DATAD) __/O/_/___ \\DAT\\ADOG\\")}`,` ${v("/DATADOGDATADOGDATADOGDATA| \\ATA)")}`,v("(DATADOGD TADOGDATADOGDATAD\\ |TA/"),v("(DATADOGD) )ATADOGDATADOGDAT)"),` ${v("\\DATADOG) )DATADOGDATADOG\xAF\xAF\\")}`,` ${v("\\DATAD/ )OGDA/\xAF\xAF\xAFTADOGDA .|")}`,` ${v(" \xAF\xAF\xAF /DATADO .GDATADOGD\\")}`,` ${v("|DATADOGDATADOGDATADOGDATA\\")}`,` ${v("|DATADOGDATADOGDATADOG\xAF\xAF\xAF\xAFD)")}`,` ${v("\\DATADOGDATADOGDATADO\\__/DA)")}`,` ${v("\\DATADOGDATADOGDATADOGDATA) __.")}`,` ${v("\\DATADOG\\ \\DATADOG/ |A/ ____/TADOG|")}`,` ${v(")DATADOGD\\_ _/ATADOGDATADOGDAT|")}`,` ${v(")DATADO |OGDATADOGDATADOGDATADOG/|D|")}`,` ${v("/DATADOG |DATADOGDATADOGDA/\\TADO/ |A|")}`,` ${v("/DATADOGD |ATADOGDATADOGDA/ \\GD/ |T|")}`,` ${v("/D\\._ \xAF\\ATA |DATAD/\\DOGDAT/ \\/ |A|")}`,` ${v("/DATADOG\\ \\DA |TADO/ \\GD/ |D|")}`,` ${v("(DATADOGDA\\ \\| |TAD/ \\/ |O|")}`,` ${v("(DATADOGDAT\\ \\ |AD/ ___/DATADOG|")}`,` ${v("\\DATADOGDAT) |A| _/DATADOG/\xAF")}`,` ${v("\\DATADOGDA) |T/\xAF")}`,` ${v("\\DATADO/")}`,` ${v("\xAF\xAF\xAF")}`],n=e.length-3,r=12-e.length,o=[],a=36+Math.max(...e.map(s=>(0,Be.stripVTControlCharacters)(s).length));for(let[s,u]of t.entries()){let d=s-r;if(d>=0&&d<e.length){let l=e[d]||"",c=a-((0,Be.stripVTControlCharacters)(u).length+(0,Be.stripVTControlCharacters)(l).length);d===n&&(l=l.replace(/^./,"< "),c-=1);let p=" ".repeat(c);o.push(`${u}${p}${l}`)}else o.push(u)}return`
|
|
90
90
|
${o.join(`
|
|
91
91
|
`)}
|
|
92
|
-
`};var Ue=(e,t=[])=>e.name==="up"||t.includes("vim")&&e.name==="k"||t.includes("emacs")&&e.ctrl&&e.name==="p",At=(e,t=[])=>e.name==="down"||t.includes("vim")&&e.name==="j"||t.includes("emacs")&&e.ctrl&&e.name==="n";var ze=e=>e.name==="backspace",qe=e=>e.name==="tab",fn=e=>"1234567890".includes(e.name),De=e=>e.name==="enter"||e.name==="return";var Ft=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(t){super(),this.cause=t?.cause}},Et=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Qe=class extends Error{name="ExitPromptError"},Ct=class extends Error{name="HookError"},xe=class extends Error{name="ValidationError"};var sr=require("node:async_hooks");var yt=require("node:async_hooks");var or=new yt.AsyncLocalStorage;function Da(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function rr(e,t){let n=Da(e);return or.run(n,()=>{function r(o){n.handleChange=()=>{n.index=0,o()},n.handleChange()}return t(r)})}function fe(){let e=or.getStore();if(!e)throw new Ct("[Inquirer] Hook functions can only be called from within a prompt");return e}function hn(){return fe().rl}function gn(e){let t=(...n)=>{let r=fe(),o=!1,i=r.handleChange;r.handleChange=()=>{o=!0};let a=e(...n);return o&&i(),r.handleChange=i,a};return yt.AsyncResource.bind(t)}function ke(e){let t=fe(),{index:n}=t,r={get(){return t.hooks[n]},set(i){t.hooks[n]=i},initialized:n in t.hooks},o=e(r);return t.index++,o}function ir(){fe().handleChange()}var he={queue(e){let t=fe(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(hn());if(r!=null&&typeof r!="function")throw new xe("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[n]=r})},run(){let e=fe();gn(()=>{e.hooksEffect.forEach(t=>{t()}),e.hooksEffect.length=0})()},clearAll(){let e=fe();e.hooksCleanup.forEach(t=>{t?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function N(e){return ke(t=>{let n=sr.AsyncResource.bind(function(i){t.get()!==i&&(t.set(i),ir())});if(t.initialized)return[t.get(),n];let r=typeof e=="function"?e():e;return t.set(r),[r,n]})}function te(e,t){ke(n=>{let r=n.get();(!Array.isArray(r)||t.some((i,a)=>!Object.is(i,r[a])))&&he.queue(e),n.set(t)})}var K=require("node:util");var W=Q(require("node:process"),1);function fa(){return W.default.platform!=="win32"?W.default.env.TERM!=="linux":!!W.default.env.WT_SESSION||!!W.default.env.TERMINUS_SUBLIME||W.default.env.ConEmuTask==="{cmd::Cmder}"||W.default.env.TERM_PROGRAM==="Terminus-Sublime"||W.default.env.TERM_PROGRAM==="vscode"||W.default.env.TERM==="xterm-256color"||W.default.env.TERM==="alacritty"||W.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ar={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},ur={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},ha={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},ga={...ar,...ur},ma={...ar,...ha},Aa=fa(),Fa=Aa?ga:ma,Pe=Fa,bc=Object.entries(ur);var cr={prefix:{idle:(0,K.styleText)("blue","?"),done:(0,K.styleText)("green",Pe.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(e=>(0,K.styleText)("yellow",e))},style:{answer:e=>(0,K.styleText)("cyan",e),message:e=>(0,K.styleText)("bold",e),error:e=>(0,K.styleText)("red",`> ${e}`),defaultAnswer:e=>(0,K.styleText)("dim",`(${e})`),help:e=>(0,K.styleText)("dim",e),highlight:e=>(0,K.styleText)("cyan",e),key:e=>(0,K.styleText)("cyan",(0,K.styleText)("bold",`<${e}>`))}};function dr(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function lr(...e){let t={};for(let n of e)for(let[r,o]of Object.entries(n)){let i=t[r];t[r]=dr(i)&&dr(o)?lr(i,o):o}return t}function ne(...e){let t=[cr,...e.filter(n=>n!=null)];return lr(...t)}function ge({status:e="idle",theme:t}){let[n,r]=N(!1),[o,i]=N(0),{prefix:a,spinner:s}=ne(t);return te(()=>{if(e==="loading"){let c,l=-1,d=setTimeout(()=>{r(!0),c=setInterval(()=>{l=l+1,i(l%s.frames.length)},s.interval)},300);return()=>{clearTimeout(d),clearInterval(c)}}else r(!1)},[e]),n?s.frames[o]:typeof a=="string"?a:a[e==="loading"?"idle":e]??a.idle}function Ye(e,t){return ke(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((o,i)=>o!==t[i])){let o=e();return n.set({value:o,dependencies:t}),o}return r.value})}function me(e){return N({current:e})[0]}function Ae(e){let t=me(e);t.current=e,te(n=>{let r=!1,o=gn((i,a)=>{r||t.current(a,n)});return n.input.on("keypress",o),()=>{r=!0,n.input.removeListener("keypress",o)}},[])}var Pr=Q(Dr(),1);function mn({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}var ya=mn();function Ke(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(ya,"")}function fr(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function hr(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function gr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function ba(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function mr(e,{ambiguousAsWide:t=!1}={}){return ba(e),hr(e)||gr(e)||t&&fr(e)?2:1}var Er=Q(Fr(),1),va=new Intl.Segmenter,wa=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function Fe(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=Ke(e)),e.length===0)return 0;let o=0,i={ambiguousAsWide:!n};for(let{segment:a}of va.segment(e)){let s=a.codePointAt(0);if(!(s<=31||s>=127&&s<=159)&&!(s>=8203&&s<=8207||s===65279)&&!(s>=768&&s<=879||s>=6832&&s<=6911||s>=7616&&s<=7679||s>=8400&&s<=8447||s>=65056&&s<=65071)&&!(s>=55296&&s<=57343)&&!(s>=65024&&s<=65039)&&!wa.test(a)){if((0,Er.default)().test(a)){o+=2;continue}o+=mr(s,i)}}return o}var Cr=(e=0)=>t=>`\x1B[${t+e}m`,yr=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,br=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,x={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},$c=Object.keys(x.modifier),Ba=Object.keys(x.color),xa=Object.keys(x.bgColor),ed=[...Ba,...xa];function ka(){let e=new Map;for(let[t,n]of Object.entries(x)){for(let[r,o]of Object.entries(n))x[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[r]=x[r],e.set(o[0],o[1]);Object.defineProperty(x,t,{value:n,enumerable:!1})}return Object.defineProperty(x,"codes",{value:e,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=Cr(),x.color.ansi256=yr(),x.color.ansi16m=br(),x.bgColor.ansi=Cr(10),x.bgColor.ansi256=yr(10),x.bgColor.ansi16m=br(10),Object.defineProperties(x,{rgbToAnsi256:{value:(t,n,r)=>t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(i=>i+i).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>x.rgbToAnsi256(...x.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,o;if(t>=232)n=((t-232)*10+8)/255,r=n,o=n;else{t-=16;let s=t%36;n=Math.floor(t/36)/5,r=Math.floor(s/6)/5,o=s%6/5}let i=Math.max(n,r,o)*2;if(i===0)return 30;let a=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(n));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>x.ansi256ToAnsi(x.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>x.ansi256ToAnsi(x.hexToAnsi256(t)),enumerable:!1}}),x}var Pa=ka(),vr=Pa;var vt=new Set(["\x1B","\x9B"]),Oa=39,Fn="\x07",xr="[",Sa="]",kr="m",bt=`${Sa}8;;`,wr=e=>`${vt.values().next().value}${xr}${e}${kr}`,Br=e=>`${vt.values().next().value}${bt}${e}${Fn}`,Ia=e=>e.split(" ").map(t=>Fe(t)),An=(e,t,n)=>{let r=[...t],o=!1,i=!1,a=Fe(Ke(e.at(-1)));for(let[s,u]of r.entries()){let c=Fe(u);if(a+c<=n?e[e.length-1]+=u:(e.push(u),a=0),vt.has(u)&&(o=!0,i=r.slice(s+1,s+1+bt.length).join("")===bt),o){i?u===Fn&&(o=!1,i=!1):u===kr&&(o=!1);continue}a+=c,a===n&&s<r.length-1&&(e.push(""),a=0)}!a&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Ta=e=>{let t=e.split(" "),n=t.length;for(;n>0&&!(Fe(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},Na=(e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",o,i,a=Ia(e),s=[""];for(let[d,p]of e.split(" ").entries()){n.trim!==!1&&(s[s.length-1]=s.at(-1).trimStart());let D=Fe(s.at(-1));if(d!==0&&(D>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(""),D=0),(D>0||n.trim===!1)&&(s[s.length-1]+=" ",D++)),n.hard&&a[d]>t){let h=t-D,A=1+Math.floor((a[d]-h-1)/t);Math.floor((a[d]-1)/t)<A&&s.push(""),An(s,p,t);continue}if(D+a[d]>t&&D>0&&a[d]>0){if(n.wordWrap===!1&&D<t){An(s,p,t);continue}s.push("")}if(D+a[d]>t&&n.wordWrap===!1){An(s,p,t);continue}s[s.length-1]+=p}n.trim!==!1&&(s=s.map(d=>Ta(d)));let u=s.join(`
|
|
93
|
-
`),
|
|
92
|
+
`};var Ue=(e,t=[])=>e.name==="up"||t.includes("vim")&&e.name==="k"||t.includes("emacs")&&e.ctrl&&e.name==="p",At=(e,t=[])=>e.name==="down"||t.includes("vim")&&e.name==="j"||t.includes("emacs")&&e.ctrl&&e.name==="n";var ze=e=>e.name==="backspace",qe=e=>e.name==="tab",fn=e=>"1234567890".includes(e.name),De=e=>e.name==="enter"||e.name==="return";var Ft=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(t){super(),this.cause=t?.cause}},Et=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Qe=class extends Error{name="ExitPromptError"},Ct=class extends Error{name="HookError"},xe=class extends Error{name="ValidationError"};var sr=require("node:async_hooks");var yt=require("node:async_hooks");var or=new yt.AsyncLocalStorage;function Da(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function rr(e,t){let n=Da(e);return or.run(n,()=>{function r(o){n.handleChange=()=>{n.index=0,o()},n.handleChange()}return t(r)})}function fe(){let e=or.getStore();if(!e)throw new Ct("[Inquirer] Hook functions can only be called from within a prompt");return e}function hn(){return fe().rl}function mn(e){let t=(...n)=>{let r=fe(),o=!1,i=r.handleChange;r.handleChange=()=>{o=!0};let a=e(...n);return o&&i(),r.handleChange=i,a};return yt.AsyncResource.bind(t)}function ke(e){let t=fe(),{index:n}=t,r={get(){return t.hooks[n]},set(i){t.hooks[n]=i},initialized:n in t.hooks},o=e(r);return t.index++,o}function ir(){fe().handleChange()}var he={queue(e){let t=fe(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(hn());if(r!=null&&typeof r!="function")throw new xe("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[n]=r})},run(){let e=fe();mn(()=>{e.hooksEffect.forEach(t=>{t()}),e.hooksEffect.length=0})()},clearAll(){let e=fe();e.hooksCleanup.forEach(t=>{t?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function N(e){return ke(t=>{let n=sr.AsyncResource.bind(function(i){t.get()!==i&&(t.set(i),ir())});if(t.initialized)return[t.get(),n];let r=typeof e=="function"?e():e;return t.set(r),[r,n]})}function te(e,t){ke(n=>{let r=n.get();(!Array.isArray(r)||t.some((i,a)=>!Object.is(i,r[a])))&&he.queue(e),n.set(t)})}var K=require("node:util");var W=Q(require("node:process"),1);function fa(){return W.default.platform!=="win32"?W.default.env.TERM!=="linux":!!W.default.env.WT_SESSION||!!W.default.env.TERMINUS_SUBLIME||W.default.env.ConEmuTask==="{cmd::Cmder}"||W.default.env.TERM_PROGRAM==="Terminus-Sublime"||W.default.env.TERM_PROGRAM==="vscode"||W.default.env.TERM==="xterm-256color"||W.default.env.TERM==="alacritty"||W.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var ar={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},ur={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},ha={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},ma={...ar,...ur},ga={...ar,...ha},Aa=fa(),Fa=Aa?ma:ga,Pe=Fa,bd=Object.entries(ur);var dr={prefix:{idle:(0,K.styleText)("blue","?"),done:(0,K.styleText)("green",Pe.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(e=>(0,K.styleText)("yellow",e))},style:{answer:e=>(0,K.styleText)("cyan",e),message:e=>(0,K.styleText)("bold",e),error:e=>(0,K.styleText)("red",`> ${e}`),defaultAnswer:e=>(0,K.styleText)("dim",`(${e})`),help:e=>(0,K.styleText)("dim",e),highlight:e=>(0,K.styleText)("cyan",e),key:e=>(0,K.styleText)("cyan",(0,K.styleText)("bold",`<${e}>`))}};function cr(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function lr(...e){let t={};for(let n of e)for(let[r,o]of Object.entries(n)){let i=t[r];t[r]=cr(i)&&cr(o)?lr(i,o):o}return t}function ne(...e){let t=[dr,...e.filter(n=>n!=null)];return lr(...t)}function me({status:e="idle",theme:t}){let[n,r]=N(!1),[o,i]=N(0),{prefix:a,spinner:s}=ne(t);return te(()=>{if(e==="loading"){let d,l=-1,c=setTimeout(()=>{r(!0),d=setInterval(()=>{l=l+1,i(l%s.frames.length)},s.interval)},300);return()=>{clearTimeout(c),clearInterval(d)}}else r(!1)},[e]),n?s.frames[o]:typeof a=="string"?a:a[e==="loading"?"idle":e]??a.idle}function Ye(e,t){return ke(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((o,i)=>o!==t[i])){let o=e();return n.set({value:o,dependencies:t}),o}return r.value})}function ge(e){return N({current:e})[0]}function Ae(e){let t=ge(e);t.current=e,te(n=>{let r=!1,o=mn((i,a)=>{r||t.current(a,n)});return n.input.on("keypress",o),()=>{r=!0,n.input.removeListener("keypress",o)}},[])}var Pr=Q(Dr(),1);function gn({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}var ya=gn();function Ke(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(ya,"")}function fr(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function hr(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function mr(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function ba(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function gr(e,{ambiguousAsWide:t=!1}={}){return ba(e),hr(e)||mr(e)||t&&fr(e)?2:1}var Er=Q(Fr(),1),va=new Intl.Segmenter,wa=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function Fe(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=Ke(e)),e.length===0)return 0;let o=0,i={ambiguousAsWide:!n};for(let{segment:a}of va.segment(e)){let s=a.codePointAt(0);if(!(s<=31||s>=127&&s<=159)&&!(s>=8203&&s<=8207||s===65279)&&!(s>=768&&s<=879||s>=6832&&s<=6911||s>=7616&&s<=7679||s>=8400&&s<=8447||s>=65056&&s<=65071)&&!(s>=55296&&s<=57343)&&!(s>=65024&&s<=65039)&&!wa.test(a)){if((0,Er.default)().test(a)){o+=2;continue}o+=gr(s,i)}}return o}var Cr=(e=0)=>t=>`\x1B[${t+e}m`,yr=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,br=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,x={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},$d=Object.keys(x.modifier),Ba=Object.keys(x.color),xa=Object.keys(x.bgColor),ec=[...Ba,...xa];function ka(){let e=new Map;for(let[t,n]of Object.entries(x)){for(let[r,o]of Object.entries(n))x[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[r]=x[r],e.set(o[0],o[1]);Object.defineProperty(x,t,{value:n,enumerable:!1})}return Object.defineProperty(x,"codes",{value:e,enumerable:!1}),x.color.close="\x1B[39m",x.bgColor.close="\x1B[49m",x.color.ansi=Cr(),x.color.ansi256=yr(),x.color.ansi16m=br(),x.bgColor.ansi=Cr(10),x.bgColor.ansi256=yr(10),x.bgColor.ansi16m=br(10),Object.defineProperties(x,{rgbToAnsi256:{value:(t,n,r)=>t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(i=>i+i).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>x.rgbToAnsi256(...x.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,o;if(t>=232)n=((t-232)*10+8)/255,r=n,o=n;else{t-=16;let s=t%36;n=Math.floor(t/36)/5,r=Math.floor(s/6)/5,o=s%6/5}let i=Math.max(n,r,o)*2;if(i===0)return 30;let a=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(n));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>x.ansi256ToAnsi(x.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>x.ansi256ToAnsi(x.hexToAnsi256(t)),enumerable:!1}}),x}var Pa=ka(),vr=Pa;var vt=new Set(["\x1B","\x9B"]),Oa=39,Fn="\x07",xr="[",Sa="]",kr="m",bt=`${Sa}8;;`,wr=e=>`${vt.values().next().value}${xr}${e}${kr}`,Br=e=>`${vt.values().next().value}${bt}${e}${Fn}`,Ia=e=>e.split(" ").map(t=>Fe(t)),An=(e,t,n)=>{let r=[...t],o=!1,i=!1,a=Fe(Ke(e.at(-1)));for(let[s,u]of r.entries()){let d=Fe(u);if(a+d<=n?e[e.length-1]+=u:(e.push(u),a=0),vt.has(u)&&(o=!0,i=r.slice(s+1,s+1+bt.length).join("")===bt),o){i?u===Fn&&(o=!1,i=!1):u===kr&&(o=!1);continue}a+=d,a===n&&s<r.length-1&&(e.push(""),a=0)}!a&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Ta=e=>{let t=e.split(" "),n=t.length;for(;n>0&&!(Fe(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},Na=(e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",o,i,a=Ia(e),s=[""];for(let[c,p]of e.split(" ").entries()){n.trim!==!1&&(s[s.length-1]=s.at(-1).trimStart());let D=Fe(s.at(-1));if(c!==0&&(D>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(""),D=0),(D>0||n.trim===!1)&&(s[s.length-1]+=" ",D++)),n.hard&&a[c]>t){let h=t-D,A=1+Math.floor((a[c]-h-1)/t);Math.floor((a[c]-1)/t)<A&&s.push(""),An(s,p,t);continue}if(D+a[c]>t&&D>0&&a[c]>0){if(n.wordWrap===!1&&D<t){An(s,p,t);continue}s.push("")}if(D+a[c]>t&&n.wordWrap===!1){An(s,p,t);continue}s[s.length-1]+=p}n.trim!==!1&&(s=s.map(c=>Ta(c)));let u=s.join(`
|
|
93
|
+
`),d=[...u],l=0;for(let[c,p]of d.entries()){if(r+=p,vt.has(p)){let{groups:h}=new RegExp(`(?:\\${xr}(?<code>\\d+)m|\\${bt}(?<uri>.*)${Fn})`).exec(u.slice(l))||{groups:{}};if(h.code!==void 0){let A=Number.parseFloat(h.code);o=A===Oa?void 0:A}else h.uri!==void 0&&(i=h.uri.length===0?void 0:h.uri)}let D=vr.codes.get(Number(o));d[c+1]===`
|
|
94
94
|
`?(i&&(r+=Br("")),o&&D&&(r+=wr(D))):p===`
|
|
95
95
|
`&&(o&&D&&(r+=wr(o)),i&&(r+=Br(i))),l+=p.length}return r};function En(e,t,n){return String(e).normalize().replaceAll(`\r
|
|
96
96
|
`,`
|
|
@@ -99,22 +99,22 @@ ${o.join(`
|
|
|
99
99
|
`)}function We(e,t){return e.split(`
|
|
100
100
|
`).flatMap(n=>En(n,t,{trim:!1,hard:!0}).split(`
|
|
101
101
|
`).map(r=>r.trimEnd())).join(`
|
|
102
|
-
`)}function wt(){return(0,Pr.default)({defaultWidth:80,output:hn().output})}function Ra({active:e,renderedItems:t,pageSize:n,loop:r}){let o=
|
|
103
|
-
`)),u=s.reduce((C,y)=>C+y.length,0),
|
|
104
|
-
`)}var Mr=Q(require("node:readline"),1),Hr=require("node:async_hooks"),Gr=Q(Sr(),1);var Ee=[];Ee.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ee.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ee.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Bt=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",bn=Symbol.for("signal-exit emitter"),vn=globalThis,La=Object.defineProperty.bind(Object),wn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(vn[bn])return vn[bn];La(vn,bn,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,n){this.listeners[t].push(n)}removeListener(t,n){let r=this.listeners[t],o=r.indexOf(n);o!==-1&&(o===0&&r.length===1?r.length=0:r.splice(o,1))}emit(t,n,r){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(n,r)===!0||o;return t==="exit"&&(o=this.emit("afterExit",n,r)||o),o}},xt=class{},Ma=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),Bn=class extends xt{onExit(){return()=>{}}load(){}unload(){}},xn=class extends xt{#n=kn.platform==="win32"?"SIGINT":"SIGHUP";#t=new wn;#e;#i;#s;#r={};#o=!1;constructor(t){super(),this.#e=t,this.#r={};for(let n of Ee)this.#r[n]=()=>{let r=this.#e.listeners(n),{count:o}=this.#t,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),r.length===o){this.unload();let a=this.#t.emit("exit",null,n),s=n==="SIGHUP"?this.#n:n;a||t.kill(t.pid,s)}};this.#s=t.reallyExit,this.#i=t.emit}onExit(t,n){if(!Bt(this.#e))return()=>{};this.#o===!1&&this.load();let r=n?.alwaysLast?"afterExit":"exit";return this.#t.on(r,t),()=>{this.#t.removeListener(r,t),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let t of Ee)try{let n=this.#r[t];n&&this.#e.on(t,n)}catch{}this.#e.emit=(t,...n)=>this.#u(t,...n),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#o&&(this.#o=!1,Ee.forEach(t=>{let n=this.#r[t];if(!n)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,n)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#s,this.#t.count-=1)}#a(t){return Bt(this.#e)?(this.#e.exitCode=t||0,this.#t.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#u(t,...n){let r=this.#i;if(t==="exit"&&Bt(this.#e)){typeof n[0]=="number"&&(this.#e.exitCode=n[0]);let o=r.call(this.#e,t,...n);return this.#t.emit("exit",this.#e.exitCode,null),o}else return r.call(this.#e,t,...n)}},kn=globalThis.process,{onExit:Ir,load:
|
|
102
|
+
`)}function wt(){return(0,Pr.default)({defaultWidth:80,output:hn().output})}function Ra({active:e,renderedItems:t,pageSize:n,loop:r}){let o=ge({lastPointer:e,lastActive:void 0}),{lastPointer:i,lastActive:a}=o.current,s=Math.floor(n/2),u=t.reduce((c,p)=>c+p.length,0),d=t.slice(0,e).reduce((c,p)=>c+p.length,0),l=d;if(u>n)if(r)l=i,a!=null&&a<e&&e-a<n&&(l=Math.min(s,Math.abs(e-a)===1?Math.min(i+(t[a]?.length??0),Math.max(d,i)):i+e-a));else{let c=t.slice(e).reduce((p,D)=>p+D.length,0);l=c<n-s?n-c:Math.min(d,s)}return o.current.lastPointer=l,o.current.lastActive=e,l}function Cn({items:e,active:t,renderItem:n,pageSize:r,loop:o=!0}){let i=wt(),a=C=>(C%e.length+e.length)%e.length,s=e.map((C,y)=>C==null?[]:We(n({item:C,index:y,isActive:y===t}),i).split(`
|
|
103
|
+
`)),u=s.reduce((C,y)=>C+y.length,0),d=C=>s[C]??[],l=Ra({active:t,renderedItems:s,pageSize:r,loop:o}),c=d(t).slice(0,r),p=l+c.length<=r?l:r-c.length,D=Array.from({length:r});D.splice(p,c.length,...c);let h=new Set([t]),A=p+c.length,F=a(t+1);for(;A<r&&!h.has(F)&&(o&&u>r?F!==t:F>t);){let y=d(F).slice(0,r-A);D.splice(A,y.length,...y),h.add(F),A+=y.length,F=a(F+1)}for(A=p-1,F=a(t-1);A>=0&&!h.has(F)&&(o&&u>r?F!==t:F<t);){let C=d(F),y=C.slice(Math.max(0,C.length-A-1));D.splice(A-y.length+1,y.length,...y),h.add(F),A-=y.length,F=a(F-1)}return D.filter(C=>typeof C=="string").join(`
|
|
104
|
+
`)}var Mr=Q(require("node:readline"),1),Hr=require("node:async_hooks"),Gr=Q(Sr(),1);var Ee=[];Ee.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ee.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ee.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Bt=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",bn=Symbol.for("signal-exit emitter"),vn=globalThis,La=Object.defineProperty.bind(Object),wn=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(vn[bn])return vn[bn];La(vn,bn,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,n){this.listeners[t].push(n)}removeListener(t,n){let r=this.listeners[t],o=r.indexOf(n);o!==-1&&(o===0&&r.length===1?r.length=0:r.splice(o,1))}emit(t,n,r){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(n,r)===!0||o;return t==="exit"&&(o=this.emit("afterExit",n,r)||o),o}},xt=class{},Ma=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),Bn=class extends xt{onExit(){return()=>{}}load(){}unload(){}},xn=class extends xt{#n=kn.platform==="win32"?"SIGINT":"SIGHUP";#t=new wn;#e;#i;#s;#r={};#o=!1;constructor(t){super(),this.#e=t,this.#r={};for(let n of Ee)this.#r[n]=()=>{let r=this.#e.listeners(n),{count:o}=this.#t,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),r.length===o){this.unload();let a=this.#t.emit("exit",null,n),s=n==="SIGHUP"?this.#n:n;a||t.kill(t.pid,s)}};this.#s=t.reallyExit,this.#i=t.emit}onExit(t,n){if(!Bt(this.#e))return()=>{};this.#o===!1&&this.load();let r=n?.alwaysLast?"afterExit":"exit";return this.#t.on(r,t),()=>{this.#t.removeListener(r,t),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let t of Ee)try{let n=this.#r[t];n&&this.#e.on(t,n)}catch{}this.#e.emit=(t,...n)=>this.#u(t,...n),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#o&&(this.#o=!1,Ee.forEach(t=>{let n=this.#r[t];if(!n)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,n)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#s,this.#t.count-=1)}#a(t){return Bt(this.#e)?(this.#e.exitCode=t||0,this.#t.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#u(t,...n){let r=this.#i;if(t==="exit"&&Bt(this.#e)){typeof n[0]=="number"&&(this.#e.exitCode=n[0]);let o=r.call(this.#e,t,...n);return this.#t.emit("exit",this.#e.exitCode,null),o}else return r.call(this.#e,t,...n)}},kn=globalThis.process,{onExit:Ir,load:hc,unload:mc}=Ma(Bt(kn)?new xn(kn):new Bn);var Lr=require("node:util");var Nr="\x1B[?25l",Rr="\x1B[?25h",Pn=(e=1)=>e>0?`\x1B[${e}A`:"",On=(e=1)=>e>0?`\x1B[${e}B`:"",Sn=(e,t)=>typeof t=="number"&&!Number.isNaN(t)?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`,Tr="\x1B[2K",In=e=>e>0?(Tr+Pn(1)).repeat(e-1)+Tr+"\x1B[G":"";var jr=e=>e.split(`
|
|
105
105
|
`).length,Ha=e=>e.split(`
|
|
106
106
|
`).pop()??"",Ve=class{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(t){this.rl=t,this.cursorPos=t.getCursorPos()}write(t){this.rl.output.unmute(),this.rl.output.write(t),this.rl.output.mute()}render(t,n=""){let r=Ha(t),o=(0,Lr.stripVTControlCharacters)(r),i=o;this.rl.line.length>0&&(i=i.slice(0,-this.rl.line.length)),this.rl.setPrompt(i),this.cursorPos=this.rl.getCursorPos();let a=wt();t=We(t,a),n=We(n,a),o.length%a===0&&(t+=`
|
|
107
107
|
`);let s=t+(n?`
|
|
108
|
-
`+n:""),
|
|
109
|
-
`,n+=Rr,this.write(n),this.rl.close()}};var kt=class extends Promise{static withResolver(){let t,n;return{promise:new Promise((o,i)=>{t=o,n=i}),resolve:t,reject:n}}};function Ga(){let e=Error.prepareStackTrace,t=[];try{Error.prepareStackTrace=(n,r)=>{let o=r.slice(1);return t=o,o},new Error().stack}catch{return t}return Error.prepareStackTrace=e,t}function Ce(e){let t=Ga();return(r,o={})=>{let{input:i=process.stdin,signal:a}=o,s=new Set,u=new Gr.default;u.pipe(o.output??process.stdout);let
|
|
110
|
-
at ${$e}`)}let[V,_]=typeof k=="string"?[k]:k;l.render(V,_),he.run()}catch(k){D(k)}}),Object.assign(
|
|
108
|
+
`+n:""),d=Math.floor(o.length/a)-this.cursorPos.rows+(n?jr(n):0);d>0&&(s+=Pn(d)),s+=Sn(this.cursorPos.cols),this.write(On(this.extraLinesUnderPrompt)+In(this.height)+s),this.extraLinesUnderPrompt=d,this.height=jr(s)}checkCursorPos(){let t=this.rl.getCursorPos();t.cols!==this.cursorPos.cols&&(this.write(Sn(t.cols)),this.cursorPos=t)}done({clearContent:t}){this.rl.setPrompt("");let n=On(this.extraLinesUnderPrompt);n+=t?In(this.height):`
|
|
109
|
+
`,n+=Rr,this.write(n),this.rl.close()}};var kt=class extends Promise{static withResolver(){let t,n;return{promise:new Promise((o,i)=>{t=o,n=i}),resolve:t,reject:n}}};function Ga(){let e=Error.prepareStackTrace,t=[];try{Error.prepareStackTrace=(n,r)=>{let o=r.slice(1);return t=o,o},new Error().stack}catch{return t}return Error.prepareStackTrace=e,t}function Ce(e){let t=Ga();return(r,o={})=>{let{input:i=process.stdin,signal:a}=o,s=new Set,u=new Gr.default;u.pipe(o.output??process.stdout);let d=Mr.createInterface({terminal:!0,input:i,output:u}),l=new Ve(d),{promise:c,resolve:p,reject:D}=kt.withResolver(),h=()=>D(new Et);if(a){let C=()=>D(new Ft({cause:a.reason}));if(a.aborted)return C(),Object.assign(c,{cancel:h});a.addEventListener("abort",C),s.add(()=>a.removeEventListener("abort",C))}s.add(Ir((C,y)=>{D(new Qe(`User force closed the prompt with ${C} ${y}`))}));let A=()=>D(new Qe("User force closed the prompt with SIGINT"));d.on("SIGINT",A),s.add(()=>d.removeListener("SIGINT",A));let F=()=>l.checkCursorPos();return d.input.on("keypress",F),s.add(()=>d.input.removeListener("keypress",F)),rr(d,C=>{let y=Hr.AsyncResource.bind(()=>he.clearAll());return d.on("close",y),s.add(()=>d.removeListener("close",y)),C(()=>{try{let k=e(r,$e=>{setImmediate(()=>p($e))});if(k===void 0){let $e=t[1]?.getFileName();throw new Error(`Prompt functions must return a string.
|
|
110
|
+
at ${$e}`)}let[V,_]=typeof k=="string"?[k]:k;l.render(V,_),he.run()}catch(k){D(k)}}),Object.assign(c.then(k=>(he.clearAll(),k),k=>{throw he.clearAll(),k}).finally(()=>{s.forEach(k=>k()),l.done({clearContent:!!o.clearPromptOnDone}),u.end()}).then(()=>c),{cancel:h})})}}var Ur=require("node:util");var oe=class{separator=(0,Ur.styleText)("dim",Array.from({length:15}).join(Pe.line));type="separator";constructor(t){t&&(this.separator=t)}static isSeparator(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="separator")}};function zr(e,t){let n=t!==!1;return/^(y|yes)/i.test(e)?n=!0:/^(n|no)/i.test(e)&&(n=!1),n}function qr(e){return e?"Yes":"No"}var Ze=Ce((e,t)=>{let{transformer:n=qr}=e,[r,o]=N("idle"),[i,a]=N(""),s=ne(e.theme),u=me({status:r,theme:s});Ae((p,D)=>{if(r==="idle")if(De(p)){let h=zr(i,e.default);a(n(h)),o("done"),t(h)}else if(qe(p)){let h=qr(!zr(i,e.default));D.clearLine(0),D.write(h),a(h)}else a(D.line)});let d=i,l="";r==="done"?d=s.style.answer(i):l=` ${s.style.defaultAnswer(e.default===!1?"y/N":"Y/n")}`;let c=s.style.message(e.message,r);return`${u} ${c}${l} ${d}`});var Ua={validationFailureMode:"keep"},Oe=Ce((e,t)=>{let{prefill:n="tab"}=e,r=ne(Ua,e.theme),[o,i]=N("idle"),[a="",s]=N(e.default),[u,d]=N(),[l,c]=N(""),p=me({status:o,theme:r});async function D(y){let{required:k,pattern:V,patternError:_="Invalid input"}=e;return k&&!y?"You must provide a value":V&&!V.test(y)?_:typeof e.validate=="function"?await e.validate(y)||"You must provide a valid value":!0}Ae(async(y,k)=>{if(o==="idle")if(De(y)){let V=l||a;i("loading");let _=await D(V);_===!0?(c(V),i("done"),t(V)):(r.validationFailureMode==="clear"?c(""):k.write(l),d(_),i("idle"))}else ze(y)&&!l?s(void 0):qe(y)&&!l?(s(void 0),k.clearLine(0),k.write(a),c(a)):(c(k.line),d(void 0))}),te(y=>{n==="editable"&&a&&(y.write(a),c(a))},[]);let h=r.style.message(e.message,o),A=l;typeof e.transformer=="function"?A=e.transformer(l,{isFinal:o==="done"}):o==="done"&&(A=r.style.answer(l));let F;a&&o!=="done"&&!l&&(F=r.style.defaultAnswer(a));let C="";return u&&(C=r.style.error(u)),[[p,h,F,A].filter(y=>y!==void 0).join(" "),C]});var Ie=require("node:util");var za={icon:{cursor:Pe.pointer},style:{disabled:e=>(0,Ie.styleText)("dim",`- ${e}`),description:e=>(0,Ie.styleText)("cyan",e),keysHelpTip:e=>e.map(([t,n])=>`${(0,Ie.styleText)("bold",t)} ${(0,Ie.styleText)("dim",n)}`).join((0,Ie.styleText)("dim"," \u2022 "))},indexMode:"hidden",keybindings:[]};function Se(e){return!oe.isSeparator(e)&&!e.disabled}function qa(e){return e.map(t=>{if(oe.isSeparator(t))return t;if(typeof t!="object"||t===null||!("value"in t)){let o=String(t);return{value:t,name:o,short:o,disabled:!1}}let n=t.name??String(t.value),r={value:t.value,name:n,short:t.short??n,disabled:t.disabled??!1};return t.description&&(r.description=t.description),r})}var Tn=Ce((e,t)=>{let{loop:n=!0,pageSize:r=7}=e,o=ne(za,e.theme),{keybindings:i}=o,[a,s]=N("idle"),u=me({status:a,theme:o}),d=ge(),l=!i.includes("vim"),c=Ye(()=>qa(e.choices),[e.choices]),p=Ye(()=>{let P=c.findIndex(Se),q=c.findLastIndex(Se);if(P===-1)throw new xe("[select prompt] No selectable choices. All choices are disabled.");return{first:P,last:q}},[c]),D=Ye(()=>"default"in e?c.findIndex(P=>Se(P)&&P.value===e.default):-1,[e.default,c]),[h,A]=N(D===-1?p.first:D),F=c[h];Ae((P,q)=>{if(clearTimeout(d.current),De(P))s("done"),t(F.value);else if(Ue(P,i)||At(P,i)){if(q.clearLine(0),n||Ue(P,i)&&h!==p.first||At(P,i)&&h!==p.last){let ce=Ue(P,i)?-1:1,H=h;do H=(H+ce+c.length)%c.length;while(!Se(c[H]));A(H)}}else if(fn(P)&&!Number.isNaN(Number(q.line))){let ce=Number(q.line)-1,H=-1,re=c.findIndex(Te=>oe.isSeparator(Te)?!1:(H++,H===ce)),et=c[re];et!=null&&Se(et)&&A(re),d.current=setTimeout(()=>{q.clearLine(0)},700)}else if(ze(P))q.clearLine(0);else if(l){let ce=q.line.toLowerCase(),H=c.findIndex(re=>oe.isSeparator(re)||!Se(re)?!1:re.name.toLowerCase().startsWith(ce));H!==-1&&A(H),d.current=setTimeout(()=>{q.clearLine(0)},700)}}),te(()=>()=>{clearTimeout(d.current)},[]);let C=o.style.message(e.message,a),y=o.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]),k=0,V=Cn({items:c,active:h,renderItem({item:P,isActive:q,index:ce}){if(oe.isSeparator(P))return k++,` ${P.separator}`;let H=o.indexMode==="number"?`${ce+1-k}. `:"";if(P.disabled){let Te=typeof P.disabled=="string"?P.disabled:"(disabled)";return o.style.disabled(`${H}${P.name} ${Te}`)}let re=q?o.style.highlight:Te=>Te,et=q?o.icon.cursor:" ";return re(`${et} ${H}${P.name}`)},pageSize:r,loop:n});if(a==="done")return[u,C,o.style.answer(F.short)].filter(Boolean).join(" ");let{description:_}=F;return`${[[u,C].filter(Boolean).join(" "),V," ",_?o.style.description(_):"",y].filter(Boolean).join(`
|
|
111
111
|
`).trimEnd()}${Nr}`});var Kr=require("node:child_process");var Qr=require("node:child_process");function Yr(e){try{return(0,Qr.execSync)("git rev-parse --is-inside-work-tree",{cwd:e,stdio:["ignore","pipe","ignore"],encoding:"utf-8"}).trim()==="true"}catch{return!1}}function Qa(e,t){let n=e.postScaffoldCommands;if(!n)return{commands:[],gitInitSkipped:!1};let r=n.setup??[],o=n.gitInit??[],i=o.length>0&&Yr(t);return{commands:i?[...r]:[...r,...o],gitInitSkipped:i}}async function Wr(e,t,n=!1,r=!1){let{commands:o,gitInitSkipped:i}=Qa(t,e);if(o.length===0){i&&(console.log(),console.log(T(`Existing git repo detected at ${e} \u2014 skipping git setup commands.`)));return}if(console.log(),i&&console.log(T(`Existing git repo detected at ${e} \u2014 skipping git setup commands.`)),console.log("The following commands will be executed:"),o.forEach(l=>{console.log(` ${T("$")} ${l}`)}),console.log(),!(!n&&(r||await Ze({message:"Continue?",default:!0})))){console.log(T(`
|
|
112
|
-
Skipped post-scaffold commands. You can run them manually later.`));return}console.log(),console.log("Running post-scaffold commands..."),console.log();let s=0,u;for(let l of o)try{console.log(` ${T("$")} ${l}`),(0,Kr.execSync)(l,{cwd:e,stdio:"inherit"}),s++}catch(
|
|
113
|
-
Failed to execute command: ${
|
|
112
|
+
Skipped post-scaffold commands. You can run them manually later.`));return}console.log(),console.log("Running post-scaffold commands..."),console.log();let s=0,u;for(let l of o)try{console.log(` ${T("$")} ${l}`),(0,Kr.execSync)(l,{cwd:e,stdio:"inherit"}),s++}catch(c){u=c instanceof Error?c.message:String(c);break}if(!u)return;let d=o[s];console.error(pe(`
|
|
113
|
+
Failed to execute command: ${d}
|
|
114
114
|
${u}
|
|
115
115
|
`)),console.error(pe(`\u26A0\uFE0F Aborting post-scaffold commands.
|
|
116
|
-
`)),console.log("Command execution status:"),o.forEach((l,
|
|
117
|
-
If your org has a custom subdomain (e.g. acme.datadoghq.com), use that instead:`,default:Pt,validate:jn});
|
|
116
|
+
`)),console.log("Command execution status:"),o.forEach((l,c)=>{c<s?console.log(` \u2713 ${T(l)}`):console.log(c===s?` \u2717 ${pe(l)}`:` - ${T(l)} ${T("(skipped)")}`)}),console.log(),console.log("You can run the remaining commands manually from your project directory:"),console.log(` ${T("cd")} ${e}`),o.slice(s).forEach(l=>{console.log(` ${T("$")} ${l}`)}),console.log()}var Nn=["datadoghq.com","us3.datadoghq.com","us5.datadoghq.com","datadoghq.eu","ddog-gov.com","us2.ddog-gov.com","ap1.datadoghq.com","ap2.datadoghq.com","uk1.datadoghq.com","datad0g.com"];var Ya=new Set(["api","app"]);function Ka(e){return(e.trim().replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/)[0]??"").trim().toLowerCase()}function Vr(e){if(typeof e!="string"||e.length===0)return;let t=Ka(e),n=Nn.find(s=>s===t);if(n)return{site:n};let r=Nn.filter(s=>t.endsWith(`.${s}`)),[o]=r;if(o===void 0)return;let i=o;for(let s of r)s.length>i.length&&(i=s);let a=t.slice(0,t.length-i.length-1);if(!(!a||!/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(a)))return Ya.has(a)?{site:i}:{site:i,subdomain:a}}function Rn(e){let t=Vr(e);if(t!==void 0)return t.subdomain?`${t.subdomain}.${t.site}`:t.site}var Wa=new Set(["datad0g.com"]),Va=Nn.filter(e=>!Wa.has(e));function Za(){return Va.join(", ")}function jn(e){return!e||!e.trim()?"The Datadog site cannot be empty.":Vr(e)!==void 0?!0:`"${e}" is not a known Datadog site. Known sites: ${Za()}.`}var Xe=Q(require("node:fs")),St=Q(require("node:path"));var Pt="datadoghq.com";function Zr(e){return e?/^[a-z0-9][a-z0-9-]*$/.test(e)?!0:"Directory name must start with a lowercase letter or number and contain only lowercase letters, numbers, and hyphens.":"The directory name cannot be empty."}function Ot(e){let t=e.trim();return t?/[{}<>`$]/.test(t)?"The app name cannot contain the characters {, }, <, >, `, or $.":!0:"The app name cannot be empty."}function Xa(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Xr(e){return e.split("-").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}async function Ja(e,t){if(!Xe.default.existsSync(e))return;if(t){console.log(T("Deleting directory.")),Xe.default.rmSync(e,{force:!0,recursive:!0});return}if(console.log(),await Ze({message:`Directory ${M(e)} already exists. Overwrite?`,default:!1}))console.log(T("Deleting directory.")),Xe.default.rmSync(e,{force:!0,recursive:!0});else throw console.log(T("Cancelled.")),new Error("Operation cancelled by user")}async function Jr(e,t,n,r,o){let i,a;if(e){let l=St.default.basename(e),c=Zr(l);if(c!==!0)throw new Error(c);if(a=e,r!==void 0){let p=Ot(r);if(p!==!0)throw new Error(p);i=r.trim()}else n?i=Xr(l):i=(await Oe({message:"Enter your app name:",default:Xr(l),validate:Ot})).trim()}else{if(n)throw new Error("A directory name is required when using --yes. Pass it as a positional argument.");{if(r!==void 0){let c=Ot(r);if(c!==!0)throw new Error(c);i=r.trim()}else i=(await Oe({message:"Enter your app name:",validate:Ot})).trim();let l=Xa(i);a=await Oe({message:"Enter the directory name for your app:",default:l,validate:c=>Zr(c)})}}let s=St.default.basename(a),u=St.default.resolve(process.cwd(),a),d=Pt;if(o!==void 0){let l=jn(o);if(l!==!0)throw new Error(l);d=Rn(o)??Pt}else if(!n){let l=await Oe({message:`Enter your Datadog site (e.g. datadoghq.com, datadoghq.eu, ap1.datadoghq.com).
|
|
117
|
+
If your org has a custom subdomain (e.g. acme.datadoghq.com), use that instead:`,default:Pt,validate:jn});d=Rn(l)??Pt}if(n&&!t&&Xe.default.existsSync(u))throw new Error(`Directory ${u} already exists. Use --overwrite to replace it.`);return await Ja(u,t),{name:i,directoryName:s,directory:a,datadogSite:d,description:""}}var no=Q(require("node:fs/promises")),oo=Q(require("node:path"));var Ln={};S(Ln,{contents:()=>$a,filepath:()=>_a});var _a="./src/App.tsx",$a=e=>`import { Button } from '@datadog/druids/form/Button';
|
|
118
118
|
import { Grid } from '@datadog/druids/layout/Grid';
|
|
119
119
|
import { GridItem } from '@datadog/druids/layout/GridItem';
|
|
120
120
|
import { Spacing } from '@datadog/druids/layout/Spacing';
|
|
@@ -366,7 +366,7 @@ Connections are optional, reusable auth configuration for Action Catalog actions
|
|
|
366
366
|
Integrations such as GitHub, Jira, Slack, PagerDuty, and Statuspage may inherit credentials from their Datadog integration tile and may not need an explicit connection.
|
|
367
367
|
|
|
368
368
|
Public docs: [Connections](https://docs.datadoghq.com/actions/connections/), [Action Catalog](https://docs.datadoghq.com/actions/action_interface/)
|
|
369
|
-
`;var zn={};S(zn,{contents:()=>
|
|
369
|
+
`;var zn={};S(zn,{contents:()=>du,filepath:()=>uu});var uu="./docs/agents/runtime-context.md",du=e=>`# Runtime Context
|
|
370
370
|
|
|
371
371
|
Datadog Apps are embedded inside the Datadog UI. Treat this app as iframe-hosted browser code with Datadog-managed backend execution.
|
|
372
372
|
|
|
@@ -385,6 +385,7 @@ Datadog Apps are embedded inside the Datadog UI. Treat this app as iframe-hosted
|
|
|
385
385
|
Datadog provides \`@datadog/apps-frontend\`, a library of React tools to make embedded frontend development easier.
|
|
386
386
|
The scaffold mounts \`DatadogAppProvider\` from \`@datadog/apps-frontend/embedding/react\` at the React root;
|
|
387
387
|
every \`@datadog/apps-frontend\` hook must be called below it. \`useDatadogAppInput\` from \`@datadog/apps-frontend/inputs/react\` reads typed inputs the host provides, with schemas such as \`datadogTheme\` in \`@datadog/apps-frontend/inputs/schema\`.
|
|
388
|
+
For DRUIDS apps, \`DruidsEnvironmentWithThemeInput\` from \`@datadog/apps-frontend/druids/react\` is a drop-in \`DruidsEnvironment\` that follows the live Datadog theme; the scaffold mounts it at the React root.
|
|
388
389
|
Check out this library for features, tools, utils and more
|
|
389
390
|
|
|
390
391
|
## Storage and cookies
|
|
@@ -403,7 +404,7 @@ Frontend code imports backend functions like normal ES modules, but those import
|
|
|
403
404
|
- Do not build app logic that depends on backend functions running in the local Node.js process.
|
|
404
405
|
|
|
405
406
|
For backend implementation details, read \`backend-functions.md\`.
|
|
406
|
-
`;var qn={};S(qn,{contents:()=>lu,filepath:()=>
|
|
407
|
+
`;var qn={};S(qn,{contents:()=>lu,filepath:()=>cu});var cu="./docs/agents/upgrading.md",lu=e=>'# Upgrading\n\n## Primary packages\n\n- `@datadog/vite-plugin`: Vite integration for local development, build, and deploy.\n- `@datadog/action-catalog`: typed Action Catalog client for backend functions.\n- `@datadog/apps-backend`: Datadog-provided helpers for backend function development.\n- `@datadog/apps-frontend`: Datadog-provided helpers and utils for apps, such as getting input context from the page!\n\nPreserve the existing package manager and lockfile style.\n\n## Before upgrading\n\nCheck release notes before changing versions:\n\n```bash\nnpm view @datadog/vite-plugin version repository.url homepage\nnpm view @datadog/action-catalog version repository.url homepage\nnpm view @datadog/apps-backend version repository.url homepage\nnpm view @datadog/apps-frontend version repository.url homepage\n```\n\nInspect the current app:\n\n```bash\nnpm outdated @datadog/vite-plugin @datadog/action-catalog @datadog/apps-backend @datadog/apps-frontend\nnpm ls @datadog/vite-plugin @datadog/action-catalog @datadog/apps-backend @datadog/apps-frontend\n```\n\n## Upgrade\n\n```bash\nnpm install @datadog/action-catalog@latest\nnpm install @datadog/apps-backend@latest\nnpm install @datadog/apps-frontend@latest\nnpm install -D @datadog/vite-plugin@latest\n```\n\nAfter upgrading, verify:\n\n- `datadog-app.config.json` app definition and configuration fields (`datadogSite`, `id`, `name`, `description`, `selfService`, `permissions`) and `vite.config.ts` Datadog plugin config.\n- `package.json` scripts \u2014 check for new `deploy` and `publish` scripts added in `@datadog/vite-plugin` 3.2.0+.\n- Backend function imports from `@datadog/action-catalog/...`.\n- Frontend embedding and input imports from `@datadog/apps-frontend/...`.\n- Project-local instructions in `AGENTS.md`.\n\n## Compare against a fresh scaffold\n\nTo pull in changes from the latest scaffolder without guessing:\n\n```bash\ntmp_dir="$(mktemp -d)"\nnpm create @datadog/apps@latest -- "$tmp_dir/base-app" --template vite-react -y --skip-post-scaffold\ndiff -ru "$tmp_dir/base-app/package.json" package.json\ndiff -ru "$tmp_dir/base-app/datadog-app.config.json" datadog-app.config.json\ndiff -ru "$tmp_dir/base-app/vite.config.ts" vite.config.ts\ndiff -ru "$tmp_dir/base-app/src" src\n```\n\nPort only the specific changes needed. Do not replace the app wholesale.\n\n**Preserve your existing `id`** \u2014 the fresh scaffold generates a new random `id` in `datadog-app.config.json`. Do not copy it into your project; keep your existing `id` to avoid creating a duplicate app on the next upload.\n\n## Verify\n\n```bash\nnpm run typecheck\nnpm run lint\nnpm run build\n```\n';var Qn={};S(Qn,{contents:()=>Du,filepath:()=>pu});var pu="./docs/agents/workflow-automation.md",Du=e=>`# Workflow Automation
|
|
407
408
|
|
|
408
409
|
Use this when a backend function needs to trigger a Datadog Workflow Automation workflow and poll for the result.
|
|
409
410
|
|
|
@@ -563,7 +564,7 @@ Datadog Apps are React + TypeScript applications bundled by Vite and embedded in
|
|
|
563
564
|
|
|
564
565
|
This app uses the published \`@datadog/druids\` package. In scaffolded apps, import components from \`@datadog/druids/[category]/[Component]\`; do not import private web-ui paths like \`@druids/ui/...\`.
|
|
565
566
|
|
|
566
|
-
- The scaffold
|
|
567
|
+
- The scaffold imports \`@datadog/druids/styles.css\` at the React root and wraps the app in \`DruidsEnvironmentWithThemeInput\` (\`@datadog/apps-frontend/druids/react\`) below \`DatadogAppProvider\`. The environment follows the Datadog UI theme through the live \`datadog.theme\` input; \`defaultThemePreference\` in \`src/main.tsx\` only covers the first paint before the input claims. Keep that setup in place if you restructure the root. To keep DRUIDS' own cookie-based preference handling instead, render \`DruidsEnvironment\` from \`@datadog/druids/layout/DruidsEnvironment\`.
|
|
567
568
|
- Discover available components by browsing the installed package. Treat the \`exports\` map in \`node_modules/@datadog/druids/package.json\` as the source of truth for public entry points, and explore the corresponding category directories under \`node_modules/@datadog/druids/dist\` instead of relying on a hard-coded component list.
|
|
568
569
|
- After choosing an exported component, inspect its TypeScript definitions under \`node_modules/@datadog/druids/dist/**/*.d.mts\` before inventing props or imports. For icons, only use entry points that are present in the installed package.
|
|
569
570
|
- Start with the [DRUIDS docs](https://druids.datadoghq.com/), especially [Foundations](https://druids.datadoghq.com/foundations), [Spacing & Layout](https://druids.datadoghq.com/foundations/spacing-and-layout), [Typography](https://druids.datadoghq.com/foundations/typography), and [Components](https://druids.datadoghq.com/components). The docs cover the full internal DRUIDS library; the public \`@datadog/druids\` package exposes only a subset for Datadog Apps.
|
|
@@ -602,7 +603,7 @@ This app uses the published \`@datadog/druids\` package. In scaffolded apps, imp
|
|
|
602
603
|
- Use Datadog MCP tools when available for Datadog-specific lookup, diagnostics, or API-backed workflows.
|
|
603
604
|
|
|
604
605
|
Primary docs: https://docs.datadoghq.com/actions/datadog_apps/
|
|
605
|
-
`;var Kn={};S(Kn,{contents:()=>
|
|
606
|
+
`;var Kn={};S(Kn,{contents:()=>gu,filepath:()=>mu});var mu="./CLAUDE.md",gu=e=>`@AGENTS.md
|
|
606
607
|
`;var Wn={};S(Wn,{contents:()=>Fu,filepath:()=>Au});var _r=require("node:crypto"),Au="./datadog-app.config.json",Fu=e=>{let t=(0,_r.createHash)("md5").update(`${Math.random().toString()}:${e.name}`).digest("hex"),n={$schema:"https://unpkg.com/@datadog/create-apps/dist/datadog-app.config.schema.json",datadogSite:e.datadogSite,id:t,name:e.name};return`${JSON.stringify(n,null,2)}
|
|
607
608
|
`};var Vn={};S(Vn,{contents:()=>Cu,filepath:()=>Eu});var Eu="./eslint.config.mjs",Cu=e=>`import js from '@eslint/js';
|
|
608
609
|
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
@@ -672,8 +673,8 @@ dist-ssr
|
|
|
672
673
|
</html>
|
|
673
674
|
`;var _n={};S(_n,{contents:()=>Pu,filepath:()=>ku});var ku="./src/main.tsx",Pu=e=>`import '@datadog/druids/styles.css';
|
|
674
675
|
|
|
676
|
+
import { DruidsEnvironmentWithThemeInput } from '@datadog/apps-frontend/druids/react';
|
|
675
677
|
import { DatadogAppProvider } from '@datadog/apps-frontend/embedding/react';
|
|
676
|
-
import { DruidsEnvironment } from '@datadog/druids/layout/DruidsEnvironment';
|
|
677
678
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
678
679
|
import { StrictMode } from 'react';
|
|
679
680
|
import { createRoot } from 'react-dom/client';
|
|
@@ -687,9 +688,12 @@ if (appRoot) {
|
|
|
687
688
|
<StrictMode>
|
|
688
689
|
<DatadogAppProvider>
|
|
689
690
|
<QueryClientProvider client={queryClient}>
|
|
690
|
-
<
|
|
691
|
+
<DruidsEnvironmentWithThemeInput
|
|
692
|
+
backgroundColor="standard"
|
|
693
|
+
defaultThemePreference="light"
|
|
694
|
+
>
|
|
691
695
|
<App />
|
|
692
|
-
</
|
|
696
|
+
</DruidsEnvironmentWithThemeInput>
|
|
693
697
|
</QueryClientProvider>
|
|
694
698
|
</DatadogAppProvider>
|
|
695
699
|
</StrictMode>,
|
|
@@ -697,7 +701,7 @@ if (appRoot) {
|
|
|
697
701
|
} else {
|
|
698
702
|
console.error('Missing #app div for createRoot.');
|
|
699
703
|
}
|
|
700
|
-
`;var $n={};S($n,{contents:()=>Su,filepath:()=>Ou});var Ou="./package.json",Su=e=>{let t={name:e.directoryName,version:"0.0.1",private:!0,engines:{node:"^20.19.0 || >=22.13.0"},scripts:{dev:"vite",build:"vite build",upload:"DD_APPS_UPLOAD_ASSETS=1 vite build",lint:"eslint . --report-unused-disable-directives --max-warnings 0","lint:fix":"eslint . --fix",preview:"vite preview",typecheck:"tsc --noEmit"},dependencies:{"@datadog/action-catalog":"^0.0.7","@datadog/apps-backend":"^0.0.1","@datadog/apps-frontend":"^0.0.
|
|
704
|
+
`;var $n={};S($n,{contents:()=>Su,filepath:()=>Ou});var Ou="./package.json",Su=e=>{let t={name:e.directoryName,version:"0.0.1",private:!0,engines:{node:"^20.19.0 || >=22.13.0"},scripts:{dev:"vite",build:"vite build",upload:"DD_APPS_UPLOAD_ASSETS=1 vite build",lint:"eslint . --report-unused-disable-directives --max-warnings 0","lint:fix":"eslint . --fix",preview:"vite preview",typecheck:"tsc --noEmit"},dependencies:{"@datadog/action-catalog":"^0.0.7","@datadog/apps-backend":"^0.0.1","@datadog/apps-frontend":"^0.0.5","@datadog/druids":"^0.0.7","@tanstack/react-query":"^5.101.4",react:"^19.2.8","react-dom":"^19.2.8"},optionalDependencies:{"@napi-rs/keyring":"^1.3.0"},devDependencies:{"@datadog/vite-plugin":"^3.2.12","@eslint/js":"^9.39.5","@types/node":"^24.12.2","@types/react":"^19.2.18","@types/react-dom":"^19.2.4","@vitejs/plugin-react":"^6.1.0",eslint:"^9.39.5","eslint-plugin-react-hooks":"^7.1.1","eslint-plugin-react-refresh":"^0.5.4",globals:"^17.11.0",typescript:"^5.9.3","typescript-eslint":"^8.67.0",vite:"^8.2.2"}};return JSON.stringify(t,null,2)};var eo={};S(eo,{contents:()=>Tu,filepath:()=>Iu});var Iu="./tsconfig.json",Tu=e=>JSON.stringify({compilerOptions:{target:"ES2020",useDefineForClassFields:!0,lib:["ES2020","DOM","DOM.Iterable"],module:"ESNext",skipLibCheck:!0,moduleResolution:"bundler",allowImportingTsExtensions:!0,resolveJsonModule:!0,isolatedModules:!0,noEmit:!0,jsx:"react-jsx",strict:!0,noUnusedLocals:!0,noUnusedParameters:!0,noFallthroughCasesInSwitch:!0},include:["src"]},null,2);var to={};S(to,{contents:()=>Ru,filepath:()=>Nu});var Nu="./vite.config.ts",Ru=e=>{let t="";return(e.rumConfig?.applicationId||e.rumConfig?.clientToken)&&(t=`
|
|
701
705
|
rum: {
|
|
702
706
|
enable: true,
|
|
703
707
|
sdk: {
|
|
@@ -761,4 +765,4 @@ export default defineConfig({
|
|
|
761
765
|
`};var $r={name:"Vite & React",description:"A basic React application bundled with Vite.",requiresRumConfig:!0,postScaffoldCommands:{setup:["npm install"],gitInit:["git init","git add .",'git commit -m "Initial commit"']}};var ei={metadata:$r,files:[Wn,Ln,Yn,zn,Mn,Hn,Gn,Un,Qn,qn,Kn,Vn,Xn,Zn,Jn,_n,$n,eo,to]};var Je={"vite-react":ei};function Lu(e,t){let n=[];return typeof e!="object"||e===null?(n.push(`[${t}] metadata.json must be a valid JSON object`),n):(!("name"in e)||typeof e.name!="string"?n.push(`[${t}] metadata.json is missing required "name" field (string)`):e.name.trim()===""&&n.push(`[${t}] metadata.json "name" field cannot be empty`),!("description"in e)||typeof e.description!="string"?n.push(`[${t}] metadata.json is missing required "description" field (string)`):e.description.trim()===""&&n.push(`[${t}] metadata.json "description" field cannot be empty`),n)}function Mu(e,t){let n=[];return typeof e!="object"||e===null?(n.push(`[${t}] must export an object`),n):("filepath"in e?typeof e.filepath!="string"&&n.push(`[${t}] "filepath" must be a string, got ${typeof e.filepath}`):n.push(`[${t}] missing required export "filepath"`),"contents"in e?typeof e.contents!="function"&&n.push(`[${t}] "contents" must be a function, got ${typeof e.contents}`):n.push(`[${t}] missing required export "contents"`),n)}var ti=["npm","yarn","git"],ni=["|",">","<","$(","`","&&","||",";"];function Hu(e){let t=e.trim(),r=t.split(/\s+/)[0];if(!r||!ti.includes(r))return!1;for(let o of ni)if(t.includes(o))return!1;return!0}function Gu(e,t){let n=[];if(!e.postScaffoldCommands)return n;let r=[...e.postScaffoldCommands.setup??[],...e.postScaffoldCommands.gitInit??[]];for(let o of r)if(!Hu(o)){let i=ti.join(", "),a=ni.join(", ");n.push(`[${t}] Unsafe post-scaffold command: "${o}".
|
|
762
766
|
Only ${i} commands without dangerous patterns (${a}) are allowed.`)}return n}function oi(){let e=[];for(let[t,n]of Object.entries(Je)){e.push(...Lu(n.metadata,t)),e.push(...Gu(n.metadata,t));for(let r of n.files)e.push(...Mu(r,n.metadata.name))}if(e.length>0){let t=["Template validation errors:",...e.map(n=>` - ${n}`)].join(`
|
|
763
767
|
`);return console.log(t),1}return 0}function ro(e){let t=Je[e];if(!t){let n=Object.keys(Je).join(", ");throw new Error(pe(`Unknown template "${e}". Available templates: ${n}`))}return t}async function ri(){let e=Object.values(Je).map(t=>({name:t.metadata.name,value:t,description:t.metadata.description}));if(e.length===0)throw new Error(pe("No templates found."));return Tn({message:"Select a template",choices:e.map(({name:t,value:n,description:r})=>({name:`${_o(t)}
|
|
764
|
-
${T(r)}`,value:n}))})}async function ii(e,t){let n=t.map(async({filepath:r,contents:o})=>{let i=oo.default.join(e,r);await no.default.mkdir(oo.default.dirname(i),{recursive:!0}),await no.default.writeFile(i,o,Buffer.isBuffer(o)?void 0:{encoding:"utf-8"})});await Promise.all(n)}var It=class extends z.Command{static paths=[z.Command.Default];static usage=z.Command.Usage({description:"Create a new Datadog App",examples:[["Create a new app interactively","npm init @datadog/apps my-app"],["Create a new app non-interactively","npm init @datadog/apps my-app --template vite-react -y"],["Create an app with a custom name and site",'npm init @datadog/apps my-app --name "My App" --site datadoghq.eu -y']]});directory=z.Option.String({required:!1});template=z.Option.String("--template",{required:!1,description:"Template to use (e.g., vite-react)"});appName=z.Option.String("--name",{required:!1,description:"App name (user-facing)"});datadogSite=z.Option.String("--site",{required:!1,description:"Datadog site (e.g. datadoghq.com, datadoghq.eu)"});yes=z.Option.Boolean("--yes,-y",{description:"Accept all defaults without prompting"});overwrite=z.Option.Boolean("--overwrite",{description:"Overwrite existing directory without prompting"});validate=z.Option.Boolean("--validate",{description:"Validate templates and exit"});skipPostScaffold=z.Option.Boolean("--skip-post-scaffold",{description:"Skip post-scaffold commands"});async execute(){if(console.log($o),console.log(),console.log(),this.validate)return oi();try{let t=await Jr(this.directory,this.overwrite,this.yes,this.appName,this.datadogSite),n=si.default.resolve(process.cwd(),t.directory),r=this.template?ro(this.template):this.yes?ro("vite-react"):await ri(),o=r.metadata;console.log(),console.log(),console.log(`Creating ${M(t.name)} in ${M(n)}...`),console.log(),console.log();let i=r.files.map(a=>({filepath:a.filepath,contents:a.contents({name:t.name,directoryName:t.directoryName,datadogSite:t.datadogSite})}));return await ii(n,i),await Wr(n,o,this.skipPostScaffold,this.yes),console.log(tr(t)),0}catch(t){if(t instanceof Error&&t.name==="ExitPromptError")console.log(Dn());else if(t instanceof Error&&t.message==="Operation cancelled by user")console.log(Dn());else throw t;return 1}}};var ai="0.0.
|
|
768
|
+
${T(r)}`,value:n}))})}async function ii(e,t){let n=t.map(async({filepath:r,contents:o})=>{let i=oo.default.join(e,r);await no.default.mkdir(oo.default.dirname(i),{recursive:!0}),await no.default.writeFile(i,o,Buffer.isBuffer(o)?void 0:{encoding:"utf-8"})});await Promise.all(n)}var It=class extends z.Command{static paths=[z.Command.Default];static usage=z.Command.Usage({description:"Create a new Datadog App",examples:[["Create a new app interactively","npm init @datadog/apps my-app"],["Create a new app non-interactively","npm init @datadog/apps my-app --template vite-react -y"],["Create an app with a custom name and site",'npm init @datadog/apps my-app --name "My App" --site datadoghq.eu -y']]});directory=z.Option.String({required:!1});template=z.Option.String("--template",{required:!1,description:"Template to use (e.g., vite-react)"});appName=z.Option.String("--name",{required:!1,description:"App name (user-facing)"});datadogSite=z.Option.String("--site",{required:!1,description:"Datadog site (e.g. datadoghq.com, datadoghq.eu)"});yes=z.Option.Boolean("--yes,-y",{description:"Accept all defaults without prompting"});overwrite=z.Option.Boolean("--overwrite",{description:"Overwrite existing directory without prompting"});validate=z.Option.Boolean("--validate",{description:"Validate templates and exit"});skipPostScaffold=z.Option.Boolean("--skip-post-scaffold",{description:"Skip post-scaffold commands"});async execute(){if(console.log($o),console.log(),console.log(),this.validate)return oi();try{let t=await Jr(this.directory,this.overwrite,this.yes,this.appName,this.datadogSite),n=si.default.resolve(process.cwd(),t.directory),r=this.template?ro(this.template):this.yes?ro("vite-react"):await ri(),o=r.metadata;console.log(),console.log(),console.log(`Creating ${M(t.name)} in ${M(n)}...`),console.log(),console.log();let i=r.files.map(a=>({filepath:a.filepath,contents:a.contents({name:t.name,directoryName:t.directoryName,datadogSite:t.datadogSite})}));return await ii(n,i),await Wr(n,o,this.skipPostScaffold,this.yes),console.log(tr(t)),0}catch(t){if(t instanceof Error&&t.name==="ExitPromptError")console.log(Dn());else if(t instanceof Error&&t.message==="Operation cancelled by user")console.log(Dn());else throw t;return 1}}};var ai="0.0.14";var Tt=new _e.Cli({binaryLabel:"create-apps",binaryName:"npm init @datadog/apps",binaryVersion:ai});Tt.register(It);Tt.register(_e.Builtins.HelpCommand);Tt.register(_e.Builtins.VersionCommand);Tt.runExit(process.argv.slice(2));
|