@seeka-labs/cli-apps 1.1.5 → 1.1.6

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/index.js CHANGED
@@ -1,29 +1,29 @@
1
1
  #! /usr/bin/env node
2
- "use strict";var un=Object.create;var ft=Object.defineProperty;var cn=Object.getOwnPropertyDescriptor;var hn=Object.getOwnPropertyNames;var fn=Object.getPrototypeOf,pn=Object.prototype.hasOwnProperty;var v=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var dn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of hn(e))!pn.call(r,i)&&i!==t&&ft(r,i,{get:()=>e[i],enumerable:!(n=cn(e,i))||n.enumerable});return r};var U=(r,e,t)=>(t=r!=null?un(fn(r)):{},dn(e||!r||!r.__esModule?ft(t,"default",{value:r,enumerable:!0}):t,r));var dt=v(ge=>{var pt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");ge.encode=function(r){if(0<=r&&r<pt.length)return pt[r];throw new TypeError("Must be between 0 and 63: "+r)};ge.decode=function(r){var e=65,t=90,n=97,i=122,s=48,o=57,l=43,a=47,m=26,u=52;return e<=r&&r<=t?r-e:n<=r&&r<=i?r-n+m:s<=r&&r<=o?r-s+u:r==l?62:r==a?63:-1}});var ye=v(ve=>{var gt=dt(),_e=5,_t=1<<_e,vt=_t-1,yt=_t;function gn(r){return r<0?(-r<<1)+1:(r<<1)+0}function _n(r){var e=(r&1)===1,t=r>>1;return e?-t:t}ve.encode=function(e){var t="",n,i=gn(e);do n=i&vt,i>>>=_e,i>0&&(n|=yt),t+=gt.encode(n);while(i>0);return t};ve.decode=function(e,t,n){var i=e.length,s=0,o=0,l,a;do{if(t>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(a=gt.decode(e.charCodeAt(t++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));l=!!(a&yt),a&=vt,s=s+(a<<o),o+=_e}while(l);n.value=_n(s),n.rest=t}});var z=v(E=>{function vn(r,e,t){if(e in r)return r[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}E.getArg=vn;var wt=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,yn=/^data:.+\,.+$/;function Z(r){var e=r.match(wt);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}E.urlParse=Z;function B(r){var e="";return r.scheme&&(e+=r.scheme+":"),e+="//",r.auth&&(e+=r.auth+"@"),r.host&&(e+=r.host),r.port&&(e+=":"+r.port),r.path&&(e+=r.path),e}E.urlGenerate=B;function we(r){var e=r,t=Z(r);if(t){if(!t.path)return r;e=t.path}for(var n=E.isAbsolute(e),i=e.split(/\/+/),s,o=0,l=i.length-1;l>=0;l--)s=i[l],s==="."?i.splice(l,1):s===".."?o++:o>0&&(s===""?(i.splice(l+1,o),o=0):(i.splice(l,2),o--));return e=i.join("/"),e===""&&(e=n?"/":"."),t?(t.path=e,B(t)):e}E.normalize=we;function Ct(r,e){r===""&&(r="."),e===""&&(e=".");var t=Z(e),n=Z(r);if(n&&(r=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),B(t);if(t||e.match(yn))return e;if(n&&!n.host&&!n.path)return n.host=e,B(n);var i=e.charAt(0)==="/"?e:we(r.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,B(n)):i}E.join=Ct;E.isAbsolute=function(r){return r.charAt(0)==="/"||wt.test(r)};function wn(r,e){r===""&&(r="."),r=r.replace(/\/$/,"");for(var t=0;e.indexOf(r+"/")!==0;){var n=r.lastIndexOf("/");if(n<0||(r=r.slice(0,n),r.match(/^([^\/]+:\/)?\/*$/)))return e;++t}return Array(t+1).join("../")+e.substr(r.length+1)}E.relative=wn;var St=function(){var r=Object.create(null);return!("__proto__"in r)}();function bt(r){return r}function Cn(r){return At(r)?"$"+r:r}E.toSetString=St?bt:Cn;function Sn(r){return At(r)?r.slice(1):r}E.fromSetString=St?bt:Sn;function At(r){if(!r)return!1;var e=r.length;if(e<9||r.charCodeAt(e-1)!==95||r.charCodeAt(e-2)!==95||r.charCodeAt(e-3)!==111||r.charCodeAt(e-4)!==116||r.charCodeAt(e-5)!==111||r.charCodeAt(e-6)!==114||r.charCodeAt(e-7)!==112||r.charCodeAt(e-8)!==95||r.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(r.charCodeAt(t)!==36)return!1;return!0}function bn(r,e,t){var n=W(r.source,e.source);return n!==0||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0||t)||(n=r.generatedColumn-e.generatedColumn,n!==0)||(n=r.generatedLine-e.generatedLine,n!==0)?n:W(r.name,e.name)}E.compareByOriginalPositions=bn;function An(r,e,t){var n=r.generatedLine-e.generatedLine;return n!==0||(n=r.generatedColumn-e.generatedColumn,n!==0||t)||(n=W(r.source,e.source),n!==0)||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0)?n:W(r.name,e.name)}E.compareByGeneratedPositionsDeflated=An;function W(r,e){return r===e?0:r===null?1:e===null?-1:r>e?1:-1}function En(r,e){var t=r.generatedLine-e.generatedLine;return t!==0||(t=r.generatedColumn-e.generatedColumn,t!==0)||(t=W(r.source,e.source),t!==0)||(t=r.originalLine-e.originalLine,t!==0)||(t=r.originalColumn-e.originalColumn,t!==0)?t:W(r.name,e.name)}E.compareByGeneratedPositionsInflated=En;function On(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}E.parseSourceMapInput=On;function xn(r,e,t){if(e=e||"",r&&(r[r.length-1]!=="/"&&e[0]!=="/"&&(r+="/"),e=r+e),t){var n=Z(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=Ct(B(n),e)}return we(e)}E.computeSourceURL=xn});var be=v(Et=>{var Ce=z(),Se=Object.prototype.hasOwnProperty,T=typeof Map<"u";function $(){this._array=[],this._set=T?new Map:Object.create(null)}$.fromArray=function(e,t){for(var n=new $,i=0,s=e.length;i<s;i++)n.add(e[i],t);return n};$.prototype.size=function(){return T?this._set.size:Object.getOwnPropertyNames(this._set).length};$.prototype.add=function(e,t){var n=T?e:Ce.toSetString(e),i=T?this.has(e):Se.call(this._set,n),s=this._array.length;(!i||t)&&this._array.push(e),i||(T?this._set.set(e,s):this._set[n]=s)};$.prototype.has=function(e){if(T)return this._set.has(e);var t=Ce.toSetString(e);return Se.call(this._set,t)};$.prototype.indexOf=function(e){if(T){var t=this._set.get(e);if(t>=0)return t}else{var n=Ce.toSetString(e);if(Se.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};$.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};$.prototype.toArray=function(){return this._array.slice()};Et.ArraySet=$});var kt=v(xt=>{var Ot=z();function kn(r,e){var t=r.generatedLine,n=e.generatedLine,i=r.generatedColumn,s=e.generatedColumn;return n>t||n==t&&s>=i||Ot.compareByGeneratedPositionsInflated(r,e)<=0}function oe(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}oe.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)};oe.prototype.add=function(e){kn(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};oe.prototype.toArray=function(){return this._sorted||(this._array.sort(Ot.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};xt.MappingList=oe});var Ae=v(Mt=>{var ee=ye(),S=z(),ae=be().ArraySet,Mn=kt().MappingList;function x(r){r||(r={}),this._file=S.getArg(r,"file",null),this._sourceRoot=S.getArg(r,"sourceRoot",null),this._skipValidation=S.getArg(r,"skipValidation",!1),this._sources=new ae,this._names=new ae,this._mappings=new Mn,this._sourcesContents=null}x.prototype._version=3;x.fromSourceMap=function(e){var t=e.sourceRoot,n=new x({file:e.file,sourceRoot:t});return e.eachMapping(function(i){var s={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(s.source=i.source,t!=null&&(s.source=S.relative(t,s.source)),s.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(s.name=i.name)),n.addMapping(s)}),e.sources.forEach(function(i){var s=i;t!==null&&(s=S.relative(t,i)),n._sources.has(s)||n._sources.add(s);var o=e.sourceContentFor(i);o!=null&&n.setSourceContent(i,o)}),n};x.prototype.addMapping=function(e){var t=S.getArg(e,"generated"),n=S.getArg(e,"original",null),i=S.getArg(e,"source",null),s=S.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,i,s),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s})};x.prototype.setSourceContent=function(e,t){var n=e;this._sourceRoot!=null&&(n=S.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[S.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[S.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};x.prototype.applySourceMap=function(e,t,n){var i=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var s=this._sourceRoot;s!=null&&(i=S.relative(s,i));var o=new ae,l=new ae;this._mappings.unsortedForEach(function(a){if(a.source===i&&a.originalLine!=null){var m=e.originalPositionFor({line:a.originalLine,column:a.originalColumn});m.source!=null&&(a.source=m.source,n!=null&&(a.source=S.join(n,a.source)),s!=null&&(a.source=S.relative(s,a.source)),a.originalLine=m.line,a.originalColumn=m.column,m.name!=null&&(a.name=m.name))}var u=a.source;u!=null&&!o.has(u)&&o.add(u);var h=a.name;h!=null&&!l.has(h)&&l.add(h)},this),this._sources=o,this._names=l,e.sources.forEach(function(a){var m=e.sourceContentFor(a);m!=null&&(n!=null&&(a=S.join(n,a)),s!=null&&(a=S.relative(s,a)),this.setSourceContent(a,m))},this)};x.prototype._validateMapping=function(e,t,n,i){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!i)){if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:i}))}};x.prototype._serializeMappings=function(){for(var e=0,t=1,n=0,i=0,s=0,o=0,l="",a,m,u,h,c=this._mappings.toArray(),d=0,g=c.length;d<g;d++){if(m=c[d],a="",m.generatedLine!==t)for(e=0;m.generatedLine!==t;)a+=";",t++;else if(d>0){if(!S.compareByGeneratedPositionsInflated(m,c[d-1]))continue;a+=","}a+=ee.encode(m.generatedColumn-e),e=m.generatedColumn,m.source!=null&&(h=this._sources.indexOf(m.source),a+=ee.encode(h-o),o=h,a+=ee.encode(m.originalLine-1-i),i=m.originalLine-1,a+=ee.encode(m.originalColumn-n),n=m.originalColumn,m.name!=null&&(u=this._names.indexOf(m.name),a+=ee.encode(u-s),s=u)),l+=a}return l};x.prototype._generateSourcesContent=function(e,t){return e.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=S.relative(t,n));var i=S.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};x.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};x.prototype.toString=function(){return JSON.stringify(this.toJSON())};Mt.SourceMapGenerator=x});var Lt=v(j=>{j.GREATEST_LOWER_BOUND=1;j.LEAST_UPPER_BOUND=2;function Ee(r,e,t,n,i,s){var o=Math.floor((e-r)/2)+r,l=i(t,n[o],!0);return l===0?o:l>0?e-o>1?Ee(o,e,t,n,i,s):s==j.LEAST_UPPER_BOUND?e<n.length?e:-1:o:o-r>1?Ee(r,o,t,n,i,s):s==j.LEAST_UPPER_BOUND?o:r<0?-1:r}j.search=function(e,t,n,i){if(t.length===0)return-1;var s=Ee(-1,t.length,e,t,n,i||j.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(t[s],t[s-1],!0)===0;)--s;return s}});var $t=v(Nt=>{function Oe(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function Ln(r,e){return Math.round(r+Math.random()*(e-r))}function xe(r,e,t,n){if(t<n){var i=Ln(t,n),s=t-1;Oe(r,i,n);for(var o=r[n],l=t;l<n;l++)e(r[l],o)<=0&&(s+=1,Oe(r,s,l));Oe(r,s+1,l);var a=s+1;xe(r,e,t,a-1),xe(r,e,a+1,n)}}Nt.quickSort=function(r,e){xe(r,e,0,r.length-1)}});var It=v(me=>{var f=z(),ke=Lt(),J=be().ArraySet,Nn=ye(),te=$t().quickSort;function w(r,e){var t=r;return typeof r=="string"&&(t=f.parseSourceMapInput(r)),t.sections!=null?new M(t,e):new b(t,e)}w.fromSourceMap=function(r,e){return b.fromSourceMap(r,e)};w.prototype._version=3;w.prototype.__generatedMappings=null;Object.defineProperty(w.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});w.prototype.__originalMappings=null;Object.defineProperty(w.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});w.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return n===";"||n===","};w.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")};w.GENERATED_ORDER=1;w.ORIGINAL_ORDER=2;w.GREATEST_LOWER_BOUND=1;w.LEAST_UPPER_BOUND=2;w.prototype.eachMapping=function(e,t,n){var i=t||null,s=n||w.GENERATED_ORDER,o;switch(s){case w.GENERATED_ORDER:o=this._generatedMappings;break;case w.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;o.map(function(a){var m=a.source===null?null:this._sources.at(a.source);return m=f.computeSourceURL(l,m,this._sourceMapURL),{source:m,generatedLine:a.generatedLine,generatedColumn:a.generatedColumn,originalLine:a.originalLine,originalColumn:a.originalColumn,name:a.name===null?null:this._names.at(a.name)}},this).forEach(e,i)};w.prototype.allGeneratedPositionsFor=function(e){var t=f.getArg(e,"line"),n={source:f.getArg(e,"source"),originalLine:t,originalColumn:f.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",f.compareByOriginalPositions,ke.LEAST_UPPER_BOUND);if(s>=0){var o=this._originalMappings[s];if(e.column===void 0)for(var l=o.originalLine;o&&o.originalLine===l;)i.push({line:f.getArg(o,"generatedLine",null),column:f.getArg(o,"generatedColumn",null),lastColumn:f.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var a=o.originalColumn;o&&o.originalLine===t&&o.originalColumn==a;)i.push({line:f.getArg(o,"generatedLine",null),column:f.getArg(o,"generatedColumn",null),lastColumn:f.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return i};me.SourceMapConsumer=w;function b(r,e){var t=r;typeof r=="string"&&(t=f.parseSourceMapInput(r));var n=f.getArg(t,"version"),i=f.getArg(t,"sources"),s=f.getArg(t,"names",[]),o=f.getArg(t,"sourceRoot",null),l=f.getArg(t,"sourcesContent",null),a=f.getArg(t,"mappings"),m=f.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=f.normalize(o)),i=i.map(String).map(f.normalize).map(function(u){return o&&f.isAbsolute(o)&&f.isAbsolute(u)?f.relative(o,u):u}),this._names=J.fromArray(s.map(String),!0),this._sources=J.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(u){return f.computeSourceURL(o,u,e)}),this.sourceRoot=o,this.sourcesContent=l,this._mappings=a,this._sourceMapURL=e,this.file=m}b.prototype=Object.create(w.prototype);b.prototype.consumer=w;b.prototype._findSourceIndex=function(r){var e=r;if(this.sourceRoot!=null&&(e=f.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==r)return t;return-1};b.fromSourceMap=function(e,t){var n=Object.create(b.prototype),i=n._names=J.fromArray(e._names.toArray(),!0),s=n._sources=J.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(d){return f.computeSourceURL(n.sourceRoot,d,t)});for(var o=e._mappings.toArray().slice(),l=n.__generatedMappings=[],a=n.__originalMappings=[],m=0,u=o.length;m<u;m++){var h=o[m],c=new Pt;c.generatedLine=h.generatedLine,c.generatedColumn=h.generatedColumn,h.source&&(c.source=s.indexOf(h.source),c.originalLine=h.originalLine,c.originalColumn=h.originalColumn,h.name&&(c.name=i.indexOf(h.name)),a.push(c)),l.push(c)}return te(n.__originalMappings,f.compareByOriginalPositions),n};b.prototype._version=3;Object.defineProperty(b.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Pt(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}b.prototype._parseMappings=function(e,t){for(var n=1,i=0,s=0,o=0,l=0,a=0,m=e.length,u=0,h={},c={},d=[],g=[],y,L,A,G,ht;u<m;)if(e.charAt(u)===";")n++,u++,i=0;else if(e.charAt(u)===",")u++;else{for(y=new Pt,y.generatedLine=n,G=u;G<m&&!this._charIsMappingSeparator(e,G);G++);if(L=e.slice(u,G),A=h[L],A)u+=L.length;else{for(A=[];u<G;)Nn.decode(e,u,c),ht=c.value,u=c.rest,A.push(ht);if(A.length===2)throw new Error("Found a source, but no line and column");if(A.length===3)throw new Error("Found a source and line, but no column");h[L]=A}y.generatedColumn=i+A[0],i=y.generatedColumn,A.length>1&&(y.source=l+A[1],l+=A[1],y.originalLine=s+A[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=o+A[3],o=y.originalColumn,A.length>4&&(y.name=a+A[4],a+=A[4])),g.push(y),typeof y.originalLine=="number"&&d.push(y)}te(g,f.compareByGeneratedPositionsDeflated),this.__generatedMappings=g,te(d,f.compareByOriginalPositions),this.__originalMappings=d};b.prototype._findMapping=function(e,t,n,i,s,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return ke.search(e,t,s,o)};b.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};b.prototype.originalPositionFor=function(e){var t={generatedLine:f.getArg(e,"line"),generatedColumn:f.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",f.compareByGeneratedPositionsDeflated,f.getArg(e,"bias",w.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var s=f.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),s=f.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=f.getArg(i,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:f.getArg(i,"originalLine",null),column:f.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};b.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};b.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=f.relative(this.sourceRoot,i));var s;if(this.sourceRoot!=null&&(s=f.urlParse(this.sourceRoot))){var o=i.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!s.path||s.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')};b.prototype.generatedPositionFor=function(e){var t=f.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:f.getArg(e,"line"),originalColumn:f.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",f.compareByOriginalPositions,f.getArg(e,"bias",w.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:f.getArg(s,"generatedLine",null),column:f.getArg(s,"generatedColumn",null),lastColumn:f.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};me.BasicSourceMapConsumer=b;function M(r,e){var t=r;typeof r=="string"&&(t=f.parseSourceMapInput(r));var n=f.getArg(t,"version"),i=f.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new J,this._names=new J;var s={line:-1,column:0};this._sections=i.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var l=f.getArg(o,"offset"),a=f.getArg(l,"line"),m=f.getArg(l,"column");if(a<s.line||a===s.line&&m<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=l,{generatedOffset:{generatedLine:a+1,generatedColumn:m+1},consumer:new w(f.getArg(o,"map"),e)}})}M.prototype=Object.create(w.prototype);M.prototype.constructor=w;M.prototype._version=3;Object.defineProperty(M.prototype,"sources",{get:function(){for(var r=[],e=0;e<this._sections.length;e++)for(var t=0;t<this._sections[e].consumer.sources.length;t++)r.push(this._sections[e].consumer.sources[t]);return r}});M.prototype.originalPositionFor=function(e){var t={generatedLine:f.getArg(e,"line"),generatedColumn:f.getArg(e,"column")},n=ke.search(t,this._sections,function(s,o){var l=s.generatedLine-o.generatedOffset.generatedLine;return l||s.generatedColumn-o.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};M.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};M.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],s=i.consumer.sourceContentFor(e,!0);if(s)return s}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')};M.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(n.consumer._findSourceIndex(f.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var s={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};M.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],s=i.consumer._generatedMappings,o=0;o<s.length;o++){var l=s[o],a=i.consumer._sources.at(l.source);a=f.computeSourceURL(i.consumer.sourceRoot,a,this._sourceMapURL),this._sources.add(a),a=this._sources.indexOf(a);var m=null;l.name&&(m=i.consumer._names.at(l.name),this._names.add(m),m=this._names.indexOf(m));var u={source:a,generatedLine:l.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:l.generatedColumn+(i.generatedOffset.generatedLine===l.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:l.originalLine,originalColumn:l.originalColumn,name:m};this.__generatedMappings.push(u),typeof u.originalLine=="number"&&this.__originalMappings.push(u)}te(this.__generatedMappings,f.compareByGeneratedPositionsDeflated),te(this.__originalMappings,f.compareByOriginalPositions)};me.IndexedSourceMapConsumer=M});var Vt=v(Rt=>{var $n=Ae().SourceMapGenerator,le=z(),Pn=/(\r?\n)/,In=10,K="$$$isSourceNode$$$";function O(r,e,t,n,i){this.children=[],this.sourceContents={},this.line=r??null,this.column=e??null,this.source=t??null,this.name=i??null,this[K]=!0,n!=null&&this.add(n)}O.fromStringWithSourceMap=function(e,t,n){var i=new O,s=e.split(Pn),o=0,l=function(){var c=g(),d=g()||"";return c+d;function g(){return o<s.length?s[o++]:void 0}},a=1,m=0,u=null;return t.eachMapping(function(c){if(u!==null)if(a<c.generatedLine)h(u,l()),a++,m=0;else{var d=s[o]||"",g=d.substr(0,c.generatedColumn-m);s[o]=d.substr(c.generatedColumn-m),m=c.generatedColumn,h(u,g),u=c;return}for(;a<c.generatedLine;)i.add(l()),a++;if(m<c.generatedColumn){var d=s[o]||"";i.add(d.substr(0,c.generatedColumn)),s[o]=d.substr(c.generatedColumn),m=c.generatedColumn}u=c},this),o<s.length&&(u&&h(u,l()),i.add(s.splice(o).join(""))),t.sources.forEach(function(c){var d=t.sourceContentFor(c);d!=null&&(n!=null&&(c=le.join(n,c)),i.setSourceContent(c,d))}),i;function h(c,d){if(c===null||c.source===void 0)i.add(d);else{var g=n?le.join(n,c.source):c.source;i.add(new O(c.originalLine,c.originalColumn,g,d,c.name))}}};O.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(t){this.add(t)},this);else if(e[K]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};O.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else if(e[K]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};O.prototype.walk=function(e){for(var t,n=0,i=this.children.length;n<i;n++)t=this.children[n],t[K]?t.walk(e):t!==""&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})};O.prototype.join=function(e){var t,n,i=this.children.length;if(i>0){for(t=[],n=0;n<i-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this};O.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[K]?n.replaceRight(e,t):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this};O.prototype.setSourceContent=function(e,t){this.sourceContents[le.toSetString(e)]=t};O.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][K]&&this.children[t].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),t=0,n=i.length;t<n;t++)e(le.fromSetString(i[t]),this.sourceContents[i[t]])};O.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e};O.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new $n(e),i=!1,s=null,o=null,l=null,a=null;return this.walk(function(m,u){t.code+=m,u.source!==null&&u.line!==null&&u.column!==null?((s!==u.source||o!==u.line||l!==u.column||a!==u.name)&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:t.line,column:t.column},name:u.name}),s=u.source,o=u.line,l=u.column,a=u.name,i=!0):i&&(n.addMapping({generated:{line:t.line,column:t.column}}),s=null,i=!1);for(var h=0,c=m.length;h<c;h++)m.charCodeAt(h)===In?(t.line++,t.column=0,h+1===c?(s=null,i=!1):i&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:t.line,column:t.column},name:u.name})):t.column++}),this.walkSourceContents(function(m,u){n.setSourceContent(m,u)}),{code:t.code,map:n}};Rt.SourceNode=O});var Tt=v(ue=>{ue.SourceMapGenerator=Ae().SourceMapGenerator;ue.SourceMapConsumer=It().SourceMapConsumer;ue.SourceNode=Vt().SourceNode});var Dt=v((fs,jt)=>{var Rn=Object.prototype.toString,Me=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Vn(r){return Rn.call(r).slice(8,-1)==="ArrayBuffer"}function Tn(r,e,t){e>>>=0;var n=r.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=n;else if(t>>>=0,t>n)throw new RangeError("'length' is out of bounds");return Me?Buffer.from(r.slice(e,e+t)):new Buffer(new Uint8Array(r.slice(e,e+t)))}function jn(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Me?Buffer.from(r,e):new Buffer(r,e)}function Dn(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return Vn(r)?Tn(r,e,t):typeof r=="string"?jn(r,e):Me?Buffer.from(r):new Buffer(r)}jt.exports=Dn});var zt=v((q,Pe)=>{var qn=Tt().SourceMapConsumer,Le=require("path"),N;try{N=require("fs"),(!N.existsSync||!N.readFileSync)&&(N=null)}catch{}var Hn=Dt();function qt(r,e){return r.require(e)}var Ht=!1,Ft=!1,Ne=!1,re="auto",D={},ne={},Fn=/^data:application\/json[^,]+base64,/,I=[],R=[];function Ie(){return re==="browser"?!0:re==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function Gn(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function Un(){return typeof process=="object"&&process!==null?process.version:""}function Bn(){if(typeof process=="object"&&process!==null)return process.stderr}function Wn(r){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(r)}function ce(r){return function(e){for(var t=0;t<r.length;t++){var n=r[t](e);if(n)return n}return null}}var Re=ce(I);I.push(function(r){if(r=r.trim(),/^file:/.test(r)&&(r=r.replace(/file:\/\/\/(\w:)?/,function(n,i){return i?"":"/"})),r in D)return D[r];var e="";try{if(N)N.existsSync(r)&&(e=N.readFileSync(r,"utf8"));else{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),t.readyState===4&&t.status===200&&(e=t.responseText)}}catch{}return D[r]=e});function $e(r,e){if(!r)return e;var t=Le.dirname(r),n=/^\w+:\/\/[^\/]*/.exec(t),i=n?n[0]:"",s=t.slice(i.length);return i&&/^\/\w\:/.test(s)?(i+="/",i+Le.resolve(t.slice(i.length),e).replace(/\\/g,"/")):i+Le.resolve(t.slice(i.length),e)}function zn(r){var e;if(Ie())try{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),e=t.readyState===4?t.responseText:null;var n=t.getResponseHeader("SourceMap")||t.getResponseHeader("X-SourceMap");if(n)return n}catch{}e=Re(r);for(var i=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,s,o;o=i.exec(e);)s=o;return s?s[1]:null}var Ve=ce(R);R.push(function(r){var e=zn(r);if(!e)return null;var t;if(Fn.test(e)){var n=e.slice(e.indexOf(",")+1);t=Hn(n,"base64").toString(),e=r}else e=$e(r,e),t=Re(e);return t?{url:e,map:t}:null});function Te(r){var e=ne[r.source];if(!e){var t=Ve(r.source);t?(e=ne[r.source]={url:t.url,map:new qn(t.map)},e.map.sourcesContent&&e.map.sources.forEach(function(i,s){var o=e.map.sourcesContent[s];if(o){var l=$e(e.url,i);D[l]=o}})):e=ne[r.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var n=e.map.originalPositionFor(r);if(n.source!==null)return n.source=$e(e.url,n.source),n}return r}function Ut(r){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(r);if(e){var t=Te({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+t.source+":"+t.line+":"+(t.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(r),e?"eval at "+e[1]+" ("+Ut(e[2])+")":r}function Jn(){var r,e="";if(this.isNative())e="native";else{r=this.getScriptNameOrSourceURL(),!r&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),r?e+=r:e+="<anonymous>";var t=this.getLineNumber();if(t!=null){e+=":"+t;var n=this.getColumnNumber();n&&(e+=":"+n)}}var i="",s=this.getFunctionName(),o=!0,l=this.isConstructor(),a=!(this.isToplevel()||l);if(a){var m=this.getTypeName();m==="[object Object]"&&(m="null");var u=this.getMethodName();s?(m&&s.indexOf(m)!=0&&(i+=m+"."),i+=s,u&&s.indexOf("."+u)!=s.length-u.length-1&&(i+=" [as "+u+"]")):i+=m+"."+(u||"<anonymous>")}else l?i+="new "+(s||"<anonymous>"):s?i+=s:(i+=e,o=!1);return o&&(i+=" ("+e+")"),i}function Gt(r){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(function(t){e[t]=/^(?:is|get)/.test(t)?function(){return r[t].call(r)}:r[t]}),e.toString=Jn,e}function Bt(r,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),r.isNative())return e.curPosition=null,r;var t=r.getFileName()||r.getScriptNameOrSourceURL();if(t){var n=r.getLineNumber(),i=r.getColumnNumber()-1,s=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,o=s.test(Un())?0:62;n===1&&i>o&&!Ie()&&!r.isEval()&&(i-=o);var l=Te({source:t,line:n,column:i});e.curPosition=l,r=Gt(r);var a=r.getFunctionName;return r.getFunctionName=function(){return e.nextPosition==null?a():e.nextPosition.name||a()},r.getFileName=function(){return l.source},r.getLineNumber=function(){return l.line},r.getColumnNumber=function(){return l.column+1},r.getScriptNameOrSourceURL=function(){return l.source},r}var m=r.isEval()&&r.getEvalOrigin();return m&&(m=Ut(m),r=Gt(r),r.getEvalOrigin=function(){return m}),r}function Kn(r,e){Ne&&(D={},ne={});for(var t=r.name||"Error",n=r.message||"",i=t+": "+n,s={nextPosition:null,curPosition:null},o=[],l=e.length-1;l>=0;l--)o.push(`
3
- at `+Bt(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,i+o.reverse().join("")}function Wt(r){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(r.stack);if(e){var t=e[1],n=+e[2],i=+e[3],s=D[t];if(!s&&N&&N.existsSync(t))try{s=N.readFileSync(t,"utf8")}catch{s=""}if(s){var o=s.split(/(?:\r\n|\r|\n)/)[n-1];if(o)return t+":"+n+`
4
- `+o+`
5
- `+new Array(i).join(" ")+"^"}}return null}function Qn(r){var e=Wt(r),t=Bn();t&&t._handle&&t._handle.setBlocking&&t._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(r.stack),Wn(1)}function Xn(){var r=process.emit;process.emit=function(e){if(e==="uncaughtException"){var t=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(t&&!n)return Qn(arguments[1])}return r.apply(this,arguments)}}var Yn=I.slice(0),Zn=R.slice(0);q.wrapCallSite=Bt;q.getErrorSource=Wt;q.mapSourcePosition=Te;q.retrieveSourceMap=Ve;q.install=function(r){if(r=r||{},r.environment&&(re=r.environment,["node","browser","auto"].indexOf(re)===-1))throw new Error("environment "+re+" was unknown. Available options are {auto, browser, node}");if(r.retrieveFile&&(r.overrideRetrieveFile&&(I.length=0),I.unshift(r.retrieveFile)),r.retrieveSourceMap&&(r.overrideRetrieveSourceMap&&(R.length=0),R.unshift(r.retrieveSourceMap)),r.hookRequire&&!Ie()){var e=qt(Pe,"module"),t=e.prototype._compile;t.__sourceMapSupport||(e.prototype._compile=function(s,o){return D[o]=s,ne[o]=void 0,t.call(this,s,o)},e.prototype._compile.__sourceMapSupport=!0)}if(Ne||(Ne="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:!1),Ht||(Ht=!0,Error.prepareStackTrace=Kn),!Ft){var n="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:!0;try{var i=qt(Pe,"worker_threads");i.isMainThread===!1&&(n=!1)}catch{}n&&Gn()&&(Ft=!0,Xn())}};q.resetRetrieveHandlers=function(){I.length=0,R.length=0,I=Yn.slice(0),R=Zn.slice(0),Ve=ce(R),Re=ce(I)}});var ie=v(De=>{var he=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},je=class extends he{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};De.CommanderError=he;De.InvalidArgumentError=je});var fe=v(He=>{var{InvalidArgumentError:ei}=ie(),qe=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new ei(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function ti(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}He.Argument=qe;He.humanReadableArgName=ti});var Ge=v(Jt=>{var{humanReadableArgName:ri}=fe(),Fe=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((i,s)=>i.name().localeCompare(s.name())),t}compareOptions(e,t){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);!i&&!s?t.push(n):n.long&&!s?t.push(e.createOption(n.long,n.description)):n.short&&!i&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(s=>!s.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>ri(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,i)=>Math.max(n,t.subcommandTerm(i).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,i)=>Math.max(n,t.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,t.optionTerm(i).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,i)=>Math.max(n,t.argumentTerm(i).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){let n=t.padWidth(e,t),i=t.helpWidth||80,s=2,o=2;function l(g,y){if(y){let L=`${g.padEnd(n+o)}${y}`;return t.wrap(L,i-s,n+o)}return g}function a(g){return g.join(`
6
- `).replace(/^/gm," ".repeat(s))}let m=[`Usage: ${t.commandUsage(e)}`,""],u=t.commandDescription(e);u.length>0&&(m=m.concat([t.wrap(u,i,0),""]));let h=t.visibleArguments(e).map(g=>l(t.argumentTerm(g),t.argumentDescription(g)));h.length>0&&(m=m.concat(["Arguments:",a(h),""]));let c=t.visibleOptions(e).map(g=>l(t.optionTerm(g),t.optionDescription(g)));if(c.length>0&&(m=m.concat(["Options:",a(c),""])),this.showGlobalOptions){let g=t.visibleGlobalOptions(e).map(y=>l(t.optionTerm(y),t.optionDescription(y)));g.length>0&&(m=m.concat(["Global Options:",a(g),""]))}let d=t.visibleCommands(e).map(g=>l(t.subcommandTerm(g),t.subcommandDescription(g)));return d.length>0&&(m=m.concat(["Commands:",a(d),""])),m.join(`
7
- `)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,i=40){let s=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",o=new RegExp(`[\\n][${s}]+`);if(e.match(o))return e;let l=t-n;if(l<i)return e;let a=e.slice(0,n),m=e.slice(n).replace(`\r
2
+ "use strict";var no=Object.create;var Ot=Object.defineProperty;var oo=Object.getOwnPropertyDescriptor;var io=Object.getOwnPropertyNames;var so=Object.getPrototypeOf,ao=Object.prototype.hasOwnProperty;var _=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var mo=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of io(e))!ao.call(r,o)&&o!==t&&Ot(r,o,{get:()=>e[o],enumerable:!(n=oo(e,o))||n.enumerable});return r};var W=(r,e,t)=>(t=r!=null?no(so(r)):{},mo(e||!r||!r.__esModule?Ot(t,"default",{value:r,enumerable:!0}):t,r));var kt=_(Ae=>{var Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Ae.encode=function(r){if(0<=r&&r<Et.length)return Et[r];throw new TypeError("Must be between 0 and 63: "+r)};Ae.decode=function(r){var e=65,t=90,n=97,o=122,i=48,s=57,u=43,a=47,m=26,l=52;return e<=r&&r<=t?r-e:n<=r&&r<=o?r-n+m:i<=r&&r<=s?r-i+l:r==u?62:r==a?63:-1}});var ke=_(Ee=>{var Mt=kt(),Oe=5,Lt=1<<Oe,jt=Lt-1,Tt=Lt;function uo(r){return r<0?(-r<<1)+1:(r<<1)+0}function lo(r){var e=(r&1)===1,t=r>>1;return e?-t:t}Ee.encode=function(e){var t="",n,o=uo(e);do n=o&jt,o>>>=Oe,o>0&&(n|=Tt),t+=Mt.encode(n);while(o>0);return t};Ee.decode=function(e,t,n){var o=e.length,i=0,s=0,u,a;do{if(t>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(a=Mt.decode(e.charCodeAt(t++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));u=!!(a&Tt),a&=jt,i=i+(a<<s),s+=Oe}while(u);n.value=lo(i),n.rest=t}});var K=_(O=>{function fo(r,e,t){if(e in r)return r[e];if(arguments.length===3)return t;throw new Error('"'+e+'" is a required argument.')}O.getArg=fo;var Nt=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,co=/^data:.+\,.+$/;function ne(r){var e=r.match(Nt);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}O.urlParse=ne;function G(r){var e="";return r.scheme&&(e+=r.scheme+":"),e+="//",r.auth&&(e+=r.auth+"@"),r.host&&(e+=r.host),r.port&&(e+=":"+r.port),r.path&&(e+=r.path),e}O.urlGenerate=G;function Me(r){var e=r,t=ne(r);if(t){if(!t.path)return r;e=t.path}for(var n=O.isAbsolute(e),o=e.split(/\/+/),i,s=0,u=o.length-1;u>=0;u--)i=o[u],i==="."?o.splice(u,1):i===".."?s++:s>0&&(i===""?(o.splice(u+1,s),s=0):(o.splice(u,2),s--));return e=o.join("/"),e===""&&(e=n?"/":"."),t?(t.path=e,G(t)):e}O.normalize=Me;function Pt(r,e){r===""&&(r="."),e===""&&(e=".");var t=ne(e),n=ne(r);if(n&&(r=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),G(t);if(t||e.match(co))return e;if(n&&!n.host&&!n.path)return n.host=e,G(n);var o=e.charAt(0)==="/"?e:Me(r.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,G(n)):o}O.join=Pt;O.isAbsolute=function(r){return r.charAt(0)==="/"||Nt.test(r)};function po(r,e){r===""&&(r="."),r=r.replace(/\/$/,"");for(var t=0;e.indexOf(r+"/")!==0;){var n=r.lastIndexOf("/");if(n<0||(r=r.slice(0,n),r.match(/^([^\/]+:\/)?\/*$/)))return e;++t}return Array(t+1).join("../")+e.substr(r.length+1)}O.relative=po;var It=function(){var r=Object.create(null);return!("__proto__"in r)}();function $t(r){return r}function ho(r){return Rt(r)?"$"+r:r}O.toSetString=It?$t:ho;function go(r){return Rt(r)?r.slice(1):r}O.fromSetString=It?$t:go;function Rt(r){if(!r)return!1;var e=r.length;if(e<9||r.charCodeAt(e-1)!==95||r.charCodeAt(e-2)!==95||r.charCodeAt(e-3)!==111||r.charCodeAt(e-4)!==116||r.charCodeAt(e-5)!==111||r.charCodeAt(e-6)!==114||r.charCodeAt(e-7)!==112||r.charCodeAt(e-8)!==95||r.charCodeAt(e-9)!==95)return!1;for(var t=e-10;t>=0;t--)if(r.charCodeAt(t)!==36)return!1;return!0}function vo(r,e,t){var n=z(r.source,e.source);return n!==0||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0||t)||(n=r.generatedColumn-e.generatedColumn,n!==0)||(n=r.generatedLine-e.generatedLine,n!==0)?n:z(r.name,e.name)}O.compareByOriginalPositions=vo;function _o(r,e,t){var n=r.generatedLine-e.generatedLine;return n!==0||(n=r.generatedColumn-e.generatedColumn,n!==0||t)||(n=z(r.source,e.source),n!==0)||(n=r.originalLine-e.originalLine,n!==0)||(n=r.originalColumn-e.originalColumn,n!==0)?n:z(r.name,e.name)}O.compareByGeneratedPositionsDeflated=_o;function z(r,e){return r===e?0:r===null?1:e===null?-1:r>e?1:-1}function xo(r,e){var t=r.generatedLine-e.generatedLine;return t!==0||(t=r.generatedColumn-e.generatedColumn,t!==0)||(t=z(r.source,e.source),t!==0)||(t=r.originalLine-e.originalLine,t!==0)||(t=r.originalColumn-e.originalColumn,t!==0)?t:z(r.name,e.name)}O.compareByGeneratedPositionsInflated=xo;function yo(r){return JSON.parse(r.replace(/^\)]}'[^\n]*\n/,""))}O.parseSourceMapInput=yo;function bo(r,e,t){if(e=e||"",r&&(r[r.length-1]!=="/"&&e[0]!=="/"&&(r+="/"),e=r+e),t){var n=ne(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=Pt(G(n),e)}return Me(e)}O.computeSourceURL=bo});var Te=_(Vt=>{var Le=K(),je=Object.prototype.hasOwnProperty,F=typeof Map<"u";function P(){this._array=[],this._set=F?new Map:Object.create(null)}P.fromArray=function(e,t){for(var n=new P,o=0,i=e.length;o<i;o++)n.add(e[o],t);return n};P.prototype.size=function(){return F?this._set.size:Object.getOwnPropertyNames(this._set).length};P.prototype.add=function(e,t){var n=F?e:Le.toSetString(e),o=F?this.has(e):je.call(this._set,n),i=this._array.length;(!o||t)&&this._array.push(e),o||(F?this._set.set(e,i):this._set[n]=i)};P.prototype.has=function(e){if(F)return this._set.has(e);var t=Le.toSetString(e);return je.call(this._set,t)};P.prototype.indexOf=function(e){if(F){var t=this._set.get(e);if(t>=0)return t}else{var n=Le.toSetString(e);if(je.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};P.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};P.prototype.toArray=function(){return this._array.slice()};Vt.ArraySet=P});var qt=_(Dt=>{var Ft=K();function wo(r,e){var t=r.generatedLine,n=e.generatedLine,o=r.generatedColumn,i=e.generatedColumn;return n>t||n==t&&i>=o||Ft.compareByGeneratedPositionsInflated(r,e)<=0}function ce(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}ce.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)};ce.prototype.add=function(e){wo(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};ce.prototype.toArray=function(){return this._sorted||(this._array.sort(Ft.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Dt.MappingList=ce});var Ne=_(Ht=>{var oe=ke(),S=K(),pe=Te().ArraySet,So=qt().MappingList;function k(r){r||(r={}),this._file=S.getArg(r,"file",null),this._sourceRoot=S.getArg(r,"sourceRoot",null),this._skipValidation=S.getArg(r,"skipValidation",!1),this._sources=new pe,this._names=new pe,this._mappings=new So,this._sourcesContents=null}k.prototype._version=3;k.fromSourceMap=function(e){var t=e.sourceRoot,n=new k({file:e.file,sourceRoot:t});return e.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,t!=null&&(i.source=S.relative(t,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),n.addMapping(i)}),e.sources.forEach(function(o){var i=o;t!==null&&(i=S.relative(t,o)),n._sources.has(i)||n._sources.add(i);var s=e.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};k.prototype.addMapping=function(e){var t=S.getArg(e,"generated"),n=S.getArg(e,"original",null),o=S.getArg(e,"source",null),i=S.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i})};k.prototype.setSourceContent=function(e,t){var n=e;this._sourceRoot!=null&&(n=S.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[S.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[S.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};k.prototype.applySourceMap=function(e,t,n){var o=t;if(t==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var i=this._sourceRoot;i!=null&&(o=S.relative(i,o));var s=new pe,u=new pe;this._mappings.unsortedForEach(function(a){if(a.source===o&&a.originalLine!=null){var m=e.originalPositionFor({line:a.originalLine,column:a.originalColumn});m.source!=null&&(a.source=m.source,n!=null&&(a.source=S.join(n,a.source)),i!=null&&(a.source=S.relative(i,a.source)),a.originalLine=m.line,a.originalColumn=m.column,m.name!=null&&(a.name=m.name))}var l=a.source;l!=null&&!s.has(l)&&s.add(l);var c=a.name;c!=null&&!u.has(c)&&u.add(c)},this),this._sources=s,this._names=u,e.sources.forEach(function(a){var m=e.sourceContentFor(a);m!=null&&(n!=null&&(a=S.join(n,a)),i!=null&&(a=S.relative(i,a)),this.setSourceContent(a,m))},this)};k.prototype._validateMapping=function(e,t,n,o){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!o)){if(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:o}))}};k.prototype._serializeMappings=function(){for(var e=0,t=1,n=0,o=0,i=0,s=0,u="",a,m,l,c,f=this._mappings.toArray(),h=0,g=f.length;h<g;h++){if(m=f[h],a="",m.generatedLine!==t)for(e=0;m.generatedLine!==t;)a+=";",t++;else if(h>0){if(!S.compareByGeneratedPositionsInflated(m,f[h-1]))continue;a+=","}a+=oe.encode(m.generatedColumn-e),e=m.generatedColumn,m.source!=null&&(c=this._sources.indexOf(m.source),a+=oe.encode(c-s),s=c,a+=oe.encode(m.originalLine-1-o),o=m.originalLine-1,a+=oe.encode(m.originalColumn-n),n=m.originalColumn,m.name!=null&&(l=this._names.indexOf(m.name),a+=oe.encode(l-i),i=l)),u+=a}return u};k.prototype._generateSourcesContent=function(e,t){return e.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=S.relative(t,n));var o=S.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};k.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};k.prototype.toString=function(){return JSON.stringify(this.toJSON())};Ht.SourceMapGenerator=k});var Bt=_(D=>{D.GREATEST_LOWER_BOUND=1;D.LEAST_UPPER_BOUND=2;function Pe(r,e,t,n,o,i){var s=Math.floor((e-r)/2)+r,u=o(t,n[s],!0);return u===0?s:u>0?e-s>1?Pe(s,e,t,n,o,i):i==D.LEAST_UPPER_BOUND?e<n.length?e:-1:s:s-r>1?Pe(r,s,t,n,o,i):i==D.LEAST_UPPER_BOUND?s:r<0?-1:r}D.search=function(e,t,n,o){if(t.length===0)return-1;var i=Pe(-1,t.length,e,t,n,o||D.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&n(t[i],t[i-1],!0)===0;)--i;return i}});var Wt=_(Ut=>{function Ie(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function Co(r,e){return Math.round(r+Math.random()*(e-r))}function $e(r,e,t,n){if(t<n){var o=Co(t,n),i=t-1;Ie(r,o,n);for(var s=r[n],u=t;u<n;u++)e(r[u],s)<=0&&(i+=1,Ie(r,i,u));Ie(r,i+1,u);var a=i+1;$e(r,e,t,a-1),$e(r,e,a+1,n)}}Ut.quickSort=function(r,e){$e(r,e,0,r.length-1)}});var zt=_(de=>{var p=K(),Re=Bt(),J=Te().ArraySet,Ao=ke(),ie=Wt().quickSort;function y(r,e){var t=r;return typeof r=="string"&&(t=p.parseSourceMapInput(r)),t.sections!=null?new L(t,e):new C(t,e)}y.fromSourceMap=function(r,e){return C.fromSourceMap(r,e)};y.prototype._version=3;y.prototype.__generatedMappings=null;Object.defineProperty(y.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});y.prototype.__originalMappings=null;Object.defineProperty(y.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});y.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return n===";"||n===","};y.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")};y.GENERATED_ORDER=1;y.ORIGINAL_ORDER=2;y.GREATEST_LOWER_BOUND=1;y.LEAST_UPPER_BOUND=2;y.prototype.eachMapping=function(e,t,n){var o=t||null,i=n||y.GENERATED_ORDER,s;switch(i){case y.GENERATED_ORDER:s=this._generatedMappings;break;case y.ORIGINAL_ORDER:s=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var u=this.sourceRoot;s.map(function(a){var m=a.source===null?null:this._sources.at(a.source);return m=p.computeSourceURL(u,m,this._sourceMapURL),{source:m,generatedLine:a.generatedLine,generatedColumn:a.generatedColumn,originalLine:a.originalLine,originalColumn:a.originalColumn,name:a.name===null?null:this._names.at(a.name)}},this).forEach(e,o)};y.prototype.allGeneratedPositionsFor=function(e){var t=p.getArg(e,"line"),n={source:p.getArg(e,"source"),originalLine:t,originalColumn:p.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",p.compareByOriginalPositions,Re.LEAST_UPPER_BOUND);if(i>=0){var s=this._originalMappings[i];if(e.column===void 0)for(var u=s.originalLine;s&&s.originalLine===u;)o.push({line:p.getArg(s,"generatedLine",null),column:p.getArg(s,"generatedColumn",null),lastColumn:p.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var a=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==a;)o.push({line:p.getArg(s,"generatedLine",null),column:p.getArg(s,"generatedColumn",null),lastColumn:p.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return o};de.SourceMapConsumer=y;function C(r,e){var t=r;typeof r=="string"&&(t=p.parseSourceMapInput(r));var n=p.getArg(t,"version"),o=p.getArg(t,"sources"),i=p.getArg(t,"names",[]),s=p.getArg(t,"sourceRoot",null),u=p.getArg(t,"sourcesContent",null),a=p.getArg(t,"mappings"),m=p.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=p.normalize(s)),o=o.map(String).map(p.normalize).map(function(l){return s&&p.isAbsolute(s)&&p.isAbsolute(l)?p.relative(s,l):l}),this._names=J.fromArray(i.map(String),!0),this._sources=J.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(l){return p.computeSourceURL(s,l,e)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=a,this._sourceMapURL=e,this.file=m}C.prototype=Object.create(y.prototype);C.prototype.consumer=y;C.prototype._findSourceIndex=function(r){var e=r;if(this.sourceRoot!=null&&(e=p.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==r)return t;return-1};C.fromSourceMap=function(e,t){var n=Object.create(C.prototype),o=n._names=J.fromArray(e._names.toArray(),!0),i=n._sources=J.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(h){return p.computeSourceURL(n.sourceRoot,h,t)});for(var s=e._mappings.toArray().slice(),u=n.__generatedMappings=[],a=n.__originalMappings=[],m=0,l=s.length;m<l;m++){var c=s[m],f=new Gt;f.generatedLine=c.generatedLine,f.generatedColumn=c.generatedColumn,c.source&&(f.source=i.indexOf(c.source),f.originalLine=c.originalLine,f.originalColumn=c.originalColumn,c.name&&(f.name=o.indexOf(c.name)),a.push(f)),u.push(f)}return ie(n.__originalMappings,p.compareByOriginalPositions),n};C.prototype._version=3;Object.defineProperty(C.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Gt(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}C.prototype._parseMappings=function(e,t){for(var n=1,o=0,i=0,s=0,u=0,a=0,m=e.length,l=0,c={},f={},h=[],g=[],x,T,A,U,At;l<m;)if(e.charAt(l)===";")n++,l++,o=0;else if(e.charAt(l)===",")l++;else{for(x=new Gt,x.generatedLine=n,U=l;U<m&&!this._charIsMappingSeparator(e,U);U++);if(T=e.slice(l,U),A=c[T],A)l+=T.length;else{for(A=[];l<U;)Ao.decode(e,l,f),At=f.value,l=f.rest,A.push(At);if(A.length===2)throw new Error("Found a source, but no line and column");if(A.length===3)throw new Error("Found a source and line, but no column");c[T]=A}x.generatedColumn=o+A[0],o=x.generatedColumn,A.length>1&&(x.source=u+A[1],u+=A[1],x.originalLine=i+A[2],i=x.originalLine,x.originalLine+=1,x.originalColumn=s+A[3],s=x.originalColumn,A.length>4&&(x.name=a+A[4],a+=A[4])),g.push(x),typeof x.originalLine=="number"&&h.push(x)}ie(g,p.compareByGeneratedPositionsDeflated),this.__generatedMappings=g,ie(h,p.compareByOriginalPositions),this.__originalMappings=h};C.prototype._findMapping=function(e,t,n,o,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return Re.search(e,t,i,s)};C.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};C.prototype.originalPositionFor=function(e){var t={generatedLine:p.getArg(e,"line"),generatedColumn:p.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",p.compareByGeneratedPositionsDeflated,p.getArg(e,"bias",y.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=p.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=p.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=p.getArg(o,"name",null);return s!==null&&(s=this._names.at(s)),{source:i,line:p.getArg(o,"originalLine",null),column:p.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}};C.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};C.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=p.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=p.urlParse(this.sourceRoot))){var s=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(t)return null;throw new Error('"'+o+'" is not in the SourceMap.')};C.prototype.generatedPositionFor=function(e){var t=p.getArg(e,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:p.getArg(e,"line"),originalColumn:p.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",p.compareByOriginalPositions,p.getArg(e,"bias",y.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:p.getArg(i,"generatedLine",null),column:p.getArg(i,"generatedColumn",null),lastColumn:p.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};de.BasicSourceMapConsumer=C;function L(r,e){var t=r;typeof r=="string"&&(t=p.parseSourceMapInput(r));var n=p.getArg(t,"version"),o=p.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new J,this._names=new J;var i={line:-1,column:0};this._sections=o.map(function(s){if(s.url)throw new Error("Support for url field in sections not implemented.");var u=p.getArg(s,"offset"),a=p.getArg(u,"line"),m=p.getArg(u,"column");if(a<i.line||a===i.line&&m<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=u,{generatedOffset:{generatedLine:a+1,generatedColumn:m+1},consumer:new y(p.getArg(s,"map"),e)}})}L.prototype=Object.create(y.prototype);L.prototype.constructor=y;L.prototype._version=3;Object.defineProperty(L.prototype,"sources",{get:function(){for(var r=[],e=0;e<this._sections.length;e++)for(var t=0;t<this._sections[e].consumer.sources.length;t++)r.push(this._sections[e].consumer.sources[t]);return r}});L.prototype.originalPositionFor=function(e){var t={generatedLine:p.getArg(e,"line"),generatedColumn:p.getArg(e,"column")},n=Re.search(t,this._sections,function(i,s){var u=i.generatedLine-s.generatedOffset.generatedLine;return u||i.generatedColumn-s.generatedOffset.generatedColumn}),o=this._sections[n];return o?o.consumer.originalPositionFor({line:t.generatedLine-(o.generatedOffset.generatedLine-1),column:t.generatedColumn-(o.generatedOffset.generatedLine===t.generatedLine?o.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};L.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};L.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var o=this._sections[n],i=o.consumer.sourceContentFor(e,!0);if(i)return i}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')};L.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(n.consumer._findSourceIndex(p.getArg(e,"source"))!==-1){var o=n.consumer.generatedPositionFor(e);if(o){var i={line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)};return i}}}return{line:null,column:null}};L.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var u=i[s],a=o.consumer._sources.at(u.source);a=p.computeSourceURL(o.consumer.sourceRoot,a,this._sourceMapURL),this._sources.add(a),a=this._sources.indexOf(a);var m=null;u.name&&(m=o.consumer._names.at(u.name),this._names.add(m),m=this._names.indexOf(m));var l={source:a,generatedLine:u.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(o.generatedOffset.generatedLine===u.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:m};this.__generatedMappings.push(l),typeof l.originalLine=="number"&&this.__originalMappings.push(l)}ie(this.__generatedMappings,p.compareByGeneratedPositionsDeflated),ie(this.__originalMappings,p.compareByOriginalPositions)};de.IndexedSourceMapConsumer=L});var Jt=_(Kt=>{var Oo=Ne().SourceMapGenerator,he=K(),Eo=/(\r?\n)/,ko=10,Q="$$$isSourceNode$$$";function E(r,e,t,n,o){this.children=[],this.sourceContents={},this.line=r??null,this.column=e??null,this.source=t??null,this.name=o??null,this[Q]=!0,n!=null&&this.add(n)}E.fromStringWithSourceMap=function(e,t,n){var o=new E,i=e.split(Eo),s=0,u=function(){var f=g(),h=g()||"";return f+h;function g(){return s<i.length?i[s++]:void 0}},a=1,m=0,l=null;return t.eachMapping(function(f){if(l!==null)if(a<f.generatedLine)c(l,u()),a++,m=0;else{var h=i[s]||"",g=h.substr(0,f.generatedColumn-m);i[s]=h.substr(f.generatedColumn-m),m=f.generatedColumn,c(l,g),l=f;return}for(;a<f.generatedLine;)o.add(u()),a++;if(m<f.generatedColumn){var h=i[s]||"";o.add(h.substr(0,f.generatedColumn)),i[s]=h.substr(f.generatedColumn),m=f.generatedColumn}l=f},this),s<i.length&&(l&&c(l,u()),o.add(i.splice(s).join(""))),t.sources.forEach(function(f){var h=t.sourceContentFor(f);h!=null&&(n!=null&&(f=he.join(n,f)),o.setSourceContent(f,h))}),o;function c(f,h){if(f===null||f.source===void 0)o.add(h);else{var g=n?he.join(n,f.source):f.source;o.add(new E(f.originalLine,f.originalColumn,g,h,f.name))}}};E.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(t){this.add(t)},this);else if(e[Q]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};E.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else if(e[Q]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};E.prototype.walk=function(e){for(var t,n=0,o=this.children.length;n<o;n++)t=this.children[n],t[Q]?t.walk(e):t!==""&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})};E.prototype.join=function(e){var t,n,o=this.children.length;if(o>0){for(t=[],n=0;n<o-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this};E.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[Q]?n.replaceRight(e,t):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this};E.prototype.setSourceContent=function(e,t){this.sourceContents[he.toSetString(e)]=t};E.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][Q]&&this.children[t].walkSourceContents(e);for(var o=Object.keys(this.sourceContents),t=0,n=o.length;t<n;t++)e(he.fromSetString(o[t]),this.sourceContents[o[t]])};E.prototype.toString=function(){var e="";return this.walk(function(t){e+=t}),e};E.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new Oo(e),o=!1,i=null,s=null,u=null,a=null;return this.walk(function(m,l){t.code+=m,l.source!==null&&l.line!==null&&l.column!==null?((i!==l.source||s!==l.line||u!==l.column||a!==l.name)&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name}),i=l.source,s=l.line,u=l.column,a=l.name,o=!0):o&&(n.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var c=0,f=m.length;c<f;c++)m.charCodeAt(c)===ko?(t.line++,t.column=0,c+1===f?(i=null,o=!1):o&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:t.line,column:t.column},name:l.name})):t.column++}),this.walkSourceContents(function(m,l){n.setSourceContent(m,l)}),{code:t.code,map:n}};Kt.SourceNode=E});var Qt=_(ge=>{ge.SourceMapGenerator=Ne().SourceMapGenerator;ge.SourceMapConsumer=zt().SourceMapConsumer;ge.SourceNode=Jt().SourceNode});var Yt=_((Ra,Xt)=>{var Mo=Object.prototype.toString,Ve=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Lo(r){return Mo.call(r).slice(8,-1)==="ArrayBuffer"}function jo(r,e,t){e>>>=0;var n=r.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=n;else if(t>>>=0,t>n)throw new RangeError("'length' is out of bounds");return Ve?Buffer.from(r.slice(e,e+t)):new Buffer(new Uint8Array(r.slice(e,e+t)))}function To(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Ve?Buffer.from(r,e):new Buffer(r,e)}function No(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return Lo(r)?jo(r,e,t):typeof r=="string"?To(r,e):Ve?Buffer.from(r):new Buffer(r)}Xt.exports=No});var sr=_((H,He)=>{var Po=Qt().SourceMapConsumer,Fe=require("path"),N;try{N=require("fs"),(!N.existsSync||!N.readFileSync)&&(N=null)}catch{}var Io=Yt();function Zt(r,e){return r.require(e)}var er=!1,tr=!1,De=!1,se="auto",q={},ae={},$o=/^data:application\/json[^,]+base64,/,R=[],V=[];function Be(){return se==="browser"?!0:se==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function Ro(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}function Vo(){return typeof process=="object"&&process!==null?process.version:""}function Fo(){if(typeof process=="object"&&process!==null)return process.stderr}function Do(r){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(r)}function ve(r){return function(e){for(var t=0;t<r.length;t++){var n=r[t](e);if(n)return n}return null}}var Ue=ve(R);R.push(function(r){if(r=r.trim(),/^file:/.test(r)&&(r=r.replace(/file:\/\/\/(\w:)?/,function(n,o){return o?"":"/"})),r in q)return q[r];var e="";try{if(N)N.existsSync(r)&&(e=N.readFileSync(r,"utf8"));else{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),t.readyState===4&&t.status===200&&(e=t.responseText)}}catch{}return q[r]=e});function qe(r,e){if(!r)return e;var t=Fe.dirname(r),n=/^\w+:\/\/[^\/]*/.exec(t),o=n?n[0]:"",i=t.slice(o.length);return o&&/^\/\w\:/.test(i)?(o+="/",o+Fe.resolve(t.slice(o.length),e).replace(/\\/g,"/")):o+Fe.resolve(t.slice(o.length),e)}function qo(r){var e;if(Be())try{var t=new XMLHttpRequest;t.open("GET",r,!1),t.send(null),e=t.readyState===4?t.responseText:null;var n=t.getResponseHeader("SourceMap")||t.getResponseHeader("X-SourceMap");if(n)return n}catch{}e=Ue(r);for(var o=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg,i,s;s=o.exec(e);)i=s;return i?i[1]:null}var We=ve(V);V.push(function(r){var e=qo(r);if(!e)return null;var t;if($o.test(e)){var n=e.slice(e.indexOf(",")+1);t=Io(n,"base64").toString(),e=r}else e=qe(r,e),t=Ue(e);return t?{url:e,map:t}:null});function Ge(r){var e=ae[r.source];if(!e){var t=We(r.source);t?(e=ae[r.source]={url:t.url,map:new Po(t.map)},e.map.sourcesContent&&e.map.sources.forEach(function(o,i){var s=e.map.sourcesContent[i];if(s){var u=qe(e.url,o);q[u]=s}})):e=ae[r.source]={url:null,map:null}}if(e&&e.map&&typeof e.map.originalPositionFor=="function"){var n=e.map.originalPositionFor(r);if(n.source!==null)return n.source=qe(e.url,n.source),n}return r}function nr(r){var e=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(r);if(e){var t=Ge({source:e[2],line:+e[3],column:e[4]-1});return"eval at "+e[1]+" ("+t.source+":"+t.line+":"+(t.column+1)+")"}return e=/^eval at ([^(]+) \((.+)\)$/.exec(r),e?"eval at "+e[1]+" ("+nr(e[2])+")":r}function Ho(){var r,e="";if(this.isNative())e="native";else{r=this.getScriptNameOrSourceURL(),!r&&this.isEval()&&(e=this.getEvalOrigin(),e+=", "),r?e+=r:e+="<anonymous>";var t=this.getLineNumber();if(t!=null){e+=":"+t;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",i=this.getFunctionName(),s=!0,u=this.isConstructor(),a=!(this.isToplevel()||u);if(a){var m=this.getTypeName();m==="[object Object]"&&(m="null");var l=this.getMethodName();i?(m&&i.indexOf(m)!=0&&(o+=m+"."),o+=i,l&&i.indexOf("."+l)!=i.length-l.length-1&&(o+=" [as "+l+"]")):o+=m+"."+(l||"<anonymous>")}else u?o+="new "+(i||"<anonymous>"):i?o+=i:(o+=e,s=!1);return s&&(o+=" ("+e+")"),o}function rr(r){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(function(t){e[t]=/^(?:is|get)/.test(t)?function(){return r[t].call(r)}:r[t]}),e.toString=Ho,e}function or(r,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),r.isNative())return e.curPosition=null,r;var t=r.getFileName()||r.getScriptNameOrSourceURL();if(t){var n=r.getLineNumber(),o=r.getColumnNumber()-1,i=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,s=i.test(Vo())?0:62;n===1&&o>s&&!Be()&&!r.isEval()&&(o-=s);var u=Ge({source:t,line:n,column:o});e.curPosition=u,r=rr(r);var a=r.getFunctionName;return r.getFunctionName=function(){return e.nextPosition==null?a():e.nextPosition.name||a()},r.getFileName=function(){return u.source},r.getLineNumber=function(){return u.line},r.getColumnNumber=function(){return u.column+1},r.getScriptNameOrSourceURL=function(){return u.source},r}var m=r.isEval()&&r.getEvalOrigin();return m&&(m=nr(m),r=rr(r),r.getEvalOrigin=function(){return m}),r}function Bo(r,e){De&&(q={},ae={});for(var t=r.name||"Error",n=r.message||"",o=t+": "+n,i={nextPosition:null,curPosition:null},s=[],u=e.length-1;u>=0;u--)s.push(`
3
+ at `+or(e[u],i)),i.nextPosition=i.curPosition;return i.curPosition=i.nextPosition=null,o+s.reverse().join("")}function ir(r){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(r.stack);if(e){var t=e[1],n=+e[2],o=+e[3],i=q[t];if(!i&&N&&N.existsSync(t))try{i=N.readFileSync(t,"utf8")}catch{i=""}if(i){var s=i.split(/(?:\r\n|\r|\n)/)[n-1];if(s)return t+":"+n+`
4
+ `+s+`
5
+ `+new Array(o).join(" ")+"^"}}return null}function Uo(r){var e=ir(r),t=Fo();t&&t._handle&&t._handle.setBlocking&&t._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(r.stack),Do(1)}function Wo(){var r=process.emit;process.emit=function(e){if(e==="uncaughtException"){var t=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(t&&!n)return Uo(arguments[1])}return r.apply(this,arguments)}}var Go=R.slice(0),zo=V.slice(0);H.wrapCallSite=or;H.getErrorSource=ir;H.mapSourcePosition=Ge;H.retrieveSourceMap=We;H.install=function(r){if(r=r||{},r.environment&&(se=r.environment,["node","browser","auto"].indexOf(se)===-1))throw new Error("environment "+se+" was unknown. Available options are {auto, browser, node}");if(r.retrieveFile&&(r.overrideRetrieveFile&&(R.length=0),R.unshift(r.retrieveFile)),r.retrieveSourceMap&&(r.overrideRetrieveSourceMap&&(V.length=0),V.unshift(r.retrieveSourceMap)),r.hookRequire&&!Be()){var e=Zt(He,"module"),t=e.prototype._compile;t.__sourceMapSupport||(e.prototype._compile=function(i,s){return q[s]=i,ae[s]=void 0,t.call(this,i,s)},e.prototype._compile.__sourceMapSupport=!0)}if(De||(De="emptyCacheBetweenOperations"in r?r.emptyCacheBetweenOperations:!1),er||(er=!0,Error.prepareStackTrace=Bo),!tr){var n="handleUncaughtExceptions"in r?r.handleUncaughtExceptions:!0;try{var o=Zt(He,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&Ro()&&(tr=!0,Wo())}};H.resetRetrieveHandlers=function(){R.length=0,V.length=0,R=Go.slice(0),V=zo.slice(0),We=ve(V),Ue=ve(R)}});var me=_(Ke=>{var _e=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},ze=class extends _e{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Ke.CommanderError=_e;Ke.InvalidArgumentError=ze});var xe=_(Qe=>{var{InvalidArgumentError:Ko}=me(),Je=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Ko(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Jo(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}Qe.Argument=Je;Qe.humanReadableArgName=Jo});var Ye=_(ar=>{var{humanReadableArgName:Qo}=xe(),Xe=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(o=>!o._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((o,i)=>o.name().localeCompare(i.name())),t}compareOptions(e,t){let n=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(o=>!o.hidden),n=e._getHelpOption();if(n&&!n.hidden){let o=n.short&&e._findOption(n.short),i=n.long&&e._findOption(n.long);!o&&!i?t.push(n):n.long&&!i?t.push(e.createOption(n.long,n.description)):n.short&&!o&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let o=n.options.filter(i=>!i.hidden);t.push(...o)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>Qo(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,o)=>Math.max(n,t.subcommandTerm(o).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,o)=>Math.max(n,t.optionTerm(o).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,o)=>Math.max(n,t.optionTerm(o).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,o)=>Math.max(n,t.argumentTerm(o).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let o=e.parent;o;o=o.parent)n=o.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){let n=t.padWidth(e,t),o=t.helpWidth||80,i=2,s=2;function u(g,x){if(x){let T=`${g.padEnd(n+s)}${x}`;return t.wrap(T,o-i,n+s)}return g}function a(g){return g.join(`
6
+ `).replace(/^/gm," ".repeat(i))}let m=[`Usage: ${t.commandUsage(e)}`,""],l=t.commandDescription(e);l.length>0&&(m=m.concat([t.wrap(l,o,0),""]));let c=t.visibleArguments(e).map(g=>u(t.argumentTerm(g),t.argumentDescription(g)));c.length>0&&(m=m.concat(["Arguments:",a(c),""]));let f=t.visibleOptions(e).map(g=>u(t.optionTerm(g),t.optionDescription(g)));if(f.length>0&&(m=m.concat(["Options:",a(f),""])),this.showGlobalOptions){let g=t.visibleGlobalOptions(e).map(x=>u(t.optionTerm(x),t.optionDescription(x)));g.length>0&&(m=m.concat(["Global Options:",a(g),""]))}let h=t.visibleCommands(e).map(g=>u(t.subcommandTerm(g),t.subcommandDescription(g)));return h.length>0&&(m=m.concat(["Commands:",a(h),""])),m.join(`
7
+ `)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,o=40){let i=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${i}]+`);if(e.match(s))return e;let u=t-n;if(u<o)return e;let a=e.slice(0,n),m=e.slice(n).replace(`\r
8
8
  `,`
9
- `),u=" ".repeat(n),c="\\s\u200B",d=new RegExp(`
10
- |.{1,${l-1}}([${c}]|$)|[^${c}]+?([${c}]|$)`,"g"),g=m.match(d)||[];return a+g.map((y,L)=>y===`
11
- `?"":(L>0?u:"")+y.trimEnd()).join(`
12
- `)}};Jt.Help=Fe});var ze=v(We=>{var{InvalidArgumentError:ni}=ie(),Ue=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=si(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new ni(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return ii(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Be=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,s=i!==void 0?i:!1;return t.negate===(s===e)}};function ii(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function si(r){let e,t,n=r.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),t=n.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}We.Option=Ue;We.DualOptions=Be});var Qt=v(Kt=>{function oi(r,e){if(Math.abs(r.length-e.length)>3)return Math.max(r.length,e.length);let t=[];for(let n=0;n<=r.length;n++)t[n]=[n];for(let n=0;n<=e.length;n++)t[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=r.length;i++){let s=1;r[i-1]===e[n-1]?s=0:s=1,t[i][n]=Math.min(t[i-1][n]+1,t[i][n-1]+1,t[i-1][n-1]+s),i>1&&n>1&&r[i-1]===e[n-2]&&r[i-2]===e[n-1]&&(t[i][n]=Math.min(t[i][n],t[i-2][n-2]+1))}return t[r.length][e.length]}function ai(r,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=r.startsWith("--");t&&(r=r.slice(2),e=e.map(o=>o.slice(2)));let n=[],i=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let l=oi(r,o),a=Math.max(r.length,o.length);(a-l)/a>s&&(l<i?(i=l,n=[o]):l===i&&n.push(o))}),n.sort((o,l)=>o.localeCompare(l)),t&&(n=n.map(o=>`--${o}`)),n.length>1?`
9
+ `),l=" ".repeat(n),f="\\s\u200B",h=new RegExp(`
10
+ |.{1,${u-1}}([${f}]|$)|[^${f}]+?([${f}]|$)`,"g"),g=m.match(h)||[];return a+g.map((x,T)=>x===`
11
+ `?"":(T>0?l:"")+x.trimEnd()).join(`
12
+ `)}};ar.Help=Xe});var rt=_(tt=>{var{InvalidArgumentError:Xo}=me(),Ze=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Zo(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new Xo(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return Yo(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},et=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,t){let n=t.attributeName();if(!this.dualOptions.has(n))return!0;let o=this.negativeOptions.get(n).presetArg,i=o!==void 0?o:!1;return t.negate===(i===e)}};function Yo(r){return r.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function Zo(r){let e,t,n=r.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),t=n.shift(),!e&&/^-[^-]$/.test(t)&&(e=t,t=void 0),{shortFlag:e,longFlag:t}}tt.Option=Ze;tt.DualOptions=et});var ur=_(mr=>{function ei(r,e){if(Math.abs(r.length-e.length)>3)return Math.max(r.length,e.length);let t=[];for(let n=0;n<=r.length;n++)t[n]=[n];for(let n=0;n<=e.length;n++)t[0][n]=n;for(let n=1;n<=e.length;n++)for(let o=1;o<=r.length;o++){let i=1;r[o-1]===e[n-1]?i=0:i=1,t[o][n]=Math.min(t[o-1][n]+1,t[o][n-1]+1,t[o-1][n-1]+i),o>1&&n>1&&r[o-1]===e[n-2]&&r[o-2]===e[n-1]&&(t[o][n]=Math.min(t[o][n],t[o-2][n-2]+1))}return t[r.length][e.length]}function ti(r,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=r.startsWith("--");t&&(r=r.slice(2),e=e.map(s=>s.slice(2)));let n=[],o=3,i=.4;return e.forEach(s=>{if(s.length<=1)return;let u=ei(r,s),a=Math.max(r.length,s.length);(a-u)/a>i&&(u<o?(o=u,n=[s]):u===o&&n.push(s))}),n.sort((s,u)=>s.localeCompare(u)),t&&(n=n.map(s=>`--${s}`)),n.length>1?`
13
13
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
14
- (Did you mean ${n[0]}?)`:""}Kt.suggestSimilar=ai});var tr=v(er=>{var mi=require("events").EventEmitter,Je=require("child_process"),P=require("path"),Ke=require("fs"),C=require("process"),{Argument:li,humanReadableArgName:ui}=fe(),{CommanderError:Qe}=ie(),{Help:ci}=Ge(),{Option:Xt,DualOptions:hi}=ze(),{suggestSimilar:Yt}=Qt(),Xe=class r extends mi{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>C.stdout.write(t),writeErr:t=>C.stderr.write(t),getOutHelpWidth:()=>C.stdout.isTTY?C.stdout.columns:void 0,getErrHelpWidth:()=>C.stderr.isTTY?C.stderr.columns:void 0,outputError:(t,n)=>n(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let i=t,s=n;typeof i=="object"&&i!==null&&(s=i,i=null),s=s||{};let[,o,l]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(o);return i&&(a.description(i),a._executableHandler=!0),s.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(s.noHelp||s.hidden),a._executableFile=s.executableFile||null,l&&a.arguments(l),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),i?this:a}createCommand(e){return new r(e)}createHelp(){return Object.assign(new ci,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new li(e,t)}argument(e,t,n,i){let s=this.createArgument(e,t);return typeof n=="function"?s.default(i).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),s=t??"display help for command",o=this.createCommand(n);return o.helpOption(!1),i&&o.arguments(i),s&&o.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
16
- Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new Qe(e,t,n)),C.exit(e)}action(e){let t=n=>{let i=this.registeredArguments.length,s=n.slice(0,i);return this._storeOptionsAsProperties?s[i]=this:s[i]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=t,this}createOption(e,t){return new Xt(e,t)}_callParseArg(e,t,n,i){try{return e.parseArg(t,n)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${i} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
17
- - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=i=>[i.name()].concat(i.aliases()),n=t(e).find(i=>this._findCommand(i));if(n){let i=t(this._findCommand(n)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(s,o,l)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let a=this.getOptionValue(n);s!==null&&e.parseArg?s=this._callParseArg(e,s,a,o):s!==null&&e.variadic&&(s=e._concatValue(s,a)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,l)};return this.on("option:"+t,s=>{let o=`error: option '${e.flags}' argument '${s}' is invalid.`;i(s,o,"cli")}),e.envVar&&this.on("optionEnv:"+t,s=>{let o=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;i(s,o,"env")}),this}_optionEx(e,t,n,i,s){if(typeof t=="object"&&t instanceof Xt)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(t,n);if(o.makeOptionMandatory(!!e.mandatory),typeof i=="function")o.default(s).argParser(i);else if(i instanceof RegExp){let l=i;i=(a,m)=>{let u=l.exec(a);return u?u[0]:m},o.default(s).argParser(i)}else o.default(i);return this.addOption(o)}option(e,t,n,i){return this._optionEx({},e,t,n,i)}requiredOption(e,t,n,i){return this._optionEx({mandatory:!0},e,t,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");t=t||{},e===void 0&&(e=C.argv,C.versions&&C.versions.electron&&(t.from="electron")),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":C.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function s(u,h){let c=P.resolve(u,h);if(Ke.existsSync(c))return c;if(i.includes(P.extname(h)))return;let d=i.find(g=>Ke.existsSync(`${c}${g}`));if(d)return`${c}${d}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,l=this._executableDir||"";if(this._scriptPath){let u;try{u=Ke.realpathSync(this._scriptPath)}catch{u=this._scriptPath}l=P.resolve(P.dirname(u),l)}if(l){let u=s(l,o);if(!u&&!e._executableFile&&this._scriptPath){let h=P.basename(this._scriptPath,P.extname(this._scriptPath));h!==this._name&&(u=s(l,`${h}-${e._name}`))}o=u||o}n=i.includes(P.extname(o));let a;C.platform!=="win32"?n?(t.unshift(o),t=Zt(C.execArgv).concat(t),a=Je.spawn(C.argv[0],t,{stdio:"inherit"})):a=Je.spawn(o,t,{stdio:"inherit"}):(t.unshift(o),t=Zt(C.execArgv).concat(t),a=Je.spawn(C.execPath,t,{stdio:"inherit"})),a.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(h=>{C.on(h,()=>{a.killed===!1&&a.exitCode===null&&a.kill(h)})});let m=this._exitCallback;a.on("close",(u,h)=>{u=u??1,m?m(new Qe(u,"commander.executeSubCommandAsync","(close)")):C.exit(u)}),a.on("error",u=>{if(u.code==="ENOENT"){let h=l?`searched for local subcommand relative to directory '${l}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",c=`'${o}' does not exist
14
+ (Did you mean ${n[0]}?)`:""}mr.suggestSimilar=ti});var dr=_(pr=>{var ri=require("events").EventEmitter,nt=require("child_process"),I=require("path"),ot=require("fs"),w=require("process"),{Argument:ni,humanReadableArgName:oi}=xe(),{CommanderError:it}=me(),{Help:ii}=Ye(),{Option:lr,DualOptions:si}=rt(),{suggestSimilar:fr}=ur(),st=class r extends ri{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:t=>w.stdout.write(t),writeErr:t=>w.stderr.write(t),getOutHelpWidth:()=>w.stdout.isTTY?w.stdout.columns:void 0,getErrHelpWidth:()=>w.stderr.isTTY?w.stderr.columns:void 0,outputError:(t,n)=>n(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let o=t,i=n;typeof o=="object"&&o!==null&&(i=o,o=null),i=i||{};let[,s,u]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(s);return o&&(a.description(o),a._executableHandler=!0),i.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(i.noHelp||i.hidden),a._executableFile=i.executableFile||null,u&&a.arguments(u),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),o?this:a}createCommand(e){return new r(e)}createHelp(){return Object.assign(new ii,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new ni(e,t)}argument(e,t,n,o){let i=this.createArgument(e,t);return typeof n=="function"?i.default(o).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,o]=e.match(/([^ ]+) *(.*)/),i=t??"display help for command",s=this.createCommand(n);return s.helpOption(!1),o&&s.arguments(o),i&&s.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
16
+ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync")throw t},this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new it(e,t,n)),w.exit(e)}action(e){let t=n=>{let o=this.registeredArguments.length,i=n.slice(0,o);return this._storeOptionsAsProperties?i[o]=this:i[o]=this.opts(),i.push(this),e.apply(this,i)};return this._actionHandler=t,this}createOption(e,t){return new lr(e,t)}_callParseArg(e,t,n,o){try{return e.parseArg(t,n)}catch(i){if(i.code==="commander.invalidArgument"){let s=`${o} ${i.message}`;this.error(s,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
17
+ - already used by option '${t.flags}'`)}this.options.push(e)}_registerCommand(e){let t=o=>[o.name()].concat(o.aliases()),n=t(e).find(o=>this._findCommand(o));if(n){let o=t(this._findCommand(n)).join("|"),i=t(e).join("|");throw new Error(`cannot add command '${i}' as already have command '${o}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),n=e.attributeName();if(e.negate){let i=e.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let o=(i,s,u)=>{i==null&&e.presetArg!==void 0&&(i=e.presetArg);let a=this.getOptionValue(n);i!==null&&e.parseArg?i=this._callParseArg(e,i,a,s):i!==null&&e.variadic&&(i=e._concatValue(i,a)),i==null&&(e.negate?i=!1:e.isBoolean()||e.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,u)};return this.on("option:"+t,i=>{let s=`error: option '${e.flags}' argument '${i}' is invalid.`;o(i,s,"cli")}),e.envVar&&this.on("optionEnv:"+t,i=>{let s=`error: option '${e.flags}' value '${i}' from env '${e.envVar}' is invalid.`;o(i,s,"env")}),this}_optionEx(e,t,n,o,i){if(typeof t=="object"&&t instanceof lr)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(t,n);if(s.makeOptionMandatory(!!e.mandatory),typeof o=="function")s.default(i).argParser(o);else if(o instanceof RegExp){let u=o;o=(a,m)=>{let l=u.exec(a);return l?l[0]:m},s.default(i).argParser(o)}else s.default(o);return this.addOption(s)}option(e,t,n,o){return this._optionEx({},e,t,n,o)}requiredOption(e,t,n,o){return this._optionEx({mandatory:!0},e,t,n,o)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");t=t||{},e===void 0&&(e=w.argv,w.versions&&w.versions.electron&&(t.from="electron")),this.rawArgs=e.slice();let n;switch(t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":w.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){let n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){let n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,c){let f=I.resolve(l,c);if(ot.existsSync(f))return f;if(o.includes(I.extname(c)))return;let h=o.find(g=>ot.existsSync(`${f}${g}`));if(h)return`${f}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,u=this._executableDir||"";if(this._scriptPath){let l;try{l=ot.realpathSync(this._scriptPath)}catch{l=this._scriptPath}u=I.resolve(I.dirname(l),u)}if(u){let l=i(u,s);if(!l&&!e._executableFile&&this._scriptPath){let c=I.basename(this._scriptPath,I.extname(this._scriptPath));c!==this._name&&(l=i(u,`${c}-${e._name}`))}s=l||s}n=o.includes(I.extname(s));let a;w.platform!=="win32"?n?(t.unshift(s),t=cr(w.execArgv).concat(t),a=nt.spawn(w.argv[0],t,{stdio:"inherit"})):a=nt.spawn(s,t,{stdio:"inherit"}):(t.unshift(s),t=cr(w.execArgv).concat(t),a=nt.spawn(w.execPath,t,{stdio:"inherit"})),a.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{w.on(c,()=>{a.killed===!1&&a.exitCode===null&&a.kill(c)})});let m=this._exitCallback;a.on("close",(l,c)=>{l=l??1,m?m(new it(l,"commander.executeSubCommandAsync","(close)")):w.exit(l)}),a.on("error",l=>{if(l.code==="ENOENT"){let c=u?`searched for local subcommand relative to directory '${u}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",f=`'${s}' does not exist
18
18
  - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
19
19
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
20
- - ${h}`;throw new Error(c)}else if(u.code==="EACCES")throw new Error(`'${o}' not executable`);if(!m)C.exit(1);else{let h=new Qe(1,"commander.executeSubCommandAsync","(error)");h.nestedError=u,m(h)}}),this.runningCommand=a}_dispatchSubcommand(e,t,n){let i=this._findCommand(e);i||this.help({error:!0});let s;return s=this._chainOrCallSubCommandHook(s,i,"preSubcommand"),s=this._chainOrCall(s,()=>{if(i._executableHandler)this._executeSubCommand(i,t.concat(n));else return i._parseCommand(t,n)}),s}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,s)=>{let o=i;if(i!==null&&n.parseArg){let l=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,i,s,l)}return o};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,i)=>{let s=n.defaultValue;n.variadic?i<this.args.length?(s=this.args.slice(i),n.parseArg&&(s=s.reduce((o,l)=>e(n,l,o),n.defaultValue))):s===void 0&&(s=[]):i<this.args.length&&(s=this.args[i],n.parseArg&&(s=e(n,s,n.defaultValue))),t[i]=s}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[t]!==void 0).forEach(s=>{s._lifeCycleHooks[t].forEach(o=>{i.push({hookedCommand:s,callback:o})})}),t==="postAction"&&i.reverse(),i.forEach(s=>{n=this._chainOrCall(n,()=>s.callback(s.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(s=>{i=this._chainOrCall(i,()=>s(this,t))}),i}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,e,t)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(s))i(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(s=>n.conflictsWith.includes(s.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],i=t,s=e.slice();function o(a){return a.length>1&&a[0]==="-"}let l=null;for(;s.length;){let a=s.shift();if(a==="--"){i===n&&i.push(a),i.push(...s);break}if(l&&!o(a)){this.emit(`option:${l.name()}`,a);continue}if(l=null,o(a)){let m=this._findOption(a);if(m){if(m.required){let u=s.shift();u===void 0&&this.optionMissingArgument(m),this.emit(`option:${m.name()}`,u)}else if(m.optional){let u=null;s.length>0&&!o(s[0])&&(u=s.shift()),this.emit(`option:${m.name()}`,u)}else this.emit(`option:${m.name()}`);l=m.variadic?m:null;continue}}if(a.length>2&&a[0]==="-"&&a[1]!=="-"){let m=this._findOption(`-${a[1]}`);if(m){m.required||m.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${m.name()}`,a.slice(2)):(this.emit(`option:${m.name()}`),s.unshift(`-${a.slice(2)}`));continue}}if(/^--[^=]+=/.test(a)){let m=a.indexOf("="),u=this._findOption(a.slice(0,m));if(u&&(u.required||u.optional)){this.emit(`option:${u.name()}`,a.slice(m+1));continue}}if(o(a)&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(a)){t.push(a),s.length>0&&n.push(...s);break}else if(this._getHelpCommand()&&a===this._getHelpCommand().name()){t.push(a),s.length>0&&t.push(...s);break}else if(this._defaultCommandName){n.push(a),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){i.push(a),s.length>0&&i.push(...s);break}i.push(a)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let i=this.options[n].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
20
+ - ${c}`;throw new Error(f)}else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!m)w.exit(1);else{let c=new it(1,"commander.executeSubCommandAsync","(error)");c.nestedError=l,m(c)}}),this.runningCommand=a}_dispatchSubcommand(e,t,n){let o=this._findCommand(e);o||this.help({error:!0});let i;return i=this._chainOrCallSubCommandHook(i,o,"preSubcommand"),i=this._chainOrCall(i,()=>{if(o._executableHandler)this._executeSubCommand(o,t.concat(n));else return o._parseCommand(t,n)}),i}_dispatchHelpCommand(e){e||this.help();let t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&this.args[t]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,o,i)=>{let s=o;if(o!==null&&n.parseArg){let u=`error: command-argument value '${o}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,o,i,u)}return s};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((n,o)=>{let i=n.defaultValue;n.variadic?o<this.args.length?(i=this.args.slice(o),n.parseArg&&(i=i.reduce((s,u)=>e(n,u,s),n.defaultValue))):i===void 0&&(i=[]):o<this.args.length&&(i=this.args[o],n.parseArg&&(i=e(n,i,n.defaultValue))),t[o]=i}),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&typeof e.then=="function"?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e,o=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[t]!==void 0).forEach(i=>{i._lifeCycleHooks[t].forEach(s=>{o.push({hookedCommand:i,callback:s})})}),t==="postAction"&&o.reverse(),o.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let o=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{o=this._chainOrCall(o,()=>i(this,t))}),o}_parseCommand(e,t){let n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){o(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(i,e,t)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(i))o(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(o(),this._processArguments())}else this.commands.length?(o(),this.help({error:!0})):(o(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&e.getOptionValue(t.attributeName())===void 0&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let o=n.attributeName();return this.getOptionValue(o)===void 0?!1:this.getOptionValueSource(o)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let o=e.find(i=>n.conflictsWith.includes(i.attributeName()));o&&this._conflictingOption(n,o)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],n=[],o=t,i=e.slice();function s(a){return a.length>1&&a[0]==="-"}let u=null;for(;i.length;){let a=i.shift();if(a==="--"){o===n&&o.push(a),o.push(...i);break}if(u&&!s(a)){this.emit(`option:${u.name()}`,a);continue}if(u=null,s(a)){let m=this._findOption(a);if(m){if(m.required){let l=i.shift();l===void 0&&this.optionMissingArgument(m),this.emit(`option:${m.name()}`,l)}else if(m.optional){let l=null;i.length>0&&!s(i[0])&&(l=i.shift()),this.emit(`option:${m.name()}`,l)}else this.emit(`option:${m.name()}`);u=m.variadic?m:null;continue}}if(a.length>2&&a[0]==="-"&&a[1]!=="-"){let m=this._findOption(`-${a[1]}`);if(m){m.required||m.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${m.name()}`,a.slice(2)):(this.emit(`option:${m.name()}`),i.unshift(`-${a.slice(2)}`));continue}}if(/^--[^=]+=/.test(a)){let m=a.indexOf("="),l=this._findOption(a.slice(0,m));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,a.slice(m+1));continue}}if(s(a)&&(o=n),(this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&n.length===0){if(this._findCommand(a)){t.push(a),i.length>0&&n.push(...i);break}else if(this._getHelpCommand()&&a===this._getHelpCommand().name()){t.push(a),i.length>0&&t.push(...i);break}else if(this._defaultCommandName){n.push(a),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){o.push(a),i.length>0&&o.push(...i);break}o.push(a)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let n=0;n<t;n++){let o=this.options[n].attributeName();e[o]=o===this._versionOptionName?this._version:this[o]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}
21
21
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
22
22
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
23
- `),this.outputHelp({error:!0}));let n=t||{},i=n.exitCode||1,s=n.code||"commander.error";this._exit(i,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in C.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,C.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new hi(this.options),t=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let n=o=>{let l=o.attributeName(),a=this.getOptionValue(l),m=this.options.find(h=>h.negate&&l===h.attributeName()),u=this.options.find(h=>!h.negate&&l===h.attributeName());return m&&(m.presetArg===void 0&&a===!1||m.presetArg!==void 0&&a===m.presetArg)?m:u||o},i=o=>{let l=n(o),a=l.attributeName();return this.getOptionValueSource(a)==="env"?`environment variable '${l.envVar}'`:`option '${l.flags}'`},s=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(l=>l.long).map(l=>l.long);i=i.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);t=Yt(e,i)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),t=Yt(e,i)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";let i=this.createOption(t,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
24
- `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(n=>ui(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=P.basename(e,P.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};let t={error:!!e.error},n;return t.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(t&&(i=t(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",n))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=C.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
25
- Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let o;typeof t=="function"?o=t({error:s.error,command:s.command}):o=t,o&&s.write(`${o}
26
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Zt(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?i=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],n=s[3],i=s[4]),t&&i!=="0"?`${t}=${n}:${parseInt(i)+1}`:e})}er.Command=Xe});var sr=v(k=>{var{Argument:rr}=fe(),{Command:Ye}=tr(),{CommanderError:fi,InvalidArgumentError:nr}=ie(),{Help:pi}=Ge(),{Option:ir}=ze();k.program=new Ye;k.createCommand=r=>new Ye(r);k.createOption=(r,e)=>new ir(r,e);k.createArgument=(r,e)=>new rr(r,e);k.Command=Ye;k.Option=ir;k.Argument=rr;k.Help=pi;k.CommanderError=fi;k.InvalidArgumentError=nr;k.InvalidOptionArgumentError=nr});var hr=v((Ns,cr)=>{cr.exports=ur;ur.sync=gi;var mr=require("fs");function di(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var n=0;n<t.length;n++){var i=t[n].toLowerCase();if(i&&r.substr(-i.length).toLowerCase()===i)return!0}return!1}function lr(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:di(e,t)}function ur(r,e,t){mr.stat(r,function(n,i){t(n,n?!1:lr(i,r,e))})}function gi(r,e){return lr(mr.statSync(r),r,e)}});var _r=v(($s,gr)=>{gr.exports=pr;pr.sync=_i;var fr=require("fs");function pr(r,e,t){fr.stat(r,function(n,i){t(n,n?!1:dr(i,e))})}function _i(r,e){return dr(fr.statSync(r),e)}function dr(r,e){return r.isFile()&&vi(r,e)}function vi(r,e){var t=r.mode,n=r.uid,i=r.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),l=parseInt("100",8),a=parseInt("010",8),m=parseInt("001",8),u=l|a,h=t&m||t&a&&i===o||t&l&&n===s||t&u&&s===0;return h}});var yr=v((Is,vr)=>{var Ps=require("fs"),pe;process.platform==="win32"||global.TESTING_WINDOWS?pe=hr():pe=_r();vr.exports=Ze;Ze.sync=yi;function Ze(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){Ze(r,e||{},function(s,o){s?i(s):n(o)})})}pe(r,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),t(n,i)})}function yi(r,e){try{return pe.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Or=v((Rs,Er)=>{var Q=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",wr=require("path"),wi=Q?";":":",Cr=yr(),Sr=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),br=(r,e)=>{let t=e.colon||wi,n=r.match(/\//)||Q&&r.match(/\\/)?[""]:[...Q?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],i=Q?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Q?i.split(t):[""];return Q&&r.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:i}},Ar=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:s}=br(r,e),o=[],l=m=>new Promise((u,h)=>{if(m===n.length)return e.all&&o.length?u(o):h(Sr(r));let c=n[m],d=/^".*"$/.test(c)?c.slice(1,-1):c,g=wr.join(d,r),y=!d&&/^\.[\\\/]/.test(r)?r.slice(0,2)+g:g;u(a(y,m,0))}),a=(m,u,h)=>new Promise((c,d)=>{if(h===i.length)return c(l(u+1));let g=i[h];Cr(m+g,{pathExt:s},(y,L)=>{if(!y&&L)if(e.all)o.push(m+g);else return c(m+g);return c(a(m,u,h+1))})});return t?l(0).then(m=>t(null,m),t):l(0)},Ci=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:n,pathExtExe:i}=br(r,e),s=[];for(let o=0;o<t.length;o++){let l=t[o],a=/^".*"$/.test(l)?l.slice(1,-1):l,m=wr.join(a,r),u=!a&&/^\.[\\\/]/.test(r)?r.slice(0,2)+m:m;for(let h=0;h<n.length;h++){let c=u+n[h];try{if(Cr.sync(c,{pathExt:i}))if(e.all)s.push(c);else return c}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw Sr(r)};Er.exports=Ar;Ar.sync=Ci});var kr=v((Vs,et)=>{"use strict";var xr=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};et.exports=xr;et.exports.default=xr});var $r=v((Ts,Nr)=>{"use strict";var Mr=require("path"),Si=Or(),bi=kr();function Lr(r,e){let t=r.options.env||process.env,n=process.cwd(),i=r.options.cwd!=null,s=i&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(r.options.cwd)}catch{}let o;try{o=Si.sync(r.command,{path:t[bi({env:t})],pathExt:e?Mr.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return o&&(o=Mr.resolve(i?r.options.cwd:"",o)),o}function Ai(r){return Lr(r)||Lr(r,!0)}Nr.exports=Ai});var Pr=v((js,rt)=>{"use strict";var tt=/([()\][%!^"`<>&|;, *?])/g;function Ei(r){return r=r.replace(tt,"^$1"),r}function Oi(r,e){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(tt,"^$1"),e&&(r=r.replace(tt,"^$1")),r}rt.exports.command=Ei;rt.exports.argument=Oi});var Rr=v((Ds,Ir)=>{"use strict";Ir.exports=/^#!(.*)/});var Tr=v((qs,Vr)=>{"use strict";var xi=Rr();Vr.exports=(r="")=>{let e=r.match(xi);if(!e)return null;let[t,n]=e[0].replace(/#! ?/,"").split(" "),i=t.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var Dr=v((Hs,jr)=>{"use strict";var nt=require("fs"),ki=Tr();function Mi(r){let t=Buffer.alloc(150),n;try{n=nt.openSync(r,"r"),nt.readSync(n,t,0,150,0),nt.closeSync(n)}catch{}return ki(t.toString())}jr.exports=Mi});var Gr=v((Fs,Fr)=>{"use strict";var Li=require("path"),qr=$r(),Hr=Pr(),Ni=Dr(),$i=process.platform==="win32",Pi=/\.(?:com|exe)$/i,Ii=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Ri(r){r.file=qr(r);let e=r.file&&Ni(r.file);return e?(r.args.unshift(r.file),r.command=e,qr(r)):r.file}function Vi(r){if(!$i)return r;let e=Ri(r),t=!Pi.test(e);if(r.options.forceShell||t){let n=Ii.test(e);r.command=Li.normalize(r.command),r.command=Hr.command(r.command),r.args=r.args.map(s=>Hr.argument(s,n));let i=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${i}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function Ti(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let n={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?n:Vi(n)}Fr.exports=Ti});var Wr=v((Gs,Br)=>{"use strict";var it=process.platform==="win32";function st(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function ji(r,e){if(!it)return;let t=r.emit;r.emit=function(n,i){if(n==="exit"){let s=Ur(i,e,"spawn");if(s)return t.call(r,"error",s)}return t.apply(r,arguments)}}function Ur(r,e){return it&&r===1&&!e.file?st(e.original,"spawn"):null}function Di(r,e){return it&&r===1&&!e.file?st(e.original,"spawnSync"):null}Br.exports={hookChildProcess:ji,verifyENOENT:Ur,verifyENOENTSync:Di,notFoundError:st}});var Kr=v((Us,X)=>{"use strict";var zr=require("child_process"),ot=Gr(),at=Wr();function Jr(r,e,t){let n=ot(r,e,t),i=zr.spawn(n.command,n.args,n.options);return at.hookChildProcess(i,n),i}function qi(r,e,t){let n=ot(r,e,t),i=zr.spawnSync(n.command,n.args,n.options);return i.error=i.error||at.verifyENOENTSync(i.status,n),i}X.exports=Jr;X.exports.spawn=Jr;X.exports.sync=qi;X.exports._parse=ot;X.exports._enoent=at});zt().install();var or=U(sr(),1),{program:Cs,createCommand:Ss,createArgument:bs,createOption:As,CommanderError:Es,InvalidArgumentError:Os,InvalidOptionArgumentError:xs,Command:ar,Argument:ks,Option:H,Help:Ms}=or.default;var F=U(Kr()),_=U(require("fs")),mn=U(require("os")),p=U(require("path"));var Hi=/[\p{Lu}]/u,Fi=/[\p{Ll}]/u,Qr=/^[\p{Lu}](?![\p{Lu}])/gu,Zr=/([\p{Alpha}\p{N}_]|$)/u,mt=/[_.\- ]+/,Gi=new RegExp("^"+mt.source),Xr=new RegExp(mt.source+Zr.source,"gu"),Yr=new RegExp("\\d+"+Zr.source,"gu"),Ui=(r,e,t,n)=>{let i=!1,s=!1,o=!1,l=!1;for(let a=0;a<r.length;a++){let m=r[a];l=a>2?r[a-3]==="-":!0,i&&Hi.test(m)?(r=r.slice(0,a)+"-"+r.slice(a),i=!1,o=s,s=!0,a++):s&&o&&Fi.test(m)&&(!l||n)?(r=r.slice(0,a-1)+"-"+r.slice(a-1),o=s,s=!1,i=!0):(i=e(m)===m&&t(m)!==m,o=s,s=t(m)===m&&e(m)!==m)}return r},Bi=(r,e)=>(Qr.lastIndex=0,r.replaceAll(Qr,t=>e(t))),Wi=(r,e)=>(Xr.lastIndex=0,Yr.lastIndex=0,r.replaceAll(Yr,(t,n,i)=>["_","-"].includes(r.charAt(i+t.length))?t:e(t)).replaceAll(Xr,(t,n)=>e(n)));function lt(r,e){if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(r)?r=r.map(s=>s.trim()).filter(s=>s.length).join("-"):r=r.trim(),r.length===0)return"";let t=e.locale===!1?s=>s.toLowerCase():s=>s.toLocaleLowerCase(e.locale),n=e.locale===!1?s=>s.toUpperCase():s=>s.toLocaleUpperCase(e.locale);return r.length===1?mt.test(r)?"":e.pascalCase?n(r):t(r):(r!==t(r)&&(r=Ui(r,t,n,e.preserveConsecutiveUppercase)),r=r.replace(Gi,""),r=e.preserveConsecutiveUppercase?Bi(r,t):t(r),e.pascalCase&&(r=n(r.charAt(0))+r.slice(1)),Wi(r,n))}var de="1.1.5";var tn=()=>{se(),console.log(`
23
+ `),this.outputHelp({error:!0}));let n=t||{},o=n.exitCode||1,i=n.code||"commander.error";this._exit(o,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in w.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,w.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new si(this.options),t=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(o=>!t(o)).forEach(o=>{this.setOptionValueWithSource(o,n.implied[o],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let n=s=>{let u=s.attributeName(),a=this.getOptionValue(u),m=this.options.find(c=>c.negate&&u===c.attributeName()),l=this.options.find(c=>!c.negate&&u===c.attributeName());return m&&(m.presetArg===void 0&&a===!1||m.presetArg!==void 0&&a===m.presetArg)?m:l||s},o=s=>{let u=n(s),a=u.attributeName();return this.getOptionValueSource(a)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},i=`error: ${o(e)} cannot be used with ${o(t)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let o=[],i=this;do{let s=i.createHelp().visibleOptions(i).filter(u=>u.long).map(u=>u.long);o=o.concat(s),i=i.parent}while(i&&!i._enablePositionalOptions);t=fr(e,o)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach(i=>{o.push(i.name()),i.alias()&&o.push(i.alias())}),t=fr(e,o)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";let o=this.createOption(t,n);return this._versionOptionName=o.attributeName(),this._registerOption(o),this.on("option:"+o.name(),()=>{this._outputConfiguration.writeOut(`${e}
24
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${o}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(n=>oi(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=I.basename(e,I.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};let t={error:!!e.error},n;return t.error?n=o=>this._outputConfiguration.writeErr(o):n=o=>this._outputConfiguration.writeOut(o),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(i=>i.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation(n);if(t&&(o=t(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(i=>i.emit("afterAllHelp",n))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=w.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
25
+ Expecting one of '${n.join("', '")}'`);let o=`${e}Help`;return this.on(o,i=>{let s;typeof t=="function"?s=t({error:i.error,command:i.command}):s=t,s&&i.write(`${s}
26
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(o=>t.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function cr(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",o="9229",i;return(i=e.match(/^(--inspect(-brk)?)$/))!==null?t=i[1]:(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=i[1],/^\d+$/.test(i[3])?o=i[3]:n=i[3]):(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=i[1],n=i[3],o=i[4]),t&&o!=="0"?`${t}=${n}:${parseInt(o)+1}`:e})}pr.Command=st});var _r=_(M=>{var{Argument:hr}=xe(),{Command:at}=dr(),{CommanderError:ai,InvalidArgumentError:gr}=me(),{Help:mi}=Ye(),{Option:vr}=rt();M.program=new at;M.createCommand=r=>new at(r);M.createOption=(r,e)=>new vr(r,e);M.createArgument=(r,e)=>new hr(r,e);M.Command=at;M.Option=vr;M.Argument=hr;M.Help=mi;M.CommanderError=ai;M.InvalidArgumentError=gr;M.InvalidOptionArgumentError=gr});var Ar=_((tm,Cr)=>{Cr.exports=Sr;Sr.sync=li;var br=require("fs");function ui(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var n=0;n<t.length;n++){var o=t[n].toLowerCase();if(o&&r.substr(-o.length).toLowerCase()===o)return!0}return!1}function wr(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:ui(e,t)}function Sr(r,e,t){br.stat(r,function(n,o){t(n,n?!1:wr(o,r,e))})}function li(r,e){return wr(br.statSync(r),r,e)}});var Lr=_((rm,Mr)=>{Mr.exports=Er;Er.sync=fi;var Or=require("fs");function Er(r,e,t){Or.stat(r,function(n,o){t(n,n?!1:kr(o,e))})}function fi(r,e){return kr(Or.statSync(r),e)}function kr(r,e){return r.isFile()&&ci(r,e)}function ci(r,e){var t=r.mode,n=r.uid,o=r.gid,i=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),u=parseInt("100",8),a=parseInt("010",8),m=parseInt("001",8),l=u|a,c=t&m||t&a&&o===s||t&u&&n===i||t&l&&i===0;return c}});var Tr=_((om,jr)=>{var nm=require("fs"),ye;process.platform==="win32"||global.TESTING_WINDOWS?ye=Ar():ye=Lr();jr.exports=mt;mt.sync=pi;function mt(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){mt(r,e||{},function(i,s){i?o(i):n(s)})})}ye(r,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),t(n,o)})}function pi(r,e){try{return ye.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var Fr=_((im,Vr)=>{var X=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Nr=require("path"),di=X?";":":",Pr=Tr(),Ir=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),$r=(r,e)=>{let t=e.colon||di,n=r.match(/\//)||X&&r.match(/\\/)?[""]:[...X?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],o=X?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=X?o.split(t):[""];return X&&r.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},Rr=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:i}=$r(r,e),s=[],u=m=>new Promise((l,c)=>{if(m===n.length)return e.all&&s.length?l(s):c(Ir(r));let f=n[m],h=/^".*"$/.test(f)?f.slice(1,-1):f,g=Nr.join(h,r),x=!h&&/^\.[\\\/]/.test(r)?r.slice(0,2)+g:g;l(a(x,m,0))}),a=(m,l,c)=>new Promise((f,h)=>{if(c===o.length)return f(u(l+1));let g=o[c];Pr(m+g,{pathExt:i},(x,T)=>{if(!x&&T)if(e.all)s.push(m+g);else return f(m+g);return f(a(m,l,c+1))})});return t?u(0).then(m=>t(null,m),t):u(0)},hi=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:n,pathExtExe:o}=$r(r,e),i=[];for(let s=0;s<t.length;s++){let u=t[s],a=/^".*"$/.test(u)?u.slice(1,-1):u,m=Nr.join(a,r),l=!a&&/^\.[\\\/]/.test(r)?r.slice(0,2)+m:m;for(let c=0;c<n.length;c++){let f=l+n[c];try{if(Pr.sync(f,{pathExt:o}))if(e.all)i.push(f);else return f}catch{}}}if(e.all&&i.length)return i;if(e.nothrow)return null;throw Ir(r)};Vr.exports=Rr;Rr.sync=hi});var qr=_((sm,ut)=>{"use strict";var Dr=(r={})=>{let e=r.env||process.env;return(r.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};ut.exports=Dr;ut.exports.default=Dr});var Wr=_((am,Ur)=>{"use strict";var Hr=require("path"),gi=Fr(),vi=qr();function Br(r,e){let t=r.options.env||process.env,n=process.cwd(),o=r.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(r.options.cwd)}catch{}let s;try{s=gi.sync(r.command,{path:t[vi({env:t})],pathExt:e?Hr.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=Hr.resolve(o?r.options.cwd:"",s)),s}function _i(r){return Br(r)||Br(r,!0)}Ur.exports=_i});var Gr=_((mm,ft)=>{"use strict";var lt=/([()\][%!^"`<>&|;, *?])/g;function xi(r){return r=r.replace(lt,"^$1"),r}function yi(r,e){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(lt,"^$1"),e&&(r=r.replace(lt,"^$1")),r}ft.exports.command=xi;ft.exports.argument=yi});var Kr=_((um,zr)=>{"use strict";zr.exports=/^#!(.*)/});var Qr=_((lm,Jr)=>{"use strict";var bi=Kr();Jr.exports=(r="")=>{let e=r.match(bi);if(!e)return null;let[t,n]=e[0].replace(/#! ?/,"").split(" "),o=t.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Yr=_((fm,Xr)=>{"use strict";var ct=require("fs"),wi=Qr();function Si(r){let t=Buffer.alloc(150),n;try{n=ct.openSync(r,"r"),ct.readSync(n,t,0,150,0),ct.closeSync(n)}catch{}return wi(t.toString())}Xr.exports=Si});var rn=_((cm,tn)=>{"use strict";var Ci=require("path"),Zr=Wr(),en=Gr(),Ai=Yr(),Oi=process.platform==="win32",Ei=/\.(?:com|exe)$/i,ki=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Mi(r){r.file=Zr(r);let e=r.file&&Ai(r.file);return e?(r.args.unshift(r.file),r.command=e,Zr(r)):r.file}function Li(r){if(!Oi)return r;let e=Mi(r),t=!Ei.test(e);if(r.options.forceShell||t){let n=ki.test(e);r.command=Ci.normalize(r.command),r.command=en.command(r.command),r.args=r.args.map(i=>en.argument(i,n));let o=[r.command].concat(r.args).join(" ");r.args=["/d","/s","/c",`"${o}"`],r.command=process.env.comspec||"cmd.exe",r.options.windowsVerbatimArguments=!0}return r}function ji(r,e,t){e&&!Array.isArray(e)&&(t=e,e=null),e=e?e.slice(0):[],t=Object.assign({},t);let n={command:r,args:e,options:t,file:void 0,original:{command:r,args:e}};return t.shell?n:Li(n)}tn.exports=ji});var sn=_((pm,on)=>{"use strict";var pt=process.platform==="win32";function dt(r,e){return Object.assign(new Error(`${e} ${r.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${r.command}`,path:r.command,spawnargs:r.args})}function Ti(r,e){if(!pt)return;let t=r.emit;r.emit=function(n,o){if(n==="exit"){let i=nn(o,e,"spawn");if(i)return t.call(r,"error",i)}return t.apply(r,arguments)}}function nn(r,e){return pt&&r===1&&!e.file?dt(e.original,"spawn"):null}function Ni(r,e){return pt&&r===1&&!e.file?dt(e.original,"spawnSync"):null}on.exports={hookChildProcess:Ti,verifyENOENT:nn,verifyENOENTSync:Ni,notFoundError:dt}});var un=_((dm,Y)=>{"use strict";var an=require("child_process"),ht=rn(),gt=sn();function mn(r,e,t){let n=ht(r,e,t),o=an.spawn(n.command,n.args,n.options);return gt.hookChildProcess(o,n),o}function Pi(r,e,t){let n=ht(r,e,t),o=an.spawnSync(n.command,n.args,n.options);return o.error=o.error||gt.verifyENOENTSync(o.status,n),o}Y.exports=mn;Y.exports.spawn=mn;Y.exports.sync=Pi;Y.exports._parse=ht;Y.exports._enoent=gt});sr().install();var xr=W(_r(),1),{program:Wa,createCommand:Ga,createArgument:za,createOption:Ka,CommanderError:Ja,InvalidArgumentError:Qa,InvalidOptionArgumentError:Xa,Command:yr,Argument:Ya,Option:$,Help:Za}=xr.default;var B=W(un()),v=W(require("fs")),to=W(require("os")),d=W(require("path"));var Ii=/[\p{Lu}]/u,$i=/[\p{Ll}]/u,ln=/^[\p{Lu}](?![\p{Lu}])/gu,pn=/([\p{Alpha}\p{N}_]|$)/u,vt=/[_.\- ]+/,Ri=new RegExp("^"+vt.source),fn=new RegExp(vt.source+pn.source,"gu"),cn=new RegExp("\\d+"+pn.source,"gu"),Vi=(r,e,t,n)=>{let o=!1,i=!1,s=!1,u=!1;for(let a=0;a<r.length;a++){let m=r[a];u=a>2?r[a-3]==="-":!0,o&&Ii.test(m)?(r=r.slice(0,a)+"-"+r.slice(a),o=!1,s=i,i=!0,a++):i&&s&&$i.test(m)&&(!u||n)?(r=r.slice(0,a-1)+"-"+r.slice(a-1),s=i,i=!1,o=!0):(o=e(m)===m&&t(m)!==m,s=i,i=t(m)===m&&e(m)!==m)}return r},Fi=(r,e)=>(ln.lastIndex=0,r.replaceAll(ln,t=>e(t))),Di=(r,e)=>(fn.lastIndex=0,cn.lastIndex=0,r.replaceAll(cn,(t,n,o)=>["_","-"].includes(r.charAt(o+t.length))?t:e(t)).replaceAll(fn,(t,n)=>e(n)));function _t(r,e){if(!(typeof r=="string"||Array.isArray(r)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(r)?r=r.map(i=>i.trim()).filter(i=>i.length).join("-"):r=r.trim(),r.length===0)return"";let t=e.locale===!1?i=>i.toLowerCase():i=>i.toLocaleLowerCase(e.locale),n=e.locale===!1?i=>i.toUpperCase():i=>i.toLocaleUpperCase(e.locale);return r.length===1?vt.test(r)?"":e.pascalCase?n(r):t(r):(r!==t(r)&&(r=Vi(r,t,n,e.preserveConsecutiveUppercase)),r=r.replace(Ri,""),r=e.preserveConsecutiveUppercase?Fi(r,t):t(r),e.pascalCase&&(r=n(r.charAt(0))+r.slice(1)),Di(r,n))}var qi=typeof global=="object"&&global&&global.Object===Object&&global,be=qi;var Hi=typeof self=="object"&&self&&self.Object===Object&&self,Bi=be||Hi||Function("return this")(),we=Bi;var Ui=we.Symbol,Z=Ui;var dn=Object.prototype,Wi=dn.hasOwnProperty,Gi=dn.toString,ue=Z?Z.toStringTag:void 0;function zi(r){var e=Wi.call(r,ue),t=r[ue];try{r[ue]=void 0;var n=!0}catch{}var o=Gi.call(r);return n&&(e?r[ue]=t:delete r[ue]),o}var hn=zi;var Ki=Object.prototype,Ji=Ki.toString;function Qi(r){return Ji.call(r)}var gn=Qi;var Xi="[object Null]",Yi="[object Undefined]",vn=Z?Z.toStringTag:void 0;function Zi(r){return r==null?r===void 0?Yi:Xi:vn&&vn in Object(r)?hn(r):gn(r)}var ee=Zi;function es(r){return r!=null&&typeof r=="object"}var te=es;var ts=Array.isArray,_n=ts;function rs(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var xn=rs;function ns(r){return r}var yn=ns;var os="[object AsyncFunction]",is="[object Function]",ss="[object GeneratorFunction]",as="[object Proxy]";function ms(r){if(!xn(r))return!1;var e=ee(r);return e==is||e==ss||e==os||e==as}var bn=ms;var us=9007199254740991,ls=/^(?:0|[1-9]\d*)$/;function fs(r,e){var t=typeof r;return e=e??us,!!e&&(t=="number"||t!="symbol"&&ls.test(r))&&r>-1&&r%1==0&&r<e}var wn=fs;var cs=9007199254740991;function ps(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=cs}var Se=ps;function ds(r){return r!=null&&Se(r.length)&&!bn(r)}var Sn=ds;var hs=Object.prototype;function gs(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||hs;return r===t}var Cn=gs;function vs(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var An=vs;var _s="[object Arguments]";function xs(r){return te(r)&&ee(r)==_s}var xt=xs;var On=Object.prototype,ys=On.hasOwnProperty,bs=On.propertyIsEnumerable,ws=xt(function(){return arguments}())?xt:function(r){return te(r)&&ys.call(r,"callee")&&!bs.call(r,"callee")},En=ws;function Ss(){return!1}var kn=Ss;var jn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mn=jn&&typeof module=="object"&&module&&!module.nodeType&&module,Cs=Mn&&Mn.exports===jn,Ln=Cs?we.Buffer:void 0,As=Ln?Ln.isBuffer:void 0,Os=As||kn,Tn=Os;var Es="[object Arguments]",ks="[object Array]",Ms="[object Boolean]",Ls="[object Date]",js="[object Error]",Ts="[object Function]",Ns="[object Map]",Ps="[object Number]",Is="[object Object]",$s="[object RegExp]",Rs="[object Set]",Vs="[object String]",Fs="[object WeakMap]",Ds="[object ArrayBuffer]",qs="[object DataView]",Hs="[object Float32Array]",Bs="[object Float64Array]",Us="[object Int8Array]",Ws="[object Int16Array]",Gs="[object Int32Array]",zs="[object Uint8Array]",Ks="[object Uint8ClampedArray]",Js="[object Uint16Array]",Qs="[object Uint32Array]",b={};b[Hs]=b[Bs]=b[Us]=b[Ws]=b[Gs]=b[zs]=b[Ks]=b[Js]=b[Qs]=!0;b[Es]=b[ks]=b[Ds]=b[Ms]=b[qs]=b[Ls]=b[js]=b[Ts]=b[Ns]=b[Ps]=b[Is]=b[$s]=b[Rs]=b[Vs]=b[Fs]=!1;function Xs(r){return te(r)&&Se(r.length)&&!!b[ee(r)]}var Nn=Xs;function Ys(r){return function(e){return r(e)}}var Pn=Ys;var In=typeof exports=="object"&&exports&&!exports.nodeType&&exports,le=In&&typeof module=="object"&&module&&!module.nodeType&&module,Zs=le&&le.exports===In,yt=Zs&&be.process,ea=function(){try{var r=le&&le.require&&le.require("util").types;return r||yt&&yt.binding&&yt.binding("util")}catch{}}(),bt=ea;var $n=bt&&bt.isTypedArray,ta=$n?Pn($n):Nn,Rn=ta;var ra=Object.prototype,na=ra.hasOwnProperty;function oa(r,e){var t=_n(r),n=!t&&En(r),o=!t&&!n&&Tn(r),i=!t&&!n&&!o&&Rn(r),s=t||n||o||i,u=s?An(r.length,String):[],a=u.length;for(var m in r)(e||na.call(r,m))&&!(s&&(m=="length"||o&&(m=="offset"||m=="parent")||i&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||wn(m,a)))&&u.push(m);return u}var Vn=oa;function ia(r,e){return function(t){return r(e(t))}}var Fn=ia;var sa=Fn(Object.keys,Object),Dn=sa;var aa=Object.prototype,ma=aa.hasOwnProperty;function ua(r){if(!Cn(r))return Dn(r);var e=[];for(var t in Object(r))ma.call(r,t)&&t!="constructor"&&e.push(t);return e}var qn=ua;function la(r){return Sn(r)?Vn(r):qn(r)}var Hn=la;function fa(r){return function(e,t,n){for(var o=-1,i=Object(e),s=n(e),u=s.length;u--;){var a=s[r?u:++o];if(t(i[a],a,i)===!1)break}return e}}var Bn=fa;var ca=Bn(),Un=ca;function pa(r,e){return r&&Un(r,e,Hn)}var Wn=pa;function da(r){return typeof r=="function"?r:yn}var Gn=da;function ha(r,e){return r&&Wn(r,Gn(e))}var wt=ha;var Ce="1.1.6";var Kn=()=>{fe(),console.log(`
27
27
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
28
28
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
29
29
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
@@ -47,4 +47,17 @@ Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let
47
47
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
48
48
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m/\x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;016m \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
49
49
  \x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@\x1B[38;5;m@
50
- \x1B[0m`),console.log(""),console.log("---------------------- Seeka Apps CLI ----------------------"),console.log(`-------------------------- v${de} -------------------------`),console.log(""),console.log("https://developers.seeka.co"),console.log("for help: npx @seeka-labs/cli-apps@latest --help"),console.log("for scaffolding help: npx @seeka-labs/cli-apps@latest init --help"),se()},se=()=>{console.log(""),console.log("------------------------------------------------------------"),console.log("")};var Y=U(require("fs")),rn=require("os"),nn=r=>/^[a-zA-Z0-9-]+$/.test(r);function sn(r){try{let e=Y.opendirSync(r),t=e.readSync();return e.closeSync(),t===null}catch{return!1}}function on(r){let e={};return!r||r.length===0||r.forEach(t=>{let n=t.indexOf("=");if(n===-1){e[t]="";return}let i=t.substring(0,n),s=t.substring(n+1);e[i]=s}),e}var Ji=r=>Y.readFileSync(r,"utf-8").split(rn.EOL);var Ki=(r,e,t)=>{let n=Ji(r),i=n.find(s=>s.split("=")[0]===e);if(i!==void 0){let s=n.indexOf(i);n.splice(s,1,`${e}="${t}"`)}else n.push(`${e}="${t}"`);Y.writeFileSync(r,n.join(rn.EOL))},ut=(r,e)=>{e&&Object.keys(e).forEach(t=>{Ki(r,t,e[t])})};var ln=r=>{if(!nn(r.appName)){console.error("App name must be alphanumeric and hyphens only");return}if(!r.appName.startsWith("seeka-app-")){console.error("App name must start with seeka-app-");return}let e=r.appName,t=lt(r.appName.replace("seeka-app-",""),{pascalCase:!0}),n=p.resolve(r.outputDirectory,r.skipSubDir?"":r.directoryName||e);console.log(`Creating new ${r.template.replace(/-/g," ")} Seeka app in ${n}`),console.log("");let i=p.resolve(n,".git"),s=_.existsSync(i),o=p.resolve(mn.default.tmpdir(),".seeka-app-init-git-"+new Date().getTime());if(_.existsSync(o)||_.mkdirSync(o,{recursive:!0}),!r.skipSubDir&&_.existsSync(n)&&sn(n)===!1)if(r.force)console.log("--force was used and destination directory is not empty. Clearing out the directory"),s&&(console.info(".git directory found in directory, I will preserve it and remove all other files and directories to prepare for the app creation"),_.cpSync(i,o,{recursive:!0})),_.rmSync(n,{recursive:!0,force:!0});else{console.error("Directory is not empty. Use --force to create app in non-empty directory");return}_.existsSync(n)||_.mkdirSync(n,{recursive:!0}),s&&(_.cpSync(o,i,{recursive:!0}),_.rmSync(o,{recursive:!0}),console.info("Restored .git directory"));let l=p.resolve(__dirname,"init-templates"),a=p.resolve(l,r.template);_.cpSync(a,n,{recursive:!0}),_.renameSync(p.join(n,".example.gitignore"),p.join(n,".gitignore"));let m=require(p.join(n,"package.json"));m.name=r.appName,m.version=de,m.description=`Seeka app ${r.appName}`,m.author=`${r.developerName} <${r.developerEmail}>`,m.scripts.deploy=m.scripts.deploy.replace(/seeka-app-example-name/i,r.appName),m.scripts.tunnel=m.scripts.tunnel.replace(/seeka-app-example-name/i,r.appName);let u=p.resolve(p.join(n,"README.md")),h=_.readFileSync(u,"utf8");h=h.replace(/seeka-app-example-name/g,r.appName),_.writeFileSync(u,h);let c=p.resolve(p.join(n,".gitlab-ci.yml")),d=_.readFileSync(c,"utf8");switch(d=d.replace(/seeka-app-example-name/g,r.appName),_.writeFileSync(c,d),r.template){case"aws-lambda":es(r,n,m,t);break;case"azure-function":Yi(r,n,m,t);break;case"netlify-function":Zi(r,n,m,t);break}if(V(p.join(n,"src","lib","state","seeka","installations.ts"),{SampleApp:t+"App"}),Xi(r,n,l,t),Qi(r,m),_.writeFileSync(p.resolve(p.join(n,"package.json")),JSON.stringify(m,null,2)),console.info("Scaffolded package.json"),console.log(""),r.installDependencies)switch(console.info("Installing dependencies with "+r.packageManager),r.packageManager){case"npm":F.sync("npm",["install"],{stdio:"inherit",cwd:n}),r.browser&&F.sync("npm",["install"],{stdio:"inherit",cwd:p.join(n,"src","browser")});break;case"pnpm":F.sync("pnpm",["install"],{stdio:"inherit",cwd:n}),r.browser&&F.sync("pnpm",["install"],{stdio:"inherit",cwd:p.join(n,"src","browser")});break;case"yarn":F.sync("yarn",["install"],{stdio:"inherit",cwd:n}),r.browser&&F.sync("yarn",["install"],{stdio:"inherit",cwd:p.join(n,"src","browser")});break;default:console.error("Invalid package manager");return}se(),console.log(`Created ${e} in ${n}`),console.log("Boom! Your new Seeka app is ready!"),se();let g=r.skipSubDir?n:p.relative(process.cwd(),n);console.log(`Run "cd ${g}" to change to your apps directory and start creating some magic!`),console.log(""),console.log("")},Qi=(r,e)=>{let t;switch(r.packageManager){case"npm":t="npm run";break;case"pnpm":t="pnpm run";break;case"yarn":t="yarn";break;default:console.error("Invalid package manager");return}for(let n in e.scripts)e.scripts[n]=e.scripts[n].replace(/<packageManagerRunPrefix>/g,t);e.dependencies&&e.dependencies["@seeka-labs/sdk-apps-server"]&&(e.dependencies["@seeka-labs/sdk-apps-server"]="^"+e.version)},Xi=(r,e,t,n)=>{if(!r.browser){an(e);return}if(r.template!=="azure-function"){console.warn("Browser plugin is only supported for Azure function template, skipping browser plugin creation"),an(e);return}_.mkdirSync(p.resolve(p.join(e,"src","browser")),{recursive:!0}),_.cpSync(p.resolve(p.join(t,"browser")),p.resolve(p.join(e,"src","browser")),{recursive:!0});let i=p.resolve(p.join(e,"src","browser")),s=require(p.join(i,"package.json"));s.name=s.name.replace(/seeka-app-example-name/i,r.appName),s.description=s.description.replace(/seeka-app-example-name/i,r.appName),s.scripts.build=s.scripts.build.replace(/seeka-app-example-name/i,r.appName),s.scripts["build:dev"]=s.scripts["build:dev"].replace(/seeka-app-example-name/i,r.appName),s.scripts.watch=s.scripts.watch.replace(/seeka-app-example-name/i,r.appName),_.writeFileSync(p.join(i,"package.json"),JSON.stringify(s,null,2)),V(p.join(e,"src","lib","browser","index.ts"),{"seeka-app-example-name":r.appName}),V(p.join(i,"README.md"),{"seeka-app-example-name":r.appName}),V(p.join(i,"src","plugin","index.ts"),{"seeka-app-example-name":r.appName,SampleApp:n+"App"}),V(p.join(i,"src","browser.ts"),{SampleApp:n+"App"}),V(p.join(i,"package.json"),{SampleApp:n+"App"}),console.info("Scaffolded browser plugin"),console.log("")},V=(r,e)=>{let t=_.readFileSync(p.resolve(r),"utf8");for(let n in e)t=t.replace(new RegExp(n,"g"),e[n]);_.writeFileSync(p.resolve(r),t)},an=r=>{_.rmSync(p.resolve(p.join(r,"src","lib","browser")),{recursive:!0})},Yi=(r,e,t,n)=>{if(_.renameSync(p.join(e,"local.settings.example.json"),p.join(e,"local.settings.json")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0){let i=require(p.join(e,"local.settings.json"));i.Values={...i.Values,...r.environmentVariables},_.writeFileSync(p.join(e,"local.settings.json"),JSON.stringify(i,null,2))}r.browser&&(t.scripts.build="tsc && cd src/browser && yarn && yarn build && cd ../",t.scripts.watch="cd src/browser && yarn && yarn build && cd ../ && tsc -w"),V(p.join(e,"src","lib","browser","models","index.ts"),{SampleApp:n+"App"}),V(p.join(e,"src","lib","browser","index.ts"),{SampleApp:n+"App"}),console.info("Scaffolded Azure function")},Zi=(r,e,t,n)=>{_.renameSync(p.join(e,".env.example"),p.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&ut(p.join(e,".env"),r.environmentVariables),console.info("Scaffolded Netlify function")},es=(r,e,t,n)=>{_.renameSync(p.join(e,".env.example"),p.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&ut(p.join(e,".env"),r.environmentVariables),console.info("Scaffolded AWS lambda function")};var ct=new ar;tn();ct.command("init").description("initialises a new Seeka app").argument("<name>",'name of your app. alphanumeric and hyphens only and must start with "seeka-app-"').addOption(new H("--template <template>","app template").choices(["azure-function","aws-lambda","netlify-function"]).makeOptionMandatory()).addOption(new H("--developer <developer>","app developer name or company").makeOptionMandatory()).addOption(new H("--email <email>","app developer email").makeOptionMandatory()).addOption(new H("--outName [outName]","directory name of the app. a new directory will be created with this name to contain the app.")).addOption(new H("--outDir [outDir]","output directory to create the app in. a new directory will be created here that contains the app.").default("","current working dir")).addOption(new H("--packageManager [packageManager]","package manager").choices(["yarn","npm","pnpm"]).default("yarn")).option("--noDependencies","skip installing dependencies").option("--skipSubDir","use sub directory for app files instead of root folder").option("--force","force creation of app in non-empty directory").option("--browser","adds support for browser plugin served from the app").option("--env [env...]","sets environment variables for the app. Use format of --env KEY1=VALUE1 KEY2=VALUE2").action((r,e)=>{let t={appName:r,template:e.template,skipSubDir:e.skipSubDir,browser:e.browser,outputDirectory:e.outDir||process.cwd(),directoryName:e.outName||void 0,packageManager:e.packageManager,developerEmail:e.email,developerName:e.developer,installDependencies:!e.noDependencies,force:e.force,environmentVariables:on(e.env)};ln(t)}).showHelpAfterError(!0);ct.showHelpAfterError(!0);ct.parse();
50
+ \x1B[0m`),console.log(""),console.log("---------------------- Seeka Apps CLI ----------------------"),console.log(`-------------------------- v${Ce} -------------------------`),console.log(""),console.log("https://developers.seeka.co"),console.log("for help: npx @seeka-labs/cli-apps@latest --help"),console.log("for scaffolding help: npx @seeka-labs/cli-apps@latest init --help"),fe()},fe=()=>{console.log(""),console.log("------------------------------------------------------------"),console.log("")};var re=W(require("fs")),Jn=require("os"),Qn=r=>/^[a-zA-Z0-9-]+$/.test(r);function Xn(r){try{let e=re.opendirSync(r),t=e.readSync();return e.closeSync(),t===null}catch{return!1}}function Yn(r){let e={};return!r||r.length===0||r.forEach(t=>{let n=t.indexOf("=");if(n===-1){e[t]="";return}let o=t.substring(0,n),i=t.substring(n+1);e[o]=i}),e}var va=r=>re.readFileSync(r,"utf-8").split(Jn.EOL);var _a=(r,e,t)=>{let n=va(r),o=n.find(i=>i.split("=")[0]===e);if(o!==void 0){let i=n.indexOf(o);n.splice(i,1,`${e}="${t}"`)}else n.push(`${e}="${t}"`);re.writeFileSync(r,n.join(Jn.EOL))},St=(r,e)=>{e&&Object.keys(e).forEach(t=>{_a(r,t,e[t])})};var ro=r=>{if(!Qn(r.appName)){console.error("App name must be alphanumeric and hyphens only");return}if(!r.appName.startsWith("seeka-app-")){console.error("App name must start with seeka-app-");return}let e=r.appName,t=_t(r.appName.replace("seeka-app-",""),{pascalCase:!0}),n=d.resolve(r.outputDirectory,r.skipSubDir?"":r.directoryName||e);console.log(`Creating new ${r.template.replace(/-/g," ")} Seeka app in ${n}`),console.log("");let o=d.resolve(n,".git"),i=v.existsSync(o),s=d.resolve(to.default.tmpdir(),".seeka-app-init-git-"+new Date().getTime());if(v.existsSync(s)||v.mkdirSync(s,{recursive:!0}),!r.skipSubDir&&v.existsSync(n)&&Xn(n)===!1)if(r.force)console.log("--force was used and destination directory is not empty. Clearing out the directory"),i&&(console.info(".git directory found in directory, I will preserve it and remove all other files and directories to prepare for the app creation"),v.cpSync(o,s,{recursive:!0})),v.rmSync(n,{recursive:!0,force:!0});else{console.error("Directory is not empty. Use --force to create app in non-empty directory");return}v.existsSync(n)||v.mkdirSync(n,{recursive:!0}),i&&(v.cpSync(s,o,{recursive:!0}),v.rmSync(s,{recursive:!0}),console.info("Restored .git directory"));let u=d.resolve(__dirname,"init-templates"),a=d.resolve(u,r.template);v.cpSync(a,n,{recursive:!0}),v.renameSync(d.join(n,".example.gitignore"),d.join(n,".gitignore"));let m=require(d.join(n,"package.json"));m.name=r.appName,m.version=Ce,m.description=`Seeka app ${r.appName}`,m.author=`${r.developerName} <${r.developerEmail}>`,m.scripts.deploy=m.scripts.deploy.replace(/seeka-app-example-name/i,r.appName),m.scripts.tunnel=m.scripts.tunnel.replace(/seeka-app-example-name/i,r.appName);let l=d.resolve(d.join(n,"README.md")),c=v.readFileSync(l,"utf8");c=c.replace(/seeka-app-example-name/g,r.appName),v.writeFileSync(l,c);let f=d.resolve(d.join(n,".gitlab-ci.yml")),h=v.readFileSync(f,"utf8");switch(h=h.replace(/seeka-app-example-name/g,r.appName),v.writeFileSync(f,h),r.template){case"aws-lambda":Ca(r,n,m,t);break;case"azure-function":wa(r,n,m,t);break;case"netlify-function":Sa(r,n,m,t);break}if(j(d.join(n,"src","lib","state","seeka","installations.ts"),{SampleApp:t+"App"}),ba(r,n,u,t),xa(r,m),v.writeFileSync(d.resolve(d.join(n,"package.json")),JSON.stringify(m,null,2)),console.info("Scaffolded package.json"),console.log(""),r.installDependencies)switch(console.info("Installing dependencies with "+r.packageManager),r.packageManager){case"npm":B.sync("npm",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("npm",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;case"pnpm":B.sync("pnpm",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("pnpm",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;case"yarn":B.sync("yarn",["install"],{stdio:"inherit",cwd:n}),r.components.browser&&B.sync("yarn",["install"],{stdio:"inherit",cwd:d.join(n,"src","browser")});break;default:console.error("Invalid package manager");return}fe(),console.log(`Created ${e} in ${n}`),console.log("Boom! Your new Seeka app is ready!"),fe();let g=r.skipSubDir?n:d.relative(process.cwd(),n);console.log(`Run "cd ${g}" to change to your apps directory and start creating some magic!`),console.log(""),console.log("")},xa=(r,e)=>{let t;switch(r.packageManager){case"npm":t="npm run";break;case"pnpm":t="pnpm run";break;case"yarn":t="yarn";break;default:console.error("Invalid package manager");return}for(let n in e.scripts)e.scripts[n]=e.scripts[n].replace(/<packageManagerRunPrefix>/g,t);e.dependencies&&e.dependencies["@seeka-labs/sdk-apps-server"]&&(e.dependencies["@seeka-labs/sdk-apps-server"]="^"+e.version)};function Zn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ya=(r,e,t,n)=>{let o=r.endsWith(".ts")||r.endsWith(".js")?"//":"";if(!o)throw new Error("Unsupported file type for components application");wt(e.components,(i,s)=>{let u=Zn(`${o} START: component:${s}`),a=Zn(`${o} END: component:${s}`);i?j(r,{[u+"\r"]:"",[a+"\r"]:""}):j(r,{[`${u}[\\s\\S]*?${a}\r`]:""})})},ba=(r,e,t,n)=>{if(!r.components.browser){eo(e);return}if(r.template!=="azure-function"){console.warn("Browser plugin is only supported for Azure function template, skipping browser plugin creation"),eo(e);return}v.mkdirSync(d.resolve(d.join(e,"src","browser")),{recursive:!0}),v.cpSync(d.resolve(d.join(t,"browser")),d.resolve(d.join(e,"src","browser")),{recursive:!0});let o=d.resolve(d.join(e,"src","browser")),i=require(d.join(o,"package.json"));if(i.name=i.name.replace(/seeka-app-example-name/i,r.appName),i.description=i.description.replace(/seeka-app-example-name/i,r.appName),i.scripts.build=i.scripts.build.replace(/seeka-app-example-name/i,r.appName),i.scripts["build:dev"]=i.scripts["build:dev"].replace(/seeka-app-example-name/i,r.appName),i.scripts.watch=i.scripts.watch.replace(/seeka-app-example-name/i,r.appName),v.writeFileSync(d.join(o,"package.json"),JSON.stringify(i,null,2)),!r.npmUsername||!r.npmPassword)console.warn("npmUsername and npmPassword should be provided for browser plugin support.");else{let s=d.join(o,".npmrc");j(s,{"<<npm_registry_token>>":Buffer.from(`${r.npmUsername}:${r.npmPassword}`).toString("base64")})}j(d.join(e,"src","lib","browser","index.ts"),{"seeka-app-example-name":r.appName}),j(d.join(o,"README.md"),{"seeka-app-example-name":r.appName}),j(d.join(o,"src","plugin","index.ts"),{"seeka-app-example-name":r.appName,SampleApp:n+"App"}),j(d.join(o,"src","browser.ts"),{SampleApp:n+"App"}),j(d.join(o,"package.json"),{SampleApp:n+"App"}),console.info("Scaffolded browser plugin"),console.log("")},j=(r,e)=>{let t=v.readFileSync(d.resolve(r),"utf8");for(let n in e)t=t.replace(new RegExp(n,"g"),e[n]);v.writeFileSync(d.resolve(r),t)},eo=r=>{v.rmSync(d.resolve(d.join(r,"src","lib","browser")),{recursive:!0})},wa=(r,e,t,n)=>{if(v.renameSync(d.join(e,"local.settings.example.json"),d.join(e,"local.settings.json")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0){let o=require(d.join(e,"local.settings.json"));o.Values={...o.Values,...r.environmentVariables},v.writeFileSync(d.join(e,"local.settings.json"),JSON.stringify(o,null,2))}r.components.browser&&(t.scripts.build="tsc && cd src/browser && yarn && yarn build && cd ../",t.scripts.watch="cd src/browser && yarn && yarn build && cd ../ && tsc -w"),j(d.join(e,"src","lib","browser","models","index.ts"),{SampleApp:n+"App"}),j(d.join(e,"src","lib","browser","index.ts"),{SampleApp:n+"App"}),ya(d.join(e,"src","functions","seekaAppWebhook.ts"),r,e,n),console.info("Scaffolded Azure function")},Sa=(r,e,t,n)=>{v.renameSync(d.join(e,".env.example"),d.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&St(d.join(e,".env"),r.environmentVariables),console.info("Scaffolded Netlify function")},Ca=(r,e,t,n)=>{v.renameSync(d.join(e,".env.example"),d.join(e,".env")),r.environmentVariables&&Object.keys(r.environmentVariables).length>0&&St(d.join(e,".env"),r.environmentVariables),console.info("Scaffolded AWS lambda function")};var Ct=new yr;Kn();Ct.command("init").description("initialises a new Seeka app").argument("<name>",'name of your app. alphanumeric and hyphens only and must start with "seeka-app-"').addOption(new $("--template <template>","app template").choices(["azure-function","aws-lambda","netlify-function"]).makeOptionMandatory()).addOption(new $("--developer <developer>","app developer name or company").makeOptionMandatory()).addOption(new $("--email <email>","app developer email").makeOptionMandatory()).addOption(new $("--outName [outName]","directory name of the app. a new directory will be created with this name to contain the app.")).addOption(new $("--outDir [outDir]","output directory to create the app in. a new directory will be created here that contains the app.").default("","current working dir")).addOption(new $("--packageManager [packageManager]","package manager").choices(["yarn","npm","pnpm"]).default("yarn")).addOption(new $("--npmUsername [npmUsername]","Private NPM registry username for browser plugin dependencies.")).addOption(new $("--npmPassword [npmPassword]","Private NPM registry password for browser plugin dependencies.")).option("--noDependencies","skip installing dependencies").option("--skipSubDir","use sub directory for app files instead of root folder").option("--force","force creation of app in non-empty directory").option("--browser","adds support for browser plugin served from the app").option("--env [env...]","sets environment variables for the app. Use format of --env KEY1=VALUE1 KEY2=VALUE2").action((r,e)=>{let t={appName:r,components:{browser:e.browser&&e.template==="azure-function"},template:e.template,skipSubDir:e.skipSubDir,outputDirectory:e.outDir||process.cwd(),directoryName:e.outName||void 0,packageManager:e.packageManager,developerEmail:e.email,developerName:e.developer,installDependencies:!e.noDependencies,force:e.force,environmentVariables:Yn(e.env),npmUsername:e.npmUsername,npmPassword:e.npmPassword};ro(t)}).showHelpAfterError(!0);Ct.showHelpAfterError(!0);Ct.parse();
51
+ /*! Bundled license information:
52
+
53
+ lodash-es/lodash.js:
54
+ (**
55
+ * @license
56
+ * Lodash (Custom Build) <https://lodash.com/>
57
+ * Build: `lodash modularize exports="es" -o ./`
58
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
59
+ * Released under MIT license <https://lodash.com/license>
60
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
61
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
62
+ *)
63
+ */