@uniformdev/context 16.0.0 → 16.0.1-alpha.221

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 lc=Object.create;var Qr=Object.defineProperty;var cc=Object.getOwnPropertyDescriptor;var fc=Object.getOwnPropertyNames;var uc=Object.getPrototypeOf,dc=Object.prototype.hasOwnProperty;var pc=(e,t,n)=>t in e?Qr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Se=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var hc=(e,t)=>()=>(e&&(t=e(e=0)),t);var ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var mc=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fc(t))!dc.call(e,i)&&i!==n&&Qr(e,i,{get:()=>t[i],enumerable:!(r=cc(t,i))||r.enumerable});return e};var uo=(e,t,n)=>(n=e!=null?lc(uc(e)):{},mc(t||!e||!e.__esModule?Qr(n,"default",{value:e,enumerable:!0}):n,e));var po=(e,t,n)=>(pc(e,typeof t!="symbol"?t+"":t,n),n),gc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ae=(e,t,n)=>(gc(e,t,"read from private field"),n?n.call(e):t.get(e)),Ve=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var b=hc(()=>{});var Ua=ot((Hn,xn)=>{b();var sp=200,Ki="__lodash_hash_undefined__",Aa=1,Fr=2,xa=9007199254740991,Sr="[object Arguments]",Wi="[object Array]",Ca="[object Boolean]",Oa="[object Date]",va="[object Error]",Ea="[object Function]",ap="[object GeneratorFunction]",jr="[object Map]",_a="[object Number]",An="[object Object]",fa="[object Promise]",Sa="[object RegExp]",Pr="[object Set]",ja="[object String]",lp="[object Symbol]",Bi="[object WeakMap]",Pa="[object ArrayBuffer]",Ir="[object DataView]",cp="[object Float32Array]",fp="[object Float64Array]",up="[object Int8Array]",dp="[object Int16Array]",pp="[object Int32Array]",hp="[object Uint8Array]",mp="[object Uint8ClampedArray]",gp="[object Uint16Array]",bp="[object Uint32Array]",yp=/[\\^$.*+?()[\]{}|]/g,wp=/^\[object .+?Constructor\]$/,Ap=/^(?:0|[1-9]\d*)$/,se={};se[cp]=se[fp]=se[up]=se[dp]=se[pp]=se[hp]=se[mp]=se[gp]=se[bp]=!0;se[Sr]=se[Wi]=se[Pa]=se[Ca]=se[Ir]=se[Oa]=se[va]=se[Ea]=se[jr]=se[_a]=se[An]=se[Sa]=se[Pr]=se[ja]=se[Bi]=!1;var Ia=typeof global=="object"&&global&&global.Object===Object&&global,xp=typeof self=="object"&&self&&self.Object===Object&&self,It=Ia||xp||Function("return this")(),Ma=typeof Hn=="object"&&Hn&&!Hn.nodeType&&Hn,ua=Ma&&typeof xn=="object"&&xn&&!xn.nodeType&&xn,Cp=ua&&ua.exports===Ma,da=Cp&&Ia.process,pa=function(){try{return da&&da.binding("util")}catch(e){}}(),ha=pa&&pa.isTypedArray;function Op(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function vp(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ep(e){return function(t){return e(t)}}function _p(e,t){return e==null?void 0:e[t]}function Hi(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function Sp(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function jp(e,t){return function(n){return e(t(n))}}function Pp(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Ip=Array.prototype,Mp=Function.prototype,Tr=Object.prototype,Ui=It["__core-js_shared__"],ma=function(){var e=/[^.]+$/.exec(Ui&&Ui.keys&&Ui.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Fa=Mp.toString,bt=Tr.hasOwnProperty,Yn=Tr.toString,Fp=RegExp("^"+Fa.call(bt).replace(yp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ga=It.Symbol,ba=It.Uint8Array,Tp=Tr.propertyIsEnumerable,Lp=Ip.splice,Dp=jp(Object.keys,Object),Gi=Cn(It,"DataView"),Gn=Cn(It,"Map"),qi=Cn(It,"Promise"),Yi=Cn(It,"Set"),zi=Cn(It,"WeakMap"),qn=Cn(Object,"create"),Np=an(Gi),kp=an(Gn),Rp=an(qi),Up=an(Yi),$p=an(zi),ya=ga?ga.prototype:void 0,$i=ya?ya.valueOf:void 0;function on(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Wp(){this.__data__=qn?qn(null):{}}function Bp(e){return this.has(e)&&delete this.__data__[e]}function Hp(e){var t=this.__data__;if(qn){var n=t[e];return n===Ki?void 0:n}return bt.call(t,e)?t[e]:void 0}function Gp(e){var t=this.__data__;return qn?t[e]!==void 0:bt.call(t,e)}function qp(e,t){var n=this.__data__;return n[e]=qn&&t===void 0?Ki:t,this}on.prototype.clear=Wp;on.prototype.delete=Bp;on.prototype.get=Hp;on.prototype.has=Gp;on.prototype.set=qp;function yt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yp(){this.__data__=[]}function zp(e){var t=this.__data__,n=Lr(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Lp.call(t,n,1),!0}function Vp(e){var t=this.__data__,n=Lr(t,e);return n<0?void 0:t[n][1]}function Kp(e){return Lr(this.__data__,e)>-1}function Qp(e,t){var n=this.__data__,r=Lr(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}yt.prototype.clear=Yp;yt.prototype.delete=zp;yt.prototype.get=Vp;yt.prototype.has=Kp;yt.prototype.set=Qp;function sn(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Jp(){this.__data__={hash:new on,map:new(Gn||yt),string:new on}}function Xp(e){return Dr(this,e).delete(e)}function Zp(e){return Dr(this,e).get(e)}function eh(e){return Dr(this,e).has(e)}function th(e,t){return Dr(this,e).set(e,t),this}sn.prototype.clear=Jp;sn.prototype.delete=Xp;sn.prototype.get=Zp;sn.prototype.has=eh;sn.prototype.set=th;function Mr(e){var t=-1,n=e?e.length:0;for(this.__data__=new sn;++t<n;)this.add(e[t])}function nh(e){return this.__data__.set(e,Ki),this}function rh(e){return this.__data__.has(e)}Mr.prototype.add=Mr.prototype.push=nh;Mr.prototype.has=rh;function Pt(e){this.__data__=new yt(e)}function ih(){this.__data__=new yt}function oh(e){return this.__data__.delete(e)}function sh(e){return this.__data__.get(e)}function ah(e){return this.__data__.has(e)}function lh(e,t){var n=this.__data__;if(n instanceof yt){var r=n.__data__;if(!Gn||r.length<sp-1)return r.push([e,t]),this;n=this.__data__=new sn(r)}return n.set(e,t),this}Pt.prototype.clear=ih;Pt.prototype.delete=oh;Pt.prototype.get=sh;Pt.prototype.has=ah;Pt.prototype.set=lh;function ch(e,t){var n=Vi(e)||xh(e)?vp(e.length,String):[],r=n.length,i=!!r;for(var s in e)(t||bt.call(e,s))&&!(i&&(s=="length"||bh(s,r)))&&n.push(s);return n}function Lr(e,t){for(var n=e.length;n--;)if(Da(e[n][0],t))return n;return-1}function fh(e){return Yn.call(e)}function Ta(e,t,n,r,i){return e===t?!0:e==null||t==null||!Qi(e)&&!Ji(t)?e!==e&&t!==t:uh(e,t,Ta,n,r,i)}function uh(e,t,n,r,i,s){var o=Vi(e),a=Vi(t),l=Wi,c=Wi;o||(l=jt(e),l=l==Sr?An:l),a||(c=jt(t),c=c==Sr?An:c);var u=l==An&&!Hi(e),f=c==An&&!Hi(t),d=l==c;if(d&&!u)return s||(s=new Pt),o||vh(e)?La(e,t,n,r,i,s):mh(e,t,l,n,r,i,s);if(!(i&Fr)){var p=u&&bt.call(e,"__wrapped__"),y=f&&bt.call(t,"__wrapped__");if(p||y){var g=p?e.value():e,m=y?t.value():t;return s||(s=new Pt),n(g,m,r,i,s)}}return d?(s||(s=new Pt),gh(e,t,n,r,i,s)):!1}function dh(e){if(!Qi(e)||wh(e))return!1;var t=ka(e)||Hi(e)?Fp:wp;return t.test(an(e))}function ph(e){return Ji(e)&&Ra(e.length)&&!!se[Yn.call(e)]}function hh(e){if(!Ah(e))return Dp(e);var t=[];for(var n in Object(e))bt.call(e,n)&&n!="constructor"&&t.push(n);return t}function La(e,t,n,r,i,s){var o=i&Fr,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 u=-1,f=!0,d=i&Aa?new Mr:void 0;for(s.set(e,t),s.set(t,e);++u<a;){var p=e[u],y=t[u];if(r)var g=o?r(y,p,u,t,e,s):r(p,y,u,e,t,s);if(g!==void 0){if(g)continue;f=!1;break}if(d){if(!Op(t,function(m,E){if(!d.has(E)&&(p===m||n(p,m,r,i,s)))return d.add(E)})){f=!1;break}}else if(!(p===y||n(p,y,r,i,s))){f=!1;break}}return s.delete(e),s.delete(t),f}function mh(e,t,n,r,i,s,o){switch(n){case Ir:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Pa:return!(e.byteLength!=t.byteLength||!r(new ba(e),new ba(t)));case Ca:case Oa:case _a:return Da(+e,+t);case va:return e.name==t.name&&e.message==t.message;case Sa:case ja:return e==t+"";case jr:var a=Sp;case Pr:var l=s&Fr;if(a||(a=Pp),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;s|=Aa,o.set(e,t);var u=La(a(e),a(t),r,i,s,o);return o.delete(e),u;case lp:if($i)return $i.call(e)==$i.call(t)}return!1}function gh(e,t,n,r,i,s){var o=i&Fr,a=wa(e),l=a.length,c=wa(t),u=c.length;if(l!=u&&!o)return!1;for(var f=l;f--;){var d=a[f];if(!(o?d in t:bt.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;++f<l;){d=a[f];var m=e[d],E=t[d];if(r)var _=o?r(E,m,d,t,e,s):r(m,E,d,e,t,s);if(!(_===void 0?m===E||n(m,E,r,i,s):_)){y=!1;break}g||(g=d=="constructor")}if(y&&!g){var U=e.constructor,K=t.constructor;U!=K&&"constructor"in e&&"constructor"in t&&!(typeof U=="function"&&U instanceof U&&typeof K=="function"&&K instanceof K)&&(y=!1)}return s.delete(e),s.delete(t),y}function Dr(e,t){var n=e.__data__;return yh(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Cn(e,t){var n=_p(e,t);return dh(n)?n:void 0}var jt=fh;(Gi&&jt(new Gi(new ArrayBuffer(1)))!=Ir||Gn&&jt(new Gn)!=jr||qi&&jt(qi.resolve())!=fa||Yi&&jt(new Yi)!=Pr||zi&&jt(new zi)!=Bi)&&(jt=function(e){var t=Yn.call(e),n=t==An?e.constructor:void 0,r=n?an(n):void 0;if(r)switch(r){case Np:return Ir;case kp:return jr;case Rp:return fa;case Up:return Pr;case $p:return Bi}return t});function bh(e,t){return t=t==null?xa:t,!!t&&(typeof e=="number"||Ap.test(e))&&e>-1&&e%1==0&&e<t}function yh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function wh(e){return!!ma&&ma in e}function Ah(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Tr;return e===n}function an(e){if(e!=null){try{return Fa.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Da(e,t){return e===t||e!==e&&t!==t}function xh(e){return Ch(e)&&bt.call(e,"callee")&&(!Tp.call(e,"callee")||Yn.call(e)==Sr)}var Vi=Array.isArray;function Na(e){return e!=null&&Ra(e.length)&&!ka(e)}function Ch(e){return Ji(e)&&Na(e)}function Oh(e,t,n){n=typeof n=="function"?n:void 0;var r=n?n(e,t):void 0;return r===void 0?Ta(e,t,n):!!r}function ka(e){var t=Qi(e)?Yn.call(e):"";return t==Ea||t==ap}function Ra(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=xa}function Qi(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ji(e){return!!e&&typeof e=="object"}var vh=ha?Ep(ha):ph;function wa(e){return Na(e)?ch(e):hh(e)}xn.exports=Oh});var al=ot((Oy,sl)=>{"use strict";b();sl.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 Xi=ot((vy,cl)=>{b();var Kn=al(),ll={};for(let e of Object.keys(Kn))ll[Kn[e]]=e;var T={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};cl.exports=T;for(let e of Object.keys(T)){if(!("channels"in T[e]))throw new Error("missing channels property: "+e);if(!("labels"in T[e]))throw new Error("missing channel labels property: "+e);if(T[e].labels.length!==T[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=T[e];delete T[e].channels,delete T[e].labels,Object.defineProperty(T[e],"channels",{value:t}),Object.defineProperty(T[e],"labels",{value:n})}T.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,a,l;s===i?a=0:t===s?a=(n-r)/o:n===s?a=2+(r-t)/o:r===s&&(a=4+(t-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let 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]};T.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),u=c-Math.min(o,a,l),f=function(d){return(c-d)/6/u+1/2};return u===0?(i=0,s=0):(s=u/c,t=f(o),n=f(a),r=f(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]};T.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=T.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,s*100,r*100]};T.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),s=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function Yh(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}T.rgb.keyword=function(e){let t=ll[e];if(t)return t;let n=1/0,r;for(let i of Object.keys(Kn)){let s=Kn[i],o=Yh(e,s);o<n&&(n=o,r=i)}return r};T.keyword.rgb=function(e){return Kn[e]};T.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,s=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};T.rgb.lab=function(e){let t=T.rgb.xyz(e),n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,o=500*(n-r),a=200*(r-i);return[s,o,a]};T.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,s,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;let a=2*r-i,l=[0,0,0];for(let 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};T.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let o=(r+n)/2,a=r===0?2*i/(s+i):2*n/(r+n);return[t,a*100,o*100]};T.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,s=t-Math.floor(t),o=255*r*(1-n),a=255*r*(1-n*s),l=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,l,o];case 1:return[a,r,o];case 2:return[o,r,l];case 3:return[o,a,r];case 4:return[l,o,r];case 5:return[r,o,a]}};T.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),s,o;o=(2-n)*r;let a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[t,s*100,o*100]};T.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),a=1-r;s=6*t-o,(o&1)!==0&&(s=1-s);let l=n+s*(a-n),c,u,f;switch(o){default:case 6:case 0:c=a,u=l,f=n;break;case 1:c=l,u=a,f=n;break;case 2:c=n,u=a,f=l;break;case 3:c=n,u=l,f=a;break;case 4:c=l,u=n,f=a;break;case 5:c=a,u=n,f=l;break}return[c*255,u*255,f*255]};T.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,s=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};T.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,s,o;return i=t*3.2406+n*-1.5372+r*-.4986,s=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};T.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(t-n),o=200*(n-r);return[i,s,o]};T.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,s,o;s=(t+16)/116,i=n/500+s,o=s-r/200;let a=s**3,l=i**3,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]};T.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(n*n+r*r);return[t,o,i]};T.lch.lab=function(e){let t=e[0],n=e[1],i=e[2]/360*2*Math.PI,s=n*Math.cos(i),o=n*Math.sin(i);return[t,s,o]};T.rgb.ansi16=function(e,t=null){let[n,r,i]=e,s=t===null?T.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(o+=60),o};T.hsv.ansi16=function(e){return T.rgb.ansi16(T.hsv.rgb(e),e[2])};T.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};T.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5,r=(t&1)*n*255,i=(t>>1&1)*n*255,s=(t>>2&1)*n*255;return[r,i,s]};T.ansi256.rgb=function(e){if(e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[n,r,i]};T.rgb.hex=function(e){let n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};T.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(a=>a+a).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,o=r&255;return[i,s,o]};T.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),s=Math.min(Math.min(t,n),r),o=i-s,a,l;return o<1?a=s/(1-o):a=0,o<=0?l=0:i===t?l=(n-r)/o%6:i===n?l=2+(r-t)/o:l=4+(t-n)/o,l/=6,l%=1,[l*360,o*100,a*100]};T.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]};T.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]};T.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=t%1*6,o=s%1,a=1-o,l=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};T.hcg.hsv=function(e){let t=e[1]/100,n=e[2]/100,r=t+n*(1-t),i=0;return r>0&&(i=t/r),[e[0],i*100,r*100]};T.hcg.hsl=function(e){let t=e[1]/100,r=e[2]/100*(1-t)+.5*t,i=0;return r>0&&r<.5?i=t/(2*r):r>=.5&&r<1&&(i=t/(2*(1-r))),[e[0],i*100,r*100]};T.hcg.hwb=function(e){let t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};T.hwb.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=1-n,i=r-t,s=0;return i<1&&(s=(r-i)/(1-i)),[e[0],i*100,s*100]};T.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};T.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};T.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};T.gray.hsl=function(e){return[0,0,e[0]]};T.gray.hsv=T.gray.hsl;T.gray.hwb=function(e){return[0,100,e[0]]};T.gray.cmyk=function(e){return[0,0,0,e[0]]};T.gray.lab=function(e){return[e[0],0,0]};T.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};T.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var ul=ot((Ey,fl)=>{b();var Ur=Xi();function zh(){let e={},t=Object.keys(Ur);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function Vh(e){let t=zh(),n=[e];for(t[e].distance=0;n.length;){let r=n.pop(),i=Object.keys(Ur[r]);for(let s=i.length,o=0;o<s;o++){let a=i[o],l=t[a];l.distance===-1&&(l.distance=t[r].distance+1,l.parent=r,n.unshift(a))}}return t}function Kh(e,t){return function(n){return t(e(n))}}function Qh(e,t){let n=[t[e].parent,e],r=Ur[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=Kh(Ur[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}fl.exports=function(e){let t=Vh(e),n={},r=Object.keys(t);for(let i=r.length,s=0;s<i;s++){let o=r[s];t[o].parent!==null&&(n[o]=Qh(o,t))}return n}});var pl=ot((_y,dl)=>{b();var Zi=Xi(),Jh=ul(),_n={},Xh=Object.keys(Zi);function Zh(e){let t=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function em(e){let t=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=e(n);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}Xh.forEach(e=>{_n[e]={},Object.defineProperty(_n[e],"channels",{value:Zi[e].channels}),Object.defineProperty(_n[e],"labels",{value:Zi[e].labels});let t=Jh(e);Object.keys(t).forEach(r=>{let i=t[r];_n[e][r]=em(i),_n[e][r].raw=Zh(i)})});dl.exports=_n});var wl=ot((Sy,yl)=>{"use strict";b();var hl=(e,t)=>(...n)=>`\x1B[${e(...n)+t}m`,ml=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};5;${r}m`},gl=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},$r=e=>e,bl=(e,t,n)=>[e,t,n],Sn=(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})},eo,jn=(e,t,n,r)=>{eo===void 0&&(eo=pl());let i=r?10:0,s={};for(let[o,a]of Object.entries(eo)){let l=o==="ansi16"?"ansi":o;o===t?s[l]=e(n,i):typeof a=="object"&&(s[l]=e(a[t],i))}return s};function tm(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[n,r]of Object.entries(t)){for(let[i,s]of Object.entries(r))t[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=t[i],e.set(s[0],s[1]);Object.defineProperty(t,n,{value:r,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",Sn(t.color,"ansi",()=>jn(hl,"ansi16",$r,!1)),Sn(t.color,"ansi256",()=>jn(ml,"ansi256",$r,!1)),Sn(t.color,"ansi16m",()=>jn(gl,"rgb",bl,!1)),Sn(t.bgColor,"ansi",()=>jn(hl,"ansi16",$r,!0)),Sn(t.bgColor,"ansi256",()=>jn(ml,"ansi256",$r,!0)),Sn(t.bgColor,"ansi16m",()=>jn(gl,"rgb",bl,!0)),t}Object.defineProperty(yl,"exports",{enumerable:!0,get:tm})});var xl=ot((jy,Al)=>{"use strict";b();Al.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}});var vl=ot((Py,Ol)=>{"use strict";b();var nm=Se("os"),Cl=Se("tty"),it=xl(),{env:Fe}=process,Nt;it("no-color")||it("no-colors")||it("color=false")||it("color=never")?Nt=0:(it("color")||it("colors")||it("color=true")||it("color=always"))&&(Nt=1);"FORCE_COLOR"in Fe&&(Fe.FORCE_COLOR==="true"?Nt=1:Fe.FORCE_COLOR==="false"?Nt=0:Nt=Fe.FORCE_COLOR.length===0?1:Math.min(parseInt(Fe.FORCE_COLOR,10),3));function to(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function no(e,t){if(Nt===0)return 0;if(it("color=16m")||it("color=full")||it("color=truecolor"))return 3;if(it("color=256"))return 2;if(e&&!t&&Nt===void 0)return 0;let n=Nt||0;if(Fe.TERM==="dumb")return n;if(process.platform==="win32"){let r=nm.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Fe)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Fe)||Fe.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Fe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Fe.TEAMCITY_VERSION)?1:0;if(Fe.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Fe){let r=parseInt((Fe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Fe.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Fe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Fe.TERM)||"COLORTERM"in Fe?1:n}function rm(e){let t=no(e,e&&e.isTTY);return to(t)}Ol.exports={supportsColor:rm,stdout:to(no(!0,Cl.isatty(1))),stderr:to(no(!0,Cl.isatty(2)))}});var _l=ot((Iy,El)=>{"use strict";b();var im=(e,t,n)=>{let r=e.indexOf(t);if(r===-1)return e;let i=t.length,s=0,o="";do o+=e.substr(s,r-s)+t+n,s=r+i,r=e.indexOf(t,s);while(r!==-1);return o+=e.substr(s),o},om=(e,t,n,r)=>{let i=0,s="";do{let o=e[r-1]==="\r";s+=e.substr(i,(o?r-1:r)-i)+t+(o?`\r
1
+ var lc=Object.create;var Qr=Object.defineProperty;var cc=Object.getOwnPropertyDescriptor;var fc=Object.getOwnPropertyNames;var uc=Object.getPrototypeOf,dc=Object.prototype.hasOwnProperty;var pc=(e,t,n)=>t in e?Qr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Se=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var hc=(e,t)=>()=>(e&&(t=e(e=0)),t);var ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var mc=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fc(t))!dc.call(e,i)&&i!==n&&Qr(e,i,{get:()=>t[i],enumerable:!(r=cc(t,i))||r.enumerable});return e};var uo=(e,t,n)=>(n=e!=null?lc(uc(e)):{},mc(t||!e||!e.__esModule?Qr(n,"default",{value:e,enumerable:!0}):n,e));var po=(e,t,n)=>(pc(e,typeof t!="symbol"?t+"":t,n),n),gc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var le=(e,t,n)=>(gc(e,t,"read from private field"),n?n.call(e):t.get(e)),Ve=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var b=hc(()=>{});var Ua=ot((Gn,xn)=>{b();var sp=200,Ki="__lodash_hash_undefined__",Aa=1,Fr=2,xa=9007199254740991,Sr="[object Arguments]",Wi="[object Array]",Ca="[object Boolean]",Oa="[object Date]",va="[object Error]",Ea="[object Function]",ap="[object GeneratorFunction]",jr="[object Map]",_a="[object Number]",An="[object Object]",fa="[object Promise]",Sa="[object RegExp]",Pr="[object Set]",ja="[object String]",lp="[object Symbol]",Bi="[object WeakMap]",Pa="[object ArrayBuffer]",Ir="[object DataView]",cp="[object Float32Array]",fp="[object Float64Array]",up="[object Int8Array]",dp="[object Int16Array]",pp="[object Int32Array]",hp="[object Uint8Array]",mp="[object Uint8ClampedArray]",gp="[object Uint16Array]",bp="[object Uint32Array]",yp=/[\\^$.*+?()[\]{}|]/g,wp=/^\[object .+?Constructor\]$/,Ap=/^(?:0|[1-9]\d*)$/,ae={};ae[cp]=ae[fp]=ae[up]=ae[dp]=ae[pp]=ae[hp]=ae[mp]=ae[gp]=ae[bp]=!0;ae[Sr]=ae[Wi]=ae[Pa]=ae[Ca]=ae[Ir]=ae[Oa]=ae[va]=ae[Ea]=ae[jr]=ae[_a]=ae[An]=ae[Sa]=ae[Pr]=ae[ja]=ae[Bi]=!1;var Ia=typeof global=="object"&&global&&global.Object===Object&&global,xp=typeof self=="object"&&self&&self.Object===Object&&self,It=Ia||xp||Function("return this")(),Ma=typeof Gn=="object"&&Gn&&!Gn.nodeType&&Gn,ua=Ma&&typeof xn=="object"&&xn&&!xn.nodeType&&xn,Cp=ua&&ua.exports===Ma,da=Cp&&Ia.process,pa=function(){try{return da&&da.binding("util")}catch(e){}}(),ha=pa&&pa.isTypedArray;function Op(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function vp(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ep(e){return function(t){return e(t)}}function _p(e,t){return e==null?void 0:e[t]}function Hi(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function Sp(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function jp(e,t){return function(n){return e(t(n))}}function Pp(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Ip=Array.prototype,Mp=Function.prototype,Tr=Object.prototype,Ui=It["__core-js_shared__"],ma=function(){var e=/[^.]+$/.exec(Ui&&Ui.keys&&Ui.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Fa=Mp.toString,bt=Tr.hasOwnProperty,zn=Tr.toString,Fp=RegExp("^"+Fa.call(bt).replace(yp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ga=It.Symbol,ba=It.Uint8Array,Tp=Tr.propertyIsEnumerable,Lp=Ip.splice,Dp=jp(Object.keys,Object),Gi=Cn(It,"DataView"),qn=Cn(It,"Map"),qi=Cn(It,"Promise"),Yi=Cn(It,"Set"),zi=Cn(It,"WeakMap"),Yn=Cn(Object,"create"),Np=an(Gi),kp=an(qn),Rp=an(qi),Up=an(Yi),$p=an(zi),ya=ga?ga.prototype:void 0,$i=ya?ya.valueOf:void 0;function on(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Wp(){this.__data__=Yn?Yn(null):{}}function Bp(e){return this.has(e)&&delete this.__data__[e]}function Hp(e){var t=this.__data__;if(Yn){var n=t[e];return n===Ki?void 0:n}return bt.call(t,e)?t[e]:void 0}function Gp(e){var t=this.__data__;return Yn?t[e]!==void 0:bt.call(t,e)}function qp(e,t){var n=this.__data__;return n[e]=Yn&&t===void 0?Ki:t,this}on.prototype.clear=Wp;on.prototype.delete=Bp;on.prototype.get=Hp;on.prototype.has=Gp;on.prototype.set=qp;function yt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yp(){this.__data__=[]}function zp(e){var t=this.__data__,n=Lr(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Lp.call(t,n,1),!0}function Vp(e){var t=this.__data__,n=Lr(t,e);return n<0?void 0:t[n][1]}function Kp(e){return Lr(this.__data__,e)>-1}function Qp(e,t){var n=this.__data__,r=Lr(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}yt.prototype.clear=Yp;yt.prototype.delete=zp;yt.prototype.get=Vp;yt.prototype.has=Kp;yt.prototype.set=Qp;function sn(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Jp(){this.__data__={hash:new on,map:new(qn||yt),string:new on}}function Xp(e){return Dr(this,e).delete(e)}function Zp(e){return Dr(this,e).get(e)}function eh(e){return Dr(this,e).has(e)}function th(e,t){return Dr(this,e).set(e,t),this}sn.prototype.clear=Jp;sn.prototype.delete=Xp;sn.prototype.get=Zp;sn.prototype.has=eh;sn.prototype.set=th;function Mr(e){var t=-1,n=e?e.length:0;for(this.__data__=new sn;++t<n;)this.add(e[t])}function nh(e){return this.__data__.set(e,Ki),this}function rh(e){return this.__data__.has(e)}Mr.prototype.add=Mr.prototype.push=nh;Mr.prototype.has=rh;function Pt(e){this.__data__=new yt(e)}function ih(){this.__data__=new yt}function oh(e){return this.__data__.delete(e)}function sh(e){return this.__data__.get(e)}function ah(e){return this.__data__.has(e)}function lh(e,t){var n=this.__data__;if(n instanceof yt){var r=n.__data__;if(!qn||r.length<sp-1)return r.push([e,t]),this;n=this.__data__=new sn(r)}return n.set(e,t),this}Pt.prototype.clear=ih;Pt.prototype.delete=oh;Pt.prototype.get=sh;Pt.prototype.has=ah;Pt.prototype.set=lh;function ch(e,t){var n=Vi(e)||xh(e)?vp(e.length,String):[],r=n.length,i=!!r;for(var s in e)(t||bt.call(e,s))&&!(i&&(s=="length"||bh(s,r)))&&n.push(s);return n}function Lr(e,t){for(var n=e.length;n--;)if(Da(e[n][0],t))return n;return-1}function fh(e){return zn.call(e)}function Ta(e,t,n,r,i){return e===t?!0:e==null||t==null||!Qi(e)&&!Ji(t)?e!==e&&t!==t:uh(e,t,Ta,n,r,i)}function uh(e,t,n,r,i,s){var o=Vi(e),a=Vi(t),l=Wi,c=Wi;o||(l=jt(e),l=l==Sr?An:l),a||(c=jt(t),c=c==Sr?An:c);var f=l==An&&!Hi(e),u=c==An&&!Hi(t),d=l==c;if(d&&!f)return s||(s=new Pt),o||vh(e)?La(e,t,n,r,i,s):mh(e,t,l,n,r,i,s);if(!(i&Fr)){var p=f&&bt.call(e,"__wrapped__"),y=u&&bt.call(t,"__wrapped__");if(p||y){var g=p?e.value():e,m=y?t.value():t;return s||(s=new Pt),n(g,m,r,i,s)}}return d?(s||(s=new Pt),gh(e,t,n,r,i,s)):!1}function dh(e){if(!Qi(e)||wh(e))return!1;var t=ka(e)||Hi(e)?Fp:wp;return t.test(an(e))}function ph(e){return Ji(e)&&Ra(e.length)&&!!ae[zn.call(e)]}function hh(e){if(!Ah(e))return Dp(e);var t=[];for(var n in Object(e))bt.call(e,n)&&n!="constructor"&&t.push(n);return t}function La(e,t,n,r,i,s){var o=i&Fr,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&Aa?new Mr: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(!Op(t,function(m,E){if(!d.has(E)&&(p===m||n(p,m,r,i,s)))return d.add(E)})){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 mh(e,t,n,r,i,s,o){switch(n){case Ir:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Pa:return!(e.byteLength!=t.byteLength||!r(new ba(e),new ba(t)));case Ca:case Oa:case _a:return Da(+e,+t);case va:return e.name==t.name&&e.message==t.message;case Sa:case ja:return e==t+"";case jr:var a=Sp;case Pr:var l=s&Fr;if(a||(a=Pp),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;s|=Aa,o.set(e,t);var f=La(a(e),a(t),r,i,s,o);return o.delete(e),f;case lp:if($i)return $i.call(e)==$i.call(t)}return!1}function gh(e,t,n,r,i,s){var o=i&Fr,a=wa(e),l=a.length,c=wa(t),f=c.length;if(l!=f&&!o)return!1;for(var u=l;u--;){var d=a[u];if(!(o?d in t:bt.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],E=t[d];if(r)var _=o?r(E,m,d,t,e,s):r(m,E,d,e,t,s);if(!(_===void 0?m===E||n(m,E,r,i,s):_)){y=!1;break}g||(g=d=="constructor")}if(y&&!g){var U=e.constructor,K=t.constructor;U!=K&&"constructor"in e&&"constructor"in t&&!(typeof U=="function"&&U instanceof U&&typeof K=="function"&&K instanceof K)&&(y=!1)}return s.delete(e),s.delete(t),y}function Dr(e,t){var n=e.__data__;return yh(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Cn(e,t){var n=_p(e,t);return dh(n)?n:void 0}var jt=fh;(Gi&&jt(new Gi(new ArrayBuffer(1)))!=Ir||qn&&jt(new qn)!=jr||qi&&jt(qi.resolve())!=fa||Yi&&jt(new Yi)!=Pr||zi&&jt(new zi)!=Bi)&&(jt=function(e){var t=zn.call(e),n=t==An?e.constructor:void 0,r=n?an(n):void 0;if(r)switch(r){case Np:return Ir;case kp:return jr;case Rp:return fa;case Up:return Pr;case $p:return Bi}return t});function bh(e,t){return t=t==null?xa:t,!!t&&(typeof e=="number"||Ap.test(e))&&e>-1&&e%1==0&&e<t}function yh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function wh(e){return!!ma&&ma in e}function Ah(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Tr;return e===n}function an(e){if(e!=null){try{return Fa.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Da(e,t){return e===t||e!==e&&t!==t}function xh(e){return Ch(e)&&bt.call(e,"callee")&&(!Tp.call(e,"callee")||zn.call(e)==Sr)}var Vi=Array.isArray;function Na(e){return e!=null&&Ra(e.length)&&!ka(e)}function Ch(e){return Ji(e)&&Na(e)}function Oh(e,t,n){n=typeof n=="function"?n:void 0;var r=n?n(e,t):void 0;return r===void 0?Ta(e,t,n):!!r}function ka(e){var t=Qi(e)?zn.call(e):"";return t==Ea||t==ap}function Ra(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=xa}function Qi(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ji(e){return!!e&&typeof e=="object"}var vh=ha?Ep(ha):ph;function wa(e){return Na(e)?ch(e):hh(e)}xn.exports=Oh});var al=ot((Oy,sl)=>{"use strict";b();sl.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 Xi=ot((vy,cl)=>{b();var Qn=al(),ll={};for(let e of Object.keys(Qn))ll[Qn[e]]=e;var T={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};cl.exports=T;for(let e of Object.keys(T)){if(!("channels"in T[e]))throw new Error("missing channels property: "+e);if(!("labels"in T[e]))throw new Error("missing channel labels property: "+e);if(T[e].labels.length!==T[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=T[e];delete T[e].channels,delete T[e].labels,Object.defineProperty(T[e],"channels",{value:t}),Object.defineProperty(T[e],"labels",{value:n})}T.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,a,l;s===i?a=0:t===s?a=(n-r)/o:n===s?a=2+(r-t)/o:r===s&&(a=4+(t-n)/o),a=Math.min(a*60,360),a<0&&(a+=360);let 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]};T.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]};T.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=T.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,s*100,r*100]};T.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),s=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function Yh(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}T.rgb.keyword=function(e){let t=ll[e];if(t)return t;let n=1/0,r;for(let i of Object.keys(Qn)){let s=Qn[i],o=Yh(e,s);o<n&&(n=o,r=i)}return r};T.keyword.rgb=function(e){return Qn[e]};T.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,s=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};T.rgb.lab=function(e){let t=T.rgb.xyz(e),n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,o=500*(n-r),a=200*(r-i);return[s,o,a]};T.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,s,o;if(n===0)return o=r*255,[o,o,o];r<.5?i=r*(1+n):i=r+n-r*n;let a=2*r-i,l=[0,0,0];for(let 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};T.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=s<=1?s:2-s;let o=(r+n)/2,a=r===0?2*i/(s+i):2*n/(r+n);return[t,a*100,o*100]};T.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,s=t-Math.floor(t),o=255*r*(1-n),a=255*r*(1-n*s),l=255*r*(1-n*(1-s));switch(r*=255,i){case 0:return[r,l,o];case 1:return[a,r,o];case 2:return[o,r,l];case 3:return[o,a,r];case 4:return[l,o,r];case 5:return[r,o,a]}};T.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),s,o;o=(2-n)*r;let a=(2-n)*i;return s=n*i,s/=a<=1?a:2-a,s=s||0,o/=2,[t,s*100,o*100]};T.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,s;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),a=1-r;s=6*t-o,(o&1)!==0&&(s=1-s);let l=n+s*(a-n),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]};T.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,s=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};T.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,s,o;return i=t*3.2406+n*-1.5372+r*-.4986,s=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[i*255,s*255,o*255]};T.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,s=500*(t-n),o=200*(n-r);return[i,s,o]};T.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,s,o;s=(t+16)/116,i=n/500+s,o=s-r/200;let a=s**3,l=i**3,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]};T.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(n*n+r*r);return[t,o,i]};T.lch.lab=function(e){let t=e[0],n=e[1],i=e[2]/360*2*Math.PI,s=n*Math.cos(i),o=n*Math.sin(i);return[t,s,o]};T.rgb.ansi16=function(e,t=null){let[n,r,i]=e,s=t===null?T.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(o+=60),o};T.hsv.ansi16=function(e){return T.rgb.ansi16(T.hsv.rgb(e),e[2])};T.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};T.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5,r=(t&1)*n*255,i=(t>>1&1)*n*255,s=(t>>2&1)*n*255;return[r,i,s]};T.ansi256.rgb=function(e){if(e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[n,r,i]};T.rgb.hex=function(e){let n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};T.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(a=>a+a).join(""));let r=parseInt(n,16),i=r>>16&255,s=r>>8&255,o=r&255;return[i,s,o]};T.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),s=Math.min(Math.min(t,n),r),o=i-s,a,l;return o<1?a=s/(1-o):a=0,o<=0?l=0:i===t?l=(n-r)/o%6:i===n?l=2+(r-t)/o:l=4+(t-n)/o,l/=6,l%=1,[l*360,o*100,a*100]};T.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]};T.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]};T.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],s=t%1*6,o=s%1,a=1-o,l=0;switch(Math.floor(s)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};T.hcg.hsv=function(e){let t=e[1]/100,n=e[2]/100,r=t+n*(1-t),i=0;return r>0&&(i=t/r),[e[0],i*100,r*100]};T.hcg.hsl=function(e){let t=e[1]/100,r=e[2]/100*(1-t)+.5*t,i=0;return r>0&&r<.5?i=t/(2*r):r>=.5&&r<1&&(i=t/(2*(1-r))),[e[0],i*100,r*100]};T.hcg.hwb=function(e){let t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};T.hwb.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=1-n,i=r-t,s=0;return i<1&&(s=(r-i)/(1-i)),[e[0],i*100,s*100]};T.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};T.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};T.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};T.gray.hsl=function(e){return[0,0,e[0]]};T.gray.hsv=T.gray.hsl;T.gray.hwb=function(e){return[0,100,e[0]]};T.gray.cmyk=function(e){return[0,0,0,e[0]]};T.gray.lab=function(e){return[e[0],0,0]};T.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};T.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var ul=ot((Ey,fl)=>{b();var Ur=Xi();function zh(){let e={},t=Object.keys(Ur);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function Vh(e){let t=zh(),n=[e];for(t[e].distance=0;n.length;){let r=n.pop(),i=Object.keys(Ur[r]);for(let s=i.length,o=0;o<s;o++){let a=i[o],l=t[a];l.distance===-1&&(l.distance=t[r].distance+1,l.parent=r,n.unshift(a))}}return t}function Kh(e,t){return function(n){return t(e(n))}}function Qh(e,t){let n=[t[e].parent,e],r=Ur[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=Kh(Ur[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}fl.exports=function(e){let t=Vh(e),n={},r=Object.keys(t);for(let i=r.length,s=0;s<i;s++){let o=r[s];t[o].parent!==null&&(n[o]=Qh(o,t))}return n}});var pl=ot((_y,dl)=>{b();var Zi=Xi(),Jh=ul(),_n={},Xh=Object.keys(Zi);function Zh(e){let t=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function em(e){let t=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let i=e(n);if(typeof i=="object")for(let s=i.length,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}Xh.forEach(e=>{_n[e]={},Object.defineProperty(_n[e],"channels",{value:Zi[e].channels}),Object.defineProperty(_n[e],"labels",{value:Zi[e].labels});let t=Jh(e);Object.keys(t).forEach(r=>{let i=t[r];_n[e][r]=em(i),_n[e][r].raw=Zh(i)})});dl.exports=_n});var wl=ot((Sy,yl)=>{"use strict";b();var hl=(e,t)=>(...n)=>`\x1B[${e(...n)+t}m`,ml=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};5;${r}m`},gl=(e,t)=>(...n)=>{let r=e(...n);return`\x1B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},$r=e=>e,bl=(e,t,n)=>[e,t,n],Sn=(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})},eo,jn=(e,t,n,r)=>{eo===void 0&&(eo=pl());let i=r?10:0,s={};for(let[o,a]of Object.entries(eo)){let l=o==="ansi16"?"ansi":o;o===t?s[l]=e(n,i):typeof a=="object"&&(s[l]=e(a[t],i))}return s};function tm(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[n,r]of Object.entries(t)){for(let[i,s]of Object.entries(r))t[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=t[i],e.set(s[0],s[1]);Object.defineProperty(t,n,{value:r,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="\x1B[39m",t.bgColor.close="\x1B[49m",Sn(t.color,"ansi",()=>jn(hl,"ansi16",$r,!1)),Sn(t.color,"ansi256",()=>jn(ml,"ansi256",$r,!1)),Sn(t.color,"ansi16m",()=>jn(gl,"rgb",bl,!1)),Sn(t.bgColor,"ansi",()=>jn(hl,"ansi16",$r,!0)),Sn(t.bgColor,"ansi256",()=>jn(ml,"ansi256",$r,!0)),Sn(t.bgColor,"ansi16m",()=>jn(gl,"rgb",bl,!0)),t}Object.defineProperty(yl,"exports",{enumerable:!0,get:tm})});var xl=ot((jy,Al)=>{"use strict";b();Al.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}});var vl=ot((Py,Ol)=>{"use strict";b();var nm=Se("os"),Cl=Se("tty"),it=xl(),{env:Fe}=process,Nt;it("no-color")||it("no-colors")||it("color=false")||it("color=never")?Nt=0:(it("color")||it("colors")||it("color=true")||it("color=always"))&&(Nt=1);"FORCE_COLOR"in Fe&&(Fe.FORCE_COLOR==="true"?Nt=1:Fe.FORCE_COLOR==="false"?Nt=0:Nt=Fe.FORCE_COLOR.length===0?1:Math.min(parseInt(Fe.FORCE_COLOR,10),3));function to(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function no(e,t){if(Nt===0)return 0;if(it("color=16m")||it("color=full")||it("color=truecolor"))return 3;if(it("color=256"))return 2;if(e&&!t&&Nt===void 0)return 0;let n=Nt||0;if(Fe.TERM==="dumb")return n;if(process.platform==="win32"){let r=nm.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Fe)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Fe)||Fe.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Fe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Fe.TEAMCITY_VERSION)?1:0;if(Fe.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Fe){let r=parseInt((Fe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Fe.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Fe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Fe.TERM)||"COLORTERM"in Fe?1:n}function rm(e){let t=no(e,e&&e.isTTY);return to(t)}Ol.exports={supportsColor:rm,stdout:to(no(!0,Cl.isatty(1))),stderr:to(no(!0,Cl.isatty(2)))}});var _l=ot((Iy,El)=>{"use strict";b();var im=(e,t,n)=>{let r=e.indexOf(t);if(r===-1)return e;let i=t.length,s=0,o="";do o+=e.substr(s,r-s)+t+n,s=r+i,r=e.indexOf(t,s);while(r!==-1);return o+=e.substr(s),o},om=(e,t,n,r)=>{let i=0,s="";do{let o=e[r-1]==="\r";s+=e.substr(i,(o?r-1:r)-i)+t+(o?`\r
2
2
  `:`
3
3
  `)+n,i=r+1,r=e.indexOf(`
4
4
  `,i)}while(r!==-1);return s+=e.substr(i),s};El.exports={stringReplaceAll:im,stringEncaseCRLFWithFirstIndex:om}});var Ml=ot((My,Il)=>{"use strict";b();var sm=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Sl=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,am=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,lm=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,cm=new Map([["n",`
5
- `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Pl(e){let t=e[0]==="u",n=e[1]==="{";return t&&!n&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):cm.get(e)||e}function fm(e,t){let n=[],r=t.trim().split(/\s*,\s*/g),i;for(let s of r){let o=Number(s);if(!Number.isNaN(o))n.push(o);else if(i=s.match(am))n.push(i[2].replace(lm,(a,l,c)=>l?Pl(l):c));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return n}function um(e){Sl.lastIndex=0;let t=[],n;for(;(n=Sl.exec(e))!==null;){let r=n[1];if(n[2]){let i=fm(r,n[2]);t.push([r].concat(i))}else t.push([r])}return t}function jl(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}Il.exports=(e,t)=>{let n=[],r=[],i=[];if(t.replace(sm,(s,o,a,l,c,u)=>{if(o)i.push(Pl(o));else if(l){let f=i.join("");i=[],r.push(n.length===0?f:jl(e,n)(f)),n.push({inverse:a,styles:um(l)})}else if(c){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");r.push(jl(e,n)(i.join(""))),i=[],n.pop()}else i.push(u)}),r.push(i.join("")),n.length>0){let s=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return r.join("")}});var Rl=ot((Fy,kl)=>{"use strict";b();var Qn=wl(),{stdout:io,stderr:oo}=vl(),{stringReplaceAll:dm,stringEncaseCRLFWithFirstIndex:pm}=_l(),{isArray:Wr}=Array,Tl=["ansi","ansi","ansi256","ansi16m"],Pn=Object.create(null),hm=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let n=io?io.level:0;e.level=t.level===void 0?n:t.level},so=class{constructor(t){return Ll(t)}},Ll=e=>{let t={};return hm(t,e),t.template=(...n)=>Nl(t.template,...n),Object.setPrototypeOf(t,Br.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=so,t.template};function Br(e){return Ll(e)}for(let[e,t]of Object.entries(Qn))Pn[e]={get(){let n=Hr(this,ao(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};Pn.visible={get(){let e=Hr(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Dl=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of Dl)Pn[e]={get(){let{level:t}=this;return function(...n){let r=ao(Qn.color[Tl[t]][e](...n),Qn.color.close,this._styler);return Hr(this,r,this._isEmpty)}}};for(let e of Dl){let t="bg"+e[0].toUpperCase()+e.slice(1);Pn[t]={get(){let{level:n}=this;return function(...r){let i=ao(Qn.bgColor[Tl[n]][e](...r),Qn.bgColor.close,this._styler);return Hr(this,i,this._isEmpty)}}}}var mm=Object.defineProperties(()=>{},{...Pn,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),ao=(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}},Hr=(e,t,n)=>{let r=(...i)=>Wr(i[0])&&Wr(i[0].raw)?Fl(r,Nl(r,...i)):Fl(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,mm),r._generator=e,r._styler=t,r._isEmpty=n,r},Fl=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.indexOf("\x1B")!==-1)for(;n!==void 0;)t=dm(t,n.close,n.open),n=n.parent;let s=t.indexOf(`
6
- `);return s!==-1&&(t=pm(t,i,r,s)),r+t+i},ro,Nl=(e,...t)=>{let[n]=t;if(!Wr(n)||!Wr(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 ro===void 0&&(ro=Ml()),ro(e,i.join(""))};Object.defineProperties(Br.prototype,Pn);var Gr=Br();Gr.supportsColor=io;Gr.stderr=Br({level:oo?oo.level:0});Gr.stderr.supportsColor=oo;kl.exports=Gr});b();b();b();import{notStrictEqual as Bc,strictEqual as Hc}from"assert";b();b();var bc={right:Cc,center:Oc},yc=0,nr=1,wc=2,rr=3,Jr=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(`
5
+ `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Pl(e){let t=e[0]==="u",n=e[1]==="{";return t&&!n&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):cm.get(e)||e}function fm(e,t){let n=[],r=t.trim().split(/\s*,\s*/g),i;for(let s of r){let o=Number(s);if(!Number.isNaN(o))n.push(o);else if(i=s.match(am))n.push(i[2].replace(lm,(a,l,c)=>l?Pl(l):c));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return n}function um(e){Sl.lastIndex=0;let t=[],n;for(;(n=Sl.exec(e))!==null;){let r=n[1];if(n[2]){let i=fm(r,n[2]);t.push([r].concat(i))}else t.push([r])}return t}function jl(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}Il.exports=(e,t)=>{let n=[],r=[],i=[];if(t.replace(sm,(s,o,a,l,c,f)=>{if(o)i.push(Pl(o));else if(l){let u=i.join("");i=[],r.push(n.length===0?u:jl(e,n)(u)),n.push({inverse:a,styles:um(l)})}else if(c){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");r.push(jl(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 Rl=ot((Fy,kl)=>{"use strict";b();var Jn=wl(),{stdout:io,stderr:oo}=vl(),{stringReplaceAll:dm,stringEncaseCRLFWithFirstIndex:pm}=_l(),{isArray:Wr}=Array,Tl=["ansi","ansi","ansi256","ansi16m"],Pn=Object.create(null),hm=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let n=io?io.level:0;e.level=t.level===void 0?n:t.level},so=class{constructor(t){return Ll(t)}},Ll=e=>{let t={};return hm(t,e),t.template=(...n)=>Nl(t.template,...n),Object.setPrototypeOf(t,Br.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=so,t.template};function Br(e){return Ll(e)}for(let[e,t]of Object.entries(Jn))Pn[e]={get(){let n=Hr(this,ao(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};Pn.visible={get(){let e=Hr(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Dl=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of Dl)Pn[e]={get(){let{level:t}=this;return function(...n){let r=ao(Jn.color[Tl[t]][e](...n),Jn.color.close,this._styler);return Hr(this,r,this._isEmpty)}}};for(let e of Dl){let t="bg"+e[0].toUpperCase()+e.slice(1);Pn[t]={get(){let{level:n}=this;return function(...r){let i=ao(Jn.bgColor[Tl[n]][e](...r),Jn.bgColor.close,this._styler);return Hr(this,i,this._isEmpty)}}}}var mm=Object.defineProperties(()=>{},{...Pn,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),ao=(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}},Hr=(e,t,n)=>{let r=(...i)=>Wr(i[0])&&Wr(i[0].raw)?Fl(r,Nl(r,...i)):Fl(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,mm),r._generator=e,r._styler=t,r._isEmpty=n,r},Fl=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.indexOf("\x1B")!==-1)for(;n!==void 0;)t=dm(t,n.close,n.open),n=n.parent;let s=t.indexOf(`
6
+ `);return s!==-1&&(t=pm(t,i,r,s)),r+t+i},ro,Nl=(e,...t)=>{let[n]=t;if(!Wr(n)||!Wr(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 ro===void 0&&(ro=Ml()),ro(e,i.join(""))};Object.defineProperties(Br.prototype,Pn);var Gr=Br();Gr.supportsColor=io;Gr.stderr=Br({level:oo?oo.level:0});Gr.stderr.supportsColor=oo;kl.exports=Gr});b();b();b();import{notStrictEqual as Bc,strictEqual as Hc}from"assert";b();b();var bc={right:Cc,center:Oc},yc=0,rr=1,wc=2,ir=3,Jr=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&&Ke.stringWidth(i[0])>r&&(r=Math.min(Math.floor(this.width*.5),Ke.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=Ke.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]),u=o;c>Ke.stringWidth(o)&&(u+=" ".repeat(c-Ke.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap&&(u=bc[t[a].align](u,c),Ke.stringWidth(u)<c&&(u+=" ".repeat((l||0)-Ke.stringWidth(u)-1)));let f=t[a].padding||[0,0,0,0];f[rr]&&(s+=" ".repeat(f[rr])),s+=ho(t[a],u,"| "),s+=u,s+=ho(t[a],u," |"),f[nr]&&(s+=" ".repeat(f[nr])),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=Ke.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=Ke.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;c>Ke.stringWidth(o)&&(f+=" ".repeat(c-Ke.stringWidth(o))),t[a].align&&t[a].align!=="left"&&this.wrap&&(f=bc[t[a].align](f,c),Ke.stringWidth(f)<c&&(f+=" ".repeat((l||0)-Ke.stringWidth(f)-1)));let u=t[a].padding||[0,0,0,0];u[ir]&&(s+=" ".repeat(u[ir])),s+=ho(t[a],f,"| "),s+=f,s+=ho(t[a],f," |"),u[rr]&&(s+=" ".repeat(u[rr])),i===0&&n.length>0&&(s=this.renderInline(s,n[n.length-1]))}),n.push({text:s.replace(/ +$/,""),span:t.span})}),n}renderInline(t,n){let r=t.match(/^ */),i=r?r[0].length:0,s=n.text,o=Ke.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=Ke.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[yc]||0).fill("")),i.push(...new Array(s.padding[wc]||0).fill(""))),i.forEach((a,l)=>{n[l]||n.push([]);let c=n[l];for(let u=0;u<o;u++)c[u]===void 0&&c.push("");c.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[rr]||0)+(t.padding[nr]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(o=>o.width||Ke.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,Ac(t[a])):o)}};function ho(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function Ac(e){let t=e.padding||[],n=1+(t[rr]||0)+(t[nr]||0);return e.border?n+4:n}function xc(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Cc(e,t){e=e.trim();let n=Ke.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function Oc(e,t){e=e.trim();let n=Ke.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var Ke;function mo(e,t){return Ke=t,new Jr({width:(e==null?void 0:e.width)||xc(),wrap:e==null?void 0:e.wrap})}b();var go=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Xr(e){return e.replace(go,"")}function bo(e,t){let[n,r]=e.match(go)||["",""];e=Xr(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 Zr(e){return mo(e,{stringWidth:t=>[...t].length,stripAnsi:Xr,wrap:bo})}b();import{dirname as yo,resolve as wo}from"path";import{readdirSync as vc,statSync as Ec}from"fs";function Ao(e,t){let n=wo(".",e),r;for(Ec(n).isDirectory()||(n=yo(n));;){if(r=t(n,vc(n)),r)return wo(n,r);if(n=yo(r=n),r===n)break}}import{inspect as Gc}from"util";import{readFileSync as qc}from"fs";import{fileURLToPath as Yc}from"url";b();import{format as jc}from"util";import{normalize as Pc,resolve as Ic}from"path";b();function Ht(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 ir(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 or(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}b();b();function xo(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}b();var Ze;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Ze||(Ze={}));var ht,sr=class{constructor(t){ht=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=xo(t),s=typeof t=="string",o=_c(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||[],u=r.envPrefix,f=a["populate--"],d=f?"--":"_",p=Object.create(null),y=Object.create(null),g=r.__||ht.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},E=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,_=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach(function(w){let x=typeof w=="object"?w.key:w,S=Object.keys(w).map(function(C){return{boolean:"bools",string:"strings",number:"numbers"}[C]}).filter(Boolean).pop();S&&(m[S][x]=!0),m.arrays[x]=!0,m.keys.push(x)}),[].concat(r.boolean||[]).filter(Boolean).forEach(function(w){m.bools[w]=!0,m.keys.push(w)}),[].concat(r.string||[]).filter(Boolean).forEach(function(w){m.strings[w]=!0,m.keys.push(w)}),[].concat(r.number||[]).filter(Boolean).forEach(function(w){m.numbers[w]=!0,m.keys.push(w)}),[].concat(r.count||[]).filter(Boolean).forEach(function(w){m.counts[w]=!0,m.keys.push(w)}),[].concat(r.normalize||[]).filter(Boolean).forEach(function(w){m.normalize[w]=!0,m.keys.push(w)}),typeof r.narg=="object"&&Object.entries(r.narg).forEach(([w,x])=>{typeof x=="number"&&(m.nargs[w]=x,m.keys.push(w))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([w,x])=>{typeof x=="function"&&(m.coercions[w]=x,m.keys.push(w))}),typeof r.config!="undefined"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(w){m.configs[w]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([w,x])=>{(typeof x=="boolean"||typeof x=="function")&&(m.configs[w]=x)})),Tn(r.key,o,r.default,m.arrays),Object.keys(l).forEach(function(w){(m.aliases[w]||[]).forEach(function(x){l[x]=l[w]})});let U=null;Kr();let K=[],J=Object.assign(Object.create(null),{_:[]}),V={};for(let w=0;w<i.length;w++){let x=i[w],S=x.replace(/^-{3,}/,"---"),C,A,F,P,W,Pe;if(x!=="--"&&re(x))$(x);else if(S.match(/---+(=|$)/)){$(x);continue}else if(x.match(/^--.+=/)||!a["short-option-groups"]&&x.match(/^-.+=/))P=x.match(/^--?([^=]+)=([\s\S]*)$/),P!==null&&Array.isArray(P)&&P.length>=3&&(H(P[1],m.arrays)?w=ne(w,P[1],i,P[2]):H(P[1],m.nargs)!==!1?w=Z(w,P[1],i,P[2]):Y(P[1],P[2],!0));else if(x.match(_)&&a["boolean-negation"])P=x.match(_),P!==null&&Array.isArray(P)&&P.length>=2&&(A=P[1],Y(A,H(A,m.arrays)?[!1]:!1));else if(x.match(/^--.+/)||!a["short-option-groups"]&&x.match(/^-[^-]+/))P=x.match(/^--?(.+)/),P!==null&&Array.isArray(P)&&P.length>=2&&(A=P[1],H(A,m.arrays)?w=ne(w,A,i):H(A,m.nargs)!==!1?w=Z(w,A,i):(W=i[w+1],W!==void 0&&(!W.match(/^-/)||W.match(E))&&!H(A,m.bools)&&!H(A,m.counts)||/^(true|false)$/.test(W)?(Y(A,W),w++):Y(A,X(A))));else if(x.match(/^-.\..+=/))P=x.match(/^-([^=]+)=([\s\S]*)$/),P!==null&&Array.isArray(P)&&P.length>=3&&Y(P[1],P[2]);else if(x.match(/^-.\..+/)&&!x.match(E))W=i[w+1],P=x.match(/^-(.\..+)/),P!==null&&Array.isArray(P)&&P.length>=2&&(A=P[1],W!==void 0&&!W.match(/^-/)&&!H(A,m.bools)&&!H(A,m.counts)?(Y(A,W),w++):Y(A,X(A)));else if(x.match(/^-[^-]+/)&&!x.match(E)){F=x.slice(1,-1).split(""),C=!1;for(let ke=0;ke<F.length;ke++){if(W=x.slice(ke+2),F[ke+1]&&F[ke+1]==="="){Pe=x.slice(ke+3),A=F[ke],H(A,m.arrays)?w=ne(w,A,i,Pe):H(A,m.nargs)!==!1?w=Z(w,A,i,Pe):Y(A,Pe),C=!0;break}if(W==="-"){Y(F[ke],W);continue}if(/[A-Za-z]/.test(F[ke])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(W)&&H(W,m.bools)===!1){Y(F[ke],W),C=!0;break}if(F[ke+1]&&F[ke+1].match(/\W/)){Y(F[ke],W),C=!0;break}else Y(F[ke],X(F[ke]))}A=x.slice(-1)[0],!C&&A!=="-"&&(H(A,m.arrays)?w=ne(w,A,i):H(A,m.nargs)!==!1?w=Z(w,A,i):(W=i[w+1],W!==void 0&&(!/^(-|--)[^-]/.test(W)||W.match(E))&&!H(A,m.bools)&&!H(A,m.counts)||/^(true|false)$/.test(W)?(Y(A,W),w++):Y(A,X(A))))}else if(x.match(/^-[0-9]$/)&&x.match(E)&&H(x.slice(1),m.bools))A=x.slice(1),Y(A,X(A));else if(x==="--"){K=i.slice(w+1);break}else if(a["halt-at-non-option"]){K=i.slice(w);break}else $(x)}me(J,!0),me(J,!1),D(J),te(),wt(J,m.aliases,l,!0),ee(J),a["set-placeholder-key"]&&ve(J),Object.keys(m.counts).forEach(function(w){oe(J,w.split("."))||Y(w,0)}),f&&K.length&&(J[d]=[]),K.forEach(function(w){J[d].push(w)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(J).filter(w=>w!=="--"&&w.includes("-")).forEach(w=>{delete J[w]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(w=>o[w])).forEach(w=>{a["camel-case-expansion"]&&w.includes("-")&&delete J[w.split(".").map(x=>Ht(x)).join(".")],delete J[w]});function $(w){let x=j("_",w);(typeof x=="string"||typeof x=="number")&&J._.push(x)}function Z(w,x,S,C){let A,F=H(x,m.nargs);if(F=typeof F!="number"||isNaN(F)?1:F,F===0)return _e(C)||(U=Error(g("Argument unexpected for: %s",x))),Y(x,X(x)),w;let P=_e(C)?0:1;if(a["nargs-eats-options"])S.length-(w+1)+P<F&&(U=Error(g("Not enough arguments following: %s",x))),P=F;else{for(A=w+1;A<S.length&&(!S[A].match(/^-[^0-9]/)||S[A].match(E)||re(S[A]));A++)P++;P<F&&(U=Error(g("Not enough arguments following: %s",x)))}let W=Math.min(P,F);for(!_e(C)&&W>0&&(Y(x,C),W--),A=w+1;A<W+w+1;A++)Y(x,S[A]);return w+W}function ne(w,x,S,C){let A=[],F=C||S[w+1],P=H(x,m.nargs);if(H(x,m.bools)&&!/^(true|false)$/.test(F))A.push(!0);else if(_e(F)||_e(C)&&/^-/.test(F)&&!E.test(F)&&!re(F)){if(l[x]!==void 0){let W=l[x];A=Array.isArray(W)?W:[W]}}else{_e(C)||A.push(L(x,C,!0));for(let W=w+1;W<S.length&&!(!a["greedy-arrays"]&&A.length>0||P&&typeof P=="number"&&A.length>=P||(F=S[W],/^-/.test(F)&&!E.test(F)&&!re(F)));W++)w=W,A.push(L(x,F,s))}return typeof P=="number"&&(P&&A.length<P||isNaN(P)&&A.length===0)&&(U=Error(g("Not enough arguments following: %s",x))),Y(x,A),w}function Y(w,x,S=s){if(/-/.test(w)&&a["camel-case-expansion"]){let F=w.split(".").map(function(P){return Ht(P)}).join(".");ze(w,F)}let C=L(w,x,S),A=w.split(".");pt(J,A,C),m.aliases[w]&&m.aliases[w].forEach(function(F){let P=F.split(".");pt(J,P,C)}),A.length>1&&a["dot-notation"]&&(m.aliases[A[0]]||[]).forEach(function(F){let P=F.split("."),W=[].concat(A);W.shift(),P=P.concat(W),(m.aliases[w]||[]).includes(P.join("."))||pt(J,P,C)}),H(w,m.normalize)&&!H(w,m.arrays)&&[w].concat(m.aliases[w]||[]).forEach(function(P){Object.defineProperty(V,P,{enumerable:!0,get(){return x},set(W){x=typeof W=="string"?ht.normalize(W):W}})})}function ze(w,x){m.aliases[w]&&m.aliases[w].length||(m.aliases[w]=[x],p[x]=!0),m.aliases[x]&&m.aliases[x].length||ze(x,w)}function L(w,x,S){S&&(x=Sc(x)),(H(w,m.bools)||H(w,m.counts))&&typeof x=="string"&&(x=x==="true");let C=Array.isArray(x)?x.map(function(A){return j(w,A)}):j(w,x);return H(w,m.counts)&&(_e(C)||typeof C=="boolean")&&(C=ei()),H(w,m.normalize)&&H(w,m.arrays)&&(Array.isArray(x)?C=x.map(A=>ht.normalize(A)):C=ht.normalize(x)),C}function j(w,x){return!a["parse-positional-numbers"]&&w==="_"||!H(w,m.strings)&&!H(w,m.bools)&&!Array.isArray(x)&&(or(x)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${x}`)))||!_e(x)&&H(w,m.numbers))&&(x=Number(x)),x}function D(w){let x=Object.create(null);wt(x,m.aliases,l),Object.keys(m.configs).forEach(function(S){let C=w[S]||x[S];if(C)try{let A=null,F=ht.resolve(ht.cwd(),C),P=m.configs[S];if(typeof P=="function"){try{A=P(F)}catch(W){A=W}if(A instanceof Error){U=A;return}}else A=ht.require(F);z(A)}catch(A){A.name==="PermissionDenied"?U=A:w[S]&&(U=Error(g("Invalid JSON config file: %s",C)))}})}function z(w,x){Object.keys(w).forEach(function(S){let C=w[S],A=x?x+"."+S:S;typeof C=="object"&&C!==null&&!Array.isArray(C)&&a["dot-notation"]?z(C,A):(!oe(J,A.split("."))||H(A,m.arrays)&&a["combine-arrays"])&&Y(A,C)})}function te(){typeof c!="undefined"&&c.forEach(function(w){z(w)})}function me(w,x){if(typeof u=="undefined")return;let S=typeof u=="string"?u:"",C=ht.env();Object.keys(C).forEach(function(A){if(S===""||A.lastIndexOf(S,0)===0){let F=A.split("__").map(function(P,W){return W===0&&(P=P.substring(S.length)),Ht(P)});(x&&m.configs[F.join(".")]||!x)&&!oe(w,F)&&Y(F.join("."),C[A])}})}function ee(w){let x,S=new Set;Object.keys(w).forEach(function(C){if(!S.has(C)&&(x=H(C,m.coercions),typeof x=="function"))try{let A=j(C,x(w[C]));[].concat(m.aliases[C]||[],C).forEach(F=>{S.add(F),w[F]=A})}catch(A){U=A}})}function ve(w){return m.keys.forEach(x=>{~x.indexOf(".")||typeof w[x]=="undefined"&&(w[x]=void 0)}),w}function wt(w,x,S,C=!1){Object.keys(S).forEach(function(A){oe(w,A.split("."))||(pt(w,A.split("."),S[A]),C&&(y[A]=!0),(x[A]||[]).forEach(function(F){oe(w,F.split("."))||pt(w,F.split("."),S[A])}))})}function oe(w,x){let S=w;a["dot-notation"]||(x=[x.join(".")]),x.slice(0,-1).forEach(function(A){S=S[A]||{}});let C=x[x.length-1];return typeof S!="object"?!1:C in S}function pt(w,x,S){let C=w;a["dot-notation"]||(x=[x.join(".")]),x.slice(0,-1).forEach(function(Pe){Pe=Co(Pe),typeof C=="object"&&C[Pe]===void 0&&(C[Pe]={}),typeof C[Pe]!="object"||Array.isArray(C[Pe])?(Array.isArray(C[Pe])?C[Pe].push({}):C[Pe]=[C[Pe],{}],C=C[Pe][C[Pe].length-1]):C=C[Pe]});let A=Co(x[x.length-1]),F=H(x.join("."),m.arrays),P=Array.isArray(S),W=a["duplicate-arguments-array"];!W&&H(A,m.nargs)&&(W=!0,(!_e(C[A])&&m.nargs[A]===1||Array.isArray(C[A])&&C[A].length===m.nargs[A])&&(C[A]=void 0)),S===ei()?C[A]=ei(C[A]):Array.isArray(C[A])?W&&F&&P?C[A]=a["flatten-duplicate-arrays"]?C[A].concat(S):(Array.isArray(C[A][0])?C[A]:[C[A]]).concat([S]):!W&&Boolean(F)===Boolean(P)?C[A]=S:C[A]=C[A].concat([S]):C[A]===void 0&&F?C[A]=P?S:[S]:W&&!(C[A]===void 0||H(A,m.counts)||H(A,m.bools))?C[A]=[C[A],S]:C[A]=S}function Tn(...w){w.forEach(function(x){Object.keys(x||{}).forEach(function(S){m.aliases[S]||(m.aliases[S]=[].concat(o[S]||[]),m.aliases[S].concat(S).forEach(function(C){if(/-/.test(C)&&a["camel-case-expansion"]){let A=Ht(C);A!==S&&m.aliases[S].indexOf(A)===-1&&(m.aliases[S].push(A),p[A]=!0)}}),m.aliases[S].concat(S).forEach(function(C){if(C.length>1&&/[A-Z]/.test(C)&&a["camel-case-expansion"]){let A=ir(C,"-");A!==S&&m.aliases[S].indexOf(A)===-1&&(m.aliases[S].push(A),p[A]=!0)}}),m.aliases[S].forEach(function(C){m.aliases[C]=[S].concat(m.aliases[S].filter(function(A){return C!==A}))}))})})}function H(w,x){let S=[].concat(m.aliases[w]||[],w),C=Object.keys(x),A=S.find(F=>C.includes(F));return A?x[A]:!1}function cn(w){let x=Object.keys(m);return[].concat(x.map(C=>m[C])).some(function(C){return Array.isArray(C)?C.includes(w):C[w]})}function fo(w,...x){return[].concat(...x).some(function(C){let A=w.match(C);return A&&cn(A[1])})}function G(w){if(w.match(E)||!w.match(/^-[^-]+/))return!1;let x=!0,S,C=w.slice(1).split("");for(let A=0;A<C.length;A++){if(S=w.slice(A+2),!cn(C[A])){x=!1;break}if(C[A+1]&&C[A+1]==="="||S==="-"||/[A-Za-z]/.test(C[A])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(S)||C[A+1]&&C[A+1].match(/\W/))break}return x}function re(w){return a["unknown-options-as-args"]&&Ee(w)}function Ee(w){return w=w.replace(/^-{3,}/,"--"),w.match(E)||G(w)?!1:!fo(w,/^-+([^=]+?)=[\s\S]*$/,_,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function X(w){return!H(w,m.bools)&&!H(w,m.counts)&&`${w}`in l?l[w]:Te(pe(w))}function Te(w){return{[Ze.BOOLEAN]:!0,[Ze.STRING]:"",[Ze.NUMBER]:void 0,[Ze.ARRAY]:[]}[w]}function pe(w){let x=Ze.BOOLEAN;return H(w,m.strings)?x=Ze.STRING:H(w,m.numbers)?x=Ze.NUMBER:H(w,m.bools)?x=Ze.BOOLEAN:H(w,m.arrays)&&(x=Ze.ARRAY),x}function _e(w){return w===void 0}function Kr(){Object.keys(m.counts).find(w=>H(w,m.arrays)?(U=Error(g("Invalid configuration: %s, opts.count excludes opts.array.",w)),!0):H(w,m.nargs)?(U=Error(g("Invalid configuration: %s, opts.count excludes opts.narg.",w)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(V,J),configuration:a,defaulted:Object.assign({},y),error:U,newAliases:Object.assign({},p)}}};function _c(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 ei(e){return e!==void 0?e+1:1}function Co(e){return e==="__proto__"?"___proto___":e}function Sc(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}import{readFileSync as Mc}from"fs";var Oo=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])<Oo)throw Error(`yargs parser supports a minimum Node.js version of ${Oo}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Fc=process?process.env:{},vo=new sr({cwd:process.cwd,env:()=>Fc,format:jc,normalize:Pc,resolve:Ic,require:e=>{if(typeof Se!="undefined")return Se(e);if(e.match(/\.json$/))return JSON.parse(Mc(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),Ln=function(t,n){return vo.parse(t.slice(),n).argv};Ln.detailed=function(e,t){return vo.parse(e.slice(),t)};Ln.camelCase=Ht;Ln.decamelize=ir;Ln.looksLikeNumber=or;var Eo=Ln;import{basename as zc,dirname as Vc,extname as Kc,relative as Qc,resolve as Io}from"path";b();function Tc(){return Lc()?0:1}function Lc(){return Dc()&&!process.defaultApp}function Dc(){return!!process.versions.electron}function _o(){return process.argv[Tc()]}b();var ie=class extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace(this,ie)}};b();b();import{readFileSync as Nc,statSync as kc,writeFile as Rc}from"fs";import{format as Uc}from"util";import{resolve as $c}from"path";var So={fs:{readFileSync:Nc,writeFile:Rc},format:Uc,resolve:$c,exists:e=>{try{return kc(e).isFile()}catch(t){return!1}}};b();var st,ti=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=t.shift(),r=function(){};return typeof t[t.length-1]=="function"&&(r=t.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),st.format.apply(st.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),r=t.shift(),i=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?n:r;this.cache[this.locale][n]&&(o=this.cache[this.locale][n][i===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(i),st.format.apply(st.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let r="";return t.forEach(function(i,s){let o=n[s+1];r+=i,typeof o!="undefined"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],r=n.directory,i=n.locale,s=n.cb,o=this._resolveLocaleFile(r,i),a=JSON.stringify(this.cache[i],null,2);st.fs.writeFile(o,a,"utf-8",function(l){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(l)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{st.fs.readFileSync&&(t=JSON.parse(st.fs.readFileSync(n,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+n),r.code==="ENOENT")t={};else throw r}this.cache[this.locale]=t}_resolveLocaleFile(t,n){let r=st.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~n.lastIndexOf("_")){let i=st.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(t){return st.exists(t)}};function jo(e,t){st=t;let n=new ti(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 Wc=e=>jo(e,So),Po=Wc;var Zc={},Jc="require is not supported by ESM",Mo="loading a directory of commands is not supported yet for ESM",ar;try{ar=Yc(Zc.url)}catch(e){ar=process.cwd()}var Xc=ar.split("node_modules")[0],Fo={assert:{notStrictEqual:Bc,strictEqual:Hc},cliui:Zr,findUp:Ao,getEnv:e=>process.env[e],inspect:Gc,getCallerFile:()=>{throw new ie(Mo)},getProcessArgvBin:_o,mainFilename:Xc||process.cwd(),Parser:Eo,path:{basename:zc,dirname:Vc,extname:Kc,relative:Qc,resolve:Io},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:qc,require:()=>{throw new ie(Jc)},requireDirectory:()=>{throw new ie(Mo)},stringWidth:e=>[...e].length,y18n:Po({directory:Io(ar,"../../../locales"),updateFiles:!1})};b();b();b();function Re(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function ni(e,t){t.assert.strictEqual(typeof e,"string")}function fn(e){return Object.keys(e)}b();function le(e){return!!e&&!!e.then&&typeof e.then=="function"}b();b();b();function At(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),r=/\.*[\][<>]/g,i=n.shift();if(!i)throw new Error(`No command found in: ${e}`);let s={cmd:i.replace(r,""),demanded:[],optional:[]};return n.forEach((o,a)=>{let l=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===n.length-1&&(l=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(r,"").split("|"),variadic:l}):s.demanded.push({cmd:o.replace(r,"").split("|"),variadic:l})}),s}var ef=["first","second","third","fourth","fifth","sixth"];function I(e,t,n){function r(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[At(`cmd ${e}`),t,n]}try{let i=0,[s,o,a]=r(),l=[].slice.call(o);for(;l.length&&l[l.length-1]===void 0;)l.pop();let c=a||l.length;if(c<s.demanded.length)throw new ie(`Not enough arguments provided. Expected ${s.demanded.length} but received ${l.length}.`);let u=s.demanded.length+s.optional.length;if(c>u)throw new ie(`Too many arguments provided. Expected max ${u} but received ${c}.`);s.demanded.forEach(f=>{let d=l.shift(),p=To(d);f.cmd.filter(g=>g===p||g==="*").length===0&&Lo(p,f.cmd,i),i+=1}),s.optional.forEach(f=>{if(l.length===0)return;let d=l.shift(),p=To(d);f.cmd.filter(g=>g===p||g==="*").length===0&&Lo(p,f.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function To(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function Lo(e,t,n){throw new ie(`Invalid ${ef[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var lr=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,r=!0,i=!1){if(I("<array|function> [boolean] [boolean] [boolean]",[t,n,r],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let o=t[s];o.applyBeforeValidation=n,o.global=r}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=n,s.global=r,s.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,n){let r=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...r[n]||[],n];return i.option?!s.includes(i.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function Do(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Gt(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(le(i))return i.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(i,t);return le(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},e)}b();function qt(e,t,n=r=>{throw r}){try{let r=tf(e)?e():e;return le(r)?r.then(i=>t(i)):t(r)}catch(r){return n(r)}}function tf(e){return typeof e=="function"}b();function ri(e){if(typeof Se=="undefined")return null;for(let t=0,n=Object.keys(Se.cache),r;t<n.length;t++)if(r=Se.cache[n[t]],r.exports===e)return r;return null}var un=/(^\*)|(^\$0)/,ii=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=Do(s);if(i=i||(()=>{}),Array.isArray(t))if(nf(t))[t,...a]=t;else for(let c of t)this.addHandler(c);else if(of(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(No(r)){this.addHandler([t].concat(a),n,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof t=="string"){let c=At(t);a=a.map(d=>At(d).cmd);let u=!1,f=[c.cmd].concat(a).filter(d=>un.test(d)?(u=!0,!1):!0);f.length===0&&u&&f.push("$0"),u&&(c.cmd=f[0],a=f.slice(1),t=t.replace(un,c.cmd)),a.forEach(d=>{this.aliasMap[d]=c.cmd}),n!==!1&&this.usage.command(t,n,u,a,o),this.handlers[c.cmd]={original:t,description:n,handler:i,builder:r||{},middlewares:l,deprecated:o,demanded:c.demanded,optional:c.optional},u&&(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(),u=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(u,a,n,r.aliases,c,i,s,o);return le(f)?f.then(d=>this.applyMiddlewareAndGetResult(u,a,d.innerArgv,l,s,d.aliases,n)):this.applyMiddlewareAndGetResult(u,a,f.innerArgv,l,s,f.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,r,i,s,o,a,l){let c=n.builder,u=r;if(cr(c)){let f=c(r.getInternalMethods().reset(i),l);if(le(f))return f.then(d=>(u=Ro(d)?d:r,this.parseAndUpdateUsage(t,n,u,s,o,a)))}else rf(c)&&(u=r.getInternalMethods().reset(i),Object.keys(n.builder).forEach(f=>{u.option(f,c[f])}));return this.parseAndUpdateUsage(t,n,u,s,o,a)}parseAndUpdateUsage(t,n,r,i,s,o){t&&r.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(r)&&r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,n),n.description);let a=r.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return le(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=un.test(n.original)?n.original.replace(un,"").trim():n.original,i=t.filter(s=>!un.test(s));return i.push(r),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(t,n,r,i,s,o,a){let l={};if(s)return r;a.getInternalMethods().getHasOutput()||(l=this.populatePositionals(n,r,i,a));let c=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(r=Gt(r,a,c,!0),!a.getInternalMethods().getHasOutput()){let u=a.getInternalMethods().runValidation(o,l,a.parsed.error,t);r=qt(r,f=>(u(f),f))}if(n.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let u=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(r,u,!1,!1),r=Gt(r,a,c,!1),r=qt(r,f=>{let d=n.handler(f);return le(d)?d.then(()=>f):f}),t||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),le(r)&&!a.getInternalMethods().hasParseCallback()&&r.catch(f=>{try{a.getInternalMethods().getUsageInstance().fail(null,f)}catch(d){}})}return t||(i.commands.pop(),i.fullCommands.pop()),r}populatePositionals(t,n,r,i){n._=n._.slice(r.commands.length);let s=t.demanded.slice(0),o=t.optional.slice(0),a={};for(this.validation.positionalCount(s.length,n._.length);s.length;){let l=s.shift();this.populatePositional(l,n,a)}for(;o.length;){let l=o.shift();this.populatePositional(l,n,a)}return n._=r.commands.concat(n._.map(l=>""+l)),this.postProcessPositionals(n,a,this.cmdToParseOptions(t.original),i),a}populatePositional(t,n,r){let i=t.cmd[0];t.variadic?r[i]=n._.splice(0).map(String):n._.length&&(r[i]=[String(n._.shift())])}cmdToParseOptions(t){let n={array:[],default:{},alias:{},demand:{}},r=At(t);return r.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o,n.demand[s]=!0}),r.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o}),n}postProcessPositionals(t,n,r,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(r.default,s.default);for(let 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(u=>{s.configuration["unknown-options-as-args"]&&(s.key[c]=!0),o.push(`--${c}`),o.push(u)})}),!o.length)return;let a=Object.assign({},s.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(l.error)i.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let c=Object.keys(n);Object.keys(n).forEach(f=>{c.push(...l.aliases[f])});let u=i.getOptions().default;Object.keys(l.argv).forEach(f=>{c.includes(f)&&(n[f]||(n[f]=l.argv[f]),!Object.hasOwnProperty.call(u,f)&&Object.hasOwnProperty.call(t,f)&&Object.hasOwnProperty.call(l.argv,f)&&(Array.isArray(t[f])||Array.isArray(l.argv[f]))?t[f]=[].concat(t[f],l.argv[f]):t[f]=l.argv[f])})}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let r=un.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(cr(n))return n(t,!0);No(n)||Object.keys(n).forEach(r=>{t.option(r,n[r])})}moduleName(t){let n=ri(t);if(!n)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(n.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:n,desc:r}){for(let i of[t,n,r]){if(typeof i=="string"||i===!1)return i;Re(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();Re(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 ko(e,t,n,r){return new ii(e,t,n,r)}function No(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function nf(e){return e.every(t=>typeof t=="string")}function cr(e){return typeof e=="function"}function rf(e){return typeof e=="object"}function of(e){return typeof e=="object"&&!Array.isArray(e)}b();b();function xt(e={},t=()=>!0){let n={};return fn(e).forEach(r=>{t(r,e[r])&&(n[r]=e[r])}),n}b();function Ct(e){typeof process!="undefined"&&[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(e)})}function sf(e){return typeof e=="boolean"}function $o(e,t){let n=t.y18n.__,r={},i=[];r.failFn=function(j){i.push(j)};let s=null,o=null,a=!0;r.showHelpOnFail=function(j=!0,D){let[z,te]=typeof j=="string"?[!0,j]:[j,D];return e.getInternalMethods().isGlobalContext()&&(o=te),s=te,a=z,r};let l=!1;r.fail=function(j,D){let z=e.getInternalMethods().getLoggerInstance();if(i.length)for(let te=i.length-1;te>=0;--te){let me=i[te];if(sf(me)){if(D)throw D;if(j)throw Error(j)}else me(j,D,r)}else{if(e.getExitProcess()&&Ct(!0),!l){l=!0,a&&(e.showHelp("error"),z.error()),(j||D)&&z.error(j||D);let te=s||o;te&&((j||D)&&z.error(""),z.error(te))}if(D=D||new ie(j),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,D);throw D}};let c=[],u=!1;r.usage=(L,j)=>L===null?(u=!0,c=[],r):(u=!1,c.push([L,j||""]),r),r.getUsage=()=>c,r.getUsageDisabled=()=>u,r.getPositionalGroupName=()=>n("Positionals:");let f=[];r.example=(L,j)=>{f.push([L,j||""])};let d=[];r.command=function(j,D,z,te,me=!1){z&&(d=d.map(ee=>(ee[2]=!1,ee))),d.push([j,D||"",z,te,me])},r.getCommands=()=>d;let p={};r.describe=function(j,D){Array.isArray(j)?j.forEach(z=>{r.describe(z,D)}):typeof j=="object"?Object.keys(j).forEach(z=>{r.describe(z,j[z])}):p[j]=D},r.getDescriptions=()=>p;let y=[];r.epilog=L=>{y.push(L)};let g=!1,m;r.wrap=L=>{g=!0,m=L};function E(){return g||(m=ne(),g=!0),m}let _="__yargsString__:";r.deferY18nLookup=L=>_+L,r.help=function(){if(J)return J;K();let j=e.customScriptName?e.$0:t.path.basename(e.$0),D=e.getDemandedOptions(),z=e.getDemandedCommands(),te=e.getDeprecatedOptions(),me=e.getGroups(),ee=e.getOptions(),ve=[];ve=ve.concat(Object.keys(p)),ve=ve.concat(Object.keys(D)),ve=ve.concat(Object.keys(z)),ve=ve.concat(Object.keys(ee.default)),ve=ve.filter($),ve=Object.keys(ve.reduce((G,re)=>(re!=="_"&&(G[re]=!0),G),{}));let wt=E(),oe=t.cliui({width:wt,wrap:!!wt});if(!u){if(c.length)c.forEach(G=>{oe.div({text:`${G[0].replace(/\$0/g,j)}`}),G[1]&&oe.div({text:`${G[1]}`,padding:[1,0,0,0]})}),oe.div();else if(d.length){let G=null;z._?G=`${j} <${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[yc]||0).fill("")),i.push(...new Array(s.padding[wc]||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[ir]||0)+(t.padding[rr]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(o=>o.width||Ke.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,Ac(t[a])):o)}};function ho(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function Ac(e){let t=e.padding||[],n=1+(t[ir]||0)+(t[rr]||0);return e.border?n+4:n}function xc(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Cc(e,t){e=e.trim();let n=Ke.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function Oc(e,t){e=e.trim();let n=Ke.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var Ke;function mo(e,t){return Ke=t,new Jr({width:(e==null?void 0:e.width)||xc(),wrap:e==null?void 0:e.wrap})}b();var go=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Xr(e){return e.replace(go,"")}function bo(e,t){let[n,r]=e.match(go)||["",""];e=Xr(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 Zr(e){return mo(e,{stringWidth:t=>[...t].length,stripAnsi:Xr,wrap:bo})}b();import{dirname as yo,resolve as wo}from"path";import{readdirSync as vc,statSync as Ec}from"fs";function Ao(e,t){let n=wo(".",e),r;for(Ec(n).isDirectory()||(n=yo(n));;){if(r=t(n,vc(n)),r)return wo(n,r);if(n=yo(r=n),r===n)break}}import{inspect as Gc}from"util";import{readFileSync as qc}from"fs";import{fileURLToPath as Yc}from"url";b();import{format as jc}from"util";import{normalize as Pc,resolve as Ic}from"path";b();function Ht(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let n="",r=!1,i=e.match(/^-+/);for(let s=i?i[0].length:0;s<e.length;s++){let o=e.charAt(s);r&&(r=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?r=!0:o!=="-"&&o!=="_"&&(n+=o)}return n}}function or(e,t){let n=e.toLowerCase();t=t||"-";let r="";for(let i=0;i<e.length;i++){let s=n.charAt(i),o=e.charAt(i);s!==o&&i>0?r+=`${t}${n.charAt(i)}`:r+=o}return r}function sr(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}b();b();function xo(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}b();var Ze;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(Ze||(Ze={}));var ht,ar=class{constructor(t){ht=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=xo(t),s=typeof t=="string",o=_c(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.__||ht.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},E=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,_=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach(function(w){let x=typeof w=="object"?w.key:w,S=Object.keys(w).map(function(C){return{boolean:"bools",string:"strings",number:"numbers"}[C]}).filter(Boolean).pop();S&&(m[S][x]=!0),m.arrays[x]=!0,m.keys.push(x)}),[].concat(r.boolean||[]).filter(Boolean).forEach(function(w){m.bools[w]=!0,m.keys.push(w)}),[].concat(r.string||[]).filter(Boolean).forEach(function(w){m.strings[w]=!0,m.keys.push(w)}),[].concat(r.number||[]).filter(Boolean).forEach(function(w){m.numbers[w]=!0,m.keys.push(w)}),[].concat(r.count||[]).filter(Boolean).forEach(function(w){m.counts[w]=!0,m.keys.push(w)}),[].concat(r.normalize||[]).filter(Boolean).forEach(function(w){m.normalize[w]=!0,m.keys.push(w)}),typeof r.narg=="object"&&Object.entries(r.narg).forEach(([w,x])=>{typeof x=="number"&&(m.nargs[w]=x,m.keys.push(w))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([w,x])=>{typeof x=="function"&&(m.coercions[w]=x,m.keys.push(w))}),typeof r.config!="undefined"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(w){m.configs[w]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([w,x])=>{(typeof x=="boolean"||typeof x=="function")&&(m.configs[w]=x)})),Tn(r.key,o,r.default,m.arrays),Object.keys(l).forEach(function(w){(m.aliases[w]||[]).forEach(function(x){l[x]=l[w]})});let U=null;Kr();let K=[],J=Object.assign(Object.create(null),{_:[]}),V={};for(let w=0;w<i.length;w++){let x=i[w],S=x.replace(/^-{3,}/,"---"),C,A,F,P,W,Pe;if(x!=="--"&&re(x))$(x);else if(S.match(/---+(=|$)/)){$(x);continue}else if(x.match(/^--.+=/)||!a["short-option-groups"]&&x.match(/^-.+=/))P=x.match(/^--?([^=]+)=([\s\S]*)$/),P!==null&&Array.isArray(P)&&P.length>=3&&(H(P[1],m.arrays)?w=ne(w,P[1],i,P[2]):H(P[1],m.nargs)!==!1?w=Z(w,P[1],i,P[2]):Y(P[1],P[2],!0));else if(x.match(_)&&a["boolean-negation"])P=x.match(_),P!==null&&Array.isArray(P)&&P.length>=2&&(A=P[1],Y(A,H(A,m.arrays)?[!1]:!1));else if(x.match(/^--.+/)||!a["short-option-groups"]&&x.match(/^-[^-]+/))P=x.match(/^--?(.+)/),P!==null&&Array.isArray(P)&&P.length>=2&&(A=P[1],H(A,m.arrays)?w=ne(w,A,i):H(A,m.nargs)!==!1?w=Z(w,A,i):(W=i[w+1],W!==void 0&&(!W.match(/^-/)||W.match(E))&&!H(A,m.bools)&&!H(A,m.counts)||/^(true|false)$/.test(W)?(Y(A,W),w++):Y(A,X(A))));else if(x.match(/^-.\..+=/))P=x.match(/^-([^=]+)=([\s\S]*)$/),P!==null&&Array.isArray(P)&&P.length>=3&&Y(P[1],P[2]);else if(x.match(/^-.\..+/)&&!x.match(E))W=i[w+1],P=x.match(/^-(.\..+)/),P!==null&&Array.isArray(P)&&P.length>=2&&(A=P[1],W!==void 0&&!W.match(/^-/)&&!H(A,m.bools)&&!H(A,m.counts)?(Y(A,W),w++):Y(A,X(A)));else if(x.match(/^-[^-]+/)&&!x.match(E)){F=x.slice(1,-1).split(""),C=!1;for(let ke=0;ke<F.length;ke++){if(W=x.slice(ke+2),F[ke+1]&&F[ke+1]==="="){Pe=x.slice(ke+3),A=F[ke],H(A,m.arrays)?w=ne(w,A,i,Pe):H(A,m.nargs)!==!1?w=Z(w,A,i,Pe):Y(A,Pe),C=!0;break}if(W==="-"){Y(F[ke],W);continue}if(/[A-Za-z]/.test(F[ke])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(W)&&H(W,m.bools)===!1){Y(F[ke],W),C=!0;break}if(F[ke+1]&&F[ke+1].match(/\W/)){Y(F[ke],W),C=!0;break}else Y(F[ke],X(F[ke]))}A=x.slice(-1)[0],!C&&A!=="-"&&(H(A,m.arrays)?w=ne(w,A,i):H(A,m.nargs)!==!1?w=Z(w,A,i):(W=i[w+1],W!==void 0&&(!/^(-|--)[^-]/.test(W)||W.match(E))&&!H(A,m.bools)&&!H(A,m.counts)||/^(true|false)$/.test(W)?(Y(A,W),w++):Y(A,X(A))))}else if(x.match(/^-[0-9]$/)&&x.match(E)&&H(x.slice(1),m.bools))A=x.slice(1),Y(A,X(A));else if(x==="--"){K=i.slice(w+1);break}else if(a["halt-at-non-option"]){K=i.slice(w);break}else $(x)}me(J,!0),me(J,!1),D(J),te(),wt(J,m.aliases,l,!0),ee(J),a["set-placeholder-key"]&&ve(J),Object.keys(m.counts).forEach(function(w){oe(J,w.split("."))||Y(w,0)}),u&&K.length&&(J[d]=[]),K.forEach(function(w){J[d].push(w)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(J).filter(w=>w!=="--"&&w.includes("-")).forEach(w=>{delete J[w]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(w=>o[w])).forEach(w=>{a["camel-case-expansion"]&&w.includes("-")&&delete J[w.split(".").map(x=>Ht(x)).join(".")],delete J[w]});function $(w){let x=j("_",w);(typeof x=="string"||typeof x=="number")&&J._.push(x)}function Z(w,x,S,C){let A,F=H(x,m.nargs);if(F=typeof F!="number"||isNaN(F)?1:F,F===0)return _e(C)||(U=Error(g("Argument unexpected for: %s",x))),Y(x,X(x)),w;let P=_e(C)?0:1;if(a["nargs-eats-options"])S.length-(w+1)+P<F&&(U=Error(g("Not enough arguments following: %s",x))),P=F;else{for(A=w+1;A<S.length&&(!S[A].match(/^-[^0-9]/)||S[A].match(E)||re(S[A]));A++)P++;P<F&&(U=Error(g("Not enough arguments following: %s",x)))}let W=Math.min(P,F);for(!_e(C)&&W>0&&(Y(x,C),W--),A=w+1;A<W+w+1;A++)Y(x,S[A]);return w+W}function ne(w,x,S,C){let A=[],F=C||S[w+1],P=H(x,m.nargs);if(H(x,m.bools)&&!/^(true|false)$/.test(F))A.push(!0);else if(_e(F)||_e(C)&&/^-/.test(F)&&!E.test(F)&&!re(F)){if(l[x]!==void 0){let W=l[x];A=Array.isArray(W)?W:[W]}}else{_e(C)||A.push(L(x,C,!0));for(let W=w+1;W<S.length&&!(!a["greedy-arrays"]&&A.length>0||P&&typeof P=="number"&&A.length>=P||(F=S[W],/^-/.test(F)&&!E.test(F)&&!re(F)));W++)w=W,A.push(L(x,F,s))}return typeof P=="number"&&(P&&A.length<P||isNaN(P)&&A.length===0)&&(U=Error(g("Not enough arguments following: %s",x))),Y(x,A),w}function Y(w,x,S=s){if(/-/.test(w)&&a["camel-case-expansion"]){let F=w.split(".").map(function(P){return Ht(P)}).join(".");ze(w,F)}let C=L(w,x,S),A=w.split(".");pt(J,A,C),m.aliases[w]&&m.aliases[w].forEach(function(F){let P=F.split(".");pt(J,P,C)}),A.length>1&&a["dot-notation"]&&(m.aliases[A[0]]||[]).forEach(function(F){let P=F.split("."),W=[].concat(A);W.shift(),P=P.concat(W),(m.aliases[w]||[]).includes(P.join("."))||pt(J,P,C)}),H(w,m.normalize)&&!H(w,m.arrays)&&[w].concat(m.aliases[w]||[]).forEach(function(P){Object.defineProperty(V,P,{enumerable:!0,get(){return x},set(W){x=typeof W=="string"?ht.normalize(W):W}})})}function ze(w,x){m.aliases[w]&&m.aliases[w].length||(m.aliases[w]=[x],p[x]=!0),m.aliases[x]&&m.aliases[x].length||ze(x,w)}function L(w,x,S){S&&(x=Sc(x)),(H(w,m.bools)||H(w,m.counts))&&typeof x=="string"&&(x=x==="true");let C=Array.isArray(x)?x.map(function(A){return j(w,A)}):j(w,x);return H(w,m.counts)&&(_e(C)||typeof C=="boolean")&&(C=ei()),H(w,m.normalize)&&H(w,m.arrays)&&(Array.isArray(x)?C=x.map(A=>ht.normalize(A)):C=ht.normalize(x)),C}function j(w,x){return!a["parse-positional-numbers"]&&w==="_"||!H(w,m.strings)&&!H(w,m.bools)&&!Array.isArray(x)&&(sr(x)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${x}`)))||!_e(x)&&H(w,m.numbers))&&(x=Number(x)),x}function D(w){let x=Object.create(null);wt(x,m.aliases,l),Object.keys(m.configs).forEach(function(S){let C=w[S]||x[S];if(C)try{let A=null,F=ht.resolve(ht.cwd(),C),P=m.configs[S];if(typeof P=="function"){try{A=P(F)}catch(W){A=W}if(A instanceof Error){U=A;return}}else A=ht.require(F);z(A)}catch(A){A.name==="PermissionDenied"?U=A:w[S]&&(U=Error(g("Invalid JSON config file: %s",C)))}})}function z(w,x){Object.keys(w).forEach(function(S){let C=w[S],A=x?x+"."+S:S;typeof C=="object"&&C!==null&&!Array.isArray(C)&&a["dot-notation"]?z(C,A):(!oe(J,A.split("."))||H(A,m.arrays)&&a["combine-arrays"])&&Y(A,C)})}function te(){typeof c!="undefined"&&c.forEach(function(w){z(w)})}function me(w,x){if(typeof f=="undefined")return;let S=typeof f=="string"?f:"",C=ht.env();Object.keys(C).forEach(function(A){if(S===""||A.lastIndexOf(S,0)===0){let F=A.split("__").map(function(P,W){return W===0&&(P=P.substring(S.length)),Ht(P)});(x&&m.configs[F.join(".")]||!x)&&!oe(w,F)&&Y(F.join("."),C[A])}})}function ee(w){let x,S=new Set;Object.keys(w).forEach(function(C){if(!S.has(C)&&(x=H(C,m.coercions),typeof x=="function"))try{let A=j(C,x(w[C]));[].concat(m.aliases[C]||[],C).forEach(F=>{S.add(F),w[F]=A})}catch(A){U=A}})}function ve(w){return m.keys.forEach(x=>{~x.indexOf(".")||typeof w[x]=="undefined"&&(w[x]=void 0)}),w}function wt(w,x,S,C=!1){Object.keys(S).forEach(function(A){oe(w,A.split("."))||(pt(w,A.split("."),S[A]),C&&(y[A]=!0),(x[A]||[]).forEach(function(F){oe(w,F.split("."))||pt(w,F.split("."),S[A])}))})}function oe(w,x){let S=w;a["dot-notation"]||(x=[x.join(".")]),x.slice(0,-1).forEach(function(A){S=S[A]||{}});let C=x[x.length-1];return typeof S!="object"?!1:C in S}function pt(w,x,S){let C=w;a["dot-notation"]||(x=[x.join(".")]),x.slice(0,-1).forEach(function(Pe){Pe=Co(Pe),typeof C=="object"&&C[Pe]===void 0&&(C[Pe]={}),typeof C[Pe]!="object"||Array.isArray(C[Pe])?(Array.isArray(C[Pe])?C[Pe].push({}):C[Pe]=[C[Pe],{}],C=C[Pe][C[Pe].length-1]):C=C[Pe]});let A=Co(x[x.length-1]),F=H(x.join("."),m.arrays),P=Array.isArray(S),W=a["duplicate-arguments-array"];!W&&H(A,m.nargs)&&(W=!0,(!_e(C[A])&&m.nargs[A]===1||Array.isArray(C[A])&&C[A].length===m.nargs[A])&&(C[A]=void 0)),S===ei()?C[A]=ei(C[A]):Array.isArray(C[A])?W&&F&&P?C[A]=a["flatten-duplicate-arrays"]?C[A].concat(S):(Array.isArray(C[A][0])?C[A]:[C[A]]).concat([S]):!W&&Boolean(F)===Boolean(P)?C[A]=S:C[A]=C[A].concat([S]):C[A]===void 0&&F?C[A]=P?S:[S]:W&&!(C[A]===void 0||H(A,m.counts)||H(A,m.bools))?C[A]=[C[A],S]:C[A]=S}function Tn(...w){w.forEach(function(x){Object.keys(x||{}).forEach(function(S){m.aliases[S]||(m.aliases[S]=[].concat(o[S]||[]),m.aliases[S].concat(S).forEach(function(C){if(/-/.test(C)&&a["camel-case-expansion"]){let A=Ht(C);A!==S&&m.aliases[S].indexOf(A)===-1&&(m.aliases[S].push(A),p[A]=!0)}}),m.aliases[S].concat(S).forEach(function(C){if(C.length>1&&/[A-Z]/.test(C)&&a["camel-case-expansion"]){let A=or(C,"-");A!==S&&m.aliases[S].indexOf(A)===-1&&(m.aliases[S].push(A),p[A]=!0)}}),m.aliases[S].forEach(function(C){m.aliases[C]=[S].concat(m.aliases[S].filter(function(A){return C!==A}))}))})})}function H(w,x){let S=[].concat(m.aliases[w]||[],w),C=Object.keys(x),A=S.find(F=>C.includes(F));return A?x[A]:!1}function cn(w){let x=Object.keys(m);return[].concat(x.map(C=>m[C])).some(function(C){return Array.isArray(C)?C.includes(w):C[w]})}function fo(w,...x){return[].concat(...x).some(function(C){let A=w.match(C);return A&&cn(A[1])})}function G(w){if(w.match(E)||!w.match(/^-[^-]+/))return!1;let x=!0,S,C=w.slice(1).split("");for(let A=0;A<C.length;A++){if(S=w.slice(A+2),!cn(C[A])){x=!1;break}if(C[A+1]&&C[A+1]==="="||S==="-"||/[A-Za-z]/.test(C[A])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(S)||C[A+1]&&C[A+1].match(/\W/))break}return x}function re(w){return a["unknown-options-as-args"]&&Ee(w)}function Ee(w){return w=w.replace(/^-{3,}/,"--"),w.match(E)||G(w)?!1:!fo(w,/^-+([^=]+?)=[\s\S]*$/,_,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function X(w){return!H(w,m.bools)&&!H(w,m.counts)&&`${w}`in l?l[w]:Te(pe(w))}function Te(w){return{[Ze.BOOLEAN]:!0,[Ze.STRING]:"",[Ze.NUMBER]:void 0,[Ze.ARRAY]:[]}[w]}function pe(w){let x=Ze.BOOLEAN;return H(w,m.strings)?x=Ze.STRING:H(w,m.numbers)?x=Ze.NUMBER:H(w,m.bools)?x=Ze.BOOLEAN:H(w,m.arrays)&&(x=Ze.ARRAY),x}function _e(w){return w===void 0}function Kr(){Object.keys(m.counts).find(w=>H(w,m.arrays)?(U=Error(g("Invalid configuration: %s, opts.count excludes opts.array.",w)),!0):H(w,m.nargs)?(U=Error(g("Invalid configuration: %s, opts.count excludes opts.narg.",w)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(V,J),configuration:a,defaulted:Object.assign({},y),error:U,newAliases:Object.assign({},p)}}};function _c(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 ei(e){return e!==void 0?e+1:1}function Co(e){return e==="__proto__"?"___proto___":e}function Sc(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}import{readFileSync as Mc}from"fs";var Oo=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])<Oo)throw Error(`yargs parser supports a minimum Node.js version of ${Oo}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Fc=process?process.env:{},vo=new ar({cwd:process.cwd,env:()=>Fc,format:jc,normalize:Pc,resolve:Ic,require:e=>{if(typeof Se!="undefined")return Se(e);if(e.match(/\.json$/))return JSON.parse(Mc(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),Ln=function(t,n){return vo.parse(t.slice(),n).argv};Ln.detailed=function(e,t){return vo.parse(e.slice(),t)};Ln.camelCase=Ht;Ln.decamelize=or;Ln.looksLikeNumber=sr;var Eo=Ln;import{basename as zc,dirname as Vc,extname as Kc,relative as Qc,resolve as Io}from"path";b();function Tc(){return Lc()?0:1}function Lc(){return Dc()&&!process.defaultApp}function Dc(){return!!process.versions.electron}function _o(){return process.argv[Tc()]}b();var ie=class extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,ie)}};b();b();import{readFileSync as Nc,statSync as kc,writeFile as Rc}from"fs";import{format as Uc}from"util";import{resolve as $c}from"path";var So={fs:{readFileSync:Nc,writeFile:Rc},format:Uc,resolve:$c,exists:e=>{try{return kc(e).isFile()}catch(t){return!1}}};b();var st,ti=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=t.shift(),r=function(){};return typeof t[t.length-1]=="function"&&(r=t.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),st.format.apply(st.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),r=t.shift(),i=t.shift(),s=function(){};typeof t[t.length-1]=="function"&&(s=t.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?n:r;this.cache[this.locale][n]&&(o=this.cache[this.locale][n][i===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(i),st.format.apply(st.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let r="";return t.forEach(function(i,s){let o=n[s+1];r+=i,typeof o!="undefined"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],r=n.directory,i=n.locale,s=n.cb,o=this._resolveLocaleFile(r,i),a=JSON.stringify(this.cache[i],null,2);st.fs.writeFile(o,a,"utf-8",function(l){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),s(l)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{st.fs.readFileSync&&(t=JSON.parse(st.fs.readFileSync(n,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+n),r.code==="ENOENT")t={};else throw r}this.cache[this.locale]=t}_resolveLocaleFile(t,n){let r=st.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~n.lastIndexOf("_")){let i=st.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(i)&&(r=i)}return r}_fileExistsSync(t){return st.exists(t)}};function jo(e,t){st=t;let n=new ti(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 Wc=e=>jo(e,So),Po=Wc;var Zc={},Jc="require is not supported by ESM",Mo="loading a directory of commands is not supported yet for ESM",Dn;try{Dn=Yc(Zc.url)}catch(e){Dn=process.cwd()}var Xc=Dn.substring(0,Dn.lastIndexOf("node_modules")),Fo={assert:{notStrictEqual:Bc,strictEqual:Hc},cliui:Zr,findUp:Ao,getEnv:e=>process.env[e],inspect:Gc,getCallerFile:()=>{throw new ie(Mo)},getProcessArgvBin:_o,mainFilename:Xc||process.cwd(),Parser:Eo,path:{basename:zc,dirname:Vc,extname:Kc,relative:Qc,resolve:Io},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:qc,require:()=>{throw new ie(Jc)},requireDirectory:()=>{throw new ie(Mo)},stringWidth:e=>[...e].length,y18n:Po({directory:Io(Dn,"../../../locales"),updateFiles:!1})};b();b();b();function Re(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function ni(e,t){t.assert.strictEqual(typeof e,"string")}function fn(e){return Object.keys(e)}b();function se(e){return!!e&&!!e.then&&typeof e.then=="function"}b();b();b();function At(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),r=/\.*[\][<>]/g,i=n.shift();if(!i)throw new Error(`No command found in: ${e}`);let s={cmd:i.replace(r,""),demanded:[],optional:[]};return n.forEach((o,a)=>{let l=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===n.length-1&&(l=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(r,"").split("|"),variadic:l}):s.demanded.push({cmd:o.replace(r,"").split("|"),variadic:l})}),s}var ef=["first","second","third","fourth","fifth","sixth"];function I(e,t,n){function r(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[At(`cmd ${e}`),t,n]}try{let i=0,[s,o,a]=r(),l=[].slice.call(o);for(;l.length&&l[l.length-1]===void 0;)l.pop();let c=a||l.length;if(c<s.demanded.length)throw new ie(`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 ie(`Too many arguments provided. Expected max ${f} but received ${c}.`);s.demanded.forEach(u=>{let d=l.shift(),p=To(d);u.cmd.filter(g=>g===p||g==="*").length===0&&Lo(p,u.cmd,i),i+=1}),s.optional.forEach(u=>{if(l.length===0)return;let d=l.shift(),p=To(d);u.cmd.filter(g=>g===p||g==="*").length===0&&Lo(p,u.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function To(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function Lo(e,t,n){throw new ie(`Invalid ${ef[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var lr=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,r=!0,i=!1){if(I("<array|function> [boolean] [boolean] [boolean]",[t,n,r],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if(typeof t[s]!="function")throw Error("middleware must be a function");let o=t[s];o.applyBeforeValidation=n,o.global=r}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let s=t;s.applyBeforeValidation=n,s.global=r,s.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,n){let r=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...r[n]||[],n];return i.option?!s.includes(i.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function Do(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Gt(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(se(i))return i.then(o=>Promise.all([o,s(o,t)])).then(([o,a])=>Object.assign(o,a));{let o=s(i,t);return se(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},e)}b();function qt(e,t,n=r=>{throw r}){try{let r=tf(e)?e():e;return se(r)?r.then(i=>t(i)):t(r)}catch(r){return n(r)}}function tf(e){return typeof e=="function"}b();function ri(e){if(typeof Se=="undefined")return null;for(let t=0,n=Object.keys(Se.cache),r;t<n.length;t++)if(r=Se.cache[n[t]],r.exports===e)return r;return null}var un=/(^\*)|(^\$0)/,ii=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=Do(s);if(i=i||(()=>{}),Array.isArray(t))if(nf(t))[t,...a]=t;else for(let c of t)this.addHandler(c);else if(of(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(No(r)){this.addHandler([t].concat(a),n,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof t=="string"){let c=At(t);a=a.map(d=>At(d).cmd);let f=!1,u=[c.cmd].concat(a).filter(d=>un.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(un,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 se(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(cr(c)){let u=c(r.getInternalMethods().reset(i),l);if(se(u))return u.then(d=>(f=Ro(d)?d:r,this.parseAndUpdateUsage(t,n,f,s,o,a)))}else rf(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 se(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=un.test(n.original)?n.original.replace(un,"").trim():n.original,i=t.filter(s=>!un.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=qt(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=Gt(r,o,a,!1),r=qt(r,f=>{let u=n.handler(f);return se(u)?u.then(()=>f):f}),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),se(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=Gt(r,a,c,!0);return se(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=At(t);return r.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o,n.demand[s]=!0}),r.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(n.array.push(s),n.default[s]=[]),n.alias[s]=o}),n}postProcessPositionals(t,n,r,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(r.default,s.default);for(let 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=un.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(cr(n))return n(t,!0);No(n)||Object.keys(n).forEach(r=>{t.option(r,n[r])})}moduleName(t){let n=ri(t);if(!n)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(n.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:n,desc:r}){for(let i of[t,n,r]){if(typeof i=="string"||i===!1)return i;Re(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();Re(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 ko(e,t,n,r){return new ii(e,t,n,r)}function No(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function nf(e){return e.every(t=>typeof t=="string")}function cr(e){return typeof e=="function"}function rf(e){return typeof e=="object"}function of(e){return typeof e=="object"&&!Array.isArray(e)}b();b();function xt(e={},t=()=>!0){let n={};return fn(e).forEach(r=>{t(r,e[r])&&(n[r]=e[r])}),n}b();function Ct(e){typeof process!="undefined"&&[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(e)})}function sf(e){return typeof e=="boolean"}function $o(e,t){let n=t.y18n.__,r={},i=[];r.failFn=function(j){i.push(j)};let s=null,o=null,a=!0;r.showHelpOnFail=function(j=!0,D){let[z,te]=typeof j=="string"?[!0,j]:[j,D];return e.getInternalMethods().isGlobalContext()&&(o=te),s=te,a=z,r};let l=!1;r.fail=function(j,D){let z=e.getInternalMethods().getLoggerInstance();if(i.length)for(let te=i.length-1;te>=0;--te){let me=i[te];if(sf(me)){if(D)throw D;if(j)throw Error(j)}else me(j,D,r)}else{if(e.getExitProcess()&&Ct(!0),!l){l=!0,a&&(e.showHelp("error"),z.error()),(j||D)&&z.error(j||D);let te=s||o;te&&((j||D)&&z.error(""),z.error(te))}if(D=D||new ie(j),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,D);throw D}};let c=[],f=!1;r.usage=(L,j)=>L===null?(f=!0,c=[],r):(f=!1,c.push([L,j||""]),r),r.getUsage=()=>c,r.getUsageDisabled=()=>f,r.getPositionalGroupName=()=>n("Positionals:");let u=[];r.example=(L,j)=>{u.push([L,j||""])};let d=[];r.command=function(j,D,z,te,me=!1){z&&(d=d.map(ee=>(ee[2]=!1,ee))),d.push([j,D||"",z,te,me])},r.getCommands=()=>d;let p={};r.describe=function(j,D){Array.isArray(j)?j.forEach(z=>{r.describe(z,D)}):typeof j=="object"?Object.keys(j).forEach(z=>{r.describe(z,j[z])}):p[j]=D},r.getDescriptions=()=>p;let y=[];r.epilog=L=>{y.push(L)};let g=!1,m;r.wrap=L=>{g=!0,m=L};function E(){return g||(m=ne(),g=!0),m}let _="__yargsString__:";r.deferY18nLookup=L=>_+L,r.help=function(){if(J)return J;K();let j=e.customScriptName?e.$0:t.path.basename(e.$0),D=e.getDemandedOptions(),z=e.getDemandedCommands(),te=e.getDeprecatedOptions(),me=e.getGroups(),ee=e.getOptions(),ve=[];ve=ve.concat(Object.keys(p)),ve=ve.concat(Object.keys(D)),ve=ve.concat(Object.keys(z)),ve=ve.concat(Object.keys(ee.default)),ve=ve.filter($),ve=Object.keys(ve.reduce((G,re)=>(re!=="_"&&(G[re]=!0),G),{}));let wt=E(),oe=t.cliui({width:wt,wrap:!!wt});if(!f){if(c.length)c.forEach(G=>{oe.div({text:`${G[0].replace(/\$0/g,j)}`}),G[1]&&oe.div({text:`${G[1]}`,padding:[1,0,0,0]})}),oe.div();else if(d.length){let G=null;z._?G=`${j} <${n("command")}>
12
12
  `:G=`${j} [${n("command")}]
13
- `,oe.div(`${G}`)}}if(d.length>1||d.length===1&&!d[0][2]){oe.div(n("Commands:"));let G=e.getInternalMethods().getContext(),re=G.commands.length?`${G.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(d=d.sort((X,Te)=>X[0].localeCompare(Te[0])));let Ee=j?`${j} `:"";d.forEach(X=>{let Te=`${Ee}${re}${X[0].replace(/^\$0 ?/,"")}`;oe.span({text:Te,padding:[0,2,0,2],width:U(d,wt,`${j}${re}`)+4},{text:X[1]});let pe=[];X[2]&&pe.push(`[${n("default")}]`),X[3]&&X[3].length&&pe.push(`[${n("aliases:")} ${X[3].join(", ")}]`),X[4]&&(typeof X[4]=="string"?pe.push(`[${n("deprecated: %s",X[4])}]`):pe.push(`[${n("deprecated")}]`)),pe.length?oe.div({text:pe.join(" "),padding:[0,0,0,2],align:"right"}):oe.div()}),oe.div()}let pt=(Object.keys(ee.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);ve=ve.filter(G=>!e.parsed.newAliases[G]&&pt.every(re=>(ee.alias[re]||[]).indexOf(G)===-1));let Tn=n("Options:");me[Tn]||(me[Tn]=[]),V(ve,ee.alias,me,Tn);let H=G=>/^--/.test(fr(G)),cn=Object.keys(me).filter(G=>me[G].length>0).map(G=>{let re=me[G].filter($).map(Ee=>{if(pt.includes(Ee))return Ee;for(let X=0,Te;(Te=pt[X])!==void 0;X++)if((ee.alias[Te]||[]).includes(Ee))return Te;return Ee});return{groupName:G,normalizedKeys:re}}).filter(({normalizedKeys:G})=>G.length>0).map(({groupName:G,normalizedKeys:re})=>{let Ee=re.reduce((X,Te)=>(X[Te]=[Te].concat(ee.alias[Te]||[]).map(pe=>G===r.getPositionalGroupName()?pe:(/^[0-9]$/.test(pe)?ee.boolean.includes(Te)?"-":"--":pe.length>1?"--":"-")+pe).sort((pe,_e)=>H(pe)===H(_e)?0:H(pe)?1:-1).join(", "),X),{});return{groupName:G,normalizedKeys:re,switches:Ee}});if(cn.filter(({groupName:G})=>G!==r.getPositionalGroupName()).some(({normalizedKeys:G,switches:re})=>!G.every(Ee=>H(re[Ee])))&&cn.filter(({groupName:G})=>G!==r.getPositionalGroupName()).forEach(({normalizedKeys:G,switches:re})=>{G.forEach(Ee=>{H(re[Ee])&&(re[Ee]=af(re[Ee],4))})}),cn.forEach(({groupName:G,normalizedKeys:re,switches:Ee})=>{oe.div(G),re.forEach(X=>{let Te=Ee[X],pe=p[X]||"",_e=null;pe.includes(_)&&(pe=n(pe.substring(_.length))),ee.boolean.includes(X)&&(_e=`[${n("boolean")}]`),ee.count.includes(X)&&(_e=`[${n("count")}]`),ee.string.includes(X)&&(_e=`[${n("string")}]`),ee.normalize.includes(X)&&(_e=`[${n("string")}]`),ee.array.includes(X)&&(_e=`[${n("array")}]`),ee.number.includes(X)&&(_e=`[${n("number")}]`);let Kr=x=>typeof x=="string"?`[${n("deprecated: %s",x)}]`:`[${n("deprecated")}]`,w=[X in te?Kr(te[X]):null,_e,X in D?`[${n("required")}]`:null,ee.choices&&ee.choices[X]?`[${n("choices:")} ${r.stringifiedValues(ee.choices[X])}]`:null,Z(ee.default[X],ee.defaultDescription[X])].filter(Boolean).join(" ");oe.span({text:fr(Te),padding:[0,2,0,2+Uo(Te)],width:U(Ee,wt)+4},pe),w?oe.div({text:w,padding:[0,0,0,2],align:"right"}):oe.div()}),oe.div()}),f.length&&(oe.div(n("Examples:")),f.forEach(G=>{G[0]=G[0].replace(/\$0/g,j)}),f.forEach(G=>{G[1]===""?oe.div({text:G[0],padding:[0,2,0,2]}):oe.div({text:G[0],padding:[0,2,0,2],width:U(f,wt)+4},{text:G[1]})}),oe.div()),y.length>0){let G=y.map(re=>re.replace(/\$0/g,j)).join(`
13
+ `,oe.div(`${G}`)}}if(d.length>1||d.length===1&&!d[0][2]){oe.div(n("Commands:"));let G=e.getInternalMethods().getContext(),re=G.commands.length?`${G.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(d=d.sort((X,Te)=>X[0].localeCompare(Te[0])));let Ee=j?`${j} `:"";d.forEach(X=>{let Te=`${Ee}${re}${X[0].replace(/^\$0 ?/,"")}`;oe.span({text:Te,padding:[0,2,0,2],width:U(d,wt,`${j}${re}`)+4},{text:X[1]});let pe=[];X[2]&&pe.push(`[${n("default")}]`),X[3]&&X[3].length&&pe.push(`[${n("aliases:")} ${X[3].join(", ")}]`),X[4]&&(typeof X[4]=="string"?pe.push(`[${n("deprecated: %s",X[4])}]`):pe.push(`[${n("deprecated")}]`)),pe.length?oe.div({text:pe.join(" "),padding:[0,0,0,2],align:"right"}):oe.div()}),oe.div()}let pt=(Object.keys(ee.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);ve=ve.filter(G=>!e.parsed.newAliases[G]&&pt.every(re=>(ee.alias[re]||[]).indexOf(G)===-1));let Tn=n("Options:");me[Tn]||(me[Tn]=[]),V(ve,ee.alias,me,Tn);let H=G=>/^--/.test(fr(G)),cn=Object.keys(me).filter(G=>me[G].length>0).map(G=>{let re=me[G].filter($).map(Ee=>{if(pt.includes(Ee))return Ee;for(let X=0,Te;(Te=pt[X])!==void 0;X++)if((ee.alias[Te]||[]).includes(Ee))return Te;return Ee});return{groupName:G,normalizedKeys:re}}).filter(({normalizedKeys:G})=>G.length>0).map(({groupName:G,normalizedKeys:re})=>{let Ee=re.reduce((X,Te)=>(X[Te]=[Te].concat(ee.alias[Te]||[]).map(pe=>G===r.getPositionalGroupName()?pe:(/^[0-9]$/.test(pe)?ee.boolean.includes(Te)?"-":"--":pe.length>1?"--":"-")+pe).sort((pe,_e)=>H(pe)===H(_e)?0:H(pe)?1:-1).join(", "),X),{});return{groupName:G,normalizedKeys:re,switches:Ee}});if(cn.filter(({groupName:G})=>G!==r.getPositionalGroupName()).some(({normalizedKeys:G,switches:re})=>!G.every(Ee=>H(re[Ee])))&&cn.filter(({groupName:G})=>G!==r.getPositionalGroupName()).forEach(({normalizedKeys:G,switches:re})=>{G.forEach(Ee=>{H(re[Ee])&&(re[Ee]=af(re[Ee],4))})}),cn.forEach(({groupName:G,normalizedKeys:re,switches:Ee})=>{oe.div(G),re.forEach(X=>{let Te=Ee[X],pe=p[X]||"",_e=null;pe.includes(_)&&(pe=n(pe.substring(_.length))),ee.boolean.includes(X)&&(_e=`[${n("boolean")}]`),ee.count.includes(X)&&(_e=`[${n("count")}]`),ee.string.includes(X)&&(_e=`[${n("string")}]`),ee.normalize.includes(X)&&(_e=`[${n("string")}]`),ee.array.includes(X)&&(_e=`[${n("array")}]`),ee.number.includes(X)&&(_e=`[${n("number")}]`);let Kr=x=>typeof x=="string"?`[${n("deprecated: %s",x)}]`:`[${n("deprecated")}]`,w=[X in te?Kr(te[X]):null,_e,X in D?`[${n("required")}]`:null,ee.choices&&ee.choices[X]?`[${n("choices:")} ${r.stringifiedValues(ee.choices[X])}]`:null,Z(ee.default[X],ee.defaultDescription[X])].filter(Boolean).join(" ");oe.span({text:fr(Te),padding:[0,2,0,2+Uo(Te)],width:U(Ee,wt)+4},pe),w?oe.div({text:w,padding:[0,0,0,2],align:"right"}):oe.div()}),oe.div()}),u.length&&(oe.div(n("Examples:")),u.forEach(G=>{G[0]=G[0].replace(/\$0/g,j)}),u.forEach(G=>{G[1]===""?oe.div({text:G[0],padding:[0,2,0,2]}):oe.div({text:G[0],padding:[0,2,0,2],width:U(u,wt)+4},{text:G[1]})}),oe.div()),y.length>0){let G=y.map(re=>re.replace(/\$0/g,j)).join(`
14
14
  `);oe.div(`${G}
15
- `)}return oe.toString().replace(/\s*$/,"")};function U(L,j,D){let z=0;return Array.isArray(L)||(L=Object.values(L).map(te=>[te])),L.forEach(te=>{z=Math.max(t.stringWidth(D?`${D} ${fr(te[0])}`:fr(te[0]))+Uo(te[0]),z)}),j&&(z=Math.min(z,parseInt((j*.5).toString(),10))),z}function K(){let L=e.getDemandedOptions(),j=e.getOptions();(Object.keys(j.alias)||[]).forEach(D=>{j.alias[D].forEach(z=>{p[z]&&r.describe(D,p[z]),z in L&&e.demandOption(D,L[z]),j.boolean.includes(z)&&e.boolean(D),j.count.includes(z)&&e.count(D),j.string.includes(z)&&e.string(D),j.normalize.includes(z)&&e.normalize(D),j.array.includes(z)&&e.array(D),j.number.includes(z)&&e.number(D)})})}let J;r.cacheHelpMessage=function(){J=this.help()},r.clearCachedHelpMessage=function(){J=void 0},r.hasCachedHelpMessage=function(){return!!J};function V(L,j,D,z){let te=[],me=null;return Object.keys(D).forEach(ee=>{te=te.concat(D[ee])}),L.forEach(ee=>{me=[ee].concat(j[ee]),me.some(ve=>te.indexOf(ve)!==-1)||D[z].push(ee)}),te}function $(L){return e.getOptions().hiddenOptions.indexOf(L)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}r.showHelp=L=>{let j=e.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:j[L])(r.help())},r.functionDescription=L=>{let j=L.name?t.Parser.decamelize(L.name,"-"):n("generated-value");return["(",j,")"].join("")},r.stringifiedValues=function(j,D){let z="",te=D||", ",me=[].concat(j);return!j||!me.length||me.forEach(ee=>{z.length&&(z+=te),z+=JSON.stringify(ee)}),z};function Z(L,j){let D=`[${n("default:")} `;if(L===void 0&&!j)return null;if(j)D+=j;else switch(typeof L){case"string":D+=`"${L}"`;break;case"object":D+=JSON.stringify(L);break;default:D+=L}return`${D}]`}function ne(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let Y=null;r.version=L=>{Y=L},r.showVersion=L=>{let j=e.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:j[L])(Y)},r.reset=function(j){return s=null,l=!1,c=[],u=!1,y=[],f=[],d=[],p=xt(p,D=>!j[D]),r};let ze=[];return r.freeze=function(){ze.push({failMessage:s,failureOutput:l,usages:c,usageDisabled:u,epilogs:y,examples:f,commands:d,descriptions:p})},r.unfreeze=function(j=!1){let D=ze.pop();!D||(j?(p={...D.descriptions,...p},d=[...D.commands,...d],c=[...D.usages,...c],f=[...D.examples,...f],y=[...D.epilogs,...y]):{failMessage:s,failureOutput:l,usages:c,usageDisabled:u,epilogs:y,examples:f,commands:d,descriptions:p}=D)},r}function oi(e){return typeof e=="object"}function af(e,t){return oi(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Uo(e){return oi(e)?e.indentation:0}function fr(e){return oi(e)?e.text:e}b();b();var Wo=`###-begin-{{app_name}}-completions-###
15
+ `)}return oe.toString().replace(/\s*$/,"")};function U(L,j,D){let z=0;return Array.isArray(L)||(L=Object.values(L).map(te=>[te])),L.forEach(te=>{z=Math.max(t.stringWidth(D?`${D} ${fr(te[0])}`:fr(te[0]))+Uo(te[0]),z)}),j&&(z=Math.min(z,parseInt((j*.5).toString(),10))),z}function K(){let L=e.getDemandedOptions(),j=e.getOptions();(Object.keys(j.alias)||[]).forEach(D=>{j.alias[D].forEach(z=>{p[z]&&r.describe(D,p[z]),z in L&&e.demandOption(D,L[z]),j.boolean.includes(z)&&e.boolean(D),j.count.includes(z)&&e.count(D),j.string.includes(z)&&e.string(D),j.normalize.includes(z)&&e.normalize(D),j.array.includes(z)&&e.array(D),j.number.includes(z)&&e.number(D)})})}let J;r.cacheHelpMessage=function(){J=this.help()},r.clearCachedHelpMessage=function(){J=void 0},r.hasCachedHelpMessage=function(){return!!J};function V(L,j,D,z){let te=[],me=null;return Object.keys(D).forEach(ee=>{te=te.concat(D[ee])}),L.forEach(ee=>{me=[ee].concat(j[ee]),me.some(ve=>te.indexOf(ve)!==-1)||D[z].push(ee)}),te}function $(L){return e.getOptions().hiddenOptions.indexOf(L)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}r.showHelp=L=>{let j=e.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:j[L])(r.help())},r.functionDescription=L=>{let j=L.name?t.Parser.decamelize(L.name,"-"):n("generated-value");return["(",j,")"].join("")},r.stringifiedValues=function(j,D){let z="",te=D||", ",me=[].concat(j);return!j||!me.length||me.forEach(ee=>{z.length&&(z+=te),z+=JSON.stringify(ee)}),z};function Z(L,j){let D=`[${n("default:")} `;if(L===void 0&&!j)return null;if(j)D+=j;else switch(typeof L){case"string":D+=`"${L}"`;break;case"object":D+=JSON.stringify(L);break;default:D+=L}return`${D}]`}function ne(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let Y=null;r.version=L=>{Y=L},r.showVersion=L=>{let j=e.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:j[L])(Y)},r.reset=function(j){return s=null,l=!1,c=[],f=!1,y=[],u=[],d=[],p=xt(p,D=>!j[D]),r};let ze=[];return r.freeze=function(){ze.push({failMessage:s,failureOutput:l,usages:c,usageDisabled:f,epilogs:y,examples:u,commands:d,descriptions:p})},r.unfreeze=function(j=!1){let D=ze.pop();!D||(j?(p={...D.descriptions,...p},d=[...D.commands,...d],c=[...D.usages,...c],u=[...D.examples,...u],y=[...D.epilogs,...y]):{failMessage:s,failureOutput:l,usages:c,usageDisabled:f,epilogs:y,examples:u,commands:d,descriptions:p}=D)},r}function oi(e){return typeof e=="object"}function af(e,t){return oi(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Uo(e){return oi(e)?e.indentation:0}function fr(e){return oi(e)?e.text:e}b();b();var Wo=`###-begin-{{app_name}}-completions-###
16
16
  #
17
17
  # yargs command completion script
18
18
  #
@@ -46,7 +46,7 @@ complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name
46
46
  # yargs command completion script
47
47
  #
48
48
  # Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
49
- # or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.
49
+ # or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
50
50
  #
51
51
  _{{app_name}}_yargs_completions()
52
52
  {
@@ -59,38 +59,38 @@ _{{app_name}}_yargs_completions()
59
59
  }
60
60
  compdef _{{app_name}}_yargs_completions {{app_name}}
61
61
  ###-end-{{app_name}}-completions-###
62
- `;var si=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(cr(c)){this.indexAfterLastReset=a+1;let u=this.yargs.getInternalMethods().reset();return c(u,!0),u.argv}}let o=[];this.commandCompletions(o,t,r),this.optionCompletions(o,t,n,r),this.choicesFromOptionsCompletions(o,t,n,r),this.choicesFromPositionalsCompletions(o,t,n,r),i(null,o)}commandCompletions(t,n,r){let i=this.yargs.getInternalMethods().getContext().commands;!r.match(/^-/)&&i[i.length-1]!==r&&!this.previousArgHasChoices(n)&&this.usage.getCommands().forEach(s=>{let o=At(s[0]).cmd;if(n.indexOf(o)===-1)if(!this.zshShell)t.push(o);else{let a=s[1]||"";t.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(t,n,r,i){if((i.match(/^-/)||i===""&&t.length===0)&&!this.previousArgHasChoices(n)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let l=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!s.hiddenOptions.includes(a)&&!this.argsContainKey(n,r,a,l)&&(this.completeOptionKey(a,t,i),l&&!!s.default[a]&&this.completeOptionKey(`no-${a}`,t,i))})}}choicesFromOptionsCompletions(t,n,r,i){if(this.previousArgHasChoices(n)){let s=this.getPreviousArgChoices(n);s&&s.length>0&&t.push(...s.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,i){if(t.indexOf(`--${r}`)!==-1||i&&t.indexOf(`--no-${r}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[r])if(n[s]!==void 0)return!0}return!1}completeOptionKey(t,n,r){let i=this.usage.getDescriptions(),s=l=>/^--/.test(l),o=l=>/^[^0-9]$/.test(l),a=!s(r)&&o(t)?"-":"--";if(!this.zshShell)n.push(a+t);else{let l=i[t]||"";n.push(a+`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","")}`)}}customCompletion(t,n,r,i){if(Re(this.customCompletionFunction,null,this.shim),cf(this.customCompletionFunction)){let s=this.customCompletionFunction(r,n);return le(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 ff(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 le(i)?i.then(s):s(i)}generateCompletionScript(t,n){let r=this.zshShell?Bo:Wo,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 Ho(e,t,n,r){return new si(e,t,n,r)}function cf(e){return e.length<3}function ff(e){return e.length>3}b();b();function Go(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 qo=["$0","--","_"];function Yo(e,t,n){let r=n.y18n.__,i=n.y18n.__n,s={};s.nonOptionCount=function(f){let d=e.getDemandedCommands(),y=f._.length+(f["--"]?f["--"].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(f,d){d<f&&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+"",f+""))},s.requiredArguments=function(f,d){let p=null;for(let y of Object.keys(d))(!Object.prototype.hasOwnProperty.call(f,y)||typeof f[y]=="undefined")&&(p=p||{},p[y]=d[y]);if(p){let y=[];for(let m of Object.keys(p)){let E=p[m];E&&y.indexOf(E)<0&&y.push(E)}let g=y.length?`
62
+ `;var si=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(cr(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=At(s[0]).cmd;if(n.indexOf(o)===-1)if(!this.zshShell)t.push(o);else{let a=s[1]||"";t.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(t,n,r,i){if((i.match(/^-/)||i===""&&t.length===0)&&!this.previousArgHasChoices(n)){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let l=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!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(Re(this.customCompletionFunction,null,this.shim),cf(this.customCompletionFunction)){let s=this.customCompletionFunction(r,n);return se(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 ff(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 se(i)?i.then(s):s(i)}generateCompletionScript(t,n){let r=this.zshShell?Bo:Wo,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 Ho(e,t,n,r){return new si(e,t,n,r)}function cf(e){return e.length<3}function ff(e){return e.length>3}b();b();function Go(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 qo=["$0","--","_"];function Yo(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 E=p[m];E&&y.indexOf(E)<0&&y.push(E)}let g=y.length?`
63
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(f,d,p,y,g=!0){var m;let E=e.getInternalMethods().getCommandInstance().getCommands(),_=[],U=e.getInternalMethods().getContext();if(Object.keys(f).forEach(K=>{!qo.includes(K)&&!Object.prototype.hasOwnProperty.call(p,K)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),K)&&!s.isValidAndSomeAliasIsNotNew(K,d)&&_.push(K)}),g&&(U.commands.length>0||E.length>0||y)&&f._.slice(U.commands.length).forEach(K=>{E.includes(""+K)||_.push(""+K)}),g){let J=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,V=U.commands.length+J;V<f._.length&&f._.slice(V).forEach($=>{$=String($),!U.commands.includes($)&&!_.includes($)&&_.push($)})}_.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",_.length,_.map(K=>K.trim()?K:`"${K}"`).join(", ")))},s.unknownCommands=function(f){let d=e.getInternalMethods().getCommandInstance().getCommands(),p=[],y=e.getInternalMethods().getContext();return(y.commands.length>0||d.length>0)&&f._.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(f,d){if(!Object.prototype.hasOwnProperty.call(d,f))return!1;let p=e.parsed.newAliases;return[f,...d[f]].some(y=>!Object.prototype.hasOwnProperty.call(p,y)||!p[f])},s.limitedChoices=function(f){let d=e.getOptions(),p={};if(!Object.keys(d.choices).length)return;Object.keys(f).forEach(m=>{qo.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(d.choices,m)&&[].concat(f[m]).forEach(E=>{d.choices[m].indexOf(E)===-1&&E!==void 0&&(p[m]=(p[m]||[]).concat(E))})});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(f,d){I("<string|object> [array|number|string]",[f,d],arguments.length),typeof f=="object"?Object.keys(f).forEach(p=>{s.implies(p,f[p])}):(e.global(f),o[f]||(o[f]=[]),Array.isArray(d)?d.forEach(p=>s.implies(f,p)):(Re(d,void 0,n),o[f].push(d)))},s.getImplied=function(){return o};function a(u,f){let d=Number(f);return f=isNaN(d)?f:d,typeof f=="number"?f=u._.length>=f:f.match(/^--no-.+/)?(f=f.match(/^--no-(.+)/)[1],f=!Object.prototype.hasOwnProperty.call(u,f)):f=Object.prototype.hasOwnProperty.call(u,f),f}s.implications=function(f){let d=[];if(Object.keys(o).forEach(p=>{let y=p;(o[p]||[]).forEach(g=>{let m=y,E=g;m=a(f,m),g=a(f,g),m&&!g&&d.push(` ${y} -> ${E}`)})}),d.length){let p=`${r("Implications failed:")}
66
- `;d.forEach(y=>{p+=y}),t.fail(p)}};let l={};s.conflicts=function(f,d){I("<string|object> [array|string]",[f,d],arguments.length),typeof f=="object"?Object.keys(f).forEach(p=>{s.conflicts(p,f[p])}):(e.global(f),l[f]||(l[f]=[]),Array.isArray(d)?d.forEach(p=>s.conflicts(f,p)):l[f].push(d))},s.getConflicting=()=>l,s.conflicting=function(f){Object.keys(f).forEach(d=>{l[d]&&l[d].forEach(p=>{p&&f[d]!==void 0&&f[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&&f[n.Parser.camelCase(d)]!==void 0&&f[n.Parser.camelCase(p)]!==void 0&&t.fail(r("Arguments %s and %s are mutually exclusive",d,p))})})},s.recommendCommands=function(f,d){d=d.sort((m,E)=>E.length-m.length);let y=null,g=1/0;for(let m=0,E;(E=d[m])!==void 0;m++){let _=Go(f,E);_<=3&&_<g&&(g=_,y=E)}y&&t.fail(r("Did you mean %s?",y))},s.reset=function(f){return o=xt(o,d=>!f[d]),l=xt(l,d=>!f[d]),s};let c=[];return s.freeze=function(){c.push({implied:o,conflicting:l})},s.unfreeze=function(){let f=c.pop();Re(f,void 0,n),{implied:o,conflicting:l}=f},s}b();var ai=[],Dn;function ur(e,t,n,r){Dn=r;let i={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return i;let s=/\.json|\..*rc$/.test(e.extends),o=null;if(s)o=df(t,e.extends);else try{o=Se.resolve(e.extends)}catch(a){return e}uf(o),ai.push(o),i=s?JSON.parse(Dn.readFileSync(o,"utf8")):Se(e.extends),delete e.extends,i=ur(i,Dn.path.dirname(o),n,Dn)}return ai=[],n?zo(i,e):Object.assign({},i,e)}function uf(e){if(ai.indexOf(e)>-1)throw new ie(`Circular extended configurations: '${e}'.`)}function df(e,t){return Dn.path.resolve(e,t)}function zo(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]=zo(e[i],t[i]):n[i]=t[i];return n}var M=function(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},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)},he,Yt,Nn,et,Qe,dr,Ot,zt,pr,tt,hr,nt,at,Je,rt,mr,dn,Ie,N,gr,br,Xe,Vt,pn,Kt,vt,yr,q,Qt,Jt,Xt,Q,lt,ce;function ds(e){return(t=[],n=e.process.cwd(),r)=>{let i=new yi(t,n,r,e);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Vo=Symbol("copyDoubleDash"),Ko=Symbol("copyDoubleDash"),li=Symbol("deleteFromParserHintObject"),Qo=Symbol("emitWarning"),Jo=Symbol("freeze"),Xo=Symbol("getDollarZero"),Zt=Symbol("getParserConfiguration"),ci=Symbol("guessLocale"),Zo=Symbol("guessVersion"),es=Symbol("parsePositionalNumbers"),fi=Symbol("pkgUp"),Et=Symbol("populateParserHintArray"),hn=Symbol("populateParserHintSingleValueDictionary"),ui=Symbol("populateParserHintArrayDictionary"),di=Symbol("populateParserHintDictionary"),pi=Symbol("sanitizeKey"),hi=Symbol("setKey"),mi=Symbol("unfreeze"),ts=Symbol("validateAsync"),ns=Symbol("getCommandInstance"),rs=Symbol("getContext"),is=Symbol("getHasOutput"),os=Symbol("getLoggerInstance"),ss=Symbol("getParseContext"),as=Symbol("getUsageInstance"),ls=Symbol("getValidationInstance"),wr=Symbol("hasParseCallback"),cs=Symbol("isGlobalContext"),en=Symbol("postProcess"),fs=Symbol("rebase"),gi=Symbol("reset"),kn=Symbol("runYargsParserAndExecuteCommands"),bi=Symbol("runValidation"),us=Symbol("setHasOutput"),tn=Symbol("kTrackManuallySetKeys"),yi=class{constructor(t=[],n,r,i){this.customScriptName=!1,this.parsed=!1,he.set(this,void 0),Yt.set(this,void 0),Nn.set(this,{commands:[],fullCommands:[]}),et.set(this,null),Qe.set(this,null),dr.set(this,"show-hidden"),Ot.set(this,null),zt.set(this,!0),pr.set(this,{}),tt.set(this,!0),hr.set(this,[]),nt.set(this,void 0),at.set(this,{}),Je.set(this,!1),rt.set(this,null),mr.set(this,!0),dn.set(this,void 0),Ie.set(this,""),N.set(this,void 0),gr.set(this,void 0),br.set(this,{}),Xe.set(this,null),Vt.set(this,null),pn.set(this,{}),Kt.set(this,{}),vt.set(this,void 0),yr.set(this,!1),q.set(this,void 0),Qt.set(this,!1),Jt.set(this,!1),Xt.set(this,!1),Q.set(this,void 0),lt.set(this,null),ce.set(this,void 0),M(this,q,i,"f"),M(this,vt,t,"f"),M(this,Yt,n,"f"),M(this,gr,r,"f"),M(this,nt,new lr(this),"f"),this.$0=this[Xo](),this[gi](),M(this,he,h(this,he,"f"),"f"),M(this,Q,h(this,Q,"f"),"f"),M(this,ce,h(this,ce,"f"),"f"),M(this,N,h(this,N,"f"),"f"),h(this,N,"f").showHiddenOpt=h(this,dr,"f"),M(this,dn,this[Ko](),"f")}addHelpOpt(t,n){let r="help";return I("[string|boolean] [string]",[t,n],arguments.length),h(this,rt,"f")&&(this[li](h(this,rt,"f")),M(this,rt,null,"f")),t===!1&&n===void 0?this:(M(this,rt,typeof t=="string"?t:r,"f"),this.boolean(h(this,rt,"f")),this.describe(h(this,rt,"f"),n||h(this,Q,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(I("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let r=typeof t=="string"?t:h(this,dr,"f");return this.boolean(r),this.describe(r,n||h(this,Q,"f").deferY18nLookup("Show hidden options")),h(this,N,"f").showHiddenOpt=r,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return I("<object|string|array> [string|array]",[t,n],arguments.length),this[ui](this.alias.bind(this),"alias",t,n),this}array(t){return I("<array|string>",[t],arguments.length),this[Et]("array",t),this[tn](t),this}boolean(t){return I("<array|string>",[t],arguments.length),this[Et]("boolean",t),this[tn](t),this}check(t,n){return I("<function> [boolean]",[t,n],arguments.length),this.middleware((r,i)=>qt(()=>t(r,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&h(this,Q,"f").fail(s.toString(),s):h(this,Q,"f").fail(h(this,q,"f").y18n.__("Argument check failed: %s",t.toString())),r),s=>(h(this,Q,"f").fail(s.message?s.message:s.toString(),s),r)),!1,n),this}choices(t,n){return I("<object|string|array> [string|array]",[t,n],arguments.length),this[ui](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(I("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new ie("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 ie("coerce callback must be provided");return h(this,N,"f").key[t]=!0,h(this,nt,"f").addCoerceMiddleware((r,i)=>{let s;return Object.hasOwnProperty.call(r,t)?qt(()=>(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 ie(a.message)}):r},t),this}conflicts(t,n){return I("<string|object> [string|array]",[t,n],arguments.length),h(this,ce,"f").conflicts(t,n),this}config(t="config",n,r){return I("[object|string] [string|function] [function]",[t,n,r],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=ur(t,h(this,Yt,"f"),this[Zt]()["deep-merge-config"]||!1,h(this,q,"f")),h(this,N,"f").configObjects=(h(this,N,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(r=n,n=void 0),this.describe(t,n||h(this,Q,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{h(this,N,"f").config[i]=r||!0}),this)}completion(t,n,r){return I("[string] [string|boolean|function] [function]",[t,n,r],arguments.length),typeof n=="function"&&(r=n,n=void 0),M(this,Qe,t||h(this,Qe,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(h(this,Qe,"f"),n),r&&h(this,et,"f").registerFunction(r),this}command(t,n,r,i,s,o){return I("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,r,i,s,o],arguments.length),h(this,he,"f").addHandler(t,n,r,i,s,o),this}commands(t,n,r,i,s,o){return this.command(t,n,r,i,s,o)}commandDir(t,n){I("<string> [object]",[t,n],arguments.length);let r=h(this,gr,"f")||h(this,q,"f").require;return h(this,he,"f").addDirectory(t,r,h(this,q,"f").getCallerFile(),n),this}count(t){return I("<array|string>",[t],arguments.length),this[Et]("count",t),this[tn](t),this}default(t,n,r){return I("<object|string|array> [*] [string]",[t,n,r],arguments.length),r&&(ni(t,h(this,q,"f")),h(this,N,"f").defaultDescription[t]=r),typeof n=="function"&&(ni(t,h(this,q,"f")),h(this,N,"f").defaultDescription[t]||(h(this,N,"f").defaultDescription[t]=h(this,Q,"f").functionDescription(n)),n=n.call()),this[hn](this.default.bind(this),"default",t,n),this}defaults(t,n,r){return this.default(t,n,r)}demandCommand(t=1,n,r,i){return I("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,r,i],arguments.length),typeof n!="number"&&(r=n,n=1/0),this.global("_",!1),h(this,N,"f").demandedCommands._={min:t,max:n,minMsg:r,maxMsg:i},this}demand(t,n,r){return Array.isArray(n)?(n.forEach(i=>{Re(r,!0,h(this,q,"f")),this.demandOption(i,r)}),n=1/0):typeof n!="number"&&(r=n,n=1/0),typeof t=="number"?(Re(r,!0,h(this,q,"f")),this.demandCommand(t,n,r,r)):Array.isArray(t)?t.forEach(i=>{Re(r,!0,h(this,q,"f")),this.demandOption(i,r)}):typeof r=="string"?this.demandOption(t,r):(r===!0||typeof r=="undefined")&&this.demandOption(t),this}demandOption(t,n){return I("<object|string|array> [string]",[t,n],arguments.length),this[hn](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return I("<string> [string|boolean]",[t,n],arguments.length),h(this,N,"f").deprecatedOptions[t]=n,this}describe(t,n){return I("<object|string|array> [string]",[t,n],arguments.length),this[hi](t,!0),h(this,Q,"f").describe(t,n),this}detectLocale(t){return I("<boolean>",[t],arguments.length),M(this,zt,t,"f"),this}env(t){return I("[string|boolean]",[t],arguments.length),t===!1?delete h(this,N,"f").envPrefix:h(this,N,"f").envPrefix=t||"",this}epilogue(t){return I("<string>",[t],arguments.length),h(this,Q,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return I("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(r=>this.example(...r)):h(this,Q,"f").example(t,n),this}exit(t,n){M(this,Je,!0,"f"),M(this,Ot,n,"f"),h(this,tt,"f")&&h(this,q,"f").process.exit(t)}exitProcess(t=!0){return I("[boolean]",[t],arguments.length),M(this,tt,t,"f"),this}fail(t){if(I("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new ie("Invalid first argument. Expected function or boolean 'false'");return h(this,Q,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return I("<array> [function]",[t,n],arguments.length),n?h(this,et,"f").getCompletion(t,n):new Promise((r,i)=>{h(this,et,"f").getCompletion(t,(s,o)=>{s?i(s):r(o)})})}getDemandedOptions(){return I([],0),h(this,N,"f").demandedOptions}getDemandedCommands(){return I([],0),h(this,N,"f").demandedCommands}getDeprecatedOptions(){return I([],0),h(this,N,"f").deprecatedOptions}getDetectLocale(){return h(this,zt,"f")}getExitProcess(){return h(this,tt,"f")}getGroups(){return Object.assign({},h(this,at,"f"),h(this,Kt,"f"))}getHelp(){if(M(this,Je,!0,"f"),!h(this,Q,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[kn](h(this,vt,"f"),void 0,void 0,0,!0);if(le(n))return n.then(()=>h(this,Q,"f").help())}let t=h(this,he,"f").runDefaultBuilderOn(this);if(le(t))return t.then(()=>h(this,Q,"f").help())}return Promise.resolve(h(this,Q,"f").help())}getOptions(){return h(this,N,"f")}getStrict(){return h(this,Qt,"f")}getStrictCommands(){return h(this,Jt,"f")}getStrictOptions(){return h(this,Xt,"f")}global(t,n){return I("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?h(this,N,"f").local=h(this,N,"f").local.filter(r=>t.indexOf(r)===-1):t.forEach(r=>{h(this,N,"f").local.includes(r)||h(this,N,"f").local.push(r)}),this}group(t,n){I("<string|array> <string>",[t,n],arguments.length);let r=h(this,Kt,"f")[n]||h(this,at,"f")[n];h(this,Kt,"f")[n]&&delete h(this,Kt,"f")[n];let i={};return h(this,at,"f")[n]=(r||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return I("<string>",[t],arguments.length),h(this,N,"f").hiddenOptions.push(t),this}implies(t,n){return I("<string|object> [number|string|array]",[t,n],arguments.length),h(this,ce,"f").implies(t,n),this}locale(t){return I("[string]",[t],arguments.length),t?(M(this,zt,!1,"f"),h(this,q,"f").y18n.setLocale(t),this):(this[ci](),h(this,q,"f").y18n.getLocale())}middleware(t,n,r){return h(this,nt,"f").addMiddleware(t,!!n,r)}nargs(t,n){return I("<string|object|array> [number]",[t,n],arguments.length),this[hn](this.nargs.bind(this),"narg",t,n),this}normalize(t){return I("<array|string>",[t],arguments.length),this[Et]("normalize",t),this}number(t){return I("<array|string>",[t],arguments.length),this[Et]("number",t),this[tn](t),this}option(t,n){if(I("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(r=>{this.options(r,t[r])});else{typeof n!="object"&&(n={}),this[tn](t),h(this,lt,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[Qo](['"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,N,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let r=n.deprecate||n.deprecated;r&&this.deprecateOption(t,r);let i=n.demand||n.required||n.require;i&&this.demand(t,i),n.demandOption&&this.demandOption(t,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),"default"in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(t),typeof n.global=="boolean"&&this.global(t,n.global),n.defaultDescription&&(h(this,N,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let s=n.describe||n.description||n.desc;this.describe(t,s),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,r){I("[string|array] [function|boolean|object] [function]",[t,n,r],arguments.length),this[Jo](),typeof t=="undefined"&&(t=h(this,vt,"f")),typeof n=="object"&&(M(this,Vt,n,"f"),n=r),typeof n=="function"&&(M(this,Xe,n,"f"),n=!1),n||M(this,vt,t,"f"),h(this,Xe,"f")&&M(this,tt,!1,"f");let i=this[kn](t,!!n),s=this.parsed;return h(this,et,"f").setParsed(this.parsed),le(i)?i.then(o=>(h(this,Xe,"f")&&h(this,Xe,"f").call(this,h(this,Ot,"f"),o,h(this,Ie,"f")),o)).catch(o=>{throw h(this,Xe,"f")&&h(this,Xe,"f")(o,this.parsed.argv,h(this,Ie,"f")),o}).finally(()=>{this[mi](),this.parsed=s}):(h(this,Xe,"f")&&h(this,Xe,"f").call(this,h(this,Ot,"f"),i,h(this,Ie,"f")),this[mi](),this.parsed=s,i)}parseAsync(t,n,r){let i=this.parse(t,n,r);return le(i)?i:Promise.resolve(i)}parseSync(t,n,r){let i=this.parse(t,n,r);if(le(i))throw new ie(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return I("<object>",[t],arguments.length),M(this,br,t,"f"),this}pkgConf(t,n){I("<string> [string]",[t,n],arguments.length);let r=null,i=this[fi](n||h(this,Yt,"f"));return i[t]&&typeof i[t]=="object"&&(r=ur(i[t],n||h(this,Yt,"f"),this[Zt]()["deep-merge-config"]||!1,h(this,q,"f")),h(this,N,"f").configObjects=(h(this,N,"f").configObjects||[]).concat(r)),this}positional(t,n){I("<string> <object>",[t,n],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=xt(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:r.includes(o));let i=h(this,Nn,"f").fullCommands[h(this,Nn,"f").fullCommands.length-1],s=i?h(this,he,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return fn(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,Q,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return I("[boolean]",[t],arguments.length),M(this,yr,t,"f"),this}required(t,n,r){return this.demand(t,n,r)}require(t,n,r){return this.demand(t,n,r)}requiresArg(t){return I("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&h(this,N,"f").narg[t]?this:(this[hn](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return I("[string] [string]",[t,n],arguments.length),t=t||this.$0,h(this,dn,"f").log(h(this,et,"f").generateCompletionScript(t,n||h(this,Qe,"f")||"completion")),this}showHelp(t){if(I("[string|function]",[t],arguments.length),M(this,Je,!0,"f"),!h(this,Q,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[kn](h(this,vt,"f"),void 0,void 0,0,!0);if(le(r))return r.then(()=>{h(this,Q,"f").showHelp(t)}),this}let n=h(this,he,"f").runDefaultBuilderOn(this);if(le(n))return n.then(()=>{h(this,Q,"f").showHelp(t)}),this}return h(this,Q,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return I("[boolean|string] [string]",[t,n],arguments.length),h(this,Q,"f").showHelpOnFail(t,n),this}showVersion(t){return I("[string|function]",[t],arguments.length),h(this,Q,"f").showVersion(t),this}skipValidation(t){return I("<array|string>",[t],arguments.length),this[Et]("skipValidation",t),this}strict(t){return I("[boolean]",[t],arguments.length),M(this,Qt,t!==!1,"f"),this}strictCommands(t){return I("[boolean]",[t],arguments.length),M(this,Jt,t!==!1,"f"),this}strictOptions(t){return I("[boolean]",[t],arguments.length),M(this,Xt,t!==!1,"f"),this}string(t){return I("<array|string>",[t],arguments.length),this[Et]("string",t),this[tn](t),this}terminalWidth(){return I([],0),h(this,q,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return I("<object>",[t],arguments.length),M(this,zt,!1,"f"),h(this,q,"f").y18n.updateLocale(t),this}usage(t,n,r,i){if(I("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,r,i],arguments.length),n!==void 0){if(Re(t,null,h(this,q,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,r,i);throw new ie(".usage() description must start with $0 if being used as alias for .command()")}else return h(this,Q,"f").usage(t),this}version(t,n,r){let i="version";if(I("[boolean|string] [string] [string]",[t,n,r],arguments.length),h(this,lt,"f")&&(this[li](h(this,lt,"f")),h(this,Q,"f").version(void 0),M(this,lt,null,"f")),arguments.length===0)r=this[Zo](),t=i;else if(arguments.length===1){if(t===!1)return this;r=t,t=i}else arguments.length===2&&(r=n,n=void 0);return M(this,lt,typeof t=="string"?t:i,"f"),n=n||h(this,Q,"f").deferY18nLookup("Show version number"),h(this,Q,"f").version(r||void 0),this.boolean(h(this,lt,"f")),this.describe(h(this,lt,"f"),n),this}wrap(t){return I("<number|null|undefined>",[t],arguments.length),h(this,Q,"f").wrap(t),this}[(he=new WeakMap,Yt=new WeakMap,Nn=new WeakMap,et=new WeakMap,Qe=new WeakMap,dr=new WeakMap,Ot=new WeakMap,zt=new WeakMap,pr=new WeakMap,tt=new WeakMap,hr=new WeakMap,nt=new WeakMap,at=new WeakMap,Je=new WeakMap,rt=new WeakMap,mr=new WeakMap,dn=new WeakMap,Ie=new WeakMap,N=new WeakMap,gr=new WeakMap,br=new WeakMap,Xe=new WeakMap,Vt=new WeakMap,pn=new WeakMap,Kt=new WeakMap,vt=new WeakMap,yr=new WeakMap,q=new WeakMap,Qt=new WeakMap,Jt=new WeakMap,Xt=new WeakMap,Q=new WeakMap,lt=new WeakMap,ce=new WeakMap,Vo)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[Ko](){return{log:(...t)=>{this[wr]()||console.log(...t),M(this,Je,!0,"f"),h(this,Ie,"f").length&&M(this,Ie,h(this,Ie,"f")+`
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 E=e.getInternalMethods().getCommandInstance().getCommands(),_=[],U=e.getInternalMethods().getContext();if(Object.keys(u).forEach(K=>{!qo.includes(K)&&!Object.prototype.hasOwnProperty.call(p,K)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),K)&&!s.isValidAndSomeAliasIsNotNew(K,d)&&_.push(K)}),g&&(U.commands.length>0||E.length>0||y)&&u._.slice(U.commands.length).forEach(K=>{E.includes(""+K)||_.push(""+K)}),g){let J=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,V=U.commands.length+J;V<u._.length&&u._.slice(V).forEach($=>{$=String($),!U.commands.includes($)&&!_.includes($)&&_.push($)})}_.length&&t.fail(i("Unknown argument: %s","Unknown arguments: %s",_.length,_.map(K=>K.trim()?K:`"${K}"`).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=>{qo.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(d.choices,m)&&[].concat(u[m]).forEach(E=>{d.choices[m].indexOf(E)===-1&&E!==void 0&&(p[m]=(p[m]||[]).concat(E))})});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){I("<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)):(Re(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,E=g;m=a(u,m),g=a(u,g),m&&!g&&d.push(` ${y} -> ${E}`)})}),d.length){let p=`${r("Implications failed:")}
66
+ `;d.forEach(y=>{p+=y}),t.fail(p)}};let l={};s.conflicts=function(u,d){I("<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,E)=>E.length-m.length);let y=null,g=1/0;for(let m=0,E;(E=d[m])!==void 0;m++){let _=Go(u,E);_<=3&&_<g&&(g=_,y=E)}y&&t.fail(r("Did you mean %s?",y))},s.reset=function(u){return o=xt(o,d=>!u[d]),l=xt(l,d=>!u[d]),s};let c=[];return s.freeze=function(){c.push({implied:o,conflicting:l})},s.unfreeze=function(){let u=c.pop();Re(u,void 0,n),{implied:o,conflicting:l}=u},s}b();var ai=[],Nn;function ur(e,t,n,r){Nn=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=df(t,e.extends);else try{o=Se.resolve(e.extends)}catch(a){return e}uf(o),ai.push(o),i=s?JSON.parse(Nn.readFileSync(o,"utf8")):Se(e.extends),delete e.extends,i=ur(i,Nn.path.dirname(o),n,Nn)}return ai=[],n?zo(i,e):Object.assign({},i,e)}function uf(e){if(ai.indexOf(e)>-1)throw new ie(`Circular extended configurations: '${e}'.`)}function df(e,t){return Nn.path.resolve(e,t)}function zo(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]=zo(e[i],t[i]):n[i]=t[i];return n}var M=function(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},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)},he,Yt,kn,et,Qe,dr,Ot,zt,pr,tt,hr,nt,at,Je,rt,mr,dn,Ie,N,gr,br,Xe,Vt,pn,Kt,vt,yr,q,Qt,Jt,Xt,Q,lt,ce;function ds(e){return(t=[],n=e.process.cwd(),r)=>{let i=new yi(t,n,r,e);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Vo=Symbol("copyDoubleDash"),Ko=Symbol("copyDoubleDash"),li=Symbol("deleteFromParserHintObject"),Qo=Symbol("emitWarning"),Jo=Symbol("freeze"),Xo=Symbol("getDollarZero"),Zt=Symbol("getParserConfiguration"),ci=Symbol("guessLocale"),Zo=Symbol("guessVersion"),es=Symbol("parsePositionalNumbers"),fi=Symbol("pkgUp"),Et=Symbol("populateParserHintArray"),hn=Symbol("populateParserHintSingleValueDictionary"),ui=Symbol("populateParserHintArrayDictionary"),di=Symbol("populateParserHintDictionary"),pi=Symbol("sanitizeKey"),hi=Symbol("setKey"),mi=Symbol("unfreeze"),ts=Symbol("validateAsync"),ns=Symbol("getCommandInstance"),rs=Symbol("getContext"),is=Symbol("getHasOutput"),os=Symbol("getLoggerInstance"),ss=Symbol("getParseContext"),as=Symbol("getUsageInstance"),ls=Symbol("getValidationInstance"),wr=Symbol("hasParseCallback"),cs=Symbol("isGlobalContext"),en=Symbol("postProcess"),fs=Symbol("rebase"),gi=Symbol("reset"),Rn=Symbol("runYargsParserAndExecuteCommands"),bi=Symbol("runValidation"),us=Symbol("setHasOutput"),tn=Symbol("kTrackManuallySetKeys"),yi=class{constructor(t=[],n,r,i){this.customScriptName=!1,this.parsed=!1,he.set(this,void 0),Yt.set(this,void 0),kn.set(this,{commands:[],fullCommands:[]}),et.set(this,null),Qe.set(this,null),dr.set(this,"show-hidden"),Ot.set(this,null),zt.set(this,!0),pr.set(this,{}),tt.set(this,!0),hr.set(this,[]),nt.set(this,void 0),at.set(this,{}),Je.set(this,!1),rt.set(this,null),mr.set(this,!0),dn.set(this,void 0),Ie.set(this,""),N.set(this,void 0),gr.set(this,void 0),br.set(this,{}),Xe.set(this,null),Vt.set(this,null),pn.set(this,{}),Kt.set(this,{}),vt.set(this,void 0),yr.set(this,!1),q.set(this,void 0),Qt.set(this,!1),Jt.set(this,!1),Xt.set(this,!1),Q.set(this,void 0),lt.set(this,null),ce.set(this,void 0),M(this,q,i,"f"),M(this,vt,t,"f"),M(this,Yt,n,"f"),M(this,gr,r,"f"),M(this,nt,new lr(this),"f"),this.$0=this[Xo](),this[gi](),M(this,he,h(this,he,"f"),"f"),M(this,Q,h(this,Q,"f"),"f"),M(this,ce,h(this,ce,"f"),"f"),M(this,N,h(this,N,"f"),"f"),h(this,N,"f").showHiddenOpt=h(this,dr,"f"),M(this,dn,this[Ko](),"f")}addHelpOpt(t,n){let r="help";return I("[string|boolean] [string]",[t,n],arguments.length),h(this,rt,"f")&&(this[li](h(this,rt,"f")),M(this,rt,null,"f")),t===!1&&n===void 0?this:(M(this,rt,typeof t=="string"?t:r,"f"),this.boolean(h(this,rt,"f")),this.describe(h(this,rt,"f"),n||h(this,Q,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(I("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let r=typeof t=="string"?t:h(this,dr,"f");return this.boolean(r),this.describe(r,n||h(this,Q,"f").deferY18nLookup("Show hidden options")),h(this,N,"f").showHiddenOpt=r,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return I("<object|string|array> [string|array]",[t,n],arguments.length),this[ui](this.alias.bind(this),"alias",t,n),this}array(t){return I("<array|string>",[t],arguments.length),this[Et]("array",t),this[tn](t),this}boolean(t){return I("<array|string>",[t],arguments.length),this[Et]("boolean",t),this[tn](t),this}check(t,n){return I("<function> [boolean]",[t,n],arguments.length),this.middleware((r,i)=>qt(()=>t(r,i.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&h(this,Q,"f").fail(s.toString(),s):h(this,Q,"f").fail(h(this,q,"f").y18n.__("Argument check failed: %s",t.toString())),r),s=>(h(this,Q,"f").fail(s.message?s.message:s.toString(),s),r)),!1,n),this}choices(t,n){return I("<object|string|array> [string|array]",[t,n],arguments.length),this[ui](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(I("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new ie("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 ie("coerce callback must be provided");return h(this,N,"f").key[t]=!0,h(this,nt,"f").addCoerceMiddleware((r,i)=>{let s;return Object.prototype.hasOwnProperty.call(r,t)?qt(()=>(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 ie(a.message)}):r},t),this}conflicts(t,n){return I("<string|object> [string|array]",[t,n],arguments.length),h(this,ce,"f").conflicts(t,n),this}config(t="config",n,r){return I("[object|string] [string|function] [function]",[t,n,r],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=ur(t,h(this,Yt,"f"),this[Zt]()["deep-merge-config"]||!1,h(this,q,"f")),h(this,N,"f").configObjects=(h(this,N,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(r=n,n=void 0),this.describe(t,n||h(this,Q,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(i=>{h(this,N,"f").config[i]=r||!0}),this)}completion(t,n,r){return I("[string] [string|boolean|function] [function]",[t,n,r],arguments.length),typeof n=="function"&&(r=n,n=void 0),M(this,Qe,t||h(this,Qe,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(h(this,Qe,"f"),n),r&&h(this,et,"f").registerFunction(r),this}command(t,n,r,i,s,o){return I("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,r,i,s,o],arguments.length),h(this,he,"f").addHandler(t,n,r,i,s,o),this}commands(t,n,r,i,s,o){return this.command(t,n,r,i,s,o)}commandDir(t,n){I("<string> [object]",[t,n],arguments.length);let r=h(this,gr,"f")||h(this,q,"f").require;return h(this,he,"f").addDirectory(t,r,h(this,q,"f").getCallerFile(),n),this}count(t){return I("<array|string>",[t],arguments.length),this[Et]("count",t),this[tn](t),this}default(t,n,r){return I("<object|string|array> [*] [string]",[t,n,r],arguments.length),r&&(ni(t,h(this,q,"f")),h(this,N,"f").defaultDescription[t]=r),typeof n=="function"&&(ni(t,h(this,q,"f")),h(this,N,"f").defaultDescription[t]||(h(this,N,"f").defaultDescription[t]=h(this,Q,"f").functionDescription(n)),n=n.call()),this[hn](this.default.bind(this),"default",t,n),this}defaults(t,n,r){return this.default(t,n,r)}demandCommand(t=1,n,r,i){return I("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,r,i],arguments.length),typeof n!="number"&&(r=n,n=1/0),this.global("_",!1),h(this,N,"f").demandedCommands._={min:t,max:n,minMsg:r,maxMsg:i},this}demand(t,n,r){return Array.isArray(n)?(n.forEach(i=>{Re(r,!0,h(this,q,"f")),this.demandOption(i,r)}),n=1/0):typeof n!="number"&&(r=n,n=1/0),typeof t=="number"?(Re(r,!0,h(this,q,"f")),this.demandCommand(t,n,r,r)):Array.isArray(t)?t.forEach(i=>{Re(r,!0,h(this,q,"f")),this.demandOption(i,r)}):typeof r=="string"?this.demandOption(t,r):(r===!0||typeof r=="undefined")&&this.demandOption(t),this}demandOption(t,n){return I("<object|string|array> [string]",[t,n],arguments.length),this[hn](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return I("<string> [string|boolean]",[t,n],arguments.length),h(this,N,"f").deprecatedOptions[t]=n,this}describe(t,n){return I("<object|string|array> [string]",[t,n],arguments.length),this[hi](t,!0),h(this,Q,"f").describe(t,n),this}detectLocale(t){return I("<boolean>",[t],arguments.length),M(this,zt,t,"f"),this}env(t){return I("[string|boolean]",[t],arguments.length),t===!1?delete h(this,N,"f").envPrefix:h(this,N,"f").envPrefix=t||"",this}epilogue(t){return I("<string>",[t],arguments.length),h(this,Q,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return I("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(r=>this.example(...r)):h(this,Q,"f").example(t,n),this}exit(t,n){M(this,Je,!0,"f"),M(this,Ot,n,"f"),h(this,tt,"f")&&h(this,q,"f").process.exit(t)}exitProcess(t=!0){return I("[boolean]",[t],arguments.length),M(this,tt,t,"f"),this}fail(t){if(I("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new ie("Invalid first argument. Expected function or boolean 'false'");return h(this,Q,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return I("<array> [function]",[t,n],arguments.length),n?h(this,et,"f").getCompletion(t,n):new Promise((r,i)=>{h(this,et,"f").getCompletion(t,(s,o)=>{s?i(s):r(o)})})}getDemandedOptions(){return I([],0),h(this,N,"f").demandedOptions}getDemandedCommands(){return I([],0),h(this,N,"f").demandedCommands}getDeprecatedOptions(){return I([],0),h(this,N,"f").deprecatedOptions}getDetectLocale(){return h(this,zt,"f")}getExitProcess(){return h(this,tt,"f")}getGroups(){return Object.assign({},h(this,at,"f"),h(this,Kt,"f"))}getHelp(){if(M(this,Je,!0,"f"),!h(this,Q,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[Rn](h(this,vt,"f"),void 0,void 0,0,!0);if(se(n))return n.then(()=>h(this,Q,"f").help())}let t=h(this,he,"f").runDefaultBuilderOn(this);if(se(t))return t.then(()=>h(this,Q,"f").help())}return Promise.resolve(h(this,Q,"f").help())}getOptions(){return h(this,N,"f")}getStrict(){return h(this,Qt,"f")}getStrictCommands(){return h(this,Jt,"f")}getStrictOptions(){return h(this,Xt,"f")}global(t,n){return I("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?h(this,N,"f").local=h(this,N,"f").local.filter(r=>t.indexOf(r)===-1):t.forEach(r=>{h(this,N,"f").local.includes(r)||h(this,N,"f").local.push(r)}),this}group(t,n){I("<string|array> <string>",[t,n],arguments.length);let r=h(this,Kt,"f")[n]||h(this,at,"f")[n];h(this,Kt,"f")[n]&&delete h(this,Kt,"f")[n];let i={};return h(this,at,"f")[n]=(r||[]).concat(t).filter(s=>i[s]?!1:i[s]=!0),this}hide(t){return I("<string>",[t],arguments.length),h(this,N,"f").hiddenOptions.push(t),this}implies(t,n){return I("<string|object> [number|string|array]",[t,n],arguments.length),h(this,ce,"f").implies(t,n),this}locale(t){return I("[string]",[t],arguments.length),t===void 0?(this[ci](),h(this,q,"f").y18n.getLocale()):(M(this,zt,!1,"f"),h(this,q,"f").y18n.setLocale(t),this)}middleware(t,n,r){return h(this,nt,"f").addMiddleware(t,!!n,r)}nargs(t,n){return I("<string|object|array> [number]",[t,n],arguments.length),this[hn](this.nargs.bind(this),"narg",t,n),this}normalize(t){return I("<array|string>",[t],arguments.length),this[Et]("normalize",t),this}number(t){return I("<array|string>",[t],arguments.length),this[Et]("number",t),this[tn](t),this}option(t,n){if(I("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(r=>{this.options(r,t[r])});else{typeof n!="object"&&(n={}),this[tn](t),h(this,lt,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[Qo](['"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,N,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let r=n.deprecate||n.deprecated;r&&this.deprecateOption(t,r);let i=n.demand||n.required||n.require;i&&this.demand(t,i),n.demandOption&&this.demandOption(t,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),"default"in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(t),typeof n.global=="boolean"&&this.global(t,n.global),n.defaultDescription&&(h(this,N,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let s=n.describe||n.description||n.desc;this.describe(t,s),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,r){I("[string|array] [function|boolean|object] [function]",[t,n,r],arguments.length),this[Jo](),typeof t=="undefined"&&(t=h(this,vt,"f")),typeof n=="object"&&(M(this,Vt,n,"f"),n=r),typeof n=="function"&&(M(this,Xe,n,"f"),n=!1),n||M(this,vt,t,"f"),h(this,Xe,"f")&&M(this,tt,!1,"f");let i=this[Rn](t,!!n),s=this.parsed;return h(this,et,"f").setParsed(this.parsed),se(i)?i.then(o=>(h(this,Xe,"f")&&h(this,Xe,"f").call(this,h(this,Ot,"f"),o,h(this,Ie,"f")),o)).catch(o=>{throw h(this,Xe,"f")&&h(this,Xe,"f")(o,this.parsed.argv,h(this,Ie,"f")),o}).finally(()=>{this[mi](),this.parsed=s}):(h(this,Xe,"f")&&h(this,Xe,"f").call(this,h(this,Ot,"f"),i,h(this,Ie,"f")),this[mi](),this.parsed=s,i)}parseAsync(t,n,r){let i=this.parse(t,n,r);return se(i)?i:Promise.resolve(i)}parseSync(t,n,r){let i=this.parse(t,n,r);if(se(i))throw new ie(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return I("<object>",[t],arguments.length),M(this,br,t,"f"),this}pkgConf(t,n){I("<string> [string]",[t,n],arguments.length);let r=null,i=this[fi](n||h(this,Yt,"f"));return i[t]&&typeof i[t]=="object"&&(r=ur(i[t],n||h(this,Yt,"f"),this[Zt]()["deep-merge-config"]||!1,h(this,q,"f")),h(this,N,"f").configObjects=(h(this,N,"f").configObjects||[]).concat(r)),this}positional(t,n){I("<string> <object>",[t,n],arguments.length);let r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=xt(n,(o,a)=>o==="type"&&!["string","number","boolean"].includes(a)?!1:r.includes(o));let i=h(this,kn,"f").fullCommands[h(this,kn,"f").fullCommands.length-1],s=i?h(this,he,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return fn(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,Q,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return I("[boolean]",[t],arguments.length),M(this,yr,t,"f"),this}required(t,n,r){return this.demand(t,n,r)}require(t,n,r){return this.demand(t,n,r)}requiresArg(t){return I("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&h(this,N,"f").narg[t]?this:(this[hn](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return I("[string] [string]",[t,n],arguments.length),t=t||this.$0,h(this,dn,"f").log(h(this,et,"f").generateCompletionScript(t,n||h(this,Qe,"f")||"completion")),this}showHelp(t){if(I("[string|function]",[t],arguments.length),M(this,Je,!0,"f"),!h(this,Q,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[Rn](h(this,vt,"f"),void 0,void 0,0,!0);if(se(r))return r.then(()=>{h(this,Q,"f").showHelp(t)}),this}let n=h(this,he,"f").runDefaultBuilderOn(this);if(se(n))return n.then(()=>{h(this,Q,"f").showHelp(t)}),this}return h(this,Q,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return I("[boolean|string] [string]",[t,n],arguments.length),h(this,Q,"f").showHelpOnFail(t,n),this}showVersion(t){return I("[string|function]",[t],arguments.length),h(this,Q,"f").showVersion(t),this}skipValidation(t){return I("<array|string>",[t],arguments.length),this[Et]("skipValidation",t),this}strict(t){return I("[boolean]",[t],arguments.length),M(this,Qt,t!==!1,"f"),this}strictCommands(t){return I("[boolean]",[t],arguments.length),M(this,Jt,t!==!1,"f"),this}strictOptions(t){return I("[boolean]",[t],arguments.length),M(this,Xt,t!==!1,"f"),this}string(t){return I("<array|string>",[t],arguments.length),this[Et]("string",t),this[tn](t),this}terminalWidth(){return I([],0),h(this,q,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return I("<object>",[t],arguments.length),M(this,zt,!1,"f"),h(this,q,"f").y18n.updateLocale(t),this}usage(t,n,r,i){if(I("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,r,i],arguments.length),n!==void 0){if(Re(t,null,h(this,q,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,r,i);throw new ie(".usage() description must start with $0 if being used as alias for .command()")}else return h(this,Q,"f").usage(t),this}version(t,n,r){let i="version";if(I("[boolean|string] [string] [string]",[t,n,r],arguments.length),h(this,lt,"f")&&(this[li](h(this,lt,"f")),h(this,Q,"f").version(void 0),M(this,lt,null,"f")),arguments.length===0)r=this[Zo](),t=i;else if(arguments.length===1){if(t===!1)return this;r=t,t=i}else arguments.length===2&&(r=n,n=void 0);return M(this,lt,typeof t=="string"?t:i,"f"),n=n||h(this,Q,"f").deferY18nLookup("Show version number"),h(this,Q,"f").version(r||void 0),this.boolean(h(this,lt,"f")),this.describe(h(this,lt,"f"),n),this}wrap(t){return I("<number|null|undefined>",[t],arguments.length),h(this,Q,"f").wrap(t),this}[(he=new WeakMap,Yt=new WeakMap,kn=new WeakMap,et=new WeakMap,Qe=new WeakMap,dr=new WeakMap,Ot=new WeakMap,zt=new WeakMap,pr=new WeakMap,tt=new WeakMap,hr=new WeakMap,nt=new WeakMap,at=new WeakMap,Je=new WeakMap,rt=new WeakMap,mr=new WeakMap,dn=new WeakMap,Ie=new WeakMap,N=new WeakMap,gr=new WeakMap,br=new WeakMap,Xe=new WeakMap,Vt=new WeakMap,pn=new WeakMap,Kt=new WeakMap,vt=new WeakMap,yr=new WeakMap,q=new WeakMap,Qt=new WeakMap,Jt=new WeakMap,Xt=new WeakMap,Q=new WeakMap,lt=new WeakMap,ce=new WeakMap,Vo)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[Ko](){return{log:(...t)=>{this[wr]()||console.log(...t),M(this,Je,!0,"f"),h(this,Ie,"f").length&&M(this,Ie,h(this,Ie,"f")+`
68
68
  `,"f"),M(this,Ie,h(this,Ie,"f")+t.join(" "),"f")},error:(...t)=>{this[wr]()||console.error(...t),M(this,Je,!0,"f"),h(this,Ie,"f").length&&M(this,Ie,h(this,Ie,"f")+`
69
- `,"f"),M(this,Ie,h(this,Ie,"f")+t.join(" "),"f")}}}[li](t){fn(h(this,N,"f")).forEach(n=>{if((i=>i==="configObjects")(n))return;let r=h(this,N,"f")[n];Array.isArray(r)?r.includes(t)&&r.splice(r.indexOf(t),1):typeof r=="object"&&delete r[t]}),delete h(this,Q,"f").getDescriptions()[t]}[Qo](t,n,r){h(this,pr,"f")[r]||(h(this,q,"f").process.emitWarning(t,n),h(this,pr,"f")[r]=!0)}[Jo](){h(this,hr,"f").push({options:h(this,N,"f"),configObjects:h(this,N,"f").configObjects.slice(0),exitProcess:h(this,tt,"f"),groups:h(this,at,"f"),strict:h(this,Qt,"f"),strictCommands:h(this,Jt,"f"),strictOptions:h(this,Xt,"f"),completionCommand:h(this,Qe,"f"),output:h(this,Ie,"f"),exitError:h(this,Ot,"f"),hasOutput:h(this,Je,"f"),parsed:this.parsed,parseFn:h(this,Xe,"f"),parseContext:h(this,Vt,"f")}),h(this,Q,"f").freeze(),h(this,ce,"f").freeze(),h(this,he,"f").freeze(),h(this,nt,"f").freeze()}[Xo](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,q,"f").process.argv()[0])?n=h(this,q,"f").process.argv().slice(1,2):n=h(this,q,"f").process.argv().slice(0,1),t=n.map(r=>{let i=this[fs](h(this,Yt,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<r.length?i:r}).join(" ").trim(),h(this,q,"f").getEnv("_")&&h(this,q,"f").getProcessArgvBin()===h(this,q,"f").getEnv("_")&&(t=h(this,q,"f").getEnv("_").replace(`${h(this,q,"f").path.dirname(h(this,q,"f").process.execPath())}/`,"")),t}[Zt](){return h(this,br,"f")}[ci](){if(!h(this,zt,"f"))return;let t=h(this,q,"f").getEnv("LC_ALL")||h(this,q,"f").getEnv("LC_MESSAGES")||h(this,q,"f").getEnv("LANG")||h(this,q,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Zo](){return this[fi]().version||"unknown"}[es](t){let n=t["--"]?t["--"]:t._;for(let r=0,i;(i=n[r])!==void 0;r++)h(this,q,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(n[r]=Number(i));return t}[fi](t){let n=t||"*";if(h(this,pn,"f")[n])return h(this,pn,"f")[n];let r={};try{let i=t||h(this,q,"f").mainFilename;!t&&h(this,q,"f").path.extname(i)&&(i=h(this,q,"f").path.dirname(i));let s=h(this,q,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});Re(s,void 0,h(this,q,"f")),r=JSON.parse(h(this,q,"f").readFileSync(s,"utf8"))}catch(i){}return h(this,pn,"f")[n]=r||{},h(this,pn,"f")[n]}[Et](t,n){n=[].concat(n),n.forEach(r=>{r=this[pi](r),h(this,N,"f")[t].push(r)})}[hn](t,n,r,i){this[di](t,n,r,i,(s,o,a)=>{h(this,N,"f")[s][o]=a})}[ui](t,n,r,i){this[di](t,n,r,i,(s,o,a)=>{h(this,N,"f")[s][o]=(h(this,N,"f")[s][o]||[]).concat(a)})}[di](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 fn(r))t(o,r[o]);else s(n,this[pi](r),i)}[pi](t){return t==="__proto__"?"___proto___":t}[hi](t,n){return this[hn](this[hi].bind(this),"key",t,n),this}[mi](){var t,n,r,i,s,o,a,l,c,u,f,d;let p=h(this,hr,"f").pop();Re(p,void 0,h(this,q,"f"));let y;t=this,n=this,r=this,i=this,s=this,o=this,a=this,l=this,c=this,u=this,f=this,d=this,{options:{set value(g){M(t,N,g,"f")}}.value,configObjects:y,exitProcess:{set value(g){M(n,tt,g,"f")}}.value,groups:{set value(g){M(r,at,g,"f")}}.value,output:{set value(g){M(i,Ie,g,"f")}}.value,exitError:{set value(g){M(s,Ot,g,"f")}}.value,hasOutput:{set value(g){M(o,Je,g,"f")}}.value,parsed:this.parsed,strict:{set value(g){M(a,Qt,g,"f")}}.value,strictCommands:{set value(g){M(l,Jt,g,"f")}}.value,strictOptions:{set value(g){M(c,Xt,g,"f")}}.value,completionCommand:{set value(g){M(u,Qe,g,"f")}}.value,parseFn:{set value(g){M(f,Xe,g,"f")}}.value,parseContext:{set value(g){M(d,Vt,g,"f")}}.value}=p,h(this,N,"f").configObjects=y,h(this,Q,"f").unfreeze(),h(this,ce,"f").unfreeze(),h(this,he,"f").unfreeze(),h(this,nt,"f").unfreeze()}[ts](t,n){return qt(n,r=>(t(r),r))}getInternalMethods(){return{getCommandInstance:this[ns].bind(this),getContext:this[rs].bind(this),getHasOutput:this[is].bind(this),getLoggerInstance:this[os].bind(this),getParseContext:this[ss].bind(this),getParserConfiguration:this[Zt].bind(this),getUsageInstance:this[as].bind(this),getValidationInstance:this[ls].bind(this),hasParseCallback:this[wr].bind(this),isGlobalContext:this[cs].bind(this),postProcess:this[en].bind(this),reset:this[gi].bind(this),runValidation:this[bi].bind(this),runYargsParserAndExecuteCommands:this[kn].bind(this),setHasOutput:this[us].bind(this)}}[ns](){return h(this,he,"f")}[rs](){return h(this,Nn,"f")}[is](){return h(this,Je,"f")}[os](){return h(this,dn,"f")}[ss](){return h(this,Vt,"f")||{}}[as](){return h(this,Q,"f")}[ls](){return h(this,ce,"f")}[wr](){return!!h(this,Xe,"f")}[cs](){return h(this,mr,"f")}[en](t,n,r,i){return r||le(t)||(n||(t=this[Vo](t)),(this[Zt]()["parse-positional-numbers"]||this[Zt]()["parse-positional-numbers"]===void 0)&&(t=this[es](t)),i&&(t=Gt(t,this,h(this,nt,"f").getMiddleware(),!1))),t}[gi](t={}){M(this,N,h(this,N,"f")||{},"f");let n={};n.local=h(this,N,"f").local||[],n.configObjects=h(this,N,"f").configObjects||[];let r={};n.local.forEach(o=>{r[o]=!0,(t[o]||[]).forEach(a=>{r[a]=!0})}),Object.assign(h(this,Kt,"f"),Object.keys(h(this,at,"f")).reduce((o,a)=>{let l=h(this,at,"f")[a].filter(c=>!(c in r));return l.length>0&&(o[a]=l),o},{})),M(this,at,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{n[o]=(h(this,N,"f")[o]||[]).filter(a=>!r[a])}),s.forEach(o=>{n[o]=xt(h(this,N,"f")[o],a=>!r[a])}),n.envPrefix=h(this,N,"f").envPrefix,M(this,N,n,"f"),M(this,Q,h(this,Q,"f")?h(this,Q,"f").reset(r):$o(this,h(this,q,"f")),"f"),M(this,ce,h(this,ce,"f")?h(this,ce,"f").reset(r):Yo(this,h(this,Q,"f"),h(this,q,"f")),"f"),M(this,he,h(this,he,"f")?h(this,he,"f").reset():ko(h(this,Q,"f"),h(this,ce,"f"),h(this,nt,"f"),h(this,q,"f")),"f"),h(this,et,"f")||M(this,et,Ho(this,h(this,Q,"f"),h(this,he,"f"),h(this,q,"f")),"f"),h(this,nt,"f").reset(),M(this,Qe,null,"f"),M(this,Ie,"","f"),M(this,Ot,null,"f"),M(this,Je,!1,"f"),this.parsed=!1,this}[fs](t,n){return h(this,q,"f").path.relative(t,n)}[kn](t,n,r,i=0,s=!1){let o=!!r||s;t=t||h(this,vt,"f"),h(this,N,"f").__=h(this,q,"f").y18n.__,h(this,N,"f").configuration=this[Zt]();let a=!!h(this,N,"f").configuration["populate--"],l=Object.assign({},h(this,N,"f").configuration,{"populate--":!0}),c=h(this,q,"f").Parser.detailed(t,Object.assign({},h(this,N,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),u=Object.assign(c.argv,h(this,Vt,"f")),f,d=c.aliases,p=!1,y=!1;Object.keys(u).forEach(g=>{g===h(this,rt,"f")&&u[g]?p=!0:g===h(this,lt,"f")&&u[g]&&(y=!0)}),u.$0=this.$0,this.parsed=c,i===0&&h(this,Q,"f").clearCachedHelpMessage();try{if(this[ci](),n)return this[en](u,a,!!r,!1);h(this,rt,"f")&&[h(this,rt,"f")].concat(d[h(this,rt,"f")]||[]).filter(U=>U.length>1).includes(""+u._[u._.length-1])&&(u._.pop(),p=!0),M(this,mr,!1,"f");let g=h(this,he,"f").getCommands(),m=h(this,et,"f").completionKey in u,E=p||m||s;if(u._.length){if(g.length){let _;for(let U=i||0,K;u._[U]!==void 0;U++)if(K=String(u._[U]),g.includes(K)&&K!==h(this,Qe,"f")){let J=h(this,he,"f").runCommand(K,this,c,U+1,s,p||y||s);return this[en](J,a,!!r,!1)}else if(!_&&K!==h(this,Qe,"f")){_=K;break}!h(this,he,"f").hasDefaultCommand()&&h(this,yr,"f")&&_&&!E&&h(this,ce,"f").recommendCommands(_,g)}h(this,Qe,"f")&&u._.includes(h(this,Qe,"f"))&&!m&&(h(this,tt,"f")&&Ct(!0),this.showCompletionScript(),this.exit(0))}if(h(this,he,"f").hasDefaultCommand()&&!E){let _=h(this,he,"f").runCommand(null,this,c,0,s,p||y||s);return this[en](_,a,!!r,!1)}if(m){h(this,tt,"f")&&Ct(!0),t=[].concat(t);let _=t.slice(t.indexOf(`--${h(this,et,"f").completionKey}`)+1);return h(this,et,"f").getCompletion(_,(U,K)=>{if(U)throw new ie(U.message);(K||[]).forEach(J=>{h(this,dn,"f").log(J)}),this.exit(0)}),this[en](u,!a,!!r,!1)}if(h(this,Je,"f")||(p?(h(this,tt,"f")&&Ct(!0),o=!0,this.showHelp("log"),this.exit(0)):y&&(h(this,tt,"f")&&Ct(!0),o=!0,h(this,Q,"f").showVersion("log"),this.exit(0))),!o&&h(this,N,"f").skipValidation.length>0&&(o=Object.keys(u).some(_=>h(this,N,"f").skipValidation.indexOf(_)>=0&&u[_]===!0)),!o){if(c.error)throw new ie(c.error.message);if(!m){let _=this[bi](d,{},c.error);r||(f=Gt(u,this,h(this,nt,"f").getMiddleware(),!0)),f=this[ts](_,f!=null?f:u),le(f)&&!r&&(f=f.then(()=>Gt(u,this,h(this,nt,"f").getMiddleware(),!1)))}}}catch(g){if(g instanceof ie)h(this,Q,"f").fail(g.message,g);else throw g}return this[en](f!=null?f:u,a,!!r,!0)}[bi](t,n,r,i){let s={...this.getDemandedOptions()};return o=>{if(r)throw new ie(r.message);h(this,ce,"f").nonOptionCount(o),h(this,ce,"f").requiredArguments(o,s);let a=!1;h(this,Jt,"f")&&(a=h(this,ce,"f").unknownCommands(o)),h(this,Qt,"f")&&!a?h(this,ce,"f").unknownArguments(o,t,n,!!i):h(this,Xt,"f")&&h(this,ce,"f").unknownArguments(o,t,{},!1,!1),h(this,ce,"f").limitedChoices(o),h(this,ce,"f").implications(o),h(this,ce,"f").conflicting(o)}}[us](){M(this,Je,!0,"f")}[tn](t){if(typeof t=="string")h(this,N,"f").key[t]=!0;else for(let n of t)h(this,N,"f").key[n]=!0}};function Ro(e){return!!e&&typeof e.getInternalMethods=="function"}var pf=ds(Fo),He=pf;b();b();import Lh from"isomorphic-unfetch";b();b();var hf=Object.create,wi=Object.defineProperty,mf=Object.defineProperties,gf=Object.getOwnPropertyDescriptor,bf=Object.getOwnPropertyDescriptors,yf=Object.getOwnPropertyNames,ps=Object.getOwnPropertySymbols,wf=Object.getPrototypeOf,gs=Object.prototype.hasOwnProperty,Af=Object.prototype.propertyIsEnumerable,hs=(e,t,n)=>t in e?wi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xf=(e,t)=>{for(var n in t||(t={}))gs.call(t,n)&&hs(e,n,t[n]);if(ps)for(var n of ps(t))Af.call(t,n)&&hs(e,n,t[n]);return e},Cf=(e,t)=>mf(e,bf(t)),ms=(e=>typeof Se!="undefined"?Se:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof Se!="undefined"?Se:t)[n]}):e)(function(e){if(typeof Se!="undefined")return Se.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),Of=(e,t)=>()=>(e&&(t=e(e=0)),t),ct=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vf=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yf(t))!gs.call(e,i)&&i!==n&&wi(e,i,{get:()=>t[i],enumerable:!(r=gf(t,i))||r.enumerable});return e},Ai=(e,t,n)=>(n=e!=null?hf(wf(e)):{},vf(t||!e||!e.__esModule?wi(n,"default",{value:e,enumerable:!0}):n,e)),Me=Of(()=>{}),Ef=ct((e,t)=>{"use strict";Me(),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]}}),bs=ct((e,t)=>{Me();var n=Ef(),r={};for(let o of Object.keys(n))r[n[o]]=o;var i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=i;for(let o of Object.keys(i)){if(!("channels"in i[o]))throw new Error("missing channels property: "+o);if(!("labels"in i[o]))throw new Error("missing channel labels property: "+o);if(i[o].labels.length!==i[o].channels)throw new Error("channel and label counts mismatch: "+o);let{channels:a,labels:l}=i[o];delete i[o].channels,delete i[o].labels,Object.defineProperty(i[o],"channels",{value:a}),Object.defineProperty(i[o],"labels",{value:l})}i.rgb.hsl=function(o){let a=o[0]/255,l=o[1]/255,c=o[2]/255,u=Math.min(a,l,c),f=Math.max(a,l,c),d=f-u,p,y;f===u?p=0:a===f?p=(l-c)/d:l===f?p=2+(c-a)/d:c===f&&(p=4+(a-l)/d),p=Math.min(p*60,360),p<0&&(p+=360);let g=(u+f)/2;return f===u?y=0:g<=.5?y=d/(f+u):y=d/(2-f-u),[p,y*100,g*100]},i.rgb.hsv=function(o){let a,l,c,u,f,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),E=function(_){return(g-_)/6/m+1/2};return m===0?(u=0,f=0):(f=m/g,a=E(d),l=E(p),c=E(y),d===g?u=c-l:p===g?u=1/3+a-c:y===g&&(u=2/3+l-a),u<0?u+=1:u>1&&(u-=1)),[u*360,f*100,g*100]},i.rgb.hwb=function(o){let a=o[0],l=o[1],c=o[2],u=i.rgb.hsl(o)[0],f=1/255*Math.min(a,Math.min(l,c));return c=1-1/255*Math.max(a,Math.max(l,c)),[u,f*100,c*100]},i.rgb.cmyk=function(o){let a=o[0]/255,l=o[1]/255,c=o[2]/255,u=Math.min(1-a,1-l,1-c),f=(1-a-u)/(1-u)||0,d=(1-l-u)/(1-u)||0,p=(1-c-u)/(1-u)||0;return[f*100,d*100,p*100,u*100]};function s(o,a){return(o[0]-a[0])**2+(o[1]-a[1])**2+(o[2]-a[2])**2}i.rgb.keyword=function(o){let a=r[o];if(a)return a;let l=1/0,c;for(let u of Object.keys(n)){let f=n[u],d=s(o,f);d<l&&(l=d,c=u)}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 u=a*.4124+l*.3576+c*.1805,f=a*.2126+l*.7152+c*.0722,d=a*.0193+l*.1192+c*.9505;return[u*100,f*100,d*100]},i.rgb.lab=function(o){let a=i.rgb.xyz(o),l=a[0],c=a[1],u=a[2];l/=95.047,c/=100,u/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,c=c>.008856?c**(1/3):7.787*c+16/116,u=u>.008856?u**(1/3):7.787*u+16/116;let f=116*c-16,d=500*(l-c),p=200*(c-u);return[f,d,p]},i.hsl.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100,u,f,d;if(l===0)return d=c*255,[d,d,d];c<.5?u=c*(1+l):u=c+l-c*l;let p=2*c-u,y=[0,0,0];for(let g=0;g<3;g++)f=a+1/3*-(g-1),f<0&&f++,f>1&&f--,6*f<1?d=p+(u-p)*6*f:2*f<1?d=u:3*f<2?d=p+(u-p)*(2/3-f)*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,u=l,f=Math.max(c,.01);c*=2,l*=c<=1?c:2-c,u*=f<=1?f:2-f;let d=(c+l)/2,p=c===0?2*u/(f+u):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,u=Math.floor(a)%6,f=a-Math.floor(a),d=255*c*(1-l),p=255*c*(1-l*f),y=255*c*(1-l*(1-f));switch(c*=255,u){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,u=Math.max(c,.01),f,d;d=(2-l)*c;let p=(2-l)*u;return f=l*u,f/=p<=1?p:2-p,f=f||0,d/=2,[a,f*100,d*100]},i.hwb.rgb=function(o){let a=o[0]/360,l=o[1]/100,c=o[2]/100,u=l+c,f;u>1&&(l/=u,c/=u);let d=Math.floor(6*a),p=1-c;f=6*a-d,(d&1)!==0&&(f=1-f);let y=l+f*(p-l),g,m,E;switch(d){default:case 6:case 0:g=p,m=y,E=l;break;case 1:g=y,m=p,E=l;break;case 2:g=l,m=p,E=y;break;case 3:g=l,m=y,E=p;break;case 4:g=y,m=l,E=p;break;case 5:g=p,m=l,E=y;break}return[g*255,m*255,E*255]},i.cmyk.rgb=function(o){let a=o[0]/100,l=o[1]/100,c=o[2]/100,u=o[3]/100,f=1-Math.min(1,a*(1-u)+u),d=1-Math.min(1,l*(1-u)+u),p=1-Math.min(1,c*(1-u)+u);return[f*255,d*255,p*255]},i.xyz.rgb=function(o){let a=o[0]/100,l=o[1]/100,c=o[2]/100,u,f,d;return u=a*3.2406+l*-1.5372+c*-.4986,f=a*-.9689+l*1.8758+c*.0415,d=a*.0557+l*-.204+c*1.057,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,f=f>.0031308?1.055*f**(1/2.4)-.055:f*12.92,d=d>.0031308?1.055*d**(1/2.4)-.055:d*12.92,u=Math.min(Math.max(0,u),1),f=Math.min(Math.max(0,f),1),d=Math.min(Math.max(0,d),1),[u*255,f*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 u=116*l-16,f=500*(a-l),d=200*(l-c);return[u,f,d]},i.lab.xyz=function(o){let a=o[0],l=o[1],c=o[2],u,f,d;f=(a+16)/116,u=l/500+f,d=f-c/200;let p=f**3,y=u**3,g=d**3;return f=p>.008856?p:(f-16/116)/7.787,u=y>.008856?y:(u-16/116)/7.787,d=g>.008856?g:(d-16/116)/7.787,u*=95.047,f*=100,d*=108.883,[u,f,d]},i.lab.lch=function(o){let a=o[0],l=o[1],c=o[2],u;u=Math.atan2(c,l)*360/2/Math.PI,u<0&&(u+=360);let f=Math.sqrt(l*l+c*c);return[a,f,u]},i.lch.lab=function(o){let a=o[0],l=o[1],c=o[2]/360*2*Math.PI,u=l*Math.cos(c),f=l*Math.sin(c);return[a,u,f]},i.rgb.ansi16=function(o,a=null){let[l,c,u]=o,f=a===null?i.rgb.hsv(o)[2]:a;if(f=Math.round(f/50),f===0)return 30;let d=30+(Math.round(u/255)<<2|Math.round(c/255)<<1|Math.round(l/255));return f===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,u=(a>>1&1)*l*255,f=(a>>2&1)*l*255;return[c,u,f]},i.ansi256.rgb=function(o){if(o>=232){let f=(o-232)*10+8;return[f,f,f]}o-=16;let a,l=Math.floor(o/36)/5*255,c=Math.floor((a=o%36)/6)/5*255,u=a%6/5*255;return[l,c,u]},i.rgb.hex=function(o){let a=(((Math.round(o[0])&255)<<16)+((Math.round(o[1])&255)<<8)+(Math.round(o[2])&255)).toString(16).toUpperCase();return"000000".substring(a.length)+a},i.hex.rgb=function(o){let a=o.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!a)return[0,0,0];let l=a[0];a[0].length===3&&(l=l.split("").map(p=>p+p).join(""));let c=parseInt(l,16),u=c>>16&255,f=c>>8&255,d=c&255;return[u,f,d]},i.rgb.hcg=function(o){let a=o[0]/255,l=o[1]/255,c=o[2]/255,u=Math.max(Math.max(a,l),c),f=Math.min(Math.min(a,l),c),d=u-f,p,y;return d<1?p=f/(1-d):p=0,d<=0?y=0:u===a?y=(l-c)/d%6:u===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),u=0;return c<1&&(u=(l-.5*c)/(1-c)),[o[0],c*100,u*100]},i.hsv.hcg=function(o){let a=o[1]/100,l=o[2]/100,c=a*l,u=0;return c<1&&(u=(l-c)/(1-c)),[o[0],c*100,u*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 u=[0,0,0],f=a%1*6,d=f%1,p=1-d,y=0;switch(Math.floor(f)){case 0:u[0]=1,u[1]=d,u[2]=0;break;case 1:u[0]=p,u[1]=1,u[2]=0;break;case 2:u[0]=0,u[1]=1,u[2]=d;break;case 3:u[0]=0,u[1]=p,u[2]=1;break;case 4:u[0]=d,u[1]=0,u[2]=1;break;default:u[0]=1,u[1]=0,u[2]=p}return y=(1-l)*c,[(l*u[0]+y)*255,(l*u[1]+y)*255,(l*u[2]+y)*255]},i.hcg.hsv=function(o){let a=o[1]/100,l=o[2]/100,c=a+l*(1-a),u=0;return c>0&&(u=a/c),[o[0],u*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,u=c-a,f=0;return u<1&&(f=(c-u)/(1-u)),[o[0],u*100,f*100]},i.apple.rgb=function(o){return[o[0]/65535*255,o[1]/65535*255,o[2]/65535*255]},i.rgb.apple=function(o){return[o[0]/255*65535,o[1]/255*65535,o[2]/255*65535]},i.gray.rgb=function(o){return[o[0]/100*255,o[0]/100*255,o[0]/100*255]},i.gray.hsl=function(o){return[0,0,o[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(o){return[0,100,o[0]]},i.gray.cmyk=function(o){return[0,0,0,o[0]]},i.gray.lab=function(o){return[o[0],0,0]},i.gray.hex=function(o){let a=Math.round(o[0]/100*255)&255,l=((a<<16)+(a<<8)+a).toString(16).toUpperCase();return"000000".substring(l.length)+l},i.rgb.gray=function(o){return[(o[0]+o[1]+o[2])/3/255*100]}}),_f=ct((e,t)=>{Me();var n=bs();function r(){let a={},l=Object.keys(n);for(let c=l.length,u=0;u<c;u++)a[l[u]]={distance:-1,parent:null};return a}function i(a){let l=r(),c=[a];for(l[a].distance=0;c.length;){let u=c.pop(),f=Object.keys(n[u]);for(let d=f.length,p=0;p<d;p++){let y=f[p],g=l[y];g.distance===-1&&(g.distance=l[u].distance+1,g.parent=u,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],u=n[l[a].parent][a],f=l[a].parent;for(;l[f].parent;)c.unshift(l[f].parent),u=s(n[l[f].parent][f],u),f=l[f].parent;return u.conversion=c,u}t.exports=function(a){let l=i(a),c={},u=Object.keys(l);for(let f=u.length,d=0;d<f;d++){let p=u[d];l[p].parent!==null&&(c[p]=o(p,l))}return c}}),Sf=ct((e,t)=>{Me();var n=bs(),r=_f(),i={},s=Object.keys(n);function o(l){let c=function(...u){let f=u[0];return f==null?f:(f.length>1&&(u=f),l(u))};return"conversion"in l&&(c.conversion=l.conversion),c}function a(l){let c=function(...u){let f=u[0];if(f==null)return f;f.length>1&&(u=f);let d=l(u);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(u=>{let f=c[u];i[l][u]=a(f),i[l][u].raw=o(f)})}),t.exports=i}),jf=ct((e,t)=>{"use strict";Me();var n=(f,d)=>(...p)=>`\x1B[${f(...p)+d}m`,r=(f,d)=>(...p)=>{let y=f(...p);return`\x1B[${38+d};5;${y}m`},i=(f,d)=>(...p)=>{let y=f(...p);return`\x1B[${38+d};2;${y[0]};${y[1]};${y[2]}m`},s=f=>f,o=(f,d,p)=>[f,d,p],a=(f,d,p)=>{Object.defineProperty(f,d,{get:()=>{let y=p();return Object.defineProperty(f,d,{value:y,enumerable:!0,configurable:!0}),y},enumerable:!0,configurable:!0})},l,c=(f,d,p,y)=>{l===void 0&&(l=Sf());let g=y?10:0,m={};for(let[E,_]of Object.entries(l)){let U=E==="ansi16"?"ansi":E;E===d?m[U]=f(p,g):typeof _=="object"&&(m[U]=f(_[d],g))}return m};function u(){let f=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],f.set(m[0],m[1]);Object.defineProperty(d,p,{value:y,enumerable:!1})}return Object.defineProperty(d,"codes",{value:f,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:u})}),Pf=ct((e,t)=>{"use strict";Me(),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)}}),If=ct((e,t)=>{"use strict";Me();var n=ms("os"),r=ms("tty"),i=Pf(),{env:s}=process,o;i("no-color")||i("no-colors")||i("color=false")||i("color=never")?o=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(o=1),"FORCE_COLOR"in s&&(s.FORCE_COLOR==="true"?o=1:s.FORCE_COLOR==="false"?o=0:o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3));function a(u){return u===0?!1:{level:u,hasBasic:!0,has256:u>=2,has16m:u>=3}}function l(u,f){if(o===0)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(u&&!f&&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(u){let f=l(u,u&&u.isTTY);return a(f)}t.exports={supportsColor:c,stdout:a(l(!0,r.isatty(1))),stderr:a(l(!0,r.isatty(2)))}}),Mf=ct((e,t)=>{"use strict";Me();var n=(i,s,o)=>{let a=i.indexOf(s);if(a===-1)return i;let l=s.length,c=0,u="";do u+=i.substr(c,a-c)+s+o,c=a+l,a=i.indexOf(s,c);while(a!==-1);return u+=i.substr(c),u},r=(i,s,o,a)=>{let l=0,c="";do{let u=i[a-1]==="\r";c+=i.substr(l,(u?a-1:a)-l)+s+(u?`\r
69
+ `,"f"),M(this,Ie,h(this,Ie,"f")+t.join(" "),"f")}}}[li](t){fn(h(this,N,"f")).forEach(n=>{if((i=>i==="configObjects")(n))return;let r=h(this,N,"f")[n];Array.isArray(r)?r.includes(t)&&r.splice(r.indexOf(t),1):typeof r=="object"&&delete r[t]}),delete h(this,Q,"f").getDescriptions()[t]}[Qo](t,n,r){h(this,pr,"f")[r]||(h(this,q,"f").process.emitWarning(t,n),h(this,pr,"f")[r]=!0)}[Jo](){h(this,hr,"f").push({options:h(this,N,"f"),configObjects:h(this,N,"f").configObjects.slice(0),exitProcess:h(this,tt,"f"),groups:h(this,at,"f"),strict:h(this,Qt,"f"),strictCommands:h(this,Jt,"f"),strictOptions:h(this,Xt,"f"),completionCommand:h(this,Qe,"f"),output:h(this,Ie,"f"),exitError:h(this,Ot,"f"),hasOutput:h(this,Je,"f"),parsed:this.parsed,parseFn:h(this,Xe,"f"),parseContext:h(this,Vt,"f")}),h(this,Q,"f").freeze(),h(this,ce,"f").freeze(),h(this,he,"f").freeze(),h(this,nt,"f").freeze()}[Xo](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,q,"f").process.argv()[0])?n=h(this,q,"f").process.argv().slice(1,2):n=h(this,q,"f").process.argv().slice(0,1),t=n.map(r=>{let i=this[fs](h(this,Yt,"f"),r);return r.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<r.length?i:r}).join(" ").trim(),h(this,q,"f").getEnv("_")&&h(this,q,"f").getProcessArgvBin()===h(this,q,"f").getEnv("_")&&(t=h(this,q,"f").getEnv("_").replace(`${h(this,q,"f").path.dirname(h(this,q,"f").process.execPath())}/`,"")),t}[Zt](){return h(this,br,"f")}[ci](){if(!h(this,zt,"f"))return;let t=h(this,q,"f").getEnv("LC_ALL")||h(this,q,"f").getEnv("LC_MESSAGES")||h(this,q,"f").getEnv("LANG")||h(this,q,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Zo](){return this[fi]().version||"unknown"}[es](t){let n=t["--"]?t["--"]:t._;for(let r=0,i;(i=n[r])!==void 0;r++)h(this,q,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(n[r]=Number(i));return t}[fi](t){let n=t||"*";if(h(this,pn,"f")[n])return h(this,pn,"f")[n];let r={};try{let i=t||h(this,q,"f").mainFilename;!t&&h(this,q,"f").path.extname(i)&&(i=h(this,q,"f").path.dirname(i));let s=h(this,q,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});Re(s,void 0,h(this,q,"f")),r=JSON.parse(h(this,q,"f").readFileSync(s,"utf8"))}catch(i){}return h(this,pn,"f")[n]=r||{},h(this,pn,"f")[n]}[Et](t,n){n=[].concat(n),n.forEach(r=>{r=this[pi](r),h(this,N,"f")[t].push(r)})}[hn](t,n,r,i){this[di](t,n,r,i,(s,o,a)=>{h(this,N,"f")[s][o]=a})}[ui](t,n,r,i){this[di](t,n,r,i,(s,o,a)=>{h(this,N,"f")[s][o]=(h(this,N,"f")[s][o]||[]).concat(a)})}[di](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 fn(r))t(o,r[o]);else s(n,this[pi](r),i)}[pi](t){return t==="__proto__"?"___proto___":t}[hi](t,n){return this[hn](this[hi].bind(this),"key",t,n),this}[mi](){var t,n,r,i,s,o,a,l,c,f,u,d;let p=h(this,hr,"f").pop();Re(p,void 0,h(this,q,"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){M(t,N,g,"f")}}.value,configObjects:y,exitProcess:{set value(g){M(n,tt,g,"f")}}.value,groups:{set value(g){M(r,at,g,"f")}}.value,output:{set value(g){M(i,Ie,g,"f")}}.value,exitError:{set value(g){M(s,Ot,g,"f")}}.value,hasOutput:{set value(g){M(o,Je,g,"f")}}.value,parsed:this.parsed,strict:{set value(g){M(a,Qt,g,"f")}}.value,strictCommands:{set value(g){M(l,Jt,g,"f")}}.value,strictOptions:{set value(g){M(c,Xt,g,"f")}}.value,completionCommand:{set value(g){M(f,Qe,g,"f")}}.value,parseFn:{set value(g){M(u,Xe,g,"f")}}.value,parseContext:{set value(g){M(d,Vt,g,"f")}}.value}=p,h(this,N,"f").configObjects=y,h(this,Q,"f").unfreeze(),h(this,ce,"f").unfreeze(),h(this,he,"f").unfreeze(),h(this,nt,"f").unfreeze()}[ts](t,n){return qt(n,r=>(t(r),r))}getInternalMethods(){return{getCommandInstance:this[ns].bind(this),getContext:this[rs].bind(this),getHasOutput:this[is].bind(this),getLoggerInstance:this[os].bind(this),getParseContext:this[ss].bind(this),getParserConfiguration:this[Zt].bind(this),getUsageInstance:this[as].bind(this),getValidationInstance:this[ls].bind(this),hasParseCallback:this[wr].bind(this),isGlobalContext:this[cs].bind(this),postProcess:this[en].bind(this),reset:this[gi].bind(this),runValidation:this[bi].bind(this),runYargsParserAndExecuteCommands:this[Rn].bind(this),setHasOutput:this[us].bind(this)}}[ns](){return h(this,he,"f")}[rs](){return h(this,kn,"f")}[is](){return h(this,Je,"f")}[os](){return h(this,dn,"f")}[ss](){return h(this,Vt,"f")||{}}[as](){return h(this,Q,"f")}[ls](){return h(this,ce,"f")}[wr](){return!!h(this,Xe,"f")}[cs](){return h(this,mr,"f")}[en](t,n,r,i){return r||se(t)||(n||(t=this[Vo](t)),(this[Zt]()["parse-positional-numbers"]||this[Zt]()["parse-positional-numbers"]===void 0)&&(t=this[es](t)),i&&(t=Gt(t,this,h(this,nt,"f").getMiddleware(),!1))),t}[gi](t={}){M(this,N,h(this,N,"f")||{},"f");let n={};n.local=h(this,N,"f").local||[],n.configObjects=h(this,N,"f").configObjects||[];let r={};n.local.forEach(o=>{r[o]=!0,(t[o]||[]).forEach(a=>{r[a]=!0})}),Object.assign(h(this,Kt,"f"),Object.keys(h(this,at,"f")).reduce((o,a)=>{let l=h(this,at,"f")[a].filter(c=>!(c in r));return l.length>0&&(o[a]=l),o},{})),M(this,at,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{n[o]=(h(this,N,"f")[o]||[]).filter(a=>!r[a])}),s.forEach(o=>{n[o]=xt(h(this,N,"f")[o],a=>!r[a])}),n.envPrefix=h(this,N,"f").envPrefix,M(this,N,n,"f"),M(this,Q,h(this,Q,"f")?h(this,Q,"f").reset(r):$o(this,h(this,q,"f")),"f"),M(this,ce,h(this,ce,"f")?h(this,ce,"f").reset(r):Yo(this,h(this,Q,"f"),h(this,q,"f")),"f"),M(this,he,h(this,he,"f")?h(this,he,"f").reset():ko(h(this,Q,"f"),h(this,ce,"f"),h(this,nt,"f"),h(this,q,"f")),"f"),h(this,et,"f")||M(this,et,Ho(this,h(this,Q,"f"),h(this,he,"f"),h(this,q,"f")),"f"),h(this,nt,"f").reset(),M(this,Qe,null,"f"),M(this,Ie,"","f"),M(this,Ot,null,"f"),M(this,Je,!1,"f"),this.parsed=!1,this}[fs](t,n){return h(this,q,"f").path.relative(t,n)}[Rn](t,n,r,i=0,s=!1){let o=!!r||s;t=t||h(this,vt,"f"),h(this,N,"f").__=h(this,q,"f").y18n.__,h(this,N,"f").configuration=this[Zt]();let a=!!h(this,N,"f").configuration["populate--"],l=Object.assign({},h(this,N,"f").configuration,{"populate--":!0}),c=h(this,q,"f").Parser.detailed(t,Object.assign({},h(this,N,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),f=Object.assign(c.argv,h(this,Vt,"f")),u,d=c.aliases,p=!1,y=!1;Object.keys(f).forEach(g=>{g===h(this,rt,"f")&&f[g]?p=!0:g===h(this,lt,"f")&&f[g]&&(y=!0)}),f.$0=this.$0,this.parsed=c,i===0&&h(this,Q,"f").clearCachedHelpMessage();try{if(this[ci](),n)return this[en](f,a,!!r,!1);h(this,rt,"f")&&[h(this,rt,"f")].concat(d[h(this,rt,"f")]||[]).filter(U=>U.length>1).includes(""+f._[f._.length-1])&&(f._.pop(),p=!0),M(this,mr,!1,"f");let g=h(this,he,"f").getCommands(),m=h(this,et,"f").completionKey in f,E=p||m||s;if(f._.length){if(g.length){let _;for(let U=i||0,K;f._[U]!==void 0;U++)if(K=String(f._[U]),g.includes(K)&&K!==h(this,Qe,"f")){let J=h(this,he,"f").runCommand(K,this,c,U+1,s,p||y||s);return this[en](J,a,!!r,!1)}else if(!_&&K!==h(this,Qe,"f")){_=K;break}!h(this,he,"f").hasDefaultCommand()&&h(this,yr,"f")&&_&&!E&&h(this,ce,"f").recommendCommands(_,g)}h(this,Qe,"f")&&f._.includes(h(this,Qe,"f"))&&!m&&(h(this,tt,"f")&&Ct(!0),this.showCompletionScript(),this.exit(0))}if(h(this,he,"f").hasDefaultCommand()&&!E){let _=h(this,he,"f").runCommand(null,this,c,0,s,p||y||s);return this[en](_,a,!!r,!1)}if(m){h(this,tt,"f")&&Ct(!0),t=[].concat(t);let _=t.slice(t.indexOf(`--${h(this,et,"f").completionKey}`)+1);return h(this,et,"f").getCompletion(_,(U,K)=>{if(U)throw new ie(U.message);(K||[]).forEach(J=>{h(this,dn,"f").log(J)}),this.exit(0)}),this[en](f,!a,!!r,!1)}if(h(this,Je,"f")||(p?(h(this,tt,"f")&&Ct(!0),o=!0,this.showHelp("log"),this.exit(0)):y&&(h(this,tt,"f")&&Ct(!0),o=!0,h(this,Q,"f").showVersion("log"),this.exit(0))),!o&&h(this,N,"f").skipValidation.length>0&&(o=Object.keys(f).some(_=>h(this,N,"f").skipValidation.indexOf(_)>=0&&f[_]===!0)),!o){if(c.error)throw new ie(c.error.message);if(!m){let _=this[bi](d,{},c.error);r||(u=Gt(f,this,h(this,nt,"f").getMiddleware(),!0)),u=this[ts](_,u!=null?u:f),se(u)&&!r&&(u=u.then(()=>Gt(f,this,h(this,nt,"f").getMiddleware(),!1)))}}}catch(g){if(g instanceof ie)h(this,Q,"f").fail(g.message,g);else throw g}return this[en](u!=null?u:f,a,!!r,!0)}[bi](t,n,r,i){let s={...this.getDemandedOptions()};return o=>{if(r)throw new ie(r.message);h(this,ce,"f").nonOptionCount(o),h(this,ce,"f").requiredArguments(o,s);let a=!1;h(this,Jt,"f")&&(a=h(this,ce,"f").unknownCommands(o)),h(this,Qt,"f")&&!a?h(this,ce,"f").unknownArguments(o,t,n,!!i):h(this,Xt,"f")&&h(this,ce,"f").unknownArguments(o,t,{},!1,!1),h(this,ce,"f").limitedChoices(o),h(this,ce,"f").implications(o),h(this,ce,"f").conflicting(o)}}[us](){M(this,Je,!0,"f")}[tn](t){if(typeof t=="string")h(this,N,"f").key[t]=!0;else for(let n of t)h(this,N,"f").key[n]=!0}};function Ro(e){return!!e&&typeof e.getInternalMethods=="function"}var pf=ds(Fo),He=pf;b();b();import Lh from"isomorphic-unfetch";b();b();var hf=Object.create,wi=Object.defineProperty,mf=Object.defineProperties,gf=Object.getOwnPropertyDescriptor,bf=Object.getOwnPropertyDescriptors,yf=Object.getOwnPropertyNames,ps=Object.getOwnPropertySymbols,wf=Object.getPrototypeOf,gs=Object.prototype.hasOwnProperty,Af=Object.prototype.propertyIsEnumerable,hs=(e,t,n)=>t in e?wi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xf=(e,t)=>{for(var n in t||(t={}))gs.call(t,n)&&hs(e,n,t[n]);if(ps)for(var n of ps(t))Af.call(t,n)&&hs(e,n,t[n]);return e},Cf=(e,t)=>mf(e,bf(t)),ms=(e=>typeof Se!="undefined"?Se:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof Se!="undefined"?Se:t)[n]}):e)(function(e){if(typeof Se!="undefined")return Se.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),Of=(e,t)=>()=>(e&&(t=e(e=0)),t),ct=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vf=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yf(t))!gs.call(e,i)&&i!==n&&wi(e,i,{get:()=>t[i],enumerable:!(r=gf(t,i))||r.enumerable});return e},Ai=(e,t,n)=>(n=e!=null?hf(wf(e)):{},vf(t||!e||!e.__esModule?wi(n,"default",{value:e,enumerable:!0}):n,e)),Me=Of(()=>{}),Ef=ct((e,t)=>{"use strict";Me(),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]}}),bs=ct((e,t)=>{Me();var n=Ef(),r={};for(let o of Object.keys(n))r[n[o]]=o;var i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=i;for(let o of Object.keys(i)){if(!("channels"in i[o]))throw new Error("missing channels property: "+o);if(!("labels"in i[o]))throw new Error("missing channel labels property: "+o);if(i[o].labels.length!==i[o].channels)throw new Error("channel and label counts mismatch: "+o);let{channels:a,labels:l}=i[o];delete i[o].channels,delete i[o].labels,Object.defineProperty(i[o],"channels",{value:a}),Object.defineProperty(i[o],"labels",{value:l})}i.rgb.hsl=function(o){let a=o[0]/255,l=o[1]/255,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),E=function(_){return(g-_)/6/m+1/2};return m===0?(f=0,u=0):(u=m/g,a=E(d),l=E(p),c=E(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,E;switch(d){default:case 6:case 0:g=p,m=y,E=l;break;case 1:g=y,m=p,E=l;break;case 2:g=l,m=p,E=y;break;case 3:g=l,m=y,E=p;break;case 4:g=y,m=l,E=p;break;case 5:g=p,m=l,E=y;break}return[g*255,m*255,E*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]}}),_f=ct((e,t)=>{Me();var n=bs();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}}),Sf=ct((e,t)=>{Me();var n=bs(),r=_f(),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}),jf=ct((e,t)=>{"use strict";Me();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=Sf());let g=y?10:0,m={};for(let[E,_]of Object.entries(l)){let U=E==="ansi16"?"ansi":E;E===d?m[U]=u(p,g):typeof _=="object"&&(m[U]=u(_[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})}),Pf=ct((e,t)=>{"use strict";Me(),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)}}),If=ct((e,t)=>{"use strict";Me();var n=ms("os"),r=ms("tty"),i=Pf(),{env:s}=process,o;i("no-color")||i("no-colors")||i("color=false")||i("color=never")?o=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(o=1),"FORCE_COLOR"in s&&(s.FORCE_COLOR==="true"?o=1:s.FORCE_COLOR==="false"?o=0:o=s.FORCE_COLOR.length===0?1:Math.min(parseInt(s.FORCE_COLOR,10),3));function a(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)))}}),Mf=ct((e,t)=>{"use strict";Me();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
72
  `,l)}while(a!==-1);return c+=i.substr(l),c};t.exports={stringReplaceAll:n,stringEncaseCRLFWithFirstIndex:r}}),Ff=ct((e,t)=>{"use strict";Me();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(f){let d=f[0]==="u",p=f[1]==="{";return d&&!p&&f.length===5||f[0]==="x"&&f.length===3?String.fromCharCode(parseInt(f.slice(1),16)):d&&p?String.fromCodePoint(parseInt(f.slice(2,-1),16)):o.get(f)||f}function l(f,d){let p=[],y=d.trim().split(/\s*,\s*/g),g;for(let m of y){let E=Number(m);if(!Number.isNaN(E))p.push(E);else if(g=m.match(i))p.push(g[2].replace(s,(_,U,K)=>U?a(U):K));else throw new Error(`Invalid Chalk template style argument: ${m} (in style '${f}')`)}return p}function c(f){r.lastIndex=0;let d=[],p;for(;(p=r.exec(f))!==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 u(f,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=f;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=(f,d)=>{let p=[],y=[],g=[];if(d.replace(n,(m,E,_,U,K,J)=>{if(E)g.push(a(E));else if(U){let V=g.join("");g=[],y.push(p.length===0?V:u(f,p)(V)),p.push({inverse:_,styles:c(U)})}else if(K){if(p.length===0)throw new Error("Found extraneous } in Chalk template literal");y.push(u(f,p)(g.join(""))),g=[],p.pop()}else g.push(J)}),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("")}}),xi=ct((e,t)=>{"use strict";Me();var n=jf(),{stdout:r,stderr:i}=If(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=Mf(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],c=Object.create(null),u=(V,$={})=>{if($.level&&!(Number.isInteger($.level)&&$.level>=0&&$.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let Z=r?r.level:0;V.level=$.level===void 0?Z:$.level},f=class{constructor(V){return d(V)}},d=V=>{let $={};return u($,V),$.template=(...Z)=>K($.template,...Z),Object.setPrototypeOf($,p.prototype),Object.setPrototypeOf($.template,$),$.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},$.template.Instance=f,$.template};function p(V){return d(V)}for(let[V,$]of Object.entries(n))c[V]={get(){let Z=E(this,m($.open,$.close,this._styler),this._isEmpty);return Object.defineProperty(this,V,{value:Z}),Z}};c.visible={get(){let V=E(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:V}),V}};var y=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let V of y)c[V]={get(){let{level:$}=this;return function(...Z){let ne=m(n.color[l[$]][V](...Z),n.color.close,this._styler);return E(this,ne,this._isEmpty)}}};for(let V of y){let $="bg"+V[0].toUpperCase()+V.slice(1);c[$]={get(){let{level:Z}=this;return function(...ne){let Y=m(n.bgColor[l[Z]][V](...ne),n.bgColor.close,this._styler);return E(this,Y,this._isEmpty)}}}}var g=Object.defineProperties(()=>{},Cf(xf({},c),{level:{enumerable:!0,get(){return this._generator.level},set(V){this._generator.level=V}}})),m=(V,$,Z)=>{let ne,Y;return Z===void 0?(ne=V,Y=$):(ne=Z.openAll+V,Y=$+Z.closeAll),{open:V,close:$,openAll:ne,closeAll:Y,parent:Z}},E=(V,$,Z)=>{let ne=(...Y)=>a(Y[0])&&a(Y[0].raw)?_(ne,K(ne,...Y)):_(ne,Y.length===1?""+Y[0]:Y.join(" "));return Object.setPrototypeOf(ne,g),ne._generator=V,ne._styler=$,ne._isEmpty=Z,ne},_=(V,$)=>{if(V.level<=0||!$)return V._isEmpty?"":$;let Z=V._styler;if(Z===void 0)return $;let{openAll:ne,closeAll:Y}=Z;if($.indexOf("\x1B")!==-1)for(;Z!==void 0;)$=s($,Z.close,Z.open),Z=Z.parent;let ze=$.indexOf(`
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 E=Number(m);if(!Number.isNaN(E))p.push(E);else if(g=m.match(i))p.push(g[2].replace(s,(_,U,K)=>U?a(U):K));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,E,_,U,K,J)=>{if(E)g.push(a(E));else if(U){let V=g.join("");g=[],y.push(p.length===0?V:f(u,p)(V)),p.push({inverse:_,styles:c(U)})}else if(K){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(J)}),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("")}}),xi=ct((e,t)=>{"use strict";Me();var n=jf(),{stdout:r,stderr:i}=If(),{stringReplaceAll:s,stringEncaseCRLFWithFirstIndex:o}=Mf(),{isArray:a}=Array,l=["ansi","ansi","ansi256","ansi16m"],c=Object.create(null),f=(V,$={})=>{if($.level&&!(Number.isInteger($.level)&&$.level>=0&&$.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let Z=r?r.level:0;V.level=$.level===void 0?Z:$.level},u=class{constructor(V){return d(V)}},d=V=>{let $={};return f($,V),$.template=(...Z)=>K($.template,...Z),Object.setPrototypeOf($,p.prototype),Object.setPrototypeOf($.template,$),$.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},$.template.Instance=u,$.template};function p(V){return d(V)}for(let[V,$]of Object.entries(n))c[V]={get(){let Z=E(this,m($.open,$.close,this._styler),this._isEmpty);return Object.defineProperty(this,V,{value:Z}),Z}};c.visible={get(){let V=E(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:V}),V}};var y=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let V of y)c[V]={get(){let{level:$}=this;return function(...Z){let ne=m(n.color[l[$]][V](...Z),n.color.close,this._styler);return E(this,ne,this._isEmpty)}}};for(let V of y){let $="bg"+V[0].toUpperCase()+V.slice(1);c[$]={get(){let{level:Z}=this;return function(...ne){let Y=m(n.bgColor[l[Z]][V](...ne),n.bgColor.close,this._styler);return E(this,Y,this._isEmpty)}}}}var g=Object.defineProperties(()=>{},Cf(xf({},c),{level:{enumerable:!0,get(){return this._generator.level},set(V){this._generator.level=V}}})),m=(V,$,Z)=>{let ne,Y;return Z===void 0?(ne=V,Y=$):(ne=Z.openAll+V,Y=$+Z.closeAll),{open:V,close:$,openAll:ne,closeAll:Y,parent:Z}},E=(V,$,Z)=>{let ne=(...Y)=>a(Y[0])&&a(Y[0].raw)?_(ne,K(ne,...Y)):_(ne,Y.length===1?""+Y[0]:Y.join(" "));return Object.setPrototypeOf(ne,g),ne._generator=V,ne._styler=$,ne._isEmpty=Z,ne},_=(V,$)=>{if(V.level<=0||!$)return V._isEmpty?"":$;let Z=V._styler;if(Z===void 0)return $;let{openAll:ne,closeAll:Y}=Z;if($.indexOf("\x1B")!==-1)for(;Z!==void 0;)$=s($,Z.close,Z.open),Z=Z.parent;let ze=$.indexOf(`
74
74
  `);return ze!==-1&&($=o($,Y,ne,ze)),ne+$+Y},U,K=(V,...$)=>{let[Z]=$;if(!a(Z)||!a(Z.raw))return $.join(" ");let ne=$.slice(1),Y=[Z.raw[0]];for(let ze=1;ze<Z.length;ze++)Y.push(String(ne[ze-1]).replace(/[{}\\]/g,"\\$&"),String(Z.raw[ze]));return U===void 0&&(U=Ff()),U(V,Y.join(""))};Object.defineProperties(p.prototype,c);var J=p();J.supportsColor=r,J.stderr=p({level:i?i.level:0}),J.stderr.supportsColor=i,t.exports=J});import{existsSync as _h,mkdirSync as Sh}from"fs";import{readdir as jh,unlink as Ph}from"fs/promises";import{extname as Ih,join as $a}from"path";b();function Ts(e){return typeof e=="undefined"||e===null}function Tf(e){return typeof e=="object"&&e!==null}function Lf(e){return Array.isArray(e)?e:Ts(e)?[]:[e]}function Df(e,t){var n,r,i,s;if(t)for(s=Object.keys(t),n=0,r=s.length;n<r;n+=1)i=s[n],e[i]=t[i];return e}function Nf(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function kf(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Rf=Ts,Uf=Tf,$f=Lf,Wf=Nf,Bf=kf,Hf=Df,je={isNothing:Rf,isObject:Uf,toArray:$f,repeat:Wf,isNegativeZero:Bf,extend:Hf};function Ls(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 Un(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Ls(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Un.prototype=Object.create(Error.prototype);Un.prototype.constructor=Un;Un.prototype.toString=function(t){return this.name+": "+Ls(this,t)};var Ge=Un;function Ci(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 Oi(e,t){return je.repeat(" ",t-e.length)+e}function Gf(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],s,o=-1;s=n.exec(e.buffer);)i.push(s.index),r.push(s.index+s[0].length),e.position<=s.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var a="",l,c,u=Math.min(e.line+t.linesAfter,i.length).toString().length,f=t.maxLength-(t.indent+u+3);for(l=1;l<=t.linesBefore&&!(o-l<0);l++)c=Ci(e.buffer,r[o-l],i[o-l],e.position-(r[o]-r[o-l]),f),a=je.repeat(" ",t.indent)+Oi((e.line-l+1).toString(),u)+" | "+c.str+`
77
- `+a;for(c=Ci(e.buffer,r[o],i[o],e.position,f),a+=je.repeat(" ",t.indent)+Oi((e.line+1).toString(),u)+" | "+c.str+`
78
- `,a+=je.repeat("-",t.indent+u+3+c.pos)+`^
79
- `,l=1;l<=t.linesAfter&&!(o+l>=i.length);l++)c=Ci(e.buffer,r[o+l],i[o+l],e.position-(r[o]-r[o+l]),f),a+=je.repeat(" ",t.indent)+Oi((e.line+l+1).toString(),u)+" | "+c.str+`
80
- `;return a.replace(/\n$/,"")}var qf=Gf,Yf=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],zf=["scalar","sequence","mapping"];function Vf(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Kf(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Yf.indexOf(n)===-1)throw new Ge('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Vf(t.styleAliases||null),zf.indexOf(this.kind)===-1)throw new Ge('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Le=Kf;function ys(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(s,o){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=o)}),n[i]=r}),n}function Qf(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function Ei(e){return this.extend(e)}Ei.prototype.extend=function(t){var n=[],r=[];if(t instanceof Le)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 Ge("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof Le))throw new Ge("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Ge("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 Ge("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 Le))throw new Ge("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Ei.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=ys(i,"implicit"),i.compiledExplicit=ys(i,"explicit"),i.compiledTypeMap=Qf(i.compiledImplicit,i.compiledExplicit),i};var Jf=Ei,Xf=new Le("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Zf=new Le("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),eu=new Le("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),tu=new Jf({explicit:[Xf,Zf,eu]});function nu(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function ru(){return null}function iu(e){return e===null}var ou=new Le("tag:yaml.org,2002:null",{kind:"scalar",resolve:nu,construct:ru,predicate:iu,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function su(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function au(e){return e==="true"||e==="True"||e==="TRUE"}function lu(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var cu=new Le("tag:yaml.org,2002:bool",{kind:"scalar",resolve:su,construct:au,predicate:lu,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function fu(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function uu(e){return 48<=e&&e<=55}function du(e){return 48<=e&&e<=57}function pu(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!fu(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!uu(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!du(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function hu(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function mu(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!je.isNegativeZero(e)}var gu=new Le("tag:yaml.org,2002:int",{kind:"scalar",resolve:pu,construct:hu,predicate:mu,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),bu=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function yu(e){return!(e===null||!bu.test(e)||e[e.length-1]==="_")}function wu(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var Au=/^[-+]?[0-9]+e/;function xu(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(je.isNegativeZero(e))return"-0.0";return n=e.toString(10),Au.test(n)?n.replace("e",".e"):n}function Cu(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||je.isNegativeZero(e))}var Ou=new Le("tag:yaml.org,2002:float",{kind:"scalar",resolve:yu,construct:wu,predicate:Cu,represent:xu,defaultStyle:"lowercase"}),vu=tu.extend({implicit:[ou,cu,gu,Ou]}),Eu=vu,Ds=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ns=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function _u(e){return e===null?!1:Ds.exec(e)!==null||Ns.exec(e)!==null}function Su(e){var t,n,r,i,s,o,a,l=0,c=null,u,f,d;if(t=Ds.exec(e),t===null&&(t=Ns.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(s=+t[4],o=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=+t[10],f=+(t[11]||0),c=(u*60+f)*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 ju(e){return e.toISOString()}var Pu=new Le("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:_u,construct:Su,instanceOf:Date,represent:ju});function Iu(e){return e==="<<"||e===null}var Mu=new Le("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Iu}),Ii=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
76
+ `+e.mark.snippet),r+" "+n):r}function $n(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Ls(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}$n.prototype=Object.create(Error.prototype);$n.prototype.constructor=$n;$n.prototype.toString=function(t){return this.name+": "+Ls(this,t)};var Ge=$n;function Ci(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 Oi(e,t){return je.repeat(" ",t-e.length)+e}function Gf(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],s,o=-1;s=n.exec(e.buffer);)i.push(s.index),r.push(s.index+s[0].length),e.position<=s.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var a="",l,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=Ci(e.buffer,r[o-l],i[o-l],e.position-(r[o]-r[o-l]),u),a=je.repeat(" ",t.indent)+Oi((e.line-l+1).toString(),f)+" | "+c.str+`
77
+ `+a;for(c=Ci(e.buffer,r[o],i[o],e.position,u),a+=je.repeat(" ",t.indent)+Oi((e.line+1).toString(),f)+" | "+c.str+`
78
+ `,a+=je.repeat("-",t.indent+f+3+c.pos)+`^
79
+ `,l=1;l<=t.linesAfter&&!(o+l>=i.length);l++)c=Ci(e.buffer,r[o+l],i[o+l],e.position-(r[o]-r[o+l]),u),a+=je.repeat(" ",t.indent)+Oi((e.line+l+1).toString(),f)+" | "+c.str+`
80
+ `;return a.replace(/\n$/,"")}var qf=Gf,Yf=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],zf=["scalar","sequence","mapping"];function Vf(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Kf(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Yf.indexOf(n)===-1)throw new Ge('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Vf(t.styleAliases||null),zf.indexOf(this.kind)===-1)throw new Ge('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Le=Kf;function ys(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(s,o){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=o)}),n[i]=r}),n}function Qf(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function Ei(e){return this.extend(e)}Ei.prototype.extend=function(t){var n=[],r=[];if(t instanceof Le)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 Ge("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof Le))throw new Ge("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Ge("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 Ge("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 Le))throw new Ge("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Ei.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=ys(i,"implicit"),i.compiledExplicit=ys(i,"explicit"),i.compiledTypeMap=Qf(i.compiledImplicit,i.compiledExplicit),i};var Jf=Ei,Xf=new Le("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Zf=new Le("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),eu=new Le("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),tu=new Jf({explicit:[Xf,Zf,eu]});function nu(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function ru(){return null}function iu(e){return e===null}var ou=new Le("tag:yaml.org,2002:null",{kind:"scalar",resolve:nu,construct:ru,predicate:iu,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function su(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function au(e){return e==="true"||e==="True"||e==="TRUE"}function lu(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var cu=new Le("tag:yaml.org,2002:bool",{kind:"scalar",resolve:su,construct:au,predicate:lu,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function fu(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function uu(e){return 48<=e&&e<=55}function du(e){return 48<=e&&e<=57}function pu(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!fu(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!uu(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!du(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function hu(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function mu(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!je.isNegativeZero(e)}var gu=new Le("tag:yaml.org,2002:int",{kind:"scalar",resolve:pu,construct:hu,predicate:mu,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),bu=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function yu(e){return!(e===null||!bu.test(e)||e[e.length-1]==="_")}function wu(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var Au=/^[-+]?[0-9]+e/;function xu(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(je.isNegativeZero(e))return"-0.0";return n=e.toString(10),Au.test(n)?n.replace("e",".e"):n}function Cu(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||je.isNegativeZero(e))}var Ou=new Le("tag:yaml.org,2002:float",{kind:"scalar",resolve:yu,construct:wu,predicate:Cu,represent:xu,defaultStyle:"lowercase"}),vu=tu.extend({implicit:[ou,cu,gu,Ou]}),Eu=vu,Ds=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ns=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function _u(e){return e===null?!1:Ds.exec(e)!==null||Ns.exec(e)!==null}function Su(e){var t,n,r,i,s,o,a,l=0,c=null,f,u,d;if(t=Ds.exec(e),t===null&&(t=Ns.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 ju(e){return e.toISOString()}var Pu=new Le("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:_u,construct:Su,instanceOf:Date,represent:ju});function Iu(e){return e==="<<"||e===null}var Mu=new Le("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Iu}),Ii=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
81
81
  \r`;function Fu(e){if(e===null)return!1;var t,n,r=0,i=e.length,s=Ii;for(n=0;n<i;n++)if(t=s.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function Tu(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,s=Ii,o=0,a=[];for(t=0;t<i;t++)t%4===0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(r.charAt(t));return n=i%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function Lu(e){var t="",n=0,r,i,s=e.length,o=Ii;for(r=0;r<s;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=s%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function Du(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Nu=new Le("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Fu,construct:Tu,predicate:Du,represent:Lu}),ku=Object.prototype.hasOwnProperty,Ru=Object.prototype.toString;function Uu(e){if(e===null)return!0;var t=[],n,r,i,s,o,a=e;for(n=0,r=a.length;n<r;n+=1){if(i=a[n],o=!1,Ru.call(i)!=="[object Object]")return!1;for(s in i)if(ku.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function $u(e){return e!==null?e:[]}var Wu=new Le("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Uu,construct:$u}),Bu=Object.prototype.toString;function Hu(e){if(e===null)return!0;var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],Bu.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[t]=[i[0],r[i[0]]]}return!0}function Gu(e){if(e===null)return[];var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),s[t]=[i[0],r[i[0]]];return s}var qu=new Le("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Hu,construct:Gu}),Yu=Object.prototype.hasOwnProperty;function zu(e){if(e===null)return!0;var t,n=e;for(t in n)if(Yu.call(n,t)&&n[t]!==null)return!1;return!0}function Vu(e){return e!==null?e:{}}var Ku=new Le("tag:yaml.org,2002:set",{kind:"mapping",resolve:zu,construct:Vu}),ks=Eu.extend({implicit:[Pu,Mu],explicit:[Nu,Wu,qu,Ku]}),St=Object.prototype.hasOwnProperty,Ar=1,Rs=2,Us=3,xr=4,vi=1,Qu=2,ws=3,Ju=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Xu=/[\x85\u2028\u2029]/,Zu=/[,\[\]\{\}]/,$s=/^(?:!|!!|![a-z\-]+!)$/i,Ws=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function As(e){return Object.prototype.toString.call(e)}function ft(e){return e===10||e===13}function rn(e){return e===9||e===32}function qe(e){return e===9||e===32||e===10||e===13}function gn(e){return e===44||e===91||e===93||e===123||e===125}function ed(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function td(e){return e===120?2:e===117?4:e===85?8:0}function nd(e){return 48<=e&&e<=57?e-48:-1}function xs(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
82
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function rd(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Bs=new Array(256),Hs=new Array(256);for(nn=0;nn<256;nn++)Bs[nn]=xs(nn)?1:0,Hs[nn]=xs(nn);var nn;function id(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||ks,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 Gs(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=qf(n),new Ge(t,n)}function B(e,t){throw Gs(e,t)}function Cr(e,t){e.onWarning&&e.onWarning.call(null,Gs(e,t))}var Cs={YAML:function(t,n,r){var i,s,o;t.version!==null&&B(t,"duplication of %YAML directive"),r.length!==1&&B(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&B(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&B(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Cr(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,s;r.length!==2&&B(t,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],$s.test(i)||B(t,"ill-formed tag handle (first argument) of the TAG directive"),St.call(t.tagMap,i)&&B(t,'there is a previously declared suffix for "'+i+'" tag handle'),Ws.test(s)||B(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){B(t,"tag prefix is malformed: "+s)}t.tagMap[i]=s}};function _t(e,t,n,r){var i,s,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,s=a.length;i<s;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||B(e,"expected valid JSON character");else Ju.test(a)&&B(e,"the stream contains non-printable characters");e.result+=a}}function Os(e,t,n,r){var i,s,o,a;for(je.isObject(n)||B(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)s=i[o],St.call(t,s)||(t[s]=n[s],r[s]=!0)}function bn(e,t,n,r,i,s,o,a,l){var c,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,u=i.length;c<u;c+=1)Array.isArray(i[c])&&B(e,"nested arrays are not supported inside keys"),typeof i=="object"&&As(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&As(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,u=s.length;c<u;c+=1)Os(e,t,s[c],n);else Os(e,t,s,n);else!e.json&&!St.call(n,i)&&St.call(t,i)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,B(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 Mi(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++):B(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ge(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;rn(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(ft(i))for(Mi(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&&Cr(e,"deficient indentation"),r}function Er(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||qe(n)))}function Fi(e,t){t===1?e.result+=" ":t>1&&(e.result+=je.repeat(`
83
- `,t-1))}function od(e,t,n){var r,i,s,o,a,l,c,u,f=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),qe(p)||gn(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),qe(i)||n&&gn(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),qe(i)||n&&gn(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),qe(r))break}else{if(e.position===e.lineStart&&Er(e)||n&&gn(p))break;if(ft(p))if(l=e.line,c=e.lineStart,u=e.lineIndent,ge(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=u;break}}a&&(_t(e,s,o,!1),Fi(e,e.line-l),s=o=e.position,a=!1),rn(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return _t(e,s,o,!1),e.result?!0:(e.kind=f,e.result=d,!1)}function sd(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(_t(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else ft(n)?(_t(e,r,i,!0),Fi(e,ge(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Er(e)?B(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);B(e,"unexpected end of the stream within a single quoted scalar")}function ad(e,t){var n,r,i,s,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return _t(e,n,e.position,!0),e.position++,!0;if(a===92){if(_t(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),ft(a))ge(e,!1,t);else if(a<256&&Bs[a])e.result+=Hs[a],e.position++;else if((o=td(a))>0){for(i=o,s=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=ed(a))>=0?s=(s<<4)+o:B(e,"expected hexadecimal character");e.result+=rd(s),e.position++}else B(e,"unknown escape sequence");n=r=e.position}else ft(a)?(_t(e,n,r,!0),Fi(e,ge(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Er(e)?B(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}B(e,"unexpected end of the stream within a double quoted scalar")}function ld(e,t){var n=!0,r,i,s,o=e.tag,a,l=e.anchor,c,u,f,d,p,y=Object.create(null),g,m,E,_;if(_=e.input.charCodeAt(e.position),_===91)u=93,p=!1,a=[];else if(_===123)u=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),_=e.input.charCodeAt(++e.position);_!==0;){if(ge(e,!0,t),_=e.input.charCodeAt(e.position),_===u)return e.position++,e.tag=o,e.anchor=l,e.kind=p?"mapping":"sequence",e.result=a,!0;n?_===44&&B(e,"expected the node content, but found ','"):B(e,"missed comma between flow collection entries"),m=g=E=null,f=d=!1,_===63&&(c=e.input.charCodeAt(e.position+1),qe(c)&&(f=d=!0,e.position++,ge(e,!0,t))),r=e.line,i=e.lineStart,s=e.position,yn(e,t,Ar,!1,!0),m=e.tag,g=e.result,ge(e,!0,t),_=e.input.charCodeAt(e.position),(d||e.line===r)&&_===58&&(f=!0,_=e.input.charCodeAt(++e.position),ge(e,!0,t),yn(e,t,Ar,!1,!0),E=e.result),p?bn(e,a,y,m,g,E,r,i,s):f?a.push(bn(e,null,y,m,g,E,r,i,s)):a.push(g),ge(e,!0,t),_=e.input.charCodeAt(e.position),_===44?(n=!0,_=e.input.charCodeAt(++e.position)):n=!1}B(e,"unexpected end of the stream within a flow collection")}function cd(e,t){var n,r,i=vi,s=!1,o=!1,a=t,l=0,c=!1,u,f;if(f=e.input.charCodeAt(e.position),f===124)r=!1;else if(f===62)r=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)vi===i?i=f===43?ws:Qu:B(e,"repeat of a chomping mode identifier");else if((u=nd(f))>=0)u===0?B(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?B(e,"repeat of an indentation width identifier"):(a=t+u-1,o=!0);else break;if(rn(f)){do f=e.input.charCodeAt(++e.position);while(rn(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!ft(f)&&f!==0)}for(;f!==0;){for(Mi(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),ft(f)){l++;continue}if(e.lineIndent<a){i===ws?e.result+=je.repeat(`
82
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function rd(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Bs=new Array(256),Hs=new Array(256);for(nn=0;nn<256;nn++)Bs[nn]=xs(nn)?1:0,Hs[nn]=xs(nn);var nn;function id(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||ks,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 Gs(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=qf(n),new Ge(t,n)}function B(e,t){throw Gs(e,t)}function Cr(e,t){e.onWarning&&e.onWarning.call(null,Gs(e,t))}var Cs={YAML:function(t,n,r){var i,s,o;t.version!==null&&B(t,"duplication of %YAML directive"),r.length!==1&&B(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&B(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&B(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Cr(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,s;r.length!==2&&B(t,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],$s.test(i)||B(t,"ill-formed tag handle (first argument) of the TAG directive"),St.call(t.tagMap,i)&&B(t,'there is a previously declared suffix for "'+i+'" tag handle'),Ws.test(s)||B(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch(o){B(t,"tag prefix is malformed: "+s)}t.tagMap[i]=s}};function _t(e,t,n,r){var i,s,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,s=a.length;i<s;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||B(e,"expected valid JSON character");else Ju.test(a)&&B(e,"the stream contains non-printable characters");e.result+=a}}function Os(e,t,n,r){var i,s,o,a;for(je.isObject(n)||B(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)s=i[o],St.call(t,s)||(t[s]=n[s],r[s]=!0)}function bn(e,t,n,r,i,s,o,a,l){var 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])&&B(e,"nested arrays are not supported inside keys"),typeof i=="object"&&As(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&As(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)Os(e,t,s[c],n);else Os(e,t,s,n);else!e.json&&!St.call(n,i)&&St.call(t,i)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,B(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 Mi(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++):B(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ge(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;rn(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(ft(i))for(Mi(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&&Cr(e,"deficient indentation"),r}function Er(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||qe(n)))}function Fi(e,t){t===1?e.result+=" ":t>1&&(e.result+=je.repeat(`
83
+ `,t-1))}function od(e,t,n){var r,i,s,o,a,l,c,f,u=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),qe(p)||gn(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),qe(i)||n&&gn(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),qe(i)||n&&gn(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),qe(r))break}else{if(e.position===e.lineStart&&Er(e)||n&&gn(p))break;if(ft(p))if(l=e.line,c=e.lineStart,f=e.lineIndent,ge(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&&(_t(e,s,o,!1),Fi(e,e.line-l),s=o=e.position,a=!1),rn(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return _t(e,s,o,!1),e.result?!0:(e.kind=u,e.result=d,!1)}function sd(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(_t(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else ft(n)?(_t(e,r,i,!0),Fi(e,ge(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Er(e)?B(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);B(e,"unexpected end of the stream within a single quoted scalar")}function ad(e,t){var n,r,i,s,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return _t(e,n,e.position,!0),e.position++,!0;if(a===92){if(_t(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),ft(a))ge(e,!1,t);else if(a<256&&Bs[a])e.result+=Hs[a],e.position++;else if((o=td(a))>0){for(i=o,s=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=ed(a))>=0?s=(s<<4)+o:B(e,"expected hexadecimal character");e.result+=rd(s),e.position++}else B(e,"unknown escape sequence");n=r=e.position}else ft(a)?(_t(e,n,r,!0),Fi(e,ge(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Er(e)?B(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}B(e,"unexpected end of the stream within a double quoted scalar")}function ld(e,t){var n=!0,r,i,s,o=e.tag,a,l=e.anchor,c,f,u,d,p,y=Object.create(null),g,m,E,_;if(_=e.input.charCodeAt(e.position),_===91)f=93,p=!1,a=[];else if(_===123)f=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),_=e.input.charCodeAt(++e.position);_!==0;){if(ge(e,!0,t),_=e.input.charCodeAt(e.position),_===f)return e.position++,e.tag=o,e.anchor=l,e.kind=p?"mapping":"sequence",e.result=a,!0;n?_===44&&B(e,"expected the node content, but found ','"):B(e,"missed comma between flow collection entries"),m=g=E=null,u=d=!1,_===63&&(c=e.input.charCodeAt(e.position+1),qe(c)&&(u=d=!0,e.position++,ge(e,!0,t))),r=e.line,i=e.lineStart,s=e.position,yn(e,t,Ar,!1,!0),m=e.tag,g=e.result,ge(e,!0,t),_=e.input.charCodeAt(e.position),(d||e.line===r)&&_===58&&(u=!0,_=e.input.charCodeAt(++e.position),ge(e,!0,t),yn(e,t,Ar,!1,!0),E=e.result),p?bn(e,a,y,m,g,E,r,i,s):u?a.push(bn(e,null,y,m,g,E,r,i,s)):a.push(g),ge(e,!0,t),_=e.input.charCodeAt(e.position),_===44?(n=!0,_=e.input.charCodeAt(++e.position)):n=!1}B(e,"unexpected end of the stream within a flow collection")}function cd(e,t){var n,r,i=vi,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)vi===i?i=u===43?ws:Qu:B(e,"repeat of a chomping mode identifier");else if((f=nd(u))>=0)f===0?B(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?B(e,"repeat of an indentation width identifier"):(a=t+f-1,o=!0);else break;if(rn(u)){do u=e.input.charCodeAt(++e.position);while(rn(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!ft(u)&&u!==0)}for(;u!==0;){for(Mi(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),ft(u)){l++;continue}if(e.lineIndent<a){i===ws?e.result+=je.repeat(`
84
84
  `,s?1+l:l):i===vi&&s&&(e.result+=`
85
- `);break}for(r?rn(f)?(c=!0,e.result+=je.repeat(`
85
+ `);break}for(r?rn(u)?(c=!0,e.result+=je.repeat(`
86
86
  `,s?1+l:l)):c?(c=!1,e.result+=je.repeat(`
87
87
  `,l+1)):l===0?s&&(e.result+=" "):e.result+=je.repeat(`
88
88
  `,l):e.result+=je.repeat(`
89
- `,s?1+l:l),s=!0,o=!0,l=0,n=e.position;!ft(f)&&f!==0;)f=e.input.charCodeAt(++e.position);_t(e,n,e.position,!1)}return!0}function vs(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,B(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!qe(o))));){if(a=!0,e.position++,ge(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,yn(e,t,Us,!1,!0),s.push(e.result),ge(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)B(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=s,!0):!1}function fd(e,t,n){var r,i,s,o,a,l,c=e.tag,u=e.anchor,f={},d=Object.create(null),p=null,y=null,g=null,m=!1,E=!1,_;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),_=e.input.charCodeAt(e.position);_!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,B(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),s=e.line,(_===63||_===58)&&qe(r))_===63?(m&&(bn(e,f,d,p,y,null,o,a,l),p=y=g=null),E=!0,m=!0,i=!0):m?(m=!1,i=!0):B(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,_=r;else{if(o=e.line,a=e.lineStart,l=e.position,!yn(e,n,Rs,!1,!0))break;if(e.line===s){for(_=e.input.charCodeAt(e.position);rn(_);)_=e.input.charCodeAt(++e.position);if(_===58)_=e.input.charCodeAt(++e.position),qe(_)||B(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(bn(e,f,d,p,y,null,o,a,l),p=y=g=null),E=!0,m=!1,i=!1,p=e.tag,y=e.result;else if(E)B(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=u,!0}else if(E)B(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=u,!0}if((e.line===s||e.lineIndent>t)&&(m&&(o=e.line,a=e.lineStart,l=e.position),yn(e,t,xr,!0,i)&&(m?y=e.result:g=e.result),m||(bn(e,f,d,p,y,g,o,a,l),p=y=g=null),ge(e,!0,-1),_=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&_!==0)B(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&bn(e,f,d,p,y,null,o,a,l),E&&(e.tag=c,e.anchor=u,e.kind="mapping",e.result=f),E}function ud(e){var t,n=!1,r=!1,i,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&B(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)):B(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!qe(o);)o===33&&(r?B(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),$s.test(i)||B(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)&&B(e,"tag suffix cannot contain flow indicator characters")}s&&!Ws.test(s)&&B(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){B(e,"tag name is malformed: "+s)}return n?e.tag=s:St.call(e.tagMap,i)?e.tag=e.tagMap[i]+s:i==="!"?e.tag="!"+s:i==="!!"?e.tag="tag:yaml.org,2002:"+s:B(e,'undeclared tag handle "'+i+'"'),!0}function dd(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&B(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!qe(n)&&!gn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&B(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function pd(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!qe(r)&&!gn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&B(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),St.call(e.anchorMap,n)||B(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ge(e,!0,-1),!0}function yn(e,t,n,r,i){var s,o,a,l=1,c=!1,u=!1,f,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=xr===n||Us===n,r&&ge(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;ud(e)||dd(e);)ge(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||xr===n)&&(Ar===n||Rs===n?g=t:g=t+1,m=e.position-e.lineStart,l===1?a&&(vs(e,m)||fd(e,m,g))||ld(e,g)?u=!0:(o&&cd(e,g)||sd(e,g)||ad(e,g)?u=!0:pd(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&B(e,"alias node should not have any properties")):od(e,g,Ar===n)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(u=a&&vs(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"&&B(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,d=e.implicitTypes.length;f<d;f+=1)if(y=e.implicitTypes[f],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(St.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"],f=0,d=p.length;f<d;f+=1)if(e.tag.slice(0,p[f].tag.length)===p[f].tag){y=p[f];break}y||B(e,"unknown tag !<"+e.tag+">"),e.result!==null&&y.kind!==e.kind&&B(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)):B(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function hd(e){var t=e.position,n,r,i,s=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(ge(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&&!qe(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&B(e,"directive name must not be less than one character in length");o!==0;){for(;rn(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!ft(o));break}if(ft(o))break;for(n=e.position;o!==0&&!qe(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Mi(e),St.call(Cs,r)?Cs[r](e,r,i):Cr(e,'unknown document directive "'+r+'"')}if(ge(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,ge(e,!0,-1)):s&&B(e,"directives end mark is expected"),yn(e,e.lineIndent-1,xr,!1,!0),ge(e,!0,-1),e.checkLineBreaks&&Xu.test(e.input.slice(t,e.position))&&Cr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Er(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ge(e,!0,-1));return}if(e.position<e.length-1)B(e,"end of the stream or a document separator is expected");else return}function qs(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
90
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new id(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,B(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)hd(n);return n.documents}function md(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var r=qs(e,n);if(typeof t!="function")return r;for(var i=0,s=r.length;i<s;i+=1)t(r[i])}function gd(e,t){var n=qs(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Ge("expected a single document in the stream, but found more")}}var bd=md,yd=gd,Ys={loadAll:bd,load:yd},zs=Object.prototype.toString,Vs=Object.prototype.hasOwnProperty,Ti=65279,wd=9,$n=10,Ad=13,xd=32,Cd=33,Od=34,_i=35,vd=37,Ed=38,_d=39,Sd=42,Ks=44,jd=45,Or=58,Pd=61,Id=62,Md=63,Fd=64,Qs=91,Js=93,Td=96,Xs=123,Ld=124,Zs=125,De={};De[0]="\\0";De[7]="\\a";De[8]="\\b";De[9]="\\t";De[10]="\\n";De[11]="\\v";De[12]="\\f";De[13]="\\r";De[27]="\\e";De[34]='\\"';De[92]="\\\\";De[133]="\\N";De[160]="\\_";De[8232]="\\L";De[8233]="\\P";var Dd=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Nd=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function kd(e,t){var n,r,i,s,o,a,l;if(t===null)return{};for(n={},r=Object.keys(t),i=0,s=r.length;i<s;i+=1)o=r[i],a=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=e.compiledTypeMap.fallback[o],l&&Vs.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function Rd(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Ge("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+je.repeat("0",r-t.length)+t}var Ud=1,Wn=2;function $d(e){this.schema=e.schema||ks,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=je.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=kd(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Wn:Ud,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Es(e,t){for(var n=je.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;!ft(u)&&u!==0;)u=e.input.charCodeAt(++e.position);_t(e,n,e.position,!1)}return!0}function vs(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,B(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!qe(o))));){if(a=!0,e.position++,ge(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,yn(e,t,Us,!1,!0),s.push(e.result),ge(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)B(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=s,!0):!1}function fd(e,t,n){var r,i,s,o,a,l,c=e.tag,f=e.anchor,u={},d=Object.create(null),p=null,y=null,g=null,m=!1,E=!1,_;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),_=e.input.charCodeAt(e.position);_!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,B(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),s=e.line,(_===63||_===58)&&qe(r))_===63?(m&&(bn(e,u,d,p,y,null,o,a,l),p=y=g=null),E=!0,m=!0,i=!0):m?(m=!1,i=!0):B(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,_=r;else{if(o=e.line,a=e.lineStart,l=e.position,!yn(e,n,Rs,!1,!0))break;if(e.line===s){for(_=e.input.charCodeAt(e.position);rn(_);)_=e.input.charCodeAt(++e.position);if(_===58)_=e.input.charCodeAt(++e.position),qe(_)||B(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(bn(e,u,d,p,y,null,o,a,l),p=y=g=null),E=!0,m=!1,i=!1,p=e.tag,y=e.result;else if(E)B(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=f,!0}else if(E)B(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),yn(e,t,xr,!0,i)&&(m?y=e.result:g=e.result),m||(bn(e,u,d,p,y,g,o,a,l),p=y=g=null),ge(e,!0,-1),_=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&_!==0)B(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&bn(e,u,d,p,y,null,o,a,l),E&&(e.tag=c,e.anchor=f,e.kind="mapping",e.result=u),E}function ud(e){var t,n=!1,r=!1,i,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&B(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)):B(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!qe(o);)o===33&&(r?B(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),$s.test(i)||B(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)&&B(e,"tag suffix cannot contain flow indicator characters")}s&&!Ws.test(s)&&B(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch(a){B(e,"tag name is malformed: "+s)}return n?e.tag=s:St.call(e.tagMap,i)?e.tag=e.tagMap[i]+s:i==="!"?e.tag="!"+s:i==="!!"?e.tag="tag:yaml.org,2002:"+s:B(e,'undeclared tag handle "'+i+'"'),!0}function dd(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&B(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!qe(n)&&!gn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&B(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function pd(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!qe(r)&&!gn(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&B(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),St.call(e.anchorMap,n)||B(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ge(e,!0,-1),!0}function yn(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=xr===n||Us===n,r&&ge(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;ud(e)||dd(e);)ge(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||xr===n)&&(Ar===n||Rs===n?g=t:g=t+1,m=e.position-e.lineStart,l===1?a&&(vs(e,m)||fd(e,m,g))||ld(e,g)?f=!0:(o&&cd(e,g)||sd(e,g)||ad(e,g)?f=!0:pd(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&B(e,"alias node should not have any properties")):od(e,g,Ar===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(f=a&&vs(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"&&B(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(St.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||B(e,"unknown tag !<"+e.tag+">"),e.result!==null&&y.kind!==e.kind&&B(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)):B(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 hd(e){var t=e.position,n,r,i,s=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(ge(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&&!qe(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&B(e,"directive name must not be less than one character in length");o!==0;){for(;rn(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!ft(o));break}if(ft(o))break;for(n=e.position;o!==0&&!qe(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Mi(e),St.call(Cs,r)?Cs[r](e,r,i):Cr(e,'unknown document directive "'+r+'"')}if(ge(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,ge(e,!0,-1)):s&&B(e,"directives end mark is expected"),yn(e,e.lineIndent-1,xr,!1,!0),ge(e,!0,-1),e.checkLineBreaks&&Xu.test(e.input.slice(t,e.position))&&Cr(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Er(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ge(e,!0,-1));return}if(e.position<e.length-1)B(e,"end of the stream or a document separator is expected");else return}function qs(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
90
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new id(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,B(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)hd(n);return n.documents}function md(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var r=qs(e,n);if(typeof t!="function")return r;for(var i=0,s=r.length;i<s;i+=1)t(r[i])}function gd(e,t){var n=qs(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Ge("expected a single document in the stream, but found more")}}var bd=md,yd=gd,Ys={loadAll:bd,load:yd},zs=Object.prototype.toString,Vs=Object.prototype.hasOwnProperty,Ti=65279,wd=9,Wn=10,Ad=13,xd=32,Cd=33,Od=34,_i=35,vd=37,Ed=38,_d=39,Sd=42,Ks=44,jd=45,Or=58,Pd=61,Id=62,Md=63,Fd=64,Qs=91,Js=93,Td=96,Xs=123,Ld=124,Zs=125,De={};De[0]="\\0";De[7]="\\a";De[8]="\\b";De[9]="\\t";De[10]="\\n";De[11]="\\v";De[12]="\\f";De[13]="\\r";De[27]="\\e";De[34]='\\"';De[92]="\\\\";De[133]="\\N";De[160]="\\_";De[8232]="\\L";De[8233]="\\P";var Dd=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Nd=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function kd(e,t){var n,r,i,s,o,a,l;if(t===null)return{};for(n={},r=Object.keys(t),i=0,s=r.length;i<s;i+=1)o=r[i],a=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=e.compiledTypeMap.fallback[o],l&&Vs.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[o]=a;return n}function Rd(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Ge("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+je.repeat("0",r-t.length)+t}var Ud=1,Bn=2;function $d(e){this.schema=e.schema||ks,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=je.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=kd(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Bn:Ud,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Es(e,t){for(var n=je.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 Si(e,t){return`
93
- `+je.repeat(" ",e.indent*t)}function Wd(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function vr(e){return e===xd||e===wd}function Bn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ti||65536<=e&&e<=1114111}function _s(e){return Bn(e)&&e!==Ti&&e!==Ad&&e!==$n}function Ss(e,t,n){var r=_s(e),i=r&&!vr(e);return(n?r:r&&e!==Ks&&e!==Qs&&e!==Js&&e!==Xs&&e!==Zs)&&e!==_i&&!(t===Or&&!i)||_s(t)&&!vr(t)&&e===_i||t===Or&&i}function Bd(e){return Bn(e)&&e!==Ti&&!vr(e)&&e!==jd&&e!==Md&&e!==Or&&e!==Ks&&e!==Qs&&e!==Js&&e!==Xs&&e!==Zs&&e!==_i&&e!==Ed&&e!==Sd&&e!==Cd&&e!==Ld&&e!==Pd&&e!==Id&&e!==_d&&e!==Od&&e!==vd&&e!==Fd&&e!==Td}function Hd(e){return!vr(e)&&e!==Or}function Rn(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function ea(e){var t=/^\n* /;return t.test(e)}var ta=1,ji=2,na=3,ra=4,mn=5;function Gd(e,t,n,r,i,s,o,a){var l,c=0,u=null,f=!1,d=!1,p=r!==-1,y=-1,g=Bd(Rn(e,0))&&Hd(Rn(e,e.length-1));if(t||o)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Rn(e,l),!Bn(c))return mn;g=g&&Ss(c,u,a),u=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Rn(e,l),c===$n)f=!0,p&&(d=d||l-y-1>r&&e[y+1]!==" ",y=l);else if(!Bn(c))return mn;g=g&&Ss(c,u,a),u=c}d=d||p&&l-y-1>r&&e[y+1]!==" "}return!f&&!d?g&&!o&&!i(e)?ta:s===Wn?mn:ji:n>9&&ea(e)?mn:o?s===Wn?mn:ji:d?ra:na}function qd(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Wn?'""':"''";if(!e.noCompatMode&&(Dd.indexOf(t)!==-1||Nd.test(t)))return e.quotingType===Wn?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),a=r||e.flowLevel>-1&&n>=e.flowLevel;function l(c){return Wd(e,c)}switch(Gd(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!r,i)){case ta:return t;case ji:return"'"+t.replace(/'/g,"''")+"'";case na:return"|"+js(t,e.indent)+Ps(Es(t,s));case ra:return">"+js(t,e.indent)+Ps(Es(Yd(t,o),s));case mn:return'"'+zd(t)+'"';default:throw new Ge("impossible error: invalid scalar style")}}()}function js(e,t){var n=ea(e)?String(t):"",r=e[e.length-1]===`
93
+ `+je.repeat(" ",e.indent*t)}function Wd(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function vr(e){return e===xd||e===wd}function Hn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ti||65536<=e&&e<=1114111}function _s(e){return Hn(e)&&e!==Ti&&e!==Ad&&e!==Wn}function Ss(e,t,n){var r=_s(e),i=r&&!vr(e);return(n?r:r&&e!==Ks&&e!==Qs&&e!==Js&&e!==Xs&&e!==Zs)&&e!==_i&&!(t===Or&&!i)||_s(t)&&!vr(t)&&e===_i||t===Or&&i}function Bd(e){return Hn(e)&&e!==Ti&&!vr(e)&&e!==jd&&e!==Md&&e!==Or&&e!==Ks&&e!==Qs&&e!==Js&&e!==Xs&&e!==Zs&&e!==_i&&e!==Ed&&e!==Sd&&e!==Cd&&e!==Ld&&e!==Pd&&e!==Id&&e!==_d&&e!==Od&&e!==vd&&e!==Fd&&e!==Td}function Hd(e){return!vr(e)&&e!==Or}function Un(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 ea(e){var t=/^\n* /;return t.test(e)}var ta=1,ji=2,na=3,ra=4,mn=5;function Gd(e,t,n,r,i,s,o,a){var l,c=0,f=null,u=!1,d=!1,p=r!==-1,y=-1,g=Bd(Un(e,0))&&Hd(Un(e,e.length-1));if(t||o)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Un(e,l),!Hn(c))return mn;g=g&&Ss(c,f,a),f=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Un(e,l),c===Wn)u=!0,p&&(d=d||l-y-1>r&&e[y+1]!==" ",y=l);else if(!Hn(c))return mn;g=g&&Ss(c,f,a),f=c}d=d||p&&l-y-1>r&&e[y+1]!==" "}return!u&&!d?g&&!o&&!i(e)?ta:s===Bn?mn:ji:n>9&&ea(e)?mn:o?s===Bn?mn:ji:d?ra:na}function qd(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Bn?'""':"''";if(!e.noCompatMode&&(Dd.indexOf(t)!==-1||Nd.test(t)))return e.quotingType===Bn?'"'+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 Wd(e,c)}switch(Gd(t,a,e.indent,o,l,e.quotingType,e.forceQuotes&&!r,i)){case ta:return t;case ji:return"'"+t.replace(/'/g,"''")+"'";case na:return"|"+js(t,e.indent)+Ps(Es(t,s));case ra:return">"+js(t,e.indent)+Ps(Es(Yd(t,o),s));case mn:return'"'+zd(t)+'"';default:throw new Ge("impossible error: invalid scalar style")}}()}function js(e,t){var n=ea(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+`
@@ -101,13 +101,13 @@ ${y.join(`
101
101
  `:"")+Is(l,t),i=s}return r}function Is(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 zd(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Rn(e,i),r=De[n],!r&&Bn(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||Rd(n);return t}function Vd(e,t,n){var r="",i=e.tag,s,o,a;for(s=0,o=n.length;s<o;s+=1)a=n[s],e.replacer&&(a=e.replacer.call(n,String(s),a)),(mt(e,t,a,!1,!1)||typeof a=="undefined"&&mt(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function Ms(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)),(mt(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&mt(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Si(e,t)),e.dump&&$n===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}function Kd(e,t,n){var r="",i=e.tag,s=Object.keys(n),o,a,l,c,u;for(o=0,a=s.length;o<a;o+=1)u="",r!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=s[o],c=n[l],e.replacer&&(c=e.replacer.call(n,l,c)),mt(e,t,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),mt(e,t,c,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump="{"+r+"}"}function Qd(e,t,n,r){var i="",s=e.tag,o=Object.keys(n),a,l,c,u,f,d;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Ge("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)d="",(!r||i!=="")&&(d+=Si(e,t)),c=o[a],u=n[c],e.replacer&&(u=e.replacer.call(n,c,u)),mt(e,t+1,c,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&$n===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,f&&(d+=Si(e,t)),mt(e,t+1,u,!0,f)&&(e.dump&&$n===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=s,e.dump=i||"{}"}function Fs(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,zs.call(a.represent)==="[object Function]")r=a.represent(t,l);else if(Vs.call(a.represent,l))r=a.represent[l](t,l);else throw new Ge("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function mt(e,t,n,r,i,s,o){e.tag=null,e.dump=n,Fs(e,n,!1)||Fs(e,n,!0);var a=zs.call(e.dump),l=r,c;r&&(r=e.flowLevel<0||e.flowLevel>t);var u=a==="[object Object]"||a==="[object Array]",f,d;if(u&&(f=e.duplicates.indexOf(n),d=f!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(i=!1),d&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(u&&d&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),a==="[object Object]")r&&Object.keys(e.dump).length!==0?(Qd(e,t,e.dump,i),d&&(e.dump="&ref_"+f+e.dump)):(Kd(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?Ms(e,t-1,e.dump,i):Ms(e,t,e.dump,i),d&&(e.dump="&ref_"+f+e.dump)):(Vd(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&qd(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Ge("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 Jd(e,t){var n=[],r=[],i,s;for(Pi(e,n,r),i=0,s=r.length;i<s;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(s)}function Pi(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)Pi(e[i],t,n);else for(r=Object.keys(e),i=0,s=r.length;i<s;i+=1)Pi(e[r[i]],t,n)}function Xd(e,t){t=t||{};var n=new $d(t);n.noRefs||Jd(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),mt(n,0,r,!0,!0)?n.dump+`
105
- `:""}var Zd=Xd,ep={dump:Zd};function Li(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 ia=Ys.load,T0=Ys.loadAll,oa=ep.dump;var L0=Li("safeLoad","load"),D0=Li("safeLoadAll","loadAll"),N0=Li("safeDump","dump");import{writeFileSync as Mh}from"fs";import{extname as Wa}from"path";import{readFileSync as Fh}from"fs";import Th from"fs";b();function gt(){}gt.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,u=a+l,f=[{newPos:-1,components:[]}],d=this.extractCommon(f[0],n,t,0);if(f[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,E=f[g-1],_=f[g+1],U=(_?_.newPos:0)-g;E&&(f[g-1]=void 0);var K=E&&E.newPos+1<a,J=_&&0<=U&&U<l;if(!K&&!J){f[g]=void 0;continue}if(!K||J&&E.newPos<_.newPos?(m=np(_),s.pushComponent(m.components,void 0,!0)):(m=E,m.newPos++,s.pushComponent(m.components,!0,void 0)),U=s.extractCommon(m,n,t,g),m.newPos+1>=a&&U+1>=l)return o(tp(s,m.components,n,t,s.useLongestToken));f[g]=m}c++}if(i)(function g(){setTimeout(function(){if(c>u)return i();p()||g()},0)})();else for(;c<=u;){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 tp(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 f=t[s-1];t[s-1]=t[s],t[s]=f}}else{if(!c.added&&i){var u=n.slice(a,a+c.count);u=u.map(function(p,y){var g=r[l+y];return g.length>p.length?g:p}),c.value=e.join(u)}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 np(e){return{newPos:e.newPos,components:e.components.slice(0)}}var R0=new gt;var sa=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,aa=/\S/,la=new gt;la.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!aa.test(e)&&!aa.test(t)};la.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]&&sa.test(t[n])&&sa.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var ki=new gt;ki.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 Ri(e,t,n){return ki.diff(e,t,n)}var rp=new gt;rp.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var ip=new gt;ip.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function _r(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_r=function(t){return typeof t}:_r=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(e)}var op=Object.prototype.toString,wn=new gt;wn.useLongestToken=!0;wn.tokenize=ki.tokenize;wn.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(Di(e,null,null,i),i," ")};wn.equals=function(e,t){return gt.prototype.equals.call(wn,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function ca(e,t,n){return wn.diff(e,t,n)}function Di(e,t,n,r,i){t=t||[],n=n||[],r&&(e=r(i,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var o;if(op.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),n.push(o),s=0;s<e.length;s+=1)o[s]=Di(e[s],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),_r(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]=Di(e[l],t,n,r,l);t.pop(),n.pop()}else o=e;return o}var Ni=new gt;Ni.tokenize=function(e){return e.slice()};Ni.join=Ni.removeEmpty=function(e){return e};var Ga=uo(Ua(),1);Me();Me();async function be({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}}Me();var Eh=Ai(xi());Me();function k(e){var t,n;return e.option("apiKey",{describe:"Uniform API key. Defaults to CANVAS_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",default:(n=(t=process.env.CANVAS_CLI_API_KEY)!=null?t:process.env.UPM_CLI_API_KEY)!=null?n:process.env.UNIFORM_API_KEY,demandOption:!0,type:"string"}).option("apiHost",{describe:"Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or https://uniform.app. Supports dotenv.",default:process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app",demandOption:!0,type:"string"})}function R(e){var t,n,r;return e.option("project",{describe:"Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",default:(r=(n=(t=process.env.UNIFORM_CLI_PROJECT_ID)!=null?t:process.env.CANVAS_CLI_PROJECT_ID)!=null?n:process.env.UPM_CLI_PROJECT_ID)!=null?r:process.env.UNIFORM_PROJECT_ID,demandOption:!0,type:"string",alias:["p"]})}function ye(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 we(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 Ae(e){let t=Wa(e);return t===".yaml"||t===".yml"||t===".json"}function fe(e,t,n){let r;if(n&&!t){let i=Wa(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=oa(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?Mh(n,r,"utf8"):console.log(r)}function ut(e){let t=Fh(e,"utf8");return ia(t,{filename:e,json:!0})}async function xe({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:r=n}){_h(e)||Sh(e,{recursive:!0});let i=await jh(e,"utf-8"),s=new Set(i.filter(l=>{let c=Ih(l);return c===".json"||c===".yaml"||c===".yml"})),o=l=>$a(e,`${l}.${t}`);async function*a(){for(let l of s){let c=$a(e,l);try{let u=await ut(c);yield{id:n(u),displayName:r(u),providerId:c,object:u}}catch(u){throw console.error(Eh.default.red(`Failed to read ${c}, data is likely invalid.
106
- ${u==null?void 0:u.message}`)),u}}}return{objects:a(),deleteObject:async l=>{await Ph(l)},writeObject:async l=>{fe(l.object,t,o(l.id))}}}Me();function Ba(e,t){if(!t&&!Th.existsSync(e))return{};let n=ut(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function Ha(e,t){fe(t,void 0,e)}Me();async function ue({source:e,target:t,compareContents:n=(a,l)=>(0,Ga.default)(a.object,l.object,(c,u,f)=>f==="created"||f==="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 u=[],f=!1;for await(let d of e.objects){f=!0;let p=d.id,y=c.get(p);if(y){if(!n(d,y)&&(r==="createOrUpdate"||r==="mirror")){let g=async(m,E)=>{var _;if(!s)try{await t.writeObject(m,E)}catch(U){throw new Nr(U,m)}o({action:"update",id:p,providerId:m.providerId,displayName:(_=m.displayName)!=null?_:m.providerId,whatIf:s,diff:ca(E.object,m.object)})};u.push(g(d,y))}c.delete(p)}else{let g=async(m,E)=>{var _;if(!s)try{await t.writeObject(m)}catch(U){throw new Nr(U,m)}o({action:"create",id:E,providerId:E,displayName:(_=m.displayName)!=null?_:m.providerId,whatIf:s,diff:Ri("",JSON.stringify(m.object,null,2))})};u.push(g(d,p))}}if(await Promise.all(u),r==="mirror"){if(!f&&!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(E){throw new Nr(E,g)}o({action:"delete",id:g.id,providerId:g.providerId,displayName:(m=g.displayName)!=null?m:g.providerId,whatIf:s,diff:Ri(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 Nr=class extends Error{constructor(e,t){var n;super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
104
+ `+e.slice(o+1):l+=e.slice(i),l.slice(1)}function zd(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=Un(e,i),r=De[n],!r&&Hn(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||Rd(n);return t}function Vd(e,t,n){var r="",i=e.tag,s,o,a;for(s=0,o=n.length;s<o;s+=1)a=n[s],e.replacer&&(a=e.replacer.call(n,String(s),a)),(mt(e,t,a,!1,!1)||typeof a=="undefined"&&mt(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function Ms(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)),(mt(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&mt(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Si(e,t)),e.dump&&Wn===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}function Kd(e,t,n){var r="",i=e.tag,s=Object.keys(n),o,a,l,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)),mt(e,t,l,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),mt(e,t,c,!1,!1)&&(f+=e.dump,r+=f));e.tag=i,e.dump="{"+r+"}"}function Qd(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 Ge("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)d="",(!r||i!=="")&&(d+=Si(e,t)),c=o[a],f=n[c],e.replacer&&(f=e.replacer.call(n,c,f)),mt(e,t+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&Wn===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,u&&(d+=Si(e,t)),mt(e,t+1,f,!0,u)&&(e.dump&&Wn===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=s,e.dump=i||"{}"}function Fs(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,zs.call(a.represent)==="[object Function]")r=a.represent(t,l);else if(Vs.call(a.represent,l))r=a.represent[l](t,l);else throw new Ge("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function mt(e,t,n,r,i,s,o){e.tag=null,e.dump=n,Fs(e,n,!1)||Fs(e,n,!0);var a=zs.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?(Qd(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 Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?Ms(e,t-1,e.dump,i):Ms(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(Vd(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&qd(e,e.dump,t,s,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Ge("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 Jd(e,t){var n=[],r=[],i,s;for(Pi(e,n,r),i=0,s=r.length;i<s;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(s)}function Pi(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)Pi(e[i],t,n);else for(r=Object.keys(e),i=0,s=r.length;i<s;i+=1)Pi(e[r[i]],t,n)}function Xd(e,t){t=t||{};var n=new $d(t);n.noRefs||Jd(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),mt(n,0,r,!0,!0)?n.dump+`
105
+ `:""}var Zd=Xd,ep={dump:Zd};function Li(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 ia=Ys.load,T0=Ys.loadAll,oa=ep.dump;var L0=Li("safeLoad","load"),D0=Li("safeLoadAll","loadAll"),N0=Li("safeDump","dump");import{writeFileSync as Mh}from"fs";import{extname as Wa}from"path";import{readFileSync as Fh}from"fs";import Th from"fs";b();function gt(){}gt.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,E=u[g-1],_=u[g+1],U=(_?_.newPos:0)-g;E&&(u[g-1]=void 0);var K=E&&E.newPos+1<a,J=_&&0<=U&&U<l;if(!K&&!J){u[g]=void 0;continue}if(!K||J&&E.newPos<_.newPos?(m=np(_),s.pushComponent(m.components,void 0,!0)):(m=E,m.newPos++,s.pushComponent(m.components,!0,void 0)),U=s.extractCommon(m,n,t,g),m.newPos+1>=a&&U+1>=l)return o(tp(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 tp(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 np(e){return{newPos:e.newPos,components:e.components.slice(0)}}var R0=new gt;var sa=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,aa=/\S/,la=new gt;la.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!aa.test(e)&&!aa.test(t)};la.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]&&sa.test(t[n])&&sa.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var ki=new gt;ki.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 Ri(e,t,n){return ki.diff(e,t,n)}var rp=new gt;rp.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var ip=new gt;ip.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function _r(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_r=function(t){return typeof t}:_r=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(e)}var op=Object.prototype.toString,wn=new gt;wn.useLongestToken=!0;wn.tokenize=ki.tokenize;wn.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(Di(e,null,null,i),i," ")};wn.equals=function(e,t){return gt.prototype.equals.call(wn,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function ca(e,t,n){return wn.diff(e,t,n)}function Di(e,t,n,r,i){t=t||[],n=n||[],r&&(e=r(i,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var o;if(op.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),n.push(o),s=0;s<e.length;s+=1)o[s]=Di(e[s],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),_r(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]=Di(e[l],t,n,r,l);t.pop(),n.pop()}else o=e;return o}var Ni=new gt;Ni.tokenize=function(e){return e.slice()};Ni.join=Ni.removeEmpty=function(e){return e};var Ga=uo(Ua(),1);Me();Me();async function be({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}}Me();var Eh=Ai(xi());Me();function k(e){var t,n;return e.option("apiKey",{describe:"Uniform API key. Defaults to CANVAS_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",default:(n=(t=process.env.CANVAS_CLI_API_KEY)!=null?t:process.env.UPM_CLI_API_KEY)!=null?n:process.env.UNIFORM_API_KEY,demandOption:!0,type:"string"}).option("apiHost",{describe:"Uniform host. Defaults to UNIFORM_CLI_BASE_URL env or https://uniform.app. Supports dotenv.",default:process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app",demandOption:!0,type:"string"})}function R(e){var t,n,r;return e.option("project",{describe:"Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",default:(r=(n=(t=process.env.UNIFORM_CLI_PROJECT_ID)!=null?t:process.env.CANVAS_CLI_PROJECT_ID)!=null?n:process.env.UPM_CLI_PROJECT_ID)!=null?r:process.env.UNIFORM_PROJECT_ID,demandOption:!0,type:"string",alias:["p"]})}function ye(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 we(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 Ae(e){let t=Wa(e);return t===".yaml"||t===".yml"||t===".json"}function fe(e,t,n){let r;if(n&&!t){let i=Wa(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=oa(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?Mh(n,r,"utf8"):console.log(r)}function ut(e){let t=Fh(e,"utf8");return ia(t,{filename:e,json:!0})}async function xe({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:r=n}){_h(e)||Sh(e,{recursive:!0});let i=await jh(e,"utf-8"),s=new Set(i.filter(l=>{let c=Ih(l);return c===".json"||c===".yaml"||c===".yml"})),o=l=>$a(e,`${l}.${t}`);async function*a(){for(let l of s){let c=$a(e,l);try{let f=await ut(c);yield{id:n(f),displayName:r(f),providerId:c,object:f}}catch(f){throw console.error(Eh.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 Ph(l)},writeObject:async l=>{fe(l.object,t,o(l.id))}}}Me();function Ba(e,t){if(!t&&!Th.existsSync(e))return{};let n=ut(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function Ha(e,t){fe(t,void 0,e)}Me();async function ue({source:e,target:t,compareContents:n=(a,l)=>(0,Ga.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,E)=>{var _;if(!s)try{await t.writeObject(m,E)}catch(U){throw new Nr(U,m)}o({action:"update",id:p,providerId:m.providerId,displayName:(_=m.displayName)!=null?_:m.providerId,whatIf:s,diff:ca(E.object,m.object)})};f.push(g(d,y))}c.delete(p)}else{let g=async(m,E)=>{var _;if(!s)try{await t.writeObject(m)}catch(U){throw new Nr(U,m)}o({action:"create",id:E,providerId:E,displayName:(_=m.displayName)!=null?_:m.providerId,whatIf:s,diff:Ri("",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(E){throw new Nr(E,g)}o({action:"delete",id:g.id,providerId:g.providerId,displayName:(m=g.displayName)!=null?m:g.providerId,whatIf:s,diff:Ri(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 Nr=class extends Error{constructor(e,t){var n;super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
107
107
  ${e}`),this.stack=void 0,Object.setPrototypeOf(this,Nr.prototype)}};Me();var On=Ai(xi());function de(e){let{diffMode:t="off",indent:n,prefix:r}=e!=null?e:{};return function({action:i,displayName:s,whatIf:o,diff:a}){let l="";switch(i){case"create":l=On.default.green("[A]");break;case"update":l=On.default.white("[U]");break;case"delete":l=On.default.yellow("[D]");break}let c="";(t==="on"||t==="update"&&i==="update")&&(c=`
108
- `+a.map(u=>u.added?On.default.green(u.value):u.removed?On.default.red(u.value):u.value).join("")),console.log(`${n!=null?n:""}${o?On.default.gray("[WHATIF]"):""}${l}${r!=null?r:""} ${s}${c}`)}}b();b();b();var qa=async e=>await e(),Mt=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,Mt.prototype)}};var Ne=class{constructor(t){po(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:qa}}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 Mt(o,(s=n==null?void 0:n.method)!=null?s:"GET",t.toString(),i.status,i.statusText,Ne.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 vn,zn=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(ae(zn,vn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(ae(zn,vn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ae(zn,vn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Ue=zn;vn=new WeakMap,Ve(Ue,vn,"/api/v2/aggregate");var Ya={command:"get <id>",describe:"Fetch an aggregate",builder:e=>ye(k(R(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new Ue({apiKey:t,apiHost:e,fetch:Lh,projectId:i}).get({aggregateId:n});a.aggregates.length===0?(console.error("Aggregate did not exist"),process.exit(1)):fe(a.aggregates[0],r,s)}};b();import Dh from"isomorphic-unfetch";var za={command:"list",describe:"List aggregates",aliases:["ls"],builder:e=>ye(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Ue({apiKey:t,apiHost:e,fetch:Dh,projectId:i}).get({});fe(o.aggregates,n,r)}};b();import kh from"isomorphic-unfetch";b();var Ft=e=>e.id,Tt=e=>`${e.name} (pid: ${e.id})`;b();function Ce(e,t){return Ba(e,t)}function dt(e,t){Ha(e,t)}b();import Nh from"p-limit";var Oe=Nh(8);b();function kr({client:e,type:t}){async function*n(){let i=(await e.get({type:t})).aggregates;for await(let s of i)yield{id:Ft(s),displayName:Tt(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 Va={command:"pull <directory>",describe:"Pulls all aggregates to local files in a directory",builder:e=>k(R(we(e.positional("directory",{describe:"Directory to save the aggregates to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new Ue({apiKey:t,apiHost:e,fetch:kh,projectId:o,limitPolicy:Oe}),c=kr({client:l}),u;if(Ae(n)){let p=Ce(n,!1);u=await be({objects:(d=p.aggregates)!=null?d:[],selectIdentifier:Ft,selectDisplayName:Tt,onSyncComplete:async(y,g)=>{p.aggregates=g,dt(n,p)}})}else u=await xe({directory:n,selectIdentifier:Ft,selectDisplayName:Tt,format:r});await ue({source:c,target:u,mode:i,whatIf:s,log:de({diffMode:a})})}};b();import Rh from"isomorphic-unfetch";var Ka={command:"push <directory>",describe:"Pushes all aggregates from files in a directory or package to Uniform",builder:e=>k(R(we(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 f;let a=new Ue({apiKey:t,apiHost:e,fetch:Rh,projectId:s,limitPolicy:Oe}),l;if(Ae(n)){let d=Ce(n,!0);l=await be({objects:(f=d.aggregates)!=null?f:[],selectIdentifier:Ft,selectDisplayName:Tt})}else l=await xe({directory:n,selectIdentifier:Ft,selectDisplayName:Tt});let u=kr({client:a});await ue({source:l,target:u,mode:r,whatIf:i,log:de({diffMode:o})}),await u.complete()}};b();import Uh from"isomorphic-unfetch";var Qa={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an aggregate",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Ue({apiKey:t,apiHost:e,fetch:Uh,projectId:r}).remove({aggregateId:n})}};b();import $h from"isomorphic-unfetch";var Ja={command:"update <filename>",aliases:["put"],describe:"Insert or update an aggregate",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Aggregate file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new Ue({apiKey:t,apiHost:e,fetch:$h,projectId:r}),s=ut(n);await i.upsert({aggregate:s})}};var Xa={command:"aggregate <command>",aliases:["agg","intent","audience"],describe:"Commands for Context aggregates (intents, audiences)",builder:e=>e.command(Va).command(Ka).command(Ya).command(Qa).command(za).command(Ja).demandCommand(),handler:()=>{He.help()}};b();b();import Wh from"isomorphic-unfetch";b();var En,Vn,ln=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(ae(ln,En),{...t,projectId:n});return await this.apiClient(r)}async upsertCategory(t){let n=this.createUrl(ae(ln,En));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(t){let n=this.createUrl(ae(ln,En));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(t){let n=this.createUrl(ae(ln,Vn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(t){let n=this.createUrl(ae(ln,Vn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Ye=ln;En=new WeakMap,Vn=new WeakMap,Ve(Ye,En,"/api/v1/enrichments"),Ve(Ye,Vn,"/api/v1/enrichment-values");var Za={command:"get <id>",describe:"Fetch an enrichment category and its values",builder:e=>ye(k(R(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{var l,c;let a=(c=(l=await new Ye({apiKey:t,apiHost:e,fetch:Wh,projectId:i}).get())==null?void 0:l.enrichments)==null?void 0:c.filter(u=>u.id===n);a.length===0?(console.error("Enrichment did not exist"),process.exit(1)):fe(a[0],r,s)}};b();import Bh from"isomorphic-unfetch";var el={command:"list",describe:"List enrichments",aliases:["ls"],builder:e=>ye(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Ye({apiKey:t,apiHost:e,fetch:Bh,projectId:i}).get();fe(o.enrichments,n,r)}};b();import Hh from"isomorphic-unfetch";b();var Lt=e=>e.id,Dt=e=>`${e.name} (pid: ${e.id})`;b();function Rr({client:e}){async function*t(){let n=(await e.get()).enrichments;for await(let r of n)yield{id:Lt(r),displayName:Dt(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=tl({categoryId:n.id,values:n.object.values}),s=tl({categoryId:n.id,values:(a=(o=r==null?void 0:r.object)==null?void 0:o.values)!=null?a:[],client:e});await ue({source:i,target:s,mode:"mirror",whatIf:!1,log:de({diffMode:"off",prefix:` ${n.displayName} value`,indent:"> "})})}}}var tl=({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 nl={command:"pull <directory>",describe:"Pulls all enrichments to local files in a directory",builder:e=>k(R(we(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 Ye({apiKey:t,apiHost:e,fetch:Hh,projectId:o,limitPolicy:Oe}),c=Rr({client:l}),u;if(Ae(n)){let p=Ce(n,!1);u=await be({objects:(d=p.enrichments)!=null?d:[],selectIdentifier:Lt,selectDisplayName:Dt,onSyncComplete:async(y,g)=>{p.enrichments=g,dt(n,p)}})}else u=await xe({directory:n,selectIdentifier:Lt,selectDisplayName:Dt,format:r});await ue({source:c,target:u,mode:i,whatIf:s,log:de({diffMode:a})})}};b();import Gh from"isomorphic-unfetch";var rl={command:"push <directory>",describe:"Pushes all enrichments from files in a directory or package to Uniform",builder:e=>k(R(we(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 f;let a=new Ye({apiKey:t,apiHost:e,fetch:Gh,projectId:s,limitPolicy:Oe}),l;if(Ae(n)){let d=Ce(n,!0);l=await be({objects:(f=d.enrichments)!=null?f:[],selectIdentifier:Lt,selectDisplayName:Dt})}else l=await xe({directory:n,selectIdentifier:Lt,selectDisplayName:Dt});let u=Rr({client:a});await ue({source:l,target:u,mode:r,whatIf:i,log:de({diffMode:o})})}};b();import qh from"isomorphic-unfetch";var il={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an enrichment category and its values",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Ye({apiKey:t,apiHost:e,fetch:qh,projectId:r}).removeCategory({enrichmentId:n})}};var ol={command:"enrichment <command>",aliases:["enr"],describe:"Commands for Context enrichments",builder:e=>e.command(nl).command(rl).command(Za).command(il).command(el).demandCommand(),handler:()=>{He.help()}};b();b();var Xn=uo(Rl());import{writeFile as gm}from"fs";import bm from"isomorphic-unfetch";import{exit as co}from"process";b();var qr,lo=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(ae(lo,qr),{...t,projectId:n});return await this.apiClient(r)}},Jn=lo;qr=new WeakMap,Ve(Jn,qr,"/api/v2/manifest");var Ul={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(Xn.default.red("You must specify the project ID")),co(1));let i=ym(),s=new Jn({apiHost:i,projectId:n,apiKey:e,fetch:bm});try{let o=await s.get({preview:r}),a=JSON.stringify(o,null,2);t?gm(t,a,l=>{l&&(console.error(`Error writing file to ${t}
110
- `,l),co(1)),console.log(Xn.default.green(`\u2705 ${t} has been updated from ${i}`))}):console.log(a)}catch(o){let a;o instanceof Mt?(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(Xn.default.red("\u26A0 Error fetching Context manifest")),console.error(Xn.default.gray(` \u2757 ${a}`)),co(1)}}},ym=()=>process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app";var $l={command:"manifest <command>",describe:"Commands for context manifests",aliases:["man"],builder:e=>e.command(Ul).demandCommand(),handler:()=>{He.help()}};b();b();import wm from"isomorphic-unfetch";b();var In,Zn=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(ae(Zn,In),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(ae(Zn,In));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ae(Zn,In));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},$e=Zn;In=new WeakMap,Ve($e,In,"/api/v2/quirk");var Wl={command:"get <id>",describe:"Fetch a quirk",builder:e=>ye(k(R(e.positional("id",{demandOption:!0,describe:"Quirk public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new $e({apiKey:t,apiHost:e,fetch:wm,projectId:i}).get({quirkId:n,withIntegrations:!0});a.quirks.length===0?(console.error("Quirk did not exist"),process.exit(1)):fe(a.quirks[0],r,s)}};b();import Am from"isomorphic-unfetch";var Bl={command:"list",describe:"List quirks",aliases:["ls"],builder:e=>ye(k(R(e.option("withIntegrations",{alias:["i"],describe:"Whether to include meta-quirks created by integrations in the list. Defaults to false.",type:"boolean"})))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i,withIntegrations:s})=>{let a=await new $e({apiKey:t,apiHost:e,fetch:Am,projectId:i}).get({withIntegrations:s});fe(a.quirks,n,r)}};b();import xm from"isomorphic-unfetch";b();var kt=e=>e.id,Rt=e=>`${e.name} (pid: ${e.id})`;b();function Yr({client:e}){async function*t(){let n=(await e.get({withIntegrations:!1})).quirks;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({quirkId:n})},writeObject:async n=>{await e.upsert({quirk:n.object})}}}var Hl={command:"pull <directory>",describe:"Pulls all quirks to local files in a directory",builder:e=>k(R(we(e.positional("directory",{describe:"Directory to save the quirks to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new $e({apiKey:t,apiHost:e,fetch:xm,projectId:o,limitPolicy:Oe}),c=Yr({client:l}),u;if(Ae(n)){let p=Ce(n,!1);u=await be({objects:(d=p.quirks)!=null?d:[],selectIdentifier:kt,selectDisplayName:Rt,onSyncComplete:async(y,g)=>{p.quirks=g,dt(n,p)}})}else u=await xe({directory:n,selectIdentifier:kt,selectDisplayName:Rt,format:r});await ue({source:c,target:u,mode:i,whatIf:s,log:de({diffMode:a})})}};b();import Cm from"isomorphic-unfetch";var Gl={command:"push <directory>",describe:"Pushes all quirks from files in a directory or package to Uniform",builder:e=>k(R(we(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 f;let a=new $e({apiKey:t,apiHost:e,fetch:Cm,projectId:s,limitPolicy:Oe}),l;if(Ae(n)){let d=Ce(n,!0);l=await be({objects:(f=d.quirks)!=null?f:[],selectIdentifier:kt,selectDisplayName:Rt})}else l=await xe({directory:n,selectIdentifier:kt,selectDisplayName:Rt});let u=Yr({client:a});await ue({source:l,target:u,mode:r,whatIf:i,log:de({diffMode:o})})}};b();import Om from"isomorphic-unfetch";var ql={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a quirk",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Quirk public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new $e({apiKey:t,apiHost:e,fetch:Om,projectId:r}).remove({quirkId:n})}};b();import vm from"isomorphic-unfetch";var Yl={command:"update <filename>",aliases:["put"],describe:"Insert or update a quirk",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Quirk file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new $e({apiKey:t,apiHost:e,fetch:vm,projectId:r}),s=ut(n);await i.upsert({quirk:s})}};var zl={command:"quirk <command>",aliases:["qk"],describe:"Commands for Context quirks",builder:e=>e.command(Hl).command(Gl).command(Wl).command(ql).command(Bl).command(Yl).demandCommand(),handler:()=>{He.help()}};b();b();import Em from"isomorphic-unfetch";b();var Mn,er=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(ae(er,Mn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(ae(er,Mn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ae(er,Mn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},We=er;Mn=new WeakMap,Ve(We,Mn,"/api/v2/signal");var Vl={command:"get <id>",describe:"Fetch a signal",builder:e=>ye(k(R(e.positional("id",{demandOption:!0,describe:"Signal public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new We({apiKey:t,apiHost:e,fetch:Em,projectId:i}).get({signalId:n});a.signals.length===0?(console.error("Signal did not exist"),process.exit(1)):fe(a.signals[0],r,s)}};b();import _m from"isomorphic-unfetch";var Kl={command:"list",describe:"List signals",aliases:["ls"],builder:e=>ye(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new We({apiKey:t,apiHost:e,fetch:_m,projectId:i}).get();fe(o.signals,n,r)}};b();import Sm from"isomorphic-unfetch";b();var Ut=e=>e.id,$t=e=>`${e.name} (pid: ${e.id})`;b();function zr({client:e}){async function*t(){let n=(await e.get()).signals;for await(let r of n)yield{id:Ut(r),displayName:$t(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=>k(R(we(e.positional("directory",{describe:"Directory to save the signals to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new We({apiKey:t,apiHost:e,fetch:Sm,projectId:o,limitPolicy:Oe}),c=zr({client:l}),u;if(Ae(n)){let p=Ce(n,!1);u=await be({objects:(d=p.signals)!=null?d:[],selectIdentifier:Ut,selectDisplayName:$t,onSyncComplete:async(y,g)=>{p.signals=g,dt(n,p)}})}else u=await xe({directory:n,selectIdentifier:Ut,selectDisplayName:$t,format:r});await ue({source:c,target:u,mode:i,whatIf:s,log:de({diffMode:a})})}};b();import jm from"isomorphic-unfetch";var Jl={command:"push <directory>",describe:"Pushes all signals from files in a directory or package to Uniform",builder:e=>k(R(we(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 f;let a=new We({apiKey:t,apiHost:e,fetch:jm,projectId:s,limitPolicy:Oe}),l;if(Ae(n)){let d=Ce(n,!0);l=await be({objects:(f=d.signals)!=null?f:[],selectIdentifier:Ut,selectDisplayName:$t})}else l=await xe({directory:n,selectIdentifier:Ut,selectDisplayName:$t});let u=zr({client:a});await ue({source:l,target:u,mode:r,whatIf:i,log:de({diffMode:o})})}};b();import Pm from"isomorphic-unfetch";var Xl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a signal",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Signal public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new We({apiKey:t,apiHost:e,fetch:Pm,projectId:r}).remove({signalId:n})}};b();import Im from"isomorphic-unfetch";var Zl={command:"update <filename>",aliases:["put"],describe:"Insert or update a signal",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Signal file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new We({apiKey:t,apiHost:e,fetch:Im,projectId:r}),s=ut(n);await i.upsert({signal:s})}};var ec={command:"signal <command>",aliases:["sig"],describe:"Commands for Context signals",builder:e=>e.command(Ql).command(Jl).command(Vl).command(Xl).command(Kl).command(Zl).demandCommand(),handler:()=>{He.help()}};b();b();import Mm from"isomorphic-unfetch";b();var Fn,tr=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(ae(tr,Fn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(ae(tr,Fn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ae(tr,Fn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Be=tr;Fn=new WeakMap,Ve(Be,Fn,"/api/v2/test");var tc={command:"get <id>",describe:"Fetch a test",builder:e=>ye(k(R(e.positional("id",{demandOption:!0,describe:"Test public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new Be({apiKey:t,apiHost:e,fetch:Mm,projectId:i}).get({testId:n});a.tests.length===0?(console.error("Test did not exist"),process.exit(1)):fe(a.tests[0],r,s)}};b();import Fm from"isomorphic-unfetch";var nc={command:"list",describe:"List tests",aliases:["ls"],builder:e=>ye(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Be({apiKey:t,apiHost:e,fetch:Fm,projectId:i}).get();fe(o.tests,n,r)}};b();import Tm from"isomorphic-unfetch";b();var Wt=e=>e.id,Bt=e=>`${e.name} (pid: ${e.id})`;b();function Vr({client:e}){async function*t(){let n=(await e.get()).tests;for await(let r of n)yield{id:Wt(r),displayName:Bt(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 rc={command:"pull <directory>",describe:"Pulls all tests to local files in a directory",builder:e=>k(R(we(e.positional("directory",{describe:"Directory to save the tests to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new Be({apiKey:t,apiHost:e,fetch:Tm,projectId:o,limitPolicy:Oe}),c=Vr({client:l}),u;if(Ae(n)){let p=Ce(n,!1);u=await be({objects:(d=p.tests)!=null?d:[],selectIdentifier:Wt,selectDisplayName:Bt,onSyncComplete:async(y,g)=>{p.tests=g,dt(n,p)}})}else u=await xe({directory:n,selectIdentifier:Wt,selectDisplayName:Bt,format:r});await ue({source:c,target:u,mode:i,whatIf:s,log:de({diffMode:a})})}};b();import Lm from"isomorphic-unfetch";var ic={command:"push <directory>",describe:"Pushes all tests from files in a directory or package to Uniform",builder:e=>k(R(we(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 f;let a=new Be({apiKey:t,apiHost:e,fetch:Lm,projectId:s,limitPolicy:Oe}),l;if(Ae(n)){let d=Ce(n,!0);l=await be({objects:(f=d.tests)!=null?f:[],selectIdentifier:Wt,selectDisplayName:Bt})}else l=await xe({directory:n,selectIdentifier:Wt,selectDisplayName:Bt});let u=Vr({client:a});await ue({source:l,target:u,mode:r,whatIf:i,log:de({diffMode:o})})}};b();import Dm from"isomorphic-unfetch";var oc={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a test",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Test public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Be({apiKey:t,apiHost:e,fetch:Dm,projectId:r}).remove({testId:n})}};b();import Nm from"isomorphic-unfetch";var sc={command:"update <filename>",aliases:["put"],describe:"Insert or update a test",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Test file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new Be({apiKey:t,apiHost:e,fetch:Nm,projectId:r}),s=ut(n);await i.upsert({test:s})}};var ac={command:"test <command>",describe:"Commands for Context A/B tests",builder:e=>e.command(rc).command(ic).command(tc).command(oc).command(nc).command(sc).demandCommand(),handler:()=>{He.help()}};var jx={commands:[{command:"context <command>",aliases:["ctx"],describe:"Uniform Context commands",builder:e=>e.command($l).command(ec).command(ol).command(Xa).command(zl).command(ac).demandCommand(),handler:()=>{He.showHelp()}}]};export{Ce as readContextPackage,jx as uniformCLI,dt as writeContextPackage};
108
+ `+a.map(f=>f.added?On.default.green(f.value):f.removed?On.default.red(f.value):f.value).join("")),console.log(`${n!=null?n:""}${o?On.default.gray("[WHATIF]"):""}${l}${r!=null?r:""} ${s}${c}`)}}b();b();b();var qa=async e=>await e(),Mt=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,Mt.prototype)}};var Ne=class{constructor(t){po(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:qa}}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 Mt(o,(s=n==null?void 0:n.method)!=null?s:"GET",t.toString(),i.status,i.statusText,Ne.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 vn,Vn=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(le(Vn,vn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(le(Vn,vn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(le(Vn,vn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Ue=Vn;vn=new WeakMap,Ve(Ue,vn,"/api/v2/aggregate");var Ya={command:"get <id>",describe:"Fetch an aggregate",builder:e=>ye(k(R(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new Ue({apiKey:t,apiHost:e,fetch:Lh,projectId:i}).get({aggregateId:n});a.aggregates.length===0?(console.error("Aggregate did not exist"),process.exit(1)):fe(a.aggregates[0],r,s)}};b();import Dh from"isomorphic-unfetch";var za={command:"list",describe:"List aggregates",aliases:["ls"],builder:e=>ye(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Ue({apiKey:t,apiHost:e,fetch:Dh,projectId:i}).get({});fe(o.aggregates,n,r)}};b();import kh from"isomorphic-unfetch";b();var Ft=e=>e.id,Tt=e=>`${e.name} (pid: ${e.id})`;b();function Ce(e,t){return Ba(e,t)}function dt(e,t){Ha(e,t)}b();import Nh from"p-limit";var Oe=Nh(8);b();function kr({client:e,type:t}){async function*n(){let i=(await e.get({type:t})).aggregates;for await(let s of i)yield{id:Ft(s),displayName:Tt(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 Va={command:"pull <directory>",describe:"Pulls all aggregates to local files in a directory",builder:e=>k(R(we(e.positional("directory",{describe:"Directory to save the aggregates to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new Ue({apiKey:t,apiHost:e,fetch:kh,projectId:o,limitPolicy:Oe}),c=kr({client:l}),f;if(Ae(n)){let p=Ce(n,!1);f=await be({objects:(d=p.aggregates)!=null?d:[],selectIdentifier:Ft,selectDisplayName:Tt,onSyncComplete:async(y,g)=>{p.aggregates=g,dt(n,p)}})}else f=await xe({directory:n,selectIdentifier:Ft,selectDisplayName:Tt,format:r});await ue({source:c,target:f,mode:i,whatIf:s,log:de({diffMode:a})})}};b();import Rh from"isomorphic-unfetch";var Ka={command:"push <directory>",describe:"Pushes all aggregates from files in a directory or package to Uniform",builder:e=>k(R(we(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 Ue({apiKey:t,apiHost:e,fetch:Rh,projectId:s,limitPolicy:Oe}),l;if(Ae(n)){let d=Ce(n,!0);l=await be({objects:(u=d.aggregates)!=null?u:[],selectIdentifier:Ft,selectDisplayName:Tt})}else l=await xe({directory:n,selectIdentifier:Ft,selectDisplayName:Tt});let f=kr({client:a});await ue({source:l,target:f,mode:r,whatIf:i,log:de({diffMode:o})}),await f.complete()}};b();import Uh from"isomorphic-unfetch";var Qa={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an aggregate",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Ue({apiKey:t,apiHost:e,fetch:Uh,projectId:r}).remove({aggregateId:n})}};b();import $h from"isomorphic-unfetch";var Ja={command:"update <filename>",aliases:["put"],describe:"Insert or update an aggregate",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Aggregate file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new Ue({apiKey:t,apiHost:e,fetch:$h,projectId:r}),s=ut(n);await i.upsert({aggregate:s})}};var Xa={command:"aggregate <command>",aliases:["agg","intent","audience"],describe:"Commands for Context aggregates (intents, audiences)",builder:e=>e.command(Va).command(Ka).command(Ya).command(Qa).command(za).command(Ja).demandCommand(),handler:()=>{He.help()}};b();b();import Wh from"isomorphic-unfetch";b();var En,Kn,ln=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(le(ln,En),{...t,projectId:n});return await this.apiClient(r)}async upsertCategory(t){let n=this.createUrl(le(ln,En));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(t){let n=this.createUrl(le(ln,En));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(t){let n=this.createUrl(le(ln,Kn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(t){let n=this.createUrl(le(ln,Kn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Ye=ln;En=new WeakMap,Kn=new WeakMap,Ve(Ye,En,"/api/v1/enrichments"),Ve(Ye,Kn,"/api/v1/enrichment-values");var Za={command:"get <id>",describe:"Fetch an enrichment category and its values",builder:e=>ye(k(R(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{var l,c;let a=(c=(l=await new Ye({apiKey:t,apiHost:e,fetch:Wh,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)):fe(a[0],r,s)}};b();import Bh from"isomorphic-unfetch";var el={command:"list",describe:"List enrichments",aliases:["ls"],builder:e=>ye(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Ye({apiKey:t,apiHost:e,fetch:Bh,projectId:i}).get();fe(o.enrichments,n,r)}};b();import Hh from"isomorphic-unfetch";b();var Lt=e=>e.id,Dt=e=>`${e.name} (pid: ${e.id})`;b();function Rr({client:e}){async function*t(){let n=(await e.get()).enrichments;for await(let r of n)yield{id:Lt(r),displayName:Dt(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=tl({categoryId:n.id,values:n.object.values}),s=tl({categoryId:n.id,values:(a=(o=r==null?void 0:r.object)==null?void 0:o.values)!=null?a:[],client:e});await ue({source:i,target:s,mode:"mirror",whatIf:!1,log:de({diffMode:"off",prefix:` ${n.displayName} value`,indent:"> "})})}}}var tl=({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 nl={command:"pull <directory>",describe:"Pulls all enrichments to local files in a directory",builder:e=>k(R(we(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 Ye({apiKey:t,apiHost:e,fetch:Hh,projectId:o,limitPolicy:Oe}),c=Rr({client:l}),f;if(Ae(n)){let p=Ce(n,!1);f=await be({objects:(d=p.enrichments)!=null?d:[],selectIdentifier:Lt,selectDisplayName:Dt,onSyncComplete:async(y,g)=>{p.enrichments=g,dt(n,p)}})}else f=await xe({directory:n,selectIdentifier:Lt,selectDisplayName:Dt,format:r});await ue({source:c,target:f,mode:i,whatIf:s,log:de({diffMode:a})})}};b();import Gh from"isomorphic-unfetch";var rl={command:"push <directory>",describe:"Pushes all enrichments from files in a directory or package to Uniform",builder:e=>k(R(we(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 Ye({apiKey:t,apiHost:e,fetch:Gh,projectId:s,limitPolicy:Oe}),l;if(Ae(n)){let d=Ce(n,!0);l=await be({objects:(u=d.enrichments)!=null?u:[],selectIdentifier:Lt,selectDisplayName:Dt})}else l=await xe({directory:n,selectIdentifier:Lt,selectDisplayName:Dt});let f=Rr({client:a});await ue({source:l,target:f,mode:r,whatIf:i,log:de({diffMode:o})})}};b();import qh from"isomorphic-unfetch";var il={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an enrichment category and its values",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Ye({apiKey:t,apiHost:e,fetch:qh,projectId:r}).removeCategory({enrichmentId:n})}};var ol={command:"enrichment <command>",aliases:["enr"],describe:"Commands for Context enrichments",builder:e=>e.command(nl).command(rl).command(Za).command(il).command(el).demandCommand(),handler:()=>{He.help()}};b();b();var Zn=uo(Rl());import{writeFile as gm}from"fs";import bm from"isomorphic-unfetch";import{exit as co}from"process";b();var qr,lo=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(le(lo,qr),{...t,projectId:n});return await this.apiClient(r)}},Xn=lo;qr=new WeakMap,Ve(Xn,qr,"/api/v2/manifest");var Ul={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(Zn.default.red("You must specify the project ID")),co(1));let i=ym(),s=new Xn({apiHost:i,projectId:n,apiKey:e,fetch:bm});try{let o=await s.get({preview:r}),a=JSON.stringify(o,null,2);t?gm(t,a,l=>{l&&(console.error(`Error writing file to ${t}
110
+ `,l),co(1)),console.log(Zn.default.green(`\u2705 ${t} has been updated from ${i}`))}):console.log(a)}catch(o){let a;o instanceof Mt?(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(Zn.default.red("\u26A0 Error fetching Context manifest")),console.error(Zn.default.gray(` \u2757 ${a}`)),co(1)}}},ym=()=>process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app";var $l={command:"manifest <command>",describe:"Commands for context manifests",aliases:["man"],builder:e=>e.command(Ul).demandCommand(),handler:()=>{He.help()}};b();b();import wm from"isomorphic-unfetch";b();var In,er=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(le(er,In),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(le(er,In));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(le(er,In));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},$e=er;In=new WeakMap,Ve($e,In,"/api/v2/quirk");var Wl={command:"get <id>",describe:"Fetch a quirk",builder:e=>ye(k(R(e.positional("id",{demandOption:!0,describe:"Quirk public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new $e({apiKey:t,apiHost:e,fetch:wm,projectId:i}).get({quirkId:n,withIntegrations:!0});a.quirks.length===0?(console.error("Quirk did not exist"),process.exit(1)):fe(a.quirks[0],r,s)}};b();import Am from"isomorphic-unfetch";var Bl={command:"list",describe:"List quirks",aliases:["ls"],builder:e=>ye(k(R(e.option("withIntegrations",{alias:["i"],describe:"Whether to include meta-quirks created by integrations in the list. Defaults to false.",type:"boolean"})))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i,withIntegrations:s})=>{let a=await new $e({apiKey:t,apiHost:e,fetch:Am,projectId:i}).get({withIntegrations:s});fe(a.quirks,n,r)}};b();import xm from"isomorphic-unfetch";b();var kt=e=>e.id,Rt=e=>`${e.name} (pid: ${e.id})`;b();function Yr({client:e}){async function*t(){let n=(await e.get({withIntegrations:!1})).quirks;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({quirkId:n})},writeObject:async n=>{await e.upsert({quirk:n.object})}}}var Hl={command:"pull <directory>",describe:"Pulls all quirks to local files in a directory",builder:e=>k(R(we(e.positional("directory",{describe:"Directory to save the quirks to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new $e({apiKey:t,apiHost:e,fetch:xm,projectId:o,limitPolicy:Oe}),c=Yr({client:l}),f;if(Ae(n)){let p=Ce(n,!1);f=await be({objects:(d=p.quirks)!=null?d:[],selectIdentifier:kt,selectDisplayName:Rt,onSyncComplete:async(y,g)=>{p.quirks=g,dt(n,p)}})}else f=await xe({directory:n,selectIdentifier:kt,selectDisplayName:Rt,format:r});await ue({source:c,target:f,mode:i,whatIf:s,log:de({diffMode:a})})}};b();import Cm from"isomorphic-unfetch";var Gl={command:"push <directory>",describe:"Pushes all quirks from files in a directory or package to Uniform",builder:e=>k(R(we(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 $e({apiKey:t,apiHost:e,fetch:Cm,projectId:s,limitPolicy:Oe}),l;if(Ae(n)){let d=Ce(n,!0);l=await be({objects:(u=d.quirks)!=null?u:[],selectIdentifier:kt,selectDisplayName:Rt})}else l=await xe({directory:n,selectIdentifier:kt,selectDisplayName:Rt});let f=Yr({client:a});await ue({source:l,target:f,mode:r,whatIf:i,log:de({diffMode:o})})}};b();import Om from"isomorphic-unfetch";var ql={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a quirk",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Quirk public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new $e({apiKey:t,apiHost:e,fetch:Om,projectId:r}).remove({quirkId:n})}};b();import vm from"isomorphic-unfetch";var Yl={command:"update <filename>",aliases:["put"],describe:"Insert or update a quirk",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Quirk file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new $e({apiKey:t,apiHost:e,fetch:vm,projectId:r}),s=ut(n);await i.upsert({quirk:s})}};var zl={command:"quirk <command>",aliases:["qk"],describe:"Commands for Context quirks",builder:e=>e.command(Hl).command(Gl).command(Wl).command(ql).command(Bl).command(Yl).demandCommand(),handler:()=>{He.help()}};b();b();import Em from"isomorphic-unfetch";b();var Mn,tr=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(le(tr,Mn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(le(tr,Mn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(le(tr,Mn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},We=tr;Mn=new WeakMap,Ve(We,Mn,"/api/v2/signal");var Vl={command:"get <id>",describe:"Fetch a signal",builder:e=>ye(k(R(e.positional("id",{demandOption:!0,describe:"Signal public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new We({apiKey:t,apiHost:e,fetch:Em,projectId:i}).get({signalId:n});a.signals.length===0?(console.error("Signal did not exist"),process.exit(1)):fe(a.signals[0],r,s)}};b();import _m from"isomorphic-unfetch";var Kl={command:"list",describe:"List signals",aliases:["ls"],builder:e=>ye(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new We({apiKey:t,apiHost:e,fetch:_m,projectId:i}).get();fe(o.signals,n,r)}};b();import Sm from"isomorphic-unfetch";b();var Ut=e=>e.id,$t=e=>`${e.name} (pid: ${e.id})`;b();function zr({client:e}){async function*t(){let n=(await e.get()).signals;for await(let r of n)yield{id:Ut(r),displayName:$t(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=>k(R(we(e.positional("directory",{describe:"Directory to save the signals to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new We({apiKey:t,apiHost:e,fetch:Sm,projectId:o,limitPolicy:Oe}),c=zr({client:l}),f;if(Ae(n)){let p=Ce(n,!1);f=await be({objects:(d=p.signals)!=null?d:[],selectIdentifier:Ut,selectDisplayName:$t,onSyncComplete:async(y,g)=>{p.signals=g,dt(n,p)}})}else f=await xe({directory:n,selectIdentifier:Ut,selectDisplayName:$t,format:r});await ue({source:c,target:f,mode:i,whatIf:s,log:de({diffMode:a})})}};b();import jm from"isomorphic-unfetch";var Jl={command:"push <directory>",describe:"Pushes all signals from files in a directory or package to Uniform",builder:e=>k(R(we(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 We({apiKey:t,apiHost:e,fetch:jm,projectId:s,limitPolicy:Oe}),l;if(Ae(n)){let d=Ce(n,!0);l=await be({objects:(u=d.signals)!=null?u:[],selectIdentifier:Ut,selectDisplayName:$t})}else l=await xe({directory:n,selectIdentifier:Ut,selectDisplayName:$t});let f=zr({client:a});await ue({source:l,target:f,mode:r,whatIf:i,log:de({diffMode:o})})}};b();import Pm from"isomorphic-unfetch";var Xl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a signal",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Signal public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new We({apiKey:t,apiHost:e,fetch:Pm,projectId:r}).remove({signalId:n})}};b();import Im from"isomorphic-unfetch";var Zl={command:"update <filename>",aliases:["put"],describe:"Insert or update a signal",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Signal file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new We({apiKey:t,apiHost:e,fetch:Im,projectId:r}),s=ut(n);await i.upsert({signal:s})}};var ec={command:"signal <command>",aliases:["sig"],describe:"Commands for Context signals",builder:e=>e.command(Ql).command(Jl).command(Vl).command(Xl).command(Kl).command(Zl).demandCommand(),handler:()=>{He.help()}};b();b();import Mm from"isomorphic-unfetch";b();var Fn,nr=class extends Ne{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,r=this.createUrl(le(nr,Fn),{...t,projectId:n});return await this.apiClient(r)}async upsert(t){let n=this.createUrl(le(nr,Fn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(le(nr,Fn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Be=nr;Fn=new WeakMap,Ve(Be,Fn,"/api/v2/test");var tc={command:"get <id>",describe:"Fetch a test",builder:e=>ye(k(R(e.positional("id",{demandOption:!0,describe:"Test public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:r,project:i,filename:s})=>{let a=await new Be({apiKey:t,apiHost:e,fetch:Mm,projectId:i}).get({testId:n});a.tests.length===0?(console.error("Test did not exist"),process.exit(1)):fe(a.tests[0],r,s)}};b();import Fm from"isomorphic-unfetch";var nc={command:"list",describe:"List tests",aliases:["ls"],builder:e=>ye(k(R(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:r,project:i})=>{let o=await new Be({apiKey:t,apiHost:e,fetch:Fm,projectId:i}).get();fe(o.tests,n,r)}};b();import Tm from"isomorphic-unfetch";b();var Wt=e=>e.id,Bt=e=>`${e.name} (pid: ${e.id})`;b();function Vr({client:e}){async function*t(){let n=(await e.get()).tests;for await(let r of n)yield{id:Wt(r),displayName:Bt(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 rc={command:"pull <directory>",describe:"Pulls all tests to local files in a directory",builder:e=>k(R(we(e.positional("directory",{describe:"Directory to save the tests to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:r,mode:i,whatIf:s,project:o,diff:a})=>{var d;let l=new Be({apiKey:t,apiHost:e,fetch:Tm,projectId:o,limitPolicy:Oe}),c=Vr({client:l}),f;if(Ae(n)){let p=Ce(n,!1);f=await be({objects:(d=p.tests)!=null?d:[],selectIdentifier:Wt,selectDisplayName:Bt,onSyncComplete:async(y,g)=>{p.tests=g,dt(n,p)}})}else f=await xe({directory:n,selectIdentifier:Wt,selectDisplayName:Bt,format:r});await ue({source:c,target:f,mode:i,whatIf:s,log:de({diffMode:a})})}};b();import Lm from"isomorphic-unfetch";var ic={command:"push <directory>",describe:"Pushes all tests from files in a directory or package to Uniform",builder:e=>k(R(we(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 Be({apiKey:t,apiHost:e,fetch:Lm,projectId:s,limitPolicy:Oe}),l;if(Ae(n)){let d=Ce(n,!0);l=await be({objects:(u=d.tests)!=null?u:[],selectIdentifier:Wt,selectDisplayName:Bt})}else l=await xe({directory:n,selectIdentifier:Wt,selectDisplayName:Bt});let f=Vr({client:a});await ue({source:l,target:f,mode:r,whatIf:i,log:de({diffMode:o})})}};b();import Dm from"isomorphic-unfetch";var oc={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a test",builder:e=>k(R(e.positional("id",{demandOption:!0,describe:"Test public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:r})=>{await new Be({apiKey:t,apiHost:e,fetch:Dm,projectId:r}).remove({testId:n})}};b();import Nm from"isomorphic-unfetch";var sc={command:"update <filename>",aliases:["put"],describe:"Insert or update a test",builder:e=>k(R(e.positional("filename",{demandOption:!0,describe:"Test file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:r})=>{let i=new Be({apiKey:t,apiHost:e,fetch:Nm,projectId:r}),s=ut(n);await i.upsert({test:s})}};var ac={command:"test <command>",describe:"Commands for Context A/B tests",builder:e=>e.command(rc).command(ic).command(tc).command(oc).command(nc).command(sc).demandCommand(),handler:()=>{He.help()}};var jx={commands:[{command:"context <command>",aliases:["ctx"],describe:"Uniform Context commands",builder:e=>e.command($l).command(ec).command(ol).command(Xa).command(zl).command(ac).demandCommand(),handler:()=>{He.showHelp()}}]};export{Ce as readContextPackage,jx as uniformCLI,dt 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