@uniformdev/context 12.2.1-alpha.177 → 14.2.1-alpha.119
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/api/api.d.ts +17 -1401
- package/dist/api/api.js +2 -2
- package/dist/api/api.mjs +1 -1
- package/dist/chunk-5UOAJNMX.mjs +2 -0
- package/dist/{chunk-KZPEO35A.mjs → chunk-AFJ7PNM5.mjs} +0 -0
- package/dist/chunk-CEKV2MHL.mjs +1 -0
- package/dist/cli/cli.d.ts +14 -1
- package/dist/cli/cli.js +63 -52
- package/dist/cli/cli.mjs +62 -51
- package/dist/contextTypes-7f24fc7c.d.ts +1534 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.esm.js +3 -3
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/dist/{types-1ad8439c.d.ts → types-d77228a6.d.ts} +35 -290
- package/dist/v2-manifest.swagger-d0899723.d.ts +285 -0
- package/package.json +6 -19
- package/dist/chunk-GU2YFM6V.mjs +0 -1
- package/dist/chunk-JKQJOIRC.mjs +0 -2
package/dist/cli/cli.js
CHANGED
@@ -1,13 +1,18 @@
|
|
1
|
-
var bl=Object.create;var xn=Object.defineProperty;var wl=Object.getOwnPropertyDescriptor;var Al=Object.getOwnPropertyNames;var xl=Object.getPrototypeOf,Cl=Object.prototype.hasOwnProperty;var Ol=(e,t,n)=>t in e?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var jr=e=>xn(e,"__esModule",{value:!0});var vl=(e,t)=>()=>(e&&(t=e(e=0)),t);var El=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_l=(e,t)=>{for(var n in t)xn(e,n,{get:t[n],enumerable:!0})},Ir=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Al(t))!Cl.call(e,r)&&(n||r!=="default")&&xn(e,r,{get:()=>t[r],enumerable:!(i=wl(t,r))||i.enumerable});return e},Q=(e,t)=>Ir(jr(xn(e!=null?bl(xl(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Sl=(e=>(t,n)=>e&&e.get(t)||(n=Ir(jr({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var Mr=(e,t,n)=>(Ol(e,typeof t!="symbol"?t+"":t,n),n),Pl=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ce=(e,t,n)=>(Pl(e,t,"read from private field"),n?n.call(e):t.get(e)),Ve=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var jl,O,g=vl(()=>{jl=()=>typeof document=="undefined"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,O=jl()});var aa=El((Dn,gn)=>{g();var Lu=200,hr="__lodash_hash_undefined__",Fs=1,pi=2,Ls=9007199254740991,hi="[object Arguments]",mr="[object Array]",Ds="[object Boolean]",Ns="[object Date]",Ts="[object Error]",Us="[object Function]",Du="[object GeneratorFunction]",mi="[object Map]",Rs="[object Number]",hn="[object Object]",$s="[object Promise]",Ws="[object RegExp]",gi="[object Set]",ks="[object String]",Nu="[object Symbol]",gr="[object WeakMap]",Hs="[object ArrayBuffer]",yi="[object DataView]",Tu="[object Float32Array]",Uu="[object Float64Array]",Ru="[object Int8Array]",$u="[object Int16Array]",Wu="[object Int32Array]",ku="[object Uint8Array]",Hu="[object Uint8ClampedArray]",Yu="[object Uint16Array]",Gu="[object Uint32Array]",Bu=/[\\^$.*+?()[\]{}|]/g,qu=/^\[object .+?Constructor\]$/,zu=/^(?:0|[1-9]\d*)$/,X={};X[Tu]=X[Uu]=X[Ru]=X[$u]=X[Wu]=X[ku]=X[Hu]=X[Yu]=X[Gu]=!0;X[hi]=X[mr]=X[Hs]=X[Ds]=X[yi]=X[Ns]=X[Ts]=X[Us]=X[mi]=X[Rs]=X[hn]=X[Ws]=X[gi]=X[ks]=X[gr]=!1;var Ys=typeof global=="object"&&global&&global.Object===Object&&global,Vu=typeof self=="object"&&self&&self.Object===Object&&self,yt=Ys||Vu||Function("return this")(),Gs=typeof Dn=="object"&&Dn&&!Dn.nodeType&&Dn,Bs=Gs&&typeof gn=="object"&&gn&&!gn.nodeType&&gn,Qu=Bs&&Bs.exports===Gs,qs=Qu&&Ys.process,zs=function(){try{return qs&&qs.binding("util")}catch(e){}}(),Vs=zs&&zs.isTypedArray;function Ku(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function Ju(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function Zu(e){return function(t){return e(t)}}function Xu(e,t){return e==null?void 0:e[t]}function yr(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function ed(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function td(e,t){return function(n){return e(t(n))}}function nd(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var id=Array.prototype,rd=Function.prototype,bi=Object.prototype,br=yt["__core-js_shared__"],Qs=function(){var e=/[^.]+$/.exec(br&&br.keys&&br.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ks=rd.toString,st=bi.hasOwnProperty,Mn=bi.toString,od=RegExp("^"+Ks.call(st).replace(Bu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Js=yt.Symbol,Zs=yt.Uint8Array,sd=bi.propertyIsEnumerable,ad=id.splice,ld=td(Object.keys,Object),wr=mn(yt,"DataView"),Fn=mn(yt,"Map"),Ar=mn(yt,"Promise"),xr=mn(yt,"Set"),Cr=mn(yt,"WeakMap"),Ln=mn(Object,"create"),cd=Kt(wr),fd=Kt(Fn),ud=Kt(Ar),dd=Kt(xr),pd=Kt(Cr),Xs=Js?Js.prototype:void 0,Or=Xs?Xs.valueOf:void 0;function Vt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function hd(){this.__data__=Ln?Ln(null):{}}function md(e){return this.has(e)&&delete this.__data__[e]}function gd(e){var t=this.__data__;if(Ln){var n=t[e];return n===hr?void 0:n}return st.call(t,e)?t[e]:void 0}function yd(e){var t=this.__data__;return Ln?t[e]!==void 0:st.call(t,e)}function bd(e,t){var n=this.__data__;return n[e]=Ln&&t===void 0?hr:t,this}Vt.prototype.clear=hd;Vt.prototype.delete=md;Vt.prototype.get=gd;Vt.prototype.has=yd;Vt.prototype.set=bd;function at(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function wd(){this.__data__=[]}function Ad(e){var t=this.__data__,n=Ai(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():ad.call(t,n,1),!0}function xd(e){var t=this.__data__,n=Ai(t,e);return n<0?void 0:t[n][1]}function Cd(e){return Ai(this.__data__,e)>-1}function Od(e,t){var n=this.__data__,i=Ai(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}at.prototype.clear=wd;at.prototype.delete=Ad;at.prototype.get=xd;at.prototype.has=Cd;at.prototype.set=Od;function Qt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function vd(){this.__data__={hash:new Vt,map:new(Fn||at),string:new Vt}}function Ed(e){return xi(this,e).delete(e)}function _d(e){return xi(this,e).get(e)}function Sd(e){return xi(this,e).has(e)}function Pd(e,t){return xi(this,e).set(e,t),this}Qt.prototype.clear=vd;Qt.prototype.delete=Ed;Qt.prototype.get=_d;Qt.prototype.has=Sd;Qt.prototype.set=Pd;function wi(e){var t=-1,n=e?e.length:0;for(this.__data__=new Qt;++t<n;)this.add(e[t])}function jd(e){return this.__data__.set(e,hr),this}function Id(e){return this.__data__.has(e)}wi.prototype.add=wi.prototype.push=jd;wi.prototype.has=Id;function bt(e){this.__data__=new at(e)}function Md(){this.__data__=new at}function Fd(e){return this.__data__.delete(e)}function Ld(e){return this.__data__.get(e)}function Dd(e){return this.__data__.has(e)}function Nd(e,t){var n=this.__data__;if(n instanceof at){var i=n.__data__;if(!Fn||i.length<Lu-1)return i.push([e,t]),this;n=this.__data__=new Qt(i)}return n.set(e,t),this}bt.prototype.clear=Md;bt.prototype.delete=Fd;bt.prototype.get=Ld;bt.prototype.has=Dd;bt.prototype.set=Nd;function Td(e,t){var n=vr(e)||Vd(e)?Ju(e.length,String):[],i=n.length,r=!!i;for(var o in e)(t||st.call(e,o))&&!(r&&(o=="length"||Gd(o,i)))&&n.push(o);return n}function Ai(e,t){for(var n=e.length;n--;)if(na(e[n][0],t))return n;return-1}function Ud(e){return Mn.call(e)}function ea(e,t,n,i,r){return e===t?!0:e==null||t==null||!Er(e)&&!_r(t)?e!==e&&t!==t:Rd(e,t,ea,n,i,r)}function Rd(e,t,n,i,r,o){var s=vr(e),a=vr(t),l=mr,u=mr;s||(l=wt(e),l=l==hi?hn:l),a||(u=wt(t),u=u==hi?hn:u);var d=l==hn&&!yr(e),f=u==hn&&!yr(t),p=l==u;if(p&&!d)return o||(o=new bt),s||Jd(e)?ta(e,t,n,i,r,o):Hd(e,t,l,n,i,r,o);if(!(r&pi)){var y=d&&st.call(e,"__wrapped__"),C=f&&st.call(t,"__wrapped__");if(y||C){var A=y?e.value():e,m=C?t.value():t;return o||(o=new bt),n(A,m,i,r,o)}}return p?(o||(o=new bt),Yd(e,t,n,i,r,o)):!1}function $d(e){if(!Er(e)||qd(e))return!1;var t=ra(e)||yr(e)?od:qu;return t.test(Kt(e))}function Wd(e){return _r(e)&&oa(e.length)&&!!X[Mn.call(e)]}function kd(e){if(!zd(e))return ld(e);var t=[];for(var n in Object(e))st.call(e,n)&&n!="constructor"&&t.push(n);return t}function ta(e,t,n,i,r,o){var s=r&pi,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var d=-1,f=!0,p=r&Fs?new wi:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var y=e[d],C=t[d];if(i)var A=s?i(C,y,d,t,e,o):i(y,C,d,e,t,o);if(A!==void 0){if(A)continue;f=!1;break}if(p){if(!Ku(t,function(m,P){if(!p.has(P)&&(y===m||n(y,m,i,r,o)))return p.add(P)})){f=!1;break}}else if(!(y===C||n(y,C,i,r,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function Hd(e,t,n,i,r,o,s){switch(n){case yi:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Hs:return!(e.byteLength!=t.byteLength||!i(new Zs(e),new Zs(t)));case Ds:case Ns:case Rs:return na(+e,+t);case Ts:return e.name==t.name&&e.message==t.message;case Ws:case ks:return e==t+"";case mi:var a=ed;case gi:var l=oπif(a||(a=nd),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;o|=Fs,s.set(e,t);var d=ta(a(e),a(t),i,r,o,s);return s.delete(e),d;case Nu:if(Or)return Or.call(e)==Or.call(t)}return!1}function Yd(e,t,n,i,r,o){var s=r&pi,a=sa(e),l=a.length,u=sa(t),d=u.length;if(l!=d&&!s)return!1;for(var f=l;f--;){var p=a[f];if(!(s?p in t:st.call(t,p)))return!1}var y=o.get(e);if(y&&o.get(t))return y==t;var C=!0;o.set(e,t),o.set(t,e);for(var A=s;++f<l;){p=a[f];var m=e[p],P=t[p];if(i)var E=s?i(P,m,p,t,e,o):i(m,P,p,e,t,o);if(!(E===void 0?m===P||n(m,P,i,r,o):E)){C=!1;break}A||(A=p=="constructor")}if(C&&!A){var G=e.constructor,B=t.constructor;G!=B&&"constructor"in e&&"constructor"in t&&!(typeof G=="function"&&G instanceof G&&typeof B=="function"&&B instanceof B)&&(C=!1)}return o.delete(e),o.delete(t),C}function xi(e,t){var n=e.__data__;return Bd(t)?n[typeof t=="string"?"string":"hash"]:n.map}function mn(e,t){var n=Xu(e,t);return $d(n)?n:void 0}var wt=Ud;(wr&&wt(new wr(new ArrayBuffer(1)))!=yi||Fn&&wt(new Fn)!=mi||Ar&&wt(Ar.resolve())!=$s||xr&&wt(new xr)!=gi||Cr&&wt(new Cr)!=gr)&&(wt=function(e){var t=Mn.call(e),n=t==hn?e.constructor:void 0,i=n?Kt(n):void 0;if(i)switch(i){case cd:return yi;case fd:return mi;case ud:return $s;case dd:return gi;case pd:return gr}return t});function Gd(e,t){return t=t==null?Ls:t,!!t&&(typeof e=="number"||zu.test(e))&&e>-1&&e%1==0&&e<t}function Bd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function qd(e){return!!Qs&&Qs in e}function zd(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||bi;return e===n}function Kt(e){if(e!=null){try{return Ks.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function na(e,t){return e===t||e!==e&&t!==t}function Vd(e){return Qd(e)&&st.call(e,"callee")&&(!sd.call(e,"callee")||Mn.call(e)==hi)}var vr=Array.isArray;function ia(e){return e!=null&&oa(e.length)&&!ra(e)}function Qd(e){return _r(e)&&ia(e)}function Kd(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?ea(e,t,n):!!i}function ra(e){var t=Er(e)?Mn.call(e):"";return t==Us||t==Du}function oa(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ls}function Er(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function _r(e){return!!e&&typeof e=="object"}var Jd=Vs?Zu(Vs):Wd;function sa(e){return ia(e)?Td(e):kd(e)}gn.exports=Kd});var ep={};_l(ep,{uniformCLI:()=>Xd});g();g();g();var Vn=require("assert");g();g();var Il={right:Nl,center:Tl},Ml=0,Hn=1,Fl=2,Yn=3,Fr=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(i=>typeof i=="string"?this.colFromString(i):i);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(`
|
2
|
-
|
3
|
-
`)
|
4
|
-
|
5
|
-
`
|
6
|
-
`),r+=e.charAt(o);return n&&i&&(r=`${n}${r}${i}`),r}function Li(e){return Dr(e,{stringWidth:t=>[...t].length,stripAnsi:Fi,wrap:Tr})}g();var tn=require("path"),Gn=require("fs");function Ur(e,t){let n=(0,tn.resolve)(".",e),i;for((0,Gn.statSync)(n).isDirectory()||(n=(0,tn.dirname)(n));;){if(i=t(n,(0,Gn.readdirSync)(n)),i)return(0,tn.resolve)(n,i);if(n=(0,tn.dirname)(i=n),i===n)break}}var Zr=require("util"),Xr=require("fs"),eo=require("url");g();var Wr=require("util"),zn=require("path");g();function Lt(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let n="",i=!1,r=e.match(/^-+/);for(let o=r?r[0].length:0;o<e.length;o++){let s=e.charAt(o);i&&(i=!1,s=s.toUpperCase()),o!==0&&(s==="-"||s==="_")?i=!0:s!=="-"&&s!=="_"&&(n+=s)}return n}}function Bn(e,t){let n=e.toLowerCase();t=t||"-";let i="";for(let r=0;r<e.length;r++){let o=n.charAt(r),s=e.charAt(r);o!==s&&r>0?i+=`${t}${n.charAt(r)}`:i+=s}return i}function qn(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}g();g();function Rr(e){if(Array.isArray(e))return e.map(s=>typeof s!="string"?s+"":s);e=e.trim();let t=0,n=null,i=null,r=null,o=[];for(let s=0;s<e.length;s++){if(n=i,i=e.charAt(s),i===" "&&!r){n!==" "&&t++;continue}i===r?r=null:(i==="'"||i==='"')&&!r&&(r=i),o[t]||(o[t]=""),o[t]+=i}return o}g();var $e;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})($e||($e={}));var it,Di=class{constructor(t){it=t}parse(t,n){let i=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},n),r=Rr(t),o=typeof t=="string",s=Ul(Object.assign(Object.create(null),i.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},i.configuration),l=Object.assign(Object.create(null),i.default),u=i.configObjects||[],d=i.envPrefix,f=a["populate--"],p=f?"--":"_",y=Object.create(null),C=Object.create(null),A=i.__||it.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},P=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,E=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(h){let w=typeof h=="object"?h.key:h,v=Object.keys(h).map(function(x){return{boolean:"bools",string:"strings",number:"numbers"}[x]}).filter(Boolean).pop();v&&(m[v][w]=!0),m.arrays[w]=!0,m.keys.push(w)}),[].concat(i.boolean||[]).filter(Boolean).forEach(function(h){m.bools[h]=!0,m.keys.push(h)}),[].concat(i.string||[]).filter(Boolean).forEach(function(h){m.strings[h]=!0,m.keys.push(h)}),[].concat(i.number||[]).filter(Boolean).forEach(function(h){m.numbers[h]=!0,m.keys.push(h)}),[].concat(i.count||[]).filter(Boolean).forEach(function(h){m.counts[h]=!0,m.keys.push(h)}),[].concat(i.normalize||[]).filter(Boolean).forEach(function(h){m.normalize[h]=!0,m.keys.push(h)}),typeof i.narg=="object"&&Object.entries(i.narg).forEach(([h,w])=>{typeof w=="number"&&(m.nargs[h]=w,m.keys.push(h))}),typeof i.coerce=="object"&&Object.entries(i.coerce).forEach(([h,w])=>{typeof w=="function"&&(m.coercions[h]=w,m.keys.push(h))}),typeof i.config!="undefined"&&(Array.isArray(i.config)||typeof i.config=="string"?[].concat(i.config).filter(Boolean).forEach(function(h){m.configs[h]=!0}):typeof i.config=="object"&&Object.entries(i.config).forEach(([h,w])=>{(typeof w=="boolean"||typeof w=="function")&&(m.configs[h]=w)})),Ft(i.key,s,i.default,m.arrays),Object.keys(l).forEach(function(h){(m.aliases[h]||[]).forEach(function(w){l[w]=l[h]})});let G=null;kn();let B=[],V=Object.assign(Object.create(null),{_:[]}),lt={};for(let h=0;h<r.length;h++){let w=r[h],v=w.replace(/^-{3,}/,"---"),x,b,F,S,D,pe;if(w!=="--"&&ie(w))Be(w);else if(v.match(/---+(=|$)/)){Be(w);continue}else if(w.match(/^--.+=/)||!a["short-option-groups"]&&w.match(/^-.+=/))S=w.match(/^--?([^=]+)=([\s\S]*)$/),S!==null&&Array.isArray(S)&&S.length>=3&&(R(S[1],m.arrays)?h=It(h,S[1],r,S[2]):R(S[1],m.nargs)!==!1?h=en(h,S[1],r,S[2]):K(S[1],S[2],!0));else if(w.match(E)&&a["boolean-negation"])S=w.match(E),S!==null&&Array.isArray(S)&&S.length>=2&&(b=S[1],K(b,R(b,m.arrays)?[!1]:!1));else if(w.match(/^--.+/)||!a["short-option-groups"]&&w.match(/^-[^-]+/))S=w.match(/^--?(.+)/),S!==null&&Array.isArray(S)&&S.length>=2&&(b=S[1],R(b,m.arrays)?h=It(h,b,r):R(b,m.nargs)!==!1?h=en(h,b,r):(D=r[h+1],D!==void 0&&(!D.match(/^-/)||D.match(P))&&!R(b,m.bools)&&!R(b,m.counts)||/^(true|false)$/.test(D)?(K(b,D),h++):K(b,re(b))));else if(w.match(/^-.\..+=/))S=w.match(/^-([^=]+)=([\s\S]*)$/),S!==null&&Array.isArray(S)&&S.length>=3&&K(S[1],S[2]);else if(w.match(/^-.\..+/)&&!w.match(P))D=r[h+1],S=w.match(/^-(.\..+)/),S!==null&&Array.isArray(S)&&S.length>=2&&(b=S[1],D!==void 0&&!D.match(/^-/)&&!R(b,m.bools)&&!R(b,m.counts)?(K(b,D),h++):K(b,re(b)));else if(w.match(/^-[^-]+/)&&!w.match(P)){F=w.slice(1,-1).split(""),x=!1;for(let Se=0;Se<F.length;Se++){if(D=w.slice(Se+2),F[Se+1]&&F[Se+1]==="="){pe=w.slice(Se+3),b=F[Se],R(b,m.arrays)?h=It(h,b,r,pe):R(b,m.nargs)!==!1?h=en(h,b,r,pe):K(b,pe),x=!0;break}if(D==="-"){K(F[Se],D);continue}if(/[A-Za-z]/.test(F[Se])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(D)&&R(D,m.bools)===!1){K(F[Se],D),x=!0;break}if(F[Se+1]&&F[Se+1].match(/\W/)){K(F[Se],D),x=!0;break}else K(F[Se],re(F[Se]))}b=w.slice(-1)[0],!x&&b!=="-"&&(R(b,m.arrays)?h=It(h,b,r):R(b,m.nargs)!==!1?h=en(h,b,r):(D=r[h+1],D!==void 0&&(!/^(-|--)[^-]/.test(D)||D.match(P))&&!R(b,m.bools)&&!R(b,m.counts)||/^(true|false)$/.test(D)?(K(b,D),h++):K(b,re(b))))}else if(w.match(/^-[0-9]$/)&&w.match(P)&&R(w.slice(1),m.bools))b=w.slice(1),K(b,re(b));else if(w==="--"){B=r.slice(h+1);break}else if(a["halt-at-non-option"]){B=r.slice(h);break}else Be(w)}z(V,!0),z(V,!1),H(V),se(),ne(V,m.aliases,l,!0),ue(V),a["set-placeholder-key"]&&Mt(V),Object.keys(m.counts).forEach(function(h){tt(V,h.split("."))||K(h,0)}),f&&B.length&&(V[p]=[]),B.forEach(function(h){V[p].push(h)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(V).filter(h=>h!=="--"&&h.includes("-")).forEach(h=>{delete V[h]}),a["strip-aliased"]&&[].concat(...Object.keys(s).map(h=>s[h])).forEach(h=>{a["camel-case-expansion"]&&h.includes("-")&&delete V[h.split(".").map(w=>Lt(w)).join(".")],delete V[h]});function Be(h){let w=T("_",h);(typeof w=="string"||typeof w=="number")&&V._.push(w)}function en(h,w,v,x){let b,F=R(w,m.nargs);if(F=typeof F!="number"||isNaN(F)?1:F,F===0)return ze(x)||(G=Error(A("Argument unexpected for: %s",w))),K(w,re(w)),h;let S=ze(x)?0:1;if(a["nargs-eats-options"])v.length-(h+1)+S<F&&(G=Error(A("Not enough arguments following: %s",w))),S=F;else{for(b=h+1;b<v.length&&(!v[b].match(/^-[^0-9]/)||v[b].match(P)||ie(v[b]));b++)S++;S<F&&(G=Error(A("Not enough arguments following: %s",w)))}let D=Math.min(S,F);for(!ze(x)&&D>0&&(K(w,x),D--),b=h+1;b<D+h+1;b++)K(w,v[b]);return h+D}function It(h,w,v,x){let b=[],F=x||v[h+1],S=R(w,m.nargs);if(R(w,m.bools)&&!/^(true|false)$/.test(F))b.push(!0);else if(ze(F)||ze(x)&&/^-/.test(F)&&!P.test(F)&&!ie(F)){if(l[w]!==void 0){let D=l[w];b=Array.isArray(D)?D:[D]}}else{ze(x)||b.push(_(w,x,!0));for(let D=h+1;D<v.length&&!(!a["greedy-arrays"]&&b.length>0||S&&typeof S=="number"&&b.length>=S||(F=v[D],/^-/.test(F)&&!P.test(F)&&!ie(F)));D++)h=D,b.push(_(w,F,o))}return typeof S=="number"&&(S&&b.length<S||isNaN(S)&&b.length===0)&&(G=Error(A("Not enough arguments following: %s",w))),K(w,b),h}function K(h,w,v=o){if(/-/.test(h)&&a["camel-case-expansion"]){let F=h.split(".").map(function(S){return Lt(S)}).join(".");M(h,F)}let x=_(h,w,v),b=h.split(".");nt(V,b,x),m.aliases[h]&&m.aliases[h].forEach(function(F){let S=F.split(".");nt(V,S,x)}),b.length>1&&a["dot-notation"]&&(m.aliases[b[0]]||[]).forEach(function(F){let S=F.split("."),D=[].concat(b);D.shift(),S=S.concat(D),(m.aliases[h]||[]).includes(S.join("."))||nt(V,S,x)}),R(h,m.normalize)&&!R(h,m.arrays)&&[h].concat(m.aliases[h]||[]).forEach(function(S){Object.defineProperty(lt,S,{enumerable:!0,get(){return w},set(D){w=typeof D=="string"?it.normalize(D):D}})})}function M(h,w){m.aliases[h]&&m.aliases[h].length||(m.aliases[h]=[w],y[w]=!0),m.aliases[w]&&m.aliases[w].length||M(w,h)}function _(h,w,v){v&&(w=Rl(w)),(R(h,m.bools)||R(h,m.counts))&&typeof w=="string"&&(w=w==="true");let x=Array.isArray(w)?w.map(function(b){return T(h,b)}):T(h,w);return R(h,m.counts)&&(ze(x)||typeof x=="boolean")&&(x=Ni()),R(h,m.normalize)&&R(h,m.arrays)&&(Array.isArray(w)?x=w.map(b=>it.normalize(b)):x=it.normalize(w)),x}function T(h,w){return!a["parse-positional-numbers"]&&h==="_"||!R(h,m.strings)&&!R(h,m.bools)&&!Array.isArray(w)&&(qn(w)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${w}`)))||!ze(w)&&R(h,m.numbers))&&(w=Number(w)),w}function H(h){let w=Object.create(null);ne(w,m.aliases,l),Object.keys(m.configs).forEach(function(v){let x=h[v]||w[v];if(x)try{let b=null,F=it.resolve(it.cwd(),x),S=m.configs[v];if(typeof S=="function"){try{b=S(F)}catch(D){b=D}if(b instanceof Error){G=b;return}}else b=it.require(F);J(b)}catch(b){b.name==="PermissionDenied"?G=b:h[v]&&(G=Error(A("Invalid JSON config file: %s",x)))}})}function J(h,w){Object.keys(h).forEach(function(v){let x=h[v],b=w?w+"."+v:v;typeof x=="object"&&x!==null&&!Array.isArray(x)&&a["dot-notation"]?J(x,b):(!tt(V,b.split("."))||R(b,m.arrays)&&a["combine-arrays"])&&K(b,x)})}function se(){typeof u!="undefined"&&u.forEach(function(h){J(h)})}function z(h,w){if(typeof d=="undefined")return;let v=typeof d=="string"?d:"",x=it.env();Object.keys(x).forEach(function(b){if(v===""||b.lastIndexOf(v,0)===0){let F=b.split("__").map(function(S,D){return D===0&&(S=S.substring(v.length)),Lt(S)});(w&&m.configs[F.join(".")]||!w)&&!tt(h,F)&&K(F.join("."),x[b])}})}function ue(h){let w,v=new Set;Object.keys(h).forEach(function(x){if(!v.has(x)&&(w=R(x,m.coercions),typeof w=="function"))try{let b=T(x,w(h[x]));[].concat(m.aliases[x]||[],x).forEach(F=>{v.add(F),h[F]=b})}catch(b){G=b}})}function Mt(h){return m.keys.forEach(w=>{~w.indexOf(".")||typeof h[w]=="undefined"&&(h[w]=void 0)}),h}function ne(h,w,v,x=!1){Object.keys(v).forEach(function(b){tt(h,b.split("."))||(nt(h,b.split("."),v[b]),x&&(C[b]=!0),(w[b]||[]).forEach(function(F){tt(h,F.split("."))||nt(h,F.split("."),v[b])}))})}function tt(h,w){let v=h;a["dot-notation"]||(w=[w.join(".")]),w.slice(0,-1).forEach(function(b){v=v[b]||{}});let x=w[w.length-1];return typeof v!="object"?!1:x in v}function nt(h,w,v){let x=h;a["dot-notation"]||(w=[w.join(".")]),w.slice(0,-1).forEach(function(pe){pe=$r(pe),typeof x=="object"&&x[pe]===void 0&&(x[pe]={}),typeof x[pe]!="object"||Array.isArray(x[pe])?(Array.isArray(x[pe])?x[pe].push({}):x[pe]=[x[pe],{}],x=x[pe][x[pe].length-1]):x=x[pe]});let b=$r(w[w.length-1]),F=R(w.join("."),m.arrays),S=Array.isArray(v),D=a["duplicate-arguments-array"];!D&&R(b,m.nargs)&&(D=!0,(!ze(x[b])&&m.nargs[b]===1||Array.isArray(x[b])&&x[b].length===m.nargs[b])&&(x[b]=void 0)),v===Ni()?x[b]=Ni(x[b]):Array.isArray(x[b])?D&&F&&S?x[b]=a["flatten-duplicate-arrays"]?x[b].concat(v):(Array.isArray(x[b][0])?x[b]:[x[b]]).concat([v]):!D&&Boolean(F)===Boolean(S)?x[b]=v:x[b]=x[b].concat([v]):x[b]===void 0&&F?x[b]=S?v:[v]:D&&!(x[b]===void 0||R(b,m.counts)||R(b,m.bools))?x[b]=[x[b],v]:x[b]=v}function Ft(...h){h.forEach(function(w){Object.keys(w||{}).forEach(function(v){m.aliases[v]||(m.aliases[v]=[].concat(s[v]||[]),m.aliases[v].concat(v).forEach(function(x){if(/-/.test(x)&&a["camel-case-expansion"]){let b=Lt(x);b!==v&&m.aliases[v].indexOf(b)===-1&&(m.aliases[v].push(b),y[b]=!0)}}),m.aliases[v].concat(v).forEach(function(x){if(x.length>1&&/[A-Z]/.test(x)&&a["camel-case-expansion"]){let b=Bn(x,"-");b!==v&&m.aliases[v].indexOf(b)===-1&&(m.aliases[v].push(b),y[b]=!0)}}),m.aliases[v].forEach(function(x){m.aliases[x]=[v].concat(m.aliases[v].filter(function(b){return x!==b}))}))})})}function R(h,w){let v=[].concat(m.aliases[h]||[],h),x=Object.keys(w),b=v.find(F=>x.includes(F));return b?w[b]:!1}function Mi(h){let w=Object.keys(m);return[].concat(w.map(x=>m[x])).some(function(x){return Array.isArray(x)?x.includes(h):x[h]})}function U(h,...w){return[].concat(...w).some(function(x){let b=h.match(x);return b&&Mi(b[1])})}function ee(h){if(h.match(P)||!h.match(/^-[^-]+/))return!1;let w=!0,v,x=h.slice(1).split("");for(let b=0;b<x.length;b++){if(v=h.slice(b+2),!Mi(x[b])){w=!1;break}if(x[b+1]&&x[b+1]==="="||v==="-"||/[A-Za-z]/.test(x[b])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(v)||x[b+1]&&x[b+1].match(/\W/))break}return w}function ie(h){return a["unknown-options-as-args"]&&q(h)}function q(h){return h=h.replace(/^-{3,}/,"--"),h.match(P)||ee(h)?!1:!U(h,/^-+([^=]+?)=[\s\S]*$/,E,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function re(h){return!R(h,m.bools)&&!R(h,m.counts)&&`${h}`in l?l[h]:ae(qe(h))}function ae(h){return{[$e.BOOLEAN]:!0,[$e.STRING]:"",[$e.NUMBER]:void 0,[$e.ARRAY]:[]}[h]}function qe(h){let w=$e.BOOLEAN;return R(h,m.strings)?w=$e.STRING:R(h,m.numbers)?w=$e.NUMBER:R(h,m.bools)?w=$e.BOOLEAN:R(h,m.arrays)&&(w=$e.ARRAY),w}function ze(h){return h===void 0}function kn(){Object.keys(m.counts).find(h=>R(h,m.arrays)?(G=Error(A("Invalid configuration: %s, opts.count excludes opts.array.",h)),!0):R(h,m.nargs)?(G=Error(A("Invalid configuration: %s, opts.count excludes opts.narg.",h)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(lt,V),configuration:a,defaulted:Object.assign({},C),error:G,newAliases:Object.assign({},y)}}};function Ul(e){let t=[],n=Object.create(null),i=!0;for(Object.keys(e).forEach(function(r){t.push([].concat(e[r],r))});i;){i=!1;for(let r=0;r<t.length;r++)for(let o=r+1;o<t.length;o++)if(t[r].filter(function(a){return t[o].indexOf(a)!==-1}).length){t[r]=t[r].concat(t[o]),t.splice(o,1),i=!0;break}}return t.forEach(function(r){r=r.filter(function(s,a,l){return l.indexOf(s)===a});let o=r.pop();o!==void 0&&typeof o=="string"&&(n[o]=r)}),n}function Ni(e){return e!==void 0?e+1:1}function $r(e){return e==="__proto__"?"___proto___":e}function Rl(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}var kr=require("fs");var Hr=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<Hr)throw Error(`yargs parser supports a minimum Node.js version of ${Hr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var $l=process?process.env:{},Yr=new Di({cwd:process.cwd,env:()=>$l,format:Wr.format,normalize:zn.normalize,resolve:zn.resolve,require:e=>{if(typeof require!="undefined")return require(e);if(e.match(/\.json$/))return JSON.parse((0,kr.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),Cn=function(t,n){return Yr.parse(t.slice(),n).argv};Cn.detailed=function(e,t){return Yr.parse(e.slice(),t)};Cn.camelCase=Lt;Cn.decamelize=Bn;Cn.looksLikeNumber=qn;var Gr=Cn;var Ke=require("path");g();function Wl(){return kl()?0:1}function kl(){return Hl()&&!process.defaultApp}function Hl(){return!!process.versions.electron}function Br(){return process.argv[Wl()]}g();var Z=class extends Error{constructor(t){super(t||"yargs error");this.name="YError",Error.captureStackTrace(this,Z)}};g();g();var nn=require("fs"),qr=require("util"),zr=require("path"),Vr={fs:{readFileSync:nn.readFileSync,writeFile:nn.writeFile},format:qr.format,resolve:zr.resolve,exists:e=>{try{return(0,nn.statSync)(e).isFile()}catch(t){return!1}}};g();var Qe,Qr=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=t.shift(),i=function(){};return typeof t[t.length-1]=="function"&&(i=t.pop()),i=i||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i(),Qe.format.apply(Qe.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),i=t.shift(),r=t.shift(),o=function(){};typeof t[t.length-1]=="function"&&(o=t.pop()),this.cache[this.locale]||this._readLocaleFile();let s=r===1?n:i;this.cache[this.locale][n]&&(s=this.cache[this.locale][n][r===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:i},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let a=[s];return~s.indexOf("%d")&&a.push(r),Qe.format.apply(Qe.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let i="";return t.forEach(function(r,o){let s=n[o+1];i+=r,typeof s!="undefined"&&(i+="%s")}),this.__.apply(this,[i].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],i=n.directory,r=n.locale,o=n.cb,s=this._resolveLocaleFile(i,r),a=JSON.stringify(this.cache[r],null,2);Qe.fs.writeFile(s,a,"utf-8",function(l){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),o(l)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{Qe.fs.readFileSync&&(t=JSON.parse(Qe.fs.readFileSync(n,"utf-8")))}catch(i){if(i instanceof SyntaxError&&(i.message="syntax error in "+n),i.code==="ENOENT")t={};else throw i}this.cache[this.locale]=t}_resolveLocaleFile(t,n){let i=Qe.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(i)&&~n.lastIndexOf("_")){let r=Qe.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(i=r)}return i}_fileExistsSync(t){return Qe.exists(t)}};function Kr(e,t){Qe=t;let n=new Qr(e);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var Yl=e=>Kr(e,Vr),Jr=Yl;var Gl="require is not supported by ESM",to="loading a directory of commands is not supported yet for ESM",Qn;try{Qn=(0,eo.fileURLToPath)(O)}catch(e){Qn=process.cwd()}var Bl=Qn.split("node_modules")[0],no={assert:{notStrictEqual:Vn.notStrictEqual,strictEqual:Vn.strictEqual},cliui:Li,findUp:Ur,getEnv:e=>process.env[e],inspect:Zr.inspect,getCallerFile:()=>{throw new Z(to)},getProcessArgvBin:Br,mainFilename:Bl||process.cwd(),Parser:Gr,path:{basename:Ke.basename,dirname:Ke.dirname,extname:Ke.extname,relative:Ke.relative,resolve:Ke.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!="undefined"?process.stdout.columns:null},readFileSync:Xr.readFileSync,require:()=>{throw new Z(Gl)},requireDirectory:()=>{throw new Z(to)},stringWidth:e=>[...e].length,y18n:Jr({directory:(0,Ke.resolve)(Qn,"../../../locales"),updateFiles:!1})};g();g();g();function Pe(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function Ti(e,t){t.assert.strictEqual(typeof e,"string")}function rn(e){return Object.keys(e)}g();function te(e){return!!e&&!!e.then&&typeof e.then=="function"}g();g();g();function ct(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),i=/\.*[\][<>]/g,r=n.shift();if(!r)throw new Error(`No command found in: ${e}`);let o={cmd:r.replace(i,""),demanded:[],optional:[]};return n.forEach((s,a)=>{let l=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===n.length-1&&(l=!0),/^\[/.test(s)?o.optional.push({cmd:s.replace(i,"").split("|"),variadic:l}):o.demanded.push({cmd:s.replace(i,"").split("|"),variadic:l})}),o}var ql=["first","second","third","fourth","fifth","sixth"];function j(e,t,n){function i(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[ct(`cmd ${e}`),t,n]}try{let r=0,[o,s,a]=i(),l=[].slice.call(s);for(;l.length&&l[l.length-1]===void 0;)l.pop();let u=a||l.length;if(u<o.demanded.length)throw new Z(`Not enough arguments provided. Expected ${o.demanded.length} but received ${l.length}.`);let d=o.demanded.length+o.optional.length;if(u>d)throw new Z(`Too many arguments provided. Expected max ${d} but received ${u}.`);o.demanded.forEach(f=>{let p=l.shift(),y=io(p);f.cmd.filter(A=>A===y||A==="*").length===0&&ro(y,f.cmd,r),r+=1}),o.optional.forEach(f=>{if(l.length===0)return;let p=l.shift(),y=io(p);f.cmd.filter(A=>A===y||A==="*").length===0&&ro(y,f.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function io(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function ro(e,t,n){throw new Z(`Invalid ${ql[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var Ui=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,i=!0,r=!1){if(j("<array|function> [boolean] [boolean] [boolean]",[t,n,i],arguments.length),Array.isArray(t)){for(let o=0;o<t.length;o++){if(typeof t[o]!="function")throw Error("middleware must be a function");let s=t[o];s.applyBeforeValidation=n,s.global=i}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let o=t;o.applyBeforeValidation=n,o.global=i,o.mutates=r,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,n){let i=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(r=>{let o=[...i[n]||[],n];return r.option?!o.includes(r.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function oo(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Dt(e,t,n,i){return n.reduce((r,o)=>{if(o.applyBeforeValidation!==i)return r;if(o.mutates){if(o.applied)return r;o.applied=!0}if(te(r))return r.then(s=>Promise.all([s,o(s,t)])).then(([s,a])=>Object.assign(s,a));{let s=o(r,t);return te(s)?s.then(a=>Object.assign(r,a)):Object.assign(r,s)}},e)}g();function Nt(e,t,n=i=>{throw i}){try{let i=zl(e)?e():e;return te(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function zl(e){return typeof e=="function"}g();function Ri(e){if(typeof require=="undefined")return null;for(let t=0,n=Object.keys(require.cache),i;t<n.length;t++)if(i=require.cache[n[t]],i.exports===e)return i;return null}var on=/(^\*)|(^\$0)/,so=class{constructor(t,n,i,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=t,this.globalMiddleware=i,this.validation=n}addDirectory(t,n,i,r){r=r||{},typeof r.recurse!="boolean"&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=["js"]);let o=typeof r.visit=="function"?r.visit:s=>s;r.visit=(s,a,l)=>{let u=o(s,a,l);if(u){if(this.requireCache.has(a))return u;this.requireCache.add(a),this.addHandler(u)}return u},this.shim.requireDirectory({require:n,filename:i},t,r)}addHandler(t,n,i,r,o,s){let a=[],l=oo(o);if(r=r||(()=>{}),Array.isArray(t))if(Vl(t))[t,...a]=t;else for(let u of t)this.addHandler(u);else if(Kl(t)){let u=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(u=[].concat(u).concat(t.aliases)),this.addHandler(u,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(lo(i)){this.addHandler([t].concat(a),n,i.builder,i.handler,i.middlewares,i.deprecated);return}if(typeof t=="string"){let u=ct(t);a=a.map(p=>ct(p).cmd);let d=!1,f=[u.cmd].concat(a).filter(p=>on.test(p)?(d=!0,!1):!0);f.length===0&&d&&f.push("$0"),d&&(u.cmd=f[0],a=f.slice(1),t=t.replace(on,u.cmd)),a.forEach(p=>{this.aliasMap[p]=u.cmd}),n!==!1&&this.usage.command(t,n,d,a,s),this.handlers[u.cmd]={original:t,description:n,handler:r,builder:i||{},middlewares:l,deprecated:s,demanded:u.demanded,optional:u.optional},d&&(this.defaultCommand=this.handlers[u.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,n,i,r,o,s){let a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,l=n.getInternalMethods().getContext(),u=l.commands.slice(),d=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(d,a,n,i.aliases,u,r,o,s);return te(f)?f.then(p=>this.applyMiddlewareAndGetResult(d,a,p.innerArgv,l,o,p.aliases,n)):this.applyMiddlewareAndGetResult(d,a,f.innerArgv,l,o,f.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,i,r,o,s,a,l){let u=n.builder,d=i;if(Kn(u)){let f=u(i.getInternalMethods().reset(r),l);if(te(f))return f.then(p=>(d=co(p)?p:i,this.parseAndUpdateUsage(t,n,d,o,s,a)))}else Ql(u)&&(d=i.getInternalMethods().reset(r),Object.keys(n.builder).forEach(f=>{d.option(f,u[f])}));return this.parseAndUpdateUsage(t,n,d,o,s,a)}parseAndUpdateUsage(t,n,i,r,o,s){t&&i.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(i)&&i.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,n),n.description);let a=i.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,s);return te(a)?a.then(l=>({aliases:i.parsed.aliases,innerArgv:l})):{aliases:i.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,n){let i=on.test(n.original)?n.original.replace(on,"").trim():n.original,r=t.filter(o=>!on.test(o));return r.push(i),`$0 ${r.join(" ")}`}applyMiddlewareAndGetResult(t,n,i,r,o,s,a){let l={};if(o)return i;a.getInternalMethods().getHasOutput()||(l=this.populatePositionals(n,i,r,a));let u=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(i=Dt(i,a,u,!0),!a.getInternalMethods().getHasOutput()){let d=a.getInternalMethods().runValidation(s,l,a.parsed.error,t);i=Nt(i,f=>(d(f),f))}if(n.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let d=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(i,d,!1,!1),i=Dt(i,a,u,!1),i=Nt(i,f=>{let p=n.handler(f);return te(p)?p.then(()=>f):f}),t||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),te(i)&&!a.getInternalMethods().hasParseCallback()&&i.catch(f=>{try{a.getInternalMethods().getUsageInstance().fail(null,f)}catch(p){}})}return t||(r.commands.pop(),r.fullCommands.pop()),i}populatePositionals(t,n,i,r){n._=n._.slice(i.commands.length);let o=t.demanded.slice(0),s=t.optional.slice(0),a={};for(this.validation.positionalCount(o.length,n._.length);o.length;){let l=o.shift();this.populatePositional(l,n,a)}for(;s.length;){let l=s.shift();this.populatePositional(l,n,a)}return n._=i.commands.concat(n._.map(l=>""+l)),this.postProcessPositionals(n,a,this.cmdToParseOptions(t.original),r),a}populatePositional(t,n,i){let r=t.cmd[0];t.variadic?i[r]=n._.splice(0).map(String):n._.length&&(i[r]=[String(n._.shift())])}cmdToParseOptions(t){let n={array:[],default:{},alias:{},demand:{}},i=ct(t);return i.demanded.forEach(r=>{let[o,...s]=r.cmd;r.variadic&&(n.array.push(o),n.default[o]=[]),n.alias[o]=s,n.demand[o]=!0}),i.optional.forEach(r=>{let[o,...s]=r.cmd;r.variadic&&(n.array.push(o),n.default[o]=[]),n.alias[o]=s}),n}postProcessPositionals(t,n,i,r){let o=Object.assign({},r.getOptions());o.default=Object.assign(i.default,o.default);for(let u of Object.keys(i.alias))o.alias[u]=(o.alias[u]||[]).concat(i.alias[u]);o.array=o.array.concat(i.array),o.config={};let s=[];if(Object.keys(n).forEach(u=>{n[u].map(d=>{o.configuration["unknown-options-as-args"]&&(o.key[u]=!0),s.push(`--${u}`),s.push(d)})}),!s.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(s,Object.assign({},o,{configuration:a}));if(l.error)r.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let u=Object.keys(n);Object.keys(n).forEach(f=>{u.push(...l.aliases[f])});let d=r.getOptions().default;Object.keys(l.argv).forEach(f=>{u.includes(f)&&(n[f]||(n[f]=l.argv[f]),!Object.prototype.hasOwnProperty.call(d,f)&&Object.prototype.hasOwnProperty.call(t,f)&&Object.prototype.hasOwnProperty.call(l.argv,f)&&(Array.isArray(t[f])||Array.isArray(l.argv[f]))?t[f]=[].concat(t[f],l.argv[f]):t[f]=l.argv[f])})}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let i=on.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(i,this.defaultCommand.description)}let n=this.defaultCommand.builder;if(Kn(n))return n(t,!0);lo(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=Ri(t);if(!n)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(n.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:n,desc:i}){for(let r of[t,n,i]){if(typeof r=="string"||r===!1)return r;Pe(r,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();Pe(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function ao(e,t,n,i){return new so(e,t,n,i)}function lo(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Vl(e){return e.every(t=>typeof t=="string")}function Kn(e){return typeof e=="function"}function Ql(e){return typeof e=="object"}function Kl(e){return typeof e=="object"&&!Array.isArray(e)}g();g();function ft(e={},t=()=>!0){let n={};return rn(e).forEach(i=>{t(i,e[i])&&(n[i]=e[i])}),n}g();function ut(e){typeof process!="undefined"&&[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(e)})}function Jl(e){return typeof e=="boolean"}function fo(e,t){let n=t.y18n.__,i={},r=[];i.failFn=function(_){r.push(_)};let o=null,s=!0;i.showHelpOnFail=function(_=!0,T){function H(){return typeof _=="string"?[!0,_]:[_,T]}let[J,se]=H();return o=se,s=J,i};let a=!1;i.fail=function(_,T){let H=e.getInternalMethods().getLoggerInstance();if(r.length)for(let J=r.length-1;J>=0;--J){let se=r[J];if(Jl(se)){if(T)throw T;if(_)throw Error(_)}else se(_,T,i)}else{if(e.getExitProcess()&&ut(!0),a||(a=!0,s&&(e.showHelp("error"),H.error()),(_||T)&&H.error(_||T),o&&((_||T)&&H.error(""),H.error(o))),T=T||new Z(_),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,T);throw T}};let l=[],u=!1;i.usage=(M,_)=>M===null?(u=!0,l=[],i):(u=!1,l.push([M,_||""]),i),i.getUsage=()=>l,i.getUsageDisabled=()=>u,i.getPositionalGroupName=()=>n("Positionals:");let d=[];i.example=(M,_)=>{d.push([M,_||""])};let f=[];i.command=function(_,T,H,J,se=!1){H&&(f=f.map(z=>(z[2]=!1,z))),f.push([_,T||"",H,J,se])},i.getCommands=()=>f;let p={};i.describe=function(_,T){Array.isArray(_)?_.forEach(H=>{i.describe(H,T)}):typeof _=="object"?Object.keys(_).forEach(H=>{i.describe(H,_[H])}):p[_]=T},i.getDescriptions=()=>p;let y=[];i.epilog=M=>{y.push(M)};let C=!1,A;i.wrap=M=>{C=!0,A=M};function m(){return C||(A=en(),C=!0),A}let P="__yargsString__:";i.deferY18nLookup=M=>P+M,i.help=function(){if(B)return B;G();let _=e.customScriptName?e.$0:t.path.basename(e.$0),T=e.getDemandedOptions(),H=e.getDemandedCommands(),J=e.getDeprecatedOptions(),se=e.getGroups(),z=e.getOptions(),ue=[];ue=ue.concat(Object.keys(p)),ue=ue.concat(Object.keys(T)),ue=ue.concat(Object.keys(H)),ue=ue.concat(Object.keys(z.default)),ue=ue.filter(lt),ue=Object.keys(ue.reduce((U,ee)=>(ee!=="_"&&(U[ee]=!0),U),{}));let Mt=m(),ne=t.cliui({width:Mt,wrap:!!Mt});if(!u){if(l.length)l.forEach(U=>{ne.div({text:`${U[0].replace(/\$0/g,_)}`}),U[1]&&ne.div({text:`${U[1]}`,padding:[1,0,0,0]})}),ne.div();else if(f.length){let U=null;H._?U=`${_} <${n("command")}>
|
7
|
-
|
8
|
-
|
9
|
-
`)
|
10
|
-
`)
|
1
|
+
var Zc=Object.create;var Nn=Object.defineProperty;var ef=Object.getOwnPropertyDescriptor;var tf=Object.getOwnPropertyNames;var nf=Object.getPrototypeOf,rf=Object.prototype.hasOwnProperty;var of=(e,t,n)=>t in e?Nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ho=e=>Nn(e,"__esModule",{value:!0});var sf=(e,t)=>()=>(e&&(t=e(e=0)),t);var it=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),af=(e,t)=>{for(var n in t)Nn(e,n,{get:t[n],enumerable:!0})},mo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tf(t))!rf.call(e,i)&&(n||i!=="default")&&Nn(e,i,{get:()=>t[i],enumerable:!(r=ef(t,i))||r.enumerable});return e},Z=(e,t)=>mo(ho(Nn(e!=null?Zc(nf(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),lf=(e=>(t,n)=>e&&e.get(t)||(n=mo(ho({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var go=(e,t,n)=>(of(e,typeof t!="symbol"?t+"":t,n),n),cf=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var se=(e,t,n)=>(cf(e,t,"read from private field"),n?n.call(e):t.get(e)),He=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var ff,v,y=sf(()=>{ff=()=>typeof document=="undefined"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,v=ff()});var Qa=it((Yn,On)=>{y();var Tp=200,Zi="__lodash_hash_undefined__",Ma=1,kr=2,Fa=9007199254740991,Fr="[object Arguments]",qi="[object Array]",Ta="[object Boolean]",La="[object Date]",Da="[object Error]",Na="[object Function]",Lp="[object GeneratorFunction]",Tr="[object Map]",ka="[object Number]",vn="[object Object]",xa="[object Promise]",Ra="[object RegExp]",Lr="[object Set]",Ua="[object String]",Dp="[object Symbol]",Yi="[object WeakMap]",$a="[object ArrayBuffer]",Dr="[object DataView]",Np="[object Float32Array]",kp="[object Float64Array]",Rp="[object Int8Array]",Up="[object Int16Array]",$p="[object Int32Array]",Wp="[object Uint8Array]",Bp="[object Uint8ClampedArray]",Hp="[object Uint16Array]",Gp="[object Uint32Array]",qp=/[\\^$.*+?()[\]{}|]/g,Yp=/^\[object .+?Constructor\]$/,zp=/^(?:0|[1-9]\d*)$/,ie={};ie[Np]=ie[kp]=ie[Rp]=ie[Up]=ie[$p]=ie[Wp]=ie[Bp]=ie[Hp]=ie[Gp]=!0;ie[Fr]=ie[qi]=ie[$a]=ie[Ta]=ie[Dr]=ie[La]=ie[Da]=ie[Na]=ie[Tr]=ie[ka]=ie[vn]=ie[Ra]=ie[Lr]=ie[Ua]=ie[Yi]=!1;var Wa=typeof global=="object"&&global&&global.Object===Object&&global,Vp=typeof self=="object"&&self&&self.Object===Object&&self,It=Wa||Vp||Function("return this")(),Ba=typeof Yn=="object"&&Yn&&!Yn.nodeType&&Yn,Ca=Ba&&typeof On=="object"&&On&&!On.nodeType&&On,Kp=Ca&&Ca.exports===Ba,va=Kp&&Wa.process,Oa=function(){try{return va&&va.binding("util")}catch(e){}}(),Ea=Oa&&Oa.isTypedArray;function Qp(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function Jp(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Xp(e){return function(t){return e(t)}}function Zp(e,t){return e==null?void 0:e[t]}function zi(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function eh(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function th(e,t){return function(n){return e(t(n))}}function nh(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var rh=Array.prototype,ih=Function.prototype,Rr=Object.prototype,Hi=It["__core-js_shared__"],_a=function(){var e=/[^.]+$/.exec(Hi&&Hi.keys&&Hi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ha=ih.toString,bt=Rr.hasOwnProperty,Kn=Rr.toString,oh=RegExp("^"+Ha.call(bt).replace(qp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Sa=It.Symbol,ja=It.Uint8Array,sh=Rr.propertyIsEnumerable,ah=rh.splice,lh=th(Object.keys,Object),Vi=En(It,"DataView"),zn=En(It,"Map"),Ki=En(It,"Promise"),Qi=En(It,"Set"),Ji=En(It,"WeakMap"),Vn=En(Object,"create"),ch=ln(Vi),fh=ln(zn),uh=ln(Ki),dh=ln(Qi),ph=ln(Ji),Pa=Sa?Sa.prototype:void 0,Gi=Pa?Pa.valueOf:void 0;function sn(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function hh(){this.__data__=Vn?Vn(null):{}}function mh(e){return this.has(e)&&delete this.__data__[e]}function gh(e){var t=this.__data__;if(Vn){var n=t[e];return n===Zi?void 0:n}return bt.call(t,e)?t[e]:void 0}function yh(e){var t=this.__data__;return Vn?t[e]!==void 0:bt.call(t,e)}function bh(e,t){var n=this.__data__;return n[e]=Vn&&t===void 0?Zi:t,this}sn.prototype.clear=hh;sn.prototype.delete=mh;sn.prototype.get=gh;sn.prototype.has=yh;sn.prototype.set=bh;function wt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function wh(){this.__data__=[]}function Ah(e){var t=this.__data__,n=Ur(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():ah.call(t,n,1),!0}function xh(e){var t=this.__data__,n=Ur(t,e);return n<0?void 0:t[n][1]}function Ch(e){return Ur(this.__data__,e)>-1}function vh(e,t){var n=this.__data__,r=Ur(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}wt.prototype.clear=wh;wt.prototype.delete=Ah;wt.prototype.get=xh;wt.prototype.has=Ch;wt.prototype.set=vh;function an(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oh(){this.__data__={hash:new sn,map:new(zn||wt),string:new sn}}function Eh(e){return $r(this,e).delete(e)}function _h(e){return $r(this,e).get(e)}function Sh(e){return $r(this,e).has(e)}function jh(e,t){return $r(this,e).set(e,t),this}an.prototype.clear=Oh;an.prototype.delete=Eh;an.prototype.get=_h;an.prototype.has=Sh;an.prototype.set=jh;function Nr(e){var t=-1,n=e?e.length:0;for(this.__data__=new an;++t<n;)this.add(e[t])}function Ph(e){return this.__data__.set(e,Zi),this}function Ih(e){return this.__data__.has(e)}Nr.prototype.add=Nr.prototype.push=Ph;Nr.prototype.has=Ih;function Pt(e){this.__data__=new wt(e)}function Mh(){this.__data__=new wt}function Fh(e){return this.__data__.delete(e)}function Th(e){return this.__data__.get(e)}function Lh(e){return this.__data__.has(e)}function Dh(e,t){var n=this.__data__;if(n instanceof wt){var r=n.__data__;if(!zn||r.length<Tp-1)return r.push([e,t]),this;n=this.__data__=new an(r)}return n.set(e,t),this}Pt.prototype.clear=Mh;Pt.prototype.delete=Fh;Pt.prototype.get=Th;Pt.prototype.has=Lh;Pt.prototype.set=Dh;function Nh(e,t){var n=Xi(e)||Vh(e)?Jp(e.length,String):[],r=n.length,i=!!r;for(var s in e)(t||bt.call(e,s))&&!(i&&(s=="length"||Gh(s,r)))&&n.push(s);return n}function Ur(e,t){for(var n=e.length;n--;)if(Ya(e[n][0],t))return n;return-1}function kh(e){return Kn.call(e)}function Ga(e,t,n,r,i){return e===t?!0:e==null||t==null||!eo(e)&&!to(t)?e!==e&&t!==t:Rh(e,t,Ga,n,r,i)}function Rh(e,t,n,r,i,s){var o=Xi(e),a=Xi(t),l=qi,f=qi;o||(l=jt(e),l=l==Fr?vn:l),a||(f=jt(t),f=f==Fr?vn:f);var u=l==vn&&!zi(e),c=f==vn&&!zi(t),d=l==f;if(d&&!u)return s||(s=new Pt),o||Jh(e)?qa(e,t,n,r,i,s):Bh(e,t,l,n,r,i,s);if(!(i&kr)){var h=u&&bt.call(e,"__wrapped__"),b=c&&bt.call(t,"__wrapped__");if(h||b){var g=h?e.value():e,m=b?t.value():t;return s||(s=new Pt),n(g,m,r,i,s)}}return d?(s||(s=new Pt),Hh(e,t,n,r,i,s)):!1}function Uh(e){if(!eo(e)||Yh(e))return!1;var t=Va(e)||zi(e)?oh:Yp;return t.test(ln(e))}function $h(e){return to(e)&&Ka(e.length)&&!!ie[Kn.call(e)]}function Wh(e){if(!zh(e))return lh(e);var t=[];for(var n in Object(e))bt.call(e,n)&&n!="constructor"&&t.push(n);return t}function qa(e,t,n,r,i,s){var o=i&kr,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var f=s.get(e);if(f&&s.get(t))return f==t;var u=-1,c=!0,d=i&Ma?new Nr:void 0;for(s.set(e,t),s.set(t,e);++u<a;){var h=e[u],b=t[u];if(r)var g=o?r(b,h,u,t,e,s):r(h,b,u,e,t,s);if(g!==void 0){if(g)continue;c=!1;break}if(d){if(!Qp(t,function(m,O){if(!d.has(O)&&(h===m||n(h,m,r,i,s)))return d.add(O)})){c=!1;break}}else if(!(h===b||n(h,b,r,i,s))){c=!1;break}}return s.delete(e),s.delete(t),c}function Bh(e,t,n,r,i,s,o){switch(n){case Dr:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case $a:return!(e.byteLength!=t.byteLength||!r(new ja(e),new ja(t)));case Ta:case La:case ka:return Ya(+e,+t);case Da:return e.name==t.name&&e.message==t.message;case Ra:case Ua:return e==t+"";case Tr:var a=eh;case Lr:var l=s&kr;if(a||(a=nh),e.size!=t.size&&!l)return!1;var f=o.get(e);if(f)return f==t;s|=Ma,o.set(e,t);var u=qa(a(e),a(t),r,i,s,o);return o.delete(e),u;case Dp:if(Gi)return Gi.call(e)==Gi.call(t)}return!1}function Hh(e,t,n,r,i,s){var o=i&kr,a=Ia(e),l=a.length,f=Ia(t),u=f.length;if(l!=u&&!o)return!1;for(var c=l;c--;){var d=a[c];if(!(o?d in t:bt.call(t,d)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var b=!0;s.set(e,t),s.set(t,e);for(var g=o;++c<l;){d=a[c];var m=e[d],O=t[d];if(r)var E=o?r(O,m,d,t,e,s):r(m,O,d,e,t,s);if(!(E===void 0?m===O||n(m,O,r,i,s):E)){b=!1;break}g||(g=d=="constructor")}if(b&&!g){var $=e.constructor,z=t.constructor;$!=z&&"constructor"in e&&"constructor"in t&&!(typeof $=="function"&&$ instanceof $&&typeof z=="function"&&z instanceof z)&&(b=!1)}return s.delete(e),s.delete(t),b}function $r(e,t){var n=e.__data__;return qh(t)?n[typeof t=="string"?"string":"hash"]:n.map}function En(e,t){var n=Zp(e,t);return Uh(n)?n:void 0}var jt=kh;(Vi&&jt(new Vi(new ArrayBuffer(1)))!=Dr||zn&&jt(new zn)!=Tr||Ki&&jt(Ki.resolve())!=xa||Qi&&jt(new Qi)!=Lr||Ji&&jt(new Ji)!=Yi)&&(jt=function(e){var t=Kn.call(e),n=t==vn?e.constructor:void 0,r=n?ln(n):void 0;if(r)switch(r){case ch:return Dr;case fh:return Tr;case uh:return xa;case dh:return Lr;case ph:return Yi}return t});function Gh(e,t){return t=t==null?Fa:t,!!t&&(typeof e=="number"||zp.test(e))&&e>-1&&e%1==0&&e<t}function qh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Yh(e){return!!_a&&_a in e}function zh(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Rr;return e===n}function ln(e){if(e!=null){try{return Ha.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ya(e,t){return e===t||e!==e&&t!==t}function Vh(e){return Kh(e)&&bt.call(e,"callee")&&(!sh.call(e,"callee")||Kn.call(e)==Fr)}var Xi=Array.isArray;function za(e){return e!=null&&Ka(e.length)&&!Va(e)}function Kh(e){return to(e)&&za(e)}function Qh(e,t,n){n=typeof n=="function"?n:void 0;var r=n?n(e,t):void 0;return r===void 0?Ga(e,t,n):!!r}function Va(e){var t=eo(e)?Kn.call(e):"";return t==Na||t==Lp}function Ka(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Fa}function eo(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function to(e){return!!e&&typeof e=="object"}var Jh=Ea?Xp(Ea):$h;function Ia(e){return za(e)?Nh(e):Wh(e)}On.exports=Qh});var Ml=it((Fy,Il)=>{"use strict";y();Il.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var ro=it((Ty,Tl)=>{y();var Zn=Ml(),Fl={};for(let e of Object.keys(Zn))Fl[Zn[e]]=e;var T={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Tl.exports=T;for(let e of Object.keys(T)){if(!("channels"in T[e]))throw new Error("missing channels property: "+e);if(!("labels"in T[e]))throw new Error("missing channel labels property: "+e);if(T[e].labels.length!==T[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=T[e];delete T[e].channels,delete T[e].labels,Object.defineProperty(T[e],"channels",{value:t}),Object.defineProperty(T[e],"labels",{value:n})}T.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,a,l;s===i?a=0:t===s?a=(n-r)/o:n===s?a=2+(r-t)/o:r===s&&(a=4+(t-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let f=(i+s)/2;return s===i?l=0:f<=.5?l=o/(s+i):l=o/(2-s-i),[a,l*100,f*100]};T.rgb.hsv=function(e){let t,n,r,i,s,o=e[0]/255,a=e[1]/255,l=e[2]/255,f=Math.max(o,a,l),u=f-Math.min(o,a,l),c=function(d){return(f-d)/6/u+1/2};return u===0?(i=0,s=0):(s=u/f,t=c(o),n=c(a),r=c(l),o===f?i=r-n:a===f?i=1/3+t-r:l===f&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,f*100]};T.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=T.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,s*100,r*100]};T.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),s=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function Zh(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}T.rgb.keyword=function(e){let t=Fl[e];if(t)return t;let n=1/0,r;for(let i of Object.keys(Zn)){let s=Zn[i],o=Zh(e,s);o<n&&(n=o,r=i)}return r};T.keyword.rgb=function(e){return Zn[e]};T.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,s=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};T.rgb.lab=function(e){let t=T.rgb.xyz(e),n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,o=500*(n-r),a=200*(r-i);return[s,o,a]};T.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,s,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;let a=2*r-i,l=[0,0,0];for(let f=0;f<3;f++)s=t+1/3*-(f-1),s<0&&s++,s>1&&s--,6*s<1?o=a+(i-a)*6*s:2*s<1?o=i:3*s<2?o=a+(i-a)*(2/3-s)*6:o=a,l[f]=o*255;return l};T.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let o=(r+n)/2,a=r===0?2*i/(s+i):2*n/(r+n);return[t,a*100,o*100]};T.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,s=t-Math.floor(t),o=255*r*(1-n),a=255*r*(1-n*s),l=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,l,o];case 1:return[a,r,o];case 2:return[o,r,l];case 3:return[o,a,r];case 4:return[l,o,r];case 5:return[r,o,a]}};T.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),s,o;o=(2-n)*r;let a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[t,s*100,o*100]};T.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),a=1-r;s=6*t-o,(o&1)!==0&&(s=1-s);let l=n+s*(a-n),f,u,c;switch(o){default:case 6:case 0:f=a,u=l,c=n;break;case 1:f=l,u=a,c=n;break;case 2:f=n,u=a,c=l;break;case 3:f=n,u=l,c=a;break;case 4:f=l,u=n,c=a;break;case 5:f=a,u=n,c=l;break}return[f*255,u*255,c*255]};T.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,s=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};T.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,s,o;return i=t*3.2406+n*-1.5372+r*-.4986,s=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};T.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(t-n),o=200*(n-r);return[i,s,o]};T.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,s,o;s=(t+16)/116,i=n/500+s,o=s-r/200;let a=s**3,l=i**3,f=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=f>.008856?f:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};T.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(n*n+r*r);return[t,o,i]};T.lch.lab=function(e){let t=e[0],n=e[1],i=e[2]/360*2*Math.PI,s=n*Math.cos(i),o=n*Math.sin(i);return[t,s,o]};T.rgb.ansi16=function(e,t=null){let[n,r,i]=e,s=t===null?T.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(o+=60),o};T.hsv.ansi16=function(e){return T.rgb.ansi16(T.hsv.rgb(e),e[2])};T.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return 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)};T.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5,r=(t&1)*n*255,i=(t>>1&1)*n*255,s=(t>>2&1)*n*255;return[r,i,s]};T.ansi256.rgb=function(e){if(e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[n,r,i]};T.rgb.hex=function(e){let n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};T.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(a=>a+a).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,o=r&255;return[i,s,o]};T.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),s=Math.min(Math.min(t,n),r),o=i-s,a,l;return o<1?a=s/(1-o):a=0,o<=0?l=0:i===t?l=(n-r)/o%6:i===n?l=2+(r-t)/o:l=4+(t-n)/o,l/=6,l%=1,[l*360,o*100,a*100]};T.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]};T.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]};T.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=t%1*6,o=s%1,a=1-o,l=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};T.hcg.hsv=function(e){let t=e[1]/100,n=e[2]/100,r=t+n*(1-t),i=0;return r>0&&(i=t/r),[e[0],i*100,r*100]};T.hcg.hsl=function(e){let t=e[1]/100,r=e[2]/100*(1-t)+.5*t,i=0;return r>0&&r<.5?i=t/(2*r):r>=.5&&r<1&&(i=t/(2*(1-r))),[e[0],i*100,r*100]};T.hcg.hwb=function(e){let t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};T.hwb.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=1-n,i=r-t,s=0;return i<1&&(s=(r-i)/(1-i)),[e[0],i*100,s*100]};T.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};T.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};T.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};T.gray.hsl=function(e){return[0,0,e[0]]};T.gray.hsv=T.gray.hsl;T.gray.hwb=function(e){return[0,100,e[0]]};T.gray.cmyk=function(e){return[0,0,0,e[0]]};T.gray.lab=function(e){return[e[0],0,0]};T.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};T.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var Dl=it((Ly,Ll)=>{y();var Yr=ro();function em(){let e={},t=Object.keys(Yr);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function tm(e){let t=em(),n=[e];for(t[e].distance=0;n.length;){let r=n.pop(),i=Object.keys(Yr[r]);for(let s=i.length,o=0;o<s;o++){let a=i[o],l=t[a];l.distance===-1&&(l.distance=t[r].distance+1,l.parent=r,n.unshift(a))}}return t}function nm(e,t){return function(n){return t(e(n))}}function rm(e,t){let n=[t[e].parent,e],r=Yr[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=nm(Yr[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}Ll.exports=function(e){let t=tm(e),n={},r=Object.keys(t);for(let i=r.length,s=0;s<i;s++){let o=r[s];t[o].parent!==null&&(n[o]=rm(o,t))}return n}});var kl=it((Dy,Nl)=>{y();var io=ro(),im=Dl(),Pn={},om=Object.keys(io);function sm(e){let t=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function am(e){let t=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=e(n);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}om.forEach(e=>{Pn[e]={},Object.defineProperty(Pn[e],"channels",{value:io[e].channels}),Object.defineProperty(Pn[e],"labels",{value:io[e].labels});let t=im(e);Object.keys(t).forEach(r=>{let i=t[r];Pn[e][r]=am(i),Pn[e][r].raw=sm(i)})});Nl.exports=Pn});var Hl=it((Ny,Bl)=>{"use strict";y();var Rl=(e,t)=>(...n)=>`\x1B[${e(...n)+t}m`,Ul=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};5;${r}m`},$l=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},zr=e=>e,Wl=(e,t,n)=>[e,t,n],In=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{let r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})},oo,Mn=(e,t,n,r)=>{oo===void 0&&(oo=kl());let i=r?10:0,s={};for(let[o,a]of Object.entries(oo)){let l=o==="ansi16"?"ansi":o;o===t?s[l]=e(n,i):typeof a=="object"&&(s[l]=e(a[t],i))}return s};function lm(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[n,r]of Object.entries(t)){for(let[i,s]of Object.entries(r))t[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=t[i],e.set(s[0],s[1]);Object.defineProperty(t,n,{value:r,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",In(t.color,"ansi",()=>Mn(Rl,"ansi16",zr,!1)),In(t.color,"ansi256",()=>Mn(Ul,"ansi256",zr,!1)),In(t.color,"ansi16m",()=>Mn($l,"rgb",Wl,!1)),In(t.bgColor,"ansi",()=>Mn(Rl,"ansi16",zr,!0)),In(t.bgColor,"ansi256",()=>Mn(Ul,"ansi256",zr,!0)),In(t.bgColor,"ansi16m",()=>Mn($l,"rgb",Wl,!0)),t}Object.defineProperty(Bl,"exports",{enumerable:!0,get:lm})});var ql=it((ky,Gl)=>{"use strict";y();Gl.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}});var Vl=it((Ry,zl)=>{"use strict";y();var cm=require("os"),Yl=require("tty"),tt=ql(),{env:Me}=process,Dt;tt("no-color")||tt("no-colors")||tt("color=false")||tt("color=never")?Dt=0:(tt("color")||tt("colors")||tt("color=true")||tt("color=always"))&&(Dt=1);"FORCE_COLOR"in Me&&(Me.FORCE_COLOR==="true"?Dt=1:Me.FORCE_COLOR==="false"?Dt=0:Dt=Me.FORCE_COLOR.length===0?1:Math.min(parseInt(Me.FORCE_COLOR,10),3));function so(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ao(e,t){if(Dt===0)return 0;if(tt("color=16m")||tt("color=full")||tt("color=truecolor"))return 3;if(tt("color=256"))return 2;if(e&&!t&&Dt===void 0)return 0;let n=Dt||0;if(Me.TERM==="dumb")return n;if(process.platform==="win32"){let r=cm.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Me)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Me)||Me.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Me)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Me.TEAMCITY_VERSION)?1:0;if(Me.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Me){let r=parseInt((Me.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Me.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Me.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Me.TERM)||"COLORTERM"in Me?1:n}function fm(e){let t=ao(e,e&&e.isTTY);return so(t)}zl.exports={supportsColor:fm,stdout:so(ao(!0,Yl.isatty(1))),stderr:so(ao(!0,Yl.isatty(2)))}});var Ql=it((Uy,Kl)=>{"use strict";y();var um=(e,t,n)=>{let r=e.indexOf(t);if(r===-1)return e;let i=t.length,s=0,o="";do o+=e.substr(s,r-s)+t+n,s=r+i,r=e.indexOf(t,s);while(r!==-1);return o+=e.substr(s),o},dm=(e,t,n,r)=>{let i=0,s="";do{let o=e[r-1]==="\r";s+=e.substr(i,(o?r-1:r)-i)+t+(o?`\r
|
2
|
+
`:`
|
3
|
+
`)+n,i=r+1,r=e.indexOf(`
|
4
|
+
`,i)}while(r!==-1);return s+=e.substr(i),s};Kl.exports={stringReplaceAll:um,stringEncaseCRLFWithFirstIndex:dm}});var tc=it(($y,ec)=>{"use strict";y();var pm=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Jl=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,hm=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,mm=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,gm=new Map([["n",`
|
5
|
+
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Zl(e){let t=e[0]==="u",n=e[1]==="{";return t&&!n&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):gm.get(e)||e}function ym(e,t){let n=[],r=t.trim().split(/\s*,\s*/g),i;for(let s of r){let o=Number(s);if(!Number.isNaN(o))n.push(o);else if(i=s.match(hm))n.push(i[2].replace(mm,(a,l,f)=>l?Zl(l):f));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return n}function bm(e){Jl.lastIndex=0;let t=[],n;for(;(n=Jl.exec(e))!==null;){let r=n[1];if(n[2]){let i=ym(r,n[2]);t.push([r].concat(i))}else t.push([r])}return t}function Xl(e,t){let n={};for(let i of t)for(let s of i.styles)n[s[0]]=i.inverse?null:s.slice(1);let r=e;for(let[i,s]of Object.entries(n))if(!!Array.isArray(s)){if(!(i in r))throw new Error(`Unknown Chalk style: ${i}`);r=s.length>0?r[i](...s):r[i]}return r}ec.exports=(e,t)=>{let n=[],r=[],i=[];if(t.replace(pm,(s,o,a,l,f,u)=>{if(o)i.push(Zl(o));else if(l){let c=i.join("");i=[],r.push(n.length===0?c:Xl(e,n)(c)),n.push({inverse:a,styles:bm(l)})}else if(f){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");r.push(Xl(e,n)(i.join(""))),i=[],n.pop()}else i.push(u)}),r.push(i.join("")),n.length>0){let s=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return r.join("")}});var cc=it((Wy,lc)=>{"use strict";y();var er=Hl(),{stdout:co,stderr:fo}=Vl(),{stringReplaceAll:wm,stringEncaseCRLFWithFirstIndex:Am}=Ql(),{isArray:Vr}=Array,rc=["ansi","ansi","ansi256","ansi16m"],Fn=Object.create(null),xm=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let n=co?co.level:0;e.level=t.level===void 0?n:t.level},ic=class{constructor(t){return oc(t)}},oc=e=>{let t={};return xm(t,e),t.template=(...n)=>ac(t.template,...n),Object.setPrototypeOf(t,Kr.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=ic,t.template};function Kr(e){return oc(e)}for(let[e,t]of Object.entries(er))Fn[e]={get(){let n=Qr(this,uo(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};Fn.visible={get(){let e=Qr(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var sc=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of sc)Fn[e]={get(){let{level:t}=this;return function(...n){let r=uo(er.color[rc[t]][e](...n),er.color.close,this._styler);return Qr(this,r,this._isEmpty)}}};for(let e of sc){let t="bg"+e[0].toUpperCase()+e.slice(1);Fn[t]={get(){let{level:n}=this;return function(...r){let i=uo(er.bgColor[rc[n]][e](...r),er.bgColor.close,this._styler);return Qr(this,i,this._isEmpty)}}}}var Cm=Object.defineProperties(()=>{},{...Fn,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),uo=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},Qr=(e,t,n)=>{let r=(...i)=>Vr(i[0])&&Vr(i[0].raw)?nc(r,ac(r,...i)):nc(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,Cm),r._generator=e,r._styler=t,r._isEmpty=n,r},nc=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.indexOf("\x1B")!==-1)for(;n!==void 0;)t=wm(t,n.close,n.open),n=n.parent;let s=t.indexOf(`
|
6
|
+
`);return s!==-1&&(t=Am(t,i,r,s)),r+t+i},lo,ac=(e,...t)=>{let[n]=t;if(!Vr(n)||!Vr(n.raw))return t.join(" ");let r=t.slice(1),i=[n.raw[0]];for(let s=1;s<n.length;s++)i.push(String(r[s-1]).replace(/[{}\\]/g,"\\$&"),String(n.raw[s]));return lo===void 0&&(lo=tc()),lo(e,i.join(""))};Object.defineProperties(Kr.prototype,Fn);var Jr=Kr();Jr.supportsColor=co;Jr.stderr=Kr({level:fo?fo.level:0});Jr.stderr.supportsColor=fo;lc.exports=Jr});var Em={};af(Em,{readContextPackage:()=>be,uniformCLI:()=>Om,writeContextPackage:()=>at});y();y();y();var pr=require("assert");y();y();var uf={right:gf,center:yf},df=0,sr=1,pf=2,ar=3,bo=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(r=>typeof r=="string"?this.colFromString(r):r);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(`
|
7
|
+
`).map(i=>i.split(" ")),r=0;return n.forEach(i=>{i.length>1&&Ge.stringWidth(i[0])>r&&(r=Math.min(Math.floor(this.width*.5),Ge.stringWidth(i[0])))}),n.forEach(i=>{this.div(...i.map((s,o)=>({text:s.trim(),padding:this.measurePadding(s),width:o===0&&i.length>1?r:void 0})))}),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){let n=Ge.stripAnsi(t);return[0,n.match(/\s*$/)[0].length,0,n.match(/^\s*/)[0].length]}toString(){let t=[];return this.rows.forEach(n=>{this.rowToString(n,t)}),t.filter(n=>!n.hidden).map(n=>n.text).join(`
|
8
|
+
`)}rowToString(t,n){return this.rasterize(t).forEach((r,i)=>{let s="";r.forEach((o,a)=>{let{width:l}=t[a],f=this.negatePadding(t[a]),u=o;f>Ge.stringWidth(o)&&(u+=" ".repeat(f-Ge.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap&&(u=uf[t[a].align](u,f),Ge.stringWidth(u)<f&&(u+=" ".repeat((l||0)-Ge.stringWidth(u)-1)));let c=t[a].padding||[0,0,0,0];c[ar]&&(s+=" ".repeat(c[ar])),s+=yo(t[a],u,"| "),s+=u,s+=yo(t[a],u," |"),c[sr]&&(s+=" ".repeat(c[sr])),i===0&&n.length>0&&(s=this.renderInline(s,n[n.length-1]))}),n.push({text:s.replace(/ +$/,""),span:t.span})}),n}renderInline(t,n){let r=t.match(/^ */),i=r?r[0].length:0,s=n.text,o=Ge.stringWidth(s.trimRight());return n.span?this.wrap?i<o?t:(n.hidden=!0,s.trimRight()+" ".repeat(i-o)+t.trimLeft()):(n.hidden=!0,s+t):t}rasterize(t){let n=[],r=this.columnWidths(t),i;return t.forEach((s,o)=>{s.width=r[o],this.wrap?i=Ge.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
|
9
|
+
`):i=s.text.split(`
|
10
|
+
`),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[df]||0).fill("")),i.push(...new Array(s.padding[pf]||0).fill(""))),i.forEach((a,l)=>{n[l]||n.push([]);let f=n[l];for(let u=0;u<o;u++)f[u]===void 0&&f.push("");f.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[ar]||0)+(t.padding[sr]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(o=>o.width||Ge.stringWidth(o.text));let n=t.length,r=this.width,i=t.map(o=>{if(o.width)return n--,r-=o.width,o.width}),s=n?Math.floor(r/n):0;return i.map((o,a)=>o===void 0?Math.max(s,hf(t[a])):o)}};function yo(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function hf(e){let t=e.padding||[],n=1+(t[ar]||0)+(t[sr]||0);return e.border?n+4:n}function mf(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function gf(e,t){e=e.trim();let n=Ge.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function yf(e,t){e=e.trim();let n=Ge.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var Ge;function wo(e,t){return Ge=t,new bo({width:(e==null?void 0:e.width)||mf(),wrap:e==null?void 0:e.wrap})}y();var Ao=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function oi(e){return e.replace(Ao,"")}function xo(e,t){let[n,r]=e.match(Ao)||["",""];e=oi(e);let i="";for(let s=0;s<e.length;s++)s!==0&&s%t===0&&(i+=`
|
11
|
+
`),i+=e.charAt(s);return n&&r&&(i=`${n}${i}${r}`),i}function si(e){return wo(e,{stringWidth:t=>[...t].length,stripAnsi:oi,wrap:xo})}y();var un=require("path"),lr=require("fs");function Co(e,t){let n=(0,un.resolve)(".",e),r;for((0,lr.statSync)(n).isDirectory()||(n=(0,un.dirname)(n));;){if(r=t(n,(0,lr.readdirSync)(n)),r)return(0,un.resolve)(n,r);if(n=(0,un.dirname)(r=n),r===n)break}}var Ro=require("util"),Uo=require("fs"),$o=require("url");y();var _o=require("util"),ur=require("path");y();function Gt(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let n="",r=!1,i=e.match(/^-+/);for(let s=i?i[0].length:0;s<e.length;s++){let o=e.charAt(s);r&&(r=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?r=!0:o!=="-"&&o!=="_"&&(n+=o)}return n}}function cr(e,t){let n=e.toLowerCase();t=t||"-";let r="";for(let i=0;i<e.length;i++){let s=n.charAt(i),o=e.charAt(i);s!==o&&i>0?r+=`${t}${n.charAt(i)}`:r+=o}return r}function fr(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}y();y();function vo(e){if(Array.isArray(e))return e.map(o=>typeof o!="string"?o+"":o);e=e.trim();let t=0,n=null,r=null,i=null,s=[];for(let o=0;o<e.length;o++){if(n=r,r=e.charAt(o),r===" "&&!i){n!==" "&&t++;continue}r===i?i=null:(r==="'"||r==='"')&&!i&&(i=r),s[t]||(s[t]=""),s[t]+=r}return s}y();var Qe;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Qe||(Qe={}));var mt,li=class{constructor(t){mt=t}parse(t,n){let r=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},n),i=vo(t),s=typeof t=="string",o=bf(Object.assign(Object.create(null),r.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},r.configuration),l=Object.assign(Object.create(null),r.default),f=r.configObjects||[],u=r.envPrefix,c=a["populate--"],d=c?"--":"_",h=Object.create(null),b=Object.create(null),g=r.__||mt.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},O=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,E=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach(function(w){let x=typeof w=="object"?w.key:w,_=Object.keys(w).map(function(C){return{boolean:"bools",string:"strings",number:"numbers"}[C]}).filter(Boolean).pop();_&&(m[_][x]=!0),m.arrays[x]=!0,m.keys.push(x)}),[].concat(r.boolean||[]).filter(Boolean).forEach(function(w){m.bools[w]=!0,m.keys.push(w)}),[].concat(r.string||[]).filter(Boolean).forEach(function(w){m.strings[w]=!0,m.keys.push(w)}),[].concat(r.number||[]).filter(Boolean).forEach(function(w){m.numbers[w]=!0,m.keys.push(w)}),[].concat(r.count||[]).filter(Boolean).forEach(function(w){m.counts[w]=!0,m.keys.push(w)}),[].concat(r.normalize||[]).filter(Boolean).forEach(function(w){m.normalize[w]=!0,m.keys.push(w)}),typeof r.narg=="object"&&Object.entries(r.narg).forEach(([w,x])=>{typeof x=="number"&&(m.nargs[w]=x,m.keys.push(w))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([w,x])=>{typeof x=="function"&&(m.coercions[w]=x,m.keys.push(w))}),typeof r.config!="undefined"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(w){m.configs[w]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([w,x])=>{(typeof x=="boolean"||typeof x=="function")&&(m.configs[w]=x)})),Ht(r.key,o,r.default,m.arrays),Object.keys(l).forEach(function(w){(m.aliases[w]||[]).forEach(function(x){l[x]=l[w]})});let $=null;or();let z=[],J=Object.assign(Object.create(null),{_:[]}),q={};for(let w=0;w<i.length;w++){let x=i[w],_=x.replace(/^-{3,}/,"---"),C,A,F,j,R,je;if(x!=="--"&&ce(x))k(x);else if(_.match(/---+(=|$)/)){k(x);continue}else if(x.match(/^--.+=/)||!a["short-option-groups"]&&x.match(/^-.+=/))j=x.match(/^--?([^=]+)=([\s\S]*)$/),j!==null&&Array.isArray(j)&&j.length>=3&&(H(j[1],m.arrays)?w=te(w,j[1],i,j[2]):H(j[1],m.nargs)!==!1?w=Q(w,j[1],i,j[2]):Y(j[1],j[2],!0));else if(x.match(E)&&a["boolean-negation"])j=x.match(E),j!==null&&Array.isArray(j)&&j.length>=2&&(A=j[1],Y(A,H(A,m.arrays)?[!1]:!1));else if(x.match(/^--.+/)||!a["short-option-groups"]&&x.match(/^-[^-]+/))j=x.match(/^--?(.+)/),j!==null&&Array.isArray(j)&&j.length>=2&&(A=j[1],H(A,m.arrays)?w=te(w,A,i):H(A,m.nargs)!==!1?w=Q(w,A,i):(R=i[w+1],R!==void 0&&(!R.match(/^-/)||R.match(O))&&!H(A,m.bools)&&!H(A,m.counts)||/^(true|false)$/.test(R)?(Y(A,R),w++):Y(A,fe(A))));else if(x.match(/^-.\..+=/))j=x.match(/^-([^=]+)=([\s\S]*)$/),j!==null&&Array.isArray(j)&&j.length>=3&&Y(j[1],j[2]);else if(x.match(/^-.\..+/)&&!x.match(O))R=i[w+1],j=x.match(/^-(.\..+)/),j!==null&&Array.isArray(j)&&j.length>=2&&(A=j[1],R!==void 0&&!R.match(/^-/)&&!H(A,m.bools)&&!H(A,m.counts)?(Y(A,R),w++):Y(A,fe(A)));else if(x.match(/^-[^-]+/)&&!x.match(O)){F=x.slice(1,-1).split(""),C=!1;for(let Le=0;Le<F.length;Le++){if(R=x.slice(Le+2),F[Le+1]&&F[Le+1]==="="){je=x.slice(Le+3),A=F[Le],H(A,m.arrays)?w=te(w,A,i,je):H(A,m.nargs)!==!1?w=Q(w,A,i,je):Y(A,je),C=!0;break}if(R==="-"){Y(F[Le],R);continue}if(/[A-Za-z]/.test(F[Le])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(R)&&H(R,m.bools)===!1){Y(F[Le],R),C=!0;break}if(F[Le+1]&&F[Le+1].match(/\W/)){Y(F[Le],R),C=!0;break}else Y(F[Le],fe(F[Le]))}A=x.slice(-1)[0],!C&&A!=="-"&&(H(A,m.arrays)?w=te(w,A,i):H(A,m.nargs)!==!1?w=Q(w,A,i):(R=i[w+1],R!==void 0&&(!/^(-|--)[^-]/.test(R)||R.match(O))&&!H(A,m.bools)&&!H(A,m.counts)||/^(true|false)$/.test(R)?(Y(A,R),w++):Y(A,fe(A))))}else if(x.match(/^-[0-9]$/)&&x.match(O)&&H(x.slice(1),m.bools))A=x.slice(1),Y(A,fe(A));else if(x==="--"){z=i.slice(w+1);break}else if(a["halt-at-non-option"]){z=i.slice(w);break}else k(x)}ee(J,!0),ee(J,!1),V(J),me(),le(J,m.aliases,l,!0),_e(J),a["set-placeholder-key"]&&Bt(J),Object.keys(m.counts).forEach(function(w){pt(J,w.split("."))||Y(w,0)}),c&&z.length&&(J[d]=[]),z.forEach(function(w){J[d].push(w)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(J).filter(w=>w!=="--"&&w.includes("-")).forEach(w=>{delete J[w]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(w=>o[w])).forEach(w=>{a["camel-case-expansion"]&&w.includes("-")&&delete J[w.split(".").map(x=>Gt(x)).join(".")],delete J[w]});function k(w){let x=W("_",w);(typeof x=="string"||typeof x=="number")&&J._.push(x)}function Q(w,x,_,C){let A,F=H(x,m.nargs);if(F=typeof F!="number"||isNaN(F)?1:F,F===0)return rt(C)||($=Error(g("Argument unexpected for: %s",x))),Y(x,fe(x)),w;let j=rt(C)?0:1;if(a["nargs-eats-options"])_.length-(w+1)+j<F&&($=Error(g("Not enough arguments following: %s",x))),j=F;else{for(A=w+1;A<_.length&&(!_[A].match(/^-[^0-9]/)||_[A].match(O)||ce(_[A]));A++)j++;j<F&&($=Error(g("Not enough arguments following: %s",x)))}let R=Math.min(j,F);for(!rt(C)&&R>0&&(Y(x,C),R--),A=w+1;A<R+w+1;A++)Y(x,_[A]);return w+R}function te(w,x,_,C){let A=[],F=C||_[w+1],j=H(x,m.nargs);if(H(x,m.bools)&&!/^(true|false)$/.test(F))A.push(!0);else if(rt(F)||rt(C)&&/^-/.test(F)&&!O.test(F)&&!ce(F)){if(l[x]!==void 0){let R=l[x];A=Array.isArray(R)?R:[R]}}else{rt(C)||A.push(S(x,C,!0));for(let R=w+1;R<_.length&&!(!a["greedy-arrays"]&&A.length>0||j&&typeof j=="number"&&A.length>=j||(F=_[R],/^-/.test(F)&&!O.test(F)&&!ce(F)));R++)w=R,A.push(S(x,F,s))}return typeof j=="number"&&(j&&A.length<j||isNaN(j)&&A.length===0)&&($=Error(g("Not enough arguments following: %s",x))),Y(x,A),w}function Y(w,x,_=s){if(/-/.test(w)&&a["camel-case-expansion"]){let F=w.split(".").map(function(j){return Gt(j)}).join(".");P(w,F)}let C=S(w,x,_),A=w.split(".");ht(J,A,C),m.aliases[w]&&m.aliases[w].forEach(function(F){let j=F.split(".");ht(J,j,C)}),A.length>1&&a["dot-notation"]&&(m.aliases[A[0]]||[]).forEach(function(F){let j=F.split("."),R=[].concat(A);R.shift(),j=j.concat(R),(m.aliases[w]||[]).includes(j.join("."))||ht(J,j,C)}),H(w,m.normalize)&&!H(w,m.arrays)&&[w].concat(m.aliases[w]||[]).forEach(function(j){Object.defineProperty(q,j,{enumerable:!0,get(){return x},set(R){x=typeof R=="string"?mt.normalize(R):R}})})}function P(w,x){m.aliases[w]&&m.aliases[w].length||(m.aliases[w]=[x],h[x]=!0),m.aliases[x]&&m.aliases[x].length||P(x,w)}function S(w,x,_){_&&(x=wf(x)),(H(w,m.bools)||H(w,m.counts))&&typeof x=="string"&&(x=x==="true");let C=Array.isArray(x)?x.map(function(A){return W(w,A)}):W(w,x);return H(w,m.counts)&&(rt(C)||typeof C=="boolean")&&(C=ai()),H(w,m.normalize)&&H(w,m.arrays)&&(Array.isArray(x)?C=x.map(A=>mt.normalize(A)):C=mt.normalize(x)),C}function W(w,x){return!a["parse-positional-numbers"]&&w==="_"||!H(w,m.strings)&&!H(w,m.bools)&&!Array.isArray(x)&&(fr(x)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${x}`)))||!rt(x)&&H(w,m.numbers))&&(x=Number(x)),x}function V(w){let x=Object.create(null);le(x,m.aliases,l),Object.keys(m.configs).forEach(function(_){let C=w[_]||x[_];if(C)try{let A=null,F=mt.resolve(mt.cwd(),C),j=m.configs[_];if(typeof j=="function"){try{A=j(F)}catch(R){A=R}if(A instanceof Error){$=A;return}}else A=mt.require(F);ne(A)}catch(A){A.name==="PermissionDenied"?$=A:w[_]&&($=Error(g("Invalid JSON config file: %s",C)))}})}function ne(w,x){Object.keys(w).forEach(function(_){let C=w[_],A=x?x+"."+_:_;typeof C=="object"&&C!==null&&!Array.isArray(C)&&a["dot-notation"]?ne(C,A):(!pt(J,A.split("."))||H(A,m.arrays)&&a["combine-arrays"])&&Y(A,C)})}function me(){typeof f!="undefined"&&f.forEach(function(w){ne(w)})}function ee(w,x){if(typeof u=="undefined")return;let _=typeof u=="string"?u:"",C=mt.env();Object.keys(C).forEach(function(A){if(_===""||A.lastIndexOf(_,0)===0){let F=A.split("__").map(function(j,R){return R===0&&(j=j.substring(_.length)),Gt(j)});(x&&m.configs[F.join(".")]||!x)&&!pt(w,F)&&Y(F.join("."),C[A])}})}function _e(w){let x,_=new Set;Object.keys(w).forEach(function(C){if(!_.has(C)&&(x=H(C,m.coercions),typeof x=="function"))try{let A=W(C,x(w[C]));[].concat(m.aliases[C]||[],C).forEach(F=>{_.add(F),w[F]=A})}catch(A){$=A}})}function Bt(w){return m.keys.forEach(x=>{~x.indexOf(".")||typeof w[x]=="undefined"&&(w[x]=void 0)}),w}function le(w,x,_,C=!1){Object.keys(_).forEach(function(A){pt(w,A.split("."))||(ht(w,A.split("."),_[A]),C&&(b[A]=!0),(x[A]||[]).forEach(function(F){pt(w,F.split("."))||ht(w,F.split("."),_[A])}))})}function pt(w,x){let _=w;a["dot-notation"]||(x=[x.join(".")]),x.slice(0,-1).forEach(function(A){_=_[A]||{}});let C=x[x.length-1];return typeof _!="object"?!1:C in _}function ht(w,x,_){let C=w;a["dot-notation"]||(x=[x.join(".")]),x.slice(0,-1).forEach(function(je){je=Oo(je),typeof C=="object"&&C[je]===void 0&&(C[je]={}),typeof C[je]!="object"||Array.isArray(C[je])?(Array.isArray(C[je])?C[je].push({}):C[je]=[C[je],{}],C=C[je][C[je].length-1]):C=C[je]});let A=Oo(x[x.length-1]),F=H(x.join("."),m.arrays),j=Array.isArray(_),R=a["duplicate-arguments-array"];!R&&H(A,m.nargs)&&(R=!0,(!rt(C[A])&&m.nargs[A]===1||Array.isArray(C[A])&&C[A].length===m.nargs[A])&&(C[A]=void 0)),_===ai()?C[A]=ai(C[A]):Array.isArray(C[A])?R&&F&&j?C[A]=a["flatten-duplicate-arrays"]?C[A].concat(_):(Array.isArray(C[A][0])?C[A]:[C[A]]).concat([_]):!R&&Boolean(F)===Boolean(j)?C[A]=_:C[A]=C[A].concat([_]):C[A]===void 0&&F?C[A]=j?_:[_]:R&&!(C[A]===void 0||H(A,m.counts)||H(A,m.bools))?C[A]=[C[A],_]:C[A]=_}function Ht(...w){w.forEach(function(x){Object.keys(x||{}).forEach(function(_){m.aliases[_]||(m.aliases[_]=[].concat(o[_]||[]),m.aliases[_].concat(_).forEach(function(C){if(/-/.test(C)&&a["camel-case-expansion"]){let A=Gt(C);A!==_&&m.aliases[_].indexOf(A)===-1&&(m.aliases[_].push(A),h[A]=!0)}}),m.aliases[_].concat(_).forEach(function(C){if(C.length>1&&/[A-Z]/.test(C)&&a["camel-case-expansion"]){let A=cr(C,"-");A!==_&&m.aliases[_].indexOf(A)===-1&&(m.aliases[_].push(A),h[A]=!0)}}),m.aliases[_].forEach(function(C){m.aliases[C]=[_].concat(m.aliases[_].filter(function(A){return C!==A}))}))})})}function H(w,x){let _=[].concat(m.aliases[w]||[],w),C=Object.keys(x),A=_.find(F=>C.includes(F));return A?x[A]:!1}function ii(w){let x=Object.keys(m);return[].concat(x.map(C=>m[C])).some(function(C){return Array.isArray(C)?C.includes(w):C[w]})}function B(w,...x){return[].concat(...x).some(function(C){let A=w.match(C);return A&&ii(A[1])})}function oe(w){if(w.match(O)||!w.match(/^-[^-]+/))return!1;let x=!0,_,C=w.slice(1).split("");for(let A=0;A<C.length;A++){if(_=w.slice(A+2),!ii(C[A])){x=!1;break}if(C[A+1]&&C[A+1]==="="||_==="-"||/[A-Za-z]/.test(C[A])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(_)||C[A+1]&&C[A+1].match(/\W/))break}return x}function ce(w){return a["unknown-options-as-args"]&&X(w)}function X(w){return w=w.replace(/^-{3,}/,"--"),w.match(O)||oe(w)?!1:!B(w,/^-+([^=]+?)=[\s\S]*$/,E,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function fe(w){return!H(w,m.bools)&&!H(w,m.counts)&&`${w}`in l?l[w]:ge(nt(w))}function ge(w){return{[Qe.BOOLEAN]:!0,[Qe.STRING]:"",[Qe.NUMBER]:void 0,[Qe.ARRAY]:[]}[w]}function nt(w){let x=Qe.BOOLEAN;return H(w,m.strings)?x=Qe.STRING:H(w,m.numbers)?x=Qe.NUMBER:H(w,m.bools)?x=Qe.BOOLEAN:H(w,m.arrays)&&(x=Qe.ARRAY),x}function rt(w){return w===void 0}function or(){Object.keys(m.counts).find(w=>H(w,m.arrays)?($=Error(g("Invalid configuration: %s, opts.count excludes opts.array.",w)),!0):H(w,m.nargs)?($=Error(g("Invalid configuration: %s, opts.count excludes opts.narg.",w)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(q,J),configuration:a,defaulted:Object.assign({},b),error:$,newAliases:Object.assign({},h)}}};function bf(e){let t=[],n=Object.create(null),r=!0;for(Object.keys(e).forEach(function(i){t.push([].concat(e[i],i))});r;){r=!1;for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)if(t[i].filter(function(a){return t[s].indexOf(a)!==-1}).length){t[i]=t[i].concat(t[s]),t.splice(s,1),r=!0;break}}return t.forEach(function(i){i=i.filter(function(o,a,l){return l.indexOf(o)===a});let s=i.pop();s!==void 0&&typeof s=="string"&&(n[s]=i)}),n}function ai(e){return e!==void 0?e+1:1}function Oo(e){return e==="__proto__"?"___proto___":e}function wf(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}var So=require("fs");var Eo=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<Eo)throw Error(`yargs parser supports a minimum Node.js version of ${Eo}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Af=process?process.env:{},jo=new li({cwd:process.cwd,env:()=>Af,format:_o.format,normalize:ur.normalize,resolve:ur.resolve,require:e=>{if(typeof require!="undefined")return require(e);if(e.match(/\.json$/))return JSON.parse((0,So.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),kn=function(t,n){return jo.parse(t.slice(),n).argv};kn.detailed=function(e,t){return jo.parse(e.slice(),t)};kn.camelCase=Gt;kn.decamelize=cr;kn.looksLikeNumber=fr;var Po=kn;var st=require("path");y();function xf(){return Cf()?0:1}function Cf(){return vf()&&!process.defaultApp}function vf(){return!!process.versions.electron}function Io(){return process.argv[xf()]}y();var re=class extends Error{constructor(t){super(t||"yargs error");this.name="YError",Error.captureStackTrace(this,re)}};y();y();var dn=require("fs"),Mo=require("util"),Fo=require("path"),To={fs:{readFileSync:dn.readFileSync,writeFile:dn.writeFile},format:Mo.format,resolve:Fo.resolve,exists:e=>{try{return(0,dn.statSync)(e).isFile()}catch(t){return!1}}};y();var ot,Lo=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=t.shift(),r=function(){};return typeof t[t.length-1]=="function"&&(r=t.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),ot.format.apply(ot.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),r=t.shift(),i=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?n:r;this.cache[this.locale][n]&&(o=this.cache[this.locale][n][i===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(i),ot.format.apply(ot.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let r="";return t.forEach(function(i,s){let o=n[s+1];r+=i,typeof o!="undefined"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],r=n.directory,i=n.locale,s=n.cb,o=this._resolveLocaleFile(r,i),a=JSON.stringify(this.cache[i],null,2);ot.fs.writeFile(o,a,"utf-8",function(l){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(l)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{ot.fs.readFileSync&&(t=JSON.parse(ot.fs.readFileSync(n,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+n),r.code==="ENOENT")t={};else throw r}this.cache[this.locale]=t}_resolveLocaleFile(t,n){let r=ot.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~n.lastIndexOf("_")){let i=ot.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(t){return ot.exists(t)}};function Do(e,t){ot=t;let n=new Lo(e);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var Of=e=>Do(e,To),No=Of;var Ef="require is not supported by ESM",ko="loading a directory of commands is not supported yet for ESM",dr;try{dr=(0,$o.fileURLToPath)(v)}catch(e){dr=process.cwd()}var _f=dr.split("node_modules")[0],Wo={assert:{notStrictEqual:pr.notStrictEqual,strictEqual:pr.strictEqual},cliui:si,findUp:Co,getEnv:e=>process.env[e],inspect:Ro.inspect,getCallerFile:()=>{throw new re(ko)},getProcessArgvBin:Io,mainFilename:_f||process.cwd(),Parser:Po,path:{basename:st.basename,dirname:st.dirname,extname:st.extname,relative:st.relative,resolve:st.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!="undefined"?process.stdout.columns:null},readFileSync:Uo.readFileSync,require:()=>{throw new re(Ef)},requireDirectory:()=>{throw new re(ko)},stringWidth:e=>[...e].length,y18n:No({directory:(0,st.resolve)(dr,"../../../locales"),updateFiles:!1})};y();y();y();function De(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function ci(e,t){t.assert.strictEqual(typeof e,"string")}function pn(e){return Object.keys(e)}y();function ae(e){return!!e&&!!e.then&&typeof e.then=="function"}y();y();y();function At(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),r=/\.*[\][<>]/g,i=n.shift();if(!i)throw new Error(`No command found in: ${e}`);let s={cmd:i.replace(r,""),demanded:[],optional:[]};return n.forEach((o,a)=>{let l=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===n.length-1&&(l=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(r,"").split("|"),variadic:l}):s.demanded.push({cmd:o.replace(r,"").split("|"),variadic:l})}),s}var Sf=["first","second","third","fourth","fifth","sixth"];function I(e,t,n){function r(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[At(`cmd ${e}`),t,n]}try{let i=0,[s,o,a]=r(),l=[].slice.call(o);for(;l.length&&l[l.length-1]===void 0;)l.pop();let f=a||l.length;if(f<s.demanded.length)throw new re(`Not enough arguments provided. Expected ${s.demanded.length} but received ${l.length}.`);let u=s.demanded.length+s.optional.length;if(f>u)throw new re(`Too many arguments provided. Expected max ${u} but received ${f}.`);s.demanded.forEach(c=>{let d=l.shift(),h=Bo(d);c.cmd.filter(g=>g===h||g==="*").length===0&&Ho(h,c.cmd,i),i+=1}),s.optional.forEach(c=>{if(l.length===0)return;let d=l.shift(),h=Bo(d);c.cmd.filter(g=>g===h||g==="*").length===0&&Ho(h,c.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function Bo(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function Ho(e,t,n){throw new re(`Invalid ${Sf[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var fi=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,r=!0,i=!1){if(I("<array|function> [boolean] [boolean] [boolean]",[t,n,r],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let o=t[s];o.applyBeforeValidation=n,o.global=r}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=n,s.global=r,s.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,n){let r=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...r[n]||[],n];return i.option?!s.includes(i.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function Go(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function qt(e,t,n,r){return n.reduce((i,s)=>{if(s.applyBeforeValidation!==r)return i;if(s.mutates){if(s.applied)return i;s.applied=!0}if(ae(i))return i.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(i,t);return ae(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},e)}y();function Yt(e,t,n=r=>{throw r}){try{let r=jf(e)?e():e;return ae(r)?r.then(i=>t(i)):t(r)}catch(r){return n(r)}}function jf(e){return typeof e=="function"}y();function ui(e){if(typeof require=="undefined")return null;for(let t=0,n=Object.keys(require.cache),r;t<n.length;t++)if(r=require.cache[n[t]],r.exports===e)return r;return null}var hn=/(^\*)|(^\$0)/,Yo=class{constructor(t,n,r,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=r,this.validation=n}addDirectory(t,n,r,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:o=>o;i.visit=(o,a,l)=>{let f=s(o,a,l);if(f){if(this.requireCache.has(a))return f;this.requireCache.add(a),this.addHandler(f)}return f},this.shim.requireDirectory({require:n,filename:r},t,i)}addHandler(t,n,r,i,s,o){let a=[],l=Go(s);if(i=i||(()=>{}),Array.isArray(t))if(Pf(t))[t,...a]=t;else for(let f of t)this.addHandler(f);else if(Mf(t)){let f=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(f=[].concat(f).concat(t.aliases)),this.addHandler(f,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(qo(r)){this.addHandler([t].concat(a),n,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof t=="string"){let f=At(t);a=a.map(d=>At(d).cmd);let u=!1,c=[f.cmd].concat(a).filter(d=>hn.test(d)?(u=!0,!1):!0);c.length===0&&u&&c.push("$0"),u&&(f.cmd=c[0],a=c.slice(1),t=t.replace(hn,f.cmd)),a.forEach(d=>{this.aliasMap[d]=f.cmd}),n!==!1&&this.usage.command(t,n,u,a,o),this.handlers[f.cmd]={original:t,description:n,handler:i,builder:r||{},middlewares:l,deprecated:o,demanded:f.demanded,optional:f.optional},u&&(this.defaultCommand=this.handlers[f.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,n,r,i,s,o){let a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,l=n.getInternalMethods().getContext(),f=l.commands.slice(),u=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let c=this.applyBuilderUpdateUsageAndParse(u,a,n,r.aliases,f,i,s,o);return ae(c)?c.then(d=>this.applyMiddlewareAndGetResult(u,a,d.innerArgv,l,s,d.aliases,n)):this.applyMiddlewareAndGetResult(u,a,c.innerArgv,l,s,c.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,r,i,s,o,a,l){let f=n.builder,u=r;if(hr(f)){let c=f(r.getInternalMethods().reset(i),l);if(ae(c))return c.then(d=>(u=Vo(d)?d:r,this.parseAndUpdateUsage(t,n,u,s,o,a)))}else If(f)&&(u=r.getInternalMethods().reset(i),Object.keys(n.builder).forEach(c=>{u.option(c,f[c])}));return this.parseAndUpdateUsage(t,n,u,s,o,a)}parseAndUpdateUsage(t,n,r,i,s,o){t&&r.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(r)&&r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,n),n.description);let a=r.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return ae(a)?a.then(l=>({aliases:r.parsed.aliases,innerArgv:l})):{aliases:r.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,n){let r=hn.test(n.original)?n.original.replace(hn,"").trim():n.original,i=t.filter(s=>!hn.test(s));return i.push(r),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(t,n,r,i,s,o,a){let l={};if(s)return r;a.getInternalMethods().getHasOutput()||(l=this.populatePositionals(n,r,i,a));let f=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(r=qt(r,a,f,!0),!a.getInternalMethods().getHasOutput()){let u=a.getInternalMethods().runValidation(o,l,a.parsed.error,t);r=Yt(r,c=>(u(c),c))}if(n.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let u=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(r,u,!1,!1),r=qt(r,a,f,!1),r=Yt(r,c=>{let d=n.handler(c);return ae(d)?d.then(()=>c):c}),t||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),ae(r)&&!a.getInternalMethods().hasParseCallback()&&r.catch(c=>{try{a.getInternalMethods().getUsageInstance().fail(null,c)}catch(d){}})}return t||(i.commands.pop(),i.fullCommands.pop()),r}populatePositionals(t,n,r,i){n._=n._.slice(r.commands.length);let s=t.demanded.slice(0),o=t.optional.slice(0),a={};for(this.validation.positionalCount(s.length,n._.length);s.length;){let l=s.shift();this.populatePositional(l,n,a)}for(;o.length;){let l=o.shift();this.populatePositional(l,n,a)}return n._=r.commands.concat(n._.map(l=>""+l)),this.postProcessPositionals(n,a,this.cmdToParseOptions(t.original),i),a}populatePositional(t,n,r){let i=t.cmd[0];t.variadic?r[i]=n._.splice(0).map(String):n._.length&&(r[i]=[String(n._.shift())])}cmdToParseOptions(t){let n={array:[],default:{},alias:{},demand:{}},r=At(t);return r.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o,n.demand[s]=!0}),r.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o}),n}postProcessPositionals(t,n,r,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(r.default,s.default);for(let f of Object.keys(r.alias))s.alias[f]=(s.alias[f]||[]).concat(r.alias[f]);s.array=s.array.concat(r.array),s.config={};let o=[];if(Object.keys(n).forEach(f=>{n[f].map(u=>{s.configuration["unknown-options-as-args"]&&(s.key[f]=!0),o.push(`--${f}`),o.push(u)})}),!o.length)return;let a=Object.assign({},s.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(l.error)i.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let f=Object.keys(n);Object.keys(n).forEach(c=>{f.push(...l.aliases[c])});let u=i.getOptions().default;Object.keys(l.argv).forEach(c=>{f.includes(c)&&(n[c]||(n[c]=l.argv[c]),!Object.prototype.hasOwnProperty.call(u,c)&&Object.prototype.hasOwnProperty.call(t,c)&&Object.prototype.hasOwnProperty.call(l.argv,c)&&(Array.isArray(t[c])||Array.isArray(l.argv[c]))?t[c]=[].concat(t[c],l.argv[c]):t[c]=l.argv[c])})}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let r=hn.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(r,this.defaultCommand.description)}let n=this.defaultCommand.builder;if(hr(n))return n(t,!0);qo(n)||Object.keys(n).forEach(r=>{t.option(r,n[r])})}moduleName(t){let n=ui(t);if(!n)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(n.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:n,desc:r}){for(let i of[t,n,r]){if(typeof i=="string"||i===!1)return i;De(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();De(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function zo(e,t,n,r){return new Yo(e,t,n,r)}function qo(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Pf(e){return e.every(t=>typeof t=="string")}function hr(e){return typeof e=="function"}function If(e){return typeof e=="object"}function Mf(e){return typeof e=="object"&&!Array.isArray(e)}y();y();function xt(e={},t=()=>!0){let n={};return pn(e).forEach(r=>{t(r,e[r])&&(n[r]=e[r])}),n}y();function Ct(e){typeof process!="undefined"&&[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(e)})}function Ff(e){return typeof e=="boolean"}function Qo(e,t){let n=t.y18n.__,r={},i=[];r.failFn=function(S){i.push(S)};let s=null,o=!0;r.showHelpOnFail=function(S=!0,W){function V(){return typeof S=="string"?[!0,S]:[S,W]}let[ne,me]=V();return s=me,o=ne,r};let a=!1;r.fail=function(S,W){let V=e.getInternalMethods().getLoggerInstance();if(i.length)for(let ne=i.length-1;ne>=0;--ne){let me=i[ne];if(Ff(me)){if(W)throw W;if(S)throw Error(S)}else me(S,W,r)}else{if(e.getExitProcess()&&Ct(!0),a||(a=!0,o&&(e.showHelp("error"),V.error()),(S||W)&&V.error(S||W),s&&((S||W)&&V.error(""),V.error(s))),W=W||new re(S),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,W);throw W}};let l=[],f=!1;r.usage=(P,S)=>P===null?(f=!0,l=[],r):(f=!1,l.push([P,S||""]),r),r.getUsage=()=>l,r.getUsageDisabled=()=>f,r.getPositionalGroupName=()=>n("Positionals:");let u=[];r.example=(P,S)=>{u.push([P,S||""])};let c=[];r.command=function(S,W,V,ne,me=!1){V&&(c=c.map(ee=>(ee[2]=!1,ee))),c.push([S,W||"",V,ne,me])},r.getCommands=()=>c;let d={};r.describe=function(S,W){Array.isArray(S)?S.forEach(V=>{r.describe(V,W)}):typeof S=="object"?Object.keys(S).forEach(V=>{r.describe(V,S[V])}):d[S]=W},r.getDescriptions=()=>d;let h=[];r.epilog=P=>{h.push(P)};let b=!1,g;r.wrap=P=>{b=!0,g=P};function m(){return b||(g=Q(),b=!0),g}let O="__yargsString__:";r.deferY18nLookup=P=>O+P,r.help=function(){if(z)return z;$();let S=e.customScriptName?e.$0:t.path.basename(e.$0),W=e.getDemandedOptions(),V=e.getDemandedCommands(),ne=e.getDeprecatedOptions(),me=e.getGroups(),ee=e.getOptions(),_e=[];_e=_e.concat(Object.keys(d)),_e=_e.concat(Object.keys(W)),_e=_e.concat(Object.keys(V)),_e=_e.concat(Object.keys(ee.default)),_e=_e.filter(q),_e=Object.keys(_e.reduce((B,oe)=>(oe!=="_"&&(B[oe]=!0),B),{}));let Bt=m(),le=t.cliui({width:Bt,wrap:!!Bt});if(!f){if(l.length)l.forEach(B=>{le.div({text:`${B[0].replace(/\$0/g,S)}`}),B[1]&&le.div({text:`${B[1]}`,padding:[1,0,0,0]})}),le.div();else if(c.length){let B=null;V._?B=`${S} <${n("command")}>
|
12
|
+
`:B=`${S} [${n("command")}]
|
13
|
+
`,le.div(`${B}`)}}if(c.length>1||c.length===1&&!c[0][2]){le.div(n("Commands:"));let B=e.getInternalMethods().getContext(),oe=B.commands.length?`${B.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(c=c.sort((X,fe)=>X[0].localeCompare(fe[0])));let ce=S?`${S} `:"";c.forEach(X=>{let fe=`${ce}${oe}${X[0].replace(/^\$0 ?/,"")}`;le.span({text:fe,padding:[0,2,0,2],width:E(c,Bt,`${S}${oe}`)+4},{text:X[1]});let ge=[];X[2]&&ge.push(`[${n("default")}]`),X[3]&&X[3].length&&ge.push(`[${n("aliases:")} ${X[3].join(", ")}]`),X[4]&&(typeof X[4]=="string"?ge.push(`[${n("deprecated: %s",X[4])}]`):ge.push(`[${n("deprecated")}]`)),ge.length?le.div({text:ge.join(" "),padding:[0,0,0,2],align:"right"}):le.div()}),le.div()}let pt=(Object.keys(ee.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);_e=_e.filter(B=>!e.parsed.newAliases[B]&&pt.every(oe=>(ee.alias[oe]||[]).indexOf(B)===-1));let ht=n("Options:");me[ht]||(me[ht]=[]),J(_e,ee.alias,me,ht);let Ht=B=>/^--/.test(mr(B)),H=Object.keys(me).filter(B=>me[B].length>0).map(B=>{let oe=me[B].filter(q).map(ce=>{if(pt.includes(ce))return ce;for(let X=0,fe;(fe=pt[X])!==void 0;X++)if((ee.alias[fe]||[]).includes(ce))return fe;return ce});return{groupName:B,normalizedKeys:oe}}).filter(({normalizedKeys:B})=>B.length>0).map(({groupName:B,normalizedKeys:oe})=>{let ce=oe.reduce((X,fe)=>(X[fe]=[fe].concat(ee.alias[fe]||[]).map(ge=>B===r.getPositionalGroupName()?ge:(/^[0-9]$/.test(ge)?ee.boolean.includes(fe)?"-":"--":ge.length>1?"--":"-")+ge).sort((ge,nt)=>Ht(ge)===Ht(nt)?0:Ht(ge)?1:-1).join(", "),X),{});return{groupName:B,normalizedKeys:oe,switches:ce}});if(H.filter(({groupName:B})=>B!==r.getPositionalGroupName()).some(({normalizedKeys:B,switches:oe})=>!B.every(ce=>Ht(oe[ce])))&&H.filter(({groupName:B})=>B!==r.getPositionalGroupName()).forEach(({normalizedKeys:B,switches:oe})=>{B.forEach(ce=>{Ht(oe[ce])&&(oe[ce]=Tf(oe[ce],4))})}),H.forEach(({groupName:B,normalizedKeys:oe,switches:ce})=>{le.div(B),oe.forEach(X=>{let fe=ce[X],ge=d[X]||"",nt=null;ge.includes(O)&&(ge=n(ge.substring(O.length))),ee.boolean.includes(X)&&(nt=`[${n("boolean")}]`),ee.count.includes(X)&&(nt=`[${n("count")}]`),ee.string.includes(X)&&(nt=`[${n("string")}]`),ee.normalize.includes(X)&&(nt=`[${n("string")}]`),ee.array.includes(X)&&(nt=`[${n("array")}]`),ee.number.includes(X)&&(nt=`[${n("number")}]`);let rt=w=>typeof w=="string"?`[${n("deprecated: %s",w)}]`:`[${n("deprecated")}]`,or=[X in ne?rt(ne[X]):null,nt,X in W?`[${n("required")}]`:null,ee.choices&&ee.choices[X]?`[${n("choices:")} ${r.stringifiedValues(ee.choices[X])}]`:null,k(ee.default[X],ee.defaultDescription[X])].filter(Boolean).join(" ");le.span({text:mr(fe),padding:[0,2,0,2+Ko(fe)],width:E(ce,Bt)+4},ge),or?le.div({text:or,padding:[0,0,0,2],align:"right"}):le.div()}),le.div()}),u.length&&(le.div(n("Examples:")),u.forEach(B=>{B[0]=B[0].replace(/\$0/g,S)}),u.forEach(B=>{B[1]===""?le.div({text:B[0],padding:[0,2,0,2]}):le.div({text:B[0],padding:[0,2,0,2],width:E(u,Bt)+4},{text:B[1]})}),le.div()),h.length>0){let B=h.map(oe=>oe.replace(/\$0/g,S)).join(`
|
14
|
+
`);le.div(`${B}
|
15
|
+
`)}return le.toString().replace(/\s*$/,"")};function E(P,S,W){let V=0;return Array.isArray(P)||(P=Object.values(P).map(ne=>[ne])),P.forEach(ne=>{V=Math.max(t.stringWidth(W?`${W} ${mr(ne[0])}`:mr(ne[0]))+Ko(ne[0]),V)}),S&&(V=Math.min(V,parseInt((S*.5).toString(),10))),V}function $(){let P=e.getDemandedOptions(),S=e.getOptions();(Object.keys(S.alias)||[]).forEach(W=>{S.alias[W].forEach(V=>{d[V]&&r.describe(W,d[V]),V in P&&e.demandOption(W,P[V]),S.boolean.includes(V)&&e.boolean(W),S.count.includes(V)&&e.count(W),S.string.includes(V)&&e.string(W),S.normalize.includes(V)&&e.normalize(W),S.array.includes(V)&&e.array(W),S.number.includes(V)&&e.number(W)})})}let z;r.cacheHelpMessage=function(){z=this.help()},r.clearCachedHelpMessage=function(){z=void 0},r.hasCachedHelpMessage=function(){return!!z};function J(P,S,W,V){let ne=[],me=null;return Object.keys(W).forEach(ee=>{ne=ne.concat(W[ee])}),P.forEach(ee=>{me=[ee].concat(S[ee]),me.some(_e=>ne.indexOf(_e)!==-1)||W[V].push(ee)}),ne}function q(P){return e.getOptions().hiddenOptions.indexOf(P)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}r.showHelp=P=>{let S=e.getInternalMethods().getLoggerInstance();P||(P="error"),(typeof P=="function"?P:S[P])(r.help())},r.functionDescription=P=>{let S=P.name?t.Parser.decamelize(P.name,"-"):n("generated-value");return["(",S,")"].join("")},r.stringifiedValues=function(S,W){let V="",ne=W||", ",me=[].concat(S);return!S||!me.length||me.forEach(ee=>{V.length&&(V+=ne),V+=JSON.stringify(ee)}),V};function k(P,S){let W=`[${n("default:")} `;if(P===void 0&&!S)return null;if(S)W+=S;else switch(typeof P){case"string":W+=`"${P}"`;break;case"object":W+=JSON.stringify(P);break;default:W+=P}return`${W}]`}function Q(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let te=null;r.version=P=>{te=P},r.showVersion=P=>{let S=e.getInternalMethods().getLoggerInstance();P||(P="error"),(typeof P=="function"?P:S[P])(te)},r.reset=function(S){return s=null,a=!1,l=[],f=!1,h=[],u=[],c=[],d=xt(d,W=>!S[W]),r};let Y=[];return r.freeze=function(){Y.push({failMessage:s,failureOutput:a,usages:l,usageDisabled:f,epilogs:h,examples:u,commands:c,descriptions:d})},r.unfreeze=function(){let S=Y.pop();!S||({failMessage:s,failureOutput:a,usages:l,usageDisabled:f,epilogs:h,examples:u,commands:c,descriptions:d}=S)},r}function di(e){return typeof e=="object"}function Tf(e,t){return di(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Ko(e){return di(e)?e.indentation:0}function mr(e){return di(e)?e.text:e}y();y();var Jo=`###-begin-{{app_name}}-completions-###
|
11
16
|
#
|
12
17
|
# yargs command completion script
|
13
18
|
#
|
@@ -35,7 +40,7 @@ _{{app_name}}_yargs_completions()
|
|
35
40
|
}
|
36
41
|
complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
|
37
42
|
###-end-{{app_name}}-completions-###
|
38
|
-
`,
|
43
|
+
`,Xo=`#compdef {{app_name}}
|
39
44
|
###-begin-{{app_name}}-completions-###
|
40
45
|
#
|
41
46
|
# yargs command completion script
|
@@ -54,49 +59,55 @@ _{{app_name}}_yargs_completions()
|
|
54
59
|
}
|
55
60
|
compdef _{{app_name}}_yargs_completions {{app_name}}
|
56
61
|
###-end-{{app_name}}-completions-###
|
57
|
-
`;var
|
58
|
-
${
|
59
|
-
`)}`:"";t.fail(
|
60
|
-
${
|
61
|
-
`;p.forEach(C=>{y+=C}),t.fail(y)}};let l={};o.conflicts=function(f,p){j("<string|object> [array|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(y=>{o.conflicts(y,f[y])}):(e.global(f),l[f]||(l[f]=[]),Array.isArray(p)?p.forEach(y=>o.conflicts(f,y)):l[f].push(p))},o.getConflicting=()=>l,o.conflicting=function(f){Object.keys(f).forEach(p=>{l[p]&&l[p].forEach(y=>{y&&f[p]!==void 0&&f[y]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,y))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(p=>{l[p].forEach(y=>{y&&f[n.Parser.camelCase(p)]!==void 0&&f[n.Parser.camelCase(y)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,y))})})},o.recommendCommands=function(f,p){let y=3;p=p.sort((m,P)=>P.length-m.length);let C=null,A=1/0;for(let m=0,P;(P=p[m])!==void 0;m++){let E=yo(f,P);E<=y&&E<A&&(A=E,C=P)}C&&t.fail(i("Did you mean %s?",C))},o.reset=function(f){return s=ft(s,p=>!f[p]),l=ft(l,p=>!f[p]),o};let u=[];return o.freeze=function(){u.push({implied:s,conflicting:l})},o.unfreeze=function(){let f=u.pop();Pe(f,void 0,n),{implied:s,conflicting:l}=f},o}g();var Wi=[],On;function Zn(e,t,n,i){On=i;let r={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return r;let o=/\.json|\..*rc$/.test(e.extends),s=null;if(o)s=ic(t,e.extends);else try{s=require.resolve(e.extends)}catch(a){return e}nc(s),Wi.push(s),r=o?JSON.parse(On.readFileSync(s,"utf8")):require(e.extends),delete e.extends,r=Zn(r,On.path.dirname(s),n,On)}return Wi=[],n?Ao(r,e):Object.assign({},r,e)}function nc(e){if(Wi.indexOf(e)>-1)throw new Z(`Circular extended configurations: '${e}'.`)}function ic(e,t){return On.path.resolve(e,t)}function Ao(e,t){let n={};function i(r){return r&&typeof r=="object"&&!Array.isArray(r)}Object.assign(n,e);for(let r of Object.keys(t))i(t[r])&&i(n[r])?n[r]=Ao(e[r],t[r]):n[r]=t[r];return n}var I=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},c=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},le,Tt,vn,We,Ne,Xn,dt,Ut,ei,ke,ti,He,Ze,Te,Ye,sn,he,L,ni,ii,Ue,Rt,an,$t,pt,ri,$,Wt,kt,Ht,Y,Xe,oe;function xo(e){return(t=[],n=e.process.cwd(),i)=>{let r=new $o(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Co=Symbol("copyDoubleDash"),Oo=Symbol("copyDoubleDash"),ki=Symbol("deleteFromParserHintObject"),vo=Symbol("emitWarning"),Eo=Symbol("freeze"),_o=Symbol("getDollarZero"),Yt=Symbol("getParserConfiguration"),Hi=Symbol("guessLocale"),So=Symbol("guessVersion"),Po=Symbol("parsePositionalNumbers"),Yi=Symbol("pkgUp"),ht=Symbol("populateParserHintArray"),ln=Symbol("populateParserHintSingleValueDictionary"),Gi=Symbol("populateParserHintArrayDictionary"),Bi=Symbol("populateParserHintDictionary"),qi=Symbol("sanitizeKey"),zi=Symbol("setKey"),Vi=Symbol("unfreeze"),jo=Symbol("validateAsync"),Io=Symbol("getCommandInstance"),Mo=Symbol("getContext"),Fo=Symbol("getHasOutput"),Lo=Symbol("getLoggerInstance"),Do=Symbol("getParseContext"),No=Symbol("getUsageInstance"),To=Symbol("getValidationInstance"),oi=Symbol("hasParseCallback"),Gt=Symbol("postProcess"),Uo=Symbol("rebase"),Qi=Symbol("reset"),En=Symbol("runYargsParserAndExecuteCommands"),Ki=Symbol("runValidation"),Ro=Symbol("setHasOutput"),Bt=Symbol("kTrackManuallySetKeys"),$o=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,le.set(this,void 0),Tt.set(this,void 0),vn.set(this,{commands:[],fullCommands:[]}),We.set(this,null),Ne.set(this,null),Xn.set(this,"show-hidden"),dt.set(this,null),Ut.set(this,!0),ei.set(this,{}),ke.set(this,!0),ti.set(this,[]),He.set(this,void 0),Ze.set(this,{}),Te.set(this,!1),Ye.set(this,null),sn.set(this,void 0),he.set(this,""),L.set(this,void 0),ni.set(this,void 0),ii.set(this,{}),Ue.set(this,null),Rt.set(this,null),an.set(this,{}),$t.set(this,{}),pt.set(this,void 0),ri.set(this,!1),$.set(this,void 0),Wt.set(this,!1),kt.set(this,!1),Ht.set(this,!1),Y.set(this,void 0),Xe.set(this,null),oe.set(this,void 0),I(this,$,r,"f"),I(this,pt,t,"f"),I(this,Tt,n,"f"),I(this,ni,i,"f"),I(this,He,new Ui(this),"f"),this.$0=this[_o](),this[Qi](),I(this,le,c(this,le,"f"),"f"),I(this,Y,c(this,Y,"f"),"f"),I(this,oe,c(this,oe,"f"),"f"),I(this,L,c(this,L,"f"),"f"),c(this,L,"f").showHiddenOpt=c(this,Xn,"f"),I(this,sn,this[Oo](),"f")}addHelpOpt(t,n){let i="help";return j("[string|boolean] [string]",[t,n],arguments.length),c(this,Ye,"f")&&(this[ki](c(this,Ye,"f")),I(this,Ye,null,"f")),t===!1&&n===void 0?this:(I(this,Ye,typeof t=="string"?t:i,"f"),this.boolean(c(this,Ye,"f")),this.describe(c(this,Ye,"f"),n||c(this,Y,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(j("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let i=typeof t=="string"?t:c(this,Xn,"f");return this.boolean(i),this.describe(i,n||c(this,Y,"f").deferY18nLookup("Show hidden options")),c(this,L,"f").showHiddenOpt=i,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[Gi](this.alias.bind(this),"alias",t,n),this}array(t){return j("<array|string>",[t],arguments.length),this[ht]("array",t),this[Bt](t),this}boolean(t){return j("<array|string>",[t],arguments.length),this[ht]("boolean",t),this[Bt](t),this}check(t,n){return j("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>Nt(()=>t(i,r.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&c(this,Y,"f").fail(o.toString(),o):c(this,Y,"f").fail(c(this,$,"f").y18n.__("Argument check failed: %s",t.toString())),i),o=>(c(this,Y,"f").fail(o.message?o.message:o.toString(),o),i)),!1,n),this}choices(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[Gi](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(j("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new Z("coerce callback must be provided");for(let i of t)this.coerce(i,n);return this}else if(typeof t=="object"){for(let i of Object.keys(t))this.coerce(i,t[i]);return this}if(!n)throw new Z("coerce callback must be provided");return c(this,L,"f").key[t]=!0,c(this,He,"f").addCoerceMiddleware((i,r)=>{let o;return Nt(()=>(o=r.getAliases(),n(i[t])),s=>{if(i[t]=s,o[t])for(let a of o[t])i[a]=s;return i},s=>{throw new Z(s.message)})},t),this}conflicts(t,n){return j("<string|object> [string|array]",[t,n],arguments.length),c(this,oe,"f").conflicts(t,n),this}config(t="config",n,i){return j("[object|string] [string|function] [function]",[t,n,i],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=Zn(t,c(this,Tt,"f"),this[Yt]()["deep-merge-config"]||!1,c(this,$,"f")),c(this,L,"f").configObjects=(c(this,L,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(i=n,n=void 0),this.describe(t,n||c(this,Y,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{c(this,L,"f").config[r]=i||!0}),this)}completion(t,n,i){return j("[string] [string|boolean|function] [function]",[t,n,i],arguments.length),typeof n=="function"&&(i=n,n=void 0),I(this,Ne,t||c(this,Ne,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(c(this,Ne,"f"),n),i&&c(this,We,"f").registerFunction(i),this}command(t,n,i,r,o,s){return j("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,i,r,o,s],arguments.length),c(this,le,"f").addHandler(t,n,i,r,o,s),this}commands(t,n,i,r,o,s){return this.command(t,n,i,r,o,s)}commandDir(t,n){j("<string> [object]",[t,n],arguments.length);let i=c(this,ni,"f")||c(this,$,"f").require;return c(this,le,"f").addDirectory(t,i,c(this,$,"f").getCallerFile(),n),this}count(t){return j("<array|string>",[t],arguments.length),this[ht]("count",t),this[Bt](t),this}default(t,n,i){return j("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(Ti(t,c(this,$,"f")),c(this,L,"f").defaultDescription[t]=i),typeof n=="function"&&(Ti(t,c(this,$,"f")),c(this,L,"f").defaultDescription[t]||(c(this,L,"f").defaultDescription[t]=c(this,Y,"f").functionDescription(n)),n=n.call()),this[ln](this.default.bind(this),"default",t,n),this}defaults(t,n,i){return this.default(t,n,i)}demandCommand(t=1,n,i,r){return j("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,i,r],arguments.length),typeof n!="number"&&(i=n,n=1/0),this.global("_",!1),c(this,L,"f").demandedCommands._={min:t,max:n,minMsg:i,maxMsg:r},this}demand(t,n,i){return Array.isArray(n)?(n.forEach(r=>{Pe(i,!0,c(this,$,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(Pe(i,!0,c(this,$,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{Pe(i,!0,c(this,$,"f")),this.demandOption(r,i)}):typeof i=="string"?this.demandOption(t,i):(i===!0||typeof i=="undefined")&&this.demandOption(t),this}demandOption(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[ln](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return j("<string> [string|boolean]",[t,n],arguments.length),c(this,L,"f").deprecatedOptions[t]=n,this}describe(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[zi](t,!0),c(this,Y,"f").describe(t,n),this}detectLocale(t){return j("<boolean>",[t],arguments.length),I(this,Ut,t,"f"),this}env(t){return j("[string|boolean]",[t],arguments.length),t===!1?delete c(this,L,"f").envPrefix:c(this,L,"f").envPrefix=t||"",this}epilogue(t){return j("<string>",[t],arguments.length),c(this,Y,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return j("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(i=>this.example(...i)):c(this,Y,"f").example(t,n),this}exit(t,n){I(this,Te,!0,"f"),I(this,dt,n,"f"),c(this,ke,"f")&&c(this,$,"f").process.exit(t)}exitProcess(t=!0){return j("[boolean]",[t],arguments.length),I(this,ke,t,"f"),this}fail(t){if(j("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new Z("Invalid first argument. Expected function or boolean 'false'");return c(this,Y,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return j("<array> [function]",[t,n],arguments.length),n?c(this,We,"f").getCompletion(t,n):new Promise((i,r)=>{c(this,We,"f").getCompletion(t,(o,s)=>{o?r(o):i(s)})})}getDemandedOptions(){return j([],0),c(this,L,"f").demandedOptions}getDemandedCommands(){return j([],0),c(this,L,"f").demandedCommands}getDeprecatedOptions(){return j([],0),c(this,L,"f").deprecatedOptions}getDetectLocale(){return c(this,Ut,"f")}getExitProcess(){return c(this,ke,"f")}getGroups(){return Object.assign({},c(this,Ze,"f"),c(this,$t,"f"))}getHelp(){if(I(this,Te,!0,"f"),!c(this,Y,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[En](c(this,pt,"f"),void 0,void 0,0,!0);if(te(n))return n.then(()=>c(this,Y,"f").help())}let t=c(this,le,"f").runDefaultBuilderOn(this);if(te(t))return t.then(()=>c(this,Y,"f").help())}return Promise.resolve(c(this,Y,"f").help())}getOptions(){return c(this,L,"f")}getStrict(){return c(this,Wt,"f")}getStrictCommands(){return c(this,kt,"f")}getStrictOptions(){return c(this,Ht,"f")}global(t,n){return j("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?c(this,L,"f").local=c(this,L,"f").local.filter(i=>t.indexOf(i)===-1):t.forEach(i=>{c(this,L,"f").local.includes(i)||c(this,L,"f").local.push(i)}),this}group(t,n){j("<string|array> <string>",[t,n],arguments.length);let i=c(this,$t,"f")[n]||c(this,Ze,"f")[n];c(this,$t,"f")[n]&&delete c(this,$t,"f")[n];let r={};return c(this,Ze,"f")[n]=(i||[]).concat(t).filter(o=>r[o]?!1:r[o]=!0),this}hide(t){return j("<string>",[t],arguments.length),c(this,L,"f").hiddenOptions.push(t),this}implies(t,n){return j("<string|object> [number|string|array]",[t,n],arguments.length),c(this,oe,"f").implies(t,n),this}locale(t){return j("[string]",[t],arguments.length),t?(I(this,Ut,!1,"f"),c(this,$,"f").y18n.setLocale(t),this):(this[Hi](),c(this,$,"f").y18n.getLocale())}middleware(t,n,i){return c(this,He,"f").addMiddleware(t,!!n,i)}nargs(t,n){return j("<string|object|array> [number]",[t,n],arguments.length),this[ln](this.nargs.bind(this),"narg",t,n),this}normalize(t){return j("<array|string>",[t],arguments.length),this[ht]("normalize",t),this}number(t){return j("<array|string>",[t],arguments.length),this[ht]("number",t),this[Bt](t),this}option(t,n){if(j("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(i=>{this.options(i,t[i])});else{typeof n!="object"&&(n={}),this[Bt](t),c(this,Xe,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[vo](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
62
|
-
`),void 0,"versionWarning"),
|
63
|
-
`,"f"),
|
64
|
-
`,"f"),I(this,he,c(this,he,"f")+t.join(" "),"f")}}}[ki](t){rn(c(this,L,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let i=c(this,L,"f")[n];Array.isArray(i)?i.includes(t)&&i.splice(i.indexOf(t),1):typeof i=="object"&&delete i[t]}),delete c(this,Y,"f").getDescriptions()[t]}[vo](t,n,i){c(this,ei,"f")[i]||(c(this,$,"f").process.emitWarning(t,n),c(this,ei,"f")[i]=!0)}[Eo](){c(this,ti,"f").push({options:c(this,L,"f"),configObjects:c(this,L,"f").configObjects.slice(0),exitProcess:c(this,ke,"f"),groups:c(this,Ze,"f"),strict:c(this,Wt,"f"),strictCommands:c(this,kt,"f"),strictOptions:c(this,Ht,"f"),completionCommand:c(this,Ne,"f"),output:c(this,he,"f"),exitError:c(this,dt,"f"),hasOutput:c(this,Te,"f"),parsed:this.parsed,parseFn:c(this,Ue,"f"),parseContext:c(this,Rt,"f")}),c(this,Y,"f").freeze(),c(this,oe,"f").freeze(),c(this,le,"f").freeze(),c(this,He,"f").freeze()}[_o](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(c(this,$,"f").process.argv()[0])?n=c(this,$,"f").process.argv().slice(1,2):n=c(this,$,"f").process.argv().slice(0,1),t=n.map(i=>{let r=this[Uo](c(this,Tt,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),c(this,$,"f").getEnv("_")&&c(this,$,"f").getProcessArgvBin()===c(this,$,"f").getEnv("_")&&(t=c(this,$,"f").getEnv("_").replace(`${c(this,$,"f").path.dirname(c(this,$,"f").process.execPath())}/`,"")),t}[Yt](){return c(this,ii,"f")}[Hi](){if(!c(this,Ut,"f"))return;let t=c(this,$,"f").getEnv("LC_ALL")||c(this,$,"f").getEnv("LC_MESSAGES")||c(this,$,"f").getEnv("LANG")||c(this,$,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[So](){return this[Yi]().version||"unknown"}[Po](t){let n=t["--"]?t["--"]:t._;for(let i=0,r;(r=n[i])!==void 0;i++)c(this,$,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(n[i]=Number(r));return t}[Yi](t){let n=t||"*";if(c(this,an,"f")[n])return c(this,an,"f")[n];let i={};try{let r=t||c(this,$,"f").mainFilename;!t&&c(this,$,"f").path.extname(r)&&(r=c(this,$,"f").path.dirname(r));let o=c(this,$,"f").findUp(r,(s,a)=>{if(a.includes("package.json"))return"package.json"});Pe(o,void 0,c(this,$,"f")),i=JSON.parse(c(this,$,"f").readFileSync(o,"utf8"))}catch(r){}return c(this,an,"f")[n]=i||{},c(this,an,"f")[n]}[ht](t,n){n=[].concat(n),n.forEach(i=>{i=this[qi](i),c(this,L,"f")[t].push(i)})}[ln](t,n,i,r){this[Bi](t,n,i,r,(o,s,a)=>{c(this,L,"f")[o][s]=a})}[Gi](t,n,i,r){this[Bi](t,n,i,r,(o,s,a)=>{c(this,L,"f")[o][s]=(c(this,L,"f")[o][s]||[]).concat(a)})}[Bi](t,n,i,r,o){if(Array.isArray(i))i.forEach(s=>{t(s,r)});else if((s=>typeof s=="object")(i))for(let s of rn(i))t(s,i[s]);else o(n,this[qi](i),r)}[qi](t){return t==="__proto__"?"___proto___":t}[zi](t,n){return this[ln](this[zi].bind(this),"key",t,n),this}[Vi](){var t,n,i,r,o,s,a,l,u,d,f,p;let y=c(this,ti,"f").pop();Pe(y,void 0,c(this,$,"f"));let C;t=this,n=this,i=this,r=this,o=this,s=this,a=this,l=this,u=this,d=this,f=this,p=this,{options:{set value(A){I(t,L,A,"f")}}.value,configObjects:C,exitProcess:{set value(A){I(n,ke,A,"f")}}.value,groups:{set value(A){I(i,Ze,A,"f")}}.value,output:{set value(A){I(r,he,A,"f")}}.value,exitError:{set value(A){I(o,dt,A,"f")}}.value,hasOutput:{set value(A){I(s,Te,A,"f")}}.value,parsed:this.parsed,strict:{set value(A){I(a,Wt,A,"f")}}.value,strictCommands:{set value(A){I(l,kt,A,"f")}}.value,strictOptions:{set value(A){I(u,Ht,A,"f")}}.value,completionCommand:{set value(A){I(d,Ne,A,"f")}}.value,parseFn:{set value(A){I(f,Ue,A,"f")}}.value,parseContext:{set value(A){I(p,Rt,A,"f")}}.value}=y,c(this,L,"f").configObjects=C,c(this,Y,"f").unfreeze(),c(this,oe,"f").unfreeze(),c(this,le,"f").unfreeze(),c(this,He,"f").unfreeze()}[jo](t,n){return Nt(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[Io].bind(this),getContext:this[Mo].bind(this),getHasOutput:this[Fo].bind(this),getLoggerInstance:this[Lo].bind(this),getParseContext:this[Do].bind(this),getParserConfiguration:this[Yt].bind(this),getUsageInstance:this[No].bind(this),getValidationInstance:this[To].bind(this),hasParseCallback:this[oi].bind(this),postProcess:this[Gt].bind(this),reset:this[Qi].bind(this),runValidation:this[Ki].bind(this),runYargsParserAndExecuteCommands:this[En].bind(this),setHasOutput:this[Ro].bind(this)}}[Io](){return c(this,le,"f")}[Mo](){return c(this,vn,"f")}[Fo](){return c(this,Te,"f")}[Lo](){return c(this,sn,"f")}[Do](){return c(this,Rt,"f")||{}}[No](){return c(this,Y,"f")}[To](){return c(this,oe,"f")}[oi](){return!!c(this,Ue,"f")}[Gt](t,n,i,r){return i||te(t)||(n||(t=this[Co](t)),(this[Yt]()["parse-positional-numbers"]||this[Yt]()["parse-positional-numbers"]===void 0)&&(t=this[Po](t)),r&&(t=Dt(t,this,c(this,He,"f").getMiddleware(),!1))),t}[Qi](t={}){I(this,L,c(this,L,"f")||{},"f");let n={};n.local=c(this,L,"f").local||[],n.configObjects=c(this,L,"f").configObjects||[];let i={};n.local.forEach(s=>{i[s]=!0,(t[s]||[]).forEach(a=>{i[a]=!0})}),Object.assign(c(this,$t,"f"),Object.keys(c(this,Ze,"f")).reduce((s,a)=>{let l=c(this,Ze,"f")[a].filter(u=>!(u in i));return l.length>0&&(s[a]=l),s},{})),I(this,Ze,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(s=>{n[s]=(c(this,L,"f")[s]||[]).filter(a=>!i[a])}),o.forEach(s=>{n[s]=ft(c(this,L,"f")[s],a=>!i[a])}),n.envPrefix=c(this,L,"f").envPrefix,I(this,L,n,"f"),I(this,Y,c(this,Y,"f")?c(this,Y,"f").reset(i):fo(this,c(this,$,"f")),"f"),I(this,oe,c(this,oe,"f")?c(this,oe,"f").reset(i):wo(this,c(this,Y,"f"),c(this,$,"f")),"f"),I(this,le,c(this,le,"f")?c(this,le,"f").reset():ao(c(this,Y,"f"),c(this,oe,"f"),c(this,He,"f"),c(this,$,"f")),"f"),c(this,We,"f")||I(this,We,go(this,c(this,Y,"f"),c(this,le,"f"),c(this,$,"f")),"f"),c(this,He,"f").reset(),I(this,Ne,null,"f"),I(this,he,"","f"),I(this,dt,null,"f"),I(this,Te,!1,"f"),this.parsed=!1,this}[Uo](t,n){return c(this,$,"f").path.relative(t,n)}[En](t,n,i,r=0,o=!1){let s=!!i||o;t=t||c(this,pt,"f"),c(this,L,"f").__=c(this,$,"f").y18n.__,c(this,L,"f").configuration=this[Yt]();let a=!!c(this,L,"f").configuration["populate--"],l=Object.assign({},c(this,L,"f").configuration,{"populate--":!0}),u=c(this,$,"f").Parser.detailed(t,Object.assign({},c(this,L,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),d=Object.assign(u.argv,c(this,Rt,"f")),f,p=u.aliases,y=!1,C=!1;Object.keys(d).forEach(A=>{A===c(this,Ye,"f")&&d[A]?y=!0:A===c(this,Xe,"f")&&d[A]&&(C=!0)}),d.$0=this.$0,this.parsed=u,r===0&&c(this,Y,"f").clearCachedHelpMessage();try{if(this[Hi](),n)return this[Gt](d,a,!!i,!1);c(this,Ye,"f")&&[c(this,Ye,"f")].concat(p[c(this,Ye,"f")]||[]).filter(G=>G.length>1).includes(""+d._[d._.length-1])&&(d._.pop(),y=!0);let A=c(this,le,"f").getCommands(),m=c(this,We,"f").completionKey in d,P=y||m||o;if(d._.length){if(A.length){let E;for(let G=r||0,B;d._[G]!==void 0;G++)if(B=String(d._[G]),A.includes(B)&&B!==c(this,Ne,"f")){let V=c(this,le,"f").runCommand(B,this,u,G+1,o,y||C||o);return this[Gt](V,a,!!i,!1)}else if(!E&&B!==c(this,Ne,"f")){E=B;break}!c(this,le,"f").hasDefaultCommand()&&c(this,ri,"f")&&E&&!P&&c(this,oe,"f").recommendCommands(E,A)}c(this,Ne,"f")&&d._.includes(c(this,Ne,"f"))&&!m&&(c(this,ke,"f")&&ut(!0),this.showCompletionScript(),this.exit(0))}if(c(this,le,"f").hasDefaultCommand()&&!P){let E=c(this,le,"f").runCommand(null,this,u,0,o,y||C||o);return this[Gt](E,a,!!i,!1)}if(m){c(this,ke,"f")&&ut(!0),t=[].concat(t);let E=t.slice(t.indexOf(`--${c(this,We,"f").completionKey}`)+1);return c(this,We,"f").getCompletion(E,(G,B)=>{if(G)throw new Z(G.message);(B||[]).forEach(V=>{c(this,sn,"f").log(V)}),this.exit(0)}),this[Gt](d,!a,!!i,!1)}if(c(this,Te,"f")||(y?(c(this,ke,"f")&&ut(!0),s=!0,this.showHelp("log"),this.exit(0)):C&&(c(this,ke,"f")&&ut(!0),s=!0,c(this,Y,"f").showVersion("log"),this.exit(0))),!s&&c(this,L,"f").skipValidation.length>0&&(s=Object.keys(d).some(E=>c(this,L,"f").skipValidation.indexOf(E)>=0&&d[E]===!0)),!s){if(u.error)throw new Z(u.error.message);if(!m){let E=this[Ki](p,{},u.error);i||(f=Dt(d,this,c(this,He,"f").getMiddleware(),!0)),f=this[jo](E,f!=null?f:d),te(f)&&!i&&(f=f.then(()=>Dt(d,this,c(this,He,"f").getMiddleware(),!1)))}}}catch(A){if(A instanceof Z)c(this,Y,"f").fail(A.message,A);else throw A}return this[Gt](f!=null?f:d,a,!!i,!0)}[Ki](t,n,i,r){let o={...this.getDemandedOptions()};return s=>{if(i)throw new Z(i.message);c(this,oe,"f").nonOptionCount(s),c(this,oe,"f").requiredArguments(s,o);let a=!1;c(this,kt,"f")&&(a=c(this,oe,"f").unknownCommands(s)),c(this,Wt,"f")&&!a?c(this,oe,"f").unknownArguments(s,t,n,!!r):c(this,Ht,"f")&&c(this,oe,"f").unknownArguments(s,t,{},!1,!1),c(this,oe,"f").limitedChoices(s),c(this,oe,"f").implications(s),c(this,oe,"f").conflicting(s)}}[Ro](){I(this,Te,!0,"f")}[Bt](t){if(typeof t=="string")c(this,L,"f").key[t]=!0;else for(let n of t)c(this,L,"f").key[n]=!0}};function co(e){return!!e&&typeof e.getInternalMethods=="function"}var rc=xo(no),Ge=rc;g();g();var ga=Q(require("isomorphic-unfetch"));g();var la=Q(require("chalk"),1),Ci=require("fs"),Oi=require("fs/promises"),Nn=require("path");g();function Wo(e){return typeof e=="undefined"||e===null}function oc(e){return typeof e=="object"&&e!==null}function sc(e){return Array.isArray(e)?e:Wo(e)?[]:[e]}function ac(e,t){var n,i,r,o;if(t)for(o=Object.keys(t),n=0,i=o.length;n<i;n+=1)r=o[n],e[r]=t[r];return e}function lc(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function cc(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var fc=Wo,uc=oc,dc=sc,pc=lc,hc=cc,mc=ac,de={isNothing:fc,isObject:uc,toArray:dc,repeat:pc,isNegativeZero:hc,extend:mc};function ko(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
|
62
|
+
`;var Zo=class{constructor(t,n,r,i){var s,o,a;this.yargs=t,this.usage=n,this.command=r,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=(a=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(t,n,r,i){let s=this.command.getCommandHandlers();for(let a=0,l=t.length;a<l;++a)if(s[t[a]]&&s[t[a]].builder){let f=s[t[a]].builder;if(hr(f)){let u=this.yargs.getInternalMethods().reset();return f(u,!0),u.argv}}let o=[];this.commandCompletions(o,t,r),this.optionCompletions(o,t,n,r),this.choicesCompletions(o,t,n,r),i(null,o)}commandCompletions(t,n,r){let i=this.yargs.getInternalMethods().getContext().commands;!r.match(/^-/)&&i[i.length-1]!==r&&!this.previousArgHasChoices(n)&&this.usage.getCommands().forEach(s=>{let o=At(s[0]).cmd;if(n.indexOf(o)===-1)if(!this.zshShell)t.push(o);else{let a=s[1]||"";t.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(t,n,r,i){if((i.match(/^-/)||i===""&&t.length===0)&&!this.previousArgHasChoices(n)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let l=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!this.argsContainKey(n,r,a,l)&&(this.completeOptionKey(a,t,i),l&&!!s.default[a]&&this.completeOptionKey(`no-${a}`,t,i))})}}choicesCompletions(t,n,r,i){if(this.previousArgHasChoices(n)){let s=this.getPreviousArgChoices(n);s&&s.length>0&&t.push(...s)}}getPreviousArgChoices(t){if(t.length<1)return;let n=t[t.length-1],r="";if(!n.startsWith("--")&&t.length>1&&(r=n,n=t[t.length-2]),!n.startsWith("--"))return;let i=n.replace(/-/g,""),s=this.yargs.getOptions();if(Object.keys(s.key).some(o=>o===i)&&Array.isArray(s.choices[i]))return s.choices[i].filter(o=>!r||o.startsWith(r))}previousArgHasChoices(t){let n=this.getPreviousArgChoices(t);return n!==void 0&&n.length>0}argsContainKey(t,n,r,i){if(t.indexOf(`--${r}`)!==-1||i&&t.indexOf(`--no-${r}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[r])if(n[s]!==void 0)return!0}return!1}completeOptionKey(t,n,r){let i=this.usage.getDescriptions(),s=l=>/^--/.test(l),o=l=>/^[^0-9]$/.test(l),a=!s(r)&&o(t)?"-":"--";if(!this.zshShell)n.push(a+t);else{let l=i[t]||"";n.push(a+`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","")}`)}}customCompletion(t,n,r,i){if(De(this.customCompletionFunction,null,this.shim),Df(this.customCompletionFunction)){let s=this.customCompletionFunction(r,n);return ae(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return Nf(this.customCompletionFunction)?this.customCompletionFunction(r,n,(s=i)=>this.defaultCompletion(t,n,r,s),s=>{i(null,s)}):this.customCompletionFunction(r,n,s=>{i(null,s)})}getCompletion(t,n){let r=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),s=this.customCompletionFunction?o=>this.customCompletion(t,o,r,n):o=>this.defaultCompletion(t,o,r,n);return ae(i)?i.then(s):s(i)}generateCompletionScript(t,n){let r=this.zshShell?Xo:Jo,i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),r=r.replace(/{{app_name}}/g,i),r=r.replace(/{{completion_command}}/g,n),r.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}};function es(e,t,n,r){return new Zo(e,t,n,r)}function Df(e){return e.length<3}function Nf(e){return e.length>3}y();y();function ts(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[],r;for(r=0;r<=t.length;r++)n[r]=[r];let i;for(i=0;i<=e.length;i++)n[0][i]=i;for(r=1;r<=t.length;r++)for(i=1;i<=e.length;i++)t.charAt(r-1)===e.charAt(i-1)?n[r][i]=n[r-1][i-1]:r>1&&i>1&&t.charAt(r-2)===e.charAt(i-1)&&t.charAt(r-1)===e.charAt(i-2)?n[r][i]=n[r-2][i-2]+1:n[r][i]=Math.min(n[r-1][i-1]+1,Math.min(n[r][i-1]+1,n[r-1][i]+1));return n[t.length][e.length]}var ns=["$0","--","_"];function rs(e,t,n){let r=n.y18n.__,i=n.y18n.__n,s={};s.nonOptionCount=function(c){let d=e.getDemandedCommands(),b=c._.length+(c["--"]?c["--"].length:0)-e.getInternalMethods().getContext().commands.length;d._&&(b<d._.min||b>d._.max)&&(b<d._.min?d._.minMsg!==void 0?t.fail(d._.minMsg?d._.minMsg.replace(/\$0/g,b.toString()).replace(/\$1/,d._.min.toString()):null):t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",b,b.toString(),d._.min.toString())):b>d._.max&&(d._.maxMsg!==void 0?t.fail(d._.maxMsg?d._.maxMsg.replace(/\$0/g,b.toString()).replace(/\$1/,d._.max.toString()):null):t.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",b,b.toString(),d._.max.toString()))))},s.positionalCount=function(c,d){d<c&&t.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",d,d+"",c+""))},s.requiredArguments=function(c,d){let h=null;for(let b of Object.keys(d))(!Object.prototype.hasOwnProperty.call(c,b)||typeof c[b]=="undefined")&&(h=h||{},h[b]=d[b]);if(h){let b=[];for(let m of Object.keys(h)){let O=h[m];O&&b.indexOf(O)<0&&b.push(O)}let g=b.length?`
|
63
|
+
${b.join(`
|
64
|
+
`)}`:"";t.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(h).length,Object.keys(h).join(", ")+g))}},s.unknownArguments=function(c,d,h,b,g=!0){var m;let O=e.getInternalMethods().getCommandInstance().getCommands(),E=[],$=e.getInternalMethods().getContext();if(Object.keys(c).forEach(z=>{!ns.includes(z)&&!Object.prototype.hasOwnProperty.call(h,z)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),z)&&!s.isValidAndSomeAliasIsNotNew(z,d)&&E.push(z)}),g&&($.commands.length>0||O.length>0||b)&&c._.slice($.commands.length).forEach(z=>{O.includes(""+z)||E.push(""+z)}),g){let J=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,q=$.commands.length+J;q<c._.length&&c._.slice(q).forEach(k=>{k=String(k),!$.commands.includes(k)&&!E.includes(k)&&E.push(k)})}E.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",E.length,E.join(", ")))},s.unknownCommands=function(c){let d=e.getInternalMethods().getCommandInstance().getCommands(),h=[],b=e.getInternalMethods().getContext();return(b.commands.length>0||d.length>0)&&c._.slice(b.commands.length).forEach(g=>{d.includes(""+g)||h.push(""+g)}),h.length>0?(t.fail(i("Unknown command: %s","Unknown commands: %s",h.length,h.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(c,d){if(!Object.prototype.hasOwnProperty.call(d,c))return!1;let h=e.parsed.newAliases;return[c,...d[c]].some(b=>!Object.prototype.hasOwnProperty.call(h,b)||!h[c])},s.limitedChoices=function(c){let d=e.getOptions(),h={};if(!Object.keys(d.choices).length)return;Object.keys(c).forEach(m=>{ns.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(d.choices,m)&&[].concat(c[m]).forEach(O=>{d.choices[m].indexOf(O)===-1&&O!==void 0&&(h[m]=(h[m]||[]).concat(O))})});let b=Object.keys(h);if(!b.length)return;let g=r("Invalid values:");b.forEach(m=>{g+=`
|
65
|
+
${r("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(h[m]),t.stringifiedValues(d.choices[m]))}`}),t.fail(g)};let o={};s.implies=function(c,d){I("<string|object> [array|number|string]",[c,d],arguments.length),typeof c=="object"?Object.keys(c).forEach(h=>{s.implies(h,c[h])}):(e.global(c),o[c]||(o[c]=[]),Array.isArray(d)?d.forEach(h=>s.implies(c,h)):(De(d,void 0,n),o[c].push(d)))},s.getImplied=function(){return o};function a(u,c){let d=Number(c);return c=isNaN(d)?c:d,typeof c=="number"?c=u._.length>=c:c.match(/^--no-.+/)?(c=c.match(/^--no-(.+)/)[1],c=!Object.prototype.hasOwnProperty.call(u,c)):c=Object.prototype.hasOwnProperty.call(u,c),c}s.implications=function(c){let d=[];if(Object.keys(o).forEach(h=>{let b=h;(o[h]||[]).forEach(g=>{let m=b,O=g;m=a(c,m),g=a(c,g),m&&!g&&d.push(` ${b} -> ${O}`)})}),d.length){let h=`${r("Implications failed:")}
|
66
|
+
`;d.forEach(b=>{h+=b}),t.fail(h)}};let l={};s.conflicts=function(c,d){I("<string|object> [array|string]",[c,d],arguments.length),typeof c=="object"?Object.keys(c).forEach(h=>{s.conflicts(h,c[h])}):(e.global(c),l[c]||(l[c]=[]),Array.isArray(d)?d.forEach(h=>s.conflicts(c,h)):l[c].push(d))},s.getConflicting=()=>l,s.conflicting=function(c){Object.keys(c).forEach(d=>{l[d]&&l[d].forEach(h=>{h&&c[d]!==void 0&&c[h]!==void 0&&t.fail(r("Arguments %s and %s are mutually exclusive",d,h))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(d=>{l[d].forEach(h=>{h&&c[n.Parser.camelCase(d)]!==void 0&&c[n.Parser.camelCase(h)]!==void 0&&t.fail(r("Arguments %s and %s are mutually exclusive",d,h))})})},s.recommendCommands=function(c,d){d=d.sort((m,O)=>O.length-m.length);let b=null,g=1/0;for(let m=0,O;(O=d[m])!==void 0;m++){let E=ts(c,O);E<=3&&E<g&&(g=E,b=O)}b&&t.fail(r("Did you mean %s?",b))},s.reset=function(c){return o=xt(o,d=>!c[d]),l=xt(l,d=>!c[d]),s};let f=[];return s.freeze=function(){f.push({implied:o,conflicting:l})},s.unfreeze=function(){let c=f.pop();De(c,void 0,n),{implied:o,conflicting:l}=c},s}y();var pi=[],Rn;function gr(e,t,n,r){Rn=r;let i={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return i;let s=/\.json|\..*rc$/.test(e.extends),o=null;if(s)o=Rf(t,e.extends);else try{o=require.resolve(e.extends)}catch(a){return e}kf(o),pi.push(o),i=s?JSON.parse(Rn.readFileSync(o,"utf8")):require(e.extends),delete e.extends,i=gr(i,Rn.path.dirname(o),n,Rn)}return pi=[],n?is(i,e):Object.assign({},i,e)}function kf(e){if(pi.indexOf(e)>-1)throw new re(`Circular extended configurations: '${e}'.`)}function Rf(e,t){return Rn.path.resolve(e,t)}function is(e,t){let n={};function r(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(n,e);for(let i of Object.keys(t))r(t[i])&&r(n[i])?n[i]=is(e[i],t[i]):n[i]=t[i];return n}var M=function(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},p=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},ye,zt,Un,Je,qe,yr,vt,Vt,br,Xe,wr,Ze,lt,Ye,et,mn,Pe,L,Ar,xr,ze,Kt,gn,Qt,Ot,Cr,G,Jt,Xt,Zt,K,ct,ue;function Cs(e){return(t=[],n=e.process.cwd(),r)=>{let i=new vs(t,n,r,e);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var os=Symbol("copyDoubleDash"),ss=Symbol("copyDoubleDash"),hi=Symbol("deleteFromParserHintObject"),as=Symbol("emitWarning"),ls=Symbol("freeze"),cs=Symbol("getDollarZero"),en=Symbol("getParserConfiguration"),mi=Symbol("guessLocale"),fs=Symbol("guessVersion"),us=Symbol("parsePositionalNumbers"),gi=Symbol("pkgUp"),Et=Symbol("populateParserHintArray"),yn=Symbol("populateParserHintSingleValueDictionary"),yi=Symbol("populateParserHintArrayDictionary"),bi=Symbol("populateParserHintDictionary"),wi=Symbol("sanitizeKey"),Ai=Symbol("setKey"),xi=Symbol("unfreeze"),ds=Symbol("validateAsync"),ps=Symbol("getCommandInstance"),hs=Symbol("getContext"),ms=Symbol("getHasOutput"),gs=Symbol("getLoggerInstance"),ys=Symbol("getParseContext"),bs=Symbol("getUsageInstance"),ws=Symbol("getValidationInstance"),vr=Symbol("hasParseCallback"),tn=Symbol("postProcess"),As=Symbol("rebase"),Ci=Symbol("reset"),$n=Symbol("runYargsParserAndExecuteCommands"),vi=Symbol("runValidation"),xs=Symbol("setHasOutput"),nn=Symbol("kTrackManuallySetKeys"),vs=class{constructor(t=[],n,r,i){this.customScriptName=!1,this.parsed=!1,ye.set(this,void 0),zt.set(this,void 0),Un.set(this,{commands:[],fullCommands:[]}),Je.set(this,null),qe.set(this,null),yr.set(this,"show-hidden"),vt.set(this,null),Vt.set(this,!0),br.set(this,{}),Xe.set(this,!0),wr.set(this,[]),Ze.set(this,void 0),lt.set(this,{}),Ye.set(this,!1),et.set(this,null),mn.set(this,void 0),Pe.set(this,""),L.set(this,void 0),Ar.set(this,void 0),xr.set(this,{}),ze.set(this,null),Kt.set(this,null),gn.set(this,{}),Qt.set(this,{}),Ot.set(this,void 0),Cr.set(this,!1),G.set(this,void 0),Jt.set(this,!1),Xt.set(this,!1),Zt.set(this,!1),K.set(this,void 0),ct.set(this,null),ue.set(this,void 0),M(this,G,i,"f"),M(this,Ot,t,"f"),M(this,zt,n,"f"),M(this,Ar,r,"f"),M(this,Ze,new fi(this),"f"),this.$0=this[cs](),this[Ci](),M(this,ye,p(this,ye,"f"),"f"),M(this,K,p(this,K,"f"),"f"),M(this,ue,p(this,ue,"f"),"f"),M(this,L,p(this,L,"f"),"f"),p(this,L,"f").showHiddenOpt=p(this,yr,"f"),M(this,mn,this[ss](),"f")}addHelpOpt(t,n){let r="help";return I("[string|boolean] [string]",[t,n],arguments.length),p(this,et,"f")&&(this[hi](p(this,et,"f")),M(this,et,null,"f")),t===!1&&n===void 0?this:(M(this,et,typeof t=="string"?t:r,"f"),this.boolean(p(this,et,"f")),this.describe(p(this,et,"f"),n||p(this,K,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(I("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let r=typeof t=="string"?t:p(this,yr,"f");return this.boolean(r),this.describe(r,n||p(this,K,"f").deferY18nLookup("Show hidden options")),p(this,L,"f").showHiddenOpt=r,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return I("<object|string|array> [string|array]",[t,n],arguments.length),this[yi](this.alias.bind(this),"alias",t,n),this}array(t){return I("<array|string>",[t],arguments.length),this[Et]("array",t),this[nn](t),this}boolean(t){return I("<array|string>",[t],arguments.length),this[Et]("boolean",t),this[nn](t),this}check(t,n){return I("<function> [boolean]",[t,n],arguments.length),this.middleware((r,i)=>Yt(()=>t(r,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&p(this,K,"f").fail(s.toString(),s):p(this,K,"f").fail(p(this,G,"f").y18n.__("Argument check failed: %s",t.toString())),r),s=>(p(this,K,"f").fail(s.message?s.message:s.toString(),s),r)),!1,n),this}choices(t,n){return I("<object|string|array> [string|array]",[t,n],arguments.length),this[yi](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(I("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new re("coerce callback must be provided");for(let r of t)this.coerce(r,n);return this}else if(typeof t=="object"){for(let r of Object.keys(t))this.coerce(r,t[r]);return this}if(!n)throw new re("coerce callback must be provided");return p(this,L,"f").key[t]=!0,p(this,Ze,"f").addCoerceMiddleware((r,i)=>{let s;return Yt(()=>(s=i.getAliases(),n(r[t])),o=>{if(r[t]=o,s[t])for(let a of s[t])r[a]=o;return r},o=>{throw new re(o.message)})},t),this}conflicts(t,n){return I("<string|object> [string|array]",[t,n],arguments.length),p(this,ue,"f").conflicts(t,n),this}config(t="config",n,r){return I("[object|string] [string|function] [function]",[t,n,r],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=gr(t,p(this,zt,"f"),this[en]()["deep-merge-config"]||!1,p(this,G,"f")),p(this,L,"f").configObjects=(p(this,L,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(r=n,n=void 0),this.describe(t,n||p(this,K,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{p(this,L,"f").config[i]=r||!0}),this)}completion(t,n,r){return I("[string] [string|boolean|function] [function]",[t,n,r],arguments.length),typeof n=="function"&&(r=n,n=void 0),M(this,qe,t||p(this,qe,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(p(this,qe,"f"),n),r&&p(this,Je,"f").registerFunction(r),this}command(t,n,r,i,s,o){return I("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,r,i,s,o],arguments.length),p(this,ye,"f").addHandler(t,n,r,i,s,o),this}commands(t,n,r,i,s,o){return this.command(t,n,r,i,s,o)}commandDir(t,n){I("<string> [object]",[t,n],arguments.length);let r=p(this,Ar,"f")||p(this,G,"f").require;return p(this,ye,"f").addDirectory(t,r,p(this,G,"f").getCallerFile(),n),this}count(t){return I("<array|string>",[t],arguments.length),this[Et]("count",t),this[nn](t),this}default(t,n,r){return I("<object|string|array> [*] [string]",[t,n,r],arguments.length),r&&(ci(t,p(this,G,"f")),p(this,L,"f").defaultDescription[t]=r),typeof n=="function"&&(ci(t,p(this,G,"f")),p(this,L,"f").defaultDescription[t]||(p(this,L,"f").defaultDescription[t]=p(this,K,"f").functionDescription(n)),n=n.call()),this[yn](this.default.bind(this),"default",t,n),this}defaults(t,n,r){return this.default(t,n,r)}demandCommand(t=1,n,r,i){return I("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,r,i],arguments.length),typeof n!="number"&&(r=n,n=1/0),this.global("_",!1),p(this,L,"f").demandedCommands._={min:t,max:n,minMsg:r,maxMsg:i},this}demand(t,n,r){return Array.isArray(n)?(n.forEach(i=>{De(r,!0,p(this,G,"f")),this.demandOption(i,r)}),n=1/0):typeof n!="number"&&(r=n,n=1/0),typeof t=="number"?(De(r,!0,p(this,G,"f")),this.demandCommand(t,n,r,r)):Array.isArray(t)?t.forEach(i=>{De(r,!0,p(this,G,"f")),this.demandOption(i,r)}):typeof r=="string"?this.demandOption(t,r):(r===!0||typeof r=="undefined")&&this.demandOption(t),this}demandOption(t,n){return I("<object|string|array> [string]",[t,n],arguments.length),this[yn](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return I("<string> [string|boolean]",[t,n],arguments.length),p(this,L,"f").deprecatedOptions[t]=n,this}describe(t,n){return I("<object|string|array> [string]",[t,n],arguments.length),this[Ai](t,!0),p(this,K,"f").describe(t,n),this}detectLocale(t){return I("<boolean>",[t],arguments.length),M(this,Vt,t,"f"),this}env(t){return I("[string|boolean]",[t],arguments.length),t===!1?delete p(this,L,"f").envPrefix:p(this,L,"f").envPrefix=t||"",this}epilogue(t){return I("<string>",[t],arguments.length),p(this,K,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return I("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(r=>this.example(...r)):p(this,K,"f").example(t,n),this}exit(t,n){M(this,Ye,!0,"f"),M(this,vt,n,"f"),p(this,Xe,"f")&&p(this,G,"f").process.exit(t)}exitProcess(t=!0){return I("[boolean]",[t],arguments.length),M(this,Xe,t,"f"),this}fail(t){if(I("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new re("Invalid first argument. Expected function or boolean 'false'");return p(this,K,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return I("<array> [function]",[t,n],arguments.length),n?p(this,Je,"f").getCompletion(t,n):new Promise((r,i)=>{p(this,Je,"f").getCompletion(t,(s,o)=>{s?i(s):r(o)})})}getDemandedOptions(){return I([],0),p(this,L,"f").demandedOptions}getDemandedCommands(){return I([],0),p(this,L,"f").demandedCommands}getDeprecatedOptions(){return I([],0),p(this,L,"f").deprecatedOptions}getDetectLocale(){return p(this,Vt,"f")}getExitProcess(){return p(this,Xe,"f")}getGroups(){return Object.assign({},p(this,lt,"f"),p(this,Qt,"f"))}getHelp(){if(M(this,Ye,!0,"f"),!p(this,K,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[$n](p(this,Ot,"f"),void 0,void 0,0,!0);if(ae(n))return n.then(()=>p(this,K,"f").help())}let t=p(this,ye,"f").runDefaultBuilderOn(this);if(ae(t))return t.then(()=>p(this,K,"f").help())}return Promise.resolve(p(this,K,"f").help())}getOptions(){return p(this,L,"f")}getStrict(){return p(this,Jt,"f")}getStrictCommands(){return p(this,Xt,"f")}getStrictOptions(){return p(this,Zt,"f")}global(t,n){return I("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?p(this,L,"f").local=p(this,L,"f").local.filter(r=>t.indexOf(r)===-1):t.forEach(r=>{p(this,L,"f").local.includes(r)||p(this,L,"f").local.push(r)}),this}group(t,n){I("<string|array> <string>",[t,n],arguments.length);let r=p(this,Qt,"f")[n]||p(this,lt,"f")[n];p(this,Qt,"f")[n]&&delete p(this,Qt,"f")[n];let i={};return p(this,lt,"f")[n]=(r||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return I("<string>",[t],arguments.length),p(this,L,"f").hiddenOptions.push(t),this}implies(t,n){return I("<string|object> [number|string|array]",[t,n],arguments.length),p(this,ue,"f").implies(t,n),this}locale(t){return I("[string]",[t],arguments.length),t?(M(this,Vt,!1,"f"),p(this,G,"f").y18n.setLocale(t),this):(this[mi](),p(this,G,"f").y18n.getLocale())}middleware(t,n,r){return p(this,Ze,"f").addMiddleware(t,!!n,r)}nargs(t,n){return I("<string|object|array> [number]",[t,n],arguments.length),this[yn](this.nargs.bind(this),"narg",t,n),this}normalize(t){return I("<array|string>",[t],arguments.length),this[Et]("normalize",t),this}number(t){return I("<array|string>",[t],arguments.length),this[Et]("number",t),this[nn](t),this}option(t,n){if(I("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(r=>{this.options(r,t[r])});else{typeof n!="object"&&(n={}),this[nn](t),p(this,ct,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[as](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
67
|
+
`),void 0,"versionWarning"),p(this,L,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let r=n.deprecate||n.deprecated;r&&this.deprecateOption(t,r);let i=n.demand||n.required||n.require;i&&this.demand(t,i),n.demandOption&&this.demandOption(t,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),"default"in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(t),typeof n.global=="boolean"&&this.global(t,n.global),n.defaultDescription&&(p(this,L,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let s=n.describe||n.description||n.desc;this.describe(t,s),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,r){I("[string|array] [function|boolean|object] [function]",[t,n,r],arguments.length),this[ls](),typeof t=="undefined"&&(t=p(this,Ot,"f")),typeof n=="object"&&(M(this,Kt,n,"f"),n=r),typeof n=="function"&&(M(this,ze,n,"f"),n=!1),n||M(this,Ot,t,"f"),p(this,ze,"f")&&M(this,Xe,!1,"f");let i=this[$n](t,!!n),s=this.parsed;return p(this,Je,"f").setParsed(this.parsed),ae(i)?i.then(o=>(p(this,ze,"f")&&p(this,ze,"f").call(this,p(this,vt,"f"),o,p(this,Pe,"f")),o)).catch(o=>{throw p(this,ze,"f")&&p(this,ze,"f")(o,this.parsed.argv,p(this,Pe,"f")),o}).finally(()=>{this[xi](),this.parsed=s}):(p(this,ze,"f")&&p(this,ze,"f").call(this,p(this,vt,"f"),i,p(this,Pe,"f")),this[xi](),this.parsed=s,i)}parseAsync(t,n,r){let i=this.parse(t,n,r);return ae(i)?i:Promise.resolve(i)}parseSync(t,n,r){let i=this.parse(t,n,r);if(ae(i))throw new re(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return I("<object>",[t],arguments.length),M(this,xr,t,"f"),this}pkgConf(t,n){I("<string> [string]",[t,n],arguments.length);let r=null,i=this[gi](n||p(this,zt,"f"));return i[t]&&typeof i[t]=="object"&&(r=gr(i[t],n||p(this,zt,"f"),this[en]()["deep-merge-config"]||!1,p(this,G,"f")),p(this,L,"f").configObjects=(p(this,L,"f").configObjects||[]).concat(r)),this}positional(t,n){I("<string> <object>",[t,n],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=xt(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:r.includes(o));let i=p(this,Un,"f").fullCommands[p(this,Un,"f").fullCommands.length-1],s=i?p(this,ye,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return pn(s).forEach(o=>{let a=s[o];Array.isArray(a)?a.indexOf(t)!==-1&&(n[o]=!0):a[t]&&!(o in n)&&(n[o]=a[t])}),this.group(t,p(this,K,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return I("[boolean]",[t],arguments.length),M(this,Cr,t,"f"),this}required(t,n,r){return this.demand(t,n,r)}require(t,n,r){return this.demand(t,n,r)}requiresArg(t){return I("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&p(this,L,"f").narg[t]?this:(this[yn](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return I("[string] [string]",[t,n],arguments.length),t=t||this.$0,p(this,mn,"f").log(p(this,Je,"f").generateCompletionScript(t,n||p(this,qe,"f")||"completion")),this}showHelp(t){if(I("[string|function]",[t],arguments.length),M(this,Ye,!0,"f"),!p(this,K,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[$n](p(this,Ot,"f"),void 0,void 0,0,!0);if(ae(r))return r.then(()=>{p(this,K,"f").showHelp(t)}),this}let n=p(this,ye,"f").runDefaultBuilderOn(this);if(ae(n))return n.then(()=>{p(this,K,"f").showHelp(t)}),this}return p(this,K,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return I("[boolean|string] [string]",[t,n],arguments.length),p(this,K,"f").showHelpOnFail(t,n),this}showVersion(t){return I("[string|function]",[t],arguments.length),p(this,K,"f").showVersion(t),this}skipValidation(t){return I("<array|string>",[t],arguments.length),this[Et]("skipValidation",t),this}strict(t){return I("[boolean]",[t],arguments.length),M(this,Jt,t!==!1,"f"),this}strictCommands(t){return I("[boolean]",[t],arguments.length),M(this,Xt,t!==!1,"f"),this}strictOptions(t){return I("[boolean]",[t],arguments.length),M(this,Zt,t!==!1,"f"),this}string(t){return I("<array|string>",[t],arguments.length),this[Et]("string",t),this[nn](t),this}terminalWidth(){return I([],0),p(this,G,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return I("<object>",[t],arguments.length),M(this,Vt,!1,"f"),p(this,G,"f").y18n.updateLocale(t),this}usage(t,n,r,i){if(I("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,r,i],arguments.length),n!==void 0){if(De(t,null,p(this,G,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,r,i);throw new re(".usage() description must start with $0 if being used as alias for .command()")}else return p(this,K,"f").usage(t),this}version(t,n,r){let i="version";if(I("[boolean|string] [string] [string]",[t,n,r],arguments.length),p(this,ct,"f")&&(this[hi](p(this,ct,"f")),p(this,K,"f").version(void 0),M(this,ct,null,"f")),arguments.length===0)r=this[fs](),t=i;else if(arguments.length===1){if(t===!1)return this;r=t,t=i}else arguments.length===2&&(r=n,n=void 0);return M(this,ct,typeof t=="string"?t:i,"f"),n=n||p(this,K,"f").deferY18nLookup("Show version number"),p(this,K,"f").version(r||void 0),this.boolean(p(this,ct,"f")),this.describe(p(this,ct,"f"),n),this}wrap(t){return I("<number|null|undefined>",[t],arguments.length),p(this,K,"f").wrap(t),this}[(ye=new WeakMap,zt=new WeakMap,Un=new WeakMap,Je=new WeakMap,qe=new WeakMap,yr=new WeakMap,vt=new WeakMap,Vt=new WeakMap,br=new WeakMap,Xe=new WeakMap,wr=new WeakMap,Ze=new WeakMap,lt=new WeakMap,Ye=new WeakMap,et=new WeakMap,mn=new WeakMap,Pe=new WeakMap,L=new WeakMap,Ar=new WeakMap,xr=new WeakMap,ze=new WeakMap,Kt=new WeakMap,gn=new WeakMap,Qt=new WeakMap,Ot=new WeakMap,Cr=new WeakMap,G=new WeakMap,Jt=new WeakMap,Xt=new WeakMap,Zt=new WeakMap,K=new WeakMap,ct=new WeakMap,ue=new WeakMap,os)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[ss](){return{log:(...t)=>{this[vr]()||console.log(...t),M(this,Ye,!0,"f"),p(this,Pe,"f").length&&M(this,Pe,p(this,Pe,"f")+`
|
68
|
+
`,"f"),M(this,Pe,p(this,Pe,"f")+t.join(" "),"f")},error:(...t)=>{this[vr]()||console.error(...t),M(this,Ye,!0,"f"),p(this,Pe,"f").length&&M(this,Pe,p(this,Pe,"f")+`
|
69
|
+
`,"f"),M(this,Pe,p(this,Pe,"f")+t.join(" "),"f")}}}[hi](t){pn(p(this,L,"f")).forEach(n=>{if((i=>i==="configObjects")(n))return;let r=p(this,L,"f")[n];Array.isArray(r)?r.includes(t)&&r.splice(r.indexOf(t),1):typeof r=="object"&&delete r[t]}),delete p(this,K,"f").getDescriptions()[t]}[as](t,n,r){p(this,br,"f")[r]||(p(this,G,"f").process.emitWarning(t,n),p(this,br,"f")[r]=!0)}[ls](){p(this,wr,"f").push({options:p(this,L,"f"),configObjects:p(this,L,"f").configObjects.slice(0),exitProcess:p(this,Xe,"f"),groups:p(this,lt,"f"),strict:p(this,Jt,"f"),strictCommands:p(this,Xt,"f"),strictOptions:p(this,Zt,"f"),completionCommand:p(this,qe,"f"),output:p(this,Pe,"f"),exitError:p(this,vt,"f"),hasOutput:p(this,Ye,"f"),parsed:this.parsed,parseFn:p(this,ze,"f"),parseContext:p(this,Kt,"f")}),p(this,K,"f").freeze(),p(this,ue,"f").freeze(),p(this,ye,"f").freeze(),p(this,Ze,"f").freeze()}[cs](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(p(this,G,"f").process.argv()[0])?n=p(this,G,"f").process.argv().slice(1,2):n=p(this,G,"f").process.argv().slice(0,1),t=n.map(r=>{let i=this[As](p(this,zt,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<r.length?i:r}).join(" ").trim(),p(this,G,"f").getEnv("_")&&p(this,G,"f").getProcessArgvBin()===p(this,G,"f").getEnv("_")&&(t=p(this,G,"f").getEnv("_").replace(`${p(this,G,"f").path.dirname(p(this,G,"f").process.execPath())}/`,"")),t}[en](){return p(this,xr,"f")}[mi](){if(!p(this,Vt,"f"))return;let t=p(this,G,"f").getEnv("LC_ALL")||p(this,G,"f").getEnv("LC_MESSAGES")||p(this,G,"f").getEnv("LANG")||p(this,G,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[fs](){return this[gi]().version||"unknown"}[us](t){let n=t["--"]?t["--"]:t._;for(let r=0,i;(i=n[r])!==void 0;r++)p(this,G,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(n[r]=Number(i));return t}[gi](t){let n=t||"*";if(p(this,gn,"f")[n])return p(this,gn,"f")[n];let r={};try{let i=t||p(this,G,"f").mainFilename;!t&&p(this,G,"f").path.extname(i)&&(i=p(this,G,"f").path.dirname(i));let s=p(this,G,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});De(s,void 0,p(this,G,"f")),r=JSON.parse(p(this,G,"f").readFileSync(s,"utf8"))}catch(i){}return p(this,gn,"f")[n]=r||{},p(this,gn,"f")[n]}[Et](t,n){n=[].concat(n),n.forEach(r=>{r=this[wi](r),p(this,L,"f")[t].push(r)})}[yn](t,n,r,i){this[bi](t,n,r,i,(s,o,a)=>{p(this,L,"f")[s][o]=a})}[yi](t,n,r,i){this[bi](t,n,r,i,(s,o,a)=>{p(this,L,"f")[s][o]=(p(this,L,"f")[s][o]||[]).concat(a)})}[bi](t,n,r,i,s){if(Array.isArray(r))r.forEach(o=>{t(o,i)});else if((o=>typeof o=="object")(r))for(let o of pn(r))t(o,r[o]);else s(n,this[wi](r),i)}[wi](t){return t==="__proto__"?"___proto___":t}[Ai](t,n){return this[yn](this[Ai].bind(this),"key",t,n),this}[xi](){var t,n,r,i,s,o,a,l,f,u,c,d;let h=p(this,wr,"f").pop();De(h,void 0,p(this,G,"f"));let b;t=this,n=this,r=this,i=this,s=this,o=this,a=this,l=this,f=this,u=this,c=this,d=this,{options:{set value(g){M(t,L,g,"f")}}.value,configObjects:b,exitProcess:{set value(g){M(n,Xe,g,"f")}}.value,groups:{set value(g){M(r,lt,g,"f")}}.value,output:{set value(g){M(i,Pe,g,"f")}}.value,exitError:{set value(g){M(s,vt,g,"f")}}.value,hasOutput:{set value(g){M(o,Ye,g,"f")}}.value,parsed:this.parsed,strict:{set value(g){M(a,Jt,g,"f")}}.value,strictCommands:{set value(g){M(l,Xt,g,"f")}}.value,strictOptions:{set value(g){M(f,Zt,g,"f")}}.value,completionCommand:{set value(g){M(u,qe,g,"f")}}.value,parseFn:{set value(g){M(c,ze,g,"f")}}.value,parseContext:{set value(g){M(d,Kt,g,"f")}}.value}=h,p(this,L,"f").configObjects=b,p(this,K,"f").unfreeze(),p(this,ue,"f").unfreeze(),p(this,ye,"f").unfreeze(),p(this,Ze,"f").unfreeze()}[ds](t,n){return Yt(n,r=>(t(r),r))}getInternalMethods(){return{getCommandInstance:this[ps].bind(this),getContext:this[hs].bind(this),getHasOutput:this[ms].bind(this),getLoggerInstance:this[gs].bind(this),getParseContext:this[ys].bind(this),getParserConfiguration:this[en].bind(this),getUsageInstance:this[bs].bind(this),getValidationInstance:this[ws].bind(this),hasParseCallback:this[vr].bind(this),postProcess:this[tn].bind(this),reset:this[Ci].bind(this),runValidation:this[vi].bind(this),runYargsParserAndExecuteCommands:this[$n].bind(this),setHasOutput:this[xs].bind(this)}}[ps](){return p(this,ye,"f")}[hs](){return p(this,Un,"f")}[ms](){return p(this,Ye,"f")}[gs](){return p(this,mn,"f")}[ys](){return p(this,Kt,"f")||{}}[bs](){return p(this,K,"f")}[ws](){return p(this,ue,"f")}[vr](){return!!p(this,ze,"f")}[tn](t,n,r,i){return r||ae(t)||(n||(t=this[os](t)),(this[en]()["parse-positional-numbers"]||this[en]()["parse-positional-numbers"]===void 0)&&(t=this[us](t)),i&&(t=qt(t,this,p(this,Ze,"f").getMiddleware(),!1))),t}[Ci](t={}){M(this,L,p(this,L,"f")||{},"f");let n={};n.local=p(this,L,"f").local||[],n.configObjects=p(this,L,"f").configObjects||[];let r={};n.local.forEach(o=>{r[o]=!0,(t[o]||[]).forEach(a=>{r[a]=!0})}),Object.assign(p(this,Qt,"f"),Object.keys(p(this,lt,"f")).reduce((o,a)=>{let l=p(this,lt,"f")[a].filter(f=>!(f in r));return l.length>0&&(o[a]=l),o},{})),M(this,lt,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{n[o]=(p(this,L,"f")[o]||[]).filter(a=>!r[a])}),s.forEach(o=>{n[o]=xt(p(this,L,"f")[o],a=>!r[a])}),n.envPrefix=p(this,L,"f").envPrefix,M(this,L,n,"f"),M(this,K,p(this,K,"f")?p(this,K,"f").reset(r):Qo(this,p(this,G,"f")),"f"),M(this,ue,p(this,ue,"f")?p(this,ue,"f").reset(r):rs(this,p(this,K,"f"),p(this,G,"f")),"f"),M(this,ye,p(this,ye,"f")?p(this,ye,"f").reset():zo(p(this,K,"f"),p(this,ue,"f"),p(this,Ze,"f"),p(this,G,"f")),"f"),p(this,Je,"f")||M(this,Je,es(this,p(this,K,"f"),p(this,ye,"f"),p(this,G,"f")),"f"),p(this,Ze,"f").reset(),M(this,qe,null,"f"),M(this,Pe,"","f"),M(this,vt,null,"f"),M(this,Ye,!1,"f"),this.parsed=!1,this}[As](t,n){return p(this,G,"f").path.relative(t,n)}[$n](t,n,r,i=0,s=!1){let o=!!r||s;t=t||p(this,Ot,"f"),p(this,L,"f").__=p(this,G,"f").y18n.__,p(this,L,"f").configuration=this[en]();let a=!!p(this,L,"f").configuration["populate--"],l=Object.assign({},p(this,L,"f").configuration,{"populate--":!0}),f=p(this,G,"f").Parser.detailed(t,Object.assign({},p(this,L,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),u=Object.assign(f.argv,p(this,Kt,"f")),c,d=f.aliases,h=!1,b=!1;Object.keys(u).forEach(g=>{g===p(this,et,"f")&&u[g]?h=!0:g===p(this,ct,"f")&&u[g]&&(b=!0)}),u.$0=this.$0,this.parsed=f,i===0&&p(this,K,"f").clearCachedHelpMessage();try{if(this[mi](),n)return this[tn](u,a,!!r,!1);p(this,et,"f")&&[p(this,et,"f")].concat(d[p(this,et,"f")]||[]).filter($=>$.length>1).includes(""+u._[u._.length-1])&&(u._.pop(),h=!0);let g=p(this,ye,"f").getCommands(),m=p(this,Je,"f").completionKey in u,O=h||m||s;if(u._.length){if(g.length){let E;for(let $=i||0,z;u._[$]!==void 0;$++)if(z=String(u._[$]),g.includes(z)&&z!==p(this,qe,"f")){let J=p(this,ye,"f").runCommand(z,this,f,$+1,s,h||b||s);return this[tn](J,a,!!r,!1)}else if(!E&&z!==p(this,qe,"f")){E=z;break}!p(this,ye,"f").hasDefaultCommand()&&p(this,Cr,"f")&&E&&!O&&p(this,ue,"f").recommendCommands(E,g)}p(this,qe,"f")&&u._.includes(p(this,qe,"f"))&&!m&&(p(this,Xe,"f")&&Ct(!0),this.showCompletionScript(),this.exit(0))}if(p(this,ye,"f").hasDefaultCommand()&&!O){let E=p(this,ye,"f").runCommand(null,this,f,0,s,h||b||s);return this[tn](E,a,!!r,!1)}if(m){p(this,Xe,"f")&&Ct(!0),t=[].concat(t);let E=t.slice(t.indexOf(`--${p(this,Je,"f").completionKey}`)+1);return p(this,Je,"f").getCompletion(E,($,z)=>{if($)throw new re($.message);(z||[]).forEach(J=>{p(this,mn,"f").log(J)}),this.exit(0)}),this[tn](u,!a,!!r,!1)}if(p(this,Ye,"f")||(h?(p(this,Xe,"f")&&Ct(!0),o=!0,this.showHelp("log"),this.exit(0)):b&&(p(this,Xe,"f")&&Ct(!0),o=!0,p(this,K,"f").showVersion("log"),this.exit(0))),!o&&p(this,L,"f").skipValidation.length>0&&(o=Object.keys(u).some(E=>p(this,L,"f").skipValidation.indexOf(E)>=0&&u[E]===!0)),!o){if(f.error)throw new re(f.error.message);if(!m){let E=this[vi](d,{},f.error);r||(c=qt(u,this,p(this,Ze,"f").getMiddleware(),!0)),c=this[ds](E,c!=null?c:u),ae(c)&&!r&&(c=c.then(()=>qt(u,this,p(this,Ze,"f").getMiddleware(),!1)))}}}catch(g){if(g instanceof re)p(this,K,"f").fail(g.message,g);else throw g}return this[tn](c!=null?c:u,a,!!r,!0)}[vi](t,n,r,i){let s={...this.getDemandedOptions()};return o=>{if(r)throw new re(r.message);p(this,ue,"f").nonOptionCount(o),p(this,ue,"f").requiredArguments(o,s);let a=!1;p(this,Xt,"f")&&(a=p(this,ue,"f").unknownCommands(o)),p(this,Jt,"f")&&!a?p(this,ue,"f").unknownArguments(o,t,n,!!i):p(this,Zt,"f")&&p(this,ue,"f").unknownArguments(o,t,{},!1,!1),p(this,ue,"f").limitedChoices(o),p(this,ue,"f").implications(o),p(this,ue,"f").conflicting(o)}}[xs](){M(this,Ye,!0,"f")}[nn](t){if(typeof t=="string")p(this,L,"f").key[t]=!0;else for(let n of t)p(this,L,"f").key[n]=!0}};function Vo(e){return!!e&&typeof e.getInternalMethods=="function"}var Uf=Cs(Wo),Ne=Uf;y();y();var il=Z(require("isomorphic-unfetch"));y();y();var $f=Object.create,Or=Object.defineProperty,Wf=Object.defineProperties,Bf=Object.getOwnPropertyDescriptor,Hf=Object.getOwnPropertyDescriptors,Gf=Object.getOwnPropertyNames,Os=Object.getOwnPropertySymbols,qf=Object.getPrototypeOf,Ss=Object.prototype.hasOwnProperty,Yf=Object.prototype.propertyIsEnumerable,Es=(e,t,n)=>t in e?Or(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zf=(e,t)=>{for(var n in t||(t={}))Ss.call(t,n)&&Es(e,n,t[n]);if(Os)for(var n of Os(t))Yf.call(t,n)&&Es(e,n,t[n]);return e},Vf=(e,t)=>Wf(e,Hf(t)),Kf=e=>Or(e,"__esModule",{value:!0}),_s=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),Qf=(e,t)=>()=>(e&&(t=e(e=0)),t),ft=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Jf=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gf(t))!Ss.call(e,i)&&(n||i!=="default")&&Or(e,i,{get:()=>t[i],enumerable:!(r=Bf(t,i))||r.enumerable});return e},Oi=(e,t)=>Jf(Kf(Or(e!=null?$f(qf(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Ie=Qf(()=>{}),Xf=ft((e,t)=>{"use strict";Ie(),t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),js=ft((e,t)=>{Ie();var n=Xf(),r={};for(let o of Object.keys(n))r[n[o]]=o;var i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=i;for(let o of Object.keys(i)){if(!("channels"in i[o]))throw new Error("missing channels property: "+o);if(!("labels"in i[o]))throw new Error("missing channel labels property: "+o);if(i[o].labels.length!==i[o].channels)throw new Error("channel and label counts mismatch: "+o);let{channels:a,labels:l}=i[o];delete i[o].channels,delete i[o].labels,Object.defineProperty(i[o],"channels",{value:a}),Object.defineProperty(i[o],"labels",{value:l})}i.rgb.hsl=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.min(a,l,f),c=Math.max(a,l,f),d=c-u,h,b;c===u?h=0:a===c?h=(l-f)/d:l===c?h=2+(f-a)/d:f===c&&(h=4+(a-l)/d),h=Math.min(h*60,360),h<0&&(h+=360);let g=(u+c)/2;return c===u?b=0:g<=.5?b=d/(c+u):b=d/(2-c-u),[h,b*100,g*100]},i.rgb.hsv=function(o){let a,l,f,u,c,d=o[0]/255,h=o[1]/255,b=o[2]/255,g=Math.max(d,h,b),m=g-Math.min(d,h,b),O=function(E){return(g-E)/6/m+1/2};return m===0?(u=0,c=0):(c=m/g,a=O(d),l=O(h),f=O(b),d===g?u=f-l:h===g?u=1/3+a-f:b===g&&(u=2/3+l-a),u<0?u+=1:u>1&&(u-=1)),[u*360,c*100,g*100]},i.rgb.hwb=function(o){let a=o[0],l=o[1],f=o[2],u=i.rgb.hsl(o)[0],c=1/255*Math.min(a,Math.min(l,f));return f=1-1/255*Math.max(a,Math.max(l,f)),[u,c*100,f*100]},i.rgb.cmyk=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.min(1-a,1-l,1-f),c=(1-a-u)/(1-u)||0,d=(1-l-u)/(1-u)||0,h=(1-f-u)/(1-u)||0;return[c*100,d*100,h*100,u*100]};function s(o,a){return(o[0]-a[0])**2+(o[1]-a[1])**2+(o[2]-a[2])**2}i.rgb.keyword=function(o){let a=r[o];if(a)return a;let l=1/0,f;for(let u of Object.keys(n)){let c=n[u],d=s(o,c);d<l&&(l=d,f=u)}return f},i.keyword.rgb=function(o){return n[o]},i.rgb.xyz=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255;a=a>.04045?((a+.055)/1.055)**2.4:a/12.92,l=l>.04045?((l+.055)/1.055)**2.4:l/12.92,f=f>.04045?((f+.055)/1.055)**2.4:f/12.92;let u=a*.4124+l*.3576+f*.1805,c=a*.2126+l*.7152+f*.0722,d=a*.0193+l*.1192+f*.9505;return[u*100,c*100,d*100]},i.rgb.lab=function(o){let a=i.rgb.xyz(o),l=a[0],f=a[1],u=a[2];l/=95.047,f/=100,u/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,f=f>.008856?f**(1/3):7.787*f+16/116,u=u>.008856?u**(1/3):7.787*u+16/116;let c=116*f-16,d=500*(l-f),h=200*(f-u);return[c,d,h]},i.hsl.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100,u,c,d;if(l===0)return d=f*255,[d,d,d];f<.5?u=f*(1+l):u=f+l-f*l;let h=2*f-u,b=[0,0,0];for(let g=0;g<3;g++)c=a+1/3*-(g-1),c<0&&c++,c>1&&c--,6*c<1?d=h+(u-h)*6*c:2*c<1?d=u:3*c<2?d=h+(u-h)*(2/3-c)*6:d=h,b[g]=d*255;return b},i.hsl.hsv=function(o){let a=o[0],l=o[1]/100,f=o[2]/100,u=l,c=Math.max(f,.01);f*=2,l*=f<=1?f:2-f,u*=c<=1?c:2-c;let d=(f+l)/2,h=f===0?2*u/(c+u):2*l/(f+l);return[a,h*100,d*100]},i.hsv.rgb=function(o){let a=o[0]/60,l=o[1]/100,f=o[2]/100,u=Math.floor(a)%6,c=a-Math.floor(a),d=255*f*(1-l),h=255*f*(1-l*c),b=255*f*(1-l*(1-c));switch(f*=255,u){case 0:return[f,b,d];case 1:return[h,f,d];case 2:return[d,f,b];case 3:return[d,h,f];case 4:return[b,d,f];case 5:return[f,d,h]}},i.hsv.hsl=function(o){let a=o[0],l=o[1]/100,f=o[2]/100,u=Math.max(f,.01),c,d;d=(2-l)*f;let h=(2-l)*u;return c=l*u,c/=h<=1?h:2-h,c=c||0,d/=2,[a,c*100,d*100]},i.hwb.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100,u=l+f,c;u>1&&(l/=u,f/=u);let d=Math.floor(6*a),h=1-f;c=6*a-d,(d&1)!==0&&(c=1-c);let b=l+c*(h-l),g,m,O;switch(d){default:case 6:case 0:g=h,m=b,O=l;break;case 1:g=b,m=h,O=l;break;case 2:g=l,m=h,O=b;break;case 3:g=l,m=b,O=h;break;case 4:g=b,m=l,O=h;break;case 5:g=h,m=l,O=b;break}return[g*255,m*255,O*255]},i.cmyk.rgb=function(o){let a=o[0]/100,l=o[1]/100,f=o[2]/100,u=o[3]/100,c=1-Math.min(1,a*(1-u)+u),d=1-Math.min(1,l*(1-u)+u),h=1-Math.min(1,f*(1-u)+u);return[c*255,d*255,h*255]},i.xyz.rgb=function(o){let a=o[0]/100,l=o[1]/100,f=o[2]/100,u,c,d;return u=a*3.2406+l*-1.5372+f*-.4986,c=a*-.9689+l*1.8758+f*.0415,d=a*.0557+l*-.204+f*1.057,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,d=d>.0031308?1.055*d**(1/2.4)-.055:d*12.92,u=Math.min(Math.max(0,u),1),c=Math.min(Math.max(0,c),1),d=Math.min(Math.max(0,d),1),[u*255,c*255,d*255]},i.xyz.lab=function(o){let a=o[0],l=o[1],f=o[2];a/=95.047,l/=100,f/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,f=f>.008856?f**(1/3):7.787*f+16/116;let u=116*l-16,c=500*(a-l),d=200*(l-f);return[u,c,d]},i.lab.xyz=function(o){let a=o[0],l=o[1],f=o[2],u,c,d;c=(a+16)/116,u=l/500+c,d=c-f/200;let h=c**3,b=u**3,g=d**3;return c=h>.008856?h:(c-16/116)/7.787,u=b>.008856?b:(u-16/116)/7.787,d=g>.008856?g:(d-16/116)/7.787,u*=95.047,c*=100,d*=108.883,[u,c,d]},i.lab.lch=function(o){let a=o[0],l=o[1],f=o[2],u;u=Math.atan2(f,l)*360/2/Math.PI,u<0&&(u+=360);let c=Math.sqrt(l*l+f*f);return[a,c,u]},i.lch.lab=function(o){let a=o[0],l=o[1],f=o[2]/360*2*Math.PI,u=l*Math.cos(f),c=l*Math.sin(f);return[a,u,c]},i.rgb.ansi16=function(o,a=null){let[l,f,u]=o,c=a===null?i.rgb.hsv(o)[2]:a;if(c=Math.round(c/50),c===0)return 30;let d=30+(Math.round(u/255)<<2|Math.round(f/255)<<1|Math.round(l/255));return c===2&&(d+=60),d},i.hsv.ansi16=function(o){return i.rgb.ansi16(i.hsv.rgb(o),o[2])},i.rgb.ansi256=function(o){let a=o[0],l=o[1],f=o[2];return a===l&&l===f?a<8?16:a>248?231:Math.round((a-8)/247*24)+232:16+36*Math.round(a/255*5)+6*Math.round(l/255*5)+Math.round(f/255*5)},i.ansi16.rgb=function(o){let a=o%10;if(a===0||a===7)return o>50&&(a+=3.5),a=a/10.5*255,[a,a,a];let l=(~~(o>50)+1)*.5,f=(a&1)*l*255,u=(a>>1&1)*l*255,c=(a>>2&1)*l*255;return[f,u,c]},i.ansi256.rgb=function(o){if(o>=232){let c=(o-232)*10+8;return[c,c,c]}o-=16;let a,l=Math.floor(o/36)/5*255,f=Math.floor((a=o%36)/6)/5*255,u=a%6/5*255;return[l,f,u]},i.rgb.hex=function(o){let a=(((Math.round(o[0])&255)<<16)+((Math.round(o[1])&255)<<8)+(Math.round(o[2])&255)).toString(16).toUpperCase();return"000000".substring(a.length)+a},i.hex.rgb=function(o){let a=o.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!a)return[0,0,0];let l=a[0];a[0].length===3&&(l=l.split("").map(h=>h+h).join(""));let f=parseInt(l,16),u=f>>16&255,c=f>>8&255,d=f&255;return[u,c,d]},i.rgb.hcg=function(o){let a=o[0]/255,l=o[1]/255,f=o[2]/255,u=Math.max(Math.max(a,l),f),c=Math.min(Math.min(a,l),f),d=u-c,h,b;return d<1?h=c/(1-d):h=0,d<=0?b=0:u===a?b=(l-f)/d%6:u===l?b=2+(f-a)/d:b=4+(a-l)/d,b/=6,b%=1,[b*360,d*100,h*100]},i.hsl.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=l<.5?2*a*l:2*a*(1-l),u=0;return f<1&&(u=(l-.5*f)/(1-f)),[o[0],f*100,u*100]},i.hsv.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=a*l,u=0;return f<1&&(u=(l-f)/(1-f)),[o[0],f*100,u*100]},i.hcg.rgb=function(o){let a=o[0]/360,l=o[1]/100,f=o[2]/100;if(l===0)return[f*255,f*255,f*255];let u=[0,0,0],c=a%1*6,d=c%1,h=1-d,b=0;switch(Math.floor(c)){case 0:u[0]=1,u[1]=d,u[2]=0;break;case 1:u[0]=h,u[1]=1,u[2]=0;break;case 2:u[0]=0,u[1]=1,u[2]=d;break;case 3:u[0]=0,u[1]=h,u[2]=1;break;case 4:u[0]=d,u[1]=0,u[2]=1;break;default:u[0]=1,u[1]=0,u[2]=h}return b=(1-l)*f,[(l*u[0]+b)*255,(l*u[1]+b)*255,(l*u[2]+b)*255]},i.hcg.hsv=function(o){let a=o[1]/100,l=o[2]/100,f=a+l*(1-a),u=0;return f>0&&(u=a/f),[o[0],u*100,f*100]},i.hcg.hsl=function(o){let a=o[1]/100,l=o[2]/100*(1-a)+.5*a,f=0;return l>0&&l<.5?f=a/(2*l):l>=.5&&l<1&&(f=a/(2*(1-l))),[o[0],f*100,l*100]},i.hcg.hwb=function(o){let a=o[1]/100,l=o[2]/100,f=a+l*(1-a);return[o[0],(f-a)*100,(1-f)*100]},i.hwb.hcg=function(o){let a=o[1]/100,l=o[2]/100,f=1-l,u=f-a,c=0;return u<1&&(c=(f-u)/(1-u)),[o[0],u*100,c*100]},i.apple.rgb=function(o){return[o[0]/65535*255,o[1]/65535*255,o[2]/65535*255]},i.rgb.apple=function(o){return[o[0]/255*65535,o[1]/255*65535,o[2]/255*65535]},i.gray.rgb=function(o){return[o[0]/100*255,o[0]/100*255,o[0]/100*255]},i.gray.hsl=function(o){return[0,0,o[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(o){return[0,100,o[0]]},i.gray.cmyk=function(o){return[0,0,0,o[0]]},i.gray.lab=function(o){return[o[0],0,0]},i.gray.hex=function(o){let a=Math.round(o[0]/100*255)&255,l=((a<<16)+(a<<8)+a).toString(16).toUpperCase();return"000000".substring(l.length)+l},i.rgb.gray=function(o){return[(o[0]+o[1]+o[2])/3/255*100]}}),Zf=ft((e,t)=>{Ie();var n=js();function r(){let a={},l=Object.keys(n);for(let f=l.length,u=0;u<f;u++)a[l[u]]={distance:-1,parent:null};return a}function i(a){let l=r(),f=[a];for(l[a].distance=0;f.length;){let u=f.pop(),c=Object.keys(n[u]);for(let d=c.length,h=0;h<d;h++){let b=c[h],g=l[b];g.distance===-1&&(g.distance=l[u].distance+1,g.parent=u,f.unshift(b))}}return l}function s(a,l){return function(f){return l(a(f))}}function o(a,l){let f=[l[a].parent,a],u=n[l[a].parent][a],c=l[a].parent;for(;l[c].parent;)f.unshift(l[c].parent),u=s(n[l[c].parent][c],u),c=l[c].parent;return u.conversion=f,u}t.exports=function(a){let l=i(a),f={},u=Object.keys(l);for(let c=u.length,d=0;d<c;d++){let h=u[d];l[h].parent!==null&&(f[h]=o(h,l))}return f}}),eu=ft((e,t)=>{Ie();var n=js(),r=Zf(),i={},s=Object.keys(n);function o(l){let f=function(...u){let c=u[0];return c==null?c:(c.length>1&&(u=c),l(u))};return"conversion"in l&&(f.conversion=l.conversion),f}function a(l){let f=function(...u){let c=u[0];if(c==null)return c;c.length>1&&(u=c);let d=l(u);if(typeof d=="object")for(let h=d.length,b=0;b<h;b++)d[b]=Math.round(d[b]);return d};return"conversion"in l&&(f.conversion=l.conversion),f}s.forEach(l=>{i[l]={},Object.defineProperty(i[l],"channels",{value:n[l].channels}),Object.defineProperty(i[l],"labels",{value:n[l].labels});let f=r(l);Object.keys(f).forEach(u=>{let c=f[u];i[l][u]=a(c),i[l][u].raw=o(c)})}),t.exports=i}),tu=ft((e,t)=>{"use strict";Ie();var n=(c,d)=>(...h)=>`\x1B[${c(...h)+d}m`,r=(c,d)=>(...h)=>{let b=c(...h);return`\x1B[${38+d};5;${b}m`},i=(c,d)=>(...h)=>{let b=c(...h);return`\x1B[${38+d};2;${b[0]};${b[1]};${b[2]}m`},s=c=>c,o=(c,d,h)=>[c,d,h],a=(c,d,h)=>{Object.defineProperty(c,d,{get:()=>{let b=h();return Object.defineProperty(c,d,{value:b,enumerable:!0,configurable:!0}),b},enumerable:!0,configurable:!0})},l,f=(c,d,h,b)=>{l===void 0&&(l=eu());let g=b?10:0,m={};for(let[O,E]of Object.entries(l)){let $=O==="ansi16"?"ansi":O;O===d?m[$]=c(h,g):typeof E=="object"&&(m[$]=c(E[d],g))}return m};function u(){let c=new Map,d={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};d.color.gray=d.color.blackBright,d.bgColor.bgGray=d.bgColor.bgBlackBright,d.color.grey=d.color.blackBright,d.bgColor.bgGrey=d.bgColor.bgBlackBright;for(let[h,b]of Object.entries(d)){for(let[g,m]of Object.entries(b))d[g]={open:`\x1B[${m[0]}m`,close:`\x1B[${m[1]}m`},b[g]=d[g],c.set(m[0],m[1]);Object.defineProperty(d,h,{value:b,enumerable:!1})}return Object.defineProperty(d,"codes",{value:c,enumerable:!1}),d.color.close="\x1B[39m",d.bgColor.close="\x1B[49m",a(d.color,"ansi",()=>f(n,"ansi16",s,!1)),a(d.color,"ansi256",()=>f(r,"ansi256",s,!1)),a(d.color,"ansi16m",()=>f(i,"rgb",o,!1)),a(d.bgColor,"ansi",()=>f(n,"ansi16",s,!0)),a(d.bgColor,"ansi256",()=>f(r,"ansi256",s,!0)),a(d.bgColor,"ansi16m",()=>f(i,"rgb",o,!0)),d}Object.defineProperty(t,"exports",{enumerable:!0,get:u})}),nu=ft((e,t)=>{"use strict";Ie(),t.exports=(n,r=process.argv)=>{let i=n.startsWith("-")?"":n.length===1?"-":"--",s=r.indexOf(i+n),o=r.indexOf("--");return s!==-1&&(o===-1||s<o)}}),ru=ft((e,t)=>{"use strict";Ie();var n=_s("os"),r=_s("tty"),i=nu(),{env:s}=process,o;i("no-color")||i("no-colors")||i("color=false")||i("color=never")?o=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(o=1),"FORCE_COLOR"in s&&(s.FORCE_COLOR==="true"?o=1:s.FORCE_COLOR==="false"?o=0:o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3));function a(u){return u===0?!1:{level:u,hasBasic:!0,has256:u>=2,has16m:u>=3}}function l(u,c){if(o===0)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(u&&!c&&o===void 0)return 0;let d=o||0;if(s.TERM==="dumb")return d;if(process.platform==="win32"){let h=n.release().split(".");return Number(h[0])>=10&&Number(h[2])>=10586?Number(h[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(h=>h in s)||s.CI_NAME==="codeship"?1:d;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if(s.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in s){let h=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return h>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:d}function f(u){let c=l(u,u&&u.isTTY);return a(c)}t.exports={supportsColor:f,stdout:a(l(!0,r.isatty(1))),stderr:a(l(!0,r.isatty(2)))}}),iu=ft((e,t)=>{"use strict";Ie();var n=(i,s,o)=>{let a=i.indexOf(s);if(a===-1)return i;let l=s.length,f=0,u="";do u+=i.substr(f,a-f)+s+o,f=a+l,a=i.indexOf(s,f);while(a!==-1);return u+=i.substr(f),u},r=(i,s,o,a)=>{let l=0,f="";do{let u=i[a-1]==="\r";f+=i.substr(l,(u?a-1:a)-l)+s+(u?`\r
|
70
|
+
`:`
|
71
|
+
`)+o,l=a+1,a=i.indexOf(`
|
72
|
+
`,l)}while(a!==-1);return f+=i.substr(l),f};t.exports={stringReplaceAll:n,stringEncaseCRLFWithFirstIndex:r}}),ou=ft((e,t)=>{"use strict";Ie();var n=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,i=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,s=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,o=new Map([["n",`
|
73
|
+
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function a(c){let d=c[0]==="u",h=c[1]==="{";return d&&!h&&c.length===5||c[0]==="x"&&c.length===3?String.fromCharCode(parseInt(c.slice(1),16)):d&&h?String.fromCodePoint(parseInt(c.slice(2,-1),16)):o.get(c)||c}function l(c,d){let h=[],b=d.trim().split(/\s*,\s*/g),g;for(let m of b){let O=Number(m);if(!Number.isNaN(O))h.push(O);else if(g=m.match(i))h.push(g[2].replace(s,(E,$,z)=>$?a($):z));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${c}')`)}return h}function f(c){r.lastIndex=0;let d=[],h;for(;(h=r.exec(c))!==null;){let b=h[1];if(h[2]){let g=l(b,h[2]);d.push([b].concat(g))}else d.push([b])}return d}function u(c,d){let h={};for(let g of d)for(let m of g.styles)h[m[0]]=g.inverse?null:m.slice(1);let b=c;for(let[g,m]of Object.entries(h))if(Array.isArray(m)){if(!(g in b))throw new Error(`Unknown Chalk style: ${g}`);b=m.length>0?b[g](...m):b[g]}return b}t.exports=(c,d)=>{let h=[],b=[],g=[];if(d.replace(n,(m,O,E,$,z,J)=>{if(O)g.push(a(O));else if($){let q=g.join("");g=[],b.push(h.length===0?q:u(c,h)(q)),h.push({inverse:E,styles:f($)})}else if(z){if(h.length===0)throw new Error("Found extraneous } in Chalk template literal");b.push(u(c,h)(g.join(""))),g=[],h.pop()}else g.push(J)}),b.push(g.join("")),h.length>0){let m=`Chalk template literal is missing ${h.length} closing bracket${h.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return b.join("")}}),Ei=ft((e,t)=>{"use strict";Ie();var n=tu(),{stdout:r,stderr:i}=ru(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=iu(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],f=Object.create(null),u=(q,k={})=>{if(k.level&&!(Number.isInteger(k.level)&&k.level>=0&&k.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let Q=r?r.level:0;q.level=k.level===void 0?Q:k.level},c=class{constructor(q){return d(q)}},d=q=>{let k={};return u(k,q),k.template=(...Q)=>z(k.template,...Q),Object.setPrototypeOf(k,h.prototype),Object.setPrototypeOf(k.template,k),k.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},k.template.Instance=c,k.template};function h(q){return d(q)}for(let[q,k]of Object.entries(n))f[q]={get(){let Q=O(this,m(k.open,k.close,this._styler),this._isEmpty);return Object.defineProperty(this,q,{value:Q}),Q}};f.visible={get(){let q=O(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:q}),q}};var b=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let q of b)f[q]={get(){let{level:k}=this;return function(...Q){let te=m(n.color[l[k]][q](...Q),n.color.close,this._styler);return O(this,te,this._isEmpty)}}};for(let q of b){let k="bg"+q[0].toUpperCase()+q.slice(1);f[k]={get(){let{level:Q}=this;return function(...te){let Y=m(n.bgColor[l[Q]][q](...te),n.bgColor.close,this._styler);return O(this,Y,this._isEmpty)}}}}var g=Object.defineProperties(()=>{},Vf(zf({},f),{level:{enumerable:!0,get(){return this._generator.level},set(q){this._generator.level=q}}})),m=(q,k,Q)=>{let te,Y;return Q===void 0?(te=q,Y=k):(te=Q.openAll+q,Y=k+Q.closeAll),{open:q,close:k,openAll:te,closeAll:Y,parent:Q}},O=(q,k,Q)=>{let te=(...Y)=>a(Y[0])&&a(Y[0].raw)?E(te,z(te,...Y)):E(te,Y.length===1?""+Y[0]:Y.join(" "));return Object.setPrototypeOf(te,g),te._generator=q,te._styler=k,te._isEmpty=Q,te},E=(q,k)=>{if(q.level<=0||!k)return q._isEmpty?"":k;let Q=q._styler;if(Q===void 0)return k;let{openAll:te,closeAll:Y}=Q;if(k.indexOf("\x1B")!==-1)for(;Q!==void 0;)k=s(k,Q.close,Q.open),Q=Q.parent;let P=k.indexOf(`
|
74
|
+
`);return P!==-1&&(k=o(k,Y,te,P)),te+k+Y},$,z=(q,...k)=>{let[Q]=k;if(!a(Q)||!a(Q.raw))return k.join(" ");let te=k.slice(1),Y=[Q.raw[0]];for(let P=1;P<Q.length;P++)Y.push(String(te[P-1]).replace(/[{}\\]/g,"\\$&"),String(Q.raw[P]));return $===void 0&&($=ou()),$(q,Y.join(""))};Object.defineProperties(h.prototype,f);var J=h();J.supportsColor=r,J.stderr=h({level:i?i.level:0}),J.stderr.supportsColor=i,t.exports=J});var Br=require("fs"),Hr=require("fs/promises"),Qn=require("path");y();function Gs(e){return typeof e=="undefined"||e===null}function su(e){return typeof e=="object"&&e!==null}function au(e){return Array.isArray(e)?e:Gs(e)?[]:[e]}function lu(e,t){var n,r,i,s;if(t)for(s=Object.keys(t),n=0,r=s.length;n<r;n+=1)i=s[n],e[i]=t[i];return e}function cu(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function fu(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var uu=Gs,du=su,pu=au,hu=cu,mu=fu,gu=lu,Se={isNothing:uu,isObject:du,toArray:pu,repeat:hu,isNegativeZero:mu,extend:gu};function qs(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
|
65
75
|
|
66
|
-
`+e.mark.snippet),
|
67
|
-
`+a;for(
|
68
|
-
`,a+=
|
69
|
-
`,l=1;l<=t.linesAfter&&!(
|
70
|
-
`;return a.replace(/\n$/,"")}var
|
71
|
-
\r`;function
|
72
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function
|
73
|
-
`,t-1))}function
|
74
|
-
`,
|
75
|
-
`);break}for(
|
76
|
-
`,
|
77
|
-
`,l+1)):l===0?
|
78
|
-
`,l):e.result+=
|
79
|
-
`,
|
80
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new
|
81
|
-
`,
|
82
|
-
`&&(
|
83
|
-
`+
|
84
|
-
`,r
|
76
|
+
`+e.mark.snippet),r+" "+n):r}function Bn(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=qs(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Bn.prototype=Object.create(Error.prototype);Bn.prototype.constructor=Bn;Bn.prototype.toString=function(t){return this.name+": "+qs(this,t)};var ke=Bn;function _i(e,t,n,r,i){var s="",o="",a=Math.floor(i/2)-1;return r-t>a&&(s=" ... ",t=r-a+s.length),n-r>a&&(o=" ...",n=r+a-o.length),{str:s+e.slice(t,n).replace(/\t/g,"\u2192")+o,pos:r-t+s.length}}function Si(e,t){return Se.repeat(" ",t-e.length)+e}function yu(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],s,o=-1;s=n.exec(e.buffer);)i.push(s.index),r.push(s.index+s[0].length),e.position<=s.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var a="",l,f,u=Math.min(e.line+t.linesAfter,i.length).toString().length,c=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)f=_i(e.buffer,r[o-l],i[o-l],e.position-(r[o]-r[o-l]),c),a=Se.repeat(" ",t.indent)+Si((e.line-l+1).toString(),u)+" | "+f.str+`
|
77
|
+
`+a;for(f=_i(e.buffer,r[o],i[o],e.position,c),a+=Se.repeat(" ",t.indent)+Si((e.line+1).toString(),u)+" | "+f.str+`
|
78
|
+
`,a+=Se.repeat("-",t.indent+u+3+f.pos)+`^
|
79
|
+
`,l=1;l<=t.linesAfter&&!(o+l>=i.length);l++)f=_i(e.buffer,r[o+l],i[o+l],e.position-(r[o]-r[o+l]),c),a+=Se.repeat(" ",t.indent)+Si((e.line+l+1).toString(),u)+" | "+f.str+`
|
80
|
+
`;return a.replace(/\n$/,"")}var bu=yu,wu=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Au=["scalar","sequence","mapping"];function xu(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Cu(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(wu.indexOf(n)===-1)throw new ke('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=xu(t.styleAliases||null),Au.indexOf(this.kind)===-1)throw new ke('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Fe=Cu;function Ps(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(s,o){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=o)}),n[i]=r}),n}function vu(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function Pi(e){return this.extend(e)}Pi.prototype.extend=function(t){var n=[],r=[];if(t instanceof Fe)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new ke("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof Fe))throw new ke("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new ke("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new ke("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(s){if(!(s instanceof Fe))throw new ke("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Pi.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Ps(i,"implicit"),i.compiledExplicit=Ps(i,"explicit"),i.compiledTypeMap=vu(i.compiledImplicit,i.compiledExplicit),i};var Ou=Pi,Eu=new Fe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),_u=new Fe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Su=new Fe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),ju=new Ou({explicit:[Eu,_u,Su]});function Pu(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Iu(){return null}function Mu(e){return e===null}var Fu=new Fe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Pu,construct:Iu,predicate:Mu,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Tu(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Lu(e){return e==="true"||e==="True"||e==="TRUE"}function Du(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Nu=new Fe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Tu,construct:Lu,predicate:Du,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function ku(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Ru(e){return 48<=e&&e<=55}function Uu(e){return 48<=e&&e<=57}function $u(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!ku(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Ru(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!Uu(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function Wu(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function Bu(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Se.isNegativeZero(e)}var Hu=new Fe("tag:yaml.org,2002:int",{kind:"scalar",resolve:$u,construct:Wu,predicate:Bu,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Gu=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function qu(e){return!(e===null||!Gu.test(e)||e[e.length-1]==="_")}function Yu(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var zu=/^[-+]?[0-9]+e/;function Vu(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Se.isNegativeZero(e))return"-0.0";return n=e.toString(10),zu.test(n)?n.replace("e",".e"):n}function Ku(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Se.isNegativeZero(e))}var Qu=new Fe("tag:yaml.org,2002:float",{kind:"scalar",resolve:qu,construct:Yu,predicate:Ku,represent:Vu,defaultStyle:"lowercase"}),Ju=ju.extend({implicit:[Fu,Nu,Hu,Qu]}),Xu=Ju,Ys=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),zs=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Zu(e){return e===null?!1:Ys.exec(e)!==null||zs.exec(e)!==null}function ed(e){var t,n,r,i,s,o,a,l=0,f=null,u,c,d;if(t=Ys.exec(e),t===null&&(t=zs.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(s=+t[4],o=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],c=+(t[11]||0),f=(u*60+c)*6e4,t[9]==="-"&&(f=-f)),d=new Date(Date.UTC(n,r,i,s,o,a,l)),f&&d.setTime(d.getTime()-f),d}function td(e){return e.toISOString()}var nd=new Fe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Zu,construct:ed,instanceOf:Date,represent:td});function rd(e){return e==="<<"||e===null}var id=new Fe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:rd}),Li=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
81
|
+
\r`;function od(e){if(e===null)return!1;var t,n,r=0,i=e.length,s=Li;for(n=0;n<i;n++)if(t=s.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function sd(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,s=Li,o=0,a=[];for(t=0;t<i;t++)t%4===0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(r.charAt(t));return n=i%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function ad(e){var t="",n=0,r,i,s=e.length,o=Li;for(r=0;r<s;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=s%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function ld(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var cd=new Fe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:od,construct:sd,predicate:ld,represent:ad}),fd=Object.prototype.hasOwnProperty,ud=Object.prototype.toString;function dd(e){if(e===null)return!0;var t=[],n,r,i,s,o,a=e;for(n=0,r=a.length;n<r;n+=1){if(i=a[n],o=!1,ud.call(i)!=="[object Object]")return!1;for(s in i)if(fd.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function pd(e){return e!==null?e:[]}var hd=new Fe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:dd,construct:pd}),md=Object.prototype.toString;function gd(e){if(e===null)return!0;var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],md.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[t]=[i[0],r[i[0]]]}return!0}function yd(e){if(e===null)return[];var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),s[t]=[i[0],r[i[0]]];return s}var bd=new Fe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:gd,construct:yd}),wd=Object.prototype.hasOwnProperty;function Ad(e){if(e===null)return!0;var t,n=e;for(t in n)if(wd.call(n,t)&&n[t]!==null)return!1;return!0}function xd(e){return e!==null?e:{}}var Cd=new Fe("tag:yaml.org,2002:set",{kind:"mapping",resolve:Ad,construct:xd}),Vs=Xu.extend({implicit:[nd,id],explicit:[cd,hd,bd,Cd]}),St=Object.prototype.hasOwnProperty,Er=1,Ks=2,Qs=3,_r=4,ji=1,vd=2,Is=3,Od=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ed=/[\x85\u2028\u2029]/,_d=/[,\[\]\{\}]/,Js=/^(?:!|!!|![a-z\-]+!)$/i,Xs=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Ms(e){return Object.prototype.toString.call(e)}function ut(e){return e===10||e===13}function on(e){return e===9||e===32}function Re(e){return e===9||e===32||e===10||e===13}function wn(e){return e===44||e===91||e===93||e===123||e===125}function Sd(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function jd(e){return e===120?2:e===117?4:e===85?8:0}function Pd(e){return 48<=e&&e<=57?e-48:-1}function Fs(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
82
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Id(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Zs=new Array(256),ea=new Array(256);for(rn=0;rn<256;rn++)Zs[rn]=Fs(rn)?1:0,ea[rn]=Fs(rn);var rn;function Md(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Vs,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function ta(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=bu(n),new ke(t,n)}function U(e,t){throw ta(e,t)}function Sr(e,t){e.onWarning&&e.onWarning.call(null,ta(e,t))}var Ts={YAML:function(t,n,r){var i,s,o;t.version!==null&&U(t,"duplication of %YAML directive"),r.length!==1&&U(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&U(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&U(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Sr(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,s;r.length!==2&&U(t,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],Js.test(i)||U(t,"ill-formed tag handle (first argument) of the TAG directive"),St.call(t.tagMap,i)&&U(t,'there is a previously declared suffix for "'+i+'" tag handle'),Xs.test(s)||U(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){U(t,"tag prefix is malformed: "+s)}t.tagMap[i]=s}};function _t(e,t,n,r){var i,s,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,s=a.length;i<s;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||U(e,"expected valid JSON character");else Od.test(a)&&U(e,"the stream contains non-printable characters");e.result+=a}}function Ls(e,t,n,r){var i,s,o,a;for(Se.isObject(n)||U(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)s=i[o],St.call(t,s)||(t[s]=n[s],r[s]=!0)}function An(e,t,n,r,i,s,o,a,l){var f,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),f=0,u=i.length;f<u;f+=1)Array.isArray(i[f])&&U(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Ms(i[f])==="[object Object]"&&(i[f]="[object Object]");if(typeof i=="object"&&Ms(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(f=0,u=s.length;f<u;f+=1)Ls(e,t,s[f],n);else Ls(e,t,s,n);else!e.json&&!St.call(n,i)&&St.call(t,i)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,U(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[i]=s,delete n[i];return t}function Di(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):U(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function we(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;on(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(ut(i))for(Di(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Sr(e,"deficient indentation"),r}function Ir(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Re(n)))}function Ni(e,t){t===1?e.result+=" ":t>1&&(e.result+=Se.repeat(`
|
83
|
+
`,t-1))}function Fd(e,t,n){var r,i,s,o,a,l,f,u,c=e.kind,d=e.result,h;if(h=e.input.charCodeAt(e.position),Re(h)||wn(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(i=e.input.charCodeAt(e.position+1),Re(i)||n&&wn(i)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,a=!1;h!==0;){if(h===58){if(i=e.input.charCodeAt(e.position+1),Re(i)||n&&wn(i))break}else if(h===35){if(r=e.input.charCodeAt(e.position-1),Re(r))break}else{if(e.position===e.lineStart&&Ir(e)||n&&wn(h))break;if(ut(h))if(l=e.line,f=e.lineStart,u=e.lineIndent,we(e,!1,-1),e.lineIndent>=t){a=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=f,e.lineIndent=u;break}}a&&(_t(e,s,o,!1),Ni(e,e.line-l),s=o=e.position,a=!1),on(h)||(o=e.position+1),h=e.input.charCodeAt(++e.position)}return _t(e,s,o,!1),e.result?!0:(e.kind=c,e.result=d,!1)}function Td(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(_t(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else ut(n)?(_t(e,r,i,!0),Ni(e,we(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Ir(e)?U(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);U(e,"unexpected end of the stream within a single quoted scalar")}function Ld(e,t){var n,r,i,s,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return _t(e,n,e.position,!0),e.position++,!0;if(a===92){if(_t(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),ut(a))we(e,!1,t);else if(a<256&&Zs[a])e.result+=ea[a],e.position++;else if((o=jd(a))>0){for(i=o,s=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=Sd(a))>=0?s=(s<<4)+o:U(e,"expected hexadecimal character");e.result+=Id(s),e.position++}else U(e,"unknown escape sequence");n=r=e.position}else ut(a)?(_t(e,n,r,!0),Ni(e,we(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Ir(e)?U(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}U(e,"unexpected end of the stream within a double quoted scalar")}function Dd(e,t){var n=!0,r,i,s,o=e.tag,a,l=e.anchor,f,u,c,d,h,b=Object.create(null),g,m,O,E;if(E=e.input.charCodeAt(e.position),E===91)u=93,h=!1,a=[];else if(E===123)u=125,h=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),E=e.input.charCodeAt(++e.position);E!==0;){if(we(e,!0,t),E=e.input.charCodeAt(e.position),E===u)return e.position++,e.tag=o,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=a,!0;n?E===44&&U(e,"expected the node content, but found ','"):U(e,"missed comma between flow collection entries"),m=g=O=null,c=d=!1,E===63&&(f=e.input.charCodeAt(e.position+1),Re(f)&&(c=d=!0,e.position++,we(e,!0,t))),r=e.line,i=e.lineStart,s=e.position,xn(e,t,Er,!1,!0),m=e.tag,g=e.result,we(e,!0,t),E=e.input.charCodeAt(e.position),(d||e.line===r)&&E===58&&(c=!0,E=e.input.charCodeAt(++e.position),we(e,!0,t),xn(e,t,Er,!1,!0),O=e.result),h?An(e,a,b,m,g,O,r,i,s):c?a.push(An(e,null,b,m,g,O,r,i,s)):a.push(g),we(e,!0,t),E=e.input.charCodeAt(e.position),E===44?(n=!0,E=e.input.charCodeAt(++e.position)):n=!1}U(e,"unexpected end of the stream within a flow collection")}function Nd(e,t){var n,r,i=ji,s=!1,o=!1,a=t,l=0,f=!1,u,c;if(c=e.input.charCodeAt(e.position),c===124)r=!1;else if(c===62)r=!0;else return!1;for(e.kind="scalar",e.result="";c!==0;)if(c=e.input.charCodeAt(++e.position),c===43||c===45)ji===i?i=c===43?Is:vd:U(e,"repeat of a chomping mode identifier");else if((u=Pd(c))>=0)u===0?U(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?U(e,"repeat of an indentation width identifier"):(a=t+u-1,o=!0);else break;if(on(c)){do c=e.input.charCodeAt(++e.position);while(on(c));if(c===35)do c=e.input.charCodeAt(++e.position);while(!ut(c)&&c!==0)}for(;c!==0;){for(Di(e),e.lineIndent=0,c=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&c===32;)e.lineIndent++,c=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),ut(c)){l++;continue}if(e.lineIndent<a){i===Is?e.result+=Se.repeat(`
|
84
|
+
`,s?1+l:l):i===ji&&s&&(e.result+=`
|
85
|
+
`);break}for(r?on(c)?(f=!0,e.result+=Se.repeat(`
|
86
|
+
`,s?1+l:l)):f?(f=!1,e.result+=Se.repeat(`
|
87
|
+
`,l+1)):l===0?s&&(e.result+=" "):e.result+=Se.repeat(`
|
88
|
+
`,l):e.result+=Se.repeat(`
|
89
|
+
`,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!ut(c)&&c!==0;)c=e.input.charCodeAt(++e.position);_t(e,n,e.position,!1)}return!0}function Ds(e,t){var n,r=e.tag,i=e.anchor,s=[],o,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,U(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!Re(o))));){if(a=!0,e.position++,we(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,xn(e,t,Qs,!1,!0),s.push(e.result),we(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)U(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=s,!0):!1}function kd(e,t,n){var r,i,s,o,a,l,f=e.tag,u=e.anchor,c={},d=Object.create(null),h=null,b=null,g=null,m=!1,O=!1,E;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),E=e.input.charCodeAt(e.position);E!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,U(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),s=e.line,(E===63||E===58)&&Re(r))E===63?(m&&(An(e,c,d,h,b,null,o,a,l),h=b=g=null),O=!0,m=!0,i=!0):m?(m=!1,i=!0):U(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,E=r;else{if(o=e.line,a=e.lineStart,l=e.position,!xn(e,n,Ks,!1,!0))break;if(e.line===s){for(E=e.input.charCodeAt(e.position);on(E);)E=e.input.charCodeAt(++e.position);if(E===58)E=e.input.charCodeAt(++e.position),Re(E)||U(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(An(e,c,d,h,b,null,o,a,l),h=b=g=null),O=!0,m=!1,i=!1,h=e.tag,b=e.result;else if(O)U(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=u,!0}else if(O)U(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=u,!0}if((e.line===s||e.lineIndent>t)&&(m&&(o=e.line,a=e.lineStart,l=e.position),xn(e,t,_r,!0,i)&&(m?b=e.result:g=e.result),m||(An(e,c,d,h,b,g,o,a,l),h=b=g=null),we(e,!0,-1),E=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&E!==0)U(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&An(e,c,d,h,b,null,o,a,l),O&&(e.tag=f,e.anchor=u,e.kind="mapping",e.result=c),O}function Rd(e){var t,n=!1,r=!1,i,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&U(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):U(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Re(o);)o===33&&(r?U(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),Js.test(i)||U(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),_d.test(s)&&U(e,"tag suffix cannot contain flow indicator characters")}s&&!Xs.test(s)&&U(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){U(e,"tag name is malformed: "+s)}return n?e.tag=s:St.call(e.tagMap,i)?e.tag=e.tagMap[i]+s:i==="!"?e.tag="!"+s:i==="!!"?e.tag="tag:yaml.org,2002:"+s:U(e,'undeclared tag handle "'+i+'"'),!0}function Ud(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&U(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Re(n)&&!wn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&U(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function $d(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Re(r)&&!wn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&U(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),St.call(e.anchorMap,n)||U(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],we(e,!0,-1),!0}function xn(e,t,n,r,i){var s,o,a,l=1,f=!1,u=!1,c,d,h,b,g,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=a=_r===n||Qs===n,r&&we(e,!0,-1)&&(f=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Rd(e)||Ud(e);)we(e,!0,-1)?(f=!0,a=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=f||i),(l===1||_r===n)&&(Er===n||Ks===n?g=t:g=t+1,m=e.position-e.lineStart,l===1?a&&(Ds(e,m)||kd(e,m,g))||Dd(e,g)?u=!0:(o&&Nd(e,g)||Td(e,g)||Ld(e,g)?u=!0:$d(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&U(e,"alias node should not have any properties")):Fd(e,g,Er===n)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=a&&Ds(e,m))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&U(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,d=e.implicitTypes.length;c<d;c+=1)if(b=e.implicitTypes[c],b.resolve(e.result)){e.result=b.construct(e.result),e.tag=b.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(St.call(e.typeMap[e.kind||"fallback"],e.tag))b=e.typeMap[e.kind||"fallback"][e.tag];else for(b=null,h=e.typeMap.multi[e.kind||"fallback"],c=0,d=h.length;c<d;c+=1)if(e.tag.slice(0,h[c].tag.length)===h[c].tag){b=h[c];break}b||U(e,"unknown tag !<"+e.tag+">"),e.result!==null&&b.kind!==e.kind&&U(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result,e.tag)?(e.result=b.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):U(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function Wd(e){var t=e.position,n,r,i,s=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(we(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(s=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!Re(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&U(e,"directive name must not be less than one character in length");o!==0;){for(;on(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!ut(o));break}if(ut(o))break;for(n=e.position;o!==0&&!Re(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Di(e),St.call(Ts,r)?Ts[r](e,r,i):Sr(e,'unknown document directive "'+r+'"')}if(we(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,we(e,!0,-1)):s&&U(e,"directives end mark is expected"),xn(e,e.lineIndent-1,_r,!1,!0),we(e,!0,-1),e.checkLineBreaks&&Ed.test(e.input.slice(t,e.position))&&Sr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ir(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,we(e,!0,-1));return}if(e.position<e.length-1)U(e,"end of the stream or a document separator is expected");else return}function na(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
90
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Md(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,U(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Wd(n);return n.documents}function Bd(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var r=na(e,n);if(typeof t!="function")return r;for(var i=0,s=r.length;i<s;i+=1)t(r[i])}function Hd(e,t){var n=na(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new ke("expected a single document in the stream, but found more")}}var Gd=Bd,qd=Hd,ra={loadAll:Gd,load:qd},ia=Object.prototype.toString,oa=Object.prototype.hasOwnProperty,ki=65279,Yd=9,Hn=10,zd=13,Vd=32,Kd=33,Qd=34,Ii=35,Jd=37,Xd=38,Zd=39,ep=42,sa=44,tp=45,jr=58,np=61,rp=62,ip=63,op=64,aa=91,la=93,sp=96,ca=123,ap=124,fa=125,Te={};Te[0]="\\0";Te[7]="\\a";Te[8]="\\b";Te[9]="\\t";Te[10]="\\n";Te[11]="\\v";Te[12]="\\f";Te[13]="\\r";Te[27]="\\e";Te[34]='\\"';Te[92]="\\\\";Te[133]="\\N";Te[160]="\\_";Te[8232]="\\L";Te[8233]="\\P";var lp=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],cp=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function fp(e,t){var n,r,i,s,o,a,l;if(t===null)return{};for(n={},r=Object.keys(t),i=0,s=r.length;i<s;i+=1)o=r[i],a=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=e.compiledTypeMap.fallback[o],l&&oa.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function up(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new ke("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Se.repeat("0",r-t.length)+t}var dp=1,Gn=2;function pp(e){this.schema=e.schema||Vs,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Se.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=fp(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Gn:dp,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ns(e,t){for(var n=Se.repeat(" ",t),r=0,i=-1,s="",o,a=e.length;r<a;)i=e.indexOf(`
|
91
|
+
`,r),i===-1?(o=e.slice(r),r=a):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
|
92
|
+
`&&(s+=n),s+=o;return s}function Mi(e,t){return`
|
93
|
+
`+Se.repeat(" ",e.indent*t)}function hp(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Pr(e){return e===Vd||e===Yd}function qn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ki||65536<=e&&e<=1114111}function ks(e){return qn(e)&&e!==ki&&e!==zd&&e!==Hn}function Rs(e,t,n){var r=ks(e),i=r&&!Pr(e);return(n?r:r&&e!==sa&&e!==aa&&e!==la&&e!==ca&&e!==fa)&&e!==Ii&&!(t===jr&&!i)||ks(t)&&!Pr(t)&&e===Ii||t===jr&&i}function mp(e){return qn(e)&&e!==ki&&!Pr(e)&&e!==tp&&e!==ip&&e!==jr&&e!==sa&&e!==aa&&e!==la&&e!==ca&&e!==fa&&e!==Ii&&e!==Xd&&e!==ep&&e!==Kd&&e!==ap&&e!==np&&e!==rp&&e!==Zd&&e!==Qd&&e!==Jd&&e!==op&&e!==sp}function gp(e){return!Pr(e)&&e!==jr}function Wn(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function ua(e){var t=/^\n* /;return t.test(e)}var da=1,Fi=2,pa=3,ha=4,bn=5;function yp(e,t,n,r,i,s,o,a){var l,f=0,u=null,c=!1,d=!1,h=r!==-1,b=-1,g=mp(Wn(e,0))&&gp(Wn(e,e.length-1));if(t||o)for(l=0;l<e.length;f>=65536?l+=2:l++){if(f=Wn(e,l),!qn(f))return bn;g=g&&Rs(f,u,a),u=f}else{for(l=0;l<e.length;f>=65536?l+=2:l++){if(f=Wn(e,l),f===Hn)c=!0,h&&(d=d||l-b-1>r&&e[b+1]!==" ",b=l);else if(!qn(f))return bn;g=g&&Rs(f,u,a),u=f}d=d||h&&l-b-1>r&&e[b+1]!==" "}return!c&&!d?g&&!o&&!i(e)?da:s===Gn?bn:Fi:n>9&&ua(e)?bn:o?s===Gn?bn:Fi:d?ha:pa}function bp(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Gn?'""':"''";if(!e.noCompatMode&&(lp.indexOf(t)!==-1||cp.test(t)))return e.quotingType===Gn?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),a=r||e.flowLevel>-1&&n>=e.flowLevel;function l(f){return hp(e,f)}switch(yp(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!r,i)){case da:return t;case Fi:return"'"+t.replace(/'/g,"''")+"'";case pa:return"|"+Us(t,e.indent)+$s(Ns(t,s));case ha:return">"+Us(t,e.indent)+$s(Ns(wp(t,o),s));case bn:return'"'+Ap(t)+'"';default:throw new ke("impossible error: invalid scalar style")}}()}function Us(e,t){var n=ua(e)?String(t):"",r=e[e.length-1]===`
|
94
|
+
`,i=r&&(e[e.length-2]===`
|
85
95
|
`||e===`
|
86
|
-
`),
|
87
|
-
`}function
|
88
|
-
`?e.slice(0,-1):e}function
|
89
|
-
`);return
|
90
|
-
`||e[0]===" ",o
|
91
|
-
`:"")+
|
92
|
-
`+e.slice(
|
93
|
-
`,e.length-
|
94
|
-
`+e.slice(
|
95
|
-
`:""}var
|
96
|
-
${
|
97
|
-
|
98
|
-
${r}${o?" "+o:""} (${n} ${i})`);this.errorMessage=t;this.fetchMethod=n;this.fetchUri=i;this.statusCode=r;this.statusText=o;Object.setPrototypeOf(this,Zt.prototype)}};var Je=class{constructor(t){Mr(this,"options");var n,i,r,o,s,a;if(!t.apiKey&&!t.bearerToken)throw new Error("You must provide an API key or a bearer token");this.options={...t,fetch:(n=t.fetch)!=null?n:fetch,apiHost:(i=t.apiHost)!=null?i:"https://uniform.app",apiKey:(r=t.apiKey)!=null?r:null,projectId:(o=t.projectId)!=null?o:null,bearerToken:(s=t.bearerToken)!=null?s:null,limitPolicy:(a=t.limitPolicy)!=null?a:ma}}async apiClient(t,n){return this.options.limitPolicy(async()=>{var o;let i=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},r=await fetch(t.toString(),{...n,headers:{...n==null?void 0:n.headers,...i}});if(!r.ok){let s="";try{let a=await r.text();try{let l=JSON.parse(a);l.errorMessage?s=Array.isArray(l.errorMessage)?l.errorMessage.join(", "):l.errorMessage:s=a}catch(l){s=a}}catch(a){s="General error"}throw new Zt(s,(o=n==null?void 0:n.method)!=null?o:"GET",t.toString(),r.status)}return(n==null?void 0:n.expectNoContent)?null:await r.json()})}createUrl(t,n){let i=new URL(`${this.options.apiHost}${t}`);return Object.entries(n!=null?n:{}).forEach(([r,o])=>{var s;typeof o!="undefined"&&o!==null&&i.searchParams.append(r,(s=o==null?void 0:o.toString())!=null?s:"")}),i}};var yn,Tn=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(Tn,yn),{...t,projectId:n});return await this.apiClient(i)}async upsert(t){let n=this.createUrl(ce(Tn,yn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ce(Tn,yn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Me=Tn;yn=new WeakMap,Ve(Me,yn,"/api/v2/aggregate");var ya={command:"get <id>",describe:"Fetch an aggregate",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{let a=await new Me({apiKey:t,apiHost:e,fetch:ga.default,projectId:r}).get({aggregateId:n});a.aggregates.length===0?(console.error("Aggregate did not exist"),process.exit(1)):me(a.aggregates[0],i,o)}};g();var ba=Q(require("isomorphic-unfetch"));var wa={command:"list",describe:"List aggregates",aliases:["ls"],builder:e=>xe(W(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new Me({apiKey:t,apiHost:e,fetch:ba.default,projectId:r}).get({});me(s.aggregates,n,i)}};g();var xa=Q(require("isomorphic-unfetch"));g();var xt=e=>e.id,Ct=e=>`${e.name} (pid: ${e.id})`;g();function Ee(e,t){return da(e,t)}function Ot(e,t){pa(e,t)}g();var Aa=Q(require("p-limit")),_e=(0,Aa.default)(8);g();function vi({client:e,type:t}){async function*n(){let r=(await e.get({type:t})).aggregates;for await(let o of r)yield{id:xt(o),displayName:Ct(o),providerId:o.id,object:o}}let i=[];return{objects:n(),deleteObject:async r=>{await e.remove({aggregateId:r})},writeObject:async r=>{await e.upsert({aggregate:r.object,skipInputs:!0}),i.push(r.object)},complete:async()=>{await Promise.all(i.map(r=>e.upsert({aggregate:r,skipInputs:!1})))}}}var Ca={command:"pull <directory>",describe:"Pulls all aggregates to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the aggregates to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:o,project:s,diff:a})=>{var p;let l=new Me({apiKey:t,apiHost:e,fetch:xa.default,projectId:s,limitPolicy:_e}),u=vi({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.aggregates)!=null?p:[],selectIdentifier:xt,selectDisplayName:Ct,onSyncComplete:async(C,A)=>{y.aggregates=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:xt,selectDisplayName:Ct,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var Oa=Q(require("isomorphic-unfetch"));var va={command:"push <directory>",describe:"Pushes all aggregates from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the aggregates from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,project:o,diff:s})=>{var f;let a=new Me({apiKey:t,apiHost:e,fetch:Oa.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.aggregates)!=null?f:[],selectIdentifier:xt,selectDisplayName:Ct})}else l=await ve({directory:n,selectIdentifier:xt,selectDisplayName:Ct});let d=vi({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})}),await d.complete()}};g();var Ea=Q(require("isomorphic-unfetch"));var _a={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an aggregate",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Me({apiKey:t,apiHost:e,fetch:Ea.default,projectId:i}).remove({aggregateId:n})}};g();var Sa=Q(require("isomorphic-unfetch"));var Pa={command:"update <filename>",aliases:["put"],describe:"Insert or update an aggregate",builder:e=>W(k(e.positional("filename",{demandOption:!0,describe:"Aggregate file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new Me({apiKey:t,apiHost:e,fetch:Sa.default,projectId:i}),o=At(n);await r.upsert({aggregate:o})}};var ja={command:"aggregate <command>",aliases:["agg","intent","audience"],describe:"Commands for Context aggregates (intents, audiences)",builder:e=>e.command(Ca).command(va).command(ya).command(_a).command(wa).command(Pa).demandCommand(),handler:()=>{Ge.help()}};g();g();var Ia=Q(require("isomorphic-unfetch"));g();var bn,Un,Xt=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(Xt,bn),{...t,projectId:n});return await this.apiClient(i)}async upsertCategory(t){let n=this.createUrl(ce(Xt,bn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(t){let n=this.createUrl(ce(Xt,bn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(t){let n=this.createUrl(ce(Xt,Un));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(t){let n=this.createUrl(ce(Xt,Un));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Re=Xt;bn=new WeakMap,Un=new WeakMap,Ve(Re,bn,"/api/v1/enrichments"),Ve(Re,Un,"/api/v1/enrichment-values");var Ma={command:"get <id>",describe:"Fetch an enrichment category and its values",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{var l,u;let a=(u=(l=await new Re({apiKey:t,apiHost:e,fetch:Ia.default,projectId:r}).get())==null?void 0:l.enrichments)==null?void 0:u.filter(d=>d.id===n);a.length===0?(console.error("Enrichment did not exist"),process.exit(1)):me(a[0],i,o)}};g();var Fa=Q(require("isomorphic-unfetch"));var La={command:"list",describe:"List enrichments",aliases:["ls"],builder:e=>xe(W(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new Re({apiKey:t,apiHost:e,fetch:Fa.default,projectId:r}).get();me(s.enrichments,n,i)}};g();var Na=Q(require("isomorphic-unfetch"));g();var vt=e=>e.id,Et=e=>`${e.name} (pid: ${e.id})`;g();function Ei({client:e}){async function*t(){let n=(await e.get()).enrichments;for await(let i of n)yield{id:vt(i),displayName:Et(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.removeCategory({enrichmentId:n})},writeObject:async(n,i)=>{var s,a;await e.upsertCategory({enrichment:n.object});let r=Da({categoryId:n.id,values:n.object.values}),o=Da({categoryId:n.id,values:(a=(s=i==null?void 0:i.object)==null?void 0:s.values)!=null?a:[],client:e});await ge({source:r,target:o,mode:"mirror",whatIf:!1,log:ye({diffMode:"off",prefix:` ${n.displayName} value`,indent:"> "})})}}}var Da=({client:e,categoryId:t,values:n})=>({objects:async function*(){for(let r of n)yield{id:r.id,providerId:r.id,object:r,displayName:`${r.value} (pid: ${r.id})`}}(),deleteObject:async r=>{if(!e)throw new Error("Provider is read only");await e.removeValue({enrichmentId:t,enrichmentValueId:r})},writeObject:async r=>{if(!e)throw new Error("Provider is read only");await e.upsertValue({enrichmentId:t,enrichmentValue:r.object})}});var Ta={command:"pull <directory>",describe:"Pulls all enrichments to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the enrichments to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:o,project:s,diff:a})=>{var p;let l=new Re({apiKey:t,apiHost:e,fetch:Na.default,projectId:s,limitPolicy:_e}),u=Ei({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.enrichments)!=null?p:[],selectIdentifier:vt,selectDisplayName:Et,onSyncComplete:async(C,A)=>{y.enrichments=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:vt,selectDisplayName:Et,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var Ua=Q(require("isomorphic-unfetch"));var Ra={command:"push <directory>",describe:"Pushes all enrichments from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the enrichments from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,project:o,diff:s})=>{var f;let a=new Re({apiKey:t,apiHost:e,fetch:Ua.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.enrichments)!=null?f:[],selectIdentifier:vt,selectDisplayName:Et})}else l=await ve({directory:n,selectIdentifier:vt,selectDisplayName:Et});let d=Ei({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})})}};g();var $a=Q(require("isomorphic-unfetch"));var Wa={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an enrichment category and its values",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Re({apiKey:t,apiHost:e,fetch:$a.default,projectId:i}).removeCategory({enrichmentId:n})}};var ka={command:"enrichment <command>",aliases:["enr"],describe:"Commands for Context enrichments",builder:e=>e.command(Ta).command(Ra).command(Ma).command(Wa).command(La).demandCommand(),handler:()=>{Ge.help()}};g();g();var Rn=Q(require("chalk")),Ha=require("fs"),Ya=Q(require("isomorphic-unfetch")),Pi=require("process");g();var Si,Pr=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(Pr,Si),{...t,projectId:n});return await this.apiClient(i)}},_i=Pr;Si=new WeakMap,Ve(_i,Si,"/api/v2/manifest");var Ga={command:"get [output]",aliases:["dl","download"],describe:"Download the Uniform Context manifest for a project",builder:e=>{var t,n,i;return e.option("apiKey",{alias:"k",demandOption:!0,string:!0,default:(t=process.env.UNIFORM_API_KEY)!=null?t:"",describe:"Uniform API key to use. Defaults to UNIFORM_API_KEY env if set."}).option("project",{describe:"Uniform project ID. Defaults to UCTX_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",demandOption:!0,default:(i=(n=process.env.UCTX_CLI_PROJECT_ID)!=null?n:process.env.UNIFORM_PROJECT_ID)!=null?i:"",type:"string",alias:["p"]}).option("preview",{describe:"If set, fetches the unpublished preview manifest (The API key must have permission)",default:!1,type:"boolean",alias:["d"]}).option("output",{string:!0,alias:"o",default:process.env.UNIFORM_MANIFEST_PATH,describe:"Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set."})},handler:async({apiKey:e,output:t,project:n,preview:i})=>{n||(console.error(Rn.default.red("You must specify the project ID")),(0,Pi.exit)(1));let r=Zd(),o=new _i({apiHost:r,projectId:n,apiKey:e,fetch:Ya.default});try{let s=await o.get({preview:i}),a=JSON.stringify(s,null,2);t?(0,Ha.writeFile)(t,a,l=>{l&&(console.error(`Error writing file to ${t}
|
99
|
-
`,l),(0,Pi.exit)(1)),console.log(Rn.default.green(`\u2705 ${t} has been updated from ${r}`))}):console.log(a)}catch(s){let a;s instanceof Zt?(s.statusCode===403&&(a=`The API key ${e} did not have permissions to fetch the manifest. Ensure ${i?"Context > Read Drafts":"Context > Manifest > Read"} permissions are granted.`),a=s.message):a=s.toString(),console.error(Rn.default.red("\u26A0 Error fetching Context manifest")),console.error(Rn.default.gray(` \u2757 ${a}`)),(0,Pi.exit)(1)}}},Zd=()=>process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app";var Ba={command:"manifest <command>",describe:"Commands for context manifests",aliases:["man"],builder:e=>e.command(Ga).demandCommand(),handler:()=>{Ge.help()}};g();g();var qa=Q(require("isomorphic-unfetch"));g();var wn,$n=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce($n,wn),{...t,projectId:n});return await this.apiClient(i)}async upsert(t){let n=this.createUrl(ce($n,wn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ce($n,wn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Fe=$n;wn=new WeakMap,Ve(Fe,wn,"/api/v2/quirk");var za={command:"get <id>",describe:"Fetch a quirk",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Quirk public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{let a=await new Fe({apiKey:t,apiHost:e,fetch:qa.default,projectId:r}).get({quirkId:n,withIntegrations:!0});a.quirks.length===0?(console.error("Quirk did not exist"),process.exit(1)):me(a.quirks[0],i,o)}};g();var Va=Q(require("isomorphic-unfetch"));var Qa={command:"list",describe:"List quirks",aliases:["ls"],builder:e=>xe(W(k(e.option("withIntegrations",{alias:["i"],describe:"Whether to include meta-quirks created by integrations in the list. Defaults to false.",type:"boolean"})))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r,withIntegrations:o})=>{let a=await new Fe({apiKey:t,apiHost:e,fetch:Va.default,projectId:r}).get({withIntegrations:o});me(a.quirks,n,i)}};g();var Ka=Q(require("isomorphic-unfetch"));g();var _t=e=>e.id,St=e=>`${e.name} (pid: ${e.id})`;g();function ji({client:e}){async function*t(){let n=(await e.get({withIntegrations:!1})).quirks;for await(let i of n)yield{id:_t(i),displayName:St(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.remove({quirkId:n})},writeObject:async n=>{await e.upsert({quirk:n.object})}}}var Ja={command:"pull <directory>",describe:"Pulls all quirks to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the quirks to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:o,project:s,diff:a})=>{var p;let l=new Fe({apiKey:t,apiHost:e,fetch:Ka.default,projectId:s,limitPolicy:_e}),u=ji({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.quirks)!=null?p:[],selectIdentifier:_t,selectDisplayName:St,onSyncComplete:async(C,A)=>{y.quirks=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:_t,selectDisplayName:St,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var Za=Q(require("isomorphic-unfetch"));var Xa={command:"push <directory>",describe:"Pushes all quirks from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the quirks from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,project:o,diff:s})=>{var f;let a=new Fe({apiKey:t,apiHost:e,fetch:Za.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.quirks)!=null?f:[],selectIdentifier:_t,selectDisplayName:St})}else l=await ve({directory:n,selectIdentifier:_t,selectDisplayName:St});let d=ji({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})})}};g();var el=Q(require("isomorphic-unfetch"));var tl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a quirk",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Quirk public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Fe({apiKey:t,apiHost:e,fetch:el.default,projectId:i}).remove({quirkId:n})}};g();var nl=Q(require("isomorphic-unfetch"));var il={command:"update <filename>",aliases:["put"],describe:"Insert or update a quirk",builder:e=>W(k(e.positional("filename",{demandOption:!0,describe:"Quirk file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new Fe({apiKey:t,apiHost:e,fetch:nl.default,projectId:i}),o=At(n);await r.upsert({quirk:o})}};var rl={command:"quirk <command>",aliases:["qk"],describe:"Commands for Context quirks",builder:e=>e.command(Ja).command(Xa).command(za).command(tl).command(Qa).command(il).demandCommand(),handler:()=>{Ge.help()}};g();g();var ol=Q(require("isomorphic-unfetch"));g();var An,Wn=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(Wn,An),{...t,projectId:n});return await this.apiClient(i)}async upsert(t){let n=this.createUrl(ce(Wn,An));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ce(Wn,An));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Le=Wn;An=new WeakMap,Ve(Le,An,"/api/v2/signal");var sl={command:"get <id>",describe:"Fetch a signal",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Signal public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{let a=await new Le({apiKey:t,apiHost:e,fetch:ol.default,projectId:r}).get({signalId:n});a.signals.length===0?(console.error("Signal did not exist"),process.exit(1)):me(a.signals[0],i,o)}};g();var al=Q(require("isomorphic-unfetch"));var ll={command:"list",describe:"List signals",aliases:["ls"],builder:e=>xe(W(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new Le({apiKey:t,apiHost:e,fetch:al.default,projectId:r}).get();me(s.signals,n,i)}};g();var cl=Q(require("isomorphic-unfetch"));g();var Pt=e=>e.id,jt=e=>`${e.name} (pid: ${e.id})`;g();function Ii({client:e}){async function*t(){let n=(await e.get()).signals;for await(let i of n)yield{id:Pt(i),displayName:jt(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.remove({signalId:n})},writeObject:async n=>{await e.upsert({signal:n.object})}}}var fl={command:"pull <directory>",describe:"Pulls all signals to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the signals to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:o,project:s,diff:a})=>{var p;let l=new Le({apiKey:t,apiHost:e,fetch:cl.default,projectId:s,limitPolicy:_e}),u=Ii({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.signals)!=null?p:[],selectIdentifier:Pt,selectDisplayName:jt,onSyncComplete:async(C,A)=>{y.signals=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:Pt,selectDisplayName:jt,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var ul=Q(require("isomorphic-unfetch"));var dl={command:"push <directory>",describe:"Pushes all signals from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the signals from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,project:o,diff:s})=>{var f;let a=new Le({apiKey:t,apiHost:e,fetch:ul.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.signals)!=null?f:[],selectIdentifier:Pt,selectDisplayName:jt})}else l=await ve({directory:n,selectIdentifier:Pt,selectDisplayName:jt});let d=Ii({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})})}};g();var pl=Q(require("isomorphic-unfetch"));var hl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a signal",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Signal public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Le({apiKey:t,apiHost:e,fetch:pl.default,projectId:i}).remove({signalId:n})}};g();var ml=Q(require("isomorphic-unfetch"));var gl={command:"update <filename>",aliases:["put"],describe:"Insert or update a signal",builder:e=>W(k(e.positional("filename",{demandOption:!0,describe:"Signal file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new Le({apiKey:t,apiHost:e,fetch:ml.default,projectId:i}),o=At(n);await r.upsert({signal:o})}};var yl={command:"signal <command>",aliases:["sig"],describe:"Commands for Context signals",builder:e=>e.command(fl).command(dl).command(sl).command(hl).command(ll).command(gl).demandCommand(),handler:()=>{Ge.help()}};var Xd={commands:[{command:"context <command>",aliases:["ctx"],describe:"Uniform Context commands",builder:e=>e.command(Ba).command(yl).command(ka).command(ja).command(rl).demandCommand(),handler:()=>{Ge.showHelp()}}]};module.exports=Sl(ep);0&&(module.exports={uniformCLI});
|
96
|
+
`),s=i?"+":r?"":"-";return n+s+`
|
97
|
+
`}function $s(e){return e[e.length-1]===`
|
98
|
+
`?e.slice(0,-1):e}function wp(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var f=e.indexOf(`
|
99
|
+
`);return f=f!==-1?f:e.length,n.lastIndex=f,Ws(e.slice(0,f),t)}(),i=e[0]===`
|
100
|
+
`||e[0]===" ",s,o;o=n.exec(e);){var a=o[1],l=o[2];s=l[0]===" ",r+=a+(!i&&!s&&l!==""?`
|
101
|
+
`:"")+Ws(l,t),i=s}return r}function Ws(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,s,o=0,a=0,l="";r=n.exec(e);)a=r.index,a-i>t&&(s=o>i?o:a,l+=`
|
102
|
+
`+e.slice(i,s),i=s+1),o=a;return l+=`
|
103
|
+
`,e.length-i>t&&o>i?l+=e.slice(i,o)+`
|
104
|
+
`+e.slice(o+1):l+=e.slice(i),l.slice(1)}function Ap(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Wn(e,i),r=Te[n],!r&&qn(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||up(n);return t}function xp(e,t,n){var r="",i=e.tag,s,o,a;for(s=0,o=n.length;s<o;s+=1)a=n[s],e.replacer&&(a=e.replacer.call(n,String(s),a)),(gt(e,t,a,!1,!1)||typeof a=="undefined"&>(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function Bs(e,t,n,r){var i="",s=e.tag,o,a,l;for(o=0,a=n.length;o<a;o+=1)l=n[o],e.replacer&&(l=e.replacer.call(n,String(o),l)),(gt(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&>(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Mi(e,t)),e.dump&&Hn===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}function Cp(e,t,n){var r="",i=e.tag,s=Object.keys(n),o,a,l,f,u;for(o=0,a=s.length;o<a;o+=1)u="",r!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=s[o],f=n[l],e.replacer&&(f=e.replacer.call(n,l,f)),gt(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),gt(e,t,f,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump="{"+r+"}"}function vp(e,t,n,r){var i="",s=e.tag,o=Object.keys(n),a,l,f,u,c,d;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new ke("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)d="",(!r||i!=="")&&(d+=Mi(e,t)),f=o[a],u=n[f],e.replacer&&(u=e.replacer.call(n,f,u)),gt(e,t+1,f,!0,!0,!0)&&(c=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,c&&(e.dump&&Hn===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,c&&(d+=Mi(e,t)),gt(e,t+1,u,!0,c)&&(e.dump&&Hn===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=s,e.dump=i||"{}"}function Hs(e,t,n){var r,i,s,o,a,l;for(i=n?e.explicitTypes:e.implicitTypes,s=0,o=i.length;s<o;s+=1)if(a=i[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,ia.call(a.represent)==="[object Function]")r=a.represent(t,l);else if(oa.call(a.represent,l))r=a.represent[l](t,l);else throw new ke("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function gt(e,t,n,r,i,s,o){e.tag=null,e.dump=n,Hs(e,n,!1)||Hs(e,n,!0);var a=ia.call(e.dump),l=r,f;r&&(r=e.flowLevel<0||e.flowLevel>t);var u=a==="[object Object]"||a==="[object Array]",c,d;if(u&&(c=e.duplicates.indexOf(n),d=c!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(i=!1),d&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(u&&d&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),a==="[object Object]")r&&Object.keys(e.dump).length!==0?(vp(e,t,e.dump,i),d&&(e.dump="&ref_"+c+e.dump)):(Cp(e,t,e.dump),d&&(e.dump="&ref_"+c+" "+e.dump));else if(a==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?Bs(e,t-1,e.dump,i):Bs(e,t,e.dump,i),d&&(e.dump="&ref_"+c+e.dump)):(xp(e,t,e.dump),d&&(e.dump="&ref_"+c+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&bp(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ke("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(f=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?f="!"+f:f.slice(0,18)==="tag:yaml.org,2002:"?f="!!"+f.slice(18):f="!<"+f+">",e.dump=f+" "+e.dump)}return!0}function Op(e,t){var n=[],r=[],i,s;for(Ti(e,n,r),i=0,s=r.length;i<s;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(s)}function Ti(e,t,n){var r,i,s;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,s=e.length;i<s;i+=1)Ti(e[i],t,n);else for(r=Object.keys(e),i=0,s=r.length;i<s;i+=1)Ti(e[r[i]],t,n)}function Ep(e,t){t=t||{};var n=new pp(t);n.noRefs||Op(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),gt(n,0,r,!0,!0)?n.dump+`
|
105
|
+
`:""}var _p=Ep,Sp={dump:_p};function Ri(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var ma=ra.load,l0=ra.loadAll,ga=Sp.dump;var c0=Ri("safeLoad","load"),f0=Ri("safeLoadAll","loadAll"),u0=Ri("safeDump","dump");var Ja=require("fs"),no=require("path"),Xa=require("fs"),Za=Z(require("fs"),1);y();function yt(){}yt.prototype={diff:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.callback;typeof r=="function"&&(i=r,r={}),this.options=r;var s=this;function o(g){return i?(setTimeout(function(){i(void 0,g)},0),!0):g}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var a=n.length,l=t.length,f=1,u=a+l,c=[{newPos:-1,components:[]}],d=this.extractCommon(c[0],n,t,0);if(c[0].newPos+1>=a&&d+1>=l)return o([{value:this.join(n),count:n.length}]);function h(){for(var g=-1*f;g<=f;g+=2){var m=void 0,O=c[g-1],E=c[g+1],$=(E?E.newPos:0)-g;O&&(c[g-1]=void 0);var z=O&&O.newPos+1<a,J=E&&0<=$&&$<l;if(!z&&!J){c[g]=void 0;continue}if(!z||J&&O.newPos<E.newPos?(m=Pp(E),s.pushComponent(m.components,void 0,!0)):(m=O,m.newPos++,s.pushComponent(m.components,!0,void 0)),$=s.extractCommon(m,n,t,g),m.newPos+1>=a&&$+1>=l)return o(jp(s,m.components,n,t,s.useLongestToken));c[g]=m}f++}if(i)(function g(){setTimeout(function(){if(f>u)return i();h()||g()},0)})();else for(;f<=u;){var b=h();if(b)return b}},pushComponent:function(t,n,r){var i=t[t.length-1];i&&i.added===n&&i.removed===r?t[t.length-1]={count:i.count+1,added:n,removed:r}:t.push({count:1,added:n,removed:r})},extractCommon:function(t,n,r,i){for(var s=n.length,o=r.length,a=t.newPos,l=a-i,f=0;a+1<s&&l+1<o&&this.equals(n[a+1],r[l+1]);)a++,l++,f++;return f&&t.components.push({count:f}),t.newPos=a,l},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function jp(e,t,n,r,i){for(var s=0,o=t.length,a=0,l=0;s<o;s++){var f=t[s];if(f.removed){if(f.value=e.join(r.slice(l,l+f.count)),l+=f.count,s&&t[s-1].added){var c=t[s-1];t[s-1]=t[s],t[s]=c}}else{if(!f.added&&i){var u=n.slice(a,a+f.count);u=u.map(function(h,b){var g=r[l+b];return g.length>h.length?g:h}),f.value=e.join(u)}else f.value=e.join(n.slice(a,a+f.count));a+=f.count,f.added||(l+=f.count)}}var d=t[o-1];return o>1&&typeof d.value=="string"&&(d.added||d.removed)&&e.equals("",d.value)&&(t[o-2].value+=d.value,t.pop()),t}function Pp(e){return{newPos:e.newPos,components:e.components.slice(0)}}var p0=new yt;var ya=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,ba=/\S/,wa=new yt;wa.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!ba.test(e)&&!ba.test(t)};wa.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&ya.test(t[n])&&ya.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Wi=new yt;Wi.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};function Bi(e,t,n){return Wi.diff(e,t,n)}var Ip=new yt;Ip.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Mp=new yt;Mp.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Mr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mr=function(t){return typeof t}:Mr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mr(e)}var Fp=Object.prototype.toString,Cn=new yt;Cn.useLongestToken=!0;Cn.tokenize=Wi.tokenize;Cn.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(s,o){return typeof o=="undefined"?n:o}:r;return typeof e=="string"?e:JSON.stringify(Ui(e,null,null,i),i," ")};Cn.equals=function(e,t){return yt.prototype.equals.call(Cn,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Aa(e,t,n){return Cn.diff(e,t,n)}function Ui(e,t,n,r,i){t=t||[],n=n||[],r&&(e=r(i,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var o;if(Fp.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),n.push(o),s=0;s<e.length;s+=1)o[s]=Ui(e[s],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Mr(e)==="object"&&e!==null){t.push(e),o={},n.push(o);var a=[],l;for(l in e)e.hasOwnProperty(l)&&a.push(l);for(a.sort(),s=0;s<a.length;s+=1)l=a[s],o[l]=Ui(e[l],t,n,r,l);t.pop(),n.pop()}else o=e;return o}var $i=new yt;$i.tokenize=function(e){return e.slice()};$i.join=$i.removeEmpty=function(e){return e};var nl=Z(Qa(),1);Ie();Ie();async function Ae({objects:e,selectIdentifier:t,selectDisplayName:n=t,onSyncComplete:r}){let i=e.reduce((a,l)=>{let f=t(l);if(a[f])throw new Error(`Identifier ${f} was not unique.`);return a[f]={id:f,object:l,providerId:f,displayName:n(l)},a},{});async function*s(){for(let a of Object.values(i))yield a}function o(){return Object.entries(i).sort((a,l)=>a[0].localeCompare(l[0])).map(a=>a[1].object)}return{objects:s(),deleteObject:async a=>{delete i[a]},writeObject:async a=>{let l=t(a.object);i[l]=a},extractCurrent:o,onSyncComplete:r?a=>r(a,o()):void 0}}Ie();var Xh=Oi(Ei());Ie();function D(e){var t,n;return e.option("apiKey",{describe:"Uniform API key. Defaults to CANVAS_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",default:(n=(t=process.env.CANVAS_CLI_API_KEY)!=null?t:process.env.UPM_CLI_API_KEY)!=null?n:process.env.UNIFORM_API_KEY,demandOption:!0,type:"string"}).option("apiHost",{describe:"Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or https://uniform.app. Supports dotenv.",default:process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app",demandOption:!0,type:"string"})}function N(e){var t,n,r;return e.option("project",{describe:"Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",default:(r=(n=(t=process.env.UNIFORM_CLI_PROJECT_ID)!=null?t:process.env.CANVAS_CLI_PROJECT_ID)!=null?n:process.env.UPM_CLI_PROJECT_ID)!=null?r:process.env.UNIFORM_PROJECT_ID,demandOption:!0,type:"string",alias:["p"]})}function xe(e){return e.option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("filename",{alias:["o"],describe:"Output filename. If not specified, write to stdout.",type:"string"})}function Ce(e){var t;return e.option("diff",{describe:"Whether to show diffs in stdout. off = no diffs; update = on for updates; on = updates, creates, deletes. Can be set by UNIFORM_CLI_DIFF_MODE environment variable.",default:(t=process.env.UNIFORM_CLI_DIFF_MODE)!=null?t:"off",type:"string",choices:["off","update","on"],alias:["d"]})}function ve(e){let t=(0,no.extname)(e);return t===".yaml"||t===".yml"||t===".json"}function de(e,t,n){let r;if(n&&!t){let i=(0,no.extname)(n);i===".yaml"||i===".yml"?t="yaml":i===".json"&&(t="json")}else if(!t)throw new Error("Format must be specified when no filename is passed");switch(t){case"json":r=JSON.stringify(e,null,2);break;case"yaml":r=ga(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?(0,Ja.writeFileSync)(n,r,"utf8"):console.log(r)}function dt(e){let t=(0,Xa.readFileSync)(e,"utf8");return ma(t,{filename:e,json:!0})}async function Oe({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:r=n}){(0,Br.existsSync)(e)||(0,Br.mkdirSync)(e,{recursive:!0});let i=await(0,Hr.readdir)(e,"utf-8"),s=new Set(i.filter(l=>{let f=(0,Qn.extname)(l);return f===".json"||f===".yaml"||f===".yml"})),o=l=>(0,Qn.join)(e,`${l}.${t}`);async function*a(){for(let l of s){let f=(0,Qn.join)(e,l);try{let u=await dt(f);yield{id:n(u),displayName:r(u),providerId:f,object:u}}catch(u){throw console.error(Xh.default.red(`Failed to read ${f}, data is likely invalid.
|
106
|
+
${u==null?void 0:u.message}`)),u}}}return{objects:a(),deleteObject:async l=>{await(0,Hr.unlink)(l)},writeObject:async l=>{de(l.object,t,o(l.id))}}}Ie();function el(e,t){if(!t&&!Za.default.existsSync(e))return{};let n=dt(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function tl(e,t){de(t,void 0,e)}Ie();async function pe({source:e,target:t,compareContents:n=(a,l)=>(0,nl.default)(a.object,l.object,(f,u,c)=>c==="created"||c==="modified"?!0:void 0),mode:r,allowEmptySource:i=!1,whatIf:s=!1,log:o=()=>{}}){var a,l;let f=new Map;for await(let d of t.objects)f.set(d.id,d);let u=[],c=!1;for await(let d of e.objects){c=!0;let h=d.id,b=f.get(h);if(b){if(!n(d,b)&&(r==="createOrUpdate"||r==="mirror")){let g=async(m,O)=>{var E;if(!s)try{await t.writeObject(m,O)}catch($){throw new Wr($,m)}o({action:"update",id:h,providerId:m.providerId,displayName:(E=m.displayName)!=null?E:m.providerId,whatIf:s,diff:Aa(O.object,m.object)})};u.push(g(d,b))}f.delete(h)}else{let g=async(m,O)=>{var E;if(!s)try{await t.writeObject(m)}catch($){throw new Wr($,m)}o({action:"create",id:O,providerId:O,displayName:(E=m.displayName)!=null?E:m.providerId,whatIf:s,diff:Bi("",JSON.stringify(m.object,null,2))})};u.push(g(d,h))}}if(await Promise.all(u),r==="mirror"){if(!c&&!i)throw new Error("Source is empty and mode is mirror. This would cause deletion of everything in the target, and most likely indicates an error in source definition.");let d=[];f.forEach(async h=>{let b=async g=>{var m;if(!s)try{await t.deleteObject(g.providerId)}catch(O){throw new Wr(O,g)}o({action:"delete",id:g.id,providerId:g.providerId,displayName:(m=g.displayName)!=null?m:g.providerId,whatIf:s,diff:Bi(JSON.stringify(g.object,null,2),"")})};d.push(b(h))}),await Promise.all(d)}await Promise.all([(a=e.onSyncComplete)==null?void 0:a.call(e,!1),(l=t.onSyncComplete)==null?void 0:l.call(t,!0)])}var Wr=class extends Error{constructor(e,t){super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
|
107
|
+
${e}`);var n;this.stack=void 0,Object.setPrototypeOf(this,Wr.prototype)}};Ie();var _n=Oi(Ei());function he(e){let{diffMode:t="off",indent:n,prefix:r}=e!=null?e:{};return function({action:i,displayName:s,whatIf:o,diff:a}){let l="";switch(i){case"create":l=_n.default.green("[A]");break;case"update":l=_n.default.white("[U]");break;case"delete":l=_n.default.yellow("[D]");break}let f="";(t==="on"||t==="update"&&i==="update")&&(f=`
|
108
|
+
`+a.map(u=>u.added?_n.default.green(u.value):u.removed?_n.default.red(u.value):u.value).join("")),console.log(`${n!=null?n:""}${o?_n.default.gray("[WHATIF]"):""}${l}${r!=null?r:""} ${s}${f}`)}}y();y();y();var rl=async e=>await e(),cn=class extends Error{constructor(t,n,r,i,s){super(`${t}
|
109
|
+
${i}${s?" "+s:""} (${n} ${r})`);this.errorMessage=t;this.fetchMethod=n;this.fetchUri=r;this.statusCode=i;this.statusText=s;Object.setPrototypeOf(this,cn.prototype)}};var Ve=class{constructor(t){go(this,"options");var n,r,i,s,o,a;if(!t.apiKey&&!t.bearerToken)throw new Error("You must provide an API key or a bearer token");this.options={...t,fetch:(n=t.fetch)!=null?n:fetch,apiHost:(r=t.apiHost)!=null?r:"https://uniform.app",apiKey:(i=t.apiKey)!=null?i:null,projectId:(s=t.projectId)!=null?s:null,bearerToken:(o=t.bearerToken)!=null?o:null,limitPolicy:(a=t.limitPolicy)!=null?a:rl}}async apiClient(t,n){return this.options.limitPolicy(async()=>{var s;let r=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},i=await fetch(t.toString(),{...n,headers:{...n==null?void 0:n.headers,...r}});if(!i.ok){let o="";try{let a=await i.text();try{let l=JSON.parse(a);l.errorMessage?o=Array.isArray(l.errorMessage)?l.errorMessage.join(", "):l.errorMessage:o=a}catch(l){o=a}}catch(a){o="General error"}throw new cn(o,(s=n==null?void 0:n.method)!=null?s:"GET",t.toString(),i.status)}return n!=null&&n.expectNoContent?null:await i.json()})}createUrl(t,n){let r=new URL(`${this.options.apiHost}${t}`);return Object.entries(n!=null?n:{}).forEach(([i,s])=>{var o;typeof s!="undefined"&&s!==null&&r.searchParams.append(i,(o=s==null?void 0:s.toString())!=null?o:"")}),r}};var Sn,Jn=class extends Ve{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(Jn,Sn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(se(Jn,Sn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(se(Jn,Sn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Ue=Jn;Sn=new WeakMap,He(Ue,Sn,"/api/v2/aggregate");var ol={command:"get <id>",describe:"Fetch an aggregate",builder:e=>xe(D(N(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new Ue({apiKey:t,apiHost:e,fetch:il.default,projectId:i}).get({aggregateId:n});a.aggregates.length===0?(console.error("Aggregate did not exist"),process.exit(1)):de(a.aggregates[0],r,s)}};y();var sl=Z(require("isomorphic-unfetch"));var al={command:"list",describe:"List aggregates",aliases:["ls"],builder:e=>xe(D(N(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Ue({apiKey:t,apiHost:e,fetch:sl.default,projectId:i}).get({});de(o.aggregates,n,r)}};y();var cl=Z(require("isomorphic-unfetch"));y();var Mt=e=>e.id,Ft=e=>`${e.name} (pid: ${e.id})`;y();function be(e,t){return el(e,t)}function at(e,t){tl(e,t)}y();var ll=Z(require("p-limit")),Ee=(0,ll.default)(8);y();function Gr({client:e,type:t}){async function*n(){let i=(await e.get({type:t})).aggregates;for await(let s of i)yield{id:Mt(s),displayName:Ft(s),providerId:s.id,object:s}}let r=[];return{objects:n(),deleteObject:async i=>{await e.remove({aggregateId:i})},writeObject:async i=>{await e.upsert({aggregate:i.object,skipInputs:!0}),r.push(i.object)},complete:async()=>{await Promise.all(r.map(i=>e.upsert({aggregate:i,skipInputs:!1})))}}}var fl={command:"pull <directory>",describe:"Pulls all aggregates to local files in a directory",builder:e=>D(N(Ce(e.positional("directory",{describe:"Directory to save the aggregates to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new Ue({apiKey:t,apiHost:e,fetch:cl.default,projectId:o,limitPolicy:Ee}),f=Gr({client:l}),u;if(ve(n)){let h=be(n,!1);u=await Ae({objects:(d=h.aggregates)!=null?d:[],selectIdentifier:Mt,selectDisplayName:Ft,onSyncComplete:async(b,g)=>{h.aggregates=g,at(n,h)}})}else u=await Oe({directory:n,selectIdentifier:Mt,selectDisplayName:Ft,format:r});await pe({source:f,target:u,mode:i,whatIf:s,log:he({diffMode:a})})}};y();var ul=Z(require("isomorphic-unfetch"));var dl={command:"push <directory>",describe:"Pushes all aggregates from files in a directory or package to Uniform",builder:e=>D(N(Ce(e.positional("directory",{describe:"Directory to read the aggregates from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:r,whatIf:i,project:s,diff:o})=>{var c;let a=new Ue({apiKey:t,apiHost:e,fetch:ul.default,projectId:s,limitPolicy:Ee}),l;if(ve(n)){let d=be(n,!0);l=await Ae({objects:(c=d.aggregates)!=null?c:[],selectIdentifier:Mt,selectDisplayName:Ft})}else l=await Oe({directory:n,selectIdentifier:Mt,selectDisplayName:Ft});let u=Gr({client:a});await pe({source:l,target:u,mode:r,whatIf:i,log:he({diffMode:o})}),await u.complete()}};y();var pl=Z(require("isomorphic-unfetch"));var hl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an aggregate",builder:e=>D(N(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Ue({apiKey:t,apiHost:e,fetch:pl.default,projectId:r}).remove({aggregateId:n})}};y();var ml=Z(require("isomorphic-unfetch"));var gl={command:"update <filename>",aliases:["put"],describe:"Insert or update an aggregate",builder:e=>D(N(e.positional("filename",{demandOption:!0,describe:"Aggregate file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new Ue({apiKey:t,apiHost:e,fetch:ml.default,projectId:r}),s=dt(n);await i.upsert({aggregate:s})}};var yl={command:"aggregate <command>",aliases:["agg","intent","audience"],describe:"Commands for Context aggregates (intents, audiences)",builder:e=>e.command(fl).command(dl).command(ol).command(hl).command(al).command(gl).demandCommand(),handler:()=>{Ne.help()}};y();y();var bl=Z(require("isomorphic-unfetch"));y();var jn,Xn,fn=class extends Ve{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(fn,jn),{...t,projectId:n});return await this.apiClient(r)}async upsertCategory(t){let n=this.createUrl(se(fn,jn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(t){let n=this.createUrl(se(fn,jn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(t){let n=this.createUrl(se(fn,Xn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(t){let n=this.createUrl(se(fn,Xn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Ke=fn;jn=new WeakMap,Xn=new WeakMap,He(Ke,jn,"/api/v1/enrichments"),He(Ke,Xn,"/api/v1/enrichment-values");var wl={command:"get <id>",describe:"Fetch an enrichment category and its values",builder:e=>xe(D(N(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{var l,f;let a=(f=(l=await new Ke({apiKey:t,apiHost:e,fetch:bl.default,projectId:i}).get())==null?void 0:l.enrichments)==null?void 0:f.filter(u=>u.id===n);a.length===0?(console.error("Enrichment did not exist"),process.exit(1)):de(a[0],r,s)}};y();var Al=Z(require("isomorphic-unfetch"));var xl={command:"list",describe:"List enrichments",aliases:["ls"],builder:e=>xe(D(N(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Ke({apiKey:t,apiHost:e,fetch:Al.default,projectId:i}).get();de(o.enrichments,n,r)}};y();var vl=Z(require("isomorphic-unfetch"));y();var Tt=e=>e.id,Lt=e=>`${e.name} (pid: ${e.id})`;y();function qr({client:e}){async function*t(){let n=(await e.get()).enrichments;for await(let r of n)yield{id:Tt(r),displayName:Lt(r),providerId:r.id,object:r}}return{objects:t(),deleteObject:async n=>{await e.removeCategory({enrichmentId:n})},writeObject:async(n,r)=>{var o,a;await e.upsertCategory({enrichment:n.object});let i=Cl({categoryId:n.id,values:n.object.values}),s=Cl({categoryId:n.id,values:(a=(o=r==null?void 0:r.object)==null?void 0:o.values)!=null?a:[],client:e});await pe({source:i,target:s,mode:"mirror",whatIf:!1,log:he({diffMode:"off",prefix:` ${n.displayName} value`,indent:"> "})})}}}var Cl=({client:e,categoryId:t,values:n})=>({objects:async function*(){for(let i of n)yield{id:i.id,providerId:i.id,object:i,displayName:`${i.value} (pid: ${i.id})`}}(),deleteObject:async i=>{if(!e)throw new Error("Provider is read only");await e.removeValue({enrichmentId:t,enrichmentValueId:i})},writeObject:async i=>{if(!e)throw new Error("Provider is read only");await e.upsertValue({enrichmentId:t,enrichmentValue:i.object})}});var Ol={command:"pull <directory>",describe:"Pulls all enrichments to local files in a directory",builder:e=>D(N(Ce(e.positional("directory",{describe:"Directory to save the enrichments to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new Ke({apiKey:t,apiHost:e,fetch:vl.default,projectId:o,limitPolicy:Ee}),f=qr({client:l}),u;if(ve(n)){let h=be(n,!1);u=await Ae({objects:(d=h.enrichments)!=null?d:[],selectIdentifier:Tt,selectDisplayName:Lt,onSyncComplete:async(b,g)=>{h.enrichments=g,at(n,h)}})}else u=await Oe({directory:n,selectIdentifier:Tt,selectDisplayName:Lt,format:r});await pe({source:f,target:u,mode:i,whatIf:s,log:he({diffMode:a})})}};y();var El=Z(require("isomorphic-unfetch"));var _l={command:"push <directory>",describe:"Pushes all enrichments from files in a directory or package to Uniform",builder:e=>D(N(Ce(e.positional("directory",{describe:"Directory to read the enrichments from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:r,whatIf:i,project:s,diff:o})=>{var c;let a=new Ke({apiKey:t,apiHost:e,fetch:El.default,projectId:s,limitPolicy:Ee}),l;if(ve(n)){let d=be(n,!0);l=await Ae({objects:(c=d.enrichments)!=null?c:[],selectIdentifier:Tt,selectDisplayName:Lt})}else l=await Oe({directory:n,selectIdentifier:Tt,selectDisplayName:Lt});let u=qr({client:a});await pe({source:l,target:u,mode:r,whatIf:i,log:he({diffMode:o})})}};y();var Sl=Z(require("isomorphic-unfetch"));var jl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an enrichment category and its values",builder:e=>D(N(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Ke({apiKey:t,apiHost:e,fetch:Sl.default,projectId:r}).removeCategory({enrichmentId:n})}};var Pl={command:"enrichment <command>",aliases:["enr"],describe:"Commands for Context enrichments",builder:e=>e.command(Ol).command(_l).command(wl).command(jl).command(xl).demandCommand(),handler:()=>{Ne.help()}};y();y();var tr=Z(cc()),fc=require("fs"),uc=Z(require("isomorphic-unfetch")),ei=require("process");y();var Zr,po=class extends Ve{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(po,Zr),{...t,projectId:n});return await this.apiClient(r)}},Xr=po;Zr=new WeakMap,He(Xr,Zr,"/api/v2/manifest");var dc={command:"get [output]",aliases:["dl","download"],describe:"Download the Uniform Context manifest for a project",builder:e=>{var t,n,r;return e.option("apiKey",{alias:"k",demandOption:!0,string:!0,default:(t=process.env.UNIFORM_API_KEY)!=null?t:"",describe:"Uniform API key to use. Defaults to UNIFORM_API_KEY env if set."}).option("project",{describe:"Uniform project ID. Defaults to UCTX_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",demandOption:!0,default:(r=(n=process.env.UCTX_CLI_PROJECT_ID)!=null?n:process.env.UNIFORM_PROJECT_ID)!=null?r:"",type:"string",alias:["p"]}).option("preview",{describe:"If set, fetches the unpublished preview manifest (The API key must have permission)",default:!1,type:"boolean",alias:["d"]}).option("output",{string:!0,alias:"o",default:process.env.UNIFORM_MANIFEST_PATH,describe:"Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set."})},handler:async({apiKey:e,output:t,project:n,preview:r})=>{n||(console.error(tr.default.red("You must specify the project ID")),(0,ei.exit)(1));let i=vm(),s=new Xr({apiHost:i,projectId:n,apiKey:e,fetch:uc.default});try{let o=await s.get({preview:r}),a=JSON.stringify(o,null,2);t?(0,fc.writeFile)(t,a,l=>{l&&(console.error(`Error writing file to ${t}
|
110
|
+
`,l),(0,ei.exit)(1)),console.log(tr.default.green(`\u2705 ${t} has been updated from ${i}`))}):console.log(a)}catch(o){let a;o instanceof cn?(o.statusCode===403&&(a=`The API key ${e} did not have permissions to fetch the manifest. Ensure ${r?"Context > Read Drafts":"Context > Manifest > Read"} permissions are granted.`),a=o.message):a=o.toString(),console.error(tr.default.red("\u26A0 Error fetching Context manifest")),console.error(tr.default.gray(` \u2757 ${a}`)),(0,ei.exit)(1)}}},vm=()=>process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app";var pc={command:"manifest <command>",describe:"Commands for context manifests",aliases:["man"],builder:e=>e.command(dc).demandCommand(),handler:()=>{Ne.help()}};y();y();var hc=Z(require("isomorphic-unfetch"));y();var Tn,nr=class extends Ve{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(nr,Tn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(se(nr,Tn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(se(nr,Tn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},$e=nr;Tn=new WeakMap,He($e,Tn,"/api/v2/quirk");var mc={command:"get <id>",describe:"Fetch a quirk",builder:e=>xe(D(N(e.positional("id",{demandOption:!0,describe:"Quirk public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new $e({apiKey:t,apiHost:e,fetch:hc.default,projectId:i}).get({quirkId:n,withIntegrations:!0});a.quirks.length===0?(console.error("Quirk did not exist"),process.exit(1)):de(a.quirks[0],r,s)}};y();var gc=Z(require("isomorphic-unfetch"));var yc={command:"list",describe:"List quirks",aliases:["ls"],builder:e=>xe(D(N(e.option("withIntegrations",{alias:["i"],describe:"Whether to include meta-quirks created by integrations in the list. Defaults to false.",type:"boolean"})))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i,withIntegrations:s})=>{let a=await new $e({apiKey:t,apiHost:e,fetch:gc.default,projectId:i}).get({withIntegrations:s});de(a.quirks,n,r)}};y();var bc=Z(require("isomorphic-unfetch"));y();var Nt=e=>e.id,kt=e=>`${e.name} (pid: ${e.id})`;y();function ti({client:e}){async function*t(){let n=(await e.get({withIntegrations:!1})).quirks;for await(let r of n)yield{id:Nt(r),displayName:kt(r),providerId:r.id,object:r}}return{objects:t(),deleteObject:async n=>{await e.remove({quirkId:n})},writeObject:async n=>{await e.upsert({quirk:n.object})}}}var wc={command:"pull <directory>",describe:"Pulls all quirks to local files in a directory",builder:e=>D(N(Ce(e.positional("directory",{describe:"Directory to save the quirks to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new $e({apiKey:t,apiHost:e,fetch:bc.default,projectId:o,limitPolicy:Ee}),f=ti({client:l}),u;if(ve(n)){let h=be(n,!1);u=await Ae({objects:(d=h.quirks)!=null?d:[],selectIdentifier:Nt,selectDisplayName:kt,onSyncComplete:async(b,g)=>{h.quirks=g,at(n,h)}})}else u=await Oe({directory:n,selectIdentifier:Nt,selectDisplayName:kt,format:r});await pe({source:f,target:u,mode:i,whatIf:s,log:he({diffMode:a})})}};y();var Ac=Z(require("isomorphic-unfetch"));var xc={command:"push <directory>",describe:"Pushes all quirks from files in a directory or package to Uniform",builder:e=>D(N(Ce(e.positional("directory",{describe:"Directory to read the quirks from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:r,whatIf:i,project:s,diff:o})=>{var c;let a=new $e({apiKey:t,apiHost:e,fetch:Ac.default,projectId:s,limitPolicy:Ee}),l;if(ve(n)){let d=be(n,!0);l=await Ae({objects:(c=d.quirks)!=null?c:[],selectIdentifier:Nt,selectDisplayName:kt})}else l=await Oe({directory:n,selectIdentifier:Nt,selectDisplayName:kt});let u=ti({client:a});await pe({source:l,target:u,mode:r,whatIf:i,log:he({diffMode:o})})}};y();var Cc=Z(require("isomorphic-unfetch"));var vc={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a quirk",builder:e=>D(N(e.positional("id",{demandOption:!0,describe:"Quirk public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new $e({apiKey:t,apiHost:e,fetch:Cc.default,projectId:r}).remove({quirkId:n})}};y();var Oc=Z(require("isomorphic-unfetch"));var Ec={command:"update <filename>",aliases:["put"],describe:"Insert or update a quirk",builder:e=>D(N(e.positional("filename",{demandOption:!0,describe:"Quirk file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new $e({apiKey:t,apiHost:e,fetch:Oc.default,projectId:r}),s=dt(n);await i.upsert({quirk:s})}};var _c={command:"quirk <command>",aliases:["qk"],describe:"Commands for Context quirks",builder:e=>e.command(wc).command(xc).command(mc).command(vc).command(yc).command(Ec).demandCommand(),handler:()=>{Ne.help()}};y();y();var Sc=Z(require("isomorphic-unfetch"));y();var Ln,rr=class extends Ve{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(rr,Ln),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(se(rr,Ln));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(se(rr,Ln));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},We=rr;Ln=new WeakMap,He(We,Ln,"/api/v2/signal");var jc={command:"get <id>",describe:"Fetch a signal",builder:e=>xe(D(N(e.positional("id",{demandOption:!0,describe:"Signal public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new We({apiKey:t,apiHost:e,fetch:Sc.default,projectId:i}).get({signalId:n});a.signals.length===0?(console.error("Signal did not exist"),process.exit(1)):de(a.signals[0],r,s)}};y();var Pc=Z(require("isomorphic-unfetch"));var Ic={command:"list",describe:"List signals",aliases:["ls"],builder:e=>xe(D(N(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new We({apiKey:t,apiHost:e,fetch:Pc.default,projectId:i}).get();de(o.signals,n,r)}};y();var Mc=Z(require("isomorphic-unfetch"));y();var Rt=e=>e.id,Ut=e=>`${e.name} (pid: ${e.id})`;y();function ni({client:e}){async function*t(){let n=(await e.get()).signals;for await(let r of n)yield{id:Rt(r),displayName:Ut(r),providerId:r.id,object:r}}return{objects:t(),deleteObject:async n=>{await e.remove({signalId:n})},writeObject:async n=>{await e.upsert({signal:n.object})}}}var Fc={command:"pull <directory>",describe:"Pulls all signals to local files in a directory",builder:e=>D(N(Ce(e.positional("directory",{describe:"Directory to save the signals to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new We({apiKey:t,apiHost:e,fetch:Mc.default,projectId:o,limitPolicy:Ee}),f=ni({client:l}),u;if(ve(n)){let h=be(n,!1);u=await Ae({objects:(d=h.signals)!=null?d:[],selectIdentifier:Rt,selectDisplayName:Ut,onSyncComplete:async(b,g)=>{h.signals=g,at(n,h)}})}else u=await Oe({directory:n,selectIdentifier:Rt,selectDisplayName:Ut,format:r});await pe({source:f,target:u,mode:i,whatIf:s,log:he({diffMode:a})})}};y();var Tc=Z(require("isomorphic-unfetch"));var Lc={command:"push <directory>",describe:"Pushes all signals from files in a directory or package to Uniform",builder:e=>D(N(Ce(e.positional("directory",{describe:"Directory to read the signals from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:r,whatIf:i,project:s,diff:o})=>{var c;let a=new We({apiKey:t,apiHost:e,fetch:Tc.default,projectId:s,limitPolicy:Ee}),l;if(ve(n)){let d=be(n,!0);l=await Ae({objects:(c=d.signals)!=null?c:[],selectIdentifier:Rt,selectDisplayName:Ut})}else l=await Oe({directory:n,selectIdentifier:Rt,selectDisplayName:Ut});let u=ni({client:a});await pe({source:l,target:u,mode:r,whatIf:i,log:he({diffMode:o})})}};y();var Dc=Z(require("isomorphic-unfetch"));var Nc={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a signal",builder:e=>D(N(e.positional("id",{demandOption:!0,describe:"Signal public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new We({apiKey:t,apiHost:e,fetch:Dc.default,projectId:r}).remove({signalId:n})}};y();var kc=Z(require("isomorphic-unfetch"));var Rc={command:"update <filename>",aliases:["put"],describe:"Insert or update a signal",builder:e=>D(N(e.positional("filename",{demandOption:!0,describe:"Signal file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new We({apiKey:t,apiHost:e,fetch:kc.default,projectId:r}),s=dt(n);await i.upsert({signal:s})}};var Uc={command:"signal <command>",aliases:["sig"],describe:"Commands for Context signals",builder:e=>e.command(Fc).command(Lc).command(jc).command(Nc).command(Ic).command(Rc).demandCommand(),handler:()=>{Ne.help()}};y();y();var $c=Z(require("isomorphic-unfetch"));y();var Dn,ir=class extends Ve{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(ir,Dn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(se(ir,Dn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(se(ir,Dn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Be=ir;Dn=new WeakMap,He(Be,Dn,"/api/v2/test");var Wc={command:"get <id>",describe:"Fetch a test",builder:e=>xe(D(N(e.positional("id",{demandOption:!0,describe:"Test public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new Be({apiKey:t,apiHost:e,fetch:$c.default,projectId:i}).get({testId:n});a.tests.length===0?(console.error("Test did not exist"),process.exit(1)):de(a.tests[0],r,s)}};y();var Bc=Z(require("isomorphic-unfetch"));var Hc={command:"list",describe:"List tests",aliases:["ls"],builder:e=>xe(D(N(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Be({apiKey:t,apiHost:e,fetch:Bc.default,projectId:i}).get();de(o.tests,n,r)}};y();var Gc=Z(require("isomorphic-unfetch"));y();var $t=e=>e.id,Wt=e=>`${e.name} (pid: ${e.id})`;y();function ri({client:e}){async function*t(){let n=(await e.get()).tests;for await(let r of n)yield{id:$t(r),displayName:Wt(r),providerId:r.id,object:r}}return{objects:t(),deleteObject:async n=>{await e.remove({testId:n})},writeObject:async n=>{await e.upsert({test:n.object})}}}var qc={command:"pull <directory>",describe:"Pulls all tests to local files in a directory",builder:e=>D(N(Ce(e.positional("directory",{describe:"Directory to save the tests to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new Be({apiKey:t,apiHost:e,fetch:Gc.default,projectId:o,limitPolicy:Ee}),f=ri({client:l}),u;if(ve(n)){let h=be(n,!1);u=await Ae({objects:(d=h.tests)!=null?d:[],selectIdentifier:$t,selectDisplayName:Wt,onSyncComplete:async(b,g)=>{h.tests=g,at(n,h)}})}else u=await Oe({directory:n,selectIdentifier:$t,selectDisplayName:Wt,format:r});await pe({source:f,target:u,mode:i,whatIf:s,log:he({diffMode:a})})}};y();var Yc=Z(require("isomorphic-unfetch"));var zc={command:"push <directory>",describe:"Pushes all tests from files in a directory or package to Uniform",builder:e=>D(N(Ce(e.positional("directory",{describe:"Directory to read the tests from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:r,whatIf:i,project:s,diff:o})=>{var c;let a=new Be({apiKey:t,apiHost:e,fetch:Yc.default,projectId:s,limitPolicy:Ee}),l;if(ve(n)){let d=be(n,!0);l=await Ae({objects:(c=d.tests)!=null?c:[],selectIdentifier:$t,selectDisplayName:Wt})}else l=await Oe({directory:n,selectIdentifier:$t,selectDisplayName:Wt});let u=ri({client:a});await pe({source:l,target:u,mode:r,whatIf:i,log:he({diffMode:o})})}};y();var Vc=Z(require("isomorphic-unfetch"));var Kc={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a test",builder:e=>D(N(e.positional("id",{demandOption:!0,describe:"Test public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Be({apiKey:t,apiHost:e,fetch:Vc.default,projectId:r}).remove({testId:n})}};y();var Qc=Z(require("isomorphic-unfetch"));var Jc={command:"update <filename>",aliases:["put"],describe:"Insert or update a test",builder:e=>D(N(e.positional("filename",{demandOption:!0,describe:"Test file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new Be({apiKey:t,apiHost:e,fetch:Qc.default,projectId:r}),s=dt(n);await i.upsert({test:s})}};var Xc={command:"test <command>",describe:"Commands for Context A/B tests",builder:e=>e.command(qc).command(zc).command(Wc).command(Kc).command(Hc).command(Jc).demandCommand(),handler:()=>{Ne.help()}};var Om={commands:[{command:"context <command>",aliases:["ctx"],describe:"Uniform Context commands",builder:e=>e.command(pc).command(Uc).command(Pl).command(yl).command(_c).command(Xc).demandCommand(),handler:()=>{Ne.showHelp()}}]};module.exports=lf(Em);0&&(module.exports={readContextPackage,uniformCLI,writeContextPackage});
|
100
111
|
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
101
112
|
/**
|
102
113
|
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|