@uniformdev/context 12.2.1-alpha.183 → 12.2.1-alpha.184

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.js CHANGED
@@ -1,13 +1,13 @@
1
- var wl=Object.create;var xn=Object.defineProperty;var Al=Object.getOwnPropertyDescriptor;var xl=Object.getOwnPropertyNames;var Cl=Object.getPrototypeOf,Ol=Object.prototype.hasOwnProperty;var vl=(e,t,n)=>t in e?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ir=e=>xn(e,"__esModule",{value:!0});var El=(e,t)=>()=>(e&&(t=e(e=0)),t);var _l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Sl=(e,t)=>{for(var n in t)xn(e,n,{get:t[n],enumerable:!0})},Mr=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xl(t))!Ol.call(e,r)&&(n||r!=="default")&&xn(e,r,{get:()=>t[r],enumerable:!(i=Al(t,r))||i.enumerable});return e},K=(e,t)=>Mr(Ir(xn(e!=null?wl(Cl(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Pl=(e=>(t,n)=>e&&e.get(t)||(n=Mr(Ir({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var Fr=(e,t,n)=>(vl(e,typeof t!="symbol"?t+"":t,n),n),jl=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ce=(e,t,n)=>(jl(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 Il,O,g=El(()=>{Il=()=>typeof document=="undefined"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,O=Il()});var la=_l((Dn,gn)=>{g();var Du=200,mr="__lodash_hash_undefined__",Ls=1,pi=2,Ds=9007199254740991,hi="[object Arguments]",gr="[object Array]",Ns="[object Boolean]",Ts="[object Date]",Us="[object Error]",Rs="[object Function]",Nu="[object GeneratorFunction]",mi="[object Map]",$s="[object Number]",hn="[object Object]",Ws="[object Promise]",ks="[object RegExp]",gi="[object Set]",Hs="[object String]",Tu="[object Symbol]",yr="[object WeakMap]",Ys="[object ArrayBuffer]",yi="[object DataView]",Uu="[object Float32Array]",Ru="[object Float64Array]",$u="[object Int8Array]",Wu="[object Int16Array]",ku="[object Int32Array]",Hu="[object Uint8Array]",Yu="[object Uint8ClampedArray]",Gu="[object Uint16Array]",Bu="[object Uint32Array]",qu=/[\\^$.*+?()[\]{}|]/g,zu=/^\[object .+?Constructor\]$/,Vu=/^(?:0|[1-9]\d*)$/,X={};X[Uu]=X[Ru]=X[$u]=X[Wu]=X[ku]=X[Hu]=X[Yu]=X[Gu]=X[Bu]=!0;X[hi]=X[gr]=X[Ys]=X[Ns]=X[yi]=X[Ts]=X[Us]=X[Rs]=X[mi]=X[$s]=X[hn]=X[ks]=X[gi]=X[Hs]=X[yr]=!1;var Gs=typeof global=="object"&&global&&global.Object===Object&&global,Ku=typeof self=="object"&&self&&self.Object===Object&&self,yt=Gs||Ku||Function("return this")(),Bs=typeof Dn=="object"&&Dn&&!Dn.nodeType&&Dn,qs=Bs&&typeof gn=="object"&&gn&&!gn.nodeType&&gn,Qu=qs&&qs.exports===Bs,zs=Qu&&Gs.process,Vs=function(){try{return zs&&zs.binding("util")}catch(e){}}(),Ks=Vs&&Vs.isTypedArray;function Ju(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function Zu(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function Xu(e){return function(t){return e(t)}}function ed(e,t){return e==null?void 0:e[t]}function br(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function td(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function nd(e,t){return function(n){return e(t(n))}}function id(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var rd=Array.prototype,od=Function.prototype,bi=Object.prototype,wr=yt["__core-js_shared__"],Qs=function(){var e=/[^.]+$/.exec(wr&&wr.keys&&wr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Js=od.toString,st=bi.hasOwnProperty,Mn=bi.toString,sd=RegExp("^"+Js.call(st).replace(qu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Zs=yt.Symbol,Xs=yt.Uint8Array,ad=bi.propertyIsEnumerable,ld=rd.splice,cd=nd(Object.keys,Object),Ar=mn(yt,"DataView"),Fn=mn(yt,"Map"),xr=mn(yt,"Promise"),Cr=mn(yt,"Set"),Or=mn(yt,"WeakMap"),Ln=mn(Object,"create"),fd=Qt(Ar),ud=Qt(Fn),dd=Qt(xr),pd=Qt(Cr),hd=Qt(Or),ea=Zs?Zs.prototype:void 0,vr=ea?ea.valueOf:void 0;function Vt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function md(){this.__data__=Ln?Ln(null):{}}function gd(e){return this.has(e)&&delete this.__data__[e]}function yd(e){var t=this.__data__;if(Ln){var n=t[e];return n===mr?void 0:n}return st.call(t,e)?t[e]:void 0}function bd(e){var t=this.__data__;return Ln?t[e]!==void 0:st.call(t,e)}function wd(e,t){var n=this.__data__;return n[e]=Ln&&t===void 0?mr:t,this}Vt.prototype.clear=md;Vt.prototype.delete=gd;Vt.prototype.get=yd;Vt.prototype.has=bd;Vt.prototype.set=wd;function at(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ad(){this.__data__=[]}function xd(e){var t=this.__data__,n=Ai(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():ld.call(t,n,1),!0}function Cd(e){var t=this.__data__,n=Ai(t,e);return n<0?void 0:t[n][1]}function Od(e){return Ai(this.__data__,e)>-1}function vd(e,t){var n=this.__data__,i=Ai(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}at.prototype.clear=Ad;at.prototype.delete=xd;at.prototype.get=Cd;at.prototype.has=Od;at.prototype.set=vd;function Kt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ed(){this.__data__={hash:new Vt,map:new(Fn||at),string:new Vt}}function _d(e){return xi(this,e).delete(e)}function Sd(e){return xi(this,e).get(e)}function Pd(e){return xi(this,e).has(e)}function jd(e,t){return xi(this,e).set(e,t),this}Kt.prototype.clear=Ed;Kt.prototype.delete=_d;Kt.prototype.get=Sd;Kt.prototype.has=Pd;Kt.prototype.set=jd;function wi(e){var t=-1,n=e?e.length:0;for(this.__data__=new Kt;++t<n;)this.add(e[t])}function Id(e){return this.__data__.set(e,mr),this}function Md(e){return this.__data__.has(e)}wi.prototype.add=wi.prototype.push=Id;wi.prototype.has=Md;function bt(e){this.__data__=new at(e)}function Fd(){this.__data__=new at}function Ld(e){return this.__data__.delete(e)}function Dd(e){return this.__data__.get(e)}function Nd(e){return this.__data__.has(e)}function Td(e,t){var n=this.__data__;if(n instanceof at){var i=n.__data__;if(!Fn||i.length<Du-1)return i.push([e,t]),this;n=this.__data__=new Kt(i)}return n.set(e,t),this}bt.prototype.clear=Fd;bt.prototype.delete=Ld;bt.prototype.get=Dd;bt.prototype.has=Nd;bt.prototype.set=Td;function Ud(e,t){var n=Er(e)||Kd(e)?Zu(e.length,String):[],i=n.length,r=!!i;for(var o in e)(t||st.call(e,o))&&!(r&&(o=="length"||Bd(o,i)))&&n.push(o);return n}function Ai(e,t){for(var n=e.length;n--;)if(ia(e[n][0],t))return n;return-1}function Rd(e){return Mn.call(e)}function ta(e,t,n,i,r){return e===t?!0:e==null||t==null||!_r(e)&&!Sr(t)?e!==e&&t!==t:$d(e,t,ta,n,i,r)}function $d(e,t,n,i,r,o){var s=Er(e),a=Er(t),l=gr,u=gr;s||(l=wt(e),l=l==hi?hn:l),a||(u=wt(t),u=u==hi?hn:u);var d=l==hn&&!br(e),f=u==hn&&!br(t),p=l==u;if(p&&!d)return o||(o=new bt),s||Zd(e)?na(e,t,n,i,r,o):Yd(e,t,l,n,i,r,o);if(!(r&pi)){var y=d&&st.call(e,"__wrapped__"),C=f&&st.call(t,"__wrapped__");if(y||C){var A=y?e.value():e,m=C?t.value():t;return o||(o=new bt),n(A,m,i,r,o)}}return p?(o||(o=new bt),Gd(e,t,n,i,r,o)):!1}function Wd(e){if(!_r(e)||zd(e))return!1;var t=oa(e)||br(e)?sd:zu;return t.test(Qt(e))}function kd(e){return Sr(e)&&sa(e.length)&&!!X[Mn.call(e)]}function Hd(e){if(!Vd(e))return cd(e);var t=[];for(var n in Object(e))st.call(e,n)&&n!="constructor"&&t.push(n);return t}function na(e,t,n,i,r,o){var s=r&pi,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var d=-1,f=!0,p=r&Ls?new wi:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var y=e[d],C=t[d];if(i)var A=s?i(C,y,d,t,e,o):i(y,C,d,e,t,o);if(A!==void 0){if(A)continue;f=!1;break}if(p){if(!Ju(t,function(m,S){if(!p.has(S)&&(y===m||n(y,m,i,r,o)))return p.add(S)})){f=!1;break}}else if(!(y===C||n(y,C,i,r,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function Yd(e,t,n,i,r,o,s){switch(n){case yi:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ys:return!(e.byteLength!=t.byteLength||!i(new Xs(e),new Xs(t)));case Ns:case Ts:case $s:return ia(+e,+t);case Us:return e.name==t.name&&e.message==t.message;case ks:case Hs:return e==t+"";case mi:var a=td;case gi:var l=o&pi;if(a||(a=id),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;o|=Ls,s.set(e,t);var d=na(a(e),a(t),i,r,o,s);return s.delete(e),d;case Tu:if(vr)return vr.call(e)==vr.call(t)}return!1}function Gd(e,t,n,i,r,o){var s=r&pi,a=aa(e),l=a.length,u=aa(t),d=u.length;if(l!=d&&!s)return!1;for(var f=l;f--;){var p=a[f];if(!(s?p in t:st.call(t,p)))return!1}var y=o.get(e);if(y&&o.get(t))return y==t;var C=!0;o.set(e,t),o.set(t,e);for(var A=s;++f<l;){p=a[f];var m=e[p],S=t[p];if(i)var E=s?i(S,m,p,t,e,o):i(m,S,p,e,t,o);if(!(E===void 0?m===S||n(m,S,i,r,o):E)){C=!1;break}A||(A=p=="constructor")}if(C&&!A){var G=e.constructor,B=t.constructor;G!=B&&"constructor"in e&&"constructor"in t&&!(typeof G=="function"&&G instanceof G&&typeof B=="function"&&B instanceof B)&&(C=!1)}return o.delete(e),o.delete(t),C}function xi(e,t){var n=e.__data__;return qd(t)?n[typeof t=="string"?"string":"hash"]:n.map}function mn(e,t){var n=ed(e,t);return Wd(n)?n:void 0}var wt=Rd;(Ar&&wt(new Ar(new ArrayBuffer(1)))!=yi||Fn&&wt(new Fn)!=mi||xr&&wt(xr.resolve())!=Ws||Cr&&wt(new Cr)!=gi||Or&&wt(new Or)!=yr)&&(wt=function(e){var t=Mn.call(e),n=t==hn?e.constructor:void 0,i=n?Qt(n):void 0;if(i)switch(i){case fd:return yi;case ud:return mi;case dd:return Ws;case pd:return gi;case hd:return yr}return t});function Bd(e,t){return t=t==null?Ds:t,!!t&&(typeof e=="number"||Vu.test(e))&&e>-1&&e%1==0&&e<t}function qd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function zd(e){return!!Qs&&Qs in e}function Vd(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||bi;return e===n}function Qt(e){if(e!=null){try{return Js.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function ia(e,t){return e===t||e!==e&&t!==t}function Kd(e){return Qd(e)&&st.call(e,"callee")&&(!ad.call(e,"callee")||Mn.call(e)==hi)}var Er=Array.isArray;function ra(e){return e!=null&&sa(e.length)&&!oa(e)}function Qd(e){return Sr(e)&&ra(e)}function Jd(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?ta(e,t,n):!!i}function oa(e){var t=_r(e)?Mn.call(e):"";return t==Rs||t==Nu}function sa(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ds}function _r(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Sr(e){return!!e&&typeof e=="object"}var Zd=Ks?Xu(Ks):kd;function aa(e){return ra(e)?Ud(e):Hd(e)}gn.exports=Jd});var tp={};Sl(tp,{uniformCLI:()=>ep});g();g();g();var Vn=require("assert");g();g();var Ml={right:Tl,center:Ul},Fl=0,Hn=1,Ll=2,Yn=3,Lr=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(i=>typeof i=="string"?this.colFromString(i):i);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(`
1
+ var wl=Object.create;var xn=Object.defineProperty;var Al=Object.getOwnPropertyDescriptor;var xl=Object.getOwnPropertyNames;var Cl=Object.getPrototypeOf,Ol=Object.prototype.hasOwnProperty;var vl=(e,t,n)=>t in e?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ir=e=>xn(e,"__esModule",{value:!0});var El=(e,t)=>()=>(e&&(t=e(e=0)),t);var _l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Sl=(e,t)=>{for(var n in t)xn(e,n,{get:t[n],enumerable:!0})},Mr=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xl(t))!Ol.call(e,r)&&(n||r!=="default")&&xn(e,r,{get:()=>t[r],enumerable:!(i=Al(t,r))||i.enumerable});return e},K=(e,t)=>Mr(Ir(xn(e!=null?wl(Cl(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Pl=(e=>(t,n)=>e&&e.get(t)||(n=Mr(Ir({}),t,1),e&&e.set(t,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var Fr=(e,t,n)=>(vl(e,typeof t!="symbol"?t+"":t,n),n),jl=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ce=(e,t,n)=>(jl(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 Il,O,g=El(()=>{Il=()=>typeof document=="undefined"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,O=Il()});var la=_l((Mn,mn)=>{g();var Du=200,Er="__lodash_hash_undefined__",Ys=1,bi=2,Gs=9007199254740991,pi="[object Arguments]",yr="[object Array]",Bs="[object Boolean]",qs="[object Date]",zs="[object Error]",Vs="[object Function]",Nu="[object GeneratorFunction]",hi="[object Map]",Ks="[object Number]",hn="[object Object]",Ls="[object Promise]",Qs="[object RegExp]",mi="[object Set]",Js="[object String]",Tu="[object Symbol]",br="[object WeakMap]",Zs="[object ArrayBuffer]",gi="[object DataView]",Uu="[object Float32Array]",Ru="[object Float64Array]",$u="[object Int8Array]",Wu="[object Int16Array]",ku="[object Int32Array]",Hu="[object Uint8Array]",Yu="[object Uint8ClampedArray]",Gu="[object Uint16Array]",Bu="[object Uint32Array]",qu=/[\\^$.*+?()[\]{}|]/g,zu=/^\[object .+?Constructor\]$/,Vu=/^(?:0|[1-9]\d*)$/,X={};X[Uu]=X[Ru]=X[$u]=X[Wu]=X[ku]=X[Hu]=X[Yu]=X[Gu]=X[Bu]=!0;X[pi]=X[yr]=X[Zs]=X[Bs]=X[gi]=X[qs]=X[zs]=X[Vs]=X[hi]=X[Ks]=X[hn]=X[Qs]=X[mi]=X[Js]=X[br]=!1;var Xs=typeof global=="object"&&global&&global.Object===Object&&global,Ku=typeof self=="object"&&self&&self.Object===Object&&self,wt=Xs||Ku||Function("return this")(),ea=typeof Mn=="object"&&Mn&&!Mn.nodeType&&Mn,Ds=ea&&typeof mn=="object"&&mn&&!mn.nodeType&&mn,Qu=Ds&&Ds.exports===ea,Ns=Qu&&Xs.process,Ts=function(){try{return Ns&&Ns.binding("util")}catch(e){}}(),Us=Ts&&Ts.isTypedArray;function Ju(e,t){for(var n=-1,i=e?e.length:0;++n<i;)if(t(e[n],n,e))return!0;return!1}function Zu(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function Xu(e){return function(t){return e(t)}}function ed(e,t){return e==null?void 0:e[t]}function wr(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(n){}return t}function td(e){var t=-1,n=Array(e.size);return e.forEach(function(i,r){n[++t]=[r,i]}),n}function nd(e,t){return function(n){return e(t(n))}}function id(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var rd=Array.prototype,od=Function.prototype,wi=Object.prototype,mr=wt["__core-js_shared__"],Rs=function(){var e=/[^.]+$/.exec(mr&&mr.keys&&mr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ta=od.toString,st=wi.hasOwnProperty,Dn=wi.toString,sd=RegExp("^"+ta.call(st).replace(qu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$s=wt.Symbol,Ws=wt.Uint8Array,ad=wi.propertyIsEnumerable,ld=rd.splice,cd=nd(Object.keys,Object),Ar=gn(wt,"DataView"),Fn=gn(wt,"Map"),xr=gn(wt,"Promise"),Cr=gn(wt,"Set"),Or=gn(wt,"WeakMap"),Ln=gn(Object,"create"),fd=Qt(Ar),ud=Qt(Fn),dd=Qt(xr),pd=Qt(Cr),hd=Qt(Or),ks=$s?$s.prototype:void 0,gr=ks?ks.valueOf:void 0;function Vt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function md(){this.__data__=Ln?Ln(null):{}}function gd(e){return this.has(e)&&delete this.__data__[e]}function yd(e){var t=this.__data__;if(Ln){var n=t[e];return n===Er?void 0:n}return st.call(t,e)?t[e]:void 0}function bd(e){var t=this.__data__;return Ln?t[e]!==void 0:st.call(t,e)}function wd(e,t){var n=this.__data__;return n[e]=Ln&&t===void 0?Er:t,this}Vt.prototype.clear=md;Vt.prototype.delete=gd;Vt.prototype.get=yd;Vt.prototype.has=bd;Vt.prototype.set=wd;function at(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ad(){this.__data__=[]}function xd(e){var t=this.__data__,n=Ai(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():ld.call(t,n,1),!0}function Cd(e){var t=this.__data__,n=Ai(t,e);return n<0?void 0:t[n][1]}function Od(e){return Ai(this.__data__,e)>-1}function vd(e,t){var n=this.__data__,i=Ai(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}at.prototype.clear=Ad;at.prototype.delete=xd;at.prototype.get=Cd;at.prototype.has=Od;at.prototype.set=vd;function Kt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ed(){this.__data__={hash:new Vt,map:new(Fn||at),string:new Vt}}function _d(e){return xi(this,e).delete(e)}function Sd(e){return xi(this,e).get(e)}function Pd(e){return xi(this,e).has(e)}function jd(e,t){return xi(this,e).set(e,t),this}Kt.prototype.clear=Ed;Kt.prototype.delete=_d;Kt.prototype.get=Sd;Kt.prototype.has=Pd;Kt.prototype.set=jd;function yi(e){var t=-1,n=e?e.length:0;for(this.__data__=new Kt;++t<n;)this.add(e[t])}function Id(e){return this.__data__.set(e,Er),this}function Md(e){return this.__data__.has(e)}yi.prototype.add=yi.prototype.push=Id;yi.prototype.has=Md;function bt(e){this.__data__=new at(e)}function Fd(){this.__data__=new at}function Ld(e){return this.__data__.delete(e)}function Dd(e){return this.__data__.get(e)}function Nd(e){return this.__data__.has(e)}function Td(e,t){var n=this.__data__;if(n instanceof at){var i=n.__data__;if(!Fn||i.length<Du-1)return i.push([e,t]),this;n=this.__data__=new Kt(i)}return n.set(e,t),this}bt.prototype.clear=Fd;bt.prototype.delete=Ld;bt.prototype.get=Dd;bt.prototype.has=Nd;bt.prototype.set=Td;function Ud(e,t){var n=vr(e)||Kd(e)?Zu(e.length,String):[],i=n.length,r=!!i;for(var o in e)(t||st.call(e,o))&&!(r&&(o=="length"||Bd(o,i)))&&n.push(o);return n}function Ai(e,t){for(var n=e.length;n--;)if(ra(e[n][0],t))return n;return-1}function Rd(e){return Dn.call(e)}function na(e,t,n,i,r){return e===t?!0:e==null||t==null||!_r(e)&&!Sr(t)?e!==e&&t!==t:$d(e,t,na,n,i,r)}function $d(e,t,n,i,r,o){var s=vr(e),a=vr(t),l=yr,u=yr;s||(l=yt(e),l=l==pi?hn:l),a||(u=yt(t),u=u==pi?hn:u);var d=l==hn&&!wr(e),f=u==hn&&!wr(t),p=l==u;if(p&&!d)return o||(o=new bt),s||Zd(e)?ia(e,t,n,i,r,o):Yd(e,t,l,n,i,r,o);if(!(r&bi)){var y=d&&st.call(e,"__wrapped__"),C=f&&st.call(t,"__wrapped__");if(y||C){var A=y?e.value():e,m=C?t.value():t;return o||(o=new bt),n(A,m,i,r,o)}}return p?(o||(o=new bt),Gd(e,t,n,i,r,o)):!1}function Wd(e){if(!_r(e)||zd(e))return!1;var t=sa(e)||wr(e)?sd:zu;return t.test(Qt(e))}function kd(e){return Sr(e)&&aa(e.length)&&!!X[Dn.call(e)]}function Hd(e){if(!Vd(e))return cd(e);var t=[];for(var n in Object(e))st.call(e,n)&&n!="constructor"&&t.push(n);return t}function ia(e,t,n,i,r,o){var s=r&bi,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var d=-1,f=!0,p=r&Ys?new yi:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var y=e[d],C=t[d];if(i)var A=s?i(C,y,d,t,e,o):i(y,C,d,e,t,o);if(A!==void 0){if(A)continue;f=!1;break}if(p){if(!Ju(t,function(m,S){if(!p.has(S)&&(y===m||n(y,m,i,r,o)))return p.add(S)})){f=!1;break}}else if(!(y===C||n(y,C,i,r,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function Yd(e,t,n,i,r,o,s){switch(n){case gi:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Zs:return!(e.byteLength!=t.byteLength||!i(new Ws(e),new Ws(t)));case Bs:case qs:case Ks:return ra(+e,+t);case zs:return e.name==t.name&&e.message==t.message;case Qs:case Js:return e==t+"";case hi:var a=td;case mi:var l=o&bi;if(a||(a=id),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;o|=Ys,s.set(e,t);var d=ia(a(e),a(t),i,r,o,s);return s.delete(e),d;case Tu:if(gr)return gr.call(e)==gr.call(t)}return!1}function Gd(e,t,n,i,r,o){var s=r&bi,a=Hs(e),l=a.length,u=Hs(t),d=u.length;if(l!=d&&!s)return!1;for(var f=l;f--;){var p=a[f];if(!(s?p in t:st.call(t,p)))return!1}var y=o.get(e);if(y&&o.get(t))return y==t;var C=!0;o.set(e,t),o.set(t,e);for(var A=s;++f<l;){p=a[f];var m=e[p],S=t[p];if(i)var E=s?i(S,m,p,t,e,o):i(m,S,p,e,t,o);if(!(E===void 0?m===S||n(m,S,i,r,o):E)){C=!1;break}A||(A=p=="constructor")}if(C&&!A){var G=e.constructor,B=t.constructor;G!=B&&"constructor"in e&&"constructor"in t&&!(typeof G=="function"&&G instanceof G&&typeof B=="function"&&B instanceof B)&&(C=!1)}return o.delete(e),o.delete(t),C}function xi(e,t){var n=e.__data__;return qd(t)?n[typeof t=="string"?"string":"hash"]:n.map}function gn(e,t){var n=ed(e,t);return Wd(n)?n:void 0}var yt=Rd;(Ar&&yt(new Ar(new ArrayBuffer(1)))!=gi||Fn&&yt(new Fn)!=hi||xr&&yt(xr.resolve())!=Ls||Cr&&yt(new Cr)!=mi||Or&&yt(new Or)!=br)&&(yt=function(e){var t=Dn.call(e),n=t==hn?e.constructor:void 0,i=n?Qt(n):void 0;if(i)switch(i){case fd:return gi;case ud:return hi;case dd:return Ls;case pd:return mi;case hd:return br}return t});function Bd(e,t){return t=t==null?Gs:t,!!t&&(typeof e=="number"||Vu.test(e))&&e>-1&&e%1==0&&e<t}function qd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function zd(e){return!!Rs&&Rs in e}function Vd(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||wi;return e===n}function Qt(e){if(e!=null){try{return ta.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function ra(e,t){return e===t||e!==e&&t!==t}function Kd(e){return Qd(e)&&st.call(e,"callee")&&(!ad.call(e,"callee")||Dn.call(e)==pi)}var vr=Array.isArray;function oa(e){return e!=null&&aa(e.length)&&!sa(e)}function Qd(e){return Sr(e)&&oa(e)}function Jd(e,t,n){n=typeof n=="function"?n:void 0;var i=n?n(e,t):void 0;return i===void 0?na(e,t,n):!!i}function sa(e){var t=_r(e)?Dn.call(e):"";return t==Vs||t==Nu}function aa(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Gs}function _r(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Sr(e){return!!e&&typeof e=="object"}var Zd=Us?Xu(Us):kd;function Hs(e){return oa(e)?Ud(e):Hd(e)}mn.exports=Jd});var tp={};Sl(tp,{uniformCLI:()=>ep});g();g();g();var Kn=require("assert");g();g();var Ml={right:Tl,center:Ul},Fl=0,Hn=1,Ll=2,Yn=3,Dr=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(i=>typeof i=="string"?this.colFromString(i):i);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(`
2
2
  `).map(r=>r.split(" ")),i=0;return n.forEach(r=>{r.length>1&&De.stringWidth(r[0])>i&&(i=Math.min(Math.floor(this.width*.5),De.stringWidth(r[0])))}),n.forEach(r=>{this.div(...r.map((o,s)=>({text:o.trim(),padding:this.measurePadding(o),width:s===0&&r.length>1?i:void 0})))}),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){let n=De.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(`
3
- `)}rowToString(t,n){return this.rasterize(t).forEach((i,r)=>{let o="";i.forEach((s,a)=>{let{width:l}=t[a],u=this.negatePadding(t[a]),d=s;u>De.stringWidth(s)&&(d+=" ".repeat(u-De.stringWidth(s))),t[a].align&&t[a].align!=="left"&&this.wrap&&(d=Ml[t[a].align](d,u),De.stringWidth(d)<u&&(d+=" ".repeat((l||0)-De.stringWidth(d)-1)));let f=t[a].padding||[0,0,0,0];f[Yn]&&(o+=" ".repeat(f[Yn])),o+=Dr(t[a],d,"| "),o+=d,o+=Dr(t[a],d," |"),f[Hn]&&(o+=" ".repeat(f[Hn])),r===0&&n.length>0&&(o=this.renderInline(o,n[n.length-1]))}),n.push({text:o.replace(/ +$/,""),span:t.span})}),n}renderInline(t,n){let i=t.match(/^ */),r=i?i[0].length:0,o=n.text,s=De.stringWidth(o.trimRight());return n.span?this.wrap?r<s?t:(n.hidden=!0,o.trimRight()+" ".repeat(r-s)+t.trimLeft()):(n.hidden=!0,o+t):t}rasterize(t){let n=[],i=this.columnWidths(t),r;return t.forEach((o,s)=>{o.width=i[s],this.wrap?r=De.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
3
+ `)}rowToString(t,n){return this.rasterize(t).forEach((i,r)=>{let o="";i.forEach((s,a)=>{let{width:l}=t[a],u=this.negatePadding(t[a]),d=s;u>De.stringWidth(s)&&(d+=" ".repeat(u-De.stringWidth(s))),t[a].align&&t[a].align!=="left"&&this.wrap&&(d=Ml[t[a].align](d,u),De.stringWidth(d)<u&&(d+=" ".repeat((l||0)-De.stringWidth(d)-1)));let f=t[a].padding||[0,0,0,0];f[Yn]&&(o+=" ".repeat(f[Yn])),o+=Lr(t[a],d,"| "),o+=d,o+=Lr(t[a],d," |"),f[Hn]&&(o+=" ".repeat(f[Hn])),r===0&&n.length>0&&(o=this.renderInline(o,n[n.length-1]))}),n.push({text:o.replace(/ +$/,""),span:t.span})}),n}renderInline(t,n){let i=t.match(/^ */),r=i?i[0].length:0,o=n.text,s=De.stringWidth(o.trimRight());return n.span?this.wrap?r<s?t:(n.hidden=!0,o.trimRight()+" ".repeat(r-s)+t.trimLeft()):(n.hidden=!0,o+t):t}rasterize(t){let n=[],i=this.columnWidths(t),r;return t.forEach((o,s)=>{o.width=i[s],this.wrap?r=De.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
4
4
  `):r=o.text.split(`
5
- `),o.border&&(r.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),r.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(r.unshift(...new Array(o.padding[Fl]||0).fill("")),r.push(...new Array(o.padding[Ll]||0).fill(""))),r.forEach((a,l)=>{n[l]||n.push([]);let u=n[l];for(let d=0;d<s;d++)u[d]===void 0&&u.push("");u.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[Yn]||0)+(t.padding[Hn]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(s=>s.width||De.stringWidth(s.text));let n=t.length,i=this.width,r=t.map(s=>{if(s.width)return n--,i-=s.width,s.width}),o=n?Math.floor(i/n):0;return r.map((s,a)=>s===void 0?Math.max(o,Dl(t[a])):s)}};function Dr(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function Dl(e){let t=e.padding||[],n=1+(t[Yn]||0)+(t[Hn]||0);return e.border?n+4:n}function Nl(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Tl(e,t){e=e.trim();let n=De.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function Ul(e,t){e=e.trim();let n=De.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var De;function Nr(e,t){return De=t,new Lr({width:(e==null?void 0:e.width)||Nl(),wrap:e==null?void 0:e.wrap})}g();var Tr=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Li(e){return e.replace(Tr,"")}function Ur(e,t){let[n,i]=e.match(Tr)||["",""];e=Li(e);let r="";for(let o=0;o<e.length;o++)o!==0&&o%t===0&&(r+=`
6
- `),r+=e.charAt(o);return n&&i&&(r=`${n}${r}${i}`),r}function Di(e){return Nr(e,{stringWidth:t=>[...t].length,stripAnsi:Li,wrap:Ur})}g();var tn=require("path"),Gn=require("fs");function Rr(e,t){let n=(0,tn.resolve)(".",e),i;for((0,Gn.statSync)(n).isDirectory()||(n=(0,tn.dirname)(n));;){if(i=t(n,(0,Gn.readdirSync)(n)),i)return(0,tn.resolve)(n,i);if(n=(0,tn.dirname)(i=n),i===n)break}}var Xr=require("util"),eo=require("fs"),to=require("url");g();var kr=require("util"),zn=require("path");g();function Lt(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let n="",i=!1,r=e.match(/^-+/);for(let o=r?r[0].length:0;o<e.length;o++){let s=e.charAt(o);i&&(i=!1,s=s.toUpperCase()),o!==0&&(s==="-"||s==="_")?i=!0:s!=="-"&&s!=="_"&&(n+=s)}return n}}function Bn(e,t){let n=e.toLowerCase();t=t||"-";let i="";for(let r=0;r<e.length;r++){let o=n.charAt(r),s=e.charAt(r);o!==s&&r>0?i+=`${t}${n.charAt(r)}`:i+=s}return i}function qn(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}g();g();function $r(e){if(Array.isArray(e))return e.map(s=>typeof s!="string"?s+"":s);e=e.trim();let t=0,n=null,i=null,r=null,o=[];for(let s=0;s<e.length;s++){if(n=i,i=e.charAt(s),i===" "&&!r){n!==" "&&t++;continue}i===r?r=null:(i==="'"||i==='"')&&!r&&(r=i),o[t]||(o[t]=""),o[t]+=i}return o}g();var $e;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})($e||($e={}));var it,Ni=class{constructor(t){it=t}parse(t,n){let i=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},n),r=$r(t),o=typeof t=="string",s=Rl(Object.assign(Object.create(null),i.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},i.configuration),l=Object.assign(Object.create(null),i.default),u=i.configObjects||[],d=i.envPrefix,f=a["populate--"],p=f?"--":"_",y=Object.create(null),C=Object.create(null),A=i.__||it.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},S=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,E=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(h){let w=typeof h=="object"?h.key:h,v=Object.keys(h).map(function(x){return{boolean:"bools",string:"strings",number:"numbers"}[x]}).filter(Boolean).pop();v&&(m[v][w]=!0),m.arrays[w]=!0,m.keys.push(w)}),[].concat(i.boolean||[]).filter(Boolean).forEach(function(h){m.bools[h]=!0,m.keys.push(h)}),[].concat(i.string||[]).filter(Boolean).forEach(function(h){m.strings[h]=!0,m.keys.push(h)}),[].concat(i.number||[]).filter(Boolean).forEach(function(h){m.numbers[h]=!0,m.keys.push(h)}),[].concat(i.count||[]).filter(Boolean).forEach(function(h){m.counts[h]=!0,m.keys.push(h)}),[].concat(i.normalize||[]).filter(Boolean).forEach(function(h){m.normalize[h]=!0,m.keys.push(h)}),typeof i.narg=="object"&&Object.entries(i.narg).forEach(([h,w])=>{typeof w=="number"&&(m.nargs[h]=w,m.keys.push(h))}),typeof i.coerce=="object"&&Object.entries(i.coerce).forEach(([h,w])=>{typeof w=="function"&&(m.coercions[h]=w,m.keys.push(h))}),typeof i.config!="undefined"&&(Array.isArray(i.config)||typeof i.config=="string"?[].concat(i.config).filter(Boolean).forEach(function(h){m.configs[h]=!0}):typeof i.config=="object"&&Object.entries(i.config).forEach(([h,w])=>{(typeof w=="boolean"||typeof w=="function")&&(m.configs[h]=w)})),Ft(i.key,s,i.default,m.arrays),Object.keys(l).forEach(function(h){(m.aliases[h]||[]).forEach(function(w){l[w]=l[h]})});let G=null;kn();let B=[],V=Object.assign(Object.create(null),{_:[]}),lt={};for(let h=0;h<r.length;h++){let w=r[h],v=w.replace(/^-{3,}/,"---"),x,b,F,P,D,pe;if(w!=="--"&&ie(w))Be(w);else if(v.match(/---+(=|$)/)){Be(w);continue}else if(w.match(/^--.+=/)||!a["short-option-groups"]&&w.match(/^-.+=/))P=w.match(/^--?([^=]+)=([\s\S]*)$/),P!==null&&Array.isArray(P)&&P.length>=3&&(R(P[1],m.arrays)?h=It(h,P[1],r,P[2]):R(P[1],m.nargs)!==!1?h=en(h,P[1],r,P[2]):Q(P[1],P[2],!0));else if(w.match(E)&&a["boolean-negation"])P=w.match(E),P!==null&&Array.isArray(P)&&P.length>=2&&(b=P[1],Q(b,R(b,m.arrays)?[!1]:!1));else if(w.match(/^--.+/)||!a["short-option-groups"]&&w.match(/^-[^-]+/))P=w.match(/^--?(.+)/),P!==null&&Array.isArray(P)&&P.length>=2&&(b=P[1],R(b,m.arrays)?h=It(h,b,r):R(b,m.nargs)!==!1?h=en(h,b,r):(D=r[h+1],D!==void 0&&(!D.match(/^-/)||D.match(S))&&!R(b,m.bools)&&!R(b,m.counts)||/^(true|false)$/.test(D)?(Q(b,D),h++):Q(b,re(b))));else if(w.match(/^-.\..+=/))P=w.match(/^-([^=]+)=([\s\S]*)$/),P!==null&&Array.isArray(P)&&P.length>=3&&Q(P[1],P[2]);else if(w.match(/^-.\..+/)&&!w.match(S))D=r[h+1],P=w.match(/^-(.\..+)/),P!==null&&Array.isArray(P)&&P.length>=2&&(b=P[1],D!==void 0&&!D.match(/^-/)&&!R(b,m.bools)&&!R(b,m.counts)?(Q(b,D),h++):Q(b,re(b)));else if(w.match(/^-[^-]+/)&&!w.match(S)){F=w.slice(1,-1).split(""),x=!1;for(let Se=0;Se<F.length;Se++){if(D=w.slice(Se+2),F[Se+1]&&F[Se+1]==="="){pe=w.slice(Se+3),b=F[Se],R(b,m.arrays)?h=It(h,b,r,pe):R(b,m.nargs)!==!1?h=en(h,b,r,pe):Q(b,pe),x=!0;break}if(D==="-"){Q(F[Se],D);continue}if(/[A-Za-z]/.test(F[Se])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(D)&&R(D,m.bools)===!1){Q(F[Se],D),x=!0;break}if(F[Se+1]&&F[Se+1].match(/\W/)){Q(F[Se],D),x=!0;break}else Q(F[Se],re(F[Se]))}b=w.slice(-1)[0],!x&&b!=="-"&&(R(b,m.arrays)?h=It(h,b,r):R(b,m.nargs)!==!1?h=en(h,b,r):(D=r[h+1],D!==void 0&&(!/^(-|--)[^-]/.test(D)||D.match(S))&&!R(b,m.bools)&&!R(b,m.counts)||/^(true|false)$/.test(D)?(Q(b,D),h++):Q(b,re(b))))}else if(w.match(/^-[0-9]$/)&&w.match(S)&&R(w.slice(1),m.bools))b=w.slice(1),Q(b,re(b));else if(w==="--"){B=r.slice(h+1);break}else if(a["halt-at-non-option"]){B=r.slice(h);break}else Be(w)}z(V,!0),z(V,!1),H(V),se(),ne(V,m.aliases,l,!0),ue(V),a["set-placeholder-key"]&&Mt(V),Object.keys(m.counts).forEach(function(h){tt(V,h.split("."))||Q(h,0)}),f&&B.length&&(V[p]=[]),B.forEach(function(h){V[p].push(h)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(V).filter(h=>h!=="--"&&h.includes("-")).forEach(h=>{delete V[h]}),a["strip-aliased"]&&[].concat(...Object.keys(s).map(h=>s[h])).forEach(h=>{a["camel-case-expansion"]&&h.includes("-")&&delete V[h.split(".").map(w=>Lt(w)).join(".")],delete V[h]});function Be(h){let w=T("_",h);(typeof w=="string"||typeof w=="number")&&V._.push(w)}function en(h,w,v,x){let b,F=R(w,m.nargs);if(F=typeof F!="number"||isNaN(F)?1:F,F===0)return ze(x)||(G=Error(A("Argument unexpected for: %s",w))),Q(w,re(w)),h;let P=ze(x)?0:1;if(a["nargs-eats-options"])v.length-(h+1)+P<F&&(G=Error(A("Not enough arguments following: %s",w))),P=F;else{for(b=h+1;b<v.length&&(!v[b].match(/^-[^0-9]/)||v[b].match(S)||ie(v[b]));b++)P++;P<F&&(G=Error(A("Not enough arguments following: %s",w)))}let D=Math.min(P,F);for(!ze(x)&&D>0&&(Q(w,x),D--),b=h+1;b<D+h+1;b++)Q(w,v[b]);return h+D}function It(h,w,v,x){let b=[],F=x||v[h+1],P=R(w,m.nargs);if(R(w,m.bools)&&!/^(true|false)$/.test(F))b.push(!0);else if(ze(F)||ze(x)&&/^-/.test(F)&&!S.test(F)&&!ie(F)){if(l[w]!==void 0){let D=l[w];b=Array.isArray(D)?D:[D]}}else{ze(x)||b.push(_(w,x,!0));for(let D=h+1;D<v.length&&!(!a["greedy-arrays"]&&b.length>0||P&&typeof P=="number"&&b.length>=P||(F=v[D],/^-/.test(F)&&!S.test(F)&&!ie(F)));D++)h=D,b.push(_(w,F,o))}return typeof P=="number"&&(P&&b.length<P||isNaN(P)&&b.length===0)&&(G=Error(A("Not enough arguments following: %s",w))),Q(w,b),h}function Q(h,w,v=o){if(/-/.test(h)&&a["camel-case-expansion"]){let F=h.split(".").map(function(P){return Lt(P)}).join(".");M(h,F)}let x=_(h,w,v),b=h.split(".");nt(V,b,x),m.aliases[h]&&m.aliases[h].forEach(function(F){let P=F.split(".");nt(V,P,x)}),b.length>1&&a["dot-notation"]&&(m.aliases[b[0]]||[]).forEach(function(F){let P=F.split("."),D=[].concat(b);D.shift(),P=P.concat(D),(m.aliases[h]||[]).includes(P.join("."))||nt(V,P,x)}),R(h,m.normalize)&&!R(h,m.arrays)&&[h].concat(m.aliases[h]||[]).forEach(function(P){Object.defineProperty(lt,P,{enumerable:!0,get(){return w},set(D){w=typeof D=="string"?it.normalize(D):D}})})}function M(h,w){m.aliases[h]&&m.aliases[h].length||(m.aliases[h]=[w],y[w]=!0),m.aliases[w]&&m.aliases[w].length||M(w,h)}function _(h,w,v){v&&(w=$l(w)),(R(h,m.bools)||R(h,m.counts))&&typeof w=="string"&&(w=w==="true");let x=Array.isArray(w)?w.map(function(b){return T(h,b)}):T(h,w);return R(h,m.counts)&&(ze(x)||typeof x=="boolean")&&(x=Ti()),R(h,m.normalize)&&R(h,m.arrays)&&(Array.isArray(w)?x=w.map(b=>it.normalize(b)):x=it.normalize(w)),x}function T(h,w){return!a["parse-positional-numbers"]&&h==="_"||!R(h,m.strings)&&!R(h,m.bools)&&!Array.isArray(w)&&(qn(w)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${w}`)))||!ze(w)&&R(h,m.numbers))&&(w=Number(w)),w}function H(h){let w=Object.create(null);ne(w,m.aliases,l),Object.keys(m.configs).forEach(function(v){let x=h[v]||w[v];if(x)try{let b=null,F=it.resolve(it.cwd(),x),P=m.configs[v];if(typeof P=="function"){try{b=P(F)}catch(D){b=D}if(b instanceof Error){G=b;return}}else b=it.require(F);J(b)}catch(b){b.name==="PermissionDenied"?G=b:h[v]&&(G=Error(A("Invalid JSON config file: %s",x)))}})}function J(h,w){Object.keys(h).forEach(function(v){let x=h[v],b=w?w+"."+v:v;typeof x=="object"&&x!==null&&!Array.isArray(x)&&a["dot-notation"]?J(x,b):(!tt(V,b.split("."))||R(b,m.arrays)&&a["combine-arrays"])&&Q(b,x)})}function se(){typeof u!="undefined"&&u.forEach(function(h){J(h)})}function z(h,w){if(typeof d=="undefined")return;let v=typeof d=="string"?d:"",x=it.env();Object.keys(x).forEach(function(b){if(v===""||b.lastIndexOf(v,0)===0){let F=b.split("__").map(function(P,D){return D===0&&(P=P.substring(v.length)),Lt(P)});(w&&m.configs[F.join(".")]||!w)&&!tt(h,F)&&Q(F.join("."),x[b])}})}function ue(h){let w,v=new Set;Object.keys(h).forEach(function(x){if(!v.has(x)&&(w=R(x,m.coercions),typeof w=="function"))try{let b=T(x,w(h[x]));[].concat(m.aliases[x]||[],x).forEach(F=>{v.add(F),h[F]=b})}catch(b){G=b}})}function Mt(h){return m.keys.forEach(w=>{~w.indexOf(".")||typeof h[w]=="undefined"&&(h[w]=void 0)}),h}function ne(h,w,v,x=!1){Object.keys(v).forEach(function(b){tt(h,b.split("."))||(nt(h,b.split("."),v[b]),x&&(C[b]=!0),(w[b]||[]).forEach(function(F){tt(h,F.split("."))||nt(h,F.split("."),v[b])}))})}function tt(h,w){let v=h;a["dot-notation"]||(w=[w.join(".")]),w.slice(0,-1).forEach(function(b){v=v[b]||{}});let x=w[w.length-1];return typeof v!="object"?!1:x in v}function nt(h,w,v){let x=h;a["dot-notation"]||(w=[w.join(".")]),w.slice(0,-1).forEach(function(pe){pe=Wr(pe),typeof x=="object"&&x[pe]===void 0&&(x[pe]={}),typeof x[pe]!="object"||Array.isArray(x[pe])?(Array.isArray(x[pe])?x[pe].push({}):x[pe]=[x[pe],{}],x=x[pe][x[pe].length-1]):x=x[pe]});let b=Wr(w[w.length-1]),F=R(w.join("."),m.arrays),P=Array.isArray(v),D=a["duplicate-arguments-array"];!D&&R(b,m.nargs)&&(D=!0,(!ze(x[b])&&m.nargs[b]===1||Array.isArray(x[b])&&x[b].length===m.nargs[b])&&(x[b]=void 0)),v===Ti()?x[b]=Ti(x[b]):Array.isArray(x[b])?D&&F&&P?x[b]=a["flatten-duplicate-arrays"]?x[b].concat(v):(Array.isArray(x[b][0])?x[b]:[x[b]]).concat([v]):!D&&Boolean(F)===Boolean(P)?x[b]=v:x[b]=x[b].concat([v]):x[b]===void 0&&F?x[b]=P?v:[v]:D&&!(x[b]===void 0||R(b,m.counts)||R(b,m.bools))?x[b]=[x[b],v]:x[b]=v}function Ft(...h){h.forEach(function(w){Object.keys(w||{}).forEach(function(v){m.aliases[v]||(m.aliases[v]=[].concat(s[v]||[]),m.aliases[v].concat(v).forEach(function(x){if(/-/.test(x)&&a["camel-case-expansion"]){let b=Lt(x);b!==v&&m.aliases[v].indexOf(b)===-1&&(m.aliases[v].push(b),y[b]=!0)}}),m.aliases[v].concat(v).forEach(function(x){if(x.length>1&&/[A-Z]/.test(x)&&a["camel-case-expansion"]){let b=Bn(x,"-");b!==v&&m.aliases[v].indexOf(b)===-1&&(m.aliases[v].push(b),y[b]=!0)}}),m.aliases[v].forEach(function(x){m.aliases[x]=[v].concat(m.aliases[v].filter(function(b){return x!==b}))}))})})}function R(h,w){let v=[].concat(m.aliases[h]||[],h),x=Object.keys(w),b=v.find(F=>x.includes(F));return b?w[b]:!1}function Fi(h){let w=Object.keys(m);return[].concat(w.map(x=>m[x])).some(function(x){return Array.isArray(x)?x.includes(h):x[h]})}function U(h,...w){return[].concat(...w).some(function(x){let b=h.match(x);return b&&Fi(b[1])})}function ee(h){if(h.match(S)||!h.match(/^-[^-]+/))return!1;let w=!0,v,x=h.slice(1).split("");for(let b=0;b<x.length;b++){if(v=h.slice(b+2),!Fi(x[b])){w=!1;break}if(x[b+1]&&x[b+1]==="="||v==="-"||/[A-Za-z]/.test(x[b])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(v)||x[b+1]&&x[b+1].match(/\W/))break}return w}function ie(h){return a["unknown-options-as-args"]&&q(h)}function q(h){return h=h.replace(/^-{3,}/,"--"),h.match(S)||ee(h)?!1:!U(h,/^-+([^=]+?)=[\s\S]*$/,E,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function re(h){return!R(h,m.bools)&&!R(h,m.counts)&&`${h}`in l?l[h]:ae(qe(h))}function ae(h){return{[$e.BOOLEAN]:!0,[$e.STRING]:"",[$e.NUMBER]:void 0,[$e.ARRAY]:[]}[h]}function qe(h){let w=$e.BOOLEAN;return R(h,m.strings)?w=$e.STRING:R(h,m.numbers)?w=$e.NUMBER:R(h,m.bools)?w=$e.BOOLEAN:R(h,m.arrays)&&(w=$e.ARRAY),w}function ze(h){return h===void 0}function kn(){Object.keys(m.counts).find(h=>R(h,m.arrays)?(G=Error(A("Invalid configuration: %s, opts.count excludes opts.array.",h)),!0):R(h,m.nargs)?(G=Error(A("Invalid configuration: %s, opts.count excludes opts.narg.",h)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(lt,V),configuration:a,defaulted:Object.assign({},C),error:G,newAliases:Object.assign({},y)}}};function Rl(e){let t=[],n=Object.create(null),i=!0;for(Object.keys(e).forEach(function(r){t.push([].concat(e[r],r))});i;){i=!1;for(let r=0;r<t.length;r++)for(let o=r+1;o<t.length;o++)if(t[r].filter(function(a){return t[o].indexOf(a)!==-1}).length){t[r]=t[r].concat(t[o]),t.splice(o,1),i=!0;break}}return t.forEach(function(r){r=r.filter(function(s,a,l){return l.indexOf(s)===a});let o=r.pop();o!==void 0&&typeof o=="string"&&(n[o]=r)}),n}function Ti(e){return e!==void 0?e+1:1}function Wr(e){return e==="__proto__"?"___proto___":e}function $l(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}var Hr=require("fs");var Yr=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])<Yr)throw Error(`yargs parser supports a minimum Node.js version of ${Yr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Wl=process?process.env:{},Gr=new Ni({cwd:process.cwd,env:()=>Wl,format:kr.format,normalize:zn.normalize,resolve:zn.resolve,require:e=>{if(typeof require!="undefined")return require(e);if(e.match(/\.json$/))return JSON.parse((0,Hr.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),Cn=function(t,n){return Gr.parse(t.slice(),n).argv};Cn.detailed=function(e,t){return Gr.parse(e.slice(),t)};Cn.camelCase=Lt;Cn.decamelize=Bn;Cn.looksLikeNumber=qn;var Br=Cn;var Qe=require("path");g();function kl(){return Hl()?0:1}function Hl(){return Yl()&&!process.defaultApp}function Yl(){return!!process.versions.electron}function qr(){return process.argv[kl()]}g();var Z=class extends Error{constructor(t){super(t||"yargs error");this.name="YError",Error.captureStackTrace(this,Z)}};g();g();var nn=require("fs"),zr=require("util"),Vr=require("path"),Kr={fs:{readFileSync:nn.readFileSync,writeFile:nn.writeFile},format:zr.format,resolve:Vr.resolve,exists:e=>{try{return(0,nn.statSync)(e).isFile()}catch(t){return!1}}};g();var Ke,Qr=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=t.shift(),i=function(){};return typeof t[t.length-1]=="function"&&(i=t.pop()),i=i||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i(),Ke.format.apply(Ke.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),i=t.shift(),r=t.shift(),o=function(){};typeof t[t.length-1]=="function"&&(o=t.pop()),this.cache[this.locale]||this._readLocaleFile();let s=r===1?n:i;this.cache[this.locale][n]&&(s=this.cache[this.locale][n][r===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:i},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let a=[s];return~s.indexOf("%d")&&a.push(r),Ke.format.apply(Ke.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let i="";return t.forEach(function(r,o){let s=n[o+1];i+=r,typeof s!="undefined"&&(i+="%s")}),this.__.apply(this,[i].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],i=n.directory,r=n.locale,o=n.cb,s=this._resolveLocaleFile(i,r),a=JSON.stringify(this.cache[r],null,2);Ke.fs.writeFile(s,a,"utf-8",function(l){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),o(l)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{Ke.fs.readFileSync&&(t=JSON.parse(Ke.fs.readFileSync(n,"utf-8")))}catch(i){if(i instanceof SyntaxError&&(i.message="syntax error in "+n),i.code==="ENOENT")t={};else throw i}this.cache[this.locale]=t}_resolveLocaleFile(t,n){let i=Ke.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(i)&&~n.lastIndexOf("_")){let r=Ke.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(i=r)}return i}_fileExistsSync(t){return Ke.exists(t)}};function Jr(e,t){Ke=t;let n=new Qr(e);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var Gl=e=>Jr(e,Kr),Zr=Gl;var Bl="require is not supported by ESM",no="loading a directory of commands is not supported yet for ESM",Kn;try{Kn=(0,to.fileURLToPath)(O)}catch(e){Kn=process.cwd()}var ql=Kn.split("node_modules")[0],io={assert:{notStrictEqual:Vn.notStrictEqual,strictEqual:Vn.strictEqual},cliui:Di,findUp:Rr,getEnv:e=>process.env[e],inspect:Xr.inspect,getCallerFile:()=>{throw new Z(no)},getProcessArgvBin:qr,mainFilename:ql||process.cwd(),Parser:Br,path:{basename:Qe.basename,dirname:Qe.dirname,extname:Qe.extname,relative:Qe.relative,resolve:Qe.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!="undefined"?process.stdout.columns:null},readFileSync:eo.readFileSync,require:()=>{throw new Z(Bl)},requireDirectory:()=>{throw new Z(no)},stringWidth:e=>[...e].length,y18n:Zr({directory:(0,Qe.resolve)(Kn,"../../../locales"),updateFiles:!1})};g();g();g();function Pe(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function Ui(e,t){t.assert.strictEqual(typeof e,"string")}function rn(e){return Object.keys(e)}g();function te(e){return!!e&&!!e.then&&typeof e.then=="function"}g();g();g();function ct(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),i=/\.*[\][<>]/g,r=n.shift();if(!r)throw new Error(`No command found in: ${e}`);let o={cmd:r.replace(i,""),demanded:[],optional:[]};return n.forEach((s,a)=>{let l=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===n.length-1&&(l=!0),/^\[/.test(s)?o.optional.push({cmd:s.replace(i,"").split("|"),variadic:l}):o.demanded.push({cmd:s.replace(i,"").split("|"),variadic:l})}),o}var zl=["first","second","third","fourth","fifth","sixth"];function j(e,t,n){function i(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[ct(`cmd ${e}`),t,n]}try{let r=0,[o,s,a]=i(),l=[].slice.call(s);for(;l.length&&l[l.length-1]===void 0;)l.pop();let u=a||l.length;if(u<o.demanded.length)throw new Z(`Not enough arguments provided. Expected ${o.demanded.length} but received ${l.length}.`);let d=o.demanded.length+o.optional.length;if(u>d)throw new Z(`Too many arguments provided. Expected max ${d} but received ${u}.`);o.demanded.forEach(f=>{let p=l.shift(),y=ro(p);f.cmd.filter(A=>A===y||A==="*").length===0&&oo(y,f.cmd,r),r+=1}),o.optional.forEach(f=>{if(l.length===0)return;let p=l.shift(),y=ro(p);f.cmd.filter(A=>A===y||A==="*").length===0&&oo(y,f.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function ro(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function oo(e,t,n){throw new Z(`Invalid ${zl[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var Ri=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,i=!0,r=!1){if(j("<array|function> [boolean] [boolean] [boolean]",[t,n,i],arguments.length),Array.isArray(t)){for(let o=0;o<t.length;o++){if(typeof t[o]!="function")throw Error("middleware must be a function");let s=t[o];s.applyBeforeValidation=n,s.global=i}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let o=t;o.applyBeforeValidation=n,o.global=i,o.mutates=r,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,n){let i=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(r=>{let o=[...i[n]||[],n];return r.option?!o.includes(r.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function so(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Dt(e,t,n,i){return n.reduce((r,o)=>{if(o.applyBeforeValidation!==i)return r;if(o.mutates){if(o.applied)return r;o.applied=!0}if(te(r))return r.then(s=>Promise.all([s,o(s,t)])).then(([s,a])=>Object.assign(s,a));{let s=o(r,t);return te(s)?s.then(a=>Object.assign(r,a)):Object.assign(r,s)}},e)}g();function Nt(e,t,n=i=>{throw i}){try{let i=Vl(e)?e():e;return te(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function Vl(e){return typeof e=="function"}g();function $i(e){if(typeof require=="undefined")return null;for(let t=0,n=Object.keys(require.cache),i;t<n.length;t++)if(i=require.cache[n[t]],i.exports===e)return i;return null}var on=/(^\*)|(^\$0)/,ao=class{constructor(t,n,i,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=t,this.globalMiddleware=i,this.validation=n}addDirectory(t,n,i,r){r=r||{},typeof r.recurse!="boolean"&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=["js"]);let o=typeof r.visit=="function"?r.visit:s=>s;r.visit=(s,a,l)=>{let u=o(s,a,l);if(u){if(this.requireCache.has(a))return u;this.requireCache.add(a),this.addHandler(u)}return u},this.shim.requireDirectory({require:n,filename:i},t,r)}addHandler(t,n,i,r,o,s){let a=[],l=so(o);if(r=r||(()=>{}),Array.isArray(t))if(Kl(t))[t,...a]=t;else for(let u of t)this.addHandler(u);else if(Jl(t)){let u=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(u=[].concat(u).concat(t.aliases)),this.addHandler(u,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(co(i)){this.addHandler([t].concat(a),n,i.builder,i.handler,i.middlewares,i.deprecated);return}if(typeof t=="string"){let u=ct(t);a=a.map(p=>ct(p).cmd);let d=!1,f=[u.cmd].concat(a).filter(p=>on.test(p)?(d=!0,!1):!0);f.length===0&&d&&f.push("$0"),d&&(u.cmd=f[0],a=f.slice(1),t=t.replace(on,u.cmd)),a.forEach(p=>{this.aliasMap[p]=u.cmd}),n!==!1&&this.usage.command(t,n,d,a,s),this.handlers[u.cmd]={original:t,description:n,handler:r,builder:i||{},middlewares:l,deprecated:s,demanded:u.demanded,optional:u.optional},d&&(this.defaultCommand=this.handlers[u.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,n,i,r,o,s){let a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,l=n.getInternalMethods().getContext(),u=l.commands.slice(),d=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(d,a,n,i.aliases,u,r,o,s);return te(f)?f.then(p=>this.applyMiddlewareAndGetResult(d,a,p.innerArgv,l,o,p.aliases,n)):this.applyMiddlewareAndGetResult(d,a,f.innerArgv,l,o,f.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,i,r,o,s,a,l){let u=n.builder,d=i;if(Qn(u)){let f=u(i.getInternalMethods().reset(r),l);if(te(f))return f.then(p=>(d=fo(p)?p:i,this.parseAndUpdateUsage(t,n,d,o,s,a)))}else Ql(u)&&(d=i.getInternalMethods().reset(r),Object.keys(n.builder).forEach(f=>{d.option(f,u[f])}));return this.parseAndUpdateUsage(t,n,d,o,s,a)}parseAndUpdateUsage(t,n,i,r,o,s){t&&i.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(i)&&i.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,n),n.description);let a=i.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,s);return te(a)?a.then(l=>({aliases:i.parsed.aliases,innerArgv:l})):{aliases:i.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,n){let i=on.test(n.original)?n.original.replace(on,"").trim():n.original,r=t.filter(o=>!on.test(o));return r.push(i),`$0 ${r.join(" ")}`}applyMiddlewareAndGetResult(t,n,i,r,o,s,a){let l={};if(o)return i;a.getInternalMethods().getHasOutput()||(l=this.populatePositionals(n,i,r,a));let u=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(i=Dt(i,a,u,!0),!a.getInternalMethods().getHasOutput()){let d=a.getInternalMethods().runValidation(s,l,a.parsed.error,t);i=Nt(i,f=>(d(f),f))}if(n.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let d=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(i,d,!1,!1),i=Dt(i,a,u,!1),i=Nt(i,f=>{let p=n.handler(f);return te(p)?p.then(()=>f):f}),t||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),te(i)&&!a.getInternalMethods().hasParseCallback()&&i.catch(f=>{try{a.getInternalMethods().getUsageInstance().fail(null,f)}catch(p){}})}return t||(r.commands.pop(),r.fullCommands.pop()),i}populatePositionals(t,n,i,r){n._=n._.slice(i.commands.length);let o=t.demanded.slice(0),s=t.optional.slice(0),a={};for(this.validation.positionalCount(o.length,n._.length);o.length;){let l=o.shift();this.populatePositional(l,n,a)}for(;s.length;){let l=s.shift();this.populatePositional(l,n,a)}return n._=i.commands.concat(n._.map(l=>""+l)),this.postProcessPositionals(n,a,this.cmdToParseOptions(t.original),r),a}populatePositional(t,n,i){let r=t.cmd[0];t.variadic?i[r]=n._.splice(0).map(String):n._.length&&(i[r]=[String(n._.shift())])}cmdToParseOptions(t){let n={array:[],default:{},alias:{},demand:{}},i=ct(t);return i.demanded.forEach(r=>{let[o,...s]=r.cmd;r.variadic&&(n.array.push(o),n.default[o]=[]),n.alias[o]=s,n.demand[o]=!0}),i.optional.forEach(r=>{let[o,...s]=r.cmd;r.variadic&&(n.array.push(o),n.default[o]=[]),n.alias[o]=s}),n}postProcessPositionals(t,n,i,r){let o=Object.assign({},r.getOptions());o.default=Object.assign(i.default,o.default);for(let u of Object.keys(i.alias))o.alias[u]=(o.alias[u]||[]).concat(i.alias[u]);o.array=o.array.concat(i.array),o.config={};let s=[];if(Object.keys(n).forEach(u=>{n[u].map(d=>{o.configuration["unknown-options-as-args"]&&(o.key[u]=!0),s.push(`--${u}`),s.push(d)})}),!s.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(s,Object.assign({},o,{configuration:a}));if(l.error)r.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let u=Object.keys(n);Object.keys(n).forEach(f=>{u.push(...l.aliases[f])});let d=r.getOptions().default;Object.keys(l.argv).forEach(f=>{u.includes(f)&&(n[f]||(n[f]=l.argv[f]),!Object.prototype.hasOwnProperty.call(d,f)&&Object.prototype.hasOwnProperty.call(t,f)&&Object.prototype.hasOwnProperty.call(l.argv,f)&&(Array.isArray(t[f])||Array.isArray(l.argv[f]))?t[f]=[].concat(t[f],l.argv[f]):t[f]=l.argv[f])})}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let i=on.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(i,this.defaultCommand.description)}let n=this.defaultCommand.builder;if(Qn(n))return n(t,!0);co(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=$i(t);if(!n)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(n.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:n,desc:i}){for(let r of[t,n,i]){if(typeof r=="string"||r===!1)return r;Pe(r,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();Pe(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function lo(e,t,n,i){return new ao(e,t,n,i)}function co(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Kl(e){return e.every(t=>typeof t=="string")}function Qn(e){return typeof e=="function"}function Ql(e){return typeof e=="object"}function Jl(e){return typeof e=="object"&&!Array.isArray(e)}g();g();function ft(e={},t=()=>!0){let n={};return rn(e).forEach(i=>{t(i,e[i])&&(n[i]=e[i])}),n}g();function ut(e){typeof process!="undefined"&&[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(e)})}function Zl(e){return typeof e=="boolean"}function uo(e,t){let n=t.y18n.__,i={},r=[];i.failFn=function(_){r.push(_)};let o=null,s=!0;i.showHelpOnFail=function(_=!0,T){function H(){return typeof _=="string"?[!0,_]:[_,T]}let[J,se]=H();return o=se,s=J,i};let a=!1;i.fail=function(_,T){let H=e.getInternalMethods().getLoggerInstance();if(r.length)for(let J=r.length-1;J>=0;--J){let se=r[J];if(Zl(se)){if(T)throw T;if(_)throw Error(_)}else se(_,T,i)}else{if(e.getExitProcess()&&ut(!0),a||(a=!0,s&&(e.showHelp("error"),H.error()),(_||T)&&H.error(_||T),o&&((_||T)&&H.error(""),H.error(o))),T=T||new Z(_),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,T);throw T}};let l=[],u=!1;i.usage=(M,_)=>M===null?(u=!0,l=[],i):(u=!1,l.push([M,_||""]),i),i.getUsage=()=>l,i.getUsageDisabled=()=>u,i.getPositionalGroupName=()=>n("Positionals:");let d=[];i.example=(M,_)=>{d.push([M,_||""])};let f=[];i.command=function(_,T,H,J,se=!1){H&&(f=f.map(z=>(z[2]=!1,z))),f.push([_,T||"",H,J,se])},i.getCommands=()=>f;let p={};i.describe=function(_,T){Array.isArray(_)?_.forEach(H=>{i.describe(H,T)}):typeof _=="object"?Object.keys(_).forEach(H=>{i.describe(H,_[H])}):p[_]=T},i.getDescriptions=()=>p;let y=[];i.epilog=M=>{y.push(M)};let C=!1,A;i.wrap=M=>{C=!0,A=M};function m(){return C||(A=en(),C=!0),A}let S="__yargsString__:";i.deferY18nLookup=M=>S+M,i.help=function(){if(B)return B;G();let _=e.customScriptName?e.$0:t.path.basename(e.$0),T=e.getDemandedOptions(),H=e.getDemandedCommands(),J=e.getDeprecatedOptions(),se=e.getGroups(),z=e.getOptions(),ue=[];ue=ue.concat(Object.keys(p)),ue=ue.concat(Object.keys(T)),ue=ue.concat(Object.keys(H)),ue=ue.concat(Object.keys(z.default)),ue=ue.filter(lt),ue=Object.keys(ue.reduce((U,ee)=>(ee!=="_"&&(U[ee]=!0),U),{}));let Mt=m(),ne=t.cliui({width:Mt,wrap:!!Mt});if(!u){if(l.length)l.forEach(U=>{ne.div({text:`${U[0].replace(/\$0/g,_)}`}),U[1]&&ne.div({text:`${U[1]}`,padding:[1,0,0,0]})}),ne.div();else if(f.length){let U=null;H._?U=`${_} <${n("command")}>
5
+ `),o.border&&(r.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),r.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(r.unshift(...new Array(o.padding[Fl]||0).fill("")),r.push(...new Array(o.padding[Ll]||0).fill(""))),r.forEach((a,l)=>{n[l]||n.push([]);let u=n[l];for(let d=0;d<s;d++)u[d]===void 0&&u.push("");u.push(a)})}),n}negatePadding(t){let n=t.width||0;return t.padding&&(n-=(t.padding[Yn]||0)+(t.padding[Hn]||0)),t.border&&(n-=4),n}columnWidths(t){if(!this.wrap)return t.map(s=>s.width||De.stringWidth(s.text));let n=t.length,i=this.width,r=t.map(s=>{if(s.width)return n--,i-=s.width,s.width}),o=n?Math.floor(i/n):0;return r.map((s,a)=>s===void 0?Math.max(o,Dl(t[a])):s)}};function Lr(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function Dl(e){let t=e.padding||[],n=1+(t[Yn]||0)+(t[Hn]||0);return e.border?n+4:n}function Nl(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Tl(e,t){e=e.trim();let n=De.stringWidth(e);return n<t?" ".repeat(t-n)+e:e}function Ul(e,t){e=e.trim();let n=De.stringWidth(e);return n>=t?e:" ".repeat(t-n>>1)+e}var De;function Nr(e,t){return De=t,new Dr({width:(e==null?void 0:e.width)||Nl(),wrap:e==null?void 0:e.wrap})}g();var Tr=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Li(e){return e.replace(Tr,"")}function Ur(e,t){let[n,i]=e.match(Tr)||["",""];e=Li(e);let r="";for(let o=0;o<e.length;o++)o!==0&&o%t===0&&(r+=`
6
+ `),r+=e.charAt(o);return n&&i&&(r=`${n}${r}${i}`),r}function Di(e){return Nr(e,{stringWidth:t=>[...t].length,stripAnsi:Li,wrap:Ur})}g();var tn=require("path"),Gn=require("fs");function Rr(e,t){let n=(0,tn.resolve)(".",e),i;for((0,Gn.statSync)(n).isDirectory()||(n=(0,tn.dirname)(n));;){if(i=t(n,(0,Gn.readdirSync)(n)),i)return(0,tn.resolve)(n,i);if(n=(0,tn.dirname)(i=n),i===n)break}}var eo=require("util"),to=require("fs"),no=require("url");g();var Hr=require("util"),zn=require("path");g();function Lt(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let n="",i=!1,r=e.match(/^-+/);for(let o=r?r[0].length:0;o<e.length;o++){let s=e.charAt(o);i&&(i=!1,s=s.toUpperCase()),o!==0&&(s==="-"||s==="_")?i=!0:s!=="-"&&s!=="_"&&(n+=s)}return n}}function Bn(e,t){let n=e.toLowerCase();t=t||"-";let i="";for(let r=0;r<e.length;r++){let o=n.charAt(r),s=e.charAt(r);o!==s&&r>0?i+=`${t}${n.charAt(r)}`:i+=s}return i}function qn(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}g();g();function $r(e){if(Array.isArray(e))return e.map(s=>typeof s!="string"?s+"":s);e=e.trim();let t=0,n=null,i=null,r=null,o=[];for(let s=0;s<e.length;s++){if(n=i,i=e.charAt(s),i===" "&&!r){n!==" "&&t++;continue}i===r?r=null:(i==="'"||i==='"')&&!r&&(r=i),o[t]||(o[t]=""),o[t]+=i}return o}g();var $e;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})($e||($e={}));var it,Ti=class{constructor(t){it=t}parse(t,n){let i=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},n),r=$r(t),o=typeof t=="string",s=Rl(Object.assign(Object.create(null),i.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},i.configuration),l=Object.assign(Object.create(null),i.default),u=i.configObjects||[],d=i.envPrefix,f=a["populate--"],p=f?"--":"_",y=Object.create(null),C=Object.create(null),A=i.__||it.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},S=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,E=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(h){let w=typeof h=="object"?h.key:h,v=Object.keys(h).map(function(x){return{boolean:"bools",string:"strings",number:"numbers"}[x]}).filter(Boolean).pop();v&&(m[v][w]=!0),m.arrays[w]=!0,m.keys.push(w)}),[].concat(i.boolean||[]).filter(Boolean).forEach(function(h){m.bools[h]=!0,m.keys.push(h)}),[].concat(i.string||[]).filter(Boolean).forEach(function(h){m.strings[h]=!0,m.keys.push(h)}),[].concat(i.number||[]).filter(Boolean).forEach(function(h){m.numbers[h]=!0,m.keys.push(h)}),[].concat(i.count||[]).filter(Boolean).forEach(function(h){m.counts[h]=!0,m.keys.push(h)}),[].concat(i.normalize||[]).filter(Boolean).forEach(function(h){m.normalize[h]=!0,m.keys.push(h)}),typeof i.narg=="object"&&Object.entries(i.narg).forEach(([h,w])=>{typeof w=="number"&&(m.nargs[h]=w,m.keys.push(h))}),typeof i.coerce=="object"&&Object.entries(i.coerce).forEach(([h,w])=>{typeof w=="function"&&(m.coercions[h]=w,m.keys.push(h))}),typeof i.config!="undefined"&&(Array.isArray(i.config)||typeof i.config=="string"?[].concat(i.config).filter(Boolean).forEach(function(h){m.configs[h]=!0}):typeof i.config=="object"&&Object.entries(i.config).forEach(([h,w])=>{(typeof w=="boolean"||typeof w=="function")&&(m.configs[h]=w)})),Ft(i.key,s,i.default,m.arrays),Object.keys(l).forEach(function(h){(m.aliases[h]||[]).forEach(function(w){l[w]=l[h]})});let G=null;kn();let B=[],V=Object.assign(Object.create(null),{_:[]}),lt={};for(let h=0;h<r.length;h++){let w=r[h],v=w.replace(/^-{3,}/,"---"),x,b,M,P,D,pe;if(w!=="--"&&ie(w))Be(w);else if(v.match(/---+(=|$)/)){Be(w);continue}else if(w.match(/^--.+=/)||!a["short-option-groups"]&&w.match(/^-.+=/))P=w.match(/^--?([^=]+)=([\s\S]*)$/),P!==null&&Array.isArray(P)&&P.length>=3&&(R(P[1],m.arrays)?h=It(h,P[1],r,P[2]):R(P[1],m.nargs)!==!1?h=en(h,P[1],r,P[2]):Q(P[1],P[2],!0));else if(w.match(E)&&a["boolean-negation"])P=w.match(E),P!==null&&Array.isArray(P)&&P.length>=2&&(b=P[1],Q(b,R(b,m.arrays)?[!1]:!1));else if(w.match(/^--.+/)||!a["short-option-groups"]&&w.match(/^-[^-]+/))P=w.match(/^--?(.+)/),P!==null&&Array.isArray(P)&&P.length>=2&&(b=P[1],R(b,m.arrays)?h=It(h,b,r):R(b,m.nargs)!==!1?h=en(h,b,r):(D=r[h+1],D!==void 0&&(!D.match(/^-/)||D.match(S))&&!R(b,m.bools)&&!R(b,m.counts)||/^(true|false)$/.test(D)?(Q(b,D),h++):Q(b,re(b))));else if(w.match(/^-.\..+=/))P=w.match(/^-([^=]+)=([\s\S]*)$/),P!==null&&Array.isArray(P)&&P.length>=3&&Q(P[1],P[2]);else if(w.match(/^-.\..+/)&&!w.match(S))D=r[h+1],P=w.match(/^-(.\..+)/),P!==null&&Array.isArray(P)&&P.length>=2&&(b=P[1],D!==void 0&&!D.match(/^-/)&&!R(b,m.bools)&&!R(b,m.counts)?(Q(b,D),h++):Q(b,re(b)));else if(w.match(/^-[^-]+/)&&!w.match(S)){M=w.slice(1,-1).split(""),x=!1;for(let Se=0;Se<M.length;Se++){if(D=w.slice(Se+2),M[Se+1]&&M[Se+1]==="="){pe=w.slice(Se+3),b=M[Se],R(b,m.arrays)?h=It(h,b,r,pe):R(b,m.nargs)!==!1?h=en(h,b,r,pe):Q(b,pe),x=!0;break}if(D==="-"){Q(M[Se],D);continue}if(/[A-Za-z]/.test(M[Se])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(D)&&R(D,m.bools)===!1){Q(M[Se],D),x=!0;break}if(M[Se+1]&&M[Se+1].match(/\W/)){Q(M[Se],D),x=!0;break}else Q(M[Se],re(M[Se]))}b=w.slice(-1)[0],!x&&b!=="-"&&(R(b,m.arrays)?h=It(h,b,r):R(b,m.nargs)!==!1?h=en(h,b,r):(D=r[h+1],D!==void 0&&(!/^(-|--)[^-]/.test(D)||D.match(S))&&!R(b,m.bools)&&!R(b,m.counts)||/^(true|false)$/.test(D)?(Q(b,D),h++):Q(b,re(b))))}else if(w.match(/^-[0-9]$/)&&w.match(S)&&R(w.slice(1),m.bools))b=w.slice(1),Q(b,re(b));else if(w==="--"){B=r.slice(h+1);break}else if(a["halt-at-non-option"]){B=r.slice(h);break}else Be(w)}z(V,!0),z(V,!1),H(V),se(),ne(V,m.aliases,l,!0),ue(V),a["set-placeholder-key"]&&Mt(V),Object.keys(m.counts).forEach(function(h){tt(V,h.split("."))||Q(h,0)}),f&&B.length&&(V[p]=[]),B.forEach(function(h){V[p].push(h)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(V).filter(h=>h!=="--"&&h.includes("-")).forEach(h=>{delete V[h]}),a["strip-aliased"]&&[].concat(...Object.keys(s).map(h=>s[h])).forEach(h=>{a["camel-case-expansion"]&&h.includes("-")&&delete V[h.split(".").map(w=>Lt(w)).join(".")],delete V[h]});function Be(h){let w=T("_",h);(typeof w=="string"||typeof w=="number")&&V._.push(w)}function en(h,w,v,x){let b,M=R(w,m.nargs);if(M=typeof M!="number"||isNaN(M)?1:M,M===0)return ze(x)||(G=Error(A("Argument unexpected for: %s",w))),Q(w,re(w)),h;let P=ze(x)?0:1;if(a["nargs-eats-options"])v.length-(h+1)+P<M&&(G=Error(A("Not enough arguments following: %s",w))),P=M;else{for(b=h+1;b<v.length&&(!v[b].match(/^-[^0-9]/)||v[b].match(S)||ie(v[b]));b++)P++;P<M&&(G=Error(A("Not enough arguments following: %s",w)))}let D=Math.min(P,M);for(!ze(x)&&D>0&&(Q(w,x),D--),b=h+1;b<D+h+1;b++)Q(w,v[b]);return h+D}function It(h,w,v,x){let b=[],M=x||v[h+1],P=R(w,m.nargs);if(R(w,m.bools)&&!/^(true|false)$/.test(M))b.push(!0);else if(ze(M)||ze(x)&&/^-/.test(M)&&!S.test(M)&&!ie(M)){if(l[w]!==void 0){let D=l[w];b=Array.isArray(D)?D:[D]}}else{ze(x)||b.push(_(w,x,!0));for(let D=h+1;D<v.length&&!(!a["greedy-arrays"]&&b.length>0||P&&typeof P=="number"&&b.length>=P||(M=v[D],/^-/.test(M)&&!S.test(M)&&!ie(M)));D++)h=D,b.push(_(w,M,o))}return typeof P=="number"&&(P&&b.length<P||isNaN(P)&&b.length===0)&&(G=Error(A("Not enough arguments following: %s",w))),Q(w,b),h}function Q(h,w,v=o){if(/-/.test(h)&&a["camel-case-expansion"]){let M=h.split(".").map(function(P){return Lt(P)}).join(".");F(h,M)}let x=_(h,w,v),b=h.split(".");nt(V,b,x),m.aliases[h]&&m.aliases[h].forEach(function(M){let P=M.split(".");nt(V,P,x)}),b.length>1&&a["dot-notation"]&&(m.aliases[b[0]]||[]).forEach(function(M){let P=M.split("."),D=[].concat(b);D.shift(),P=P.concat(D),(m.aliases[h]||[]).includes(P.join("."))||nt(V,P,x)}),R(h,m.normalize)&&!R(h,m.arrays)&&[h].concat(m.aliases[h]||[]).forEach(function(P){Object.defineProperty(lt,P,{enumerable:!0,get(){return w},set(D){w=typeof D=="string"?it.normalize(D):D}})})}function F(h,w){m.aliases[h]&&m.aliases[h].length||(m.aliases[h]=[w],y[w]=!0),m.aliases[w]&&m.aliases[w].length||F(w,h)}function _(h,w,v){v&&(w=$l(w)),(R(h,m.bools)||R(h,m.counts))&&typeof w=="string"&&(w=w==="true");let x=Array.isArray(w)?w.map(function(b){return T(h,b)}):T(h,w);return R(h,m.counts)&&(ze(x)||typeof x=="boolean")&&(x=Ni()),R(h,m.normalize)&&R(h,m.arrays)&&(Array.isArray(w)?x=w.map(b=>it.normalize(b)):x=it.normalize(w)),x}function T(h,w){return!a["parse-positional-numbers"]&&h==="_"||!R(h,m.strings)&&!R(h,m.bools)&&!Array.isArray(w)&&(qn(w)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${w}`)))||!ze(w)&&R(h,m.numbers))&&(w=Number(w)),w}function H(h){let w=Object.create(null);ne(w,m.aliases,l),Object.keys(m.configs).forEach(function(v){let x=h[v]||w[v];if(x)try{let b=null,M=it.resolve(it.cwd(),x),P=m.configs[v];if(typeof P=="function"){try{b=P(M)}catch(D){b=D}if(b instanceof Error){G=b;return}}else b=it.require(M);J(b)}catch(b){b.name==="PermissionDenied"?G=b:h[v]&&(G=Error(A("Invalid JSON config file: %s",x)))}})}function J(h,w){Object.keys(h).forEach(function(v){let x=h[v],b=w?w+"."+v:v;typeof x=="object"&&x!==null&&!Array.isArray(x)&&a["dot-notation"]?J(x,b):(!tt(V,b.split("."))||R(b,m.arrays)&&a["combine-arrays"])&&Q(b,x)})}function se(){typeof u!="undefined"&&u.forEach(function(h){J(h)})}function z(h,w){if(typeof d=="undefined")return;let v=typeof d=="string"?d:"",x=it.env();Object.keys(x).forEach(function(b){if(v===""||b.lastIndexOf(v,0)===0){let M=b.split("__").map(function(P,D){return D===0&&(P=P.substring(v.length)),Lt(P)});(w&&m.configs[M.join(".")]||!w)&&!tt(h,M)&&Q(M.join("."),x[b])}})}function ue(h){let w,v=new Set;Object.keys(h).forEach(function(x){if(!v.has(x)&&(w=R(x,m.coercions),typeof w=="function"))try{let b=T(x,w(h[x]));[].concat(m.aliases[x]||[],x).forEach(M=>{v.add(M),h[M]=b})}catch(b){G=b}})}function Mt(h){return m.keys.forEach(w=>{~w.indexOf(".")||typeof h[w]=="undefined"&&(h[w]=void 0)}),h}function ne(h,w,v,x=!1){Object.keys(v).forEach(function(b){tt(h,b.split("."))||(nt(h,b.split("."),v[b]),x&&(C[b]=!0),(w[b]||[]).forEach(function(M){tt(h,M.split("."))||nt(h,M.split("."),v[b])}))})}function tt(h,w){let v=h;a["dot-notation"]||(w=[w.join(".")]),w.slice(0,-1).forEach(function(b){v=v[b]||{}});let x=w[w.length-1];return typeof v!="object"?!1:x in v}function nt(h,w,v){let x=h;a["dot-notation"]||(w=[w.join(".")]),w.slice(0,-1).forEach(function(pe){pe=Wr(pe),typeof x=="object"&&x[pe]===void 0&&(x[pe]={}),typeof x[pe]!="object"||Array.isArray(x[pe])?(Array.isArray(x[pe])?x[pe].push({}):x[pe]=[x[pe],{}],x=x[pe][x[pe].length-1]):x=x[pe]});let b=Wr(w[w.length-1]),M=R(w.join("."),m.arrays),P=Array.isArray(v),D=a["duplicate-arguments-array"];!D&&R(b,m.nargs)&&(D=!0,(!ze(x[b])&&m.nargs[b]===1||Array.isArray(x[b])&&x[b].length===m.nargs[b])&&(x[b]=void 0)),v===Ni()?x[b]=Ni(x[b]):Array.isArray(x[b])?D&&M&&P?x[b]=a["flatten-duplicate-arrays"]?x[b].concat(v):(Array.isArray(x[b][0])?x[b]:[x[b]]).concat([v]):!D&&Boolean(M)===Boolean(P)?x[b]=v:x[b]=x[b].concat([v]):x[b]===void 0&&M?x[b]=P?v:[v]:D&&!(x[b]===void 0||R(b,m.counts)||R(b,m.bools))?x[b]=[x[b],v]:x[b]=v}function Ft(...h){h.forEach(function(w){Object.keys(w||{}).forEach(function(v){m.aliases[v]||(m.aliases[v]=[].concat(s[v]||[]),m.aliases[v].concat(v).forEach(function(x){if(/-/.test(x)&&a["camel-case-expansion"]){let b=Lt(x);b!==v&&m.aliases[v].indexOf(b)===-1&&(m.aliases[v].push(b),y[b]=!0)}}),m.aliases[v].concat(v).forEach(function(x){if(x.length>1&&/[A-Z]/.test(x)&&a["camel-case-expansion"]){let b=Bn(x,"-");b!==v&&m.aliases[v].indexOf(b)===-1&&(m.aliases[v].push(b),y[b]=!0)}}),m.aliases[v].forEach(function(x){m.aliases[x]=[v].concat(m.aliases[v].filter(function(b){return x!==b}))}))})})}function R(h,w){let v=[].concat(m.aliases[h]||[],h),x=Object.keys(w),b=v.find(M=>x.includes(M));return b?w[b]:!1}function Fi(h){let w=Object.keys(m);return[].concat(w.map(x=>m[x])).some(function(x){return Array.isArray(x)?x.includes(h):x[h]})}function U(h,...w){return[].concat(...w).some(function(x){let b=h.match(x);return b&&Fi(b[1])})}function ee(h){if(h.match(S)||!h.match(/^-[^-]+/))return!1;let w=!0,v,x=h.slice(1).split("");for(let b=0;b<x.length;b++){if(v=h.slice(b+2),!Fi(x[b])){w=!1;break}if(x[b+1]&&x[b+1]==="="||v==="-"||/[A-Za-z]/.test(x[b])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(v)||x[b+1]&&x[b+1].match(/\W/))break}return w}function ie(h){return a["unknown-options-as-args"]&&q(h)}function q(h){return h=h.replace(/^-{3,}/,"--"),h.match(S)||ee(h)?!1:!U(h,/^-+([^=]+?)=[\s\S]*$/,E,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function re(h){return!R(h,m.bools)&&!R(h,m.counts)&&`${h}`in l?l[h]:ae(qe(h))}function ae(h){return{[$e.BOOLEAN]:!0,[$e.STRING]:"",[$e.NUMBER]:void 0,[$e.ARRAY]:[]}[h]}function qe(h){let w=$e.BOOLEAN;return R(h,m.strings)?w=$e.STRING:R(h,m.numbers)?w=$e.NUMBER:R(h,m.bools)?w=$e.BOOLEAN:R(h,m.arrays)&&(w=$e.ARRAY),w}function ze(h){return h===void 0}function kn(){Object.keys(m.counts).find(h=>R(h,m.arrays)?(G=Error(A("Invalid configuration: %s, opts.count excludes opts.array.",h)),!0):R(h,m.nargs)?(G=Error(A("Invalid configuration: %s, opts.count excludes opts.narg.",h)),!0):!1)}return{aliases:Object.assign({},m.aliases),argv:Object.assign(lt,V),configuration:a,defaulted:Object.assign({},C),error:G,newAliases:Object.assign({},y)}}};function Rl(e){let t=[],n=Object.create(null),i=!0;for(Object.keys(e).forEach(function(r){t.push([].concat(e[r],r))});i;){i=!1;for(let r=0;r<t.length;r++)for(let o=r+1;o<t.length;o++)if(t[r].filter(function(a){return t[o].indexOf(a)!==-1}).length){t[r]=t[r].concat(t[o]),t.splice(o,1),i=!0;break}}return t.forEach(function(r){r=r.filter(function(s,a,l){return l.indexOf(s)===a});let o=r.pop();o!==void 0&&typeof o=="string"&&(n[o]=r)}),n}function Ni(e){return e!==void 0?e+1:1}function Wr(e){return e==="__proto__"?"___proto___":e}function $l(e){return typeof e=="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}var Yr=require("fs");var kr=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])<kr)throw Error(`yargs parser supports a minimum Node.js version of ${kr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Wl=process?process.env:{},Gr=new Ti({cwd:process.cwd,env:()=>Wl,format:Hr.format,normalize:zn.normalize,resolve:zn.resolve,require:e=>{if(typeof require!="undefined")return require(e);if(e.match(/\.json$/))return JSON.parse((0,Yr.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),Cn=function(t,n){return Gr.parse(t.slice(),n).argv};Cn.detailed=function(e,t){return Gr.parse(e.slice(),t)};Cn.camelCase=Lt;Cn.decamelize=Bn;Cn.looksLikeNumber=qn;var Br=Cn;var Qe=require("path");g();function kl(){return Hl()?0:1}function Hl(){return Yl()&&!process.defaultApp}function Yl(){return!!process.versions.electron}function qr(){return process.argv[kl()]}g();var Z=class extends Error{constructor(t){super(t||"yargs error");this.name="YError",Error.captureStackTrace(this,Z)}};g();g();var nn=require("fs"),zr=require("util"),Vr=require("path"),Kr={fs:{readFileSync:nn.readFileSync,writeFile:nn.writeFile},format:zr.format,resolve:Vr.resolve,exists:e=>{try{return(0,nn.statSync)(e).isFile()}catch(t){return!1}}};g();var Ke,Qr=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=t.shift(),i=function(){};return typeof t[t.length-1]=="function"&&(i=t.pop()),i=i||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i(),Ke.format.apply(Ke.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),i=t.shift(),r=t.shift(),o=function(){};typeof t[t.length-1]=="function"&&(o=t.pop()),this.cache[this.locale]||this._readLocaleFile();let s=r===1?n:i;this.cache[this.locale][n]&&(s=this.cache[this.locale][n][r===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:i},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let a=[s];return~s.indexOf("%d")&&a.push(r),Ke.format.apply(Ke.format,a.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let i="";return t.forEach(function(r,o){let s=n[o+1];i+=r,typeof s!="undefined"&&(i+="%s")}),this.__.apply(this,[i].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],i=n.directory,r=n.locale,o=n.cb,s=this._resolveLocaleFile(i,r),a=JSON.stringify(this.cache[r],null,2);Ke.fs.writeFile(s,a,"utf-8",function(l){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),o(l)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{Ke.fs.readFileSync&&(t=JSON.parse(Ke.fs.readFileSync(n,"utf-8")))}catch(i){if(i instanceof SyntaxError&&(i.message="syntax error in "+n),i.code==="ENOENT")t={};else throw i}this.cache[this.locale]=t}_resolveLocaleFile(t,n){let i=Ke.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(i)&&~n.lastIndexOf("_")){let r=Ke.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(i=r)}return i}_fileExistsSync(t){return Ke.exists(t)}};function Jr(e,t){Ke=t;let n=new Qr(e);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var Gl=e=>Jr(e,Kr),Zr=Gl;var Bl="require is not supported by ESM",Xr="loading a directory of commands is not supported yet for ESM",Vn;try{Vn=(0,no.fileURLToPath)(O)}catch(e){Vn=process.cwd()}var ql=Vn.split("node_modules")[0],io={assert:{notStrictEqual:Kn.notStrictEqual,strictEqual:Kn.strictEqual},cliui:Di,findUp:Rr,getEnv:e=>process.env[e],inspect:eo.inspect,getCallerFile:()=>{throw new Z(Xr)},getProcessArgvBin:qr,mainFilename:ql||process.cwd(),Parser:Br,path:{basename:Qe.basename,dirname:Qe.dirname,extname:Qe.extname,relative:Qe.relative,resolve:Qe.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!="undefined"?process.stdout.columns:null},readFileSync:to.readFileSync,require:()=>{throw new Z(Bl)},requireDirectory:()=>{throw new Z(Xr)},stringWidth:e=>[...e].length,y18n:Zr({directory:(0,Qe.resolve)(Vn,"../../../locales"),updateFiles:!1})};g();g();g();function Pe(e,t,n,i){n.assert.notStrictEqual(e,t,i)}function Ui(e,t){t.assert.strictEqual(typeof e,"string")}function rn(e){return Object.keys(e)}g();function te(e){return!!e&&!!e.then&&typeof e.then=="function"}g();g();g();function ct(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),i=/\.*[\][<>]/g,r=n.shift();if(!r)throw new Error(`No command found in: ${e}`);let o={cmd:r.replace(i,""),demanded:[],optional:[]};return n.forEach((s,a)=>{let l=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===n.length-1&&(l=!0),/^\[/.test(s)?o.optional.push({cmd:s.replace(i,"").split("|"),variadic:l}):o.demanded.push({cmd:s.replace(i,"").split("|"),variadic:l})}),o}var zl=["first","second","third","fourth","fifth","sixth"];function j(e,t,n){function i(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[ct(`cmd ${e}`),t,n]}try{let r=0,[o,s,a]=i(),l=[].slice.call(s);for(;l.length&&l[l.length-1]===void 0;)l.pop();let u=a||l.length;if(u<o.demanded.length)throw new Z(`Not enough arguments provided. Expected ${o.demanded.length} but received ${l.length}.`);let d=o.demanded.length+o.optional.length;if(u>d)throw new Z(`Too many arguments provided. Expected max ${d} but received ${u}.`);o.demanded.forEach(f=>{let p=l.shift(),y=ro(p);f.cmd.filter(A=>A===y||A==="*").length===0&&oo(y,f.cmd,r),r+=1}),o.optional.forEach(f=>{if(l.length===0)return;let p=l.shift(),y=ro(p);f.cmd.filter(A=>A===y||A==="*").length===0&&oo(y,f.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function ro(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function oo(e,t,n){throw new Z(`Invalid ${zl[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var Ri=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,i=!0,r=!1){if(j("<array|function> [boolean] [boolean] [boolean]",[t,n,i],arguments.length),Array.isArray(t)){for(let o=0;o<t.length;o++){if(typeof t[o]!="function")throw Error("middleware must be a function");let s=t[o];s.applyBeforeValidation=n,s.global=i}Array.prototype.push.apply(this.globalMiddleware,t)}else if(typeof t=="function"){let o=t;o.applyBeforeValidation=n,o.global=i,o.mutates=r,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,n){let i=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(r=>{let o=[...i[n]||[],n];return r.option?!o.includes(r.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function so(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function Dt(e,t,n,i){return n.reduce((r,o)=>{if(o.applyBeforeValidation!==i)return r;if(o.mutates){if(o.applied)return r;o.applied=!0}if(te(r))return r.then(s=>Promise.all([s,o(s,t)])).then(([s,a])=>Object.assign(s,a));{let s=o(r,t);return te(s)?s.then(a=>Object.assign(r,a)):Object.assign(r,s)}},e)}g();function Nt(e,t,n=i=>{throw i}){try{let i=Vl(e)?e():e;return te(i)?i.then(r=>t(r)):t(i)}catch(i){return n(i)}}function Vl(e){return typeof e=="function"}g();function $i(e){if(typeof require=="undefined")return null;for(let t=0,n=Object.keys(require.cache),i;t<n.length;t++)if(i=require.cache[n[t]],i.exports===e)return i;return null}var on=/(^\*)|(^\$0)/,lo=class{constructor(t,n,i,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=t,this.globalMiddleware=i,this.validation=n}addDirectory(t,n,i,r){r=r||{},typeof r.recurse!="boolean"&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=["js"]);let o=typeof r.visit=="function"?r.visit:s=>s;r.visit=(s,a,l)=>{let u=o(s,a,l);if(u){if(this.requireCache.has(a))return u;this.requireCache.add(a),this.addHandler(u)}return u},this.shim.requireDirectory({require:n,filename:i},t,r)}addHandler(t,n,i,r,o,s){let a=[],l=so(o);if(r=r||(()=>{}),Array.isArray(t))if(Kl(t))[t,...a]=t;else for(let u of t)this.addHandler(u);else if(Jl(t)){let u=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(u=[].concat(u).concat(t.aliases)),this.addHandler(u,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(ao(i)){this.addHandler([t].concat(a),n,i.builder,i.handler,i.middlewares,i.deprecated);return}if(typeof t=="string"){let u=ct(t);a=a.map(p=>ct(p).cmd);let d=!1,f=[u.cmd].concat(a).filter(p=>on.test(p)?(d=!0,!1):!0);f.length===0&&d&&f.push("$0"),d&&(u.cmd=f[0],a=f.slice(1),t=t.replace(on,u.cmd)),a.forEach(p=>{this.aliasMap[p]=u.cmd}),n!==!1&&this.usage.command(t,n,d,a,s),this.handlers[u.cmd]={original:t,description:n,handler:r,builder:i||{},middlewares:l,deprecated:s,demanded:u.demanded,optional:u.optional},d&&(this.defaultCommand=this.handlers[u.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,n,i,r,o,s){let a=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,l=n.getInternalMethods().getContext(),u=l.commands.slice(),d=!t;t&&(l.commands.push(t),l.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(d,a,n,i.aliases,u,r,o,s);return te(f)?f.then(p=>this.applyMiddlewareAndGetResult(d,a,p.innerArgv,l,o,p.aliases,n)):this.applyMiddlewareAndGetResult(d,a,f.innerArgv,l,o,f.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,i,r,o,s,a,l){let u=n.builder,d=i;if(Qn(u)){let f=u(i.getInternalMethods().reset(r),l);if(te(f))return f.then(p=>(d=fo(p)?p:i,this.parseAndUpdateUsage(t,n,d,o,s,a)))}else Ql(u)&&(d=i.getInternalMethods().reset(r),Object.keys(n.builder).forEach(f=>{d.option(f,u[f])}));return this.parseAndUpdateUsage(t,n,d,o,s,a)}parseAndUpdateUsage(t,n,i,r,o,s){t&&i.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(i)&&i.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,n),n.description);let a=i.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,s);return te(a)?a.then(l=>({aliases:i.parsed.aliases,innerArgv:l})):{aliases:i.parsed.aliases,innerArgv:a}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,n){let i=on.test(n.original)?n.original.replace(on,"").trim():n.original,r=t.filter(o=>!on.test(o));return r.push(i),`$0 ${r.join(" ")}`}applyMiddlewareAndGetResult(t,n,i,r,o,s,a){let l={};if(o)return i;a.getInternalMethods().getHasOutput()||(l=this.populatePositionals(n,i,r,a));let u=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(i=Dt(i,a,u,!0),!a.getInternalMethods().getHasOutput()){let d=a.getInternalMethods().runValidation(s,l,a.parsed.error,t);i=Nt(i,f=>(d(f),f))}if(n.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let d=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(i,d,!1,!1),i=Dt(i,a,u,!1),i=Nt(i,f=>{let p=n.handler(f);return te(p)?p.then(()=>f):f}),t||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),te(i)&&!a.getInternalMethods().hasParseCallback()&&i.catch(f=>{try{a.getInternalMethods().getUsageInstance().fail(null,f)}catch(p){}})}return t||(r.commands.pop(),r.fullCommands.pop()),i}populatePositionals(t,n,i,r){n._=n._.slice(i.commands.length);let o=t.demanded.slice(0),s=t.optional.slice(0),a={};for(this.validation.positionalCount(o.length,n._.length);o.length;){let l=o.shift();this.populatePositional(l,n,a)}for(;s.length;){let l=s.shift();this.populatePositional(l,n,a)}return n._=i.commands.concat(n._.map(l=>""+l)),this.postProcessPositionals(n,a,this.cmdToParseOptions(t.original),r),a}populatePositional(t,n,i){let r=t.cmd[0];t.variadic?i[r]=n._.splice(0).map(String):n._.length&&(i[r]=[String(n._.shift())])}cmdToParseOptions(t){let n={array:[],default:{},alias:{},demand:{}},i=ct(t);return i.demanded.forEach(r=>{let[o,...s]=r.cmd;r.variadic&&(n.array.push(o),n.default[o]=[]),n.alias[o]=s,n.demand[o]=!0}),i.optional.forEach(r=>{let[o,...s]=r.cmd;r.variadic&&(n.array.push(o),n.default[o]=[]),n.alias[o]=s}),n}postProcessPositionals(t,n,i,r){let o=Object.assign({},r.getOptions());o.default=Object.assign(i.default,o.default);for(let u of Object.keys(i.alias))o.alias[u]=(o.alias[u]||[]).concat(i.alias[u]);o.array=o.array.concat(i.array),o.config={};let s=[];if(Object.keys(n).forEach(u=>{n[u].map(d=>{o.configuration["unknown-options-as-args"]&&(o.key[u]=!0),s.push(`--${u}`),s.push(d)})}),!s.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),l=this.shim.Parser.detailed(s,Object.assign({},o,{configuration:a}));if(l.error)r.getInternalMethods().getUsageInstance().fail(l.error.message,l.error);else{let u=Object.keys(n);Object.keys(n).forEach(f=>{u.push(...l.aliases[f])});let d=r.getOptions().default;Object.keys(l.argv).forEach(f=>{u.includes(f)&&(n[f]||(n[f]=l.argv[f]),!Object.prototype.hasOwnProperty.call(d,f)&&Object.prototype.hasOwnProperty.call(t,f)&&Object.prototype.hasOwnProperty.call(l.argv,f)&&(Array.isArray(t[f])||Array.isArray(l.argv[f]))?t[f]=[].concat(t[f],l.argv[f]):t[f]=l.argv[f])})}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let i=on.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(i,this.defaultCommand.description)}let n=this.defaultCommand.builder;if(Qn(n))return n(t,!0);ao(n)||Object.keys(n).forEach(i=>{t.option(i,n[i])})}moduleName(t){let n=$i(t);if(!n)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(n.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:n,desc:i}){for(let r of[t,n,i]){if(typeof r=="string"||r===!1)return r;Pe(r,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();Pe(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function co(e,t,n,i){return new lo(e,t,n,i)}function ao(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function Kl(e){return e.every(t=>typeof t=="string")}function Qn(e){return typeof e=="function"}function Ql(e){return typeof e=="object"}function Jl(e){return typeof e=="object"&&!Array.isArray(e)}g();g();function ft(e={},t=()=>!0){let n={};return rn(e).forEach(i=>{t(i,e[i])&&(n[i]=e[i])}),n}g();function ut(e){typeof process!="undefined"&&[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(e)})}function Zl(e){return typeof e=="boolean"}function po(e,t){let n=t.y18n.__,i={},r=[];i.failFn=function(_){r.push(_)};let o=null,s=!0;i.showHelpOnFail=function(_=!0,T){function H(){return typeof _=="string"?[!0,_]:[_,T]}let[J,se]=H();return o=se,s=J,i};let a=!1;i.fail=function(_,T){let H=e.getInternalMethods().getLoggerInstance();if(r.length)for(let J=r.length-1;J>=0;--J){let se=r[J];if(Zl(se)){if(T)throw T;if(_)throw Error(_)}else se(_,T,i)}else{if(e.getExitProcess()&&ut(!0),a||(a=!0,s&&(e.showHelp("error"),H.error()),(_||T)&&H.error(_||T),o&&((_||T)&&H.error(""),H.error(o))),T=T||new Z(_),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,T);throw T}};let l=[],u=!1;i.usage=(F,_)=>F===null?(u=!0,l=[],i):(u=!1,l.push([F,_||""]),i),i.getUsage=()=>l,i.getUsageDisabled=()=>u,i.getPositionalGroupName=()=>n("Positionals:");let d=[];i.example=(F,_)=>{d.push([F,_||""])};let f=[];i.command=function(_,T,H,J,se=!1){H&&(f=f.map(z=>(z[2]=!1,z))),f.push([_,T||"",H,J,se])},i.getCommands=()=>f;let p={};i.describe=function(_,T){Array.isArray(_)?_.forEach(H=>{i.describe(H,T)}):typeof _=="object"?Object.keys(_).forEach(H=>{i.describe(H,_[H])}):p[_]=T},i.getDescriptions=()=>p;let y=[];i.epilog=F=>{y.push(F)};let C=!1,A;i.wrap=F=>{C=!0,A=F};function m(){return C||(A=en(),C=!0),A}let S="__yargsString__:";i.deferY18nLookup=F=>S+F,i.help=function(){if(B)return B;G();let _=e.customScriptName?e.$0:t.path.basename(e.$0),T=e.getDemandedOptions(),H=e.getDemandedCommands(),J=e.getDeprecatedOptions(),se=e.getGroups(),z=e.getOptions(),ue=[];ue=ue.concat(Object.keys(p)),ue=ue.concat(Object.keys(T)),ue=ue.concat(Object.keys(H)),ue=ue.concat(Object.keys(z.default)),ue=ue.filter(lt),ue=Object.keys(ue.reduce((U,ee)=>(ee!=="_"&&(U[ee]=!0),U),{}));let Mt=m(),ne=t.cliui({width:Mt,wrap:!!Mt});if(!u){if(l.length)l.forEach(U=>{ne.div({text:`${U[0].replace(/\$0/g,_)}`}),U[1]&&ne.div({text:`${U[1]}`,padding:[1,0,0,0]})}),ne.div();else if(f.length){let U=null;H._?U=`${_} <${n("command")}>
7
7
  `:U=`${_} [${n("command")}]
8
- `,ne.div(`${U}`)}}if(f.length>1||f.length===1&&!f[0][2]){ne.div(n("Commands:"));let U=e.getInternalMethods().getContext(),ee=U.commands.length?`${U.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(f=f.sort((q,re)=>q[0].localeCompare(re[0])));let ie=_?`${_} `:"";f.forEach(q=>{let re=`${ie}${ee}${q[0].replace(/^\$0 ?/,"")}`;ne.span({text:re,padding:[0,2,0,2],width:E(f,Mt,`${_}${ee}`)+4},{text:q[1]});let ae=[];q[2]&&ae.push(`[${n("default")}]`),q[3]&&q[3].length&&ae.push(`[${n("aliases:")} ${q[3].join(", ")}]`),q[4]&&(typeof q[4]=="string"?ae.push(`[${n("deprecated: %s",q[4])}]`):ae.push(`[${n("deprecated")}]`)),ae.length?ne.div({text:ae.join(" "),padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}let tt=(Object.keys(z.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);ue=ue.filter(U=>!e.parsed.newAliases[U]&&tt.every(ee=>(z.alias[ee]||[]).indexOf(U)===-1));let nt=n("Options:");se[nt]||(se[nt]=[]),V(ue,z.alias,se,nt);let Ft=U=>/^--/.test(Jn(U)),R=Object.keys(se).filter(U=>se[U].length>0).map(U=>{let ee=se[U].filter(lt).map(ie=>{if(tt.includes(ie))return ie;for(let q=0,re;(re=tt[q])!==void 0;q++)if((z.alias[re]||[]).includes(ie))return re;return ie});return{groupName:U,normalizedKeys:ee}}).filter(({normalizedKeys:U})=>U.length>0).map(({groupName:U,normalizedKeys:ee})=>{let ie=ee.reduce((q,re)=>(q[re]=[re].concat(z.alias[re]||[]).map(ae=>U===i.getPositionalGroupName()?ae:(/^[0-9]$/.test(ae)?z.boolean.includes(re)?"-":"--":ae.length>1?"--":"-")+ae).sort((ae,qe)=>Ft(ae)===Ft(qe)?0:Ft(ae)?1:-1).join(", "),q),{});return{groupName:U,normalizedKeys:ee,switches:ie}});if(R.filter(({groupName:U})=>U!==i.getPositionalGroupName()).some(({normalizedKeys:U,switches:ee})=>!U.every(ie=>Ft(ee[ie])))&&R.filter(({groupName:U})=>U!==i.getPositionalGroupName()).forEach(({normalizedKeys:U,switches:ee})=>{U.forEach(ie=>{Ft(ee[ie])&&(ee[ie]=Xl(ee[ie],"-x, ".length))})}),R.forEach(({groupName:U,normalizedKeys:ee,switches:ie})=>{ne.div(U),ee.forEach(q=>{let re=ie[q],ae=p[q]||"",qe=null;ae.includes(S)&&(ae=n(ae.substring(S.length))),z.boolean.includes(q)&&(qe=`[${n("boolean")}]`),z.count.includes(q)&&(qe=`[${n("count")}]`),z.string.includes(q)&&(qe=`[${n("string")}]`),z.normalize.includes(q)&&(qe=`[${n("string")}]`),z.array.includes(q)&&(qe=`[${n("array")}]`),z.number.includes(q)&&(qe=`[${n("number")}]`);let ze=h=>typeof h=="string"?`[${n("deprecated: %s",h)}]`:`[${n("deprecated")}]`,kn=[q in J?ze(J[q]):null,qe,q in T?`[${n("required")}]`:null,z.choices&&z.choices[q]?`[${n("choices:")} ${i.stringifiedValues(z.choices[q])}]`:null,Be(z.default[q],z.defaultDescription[q])].filter(Boolean).join(" ");ne.span({text:Jn(re),padding:[0,2,0,2+po(re)],width:E(ie,Mt)+4},ae),kn?ne.div({text:kn,padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}),d.length&&(ne.div(n("Examples:")),d.forEach(U=>{U[0]=U[0].replace(/\$0/g,_)}),d.forEach(U=>{U[1]===""?ne.div({text:U[0],padding:[0,2,0,2]}):ne.div({text:U[0],padding:[0,2,0,2],width:E(d,Mt)+4},{text:U[1]})}),ne.div()),y.length>0){let U=y.map(ee=>ee.replace(/\$0/g,_)).join(`
8
+ `,ne.div(`${U}`)}}if(f.length>1||f.length===1&&!f[0][2]){ne.div(n("Commands:"));let U=e.getInternalMethods().getContext(),ee=U.commands.length?`${U.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(f=f.sort((q,re)=>q[0].localeCompare(re[0])));let ie=_?`${_} `:"";f.forEach(q=>{let re=`${ie}${ee}${q[0].replace(/^\$0 ?/,"")}`;ne.span({text:re,padding:[0,2,0,2],width:E(f,Mt,`${_}${ee}`)+4},{text:q[1]});let ae=[];q[2]&&ae.push(`[${n("default")}]`),q[3]&&q[3].length&&ae.push(`[${n("aliases:")} ${q[3].join(", ")}]`),q[4]&&(typeof q[4]=="string"?ae.push(`[${n("deprecated: %s",q[4])}]`):ae.push(`[${n("deprecated")}]`)),ae.length?ne.div({text:ae.join(" "),padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}let tt=(Object.keys(z.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);ue=ue.filter(U=>!e.parsed.newAliases[U]&&tt.every(ee=>(z.alias[ee]||[]).indexOf(U)===-1));let nt=n("Options:");se[nt]||(se[nt]=[]),V(ue,z.alias,se,nt);let Ft=U=>/^--/.test(Jn(U)),R=Object.keys(se).filter(U=>se[U].length>0).map(U=>{let ee=se[U].filter(lt).map(ie=>{if(tt.includes(ie))return ie;for(let q=0,re;(re=tt[q])!==void 0;q++)if((z.alias[re]||[]).includes(ie))return re;return ie});return{groupName:U,normalizedKeys:ee}}).filter(({normalizedKeys:U})=>U.length>0).map(({groupName:U,normalizedKeys:ee})=>{let ie=ee.reduce((q,re)=>(q[re]=[re].concat(z.alias[re]||[]).map(ae=>U===i.getPositionalGroupName()?ae:(/^[0-9]$/.test(ae)?z.boolean.includes(re)?"-":"--":ae.length>1?"--":"-")+ae).sort((ae,qe)=>Ft(ae)===Ft(qe)?0:Ft(ae)?1:-1).join(", "),q),{});return{groupName:U,normalizedKeys:ee,switches:ie}});if(R.filter(({groupName:U})=>U!==i.getPositionalGroupName()).some(({normalizedKeys:U,switches:ee})=>!U.every(ie=>Ft(ee[ie])))&&R.filter(({groupName:U})=>U!==i.getPositionalGroupName()).forEach(({normalizedKeys:U,switches:ee})=>{U.forEach(ie=>{Ft(ee[ie])&&(ee[ie]=Xl(ee[ie],4))})}),R.forEach(({groupName:U,normalizedKeys:ee,switches:ie})=>{ne.div(U),ee.forEach(q=>{let re=ie[q],ae=p[q]||"",qe=null;ae.includes(S)&&(ae=n(ae.substring(S.length))),z.boolean.includes(q)&&(qe=`[${n("boolean")}]`),z.count.includes(q)&&(qe=`[${n("count")}]`),z.string.includes(q)&&(qe=`[${n("string")}]`),z.normalize.includes(q)&&(qe=`[${n("string")}]`),z.array.includes(q)&&(qe=`[${n("array")}]`),z.number.includes(q)&&(qe=`[${n("number")}]`);let ze=h=>typeof h=="string"?`[${n("deprecated: %s",h)}]`:`[${n("deprecated")}]`,kn=[q in J?ze(J[q]):null,qe,q in T?`[${n("required")}]`:null,z.choices&&z.choices[q]?`[${n("choices:")} ${i.stringifiedValues(z.choices[q])}]`:null,Be(z.default[q],z.defaultDescription[q])].filter(Boolean).join(" ");ne.span({text:Jn(re),padding:[0,2,0,2+uo(re)],width:E(ie,Mt)+4},ae),kn?ne.div({text:kn,padding:[0,0,0,2],align:"right"}):ne.div()}),ne.div()}),d.length&&(ne.div(n("Examples:")),d.forEach(U=>{U[0]=U[0].replace(/\$0/g,_)}),d.forEach(U=>{U[1]===""?ne.div({text:U[0],padding:[0,2,0,2]}):ne.div({text:U[0],padding:[0,2,0,2],width:E(d,Mt)+4},{text:U[1]})}),ne.div()),y.length>0){let U=y.map(ee=>ee.replace(/\$0/g,_)).join(`
9
9
  `);ne.div(`${U}
10
- `)}return ne.toString().replace(/\s*$/,"")};function E(M,_,T){let H=0;return Array.isArray(M)||(M=Object.values(M).map(J=>[J])),M.forEach(J=>{H=Math.max(t.stringWidth(T?`${T} ${Jn(J[0])}`:Jn(J[0]))+po(J[0]),H)}),_&&(H=Math.min(H,parseInt((_*.5).toString(),10))),H}function G(){let M=e.getDemandedOptions(),_=e.getOptions();(Object.keys(_.alias)||[]).forEach(T=>{_.alias[T].forEach(H=>{p[H]&&i.describe(T,p[H]),H in M&&e.demandOption(T,M[H]),_.boolean.includes(H)&&e.boolean(T),_.count.includes(H)&&e.count(T),_.string.includes(H)&&e.string(T),_.normalize.includes(H)&&e.normalize(T),_.array.includes(H)&&e.array(T),_.number.includes(H)&&e.number(T)})})}let B;i.cacheHelpMessage=function(){B=this.help()},i.clearCachedHelpMessage=function(){B=void 0},i.hasCachedHelpMessage=function(){return!!B};function V(M,_,T,H){let J=[],se=null;return Object.keys(T).forEach(z=>{J=J.concat(T[z])}),M.forEach(z=>{se=[z].concat(_[z]),se.some(ue=>J.indexOf(ue)!==-1)||T[H].push(z)}),J}function lt(M){return e.getOptions().hiddenOptions.indexOf(M)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}i.showHelp=M=>{let _=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:_[M])(i.help())},i.functionDescription=M=>{let _=M.name?t.Parser.decamelize(M.name,"-"):n("generated-value");return["(",_,")"].join("")},i.stringifiedValues=function(_,T){let H="",J=T||", ",se=[].concat(_);return!_||!se.length||se.forEach(z=>{H.length&&(H+=J),H+=JSON.stringify(z)}),H};function Be(M,_){let T=`[${n("default:")} `;if(M===void 0&&!_)return null;if(_)T+=_;else switch(typeof M){case"string":T+=`"${M}"`;break;case"object":T+=JSON.stringify(M);break;default:T+=M}return`${T}]`}function en(){let M=80;return t.process.stdColumns?Math.min(M,t.process.stdColumns):M}let It=null;i.version=M=>{It=M},i.showVersion=M=>{let _=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:_[M])(It)},i.reset=function(_){return o=null,a=!1,l=[],u=!1,y=[],d=[],f=[],p=ft(p,T=>!_[T]),i};let Q=[];return i.freeze=function(){Q.push({failMessage:o,failureOutput:a,usages:l,usageDisabled:u,epilogs:y,examples:d,commands:f,descriptions:p})},i.unfreeze=function(){let _=Q.pop();!_||({failMessage:o,failureOutput:a,usages:l,usageDisabled:u,epilogs:y,examples:d,commands:f,descriptions:p}=_)},i}function Wi(e){return typeof e=="object"}function Xl(e,t){return Wi(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function po(e){return Wi(e)?e.indentation:0}function Jn(e){return Wi(e)?e.text:e}g();g();var ho=`###-begin-{{app_name}}-completions-###
10
+ `)}return ne.toString().replace(/\s*$/,"")};function E(F,_,T){let H=0;return Array.isArray(F)||(F=Object.values(F).map(J=>[J])),F.forEach(J=>{H=Math.max(t.stringWidth(T?`${T} ${Jn(J[0])}`:Jn(J[0]))+uo(J[0]),H)}),_&&(H=Math.min(H,parseInt((_*.5).toString(),10))),H}function G(){let F=e.getDemandedOptions(),_=e.getOptions();(Object.keys(_.alias)||[]).forEach(T=>{_.alias[T].forEach(H=>{p[H]&&i.describe(T,p[H]),H in F&&e.demandOption(T,F[H]),_.boolean.includes(H)&&e.boolean(T),_.count.includes(H)&&e.count(T),_.string.includes(H)&&e.string(T),_.normalize.includes(H)&&e.normalize(T),_.array.includes(H)&&e.array(T),_.number.includes(H)&&e.number(T)})})}let B;i.cacheHelpMessage=function(){B=this.help()},i.clearCachedHelpMessage=function(){B=void 0},i.hasCachedHelpMessage=function(){return!!B};function V(F,_,T,H){let J=[],se=null;return Object.keys(T).forEach(z=>{J=J.concat(T[z])}),F.forEach(z=>{se=[z].concat(_[z]),se.some(ue=>J.indexOf(ue)!==-1)||T[H].push(z)}),J}function lt(F){return e.getOptions().hiddenOptions.indexOf(F)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}i.showHelp=F=>{let _=e.getInternalMethods().getLoggerInstance();F||(F="error"),(typeof F=="function"?F:_[F])(i.help())},i.functionDescription=F=>{let _=F.name?t.Parser.decamelize(F.name,"-"):n("generated-value");return["(",_,")"].join("")},i.stringifiedValues=function(_,T){let H="",J=T||", ",se=[].concat(_);return!_||!se.length||se.forEach(z=>{H.length&&(H+=J),H+=JSON.stringify(z)}),H};function Be(F,_){let T=`[${n("default:")} `;if(F===void 0&&!_)return null;if(_)T+=_;else switch(typeof F){case"string":T+=`"${F}"`;break;case"object":T+=JSON.stringify(F);break;default:T+=F}return`${T}]`}function en(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let It=null;i.version=F=>{It=F},i.showVersion=F=>{let _=e.getInternalMethods().getLoggerInstance();F||(F="error"),(typeof F=="function"?F:_[F])(It)},i.reset=function(_){return o=null,a=!1,l=[],u=!1,y=[],d=[],f=[],p=ft(p,T=>!_[T]),i};let Q=[];return i.freeze=function(){Q.push({failMessage:o,failureOutput:a,usages:l,usageDisabled:u,epilogs:y,examples:d,commands:f,descriptions:p})},i.unfreeze=function(){let _=Q.pop();!_||({failMessage:o,failureOutput:a,usages:l,usageDisabled:u,epilogs:y,examples:d,commands:f,descriptions:p}=_)},i}function Wi(e){return typeof e=="object"}function Xl(e,t){return Wi(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function uo(e){return Wi(e)?e.indentation:0}function Jn(e){return Wi(e)?e.text:e}g();g();var ho=`###-begin-{{app_name}}-completions-###
11
11
  #
12
12
  # yargs command completion script
13
13
  #
@@ -58,43 +58,43 @@ compdef _{{app_name}}_yargs_completions {{app_name}}
58
58
  ${C.join(`
59
59
  `)}`:"";t.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(y).length,Object.keys(y).join(", ")+A))}},o.unknownArguments=function(f,p,y,C,A=!0){var m;let S=e.getInternalMethods().getCommandInstance().getCommands(),E=[],G=e.getInternalMethods().getContext();if(Object.keys(f).forEach(B=>{!wo.includes(B)&&!Object.prototype.hasOwnProperty.call(y,B)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),B)&&!o.isValidAndSomeAliasIsNotNew(B,p)&&E.push(B)}),A&&(G.commands.length>0||S.length>0||C)&&f._.slice(G.commands.length).forEach(B=>{S.includes(""+B)||E.push(""+B)}),A){let V=((m=e.getDemandedCommands()._)===null||m===void 0?void 0:m.max)||0,lt=G.commands.length+V;lt<f._.length&&f._.slice(lt).forEach(Be=>{Be=String(Be),!G.commands.includes(Be)&&!E.includes(Be)&&E.push(Be)})}E.length&&t.fail(r("Unknown argument: %s","Unknown arguments: %s",E.length,E.join(", ")))},o.unknownCommands=function(f){let p=e.getInternalMethods().getCommandInstance().getCommands(),y=[],C=e.getInternalMethods().getContext();return(C.commands.length>0||p.length>0)&&f._.slice(C.commands.length).forEach(A=>{p.includes(""+A)||y.push(""+A)}),y.length>0?(t.fail(r("Unknown command: %s","Unknown commands: %s",y.length,y.join(", "))),!0):!1},o.isValidAndSomeAliasIsNotNew=function(f,p){if(!Object.prototype.hasOwnProperty.call(p,f))return!1;let y=e.parsed.newAliases;return[f,...p[f]].some(C=>!Object.prototype.hasOwnProperty.call(y,C)||!y[f])},o.limitedChoices=function(f){let p=e.getOptions(),y={};if(!Object.keys(p.choices).length)return;Object.keys(f).forEach(m=>{wo.indexOf(m)===-1&&Object.prototype.hasOwnProperty.call(p.choices,m)&&[].concat(f[m]).forEach(S=>{p.choices[m].indexOf(S)===-1&&S!==void 0&&(y[m]=(y[m]||[]).concat(S))})});let C=Object.keys(y);if(!C.length)return;let A=i("Invalid values:");C.forEach(m=>{A+=`
60
60
  ${i("Argument: %s, Given: %s, Choices: %s",m,t.stringifiedValues(y[m]),t.stringifiedValues(p.choices[m]))}`}),t.fail(A)};let s={};o.implies=function(f,p){j("<string|object> [array|number|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(y=>{o.implies(y,f[y])}):(e.global(f),s[f]||(s[f]=[]),Array.isArray(p)?p.forEach(y=>o.implies(f,y)):(Pe(p,void 0,n),s[f].push(p)))},o.getImplied=function(){return s};function a(d,f){let p=Number(f);return f=isNaN(p)?f:p,typeof f=="number"?f=d._.length>=f:f.match(/^--no-.+/)?(f=f.match(/^--no-(.+)/)[1],f=!Object.prototype.hasOwnProperty.call(d,f)):f=Object.prototype.hasOwnProperty.call(d,f),f}o.implications=function(f){let p=[];if(Object.keys(s).forEach(y=>{let C=y;(s[y]||[]).forEach(A=>{let m=C,S=A;m=a(f,m),A=a(f,A),m&&!A&&p.push(` ${C} -> ${S}`)})}),p.length){let y=`${i("Implications failed:")}
61
- `;p.forEach(C=>{y+=C}),t.fail(y)}};let l={};o.conflicts=function(f,p){j("<string|object> [array|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(y=>{o.conflicts(y,f[y])}):(e.global(f),l[f]||(l[f]=[]),Array.isArray(p)?p.forEach(y=>o.conflicts(f,y)):l[f].push(p))},o.getConflicting=()=>l,o.conflicting=function(f){Object.keys(f).forEach(p=>{l[p]&&l[p].forEach(y=>{y&&f[p]!==void 0&&f[y]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,y))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(p=>{l[p].forEach(y=>{y&&f[n.Parser.camelCase(p)]!==void 0&&f[n.Parser.camelCase(y)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,y))})})},o.recommendCommands=function(f,p){let y=3;p=p.sort((m,S)=>S.length-m.length);let C=null,A=1/0;for(let m=0,S;(S=p[m])!==void 0;m++){let E=bo(f,S);E<=y&&E<A&&(A=E,C=S)}C&&t.fail(i("Did you mean %s?",C))},o.reset=function(f){return s=ft(s,p=>!f[p]),l=ft(l,p=>!f[p]),o};let u=[];return o.freeze=function(){u.push({implied:s,conflicting:l})},o.unfreeze=function(){let f=u.pop();Pe(f,void 0,n),{implied:s,conflicting:l}=f},o}g();var ki=[],On;function Zn(e,t,n,i){On=i;let r={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return r;let o=/\.json|\..*rc$/.test(e.extends),s=null;if(o)s=rc(t,e.extends);else try{s=require.resolve(e.extends)}catch(a){return e}ic(s),ki.push(s),r=o?JSON.parse(On.readFileSync(s,"utf8")):require(e.extends),delete e.extends,r=Zn(r,On.path.dirname(s),n,On)}return ki=[],n?xo(r,e):Object.assign({},r,e)}function ic(e){if(ki.indexOf(e)>-1)throw new Z(`Circular extended configurations: '${e}'.`)}function rc(e,t){return On.path.resolve(e,t)}function xo(e,t){let n={};function i(r){return r&&typeof r=="object"&&!Array.isArray(r)}Object.assign(n,e);for(let r of Object.keys(t))i(t[r])&&i(n[r])?n[r]=xo(e[r],t[r]):n[r]=t[r];return n}var I=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},c=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},le,Tt,vn,We,Ne,Xn,dt,Ut,ei,ke,ti,He,Ze,Te,Ye,sn,he,L,ni,ii,Ue,Rt,an,$t,pt,ri,$,Wt,kt,Ht,Y,Xe,oe;function Co(e){return(t=[],n=e.process.cwd(),i)=>{let r=new Wo(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Oo=Symbol("copyDoubleDash"),vo=Symbol("copyDoubleDash"),Hi=Symbol("deleteFromParserHintObject"),Eo=Symbol("emitWarning"),_o=Symbol("freeze"),So=Symbol("getDollarZero"),Yt=Symbol("getParserConfiguration"),Yi=Symbol("guessLocale"),Po=Symbol("guessVersion"),jo=Symbol("parsePositionalNumbers"),Gi=Symbol("pkgUp"),ht=Symbol("populateParserHintArray"),ln=Symbol("populateParserHintSingleValueDictionary"),Bi=Symbol("populateParserHintArrayDictionary"),qi=Symbol("populateParserHintDictionary"),zi=Symbol("sanitizeKey"),Vi=Symbol("setKey"),Ki=Symbol("unfreeze"),Io=Symbol("validateAsync"),Mo=Symbol("getCommandInstance"),Fo=Symbol("getContext"),Lo=Symbol("getHasOutput"),Do=Symbol("getLoggerInstance"),No=Symbol("getParseContext"),To=Symbol("getUsageInstance"),Uo=Symbol("getValidationInstance"),oi=Symbol("hasParseCallback"),Gt=Symbol("postProcess"),Ro=Symbol("rebase"),Qi=Symbol("reset"),En=Symbol("runYargsParserAndExecuteCommands"),Ji=Symbol("runValidation"),$o=Symbol("setHasOutput"),Bt=Symbol("kTrackManuallySetKeys"),Wo=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,le.set(this,void 0),Tt.set(this,void 0),vn.set(this,{commands:[],fullCommands:[]}),We.set(this,null),Ne.set(this,null),Xn.set(this,"show-hidden"),dt.set(this,null),Ut.set(this,!0),ei.set(this,{}),ke.set(this,!0),ti.set(this,[]),He.set(this,void 0),Ze.set(this,{}),Te.set(this,!1),Ye.set(this,null),sn.set(this,void 0),he.set(this,""),L.set(this,void 0),ni.set(this,void 0),ii.set(this,{}),Ue.set(this,null),Rt.set(this,null),an.set(this,{}),$t.set(this,{}),pt.set(this,void 0),ri.set(this,!1),$.set(this,void 0),Wt.set(this,!1),kt.set(this,!1),Ht.set(this,!1),Y.set(this,void 0),Xe.set(this,null),oe.set(this,void 0),I(this,$,r,"f"),I(this,pt,t,"f"),I(this,Tt,n,"f"),I(this,ni,i,"f"),I(this,He,new Ri(this),"f"),this.$0=this[So](),this[Qi](),I(this,le,c(this,le,"f"),"f"),I(this,Y,c(this,Y,"f"),"f"),I(this,oe,c(this,oe,"f"),"f"),I(this,L,c(this,L,"f"),"f"),c(this,L,"f").showHiddenOpt=c(this,Xn,"f"),I(this,sn,this[vo](),"f")}addHelpOpt(t,n){let i="help";return j("[string|boolean] [string]",[t,n],arguments.length),c(this,Ye,"f")&&(this[Hi](c(this,Ye,"f")),I(this,Ye,null,"f")),t===!1&&n===void 0?this:(I(this,Ye,typeof t=="string"?t:i,"f"),this.boolean(c(this,Ye,"f")),this.describe(c(this,Ye,"f"),n||c(this,Y,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(j("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let i=typeof t=="string"?t:c(this,Xn,"f");return this.boolean(i),this.describe(i,n||c(this,Y,"f").deferY18nLookup("Show hidden options")),c(this,L,"f").showHiddenOpt=i,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[Bi](this.alias.bind(this),"alias",t,n),this}array(t){return j("<array|string>",[t],arguments.length),this[ht]("array",t),this[Bt](t),this}boolean(t){return j("<array|string>",[t],arguments.length),this[ht]("boolean",t),this[Bt](t),this}check(t,n){return j("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>Nt(()=>t(i,r.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&c(this,Y,"f").fail(o.toString(),o):c(this,Y,"f").fail(c(this,$,"f").y18n.__("Argument check failed: %s",t.toString())),i),o=>(c(this,Y,"f").fail(o.message?o.message:o.toString(),o),i)),!1,n),this}choices(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[Bi](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(j("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new Z("coerce callback must be provided");for(let i of t)this.coerce(i,n);return this}else if(typeof t=="object"){for(let i of Object.keys(t))this.coerce(i,t[i]);return this}if(!n)throw new Z("coerce callback must be provided");return c(this,L,"f").key[t]=!0,c(this,He,"f").addCoerceMiddleware((i,r)=>{let o;return Nt(()=>(o=r.getAliases(),n(i[t])),s=>{if(i[t]=s,o[t])for(let a of o[t])i[a]=s;return i},s=>{throw new Z(s.message)})},t),this}conflicts(t,n){return j("<string|object> [string|array]",[t,n],arguments.length),c(this,oe,"f").conflicts(t,n),this}config(t="config",n,i){return j("[object|string] [string|function] [function]",[t,n,i],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=Zn(t,c(this,Tt,"f"),this[Yt]()["deep-merge-config"]||!1,c(this,$,"f")),c(this,L,"f").configObjects=(c(this,L,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(i=n,n=void 0),this.describe(t,n||c(this,Y,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{c(this,L,"f").config[r]=i||!0}),this)}completion(t,n,i){return j("[string] [string|boolean|function] [function]",[t,n,i],arguments.length),typeof n=="function"&&(i=n,n=void 0),I(this,Ne,t||c(this,Ne,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(c(this,Ne,"f"),n),i&&c(this,We,"f").registerFunction(i),this}command(t,n,i,r,o,s){return j("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,i,r,o,s],arguments.length),c(this,le,"f").addHandler(t,n,i,r,o,s),this}commands(t,n,i,r,o,s){return this.command(t,n,i,r,o,s)}commandDir(t,n){j("<string> [object]",[t,n],arguments.length);let i=c(this,ni,"f")||c(this,$,"f").require;return c(this,le,"f").addDirectory(t,i,c(this,$,"f").getCallerFile(),n),this}count(t){return j("<array|string>",[t],arguments.length),this[ht]("count",t),this[Bt](t),this}default(t,n,i){return j("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(Ui(t,c(this,$,"f")),c(this,L,"f").defaultDescription[t]=i),typeof n=="function"&&(Ui(t,c(this,$,"f")),c(this,L,"f").defaultDescription[t]||(c(this,L,"f").defaultDescription[t]=c(this,Y,"f").functionDescription(n)),n=n.call()),this[ln](this.default.bind(this),"default",t,n),this}defaults(t,n,i){return this.default(t,n,i)}demandCommand(t=1,n,i,r){return j("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,i,r],arguments.length),typeof n!="number"&&(i=n,n=1/0),this.global("_",!1),c(this,L,"f").demandedCommands._={min:t,max:n,minMsg:i,maxMsg:r},this}demand(t,n,i){return Array.isArray(n)?(n.forEach(r=>{Pe(i,!0,c(this,$,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(Pe(i,!0,c(this,$,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{Pe(i,!0,c(this,$,"f")),this.demandOption(r,i)}):typeof i=="string"?this.demandOption(t,i):(i===!0||typeof i=="undefined")&&this.demandOption(t),this}demandOption(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[ln](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return j("<string> [string|boolean]",[t,n],arguments.length),c(this,L,"f").deprecatedOptions[t]=n,this}describe(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[Vi](t,!0),c(this,Y,"f").describe(t,n),this}detectLocale(t){return j("<boolean>",[t],arguments.length),I(this,Ut,t,"f"),this}env(t){return j("[string|boolean]",[t],arguments.length),t===!1?delete c(this,L,"f").envPrefix:c(this,L,"f").envPrefix=t||"",this}epilogue(t){return j("<string>",[t],arguments.length),c(this,Y,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return j("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(i=>this.example(...i)):c(this,Y,"f").example(t,n),this}exit(t,n){I(this,Te,!0,"f"),I(this,dt,n,"f"),c(this,ke,"f")&&c(this,$,"f").process.exit(t)}exitProcess(t=!0){return j("[boolean]",[t],arguments.length),I(this,ke,t,"f"),this}fail(t){if(j("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new Z("Invalid first argument. Expected function or boolean 'false'");return c(this,Y,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return j("<array> [function]",[t,n],arguments.length),n?c(this,We,"f").getCompletion(t,n):new Promise((i,r)=>{c(this,We,"f").getCompletion(t,(o,s)=>{o?r(o):i(s)})})}getDemandedOptions(){return j([],0),c(this,L,"f").demandedOptions}getDemandedCommands(){return j([],0),c(this,L,"f").demandedCommands}getDeprecatedOptions(){return j([],0),c(this,L,"f").deprecatedOptions}getDetectLocale(){return c(this,Ut,"f")}getExitProcess(){return c(this,ke,"f")}getGroups(){return Object.assign({},c(this,Ze,"f"),c(this,$t,"f"))}getHelp(){if(I(this,Te,!0,"f"),!c(this,Y,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[En](c(this,pt,"f"),void 0,void 0,0,!0);if(te(n))return n.then(()=>c(this,Y,"f").help())}let t=c(this,le,"f").runDefaultBuilderOn(this);if(te(t))return t.then(()=>c(this,Y,"f").help())}return Promise.resolve(c(this,Y,"f").help())}getOptions(){return c(this,L,"f")}getStrict(){return c(this,Wt,"f")}getStrictCommands(){return c(this,kt,"f")}getStrictOptions(){return c(this,Ht,"f")}global(t,n){return j("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?c(this,L,"f").local=c(this,L,"f").local.filter(i=>t.indexOf(i)===-1):t.forEach(i=>{c(this,L,"f").local.includes(i)||c(this,L,"f").local.push(i)}),this}group(t,n){j("<string|array> <string>",[t,n],arguments.length);let i=c(this,$t,"f")[n]||c(this,Ze,"f")[n];c(this,$t,"f")[n]&&delete c(this,$t,"f")[n];let r={};return c(this,Ze,"f")[n]=(i||[]).concat(t).filter(o=>r[o]?!1:r[o]=!0),this}hide(t){return j("<string>",[t],arguments.length),c(this,L,"f").hiddenOptions.push(t),this}implies(t,n){return j("<string|object> [number|string|array]",[t,n],arguments.length),c(this,oe,"f").implies(t,n),this}locale(t){return j("[string]",[t],arguments.length),t?(I(this,Ut,!1,"f"),c(this,$,"f").y18n.setLocale(t),this):(this[Yi](),c(this,$,"f").y18n.getLocale())}middleware(t,n,i){return c(this,He,"f").addMiddleware(t,!!n,i)}nargs(t,n){return j("<string|object|array> [number]",[t,n],arguments.length),this[ln](this.nargs.bind(this),"narg",t,n),this}normalize(t){return j("<array|string>",[t],arguments.length),this[ht]("normalize",t),this}number(t){return j("<array|string>",[t],arguments.length),this[ht]("number",t),this[Bt](t),this}option(t,n){if(j("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(i=>{this.options(i,t[i])});else{typeof n!="object"&&(n={}),this[Bt](t),c(this,Xe,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[Eo](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
62
- `),void 0,"versionWarning"),c(this,L,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let i=n.deprecate||n.deprecated;i&&this.deprecateOption(t,i);let r=n.demand||n.required||n.require;r&&this.demand(t,r),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&&(c(this,L,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let o=n.describe||n.description||n.desc;this.describe(t,o),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,i){j("[string|array] [function|boolean|object] [function]",[t,n,i],arguments.length),this[_o](),typeof t=="undefined"&&(t=c(this,pt,"f")),typeof n=="object"&&(I(this,Rt,n,"f"),n=i),typeof n=="function"&&(I(this,Ue,n,"f"),n=!1),n||I(this,pt,t,"f"),c(this,Ue,"f")&&I(this,ke,!1,"f");let r=this[En](t,!!n),o=this.parsed;return c(this,We,"f").setParsed(this.parsed),te(r)?r.then(s=>(c(this,Ue,"f")&&c(this,Ue,"f").call(this,c(this,dt,"f"),s,c(this,he,"f")),s)).catch(s=>{throw c(this,Ue,"f")&&c(this,Ue,"f")(s,this.parsed.argv,c(this,he,"f")),s}).finally(()=>{this[Ki](),this.parsed=o}):(c(this,Ue,"f")&&c(this,Ue,"f").call(this,c(this,dt,"f"),r,c(this,he,"f")),this[Ki](),this.parsed=o,r)}parseAsync(t,n,i){let r=this.parse(t,n,i);return te(r)?r:Promise.resolve(r)}parseSync(t,n,i){let r=this.parse(t,n,i);if(te(r))throw new Z(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(t){return j("<object>",[t],arguments.length),I(this,ii,t,"f"),this}pkgConf(t,n){j("<string> [string]",[t,n],arguments.length);let i=null,r=this[Gi](n||c(this,Tt,"f"));return r[t]&&typeof r[t]=="object"&&(i=Zn(r[t],n||c(this,Tt,"f"),this[Yt]()["deep-merge-config"]||!1,c(this,$,"f")),c(this,L,"f").configObjects=(c(this,L,"f").configObjects||[]).concat(i)),this}positional(t,n){j("<string> <object>",[t,n],arguments.length);let i=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=ft(n,(s,a)=>s==="type"&&!["string","number","boolean"].includes(a)?!1:i.includes(s));let r=c(this,vn,"f").fullCommands[c(this,vn,"f").fullCommands.length-1],o=r?c(this,le,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return rn(o).forEach(s=>{let a=o[s];Array.isArray(a)?a.indexOf(t)!==-1&&(n[s]=!0):a[t]&&!(s in n)&&(n[s]=a[t])}),this.group(t,c(this,Y,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return j("[boolean]",[t],arguments.length),I(this,ri,t,"f"),this}required(t,n,i){return this.demand(t,n,i)}require(t,n,i){return this.demand(t,n,i)}requiresArg(t){return j("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&c(this,L,"f").narg[t]?this:(this[ln](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return j("[string] [string]",[t,n],arguments.length),t=t||this.$0,c(this,sn,"f").log(c(this,We,"f").generateCompletionScript(t,n||c(this,Ne,"f")||"completion")),this}showHelp(t){if(j("[string|function]",[t],arguments.length),I(this,Te,!0,"f"),!c(this,Y,"f").hasCachedHelpMessage()){if(!this.parsed){let i=this[En](c(this,pt,"f"),void 0,void 0,0,!0);if(te(i))return i.then(()=>{c(this,Y,"f").showHelp(t)}),this}let n=c(this,le,"f").runDefaultBuilderOn(this);if(te(n))return n.then(()=>{c(this,Y,"f").showHelp(t)}),this}return c(this,Y,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return j("[boolean|string] [string]",[t,n],arguments.length),c(this,Y,"f").showHelpOnFail(t,n),this}showVersion(t){return j("[string|function]",[t],arguments.length),c(this,Y,"f").showVersion(t),this}skipValidation(t){return j("<array|string>",[t],arguments.length),this[ht]("skipValidation",t),this}strict(t){return j("[boolean]",[t],arguments.length),I(this,Wt,t!==!1,"f"),this}strictCommands(t){return j("[boolean]",[t],arguments.length),I(this,kt,t!==!1,"f"),this}strictOptions(t){return j("[boolean]",[t],arguments.length),I(this,Ht,t!==!1,"f"),this}string(t){return j("<array|string>",[t],arguments.length),this[ht]("string",t),this[Bt](t),this}terminalWidth(){return j([],0),c(this,$,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return j("<object>",[t],arguments.length),I(this,Ut,!1,"f"),c(this,$,"f").y18n.updateLocale(t),this}usage(t,n,i,r){if(j("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,i,r],arguments.length),n!==void 0){if(Pe(t,null,c(this,$,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,i,r);throw new Z(".usage() description must start with $0 if being used as alias for .command()")}else return c(this,Y,"f").usage(t),this}version(t,n,i){let r="version";if(j("[boolean|string] [string] [string]",[t,n,i],arguments.length),c(this,Xe,"f")&&(this[Hi](c(this,Xe,"f")),c(this,Y,"f").version(void 0),I(this,Xe,null,"f")),arguments.length===0)i=this[Po](),t=r;else if(arguments.length===1){if(t===!1)return this;i=t,t=r}else arguments.length===2&&(i=n,n=void 0);return I(this,Xe,typeof t=="string"?t:r,"f"),n=n||c(this,Y,"f").deferY18nLookup("Show version number"),c(this,Y,"f").version(i||void 0),this.boolean(c(this,Xe,"f")),this.describe(c(this,Xe,"f"),n),this}wrap(t){return j("<number|null|undefined>",[t],arguments.length),c(this,Y,"f").wrap(t),this}[(le=new WeakMap,Tt=new WeakMap,vn=new WeakMap,We=new WeakMap,Ne=new WeakMap,Xn=new WeakMap,dt=new WeakMap,Ut=new WeakMap,ei=new WeakMap,ke=new WeakMap,ti=new WeakMap,He=new WeakMap,Ze=new WeakMap,Te=new WeakMap,Ye=new WeakMap,sn=new WeakMap,he=new WeakMap,L=new WeakMap,ni=new WeakMap,ii=new WeakMap,Ue=new WeakMap,Rt=new WeakMap,an=new WeakMap,$t=new WeakMap,pt=new WeakMap,ri=new WeakMap,$=new WeakMap,Wt=new WeakMap,kt=new WeakMap,Ht=new WeakMap,Y=new WeakMap,Xe=new WeakMap,oe=new WeakMap,Oo)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[vo](){return{log:(...t)=>{this[oi]()||console.log(...t),I(this,Te,!0,"f"),c(this,he,"f").length&&I(this,he,c(this,he,"f")+`
61
+ `;p.forEach(C=>{y+=C}),t.fail(y)}};let l={};o.conflicts=function(f,p){j("<string|object> [array|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(y=>{o.conflicts(y,f[y])}):(e.global(f),l[f]||(l[f]=[]),Array.isArray(p)?p.forEach(y=>o.conflicts(f,y)):l[f].push(p))},o.getConflicting=()=>l,o.conflicting=function(f){Object.keys(f).forEach(p=>{l[p]&&l[p].forEach(y=>{y&&f[p]!==void 0&&f[y]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,y))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach(p=>{l[p].forEach(y=>{y&&f[n.Parser.camelCase(p)]!==void 0&&f[n.Parser.camelCase(y)]!==void 0&&t.fail(i("Arguments %s and %s are mutually exclusive",p,y))})})},o.recommendCommands=function(f,p){p=p.sort((m,S)=>S.length-m.length);let C=null,A=1/0;for(let m=0,S;(S=p[m])!==void 0;m++){let E=bo(f,S);E<=3&&E<A&&(A=E,C=S)}C&&t.fail(i("Did you mean %s?",C))},o.reset=function(f){return s=ft(s,p=>!f[p]),l=ft(l,p=>!f[p]),o};let u=[];return o.freeze=function(){u.push({implied:s,conflicting:l})},o.unfreeze=function(){let f=u.pop();Pe(f,void 0,n),{implied:s,conflicting:l}=f},o}g();var ki=[],On;function Zn(e,t,n,i){On=i;let r={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return r;let o=/\.json|\..*rc$/.test(e.extends),s=null;if(o)s=rc(t,e.extends);else try{s=require.resolve(e.extends)}catch(a){return e}ic(s),ki.push(s),r=o?JSON.parse(On.readFileSync(s,"utf8")):require(e.extends),delete e.extends,r=Zn(r,On.path.dirname(s),n,On)}return ki=[],n?xo(r,e):Object.assign({},r,e)}function ic(e){if(ki.indexOf(e)>-1)throw new Z(`Circular extended configurations: '${e}'.`)}function rc(e,t){return On.path.resolve(e,t)}function xo(e,t){let n={};function i(r){return r&&typeof r=="object"&&!Array.isArray(r)}Object.assign(n,e);for(let r of Object.keys(t))i(t[r])&&i(n[r])?n[r]=xo(e[r],t[r]):n[r]=t[r];return n}var I=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},c=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},le,Tt,vn,We,Ne,Xn,dt,Ut,ei,ke,ti,He,Ze,Te,Ye,sn,he,L,ni,ii,Ue,Rt,an,$t,pt,ri,$,Wt,kt,Ht,Y,Xe,oe;function $o(e){return(t=[],n=e.process.cwd(),i)=>{let r=new Wo(t,n,i,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Co=Symbol("copyDoubleDash"),Oo=Symbol("copyDoubleDash"),Hi=Symbol("deleteFromParserHintObject"),vo=Symbol("emitWarning"),Eo=Symbol("freeze"),_o=Symbol("getDollarZero"),Yt=Symbol("getParserConfiguration"),Yi=Symbol("guessLocale"),So=Symbol("guessVersion"),Po=Symbol("parsePositionalNumbers"),Gi=Symbol("pkgUp"),ht=Symbol("populateParserHintArray"),ln=Symbol("populateParserHintSingleValueDictionary"),Bi=Symbol("populateParserHintArrayDictionary"),qi=Symbol("populateParserHintDictionary"),zi=Symbol("sanitizeKey"),Vi=Symbol("setKey"),Ki=Symbol("unfreeze"),jo=Symbol("validateAsync"),Io=Symbol("getCommandInstance"),Mo=Symbol("getContext"),Fo=Symbol("getHasOutput"),Lo=Symbol("getLoggerInstance"),Do=Symbol("getParseContext"),No=Symbol("getUsageInstance"),To=Symbol("getValidationInstance"),oi=Symbol("hasParseCallback"),Gt=Symbol("postProcess"),Uo=Symbol("rebase"),Qi=Symbol("reset"),En=Symbol("runYargsParserAndExecuteCommands"),Ji=Symbol("runValidation"),Ro=Symbol("setHasOutput"),Bt=Symbol("kTrackManuallySetKeys"),Wo=class{constructor(t=[],n,i,r){this.customScriptName=!1,this.parsed=!1,le.set(this,void 0),Tt.set(this,void 0),vn.set(this,{commands:[],fullCommands:[]}),We.set(this,null),Ne.set(this,null),Xn.set(this,"show-hidden"),dt.set(this,null),Ut.set(this,!0),ei.set(this,{}),ke.set(this,!0),ti.set(this,[]),He.set(this,void 0),Ze.set(this,{}),Te.set(this,!1),Ye.set(this,null),sn.set(this,void 0),he.set(this,""),L.set(this,void 0),ni.set(this,void 0),ii.set(this,{}),Ue.set(this,null),Rt.set(this,null),an.set(this,{}),$t.set(this,{}),pt.set(this,void 0),ri.set(this,!1),$.set(this,void 0),Wt.set(this,!1),kt.set(this,!1),Ht.set(this,!1),Y.set(this,void 0),Xe.set(this,null),oe.set(this,void 0),I(this,$,r,"f"),I(this,pt,t,"f"),I(this,Tt,n,"f"),I(this,ni,i,"f"),I(this,He,new Ri(this),"f"),this.$0=this[_o](),this[Qi](),I(this,le,c(this,le,"f"),"f"),I(this,Y,c(this,Y,"f"),"f"),I(this,oe,c(this,oe,"f"),"f"),I(this,L,c(this,L,"f"),"f"),c(this,L,"f").showHiddenOpt=c(this,Xn,"f"),I(this,sn,this[Oo](),"f")}addHelpOpt(t,n){let i="help";return j("[string|boolean] [string]",[t,n],arguments.length),c(this,Ye,"f")&&(this[Hi](c(this,Ye,"f")),I(this,Ye,null,"f")),t===!1&&n===void 0?this:(I(this,Ye,typeof t=="string"?t:i,"f"),this.boolean(c(this,Ye,"f")),this.describe(c(this,Ye,"f"),n||c(this,Y,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(j("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let i=typeof t=="string"?t:c(this,Xn,"f");return this.boolean(i),this.describe(i,n||c(this,Y,"f").deferY18nLookup("Show hidden options")),c(this,L,"f").showHiddenOpt=i,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[Bi](this.alias.bind(this),"alias",t,n),this}array(t){return j("<array|string>",[t],arguments.length),this[ht]("array",t),this[Bt](t),this}boolean(t){return j("<array|string>",[t],arguments.length),this[ht]("boolean",t),this[Bt](t),this}check(t,n){return j("<function> [boolean]",[t,n],arguments.length),this.middleware((i,r)=>Nt(()=>t(i,r.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&c(this,Y,"f").fail(o.toString(),o):c(this,Y,"f").fail(c(this,$,"f").y18n.__("Argument check failed: %s",t.toString())),i),o=>(c(this,Y,"f").fail(o.message?o.message:o.toString(),o),i)),!1,n),this}choices(t,n){return j("<object|string|array> [string|array]",[t,n],arguments.length),this[Bi](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(j("<object|string|array> [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new Z("coerce callback must be provided");for(let i of t)this.coerce(i,n);return this}else if(typeof t=="object"){for(let i of Object.keys(t))this.coerce(i,t[i]);return this}if(!n)throw new Z("coerce callback must be provided");return c(this,L,"f").key[t]=!0,c(this,He,"f").addCoerceMiddleware((i,r)=>{let o;return Nt(()=>(o=r.getAliases(),n(i[t])),s=>{if(i[t]=s,o[t])for(let a of o[t])i[a]=s;return i},s=>{throw new Z(s.message)})},t),this}conflicts(t,n){return j("<string|object> [string|array]",[t,n],arguments.length),c(this,oe,"f").conflicts(t,n),this}config(t="config",n,i){return j("[object|string] [string|function] [function]",[t,n,i],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=Zn(t,c(this,Tt,"f"),this[Yt]()["deep-merge-config"]||!1,c(this,$,"f")),c(this,L,"f").configObjects=(c(this,L,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(i=n,n=void 0),this.describe(t,n||c(this,Y,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{c(this,L,"f").config[r]=i||!0}),this)}completion(t,n,i){return j("[string] [string|boolean|function] [function]",[t,n,i],arguments.length),typeof n=="function"&&(i=n,n=void 0),I(this,Ne,t||c(this,Ne,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(c(this,Ne,"f"),n),i&&c(this,We,"f").registerFunction(i),this}command(t,n,i,r,o,s){return j("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,i,r,o,s],arguments.length),c(this,le,"f").addHandler(t,n,i,r,o,s),this}commands(t,n,i,r,o,s){return this.command(t,n,i,r,o,s)}commandDir(t,n){j("<string> [object]",[t,n],arguments.length);let i=c(this,ni,"f")||c(this,$,"f").require;return c(this,le,"f").addDirectory(t,i,c(this,$,"f").getCallerFile(),n),this}count(t){return j("<array|string>",[t],arguments.length),this[ht]("count",t),this[Bt](t),this}default(t,n,i){return j("<object|string|array> [*] [string]",[t,n,i],arguments.length),i&&(Ui(t,c(this,$,"f")),c(this,L,"f").defaultDescription[t]=i),typeof n=="function"&&(Ui(t,c(this,$,"f")),c(this,L,"f").defaultDescription[t]||(c(this,L,"f").defaultDescription[t]=c(this,Y,"f").functionDescription(n)),n=n.call()),this[ln](this.default.bind(this),"default",t,n),this}defaults(t,n,i){return this.default(t,n,i)}demandCommand(t=1,n,i,r){return j("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,i,r],arguments.length),typeof n!="number"&&(i=n,n=1/0),this.global("_",!1),c(this,L,"f").demandedCommands._={min:t,max:n,minMsg:i,maxMsg:r},this}demand(t,n,i){return Array.isArray(n)?(n.forEach(r=>{Pe(i,!0,c(this,$,"f")),this.demandOption(r,i)}),n=1/0):typeof n!="number"&&(i=n,n=1/0),typeof t=="number"?(Pe(i,!0,c(this,$,"f")),this.demandCommand(t,n,i,i)):Array.isArray(t)?t.forEach(r=>{Pe(i,!0,c(this,$,"f")),this.demandOption(r,i)}):typeof i=="string"?this.demandOption(t,i):(i===!0||typeof i=="undefined")&&this.demandOption(t),this}demandOption(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[ln](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return j("<string> [string|boolean]",[t,n],arguments.length),c(this,L,"f").deprecatedOptions[t]=n,this}describe(t,n){return j("<object|string|array> [string]",[t,n],arguments.length),this[Vi](t,!0),c(this,Y,"f").describe(t,n),this}detectLocale(t){return j("<boolean>",[t],arguments.length),I(this,Ut,t,"f"),this}env(t){return j("[string|boolean]",[t],arguments.length),t===!1?delete c(this,L,"f").envPrefix:c(this,L,"f").envPrefix=t||"",this}epilogue(t){return j("<string>",[t],arguments.length),c(this,Y,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return j("<string|array> [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(i=>this.example(...i)):c(this,Y,"f").example(t,n),this}exit(t,n){I(this,Te,!0,"f"),I(this,dt,n,"f"),c(this,ke,"f")&&c(this,$,"f").process.exit(t)}exitProcess(t=!0){return j("[boolean]",[t],arguments.length),I(this,ke,t,"f"),this}fail(t){if(j("<function|boolean>",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new Z("Invalid first argument. Expected function or boolean 'false'");return c(this,Y,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return j("<array> [function]",[t,n],arguments.length),n?c(this,We,"f").getCompletion(t,n):new Promise((i,r)=>{c(this,We,"f").getCompletion(t,(o,s)=>{o?r(o):i(s)})})}getDemandedOptions(){return j([],0),c(this,L,"f").demandedOptions}getDemandedCommands(){return j([],0),c(this,L,"f").demandedCommands}getDeprecatedOptions(){return j([],0),c(this,L,"f").deprecatedOptions}getDetectLocale(){return c(this,Ut,"f")}getExitProcess(){return c(this,ke,"f")}getGroups(){return Object.assign({},c(this,Ze,"f"),c(this,$t,"f"))}getHelp(){if(I(this,Te,!0,"f"),!c(this,Y,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[En](c(this,pt,"f"),void 0,void 0,0,!0);if(te(n))return n.then(()=>c(this,Y,"f").help())}let t=c(this,le,"f").runDefaultBuilderOn(this);if(te(t))return t.then(()=>c(this,Y,"f").help())}return Promise.resolve(c(this,Y,"f").help())}getOptions(){return c(this,L,"f")}getStrict(){return c(this,Wt,"f")}getStrictCommands(){return c(this,kt,"f")}getStrictOptions(){return c(this,Ht,"f")}global(t,n){return j("<string|array> [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?c(this,L,"f").local=c(this,L,"f").local.filter(i=>t.indexOf(i)===-1):t.forEach(i=>{c(this,L,"f").local.includes(i)||c(this,L,"f").local.push(i)}),this}group(t,n){j("<string|array> <string>",[t,n],arguments.length);let i=c(this,$t,"f")[n]||c(this,Ze,"f")[n];c(this,$t,"f")[n]&&delete c(this,$t,"f")[n];let r={};return c(this,Ze,"f")[n]=(i||[]).concat(t).filter(o=>r[o]?!1:r[o]=!0),this}hide(t){return j("<string>",[t],arguments.length),c(this,L,"f").hiddenOptions.push(t),this}implies(t,n){return j("<string|object> [number|string|array]",[t,n],arguments.length),c(this,oe,"f").implies(t,n),this}locale(t){return j("[string]",[t],arguments.length),t?(I(this,Ut,!1,"f"),c(this,$,"f").y18n.setLocale(t),this):(this[Yi](),c(this,$,"f").y18n.getLocale())}middleware(t,n,i){return c(this,He,"f").addMiddleware(t,!!n,i)}nargs(t,n){return j("<string|object|array> [number]",[t,n],arguments.length),this[ln](this.nargs.bind(this),"narg",t,n),this}normalize(t){return j("<array|string>",[t],arguments.length),this[ht]("normalize",t),this}number(t){return j("<array|string>",[t],arguments.length),this[ht]("number",t),this[Bt](t),this}option(t,n){if(j("<string|object> [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(i=>{this.options(i,t[i])});else{typeof n!="object"&&(n={}),this[Bt](t),c(this,Xe,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[vo](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
62
+ `),void 0,"versionWarning"),c(this,L,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let i=n.deprecate||n.deprecated;i&&this.deprecateOption(t,i);let r=n.demand||n.required||n.require;r&&this.demand(t,r),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&&(c(this,L,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let o=n.describe||n.description||n.desc;this.describe(t,o),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,i){j("[string|array] [function|boolean|object] [function]",[t,n,i],arguments.length),this[Eo](),typeof t=="undefined"&&(t=c(this,pt,"f")),typeof n=="object"&&(I(this,Rt,n,"f"),n=i),typeof n=="function"&&(I(this,Ue,n,"f"),n=!1),n||I(this,pt,t,"f"),c(this,Ue,"f")&&I(this,ke,!1,"f");let r=this[En](t,!!n),o=this.parsed;return c(this,We,"f").setParsed(this.parsed),te(r)?r.then(s=>(c(this,Ue,"f")&&c(this,Ue,"f").call(this,c(this,dt,"f"),s,c(this,he,"f")),s)).catch(s=>{throw c(this,Ue,"f")&&c(this,Ue,"f")(s,this.parsed.argv,c(this,he,"f")),s}).finally(()=>{this[Ki](),this.parsed=o}):(c(this,Ue,"f")&&c(this,Ue,"f").call(this,c(this,dt,"f"),r,c(this,he,"f")),this[Ki](),this.parsed=o,r)}parseAsync(t,n,i){let r=this.parse(t,n,i);return te(r)?r:Promise.resolve(r)}parseSync(t,n,i){let r=this.parse(t,n,i);if(te(r))throw new Z(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(t){return j("<object>",[t],arguments.length),I(this,ii,t,"f"),this}pkgConf(t,n){j("<string> [string]",[t,n],arguments.length);let i=null,r=this[Gi](n||c(this,Tt,"f"));return r[t]&&typeof r[t]=="object"&&(i=Zn(r[t],n||c(this,Tt,"f"),this[Yt]()["deep-merge-config"]||!1,c(this,$,"f")),c(this,L,"f").configObjects=(c(this,L,"f").configObjects||[]).concat(i)),this}positional(t,n){j("<string> <object>",[t,n],arguments.length);let i=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=ft(n,(s,a)=>s==="type"&&!["string","number","boolean"].includes(a)?!1:i.includes(s));let r=c(this,vn,"f").fullCommands[c(this,vn,"f").fullCommands.length-1],o=r?c(this,le,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return rn(o).forEach(s=>{let a=o[s];Array.isArray(a)?a.indexOf(t)!==-1&&(n[s]=!0):a[t]&&!(s in n)&&(n[s]=a[t])}),this.group(t,c(this,Y,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return j("[boolean]",[t],arguments.length),I(this,ri,t,"f"),this}required(t,n,i){return this.demand(t,n,i)}require(t,n,i){return this.demand(t,n,i)}requiresArg(t){return j("<array|string|object> [number]",[t],arguments.length),typeof t=="string"&&c(this,L,"f").narg[t]?this:(this[ln](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return j("[string] [string]",[t,n],arguments.length),t=t||this.$0,c(this,sn,"f").log(c(this,We,"f").generateCompletionScript(t,n||c(this,Ne,"f")||"completion")),this}showHelp(t){if(j("[string|function]",[t],arguments.length),I(this,Te,!0,"f"),!c(this,Y,"f").hasCachedHelpMessage()){if(!this.parsed){let i=this[En](c(this,pt,"f"),void 0,void 0,0,!0);if(te(i))return i.then(()=>{c(this,Y,"f").showHelp(t)}),this}let n=c(this,le,"f").runDefaultBuilderOn(this);if(te(n))return n.then(()=>{c(this,Y,"f").showHelp(t)}),this}return c(this,Y,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return j("[boolean|string] [string]",[t,n],arguments.length),c(this,Y,"f").showHelpOnFail(t,n),this}showVersion(t){return j("[string|function]",[t],arguments.length),c(this,Y,"f").showVersion(t),this}skipValidation(t){return j("<array|string>",[t],arguments.length),this[ht]("skipValidation",t),this}strict(t){return j("[boolean]",[t],arguments.length),I(this,Wt,t!==!1,"f"),this}strictCommands(t){return j("[boolean]",[t],arguments.length),I(this,kt,t!==!1,"f"),this}strictOptions(t){return j("[boolean]",[t],arguments.length),I(this,Ht,t!==!1,"f"),this}string(t){return j("<array|string>",[t],arguments.length),this[ht]("string",t),this[Bt](t),this}terminalWidth(){return j([],0),c(this,$,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return j("<object>",[t],arguments.length),I(this,Ut,!1,"f"),c(this,$,"f").y18n.updateLocale(t),this}usage(t,n,i,r){if(j("<string|null|undefined> [string|boolean] [function|object] [function]",[t,n,i,r],arguments.length),n!==void 0){if(Pe(t,null,c(this,$,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,i,r);throw new Z(".usage() description must start with $0 if being used as alias for .command()")}else return c(this,Y,"f").usage(t),this}version(t,n,i){let r="version";if(j("[boolean|string] [string] [string]",[t,n,i],arguments.length),c(this,Xe,"f")&&(this[Hi](c(this,Xe,"f")),c(this,Y,"f").version(void 0),I(this,Xe,null,"f")),arguments.length===0)i=this[So](),t=r;else if(arguments.length===1){if(t===!1)return this;i=t,t=r}else arguments.length===2&&(i=n,n=void 0);return I(this,Xe,typeof t=="string"?t:r,"f"),n=n||c(this,Y,"f").deferY18nLookup("Show version number"),c(this,Y,"f").version(i||void 0),this.boolean(c(this,Xe,"f")),this.describe(c(this,Xe,"f"),n),this}wrap(t){return j("<number|null|undefined>",[t],arguments.length),c(this,Y,"f").wrap(t),this}[(le=new WeakMap,Tt=new WeakMap,vn=new WeakMap,We=new WeakMap,Ne=new WeakMap,Xn=new WeakMap,dt=new WeakMap,Ut=new WeakMap,ei=new WeakMap,ke=new WeakMap,ti=new WeakMap,He=new WeakMap,Ze=new WeakMap,Te=new WeakMap,Ye=new WeakMap,sn=new WeakMap,he=new WeakMap,L=new WeakMap,ni=new WeakMap,ii=new WeakMap,Ue=new WeakMap,Rt=new WeakMap,an=new WeakMap,$t=new WeakMap,pt=new WeakMap,ri=new WeakMap,$=new WeakMap,Wt=new WeakMap,kt=new WeakMap,Ht=new WeakMap,Y=new WeakMap,Xe=new WeakMap,oe=new WeakMap,Co)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(n){}return t}[Oo](){return{log:(...t)=>{this[oi]()||console.log(...t),I(this,Te,!0,"f"),c(this,he,"f").length&&I(this,he,c(this,he,"f")+`
63
63
  `,"f"),I(this,he,c(this,he,"f")+t.join(" "),"f")},error:(...t)=>{this[oi]()||console.error(...t),I(this,Te,!0,"f"),c(this,he,"f").length&&I(this,he,c(this,he,"f")+`
64
- `,"f"),I(this,he,c(this,he,"f")+t.join(" "),"f")}}}[Hi](t){rn(c(this,L,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let i=c(this,L,"f")[n];Array.isArray(i)?i.includes(t)&&i.splice(i.indexOf(t),1):typeof i=="object"&&delete i[t]}),delete c(this,Y,"f").getDescriptions()[t]}[Eo](t,n,i){c(this,ei,"f")[i]||(c(this,$,"f").process.emitWarning(t,n),c(this,ei,"f")[i]=!0)}[_o](){c(this,ti,"f").push({options:c(this,L,"f"),configObjects:c(this,L,"f").configObjects.slice(0),exitProcess:c(this,ke,"f"),groups:c(this,Ze,"f"),strict:c(this,Wt,"f"),strictCommands:c(this,kt,"f"),strictOptions:c(this,Ht,"f"),completionCommand:c(this,Ne,"f"),output:c(this,he,"f"),exitError:c(this,dt,"f"),hasOutput:c(this,Te,"f"),parsed:this.parsed,parseFn:c(this,Ue,"f"),parseContext:c(this,Rt,"f")}),c(this,Y,"f").freeze(),c(this,oe,"f").freeze(),c(this,le,"f").freeze(),c(this,He,"f").freeze()}[So](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(c(this,$,"f").process.argv()[0])?n=c(this,$,"f").process.argv().slice(1,2):n=c(this,$,"f").process.argv().slice(0,1),t=n.map(i=>{let r=this[Ro](c(this,Tt,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),c(this,$,"f").getEnv("_")&&c(this,$,"f").getProcessArgvBin()===c(this,$,"f").getEnv("_")&&(t=c(this,$,"f").getEnv("_").replace(`${c(this,$,"f").path.dirname(c(this,$,"f").process.execPath())}/`,"")),t}[Yt](){return c(this,ii,"f")}[Yi](){if(!c(this,Ut,"f"))return;let t=c(this,$,"f").getEnv("LC_ALL")||c(this,$,"f").getEnv("LC_MESSAGES")||c(this,$,"f").getEnv("LANG")||c(this,$,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Po](){return this[Gi]().version||"unknown"}[jo](t){let n=t["--"]?t["--"]:t._;for(let i=0,r;(r=n[i])!==void 0;i++)c(this,$,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(n[i]=Number(r));return t}[Gi](t){let n=t||"*";if(c(this,an,"f")[n])return c(this,an,"f")[n];let i={};try{let r=t||c(this,$,"f").mainFilename;!t&&c(this,$,"f").path.extname(r)&&(r=c(this,$,"f").path.dirname(r));let o=c(this,$,"f").findUp(r,(s,a)=>{if(a.includes("package.json"))return"package.json"});Pe(o,void 0,c(this,$,"f")),i=JSON.parse(c(this,$,"f").readFileSync(o,"utf8"))}catch(r){}return c(this,an,"f")[n]=i||{},c(this,an,"f")[n]}[ht](t,n){n=[].concat(n),n.forEach(i=>{i=this[zi](i),c(this,L,"f")[t].push(i)})}[ln](t,n,i,r){this[qi](t,n,i,r,(o,s,a)=>{c(this,L,"f")[o][s]=a})}[Bi](t,n,i,r){this[qi](t,n,i,r,(o,s,a)=>{c(this,L,"f")[o][s]=(c(this,L,"f")[o][s]||[]).concat(a)})}[qi](t,n,i,r,o){if(Array.isArray(i))i.forEach(s=>{t(s,r)});else if((s=>typeof s=="object")(i))for(let s of rn(i))t(s,i[s]);else o(n,this[zi](i),r)}[zi](t){return t==="__proto__"?"___proto___":t}[Vi](t,n){return this[ln](this[Vi].bind(this),"key",t,n),this}[Ki](){var t,n,i,r,o,s,a,l,u,d,f,p;let y=c(this,ti,"f").pop();Pe(y,void 0,c(this,$,"f"));let C;t=this,n=this,i=this,r=this,o=this,s=this,a=this,l=this,u=this,d=this,f=this,p=this,{options:{set value(A){I(t,L,A,"f")}}.value,configObjects:C,exitProcess:{set value(A){I(n,ke,A,"f")}}.value,groups:{set value(A){I(i,Ze,A,"f")}}.value,output:{set value(A){I(r,he,A,"f")}}.value,exitError:{set value(A){I(o,dt,A,"f")}}.value,hasOutput:{set value(A){I(s,Te,A,"f")}}.value,parsed:this.parsed,strict:{set value(A){I(a,Wt,A,"f")}}.value,strictCommands:{set value(A){I(l,kt,A,"f")}}.value,strictOptions:{set value(A){I(u,Ht,A,"f")}}.value,completionCommand:{set value(A){I(d,Ne,A,"f")}}.value,parseFn:{set value(A){I(f,Ue,A,"f")}}.value,parseContext:{set value(A){I(p,Rt,A,"f")}}.value}=y,c(this,L,"f").configObjects=C,c(this,Y,"f").unfreeze(),c(this,oe,"f").unfreeze(),c(this,le,"f").unfreeze(),c(this,He,"f").unfreeze()}[Io](t,n){return Nt(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[Mo].bind(this),getContext:this[Fo].bind(this),getHasOutput:this[Lo].bind(this),getLoggerInstance:this[Do].bind(this),getParseContext:this[No].bind(this),getParserConfiguration:this[Yt].bind(this),getUsageInstance:this[To].bind(this),getValidationInstance:this[Uo].bind(this),hasParseCallback:this[oi].bind(this),postProcess:this[Gt].bind(this),reset:this[Qi].bind(this),runValidation:this[Ji].bind(this),runYargsParserAndExecuteCommands:this[En].bind(this),setHasOutput:this[$o].bind(this)}}[Mo](){return c(this,le,"f")}[Fo](){return c(this,vn,"f")}[Lo](){return c(this,Te,"f")}[Do](){return c(this,sn,"f")}[No](){return c(this,Rt,"f")||{}}[To](){return c(this,Y,"f")}[Uo](){return c(this,oe,"f")}[oi](){return!!c(this,Ue,"f")}[Gt](t,n,i,r){return i||te(t)||(n||(t=this[Oo](t)),(this[Yt]()["parse-positional-numbers"]||this[Yt]()["parse-positional-numbers"]===void 0)&&(t=this[jo](t)),r&&(t=Dt(t,this,c(this,He,"f").getMiddleware(),!1))),t}[Qi](t={}){I(this,L,c(this,L,"f")||{},"f");let n={};n.local=c(this,L,"f").local||[],n.configObjects=c(this,L,"f").configObjects||[];let i={};n.local.forEach(s=>{i[s]=!0,(t[s]||[]).forEach(a=>{i[a]=!0})}),Object.assign(c(this,$t,"f"),Object.keys(c(this,Ze,"f")).reduce((s,a)=>{let l=c(this,Ze,"f")[a].filter(u=>!(u in i));return l.length>0&&(s[a]=l),s},{})),I(this,Ze,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(s=>{n[s]=(c(this,L,"f")[s]||[]).filter(a=>!i[a])}),o.forEach(s=>{n[s]=ft(c(this,L,"f")[s],a=>!i[a])}),n.envPrefix=c(this,L,"f").envPrefix,I(this,L,n,"f"),I(this,Y,c(this,Y,"f")?c(this,Y,"f").reset(i):uo(this,c(this,$,"f")),"f"),I(this,oe,c(this,oe,"f")?c(this,oe,"f").reset(i):Ao(this,c(this,Y,"f"),c(this,$,"f")),"f"),I(this,le,c(this,le,"f")?c(this,le,"f").reset():lo(c(this,Y,"f"),c(this,oe,"f"),c(this,He,"f"),c(this,$,"f")),"f"),c(this,We,"f")||I(this,We,yo(this,c(this,Y,"f"),c(this,le,"f"),c(this,$,"f")),"f"),c(this,He,"f").reset(),I(this,Ne,null,"f"),I(this,he,"","f"),I(this,dt,null,"f"),I(this,Te,!1,"f"),this.parsed=!1,this}[Ro](t,n){return c(this,$,"f").path.relative(t,n)}[En](t,n,i,r=0,o=!1){let s=!!i||o;t=t||c(this,pt,"f"),c(this,L,"f").__=c(this,$,"f").y18n.__,c(this,L,"f").configuration=this[Yt]();let a=!!c(this,L,"f").configuration["populate--"],l=Object.assign({},c(this,L,"f").configuration,{"populate--":!0}),u=c(this,$,"f").Parser.detailed(t,Object.assign({},c(this,L,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),d=Object.assign(u.argv,c(this,Rt,"f")),f,p=u.aliases,y=!1,C=!1;Object.keys(d).forEach(A=>{A===c(this,Ye,"f")&&d[A]?y=!0:A===c(this,Xe,"f")&&d[A]&&(C=!0)}),d.$0=this.$0,this.parsed=u,r===0&&c(this,Y,"f").clearCachedHelpMessage();try{if(this[Yi](),n)return this[Gt](d,a,!!i,!1);c(this,Ye,"f")&&[c(this,Ye,"f")].concat(p[c(this,Ye,"f")]||[]).filter(G=>G.length>1).includes(""+d._[d._.length-1])&&(d._.pop(),y=!0);let A=c(this,le,"f").getCommands(),m=c(this,We,"f").completionKey in d,S=y||m||o;if(d._.length){if(A.length){let E;for(let G=r||0,B;d._[G]!==void 0;G++)if(B=String(d._[G]),A.includes(B)&&B!==c(this,Ne,"f")){let V=c(this,le,"f").runCommand(B,this,u,G+1,o,y||C||o);return this[Gt](V,a,!!i,!1)}else if(!E&&B!==c(this,Ne,"f")){E=B;break}!c(this,le,"f").hasDefaultCommand()&&c(this,ri,"f")&&E&&!S&&c(this,oe,"f").recommendCommands(E,A)}c(this,Ne,"f")&&d._.includes(c(this,Ne,"f"))&&!m&&(c(this,ke,"f")&&ut(!0),this.showCompletionScript(),this.exit(0))}if(c(this,le,"f").hasDefaultCommand()&&!S){let E=c(this,le,"f").runCommand(null,this,u,0,o,y||C||o);return this[Gt](E,a,!!i,!1)}if(m){c(this,ke,"f")&&ut(!0),t=[].concat(t);let E=t.slice(t.indexOf(`--${c(this,We,"f").completionKey}`)+1);return c(this,We,"f").getCompletion(E,(G,B)=>{if(G)throw new Z(G.message);(B||[]).forEach(V=>{c(this,sn,"f").log(V)}),this.exit(0)}),this[Gt](d,!a,!!i,!1)}if(c(this,Te,"f")||(y?(c(this,ke,"f")&&ut(!0),s=!0,this.showHelp("log"),this.exit(0)):C&&(c(this,ke,"f")&&ut(!0),s=!0,c(this,Y,"f").showVersion("log"),this.exit(0))),!s&&c(this,L,"f").skipValidation.length>0&&(s=Object.keys(d).some(E=>c(this,L,"f").skipValidation.indexOf(E)>=0&&d[E]===!0)),!s){if(u.error)throw new Z(u.error.message);if(!m){let E=this[Ji](p,{},u.error);i||(f=Dt(d,this,c(this,He,"f").getMiddleware(),!0)),f=this[Io](E,f!=null?f:d),te(f)&&!i&&(f=f.then(()=>Dt(d,this,c(this,He,"f").getMiddleware(),!1)))}}}catch(A){if(A instanceof Z)c(this,Y,"f").fail(A.message,A);else throw A}return this[Gt](f!=null?f:d,a,!!i,!0)}[Ji](t,n,i,r){let o={...this.getDemandedOptions()};return s=>{if(i)throw new Z(i.message);c(this,oe,"f").nonOptionCount(s),c(this,oe,"f").requiredArguments(s,o);let a=!1;c(this,kt,"f")&&(a=c(this,oe,"f").unknownCommands(s)),c(this,Wt,"f")&&!a?c(this,oe,"f").unknownArguments(s,t,n,!!r):c(this,Ht,"f")&&c(this,oe,"f").unknownArguments(s,t,{},!1,!1),c(this,oe,"f").limitedChoices(s),c(this,oe,"f").implications(s),c(this,oe,"f").conflicting(s)}}[$o](){I(this,Te,!0,"f")}[Bt](t){if(typeof t=="string")c(this,L,"f").key[t]=!0;else for(let n of t)c(this,L,"f").key[n]=!0}};function fo(e){return!!e&&typeof e.getInternalMethods=="function"}var oc=Co(io),Ge=oc;g();g();var ya=K(require("isomorphic-unfetch"));g();var ca=K(require("chalk"),1),Ci=require("fs"),Oi=require("fs/promises"),Nn=require("path");g();function ko(e){return typeof e=="undefined"||e===null}function sc(e){return typeof e=="object"&&e!==null}function ac(e){return Array.isArray(e)?e:ko(e)?[]:[e]}function lc(e,t){var n,i,r,o;if(t)for(o=Object.keys(t),n=0,i=o.length;n<i;n+=1)r=o[n],e[r]=t[r];return e}function cc(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function fc(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var uc=ko,dc=sc,pc=ac,hc=cc,mc=fc,gc=lc,de={isNothing:uc,isObject:dc,toArray:pc,repeat:hc,isNegativeZero:mc,extend:gc};function Ho(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
64
+ `,"f"),I(this,he,c(this,he,"f")+t.join(" "),"f")}}}[Hi](t){rn(c(this,L,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let i=c(this,L,"f")[n];Array.isArray(i)?i.includes(t)&&i.splice(i.indexOf(t),1):typeof i=="object"&&delete i[t]}),delete c(this,Y,"f").getDescriptions()[t]}[vo](t,n,i){c(this,ei,"f")[i]||(c(this,$,"f").process.emitWarning(t,n),c(this,ei,"f")[i]=!0)}[Eo](){c(this,ti,"f").push({options:c(this,L,"f"),configObjects:c(this,L,"f").configObjects.slice(0),exitProcess:c(this,ke,"f"),groups:c(this,Ze,"f"),strict:c(this,Wt,"f"),strictCommands:c(this,kt,"f"),strictOptions:c(this,Ht,"f"),completionCommand:c(this,Ne,"f"),output:c(this,he,"f"),exitError:c(this,dt,"f"),hasOutput:c(this,Te,"f"),parsed:this.parsed,parseFn:c(this,Ue,"f"),parseContext:c(this,Rt,"f")}),c(this,Y,"f").freeze(),c(this,oe,"f").freeze(),c(this,le,"f").freeze(),c(this,He,"f").freeze()}[_o](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(c(this,$,"f").process.argv()[0])?n=c(this,$,"f").process.argv().slice(1,2):n=c(this,$,"f").process.argv().slice(0,1),t=n.map(i=>{let r=this[Uo](c(this,Tt,"f"),i);return i.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<i.length?r:i}).join(" ").trim(),c(this,$,"f").getEnv("_")&&c(this,$,"f").getProcessArgvBin()===c(this,$,"f").getEnv("_")&&(t=c(this,$,"f").getEnv("_").replace(`${c(this,$,"f").path.dirname(c(this,$,"f").process.execPath())}/`,"")),t}[Yt](){return c(this,ii,"f")}[Yi](){if(!c(this,Ut,"f"))return;let t=c(this,$,"f").getEnv("LC_ALL")||c(this,$,"f").getEnv("LC_MESSAGES")||c(this,$,"f").getEnv("LANG")||c(this,$,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[So](){return this[Gi]().version||"unknown"}[Po](t){let n=t["--"]?t["--"]:t._;for(let i=0,r;(r=n[i])!==void 0;i++)c(this,$,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(n[i]=Number(r));return t}[Gi](t){let n=t||"*";if(c(this,an,"f")[n])return c(this,an,"f")[n];let i={};try{let r=t||c(this,$,"f").mainFilename;!t&&c(this,$,"f").path.extname(r)&&(r=c(this,$,"f").path.dirname(r));let o=c(this,$,"f").findUp(r,(s,a)=>{if(a.includes("package.json"))return"package.json"});Pe(o,void 0,c(this,$,"f")),i=JSON.parse(c(this,$,"f").readFileSync(o,"utf8"))}catch(r){}return c(this,an,"f")[n]=i||{},c(this,an,"f")[n]}[ht](t,n){n=[].concat(n),n.forEach(i=>{i=this[zi](i),c(this,L,"f")[t].push(i)})}[ln](t,n,i,r){this[qi](t,n,i,r,(o,s,a)=>{c(this,L,"f")[o][s]=a})}[Bi](t,n,i,r){this[qi](t,n,i,r,(o,s,a)=>{c(this,L,"f")[o][s]=(c(this,L,"f")[o][s]||[]).concat(a)})}[qi](t,n,i,r,o){if(Array.isArray(i))i.forEach(s=>{t(s,r)});else if((s=>typeof s=="object")(i))for(let s of rn(i))t(s,i[s]);else o(n,this[zi](i),r)}[zi](t){return t==="__proto__"?"___proto___":t}[Vi](t,n){return this[ln](this[Vi].bind(this),"key",t,n),this}[Ki](){var t,n,i,r,o,s,a,l,u,d,f,p;let y=c(this,ti,"f").pop();Pe(y,void 0,c(this,$,"f"));let C;t=this,n=this,i=this,r=this,o=this,s=this,a=this,l=this,u=this,d=this,f=this,p=this,{options:{set value(A){I(t,L,A,"f")}}.value,configObjects:C,exitProcess:{set value(A){I(n,ke,A,"f")}}.value,groups:{set value(A){I(i,Ze,A,"f")}}.value,output:{set value(A){I(r,he,A,"f")}}.value,exitError:{set value(A){I(o,dt,A,"f")}}.value,hasOutput:{set value(A){I(s,Te,A,"f")}}.value,parsed:this.parsed,strict:{set value(A){I(a,Wt,A,"f")}}.value,strictCommands:{set value(A){I(l,kt,A,"f")}}.value,strictOptions:{set value(A){I(u,Ht,A,"f")}}.value,completionCommand:{set value(A){I(d,Ne,A,"f")}}.value,parseFn:{set value(A){I(f,Ue,A,"f")}}.value,parseContext:{set value(A){I(p,Rt,A,"f")}}.value}=y,c(this,L,"f").configObjects=C,c(this,Y,"f").unfreeze(),c(this,oe,"f").unfreeze(),c(this,le,"f").unfreeze(),c(this,He,"f").unfreeze()}[jo](t,n){return Nt(n,i=>(t(i),i))}getInternalMethods(){return{getCommandInstance:this[Io].bind(this),getContext:this[Mo].bind(this),getHasOutput:this[Fo].bind(this),getLoggerInstance:this[Lo].bind(this),getParseContext:this[Do].bind(this),getParserConfiguration:this[Yt].bind(this),getUsageInstance:this[No].bind(this),getValidationInstance:this[To].bind(this),hasParseCallback:this[oi].bind(this),postProcess:this[Gt].bind(this),reset:this[Qi].bind(this),runValidation:this[Ji].bind(this),runYargsParserAndExecuteCommands:this[En].bind(this),setHasOutput:this[Ro].bind(this)}}[Io](){return c(this,le,"f")}[Mo](){return c(this,vn,"f")}[Fo](){return c(this,Te,"f")}[Lo](){return c(this,sn,"f")}[Do](){return c(this,Rt,"f")||{}}[No](){return c(this,Y,"f")}[To](){return c(this,oe,"f")}[oi](){return!!c(this,Ue,"f")}[Gt](t,n,i,r){return i||te(t)||(n||(t=this[Co](t)),(this[Yt]()["parse-positional-numbers"]||this[Yt]()["parse-positional-numbers"]===void 0)&&(t=this[Po](t)),r&&(t=Dt(t,this,c(this,He,"f").getMiddleware(),!1))),t}[Qi](t={}){I(this,L,c(this,L,"f")||{},"f");let n={};n.local=c(this,L,"f").local||[],n.configObjects=c(this,L,"f").configObjects||[];let i={};n.local.forEach(s=>{i[s]=!0,(t[s]||[]).forEach(a=>{i[a]=!0})}),Object.assign(c(this,$t,"f"),Object.keys(c(this,Ze,"f")).reduce((s,a)=>{let l=c(this,Ze,"f")[a].filter(u=>!(u in i));return l.length>0&&(s[a]=l),s},{})),I(this,Ze,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(s=>{n[s]=(c(this,L,"f")[s]||[]).filter(a=>!i[a])}),o.forEach(s=>{n[s]=ft(c(this,L,"f")[s],a=>!i[a])}),n.envPrefix=c(this,L,"f").envPrefix,I(this,L,n,"f"),I(this,Y,c(this,Y,"f")?c(this,Y,"f").reset(i):po(this,c(this,$,"f")),"f"),I(this,oe,c(this,oe,"f")?c(this,oe,"f").reset(i):Ao(this,c(this,Y,"f"),c(this,$,"f")),"f"),I(this,le,c(this,le,"f")?c(this,le,"f").reset():co(c(this,Y,"f"),c(this,oe,"f"),c(this,He,"f"),c(this,$,"f")),"f"),c(this,We,"f")||I(this,We,yo(this,c(this,Y,"f"),c(this,le,"f"),c(this,$,"f")),"f"),c(this,He,"f").reset(),I(this,Ne,null,"f"),I(this,he,"","f"),I(this,dt,null,"f"),I(this,Te,!1,"f"),this.parsed=!1,this}[Uo](t,n){return c(this,$,"f").path.relative(t,n)}[En](t,n,i,r=0,o=!1){let s=!!i||o;t=t||c(this,pt,"f"),c(this,L,"f").__=c(this,$,"f").y18n.__,c(this,L,"f").configuration=this[Yt]();let a=!!c(this,L,"f").configuration["populate--"],l=Object.assign({},c(this,L,"f").configuration,{"populate--":!0}),u=c(this,$,"f").Parser.detailed(t,Object.assign({},c(this,L,"f"),{configuration:{"parse-positional-numbers":!1,...l}})),d=Object.assign(u.argv,c(this,Rt,"f")),f,p=u.aliases,y=!1,C=!1;Object.keys(d).forEach(A=>{A===c(this,Ye,"f")&&d[A]?y=!0:A===c(this,Xe,"f")&&d[A]&&(C=!0)}),d.$0=this.$0,this.parsed=u,r===0&&c(this,Y,"f").clearCachedHelpMessage();try{if(this[Yi](),n)return this[Gt](d,a,!!i,!1);c(this,Ye,"f")&&[c(this,Ye,"f")].concat(p[c(this,Ye,"f")]||[]).filter(G=>G.length>1).includes(""+d._[d._.length-1])&&(d._.pop(),y=!0);let A=c(this,le,"f").getCommands(),m=c(this,We,"f").completionKey in d,S=y||m||o;if(d._.length){if(A.length){let E;for(let G=r||0,B;d._[G]!==void 0;G++)if(B=String(d._[G]),A.includes(B)&&B!==c(this,Ne,"f")){let V=c(this,le,"f").runCommand(B,this,u,G+1,o,y||C||o);return this[Gt](V,a,!!i,!1)}else if(!E&&B!==c(this,Ne,"f")){E=B;break}!c(this,le,"f").hasDefaultCommand()&&c(this,ri,"f")&&E&&!S&&c(this,oe,"f").recommendCommands(E,A)}c(this,Ne,"f")&&d._.includes(c(this,Ne,"f"))&&!m&&(c(this,ke,"f")&&ut(!0),this.showCompletionScript(),this.exit(0))}if(c(this,le,"f").hasDefaultCommand()&&!S){let E=c(this,le,"f").runCommand(null,this,u,0,o,y||C||o);return this[Gt](E,a,!!i,!1)}if(m){c(this,ke,"f")&&ut(!0),t=[].concat(t);let E=t.slice(t.indexOf(`--${c(this,We,"f").completionKey}`)+1);return c(this,We,"f").getCompletion(E,(G,B)=>{if(G)throw new Z(G.message);(B||[]).forEach(V=>{c(this,sn,"f").log(V)}),this.exit(0)}),this[Gt](d,!a,!!i,!1)}if(c(this,Te,"f")||(y?(c(this,ke,"f")&&ut(!0),s=!0,this.showHelp("log"),this.exit(0)):C&&(c(this,ke,"f")&&ut(!0),s=!0,c(this,Y,"f").showVersion("log"),this.exit(0))),!s&&c(this,L,"f").skipValidation.length>0&&(s=Object.keys(d).some(E=>c(this,L,"f").skipValidation.indexOf(E)>=0&&d[E]===!0)),!s){if(u.error)throw new Z(u.error.message);if(!m){let E=this[Ji](p,{},u.error);i||(f=Dt(d,this,c(this,He,"f").getMiddleware(),!0)),f=this[jo](E,f!=null?f:d),te(f)&&!i&&(f=f.then(()=>Dt(d,this,c(this,He,"f").getMiddleware(),!1)))}}}catch(A){if(A instanceof Z)c(this,Y,"f").fail(A.message,A);else throw A}return this[Gt](f!=null?f:d,a,!!i,!0)}[Ji](t,n,i,r){let o={...this.getDemandedOptions()};return s=>{if(i)throw new Z(i.message);c(this,oe,"f").nonOptionCount(s),c(this,oe,"f").requiredArguments(s,o);let a=!1;c(this,kt,"f")&&(a=c(this,oe,"f").unknownCommands(s)),c(this,Wt,"f")&&!a?c(this,oe,"f").unknownArguments(s,t,n,!!r):c(this,Ht,"f")&&c(this,oe,"f").unknownArguments(s,t,{},!1,!1),c(this,oe,"f").limitedChoices(s),c(this,oe,"f").implications(s),c(this,oe,"f").conflicting(s)}}[Ro](){I(this,Te,!0,"f")}[Bt](t){if(typeof t=="string")c(this,L,"f").key[t]=!0;else for(let n of t)c(this,L,"f").key[n]=!0}};function fo(e){return!!e&&typeof e.getInternalMethods=="function"}var oc=$o(io),Ge=oc;g();g();var ya=K(require("isomorphic-unfetch"));g();var ca=K(require("chalk"),1),Oi=require("fs"),vi=require("fs/promises"),Nn=require("path");g();function ns(e){return typeof e=="undefined"||e===null}function sc(e){return typeof e=="object"&&e!==null}function ac(e){return Array.isArray(e)?e:ns(e)?[]:[e]}function lc(e,t){var n,i,r,o;if(t)for(o=Object.keys(t),n=0,i=o.length;n<i;n+=1)r=o[n],e[r]=t[r];return e}function cc(e,t){var n="",i;for(i=0;i<t;i+=1)n+=e;return n}function fc(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var uc=ns,dc=sc,pc=ac,hc=cc,mc=fc,gc=lc,de={isNothing:uc,isObject:dc,toArray:pc,repeat:hc,isNegativeZero:mc,extend:gc};function is(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
65
65
 
66
- `+e.mark.snippet),i+" "+n):i}function _n(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Ho(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+": "+Ho(this,t)};var je=_n;function Zi(e,t,n,i,r){var o="",s="",a=Math.floor(r/2)-1;return i-t>a&&(o=" ... ",t=i-a+o.length),n-i>a&&(s=" ...",n=i+a-s.length),{str:o+e.slice(t,n).replace(/\t/g,"\u2192")+s,pos:i-t+o.length}}function Xi(e,t){return de.repeat(" ",t-e.length)+e}function yc(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,i=[0],r=[],o,s=-1;o=n.exec(e.buffer);)r.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var a="",l,u,d=Math.min(e.line+t.linesAfter,r.length).toString().length,f=t.maxLength-(t.indent+d+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)u=Zi(e.buffer,i[s-l],r[s-l],e.position-(i[s]-i[s-l]),f),a=de.repeat(" ",t.indent)+Xi((e.line-l+1).toString(),d)+" | "+u.str+`
66
+ `+e.mark.snippet),i+" "+n):i}function Sn(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=is(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Sn.prototype=Object.create(Error.prototype);Sn.prototype.constructor=Sn;Sn.prototype.toString=function(t){return this.name+": "+is(this,t)};var je=Sn;function Zi(e,t,n,i,r){var o="",s="",a=Math.floor(r/2)-1;return i-t>a&&(o=" ... ",t=i-a+o.length),n-i>a&&(s=" ...",n=i+a-s.length),{str:o+e.slice(t,n).replace(/\t/g,"\u2192")+s,pos:i-t+o.length}}function Xi(e,t){return de.repeat(" ",t-e.length)+e}function yc(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,i=[0],r=[],o,s=-1;o=n.exec(e.buffer);)r.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var a="",l,u,d=Math.min(e.line+t.linesAfter,r.length).toString().length,f=t.maxLength-(t.indent+d+3);for(l=1;l<=t.linesBefore&&!(s-l<0);l++)u=Zi(e.buffer,i[s-l],r[s-l],e.position-(i[s]-i[s-l]),f),a=de.repeat(" ",t.indent)+Xi((e.line-l+1).toString(),d)+" | "+u.str+`
67
67
  `+a;for(u=Zi(e.buffer,i[s],r[s],e.position,f),a+=de.repeat(" ",t.indent)+Xi((e.line+1).toString(),d)+" | "+u.str+`
68
68
  `,a+=de.repeat("-",t.indent+d+3+u.pos)+`^
69
69
  `,l=1;l<=t.linesAfter&&!(s+l>=r.length);l++)u=Zi(e.buffer,i[s+l],r[s+l],e.position-(i[s]-i[s+l]),f),a+=de.repeat(" ",t.indent)+Xi((e.line+l+1).toString(),d)+" | "+u.str+`
70
- `;return a.replace(/\n$/,"")}var bc=yc,wc=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ac=["scalar","sequence","mapping"];function xc(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function Cc(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(wc.indexOf(n)===-1)throw new je('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=xc(t.styleAliases||null),Ac.indexOf(this.kind)===-1)throw new je('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var be=Cc;function Yo(e,t){var n=[];return e[t].forEach(function(i){var r=n.length;n.forEach(function(o,s){o.tag===i.tag&&o.kind===i.kind&&o.multi===i.multi&&(r=s)}),n[r]=i}),n}function Oc(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function i(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(i);return e}function er(e){return this.extend(e)}er.prototype.extend=function(t){var n=[],i=[];if(t instanceof be)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new je("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof be))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new je("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new je("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(o){if(!(o instanceof be))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(er.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=Yo(r,"implicit"),r.compiledExplicit=Yo(r,"explicit"),r.compiledTypeMap=Oc(r.compiledImplicit,r.compiledExplicit),r};var vc=er,Ec=new be("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),_c=new be("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Sc=new be("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Pc=new vc({explicit:[Ec,_c,Sc]});function jc(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Ic(){return null}function Mc(e){return e===null}var Fc=new be("tag:yaml.org,2002:null",{kind:"scalar",resolve:jc,construct:Ic,predicate:Mc,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Lc(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 Dc(e){return e==="true"||e==="True"||e==="TRUE"}function Nc(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Tc=new be("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Lc,construct:Dc,predicate:Nc,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 Uc(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Rc(e){return 48<=e&&e<=55}function $c(e){return 48<=e&&e<=57}function Wc(e){if(e===null)return!1;var t=e.length,n=0,i=!1,r;if(!t)return!1;if(r=e[n],(r==="-"||r==="+")&&(r=e[++n]),r==="0"){if(n+1===t)return!0;if(r=e[++n],r==="b"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;i=!0}return i&&r!=="_"}if(r==="x"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Uc(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Rc(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!$c(e.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function kc(e){var t=e,n=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(n=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="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 Hc(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!de.isNegativeZero(e)}var Yc=new be("tag:yaml.org,2002:int",{kind:"scalar",resolve:Wc,construct:kc,predicate:Hc,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"]}}),Gc=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Bc(e){return!(e===null||!Gc.test(e)||e[e.length-1]==="_")}function qc(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 zc=/^[-+]?[0-9]+e/;function Vc(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(de.isNegativeZero(e))return"-0.0";return n=e.toString(10),zc.test(n)?n.replace("e",".e"):n}function Kc(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||de.isNegativeZero(e))}var Qc=new be("tag:yaml.org,2002:float",{kind:"scalar",resolve:Bc,construct:qc,predicate:Kc,represent:Vc,defaultStyle:"lowercase"}),Jc=Pc.extend({implicit:[Fc,Tc,Yc,Qc]}),Zc=Jc,Go=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Bo=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 Xc(e){return e===null?!1:Go.exec(e)!==null||Bo.exec(e)!==null}function ef(e){var t,n,i,r,o,s,a,l=0,u=null,d,f,p;if(t=Go.exec(e),t===null&&(t=Bo.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],s=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(d=+t[10],f=+(t[11]||0),u=(d*60+f)*6e4,t[9]==="-"&&(u=-u)),p=new Date(Date.UTC(n,i,r,o,s,a,l)),u&&p.setTime(p.getTime()-u),p}function tf(e){return e.toISOString()}var nf=new be("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Xc,construct:ef,instanceOf:Date,represent:tf});function rf(e){return e==="<<"||e===null}var of=new be("tag:yaml.org,2002:merge",{kind:"scalar",resolve:rf}),tr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
71
- \r`;function sf(e){if(e===null)return!1;var t,n,i=0,r=e.length,o=tr;for(n=0;n<r;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function af(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=tr,s=0,a=[];for(t=0;t<r;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,n===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):n===18?(a.push(s>>10&255),a.push(s>>2&255)):n===12&&a.push(s>>4&255),new Uint8Array(a)}function lf(e){var t="",n=0,i,r,o=e.length,s=tr;for(i=0;i<o;i++)i%3===0&&i&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[i];return r=o%3,r===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):r===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):r===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function cf(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var ff=new be("tag:yaml.org,2002:binary",{kind:"scalar",resolve:sf,construct:af,predicate:cf,represent:lf}),uf=Object.prototype.hasOwnProperty,df=Object.prototype.toString;function pf(e){if(e===null)return!0;var t=[],n,i,r,o,s,a=e;for(n=0,i=a.length;n<i;n+=1){if(r=a[n],s=!1,df.call(r)!=="[object Object]")return!1;for(o in r)if(uf.call(r,o))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function hf(e){return e!==null?e:[]}var mf=new be("tag:yaml.org,2002:omap",{kind:"sequence",resolve:pf,construct:hf}),gf=Object.prototype.toString;function yf(e){if(e===null)return!0;var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(i=s[t],gf.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;o[t]=[r[0],i[r[0]]]}return!0}function bf(e){if(e===null)return[];var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)i=s[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var wf=new be("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:yf,construct:bf}),Af=Object.prototype.hasOwnProperty;function xf(e){if(e===null)return!0;var t,n=e;for(t in n)if(Af.call(n,t)&&n[t]!==null)return!1;return!0}function Cf(e){return e!==null?e:{}}var Of=new be("tag:yaml.org,2002:set",{kind:"mapping",resolve:xf,construct:Cf}),qo=Zc.extend({implicit:[nf,of],explicit:[ff,mf,wf,Of]}),mt=Object.prototype.hasOwnProperty,si=1,zo=2,Vo=3,ai=4,nr=1,vf=2,Ko=3,Ef=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,_f=/[\x85\u2028\u2029]/,Sf=/[,\[\]\{\}]/,Qo=/^(?:!|!!|![a-z\-]+!)$/i,Jo=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Zo(e){return Object.prototype.toString.call(e)}function et(e){return e===10||e===13}function qt(e){return e===9||e===32}function Ie(e){return e===9||e===32||e===10||e===13}function cn(e){return e===44||e===91||e===93||e===123||e===125}function Pf(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function jf(e){return e===120?2:e===117?4:e===85?8:0}function If(e){return 48<=e&&e<=57?e-48:-1}function Xo(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
72
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Mf(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var es=new Array(256),ts=new Array(256);for(zt=0;zt<256;zt++)es[zt]=Xo(zt)?1:0,ts[zt]=Xo(zt);var zt;function Ff(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||qo,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 ns(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=bc(n),new je(t,n)}function N(e,t){throw ns(e,t)}function li(e,t){e.onWarning&&e.onWarning.call(null,ns(e,t))}var is={YAML:function(t,n,i){var r,o,s;t.version!==null&&N(t,"duplication of %YAML directive"),i.length!==1&&N(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&N(t,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),s=parseInt(r[2],10),o!==1&&N(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&li(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,o;i.length!==2&&N(t,"TAG directive accepts exactly two arguments"),r=i[0],o=i[1],Qo.test(r)||N(t,"ill-formed tag handle (first argument) of the TAG directive"),mt.call(t.tagMap,r)&&N(t,'there is a previously declared suffix for "'+r+'" tag handle'),Jo.test(o)||N(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch(s){N(t,"tag prefix is malformed: "+o)}t.tagMap[r]=o}};function gt(e,t,n,i){var r,o,s,a;if(t<n){if(a=e.input.slice(t,n),i)for(r=0,o=a.length;r<o;r+=1)s=a.charCodeAt(r),s===9||32<=s&&s<=1114111||N(e,"expected valid JSON character");else Ef.test(a)&&N(e,"the stream contains non-printable characters");e.result+=a}}function rs(e,t,n,i){var r,o,s,a;for(de.isObject(n)||N(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),s=0,a=r.length;s<a;s+=1)o=r[s],mt.call(t,o)||(t[o]=n[o],i[o]=!0)}function fn(e,t,n,i,r,o,s,a,l){var u,d;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),u=0,d=r.length;u<d;u+=1)Array.isArray(r[u])&&N(e,"nested arrays are not supported inside keys"),typeof r=="object"&&Zo(r[u])==="[object Object]"&&(r[u]="[object Object]");if(typeof r=="object"&&Zo(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(u=0,d=o.length;u<d;u+=1)rs(e,t,o[u],n);else rs(e,t,o,n);else!e.json&&!mt.call(n,r)&&mt.call(t,r)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,N(e,"duplicated mapping key")),r==="__proto__"?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:o}):t[r]=o,delete n[r];return t}function ir(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++):N(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function fe(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;qt(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(et(r))for(ir(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return n!==-1&&i!==0&&e.lineIndent<n&&li(e,"deficient indentation"),i}function ci(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||Ie(n)))}function rr(e,t){t===1?e.result+=" ":t>1&&(e.result+=de.repeat(`
73
- `,t-1))}function Lf(e,t,n){var i,r,o,s,a,l,u,d,f=e.kind,p=e.result,y;if(y=e.input.charCodeAt(e.position),Ie(y)||cn(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(r=e.input.charCodeAt(e.position+1),Ie(r)||n&&cn(r)))return!1;for(e.kind="scalar",e.result="",o=s=e.position,a=!1;y!==0;){if(y===58){if(r=e.input.charCodeAt(e.position+1),Ie(r)||n&&cn(r))break}else if(y===35){if(i=e.input.charCodeAt(e.position-1),Ie(i))break}else{if(e.position===e.lineStart&&ci(e)||n&&cn(y))break;if(et(y))if(l=e.line,u=e.lineStart,d=e.lineIndent,fe(e,!1,-1),e.lineIndent>=t){a=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=u,e.lineIndent=d;break}}a&&(gt(e,o,s,!1),rr(e,e.line-l),o=s=e.position,a=!1),qt(y)||(s=e.position+1),y=e.input.charCodeAt(++e.position)}return gt(e,o,s,!1),e.result?!0:(e.kind=f,e.result=p,!1)}function Df(e,t){var n,i,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(gt(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)i=e.position,e.position++,r=e.position;else return!0;else et(n)?(gt(e,i,r,!0),rr(e,fe(e,!1,t)),i=r=e.position):e.position===e.lineStart&&ci(e)?N(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);N(e,"unexpected end of the stream within a single quoted scalar")}function Nf(e,t){var n,i,r,o,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return gt(e,n,e.position,!0),e.position++,!0;if(a===92){if(gt(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),et(a))fe(e,!1,t);else if(a<256&&es[a])e.result+=ts[a],e.position++;else if((s=jf(a))>0){for(r=s,o=0;r>0;r--)a=e.input.charCodeAt(++e.position),(s=Pf(a))>=0?o=(o<<4)+s:N(e,"expected hexadecimal character");e.result+=Mf(o),e.position++}else N(e,"unknown escape sequence");n=i=e.position}else et(a)?(gt(e,n,i,!0),rr(e,fe(e,!1,t)),n=i=e.position):e.position===e.lineStart&&ci(e)?N(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}N(e,"unexpected end of the stream within a double quoted scalar")}function Tf(e,t){var n=!0,i,r,o,s=e.tag,a,l=e.anchor,u,d,f,p,y,C=Object.create(null),A,m,S,E;if(E=e.input.charCodeAt(e.position),E===91)d=93,y=!1,a=[];else if(E===123)d=125,y=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),E=e.input.charCodeAt(++e.position);E!==0;){if(fe(e,!0,t),E=e.input.charCodeAt(e.position),E===d)return e.position++,e.tag=s,e.anchor=l,e.kind=y?"mapping":"sequence",e.result=a,!0;n?E===44&&N(e,"expected the node content, but found ','"):N(e,"missed comma between flow collection entries"),m=A=S=null,f=p=!1,E===63&&(u=e.input.charCodeAt(e.position+1),Ie(u)&&(f=p=!0,e.position++,fe(e,!0,t))),i=e.line,r=e.lineStart,o=e.position,un(e,t,si,!1,!0),m=e.tag,A=e.result,fe(e,!0,t),E=e.input.charCodeAt(e.position),(p||e.line===i)&&E===58&&(f=!0,E=e.input.charCodeAt(++e.position),fe(e,!0,t),un(e,t,si,!1,!0),S=e.result),y?fn(e,a,C,m,A,S,i,r,o):f?a.push(fn(e,null,C,m,A,S,i,r,o)):a.push(A),fe(e,!0,t),E=e.input.charCodeAt(e.position),E===44?(n=!0,E=e.input.charCodeAt(++e.position)):n=!1}N(e,"unexpected end of the stream within a flow collection")}function Uf(e,t){var n,i,r=nr,o=!1,s=!1,a=t,l=0,u=!1,d,f;if(f=e.input.charCodeAt(e.position),f===124)i=!1;else if(f===62)i=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)nr===r?r=f===43?Ko:vf:N(e,"repeat of a chomping mode identifier");else if((d=If(f))>=0)d===0?N(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?N(e,"repeat of an indentation width identifier"):(a=t+d-1,s=!0);else break;if(qt(f)){do f=e.input.charCodeAt(++e.position);while(qt(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!et(f)&&f!==0)}for(;f!==0;){for(ir(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),et(f)){l++;continue}if(e.lineIndent<a){r===Ko?e.result+=de.repeat(`
74
- `,o?1+l:l):r===nr&&o&&(e.result+=`
75
- `);break}for(i?qt(f)?(u=!0,e.result+=de.repeat(`
70
+ `;return a.replace(/\n$/,"")}var bc=yc,wc=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ac=["scalar","sequence","mapping"];function xc(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(i){t[String(i)]=n})}),t}function Cc(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(wc.indexOf(n)===-1)throw new je('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=xc(t.styleAliases||null),Ac.indexOf(this.kind)===-1)throw new je('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var be=Cc;function ko(e,t){var n=[];return e[t].forEach(function(i){var r=n.length;n.forEach(function(o,s){o.tag===i.tag&&o.kind===i.kind&&o.multi===i.multi&&(r=s)}),n[r]=i}),n}function Oc(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function i(r){r.multi?(e.multi[r.kind].push(r),e.multi.fallback.push(r)):e[r.kind][r.tag]=e.fallback[r.tag]=r}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(i);return e}function tr(e){return this.extend(e)}tr.prototype.extend=function(t){var n=[],i=[];if(t instanceof be)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new je("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof be))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new je("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new je("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(o){if(!(o instanceof be))throw new je("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(tr.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=ko(r,"implicit"),r.compiledExplicit=ko(r,"explicit"),r.compiledTypeMap=Oc(r.compiledImplicit,r.compiledExplicit),r};var vc=tr,Ec=new be("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),_c=new be("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Sc=new be("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Pc=new vc({explicit:[Ec,_c,Sc]});function jc(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Ic(){return null}function Mc(e){return e===null}var Fc=new be("tag:yaml.org,2002:null",{kind:"scalar",resolve:jc,construct:Ic,predicate:Mc,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Lc(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 Dc(e){return e==="true"||e==="True"||e==="TRUE"}function Nc(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Tc=new be("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Lc,construct:Dc,predicate:Nc,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 Uc(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Rc(e){return 48<=e&&e<=55}function $c(e){return 48<=e&&e<=57}function Wc(e){if(e===null)return!1;var t=e.length,n=0,i=!1,r;if(!t)return!1;if(r=e[n],(r==="-"||r==="+")&&(r=e[++n]),r==="0"){if(n+1===t)return!0;if(r=e[++n],r==="b"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;i=!0}return i&&r!=="_"}if(r==="x"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Uc(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<t;n++)if(r=e[n],r!=="_"){if(!Rc(e.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++)if(r=e[n],r!=="_"){if(!$c(e.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function kc(e){var t=e,n=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(n=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="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 Hc(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!de.isNegativeZero(e)}var Yc=new be("tag:yaml.org,2002:int",{kind:"scalar",resolve:Wc,construct:kc,predicate:Hc,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"]}}),Gc=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Bc(e){return!(e===null||!Gc.test(e)||e[e.length-1]==="_")}function qc(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 zc=/^[-+]?[0-9]+e/;function Vc(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(de.isNegativeZero(e))return"-0.0";return n=e.toString(10),zc.test(n)?n.replace("e",".e"):n}function Kc(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||de.isNegativeZero(e))}var Qc=new be("tag:yaml.org,2002:float",{kind:"scalar",resolve:Bc,construct:qc,predicate:Kc,represent:Vc,defaultStyle:"lowercase"}),Jc=Pc.extend({implicit:[Fc,Tc,Yc,Qc]}),Zc=Jc,rs=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),os=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 Xc(e){return e===null?!1:rs.exec(e)!==null||os.exec(e)!==null}function ef(e){var t,n,i,r,o,s,a,l=0,u=null,d,f,p;if(t=rs.exec(e),t===null&&(t=os.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],s=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(d=+t[10],f=+(t[11]||0),u=(d*60+f)*6e4,t[9]==="-"&&(u=-u)),p=new Date(Date.UTC(n,i,r,o,s,a,l)),u&&p.setTime(p.getTime()-u),p}function tf(e){return e.toISOString()}var nf=new be("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Xc,construct:ef,instanceOf:Date,represent:tf});function rf(e){return e==="<<"||e===null}var of=new be("tag:yaml.org,2002:merge",{kind:"scalar",resolve:rf}),sr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
71
+ \r`;function sf(e){if(e===null)return!1;var t,n,i=0,r=e.length,o=sr;for(n=0;n<r;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function af(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=sr,s=0,a=[];for(t=0;t<r;t++)t%4===0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,n===0?(a.push(s>>16&255),a.push(s>>8&255),a.push(s&255)):n===18?(a.push(s>>10&255),a.push(s>>2&255)):n===12&&a.push(s>>4&255),new Uint8Array(a)}function lf(e){var t="",n=0,i,r,o=e.length,s=sr;for(i=0;i<o;i++)i%3===0&&i&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[i];return r=o%3,r===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):r===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):r===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function cf(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var ff=new be("tag:yaml.org,2002:binary",{kind:"scalar",resolve:sf,construct:af,predicate:cf,represent:lf}),uf=Object.prototype.hasOwnProperty,df=Object.prototype.toString;function pf(e){if(e===null)return!0;var t=[],n,i,r,o,s,a=e;for(n=0,i=a.length;n<i;n+=1){if(r=a[n],s=!1,df.call(r)!=="[object Object]")return!1;for(o in r)if(uf.call(r,o))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function hf(e){return e!==null?e:[]}var mf=new be("tag:yaml.org,2002:omap",{kind:"sequence",resolve:pf,construct:hf}),gf=Object.prototype.toString;function yf(e){if(e===null)return!0;var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(i=s[t],gf.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;o[t]=[r[0],i[r[0]]]}return!0}function bf(e){if(e===null)return[];var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)i=s[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var wf=new be("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:yf,construct:bf}),Af=Object.prototype.hasOwnProperty;function xf(e){if(e===null)return!0;var t,n=e;for(t in n)if(Af.call(n,t)&&n[t]!==null)return!1;return!0}function Cf(e){return e!==null?e:{}}var Of=new be("tag:yaml.org,2002:set",{kind:"mapping",resolve:xf,construct:Cf}),ss=Zc.extend({implicit:[nf,of],explicit:[ff,mf,wf,Of]}),gt=Object.prototype.hasOwnProperty,si=1,as=2,ls=3,ai=4,er=1,vf=2,Ho=3,Ef=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,_f=/[\x85\u2028\u2029]/,Sf=/[,\[\]\{\}]/,cs=/^(?:!|!!|![a-z\-]+!)$/i,fs=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Yo(e){return Object.prototype.toString.call(e)}function et(e){return e===10||e===13}function zt(e){return e===9||e===32}function Ie(e){return e===9||e===32||e===10||e===13}function fn(e){return e===44||e===91||e===93||e===123||e===125}function Pf(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function jf(e){return e===120?2:e===117?4:e===85?8:0}function If(e){return 48<=e&&e<=57?e-48:-1}function Go(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
72
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Mf(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var us=new Array(256),ds=new Array(256);for(qt=0;qt<256;qt++)us[qt]=Go(qt)?1:0,ds[qt]=Go(qt);var qt;function Ff(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||ss,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 ps(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=bc(n),new je(t,n)}function N(e,t){throw ps(e,t)}function li(e,t){e.onWarning&&e.onWarning.call(null,ps(e,t))}var Bo={YAML:function(t,n,i){var r,o,s;t.version!==null&&N(t,"duplication of %YAML directive"),i.length!==1&&N(t,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&N(t,"ill-formed argument of the YAML directive"),o=parseInt(r[1],10),s=parseInt(r[2],10),o!==1&&N(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&li(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var r,o;i.length!==2&&N(t,"TAG directive accepts exactly two arguments"),r=i[0],o=i[1],cs.test(r)||N(t,"ill-formed tag handle (first argument) of the TAG directive"),gt.call(t.tagMap,r)&&N(t,'there is a previously declared suffix for "'+r+'" tag handle'),fs.test(o)||N(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch(s){N(t,"tag prefix is malformed: "+o)}t.tagMap[r]=o}};function mt(e,t,n,i){var r,o,s,a;if(t<n){if(a=e.input.slice(t,n),i)for(r=0,o=a.length;r<o;r+=1)s=a.charCodeAt(r),s===9||32<=s&&s<=1114111||N(e,"expected valid JSON character");else Ef.test(a)&&N(e,"the stream contains non-printable characters");e.result+=a}}function qo(e,t,n,i){var r,o,s,a;for(de.isObject(n)||N(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),s=0,a=r.length;s<a;s+=1)o=r[s],gt.call(t,o)||(t[o]=n[o],i[o]=!0)}function un(e,t,n,i,r,o,s,a,l){var u,d;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),u=0,d=r.length;u<d;u+=1)Array.isArray(r[u])&&N(e,"nested arrays are not supported inside keys"),typeof r=="object"&&Yo(r[u])==="[object Object]"&&(r[u]="[object Object]");if(typeof r=="object"&&Yo(r)==="[object Object]"&&(r="[object Object]"),r=String(r),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(u=0,d=o.length;u<d;u+=1)qo(e,t,o[u],n);else qo(e,t,o,n);else!e.json&&!gt.call(n,r)&&gt.call(t,r)&&(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,N(e,"duplicated mapping key")),r==="__proto__"?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:o}):t[r]=o,delete n[r];return t}function ar(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++):N(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function fe(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);r!==0;){for(;zt(r);)r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(et(r))for(ar(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position);else break}return n!==-1&&i!==0&&e.lineIndent<n&&li(e,"deficient indentation"),i}function ui(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||Ie(n)))}function lr(e,t){t===1?e.result+=" ":t>1&&(e.result+=de.repeat(`
73
+ `,t-1))}function Lf(e,t,n){var i,r,o,s,a,l,u,d,f=e.kind,p=e.result,y;if(y=e.input.charCodeAt(e.position),Ie(y)||fn(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(r=e.input.charCodeAt(e.position+1),Ie(r)||n&&fn(r)))return!1;for(e.kind="scalar",e.result="",o=s=e.position,a=!1;y!==0;){if(y===58){if(r=e.input.charCodeAt(e.position+1),Ie(r)||n&&fn(r))break}else if(y===35){if(i=e.input.charCodeAt(e.position-1),Ie(i))break}else{if(e.position===e.lineStart&&ui(e)||n&&fn(y))break;if(et(y))if(l=e.line,u=e.lineStart,d=e.lineIndent,fe(e,!1,-1),e.lineIndent>=t){a=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=u,e.lineIndent=d;break}}a&&(mt(e,o,s,!1),lr(e,e.line-l),o=s=e.position,a=!1),zt(y)||(s=e.position+1),y=e.input.charCodeAt(++e.position)}return mt(e,o,s,!1),e.result?!0:(e.kind=f,e.result=p,!1)}function Df(e,t){var n,i,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(mt(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)i=e.position,e.position++,r=e.position;else return!0;else et(n)?(mt(e,i,r,!0),lr(e,fe(e,!1,t)),i=r=e.position):e.position===e.lineStart&&ui(e)?N(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);N(e,"unexpected end of the stream within a single quoted scalar")}function Nf(e,t){var n,i,r,o,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return mt(e,n,e.position,!0),e.position++,!0;if(a===92){if(mt(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),et(a))fe(e,!1,t);else if(a<256&&us[a])e.result+=ds[a],e.position++;else if((s=jf(a))>0){for(r=s,o=0;r>0;r--)a=e.input.charCodeAt(++e.position),(s=Pf(a))>=0?o=(o<<4)+s:N(e,"expected hexadecimal character");e.result+=Mf(o),e.position++}else N(e,"unknown escape sequence");n=i=e.position}else et(a)?(mt(e,n,i,!0),lr(e,fe(e,!1,t)),n=i=e.position):e.position===e.lineStart&&ui(e)?N(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}N(e,"unexpected end of the stream within a double quoted scalar")}function Tf(e,t){var n=!0,i,r,o,s=e.tag,a,l=e.anchor,u,d,f,p,y,C=Object.create(null),A,m,S,E;if(E=e.input.charCodeAt(e.position),E===91)d=93,y=!1,a=[];else if(E===123)d=125,y=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),E=e.input.charCodeAt(++e.position);E!==0;){if(fe(e,!0,t),E=e.input.charCodeAt(e.position),E===d)return e.position++,e.tag=s,e.anchor=l,e.kind=y?"mapping":"sequence",e.result=a,!0;n?E===44&&N(e,"expected the node content, but found ','"):N(e,"missed comma between flow collection entries"),m=A=S=null,f=p=!1,E===63&&(u=e.input.charCodeAt(e.position+1),Ie(u)&&(f=p=!0,e.position++,fe(e,!0,t))),i=e.line,r=e.lineStart,o=e.position,dn(e,t,si,!1,!0),m=e.tag,A=e.result,fe(e,!0,t),E=e.input.charCodeAt(e.position),(p||e.line===i)&&E===58&&(f=!0,E=e.input.charCodeAt(++e.position),fe(e,!0,t),dn(e,t,si,!1,!0),S=e.result),y?un(e,a,C,m,A,S,i,r,o):f?a.push(un(e,null,C,m,A,S,i,r,o)):a.push(A),fe(e,!0,t),E=e.input.charCodeAt(e.position),E===44?(n=!0,E=e.input.charCodeAt(++e.position)):n=!1}N(e,"unexpected end of the stream within a flow collection")}function Uf(e,t){var n,i,r=er,o=!1,s=!1,a=t,l=0,u=!1,d,f;if(f=e.input.charCodeAt(e.position),f===124)i=!1;else if(f===62)i=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)er===r?r=f===43?Ho:vf:N(e,"repeat of a chomping mode identifier");else if((d=If(f))>=0)d===0?N(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?N(e,"repeat of an indentation width identifier"):(a=t+d-1,s=!0);else break;if(zt(f)){do f=e.input.charCodeAt(++e.position);while(zt(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!et(f)&&f!==0)}for(;f!==0;){for(ar(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!s||e.lineIndent<a)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a&&(a=e.lineIndent),et(f)){l++;continue}if(e.lineIndent<a){r===Ho?e.result+=de.repeat(`
74
+ `,o?1+l:l):r===er&&o&&(e.result+=`
75
+ `);break}for(i?zt(f)?(u=!0,e.result+=de.repeat(`
76
76
  `,o?1+l:l)):u?(u=!1,e.result+=de.repeat(`
77
77
  `,l+1)):l===0?o&&(e.result+=" "):e.result+=de.repeat(`
78
78
  `,l):e.result+=de.repeat(`
79
- `,o?1+l:l),o=!0,s=!0,l=0,n=e.position;!et(f)&&f!==0;)f=e.input.charCodeAt(++e.position);gt(e,n,e.position,!1)}return!0}function os(e,t){var n,i=e.tag,r=e.anchor,o=[],s,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,N(e,"tab characters must not be used in indentation")),!(l!==45||(s=e.input.charCodeAt(e.position+1),!Ie(s))));){if(a=!0,e.position++,fe(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,un(e,t,Vo,!1,!0),o.push(e.result),fe(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)N(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=i,e.anchor=r,e.kind="sequence",e.result=o,!0):!1}function Rf(e,t,n){var i,r,o,s,a,l,u=e.tag,d=e.anchor,f={},p=Object.create(null),y=null,C=null,A=null,m=!1,S=!1,E;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),E=e.input.charCodeAt(e.position);E!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,N(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),o=e.line,(E===63||E===58)&&Ie(i))E===63?(m&&(fn(e,f,p,y,C,null,s,a,l),y=C=A=null),S=!0,m=!0,r=!0):m?(m=!1,r=!0):N(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,E=i;else{if(s=e.line,a=e.lineStart,l=e.position,!un(e,n,zo,!1,!0))break;if(e.line===o){for(E=e.input.charCodeAt(e.position);qt(E);)E=e.input.charCodeAt(++e.position);if(E===58)E=e.input.charCodeAt(++e.position),Ie(E)||N(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(fn(e,f,p,y,C,null,s,a,l),y=C=A=null),S=!0,m=!1,r=!1,y=e.tag,C=e.result;else if(S)N(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=d,!0}else if(S)N(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=d,!0}if((e.line===o||e.lineIndent>t)&&(m&&(s=e.line,a=e.lineStart,l=e.position),un(e,t,ai,!0,r)&&(m?C=e.result:A=e.result),m||(fn(e,f,p,y,C,A,s,a,l),y=C=A=null),fe(e,!0,-1),E=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&E!==0)N(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&fn(e,f,p,y,C,null,s,a,l),S&&(e.tag=u,e.anchor=d,e.kind="mapping",e.result=f),S}function $f(e){var t,n=!1,i=!1,r,o,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&N(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(i=!0,r="!!",s=e.input.charCodeAt(++e.position)):r="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(o=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):N(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Ie(s);)s===33&&(i?N(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),Qo.test(r)||N(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),Sf.test(o)&&N(e,"tag suffix cannot contain flow indicator characters")}o&&!Jo.test(o)&&N(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch(a){N(e,"tag name is malformed: "+o)}return n?e.tag=o:mt.call(e.tagMap,r)?e.tag=e.tagMap[r]+o:r==="!"?e.tag="!"+o:r==="!!"?e.tag="tag:yaml.org,2002:"+o:N(e,'undeclared tag handle "'+r+'"'),!0}function Wf(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&N(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Ie(n)&&!cn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function kf(e){var t,n,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Ie(i)&&!cn(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),mt.call(e.anchorMap,n)||N(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],fe(e,!0,-1),!0}function un(e,t,n,i,r){var o,s,a,l=1,u=!1,d=!1,f,p,y,C,A,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=ai===n||Vo===n,i&&fe(e,!0,-1)&&(u=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;$f(e)||Wf(e);)fe(e,!0,-1)?(u=!0,a=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=u||r),(l===1||ai===n)&&(si===n||zo===n?A=t:A=t+1,m=e.position-e.lineStart,l===1?a&&(os(e,m)||Rf(e,m,A))||Tf(e,A)?d=!0:(s&&Uf(e,A)||Df(e,A)||Nf(e,A)?d=!0:kf(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&N(e,"alias node should not have any properties")):Lf(e,A,si===n)&&(d=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(d=a&&os(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"&&N(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,p=e.implicitTypes.length;f<p;f+=1)if(C=e.implicitTypes[f],C.resolve(e.result)){e.result=C.construct(e.result),e.tag=C.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(mt.call(e.typeMap[e.kind||"fallback"],e.tag))C=e.typeMap[e.kind||"fallback"][e.tag];else for(C=null,y=e.typeMap.multi[e.kind||"fallback"],f=0,p=y.length;f<p;f+=1)if(e.tag.slice(0,y[f].tag.length)===y[f].tag){C=y[f];break}C||N(e,"unknown tag !<"+e.tag+">"),e.result!==null&&C.kind!==e.kind&&N(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+C.kind+'", not "'+e.kind+'"'),C.resolve(e.result,e.tag)?(e.result=C.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):N(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||d}function Hf(e){var t=e.position,n,i,r,o=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(fe(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(o=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!Ie(s);)s=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&N(e,"directive name must not be less than one character in length");s!==0;){for(;qt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!et(s));break}if(et(s))break;for(n=e.position;s!==0&&!Ie(s);)s=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}s!==0&&ir(e),mt.call(is,i)?is[i](e,i,r):li(e,'unknown document directive "'+i+'"')}if(fe(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,fe(e,!0,-1)):o&&N(e,"directives end mark is expected"),un(e,e.lineIndent-1,ai,!1,!0),fe(e,!0,-1),e.checkLineBreaks&&_f.test(e.input.slice(t,e.position))&&li(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ci(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,fe(e,!0,-1));return}if(e.position<e.length-1)N(e,"end of the stream or a document separator is expected");else return}function ss(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
80
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Ff(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,N(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;)Hf(n);return n.documents}function Yf(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var i=ss(e,n);if(typeof t!="function")return i;for(var r=0,o=i.length;r<o;r+=1)t(i[r])}function Gf(e,t){var n=ss(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new je("expected a single document in the stream, but found more")}}var Bf=Yf,qf=Gf,as={loadAll:Bf,load:qf},ls=Object.prototype.toString,cs=Object.prototype.hasOwnProperty,or=65279,zf=9,Sn=10,Vf=13,Kf=32,Qf=33,Jf=34,sr=35,Zf=37,Xf=38,eu=39,tu=42,fs=44,nu=45,fi=58,iu=61,ru=62,ou=63,su=64,us=91,ds=93,au=96,ps=123,lu=124,hs=125,we={};we[0]="\\0";we[7]="\\a";we[8]="\\b";we[9]="\\t";we[10]="\\n";we[11]="\\v";we[12]="\\f";we[13]="\\r";we[27]="\\e";we[34]='\\"';we[92]="\\\\";we[133]="\\N";we[160]="\\_";we[8232]="\\L";we[8233]="\\P";var cu=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],fu=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function uu(e,t){var n,i,r,o,s,a,l;if(t===null)return{};for(n={},i=Object.keys(t),r=0,o=i.length;r<o;r+=1)s=i[r],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=e.compiledTypeMap.fallback[s],l&&cs.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[s]=a;return n}function du(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else if(e<=4294967295)n="U",i=8;else throw new je("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+de.repeat("0",i-t.length)+t}var pu=1,Pn=2;function hu(e){this.schema=e.schema||qo,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=de.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=uu(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==='"'?Pn:pu,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 ms(e,t){for(var n=de.repeat(" ",t),i=0,r=-1,o="",s,a=e.length;i<a;)r=e.indexOf(`
79
+ `,o?1+l:l),o=!0,s=!0,l=0,n=e.position;!et(f)&&f!==0;)f=e.input.charCodeAt(++e.position);mt(e,n,e.position,!1)}return!0}function zo(e,t){var n,i=e.tag,r=e.anchor,o=[],s,a=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,N(e,"tab characters must not be used in indentation")),!(l!==45||(s=e.input.charCodeAt(e.position+1),!Ie(s))));){if(a=!0,e.position++,fe(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(n=e.line,dn(e,t,ls,!1,!0),o.push(e.result),fe(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)N(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=i,e.anchor=r,e.kind="sequence",e.result=o,!0):!1}function Rf(e,t,n){var i,r,o,s,a,l,u=e.tag,d=e.anchor,f={},p=Object.create(null),y=null,C=null,A=null,m=!1,S=!1,E;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),E=e.input.charCodeAt(e.position);E!==0;){if(!m&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,N(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),o=e.line,(E===63||E===58)&&Ie(i))E===63?(m&&(un(e,f,p,y,C,null,s,a,l),y=C=A=null),S=!0,m=!0,r=!0):m?(m=!1,r=!0):N(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,E=i;else{if(s=e.line,a=e.lineStart,l=e.position,!dn(e,n,as,!1,!0))break;if(e.line===o){for(E=e.input.charCodeAt(e.position);zt(E);)E=e.input.charCodeAt(++e.position);if(E===58)E=e.input.charCodeAt(++e.position),Ie(E)||N(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(un(e,f,p,y,C,null,s,a,l),y=C=A=null),S=!0,m=!1,r=!1,y=e.tag,C=e.result;else if(S)N(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=d,!0}else if(S)N(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=d,!0}if((e.line===o||e.lineIndent>t)&&(m&&(s=e.line,a=e.lineStart,l=e.position),dn(e,t,ai,!0,r)&&(m?C=e.result:A=e.result),m||(un(e,f,p,y,C,A,s,a,l),y=C=A=null),fe(e,!0,-1),E=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&E!==0)N(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&un(e,f,p,y,C,null,s,a,l),S&&(e.tag=u,e.anchor=d,e.kind="mapping",e.result=f),S}function $f(e){var t,n=!1,i=!1,r,o,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&N(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(i=!0,r="!!",s=e.input.charCodeAt(++e.position)):r="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(o=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):N(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Ie(s);)s===33&&(i?N(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),cs.test(r)||N(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),Sf.test(o)&&N(e,"tag suffix cannot contain flow indicator characters")}o&&!fs.test(o)&&N(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch(a){N(e,"tag name is malformed: "+o)}return n?e.tag=o:gt.call(e.tagMap,r)?e.tag=e.tagMap[r]+o:r==="!"?e.tag="!"+o:r==="!!"?e.tag="tag:yaml.org,2002:"+o:N(e,'undeclared tag handle "'+r+'"'),!0}function Wf(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&N(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Ie(n)&&!fn(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function kf(e){var t,n,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Ie(i)&&!fn(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),gt.call(e.anchorMap,n)||N(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],fe(e,!0,-1),!0}function dn(e,t,n,i,r){var o,s,a,l=1,u=!1,d=!1,f,p,y,C,A,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=ai===n||ls===n,i&&fe(e,!0,-1)&&(u=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;$f(e)||Wf(e);)fe(e,!0,-1)?(u=!0,a=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):a=!1;if(a&&(a=u||r),(l===1||ai===n)&&(si===n||as===n?A=t:A=t+1,m=e.position-e.lineStart,l===1?a&&(zo(e,m)||Rf(e,m,A))||Tf(e,A)?d=!0:(s&&Uf(e,A)||Df(e,A)||Nf(e,A)?d=!0:kf(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&N(e,"alias node should not have any properties")):Lf(e,A,si===n)&&(d=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(d=a&&zo(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"&&N(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,p=e.implicitTypes.length;f<p;f+=1)if(C=e.implicitTypes[f],C.resolve(e.result)){e.result=C.construct(e.result),e.tag=C.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(gt.call(e.typeMap[e.kind||"fallback"],e.tag))C=e.typeMap[e.kind||"fallback"][e.tag];else for(C=null,y=e.typeMap.multi[e.kind||"fallback"],f=0,p=y.length;f<p;f+=1)if(e.tag.slice(0,y[f].tag.length)===y[f].tag){C=y[f];break}C||N(e,"unknown tag !<"+e.tag+">"),e.result!==null&&C.kind!==e.kind&&N(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+C.kind+'", not "'+e.kind+'"'),C.resolve(e.result,e.tag)?(e.result=C.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):N(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||d}function Hf(e){var t=e.position,n,i,r,o=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(fe(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(o=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!Ie(s);)s=e.input.charCodeAt(++e.position);for(i=e.input.slice(n,e.position),r=[],i.length<1&&N(e,"directive name must not be less than one character in length");s!==0;){for(;zt(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!et(s));break}if(et(s))break;for(n=e.position;s!==0&&!Ie(s);)s=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}s!==0&&ar(e),gt.call(Bo,i)?Bo[i](e,i,r):li(e,'unknown document directive "'+i+'"')}if(fe(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,fe(e,!0,-1)):o&&N(e,"directives end mark is expected"),dn(e,e.lineIndent-1,ai,!1,!0),fe(e,!0,-1),e.checkLineBreaks&&_f.test(e.input.slice(t,e.position))&&li(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ui(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,fe(e,!0,-1));return}if(e.position<e.length-1)N(e,"end of the stream or a document separator is expected");else return}function hs(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
80
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Ff(e,t),i=e.indexOf("\0");for(i!==-1&&(n.position=i,N(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;)Hf(n);return n.documents}function Yf(e,t,n){t!==null&&typeof t=="object"&&typeof n=="undefined"&&(n=t,t=null);var i=hs(e,n);if(typeof t!="function")return i;for(var r=0,o=i.length;r<o;r+=1)t(i[r])}function Gf(e,t){var n=hs(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new je("expected a single document in the stream, but found more")}}var Bf=Yf,qf=Gf,ms={loadAll:Bf,load:qf},gs=Object.prototype.toString,ys=Object.prototype.hasOwnProperty,cr=65279,zf=9,Pn=10,Vf=13,Kf=32,Qf=33,Jf=34,nr=35,Zf=37,Xf=38,eu=39,tu=42,bs=44,nu=45,ci=58,iu=61,ru=62,ou=63,su=64,ws=91,As=93,au=96,xs=123,lu=124,Cs=125,we={};we[0]="\\0";we[7]="\\a";we[8]="\\b";we[9]="\\t";we[10]="\\n";we[11]="\\v";we[12]="\\f";we[13]="\\r";we[27]="\\e";we[34]='\\"';we[92]="\\\\";we[133]="\\N";we[160]="\\_";we[8232]="\\L";we[8233]="\\P";var cu=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],fu=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function uu(e,t){var n,i,r,o,s,a,l;if(t===null)return{};for(n={},i=Object.keys(t),r=0,o=i.length;r<o;r+=1)s=i[r],a=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),l=e.compiledTypeMap.fallback[s],l&&ys.call(l.styleAliases,a)&&(a=l.styleAliases[a]),n[s]=a;return n}function du(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else if(e<=4294967295)n="U",i=8;else throw new je("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+de.repeat("0",i-t.length)+t}var pu=1,jn=2;function hu(e){this.schema=e.schema||ss,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=de.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=uu(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==='"'?jn:pu,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 Vo(e,t){for(var n=de.repeat(" ",t),i=0,r=-1,o="",s,a=e.length;i<a;)r=e.indexOf(`
81
81
  `,i),r===-1?(s=e.slice(i),i=a):(s=e.slice(i,r+1),i=r+1),s.length&&s!==`
82
- `&&(o+=n),o+=s;return o}function ar(e,t){return`
83
- `+de.repeat(" ",e.indent*t)}function mu(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;n<i;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function ui(e){return e===Kf||e===zf}function jn(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==or||65536<=e&&e<=1114111}function gs(e){return jn(e)&&e!==or&&e!==Vf&&e!==Sn}function ys(e,t,n){var i=gs(e),r=i&&!ui(e);return(n?i:i&&e!==fs&&e!==us&&e!==ds&&e!==ps&&e!==hs)&&e!==sr&&!(t===fi&&!r)||gs(t)&&!ui(t)&&e===sr||t===fi&&r}function gu(e){return jn(e)&&e!==or&&!ui(e)&&e!==nu&&e!==ou&&e!==fi&&e!==fs&&e!==us&&e!==ds&&e!==ps&&e!==hs&&e!==sr&&e!==Xf&&e!==tu&&e!==Qf&&e!==lu&&e!==iu&&e!==ru&&e!==eu&&e!==Jf&&e!==Zf&&e!==su&&e!==au}function yu(e){return!ui(e)&&e!==fi}function In(e,t){var n=e.charCodeAt(t),i;return n>=55296&&n<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function bs(e){var t=/^\n* /;return t.test(e)}var ws=1,lr=2,As=3,xs=4,dn=5;function bu(e,t,n,i,r,o,s,a){var l,u=0,d=null,f=!1,p=!1,y=i!==-1,C=-1,A=gu(In(e,0))&&yu(In(e,e.length-1));if(t||s)for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=In(e,l),!jn(u))return dn;A=A&&ys(u,d,a),d=u}else{for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=In(e,l),u===Sn)f=!0,y&&(p=p||l-C-1>i&&e[C+1]!==" ",C=l);else if(!jn(u))return dn;A=A&&ys(u,d,a),d=u}p=p||y&&l-C-1>i&&e[C+1]!==" "}return!f&&!p?A&&!s&&!r(e)?ws:o===Pn?dn:lr:n>9&&bs(e)?dn:s?o===Pn?dn:lr:p?xs:As}function wu(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===Pn?'""':"''";if(!e.noCompatMode&&(cu.indexOf(t)!==-1||fu.test(t)))return e.quotingType===Pn?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(u){return mu(e,u)}switch(bu(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!i,r)){case ws:return t;case lr:return"'"+t.replace(/'/g,"''")+"'";case As:return"|"+Cs(t,e.indent)+Os(ms(t,o));case xs:return">"+Cs(t,e.indent)+Os(ms(Au(t,s),o));case dn:return'"'+xu(t)+'"';default:throw new je("impossible error: invalid scalar style")}}()}function Cs(e,t){var n=bs(e)?String(t):"",i=e[e.length-1]===`
82
+ `&&(o+=n),o+=s;return o}function ir(e,t){return`
83
+ `+de.repeat(" ",e.indent*t)}function mu(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;n<i;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function fi(e){return e===Kf||e===zf}function In(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==cr||65536<=e&&e<=1114111}function Ko(e){return In(e)&&e!==cr&&e!==Vf&&e!==Pn}function Qo(e,t,n){var i=Ko(e),r=i&&!fi(e);return(n?i:i&&e!==bs&&e!==ws&&e!==As&&e!==xs&&e!==Cs)&&e!==nr&&!(t===ci&&!r)||Ko(t)&&!fi(t)&&e===nr||t===ci&&r}function gu(e){return In(e)&&e!==cr&&!fi(e)&&e!==nu&&e!==ou&&e!==ci&&e!==bs&&e!==ws&&e!==As&&e!==xs&&e!==Cs&&e!==nr&&e!==Xf&&e!==tu&&e!==Qf&&e!==lu&&e!==iu&&e!==ru&&e!==eu&&e!==Jf&&e!==Zf&&e!==su&&e!==au}function yu(e){return!fi(e)&&e!==ci}function _n(e,t){var n=e.charCodeAt(t),i;return n>=55296&&n<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function Os(e){var t=/^\n* /;return t.test(e)}var vs=1,rr=2,Es=3,_s=4,cn=5;function bu(e,t,n,i,r,o,s,a){var l,u=0,d=null,f=!1,p=!1,y=i!==-1,C=-1,A=gu(_n(e,0))&&yu(_n(e,e.length-1));if(t||s)for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=_n(e,l),!In(u))return cn;A=A&&Qo(u,d,a),d=u}else{for(l=0;l<e.length;u>=65536?l+=2:l++){if(u=_n(e,l),u===Pn)f=!0,y&&(p=p||l-C-1>i&&e[C+1]!==" ",C=l);else if(!In(u))return cn;A=A&&Qo(u,d,a),d=u}p=p||y&&l-C-1>i&&e[C+1]!==" "}return!f&&!p?A&&!s&&!r(e)?vs:o===jn?cn:rr:n>9&&Os(e)?cn:s?o===jn?cn:rr:p?_s:Es}function wu(e,t,n,i,r){e.dump=function(){if(t.length===0)return e.quotingType===jn?'""':"''";if(!e.noCompatMode&&(cu.indexOf(t)!==-1||fu.test(t)))return e.quotingType===jn?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=i||e.flowLevel>-1&&n>=e.flowLevel;function l(u){return mu(e,u)}switch(bu(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!i,r)){case vs:return t;case rr:return"'"+t.replace(/'/g,"''")+"'";case Es:return"|"+Jo(t,e.indent)+Zo(Vo(t,o));case _s:return">"+Jo(t,e.indent)+Zo(Vo(Au(t,s),o));case cn:return'"'+xu(t)+'"';default:throw new je("impossible error: invalid scalar style")}}()}function Jo(e,t){var n=Os(e)?String(t):"",i=e[e.length-1]===`
84
84
  `,r=i&&(e[e.length-2]===`
85
85
  `||e===`
86
86
  `),o=r?"+":i?"":"-";return n+o+`
87
- `}function Os(e){return e[e.length-1]===`
87
+ `}function Zo(e){return e[e.length-1]===`
88
88
  `?e.slice(0,-1):e}function Au(e,t){for(var n=/(\n+)([^\n]*)/g,i=function(){var u=e.indexOf(`
89
- `);return u=u!==-1?u:e.length,n.lastIndex=u,vs(e.slice(0,u),t)}(),r=e[0]===`
89
+ `);return u=u!==-1?u:e.length,n.lastIndex=u,Xo(e.slice(0,u),t)}(),r=e[0]===`
90
90
  `||e[0]===" ",o,s;s=n.exec(e);){var a=s[1],l=s[2];o=l[0]===" ",i+=a+(!r&&!o&&l!==""?`
91
- `:"")+vs(l,t),r=o}return i}function vs(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,i,r=0,o,s=0,a=0,l="";i=n.exec(e);)a=i.index,a-r>t&&(o=s>r?s:a,l+=`
91
+ `:"")+Xo(l,t),r=o}return i}function Xo(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,i,r=0,o,s=0,a=0,l="";i=n.exec(e);)a=i.index,a-r>t&&(o=s>r?s:a,l+=`
92
92
  `+e.slice(r,o),r=o+1),s=a;return l+=`
93
93
  `,e.length-r>t&&s>r?l+=e.slice(r,s)+`
94
- `+e.slice(s+1):l+=e.slice(r),l.slice(1)}function xu(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=In(e,r),i=we[n],!i&&jn(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||du(n);return t}function Cu(e,t,n){var i="",r=e.tag,o,s,a;for(o=0,s=n.length;o<s;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(rt(e,t,a,!1,!1)||typeof a=="undefined"&&rt(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function Es(e,t,n,i){var r="",o=e.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1)l=n[s],e.replacer&&(l=e.replacer.call(n,String(s),l)),(rt(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&rt(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=ar(e,t)),e.dump&&Sn===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}function Ou(e,t,n){var i="",r=e.tag,o=Object.keys(n),s,a,l,u,d;for(s=0,a=o.length;s<a;s+=1)d="",i!==""&&(d+=", "),e.condenseFlow&&(d+='"'),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),!!rt(e,t,l,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),!!rt(e,t,u,!1,!1)&&(d+=e.dump,i+=d));e.tag=r,e.dump="{"+i+"}"}function vu(e,t,n,i){var r="",o=e.tag,s=Object.keys(n),a,l,u,d,f,p;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new je("sortKeys must be a boolean or a function");for(a=0,l=s.length;a<l;a+=1)p="",(!i||r!=="")&&(p+=ar(e,t)),u=s[a],d=n[u],e.replacer&&(d=e.replacer.call(n,u,d)),!!rt(e,t+1,u,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Sn===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,f&&(p+=ar(e,t)),!!rt(e,t+1,d,!0,f)&&(e.dump&&Sn===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,r+=p));e.tag=o,e.dump=r||"{}"}function _s(e,t,n){var i,r,o,s,a,l;for(r=n?e.explicitTypes:e.implicitTypes,o=0,s=r.length;o<s;o+=1)if(a=r[o],(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,ls.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(cs.call(a.represent,l))i=a.represent[l](t,l);else throw new je("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function rt(e,t,n,i,r,o,s){e.tag=null,e.dump=n,_s(e,n,!1)||_s(e,n,!0);var a=ls.call(e.dump),l=i,u;i&&(i=e.flowLevel<0||e.flowLevel>t);var d=a==="[object Object]"||a==="[object Array]",f,p;if(d&&(f=e.duplicates.indexOf(n),p=f!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(r=!1),p&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(d&&p&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(vu(e,t,e.dump,r),p&&(e.dump="&ref_"+f+e.dump)):(Ou(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?Es(e,t-1,e.dump,r):Es(e,t,e.dump,r),p&&(e.dump="&ref_"+f+e.dump)):(Cu(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&wu(e,e.dump,t,o,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new je("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function Eu(e,t){var n=[],i=[],r,o;for(cr(e,n,i),r=0,o=i.length;r<o;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(o)}function cr(e,t,n){var i,r,o;if(e!==null&&typeof e=="object")if(r=t.indexOf(e),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;r<o;r+=1)cr(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;r<o;r+=1)cr(e[i[r]],t,n)}function _u(e,t){t=t||{};var n=new hu(t);n.noRefs||Eu(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),rt(n,0,i,!0,!0)?n.dump+`
95
- `:""}var Su=_u,Pu={dump:Su};function fr(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 Ss=as.load,Uh=as.loadAll,Ps=Pu.dump;var Rh=fr("safeLoad","load"),$h=fr("safeLoadAll","loadAll"),Wh=fr("safeDump","dump");var fa=require("fs"),Pr=require("path"),ua=require("fs"),da=K(require("fs"),1);g();function ot(){}ot.prototype={diff:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=i.callback;typeof i=="function"&&(r=i,i={}),this.options=i;var o=this;function s(A){return r?(setTimeout(function(){r(void 0,A)},0),!0):A}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,u=1,d=a+l,f=[{newPos:-1,components:[]}],p=this.extractCommon(f[0],n,t,0);if(f[0].newPos+1>=a&&p+1>=l)return s([{value:this.join(n),count:n.length}]);function y(){for(var A=-1*u;A<=u;A+=2){var m=void 0,S=f[A-1],E=f[A+1],G=(E?E.newPos:0)-A;S&&(f[A-1]=void 0);var B=S&&S.newPos+1<a,V=E&&0<=G&&G<l;if(!B&&!V){f[A]=void 0;continue}if(!B||V&&S.newPos<E.newPos?(m=Iu(E),o.pushComponent(m.components,void 0,!0)):(m=S,m.newPos++,o.pushComponent(m.components,!0,void 0)),G=o.extractCommon(m,n,t,A),m.newPos+1>=a&&G+1>=l)return s(ju(o,m.components,n,t,o.useLongestToken));f[A]=m}u++}if(r)(function A(){setTimeout(function(){if(u>d)return r();y()||A()},0)})();else for(;u<=d;){var C=y();if(C)return C}},pushComponent:function(t,n,i){var r=t[t.length-1];r&&r.added===n&&r.removed===i?t[t.length-1]={count:r.count+1,added:n,removed:i}:t.push({count:1,added:n,removed:i})},extractCommon:function(t,n,i,r){for(var o=n.length,s=i.length,a=t.newPos,l=a-r,u=0;a+1<o&&l+1<s&&this.equals(n[a+1],i[l+1]);)a++,l++,u++;return u&&t.components.push({count:u}),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=[],i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function ju(e,t,n,i,r){for(var o=0,s=t.length,a=0,l=0;o<s;o++){var u=t[o];if(u.removed){if(u.value=e.join(i.slice(l,l+u.count)),l+=u.count,o&&t[o-1].added){var f=t[o-1];t[o-1]=t[o],t[o]=f}}else{if(!u.added&&r){var d=n.slice(a,a+u.count);d=d.map(function(y,C){var A=i[l+C];return A.length>y.length?A:y}),u.value=e.join(d)}else u.value=e.join(n.slice(a,a+u.count));a+=u.count,u.added||(l+=u.count)}}var p=t[s-1];return s>1&&typeof p.value=="string"&&(p.added||p.removed)&&e.equals("",p.value)&&(t[s-2].value+=p.value,t.pop()),t}function Iu(e){return{newPos:e.newPos,components:e.components.slice(0)}}var Hh=new ot;var js=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Is=/\S/,Ms=new ot;Ms.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Is.test(e)&&!Is.test(t)};Ms.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]&&js.test(t[n])&&js.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var ur=new ot;ur.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var r=n[i];i%2&&!this.options.newlineIsToken?t[t.length-1]+=r:(this.options.ignoreWhitespace&&(r=r.trim()),t.push(r))}return t};function dr(e,t,n){return ur.diff(e,t,n)}var Mu=new ot;Mu.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Fu=new ot;Fu.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function di(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?di=function(t){return typeof t}:di=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},di(e)}var Lu=Object.prototype.toString,pn=new ot;pn.useLongestToken=!0;pn.tokenize=ur.tokenize;pn.castInput=function(e){var t=this.options,n=t.undefinedReplacement,i=t.stringifyReplacer,r=i===void 0?function(o,s){return typeof s=="undefined"?n:s}:i;return typeof e=="string"?e:JSON.stringify(pr(e,null,null,r),r," ")};pn.equals=function(e,t){return ot.prototype.equals.call(pn,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Fs(e,t,n){return pn.diff(e,t,n)}function pr(e,t,n,i,r){t=t||[],n=n||[],i&&(e=i(r,e));var o;for(o=0;o<t.length;o+=1)if(t[o]===e)return n[o];var s;if(Lu.call(e)==="[object Array]"){for(t.push(e),s=new Array(e.length),n.push(s),o=0;o<e.length;o+=1)s[o]=pr(e[o],t,n,i,r);return t.pop(),n.pop(),s}if(e&&e.toJSON&&(e=e.toJSON()),di(e)==="object"&&e!==null){t.push(e),s={},n.push(s);var a=[],l;for(l in e)e.hasOwnProperty(l)&&a.push(l);for(a.sort(),o=0;o<a.length;o+=1)l=a[o],s[l]=pr(e[l],t,n,i,l);t.pop(),n.pop()}else s=e;return s}var hr=new ot;hr.tokenize=function(e){return e.slice()};hr.join=hr.removeEmpty=function(e){return e};var ma=K(la(),1),Jt=K(require("chalk"),1);async function Ae({objects:e,selectIdentifier:t,selectDisplayName:n=t,onSyncComplete:i}){let r=e.reduce((a,l)=>{let u=t(l);if(a[u])throw new Error(`Identifier ${u} was not unique.`);return a[u]={id:u,object:l,providerId:u,displayName:n(l)},a},{});async function*o(){for(let a of Object.values(r))yield a}function s(){return Object.entries(r).sort((a,l)=>a[0].localeCompare(l[0])).map(a=>a[1].object)}return{objects:o(),deleteObject:async a=>{delete r[a]},writeObject:async a=>{let l=t(a.object);r[l]=a},extractCurrent:s,onSyncComplete:i?a=>i(a,s()):void 0}}function W(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 k(e){var t,n,i;return e.option("project",{describe:"Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",default:(i=(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?i:process.env.UNIFORM_PROJECT_ID,demandOption:!0,type:"string",alias:["p"]})}function xe(e){return e.option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("filename",{alias:["o"],describe:"Output filename. If not specified, write to stdout.",type:"string"})}function Ce(e){var t;return e.option("diff",{describe:"Whether to show diffs in stdout. off = no diffs; update = on for updates; on = updates, creates, deletes. Can be set by UNIFORM_CLI_DIFF_MODE environment variable.",default:(t=process.env.UNIFORM_CLI_DIFF_MODE)!=null?t:"off",type:"string",choices:["off","update","on"],alias:["d"]})}function Oe(e){let t=(0,Pr.extname)(e);return t===".yaml"||t===".yml"||t===".json"}function me(e,t,n){let i;if(n&&!t){let r=(0,Pr.extname)(n);r===".yaml"||r===".yml"?t="yaml":r===".json"&&(t="json")}else if(!t)throw new Error("Format must be specified when no filename is passed");switch(t){case"json":i=JSON.stringify(e,null,2);break;case"yaml":i=Ps(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?(0,fa.writeFileSync)(n,i,"utf8"):console.log(i)}function At(e){let t=(0,ua.readFileSync)(e,"utf8");return Ss(t,{filename:e,json:!0})}async function ve({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:i=n}){(0,Ci.existsSync)(e)||(0,Ci.mkdirSync)(e,{recursive:!0});let r=await(0,Oi.readdir)(e,"utf-8"),o=new Set(r.filter(l=>{let u=(0,Nn.extname)(l);return u===".json"||u===".yaml"||u===".yml"})),s=l=>(0,Nn.join)(e,`${l}.${t}`);async function*a(){for(let l of o){let u=(0,Nn.join)(e,l);try{let d=await At(u);yield{id:n(d),displayName:i(d),providerId:u,object:d}}catch(d){throw console.error(ca.default.red(`Failed to read ${u}, data is likely invalid.
96
- ${d==null?void 0:d.message}`)),d}}}return{objects:a(),deleteObject:async l=>{await(0,Oi.unlink)(l)},writeObject:async l=>{me(l.object,t,s(l.id))}}}function pa(e,t){if(!t&&!da.default.existsSync(e))return{};let n=At(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function ha(e,t){me(t,void 0,e)}async function ge({source:e,target:t,compareContents:n=(a,l)=>(0,ma.default)(a.object,l.object,(u,d,f)=>f==="created"||f==="modified"?!0:void 0),mode:i,allowEmptySource:r=!1,whatIf:o=!1,log:s=()=>{}}){var a,l;let u=new Map;for await(let p of t.objects)u.set(p.id,p);let d=[],f=!1;for await(let p of e.objects){f=!0;let y=p.id,C=u.get(y);if(C){if(!n(p,C)&&(i==="createOrUpdate"||i==="mirror")){let A=async(m,S)=>{var E;if(!o)try{await t.writeObject(m,S)}catch(G){throw new vi(G,m)}s({action:"update",id:y,providerId:m.providerId,displayName:(E=m.displayName)!=null?E:m.providerId,whatIf:o,diff:Fs(S.object,m.object)})};d.push(A(p,C))}u.delete(y)}else{let A=async(m,S)=>{var E;if(!o)try{await t.writeObject(m)}catch(G){throw new vi(G,m)}s({action:"create",id:S,providerId:S,displayName:(E=m.displayName)!=null?E:m.providerId,whatIf:o,diff:dr("",JSON.stringify(m.object,null,2))})};d.push(A(p,y))}}if(await Promise.all(d),i==="mirror"){if(!f&&!r)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 p=[];u.forEach(async y=>{let C=async A=>{var m;if(!o)try{await t.deleteObject(A.providerId)}catch(S){throw new vi(S,A)}s({action:"delete",id:A.id,providerId:A.providerId,displayName:(m=A.displayName)!=null?m:A.providerId,whatIf:o,diff:dr(JSON.stringify(A.object,null,2),"")})};p.push(C(y))}),await Promise.all(p)}await Promise.all([(a=e.onSyncComplete)==null?void 0:a.call(e,!1),(l=t.onSyncComplete)==null?void 0:l.call(t,!0)])}var vi=class extends Error{constructor(e,t){super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
97
- ${e}`);var n;this.stack=void 0,Object.setPrototypeOf(this,vi.prototype)}};function ye(e){let{diffMode:t="off",indent:n,prefix:i}=e!=null?e:{};return function({action:r,displayName:o,whatIf:s,diff:a}){let l="";switch(r){case"create":l=Jt.default.green("[A]");break;case"update":l=Jt.default.white("[U]");break;case"delete":l=Jt.default.yellow("[D]");break}let u="";(t==="on"||t==="update"&&r==="update")&&(u=`
94
+ `+e.slice(s+1):l+=e.slice(r),l.slice(1)}function xu(e){for(var t="",n=0,i,r=0;r<e.length;n>=65536?r+=2:r++)n=_n(e,r),i=we[n],!i&&In(n)?(t+=e[r],n>=65536&&(t+=e[r+1])):t+=i||du(n);return t}function Cu(e,t,n){var i="",r=e.tag,o,s,a;for(o=0,s=n.length;o<s;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(rt(e,t,a,!1,!1)||typeof a=="undefined"&&rt(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}function es(e,t,n,i){var r="",o=e.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1)l=n[s],e.replacer&&(l=e.replacer.call(n,String(s),l)),(rt(e,t+1,l,!0,!0,!1,!0)||typeof l=="undefined"&&rt(e,t+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=ir(e,t)),e.dump&&Pn===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}function Ou(e,t,n){var i="",r=e.tag,o=Object.keys(n),s,a,l,u,d;for(s=0,a=o.length;s<a;s+=1)d="",i!==""&&(d+=", "),e.condenseFlow&&(d+='"'),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),!!rt(e,t,l,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),!!rt(e,t,u,!1,!1)&&(d+=e.dump,i+=d));e.tag=r,e.dump="{"+i+"}"}function vu(e,t,n,i){var r="",o=e.tag,s=Object.keys(n),a,l,u,d,f,p;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new je("sortKeys must be a boolean or a function");for(a=0,l=s.length;a<l;a+=1)p="",(!i||r!=="")&&(p+=ir(e,t)),u=s[a],d=n[u],e.replacer&&(d=e.replacer.call(n,u,d)),!!rt(e,t+1,u,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Pn===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,f&&(p+=ir(e,t)),!!rt(e,t+1,d,!0,f)&&(e.dump&&Pn===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,r+=p));e.tag=o,e.dump=r||"{}"}function ts(e,t,n){var i,r,o,s,a,l;for(r=n?e.explicitTypes:e.implicitTypes,o=0,s=r.length;o<s;o+=1)if(a=r[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,gs.call(a.represent)==="[object Function]")i=a.represent(t,l);else if(ys.call(a.represent,l))i=a.represent[l](t,l);else throw new je("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function rt(e,t,n,i,r,o,s){e.tag=null,e.dump=n,ts(e,n,!1)||ts(e,n,!0);var a=gs.call(e.dump),l=i,u;i&&(i=e.flowLevel<0||e.flowLevel>t);var d=a==="[object Object]"||a==="[object Array]",f,p;if(d&&(f=e.duplicates.indexOf(n),p=f!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&t>0)&&(r=!1),p&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(d&&p&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),a==="[object Object]")i&&Object.keys(e.dump).length!==0?(vu(e,t,e.dump,r),p&&(e.dump="&ref_"+f+e.dump)):(Ou(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?es(e,t-1,e.dump,r):es(e,t,e.dump,r),p&&(e.dump="&ref_"+f+e.dump)):(Cu(e,t,e.dump),p&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&wu(e,e.dump,t,o,l);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new je("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(u=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",e.dump=u+" "+e.dump)}return!0}function Eu(e,t){var n=[],i=[],r,o;for(or(e,n,i),r=0,o=i.length;r<o;r+=1)t.duplicates.push(n[i[r]]);t.usedDuplicates=new Array(o)}function or(e,t,n){var i,r,o;if(e!==null&&typeof e=="object")if(r=t.indexOf(e),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;r<o;r+=1)or(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;r<o;r+=1)or(e[i[r]],t,n)}function _u(e,t){t=t||{};var n=new hu(t);n.noRefs||Eu(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),rt(n,0,i,!0,!0)?n.dump+`
95
+ `:""}var Su=_u,Pu={dump:Su};function fr(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 Ss=ms.load,Uh=ms.loadAll,Ps=Pu.dump;var Rh=fr("safeLoad","load"),$h=fr("safeLoadAll","loadAll"),Wh=fr("safeDump","dump");var fa=require("fs"),Pr=require("path"),ua=require("fs"),da=K(require("fs"),1);g();function ot(){}ot.prototype={diff:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=i.callback;typeof i=="function"&&(r=i,i={}),this.options=i;var o=this;function s(A){return r?(setTimeout(function(){r(void 0,A)},0),!0):A}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,u=1,d=a+l,f=[{newPos:-1,components:[]}],p=this.extractCommon(f[0],n,t,0);if(f[0].newPos+1>=a&&p+1>=l)return s([{value:this.join(n),count:n.length}]);function y(){for(var A=-1*u;A<=u;A+=2){var m=void 0,S=f[A-1],E=f[A+1],G=(E?E.newPos:0)-A;S&&(f[A-1]=void 0);var B=S&&S.newPos+1<a,V=E&&0<=G&&G<l;if(!B&&!V){f[A]=void 0;continue}if(!B||V&&S.newPos<E.newPos?(m=Iu(E),o.pushComponent(m.components,void 0,!0)):(m=S,m.newPos++,o.pushComponent(m.components,!0,void 0)),G=o.extractCommon(m,n,t,A),m.newPos+1>=a&&G+1>=l)return s(ju(o,m.components,n,t,o.useLongestToken));f[A]=m}u++}if(r)(function A(){setTimeout(function(){if(u>d)return r();y()||A()},0)})();else for(;u<=d;){var C=y();if(C)return C}},pushComponent:function(t,n,i){var r=t[t.length-1];r&&r.added===n&&r.removed===i?t[t.length-1]={count:r.count+1,added:n,removed:i}:t.push({count:1,added:n,removed:i})},extractCommon:function(t,n,i,r){for(var o=n.length,s=i.length,a=t.newPos,l=a-r,u=0;a+1<o&&l+1<s&&this.equals(n[a+1],i[l+1]);)a++,l++,u++;return u&&t.components.push({count:u}),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=[],i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function ju(e,t,n,i,r){for(var o=0,s=t.length,a=0,l=0;o<s;o++){var u=t[o];if(u.removed){if(u.value=e.join(i.slice(l,l+u.count)),l+=u.count,o&&t[o-1].added){var f=t[o-1];t[o-1]=t[o],t[o]=f}}else{if(!u.added&&r){var d=n.slice(a,a+u.count);d=d.map(function(y,C){var A=i[l+C];return A.length>y.length?A:y}),u.value=e.join(d)}else u.value=e.join(n.slice(a,a+u.count));a+=u.count,u.added||(l+=u.count)}}var p=t[s-1];return s>1&&typeof p.value=="string"&&(p.added||p.removed)&&e.equals("",p.value)&&(t[s-2].value+=p.value,t.pop()),t}function Iu(e){return{newPos:e.newPos,components:e.components.slice(0)}}var Hh=new ot;var js=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Is=/\S/,Ms=new ot;Ms.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Is.test(e)&&!Is.test(t)};Ms.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]&&js.test(t[n])&&js.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var pr=new ot;pr.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var r=n[i];i%2&&!this.options.newlineIsToken?t[t.length-1]+=r:(this.options.ignoreWhitespace&&(r=r.trim()),t.push(r))}return t};function hr(e,t,n){return pr.diff(e,t,n)}var Mu=new ot;Mu.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Fu=new ot;Fu.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function di(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?di=function(t){return typeof t}:di=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},di(e)}var Lu=Object.prototype.toString,pn=new ot;pn.useLongestToken=!0;pn.tokenize=pr.tokenize;pn.castInput=function(e){var t=this.options,n=t.undefinedReplacement,i=t.stringifyReplacer,r=i===void 0?function(o,s){return typeof s=="undefined"?n:s}:i;return typeof e=="string"?e:JSON.stringify(ur(e,null,null,r),r," ")};pn.equals=function(e,t){return ot.prototype.equals.call(pn,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Fs(e,t,n){return pn.diff(e,t,n)}function ur(e,t,n,i,r){t=t||[],n=n||[],i&&(e=i(r,e));var o;for(o=0;o<t.length;o+=1)if(t[o]===e)return n[o];var s;if(Lu.call(e)==="[object Array]"){for(t.push(e),s=new Array(e.length),n.push(s),o=0;o<e.length;o+=1)s[o]=ur(e[o],t,n,i,r);return t.pop(),n.pop(),s}if(e&&e.toJSON&&(e=e.toJSON()),di(e)==="object"&&e!==null){t.push(e),s={},n.push(s);var a=[],l;for(l in e)e.hasOwnProperty(l)&&a.push(l);for(a.sort(),o=0;o<a.length;o+=1)l=a[o],s[l]=ur(e[l],t,n,i,l);t.pop(),n.pop()}else s=e;return s}var dr=new ot;dr.tokenize=function(e){return e.slice()};dr.join=dr.removeEmpty=function(e){return e};var ma=K(la(),1),Jt=K(require("chalk"),1);async function Ae({objects:e,selectIdentifier:t,selectDisplayName:n=t,onSyncComplete:i}){let r=e.reduce((a,l)=>{let u=t(l);if(a[u])throw new Error(`Identifier ${u} was not unique.`);return a[u]={id:u,object:l,providerId:u,displayName:n(l)},a},{});async function*o(){for(let a of Object.values(r))yield a}function s(){return Object.entries(r).sort((a,l)=>a[0].localeCompare(l[0])).map(a=>a[1].object)}return{objects:o(),deleteObject:async a=>{delete r[a]},writeObject:async a=>{let l=t(a.object);r[l]=a},extractCurrent:s,onSyncComplete:i?a=>i(a,s()):void 0}}function W(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 k(e){var t,n,i;return e.option("project",{describe:"Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",default:(i=(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?i:process.env.UNIFORM_PROJECT_ID,demandOption:!0,type:"string",alias:["p"]})}function xe(e){return e.option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("filename",{alias:["o"],describe:"Output filename. If not specified, write to stdout.",type:"string"})}function Ce(e){var t;return e.option("diff",{describe:"Whether to show diffs in stdout. off = no diffs; update = on for updates; on = updates, creates, deletes. Can be set by UNIFORM_CLI_DIFF_MODE environment variable.",default:(t=process.env.UNIFORM_CLI_DIFF_MODE)!=null?t:"off",type:"string",choices:["off","update","on"],alias:["d"]})}function Oe(e){let t=(0,Pr.extname)(e);return t===".yaml"||t===".yml"||t===".json"}function me(e,t,n){let i;if(n&&!t){let r=(0,Pr.extname)(n);r===".yaml"||r===".yml"?t="yaml":r===".json"&&(t="json")}else if(!t)throw new Error("Format must be specified when no filename is passed");switch(t){case"json":i=JSON.stringify(e,null,2);break;case"yaml":i=Ps(e);break;default:throw new Error(`Unsupported format: ${t}`)}n?(0,fa.writeFileSync)(n,i,"utf8"):console.log(i)}function At(e){let t=(0,ua.readFileSync)(e,"utf8");return Ss(t,{filename:e,json:!0})}async function ve({directory:e,format:t="yaml",selectIdentifier:n,selectDisplayName:i=n}){(0,Oi.existsSync)(e)||(0,Oi.mkdirSync)(e,{recursive:!0});let r=await(0,vi.readdir)(e,"utf-8"),o=new Set(r.filter(l=>{let u=(0,Nn.extname)(l);return u===".json"||u===".yaml"||u===".yml"})),s=l=>(0,Nn.join)(e,`${l}.${t}`);async function*a(){for(let l of o){let u=(0,Nn.join)(e,l);try{let d=await At(u);yield{id:n(d),displayName:i(d),providerId:u,object:d}}catch(d){throw console.error(ca.default.red(`Failed to read ${u}, data is likely invalid.
96
+ ${d==null?void 0:d.message}`)),d}}}return{objects:a(),deleteObject:async l=>{await(0,vi.unlink)(l)},writeObject:async l=>{me(l.object,t,s(l.id))}}}function pa(e,t){if(!t&&!da.default.existsSync(e))return{};let n=At(e);if(typeof n!="object")throw new Error(`Package ${e} does not appear valid.`);return n}function ha(e,t){me(t,void 0,e)}async function ge({source:e,target:t,compareContents:n=(a,l)=>(0,ma.default)(a.object,l.object,(u,d,f)=>f==="created"||f==="modified"?!0:void 0),mode:i,allowEmptySource:r=!1,whatIf:o=!1,log:s=()=>{}}){var a,l;let u=new Map;for await(let p of t.objects)u.set(p.id,p);let d=[],f=!1;for await(let p of e.objects){f=!0;let y=p.id,C=u.get(y);if(C){if(!n(p,C)&&(i==="createOrUpdate"||i==="mirror")){let A=async(m,S)=>{var E;if(!o)try{await t.writeObject(m,S)}catch(G){throw new Ci(G,m)}s({action:"update",id:y,providerId:m.providerId,displayName:(E=m.displayName)!=null?E:m.providerId,whatIf:o,diff:Fs(S.object,m.object)})};d.push(A(p,C))}u.delete(y)}else{let A=async(m,S)=>{var E;if(!o)try{await t.writeObject(m)}catch(G){throw new Ci(G,m)}s({action:"create",id:S,providerId:S,displayName:(E=m.displayName)!=null?E:m.providerId,whatIf:o,diff:hr("",JSON.stringify(m.object,null,2))})};d.push(A(p,y))}}if(await Promise.all(d),i==="mirror"){if(!f&&!r)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 p=[];u.forEach(async y=>{let C=async A=>{var m;if(!o)try{await t.deleteObject(A.providerId)}catch(S){throw new Ci(S,A)}s({action:"delete",id:A.id,providerId:A.providerId,displayName:(m=A.displayName)!=null?m:A.providerId,whatIf:o,diff:hr(JSON.stringify(A.object,null,2),"")})};p.push(C(y))}),await Promise.all(p)}await Promise.all([(a=e.onSyncComplete)==null?void 0:a.call(e,!1),(l=t.onSyncComplete)==null?void 0:l.call(t,!0)])}var Ci=class extends Error{constructor(e,t){super(`Error syncing ${(n=t.displayName)!=null?n:t.providerId} (${t.providerId})
97
+ ${e}`);var n;this.stack=void 0,Object.setPrototypeOf(this,Ci.prototype)}};function ye(e){let{diffMode:t="off",indent:n,prefix:i}=e!=null?e:{};return function({action:r,displayName:o,whatIf:s,diff:a}){let l="";switch(r){case"create":l=Jt.default.green("[A]");break;case"update":l=Jt.default.white("[U]");break;case"delete":l=Jt.default.yellow("[D]");break}let u="";(t==="on"||t==="update"&&r==="update")&&(u=`
98
98
  `+a.map(d=>d.added?Jt.default.green(d.value):d.removed?Jt.default.red(d.value):d.value).join("")),console.log(`${n!=null?n:""}${s?Jt.default.gray("[WHATIF]"):""}${l}${i!=null?i:""} ${o}${u}`)}}g();g();g();var ga=async e=>await e(),Zt=class extends Error{constructor(t,n,i,r,o){super(`${t}
99
99
  ${r}${o?" "+o:""} (${n} ${i})`);this.errorMessage=t;this.fetchMethod=n;this.fetchUri=i;this.statusCode=r;this.statusText=o;Object.setPrototypeOf(this,Zt.prototype)}};var Je=class{constructor(t){Fr(this,"options");var n,i,r,o,s,a;if(!t.apiKey&&!t.bearerToken)throw new Error("You must provide an API key or a bearer token");this.options={...t,fetch:(n=t.fetch)!=null?n:fetch,apiHost:(i=t.apiHost)!=null?i:"https://uniform.app",apiKey:(r=t.apiKey)!=null?r:null,projectId:(o=t.projectId)!=null?o:null,bearerToken:(s=t.bearerToken)!=null?s:null,limitPolicy:(a=t.limitPolicy)!=null?a:ga}}async apiClient(t,n){return this.options.limitPolicy(async()=>{var o;let i=this.options.apiKey?{"x-api-key":this.options.apiKey}:{Authorization:`Bearer ${this.options.bearerToken}`},r=await fetch(t.toString(),{...n,headers:{...n==null?void 0:n.headers,...i}});if(!r.ok){let s="";try{let a=await r.text();try{let l=JSON.parse(a);l.errorMessage?s=Array.isArray(l.errorMessage)?l.errorMessage.join(", "):l.errorMessage:s=a}catch(l){s=a}}catch(a){s="General error"}throw new Zt(s,(o=n==null?void 0:n.method)!=null?o:"GET",t.toString(),r.status)}return(n==null?void 0:n.expectNoContent)?null:await r.json()})}createUrl(t,n){let i=new URL(`${this.options.apiHost}${t}`);return Object.entries(n!=null?n:{}).forEach(([r,o])=>{var s;typeof o!="undefined"&&o!==null&&i.searchParams.append(r,(s=o==null?void 0:o.toString())!=null?s:"")}),i}};var yn,Tn=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(Tn,yn),{...t,projectId:n});return await this.apiClient(i)}async upsert(t){let n=this.createUrl(ce(Tn,yn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ce(Tn,yn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Me=Tn;yn=new WeakMap,Ve(Me,yn,"/api/v2/aggregate");var ba={command:"get <id>",describe:"Fetch an aggregate",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{let a=await new Me({apiKey:t,apiHost:e,fetch:ya.default,projectId:r}).get({aggregateId:n});a.aggregates.length===0?(console.error("Aggregate did not exist"),process.exit(1)):me(a.aggregates[0],i,o)}};g();var wa=K(require("isomorphic-unfetch"));var Aa={command:"list",describe:"List aggregates",aliases:["ls"],builder:e=>xe(W(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new Me({apiKey:t,apiHost:e,fetch:wa.default,projectId:r}).get({});me(s.aggregates,n,i)}};g();var Ca=K(require("isomorphic-unfetch"));g();var xt=e=>e.id,Ct=e=>`${e.name} (pid: ${e.id})`;g();function Ee(e,t){return pa(e,t)}function Ot(e,t){ha(e,t)}g();var xa=K(require("p-limit")),_e=(0,xa.default)(8);g();function Ei({client:e,type:t}){async function*n(){let r=(await e.get({type:t})).aggregates;for await(let o of r)yield{id:xt(o),displayName:Ct(o),providerId:o.id,object:o}}let i=[];return{objects:n(),deleteObject:async r=>{await e.remove({aggregateId:r})},writeObject:async r=>{await e.upsert({aggregate:r.object,skipInputs:!0}),i.push(r.object)},complete:async()=>{await Promise.all(i.map(r=>e.upsert({aggregate:r,skipInputs:!1})))}}}var Oa={command:"pull <directory>",describe:"Pulls all aggregates to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the aggregates to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:o,project:s,diff:a})=>{var p;let l=new Me({apiKey:t,apiHost:e,fetch:Ca.default,projectId:s,limitPolicy:_e}),u=Ei({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.aggregates)!=null?p:[],selectIdentifier:xt,selectDisplayName:Ct,onSyncComplete:async(C,A)=>{y.aggregates=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:xt,selectDisplayName:Ct,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var va=K(require("isomorphic-unfetch"));var Ea={command:"push <directory>",describe:"Pushes all aggregates from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the aggregates from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,project:o,diff:s})=>{var f;let a=new Me({apiKey:t,apiHost:e,fetch:va.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.aggregates)!=null?f:[],selectIdentifier:xt,selectDisplayName:Ct})}else l=await ve({directory:n,selectIdentifier:xt,selectDisplayName:Ct});let d=Ei({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})}),await d.complete()}};g();var _a=K(require("isomorphic-unfetch"));var Sa={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an aggregate",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Aggregate public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Me({apiKey:t,apiHost:e,fetch:_a.default,projectId:i}).remove({aggregateId:n})}};g();var Pa=K(require("isomorphic-unfetch"));var ja={command:"update <filename>",aliases:["put"],describe:"Insert or update an aggregate",builder:e=>W(k(e.positional("filename",{demandOption:!0,describe:"Aggregate file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new Me({apiKey:t,apiHost:e,fetch:Pa.default,projectId:i}),o=At(n);await r.upsert({aggregate:o})}};var Ia={command:"aggregate <command>",aliases:["agg","intent","audience"],describe:"Commands for Context aggregates (intents, audiences)",builder:e=>e.command(Oa).command(Ea).command(ba).command(Sa).command(Aa).command(ja).demandCommand(),handler:()=>{Ge.help()}};g();g();var Ma=K(require("isomorphic-unfetch"));g();var bn,Un,Xt=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(Xt,bn),{...t,projectId:n});return await this.apiClient(i)}async upsertCategory(t){let n=this.createUrl(ce(Xt,bn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeCategory(t){let n=this.createUrl(ce(Xt,bn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async upsertValue(t){let n=this.createUrl(ce(Xt,Un));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async removeValue(t){let n=this.createUrl(ce(Xt,Un));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Re=Xt;bn=new WeakMap,Un=new WeakMap,Ve(Re,bn,"/api/v1/enrichments"),Ve(Re,Un,"/api/v1/enrichment-values");var Fa={command:"get <id>",describe:"Fetch an enrichment category and its values",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{var l,u;let a=(u=(l=await new Re({apiKey:t,apiHost:e,fetch:Ma.default,projectId:r}).get())==null?void 0:l.enrichments)==null?void 0:u.filter(d=>d.id===n);a.length===0?(console.error("Enrichment did not exist"),process.exit(1)):me(a[0],i,o)}};g();var La=K(require("isomorphic-unfetch"));var Da={command:"list",describe:"List enrichments",aliases:["ls"],builder:e=>xe(W(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new Re({apiKey:t,apiHost:e,fetch:La.default,projectId:r}).get();me(s.enrichments,n,i)}};g();var Ta=K(require("isomorphic-unfetch"));g();var vt=e=>e.id,Et=e=>`${e.name} (pid: ${e.id})`;g();function _i({client:e}){async function*t(){let n=(await e.get()).enrichments;for await(let i of n)yield{id:vt(i),displayName:Et(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.removeCategory({enrichmentId:n})},writeObject:async(n,i)=>{var s,a;await e.upsertCategory({enrichment:n.object});let r=Na({categoryId:n.id,values:n.object.values}),o=Na({categoryId:n.id,values:(a=(s=i==null?void 0:i.object)==null?void 0:s.values)!=null?a:[],client:e});await ge({source:r,target:o,mode:"mirror",whatIf:!1,log:ye({diffMode:"off",prefix:` ${n.displayName} value`,indent:"> "})})}}}var Na=({client:e,categoryId:t,values:n})=>({objects:async function*(){for(let r of n)yield{id:r.id,providerId:r.id,object:r,displayName:`${r.value} (pid: ${r.id})`}}(),deleteObject:async r=>{if(!e)throw new Error("Provider is read only");await e.removeValue({enrichmentId:t,enrichmentValueId:r})},writeObject:async r=>{if(!e)throw new Error("Provider is read only");await e.upsertValue({enrichmentId:t,enrichmentValue:r.object})}});var Ua={command:"pull <directory>",describe:"Pulls all enrichments to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the enrichments to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:o,project:s,diff:a})=>{var p;let l=new Re({apiKey:t,apiHost:e,fetch:Ta.default,projectId:s,limitPolicy:_e}),u=_i({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.enrichments)!=null?p:[],selectIdentifier:vt,selectDisplayName:Et,onSyncComplete:async(C,A)=>{y.enrichments=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:vt,selectDisplayName:Et,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var Ra=K(require("isomorphic-unfetch"));var $a={command:"push <directory>",describe:"Pushes all enrichments from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the enrichments from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,project:o,diff:s})=>{var f;let a=new Re({apiKey:t,apiHost:e,fetch:Ra.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.enrichments)!=null?f:[],selectIdentifier:vt,selectDisplayName:Et})}else l=await ve({directory:n,selectIdentifier:vt,selectDisplayName:Et});let d=_i({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})})}};g();var Wa=K(require("isomorphic-unfetch"));var ka={command:"remove <id>",aliases:["delete","rm"],describe:"Delete an enrichment category and its values",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Enrichment category public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Re({apiKey:t,apiHost:e,fetch:Wa.default,projectId:i}).removeCategory({enrichmentId:n})}};var Ha={command:"enrichment <command>",aliases:["enr"],describe:"Commands for Context enrichments",builder:e=>e.command(Ua).command($a).command(Fa).command(ka).command(Da).demandCommand(),handler:()=>{Ge.help()}};g();g();var Rn=K(require("chalk")),Ya=require("fs"),Ga=K(require("isomorphic-unfetch")),ji=require("process");g();var Pi,jr=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(jr,Pi),{...t,projectId:n});return await this.apiClient(i)}},Si=jr;Pi=new WeakMap,Ve(Si,Pi,"/api/v2/manifest");var Ba={command:"get [output]",aliases:["dl","download"],describe:"Download the Uniform Context manifest for a project",builder:e=>{var t,n,i;return e.option("apiKey",{alias:"k",demandOption:!0,string:!0,default:(t=process.env.UNIFORM_API_KEY)!=null?t:"",describe:"Uniform API key to use. Defaults to UNIFORM_API_KEY env if set."}).option("project",{describe:"Uniform project ID. Defaults to UCTX_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",demandOption:!0,default:(i=(n=process.env.UCTX_CLI_PROJECT_ID)!=null?n:process.env.UNIFORM_PROJECT_ID)!=null?i:"",type:"string",alias:["p"]}).option("preview",{describe:"If set, fetches the unpublished preview manifest (The API key must have permission)",default:!1,type:"boolean",alias:["d"]}).option("output",{string:!0,alias:"o",default:process.env.UNIFORM_MANIFEST_PATH,describe:"Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set."})},handler:async({apiKey:e,output:t,project:n,preview:i})=>{n||(console.error(Rn.default.red("You must specify the project ID")),(0,ji.exit)(1));let r=Xd(),o=new Si({apiHost:r,projectId:n,apiKey:e,fetch:Ga.default});try{let s=await o.get({preview:i}),a=JSON.stringify(s,null,2);t?(0,Ya.writeFile)(t,a,l=>{l&&(console.error(`Error writing file to ${t}
100
100
  `,l),(0,ji.exit)(1)),console.log(Rn.default.green(`\u2705 ${t} has been updated from ${r}`))}):console.log(a)}catch(s){let a;s instanceof Zt?(s.statusCode===403&&(a=`The API key ${e} did not have permissions to fetch the manifest. Ensure ${i?"Context > Read Drafts":"Context > Manifest > Read"} permissions are granted.`),a=s.message):a=s.toString(),console.error(Rn.default.red("\u26A0 Error fetching Context manifest")),console.error(Rn.default.gray(` \u2757 ${a}`)),(0,ji.exit)(1)}}},Xd=()=>process.env.UNIFORM_CLI_BASE_URL||"https://uniform.app";var qa={command:"manifest <command>",describe:"Commands for context manifests",aliases:["man"],builder:e=>e.command(Ba).demandCommand(),handler:()=>{Ge.help()}};g();g();var za=K(require("isomorphic-unfetch"));g();var wn,$n=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce($n,wn),{...t,projectId:n});return await this.apiClient(i)}async upsert(t){let n=this.createUrl(ce($n,wn));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ce($n,wn));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Fe=$n;wn=new WeakMap,Ve(Fe,wn,"/api/v2/quirk");var Va={command:"get <id>",describe:"Fetch a quirk",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Quirk public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{let a=await new Fe({apiKey:t,apiHost:e,fetch:za.default,projectId:r}).get({quirkId:n,withIntegrations:!0});a.quirks.length===0?(console.error("Quirk did not exist"),process.exit(1)):me(a.quirks[0],i,o)}};g();var Ka=K(require("isomorphic-unfetch"));var Qa={command:"list",describe:"List quirks",aliases:["ls"],builder:e=>xe(W(k(e.option("withIntegrations",{alias:["i"],describe:"Whether to include meta-quirks created by integrations in the list. Defaults to false.",type:"boolean"})))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r,withIntegrations:o})=>{let a=await new Fe({apiKey:t,apiHost:e,fetch:Ka.default,projectId:r}).get({withIntegrations:o});me(a.quirks,n,i)}};g();var Ja=K(require("isomorphic-unfetch"));g();var _t=e=>e.id,St=e=>`${e.name} (pid: ${e.id})`;g();function Ii({client:e}){async function*t(){let n=(await e.get({withIntegrations:!1})).quirks;for await(let i of n)yield{id:_t(i),displayName:St(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.remove({quirkId:n})},writeObject:async n=>{await e.upsert({quirk:n.object})}}}var Za={command:"pull <directory>",describe:"Pulls all quirks to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the quirks to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:o,project:s,diff:a})=>{var p;let l=new Fe({apiKey:t,apiHost:e,fetch:Ja.default,projectId:s,limitPolicy:_e}),u=Ii({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.quirks)!=null?p:[],selectIdentifier:_t,selectDisplayName:St,onSyncComplete:async(C,A)=>{y.quirks=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:_t,selectDisplayName:St,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var Xa=K(require("isomorphic-unfetch"));var el={command:"push <directory>",describe:"Pushes all quirks from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the quirks from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,project:o,diff:s})=>{var f;let a=new Fe({apiKey:t,apiHost:e,fetch:Xa.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.quirks)!=null?f:[],selectIdentifier:_t,selectDisplayName:St})}else l=await ve({directory:n,selectIdentifier:_t,selectDisplayName:St});let d=Ii({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})})}};g();var tl=K(require("isomorphic-unfetch"));var nl={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a quirk",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Quirk public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Fe({apiKey:t,apiHost:e,fetch:tl.default,projectId:i}).remove({quirkId:n})}};g();var il=K(require("isomorphic-unfetch"));var rl={command:"update <filename>",aliases:["put"],describe:"Insert or update a quirk",builder:e=>W(k(e.positional("filename",{demandOption:!0,describe:"Quirk file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new Fe({apiKey:t,apiHost:e,fetch:il.default,projectId:i}),o=At(n);await r.upsert({quirk:o})}};var ol={command:"quirk <command>",aliases:["qk"],describe:"Commands for Context quirks",builder:e=>e.command(Za).command(el).command(Va).command(nl).command(Qa).command(rl).demandCommand(),handler:()=>{Ge.help()}};g();g();var sl=K(require("isomorphic-unfetch"));g();var An,Wn=class extends Je{constructor(t){super(t)}async get(t){let{projectId:n}=this.options,i=this.createUrl(ce(Wn,An),{...t,projectId:n});return await this.apiClient(i)}async upsert(t){let n=this.createUrl(ce(Wn,An));await this.apiClient(n,{method:"PUT",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}async remove(t){let n=this.createUrl(ce(Wn,An));await this.apiClient(n,{method:"DELETE",body:JSON.stringify({...t,projectId:this.options.projectId}),expectNoContent:!0})}},Le=Wn;An=new WeakMap,Ve(Le,An,"/api/v2/signal");var al={command:"get <id>",describe:"Fetch a signal",builder:e=>xe(W(k(e.positional("id",{demandOption:!0,describe:"Signal public ID to fetch"})))),handler:async({apiHost:e,apiKey:t,id:n,format:i,project:r,filename:o})=>{let a=await new Le({apiKey:t,apiHost:e,fetch:sl.default,projectId:r}).get({signalId:n});a.signals.length===0?(console.error("Signal did not exist"),process.exit(1)):me(a.signals[0],i,o)}};g();var ll=K(require("isomorphic-unfetch"));var cl={command:"list",describe:"List signals",aliases:["ls"],builder:e=>xe(W(k(e))),handler:async({apiHost:e,apiKey:t,format:n,filename:i,project:r})=>{let s=await new Le({apiKey:t,apiHost:e,fetch:ll.default,projectId:r}).get();me(s.signals,n,i)}};g();var fl=K(require("isomorphic-unfetch"));g();var Pt=e=>e.id,jt=e=>`${e.name} (pid: ${e.id})`;g();function Mi({client:e}){async function*t(){let n=(await e.get()).signals;for await(let i of n)yield{id:Pt(i),displayName:jt(i),providerId:i.id,object:i}}return{objects:t(),deleteObject:async n=>{await e.remove({signalId:n})},writeObject:async n=>{await e.upsert({signal:n.object})}}}var ul={command:"pull <directory>",describe:"Pulls all signals to local files in a directory",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to save the signals to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",type:"string"}).option("format",{alias:["f"],describe:"Output format",default:"yaml",choices:["yaml","json"],type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes no files",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new files, update nothing. "createOrUpdate" = create new files, update existing, delete nothing. "mirror" = create, update, and delete to mirror state',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,format:i,mode:r,whatIf:o,project:s,diff:a})=>{var p;let l=new Le({apiKey:t,apiHost:e,fetch:fl.default,projectId:s,limitPolicy:_e}),u=Mi({client:l}),d;if(Oe(n)){let y=Ee(n,!1);d=await Ae({objects:(p=y.signals)!=null?p:[],selectIdentifier:Pt,selectDisplayName:jt,onSyncComplete:async(C,A)=>{y.signals=A,Ot(n,y)}})}else d=await ve({directory:n,selectIdentifier:Pt,selectDisplayName:jt,format:i});await ge({source:u,target:d,mode:r,whatIf:o,log:ye({diffMode:a})})}};g();var dl=K(require("isomorphic-unfetch"));var pl={command:"push <directory>",describe:"Pushes all signals from files in a directory or package to Uniform",builder:e=>W(k(Ce(e.positional("directory",{describe:"Directory to read the signals from. If a filename is used, a package will be read instead.",type:"string"}).option("what-if",{alias:["w"],describe:"What-if mode reports what would be done but changes nothing",default:!1,type:"boolean"}).option("mode",{alias:["m"],describe:'What kind of changes can be made. "create" = create new, update nothing. "createOrUpdate" = create new, update existing, delete nothing. "mirror" = create, update, and delete',choices:["create","createOrUpdate","mirror"],default:"mirror",type:"string"})))),handler:async({apiHost:e,apiKey:t,directory:n,mode:i,whatIf:r,project:o,diff:s})=>{var f;let a=new Le({apiKey:t,apiHost:e,fetch:dl.default,projectId:o,limitPolicy:_e}),l;if(Oe(n)){let p=Ee(n,!0);l=await Ae({objects:(f=p.signals)!=null?f:[],selectIdentifier:Pt,selectDisplayName:jt})}else l=await ve({directory:n,selectIdentifier:Pt,selectDisplayName:jt});let d=Mi({client:a});await ge({source:l,target:d,mode:i,whatIf:r,log:ye({diffMode:s})})}};g();var hl=K(require("isomorphic-unfetch"));var ml={command:"remove <id>",aliases:["delete","rm"],describe:"Delete a signal",builder:e=>W(k(e.positional("id",{demandOption:!0,describe:"Signal public ID to delete"}))),handler:async({apiHost:e,apiKey:t,id:n,project:i})=>{await new Le({apiKey:t,apiHost:e,fetch:hl.default,projectId:i}).remove({signalId:n})}};g();var gl=K(require("isomorphic-unfetch"));var yl={command:"update <filename>",aliases:["put"],describe:"Insert or update a signal",builder:e=>W(k(e.positional("filename",{demandOption:!0,describe:"Signal file to put"}))),handler:async({apiHost:e,apiKey:t,filename:n,project:i})=>{let r=new Le({apiKey:t,apiHost:e,fetch:gl.default,projectId:i}),o=At(n);await r.upsert({signal:o})}};var bl={command:"signal <command>",aliases:["sig"],describe:"Commands for Context signals",builder:e=>e.command(ul).command(pl).command(al).command(ml).command(cl).command(yl).demandCommand(),handler:()=>{Ge.help()}};var ep={commands:[{command:"context <command>",aliases:["ctx"],describe:"Uniform Context commands",builder:e=>e.command(qa).command(bl).command(Ha).command(Ia).command(ol).demandCommand(),handler:()=>{Ge.showHelp()}}]};module.exports=Pl(tp);0&&(module.exports={uniformCLI});