@uniformdev/context 12.2.1-alpha.184 → 13.0.1-alpha.132
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 +2 -1
- package/dist/cli/cli.d.ts +14 -1
- package/dist/cli/cli.js +63 -53
- package/dist/cli/cli.mjs +63 -52
- package/dist/contextTypes-572b0d33.d.ts +1534 -0
- package/dist/index.d.ts +58 -23
- 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-5f88cc63.d.ts} +154 -369
- package/dist/types-c12d92cd.d.ts +772 -0
- package/dist/v2-manifest.swagger-ff2af13e.d.ts +294 -0
- package/package.json +12 -20
- package/dist/chunk-GU2YFM6V.mjs +0 -1
- package/dist/chunk-JKQJOIRC.mjs +0 -2
- package/dist/chunk-KZPEO35A.mjs +0 -1
package/dist/cli/cli.mjs
CHANGED
@@ -1,13 +1,18 @@
|
|
1
|
-
import{b as rr,d as De,e as Ke,f as or,g as Ne,h as Te}from"../chunk-JKQJOIRC.mjs";import{a as ze,b as pa,c as ha,i as b}from"../chunk-KZPEO35A.mjs";var Ms=pa((An,an)=>{b();var $f=200,er="__lodash_hash_undefined__",ds=1,Jn=2,ps=9007199254740991,Gn="[object Arguments]",Gi="[object Array]",hs="[object Boolean]",ms="[object Date]",gs="[object Error]",ys="[object Function]",Wf="[object GeneratorFunction]",zn="[object Map]",bs="[object Number]",sn="[object Object]",ns="[object Promise]",As="[object RegExp]",Kn="[object Set]",ws="[object String]",Hf="[object Symbol]",zi="[object WeakMap]",xs="[object ArrayBuffer]",Vn="[object DataView]",kf="[object Float32Array]",Yf="[object Float64Array]",Bf="[object Int8Array]",qf="[object Int16Array]",Gf="[object Int32Array]",zf="[object Uint8Array]",Kf="[object Uint8ClampedArray]",Vf="[object Uint16Array]",Qf="[object Uint32Array]",Jf=/[\\^$.*+?()[\]{}|]/g,Zf=/^\[object .+?Constructor\]$/,Xf=/^(?:0|[1-9]\d*)$/,X={};X[kf]=X[Yf]=X[Bf]=X[qf]=X[Gf]=X[zf]=X[Kf]=X[Vf]=X[Qf]=!0;X[Gn]=X[Gi]=X[xs]=X[hs]=X[Vn]=X[ms]=X[gs]=X[ys]=X[zn]=X[bs]=X[sn]=X[As]=X[Kn]=X[ws]=X[zi]=!1;var Cs=typeof global=="object"&&global&&global.Object===Object&&global,eu=typeof self=="object"&&self&&self.Object===Object&&self,gt=Cs||eu||Function("return this")(),Os=typeof An=="object"&&An&&!An.nodeType&&An,is=Os&&typeof an=="object"&&an&&!an.nodeType&&an,tu=is&&is.exports===Os,rs=tu&&Cs.process,os=function(){try{return rs&&rs.binding("util")}catch(e){}}(),ss=os&&os.isTypedArray;function nu(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function iu(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function ru(e){return function(t){return e(t)}}function ou(e,t){return e==null?void 0:e[t]}function Ki(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function su(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function au(e,t){return function(n){return e(t(n))}}function lu(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var cu=Array.prototype,fu=Function.prototype,Zn=Object.prototype,Bi=gt["__core-js_shared__"],as=function(){var e=/[^.]+$/.exec(Bi&&Bi.keys&&Bi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),_s=fu.toString,it=Zn.hasOwnProperty,Cn=Zn.toString,uu=RegExp("^"+_s.call(it).replace(Jf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ls=gt.Symbol,cs=gt.Uint8Array,du=Zn.propertyIsEnumerable,pu=cu.splice,hu=au(Object.keys,Object),Vi=ln(gt,"DataView"),wn=ln(gt,"Map"),Qi=ln(gt,"Promise"),Ji=ln(gt,"Set"),Zi=ln(gt,"WeakMap"),xn=ln(Object,"create"),mu=zt(Vi),gu=zt(wn),yu=zt(Qi),bu=zt(Ji),Au=zt(Zi),fs=ls?ls.prototype:void 0,qi=fs?fs.valueOf:void 0;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 wu(){this.__data__=xn?xn(null):{}}function xu(e){return this.has(e)&&delete this.__data__[e]}function Cu(e){var t=this.__data__;if(xn){var n=t[e];return n===er?void 0:n}return it.call(t,e)?t[e]:void 0}function Ou(e){var t=this.__data__;return xn?t[e]!==void 0:it.call(t,e)}function _u(e,t){var n=this.__data__;return n[e]=xn&&t===void 0?er:t,this}qt.prototype.clear=wu;qt.prototype.delete=xu;qt.prototype.get=Cu;qt.prototype.has=Ou;qt.prototype.set=_u;function rt(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 vu(){this.__data__=[]}function Eu(e){var t=this.__data__,n=Xn(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():pu.call(t,n,1),!0}function Su(e){var t=this.__data__,n=Xn(t,e);return n<0?void 0:t[n][1]}function Iu(e){return Xn(this.__data__,e)>-1}function ju(e,t){var n=this.__data__,i=Xn(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}rt.prototype.clear=vu;rt.prototype.delete=Eu;rt.prototype.get=Su;rt.prototype.has=Iu;rt.prototype.set=ju;function Gt(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 Pu(){this.__data__={hash:new qt,map:new(wn||rt),string:new qt}}function Mu(e){return ei(this,e).delete(e)}function Fu(e){return ei(this,e).get(e)}function Lu(e){return ei(this,e).has(e)}function Du(e,t){return ei(this,e).set(e,t),this}Gt.prototype.clear=Pu;Gt.prototype.delete=Mu;Gt.prototype.get=Fu;Gt.prototype.has=Lu;Gt.prototype.set=Du;function Qn(e){var t=-1,n=e?e.length:0;for(this.__data__=new Gt;++t<n;)this.add(e[t])}function Nu(e){return this.__data__.set(e,er),this}function Tu(e){return this.__data__.has(e)}Qn.prototype.add=Qn.prototype.push=Nu;Qn.prototype.has=Tu;function mt(e){this.__data__=new rt(e)}function Ru(){this.__data__=new rt}function Uu(e){return this.__data__.delete(e)}function $u(e){return this.__data__.get(e)}function Wu(e){return this.__data__.has(e)}function Hu(e,t){var n=this.__data__;if(n instanceof rt){var i=n.__data__;if(!wn||i.length<$f-1)return i.push([e,t]),this;n=this.__data__=new Gt(i)}return n.set(e,t),this}mt.prototype.clear=Ru;mt.prototype.delete=Uu;mt.prototype.get=$u;mt.prototype.has=Wu;mt.prototype.set=Hu;function ku(e,t){var n=Xi(e)||ed(e)?iu(e.length,String):[],i=n.length,r=!!i;for(var o in e)(t||it.call(e,o))&&!(r&&(o=="length"||Qu(o,i)))&&n.push(o);return n}function Xn(e,t){for(var n=e.length;n--;)if(Ss(e[n][0],t))return n;return-1}function Yu(e){return Cn.call(e)}function vs(e,t,n,i,r){return e===t?!0:e==null||t==null||!tr(e)&&!nr(t)?e!==e&&t!==t:Bu(e,t,vs,n,i,r)}function Bu(e,t,n,i,r,o){var s=Xi(e),a=Xi(t),l=Gi,u=Gi;s||(l=ht(e),l=l==Gn?sn:l),a||(u=ht(t),u=u==Gn?sn:u);var d=l==sn&&!Ki(e),f=u==sn&&!Ki(t),p=l==u;if(p&&!d)return o||(o=new mt),s||id(e)?Es(e,t,n,i,r,o):Ku(e,t,l,n,i,r,o);if(!(r&Jn)){var g=d&&it.call(e,"__wrapped__"),C=f&&it.call(t,"__wrapped__");if(g||C){var w=g?e.value():e,m=C?t.value():t;return o||(o=new mt),n(w,m,i,r,o)}}return p?(o||(o=new mt),Vu(e,t,n,i,r,o)):!1}function qu(e){if(!tr(e)||Zu(e))return!1;var t=js(e)||Ki(e)?uu:Zf;return t.test(zt(e))}function Gu(e){return nr(e)&&Ps(e.length)&&!!X[Cn.call(e)]}function zu(e){if(!Xu(e))return hu(e);var t=[];for(var n in Object(e))it.call(e,n)&&n!="constructor"&&t.push(n);return t}function Es(e,t,n,i,r,o){var s=r&Jn,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&ds?new Qn:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var g=e[d],C=t[d];if(i)var w=s?i(C,g,d,t,e,o):i(g,C,d,e,t,o);if(w!==void 0){if(w)continue;f=!1;break}if(p){if(!nu(t,function(m,I){if(!p.has(I)&&(g===m||n(g,m,i,r,o)))return p.add(I)})){f=!1;break}}else if(!(g===C||n(g,C,i,r,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function Ku(e,t,n,i,r,o,s){switch(n){case Vn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case xs:return!(e.byteLength!=t.byteLength||!i(new cs(e),new cs(t)));case hs:case ms:case bs:return Ss(+e,+t);case gs:return e.name==t.name&&e.message==t.message;case As:case ws:return e==t+"";case zn:var a=su;case Kn:var l=o&Jn;if(a||(a=lu),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;o|=ds,s.set(e,t);var d=Es(a(e),a(t),i,r,o,s);return s.delete(e),d;case Hf:if(qi)return qi.call(e)==qi.call(t)}return!1}function Vu(e,t,n,i,r,o){var s=r&Jn,a=us(e),l=a.length,u=us(t),d=u.length;if(l!=d&&!s)return!1;for(var f=l;f--;){var p=a[f];if(!(s?p in t:it.call(t,p)))return!1}var g=o.get(e);if(g&&o.get(t))return g==t;var C=!0;o.set(e,t),o.set(t,e);for(var w=s;++f<l;){p=a[f];var m=e[p],I=t[p];if(i)var _=s?i(I,m,p,t,e,o):i(m,I,p,e,t,o);if(!(_===void 0?m===I||n(m,I,i,r,o):_)){C=!1;break}w||(w=p=="constructor")}if(C&&!w){var q=e.constructor,G=t.constructor;q!=G&&"constructor"in e&&"constructor"in t&&!(typeof q=="function"&&q instanceof q&&typeof G=="function"&&G instanceof G)&&(C=!1)}return o.delete(e),o.delete(t),C}function ei(e,t){var n=e.__data__;return Ju(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ln(e,t){var n=ou(e,t);return qu(n)?n:void 0}var ht=Yu;(Vi&&ht(new Vi(new ArrayBuffer(1)))!=Vn||wn&&ht(new wn)!=zn||Qi&&ht(Qi.resolve())!=ns||Ji&&ht(new Ji)!=Kn||Zi&&ht(new Zi)!=zi)&&(ht=function(e){var t=Cn.call(e),n=t==sn?e.constructor:void 0,i=n?zt(n):void 0;if(i)switch(i){case mu:return Vn;case gu:return zn;case yu:return ns;case bu:return Kn;case Au:return zi}return t});function Qu(e,t){return t=t==null?ps:t,!!t&&(typeof e=="number"||Xf.test(e))&&e>-1&&e%1==0&&e<t}function Ju(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Zu(e){return!!as&&as in e}function Xu(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Zn;return e===n}function zt(e){if(e!=null){try{return _s.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ss(e,t){return e===t||e!==e&&t!==t}function ed(e){return td(e)&&it.call(e,"callee")&&(!du.call(e,"callee")||Cn.call(e)==Gn)}var Xi=Array.isArray;function Is(e){return e!=null&&Ps(e.length)&&!js(e)}function td(e){return nr(e)&&Is(e)}function nd(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?vs(e,t,n):!!i}function js(e){var t=tr(e)?Cn.call(e):"";return t==ys||t==Wf}function Ps(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ps}function tr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function nr(e){return!!e&&typeof e=="object"}var id=ss?ru(ss):Gu;function us(e){return Is(e)?ku(e):zu(e)}an.exports=nd});b();b();b();import{notStrictEqual as Wa,strictEqual as Ha}from"assert";b();b();var ma={right:wa,center:xa},ga=0,_n=1,ya=2,vn=3,ar=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 ci(e){return lr(e,{stringWidth:t=>[...t].length,stripAnsi:li,wrap:fr})}b();import{dirname as ur,resolve as dr}from"path";import{readdirSync as Ca,statSync as Oa}from"fs";function pr(e,t){let n=dr(".",e),i;for(Oa(n).isDirectory()||(n=ur(n));;){if(i=t(n,Ca(n)),i)return dr(n,i);if(n=ur(i=n),i===n)break}}import{inspect as ka}from"util";import{readFileSync as Ya}from"fs";import{fileURLToPath as Ba}from"url";b();import{format as Ea}from"util";import{normalize as Sa,resolve as Ia}from"path";b();function Pt(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 En(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 Sn(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)}b();b();function hr(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}b();var Re;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Re||(Re={}));var et,ui=class{constructor(t){et=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=hr(t),o=typeof t=="string",s=_a(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?"--":"_",g=Object.create(null),C=Object.create(null),w=i.__||et.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:[]},I=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,_=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(h){let A=typeof h=="object"?h.key:h,O=Object.keys(h).map(function(x){return{boolean:"bools",string:"strings",number:"numbers"}[x]}).filter(Boolean).pop();O&&(m[O][A]=!0),m.arrays[A]=!0,m.keys.push(A)}),[].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,A])=>{typeof A=="number"&&(m.nargs[h]=A,m.keys.push(h))}),typeof i.coerce=="object"&&Object.entries(i.coerce).forEach(([h,A])=>{typeof A=="function"&&(m.coercions[h]=A,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,A])=>{(typeof A=="boolean"||typeof A=="function")&&(m.configs[h]=A)})),jt(i.key,s,i.default,m.arrays),Object.keys(l).forEach(function(h){(m.aliases[h]||[]).forEach(function(A){l[A]=l[h]})});let q=null;On();let G=[],V=Object.assign(Object.create(null),{_:[]}),ot={};for(let h=0;h<r.length;h++){let A=r[h],O=A.replace(/^-{3,}/,"---"),x,y,F,j,N,de;if(A!=="--"&&ie(A))Ye(A);else if(O.match(/---+(=|$)/)){Ye(A);continue}else if(A.match(/^--.+=/)||!a["short-option-groups"]&&A.match(/^-.+=/))j=A.match(/^--?([^=]+)=([\s\S]*)$/),j!==null&&Array.isArray(j)&&j.length>=3&&($(j[1],m.arrays)?h=St(h,j[1],r,j[2]):$(j[1],m.nargs)!==!1?h=Kt(h,j[1],r,j[2]):Q(j[1],j[2],!0));else if(A.match(_)&&a["boolean-negation"])j=A.match(_),j!==null&&Array.isArray(j)&&j.length>=2&&(y=j[1],Q(y,$(y,m.arrays)?[!1]:!1));else if(A.match(/^--.+/)||!a["short-option-groups"]&&A.match(/^-[^-]+/))j=A.match(/^--?(.+)/),j!==null&&Array.isArray(j)&&j.length>=2&&(y=j[1],$(y,m.arrays)?h=St(h,y,r):$(y,m.nargs)!==!1?h=Kt(h,y,r):(N=r[h+1],N!==void 0&&(!N.match(/^-/)||N.match(I))&&!$(y,m.bools)&&!$(y,m.counts)||/^(true|false)$/.test(N)?(Q(y,N),h++):Q(y,re(y))));else if(A.match(/^-.\..+=/))j=A.match(/^-([^=]+)=([\s\S]*)$/),j!==null&&Array.isArray(j)&&j.length>=3&&Q(j[1],j[2]);else if(A.match(/^-.\..+/)&&!A.match(I))N=r[h+1],j=A.match(/^-(.\..+)/),j!==null&&Array.isArray(j)&&j.length>=2&&(y=j[1],N!==void 0&&!N.match(/^-/)&&!$(y,m.bools)&&!$(y,m.counts)?(Q(y,N),h++):Q(y,re(y)));else if(A.match(/^-[^-]+/)&&!A.match(I)){F=A.slice(1,-1).split(""),x=!1;for(let Ee=0;Ee<F.length;Ee++){if(N=A.slice(Ee+2),F[Ee+1]&&F[Ee+1]==="="){de=A.slice(Ee+3),y=F[Ee],$(y,m.arrays)?h=St(h,y,r,de):$(y,m.nargs)!==!1?h=Kt(h,y,r,de):Q(y,de),x=!0;break}if(N==="-"){Q(F[Ee],N);continue}if(/[A-Za-z]/.test(F[Ee])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(N)&&$(N,m.bools)===!1){Q(F[Ee],N),x=!0;break}if(F[Ee+1]&&F[Ee+1].match(/\W/)){Q(F[Ee],N),x=!0;break}else Q(F[Ee],re(F[Ee]))}y=A.slice(-1)[0],!x&&y!=="-"&&($(y,m.arrays)?h=St(h,y,r):$(y,m.nargs)!==!1?h=Kt(h,y,r):(N=r[h+1],N!==void 0&&(!/^(-|--)[^-]/.test(N)||N.match(I))&&!$(y,m.bools)&&!$(y,m.counts)||/^(true|false)$/.test(N)?(Q(y,N),h++):Q(y,re(y))))}else if(A.match(/^-[0-9]$/)&&A.match(I)&&$(A.slice(1),m.bools))y=A.slice(1),Q(y,re(y));else if(A==="--"){G=r.slice(h+1);break}else if(a["halt-at-non-option"]){G=r.slice(h);break}else Ye(A)}K(V,!0),K(V,!1),Y(V),se(),ne(V,m.aliases,l,!0),fe(V),a["set-placeholder-key"]&&It(V),Object.keys(m.counts).forEach(function(h){Ze(V,h.split("."))||Q(h,0)}),f&&G.length&&(V[p]=[]),G.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(A=>Pt(A)).join(".")],delete V[h]});function Ye(h){let A=R("_",h);(typeof A=="string"||typeof A=="number")&&V._.push(A)}function Kt(h,A,O,x){let y,F=$(A,m.nargs);if(F=typeof F!="number"||isNaN(F)?1:F,F===0)return qe(x)||(q=Error(w("Argument unexpected for: %s",A))),Q(A,re(A)),h;let j=qe(x)?0:1;if(a["nargs-eats-options"])O.length-(h+1)+j<F&&(q=Error(w("Not enough arguments following: %s",A))),j=F;else{for(y=h+1;y<O.length&&(!O[y].match(/^-[^0-9]/)||O[y].match(I)||ie(O[y]));y++)j++;j<F&&(q=Error(w("Not enough arguments following: %s",A)))}let N=Math.min(j,F);for(!qe(x)&&N>0&&(Q(A,x),N--),y=h+1;y<N+h+1;y++)Q(A,O[y]);return h+N}function St(h,A,O,x){let y=[],F=x||O[h+1],j=$(A,m.nargs);if($(A,m.bools)&&!/^(true|false)$/.test(F))y.push(!0);else if(qe(F)||qe(x)&&/^-/.test(F)&&!I.test(F)&&!ie(F)){if(l[A]!==void 0){let N=l[A];y=Array.isArray(N)?N:[N]}}else{qe(x)||y.push(S(A,x,!0));for(let N=h+1;N<O.length&&!(!a["greedy-arrays"]&&y.length>0||j&&typeof j=="number"&&y.length>=j||(F=O[N],/^-/.test(F)&&!I.test(F)&&!ie(F)));N++)h=N,y.push(S(A,F,o))}return typeof j=="number"&&(j&&y.length<j||isNaN(j)&&y.length===0)&&(q=Error(w("Not enough arguments following: %s",A))),Q(A,y),h}function Q(h,A,O=o){if(/-/.test(h)&&a["camel-case-expansion"]){let F=h.split(".").map(function(j){return Pt(j)}).join(".");L(h,F)}let x=S(h,A,O),y=h.split(".");Xe(V,y,x),m.aliases[h]&&m.aliases[h].forEach(function(F){let j=F.split(".");Xe(V,j,x)}),y.length>1&&a["dot-notation"]&&(m.aliases[y[0]]||[]).forEach(function(F){let j=F.split("."),N=[].concat(y);N.shift(),j=j.concat(N),(m.aliases[h]||[]).includes(j.join("."))||Xe(V,j,x)}),$(h,m.normalize)&&!$(h,m.arrays)&&[h].concat(m.aliases[h]||[]).forEach(function(j){Object.defineProperty(ot,j,{enumerable:!0,get(){return A},set(N){A=typeof N=="string"?et.normalize(N):N}})})}function L(h,A){m.aliases[h]&&m.aliases[h].length||(m.aliases[h]=[A],g[A]=!0),m.aliases[A]&&m.aliases[A].length||L(A,h)}function S(h,A,O){O&&(A=va(A)),($(h,m.bools)||$(h,m.counts))&&typeof A=="string"&&(A=A==="true");let x=Array.isArray(A)?A.map(function(y){return R(h,y)}):R(h,A);return $(h,m.counts)&&(qe(x)||typeof x=="boolean")&&(x=fi()),$(h,m.normalize)&&$(h,m.arrays)&&(Array.isArray(A)?x=A.map(y=>et.normalize(y)):x=et.normalize(A)),x}function R(h,A){return!a["parse-positional-numbers"]&&h==="_"||!$(h,m.strings)&&!$(h,m.bools)&&!Array.isArray(A)&&(Sn(A)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${A}`)))||!qe(A)&&$(h,m.numbers))&&(A=Number(A)),A}function Y(h){let A=Object.create(null);ne(A,m.aliases,l),Object.keys(m.configs).forEach(function(O){let x=h[O]||A[O];if(x)try{let y=null,F=et.resolve(et.cwd(),x),j=m.configs[O];if(typeof j=="function"){try{y=j(F)}catch(N){y=N}if(y instanceof Error){q=y;return}}else y=et.require(F);J(y)}catch(y){y.name==="PermissionDenied"?q=y:h[O]&&(q=Error(w("Invalid JSON config file: %s",x)))}})}function J(h,A){Object.keys(h).forEach(function(O){let x=h[O],y=A?A+"."+O:O;typeof x=="object"&&x!==null&&!Array.isArray(x)&&a["dot-notation"]?J(x,y):(!Ze(V,y.split("."))||$(y,m.arrays)&&a["combine-arrays"])&&Q(y,x)})}function se(){typeof u!="undefined"&&u.forEach(function(h){J(h)})}function K(h,A){if(typeof d=="undefined")return;let O=typeof d=="string"?d:"",x=et.env();Object.keys(x).forEach(function(y){if(O===""||y.lastIndexOf(O,0)===0){let F=y.split("__").map(function(j,N){return N===0&&(j=j.substring(O.length)),Pt(j)});(A&&m.configs[F.join(".")]||!A)&&!Ze(h,F)&&Q(F.join("."),x[y])}})}function fe(h){let A,O=new Set;Object.keys(h).forEach(function(x){if(!O.has(x)&&(A=$(x,m.coercions),typeof A=="function"))try{let y=R(x,A(h[x]));[].concat(m.aliases[x]||[],x).forEach(F=>{O.add(F),h[F]=y})}catch(y){q=y}})}function It(h){return m.keys.forEach(A=>{~A.indexOf(".")||typeof h[A]=="undefined"&&(h[A]=void 0)}),h}function ne(h,A,O,x=!1){Object.keys(O).forEach(function(y){Ze(h,y.split("."))||(Xe(h,y.split("."),O[y]),x&&(C[y]=!0),(A[y]||[]).forEach(function(F){Ze(h,F.split("."))||Xe(h,F.split("."),O[y])}))})}function Ze(h,A){let O=h;a["dot-notation"]||(A=[A.join(".")]),A.slice(0,-1).forEach(function(y){O=O[y]||{}});let x=A[A.length-1];return typeof O!="object"?!1:x in O}function Xe(h,A,O){let x=h;a["dot-notation"]||(A=[A.join(".")]),A.slice(0,-1).forEach(function(de){de=mr(de),typeof x=="object"&&x[de]===void 0&&(x[de]={}),typeof x[de]!="object"||Array.isArray(x[de])?(Array.isArray(x[de])?x[de].push({}):x[de]=[x[de],{}],x=x[de][x[de].length-1]):x=x[de]});let y=mr(A[A.length-1]),F=$(A.join("."),m.arrays),j=Array.isArray(O),N=a["duplicate-arguments-array"];!N&&$(y,m.nargs)&&(N=!0,(!qe(x[y])&&m.nargs[y]===1||Array.isArray(x[y])&&x[y].length===m.nargs[y])&&(x[y]=void 0)),O===fi()?x[y]=fi(x[y]):Array.isArray(x[y])?N&&F&&j?x[y]=a["flatten-duplicate-arrays"]?x[y].concat(O):(Array.isArray(x[y][0])?x[y]:[x[y]]).concat([O]):!N&&Boolean(F)===Boolean(j)?x[y]=O:x[y]=x[y].concat([O]):x[y]===void 0&&F?x[y]=j?O:[O]:N&&!(x[y]===void 0||$(y,m.counts)||$(y,m.bools))?x[y]=[x[y],O]:x[y]=O}function jt(...h){h.forEach(function(A){Object.keys(A||{}).forEach(function(O){m.aliases[O]||(m.aliases[O]=[].concat(s[O]||[]),m.aliases[O].concat(O).forEach(function(x){if(/-/.test(x)&&a["camel-case-expansion"]){let y=Pt(x);y!==O&&m.aliases[O].indexOf(y)===-1&&(m.aliases[O].push(y),g[y]=!0)}}),m.aliases[O].concat(O).forEach(function(x){if(x.length>1&&/[A-Z]/.test(x)&&a["camel-case-expansion"]){let y=En(x,"-");y!==O&&m.aliases[O].indexOf(y)===-1&&(m.aliases[O].push(y),g[y]=!0)}}),m.aliases[O].forEach(function(x){m.aliases[x]=[O].concat(m.aliases[O].filter(function(y){return x!==y}))}))})})}function $(h,A){let O=[].concat(m.aliases[h]||[],h),x=Object.keys(A),y=O.find(F=>x.includes(F));return y?A[y]:!1}function ai(h){let A=Object.keys(m);return[].concat(A.map(x=>m[x])).some(function(x){return Array.isArray(x)?x.includes(h):x[h]})}function U(h,...A){return[].concat(...A).some(function(x){let y=h.match(x);return y&&ai(y[1])})}function ee(h){if(h.match(I)||!h.match(/^-[^-]+/))return!1;let A=!0,O,x=h.slice(1).split("");for(let y=0;y<x.length;y++){if(O=h.slice(y+2),!ai(x[y])){A=!1;break}if(x[y+1]&&x[y+1]==="="||O==="-"||/[A-Za-z]/.test(x[y])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(O)||x[y+1]&&x[y+1].match(/\W/))break}return A}function ie(h){return a["unknown-options-as-args"]&&z(h)}function z(h){return h=h.replace(/^-{3,}/,"--"),h.match(I)||ee(h)?!1:!U(h,/^-+([^=]+?)=[\s\S]*$/,_,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function re(h){return!$(h,m.bools)&&!$(h,m.counts)&&`${h}`in l?l[h]:ae(Be(h))}function ae(h){return{[Re.BOOLEAN]:!0,[Re.STRING]:"",[Re.NUMBER]:void 0,[Re.ARRAY]:[]}[h]}function Be(h){let A=Re.BOOLEAN;return $(h,m.strings)?A=Re.STRING:$(h,m.numbers)?A=Re.NUMBER:$(h,m.bools)?A=Re.BOOLEAN:$(h,m.arrays)&&(A=Re.ARRAY),A}function qe(h){return h===void 0}function On(){Object.keys(m.counts).find(h=>$(h,m.arrays)?(q=Error(w("Invalid configuration: %s, opts.count excludes opts.array.",h)),!0):$(h,m.nargs)?(q=Error(w("Invalid configuration: %s, opts.count excludes opts.narg.",h)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(ot,V),configuration:a,defaulted:Object.assign({},C),error:q,newAliases:Object.assign({},g)}}};function _a(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 fi(e){return e!==void 0?e+1:1}function mr(e){return e==="__proto__"?"___proto___":e}function va(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}import{readFileSync as ja}from"fs";var gr=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])<gr)throw Error(`yargs parser supports a minimum Node.js version of ${gr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Pa=process?process.env:{},yr=new ui({cwd:process.cwd,env:()=>Pa,format:Ea,normalize:Sa,resolve:Ia,require:e=>{if(typeof ze!="undefined")return ze(e);if(e.match(/\.json$/))return JSON.parse(ja(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),fn=function(t,n){return yr.parse(t.slice(),n).argv};fn.detailed=function(e,t){return yr.parse(e.slice(),t)};fn.camelCase=Pt;fn.decamelize=En;fn.looksLikeNumber=Sn;var br=fn;import{basename as qa,dirname as Ga,extname as za,relative as Ka,resolve as _r}from"path";b();function Ma(){return Fa()?0:1}function Fa(){return La()&&!process.defaultApp}function La(){return!!process.versions.electron}function Ar(){return process.argv[Ma()]}b();var Z=class extends Error{constructor(t){super(t||"yargs error");this.name="YError",Error.captureStackTrace(this,Z)}};b();b();import{readFileSync as Da,statSync as Na,writeFile as Ta}from"fs";import{format as Ra}from"util";import{resolve as Ua}from"path";var wr={fs:{readFileSync:Da,writeFile:Ta},format:Ra,resolve:Ua,exists:e=>{try{return Na(e).isFile()}catch(t){return!1}}};b();var Ge,xr=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(),Ge.format.apply(Ge.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),Ge.format.apply(Ge.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);Ge.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{Ge.fs.readFileSync&&(t=JSON.parse(Ge.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=Ge.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(i)&&~n.lastIndexOf("_")){let r=Ge.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(i=r)}return i}_fileExistsSync(t){return Ge.exists(t)}};function Cr(e,t){Ge=t;let n=new xr(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 $a=e=>Cr(e,wr),Or=$a;var Ja={},Va="require is not supported by ESM",vr="loading a directory of commands is not supported yet for ESM",In;try{In=Ba(Ja.url)}catch(e){In=process.cwd()}var Qa=In.split("node_modules")[0],Er={assert:{notStrictEqual:Wa,strictEqual:Ha},cliui:ci,findUp:pr,getEnv:e=>process.env[e],inspect:ka,getCallerFile:()=>{throw new Z(vr)},getProcessArgvBin:Ar,mainFilename:Qa||process.cwd(),Parser:br,path:{basename:qa,dirname:Ga,extname:za,relative:Ka,resolve:_r},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:Ya,require:()=>{throw new Z(Va)},requireDirectory:()=>{throw new Z(vr)},stringWidth:e=>[...e].length,y18n:Or({directory:_r(In,"../../../locales"),updateFiles:!1})};b();b();b();function Se(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function di(e,t){t.assert.strictEqual(typeof e,"string")}function Vt(e){return Object.keys(e)}b();function te(e){return!!e&&!!e.then&&typeof e.then=="function"}b();b();b();function st(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 Za=["first","second","third","fourth","fifth","sixth"];function P(e,t,n){function i(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[st(`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(),g=Sr(p);f.cmd.filter(w=>w===g||w==="*").length===0&&Ir(g,f.cmd,r),r+=1}),o.optional.forEach(f=>{if(l.length===0)return;let p=l.shift(),g=Sr(p);f.cmd.filter(w=>w===g||w==="*").length===0&&Ir(g,f.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function Sr(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function Ir(e,t,n){throw new Z(`Invalid ${Za[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var pi=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,i=!0,r=!1){if(P("<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 jr(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Mt(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)}b();function Ft(e,t,n=i=>{throw i}){try{let i=Xa(e)?e():e;return te(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function Xa(e){return typeof e=="function"}b();function hi(e){if(typeof ze=="undefined")return null;for(let t=0,n=Object.keys(ze.cache),i;t<n.length;t++)if(i=ze.cache[n[t]],i.exports===e)return i;return null}var Qt=/(^\*)|(^\$0)/,Mr=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=jr(o);if(r=r||(()=>{}),Array.isArray(t))if(el(t))[t,...a]=t;else for(let u of t)this.addHandler(u);else if(nl(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(Pr(i)){this.addHandler([t].concat(a),n,i.builder,i.handler,i.middlewares,i.deprecated);return}if(typeof t=="string"){let u=st(t);a=a.map(p=>st(p).cmd);let d=!1,f=[u.cmd].concat(a).filter(p=>Qt.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(Qt,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(jn(u)){let f=u(i.getInternalMethods().reset(r),l);if(te(f))return f.then(p=>(d=Lr(p)?p:i,this.parseAndUpdateUsage(t,n,d,o,s,a)))}else tl(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=Qt.test(n.original)?n.original.replace(Qt,"").trim():n.original,r=t.filter(o=>!Qt.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=Mt(i,a,u,!0),!a.getInternalMethods().getHasOutput()){let d=a.getInternalMethods().runValidation(s,l,a.parsed.error,t);i=Ft(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=Mt(i,a,u,!1),i=Ft(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=st(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=Qt.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(jn(n))return n(t,!0);Pr(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=hi(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;Se(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();Se(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 Fr(e,t,n,i){return new Mr(e,t,n,i)}function Pr(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function el(e){return e.every(t=>typeof t=="string")}function jn(e){return typeof e=="function"}function tl(e){return typeof e=="object"}function nl(e){return typeof e=="object"&&!Array.isArray(e)}b();b();function at(e={},t=()=>!0){let n={};return Vt(e).forEach(i=>{t(i,e[i])&&(n[i]=e[i])}),n}b();function lt(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 il(e){return typeof e=="boolean"}function Nr(e,t){let n=t.y18n.__,i={},r=[];i.failFn=function(S){r.push(S)};let o=null,s=!0;i.showHelpOnFail=function(S=!0,R){function Y(){return typeof S=="string"?[!0,S]:[S,R]}let[J,se]=Y();return o=se,s=J,i};let a=!1;i.fail=function(S,R){let Y=e.getInternalMethods().getLoggerInstance();if(r.length)for(let J=r.length-1;J>=0;--J){let se=r[J];if(il(se)){if(R)throw R;if(S)throw Error(S)}else se(S,R,i)}else{if(e.getExitProcess()&<(!0),a||(a=!0,s&&(e.showHelp("error"),Y.error()),(S||R)&&Y.error(S||R),o&&((S||R)&&Y.error(""),Y.error(o))),R=R||new Z(S),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,R);throw R}};let l=[],u=!1;i.usage=(L,S)=>L===null?(u=!0,l=[],i):(u=!1,l.push([L,S||""]),i),i.getUsage=()=>l,i.getUsageDisabled=()=>u,i.getPositionalGroupName=()=>n("Positionals:");let d=[];i.example=(L,S)=>{d.push([L,S||""])};let f=[];i.command=function(S,R,Y,J,se=!1){Y&&(f=f.map(K=>(K[2]=!1,K))),f.push([S,R||"",Y,J,se])},i.getCommands=()=>f;let p={};i.describe=function(S,R){Array.isArray(S)?S.forEach(Y=>{i.describe(Y,R)}):typeof S=="object"?Object.keys(S).forEach(Y=>{i.describe(Y,S[Y])}):p[S]=R},i.getDescriptions=()=>p;let g=[];i.epilog=L=>{g.push(L)};let C=!1,w;i.wrap=L=>{C=!0,w=L};function m(){return C||(w=Kt(),C=!0),w}let I="__yargsString__:";i.deferY18nLookup=L=>I+L,i.help=function(){if(G)return G;q();let S=e.customScriptName?e.$0:t.path.basename(e.$0),R=e.getDemandedOptions(),Y=e.getDemandedCommands(),J=e.getDeprecatedOptions(),se=e.getGroups(),K=e.getOptions(),fe=[];fe=fe.concat(Object.keys(p)),fe=fe.concat(Object.keys(R)),fe=fe.concat(Object.keys(Y)),fe=fe.concat(Object.keys(K.default)),fe=fe.filter(ot),fe=Object.keys(fe.reduce((U,ee)=>(ee!=="_"&&(U[ee]=!0),U),{}));let It=m(),ne=t.cliui({width:It,wrap:!!It});if(!u){if(l.length)l.forEach(U=>{ne.div({text:`${U[0].replace(/\$0/g,S)}`}),U[1]&&ne.div({text:`${U[1]}`,padding:[1,0,0,0]})}),ne.div();else if(f.length){let U=null;Y._?U=`${S} <${n("command")}>
|
7
|
-
|
8
|
-
|
9
|
-
`)
|
10
|
-
`)
|
1
|
+
var sc=Object.create;var nr=Object.defineProperty;var ac=Object.getOwnPropertyDescriptor;var lc=Object.getOwnPropertyNames;var cc=Object.getPrototypeOf,fc=Object.prototype.hasOwnProperty;var uc=(e,t,n)=>t in e?nr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dc=e=>nr(e,"__esModule",{value:!0});var Se=(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')});var pc=(e,t)=>()=>(e&&(t=e(e=0)),t);var ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var hc=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of lc(t))!fc.call(e,i)&&(n||i!=="default")&&nr(e,i,{get:()=>t[i],enumerable:!(r=ac(t,i))||r.enumerable});return e},io=(e,t)=>hc(dc(nr(e!=null?sc(cc(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var oo=(e,t,n)=>(uc(e,typeof t!="symbol"?t+"":t,n),n),mc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var se=(e,t,n)=>(mc(e,t,"read from private field"),n?n.call(e):t.get(e)),Ge=(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 y=pc(()=>{});var Na=ot((Hn,Cn)=>{y();var sp=200,Gi="__lodash_hash_undefined__",ya=1,Ir=2,ba=9007199254740991,_r="[object Arguments]",Ni="[object Array]",wa="[object Boolean]",Aa="[object Date]",xa="[object Error]",Ca="[object Function]",ap="[object GeneratorFunction]",Sr="[object Map]",va="[object Number]",xn="[object Object]",aa="[object Promise]",Oa="[object RegExp]",jr="[object Set]",Ea="[object String]",lp="[object Symbol]",ki="[object WeakMap]",_a="[object ArrayBuffer]",Pr="[object DataView]",cp="[object Float32Array]",fp="[object Float64Array]",up="[object Int8Array]",dp="[object Int16Array]",pp="[object Int32Array]",hp="[object Uint8Array]",mp="[object Uint8ClampedArray]",gp="[object Uint16Array]",yp="[object Uint32Array]",bp=/[\\^$.*+?()[\]{}|]/g,wp=/^\[object .+?Constructor\]$/,Ap=/^(?:0|[1-9]\d*)$/,ie={};ie[cp]=ie[fp]=ie[up]=ie[dp]=ie[pp]=ie[hp]=ie[mp]=ie[gp]=ie[yp]=!0;ie[_r]=ie[Ni]=ie[_a]=ie[wa]=ie[Pr]=ie[Aa]=ie[xa]=ie[Ca]=ie[Sr]=ie[va]=ie[xn]=ie[Oa]=ie[jr]=ie[Ea]=ie[ki]=!1;var Sa=typeof global=="object"&&global&&global.Object===Object&&global,xp=typeof self=="object"&&self&&self.Object===Object&&self,Mt=Sa||xp||Function("return this")(),ja=typeof Hn=="object"&&Hn&&!Hn.nodeType&&Hn,la=ja&&typeof Cn=="object"&&Cn&&!Cn.nodeType&&Cn,Cp=la&&la.exports===ja,ca=Cp&&Sa.process,fa=function(){try{return ca&&ca.binding("util")}catch(e){}}(),ua=fa&&fa.isTypedArray;function vp(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function Op(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ep(e){return function(t){return e(t)}}function _p(e,t){return e==null?void 0:e[t]}function Ri(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function Sp(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function jp(e,t){return function(n){return e(t(n))}}function Pp(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Mp=Array.prototype,Ip=Function.prototype,Fr=Object.prototype,Li=Mt["__core-js_shared__"],da=function(){var e=/[^.]+$/.exec(Li&&Li.keys&&Li.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Pa=Ip.toString,bt=Fr.hasOwnProperty,Yn=Fr.toString,Fp=RegExp("^"+Pa.call(bt).replace(bp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pa=Mt.Symbol,ha=Mt.Uint8Array,Tp=Fr.propertyIsEnumerable,Lp=Mp.splice,Dp=jp(Object.keys,Object),Ui=vn(Mt,"DataView"),Gn=vn(Mt,"Map"),$i=vn(Mt,"Promise"),Wi=vn(Mt,"Set"),Bi=vn(Mt,"WeakMap"),qn=vn(Object,"create"),Np=ln(Ui),kp=ln(Gn),Rp=ln($i),Up=ln(Wi),$p=ln(Bi),ma=pa?pa.prototype:void 0,Di=ma?ma.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 Wp(){this.__data__=qn?qn(null):{}}function Bp(e){return this.has(e)&&delete this.__data__[e]}function Hp(e){var t=this.__data__;if(qn){var n=t[e];return n===Gi?void 0:n}return bt.call(t,e)?t[e]:void 0}function Gp(e){var t=this.__data__;return qn?t[e]!==void 0:bt.call(t,e)}function qp(e,t){var n=this.__data__;return n[e]=qn&&t===void 0?Gi:t,this}sn.prototype.clear=Wp;sn.prototype.delete=Bp;sn.prototype.get=Hp;sn.prototype.has=Gp;sn.prototype.set=qp;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 Yp(){this.__data__=[]}function zp(e){var t=this.__data__,n=Tr(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Lp.call(t,n,1),!0}function Vp(e){var t=this.__data__,n=Tr(t,e);return n<0?void 0:t[n][1]}function Kp(e){return Tr(this.__data__,e)>-1}function Qp(e,t){var n=this.__data__,r=Tr(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}wt.prototype.clear=Yp;wt.prototype.delete=zp;wt.prototype.get=Vp;wt.prototype.has=Kp;wt.prototype.set=Qp;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 Jp(){this.__data__={hash:new sn,map:new(Gn||wt),string:new sn}}function Xp(e){return Lr(this,e).delete(e)}function Zp(e){return Lr(this,e).get(e)}function eh(e){return Lr(this,e).has(e)}function th(e,t){return Lr(this,e).set(e,t),this}an.prototype.clear=Jp;an.prototype.delete=Xp;an.prototype.get=Zp;an.prototype.has=eh;an.prototype.set=th;function Mr(e){var t=-1,n=e?e.length:0;for(this.__data__=new an;++t<n;)this.add(e[t])}function nh(e){return this.__data__.set(e,Gi),this}function rh(e){return this.__data__.has(e)}Mr.prototype.add=Mr.prototype.push=nh;Mr.prototype.has=rh;function Pt(e){this.__data__=new wt(e)}function ih(){this.__data__=new wt}function oh(e){return this.__data__.delete(e)}function sh(e){return this.__data__.get(e)}function ah(e){return this.__data__.has(e)}function lh(e,t){var n=this.__data__;if(n instanceof wt){var r=n.__data__;if(!Gn||r.length<sp-1)return r.push([e,t]),this;n=this.__data__=new an(r)}return n.set(e,t),this}Pt.prototype.clear=ih;Pt.prototype.delete=oh;Pt.prototype.get=sh;Pt.prototype.has=ah;Pt.prototype.set=lh;function ch(e,t){var n=Hi(e)||xh(e)?Op(e.length,String):[],r=n.length,i=!!r;for(var s in e)(t||bt.call(e,s))&&!(i&&(s=="length"||yh(s,r)))&&n.push(s);return n}function Tr(e,t){for(var n=e.length;n--;)if(Fa(e[n][0],t))return n;return-1}function fh(e){return Yn.call(e)}function Ma(e,t,n,r,i){return e===t?!0:e==null||t==null||!qi(e)&&!Yi(t)?e!==e&&t!==t:uh(e,t,Ma,n,r,i)}function uh(e,t,n,r,i,s){var o=Hi(e),a=Hi(t),l=Ni,f=Ni;o||(l=jt(e),l=l==_r?xn:l),a||(f=jt(t),f=f==_r?xn:f);var u=l==xn&&!Ri(e),c=f==xn&&!Ri(t),d=l==f;if(d&&!u)return s||(s=new Pt),o||Oh(e)?Ia(e,t,n,r,i,s):mh(e,t,l,n,r,i,s);if(!(i&Ir)){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),gh(e,t,n,r,i,s)):!1}function dh(e){if(!qi(e)||wh(e))return!1;var t=La(e)||Ri(e)?Fp:wp;return t.test(ln(e))}function ph(e){return Yi(e)&&Da(e.length)&&!!ie[Yn.call(e)]}function hh(e){if(!Ah(e))return Dp(e);var t=[];for(var n in Object(e))bt.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ia(e,t,n,r,i,s){var o=i&Ir,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&ya?new Mr: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(!vp(t,function(m,E){if(!d.has(E)&&(h===m||n(h,m,r,i,s)))return d.add(E)})){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 mh(e,t,n,r,i,s,o){switch(n){case Pr: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 ha(e),new ha(t)));case wa:case Aa:case va:return Fa(+e,+t);case xa:return e.name==t.name&&e.message==t.message;case Oa:case Ea:return e==t+"";case Sr:var a=Sp;case jr:var l=s&Ir;if(a||(a=Pp),e.size!=t.size&&!l)return!1;var f=o.get(e);if(f)return f==t;s|=ya,o.set(e,t);var u=Ia(a(e),a(t),r,i,s,o);return o.delete(e),u;case lp:if(Di)return Di.call(e)==Di.call(t)}return!1}function gh(e,t,n,r,i,s){var o=i&Ir,a=ga(e),l=a.length,f=ga(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],E=t[d];if(r)var _=o?r(E,m,d,t,e,s):r(m,E,d,e,t,s);if(!(_===void 0?m===E||n(m,E,r,i,s):_)){b=!1;break}g||(g=d=="constructor")}if(b&&!g){var B=e.constructor,G=t.constructor;B!=G&&"constructor"in e&&"constructor"in t&&!(typeof B=="function"&&B instanceof B&&typeof G=="function"&&G instanceof G)&&(b=!1)}return s.delete(e),s.delete(t),b}function Lr(e,t){var n=e.__data__;return bh(t)?n[typeof t=="string"?"string":"hash"]:n.map}function vn(e,t){var n=_p(e,t);return dh(n)?n:void 0}var jt=fh;(Ui&&jt(new Ui(new ArrayBuffer(1)))!=Pr||Gn&&jt(new Gn)!=Sr||$i&&jt($i.resolve())!=aa||Wi&&jt(new Wi)!=jr||Bi&&jt(new Bi)!=ki)&&(jt=function(e){var t=Yn.call(e),n=t==xn?e.constructor:void 0,r=n?ln(n):void 0;if(r)switch(r){case Np:return Pr;case kp:return Sr;case Rp:return aa;case Up:return jr;case $p:return ki}return t});function yh(e,t){return t=t==null?ba:t,!!t&&(typeof e=="number"||Ap.test(e))&&e>-1&&e%1==0&&e<t}function bh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function wh(e){return!!da&&da in e}function Ah(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Fr;return e===n}function ln(e){if(e!=null){try{return Pa.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Fa(e,t){return e===t||e!==e&&t!==t}function xh(e){return Ch(e)&&bt.call(e,"callee")&&(!Tp.call(e,"callee")||Yn.call(e)==_r)}var Hi=Array.isArray;function Ta(e){return e!=null&&Da(e.length)&&!La(e)}function Ch(e){return Yi(e)&&Ta(e)}function vh(e,t,n){n=typeof n=="function"?n:void 0;var r=n?n(e,t):void 0;return r===void 0?Ma(e,t,n):!!r}function La(e){var t=qi(e)?Yn.call(e):"";return t==Ca||t==ap}function Da(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ba}function qi(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Yi(e){return!!e&&typeof e=="object"}var Oh=ua?Ep(ua):ph;function ga(e){return Ta(e)?ch(e):hh(e)}Cn.exports=vh});var il=ot((xb,rl)=>{"use strict";y();rl.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 zi=ot((Cb,sl)=>{y();var Kn=il(),ol={};for(let e of Object.keys(Kn))ol[Kn[e]]=e;var D={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"]}};sl.exports=D;for(let e of Object.keys(D)){if(!("channels"in D[e]))throw new Error("missing channels property: "+e);if(!("labels"in D[e]))throw new Error("missing channel labels property: "+e);if(D[e].labels.length!==D[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=D[e];delete D[e].channels,delete D[e].labels,Object.defineProperty(D[e],"channels",{value:t}),Object.defineProperty(D[e],"labels",{value:n})}D.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]};D.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]};D.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=D.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]};D.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 Yh(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}D.rgb.keyword=function(e){let t=ol[e];if(t)return t;let n=1/0,r;for(let i of Object.keys(Kn)){let s=Kn[i],o=Yh(e,s);o<n&&(n=o,r=i)}return r};D.keyword.rgb=function(e){return Kn[e]};D.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]};D.rgb.lab=function(e){let t=D.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]};D.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};D.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]};D.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]}};D.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]};D.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]};D.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]};D.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]};D.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]};D.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]};D.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]};D.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]};D.rgb.ansi16=function(e,t=null){let[n,r,i]=e,s=t===null?D.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};D.hsv.ansi16=function(e){return D.rgb.ansi16(D.hsv.rgb(e),e[2])};D.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)};D.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]};D.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]};D.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};D.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]};D.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]};D.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]};D.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]};D.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]};D.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]};D.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]};D.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]};D.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]};D.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};D.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};D.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};D.gray.hsl=function(e){return[0,0,e[0]]};D.gray.hsv=D.gray.hsl;D.gray.hwb=function(e){return[0,100,e[0]]};D.gray.cmyk=function(e){return[0,0,0,e[0]]};D.gray.lab=function(e){return[e[0],0,0]};D.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};D.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var ll=ot((vb,al)=>{y();var Rr=zi();function zh(){let e={},t=Object.keys(Rr);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function Vh(e){let t=zh(),n=[e];for(t[e].distance=0;n.length;){let r=n.pop(),i=Object.keys(Rr[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 Kh(e,t){return function(n){return t(e(n))}}function Qh(e,t){let n=[t[e].parent,e],r=Rr[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=Kh(Rr[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}al.exports=function(e){let t=Vh(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]=Qh(o,t))}return n}});var fl=ot((Ob,cl)=>{y();var Vi=zi(),Jh=ll(),Sn={},Xh=Object.keys(Vi);function Zh(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 em(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}Xh.forEach(e=>{Sn[e]={},Object.defineProperty(Sn[e],"channels",{value:Vi[e].channels}),Object.defineProperty(Sn[e],"labels",{value:Vi[e].labels});let t=Jh(e);Object.keys(t).forEach(r=>{let i=t[r];Sn[e][r]=em(i),Sn[e][r].raw=Zh(i)})});cl.exports=Sn});var gl=ot((Eb,ml)=>{"use strict";y();var ul=(e,t)=>(...n)=>`\x1B[${e(...n)+t}m`,dl=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};5;${r}m`},pl=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},Ur=e=>e,hl=(e,t,n)=>[e,t,n],jn=(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})},Ki,Pn=(e,t,n,r)=>{Ki===void 0&&(Ki=fl());let i=r?10:0,s={};for(let[o,a]of Object.entries(Ki)){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 tm(){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",jn(t.color,"ansi",()=>Pn(ul,"ansi16",Ur,!1)),jn(t.color,"ansi256",()=>Pn(dl,"ansi256",Ur,!1)),jn(t.color,"ansi16m",()=>Pn(pl,"rgb",hl,!1)),jn(t.bgColor,"ansi",()=>Pn(ul,"ansi16",Ur,!0)),jn(t.bgColor,"ansi256",()=>Pn(dl,"ansi256",Ur,!0)),jn(t.bgColor,"ansi16m",()=>Pn(pl,"rgb",hl,!0)),t}Object.defineProperty(ml,"exports",{enumerable:!0,get:tm})});var bl=ot((_b,yl)=>{"use strict";y();yl.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 xl=ot((Sb,Al)=>{"use strict";y();var nm=Se("os"),wl=Se("tty"),nt=bl(),{env:Fe}=process,Dt;nt("no-color")||nt("no-colors")||nt("color=false")||nt("color=never")?Dt=0:(nt("color")||nt("colors")||nt("color=true")||nt("color=always"))&&(Dt=1);"FORCE_COLOR"in Fe&&(Fe.FORCE_COLOR==="true"?Dt=1:Fe.FORCE_COLOR==="false"?Dt=0:Dt=Fe.FORCE_COLOR.length===0?1:Math.min(parseInt(Fe.FORCE_COLOR,10),3));function Qi(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Ji(e,t){if(Dt===0)return 0;if(nt("color=16m")||nt("color=full")||nt("color=truecolor"))return 3;if(nt("color=256"))return 2;if(e&&!t&&Dt===void 0)return 0;let n=Dt||0;if(Fe.TERM==="dumb")return n;if(process.platform==="win32"){let r=nm.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Fe)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Fe)||Fe.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Fe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Fe.TEAMCITY_VERSION)?1:0;if(Fe.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Fe){let r=parseInt((Fe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Fe.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Fe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Fe.TERM)||"COLORTERM"in Fe?1:n}function rm(e){let t=Ji(e,e&&e.isTTY);return Qi(t)}Al.exports={supportsColor:rm,stdout:Qi(Ji(!0,wl.isatty(1))),stderr:Qi(Ji(!0,wl.isatty(2)))}});var vl=ot((jb,Cl)=>{"use strict";y();var im=(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},om=(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};Cl.exports={stringReplaceAll:im,stringEncaseCRLFWithFirstIndex:om}});var jl=ot((Pb,Sl)=>{"use strict";y();var sm=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Ol=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,am=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,lm=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,cm=new Map([["n",`
|
5
|
+
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function _l(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)):cm.get(e)||e}function fm(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(am))n.push(i[2].replace(lm,(a,l,f)=>l?_l(l):f));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return n}function um(e){Ol.lastIndex=0;let t=[],n;for(;(n=Ol.exec(e))!==null;){let r=n[1];if(n[2]){let i=fm(r,n[2]);t.push([r].concat(i))}else t.push([r])}return t}function El(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}Sl.exports=(e,t)=>{let n=[],r=[],i=[];if(t.replace(sm,(s,o,a,l,f,u)=>{if(o)i.push(_l(o));else if(l){let c=i.join("");i=[],r.push(n.length===0?c:El(e,n)(c)),n.push({inverse:a,styles:um(l)})}else if(f){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");r.push(El(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 Nl=ot((Mb,Dl)=>{"use strict";y();var Qn=gl(),{stdout:Zi,stderr:eo}=xl(),{stringReplaceAll:dm,stringEncaseCRLFWithFirstIndex:pm}=vl(),{isArray:$r}=Array,Ml=["ansi","ansi","ansi256","ansi16m"],Mn=Object.create(null),hm=(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=Zi?Zi.level:0;e.level=t.level===void 0?n:t.level},Il=class{constructor(t){return Fl(t)}},Fl=e=>{let t={};return hm(t,e),t.template=(...n)=>Ll(t.template,...n),Object.setPrototypeOf(t,Wr.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=Il,t.template};function Wr(e){return Fl(e)}for(let[e,t]of Object.entries(Qn))Mn[e]={get(){let n=Br(this,to(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};Mn.visible={get(){let e=Br(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Tl=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of Tl)Mn[e]={get(){let{level:t}=this;return function(...n){let r=to(Qn.color[Ml[t]][e](...n),Qn.color.close,this._styler);return Br(this,r,this._isEmpty)}}};for(let e of Tl){let t="bg"+e[0].toUpperCase()+e.slice(1);Mn[t]={get(){let{level:n}=this;return function(...r){let i=to(Qn.bgColor[Ml[n]][e](...r),Qn.bgColor.close,this._styler);return Br(this,i,this._isEmpty)}}}}var mm=Object.defineProperties(()=>{},{...Mn,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),to=(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}},Br=(e,t,n)=>{let r=(...i)=>$r(i[0])&&$r(i[0].raw)?Pl(r,Ll(r,...i)):Pl(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,mm),r._generator=e,r._styler=t,r._isEmpty=n,r},Pl=(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=dm(t,n.close,n.open),n=n.parent;let s=t.indexOf(`
|
6
|
+
`);return s!==-1&&(t=pm(t,i,r,s)),r+t+i},Xi,Ll=(e,...t)=>{let[n]=t;if(!$r(n)||!$r(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 Xi===void 0&&(Xi=jl()),Xi(e,i.join(""))};Object.defineProperties(Wr.prototype,Mn);var Hr=Wr();Hr.supportsColor=Zi;Hr.stderr=Wr({level:eo?eo.level:0});Hr.stderr.supportsColor=eo;Dl.exports=Hr});y();y();y();import{notStrictEqual as Wc,strictEqual as Bc}from"assert";y();y();var gc={right:xc,center:Cc},yc=0,rr=1,bc=2,ir=3,ao=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&&qe.stringWidth(i[0])>r&&(r=Math.min(Math.floor(this.width*.5),qe.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=qe.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>qe.stringWidth(o)&&(u+=" ".repeat(f-qe.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap&&(u=gc[t[a].align](u,f),qe.stringWidth(u)<f&&(u+=" ".repeat((l||0)-qe.stringWidth(u)-1)));let c=t[a].padding||[0,0,0,0];c[ir]&&(s+=" ".repeat(c[ir])),s+=so(t[a],u,"| "),s+=u,s+=so(t[a],u," |"),c[rr]&&(s+=" ".repeat(c[rr])),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=qe.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=qe.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[yc]||0).fill("")),i.push(...new Array(s.padding[bc]||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[ir]||0)+(t.padding[rr]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(o=>o.width||qe.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,wc(t[a])):o)}};function so(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function wc(e){let t=e.padding||[],n=1+(t[ir]||0)+(t[rr]||0);return e.border?n+4:n}function Ac(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function xc(e,t){e=e.trim();let n=qe.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function Cc(e,t){e=e.trim();let n=qe.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var qe;function lo(e,t){return qe=t,new ao({width:(e==null?void 0:e.width)||Ac(),wrap:e==null?void 0:e.wrap})}y();var co=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Qr(e){return e.replace(co,"")}function fo(e,t){let[n,r]=e.match(co)||["",""];e=Qr(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 Jr(e){return lo(e,{stringWidth:t=>[...t].length,stripAnsi:Qr,wrap:fo})}y();import{dirname as uo,resolve as po}from"path";import{readdirSync as vc,statSync as Oc}from"fs";function ho(e,t){let n=po(".",e),r;for(Oc(n).isDirectory()||(n=uo(n));;){if(r=t(n,vc(n)),r)return po(n,r);if(n=uo(r=n),r===n)break}}import{inspect as Hc}from"util";import{readFileSync as Gc}from"fs";import{fileURLToPath as qc}from"url";y();import{format as Sc}from"util";import{normalize as jc,resolve as Pc}from"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 or(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 sr(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 mo(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 Je;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Je||(Je={}));var mt,Zr=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=mo(t),s=typeof t=="string",o=Ec(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:[]},E=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,_=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach(function(w){let x=typeof w=="object"?w.key:w,S=Object.keys(w).map(function(C){return{boolean:"bools",string:"strings",number:"numbers"}[C]}).filter(Boolean).pop();S&&(m[S][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 B=null;tr();let G=[],X=Object.assign(Object.create(null),{_:[]}),z={};for(let w=0;w<i.length;w++){let x=i[w],S=x.replace(/^-{3,}/,"---"),C,A,L,P,$,Pe;if(x!=="--"&&ce(x))U(x);else if(S.match(/---+(=|$)/)){U(x);continue}else if(x.match(/^--.+=/)||!a["short-option-groups"]&&x.match(/^-.+=/))P=x.match(/^--?([^=]+)=([\s\S]*)$/),P!==null&&Array.isArray(P)&&P.length>=3&&(q(P[1],m.arrays)?w=te(w,P[1],i,P[2]):q(P[1],m.nargs)!==!1?w=J(w,P[1],i,P[2]):V(P[1],P[2],!0));else if(x.match(_)&&a["boolean-negation"])P=x.match(_),P!==null&&Array.isArray(P)&&P.length>=2&&(A=P[1],V(A,q(A,m.arrays)?[!1]:!1));else if(x.match(/^--.+/)||!a["short-option-groups"]&&x.match(/^-[^-]+/))P=x.match(/^--?(.+)/),P!==null&&Array.isArray(P)&&P.length>=2&&(A=P[1],q(A,m.arrays)?w=te(w,A,i):q(A,m.nargs)!==!1?w=J(w,A,i):($=i[w+1],$!==void 0&&(!$.match(/^-/)||$.match(E))&&!q(A,m.bools)&&!q(A,m.counts)||/^(true|false)$/.test($)?(V(A,$),w++):V(A,fe(A))));else if(x.match(/^-.\..+=/))P=x.match(/^-([^=]+)=([\s\S]*)$/),P!==null&&Array.isArray(P)&&P.length>=3&&V(P[1],P[2]);else if(x.match(/^-.\..+/)&&!x.match(E))$=i[w+1],P=x.match(/^-(.\..+)/),P!==null&&Array.isArray(P)&&P.length>=2&&(A=P[1],$!==void 0&&!$.match(/^-/)&&!q(A,m.bools)&&!q(A,m.counts)?(V(A,$),w++):V(A,fe(A)));else if(x.match(/^-[^-]+/)&&!x.match(E)){L=x.slice(1,-1).split(""),C=!1;for(let De=0;De<L.length;De++){if($=x.slice(De+2),L[De+1]&&L[De+1]==="="){Pe=x.slice(De+3),A=L[De],q(A,m.arrays)?w=te(w,A,i,Pe):q(A,m.nargs)!==!1?w=J(w,A,i,Pe):V(A,Pe),C=!0;break}if($==="-"){V(L[De],$);continue}if(/[A-Za-z]/.test(L[De])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test($)&&q($,m.bools)===!1){V(L[De],$),C=!0;break}if(L[De+1]&&L[De+1].match(/\W/)){V(L[De],$),C=!0;break}else V(L[De],fe(L[De]))}A=x.slice(-1)[0],!C&&A!=="-"&&(q(A,m.arrays)?w=te(w,A,i):q(A,m.nargs)!==!1?w=J(w,A,i):($=i[w+1],$!==void 0&&(!/^(-|--)[^-]/.test($)||$.match(E))&&!q(A,m.bools)&&!q(A,m.counts)||/^(true|false)$/.test($)?(V(A,$),w++):V(A,fe(A))))}else if(x.match(/^-[0-9]$/)&&x.match(E)&&q(x.slice(1),m.bools))A=x.slice(1),V(A,fe(A));else if(x==="--"){G=i.slice(w+1);break}else if(a["halt-at-non-option"]){G=i.slice(w);break}else U(x)}ee(X,!0),ee(X,!1),K(X),me(),le(X,m.aliases,l,!0),_e(X),a["set-placeholder-key"]&&Bt(X),Object.keys(m.counts).forEach(function(w){pt(X,w.split("."))||V(w,0)}),c&&G.length&&(X[d]=[]),G.forEach(function(w){X[d].push(w)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(X).filter(w=>w!=="--"&&w.includes("-")).forEach(w=>{delete X[w]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(w=>o[w])).forEach(w=>{a["camel-case-expansion"]&&w.includes("-")&&delete X[w.split(".").map(x=>Gt(x)).join(".")],delete X[w]});function U(w){let x=F("_",w);(typeof x=="string"||typeof x=="number")&&X._.push(x)}function J(w,x,S,C){let A,L=q(x,m.nargs);if(L=typeof L!="number"||isNaN(L)?1:L,L===0)return it(C)||(B=Error(g("Argument unexpected for: %s",x))),V(x,fe(x)),w;let P=it(C)?0:1;if(a["nargs-eats-options"])S.length-(w+1)+P<L&&(B=Error(g("Not enough arguments following: %s",x))),P=L;else{for(A=w+1;A<S.length&&(!S[A].match(/^-[^0-9]/)||S[A].match(E)||ce(S[A]));A++)P++;P<L&&(B=Error(g("Not enough arguments following: %s",x)))}let $=Math.min(P,L);for(!it(C)&&$>0&&(V(x,C),$--),A=w+1;A<$+w+1;A++)V(x,S[A]);return w+$}function te(w,x,S,C){let A=[],L=C||S[w+1],P=q(x,m.nargs);if(q(x,m.bools)&&!/^(true|false)$/.test(L))A.push(!0);else if(it(L)||it(C)&&/^-/.test(L)&&!E.test(L)&&!ce(L)){if(l[x]!==void 0){let $=l[x];A=Array.isArray($)?$:[$]}}else{it(C)||A.push(j(x,C,!0));for(let $=w+1;$<S.length&&!(!a["greedy-arrays"]&&A.length>0||P&&typeof P=="number"&&A.length>=P||(L=S[$],/^-/.test(L)&&!E.test(L)&&!ce(L)));$++)w=$,A.push(j(x,L,s))}return typeof P=="number"&&(P&&A.length<P||isNaN(P)&&A.length===0)&&(B=Error(g("Not enough arguments following: %s",x))),V(x,A),w}function V(w,x,S=s){if(/-/.test(w)&&a["camel-case-expansion"]){let L=w.split(".").map(function(P){return Gt(P)}).join(".");M(w,L)}let C=j(w,x,S),A=w.split(".");ht(X,A,C),m.aliases[w]&&m.aliases[w].forEach(function(L){let P=L.split(".");ht(X,P,C)}),A.length>1&&a["dot-notation"]&&(m.aliases[A[0]]||[]).forEach(function(L){let P=L.split("."),$=[].concat(A);$.shift(),P=P.concat($),(m.aliases[w]||[]).includes(P.join("."))||ht(X,P,C)}),q(w,m.normalize)&&!q(w,m.arrays)&&[w].concat(m.aliases[w]||[]).forEach(function(P){Object.defineProperty(z,P,{enumerable:!0,get(){return x},set($){x=typeof $=="string"?mt.normalize($):$}})})}function M(w,x){m.aliases[w]&&m.aliases[w].length||(m.aliases[w]=[x],h[x]=!0),m.aliases[x]&&m.aliases[x].length||M(x,w)}function j(w,x,S){S&&(x=_c(x)),(q(w,m.bools)||q(w,m.counts))&&typeof x=="string"&&(x=x==="true");let C=Array.isArray(x)?x.map(function(A){return F(w,A)}):F(w,x);return q(w,m.counts)&&(it(C)||typeof C=="boolean")&&(C=Xr()),q(w,m.normalize)&&q(w,m.arrays)&&(Array.isArray(x)?C=x.map(A=>mt.normalize(A)):C=mt.normalize(x)),C}function F(w,x){return!a["parse-positional-numbers"]&&w==="_"||!q(w,m.strings)&&!q(w,m.bools)&&!Array.isArray(x)&&(sr(x)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${x}`)))||!it(x)&&q(w,m.numbers))&&(x=Number(x)),x}function K(w){let x=Object.create(null);le(x,m.aliases,l),Object.keys(m.configs).forEach(function(S){let C=w[S]||x[S];if(C)try{let A=null,L=mt.resolve(mt.cwd(),C),P=m.configs[S];if(typeof P=="function"){try{A=P(L)}catch($){A=$}if(A instanceof Error){B=A;return}}else A=mt.require(L);ne(A)}catch(A){A.name==="PermissionDenied"?B=A:w[S]&&(B=Error(g("Invalid JSON config file: %s",C)))}})}function ne(w,x){Object.keys(w).forEach(function(S){let C=w[S],A=x?x+"."+S:S;typeof C=="object"&&C!==null&&!Array.isArray(C)&&a["dot-notation"]?ne(C,A):(!pt(X,A.split("."))||q(A,m.arrays)&&a["combine-arrays"])&&V(A,C)})}function me(){typeof f!="undefined"&&f.forEach(function(w){ne(w)})}function ee(w,x){if(typeof u=="undefined")return;let S=typeof u=="string"?u:"",C=mt.env();Object.keys(C).forEach(function(A){if(S===""||A.lastIndexOf(S,0)===0){let L=A.split("__").map(function(P,$){return $===0&&(P=P.substring(S.length)),Gt(P)});(x&&m.configs[L.join(".")]||!x)&&!pt(w,L)&&V(L.join("."),C[A])}})}function _e(w){let x,S=new Set;Object.keys(w).forEach(function(C){if(!S.has(C)&&(x=q(C,m.coercions),typeof x=="function"))try{let A=F(C,x(w[C]));[].concat(m.aliases[C]||[],C).forEach(L=>{S.add(L),w[L]=A})}catch(A){B=A}})}function Bt(w){return m.keys.forEach(x=>{~x.indexOf(".")||typeof w[x]=="undefined"&&(w[x]=void 0)}),w}function le(w,x,S,C=!1){Object.keys(S).forEach(function(A){pt(w,A.split("."))||(ht(w,A.split("."),S[A]),C&&(b[A]=!0),(x[A]||[]).forEach(function(L){pt(w,L.split("."))||ht(w,L.split("."),S[A])}))})}function pt(w,x){let S=w;a["dot-notation"]||(x=[x.join(".")]),x.slice(0,-1).forEach(function(A){S=S[A]||{}});let C=x[x.length-1];return typeof S!="object"?!1:C in S}function ht(w,x,S){let C=w;a["dot-notation"]||(x=[x.join(".")]),x.slice(0,-1).forEach(function(Pe){Pe=go(Pe),typeof C=="object"&&C[Pe]===void 0&&(C[Pe]={}),typeof C[Pe]!="object"||Array.isArray(C[Pe])?(Array.isArray(C[Pe])?C[Pe].push({}):C[Pe]=[C[Pe],{}],C=C[Pe][C[Pe].length-1]):C=C[Pe]});let A=go(x[x.length-1]),L=q(x.join("."),m.arrays),P=Array.isArray(S),$=a["duplicate-arguments-array"];!$&&q(A,m.nargs)&&($=!0,(!it(C[A])&&m.nargs[A]===1||Array.isArray(C[A])&&C[A].length===m.nargs[A])&&(C[A]=void 0)),S===Xr()?C[A]=Xr(C[A]):Array.isArray(C[A])?$&&L&&P?C[A]=a["flatten-duplicate-arrays"]?C[A].concat(S):(Array.isArray(C[A][0])?C[A]:[C[A]]).concat([S]):!$&&Boolean(L)===Boolean(P)?C[A]=S:C[A]=C[A].concat([S]):C[A]===void 0&&L?C[A]=P?S:[S]:$&&!(C[A]===void 0||q(A,m.counts)||q(A,m.bools))?C[A]=[C[A],S]:C[A]=S}function Ht(...w){w.forEach(function(x){Object.keys(x||{}).forEach(function(S){m.aliases[S]||(m.aliases[S]=[].concat(o[S]||[]),m.aliases[S].concat(S).forEach(function(C){if(/-/.test(C)&&a["camel-case-expansion"]){let A=Gt(C);A!==S&&m.aliases[S].indexOf(A)===-1&&(m.aliases[S].push(A),h[A]=!0)}}),m.aliases[S].concat(S).forEach(function(C){if(C.length>1&&/[A-Z]/.test(C)&&a["camel-case-expansion"]){let A=or(C,"-");A!==S&&m.aliases[S].indexOf(A)===-1&&(m.aliases[S].push(A),h[A]=!0)}}),m.aliases[S].forEach(function(C){m.aliases[C]=[S].concat(m.aliases[S].filter(function(A){return C!==A}))}))})})}function q(w,x){let S=[].concat(m.aliases[w]||[],w),C=Object.keys(x),A=S.find(L=>C.includes(L));return A?x[A]:!1}function Kr(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 H(w,...x){return[].concat(...x).some(function(C){let A=w.match(C);return A&&Kr(A[1])})}function oe(w){if(w.match(E)||!w.match(/^-[^-]+/))return!1;let x=!0,S,C=w.slice(1).split("");for(let A=0;A<C.length;A++){if(S=w.slice(A+2),!Kr(C[A])){x=!1;break}if(C[A+1]&&C[A+1]==="="||S==="-"||/[A-Za-z]/.test(C[A])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(S)||C[A+1]&&C[A+1].match(/\W/))break}return x}function ce(w){return a["unknown-options-as-args"]&&Z(w)}function Z(w){return w=w.replace(/^-{3,}/,"--"),w.match(E)||oe(w)?!1:!H(w,/^-+([^=]+?)=[\s\S]*$/,_,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function fe(w){return!q(w,m.bools)&&!q(w,m.counts)&&`${w}`in l?l[w]:ge(rt(w))}function ge(w){return{[Je.BOOLEAN]:!0,[Je.STRING]:"",[Je.NUMBER]:void 0,[Je.ARRAY]:[]}[w]}function rt(w){let x=Je.BOOLEAN;return q(w,m.strings)?x=Je.STRING:q(w,m.numbers)?x=Je.NUMBER:q(w,m.bools)?x=Je.BOOLEAN:q(w,m.arrays)&&(x=Je.ARRAY),x}function it(w){return w===void 0}function tr(){Object.keys(m.counts).find(w=>q(w,m.arrays)?(B=Error(g("Invalid configuration: %s, opts.count excludes opts.array.",w)),!0):q(w,m.nargs)?(B=Error(g("Invalid configuration: %s, opts.count excludes opts.narg.",w)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(z,X),configuration:a,defaulted:Object.assign({},b),error:B,newAliases:Object.assign({},h)}}};function Ec(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 Xr(e){return e!==void 0?e+1:1}function go(e){return e==="__proto__"?"___proto___":e}function _c(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}import{readFileSync as Mc}from"fs";var yo=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])<yo)throw Error(`yargs parser supports a minimum Node.js version of ${yo}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Ic=process?process.env:{},bo=new Zr({cwd:process.cwd,env:()=>Ic,format:Sc,normalize:jc,resolve:Pc,require:e=>{if(typeof Se!="undefined")return Se(e);if(e.match(/\.json$/))return JSON.parse(Mc(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),Ln=function(t,n){return bo.parse(t.slice(),n).argv};Ln.detailed=function(e,t){return bo.parse(e.slice(),t)};Ln.camelCase=Gt;Ln.decamelize=or;Ln.looksLikeNumber=sr;var wo=Ln;import{basename as Yc,dirname as zc,extname as Vc,relative as Kc,resolve as Eo}from"path";y();function Fc(){return Tc()?0:1}function Tc(){return Lc()&&!process.defaultApp}function Lc(){return!!process.versions.electron}function Ao(){return process.argv[Fc()]}y();var re=class extends Error{constructor(t){super(t||"yargs error");this.name="YError",Error.captureStackTrace(this,re)}};y();y();import{readFileSync as Dc,statSync as Nc,writeFile as kc}from"fs";import{format as Rc}from"util";import{resolve as Uc}from"path";var xo={fs:{readFileSync:Dc,writeFile:kc},format:Rc,resolve:Uc,exists:e=>{try{return Nc(e).isFile()}catch(t){return!1}}};y();var st,Co=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(),st.format.apply(st.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),st.format.apply(st.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);st.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{st.fs.readFileSync&&(t=JSON.parse(st.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=st.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~n.lastIndexOf("_")){let i=st.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(t){return st.exists(t)}};function vo(e,t){st=t;let n=new Co(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 $c=e=>vo(e,xo),Oo=$c;var Xc={},Qc="require is not supported by ESM",_o="loading a directory of commands is not supported yet for ESM",ar;try{ar=qc(Xc.url)}catch(e){ar=process.cwd()}var Jc=ar.split("node_modules")[0],So={assert:{notStrictEqual:Wc,strictEqual:Bc},cliui:Jr,findUp:ho,getEnv:e=>process.env[e],inspect:Hc,getCallerFile:()=>{throw new re(_o)},getProcessArgvBin:Ao,mainFilename:Jc||process.cwd(),Parser:wo,path:{basename:Yc,dirname:zc,extname:Vc,relative:Kc,resolve:Eo},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:Gc,require:()=>{throw new re(Qc)},requireDirectory:()=>{throw new re(_o)},stringWidth:e=>[...e].length,y18n:Oo({directory:Eo(ar,"../../../locales"),updateFiles:!1})};y();y();y();function Ne(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function ei(e,t){t.assert.strictEqual(typeof e,"string")}function un(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 Zc=["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=jo(d);c.cmd.filter(g=>g===h||g==="*").length===0&&Po(h,c.cmd,i),i+=1}),s.optional.forEach(c=>{if(l.length===0)return;let d=l.shift(),h=jo(d);c.cmd.filter(g=>g===h||g==="*").length===0&&Po(h,c.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function jo(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function Po(e,t,n){throw new re(`Invalid ${Zc[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var ti=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 Mo(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=ef(e)?e():e;return ae(r)?r.then(i=>t(i)):t(r)}catch(r){return n(r)}}function ef(e){return typeof e=="function"}y();function ni(e){if(typeof Se=="undefined")return null;for(let t=0,n=Object.keys(Se.cache),r;t<n.length;t++)if(r=Se.cache[n[t]],r.exports===e)return r;return null}var dn=/(^\*)|(^\$0)/,Fo=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=Mo(s);if(i=i||(()=>{}),Array.isArray(t))if(tf(t))[t,...a]=t;else for(let f of t)this.addHandler(f);else if(rf(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(Io(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=>dn.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(dn,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(lr(f)){let c=f(r.getInternalMethods().reset(i),l);if(ae(c))return c.then(d=>(u=Lo(d)?d:r,this.parseAndUpdateUsage(t,n,u,s,o,a)))}else nf(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(!0),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=dn.test(n.original)?n.original.replace(dn,"").trim():n.original,i=t.filter(s=>!dn.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=dn.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(lr(n))return n(t,!0);Io(n)||Object.keys(n).forEach(r=>{t.option(r,n[r])})}moduleName(t){let n=ni(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;Ne(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();Ne(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 To(e,t,n,r){return new Fo(e,t,n,r)}function Io(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function tf(e){return e.every(t=>typeof t=="string")}function lr(e){return typeof e=="function"}function nf(e){return typeof e=="object"}function rf(e){return typeof e=="object"&&!Array.isArray(e)}y();y();function xt(e={},t=()=>!0){let n={};return un(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 of(e){return typeof e=="boolean"}function No(e,t){let n=t.y18n.__,r={},i=[];r.failFn=function(j){i.push(j)};let s=null,o=!0;r.showHelpOnFail=function(j=!0,F){function K(){return typeof j=="string"?[!0,j]:[j,F]}let[ne,me]=K();return s=me,o=ne,r};let a=!1;r.fail=function(j,F){let K=e.getInternalMethods().getLoggerInstance();if(i.length)for(let ne=i.length-1;ne>=0;--ne){let me=i[ne];if(of(me)){if(F)throw F;if(j)throw Error(j)}else me(j,F,r)}else{if(e.getExitProcess()&&Ct(!0),a||(a=!0,o&&(e.showHelp("error"),K.error()),(j||F)&&K.error(j||F),s&&((j||F)&&K.error(""),K.error(s))),F=F||new re(j),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,F);throw F}};let l=[],f=!1;r.usage=(M,j)=>M===null?(f=!0,l=[],r):(f=!1,l.push([M,j||""]),r),r.getUsage=()=>l,r.getUsageDisabled=()=>f,r.getPositionalGroupName=()=>n("Positionals:");let u=[];r.example=(M,j)=>{u.push([M,j||""])};let c=[];r.command=function(j,F,K,ne,me=!1){K&&(c=c.map(ee=>(ee[2]=!1,ee))),c.push([j,F||"",K,ne,me])},r.getCommands=()=>c;let d={};r.describe=function(j,F){Array.isArray(j)?j.forEach(K=>{r.describe(K,F)}):typeof j=="object"?Object.keys(j).forEach(K=>{r.describe(K,j[K])}):d[j]=F},r.getDescriptions=()=>d;let h=[];r.epilog=M=>{h.push(M)};let b=!1,g;r.wrap=M=>{b=!0,g=M};function m(){return b||(g=J(),b=!0),g}let E="__yargsString__:";r.deferY18nLookup=M=>E+M,r.help=function(){if(G)return G;B();let j=e.customScriptName?e.$0:t.path.basename(e.$0),F=e.getDemandedOptions(),K=e.getDemandedCommands(),ne=e.getDeprecatedOptions(),me=e.getGroups(),ee=e.getOptions(),_e=[];_e=_e.concat(Object.keys(d)),_e=_e.concat(Object.keys(F)),_e=_e.concat(Object.keys(K)),_e=_e.concat(Object.keys(ee.default)),_e=_e.filter(z),_e=Object.keys(_e.reduce((H,oe)=>(oe!=="_"&&(H[oe]=!0),H),{}));let Bt=m(),le=t.cliui({width:Bt,wrap:!!Bt});if(!f){if(l.length)l.forEach(H=>{le.div({text:`${H[0].replace(/\$0/g,j)}`}),H[1]&&le.div({text:`${H[1]}`,padding:[1,0,0,0]})}),le.div();else if(c.length){let H=null;K._?H=`${j} <${n("command")}>
|
12
|
+
`:H=`${j} [${n("command")}]
|
13
|
+
`,le.div(`${H}`)}}if(c.length>1||c.length===1&&!c[0][2]){le.div(n("Commands:"));let H=e.getInternalMethods().getContext(),oe=H.commands.length?`${H.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(c=c.sort((Z,fe)=>Z[0].localeCompare(fe[0])));let ce=j?`${j} `:"";c.forEach(Z=>{let fe=`${ce}${oe}${Z[0].replace(/^\$0 ?/,"")}`;le.span({text:fe,padding:[0,2,0,2],width:_(c,Bt,`${j}${oe}`)+4},{text:Z[1]});let ge=[];Z[2]&&ge.push(`[${n("default")}]`),Z[3]&&Z[3].length&&ge.push(`[${n("aliases:")} ${Z[3].join(", ")}]`),Z[4]&&(typeof Z[4]=="string"?ge.push(`[${n("deprecated: %s",Z[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(H=>!e.parsed.newAliases[H]&&pt.every(oe=>(ee.alias[oe]||[]).indexOf(H)===-1));let ht=n("Options:");me[ht]||(me[ht]=[]),X(_e,ee.alias,me,ht);let Ht=H=>/^--/.test(cr(H)),q=Object.keys(me).filter(H=>me[H].length>0).map(H=>{let oe=me[H].filter(z).map(ce=>{if(pt.includes(ce))return ce;for(let Z=0,fe;(fe=pt[Z])!==void 0;Z++)if((ee.alias[fe]||[]).includes(ce))return fe;return ce});return{groupName:H,normalizedKeys:oe}}).filter(({normalizedKeys:H})=>H.length>0).map(({groupName:H,normalizedKeys:oe})=>{let ce=oe.reduce((Z,fe)=>(Z[fe]=[fe].concat(ee.alias[fe]||[]).map(ge=>H===r.getPositionalGroupName()?ge:(/^[0-9]$/.test(ge)?ee.boolean.includes(fe)?"-":"--":ge.length>1?"--":"-")+ge).sort((ge,rt)=>Ht(ge)===Ht(rt)?0:Ht(ge)?1:-1).join(", "),Z),{});return{groupName:H,normalizedKeys:oe,switches:ce}});if(q.filter(({groupName:H})=>H!==r.getPositionalGroupName()).some(({normalizedKeys:H,switches:oe})=>!H.every(ce=>Ht(oe[ce])))&&q.filter(({groupName:H})=>H!==r.getPositionalGroupName()).forEach(({normalizedKeys:H,switches:oe})=>{H.forEach(ce=>{Ht(oe[ce])&&(oe[ce]=sf(oe[ce],4))})}),q.forEach(({groupName:H,normalizedKeys:oe,switches:ce})=>{le.div(H),oe.forEach(Z=>{let fe=ce[Z],ge=d[Z]||"",rt=null;ge.includes(E)&&(ge=n(ge.substring(E.length))),ee.boolean.includes(Z)&&(rt=`[${n("boolean")}]`),ee.count.includes(Z)&&(rt=`[${n("count")}]`),ee.string.includes(Z)&&(rt=`[${n("string")}]`),ee.normalize.includes(Z)&&(rt=`[${n("string")}]`),ee.array.includes(Z)&&(rt=`[${n("array")}]`),ee.number.includes(Z)&&(rt=`[${n("number")}]`);let it=w=>typeof w=="string"?`[${n("deprecated: %s",w)}]`:`[${n("deprecated")}]`,tr=[Z in ne?it(ne[Z]):null,rt,Z in F?`[${n("required")}]`:null,ee.choices&&ee.choices[Z]?`[${n("choices:")} ${r.stringifiedValues(ee.choices[Z])}]`:null,U(ee.default[Z],ee.defaultDescription[Z])].filter(Boolean).join(" ");le.span({text:cr(fe),padding:[0,2,0,2+Do(fe)],width:_(ce,Bt)+4},ge),tr?le.div({text:tr,padding:[0,0,0,2],align:"right"}):le.div()}),le.div()}),u.length&&(le.div(n("Examples:")),u.forEach(H=>{H[0]=H[0].replace(/\$0/g,j)}),u.forEach(H=>{H[1]===""?le.div({text:H[0],padding:[0,2,0,2]}):le.div({text:H[0],padding:[0,2,0,2],width:_(u,Bt)+4},{text:H[1]})}),le.div()),h.length>0){let H=h.map(oe=>oe.replace(/\$0/g,j)).join(`
|
14
|
+
`);le.div(`${H}
|
15
|
+
`)}return le.toString().replace(/\s*$/,"")};function _(M,j,F){let K=0;return Array.isArray(M)||(M=Object.values(M).map(ne=>[ne])),M.forEach(ne=>{K=Math.max(t.stringWidth(F?`${F} ${cr(ne[0])}`:cr(ne[0]))+Do(ne[0]),K)}),j&&(K=Math.min(K,parseInt((j*.5).toString(),10))),K}function B(){let M=e.getDemandedOptions(),j=e.getOptions();(Object.keys(j.alias)||[]).forEach(F=>{j.alias[F].forEach(K=>{d[K]&&r.describe(F,d[K]),K in M&&e.demandOption(F,M[K]),j.boolean.includes(K)&&e.boolean(F),j.count.includes(K)&&e.count(F),j.string.includes(K)&&e.string(F),j.normalize.includes(K)&&e.normalize(F),j.array.includes(K)&&e.array(F),j.number.includes(K)&&e.number(F)})})}let G;r.cacheHelpMessage=function(){G=this.help()},r.clearCachedHelpMessage=function(){G=void 0},r.hasCachedHelpMessage=function(){return!!G};function X(M,j,F,K){let ne=[],me=null;return Object.keys(F).forEach(ee=>{ne=ne.concat(F[ee])}),M.forEach(ee=>{me=[ee].concat(j[ee]),me.some(_e=>ne.indexOf(_e)!==-1)||F[K].push(ee)}),ne}function z(M){return e.getOptions().hiddenOptions.indexOf(M)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}r.showHelp=M=>{let j=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:j[M])(r.help())},r.functionDescription=M=>{let j=M.name?t.Parser.decamelize(M.name,"-"):n("generated-value");return["(",j,")"].join("")},r.stringifiedValues=function(j,F){let K="",ne=F||", ",me=[].concat(j);return!j||!me.length||me.forEach(ee=>{K.length&&(K+=ne),K+=JSON.stringify(ee)}),K};function U(M,j){let F=`[${n("default:")} `;if(M===void 0&&!j)return null;if(j)F+=j;else switch(typeof M){case"string":F+=`"${M}"`;break;case"object":F+=JSON.stringify(M);break;default:F+=M}return`${F}]`}function J(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let te=null;r.version=M=>{te=M},r.showVersion=M=>{let j=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:j[M])(te)},r.reset=function(j){return s=null,a=!1,l=[],f=!1,h=[],u=[],c=[],d=xt(d,F=>!j[F]),r};let V=[];return r.freeze=function(){V.push({failMessage:s,failureOutput:a,usages:l,usageDisabled:f,epilogs:h,examples:u,commands:c,descriptions:d})},r.unfreeze=function(j=!1){let F=V.pop();!F||(j?(d={...F.descriptions,...d},c=[...F.commands,...c],l=[...F.usages,...l],u=[...F.examples,...u],h=[...F.epilogs,...h]):{failMessage:s,failureOutput:a,usages:l,usageDisabled:f,epilogs:h,examples:u,commands:c,descriptions:d}=F)},r}function ri(e){return typeof e=="object"}function sf(e,t){return ri(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Do(e){return ri(e)?e.indentation:0}function cr(e){return ri(e)?e.text:e}y();y();var ko=`###-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
|
+
`,Ro=`#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=>{g+=C}),t.fail(g)}};let l={};o.conflicts=function(f,p){P("<string|object> [array|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(g=>{o.conflicts(g,f[g])}):(e.global(f),l[f]||(l[f]=[]),Array.isArray(p)?p.forEach(g=>o.conflicts(f,g)):l[f].push(p))},o.getConflicting=()=>l,o.conflicting=function(f){Object.keys(f).forEach(p=>{l[p]&&l[p].forEach(g=>{g&&f[p]!==void 0&&f[g]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,g))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(p=>{l[p].forEach(g=>{g&&f[n.Parser.camelCase(p)]!==void 0&&f[n.Parser.camelCase(g)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,g))})})},o.recommendCommands=function(f,p){p=p.sort((m,I)=>I.length-m.length);let C=null,w=1/0;for(let m=0,I;(I=p[m])!==void 0;m++){let _=Wr(f,I);_<=3&&_<w&&(w=_,C=I)}C&&t.fail(i("Did you mean %s?",C))},o.reset=function(f){return s=at(s,p=>!f[p]),l=at(l,p=>!f[p]),o};let u=[];return o.freeze=function(){u.push({implied:s,conflicting:l})},o.unfreeze=function(){let f=u.pop();Se(f,void 0,n),{implied:s,conflicting:l}=f},o}b();var gi=[],un;function Mn(e,t,n,i){un=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=cl(t,e.extends);else try{s=ze.resolve(e.extends)}catch(a){return e}ll(s),gi.push(s),r=o?JSON.parse(un.readFileSync(s,"utf8")):ze(e.extends),delete e.extends,r=Mn(r,un.path.dirname(s),n,un)}return gi=[],n?Yr(r,e):Object.assign({},r,e)}function ll(e){if(gi.indexOf(e)>-1)throw new Z(`Circular extended configurations: '${e}'.`)}function cl(e,t){return un.path.resolve(e,t)}function Yr(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]=Yr(e[r],t[r]):n[r]=t[r];return n}var M=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,Lt,dn,Ue,Me,Fn,ct,Dt,Ln,$e,Dn,We,Ve,Fe,He,Jt,pe,D,Nn,Tn,Le,Nt,Zt,Tt,ft,Rn,W,Rt,Ut,$t,B,Qe,oe;function ao(e){return(t=[],n=e.process.cwd(),i)=>{let r=new lo(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Br=Symbol("copyDoubleDash"),qr=Symbol("copyDoubleDash"),yi=Symbol("deleteFromParserHintObject"),Gr=Symbol("emitWarning"),zr=Symbol("freeze"),Kr=Symbol("getDollarZero"),Wt=Symbol("getParserConfiguration"),bi=Symbol("guessLocale"),Vr=Symbol("guessVersion"),Qr=Symbol("parsePositionalNumbers"),Ai=Symbol("pkgUp"),ut=Symbol("populateParserHintArray"),Xt=Symbol("populateParserHintSingleValueDictionary"),wi=Symbol("populateParserHintArrayDictionary"),xi=Symbol("populateParserHintDictionary"),Ci=Symbol("sanitizeKey"),Oi=Symbol("setKey"),_i=Symbol("unfreeze"),Jr=Symbol("validateAsync"),Zr=Symbol("getCommandInstance"),Xr=Symbol("getContext"),eo=Symbol("getHasOutput"),to=Symbol("getLoggerInstance"),no=Symbol("getParseContext"),io=Symbol("getUsageInstance"),ro=Symbol("getValidationInstance"),Un=Symbol("hasParseCallback"),Ht=Symbol("postProcess"),oo=Symbol("rebase"),vi=Symbol("reset"),pn=Symbol("runYargsParserAndExecuteCommands"),Ei=Symbol("runValidation"),so=Symbol("setHasOutput"),kt=Symbol("kTrackManuallySetKeys"),lo=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,le.set(this,void 0),Lt.set(this,void 0),dn.set(this,{commands:[],fullCommands:[]}),Ue.set(this,null),Me.set(this,null),Fn.set(this,"show-hidden"),ct.set(this,null),Dt.set(this,!0),Ln.set(this,{}),$e.set(this,!0),Dn.set(this,[]),We.set(this,void 0),Ve.set(this,{}),Fe.set(this,!1),He.set(this,null),Jt.set(this,void 0),pe.set(this,""),D.set(this,void 0),Nn.set(this,void 0),Tn.set(this,{}),Le.set(this,null),Nt.set(this,null),Zt.set(this,{}),Tt.set(this,{}),ft.set(this,void 0),Rn.set(this,!1),W.set(this,void 0),Rt.set(this,!1),Ut.set(this,!1),$t.set(this,!1),B.set(this,void 0),Qe.set(this,null),oe.set(this,void 0),M(this,W,r,"f"),M(this,ft,t,"f"),M(this,Lt,n,"f"),M(this,Nn,i,"f"),M(this,We,new pi(this),"f"),this.$0=this[Kr](),this[vi](),M(this,le,c(this,le,"f"),"f"),M(this,B,c(this,B,"f"),"f"),M(this,oe,c(this,oe,"f"),"f"),M(this,D,c(this,D,"f"),"f"),c(this,D,"f").showHiddenOpt=c(this,Fn,"f"),M(this,Jt,this[qr](),"f")}addHelpOpt(t,n){let i="help";return P("[string|boolean] [string]",[t,n],arguments.length),c(this,He,"f")&&(this[yi](c(this,He,"f")),M(this,He,null,"f")),t===!1&&n===void 0?this:(M(this,He,typeof t=="string"?t:i,"f"),this.boolean(c(this,He,"f")),this.describe(c(this,He,"f"),n||c(this,B,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(P("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let i=typeof t=="string"?t:c(this,Fn,"f");return this.boolean(i),this.describe(i,n||c(this,B,"f").deferY18nLookup("Show hidden options")),c(this,D,"f").showHiddenOpt=i,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return P("<object|string|array> [string|array]",[t,n],arguments.length),this[wi](this.alias.bind(this),"alias",t,n),this}array(t){return P("<array|string>",[t],arguments.length),this[ut]("array",t),this[kt](t),this}boolean(t){return P("<array|string>",[t],arguments.length),this[ut]("boolean",t),this[kt](t),this}check(t,n){return P("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>Ft(()=>t(i,r.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&c(this,B,"f").fail(o.toString(),o):c(this,B,"f").fail(c(this,W,"f").y18n.__("Argument check failed: %s",t.toString())),i),o=>(c(this,B,"f").fail(o.message?o.message:o.toString(),o),i)),!1,n),this}choices(t,n){return P("<object|string|array> [string|array]",[t,n],arguments.length),this[wi](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(P("<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,D,"f").key[t]=!0,c(this,We,"f").addCoerceMiddleware((i,r)=>{let o;return Ft(()=>(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 P("<string|object> [string|array]",[t,n],arguments.length),c(this,oe,"f").conflicts(t,n),this}config(t="config",n,i){return P("[object|string] [string|function] [function]",[t,n,i],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=Mn(t,c(this,Lt,"f"),this[Wt]()["deep-merge-config"]||!1,c(this,W,"f")),c(this,D,"f").configObjects=(c(this,D,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(i=n,n=void 0),this.describe(t,n||c(this,B,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{c(this,D,"f").config[r]=i||!0}),this)}completion(t,n,i){return P("[string] [string|boolean|function] [function]",[t,n,i],arguments.length),typeof n=="function"&&(i=n,n=void 0),M(this,Me,t||c(this,Me,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(c(this,Me,"f"),n),i&&c(this,Ue,"f").registerFunction(i),this}command(t,n,i,r,o,s){return P("<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){P("<string> [object]",[t,n],arguments.length);let i=c(this,Nn,"f")||c(this,W,"f").require;return c(this,le,"f").addDirectory(t,i,c(this,W,"f").getCallerFile(),n),this}count(t){return P("<array|string>",[t],arguments.length),this[ut]("count",t),this[kt](t),this}default(t,n,i){return P("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(di(t,c(this,W,"f")),c(this,D,"f").defaultDescription[t]=i),typeof n=="function"&&(di(t,c(this,W,"f")),c(this,D,"f").defaultDescription[t]||(c(this,D,"f").defaultDescription[t]=c(this,B,"f").functionDescription(n)),n=n.call()),this[Xt](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 P("[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,D,"f").demandedCommands._={min:t,max:n,minMsg:i,maxMsg:r},this}demand(t,n,i){return Array.isArray(n)?(n.forEach(r=>{Se(i,!0,c(this,W,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(Se(i,!0,c(this,W,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{Se(i,!0,c(this,W,"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 P("<object|string|array> [string]",[t,n],arguments.length),this[Xt](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return P("<string> [string|boolean]",[t,n],arguments.length),c(this,D,"f").deprecatedOptions[t]=n,this}describe(t,n){return P("<object|string|array> [string]",[t,n],arguments.length),this[Oi](t,!0),c(this,B,"f").describe(t,n),this}detectLocale(t){return P("<boolean>",[t],arguments.length),M(this,Dt,t,"f"),this}env(t){return P("[string|boolean]",[t],arguments.length),t===!1?delete c(this,D,"f").envPrefix:c(this,D,"f").envPrefix=t||"",this}epilogue(t){return P("<string>",[t],arguments.length),c(this,B,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return P("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(i=>this.example(...i)):c(this,B,"f").example(t,n),this}exit(t,n){M(this,Fe,!0,"f"),M(this,ct,n,"f"),c(this,$e,"f")&&c(this,W,"f").process.exit(t)}exitProcess(t=!0){return P("[boolean]",[t],arguments.length),M(this,$e,t,"f"),this}fail(t){if(P("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new Z("Invalid first argument. Expected function or boolean 'false'");return c(this,B,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return P("<array> [function]",[t,n],arguments.length),n?c(this,Ue,"f").getCompletion(t,n):new Promise((i,r)=>{c(this,Ue,"f").getCompletion(t,(o,s)=>{o?r(o):i(s)})})}getDemandedOptions(){return P([],0),c(this,D,"f").demandedOptions}getDemandedCommands(){return P([],0),c(this,D,"f").demandedCommands}getDeprecatedOptions(){return P([],0),c(this,D,"f").deprecatedOptions}getDetectLocale(){return c(this,Dt,"f")}getExitProcess(){return c(this,$e,"f")}getGroups(){return Object.assign({},c(this,Ve,"f"),c(this,Tt,"f"))}getHelp(){if(M(this,Fe,!0,"f"),!c(this,B,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[pn](c(this,ft,"f"),void 0,void 0,0,!0);if(te(n))return n.then(()=>c(this,B,"f").help())}let t=c(this,le,"f").runDefaultBuilderOn(this);if(te(t))return t.then(()=>c(this,B,"f").help())}return Promise.resolve(c(this,B,"f").help())}getOptions(){return c(this,D,"f")}getStrict(){return c(this,Rt,"f")}getStrictCommands(){return c(this,Ut,"f")}getStrictOptions(){return c(this,$t,"f")}global(t,n){return P("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?c(this,D,"f").local=c(this,D,"f").local.filter(i=>t.indexOf(i)===-1):t.forEach(i=>{c(this,D,"f").local.includes(i)||c(this,D,"f").local.push(i)}),this}group(t,n){P("<string|array> <string>",[t,n],arguments.length);let i=c(this,Tt,"f")[n]||c(this,Ve,"f")[n];c(this,Tt,"f")[n]&&delete c(this,Tt,"f")[n];let r={};return c(this,Ve,"f")[n]=(i||[]).concat(t).filter(o=>r[o]?!1:r[o]=!0),this}hide(t){return P("<string>",[t],arguments.length),c(this,D,"f").hiddenOptions.push(t),this}implies(t,n){return P("<string|object> [number|string|array]",[t,n],arguments.length),c(this,oe,"f").implies(t,n),this}locale(t){return P("[string]",[t],arguments.length),t?(M(this,Dt,!1,"f"),c(this,W,"f").y18n.setLocale(t),this):(this[bi](),c(this,W,"f").y18n.getLocale())}middleware(t,n,i){return c(this,We,"f").addMiddleware(t,!!n,i)}nargs(t,n){return P("<string|object|array> [number]",[t,n],arguments.length),this[Xt](this.nargs.bind(this),"narg",t,n),this}normalize(t){return P("<array|string>",[t],arguments.length),this[ut]("normalize",t),this}number(t){return P("<array|string>",[t],arguments.length),this[ut]("number",t),this[kt](t),this}option(t,n){if(P("<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[kt](t),c(this,Qe,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[Gr](['"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"),M(this,pe,c(this,pe,"f")+t.join(" "),"f")}}}[yi](t){Vt(c(this,D,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let i=c(this,D,"f")[n];Array.isArray(i)?i.includes(t)&&i.splice(i.indexOf(t),1):typeof i=="object"&&delete i[t]}),delete c(this,B,"f").getDescriptions()[t]}[Gr](t,n,i){c(this,Ln,"f")[i]||(c(this,W,"f").process.emitWarning(t,n),c(this,Ln,"f")[i]=!0)}[zr](){c(this,Dn,"f").push({options:c(this,D,"f"),configObjects:c(this,D,"f").configObjects.slice(0),exitProcess:c(this,$e,"f"),groups:c(this,Ve,"f"),strict:c(this,Rt,"f"),strictCommands:c(this,Ut,"f"),strictOptions:c(this,$t,"f"),completionCommand:c(this,Me,"f"),output:c(this,pe,"f"),exitError:c(this,ct,"f"),hasOutput:c(this,Fe,"f"),parsed:this.parsed,parseFn:c(this,Le,"f"),parseContext:c(this,Nt,"f")}),c(this,B,"f").freeze(),c(this,oe,"f").freeze(),c(this,le,"f").freeze(),c(this,We,"f").freeze()}[Kr](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(c(this,W,"f").process.argv()[0])?n=c(this,W,"f").process.argv().slice(1,2):n=c(this,W,"f").process.argv().slice(0,1),t=n.map(i=>{let r=this[oo](c(this,Lt,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),c(this,W,"f").getEnv("_")&&c(this,W,"f").getProcessArgvBin()===c(this,W,"f").getEnv("_")&&(t=c(this,W,"f").getEnv("_").replace(`${c(this,W,"f").path.dirname(c(this,W,"f").process.execPath())}/`,"")),t}[Wt](){return c(this,Tn,"f")}[bi](){if(!c(this,Dt,"f"))return;let t=c(this,W,"f").getEnv("LC_ALL")||c(this,W,"f").getEnv("LC_MESSAGES")||c(this,W,"f").getEnv("LANG")||c(this,W,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Vr](){return this[Ai]().version||"unknown"}[Qr](t){let n=t["--"]?t["--"]:t._;for(let i=0,r;(r=n[i])!==void 0;i++)c(this,W,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(n[i]=Number(r));return t}[Ai](t){let n=t||"*";if(c(this,Zt,"f")[n])return c(this,Zt,"f")[n];let i={};try{let r=t||c(this,W,"f").mainFilename;!t&&c(this,W,"f").path.extname(r)&&(r=c(this,W,"f").path.dirname(r));let o=c(this,W,"f").findUp(r,(s,a)=>{if(a.includes("package.json"))return"package.json"});Se(o,void 0,c(this,W,"f")),i=JSON.parse(c(this,W,"f").readFileSync(o,"utf8"))}catch(r){}return c(this,Zt,"f")[n]=i||{},c(this,Zt,"f")[n]}[ut](t,n){n=[].concat(n),n.forEach(i=>{i=this[Ci](i),c(this,D,"f")[t].push(i)})}[Xt](t,n,i,r){this[xi](t,n,i,r,(o,s,a)=>{c(this,D,"f")[o][s]=a})}[wi](t,n,i,r){this[xi](t,n,i,r,(o,s,a)=>{c(this,D,"f")[o][s]=(c(this,D,"f")[o][s]||[]).concat(a)})}[xi](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 Vt(i))t(s,i[s]);else o(n,this[Ci](i),r)}[Ci](t){return t==="__proto__"?"___proto___":t}[Oi](t,n){return this[Xt](this[Oi].bind(this),"key",t,n),this}[_i](){var t,n,i,r,o,s,a,l,u,d,f,p;let g=c(this,Dn,"f").pop();Se(g,void 0,c(this,W,"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(w){M(t,D,w,"f")}}.value,configObjects:C,exitProcess:{set value(w){M(n,$e,w,"f")}}.value,groups:{set value(w){M(i,Ve,w,"f")}}.value,output:{set value(w){M(r,pe,w,"f")}}.value,exitError:{set value(w){M(o,ct,w,"f")}}.value,hasOutput:{set value(w){M(s,Fe,w,"f")}}.value,parsed:this.parsed,strict:{set value(w){M(a,Rt,w,"f")}}.value,strictCommands:{set value(w){M(l,Ut,w,"f")}}.value,strictOptions:{set value(w){M(u,$t,w,"f")}}.value,completionCommand:{set value(w){M(d,Me,w,"f")}}.value,parseFn:{set value(w){M(f,Le,w,"f")}}.value,parseContext:{set value(w){M(p,Nt,w,"f")}}.value}=g,c(this,D,"f").configObjects=C,c(this,B,"f").unfreeze(),c(this,oe,"f").unfreeze(),c(this,le,"f").unfreeze(),c(this,We,"f").unfreeze()}[Jr](t,n){return Ft(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[Zr].bind(this),getContext:this[Xr].bind(this),getHasOutput:this[eo].bind(this),getLoggerInstance:this[to].bind(this),getParseContext:this[no].bind(this),getParserConfiguration:this[Wt].bind(this),getUsageInstance:this[io].bind(this),getValidationInstance:this[ro].bind(this),hasParseCallback:this[Un].bind(this),postProcess:this[Ht].bind(this),reset:this[vi].bind(this),runValidation:this[Ei].bind(this),runYargsParserAndExecuteCommands:this[pn].bind(this),setHasOutput:this[so].bind(this)}}[Zr](){return c(this,le,"f")}[Xr](){return c(this,dn,"f")}[eo](){return c(this,Fe,"f")}[to](){return c(this,Jt,"f")}[no](){return c(this,Nt,"f")||{}}[io](){return c(this,B,"f")}[ro](){return c(this,oe,"f")}[Un](){return!!c(this,Le,"f")}[Ht](t,n,i,r){return i||te(t)||(n||(t=this[Br](t)),(this[Wt]()["parse-positional-numbers"]||this[Wt]()["parse-positional-numbers"]===void 0)&&(t=this[Qr](t)),r&&(t=Mt(t,this,c(this,We,"f").getMiddleware(),!1))),t}[vi](t={}){M(this,D,c(this,D,"f")||{},"f");let n={};n.local=c(this,D,"f").local||[],n.configObjects=c(this,D,"f").configObjects||[];let i={};n.local.forEach(s=>{i[s]=!0,(t[s]||[]).forEach(a=>{i[a]=!0})}),Object.assign(c(this,Tt,"f"),Object.keys(c(this,Ve,"f")).reduce((s,a)=>{let l=c(this,Ve,"f")[a].filter(u=>!(u in i));return l.length>0&&(s[a]=l),s},{})),M(this,Ve,{},"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,D,"f")[s]||[]).filter(a=>!i[a])}),o.forEach(s=>{n[s]=at(c(this,D,"f")[s],a=>!i[a])}),n.envPrefix=c(this,D,"f").envPrefix,M(this,D,n,"f"),M(this,B,c(this,B,"f")?c(this,B,"f").reset(i):Nr(this,c(this,W,"f")),"f"),M(this,oe,c(this,oe,"f")?c(this,oe,"f").reset(i):kr(this,c(this,B,"f"),c(this,W,"f")),"f"),M(this,le,c(this,le,"f")?c(this,le,"f").reset():Fr(c(this,B,"f"),c(this,oe,"f"),c(this,We,"f"),c(this,W,"f")),"f"),c(this,Ue,"f")||M(this,Ue,$r(this,c(this,B,"f"),c(this,le,"f"),c(this,W,"f")),"f"),c(this,We,"f").reset(),M(this,Me,null,"f"),M(this,pe,"","f"),M(this,ct,null,"f"),M(this,Fe,!1,"f"),this.parsed=!1,this}[oo](t,n){return c(this,W,"f").path.relative(t,n)}[pn](t,n,i,r=0,o=!1){let s=!!i||o;t=t||c(this,ft,"f"),c(this,D,"f").__=c(this,W,"f").y18n.__,c(this,D,"f").configuration=this[Wt]();let a=!!c(this,D,"f").configuration["populate--"],l=Object.assign({},c(this,D,"f").configuration,{"populate--":!0}),u=c(this,W,"f").Parser.detailed(t,Object.assign({},c(this,D,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),d=Object.assign(u.argv,c(this,Nt,"f")),f,p=u.aliases,g=!1,C=!1;Object.keys(d).forEach(w=>{w===c(this,He,"f")&&d[w]?g=!0:w===c(this,Qe,"f")&&d[w]&&(C=!0)}),d.$0=this.$0,this.parsed=u,r===0&&c(this,B,"f").clearCachedHelpMessage();try{if(this[bi](),n)return this[Ht](d,a,!!i,!1);c(this,He,"f")&&[c(this,He,"f")].concat(p[c(this,He,"f")]||[]).filter(q=>q.length>1).includes(""+d._[d._.length-1])&&(d._.pop(),g=!0);let w=c(this,le,"f").getCommands(),m=c(this,Ue,"f").completionKey in d,I=g||m||o;if(d._.length){if(w.length){let _;for(let q=r||0,G;d._[q]!==void 0;q++)if(G=String(d._[q]),w.includes(G)&&G!==c(this,Me,"f")){let V=c(this,le,"f").runCommand(G,this,u,q+1,o,g||C||o);return this[Ht](V,a,!!i,!1)}else if(!_&&G!==c(this,Me,"f")){_=G;break}!c(this,le,"f").hasDefaultCommand()&&c(this,Rn,"f")&&_&&!I&&c(this,oe,"f").recommendCommands(_,w)}c(this,Me,"f")&&d._.includes(c(this,Me,"f"))&&!m&&(c(this,$e,"f")&<(!0),this.showCompletionScript(),this.exit(0))}if(c(this,le,"f").hasDefaultCommand()&&!I){let _=c(this,le,"f").runCommand(null,this,u,0,o,g||C||o);return this[Ht](_,a,!!i,!1)}if(m){c(this,$e,"f")&<(!0),t=[].concat(t);let _=t.slice(t.indexOf(`--${c(this,Ue,"f").completionKey}`)+1);return c(this,Ue,"f").getCompletion(_,(q,G)=>{if(q)throw new Z(q.message);(G||[]).forEach(V=>{c(this,Jt,"f").log(V)}),this.exit(0)}),this[Ht](d,!a,!!i,!1)}if(c(this,Fe,"f")||(g?(c(this,$e,"f")&<(!0),s=!0,this.showHelp("log"),this.exit(0)):C&&(c(this,$e,"f")&<(!0),s=!0,c(this,B,"f").showVersion("log"),this.exit(0))),!s&&c(this,D,"f").skipValidation.length>0&&(s=Object.keys(d).some(_=>c(this,D,"f").skipValidation.indexOf(_)>=0&&d[_]===!0)),!s){if(u.error)throw new Z(u.error.message);if(!m){let _=this[Ei](p,{},u.error);i||(f=Mt(d,this,c(this,We,"f").getMiddleware(),!0)),f=this[Jr](_,f!=null?f:d),te(f)&&!i&&(f=f.then(()=>Mt(d,this,c(this,We,"f").getMiddleware(),!1)))}}}catch(w){if(w instanceof Z)c(this,B,"f").fail(w.message,w);else throw w}return this[Ht](f!=null?f:d,a,!!i,!0)}[Ei](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,Ut,"f")&&(a=c(this,oe,"f").unknownCommands(s)),c(this,Rt,"f")&&!a?c(this,oe,"f").unknownArguments(s,t,n,!!r):c(this,$t,"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)}}[so](){M(this,Fe,!0,"f")}[kt](t){if(typeof t=="string")c(this,D,"f").key[t]=!0;else for(let n of t)c(this,D,"f").key[n]=!0}};function Lr(e){return!!e&&typeof e.getInternalMethods=="function"}var fl=ao(Er),ke=fl;b();b();import pd from"isomorphic-unfetch";b();import rd from"chalk";import{existsSync as od,mkdirSync as sd}from"fs";import{readdir as ad,unlink as ld}from"fs/promises";import{extname as cd,join as Fs}from"path";b();function vo(e){return typeof e=="undefined"||e===null}function ul(e){return typeof e=="object"&&e!==null}function dl(e){return Array.isArray(e)?e:vo(e)?[]:[e]}function pl(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 hl(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function ml(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var gl=vo,yl=ul,bl=dl,Al=hl,wl=ml,xl=pl,ue={isNothing:gl,isObject:yl,toArray:bl,repeat:Al,isNegativeZero:wl,extend:xl};function Eo(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 Uo=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.indexAfterLastReset=0,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(lr(f)){this.indexAfterLastReset=a+1;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.choicesFromOptionsCompletions(o,t,n,r),this.choicesFromPositionalsCompletions(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))})}}choicesFromOptionsCompletions(t,n,r,i){if(this.previousArgHasChoices(n)){let s=this.getPreviousArgChoices(n);s&&s.length>0&&t.push(...s)}}choicesFromPositionalsCompletions(t,n,r,i){let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=r._.slice(o),l=s[a.length-1];if(!l)return;let f=this.yargs.getOptions().choices[l]||[];for(let u of f)u.startsWith(i)&&t.push(u)}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(/^-+/,""),s=this.yargs.getOptions(),o=[i,...this.yargs.getAliases()[i]||[]],a;for(let l of o)if(Object.prototype.hasOwnProperty.call(s.key,l)&&Array.isArray(s.choices[l])){a=s.choices[l];break}if(a)return a.filter(l=>!r||l.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(Ne(this.customCompletionFunction,null,this.shim),lf(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 cf(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?Ro:ko,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 $o(e,t,n,r){return new Uo(e,t,n,r)}function lf(e){return e.length<3}function cf(e){return e.length>3}y();y();function Wo(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 Bo=["$0","--","_"];function Ho(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 E=h[m];E&&b.indexOf(E)<0&&b.push(E)}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 E=e.getInternalMethods().getCommandInstance().getCommands(),_=[],B=e.getInternalMethods().getContext();if(Object.keys(c).forEach(G=>{!Bo.includes(G)&&!Object.prototype.hasOwnProperty.call(h,G)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),G)&&!s.isValidAndSomeAliasIsNotNew(G,d)&&_.push(G)}),g&&(B.commands.length>0||E.length>0||b)&&c._.slice(B.commands.length).forEach(G=>{E.includes(""+G)||_.push(""+G)}),g){let X=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,z=B.commands.length+X;z<c._.length&&c._.slice(z).forEach(U=>{U=String(U),!B.commands.includes(U)&&!_.includes(U)&&_.push(U)})}_.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",_.length,_.map(G=>G.trim()?G:`"${G}"`).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=>{Bo.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(d.choices,m)&&[].concat(c[m]).forEach(E=>{d.choices[m].indexOf(E)===-1&&E!==void 0&&(h[m]=(h[m]||[]).concat(E))})});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)):(Ne(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,E=g;m=a(c,m),g=a(c,g),m&&!g&&d.push(` ${b} -> ${E}`)})}),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,E)=>E.length-m.length);let b=null,g=1/0;for(let m=0,E;(E=d[m])!==void 0;m++){let _=Wo(c,E);_<=3&&_<g&&(g=_,b=E)}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();Ne(c,void 0,n),{implied:o,conflicting:l}=c},s}y();var ii=[],Dn;function fr(e,t,n,r){Dn=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=uf(t,e.extends);else try{o=Se.resolve(e.extends)}catch(a){return e}ff(o),ii.push(o),i=s?JSON.parse(Dn.readFileSync(o,"utf8")):Se(e.extends),delete e.extends,i=fr(i,Dn.path.dirname(o),n,Dn)}return ii=[],n?Go(i,e):Object.assign({},i,e)}function ff(e){if(ii.indexOf(e)>-1)throw new re(`Circular extended configurations: '${e}'.`)}function uf(e,t){return Dn.path.resolve(e,t)}function Go(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]=Go(e[i],t[i]):n[i]=t[i];return n}var T=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,Nn,Xe,Ye,ur,vt,Vt,dr,Ze,pr,et,at,ze,tt,pn,Me,N,hr,mr,Ve,Kt,hn,Qt,Ot,gr,Y,Jt,Xt,Zt,Q,lt,ue;function ls(e){return(t=[],n=e.process.cwd(),r)=>{let i=new cs(t,n,r,e);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var qo=Symbol("copyDoubleDash"),Yo=Symbol("copyDoubleDash"),oi=Symbol("deleteFromParserHintObject"),zo=Symbol("emitWarning"),Vo=Symbol("freeze"),Ko=Symbol("getDollarZero"),en=Symbol("getParserConfiguration"),si=Symbol("guessLocale"),Qo=Symbol("guessVersion"),Jo=Symbol("parsePositionalNumbers"),ai=Symbol("pkgUp"),Et=Symbol("populateParserHintArray"),mn=Symbol("populateParserHintSingleValueDictionary"),li=Symbol("populateParserHintArrayDictionary"),ci=Symbol("populateParserHintDictionary"),fi=Symbol("sanitizeKey"),ui=Symbol("setKey"),di=Symbol("unfreeze"),Xo=Symbol("validateAsync"),Zo=Symbol("getCommandInstance"),es=Symbol("getContext"),ts=Symbol("getHasOutput"),ns=Symbol("getLoggerInstance"),rs=Symbol("getParseContext"),is=Symbol("getUsageInstance"),os=Symbol("getValidationInstance"),yr=Symbol("hasParseCallback"),tn=Symbol("postProcess"),ss=Symbol("rebase"),pi=Symbol("reset"),kn=Symbol("runYargsParserAndExecuteCommands"),hi=Symbol("runValidation"),as=Symbol("setHasOutput"),nn=Symbol("kTrackManuallySetKeys"),cs=class{constructor(t=[],n,r,i){this.customScriptName=!1,this.parsed=!1,ye.set(this,void 0),zt.set(this,void 0),Nn.set(this,{commands:[],fullCommands:[]}),Xe.set(this,null),Ye.set(this,null),ur.set(this,"show-hidden"),vt.set(this,null),Vt.set(this,!0),dr.set(this,{}),Ze.set(this,!0),pr.set(this,[]),et.set(this,void 0),at.set(this,{}),ze.set(this,!1),tt.set(this,null),pn.set(this,void 0),Me.set(this,""),N.set(this,void 0),hr.set(this,void 0),mr.set(this,{}),Ve.set(this,null),Kt.set(this,null),hn.set(this,{}),Qt.set(this,{}),Ot.set(this,void 0),gr.set(this,!1),Y.set(this,void 0),Jt.set(this,!1),Xt.set(this,!1),Zt.set(this,!1),Q.set(this,void 0),lt.set(this,null),ue.set(this,void 0),T(this,Y,i,"f"),T(this,Ot,t,"f"),T(this,zt,n,"f"),T(this,hr,r,"f"),T(this,et,new ti(this),"f"),this.$0=this[Ko](),this[pi](),T(this,ye,p(this,ye,"f"),"f"),T(this,Q,p(this,Q,"f"),"f"),T(this,ue,p(this,ue,"f"),"f"),T(this,N,p(this,N,"f"),"f"),p(this,N,"f").showHiddenOpt=p(this,ur,"f"),T(this,pn,this[Yo](),"f")}addHelpOpt(t,n){let r="help";return I("[string|boolean] [string]",[t,n],arguments.length),p(this,tt,"f")&&(this[oi](p(this,tt,"f")),T(this,tt,null,"f")),t===!1&&n===void 0?this:(T(this,tt,typeof t=="string"?t:r,"f"),this.boolean(p(this,tt,"f")),this.describe(p(this,tt,"f"),n||p(this,Q,"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,ur,"f");return this.boolean(r),this.describe(r,n||p(this,Q,"f").deferY18nLookup("Show hidden options")),p(this,N,"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[li](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,Q,"f").fail(s.toString(),s):p(this,Q,"f").fail(p(this,Y,"f").y18n.__("Argument check failed: %s",t.toString())),r),s=>(p(this,Q,"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[li](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,N,"f").key[t]=!0,p(this,et,"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=fr(t,p(this,zt,"f"),this[en]()["deep-merge-config"]||!1,p(this,Y,"f")),p(this,N,"f").configObjects=(p(this,N,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(r=n,n=void 0),this.describe(t,n||p(this,Q,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{p(this,N,"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),T(this,Ye,t||p(this,Ye,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(p(this,Ye,"f"),n),r&&p(this,Xe,"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,hr,"f")||p(this,Y,"f").require;return p(this,ye,"f").addDirectory(t,r,p(this,Y,"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&&(ei(t,p(this,Y,"f")),p(this,N,"f").defaultDescription[t]=r),typeof n=="function"&&(ei(t,p(this,Y,"f")),p(this,N,"f").defaultDescription[t]||(p(this,N,"f").defaultDescription[t]=p(this,Q,"f").functionDescription(n)),n=n.call()),this[mn](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,N,"f").demandedCommands._={min:t,max:n,minMsg:r,maxMsg:i},this}demand(t,n,r){return Array.isArray(n)?(n.forEach(i=>{Ne(r,!0,p(this,Y,"f")),this.demandOption(i,r)}),n=1/0):typeof n!="number"&&(r=n,n=1/0),typeof t=="number"?(Ne(r,!0,p(this,Y,"f")),this.demandCommand(t,n,r,r)):Array.isArray(t)?t.forEach(i=>{Ne(r,!0,p(this,Y,"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[mn](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return I("<string> [string|boolean]",[t,n],arguments.length),p(this,N,"f").deprecatedOptions[t]=n,this}describe(t,n){return I("<object|string|array> [string]",[t,n],arguments.length),this[ui](t,!0),p(this,Q,"f").describe(t,n),this}detectLocale(t){return I("<boolean>",[t],arguments.length),T(this,Vt,t,"f"),this}env(t){return I("[string|boolean]",[t],arguments.length),t===!1?delete p(this,N,"f").envPrefix:p(this,N,"f").envPrefix=t||"",this}epilogue(t){return I("<string>",[t],arguments.length),p(this,Q,"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,Q,"f").example(t,n),this}exit(t,n){T(this,ze,!0,"f"),T(this,vt,n,"f"),p(this,Ze,"f")&&p(this,Y,"f").process.exit(t)}exitProcess(t=!0){return I("[boolean]",[t],arguments.length),T(this,Ze,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,Q,"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,Xe,"f").getCompletion(t,n):new Promise((r,i)=>{p(this,Xe,"f").getCompletion(t,(s,o)=>{s?i(s):r(o)})})}getDemandedOptions(){return I([],0),p(this,N,"f").demandedOptions}getDemandedCommands(){return I([],0),p(this,N,"f").demandedCommands}getDeprecatedOptions(){return I([],0),p(this,N,"f").deprecatedOptions}getDetectLocale(){return p(this,Vt,"f")}getExitProcess(){return p(this,Ze,"f")}getGroups(){return Object.assign({},p(this,at,"f"),p(this,Qt,"f"))}getHelp(){if(T(this,ze,!0,"f"),!p(this,Q,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[kn](p(this,Ot,"f"),void 0,void 0,0,!0);if(ae(n))return n.then(()=>p(this,Q,"f").help())}let t=p(this,ye,"f").runDefaultBuilderOn(this);if(ae(t))return t.then(()=>p(this,Q,"f").help())}return Promise.resolve(p(this,Q,"f").help())}getOptions(){return p(this,N,"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,N,"f").local=p(this,N,"f").local.filter(r=>t.indexOf(r)===-1):t.forEach(r=>{p(this,N,"f").local.includes(r)||p(this,N,"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,at,"f")[n];p(this,Qt,"f")[n]&&delete p(this,Qt,"f")[n];let i={};return p(this,at,"f")[n]=(r||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return I("<string>",[t],arguments.length),p(this,N,"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?(T(this,Vt,!1,"f"),p(this,Y,"f").y18n.setLocale(t),this):(this[si](),p(this,Y,"f").y18n.getLocale())}middleware(t,n,r){return p(this,et,"f").addMiddleware(t,!!n,r)}nargs(t,n){return I("<string|object|array> [number]",[t,n],arguments.length),this[mn](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,lt,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[zo](['"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,N,"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,N,"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[Vo](),typeof t=="undefined"&&(t=p(this,Ot,"f")),typeof n=="object"&&(T(this,Kt,n,"f"),n=r),typeof n=="function"&&(T(this,Ve,n,"f"),n=!1),n||T(this,Ot,t,"f"),p(this,Ve,"f")&&T(this,Ze,!1,"f");let i=this[kn](t,!!n),s=this.parsed;return p(this,Xe,"f").setParsed(this.parsed),ae(i)?i.then(o=>(p(this,Ve,"f")&&p(this,Ve,"f").call(this,p(this,vt,"f"),o,p(this,Me,"f")),o)).catch(o=>{throw p(this,Ve,"f")&&p(this,Ve,"f")(o,this.parsed.argv,p(this,Me,"f")),o}).finally(()=>{this[di](),this.parsed=s}):(p(this,Ve,"f")&&p(this,Ve,"f").call(this,p(this,vt,"f"),i,p(this,Me,"f")),this[di](),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),T(this,mr,t,"f"),this}pkgConf(t,n){I("<string> [string]",[t,n],arguments.length);let r=null,i=this[ai](n||p(this,zt,"f"));return i[t]&&typeof i[t]=="object"&&(r=fr(i[t],n||p(this,zt,"f"),this[en]()["deep-merge-config"]||!1,p(this,Y,"f")),p(this,N,"f").configObjects=(p(this,N,"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,Nn,"f").fullCommands[p(this,Nn,"f").fullCommands.length-1],s=i?p(this,ye,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return un(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,Q,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return I("[boolean]",[t],arguments.length),T(this,gr,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,N,"f").narg[t]?this:(this[mn](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,pn,"f").log(p(this,Xe,"f").generateCompletionScript(t,n||p(this,Ye,"f")||"completion")),this}showHelp(t){if(I("[string|function]",[t],arguments.length),T(this,ze,!0,"f"),!p(this,Q,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[kn](p(this,Ot,"f"),void 0,void 0,0,!0);if(ae(r))return r.then(()=>{p(this,Q,"f").showHelp(t)}),this}let n=p(this,ye,"f").runDefaultBuilderOn(this);if(ae(n))return n.then(()=>{p(this,Q,"f").showHelp(t)}),this}return p(this,Q,"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,Q,"f").showHelpOnFail(t,n),this}showVersion(t){return I("[string|function]",[t],arguments.length),p(this,Q,"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),T(this,Jt,t!==!1,"f"),this}strictCommands(t){return I("[boolean]",[t],arguments.length),T(this,Xt,t!==!1,"f"),this}strictOptions(t){return I("[boolean]",[t],arguments.length),T(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,Y,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return I("<object>",[t],arguments.length),T(this,Vt,!1,"f"),p(this,Y,"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(Ne(t,null,p(this,Y,"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,Q,"f").usage(t),this}version(t,n,r){let i="version";if(I("[boolean|string] [string] [string]",[t,n,r],arguments.length),p(this,lt,"f")&&(this[oi](p(this,lt,"f")),p(this,Q,"f").version(void 0),T(this,lt,null,"f")),arguments.length===0)r=this[Qo](),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 T(this,lt,typeof t=="string"?t:i,"f"),n=n||p(this,Q,"f").deferY18nLookup("Show version number"),p(this,Q,"f").version(r||void 0),this.boolean(p(this,lt,"f")),this.describe(p(this,lt,"f"),n),this}wrap(t){return I("<number|null|undefined>",[t],arguments.length),p(this,Q,"f").wrap(t),this}[(ye=new WeakMap,zt=new WeakMap,Nn=new WeakMap,Xe=new WeakMap,Ye=new WeakMap,ur=new WeakMap,vt=new WeakMap,Vt=new WeakMap,dr=new WeakMap,Ze=new WeakMap,pr=new WeakMap,et=new WeakMap,at=new WeakMap,ze=new WeakMap,tt=new WeakMap,pn=new WeakMap,Me=new WeakMap,N=new WeakMap,hr=new WeakMap,mr=new WeakMap,Ve=new WeakMap,Kt=new WeakMap,hn=new WeakMap,Qt=new WeakMap,Ot=new WeakMap,gr=new WeakMap,Y=new WeakMap,Jt=new WeakMap,Xt=new WeakMap,Zt=new WeakMap,Q=new WeakMap,lt=new WeakMap,ue=new WeakMap,qo)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[Yo](){return{log:(...t)=>{this[yr]()||console.log(...t),T(this,ze,!0,"f"),p(this,Me,"f").length&&T(this,Me,p(this,Me,"f")+`
|
68
|
+
`,"f"),T(this,Me,p(this,Me,"f")+t.join(" "),"f")},error:(...t)=>{this[yr]()||console.error(...t),T(this,ze,!0,"f"),p(this,Me,"f").length&&T(this,Me,p(this,Me,"f")+`
|
69
|
+
`,"f"),T(this,Me,p(this,Me,"f")+t.join(" "),"f")}}}[oi](t){un(p(this,N,"f")).forEach(n=>{if((i=>i==="configObjects")(n))return;let r=p(this,N,"f")[n];Array.isArray(r)?r.includes(t)&&r.splice(r.indexOf(t),1):typeof r=="object"&&delete r[t]}),delete p(this,Q,"f").getDescriptions()[t]}[zo](t,n,r){p(this,dr,"f")[r]||(p(this,Y,"f").process.emitWarning(t,n),p(this,dr,"f")[r]=!0)}[Vo](){p(this,pr,"f").push({options:p(this,N,"f"),configObjects:p(this,N,"f").configObjects.slice(0),exitProcess:p(this,Ze,"f"),groups:p(this,at,"f"),strict:p(this,Jt,"f"),strictCommands:p(this,Xt,"f"),strictOptions:p(this,Zt,"f"),completionCommand:p(this,Ye,"f"),output:p(this,Me,"f"),exitError:p(this,vt,"f"),hasOutput:p(this,ze,"f"),parsed:this.parsed,parseFn:p(this,Ve,"f"),parseContext:p(this,Kt,"f")}),p(this,Q,"f").freeze(),p(this,ue,"f").freeze(),p(this,ye,"f").freeze(),p(this,et,"f").freeze()}[Ko](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(p(this,Y,"f").process.argv()[0])?n=p(this,Y,"f").process.argv().slice(1,2):n=p(this,Y,"f").process.argv().slice(0,1),t=n.map(r=>{let i=this[ss](p(this,zt,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<r.length?i:r}).join(" ").trim(),p(this,Y,"f").getEnv("_")&&p(this,Y,"f").getProcessArgvBin()===p(this,Y,"f").getEnv("_")&&(t=p(this,Y,"f").getEnv("_").replace(`${p(this,Y,"f").path.dirname(p(this,Y,"f").process.execPath())}/`,"")),t}[en](){return p(this,mr,"f")}[si](){if(!p(this,Vt,"f"))return;let t=p(this,Y,"f").getEnv("LC_ALL")||p(this,Y,"f").getEnv("LC_MESSAGES")||p(this,Y,"f").getEnv("LANG")||p(this,Y,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Qo](){return this[ai]().version||"unknown"}[Jo](t){let n=t["--"]?t["--"]:t._;for(let r=0,i;(i=n[r])!==void 0;r++)p(this,Y,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(n[r]=Number(i));return t}[ai](t){let n=t||"*";if(p(this,hn,"f")[n])return p(this,hn,"f")[n];let r={};try{let i=t||p(this,Y,"f").mainFilename;!t&&p(this,Y,"f").path.extname(i)&&(i=p(this,Y,"f").path.dirname(i));let s=p(this,Y,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});Ne(s,void 0,p(this,Y,"f")),r=JSON.parse(p(this,Y,"f").readFileSync(s,"utf8"))}catch(i){}return p(this,hn,"f")[n]=r||{},p(this,hn,"f")[n]}[Et](t,n){n=[].concat(n),n.forEach(r=>{r=this[fi](r),p(this,N,"f")[t].push(r)})}[mn](t,n,r,i){this[ci](t,n,r,i,(s,o,a)=>{p(this,N,"f")[s][o]=a})}[li](t,n,r,i){this[ci](t,n,r,i,(s,o,a)=>{p(this,N,"f")[s][o]=(p(this,N,"f")[s][o]||[]).concat(a)})}[ci](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 un(r))t(o,r[o]);else s(n,this[fi](r),i)}[fi](t){return t==="__proto__"?"___proto___":t}[ui](t,n){return this[mn](this[ui].bind(this),"key",t,n),this}[di](){var t,n,r,i,s,o,a,l,f,u,c,d;let h=p(this,pr,"f").pop();Ne(h,void 0,p(this,Y,"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){T(t,N,g,"f")}}.value,configObjects:b,exitProcess:{set value(g){T(n,Ze,g,"f")}}.value,groups:{set value(g){T(r,at,g,"f")}}.value,output:{set value(g){T(i,Me,g,"f")}}.value,exitError:{set value(g){T(s,vt,g,"f")}}.value,hasOutput:{set value(g){T(o,ze,g,"f")}}.value,parsed:this.parsed,strict:{set value(g){T(a,Jt,g,"f")}}.value,strictCommands:{set value(g){T(l,Xt,g,"f")}}.value,strictOptions:{set value(g){T(f,Zt,g,"f")}}.value,completionCommand:{set value(g){T(u,Ye,g,"f")}}.value,parseFn:{set value(g){T(c,Ve,g,"f")}}.value,parseContext:{set value(g){T(d,Kt,g,"f")}}.value}=h,p(this,N,"f").configObjects=b,p(this,Q,"f").unfreeze(),p(this,ue,"f").unfreeze(),p(this,ye,"f").unfreeze(),p(this,et,"f").unfreeze()}[Xo](t,n){return Yt(n,r=>(t(r),r))}getInternalMethods(){return{getCommandInstance:this[Zo].bind(this),getContext:this[es].bind(this),getHasOutput:this[ts].bind(this),getLoggerInstance:this[ns].bind(this),getParseContext:this[rs].bind(this),getParserConfiguration:this[en].bind(this),getUsageInstance:this[is].bind(this),getValidationInstance:this[os].bind(this),hasParseCallback:this[yr].bind(this),postProcess:this[tn].bind(this),reset:this[pi].bind(this),runValidation:this[hi].bind(this),runYargsParserAndExecuteCommands:this[kn].bind(this),setHasOutput:this[as].bind(this)}}[Zo](){return p(this,ye,"f")}[es](){return p(this,Nn,"f")}[ts](){return p(this,ze,"f")}[ns](){return p(this,pn,"f")}[rs](){return p(this,Kt,"f")||{}}[is](){return p(this,Q,"f")}[os](){return p(this,ue,"f")}[yr](){return!!p(this,Ve,"f")}[tn](t,n,r,i){return r||ae(t)||(n||(t=this[qo](t)),(this[en]()["parse-positional-numbers"]||this[en]()["parse-positional-numbers"]===void 0)&&(t=this[Jo](t)),i&&(t=qt(t,this,p(this,et,"f").getMiddleware(),!1))),t}[pi](t={}){T(this,N,p(this,N,"f")||{},"f");let n={};n.local=p(this,N,"f").local||[],n.configObjects=p(this,N,"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,at,"f")).reduce((o,a)=>{let l=p(this,at,"f")[a].filter(f=>!(f in r));return l.length>0&&(o[a]=l),o},{})),T(this,at,{},"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,N,"f")[o]||[]).filter(a=>!r[a])}),s.forEach(o=>{n[o]=xt(p(this,N,"f")[o],a=>!r[a])}),n.envPrefix=p(this,N,"f").envPrefix,T(this,N,n,"f"),T(this,Q,p(this,Q,"f")?p(this,Q,"f").reset(r):No(this,p(this,Y,"f")),"f"),T(this,ue,p(this,ue,"f")?p(this,ue,"f").reset(r):Ho(this,p(this,Q,"f"),p(this,Y,"f")),"f"),T(this,ye,p(this,ye,"f")?p(this,ye,"f").reset():To(p(this,Q,"f"),p(this,ue,"f"),p(this,et,"f"),p(this,Y,"f")),"f"),p(this,Xe,"f")||T(this,Xe,$o(this,p(this,Q,"f"),p(this,ye,"f"),p(this,Y,"f")),"f"),p(this,et,"f").reset(),T(this,Ye,null,"f"),T(this,Me,"","f"),T(this,vt,null,"f"),T(this,ze,!1,"f"),this.parsed=!1,this}[ss](t,n){return p(this,Y,"f").path.relative(t,n)}[kn](t,n,r,i=0,s=!1){let o=!!r||s;t=t||p(this,Ot,"f"),p(this,N,"f").__=p(this,Y,"f").y18n.__,p(this,N,"f").configuration=this[en]();let a=!!p(this,N,"f").configuration["populate--"],l=Object.assign({},p(this,N,"f").configuration,{"populate--":!0}),f=p(this,Y,"f").Parser.detailed(t,Object.assign({},p(this,N,"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,tt,"f")&&u[g]?h=!0:g===p(this,lt,"f")&&u[g]&&(b=!0)}),u.$0=this.$0,this.parsed=f,i===0&&p(this,Q,"f").clearCachedHelpMessage();try{if(this[si](),n)return this[tn](u,a,!!r,!1);p(this,tt,"f")&&[p(this,tt,"f")].concat(d[p(this,tt,"f")]||[]).filter(B=>B.length>1).includes(""+u._[u._.length-1])&&(u._.pop(),h=!0);let g=p(this,ye,"f").getCommands(),m=p(this,Xe,"f").completionKey in u,E=h||m||s;if(u._.length){if(g.length){let _;for(let B=i||0,G;u._[B]!==void 0;B++)if(G=String(u._[B]),g.includes(G)&&G!==p(this,Ye,"f")){let X=p(this,ye,"f").runCommand(G,this,f,B+1,s,h||b||s);return this[tn](X,a,!!r,!1)}else if(!_&&G!==p(this,Ye,"f")){_=G;break}!p(this,ye,"f").hasDefaultCommand()&&p(this,gr,"f")&&_&&!E&&p(this,ue,"f").recommendCommands(_,g)}p(this,Ye,"f")&&u._.includes(p(this,Ye,"f"))&&!m&&(p(this,Ze,"f")&&Ct(!0),this.showCompletionScript(),this.exit(0))}if(p(this,ye,"f").hasDefaultCommand()&&!E){let _=p(this,ye,"f").runCommand(null,this,f,0,s,h||b||s);return this[tn](_,a,!!r,!1)}if(m){p(this,Ze,"f")&&Ct(!0),t=[].concat(t);let _=t.slice(t.indexOf(`--${p(this,Xe,"f").completionKey}`)+1);return p(this,Xe,"f").getCompletion(_,(B,G)=>{if(B)throw new re(B.message);(G||[]).forEach(X=>{p(this,pn,"f").log(X)}),this.exit(0)}),this[tn](u,!a,!!r,!1)}if(p(this,ze,"f")||(h?(p(this,Ze,"f")&&Ct(!0),o=!0,this.showHelp("log"),this.exit(0)):b&&(p(this,Ze,"f")&&Ct(!0),o=!0,p(this,Q,"f").showVersion("log"),this.exit(0))),!o&&p(this,N,"f").skipValidation.length>0&&(o=Object.keys(u).some(_=>p(this,N,"f").skipValidation.indexOf(_)>=0&&u[_]===!0)),!o){if(f.error)throw new re(f.error.message);if(!m){let _=this[hi](d,{},f.error);r||(c=qt(u,this,p(this,et,"f").getMiddleware(),!0)),c=this[Xo](_,c!=null?c:u),ae(c)&&!r&&(c=c.then(()=>qt(u,this,p(this,et,"f").getMiddleware(),!1)))}}}catch(g){if(g instanceof re)p(this,Q,"f").fail(g.message,g);else throw g}return this[tn](c!=null?c:u,a,!!r,!0)}[hi](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)}}[as](){T(this,ze,!0,"f")}[nn](t){if(typeof t=="string")p(this,N,"f").key[t]=!0;else for(let n of t)p(this,N,"f").key[n]=!0}};function Lo(e){return!!e&&typeof e.getInternalMethods=="function"}var df=ls(So),ke=df;y();y();import Lh from"isomorphic-unfetch";y();y();var pf=Object.create,br=Object.defineProperty,hf=Object.defineProperties,mf=Object.getOwnPropertyDescriptor,gf=Object.getOwnPropertyDescriptors,yf=Object.getOwnPropertyNames,fs=Object.getOwnPropertySymbols,bf=Object.getPrototypeOf,ps=Object.prototype.hasOwnProperty,wf=Object.prototype.propertyIsEnumerable,us=(e,t,n)=>t in e?br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Af=(e,t)=>{for(var n in t||(t={}))ps.call(t,n)&&us(e,n,t[n]);if(fs)for(var n of fs(t))wf.call(t,n)&&us(e,n,t[n]);return e},xf=(e,t)=>hf(e,gf(t)),Cf=e=>br(e,"__esModule",{value:!0}),ds=(e=>typeof Se!="undefined"?Se:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof Se!="undefined"?Se:t)[n]}):e)(function(e){if(typeof Se!="undefined")return Se.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),vf=(e,t)=>()=>(e&&(t=e(e=0)),t),ct=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Of=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yf(t))!ps.call(e,i)&&(n||i!=="default")&&br(e,i,{get:()=>t[i],enumerable:!(r=mf(t,i))||r.enumerable});return e},mi=(e,t)=>Of(Cf(br(e!=null?pf(bf(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Ie=vf(()=>{}),Ef=ct((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]}}),hs=ct((e,t)=>{Ie();var n=Ef(),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),E=function(_){return(g-_)/6/m+1/2};return m===0?(u=0,c=0):(c=m/g,a=E(d),l=E(h),f=E(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,E;switch(d){default:case 6:case 0:g=h,m=b,E=l;break;case 1:g=b,m=h,E=l;break;case 2:g=l,m=h,E=b;break;case 3:g=l,m=b,E=h;break;case 4:g=b,m=l,E=h;break;case 5:g=h,m=l,E=b;break}return[g*255,m*255,E*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]}}),_f=ct((e,t)=>{Ie();var n=hs();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}}),Sf=ct((e,t)=>{Ie();var n=hs(),r=_f(),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}),jf=ct((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=Sf());let g=b?10:0,m={};for(let[E,_]of Object.entries(l)){let B=E==="ansi16"?"ansi":E;E===d?m[B]=c(h,g):typeof _=="object"&&(m[B]=c(_[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})}),Pf=ct((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)}}),Mf=ct((e,t)=>{"use strict";Ie();var n=ds("os"),r=ds("tty"),i=Pf(),{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)))}}),If=ct((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}}),Ff=ct((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 E=Number(m);if(!Number.isNaN(E))h.push(E);else if(g=m.match(i))h.push(g[2].replace(s,(_,B,G)=>B?a(B):G));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,E,_,B,G,X)=>{if(E)g.push(a(E));else if(B){let z=g.join("");g=[],b.push(h.length===0?z:u(c,h)(z)),h.push({inverse:_,styles:f(B)})}else if(G){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(X)}),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("")}}),gi=ct((e,t)=>{"use strict";Ie();var n=jf(),{stdout:r,stderr:i}=Mf(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=If(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],f=Object.create(null),u=(z,U={})=>{if(U.level&&!(Number.isInteger(U.level)&&U.level>=0&&U.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let J=r?r.level:0;z.level=U.level===void 0?J:U.level},c=class{constructor(z){return d(z)}},d=z=>{let U={};return u(U,z),U.template=(...J)=>G(U.template,...J),Object.setPrototypeOf(U,h.prototype),Object.setPrototypeOf(U.template,U),U.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},U.template.Instance=c,U.template};function h(z){return d(z)}for(let[z,U]of Object.entries(n))f[z]={get(){let J=E(this,m(U.open,U.close,this._styler),this._isEmpty);return Object.defineProperty(this,z,{value:J}),J}};f.visible={get(){let z=E(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:z}),z}};var b=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let z of b)f[z]={get(){let{level:U}=this;return function(...J){let te=m(n.color[l[U]][z](...J),n.color.close,this._styler);return E(this,te,this._isEmpty)}}};for(let z of b){let U="bg"+z[0].toUpperCase()+z.slice(1);f[U]={get(){let{level:J}=this;return function(...te){let V=m(n.bgColor[l[J]][z](...te),n.bgColor.close,this._styler);return E(this,V,this._isEmpty)}}}}var g=Object.defineProperties(()=>{},xf(Af({},f),{level:{enumerable:!0,get(){return this._generator.level},set(z){this._generator.level=z}}})),m=(z,U,J)=>{let te,V;return J===void 0?(te=z,V=U):(te=J.openAll+z,V=U+J.closeAll),{open:z,close:U,openAll:te,closeAll:V,parent:J}},E=(z,U,J)=>{let te=(...V)=>a(V[0])&&a(V[0].raw)?_(te,G(te,...V)):_(te,V.length===1?""+V[0]:V.join(" "));return Object.setPrototypeOf(te,g),te._generator=z,te._styler=U,te._isEmpty=J,te},_=(z,U)=>{if(z.level<=0||!U)return z._isEmpty?"":U;let J=z._styler;if(J===void 0)return U;let{openAll:te,closeAll:V}=J;if(U.indexOf("\x1B")!==-1)for(;J!==void 0;)U=s(U,J.close,J.open),J=J.parent;let M=U.indexOf(`
|
74
|
+
`);return M!==-1&&(U=o(U,V,te,M)),te+U+V},B,G=(z,...U)=>{let[J]=U;if(!a(J)||!a(J.raw))return U.join(" ");let te=U.slice(1),V=[J.raw[0]];for(let M=1;M<J.length;M++)V.push(String(te[M-1]).replace(/[{}\\]/g,"\\$&"),String(J.raw[M]));return B===void 0&&(B=Ff()),B(z,V.join(""))};Object.defineProperties(h.prototype,f);var X=h();X.supportsColor=r,X.stderr=h({level:i?i.level:0}),X.stderr.supportsColor=i,t.exports=X});import{existsSync as _h,mkdirSync as Sh}from"fs";import{readdir as jh,unlink as Ph}from"fs/promises";import{extname as Mh,join as ka}from"path";y();function Ms(e){return typeof e=="undefined"||e===null}function Tf(e){return typeof e=="object"&&e!==null}function Lf(e){return Array.isArray(e)?e:Ms(e)?[]:[e]}function Df(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 Nf(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function kf(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Rf=Ms,Uf=Tf,$f=Lf,Wf=Nf,Bf=kf,Hf=Df,je={isNothing:Rf,isObject:Uf,toArray:$f,repeat:Wf,isNegativeZero:Bf,extend:Hf};function Is(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 Un(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Is(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Un.prototype=Object.create(Error.prototype);Un.prototype.constructor=Un;Un.prototype.toString=function(t){return this.name+": "+Is(this,t)};var Re=Un;function yi(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 bi(e,t){return je.repeat(" ",t-e.length)+e}function Gf(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=yi(e.buffer,r[o-l],i[o-l],e.position-(r[o]-r[o-l]),c),a=je.repeat(" ",t.indent)+bi((e.line-l+1).toString(),u)+" | "+f.str+`
|
77
|
+
`+a;for(f=yi(e.buffer,r[o],i[o],e.position,c),a+=je.repeat(" ",t.indent)+bi((e.line+1).toString(),u)+" | "+f.str+`
|
78
|
+
`,a+=je.repeat("-",t.indent+u+3+f.pos)+`^
|
79
|
+
`,l=1;l<=t.linesAfter&&!(o+l>=i.length);l++)f=yi(e.buffer,r[o+l],i[o+l],e.position-(r[o]-r[o+l]),c),a+=je.repeat(" ",t.indent)+bi((e.line+l+1).toString(),u)+" | "+f.str+`
|
80
|
+
`;return a.replace(/\n$/,"")}var qf=Gf,Yf=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],zf=["scalar","sequence","mapping"];function Vf(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Kf(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Yf.indexOf(n)===-1)throw new Re('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=Vf(t.styleAliases||null),zf.indexOf(this.kind)===-1)throw new Re('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Te=Kf;function ms(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 Qf(){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 Ai(e){return this.extend(e)}Ai.prototype.extend=function(t){var n=[],r=[];if(t instanceof Te)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 Re("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof Te))throw new Re("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Re("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 Re("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 Te))throw new Re("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Ai.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=ms(i,"implicit"),i.compiledExplicit=ms(i,"explicit"),i.compiledTypeMap=Qf(i.compiledImplicit,i.compiledExplicit),i};var Jf=Ai,Xf=new Te("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Zf=new Te("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),eu=new Te("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),tu=new Jf({explicit:[Xf,Zf,eu]});function nu(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function ru(){return null}function iu(e){return e===null}var ou=new Te("tag:yaml.org,2002:null",{kind:"scalar",resolve:nu,construct:ru,predicate:iu,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function su(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 au(e){return e==="true"||e==="True"||e==="TRUE"}function lu(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var cu=new Te("tag:yaml.org,2002:bool",{kind:"scalar",resolve:su,construct:au,predicate:lu,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 fu(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function uu(e){return 48<=e&&e<=55}function du(e){return 48<=e&&e<=57}function pu(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(!fu(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!uu(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!du(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function hu(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 mu(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!je.isNegativeZero(e)}var gu=new Te("tag:yaml.org,2002:int",{kind:"scalar",resolve:pu,construct:hu,predicate:mu,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"]}}),yu=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function bu(e){return!(e===null||!yu.test(e)||e[e.length-1]==="_")}function wu(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 Au=/^[-+]?[0-9]+e/;function xu(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(je.isNegativeZero(e))return"-0.0";return n=e.toString(10),Au.test(n)?n.replace("e",".e"):n}function Cu(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||je.isNegativeZero(e))}var vu=new Te("tag:yaml.org,2002:float",{kind:"scalar",resolve:bu,construct:wu,predicate:Cu,represent:xu,defaultStyle:"lowercase"}),Ou=tu.extend({implicit:[ou,cu,gu,vu]}),Eu=Ou,Fs=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ts=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 _u(e){return e===null?!1:Fs.exec(e)!==null||Ts.exec(e)!==null}function Su(e){var t,n,r,i,s,o,a,l=0,f=null,u,c,d;if(t=Fs.exec(e),t===null&&(t=Ts.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 ju(e){return e.toISOString()}var Pu=new Te("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:_u,construct:Su,instanceOf:Date,represent:ju});function Mu(e){return e==="<<"||e===null}var Iu=new Te("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Mu}),Ei=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
81
|
+
\r`;function Fu(e){if(e===null)return!1;var t,n,r=0,i=e.length,s=Ei;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 Tu(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,s=Ei,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 Lu(e){var t="",n=0,r,i,s=e.length,o=Ei;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 Du(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Nu=new Te("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Fu,construct:Tu,predicate:Du,represent:Lu}),ku=Object.prototype.hasOwnProperty,Ru=Object.prototype.toString;function Uu(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,Ru.call(i)!=="[object Object]")return!1;for(s in i)if(ku.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 $u(e){return e!==null?e:[]}var Wu=new Te("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Uu,construct:$u}),Bu=Object.prototype.toString;function Hu(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],Bu.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[t]=[i[0],r[i[0]]]}return!0}function Gu(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 qu=new Te("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Hu,construct:Gu}),Yu=Object.prototype.hasOwnProperty;function zu(e){if(e===null)return!0;var t,n=e;for(t in n)if(Yu.call(n,t)&&n[t]!==null)return!1;return!0}function Vu(e){return e!==null?e:{}}var Ku=new Te("tag:yaml.org,2002:set",{kind:"mapping",resolve:zu,construct:Vu}),Ls=Eu.extend({implicit:[Pu,Iu],explicit:[Nu,Wu,qu,Ku]}),St=Object.prototype.hasOwnProperty,wr=1,Ds=2,Ns=3,Ar=4,wi=1,Qu=2,gs=3,Ju=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Xu=/[\x85\u2028\u2029]/,Zu=/[,\[\]\{\}]/,ks=/^(?:!|!!|![a-z\-]+!)$/i,Rs=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ys(e){return Object.prototype.toString.call(e)}function ft(e){return e===10||e===13}function on(e){return e===9||e===32}function Ue(e){return e===9||e===32||e===10||e===13}function yn(e){return e===44||e===91||e===93||e===123||e===125}function ed(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function td(e){return e===120?2:e===117?4:e===85?8:0}function nd(e){return 48<=e&&e<=57?e-48:-1}function bs(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 rd(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Us=new Array(256),$s=new Array(256);for(rn=0;rn<256;rn++)Us[rn]=bs(rn)?1:0,$s[rn]=bs(rn);var rn;function id(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Ls,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 Ws(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=qf(n),new Re(t,n)}function W(e,t){throw Ws(e,t)}function xr(e,t){e.onWarning&&e.onWarning.call(null,Ws(e,t))}var ws={YAML:function(t,n,r){var i,s,o;t.version!==null&&W(t,"duplication of %YAML directive"),r.length!==1&&W(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&W(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&W(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&xr(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,s;r.length!==2&&W(t,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],ks.test(i)||W(t,"ill-formed tag handle (first argument) of the TAG directive"),St.call(t.tagMap,i)&&W(t,'there is a previously declared suffix for "'+i+'" tag handle'),Rs.test(s)||W(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){W(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||W(e,"expected valid JSON character");else Ju.test(a)&&W(e,"the stream contains non-printable characters");e.result+=a}}function As(e,t,n,r){var i,s,o,a;for(je.isObject(n)||W(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 bn(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])&&W(e,"nested arrays are not supported inside keys"),typeof i=="object"&&ys(i[f])==="[object Object]"&&(i[f]="[object Object]");if(typeof i=="object"&&ys(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)As(e,t,s[f],n);else As(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,W(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 _i(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++):W(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function be(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(ft(i))for(_i(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&&xr(e,"deficient indentation"),r}function Or(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||Ue(n)))}function Si(e,t){t===1?e.result+=" ":t>1&&(e.result+=je.repeat(`
|
83
|
+
`,t-1))}function od(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),Ue(h)||yn(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),Ue(i)||n&&yn(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),Ue(i)||n&&yn(i))break}else if(h===35){if(r=e.input.charCodeAt(e.position-1),Ue(r))break}else{if(e.position===e.lineStart&&Or(e)||n&&yn(h))break;if(ft(h))if(l=e.line,f=e.lineStart,u=e.lineIndent,be(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),Si(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 sd(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 ft(n)?(_t(e,r,i,!0),Si(e,be(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Or(e)?W(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);W(e,"unexpected end of the stream within a single quoted scalar")}function ad(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),ft(a))be(e,!1,t);else if(a<256&&Us[a])e.result+=$s[a],e.position++;else if((o=td(a))>0){for(i=o,s=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=ed(a))>=0?s=(s<<4)+o:W(e,"expected hexadecimal character");e.result+=rd(s),e.position++}else W(e,"unknown escape sequence");n=r=e.position}else ft(a)?(_t(e,n,r,!0),Si(e,be(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Or(e)?W(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}W(e,"unexpected end of the stream within a double quoted scalar")}function ld(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,E,_;if(_=e.input.charCodeAt(e.position),_===91)u=93,h=!1,a=[];else if(_===123)u=125,h=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),_=e.input.charCodeAt(++e.position);_!==0;){if(be(e,!0,t),_=e.input.charCodeAt(e.position),_===u)return e.position++,e.tag=o,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=a,!0;n?_===44&&W(e,"expected the node content, but found ','"):W(e,"missed comma between flow collection entries"),m=g=E=null,c=d=!1,_===63&&(f=e.input.charCodeAt(e.position+1),Ue(f)&&(c=d=!0,e.position++,be(e,!0,t))),r=e.line,i=e.lineStart,s=e.position,wn(e,t,wr,!1,!0),m=e.tag,g=e.result,be(e,!0,t),_=e.input.charCodeAt(e.position),(d||e.line===r)&&_===58&&(c=!0,_=e.input.charCodeAt(++e.position),be(e,!0,t),wn(e,t,wr,!1,!0),E=e.result),h?bn(e,a,b,m,g,E,r,i,s):c?a.push(bn(e,null,b,m,g,E,r,i,s)):a.push(g),be(e,!0,t),_=e.input.charCodeAt(e.position),_===44?(n=!0,_=e.input.charCodeAt(++e.position)):n=!1}W(e,"unexpected end of the stream within a flow collection")}function cd(e,t){var n,r,i=wi,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)wi===i?i=c===43?gs:Qu:W(e,"repeat of a chomping mode identifier");else if((u=nd(c))>=0)u===0?W(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?W(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(!ft(c)&&c!==0)}for(;c!==0;){for(_i(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),ft(c)){l++;continue}if(e.lineIndent<a){i===gs?e.result+=je.repeat(`
|
84
|
+
`,s?1+l:l):i===wi&&s&&(e.result+=`
|
85
|
+
`);break}for(r?on(c)?(f=!0,e.result+=je.repeat(`
|
86
|
+
`,s?1+l:l)):f?(f=!1,e.result+=je.repeat(`
|
87
|
+
`,l+1)):l===0?s&&(e.result+=" "):e.result+=je.repeat(`
|
88
|
+
`,l):e.result+=je.repeat(`
|
89
|
+
`,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!ft(c)&&c!==0;)c=e.input.charCodeAt(++e.position);_t(e,n,e.position,!1)}return!0}function xs(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,W(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!Ue(o))));){if(a=!0,e.position++,be(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,wn(e,t,Ns,!1,!0),s.push(e.result),be(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)W(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 fd(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,E=!1,_;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),_=e.input.charCodeAt(e.position);_!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,W(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),s=e.line,(_===63||_===58)&&Ue(r))_===63?(m&&(bn(e,c,d,h,b,null,o,a,l),h=b=g=null),E=!0,m=!0,i=!0):m?(m=!1,i=!0):W(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,_=r;else{if(o=e.line,a=e.lineStart,l=e.position,!wn(e,n,Ds,!1,!0))break;if(e.line===s){for(_=e.input.charCodeAt(e.position);on(_);)_=e.input.charCodeAt(++e.position);if(_===58)_=e.input.charCodeAt(++e.position),Ue(_)||W(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(bn(e,c,d,h,b,null,o,a,l),h=b=g=null),E=!0,m=!1,i=!1,h=e.tag,b=e.result;else if(E)W(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=u,!0}else if(E)W(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),wn(e,t,Ar,!0,i)&&(m?b=e.result:g=e.result),m||(bn(e,c,d,h,b,g,o,a,l),h=b=g=null),be(e,!0,-1),_=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&_!==0)W(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&bn(e,c,d,h,b,null,o,a,l),E&&(e.tag=f,e.anchor=u,e.kind="mapping",e.result=c),E}function ud(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&&W(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)):W(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Ue(o);)o===33&&(r?W(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),ks.test(i)||W(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),Zu.test(s)&&W(e,"tag suffix cannot contain flow indicator characters")}s&&!Rs.test(s)&&W(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){W(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:W(e,'undeclared tag handle "'+i+'"'),!0}function dd(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&W(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Ue(n)&&!yn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&W(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function pd(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&&!Ue(r)&&!yn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&W(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),St.call(e.anchorMap,n)||W(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],be(e,!0,-1),!0}function wn(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=Ar===n||Ns===n,r&&be(e,!0,-1)&&(f=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;ud(e)||dd(e);)be(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||Ar===n)&&(wr===n||Ds===n?g=t:g=t+1,m=e.position-e.lineStart,l===1?a&&(xs(e,m)||fd(e,m,g))||ld(e,g)?u=!0:(o&&cd(e,g)||sd(e,g)||ad(e,g)?u=!0:pd(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&W(e,"alias node should not have any properties")):od(e,g,wr===n)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=a&&xs(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"&&W(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||W(e,"unknown tag !<"+e.tag+">"),e.result!==null&&b.kind!==e.kind&&W(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)):W(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 hd(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&&(be(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&&!Ue(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&W(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&&!ft(o));break}if(ft(o))break;for(n=e.position;o!==0&&!Ue(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&_i(e),St.call(ws,r)?ws[r](e,r,i):xr(e,'unknown document directive "'+r+'"')}if(be(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,be(e,!0,-1)):s&&W(e,"directives end mark is expected"),wn(e,e.lineIndent-1,Ar,!1,!0),be(e,!0,-1),e.checkLineBreaks&&Xu.test(e.input.slice(t,e.position))&&xr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Or(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,be(e,!0,-1));return}if(e.position<e.length-1)W(e,"end of the stream or a document separator is expected");else return}function Bs(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 id(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,W(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;)hd(n);return n.documents}function md(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var r=Bs(e,n);if(typeof t!="function")return r;for(var i=0,s=r.length;i<s;i+=1)t(r[i])}function gd(e,t){var n=Bs(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Re("expected a single document in the stream, but found more")}}var yd=md,bd=gd,Hs={loadAll:yd,load:bd},Gs=Object.prototype.toString,qs=Object.prototype.hasOwnProperty,ji=65279,wd=9,$n=10,Ad=13,xd=32,Cd=33,vd=34,xi=35,Od=37,Ed=38,_d=39,Sd=42,Ys=44,jd=45,Cr=58,Pd=61,Md=62,Id=63,Fd=64,zs=91,Vs=93,Td=96,Ks=123,Ld=124,Qs=125,Le={};Le[0]="\\0";Le[7]="\\a";Le[8]="\\b";Le[9]="\\t";Le[10]="\\n";Le[11]="\\v";Le[12]="\\f";Le[13]="\\r";Le[27]="\\e";Le[34]='\\"';Le[92]="\\\\";Le[133]="\\N";Le[160]="\\_";Le[8232]="\\L";Le[8233]="\\P";var Dd=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Nd=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function kd(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&&qs.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function Rd(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 Re("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+je.repeat("0",r-t.length)+t}var Ud=1,Wn=2;function $d(e){this.schema=e.schema||Ls,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=je.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=kd(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==='"'?Wn:Ud,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 Cs(e,t){for(var n=je.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 Ci(e,t){return`
|
93
|
+
`+je.repeat(" ",e.indent*t)}function Wd(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 vr(e){return e===xd||e===wd}function Bn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ji||65536<=e&&e<=1114111}function vs(e){return Bn(e)&&e!==ji&&e!==Ad&&e!==$n}function Os(e,t,n){var r=vs(e),i=r&&!vr(e);return(n?r:r&&e!==Ys&&e!==zs&&e!==Vs&&e!==Ks&&e!==Qs)&&e!==xi&&!(t===Cr&&!i)||vs(t)&&!vr(t)&&e===xi||t===Cr&&i}function Bd(e){return Bn(e)&&e!==ji&&!vr(e)&&e!==jd&&e!==Id&&e!==Cr&&e!==Ys&&e!==zs&&e!==Vs&&e!==Ks&&e!==Qs&&e!==xi&&e!==Ed&&e!==Sd&&e!==Cd&&e!==Ld&&e!==Pd&&e!==Md&&e!==_d&&e!==vd&&e!==Od&&e!==Fd&&e!==Td}function Hd(e){return!vr(e)&&e!==Cr}function Rn(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 Js(e){var t=/^\n* /;return t.test(e)}var Xs=1,vi=2,Zs=3,ea=4,gn=5;function Gd(e,t,n,r,i,s,o,a){var l,f=0,u=null,c=!1,d=!1,h=r!==-1,b=-1,g=Bd(Rn(e,0))&&Hd(Rn(e,e.length-1));if(t||o)for(l=0;l<e.length;f>=65536?l+=2:l++){if(f=Rn(e,l),!Bn(f))return gn;g=g&&Os(f,u,a),u=f}else{for(l=0;l<e.length;f>=65536?l+=2:l++){if(f=Rn(e,l),f===$n)c=!0,h&&(d=d||l-b-1>r&&e[b+1]!==" ",b=l);else if(!Bn(f))return gn;g=g&&Os(f,u,a),u=f}d=d||h&&l-b-1>r&&e[b+1]!==" "}return!c&&!d?g&&!o&&!i(e)?Xs:s===Wn?gn:vi:n>9&&Js(e)?gn:o?s===Wn?gn:vi:d?ea:Zs}function qd(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Wn?'""':"''";if(!e.noCompatMode&&(Dd.indexOf(t)!==-1||Nd.test(t)))return e.quotingType===Wn?'"'+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 Wd(e,f)}switch(Gd(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!r,i)){case Xs:return t;case vi:return"'"+t.replace(/'/g,"''")+"'";case Zs:return"|"+Es(t,e.indent)+_s(Cs(t,s));case ea:return">"+Es(t,e.indent)+_s(Cs(Yd(t,o),s));case gn:return'"'+zd(t)+'"';default:throw new Re("impossible error: invalid scalar style")}}()}function Es(e,t){var n=Js(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
|
-
${e}`);var n;this.stack=void 0,Object.setPrototypeOf(this,
|
98
|
-
`+a.map(d=>d.added?cn.green(d.value):d.removed?cn.red(d.value):d.value).join("")),console.log(`${n!=null?n:""}${s?cn.gray("[WHATIF]"):""}${l}${i!=null?i:""} ${o}${u}`)}}var Rs={command:"get <id>",describe:"Fetch an aggregate",builder:e=>we(H(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 De({apiKey:t,apiHost:e,fetch:pd,projectId:r}).get({aggregateId:n});a.aggregates.length===0?(console.error("Aggregate did not exist"),process.exit(1)):he(a.aggregates[0],i,o)}};b();import hd from"isomorphic-unfetch";var Us={command:"list",describe:"List aggregates",aliases:["ls"],builder:e=>we(H(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new De({apiKey:t,apiHost:e,fetch:hd,projectId:r}).get({});he(s.aggregates,n,i)}};b();import gd from"isomorphic-unfetch";b();var bt=e=>e.id,At=e=>`${e.name} (pid: ${e.id})`;b();function _e(e,t){return Ds(e,t)}function wt(e,t){Ns(e,t)}b();import md from"p-limit";var ve=md(8);b();function ni({client:e,type:t}){async function*n(){let r=(await e.get({type:t})).aggregates;for await(let o of r)yield{id:bt(o),displayName:At(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 $s={command:"pull <directory>",describe:"Pulls all aggregates to local files in a directory",builder:e=>H(k(xe(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 De({apiKey:t,apiHost:e,fetch:gd,projectId:s,limitPolicy:ve}),u=ni({client:l}),d;if(Ce(n)){let g=_e(n,!1);d=await Ae({objects:(p=g.aggregates)!=null?p:[],selectIdentifier:bt,selectDisplayName:At,onSyncComplete:async(C,w)=>{g.aggregates=w,wt(n,g)}})}else d=await Oe({directory:n,selectIdentifier:bt,selectDisplayName:At,format:i});await me({source:u,target:d,mode:r,whatIf:o,log:ge({diffMode:a})})}};b();import yd from"isomorphic-unfetch";var Ws={command:"push <directory>",describe:"Pushes all aggregates from files in a directory or package to Uniform",builder:e=>H(k(xe(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 De({apiKey:t,apiHost:e,fetch:yd,projectId:o,limitPolicy:ve}),l;if(Ce(n)){let p=_e(n,!0);l=await Ae({objects:(f=p.aggregates)!=null?f:[],selectIdentifier:bt,selectDisplayName:At})}else l=await Oe({directory:n,selectIdentifier:bt,selectDisplayName:At});let d=ni({client:a});await me({source:l,target:d,mode:i,whatIf:r,log:ge({diffMode:s})}),await d.complete()}};b();import bd from"isomorphic-unfetch";var Hs={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an aggregate",builder:e=>H(k(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new De({apiKey:t,apiHost:e,fetch:bd,projectId:i}).remove({aggregateId:n})}};b();import Ad from"isomorphic-unfetch";var ks={command:"update <filename>",aliases:["put"],describe:"Insert or update an aggregate",builder:e=>H(k(e.positional("filename",{demandOption:!0,describe:"Aggregate file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new De({apiKey:t,apiHost:e,fetch:Ad,projectId:i}),o=yt(n);await r.upsert({aggregate:o})}};var Ys={command:"aggregate <command>",aliases:["agg","intent","audience"],describe:"Commands for Context aggregates (intents, audiences)",builder:e=>e.command($s).command(Ws).command(Rs).command(Hs).command(Us).command(ks).demandCommand(),handler:()=>{ke.help()}};b();b();import wd from"isomorphic-unfetch";var Bs={command:"get <id>",describe:"Fetch an enrichment category and its values",builder:e=>we(H(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 Ke({apiKey:t,apiHost:e,fetch:wd,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)):he(a[0],i,o)}};b();import xd from"isomorphic-unfetch";var qs={command:"list",describe:"List enrichments",aliases:["ls"],builder:e=>we(H(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new Ke({apiKey:t,apiHost:e,fetch:xd,projectId:r}).get();he(s.enrichments,n,i)}};b();import Cd from"isomorphic-unfetch";b();var xt=e=>e.id,Ct=e=>`${e.name} (pid: ${e.id})`;b();function ii({client:e}){async function*t(){let n=(await e.get()).enrichments;for await(let i of n)yield{id:xt(i),displayName:Ct(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=Gs({categoryId:n.id,values:n.object.values}),o=Gs({categoryId:n.id,values:(a=(s=i==null?void 0:i.object)==null?void 0:s.values)!=null?a:[],client:e});await me({source:r,target:o,mode:"mirror",whatIf:!1,log:ge({diffMode:"off",prefix:` ${n.displayName} value`,indent:"> "})})}}}var Gs=({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 zs={command:"pull <directory>",describe:"Pulls all enrichments to local files in a directory",builder:e=>H(k(xe(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 Ke({apiKey:t,apiHost:e,fetch:Cd,projectId:s,limitPolicy:ve}),u=ii({client:l}),d;if(Ce(n)){let g=_e(n,!1);d=await Ae({objects:(p=g.enrichments)!=null?p:[],selectIdentifier:xt,selectDisplayName:Ct,onSyncComplete:async(C,w)=>{g.enrichments=w,wt(n,g)}})}else d=await Oe({directory:n,selectIdentifier:xt,selectDisplayName:Ct,format:i});await me({source:u,target:d,mode:r,whatIf:o,log:ge({diffMode:a})})}};b();import Od from"isomorphic-unfetch";var Ks={command:"push <directory>",describe:"Pushes all enrichments from files in a directory or package to Uniform",builder:e=>H(k(xe(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 Ke({apiKey:t,apiHost:e,fetch:Od,projectId:o,limitPolicy:ve}),l;if(Ce(n)){let p=_e(n,!0);l=await Ae({objects:(f=p.enrichments)!=null?f:[],selectIdentifier:xt,selectDisplayName:Ct})}else l=await Oe({directory:n,selectIdentifier:xt,selectDisplayName:Ct});let d=ii({client:a});await me({source:l,target:d,mode:i,whatIf:r,log:ge({diffMode:s})})}};b();import _d from"isomorphic-unfetch";var Vs={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an enrichment category and its values",builder:e=>H(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 Ke({apiKey:t,apiHost:e,fetch:_d,projectId:i}).removeCategory({enrichmentId:n})}};var Qs={command:"enrichment <command>",aliases:["enr"],describe:"Commands for Context enrichments",builder:e=>e.command(zs).command(Ks).command(Bs).command(Vs).command(qs).demandCommand(),handler:()=>{ke.help()}};b();b();import ri from"chalk";import{writeFile as vd}from"fs";import Ed from"isomorphic-unfetch";import{exit as ir}from"process";var Js={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(ri.red("You must specify the project ID")),ir(1));let r=Sd(),o=new or({apiHost:r,projectId:n,apiKey:e,fetch:Ed});try{let s=await o.get({preview:i}),a=JSON.stringify(s,null,2);t?vd(t,a,l=>{l&&(console.error(`Error writing file to ${t}
|
99
|
-
`,l),ir(1)),console.log(ri.green(`\u2705 ${t} has been updated from ${r}`))}):console.log(a)}catch(s){let a;s instanceof rr?(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(ri.red("\u26A0 Error fetching Context manifest")),console.error(ri.gray(` \u2757 ${a}`)),ir(1)}}},Sd=()=>process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app";var Zs={command:"manifest <command>",describe:"Commands for context manifests",aliases:["man"],builder:e=>e.command(Js).demandCommand(),handler:()=>{ke.help()}};b();b();import Id from"isomorphic-unfetch";var Xs={command:"get <id>",describe:"Fetch a quirk",builder:e=>we(H(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 Ne({apiKey:t,apiHost:e,fetch:Id,projectId:r}).get({quirkId:n,withIntegrations:!0});a.quirks.length===0?(console.error("Quirk did not exist"),process.exit(1)):he(a.quirks[0],i,o)}};b();import jd from"isomorphic-unfetch";var ea={command:"list",describe:"List quirks",aliases:["ls"],builder:e=>we(H(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 Ne({apiKey:t,apiHost:e,fetch:jd,projectId:r}).get({withIntegrations:o});he(a.quirks,n,i)}};b();import Pd from"isomorphic-unfetch";b();var Ot=e=>e.id,_t=e=>`${e.name} (pid: ${e.id})`;b();function oi({client:e}){async function*t(){let n=(await e.get({withIntegrations:!1})).quirks;for await(let i of n)yield{id:Ot(i),displayName:_t(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 ta={command:"pull <directory>",describe:"Pulls all quirks to local files in a directory",builder:e=>H(k(xe(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 Ne({apiKey:t,apiHost:e,fetch:Pd,projectId:s,limitPolicy:ve}),u=oi({client:l}),d;if(Ce(n)){let g=_e(n,!1);d=await Ae({objects:(p=g.quirks)!=null?p:[],selectIdentifier:Ot,selectDisplayName:_t,onSyncComplete:async(C,w)=>{g.quirks=w,wt(n,g)}})}else d=await Oe({directory:n,selectIdentifier:Ot,selectDisplayName:_t,format:i});await me({source:u,target:d,mode:r,whatIf:o,log:ge({diffMode:a})})}};b();import Md from"isomorphic-unfetch";var na={command:"push <directory>",describe:"Pushes all quirks from files in a directory or package to Uniform",builder:e=>H(k(xe(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 Ne({apiKey:t,apiHost:e,fetch:Md,projectId:o,limitPolicy:ve}),l;if(Ce(n)){let p=_e(n,!0);l=await Ae({objects:(f=p.quirks)!=null?f:[],selectIdentifier:Ot,selectDisplayName:_t})}else l=await Oe({directory:n,selectIdentifier:Ot,selectDisplayName:_t});let d=oi({client:a});await me({source:l,target:d,mode:i,whatIf:r,log:ge({diffMode:s})})}};b();import Fd from"isomorphic-unfetch";var ia={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a quirk",builder:e=>H(k(e.positional("id",{demandOption:!0,describe:"Quirk public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Ne({apiKey:t,apiHost:e,fetch:Fd,projectId:i}).remove({quirkId:n})}};b();import Ld from"isomorphic-unfetch";var ra={command:"update <filename>",aliases:["put"],describe:"Insert or update a quirk",builder:e=>H(k(e.positional("filename",{demandOption:!0,describe:"Quirk file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new Ne({apiKey:t,apiHost:e,fetch:Ld,projectId:i}),o=yt(n);await r.upsert({quirk:o})}};var oa={command:"quirk <command>",aliases:["qk"],describe:"Commands for Context quirks",builder:e=>e.command(ta).command(na).command(Xs).command(ia).command(ea).command(ra).demandCommand(),handler:()=>{ke.help()}};b();b();import Dd from"isomorphic-unfetch";var sa={command:"get <id>",describe:"Fetch a signal",builder:e=>we(H(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 Te({apiKey:t,apiHost:e,fetch:Dd,projectId:r}).get({signalId:n});a.signals.length===0?(console.error("Signal did not exist"),process.exit(1)):he(a.signals[0],i,o)}};b();import Nd from"isomorphic-unfetch";var aa={command:"list",describe:"List signals",aliases:["ls"],builder:e=>we(H(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new Te({apiKey:t,apiHost:e,fetch:Nd,projectId:r}).get();he(s.signals,n,i)}};b();import Td from"isomorphic-unfetch";b();var vt=e=>e.id,Et=e=>`${e.name} (pid: ${e.id})`;b();function si({client:e}){async function*t(){let n=(await e.get()).signals;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.remove({signalId:n})},writeObject:async n=>{await e.upsert({signal:n.object})}}}var la={command:"pull <directory>",describe:"Pulls all signals to local files in a directory",builder:e=>H(k(xe(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 Te({apiKey:t,apiHost:e,fetch:Td,projectId:s,limitPolicy:ve}),u=si({client:l}),d;if(Ce(n)){let g=_e(n,!1);d=await Ae({objects:(p=g.signals)!=null?p:[],selectIdentifier:vt,selectDisplayName:Et,onSyncComplete:async(C,w)=>{g.signals=w,wt(n,g)}})}else d=await Oe({directory:n,selectIdentifier:vt,selectDisplayName:Et,format:i});await me({source:u,target:d,mode:r,whatIf:o,log:ge({diffMode:a})})}};b();import Rd from"isomorphic-unfetch";var ca={command:"push <directory>",describe:"Pushes all signals from files in a directory or package to Uniform",builder:e=>H(k(xe(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 Te({apiKey:t,apiHost:e,fetch:Rd,projectId:o,limitPolicy:ve}),l;if(Ce(n)){let p=_e(n,!0);l=await Ae({objects:(f=p.signals)!=null?f:[],selectIdentifier:vt,selectDisplayName:Et})}else l=await Oe({directory:n,selectIdentifier:vt,selectDisplayName:Et});let d=si({client:a});await me({source:l,target:d,mode:i,whatIf:r,log:ge({diffMode:s})})}};b();import Ud from"isomorphic-unfetch";var fa={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a signal",builder:e=>H(k(e.positional("id",{demandOption:!0,describe:"Signal public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Te({apiKey:t,apiHost:e,fetch:Ud,projectId:i}).remove({signalId:n})}};b();import $d from"isomorphic-unfetch";var ua={command:"update <filename>",aliases:["put"],describe:"Insert or update a signal",builder:e=>H(k(e.positional("filename",{demandOption:!0,describe:"Signal file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new Te({apiKey:t,apiHost:e,fetch:$d,projectId:i}),o=yt(n);await r.upsert({signal:o})}};var da={command:"signal <command>",aliases:["sig"],describe:"Commands for Context signals",builder:e=>e.command(la).command(ca).command(sa).command(fa).command(aa).command(ua).demandCommand(),handler:()=>{ke.help()}};var Gb={commands:[{command:"context <command>",aliases:["ctx"],describe:"Uniform Context commands",builder:e=>e.command(Zs).command(da).command(Qs).command(Ys).command(oa).demandCommand(),handler:()=>{ke.showHelp()}}]};export{Gb as uniformCLI};
|
96
|
+
`),s=i?"+":r?"":"-";return n+s+`
|
97
|
+
`}function _s(e){return e[e.length-1]===`
|
98
|
+
`?e.slice(0,-1):e}function Yd(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,Ss(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
|
+
`:"")+Ss(l,t),i=s}return r}function Ss(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 zd(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Rn(e,i),r=Le[n],!r&&Bn(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||Rd(n);return t}function Vd(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 js(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+=Ci(e,t)),e.dump&&$n===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}function Kd(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 Qd(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 Re("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)d="",(!r||i!=="")&&(d+=Ci(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&&$n===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,c&&(d+=Ci(e,t)),gt(e,t+1,u,!0,c)&&(e.dump&&$n===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=s,e.dump=i||"{}"}function Ps(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,Gs.call(a.represent)==="[object Function]")r=a.represent(t,l);else if(qs.call(a.represent,l))r=a.represent[l](t,l);else throw new Re("!<"+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,Ps(e,n,!1)||Ps(e,n,!0);var a=Gs.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?(Qd(e,t,e.dump,i),d&&(e.dump="&ref_"+c+e.dump)):(Kd(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?js(e,t-1,e.dump,i):js(e,t,e.dump,i),d&&(e.dump="&ref_"+c+e.dump)):(Vd(e,t,e.dump),d&&(e.dump="&ref_"+c+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&qd(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Re("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 Jd(e,t){var n=[],r=[],i,s;for(Oi(e,n,r),i=0,s=r.length;i<s;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(s)}function Oi(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)Oi(e[i],t,n);else for(r=Object.keys(e),i=0,s=r.length;i<s;i+=1)Oi(e[r[i]],t,n)}function Xd(e,t){t=t||{};var n=new $d(t);n.noRefs||Jd(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),gt(n,0,r,!0,!0)?n.dump+`
|
105
|
+
`:""}var Zd=Xd,ep={dump:Zd};function Pi(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 ta=Hs.load,F0=Hs.loadAll,na=ep.dump;var T0=Pi("safeLoad","load"),L0=Pi("safeLoadAll","loadAll"),D0=Pi("safeDump","dump");import{writeFileSync as Ih}from"fs";import{extname as Ra}from"path";import{readFileSync as Fh}from"fs";import Th from"fs";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,E=c[g-1],_=c[g+1],B=(_?_.newPos:0)-g;E&&(c[g-1]=void 0);var G=E&&E.newPos+1<a,X=_&&0<=B&&B<l;if(!G&&!X){c[g]=void 0;continue}if(!G||X&&E.newPos<_.newPos?(m=np(_),s.pushComponent(m.components,void 0,!0)):(m=E,m.newPos++,s.pushComponent(m.components,!0,void 0)),B=s.extractCommon(m,n,t,g),m.newPos+1>=a&&B+1>=l)return o(tp(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 tp(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 np(e){return{newPos:e.newPos,components:e.components.slice(0)}}var k0=new yt;var ra=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,ia=/\S/,oa=new yt;oa.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!ia.test(e)&&!ia.test(t)};oa.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]&&ra.test(t[n])&&ra.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Fi=new yt;Fi.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 Ti(e,t,n){return Fi.diff(e,t,n)}var rp=new yt;rp.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var ip=new yt;ip.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Er(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Er=function(t){return typeof t}:Er=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Er(e)}var op=Object.prototype.toString,An=new yt;An.useLongestToken=!0;An.tokenize=Fi.tokenize;An.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(Mi(e,null,null,i),i," ")};An.equals=function(e,t){return yt.prototype.equals.call(An,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function sa(e,t,n){return An.diff(e,t,n)}function Mi(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(op.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]=Mi(e[s],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Er(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]=Mi(e[l],t,n,r,l);t.pop(),n.pop()}else o=e;return o}var Ii=new yt;Ii.tokenize=function(e){return e.slice()};Ii.join=Ii.removeEmpty=function(e){return e};var Wa=io(Na(),1);Ie();Ie();async function we({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 Eh=mi(gi());Ie();function k(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 R(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 Ae(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 xe(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 Ce(e){let t=Ra(e);return t===".yaml"||t===".yml"||t===".json"}function de(e,t,n){let r;if(n&&!t){let i=Ra(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=na(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?Ih(n,r,"utf8"):console.log(r)}function ut(e){let t=Fh(e,"utf8");return ta(t,{filename:e,json:!0})}async function ve({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:r=n}){_h(e)||Sh(e,{recursive:!0});let i=await jh(e,"utf-8"),s=new Set(i.filter(l=>{let f=Mh(l);return f===".json"||f===".yaml"||f===".yml"})),o=l=>ka(e,`${l}.${t}`);async function*a(){for(let l of s){let f=ka(e,l);try{let u=await ut(f);yield{id:n(u),displayName:r(u),providerId:f,object:u}}catch(u){throw console.error(Eh.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 Ph(l)},writeObject:async l=>{de(l.object,t,o(l.id))}}}Ie();function Ua(e,t){if(!t&&!Th.existsSync(e))return{};let n=ut(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function $a(e,t){de(t,void 0,e)}Ie();async function pe({source:e,target:t,compareContents:n=(a,l)=>(0,Wa.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,E)=>{var _;if(!s)try{await t.writeObject(m,E)}catch(B){throw new Dr(B,m)}o({action:"update",id:h,providerId:m.providerId,displayName:(_=m.displayName)!=null?_:m.providerId,whatIf:s,diff:sa(E.object,m.object)})};u.push(g(d,b))}f.delete(h)}else{let g=async(m,E)=>{var _;if(!s)try{await t.writeObject(m)}catch(B){throw new Dr(B,m)}o({action:"create",id:E,providerId:E,displayName:(_=m.displayName)!=null?_:m.providerId,whatIf:s,diff:Ti("",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(E){throw new Dr(E,g)}o({action:"delete",id:g.id,providerId:g.providerId,displayName:(m=g.displayName)!=null?m:g.providerId,whatIf:s,diff:Ti(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 Dr=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,Dr.prototype)}};Ie();var On=mi(gi());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=On.default.green("[A]");break;case"update":l=On.default.white("[U]");break;case"delete":l=On.default.yellow("[D]");break}let f="";(t==="on"||t==="update"&&i==="update")&&(f=`
|
108
|
+
`+a.map(u=>u.added?On.default.green(u.value):u.removed?On.default.red(u.value):u.value).join("")),console.log(`${n!=null?n:""}${o?On.default.gray("[WHATIF]"):""}${l}${r!=null?r:""} ${s}${f}`)}}y();y();y();var Ba=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 Ke=class{constructor(t){oo(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:Ba}}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 En,zn=class extends Ke{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(zn,En),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(se(zn,En));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(se(zn,En));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},$e=zn;En=new WeakMap,Ge($e,En,"/api/v2/aggregate");var Ha={command:"get <id>",describe:"Fetch an aggregate",builder:e=>Ae(k(R(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 $e({apiKey:t,apiHost:e,fetch:Lh,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();import Dh from"isomorphic-unfetch";var Ga={command:"list",describe:"List aggregates",aliases:["ls"],builder:e=>Ae(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new $e({apiKey:t,apiHost:e,fetch:Dh,projectId:i}).get({});de(o.aggregates,n,r)}};y();import kh from"isomorphic-unfetch";y();var It=e=>e.id,Ft=e=>`${e.name} (pid: ${e.id})`;y();function Oe(e,t){return Ua(e,t)}function dt(e,t){$a(e,t)}y();import Nh from"p-limit";var Ee=Nh(8);y();function Nr({client:e,type:t}){async function*n(){let i=(await e.get({type:t})).aggregates;for await(let s of i)yield{id:It(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 qa={command:"pull <directory>",describe:"Pulls all aggregates to local files in a directory",builder:e=>k(R(xe(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 $e({apiKey:t,apiHost:e,fetch:kh,projectId:o,limitPolicy:Ee}),f=Nr({client:l}),u;if(Ce(n)){let h=Oe(n,!1);u=await we({objects:(d=h.aggregates)!=null?d:[],selectIdentifier:It,selectDisplayName:Ft,onSyncComplete:async(b,g)=>{h.aggregates=g,dt(n,h)}})}else u=await ve({directory:n,selectIdentifier:It,selectDisplayName:Ft,format:r});await pe({source:f,target:u,mode:i,whatIf:s,log:he({diffMode:a})})}};y();import Rh from"isomorphic-unfetch";var Ya={command:"push <directory>",describe:"Pushes all aggregates from files in a directory or package to Uniform",builder:e=>k(R(xe(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 $e({apiKey:t,apiHost:e,fetch:Rh,projectId:s,limitPolicy:Ee}),l;if(Ce(n)){let d=Oe(n,!0);l=await we({objects:(c=d.aggregates)!=null?c:[],selectIdentifier:It,selectDisplayName:Ft})}else l=await ve({directory:n,selectIdentifier:It,selectDisplayName:Ft});let u=Nr({client:a});await pe({source:l,target:u,mode:r,whatIf:i,log:he({diffMode:o})}),await u.complete()}};y();import Uh from"isomorphic-unfetch";var za={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an aggregate",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new $e({apiKey:t,apiHost:e,fetch:Uh,projectId:r}).remove({aggregateId:n})}};y();import $h from"isomorphic-unfetch";var Va={command:"update <filename>",aliases:["put"],describe:"Insert or update an aggregate",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Aggregate file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new $e({apiKey:t,apiHost:e,fetch:$h,projectId:r}),s=ut(n);await i.upsert({aggregate:s})}};var Ka={command:"aggregate <command>",aliases:["agg","intent","audience"],describe:"Commands for Context aggregates (intents, audiences)",builder:e=>e.command(qa).command(Ya).command(Ha).command(za).command(Ga).command(Va).demandCommand(),handler:()=>{ke.help()}};y();y();import Wh from"isomorphic-unfetch";y();var _n,Vn,fn=class extends Ke{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(fn,_n),{...t,projectId:n});return await this.apiClient(r)}async upsertCategory(t){let n=this.createUrl(se(fn,_n));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,_n));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,Vn));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,Vn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Qe=fn;_n=new WeakMap,Vn=new WeakMap,Ge(Qe,_n,"/api/v1/enrichments"),Ge(Qe,Vn,"/api/v1/enrichment-values");var Qa={command:"get <id>",describe:"Fetch an enrichment category and its values",builder:e=>Ae(k(R(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 Qe({apiKey:t,apiHost:e,fetch:Wh,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();import Bh from"isomorphic-unfetch";var Ja={command:"list",describe:"List enrichments",aliases:["ls"],builder:e=>Ae(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Qe({apiKey:t,apiHost:e,fetch:Bh,projectId:i}).get();de(o.enrichments,n,r)}};y();import Hh from"isomorphic-unfetch";y();var Tt=e=>e.id,Lt=e=>`${e.name} (pid: ${e.id})`;y();function kr({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=Xa({categoryId:n.id,values:n.object.values}),s=Xa({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 Xa=({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 Za={command:"pull <directory>",describe:"Pulls all enrichments to local files in a directory",builder:e=>k(R(xe(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 Qe({apiKey:t,apiHost:e,fetch:Hh,projectId:o,limitPolicy:Ee}),f=kr({client:l}),u;if(Ce(n)){let h=Oe(n,!1);u=await we({objects:(d=h.enrichments)!=null?d:[],selectIdentifier:Tt,selectDisplayName:Lt,onSyncComplete:async(b,g)=>{h.enrichments=g,dt(n,h)}})}else u=await ve({directory:n,selectIdentifier:Tt,selectDisplayName:Lt,format:r});await pe({source:f,target:u,mode:i,whatIf:s,log:he({diffMode:a})})}};y();import Gh from"isomorphic-unfetch";var el={command:"push <directory>",describe:"Pushes all enrichments from files in a directory or package to Uniform",builder:e=>k(R(xe(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 Qe({apiKey:t,apiHost:e,fetch:Gh,projectId:s,limitPolicy:Ee}),l;if(Ce(n)){let d=Oe(n,!0);l=await we({objects:(c=d.enrichments)!=null?c:[],selectIdentifier:Tt,selectDisplayName:Lt})}else l=await ve({directory:n,selectIdentifier:Tt,selectDisplayName:Lt});let u=kr({client:a});await pe({source:l,target:u,mode:r,whatIf:i,log:he({diffMode:o})})}};y();import qh from"isomorphic-unfetch";var tl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an enrichment category and its values",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Qe({apiKey:t,apiHost:e,fetch:qh,projectId:r}).removeCategory({enrichmentId:n})}};var nl={command:"enrichment <command>",aliases:["enr"],describe:"Commands for Context enrichments",builder:e=>e.command(Za).command(el).command(Qa).command(tl).command(Ja).demandCommand(),handler:()=>{ke.help()}};y();y();var Jn=io(Nl());import{writeFile as gm}from"fs";import ym from"isomorphic-unfetch";import{exit as ro}from"process";y();var qr,no=class extends Ke{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(no,qr),{...t,projectId:n});return await this.apiClient(r)}},Gr=no;qr=new WeakMap,Ge(Gr,qr,"/api/v2/manifest");var kl={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(Jn.default.red("You must specify the project ID")),ro(1));let i=bm(),s=new Gr({apiHost:i,projectId:n,apiKey:e,fetch:ym});try{let o=await s.get({preview:r}),a=JSON.stringify(o,null,2);t?gm(t,a,l=>{l&&(console.error(`Error writing file to ${t}
|
110
|
+
`,l),ro(1)),console.log(Jn.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(Jn.default.red("\u26A0 Error fetching Context manifest")),console.error(Jn.default.gray(` \u2757 ${a}`)),ro(1)}}},bm=()=>process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app";var Rl={command:"manifest <command>",describe:"Commands for context manifests",aliases:["man"],builder:e=>e.command(kl).demandCommand(),handler:()=>{ke.help()}};y();y();import wm from"isomorphic-unfetch";y();var In,Xn=class extends Ke{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(Xn,In),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(se(Xn,In));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(se(Xn,In));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},We=Xn;In=new WeakMap,Ge(We,In,"/api/v2/quirk");var Ul={command:"get <id>",describe:"Fetch a quirk",builder:e=>Ae(k(R(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 We({apiKey:t,apiHost:e,fetch:wm,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();import Am from"isomorphic-unfetch";var $l={command:"list",describe:"List quirks",aliases:["ls"],builder:e=>Ae(k(R(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 We({apiKey:t,apiHost:e,fetch:Am,projectId:i}).get({withIntegrations:s});de(a.quirks,n,r)}};y();import xm from"isomorphic-unfetch";y();var Nt=e=>e.id,kt=e=>`${e.name} (pid: ${e.id})`;y();function Yr({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 Wl={command:"pull <directory>",describe:"Pulls all quirks to local files in a directory",builder:e=>k(R(xe(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 We({apiKey:t,apiHost:e,fetch:xm,projectId:o,limitPolicy:Ee}),f=Yr({client:l}),u;if(Ce(n)){let h=Oe(n,!1);u=await we({objects:(d=h.quirks)!=null?d:[],selectIdentifier:Nt,selectDisplayName:kt,onSyncComplete:async(b,g)=>{h.quirks=g,dt(n,h)}})}else u=await ve({directory:n,selectIdentifier:Nt,selectDisplayName:kt,format:r});await pe({source:f,target:u,mode:i,whatIf:s,log:he({diffMode:a})})}};y();import Cm from"isomorphic-unfetch";var Bl={command:"push <directory>",describe:"Pushes all quirks from files in a directory or package to Uniform",builder:e=>k(R(xe(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 We({apiKey:t,apiHost:e,fetch:Cm,projectId:s,limitPolicy:Ee}),l;if(Ce(n)){let d=Oe(n,!0);l=await we({objects:(c=d.quirks)!=null?c:[],selectIdentifier:Nt,selectDisplayName:kt})}else l=await ve({directory:n,selectIdentifier:Nt,selectDisplayName:kt});let u=Yr({client:a});await pe({source:l,target:u,mode:r,whatIf:i,log:he({diffMode:o})})}};y();import vm from"isomorphic-unfetch";var Hl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a quirk",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Quirk public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new We({apiKey:t,apiHost:e,fetch:vm,projectId:r}).remove({quirkId:n})}};y();import Om from"isomorphic-unfetch";var Gl={command:"update <filename>",aliases:["put"],describe:"Insert or update a quirk",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Quirk file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new We({apiKey:t,apiHost:e,fetch:Om,projectId:r}),s=ut(n);await i.upsert({quirk:s})}};var ql={command:"quirk <command>",aliases:["qk"],describe:"Commands for Context quirks",builder:e=>e.command(Wl).command(Bl).command(Ul).command(Hl).command($l).command(Gl).demandCommand(),handler:()=>{ke.help()}};y();y();import Em from"isomorphic-unfetch";y();var Fn,Zn=class extends Ke{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(Zn,Fn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(se(Zn,Fn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(se(Zn,Fn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Be=Zn;Fn=new WeakMap,Ge(Be,Fn,"/api/v2/signal");var Yl={command:"get <id>",describe:"Fetch a signal",builder:e=>Ae(k(R(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 Be({apiKey:t,apiHost:e,fetch:Em,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();import _m from"isomorphic-unfetch";var zl={command:"list",describe:"List signals",aliases:["ls"],builder:e=>Ae(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Be({apiKey:t,apiHost:e,fetch:_m,projectId:i}).get();de(o.signals,n,r)}};y();import Sm from"isomorphic-unfetch";y();var Rt=e=>e.id,Ut=e=>`${e.name} (pid: ${e.id})`;y();function zr({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 Vl={command:"pull <directory>",describe:"Pulls all signals to local files in a directory",builder:e=>k(R(xe(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 Be({apiKey:t,apiHost:e,fetch:Sm,projectId:o,limitPolicy:Ee}),f=zr({client:l}),u;if(Ce(n)){let h=Oe(n,!1);u=await we({objects:(d=h.signals)!=null?d:[],selectIdentifier:Rt,selectDisplayName:Ut,onSyncComplete:async(b,g)=>{h.signals=g,dt(n,h)}})}else u=await ve({directory:n,selectIdentifier:Rt,selectDisplayName:Ut,format:r});await pe({source:f,target:u,mode:i,whatIf:s,log:he({diffMode:a})})}};y();import jm from"isomorphic-unfetch";var Kl={command:"push <directory>",describe:"Pushes all signals from files in a directory or package to Uniform",builder:e=>k(R(xe(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 Be({apiKey:t,apiHost:e,fetch:jm,projectId:s,limitPolicy:Ee}),l;if(Ce(n)){let d=Oe(n,!0);l=await we({objects:(c=d.signals)!=null?c:[],selectIdentifier:Rt,selectDisplayName:Ut})}else l=await ve({directory:n,selectIdentifier:Rt,selectDisplayName:Ut});let u=zr({client:a});await pe({source:l,target:u,mode:r,whatIf:i,log:he({diffMode:o})})}};y();import Pm from"isomorphic-unfetch";var Ql={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a signal",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Signal public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Be({apiKey:t,apiHost:e,fetch:Pm,projectId:r}).remove({signalId:n})}};y();import Mm from"isomorphic-unfetch";var Jl={command:"update <filename>",aliases:["put"],describe:"Insert or update a signal",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Signal file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new Be({apiKey:t,apiHost:e,fetch:Mm,projectId:r}),s=ut(n);await i.upsert({signal:s})}};var Xl={command:"signal <command>",aliases:["sig"],describe:"Commands for Context signals",builder:e=>e.command(Vl).command(Kl).command(Yl).command(Ql).command(zl).command(Jl).demandCommand(),handler:()=>{ke.help()}};y();y();import Im from"isomorphic-unfetch";y();var Tn,er=class extends Ke{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(se(er,Tn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(se(er,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(er,Tn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},He=er;Tn=new WeakMap,Ge(He,Tn,"/api/v2/test");var Zl={command:"get <id>",describe:"Fetch a test",builder:e=>Ae(k(R(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 He({apiKey:t,apiHost:e,fetch:Im,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();import Fm from"isomorphic-unfetch";var ec={command:"list",describe:"List tests",aliases:["ls"],builder:e=>Ae(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new He({apiKey:t,apiHost:e,fetch:Fm,projectId:i}).get();de(o.tests,n,r)}};y();import Tm from"isomorphic-unfetch";y();var $t=e=>e.id,Wt=e=>`${e.name} (pid: ${e.id})`;y();function Vr({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 tc={command:"pull <directory>",describe:"Pulls all tests to local files in a directory",builder:e=>k(R(xe(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 He({apiKey:t,apiHost:e,fetch:Tm,projectId:o,limitPolicy:Ee}),f=Vr({client:l}),u;if(Ce(n)){let h=Oe(n,!1);u=await we({objects:(d=h.tests)!=null?d:[],selectIdentifier:$t,selectDisplayName:Wt,onSyncComplete:async(b,g)=>{h.tests=g,dt(n,h)}})}else u=await ve({directory:n,selectIdentifier:$t,selectDisplayName:Wt,format:r});await pe({source:f,target:u,mode:i,whatIf:s,log:he({diffMode:a})})}};y();import Lm from"isomorphic-unfetch";var nc={command:"push <directory>",describe:"Pushes all tests from files in a directory or package to Uniform",builder:e=>k(R(xe(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 He({apiKey:t,apiHost:e,fetch:Lm,projectId:s,limitPolicy:Ee}),l;if(Ce(n)){let d=Oe(n,!0);l=await we({objects:(c=d.tests)!=null?c:[],selectIdentifier:$t,selectDisplayName:Wt})}else l=await ve({directory:n,selectIdentifier:$t,selectDisplayName:Wt});let u=Vr({client:a});await pe({source:l,target:u,mode:r,whatIf:i,log:he({diffMode:o})})}};y();import Dm from"isomorphic-unfetch";var rc={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a test",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Test public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new He({apiKey:t,apiHost:e,fetch:Dm,projectId:r}).remove({testId:n})}};y();import Nm from"isomorphic-unfetch";var ic={command:"update <filename>",aliases:["put"],describe:"Insert or update a test",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Test file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new He({apiKey:t,apiHost:e,fetch:Nm,projectId:r}),s=ut(n);await i.upsert({test:s})}};var oc={command:"test <command>",describe:"Commands for Context A/B tests",builder:e=>e.command(tc).command(nc).command(Zl).command(rc).command(ec).command(ic).demandCommand(),handler:()=>{ke.help()}};var _x={commands:[{command:"context <command>",aliases:["ctx"],describe:"Uniform Context commands",builder:e=>e.command(Rl).command(Xl).command(nl).command(Ka).command(ql).command(oc).demandCommand(),handler:()=>{ke.showHelp()}}]};export{Oe as readContextPackage,_x as uniformCLI,dt as 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
|