@uniformdev/context 16.1.1-alpha.321 → 16.2.1-alpha.106

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/cli/cli.mjs CHANGED
@@ -1,18 +1,18 @@
1
- var ic=Object.create;var Yr=Object.defineProperty;var oc=Object.getOwnPropertyDescriptor;var sc=Object.getOwnPropertyNames;var ac=Object.getPrototypeOf,lc=Object.prototype.hasOwnProperty;var cc=(e,t,n)=>t in e?Yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ve=(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 tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var fc=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sc(t))!lc.call(e,i)&&i!==n&&Yr(e,i,{get:()=>t[i],enumerable:!(r=oc(t,i))||r.enumerable});return e};var ao=(e,t,n)=>(n=e!=null?ic(ac(e)):{},fc(t||!e||!e.__esModule?Yr(n,"default",{value:e,enumerable:!0}):n,e));var lo=(e,t,n)=>(cc(e,typeof t!="symbol"?t+"":t,n),n),uc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var oe=(e,t,n)=>(uc(e,t,"read from private field"),n?n.call(e):t.get(e)),He=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var Da=tt(($n,yn)=>{var ep=200,qi="__lodash_hash_undefined__",ga=1,jr=2,ya=9007199254740991,Or="[object Arguments]",ki="[object Array]",ba="[object Boolean]",wa="[object Date]",Aa="[object Error]",xa="[object Function]",tp="[object GeneratorFunction]",vr="[object Map]",Ca="[object Number]",gn="[object Object]",sa="[object Promise]",Oa="[object RegExp]",Er="[object Set]",va="[object String]",np="[object Symbol]",Ri="[object WeakMap]",Ea="[object ArrayBuffer]",_r="[object DataView]",rp="[object Float32Array]",ip="[object Float64Array]",op="[object Int8Array]",sp="[object Int16Array]",ap="[object Int32Array]",lp="[object Uint8Array]",cp="[object Uint8ClampedArray]",fp="[object Uint16Array]",up="[object Uint32Array]",dp=/[\\^$.*+?()[\]{}|]/g,pp=/^\[object .+?Constructor\]$/,hp=/^(?:0|[1-9]\d*)$/,ie={};ie[rp]=ie[ip]=ie[op]=ie[sp]=ie[ap]=ie[lp]=ie[cp]=ie[fp]=ie[up]=!0;ie[Or]=ie[ki]=ie[Ea]=ie[ba]=ie[_r]=ie[wa]=ie[Aa]=ie[xa]=ie[vr]=ie[Ca]=ie[gn]=ie[Oa]=ie[Er]=ie[va]=ie[Ri]=!1;var _a=typeof global=="object"&&global&&global.Object===Object&&global,mp=typeof self=="object"&&self&&self.Object===Object&&self,_t=_a||mp||Function("return this")(),Sa=typeof $n=="object"&&$n&&!$n.nodeType&&$n,aa=Sa&&typeof yn=="object"&&yn&&!yn.nodeType&&yn,gp=aa&&aa.exports===Sa,la=gp&&_a.process,ca=function(){try{return la&&la.binding("util")}catch(e){}}(),fa=ca&&ca.isTypedArray;function yp(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function bp(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function wp(e){return function(t){return e(t)}}function Ap(e,t){return e==null?void 0:e[t]}function Ui(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function xp(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Cp(e,t){return function(n){return e(t(n))}}function Op(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var vp=Array.prototype,Ep=Function.prototype,Pr=Object.prototype,Di=_t["__core-js_shared__"],ua=function(){var e=/[^.]+$/.exec(Di&&Di.keys&&Di.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ja=Ep.toString,pt=Pr.hasOwnProperty,Gn=Pr.toString,_p=RegExp("^"+ja.call(pt).replace(dp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),da=_t.Symbol,pa=_t.Uint8Array,Sp=Pr.propertyIsEnumerable,jp=vp.splice,Pp=Cp(Object.keys,Object),$i=bn(_t,"DataView"),Wn=bn(_t,"Map"),Wi=bn(_t,"Promise"),Bi=bn(_t,"Set"),Gi=bn(_t,"WeakMap"),Bn=bn(Object,"create"),Ip=nn($i),Mp=nn(Wn),Fp=nn(Wi),Tp=nn(Bi),Lp=nn(Gi),ha=da?da.prototype:void 0,Ni=ha?ha.valueOf:void 0;function en(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 Dp(){this.__data__=Bn?Bn(null):{}}function Np(e){return this.has(e)&&delete this.__data__[e]}function kp(e){var t=this.__data__;if(Bn){var n=t[e];return n===qi?void 0:n}return pt.call(t,e)?t[e]:void 0}function Rp(e){var t=this.__data__;return Bn?t[e]!==void 0:pt.call(t,e)}function Up(e,t){var n=this.__data__;return n[e]=Bn&&t===void 0?qi:t,this}en.prototype.clear=Dp;en.prototype.delete=Np;en.prototype.get=kp;en.prototype.has=Rp;en.prototype.set=Up;function ht(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 $p(){this.__data__=[]}function Wp(e){var t=this.__data__,n=Ir(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():jp.call(t,n,1),!0}function Bp(e){var t=this.__data__,n=Ir(t,e);return n<0?void 0:t[n][1]}function Gp(e){return Ir(this.__data__,e)>-1}function Hp(e,t){var n=this.__data__,r=Ir(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}ht.prototype.clear=$p;ht.prototype.delete=Wp;ht.prototype.get=Bp;ht.prototype.has=Gp;ht.prototype.set=Hp;function tn(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 qp(){this.__data__={hash:new en,map:new(Wn||ht),string:new en}}function Yp(e){return Mr(this,e).delete(e)}function zp(e){return Mr(this,e).get(e)}function Vp(e){return Mr(this,e).has(e)}function Kp(e,t){return Mr(this,e).set(e,t),this}tn.prototype.clear=qp;tn.prototype.delete=Yp;tn.prototype.get=zp;tn.prototype.has=Vp;tn.prototype.set=Kp;function Sr(e){var t=-1,n=e?e.length:0;for(this.__data__=new tn;++t<n;)this.add(e[t])}function Qp(e){return this.__data__.set(e,qi),this}function Jp(e){return this.__data__.has(e)}Sr.prototype.add=Sr.prototype.push=Qp;Sr.prototype.has=Jp;function Et(e){this.__data__=new ht(e)}function Xp(){this.__data__=new ht}function Zp(e){return this.__data__.delete(e)}function eh(e){return this.__data__.get(e)}function th(e){return this.__data__.has(e)}function nh(e,t){var n=this.__data__;if(n instanceof ht){var r=n.__data__;if(!Wn||r.length<ep-1)return r.push([e,t]),this;n=this.__data__=new tn(r)}return n.set(e,t),this}Et.prototype.clear=Xp;Et.prototype.delete=Zp;Et.prototype.get=eh;Et.prototype.has=th;Et.prototype.set=nh;function rh(e,t){var n=Hi(e)||mh(e)?bp(e.length,String):[],r=n.length,i=!!r;for(var s in e)(t||pt.call(e,s))&&!(i&&(s=="length"||uh(s,r)))&&n.push(s);return n}function Ir(e,t){for(var n=e.length;n--;)if(Ma(e[n][0],t))return n;return-1}function ih(e){return Gn.call(e)}function Pa(e,t,n,r,i){return e===t?!0:e==null||t==null||!Yi(e)&&!zi(t)?e!==e&&t!==t:oh(e,t,Pa,n,r,i)}function oh(e,t,n,r,i,s){var o=Hi(e),a=Hi(t),l=ki,c=ki;o||(l=vt(e),l=l==Or?gn:l),a||(c=vt(t),c=c==Or?gn:c);var f=l==gn&&!Ui(e),u=c==gn&&!Ui(t),d=l==c;if(d&&!f)return s||(s=new Et),o||bh(e)?Ia(e,t,n,r,i,s):ch(e,t,l,n,r,i,s);if(!(i&jr)){var p=f&&pt.call(e,"__wrapped__"),y=u&&pt.call(t,"__wrapped__");if(p||y){var g=p?e.value():e,m=y?t.value():t;return s||(s=new Et),n(g,m,r,i,s)}}return d?(s||(s=new Et),fh(e,t,n,r,i,s)):!1}function sh(e){if(!Yi(e)||ph(e))return!1;var t=Ta(e)||Ui(e)?_p:pp;return t.test(nn(e))}function ah(e){return zi(e)&&La(e.length)&&!!ie[Gn.call(e)]}function lh(e){if(!hh(e))return Pp(e);var t=[];for(var n in Object(e))pt.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ia(e,t,n,r,i,s){var o=i&jr,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(e);if(c&&s.get(t))return c==t;var f=-1,u=!0,d=i&ga?new Sr:void 0;for(s.set(e,t),s.set(t,e);++f<a;){var p=e[f],y=t[f];if(r)var g=o?r(y,p,f,t,e,s):r(p,y,f,e,t,s);if(g!==void 0){if(g)continue;u=!1;break}if(d){if(!yp(t,function(m,C){if(!d.has(C)&&(p===m||n(p,m,r,i,s)))return d.add(C)})){u=!1;break}}else if(!(p===y||n(p,y,r,i,s))){u=!1;break}}return s.delete(e),s.delete(t),u}function ch(e,t,n,r,i,s,o){switch(n){case _r:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ea:return!(e.byteLength!=t.byteLength||!r(new pa(e),new pa(t)));case ba:case wa:case Ca:return Ma(+e,+t);case Aa:return e.name==t.name&&e.message==t.message;case Oa:case va:return e==t+"";case vr:var a=xp;case Er:var l=s&jr;if(a||(a=Op),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;s|=ga,o.set(e,t);var f=Ia(a(e),a(t),r,i,s,o);return o.delete(e),f;case np:if(Ni)return Ni.call(e)==Ni.call(t)}return!1}function fh(e,t,n,r,i,s){var o=i&jr,a=ma(e),l=a.length,c=ma(t),f=c.length;if(l!=f&&!o)return!1;for(var u=l;u--;){var d=a[u];if(!(o?d in t:pt.call(t,d)))return!1}var p=s.get(e);if(p&&s.get(t))return p==t;var y=!0;s.set(e,t),s.set(t,e);for(var g=o;++u<l;){d=a[u];var m=e[d],C=t[d];if(r)var O=o?r(C,m,d,t,e,s):r(m,C,d,e,t,s);if(!(O===void 0?m===C||n(m,C,r,i,s):O)){y=!1;break}g||(g=d=="constructor")}if(y&&!g){var N=e.constructor,Y=t.constructor;N!=Y&&"constructor"in e&&"constructor"in t&&!(typeof N=="function"&&N instanceof N&&typeof Y=="function"&&Y instanceof Y)&&(y=!1)}return s.delete(e),s.delete(t),y}function Mr(e,t){var n=e.__data__;return dh(t)?n[typeof t=="string"?"string":"hash"]:n.map}function bn(e,t){var n=Ap(e,t);return sh(n)?n:void 0}var vt=ih;($i&&vt(new $i(new ArrayBuffer(1)))!=_r||Wn&&vt(new Wn)!=vr||Wi&&vt(Wi.resolve())!=sa||Bi&&vt(new Bi)!=Er||Gi&&vt(new Gi)!=Ri)&&(vt=function(e){var t=Gn.call(e),n=t==gn?e.constructor:void 0,r=n?nn(n):void 0;if(r)switch(r){case Ip:return _r;case Mp:return vr;case Fp:return sa;case Tp:return Er;case Lp:return Ri}return t});function uh(e,t){return t=t==null?ya:t,!!t&&(typeof e=="number"||hp.test(e))&&e>-1&&e%1==0&&e<t}function dh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ph(e){return!!ua&&ua in e}function hh(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Pr;return e===n}function nn(e){if(e!=null){try{return ja.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ma(e,t){return e===t||e!==e&&t!==t}function mh(e){return gh(e)&&pt.call(e,"callee")&&(!Sp.call(e,"callee")||Gn.call(e)==Or)}var Hi=Array.isArray;function Fa(e){return e!=null&&La(e.length)&&!Ta(e)}function gh(e){return zi(e)&&Fa(e)}function yh(e,t,n){n=typeof n=="function"?n:void 0;var r=n?n(e,t):void 0;return r===void 0?Pa(e,t,n):!!r}function Ta(e){var t=Yi(e)?Gn.call(e):"";return t==xa||t==tp}function La(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ya}function Yi(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function zi(e){return!!e&&typeof e=="object"}var bh=fa?wp(fa):ah;function ma(e){return Fa(e)?rh(e):lh(e)}yn.exports=yh});var rl=tt((gb,nl)=>{"use strict";nl.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 Vi=tt((yb,ol)=>{var Yn=rl(),il={};for(let e of Object.keys(Yn))il[Yn[e]]=e;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"]}};ol.exports=I;for(let e of Object.keys(I)){if(!("channels"in I[e]))throw new Error("missing channels property: "+e);if(!("labels"in I[e]))throw new Error("missing channel labels property: "+e);if(I[e].labels.length!==I[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=I[e];delete I[e].channels,delete I[e].labels,Object.defineProperty(I[e],"channels",{value:t}),Object.defineProperty(I[e],"labels",{value:n})}I.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 c=(i+s)/2;return s===i?l=0:c<=.5?l=o/(s+i):l=o/(2-s-i),[a,l*100,c*100]};I.rgb.hsv=function(e){let t,n,r,i,s,o=e[0]/255,a=e[1]/255,l=e[2]/255,c=Math.max(o,a,l),f=c-Math.min(o,a,l),u=function(d){return(c-d)/6/f+1/2};return f===0?(i=0,s=0):(s=f/c,t=u(o),n=u(a),r=u(l),o===c?i=r-n:a===c?i=1/3+t-r:l===c&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};I.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=I.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]};I.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 $h(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}I.rgb.keyword=function(e){let t=il[e];if(t)return t;let n=1/0,r;for(let i of Object.keys(Yn)){let s=Yn[i],o=$h(e,s);o<n&&(n=o,r=i)}return r};I.keyword.rgb=function(e){return Yn[e]};I.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]};I.rgb.lab=function(e){let t=I.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]};I.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 c=0;c<3;c++)s=t+1/3*-(c-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[c]=o*255;return l};I.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]};I.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]}};I.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]};I.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),c,f,u;switch(o){default:case 6:case 0:c=a,f=l,u=n;break;case 1:c=l,f=a,u=n;break;case 2:c=n,f=a,u=l;break;case 3:c=n,f=l,u=a;break;case 4:c=l,f=n,u=a;break;case 5:c=a,f=n,u=l;break}return[c*255,f*255,u*255]};I.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]};I.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]};I.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]};I.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,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};I.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]};I.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]};I.rgb.ansi16=function(e,t=null){let[n,r,i]=e,s=t===null?I.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};I.hsv.ansi16=function(e){return I.rgb.ansi16(I.hsv.rgb(e),e[2])};I.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)};I.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]};I.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]};I.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};I.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]};I.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]};I.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]};I.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]};I.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]};I.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]};I.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]};I.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]};I.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]};I.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};I.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};I.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};I.gray.hsl=function(e){return[0,0,e[0]]};I.gray.hsv=I.gray.hsl;I.gray.hwb=function(e){return[0,100,e[0]]};I.gray.cmyk=function(e){return[0,0,0,e[0]]};I.gray.lab=function(e){return[e[0],0,0]};I.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};I.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var al=tt((bb,sl)=>{var Dr=Vi();function Wh(){let e={},t=Object.keys(Dr);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function Bh(e){let t=Wh(),n=[e];for(t[e].distance=0;n.length;){let r=n.pop(),i=Object.keys(Dr[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 Gh(e,t){return function(n){return t(e(n))}}function Hh(e,t){let n=[t[e].parent,e],r=Dr[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=Gh(Dr[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}sl.exports=function(e){let t=Bh(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]=Hh(o,t))}return n}});var cl=tt((wb,ll)=>{var Ki=Vi(),qh=al(),Cn={},Yh=Object.keys(Ki);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 Vh(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}Yh.forEach(e=>{Cn[e]={},Object.defineProperty(Cn[e],"channels",{value:Ki[e].channels}),Object.defineProperty(Cn[e],"labels",{value:Ki[e].labels});let t=qh(e);Object.keys(t).forEach(r=>{let i=t[r];Cn[e][r]=Vh(i),Cn[e][r].raw=zh(i)})});ll.exports=Cn});var ml=tt((Ab,hl)=>{"use strict";var fl=(e,t)=>(...n)=>`\x1B[${e(...n)+t}m`,ul=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};5;${r}m`},dl=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},Nr=e=>e,pl=(e,t,n)=>[e,t,n],On=(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})},Qi,vn=(e,t,n,r)=>{Qi===void 0&&(Qi=cl());let i=r?10:0,s={};for(let[o,a]of Object.entries(Qi)){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 Kh(){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",On(t.color,"ansi",()=>vn(fl,"ansi16",Nr,!1)),On(t.color,"ansi256",()=>vn(ul,"ansi256",Nr,!1)),On(t.color,"ansi16m",()=>vn(dl,"rgb",pl,!1)),On(t.bgColor,"ansi",()=>vn(fl,"ansi16",Nr,!0)),On(t.bgColor,"ansi256",()=>vn(ul,"ansi256",Nr,!0)),On(t.bgColor,"ansi16m",()=>vn(dl,"rgb",pl,!0)),t}Object.defineProperty(hl,"exports",{enumerable:!0,get:Kh})});var yl=tt((xb,gl)=>{"use strict";gl.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}});var Al=tt((Cb,wl)=>{"use strict";var Qh=ve("os"),bl=ve("tty"),et=yl(),{env:je}=process,Ft;et("no-color")||et("no-colors")||et("color=false")||et("color=never")?Ft=0:(et("color")||et("colors")||et("color=true")||et("color=always"))&&(Ft=1);"FORCE_COLOR"in je&&(je.FORCE_COLOR==="true"?Ft=1:je.FORCE_COLOR==="false"?Ft=0:Ft=je.FORCE_COLOR.length===0?1:Math.min(parseInt(je.FORCE_COLOR,10),3));function Ji(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Xi(e,t){if(Ft===0)return 0;if(et("color=16m")||et("color=full")||et("color=truecolor"))return 3;if(et("color=256"))return 2;if(e&&!t&&Ft===void 0)return 0;let n=Ft||0;if(je.TERM==="dumb")return n;if(process.platform==="win32"){let r=Qh.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in je)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in je)||je.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in je)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(je.TEAMCITY_VERSION)?1:0;if(je.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in je){let r=parseInt((je.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(je.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(je.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(je.TERM)||"COLORTERM"in je?1:n}function Jh(e){let t=Xi(e,e&&e.isTTY);return Ji(t)}wl.exports={supportsColor:Jh,stdout:Ji(Xi(!0,bl.isatty(1))),stderr:Ji(Xi(!0,bl.isatty(2)))}});var Cl=tt((Ob,xl)=>{"use strict";var Xh=(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},Zh=(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
1
+ var rc=Object.create;var Yr=Object.defineProperty;var ic=Object.getOwnPropertyDescriptor;var oc=Object.getOwnPropertyNames;var sc=Object.getPrototypeOf,ac=Object.prototype.hasOwnProperty;var lc=(e,t,n)=>t in e?Yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ve=(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 tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var cc=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of oc(t))!ac.call(e,i)&&i!==n&&Yr(e,i,{get:()=>t[i],enumerable:!(r=ic(t,i))||r.enumerable});return e};var zr=(e,t,n)=>(n=e!=null?rc(sc(e)):{},cc(t||!e||!e.__esModule?Yr(n,"default",{value:e,enumerable:!0}):n,e));var co=(e,t,n)=>(lc(e,typeof t!="symbol"?t+"":t,n),n),fc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var oe=(e,t,n)=>(fc(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 La=tt((Wn,yn)=>{var Kd=200,qi="__lodash_hash_undefined__",ma=1,Pr=2,ga=9007199254740991,Or="[object Arguments]",ki="[object Array]",ba="[object Boolean]",ya="[object Date]",wa="[object Error]",Aa="[object Function]",Qd="[object GeneratorFunction]",vr="[object Map]",xa="[object Number]",bn="[object Object]",oa="[object Promise]",Ca="[object RegExp]",Er="[object Set]",Oa="[object String]",Jd="[object Symbol]",Ri="[object WeakMap]",va="[object ArrayBuffer]",_r="[object DataView]",Xd="[object Float32Array]",Zd="[object Float64Array]",ep="[object Int8Array]",tp="[object Int16Array]",np="[object Int32Array]",rp="[object Uint8Array]",ip="[object Uint8ClampedArray]",op="[object Uint16Array]",sp="[object Uint32Array]",ap=/[\\^$.*+?()[\]{}|]/g,lp=/^\[object .+?Constructor\]$/,cp=/^(?:0|[1-9]\d*)$/,ie={};ie[Xd]=ie[Zd]=ie[ep]=ie[tp]=ie[np]=ie[rp]=ie[ip]=ie[op]=ie[sp]=!0;ie[Or]=ie[ki]=ie[va]=ie[ba]=ie[_r]=ie[ya]=ie[wa]=ie[Aa]=ie[vr]=ie[xa]=ie[bn]=ie[Ca]=ie[Er]=ie[Oa]=ie[Ri]=!1;var Ea=typeof global=="object"&&global&&global.Object===Object&&global,fp=typeof self=="object"&&self&&self.Object===Object&&self,St=Ea||fp||Function("return this")(),_a=typeof Wn=="object"&&Wn&&!Wn.nodeType&&Wn,sa=_a&&typeof yn=="object"&&yn&&!yn.nodeType&&yn,up=sa&&sa.exports===_a,aa=up&&Ea.process,la=function(){try{return aa&&aa.binding("util")}catch(e){}}(),ca=la&&la.isTypedArray;function dp(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function pp(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function hp(e){return function(t){return e(t)}}function mp(e,t){return e==null?void 0:e[t]}function Ui(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function gp(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function bp(e,t){return function(n){return e(t(n))}}function yp(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var wp=Array.prototype,Ap=Function.prototype,jr=Object.prototype,Di=St["__core-js_shared__"],fa=function(){var e=/[^.]+$/.exec(Di&&Di.keys&&Di.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Sa=Ap.toString,ht=jr.hasOwnProperty,Gn=jr.toString,xp=RegExp("^"+Sa.call(ht).replace(ap,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ua=St.Symbol,da=St.Uint8Array,Cp=jr.propertyIsEnumerable,Op=wp.splice,vp=bp(Object.keys,Object),$i=wn(St,"DataView"),Bn=wn(St,"Map"),Wi=wn(St,"Promise"),Bi=wn(St,"Set"),Hi=wn(St,"WeakMap"),Hn=wn(Object,"create"),Ep=nn($i),_p=nn(Bn),Sp=nn(Wi),Pp=nn(Bi),jp=nn(Hi),pa=ua?ua.prototype:void 0,Ni=pa?pa.valueOf:void 0;function en(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 Mp(){this.__data__=Hn?Hn(null):{}}function Ip(e){return this.has(e)&&delete this.__data__[e]}function Fp(e){var t=this.__data__;if(Hn){var n=t[e];return n===qi?void 0:n}return ht.call(t,e)?t[e]:void 0}function Tp(e){var t=this.__data__;return Hn?t[e]!==void 0:ht.call(t,e)}function Lp(e,t){var n=this.__data__;return n[e]=Hn&&t===void 0?qi:t,this}en.prototype.clear=Mp;en.prototype.delete=Ip;en.prototype.get=Fp;en.prototype.has=Tp;en.prototype.set=Lp;function mt(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 Dp(){this.__data__=[]}function Np(e){var t=this.__data__,n=Mr(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Op.call(t,n,1),!0}function kp(e){var t=this.__data__,n=Mr(t,e);return n<0?void 0:t[n][1]}function Rp(e){return Mr(this.__data__,e)>-1}function Up(e,t){var n=this.__data__,r=Mr(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}mt.prototype.clear=Dp;mt.prototype.delete=Np;mt.prototype.get=kp;mt.prototype.has=Rp;mt.prototype.set=Up;function tn(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 $p(){this.__data__={hash:new en,map:new(Bn||mt),string:new en}}function Wp(e){return Ir(this,e).delete(e)}function Bp(e){return Ir(this,e).get(e)}function Hp(e){return Ir(this,e).has(e)}function Gp(e,t){return Ir(this,e).set(e,t),this}tn.prototype.clear=$p;tn.prototype.delete=Wp;tn.prototype.get=Bp;tn.prototype.has=Hp;tn.prototype.set=Gp;function Sr(e){var t=-1,n=e?e.length:0;for(this.__data__=new tn;++t<n;)this.add(e[t])}function qp(e){return this.__data__.set(e,qi),this}function Yp(e){return this.__data__.has(e)}Sr.prototype.add=Sr.prototype.push=qp;Sr.prototype.has=Yp;function _t(e){this.__data__=new mt(e)}function zp(){this.__data__=new mt}function Vp(e){return this.__data__.delete(e)}function Kp(e){return this.__data__.get(e)}function Qp(e){return this.__data__.has(e)}function Jp(e,t){var n=this.__data__;if(n instanceof mt){var r=n.__data__;if(!Bn||r.length<Kd-1)return r.push([e,t]),this;n=this.__data__=new tn(r)}return n.set(e,t),this}_t.prototype.clear=zp;_t.prototype.delete=Vp;_t.prototype.get=Kp;_t.prototype.has=Qp;_t.prototype.set=Jp;function Xp(e,t){var n=Gi(e)||fh(e)?pp(e.length,String):[],r=n.length,i=!!r;for(var s in e)(t||ht.call(e,s))&&!(i&&(s=="length"||sh(s,r)))&&n.push(s);return n}function Mr(e,t){for(var n=e.length;n--;)if(Ma(e[n][0],t))return n;return-1}function Zp(e){return Gn.call(e)}function Pa(e,t,n,r,i){return e===t?!0:e==null||t==null||!Yi(e)&&!zi(t)?e!==e&&t!==t:eh(e,t,Pa,n,r,i)}function eh(e,t,n,r,i,s){var o=Gi(e),a=Gi(t),l=ki,c=ki;o||(l=Et(e),l=l==Or?bn:l),a||(c=Et(t),c=c==Or?bn:c);var f=l==bn&&!Ui(e),u=c==bn&&!Ui(t),d=l==c;if(d&&!f)return s||(s=new _t),o||ph(e)?ja(e,t,n,r,i,s):ih(e,t,l,n,r,i,s);if(!(i&Pr)){var p=f&&ht.call(e,"__wrapped__"),b=u&&ht.call(t,"__wrapped__");if(p||b){var g=p?e.value():e,m=b?t.value():t;return s||(s=new _t),n(g,m,r,i,s)}}return d?(s||(s=new _t),oh(e,t,n,r,i,s)):!1}function th(e){if(!Yi(e)||lh(e))return!1;var t=Fa(e)||Ui(e)?xp:lp;return t.test(nn(e))}function nh(e){return zi(e)&&Ta(e.length)&&!!ie[Gn.call(e)]}function rh(e){if(!ch(e))return vp(e);var t=[];for(var n in Object(e))ht.call(e,n)&&n!="constructor"&&t.push(n);return t}function ja(e,t,n,r,i,s){var o=i&Pr,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(e);if(c&&s.get(t))return c==t;var f=-1,u=!0,d=i&ma?new Sr:void 0;for(s.set(e,t),s.set(t,e);++f<a;){var p=e[f],b=t[f];if(r)var g=o?r(b,p,f,t,e,s):r(p,b,f,e,t,s);if(g!==void 0){if(g)continue;u=!1;break}if(d){if(!dp(t,function(m,C){if(!d.has(C)&&(p===m||n(p,m,r,i,s)))return d.add(C)})){u=!1;break}}else if(!(p===b||n(p,b,r,i,s))){u=!1;break}}return s.delete(e),s.delete(t),u}function ih(e,t,n,r,i,s,o){switch(n){case _r:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case va:return!(e.byteLength!=t.byteLength||!r(new da(e),new da(t)));case ba:case ya:case xa:return Ma(+e,+t);case wa:return e.name==t.name&&e.message==t.message;case Ca:case Oa:return e==t+"";case vr:var a=gp;case Er:var l=s&Pr;if(a||(a=yp),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;s|=ma,o.set(e,t);var f=ja(a(e),a(t),r,i,s,o);return o.delete(e),f;case Jd:if(Ni)return Ni.call(e)==Ni.call(t)}return!1}function oh(e,t,n,r,i,s){var o=i&Pr,a=ha(e),l=a.length,c=ha(t),f=c.length;if(l!=f&&!o)return!1;for(var u=l;u--;){var d=a[u];if(!(o?d in t:ht.call(t,d)))return!1}var p=s.get(e);if(p&&s.get(t))return p==t;var b=!0;s.set(e,t),s.set(t,e);for(var g=o;++u<l;){d=a[u];var m=e[d],C=t[d];if(r)var O=o?r(C,m,d,t,e,s):r(m,C,d,e,t,s);if(!(O===void 0?m===C||n(m,C,r,i,s):O)){b=!1;break}g||(g=d=="constructor")}if(b&&!g){var N=e.constructor,Y=t.constructor;N!=Y&&"constructor"in e&&"constructor"in t&&!(typeof N=="function"&&N instanceof N&&typeof Y=="function"&&Y instanceof Y)&&(b=!1)}return s.delete(e),s.delete(t),b}function Ir(e,t){var n=e.__data__;return ah(t)?n[typeof t=="string"?"string":"hash"]:n.map}function wn(e,t){var n=mp(e,t);return th(n)?n:void 0}var Et=Zp;($i&&Et(new $i(new ArrayBuffer(1)))!=_r||Bn&&Et(new Bn)!=vr||Wi&&Et(Wi.resolve())!=oa||Bi&&Et(new Bi)!=Er||Hi&&Et(new Hi)!=Ri)&&(Et=function(e){var t=Gn.call(e),n=t==bn?e.constructor:void 0,r=n?nn(n):void 0;if(r)switch(r){case Ep:return _r;case _p:return vr;case Sp:return oa;case Pp:return Er;case jp:return Ri}return t});function sh(e,t){return t=t==null?ga:t,!!t&&(typeof e=="number"||cp.test(e))&&e>-1&&e%1==0&&e<t}function ah(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function lh(e){return!!fa&&fa in e}function ch(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||jr;return e===n}function nn(e){if(e!=null){try{return Sa.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Ma(e,t){return e===t||e!==e&&t!==t}function fh(e){return uh(e)&&ht.call(e,"callee")&&(!Cp.call(e,"callee")||Gn.call(e)==Or)}var Gi=Array.isArray;function Ia(e){return e!=null&&Ta(e.length)&&!Fa(e)}function uh(e){return zi(e)&&Ia(e)}function dh(e,t,n){n=typeof n=="function"?n:void 0;var r=n?n(e,t):void 0;return r===void 0?Pa(e,t,n):!!r}function Fa(e){var t=Yi(e)?Gn.call(e):"";return t==Aa||t==Qd}function Ta(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ga}function Yi(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function zi(e){return!!e&&typeof e=="object"}var ph=ca?hp(ca):nh;function ha(e){return Ia(e)?Xp(e):rh(e)}yn.exports=dh});var nl=tt((py,tl)=>{"use strict";tl.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 Vi=tt((hy,il)=>{var zn=nl(),rl={};for(let e of Object.keys(zn))rl[zn[e]]=e;var M={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"]}};il.exports=M;for(let e of Object.keys(M)){if(!("channels"in M[e]))throw new Error("missing channels property: "+e);if(!("labels"in M[e]))throw new Error("missing channel labels property: "+e);if(M[e].labels.length!==M[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=M[e];delete M[e].channels,delete M[e].labels,Object.defineProperty(M[e],"channels",{value:t}),Object.defineProperty(M[e],"labels",{value:n})}M.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 c=(i+s)/2;return s===i?l=0:c<=.5?l=o/(s+i):l=o/(2-s-i),[a,l*100,c*100]};M.rgb.hsv=function(e){let t,n,r,i,s,o=e[0]/255,a=e[1]/255,l=e[2]/255,c=Math.max(o,a,l),f=c-Math.min(o,a,l),u=function(d){return(c-d)/6/f+1/2};return f===0?(i=0,s=0):(s=f/c,t=u(o),n=u(a),r=u(l),o===c?i=r-n:a===c?i=1/3+t-r:l===c&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[i*360,s*100,c*100]};M.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=M.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]};M.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 Dh(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}M.rgb.keyword=function(e){let t=rl[e];if(t)return t;let n=1/0,r;for(let i of Object.keys(zn)){let s=zn[i],o=Dh(e,s);o<n&&(n=o,r=i)}return r};M.keyword.rgb=function(e){return zn[e]};M.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]};M.rgb.lab=function(e){let t=M.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]};M.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 c=0;c<3;c++)s=t+1/3*-(c-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[c]=o*255;return l};M.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]};M.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]}};M.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]};M.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),c,f,u;switch(o){default:case 6:case 0:c=a,f=l,u=n;break;case 1:c=l,f=a,u=n;break;case 2:c=n,f=a,u=l;break;case 3:c=n,f=l,u=a;break;case 4:c=l,f=n,u=a;break;case 5:c=a,f=n,u=l;break}return[c*255,f*255,u*255]};M.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]};M.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]};M.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]};M.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,c=o**3;return s=a>.008856?a:(s-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};M.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]};M.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]};M.rgb.ansi16=function(e,t=null){let[n,r,i]=e,s=t===null?M.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};M.hsv.ansi16=function(e){return M.rgb.ansi16(M.hsv.rgb(e),e[2])};M.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)};M.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]};M.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]};M.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};M.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]};M.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]};M.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]};M.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]};M.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]};M.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]};M.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]};M.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]};M.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]};M.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};M.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};M.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};M.gray.hsl=function(e){return[0,0,e[0]]};M.gray.hsv=M.gray.hsl;M.gray.hwb=function(e){return[0,100,e[0]]};M.gray.cmyk=function(e){return[0,0,0,e[0]]};M.gray.lab=function(e){return[e[0],0,0]};M.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};M.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var sl=tt((my,ol)=>{var Dr=Vi();function Nh(){let e={},t=Object.keys(Dr);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function kh(e){let t=Nh(),n=[e];for(t[e].distance=0;n.length;){let r=n.pop(),i=Object.keys(Dr[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 Rh(e,t){return function(n){return t(e(n))}}function Uh(e,t){let n=[t[e].parent,e],r=Dr[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=Rh(Dr[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}ol.exports=function(e){let t=kh(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]=Uh(o,t))}return n}});var ll=tt((gy,al)=>{var Ki=Vi(),$h=sl(),On={},Wh=Object.keys(Ki);function Bh(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 Hh(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}Wh.forEach(e=>{On[e]={},Object.defineProperty(On[e],"channels",{value:Ki[e].channels}),Object.defineProperty(On[e],"labels",{value:Ki[e].labels});let t=$h(e);Object.keys(t).forEach(r=>{let i=t[r];On[e][r]=Hh(i),On[e][r].raw=Bh(i)})});al.exports=On});var hl=tt((by,pl)=>{"use strict";var cl=(e,t)=>(...n)=>`\x1B[${e(...n)+t}m`,fl=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};5;${r}m`},ul=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},Nr=e=>e,dl=(e,t,n)=>[e,t,n],vn=(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})},Qi,En=(e,t,n,r)=>{Qi===void 0&&(Qi=ll());let i=r?10:0,s={};for(let[o,a]of Object.entries(Qi)){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 Gh(){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",vn(t.color,"ansi",()=>En(cl,"ansi16",Nr,!1)),vn(t.color,"ansi256",()=>En(fl,"ansi256",Nr,!1)),vn(t.color,"ansi16m",()=>En(ul,"rgb",dl,!1)),vn(t.bgColor,"ansi",()=>En(cl,"ansi16",Nr,!0)),vn(t.bgColor,"ansi256",()=>En(fl,"ansi256",Nr,!0)),vn(t.bgColor,"ansi16m",()=>En(ul,"rgb",dl,!0)),t}Object.defineProperty(pl,"exports",{enumerable:!0,get:Gh})});var gl=tt((yy,ml)=>{"use strict";ml.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 wl=tt((wy,yl)=>{"use strict";var qh=ve("os"),bl=ve("tty"),et=gl(),{env:Pe}=process,Ft;et("no-color")||et("no-colors")||et("color=false")||et("color=never")?Ft=0:(et("color")||et("colors")||et("color=true")||et("color=always"))&&(Ft=1);"FORCE_COLOR"in Pe&&(Pe.FORCE_COLOR==="true"?Ft=1:Pe.FORCE_COLOR==="false"?Ft=0:Ft=Pe.FORCE_COLOR.length===0?1:Math.min(parseInt(Pe.FORCE_COLOR,10),3));function Ji(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Xi(e,t){if(Ft===0)return 0;if(et("color=16m")||et("color=full")||et("color=truecolor"))return 3;if(et("color=256"))return 2;if(e&&!t&&Ft===void 0)return 0;let n=Ft||0;if(Pe.TERM==="dumb")return n;if(process.platform==="win32"){let r=qh.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Pe)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Pe)||Pe.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Pe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Pe.TEAMCITY_VERSION)?1:0;if(Pe.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Pe){let r=parseInt((Pe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Pe.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Pe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Pe.TERM)||"COLORTERM"in Pe?1:n}function Yh(e){let t=Xi(e,e&&e.isTTY);return Ji(t)}yl.exports={supportsColor:Yh,stdout:Ji(Xi(!0,bl.isatty(1))),stderr:Ji(Xi(!0,bl.isatty(2)))}});var xl=tt((Ay,Al)=>{"use strict";var zh=(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},Vh=(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
2
  `:`
3
3
  `)+n,i=r+1,r=e.indexOf(`
4
- `,i)}while(r!==-1);return s+=e.substr(i),s};xl.exports={stringReplaceAll:Xh,stringEncaseCRLFWithFirstIndex:Zh}});var Sl=tt((vb,_l)=>{"use strict";var em=/(?:\\(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,tm=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,nm=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,rm=new Map([["n",`
5
- `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function El(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)):rm.get(e)||e}function im(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(tm))n.push(i[2].replace(nm,(a,l,c)=>l?El(l):c));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return n}function om(e){Ol.lastIndex=0;let t=[],n;for(;(n=Ol.exec(e))!==null;){let r=n[1];if(n[2]){let i=im(r,n[2]);t.push([r].concat(i))}else t.push([r])}return t}function vl(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}_l.exports=(e,t)=>{let n=[],r=[],i=[];if(t.replace(em,(s,o,a,l,c,f)=>{if(o)i.push(El(o));else if(l){let u=i.join("");i=[],r.push(n.length===0?u:vl(e,n)(u)),n.push({inverse:a,styles:om(l)})}else if(c){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");r.push(vl(e,n)(i.join(""))),i=[],n.pop()}else i.push(f)}),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 Ll=tt((Eb,Tl)=>{"use strict";var zn=ml(),{stdout:eo,stderr:to}=Al(),{stringReplaceAll:sm,stringEncaseCRLFWithFirstIndex:am}=Cl(),{isArray:kr}=Array,Pl=["ansi","ansi","ansi256","ansi16m"],En=Object.create(null),lm=(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=eo?eo.level:0;e.level=t.level===void 0?n:t.level},no=class{constructor(t){return Il(t)}},Il=e=>{let t={};return lm(t,e),t.template=(...n)=>Fl(t.template,...n),Object.setPrototypeOf(t,Rr.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=no,t.template};function Rr(e){return Il(e)}for(let[e,t]of Object.entries(zn))En[e]={get(){let n=Ur(this,ro(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};En.visible={get(){let e=Ur(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Ml=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of Ml)En[e]={get(){let{level:t}=this;return function(...n){let r=ro(zn.color[Pl[t]][e](...n),zn.color.close,this._styler);return Ur(this,r,this._isEmpty)}}};for(let e of Ml){let t="bg"+e[0].toUpperCase()+e.slice(1);En[t]={get(){let{level:n}=this;return function(...r){let i=ro(zn.bgColor[Pl[n]][e](...r),zn.bgColor.close,this._styler);return Ur(this,i,this._isEmpty)}}}}var cm=Object.defineProperties(()=>{},{...En,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),ro=(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}},Ur=(e,t,n)=>{let r=(...i)=>kr(i[0])&&kr(i[0].raw)?jl(r,Fl(r,...i)):jl(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,cm),r._generator=e,r._styler=t,r._isEmpty=n,r},jl=(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=sm(t,n.close,n.open),n=n.parent;let s=t.indexOf(`
6
- `);return s!==-1&&(t=am(t,i,r,s)),r+t+i},Zi,Fl=(e,...t)=>{let[n]=t;if(!kr(n)||!kr(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 Zi===void 0&&(Zi=Sl()),Zi(e,i.join(""))};Object.defineProperties(Rr.prototype,En);var $r=Rr();$r.supportsColor=eo;$r.stderr=Rr({level:to?to.level:0});$r.stderr.supportsColor=to;Tl.exports=$r});import{notStrictEqual as kc,strictEqual as Rc}from"assert";var dc={right:yc,center:bc},pc=0,Zn=1,hc=2,er=3,zr=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(`
4
+ `,i)}while(r!==-1);return s+=e.substr(i),s};Al.exports={stringReplaceAll:zh,stringEncaseCRLFWithFirstIndex:Vh}});var _l=tt((xy,El)=>{"use strict";var Kh=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Cl=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Qh=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Jh=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,Xh=new Map([["n",`
5
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function vl(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)):Xh.get(e)||e}function Zh(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(Qh))n.push(i[2].replace(Jh,(a,l,c)=>l?vl(l):c));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return n}function em(e){Cl.lastIndex=0;let t=[],n;for(;(n=Cl.exec(e))!==null;){let r=n[1];if(n[2]){let i=Zh(r,n[2]);t.push([r].concat(i))}else t.push([r])}return t}function Ol(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}El.exports=(e,t)=>{let n=[],r=[],i=[];if(t.replace(Kh,(s,o,a,l,c,f)=>{if(o)i.push(vl(o));else if(l){let u=i.join("");i=[],r.push(n.length===0?u:Ol(e,n)(u)),n.push({inverse:a,styles:em(l)})}else if(c){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");r.push(Ol(e,n)(i.join(""))),i=[],n.pop()}else i.push(f)}),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 io=tt((Cy,Fl)=>{"use strict";var Vn=hl(),{stdout:eo,stderr:to}=wl(),{stringReplaceAll:tm,stringEncaseCRLFWithFirstIndex:nm}=xl(),{isArray:kr}=Array,Pl=["ansi","ansi","ansi256","ansi16m"],_n=Object.create(null),rm=(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=eo?eo.level:0;e.level=t.level===void 0?n:t.level},no=class{constructor(t){return jl(t)}},jl=e=>{let t={};return rm(t,e),t.template=(...n)=>Il(t.template,...n),Object.setPrototypeOf(t,Rr.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=no,t.template};function Rr(e){return jl(e)}for(let[e,t]of Object.entries(Vn))_n[e]={get(){let n=Ur(this,ro(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};_n.visible={get(){let e=Ur(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Ml=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of Ml)_n[e]={get(){let{level:t}=this;return function(...n){let r=ro(Vn.color[Pl[t]][e](...n),Vn.color.close,this._styler);return Ur(this,r,this._isEmpty)}}};for(let e of Ml){let t="bg"+e[0].toUpperCase()+e.slice(1);_n[t]={get(){let{level:n}=this;return function(...r){let i=ro(Vn.bgColor[Pl[n]][e](...r),Vn.bgColor.close,this._styler);return Ur(this,i,this._isEmpty)}}}}var im=Object.defineProperties(()=>{},{..._n,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),ro=(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}},Ur=(e,t,n)=>{let r=(...i)=>kr(i[0])&&kr(i[0].raw)?Sl(r,Il(r,...i)):Sl(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,im),r._generator=e,r._styler=t,r._isEmpty=n,r},Sl=(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=tm(t,n.close,n.open),n=n.parent;let s=t.indexOf(`
6
+ `);return s!==-1&&(t=nm(t,i,r,s)),r+t+i},Zi,Il=(e,...t)=>{let[n]=t;if(!kr(n)||!kr(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 Zi===void 0&&(Zi=_l()),Zi(e,i.join(""))};Object.defineProperties(Rr.prototype,_n);var $r=Rr();$r.supportsColor=eo;$r.stderr=Rr({level:to?to.level:0});$r.stderr.supportsColor=to;Fl.exports=$r});import{notStrictEqual as Nc,strictEqual as kc}from"assert";var uc={right:gc,center:bc},dc=0,Zn=1,pc=2,er=3,Vr=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
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],c=this.negatePadding(t[a]),f=o;c>qe.stringWidth(o)&&(f+=" ".repeat(c-qe.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap&&(f=dc[t[a].align](f,c),qe.stringWidth(f)<c&&(f+=" ".repeat((l||0)-qe.stringWidth(f)-1)));let u=t[a].padding||[0,0,0,0];u[er]&&(s+=" ".repeat(u[er])),s+=co(t[a],f,"| "),s+=f,s+=co(t[a],f," |"),u[Zn]&&(s+=" ".repeat(u[Zn])),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(`
8
+ `)}rowToString(t,n){return this.rasterize(t).forEach((r,i)=>{let s="";r.forEach((o,a)=>{let{width:l}=t[a],c=this.negatePadding(t[a]),f=o;if(c>qe.stringWidth(o)&&(f+=" ".repeat(c-qe.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap){let d=uc[t[a].align];f=d(f,c),qe.stringWidth(f)<c&&(f+=" ".repeat((l||0)-qe.stringWidth(f)-1))}let u=t[a].padding||[0,0,0,0];u[er]&&(s+=" ".repeat(u[er])),s+=fo(t[a],f,"| "),s+=f,s+=fo(t[a],f," |"),u[Zn]&&(s+=" ".repeat(u[Zn])),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
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[pc]||0).fill("")),i.push(...new Array(s.padding[hc]||0).fill(""))),i.forEach((a,l)=>{n[l]||n.push([]);let c=n[l];for(let f=0;f<o;f++)c[f]===void 0&&c.push("");c.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[er]||0)+(t.padding[Zn]||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,mc(t[a])):o)}};function co(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function mc(e){let t=e.padding||[],n=1+(t[er]||0)+(t[Zn]||0);return e.border?n+4:n}function gc(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function yc(e,t){e=e.trim();let n=qe.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function bc(e,t){e=e.trim();let n=qe.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var qe;function fo(e,t){return qe=t,new zr({width:(e==null?void 0:e.width)||gc(),wrap:e==null?void 0:e.wrap})}var uo=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Vr(e){return e.replace(uo,"")}function po(e,t){let[n,r]=e.match(uo)||["",""];e=Vr(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 Kr(e){return fo(e,{stringWidth:t=>[...t].length,stripAnsi:Vr,wrap:po})}import{dirname as ho,resolve as mo}from"path";import{readdirSync as wc,statSync as Ac}from"fs";function go(e,t){let n=mo(".",e),r;for(Ac(n).isDirectory()||(n=ho(n));;){if(r=t(n,wc(n)),r)return mo(n,r);if(n=ho(r=n),r===n)break}}import{inspect as Uc}from"util";import{readFileSync as $c}from"fs";import{fileURLToPath as Wc}from"url";import{format as Oc}from"util";import{normalize as vc,resolve as Ec}from"path";function Ut(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 tr(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 nr(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)}function yo(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}var Ke;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Ke||(Ke={}));var ft,rr=class{constructor(t){ft=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=yo(t),s=typeof t=="string",o=xc(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),c=r.configObjects||[],f=r.envPrefix,u=a["populate--"],d=u?"--":"_",p=Object.create(null),y=Object.create(null),g=r.__||ft.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:[]},C=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,O=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach(function(b){let A=typeof b=="object"?b.key:b,v=Object.keys(b).map(function(x){return{boolean:"bools",string:"strings",number:"numbers"}[x]}).filter(Boolean).pop();v&&(m[v][A]=!0),m.arrays[A]=!0,m.keys.push(A)}),[].concat(r.boolean||[]).filter(Boolean).forEach(function(b){m.bools[b]=!0,m.keys.push(b)}),[].concat(r.string||[]).filter(Boolean).forEach(function(b){m.strings[b]=!0,m.keys.push(b)}),[].concat(r.number||[]).filter(Boolean).forEach(function(b){m.numbers[b]=!0,m.keys.push(b)}),[].concat(r.count||[]).filter(Boolean).forEach(function(b){m.counts[b]=!0,m.keys.push(b)}),[].concat(r.normalize||[]).filter(Boolean).forEach(function(b){m.normalize[b]=!0,m.keys.push(b)}),typeof r.narg=="object"&&Object.entries(r.narg).forEach(([b,A])=>{typeof A=="number"&&(m.nargs[b]=A,m.keys.push(b))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([b,A])=>{typeof A=="function"&&(m.coercions[b]=A,m.keys.push(b))}),typeof r.config!="undefined"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(b){m.configs[b]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([b,A])=>{(typeof A=="boolean"||typeof A=="function")&&(m.configs[b]=A)})),Pn(r.key,o,r.default,m.arrays),Object.keys(l).forEach(function(b){(m.aliases[b]||[]).forEach(function(A){l[A]=l[b]})});let N=null;qr();let Y=[],V=Object.assign(Object.create(null),{_:[]}),q={};for(let b=0;b<i.length;b++){let A=i[b],v=A.replace(/^-{3,}/,"---"),x,w,P,_,R,_e;if(A!=="--"&&ee(A))k(A);else if(v.match(/---+(=|$)/)){k(A);continue}else if(A.match(/^--.+=/)||!a["short-option-groups"]&&A.match(/^-.+=/))_=A.match(/^--?([^=]+)=([\s\S]*)$/),_!==null&&Array.isArray(_)&&_.length>=3&&($(_[1],m.arrays)?b=Z(b,_[1],i,_[2]):$(_[1],m.nargs)!==!1?b=Q(b,_[1],i,_[2]):G(_[1],_[2],!0));else if(A.match(O)&&a["boolean-negation"])_=A.match(O),_!==null&&Array.isArray(_)&&_.length>=2&&(w=_[1],G(w,$(w,m.arrays)?[!1]:!1));else if(A.match(/^--.+/)||!a["short-option-groups"]&&A.match(/^-[^-]+/))_=A.match(/^--?(.+)/),_!==null&&Array.isArray(_)&&_.length>=2&&(w=_[1],$(w,m.arrays)?b=Z(b,w,i):$(w,m.nargs)!==!1?b=Q(b,w,i):(R=i[b+1],R!==void 0&&(!R.match(/^-/)||R.match(C))&&!$(w,m.bools)&&!$(w,m.counts)||/^(true|false)$/.test(R)?(G(w,R),b++):G(w,K(w))));else if(A.match(/^-.\..+=/))_=A.match(/^-([^=]+)=([\s\S]*)$/),_!==null&&Array.isArray(_)&&_.length>=3&&G(_[1],_[2]);else if(A.match(/^-.\..+/)&&!A.match(C))R=i[b+1],_=A.match(/^-(.\..+)/),_!==null&&Array.isArray(_)&&_.length>=2&&(w=_[1],R!==void 0&&!R.match(/^-/)&&!$(w,m.bools)&&!$(w,m.counts)?(G(w,R),b++):G(w,K(w)));else if(A.match(/^-[^-]+/)&&!A.match(C)){P=A.slice(1,-1).split(""),x=!1;for(let Te=0;Te<P.length;Te++){if(R=A.slice(Te+2),P[Te+1]&&P[Te+1]==="="){_e=A.slice(Te+3),w=P[Te],$(w,m.arrays)?b=Z(b,w,i,_e):$(w,m.nargs)!==!1?b=Q(b,w,i,_e):G(w,_e),x=!0;break}if(R==="-"){G(P[Te],R);continue}if(/[A-Za-z]/.test(P[Te])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(R)&&$(R,m.bools)===!1){G(P[Te],R),x=!0;break}if(P[Te+1]&&P[Te+1].match(/\W/)){G(P[Te],R),x=!0;break}else G(P[Te],K(P[Te]))}w=A.slice(-1)[0],!x&&w!=="-"&&($(w,m.arrays)?b=Z(b,w,i):$(w,m.nargs)!==!1?b=Q(b,w,i):(R=i[b+1],R!==void 0&&(!/^(-|--)[^-]/.test(R)||R.match(C))&&!$(w,m.bools)&&!$(w,m.counts)||/^(true|false)$/.test(R)?(G(w,R),b++):G(w,K(w))))}else if(A.match(/^-[0-9]$/)&&A.match(C)&&$(A.slice(1),m.bools))w=A.slice(1),G(w,K(w));else if(A==="--"){Y=i.slice(b+1);break}else if(a["halt-at-non-option"]){Y=i.slice(b);break}else k(A)}de(V,!0),de(V,!1),F(V),X(),mt(V,m.aliases,l,!0),J(V),a["set-placeholder-key"]&&xe(V),Object.keys(m.counts).forEach(function(b){ne(V,b.split("."))||G(b,0)}),u&&Y.length&&(V[d]=[]),Y.forEach(function(b){V[d].push(b)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(V).filter(b=>b!=="--"&&b.includes("-")).forEach(b=>{delete V[b]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(b=>o[b])).forEach(b=>{a["camel-case-expansion"]&&b.includes("-")&&delete V[b.split(".").map(A=>Ut(A)).join(".")],delete V[b]});function k(b){let A=E("_",b);(typeof A=="string"||typeof A=="number")&&V._.push(A)}function Q(b,A,v,x){let w,P=$(A,m.nargs);if(P=typeof P!="number"||isNaN(P)?1:P,P===0)return Oe(x)||(N=Error(g("Argument unexpected for: %s",A))),G(A,K(A)),b;let _=Oe(x)?0:1;if(a["nargs-eats-options"])v.length-(b+1)+_<P&&(N=Error(g("Not enough arguments following: %s",A))),_=P;else{for(w=b+1;w<v.length&&(!v[w].match(/^-[^0-9]/)||v[w].match(C)||ee(v[w]));w++)_++;_<P&&(N=Error(g("Not enough arguments following: %s",A)))}let R=Math.min(_,P);for(!Oe(x)&&R>0&&(G(A,x),R--),w=b+1;w<R+b+1;w++)G(A,v[w]);return b+R}function Z(b,A,v,x){let w=[],P=x||v[b+1],_=$(A,m.nargs);if($(A,m.bools)&&!/^(true|false)$/.test(P))w.push(!0);else if(Oe(P)||Oe(x)&&/^-/.test(P)&&!C.test(P)&&!ee(P)){if(l[A]!==void 0){let R=l[A];w=Array.isArray(R)?R:[R]}}else{Oe(x)||w.push(M(A,x,!0));for(let R=b+1;R<v.length&&!(!a["greedy-arrays"]&&w.length>0||_&&typeof _=="number"&&w.length>=_||(P=v[R],/^-/.test(P)&&!C.test(P)&&!ee(P)));R++)b=R,w.push(M(A,P,s))}return typeof _=="number"&&(_&&w.length<_||isNaN(_)&&w.length===0)&&(N=Error(g("Not enough arguments following: %s",A))),G(A,w),b}function G(b,A,v=s){if(/-/.test(b)&&a["camel-case-expansion"]){let P=b.split(".").map(function(_){return Ut(_)}).join(".");Ge(b,P)}let x=M(b,A,v),w=b.split(".");ct(V,w,x),m.aliases[b]&&m.aliases[b].forEach(function(P){let _=P.split(".");ct(V,_,x)}),w.length>1&&a["dot-notation"]&&(m.aliases[w[0]]||[]).forEach(function(P){let _=P.split("."),R=[].concat(w);R.shift(),_=_.concat(R),(m.aliases[b]||[]).includes(_.join("."))||ct(V,_,x)}),$(b,m.normalize)&&!$(b,m.arrays)&&[b].concat(m.aliases[b]||[]).forEach(function(_){Object.defineProperty(q,_,{enumerable:!0,get(){return A},set(R){A=typeof R=="string"?ft.normalize(R):R}})})}function Ge(b,A){m.aliases[b]&&m.aliases[b].length||(m.aliases[b]=[A],p[A]=!0),m.aliases[A]&&m.aliases[A].length||Ge(A,b)}function M(b,A,v){v&&(A=Cc(A)),($(b,m.bools)||$(b,m.counts))&&typeof A=="string"&&(A=A==="true");let x=Array.isArray(A)?A.map(function(w){return E(b,w)}):E(b,A);return $(b,m.counts)&&(Oe(x)||typeof x=="boolean")&&(x=Qr()),$(b,m.normalize)&&$(b,m.arrays)&&(Array.isArray(A)?x=A.map(w=>ft.normalize(w)):x=ft.normalize(A)),x}function E(b,A){return!a["parse-positional-numbers"]&&b==="_"||!$(b,m.strings)&&!$(b,m.bools)&&!Array.isArray(A)&&(nr(A)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${A}`)))||!Oe(A)&&$(b,m.numbers))&&(A=Number(A)),A}function F(b){let A=Object.create(null);mt(A,m.aliases,l),Object.keys(m.configs).forEach(function(v){let x=b[v]||A[v];if(x)try{let w=null,P=ft.resolve(ft.cwd(),x),_=m.configs[v];if(typeof _=="function"){try{w=_(P)}catch(R){w=R}if(w instanceof Error){N=w;return}}else w=ft.require(P);H(w)}catch(w){w.name==="PermissionDenied"?N=w:b[v]&&(N=Error(g("Invalid JSON config file: %s",x)))}})}function H(b,A){Object.keys(b).forEach(function(v){let x=b[v],w=A?A+"."+v:v;typeof x=="object"&&x!==null&&!Array.isArray(x)&&a["dot-notation"]?H(x,w):(!ne(V,w.split("."))||$(w,m.arrays)&&a["combine-arrays"])&&G(w,x)})}function X(){typeof c!="undefined"&&c.forEach(function(b){H(b)})}function de(b,A){if(typeof f=="undefined")return;let v=typeof f=="string"?f:"",x=ft.env();Object.keys(x).forEach(function(w){if(v===""||w.lastIndexOf(v,0)===0){let P=w.split("__").map(function(_,R){return R===0&&(_=_.substring(v.length)),Ut(_)});(A&&m.configs[P.join(".")]||!A)&&!ne(b,P)&&G(P.join("."),x[w])}})}function J(b){let A,v=new Set;Object.keys(b).forEach(function(x){if(!v.has(x)&&(A=$(x,m.coercions),typeof A=="function"))try{let w=E(x,A(b[x]));[].concat(m.aliases[x]||[],x).forEach(P=>{v.add(P),b[P]=w})}catch(w){N=w}})}function xe(b){return m.keys.forEach(A=>{~A.indexOf(".")||typeof b[A]=="undefined"&&(b[A]=void 0)}),b}function mt(b,A,v,x=!1){Object.keys(v).forEach(function(w){ne(b,w.split("."))||(ct(b,w.split("."),v[w]),x&&(y[w]=!0),(A[w]||[]).forEach(function(P){ne(b,P.split("."))||ct(b,P.split("."),v[w])}))})}function ne(b,A){let v=b;a["dot-notation"]||(A=[A.join(".")]),A.slice(0,-1).forEach(function(w){v=v[w]||{}});let x=A[A.length-1];return typeof v!="object"?!1:x in v}function ct(b,A,v){let x=b;a["dot-notation"]||(A=[A.join(".")]),A.slice(0,-1).forEach(function(_e){_e=bo(_e),typeof x=="object"&&x[_e]===void 0&&(x[_e]={}),typeof x[_e]!="object"||Array.isArray(x[_e])?(Array.isArray(x[_e])?x[_e].push({}):x[_e]=[x[_e],{}],x=x[_e][x[_e].length-1]):x=x[_e]});let w=bo(A[A.length-1]),P=$(A.join("."),m.arrays),_=Array.isArray(v),R=a["duplicate-arguments-array"];!R&&$(w,m.nargs)&&(R=!0,(!Oe(x[w])&&m.nargs[w]===1||Array.isArray(x[w])&&x[w].length===m.nargs[w])&&(x[w]=void 0)),v===Qr()?x[w]=Qr(x[w]):Array.isArray(x[w])?R&&P&&_?x[w]=a["flatten-duplicate-arrays"]?x[w].concat(v):(Array.isArray(x[w][0])?x[w]:[x[w]]).concat([v]):!R&&Boolean(P)===Boolean(_)?x[w]=v:x[w]=x[w].concat([v]):x[w]===void 0&&P?x[w]=_?v:[v]:R&&!(x[w]===void 0||$(w,m.counts)||$(w,m.bools))?x[w]=[x[w],v]:x[w]=v}function Pn(...b){b.forEach(function(A){Object.keys(A||{}).forEach(function(v){m.aliases[v]||(m.aliases[v]=[].concat(o[v]||[]),m.aliases[v].concat(v).forEach(function(x){if(/-/.test(x)&&a["camel-case-expansion"]){let w=Ut(x);w!==v&&m.aliases[v].indexOf(w)===-1&&(m.aliases[v].push(w),p[w]=!0)}}),m.aliases[v].concat(v).forEach(function(x){if(x.length>1&&/[A-Z]/.test(x)&&a["camel-case-expansion"]){let w=tr(x,"-");w!==v&&m.aliases[v].indexOf(w)===-1&&(m.aliases[v].push(w),p[w]=!0)}}),m.aliases[v].forEach(function(x){m.aliases[x]=[v].concat(m.aliases[v].filter(function(w){return x!==w}))}))})})}function $(b,A){let v=[].concat(m.aliases[b]||[],b),x=Object.keys(A),w=v.find(P=>x.includes(P));return w?A[w]:!1}function on(b){let A=Object.keys(m);return[].concat(A.map(x=>m[x])).some(function(x){return Array.isArray(x)?x.includes(b):x[b]})}function so(b,...A){return[].concat(...A).some(function(x){let w=b.match(x);return w&&on(w[1])})}function W(b){if(b.match(C)||!b.match(/^-[^-]+/))return!1;let A=!0,v,x=b.slice(1).split("");for(let w=0;w<x.length;w++){if(v=b.slice(w+2),!on(x[w])){A=!1;break}if(x[w+1]&&x[w+1]==="="||v==="-"||/[A-Za-z]/.test(x[w])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(v)||x[w+1]&&x[w+1].match(/\W/))break}return A}function ee(b){return a["unknown-options-as-args"]&&Ce(b)}function Ce(b){return b=b.replace(/^-{3,}/,"--"),b.match(C)||W(b)?!1:!so(b,/^-+([^=]+?)=[\s\S]*$/,O,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function K(b){return!$(b,m.bools)&&!$(b,m.counts)&&`${b}`in l?l[b]:Pe(fe(b))}function Pe(b){return{[Ke.BOOLEAN]:!0,[Ke.STRING]:"",[Ke.NUMBER]:void 0,[Ke.ARRAY]:[]}[b]}function fe(b){let A=Ke.BOOLEAN;return $(b,m.strings)?A=Ke.STRING:$(b,m.numbers)?A=Ke.NUMBER:$(b,m.bools)?A=Ke.BOOLEAN:$(b,m.arrays)&&(A=Ke.ARRAY),A}function Oe(b){return b===void 0}function qr(){Object.keys(m.counts).find(b=>$(b,m.arrays)?(N=Error(g("Invalid configuration: %s, opts.count excludes opts.array.",b)),!0):$(b,m.nargs)?(N=Error(g("Invalid configuration: %s, opts.count excludes opts.narg.",b)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(q,V),configuration:a,defaulted:Object.assign({},y),error:N,newAliases:Object.assign({},p)}}};function xc(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 Qr(e){return e!==void 0?e+1:1}function bo(e){return e==="__proto__"?"___proto___":e}function Cc(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 _c}from"fs";var wo=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])<wo)throw Error(`yargs parser supports a minimum Node.js version of ${wo}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Sc=process?process.env:{},Ao=new rr({cwd:process.cwd,env:()=>Sc,format:Oc,normalize:vc,resolve:Ec,require:e=>{if(typeof ve!="undefined")return ve(e);if(e.match(/\.json$/))return JSON.parse(_c(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),In=function(t,n){return Ao.parse(t.slice(),n).argv};In.detailed=function(e,t){return Ao.parse(e.slice(),t)};In.camelCase=Ut;In.decamelize=tr;In.looksLikeNumber=nr;var xo=In;import{basename as Bc,dirname as Gc,extname as Hc,relative as qc,resolve as _o}from"path";function jc(){return Pc()?0:1}function Pc(){return Ic()&&!process.defaultApp}function Ic(){return!!process.versions.electron}function Co(){return process.argv[jc()]}var te=class extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,te)}};import{readFileSync as Mc,statSync as Fc,writeFile as Tc}from"fs";import{format as Lc}from"util";import{resolve as Dc}from"path";var Oo={fs:{readFileSync:Mc,writeFile:Tc},format:Lc,resolve:Dc,exists:e=>{try{return Fc(e).isFile()}catch(t){return!1}}};var nt,Jr=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(),nt.format.apply(nt.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),nt.format.apply(nt.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);nt.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{nt.fs.readFileSync&&(t=JSON.parse(nt.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=nt.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~n.lastIndexOf("_")){let i=nt.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(t){return nt.exists(t)}};function vo(e,t){nt=t;let n=new Jr(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 Nc=e=>vo(e,Oo),Eo=Nc;var Vc={},Yc="require is not supported by ESM",So="loading a directory of commands is not supported yet for ESM",Mn;try{Mn=Wc(Vc.url)}catch(e){Mn=process.cwd()}var zc=Mn.substring(0,Mn.lastIndexOf("node_modules")),jo={assert:{notStrictEqual:kc,strictEqual:Rc},cliui:Kr,findUp:go,getEnv:e=>process.env[e],inspect:Uc,getCallerFile:()=>{throw new te(So)},getProcessArgvBin:Co,mainFilename:zc||process.cwd(),Parser:xo,path:{basename:Bc,dirname:Gc,extname:Hc,relative:qc,resolve:_o},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:$c,require:()=>{throw new te(Yc)},requireDirectory:()=>{throw new te(So)},stringWidth:e=>[...e].length,y18n:Eo({directory:_o(Mn,"../../../locales"),updateFiles:!1})};function Le(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function Xr(e,t){t.assert.strictEqual(typeof e,"string")}function sn(e){return Object.keys(e)}function re(e){return!!e&&!!e.then&&typeof e.then=="function"}function gt(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 Kc=["first","second","third","fourth","fifth","sixth"];function S(e,t,n){function r(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[gt(`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 c=a||l.length;if(c<s.demanded.length)throw new te(`Not enough arguments provided. Expected ${s.demanded.length} but received ${l.length}.`);let f=s.demanded.length+s.optional.length;if(c>f)throw new te(`Too many arguments provided. Expected max ${f} but received ${c}.`);s.demanded.forEach(u=>{let d=l.shift(),p=Po(d);u.cmd.filter(g=>g===p||g==="*").length===0&&Io(p,u.cmd,i),i+=1}),s.optional.forEach(u=>{if(l.length===0)return;let d=l.shift(),p=Po(d);u.cmd.filter(g=>g===p||g==="*").length===0&&Io(p,u.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function Po(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function Io(e,t,n){throw new te(`Invalid ${Kc[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var ir=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,r=!0,i=!1){if(S("<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 $t(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(re(i))return i.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(i,t);return re(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},e)}function Wt(e,t,n=r=>{throw r}){try{let r=Qc(e)?e():e;return re(r)?r.then(i=>t(i)):t(r)}catch(r){return n(r)}}function Qc(e){return typeof e=="function"}function Zr(e){if(typeof ve=="undefined")return null;for(let t=0,n=Object.keys(ve.cache),r;t<n.length;t++)if(r=ve.cache[n[t]],r.exports===e)return r;return null}var an=/(^\*)|(^\$0)/,ei=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 c=s(o,a,l);if(c){if(this.requireCache.has(a))return c;this.requireCache.add(a),this.addHandler(c)}return c},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(Jc(t))[t,...a]=t;else for(let c of t)this.addHandler(c);else if(Zc(t)){let c=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(c=[].concat(c).concat(t.aliases)),this.addHandler(c,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(Fo(r)){this.addHandler([t].concat(a),n,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof t=="string"){let c=gt(t);a=a.map(d=>gt(d).cmd);let f=!1,u=[c.cmd].concat(a).filter(d=>an.test(d)?(f=!0,!1):!0);u.length===0&&f&&u.push("$0"),f&&(c.cmd=u[0],a=u.slice(1),t=t.replace(an,c.cmd)),a.forEach(d=>{this.aliasMap[d]=c.cmd}),n!==!1&&this.usage.command(t,n,f,a,o),this.handlers[c.cmd]={original:t,description:n,handler:i,builder:r||{},middlewares:l,deprecated:o,demanded:c.demanded,optional:c.optional},f&&(this.defaultCommand=this.handlers[c.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(),c=l.commands.slice(),f=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let u=this.applyBuilderUpdateUsageAndParse(f,a,n,r.aliases,c,i,s,o);return re(u)?u.then(d=>this.applyMiddlewareAndGetResult(f,a,d.innerArgv,l,s,d.aliases,n)):this.applyMiddlewareAndGetResult(f,a,u.innerArgv,l,s,u.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,r,i,s,o,a,l){let c=n.builder,f=r;if(or(c)){let u=c(r.getInternalMethods().reset(i),l);if(re(u))return u.then(d=>(f=Lo(d)?d:r,this.parseAndUpdateUsage(t,n,f,s,o,a)))}else Xc(c)&&(f=r.getInternalMethods().reset(i),Object.keys(n.builder).forEach(u=>{f.option(u,c[u])}));return this.parseAndUpdateUsage(t,n,f,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 re(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=an.test(n.original)?n.original.replace(an,"").trim():n.original,i=t.filter(s=>!an.test(s));return i.push(r),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,n,r,i,s,o,a,l){if(!o.getInternalMethods().getHasOutput()){let c=o.getInternalMethods().runValidation(s,l,o.parsed.error,t);r=Wt(r,f=>(c(f),f))}if(n.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let c=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(r,c,!1,!1),r=$t(r,o,a,!1),r=Wt(r,f=>{let u=n.handler(f);return re(u)?u.then(()=>f):f}),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),re(r)&&!o.getInternalMethods().hasParseCallback()&&r.catch(f=>{try{o.getInternalMethods().getUsageInstance().fail(null,f)}catch(u){}})}return t||(i.commands.pop(),i.fullCommands.pop()),r}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 c=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares),f=$t(r,a,c,!0);return re(f)?f.then(u=>this.handleValidationAndGetResult(t,n,u,i,o,a,c,l)):this.handleValidationAndGetResult(t,n,f,i,o,a,c,l)}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=gt(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 c of Object.keys(r.alias))s.alias[c]=(s.alias[c]||[]).concat(r.alias[c]);s.array=s.array.concat(r.array),s.config={};let o=[];if(Object.keys(n).forEach(c=>{n[c].map(f=>{s.configuration["unknown-options-as-args"]&&(s.key[c]=!0),o.push(`--${c}`),o.push(f)})}),!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 c=Object.keys(n);Object.keys(n).forEach(f=>{c.push(...l.aliases[f])}),Object.keys(l.argv).forEach(f=>{c.includes(f)&&(n[f]||(n[f]=l.argv[f]),!this.isInConfigs(i,f)&&!this.isDefaulted(i,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])})}}isDefaulted(t,n){let{default:r}=t.getOptions();return Object.prototype.hasOwnProperty.call(r,n)||Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(n))}isInConfigs(t,n){let{configObjects:r}=t.getOptions();return r.some(i=>Object.prototype.hasOwnProperty.call(i,n))||r.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(n)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let r=an.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(or(n))return n(t,!0);Fo(n)||Object.keys(n).forEach(r=>{t.option(r,n[r])})}moduleName(t){let n=Zr(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;Le(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();Le(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 ei(e,t,n,r)}function Fo(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Jc(e){return e.every(t=>typeof t=="string")}function or(e){return typeof e=="function"}function Xc(e){return typeof e=="object"}function Zc(e){return typeof e=="object"&&!Array.isArray(e)}function yt(e={},t=()=>!0){let n={};return sn(e).forEach(r=>{t(r,e[r])&&(n[r]=e[r])}),n}function bt(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 ef(e){return typeof e=="boolean"}function No(e,t){let n=t.y18n.__,r={},i=[];r.failFn=function(E){i.push(E)};let s=null,o=null,a=!0;r.showHelpOnFail=function(E=!0,F){let[H,X]=typeof E=="string"?[!0,E]:[E,F];return e.getInternalMethods().isGlobalContext()&&(o=X),s=X,a=H,r};let l=!1;r.fail=function(E,F){let H=e.getInternalMethods().getLoggerInstance();if(i.length)for(let X=i.length-1;X>=0;--X){let de=i[X];if(ef(de)){if(F)throw F;if(E)throw Error(E)}else de(E,F,r)}else{if(e.getExitProcess()&&bt(!0),!l){l=!0,a&&(e.showHelp("error"),H.error()),(E||F)&&H.error(E||F);let X=s||o;X&&((E||F)&&H.error(""),H.error(X))}if(F=F||new te(E),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,F);throw F}};let c=[],f=!1;r.usage=(M,E)=>M===null?(f=!0,c=[],r):(f=!1,c.push([M,E||""]),r),r.getUsage=()=>c,r.getUsageDisabled=()=>f,r.getPositionalGroupName=()=>n("Positionals:");let u=[];r.example=(M,E)=>{u.push([M,E||""])};let d=[];r.command=function(E,F,H,X,de=!1){H&&(d=d.map(J=>(J[2]=!1,J))),d.push([E,F||"",H,X,de])},r.getCommands=()=>d;let p={};r.describe=function(E,F){Array.isArray(E)?E.forEach(H=>{r.describe(H,F)}):typeof E=="object"?Object.keys(E).forEach(H=>{r.describe(H,E[H])}):p[E]=F},r.getDescriptions=()=>p;let y=[];r.epilog=M=>{y.push(M)};let g=!1,m;r.wrap=M=>{g=!0,m=M};function C(){return g||(m=Z(),g=!0),m}let O="__yargsString__:";r.deferY18nLookup=M=>O+M,r.help=function(){if(V)return V;Y();let E=e.customScriptName?e.$0:t.path.basename(e.$0),F=e.getDemandedOptions(),H=e.getDemandedCommands(),X=e.getDeprecatedOptions(),de=e.getGroups(),J=e.getOptions(),xe=[];xe=xe.concat(Object.keys(p)),xe=xe.concat(Object.keys(F)),xe=xe.concat(Object.keys(H)),xe=xe.concat(Object.keys(J.default)),xe=xe.filter(k),xe=Object.keys(xe.reduce((W,ee)=>(ee!=="_"&&(W[ee]=!0),W),{}));let mt=C(),ne=t.cliui({width:mt,wrap:!!mt});if(!f){if(c.length)c.forEach(W=>{ne.div({text:`${W[0].replace(/\$0/g,E)}`}),W[1]&&ne.div({text:`${W[1]}`,padding:[1,0,0,0]})}),ne.div();else if(d.length){let W=null;H._?W=`${E} <${n("command")}>
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[dc]||0).fill("")),i.push(...new Array(s.padding[pc]||0).fill(""))),i.forEach((a,l)=>{n[l]||n.push([]);let c=n[l];for(let f=0;f<o;f++)c[f]===void 0&&c.push("");c.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[er]||0)+(t.padding[Zn]||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,hc(t[a])):o)}};function fo(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function hc(e){let t=e.padding||[],n=1+(t[er]||0)+(t[Zn]||0);return e.border?n+4:n}function mc(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function gc(e,t){e=e.trim();let n=qe.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function bc(e,t){e=e.trim();let n=qe.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var qe;function uo(e,t){return qe=t,new Vr({width:(e==null?void 0:e.width)||mc(),wrap:e==null?void 0:e.wrap})}var po=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Kr(e){return e.replace(po,"")}function ho(e,t){let[n,r]=e.match(po)||["",""];e=Kr(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 Qr(e){return uo(e,{stringWidth:t=>[...t].length,stripAnsi:Kr,wrap:ho})}import{dirname as mo,resolve as go}from"path";import{readdirSync as yc,statSync as wc}from"fs";function bo(e,t){let n=go(".",e),r;for(wc(n).isDirectory()||(n=mo(n));;){if(r=t(n,yc(n)),r)return go(n,r);if(n=mo(r=n),r===n)break}}import{inspect as Rc}from"util";import{readFileSync as Uc}from"fs";import{fileURLToPath as $c}from"url";import{format as Cc}from"util";import{normalize as Oc,resolve as vc}from"path";function Ut(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 tr(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 nr(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)}function yo(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}var Ke;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Ke||(Ke={}));var ut,rr=class{constructor(t){ut=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=yo(t),s=typeof t=="string",o=Ac(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),c=r.configObjects||[],f=r.envPrefix,u=a["populate--"],d=u?"--":"_",p=Object.create(null),b=Object.create(null),g=r.__||ut.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:[]},C=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,O=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach(function(y){let A=typeof y=="object"?y.key:y,v=Object.keys(y).map(function(x){return{boolean:"bools",string:"strings",number:"numbers"}[x]}).filter(Boolean).pop();v&&(m[v][A]=!0),m.arrays[A]=!0,m.keys.push(A)}),[].concat(r.boolean||[]).filter(Boolean).forEach(function(y){m.bools[y]=!0,m.keys.push(y)}),[].concat(r.string||[]).filter(Boolean).forEach(function(y){m.strings[y]=!0,m.keys.push(y)}),[].concat(r.number||[]).filter(Boolean).forEach(function(y){m.numbers[y]=!0,m.keys.push(y)}),[].concat(r.count||[]).filter(Boolean).forEach(function(y){m.counts[y]=!0,m.keys.push(y)}),[].concat(r.normalize||[]).filter(Boolean).forEach(function(y){m.normalize[y]=!0,m.keys.push(y)}),typeof r.narg=="object"&&Object.entries(r.narg).forEach(([y,A])=>{typeof A=="number"&&(m.nargs[y]=A,m.keys.push(y))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([y,A])=>{typeof A=="function"&&(m.coercions[y]=A,m.keys.push(y))}),typeof r.config!="undefined"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(y){m.configs[y]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([y,A])=>{(typeof A=="boolean"||typeof A=="function")&&(m.configs[y]=A)})),Mn(r.key,o,r.default,m.arrays),Object.keys(l).forEach(function(y){(m.aliases[y]||[]).forEach(function(A){l[A]=l[y]})});let N=null;qr();let Y=[],V=Object.assign(Object.create(null),{_:[]}),q={};for(let y=0;y<i.length;y++){let A=i[y],v=A.replace(/^-{3,}/,"---"),x,w,j,_,R,_e;if(A!=="--"&&ee(A))k(A);else if(v.match(/---+(=|$)/)){k(A);continue}else if(A.match(/^--.+=/)||!a["short-option-groups"]&&A.match(/^-.+=/))_=A.match(/^--?([^=]+)=([\s\S]*)$/),_!==null&&Array.isArray(_)&&_.length>=3&&($(_[1],m.arrays)?y=Z(y,_[1],i,_[2]):$(_[1],m.nargs)!==!1?y=Q(y,_[1],i,_[2]):H(_[1],_[2],!0));else if(A.match(O)&&a["boolean-negation"])_=A.match(O),_!==null&&Array.isArray(_)&&_.length>=2&&(w=_[1],H(w,$(w,m.arrays)?[!1]:!1));else if(A.match(/^--.+/)||!a["short-option-groups"]&&A.match(/^-[^-]+/))_=A.match(/^--?(.+)/),_!==null&&Array.isArray(_)&&_.length>=2&&(w=_[1],$(w,m.arrays)?y=Z(y,w,i):$(w,m.nargs)!==!1?y=Q(y,w,i):(R=i[y+1],R!==void 0&&(!R.match(/^-/)||R.match(C))&&!$(w,m.bools)&&!$(w,m.counts)||/^(true|false)$/.test(R)?(H(w,R),y++):H(w,K(w))));else if(A.match(/^-.\..+=/))_=A.match(/^-([^=]+)=([\s\S]*)$/),_!==null&&Array.isArray(_)&&_.length>=3&&H(_[1],_[2]);else if(A.match(/^-.\..+/)&&!A.match(C))R=i[y+1],_=A.match(/^-(.\..+)/),_!==null&&Array.isArray(_)&&_.length>=2&&(w=_[1],R!==void 0&&!R.match(/^-/)&&!$(w,m.bools)&&!$(w,m.counts)?(H(w,R),y++):H(w,K(w)));else if(A.match(/^-[^-]+/)&&!A.match(C)){j=A.slice(1,-1).split(""),x=!1;for(let Te=0;Te<j.length;Te++){if(R=A.slice(Te+2),j[Te+1]&&j[Te+1]==="="){_e=A.slice(Te+3),w=j[Te],$(w,m.arrays)?y=Z(y,w,i,_e):$(w,m.nargs)!==!1?y=Q(y,w,i,_e):H(w,_e),x=!0;break}if(R==="-"){H(j[Te],R);continue}if(/[A-Za-z]/.test(j[Te])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(R)&&$(R,m.bools)===!1){H(j[Te],R),x=!0;break}if(j[Te+1]&&j[Te+1].match(/\W/)){H(j[Te],R),x=!0;break}else H(j[Te],K(j[Te]))}w=A.slice(-1)[0],!x&&w!=="-"&&($(w,m.arrays)?y=Z(y,w,i):$(w,m.nargs)!==!1?y=Q(y,w,i):(R=i[y+1],R!==void 0&&(!/^(-|--)[^-]/.test(R)||R.match(C))&&!$(w,m.bools)&&!$(w,m.counts)||/^(true|false)$/.test(R)?(H(w,R),y++):H(w,K(w))))}else if(A.match(/^-[0-9]$/)&&A.match(C)&&$(A.slice(1),m.bools))w=A.slice(1),H(w,K(w));else if(A==="--"){Y=i.slice(y+1);break}else if(a["halt-at-non-option"]){Y=i.slice(y);break}else k(A)}de(V,!0),de(V,!1),L(V),X(),gt(V,m.aliases,l,!0),J(V),a["set-placeholder-key"]&&xe(V),Object.keys(m.counts).forEach(function(y){ne(V,y.split("."))||H(y,0)}),u&&Y.length&&(V[d]=[]),Y.forEach(function(y){V[d].push(y)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(V).filter(y=>y!=="--"&&y.includes("-")).forEach(y=>{delete V[y]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(y=>o[y])).forEach(y=>{a["camel-case-expansion"]&&y.includes("-")&&delete V[y.split(".").map(A=>Ut(A)).join(".")],delete V[y]});function k(y){let A=E("_",y);(typeof A=="string"||typeof A=="number")&&V._.push(A)}function Q(y,A,v,x){let w,j=$(A,m.nargs);if(j=typeof j!="number"||isNaN(j)?1:j,j===0)return Oe(x)||(N=Error(g("Argument unexpected for: %s",A))),H(A,K(A)),y;let _=Oe(x)?0:1;if(a["nargs-eats-options"])v.length-(y+1)+_<j&&(N=Error(g("Not enough arguments following: %s",A))),_=j;else{for(w=y+1;w<v.length&&(!v[w].match(/^-[^0-9]/)||v[w].match(C)||ee(v[w]));w++)_++;_<j&&(N=Error(g("Not enough arguments following: %s",A)))}let R=Math.min(_,j);for(!Oe(x)&&R>0&&(H(A,x),R--),w=y+1;w<R+y+1;w++)H(A,v[w]);return y+R}function Z(y,A,v,x){let w=[],j=x||v[y+1],_=$(A,m.nargs);if($(A,m.bools)&&!/^(true|false)$/.test(j))w.push(!0);else if(Oe(j)||Oe(x)&&/^-/.test(j)&&!C.test(j)&&!ee(j)){if(l[A]!==void 0){let R=l[A];w=Array.isArray(R)?R:[R]}}else{Oe(x)||w.push(I(A,x,!0));for(let R=y+1;R<v.length&&!(!a["greedy-arrays"]&&w.length>0||_&&typeof _=="number"&&w.length>=_||(j=v[R],/^-/.test(j)&&!C.test(j)&&!ee(j)));R++)y=R,w.push(I(A,j,s))}return typeof _=="number"&&(_&&w.length<_||isNaN(_)&&w.length===0)&&(N=Error(g("Not enough arguments following: %s",A))),H(A,w),y}function H(y,A,v=s){if(/-/.test(y)&&a["camel-case-expansion"]){let j=y.split(".").map(function(_){return Ut(_)}).join(".");He(y,j)}let x=I(y,A,v),w=y.split(".");ft(V,w,x),m.aliases[y]&&m.aliases[y].forEach(function(j){let _=j.split(".");ft(V,_,x)}),w.length>1&&a["dot-notation"]&&(m.aliases[w[0]]||[]).forEach(function(j){let _=j.split("."),R=[].concat(w);R.shift(),_=_.concat(R),(m.aliases[y]||[]).includes(_.join("."))||ft(V,_,x)}),$(y,m.normalize)&&!$(y,m.arrays)&&[y].concat(m.aliases[y]||[]).forEach(function(_){Object.defineProperty(q,_,{enumerable:!0,get(){return A},set(R){A=typeof R=="string"?ut.normalize(R):R}})})}function He(y,A){m.aliases[y]&&m.aliases[y].length||(m.aliases[y]=[A],p[A]=!0),m.aliases[A]&&m.aliases[A].length||He(A,y)}function I(y,A,v){v&&(A=xc(A)),($(y,m.bools)||$(y,m.counts))&&typeof A=="string"&&(A=A==="true");let x=Array.isArray(A)?A.map(function(w){return E(y,w)}):E(y,A);return $(y,m.counts)&&(Oe(x)||typeof x=="boolean")&&(x=Jr()),$(y,m.normalize)&&$(y,m.arrays)&&(Array.isArray(A)?x=A.map(w=>ut.normalize(w)):x=ut.normalize(A)),x}function E(y,A){return!a["parse-positional-numbers"]&&y==="_"||!$(y,m.strings)&&!$(y,m.bools)&&!Array.isArray(A)&&(nr(A)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${A}`)))||!Oe(A)&&$(y,m.numbers))&&(A=Number(A)),A}function L(y){let A=Object.create(null);gt(A,m.aliases,l),Object.keys(m.configs).forEach(function(v){let x=y[v]||A[v];if(x)try{let w=null,j=ut.resolve(ut.cwd(),x),_=m.configs[v];if(typeof _=="function"){try{w=_(j)}catch(R){w=R}if(w instanceof Error){N=w;return}}else w=ut.require(j);G(w)}catch(w){w.name==="PermissionDenied"?N=w:y[v]&&(N=Error(g("Invalid JSON config file: %s",x)))}})}function G(y,A){Object.keys(y).forEach(function(v){let x=y[v],w=A?A+"."+v:v;typeof x=="object"&&x!==null&&!Array.isArray(x)&&a["dot-notation"]?G(x,w):(!ne(V,w.split("."))||$(w,m.arrays)&&a["combine-arrays"])&&H(w,x)})}function X(){typeof c!="undefined"&&c.forEach(function(y){G(y)})}function de(y,A){if(typeof f=="undefined")return;let v=typeof f=="string"?f:"",x=ut.env();Object.keys(x).forEach(function(w){if(v===""||w.lastIndexOf(v,0)===0){let j=w.split("__").map(function(_,R){return R===0&&(_=_.substring(v.length)),Ut(_)});(A&&m.configs[j.join(".")]||!A)&&!ne(y,j)&&H(j.join("."),x[w])}})}function J(y){let A,v=new Set;Object.keys(y).forEach(function(x){if(!v.has(x)&&(A=$(x,m.coercions),typeof A=="function"))try{let w=E(x,A(y[x]));[].concat(m.aliases[x]||[],x).forEach(j=>{v.add(j),y[j]=w})}catch(w){N=w}})}function xe(y){return m.keys.forEach(A=>{~A.indexOf(".")||typeof y[A]=="undefined"&&(y[A]=void 0)}),y}function gt(y,A,v,x=!1){Object.keys(v).forEach(function(w){ne(y,w.split("."))||(ft(y,w.split("."),v[w]),x&&(b[w]=!0),(A[w]||[]).forEach(function(j){ne(y,j.split("."))||ft(y,j.split("."),v[w])}))})}function ne(y,A){let v=y;a["dot-notation"]||(A=[A.join(".")]),A.slice(0,-1).forEach(function(w){v=v[w]||{}});let x=A[A.length-1];return typeof v!="object"?!1:x in v}function ft(y,A,v){let x=y;a["dot-notation"]||(A=[A.join(".")]),A.slice(0,-1).forEach(function(_e){_e=wo(_e),typeof x=="object"&&x[_e]===void 0&&(x[_e]={}),typeof x[_e]!="object"||Array.isArray(x[_e])?(Array.isArray(x[_e])?x[_e].push({}):x[_e]=[x[_e],{}],x=x[_e][x[_e].length-1]):x=x[_e]});let w=wo(A[A.length-1]),j=$(A.join("."),m.arrays),_=Array.isArray(v),R=a["duplicate-arguments-array"];!R&&$(w,m.nargs)&&(R=!0,(!Oe(x[w])&&m.nargs[w]===1||Array.isArray(x[w])&&x[w].length===m.nargs[w])&&(x[w]=void 0)),v===Jr()?x[w]=Jr(x[w]):Array.isArray(x[w])?R&&j&&_?x[w]=a["flatten-duplicate-arrays"]?x[w].concat(v):(Array.isArray(x[w][0])?x[w]:[x[w]]).concat([v]):!R&&Boolean(j)===Boolean(_)?x[w]=v:x[w]=x[w].concat([v]):x[w]===void 0&&j?x[w]=_?v:[v]:R&&!(x[w]===void 0||$(w,m.counts)||$(w,m.bools))?x[w]=[x[w],v]:x[w]=v}function Mn(...y){y.forEach(function(A){Object.keys(A||{}).forEach(function(v){m.aliases[v]||(m.aliases[v]=[].concat(o[v]||[]),m.aliases[v].concat(v).forEach(function(x){if(/-/.test(x)&&a["camel-case-expansion"]){let w=Ut(x);w!==v&&m.aliases[v].indexOf(w)===-1&&(m.aliases[v].push(w),p[w]=!0)}}),m.aliases[v].concat(v).forEach(function(x){if(x.length>1&&/[A-Z]/.test(x)&&a["camel-case-expansion"]){let w=tr(x,"-");w!==v&&m.aliases[v].indexOf(w)===-1&&(m.aliases[v].push(w),p[w]=!0)}}),m.aliases[v].forEach(function(x){m.aliases[x]=[v].concat(m.aliases[v].filter(function(w){return x!==w}))}))})})}function $(y,A){let v=[].concat(m.aliases[y]||[],y),x=Object.keys(A),w=v.find(j=>x.includes(j));return w?A[w]:!1}function sn(y){let A=Object.keys(m);return[].concat(A.map(x=>m[x])).some(function(x){return Array.isArray(x)?x.includes(y):x[y]})}function lo(y,...A){return[].concat(...A).some(function(x){let w=y.match(x);return w&&sn(w[1])})}function W(y){if(y.match(C)||!y.match(/^-[^-]+/))return!1;let A=!0,v,x=y.slice(1).split("");for(let w=0;w<x.length;w++){if(v=y.slice(w+2),!sn(x[w])){A=!1;break}if(x[w+1]&&x[w+1]==="="||v==="-"||/[A-Za-z]/.test(x[w])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(v)||x[w+1]&&x[w+1].match(/\W/))break}return A}function ee(y){return a["unknown-options-as-args"]&&Ce(y)}function Ce(y){return y=y.replace(/^-{3,}/,"--"),y.match(C)||W(y)?!1:!lo(y,/^-+([^=]+?)=[\s\S]*$/,O,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function K(y){return!$(y,m.bools)&&!$(y,m.counts)&&`${y}`in l?l[y]:je(fe(y))}function je(y){return{[Ke.BOOLEAN]:!0,[Ke.STRING]:"",[Ke.NUMBER]:void 0,[Ke.ARRAY]:[]}[y]}function fe(y){let A=Ke.BOOLEAN;return $(y,m.strings)?A=Ke.STRING:$(y,m.numbers)?A=Ke.NUMBER:$(y,m.bools)?A=Ke.BOOLEAN:$(y,m.arrays)&&(A=Ke.ARRAY),A}function Oe(y){return y===void 0}function qr(){Object.keys(m.counts).find(y=>$(y,m.arrays)?(N=Error(g("Invalid configuration: %s, opts.count excludes opts.array.",y)),!0):$(y,m.nargs)?(N=Error(g("Invalid configuration: %s, opts.count excludes opts.narg.",y)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(q,V),configuration:a,defaulted:Object.assign({},b),error:N,newAliases:Object.assign({},p)}}};function Ac(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 Jr(e){return e!==void 0?e+1:1}function wo(e){return e==="__proto__"?"___proto___":e}function xc(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 Ec}from"fs";var Ao=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])<Ao)throw Error(`yargs parser supports a minimum Node.js version of ${Ao}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var _c=process?process.env:{},xo=new rr({cwd:process.cwd,env:()=>_c,format:Cc,normalize:Oc,resolve:vc,require:e=>{if(typeof ve!="undefined")return ve(e);if(e.match(/\.json$/))return JSON.parse(Ec(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),In=function(t,n){return xo.parse(t.slice(),n).argv};In.detailed=function(e,t){return xo.parse(e.slice(),t)};In.camelCase=Ut;In.decamelize=tr;In.looksLikeNumber=nr;var Co=In;import{basename as Wc,dirname as Bc,extname as Hc,relative as Gc,resolve as So}from"path";function Sc(){return Pc()?0:1}function Pc(){return jc()&&!process.defaultApp}function jc(){return!!process.versions.electron}function Oo(){return process.argv[Sc()]}var te=class extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,te)}};import{readFileSync as Mc,statSync as Ic,writeFile as Fc}from"fs";import{format as Tc}from"util";import{resolve as Lc}from"path";var vo={fs:{readFileSync:Mc,writeFile:Fc},format:Tc,resolve:Lc,exists:e=>{try{return Ic(e).isFile()}catch(t){return!1}}};var nt,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(),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(),nt.format.apply(nt.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),nt.format.apply(nt.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);nt.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{nt.fs.readFileSync&&(t=JSON.parse(nt.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=nt.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~n.lastIndexOf("_")){let i=nt.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(t){return nt.exists(t)}};function Eo(e,t){nt=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 Dc=e=>Eo(e,vo),_o=Dc;var zc={},qc="require is not supported by ESM",Po="loading a directory of commands is not supported yet for ESM",Fn;try{Fn=$c(zc.url)}catch(e){Fn=process.cwd()}var Yc=Fn.substring(0,Fn.lastIndexOf("node_modules")),jo={assert:{notStrictEqual:Nc,strictEqual:kc},cliui:Qr,findUp:bo,getEnv:e=>process.env[e],inspect:Rc,getCallerFile:()=>{throw new te(Po)},getProcessArgvBin:Oo,mainFilename:Yc||process.cwd(),Parser:Co,path:{basename:Wc,dirname:Bc,extname:Hc,relative:Gc,resolve:So},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:Uc,require:()=>{throw new te(qc)},requireDirectory:()=>{throw new te(Po)},stringWidth:e=>[...e].length,y18n:_o({directory:So(Fn,"../../../locales"),updateFiles:!1})};function Le(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function Zr(e,t){t.assert.strictEqual(typeof e,"string")}function an(e){return Object.keys(e)}function re(e){return!!e&&!!e.then&&typeof e.then=="function"}function bt(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 Vc=["first","second","third","fourth","fifth","sixth"];function S(e,t,n){function r(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[bt(`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 c=a||l.length;if(c<s.demanded.length)throw new te(`Not enough arguments provided. Expected ${s.demanded.length} but received ${l.length}.`);let f=s.demanded.length+s.optional.length;if(c>f)throw new te(`Too many arguments provided. Expected max ${f} but received ${c}.`);s.demanded.forEach(u=>{let d=l.shift(),p=Mo(d);u.cmd.filter(g=>g===p||g==="*").length===0&&Io(p,u.cmd,i),i+=1}),s.optional.forEach(u=>{if(l.length===0)return;let d=l.shift(),p=Mo(d);u.cmd.filter(g=>g===p||g==="*").length===0&&Io(p,u.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function Mo(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function Io(e,t,n){throw new te(`Invalid ${Vc[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var ir=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,r=!0,i=!1){if(S("<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 Fo(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function $t(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(re(i))return i.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(i,t);return re(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},e)}function Wt(e,t,n=r=>{throw r}){try{let r=Kc(e)?e():e;return re(r)?r.then(i=>t(i)):t(r)}catch(r){return n(r)}}function Kc(e){return typeof e=="function"}function ei(e){if(typeof ve=="undefined")return null;for(let t=0,n=Object.keys(ve.cache),r;t<n.length;t++)if(r=ve.cache[n[t]],r.exports===e)return r;return null}var ln=/(^\*)|(^\$0)/,ti=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 c=s(o,a,l);if(c){if(this.requireCache.has(a))return c;this.requireCache.add(a),this.addHandler(c)}return c},this.shim.requireDirectory({require:n,filename:r},t,i)}addHandler(t,n,r,i,s,o){let a=[],l=Fo(s);if(i=i||(()=>{}),Array.isArray(t))if(Qc(t))[t,...a]=t;else for(let c of t)this.addHandler(c);else if(Xc(t)){let c=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(c=[].concat(c).concat(t.aliases)),this.addHandler(c,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(To(r)){this.addHandler([t].concat(a),n,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof t=="string"){let c=bt(t);a=a.map(d=>bt(d).cmd);let f=!1,u=[c.cmd].concat(a).filter(d=>ln.test(d)?(f=!0,!1):!0);u.length===0&&f&&u.push("$0"),f&&(c.cmd=u[0],a=u.slice(1),t=t.replace(ln,c.cmd)),a.forEach(d=>{this.aliasMap[d]=c.cmd}),n!==!1&&this.usage.command(t,n,f,a,o),this.handlers[c.cmd]={original:t,description:n,handler:i,builder:r||{},middlewares:l,deprecated:o,demanded:c.demanded,optional:c.optional},f&&(this.defaultCommand=this.handlers[c.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(),c=l.commands.slice(),f=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let u=this.applyBuilderUpdateUsageAndParse(f,a,n,r.aliases,c,i,s,o);return re(u)?u.then(d=>this.applyMiddlewareAndGetResult(f,a,d.innerArgv,l,s,d.aliases,n)):this.applyMiddlewareAndGetResult(f,a,u.innerArgv,l,s,u.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,r,i,s,o,a,l){let c=n.builder,f=r;if(or(c)){let u=c(r.getInternalMethods().reset(i),l);if(re(u))return u.then(d=>(f=Do(d)?d:r,this.parseAndUpdateUsage(t,n,f,s,o,a)))}else Jc(c)&&(f=r.getInternalMethods().reset(i),Object.keys(n.builder).forEach(u=>{f.option(u,c[u])}));return this.parseAndUpdateUsage(t,n,f,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 re(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=ln.test(n.original)?n.original.replace(ln,"").trim():n.original,i=t.filter(s=>!ln.test(s));return i.push(r),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,n,r,i,s,o,a,l){if(!o.getInternalMethods().getHasOutput()){let c=o.getInternalMethods().runValidation(s,l,o.parsed.error,t);r=Wt(r,f=>(c(f),f))}if(n.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();let c=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(r,c,!1,!1),r=$t(r,o,a,!1),r=Wt(r,f=>{let u=n.handler(f);return re(u)?u.then(()=>f):f}),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),re(r)&&!o.getInternalMethods().hasParseCallback()&&r.catch(f=>{try{o.getInternalMethods().getUsageInstance().fail(null,f)}catch(u){}})}return t||(i.commands.pop(),i.fullCommands.pop()),r}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 c=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares),f=$t(r,a,c,!0);return re(f)?f.then(u=>this.handleValidationAndGetResult(t,n,u,i,o,a,c,l)):this.handleValidationAndGetResult(t,n,f,i,o,a,c,l)}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=bt(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 c of Object.keys(r.alias))s.alias[c]=(s.alias[c]||[]).concat(r.alias[c]);s.array=s.array.concat(r.array),s.config={};let o=[];if(Object.keys(n).forEach(c=>{n[c].map(f=>{s.configuration["unknown-options-as-args"]&&(s.key[c]=!0),o.push(`--${c}`),o.push(f)})}),!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 c=Object.keys(n);Object.keys(n).forEach(f=>{c.push(...l.aliases[f])}),Object.keys(l.argv).forEach(f=>{c.includes(f)&&(n[f]||(n[f]=l.argv[f]),!this.isInConfigs(i,f)&&!this.isDefaulted(i,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])})}}isDefaulted(t,n){let{default:r}=t.getOptions();return Object.prototype.hasOwnProperty.call(r,n)||Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(n))}isInConfigs(t,n){let{configObjects:r}=t.getOptions();return r.some(i=>Object.prototype.hasOwnProperty.call(i,n))||r.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(n)))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let r=ln.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(or(n))return n(t,!0);To(n)||Object.keys(n).forEach(r=>{t.option(r,n[r])})}moduleName(t){let n=ei(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;Le(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();Le(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 Lo(e,t,n,r){return new ti(e,t,n,r)}function To(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Qc(e){return e.every(t=>typeof t=="string")}function or(e){return typeof e=="function"}function Jc(e){return typeof e=="object"}function Xc(e){return typeof e=="object"&&!Array.isArray(e)}function yt(e={},t=()=>!0){let n={};return an(e).forEach(r=>{t(r,e[r])&&(n[r]=e[r])}),n}function wt(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 Zc(e){return typeof e=="boolean"}function ko(e,t){let n=t.y18n.__,r={},i=[];r.failFn=function(E){i.push(E)};let s=null,o=null,a=!0;r.showHelpOnFail=function(E=!0,L){let[G,X]=typeof E=="string"?[!0,E]:[E,L];return e.getInternalMethods().isGlobalContext()&&(o=X),s=X,a=G,r};let l=!1;r.fail=function(E,L){let G=e.getInternalMethods().getLoggerInstance();if(i.length)for(let X=i.length-1;X>=0;--X){let de=i[X];if(Zc(de)){if(L)throw L;if(E)throw Error(E)}else de(E,L,r)}else{if(e.getExitProcess()&&wt(!0),!l){l=!0,a&&(e.showHelp("error"),G.error()),(E||L)&&G.error(E||L);let X=s||o;X&&((E||L)&&G.error(""),G.error(X))}if(L=L||new te(E),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,L);throw L}};let c=[],f=!1;r.usage=(I,E)=>I===null?(f=!0,c=[],r):(f=!1,c.push([I,E||""]),r),r.getUsage=()=>c,r.getUsageDisabled=()=>f,r.getPositionalGroupName=()=>n("Positionals:");let u=[];r.example=(I,E)=>{u.push([I,E||""])};let d=[];r.command=function(E,L,G,X,de=!1){G&&(d=d.map(J=>(J[2]=!1,J))),d.push([E,L||"",G,X,de])},r.getCommands=()=>d;let p={};r.describe=function(E,L){Array.isArray(E)?E.forEach(G=>{r.describe(G,L)}):typeof E=="object"?Object.keys(E).forEach(G=>{r.describe(G,E[G])}):p[E]=L},r.getDescriptions=()=>p;let b=[];r.epilog=I=>{b.push(I)};let g=!1,m;r.wrap=I=>{g=!0,m=I};function C(){return g||(m=Z(),g=!0),m}let O="__yargsString__:";r.deferY18nLookup=I=>O+I,r.help=function(){if(V)return V;Y();let E=e.customScriptName?e.$0:t.path.basename(e.$0),L=e.getDemandedOptions(),G=e.getDemandedCommands(),X=e.getDeprecatedOptions(),de=e.getGroups(),J=e.getOptions(),xe=[];xe=xe.concat(Object.keys(p)),xe=xe.concat(Object.keys(L)),xe=xe.concat(Object.keys(G)),xe=xe.concat(Object.keys(J.default)),xe=xe.filter(k),xe=Object.keys(xe.reduce((W,ee)=>(ee!=="_"&&(W[ee]=!0),W),{}));let gt=C(),ne=t.cliui({width:gt,wrap:!!gt});if(!f){if(c.length)c.forEach(W=>{ne.div({text:`${W[0].replace(/\$0/g,E)}`}),W[1]&&ne.div({text:`${W[1]}`,padding:[1,0,0,0]})}),ne.div();else if(d.length){let W=null;G._?W=`${E} <${n("command")}>
12
12
  `:W=`${E} [${n("command")}]
13
- `,ne.div(`${W}`)}}if(d.length>1||d.length===1&&!d[0][2]){ne.div(n("Commands:"));let W=e.getInternalMethods().getContext(),ee=W.commands.length?`${W.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(d=d.sort((K,Pe)=>K[0].localeCompare(Pe[0])));let Ce=E?`${E} `:"";d.forEach(K=>{let Pe=`${Ce}${ee}${K[0].replace(/^\$0 ?/,"")}`;ne.span({text:Pe,padding:[0,2,0,2],width:N(d,mt,`${E}${ee}`)+4},{text:K[1]});let fe=[];K[2]&&fe.push(`[${n("default")}]`),K[3]&&K[3].length&&fe.push(`[${n("aliases:")} ${K[3].join(", ")}]`),K[4]&&(typeof K[4]=="string"?fe.push(`[${n("deprecated: %s",K[4])}]`):fe.push(`[${n("deprecated")}]`)),fe.length?ne.div({text:fe.join(" "),padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}let ct=(Object.keys(J.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);xe=xe.filter(W=>!e.parsed.newAliases[W]&&ct.every(ee=>(J.alias[ee]||[]).indexOf(W)===-1));let Pn=n("Options:");de[Pn]||(de[Pn]=[]),q(xe,J.alias,de,Pn);let $=W=>/^--/.test(sr(W)),on=Object.keys(de).filter(W=>de[W].length>0).map(W=>{let ee=de[W].filter(k).map(Ce=>{if(ct.includes(Ce))return Ce;for(let K=0,Pe;(Pe=ct[K])!==void 0;K++)if((J.alias[Pe]||[]).includes(Ce))return Pe;return Ce});return{groupName:W,normalizedKeys:ee}}).filter(({normalizedKeys:W})=>W.length>0).map(({groupName:W,normalizedKeys:ee})=>{let Ce=ee.reduce((K,Pe)=>(K[Pe]=[Pe].concat(J.alias[Pe]||[]).map(fe=>W===r.getPositionalGroupName()?fe:(/^[0-9]$/.test(fe)?J.boolean.includes(Pe)?"-":"--":fe.length>1?"--":"-")+fe).sort((fe,Oe)=>$(fe)===$(Oe)?0:$(fe)?1:-1).join(", "),K),{});return{groupName:W,normalizedKeys:ee,switches:Ce}});if(on.filter(({groupName:W})=>W!==r.getPositionalGroupName()).some(({normalizedKeys:W,switches:ee})=>!W.every(Ce=>$(ee[Ce])))&&on.filter(({groupName:W})=>W!==r.getPositionalGroupName()).forEach(({normalizedKeys:W,switches:ee})=>{W.forEach(Ce=>{$(ee[Ce])&&(ee[Ce]=tf(ee[Ce],4))})}),on.forEach(({groupName:W,normalizedKeys:ee,switches:Ce})=>{ne.div(W),ee.forEach(K=>{let Pe=Ce[K],fe=p[K]||"",Oe=null;fe.includes(O)&&(fe=n(fe.substring(O.length))),J.boolean.includes(K)&&(Oe=`[${n("boolean")}]`),J.count.includes(K)&&(Oe=`[${n("count")}]`),J.string.includes(K)&&(Oe=`[${n("string")}]`),J.normalize.includes(K)&&(Oe=`[${n("string")}]`),J.array.includes(K)&&(Oe=`[${n("array")}]`),J.number.includes(K)&&(Oe=`[${n("number")}]`);let qr=A=>typeof A=="string"?`[${n("deprecated: %s",A)}]`:`[${n("deprecated")}]`,b=[K in X?qr(X[K]):null,Oe,K in F?`[${n("required")}]`:null,J.choices&&J.choices[K]?`[${n("choices:")} ${r.stringifiedValues(J.choices[K])}]`:null,Q(J.default[K],J.defaultDescription[K])].filter(Boolean).join(" ");ne.span({text:sr(Pe),padding:[0,2,0,2+Do(Pe)],width:N(Ce,mt)+4},fe),b?ne.div({text:b,padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}),u.length&&(ne.div(n("Examples:")),u.forEach(W=>{W[0]=W[0].replace(/\$0/g,E)}),u.forEach(W=>{W[1]===""?ne.div({text:W[0],padding:[0,2,0,2]}):ne.div({text:W[0],padding:[0,2,0,2],width:N(u,mt)+4},{text:W[1]})}),ne.div()),y.length>0){let W=y.map(ee=>ee.replace(/\$0/g,E)).join(`
13
+ `,ne.div(`${W}`)}}if(d.length>1||d.length===1&&!d[0][2]){ne.div(n("Commands:"));let W=e.getInternalMethods().getContext(),ee=W.commands.length?`${W.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(d=d.sort((K,je)=>K[0].localeCompare(je[0])));let Ce=E?`${E} `:"";d.forEach(K=>{let je=`${Ce}${ee}${K[0].replace(/^\$0 ?/,"")}`;ne.span({text:je,padding:[0,2,0,2],width:N(d,gt,`${E}${ee}`)+4},{text:K[1]});let fe=[];K[2]&&fe.push(`[${n("default")}]`),K[3]&&K[3].length&&fe.push(`[${n("aliases:")} ${K[3].join(", ")}]`),K[4]&&(typeof K[4]=="string"?fe.push(`[${n("deprecated: %s",K[4])}]`):fe.push(`[${n("deprecated")}]`)),fe.length?ne.div({text:fe.join(" "),padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}let ft=(Object.keys(J.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);xe=xe.filter(W=>!e.parsed.newAliases[W]&&ft.every(ee=>(J.alias[ee]||[]).indexOf(W)===-1));let Mn=n("Options:");de[Mn]||(de[Mn]=[]),q(xe,J.alias,de,Mn);let $=W=>/^--/.test(sr(W)),sn=Object.keys(de).filter(W=>de[W].length>0).map(W=>{let ee=de[W].filter(k).map(Ce=>{if(ft.includes(Ce))return Ce;for(let K=0,je;(je=ft[K])!==void 0;K++)if((J.alias[je]||[]).includes(Ce))return je;return Ce});return{groupName:W,normalizedKeys:ee}}).filter(({normalizedKeys:W})=>W.length>0).map(({groupName:W,normalizedKeys:ee})=>{let Ce=ee.reduce((K,je)=>(K[je]=[je].concat(J.alias[je]||[]).map(fe=>W===r.getPositionalGroupName()?fe:(/^[0-9]$/.test(fe)?J.boolean.includes(je)?"-":"--":fe.length>1?"--":"-")+fe).sort((fe,Oe)=>$(fe)===$(Oe)?0:$(fe)?1:-1).join(", "),K),{});return{groupName:W,normalizedKeys:ee,switches:Ce}});if(sn.filter(({groupName:W})=>W!==r.getPositionalGroupName()).some(({normalizedKeys:W,switches:ee})=>!W.every(Ce=>$(ee[Ce])))&&sn.filter(({groupName:W})=>W!==r.getPositionalGroupName()).forEach(({normalizedKeys:W,switches:ee})=>{W.forEach(Ce=>{$(ee[Ce])&&(ee[Ce]=ef(ee[Ce],4))})}),sn.forEach(({groupName:W,normalizedKeys:ee,switches:Ce})=>{ne.div(W),ee.forEach(K=>{let je=Ce[K],fe=p[K]||"",Oe=null;fe.includes(O)&&(fe=n(fe.substring(O.length))),J.boolean.includes(K)&&(Oe=`[${n("boolean")}]`),J.count.includes(K)&&(Oe=`[${n("count")}]`),J.string.includes(K)&&(Oe=`[${n("string")}]`),J.normalize.includes(K)&&(Oe=`[${n("string")}]`),J.array.includes(K)&&(Oe=`[${n("array")}]`),J.number.includes(K)&&(Oe=`[${n("number")}]`);let qr=A=>typeof A=="string"?`[${n("deprecated: %s",A)}]`:`[${n("deprecated")}]`,y=[K in X?qr(X[K]):null,Oe,K in L?`[${n("required")}]`:null,J.choices&&J.choices[K]?`[${n("choices:")} ${r.stringifiedValues(J.choices[K])}]`:null,Q(J.default[K],J.defaultDescription[K])].filter(Boolean).join(" ");ne.span({text:sr(je),padding:[0,2,0,2+No(je)],width:N(Ce,gt)+4},fe),y?ne.div({text:y,padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}),u.length&&(ne.div(n("Examples:")),u.forEach(W=>{W[0]=W[0].replace(/\$0/g,E)}),u.forEach(W=>{W[1]===""?ne.div({text:W[0],padding:[0,2,0,2]}):ne.div({text:W[0],padding:[0,2,0,2],width:N(u,gt)+4},{text:W[1]})}),ne.div()),b.length>0){let W=b.map(ee=>ee.replace(/\$0/g,E)).join(`
14
14
  `);ne.div(`${W}
15
- `)}return ne.toString().replace(/\s*$/,"")};function N(M,E,F){let H=0;return Array.isArray(M)||(M=Object.values(M).map(X=>[X])),M.forEach(X=>{H=Math.max(t.stringWidth(F?`${F} ${sr(X[0])}`:sr(X[0]))+Do(X[0]),H)}),E&&(H=Math.min(H,parseInt((E*.5).toString(),10))),H}function Y(){let M=e.getDemandedOptions(),E=e.getOptions();(Object.keys(E.alias)||[]).forEach(F=>{E.alias[F].forEach(H=>{p[H]&&r.describe(F,p[H]),H in M&&e.demandOption(F,M[H]),E.boolean.includes(H)&&e.boolean(F),E.count.includes(H)&&e.count(F),E.string.includes(H)&&e.string(F),E.normalize.includes(H)&&e.normalize(F),E.array.includes(H)&&e.array(F),E.number.includes(H)&&e.number(F)})})}let V;r.cacheHelpMessage=function(){V=this.help()},r.clearCachedHelpMessage=function(){V=void 0},r.hasCachedHelpMessage=function(){return!!V};function q(M,E,F,H){let X=[],de=null;return Object.keys(F).forEach(J=>{X=X.concat(F[J])}),M.forEach(J=>{de=[J].concat(E[J]),de.some(xe=>X.indexOf(xe)!==-1)||F[H].push(J)}),X}function k(M){return e.getOptions().hiddenOptions.indexOf(M)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}r.showHelp=M=>{let E=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:E[M])(r.help())},r.functionDescription=M=>{let E=M.name?t.Parser.decamelize(M.name,"-"):n("generated-value");return["(",E,")"].join("")},r.stringifiedValues=function(E,F){let H="",X=F||", ",de=[].concat(E);return!E||!de.length||de.forEach(J=>{H.length&&(H+=X),H+=JSON.stringify(J)}),H};function Q(M,E){let F=`[${n("default:")} `;if(M===void 0&&!E)return null;if(E)F+=E;else switch(typeof M){case"string":F+=`"${M}"`;break;case"object":F+=JSON.stringify(M);break;default:F+=M}return`${F}]`}function Z(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let G=null;r.version=M=>{G=M},r.showVersion=M=>{let E=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:E[M])(G)},r.reset=function(E){return s=null,l=!1,c=[],f=!1,y=[],u=[],d=[],p=yt(p,F=>!E[F]),r};let Ge=[];return r.freeze=function(){Ge.push({failMessage:s,failureOutput:l,usages:c,usageDisabled:f,epilogs:y,examples:u,commands:d,descriptions:p})},r.unfreeze=function(E=!1){let F=Ge.pop();!F||(E?(p={...F.descriptions,...p},d=[...F.commands,...d],c=[...F.usages,...c],u=[...F.examples,...u],y=[...F.epilogs,...y]):{failMessage:s,failureOutput:l,usages:c,usageDisabled:f,epilogs:y,examples:u,commands:d,descriptions:p}=F)},r}function ti(e){return typeof e=="object"}function tf(e,t){return ti(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Do(e){return ti(e)?e.indentation:0}function sr(e){return ti(e)?e.text:e}var ko=`###-begin-{{app_name}}-completions-###
15
+ `)}return ne.toString().replace(/\s*$/,"")};function N(I,E,L){let G=0;return Array.isArray(I)||(I=Object.values(I).map(X=>[X])),I.forEach(X=>{G=Math.max(t.stringWidth(L?`${L} ${sr(X[0])}`:sr(X[0]))+No(X[0]),G)}),E&&(G=Math.min(G,parseInt((E*.5).toString(),10))),G}function Y(){let I=e.getDemandedOptions(),E=e.getOptions();(Object.keys(E.alias)||[]).forEach(L=>{E.alias[L].forEach(G=>{p[G]&&r.describe(L,p[G]),G in I&&e.demandOption(L,I[G]),E.boolean.includes(G)&&e.boolean(L),E.count.includes(G)&&e.count(L),E.string.includes(G)&&e.string(L),E.normalize.includes(G)&&e.normalize(L),E.array.includes(G)&&e.array(L),E.number.includes(G)&&e.number(L)})})}let V;r.cacheHelpMessage=function(){V=this.help()},r.clearCachedHelpMessage=function(){V=void 0},r.hasCachedHelpMessage=function(){return!!V};function q(I,E,L,G){let X=[],de=null;return Object.keys(L).forEach(J=>{X=X.concat(L[J])}),I.forEach(J=>{de=[J].concat(E[J]),de.some(xe=>X.indexOf(xe)!==-1)||L[G].push(J)}),X}function k(I){return e.getOptions().hiddenOptions.indexOf(I)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}r.showHelp=I=>{let E=e.getInternalMethods().getLoggerInstance();I||(I="error"),(typeof I=="function"?I:E[I])(r.help())},r.functionDescription=I=>{let E=I.name?t.Parser.decamelize(I.name,"-"):n("generated-value");return["(",E,")"].join("")},r.stringifiedValues=function(E,L){let G="",X=L||", ",de=[].concat(E);return!E||!de.length||de.forEach(J=>{G.length&&(G+=X),G+=JSON.stringify(J)}),G};function Q(I,E){let L=`[${n("default:")} `;if(I===void 0&&!E)return null;if(E)L+=E;else switch(typeof I){case"string":L+=`"${I}"`;break;case"object":L+=JSON.stringify(I);break;default:L+=I}return`${L}]`}function Z(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let H=null;r.version=I=>{H=I},r.showVersion=I=>{let E=e.getInternalMethods().getLoggerInstance();I||(I="error"),(typeof I=="function"?I:E[I])(H)},r.reset=function(E){return s=null,l=!1,c=[],f=!1,b=[],u=[],d=[],p=yt(p,L=>!E[L]),r};let He=[];return r.freeze=function(){He.push({failMessage:s,failureOutput:l,usages:c,usageDisabled:f,epilogs:b,examples:u,commands:d,descriptions:p})},r.unfreeze=function(E=!1){let L=He.pop();!L||(E?(p={...L.descriptions,...p},d=[...L.commands,...d],c=[...L.usages,...c],u=[...L.examples,...u],b=[...L.epilogs,...b]):{failMessage:s,failureOutput:l,usages:c,usageDisabled:f,epilogs:b,examples:u,commands:d,descriptions:p}=L)},r}function ni(e){return typeof e=="object"}function ef(e,t){return ni(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function No(e){return ni(e)?e.indentation:0}function sr(e){return ni(e)?e.text:e}var Ro=`###-begin-{{app_name}}-completions-###
16
16
  #
17
17
  # yargs command completion script
18
18
  #
@@ -40,7 +40,7 @@ _{{app_name}}_yargs_completions()
40
40
  }
41
41
  complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
42
42
  ###-end-{{app_name}}-completions-###
43
- `,Ro=`#compdef {{app_name}}
43
+ `,Uo=`#compdef {{app_name}}
44
44
  ###-begin-{{app_name}}-completions-###
45
45
  #
46
46
  # yargs command completion script
@@ -59,55 +59,55 @@ _{{app_name}}_yargs_completions()
59
59
  }
60
60
  compdef _{{app_name}}_yargs_completions {{app_name}}
61
61
  ###-end-{{app_name}}-completions-###
62
- `;var ni=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 c=s[t[a]].builder;if(or(c)){this.indexAfterLastReset=a+1;let f=this.yargs.getInternalMethods().reset();return c(f,!0),f.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=gt(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)&&!s.hiddenOptions.includes(a)&&!this.argsContainKey(n,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.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,n,r,i){if(i===""&&t.length>0&&this.previousArgHasChoices(n))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=s[r._.length-o-1];if(!a)return;let l=this.yargs.getOptions().choices[a]||[];for(let c of l)c.startsWith(i)&&t.push(c.replace(/:/g,"\\:"))}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){let i=s=>t.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(i(n)||r&&i(`no-${n}`))return!0;if(this.aliases){for(let s of this.aliases[n])if(i(s))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(Le(this.customCompletionFunction,null,this.shim),rf(this.customCompletionFunction)){let s=this.customCompletionFunction(r,n);return re(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 of(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 re(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 Uo(e,t,n,r){return new ni(e,t,n,r)}function rf(e){return e.length<3}function of(e){return e.length>3}function $o(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 Wo=["$0","--","_"];function Bo(e,t,n){let r=n.y18n.__,i=n.y18n.__n,s={};s.nonOptionCount=function(u){let d=e.getDemandedCommands(),y=u._.length+(u["--"]?u["--"].length:0)-e.getInternalMethods().getContext().commands.length;d._&&(y<d._.min||y>d._.max)&&(y<d._.min?d._.minMsg!==void 0?t.fail(d._.minMsg?d._.minMsg.replace(/\$0/g,y.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",y,y.toString(),d._.min.toString())):y>d._.max&&(d._.maxMsg!==void 0?t.fail(d._.maxMsg?d._.maxMsg.replace(/\$0/g,y.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",y,y.toString(),d._.max.toString()))))},s.positionalCount=function(u,d){d<u&&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+"",u+""))},s.requiredArguments=function(u,d){let p=null;for(let y of Object.keys(d))(!Object.prototype.hasOwnProperty.call(u,y)||typeof u[y]=="undefined")&&(p=p||{},p[y]=d[y]);if(p){let y=[];for(let m of Object.keys(p)){let C=p[m];C&&y.indexOf(C)<0&&y.push(C)}let g=y.length?`
63
- ${y.join(`
64
- `)}`:"";t.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(p).length,Object.keys(p).join(", ")+g))}},s.unknownArguments=function(u,d,p,y,g=!0){var m;let C=e.getInternalMethods().getCommandInstance().getCommands(),O=[],N=e.getInternalMethods().getContext();if(Object.keys(u).forEach(Y=>{!Wo.includes(Y)&&!Object.prototype.hasOwnProperty.call(p,Y)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),Y)&&!s.isValidAndSomeAliasIsNotNew(Y,d)&&O.push(Y)}),g&&(N.commands.length>0||C.length>0||y)&&u._.slice(N.commands.length).forEach(Y=>{C.includes(""+Y)||O.push(""+Y)}),g){let V=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,q=N.commands.length+V;q<u._.length&&u._.slice(q).forEach(k=>{k=String(k),!N.commands.includes(k)&&!O.includes(k)&&O.push(k)})}O.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",O.length,O.map(Y=>Y.trim()?Y:`"${Y}"`).join(", ")))},s.unknownCommands=function(u){let d=e.getInternalMethods().getCommandInstance().getCommands(),p=[],y=e.getInternalMethods().getContext();return(y.commands.length>0||d.length>0)&&u._.slice(y.commands.length).forEach(g=>{d.includes(""+g)||p.push(""+g)}),p.length>0?(t.fail(i("Unknown command: %s","Unknown commands: %s",p.length,p.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(u,d){if(!Object.prototype.hasOwnProperty.call(d,u))return!1;let p=e.parsed.newAliases;return[u,...d[u]].some(y=>!Object.prototype.hasOwnProperty.call(p,y)||!p[u])},s.limitedChoices=function(u){let d=e.getOptions(),p={};if(!Object.keys(d.choices).length)return;Object.keys(u).forEach(m=>{Wo.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(d.choices,m)&&[].concat(u[m]).forEach(C=>{d.choices[m].indexOf(C)===-1&&C!==void 0&&(p[m]=(p[m]||[]).concat(C))})});let y=Object.keys(p);if(!y.length)return;let g=r("Invalid values:");y.forEach(m=>{g+=`
65
- ${r("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(p[m]),t.stringifiedValues(d.choices[m]))}`}),t.fail(g)};let o={};s.implies=function(u,d){S("<string|object> [array|number|string]",[u,d],arguments.length),typeof u=="object"?Object.keys(u).forEach(p=>{s.implies(p,u[p])}):(e.global(u),o[u]||(o[u]=[]),Array.isArray(d)?d.forEach(p=>s.implies(u,p)):(Le(d,void 0,n),o[u].push(d)))},s.getImplied=function(){return o};function a(f,u){let d=Number(u);return u=isNaN(d)?u:d,typeof u=="number"?u=f._.length>=u:u.match(/^--no-.+/)?(u=u.match(/^--no-(.+)/)[1],u=!Object.prototype.hasOwnProperty.call(f,u)):u=Object.prototype.hasOwnProperty.call(f,u),u}s.implications=function(u){let d=[];if(Object.keys(o).forEach(p=>{let y=p;(o[p]||[]).forEach(g=>{let m=y,C=g;m=a(u,m),g=a(u,g),m&&!g&&d.push(` ${y} -> ${C}`)})}),d.length){let p=`${r("Implications failed:")}
66
- `;d.forEach(y=>{p+=y}),t.fail(p)}};let l={};s.conflicts=function(u,d){S("<string|object> [array|string]",[u,d],arguments.length),typeof u=="object"?Object.keys(u).forEach(p=>{s.conflicts(p,u[p])}):(e.global(u),l[u]||(l[u]=[]),Array.isArray(d)?d.forEach(p=>s.conflicts(u,p)):l[u].push(d))},s.getConflicting=()=>l,s.conflicting=function(u){Object.keys(u).forEach(d=>{l[d]&&l[d].forEach(p=>{p&&u[d]!==void 0&&u[p]!==void 0&&t.fail(r("Arguments %s and %s are mutually exclusive",d,p))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(d=>{l[d].forEach(p=>{p&&u[n.Parser.camelCase(d)]!==void 0&&u[n.Parser.camelCase(p)]!==void 0&&t.fail(r("Arguments %s and %s are mutually exclusive",d,p))})})},s.recommendCommands=function(u,d){d=d.sort((m,C)=>C.length-m.length);let y=null,g=1/0;for(let m=0,C;(C=d[m])!==void 0;m++){let O=$o(u,C);O<=3&&O<g&&(g=O,y=C)}y&&t.fail(r("Did you mean %s?",y))},s.reset=function(u){return o=yt(o,d=>!u[d]),l=yt(l,d=>!u[d]),s};let c=[];return s.freeze=function(){c.push({implied:o,conflicting:l})},s.unfreeze=function(){let u=c.pop();Le(u,void 0,n),{implied:o,conflicting:l}=u},s}var ri=[],Fn;function ar(e,t,n,r){Fn=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=af(t,e.extends);else try{o=ve.resolve(e.extends)}catch(a){return e}sf(o),ri.push(o),i=s?JSON.parse(Fn.readFileSync(o,"utf8")):ve(e.extends),delete e.extends,i=ar(i,Fn.path.dirname(o),n,Fn)}return ri=[],n?Go(i,e):Object.assign({},i,e)}function sf(e){if(ri.indexOf(e)>-1)throw new te(`Circular extended configurations: '${e}'.`)}function af(e,t){return Fn.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 j=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},h=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)},ue,Bt,Tn,Qe,Ye,lr,wt,Gt,cr,Je,fr,Xe,rt,ze,Ze,ur,ln,Se,T,dr,pr,Ve,Ht,cn,qt,At,hr,B,Yt,zt,Vt,z,it,se;function ls(e){return(t=[],n=e.process.cwd(),r)=>{let i=new hi(t,n,r,e);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Ho=Symbol("copyDoubleDash"),qo=Symbol("copyDoubleDash"),ii=Symbol("deleteFromParserHintObject"),Yo=Symbol("emitWarning"),zo=Symbol("freeze"),Vo=Symbol("getDollarZero"),Kt=Symbol("getParserConfiguration"),oi=Symbol("guessLocale"),Ko=Symbol("guessVersion"),Qo=Symbol("parsePositionalNumbers"),si=Symbol("pkgUp"),xt=Symbol("populateParserHintArray"),fn=Symbol("populateParserHintSingleValueDictionary"),ai=Symbol("populateParserHintArrayDictionary"),li=Symbol("populateParserHintDictionary"),ci=Symbol("sanitizeKey"),fi=Symbol("setKey"),ui=Symbol("unfreeze"),Jo=Symbol("validateAsync"),Xo=Symbol("getCommandInstance"),Zo=Symbol("getContext"),es=Symbol("getHasOutput"),ts=Symbol("getLoggerInstance"),ns=Symbol("getParseContext"),rs=Symbol("getUsageInstance"),is=Symbol("getValidationInstance"),mr=Symbol("hasParseCallback"),os=Symbol("isGlobalContext"),Qt=Symbol("postProcess"),ss=Symbol("rebase"),di=Symbol("reset"),Ln=Symbol("runYargsParserAndExecuteCommands"),pi=Symbol("runValidation"),as=Symbol("setHasOutput"),Jt=Symbol("kTrackManuallySetKeys"),hi=class{constructor(t=[],n,r,i){this.customScriptName=!1,this.parsed=!1,ue.set(this,void 0),Bt.set(this,void 0),Tn.set(this,{commands:[],fullCommands:[]}),Qe.set(this,null),Ye.set(this,null),lr.set(this,"show-hidden"),wt.set(this,null),Gt.set(this,!0),cr.set(this,{}),Je.set(this,!0),fr.set(this,[]),Xe.set(this,void 0),rt.set(this,{}),ze.set(this,!1),Ze.set(this,null),ur.set(this,!0),ln.set(this,void 0),Se.set(this,""),T.set(this,void 0),dr.set(this,void 0),pr.set(this,{}),Ve.set(this,null),Ht.set(this,null),cn.set(this,{}),qt.set(this,{}),At.set(this,void 0),hr.set(this,!1),B.set(this,void 0),Yt.set(this,!1),zt.set(this,!1),Vt.set(this,!1),z.set(this,void 0),it.set(this,null),se.set(this,void 0),j(this,B,i,"f"),j(this,At,t,"f"),j(this,Bt,n,"f"),j(this,dr,r,"f"),j(this,Xe,new ir(this),"f"),this.$0=this[Vo](),this[di](),j(this,ue,h(this,ue,"f"),"f"),j(this,z,h(this,z,"f"),"f"),j(this,se,h(this,se,"f"),"f"),j(this,T,h(this,T,"f"),"f"),h(this,T,"f").showHiddenOpt=h(this,lr,"f"),j(this,ln,this[qo](),"f")}addHelpOpt(t,n){let r="help";return S("[string|boolean] [string]",[t,n],arguments.length),h(this,Ze,"f")&&(this[ii](h(this,Ze,"f")),j(this,Ze,null,"f")),t===!1&&n===void 0?this:(j(this,Ze,typeof t=="string"?t:r,"f"),this.boolean(h(this,Ze,"f")),this.describe(h(this,Ze,"f"),n||h(this,z,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(S("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let r=typeof t=="string"?t:h(this,lr,"f");return this.boolean(r),this.describe(r,n||h(this,z,"f").deferY18nLookup("Show hidden options")),h(this,T,"f").showHiddenOpt=r,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return S("<object|string|array> [string|array]",[t,n],arguments.length),this[ai](this.alias.bind(this),"alias",t,n),this}array(t){return S("<array|string>",[t],arguments.length),this[xt]("array",t),this[Jt](t),this}boolean(t){return S("<array|string>",[t],arguments.length),this[xt]("boolean",t),this[Jt](t),this}check(t,n){return S("<function> [boolean]",[t,n],arguments.length),this.middleware((r,i)=>Wt(()=>t(r,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&h(this,z,"f").fail(s.toString(),s):h(this,z,"f").fail(h(this,B,"f").y18n.__("Argument check failed: %s",t.toString())),r),s=>(h(this,z,"f").fail(s.message?s.message:s.toString(),s),r)),!1,n),this}choices(t,n){return S("<object|string|array> [string|array]",[t,n],arguments.length),this[ai](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(S("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new te("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 te("coerce callback must be provided");return h(this,T,"f").key[t]=!0,h(this,Xe,"f").addCoerceMiddleware((r,i)=>{let s;return Object.prototype.hasOwnProperty.call(r,t)?Wt(()=>(s=i.getAliases(),n(r[t])),a=>{r[t]=a;let l=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&l!==!0)for(let c of s[t])r[c]=a;return r},a=>{throw new te(a.message)}):r},t),this}conflicts(t,n){return S("<string|object> [string|array]",[t,n],arguments.length),h(this,se,"f").conflicts(t,n),this}config(t="config",n,r){return S("[object|string] [string|function] [function]",[t,n,r],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=ar(t,h(this,Bt,"f"),this[Kt]()["deep-merge-config"]||!1,h(this,B,"f")),h(this,T,"f").configObjects=(h(this,T,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(r=n,n=void 0),this.describe(t,n||h(this,z,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{h(this,T,"f").config[i]=r||!0}),this)}completion(t,n,r){return S("[string] [string|boolean|function] [function]",[t,n,r],arguments.length),typeof n=="function"&&(r=n,n=void 0),j(this,Ye,t||h(this,Ye,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(h(this,Ye,"f"),n),r&&h(this,Qe,"f").registerFunction(r),this}command(t,n,r,i,s,o){return S("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,r,i,s,o],arguments.length),h(this,ue,"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){S("<string> [object]",[t,n],arguments.length);let r=h(this,dr,"f")||h(this,B,"f").require;return h(this,ue,"f").addDirectory(t,r,h(this,B,"f").getCallerFile(),n),this}count(t){return S("<array|string>",[t],arguments.length),this[xt]("count",t),this[Jt](t),this}default(t,n,r){return S("<object|string|array> [*] [string]",[t,n,r],arguments.length),r&&(Xr(t,h(this,B,"f")),h(this,T,"f").defaultDescription[t]=r),typeof n=="function"&&(Xr(t,h(this,B,"f")),h(this,T,"f").defaultDescription[t]||(h(this,T,"f").defaultDescription[t]=h(this,z,"f").functionDescription(n)),n=n.call()),this[fn](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 S("[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),h(this,T,"f").demandedCommands._={min:t,max:n,minMsg:r,maxMsg:i},this}demand(t,n,r){return Array.isArray(n)?(n.forEach(i=>{Le(r,!0,h(this,B,"f")),this.demandOption(i,r)}),n=1/0):typeof n!="number"&&(r=n,n=1/0),typeof t=="number"?(Le(r,!0,h(this,B,"f")),this.demandCommand(t,n,r,r)):Array.isArray(t)?t.forEach(i=>{Le(r,!0,h(this,B,"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 S("<object|string|array> [string]",[t,n],arguments.length),this[fn](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return S("<string> [string|boolean]",[t,n],arguments.length),h(this,T,"f").deprecatedOptions[t]=n,this}describe(t,n){return S("<object|string|array> [string]",[t,n],arguments.length),this[fi](t,!0),h(this,z,"f").describe(t,n),this}detectLocale(t){return S("<boolean>",[t],arguments.length),j(this,Gt,t,"f"),this}env(t){return S("[string|boolean]",[t],arguments.length),t===!1?delete h(this,T,"f").envPrefix:h(this,T,"f").envPrefix=t||"",this}epilogue(t){return S("<string>",[t],arguments.length),h(this,z,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return S("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(r=>this.example(...r)):h(this,z,"f").example(t,n),this}exit(t,n){j(this,ze,!0,"f"),j(this,wt,n,"f"),h(this,Je,"f")&&h(this,B,"f").process.exit(t)}exitProcess(t=!0){return S("[boolean]",[t],arguments.length),j(this,Je,t,"f"),this}fail(t){if(S("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new te("Invalid first argument. Expected function or boolean 'false'");return h(this,z,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return S("<array> [function]",[t,n],arguments.length),n?h(this,Qe,"f").getCompletion(t,n):new Promise((r,i)=>{h(this,Qe,"f").getCompletion(t,(s,o)=>{s?i(s):r(o)})})}getDemandedOptions(){return S([],0),h(this,T,"f").demandedOptions}getDemandedCommands(){return S([],0),h(this,T,"f").demandedCommands}getDeprecatedOptions(){return S([],0),h(this,T,"f").deprecatedOptions}getDetectLocale(){return h(this,Gt,"f")}getExitProcess(){return h(this,Je,"f")}getGroups(){return Object.assign({},h(this,rt,"f"),h(this,qt,"f"))}getHelp(){if(j(this,ze,!0,"f"),!h(this,z,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[Ln](h(this,At,"f"),void 0,void 0,0,!0);if(re(n))return n.then(()=>h(this,z,"f").help())}let t=h(this,ue,"f").runDefaultBuilderOn(this);if(re(t))return t.then(()=>h(this,z,"f").help())}return Promise.resolve(h(this,z,"f").help())}getOptions(){return h(this,T,"f")}getStrict(){return h(this,Yt,"f")}getStrictCommands(){return h(this,zt,"f")}getStrictOptions(){return h(this,Vt,"f")}global(t,n){return S("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?h(this,T,"f").local=h(this,T,"f").local.filter(r=>t.indexOf(r)===-1):t.forEach(r=>{h(this,T,"f").local.includes(r)||h(this,T,"f").local.push(r)}),this}group(t,n){S("<string|array> <string>",[t,n],arguments.length);let r=h(this,qt,"f")[n]||h(this,rt,"f")[n];h(this,qt,"f")[n]&&delete h(this,qt,"f")[n];let i={};return h(this,rt,"f")[n]=(r||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return S("<string>",[t],arguments.length),h(this,T,"f").hiddenOptions.push(t),this}implies(t,n){return S("<string|object> [number|string|array]",[t,n],arguments.length),h(this,se,"f").implies(t,n),this}locale(t){return S("[string]",[t],arguments.length),t===void 0?(this[oi](),h(this,B,"f").y18n.getLocale()):(j(this,Gt,!1,"f"),h(this,B,"f").y18n.setLocale(t),this)}middleware(t,n,r){return h(this,Xe,"f").addMiddleware(t,!!n,r)}nargs(t,n){return S("<string|object|array> [number]",[t,n],arguments.length),this[fn](this.nargs.bind(this),"narg",t,n),this}normalize(t){return S("<array|string>",[t],arguments.length),this[xt]("normalize",t),this}number(t){return S("<array|string>",[t],arguments.length),this[xt]("number",t),this[Jt](t),this}option(t,n){if(S("<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[Jt](t),h(this,it,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[Yo](['"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"),h(this,T,"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&&(h(this,T,"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){S("[string|array] [function|boolean|object] [function]",[t,n,r],arguments.length),this[zo](),typeof t=="undefined"&&(t=h(this,At,"f")),typeof n=="object"&&(j(this,Ht,n,"f"),n=r),typeof n=="function"&&(j(this,Ve,n,"f"),n=!1),n||j(this,At,t,"f"),h(this,Ve,"f")&&j(this,Je,!1,"f");let i=this[Ln](t,!!n),s=this.parsed;return h(this,Qe,"f").setParsed(this.parsed),re(i)?i.then(o=>(h(this,Ve,"f")&&h(this,Ve,"f").call(this,h(this,wt,"f"),o,h(this,Se,"f")),o)).catch(o=>{throw h(this,Ve,"f")&&h(this,Ve,"f")(o,this.parsed.argv,h(this,Se,"f")),o}).finally(()=>{this[ui](),this.parsed=s}):(h(this,Ve,"f")&&h(this,Ve,"f").call(this,h(this,wt,"f"),i,h(this,Se,"f")),this[ui](),this.parsed=s,i)}parseAsync(t,n,r){let i=this.parse(t,n,r);return re(i)?i:Promise.resolve(i)}parseSync(t,n,r){let i=this.parse(t,n,r);if(re(i))throw new te(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return S("<object>",[t],arguments.length),j(this,pr,t,"f"),this}pkgConf(t,n){S("<string> [string]",[t,n],arguments.length);let r=null,i=this[si](n||h(this,Bt,"f"));return i[t]&&typeof i[t]=="object"&&(r=ar(i[t],n||h(this,Bt,"f"),this[Kt]()["deep-merge-config"]||!1,h(this,B,"f")),h(this,T,"f").configObjects=(h(this,T,"f").configObjects||[]).concat(r)),this}positional(t,n){S("<string> <object>",[t,n],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=yt(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:r.includes(o));let i=h(this,Tn,"f").fullCommands[h(this,Tn,"f").fullCommands.length-1],s=i?h(this,ue,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return sn(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,h(this,z,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return S("[boolean]",[t],arguments.length),j(this,hr,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 S("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&h(this,T,"f").narg[t]?this:(this[fn](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return S("[string] [string]",[t,n],arguments.length),t=t||this.$0,h(this,ln,"f").log(h(this,Qe,"f").generateCompletionScript(t,n||h(this,Ye,"f")||"completion")),this}showHelp(t){if(S("[string|function]",[t],arguments.length),j(this,ze,!0,"f"),!h(this,z,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[Ln](h(this,At,"f"),void 0,void 0,0,!0);if(re(r))return r.then(()=>{h(this,z,"f").showHelp(t)}),this}let n=h(this,ue,"f").runDefaultBuilderOn(this);if(re(n))return n.then(()=>{h(this,z,"f").showHelp(t)}),this}return h(this,z,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return S("[boolean|string] [string]",[t,n],arguments.length),h(this,z,"f").showHelpOnFail(t,n),this}showVersion(t){return S("[string|function]",[t],arguments.length),h(this,z,"f").showVersion(t),this}skipValidation(t){return S("<array|string>",[t],arguments.length),this[xt]("skipValidation",t),this}strict(t){return S("[boolean]",[t],arguments.length),j(this,Yt,t!==!1,"f"),this}strictCommands(t){return S("[boolean]",[t],arguments.length),j(this,zt,t!==!1,"f"),this}strictOptions(t){return S("[boolean]",[t],arguments.length),j(this,Vt,t!==!1,"f"),this}string(t){return S("<array|string>",[t],arguments.length),this[xt]("string",t),this[Jt](t),this}terminalWidth(){return S([],0),h(this,B,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return S("<object>",[t],arguments.length),j(this,Gt,!1,"f"),h(this,B,"f").y18n.updateLocale(t),this}usage(t,n,r,i){if(S("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,r,i],arguments.length),n!==void 0){if(Le(t,null,h(this,B,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,r,i);throw new te(".usage() description must start with $0 if being used as alias for .command()")}else return h(this,z,"f").usage(t),this}version(t,n,r){let i="version";if(S("[boolean|string] [string] [string]",[t,n,r],arguments.length),h(this,it,"f")&&(this[ii](h(this,it,"f")),h(this,z,"f").version(void 0),j(this,it,null,"f")),arguments.length===0)r=this[Ko](),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 j(this,it,typeof t=="string"?t:i,"f"),n=n||h(this,z,"f").deferY18nLookup("Show version number"),h(this,z,"f").version(r||void 0),this.boolean(h(this,it,"f")),this.describe(h(this,it,"f"),n),this}wrap(t){return S("<number|null|undefined>",[t],arguments.length),h(this,z,"f").wrap(t),this}[(ue=new WeakMap,Bt=new WeakMap,Tn=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,lr=new WeakMap,wt=new WeakMap,Gt=new WeakMap,cr=new WeakMap,Je=new WeakMap,fr=new WeakMap,Xe=new WeakMap,rt=new WeakMap,ze=new WeakMap,Ze=new WeakMap,ur=new WeakMap,ln=new WeakMap,Se=new WeakMap,T=new WeakMap,dr=new WeakMap,pr=new WeakMap,Ve=new WeakMap,Ht=new WeakMap,cn=new WeakMap,qt=new WeakMap,At=new WeakMap,hr=new WeakMap,B=new WeakMap,Yt=new WeakMap,zt=new WeakMap,Vt=new WeakMap,z=new WeakMap,it=new WeakMap,se=new WeakMap,Ho)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[qo](){return{log:(...t)=>{this[mr]()||console.log(...t),j(this,ze,!0,"f"),h(this,Se,"f").length&&j(this,Se,h(this,Se,"f")+`
68
- `,"f"),j(this,Se,h(this,Se,"f")+t.join(" "),"f")},error:(...t)=>{this[mr]()||console.error(...t),j(this,ze,!0,"f"),h(this,Se,"f").length&&j(this,Se,h(this,Se,"f")+`
69
- `,"f"),j(this,Se,h(this,Se,"f")+t.join(" "),"f")}}}[ii](t){sn(h(this,T,"f")).forEach(n=>{if((i=>i==="configObjects")(n))return;let r=h(this,T,"f")[n];Array.isArray(r)?r.includes(t)&&r.splice(r.indexOf(t),1):typeof r=="object"&&delete r[t]}),delete h(this,z,"f").getDescriptions()[t]}[Yo](t,n,r){h(this,cr,"f")[r]||(h(this,B,"f").process.emitWarning(t,n),h(this,cr,"f")[r]=!0)}[zo](){h(this,fr,"f").push({options:h(this,T,"f"),configObjects:h(this,T,"f").configObjects.slice(0),exitProcess:h(this,Je,"f"),groups:h(this,rt,"f"),strict:h(this,Yt,"f"),strictCommands:h(this,zt,"f"),strictOptions:h(this,Vt,"f"),completionCommand:h(this,Ye,"f"),output:h(this,Se,"f"),exitError:h(this,wt,"f"),hasOutput:h(this,ze,"f"),parsed:this.parsed,parseFn:h(this,Ve,"f"),parseContext:h(this,Ht,"f")}),h(this,z,"f").freeze(),h(this,se,"f").freeze(),h(this,ue,"f").freeze(),h(this,Xe,"f").freeze()}[Vo](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,B,"f").process.argv()[0])?n=h(this,B,"f").process.argv().slice(1,2):n=h(this,B,"f").process.argv().slice(0,1),t=n.map(r=>{let i=this[ss](h(this,Bt,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<r.length?i:r}).join(" ").trim(),h(this,B,"f").getEnv("_")&&h(this,B,"f").getProcessArgvBin()===h(this,B,"f").getEnv("_")&&(t=h(this,B,"f").getEnv("_").replace(`${h(this,B,"f").path.dirname(h(this,B,"f").process.execPath())}/`,"")),t}[Kt](){return h(this,pr,"f")}[oi](){if(!h(this,Gt,"f"))return;let t=h(this,B,"f").getEnv("LC_ALL")||h(this,B,"f").getEnv("LC_MESSAGES")||h(this,B,"f").getEnv("LANG")||h(this,B,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Ko](){return this[si]().version||"unknown"}[Qo](t){let n=t["--"]?t["--"]:t._;for(let r=0,i;(i=n[r])!==void 0;r++)h(this,B,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(n[r]=Number(i));return t}[si](t){let n=t||"*";if(h(this,cn,"f")[n])return h(this,cn,"f")[n];let r={};try{let i=t||h(this,B,"f").mainFilename;!t&&h(this,B,"f").path.extname(i)&&(i=h(this,B,"f").path.dirname(i));let s=h(this,B,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});Le(s,void 0,h(this,B,"f")),r=JSON.parse(h(this,B,"f").readFileSync(s,"utf8"))}catch(i){}return h(this,cn,"f")[n]=r||{},h(this,cn,"f")[n]}[xt](t,n){n=[].concat(n),n.forEach(r=>{r=this[ci](r),h(this,T,"f")[t].push(r)})}[fn](t,n,r,i){this[li](t,n,r,i,(s,o,a)=>{h(this,T,"f")[s][o]=a})}[ai](t,n,r,i){this[li](t,n,r,i,(s,o,a)=>{h(this,T,"f")[s][o]=(h(this,T,"f")[s][o]||[]).concat(a)})}[li](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 sn(r))t(o,r[o]);else s(n,this[ci](r),i)}[ci](t){return t==="__proto__"?"___proto___":t}[fi](t,n){return this[fn](this[fi].bind(this),"key",t,n),this}[ui](){var t,n,r,i,s,o,a,l,c,f,u,d;let p=h(this,fr,"f").pop();Le(p,void 0,h(this,B,"f"));let y;t=this,n=this,r=this,i=this,s=this,o=this,a=this,l=this,c=this,f=this,u=this,d=this,{options:{set value(g){j(t,T,g,"f")}}.value,configObjects:y,exitProcess:{set value(g){j(n,Je,g,"f")}}.value,groups:{set value(g){j(r,rt,g,"f")}}.value,output:{set value(g){j(i,Se,g,"f")}}.value,exitError:{set value(g){j(s,wt,g,"f")}}.value,hasOutput:{set value(g){j(o,ze,g,"f")}}.value,parsed:this.parsed,strict:{set value(g){j(a,Yt,g,"f")}}.value,strictCommands:{set value(g){j(l,zt,g,"f")}}.value,strictOptions:{set value(g){j(c,Vt,g,"f")}}.value,completionCommand:{set value(g){j(f,Ye,g,"f")}}.value,parseFn:{set value(g){j(u,Ve,g,"f")}}.value,parseContext:{set value(g){j(d,Ht,g,"f")}}.value}=p,h(this,T,"f").configObjects=y,h(this,z,"f").unfreeze(),h(this,se,"f").unfreeze(),h(this,ue,"f").unfreeze(),h(this,Xe,"f").unfreeze()}[Jo](t,n){return Wt(n,r=>(t(r),r))}getInternalMethods(){return{getCommandInstance:this[Xo].bind(this),getContext:this[Zo].bind(this),getHasOutput:this[es].bind(this),getLoggerInstance:this[ts].bind(this),getParseContext:this[ns].bind(this),getParserConfiguration:this[Kt].bind(this),getUsageInstance:this[rs].bind(this),getValidationInstance:this[is].bind(this),hasParseCallback:this[mr].bind(this),isGlobalContext:this[os].bind(this),postProcess:this[Qt].bind(this),reset:this[di].bind(this),runValidation:this[pi].bind(this),runYargsParserAndExecuteCommands:this[Ln].bind(this),setHasOutput:this[as].bind(this)}}[Xo](){return h(this,ue,"f")}[Zo](){return h(this,Tn,"f")}[es](){return h(this,ze,"f")}[ts](){return h(this,ln,"f")}[ns](){return h(this,Ht,"f")||{}}[rs](){return h(this,z,"f")}[is](){return h(this,se,"f")}[mr](){return!!h(this,Ve,"f")}[os](){return h(this,ur,"f")}[Qt](t,n,r,i){return r||re(t)||(n||(t=this[Ho](t)),(this[Kt]()["parse-positional-numbers"]||this[Kt]()["parse-positional-numbers"]===void 0)&&(t=this[Qo](t)),i&&(t=$t(t,this,h(this,Xe,"f").getMiddleware(),!1))),t}[di](t={}){j(this,T,h(this,T,"f")||{},"f");let n={};n.local=h(this,T,"f").local||[],n.configObjects=h(this,T,"f").configObjects||[];let r={};n.local.forEach(o=>{r[o]=!0,(t[o]||[]).forEach(a=>{r[a]=!0})}),Object.assign(h(this,qt,"f"),Object.keys(h(this,rt,"f")).reduce((o,a)=>{let l=h(this,rt,"f")[a].filter(c=>!(c in r));return l.length>0&&(o[a]=l),o},{})),j(this,rt,{},"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]=(h(this,T,"f")[o]||[]).filter(a=>!r[a])}),s.forEach(o=>{n[o]=yt(h(this,T,"f")[o],a=>!r[a])}),n.envPrefix=h(this,T,"f").envPrefix,j(this,T,n,"f"),j(this,z,h(this,z,"f")?h(this,z,"f").reset(r):No(this,h(this,B,"f")),"f"),j(this,se,h(this,se,"f")?h(this,se,"f").reset(r):Bo(this,h(this,z,"f"),h(this,B,"f")),"f"),j(this,ue,h(this,ue,"f")?h(this,ue,"f").reset():To(h(this,z,"f"),h(this,se,"f"),h(this,Xe,"f"),h(this,B,"f")),"f"),h(this,Qe,"f")||j(this,Qe,Uo(this,h(this,z,"f"),h(this,ue,"f"),h(this,B,"f")),"f"),h(this,Xe,"f").reset(),j(this,Ye,null,"f"),j(this,Se,"","f"),j(this,wt,null,"f"),j(this,ze,!1,"f"),this.parsed=!1,this}[ss](t,n){return h(this,B,"f").path.relative(t,n)}[Ln](t,n,r,i=0,s=!1){let o=!!r||s;t=t||h(this,At,"f"),h(this,T,"f").__=h(this,B,"f").y18n.__,h(this,T,"f").configuration=this[Kt]();let a=!!h(this,T,"f").configuration["populate--"],l=Object.assign({},h(this,T,"f").configuration,{"populate--":!0}),c=h(this,B,"f").Parser.detailed(t,Object.assign({},h(this,T,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),f=Object.assign(c.argv,h(this,Ht,"f")),u,d=c.aliases,p=!1,y=!1;Object.keys(f).forEach(g=>{g===h(this,Ze,"f")&&f[g]?p=!0:g===h(this,it,"f")&&f[g]&&(y=!0)}),f.$0=this.$0,this.parsed=c,i===0&&h(this,z,"f").clearCachedHelpMessage();try{if(this[oi](),n)return this[Qt](f,a,!!r,!1);h(this,Ze,"f")&&[h(this,Ze,"f")].concat(d[h(this,Ze,"f")]||[]).filter(N=>N.length>1).includes(""+f._[f._.length-1])&&(f._.pop(),p=!0),j(this,ur,!1,"f");let g=h(this,ue,"f").getCommands(),m=h(this,Qe,"f").completionKey in f,C=p||m||s;if(f._.length){if(g.length){let O;for(let N=i||0,Y;f._[N]!==void 0;N++)if(Y=String(f._[N]),g.includes(Y)&&Y!==h(this,Ye,"f")){let V=h(this,ue,"f").runCommand(Y,this,c,N+1,s,p||y||s);return this[Qt](V,a,!!r,!1)}else if(!O&&Y!==h(this,Ye,"f")){O=Y;break}!h(this,ue,"f").hasDefaultCommand()&&h(this,hr,"f")&&O&&!C&&h(this,se,"f").recommendCommands(O,g)}h(this,Ye,"f")&&f._.includes(h(this,Ye,"f"))&&!m&&(h(this,Je,"f")&&bt(!0),this.showCompletionScript(),this.exit(0))}if(h(this,ue,"f").hasDefaultCommand()&&!C){let O=h(this,ue,"f").runCommand(null,this,c,0,s,p||y||s);return this[Qt](O,a,!!r,!1)}if(m){h(this,Je,"f")&&bt(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${h(this,Qe,"f").completionKey}`)+1);return h(this,Qe,"f").getCompletion(O,(N,Y)=>{if(N)throw new te(N.message);(Y||[]).forEach(V=>{h(this,ln,"f").log(V)}),this.exit(0)}),this[Qt](f,!a,!!r,!1)}if(h(this,ze,"f")||(p?(h(this,Je,"f")&&bt(!0),o=!0,this.showHelp("log"),this.exit(0)):y&&(h(this,Je,"f")&&bt(!0),o=!0,h(this,z,"f").showVersion("log"),this.exit(0))),!o&&h(this,T,"f").skipValidation.length>0&&(o=Object.keys(f).some(O=>h(this,T,"f").skipValidation.indexOf(O)>=0&&f[O]===!0)),!o){if(c.error)throw new te(c.error.message);if(!m){let O=this[pi](d,{},c.error);r||(u=$t(f,this,h(this,Xe,"f").getMiddleware(),!0)),u=this[Jo](O,u!=null?u:f),re(u)&&!r&&(u=u.then(()=>$t(f,this,h(this,Xe,"f").getMiddleware(),!1)))}}}catch(g){if(g instanceof te)h(this,z,"f").fail(g.message,g);else throw g}return this[Qt](u!=null?u:f,a,!!r,!0)}[pi](t,n,r,i){let s={...this.getDemandedOptions()};return o=>{if(r)throw new te(r.message);h(this,se,"f").nonOptionCount(o),h(this,se,"f").requiredArguments(o,s);let a=!1;h(this,zt,"f")&&(a=h(this,se,"f").unknownCommands(o)),h(this,Yt,"f")&&!a?h(this,se,"f").unknownArguments(o,t,n,!!i):h(this,Vt,"f")&&h(this,se,"f").unknownArguments(o,t,{},!1,!1),h(this,se,"f").limitedChoices(o),h(this,se,"f").implications(o),h(this,se,"f").conflicting(o)}}[as](){j(this,ze,!0,"f")}[Jt](t){if(typeof t=="string")h(this,T,"f").key[t]=!0;else for(let n of t)h(this,T,"f").key[n]=!0}};function Lo(e){return!!e&&typeof e.getInternalMethods=="function"}var lf=ls(jo),Ue=lf;import jh from"isomorphic-unfetch";var cf=Object.create,mi=Object.defineProperty,ff=Object.defineProperties,uf=Object.getOwnPropertyDescriptor,df=Object.getOwnPropertyDescriptors,pf=Object.getOwnPropertyNames,cs=Object.getOwnPropertySymbols,hf=Object.getPrototypeOf,ds=Object.prototype.hasOwnProperty,mf=Object.prototype.propertyIsEnumerable,fs=(e,t,n)=>t in e?mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gf=(e,t)=>{for(var n in t||(t={}))ds.call(t,n)&&fs(e,n,t[n]);if(cs)for(var n of cs(t))mf.call(t,n)&&fs(e,n,t[n]);return e},yf=(e,t)=>ff(e,df(t)),us=(e=>typeof ve!="undefined"?ve:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof ve!="undefined"?ve:t)[n]}):e)(function(e){if(typeof ve!="undefined")return ve.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bf=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pf(t))!ds.call(e,i)&&i!==n&&mi(e,i,{get:()=>t[i],enumerable:!(r=uf(t,i))||r.enumerable});return e},gi=(e,t,n)=>(n=e!=null?cf(hf(e)):{},bf(t||!e||!e.__esModule?mi(n,"default",{value:e,enumerable:!0}):n,e)),wf=ot((e,t)=>{"use strict";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]}}),ps=ot((e,t)=>{var n=wf(),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,c=o[2]/255,f=Math.min(a,l,c),u=Math.max(a,l,c),d=u-f,p,y;u===f?p=0:a===u?p=(l-c)/d:l===u?p=2+(c-a)/d:c===u&&(p=4+(a-l)/d),p=Math.min(p*60,360),p<0&&(p+=360);let g=(f+u)/2;return u===f?y=0:g<=.5?y=d/(u+f):y=d/(2-u-f),[p,y*100,g*100]},i.rgb.hsv=function(o){let a,l,c,f,u,d=o[0]/255,p=o[1]/255,y=o[2]/255,g=Math.max(d,p,y),m=g-Math.min(d,p,y),C=function(O){return(g-O)/6/m+1/2};return m===0?(f=0,u=0):(u=m/g,a=C(d),l=C(p),c=C(y),d===g?f=c-l:p===g?f=1/3+a-c:y===g&&(f=2/3+l-a),f<0?f+=1:f>1&&(f-=1)),[f*360,u*100,g*100]},i.rgb.hwb=function(o){let a=o[0],l=o[1],c=o[2],f=i.rgb.hsl(o)[0],u=1/255*Math.min(a,Math.min(l,c));return c=1-1/255*Math.max(a,Math.max(l,c)),[f,u*100,c*100]},i.rgb.cmyk=function(o){let a=o[0]/255,l=o[1]/255,c=o[2]/255,f=Math.min(1-a,1-l,1-c),u=(1-a-f)/(1-f)||0,d=(1-l-f)/(1-f)||0,p=(1-c-f)/(1-f)||0;return[u*100,d*100,p*100,f*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,c;for(let f of Object.keys(n)){let u=n[f],d=s(o,u);d<l&&(l=d,c=f)}return c},i.keyword.rgb=function(o){return n[o]},i.rgb.xyz=function(o){let a=o[0]/255,l=o[1]/255,c=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,c=c>.04045?((c+.055)/1.055)**2.4:c/12.92;let f=a*.4124+l*.3576+c*.1805,u=a*.2126+l*.7152+c*.0722,d=a*.0193+l*.1192+c*.9505;return[f*100,u*100,d*100]},i.rgb.lab=function(o){let a=i.rgb.xyz(o),l=a[0],c=a[1],f=a[2];l/=95.047,c/=100,f/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,c=c>.008856?c**(1/3):7.787*c+16/116,f=f>.008856?f**(1/3):7.787*f+16/116;let u=116*c-16,d=500*(l-c),p=200*(c-f);return[u,d,p]},i.hsl.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100,f,u,d;if(l===0)return d=c*255,[d,d,d];c<.5?f=c*(1+l):f=c+l-c*l;let p=2*c-f,y=[0,0,0];for(let g=0;g<3;g++)u=a+1/3*-(g-1),u<0&&u++,u>1&&u--,6*u<1?d=p+(f-p)*6*u:2*u<1?d=f:3*u<2?d=p+(f-p)*(2/3-u)*6:d=p,y[g]=d*255;return y},i.hsl.hsv=function(o){let a=o[0],l=o[1]/100,c=o[2]/100,f=l,u=Math.max(c,.01);c*=2,l*=c<=1?c:2-c,f*=u<=1?u:2-u;let d=(c+l)/2,p=c===0?2*f/(u+f):2*l/(c+l);return[a,p*100,d*100]},i.hsv.rgb=function(o){let a=o[0]/60,l=o[1]/100,c=o[2]/100,f=Math.floor(a)%6,u=a-Math.floor(a),d=255*c*(1-l),p=255*c*(1-l*u),y=255*c*(1-l*(1-u));switch(c*=255,f){case 0:return[c,y,d];case 1:return[p,c,d];case 2:return[d,c,y];case 3:return[d,p,c];case 4:return[y,d,c];case 5:return[c,d,p]}},i.hsv.hsl=function(o){let a=o[0],l=o[1]/100,c=o[2]/100,f=Math.max(c,.01),u,d;d=(2-l)*c;let p=(2-l)*f;return u=l*f,u/=p<=1?p:2-p,u=u||0,d/=2,[a,u*100,d*100]},i.hwb.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100,f=l+c,u;f>1&&(l/=f,c/=f);let d=Math.floor(6*a),p=1-c;u=6*a-d,(d&1)!==0&&(u=1-u);let y=l+u*(p-l),g,m,C;switch(d){default:case 6:case 0:g=p,m=y,C=l;break;case 1:g=y,m=p,C=l;break;case 2:g=l,m=p,C=y;break;case 3:g=l,m=y,C=p;break;case 4:g=y,m=l,C=p;break;case 5:g=p,m=l,C=y;break}return[g*255,m*255,C*255]},i.cmyk.rgb=function(o){let a=o[0]/100,l=o[1]/100,c=o[2]/100,f=o[3]/100,u=1-Math.min(1,a*(1-f)+f),d=1-Math.min(1,l*(1-f)+f),p=1-Math.min(1,c*(1-f)+f);return[u*255,d*255,p*255]},i.xyz.rgb=function(o){let a=o[0]/100,l=o[1]/100,c=o[2]/100,f,u,d;return f=a*3.2406+l*-1.5372+c*-.4986,u=a*-.9689+l*1.8758+c*.0415,d=a*.0557+l*-.204+c*1.057,f=f>.0031308?1.055*f**(1/2.4)-.055:f*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,d=d>.0031308?1.055*d**(1/2.4)-.055:d*12.92,f=Math.min(Math.max(0,f),1),u=Math.min(Math.max(0,u),1),d=Math.min(Math.max(0,d),1),[f*255,u*255,d*255]},i.xyz.lab=function(o){let a=o[0],l=o[1],c=o[2];a/=95.047,l/=100,c/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;let f=116*l-16,u=500*(a-l),d=200*(l-c);return[f,u,d]},i.lab.xyz=function(o){let a=o[0],l=o[1],c=o[2],f,u,d;u=(a+16)/116,f=l/500+u,d=u-c/200;let p=u**3,y=f**3,g=d**3;return u=p>.008856?p:(u-16/116)/7.787,f=y>.008856?y:(f-16/116)/7.787,d=g>.008856?g:(d-16/116)/7.787,f*=95.047,u*=100,d*=108.883,[f,u,d]},i.lab.lch=function(o){let a=o[0],l=o[1],c=o[2],f;f=Math.atan2(c,l)*360/2/Math.PI,f<0&&(f+=360);let u=Math.sqrt(l*l+c*c);return[a,u,f]},i.lch.lab=function(o){let a=o[0],l=o[1],c=o[2]/360*2*Math.PI,f=l*Math.cos(c),u=l*Math.sin(c);return[a,f,u]},i.rgb.ansi16=function(o,a=null){let[l,c,f]=o,u=a===null?i.rgb.hsv(o)[2]:a;if(u=Math.round(u/50),u===0)return 30;let d=30+(Math.round(f/255)<<2|Math.round(c/255)<<1|Math.round(l/255));return u===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],c=o[2];return a===l&&l===c?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(c/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,c=(a&1)*l*255,f=(a>>1&1)*l*255,u=(a>>2&1)*l*255;return[c,f,u]},i.ansi256.rgb=function(o){if(o>=232){let u=(o-232)*10+8;return[u,u,u]}o-=16;let a,l=Math.floor(o/36)/5*255,c=Math.floor((a=o%36)/6)/5*255,f=a%6/5*255;return[l,c,f]},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(p=>p+p).join(""));let c=parseInt(l,16),f=c>>16&255,u=c>>8&255,d=c&255;return[f,u,d]},i.rgb.hcg=function(o){let a=o[0]/255,l=o[1]/255,c=o[2]/255,f=Math.max(Math.max(a,l),c),u=Math.min(Math.min(a,l),c),d=f-u,p,y;return d<1?p=u/(1-d):p=0,d<=0?y=0:f===a?y=(l-c)/d%6:f===l?y=2+(c-a)/d:y=4+(a-l)/d,y/=6,y%=1,[y*360,d*100,p*100]},i.hsl.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=l<.5?2*a*l:2*a*(1-l),f=0;return c<1&&(f=(l-.5*c)/(1-c)),[o[0],c*100,f*100]},i.hsv.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=a*l,f=0;return c<1&&(f=(l-c)/(1-c)),[o[0],c*100,f*100]},i.hcg.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100;if(l===0)return[c*255,c*255,c*255];let f=[0,0,0],u=a%1*6,d=u%1,p=1-d,y=0;switch(Math.floor(u)){case 0:f[0]=1,f[1]=d,f[2]=0;break;case 1:f[0]=p,f[1]=1,f[2]=0;break;case 2:f[0]=0,f[1]=1,f[2]=d;break;case 3:f[0]=0,f[1]=p,f[2]=1;break;case 4:f[0]=d,f[1]=0,f[2]=1;break;default:f[0]=1,f[1]=0,f[2]=p}return y=(1-l)*c,[(l*f[0]+y)*255,(l*f[1]+y)*255,(l*f[2]+y)*255]},i.hcg.hsv=function(o){let a=o[1]/100,l=o[2]/100,c=a+l*(1-a),f=0;return c>0&&(f=a/c),[o[0],f*100,c*100]},i.hcg.hsl=function(o){let a=o[1]/100,l=o[2]/100*(1-a)+.5*a,c=0;return l>0&&l<.5?c=a/(2*l):l>=.5&&l<1&&(c=a/(2*(1-l))),[o[0],c*100,l*100]},i.hcg.hwb=function(o){let a=o[1]/100,l=o[2]/100,c=a+l*(1-a);return[o[0],(c-a)*100,(1-c)*100]},i.hwb.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=1-l,f=c-a,u=0;return f<1&&(u=(c-f)/(1-f)),[o[0],f*100,u*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]}}),Af=ot((e,t)=>{var n=ps();function r(){let a={},l=Object.keys(n);for(let c=l.length,f=0;f<c;f++)a[l[f]]={distance:-1,parent:null};return a}function i(a){let l=r(),c=[a];for(l[a].distance=0;c.length;){let f=c.pop(),u=Object.keys(n[f]);for(let d=u.length,p=0;p<d;p++){let y=u[p],g=l[y];g.distance===-1&&(g.distance=l[f].distance+1,g.parent=f,c.unshift(y))}}return l}function s(a,l){return function(c){return l(a(c))}}function o(a,l){let c=[l[a].parent,a],f=n[l[a].parent][a],u=l[a].parent;for(;l[u].parent;)c.unshift(l[u].parent),f=s(n[l[u].parent][u],f),u=l[u].parent;return f.conversion=c,f}t.exports=function(a){let l=i(a),c={},f=Object.keys(l);for(let u=f.length,d=0;d<u;d++){let p=f[d];l[p].parent!==null&&(c[p]=o(p,l))}return c}}),xf=ot((e,t)=>{var n=ps(),r=Af(),i={},s=Object.keys(n);function o(l){let c=function(...f){let u=f[0];return u==null?u:(u.length>1&&(f=u),l(f))};return"conversion"in l&&(c.conversion=l.conversion),c}function a(l){let c=function(...f){let u=f[0];if(u==null)return u;u.length>1&&(f=u);let d=l(f);if(typeof d=="object")for(let p=d.length,y=0;y<p;y++)d[y]=Math.round(d[y]);return d};return"conversion"in l&&(c.conversion=l.conversion),c}s.forEach(l=>{i[l]={},Object.defineProperty(i[l],"channels",{value:n[l].channels}),Object.defineProperty(i[l],"labels",{value:n[l].labels});let c=r(l);Object.keys(c).forEach(f=>{let u=c[f];i[l][f]=a(u),i[l][f].raw=o(u)})}),t.exports=i}),Cf=ot((e,t)=>{"use strict";var n=(u,d)=>(...p)=>`\x1B[${u(...p)+d}m`,r=(u,d)=>(...p)=>{let y=u(...p);return`\x1B[${38+d};5;${y}m`},i=(u,d)=>(...p)=>{let y=u(...p);return`\x1B[${38+d};2;${y[0]};${y[1]};${y[2]}m`},s=u=>u,o=(u,d,p)=>[u,d,p],a=(u,d,p)=>{Object.defineProperty(u,d,{get:()=>{let y=p();return Object.defineProperty(u,d,{value:y,enumerable:!0,configurable:!0}),y},enumerable:!0,configurable:!0})},l,c=(u,d,p,y)=>{l===void 0&&(l=xf());let g=y?10:0,m={};for(let[C,O]of Object.entries(l)){let N=C==="ansi16"?"ansi":C;C===d?m[N]=u(p,g):typeof O=="object"&&(m[N]=u(O[d],g))}return m};function f(){let u=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[p,y]of Object.entries(d)){for(let[g,m]of Object.entries(y))d[g]={open:`\x1B[${m[0]}m`,close:`\x1B[${m[1]}m`},y[g]=d[g],u.set(m[0],m[1]);Object.defineProperty(d,p,{value:y,enumerable:!1})}return Object.defineProperty(d,"codes",{value:u,enumerable:!1}),d.color.close="\x1B[39m",d.bgColor.close="\x1B[49m",a(d.color,"ansi",()=>c(n,"ansi16",s,!1)),a(d.color,"ansi256",()=>c(r,"ansi256",s,!1)),a(d.color,"ansi16m",()=>c(i,"rgb",o,!1)),a(d.bgColor,"ansi",()=>c(n,"ansi16",s,!0)),a(d.bgColor,"ansi256",()=>c(r,"ansi256",s,!0)),a(d.bgColor,"ansi16m",()=>c(i,"rgb",o,!0)),d}Object.defineProperty(t,"exports",{enumerable:!0,get:f})}),Of=ot((e,t)=>{"use strict";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)}}),vf=ot((e,t)=>{"use strict";var n=us("os"),r=us("tty"),i=Of(),{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(f){return f===0?!1:{level:f,hasBasic:!0,has256:f>=2,has16m:f>=3}}function l(f,u){if(o===0)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(f&&!u&&o===void 0)return 0;let d=o||0;if(s.TERM==="dumb")return d;if(process.platform==="win32"){let p=n.release().split(".");return Number(p[0])>=10&&Number(p[2])>=10586?Number(p[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(p=>p 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 p=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return p>=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 c(f){let u=l(f,f&&f.isTTY);return a(u)}t.exports={supportsColor:c,stdout:a(l(!0,r.isatty(1))),stderr:a(l(!0,r.isatty(2)))}}),Ef=ot((e,t)=>{"use strict";var n=(i,s,o)=>{let a=i.indexOf(s);if(a===-1)return i;let l=s.length,c=0,f="";do f+=i.substr(c,a-c)+s+o,c=a+l,a=i.indexOf(s,c);while(a!==-1);return f+=i.substr(c),f},r=(i,s,o,a)=>{let l=0,c="";do{let f=i[a-1]==="\r";c+=i.substr(l,(f?a-1:a)-l)+s+(f?`\r
62
+ `;var ri=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 c=s[t[a]].builder;if(or(c)){this.indexAfterLastReset=a+1;let f=this.yargs.getInternalMethods().reset();return c(f,!0),f.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=bt(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)&&!s.hiddenOptions.includes(a)&&!this.argsContainKey(n,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.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(t,n,r,i){if(i===""&&t.length>0&&this.previousArgHasChoices(n))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=s[r._.length-o-1];if(!a)return;let l=this.yargs.getOptions().choices[a]||[];for(let c of l)c.startsWith(i)&&t.push(c.replace(/:/g,"\\:"))}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){let i=s=>t.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(i(n)||r&&i(`no-${n}`))return!0;if(this.aliases){for(let s of this.aliases[n])if(i(s))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(Le(this.customCompletionFunction,null,this.shim),nf(this.customCompletionFunction)){let s=this.customCompletionFunction(r,n);return re(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 rf(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 re(i)?i.then(s):s(i)}generateCompletionScript(t,n){let r=this.zshShell?Uo:Ro,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 ri(e,t,n,r)}function nf(e){return e.length<3}function rf(e){return e.length>3}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(u){let d=e.getDemandedCommands(),b=u._.length+(u["--"]?u["--"].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(u,d){d<u&&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+"",u+""))},s.requiredArguments=function(u,d){let p=null;for(let b of Object.keys(d))(!Object.prototype.hasOwnProperty.call(u,b)||typeof u[b]=="undefined")&&(p=p||{},p[b]=d[b]);if(p){let b=[];for(let m of Object.keys(p)){let C=p[m];C&&b.indexOf(C)<0&&b.push(C)}let g=b.length?`
63
+ ${b.join(`
64
+ `)}`:"";t.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(p).length,Object.keys(p).join(", ")+g))}},s.unknownArguments=function(u,d,p,b,g=!0){var m;let C=e.getInternalMethods().getCommandInstance().getCommands(),O=[],N=e.getInternalMethods().getContext();if(Object.keys(u).forEach(Y=>{!Bo.includes(Y)&&!Object.prototype.hasOwnProperty.call(p,Y)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),Y)&&!s.isValidAndSomeAliasIsNotNew(Y,d)&&O.push(Y)}),g&&(N.commands.length>0||C.length>0||b)&&u._.slice(N.commands.length).forEach(Y=>{C.includes(""+Y)||O.push(""+Y)}),g){let V=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,q=N.commands.length+V;q<u._.length&&u._.slice(q).forEach(k=>{k=String(k),!N.commands.includes(k)&&!O.includes(k)&&O.push(k)})}O.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",O.length,O.map(Y=>Y.trim()?Y:`"${Y}"`).join(", ")))},s.unknownCommands=function(u){let d=e.getInternalMethods().getCommandInstance().getCommands(),p=[],b=e.getInternalMethods().getContext();return(b.commands.length>0||d.length>0)&&u._.slice(b.commands.length).forEach(g=>{d.includes(""+g)||p.push(""+g)}),p.length>0?(t.fail(i("Unknown command: %s","Unknown commands: %s",p.length,p.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(u,d){if(!Object.prototype.hasOwnProperty.call(d,u))return!1;let p=e.parsed.newAliases;return[u,...d[u]].some(b=>!Object.prototype.hasOwnProperty.call(p,b)||!p[u])},s.limitedChoices=function(u){let d=e.getOptions(),p={};if(!Object.keys(d.choices).length)return;Object.keys(u).forEach(m=>{Bo.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(d.choices,m)&&[].concat(u[m]).forEach(C=>{d.choices[m].indexOf(C)===-1&&C!==void 0&&(p[m]=(p[m]||[]).concat(C))})});let b=Object.keys(p);if(!b.length)return;let g=r("Invalid values:");b.forEach(m=>{g+=`
65
+ ${r("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(p[m]),t.stringifiedValues(d.choices[m]))}`}),t.fail(g)};let o={};s.implies=function(u,d){S("<string|object> [array|number|string]",[u,d],arguments.length),typeof u=="object"?Object.keys(u).forEach(p=>{s.implies(p,u[p])}):(e.global(u),o[u]||(o[u]=[]),Array.isArray(d)?d.forEach(p=>s.implies(u,p)):(Le(d,void 0,n),o[u].push(d)))},s.getImplied=function(){return o};function a(f,u){let d=Number(u);return u=isNaN(d)?u:d,typeof u=="number"?u=f._.length>=u:u.match(/^--no-.+/)?(u=u.match(/^--no-(.+)/)[1],u=!Object.prototype.hasOwnProperty.call(f,u)):u=Object.prototype.hasOwnProperty.call(f,u),u}s.implications=function(u){let d=[];if(Object.keys(o).forEach(p=>{let b=p;(o[p]||[]).forEach(g=>{let m=b,C=g;m=a(u,m),g=a(u,g),m&&!g&&d.push(` ${b} -> ${C}`)})}),d.length){let p=`${r("Implications failed:")}
66
+ `;d.forEach(b=>{p+=b}),t.fail(p)}};let l={};s.conflicts=function(u,d){S("<string|object> [array|string]",[u,d],arguments.length),typeof u=="object"?Object.keys(u).forEach(p=>{s.conflicts(p,u[p])}):(e.global(u),l[u]||(l[u]=[]),Array.isArray(d)?d.forEach(p=>s.conflicts(u,p)):l[u].push(d))},s.getConflicting=()=>l,s.conflicting=function(u){Object.keys(u).forEach(d=>{l[d]&&l[d].forEach(p=>{p&&u[d]!==void 0&&u[p]!==void 0&&t.fail(r("Arguments %s and %s are mutually exclusive",d,p))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(d=>{l[d].forEach(p=>{p&&u[n.Parser.camelCase(d)]!==void 0&&u[n.Parser.camelCase(p)]!==void 0&&t.fail(r("Arguments %s and %s are mutually exclusive",d,p))})})},s.recommendCommands=function(u,d){d=d.sort((m,C)=>C.length-m.length);let b=null,g=1/0;for(let m=0,C;(C=d[m])!==void 0;m++){let O=Wo(u,C);O<=3&&O<g&&(g=O,b=C)}b&&t.fail(r("Did you mean %s?",b))},s.reset=function(u){return o=yt(o,d=>!u[d]),l=yt(l,d=>!u[d]),s};let c=[];return s.freeze=function(){c.push({implied:o,conflicting:l})},s.unfreeze=function(){let u=c.pop();Le(u,void 0,n),{implied:o,conflicting:l}=u},s}var ii=[],Tn;function ar(e,t,n,r){Tn=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=sf(t,e.extends);else try{o=ve.resolve(e.extends)}catch(a){return e}of(o),ii.push(o),i=s?JSON.parse(Tn.readFileSync(o,"utf8")):ve(e.extends),delete e.extends,i=ar(i,Tn.path.dirname(o),n,Tn)}return ii=[],n?Go(i,e):Object.assign({},i,e)}function of(e){if(ii.indexOf(e)>-1)throw new te(`Circular extended configurations: '${e}'.`)}function sf(e,t){return Tn.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 P=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},h=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)},ue,Bt,Ln,Qe,Ye,lr,At,Ht,cr,Je,fr,Xe,rt,ze,Ze,ur,cn,Se,D,dr,pr,Ve,Gt,fn,qt,xt,hr,B,Yt,zt,Vt,z,it,se;function cs(e){return(t=[],n=e.process.cwd(),r)=>{let i=new mi(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"),Kt=Symbol("getParserConfiguration"),si=Symbol("guessLocale"),Qo=Symbol("guessVersion"),Jo=Symbol("parsePositionalNumbers"),ai=Symbol("pkgUp"),Ct=Symbol("populateParserHintArray"),un=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"),mr=Symbol("hasParseCallback"),ss=Symbol("isGlobalContext"),Qt=Symbol("postProcess"),as=Symbol("rebase"),pi=Symbol("reset"),Dn=Symbol("runYargsParserAndExecuteCommands"),hi=Symbol("runValidation"),ls=Symbol("setHasOutput"),Jt=Symbol("kTrackManuallySetKeys"),mi=class{constructor(t=[],n,r,i){this.customScriptName=!1,this.parsed=!1,ue.set(this,void 0),Bt.set(this,void 0),Ln.set(this,{commands:[],fullCommands:[]}),Qe.set(this,null),Ye.set(this,null),lr.set(this,"show-hidden"),At.set(this,null),Ht.set(this,!0),cr.set(this,{}),Je.set(this,!0),fr.set(this,[]),Xe.set(this,void 0),rt.set(this,{}),ze.set(this,!1),Ze.set(this,null),ur.set(this,!0),cn.set(this,void 0),Se.set(this,""),D.set(this,void 0),dr.set(this,void 0),pr.set(this,{}),Ve.set(this,null),Gt.set(this,null),fn.set(this,{}),qt.set(this,{}),xt.set(this,void 0),hr.set(this,!1),B.set(this,void 0),Yt.set(this,!1),zt.set(this,!1),Vt.set(this,!1),z.set(this,void 0),it.set(this,null),se.set(this,void 0),P(this,B,i,"f"),P(this,xt,t,"f"),P(this,Bt,n,"f"),P(this,dr,r,"f"),P(this,Xe,new ir(this),"f"),this.$0=this[Ko](),this[pi](),P(this,ue,h(this,ue,"f"),"f"),P(this,z,h(this,z,"f"),"f"),P(this,se,h(this,se,"f"),"f"),P(this,D,h(this,D,"f"),"f"),h(this,D,"f").showHiddenOpt=h(this,lr,"f"),P(this,cn,this[Yo](),"f")}addHelpOpt(t,n){let r="help";return S("[string|boolean] [string]",[t,n],arguments.length),h(this,Ze,"f")&&(this[oi](h(this,Ze,"f")),P(this,Ze,null,"f")),t===!1&&n===void 0?this:(P(this,Ze,typeof t=="string"?t:r,"f"),this.boolean(h(this,Ze,"f")),this.describe(h(this,Ze,"f"),n||h(this,z,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(S("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let r=typeof t=="string"?t:h(this,lr,"f");return this.boolean(r),this.describe(r,n||h(this,z,"f").deferY18nLookup("Show hidden options")),h(this,D,"f").showHiddenOpt=r,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return S("<object|string|array> [string|array]",[t,n],arguments.length),this[li](this.alias.bind(this),"alias",t,n),this}array(t){return S("<array|string>",[t],arguments.length),this[Ct]("array",t),this[Jt](t),this}boolean(t){return S("<array|string>",[t],arguments.length),this[Ct]("boolean",t),this[Jt](t),this}check(t,n){return S("<function> [boolean]",[t,n],arguments.length),this.middleware((r,i)=>Wt(()=>t(r,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&h(this,z,"f").fail(s.toString(),s):h(this,z,"f").fail(h(this,B,"f").y18n.__("Argument check failed: %s",t.toString())),r),s=>(h(this,z,"f").fail(s.message?s.message:s.toString(),s),r)),!1,n),this}choices(t,n){return S("<object|string|array> [string|array]",[t,n],arguments.length),this[li](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(S("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new te("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 te("coerce callback must be provided");return h(this,D,"f").key[t]=!0,h(this,Xe,"f").addCoerceMiddleware((r,i)=>{let s;return Object.prototype.hasOwnProperty.call(r,t)?Wt(()=>(s=i.getAliases(),n(r[t])),a=>{r[t]=a;let l=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(s[t]&&l!==!0)for(let c of s[t])r[c]=a;return r},a=>{throw new te(a.message)}):r},t),this}conflicts(t,n){return S("<string|object> [string|array]",[t,n],arguments.length),h(this,se,"f").conflicts(t,n),this}config(t="config",n,r){return S("[object|string] [string|function] [function]",[t,n,r],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=ar(t,h(this,Bt,"f"),this[Kt]()["deep-merge-config"]||!1,h(this,B,"f")),h(this,D,"f").configObjects=(h(this,D,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(r=n,n=void 0),this.describe(t,n||h(this,z,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{h(this,D,"f").config[i]=r||!0}),this)}completion(t,n,r){return S("[string] [string|boolean|function] [function]",[t,n,r],arguments.length),typeof n=="function"&&(r=n,n=void 0),P(this,Ye,t||h(this,Ye,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(h(this,Ye,"f"),n),r&&h(this,Qe,"f").registerFunction(r),this}command(t,n,r,i,s,o){return S("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,r,i,s,o],arguments.length),h(this,ue,"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){S("<string> [object]",[t,n],arguments.length);let r=h(this,dr,"f")||h(this,B,"f").require;return h(this,ue,"f").addDirectory(t,r,h(this,B,"f").getCallerFile(),n),this}count(t){return S("<array|string>",[t],arguments.length),this[Ct]("count",t),this[Jt](t),this}default(t,n,r){return S("<object|string|array> [*] [string]",[t,n,r],arguments.length),r&&(Zr(t,h(this,B,"f")),h(this,D,"f").defaultDescription[t]=r),typeof n=="function"&&(Zr(t,h(this,B,"f")),h(this,D,"f").defaultDescription[t]||(h(this,D,"f").defaultDescription[t]=h(this,z,"f").functionDescription(n)),n=n.call()),this[un](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 S("[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),h(this,D,"f").demandedCommands._={min:t,max:n,minMsg:r,maxMsg:i},this}demand(t,n,r){return Array.isArray(n)?(n.forEach(i=>{Le(r,!0,h(this,B,"f")),this.demandOption(i,r)}),n=1/0):typeof n!="number"&&(r=n,n=1/0),typeof t=="number"?(Le(r,!0,h(this,B,"f")),this.demandCommand(t,n,r,r)):Array.isArray(t)?t.forEach(i=>{Le(r,!0,h(this,B,"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 S("<object|string|array> [string]",[t,n],arguments.length),this[un](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return S("<string> [string|boolean]",[t,n],arguments.length),h(this,D,"f").deprecatedOptions[t]=n,this}describe(t,n){return S("<object|string|array> [string]",[t,n],arguments.length),this[ui](t,!0),h(this,z,"f").describe(t,n),this}detectLocale(t){return S("<boolean>",[t],arguments.length),P(this,Ht,t,"f"),this}env(t){return S("[string|boolean]",[t],arguments.length),t===!1?delete h(this,D,"f").envPrefix:h(this,D,"f").envPrefix=t||"",this}epilogue(t){return S("<string>",[t],arguments.length),h(this,z,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return S("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(r=>this.example(...r)):h(this,z,"f").example(t,n),this}exit(t,n){P(this,ze,!0,"f"),P(this,At,n,"f"),h(this,Je,"f")&&h(this,B,"f").process.exit(t)}exitProcess(t=!0){return S("[boolean]",[t],arguments.length),P(this,Je,t,"f"),this}fail(t){if(S("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new te("Invalid first argument. Expected function or boolean 'false'");return h(this,z,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return S("<array> [function]",[t,n],arguments.length),n?h(this,Qe,"f").getCompletion(t,n):new Promise((r,i)=>{h(this,Qe,"f").getCompletion(t,(s,o)=>{s?i(s):r(o)})})}getDemandedOptions(){return S([],0),h(this,D,"f").demandedOptions}getDemandedCommands(){return S([],0),h(this,D,"f").demandedCommands}getDeprecatedOptions(){return S([],0),h(this,D,"f").deprecatedOptions}getDetectLocale(){return h(this,Ht,"f")}getExitProcess(){return h(this,Je,"f")}getGroups(){return Object.assign({},h(this,rt,"f"),h(this,qt,"f"))}getHelp(){if(P(this,ze,!0,"f"),!h(this,z,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[Dn](h(this,xt,"f"),void 0,void 0,0,!0);if(re(n))return n.then(()=>h(this,z,"f").help())}let t=h(this,ue,"f").runDefaultBuilderOn(this);if(re(t))return t.then(()=>h(this,z,"f").help())}return Promise.resolve(h(this,z,"f").help())}getOptions(){return h(this,D,"f")}getStrict(){return h(this,Yt,"f")}getStrictCommands(){return h(this,zt,"f")}getStrictOptions(){return h(this,Vt,"f")}global(t,n){return S("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?h(this,D,"f").local=h(this,D,"f").local.filter(r=>t.indexOf(r)===-1):t.forEach(r=>{h(this,D,"f").local.includes(r)||h(this,D,"f").local.push(r)}),this}group(t,n){S("<string|array> <string>",[t,n],arguments.length);let r=h(this,qt,"f")[n]||h(this,rt,"f")[n];h(this,qt,"f")[n]&&delete h(this,qt,"f")[n];let i={};return h(this,rt,"f")[n]=(r||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return S("<string>",[t],arguments.length),h(this,D,"f").hiddenOptions.push(t),this}implies(t,n){return S("<string|object> [number|string|array]",[t,n],arguments.length),h(this,se,"f").implies(t,n),this}locale(t){return S("[string]",[t],arguments.length),t===void 0?(this[si](),h(this,B,"f").y18n.getLocale()):(P(this,Ht,!1,"f"),h(this,B,"f").y18n.setLocale(t),this)}middleware(t,n,r){return h(this,Xe,"f").addMiddleware(t,!!n,r)}nargs(t,n){return S("<string|object|array> [number]",[t,n],arguments.length),this[un](this.nargs.bind(this),"narg",t,n),this}normalize(t){return S("<array|string>",[t],arguments.length),this[Ct]("normalize",t),this}number(t){return S("<array|string>",[t],arguments.length),this[Ct]("number",t),this[Jt](t),this}option(t,n){if(S("<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[Jt](t),h(this,it,"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"),h(this,D,"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&&(h(this,D,"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){S("[string|array] [function|boolean|object] [function]",[t,n,r],arguments.length),this[Vo](),typeof t=="undefined"&&(t=h(this,xt,"f")),typeof n=="object"&&(P(this,Gt,n,"f"),n=r),typeof n=="function"&&(P(this,Ve,n,"f"),n=!1),n||P(this,xt,t,"f"),h(this,Ve,"f")&&P(this,Je,!1,"f");let i=this[Dn](t,!!n),s=this.parsed;return h(this,Qe,"f").setParsed(this.parsed),re(i)?i.then(o=>(h(this,Ve,"f")&&h(this,Ve,"f").call(this,h(this,At,"f"),o,h(this,Se,"f")),o)).catch(o=>{throw h(this,Ve,"f")&&h(this,Ve,"f")(o,this.parsed.argv,h(this,Se,"f")),o}).finally(()=>{this[di](),this.parsed=s}):(h(this,Ve,"f")&&h(this,Ve,"f").call(this,h(this,At,"f"),i,h(this,Se,"f")),this[di](),this.parsed=s,i)}parseAsync(t,n,r){let i=this.parse(t,n,r);return re(i)?i:Promise.resolve(i)}parseSync(t,n,r){let i=this.parse(t,n,r);if(re(i))throw new te(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return S("<object>",[t],arguments.length),P(this,pr,t,"f"),this}pkgConf(t,n){S("<string> [string]",[t,n],arguments.length);let r=null,i=this[ai](n||h(this,Bt,"f"));return i[t]&&typeof i[t]=="object"&&(r=ar(i[t],n||h(this,Bt,"f"),this[Kt]()["deep-merge-config"]||!1,h(this,B,"f")),h(this,D,"f").configObjects=(h(this,D,"f").configObjects||[]).concat(r)),this}positional(t,n){S("<string> <object>",[t,n],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=yt(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:r.includes(o));let i=h(this,Ln,"f").fullCommands[h(this,Ln,"f").fullCommands.length-1],s=i?h(this,ue,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return an(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,h(this,z,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return S("[boolean]",[t],arguments.length),P(this,hr,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 S("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&h(this,D,"f").narg[t]?this:(this[un](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return S("[string] [string]",[t,n],arguments.length),t=t||this.$0,h(this,cn,"f").log(h(this,Qe,"f").generateCompletionScript(t,n||h(this,Ye,"f")||"completion")),this}showHelp(t){if(S("[string|function]",[t],arguments.length),P(this,ze,!0,"f"),!h(this,z,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[Dn](h(this,xt,"f"),void 0,void 0,0,!0);if(re(r))return r.then(()=>{h(this,z,"f").showHelp(t)}),this}let n=h(this,ue,"f").runDefaultBuilderOn(this);if(re(n))return n.then(()=>{h(this,z,"f").showHelp(t)}),this}return h(this,z,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return S("[boolean|string] [string]",[t,n],arguments.length),h(this,z,"f").showHelpOnFail(t,n),this}showVersion(t){return S("[string|function]",[t],arguments.length),h(this,z,"f").showVersion(t),this}skipValidation(t){return S("<array|string>",[t],arguments.length),this[Ct]("skipValidation",t),this}strict(t){return S("[boolean]",[t],arguments.length),P(this,Yt,t!==!1,"f"),this}strictCommands(t){return S("[boolean]",[t],arguments.length),P(this,zt,t!==!1,"f"),this}strictOptions(t){return S("[boolean]",[t],arguments.length),P(this,Vt,t!==!1,"f"),this}string(t){return S("<array|string>",[t],arguments.length),this[Ct]("string",t),this[Jt](t),this}terminalWidth(){return S([],0),h(this,B,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return S("<object>",[t],arguments.length),P(this,Ht,!1,"f"),h(this,B,"f").y18n.updateLocale(t),this}usage(t,n,r,i){if(S("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,r,i],arguments.length),n!==void 0){if(Le(t,null,h(this,B,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,r,i);throw new te(".usage() description must start with $0 if being used as alias for .command()")}else return h(this,z,"f").usage(t),this}version(t,n,r){let i="version";if(S("[boolean|string] [string] [string]",[t,n,r],arguments.length),h(this,it,"f")&&(this[oi](h(this,it,"f")),h(this,z,"f").version(void 0),P(this,it,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 P(this,it,typeof t=="string"?t:i,"f"),n=n||h(this,z,"f").deferY18nLookup("Show version number"),h(this,z,"f").version(r||void 0),this.boolean(h(this,it,"f")),this.describe(h(this,it,"f"),n),this}wrap(t){return S("<number|null|undefined>",[t],arguments.length),h(this,z,"f").wrap(t),this}[(ue=new WeakMap,Bt=new WeakMap,Ln=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,lr=new WeakMap,At=new WeakMap,Ht=new WeakMap,cr=new WeakMap,Je=new WeakMap,fr=new WeakMap,Xe=new WeakMap,rt=new WeakMap,ze=new WeakMap,Ze=new WeakMap,ur=new WeakMap,cn=new WeakMap,Se=new WeakMap,D=new WeakMap,dr=new WeakMap,pr=new WeakMap,Ve=new WeakMap,Gt=new WeakMap,fn=new WeakMap,qt=new WeakMap,xt=new WeakMap,hr=new WeakMap,B=new WeakMap,Yt=new WeakMap,zt=new WeakMap,Vt=new WeakMap,z=new WeakMap,it=new WeakMap,se=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[mr]()||console.log(...t),P(this,ze,!0,"f"),h(this,Se,"f").length&&P(this,Se,h(this,Se,"f")+`
68
+ `,"f"),P(this,Se,h(this,Se,"f")+t.join(" "),"f")},error:(...t)=>{this[mr]()||console.error(...t),P(this,ze,!0,"f"),h(this,Se,"f").length&&P(this,Se,h(this,Se,"f")+`
69
+ `,"f"),P(this,Se,h(this,Se,"f")+t.join(" "),"f")}}}[oi](t){an(h(this,D,"f")).forEach(n=>{if((i=>i==="configObjects")(n))return;let r=h(this,D,"f")[n];Array.isArray(r)?r.includes(t)&&r.splice(r.indexOf(t),1):typeof r=="object"&&delete r[t]}),delete h(this,z,"f").getDescriptions()[t]}[zo](t,n,r){h(this,cr,"f")[r]||(h(this,B,"f").process.emitWarning(t,n),h(this,cr,"f")[r]=!0)}[Vo](){h(this,fr,"f").push({options:h(this,D,"f"),configObjects:h(this,D,"f").configObjects.slice(0),exitProcess:h(this,Je,"f"),groups:h(this,rt,"f"),strict:h(this,Yt,"f"),strictCommands:h(this,zt,"f"),strictOptions:h(this,Vt,"f"),completionCommand:h(this,Ye,"f"),output:h(this,Se,"f"),exitError:h(this,At,"f"),hasOutput:h(this,ze,"f"),parsed:this.parsed,parseFn:h(this,Ve,"f"),parseContext:h(this,Gt,"f")}),h(this,z,"f").freeze(),h(this,se,"f").freeze(),h(this,ue,"f").freeze(),h(this,Xe,"f").freeze()}[Ko](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,B,"f").process.argv()[0])?n=h(this,B,"f").process.argv().slice(1,2):n=h(this,B,"f").process.argv().slice(0,1),t=n.map(r=>{let i=this[as](h(this,Bt,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<r.length?i:r}).join(" ").trim(),h(this,B,"f").getEnv("_")&&h(this,B,"f").getProcessArgvBin()===h(this,B,"f").getEnv("_")&&(t=h(this,B,"f").getEnv("_").replace(`${h(this,B,"f").path.dirname(h(this,B,"f").process.execPath())}/`,"")),t}[Kt](){return h(this,pr,"f")}[si](){if(!h(this,Ht,"f"))return;let t=h(this,B,"f").getEnv("LC_ALL")||h(this,B,"f").getEnv("LC_MESSAGES")||h(this,B,"f").getEnv("LANG")||h(this,B,"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++)h(this,B,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(n[r]=Number(i));return t}[ai](t){let n=t||"*";if(h(this,fn,"f")[n])return h(this,fn,"f")[n];let r={};try{let i=t||h(this,B,"f").mainFilename;!t&&h(this,B,"f").path.extname(i)&&(i=h(this,B,"f").path.dirname(i));let s=h(this,B,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});Le(s,void 0,h(this,B,"f")),r=JSON.parse(h(this,B,"f").readFileSync(s,"utf8"))}catch(i){}return h(this,fn,"f")[n]=r||{},h(this,fn,"f")[n]}[Ct](t,n){n=[].concat(n),n.forEach(r=>{r=this[fi](r),h(this,D,"f")[t].push(r)})}[un](t,n,r,i){this[ci](t,n,r,i,(s,o,a)=>{h(this,D,"f")[s][o]=a})}[li](t,n,r,i){this[ci](t,n,r,i,(s,o,a)=>{h(this,D,"f")[s][o]=(h(this,D,"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 an(r))t(o,r[o]);else s(n,this[fi](r),i)}[fi](t){return t==="__proto__"?"___proto___":t}[ui](t,n){return this[un](this[ui].bind(this),"key",t,n),this}[di](){var t,n,r,i,s,o,a,l,c,f,u,d;let p=h(this,fr,"f").pop();Le(p,void 0,h(this,B,"f"));let b;t=this,n=this,r=this,i=this,s=this,o=this,a=this,l=this,c=this,f=this,u=this,d=this,{options:{set value(g){P(t,D,g,"f")}}.value,configObjects:b,exitProcess:{set value(g){P(n,Je,g,"f")}}.value,groups:{set value(g){P(r,rt,g,"f")}}.value,output:{set value(g){P(i,Se,g,"f")}}.value,exitError:{set value(g){P(s,At,g,"f")}}.value,hasOutput:{set value(g){P(o,ze,g,"f")}}.value,parsed:this.parsed,strict:{set value(g){P(a,Yt,g,"f")}}.value,strictCommands:{set value(g){P(l,zt,g,"f")}}.value,strictOptions:{set value(g){P(c,Vt,g,"f")}}.value,completionCommand:{set value(g){P(f,Ye,g,"f")}}.value,parseFn:{set value(g){P(u,Ve,g,"f")}}.value,parseContext:{set value(g){P(d,Gt,g,"f")}}.value}=p,h(this,D,"f").configObjects=b,h(this,z,"f").unfreeze(),h(this,se,"f").unfreeze(),h(this,ue,"f").unfreeze(),h(this,Xe,"f").unfreeze()}[Xo](t,n){return Wt(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[Kt].bind(this),getUsageInstance:this[is].bind(this),getValidationInstance:this[os].bind(this),hasParseCallback:this[mr].bind(this),isGlobalContext:this[ss].bind(this),postProcess:this[Qt].bind(this),reset:this[pi].bind(this),runValidation:this[hi].bind(this),runYargsParserAndExecuteCommands:this[Dn].bind(this),setHasOutput:this[ls].bind(this)}}[Zo](){return h(this,ue,"f")}[es](){return h(this,Ln,"f")}[ts](){return h(this,ze,"f")}[ns](){return h(this,cn,"f")}[rs](){return h(this,Gt,"f")||{}}[is](){return h(this,z,"f")}[os](){return h(this,se,"f")}[mr](){return!!h(this,Ve,"f")}[ss](){return h(this,ur,"f")}[Qt](t,n,r,i){return r||re(t)||(n||(t=this[qo](t)),(this[Kt]()["parse-positional-numbers"]||this[Kt]()["parse-positional-numbers"]===void 0)&&(t=this[Jo](t)),i&&(t=$t(t,this,h(this,Xe,"f").getMiddleware(),!1))),t}[pi](t={}){P(this,D,h(this,D,"f")||{},"f");let n={};n.local=h(this,D,"f").local||[],n.configObjects=h(this,D,"f").configObjects||[];let r={};n.local.forEach(o=>{r[o]=!0,(t[o]||[]).forEach(a=>{r[a]=!0})}),Object.assign(h(this,qt,"f"),Object.keys(h(this,rt,"f")).reduce((o,a)=>{let l=h(this,rt,"f")[a].filter(c=>!(c in r));return l.length>0&&(o[a]=l),o},{})),P(this,rt,{},"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]=(h(this,D,"f")[o]||[]).filter(a=>!r[a])}),s.forEach(o=>{n[o]=yt(h(this,D,"f")[o],a=>!r[a])}),n.envPrefix=h(this,D,"f").envPrefix,P(this,D,n,"f"),P(this,z,h(this,z,"f")?h(this,z,"f").reset(r):ko(this,h(this,B,"f")),"f"),P(this,se,h(this,se,"f")?h(this,se,"f").reset(r):Ho(this,h(this,z,"f"),h(this,B,"f")),"f"),P(this,ue,h(this,ue,"f")?h(this,ue,"f").reset():Lo(h(this,z,"f"),h(this,se,"f"),h(this,Xe,"f"),h(this,B,"f")),"f"),h(this,Qe,"f")||P(this,Qe,$o(this,h(this,z,"f"),h(this,ue,"f"),h(this,B,"f")),"f"),h(this,Xe,"f").reset(),P(this,Ye,null,"f"),P(this,Se,"","f"),P(this,At,null,"f"),P(this,ze,!1,"f"),this.parsed=!1,this}[as](t,n){return h(this,B,"f").path.relative(t,n)}[Dn](t,n,r,i=0,s=!1){let o=!!r||s;t=t||h(this,xt,"f"),h(this,D,"f").__=h(this,B,"f").y18n.__,h(this,D,"f").configuration=this[Kt]();let a=!!h(this,D,"f").configuration["populate--"],l=Object.assign({},h(this,D,"f").configuration,{"populate--":!0}),c=h(this,B,"f").Parser.detailed(t,Object.assign({},h(this,D,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),f=Object.assign(c.argv,h(this,Gt,"f")),u,d=c.aliases,p=!1,b=!1;Object.keys(f).forEach(g=>{g===h(this,Ze,"f")&&f[g]?p=!0:g===h(this,it,"f")&&f[g]&&(b=!0)}),f.$0=this.$0,this.parsed=c,i===0&&h(this,z,"f").clearCachedHelpMessage();try{if(this[si](),n)return this[Qt](f,a,!!r,!1);h(this,Ze,"f")&&[h(this,Ze,"f")].concat(d[h(this,Ze,"f")]||[]).filter(N=>N.length>1).includes(""+f._[f._.length-1])&&(f._.pop(),p=!0),P(this,ur,!1,"f");let g=h(this,ue,"f").getCommands(),m=h(this,Qe,"f").completionKey in f,C=p||m||s;if(f._.length){if(g.length){let O;for(let N=i||0,Y;f._[N]!==void 0;N++)if(Y=String(f._[N]),g.includes(Y)&&Y!==h(this,Ye,"f")){let V=h(this,ue,"f").runCommand(Y,this,c,N+1,s,p||b||s);return this[Qt](V,a,!!r,!1)}else if(!O&&Y!==h(this,Ye,"f")){O=Y;break}!h(this,ue,"f").hasDefaultCommand()&&h(this,hr,"f")&&O&&!C&&h(this,se,"f").recommendCommands(O,g)}h(this,Ye,"f")&&f._.includes(h(this,Ye,"f"))&&!m&&(h(this,Je,"f")&&wt(!0),this.showCompletionScript(),this.exit(0))}if(h(this,ue,"f").hasDefaultCommand()&&!C){let O=h(this,ue,"f").runCommand(null,this,c,0,s,p||b||s);return this[Qt](O,a,!!r,!1)}if(m){h(this,Je,"f")&&wt(!0),t=[].concat(t);let O=t.slice(t.indexOf(`--${h(this,Qe,"f").completionKey}`)+1);return h(this,Qe,"f").getCompletion(O,(N,Y)=>{if(N)throw new te(N.message);(Y||[]).forEach(V=>{h(this,cn,"f").log(V)}),this.exit(0)}),this[Qt](f,!a,!!r,!1)}if(h(this,ze,"f")||(p?(h(this,Je,"f")&&wt(!0),o=!0,this.showHelp("log"),this.exit(0)):b&&(h(this,Je,"f")&&wt(!0),o=!0,h(this,z,"f").showVersion("log"),this.exit(0))),!o&&h(this,D,"f").skipValidation.length>0&&(o=Object.keys(f).some(O=>h(this,D,"f").skipValidation.indexOf(O)>=0&&f[O]===!0)),!o){if(c.error)throw new te(c.error.message);if(!m){let O=this[hi](d,{},c.error);r||(u=$t(f,this,h(this,Xe,"f").getMiddleware(),!0)),u=this[Xo](O,u!=null?u:f),re(u)&&!r&&(u=u.then(()=>$t(f,this,h(this,Xe,"f").getMiddleware(),!1)))}}}catch(g){if(g instanceof te)h(this,z,"f").fail(g.message,g);else throw g}return this[Qt](u!=null?u:f,a,!!r,!0)}[hi](t,n,r,i){let s={...this.getDemandedOptions()};return o=>{if(r)throw new te(r.message);h(this,se,"f").nonOptionCount(o),h(this,se,"f").requiredArguments(o,s);let a=!1;h(this,zt,"f")&&(a=h(this,se,"f").unknownCommands(o)),h(this,Yt,"f")&&!a?h(this,se,"f").unknownArguments(o,t,n,!!i):h(this,Vt,"f")&&h(this,se,"f").unknownArguments(o,t,{},!1,!1),h(this,se,"f").limitedChoices(o),h(this,se,"f").implications(o),h(this,se,"f").conflicting(o)}}[ls](){P(this,ze,!0,"f")}[Jt](t){if(typeof t=="string")h(this,D,"f").key[t]=!0;else for(let n of t)h(this,D,"f").key[n]=!0}};function Do(e){return!!e&&typeof e.getInternalMethods=="function"}var af=cs(jo),Ue=af;import Oh from"isomorphic-unfetch";var lf=Object.create,us=Object.defineProperty,cf=Object.getOwnPropertyDescriptor,ff=Object.getOwnPropertyNames,uf=Object.getPrototypeOf,df=Object.prototype.hasOwnProperty,fs=(e=>typeof ve!="undefined"?ve:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof ve!="undefined"?ve:t)[n]}):e)(function(e){if(typeof ve!="undefined")return ve.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),pf=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ff(t))!df.call(e,i)&&i!==n&&us(e,i,{get:()=>t[i],enumerable:!(r=cf(t,i))||r.enumerable});return e},gi=(e,t,n)=>(n=e!=null?lf(uf(e)):{},pf(t||!e||!e.__esModule?us(n,"default",{value:e,enumerable:!0}):n,e)),hf=ot((e,t)=>{"use strict";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]}}),ds=ot((e,t)=>{var n=hf(),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,c=o[2]/255,f=Math.min(a,l,c),u=Math.max(a,l,c),d=u-f,p,b;u===f?p=0:a===u?p=(l-c)/d:l===u?p=2+(c-a)/d:c===u&&(p=4+(a-l)/d),p=Math.min(p*60,360),p<0&&(p+=360);let g=(f+u)/2;return u===f?b=0:g<=.5?b=d/(u+f):b=d/(2-u-f),[p,b*100,g*100]},i.rgb.hsv=function(o){let a,l,c,f,u,d=o[0]/255,p=o[1]/255,b=o[2]/255,g=Math.max(d,p,b),m=g-Math.min(d,p,b),C=function(O){return(g-O)/6/m+1/2};return m===0?(f=0,u=0):(u=m/g,a=C(d),l=C(p),c=C(b),d===g?f=c-l:p===g?f=1/3+a-c:b===g&&(f=2/3+l-a),f<0?f+=1:f>1&&(f-=1)),[f*360,u*100,g*100]},i.rgb.hwb=function(o){let a=o[0],l=o[1],c=o[2],f=i.rgb.hsl(o)[0],u=1/255*Math.min(a,Math.min(l,c));return c=1-1/255*Math.max(a,Math.max(l,c)),[f,u*100,c*100]},i.rgb.cmyk=function(o){let a=o[0]/255,l=o[1]/255,c=o[2]/255,f=Math.min(1-a,1-l,1-c),u=(1-a-f)/(1-f)||0,d=(1-l-f)/(1-f)||0,p=(1-c-f)/(1-f)||0;return[u*100,d*100,p*100,f*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,c;for(let f of Object.keys(n)){let u=n[f],d=s(o,u);d<l&&(l=d,c=f)}return c},i.keyword.rgb=function(o){return n[o]},i.rgb.xyz=function(o){let a=o[0]/255,l=o[1]/255,c=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,c=c>.04045?((c+.055)/1.055)**2.4:c/12.92;let f=a*.4124+l*.3576+c*.1805,u=a*.2126+l*.7152+c*.0722,d=a*.0193+l*.1192+c*.9505;return[f*100,u*100,d*100]},i.rgb.lab=function(o){let a=i.rgb.xyz(o),l=a[0],c=a[1],f=a[2];l/=95.047,c/=100,f/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,c=c>.008856?c**(1/3):7.787*c+16/116,f=f>.008856?f**(1/3):7.787*f+16/116;let u=116*c-16,d=500*(l-c),p=200*(c-f);return[u,d,p]},i.hsl.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100,f,u,d;if(l===0)return d=c*255,[d,d,d];c<.5?f=c*(1+l):f=c+l-c*l;let p=2*c-f,b=[0,0,0];for(let g=0;g<3;g++)u=a+1/3*-(g-1),u<0&&u++,u>1&&u--,6*u<1?d=p+(f-p)*6*u:2*u<1?d=f:3*u<2?d=p+(f-p)*(2/3-u)*6:d=p,b[g]=d*255;return b},i.hsl.hsv=function(o){let a=o[0],l=o[1]/100,c=o[2]/100,f=l,u=Math.max(c,.01);c*=2,l*=c<=1?c:2-c,f*=u<=1?u:2-u;let d=(c+l)/2,p=c===0?2*f/(u+f):2*l/(c+l);return[a,p*100,d*100]},i.hsv.rgb=function(o){let a=o[0]/60,l=o[1]/100,c=o[2]/100,f=Math.floor(a)%6,u=a-Math.floor(a),d=255*c*(1-l),p=255*c*(1-l*u),b=255*c*(1-l*(1-u));switch(c*=255,f){case 0:return[c,b,d];case 1:return[p,c,d];case 2:return[d,c,b];case 3:return[d,p,c];case 4:return[b,d,c];case 5:return[c,d,p]}},i.hsv.hsl=function(o){let a=o[0],l=o[1]/100,c=o[2]/100,f=Math.max(c,.01),u,d;d=(2-l)*c;let p=(2-l)*f;return u=l*f,u/=p<=1?p:2-p,u=u||0,d/=2,[a,u*100,d*100]},i.hwb.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100,f=l+c,u;f>1&&(l/=f,c/=f);let d=Math.floor(6*a),p=1-c;u=6*a-d,(d&1)!==0&&(u=1-u);let b=l+u*(p-l),g,m,C;switch(d){default:case 6:case 0:g=p,m=b,C=l;break;case 1:g=b,m=p,C=l;break;case 2:g=l,m=p,C=b;break;case 3:g=l,m=b,C=p;break;case 4:g=b,m=l,C=p;break;case 5:g=p,m=l,C=b;break}return[g*255,m*255,C*255]},i.cmyk.rgb=function(o){let a=o[0]/100,l=o[1]/100,c=o[2]/100,f=o[3]/100,u=1-Math.min(1,a*(1-f)+f),d=1-Math.min(1,l*(1-f)+f),p=1-Math.min(1,c*(1-f)+f);return[u*255,d*255,p*255]},i.xyz.rgb=function(o){let a=o[0]/100,l=o[1]/100,c=o[2]/100,f,u,d;return f=a*3.2406+l*-1.5372+c*-.4986,u=a*-.9689+l*1.8758+c*.0415,d=a*.0557+l*-.204+c*1.057,f=f>.0031308?1.055*f**(1/2.4)-.055:f*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,d=d>.0031308?1.055*d**(1/2.4)-.055:d*12.92,f=Math.min(Math.max(0,f),1),u=Math.min(Math.max(0,u),1),d=Math.min(Math.max(0,d),1),[f*255,u*255,d*255]},i.xyz.lab=function(o){let a=o[0],l=o[1],c=o[2];a/=95.047,l/=100,c/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;let f=116*l-16,u=500*(a-l),d=200*(l-c);return[f,u,d]},i.lab.xyz=function(o){let a=o[0],l=o[1],c=o[2],f,u,d;u=(a+16)/116,f=l/500+u,d=u-c/200;let p=u**3,b=f**3,g=d**3;return u=p>.008856?p:(u-16/116)/7.787,f=b>.008856?b:(f-16/116)/7.787,d=g>.008856?g:(d-16/116)/7.787,f*=95.047,u*=100,d*=108.883,[f,u,d]},i.lab.lch=function(o){let a=o[0],l=o[1],c=o[2],f;f=Math.atan2(c,l)*360/2/Math.PI,f<0&&(f+=360);let u=Math.sqrt(l*l+c*c);return[a,u,f]},i.lch.lab=function(o){let a=o[0],l=o[1],c=o[2]/360*2*Math.PI,f=l*Math.cos(c),u=l*Math.sin(c);return[a,f,u]},i.rgb.ansi16=function(o,a=null){let[l,c,f]=o,u=a===null?i.rgb.hsv(o)[2]:a;if(u=Math.round(u/50),u===0)return 30;let d=30+(Math.round(f/255)<<2|Math.round(c/255)<<1|Math.round(l/255));return u===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],c=o[2];return a===l&&l===c?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(c/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,c=(a&1)*l*255,f=(a>>1&1)*l*255,u=(a>>2&1)*l*255;return[c,f,u]},i.ansi256.rgb=function(o){if(o>=232){let u=(o-232)*10+8;return[u,u,u]}o-=16;let a,l=Math.floor(o/36)/5*255,c=Math.floor((a=o%36)/6)/5*255,f=a%6/5*255;return[l,c,f]},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(p=>p+p).join(""));let c=parseInt(l,16),f=c>>16&255,u=c>>8&255,d=c&255;return[f,u,d]},i.rgb.hcg=function(o){let a=o[0]/255,l=o[1]/255,c=o[2]/255,f=Math.max(Math.max(a,l),c),u=Math.min(Math.min(a,l),c),d=f-u,p,b;return d<1?p=u/(1-d):p=0,d<=0?b=0:f===a?b=(l-c)/d%6:f===l?b=2+(c-a)/d:b=4+(a-l)/d,b/=6,b%=1,[b*360,d*100,p*100]},i.hsl.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=l<.5?2*a*l:2*a*(1-l),f=0;return c<1&&(f=(l-.5*c)/(1-c)),[o[0],c*100,f*100]},i.hsv.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=a*l,f=0;return c<1&&(f=(l-c)/(1-c)),[o[0],c*100,f*100]},i.hcg.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100;if(l===0)return[c*255,c*255,c*255];let f=[0,0,0],u=a%1*6,d=u%1,p=1-d,b=0;switch(Math.floor(u)){case 0:f[0]=1,f[1]=d,f[2]=0;break;case 1:f[0]=p,f[1]=1,f[2]=0;break;case 2:f[0]=0,f[1]=1,f[2]=d;break;case 3:f[0]=0,f[1]=p,f[2]=1;break;case 4:f[0]=d,f[1]=0,f[2]=1;break;default:f[0]=1,f[1]=0,f[2]=p}return b=(1-l)*c,[(l*f[0]+b)*255,(l*f[1]+b)*255,(l*f[2]+b)*255]},i.hcg.hsv=function(o){let a=o[1]/100,l=o[2]/100,c=a+l*(1-a),f=0;return c>0&&(f=a/c),[o[0],f*100,c*100]},i.hcg.hsl=function(o){let a=o[1]/100,l=o[2]/100*(1-a)+.5*a,c=0;return l>0&&l<.5?c=a/(2*l):l>=.5&&l<1&&(c=a/(2*(1-l))),[o[0],c*100,l*100]},i.hcg.hwb=function(o){let a=o[1]/100,l=o[2]/100,c=a+l*(1-a);return[o[0],(c-a)*100,(1-c)*100]},i.hwb.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=1-l,f=c-a,u=0;return f<1&&(u=(c-f)/(1-f)),[o[0],f*100,u*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]}}),mf=ot((e,t)=>{var n=ds();function r(){let a={},l=Object.keys(n);for(let c=l.length,f=0;f<c;f++)a[l[f]]={distance:-1,parent:null};return a}function i(a){let l=r(),c=[a];for(l[a].distance=0;c.length;){let f=c.pop(),u=Object.keys(n[f]);for(let d=u.length,p=0;p<d;p++){let b=u[p],g=l[b];g.distance===-1&&(g.distance=l[f].distance+1,g.parent=f,c.unshift(b))}}return l}function s(a,l){return function(c){return l(a(c))}}function o(a,l){let c=[l[a].parent,a],f=n[l[a].parent][a],u=l[a].parent;for(;l[u].parent;)c.unshift(l[u].parent),f=s(n[l[u].parent][u],f),u=l[u].parent;return f.conversion=c,f}t.exports=function(a){let l=i(a),c={},f=Object.keys(l);for(let u=f.length,d=0;d<u;d++){let p=f[d];l[p].parent!==null&&(c[p]=o(p,l))}return c}}),gf=ot((e,t)=>{var n=ds(),r=mf(),i={},s=Object.keys(n);function o(l){let c=function(...f){let u=f[0];return u==null?u:(u.length>1&&(f=u),l(f))};return"conversion"in l&&(c.conversion=l.conversion),c}function a(l){let c=function(...f){let u=f[0];if(u==null)return u;u.length>1&&(f=u);let d=l(f);if(typeof d=="object")for(let p=d.length,b=0;b<p;b++)d[b]=Math.round(d[b]);return d};return"conversion"in l&&(c.conversion=l.conversion),c}s.forEach(l=>{i[l]={},Object.defineProperty(i[l],"channels",{value:n[l].channels}),Object.defineProperty(i[l],"labels",{value:n[l].labels});let c=r(l);Object.keys(c).forEach(f=>{let u=c[f];i[l][f]=a(u),i[l][f].raw=o(u)})}),t.exports=i}),bf=ot((e,t)=>{"use strict";var n=(u,d)=>(...p)=>`\x1B[${u(...p)+d}m`,r=(u,d)=>(...p)=>{let b=u(...p);return`\x1B[${38+d};5;${b}m`},i=(u,d)=>(...p)=>{let b=u(...p);return`\x1B[${38+d};2;${b[0]};${b[1]};${b[2]}m`},s=u=>u,o=(u,d,p)=>[u,d,p],a=(u,d,p)=>{Object.defineProperty(u,d,{get:()=>{let b=p();return Object.defineProperty(u,d,{value:b,enumerable:!0,configurable:!0}),b},enumerable:!0,configurable:!0})},l,c=(u,d,p,b)=>{l===void 0&&(l=gf());let g=b?10:0,m={};for(let[C,O]of Object.entries(l)){let N=C==="ansi16"?"ansi":C;C===d?m[N]=u(p,g):typeof O=="object"&&(m[N]=u(O[d],g))}return m};function f(){let u=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[p,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],u.set(m[0],m[1]);Object.defineProperty(d,p,{value:b,enumerable:!1})}return Object.defineProperty(d,"codes",{value:u,enumerable:!1}),d.color.close="\x1B[39m",d.bgColor.close="\x1B[49m",a(d.color,"ansi",()=>c(n,"ansi16",s,!1)),a(d.color,"ansi256",()=>c(r,"ansi256",s,!1)),a(d.color,"ansi16m",()=>c(i,"rgb",o,!1)),a(d.bgColor,"ansi",()=>c(n,"ansi16",s,!0)),a(d.bgColor,"ansi256",()=>c(r,"ansi256",s,!0)),a(d.bgColor,"ansi16m",()=>c(i,"rgb",o,!0)),d}Object.defineProperty(t,"exports",{enumerable:!0,get:f})}),yf=ot((e,t)=>{"use strict";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)}}),wf=ot((e,t)=>{"use strict";var n=fs("os"),r=fs("tty"),i=yf(),{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(f){return f===0?!1:{level:f,hasBasic:!0,has256:f>=2,has16m:f>=3}}function l(f,u){if(o===0)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(f&&!u&&o===void 0)return 0;let d=o||0;if(s.TERM==="dumb")return d;if(process.platform==="win32"){let p=n.release().split(".");return Number(p[0])>=10&&Number(p[2])>=10586?Number(p[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(p=>p 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 p=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return p>=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 c(f){let u=l(f,f&&f.isTTY);return a(u)}t.exports={supportsColor:c,stdout:a(l(!0,r.isatty(1))),stderr:a(l(!0,r.isatty(2)))}}),Af=ot((e,t)=>{"use strict";var n=(i,s,o)=>{let a=i.indexOf(s);if(a===-1)return i;let l=s.length,c=0,f="";do f+=i.substr(c,a-c)+s+o,c=a+l,a=i.indexOf(s,c);while(a!==-1);return f+=i.substr(c),f},r=(i,s,o,a)=>{let l=0,c="";do{let f=i[a-1]==="\r";c+=i.substr(l,(f?a-1:a)-l)+s+(f?`\r
70
70
  `:`
71
71
  `)+o,l=a+1,a=i.indexOf(`
72
- `,l)}while(a!==-1);return c+=i.substr(l),c};t.exports={stringReplaceAll:n,stringEncaseCRLFWithFirstIndex:r}}),_f=ot((e,t)=>{"use strict";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(u){let d=u[0]==="u",p=u[1]==="{";return d&&!p&&u.length===5||u[0]==="x"&&u.length===3?String.fromCharCode(parseInt(u.slice(1),16)):d&&p?String.fromCodePoint(parseInt(u.slice(2,-1),16)):o.get(u)||u}function l(u,d){let p=[],y=d.trim().split(/\s*,\s*/g),g;for(let m of y){let C=Number(m);if(!Number.isNaN(C))p.push(C);else if(g=m.match(i))p.push(g[2].replace(s,(O,N,Y)=>N?a(N):Y));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${u}')`)}return p}function c(u){r.lastIndex=0;let d=[],p;for(;(p=r.exec(u))!==null;){let y=p[1];if(p[2]){let g=l(y,p[2]);d.push([y].concat(g))}else d.push([y])}return d}function f(u,d){let p={};for(let g of d)for(let m of g.styles)p[m[0]]=g.inverse?null:m.slice(1);let y=u;for(let[g,m]of Object.entries(p))if(Array.isArray(m)){if(!(g in y))throw new Error(`Unknown Chalk style: ${g}`);y=m.length>0?y[g](...m):y[g]}return y}t.exports=(u,d)=>{let p=[],y=[],g=[];if(d.replace(n,(m,C,O,N,Y,V)=>{if(C)g.push(a(C));else if(N){let q=g.join("");g=[],y.push(p.length===0?q:f(u,p)(q)),p.push({inverse:O,styles:c(N)})}else if(Y){if(p.length===0)throw new Error("Found extraneous } in Chalk template literal");y.push(f(u,p)(g.join(""))),g=[],p.pop()}else g.push(V)}),y.push(g.join("")),p.length>0){let m=`Chalk template literal is missing ${p.length} closing bracket${p.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return y.join("")}}),yi=ot((e,t)=>{"use strict";var n=Cf(),{stdout:r,stderr:i}=vf(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=Ef(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],c=Object.create(null),f=(q,k={})=>{if(k.level&&!(Number.isInteger(k.level)&&k.level>=0&&k.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let Q=r?r.level:0;q.level=k.level===void 0?Q:k.level},u=class{constructor(q){return d(q)}},d=q=>{let k={};return f(k,q),k.template=(...Q)=>Y(k.template,...Q),Object.setPrototypeOf(k,p.prototype),Object.setPrototypeOf(k.template,k),k.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},k.template.Instance=u,k.template};function p(q){return d(q)}for(let[q,k]of Object.entries(n))c[q]={get(){let Q=C(this,m(k.open,k.close,this._styler),this._isEmpty);return Object.defineProperty(this,q,{value:Q}),Q}};c.visible={get(){let q=C(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:q}),q}};var y=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let q of y)c[q]={get(){let{level:k}=this;return function(...Q){let Z=m(n.color[l[k]][q](...Q),n.color.close,this._styler);return C(this,Z,this._isEmpty)}}};for(let q of y){let k="bg"+q[0].toUpperCase()+q.slice(1);c[k]={get(){let{level:Q}=this;return function(...Z){let G=m(n.bgColor[l[Q]][q](...Z),n.bgColor.close,this._styler);return C(this,G,this._isEmpty)}}}}var g=Object.defineProperties(()=>{},yf(gf({},c),{level:{enumerable:!0,get(){return this._generator.level},set(q){this._generator.level=q}}})),m=(q,k,Q)=>{let Z,G;return Q===void 0?(Z=q,G=k):(Z=Q.openAll+q,G=k+Q.closeAll),{open:q,close:k,openAll:Z,closeAll:G,parent:Q}},C=(q,k,Q)=>{let Z=(...G)=>a(G[0])&&a(G[0].raw)?O(Z,Y(Z,...G)):O(Z,G.length===1?""+G[0]:G.join(" "));return Object.setPrototypeOf(Z,g),Z._generator=q,Z._styler=k,Z._isEmpty=Q,Z},O=(q,k)=>{if(q.level<=0||!k)return q._isEmpty?"":k;let Q=q._styler;if(Q===void 0)return k;let{openAll:Z,closeAll:G}=Q;if(k.indexOf("\x1B")!==-1)for(;Q!==void 0;)k=s(k,Q.close,Q.open),Q=Q.parent;let Ge=k.indexOf(`
74
- `);return Ge!==-1&&(k=o(k,G,Z,Ge)),Z+k+G},N,Y=(q,...k)=>{let[Q]=k;if(!a(Q)||!a(Q.raw))return k.join(" ");let Z=k.slice(1),G=[Q.raw[0]];for(let Ge=1;Ge<Q.length;Ge++)G.push(String(Z[Ge-1]).replace(/[{}\\]/g,"\\$&"),String(Q.raw[Ge]));return N===void 0&&(N=_f()),N(q,G.join(""))};Object.defineProperties(p.prototype,c);var V=p();V.supportsColor=r,V.stderr=p({level:i?i.level:0}),V.stderr.supportsColor=i,t.exports=V});import{existsSync as Ah,mkdirSync as xh}from"fs";import{readdir as Ch,unlink as Oh}from"fs/promises";import{extname as vh,join as Na}from"path";function Ps(e){return typeof e=="undefined"||e===null}function Sf(e){return typeof e=="object"&&e!==null}function jf(e){return Array.isArray(e)?e:Ps(e)?[]:[e]}function Pf(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 If(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function Mf(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Ff=Ps,Tf=Sf,Lf=jf,Df=If,Nf=Mf,kf=Pf,Ee={isNothing:Ff,isObject:Tf,toArray:Lf,repeat:Df,isNegativeZero:Nf,extend:kf};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+=`
72
+ `,l)}while(a!==-1);return c+=i.substr(l),c};t.exports={stringReplaceAll:n,stringEncaseCRLFWithFirstIndex:r}}),xf=ot((e,t)=>{"use strict";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(u){let d=u[0]==="u",p=u[1]==="{";return d&&!p&&u.length===5||u[0]==="x"&&u.length===3?String.fromCharCode(parseInt(u.slice(1),16)):d&&p?String.fromCodePoint(parseInt(u.slice(2,-1),16)):o.get(u)||u}function l(u,d){let p=[],b=d.trim().split(/\s*,\s*/g),g;for(let m of b){let C=Number(m);if(!Number.isNaN(C))p.push(C);else if(g=m.match(i))p.push(g[2].replace(s,(O,N,Y)=>N?a(N):Y));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${u}')`)}return p}function c(u){r.lastIndex=0;let d=[],p;for(;(p=r.exec(u))!==null;){let b=p[1];if(p[2]){let g=l(b,p[2]);d.push([b].concat(g))}else d.push([b])}return d}function f(u,d){let p={};for(let g of d)for(let m of g.styles)p[m[0]]=g.inverse?null:m.slice(1);let b=u;for(let[g,m]of Object.entries(p))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=(u,d)=>{let p=[],b=[],g=[];if(d.replace(n,(m,C,O,N,Y,V)=>{if(C)g.push(a(C));else if(N){let q=g.join("");g=[],b.push(p.length===0?q:f(u,p)(q)),p.push({inverse:O,styles:c(N)})}else if(Y){if(p.length===0)throw new Error("Found extraneous } in Chalk template literal");b.push(f(u,p)(g.join(""))),g=[],p.pop()}else g.push(V)}),b.push(g.join("")),p.length>0){let m=`Chalk template literal is missing ${p.length} closing bracket${p.length===1?"":"s"} (\`}\`)`;throw new Error(m)}return b.join("")}}),bi=ot((e,t)=>{"use strict";var n=bf(),{stdout:r,stderr:i}=wf(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=Af(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],c=Object.create(null),f=(q,k={})=>{if(k.level&&!(Number.isInteger(k.level)&&k.level>=0&&k.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let Q=r?r.level:0;q.level=k.level===void 0?Q:k.level},u=class{constructor(q){return d(q)}},d=q=>{let k={};return f(k,q),k.template=(...Q)=>Y(k.template,...Q),Object.setPrototypeOf(k,p.prototype),Object.setPrototypeOf(k.template,k),k.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},k.template.Instance=u,k.template};function p(q){return d(q)}for(let[q,k]of Object.entries(n))c[q]={get(){let Q=C(this,m(k.open,k.close,this._styler),this._isEmpty);return Object.defineProperty(this,q,{value:Q}),Q}};c.visible={get(){let q=C(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:q}),q}};var b=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let q of b)c[q]={get(){let{level:k}=this;return function(...Q){let Z=m(n.color[l[k]][q](...Q),n.color.close,this._styler);return C(this,Z,this._isEmpty)}}};for(let q of b){let k="bg"+q[0].toUpperCase()+q.slice(1);c[k]={get(){let{level:Q}=this;return function(...Z){let H=m(n.bgColor[l[Q]][q](...Z),n.bgColor.close,this._styler);return C(this,H,this._isEmpty)}}}}var g=Object.defineProperties(()=>{},{...c,level:{enumerable:!0,get(){return this._generator.level},set(q){this._generator.level=q}}}),m=(q,k,Q)=>{let Z,H;return Q===void 0?(Z=q,H=k):(Z=Q.openAll+q,H=k+Q.closeAll),{open:q,close:k,openAll:Z,closeAll:H,parent:Q}},C=(q,k,Q)=>{let Z=(...H)=>a(H[0])&&a(H[0].raw)?O(Z,Y(Z,...H)):O(Z,H.length===1?""+H[0]:H.join(" "));return Object.setPrototypeOf(Z,g),Z._generator=q,Z._styler=k,Z._isEmpty=Q,Z},O=(q,k)=>{if(q.level<=0||!k)return q._isEmpty?"":k;let Q=q._styler;if(Q===void 0)return k;let{openAll:Z,closeAll:H}=Q;if(k.indexOf("\x1B")!==-1)for(;Q!==void 0;)k=s(k,Q.close,Q.open),Q=Q.parent;let He=k.indexOf(`
74
+ `);return He!==-1&&(k=o(k,H,Z,He)),Z+k+H},N,Y=(q,...k)=>{let[Q]=k;if(!a(Q)||!a(Q.raw))return k.join(" ");let Z=k.slice(1),H=[Q.raw[0]];for(let He=1;He<Q.length;He++)H.push(String(Z[He-1]).replace(/[{}\\]/g,"\\$&"),String(Q.raw[He]));return N===void 0&&(N=xf()),N(q,H.join(""))};Object.defineProperties(p.prototype,c);var V=p();V.supportsColor=r,V.stderr=p({level:i?i.level:0}),V.stderr.supportsColor=i,t.exports=V});import{existsSync as mh,mkdirSync as gh}from"fs";import{readdir as bh,unlink as yh}from"fs/promises";import{extname as wh,join as Da}from"path";function Ps(e){return typeof e=="undefined"||e===null}function Cf(e){return typeof e=="object"&&e!==null}function Of(e){return Array.isArray(e)?e:Ps(e)?[]:[e]}function vf(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 Ef(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function _f(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Sf=Ps,Pf=Cf,jf=Of,Mf=Ef,If=_f,Ff=vf,Ee={isNothing:Sf,isObject:Pf,toArray:jf,repeat:Mf,isNegativeZero:If,extend:Ff};function js(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+=`
75
75
 
76
- `+e.mark.snippet),r+" "+n):r}function Nn(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||""}Nn.prototype=Object.create(Error.prototype);Nn.prototype.constructor=Nn;Nn.prototype.toString=function(t){return this.name+": "+Is(this,t)};var $e=Nn;function bi(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 wi(e,t){return Ee.repeat(" ",t-e.length)+e}function Rf(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,c,f=Math.min(e.line+t.linesAfter,i.length).toString().length,u=t.maxLength-(t.indent+f+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)c=bi(e.buffer,r[o-l],i[o-l],e.position-(r[o]-r[o-l]),u),a=Ee.repeat(" ",t.indent)+wi((e.line-l+1).toString(),f)+" | "+c.str+`
77
- `+a;for(c=bi(e.buffer,r[o],i[o],e.position,u),a+=Ee.repeat(" ",t.indent)+wi((e.line+1).toString(),f)+" | "+c.str+`
76
+ `+e.mark.snippet),r+" "+n):r}function kn(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=js(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}kn.prototype=Object.create(Error.prototype);kn.prototype.constructor=kn;kn.prototype.toString=function(t){return this.name+": "+js(this,t)};var $e=kn;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 wi(e,t){return Ee.repeat(" ",t-e.length)+e}function Tf(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,c,f=Math.min(e.line+t.linesAfter,i.length).toString().length,u=t.maxLength-(t.indent+f+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)c=yi(e.buffer,r[o-l],i[o-l],e.position-(r[o]-r[o-l]),u),a=Ee.repeat(" ",t.indent)+wi((e.line-l+1).toString(),f)+" | "+c.str+`
77
+ `+a;for(c=yi(e.buffer,r[o],i[o],e.position,u),a+=Ee.repeat(" ",t.indent)+wi((e.line+1).toString(),f)+" | "+c.str+`
78
78
  `,a+=Ee.repeat("-",t.indent+f+3+c.pos)+`^
79
- `,l=1;l<=t.linesAfter&&!(o+l>=i.length);l++)c=bi(e.buffer,r[o+l],i[o+l],e.position-(r[o]-r[o+l]),u),a+=Ee.repeat(" ",t.indent)+wi((e.line+l+1).toString(),f)+" | "+c.str+`
80
- `;return a.replace(/\n$/,"")}var Uf=Rf,$f=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Wf=["scalar","sequence","mapping"];function Bf(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Gf(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if($f.indexOf(n)===-1)throw new $e('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=Bf(t.styleAliases||null),Wf.indexOf(this.kind)===-1)throw new $e('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ie=Gf;function hs(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 Hf(){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 xi(e){return this.extend(e)}xi.prototype.extend=function(t){var n=[],r=[];if(t instanceof Ie)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 $e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof Ie))throw new $e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new $e("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 $e("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 Ie))throw new $e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(xi.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=hs(i,"implicit"),i.compiledExplicit=hs(i,"explicit"),i.compiledTypeMap=Hf(i.compiledImplicit,i.compiledExplicit),i};var qf=xi,Yf=new Ie("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),zf=new Ie("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Vf=new Ie("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Kf=new qf({explicit:[Yf,zf,Vf]});function Qf(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Jf(){return null}function Xf(e){return e===null}var Zf=new Ie("tag:yaml.org,2002:null",{kind:"scalar",resolve:Qf,construct:Jf,predicate:Xf,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function eu(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 tu(e){return e==="true"||e==="True"||e==="TRUE"}function nu(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var ru=new Ie("tag:yaml.org,2002:bool",{kind:"scalar",resolve:eu,construct:tu,predicate:nu,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 iu(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function ou(e){return 48<=e&&e<=55}function su(e){return 48<=e&&e<=57}function au(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(!iu(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!ou(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!su(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function lu(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 cu(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ee.isNegativeZero(e)}var fu=new Ie("tag:yaml.org,2002:int",{kind:"scalar",resolve:au,construct:lu,predicate:cu,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"]}}),uu=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function du(e){return!(e===null||!uu.test(e)||e[e.length-1]==="_")}function pu(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 hu=/^[-+]?[0-9]+e/;function mu(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(Ee.isNegativeZero(e))return"-0.0";return n=e.toString(10),hu.test(n)?n.replace("e",".e"):n}function gu(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ee.isNegativeZero(e))}var yu=new Ie("tag:yaml.org,2002:float",{kind:"scalar",resolve:du,construct:pu,predicate:gu,represent:mu,defaultStyle:"lowercase"}),bu=Kf.extend({implicit:[Zf,ru,fu,yu]}),wu=bu,Ms=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Fs=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 Au(e){return e===null?!1:Ms.exec(e)!==null||Fs.exec(e)!==null}function xu(e){var t,n,r,i,s,o,a,l=0,c=null,f,u,d;if(t=Ms.exec(e),t===null&&(t=Fs.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]&&(f=+t[10],u=+(t[11]||0),c=(f*60+u)*6e4,t[9]==="-"&&(c=-c)),d=new Date(Date.UTC(n,r,i,s,o,a,l)),c&&d.setTime(d.getTime()-c),d}function Cu(e){return e.toISOString()}var Ou=new Ie("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Au,construct:xu,instanceOf:Date,represent:Cu});function vu(e){return e==="<<"||e===null}var Eu=new Ie("tag:yaml.org,2002:merge",{kind:"scalar",resolve:vu}),_i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
81
- \r`;function _u(e){if(e===null)return!1;var t,n,r=0,i=e.length,s=_i;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 Su(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,s=_i,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 ju(e){var t="",n=0,r,i,s=e.length,o=_i;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 Pu(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Iu=new Ie("tag:yaml.org,2002:binary",{kind:"scalar",resolve:_u,construct:Su,predicate:Pu,represent:ju}),Mu=Object.prototype.hasOwnProperty,Fu=Object.prototype.toString;function Tu(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,Fu.call(i)!=="[object Object]")return!1;for(s in i)if(Mu.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 Lu(e){return e!==null?e:[]}var Du=new Ie("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Tu,construct:Lu}),Nu=Object.prototype.toString;function ku(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],Nu.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[t]=[i[0],r[i[0]]]}return!0}function Ru(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 Uu=new Ie("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:ku,construct:Ru}),$u=Object.prototype.hasOwnProperty;function Wu(e){if(e===null)return!0;var t,n=e;for(t in n)if($u.call(n,t)&&n[t]!==null)return!1;return!0}function Bu(e){return e!==null?e:{}}var Gu=new Ie("tag:yaml.org,2002:set",{kind:"mapping",resolve:Wu,construct:Bu}),Ts=wu.extend({implicit:[Ou,Eu],explicit:[Iu,Du,Uu,Gu]}),Ot=Object.prototype.hasOwnProperty,gr=1,Ls=2,Ds=3,yr=4,Ai=1,Hu=2,ms=3,qu=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Yu=/[\x85\u2028\u2029]/,zu=/[,\[\]\{\}]/,Ns=/^(?:!|!!|![a-z\-]+!)$/i,ks=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function gs(e){return Object.prototype.toString.call(e)}function st(e){return e===10||e===13}function Zt(e){return e===9||e===32}function We(e){return e===9||e===32||e===10||e===13}function dn(e){return e===44||e===91||e===93||e===123||e===125}function Vu(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Ku(e){return e===120?2:e===117?4:e===85?8:0}function Qu(e){return 48<=e&&e<=57?e-48:-1}function ys(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 Ju(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Rs=new Array(256),Us=new Array(256);for(Xt=0;Xt<256;Xt++)Rs[Xt]=ys(Xt)?1:0,Us[Xt]=ys(Xt);var Xt;function Xu(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Ts,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 $s(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=Uf(n),new $e(t,n)}function U(e,t){throw $s(e,t)}function br(e,t){e.onWarning&&e.onWarning.call(null,$s(e,t))}var bs={YAML:function(t,n,r){var i,s,o;t.version!==null&&U(t,"duplication of %YAML directive"),r.length!==1&&U(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&U(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&U(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&br(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,s;r.length!==2&&U(t,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],Ns.test(i)||U(t,"ill-formed tag handle (first argument) of the TAG directive"),Ot.call(t.tagMap,i)&&U(t,'there is a previously declared suffix for "'+i+'" tag handle'),ks.test(s)||U(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){U(t,"tag prefix is malformed: "+s)}t.tagMap[i]=s}};function Ct(e,t,n,r){var i,s,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,s=a.length;i<s;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||U(e,"expected valid JSON character");else qu.test(a)&&U(e,"the stream contains non-printable characters");e.result+=a}}function ws(e,t,n,r){var i,s,o,a;for(Ee.isObject(n)||U(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)s=i[o],Ot.call(t,s)||(t[s]=n[s],r[s]=!0)}function pn(e,t,n,r,i,s,o,a,l){var c,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,f=i.length;c<f;c+=1)Array.isArray(i[c])&&U(e,"nested arrays are not supported inside keys"),typeof i=="object"&&gs(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&gs(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,f=s.length;c<f;c+=1)ws(e,t,s[c],n);else ws(e,t,s,n);else!e.json&&!Ot.call(n,i)&&Ot.call(t,i)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,U(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[i]=s,delete n[i];return t}function Si(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):U(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function pe(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Zt(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(st(i))for(Si(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&&br(e,"deficient indentation"),r}function xr(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||We(n)))}function ji(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ee.repeat(`
83
- `,t-1))}function Zu(e,t,n){var r,i,s,o,a,l,c,f,u=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),We(p)||dn(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),We(i)||n&&dn(i)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,a=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),We(i)||n&&dn(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),We(r))break}else{if(e.position===e.lineStart&&xr(e)||n&&dn(p))break;if(st(p))if(l=e.line,c=e.lineStart,f=e.lineIndent,pe(e,!1,-1),e.lineIndent>=t){a=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=f;break}}a&&(Ct(e,s,o,!1),ji(e,e.line-l),s=o=e.position,a=!1),Zt(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return Ct(e,s,o,!1),e.result?!0:(e.kind=u,e.result=d,!1)}function ed(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(Ct(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 st(n)?(Ct(e,r,i,!0),ji(e,pe(e,!1,t)),r=i=e.position):e.position===e.lineStart&&xr(e)?U(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);U(e,"unexpected end of the stream within a single quoted scalar")}function td(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 Ct(e,n,e.position,!0),e.position++,!0;if(a===92){if(Ct(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),st(a))pe(e,!1,t);else if(a<256&&Rs[a])e.result+=Us[a],e.position++;else if((o=Ku(a))>0){for(i=o,s=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=Vu(a))>=0?s=(s<<4)+o:U(e,"expected hexadecimal character");e.result+=Ju(s),e.position++}else U(e,"unknown escape sequence");n=r=e.position}else st(a)?(Ct(e,n,r,!0),ji(e,pe(e,!1,t)),n=r=e.position):e.position===e.lineStart&&xr(e)?U(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}U(e,"unexpected end of the stream within a double quoted scalar")}function nd(e,t){var n=!0,r,i,s,o=e.tag,a,l=e.anchor,c,f,u,d,p,y=Object.create(null),g,m,C,O;if(O=e.input.charCodeAt(e.position),O===91)f=93,p=!1,a=[];else if(O===123)f=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),O=e.input.charCodeAt(++e.position);O!==0;){if(pe(e,!0,t),O=e.input.charCodeAt(e.position),O===f)return e.position++,e.tag=o,e.anchor=l,e.kind=p?"mapping":"sequence",e.result=a,!0;n?O===44&&U(e,"expected the node content, but found ','"):U(e,"missed comma between flow collection entries"),m=g=C=null,u=d=!1,O===63&&(c=e.input.charCodeAt(e.position+1),We(c)&&(u=d=!0,e.position++,pe(e,!0,t))),r=e.line,i=e.lineStart,s=e.position,hn(e,t,gr,!1,!0),m=e.tag,g=e.result,pe(e,!0,t),O=e.input.charCodeAt(e.position),(d||e.line===r)&&O===58&&(u=!0,O=e.input.charCodeAt(++e.position),pe(e,!0,t),hn(e,t,gr,!1,!0),C=e.result),p?pn(e,a,y,m,g,C,r,i,s):u?a.push(pn(e,null,y,m,g,C,r,i,s)):a.push(g),pe(e,!0,t),O=e.input.charCodeAt(e.position),O===44?(n=!0,O=e.input.charCodeAt(++e.position)):n=!1}U(e,"unexpected end of the stream within a flow collection")}function rd(e,t){var n,r,i=Ai,s=!1,o=!1,a=t,l=0,c=!1,f,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)Ai===i?i=u===43?ms:Hu:U(e,"repeat of a chomping mode identifier");else if((f=Qu(u))>=0)f===0?U(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?U(e,"repeat of an indentation width identifier"):(a=t+f-1,o=!0);else break;if(Zt(u)){do u=e.input.charCodeAt(++e.position);while(Zt(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!st(u)&&u!==0)}for(;u!==0;){for(Si(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),st(u)){l++;continue}if(e.lineIndent<a){i===ms?e.result+=Ee.repeat(`
79
+ `,l=1;l<=t.linesAfter&&!(o+l>=i.length);l++)c=yi(e.buffer,r[o+l],i[o+l],e.position-(r[o]-r[o+l]),u),a+=Ee.repeat(" ",t.indent)+wi((e.line+l+1).toString(),f)+" | "+c.str+`
80
+ `;return a.replace(/\n$/,"")}var Lf=Tf,Df=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Nf=["scalar","sequence","mapping"];function kf(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Rf(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Df.indexOf(n)===-1)throw new $e('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=kf(t.styleAliases||null),Nf.indexOf(this.kind)===-1)throw new $e('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Me=Rf;function ps(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(s,o){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=o)}),n[i]=r}),n}function Uf(){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 xi(e){return this.extend(e)}xi.prototype.extend=function(t){var n=[],r=[];if(t instanceof Me)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 $e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof Me))throw new $e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new $e("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 $e("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 Me))throw new $e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(xi.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=ps(i,"implicit"),i.compiledExplicit=ps(i,"explicit"),i.compiledTypeMap=Uf(i.compiledImplicit,i.compiledExplicit),i};var $f=xi,Wf=new Me("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Bf=new Me("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Hf=new Me("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Gf=new $f({explicit:[Wf,Bf,Hf]});function qf(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Yf(){return null}function zf(e){return e===null}var Vf=new Me("tag:yaml.org,2002:null",{kind:"scalar",resolve:qf,construct:Yf,predicate:zf,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Kf(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 Qf(e){return e==="true"||e==="True"||e==="TRUE"}function Jf(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Xf=new Me("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Kf,construct:Qf,predicate:Jf,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 Zf(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function eu(e){return 48<=e&&e<=55}function tu(e){return 48<=e&&e<=57}function nu(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(!Zf(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!eu(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!tu(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function ru(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 iu(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ee.isNegativeZero(e)}var ou=new Me("tag:yaml.org,2002:int",{kind:"scalar",resolve:nu,construct:ru,predicate:iu,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"]}}),su=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function au(e){return!(e===null||!su.test(e)||e[e.length-1]==="_")}function lu(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 cu=/^[-+]?[0-9]+e/;function fu(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(Ee.isNegativeZero(e))return"-0.0";return n=e.toString(10),cu.test(n)?n.replace("e",".e"):n}function uu(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ee.isNegativeZero(e))}var du=new Me("tag:yaml.org,2002:float",{kind:"scalar",resolve:au,construct:lu,predicate:uu,represent:fu,defaultStyle:"lowercase"}),pu=Gf.extend({implicit:[Vf,Xf,ou,du]}),hu=pu,Ms=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Is=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 mu(e){return e===null?!1:Ms.exec(e)!==null||Is.exec(e)!==null}function gu(e){var t,n,r,i,s,o,a,l=0,c=null,f,u,d;if(t=Ms.exec(e),t===null&&(t=Is.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]&&(f=+t[10],u=+(t[11]||0),c=(f*60+u)*6e4,t[9]==="-"&&(c=-c)),d=new Date(Date.UTC(n,r,i,s,o,a,l)),c&&d.setTime(d.getTime()-c),d}function bu(e){return e.toISOString()}var yu=new Me("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:mu,construct:gu,instanceOf:Date,represent:bu});function wu(e){return e==="<<"||e===null}var Au=new Me("tag:yaml.org,2002:merge",{kind:"scalar",resolve:wu}),_i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
81
+ \r`;function xu(e){if(e===null)return!1;var t,n,r=0,i=e.length,s=_i;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 Cu(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,s=_i,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 Ou(e){var t="",n=0,r,i,s=e.length,o=_i;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 vu(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Eu=new Me("tag:yaml.org,2002:binary",{kind:"scalar",resolve:xu,construct:Cu,predicate:vu,represent:Ou}),_u=Object.prototype.hasOwnProperty,Su=Object.prototype.toString;function Pu(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,Su.call(i)!=="[object Object]")return!1;for(s in i)if(_u.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 ju(e){return e!==null?e:[]}var Mu=new Me("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Pu,construct:ju}),Iu=Object.prototype.toString;function Fu(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],Iu.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[t]=[i[0],r[i[0]]]}return!0}function Tu(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 Lu=new Me("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Fu,construct:Tu}),Du=Object.prototype.hasOwnProperty;function Nu(e){if(e===null)return!0;var t,n=e;for(t in n)if(Du.call(n,t)&&n[t]!==null)return!1;return!0}function ku(e){return e!==null?e:{}}var Ru=new Me("tag:yaml.org,2002:set",{kind:"mapping",resolve:Nu,construct:ku}),Fs=hu.extend({implicit:[yu,Au],explicit:[Eu,Mu,Lu,Ru]}),vt=Object.prototype.hasOwnProperty,gr=1,Ts=2,Ls=3,br=4,Ai=1,Uu=2,hs=3,$u=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Wu=/[\x85\u2028\u2029]/,Bu=/[,\[\]\{\}]/,Ds=/^(?:!|!!|![a-z\-]+!)$/i,Ns=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ms(e){return Object.prototype.toString.call(e)}function st(e){return e===10||e===13}function Zt(e){return e===9||e===32}function We(e){return e===9||e===32||e===10||e===13}function pn(e){return e===44||e===91||e===93||e===123||e===125}function Hu(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Gu(e){return e===120?2:e===117?4:e===85?8:0}function qu(e){return 48<=e&&e<=57?e-48:-1}function gs(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 Yu(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var ks=new Array(256),Rs=new Array(256);for(Xt=0;Xt<256;Xt++)ks[Xt]=gs(Xt)?1:0,Rs[Xt]=gs(Xt);var Xt;function zu(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Fs,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 Us(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=Lf(n),new $e(t,n)}function U(e,t){throw Us(e,t)}function yr(e,t){e.onWarning&&e.onWarning.call(null,Us(e,t))}var bs={YAML:function(t,n,r){var i,s,o;t.version!==null&&U(t,"duplication of %YAML directive"),r.length!==1&&U(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&U(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&U(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&yr(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,s;r.length!==2&&U(t,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],Ds.test(i)||U(t,"ill-formed tag handle (first argument) of the TAG directive"),vt.call(t.tagMap,i)&&U(t,'there is a previously declared suffix for "'+i+'" tag handle'),Ns.test(s)||U(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){U(t,"tag prefix is malformed: "+s)}t.tagMap[i]=s}};function Ot(e,t,n,r){var i,s,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,s=a.length;i<s;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||U(e,"expected valid JSON character");else $u.test(a)&&U(e,"the stream contains non-printable characters");e.result+=a}}function ys(e,t,n,r){var i,s,o,a;for(Ee.isObject(n)||U(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)s=i[o],vt.call(t,s)||(t[s]=n[s],r[s]=!0)}function hn(e,t,n,r,i,s,o,a,l){var c,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,f=i.length;c<f;c+=1)Array.isArray(i[c])&&U(e,"nested arrays are not supported inside keys"),typeof i=="object"&&ms(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&ms(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,f=s.length;c<f;c+=1)ys(e,t,s[c],n);else ys(e,t,s,n);else!e.json&&!vt.call(n,i)&&vt.call(t,i)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,U(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[i]=s,delete n[i];return t}function Si(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):U(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function pe(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Zt(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(st(i))for(Si(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&&yr(e,"deficient indentation"),r}function xr(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||We(n)))}function Pi(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ee.repeat(`
83
+ `,t-1))}function Vu(e,t,n){var r,i,s,o,a,l,c,f,u=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),We(p)||pn(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),We(i)||n&&pn(i)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,a=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),We(i)||n&&pn(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),We(r))break}else{if(e.position===e.lineStart&&xr(e)||n&&pn(p))break;if(st(p))if(l=e.line,c=e.lineStart,f=e.lineIndent,pe(e,!1,-1),e.lineIndent>=t){a=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=f;break}}a&&(Ot(e,s,o,!1),Pi(e,e.line-l),s=o=e.position,a=!1),Zt(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return Ot(e,s,o,!1),e.result?!0:(e.kind=u,e.result=d,!1)}function Ku(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(Ot(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 st(n)?(Ot(e,r,i,!0),Pi(e,pe(e,!1,t)),r=i=e.position):e.position===e.lineStart&&xr(e)?U(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);U(e,"unexpected end of the stream within a single quoted scalar")}function Qu(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 Ot(e,n,e.position,!0),e.position++,!0;if(a===92){if(Ot(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),st(a))pe(e,!1,t);else if(a<256&&ks[a])e.result+=Rs[a],e.position++;else if((o=Gu(a))>0){for(i=o,s=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=Hu(a))>=0?s=(s<<4)+o:U(e,"expected hexadecimal character");e.result+=Yu(s),e.position++}else U(e,"unknown escape sequence");n=r=e.position}else st(a)?(Ot(e,n,r,!0),Pi(e,pe(e,!1,t)),n=r=e.position):e.position===e.lineStart&&xr(e)?U(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}U(e,"unexpected end of the stream within a double quoted scalar")}function Ju(e,t){var n=!0,r,i,s,o=e.tag,a,l=e.anchor,c,f,u,d,p,b=Object.create(null),g,m,C,O;if(O=e.input.charCodeAt(e.position),O===91)f=93,p=!1,a=[];else if(O===123)f=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),O=e.input.charCodeAt(++e.position);O!==0;){if(pe(e,!0,t),O=e.input.charCodeAt(e.position),O===f)return e.position++,e.tag=o,e.anchor=l,e.kind=p?"mapping":"sequence",e.result=a,!0;n?O===44&&U(e,"expected the node content, but found ','"):U(e,"missed comma between flow collection entries"),m=g=C=null,u=d=!1,O===63&&(c=e.input.charCodeAt(e.position+1),We(c)&&(u=d=!0,e.position++,pe(e,!0,t))),r=e.line,i=e.lineStart,s=e.position,mn(e,t,gr,!1,!0),m=e.tag,g=e.result,pe(e,!0,t),O=e.input.charCodeAt(e.position),(d||e.line===r)&&O===58&&(u=!0,O=e.input.charCodeAt(++e.position),pe(e,!0,t),mn(e,t,gr,!1,!0),C=e.result),p?hn(e,a,b,m,g,C,r,i,s):u?a.push(hn(e,null,b,m,g,C,r,i,s)):a.push(g),pe(e,!0,t),O=e.input.charCodeAt(e.position),O===44?(n=!0,O=e.input.charCodeAt(++e.position)):n=!1}U(e,"unexpected end of the stream within a flow collection")}function Xu(e,t){var n,r,i=Ai,s=!1,o=!1,a=t,l=0,c=!1,f,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)Ai===i?i=u===43?hs:Uu:U(e,"repeat of a chomping mode identifier");else if((f=qu(u))>=0)f===0?U(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?U(e,"repeat of an indentation width identifier"):(a=t+f-1,o=!0);else break;if(Zt(u)){do u=e.input.charCodeAt(++e.position);while(Zt(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!st(u)&&u!==0)}for(;u!==0;){for(Si(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),st(u)){l++;continue}if(e.lineIndent<a){i===hs?e.result+=Ee.repeat(`
84
84
  `,s?1+l:l):i===Ai&&s&&(e.result+=`
85
85
  `);break}for(r?Zt(u)?(c=!0,e.result+=Ee.repeat(`
86
86
  `,s?1+l:l)):c?(c=!1,e.result+=Ee.repeat(`
87
87
  `,l+1)):l===0?s&&(e.result+=" "):e.result+=Ee.repeat(`
88
88
  `,l):e.result+=Ee.repeat(`
89
- `,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!st(u)&&u!==0;)u=e.input.charCodeAt(++e.position);Ct(e,n,e.position,!1)}return!0}function As(e,t){var n,r=e.tag,i=e.anchor,s=[],o,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,U(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!We(o))));){if(a=!0,e.position++,pe(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,hn(e,t,Ds,!1,!0),s.push(e.result),pe(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)U(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=s,!0):!1}function id(e,t,n){var r,i,s,o,a,l,c=e.tag,f=e.anchor,u={},d=Object.create(null),p=null,y=null,g=null,m=!1,C=!1,O;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),O=e.input.charCodeAt(e.position);O!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,U(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),s=e.line,(O===63||O===58)&&We(r))O===63?(m&&(pn(e,u,d,p,y,null,o,a,l),p=y=g=null),C=!0,m=!0,i=!0):m?(m=!1,i=!0):U(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,O=r;else{if(o=e.line,a=e.lineStart,l=e.position,!hn(e,n,Ls,!1,!0))break;if(e.line===s){for(O=e.input.charCodeAt(e.position);Zt(O);)O=e.input.charCodeAt(++e.position);if(O===58)O=e.input.charCodeAt(++e.position),We(O)||U(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(pn(e,u,d,p,y,null,o,a,l),p=y=g=null),C=!0,m=!1,i=!1,p=e.tag,y=e.result;else if(C)U(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=f,!0}else if(C)U(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=f,!0}if((e.line===s||e.lineIndent>t)&&(m&&(o=e.line,a=e.lineStart,l=e.position),hn(e,t,yr,!0,i)&&(m?y=e.result:g=e.result),m||(pn(e,u,d,p,y,g,o,a,l),p=y=g=null),pe(e,!0,-1),O=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&O!==0)U(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&pn(e,u,d,p,y,null,o,a,l),C&&(e.tag=c,e.anchor=f,e.kind="mapping",e.result=u),C}function od(e){var t,n=!1,r=!1,i,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&U(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):U(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!We(o);)o===33&&(r?U(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),Ns.test(i)||U(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),zu.test(s)&&U(e,"tag suffix cannot contain flow indicator characters")}s&&!ks.test(s)&&U(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){U(e,"tag name is malformed: "+s)}return n?e.tag=s:Ot.call(e.tagMap,i)?e.tag=e.tagMap[i]+s:i==="!"?e.tag="!"+s:i==="!!"?e.tag="tag:yaml.org,2002:"+s:U(e,'undeclared tag handle "'+i+'"'),!0}function sd(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&U(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!We(n)&&!dn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&U(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function ad(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&&!We(r)&&!dn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&U(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Ot.call(e.anchorMap,n)||U(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],pe(e,!0,-1),!0}function hn(e,t,n,r,i){var s,o,a,l=1,c=!1,f=!1,u,d,p,y,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=yr===n||Ds===n,r&&pe(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;od(e)||sd(e);)pe(e,!0,-1)?(c=!0,a=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=c||i),(l===1||yr===n)&&(gr===n||Ls===n?g=t:g=t+1,m=e.position-e.lineStart,l===1?a&&(As(e,m)||id(e,m,g))||nd(e,g)?f=!0:(o&&rd(e,g)||ed(e,g)||td(e,g)?f=!0:ad(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&U(e,"alias node should not have any properties")):Zu(e,g,gr===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(f=a&&As(e,m))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&U(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,d=e.implicitTypes.length;u<d;u+=1)if(y=e.implicitTypes[u],y.resolve(e.result)){e.result=y.construct(e.result),e.tag=y.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Ot.call(e.typeMap[e.kind||"fallback"],e.tag))y=e.typeMap[e.kind||"fallback"][e.tag];else for(y=null,p=e.typeMap.multi[e.kind||"fallback"],u=0,d=p.length;u<d;u+=1)if(e.tag.slice(0,p[u].tag.length)===p[u].tag){y=p[u];break}y||U(e,"unknown tag !<"+e.tag+">"),e.result!==null&&y.kind!==e.kind&&U(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+y.kind+'", not "'+e.kind+'"'),y.resolve(e.result,e.tag)?(e.result=y.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):U(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function ld(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&&(pe(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&&!We(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&U(e,"directive name must not be less than one character in length");o!==0;){for(;Zt(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!st(o));break}if(st(o))break;for(n=e.position;o!==0&&!We(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Si(e),Ot.call(bs,r)?bs[r](e,r,i):br(e,'unknown document directive "'+r+'"')}if(pe(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,pe(e,!0,-1)):s&&U(e,"directives end mark is expected"),hn(e,e.lineIndent-1,yr,!1,!0),pe(e,!0,-1),e.checkLineBreaks&&Yu.test(e.input.slice(t,e.position))&&br(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&xr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,pe(e,!0,-1));return}if(e.position<e.length-1)U(e,"end of the stream or a document separator is expected");else return}function Ws(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 Xu(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,U(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)ld(n);return n.documents}function cd(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var r=Ws(e,n);if(typeof t!="function")return r;for(var i=0,s=r.length;i<s;i+=1)t(r[i])}function fd(e,t){var n=Ws(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new $e("expected a single document in the stream, but found more")}}var ud=cd,dd=fd,Bs={loadAll:ud,load:dd},Gs=Object.prototype.toString,Hs=Object.prototype.hasOwnProperty,Pi=65279,pd=9,kn=10,hd=13,md=32,gd=33,yd=34,Ci=35,bd=37,wd=38,Ad=39,xd=42,qs=44,Cd=45,wr=58,Od=61,vd=62,Ed=63,_d=64,Ys=91,zs=93,Sd=96,Vs=123,jd=124,Ks=125,Me={};Me[0]="\\0";Me[7]="\\a";Me[8]="\\b";Me[9]="\\t";Me[10]="\\n";Me[11]="\\v";Me[12]="\\f";Me[13]="\\r";Me[27]="\\e";Me[34]='\\"';Me[92]="\\\\";Me[133]="\\N";Me[160]="\\_";Me[8232]="\\L";Me[8233]="\\P";var Pd=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Id=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Md(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&&Hs.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function Fd(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 $e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Ee.repeat("0",r-t.length)+t}var Td=1,Rn=2;function Ld(e){this.schema=e.schema||Ts,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ee.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Md(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==='"'?Rn:Td,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 xs(e,t){for(var n=Ee.repeat(" ",t),r=0,i=-1,s="",o,a=e.length;r<a;)i=e.indexOf(`
89
+ `,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!st(u)&&u!==0;)u=e.input.charCodeAt(++e.position);Ot(e,n,e.position,!1)}return!0}function ws(e,t){var n,r=e.tag,i=e.anchor,s=[],o,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,U(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!We(o))));){if(a=!0,e.position++,pe(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,mn(e,t,Ls,!1,!0),s.push(e.result),pe(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)U(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=s,!0):!1}function Zu(e,t,n){var r,i,s,o,a,l,c=e.tag,f=e.anchor,u={},d=Object.create(null),p=null,b=null,g=null,m=!1,C=!1,O;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),O=e.input.charCodeAt(e.position);O!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,U(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),s=e.line,(O===63||O===58)&&We(r))O===63?(m&&(hn(e,u,d,p,b,null,o,a,l),p=b=g=null),C=!0,m=!0,i=!0):m?(m=!1,i=!0):U(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,O=r;else{if(o=e.line,a=e.lineStart,l=e.position,!mn(e,n,Ts,!1,!0))break;if(e.line===s){for(O=e.input.charCodeAt(e.position);Zt(O);)O=e.input.charCodeAt(++e.position);if(O===58)O=e.input.charCodeAt(++e.position),We(O)||U(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(hn(e,u,d,p,b,null,o,a,l),p=b=g=null),C=!0,m=!1,i=!1,p=e.tag,b=e.result;else if(C)U(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=f,!0}else if(C)U(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=f,!0}if((e.line===s||e.lineIndent>t)&&(m&&(o=e.line,a=e.lineStart,l=e.position),mn(e,t,br,!0,i)&&(m?b=e.result:g=e.result),m||(hn(e,u,d,p,b,g,o,a,l),p=b=g=null),pe(e,!0,-1),O=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&O!==0)U(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&hn(e,u,d,p,b,null,o,a,l),C&&(e.tag=c,e.anchor=f,e.kind="mapping",e.result=u),C}function ed(e){var t,n=!1,r=!1,i,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&U(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):U(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!We(o);)o===33&&(r?U(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),Ds.test(i)||U(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Bu.test(s)&&U(e,"tag suffix cannot contain flow indicator characters")}s&&!Ns.test(s)&&U(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){U(e,"tag name is malformed: "+s)}return n?e.tag=s:vt.call(e.tagMap,i)?e.tag=e.tagMap[i]+s:i==="!"?e.tag="!"+s:i==="!!"?e.tag="tag:yaml.org,2002:"+s:U(e,'undeclared tag handle "'+i+'"'),!0}function td(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&U(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!We(n)&&!pn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&U(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function nd(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&&!We(r)&&!pn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&U(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),vt.call(e.anchorMap,n)||U(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],pe(e,!0,-1),!0}function mn(e,t,n,r,i){var s,o,a,l=1,c=!1,f=!1,u,d,p,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=br===n||Ls===n,r&&pe(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;ed(e)||td(e);)pe(e,!0,-1)?(c=!0,a=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=c||i),(l===1||br===n)&&(gr===n||Ts===n?g=t:g=t+1,m=e.position-e.lineStart,l===1?a&&(ws(e,m)||Zu(e,m,g))||Ju(e,g)?f=!0:(o&&Xu(e,g)||Ku(e,g)||Qu(e,g)?f=!0:nd(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&U(e,"alias node should not have any properties")):Vu(e,g,gr===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(f=a&&ws(e,m))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&U(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,d=e.implicitTypes.length;u<d;u+=1)if(b=e.implicitTypes[u],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(vt.call(e.typeMap[e.kind||"fallback"],e.tag))b=e.typeMap[e.kind||"fallback"][e.tag];else for(b=null,p=e.typeMap.multi[e.kind||"fallback"],u=0,d=p.length;u<d;u+=1)if(e.tag.slice(0,p[u].tag.length)===p[u].tag){b=p[u];break}b||U(e,"unknown tag !<"+e.tag+">"),e.result!==null&&b.kind!==e.kind&&U(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+b.kind+'", not "'+e.kind+'"'),b.resolve(e.result,e.tag)?(e.result=b.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):U(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function rd(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&&(pe(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&&!We(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&U(e,"directive name must not be less than one character in length");o!==0;){for(;Zt(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!st(o));break}if(st(o))break;for(n=e.position;o!==0&&!We(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Si(e),vt.call(bs,r)?bs[r](e,r,i):yr(e,'unknown document directive "'+r+'"')}if(pe(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,pe(e,!0,-1)):s&&U(e,"directives end mark is expected"),mn(e,e.lineIndent-1,br,!1,!0),pe(e,!0,-1),e.checkLineBreaks&&Wu.test(e.input.slice(t,e.position))&&yr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&xr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,pe(e,!0,-1));return}if(e.position<e.length-1)U(e,"end of the stream or a document separator is expected");else return}function $s(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 zu(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,U(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)rd(n);return n.documents}function id(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var r=$s(e,n);if(typeof t!="function")return r;for(var i=0,s=r.length;i<s;i+=1)t(r[i])}function od(e,t){var n=$s(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new $e("expected a single document in the stream, but found more")}}var sd=id,ad=od,Ws={loadAll:sd,load:ad},Bs=Object.prototype.toString,Hs=Object.prototype.hasOwnProperty,ji=65279,ld=9,Rn=10,cd=13,fd=32,ud=33,dd=34,Ci=35,pd=37,hd=38,md=39,gd=42,Gs=44,bd=45,wr=58,yd=61,wd=62,Ad=63,xd=64,qs=91,Ys=93,Cd=96,zs=123,Od=124,Vs=125,Ie={};Ie[0]="\\0";Ie[7]="\\a";Ie[8]="\\b";Ie[9]="\\t";Ie[10]="\\n";Ie[11]="\\v";Ie[12]="\\f";Ie[13]="\\r";Ie[27]="\\e";Ie[34]='\\"';Ie[92]="\\\\";Ie[133]="\\N";Ie[160]="\\_";Ie[8232]="\\L";Ie[8233]="\\P";var vd=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Ed=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function _d(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&&Hs.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function Sd(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 $e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Ee.repeat("0",r-t.length)+t}var Pd=1,Un=2;function jd(e){this.schema=e.schema||Fs,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ee.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=_d(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==='"'?Un:Pd,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 As(e,t){for(var n=Ee.repeat(" ",t),r=0,i=-1,s="",o,a=e.length;r<a;)i=e.indexOf(`
91
91
  `,r),i===-1?(o=e.slice(r),r=a):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
92
92
  `&&(s+=n),s+=o;return s}function Oi(e,t){return`
93
- `+Ee.repeat(" ",e.indent*t)}function Dd(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 Ar(e){return e===md||e===pd}function Un(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Pi||65536<=e&&e<=1114111}function Cs(e){return Un(e)&&e!==Pi&&e!==hd&&e!==kn}function Os(e,t,n){var r=Cs(e),i=r&&!Ar(e);return(n?r:r&&e!==qs&&e!==Ys&&e!==zs&&e!==Vs&&e!==Ks)&&e!==Ci&&!(t===wr&&!i)||Cs(t)&&!Ar(t)&&e===Ci||t===wr&&i}function Nd(e){return Un(e)&&e!==Pi&&!Ar(e)&&e!==Cd&&e!==Ed&&e!==wr&&e!==qs&&e!==Ys&&e!==zs&&e!==Vs&&e!==Ks&&e!==Ci&&e!==wd&&e!==xd&&e!==gd&&e!==jd&&e!==Od&&e!==vd&&e!==Ad&&e!==yd&&e!==bd&&e!==_d&&e!==Sd}function kd(e){return!Ar(e)&&e!==wr}function Dn(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 Qs(e){var t=/^\n* /;return t.test(e)}var Js=1,vi=2,Xs=3,Zs=4,un=5;function Rd(e,t,n,r,i,s,o,a){var l,c=0,f=null,u=!1,d=!1,p=r!==-1,y=-1,g=Nd(Dn(e,0))&&kd(Dn(e,e.length-1));if(t||o)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Dn(e,l),!Un(c))return un;g=g&&Os(c,f,a),f=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Dn(e,l),c===kn)u=!0,p&&(d=d||l-y-1>r&&e[y+1]!==" ",y=l);else if(!Un(c))return un;g=g&&Os(c,f,a),f=c}d=d||p&&l-y-1>r&&e[y+1]!==" "}return!u&&!d?g&&!o&&!i(e)?Js:s===Rn?un:vi:n>9&&Qs(e)?un:o?s===Rn?un:vi:d?Zs:Xs}function Ud(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Rn?'""':"''";if(!e.noCompatMode&&(Pd.indexOf(t)!==-1||Id.test(t)))return e.quotingType===Rn?'"'+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(c){return Dd(e,c)}switch(Rd(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!r,i)){case Js:return t;case vi:return"'"+t.replace(/'/g,"''")+"'";case Xs:return"|"+vs(t,e.indent)+Es(xs(t,s));case Zs:return">"+vs(t,e.indent)+Es(xs($d(t,o),s));case un:return'"'+Wd(t)+'"';default:throw new $e("impossible error: invalid scalar style")}}()}function vs(e,t){var n=Qs(e)?String(t):"",r=e[e.length-1]===`
93
+ `+Ee.repeat(" ",e.indent*t)}function Md(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 Ar(e){return e===fd||e===ld}function $n(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 xs(e){return $n(e)&&e!==ji&&e!==cd&&e!==Rn}function Cs(e,t,n){var r=xs(e),i=r&&!Ar(e);return(n?r:r&&e!==Gs&&e!==qs&&e!==Ys&&e!==zs&&e!==Vs)&&e!==Ci&&!(t===wr&&!i)||xs(t)&&!Ar(t)&&e===Ci||t===wr&&i}function Id(e){return $n(e)&&e!==ji&&!Ar(e)&&e!==bd&&e!==Ad&&e!==wr&&e!==Gs&&e!==qs&&e!==Ys&&e!==zs&&e!==Vs&&e!==Ci&&e!==hd&&e!==gd&&e!==ud&&e!==Od&&e!==yd&&e!==wd&&e!==md&&e!==dd&&e!==pd&&e!==xd&&e!==Cd}function Fd(e){return!Ar(e)&&e!==wr}function Nn(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 Ks(e){var t=/^\n* /;return t.test(e)}var Qs=1,vi=2,Js=3,Xs=4,dn=5;function Td(e,t,n,r,i,s,o,a){var l,c=0,f=null,u=!1,d=!1,p=r!==-1,b=-1,g=Id(Nn(e,0))&&Fd(Nn(e,e.length-1));if(t||o)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Nn(e,l),!$n(c))return dn;g=g&&Cs(c,f,a),f=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Nn(e,l),c===Rn)u=!0,p&&(d=d||l-b-1>r&&e[b+1]!==" ",b=l);else if(!$n(c))return dn;g=g&&Cs(c,f,a),f=c}d=d||p&&l-b-1>r&&e[b+1]!==" "}return!u&&!d?g&&!o&&!i(e)?Qs:s===Un?dn:vi:n>9&&Ks(e)?dn:o?s===Un?dn:vi:d?Xs:Js}function Ld(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Un?'""':"''";if(!e.noCompatMode&&(vd.indexOf(t)!==-1||Ed.test(t)))return e.quotingType===Un?'"'+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(c){return Md(e,c)}switch(Td(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!r,i)){case Qs:return t;case vi:return"'"+t.replace(/'/g,"''")+"'";case Js:return"|"+Os(t,e.indent)+vs(As(t,s));case Xs:return">"+Os(t,e.indent)+vs(As(Dd(t,o),s));case dn:return'"'+Nd(t)+'"';default:throw new $e("impossible error: invalid scalar style")}}()}function Os(e,t){var n=Ks(e)?String(t):"",r=e[e.length-1]===`
94
94
  `,i=r&&(e[e.length-2]===`
95
95
  `||e===`
96
96
  `),s=i?"+":r?"":"-";return n+s+`
97
- `}function Es(e){return e[e.length-1]===`
98
- `?e.slice(0,-1):e}function $d(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var c=e.indexOf(`
99
- `);return c=c!==-1?c:e.length,n.lastIndex=c,_s(e.slice(0,c),t)}(),i=e[0]===`
97
+ `}function vs(e){return e[e.length-1]===`
98
+ `?e.slice(0,-1):e}function Dd(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var c=e.indexOf(`
99
+ `);return c=c!==-1?c:e.length,n.lastIndex=c,Es(e.slice(0,c),t)}(),i=e[0]===`
100
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
- `:"")+_s(l,t),i=s}return r}function _s(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+=`
101
+ `:"")+Es(l,t),i=s}return r}function Es(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
102
  `+e.slice(i,s),i=s+1),o=a;return l+=`
103
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 Wd(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Dn(e,i),r=Me[n],!r&&Un(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||Fd(n);return t}function Bd(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)),(ut(e,t,a,!1,!1)||typeof a=="undefined"&&ut(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function Ss(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)),(ut(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&ut(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Oi(e,t)),e.dump&&kn===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}function Gd(e,t,n){var r="",i=e.tag,s=Object.keys(n),o,a,l,c,f;for(o=0,a=s.length;o<a;o+=1)f="",r!==""&&(f+=", "),e.condenseFlow&&(f+='"'),l=s[o],c=n[l],e.replacer&&(c=e.replacer.call(n,l,c)),ut(e,t,l,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ut(e,t,c,!1,!1)&&(f+=e.dump,r+=f));e.tag=i,e.dump="{"+r+"}"}function Hd(e,t,n,r){var i="",s=e.tag,o=Object.keys(n),a,l,c,f,u,d;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new $e("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)d="",(!r||i!=="")&&(d+=Oi(e,t)),c=o[a],f=n[c],e.replacer&&(f=e.replacer.call(n,c,f)),ut(e,t+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&kn===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,u&&(d+=Oi(e,t)),ut(e,t+1,f,!0,u)&&(e.dump&&kn===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=s,e.dump=i||"{}"}function js(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(Hs.call(a.represent,l))r=a.represent[l](t,l);else throw new $e("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function ut(e,t,n,r,i,s,o){e.tag=null,e.dump=n,js(e,n,!1)||js(e,n,!0);var a=Gs.call(e.dump),l=r,c;r&&(r=e.flowLevel<0||e.flowLevel>t);var f=a==="[object Object]"||a==="[object Array]",u,d;if(f&&(u=e.duplicates.indexOf(n),d=u!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(i=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),a==="[object Object]")r&&Object.keys(e.dump).length!==0?(Hd(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(Gd(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?Ss(e,t-1,e.dump,i):Ss(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(Bd(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Ud(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new $e("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function qd(e,t){var n=[],r=[],i,s;for(Ei(e,n,r),i=0,s=r.length;i<s;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(s)}function Ei(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)Ei(e[i],t,n);else for(r=Object.keys(e),i=0,s=r.length;i<s;i+=1)Ei(e[r[i]],t,n)}function Yd(e,t){t=t||{};var n=new Ld(t);n.noRefs||qd(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),ut(n,0,r,!0,!0)?n.dump+`
105
- `:""}var zd=Yd,Vd={dump:zd};function Ii(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 ea=Bs.load,_0=Bs.loadAll,ta=Vd.dump;var S0=Ii("safeLoad","load"),j0=Ii("safeLoadAll","loadAll"),P0=Ii("safeDump","dump");import{writeFileSync as Eh}from"fs";import{extname as ka}from"path";import{readFileSync as _h}from"fs";import Sh from"fs";function dt(){}dt.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,c=1,f=a+l,u=[{newPos:-1,components:[]}],d=this.extractCommon(u[0],n,t,0);if(u[0].newPos+1>=a&&d+1>=l)return o([{value:this.join(n),count:n.length}]);function p(){for(var g=-1*c;g<=c;g+=2){var m=void 0,C=u[g-1],O=u[g+1],N=(O?O.newPos:0)-g;C&&(u[g-1]=void 0);var Y=C&&C.newPos+1<a,V=O&&0<=N&&N<l;if(!Y&&!V){u[g]=void 0;continue}if(!Y||V&&C.newPos<O.newPos?(m=Qd(O),s.pushComponent(m.components,void 0,!0)):(m=C,m.newPos++,s.pushComponent(m.components,!0,void 0)),N=s.extractCommon(m,n,t,g),m.newPos+1>=a&&N+1>=l)return o(Kd(s,m.components,n,t,s.useLongestToken));u[g]=m}c++}if(i)(function g(){setTimeout(function(){if(c>f)return i();p()||g()},0)})();else for(;c<=f;){var y=p();if(y)return y}},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,c=0;a+1<s&&l+1<o&&this.equals(n[a+1],r[l+1]);)a++,l++,c++;return c&&t.components.push({count:c}),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 Kd(e,t,n,r,i){for(var s=0,o=t.length,a=0,l=0;s<o;s++){var c=t[s];if(c.removed){if(c.value=e.join(r.slice(l,l+c.count)),l+=c.count,s&&t[s-1].added){var u=t[s-1];t[s-1]=t[s],t[s]=u}}else{if(!c.added&&i){var f=n.slice(a,a+c.count);f=f.map(function(p,y){var g=r[l+y];return g.length>p.length?g:p}),c.value=e.join(f)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(l+=c.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 Qd(e){return{newPos:e.newPos,components:e.components.slice(0)}}var M0=new dt;var na=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,ra=/\S/,ia=new dt;ia.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!ra.test(e)&&!ra.test(t)};ia.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]&&na.test(t[n])&&na.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Ti=new dt;Ti.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 Li(e,t,n){return Ti.diff(e,t,n)}var Jd=new dt;Jd.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Xd=new dt;Xd.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Cr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cr=function(t){return typeof t}:Cr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(e)}var Zd=Object.prototype.toString,mn=new dt;mn.useLongestToken=!0;mn.tokenize=Ti.tokenize;mn.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," ")};mn.equals=function(e,t){return dt.prototype.equals.call(mn,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function oa(e,t,n){return mn.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(Zd.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()),Cr(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 Fi=new dt;Fi.tokenize=function(e){return e.slice()};Fi.join=Fi.removeEmpty=function(e){return e};var $a=ao(Da(),1);async function he({objects:e,selectIdentifier:t,selectDisplayName:n=t,onSyncComplete:r}){let i=e.reduce((a,l)=>{let c=t(l);if(a[c])throw new Error(`Identifier ${c} was not unique.`);return a[c]={id:c,object:l,providerId:c,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}}var wh=gi(yi());function L(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 D(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 me(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 ge(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 ye(e){let t=ka(e);return t===".yaml"||t===".yml"||t===".json"}function ae(e,t,n){let r;if(n&&!t){let i=ka(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=ta(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?Eh(n,r,"utf8"):console.log(r)}function at(e){let t=_h(e,"utf8");return ea(t,{filename:e,json:!0})}async function be({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:r=n}){Ah(e)||xh(e,{recursive:!0});let i=await Ch(e,"utf-8"),s=new Set(i.filter(l=>{let c=vh(l);return c===".json"||c===".yaml"||c===".yml"})),o=l=>Na(e,`${l}.${t}`);async function*a(){for(let l of s){let c=Na(e,l);try{let f=await at(c);yield{id:n(f),displayName:r(f),providerId:c,object:f}}catch(f){throw console.error(wh.default.red(`Failed to read ${c}, data is likely invalid.
106
- ${f==null?void 0:f.message}`)),f}}}return{objects:a(),deleteObject:async l=>{await Oh(l)},writeObject:async l=>{ae(l.object,t,o(l.id))}}}function Ra(e,t){if(!t&&!Sh.existsSync(e))return{};let n=at(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function Ua(e,t){ae(t,void 0,e)}async function le({source:e,target:t,compareContents:n=(a,l)=>(0,$a.default)(a.object,l.object,(c,f,u)=>u==="created"||u==="modified"?!0:void 0),mode:r,allowEmptySource:i=!1,whatIf:s=!1,log:o=()=>{}}){var a,l;let c=new Map;for await(let d of t.objects)c.set(d.id,d);let f=[],u=!1;for await(let d of e.objects){u=!0;let p=d.id,y=c.get(p);if(y){if(!n(d,y)&&(r==="createOrUpdate"||r==="mirror")){let g=async(m,C)=>{var O;if(!s)try{await t.writeObject(m,C)}catch(N){throw new Fr(N,m)}o({action:"update",id:p,providerId:m.providerId,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:oa(C.object,m.object)})};f.push(g(d,y))}c.delete(p)}else{let g=async(m,C)=>{var O;if(!s)try{await t.writeObject(m)}catch(N){throw new Fr(N,m)}o({action:"create",id:C,providerId:C,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:Li("",JSON.stringify(m.object,null,2))})};f.push(g(d,p))}}if(await Promise.all(f),r==="mirror"){if(!u&&!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=[];c.forEach(async p=>{let y=async g=>{var m;if(!s)try{await t.deleteObject(g.providerId)}catch(C){throw new Fr(C,g)}o({action:"delete",id:g.id,providerId:g.providerId,displayName:(m=g.displayName)!=null?m:g.providerId,whatIf:s,diff:Li(JSON.stringify(g.object,null,2),"")})};d.push(y(p))}),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 Fr=class extends Error{constructor(e,t){var n;super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
107
- ${e}`),this.stack=void 0,Object.setPrototypeOf(this,Fr.prototype)}},wn=gi(yi());function ce(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=wn.default.green("[A]");break;case"update":l=wn.default.white("[U]");break;case"delete":l=wn.default.yellow("[D]");break}let c="";(t==="on"||t==="update"&&i==="update")&&(c=`
108
- `+a.map(f=>f.added?wn.default.green(f.value):f.removed?wn.default.red(f.value):f.value).join("")),console.log(`${n!=null?n:""}${o?wn.default.gray("[WHATIF]"):""}${l}${r!=null?r:""} ${s}${c}`)}}var Wa=async e=>await e(),St=class extends Error{constructor(n,r,i,s,o,a){super(`${n}
109
- ${s}${o?" "+o:""} (${r} ${i}${a?` Request ID: ${a}`:""})`);this.errorMessage=n;this.fetchMethod=r;this.fetchUri=i;this.statusCode=s;this.statusText=o;this.requestId=a;Object.setPrototypeOf(this,St.prototype)}};var Fe=class{constructor(t){lo(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:Wa}}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 St(o,(s=n==null?void 0:n.method)!=null?s:"GET",t.toString(),i.status,i.statusText,Fe.getRequestId(i))}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}static getRequestId(t){let n=t.headers.get("x-nf-request-id");if(n)return n}};var An,Hn=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(Hn,An),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(oe(Hn,An));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(oe(Hn,An));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},De=Hn;An=new WeakMap,He(De,An,"/api/v2/aggregate");var Ba={command:"get <id>",describe:"Fetch an aggregate",builder:e=>me(L(D(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 De({apiKey:t,apiHost:e,fetch:jh,projectId:i}).get({aggregateId:n});a.aggregates.length===0?(console.error("Aggregate did not exist"),process.exit(1)):ae(a.aggregates[0],r,s)}};import Ph from"isomorphic-unfetch";var Ga={command:"list",describe:"List aggregates",aliases:["ls"],builder:e=>me(L(D(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new De({apiKey:t,apiHost:e,fetch:Ph,projectId:i}).get({});ae(o.aggregates,n,r)}};import Mh from"isomorphic-unfetch";var jt=e=>e.id,Pt=e=>`${e.name} (pid: ${e.id})`;function we(e,t){return Ra(e,t)}function lt(e,t){Ua(e,t)}import Ih from"p-limit";var Ae=Ih(8);function Tr({client:e,type:t}){async function*n(){let i=(await e.get({type:t})).aggregates;for await(let s of i)yield{id:jt(s),displayName:Pt(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 Ha={command:"pull <directory>",describe:"Pulls all aggregates to local files in a directory",builder:e=>L(D(ge(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 De({apiKey:t,apiHost:e,fetch:Mh,projectId:o,limitPolicy:Ae}),c=Tr({client:l}),f;if(ye(n)){let p=we(n,!1);f=await he({objects:(d=p.aggregates)!=null?d:[],selectIdentifier:jt,selectDisplayName:Pt,onSyncComplete:async(y,g)=>{p.aggregates=g,lt(n,p)}})}else f=await be({directory:n,selectIdentifier:jt,selectDisplayName:Pt,format:r});await le({source:c,target:f,mode:i,whatIf:s,log:ce({diffMode:a})})}};import Fh from"isomorphic-unfetch";var qa={command:"push <directory>",describe:"Pushes all aggregates from files in a directory or package to Uniform",builder:e=>L(D(ge(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 u;let a=new De({apiKey:t,apiHost:e,fetch:Fh,projectId:s,limitPolicy:Ae}),l;if(ye(n)){let d=we(n,!0);l=await he({objects:(u=d.aggregates)!=null?u:[],selectIdentifier:jt,selectDisplayName:Pt})}else l=await be({directory:n,selectIdentifier:jt,selectDisplayName:Pt});let f=Tr({client:a});await le({source:l,target:f,mode:r,whatIf:i,log:ce({diffMode:o})}),await f.complete()}};import Th from"isomorphic-unfetch";var Ya={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an aggregate",builder:e=>L(D(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new De({apiKey:t,apiHost:e,fetch:Th,projectId:r}).remove({aggregateId:n})}};import Lh from"isomorphic-unfetch";var za={command:"update <filename>",aliases:["put"],describe:"Insert or update an aggregate",builder:e=>L(D(e.positional("filename",{demandOption:!0,describe:"Aggregate file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new De({apiKey:t,apiHost:e,fetch:Lh,projectId:r}),s=at(n);await i.upsert({aggregate:s})}};var Va={command:"aggregate <command>",aliases:["agg","intent","audience"],describe:"Commands for Context aggregates (intents, audiences)",builder:e=>e.command(Ha).command(qa).command(Ba).command(Ya).command(Ga).command(za).demandCommand(),handler:()=>{Ue.help()}};import Dh from"isomorphic-unfetch";var xn,qn,rn=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(rn,xn),{...t,projectId:n});return await this.apiClient(r)}async upsertCategory(t){let n=this.createUrl(oe(rn,xn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(t){let n=this.createUrl(oe(rn,xn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(t){let n=this.createUrl(oe(rn,qn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(t){let n=this.createUrl(oe(rn,qn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Be=rn;xn=new WeakMap,qn=new WeakMap,He(Be,xn,"/api/v1/enrichments"),He(Be,qn,"/api/v1/enrichment-values");var Ka={command:"get <id>",describe:"Fetch an enrichment category and its values",builder:e=>me(L(D(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,c;let a=(c=(l=await new Be({apiKey:t,apiHost:e,fetch:Dh,projectId:i}).get())==null?void 0:l.enrichments)==null?void 0:c.filter(f=>f.id===n);a.length===0?(console.error("Enrichment did not exist"),process.exit(1)):ae(a[0],r,s)}};import Nh from"isomorphic-unfetch";var Qa={command:"list",describe:"List enrichments",aliases:["ls"],builder:e=>me(L(D(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Be({apiKey:t,apiHost:e,fetch:Nh,projectId:i}).get();ae(o.enrichments,n,r)}};import kh from"isomorphic-unfetch";var It=e=>e.id,Mt=e=>`${e.name} (pid: ${e.id})`;function Lr({client:e}){async function*t(){let n=(await e.get()).enrichments;for await(let r of n)yield{id:It(r),displayName:Mt(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=Ja({categoryId:n.id,values:n.object.values}),s=Ja({categoryId:n.id,values:(a=(o=r==null?void 0:r.object)==null?void 0:o.values)!=null?a:[],client:e});await le({source:i,target:s,mode:"mirror",whatIf:!1,log:ce({diffMode:"off",prefix:` ${n.displayName} value`,indent:"> "})})}}}var Ja=({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 Xa={command:"pull <directory>",describe:"Pulls all enrichments to local files in a directory",builder:e=>L(D(ge(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 Be({apiKey:t,apiHost:e,fetch:kh,projectId:o,limitPolicy:Ae}),c=Lr({client:l}),f;if(ye(n)){let p=we(n,!1);f=await he({objects:(d=p.enrichments)!=null?d:[],selectIdentifier:It,selectDisplayName:Mt,onSyncComplete:async(y,g)=>{p.enrichments=g,lt(n,p)}})}else f=await be({directory:n,selectIdentifier:It,selectDisplayName:Mt,format:r});await le({source:c,target:f,mode:i,whatIf:s,log:ce({diffMode:a})})}};import Rh from"isomorphic-unfetch";var Za={command:"push <directory>",describe:"Pushes all enrichments from files in a directory or package to Uniform",builder:e=>L(D(ge(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 u;let a=new Be({apiKey:t,apiHost:e,fetch:Rh,projectId:s,limitPolicy:Ae}),l;if(ye(n)){let d=we(n,!0);l=await he({objects:(u=d.enrichments)!=null?u:[],selectIdentifier:It,selectDisplayName:Mt})}else l=await be({directory:n,selectIdentifier:It,selectDisplayName:Mt});let f=Lr({client:a});await le({source:l,target:f,mode:r,whatIf:i,log:ce({diffMode:o})})}};import Uh from"isomorphic-unfetch";var el={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an enrichment category and its values",builder:e=>L(D(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Be({apiKey:t,apiHost:e,fetch:Uh,projectId:r}).removeCategory({enrichmentId:n})}};var tl={command:"enrichment <command>",aliases:["enr"],describe:"Commands for Context enrichments",builder:e=>e.command(Xa).command(Za).command(Ka).command(el).command(Qa).demandCommand(),handler:()=>{Ue.help()}};var Kn=ao(Ll());import{writeFile as fm}from"fs";import um from"isomorphic-unfetch";import{exit as oo}from"process";var Wr,io=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(io,Wr),{...t,projectId:n});return await this.apiClient(r)}},Vn=io;Wr=new WeakMap,He(Vn,Wr,"/api/v2/manifest");var Dl={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(Kn.default.red("You must specify the project ID")),oo(1));let i=dm(),s=new Vn({apiHost:i,projectId:n,apiKey:e,fetch:um});try{let o=await s.get({preview:r}),a=JSON.stringify(o,null,2);t?fm(t,a,l=>{l&&(console.error(`Error writing file to ${t}
110
- `,l),oo(1)),console.log(Kn.default.green(`\u2705 ${t} has been updated from ${i}`))}):console.log(a)}catch(o){let a;o instanceof St?(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(Kn.default.red("\u26A0 Error fetching Context manifest")),console.error(Kn.default.gray(` \u2757 ${a}`)),oo(1)}}},dm=()=>process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app";var Nl={command:"manifest <command>",describe:"Commands for context manifests",aliases:["man"],builder:e=>e.command(Dl).demandCommand(),handler:()=>{Ue.help()}};import pm from"isomorphic-unfetch";var _n,Qn=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(Qn,_n),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(oe(Qn,_n));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(oe(Qn,_n));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Ne=Qn;_n=new WeakMap,He(Ne,_n,"/api/v2/quirk");var kl={command:"get <id>",describe:"Fetch a quirk",builder:e=>me(L(D(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 Ne({apiKey:t,apiHost:e,fetch:pm,projectId:i}).get({quirkId:n,withIntegrations:!0});a.quirks.length===0?(console.error("Quirk did not exist"),process.exit(1)):ae(a.quirks[0],r,s)}};import hm from"isomorphic-unfetch";var Rl={command:"list",describe:"List quirks",aliases:["ls"],builder:e=>me(L(D(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 Ne({apiKey:t,apiHost:e,fetch:hm,projectId:i}).get({withIntegrations:s});ae(a.quirks,n,r)}};import mm from"isomorphic-unfetch";var Tt=e=>e.id,Lt=e=>`${e.name} (pid: ${e.id})`;function Br({client:e}){async function*t(){let n=(await e.get({withIntegrations:!1})).quirks;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.remove({quirkId:n})},writeObject:async n=>{await e.upsert({quirk:n.object})}}}var Ul={command:"pull <directory>",describe:"Pulls all quirks to local files in a directory",builder:e=>L(D(ge(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 Ne({apiKey:t,apiHost:e,fetch:mm,projectId:o,limitPolicy:Ae}),c=Br({client:l}),f;if(ye(n)){let p=we(n,!1);f=await he({objects:(d=p.quirks)!=null?d:[],selectIdentifier:Tt,selectDisplayName:Lt,onSyncComplete:async(y,g)=>{p.quirks=g,lt(n,p)}})}else f=await be({directory:n,selectIdentifier:Tt,selectDisplayName:Lt,format:r});await le({source:c,target:f,mode:i,whatIf:s,log:ce({diffMode:a})})}};import gm from"isomorphic-unfetch";var $l={command:"push <directory>",describe:"Pushes all quirks from files in a directory or package to Uniform",builder:e=>L(D(ge(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 u;let a=new Ne({apiKey:t,apiHost:e,fetch:gm,projectId:s,limitPolicy:Ae}),l;if(ye(n)){let d=we(n,!0);l=await he({objects:(u=d.quirks)!=null?u:[],selectIdentifier:Tt,selectDisplayName:Lt})}else l=await be({directory:n,selectIdentifier:Tt,selectDisplayName:Lt});let f=Br({client:a});await le({source:l,target:f,mode:r,whatIf:i,log:ce({diffMode:o})})}};import ym from"isomorphic-unfetch";var Wl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a quirk",builder:e=>L(D(e.positional("id",{demandOption:!0,describe:"Quirk public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Ne({apiKey:t,apiHost:e,fetch:ym,projectId:r}).remove({quirkId:n})}};import bm from"isomorphic-unfetch";var Bl={command:"update <filename>",aliases:["put"],describe:"Insert or update a quirk",builder:e=>L(D(e.positional("filename",{demandOption:!0,describe:"Quirk file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new Ne({apiKey:t,apiHost:e,fetch:bm,projectId:r}),s=at(n);await i.upsert({quirk:s})}};var Gl={command:"quirk <command>",aliases:["qk"],describe:"Commands for Context quirks",builder:e=>e.command(Ul).command($l).command(kl).command(Wl).command(Rl).command(Bl).demandCommand(),handler:()=>{Ue.help()}};import wm from"isomorphic-unfetch";var Sn,Jn=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(Jn,Sn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(oe(Jn,Sn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(oe(Jn,Sn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},ke=Jn;Sn=new WeakMap,He(ke,Sn,"/api/v2/signal");var Hl={command:"get <id>",describe:"Fetch a signal",builder:e=>me(L(D(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 ke({apiKey:t,apiHost:e,fetch:wm,projectId:i}).get({signalId:n});a.signals.length===0?(console.error("Signal did not exist"),process.exit(1)):ae(a.signals[0],r,s)}};import Am from"isomorphic-unfetch";var ql={command:"list",describe:"List signals",aliases:["ls"],builder:e=>me(L(D(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new ke({apiKey:t,apiHost:e,fetch:Am,projectId:i}).get();ae(o.signals,n,r)}};import xm from"isomorphic-unfetch";var Dt=e=>e.id,Nt=e=>`${e.name} (pid: ${e.id})`;function Gr({client:e}){async function*t(){let n=(await e.get()).signals;for await(let r of n)yield{id:Dt(r),displayName:Nt(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 Yl={command:"pull <directory>",describe:"Pulls all signals to local files in a directory",builder:e=>L(D(ge(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 ke({apiKey:t,apiHost:e,fetch:xm,projectId:o,limitPolicy:Ae}),c=Gr({client:l}),f;if(ye(n)){let p=we(n,!1);f=await he({objects:(d=p.signals)!=null?d:[],selectIdentifier:Dt,selectDisplayName:Nt,onSyncComplete:async(y,g)=>{p.signals=g,lt(n,p)}})}else f=await be({directory:n,selectIdentifier:Dt,selectDisplayName:Nt,format:r});await le({source:c,target:f,mode:i,whatIf:s,log:ce({diffMode:a})})}};import Cm from"isomorphic-unfetch";var zl={command:"push <directory>",describe:"Pushes all signals from files in a directory or package to Uniform",builder:e=>L(D(ge(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 u;let a=new ke({apiKey:t,apiHost:e,fetch:Cm,projectId:s,limitPolicy:Ae}),l;if(ye(n)){let d=we(n,!0);l=await he({objects:(u=d.signals)!=null?u:[],selectIdentifier:Dt,selectDisplayName:Nt})}else l=await be({directory:n,selectIdentifier:Dt,selectDisplayName:Nt});let f=Gr({client:a});await le({source:l,target:f,mode:r,whatIf:i,log:ce({diffMode:o})})}};import Om from"isomorphic-unfetch";var Vl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a signal",builder:e=>L(D(e.positional("id",{demandOption:!0,describe:"Signal public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new ke({apiKey:t,apiHost:e,fetch:Om,projectId:r}).remove({signalId:n})}};import vm from"isomorphic-unfetch";var Kl={command:"update <filename>",aliases:["put"],describe:"Insert or update a signal",builder:e=>L(D(e.positional("filename",{demandOption:!0,describe:"Signal file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new ke({apiKey:t,apiHost:e,fetch:vm,projectId:r}),s=at(n);await i.upsert({signal:s})}};var Ql={command:"signal <command>",aliases:["sig"],describe:"Commands for Context signals",builder:e=>e.command(Yl).command(zl).command(Hl).command(Vl).command(ql).command(Kl).demandCommand(),handler:()=>{Ue.help()}};import Em from"isomorphic-unfetch";var jn,Xn=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(Xn,jn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(oe(Xn,jn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(oe(Xn,jn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Re=Xn;jn=new WeakMap,He(Re,jn,"/api/v2/test");var Jl={command:"get <id>",describe:"Fetch a test",builder:e=>me(L(D(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 Re({apiKey:t,apiHost:e,fetch:Em,projectId:i}).get({testId:n});a.tests.length===0?(console.error("Test did not exist"),process.exit(1)):ae(a.tests[0],r,s)}};import _m from"isomorphic-unfetch";var Xl={command:"list",describe:"List tests",aliases:["ls"],builder:e=>me(L(D(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Re({apiKey:t,apiHost:e,fetch:_m,projectId:i}).get();ae(o.tests,n,r)}};import Sm from"isomorphic-unfetch";var kt=e=>e.id,Rt=e=>`${e.name} (pid: ${e.id})`;function Hr({client:e}){async function*t(){let n=(await e.get()).tests;for await(let r of n)yield{id:kt(r),displayName:Rt(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 Zl={command:"pull <directory>",describe:"Pulls all tests to local files in a directory",builder:e=>L(D(ge(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 Re({apiKey:t,apiHost:e,fetch:Sm,projectId:o,limitPolicy:Ae}),c=Hr({client:l}),f;if(ye(n)){let p=we(n,!1);f=await he({objects:(d=p.tests)!=null?d:[],selectIdentifier:kt,selectDisplayName:Rt,onSyncComplete:async(y,g)=>{p.tests=g,lt(n,p)}})}else f=await be({directory:n,selectIdentifier:kt,selectDisplayName:Rt,format:r});await le({source:c,target:f,mode:i,whatIf:s,log:ce({diffMode:a})})}};import jm from"isomorphic-unfetch";var ec={command:"push <directory>",describe:"Pushes all tests from files in a directory or package to Uniform",builder:e=>L(D(ge(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 u;let a=new Re({apiKey:t,apiHost:e,fetch:jm,projectId:s,limitPolicy:Ae}),l;if(ye(n)){let d=we(n,!0);l=await he({objects:(u=d.tests)!=null?u:[],selectIdentifier:kt,selectDisplayName:Rt})}else l=await be({directory:n,selectIdentifier:kt,selectDisplayName:Rt});let f=Hr({client:a});await le({source:l,target:f,mode:r,whatIf:i,log:ce({diffMode:o})})}};import Pm from"isomorphic-unfetch";var tc={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a test",builder:e=>L(D(e.positional("id",{demandOption:!0,describe:"Test public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Re({apiKey:t,apiHost:e,fetch:Pm,projectId:r}).remove({testId:n})}};import Im from"isomorphic-unfetch";var nc={command:"update <filename>",aliases:["put"],describe:"Insert or update a test",builder:e=>L(D(e.positional("filename",{demandOption:!0,describe:"Test file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new Re({apiKey:t,apiHost:e,fetch:Im,projectId:r}),s=at(n);await i.upsert({test:s})}};var rc={command:"test <command>",describe:"Commands for Context A/B tests",builder:e=>e.command(Zl).command(ec).command(Jl).command(tc).command(Xl).command(nc).demandCommand(),handler:()=>{Ue.help()}};var xx={commands:[{command:"context <command>",aliases:["ctx"],describe:"Uniform Context commands",builder:e=>e.command(Nl).command(Ql).command(tl).command(Va).command(Gl).command(rc).demandCommand(),handler:()=>{Ue.showHelp()}}]};export{we as readContextPackage,xx as uniformCLI,lt as writeContextPackage};
104
+ `+e.slice(o+1):l+=e.slice(i),l.slice(1)}function Nd(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Nn(e,i),r=Ie[n],!r&&$n(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||Sd(n);return t}function kd(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)),(dt(e,t,a,!1,!1)||typeof a=="undefined"&&dt(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function _s(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)),(dt(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&dt(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Oi(e,t)),e.dump&&Rn===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}function Rd(e,t,n){var r="",i=e.tag,s=Object.keys(n),o,a,l,c,f;for(o=0,a=s.length;o<a;o+=1)f="",r!==""&&(f+=", "),e.condenseFlow&&(f+='"'),l=s[o],c=n[l],e.replacer&&(c=e.replacer.call(n,l,c)),dt(e,t,l,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),dt(e,t,c,!1,!1)&&(f+=e.dump,r+=f));e.tag=i,e.dump="{"+r+"}"}function Ud(e,t,n,r){var i="",s=e.tag,o=Object.keys(n),a,l,c,f,u,d;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new $e("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)d="",(!r||i!=="")&&(d+=Oi(e,t)),c=o[a],f=n[c],e.replacer&&(f=e.replacer.call(n,c,f)),dt(e,t+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&Rn===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,u&&(d+=Oi(e,t)),dt(e,t+1,f,!0,u)&&(e.dump&&Rn===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=s,e.dump=i||"{}"}function Ss(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,Bs.call(a.represent)==="[object Function]")r=a.represent(t,l);else if(Hs.call(a.represent,l))r=a.represent[l](t,l);else throw new $e("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function dt(e,t,n,r,i,s,o){e.tag=null,e.dump=n,Ss(e,n,!1)||Ss(e,n,!0);var a=Bs.call(e.dump),l=r,c;r&&(r=e.flowLevel<0||e.flowLevel>t);var f=a==="[object Object]"||a==="[object Array]",u,d;if(f&&(u=e.duplicates.indexOf(n),d=u!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(i=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),a==="[object Object]")r&&Object.keys(e.dump).length!==0?(Ud(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(Rd(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?_s(e,t-1,e.dump,i):_s(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(kd(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Ld(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new $e("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function $d(e,t){var n=[],r=[],i,s;for(Ei(e,n,r),i=0,s=r.length;i<s;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(s)}function Ei(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)Ei(e[i],t,n);else for(r=Object.keys(e),i=0,s=r.length;i<s;i+=1)Ei(e[r[i]],t,n)}function Wd(e,t){t=t||{};var n=new jd(t);n.noRefs||$d(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),dt(n,0,r,!0,!0)?n.dump+`
105
+ `:""}var Bd=Wd,Hd={dump:Bd};function Mi(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 Zs=Ws.load,O0=Ws.loadAll,ea=Hd.dump;var v0=Mi("safeLoad","load"),E0=Mi("safeLoadAll","loadAll"),_0=Mi("safeDump","dump");import{writeFileSync as Ah}from"fs";import{extname as Na}from"path";import{readFileSync as xh}from"fs";import Ch from"fs";function pt(){}pt.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,c=1,f=a+l;r.maxEditLength&&(f=Math.min(f,r.maxEditLength));var u=[{newPos:-1,components:[]}],d=this.extractCommon(u[0],n,t,0);if(u[0].newPos+1>=a&&d+1>=l)return o([{value:this.join(n),count:n.length}]);function p(){for(var g=-1*c;g<=c;g+=2){var m=void 0,C=u[g-1],O=u[g+1],N=(O?O.newPos:0)-g;C&&(u[g-1]=void 0);var Y=C&&C.newPos+1<a,V=O&&0<=N&&N<l;if(!Y&&!V){u[g]=void 0;continue}if(!Y||V&&C.newPos<O.newPos?(m=qd(O),s.pushComponent(m.components,void 0,!0)):(m=C,m.newPos++,s.pushComponent(m.components,!0,void 0)),N=s.extractCommon(m,n,t,g),m.newPos+1>=a&&N+1>=l)return o(Gd(s,m.components,n,t,s.useLongestToken));u[g]=m}c++}if(i)(function g(){setTimeout(function(){if(c>f)return i();p()||g()},0)})();else for(;c<=f;){var b=p();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,c=0;a+1<s&&l+1<o&&this.equals(n[a+1],r[l+1]);)a++,l++,c++;return c&&t.components.push({count:c}),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 Gd(e,t,n,r,i){for(var s=0,o=t.length,a=0,l=0;s<o;s++){var c=t[s];if(c.removed){if(c.value=e.join(r.slice(l,l+c.count)),l+=c.count,s&&t[s-1].added){var u=t[s-1];t[s-1]=t[s],t[s]=u}}else{if(!c.added&&i){var f=n.slice(a,a+c.count);f=f.map(function(p,b){var g=r[l+b];return g.length>p.length?g:p}),c.value=e.join(f)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(l+=c.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 qd(e){return{newPos:e.newPos,components:e.components.slice(0)}}var P0=new pt;var ta=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,na=/\S/,ra=new pt;ra.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!na.test(e)&&!na.test(t)};ra.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]&&ta.test(t[n])&&ta.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Ti=new pt;Ti.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 Li(e,t,n){return Ti.diff(e,t,n)}var Yd=new pt;Yd.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var zd=new pt;zd.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Cr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cr=function(t){return typeof t}:Cr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(e)}var Vd=Object.prototype.toString,gn=new pt;gn.useLongestToken=!0;gn.tokenize=Ti.tokenize;gn.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(Ii(e,null,null,i),i," ")};gn.equals=function(e,t){return pt.prototype.equals.call(gn,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function ia(e,t,n){return gn.diff(e,t,n)}function Ii(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(Vd.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]=Ii(e[s],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),Cr(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]=Ii(e[l],t,n,r,l);t.pop(),n.pop()}else o=e;return o}var Fi=new pt;Fi.tokenize=function(e){return e.slice()};Fi.join=Fi.removeEmpty=function(e){return e};var Ua=zr(La(),1);async function he({objects:e,selectIdentifier:t,selectDisplayName:n=t,onSyncComplete:r}){let i=e.reduce((a,l)=>{let c=t(l);if(a[c])throw new Error(`Identifier ${c} was not unique.`);return a[c]={id:c,object:l,providerId:c,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}}var hh=gi(bi());function F(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 T(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 me(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 ge(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 be(e){let t=Na(e);return t===".yaml"||t===".yml"||t===".json"}function ae(e,t,n){let r;if(n&&!t){let i=Na(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=ea(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?Ah(n,r,"utf8"):console.log(r)}function at(e){let t=xh(e,"utf8");return Zs(t,{filename:e,json:!0})}async function ye({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:r=n}){mh(e)||gh(e,{recursive:!0});let i=await bh(e,"utf-8"),s=new Set(i.filter(l=>{let c=wh(l);return c===".json"||c===".yaml"||c===".yml"})),o=l=>Da(e,`${l}.${t}`);async function*a(){for(let l of s){let c=Da(e,l);try{let f=await at(c);yield{id:n(f),displayName:r(f),providerId:c,object:f}}catch(f){throw console.error(hh.default.red(`Failed to read ${c}, data is likely invalid.
106
+ ${f==null?void 0:f.message}`)),f}}}return{objects:a(),deleteObject:async l=>{await yh(l)},writeObject:async l=>{ae(l.object,t,o(l.id))}}}function ka(e,t){if(!t&&!Ch.existsSync(e))return{};let n=at(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function Ra(e,t){ae(t,void 0,e)}async function le({source:e,target:t,compareContents:n=(a,l)=>(0,Ua.default)(a.object,l.object,(c,f,u)=>u==="created"||u==="modified"?!0:void 0),mode:r,allowEmptySource:i=!1,whatIf:s=!1,log:o=()=>{}}){var a,l;let c=new Map;for await(let d of t.objects)c.set(d.id,d);let f=[],u=!1;for await(let d of e.objects){u=!0;let p=d.id,b=c.get(p);if(b){if(!n(d,b)&&(r==="createOrUpdate"||r==="mirror")){let g=async(m,C)=>{var O;if(!s)try{await t.writeObject(m,C)}catch(N){throw new Fr(N,m)}o({action:"update",id:p,providerId:m.providerId,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:ia(C.object,m.object)})};f.push(g(d,b))}c.delete(p)}else{let g=async(m,C)=>{var O;if(!s)try{await t.writeObject(m)}catch(N){throw new Fr(N,m)}o({action:"create",id:C,providerId:C,displayName:(O=m.displayName)!=null?O:m.providerId,whatIf:s,diff:Li("",JSON.stringify(m.object,null,2))})};f.push(g(d,p))}}if(await Promise.all(f),r==="mirror"){if(!u&&!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=[];c.forEach(async p=>{let b=async g=>{var m;if(!s)try{await t.deleteObject(g.providerId)}catch(C){throw new Fr(C,g)}o({action:"delete",id:g.id,providerId:g.providerId,displayName:(m=g.displayName)!=null?m:g.providerId,whatIf:s,diff:Li(JSON.stringify(g.object,null,2),"")})};d.push(b(p))}),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 Fr=class extends Error{constructor(e,t){var n;super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
107
+ ${e}`),this.stack=void 0,Object.setPrototypeOf(this,Fr.prototype)}},An=gi(bi());function ce(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=An.default.green("[A]");break;case"update":l=An.default.white("[U]");break;case"delete":l=An.default.yellow("[D]");break}let c="";(t==="on"||t==="update"&&i==="update")&&(c=`
108
+ `+a.map(f=>f.added?An.default.green(f.value):f.removed?An.default.red(f.value):f.value).join("")),console.log(`${n!=null?n:""}${o?An.default.gray("[WHATIF]"):""}${l}${r!=null?r:""} ${s}${c}`)}}var $a=async e=>await e(),lt=class extends Error{constructor(n,r,i,s,o,a){super(`${n}
109
+ ${s}${o?" "+o:""} (${r} ${i}${a?` Request ID: ${a}`:""})`);this.errorMessage=n;this.fetchMethod=r;this.fetchUri=i;this.statusCode=s;this.statusText=o;this.requestId=a;Object.setPrototypeOf(this,lt.prototype)}};var Fe=class{constructor(t){co(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:$a}}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 lt(o,(s=n==null?void 0:n.method)!=null?s:"GET",t.toString(),i.status,i.statusText,Fe.getRequestId(i))}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}static getRequestId(t){let n=t.headers.get("x-nf-request-id");if(n)return n}};var xn,qn=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(qn,xn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(oe(qn,xn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(oe(qn,xn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},De=qn;xn=new WeakMap,Ge(De,xn,"/api/v2/aggregate");var Wa={command:"get <id>",describe:"Fetch an aggregate",builder:e=>me(F(T(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 De({apiKey:t,apiHost:e,fetch:Oh,projectId:i}).get({aggregateId:n});a.aggregates.length===0?(console.error("Aggregate did not exist"),process.exit(1)):ae(a.aggregates[0],r,s)}};import vh from"isomorphic-unfetch";var Ba={command:"list",describe:"List aggregates",aliases:["ls"],builder:e=>me(F(T(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new De({apiKey:t,apiHost:e,fetch:vh,projectId:i}).get({});ae(o.aggregates,n,r)}};import _h from"isomorphic-unfetch";var Pt=e=>e.id,jt=e=>`${e.name} (pid: ${e.id})`;function we(e,t){return ka(e,t)}function ct(e,t){Ra(e,t)}import Eh from"p-limit";var Ae=Eh(8);function Tr({client:e,type:t}){async function*n(){let i=(await e.get({type:t})).aggregates;for await(let s of i)yield{id:Pt(s),displayName:jt(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 Ha={command:"pull <directory>",describe:"Pulls all aggregates to local files in a directory",builder:e=>F(T(ge(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 De({apiKey:t,apiHost:e,fetch:_h,projectId:o,limitPolicy:Ae}),c=Tr({client:l}),f;if(be(n)){let p=we(n,!1);f=await he({objects:(d=p.aggregates)!=null?d:[],selectIdentifier:Pt,selectDisplayName:jt,onSyncComplete:async(b,g)=>{p.aggregates=g,ct(n,p)}})}else f=await ye({directory:n,selectIdentifier:Pt,selectDisplayName:jt,format:r});await le({source:c,target:f,mode:i,whatIf:s,log:ce({diffMode:a})})}};import Sh from"isomorphic-unfetch";var Ga={command:"push <directory>",describe:"Pushes all aggregates from files in a directory or package to Uniform",builder:e=>F(T(ge(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 u;let a=new De({apiKey:t,apiHost:e,fetch:Sh,projectId:s,limitPolicy:Ae}),l;if(be(n)){let d=we(n,!0);l=await he({objects:(u=d.aggregates)!=null?u:[],selectIdentifier:Pt,selectDisplayName:jt})}else l=await ye({directory:n,selectIdentifier:Pt,selectDisplayName:jt});let f=Tr({client:a});await le({source:l,target:f,mode:r,whatIf:i,log:ce({diffMode:o})}),await f.complete()}};import Ph from"isomorphic-unfetch";var qa={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an aggregate",builder:e=>F(T(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new De({apiKey:t,apiHost:e,fetch:Ph,projectId:r}).remove({aggregateId:n})}};import jh from"isomorphic-unfetch";var Ya={command:"update <filename>",aliases:["put"],describe:"Insert or update an aggregate",builder:e=>F(T(e.positional("filename",{demandOption:!0,describe:"Aggregate file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new De({apiKey:t,apiHost:e,fetch:jh,projectId:r}),s=at(n);await i.upsert({aggregate:s})}};var za={command:"aggregate <command>",aliases:["agg","intent","audience"],describe:"Commands for Context aggregates (intents, audiences)",builder:e=>e.command(Ha).command(Ga).command(Wa).command(qa).command(Ba).command(Ya).demandCommand(),handler:()=>{Ue.help()}};import Mh from"isomorphic-unfetch";var Cn,Yn,rn=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(rn,Cn),{...t,projectId:n});return await this.apiClient(r)}async upsertCategory(t){let n=this.createUrl(oe(rn,Cn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(t){let n=this.createUrl(oe(rn,Cn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(t){let n=this.createUrl(oe(rn,Yn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(t){let n=this.createUrl(oe(rn,Yn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Be=rn;Cn=new WeakMap,Yn=new WeakMap,Ge(Be,Cn,"/api/v1/enrichments"),Ge(Be,Yn,"/api/v1/enrichment-values");var Va={command:"get <id>",describe:"Fetch an enrichment category and its values",builder:e=>me(F(T(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,c;let a=(c=(l=await new Be({apiKey:t,apiHost:e,fetch:Mh,projectId:i}).get())==null?void 0:l.enrichments)==null?void 0:c.filter(f=>f.id===n);a.length===0?(console.error("Enrichment did not exist"),process.exit(1)):ae(a[0],r,s)}};import Ih from"isomorphic-unfetch";var Ka={command:"list",describe:"List enrichments",aliases:["ls"],builder:e=>me(F(T(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Be({apiKey:t,apiHost:e,fetch:Ih,projectId:i}).get();ae(o.enrichments,n,r)}};import Fh from"isomorphic-unfetch";var Mt=e=>e.id,It=e=>`${e.name} (pid: ${e.id})`;function Lr({client:e}){async function*t(){let n=(await e.get()).enrichments;for await(let r of n)yield{id:Mt(r),displayName:It(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=Qa({categoryId:n.id,values:n.object.values}),s=Qa({categoryId:n.id,values:(a=(o=r==null?void 0:r.object)==null?void 0:o.values)!=null?a:[],client:e});await le({source:i,target:s,mode:"mirror",whatIf:!1,log:ce({diffMode:"off",prefix:` ${n.displayName} value`,indent:"> "})})}}}var Qa=({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 Ja={command:"pull <directory>",describe:"Pulls all enrichments to local files in a directory",builder:e=>F(T(ge(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 Be({apiKey:t,apiHost:e,fetch:Fh,projectId:o,limitPolicy:Ae}),c=Lr({client:l}),f;if(be(n)){let p=we(n,!1);f=await he({objects:(d=p.enrichments)!=null?d:[],selectIdentifier:Mt,selectDisplayName:It,onSyncComplete:async(b,g)=>{p.enrichments=g,ct(n,p)}})}else f=await ye({directory:n,selectIdentifier:Mt,selectDisplayName:It,format:r});await le({source:c,target:f,mode:i,whatIf:s,log:ce({diffMode:a})})}};import Th from"isomorphic-unfetch";var Xa={command:"push <directory>",describe:"Pushes all enrichments from files in a directory or package to Uniform",builder:e=>F(T(ge(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 u;let a=new Be({apiKey:t,apiHost:e,fetch:Th,projectId:s,limitPolicy:Ae}),l;if(be(n)){let d=we(n,!0);l=await he({objects:(u=d.enrichments)!=null?u:[],selectIdentifier:Mt,selectDisplayName:It})}else l=await ye({directory:n,selectIdentifier:Mt,selectDisplayName:It});let f=Lr({client:a});await le({source:l,target:f,mode:r,whatIf:i,log:ce({diffMode:o})})}};import Lh from"isomorphic-unfetch";var Za={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an enrichment category and its values",builder:e=>F(T(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Be({apiKey:t,apiHost:e,fetch:Lh,projectId:r}).removeCategory({enrichmentId:n})}};var el={command:"enrichment <command>",aliases:["enr"],describe:"Commands for Context enrichments",builder:e=>e.command(Ja).command(Xa).command(Va).command(Za).command(Ka).demandCommand(),handler:()=>{Ue.help()}};var Kn=zr(io());import{writeFile as om}from"fs";import sm from"isomorphic-unfetch";import{exit as so}from"process";var Wr,oo=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(oo,Wr),{...t,projectId:n});return await this.apiClient(r)}async publish(){let{projectId:t}=this.options,n=this.createUrl("/api/v1/publish",{siteId:t});await this.apiClient(n,{method:"POST",expectNoContent:!0})}},on=oo;Wr=new WeakMap,Ge(on,Wr,"/api/v2/manifest");var Tl={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(Kn.default.red("You must specify the project ID")),so(1));let i=am(),s=new on({apiHost:i,projectId:n,apiKey:e,fetch:sm});try{let o=await s.get({preview:r}),a=JSON.stringify(o,null,2);t?om(t,a,l=>{l&&(console.error(`Error writing file to ${t}
110
+ `,l),so(1)),console.log(Kn.default.green(`\u2705 ${t} has been updated from ${i}`))}):console.log(a)}catch(o){let a;o instanceof lt?(o.statusCode===403&&(a=`The API key ${e} did not have permissions to fetch the manifest. Ensure ${r?"Uniform Context > Read Drafts":"Uniform Context > Manifest > Read"} permissions are granted.`),a=o.message):a=o.toString(),console.error(Kn.default.red("\u26A0 Error fetching Context manifest")),console.error(Kn.default.gray(` \u2757 ${a}`)),so(1)}}},am=()=>process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app";var ao=zr(io());import lm from"isomorphic-unfetch";import{exit as cm}from"process";var Ll={command:"publish",describe:"Publish the Uniform Context manifest for a project",builder:e=>F(T(e)),handler:async({apiKey:e,apiHost:t,project:n})=>{try{await new on({apiHost:t,projectId:n,apiKey:e,fetch:lm}).publish()}catch(r){let i;r instanceof lt?(r.statusCode===403&&(i=`The API key ${e} did not have permissions to publish the manifest. Ensure Uniform Context > Manifest > Publish permissions are granted.`),i=r.message):i=r.toString(),console.error(ao.default.red("\u26A0 Error publishing Context manifest")),console.error(ao.default.gray(` \u2757 ${i}`)),cm(1)}}};var Dl={command:"manifest <command>",describe:"Commands for context manifests",aliases:["man"],builder:e=>e.command(Tl).command(Ll).demandCommand(),handler:()=>{Ue.help()}};import fm from"isomorphic-unfetch";var Sn,Qn=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(Qn,Sn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(oe(Qn,Sn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(oe(Qn,Sn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Ne=Qn;Sn=new WeakMap,Ge(Ne,Sn,"/api/v2/quirk");var Nl={command:"get <id>",describe:"Fetch a quirk",builder:e=>me(F(T(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 Ne({apiKey:t,apiHost:e,fetch:fm,projectId:i}).get({quirkId:n,withIntegrations:!0});a.quirks.length===0?(console.error("Quirk did not exist"),process.exit(1)):ae(a.quirks[0],r,s)}};import um from"isomorphic-unfetch";var kl={command:"list",describe:"List quirks",aliases:["ls"],builder:e=>me(F(T(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 Ne({apiKey:t,apiHost:e,fetch:um,projectId:i}).get({withIntegrations:s});ae(a.quirks,n,r)}};import dm from"isomorphic-unfetch";var Tt=e=>e.id,Lt=e=>`${e.name} (pid: ${e.id})`;function Br({client:e}){async function*t(){let n=(await e.get({withIntegrations:!1})).quirks;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.remove({quirkId:n})},writeObject:async n=>{await e.upsert({quirk:n.object})}}}var Rl={command:"pull <directory>",describe:"Pulls all quirks to local files in a directory",builder:e=>F(T(ge(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 Ne({apiKey:t,apiHost:e,fetch:dm,projectId:o,limitPolicy:Ae}),c=Br({client:l}),f;if(be(n)){let p=we(n,!1);f=await he({objects:(d=p.quirks)!=null?d:[],selectIdentifier:Tt,selectDisplayName:Lt,onSyncComplete:async(b,g)=>{p.quirks=g,ct(n,p)}})}else f=await ye({directory:n,selectIdentifier:Tt,selectDisplayName:Lt,format:r});await le({source:c,target:f,mode:i,whatIf:s,log:ce({diffMode:a})})}};import pm from"isomorphic-unfetch";var Ul={command:"push <directory>",describe:"Pushes all quirks from files in a directory or package to Uniform",builder:e=>F(T(ge(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 u;let a=new Ne({apiKey:t,apiHost:e,fetch:pm,projectId:s,limitPolicy:Ae}),l;if(be(n)){let d=we(n,!0);l=await he({objects:(u=d.quirks)!=null?u:[],selectIdentifier:Tt,selectDisplayName:Lt})}else l=await ye({directory:n,selectIdentifier:Tt,selectDisplayName:Lt});let f=Br({client:a});await le({source:l,target:f,mode:r,whatIf:i,log:ce({diffMode:o})})}};import hm from"isomorphic-unfetch";var $l={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a quirk",builder:e=>F(T(e.positional("id",{demandOption:!0,describe:"Quirk public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Ne({apiKey:t,apiHost:e,fetch:hm,projectId:r}).remove({quirkId:n})}};import mm from"isomorphic-unfetch";var Wl={command:"update <filename>",aliases:["put"],describe:"Insert or update a quirk",builder:e=>F(T(e.positional("filename",{demandOption:!0,describe:"Quirk file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new Ne({apiKey:t,apiHost:e,fetch:mm,projectId:r}),s=at(n);await i.upsert({quirk:s})}};var Bl={command:"quirk <command>",aliases:["qk"],describe:"Commands for Context quirks",builder:e=>e.command(Rl).command(Ul).command(Nl).command($l).command(kl).command(Wl).demandCommand(),handler:()=>{Ue.help()}};import gm from"isomorphic-unfetch";var Pn,Jn=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(Jn,Pn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(oe(Jn,Pn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(oe(Jn,Pn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},ke=Jn;Pn=new WeakMap,Ge(ke,Pn,"/api/v2/signal");var Hl={command:"get <id>",describe:"Fetch a signal",builder:e=>me(F(T(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 ke({apiKey:t,apiHost:e,fetch:gm,projectId:i}).get({signalId:n});a.signals.length===0?(console.error("Signal did not exist"),process.exit(1)):ae(a.signals[0],r,s)}};import bm from"isomorphic-unfetch";var Gl={command:"list",describe:"List signals",aliases:["ls"],builder:e=>me(F(T(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new ke({apiKey:t,apiHost:e,fetch:bm,projectId:i}).get();ae(o.signals,n,r)}};import ym from"isomorphic-unfetch";var Dt=e=>e.id,Nt=e=>`${e.name} (pid: ${e.id})`;function Hr({client:e}){async function*t(){let n=(await e.get()).signals;for await(let r of n)yield{id:Dt(r),displayName:Nt(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 ql={command:"pull <directory>",describe:"Pulls all signals to local files in a directory",builder:e=>F(T(ge(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 ke({apiKey:t,apiHost:e,fetch:ym,projectId:o,limitPolicy:Ae}),c=Hr({client:l}),f;if(be(n)){let p=we(n,!1);f=await he({objects:(d=p.signals)!=null?d:[],selectIdentifier:Dt,selectDisplayName:Nt,onSyncComplete:async(b,g)=>{p.signals=g,ct(n,p)}})}else f=await ye({directory:n,selectIdentifier:Dt,selectDisplayName:Nt,format:r});await le({source:c,target:f,mode:i,whatIf:s,log:ce({diffMode:a})})}};import wm from"isomorphic-unfetch";var Yl={command:"push <directory>",describe:"Pushes all signals from files in a directory or package to Uniform",builder:e=>F(T(ge(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 u;let a=new ke({apiKey:t,apiHost:e,fetch:wm,projectId:s,limitPolicy:Ae}),l;if(be(n)){let d=we(n,!0);l=await he({objects:(u=d.signals)!=null?u:[],selectIdentifier:Dt,selectDisplayName:Nt})}else l=await ye({directory:n,selectIdentifier:Dt,selectDisplayName:Nt});let f=Hr({client:a});await le({source:l,target:f,mode:r,whatIf:i,log:ce({diffMode:o})})}};import Am from"isomorphic-unfetch";var zl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a signal",builder:e=>F(T(e.positional("id",{demandOption:!0,describe:"Signal public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new ke({apiKey:t,apiHost:e,fetch:Am,projectId:r}).remove({signalId:n})}};import xm from"isomorphic-unfetch";var Vl={command:"update <filename>",aliases:["put"],describe:"Insert or update a signal",builder:e=>F(T(e.positional("filename",{demandOption:!0,describe:"Signal file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new ke({apiKey:t,apiHost:e,fetch:xm,projectId:r}),s=at(n);await i.upsert({signal:s})}};var Kl={command:"signal <command>",aliases:["sig"],describe:"Commands for Context signals",builder:e=>e.command(ql).command(Yl).command(Hl).command(zl).command(Gl).command(Vl).demandCommand(),handler:()=>{Ue.help()}};import Cm from"isomorphic-unfetch";var jn,Xn=class extends Fe{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(oe(Xn,jn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(oe(Xn,jn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(oe(Xn,jn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Re=Xn;jn=new WeakMap,Ge(Re,jn,"/api/v2/test");var Ql={command:"get <id>",describe:"Fetch a test",builder:e=>me(F(T(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 Re({apiKey:t,apiHost:e,fetch:Cm,projectId:i}).get({testId:n});a.tests.length===0?(console.error("Test did not exist"),process.exit(1)):ae(a.tests[0],r,s)}};import Om from"isomorphic-unfetch";var Jl={command:"list",describe:"List tests",aliases:["ls"],builder:e=>me(F(T(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Re({apiKey:t,apiHost:e,fetch:Om,projectId:i}).get();ae(o.tests,n,r)}};import vm from"isomorphic-unfetch";var kt=e=>e.id,Rt=e=>`${e.name} (pid: ${e.id})`;function Gr({client:e}){async function*t(){let n=(await e.get()).tests;for await(let r of n)yield{id:kt(r),displayName:Rt(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 Xl={command:"pull <directory>",describe:"Pulls all tests to local files in a directory",builder:e=>F(T(ge(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 Re({apiKey:t,apiHost:e,fetch:vm,projectId:o,limitPolicy:Ae}),c=Gr({client:l}),f;if(be(n)){let p=we(n,!1);f=await he({objects:(d=p.tests)!=null?d:[],selectIdentifier:kt,selectDisplayName:Rt,onSyncComplete:async(b,g)=>{p.tests=g,ct(n,p)}})}else f=await ye({directory:n,selectIdentifier:kt,selectDisplayName:Rt,format:r});await le({source:c,target:f,mode:i,whatIf:s,log:ce({diffMode:a})})}};import Em from"isomorphic-unfetch";var Zl={command:"push <directory>",describe:"Pushes all tests from files in a directory or package to Uniform",builder:e=>F(T(ge(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 u;let a=new Re({apiKey:t,apiHost:e,fetch:Em,projectId:s,limitPolicy:Ae}),l;if(be(n)){let d=we(n,!0);l=await he({objects:(u=d.tests)!=null?u:[],selectIdentifier:kt,selectDisplayName:Rt})}else l=await ye({directory:n,selectIdentifier:kt,selectDisplayName:Rt});let f=Gr({client:a});await le({source:l,target:f,mode:r,whatIf:i,log:ce({diffMode:o})})}};import _m from"isomorphic-unfetch";var ec={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a test",builder:e=>F(T(e.positional("id",{demandOption:!0,describe:"Test public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Re({apiKey:t,apiHost:e,fetch:_m,projectId:r}).remove({testId:n})}};import Sm from"isomorphic-unfetch";var tc={command:"update <filename>",aliases:["put"],describe:"Insert or update a test",builder:e=>F(T(e.positional("filename",{demandOption:!0,describe:"Test file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new Re({apiKey:t,apiHost:e,fetch:Sm,projectId:r}),s=at(n);await i.upsert({test:s})}};var nc={command:"test <command>",describe:"Commands for Context A/B tests",builder:e=>e.command(Xl).command(Zl).command(Ql).command(ec).command(Jl).command(tc).demandCommand(),handler:()=>{Ue.help()}};var Sx={commands:[{command:"context <command>",aliases:["ctx"],describe:"Uniform Context commands",builder:e=>e.command(Dl).command(Kl).command(el).command(za).command(Bl).command(nc).demandCommand(),handler:()=>{Ue.showHelp()}}]};export{we as readContextPackage,Sx as uniformCLI,ct as writeContextPackage};
111
111
  /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
112
112
  /**
113
113
  * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js