azamat-ui-kit-cli 0.3.4 → 0.3.13

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.
Files changed (35) hide show
  1. package/README.md +18 -6
  2. package/dist/index.cjs +84 -84
  3. package/package.json +1 -1
  4. package/vendor/src/components/data-table/data-table-pagination.tsx +2 -2
  5. package/vendor/src/components/data-table/data-table-toolbar.tsx +6 -6
  6. package/vendor/src/components/data-table/data-table.tsx +29 -25
  7. package/vendor/src/components/display/entity-card.tsx +4 -4
  8. package/vendor/src/components/display/metric-card.tsx +4 -4
  9. package/vendor/src/components/form/form-date-input.tsx +22 -16
  10. package/vendor/src/components/form/form-number-input.tsx +19 -13
  11. package/vendor/src/components/form/form-phone-input.tsx +13 -12
  12. package/vendor/src/components/form/form-search-input.tsx +22 -16
  13. package/vendor/src/components/inputs/clearable-input.tsx +9 -9
  14. package/vendor/src/components/inputs/input-decorator.tsx +20 -20
  15. package/vendor/src/components/layout/public.ts +12 -12
  16. package/vendor/src/components/navigation/pagination.tsx +4 -4
  17. package/vendor/src/components/overlay/sheet-shell.tsx +6 -6
  18. package/vendor/src/components/patterns/entity-details.tsx +4 -4
  19. package/vendor/src/components/ui/badge.tsx +21 -22
  20. package/vendor/src/components/ui/button.tsx +32 -32
  21. package/vendor/src/components/ui/card.tsx +11 -11
  22. package/vendor/src/components/ui/checkbox.tsx +1 -1
  23. package/vendor/src/components/ui/dialog.tsx +7 -7
  24. package/vendor/src/components/ui/dropdown-menu.tsx +6 -6
  25. package/vendor/src/components/ui/hover-card.tsx +5 -5
  26. package/vendor/src/components/ui/input-primitive.tsx +1 -1
  27. package/vendor/src/components/ui/popover.tsx +1 -1
  28. package/vendor/src/components/ui/select.tsx +3 -3
  29. package/vendor/src/components/ui/switch.tsx +2 -2
  30. package/vendor/src/components/ui/table.tsx +12 -5
  31. package/vendor/src/components/ui/tabs.tsx +2 -2
  32. package/vendor/src/components/ui/tooltip.tsx +5 -5
  33. package/vendor/src/families/member-metadata.ts +6 -6
  34. package/vendor/src/families/member-snippets.ts +2 -2
  35. package/vendor/src/index.ts +20 -18
package/dist/index.cjs CHANGED
@@ -1,33 +1,33 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';var events=require('events'),Rn=require('child_process'),ne=require('path'),Gr=require('fs'),k=require('process'),util=require('util'),url=require('url'),string_decoder=require('string_decoder'),RE=require('tty'),promises$1=require('timers/promises'),os=require('os'),v8=require('v8'),promises=require('stream/promises'),stream=require('stream'),buffer=require('buffer');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Rn__default=/*#__PURE__*/_interopDefault(Rn);var ne__default=/*#__PURE__*/_interopDefault(ne);var Gr__default=/*#__PURE__*/_interopDefault(Gr);var k__default=/*#__PURE__*/_interopDefault(k);var RE__default=/*#__PURE__*/_interopDefault(RE);var Rb=Object.create;var Na=Object.defineProperty;var Fb=Object.getOwnPropertyDescriptor;var Lb=Object.getOwnPropertyNames;var qb=Object.getPrototypeOf,jb=Object.prototype.hasOwnProperty;var A=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var f=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Nb=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Lb(e))!jb.call(t,n)&&n!==r&&Na(t,n,{get:()=>e[n],enumerable:!(i=Fb(e,n))||i.enumerable});return t};var Ie=(t,e,r)=>(r=t!=null?Rb(qb(t)):{},Nb(Na(r,"default",{value:t,enumerable:true}),t));var V=f(Fn=>{Fn.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,i)=>{e.push((n,s)=>n!=null?i(n):r(s)),t.apply(this,e);})},"name",{value:t.name})};Fn.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(i=>r(null,i),r);},"name",{value:t.name})};});var Wa=f((TP,Va)=>{var Je=A("constants"),Hb=process.cwd,Vr=null,zb=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Vr||(Vr=Hb.call(process)),Vr};try{process.cwd();}catch{}typeof process.chdir=="function"&&(Ln=process.chdir,process.chdir=function(t){Vr=null,Ln.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ln));var Ln;Va.exports=Yb;function Yb(t){Je.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,d,h){h&&process.nextTick(h);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,d,h,p){p&&process.nextTick(p);},t.lchownSync=function(){}),zb==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(l){function d(h,p,m){var y=Date.now(),w=0;l(h,p,function b(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(p,function(_,$){_&&_.code==="ENOENT"?l(h,p,b):m(S);});},w),w<100&&(w+=10);return}m&&m(S);});}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(l){function d(h,p,m,y,w,b){var S;if(b&&typeof b=="function"){var _=0;S=function($,oe,le){if($&&$.code==="EAGAIN"&&_<10)return _++,l.call(t,h,p,m,y,w,S);b.apply(this,arguments);};}return l.call(t,h,p,m,y,w,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(l){return function(d,h,p,m,y){for(var w=0;;)try{return l.call(t,d,h,p,m,y)}catch(b){if(b.code==="EAGAIN"&&w<10){w++;continue}throw b}}})(t.readSync);function e(l){l.lchmod=function(d,h,p){l.open(d,Je.O_WRONLY|Je.O_SYMLINK,h,function(m,y){if(m){p&&p(m);return}l.fchmod(y,h,function(w){l.close(y,function(b){p&&p(w||b);});});});},l.lchmodSync=function(d,h){var p=l.openSync(d,Je.O_WRONLY|Je.O_SYMLINK,h),m=true,y;try{y=l.fchmodSync(p,h),m=!1;}finally{if(m)try{l.closeSync(p);}catch{}else l.closeSync(p);}return y};}function r(l){Je.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(d,h,p,m){l.open(d,Je.O_SYMLINK,function(y,w){if(y){m&&m(y);return}l.futimes(w,h,p,function(b){l.close(w,function(S){m&&m(b||S);});});});},l.lutimesSync=function(d,h,p){var m=l.openSync(d,Je.O_SYMLINK),y,w=true;try{y=l.futimesSync(m,h,p),w=!1;}finally{if(w)try{l.closeSync(m);}catch{}else l.closeSync(m);}return y}):l.futimes&&(l.lutimes=function(d,h,p,m){m&&process.nextTick(m);},l.lutimesSync=function(){});}function i(l){return l&&function(d,h,p){return l.call(t,d,h,function(m){u(m)&&(m=null),p&&p.apply(this,arguments);})}}function n(l){return l&&function(d,h){try{return l.call(t,d,h)}catch(p){if(!u(p))throw p}}}function s(l){return l&&function(d,h,p,m){return l.call(t,d,h,p,function(y){u(y)&&(y=null),m&&m.apply(this,arguments);})}}function o(l){return l&&function(d,h,p){try{return l.call(t,d,h,p)}catch(m){if(!u(m))throw m}}}function a(l){return l&&function(d,h,p){typeof h=="function"&&(p=h,h=null);function m(y,w){w&&(w.uid<0&&(w.uid+=4294967296),w.gid<0&&(w.gid+=4294967296)),p&&p.apply(this,arguments);}return h?l.call(t,d,h,m):l.call(t,d,m)}}function c(l){return l&&function(d,h){var p=h?l.call(t,d,h):l.call(t,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function u(l){if(!l||l.code==="ENOSYS")return true;var d=!process.getuid||process.getuid()!==0;return !!(d&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Ya=f((kP,za)=>{var Ha=A("stream").Stream;za.exports=Jb;function Jb(t){return {ReadStream:e,WriteStream:r};function e(i,n){if(!(this instanceof e))return new e(i,n);Ha.call(this);var s=this;this.path=i,this.fd=null,this.readable=true,this.paused=false,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var o=Object.keys(n),a=0,c=o.length;a<c;a++){var u=o[a];this[u]=n[u];}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){s._read();});return}t.open(this.path,this.flags,this.mode,function(l,d){if(l){s.emit("error",l),s.readable=false;return}s.fd=d,s.emit("open",d),s._read();});}function r(i,n){if(!(this instanceof r))return new r(i,n);Ha.call(this),this.path=i,this.fd=null,this.writable=true,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),o=0,a=s.length;o<a;o++){var c=s[o];this[c]=n[c];}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start;}this.busy=false,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var Ka=f((AP,Ja)=>{Ja.exports=Zb;var Kb=Object.getPrototypeOf||function(t){return t.__proto__};function Zb(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Kb(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var Dt=f((DP,Nn)=>{var F=A("fs"),Xb=Wa(),Qb=Ya(),ew=Ka(),Wr=A("util"),J,zr;typeof Symbol=="function"&&typeof Symbol.for=="function"?(J=Symbol.for("graceful-fs.queue"),zr=Symbol.for("graceful-fs.previous")):(J="___graceful-fs.queue",zr="___graceful-fs.previous");function tw(){}function Qa(t,e){Object.defineProperty(t,J,{get:function(){return e}});}var dt=tw;Wr.debuglog?dt=Wr.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(dt=function(){var t=Wr.format.apply(Wr,arguments);t="GFS4: "+t.split(/\n/).join(`
3
- GFS4: `),console.error(t);});F[J]||(Za=global[J]||[],Qa(F,Za),F.close=(function(t){function e(r,i){return t.call(F,r,function(n){n||Xa(),typeof i=="function"&&i.apply(this,arguments);})}return Object.defineProperty(e,zr,{value:t}),e})(F.close),F.closeSync=(function(t){function e(r){t.apply(F,arguments),Xa();}return Object.defineProperty(e,zr,{value:t}),e})(F.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){dt(F[J]),A("assert").equal(F[J].length,0);}));var Za;global[J]||Qa(global,F[J]);Nn.exports=qn(ew(F));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!F.__patched&&(Nn.exports=qn(F),F.__patched=true);function qn(t){Xb(t),t.gracefulify=qn,t.createReadStream=oe,t.createWriteStream=le;var e=t.readFile;t.readFile=r;function r(x,T,O){return typeof T=="function"&&(O=T,T=null),H(x,T,O);function H(z,G,R,j){return e(z,G,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?At([H,[z,G,R],P,j||Date.now(),Date.now()]):typeof R=="function"&&R.apply(this,arguments);})}}var i=t.writeFile;t.writeFile=n;function n(x,T,O,H){return typeof O=="function"&&(H=O,O=null),z(x,T,O,H);function z(G,R,j,P,Y){return i(G,R,j,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?At([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var s=t.appendFile;s&&(t.appendFile=o);function o(x,T,O,H){return typeof O=="function"&&(H=O,O=null),z(x,T,O,H);function z(G,R,j,P,Y){return s(G,R,j,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?At([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var a=t.copyFile;a&&(t.copyFile=c);function c(x,T,O,H){return typeof O=="function"&&(H=O,O=0),z(x,T,O,H);function z(G,R,j,P,Y){return a(G,R,j,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?At([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var u=t.readdir;t.readdir=d;var l=/^v[0-5]\./;function d(x,T,O){typeof T=="function"&&(O=T,T=null);var H=l.test(process.version)?function(R,j,P,Y){return u(R,z(R,j,P,Y))}:function(R,j,P,Y){return u(R,j,z(R,j,P,Y))};return H(x,T,O);function z(G,R,j,P){return function(Y,M){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?At([H,[G,R,j],Y,P||Date.now(),Date.now()]):(M&&M.sort&&M.sort(),typeof j=="function"&&j.call(this,Y,M));}}}if(process.version.substr(0,4)==="v0.8"){var h=Qb(t);b=h.ReadStream,_=h.WriteStream;}var p=t.ReadStream;p&&(b.prototype=Object.create(p.prototype),b.prototype.open=S);var m=t.WriteStream;m&&(_.prototype=Object.create(m.prototype),_.prototype.open=$),Object.defineProperty(t,"ReadStream",{get:function(){return b},set:function(x){b=x;},enumerable:true,configurable:true}),Object.defineProperty(t,"WriteStream",{get:function(){return _},set:function(x){_=x;},enumerable:true,configurable:true});var y=b;Object.defineProperty(t,"FileReadStream",{get:function(){return y},set:function(x){y=x;},enumerable:true,configurable:true});var w=_;Object.defineProperty(t,"FileWriteStream",{get:function(){return w},set:function(x){w=x;},enumerable:true,configurable:true});function b(x,T){return this instanceof b?(p.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function S(){var x=this;be(x.path,x.flags,x.mode,function(T,O){T?(x.autoClose&&x.destroy(),x.emit("error",T)):(x.fd=O,x.emit("open",O),x.read());});}function _(x,T){return this instanceof _?(m.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function $(){var x=this;be(x.path,x.flags,x.mode,function(T,O){T?(x.destroy(),x.emit("error",T)):(x.fd=O,x.emit("open",O));});}function oe(x,T){return new t.ReadStream(x,T)}function le(x,T){return new t.WriteStream(x,T)}var Pe=t.open;t.open=be;function be(x,T,O,H){return typeof O=="function"&&(H=O,O=null),z(x,T,O,H);function z(G,R,j,P,Y){return Pe(G,R,j,function(M,KD){M&&(M.code==="EMFILE"||M.code==="ENFILE")?At([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}return t}function At(t){dt("ENQUEUE",t[0].name,t[1]),F[J].push(t),jn();}var Hr;function Xa(){for(var t=Date.now(),e=0;e<F[J].length;++e)F[J][e].length>2&&(F[J][e][3]=t,F[J][e][4]=t);jn();}function jn(){if(clearTimeout(Hr),Hr=void 0,F[J].length!==0){var t=F[J].shift(),e=t[0],r=t[1],i=t[2],n=t[3],s=t[4];if(n===void 0)dt("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-n>=6e4){dt("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,i);}else {var a=Date.now()-s,c=Math.max(s-n,1),u=Math.min(c*1.2,100);a>=u?(dt("RETRY",e.name,r),e.apply(null,r.concat([n]))):F[J].push(t);}Hr===void 0&&(Hr=setTimeout(jn,0));}}});var X=f(Me=>{var ec=V().fromCallback,Z=Dt(),rw=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Z[t]=="function");Object.assign(Me,Z);rw.forEach(t=>{Me[t]=ec(Z[t]);});Me.exists=function(t,e){return typeof e=="function"?Z.exists(t,e):new Promise(r=>Z.exists(t,r))};Me.read=function(t,e,r,i,n,s){return typeof s=="function"?Z.read(t,e,r,i,n,s):new Promise((o,a)=>{Z.read(t,e,r,i,n,(c,u,l)=>{if(c)return a(c);o({bytesRead:u,buffer:l});});})};Me.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Z.write(t,e,...r):new Promise((i,n)=>{Z.write(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesWritten:o,buffer:a});});})};Me.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Z.readv(t,e,...r):new Promise((i,n)=>{Z.readv(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesRead:o,buffers:a});});})};Me.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Z.writev(t,e,...r):new Promise((i,n)=>{Z.writev(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesWritten:o,buffers:a});});})};typeof Z.realpath.native=="function"?Me.realpath.native=ec(Z.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var rc=f((IP,tc)=>{var iw=A("path");tc.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(iw.parse(e).root,""))){let i=new Error(`Path contains invalid characters: ${e}`);throw i.code="EINVAL",i}};});var oc=f(($P,Bn)=>{var ic=X(),{checkPath:nc}=rc(),sc=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Bn.exports.makeDir=async(t,e)=>(nc(t),ic.mkdir(t,{mode:sc(e),recursive:true}));Bn.exports.makeDirSync=(t,e)=>(nc(t),ic.mkdirSync(t,{mode:sc(e),recursive:true}));});var ue=f((MP,ac)=>{var nw=V().fromPromise,{makeDir:sw,makeDirSync:Un}=oc(),Gn=nw(sw);ac.exports={mkdirs:Gn,mkdirsSync:Un,mkdirp:Gn,mkdirpSync:Un,ensureDir:Gn,ensureDirSync:Un};});var Ke=f((RP,lc)=>{var ow=V().fromPromise,cc=X();function aw(t){return cc.access(t).then(()=>true).catch(()=>false)}lc.exports={pathExists:ow(aw),pathExistsSync:cc.existsSync};});var Vn=f((FP,uc)=>{var Pt=X(),cw=V().fromPromise;async function lw(t,e,r){let i=await Pt.open(t,"r+"),n=null;try{await Pt.futimes(i,e,r);}catch(s){n=s;}finally{try{await Pt.close(i);}catch(s){n||(n=s);}}if(n)throw n}function uw(t,e,r){let i=Pt.openSync(t,"r+"),n=null;try{Pt.futimesSync(i,e,r);}catch(s){n=s;}finally{try{Pt.closeSync(i);}catch(s){n||(n=s);}}if(n)throw n}uc.exports={utimesMillis:cw(lw),utimesMillisSync:uw};});var ht=f((LP,fc)=>{var It=X(),W=A("path"),dc=V().fromPromise;function dw(t,e,r){let i=r.dereference?n=>It.stat(n,{bigint:true}):n=>It.lstat(n,{bigint:true});return Promise.all([i(t),i(e).catch(n=>{if(n.code==="ENOENT")return null;throw n})]).then(([n,s])=>({srcStat:n,destStat:s}))}function hw(t,e,r){let i,n=r.dereference?o=>It.statSync(o,{bigint:true}):o=>It.lstatSync(o,{bigint:true}),s=n(t);try{i=n(e);}catch(o){if(o.code==="ENOENT")return {srcStat:s,destStat:null};throw o}return {srcStat:s,destStat:i}}async function pw(t,e,r,i){let{srcStat:n,destStat:s}=await dw(t,e,i);if(s){if(rr(n,s)){let o=W.basename(t),a=W.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return {srcStat:n,destStat:s,isChangingCase:true};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Wn(t,e))throw new Error(Yr(t,e,r));return {srcStat:n,destStat:s}}function fw(t,e,r,i){let{srcStat:n,destStat:s}=hw(t,e,i);if(s){if(rr(n,s)){let o=W.basename(t),a=W.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return {srcStat:n,destStat:s,isChangingCase:true};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Wn(t,e))throw new Error(Yr(t,e,r));return {srcStat:n,destStat:s}}async function hc(t,e,r,i){let n=W.resolve(W.dirname(t)),s=W.resolve(W.dirname(r));if(s===n||s===W.parse(s).root)return;let o;try{o=await It.stat(s,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(rr(e,o))throw new Error(Yr(t,r,i));return hc(t,e,s,i)}function pc(t,e,r,i){let n=W.resolve(W.dirname(t)),s=W.resolve(W.dirname(r));if(s===n||s===W.parse(s).root)return;let o;try{o=It.statSync(s,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(rr(e,o))throw new Error(Yr(t,r,i));return pc(t,e,s,i)}function rr(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}function Wn(t,e){let r=W.resolve(t).split(W.sep).filter(n=>n),i=W.resolve(e).split(W.sep).filter(n=>n);return r.every((n,s)=>i[s]===n)}function Yr(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}fc.exports={checkPaths:dc(pw),checkPathsSync:fw,checkParentPaths:dc(hc),checkParentPathsSync:pc,isSrcSubdir:Wn,areIdentical:rr};});var gc=f((qP,mc)=>{async function mw(t,e){let r=[];for await(let i of t)r.push(e(i).then(()=>null,n=>n??new Error("unknown error")));await Promise.all(r.map(i=>i.then(n=>{if(n!==null)throw n})));}mc.exports={asyncIteratorConcurrentProcess:mw};});var Sc=f((jP,xc)=>{var K=X(),ir=A("path"),{mkdirs:gw}=ue(),{pathExists:yw}=Ke(),{utimesMillis:bw}=Vn(),nr=ht(),{asyncIteratorConcurrentProcess:ww}=gc();async function xw(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:true,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
2
+ 'use strict';var events=require('events'),Mn=require('child_process'),ne=require('path'),Gr=require('fs'),k=require('process'),util=require('util'),url=require('url'),string_decoder=require('string_decoder'),RO=require('tty'),promises$1=require('timers/promises'),os=require('os'),v8=require('v8'),promises=require('stream/promises'),stream=require('stream'),buffer=require('buffer');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Mn__default=/*#__PURE__*/_interopDefault(Mn);var ne__default=/*#__PURE__*/_interopDefault(ne);var Gr__default=/*#__PURE__*/_interopDefault(Gr);var k__default=/*#__PURE__*/_interopDefault(k);var RO__default=/*#__PURE__*/_interopDefault(RO);var Rb=Object.create;var ja=Object.defineProperty;var Fb=Object.getOwnPropertyDescriptor;var Lb=Object.getOwnPropertyNames;var qb=Object.getPrototypeOf,jb=Object.prototype.hasOwnProperty;var A=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var f=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Nb=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Lb(e))!jb.call(t,n)&&n!==r&&ja(t,n,{get:()=>e[n],enumerable:!(i=Fb(e,n))||i.enumerable});return t};var Ie=(t,e,r)=>(r=t!=null?Rb(qb(t)):{},Nb(ja(r,"default",{value:t,enumerable:true}),t));var V=f(Rn=>{Rn.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,i)=>{e.push((n,s)=>n!=null?i(n):r(s)),t.apply(this,e);})},"name",{value:t.name})};Rn.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(i=>r(null,i),r);},"name",{value:t.name})};});var Va=f((TP,Ga)=>{var Je=A("constants"),Hb=process.cwd,Vr=null,zb=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Vr||(Vr=Hb.call(process)),Vr};try{process.cwd();}catch{}typeof process.chdir=="function"&&(Fn=process.chdir,process.chdir=function(t){Vr=null,Fn.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Fn));var Fn;Ga.exports=Yb;function Yb(t){Je.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,d,h){h&&process.nextTick(h);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,d,h,p){p&&process.nextTick(p);},t.lchownSync=function(){}),zb==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(l){function d(h,p,m){var y=Date.now(),w=0;l(h,p,function b(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(p,function(_,$){_&&_.code==="ENOENT"?l(h,p,b):m(S);});},w),w<100&&(w+=10);return}m&&m(S);});}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(l){function d(h,p,m,y,w,b){var S;if(b&&typeof b=="function"){var _=0;S=function($,oe,le){if($&&$.code==="EAGAIN"&&_<10)return _++,l.call(t,h,p,m,y,w,S);b.apply(this,arguments);};}return l.call(t,h,p,m,y,w,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(l){return function(d,h,p,m,y){for(var w=0;;)try{return l.call(t,d,h,p,m,y)}catch(b){if(b.code==="EAGAIN"&&w<10){w++;continue}throw b}}})(t.readSync);function e(l){l.lchmod=function(d,h,p){l.open(d,Je.O_WRONLY|Je.O_SYMLINK,h,function(m,y){if(m){p&&p(m);return}l.fchmod(y,h,function(w){l.close(y,function(b){p&&p(w||b);});});});},l.lchmodSync=function(d,h){var p=l.openSync(d,Je.O_WRONLY|Je.O_SYMLINK,h),m=true,y;try{y=l.fchmodSync(p,h),m=!1;}finally{if(m)try{l.closeSync(p);}catch{}else l.closeSync(p);}return y};}function r(l){Je.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(d,h,p,m){l.open(d,Je.O_SYMLINK,function(y,w){if(y){m&&m(y);return}l.futimes(w,h,p,function(b){l.close(w,function(S){m&&m(b||S);});});});},l.lutimesSync=function(d,h,p){var m=l.openSync(d,Je.O_SYMLINK),y,w=true;try{y=l.futimesSync(m,h,p),w=!1;}finally{if(w)try{l.closeSync(m);}catch{}else l.closeSync(m);}return y}):l.futimes&&(l.lutimes=function(d,h,p,m){m&&process.nextTick(m);},l.lutimesSync=function(){});}function i(l){return l&&function(d,h,p){return l.call(t,d,h,function(m){u(m)&&(m=null),p&&p.apply(this,arguments);})}}function n(l){return l&&function(d,h){try{return l.call(t,d,h)}catch(p){if(!u(p))throw p}}}function s(l){return l&&function(d,h,p,m){return l.call(t,d,h,p,function(y){u(y)&&(y=null),m&&m.apply(this,arguments);})}}function o(l){return l&&function(d,h,p){try{return l.call(t,d,h,p)}catch(m){if(!u(m))throw m}}}function a(l){return l&&function(d,h,p){typeof h=="function"&&(p=h,h=null);function m(y,w){w&&(w.uid<0&&(w.uid+=4294967296),w.gid<0&&(w.gid+=4294967296)),p&&p.apply(this,arguments);}return h?l.call(t,d,h,m):l.call(t,d,m)}}function c(l){return l&&function(d,h){var p=h?l.call(t,d,h):l.call(t,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function u(l){if(!l||l.code==="ENOSYS")return true;var d=!process.getuid||process.getuid()!==0;return !!(d&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var za=f((kP,Ha)=>{var Wa=A("stream").Stream;Ha.exports=Jb;function Jb(t){return {ReadStream:e,WriteStream:r};function e(i,n){if(!(this instanceof e))return new e(i,n);Wa.call(this);var s=this;this.path=i,this.fd=null,this.readable=true,this.paused=false,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var o=Object.keys(n),a=0,c=o.length;a<c;a++){var u=o[a];this[u]=n[u];}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){s._read();});return}t.open(this.path,this.flags,this.mode,function(l,d){if(l){s.emit("error",l),s.readable=false;return}s.fd=d,s.emit("open",d),s._read();});}function r(i,n){if(!(this instanceof r))return new r(i,n);Wa.call(this),this.path=i,this.fd=null,this.writable=true,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),o=0,a=s.length;o<a;o++){var c=s[o];this[c]=n[c];}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start;}this.busy=false,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var Ja=f((AP,Ya)=>{Ya.exports=Zb;var Kb=Object.getPrototypeOf||function(t){return t.__proto__};function Zb(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Kb(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var Dt=f((DP,jn)=>{var F=A("fs"),Xb=Va(),Qb=za(),ew=Ja(),Wr=A("util"),J,zr;typeof Symbol=="function"&&typeof Symbol.for=="function"?(J=Symbol.for("graceful-fs.queue"),zr=Symbol.for("graceful-fs.previous")):(J="___graceful-fs.queue",zr="___graceful-fs.previous");function tw(){}function Xa(t,e){Object.defineProperty(t,J,{get:function(){return e}});}var dt=tw;Wr.debuglog?dt=Wr.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(dt=function(){var t=Wr.format.apply(Wr,arguments);t="GFS4: "+t.split(/\n/).join(`
3
+ GFS4: `),console.error(t);});F[J]||(Ka=global[J]||[],Xa(F,Ka),F.close=(function(t){function e(r,i){return t.call(F,r,function(n){n||Za(),typeof i=="function"&&i.apply(this,arguments);})}return Object.defineProperty(e,zr,{value:t}),e})(F.close),F.closeSync=(function(t){function e(r){t.apply(F,arguments),Za();}return Object.defineProperty(e,zr,{value:t}),e})(F.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){dt(F[J]),A("assert").equal(F[J].length,0);}));var Ka;global[J]||Xa(global,F[J]);jn.exports=Ln(ew(F));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!F.__patched&&(jn.exports=Ln(F),F.__patched=true);function Ln(t){Xb(t),t.gracefulify=Ln,t.createReadStream=oe,t.createWriteStream=le;var e=t.readFile;t.readFile=r;function r(x,T,E){return typeof T=="function"&&(E=T,T=null),H(x,T,E);function H(z,G,R,j){return e(z,G,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?At([H,[z,G,R],P,j||Date.now(),Date.now()]):typeof R=="function"&&R.apply(this,arguments);})}}var i=t.writeFile;t.writeFile=n;function n(x,T,E,H){return typeof E=="function"&&(H=E,E=null),z(x,T,E,H);function z(G,R,j,P,Y){return i(G,R,j,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?At([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var s=t.appendFile;s&&(t.appendFile=o);function o(x,T,E,H){return typeof E=="function"&&(H=E,E=null),z(x,T,E,H);function z(G,R,j,P,Y){return s(G,R,j,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?At([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var a=t.copyFile;a&&(t.copyFile=c);function c(x,T,E,H){return typeof E=="function"&&(H=E,E=0),z(x,T,E,H);function z(G,R,j,P,Y){return a(G,R,j,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?At([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var u=t.readdir;t.readdir=d;var l=/^v[0-5]\./;function d(x,T,E){typeof T=="function"&&(E=T,T=null);var H=l.test(process.version)?function(R,j,P,Y){return u(R,z(R,j,P,Y))}:function(R,j,P,Y){return u(R,j,z(R,j,P,Y))};return H(x,T,E);function z(G,R,j,P){return function(Y,M){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?At([H,[G,R,j],Y,P||Date.now(),Date.now()]):(M&&M.sort&&M.sort(),typeof j=="function"&&j.call(this,Y,M));}}}if(process.version.substr(0,4)==="v0.8"){var h=Qb(t);b=h.ReadStream,_=h.WriteStream;}var p=t.ReadStream;p&&(b.prototype=Object.create(p.prototype),b.prototype.open=S);var m=t.WriteStream;m&&(_.prototype=Object.create(m.prototype),_.prototype.open=$),Object.defineProperty(t,"ReadStream",{get:function(){return b},set:function(x){b=x;},enumerable:true,configurable:true}),Object.defineProperty(t,"WriteStream",{get:function(){return _},set:function(x){_=x;},enumerable:true,configurable:true});var y=b;Object.defineProperty(t,"FileReadStream",{get:function(){return y},set:function(x){y=x;},enumerable:true,configurable:true});var w=_;Object.defineProperty(t,"FileWriteStream",{get:function(){return w},set:function(x){w=x;},enumerable:true,configurable:true});function b(x,T){return this instanceof b?(p.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function S(){var x=this;be(x.path,x.flags,x.mode,function(T,E){T?(x.autoClose&&x.destroy(),x.emit("error",T)):(x.fd=E,x.emit("open",E),x.read());});}function _(x,T){return this instanceof _?(m.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function $(){var x=this;be(x.path,x.flags,x.mode,function(T,E){T?(x.destroy(),x.emit("error",T)):(x.fd=E,x.emit("open",E));});}function oe(x,T){return new t.ReadStream(x,T)}function le(x,T){return new t.WriteStream(x,T)}var Pe=t.open;t.open=be;function be(x,T,E,H){return typeof E=="function"&&(H=E,E=null),z(x,T,E,H);function z(G,R,j,P,Y){return Pe(G,R,j,function(M,KD){M&&(M.code==="EMFILE"||M.code==="ENFILE")?At([z,[G,R,j,P],M,Y||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}return t}function At(t){dt("ENQUEUE",t[0].name,t[1]),F[J].push(t),qn();}var Hr;function Za(){for(var t=Date.now(),e=0;e<F[J].length;++e)F[J][e].length>2&&(F[J][e][3]=t,F[J][e][4]=t);qn();}function qn(){if(clearTimeout(Hr),Hr=void 0,F[J].length!==0){var t=F[J].shift(),e=t[0],r=t[1],i=t[2],n=t[3],s=t[4];if(n===void 0)dt("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-n>=6e4){dt("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,i);}else {var a=Date.now()-s,c=Math.max(s-n,1),u=Math.min(c*1.2,100);a>=u?(dt("RETRY",e.name,r),e.apply(null,r.concat([n]))):F[J].push(t);}Hr===void 0&&(Hr=setTimeout(qn,0));}}});var X=f(Me=>{var Qa=V().fromCallback,Z=Dt(),rw=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Z[t]=="function");Object.assign(Me,Z);rw.forEach(t=>{Me[t]=Qa(Z[t]);});Me.exists=function(t,e){return typeof e=="function"?Z.exists(t,e):new Promise(r=>Z.exists(t,r))};Me.read=function(t,e,r,i,n,s){return typeof s=="function"?Z.read(t,e,r,i,n,s):new Promise((o,a)=>{Z.read(t,e,r,i,n,(c,u,l)=>{if(c)return a(c);o({bytesRead:u,buffer:l});});})};Me.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Z.write(t,e,...r):new Promise((i,n)=>{Z.write(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesWritten:o,buffer:a});});})};Me.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Z.readv(t,e,...r):new Promise((i,n)=>{Z.readv(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesRead:o,buffers:a});});})};Me.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Z.writev(t,e,...r):new Promise((i,n)=>{Z.writev(t,e,...r,(s,o,a)=>{if(s)return n(s);i({bytesWritten:o,buffers:a});});})};typeof Z.realpath.native=="function"?Me.realpath.native=Qa(Z.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var tc=f((IP,ec)=>{var iw=A("path");ec.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(iw.parse(e).root,""))){let i=new Error(`Path contains invalid characters: ${e}`);throw i.code="EINVAL",i}};});var sc=f(($P,Nn)=>{var rc=X(),{checkPath:ic}=tc(),nc=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Nn.exports.makeDir=async(t,e)=>(ic(t),rc.mkdir(t,{mode:nc(e),recursive:true}));Nn.exports.makeDirSync=(t,e)=>(ic(t),rc.mkdirSync(t,{mode:nc(e),recursive:true}));});var ue=f((MP,oc)=>{var nw=V().fromPromise,{makeDir:sw,makeDirSync:Bn}=sc(),Un=nw(sw);oc.exports={mkdirs:Un,mkdirsSync:Bn,mkdirp:Un,mkdirpSync:Bn,ensureDir:Un,ensureDirSync:Bn};});var Ke=f((RP,cc)=>{var ow=V().fromPromise,ac=X();function aw(t){return ac.access(t).then(()=>true).catch(()=>false)}cc.exports={pathExists:ow(aw),pathExistsSync:ac.existsSync};});var Gn=f((FP,lc)=>{var Pt=X(),cw=V().fromPromise;async function lw(t,e,r){let i=await Pt.open(t,"r+"),n=null;try{await Pt.futimes(i,e,r);}catch(s){n=s;}finally{try{await Pt.close(i);}catch(s){n||(n=s);}}if(n)throw n}function uw(t,e,r){let i=Pt.openSync(t,"r+"),n=null;try{Pt.futimesSync(i,e,r);}catch(s){n=s;}finally{try{Pt.closeSync(i);}catch(s){n||(n=s);}}if(n)throw n}lc.exports={utimesMillis:cw(lw),utimesMillisSync:uw};});var ht=f((LP,pc)=>{var It=X(),W=A("path"),uc=V().fromPromise;function dw(t,e,r){let i=r.dereference?n=>It.stat(n,{bigint:true}):n=>It.lstat(n,{bigint:true});return Promise.all([i(t),i(e).catch(n=>{if(n.code==="ENOENT")return null;throw n})]).then(([n,s])=>({srcStat:n,destStat:s}))}function hw(t,e,r){let i,n=r.dereference?o=>It.statSync(o,{bigint:true}):o=>It.lstatSync(o,{bigint:true}),s=n(t);try{i=n(e);}catch(o){if(o.code==="ENOENT")return {srcStat:s,destStat:null};throw o}return {srcStat:s,destStat:i}}async function pw(t,e,r,i){let{srcStat:n,destStat:s}=await dw(t,e,i);if(s){if(rr(n,s)){let o=W.basename(t),a=W.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return {srcStat:n,destStat:s,isChangingCase:true};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Vn(t,e))throw new Error(Yr(t,e,r));return {srcStat:n,destStat:s}}function fw(t,e,r,i){let{srcStat:n,destStat:s}=hw(t,e,i);if(s){if(rr(n,s)){let o=W.basename(t),a=W.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return {srcStat:n,destStat:s,isChangingCase:true};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Vn(t,e))throw new Error(Yr(t,e,r));return {srcStat:n,destStat:s}}async function dc(t,e,r,i){let n=W.resolve(W.dirname(t)),s=W.resolve(W.dirname(r));if(s===n||s===W.parse(s).root)return;let o;try{o=await It.stat(s,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(rr(e,o))throw new Error(Yr(t,r,i));return dc(t,e,s,i)}function hc(t,e,r,i){let n=W.resolve(W.dirname(t)),s=W.resolve(W.dirname(r));if(s===n||s===W.parse(s).root)return;let o;try{o=It.statSync(s,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(rr(e,o))throw new Error(Yr(t,r,i));return hc(t,e,s,i)}function rr(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}function Vn(t,e){let r=W.resolve(t).split(W.sep).filter(n=>n),i=W.resolve(e).split(W.sep).filter(n=>n);return r.every((n,s)=>i[s]===n)}function Yr(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}pc.exports={checkPaths:uc(pw),checkPathsSync:fw,checkParentPaths:uc(dc),checkParentPathsSync:hc,isSrcSubdir:Vn,areIdentical:rr};});var mc=f((qP,fc)=>{async function mw(t,e){let r=[];for await(let i of t)r.push(e(i).then(()=>null,n=>n??new Error("unknown error")));await Promise.all(r.map(i=>i.then(n=>{if(n!==null)throw n})));}fc.exports={asyncIteratorConcurrentProcess:mw};});var xc=f((jP,wc)=>{var K=X(),ir=A("path"),{mkdirs:gw}=ue(),{pathExists:yw}=Ke(),{utimesMillis:bw}=Gn(),nr=ht(),{asyncIteratorConcurrentProcess:ww}=mc();async function xw(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:true,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
4
4
 
5
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:i,destStat:n}=await nr.checkPaths(t,e,"copy",r);if(await nr.checkParentPaths(t,i,e,"copy"),!await bc(t,e,r))return;let o=ir.dirname(e);await yw(o)||await gw(o),await wc(n,t,e,r);}async function bc(t,e,r){return r.filter?r.filter(t,e):true}async function wc(t,e,r,i){let s=await(i.dereference?K.stat:K.lstat)(e);if(s.isDirectory())return Ow(s,t,e,r,i);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Sw(s,t,e,r,i);if(s.isSymbolicLink())return Cw(t,e,r,i);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function Sw(t,e,r,i,n){if(!e)return yc(t,r,i,n);if(n.overwrite)return await K.unlink(i),yc(t,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}async function yc(t,e,r,i){if(await K.copyFile(e,r),i.preserveTimestamps){vw(t.mode)&&await Ew(r,t.mode);let n=await K.stat(e);await bw(r,n.atime,n.mtime);}return K.chmod(r,t.mode)}function vw(t){return (t&128)===0}function Ew(t,e){return K.chmod(t,e|128)}async function Ow(t,e,r,i,n){e||await K.mkdir(i),await ww(await K.opendir(r),async s=>{let o=ir.join(r,s.name),a=ir.join(i,s.name);if(await bc(o,a,n)){let{destStat:u}=await nr.checkPaths(o,a,"copy",n);await wc(u,o,a,n);}}),e||await K.chmod(i,t.mode);}async function Cw(t,e,r,i){let n=await K.readlink(e);if(i.dereference&&(n=ir.resolve(process.cwd(),n)),!t)return K.symlink(n,r);let s=null;try{s=await K.readlink(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return K.symlink(n,r);throw o}if(i.dereference&&(s=ir.resolve(process.cwd(),s)),n!==s){if(nr.isSrcSubdir(n,s))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${s}'.`);if(nr.isSrcSubdir(s,n))throw new Error(`Cannot overwrite '${s}' with '${n}'.`)}return await K.unlink(r),K.symlink(n,r)}xc.exports=xw;});var _c=f((NP,Cc)=>{var Q=Dt(),sr=A("path"),_w=ue().mkdirsSync,Tw=Vn().utimesMillisSync,or=ht();function kw(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:true,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
5
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:i,destStat:n}=await nr.checkPaths(t,e,"copy",r);if(await nr.checkParentPaths(t,i,e,"copy"),!await yc(t,e,r))return;let o=ir.dirname(e);await yw(o)||await gw(o),await bc(n,t,e,r);}async function yc(t,e,r){return r.filter?r.filter(t,e):true}async function bc(t,e,r,i){let s=await(i.dereference?K.stat:K.lstat)(e);if(s.isDirectory())return Ew(s,t,e,r,i);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Sw(s,t,e,r,i);if(s.isSymbolicLink())return Cw(t,e,r,i);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function Sw(t,e,r,i,n){if(!e)return gc(t,r,i,n);if(n.overwrite)return await K.unlink(i),gc(t,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}async function gc(t,e,r,i){if(await K.copyFile(e,r),i.preserveTimestamps){vw(t.mode)&&await Ow(r,t.mode);let n=await K.stat(e);await bw(r,n.atime,n.mtime);}return K.chmod(r,t.mode)}function vw(t){return (t&128)===0}function Ow(t,e){return K.chmod(t,e|128)}async function Ew(t,e,r,i,n){e||await K.mkdir(i),await ww(await K.opendir(r),async s=>{let o=ir.join(r,s.name),a=ir.join(i,s.name);if(await yc(o,a,n)){let{destStat:u}=await nr.checkPaths(o,a,"copy",n);await bc(u,o,a,n);}}),e||await K.chmod(i,t.mode);}async function Cw(t,e,r,i){let n=await K.readlink(e);if(i.dereference&&(n=ir.resolve(process.cwd(),n)),!t)return K.symlink(n,r);let s=null;try{s=await K.readlink(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return K.symlink(n,r);throw o}if(i.dereference&&(s=ir.resolve(process.cwd(),s)),n!==s){if(nr.isSrcSubdir(n,s))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${s}'.`);if(nr.isSrcSubdir(s,n))throw new Error(`Cannot overwrite '${s}' with '${n}'.`)}return await K.unlink(r),K.symlink(n,r)}wc.exports=xw;});var Cc=f((NP,Ec)=>{var Q=Dt(),sr=A("path"),_w=ue().mkdirsSync,Tw=Gn().utimesMillisSync,or=ht();function kw(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:true,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
6
6
 
7
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:i,destStat:n}=or.checkPathsSync(t,e,"copy",r);if(or.checkParentPathsSync(t,i,e,"copy"),r.filter&&!r.filter(t,e))return;let s=sr.dirname(e);return Q.existsSync(s)||_w(s),vc(n,t,e,r)}function vc(t,e,r,i){let s=(i.dereference?Q.statSync:Q.lstatSync)(e);if(s.isDirectory())return Rw(s,t,e,r,i);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Aw(s,t,e,r,i);if(s.isSymbolicLink())return qw(t,e,r,i);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function Aw(t,e,r,i,n){return e?Dw(t,r,i,n):Ec(t,r,i,n)}function Dw(t,e,r,i){if(i.overwrite)return Q.unlinkSync(r),Ec(t,e,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}function Ec(t,e,r,i){return Q.copyFileSync(e,r),i.preserveTimestamps&&Pw(t.mode,e,r),Hn(r,t.mode)}function Pw(t,e,r){return Iw(t)&&$w(r,t),Mw(e,r)}function Iw(t){return (t&128)===0}function $w(t,e){return Hn(t,e|128)}function Hn(t,e){return Q.chmodSync(t,e)}function Mw(t,e){let r=Q.statSync(t);return Tw(e,r.atime,r.mtime)}function Rw(t,e,r,i,n){return e?Oc(r,i,n):Fw(t.mode,r,i,n)}function Fw(t,e,r,i){return Q.mkdirSync(r),Oc(e,r,i),Hn(r,t)}function Oc(t,e,r){let i=Q.opendirSync(t);try{let n;for(;(n=i.readSync())!==null;)Lw(n.name,t,e,r);}finally{i.closeSync();}}function Lw(t,e,r,i){let n=sr.join(e,t),s=sr.join(r,t);if(i.filter&&!i.filter(n,s))return;let{destStat:o}=or.checkPathsSync(n,s,"copy",i);return vc(o,n,s,i)}function qw(t,e,r,i){let n=Q.readlinkSync(e);if(i.dereference&&(n=sr.resolve(process.cwd(),n)),t){let s;try{s=Q.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Q.symlinkSync(n,r);throw o}if(i.dereference&&(s=sr.resolve(process.cwd(),s)),n!==s){if(or.isSrcSubdir(n,s))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${s}'.`);if(or.isSrcSubdir(s,n))throw new Error(`Cannot overwrite '${s}' with '${n}'.`)}return jw(n,r)}else return Q.symlinkSync(n,r)}function jw(t,e){return Q.unlinkSync(e),Q.symlinkSync(t,e)}Cc.exports=kw;});var Jr=f((BP,Tc)=>{var Nw=V().fromPromise;Tc.exports={copy:Nw(Sc()),copySync:_c()};});var ar=f((UP,Ac)=>{var kc=Dt(),Bw=V().fromCallback;function Uw(t,e){kc.rm(t,{recursive:true,force:true},e);}function Gw(t){kc.rmSync(t,{recursive:true,force:true});}Ac.exports={remove:Bw(Uw),removeSync:Gw};});var Lc=f((GP,Fc)=>{var Vw=V().fromPromise,Ic=X(),$c=A("path"),Mc=ue(),Rc=ar(),Dc=Vw(async function(e){let r;try{r=await Ic.readdir(e);}catch{return Mc.mkdirs(e)}return Promise.all(r.map(i=>Rc.remove($c.join(e,i))))});function Pc(t){let e;try{e=Ic.readdirSync(t);}catch{return Mc.mkdirsSync(t)}e.forEach(r=>{r=$c.join(t,r),Rc.removeSync(r);});}Fc.exports={emptyDirSync:Pc,emptydirSync:Pc,emptyDir:Dc,emptydir:Dc};});var Bc=f((VP,Nc)=>{var Ww=V().fromPromise,qc=A("path"),Re=X(),jc=ue();async function Hw(t){let e;try{e=await Re.stat(t);}catch{}if(e&&e.isFile())return;let r=qc.dirname(t),i=null;try{i=await Re.stat(r);}catch(n){if(n.code==="ENOENT"){await jc.mkdirs(r),await Re.writeFile(t,"");return}else throw n}i.isDirectory()?await Re.writeFile(t,""):await Re.readdir(r);}function zw(t){let e;try{e=Re.statSync(t);}catch{}if(e&&e.isFile())return;let r=qc.dirname(t);try{Re.statSync(r).isDirectory()||Re.readdirSync(r);}catch(i){if(i&&i.code==="ENOENT")jc.mkdirsSync(r);else throw i}Re.writeFileSync(t,"");}Nc.exports={createFile:Ww(Hw),createFileSync:zw};});var Hc=f((WP,Wc)=>{var Yw=V().fromPromise,Uc=A("path"),Ze=X(),Gc=ue(),{pathExists:Jw}=Ke(),{areIdentical:Vc}=ht();async function Kw(t,e){let r;try{r=await Ze.lstat(e,{bigint:!0});}catch{}let i;try{i=await Ze.lstat(t,{bigint:!0});}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(r&&Vc(i,r))return;let n=Uc.dirname(e);await Jw(n)||await Gc.mkdirs(n),await Ze.link(t,e);}function Zw(t,e){let r;try{r=Ze.lstatSync(e,{bigint:!0});}catch{}try{let s=Ze.lstatSync(t,{bigint:!0});if(r&&Vc(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let i=Uc.dirname(e);return Ze.existsSync(i)||Gc.mkdirsSync(i),Ze.linkSync(t,e)}Wc.exports={createLink:Yw(Kw),createLinkSync:Zw};});var Yc=f((HP,zc)=>{var Xe=A("path"),cr=X(),{pathExists:Xw}=Ke(),Qw=V().fromPromise;async function ex(t,e){if(Xe.isAbsolute(t)){try{await cr.lstat(t);}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return {toCwd:t,toDst:t}}let r=Xe.dirname(e),i=Xe.join(r,t);if(await Xw(i))return {toCwd:i,toDst:t};try{await cr.lstat(t);}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return {toCwd:t,toDst:Xe.relative(r,t)}}function tx(t,e){if(Xe.isAbsolute(t)){if(!cr.existsSync(t))throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}let r=Xe.dirname(e),i=Xe.join(r,t);if(cr.existsSync(i))return {toCwd:i,toDst:t};if(!cr.existsSync(t))throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:Xe.relative(r,t)}}zc.exports={symlinkPaths:Qw(ex),symlinkPathsSync:tx};});var Zc=f((zP,Kc)=>{var Jc=X(),rx=V().fromPromise;async function ix(t,e){if(e)return e;let r;try{r=await Jc.lstat(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}function nx(t,e){if(e)return e;let r;try{r=Jc.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}Kc.exports={symlinkType:rx(ix),symlinkTypeSync:nx};});var el=f((YP,Qc)=>{var sx=V().fromPromise,Qe=A("path"),te=X(),{mkdirs:ox,mkdirsSync:ax}=ue(),{symlinkPaths:cx,symlinkPathsSync:lx}=Yc(),{symlinkType:ux,symlinkTypeSync:dx}=Zc(),{pathExists:hx}=Ke(),{areIdentical:Xc}=ht();async function px(t,e,r){let i;try{i=await te.lstat(e);}catch{}if(i&&i.isSymbolicLink()){let a;if(Qe.isAbsolute(t))a=await te.stat(t,{bigint:true});else {let u=Qe.dirname(e),l=Qe.join(u,t);try{a=await te.stat(l,{bigint:!0});}catch{a=await te.stat(t,{bigint:true});}}let c=await te.stat(e,{bigint:true});if(Xc(a,c))return}let n=await cx(t,e);t=n.toDst;let s=await ux(n.toCwd,r),o=Qe.dirname(e);return await hx(o)||await ox(o),te.symlink(t,e,s)}function fx(t,e,r){let i;try{i=te.lstatSync(e);}catch{}if(i&&i.isSymbolicLink()){let a;if(Qe.isAbsolute(t))a=te.statSync(t,{bigint:true});else {let u=Qe.dirname(e),l=Qe.join(u,t);try{a=te.statSync(l,{bigint:!0});}catch{a=te.statSync(t,{bigint:true});}}let c=te.statSync(e,{bigint:true});if(Xc(a,c))return}let n=lx(t,e);t=n.toDst,r=dx(n.toCwd,r);let s=Qe.dirname(e);return te.existsSync(s)||ax(s),te.symlinkSync(t,e,r)}Qc.exports={createSymlink:sx(px),createSymlinkSync:fx};});var cl=f((JP,al)=>{var{createFile:tl,createFileSync:rl}=Bc(),{createLink:il,createLinkSync:nl}=Hc(),{createSymlink:sl,createSymlinkSync:ol}=el();al.exports={createFile:tl,createFileSync:rl,ensureFile:tl,ensureFileSync:rl,createLink:il,createLinkSync:nl,ensureLink:il,ensureLinkSync:nl,createSymlink:sl,createSymlinkSync:ol,ensureSymlink:sl,ensureSymlinkSync:ol};});var Kr=f((KP,ll)=>{function mx(t,{EOL:e=`
8
- `,finalEOL:r=true,replacer:i=null,spaces:n}={}){let s=r?e:"",o=JSON.stringify(t,i,n);if(o===void 0)throw new TypeError(`Converting ${typeof t} value to JSON is not supported`);return o.replace(/\n/g,e)+s}function gx(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}ll.exports={stringify:mx,stripBom:gx};});var pl=f((ZP,hl)=>{var $t;try{$t=Dt();}catch{$t=A("fs");}var Zr=V(),{stringify:ul,stripBom:dl}=Kr();async function yx(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||$t,i="throws"in e?e.throws:true,n=await Zr.fromCallback(r.readFile)(t,e);n=dl(n);let s;try{s=JSON.parse(n,e?e.reviver:null);}catch(o){if(i)throw o.message=`${t}: ${o.message}`,o;return null}return s}var bx=Zr.fromPromise(yx);function wx(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||$t,i="throws"in e?e.throws:true;try{let n=r.readFileSync(t,e);return n=dl(n),JSON.parse(n,e.reviver)}catch(n){if(i)throw n.message=`${t}: ${n.message}`,n;return null}}async function xx(t,e,r={}){let i=r.fs||$t,n=ul(e,r);await Zr.fromCallback(i.writeFile)(t,n,r);}var Sx=Zr.fromPromise(xx);function vx(t,e,r={}){let i=r.fs||$t,n=ul(e,r);return i.writeFileSync(t,n,r)}hl.exports={readFile:bx,readFileSync:wx,writeFile:Sx,writeFileSync:vx};});var ml=f((XP,fl)=>{var Xr=pl();fl.exports={readJson:Xr.readFile,readJsonSync:Xr.readFileSync,writeJson:Xr.writeFile,writeJsonSync:Xr.writeFileSync};});var Qr=f((QP,bl)=>{var Ex=V().fromPromise,zn=X(),gl=A("path"),yl=ue(),Ox=Ke().pathExists;async function Cx(t,e,r="utf-8"){let i=gl.dirname(t);return await Ox(i)||await yl.mkdirs(i),zn.writeFile(t,e,r)}function _x(t,...e){let r=gl.dirname(t);zn.existsSync(r)||yl.mkdirsSync(r),zn.writeFileSync(t,...e);}bl.exports={outputFile:Ex(Cx),outputFileSync:_x};});var xl=f((eI,wl)=>{var{stringify:Tx}=Kr(),{outputFile:kx}=Qr();async function Ax(t,e,r={}){let i=Tx(e,r);await kx(t,i,r);}wl.exports=Ax;});var vl=f((tI,Sl)=>{var{stringify:Dx}=Kr(),{outputFileSync:Px}=Qr();function Ix(t,e,r){let i=Dx(e,r);Px(t,i,r);}Sl.exports=Ix;});var Ol=f((rI,El)=>{var $x=V().fromPromise,ee=ml();ee.outputJson=$x(xl());ee.outputJsonSync=vl();ee.outputJSON=ee.outputJson;ee.outputJSONSync=ee.outputJsonSync;ee.writeJSON=ee.writeJson;ee.writeJSONSync=ee.writeJsonSync;ee.readJSON=ee.readJson;ee.readJSONSync=ee.readJsonSync;El.exports=ee;});var Al=f((iI,kl)=>{var Mx=X(),Cl=A("path"),{copy:Rx}=Jr(),{remove:Tl}=ar(),{mkdirp:Fx}=ue(),{pathExists:Lx}=Ke(),_l=ht();async function qx(t,e,r={}){let i=r.overwrite||r.clobber||false,{srcStat:n,isChangingCase:s=false}=await _l.checkPaths(t,e,"move",r);await _l.checkParentPaths(t,n,e,"move");let o=Cl.dirname(e);return Cl.parse(o).root!==o&&await Fx(o),jx(t,e,i,s)}async function jx(t,e,r,i){if(!i){if(r)await Tl(e);else if(await Lx(e))throw new Error("dest already exists.")}try{await Mx.rename(t,e);}catch(n){if(n.code!=="EXDEV")throw n;await Nx(t,e,r);}}async function Nx(t,e,r){return await Rx(t,e,{overwrite:r,errorOnExist:true,preserveTimestamps:true}),Tl(t)}kl.exports=qx;});var Ml=f((nI,$l)=>{var Pl=Dt(),Jn=A("path"),Bx=Jr().copySync,Il=ar().removeSync,Ux=ue().mkdirpSync,Dl=ht();function Gx(t,e,r){r=r||{};let i=r.overwrite||r.clobber||false,{srcStat:n,isChangingCase:s=false}=Dl.checkPathsSync(t,e,"move",r);return Dl.checkParentPathsSync(t,n,e,"move"),Vx(e)||Ux(Jn.dirname(e)),Wx(t,e,i,s)}function Vx(t){let e=Jn.dirname(t);return Jn.parse(e).root===e}function Wx(t,e,r,i){if(i)return Yn(t,e,r);if(r)return Il(e),Yn(t,e,r);if(Pl.existsSync(e))throw new Error("dest already exists.");return Yn(t,e,r)}function Yn(t,e,r){try{Pl.renameSync(t,e);}catch(i){if(i.code!=="EXDEV")throw i;return Hx(t,e,r)}}function Hx(t,e,r){return Bx(t,e,{overwrite:r,errorOnExist:true,preserveTimestamps:true}),Il(t)}$l.exports=Gx;});var Fl=f((sI,Rl)=>{var zx=V().fromPromise;Rl.exports={move:zx(Al()),moveSync:Ml()};});var et=f((oI,Ll)=>{Ll.exports={...X(),...Jr(),...Lc(),...cl(),...Ol(),...ue(),...Fl(),...Qr(),...Ke(),...ar()};});var L=f((aI,jl)=>{var{FORCE_COLOR:Yx,NODE_DISABLE_COLORS:Jx,TERM:Kx}=process.env,D={enabled:!Jx&&Kx!=="dumb"&&Yx!=="0",reset:I(0,0),bold:I(1,22),dim:I(2,22),italic:I(3,23),underline:I(4,24),inverse:I(7,27),hidden:I(8,28),strikethrough:I(9,29),black:I(30,39),red:I(31,39),green:I(32,39),yellow:I(33,39),blue:I(34,39),magenta:I(35,39),cyan:I(36,39),white:I(37,39),gray:I(90,39),grey:I(90,39),bgBlack:I(40,49),bgRed:I(41,49),bgGreen:I(42,49),bgYellow:I(43,49),bgBlue:I(44,49),bgMagenta:I(45,49),bgCyan:I(46,49),bgWhite:I(47,49)};function ql(t,e){let r=0,i,n="",s="";for(;r<t.length;r++)i=t[r],n+=i.open,s+=i.close,e.includes(i.close)&&(e=e.replace(i.rgx,i.close+i.open));return n+e+s}function Zx(t,e){let r={has:t,keys:e};return r.reset=D.reset.bind(r),r.bold=D.bold.bind(r),r.dim=D.dim.bind(r),r.italic=D.italic.bind(r),r.underline=D.underline.bind(r),r.inverse=D.inverse.bind(r),r.hidden=D.hidden.bind(r),r.strikethrough=D.strikethrough.bind(r),r.black=D.black.bind(r),r.red=D.red.bind(r),r.green=D.green.bind(r),r.yellow=D.yellow.bind(r),r.blue=D.blue.bind(r),r.magenta=D.magenta.bind(r),r.cyan=D.cyan.bind(r),r.white=D.white.bind(r),r.gray=D.gray.bind(r),r.grey=D.grey.bind(r),r.bgBlack=D.bgBlack.bind(r),r.bgRed=D.bgRed.bind(r),r.bgGreen=D.bgGreen.bind(r),r.bgYellow=D.bgYellow.bind(r),r.bgBlue=D.bgBlue.bind(r),r.bgMagenta=D.bgMagenta.bind(r),r.bgCyan=D.bgCyan.bind(r),r.bgWhite=D.bgWhite.bind(r),r}function I(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),i===void 0?this:D.enabled?ql(this.keys,i+""):i+""):i===void 0?Zx([t],[r]):D.enabled?ql([r],i+""):i+""}}jl.exports=D;});var Bl=f((cI,Nl)=>{Nl.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var ei=f((lI,Ul)=>{Ul.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var q=f((uI,Gl)=>{var Kn={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Xx={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Qx={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Kn.up():"");return t&&(e+=Kn.left),e}};Gl.exports={cursor:Kn,scroll:Xx,erase:Qx,beep:"\x07"};});var Yl=f((dI,zl)=>{function eS(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=tS(t))||e){r&&(t=r);var i=0,n=function(){};return {s:n,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=true,o=false,a;return {s:function(){r=r.call(t);},n:function(){var u=r.next();return s=u.done,u},e:function(u){o=true,a=u;},f:function(){try{!s&&r.return!=null&&r.return();}finally{if(o)throw a}}}}function tS(t,e){if(t){if(typeof t=="string")return Vl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vl(t,e)}}function Vl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}var rS=ei(),Hl=q(),Wl=Hl.erase,iS=Hl.cursor,nS=t=>[...rS(t)].length;zl.exports=function(t,e){if(!e)return Wl.line+iS.to(0);let r=0,i=t.split(/\r?\n/);var n=eS(i),s;try{for(n.s();!(s=n.n()).done;){let o=s.value;r+=1+Math.floor(Math.max(nS(o)-1,0)/e);}}catch(o){n.e(o);}finally{n.f();}return Wl.lines(r)};});var Zn=f((hI,Jl)=>{var lr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},sS={arrowUp:lr.arrowUp,arrowDown:lr.arrowDown,arrowLeft:lr.arrowLeft,arrowRight:lr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},oS=process.platform==="win32"?sS:lr;Jl.exports=oS;});var Zl=f((pI,Kl)=>{var Mt=L(),pt=Zn(),Xn=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),aS=t=>Xn[t]||Xn.default,ur=Object.freeze({aborted:Mt.red(pt.cross),done:Mt.green(pt.tick),exited:Mt.yellow(pt.cross),default:Mt.cyan("?")}),cS=(t,e,r)=>e?ur.aborted:r?ur.exited:t?ur.done:ur.default,lS=t=>Mt.gray(t?pt.ellipsis:pt.pointerSmall),uS=(t,e)=>Mt.gray(t?e?pt.pointerSmall:"+":pt.line);Kl.exports={styles:Xn,render:aS,symbols:ur,symbol:cS,delimiter:lS,item:uS};});var Ql=f((fI,Xl)=>{var dS=ei();Xl.exports=function(t,e){let r=String(dS(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,n)=>i+n):r.length};});var tu=f((mI,eu)=>{eu.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((s,o)=>(o.length+r.length>=i||s[s.length-1].length+o.length+1<i?s[s.length-1]+=` ${o}`:s.push(`${r}${o}`),s),[r]).join(`
7
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:i,destStat:n}=or.checkPathsSync(t,e,"copy",r);if(or.checkParentPathsSync(t,i,e,"copy"),r.filter&&!r.filter(t,e))return;let s=sr.dirname(e);return Q.existsSync(s)||_w(s),Sc(n,t,e,r)}function Sc(t,e,r,i){let s=(i.dereference?Q.statSync:Q.lstatSync)(e);if(s.isDirectory())return Rw(s,t,e,r,i);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Aw(s,t,e,r,i);if(s.isSymbolicLink())return qw(t,e,r,i);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function Aw(t,e,r,i,n){return e?Dw(t,r,i,n):vc(t,r,i,n)}function Dw(t,e,r,i){if(i.overwrite)return Q.unlinkSync(r),vc(t,e,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}function vc(t,e,r,i){return Q.copyFileSync(e,r),i.preserveTimestamps&&Pw(t.mode,e,r),Wn(r,t.mode)}function Pw(t,e,r){return Iw(t)&&$w(r,t),Mw(e,r)}function Iw(t){return (t&128)===0}function $w(t,e){return Wn(t,e|128)}function Wn(t,e){return Q.chmodSync(t,e)}function Mw(t,e){let r=Q.statSync(t);return Tw(e,r.atime,r.mtime)}function Rw(t,e,r,i,n){return e?Oc(r,i,n):Fw(t.mode,r,i,n)}function Fw(t,e,r,i){return Q.mkdirSync(r),Oc(e,r,i),Wn(r,t)}function Oc(t,e,r){let i=Q.opendirSync(t);try{let n;for(;(n=i.readSync())!==null;)Lw(n.name,t,e,r);}finally{i.closeSync();}}function Lw(t,e,r,i){let n=sr.join(e,t),s=sr.join(r,t);if(i.filter&&!i.filter(n,s))return;let{destStat:o}=or.checkPathsSync(n,s,"copy",i);return Sc(o,n,s,i)}function qw(t,e,r,i){let n=Q.readlinkSync(e);if(i.dereference&&(n=sr.resolve(process.cwd(),n)),t){let s;try{s=Q.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Q.symlinkSync(n,r);throw o}if(i.dereference&&(s=sr.resolve(process.cwd(),s)),n!==s){if(or.isSrcSubdir(n,s))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${s}'.`);if(or.isSrcSubdir(s,n))throw new Error(`Cannot overwrite '${s}' with '${n}'.`)}return jw(n,r)}else return Q.symlinkSync(n,r)}function jw(t,e){return Q.unlinkSync(e),Q.symlinkSync(t,e)}Ec.exports=kw;});var Jr=f((BP,_c)=>{var Nw=V().fromPromise;_c.exports={copy:Nw(xc()),copySync:Cc()};});var ar=f((UP,kc)=>{var Tc=Dt(),Bw=V().fromCallback;function Uw(t,e){Tc.rm(t,{recursive:true,force:true},e);}function Gw(t){Tc.rmSync(t,{recursive:true,force:true});}kc.exports={remove:Bw(Uw),removeSync:Gw};});var Fc=f((GP,Rc)=>{var Vw=V().fromPromise,Pc=X(),Ic=A("path"),$c=ue(),Mc=ar(),Ac=Vw(async function(e){let r;try{r=await Pc.readdir(e);}catch{return $c.mkdirs(e)}return Promise.all(r.map(i=>Mc.remove(Ic.join(e,i))))});function Dc(t){let e;try{e=Pc.readdirSync(t);}catch{return $c.mkdirsSync(t)}e.forEach(r=>{r=Ic.join(t,r),Mc.removeSync(r);});}Rc.exports={emptyDirSync:Dc,emptydirSync:Dc,emptyDir:Ac,emptydir:Ac};});var Nc=f((VP,jc)=>{var Ww=V().fromPromise,Lc=A("path"),Re=X(),qc=ue();async function Hw(t){let e;try{e=await Re.stat(t);}catch{}if(e&&e.isFile())return;let r=Lc.dirname(t),i=null;try{i=await Re.stat(r);}catch(n){if(n.code==="ENOENT"){await qc.mkdirs(r),await Re.writeFile(t,"");return}else throw n}i.isDirectory()?await Re.writeFile(t,""):await Re.readdir(r);}function zw(t){let e;try{e=Re.statSync(t);}catch{}if(e&&e.isFile())return;let r=Lc.dirname(t);try{Re.statSync(r).isDirectory()||Re.readdirSync(r);}catch(i){if(i&&i.code==="ENOENT")qc.mkdirsSync(r);else throw i}Re.writeFileSync(t,"");}jc.exports={createFile:Ww(Hw),createFileSync:zw};});var Wc=f((WP,Vc)=>{var Yw=V().fromPromise,Bc=A("path"),Ze=X(),Uc=ue(),{pathExists:Jw}=Ke(),{areIdentical:Gc}=ht();async function Kw(t,e){let r;try{r=await Ze.lstat(e,{bigint:!0});}catch{}let i;try{i=await Ze.lstat(t,{bigint:!0});}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(r&&Gc(i,r))return;let n=Bc.dirname(e);await Jw(n)||await Uc.mkdirs(n),await Ze.link(t,e);}function Zw(t,e){let r;try{r=Ze.lstatSync(e,{bigint:!0});}catch{}try{let s=Ze.lstatSync(t,{bigint:!0});if(r&&Gc(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let i=Bc.dirname(e);return Ze.existsSync(i)||Uc.mkdirsSync(i),Ze.linkSync(t,e)}Vc.exports={createLink:Yw(Kw),createLinkSync:Zw};});var zc=f((HP,Hc)=>{var Xe=A("path"),cr=X(),{pathExists:Xw}=Ke(),Qw=V().fromPromise;async function ex(t,e){if(Xe.isAbsolute(t)){try{await cr.lstat(t);}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return {toCwd:t,toDst:t}}let r=Xe.dirname(e),i=Xe.join(r,t);if(await Xw(i))return {toCwd:i,toDst:t};try{await cr.lstat(t);}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return {toCwd:t,toDst:Xe.relative(r,t)}}function tx(t,e){if(Xe.isAbsolute(t)){if(!cr.existsSync(t))throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}let r=Xe.dirname(e),i=Xe.join(r,t);if(cr.existsSync(i))return {toCwd:i,toDst:t};if(!cr.existsSync(t))throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:Xe.relative(r,t)}}Hc.exports={symlinkPaths:Qw(ex),symlinkPathsSync:tx};});var Kc=f((zP,Jc)=>{var Yc=X(),rx=V().fromPromise;async function ix(t,e){if(e)return e;let r;try{r=await Yc.lstat(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}function nx(t,e){if(e)return e;let r;try{r=Yc.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}Jc.exports={symlinkType:rx(ix),symlinkTypeSync:nx};});var Qc=f((YP,Xc)=>{var sx=V().fromPromise,Qe=A("path"),te=X(),{mkdirs:ox,mkdirsSync:ax}=ue(),{symlinkPaths:cx,symlinkPathsSync:lx}=zc(),{symlinkType:ux,symlinkTypeSync:dx}=Kc(),{pathExists:hx}=Ke(),{areIdentical:Zc}=ht();async function px(t,e,r){let i;try{i=await te.lstat(e);}catch{}if(i&&i.isSymbolicLink()){let a;if(Qe.isAbsolute(t))a=await te.stat(t,{bigint:true});else {let u=Qe.dirname(e),l=Qe.join(u,t);try{a=await te.stat(l,{bigint:!0});}catch{a=await te.stat(t,{bigint:true});}}let c=await te.stat(e,{bigint:true});if(Zc(a,c))return}let n=await cx(t,e);t=n.toDst;let s=await ux(n.toCwd,r),o=Qe.dirname(e);return await hx(o)||await ox(o),te.symlink(t,e,s)}function fx(t,e,r){let i;try{i=te.lstatSync(e);}catch{}if(i&&i.isSymbolicLink()){let a;if(Qe.isAbsolute(t))a=te.statSync(t,{bigint:true});else {let u=Qe.dirname(e),l=Qe.join(u,t);try{a=te.statSync(l,{bigint:!0});}catch{a=te.statSync(t,{bigint:true});}}let c=te.statSync(e,{bigint:true});if(Zc(a,c))return}let n=lx(t,e);t=n.toDst,r=dx(n.toCwd,r);let s=Qe.dirname(e);return te.existsSync(s)||ax(s),te.symlinkSync(t,e,r)}Xc.exports={createSymlink:sx(px),createSymlinkSync:fx};});var al=f((JP,ol)=>{var{createFile:el,createFileSync:tl}=Nc(),{createLink:rl,createLinkSync:il}=Wc(),{createSymlink:nl,createSymlinkSync:sl}=Qc();ol.exports={createFile:el,createFileSync:tl,ensureFile:el,ensureFileSync:tl,createLink:rl,createLinkSync:il,ensureLink:rl,ensureLinkSync:il,createSymlink:nl,createSymlinkSync:sl,ensureSymlink:nl,ensureSymlinkSync:sl};});var Kr=f((KP,cl)=>{function mx(t,{EOL:e=`
8
+ `,finalEOL:r=true,replacer:i=null,spaces:n}={}){let s=r?e:"",o=JSON.stringify(t,i,n);if(o===void 0)throw new TypeError(`Converting ${typeof t} value to JSON is not supported`);return o.replace(/\n/g,e)+s}function gx(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}cl.exports={stringify:mx,stripBom:gx};});var hl=f((ZP,dl)=>{var $t;try{$t=Dt();}catch{$t=A("fs");}var Zr=V(),{stringify:ll,stripBom:ul}=Kr();async function yx(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||$t,i="throws"in e?e.throws:true,n=await Zr.fromCallback(r.readFile)(t,e);n=ul(n);let s;try{s=JSON.parse(n,e?e.reviver:null);}catch(o){if(i)throw o.message=`${t}: ${o.message}`,o;return null}return s}var bx=Zr.fromPromise(yx);function wx(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||$t,i="throws"in e?e.throws:true;try{let n=r.readFileSync(t,e);return n=ul(n),JSON.parse(n,e.reviver)}catch(n){if(i)throw n.message=`${t}: ${n.message}`,n;return null}}async function xx(t,e,r={}){let i=r.fs||$t,n=ll(e,r);await Zr.fromCallback(i.writeFile)(t,n,r);}var Sx=Zr.fromPromise(xx);function vx(t,e,r={}){let i=r.fs||$t,n=ll(e,r);return i.writeFileSync(t,n,r)}dl.exports={readFile:bx,readFileSync:wx,writeFile:Sx,writeFileSync:vx};});var fl=f((XP,pl)=>{var Xr=hl();pl.exports={readJson:Xr.readFile,readJsonSync:Xr.readFileSync,writeJson:Xr.writeFile,writeJsonSync:Xr.writeFileSync};});var Qr=f((QP,yl)=>{var Ox=V().fromPromise,Hn=X(),ml=A("path"),gl=ue(),Ex=Ke().pathExists;async function Cx(t,e,r="utf-8"){let i=ml.dirname(t);return await Ex(i)||await gl.mkdirs(i),Hn.writeFile(t,e,r)}function _x(t,...e){let r=ml.dirname(t);Hn.existsSync(r)||gl.mkdirsSync(r),Hn.writeFileSync(t,...e);}yl.exports={outputFile:Ox(Cx),outputFileSync:_x};});var wl=f((eI,bl)=>{var{stringify:Tx}=Kr(),{outputFile:kx}=Qr();async function Ax(t,e,r={}){let i=Tx(e,r);await kx(t,i,r);}bl.exports=Ax;});var Sl=f((tI,xl)=>{var{stringify:Dx}=Kr(),{outputFileSync:Px}=Qr();function Ix(t,e,r){let i=Dx(e,r);Px(t,i,r);}xl.exports=Ix;});var Ol=f((rI,vl)=>{var $x=V().fromPromise,ee=fl();ee.outputJson=$x(wl());ee.outputJsonSync=Sl();ee.outputJSON=ee.outputJson;ee.outputJSONSync=ee.outputJsonSync;ee.writeJSON=ee.writeJson;ee.writeJSONSync=ee.writeJsonSync;ee.readJSON=ee.readJson;ee.readJSONSync=ee.readJsonSync;vl.exports=ee;});var kl=f((iI,Tl)=>{var Mx=X(),El=A("path"),{copy:Rx}=Jr(),{remove:_l}=ar(),{mkdirp:Fx}=ue(),{pathExists:Lx}=Ke(),Cl=ht();async function qx(t,e,r={}){let i=r.overwrite||r.clobber||false,{srcStat:n,isChangingCase:s=false}=await Cl.checkPaths(t,e,"move",r);await Cl.checkParentPaths(t,n,e,"move");let o=El.dirname(e);return El.parse(o).root!==o&&await Fx(o),jx(t,e,i,s)}async function jx(t,e,r,i){if(!i){if(r)await _l(e);else if(await Lx(e))throw new Error("dest already exists.")}try{await Mx.rename(t,e);}catch(n){if(n.code!=="EXDEV")throw n;await Nx(t,e,r);}}async function Nx(t,e,r){return await Rx(t,e,{overwrite:r,errorOnExist:true,preserveTimestamps:true}),_l(t)}Tl.exports=qx;});var $l=f((nI,Il)=>{var Dl=Dt(),Yn=A("path"),Bx=Jr().copySync,Pl=ar().removeSync,Ux=ue().mkdirpSync,Al=ht();function Gx(t,e,r){r=r||{};let i=r.overwrite||r.clobber||false,{srcStat:n,isChangingCase:s=false}=Al.checkPathsSync(t,e,"move",r);return Al.checkParentPathsSync(t,n,e,"move"),Vx(e)||Ux(Yn.dirname(e)),Wx(t,e,i,s)}function Vx(t){let e=Yn.dirname(t);return Yn.parse(e).root===e}function Wx(t,e,r,i){if(i)return zn(t,e,r);if(r)return Pl(e),zn(t,e,r);if(Dl.existsSync(e))throw new Error("dest already exists.");return zn(t,e,r)}function zn(t,e,r){try{Dl.renameSync(t,e);}catch(i){if(i.code!=="EXDEV")throw i;return Hx(t,e,r)}}function Hx(t,e,r){return Bx(t,e,{overwrite:r,errorOnExist:true,preserveTimestamps:true}),Pl(t)}Il.exports=Gx;});var Rl=f((sI,Ml)=>{var zx=V().fromPromise;Ml.exports={move:zx(kl()),moveSync:$l()};});var et=f((oI,Fl)=>{Fl.exports={...X(),...Jr(),...Fc(),...al(),...Ol(),...ue(),...Rl(),...Qr(),...Ke(),...ar()};});var L=f((aI,ql)=>{var{FORCE_COLOR:Yx,NODE_DISABLE_COLORS:Jx,TERM:Kx}=process.env,D={enabled:!Jx&&Kx!=="dumb"&&Yx!=="0",reset:I(0,0),bold:I(1,22),dim:I(2,22),italic:I(3,23),underline:I(4,24),inverse:I(7,27),hidden:I(8,28),strikethrough:I(9,29),black:I(30,39),red:I(31,39),green:I(32,39),yellow:I(33,39),blue:I(34,39),magenta:I(35,39),cyan:I(36,39),white:I(37,39),gray:I(90,39),grey:I(90,39),bgBlack:I(40,49),bgRed:I(41,49),bgGreen:I(42,49),bgYellow:I(43,49),bgBlue:I(44,49),bgMagenta:I(45,49),bgCyan:I(46,49),bgWhite:I(47,49)};function Ll(t,e){let r=0,i,n="",s="";for(;r<t.length;r++)i=t[r],n+=i.open,s+=i.close,e.includes(i.close)&&(e=e.replace(i.rgx,i.close+i.open));return n+e+s}function Zx(t,e){let r={has:t,keys:e};return r.reset=D.reset.bind(r),r.bold=D.bold.bind(r),r.dim=D.dim.bind(r),r.italic=D.italic.bind(r),r.underline=D.underline.bind(r),r.inverse=D.inverse.bind(r),r.hidden=D.hidden.bind(r),r.strikethrough=D.strikethrough.bind(r),r.black=D.black.bind(r),r.red=D.red.bind(r),r.green=D.green.bind(r),r.yellow=D.yellow.bind(r),r.blue=D.blue.bind(r),r.magenta=D.magenta.bind(r),r.cyan=D.cyan.bind(r),r.white=D.white.bind(r),r.gray=D.gray.bind(r),r.grey=D.grey.bind(r),r.bgBlack=D.bgBlack.bind(r),r.bgRed=D.bgRed.bind(r),r.bgGreen=D.bgGreen.bind(r),r.bgYellow=D.bgYellow.bind(r),r.bgBlue=D.bgBlue.bind(r),r.bgMagenta=D.bgMagenta.bind(r),r.bgCyan=D.bgCyan.bind(r),r.bgWhite=D.bgWhite.bind(r),r}function I(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),i===void 0?this:D.enabled?Ll(this.keys,i+""):i+""):i===void 0?Zx([t],[r]):D.enabled?Ll([r],i+""):i+""}}ql.exports=D;});var Nl=f((cI,jl)=>{jl.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var ei=f((lI,Bl)=>{Bl.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var q=f((uI,Ul)=>{var Jn={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Xx={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Qx={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Jn.up():"");return t&&(e+=Jn.left),e}};Ul.exports={cursor:Jn,scroll:Xx,erase:Qx,beep:"\x07"};});var zl=f((dI,Hl)=>{function eS(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=tS(t))||e){r&&(t=r);var i=0,n=function(){};return {s:n,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=true,o=false,a;return {s:function(){r=r.call(t);},n:function(){var u=r.next();return s=u.done,u},e:function(u){o=true,a=u;},f:function(){try{!s&&r.return!=null&&r.return();}finally{if(o)throw a}}}}function tS(t,e){if(t){if(typeof t=="string")return Gl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gl(t,e)}}function Gl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}var rS=ei(),Wl=q(),Vl=Wl.erase,iS=Wl.cursor,nS=t=>[...rS(t)].length;Hl.exports=function(t,e){if(!e)return Vl.line+iS.to(0);let r=0,i=t.split(/\r?\n/);var n=eS(i),s;try{for(n.s();!(s=n.n()).done;){let o=s.value;r+=1+Math.floor(Math.max(nS(o)-1,0)/e);}}catch(o){n.e(o);}finally{n.f();}return Vl.lines(r)};});var Kn=f((hI,Yl)=>{var lr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},sS={arrowUp:lr.arrowUp,arrowDown:lr.arrowDown,arrowLeft:lr.arrowLeft,arrowRight:lr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},oS=process.platform==="win32"?sS:lr;Yl.exports=oS;});var Kl=f((pI,Jl)=>{var Mt=L(),pt=Kn(),Zn=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),aS=t=>Zn[t]||Zn.default,ur=Object.freeze({aborted:Mt.red(pt.cross),done:Mt.green(pt.tick),exited:Mt.yellow(pt.cross),default:Mt.cyan("?")}),cS=(t,e,r)=>e?ur.aborted:r?ur.exited:t?ur.done:ur.default,lS=t=>Mt.gray(t?pt.ellipsis:pt.pointerSmall),uS=(t,e)=>Mt.gray(t?e?pt.pointerSmall:"+":pt.line);Jl.exports={styles:Zn,render:aS,symbols:ur,symbol:cS,delimiter:lS,item:uS};});var Xl=f((fI,Zl)=>{var dS=ei();Zl.exports=function(t,e){let r=String(dS(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,n)=>i+n):r.length};});var eu=f((mI,Ql)=>{Ql.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((s,o)=>(o.length+r.length>=i||s[s.length-1].length+o.length+1<i?s[s.length-1]+=` ${o}`:s.push(`${r}${o}`),s),[r]).join(`
10
10
  `)).join(`
11
- `)};});var iu=f((gI,ru)=>{ru.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,e);return {startIndex:i,endIndex:n}};});var de=f((yI,nu)=>{nu.exports={action:Bl(),clear:Yl(),style:Zl(),strip:ei(),figures:Zn(),lines:Ql(),wrap:tu(),entriesToDisplay:iu()};});var Fe=f((bI,au)=>{var su=A("readline"),hS=de(),pS=hS.action,fS=A("events"),ou=q(),mS=ou.beep,gS=ou.cursor,yS=L(),Qn=class extends fS{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=su.createInterface({input:this.in,escapeCodeTimeout:50});su.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(s,o)=>{let a=pS(o,i);a===false?this._&&this._(s,o):typeof this[a]=="function"?this[a](o):this.bell();};this.close=()=>{this.out.write(gS.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",n);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(mS);}render(){this.onRender(yS),this.firstRender&&(this.firstRender=false);}};au.exports=Qn;});var hu=f((wI,du)=>{function cu(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function lu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){cu(s,i,n,o,a,"next",c);}function a(c){cu(s,i,n,o,a,"throw",c);}o(void 0);})}}var ti=L(),bS=Fe(),uu=q(),wS=uu.erase,dr=uu.cursor,ri=de(),es=ri.style,ts=ri.clear,xS=ri.lines,SS=ri.figures,rs=class extends bS{constructor(e={}){super(e),this.transform=es.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=ts("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=ti.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
12
- `),this.close();}validate(){var e=this;return lu(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return lu(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=true,e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
13
- `),e.close();})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${e}${n}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(dr.down(xS(this.outputError,this.out.columns)-1)+ts(this.outputError,this.out.columns)),this.out.write(ts(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[es.symbol(this.done,this.aborted),ti.bold(this.msg),es.delimiter(this.done),this.red?ti.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
11
+ `)};});var ru=f((gI,tu)=>{tu.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,e);return {startIndex:i,endIndex:n}};});var de=f((yI,iu)=>{iu.exports={action:Nl(),clear:zl(),style:Kl(),strip:ei(),figures:Kn(),lines:Xl(),wrap:eu(),entriesToDisplay:ru()};});var Fe=f((bI,ou)=>{var nu=A("readline"),hS=de(),pS=hS.action,fS=A("events"),su=q(),mS=su.beep,gS=su.cursor,yS=L(),Xn=class extends fS{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=nu.createInterface({input:this.in,escapeCodeTimeout:50});nu.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(s,o)=>{let a=pS(o,i);a===false?this._&&this._(s,o):typeof this[a]=="function"?this[a](o):this.bell();};this.close=()=>{this.out.write(gS.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",n);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(mS);}render(){this.onRender(yS),this.firstRender&&(this.firstRender=false);}};ou.exports=Xn;});var du=f((wI,uu)=>{function au(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function cu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){au(s,i,n,o,a,"next",c);}function a(c){au(s,i,n,o,a,"throw",c);}o(void 0);})}}var ti=L(),bS=Fe(),lu=q(),wS=lu.erase,dr=lu.cursor,ri=de(),Qn=ri.style,es=ri.clear,xS=ri.lines,SS=ri.figures,ts=class extends bS{constructor(e={}){super(e),this.transform=Qn.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=es("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=ti.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
12
+ `),this.close();}validate(){var e=this;return cu(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return cu(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=true,e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
13
+ `),e.close();})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${e}${n}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(dr.down(xS(this.outputError,this.out.columns)-1)+es(this.outputError,this.out.columns)),this.out.write(es(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Qn.symbol(this.done,this.aborted),ti.bold(this.msg),Qn.delimiter(this.done),this.red?ti.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
14
14
  `).reduce((e,r,i)=>e+`
15
- ${i?" ":SS.pointerSmall} ${ti.red().italic(r)}`,"")),this.out.write(wS.line+dr.to(0)+this.outputText+dr.save+this.outputError+dr.restore+dr.move(this.cursorOffset,0)));}};du.exports=rs;});var gu=f((xI,mu)=>{var Le=L(),vS=Fe(),hr=de(),pu=hr.style,fu=hr.clear,ii=hr.figures,ES=hr.wrap,OS=hr.entriesToDisplay,CS=q(),_S=CS.cursor,is=class extends vS{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=fu("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
15
+ ${i?" ":SS.pointerSmall} ${ti.red().italic(r)}`,"")),this.out.write(wS.line+dr.to(0)+this.outputText+dr.save+this.outputError+dr.restore+dr.move(this.cursorOffset,0)));}};uu.exports=ts;});var mu=f((xI,fu)=>{var Le=L(),vS=Fe(),hr=de(),hu=hr.style,pu=hr.clear,ii=hr.figures,OS=hr.wrap,ES=hr.entriesToDisplay,CS=q(),_S=CS.cursor,rs=class extends vS{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=pu("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
16
16
  `),this.close();}submit(){this.selection.disabled?this.bell():(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
17
- `),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(_S.hide):this.out.write(fu(this.outputText,this.out.columns)),super.render();let e=OS(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,i=e.endIndex;if(this.outputText=[pu.symbol(this.done,this.aborted),Le.bold(this.msg),pu.delimiter(false),this.done?this.selection.title:this.selection.disabled?Le.yellow(this.warn):Le.gray(this.hint)].join(" "),!this.done){this.outputText+=`
17
+ `),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(_S.hide):this.out.write(pu(this.outputText,this.out.columns)),super.render();let e=ES(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,i=e.endIndex;if(this.outputText=[hu.symbol(this.done,this.aborted),Le.bold(this.msg),hu.delimiter(false),this.done?this.selection.title:this.selection.disabled?Le.yellow(this.warn):Le.gray(this.hint)].join(" "),!this.done){this.outputText+=`
18
18
  `;for(let n=r;n<i;n++){let s,o,a="",c=this.choices[n];n===r&&r>0?o=ii.arrowUp:n===i-1&&i<this.choices.length?o=ii.arrowDown:o=" ",c.disabled?(s=this.cursor===n?Le.gray().underline(c.title):Le.strikethrough().gray(c.title),o=(this.cursor===n?Le.bold().gray(ii.pointer)+" ":" ")+o):(s=this.cursor===n?Le.cyan().underline(c.title):c.title,o=(this.cursor===n?Le.cyan(ii.pointer)+" ":" ")+o,c.description&&this.cursor===n&&(a=` - ${c.description}`,(o.length+s.length+a.length>=this.out.columns||c.description.split(/\r?\n/).length>1)&&(a=`
19
- `+ES(c.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${s}${Le.gray(a)}
20
- `;}}this.out.write(this.outputText);}};mu.exports=is;});var vu=f((SI,Su)=>{var ni=L(),TS=Fe(),wu=de(),yu=wu.style,kS=wu.clear,xu=q(),bu=xu.cursor,AS=xu.erase,ns=class extends TS{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
19
+ `+OS(c.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${s}${Le.gray(a)}
20
+ `;}}this.out.write(this.outputText);}};fu.exports=rs;});var Su=f((SI,xu)=>{var ni=L(),TS=Fe(),bu=de(),gu=bu.style,kS=bu.clear,wu=q(),yu=wu.cursor,AS=wu.erase,is=class extends TS{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
21
21
  `),this.close();}submit(){this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
22
- `),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(bu.hide):this.out.write(kS(this.outputText,this.out.columns)),super.render(),this.outputText=[yu.symbol(this.done,this.aborted),ni.bold(this.msg),yu.delimiter(this.done),this.value?this.inactive:ni.cyan().underline(this.inactive),ni.gray("/"),this.value?ni.cyan().underline(this.active):this.active].join(" "),this.out.write(AS.line+bu.to(0)+this.outputText));}};Su.exports=ns;});var we=f((vI,Eu)=>{var ss=class t{constructor({token:e,date:r,parts:i,locales:n}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=n||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,n)=>n>r&&i instanceof t)}toString(){return String(this.date)}};Eu.exports=ss;});var Cu=f((EI,Ou)=>{var DS=we(),os=class extends DS{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};Ou.exports=os;});var Tu=f((OI,_u)=>{var PS=we(),IS=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),as=class extends PS{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+IS(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};_u.exports=as;});var Au=f((CI,ku)=>{var $S=we(),cs=class extends $S{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};ku.exports=cs;});var Pu=f((_I,Du)=>{var MS=we(),ls=class extends MS{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Du.exports=ls;});var $u=f((TI,Iu)=>{var RS=we(),us=class extends RS{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Iu.exports=us;});var Ru=f((kI,Mu)=>{var FS=we(),ds=class extends FS{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};Mu.exports=ds;});var Lu=f((AI,Fu)=>{var LS=we(),hs=class extends LS{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Fu.exports=hs;});var ju=f((DI,qu)=>{var qS=we(),ps=class extends qS{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};qu.exports=ps;});var Bu=f((PI,Nu)=>{Nu.exports={DatePart:we(),Meridiem:Cu(),Day:Tu(),Hours:Au(),Milliseconds:Pu(),Minutes:$u(),Month:Ru(),Seconds:Lu(),Year:ju()};});var Zu=f((II,Ku)=>{function Uu(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function Gu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){Uu(s,i,n,o,a,"next",c);}function a(c){Uu(s,i,n,o,a,"throw",c);}o(void 0);})}}var fs=L(),jS=Fe(),gs=de(),Vu=gs.style,Wu=gs.clear,NS=gs.figures,Ju=q(),BS=Ju.erase,Hu=Ju.cursor,qe=Bu(),zu=qe.DatePart,US=qe.Meridiem,GS=qe.Day,VS=qe.Hours,WS=qe.Milliseconds,HS=qe.Minutes,zS=qe.Month,YS=qe.Seconds,JS=qe.Year,KS=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Yu={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new GS(t),3:t=>new zS(t),4:t=>new JS(t),5:t=>new US(t),6:t=>new VS(t),7:t=>new HS(t),8:t=>new YS(t),9:t=>new WS(t)},ZS={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},ms=class extends jS{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(ZS,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Wu("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=KS.exec(e);){let n=r.shift(),s=r.findIndex(o=>o!=null);this.parts.push(s in Yu?Yu[s]({token:r[s]||n,date:this.date,parts:this.parts,locales:this.locales}):r[s]||n);}let i=this.parts.reduce((n,s)=>(typeof s=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=s:n.push(s),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof zu)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
23
- `),this.close();}validate(){var e=this;return Gu(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return Gu(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
24
- `),e.close();})()}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof zu)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(Hu.hide):this.out.write(Wu(this.outputText,this.out.columns)),super.render(),this.outputText=[Vu.symbol(this.done,this.aborted),fs.bold(this.msg),Vu.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?fs.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
22
+ `),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(yu.hide):this.out.write(kS(this.outputText,this.out.columns)),super.render(),this.outputText=[gu.symbol(this.done,this.aborted),ni.bold(this.msg),gu.delimiter(this.done),this.value?this.inactive:ni.cyan().underline(this.inactive),ni.gray("/"),this.value?ni.cyan().underline(this.active):this.active].join(" "),this.out.write(AS.line+yu.to(0)+this.outputText));}};xu.exports=is;});var we=f((vI,vu)=>{var ns=class t{constructor({token:e,date:r,parts:i,locales:n}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=n||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,n)=>n>r&&i instanceof t)}toString(){return String(this.date)}};vu.exports=ns;});var Eu=f((OI,Ou)=>{var DS=we(),ss=class extends DS{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};Ou.exports=ss;});var _u=f((EI,Cu)=>{var PS=we(),IS=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),os=class extends PS{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+IS(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};Cu.exports=os;});var ku=f((CI,Tu)=>{var $S=we(),as=class extends $S{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Tu.exports=as;});var Du=f((_I,Au)=>{var MS=we(),cs=class extends MS{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Au.exports=cs;});var Iu=f((TI,Pu)=>{var RS=we(),ls=class extends RS{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Pu.exports=ls;});var Mu=f((kI,$u)=>{var FS=we(),us=class extends FS{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};$u.exports=us;});var Fu=f((AI,Ru)=>{var LS=we(),ds=class extends LS{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Ru.exports=ds;});var qu=f((DI,Lu)=>{var qS=we(),hs=class extends qS{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Lu.exports=hs;});var Nu=f((PI,ju)=>{ju.exports={DatePart:we(),Meridiem:Eu(),Day:_u(),Hours:ku(),Milliseconds:Du(),Minutes:Iu(),Month:Mu(),Seconds:Fu(),Year:qu()};});var Ku=f((II,Ju)=>{function Bu(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function Uu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){Bu(s,i,n,o,a,"next",c);}function a(c){Bu(s,i,n,o,a,"throw",c);}o(void 0);})}}var ps=L(),jS=Fe(),ms=de(),Gu=ms.style,Vu=ms.clear,NS=ms.figures,Yu=q(),BS=Yu.erase,Wu=Yu.cursor,qe=Nu(),Hu=qe.DatePart,US=qe.Meridiem,GS=qe.Day,VS=qe.Hours,WS=qe.Milliseconds,HS=qe.Minutes,zS=qe.Month,YS=qe.Seconds,JS=qe.Year,KS=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,zu={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new GS(t),3:t=>new zS(t),4:t=>new JS(t),5:t=>new US(t),6:t=>new VS(t),7:t=>new HS(t),8:t=>new YS(t),9:t=>new WS(t)},ZS={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},fs=class extends jS{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(ZS,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Vu("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=KS.exec(e);){let n=r.shift(),s=r.findIndex(o=>o!=null);this.parts.push(s in zu?zu[s]({token:r[s]||n,date:this.date,parts:this.parts,locales:this.locales}):r[s]||n);}let i=this.parts.reduce((n,s)=>(typeof s=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=s:n.push(s),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Hu)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
23
+ `),this.close();}validate(){var e=this;return Uu(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return Uu(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
24
+ `),e.close();})()}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof Hu)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(Wu.hide):this.out.write(Vu(this.outputText,this.out.columns)),super.render(),this.outputText=[Gu.symbol(this.done,this.aborted),ps.bold(this.msg),Gu.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?ps.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
25
25
  `).reduce((e,r,i)=>e+`
26
- ${i?" ":NS.pointerSmall} ${fs.red().italic(r)}`,"")),this.out.write(BS.line+Hu.to(0)+this.outputText));}};Ku.exports=ms;});var nd=f(($I,id)=>{function Xu(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function Qu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){Xu(s,i,n,o,a,"next",c);}function a(c){Xu(s,i,n,o,a,"throw",c);}o(void 0);})}}var si=L(),XS=Fe(),rd=q(),oi=rd.cursor,QS=rd.erase,ai=de(),ys=ai.style,ev=ai.figures,ed=ai.clear,tv=ai.lines,rv=/[0-9]/,bs=t=>t!==void 0,td=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},ws=class extends XS{constructor(e={}){super(e),this.transform=ys.render(e.style),this.msg=e.message,this.initial=bs(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=bs(e.min)?e.min:-1/0,this.max=bs(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=si.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${td(e,this.round)}`),this._value=td(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||rv.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
27
- `),this.close();}validate(){var e=this;return Qu(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return Qu(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=true,e.aborted=false,e.error=false,e.fire(),e.render(),e.out.write(`
28
- `),e.close();})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(oi.down(tv(this.outputError,this.out.columns)-1)+ed(this.outputError,this.out.columns)),this.out.write(ed(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ys.symbol(this.done,this.aborted),si.bold(this.msg),ys.delimiter(this.done),!this.done||!this.done&&!this.placeholder?si[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
26
+ ${i?" ":NS.pointerSmall} ${ps.red().italic(r)}`,"")),this.out.write(BS.line+Wu.to(0)+this.outputText));}};Ju.exports=fs;});var id=f(($I,rd)=>{function Zu(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function Xu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){Zu(s,i,n,o,a,"next",c);}function a(c){Zu(s,i,n,o,a,"throw",c);}o(void 0);})}}var si=L(),XS=Fe(),td=q(),oi=td.cursor,QS=td.erase,ai=de(),gs=ai.style,ev=ai.figures,Qu=ai.clear,tv=ai.lines,rv=/[0-9]/,ys=t=>t!==void 0,ed=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},bs=class extends XS{constructor(e={}){super(e),this.transform=gs.render(e.style),this.msg=e.message,this.initial=ys(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=ys(e.min)?e.min:-1/0,this.max=ys(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=si.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${ed(e,this.round)}`),this._value=ed(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||rv.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
27
+ `),this.close();}validate(){var e=this;return Xu(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return Xu(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=true,e.aborted=false,e.error=false,e.fire(),e.render(),e.out.write(`
28
+ `),e.close();})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(oi.down(tv(this.outputError,this.out.columns)-1)+Qu(this.outputError,this.out.columns)),this.out.write(Qu(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[gs.symbol(this.done,this.aborted),si.bold(this.msg),gs.delimiter(this.done),!this.done||!this.done&&!this.placeholder?si[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
29
29
  `).reduce((e,r,i)=>e+`
30
- ${i?" ":ev.pointerSmall} ${si.red().italic(r)}`,"")),this.out.write(QS.line+oi.to(0)+this.outputText+oi.save+this.outputError+oi.restore));}};id.exports=ws;});var Ss=f((MI,ad)=>{var xe=L(),iv=q(),nv=iv.cursor,sv=Fe(),pr=de(),sd=pr.clear,tt=pr.figures,od=pr.style,ov=pr.wrap,av=pr.entriesToDisplay,xs=class extends sv{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=sd("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
30
+ ${i?" ":ev.pointerSmall} ${si.red().italic(r)}`,"")),this.out.write(QS.line+oi.to(0)+this.outputText+oi.save+this.outputError+oi.restore));}};rd.exports=bs;});var xs=f((MI,od)=>{var xe=L(),iv=q(),nv=iv.cursor,sv=Fe(),pr=de(),nd=pr.clear,tt=pr.figures,sd=pr.style,ov=pr.wrap,av=pr.entriesToDisplay,ws=class extends sv{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=nd("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
31
31
  `),this.close();}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=true,this.render()):(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
32
32
  `),this.close());}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.value.length,this.render();}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render();}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.value[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true,this.render();}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render();}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
33
33
  Instructions:
@@ -37,13 +37,13 @@ Instructions:
37
37
  `:"")+" enter/return: Complete answer":""}renderOption(e,r,i,n){let s=(r.selected?xe.green(tt.radioOn):tt.radioOff)+" "+n+" ",o,a;return r.disabled?o=e===i?xe.gray().underline(r.title):xe.strikethrough().gray(r.title):(o=e===i?xe.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(s.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
38
38
  `+ov(r.description,{margin:s.length,width:this.out.columns})))),s+o+xe.gray(a||"")}paginateOptions(e){if(e.length===0)return xe.red("No matches for this query.");let r=av(this.cursor,e.length,this.optionsPerPage),i=r.startIndex,n=r.endIndex,s,o=[];for(let a=i;a<n;a++)a===i&&i>0?s=tt.arrowUp:a===n-1&&n<e.length?s=tt.arrowDown:s=" ",o.push(this.renderOption(this.cursor,e[a],a,s));return `
39
39
  `+o.join(`
40
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[xe.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(xe.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(nv.hide),super.render();let e=[od.symbol(this.done,this.aborted),xe.bold(this.msg),od.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=xe.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=sd(e,this.out.columns);}};ad.exports=xs;});var fd=f((RI,pd)=>{function cd(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function cv(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){cd(s,i,n,o,a,"next",c);}function a(c){cd(s,i,n,o,a,"throw",c);}o(void 0);})}}var fr=L(),lv=Fe(),hd=q(),uv=hd.erase,ld=hd.cursor,mr=de(),vs=mr.style,ud=mr.clear,Es=mr.figures,dv=mr.wrap,hv=mr.entriesToDisplay,dd=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),pv=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),fv=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},Os=class extends lv{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:fv(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=vs.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=ud("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=dd(this.suggestions,e):this.value=this.fallback.value,this.fire();}complete(e){var r=this;return cv(function*(){let i=r.completing=r.suggest(r.input,r.choices),n=yield i;if(r.completing!==i)return;r.suggestions=n.map((o,a,c)=>({title:pv(c,a),value:dd(c,a),description:o.description})),r.completing=false;let s=Math.max(n.length-1,0);r.moveSelect(Math.min(s,r.select)),e&&e();})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
40
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[xe.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(xe.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(nv.hide),super.render();let e=[sd.symbol(this.done,this.aborted),xe.bold(this.msg),sd.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=xe.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=nd(e,this.out.columns);}};od.exports=ws;});var pd=f((RI,hd)=>{function ad(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function cv(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){ad(s,i,n,o,a,"next",c);}function a(c){ad(s,i,n,o,a,"throw",c);}o(void 0);})}}var fr=L(),lv=Fe(),dd=q(),uv=dd.erase,cd=dd.cursor,mr=de(),Ss=mr.style,ld=mr.clear,vs=mr.figures,dv=mr.wrap,hv=mr.entriesToDisplay,ud=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),pv=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),fv=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},Os=class extends lv{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:fv(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=Ss.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=ld("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=ud(this.suggestions,e):this.value=this.fallback.value,this.fire();}complete(e){var r=this;return cv(function*(){let i=r.completing=r.suggest(r.input,r.choices),n=yield i;if(r.completing!==i)return;r.suggestions=n.map((o,a,c)=>({title:pv(c,a),value:ud(c,a),description:o.description})),r.completing=false;let s=Math.max(n.length-1,0);r.moveSelect(Math.min(s,r.select)),e&&e();})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
41
41
  `),this.close());}abort(){this.done=this.aborted=true,this.exited=false,this.fire(),this.render(),this.out.write(`
42
42
  `),this.close();}submit(){this.done=true,this.aborted=this.exited=false,this.fire(),this.render(),this.out.write(`
43
- `),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${e}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,n){let s,o=i?Es.arrowUp:n?Es.arrowDown:" ",a=r?fr.cyan().underline(e.title):e.title;return o=(r?fr.cyan(Es.pointer)+" ":" ")+o,e.description&&(s=` - ${e.description}`,(o.length+a.length+s.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(s=`
44
- `+dv(e.description,{margin:3,width:this.out.columns}))),o+" "+a+fr.gray(s||"")}render(){if(this.closed)return;this.firstRender?this.out.write(ld.hide):this.out.write(ud(this.outputText,this.out.columns)),super.render();let e=hv(this.select,this.choices.length,this.limit),r=e.startIndex,i=e.endIndex;if(this.outputText=[vs.symbol(this.done,this.aborted,this.exited),fr.bold(this.msg),vs.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(r,i).map((s,o)=>this.renderOption(s,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length)).join(`
43
+ `),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${e}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,n){let s,o=i?vs.arrowUp:n?vs.arrowDown:" ",a=r?fr.cyan().underline(e.title):e.title;return o=(r?fr.cyan(vs.pointer)+" ":" ")+o,e.description&&(s=` - ${e.description}`,(o.length+a.length+s.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(s=`
44
+ `+dv(e.description,{margin:3,width:this.out.columns}))),o+" "+a+fr.gray(s||"")}render(){if(this.closed)return;this.firstRender?this.out.write(cd.hide):this.out.write(ld(this.outputText,this.out.columns)),super.render();let e=hv(this.select,this.choices.length,this.limit),r=e.startIndex,i=e.endIndex;if(this.outputText=[Ss.symbol(this.done,this.aborted,this.exited),fr.bold(this.msg),Ss.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(r,i).map((s,o)=>this.renderOption(s,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length)).join(`
45
45
  `);this.outputText+=`
46
- `+(n||fr.gray(this.fallback.title));}this.out.write(uv.line+ld.to(0)+this.outputText);}};pd.exports=Os;});var bd=f((FI,yd)=>{var je=L(),mv=q(),gv=mv.cursor,yv=Ss(),_s=de(),md=_s.clear,gd=_s.style,Rt=_s.figures,Cs=class extends yv{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=md("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
46
+ `+(n||fr.gray(this.fallback.title));}this.out.write(uv.line+cd.to(0)+this.outputText);}};hd.exports=Os;});var yd=f((FI,gd)=>{var je=L(),mv=q(),gv=mv.cursor,yv=xs(),Cs=de(),fd=Cs.clear,md=Cs.style,Rt=Cs.figures,Es=class extends yv{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=fd("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
47
47
  Instructions:
48
48
  ${Rt.arrowUp}/${Rt.arrowDown}: Highlight option
49
49
  ${Rt.arrowLeft}/${Rt.arrowRight}/[space]: Toggle selection
@@ -51,47 +51,47 @@ Instructions:
51
51
  enter/return: Complete answer
52
52
  `:""}renderCurrentInput(){return `
53
53
  Filtered results for: ${this.inputValue?this.inputValue:je.gray("Enter something to filter")}
54
- `}renderOption(e,r,i){let n;return r.disabled?n=e===i?je.gray().underline(r.title):je.strikethrough().gray(r.title):n=e===i?je.cyan().underline(r.title):r.title,(r.selected?je.green(Rt.radioOn):Rt.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[je.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(je.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(gv.hide),super.render();let e=[gd.symbol(this.done,this.aborted),je.bold(this.msg),gd.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=je.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=md(e,this.out.columns);}};yd.exports=Cs;});var Cd=f((LI,Od)=>{var wd=L(),bv=Fe(),vd=de(),xd=vd.style,wv=vd.clear,Ed=q(),xv=Ed.erase,Sd=Ed.cursor,Ts=class extends bv{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
54
+ `}renderOption(e,r,i){let n;return r.disabled?n=e===i?je.gray().underline(r.title):je.strikethrough().gray(r.title):n=e===i?je.cyan().underline(r.title):r.title,(r.selected?je.green(Rt.radioOn):Rt.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[je.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(je.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(gv.hide),super.render();let e=[md.symbol(this.done,this.aborted),je.bold(this.msg),md.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=je.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=fd(e,this.out.columns);}};gd.exports=Es;});var Ed=f((LI,Od)=>{var bd=L(),bv=Fe(),Sd=de(),wd=Sd.style,wv=Sd.clear,vd=q(),xv=vd.erase,xd=vd.cursor,_s=class extends bv{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
55
55
  `),this.close();}submit(){this.value=this.value||false,this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
56
- `),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Sd.hide):this.out.write(wv(this.outputText,this.out.columns)),super.render(),this.outputText=[xd.symbol(this.done,this.aborted),wd.bold(this.msg),xd.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:wd.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(xv.line+Sd.to(0)+this.outputText));}};Od.exports=Ts;});var Td=f((qI,_d)=>{_d.exports={TextPrompt:hu(),SelectPrompt:gu(),TogglePrompt:vu(),DatePrompt:Zu(),NumberPrompt:nd(),MultiselectPrompt:Ss(),AutocompletePrompt:fd(),AutocompleteMultiselectPrompt:bd(),ConfirmPrompt:Cd()};});var Ad=f(kd=>{var re=kd,Sv=Td(),ci=t=>t;function Se(t,e,r={}){return new Promise((i,n)=>{let s=new Sv[t](e),o=r.onAbort||ci,a=r.onSubmit||ci,c=r.onExit||ci;s.on("state",e.onState||ci),s.on("submit",u=>i(a(u))),s.on("exit",u=>i(c(u))),s.on("abort",u=>n(o(u)));})}re.text=t=>Se("TextPrompt",t);re.password=t=>(t.style="password",re.text(t));re.invisible=t=>(t.style="invisible",re.text(t));re.number=t=>Se("NumberPrompt",t);re.date=t=>Se("DatePrompt",t);re.confirm=t=>Se("ConfirmPrompt",t);re.list=t=>{let e=t.separator||",";return Se("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};re.toggle=t=>Se("TogglePrompt",t);re.select=t=>Se("SelectPrompt",t);re.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Se("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};re.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Se("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var vv=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));re.autocomplete=t=>(t.suggest=t.suggest||vv,t.choices=[].concat(t.choices||[]),Se("AutocompletePrompt",t));});var Ld=f((NI,Fd)=>{function Dd(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i);}return r}function Pd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Dd(Object(r),true).forEach(function(i){Ev(t,i,r[i]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dd(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i));});}return t}function Ev(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true}):t[e]=r,t}function Ov(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Cv(t))||e){r&&(t=r);var i=0,n=function(){};return {s:n,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
57
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=true,o=false,a;return {s:function(){r=r.call(t);},n:function(){var u=r.next();return s=u.done,u},e:function(u){o=true,a=u;},f:function(){try{!s&&r.return!=null&&r.return();}finally{if(o)throw a}}}}function Cv(t,e){if(t){if(typeof t=="string")return Id(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Id(t,e)}}function Id(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function $d(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function Md(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){$d(s,i,n,o,a,"next",c);}function a(c){$d(s,i,n,o,a,"throw",c);}o(void 0);})}}var ks=Ad(),_v=["suggest","format","onState","validate","onRender","type"],Rd=()=>{};function rt(){return As.apply(this,arguments)}function As(){return As=Md(function*(t=[],{onSubmit:e=Rd,onCancel:r=Rd}={}){let i={},n=rt._override||{};t=[].concat(t);let s,o,a,c,u,l,d=(function(){var w=Md(function*(b,S,_=false){if(!(!_&&b.validate&&b.validate(S)!==true))return b.format?yield b.format(S,i):S});return function(S,_){return w.apply(this,arguments)}})();var h=Ov(t),p;try{for(h.s();!(p=h.n()).done;){o=p.value;var m=o;if(c=m.name,u=m.type,typeof u=="function"&&(u=yield u(s,Pd({},i),o),o.type=u),!!u){for(let w in o){if(_v.includes(w))continue;let b=o[w];o[w]=typeof b=="function"?yield b(s,Pd({},i),l):b;}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");var y=o;if(c=y.name,u=y.type,ks[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(n[o.name]!==void 0&&(s=yield d(o,n[o.name]),s!==void 0)){i[c]=s;continue}try{s=rt._injected?Tv(rt._injected,o.initial):yield ks[u](o),i[c]=s=yield d(o,s,!0),a=yield e(o,s,i);}catch{a=!(yield r(o,i));}if(a)return i}}}catch(w){h.e(w);}finally{h.f();}return i}),As.apply(this,arguments)}function Tv(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function kv(t){rt._injected=(rt._injected||[]).concat(t);}function Av(t){rt._override=Object.assign({},t);}Fd.exports=Object.assign(rt,{prompt:rt,prompts:ks,inject:kv,override:Av});});var jd=f((BI,qd)=>{qd.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var li=f((UI,Nd)=>{Nd.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var Gd=f((GI,Ud)=>{var Dv=li(),{erase:Bd,cursor:Pv}=q(),Iv=t=>[...Dv(t)].length;Ud.exports=function(t,e){if(!e)return Bd.line+Pv.to(0);let r=0,i=t.split(/\r?\n/);for(let n of i)r+=1+Math.floor(Math.max(Iv(n)-1,0)/e);return Bd.lines(r)};});var Ds=f((VI,Vd)=>{var gr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},$v={arrowUp:gr.arrowUp,arrowDown:gr.arrowDown,arrowLeft:gr.arrowLeft,arrowRight:gr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Mv=process.platform==="win32"?$v:gr;Vd.exports=Mv;});var Hd=f((WI,Wd)=>{var Ft=L(),ft=Ds(),Ps=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),Rv=t=>Ps[t]||Ps.default,yr=Object.freeze({aborted:Ft.red(ft.cross),done:Ft.green(ft.tick),exited:Ft.yellow(ft.cross),default:Ft.cyan("?")}),Fv=(t,e,r)=>e?yr.aborted:r?yr.exited:t?yr.done:yr.default,Lv=t=>Ft.gray(t?ft.ellipsis:ft.pointerSmall),qv=(t,e)=>Ft.gray(t?e?ft.pointerSmall:"+":ft.line);Wd.exports={styles:Ps,render:Rv,symbols:yr,symbol:Fv,delimiter:Lv,item:qv};});var Yd=f((HI,zd)=>{var jv=li();zd.exports=function(t,e){let r=String(jv(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,n)=>i+n):r.length};});var Kd=f((zI,Jd)=>{Jd.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((s,o)=>(o.length+r.length>=i||s[s.length-1].length+o.length+1<i?s[s.length-1]+=` ${o}`:s.push(`${r}${o}`),s),[r]).join(`
56
+ `),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(xd.hide):this.out.write(wv(this.outputText,this.out.columns)),super.render(),this.outputText=[wd.symbol(this.done,this.aborted),bd.bold(this.msg),wd.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:bd.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(xv.line+xd.to(0)+this.outputText));}};Od.exports=_s;});var _d=f((qI,Cd)=>{Cd.exports={TextPrompt:du(),SelectPrompt:mu(),TogglePrompt:Su(),DatePrompt:Ku(),NumberPrompt:id(),MultiselectPrompt:xs(),AutocompletePrompt:pd(),AutocompleteMultiselectPrompt:yd(),ConfirmPrompt:Ed()};});var kd=f(Td=>{var re=Td,Sv=_d(),ci=t=>t;function Se(t,e,r={}){return new Promise((i,n)=>{let s=new Sv[t](e),o=r.onAbort||ci,a=r.onSubmit||ci,c=r.onExit||ci;s.on("state",e.onState||ci),s.on("submit",u=>i(a(u))),s.on("exit",u=>i(c(u))),s.on("abort",u=>n(o(u)));})}re.text=t=>Se("TextPrompt",t);re.password=t=>(t.style="password",re.text(t));re.invisible=t=>(t.style="invisible",re.text(t));re.number=t=>Se("NumberPrompt",t);re.date=t=>Se("DatePrompt",t);re.confirm=t=>Se("ConfirmPrompt",t);re.list=t=>{let e=t.separator||",";return Se("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};re.toggle=t=>Se("TogglePrompt",t);re.select=t=>Se("SelectPrompt",t);re.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Se("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};re.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Se("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var vv=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));re.autocomplete=t=>(t.suggest=t.suggest||vv,t.choices=[].concat(t.choices||[]),Se("AutocompletePrompt",t));});var Fd=f((NI,Rd)=>{function Ad(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i);}return r}function Dd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ad(Object(r),true).forEach(function(i){Ov(t,i,r[i]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ad(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i));});}return t}function Ov(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true}):t[e]=r,t}function Ev(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Cv(t))||e){r&&(t=r);var i=0,n=function(){};return {s:n,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
57
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=true,o=false,a;return {s:function(){r=r.call(t);},n:function(){var u=r.next();return s=u.done,u},e:function(u){o=true,a=u;},f:function(){try{!s&&r.return!=null&&r.return();}finally{if(o)throw a}}}}function Cv(t,e){if(t){if(typeof t=="string")return Pd(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pd(t,e)}}function Pd(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Id(t,e,r,i,n,s,o){try{var a=t[s](o),c=a.value;}catch(u){r(u);return}a.done?e(c):Promise.resolve(c).then(i,n);}function $d(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(c){Id(s,i,n,o,a,"next",c);}function a(c){Id(s,i,n,o,a,"throw",c);}o(void 0);})}}var Ts=kd(),_v=["suggest","format","onState","validate","onRender","type"],Md=()=>{};function rt(){return ks.apply(this,arguments)}function ks(){return ks=$d(function*(t=[],{onSubmit:e=Md,onCancel:r=Md}={}){let i={},n=rt._override||{};t=[].concat(t);let s,o,a,c,u,l,d=(function(){var w=$d(function*(b,S,_=false){if(!(!_&&b.validate&&b.validate(S)!==true))return b.format?yield b.format(S,i):S});return function(S,_){return w.apply(this,arguments)}})();var h=Ev(t),p;try{for(h.s();!(p=h.n()).done;){o=p.value;var m=o;if(c=m.name,u=m.type,typeof u=="function"&&(u=yield u(s,Dd({},i),o),o.type=u),!!u){for(let w in o){if(_v.includes(w))continue;let b=o[w];o[w]=typeof b=="function"?yield b(s,Dd({},i),l):b;}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");var y=o;if(c=y.name,u=y.type,Ts[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(n[o.name]!==void 0&&(s=yield d(o,n[o.name]),s!==void 0)){i[c]=s;continue}try{s=rt._injected?Tv(rt._injected,o.initial):yield Ts[u](o),i[c]=s=yield d(o,s,!0),a=yield e(o,s,i);}catch{a=!(yield r(o,i));}if(a)return i}}}catch(w){h.e(w);}finally{h.f();}return i}),ks.apply(this,arguments)}function Tv(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function kv(t){rt._injected=(rt._injected||[]).concat(t);}function Av(t){rt._override=Object.assign({},t);}Rd.exports=Object.assign(rt,{prompt:rt,prompts:Ts,inject:kv,override:Av});});var qd=f((BI,Ld)=>{Ld.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var li=f((UI,jd)=>{jd.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var Ud=f((GI,Bd)=>{var Dv=li(),{erase:Nd,cursor:Pv}=q(),Iv=t=>[...Dv(t)].length;Bd.exports=function(t,e){if(!e)return Nd.line+Pv.to(0);let r=0,i=t.split(/\r?\n/);for(let n of i)r+=1+Math.floor(Math.max(Iv(n)-1,0)/e);return Nd.lines(r)};});var As=f((VI,Gd)=>{var gr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},$v={arrowUp:gr.arrowUp,arrowDown:gr.arrowDown,arrowLeft:gr.arrowLeft,arrowRight:gr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Mv=process.platform==="win32"?$v:gr;Gd.exports=Mv;});var Wd=f((WI,Vd)=>{var Ft=L(),ft=As(),Ds=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),Rv=t=>Ds[t]||Ds.default,yr=Object.freeze({aborted:Ft.red(ft.cross),done:Ft.green(ft.tick),exited:Ft.yellow(ft.cross),default:Ft.cyan("?")}),Fv=(t,e,r)=>e?yr.aborted:r?yr.exited:t?yr.done:yr.default,Lv=t=>Ft.gray(t?ft.ellipsis:ft.pointerSmall),qv=(t,e)=>Ft.gray(t?e?ft.pointerSmall:"+":ft.line);Vd.exports={styles:Ds,render:Rv,symbols:yr,symbol:Fv,delimiter:Lv,item:qv};});var zd=f((HI,Hd)=>{var jv=li();Hd.exports=function(t,e){let r=String(jv(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,n)=>i+n):r.length};});var Jd=f((zI,Yd)=>{Yd.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((s,o)=>(o.length+r.length>=i||s[s.length-1].length+o.length+1<i?s[s.length-1]+=` ${o}`:s.push(`${r}${o}`),s),[r]).join(`
58
58
  `)).join(`
59
- `)};});var Xd=f((YI,Zd)=>{Zd.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,e);return {startIndex:i,endIndex:n}};});var he=f((JI,Qd)=>{Qd.exports={action:jd(),clear:Gd(),style:Hd(),strip:li(),figures:Ds(),lines:Yd(),wrap:Kd(),entriesToDisplay:Xd()};});var Ne=f((KI,th)=>{var eh=A("readline"),{action:Nv}=he(),Bv=A("events"),{beep:Uv,cursor:Gv}=q(),Vv=L(),Is=class extends Bv{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=eh.createInterface({input:this.in,escapeCodeTimeout:50});eh.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(s,o)=>{let a=Nv(o,i);a===false?this._&&this._(s,o):typeof this[a]=="function"?this[a](o):this.bell();};this.close=()=>{this.out.write(Gv.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",n);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(Uv);}render(){this.onRender(Vv),this.firstRender&&(this.firstRender=false);}};th.exports=Is;});var ih=f((ZI,rh)=>{var ui=L(),Wv=Ne(),{erase:Hv,cursor:br}=q(),{style:$s,clear:Ms,lines:zv,figures:Yv}=he(),Rs=class extends Wv{constructor(e={}){super(e),this.transform=$s.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=Ms("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=ui.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
59
+ `)};});var Zd=f((YI,Kd)=>{Kd.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,e);return {startIndex:i,endIndex:n}};});var he=f((JI,Xd)=>{Xd.exports={action:qd(),clear:Ud(),style:Wd(),strip:li(),figures:As(),lines:zd(),wrap:Jd(),entriesToDisplay:Zd()};});var Ne=f((KI,eh)=>{var Qd=A("readline"),{action:Nv}=he(),Bv=A("events"),{beep:Uv,cursor:Gv}=q(),Vv=L(),Ps=class extends Bv{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=Qd.createInterface({input:this.in,escapeCodeTimeout:50});Qd.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(s,o)=>{let a=Nv(o,i);a===false?this._&&this._(s,o):typeof this[a]=="function"?this[a](o):this.bell();};this.close=()=>{this.out.write(Gv.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",n);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(Uv);}render(){this.onRender(Vv),this.firstRender&&(this.firstRender=false);}};eh.exports=Ps;});var rh=f((ZI,th)=>{var ui=L(),Wv=Ne(),{erase:Hv,cursor:br}=q(),{style:Is,clear:$s,lines:zv,figures:Yv}=he(),Ms=class extends Wv{constructor(e={}){super(e),this.transform=Is.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=$s("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=ui.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
60
60
  `),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=true,this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
61
- `),this.close();}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${e}${n}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(br.down(zv(this.outputError,this.out.columns)-1)+Ms(this.outputError,this.out.columns)),this.out.write(Ms(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[$s.symbol(this.done,this.aborted),ui.bold(this.msg),$s.delimiter(this.done),this.red?ui.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
61
+ `),this.close();}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${e}${n}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(br.down(zv(this.outputError,this.out.columns)-1)+$s(this.outputError,this.out.columns)),this.out.write($s(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Is.symbol(this.done,this.aborted),ui.bold(this.msg),Is.delimiter(this.done),this.red?ui.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
62
62
  `).reduce((e,r,i)=>e+`
63
- ${i?" ":Yv.pointerSmall} ${ui.red().italic(r)}`,"")),this.out.write(Hv.line+br.to(0)+this.outputText+br.save+this.outputError+br.restore+br.move(this.cursorOffset,0)));}};rh.exports=Rs;});var ah=f((XI,oh)=>{var Be=L(),Jv=Ne(),{style:nh,clear:sh,figures:di,wrap:Kv,entriesToDisplay:Zv}=he(),{cursor:Xv}=q(),Fs=class extends Jv{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=sh("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
63
+ ${i?" ":Yv.pointerSmall} ${ui.red().italic(r)}`,"")),this.out.write(Hv.line+br.to(0)+this.outputText+br.save+this.outputError+br.restore+br.move(this.cursorOffset,0)));}};th.exports=Ms;});var oh=f((XI,sh)=>{var Be=L(),Jv=Ne(),{style:ih,clear:nh,figures:di,wrap:Kv,entriesToDisplay:Zv}=he(),{cursor:Xv}=q(),Rs=class extends Jv{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=nh("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
64
64
  `),this.close();}submit(){this.selection.disabled?this.bell():(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
65
- `),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Xv.hide):this.out.write(sh(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Zv(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[nh.symbol(this.done,this.aborted),Be.bold(this.msg),nh.delimiter(false),this.done?this.selection.title:this.selection.disabled?Be.yellow(this.warn):Be.gray(this.hint)].join(" "),!this.done){this.outputText+=`
65
+ `),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Xv.hide):this.out.write(nh(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Zv(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[ih.symbol(this.done,this.aborted),Be.bold(this.msg),ih.delimiter(false),this.done?this.selection.title:this.selection.disabled?Be.yellow(this.warn):Be.gray(this.hint)].join(" "),!this.done){this.outputText+=`
66
66
  `;for(let i=e;i<r;i++){let n,s,o="",a=this.choices[i];i===e&&e>0?s=di.arrowUp:i===r-1&&r<this.choices.length?s=di.arrowDown:s=" ",a.disabled?(n=this.cursor===i?Be.gray().underline(a.title):Be.strikethrough().gray(a.title),s=(this.cursor===i?Be.bold().gray(di.pointer)+" ":" ")+s):(n=this.cursor===i?Be.cyan().underline(a.title):a.title,s=(this.cursor===i?Be.cyan(di.pointer)+" ":" ")+s,a.description&&this.cursor===i&&(o=` - ${a.description}`,(s.length+n.length+o.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(o=`
67
67
  `+Kv(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${n}${Be.gray(o)}
68
- `;}}this.out.write(this.outputText);}};oh.exports=Fs;});var dh=f((QI,uh)=>{var hi=L(),Qv=Ne(),{style:ch,clear:e0}=he(),{cursor:lh,erase:t0}=q(),Ls=class extends Qv{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
68
+ `;}}this.out.write(this.outputText);}};sh.exports=Rs;});var uh=f((QI,lh)=>{var hi=L(),Qv=Ne(),{style:ah,clear:e0}=he(),{cursor:ch,erase:t0}=q(),Fs=class extends Qv{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
69
69
  `),this.close();}submit(){this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
70
- `),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(lh.hide):this.out.write(e0(this.outputText,this.out.columns)),super.render(),this.outputText=[ch.symbol(this.done,this.aborted),hi.bold(this.msg),ch.delimiter(this.done),this.value?this.inactive:hi.cyan().underline(this.inactive),hi.gray("/"),this.value?hi.cyan().underline(this.active):this.active].join(" "),this.out.write(t0.line+lh.to(0)+this.outputText));}};uh.exports=Ls;});var ve=f((e1,hh)=>{var qs=class t{constructor({token:e,date:r,parts:i,locales:n}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=n||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,n)=>n>r&&i instanceof t)}toString(){return String(this.date)}};hh.exports=qs;});var fh=f((t1,ph)=>{var r0=ve(),js=class extends r0{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};ph.exports=js;});var gh=f((r1,mh)=>{var i0=ve(),n0=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),Ns=class extends i0{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+n0(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};mh.exports=Ns;});var bh=f((i1,yh)=>{var s0=ve(),Bs=class extends s0{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};yh.exports=Bs;});var xh=f((n1,wh)=>{var o0=ve(),Us=class extends o0{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};wh.exports=Us;});var vh=f((s1,Sh)=>{var a0=ve(),Gs=class extends a0{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Sh.exports=Gs;});var Oh=f((o1,Eh)=>{var c0=ve(),Vs=class extends c0{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};Eh.exports=Vs;});var _h=f((a1,Ch)=>{var l0=ve(),Ws=class extends l0{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Ch.exports=Ws;});var kh=f((c1,Th)=>{var u0=ve(),Hs=class extends u0{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Th.exports=Hs;});var Dh=f((l1,Ah)=>{Ah.exports={DatePart:ve(),Meridiem:fh(),Day:gh(),Hours:bh(),Milliseconds:xh(),Minutes:vh(),Month:Oh(),Seconds:_h(),Year:kh()};});var Lh=f((u1,Fh)=>{var zs=L(),d0=Ne(),{style:Ph,clear:Ih,figures:h0}=he(),{erase:p0,cursor:$h}=q(),{DatePart:Mh,Meridiem:f0,Day:m0,Hours:g0,Milliseconds:y0,Minutes:b0,Month:w0,Seconds:x0,Year:S0}=Dh(),v0=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Rh={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new m0(t),3:t=>new w0(t),4:t=>new S0(t),5:t=>new f0(t),6:t=>new g0(t),7:t=>new b0(t),8:t=>new x0(t),9:t=>new y0(t)},E0={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},Ys=class extends d0{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(E0,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Ih("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=v0.exec(e);){let n=r.shift(),s=r.findIndex(o=>o!=null);this.parts.push(s in Rh?Rh[s]({token:r[s]||n,date:this.date,parts:this.parts,locales:this.locales}):r[s]||n);}let i=this.parts.reduce((n,s)=>(typeof s=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=s:n.push(s),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Mh)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
70
+ `),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(ch.hide):this.out.write(e0(this.outputText,this.out.columns)),super.render(),this.outputText=[ah.symbol(this.done,this.aborted),hi.bold(this.msg),ah.delimiter(this.done),this.value?this.inactive:hi.cyan().underline(this.inactive),hi.gray("/"),this.value?hi.cyan().underline(this.active):this.active].join(" "),this.out.write(t0.line+ch.to(0)+this.outputText));}};lh.exports=Fs;});var ve=f((e1,dh)=>{var Ls=class t{constructor({token:e,date:r,parts:i,locales:n}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=n||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,n)=>n>r&&i instanceof t)}toString(){return String(this.date)}};dh.exports=Ls;});var ph=f((t1,hh)=>{var r0=ve(),qs=class extends r0{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};hh.exports=qs;});var mh=f((r1,fh)=>{var i0=ve(),n0=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),js=class extends i0{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+n0(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};fh.exports=js;});var yh=f((i1,gh)=>{var s0=ve(),Ns=class extends s0{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};gh.exports=Ns;});var wh=f((n1,bh)=>{var o0=ve(),Bs=class extends o0{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};bh.exports=Bs;});var Sh=f((s1,xh)=>{var a0=ve(),Us=class extends a0{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};xh.exports=Us;});var Oh=f((o1,vh)=>{var c0=ve(),Gs=class extends c0{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};vh.exports=Gs;});var Ch=f((a1,Eh)=>{var l0=ve(),Vs=class extends l0{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Eh.exports=Vs;});var Th=f((c1,_h)=>{var u0=ve(),Ws=class extends u0{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};_h.exports=Ws;});var Ah=f((l1,kh)=>{kh.exports={DatePart:ve(),Meridiem:ph(),Day:mh(),Hours:yh(),Milliseconds:wh(),Minutes:Sh(),Month:Oh(),Seconds:Ch(),Year:Th()};});var Fh=f((u1,Rh)=>{var Hs=L(),d0=Ne(),{style:Dh,clear:Ph,figures:h0}=he(),{erase:p0,cursor:Ih}=q(),{DatePart:$h,Meridiem:f0,Day:m0,Hours:g0,Milliseconds:y0,Minutes:b0,Month:w0,Seconds:x0,Year:S0}=Ah(),v0=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Mh={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new m0(t),3:t=>new w0(t),4:t=>new S0(t),5:t=>new f0(t),6:t=>new g0(t),7:t=>new b0(t),8:t=>new x0(t),9:t=>new y0(t)},O0={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},zs=class extends d0{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(O0,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Ph("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=v0.exec(e);){let n=r.shift(),s=r.findIndex(o=>o!=null);this.parts.push(s in Mh?Mh[s]({token:r[s]||n,date:this.date,parts:this.parts,locales:this.locales}):r[s]||n);}let i=this.parts.reduce((n,s)=>(typeof s=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=s:n.push(s),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof $h)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
71
71
  `),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
72
- `),this.close();}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof Mh)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write($h.hide):this.out.write(Ih(this.outputText,this.out.columns)),super.render(),this.outputText=[Ph.symbol(this.done,this.aborted),zs.bold(this.msg),Ph.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?zs.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
72
+ `),this.close();}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof $h)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(Ih.hide):this.out.write(Ph(this.outputText,this.out.columns)),super.render(),this.outputText=[Dh.symbol(this.done,this.aborted),Hs.bold(this.msg),Dh.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?Hs.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
73
73
  `).reduce((e,r,i)=>e+`
74
- ${i?" ":h0.pointerSmall} ${zs.red().italic(r)}`,"")),this.out.write(p0.line+$h.to(0)+this.outputText));}};Fh.exports=Ys;});var Bh=f((d1,Nh)=>{var pi=L(),O0=Ne(),{cursor:fi,erase:C0}=q(),{style:Js,figures:_0,clear:qh,lines:T0}=he(),k0=/[0-9]/,Ks=t=>t!==void 0,jh=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Zs=class extends O0{constructor(e={}){super(e),this.transform=Js.render(e.style),this.msg=e.message,this.initial=Ks(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Ks(e.min)?e.min:-1/0,this.max=Ks(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=pi.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${jh(e,this.round)}`),this._value=jh(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||k0.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
74
+ ${i?" ":h0.pointerSmall} ${Hs.red().italic(r)}`,"")),this.out.write(p0.line+Ih.to(0)+this.outputText));}};Rh.exports=zs;});var Nh=f((d1,jh)=>{var pi=L(),E0=Ne(),{cursor:fi,erase:C0}=q(),{style:Ys,figures:_0,clear:Lh,lines:T0}=he(),k0=/[0-9]/,Js=t=>t!==void 0,qh=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Ks=class extends E0{constructor(e={}){super(e),this.transform=Ys.render(e.style),this.msg=e.message,this.initial=Js(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Js(e.min)?e.min:-1/0,this.max=Js(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=pi.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${qh(e,this.round)}`),this._value=qh(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||k0.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
75
75
  `),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=true,this.aborted=false,this.error=false,this.fire(),this.render(),this.out.write(`
76
- `),this.close();}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(fi.down(T0(this.outputError,this.out.columns)-1)+qh(this.outputError,this.out.columns)),this.out.write(qh(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Js.symbol(this.done,this.aborted),pi.bold(this.msg),Js.delimiter(this.done),!this.done||!this.done&&!this.placeholder?pi[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
76
+ `),this.close();}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(fi.down(T0(this.outputError,this.out.columns)-1)+Lh(this.outputError,this.out.columns)),this.out.write(Lh(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ys.symbol(this.done,this.aborted),pi.bold(this.msg),Ys.delimiter(this.done),!this.done||!this.done&&!this.placeholder?pi[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
77
77
  `).reduce((e,r,i)=>e+`
78
- ${i?" ":_0.pointerSmall} ${pi.red().italic(r)}`,"")),this.out.write(C0.line+fi.to(0)+this.outputText+fi.save+this.outputError+fi.restore));}};Nh.exports=Zs;});var Qs=f((h1,Vh)=>{var Ee=L(),{cursor:A0}=q(),D0=Ne(),{clear:Uh,figures:it,style:Gh,wrap:P0,entriesToDisplay:I0}=he(),Xs=class extends D0{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=Uh("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
78
+ ${i?" ":_0.pointerSmall} ${pi.red().italic(r)}`,"")),this.out.write(C0.line+fi.to(0)+this.outputText+fi.save+this.outputError+fi.restore));}};jh.exports=Ks;});var Xs=f((h1,Gh)=>{var Oe=L(),{cursor:A0}=q(),D0=Ne(),{clear:Bh,figures:it,style:Uh,wrap:P0,entriesToDisplay:I0}=he(),Zs=class extends D0{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=Bh("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
79
79
  `),this.close();}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=true,this.render()):(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
80
80
  `),this.close());}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.value.length,this.render();}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render();}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.value[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true,this.render();}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render();}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
81
81
  Instructions:
82
82
  ${it.arrowUp}/${it.arrowDown}: Highlight option
83
83
  ${it.arrowLeft}/${it.arrowRight}/[space]: Toggle selection
84
84
  `+(this.maxChoices===void 0?` a: Toggle all
85
- `:"")+" enter/return: Complete answer":""}renderOption(e,r,i,n){let s=(r.selected?Ee.green(it.radioOn):it.radioOff)+" "+n+" ",o,a;return r.disabled?o=e===i?Ee.gray().underline(r.title):Ee.strikethrough().gray(r.title):(o=e===i?Ee.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(s.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
86
- `+P0(r.description,{margin:s.length,width:this.out.columns})))),s+o+Ee.gray(a||"")}paginateOptions(e){if(e.length===0)return Ee.red("No matches for this query.");let{startIndex:r,endIndex:i}=I0(this.cursor,e.length,this.optionsPerPage),n,s=[];for(let o=r;o<i;o++)o===r&&r>0?n=it.arrowUp:o===i-1&&i<e.length?n=it.arrowDown:n=" ",s.push(this.renderOption(this.cursor,e[o],o,n));return `
85
+ `:"")+" enter/return: Complete answer":""}renderOption(e,r,i,n){let s=(r.selected?Oe.green(it.radioOn):it.radioOff)+" "+n+" ",o,a;return r.disabled?o=e===i?Oe.gray().underline(r.title):Oe.strikethrough().gray(r.title):(o=e===i?Oe.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(s.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
86
+ `+P0(r.description,{margin:s.length,width:this.out.columns})))),s+o+Oe.gray(a||"")}paginateOptions(e){if(e.length===0)return Oe.red("No matches for this query.");let{startIndex:r,endIndex:i}=I0(this.cursor,e.length,this.optionsPerPage),n,s=[];for(let o=r;o<i;o++)o===r&&r>0?n=it.arrowUp:o===i-1&&i<e.length?n=it.arrowDown:n=" ",s.push(this.renderOption(this.cursor,e[o],o,n));return `
87
87
  `+s.join(`
88
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ee.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Ee.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(A0.hide),super.render();let e=[Gh.symbol(this.done,this.aborted),Ee.bold(this.msg),Gh.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ee.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=Uh(e,this.out.columns);}};Vh.exports=Xs;});var Jh=f((p1,Yh)=>{var wr=L(),$0=Ne(),{erase:M0,cursor:Wh}=q(),{style:eo,clear:Hh,figures:to,wrap:R0,entriesToDisplay:F0}=he(),zh=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),L0=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),q0=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},ro=class extends $0{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:q0(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=eo.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Hh("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=zh(this.suggestions,e):this.value=this.fallback.value,this.fire();}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),i=await r;if(this.completing!==r)return;this.suggestions=i.map((s,o,a)=>({title:L0(a,o),value:zh(a,o),description:s.description})),this.completing=false;let n=Math.max(i.length-1,0);this.moveSelect(Math.min(n,this.select)),e&&e();}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
88
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Oe.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Oe.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(A0.hide),super.render();let e=[Uh.symbol(this.done,this.aborted),Oe.bold(this.msg),Uh.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Oe.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=Bh(e,this.out.columns);}};Gh.exports=Zs;});var Yh=f((p1,zh)=>{var wr=L(),$0=Ne(),{erase:M0,cursor:Vh}=q(),{style:Qs,clear:Wh,figures:eo,wrap:R0,entriesToDisplay:F0}=he(),Hh=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),L0=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),q0=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},to=class extends $0{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:q0(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=Qs.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Wh("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=Hh(this.suggestions,e):this.value=this.fallback.value,this.fire();}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),i=await r;if(this.completing!==r)return;this.suggestions=i.map((s,o,a)=>({title:L0(a,o),value:Hh(a,o),description:s.description})),this.completing=false;let n=Math.max(i.length-1,0);this.moveSelect(Math.min(n,this.select)),e&&e();}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
89
89
  `),this.close());}abort(){this.done=this.aborted=true,this.exited=false,this.fire(),this.render(),this.out.write(`
90
90
  `),this.close();}submit(){this.done=true,this.aborted=this.exited=false,this.fire(),this.render(),this.out.write(`
91
- `),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${e}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,n){let s,o=i?to.arrowUp:n?to.arrowDown:" ",a=r?wr.cyan().underline(e.title):e.title;return o=(r?wr.cyan(to.pointer)+" ":" ")+o,e.description&&(s=` - ${e.description}`,(o.length+a.length+s.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(s=`
92
- `+R0(e.description,{margin:3,width:this.out.columns}))),o+" "+a+wr.gray(s||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Wh.hide):this.out.write(Hh(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=F0(this.select,this.choices.length,this.limit);if(this.outputText=[eo.symbol(this.done,this.aborted,this.exited),wr.bold(this.msg),eo.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(e,r).map((n,s)=>this.renderOption(n,this.select===s+e,s===0&&e>0,s+e===r-1&&r<this.choices.length)).join(`
91
+ `),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${e}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,n){let s,o=i?eo.arrowUp:n?eo.arrowDown:" ",a=r?wr.cyan().underline(e.title):e.title;return o=(r?wr.cyan(eo.pointer)+" ":" ")+o,e.description&&(s=` - ${e.description}`,(o.length+a.length+s.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(s=`
92
+ `+R0(e.description,{margin:3,width:this.out.columns}))),o+" "+a+wr.gray(s||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Vh.hide):this.out.write(Wh(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=F0(this.select,this.choices.length,this.limit);if(this.outputText=[Qs.symbol(this.done,this.aborted,this.exited),wr.bold(this.msg),Qs.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(e,r).map((n,s)=>this.renderOption(n,this.select===s+e,s===0&&e>0,s+e===r-1&&r<this.choices.length)).join(`
93
93
  `);this.outputText+=`
94
- `+(i||wr.gray(this.fallback.title));}this.out.write(M0.line+Wh.to(0)+this.outputText);}};Yh.exports=ro;});var Qh=f((f1,Xh)=>{var Ue=L(),{cursor:j0}=q(),N0=Qs(),{clear:Kh,style:Zh,figures:Lt}=he(),io=class extends N0{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=Kh("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
94
+ `+(i||wr.gray(this.fallback.title));}this.out.write(M0.line+Vh.to(0)+this.outputText);}};zh.exports=to;});var Xh=f((f1,Zh)=>{var Ue=L(),{cursor:j0}=q(),N0=Xs(),{clear:Jh,style:Kh,figures:Lt}=he(),ro=class extends N0{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=Jh("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
95
95
  Instructions:
96
96
  ${Lt.arrowUp}/${Lt.arrowDown}: Highlight option
97
97
  ${Lt.arrowLeft}/${Lt.arrowRight}/[space]: Toggle selection
@@ -99,76 +99,76 @@ Instructions:
99
99
  enter/return: Complete answer
100
100
  `:""}renderCurrentInput(){return `
101
101
  Filtered results for: ${this.inputValue?this.inputValue:Ue.gray("Enter something to filter")}
102
- `}renderOption(e,r,i){let n;return r.disabled?n=e===i?Ue.gray().underline(r.title):Ue.strikethrough().gray(r.title):n=e===i?Ue.cyan().underline(r.title):r.title,(r.selected?Ue.green(Lt.radioOn):Lt.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ue.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Ue.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(j0.hide),super.render();let e=[Zh.symbol(this.done,this.aborted),Ue.bold(this.msg),Zh.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ue.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Kh(e,this.out.columns);}};Xh.exports=io;});var np=f((m1,ip)=>{var ep=L(),B0=Ne(),{style:tp,clear:U0}=he(),{erase:G0,cursor:rp}=q(),no=class extends B0{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
102
+ `}renderOption(e,r,i){let n;return r.disabled?n=e===i?Ue.gray().underline(r.title):Ue.strikethrough().gray(r.title):n=e===i?Ue.cyan().underline(r.title):r.title,(r.selected?Ue.green(Lt.radioOn):Lt.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ue.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Ue.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(j0.hide),super.render();let e=[Kh.symbol(this.done,this.aborted),Ue.bold(this.msg),Kh.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ue.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Jh(e,this.out.columns);}};Zh.exports=ro;});var ip=f((m1,rp)=>{var Qh=L(),B0=Ne(),{style:ep,clear:U0}=he(),{erase:G0,cursor:tp}=q(),io=class extends B0{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
103
103
  `),this.close();}submit(){this.value=this.value||false,this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
104
- `),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(rp.hide):this.out.write(U0(this.outputText,this.out.columns)),super.render(),this.outputText=[tp.symbol(this.done,this.aborted),ep.bold(this.msg),tp.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:ep.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(G0.line+rp.to(0)+this.outputText));}};ip.exports=no;});var op=f((g1,sp)=>{sp.exports={TextPrompt:ih(),SelectPrompt:ah(),TogglePrompt:dh(),DatePrompt:Lh(),NumberPrompt:Bh(),MultiselectPrompt:Qs(),AutocompletePrompt:Jh(),AutocompleteMultiselectPrompt:Qh(),ConfirmPrompt:np()};});var cp=f(ap=>{var ie=ap,V0=op(),mi=t=>t;function Oe(t,e,r={}){return new Promise((i,n)=>{let s=new V0[t](e),o=r.onAbort||mi,a=r.onSubmit||mi,c=r.onExit||mi;s.on("state",e.onState||mi),s.on("submit",u=>i(a(u))),s.on("exit",u=>i(c(u))),s.on("abort",u=>n(o(u)));})}ie.text=t=>Oe("TextPrompt",t);ie.password=t=>(t.style="password",ie.text(t));ie.invisible=t=>(t.style="invisible",ie.text(t));ie.number=t=>Oe("NumberPrompt",t);ie.date=t=>Oe("DatePrompt",t);ie.confirm=t=>Oe("ConfirmPrompt",t);ie.list=t=>{let e=t.separator||",";return Oe("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};ie.toggle=t=>Oe("TogglePrompt",t);ie.select=t=>Oe("SelectPrompt",t);ie.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Oe("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};ie.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Oe("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var W0=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));ie.autocomplete=t=>(t.suggest=t.suggest||W0,t.choices=[].concat(t.choices||[]),Oe("AutocompletePrompt",t));});var dp=f((b1,up)=>{var so=cp(),H0=["suggest","format","onState","validate","onRender","type"],lp=()=>{};async function nt(t=[],{onSubmit:e=lp,onCancel:r=lp}={}){let i={},n=nt._override||{};t=[].concat(t);let s,o,a,c,u,l,d=async(h,p,m=false)=>{if(!(!m&&h.validate&&h.validate(p)!==true))return h.format?await h.format(p,i):p};for(o of t)if({name:c,type:u}=o,typeof u=="function"&&(u=await u(s,{...i},o),o.type=u),!!u){for(let h in o){if(H0.includes(h))continue;let p=o[h];o[h]=typeof p=="function"?await p(s,{...i},l):p;}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:c,type:u}=o,so[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(n[o.name]!==void 0&&(s=await d(o,n[o.name]),s!==void 0)){i[c]=s;continue}try{s=nt._injected?z0(nt._injected,o.initial):await so[u](o),i[c]=s=await d(o,s,!0),a=await e(o,s,i);}catch{a=!await r(o,i);}if(a)return i}return i}function z0(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Y0(t){nt._injected=(nt._injected||[]).concat(t);}function J0(t){nt._override=Object.assign({},t);}up.exports=Object.assign(nt,{prompt:nt,prompts:so,inject:Y0,override:J0});});var pp=f((w1,hp)=>{function K0(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return false;if(t[e]>r[e])return true}return false}hp.exports=K0("8.6.0")?Ld():dp();});var Kp=f((GM,Jp)=>{Jp.exports=Yp;Yp.sync=ZE;var Hp=A("fs");function KE(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return true;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return true}return false}function zp(t,e,r){return !t.isSymbolicLink()&&!t.isFile()?false:KE(e,r)}function Yp(t,e,r){Hp.stat(t,function(i,n){r(i,i?false:zp(n,t,e));});}function ZE(t,e){return zp(Hp.statSync(t),t,e)}});var tf=f((VM,ef)=>{ef.exports=Xp;Xp.sync=XE;var Zp=A("fs");function Xp(t,e,r){Zp.stat(t,function(i,n){r(i,i?false:Qp(n,e));});}function XE(t,e){return Qp(Zp.statSync(t),e)}function Qp(t,e){return t.isFile()&&QE(t,e)}function QE(t,e){var r=t.mode,i=t.uid,n=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,d=r&u||r&c&&n===o||r&a&&i===s||r&l&&s===0;return d}});var nf=f((HM,rf)=>{A("fs");var Di;process.platform==="win32"||global.TESTING_WINDOWS?Di=Kp():Di=tf();rf.exports=yo;yo.sync=eO;function yo(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){yo(t,e||{},function(s,o){s?n(s):i(o);});})}Di(t,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=false),r(i,n);});}function eO(t,e){try{return Di.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return false;throw r}}});var df=f((zM,uf)=>{var Ut=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",sf=A("path"),tO=Ut?";":":",of=nf(),af=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),cf=(t,e)=>{let r=e.colon||tO,i=t.match(/\//)||Ut&&t.match(/\\/)?[""]:[...Ut?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],n=Ut?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Ut?n.split(r):[""];return Ut&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},lf=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=cf(t,e),o=[],a=u=>new Promise((l,d)=>{if(u===i.length)return e.all&&o.length?l(o):d(af(t));let h=i[u],p=/^".*"$/.test(h)?h.slice(1,-1):h,m=sf.join(p,t),y=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;l(c(y,u,0));}),c=(u,l,d)=>new Promise((h,p)=>{if(d===n.length)return h(a(l+1));let m=n[d];of(u+m,{pathExt:s},(y,w)=>{if(!y&&w)if(e.all)o.push(u+m);else return h(u+m);return h(c(u,l,d+1))});});return r?a(0).then(u=>r(null,u),r):a(0)},rO=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=cf(t,e),s=[];for(let o=0;o<r.length;o++){let a=r[o],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=sf.join(c,t),l=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let d=0;d<i.length;d++){let h=l+i[d];try{if(of.sync(h,{pathExt:n}))if(e.all)s.push(h);else return h}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw af(t)};uf.exports=lf;lf.sync=rO;});var pf=f((YM,bo)=>{var hf=(t={})=>{let e=t.env||process.env;return (t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};bo.exports=hf;bo.exports.default=hf;});var yf=f((JM,gf)=>{var ff=A("path"),iO=df(),nO=pf();function mf(t,e){let r=t.options.env||process.env,i=process.cwd(),n=t.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd);}catch{}let o;try{o=iO.sync(t.command,{path:r[nO({env:r})],pathExt:e?ff.delimiter:void 0});}catch{}finally{s&&process.chdir(i);}return o&&(o=ff.resolve(n?t.options.cwd:"",o)),o}function sO(t){return mf(t)||mf(t,true)}gf.exports=sO;});var bf=f((KM,xo)=>{var wo=/([()\][%!^"`<>&|;, *?])/g;function oO(t){return t=t.replace(wo,"^$1"),t}function aO(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(wo,"^$1"),e&&(t=t.replace(wo,"^$1")),t}xo.exports.command=oO;xo.exports.argument=aO;});var xf=f((ZM,wf)=>{wf.exports=/^#!(.*)/;});var vf=f((XM,Sf)=>{var cO=xf();Sf.exports=(t="")=>{let e=t.match(cO);if(!e)return null;let[r,i]=e[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n};});var Of=f((QM,Ef)=>{var So=A("fs"),lO=vf();function uO(t){let r=Buffer.alloc(150),i;try{i=So.openSync(t,"r"),So.readSync(i,r,0,150,0),So.closeSync(i);}catch{}return lO(r.toString())}Ef.exports=uO;});var kf=f((eR,Tf)=>{var dO=A("path"),Cf=yf(),_f=bf(),hO=Of(),pO=process.platform==="win32",fO=/\.(?:com|exe)$/i,mO=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function gO(t){t.file=Cf(t);let e=t.file&&hO(t.file);return e?(t.args.unshift(t.file),t.command=e,Cf(t)):t.file}function yO(t){if(!pO)return t;let e=gO(t),r=!fO.test(e);if(t.options.forceShell||r){let i=mO.test(e);t.command=dO.normalize(t.command),t.command=_f.command(t.command),t.args=t.args.map(s=>_f.argument(s,i));let n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=true;}return t}function bO(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let i={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?i:yO(i)}Tf.exports=bO;});var Pf=f((tR,Df)=>{var vo=process.platform==="win32";function Eo(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function wO(t,e){if(!vo)return;let r=t.emit;t.emit=function(i,n){if(i==="exit"){let s=Af(n,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)};}function Af(t,e){return vo&&t===1&&!e.file?Eo(e.original,"spawn"):null}function xO(t,e){return vo&&t===1&&!e.file?Eo(e.original,"spawnSync"):null}Df.exports={hookChildProcess:wO,verifyENOENT:Af,verifyENOENTSync:xO,notFoundError:Eo};});var Mf=f((rR,Gt)=>{var If=A("child_process"),Oo=kf(),Co=Pf();function $f(t,e,r){let i=Oo(t,e,r),n=If.spawn(i.command,i.args,i.options);return Co.hookChildProcess(n,i),n}function SO(t,e,r){let i=Oo(t,e,r),n=If.spawnSync(i.command,i.args,i.options);return n.error=n.error||Co.verifyENOENTSync(n.status,i),n}Gt.exports=$f;Gt.exports.spawn=$f;Gt.exports.sync=SO;Gt.exports._parse=Oo;Gt.exports._enoent=Co;});var Ye=class extends Error{constructor(e,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0;}},ut=class extends Ye{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var er=class{constructor(e,r){switch(this.description=r||"",this.variadic=false,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case "<":this.required=true,this._name=e.slice(1,-1);break;case "[":this.required=false,this._name=e.slice(1,-1);break;default:this.required=true,this._name=e;break}this._name.endsWith("...")&&(this.variadic=true,this._name=this._name.slice(0,-3));}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new ut(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=true,this}argOptional(){return this.required=false,this}};function Br(t){let e=t.name()+(t.variadic===true?"...":"");return t.required?"<"+e+">":"["+e+"]"}var tr=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=false,this.sortOptions=false,this.showGlobalOptions=false;}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80;}visibleCommands(e){let r=e.commands.filter(n=>!n._hidden),i=e._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,s)=>n.name().localeCompare(s.name())),r}compareOptions(e,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(r))}visibleOptions(e){let r=e.options.filter(n=>!n.hidden),i=e._getHelpOption();if(i&&!i.hidden){let n=i.short&&e._findOption(i.short),s=i.long&&e._findOption(i.long);!n&&!s?r.push(i):i.long&&!s?r.push(e.createOption(i.long,i.description)):i.short&&!n&&r.push(e.createOption(i.short,i.description));}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return [];let r=[];for(let i=e.parent;i;i=i.parent){let n=i.options.filter(s=>!s.hidden);r.push(...n);}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||"";}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(i=>Br(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,r,i){return r.length===0?[]:[i.styleTitle(e),...r,""]}groupItems(e,r,i){let n=new Map;return e.forEach(s=>{let o=i(s);n.has(o)||n.set(o,[]);}),r.forEach(s=>{let o=i(s);n.has(o)||n.set(o,[]),n.get(o).push(s);}),n}formatHelp(e,r){let i=r.padWidth(e,r),n=r.helpWidth??80;function s(d,h){return r.formatItem(d,i,h,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),n),""]));let c=r.visibleArguments(e).map(d=>s(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,h)=>{let p=d.map(m=>s(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));o=o.concat(this.formatItemList(h,p,r));}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(h=>s(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));o=o.concat(this.formatItemList("Global Options:",d,r));}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,h)=>{let p=d.map(m=>s(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));o=o.concat(this.formatItemList(h,p,r));}),o.join(`
104
+ `),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(tp.hide):this.out.write(U0(this.outputText,this.out.columns)),super.render(),this.outputText=[ep.symbol(this.done,this.aborted),Qh.bold(this.msg),ep.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Qh.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(G0.line+tp.to(0)+this.outputText));}};rp.exports=io;});var sp=f((g1,np)=>{np.exports={TextPrompt:rh(),SelectPrompt:oh(),TogglePrompt:uh(),DatePrompt:Fh(),NumberPrompt:Nh(),MultiselectPrompt:Xs(),AutocompletePrompt:Yh(),AutocompleteMultiselectPrompt:Xh(),ConfirmPrompt:ip()};});var ap=f(op=>{var ie=op,V0=sp(),mi=t=>t;function Ee(t,e,r={}){return new Promise((i,n)=>{let s=new V0[t](e),o=r.onAbort||mi,a=r.onSubmit||mi,c=r.onExit||mi;s.on("state",e.onState||mi),s.on("submit",u=>i(a(u))),s.on("exit",u=>i(c(u))),s.on("abort",u=>n(o(u)));})}ie.text=t=>Ee("TextPrompt",t);ie.password=t=>(t.style="password",ie.text(t));ie.invisible=t=>(t.style="invisible",ie.text(t));ie.number=t=>Ee("NumberPrompt",t);ie.date=t=>Ee("DatePrompt",t);ie.confirm=t=>Ee("ConfirmPrompt",t);ie.list=t=>{let e=t.separator||",";return Ee("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};ie.toggle=t=>Ee("TogglePrompt",t);ie.select=t=>Ee("SelectPrompt",t);ie.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Ee("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};ie.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Ee("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var W0=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));ie.autocomplete=t=>(t.suggest=t.suggest||W0,t.choices=[].concat(t.choices||[]),Ee("AutocompletePrompt",t));});var up=f((b1,lp)=>{var no=ap(),H0=["suggest","format","onState","validate","onRender","type"],cp=()=>{};async function nt(t=[],{onSubmit:e=cp,onCancel:r=cp}={}){let i={},n=nt._override||{};t=[].concat(t);let s,o,a,c,u,l,d=async(h,p,m=false)=>{if(!(!m&&h.validate&&h.validate(p)!==true))return h.format?await h.format(p,i):p};for(o of t)if({name:c,type:u}=o,typeof u=="function"&&(u=await u(s,{...i},o),o.type=u),!!u){for(let h in o){if(H0.includes(h))continue;let p=o[h];o[h]=typeof p=="function"?await p(s,{...i},l):p;}if(l=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:c,type:u}=o,no[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(n[o.name]!==void 0&&(s=await d(o,n[o.name]),s!==void 0)){i[c]=s;continue}try{s=nt._injected?z0(nt._injected,o.initial):await no[u](o),i[c]=s=await d(o,s,!0),a=await e(o,s,i);}catch{a=!await r(o,i);}if(a)return i}return i}function z0(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Y0(t){nt._injected=(nt._injected||[]).concat(t);}function J0(t){nt._override=Object.assign({},t);}lp.exports=Object.assign(nt,{prompt:nt,prompts:no,inject:Y0,override:J0});});var hp=f((w1,dp)=>{function K0(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return false;if(t[e]>r[e])return true}return false}dp.exports=K0("8.6.0")?Fd():up();});var Jp=f((GM,Yp)=>{Yp.exports=zp;zp.sync=ZO;var Wp=A("fs");function KO(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return true;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return true}return false}function Hp(t,e,r){return !t.isSymbolicLink()&&!t.isFile()?false:KO(e,r)}function zp(t,e,r){Wp.stat(t,function(i,n){r(i,i?false:Hp(n,t,e));});}function ZO(t,e){return Hp(Wp.statSync(t),t,e)}});var ef=f((VM,Qp)=>{Qp.exports=Zp;Zp.sync=XO;var Kp=A("fs");function Zp(t,e,r){Kp.stat(t,function(i,n){r(i,i?false:Xp(n,e));});}function XO(t,e){return Xp(Kp.statSync(t),e)}function Xp(t,e){return t.isFile()&&QO(t,e)}function QO(t,e){var r=t.mode,i=t.uid,n=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,d=r&u||r&c&&n===o||r&a&&i===s||r&l&&s===0;return d}});var rf=f((HM,tf)=>{A("fs");var Di;process.platform==="win32"||global.TESTING_WINDOWS?Di=Jp():Di=ef();tf.exports=go;go.sync=eE;function go(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){go(t,e||{},function(s,o){s?n(s):i(o);});})}Di(t,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=false),r(i,n);});}function eE(t,e){try{return Di.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return false;throw r}}});var uf=f((zM,lf)=>{var Ut=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",nf=A("path"),tE=Ut?";":":",sf=rf(),of=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),af=(t,e)=>{let r=e.colon||tE,i=t.match(/\//)||Ut&&t.match(/\\/)?[""]:[...Ut?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],n=Ut?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Ut?n.split(r):[""];return Ut&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},cf=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=af(t,e),o=[],a=u=>new Promise((l,d)=>{if(u===i.length)return e.all&&o.length?l(o):d(of(t));let h=i[u],p=/^".*"$/.test(h)?h.slice(1,-1):h,m=nf.join(p,t),y=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;l(c(y,u,0));}),c=(u,l,d)=>new Promise((h,p)=>{if(d===n.length)return h(a(l+1));let m=n[d];sf(u+m,{pathExt:s},(y,w)=>{if(!y&&w)if(e.all)o.push(u+m);else return h(u+m);return h(c(u,l,d+1))});});return r?a(0).then(u=>r(null,u),r):a(0)},rE=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=af(t,e),s=[];for(let o=0;o<r.length;o++){let a=r[o],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=nf.join(c,t),l=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let d=0;d<i.length;d++){let h=l+i[d];try{if(sf.sync(h,{pathExt:n}))if(e.all)s.push(h);else return h}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw of(t)};lf.exports=cf;cf.sync=rE;});var hf=f((YM,yo)=>{var df=(t={})=>{let e=t.env||process.env;return (t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};yo.exports=df;yo.exports.default=df;});var gf=f((JM,mf)=>{var pf=A("path"),iE=uf(),nE=hf();function ff(t,e){let r=t.options.env||process.env,i=process.cwd(),n=t.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd);}catch{}let o;try{o=iE.sync(t.command,{path:r[nE({env:r})],pathExt:e?pf.delimiter:void 0});}catch{}finally{s&&process.chdir(i);}return o&&(o=pf.resolve(n?t.options.cwd:"",o)),o}function sE(t){return ff(t)||ff(t,true)}mf.exports=sE;});var yf=f((KM,wo)=>{var bo=/([()\][%!^"`<>&|;, *?])/g;function oE(t){return t=t.replace(bo,"^$1"),t}function aE(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(bo,"^$1"),e&&(t=t.replace(bo,"^$1")),t}wo.exports.command=oE;wo.exports.argument=aE;});var wf=f((ZM,bf)=>{bf.exports=/^#!(.*)/;});var Sf=f((XM,xf)=>{var cE=wf();xf.exports=(t="")=>{let e=t.match(cE);if(!e)return null;let[r,i]=e[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n};});var Of=f((QM,vf)=>{var xo=A("fs"),lE=Sf();function uE(t){let r=Buffer.alloc(150),i;try{i=xo.openSync(t,"r"),xo.readSync(i,r,0,150,0),xo.closeSync(i);}catch{}return lE(r.toString())}vf.exports=uE;});var Tf=f((eR,_f)=>{var dE=A("path"),Ef=gf(),Cf=yf(),hE=Of(),pE=process.platform==="win32",fE=/\.(?:com|exe)$/i,mE=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function gE(t){t.file=Ef(t);let e=t.file&&hE(t.file);return e?(t.args.unshift(t.file),t.command=e,Ef(t)):t.file}function yE(t){if(!pE)return t;let e=gE(t),r=!fE.test(e);if(t.options.forceShell||r){let i=mE.test(e);t.command=dE.normalize(t.command),t.command=Cf.command(t.command),t.args=t.args.map(s=>Cf.argument(s,i));let n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=true;}return t}function bE(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let i={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?i:yE(i)}_f.exports=bE;});var Df=f((tR,Af)=>{var So=process.platform==="win32";function vo(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function wE(t,e){if(!So)return;let r=t.emit;t.emit=function(i,n){if(i==="exit"){let s=kf(n,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)};}function kf(t,e){return So&&t===1&&!e.file?vo(e.original,"spawn"):null}function xE(t,e){return So&&t===1&&!e.file?vo(e.original,"spawnSync"):null}Af.exports={hookChildProcess:wE,verifyENOENT:kf,verifyENOENTSync:xE,notFoundError:vo};});var $f=f((rR,Gt)=>{var Pf=A("child_process"),Oo=Tf(),Eo=Df();function If(t,e,r){let i=Oo(t,e,r),n=Pf.spawn(i.command,i.args,i.options);return Eo.hookChildProcess(n,i),n}function SE(t,e,r){let i=Oo(t,e,r),n=Pf.spawnSync(i.command,i.args,i.options);return n.error=n.error||Eo.verifyENOENTSync(n.status,i),n}Gt.exports=If;Gt.exports.spawn=If;Gt.exports.sync=SE;Gt.exports._parse=Oo;Gt.exports._enoent=Eo;});var Ye=class extends Error{constructor(e,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0;}},ut=class extends Ye{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var er=class{constructor(e,r){switch(this.description=r||"",this.variadic=false,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case "<":this.required=true,this._name=e.slice(1,-1);break;case "[":this.required=false,this._name=e.slice(1,-1);break;default:this.required=true,this._name=e;break}this._name.endsWith("...")&&(this.variadic=true,this._name=this._name.slice(0,-3));}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new ut(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=true,this}argOptional(){return this.required=false,this}};function Br(t){let e=t.name()+(t.variadic===true?"...":"");return t.required?"<"+e+">":"["+e+"]"}var tr=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=false,this.sortOptions=false,this.showGlobalOptions=false;}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80;}visibleCommands(e){let r=e.commands.filter(n=>!n._hidden),i=e._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,s)=>n.name().localeCompare(s.name())),r}compareOptions(e,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(r))}visibleOptions(e){let r=e.options.filter(n=>!n.hidden),i=e._getHelpOption();if(i&&!i.hidden){let n=i.short&&e._findOption(i.short),s=i.long&&e._findOption(i.long);!n&&!s?r.push(i):i.long&&!s?r.push(e.createOption(i.long,i.description)):i.short&&!n&&r.push(e.createOption(i.short,i.description));}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return [];let r=[];for(let i=e.parent;i;i=i.parent){let n=i.options.filter(s=>!s.hidden);r.push(...n);}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||"";}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(i=>Br(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,r,i){return r.length===0?[]:[i.styleTitle(e),...r,""]}groupItems(e,r,i){let n=new Map;return e.forEach(s=>{let o=i(s);n.has(o)||n.set(o,[]);}),r.forEach(s=>{let o=i(s);n.has(o)||n.set(o,[]),n.get(o).push(s);}),n}formatHelp(e,r){let i=r.padWidth(e,r),n=r.helpWidth??80;function s(d,h){return r.formatItem(d,i,h,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),n),""]));let c=r.visibleArguments(e).map(d=>s(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,h)=>{let p=d.map(m=>s(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));o=o.concat(this.formatItemList(h,p,r));}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(h=>s(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));o=o.concat(this.formatItemList("Global Options:",d,r));}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,h)=>{let p=d.map(m=>s(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));o=o.concat(this.formatItemList(h,p,r));}),o.join(`
105
105
  `)}displayWidth(e){return util.stripVTControlCharacters(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return /\n[^\S\r\n]/.test(e)}formatItem(e,r,i,n){let o=" ".repeat(2);if(!i)return o+e;let a=e.padEnd(r+e.length-n.displayWidth(e)),c=2,l=(this.helpWidth??80)-r-c-2,d;return l<this.minWidthToWrap||n.preformatted(i)?d=i:d=n.boxWrap(i,l).replace(/\n/g,`
106
106
  `+" ".repeat(r+c)),o+a+" ".repeat(c)+d.replace(/\n/g,`
107
107
  ${o}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return i.forEach(o=>{let a=o.match(n);if(a===null){s.push("");return}let c=[a.shift()],u=this.displayWidth(c[0]);a.forEach(l=>{let d=this.displayWidth(l);if(u+d<=r){c.push(l),u+=d;return}s.push(c.join(""));let h=l.trimStart();c=[h],u=this.displayWidth(h);}),s.push(c.join(""));}),s.join(`
108
- `)}};var Tt=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=false;let i=Ub(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=false,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=false,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0;}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:true}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=true){return this.mandatory=!!e,this}hideHelp(e=true){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new ut(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Ba(this.name().replace(/^no-/,"")):Ba(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return !this.required&&!this.optional&&!this.negate}},Ur=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r);}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i);});}valueFromOption(e,r){let i=r.attributeName();if(!this.dualOptions.has(i))return true;let n=this.negativeOptions.get(i).presetArg,s=n!==void 0?n:false;return r.negate===(s===e)}};function Ba(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Ub(t){let e,r,i=/^-[^-]$/,n=/^--[^-]/,s=t.split(/[ |,]+/).concat("guard");if(i.test(s[0])&&(e=s.shift()),n.test(s[0])&&(r=s.shift()),!e&&i.test(s[0])&&(e=s.shift()),!e&&n.test(s[0])&&(e=r,r=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${t}'`;throw /^-[^-][^-]/.test(o)?new Error(`${a}
108
+ `)}};var Tt=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=false;let i=Ub(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=false,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=false,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0;}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:true}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=true){return this.mandatory=!!e,this}hideHelp(e=true){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new ut(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Na(this.name().replace(/^no-/,"")):Na(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return !this.required&&!this.optional&&!this.negate}},Ur=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r);}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i);});}valueFromOption(e,r){let i=r.attributeName();if(!this.dualOptions.has(i))return true;let n=this.negativeOptions.get(i).presetArg,s=n!==void 0?n:false;return r.negate===(s===e)}};function Na(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Ub(t){let e,r,i=/^-[^-]$/,n=/^--[^-]/,s=t.split(/[ |,]+/).concat("guard");if(i.test(s[0])&&(e=s.shift()),n.test(s[0])&&(r=s.shift()),!e&&i.test(s[0])&&(e=s.shift()),!e&&n.test(s[0])&&(e=r,r=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${t}'`;throw /^-[^-][^-]/.test(o)?new Error(`${a}
109
109
  - a short flag is a single dash and a single character
110
110
  - either use a single dash and a single character (for a short flag)
111
111
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(o)?new Error(`${a}
112
112
  - too many short flags`):n.test(o)?new Error(`${a}
113
113
  - too many long flags`):new Error(`${a}
114
- - unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return {shortFlag:e,longFlag:r}}function Gb(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let i=0;i<=t.length;i++)r[i]=[i];for(let i=0;i<=e.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let n=1;n<=t.length;n++){let s;t[n-1]===e[i-1]?s=0:s=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+s),n>1&&i>1&&t[n-1]===e[i-2]&&t[n-2]===e[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1));}return r[t.length][e.length]}function Mn(t,e){if(!e||e.length===0)return "";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(o=>o.slice(2)));let i=[],n=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let a=Gb(t,o),c=Math.max(t.length,o.length);(c-a)/c>s&&(a<n?(n=a,i=[o]):a===n&&i.push(o));}),i.sort((o,a)=>o.localeCompare(a)),r&&(i=i.map(o=>`--${o}`)),i.length>1?`
114
+ - unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return {shortFlag:e,longFlag:r}}function Gb(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let i=0;i<=t.length;i++)r[i]=[i];for(let i=0;i<=e.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let n=1;n<=t.length;n++){let s;t[n-1]===e[i-1]?s=0:s=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+s),n>1&&i>1&&t[n-1]===e[i-2]&&t[n-2]===e[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1));}return r[t.length][e.length]}function $n(t,e){if(!e||e.length===0)return "";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(o=>o.slice(2)));let i=[],n=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let a=Gb(t,o),c=Math.max(t.length,o.length);(c-a)/c>s&&(a<n?(n=a,i=[o]):a===n&&i.push(o));}),i.sort((o,a)=>o.localeCompare(a)),r&&(i=i.map(o=>`--${o}`)),i.length>1?`
115
115
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
116
- (Did you mean ${i[0]}?)`:""}var kt=class t extends events.EventEmitter{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=false,this._allowExcessArguments=false,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=false,this._actionHandler=null,this._executableHandler=false,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=true,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=false,this._passThroughOptions=false,this._lifeCycleHooks={},this._showHelpAfterError=false,this._showSuggestionAfterError=true,this._savedState=null,this._outputConfiguration={writeOut:r=>k__default.default.stdout.write(r),writeErr:r=>k__default.default.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>k__default.default.stdout.isTTY?k__default.default.stdout.columns:void 0,getErrHelpWidth:()=>k__default.default.stderr.isTTY?k__default.default.stderr.columns:void 0,getOutHasColors:()=>Ga()??(k__default.default.stdout.isTTY&&k__default.default.stdout.hasColors?.()),getErrHasColors:()=>Ga()??(k__default.default.stderr.isTTY&&k__default.default.stderr.hasColors?.()),stripColor:r=>util.stripVTControlCharacters(r)},this._hidden=false,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0;}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 r=this;r;r=r.parent)e.push(r);return e}command(e,r,i){let n=r,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(o);return n&&(c.description(n),c._executableHandler=true),s.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(s.noHelp||s.hidden),c._executableFile=s.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new tr,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=true){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=true){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
116
+ (Did you mean ${i[0]}?)`:""}var kt=class t extends events.EventEmitter{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=false,this._allowExcessArguments=false,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=false,this._actionHandler=null,this._executableHandler=false,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=true,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=false,this._passThroughOptions=false,this._lifeCycleHooks={},this._showHelpAfterError=false,this._showSuggestionAfterError=true,this._savedState=null,this._outputConfiguration={writeOut:r=>k__default.default.stdout.write(r),writeErr:r=>k__default.default.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>k__default.default.stdout.isTTY?k__default.default.stdout.columns:void 0,getErrHelpWidth:()=>k__default.default.stderr.isTTY?k__default.default.stderr.columns:void 0,getOutHasColors:()=>Ua()??(k__default.default.stdout.isTTY&&k__default.default.stdout.hasColors?.()),getErrHasColors:()=>Ua()??(k__default.default.stderr.isTTY&&k__default.default.stderr.hasColors?.()),stripColor:r=>util.stripVTControlCharacters(r)},this._hidden=false,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0;}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 r=this;r;r=r.parent)e.push(r);return e}command(e,r,i){let n=r,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(o);return n&&(c.description(n),c._executableHandler=true),s.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(s.noHelp||s.hidden),c._executableFile=s.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new tr,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=true){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=true){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
117
117
  - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=true),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new er(e,r)}argument(e,r,i,n){let s=this.createArgument(e,r);return typeof i=="function"?s.default(n).argParser(i):s.default(i),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r);}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.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,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,n,s]=i.match(/([^ ]+) *(.*)/),o=r??"display help for command",a=this.createCommand(n);return a.helpOption(false),s&&a.arguments(s),o&&a.description(o),this._addImplicitHelpCommand=true,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=true,this._helpCommand=e,this._initCommandGroup(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,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
118
118
  Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,i){this._exitCallback&&this._exitCallback(new Ye(e,r,i)),k__default.default.exit(e);}action(e){let r=i=>{let n=this.registeredArguments.length,s=i.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=r,this}createOption(e,r){return new Tt(e,r)}_callParseArg(e,r,i,n){try{return e.parseArg(r,i)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${n} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code});}throw s}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let i=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 '${i}'
119
119
  - already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e);}_registerCommand(e){let r=n=>[n.name()].concat(n.aliases()),i=r(e).find(n=>this._findCommand(n));if(i){let n=r(this._findCommand(i)).join("|"),s=r(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this._initCommandGroup(e),this.commands.push(e);}addOption(e){this._registerOption(e);let r=e.name(),i=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let n=(s,o,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let c=this.getOptionValue(i);s!==null&&e.parseArg?s=this._callParseArg(e,s,c,o):s!==null&&e.variadic&&(s=e._collectValue(s,c)),s==null&&(e.negate?s=false:e.isBoolean()||e.optional?s=true:s=""),this.setOptionValueWithSource(i,s,a);};return this.on("option:"+r,s=>{let o=`error: option '${e.flags}' argument '${s}' is invalid.`;n(s,o,"cli");}),e.envVar&&this.on("optionEnv:"+r,s=>{let o=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;n(s,o,"env");}),this}_optionEx(e,r,i,n,s){if(typeof r=="object"&&r instanceof Tt)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,i);if(o.makeOptionMandatory(!!e.mandatory),typeof n=="function")o.default(s).argParser(n);else if(n instanceof RegExp){let a=n;n=(c,u)=>{let l=a.exec(c);return l?l[0]:u},o.default(s).argParser(n);}else o.default(n);return this.addOption(o)}option(e,r,i,n){return this._optionEx({},e,r,i,n)}requiredOption(e,r,i,n){return this._optionEx({mandatory:true},e,r,i,n)}combineFlagAndOptionalValue(e=true){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=true){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=true){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=true){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=true){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=true){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,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,i){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(r=i.getOptionValueSource(e));}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){k__default.default.versions?.electron&&(r.from="electron");let n=k__default.default.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval");}e===void 0&&(e=k__default.default.argv),this.rawArgs=e.slice();let i;switch(r.from){case void 0:case "node":this._scriptPath=e[1],i=e.slice(2);break;case "electron":k__default.default.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case "user":i=e.slice(0);break;case "eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return !this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return this._parseCommand([],i),this}async parseAsync(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let r=e.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(e.attributeName(),true,"default");}),this.saveStateBeforeParse()):this.restoreStateBeforeParse();}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}};}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
120
120
  - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[];}_checkForMissingExecutable(e,r,i){if(Gr__default.default.existsSync(e))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",s=`'${e}' does not exist
121
121
  - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
122
122
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
123
- - ${n}`;throw new Error(s)}_executeSubCommand(e,r){r=r.slice();let i=[".js",".ts",".tsx",".mjs",".cjs"];function n(l,d){let h=ne__default.default.resolve(l,d);if(Gr__default.default.existsSync(h))return h;if(i.includes(ne__default.default.extname(d)))return;let p=i.find(m=>Gr__default.default.existsSync(`${h}${m}`));if(p)return `${h}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,o=this._executableDir||"";if(this._scriptPath){let l;try{l=Gr__default.default.realpathSync(this._scriptPath);}catch{l=this._scriptPath;}o=ne__default.default.resolve(ne__default.default.dirname(l),o);}if(o){let l=n(o,s);if(!l&&!e._executableFile&&this._scriptPath){let d=ne__default.default.basename(this._scriptPath,ne__default.default.extname(this._scriptPath));d!==this._name&&(l=n(o,`${d}-${e._name}`));}s=l||s;}let a=i.includes(ne__default.default.extname(s)),c;k__default.default.platform!=="win32"?a?(r.unshift(s),r=Ua(k__default.default.execArgv).concat(r),c=Rn__default.default.spawn(k__default.default.argv[0],r,{stdio:"inherit"})):c=Rn__default.default.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,o,e._name),r.unshift(s),r=Ua(k__default.default.execArgv).concat(r),c=Rn__default.default.spawn(k__default.default.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{k__default.default.on(d,()=>{c.killed===false&&c.exitCode===null&&c.kill(d);});});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new Ye(l,"commander.executeSubCommandAsync","(close)")):k__default.default.exit(l);}),c.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(s,o,e._name);else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!u)k__default.default.exit(1);else {let d=new Ye(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,u(d);}}),this.runningCommand=c;}_dispatchSubcommand(e,r,i){let n=this._findCommand(e);n||this.help({error:true}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),s}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==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=(i,n,s)=>{let o=n;if(n!==null&&i.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;o=this._callParseArg(i,n,s,a);}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let s=i.defaultValue;i.variadic?n<this.args.length?(s=this.args.slice(n),i.parseArg&&(s=s.reduce((o,a)=>e(i,a,o),i.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],i.parseArg&&(s=e(i,s,i.defaultValue))),r[n]=s;}),this.processedArgs=r;}_chainOrCall(e,r){return e?.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let i=e,n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(o=>{n.push({hookedCommand:s,callback:o});});}),r==="postAction"&&n.reverse(),n.forEach(s=>{i=this._chainOrCall(i,()=>s.callback(s.hookedCommand,this));}),i}_chainOrCallSubCommandHook(e,r,i){let n=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(s=>{n=this._chainOrCall(n,()=>s(this,r));}),n}_parseCommand(e,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),r=i.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:true}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0]);},s=`command:${this.name()}`;if(this._actionHandler){n(),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,r);})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent?.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(n(),this._processArguments());}else this.commands.length?(n(),this.help({error:true})):(n(),this._processArguments());}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r);});});}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?false:this.getOptionValueSource(n)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=e.find(s=>i.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(i,n);});}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions();});}parseOptions(e){let r=[],i=[],n=r;function s(l){return l.length>1&&l[0]==="-"}let o=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(h=>h.short).some(h=>/^-\d$/.test(h))):false,a=null,c=null,u=0;for(;u<e.length||c;){let l=c??e[u++];if(c=null,l==="--"){n===i&&n.push(l),n.push(...e.slice(u));break}if(a&&(!s(l)||o(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,s(l)){let d=this._findOption(l);if(d){if(d.required){let h=e[u++];h===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,h);}else if(d.optional){let h=null;u<e.length&&(!s(e[u])||o(e[u]))&&(h=e[u++]),this.emit(`option:${d.name()}`,h);}else this.emit(`option:${d.name()}`);a=d.variadic?d:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let d=this._findOption(`-${l[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,l.slice(2)):(this.emit(`option:${d.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let d=l.indexOf("="),h=this._findOption(l.slice(0,d));if(h&&(h.required||h.optional)){this.emit(`option:${h.name()}`,l.slice(d+1));continue}}if(n===r&&s(l)&&!(this.commands.length===0&&o(l))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(l)){r.push(l),i.push(...e.slice(u));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...e.slice(u));break}else if(this._defaultCommandName){i.push(l,...e.slice(u));break}}if(this._passThroughOptions){n.push(l,...e.slice(u));break}n.push(l);}return {operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n];}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
123
+ - ${n}`;throw new Error(s)}_executeSubCommand(e,r){r=r.slice();let i=[".js",".ts",".tsx",".mjs",".cjs"];function n(l,d){let h=ne__default.default.resolve(l,d);if(Gr__default.default.existsSync(h))return h;if(i.includes(ne__default.default.extname(d)))return;let p=i.find(m=>Gr__default.default.existsSync(`${h}${m}`));if(p)return `${h}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,o=this._executableDir||"";if(this._scriptPath){let l;try{l=Gr__default.default.realpathSync(this._scriptPath);}catch{l=this._scriptPath;}o=ne__default.default.resolve(ne__default.default.dirname(l),o);}if(o){let l=n(o,s);if(!l&&!e._executableFile&&this._scriptPath){let d=ne__default.default.basename(this._scriptPath,ne__default.default.extname(this._scriptPath));d!==this._name&&(l=n(o,`${d}-${e._name}`));}s=l||s;}let a=i.includes(ne__default.default.extname(s)),c;k__default.default.platform!=="win32"?a?(r.unshift(s),r=Ba(k__default.default.execArgv).concat(r),c=Mn__default.default.spawn(k__default.default.argv[0],r,{stdio:"inherit"})):c=Mn__default.default.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,o,e._name),r.unshift(s),r=Ba(k__default.default.execArgv).concat(r),c=Mn__default.default.spawn(k__default.default.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{k__default.default.on(d,()=>{c.killed===false&&c.exitCode===null&&c.kill(d);});});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new Ye(l,"commander.executeSubCommandAsync","(close)")):k__default.default.exit(l);}),c.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(s,o,e._name);else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!u)k__default.default.exit(1);else {let d=new Ye(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,u(d);}}),this.runningCommand=c;}_dispatchSubcommand(e,r,i){let n=this._findCommand(e);n||this.help({error:true}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),s}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==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=(i,n,s)=>{let o=n;if(n!==null&&i.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;o=this._callParseArg(i,n,s,a);}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let s=i.defaultValue;i.variadic?n<this.args.length?(s=this.args.slice(n),i.parseArg&&(s=s.reduce((o,a)=>e(i,a,o),i.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],i.parseArg&&(s=e(i,s,i.defaultValue))),r[n]=s;}),this.processedArgs=r;}_chainOrCall(e,r){return e?.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let i=e,n=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(o=>{n.push({hookedCommand:s,callback:o});});}),r==="postAction"&&n.reverse(),n.forEach(s=>{i=this._chainOrCall(i,()=>s.callback(s.hookedCommand,this));}),i}_chainOrCallSubCommandHook(e,r,i){let n=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(s=>{n=this._chainOrCall(n,()=>s(this,r));}),n}_parseCommand(e,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),r=i.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:true}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0]);},s=`command:${this.name()}`;if(this._actionHandler){n(),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,r);})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent?.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(n(),this._processArguments());}else this.commands.length?(n(),this.help({error:true})):(n(),this._processArguments());}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r);});});}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?false:this.getOptionValueSource(n)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=e.find(s=>i.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(i,n);});}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions();});}parseOptions(e){let r=[],i=[],n=r;function s(l){return l.length>1&&l[0]==="-"}let o=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(h=>h.short).some(h=>/^-\d$/.test(h))):false,a=null,c=null,u=0;for(;u<e.length||c;){let l=c??e[u++];if(c=null,l==="--"){n===i&&n.push(l),n.push(...e.slice(u));break}if(a&&(!s(l)||o(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,s(l)){let d=this._findOption(l);if(d){if(d.required){let h=e[u++];h===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,h);}else if(d.optional){let h=null;u<e.length&&(!s(e[u])||o(e[u]))&&(h=e[u++]),this.emit(`option:${d.name()}`,h);}else this.emit(`option:${d.name()}`);a=d.variadic?d:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let d=this._findOption(`-${l[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,l.slice(2)):(this.emit(`option:${d.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let d=l.indexOf("="),h=this._findOption(l.slice(0,d));if(h&&(h.required||h.optional)){this.emit(`option:${h.name()}`,l.slice(d+1));continue}}if(n===r&&s(l)&&!(this.commands.length===0&&o(l))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(l)){r.push(l),i.push(...e.slice(u));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...e.slice(u));break}else if(this._defaultCommandName){i.push(l,...e.slice(u));break}}if(this._passThroughOptions){n.push(l,...e.slice(u));break}n.push(l);}return {operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n];}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
124
124
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
125
125
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
126
- `),this.outputHelp({error:true}));let i=r||{},n=i.exitCode||1,s=i.code||"commander.error";this._exit(n,s,e);}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in k__default.default.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,k__default.default.env[e.envVar]):this.emit(`optionEnv:${e.name()}`));}});}_parseOptionsImplied(){let e=new Ur(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied");});});}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"});}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"});}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"});}_conflictingOption(e,r){let i=o=>{let a=o.attributeName(),c=this.getOptionValue(a),u=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return u&&(u.presetArg===void 0&&c===false||u.presetArg!==void 0&&c===u.presetArg)?u:l||o},n=o=>{let a=i(o),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${n(e)} cannot be used with ${n(r)}`;this.error(s,{code:"commander.conflictingOption"});}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);n=n.concat(o),s=s.parent;}while(s&&!s._enablePositionalOptions);r=Mn(e,n);}let i=`error: unknown option '${e}'${r}`;this.error(i,{code:"commander.unknownOption"});}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",n=e.length,s=this.parent?` for '${this.name()}'`:"",o=e.join(", "),a=`error: too many arguments${s}. Expected ${r} argument${i} but got ${n}: ${o}.`;this.error(a,{code:"commander.excessArguments"});}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias());}),r=Mn(e,n);}let i=`error: unknown command '${e}'${r}`;this.error(i,{code:"commander.unknownCommand"});}version(e,r,i){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
126
+ `),this.outputHelp({error:true}));let i=r||{},n=i.exitCode||1,s=i.code||"commander.error";this._exit(n,s,e);}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in k__default.default.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,k__default.default.env[e.envVar]):this.emit(`optionEnv:${e.name()}`));}});}_parseOptionsImplied(){let e=new Ur(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied");});});}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"});}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"});}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"});}_conflictingOption(e,r){let i=o=>{let a=o.attributeName(),c=this.getOptionValue(a),u=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return u&&(u.presetArg===void 0&&c===false||u.presetArg!==void 0&&c===u.presetArg)?u:l||o},n=o=>{let a=i(o),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${n(e)} cannot be used with ${n(r)}`;this.error(s,{code:"commander.conflictingOption"});}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);n=n.concat(o),s=s.parent;}while(s&&!s._enablePositionalOptions);r=$n(e,n);}let i=`error: unknown option '${e}'${r}`;this.error(i,{code:"commander.unknownOption"});}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",n=e.length,s=this.parent?` for '${this.name()}'`:"",o=e.join(", "),a=`error: too many arguments${s}. Expected ${r} argument${i} but got ${n}: ${o}.`;this.error(a,{code:"commander.excessArguments"});}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias());}),r=$n(e,n);}let i=`error: unknown command '${e}'${r}`;this.error(i,{code:"commander.unknownCommand"});}version(e,r,i){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
127
127
  `),this._exit(0,"commander.version",e);}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>Br(i));return [].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup);}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup);}nameFromFilename(e){return this._name=ne__default.default.basename(e,ne__default.default.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),i=this._getOutputContext(e);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let r=!!e.error,i,n,s;return r?(i=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:n,helpWidth:s}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let i=this._getOutputContext(e),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:i.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",n));}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(k__default.default.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)");}addHelpText(e,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
128
128
  Expecting one of '${i.join("', '")}'`);let n=`${e}Help`;return this.on(n,s=>{let o;typeof r=="function"?o=r({error:s.error,command:s.command}):o=r,o&&s.write(`${o}
129
- `);}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"));}};function Ua(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,i="127.0.0.1",n="9229",s;return (s=e.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?n=s[3]:i=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],i=s[3],n=s[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:e})}function Ga(){if(k__default.default.env.NO_COLOR||k__default.default.env.FORCE_COLOR==="0"||k__default.default.env.FORCE_COLOR==="false")return false;if(k__default.default.env.FORCE_COLOR||k__default.default.env.CLICOLOR_FORCE!==void 0)return true}new kt;var U=Ie(et()),_b=Ie(pp());var mt=true,qt=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{},xr=0;if(qt.process&&qt.process.env&&qt.process.stdout){let{FORCE_COLOR:t,NODE_DISABLE_COLORS:e,NO_COLOR:r,TERM:i,COLORTERM:n}=qt.process.env;e||r||t==="0"?mt=false:t==="1"||t==="2"||t==="3"?mt=true:i==="dumb"?mt=false:"CI"in qt.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in qt.process.env)?mt=true:mt=process.stdout.isTTY,mt&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?xr=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?xr=2:xr=1);}var fp={enabled:mt,supportLevel:xr};function E(t,e,r=1){let i=`\x1B[${t}m`,n=`\x1B[${e}m`,s=new RegExp(`\\x1b\\[${e}m`,"g");return o=>fp.enabled&&fp.supportLevel>=r?i+(""+o).replace(s,i)+n:""+o}var mp=E(31,39),gp=E(32,39),yp=E(33,39),bp=E(36,39);var C={info(t){console.log(bp(t));},success(t){console.log(gp(t));},warn(t){console.log(yp(t));},error(t){console.log(mp(t));}};var Sr=Ie(et());function yi(t){return Sr.default.existsSync(ne__default.default.join(t,"pnpm-lock.yaml"))?"pnpm":Sr.default.existsSync(ne__default.default.join(t,"yarn.lock"))?"yarn":Sr.default.existsSync(ne__default.default.join(t,"bun.lockb"))||Sr.default.existsSync(ne__default.default.join(t,"bun.lock"))?"bun":"npm"}function N(t){if(typeof t!="object"||t===null)return false;let e=Object.getPrototypeOf(t);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var jt=(t,e)=>{let r=ao(X0(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},X0=t=>oo(t)?t.toString():t,oo=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,ao=t=>t instanceof URL?url.fileURLToPath(t):t;var bi=(t,e=[],r={})=>{let i=jt(t,"First argument"),[n,s]=N(e)?[[],e]:[e,r];if(!Array.isArray(n))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${n}`);if(n.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${n}`);let o=n.map(String),a=o.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!N(s))throw new TypeError(`Last argument must be an options object: ${s}`);return [i,o,s]};var{toString:wp}=Object.prototype,xp=t=>wp.call(t)==="[object ArrayBuffer]",B=t=>wp.call(t)==="[object Uint8Array]",Ge=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),eE=new TextEncoder,Sp=t=>eE.encode(t),tE=new TextDecoder,wi=t=>tE.decode(t),vp=(t,e)=>rE(t,e).join(""),rE=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;let r=new string_decoder.StringDecoder(e),i=t.map(s=>typeof s=="string"?Sp(s):s).map(s=>r.write(s)),n=r.end();return n===""?i:[...i,n]},vr=t=>t.length===1&&B(t[0])?t[0]:co(iE(t)),iE=t=>t.map(e=>typeof e=="string"?Sp(e):e),co=t=>{let e=new Uint8Array(nE(t)),r=0;for(let i of t)e.set(i,r),r+=i.length;return e},nE=t=>{let e=0;for(let r of t)e+=r.length;return e};var _p=t=>Array.isArray(t)&&Array.isArray(t.raw),Tp=(t,e)=>{let r=[];for(let[s,o]of t.entries())r=oE({templates:t,expressions:e,tokens:r,index:s,template:o});if(r.length===0)throw new TypeError("Template script must not be empty");let[i,...n]=r;return [i,n,{}]},oE=({templates:t,expressions:e,tokens:r,index:i,template:n})=>{if(n===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[i]}`);let{nextTokens:s,leadingWhitespaces:o,trailingWhitespaces:a}=aE(n,t.raw[i]),c=Op(r,s,o);if(i===e.length)return c;let u=e[i],l=Array.isArray(u)?u.map(d=>Cp(d)):[Cp(u)];return Op(c,l,a)},aE=(t,e)=>{if(e.length===0)return {nextTokens:[],leadingWhitespaces:false,trailingWhitespaces:false};let r=[],i=0,n=Ep.has(e[0]);for(let o=0,a=0;o<t.length;o+=1,a+=1){let c=e[a];if(Ep.has(c))i!==o&&r.push(t.slice(i,o)),i=o+1;else if(c==="\\"){let u=e[a+1];u===`
130
- `?(o-=1,a+=1):u==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=cE[u]??1;}}let s=i===t.length;return s||r.push(t.slice(i)),{nextTokens:r,leadingWhitespaces:n,trailingWhitespaces:s}},Ep=new Set([" "," ","\r",`
131
- `]),cE={x:3,u:5},Op=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],Cp=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(N(t)&&("stdout"in t||"isMaxBuffer"in t))return lE(t);throw t instanceof Rn.ChildProcess||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},lE=({stdout:t})=>{if(typeof t=="string")return t;if(B(t))return wi(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};var pe=t=>xi.includes(t),xi=[k__default.default.stdin,k__default.default.stdout,k__default.default.stderr],ae=["stdin","stdout","stderr"],Si=t=>ae[t]??`stdio[${t}]`;var Ap=t=>{let e={...t};for(let r of po)e[r]=uo(t,r);return e},uo=(t,e)=>{let r=Array.from({length:dE(t)+1}),i=hE(t[e],r,e);return yE(i,e)},dE=({stdio:t})=>Array.isArray(t)?Math.max(t.length,ae.length):ae.length,hE=(t,e,r)=>N(t)?pE(t,e,r):e.fill(t),pE=(t,e,r)=>{for(let i of Object.keys(t).sort(fE))for(let n of mE(i,r,e))e[n]=t[i];return e},fE=(t,e)=>kp(t)<kp(e)?1:-1,kp=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,mE=(t,e,r)=>{if(t==="ipc")return [r.length-1];let i=ho(t);if(i===void 0||i===0)throw new TypeError(`"${e}.${t}" is invalid.
129
+ `);}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"));}};function Ba(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,i="127.0.0.1",n="9229",s;return (s=e.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?n=s[3]:i=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],i=s[3],n=s[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:e})}function Ua(){if(k__default.default.env.NO_COLOR||k__default.default.env.FORCE_COLOR==="0"||k__default.default.env.FORCE_COLOR==="false")return false;if(k__default.default.env.FORCE_COLOR||k__default.default.env.CLICOLOR_FORCE!==void 0)return true}new kt;var U=Ie(et()),_b=Ie(hp());var mt=true,qt=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{},xr=0;if(qt.process&&qt.process.env&&qt.process.stdout){let{FORCE_COLOR:t,NODE_DISABLE_COLORS:e,NO_COLOR:r,TERM:i,COLORTERM:n}=qt.process.env;e||r||t==="0"?mt=false:t==="1"||t==="2"||t==="3"?mt=true:i==="dumb"?mt=false:"CI"in qt.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in qt.process.env)?mt=true:mt=process.stdout.isTTY,mt&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?xr=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?xr=2:xr=1);}var pp={enabled:mt,supportLevel:xr};function O(t,e,r=1){let i=`\x1B[${t}m`,n=`\x1B[${e}m`,s=new RegExp(`\\x1b\\[${e}m`,"g");return o=>pp.enabled&&pp.supportLevel>=r?i+(""+o).replace(s,i)+n:""+o}var fp=O(31,39),mp=O(32,39),gp=O(33,39),yp=O(36,39);var C={info(t){console.log(yp(t));},success(t){console.log(mp(t));},warn(t){console.log(gp(t));},error(t){console.log(fp(t));}};var Sr=Ie(et());function yi(t){return Sr.default.existsSync(ne__default.default.join(t,"pnpm-lock.yaml"))?"pnpm":Sr.default.existsSync(ne__default.default.join(t,"yarn.lock"))?"yarn":Sr.default.existsSync(ne__default.default.join(t,"bun.lockb"))||Sr.default.existsSync(ne__default.default.join(t,"bun.lock"))?"bun":"npm"}function N(t){if(typeof t!="object"||t===null)return false;let e=Object.getPrototypeOf(t);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var jt=(t,e)=>{let r=oo(X0(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},X0=t=>so(t)?t.toString():t,so=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,oo=t=>t instanceof URL?url.fileURLToPath(t):t;var bi=(t,e=[],r={})=>{let i=jt(t,"First argument"),[n,s]=N(e)?[[],e]:[e,r];if(!Array.isArray(n))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${n}`);if(n.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${n}`);let o=n.map(String),a=o.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!N(s))throw new TypeError(`Last argument must be an options object: ${s}`);return [i,o,s]};var{toString:bp}=Object.prototype,wp=t=>bp.call(t)==="[object ArrayBuffer]",B=t=>bp.call(t)==="[object Uint8Array]",Ge=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),eO=new TextEncoder,xp=t=>eO.encode(t),tO=new TextDecoder,wi=t=>tO.decode(t),Sp=(t,e)=>rO(t,e).join(""),rO=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;let r=new string_decoder.StringDecoder(e),i=t.map(s=>typeof s=="string"?xp(s):s).map(s=>r.write(s)),n=r.end();return n===""?i:[...i,n]},vr=t=>t.length===1&&B(t[0])?t[0]:ao(iO(t)),iO=t=>t.map(e=>typeof e=="string"?xp(e):e),ao=t=>{let e=new Uint8Array(nO(t)),r=0;for(let i of t)e.set(i,r),r+=i.length;return e},nO=t=>{let e=0;for(let r of t)e+=r.length;return e};var Cp=t=>Array.isArray(t)&&Array.isArray(t.raw),_p=(t,e)=>{let r=[];for(let[s,o]of t.entries())r=oO({templates:t,expressions:e,tokens:r,index:s,template:o});if(r.length===0)throw new TypeError("Template script must not be empty");let[i,...n]=r;return [i,n,{}]},oO=({templates:t,expressions:e,tokens:r,index:i,template:n})=>{if(n===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[i]}`);let{nextTokens:s,leadingWhitespaces:o,trailingWhitespaces:a}=aO(n,t.raw[i]),c=Op(r,s,o);if(i===e.length)return c;let u=e[i],l=Array.isArray(u)?u.map(d=>Ep(d)):[Ep(u)];return Op(c,l,a)},aO=(t,e)=>{if(e.length===0)return {nextTokens:[],leadingWhitespaces:false,trailingWhitespaces:false};let r=[],i=0,n=vp.has(e[0]);for(let o=0,a=0;o<t.length;o+=1,a+=1){let c=e[a];if(vp.has(c))i!==o&&r.push(t.slice(i,o)),i=o+1;else if(c==="\\"){let u=e[a+1];u===`
130
+ `?(o-=1,a+=1):u==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=cO[u]??1;}}let s=i===t.length;return s||r.push(t.slice(i)),{nextTokens:r,leadingWhitespaces:n,trailingWhitespaces:s}},vp=new Set([" "," ","\r",`
131
+ `]),cO={x:3,u:5},Op=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],Ep=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(N(t)&&("stdout"in t||"isMaxBuffer"in t))return lO(t);throw t instanceof Mn.ChildProcess||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},lO=({stdout:t})=>{if(typeof t=="string")return t;if(B(t))return wi(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};var pe=t=>xi.includes(t),xi=[k__default.default.stdin,k__default.default.stdout,k__default.default.stderr],ae=["stdin","stdout","stderr"],Si=t=>ae[t]??`stdio[${t}]`;var kp=t=>{let e={...t};for(let r of ho)e[r]=lo(t,r);return e},lo=(t,e)=>{let r=Array.from({length:dO(t)+1}),i=hO(t[e],r,e);return yO(i,e)},dO=({stdio:t})=>Array.isArray(t)?Math.max(t.length,ae.length):ae.length,hO=(t,e,r)=>N(t)?pO(t,e,r):e.fill(t),pO=(t,e,r)=>{for(let i of Object.keys(t).sort(fO))for(let n of mO(i,r,e))e[n]=t[i];return e},fO=(t,e)=>Tp(t)<Tp(e)?1:-1,Tp=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,mO=(t,e,r)=>{if(t==="ipc")return [r.length-1];let i=uo(t);if(i===void 0||i===0)throw new TypeError(`"${e}.${t}" is invalid.
132
132
  It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(i>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
133
- Please set the "stdio" option to ensure that file descriptor exists.`);return i==="all"?[1,2]:[i]},ho=t=>{if(t==="all")return t;if(ae.includes(t))return ae.indexOf(t);let e=gE.exec(t);if(e!==null)return Number(e[1])},gE=/^fd(\d+)$/,yE=(t,e)=>t.map(r=>r===void 0?wE[e]:r),bE=util.debuglog("execa").enabled?"full":"none",wE={lines:false,buffer:true,maxBuffer:1e3*1e3*100,verbose:bE,stripFinalNewline:true},po=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ve=(t,e)=>e==="ipc"?t.at(-1):t[e];var Nt=({verbose:t},e)=>fo(t,e)!=="none",Bt=({verbose:t},e)=>!["none","short"].includes(fo(t,e)),Dp=({verbose:t},e)=>{let r=fo(t,e);return vi(r)?r:void 0},fo=(t,e)=>e===void 0?xE(t):Ve(t,e),xE=t=>t.find(e=>vi(e))??Ei.findLast(e=>t.includes(e)),vi=t=>typeof t=="function",Ei=["none","short","full"];var Pp=(t,e)=>{let r=[t,...e],i=r.join(" "),n=r.map(s=>kE(Ip(s))).join(" ");return {command:i,escapedCommand:n}},Er=t=>util.stripVTControlCharacters(t).split(`
134
- `).map(e=>Ip(e)).join(`
135
- `),Ip=t=>t.replaceAll(CE,e=>EE(e)),EE=t=>{let e=_E[t];if(e!==void 0)return e;let r=t.codePointAt(0),i=r.toString(16);return r<=TE?`\\u${i.padStart(4,"0")}`:`\\U${i}`},OE=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return /[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},CE=OE(),_E={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},TE=65535,kE=t=>AE.test(t)?t:k.platform==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,AE=/^[\w./-]+$/;function mo(){let{env:t}=k__default.default,{TERM:e,TERM_PROGRAM:r}=t;return k__default.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Mp={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Rp={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},DE={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},PE={...Mp,...Rp},IE={...Mp,...DE},$E=mo(),ME=$E?PE:IE,Oi=ME;var FE=RE__default.default?.WriteStream?.prototype?.hasColors?.()??false,v=(t,e)=>{if(!FE)return n=>n;let r=`\x1B[${t}m`,i=`\x1B[${e}m`;return n=>{let s=n+"",o=s.indexOf(i);if(o===-1)return r+s+i;let a=r,c=0,l=(e===22?i:"")+r;for(;o!==-1;)a+=s.slice(c,o)+l,c=o+i.length,o=s.indexOf(i,c);return a+=s.slice(c)+i,a}},Fp=v(1,22),Ci=v(90,39),Lp=v(91,39),qp=v(93,39);var Bp=({type:t,message:e,timestamp:r,piped:i,commandId:n,result:{failed:s=false}={},options:{reject:o=true}})=>{let a=LE(r),c=qE[t]({failed:s,reject:o,piped:i}),u=jE[t]({reject:o});return `${Ci(`[${a}]`)} ${Ci(`[${n}]`)} ${u(c)} ${u(e)}`},LE=t=>`${_i(t.getHours(),2)}:${_i(t.getMinutes(),2)}:${_i(t.getSeconds(),2)}.${_i(t.getMilliseconds(),3)}`,_i=(t,e)=>String(t).padStart(e,"0"),jp=({failed:t,reject:e})=>t?e?Oi.cross:Oi.warning:Oi.tick,qE={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:jp,duration:jp},Np=t=>t,jE={command:()=>Fp,output:()=>Np,ipc:()=>Np,error:({reject:t})=>t?Lp:qp,duration:()=>Ci};var Up=(t,e,r)=>{let i=Dp(e,r);return t.map(({verboseLine:n,verboseObject:s})=>NE(n,s,i)).filter(n=>n!==void 0).map(n=>BE(n)).join("")},NE=(t,e,r)=>{if(r===void 0)return t;let i=r(t,e);if(typeof i=="string")return i},BE=t=>t.endsWith(`
133
+ Please set the "stdio" option to ensure that file descriptor exists.`);return i==="all"?[1,2]:[i]},uo=t=>{if(t==="all")return t;if(ae.includes(t))return ae.indexOf(t);let e=gO.exec(t);if(e!==null)return Number(e[1])},gO=/^fd(\d+)$/,yO=(t,e)=>t.map(r=>r===void 0?wO[e]:r),bO=util.debuglog("execa").enabled?"full":"none",wO={lines:false,buffer:true,maxBuffer:1e3*1e3*100,verbose:bO,stripFinalNewline:true},ho=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ve=(t,e)=>e==="ipc"?t.at(-1):t[e];var Nt=({verbose:t},e)=>po(t,e)!=="none",Bt=({verbose:t},e)=>!["none","short"].includes(po(t,e)),Ap=({verbose:t},e)=>{let r=po(t,e);return vi(r)?r:void 0},po=(t,e)=>e===void 0?xO(t):Ve(t,e),xO=t=>t.find(e=>vi(e))??Oi.findLast(e=>t.includes(e)),vi=t=>typeof t=="function",Oi=["none","short","full"];var Dp=(t,e)=>{let r=[t,...e],i=r.join(" "),n=r.map(s=>kO(Pp(s))).join(" ");return {command:i,escapedCommand:n}},Or=t=>util.stripVTControlCharacters(t).split(`
134
+ `).map(e=>Pp(e)).join(`
135
+ `),Pp=t=>t.replaceAll(CO,e=>OO(e)),OO=t=>{let e=_O[t];if(e!==void 0)return e;let r=t.codePointAt(0),i=r.toString(16);return r<=TO?`\\u${i.padStart(4,"0")}`:`\\U${i}`},EO=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return /[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},CO=EO(),_O={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},TO=65535,kO=t=>AO.test(t)?t:k.platform==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,AO=/^[\w./-]+$/;function fo(){let{env:t}=k__default.default,{TERM:e,TERM_PROGRAM:r}=t;return k__default.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var $p={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Mp={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},DO={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},PO={...$p,...Mp},IO={...$p,...DO},$O=fo(),MO=$O?PO:IO,Ei=MO;var FO=RO__default.default?.WriteStream?.prototype?.hasColors?.()??false,v=(t,e)=>{if(!FO)return n=>n;let r=`\x1B[${t}m`,i=`\x1B[${e}m`;return n=>{let s=n+"",o=s.indexOf(i);if(o===-1)return r+s+i;let a=r,c=0,l=(e===22?i:"")+r;for(;o!==-1;)a+=s.slice(c,o)+l,c=o+i.length,o=s.indexOf(i,c);return a+=s.slice(c)+i,a}},Rp=v(1,22),Ci=v(90,39),Fp=v(91,39),Lp=v(93,39);var Np=({type:t,message:e,timestamp:r,piped:i,commandId:n,result:{failed:s=false}={},options:{reject:o=true}})=>{let a=LO(r),c=qO[t]({failed:s,reject:o,piped:i}),u=jO[t]({reject:o});return `${Ci(`[${a}]`)} ${Ci(`[${n}]`)} ${u(c)} ${u(e)}`},LO=t=>`${_i(t.getHours(),2)}:${_i(t.getMinutes(),2)}:${_i(t.getSeconds(),2)}.${_i(t.getMilliseconds(),3)}`,_i=(t,e)=>String(t).padStart(e,"0"),qp=({failed:t,reject:e})=>t?e?Ei.cross:Ei.warning:Ei.tick,qO={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:qp,duration:qp},jp=t=>t,jO={command:()=>Rp,output:()=>jp,ipc:()=>jp,error:({reject:t})=>t?Fp:Lp,duration:()=>Ci};var Bp=(t,e,r)=>{let i=Ap(e,r);return t.map(({verboseLine:n,verboseObject:s})=>NO(n,s,i)).filter(n=>n!==void 0).map(n=>BO(n)).join("")},NO=(t,e,r)=>{if(r===void 0)return t;let i=r(t,e);if(typeof i=="string")return i},BO=t=>t.endsWith(`
136
136
  `)?t:`${t}
137
- `;var Ce=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:i,result:n})=>{let s=GE({type:t,result:n,verboseInfo:i}),o=VE(e,s),a=Up(o,i,r);a!==""&&console.warn(a.slice(0,-1));},GE=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:i,rawOptions:{piped:n=false,...s}}})=>({type:t,escapedCommand:r,commandId:`${i}`,timestamp:new Date,piped:n,result:e,options:s}),VE=(t,e)=>t.split(`
138
- `).map(r=>WE({...e,message:r})),WE=t=>({verboseLine:Bp(t),verboseObject:t}),Ti=t=>{let e=typeof t=="string"?t:util.inspect(t);return Er(e).replaceAll(" "," ".repeat(HE))},HE=2;var Gp=(t,e)=>{Nt(e)&&Ce({type:"command",verboseMessage:t,verboseInfo:e});};var Vp=(t,e,r)=>{JE(t);let i=zE(t);return {verbose:t,escapedCommand:e,commandId:i,rawOptions:r}},zE=t=>Nt({verbose:t})?YE++:void 0,YE=0n,JE=t=>{for(let e of t){if(e===false)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===true)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Ei.includes(e)&&!vi(e)){let r=Ei.map(i=>`'${i}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}};var ki=()=>k.hrtime.bigint(),go=t=>Number(k.hrtime.bigint()-t)/1e6;var Ai=(t,e,r)=>{let i=ki(),{command:n,escapedCommand:s}=Pp(t,e),o=uo(r,"verbose"),a=Vp(o,s,{...r});return Gp(s,a),{command:n,escapedCommand:s,startTime:i,verboseInfo:a}};var Wm=Ie(Mf());function Pi(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"}util.promisify(Rn.execFile);function Ii(t){return t instanceof URL?url.fileURLToPath(t):t}function Ff(t){return {*[Symbol.iterator](){let e=ne__default.default.resolve(Ii(t)),r;for(;r!==e;)yield e,r=e,e=ne__default.default.resolve(e,"..");}}}var CO=({cwd:t=k__default.default.cwd(),path:e=k__default.default.env[Pi()],preferLocal:r=true,execPath:i=k__default.default.execPath,addExecPath:n=true}={})=>{let s=ne__default.default.resolve(Ii(t)),o=[],a=e.split(ne__default.default.delimiter);return r&&_O(o,a,s),n&&TO(o,a,i,s),e===""||e===ne__default.default.delimiter?`${o.join(ne__default.default.delimiter)}${e}`:[...o,e].join(ne__default.default.delimiter)},_O=(t,e,r)=>{for(let i of Ff(r)){let n=ne__default.default.join(i,"node_modules/.bin");e.includes(n)||t.push(n);}},TO=(t,e,r,i)=>{let n=ne__default.default.resolve(i,Ii(r),"..");e.includes(n)||t.push(n);},Lf=({env:t=k__default.default.env,...e}={})=>{t={...t};let r=Pi({env:t});return e.path=t[r],t[r]=CO(e),t};var qf=(t,e,r)=>{let i=r?Cr:Or,n=t instanceof fe?{}:{cause:t};return new i(e,n)},fe=class extends Error{},jf=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:true,enumerable:false,configurable:true}),Object.defineProperty(t.prototype,Bf,{value:true,writable:false,enumerable:false,configurable:false});},Nf=t=>Mi(t)&&Bf in t,Bf=Symbol("isExecaError"),Mi=t=>Object.prototype.toString.call(t)==="[object Error]",Or=class extends Error{};jf(Or,Or.name);var Cr=class extends Error{};jf(Cr,Cr.name);var Uf=()=>{let t=Vf-Gf+1;return Array.from({length:t},kO)},kO=(t,e)=>({name:`SIGRT${e+1}`,number:Gf+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Gf=34,Vf=64;var Wf=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:true},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var _o=()=>{let t=Uf();return [...Wf,...t].map(DO)},DO=({name:t,number:e,description:r,action:i,forced:n=false,standard:s})=>{let{signals:{[t]:o}}=os.constants,a=o!==void 0;return {name:t,number:a?o:e,description:r,supported:a,action:i,forced:n,standard:s}};var IO=()=>{let t=_o();return Object.fromEntries(t.map($O))},$O=({name:t,number:e,description:r,supported:i,action:n,forced:s,standard:o})=>[t,{name:t,number:e,description:r,supported:i,action:n,forced:s,standard:o}],Hf=IO(),MO=()=>{let t=_o(),e=65,r=Array.from({length:e},(i,n)=>RO(n,t));return Object.assign({},...r)},RO=(t,e)=>{let r=FO(t,e);if(r===void 0)return {};let{name:i,description:n,supported:s,action:o,forced:a,standard:c}=r;return {[t]:{name:i,number:t,description:n,supported:s,action:o,forced:a,standard:c}}},FO=(t,e)=>{let r=e.find(({name:i})=>os.constants.signals[i]===t);return r!==void 0?r:e.find(i=>i.number===t)};MO();var Yf=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return Kf(t,e)},Jf=t=>t===0?t:Kf(t,"`subprocess.kill()`'s argument"),Kf=(t,e)=>{if(Number.isInteger(t))return LO(t,e);if(typeof t=="string")return jO(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
139
- ${To()}`)},LO=(t,e)=>{if(zf.has(t))return zf.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
140
- ${To()}`)},qO=()=>new Map(Object.entries(os.constants.signals).reverse().map(([t,e])=>[e,t])),zf=qO(),jO=(t,e)=>{if(t in os.constants.signals)return t;throw t.toUpperCase()in os.constants.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
141
- ${To()}`)},To=()=>`Available signal names: ${NO()}.
142
- Available signal numbers: ${BO()}.`,NO=()=>Object.keys(os.constants.signals).sort().map(t=>`'${t}'`).join(", "),BO=()=>[...new Set(Object.values(os.constants.signals).sort((t,e)=>t-e))].join(", "),Ri=t=>Hf[t].description;var Zf=t=>{if(t===false)return t;if(t===true)return GO;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},GO=1e3*5,Xf=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:i,context:n,controller:s},o,a)=>{let{signal:c,error:u}=VO(o,a,r);WO(u,i);let l=t(c);return HO({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:l,context:n,controller:s}),l},VO=(t,e,r)=>{let[i=r,n]=Mi(t)?[void 0,t]:[t,e];if(typeof i!="string"&&!Number.isInteger(i))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(i)}`);if(n!==void 0&&!Mi(n))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${n}`);return {signal:Jf(i),error:n}},WO=(t,e)=>{t!==void 0&&e.reject(t);},HO=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:i,killResult:n,context:s,controller:o})=>{e===i&&n&&ko({kill:t,forceKillAfterDelay:r,context:s,controllerSignal:o.signal});},ko=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:i})=>{if(e!==false)try{await promises$1.setTimeout(e,void 0,{signal:i}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0);}catch{}};var Fi=async(t,e)=>{t.aborted||await events.once(t,"abort",{signal:e});};var Qf=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},em=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:i,controller:n})=>e===void 0||r?[]:[YO(t,e,i,n)],YO=async(t,e,r,{signal:i})=>{throw await Fi(e,i),r.terminationReason??="cancel",t.kill(),e.reason};var Vt=({methodName:t,isSubprocess:e,ipc:r,isConnected:i})=>{JO(t,e,r),Ao(t,e,i);},JO=(t,e,r)=>{if(!r)throw new Error(`${me(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},Ao=(t,e,r)=>{if(!r)throw new Error(`${me(t,e)} cannot be used: the ${st(e)} has already exited or disconnected.`)},tm=t=>{throw new Error(`${me("getOneMessage",t)} could not complete: the ${st(t)} exited or disconnected.`)},rm=t=>{throw new Error(`${me("sendMessage",t)} failed: the ${st(t)} is sending a message too, instead of listening to incoming messages.
137
+ `;var Ce=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:i,result:n})=>{let s=GO({type:t,result:n,verboseInfo:i}),o=VO(e,s),a=Bp(o,i,r);a!==""&&console.warn(a.slice(0,-1));},GO=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:i,rawOptions:{piped:n=false,...s}}})=>({type:t,escapedCommand:r,commandId:`${i}`,timestamp:new Date,piped:n,result:e,options:s}),VO=(t,e)=>t.split(`
138
+ `).map(r=>WO({...e,message:r})),WO=t=>({verboseLine:Np(t),verboseObject:t}),Ti=t=>{let e=typeof t=="string"?t:util.inspect(t);return Or(e).replaceAll(" "," ".repeat(HO))},HO=2;var Up=(t,e)=>{Nt(e)&&Ce({type:"command",verboseMessage:t,verboseInfo:e});};var Gp=(t,e,r)=>{JO(t);let i=zO(t);return {verbose:t,escapedCommand:e,commandId:i,rawOptions:r}},zO=t=>Nt({verbose:t})?YO++:void 0,YO=0n,JO=t=>{for(let e of t){if(e===false)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===true)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Oi.includes(e)&&!vi(e)){let r=Oi.map(i=>`'${i}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}};var ki=()=>k.hrtime.bigint(),mo=t=>Number(k.hrtime.bigint()-t)/1e6;var Ai=(t,e,r)=>{let i=ki(),{command:n,escapedCommand:s}=Dp(t,e),o=lo(r,"verbose"),a=Gp(o,s,{...r});return Up(s,a),{command:n,escapedCommand:s,startTime:i,verboseInfo:a}};var Vm=Ie($f());function Pi(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"}util.promisify(Mn.execFile);function Ii(t){return t instanceof URL?url.fileURLToPath(t):t}function Rf(t){return {*[Symbol.iterator](){let e=ne__default.default.resolve(Ii(t)),r;for(;r!==e;)yield e,r=e,e=ne__default.default.resolve(e,"..");}}}var CE=({cwd:t=k__default.default.cwd(),path:e=k__default.default.env[Pi()],preferLocal:r=true,execPath:i=k__default.default.execPath,addExecPath:n=true}={})=>{let s=ne__default.default.resolve(Ii(t)),o=[],a=e.split(ne__default.default.delimiter);return r&&_E(o,a,s),n&&TE(o,a,i,s),e===""||e===ne__default.default.delimiter?`${o.join(ne__default.default.delimiter)}${e}`:[...o,e].join(ne__default.default.delimiter)},_E=(t,e,r)=>{for(let i of Rf(r)){let n=ne__default.default.join(i,"node_modules/.bin");e.includes(n)||t.push(n);}},TE=(t,e,r,i)=>{let n=ne__default.default.resolve(i,Ii(r),"..");e.includes(n)||t.push(n);},Ff=({env:t=k__default.default.env,...e}={})=>{t={...t};let r=Pi({env:t});return e.path=t[r],t[r]=CE(e),t};var Lf=(t,e,r)=>{let i=r?Cr:Er,n=t instanceof fe?{}:{cause:t};return new i(e,n)},fe=class extends Error{},qf=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:true,enumerable:false,configurable:true}),Object.defineProperty(t.prototype,Nf,{value:true,writable:false,enumerable:false,configurable:false});},jf=t=>Mi(t)&&Nf in t,Nf=Symbol("isExecaError"),Mi=t=>Object.prototype.toString.call(t)==="[object Error]",Er=class extends Error{};qf(Er,Er.name);var Cr=class extends Error{};qf(Cr,Cr.name);var Bf=()=>{let t=Gf-Uf+1;return Array.from({length:t},kE)},kE=(t,e)=>({name:`SIGRT${e+1}`,number:Uf+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Uf=34,Gf=64;var Vf=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:true},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Co=()=>{let t=Bf();return [...Vf,...t].map(DE)},DE=({name:t,number:e,description:r,action:i,forced:n=false,standard:s})=>{let{signals:{[t]:o}}=os.constants,a=o!==void 0;return {name:t,number:a?o:e,description:r,supported:a,action:i,forced:n,standard:s}};var IE=()=>{let t=Co();return Object.fromEntries(t.map($E))},$E=({name:t,number:e,description:r,supported:i,action:n,forced:s,standard:o})=>[t,{name:t,number:e,description:r,supported:i,action:n,forced:s,standard:o}],Wf=IE(),ME=()=>{let t=Co(),e=65,r=Array.from({length:e},(i,n)=>RE(n,t));return Object.assign({},...r)},RE=(t,e)=>{let r=FE(t,e);if(r===void 0)return {};let{name:i,description:n,supported:s,action:o,forced:a,standard:c}=r;return {[t]:{name:i,number:t,description:n,supported:s,action:o,forced:a,standard:c}}},FE=(t,e)=>{let r=e.find(({name:i})=>os.constants.signals[i]===t);return r!==void 0?r:e.find(i=>i.number===t)};ME();var zf=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return Jf(t,e)},Yf=t=>t===0?t:Jf(t,"`subprocess.kill()`'s argument"),Jf=(t,e)=>{if(Number.isInteger(t))return LE(t,e);if(typeof t=="string")return jE(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
139
+ ${_o()}`)},LE=(t,e)=>{if(Hf.has(t))return Hf.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
140
+ ${_o()}`)},qE=()=>new Map(Object.entries(os.constants.signals).reverse().map(([t,e])=>[e,t])),Hf=qE(),jE=(t,e)=>{if(t in os.constants.signals)return t;throw t.toUpperCase()in os.constants.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
141
+ ${_o()}`)},_o=()=>`Available signal names: ${NE()}.
142
+ Available signal numbers: ${BE()}.`,NE=()=>Object.keys(os.constants.signals).sort().map(t=>`'${t}'`).join(", "),BE=()=>[...new Set(Object.values(os.constants.signals).sort((t,e)=>t-e))].join(", "),Ri=t=>Wf[t].description;var Kf=t=>{if(t===false)return t;if(t===true)return GE;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},GE=1e3*5,Zf=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:i,context:n,controller:s},o,a)=>{let{signal:c,error:u}=VE(o,a,r);WE(u,i);let l=t(c);return HE({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:l,context:n,controller:s}),l},VE=(t,e,r)=>{let[i=r,n]=Mi(t)?[void 0,t]:[t,e];if(typeof i!="string"&&!Number.isInteger(i))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(i)}`);if(n!==void 0&&!Mi(n))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${n}`);return {signal:Yf(i),error:n}},WE=(t,e)=>{t!==void 0&&e.reject(t);},HE=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:i,killResult:n,context:s,controller:o})=>{e===i&&n&&To({kill:t,forceKillAfterDelay:r,context:s,controllerSignal:o.signal});},To=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:i})=>{if(e!==false)try{await promises$1.setTimeout(e,void 0,{signal:i}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0);}catch{}};var Fi=async(t,e)=>{t.aborted||await events.once(t,"abort",{signal:e});};var Xf=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},Qf=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:i,controller:n})=>e===void 0||r?[]:[YE(t,e,i,n)],YE=async(t,e,r,{signal:i})=>{throw await Fi(e,i),r.terminationReason??="cancel",t.kill(),e.reason};var Vt=({methodName:t,isSubprocess:e,ipc:r,isConnected:i})=>{JE(t,e,r),ko(t,e,i);},JE=(t,e,r)=>{if(!r)throw new Error(`${me(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},ko=(t,e,r)=>{if(!r)throw new Error(`${me(t,e)} cannot be used: the ${st(e)} has already exited or disconnected.`)},em=t=>{throw new Error(`${me("getOneMessage",t)} could not complete: the ${st(t)} exited or disconnected.`)},tm=t=>{throw new Error(`${me("sendMessage",t)} failed: the ${st(t)} is sending a message too, instead of listening to incoming messages.
143
143
  This can be fixed by both sending a message and listening to incoming messages at the same time:
144
144
 
145
145
  const [receivedMessage] = await Promise.all([
146
146
  ${me("getOneMessage",t)},
147
147
  ${me("sendMessage",t,"message, {strict: true}")},
148
- ]);`)},Li=(t,e)=>new Error(`${me("sendMessage",e)} failed when sending an acknowledgment response to the ${st(e)}.`,{cause:t}),im=t=>{throw new Error(`${me("sendMessage",t)} failed: the ${st(t)} is not listening to incoming messages.`)},nm=t=>{throw new Error(`${me("sendMessage",t)} failed: the ${st(t)} exited without listening to incoming messages.`)},sm=()=>new Error(`\`cancelSignal\` aborted: the ${st(true)} disconnected.`),om=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},am=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${me(e,r)} cannot be used: the ${st(r)} is disconnecting.`,{cause:t})},cm=({error:t,methodName:e,isSubprocess:r,message:i})=>{if(KO(t))throw new Error(`${me(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(i)}.`,{cause:t})},KO=({code:t,message:e})=>ZO.has(t)||XO.some(r=>e.includes(r)),ZO=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),XO=["could not be cloned","circular structure","call stack size exceeded"],me=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${QO(e)}${t}(${r})`,QO=t=>t?"":"subprocess.",st=t=>t?"parent process":"subprocess",Wt=t=>{t.connected&&t.disconnect();};var _e=()=>{let t={},e=new Promise((r,i)=>{Object.assign(t,{resolve:r,reject:i});});return Object.assign(e,t)};var ji=(t,e="stdin")=>{let{options:i,fileDescriptors:n}=Te.get(t),s=lm(n,e,true),o=t.stdio[s];if(o===null)throw new TypeError(um(s,e,i,true));return o},Ht=(t,e="stdout")=>{let{options:i,fileDescriptors:n}=Te.get(t),s=lm(n,e,false),o=s==="all"?t.all:t.stdio[s];if(o==null)throw new TypeError(um(s,e,i,false));return o},Te=new WeakMap,lm=(t,e,r)=>{let i=eC(e,r);return tC(i,e,r,t),i},eC=(t,e)=>{let r=ho(t);if(r!==void 0)return r;let{validOptions:i,defaultValue:n}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Tr(e)}" must not be "${t}".
148
+ ]);`)},Li=(t,e)=>new Error(`${me("sendMessage",e)} failed when sending an acknowledgment response to the ${st(e)}.`,{cause:t}),rm=t=>{throw new Error(`${me("sendMessage",t)} failed: the ${st(t)} is not listening to incoming messages.`)},im=t=>{throw new Error(`${me("sendMessage",t)} failed: the ${st(t)} exited without listening to incoming messages.`)},nm=()=>new Error(`\`cancelSignal\` aborted: the ${st(true)} disconnected.`),sm=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},om=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${me(e,r)} cannot be used: the ${st(r)} is disconnecting.`,{cause:t})},am=({error:t,methodName:e,isSubprocess:r,message:i})=>{if(KE(t))throw new Error(`${me(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(i)}.`,{cause:t})},KE=({code:t,message:e})=>ZE.has(t)||XE.some(r=>e.includes(r)),ZE=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),XE=["could not be cloned","circular structure","call stack size exceeded"],me=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${QE(e)}${t}(${r})`,QE=t=>t?"":"subprocess.",st=t=>t?"parent process":"subprocess",Wt=t=>{t.connected&&t.disconnect();};var _e=()=>{let t={},e=new Promise((r,i)=>{Object.assign(t,{resolve:r,reject:i});});return Object.assign(e,t)};var ji=(t,e="stdin")=>{let{options:i,fileDescriptors:n}=Te.get(t),s=cm(n,e,true),o=t.stdio[s];if(o===null)throw new TypeError(lm(s,e,i,true));return o},Ht=(t,e="stdout")=>{let{options:i,fileDescriptors:n}=Te.get(t),s=cm(n,e,false),o=s==="all"?t.all:t.stdio[s];if(o==null)throw new TypeError(lm(s,e,i,false));return o},Te=new WeakMap,cm=(t,e,r)=>{let i=eC(e,r);return tC(i,e,r,t),i},eC=(t,e)=>{let r=uo(t);if(r!==void 0)return r;let{validOptions:i,defaultValue:n}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Tr(e)}" must not be "${t}".
149
149
  It must be ${i} or "fd3", "fd4" (and so on).
150
- It is optional and defaults to "${n}".`)},tC=(t,e,r,i)=>{let n=i[dm(t)];if(n===void 0)throw new TypeError(`"${Tr(r)}" must not be ${e}. That file descriptor does not exist.
151
- Please set the "stdio" option to ensure that file descriptor exists.`);if(n.direction==="input"&&!r)throw new TypeError(`"${Tr(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(n.direction!=="input"&&r)throw new TypeError(`"${Tr(r)}" must not be ${e}. It must be a writable stream, not readable.`)},um=(t,e,r,i)=>{if(t==="all"&&!r.all)return `The "all" option must be true to use "from: 'all'".`;let{optionName:n,optionValue:s}=rC(t,r);return `The "${n}: ${qi(s)}" option is incompatible with using "${Tr(i)}: ${qi(e)}".
152
- Please set this option with "pipe" instead.`},rC=(t,{stdin:e,stdout:r,stderr:i,stdio:n})=>{let s=dm(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&r!==void 0?{optionName:"stdout",optionValue:r}:s===2&&i!==void 0?{optionName:"stderr",optionValue:i}:{optionName:`stdio[${s}]`,optionValue:n[s]}},dm=t=>t==="all"?1:t,Tr=t=>t?"to":"from",qi=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream";var yt=(t,e,r)=>{let i=t.getMaxListeners();i===0||i===Number.POSITIVE_INFINITY||(t.setMaxListeners(i+e),events.addAbortListener(r,()=>{t.setMaxListeners(t.getMaxListeners()-e);}));};var Ni=(t,e)=>{e&&Do(t);},Do=t=>{t.refCounted();},Bi=(t,e)=>{e&&Po(t);},Po=t=>{t.unrefCounted();},hm=(t,e)=>{e&&(Po(t),Po(t));},pm=(t,e)=>{e&&(Do(t),Do(t));};var fm=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i},n)=>{if(ym(n)||wm(n))return;Ui.has(t)||Ui.set(t,[]);let s=Ui.get(t);if(s.push(n),!(s.length>1))for(;s.length>0;){await bm(t,i,n),await promises$1.scheduler.yield();let o=await gm({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i});s.shift(),i.emit("message",o),i.emit("message:done");}},mm=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i,boundOnMessage:n})=>{Io();let s=Ui.get(t);for(;s?.length>0;)await events.once(i,"message:done");t.removeListener("message",n),pm(e,r),i.connected=false,i.emit("disconnect");},Ui=new WeakMap;var ot=(t,e,r)=>{if(Gi.has(t))return Gi.get(t);let i=new events.EventEmitter;return i.connected=true,Gi.set(t,i),aC({ipcEmitter:i,anyProcess:t,channel:e,isSubprocess:r}),i},Gi=new WeakMap,aC=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:i})=>{let n=fm.bind(void 0,{anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:t});e.on("message",n),e.once("disconnect",mm.bind(void 0,{anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:t,boundOnMessage:n})),hm(r,i);},Vi=t=>{let e=Gi.get(t);return e===void 0?t.channel!==null:e.connected};var xm=({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:n})=>{if(!n)return i;let s=ot(t,e,r),o=zi(t,s);return {id:lC++,type:Hi,message:i,hasListeners:o}},lC=0n,Sm=(t,e)=>{if(!(e?.type!==Hi||e.hasListeners))for(let{id:r}of t)r!==void 0&&Wi[r].resolve({isDeadlock:true,hasListeners:false});},gm=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:n})=>{if(t?.type!==Hi||!e.connected)return t;let{id:s,message:o}=t,a={id:s,type:Em,message:zi(e,n)};try{await Yi({anyProcess:e,channel:r,isSubprocess:i,ipc:!0},a);}catch(c){n.emit("strict:error",c);}return o},ym=t=>{if(t?.type!==Em)return false;let{id:e,message:r}=t;return Wi[e]?.resolve({isDeadlock:false,hasListeners:r}),true},vm=async(t,e,r)=>{if(t?.type!==Hi)return;let i=_e();Wi[t.id]=i;let n=new AbortController;try{let{isDeadlock:s,hasListeners:o}=await Promise.race([i,uC(e,r,n)]);s&&rm(r),o||im(r);}finally{n.abort(),delete Wi[t.id];}},Wi={},uC=async(t,e,{signal:r})=>{yt(t,1,r),await events.once(t,"disconnect",{signal:r}),nm(e);},Hi="execa:ipc:request",Em="execa:ipc:response";var Om=(t,e,r)=>{kr.has(t)||kr.set(t,new Set);let i=kr.get(t),n=_e(),s=r?e.id:void 0,o={onMessageSent:n,id:s};return i.add(o),{outgoingMessages:i,outgoingMessage:o}},Cm=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve();},bm=async(t,e,r)=>{for(;!zi(t,e)&&kr.get(t)?.size>0;){let i=[...kr.get(t)];Sm(i,r),await Promise.all(i.map(({onMessageSent:n})=>n));}},kr=new WeakMap,zi=(t,e)=>e.listenerCount("message")>dC(t),dC=t=>Te.has(t)&&!Ve(Te.get(t).options.buffer,"ipc")?1:0;var Yi=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},n,{strict:s=false}={})=>{let o="sendMessage";return Vt({methodName:o,isSubprocess:r,ipc:i,isConnected:t.connected}),pC({anyProcess:t,channel:e,methodName:o,isSubprocess:r,message:n,strict:s})},pC=async({anyProcess:t,channel:e,methodName:r,isSubprocess:i,message:n,strict:s})=>{let o=xm({anyProcess:t,channel:e,isSubprocess:i,message:n,strict:s}),a=Om(t,o,s);try{await Mo({anyProcess:t,methodName:r,isSubprocess:i,wrappedMessage:o,message:n});}catch(c){throw Wt(t),c}finally{Cm(a);}},Mo=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:i,message:n})=>{let s=fC(t);try{await Promise.all([vm(i,t,r),s(i)]);}catch(o){throw am({error:o,methodName:e,isSubprocess:r}),cm({error:o,methodName:e,isSubprocess:r,message:n}),o}},fC=t=>{if($o.has(t))return $o.get(t);let e=util.promisify(t.send.bind(t));return $o.set(t,e),e},$o=new WeakMap;var Tm=(t,e)=>{let r="cancelSignal";return Ao(r,false,t.connected),Mo({anyProcess:t,methodName:r,isSubprocess:false,wrappedMessage:{type:Am,message:e},message:e})},km=async({anyProcess:t,channel:e,isSubprocess:r,ipc:i})=>(await gC({anyProcess:t,channel:e,isSubprocess:r,ipc:i}),Ro.signal),gC=async({anyProcess:t,channel:e,isSubprocess:r,ipc:i})=>{if(!_m){if(_m=true,!i){om();return}if(e===null){Io();return}ot(t,e,r),await promises$1.scheduler.yield();}},_m=false,wm=t=>t?.type!==Am?false:(Ro.abort(t.message),true),Am="execa:ipc:cancel",Io=()=>{Ro.abort(sm());},Ro=new AbortController;var Dm=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:i})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(i==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},Pm=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:i,context:n,controller:s})=>r?[yC({subprocess:t,cancelSignal:e,forceKillAfterDelay:i,context:n,controller:s})]:[],yC=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:{signal:n}})=>{await Fi(e,n);let s=bC(e);throw await Tm(t,s),ko({kill:t.kill,forceKillAfterDelay:r,context:i,controllerSignal:n}),i.terminationReason??="gracefulCancel",e.reason},bC=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:false,configurable:true,writable:true}),e};var Im=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},$m=(t,e,r,i)=>e===0||e===void 0?[]:[xC(t,e,r,i)],xC=async(t,e,r,{signal:i})=>{throw await promises$1.setTimeout(e,void 0,{signal:i}),r.terminationReason??="timeout",t.kill(),new fe};var Rm=({options:t})=>{if(t.node===false)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return {options:{...t,node:true}}},Fm=(t,e,{node:r=false,nodePath:i=k.execPath,nodeOptions:n=k.execArgv.filter(c=>!c.startsWith("--inspect")),cwd:s,execPath:o,...a})=>{if(o!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=jt(i,'The "nodePath" option'),u=ne__default.default.resolve(s,c),l={...a,nodePath:u,node:r,cwd:s};if(!r)return [t,e,l];if(ne__default.default.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return [u,[...n,t,...e],{ipc:true,...l,shell:false}]};var Lm=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");_C[r](t);}},OC=t=>{try{v8.serialize(t);}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},CC=t=>{try{JSON.stringify(t);}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},_C={advanced:OC,json:CC},qm=async(t,e)=>{e!==void 0&&await t.sendMessage(e);};var Nm=({encoding:t})=>{if(Fo.has(t))return;let e=kC(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Ji(t)}\`.
153
- Please rename it to ${Ji(e)}.`);let r=[...Fo].map(i=>Ji(i)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Ji(t)}\`.
154
- Please rename it to one of: ${r}.`)},TC=new Set(["utf8","utf16le"]),se=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Fo=new Set([...TC,...se]),kC=t=>{if(t===null)return "buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in jm)return jm[e];if(Fo.has(e))return e},jm={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Ji=t=>typeof t=="string"?`"${t}"`:String(t);var Bm=(t=Um())=>{let e=jt(t,'The "cwd" option');return ne__default.default.resolve(e)},Um=()=>{try{return k__default.default.cwd()}catch(t){throw t.message=`The current directory does not exist.
155
- ${t.message}`,t}},Gm=(t,e)=>{if(e===Um())return t;let r;try{r=Gr.statSync(e);}catch(i){return `The "cwd" option is invalid: ${e}.
150
+ It is optional and defaults to "${n}".`)},tC=(t,e,r,i)=>{let n=i[um(t)];if(n===void 0)throw new TypeError(`"${Tr(r)}" must not be ${e}. That file descriptor does not exist.
151
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(n.direction==="input"&&!r)throw new TypeError(`"${Tr(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(n.direction!=="input"&&r)throw new TypeError(`"${Tr(r)}" must not be ${e}. It must be a writable stream, not readable.`)},lm=(t,e,r,i)=>{if(t==="all"&&!r.all)return `The "all" option must be true to use "from: 'all'".`;let{optionName:n,optionValue:s}=rC(t,r);return `The "${n}: ${qi(s)}" option is incompatible with using "${Tr(i)}: ${qi(e)}".
152
+ Please set this option with "pipe" instead.`},rC=(t,{stdin:e,stdout:r,stderr:i,stdio:n})=>{let s=um(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&r!==void 0?{optionName:"stdout",optionValue:r}:s===2&&i!==void 0?{optionName:"stderr",optionValue:i}:{optionName:`stdio[${s}]`,optionValue:n[s]}},um=t=>t==="all"?1:t,Tr=t=>t?"to":"from",qi=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream";var yt=(t,e,r)=>{let i=t.getMaxListeners();i===0||i===Number.POSITIVE_INFINITY||(t.setMaxListeners(i+e),events.addAbortListener(r,()=>{t.setMaxListeners(t.getMaxListeners()-e);}));};var Ni=(t,e)=>{e&&Ao(t);},Ao=t=>{t.refCounted();},Bi=(t,e)=>{e&&Do(t);},Do=t=>{t.unrefCounted();},dm=(t,e)=>{e&&(Do(t),Do(t));},hm=(t,e)=>{e&&(Ao(t),Ao(t));};var pm=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i},n)=>{if(gm(n)||bm(n))return;Ui.has(t)||Ui.set(t,[]);let s=Ui.get(t);if(s.push(n),!(s.length>1))for(;s.length>0;){await ym(t,i,n),await promises$1.scheduler.yield();let o=await mm({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i});s.shift(),i.emit("message",o),i.emit("message:done");}},fm=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i,boundOnMessage:n})=>{Po();let s=Ui.get(t);for(;s?.length>0;)await events.once(i,"message:done");t.removeListener("message",n),hm(e,r),i.connected=false,i.emit("disconnect");},Ui=new WeakMap;var ot=(t,e,r)=>{if(Gi.has(t))return Gi.get(t);let i=new events.EventEmitter;return i.connected=true,Gi.set(t,i),aC({ipcEmitter:i,anyProcess:t,channel:e,isSubprocess:r}),i},Gi=new WeakMap,aC=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:i})=>{let n=pm.bind(void 0,{anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:t});e.on("message",n),e.once("disconnect",fm.bind(void 0,{anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:t,boundOnMessage:n})),dm(r,i);},Vi=t=>{let e=Gi.get(t);return e===void 0?t.channel!==null:e.connected};var wm=({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:n})=>{if(!n)return i;let s=ot(t,e,r),o=zi(t,s);return {id:lC++,type:Hi,message:i,hasListeners:o}},lC=0n,xm=(t,e)=>{if(!(e?.type!==Hi||e.hasListeners))for(let{id:r}of t)r!==void 0&&Wi[r].resolve({isDeadlock:true,hasListeners:false});},mm=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:n})=>{if(t?.type!==Hi||!e.connected)return t;let{id:s,message:o}=t,a={id:s,type:vm,message:zi(e,n)};try{await Yi({anyProcess:e,channel:r,isSubprocess:i,ipc:!0},a);}catch(c){n.emit("strict:error",c);}return o},gm=t=>{if(t?.type!==vm)return false;let{id:e,message:r}=t;return Wi[e]?.resolve({isDeadlock:false,hasListeners:r}),true},Sm=async(t,e,r)=>{if(t?.type!==Hi)return;let i=_e();Wi[t.id]=i;let n=new AbortController;try{let{isDeadlock:s,hasListeners:o}=await Promise.race([i,uC(e,r,n)]);s&&tm(r),o||rm(r);}finally{n.abort(),delete Wi[t.id];}},Wi={},uC=async(t,e,{signal:r})=>{yt(t,1,r),await events.once(t,"disconnect",{signal:r}),im(e);},Hi="execa:ipc:request",vm="execa:ipc:response";var Om=(t,e,r)=>{kr.has(t)||kr.set(t,new Set);let i=kr.get(t),n=_e(),s=r?e.id:void 0,o={onMessageSent:n,id:s};return i.add(o),{outgoingMessages:i,outgoingMessage:o}},Em=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve();},ym=async(t,e,r)=>{for(;!zi(t,e)&&kr.get(t)?.size>0;){let i=[...kr.get(t)];xm(i,r),await Promise.all(i.map(({onMessageSent:n})=>n));}},kr=new WeakMap,zi=(t,e)=>e.listenerCount("message")>dC(t),dC=t=>Te.has(t)&&!Ve(Te.get(t).options.buffer,"ipc")?1:0;var Yi=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},n,{strict:s=false}={})=>{let o="sendMessage";return Vt({methodName:o,isSubprocess:r,ipc:i,isConnected:t.connected}),pC({anyProcess:t,channel:e,methodName:o,isSubprocess:r,message:n,strict:s})},pC=async({anyProcess:t,channel:e,methodName:r,isSubprocess:i,message:n,strict:s})=>{let o=wm({anyProcess:t,channel:e,isSubprocess:i,message:n,strict:s}),a=Om(t,o,s);try{await $o({anyProcess:t,methodName:r,isSubprocess:i,wrappedMessage:o,message:n});}catch(c){throw Wt(t),c}finally{Em(a);}},$o=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:i,message:n})=>{let s=fC(t);try{await Promise.all([Sm(i,t,r),s(i)]);}catch(o){throw om({error:o,methodName:e,isSubprocess:r}),am({error:o,methodName:e,isSubprocess:r,message:n}),o}},fC=t=>{if(Io.has(t))return Io.get(t);let e=util.promisify(t.send.bind(t));return Io.set(t,e),e},Io=new WeakMap;var _m=(t,e)=>{let r="cancelSignal";return ko(r,false,t.connected),$o({anyProcess:t,methodName:r,isSubprocess:false,wrappedMessage:{type:km,message:e},message:e})},Tm=async({anyProcess:t,channel:e,isSubprocess:r,ipc:i})=>(await gC({anyProcess:t,channel:e,isSubprocess:r,ipc:i}),Mo.signal),gC=async({anyProcess:t,channel:e,isSubprocess:r,ipc:i})=>{if(!Cm){if(Cm=true,!i){sm();return}if(e===null){Po();return}ot(t,e,r),await promises$1.scheduler.yield();}},Cm=false,bm=t=>t?.type!==km?false:(Mo.abort(t.message),true),km="execa:ipc:cancel",Po=()=>{Mo.abort(nm());},Mo=new AbortController;var Am=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:i})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(i==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},Dm=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:i,context:n,controller:s})=>r?[yC({subprocess:t,cancelSignal:e,forceKillAfterDelay:i,context:n,controller:s})]:[],yC=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:{signal:n}})=>{await Fi(e,n);let s=bC(e);throw await _m(t,s),To({kill:t.kill,forceKillAfterDelay:r,context:i,controllerSignal:n}),i.terminationReason??="gracefulCancel",e.reason},bC=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:false,configurable:true,writable:true}),e};var Pm=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},Im=(t,e,r,i)=>e===0||e===void 0?[]:[xC(t,e,r,i)],xC=async(t,e,r,{signal:i})=>{throw await promises$1.setTimeout(e,void 0,{signal:i}),r.terminationReason??="timeout",t.kill(),new fe};var Mm=({options:t})=>{if(t.node===false)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return {options:{...t,node:true}}},Rm=(t,e,{node:r=false,nodePath:i=k.execPath,nodeOptions:n=k.execArgv.filter(c=>!c.startsWith("--inspect")),cwd:s,execPath:o,...a})=>{if(o!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=jt(i,'The "nodePath" option'),u=ne__default.default.resolve(s,c),l={...a,nodePath:u,node:r,cwd:s};if(!r)return [t,e,l];if(ne__default.default.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return [u,[...n,t,...e],{ipc:true,...l,shell:false}]};var Fm=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");_C[r](t);}},EC=t=>{try{v8.serialize(t);}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},CC=t=>{try{JSON.stringify(t);}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},_C={advanced:EC,json:CC},Lm=async(t,e)=>{e!==void 0&&await t.sendMessage(e);};var jm=({encoding:t})=>{if(Ro.has(t))return;let e=kC(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Ji(t)}\`.
153
+ Please rename it to ${Ji(e)}.`);let r=[...Ro].map(i=>Ji(i)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Ji(t)}\`.
154
+ Please rename it to one of: ${r}.`)},TC=new Set(["utf8","utf16le"]),se=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Ro=new Set([...TC,...se]),kC=t=>{if(t===null)return "buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in qm)return qm[e];if(Ro.has(e))return e},qm={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Ji=t=>typeof t=="string"?`"${t}"`:String(t);var Nm=(t=Bm())=>{let e=jt(t,'The "cwd" option');return ne__default.default.resolve(e)},Bm=()=>{try{return k__default.default.cwd()}catch(t){throw t.message=`The current directory does not exist.
155
+ ${t.message}`,t}},Um=(t,e)=>{if(e===Bm())return t;let r;try{r=Gr.statSync(e);}catch(i){return `The "cwd" option is invalid: ${e}.
156
156
  ${i.message}
157
157
  ${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
158
- ${t}`};var Ki=(t,e,r)=>{r.cwd=Bm(r.cwd);let[i,n,s]=Fm(t,e,r),{command:o,args:a,options:c}=Wm.default._parse(i,n,s),u=Ap(c),l=$C(u);return Im(l),Nm(l),Lm(l),Qf(l),Dm(l),l.shell=ao(l.shell),l.env=MC(l),l.killSignal=Yf(l.killSignal),l.forceKillAfterDelay=Zf(l.forceKillAfterDelay),l.lines=l.lines.map((d,h)=>d&&!se.has(l.encoding)&&l.buffer[h]),k__default.default.platform==="win32"&&ne__default.default.basename(o,".exe")==="cmd"&&a.unshift("/q"),{file:o,commandArguments:a,options:l}},$C=({extendEnv:t=true,preferLocal:e=false,cwd:r,localDir:i=r,encoding:n="utf8",reject:s=true,cleanup:o=true,all:a=false,windowsHide:c=true,killSignal:u="SIGTERM",forceKillAfterDelay:l=true,gracefulCancel:d=false,ipcInput:h,ipc:p=h!==void 0||d,serialization:m="advanced",...y})=>({...y,extendEnv:t,preferLocal:e,cwd:r,localDirectory:i,encoding:n,reject:s,cleanup:o,all:a,windowsHide:c,killSignal:u,forceKillAfterDelay:l,gracefulCancel:d,ipcInput:h,ipc:p,serialization:m}),MC=({env:t,extendEnv:e,preferLocal:r,node:i,localDirectory:n,nodePath:s})=>{let o=e?{...k__default.default.env,...t}:t;return r||i?Lf({env:o,cwd:n,execPath:s,preferLocal:r,addExecPath:i}):o};var Zi=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r];function zt(t){if(typeof t=="string")return RC(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return FC(t)}var RC=t=>t.at(-1)===Hm?t.slice(0,t.at(-2)===zm?-2:-1):t,FC=t=>t.at(-1)===LC?t.subarray(0,t.at(-2)===qC?-2:-1):t,Hm=`
159
- `,LC=Hm.codePointAt(0),zm="\r",qC=zm.codePointAt(0);function ge(t,{checkOpen:e=true}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function Lo(t,{checkOpen:e=true}={}){return ge(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function bt(t,{checkOpen:e=true}={}){return ge(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function qo(t,e){return Lo(t,e)&&bt(t,e)}var jC=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),jo=class{#t;#r;#e=false;#i=void 0;constructor(e,r){this.#t=e,this.#r=r;}next(){let e=()=>this.#s();return this.#i=this.#i?this.#i.then(e,e):e(),this.#i}return(e){let r=()=>this.#n(e);return this.#i?this.#i.then(r,r):r()}async#s(){if(this.#e)return {done:true,value:void 0};let e;try{e=await this.#t.read();}catch(r){throw this.#i=void 0,this.#e=true,this.#t.releaseLock(),r}return e.done&&(this.#i=void 0,this.#e=true,this.#t.releaseLock()),e}async#n(e){if(this.#e)return {done:true,value:e};if(this.#e=true,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:true,value:e}}return this.#t.releaseLock(),{done:true,value:e}}},No=Symbol();function Ym(){return this[No].next()}Object.defineProperty(Ym,"name",{value:"next"});function Jm(t){return this[No].return(t)}Object.defineProperty(Jm,"name",{value:"return"});var NC=Object.create(jC,{next:{enumerable:true,configurable:true,writable:true,value:Ym},return:{enumerable:true,configurable:true,writable:true,value:Jm}});function Bo({preventCancel:t=false}={}){let e=this.getReader(),r=new jo(e,t),i=Object.create(NC);return i[No]=r,i}var Km=t=>{if(bt(t,{checkOpen:false})&&Ar.on!==void 0)return UC(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(BC.call(t)==="[object ReadableStream]")return Bo.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:BC}=Object.prototype,UC=async function*(t){let e=new AbortController,r={};GC(t,e,r);try{for await(let[i]of Ar.on(t,"data",{signal:e.signal}))yield i;}catch(i){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw i}finally{t.destroy();}},GC=async(t,e,r)=>{try{await Ar.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1});}catch(i){r.error=i;}finally{e.abort();}},Ar={};var Yt=async(t,{init:e,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let u=Km(t),l=e();l.length=0;try{for await(let d of u){let h=WC(d),p=r[h](d,l);Qm({convertedChunk:p,state:l,getSize:i,truncateChunk:n,addChunk:s,maxBuffer:c});}return VC({state:l,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:o,maxBuffer:c}),a(l)}catch(d){let h=typeof d=="object"&&d!==null?d:new Error(d);throw h.bufferedData=a(l),h}},VC=({state:t,getSize:e,truncateChunk:r,addChunk:i,getFinalChunk:n,maxBuffer:s})=>{let o=n(t);o!==void 0&&Qm({convertedChunk:o,state:t,getSize:e,truncateChunk:r,addChunk:i,maxBuffer:s});},Qm=({convertedChunk:t,state:e,getSize:r,truncateChunk:i,addChunk:n,maxBuffer:s})=>{let o=r(t),a=e.length+o;if(a<=s){Zm(t,e,n,a);return}let c=i(t,s-e.length);throw c!==void 0&&Zm(c,e,n,s),new ke},Zm=(t,e,r,i)=>{e.contents=r(t,e,i),e.length=i;},WC=t=>{let e=typeof t;if(e==="string")return "string";if(e!=="object"||t===null)return "others";if(globalThis.Buffer?.isBuffer(t))return "buffer";let r=Xm.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&Xm.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:Xm}=Object.prototype,ke=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded");}};var We=t=>t,Dr=()=>{},Xi=({contents:t})=>t,Qi=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},en=t=>t.length;async function tn(t,e){return Yt(t,JC,e)}var HC=()=>({contents:[]}),zC=()=>1,YC=(t,{contents:e})=>(e.push(t),e),JC={init:HC,convertChunk:{string:We,buffer:We,arrayBuffer:We,dataView:We,typedArray:We,others:We},getSize:zC,truncateChunk:Dr,addChunk:YC,getFinalChunk:Dr,finalize:Xi};async function rn(t,e){return Yt(t,n_,e)}var KC=()=>({contents:new ArrayBuffer(0)}),ZC=t=>XC.encode(t),XC=new TextEncoder,eg=t=>new Uint8Array(t),tg=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),QC=(t,e)=>t.slice(0,e),e_=(t,{contents:e,length:r},i)=>{let n=ng()?r_(e,i):t_(e,i);return new Uint8Array(n).set(t,r),n},t_=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(ig(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},r_=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:ig(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},ig=t=>rg**Math.ceil(Math.log(t)/Math.log(rg)),rg=2,i_=({contents:t,length:e})=>ng()?t:t.slice(0,e),ng=()=>"resize"in ArrayBuffer.prototype,n_={init:KC,convertChunk:{string:ZC,buffer:eg,arrayBuffer:eg,dataView:tg,typedArray:tg,others:Qi},getSize:en,truncateChunk:QC,addChunk:e_,getFinalChunk:Dr,finalize:i_};async function sn(t,e){return Yt(t,l_,e)}var s_=()=>({contents:"",textDecoder:new TextDecoder}),nn=(t,{textDecoder:e})=>e.decode(t,{stream:true}),o_=(t,{contents:e})=>e+t,a_=(t,e)=>t.slice(0,e),c_=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},l_={init:s_,convertChunk:{string:We,buffer:nn,arrayBuffer:nn,dataView:nn,typedArray:nn,others:Qi},getSize:en,truncateChunk:a_,addChunk:o_,getFinalChunk:c_,finalize:Xi};Object.assign(Ar,{on:events.on,finished:promises.finished});var sg=({error:t,stream:e,readableObjectMode:r,lines:i,encoding:n,fdNumber:s})=>{if(!(t instanceof ke))throw t;if(s==="all")return t;let o=h_(r,i,n);throw t.maxBufferInfo={fdNumber:s,unit:o},e.destroy(),t},h_=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",og=(t,e,r)=>{if(e.length!==r)return;let i=new ke;throw i.maxBufferInfo={fdNumber:"ipc"},i},ag=(t,e)=>{let{streamName:r,threshold:i,unit:n}=p_(t,e);return `Command's ${r} was larger than ${i} ${n}`},p_=(t,e)=>{if(t?.maxBufferInfo===void 0)return {streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:i}}=t;delete t.maxBufferInfo;let n=Ve(e,r);return r==="ipc"?{streamName:"IPC output",threshold:n,unit:"messages"}:{streamName:Si(r),threshold:n,unit:i}},cg=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(i=>i!==null&&i.length>on(r)),lg=(t,e,r)=>{if(!e)return t;let i=on(r);return t.length>i?t.slice(0,i):t},on=([,t])=>t;var dg=({stdio:t,all:e,ipcOutput:r,originalError:i,signal:n,signalDescription:s,exitCode:o,escapedCommand:a,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:d,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:m,maxBuffer:y,timeout:w,cwd:b})=>{let S=i?.code,_=m_({originalError:i,timedOut:c,timeout:w,isMaxBuffer:d,maxBuffer:y,errorCode:S,signal:n,signalDescription:s,exitCode:o,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:m}),$=y_(i,b),oe=$===void 0?"":`
158
+ ${t}`};var Ki=(t,e,r)=>{r.cwd=Nm(r.cwd);let[i,n,s]=Rm(t,e,r),{command:o,args:a,options:c}=Vm.default._parse(i,n,s),u=kp(c),l=$C(u);return Pm(l),jm(l),Fm(l),Xf(l),Am(l),l.shell=oo(l.shell),l.env=MC(l),l.killSignal=zf(l.killSignal),l.forceKillAfterDelay=Kf(l.forceKillAfterDelay),l.lines=l.lines.map((d,h)=>d&&!se.has(l.encoding)&&l.buffer[h]),k__default.default.platform==="win32"&&ne__default.default.basename(o,".exe")==="cmd"&&a.unshift("/q"),{file:o,commandArguments:a,options:l}},$C=({extendEnv:t=true,preferLocal:e=false,cwd:r,localDir:i=r,encoding:n="utf8",reject:s=true,cleanup:o=true,all:a=false,windowsHide:c=true,killSignal:u="SIGTERM",forceKillAfterDelay:l=true,gracefulCancel:d=false,ipcInput:h,ipc:p=h!==void 0||d,serialization:m="advanced",...y})=>({...y,extendEnv:t,preferLocal:e,cwd:r,localDirectory:i,encoding:n,reject:s,cleanup:o,all:a,windowsHide:c,killSignal:u,forceKillAfterDelay:l,gracefulCancel:d,ipcInput:h,ipc:p,serialization:m}),MC=({env:t,extendEnv:e,preferLocal:r,node:i,localDirectory:n,nodePath:s})=>{let o=e?{...k__default.default.env,...t}:t;return r||i?Ff({env:o,cwd:n,execPath:s,preferLocal:r,addExecPath:i}):o};var Zi=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r];function zt(t){if(typeof t=="string")return RC(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return FC(t)}var RC=t=>t.at(-1)===Wm?t.slice(0,t.at(-2)===Hm?-2:-1):t,FC=t=>t.at(-1)===LC?t.subarray(0,t.at(-2)===qC?-2:-1):t,Wm=`
159
+ `,LC=Wm.codePointAt(0),Hm="\r",qC=Hm.codePointAt(0);function ge(t,{checkOpen:e=true}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function Fo(t,{checkOpen:e=true}={}){return ge(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function bt(t,{checkOpen:e=true}={}){return ge(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Lo(t,e){return Fo(t,e)&&bt(t,e)}var jC=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),qo=class{#t;#r;#e=false;#i=void 0;constructor(e,r){this.#t=e,this.#r=r;}next(){let e=()=>this.#s();return this.#i=this.#i?this.#i.then(e,e):e(),this.#i}return(e){let r=()=>this.#n(e);return this.#i?this.#i.then(r,r):r()}async#s(){if(this.#e)return {done:true,value:void 0};let e;try{e=await this.#t.read();}catch(r){throw this.#i=void 0,this.#e=true,this.#t.releaseLock(),r}return e.done&&(this.#i=void 0,this.#e=true,this.#t.releaseLock()),e}async#n(e){if(this.#e)return {done:true,value:e};if(this.#e=true,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:true,value:e}}return this.#t.releaseLock(),{done:true,value:e}}},jo=Symbol();function zm(){return this[jo].next()}Object.defineProperty(zm,"name",{value:"next"});function Ym(t){return this[jo].return(t)}Object.defineProperty(Ym,"name",{value:"return"});var NC=Object.create(jC,{next:{enumerable:true,configurable:true,writable:true,value:zm},return:{enumerable:true,configurable:true,writable:true,value:Ym}});function No({preventCancel:t=false}={}){let e=this.getReader(),r=new qo(e,t),i=Object.create(NC);return i[jo]=r,i}var Jm=t=>{if(bt(t,{checkOpen:false})&&Ar.on!==void 0)return UC(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(BC.call(t)==="[object ReadableStream]")return No.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:BC}=Object.prototype,UC=async function*(t){let e=new AbortController,r={};GC(t,e,r);try{for await(let[i]of Ar.on(t,"data",{signal:e.signal}))yield i;}catch(i){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw i}finally{t.destroy();}},GC=async(t,e,r)=>{try{await Ar.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1});}catch(i){r.error=i;}finally{e.abort();}},Ar={};var Yt=async(t,{init:e,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let u=Jm(t),l=e();l.length=0;try{for await(let d of u){let h=WC(d),p=r[h](d,l);Xm({convertedChunk:p,state:l,getSize:i,truncateChunk:n,addChunk:s,maxBuffer:c});}return VC({state:l,convertChunk:r,getSize:i,truncateChunk:n,addChunk:s,getFinalChunk:o,maxBuffer:c}),a(l)}catch(d){let h=typeof d=="object"&&d!==null?d:new Error(d);throw h.bufferedData=a(l),h}},VC=({state:t,getSize:e,truncateChunk:r,addChunk:i,getFinalChunk:n,maxBuffer:s})=>{let o=n(t);o!==void 0&&Xm({convertedChunk:o,state:t,getSize:e,truncateChunk:r,addChunk:i,maxBuffer:s});},Xm=({convertedChunk:t,state:e,getSize:r,truncateChunk:i,addChunk:n,maxBuffer:s})=>{let o=r(t),a=e.length+o;if(a<=s){Km(t,e,n,a);return}let c=i(t,s-e.length);throw c!==void 0&&Km(c,e,n,s),new ke},Km=(t,e,r,i)=>{e.contents=r(t,e,i),e.length=i;},WC=t=>{let e=typeof t;if(e==="string")return "string";if(e!=="object"||t===null)return "others";if(globalThis.Buffer?.isBuffer(t))return "buffer";let r=Zm.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&Zm.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:Zm}=Object.prototype,ke=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded");}};var We=t=>t,Dr=()=>{},Xi=({contents:t})=>t,Qi=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},en=t=>t.length;async function tn(t,e){return Yt(t,JC,e)}var HC=()=>({contents:[]}),zC=()=>1,YC=(t,{contents:e})=>(e.push(t),e),JC={init:HC,convertChunk:{string:We,buffer:We,arrayBuffer:We,dataView:We,typedArray:We,others:We},getSize:zC,truncateChunk:Dr,addChunk:YC,getFinalChunk:Dr,finalize:Xi};async function rn(t,e){return Yt(t,n_,e)}var KC=()=>({contents:new ArrayBuffer(0)}),ZC=t=>XC.encode(t),XC=new TextEncoder,Qm=t=>new Uint8Array(t),eg=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),QC=(t,e)=>t.slice(0,e),e_=(t,{contents:e,length:r},i)=>{let n=ig()?r_(e,i):t_(e,i);return new Uint8Array(n).set(t,r),n},t_=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(rg(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},r_=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:rg(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},rg=t=>tg**Math.ceil(Math.log(t)/Math.log(tg)),tg=2,i_=({contents:t,length:e})=>ig()?t:t.slice(0,e),ig=()=>"resize"in ArrayBuffer.prototype,n_={init:KC,convertChunk:{string:ZC,buffer:Qm,arrayBuffer:Qm,dataView:eg,typedArray:eg,others:Qi},getSize:en,truncateChunk:QC,addChunk:e_,getFinalChunk:Dr,finalize:i_};async function sn(t,e){return Yt(t,l_,e)}var s_=()=>({contents:"",textDecoder:new TextDecoder}),nn=(t,{textDecoder:e})=>e.decode(t,{stream:true}),o_=(t,{contents:e})=>e+t,a_=(t,e)=>t.slice(0,e),c_=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},l_={init:s_,convertChunk:{string:We,buffer:nn,arrayBuffer:nn,dataView:nn,typedArray:nn,others:Qi},getSize:en,truncateChunk:a_,addChunk:o_,getFinalChunk:c_,finalize:Xi};Object.assign(Ar,{on:events.on,finished:promises.finished});var ng=({error:t,stream:e,readableObjectMode:r,lines:i,encoding:n,fdNumber:s})=>{if(!(t instanceof ke))throw t;if(s==="all")return t;let o=h_(r,i,n);throw t.maxBufferInfo={fdNumber:s,unit:o},e.destroy(),t},h_=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",sg=(t,e,r)=>{if(e.length!==r)return;let i=new ke;throw i.maxBufferInfo={fdNumber:"ipc"},i},og=(t,e)=>{let{streamName:r,threshold:i,unit:n}=p_(t,e);return `Command's ${r} was larger than ${i} ${n}`},p_=(t,e)=>{if(t?.maxBufferInfo===void 0)return {streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:i}}=t;delete t.maxBufferInfo;let n=Ve(e,r);return r==="ipc"?{streamName:"IPC output",threshold:n,unit:"messages"}:{streamName:Si(r),threshold:n,unit:i}},ag=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(i=>i!==null&&i.length>on(r)),cg=(t,e,r)=>{if(!e)return t;let i=on(r);return t.length>i?t.slice(0,i):t},on=([,t])=>t;var ug=({stdio:t,all:e,ipcOutput:r,originalError:i,signal:n,signalDescription:s,exitCode:o,escapedCommand:a,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:d,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:m,maxBuffer:y,timeout:w,cwd:b})=>{let S=i?.code,_=m_({originalError:i,timedOut:c,timeout:w,isMaxBuffer:d,maxBuffer:y,errorCode:S,signal:n,signalDescription:s,exitCode:o,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:m}),$=y_(i,b),oe=$===void 0?"":`
160
160
  ${$}`,le=`${_}: ${a}${oe}`,Pe=e===void 0?[t[2],t[1]]:[e],be=[le,...Pe,...t.slice(3),r.map(x=>b_(x)).join(`
161
- `)].map(x=>Er(zt(w_(x)))).filter(Boolean).join(`
161
+ `)].map(x=>Or(zt(w_(x)))).filter(Boolean).join(`
162
162
 
163
- `);return {originalMessage:$,shortMessage:le,message:be}},m_=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:i,maxBuffer:n,errorCode:s,signal:o,signalDescription:a,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:h,killSignal:p})=>{let m=g_(d,h);return e?`Command timed out after ${r} milliseconds${m}`:l?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${o} (${a})`:u?`Command was canceled${m}`:i?`${ag(t,n)}${m}`:s!==void 0?`Command failed with ${s}${m}`:d?`Command was killed with ${p} (${Ri(p)})${m}`:o!==void 0?`Command was killed with ${o} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},g_=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",y_=(t,e)=>{if(t instanceof fe)return;let r=Nf(t)?t.originalMessage:String(t?.message??t),i=Er(Gm(r,e));return i===""?void 0:i},b_=t=>typeof t=="string"?t:util.inspect(t),w_=t=>Array.isArray(t)?t.map(e=>zt(ug(e))).filter(Boolean).join(`
164
- `):ug(t),ug=t=>typeof t=="string"?t:B(t)?wi(t):"";var an=({command:t,escapedCommand:e,stdio:r,all:i,ipcOutput:n,options:{cwd:s},startTime:o})=>hg({command:t,escapedCommand:e,cwd:s,durationMs:go(o),failed:false,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isTerminated:false,isMaxBuffer:false,isForcefullyTerminated:false,exitCode:0,stdout:r[1],stderr:r[2],all:i,stdio:r,ipcOutput:n,pipedFrom:[]}),Jt=({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:o})=>Pr({error:t,command:e,escapedCommand:r,startTime:s,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:false,isForcefullyTerminated:false,stdio:Array.from({length:i.length}),ipcOutput:[],options:n,isSync:o}),Pr=({error:t,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:d,all:h,ipcOutput:p,options:{timeoutDuration:m,timeout:y=m,forceKillAfterDelay:w,killSignal:b,cwd:S,maxBuffer:_},isSync:$})=>{let{exitCode:oe,signal:le,signalDescription:Pe}=S_(u,l),{originalMessage:be,shortMessage:x,message:T}=dg({stdio:d,all:h,ipcOutput:p,originalError:t,signal:le,signalDescription:Pe,exitCode:oe,escapedCommand:r,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:w,killSignal:b,maxBuffer:_,timeout:y,cwd:S}),O=qf(t,T,$);return Object.assign(O,x_({error:O,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:oe,signal:le,signalDescription:Pe,stdio:d,all:h,ipcOutput:p,cwd:S,originalMessage:be,shortMessage:x})),O},x_=({error:t,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,stdio:h,all:p,ipcOutput:m,cwd:y,originalMessage:w,shortMessage:b})=>hg({shortMessage:b,originalMessage:w,command:e,escapedCommand:r,cwd:y,durationMs:go(i),failed:true,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,code:t.cause?.code,stdout:h[1],stderr:h[2],all:p,stdio:h,ipcOutput:m,pipedFrom:[]}),hg=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),S_=(t,e)=>{let r=t===null?void 0:t,i=e===null?void 0:e,n=i===void 0?void 0:Ri(e);return {exitCode:r,signal:i,signalDescription:n}};var pg=t=>Number.isFinite(t)?t:0;function v_(t){return {days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(pg(t*1e3)%1e3),nanoseconds:Math.trunc(pg(t*1e6)%1e3)}}function E_(t){return {days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Uo(t){switch(typeof t){case "number":{if(Number.isFinite(t))return v_(t);break}case "bigint":return E_(t)}throw new TypeError("Expected a finite number or bigint")}var O_=t=>t===0||t===0n,C_=(t,e)=>e===1||e===1n?t:`${t}s`,__=1e-7,T_=24n*60n*60n*1000n;function Go(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let i=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=false,e.formatSubMilliseconds=false,e.separateMilliseconds=false,e.verbose=false),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let n=[],s=(l,d)=>{let h=Math.floor(l*10**d+__);return (Math.round(h)/10**d).toFixed(d)},o=(l,d,h,p)=>{if(!((n.length===0||!e.colonNotation)&&O_(l)&&!(e.colonNotation&&h==="m"))){if(p??=String(l),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,y=n.length>0?2:1;p="0".repeat(Math.max(0,y-m))+p;}else p+=e.verbose?" "+C_(d,l):h;n.push(p);}},a=Uo(t),c=BigInt(a.days);if(e.hideYearAndDays?o(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(c,"day","d"):(o(c/365n,"year","y"),o(c%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),d=Number(a.milliseconds),h=Number(a.microseconds),p=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(d,"millisecond","ms"),o(h,"microsecond","\xB5s"),o(p,"nanosecond","ns");else {let m=d+h/1e3+p/1e6,y=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,w=m>=1?Math.round(m):Math.ceil(m),b=y?m.toFixed(y):w;o(Number.parseFloat(b),"millisecond","ms",b);}}else {let l=(r?Number(t%T_):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,h=s(l,d),p=e.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");o(Number.parseFloat(p),"second","s",p);}if(n.length===0)return i+"0"+(e.verbose?" milliseconds":"ms");let u=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(n=n.slice(0,Math.max(e.unitCount,1))),i+n.join(u)}var fg=(t,e)=>{t.failed&&Ce({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t});};var mg=(t,e)=>{Nt(e)&&(fg(t,e),k_(t,e));},k_=(t,e)=>{let r=`(done in ${Go(t.durationMs)})`;Ce({type:"duration",verboseMessage:r,verboseInfo:e,result:t});};var Kt=(t,e,{reject:r})=>{if(mg(t,e),t.failed&&r)throw t;return t};var bg=(t,e)=>wt(t)?"asyncGenerator":Sg(t)?"generator":cn(t)?"fileUrl":$_(t)?"filePath":F_(t)?"webStream":ge(t,{checkOpen:false})?"native":B(t)?"uint8Array":L_(t)?"asyncIterable":q_(t)?"iterable":Ho(t)?wg({},e):I_(t)?A_(t,e):"native",A_=(t,e)=>qo(t.transform,{checkOpen:false})?D_(t,e):Ho(t.transform)?wg(t,e):P_(t,e),D_=(t,e)=>(xg(t,e,"Duplex stream"),"duplex"),wg=(t,e)=>(xg(t,e,"web TransformStream"),"webTransform"),xg=({final:t,binary:e,objectMode:r},i,n)=>{gg(t,`${i}.final`,n),gg(e,`${i}.binary`,n),Vo(r,`${i}.objectMode`);},gg=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},P_=({transform:t,final:e,binary:r,objectMode:i},n)=>{if(t!==void 0&&!yg(t))throw new TypeError(`The \`${n}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(qo(e,{checkOpen:false}))throw new TypeError(`The \`${n}.final\` option must not be a Duplex stream.`);if(Ho(e))throw new TypeError(`The \`${n}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!yg(e))throw new TypeError(`The \`${n}.final\` option must be a generator.`);return Vo(r,`${n}.binary`),Vo(i,`${n}.objectMode`),wt(t)||wt(e)?"asyncGenerator":"generator"},Vo=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},yg=t=>wt(t)||Sg(t),wt=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",Sg=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",I_=t=>N(t)&&(t.transform!==void 0||t.final!==void 0),cn=t=>Object.prototype.toString.call(t)==="[object URL]",vg=t=>cn(t)&&t.protocol!=="file:",$_=t=>N(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>M_.has(e))&&Wo(t.file),M_=new Set(["file","append"]),Wo=t=>typeof t=="string",Eg=(t,e)=>t==="native"&&typeof e=="string"&&!R_.has(e),R_=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Og=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",ln=t=>Object.prototype.toString.call(t)==="[object WritableStream]",F_=t=>Og(t)||ln(t),Ho=t=>Og(t?.readable)&&ln(t?.writable),L_=t=>Cg(t)&&typeof t[Symbol.asyncIterator]=="function",q_=t=>Cg(t)&&typeof t[Symbol.iterator]=="function",Cg=t=>typeof t=="object"&&t!==null,ce=new Set(["generator","asyncGenerator","duplex","webTransform"]),un=new Set(["fileUrl","filePath","fileNumber"]),zo=new Set(["fileUrl","filePath"]),_g=new Set([...zo,"webStream","nodeStream"]),Tg=new Set(["webTransform","duplex"]),at={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var Yo=(t,e,r,i)=>i==="output"?j_(t,e,r):N_(t,e,r),j_=(t,e,r)=>{let i=e!==0&&r[e-1].value.readableObjectMode;return {writableObjectMode:i,readableObjectMode:t??i}},N_=(t,e,r)=>{let i=e===0?t===true:r[e-1].value.readableObjectMode,n=e!==r.length-1&&(t??i);return {writableObjectMode:i,readableObjectMode:n}},kg=(t,e)=>{let r=t.findLast(({type:i})=>ce.has(i));return r===void 0?false:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var Ag=(t,e,r,i)=>[...t.filter(({type:n})=>!ce.has(n)),...B_(t,e,r,i)],B_=(t,e,r,{encoding:i})=>{let n=t.filter(({type:o})=>ce.has(o)),s=Array.from({length:n.length});for(let[o,a]of Object.entries(n))s[o]=U_({stdioItem:a,index:Number(o),newTransforms:s,optionName:e,direction:r,encoding:i});return H_(s,r)},U_=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:i,optionName:n,direction:s,encoding:o})=>e==="duplex"?G_({stdioItem:t,optionName:n}):e==="webTransform"?V_({stdioItem:t,index:r,newTransforms:i,direction:s}):W_({stdioItem:t,index:r,newTransforms:i,direction:s,encoding:o}),G_=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:i},objectMode:n=i}},optionName:s})=>{if(n&&!i)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!n&&i)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return {...t,value:{transform:e,writableObjectMode:r,readableObjectMode:i}}},V_=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:i,direction:n})=>{let{transform:s,objectMode:o}=N(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=Yo(o,r,i,n);return {...t,value:{transform:s,writableObjectMode:a,readableObjectMode:c}}},W_=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:i,direction:n,encoding:s})=>{let{transform:o,final:a,binary:c=false,preserveNewlines:u=false,objectMode:l}=N(e)?e:{transform:e},d=c||se.has(s),{writableObjectMode:h,readableObjectMode:p}=Yo(l,r,i,n);return {...t,value:{transform:o,final:a,binary:d,preserveNewlines:u,writableObjectMode:h,readableObjectMode:p}}},H_=(t,e)=>e==="input"?t.reverse():t;var Dg=(t,e,r)=>{let i=t.map(n=>z_(n,e));if(i.includes("input")&&i.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return i.find(Boolean)??K_},z_=({type:t,value:e},r)=>Y_[r]??Pg[t](e),Y_=["input","output","output"],Zt=()=>{},Ko=()=>"input",Pg={generator:Zt,asyncGenerator:Zt,fileUrl:Zt,filePath:Zt,iterable:Ko,asyncIterable:Ko,uint8Array:Ko,webStream:t=>ln(t)?"output":"input",nodeStream(t){return bt(t,{checkOpen:false})?Lo(t,{checkOpen:false})?void 0:"input":"output"},webTransform:Zt,duplex:Zt,native(t){let e=J_(t);if(e!==void 0)return e;if(ge(t,{checkOpen:false}))return Pg.nodeStream(t)}},J_=t=>{if([0,k__default.default.stdin].includes(t))return "input";if([1,2,k__default.default.stdout,k__default.default.stderr].includes(t))return "output"},K_="output";var Ig=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var $g=({stdio:t,ipc:e,buffer:r,...i},n,s)=>{let o=Z_(t,i).map((a,c)=>Mg(a,c));return s?Q_(o,r,n):Ig(o,e)},Z_=(t,e)=>{if(t===void 0)return ae.map(i=>e[i]);if(X_(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ae.map(i=>`\`${i}\``).join(", ")}`);if(typeof t=="string")return [t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,ae.length);return Array.from({length:r},(i,n)=>t[n])},X_=t=>ae.some(e=>t[e]!==void 0),Mg=(t,e)=>Array.isArray(t)?t.map(r=>Mg(r,e)):t??(e>=ae.length?"ignore":"pipe"),Q_=(t,e,r)=>t.map((i,n)=>!e[n]&&n!==0&&!Bt(r,n)&&eT(i)?"ignore":i),eT=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");var Fg=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:i,direction:n,isSync:s})=>!r||e!=="native"?t:s?iT({stdioItem:t,fdNumber:i,direction:n}):oT({stdioItem:t,fdNumber:i}),iT=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:i,direction:n})=>{let s=nT({value:e,optionName:r,fdNumber:i,direction:n});if(s!==void 0)return s;if(ge(e,{checkOpen:false}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},nT=({value:t,optionName:e,fdNumber:r,direction:i})=>{let n=sT(t,r);if(n!==void 0){if(i==="output")return {type:"fileNumber",value:n,optionName:e};if(RE__default.default.isatty(n))throw new TypeError(`The \`${e}: ${qi(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return {type:"uint8Array",value:Ge(Gr.readFileSync(n)),optionName:e}}},sT=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=xi.indexOf(t);if(r!==-1)return r},oT=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:i})=>e==="inherit"?{type:"nodeStream",value:Rg(i,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:Rg(e,e,r),optionName:r}:ge(e,{checkOpen:false})?{type:"nodeStream",value:e,optionName:r}:t,Rg=(t,e,r)=>{let i=xi[t];if(i===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return i};var Lg=({input:t,inputFile:e},r)=>r===0?[...aT(t),...lT(e)]:[],aT=t=>t===void 0?[]:[{type:cT(t),value:t,optionName:"input"}],cT=t=>{if(bt(t,{checkOpen:false}))return "nodeStream";if(typeof t=="string")return "string";if(B(t))return "uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},lT=t=>t===void 0?[]:[{...uT(t),optionName:"inputFile"}],uT=t=>{if(cn(t))return {type:"fileUrl",value:t};if(Wo(t))return {type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var qg=t=>t.filter((e,r)=>t.every((i,n)=>e.value!==i.value||r>=n||e.type==="generator"||e.type==="asyncGenerator")),jg=({stdioItem:{type:t,value:e,optionName:r},direction:i,fileDescriptors:n,isSync:s})=>{let o=dT(n,t);if(o.length!==0){if(s){hT({otherStdioItems:o,type:t,value:e,optionName:r,direction:i});return}if(_g.has(t))return Ng({otherStdioItems:o,type:t,value:e,optionName:r,direction:i});Tg.has(t)&&fT({otherStdioItems:o,type:t,value:e,optionName:r});}},dT=(t,e)=>t.flatMap(({direction:r,stdioItems:i})=>i.filter(n=>n.type===e).map((n=>({...n,direction:r})))),hT=({otherStdioItems:t,type:e,value:r,optionName:i,direction:n})=>{zo.has(e)&&Ng({otherStdioItems:t,type:e,value:r,optionName:i,direction:n});},Ng=({otherStdioItems:t,type:e,value:r,optionName:i,direction:n})=>{let s=t.filter(a=>pT(a,r));if(s.length===0)return;let o=s.find(a=>a.direction!==n);return Bg(o,i,e),n==="output"?s[0].stream:void 0},pT=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,fT=({otherStdioItems:t,type:e,value:r,optionName:i})=>{let n=t.find(({value:{transform:s}})=>s===r.transform);Bg(n,i,e);},Bg=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${at[r]} that is the same.`)};var dn=(t,e,r,i)=>{let s=$g(e,r,i).map((a,c)=>mT({stdioOption:a,fdNumber:c,options:e,isSync:i})),o=ET({initialFileDescriptors:s,addProperties:t,options:e,isSync:i});return e.stdio=o.map(({stdioItems:a})=>_T(a)),o},mT=({stdioOption:t,fdNumber:e,options:r,isSync:i})=>{let n=Si(e),{stdioItems:s,isStdioArray:o}=gT({stdioOption:t,fdNumber:e,options:r,optionName:n}),a=Dg(s,e,n),c=s.map(d=>Fg({stdioItem:d,isStdioArray:o,fdNumber:e,direction:a,isSync:i})),u=Ag(c,n,a,r),l=kg(u,a);return vT(u,l),{direction:a,objectMode:l,stdioItems:u}},gT=({stdioOption:t,fdNumber:e,options:r,optionName:i})=>{let s=[...(Array.isArray(t)?t:[t]).map(c=>yT(c,i)),...Lg(r,e)],o=qg(s),a=o.length>1;return bT(o,a,i),xT(o),{stdioItems:o,isStdioArray:a}},yT=(t,e)=>({type:bg(t,e),value:t,optionName:e}),bT=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:i,optionName:n}of t)if(wT.has(i))throw new Error(`The \`${n}\` option must not include \`${i}\`.`)}},wT=new Set(["ignore","ipc"]),xT=t=>{for(let e of t)ST(e);},ST=({type:t,value:e,optionName:r})=>{if(vg(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
165
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Eg(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},vT=(t,e)=>{if(!e)return;let r=t.find(({type:i})=>un.has(i));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},ET=({initialFileDescriptors:t,addProperties:e,options:r,isSync:i})=>{let n=[];try{for(let s of t)n.push(OT({fileDescriptor:s,fileDescriptors:n,addProperties:e,options:r,isSync:i}));return n}catch(s){throw Zo(n),s}},OT=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:i,addProperties:n,options:s,isSync:o})=>{let a=r.map(c=>CT({stdioItem:c,addProperties:n,direction:t,options:s,fileDescriptors:i,isSync:o}));return {direction:t,objectMode:e,stdioItems:a}},CT=({stdioItem:t,addProperties:e,direction:r,options:i,fileDescriptors:n,isSync:s})=>{let o=jg({stdioItem:t,direction:r,fileDescriptors:n,isSync:s});return o!==void 0?{...t,stream:o}:{...t,...e[r][t.type](t,i)}},Zo=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!pe(r)&&r.destroy();},_T=t=>{if(t.length>1)return t.some(({value:i})=>i==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"};var Vg=(t,e)=>dn(kT,t,e,true),Ae=({type:t,optionName:e})=>{Wg(e,at[t]);},TT=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&Wg(t,`"${e}"`),{}),Wg=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},Gg={generator(){},asyncGenerator:Ae,webStream:Ae,nodeStream:Ae,webTransform:Ae,duplex:Ae,asyncIterable:Ae,native:TT},kT={input:{...Gg,fileUrl:({value:t})=>({contents:[Ge(Gr.readFileSync(t))]}),filePath:({value:{file:t}})=>({contents:[Ge(Gr.readFileSync(t))]}),fileNumber:Ae,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...Gg,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:Ae,string:Ae,uint8Array:Ae}};var He=(t,{stripFinalNewline:e},r)=>Xo(e,r)&&t!==void 0&&!Array.isArray(t)?zt(t):t,Xo=(t,e)=>e==="all"?t[1]||t[2]:t[e];var hn=(t,e,r,i)=>t||r?void 0:zg(e,i),ea=(t,e,r)=>r?t.flatMap(i=>Hg(i,e)):Hg(t,e),Hg=(t,e)=>{let{transform:r,final:i}=zg(e,{});return [...r(t),...i()]},zg=(t,e)=>(e.previousChunks="",{transform:AT.bind(void 0,e,t),final:PT.bind(void 0,e)}),AT=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:i}=t,n=-1;for(let s=0;s<r.length;s+=1)if(r[s]===`
166
- `){let o=DT(r,s,e,t),a=r.slice(n+1,s+1-o);i.length>0&&(a=Qo(i,a),i=""),yield a,n=s;}n!==r.length-1&&(i=Qo(i,r.slice(n+1))),t.previousChunks=i;},DT=(t,e,r,i)=>r?0:(i.isWindowsNewline=e!==0&&t[e-1]==="\r",i.isWindowsNewline?2:1),PT=function*({previousChunks:t}){t.length>0&&(yield t);},Yg=({binary:t,preserveNewlines:e,readableObjectMode:r,state:i})=>t||e||r?void 0:{transform:IT.bind(void 0,i)},IT=function*({isWindowsNewline:t=false},e){let{unixNewline:r,windowsNewline:i,LF:n,concatBytes:s}=typeof e=="string"?$T:RT;if(e.at(-1)===n){yield e;return}yield s(e,t?i:r);},Qo=(t,e)=>`${t}${e}`,$T={windowsNewline:`\r
163
+ `);return {originalMessage:$,shortMessage:le,message:be}},m_=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:i,maxBuffer:n,errorCode:s,signal:o,signalDescription:a,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:h,killSignal:p})=>{let m=g_(d,h);return e?`Command timed out after ${r} milliseconds${m}`:l?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${o} (${a})`:u?`Command was canceled${m}`:i?`${og(t,n)}${m}`:s!==void 0?`Command failed with ${s}${m}`:d?`Command was killed with ${p} (${Ri(p)})${m}`:o!==void 0?`Command was killed with ${o} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},g_=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",y_=(t,e)=>{if(t instanceof fe)return;let r=jf(t)?t.originalMessage:String(t?.message??t),i=Or(Um(r,e));return i===""?void 0:i},b_=t=>typeof t=="string"?t:util.inspect(t),w_=t=>Array.isArray(t)?t.map(e=>zt(lg(e))).filter(Boolean).join(`
164
+ `):lg(t),lg=t=>typeof t=="string"?t:B(t)?wi(t):"";var an=({command:t,escapedCommand:e,stdio:r,all:i,ipcOutput:n,options:{cwd:s},startTime:o})=>dg({command:t,escapedCommand:e,cwd:s,durationMs:mo(o),failed:false,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isTerminated:false,isMaxBuffer:false,isForcefullyTerminated:false,exitCode:0,stdout:r[1],stderr:r[2],all:i,stdio:r,ipcOutput:n,pipedFrom:[]}),Jt=({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:o})=>Pr({error:t,command:e,escapedCommand:r,startTime:s,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:false,isForcefullyTerminated:false,stdio:Array.from({length:i.length}),ipcOutput:[],options:n,isSync:o}),Pr=({error:t,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:d,all:h,ipcOutput:p,options:{timeoutDuration:m,timeout:y=m,forceKillAfterDelay:w,killSignal:b,cwd:S,maxBuffer:_},isSync:$})=>{let{exitCode:oe,signal:le,signalDescription:Pe}=S_(u,l),{originalMessage:be,shortMessage:x,message:T}=ug({stdio:d,all:h,ipcOutput:p,originalError:t,signal:le,signalDescription:Pe,exitCode:oe,escapedCommand:r,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:w,killSignal:b,maxBuffer:_,timeout:y,cwd:S}),E=Lf(t,T,$);return Object.assign(E,x_({error:E,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:oe,signal:le,signalDescription:Pe,stdio:d,all:h,ipcOutput:p,cwd:S,originalMessage:be,shortMessage:x})),E},x_=({error:t,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,stdio:h,all:p,ipcOutput:m,cwd:y,originalMessage:w,shortMessage:b})=>dg({shortMessage:b,originalMessage:w,command:e,escapedCommand:r,cwd:y,durationMs:mo(i),failed:true,timedOut:n,isCanceled:s,isGracefullyCanceled:o,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,code:t.cause?.code,stdout:h[1],stderr:h[2],all:p,stdio:h,ipcOutput:m,pipedFrom:[]}),dg=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),S_=(t,e)=>{let r=t===null?void 0:t,i=e===null?void 0:e,n=i===void 0?void 0:Ri(e);return {exitCode:r,signal:i,signalDescription:n}};var hg=t=>Number.isFinite(t)?t:0;function v_(t){return {days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(hg(t*1e3)%1e3),nanoseconds:Math.trunc(hg(t*1e6)%1e3)}}function O_(t){return {days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Bo(t){switch(typeof t){case "number":{if(Number.isFinite(t))return v_(t);break}case "bigint":return O_(t)}throw new TypeError("Expected a finite number or bigint")}var E_=t=>t===0||t===0n,C_=(t,e)=>e===1||e===1n?t:`${t}s`,__=1e-7,T_=24n*60n*60n*1000n;function Uo(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let i=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=false,e.formatSubMilliseconds=false,e.separateMilliseconds=false,e.verbose=false),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let n=[],s=(l,d)=>{let h=Math.floor(l*10**d+__);return (Math.round(h)/10**d).toFixed(d)},o=(l,d,h,p)=>{if(!((n.length===0||!e.colonNotation)&&E_(l)&&!(e.colonNotation&&h==="m"))){if(p??=String(l),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,y=n.length>0?2:1;p="0".repeat(Math.max(0,y-m))+p;}else p+=e.verbose?" "+C_(d,l):h;n.push(p);}},a=Bo(t),c=BigInt(a.days);if(e.hideYearAndDays?o(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(c,"day","d"):(o(c/365n,"year","y"),o(c%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),d=Number(a.milliseconds),h=Number(a.microseconds),p=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(d,"millisecond","ms"),o(h,"microsecond","\xB5s"),o(p,"nanosecond","ns");else {let m=d+h/1e3+p/1e6,y=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,w=m>=1?Math.round(m):Math.ceil(m),b=y?m.toFixed(y):w;o(Number.parseFloat(b),"millisecond","ms",b);}}else {let l=(r?Number(t%T_):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,h=s(l,d),p=e.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");o(Number.parseFloat(p),"second","s",p);}if(n.length===0)return i+"0"+(e.verbose?" milliseconds":"ms");let u=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(n=n.slice(0,Math.max(e.unitCount,1))),i+n.join(u)}var pg=(t,e)=>{t.failed&&Ce({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t});};var fg=(t,e)=>{Nt(e)&&(pg(t,e),k_(t,e));},k_=(t,e)=>{let r=`(done in ${Uo(t.durationMs)})`;Ce({type:"duration",verboseMessage:r,verboseInfo:e,result:t});};var Kt=(t,e,{reject:r})=>{if(fg(t,e),t.failed&&r)throw t;return t};var yg=(t,e)=>wt(t)?"asyncGenerator":xg(t)?"generator":cn(t)?"fileUrl":$_(t)?"filePath":F_(t)?"webStream":ge(t,{checkOpen:false})?"native":B(t)?"uint8Array":L_(t)?"asyncIterable":q_(t)?"iterable":Wo(t)?bg({},e):I_(t)?A_(t,e):"native",A_=(t,e)=>Lo(t.transform,{checkOpen:false})?D_(t,e):Wo(t.transform)?bg(t,e):P_(t,e),D_=(t,e)=>(wg(t,e,"Duplex stream"),"duplex"),bg=(t,e)=>(wg(t,e,"web TransformStream"),"webTransform"),wg=({final:t,binary:e,objectMode:r},i,n)=>{mg(t,`${i}.final`,n),mg(e,`${i}.binary`,n),Go(r,`${i}.objectMode`);},mg=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},P_=({transform:t,final:e,binary:r,objectMode:i},n)=>{if(t!==void 0&&!gg(t))throw new TypeError(`The \`${n}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Lo(e,{checkOpen:false}))throw new TypeError(`The \`${n}.final\` option must not be a Duplex stream.`);if(Wo(e))throw new TypeError(`The \`${n}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!gg(e))throw new TypeError(`The \`${n}.final\` option must be a generator.`);return Go(r,`${n}.binary`),Go(i,`${n}.objectMode`),wt(t)||wt(e)?"asyncGenerator":"generator"},Go=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},gg=t=>wt(t)||xg(t),wt=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",xg=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",I_=t=>N(t)&&(t.transform!==void 0||t.final!==void 0),cn=t=>Object.prototype.toString.call(t)==="[object URL]",Sg=t=>cn(t)&&t.protocol!=="file:",$_=t=>N(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>M_.has(e))&&Vo(t.file),M_=new Set(["file","append"]),Vo=t=>typeof t=="string",vg=(t,e)=>t==="native"&&typeof e=="string"&&!R_.has(e),R_=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Og=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",ln=t=>Object.prototype.toString.call(t)==="[object WritableStream]",F_=t=>Og(t)||ln(t),Wo=t=>Og(t?.readable)&&ln(t?.writable),L_=t=>Eg(t)&&typeof t[Symbol.asyncIterator]=="function",q_=t=>Eg(t)&&typeof t[Symbol.iterator]=="function",Eg=t=>typeof t=="object"&&t!==null,ce=new Set(["generator","asyncGenerator","duplex","webTransform"]),un=new Set(["fileUrl","filePath","fileNumber"]),Ho=new Set(["fileUrl","filePath"]),Cg=new Set([...Ho,"webStream","nodeStream"]),_g=new Set(["webTransform","duplex"]),at={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var zo=(t,e,r,i)=>i==="output"?j_(t,e,r):N_(t,e,r),j_=(t,e,r)=>{let i=e!==0&&r[e-1].value.readableObjectMode;return {writableObjectMode:i,readableObjectMode:t??i}},N_=(t,e,r)=>{let i=e===0?t===true:r[e-1].value.readableObjectMode,n=e!==r.length-1&&(t??i);return {writableObjectMode:i,readableObjectMode:n}},Tg=(t,e)=>{let r=t.findLast(({type:i})=>ce.has(i));return r===void 0?false:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var kg=(t,e,r,i)=>[...t.filter(({type:n})=>!ce.has(n)),...B_(t,e,r,i)],B_=(t,e,r,{encoding:i})=>{let n=t.filter(({type:o})=>ce.has(o)),s=Array.from({length:n.length});for(let[o,a]of Object.entries(n))s[o]=U_({stdioItem:a,index:Number(o),newTransforms:s,optionName:e,direction:r,encoding:i});return H_(s,r)},U_=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:i,optionName:n,direction:s,encoding:o})=>e==="duplex"?G_({stdioItem:t,optionName:n}):e==="webTransform"?V_({stdioItem:t,index:r,newTransforms:i,direction:s}):W_({stdioItem:t,index:r,newTransforms:i,direction:s,encoding:o}),G_=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:i},objectMode:n=i}},optionName:s})=>{if(n&&!i)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!n&&i)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return {...t,value:{transform:e,writableObjectMode:r,readableObjectMode:i}}},V_=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:i,direction:n})=>{let{transform:s,objectMode:o}=N(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=zo(o,r,i,n);return {...t,value:{transform:s,writableObjectMode:a,readableObjectMode:c}}},W_=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:i,direction:n,encoding:s})=>{let{transform:o,final:a,binary:c=false,preserveNewlines:u=false,objectMode:l}=N(e)?e:{transform:e},d=c||se.has(s),{writableObjectMode:h,readableObjectMode:p}=zo(l,r,i,n);return {...t,value:{transform:o,final:a,binary:d,preserveNewlines:u,writableObjectMode:h,readableObjectMode:p}}},H_=(t,e)=>e==="input"?t.reverse():t;var Ag=(t,e,r)=>{let i=t.map(n=>z_(n,e));if(i.includes("input")&&i.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return i.find(Boolean)??K_},z_=({type:t,value:e},r)=>Y_[r]??Dg[t](e),Y_=["input","output","output"],Zt=()=>{},Jo=()=>"input",Dg={generator:Zt,asyncGenerator:Zt,fileUrl:Zt,filePath:Zt,iterable:Jo,asyncIterable:Jo,uint8Array:Jo,webStream:t=>ln(t)?"output":"input",nodeStream(t){return bt(t,{checkOpen:false})?Fo(t,{checkOpen:false})?void 0:"input":"output"},webTransform:Zt,duplex:Zt,native(t){let e=J_(t);if(e!==void 0)return e;if(ge(t,{checkOpen:false}))return Dg.nodeStream(t)}},J_=t=>{if([0,k__default.default.stdin].includes(t))return "input";if([1,2,k__default.default.stdout,k__default.default.stderr].includes(t))return "output"},K_="output";var Pg=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var Ig=({stdio:t,ipc:e,buffer:r,...i},n,s)=>{let o=Z_(t,i).map((a,c)=>$g(a,c));return s?Q_(o,r,n):Pg(o,e)},Z_=(t,e)=>{if(t===void 0)return ae.map(i=>e[i]);if(X_(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ae.map(i=>`\`${i}\``).join(", ")}`);if(typeof t=="string")return [t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,ae.length);return Array.from({length:r},(i,n)=>t[n])},X_=t=>ae.some(e=>t[e]!==void 0),$g=(t,e)=>Array.isArray(t)?t.map(r=>$g(r,e)):t??(e>=ae.length?"ignore":"pipe"),Q_=(t,e,r)=>t.map((i,n)=>!e[n]&&n!==0&&!Bt(r,n)&&eT(i)?"ignore":i),eT=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");var Rg=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:i,direction:n,isSync:s})=>!r||e!=="native"?t:s?iT({stdioItem:t,fdNumber:i,direction:n}):oT({stdioItem:t,fdNumber:i}),iT=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:i,direction:n})=>{let s=nT({value:e,optionName:r,fdNumber:i,direction:n});if(s!==void 0)return s;if(ge(e,{checkOpen:false}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},nT=({value:t,optionName:e,fdNumber:r,direction:i})=>{let n=sT(t,r);if(n!==void 0){if(i==="output")return {type:"fileNumber",value:n,optionName:e};if(RO__default.default.isatty(n))throw new TypeError(`The \`${e}: ${qi(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return {type:"uint8Array",value:Ge(Gr.readFileSync(n)),optionName:e}}},sT=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=xi.indexOf(t);if(r!==-1)return r},oT=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:i})=>e==="inherit"?{type:"nodeStream",value:Mg(i,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:Mg(e,e,r),optionName:r}:ge(e,{checkOpen:false})?{type:"nodeStream",value:e,optionName:r}:t,Mg=(t,e,r)=>{let i=xi[t];if(i===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return i};var Fg=({input:t,inputFile:e},r)=>r===0?[...aT(t),...lT(e)]:[],aT=t=>t===void 0?[]:[{type:cT(t),value:t,optionName:"input"}],cT=t=>{if(bt(t,{checkOpen:false}))return "nodeStream";if(typeof t=="string")return "string";if(B(t))return "uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},lT=t=>t===void 0?[]:[{...uT(t),optionName:"inputFile"}],uT=t=>{if(cn(t))return {type:"fileUrl",value:t};if(Vo(t))return {type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var Lg=t=>t.filter((e,r)=>t.every((i,n)=>e.value!==i.value||r>=n||e.type==="generator"||e.type==="asyncGenerator")),qg=({stdioItem:{type:t,value:e,optionName:r},direction:i,fileDescriptors:n,isSync:s})=>{let o=dT(n,t);if(o.length!==0){if(s){hT({otherStdioItems:o,type:t,value:e,optionName:r,direction:i});return}if(Cg.has(t))return jg({otherStdioItems:o,type:t,value:e,optionName:r,direction:i});_g.has(t)&&fT({otherStdioItems:o,type:t,value:e,optionName:r});}},dT=(t,e)=>t.flatMap(({direction:r,stdioItems:i})=>i.filter(n=>n.type===e).map((n=>({...n,direction:r})))),hT=({otherStdioItems:t,type:e,value:r,optionName:i,direction:n})=>{Ho.has(e)&&jg({otherStdioItems:t,type:e,value:r,optionName:i,direction:n});},jg=({otherStdioItems:t,type:e,value:r,optionName:i,direction:n})=>{let s=t.filter(a=>pT(a,r));if(s.length===0)return;let o=s.find(a=>a.direction!==n);return Ng(o,i,e),n==="output"?s[0].stream:void 0},pT=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,fT=({otherStdioItems:t,type:e,value:r,optionName:i})=>{let n=t.find(({value:{transform:s}})=>s===r.transform);Ng(n,i,e);},Ng=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${at[r]} that is the same.`)};var dn=(t,e,r,i)=>{let s=Ig(e,r,i).map((a,c)=>mT({stdioOption:a,fdNumber:c,options:e,isSync:i})),o=OT({initialFileDescriptors:s,addProperties:t,options:e,isSync:i});return e.stdio=o.map(({stdioItems:a})=>_T(a)),o},mT=({stdioOption:t,fdNumber:e,options:r,isSync:i})=>{let n=Si(e),{stdioItems:s,isStdioArray:o}=gT({stdioOption:t,fdNumber:e,options:r,optionName:n}),a=Ag(s,e,n),c=s.map(d=>Rg({stdioItem:d,isStdioArray:o,fdNumber:e,direction:a,isSync:i})),u=kg(c,n,a,r),l=Tg(u,a);return vT(u,l),{direction:a,objectMode:l,stdioItems:u}},gT=({stdioOption:t,fdNumber:e,options:r,optionName:i})=>{let s=[...(Array.isArray(t)?t:[t]).map(c=>yT(c,i)),...Fg(r,e)],o=Lg(s),a=o.length>1;return bT(o,a,i),xT(o),{stdioItems:o,isStdioArray:a}},yT=(t,e)=>({type:yg(t,e),value:t,optionName:e}),bT=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:i,optionName:n}of t)if(wT.has(i))throw new Error(`The \`${n}\` option must not include \`${i}\`.`)}},wT=new Set(["ignore","ipc"]),xT=t=>{for(let e of t)ST(e);},ST=({type:t,value:e,optionName:r})=>{if(Sg(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
165
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(vg(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},vT=(t,e)=>{if(!e)return;let r=t.find(({type:i})=>un.has(i));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},OT=({initialFileDescriptors:t,addProperties:e,options:r,isSync:i})=>{let n=[];try{for(let s of t)n.push(ET({fileDescriptor:s,fileDescriptors:n,addProperties:e,options:r,isSync:i}));return n}catch(s){throw Ko(n),s}},ET=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:i,addProperties:n,options:s,isSync:o})=>{let a=r.map(c=>CT({stdioItem:c,addProperties:n,direction:t,options:s,fileDescriptors:i,isSync:o}));return {direction:t,objectMode:e,stdioItems:a}},CT=({stdioItem:t,addProperties:e,direction:r,options:i,fileDescriptors:n,isSync:s})=>{let o=qg({stdioItem:t,direction:r,fileDescriptors:n,isSync:s});return o!==void 0?{...t,stream:o}:{...t,...e[r][t.type](t,i)}},Ko=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!pe(r)&&r.destroy();},_T=t=>{if(t.length>1)return t.some(({value:i})=>i==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"};var Gg=(t,e)=>dn(kT,t,e,true),Ae=({type:t,optionName:e})=>{Vg(e,at[t]);},TT=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&Vg(t,`"${e}"`),{}),Vg=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},Ug={generator(){},asyncGenerator:Ae,webStream:Ae,nodeStream:Ae,webTransform:Ae,duplex:Ae,asyncIterable:Ae,native:TT},kT={input:{...Ug,fileUrl:({value:t})=>({contents:[Ge(Gr.readFileSync(t))]}),filePath:({value:{file:t}})=>({contents:[Ge(Gr.readFileSync(t))]}),fileNumber:Ae,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...Ug,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:Ae,string:Ae,uint8Array:Ae}};var He=(t,{stripFinalNewline:e},r)=>Zo(e,r)&&t!==void 0&&!Array.isArray(t)?zt(t):t,Zo=(t,e)=>e==="all"?t[1]||t[2]:t[e];var hn=(t,e,r,i)=>t||r?void 0:Hg(e,i),Qo=(t,e,r)=>r?t.flatMap(i=>Wg(i,e)):Wg(t,e),Wg=(t,e)=>{let{transform:r,final:i}=Hg(e,{});return [...r(t),...i()]},Hg=(t,e)=>(e.previousChunks="",{transform:AT.bind(void 0,e,t),final:PT.bind(void 0,e)}),AT=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:i}=t,n=-1;for(let s=0;s<r.length;s+=1)if(r[s]===`
166
+ `){let o=DT(r,s,e,t),a=r.slice(n+1,s+1-o);i.length>0&&(a=Xo(i,a),i=""),yield a,n=s;}n!==r.length-1&&(i=Xo(i,r.slice(n+1))),t.previousChunks=i;},DT=(t,e,r,i)=>r?0:(i.isWindowsNewline=e!==0&&t[e-1]==="\r",i.isWindowsNewline?2:1),PT=function*({previousChunks:t}){t.length>0&&(yield t);},zg=({binary:t,preserveNewlines:e,readableObjectMode:r,state:i})=>t||e||r?void 0:{transform:IT.bind(void 0,i)},IT=function*({isWindowsNewline:t=false},e){let{unixNewline:r,windowsNewline:i,LF:n,concatBytes:s}=typeof e=="string"?$T:RT;if(e.at(-1)===n){yield e;return}yield s(e,t?i:r);},Xo=(t,e)=>`${t}${e}`,$T={windowsNewline:`\r
167
167
  `,unixNewline:`
168
168
  `,LF:`
169
- `,concatBytes:Qo},MT=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},RT={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:MT};var Jg=(t,e)=>t?void 0:LT.bind(void 0,e),LT=function*(t,e){if(typeof e!="string"&&!B(e)&&!buffer.Buffer.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e;},Kg=(t,e)=>t?qT.bind(void 0,e):jT.bind(void 0,e),qT=function*(t,e){Zg(t,e),yield e;},jT=function*(t,e){if(Zg(t,e),typeof e!="string"&&!B(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e;},Zg=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
169
+ `,concatBytes:Xo},MT=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},RT={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:MT};var Yg=(t,e)=>t?void 0:LT.bind(void 0,e),LT=function*(t,e){if(typeof e!="string"&&!B(e)&&!buffer.Buffer.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e;},Jg=(t,e)=>t?qT.bind(void 0,e):jT.bind(void 0,e),qT=function*(t,e){Kg(t,e),yield e;},jT=function*(t,e){if(Kg(t,e),typeof e!="string"&&!B(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e;},Kg=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
170
170
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
171
- if (condition) { yield value; }`)};var pn=(t,e,r)=>{if(r)return;if(t)return {transform:UT.bind(void 0,new TextEncoder)};let i=new string_decoder.StringDecoder(e);return {transform:GT.bind(void 0,i),final:VT.bind(void 0,i)}},UT=function*(t,e){buffer.Buffer.isBuffer(e)?yield Ge(e):typeof e=="string"?yield t.encode(e):yield e;},GT=function*(t,e){yield B(e)?t.write(e):e;},VT=function*(t){let e=t.end();e!==""&&(yield e);};var ta=util.callbackify(async(t,e,r,i)=>{e.currentIterable=t(...r);try{for await(let n of e.currentIterable)i.push(n);}finally{delete e.currentIterable;}}),fn=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:i=HT}=e[r];for await(let n of i(t))yield*fn(n,e,r+1);},Qg=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*WT(r,Number(e),t);},WT=async function*(t,e,r){if(t!==void 0)for await(let i of t())yield*fn(i,r,e+1);},ey=util.callbackify(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),HT=function*(t){yield t;};var ra=(t,e,r,i)=>{try{for(let n of t(...e))r.push(n);i();}catch(n){i(n);}},ty=(t,e)=>[...e.flatMap(r=>[...xt(r,t,0)]),...Ir(t)],xt=function*(t,e,r){if(r===e.length){yield t;return}let{transform:i=YT}=e[r];for(let n of i(t))yield*xt(n,e,r+1);},Ir=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*zT(r,Number(e),t);},zT=function*(t,e,r){if(t!==void 0)for(let i of t())yield*xt(i,r,e+1);},YT=function*(t){yield t;};var ia=({value:t,value:{transform:e,final:r,writableObjectMode:i,readableObjectMode:n},optionName:s},{encoding:o})=>{let a={},c=iy(t,o,s),u=wt(e),l=wt(r),d=u?ta.bind(void 0,fn,a):ra.bind(void 0,xt),h=u||l?ta.bind(void 0,Qg,a):ra.bind(void 0,Ir),p=u||l?ey.bind(void 0,a):void 0;return {stream:new stream.Transform({writableObjectMode:i,writableHighWaterMark:stream.getDefaultHighWaterMark(i),readableObjectMode:n,readableHighWaterMark:stream.getDefaultHighWaterMark(n),transform(y,w,b){d([y,c,0],this,b);},flush(y){h([c],this,y);},destroy:p})}},mn=(t,e,r,i)=>{let n=e.filter(({type:o})=>o==="generator"),s=i?n.reverse():n;for(let{value:o,optionName:a}of s){let c=iy(o,r,a);t=ty(c,t);}return t},iy=({transform:t,final:e,binary:r,writableObjectMode:i,readableObjectMode:n,preserveNewlines:s},o,a)=>{let c={};return [{transform:Jg(i,a)},pn(r,o,i),hn(r,s,i,c),{transform:t,final:e},{transform:Kg(n,a)},Yg({binary:r,preserveNewlines:s,readableObjectMode:n,state:c})].filter(Boolean)};var ny=(t,e)=>{for(let r of KT(t))ZT(t,r,e);},KT=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),ZT=(t,e,r)=>{let{stdioItems:i}=t[e],n=i.filter(({contents:a})=>a!==void 0);if(n.length===0)return;if(e!==0){let[{type:a,optionName:c}]=n;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${at[a]} with synchronous methods.`)}let o=n.map(({contents:a})=>a).map(a=>XT(a,i));r.input=vr(o);},XT=(t,e)=>{let r=mn(t,e,"utf8",true);return QT(r),vr(r)},QT=t=>{let e=t.find(r=>typeof r!="string"&&!B(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};var gn=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:i})=>i!=="all"&&Bt(r,i)&&!se.has(e)&&ek(i)&&(t.some(({type:n,value:s})=>n==="native"&&tk.has(s))||t.every(({type:n})=>ce.has(n))),ek=t=>t===1||t===2,tk=new Set(["pipe","overlapped"]),sy=async(t,e,r,i)=>{for await(let n of t)rk(e)||ay(n,r,i);},oy=(t,e,r)=>{for(let i of t)ay(i,e,r);},rk=t=>t._readableState.pipes.length>0,ay=(t,e,r)=>{let i=Ti(t);Ce({type:"output",verboseMessage:i,fdNumber:e,verboseInfo:r});};var cy=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:i,verboseInfo:n})=>{if(e===null)return {output:Array.from({length:3})};let s={},o=new Set([]);return {output:e.map((c,u)=>sk({result:c,fileDescriptors:t,fdNumber:u,state:s,outputFiles:o,isMaxBuffer:i,verboseInfo:n},r)),...s}},sk=({result:t,fileDescriptors:e,fdNumber:r,state:i,outputFiles:n,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:d})=>{if(t===null)return;let h=lg(t,s,d),p=Ge(h),{stdioItems:m,objectMode:y}=e[r],w=ok([p],m,c,i),{serializedResult:b,finalResult:S=b}=ak({chunks:w,objectMode:y,encoding:c,lines:u,stripFinalNewline:l,fdNumber:r});ck({serializedResult:b,fdNumber:r,state:i,verboseInfo:o,encoding:c,stdioItems:m,objectMode:y});let _=a[r]?S:void 0;try{return i.error===void 0&&lk(b,m,n),_}catch($){return i.error=$,_}},ok=(t,e,r,i)=>{try{return mn(t,e,r,!1)}catch(n){return i.error=n,t}},ak=({chunks:t,objectMode:e,encoding:r,lines:i,stripFinalNewline:n,fdNumber:s})=>{if(e)return {serializedResult:t};if(r==="buffer")return {serializedResult:vr(t)};let o=vp(t,r);return i[s]?{serializedResult:o,finalResult:ea(o,!n[s],e)}:{serializedResult:o}},ck=({serializedResult:t,fdNumber:e,state:r,verboseInfo:i,encoding:n,stdioItems:s,objectMode:o})=>{if(!gn({stdioItems:s,encoding:n,verboseInfo:i,fdNumber:e}))return;let a=ea(t,false,o);try{oy(a,e,i);}catch(c){r.error??=c;}},lk=(t,e,r)=>{for(let{path:i,append:n}of e.filter(({type:s})=>un.has(s))){let s=typeof i=="string"?i:i.toString();n||r.has(s)?Gr.appendFileSync(i,t):(r.add(s),Gr.writeFileSync(i,t));}};var ly=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,He(e,r,"all")]:Array.isArray(e)?[He(t,r,"all"),...e]:B(t)&&B(e)?co([t,e]):`${t}${e}`};var uy=async(t,e)=>{let[r,i]=await uk(t);return e.isForcefullyTerminated??=false,[r,i]},uk=async t=>{let[e,r]=await Promise.allSettled([events.once(t,"spawn"),events.once(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?dy(t):r.value},dy=async t=>{try{return await events.once(t,"exit")}catch{return dy(t)}},hy=async t=>{let[e,r]=await t;if(!dk(e,r)&&sa(e,r))throw new fe;return [e,r]},dk=(t,e)=>t===void 0&&e===void 0,sa=(t,e)=>t!==0||e!==null;var py=({error:t,status:e,signal:r,output:i},{maxBuffer:n})=>{let s=hk(t,e,r),o=s?.code==="ETIMEDOUT",a=cg(s,i,n);return {resultError:s,exitCode:e,signal:r,timedOut:o,isMaxBuffer:a}},hk=(t,e,r)=>t!==void 0?t:sa(e,r)?new fe:void 0;var fy=(t,e,r)=>{let{file:i,commandArguments:n,command:s,escapedCommand:o,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=fk(t,e,r),d=yk({file:i,commandArguments:n,options:u,command:s,escapedCommand:o,verboseInfo:c,fileDescriptors:l,startTime:a});return Kt(d,c,u)},fk=(t,e,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:o}=Ai(t,e,r),a=mk(r),{file:c,commandArguments:u,options:l}=Ki(t,e,a);gk(l);let d=Vg(l,o);return {file:c,commandArguments:u,command:i,escapedCommand:n,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},mk=t=>t.node&&!t.ipc?{...t,ipc:false}:t,gk=({ipc:t,ipcInput:e,detached:r,cancelSignal:i})=>{e&&yn("ipcInput"),t&&yn("ipc: true"),r&&yn("detached: true"),i&&yn("cancelSignal");},yn=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},yk=({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,verboseInfo:s,fileDescriptors:o,startTime:a})=>{let c=bk({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,fileDescriptors:o,startTime:a});if(c.failed)return c;let{resultError:u,exitCode:l,signal:d,timedOut:h,isMaxBuffer:p}=py(c,r),{output:m,error:y=u}=cy({fileDescriptors:o,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:s}),w=m.map((S,_)=>He(S,r,_)),b=He(ly(m,r),r,"all");return xk({error:y,exitCode:l,signal:d,timedOut:h,isMaxBuffer:p,stdio:w,all:b,options:r,command:i,escapedCommand:n,startTime:a})},bk=({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,fileDescriptors:s,startTime:o})=>{try{ny(s,r);let a=wk(r);return Rn.spawnSync(...Zi(t,e,a))}catch(a){return Jt({error:a,command:i,escapedCommand:n,fileDescriptors:s,options:r,startTime:o,isSync:true})}},wk=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:on(e)}),xk=({error:t,exitCode:e,signal:r,timedOut:i,isMaxBuffer:n,stdio:s,all:o,options:a,command:c,escapedCommand:u,startTime:l})=>t===void 0?an({command:c,escapedCommand:u,stdio:s,all:o,ipcOutput:[],options:a,startTime:l}):Pr({error:t,command:c,escapedCommand:u,timedOut:i,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:n,isForcefullyTerminated:false,exitCode:e,signal:r,stdio:s,all:o,ipcOutput:[],options:a,startTime:l,isSync:true});var my=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},{reference:n=true,filter:s}={})=>(Vt({methodName:"getOneMessage",isSubprocess:r,ipc:i,isConnected:Vi(t)}),vk({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:n})),vk=async({anyProcess:t,channel:e,isSubprocess:r,filter:i,reference:n})=>{Ni(e,n);let s=ot(t,e,r),o=new AbortController;try{return await Promise.race([Ek(s,i,o),Ok(s,r,o),Ck(s,r,o)])}catch(a){throw Wt(t),a}finally{o.abort(),Bi(e,n);}},Ek=async(t,e,{signal:r})=>{if(e===void 0){let[i]=await events.once(t,"message",{signal:r});return i}for await(let[i]of events.on(t,"message",{signal:r}))if(e(i))return i},Ok=async(t,e,{signal:r})=>{await events.once(t,"disconnect",{signal:r}),tm(e);},Ck=async(t,e,{signal:r})=>{let[i]=await events.once(t,"strict:error",{signal:r});throw Li(i,e)};var by=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},{reference:n=true}={})=>aa({anyProcess:t,channel:e,isSubprocess:r,ipc:i,shouldAwait:!r,reference:n}),aa=({anyProcess:t,channel:e,isSubprocess:r,ipc:i,shouldAwait:n,reference:s})=>{Vt({methodName:"getEachMessage",isSubprocess:r,ipc:i,isConnected:Vi(t)}),Ni(e,s);let o=ot(t,e,r),a=new AbortController,c={};return Tk(t,o,a),kk({ipcEmitter:o,isSubprocess:r,controller:a,state:c}),Ak({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:r,shouldAwait:n,controller:a,state:c,reference:s})},Tk=async(t,e,r)=>{try{await events.once(e,"disconnect",{signal:r.signal}),r.abort();}catch{}},kk=async({ipcEmitter:t,isSubprocess:e,controller:r,state:i})=>{try{let[n]=await events.once(t,"strict:error",{signal:r.signal});i.error=Li(n,e),r.abort();}catch{}},Ak=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:i,shouldAwait:n,controller:s,state:o,reference:a}){try{for await(let[c]of events.on(r,"message",{signal:s.signal}))gy(o),yield c;}catch{gy(o);}finally{s.abort(),Bi(e,a),i||Wt(t),n&&await t;}},gy=({error:t})=>{if(t)throw t};var xy=(t,{ipc:e})=>{Object.assign(t,vy(t,false,e));},Sy=()=>{let t=k__default.default,e=true,r=k__default.default.channel!==void 0;return {...vy(t,e,r),getCancelSignal:km.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},vy=(t,e,r)=>({sendMessage:Yi.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:my.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:by.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});var Ey=({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,verboseInfo:o})=>{Zo(i);let a=new Rn.ChildProcess;Rk(a,i),Object.assign(a,{readable:Fk,writable:Lk,duplex:qk});let c=Jt({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:false}),u=jk(c,o,n);return {subprocess:a,promise:u}},Rk=(t,e)=>{let r=$r(),i=$r(),n=$r(),s=Array.from({length:e.length-3},$r),o=$r(),a=[r,i,n,...s];Object.assign(t,{stdin:r,stdout:i,stderr:n,all:o,stdio:a});},$r=()=>{let t=new stream.PassThrough;return t.end(),t},Fk=()=>new stream.Readable({read(){}}),Lk=()=>new stream.Writable({write(){}}),qk=()=>new stream.Duplex({read(){},write(){}}),jk=async(t,e,r)=>Kt(t,e,r);var Ty=(t,e)=>dn(Gk,t,e,false),Rr=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${at[t]}.`)},_y={fileNumber:Rr,generator:ia,asyncGenerator:ia,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let i=e||r;return {stream:stream.Duplex.fromWeb(t,{objectMode:i})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Gk={input:{..._y,fileUrl:({value:t})=>({stream:Gr.createReadStream(t)}),filePath:({value:{file:t}})=>({stream:Gr.createReadStream(t)}),webStream:({value:t})=>({stream:stream.Readable.fromWeb(t)}),iterable:({value:t})=>({stream:stream.Readable.from(t)}),asyncIterable:({value:t})=>({stream:stream.Readable.from(t)}),string:({value:t})=>({stream:stream.Readable.from(t)}),uint8Array:({value:t})=>({stream:stream.Readable.from(buffer.Buffer.from(t))})},output:{..._y,fileUrl:({value:t})=>({stream:Gr.createWriteStream(t)}),filePath:({value:{file:t,append:e}})=>({stream:Gr.createWriteStream(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:stream.Writable.fromWeb(t)}),iterable:Rr,asyncIterable:Rr,string:Rr,uint8Array:Rr}};function St(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let n of t)la(n);let e=t.some(({readableObjectMode:n})=>n),r=zk(t,e),i=new ca({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let n of t)i.add(n);return i}var zk=(t,e)=>{if(t.length===0)return stream.getDefaultHighWaterMark(e);let r=t.filter(({readableObjectMode:i})=>i===e).map(({readableHighWaterMark:i})=>i);return Math.max(...r)},ca=class extends stream.PassThrough{#t=new Set([]);#r=new Set([]);#e=new Set([]);#i;#s=Symbol("unpipe");#n=new WeakMap;add(e){if(la(e),this.#t.has(e))return;this.#t.add(e),this.#i??=Yk(this,this.#t,this.#s);let r=Zk({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#i,unpipeEvent:this.#s});this.#n.set(e,r),e.pipe(this,{end:false});}async remove(e){if(la(e),!this.#t.has(e))return false;let r=this.#n.get(e);return r===void 0?false:(this.#n.delete(e),e.unpipe(this),await r,true)}},Yk=async(t,e,r)=>{bn(t,Ay);let i=new AbortController;try{await Promise.race([Jk(t,i),Kk(t,e,r,i)]);}finally{i.abort(),bn(t,-Ay);}},Jk=async(t,{signal:e})=>{try{await promises.finished(t,{signal:e,cleanup:!0});}catch(r){throw Iy(t,r),r}},Kk=async(t,e,r,{signal:i})=>{for await(let[n]of events.on(t,"unpipe",{signal:i}))e.has(n)&&n.emit(r);},la=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Zk=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,onFinished:s,unpipeEvent:o})=>{bn(t,Dy);let a=new AbortController;try{await Promise.race([Xk(s,e,a),Qk({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,controller:a}),eA({stream:e,streams:r,ended:i,aborted:n,unpipeEvent:o,controller:a})]);}finally{a.abort(),bn(t,-Dy);}r.size>0&&r.size===i.size+n.size&&(i.size===0&&n.size>0?ua(t):tA(t));},Xk=async(t,e,{signal:r})=>{try{await t,r.aborted||ua(e);}catch(i){r.aborted||Iy(e,i);}},Qk=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,controller:{signal:s}})=>{try{await promises.finished(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&i.add(e);}catch(o){if(s.aborted||!r.has(e))return;$y(o)?n.add(e):My(t,o);}},eA=async({stream:t,streams:e,ended:r,aborted:i,unpipeEvent:n,controller:{signal:s}})=>{if(await events.once(t,n,{signal:s}),!t.readable)return events.once(s,"abort",{signal:s});e.delete(t),r.delete(t),i.delete(t);},tA=t=>{t.writable&&t.end();},Iy=(t,e)=>{$y(e)?ua(t):My(t,e);},$y=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",ua=t=>{(t.readable||t.writable)&&t.destroy();},My=(t,e)=>{t.destroyed||(t.once("error",rA),t.destroy(e));},rA=()=>{},bn=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e);},Ay=2,Dy=1;var Xt=(t,e)=>{t.pipe(e),iA(t,e),nA(t,e);},iA=async(t,e)=>{if(!(pe(t)||pe(e))){try{await promises.finished(t,{cleanup:!0,readable:!0,writable:!1});}catch{}da(e);}},da=t=>{t.writable&&t.end();},nA=async(t,e)=>{if(!(pe(t)||pe(e))){try{await promises.finished(e,{cleanup:!0,readable:!1,writable:!0});}catch{}ha(t);}},ha=t=>{t.readable&&t.destroy();};var Fy=(t,e,r)=>{let i=new Map;for(let[n,{stdioItems:s,direction:o}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:c})=>ce.has(c)))sA(t,a,o,n);for(let{stream:a}of s.filter(({type:c})=>!ce.has(c)))aA({subprocess:t,stream:a,direction:o,fdNumber:n,pipeGroups:i,controller:r});}for(let[n,s]of i.entries()){let o=s.length===1?s[0]:St(s);Xt(o,n);}},sA=(t,e,r,i)=>{r==="output"?Xt(t.stdio[i],e):Xt(e,t.stdio[i]);let n=oA[i];n!==void 0&&(t[n]=e),t.stdio[i]=e;},oA=["stdin","stdout","stderr"],aA=({subprocess:t,stream:e,direction:r,fdNumber:i,pipeGroups:n,controller:s})=>{if(e===void 0)return;cA(e,s);let[o,a]=r==="output"?[e,t.stdio[i]]:[t.stdio[i],e],c=n.get(o)??[];n.set(o,[...c,a]);},cA=(t,{signal:e})=>{pe(t)&&yt(t,lA,e);},lA=2;var vt=[];vt.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&vt.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&vt.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wn=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",pa=Symbol.for("signal-exit emitter"),fa=globalThis,uA=Object.defineProperty.bind(Object),ma=class{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(fa[pa])return fa[pa];uA(fa,pa,{value:this,writable:false,enumerable:false,configurable:false});}on(e,r){this.listeners[e].push(r);}removeListener(e,r){let i=this.listeners[e],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1));}emit(e,r,i){if(this.emitted[e])return false;this.emitted[e]=true;let n=false;for(let s of this.listeners[e])n=s(r,i)===true||n;return e==="exit"&&(n=this.emit("afterExit",r,i)||n),n}},xn=class{},dA=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),ga=class extends xn{onExit(){return ()=>{}}load(){}unload(){}},ya=class extends xn{#t=ba.platform==="win32"?"SIGINT":"SIGHUP";#r=new ma;#e;#i;#s;#n={};#o=false;constructor(e){super(),this.#e=e,this.#n={};for(let r of vt)this.#n[r]=()=>{let i=this.#e.listeners(r),{count:n}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(n+=s.__signal_exit_emitter__.count),i.length===n){this.unload();let o=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;o||e.kill(e.pid,a);}};this.#s=e.reallyExit,this.#i=e.emit;}onExit(e,r){if(!wn(this.#e))return ()=>{};this.#o===false&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,e),()=>{this.#r.removeListener(i,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload();}}load(){if(!this.#o){this.#o=true,this.#r.count+=1;for(let e of vt)try{let r=this.#n[e];r&&this.#e.on(e,r);}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e);}}unload(){this.#o&&(this.#o=false,vt.forEach(e=>{let r=this.#n[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r);}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#s,this.#r.count-=1);}#a(e){return wn(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let i=this.#i;if(e==="exit"&&wn(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let n=i.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),n}else return i.call(this.#e,e,...r)}},ba=globalThis.process,{onExit:Ly}=dA(wn(ba)?new ya(ba):new ga);var qy=(t,{cleanup:e,detached:r},{signal:i})=>{if(!e||r)return;let n=Ly(()=>{t.kill();});events.addAbortListener(i,()=>{n();});};var Ny=({source:t,sourcePromise:e,boundOptions:r,createNested:i},...n)=>{let s=ki(),{destination:o,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=pA(r,i,n),{sourceStream:d,sourceError:h}=mA(t,u),{options:p,fileDescriptors:m}=Te.get(t);return {sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:h,destination:o,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:m,startTime:s}},pA=(t,e,r)=>{try{let{destination:i,pipeOptions:{from:n,to:s,unpipeSignal:o}={}}=fA(t,e,...r),a=ji(i,s);return {destination:i,destinationStream:a,from:n,unpipeSignal:o}}catch(i){return {destinationError:i}}},fA=(t,e,r,...i)=>{if(Array.isArray(r))return {destination:e(jy,t)(r,...i),pipeOptions:t};if(typeof r=="string"||r instanceof URL||oo(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[n,s,o]=bi(r,...i);return {destination:e(jy)(n,s,o),pipeOptions:o}}if(Te.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return {destination:r,pipeOptions:i[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},jy=({options:t})=>({options:{...t,stdin:"pipe",piped:true}}),mA=(t,e)=>{try{return {sourceStream:Ht(t,e)}}catch(r){return {sourceError:r}}};var Uy=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i,fileDescriptors:n,sourceOptions:s,startTime:o})=>{let a=gA({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i});if(a!==void 0)throw wa({error:a,fileDescriptors:n,sourceOptions:s,startTime:o})},gA=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i})=>{if(e!==void 0&&i!==void 0)return i;if(i!==void 0)return ha(t),i;if(e!==void 0)return da(r),e},wa=({error:t,fileDescriptors:e,sourceOptions:r,startTime:i})=>Jt({error:t,command:By,escapedCommand:By,fileDescriptors:e,options:r,startTime:i,isSync:false}),By="source.pipe(destination)";var Gy=async t=>{let[{status:e,reason:r,value:i=r},{status:n,reason:s,value:o=s}]=await t;if(o.pipedFrom.includes(i)||o.pipedFrom.push(i),n==="rejected")throw o;if(e==="rejected")throw i;return o};var Vy=(t,e,r)=>{let i=Sn.has(e)?wA(t,e):bA(t,e);return yt(t,SA,r.signal),yt(e,vA,r.signal),xA(e),i},bA=(t,e)=>{let r=St([t]);return Xt(r,e),Sn.set(e,r),r},wA=(t,e)=>{let r=Sn.get(e);return r.add(t),r},xA=async t=>{try{await promises.finished(t,{cleanup:!0,readable:!1,writable:!0});}catch{}Sn.delete(t);},Sn=new WeakMap,SA=2,vA=1;var Wy=(t,e)=>t===void 0?[]:[OA(t,e)],OA=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:i,sourceOptions:n,startTime:s})=>{await util.aborted(t,e),await r.remove(e);let o=new Error("Pipe canceled by `unpipeSignal` option.");throw wa({error:o,fileDescriptors:i,sourceOptions:n,startTime:s})};var vn=(t,...e)=>{if(N(e[0]))return vn.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...i}=Ny(t,...e),n=CA({...i,destination:r});return n.pipe=vn.bind(void 0,{...t,source:r,sourcePromise:n,boundOptions:{}}),n},CA=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:i,destination:n,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{let l=_A(t,n);Uy({sourceStream:e,sourceError:i,destinationStream:s,destinationError:o,fileDescriptors:c,sourceOptions:r,startTime:u});let d=new AbortController;try{let h=Vy(e,s,d);return await Promise.race([Gy(l),...Wy(a,{sourceStream:e,mergedStream:h,sourceOptions:r,fileDescriptors:c,startTime:u})])}finally{d.abort();}},_A=(t,e)=>Promise.allSettled([t,e]);var En=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:i,encoding:n,preserveNewlines:s})=>{let o=new AbortController;return AA(e,o),zy({stream:t,controller:o,binary:r,shouldEncode:!t.readableObjectMode&&i,encoding:n,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},AA=async(t,e)=>{try{await t;}catch{}finally{e.abort();}},xa=({stream:t,onStreamEnd:e,lines:r,encoding:i,stripFinalNewline:n,allMixed:s})=>{let o=new AbortController;DA(e,o,t);let a=t.readableObjectMode&&!s;return zy({stream:t,controller:o,binary:i==="buffer",shouldEncode:!a,encoding:i,shouldSplit:!a&&r,preserveNewlines:!n})},DA=async(t,e,r)=>{try{await t;}catch{r.destroy();}finally{e.abort();}},zy=({stream:t,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o})=>{let a=events.on(t,"data",{signal:e.signal,highWaterMark:Hy,highWatermark:Hy});return PA({onStdoutChunk:a,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o})},Sa=stream.getDefaultHighWaterMark(true),Hy=Sa,PA=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o}){let a=IA({binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o});try{for await(let[c]of t)yield*xt(c,a,0);}catch(c){if(!e.signal.aborted)throw c}finally{yield*Ir(a);}},IA=({binary:t,shouldEncode:e,encoding:r,shouldSplit:i,preserveNewlines:n})=>[pn(t,r,!e),hn(t,n,!i,{})].filter(Boolean);var Yy=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,buffer:n,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{let d=MA({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,allMixed:a,verboseInfo:u,streamInfo:l});if(!n){await Promise.all([RA(t),d]);return}let h=Xo(c,r),p=xa({stream:t,onStreamEnd:e,lines:o,encoding:i,stripFinalNewline:h,allMixed:a}),[m]=await Promise.all([FA({stream:t,iterable:p,fdNumber:r,encoding:i,maxBuffer:s,lines:o}),d]);return m},MA=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,allMixed:n,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!gn({stdioItems:o[r]?.stdioItems,encoding:i,verboseInfo:s,fdNumber:r}))return;let a=xa({stream:t,onStreamEnd:e,lines:true,encoding:i,stripFinalNewline:true,allMixed:n});await sy(a,t,r,s);},RA=async t=>{await promises$1.setImmediate(),t.readableFlowing===null&&t.resume();},FA=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:i,encoding:n,maxBuffer:s,lines:o})=>{try{return e||o?await tn(r,{maxBuffer:s}):n==="buffer"?new Uint8Array(await rn(r,{maxBuffer:s})):await sn(r,{maxBuffer:s})}catch(a){return Jy(sg({error:a,stream:t,readableObjectMode:e,lines:o,encoding:n,fdNumber:i}))}},va=async t=>{try{return await t}catch(e){return Jy(e)}},Jy=({bufferedData:t})=>xp(t)?new Uint8Array(t):t;var Fr=async(t,e,r,{isSameDirection:i,stopOnExit:n=false}={})=>{let s=qA(t,r),o=new AbortController;try{await Promise.race([...n?[r.exitPromise]:[],promises.finished(t,{cleanup:!0,signal:o.signal})]);}catch(a){s.stdinCleanedUp||BA(a,e,r,i);}finally{o.abort();}},qA=(t,{originalStreams:[e],subprocess:r})=>{let i={stdinCleanedUp:false};return t===e&&jA(t,r,i),i},jA=(t,e,r)=>{let{_destroy:i}=t;t._destroy=(...n)=>{NA(e,r),i.call(t,...n);};},NA=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=true);},BA=(t,e,r,i)=>{if(!UA(t,e,r,i))throw t},UA=(t,e,r,i=true)=>r.propagating?Ky(t)||On(t):(r.propagating=true,Ea(r,e)===i?Ky(t):On(t)),Ea=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",On=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Ky=t=>t?.code==="EPIPE";var Zy=({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((c,u)=>Oa({stream:c,fdNumber:u,encoding:e,buffer:r[u],maxBuffer:i[u],lines:n[u],allMixed:false,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),Oa=async({stream:t,fdNumber:e,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!t)return;let l=Fr(t,e,u);if(Ea(u,e)){await l;return}let[d]=await Promise.all([Yy({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return d};var Xy=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?St([t,e].filter(Boolean)):void 0,Qy=({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>Oa({...GA(t,r),fdNumber:"all",encoding:e,maxBuffer:i[1]+i[2],lines:n[1]||n[2],allMixed:VA(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),GA=({stdout:t,stderr:e,all:r},[,i,n])=>{let s=i||n;return s?i?n?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},VA=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;var eb=t=>Bt(t,"ipc"),tb=(t,e)=>{let r=Ti(t);Ce({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e});};var rb=async({subprocess:t,buffer:e,maxBuffer:r,ipc:i,ipcOutput:n,verboseInfo:s})=>{if(!i)return n;let o=eb(s),a=Ve(e,"ipc"),c=Ve(r,"ipc");for await(let u of aa({anyProcess:t,channel:t.channel,isSubprocess:false,ipc:i,shouldAwait:false,reference:true}))a&&(og(t,n,c),n.push(u)),o&&tb(u,s);return n},ib=async(t,e)=>(await Promise.allSettled([t]),e);var nb=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:i,lines:n,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:d},context:h,verboseInfo:p,fileDescriptors:m,originalStreams:y,onInternalError:w,controller:b})=>{let S=uy(t,h),_={originalStreams:y,fileDescriptors:m,subprocess:t,exitPromise:S,propagating:false},$=Zy({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:u,verboseInfo:p,streamInfo:_}),oe=Qy({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:u,verboseInfo:p,streamInfo:_}),le=[],Pe=rb({subprocess:t,buffer:r,maxBuffer:i,ipc:l,ipcOutput:le,verboseInfo:p}),be=HA(y,t,_),x=zA(m,_);try{return await Promise.race([Promise.all([{},hy(S),Promise.all($),oe,Pe,qm(t,d),...be,...x]),w,YA(t,b),...$m(t,s,h,b),...em({subprocess:t,cancelSignal:o,gracefulCancel:a,context:h,controller:b}),...Pm({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,context:h,controller:b})])}catch(T){return h.terminationReason??="other",Promise.all([{error:T},S,Promise.all($.map(O=>va(O))),va(oe),ib(Pe,le),Promise.allSettled(be),Promise.allSettled(x)])}},HA=(t,e,r)=>t.map((i,n)=>i===e.stdio[n]?void 0:Fr(i,n,r)),zA=(t,e)=>t.flatMap(({stdioItems:r},i)=>r.filter(({value:n,stream:s=n})=>ge(s,{checkOpen:false})&&!pe(s)).map(({type:n,value:s,stream:o=s})=>Fr(o,i,e,{isSameDirection:ce.has(n),stopOnExit:n==="native"}))),YA=async(t,{signal:e})=>{let[r]=await events.once(t,"error",{signal:e});throw r};var sb=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Lr=(t,e,r)=>{let i=t[r];i.has(e)||i.set(e,[]);let n=i.get(e),s=_e();return n.push(s),{resolve:s.resolve.bind(s),promises:n}},Qt=async({resolve:t,promises:e},r)=>{t();let[i]=await Promise.race([Promise.allSettled([true,r]),Promise.all([false,...e])]);return !i};var Ca=async t=>{if(t!==void 0)try{await _a(t);}catch{}},ab=async t=>{if(t!==void 0)try{await Ta(t);}catch{}},_a=async t=>{await promises.finished(t,{cleanup:true,readable:false,writable:true});},Ta=async t=>{await promises.finished(t,{cleanup:true,readable:true,writable:false});},Cn=async(t,e)=>{if(await t,e)throw e},_n=(t,e,r)=>{r&&!On(r)?t.destroy(r):e&&t.destroy();};var cb=({subprocess:t,concurrentStreams:e,encoding:r},{from:i,binary:n=true,preserveNewlines:s=true}={})=>{let o=n||se.has(r),{subprocessStdout:a,waitReadableDestroy:c}=ka(t,i,e),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:d}=Aa(a,o),{read:h,onStdoutDataDone:p}=Da({subprocessStdout:a,subprocess:t,binary:o,encoding:r,preserveNewlines:s}),m=new stream.Readable({read:h,destroy:util.callbackify(Ia.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:l,encoding:u});return Pa({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},ka=(t,e,r)=>{let i=Ht(t,e),n=Lr(r,i,"readableDestroy");return {subprocessStdout:i,waitReadableDestroy:n}},Aa=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},i)=>i?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:true,readableHighWaterMark:Sa},Da=({subprocessStdout:t,subprocess:e,binary:r,encoding:i,preserveNewlines:n})=>{let s=_e(),o=En({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:i,preserveNewlines:n});return {read(){ZA(this,o,s);},onStdoutDataDone:s}},ZA=async(t,e,r)=>{try{let{value:i,done:n}=await e.next();n?r.resolve():t.push(i);}catch{}},Pa=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:i,subprocessStdin:n})=>{try{await Ta(t),await i,await Ca(n),await e,r.readable&&r.push(null);}catch(s){await Ca(n),lb(r,s);}},Ia=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},i)=>{await Qt(r,e)&&(lb(t,i),await Cn(e,i));},lb=(t,e)=>{_n(t,t.readable,e);};var db=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}=$a(t,r,e),o=new stream.Writable({...Ma(i,t,n),destroy:util.callbackify(Fa.bind(void 0,{subprocessStdin:i,subprocess:t,waitWritableFinal:n,waitWritableDestroy:s})),highWaterMark:i.writableHighWaterMark,objectMode:i.writableObjectMode});return Ra(i,o),o},$a=(t,e,r)=>{let i=ji(t,e),n=Lr(r,i,"writableFinal"),s=Lr(r,i,"writableDestroy");return {subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}},Ma=(t,e,r)=>({write:QA.bind(void 0,t),final:util.callbackify(eD.bind(void 0,t,e,r))}),QA=(t,e,r,i)=>{t.write(e,r)?i():t.once("drain",i);},eD=async(t,e,r)=>{await Qt(r,e)&&(t.writable&&t.end(),await e);},Ra=async(t,e,r)=>{try{await _a(t),e.writable&&e.end();}catch(i){await ab(r),hb(e,i);}},Fa=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:i},n)=>{await Qt(r,e),await Qt(i,e)&&(hb(t,n),await Cn(e,n));},hb=(t,e)=>{_n(t,t.writable,e);};var pb=({subprocess:t,concurrentStreams:e,encoding:r},{from:i,to:n,binary:s=true,preserveNewlines:o=true}={})=>{let a=s||se.has(r),{subprocessStdout:c,waitReadableDestroy:u}=ka(t,i,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:h}=$a(t,n,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:y}=Aa(c,a),{read:w,onStdoutDataDone:b}=Da({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:o}),S=new stream.Duplex({read:w,...Ma(l,t,d),destroy:util.callbackify(iD.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:t,waitReadableDestroy:u,waitWritableFinal:d,waitWritableDestroy:h})),readableHighWaterMark:y,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:m,writableObjectMode:l.writableObjectMode,encoding:p});return Pa({subprocessStdout:c,onStdoutDataDone:b,readable:S,subprocess:t,subprocessStdin:l}),Ra(l,S,c),S},iD=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:i,waitWritableFinal:n,waitWritableDestroy:s},o)=>{await Promise.all([Ia({subprocessStdout:t,subprocess:r,waitReadableDestroy:i},o),Fa({subprocessStdin:e,subprocess:r,waitWritableFinal:n,waitWritableDestroy:s},o)]);};var La=(t,e,{from:r,binary:i=false,preserveNewlines:n=false}={})=>{let s=i||se.has(e),o=Ht(t,r),a=En({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:true,encoding:e,preserveNewlines:n});return nD(a,o,t)},nD=async function*(t,e,r){try{yield*t;}finally{e.readable&&e.destroy(),await r;}};var fb=(t,{encoding:e})=>{let r=sb();t.readable=cb.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=db.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=pb.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=La.bind(void 0,t,e),t[Symbol.asyncIterator]=La.bind(void 0,t,e,{});};var mb=(t,e)=>{for(let[r,i]of oD){let n=i.value.bind(e);Reflect.defineProperty(t,r,{...i,value:n});}},sD=(async()=>{})().constructor.prototype,oD=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(sD,t)]);var gb=(t,e,r,i)=>{let{file:n,commandArguments:s,command:o,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:d}=lD(t,e,r),{subprocess:h,promise:p}=dD({file:n,commandArguments:s,options:l,startTime:c,verboseInfo:u,command:o,escapedCommand:a,fileDescriptors:d});return h.pipe=vn.bind(void 0,{source:h,sourcePromise:p,boundOptions:{},createNested:i}),mb(h,p),Te.set(h,{options:l,fileDescriptors:d}),h},lD=(t,e,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:o}=Ai(t,e,r),{file:a,commandArguments:c,options:u}=Ki(t,e,r),l=uD(u),d=Ty(l,o);return {file:a,commandArguments:c,command:i,escapedCommand:n,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},uD=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return {...r,timeoutDuration:t}},dD=({file:t,commandArguments:e,options:r,startTime:i,verboseInfo:n,command:s,escapedCommand:o,fileDescriptors:a})=>{let c;try{c=Rn.spawn(...Zi(t,e,r));}catch(m){return Ey({error:m,command:s,escapedCommand:o,fileDescriptors:a,options:r,startTime:i,verboseInfo:n})}let u=new AbortController;events.setMaxListeners(Number.POSITIVE_INFINITY,u.signal);let l=[...c.stdio];Fy(c,a,u),qy(c,r,u);let d={},h=_e();c.kill=Xf.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:h,context:d,controller:u}),c.all=Xy(c,r),fb(c,r),xy(c,r);let p=hD({subprocess:c,options:r,startTime:i,verboseInfo:n,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:o,context:d,onInternalError:h,controller:u});return {subprocess:c,promise:p}},hD=async({subprocess:t,options:e,startTime:r,verboseInfo:i,fileDescriptors:n,originalStreams:s,command:o,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{let[d,[h,p],m,y,w]=await nb({subprocess:t,options:e,context:c,verboseInfo:i,fileDescriptors:n,originalStreams:s,onInternalError:u,controller:l});l.abort(),u.resolve();let b=m.map(($,oe)=>He($,e,oe)),S=He(y,e,"all"),_=pD({errorInfo:d,exitCode:h,signal:p,stdio:b,all:S,ipcOutput:w,context:c,options:e,command:o,escapedCommand:a,startTime:r});return Kt(_,i,e)},pD=({errorInfo:t,exitCode:e,signal:r,stdio:i,all:n,ipcOutput:s,context:o,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in t?Pr({error:t.error,command:c,escapedCommand:u,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof ke,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:r,stdio:i,all:n,ipcOutput:s,options:a,startTime:l,isSync:false}):an({command:c,escapedCommand:u,stdio:i,all:n,ipcOutput:s,options:a,startTime:l});var Tn=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([i,n])=>[i,fD(i,t[i],n)]));return {...t,...r}},fD=(t,e,r)=>mD.has(t)&&N(e)&&N(r)?{...e,...r}:r,mD=new Set(["env",...po]);var ct=(t,e,r,i)=>{let n=(o,a,c)=>ct(o,a,r,c),s=(...o)=>gD({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:i,createNested:n},...o);return i!==void 0&&i(s,n,e),s},gD=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:i,createNested:n},s,...o)=>{if(N(s))return n(t,Tn(r,s),i);let{file:a,commandArguments:c,options:u,isSync:l}=yD({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:r});return l?fy(a,c,u):gb(a,c,u,n)},yD=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:i,boundOptions:n})=>{let s=_p(e)?Tp(e,r):[e,...r],[o,a,c]=bi(...s),u=Tn(Tn(i,n),c),{file:l=o,commandArguments:d=a,options:h=u,isSync:p=false}=t({file:o,commandArguments:a,options:u});return {file:l,commandArguments:d,options:h,isSync:p}};var yb=({file:t,commandArguments:e})=>wb(t,e),bb=({file:t,commandArguments:e})=>({...wb(t,e),isSync:true}),wb=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...i]=bD(t);return {file:r,commandArguments:i}},bD=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return [];let r=[];for(let i of e.split(wD)){let n=r.at(-1);n&&n.endsWith("\\")?r[r.length-1]=`${n.slice(0,-1)} ${i}`:r.push(i);}return r},wD=/ +/g;var xb=(t,e,r)=>{t.sync=e(xD,r),t.s=t.sync;},Sb=({options:t})=>vb(t),xD=({options:t})=>({...vb(t),isSync:true}),vb=t=>({options:{...SD(t),...t}}),SD=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},Eb={preferLocal:true};var Ob=ct(()=>({}));ct(()=>({isSync:true}));ct(yb);ct(bb);ct(Rm);ct(Sb,{},Eb,xb);Sy();async function qr({cwd:t,packageManager:e,packages:r,dev:i=false}){if(!r.length)return;let n={npm:"npm",pnpm:"pnpm",yarn:"yarn",bun:"bun"},s={npm:["install",...i?["-D"]:[],...r],pnpm:["add",...i?["-D"]:[],...r],yarn:["add",...i?["-D"]:[],...r],bun:["add",...i?["-d"]:[],...r]};await Ob(n[e],s[e],{cwd:t,stdio:"inherit"});}var Nr=Ie(et());var qa="/* azamat-ui-kit:start */",kn="/* azamat-ui-kit:end */";function Cb(t){return `${qa}
171
+ if (condition) { yield value; }`)};var pn=(t,e,r)=>{if(r)return;if(t)return {transform:UT.bind(void 0,new TextEncoder)};let i=new string_decoder.StringDecoder(e);return {transform:GT.bind(void 0,i),final:VT.bind(void 0,i)}},UT=function*(t,e){buffer.Buffer.isBuffer(e)?yield Ge(e):typeof e=="string"?yield t.encode(e):yield e;},GT=function*(t,e){yield B(e)?t.write(e):e;},VT=function*(t){let e=t.end();e!==""&&(yield e);};var ea=util.callbackify(async(t,e,r,i)=>{e.currentIterable=t(...r);try{for await(let n of e.currentIterable)i.push(n);}finally{delete e.currentIterable;}}),fn=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:i=HT}=e[r];for await(let n of i(t))yield*fn(n,e,r+1);},Xg=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*WT(r,Number(e),t);},WT=async function*(t,e,r){if(t!==void 0)for await(let i of t())yield*fn(i,r,e+1);},Qg=util.callbackify(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),HT=function*(t){yield t;};var ta=(t,e,r,i)=>{try{for(let n of t(...e))r.push(n);i();}catch(n){i(n);}},ey=(t,e)=>[...e.flatMap(r=>[...xt(r,t,0)]),...Ir(t)],xt=function*(t,e,r){if(r===e.length){yield t;return}let{transform:i=YT}=e[r];for(let n of i(t))yield*xt(n,e,r+1);},Ir=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*zT(r,Number(e),t);},zT=function*(t,e,r){if(t!==void 0)for(let i of t())yield*xt(i,r,e+1);},YT=function*(t){yield t;};var ra=({value:t,value:{transform:e,final:r,writableObjectMode:i,readableObjectMode:n},optionName:s},{encoding:o})=>{let a={},c=ry(t,o,s),u=wt(e),l=wt(r),d=u?ea.bind(void 0,fn,a):ta.bind(void 0,xt),h=u||l?ea.bind(void 0,Xg,a):ta.bind(void 0,Ir),p=u||l?Qg.bind(void 0,a):void 0;return {stream:new stream.Transform({writableObjectMode:i,writableHighWaterMark:stream.getDefaultHighWaterMark(i),readableObjectMode:n,readableHighWaterMark:stream.getDefaultHighWaterMark(n),transform(y,w,b){d([y,c,0],this,b);},flush(y){h([c],this,y);},destroy:p})}},mn=(t,e,r,i)=>{let n=e.filter(({type:o})=>o==="generator"),s=i?n.reverse():n;for(let{value:o,optionName:a}of s){let c=ry(o,r,a);t=ey(c,t);}return t},ry=({transform:t,final:e,binary:r,writableObjectMode:i,readableObjectMode:n,preserveNewlines:s},o,a)=>{let c={};return [{transform:Yg(i,a)},pn(r,o,i),hn(r,s,i,c),{transform:t,final:e},{transform:Jg(n,a)},zg({binary:r,preserveNewlines:s,readableObjectMode:n,state:c})].filter(Boolean)};var iy=(t,e)=>{for(let r of KT(t))ZT(t,r,e);},KT=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),ZT=(t,e,r)=>{let{stdioItems:i}=t[e],n=i.filter(({contents:a})=>a!==void 0);if(n.length===0)return;if(e!==0){let[{type:a,optionName:c}]=n;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${at[a]} with synchronous methods.`)}let o=n.map(({contents:a})=>a).map(a=>XT(a,i));r.input=vr(o);},XT=(t,e)=>{let r=mn(t,e,"utf8",true);return QT(r),vr(r)},QT=t=>{let e=t.find(r=>typeof r!="string"&&!B(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};var gn=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:i})=>i!=="all"&&Bt(r,i)&&!se.has(e)&&ek(i)&&(t.some(({type:n,value:s})=>n==="native"&&tk.has(s))||t.every(({type:n})=>ce.has(n))),ek=t=>t===1||t===2,tk=new Set(["pipe","overlapped"]),ny=async(t,e,r,i)=>{for await(let n of t)rk(e)||oy(n,r,i);},sy=(t,e,r)=>{for(let i of t)oy(i,e,r);},rk=t=>t._readableState.pipes.length>0,oy=(t,e,r)=>{let i=Ti(t);Ce({type:"output",verboseMessage:i,fdNumber:e,verboseInfo:r});};var ay=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:i,verboseInfo:n})=>{if(e===null)return {output:Array.from({length:3})};let s={},o=new Set([]);return {output:e.map((c,u)=>sk({result:c,fileDescriptors:t,fdNumber:u,state:s,outputFiles:o,isMaxBuffer:i,verboseInfo:n},r)),...s}},sk=({result:t,fileDescriptors:e,fdNumber:r,state:i,outputFiles:n,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:d})=>{if(t===null)return;let h=cg(t,s,d),p=Ge(h),{stdioItems:m,objectMode:y}=e[r],w=ok([p],m,c,i),{serializedResult:b,finalResult:S=b}=ak({chunks:w,objectMode:y,encoding:c,lines:u,stripFinalNewline:l,fdNumber:r});ck({serializedResult:b,fdNumber:r,state:i,verboseInfo:o,encoding:c,stdioItems:m,objectMode:y});let _=a[r]?S:void 0;try{return i.error===void 0&&lk(b,m,n),_}catch($){return i.error=$,_}},ok=(t,e,r,i)=>{try{return mn(t,e,r,!1)}catch(n){return i.error=n,t}},ak=({chunks:t,objectMode:e,encoding:r,lines:i,stripFinalNewline:n,fdNumber:s})=>{if(e)return {serializedResult:t};if(r==="buffer")return {serializedResult:vr(t)};let o=Sp(t,r);return i[s]?{serializedResult:o,finalResult:Qo(o,!n[s],e)}:{serializedResult:o}},ck=({serializedResult:t,fdNumber:e,state:r,verboseInfo:i,encoding:n,stdioItems:s,objectMode:o})=>{if(!gn({stdioItems:s,encoding:n,verboseInfo:i,fdNumber:e}))return;let a=Qo(t,false,o);try{sy(a,e,i);}catch(c){r.error??=c;}},lk=(t,e,r)=>{for(let{path:i,append:n}of e.filter(({type:s})=>un.has(s))){let s=typeof i=="string"?i:i.toString();n||r.has(s)?Gr.appendFileSync(i,t):(r.add(s),Gr.writeFileSync(i,t));}};var cy=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,He(e,r,"all")]:Array.isArray(e)?[He(t,r,"all"),...e]:B(t)&&B(e)?ao([t,e]):`${t}${e}`};var ly=async(t,e)=>{let[r,i]=await uk(t);return e.isForcefullyTerminated??=false,[r,i]},uk=async t=>{let[e,r]=await Promise.allSettled([events.once(t,"spawn"),events.once(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?uy(t):r.value},uy=async t=>{try{return await events.once(t,"exit")}catch{return uy(t)}},dy=async t=>{let[e,r]=await t;if(!dk(e,r)&&na(e,r))throw new fe;return [e,r]},dk=(t,e)=>t===void 0&&e===void 0,na=(t,e)=>t!==0||e!==null;var hy=({error:t,status:e,signal:r,output:i},{maxBuffer:n})=>{let s=hk(t,e,r),o=s?.code==="ETIMEDOUT",a=ag(s,i,n);return {resultError:s,exitCode:e,signal:r,timedOut:o,isMaxBuffer:a}},hk=(t,e,r)=>t!==void 0?t:na(e,r)?new fe:void 0;var py=(t,e,r)=>{let{file:i,commandArguments:n,command:s,escapedCommand:o,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=fk(t,e,r),d=yk({file:i,commandArguments:n,options:u,command:s,escapedCommand:o,verboseInfo:c,fileDescriptors:l,startTime:a});return Kt(d,c,u)},fk=(t,e,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:o}=Ai(t,e,r),a=mk(r),{file:c,commandArguments:u,options:l}=Ki(t,e,a);gk(l);let d=Gg(l,o);return {file:c,commandArguments:u,command:i,escapedCommand:n,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},mk=t=>t.node&&!t.ipc?{...t,ipc:false}:t,gk=({ipc:t,ipcInput:e,detached:r,cancelSignal:i})=>{e&&yn("ipcInput"),t&&yn("ipc: true"),r&&yn("detached: true"),i&&yn("cancelSignal");},yn=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},yk=({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,verboseInfo:s,fileDescriptors:o,startTime:a})=>{let c=bk({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,fileDescriptors:o,startTime:a});if(c.failed)return c;let{resultError:u,exitCode:l,signal:d,timedOut:h,isMaxBuffer:p}=hy(c,r),{output:m,error:y=u}=ay({fileDescriptors:o,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:s}),w=m.map((S,_)=>He(S,r,_)),b=He(cy(m,r),r,"all");return xk({error:y,exitCode:l,signal:d,timedOut:h,isMaxBuffer:p,stdio:w,all:b,options:r,command:i,escapedCommand:n,startTime:a})},bk=({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,fileDescriptors:s,startTime:o})=>{try{iy(s,r);let a=wk(r);return Mn.spawnSync(...Zi(t,e,a))}catch(a){return Jt({error:a,command:i,escapedCommand:n,fileDescriptors:s,options:r,startTime:o,isSync:true})}},wk=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:on(e)}),xk=({error:t,exitCode:e,signal:r,timedOut:i,isMaxBuffer:n,stdio:s,all:o,options:a,command:c,escapedCommand:u,startTime:l})=>t===void 0?an({command:c,escapedCommand:u,stdio:s,all:o,ipcOutput:[],options:a,startTime:l}):Pr({error:t,command:c,escapedCommand:u,timedOut:i,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:n,isForcefullyTerminated:false,exitCode:e,signal:r,stdio:s,all:o,ipcOutput:[],options:a,startTime:l,isSync:true});var fy=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},{reference:n=true,filter:s}={})=>(Vt({methodName:"getOneMessage",isSubprocess:r,ipc:i,isConnected:Vi(t)}),vk({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:n})),vk=async({anyProcess:t,channel:e,isSubprocess:r,filter:i,reference:n})=>{Ni(e,n);let s=ot(t,e,r),o=new AbortController;try{return await Promise.race([Ok(s,i,o),Ek(s,r,o),Ck(s,r,o)])}catch(a){throw Wt(t),a}finally{o.abort(),Bi(e,n);}},Ok=async(t,e,{signal:r})=>{if(e===void 0){let[i]=await events.once(t,"message",{signal:r});return i}for await(let[i]of events.on(t,"message",{signal:r}))if(e(i))return i},Ek=async(t,e,{signal:r})=>{await events.once(t,"disconnect",{signal:r}),em(e);},Ck=async(t,e,{signal:r})=>{let[i]=await events.once(t,"strict:error",{signal:r});throw Li(i,e)};var yy=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},{reference:n=true}={})=>oa({anyProcess:t,channel:e,isSubprocess:r,ipc:i,shouldAwait:!r,reference:n}),oa=({anyProcess:t,channel:e,isSubprocess:r,ipc:i,shouldAwait:n,reference:s})=>{Vt({methodName:"getEachMessage",isSubprocess:r,ipc:i,isConnected:Vi(t)}),Ni(e,s);let o=ot(t,e,r),a=new AbortController,c={};return Tk(t,o,a),kk({ipcEmitter:o,isSubprocess:r,controller:a,state:c}),Ak({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:r,shouldAwait:n,controller:a,state:c,reference:s})},Tk=async(t,e,r)=>{try{await events.once(e,"disconnect",{signal:r.signal}),r.abort();}catch{}},kk=async({ipcEmitter:t,isSubprocess:e,controller:r,state:i})=>{try{let[n]=await events.once(t,"strict:error",{signal:r.signal});i.error=Li(n,e),r.abort();}catch{}},Ak=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:i,shouldAwait:n,controller:s,state:o,reference:a}){try{for await(let[c]of events.on(r,"message",{signal:s.signal}))my(o),yield c;}catch{my(o);}finally{s.abort(),Bi(e,a),i||Wt(t),n&&await t;}},my=({error:t})=>{if(t)throw t};var wy=(t,{ipc:e})=>{Object.assign(t,Sy(t,false,e));},xy=()=>{let t=k__default.default,e=true,r=k__default.default.channel!==void 0;return {...Sy(t,e,r),getCancelSignal:Tm.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},Sy=(t,e,r)=>({sendMessage:Yi.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:fy.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:yy.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});var vy=({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,verboseInfo:o})=>{Ko(i);let a=new Mn.ChildProcess;Rk(a,i),Object.assign(a,{readable:Fk,writable:Lk,duplex:qk});let c=Jt({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:s,isSync:false}),u=jk(c,o,n);return {subprocess:a,promise:u}},Rk=(t,e)=>{let r=$r(),i=$r(),n=$r(),s=Array.from({length:e.length-3},$r),o=$r(),a=[r,i,n,...s];Object.assign(t,{stdin:r,stdout:i,stderr:n,all:o,stdio:a});},$r=()=>{let t=new stream.PassThrough;return t.end(),t},Fk=()=>new stream.Readable({read(){}}),Lk=()=>new stream.Writable({write(){}}),qk=()=>new stream.Duplex({read(){},write(){}}),jk=async(t,e,r)=>Kt(t,e,r);var _y=(t,e)=>dn(Gk,t,e,false),Rr=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${at[t]}.`)},Cy={fileNumber:Rr,generator:ra,asyncGenerator:ra,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let i=e||r;return {stream:stream.Duplex.fromWeb(t,{objectMode:i})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Gk={input:{...Cy,fileUrl:({value:t})=>({stream:Gr.createReadStream(t)}),filePath:({value:{file:t}})=>({stream:Gr.createReadStream(t)}),webStream:({value:t})=>({stream:stream.Readable.fromWeb(t)}),iterable:({value:t})=>({stream:stream.Readable.from(t)}),asyncIterable:({value:t})=>({stream:stream.Readable.from(t)}),string:({value:t})=>({stream:stream.Readable.from(t)}),uint8Array:({value:t})=>({stream:stream.Readable.from(buffer.Buffer.from(t))})},output:{...Cy,fileUrl:({value:t})=>({stream:Gr.createWriteStream(t)}),filePath:({value:{file:t,append:e}})=>({stream:Gr.createWriteStream(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:stream.Writable.fromWeb(t)}),iterable:Rr,asyncIterable:Rr,string:Rr,uint8Array:Rr}};function St(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let n of t)ca(n);let e=t.some(({readableObjectMode:n})=>n),r=zk(t,e),i=new aa({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let n of t)i.add(n);return i}var zk=(t,e)=>{if(t.length===0)return stream.getDefaultHighWaterMark(e);let r=t.filter(({readableObjectMode:i})=>i===e).map(({readableHighWaterMark:i})=>i);return Math.max(...r)},aa=class extends stream.PassThrough{#t=new Set([]);#r=new Set([]);#e=new Set([]);#i;#s=Symbol("unpipe");#n=new WeakMap;add(e){if(ca(e),this.#t.has(e))return;this.#t.add(e),this.#i??=Yk(this,this.#t,this.#s);let r=Zk({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#i,unpipeEvent:this.#s});this.#n.set(e,r),e.pipe(this,{end:false});}async remove(e){if(ca(e),!this.#t.has(e))return false;let r=this.#n.get(e);return r===void 0?false:(this.#n.delete(e),e.unpipe(this),await r,true)}},Yk=async(t,e,r)=>{bn(t,ky);let i=new AbortController;try{await Promise.race([Jk(t,i),Kk(t,e,r,i)]);}finally{i.abort(),bn(t,-ky);}},Jk=async(t,{signal:e})=>{try{await promises.finished(t,{signal:e,cleanup:!0});}catch(r){throw Py(t,r),r}},Kk=async(t,e,r,{signal:i})=>{for await(let[n]of events.on(t,"unpipe",{signal:i}))e.has(n)&&n.emit(r);},ca=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Zk=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,onFinished:s,unpipeEvent:o})=>{bn(t,Ay);let a=new AbortController;try{await Promise.race([Xk(s,e,a),Qk({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,controller:a}),eA({stream:e,streams:r,ended:i,aborted:n,unpipeEvent:o,controller:a})]);}finally{a.abort(),bn(t,-Ay);}r.size>0&&r.size===i.size+n.size&&(i.size===0&&n.size>0?la(t):tA(t));},Xk=async(t,e,{signal:r})=>{try{await t,r.aborted||la(e);}catch(i){r.aborted||Py(e,i);}},Qk=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,controller:{signal:s}})=>{try{await promises.finished(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&i.add(e);}catch(o){if(s.aborted||!r.has(e))return;Iy(o)?n.add(e):$y(t,o);}},eA=async({stream:t,streams:e,ended:r,aborted:i,unpipeEvent:n,controller:{signal:s}})=>{if(await events.once(t,n,{signal:s}),!t.readable)return events.once(s,"abort",{signal:s});e.delete(t),r.delete(t),i.delete(t);},tA=t=>{t.writable&&t.end();},Py=(t,e)=>{Iy(e)?la(t):$y(t,e);},Iy=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",la=t=>{(t.readable||t.writable)&&t.destroy();},$y=(t,e)=>{t.destroyed||(t.once("error",rA),t.destroy(e));},rA=()=>{},bn=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e);},ky=2,Ay=1;var Xt=(t,e)=>{t.pipe(e),iA(t,e),nA(t,e);},iA=async(t,e)=>{if(!(pe(t)||pe(e))){try{await promises.finished(t,{cleanup:!0,readable:!0,writable:!1});}catch{}ua(e);}},ua=t=>{t.writable&&t.end();},nA=async(t,e)=>{if(!(pe(t)||pe(e))){try{await promises.finished(e,{cleanup:!0,readable:!1,writable:!0});}catch{}da(t);}},da=t=>{t.readable&&t.destroy();};var Ry=(t,e,r)=>{let i=new Map;for(let[n,{stdioItems:s,direction:o}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:c})=>ce.has(c)))sA(t,a,o,n);for(let{stream:a}of s.filter(({type:c})=>!ce.has(c)))aA({subprocess:t,stream:a,direction:o,fdNumber:n,pipeGroups:i,controller:r});}for(let[n,s]of i.entries()){let o=s.length===1?s[0]:St(s);Xt(o,n);}},sA=(t,e,r,i)=>{r==="output"?Xt(t.stdio[i],e):Xt(e,t.stdio[i]);let n=oA[i];n!==void 0&&(t[n]=e),t.stdio[i]=e;},oA=["stdin","stdout","stderr"],aA=({subprocess:t,stream:e,direction:r,fdNumber:i,pipeGroups:n,controller:s})=>{if(e===void 0)return;cA(e,s);let[o,a]=r==="output"?[e,t.stdio[i]]:[t.stdio[i],e],c=n.get(o)??[];n.set(o,[...c,a]);},cA=(t,{signal:e})=>{pe(t)&&yt(t,lA,e);},lA=2;var vt=[];vt.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&vt.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&vt.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wn=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",ha=Symbol.for("signal-exit emitter"),pa=globalThis,uA=Object.defineProperty.bind(Object),fa=class{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(pa[ha])return pa[ha];uA(pa,ha,{value:this,writable:false,enumerable:false,configurable:false});}on(e,r){this.listeners[e].push(r);}removeListener(e,r){let i=this.listeners[e],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1));}emit(e,r,i){if(this.emitted[e])return false;this.emitted[e]=true;let n=false;for(let s of this.listeners[e])n=s(r,i)===true||n;return e==="exit"&&(n=this.emit("afterExit",r,i)||n),n}},xn=class{},dA=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),ma=class extends xn{onExit(){return ()=>{}}load(){}unload(){}},ga=class extends xn{#t=ya.platform==="win32"?"SIGINT":"SIGHUP";#r=new fa;#e;#i;#s;#n={};#o=false;constructor(e){super(),this.#e=e,this.#n={};for(let r of vt)this.#n[r]=()=>{let i=this.#e.listeners(r),{count:n}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(n+=s.__signal_exit_emitter__.count),i.length===n){this.unload();let o=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;o||e.kill(e.pid,a);}};this.#s=e.reallyExit,this.#i=e.emit;}onExit(e,r){if(!wn(this.#e))return ()=>{};this.#o===false&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,e),()=>{this.#r.removeListener(i,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload();}}load(){if(!this.#o){this.#o=true,this.#r.count+=1;for(let e of vt)try{let r=this.#n[e];r&&this.#e.on(e,r);}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e);}}unload(){this.#o&&(this.#o=false,vt.forEach(e=>{let r=this.#n[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r);}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#s,this.#r.count-=1);}#a(e){return wn(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let i=this.#i;if(e==="exit"&&wn(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let n=i.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),n}else return i.call(this.#e,e,...r)}},ya=globalThis.process,{onExit:Fy}=dA(wn(ya)?new ga(ya):new ma);var Ly=(t,{cleanup:e,detached:r},{signal:i})=>{if(!e||r)return;let n=Fy(()=>{t.kill();});events.addAbortListener(i,()=>{n();});};var jy=({source:t,sourcePromise:e,boundOptions:r,createNested:i},...n)=>{let s=ki(),{destination:o,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=pA(r,i,n),{sourceStream:d,sourceError:h}=mA(t,u),{options:p,fileDescriptors:m}=Te.get(t);return {sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:h,destination:o,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:m,startTime:s}},pA=(t,e,r)=>{try{let{destination:i,pipeOptions:{from:n,to:s,unpipeSignal:o}={}}=fA(t,e,...r),a=ji(i,s);return {destination:i,destinationStream:a,from:n,unpipeSignal:o}}catch(i){return {destinationError:i}}},fA=(t,e,r,...i)=>{if(Array.isArray(r))return {destination:e(qy,t)(r,...i),pipeOptions:t};if(typeof r=="string"||r instanceof URL||so(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[n,s,o]=bi(r,...i);return {destination:e(qy)(n,s,o),pipeOptions:o}}if(Te.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return {destination:r,pipeOptions:i[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},qy=({options:t})=>({options:{...t,stdin:"pipe",piped:true}}),mA=(t,e)=>{try{return {sourceStream:Ht(t,e)}}catch(r){return {sourceError:r}}};var By=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i,fileDescriptors:n,sourceOptions:s,startTime:o})=>{let a=gA({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i});if(a!==void 0)throw ba({error:a,fileDescriptors:n,sourceOptions:s,startTime:o})},gA=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i})=>{if(e!==void 0&&i!==void 0)return i;if(i!==void 0)return da(t),i;if(e!==void 0)return ua(r),e},ba=({error:t,fileDescriptors:e,sourceOptions:r,startTime:i})=>Jt({error:t,command:Ny,escapedCommand:Ny,fileDescriptors:e,options:r,startTime:i,isSync:false}),Ny="source.pipe(destination)";var Uy=async t=>{let[{status:e,reason:r,value:i=r},{status:n,reason:s,value:o=s}]=await t;if(o.pipedFrom.includes(i)||o.pipedFrom.push(i),n==="rejected")throw o;if(e==="rejected")throw i;return o};var Gy=(t,e,r)=>{let i=Sn.has(e)?wA(t,e):bA(t,e);return yt(t,SA,r.signal),yt(e,vA,r.signal),xA(e),i},bA=(t,e)=>{let r=St([t]);return Xt(r,e),Sn.set(e,r),r},wA=(t,e)=>{let r=Sn.get(e);return r.add(t),r},xA=async t=>{try{await promises.finished(t,{cleanup:!0,readable:!1,writable:!0});}catch{}Sn.delete(t);},Sn=new WeakMap,SA=2,vA=1;var Vy=(t,e)=>t===void 0?[]:[EA(t,e)],EA=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:i,sourceOptions:n,startTime:s})=>{await util.aborted(t,e),await r.remove(e);let o=new Error("Pipe canceled by `unpipeSignal` option.");throw ba({error:o,fileDescriptors:i,sourceOptions:n,startTime:s})};var vn=(t,...e)=>{if(N(e[0]))return vn.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...i}=jy(t,...e),n=CA({...i,destination:r});return n.pipe=vn.bind(void 0,{...t,source:r,sourcePromise:n,boundOptions:{}}),n},CA=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:i,destination:n,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{let l=_A(t,n);By({sourceStream:e,sourceError:i,destinationStream:s,destinationError:o,fileDescriptors:c,sourceOptions:r,startTime:u});let d=new AbortController;try{let h=Gy(e,s,d);return await Promise.race([Uy(l),...Vy(a,{sourceStream:e,mergedStream:h,sourceOptions:r,fileDescriptors:c,startTime:u})])}finally{d.abort();}},_A=(t,e)=>Promise.allSettled([t,e]);var On=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:i,encoding:n,preserveNewlines:s})=>{let o=new AbortController;return AA(e,o),Hy({stream:t,controller:o,binary:r,shouldEncode:!t.readableObjectMode&&i,encoding:n,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},AA=async(t,e)=>{try{await t;}catch{}finally{e.abort();}},wa=({stream:t,onStreamEnd:e,lines:r,encoding:i,stripFinalNewline:n,allMixed:s})=>{let o=new AbortController;DA(e,o,t);let a=t.readableObjectMode&&!s;return Hy({stream:t,controller:o,binary:i==="buffer",shouldEncode:!a,encoding:i,shouldSplit:!a&&r,preserveNewlines:!n})},DA=async(t,e,r)=>{try{await t;}catch{r.destroy();}finally{e.abort();}},Hy=({stream:t,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o})=>{let a=events.on(t,"data",{signal:e.signal,highWaterMark:Wy,highWatermark:Wy});return PA({onStdoutChunk:a,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o})},xa=stream.getDefaultHighWaterMark(true),Wy=xa,PA=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o}){let a=IA({binary:r,shouldEncode:i,encoding:n,shouldSplit:s,preserveNewlines:o});try{for await(let[c]of t)yield*xt(c,a,0);}catch(c){if(!e.signal.aborted)throw c}finally{yield*Ir(a);}},IA=({binary:t,shouldEncode:e,encoding:r,shouldSplit:i,preserveNewlines:n})=>[pn(t,r,!e),hn(t,n,!i,{})].filter(Boolean);var zy=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,buffer:n,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{let d=MA({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,allMixed:a,verboseInfo:u,streamInfo:l});if(!n){await Promise.all([RA(t),d]);return}let h=Zo(c,r),p=wa({stream:t,onStreamEnd:e,lines:o,encoding:i,stripFinalNewline:h,allMixed:a}),[m]=await Promise.all([FA({stream:t,iterable:p,fdNumber:r,encoding:i,maxBuffer:s,lines:o}),d]);return m},MA=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,allMixed:n,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!gn({stdioItems:o[r]?.stdioItems,encoding:i,verboseInfo:s,fdNumber:r}))return;let a=wa({stream:t,onStreamEnd:e,lines:true,encoding:i,stripFinalNewline:true,allMixed:n});await ny(a,t,r,s);},RA=async t=>{await promises$1.setImmediate(),t.readableFlowing===null&&t.resume();},FA=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:i,encoding:n,maxBuffer:s,lines:o})=>{try{return e||o?await tn(r,{maxBuffer:s}):n==="buffer"?new Uint8Array(await rn(r,{maxBuffer:s})):await sn(r,{maxBuffer:s})}catch(a){return Yy(ng({error:a,stream:t,readableObjectMode:e,lines:o,encoding:n,fdNumber:i}))}},Sa=async t=>{try{return await t}catch(e){return Yy(e)}},Yy=({bufferedData:t})=>wp(t)?new Uint8Array(t):t;var Fr=async(t,e,r,{isSameDirection:i,stopOnExit:n=false}={})=>{let s=qA(t,r),o=new AbortController;try{await Promise.race([...n?[r.exitPromise]:[],promises.finished(t,{cleanup:!0,signal:o.signal})]);}catch(a){s.stdinCleanedUp||BA(a,e,r,i);}finally{o.abort();}},qA=(t,{originalStreams:[e],subprocess:r})=>{let i={stdinCleanedUp:false};return t===e&&jA(t,r,i),i},jA=(t,e,r)=>{let{_destroy:i}=t;t._destroy=(...n)=>{NA(e,r),i.call(t,...n);};},NA=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=true);},BA=(t,e,r,i)=>{if(!UA(t,e,r,i))throw t},UA=(t,e,r,i=true)=>r.propagating?Jy(t)||En(t):(r.propagating=true,va(r,e)===i?Jy(t):En(t)),va=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",En=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Jy=t=>t?.code==="EPIPE";var Ky=({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((c,u)=>Oa({stream:c,fdNumber:u,encoding:e,buffer:r[u],maxBuffer:i[u],lines:n[u],allMixed:false,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),Oa=async({stream:t,fdNumber:e,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!t)return;let l=Fr(t,e,u);if(va(u,e)){await l;return}let[d]=await Promise.all([zy({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:i,maxBuffer:n,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return d};var Zy=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?St([t,e].filter(Boolean)):void 0,Xy=({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>Oa({...GA(t,r),fdNumber:"all",encoding:e,maxBuffer:i[1]+i[2],lines:n[1]||n[2],allMixed:VA(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),GA=({stdout:t,stderr:e,all:r},[,i,n])=>{let s=i||n;return s?i?n?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},VA=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;var Qy=t=>Bt(t,"ipc"),eb=(t,e)=>{let r=Ti(t);Ce({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e});};var tb=async({subprocess:t,buffer:e,maxBuffer:r,ipc:i,ipcOutput:n,verboseInfo:s})=>{if(!i)return n;let o=Qy(s),a=Ve(e,"ipc"),c=Ve(r,"ipc");for await(let u of oa({anyProcess:t,channel:t.channel,isSubprocess:false,ipc:i,shouldAwait:false,reference:true}))a&&(sg(t,n,c),n.push(u)),o&&eb(u,s);return n},rb=async(t,e)=>(await Promise.allSettled([t]),e);var ib=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:i,lines:n,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:d},context:h,verboseInfo:p,fileDescriptors:m,originalStreams:y,onInternalError:w,controller:b})=>{let S=ly(t,h),_={originalStreams:y,fileDescriptors:m,subprocess:t,exitPromise:S,propagating:false},$=Ky({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:u,verboseInfo:p,streamInfo:_}),oe=Xy({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:u,verboseInfo:p,streamInfo:_}),le=[],Pe=tb({subprocess:t,buffer:r,maxBuffer:i,ipc:l,ipcOutput:le,verboseInfo:p}),be=HA(y,t,_),x=zA(m,_);try{return await Promise.race([Promise.all([{},dy(S),Promise.all($),oe,Pe,Lm(t,d),...be,...x]),w,YA(t,b),...Im(t,s,h,b),...Qf({subprocess:t,cancelSignal:o,gracefulCancel:a,context:h,controller:b}),...Dm({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,context:h,controller:b})])}catch(T){return h.terminationReason??="other",Promise.all([{error:T},S,Promise.all($.map(E=>Sa(E))),Sa(oe),rb(Pe,le),Promise.allSettled(be),Promise.allSettled(x)])}},HA=(t,e,r)=>t.map((i,n)=>i===e.stdio[n]?void 0:Fr(i,n,r)),zA=(t,e)=>t.flatMap(({stdioItems:r},i)=>r.filter(({value:n,stream:s=n})=>ge(s,{checkOpen:false})&&!pe(s)).map(({type:n,value:s,stream:o=s})=>Fr(o,i,e,{isSameDirection:ce.has(n),stopOnExit:n==="native"}))),YA=async(t,{signal:e})=>{let[r]=await events.once(t,"error",{signal:e});throw r};var nb=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Lr=(t,e,r)=>{let i=t[r];i.has(e)||i.set(e,[]);let n=i.get(e),s=_e();return n.push(s),{resolve:s.resolve.bind(s),promises:n}},Qt=async({resolve:t,promises:e},r)=>{t();let[i]=await Promise.race([Promise.allSettled([true,r]),Promise.all([false,...e])]);return !i};var Ea=async t=>{if(t!==void 0)try{await Ca(t);}catch{}},ob=async t=>{if(t!==void 0)try{await _a(t);}catch{}},Ca=async t=>{await promises.finished(t,{cleanup:true,readable:false,writable:true});},_a=async t=>{await promises.finished(t,{cleanup:true,readable:true,writable:false});},Cn=async(t,e)=>{if(await t,e)throw e},_n=(t,e,r)=>{r&&!En(r)?t.destroy(r):e&&t.destroy();};var ab=({subprocess:t,concurrentStreams:e,encoding:r},{from:i,binary:n=true,preserveNewlines:s=true}={})=>{let o=n||se.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Ta(t,i,e),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:d}=ka(a,o),{read:h,onStdoutDataDone:p}=Aa({subprocessStdout:a,subprocess:t,binary:o,encoding:r,preserveNewlines:s}),m=new stream.Readable({read:h,destroy:util.callbackify(Pa.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:l,encoding:u});return Da({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},Ta=(t,e,r)=>{let i=Ht(t,e),n=Lr(r,i,"readableDestroy");return {subprocessStdout:i,waitReadableDestroy:n}},ka=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},i)=>i?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:true,readableHighWaterMark:xa},Aa=({subprocessStdout:t,subprocess:e,binary:r,encoding:i,preserveNewlines:n})=>{let s=_e(),o=On({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:i,preserveNewlines:n});return {read(){ZA(this,o,s);},onStdoutDataDone:s}},ZA=async(t,e,r)=>{try{let{value:i,done:n}=await e.next();n?r.resolve():t.push(i);}catch{}},Da=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:i,subprocessStdin:n})=>{try{await _a(t),await i,await Ea(n),await e,r.readable&&r.push(null);}catch(s){await Ea(n),cb(r,s);}},Pa=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},i)=>{await Qt(r,e)&&(cb(t,i),await Cn(e,i));},cb=(t,e)=>{_n(t,t.readable,e);};var ub=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}=Ia(t,r,e),o=new stream.Writable({...$a(i,t,n),destroy:util.callbackify(Ra.bind(void 0,{subprocessStdin:i,subprocess:t,waitWritableFinal:n,waitWritableDestroy:s})),highWaterMark:i.writableHighWaterMark,objectMode:i.writableObjectMode});return Ma(i,o),o},Ia=(t,e,r)=>{let i=ji(t,e),n=Lr(r,i,"writableFinal"),s=Lr(r,i,"writableDestroy");return {subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:s}},$a=(t,e,r)=>({write:QA.bind(void 0,t),final:util.callbackify(eD.bind(void 0,t,e,r))}),QA=(t,e,r,i)=>{t.write(e,r)?i():t.once("drain",i);},eD=async(t,e,r)=>{await Qt(r,e)&&(t.writable&&t.end(),await e);},Ma=async(t,e,r)=>{try{await Ca(t),e.writable&&e.end();}catch(i){await ob(r),db(e,i);}},Ra=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:i},n)=>{await Qt(r,e),await Qt(i,e)&&(db(t,n),await Cn(e,n));},db=(t,e)=>{_n(t,t.writable,e);};var hb=({subprocess:t,concurrentStreams:e,encoding:r},{from:i,to:n,binary:s=true,preserveNewlines:o=true}={})=>{let a=s||se.has(r),{subprocessStdout:c,waitReadableDestroy:u}=Ta(t,i,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:h}=Ia(t,n,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:y}=ka(c,a),{read:w,onStdoutDataDone:b}=Aa({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:o}),S=new stream.Duplex({read:w,...$a(l,t,d),destroy:util.callbackify(iD.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:t,waitReadableDestroy:u,waitWritableFinal:d,waitWritableDestroy:h})),readableHighWaterMark:y,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:m,writableObjectMode:l.writableObjectMode,encoding:p});return Da({subprocessStdout:c,onStdoutDataDone:b,readable:S,subprocess:t,subprocessStdin:l}),Ma(l,S,c),S},iD=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:i,waitWritableFinal:n,waitWritableDestroy:s},o)=>{await Promise.all([Pa({subprocessStdout:t,subprocess:r,waitReadableDestroy:i},o),Ra({subprocessStdin:e,subprocess:r,waitWritableFinal:n,waitWritableDestroy:s},o)]);};var Fa=(t,e,{from:r,binary:i=false,preserveNewlines:n=false}={})=>{let s=i||se.has(e),o=Ht(t,r),a=On({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:true,encoding:e,preserveNewlines:n});return nD(a,o,t)},nD=async function*(t,e,r){try{yield*t;}finally{e.readable&&e.destroy(),await r;}};var pb=(t,{encoding:e})=>{let r=nb();t.readable=ab.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=ub.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=hb.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=Fa.bind(void 0,t,e),t[Symbol.asyncIterator]=Fa.bind(void 0,t,e,{});};var fb=(t,e)=>{for(let[r,i]of oD){let n=i.value.bind(e);Reflect.defineProperty(t,r,{...i,value:n});}},sD=(async()=>{})().constructor.prototype,oD=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(sD,t)]);var mb=(t,e,r,i)=>{let{file:n,commandArguments:s,command:o,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:d}=lD(t,e,r),{subprocess:h,promise:p}=dD({file:n,commandArguments:s,options:l,startTime:c,verboseInfo:u,command:o,escapedCommand:a,fileDescriptors:d});return h.pipe=vn.bind(void 0,{source:h,sourcePromise:p,boundOptions:{},createNested:i}),fb(h,p),Te.set(h,{options:l,fileDescriptors:d}),h},lD=(t,e,r)=>{let{command:i,escapedCommand:n,startTime:s,verboseInfo:o}=Ai(t,e,r),{file:a,commandArguments:c,options:u}=Ki(t,e,r),l=uD(u),d=_y(l,o);return {file:a,commandArguments:c,command:i,escapedCommand:n,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},uD=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return {...r,timeoutDuration:t}},dD=({file:t,commandArguments:e,options:r,startTime:i,verboseInfo:n,command:s,escapedCommand:o,fileDescriptors:a})=>{let c;try{c=Mn.spawn(...Zi(t,e,r));}catch(m){return vy({error:m,command:s,escapedCommand:o,fileDescriptors:a,options:r,startTime:i,verboseInfo:n})}let u=new AbortController;events.setMaxListeners(Number.POSITIVE_INFINITY,u.signal);let l=[...c.stdio];Ry(c,a,u),Ly(c,r,u);let d={},h=_e();c.kill=Zf.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:h,context:d,controller:u}),c.all=Zy(c,r),pb(c,r),wy(c,r);let p=hD({subprocess:c,options:r,startTime:i,verboseInfo:n,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:o,context:d,onInternalError:h,controller:u});return {subprocess:c,promise:p}},hD=async({subprocess:t,options:e,startTime:r,verboseInfo:i,fileDescriptors:n,originalStreams:s,command:o,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{let[d,[h,p],m,y,w]=await ib({subprocess:t,options:e,context:c,verboseInfo:i,fileDescriptors:n,originalStreams:s,onInternalError:u,controller:l});l.abort(),u.resolve();let b=m.map(($,oe)=>He($,e,oe)),S=He(y,e,"all"),_=pD({errorInfo:d,exitCode:h,signal:p,stdio:b,all:S,ipcOutput:w,context:c,options:e,command:o,escapedCommand:a,startTime:r});return Kt(_,i,e)},pD=({errorInfo:t,exitCode:e,signal:r,stdio:i,all:n,ipcOutput:s,context:o,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in t?Pr({error:t.error,command:c,escapedCommand:u,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof ke,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:r,stdio:i,all:n,ipcOutput:s,options:a,startTime:l,isSync:false}):an({command:c,escapedCommand:u,stdio:i,all:n,ipcOutput:s,options:a,startTime:l});var Tn=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([i,n])=>[i,fD(i,t[i],n)]));return {...t,...r}},fD=(t,e,r)=>mD.has(t)&&N(e)&&N(r)?{...e,...r}:r,mD=new Set(["env",...ho]);var ct=(t,e,r,i)=>{let n=(o,a,c)=>ct(o,a,r,c),s=(...o)=>gD({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:i,createNested:n},...o);return i!==void 0&&i(s,n,e),s},gD=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:i,createNested:n},s,...o)=>{if(N(s))return n(t,Tn(r,s),i);let{file:a,commandArguments:c,options:u,isSync:l}=yD({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:r});return l?py(a,c,u):mb(a,c,u,n)},yD=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:i,boundOptions:n})=>{let s=Cp(e)?_p(e,r):[e,...r],[o,a,c]=bi(...s),u=Tn(Tn(i,n),c),{file:l=o,commandArguments:d=a,options:h=u,isSync:p=false}=t({file:o,commandArguments:a,options:u});return {file:l,commandArguments:d,options:h,isSync:p}};var gb=({file:t,commandArguments:e})=>bb(t,e),yb=({file:t,commandArguments:e})=>({...bb(t,e),isSync:true}),bb=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...i]=bD(t);return {file:r,commandArguments:i}},bD=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return [];let r=[];for(let i of e.split(wD)){let n=r.at(-1);n&&n.endsWith("\\")?r[r.length-1]=`${n.slice(0,-1)} ${i}`:r.push(i);}return r},wD=/ +/g;var wb=(t,e,r)=>{t.sync=e(xD,r),t.s=t.sync;},xb=({options:t})=>Sb(t),xD=({options:t})=>({...Sb(t),isSync:true}),Sb=t=>({options:{...SD(t),...t}}),SD=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},vb={preferLocal:true};var Ob=ct(()=>({}));ct(()=>({isSync:true}));ct(gb);ct(yb);ct(Mm);ct(xb,{},vb,wb);xy();async function qr({cwd:t,packageManager:e,packages:r,dev:i=false}){if(!r.length)return;let n={npm:"npm",pnpm:"pnpm",yarn:"yarn",bun:"bun"},s={npm:["install",...i?["-D"]:[],...r],pnpm:["add",...i?["-D"]:[],...r],yarn:["add",...i?["-D"]:[],...r],bun:["add",...i?["-d"]:[],...r]};await Ob(n[e],s[e],{cwd:t,stdio:"inherit"});}var Nr=Ie(et());var La="/* azamat-ui-kit:start */",kn="/* azamat-ui-kit:end */";function Eb(t){return `${La}
172
172
  @import "tw-animate-css";
173
173
  @import "@fontsource-variable/geist";
174
174
  @source "${t}";
@@ -422,16 +422,16 @@ Instead, \`yield\` should either be called with a value, or not be called at all
422
422
  }
423
423
  }
424
424
  ${kn}
425
- `}function vD(t){return /@import\s+["']tailwindcss["'];?/.test(t)}function ED(t){return vD(t)?t:`@import "tailwindcss";
425
+ `}function vD(t){return /@import\s+["']tailwindcss["'];?/.test(t)}function OD(t){return vD(t)?t:`@import "tailwindcss";
426
426
 
427
427
  ${t}`.trimEnd()+`
428
- `}function OD(t,e){let r=t.indexOf(qa),i=t.indexOf(kn);if(r!==-1&&i!==-1&&i>r){let n=t.slice(0,r).trimEnd(),s=t.slice(i+kn.length).trimStart();return [n,e,s].filter(Boolean).join(`
428
+ `}function ED(t,e){let r=t.indexOf(La),i=t.indexOf(kn);if(r!==-1&&i!==-1&&i>r){let n=t.slice(0,r).trimEnd(),s=t.slice(i+kn.length).trimStart();return [n,e,s].filter(Boolean).join(`
429
429
 
430
430
  `)+`
431
431
  `}return `${t.trimEnd()}
432
432
 
433
433
  ${e}
434
- `}function CD(t){return t.replaceAll("\\","/")}async function An({cwd:t,cssPath:e}){let r=ne__default.default.resolve(t,e),i=ne__default.default.dirname(r),n=CD(ne__default.default.relative(i,ne__default.default.join(t,"node_modules","azamat-ui-kit","dist","**","*.js")));await Nr.default.ensureDir(ne__default.default.dirname(r));let s=Nr.default.existsSync(r)?await Nr.default.readFile(r,"utf8"):"",o=ED(s),a=OD(o,Cb(n));return await Nr.default.writeFile(r,a),r}var Dn="azamat-ui-kit",_D="azamat-ui-kit-cli";function De(t=""){return `npx ${_D} ${t}`.trim()}var TD=[Dn,"@base-ui/react","@fontsource-variable/geist","clsx","tailwind-merge","class-variance-authority","lucide-react","tw-animate-css","@tanstack/react-table","react-hook-form"],kD={vite:["tailwindcss","@tailwindcss/vite"],next:["tailwindcss","@tailwindcss/postcss"]},AD=`// Generated by azamat-ui-kit init.
434
+ `}function CD(t){return t.replaceAll("\\","/")}async function An({cwd:t,cssPath:e}){let r=ne__default.default.resolve(t,e),i=ne__default.default.dirname(r),n=CD(ne__default.default.relative(i,ne__default.default.join(t,"node_modules","azamat-ui-kit","dist","**","*.js")));await Nr.default.ensureDir(ne__default.default.dirname(r));let s=Nr.default.existsSync(r)?await Nr.default.readFile(r,"utf8"):"",o=OD(s),a=ED(o,Eb(n));return await Nr.default.writeFile(r,a),r}var Cb="azamat-ui-kit",_D="azamat-ui-kit-cli";function De(t=""){return `npx ${_D} ${t}`.trim()}var TD=["@base-ui/react","@fontsource-variable/geist","clsx","tailwind-merge","class-variance-authority","lucide-react","tw-animate-css","@tanstack/react-table","react-hook-form"],kD={vite:["tailwindcss","@tailwindcss/vite"],next:["tailwindcss","@tailwindcss/postcss"]},AD=`// Generated by azamat-ui-kit init.
435
435
  // Components added with the CLI will appear under this folder.
436
436
  `;function DD(t){let i=t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/^\s*\/\/.*$/gm,"").replace(/,\s*([}\]])/g,"$1");return JSON.parse(i)}function PD(t,e,r,i){if(t==="vite"){let n=[e,r,i].map(o=>o.replaceAll("\\","/"));if(n.filter(o=>o.startsWith("src/")).length===n.length)return "./src/*"}return "./*"}async function ID({cwd:t,template:e,alias:r,componentsPath:i,hooksPath:n,utilsPath:s}){let o=ne__default.default.join(t,e==="vite"?"tsconfig.app.json":"tsconfig.json");if(!U.default.existsSync(o))return;let a=DD(await U.default.readFile(o,"utf8"));a.compilerOptions??={},a.compilerOptions.ignoreDeprecations??="6.0",a.compilerOptions.baseUrl=".";let c=a.compilerOptions.paths??{};c[`${r}/*`]=[PD(e,i,n,s)],a.compilerOptions.paths=c,await U.default.writeJson(o,a,{spaces:2});}async function $D({cwd:t,alias:e}){let r=ne__default.default.join(t,"vite.config.ts");if(!U.default.existsSync(r))return;let i=await U.default.readFile(r,"utf8"),n="import path from 'node:path'",s=` resolve: {
437
437
  alias: {
@@ -439,14 +439,14 @@ ${e}
439
439
  },
440
440
  },`,o=i;o.includes(n)||(o=`${n}
441
441
  ${o}`),!o.includes("resolve: {")&&o.includes("export default defineConfig({")&&(o=o.replace("export default defineConfig({",`export default defineConfig({
442
- ${s}`)),o.includes(`'${e}': path.resolve(process.cwd(), 'src')`)?o!==i&&await U.default.writeFile(r,o):await U.default.writeFile(r,o);}var MD={vite:{alias:"@",componentsPath:"src/components",uiPath:"src/components/ui",hooksPath:"src/hooks",utilsPath:"src/lib/utils.ts",globalCssPath:"src/index.css"},next:{alias:"@",componentsPath:"components",uiPath:"components/ui",hooksPath:"hooks",utilsPath:"lib/utils.ts",globalCssPath:"app/globals.css"}};function RD(t){return t==="next"||t==="vite"?t:(C.warn(`Unknown template '${t}'. Falling back to vite defaults.`),"vite")}function FD(t){let e=ne__default.default.join(t,"package.json"),r=U.default.readJsonSync(e);return new Set([...Object.keys(r.dependencies??{}),...Object.keys(r.devDependencies??{})])}async function Tb(t={}){let e=process.cwd(),r=ne__default.default.join(e,"package.json");U.default.existsSync(r)||(C.error("package.json topilmadi / not found. Commandni React, Vite yoki Next project ichida ishlating."),process.exit(1));let i=RD(t.template),n=MD[i],s=FD(e),o=kD[i].filter($=>!s.has($)),a=t.defaults?{installDeps:!t.skipInstall,installTailwindDeps:o.length>0,alias:n.alias,componentsPath:n.componentsPath,uiPath:n.uiPath,hooksPath:n.hooksPath,utilsPath:n.utilsPath,globalCssPath:n.globalCssPath,writeThemeCss:true}:await(0, _b.default)([{type:"confirm",name:"installDeps",message:"Asosiy dependencylarni o\u2018rnataymi? / Install base dependencies?",initial:!t.skipInstall},{type:o.length>0?"confirm":null,name:"installTailwindDeps",message:`Tailwind paketlari topilmadi (${o.join(", ")}). O\u2018rnataymi? / Install Tailwind packages?`,initial:true},{type:"text",name:"alias",message:"Path alias qanday? / Path alias?",initial:n.alias},{type:"text",name:"componentsPath",message:"Component root qayerda? / Component root?",initial:n.componentsPath},{type:"text",name:"uiPath",message:"UI primitives qayerga yozilsin? / UI primitives path?",initial:n.uiPath},{type:"text",name:"hooksPath",message:"Hooks qayerga yozilsin? / Hooks path?",initial:n.hooksPath},{type:"text",name:"utilsPath",message:"utils.ts qayerga yozilsin? / utils.ts path?",initial:n.utilsPath},{type:"text",name:"globalCssPath",message:"Theme tokenlar qaysi global CSS faylga yozilsin? / Global CSS path?",initial:n.globalCssPath},{type:"confirm",name:"writeThemeCss",message:"Dark/light theme tokenlarni global CSS faylga yozaymi? / Write theme tokens?",initial:true}]),c=yi(e);C.info(`Package manager: ${c}`),!t.skipInstall&&a.installDeps&&await qr({cwd:e,packageManager:c,packages:TD}),!t.skipInstall&&o.length>0&&a.installTailwindDeps&&await qr({cwd:e,packageManager:c,packages:o,dev:true});let u=a.utilsPath||n.utilsPath,l=a.componentsPath||n.componentsPath,d=a.uiPath||n.uiPath,h=a.hooksPath||n.hooksPath,p=a.globalCssPath||n.globalCssPath,m={style:"default",alias:a.alias||n.alias,componentsPath:l,utilsPath:u,cssPath:p,globalCssPath:p,paths:{components:l,ui:d,hooks:h,lib:ne__default.default.dirname(u)}};await U.default.writeJson(ne__default.default.join(e,"azamat-ui.json"),m,{spaces:2});let y=ne__default.default.join(e,u),w=ne__default.default.join(e,l),b=ne__default.default.join(e,d),S=ne__default.default.join(e,h);await U.default.ensureDir(ne__default.default.dirname(y)),await U.default.ensureDir(w),await U.default.ensureDir(b),await U.default.ensureDir(S);let _=[ne__default.default.join(w,"index.ts"),ne__default.default.join(b,"index.ts"),ne__default.default.join(S,"index.ts")];for(let $ of _)U.default.existsSync($)||await U.default.writeFile($,AD);if(U.default.existsSync(y)||await U.default.writeFile(y,`import { clsx, type ClassValue } from "clsx"
442
+ ${s}`)),o.includes(`'${e}': path.resolve(process.cwd(), 'src')`)?o!==i&&await U.default.writeFile(r,o):await U.default.writeFile(r,o);}var MD={vite:{alias:"@",componentsPath:"src/components",uiPath:"src/components/ui",hooksPath:"src/hooks",utilsPath:"src/lib/utils.ts",globalCssPath:"src/index.css"},next:{alias:"@",componentsPath:"components",uiPath:"components/ui",hooksPath:"hooks",utilsPath:"lib/utils.ts",globalCssPath:"app/globals.css"}};function RD(t){return t==="next"||t==="vite"?t:(C.warn(`Unknown template '${t}'. Falling back to vite defaults.`),"vite")}function FD(t){let e=ne__default.default.join(t,"package.json"),r=U.default.readJsonSync(e);return new Set([...Object.keys(r.dependencies??{}),...Object.keys(r.devDependencies??{})])}async function Tb(t={}){let e=process.cwd(),r=ne__default.default.join(e,"package.json");U.default.existsSync(r)||(C.error("package.json topilmadi / not found. Commandni React, Vite yoki Next project ichida ishlating."),process.exit(1));let i=RD(t.template),n=MD[i],s=FD(e),o=kD[i].filter($=>!s.has($)),a=t.defaults?{installDeps:!t.skipInstall,installTailwindDeps:o.length>0,alias:n.alias,componentsPath:n.componentsPath,uiPath:n.uiPath,hooksPath:n.hooksPath,utilsPath:n.utilsPath,globalCssPath:n.globalCssPath,writeThemeCss:true}:await(0, _b.default)([{type:"confirm",name:"installDeps",message:"Component source uchun kerakli dependencylarni o\u2018rnataymi? / Install component dependencies?",initial:!t.skipInstall},{type:o.length>0?"confirm":null,name:"installTailwindDeps",message:`Tailwind paketlari topilmadi (${o.join(", ")}). O\u2018rnataymi? / Install Tailwind packages?`,initial:true},{type:"text",name:"alias",message:"Path alias qanday? / Path alias?",initial:n.alias},{type:"text",name:"componentsPath",message:"Component root qayerda? / Component root?",initial:n.componentsPath},{type:"text",name:"uiPath",message:"UI primitives qayerga yozilsin? / UI primitives path?",initial:n.uiPath},{type:"text",name:"hooksPath",message:"Hooks qayerga yozilsin? / Hooks path?",initial:n.hooksPath},{type:"text",name:"utilsPath",message:"utils.ts qayerga yozilsin? / utils.ts path?",initial:n.utilsPath},{type:"text",name:"globalCssPath",message:"Theme tokenlar qaysi global CSS faylga yozilsin? / Global CSS path?",initial:n.globalCssPath},{type:"confirm",name:"writeThemeCss",message:"Dark/light theme tokenlarni global CSS faylga yozaymi? / Write theme tokens?",initial:true}]),c=yi(e);C.info(`Package manager: ${c}`),!t.skipInstall&&a.installDeps&&await qr({cwd:e,packageManager:c,packages:TD}),!t.skipInstall&&o.length>0&&a.installTailwindDeps&&await qr({cwd:e,packageManager:c,packages:o,dev:true});let u=a.utilsPath||n.utilsPath,l=a.componentsPath||n.componentsPath,d=a.uiPath||n.uiPath,h=a.hooksPath||n.hooksPath,p=a.globalCssPath||n.globalCssPath,m={style:"default",alias:a.alias||n.alias,componentsPath:l,utilsPath:u,cssPath:p,globalCssPath:p,paths:{components:l,ui:d,hooks:h,lib:ne__default.default.dirname(u)}};await U.default.writeJson(ne__default.default.join(e,"azamat-ui.json"),m,{spaces:2});let y=ne__default.default.join(e,u),w=ne__default.default.join(e,l),b=ne__default.default.join(e,d),S=ne__default.default.join(e,h);await U.default.ensureDir(ne__default.default.dirname(y)),await U.default.ensureDir(w),await U.default.ensureDir(b),await U.default.ensureDir(S);let _=[ne__default.default.join(w,"index.ts"),ne__default.default.join(b,"index.ts"),ne__default.default.join(S,"index.ts")];for(let $ of _)U.default.existsSync($)||await U.default.writeFile($,AD);if(U.default.existsSync(y)||await U.default.writeFile(y,`import { clsx, type ClassValue } from "clsx"
443
443
  import { twMerge } from "tailwind-merge"
444
444
 
445
445
  export function cn(...inputs: ClassValue[]) {
446
446
  return twMerge(clsx(inputs))
447
447
  }
448
- `),await ID({cwd:e,template:i,alias:m.alias,componentsPath:l,hooksPath:h,utilsPath:u}),i==="vite"&&await $D({cwd:e,alias:m.alias}),a.writeThemeCss&&p){let $=await An({cwd:e,cssPath:p});C.success(`Theme CSS yozildi / written: ${$}`);}C.success("Azamat UI Kit init qilindi / initialized."),C.info(`Component source root: ${l}`),C.info(`UI primitives path: ${d}`),C.info(`Hooks path: ${h}`),C.info("Componentlarni ko\u2018rish / list components:"),C.info(De("list")),C.info("Component qo\u2018shish / add components:"),C.info(De("add button input data-table")),o.length>0&&!a.installTailwindDeps&&C.warn(`Tailwind paketlari hali o\u2018rnatilmadi: ${o.join(", ")}`),C.info("Theme CSS ni yangilash / update theme CSS:"),C.info(De("theme"));}var lt=Ie(et());var g=(t,e)=>({source:t,target:e}),ze={utils:{name:"utils",category:"lib",dependencies:["clsx","tailwind-merge"],files:[g("src/lib/utils.ts","{utils}")]},button:{name:"button",category:"ui",dependencies:["@base-ui/react","class-variance-authority"],registryDependencies:["utils"],files:[g("src/components/ui/button.tsx","{ui}/button.tsx")]},input:{name:"input",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[g("src/components/ui/input.tsx","{ui}/input.tsx")]},textarea:{name:"textarea",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/textarea.tsx","{ui}/textarea.tsx")]},checkbox:{name:"checkbox",category:"ui",dependencies:["lucide-react"],registryDependencies:["utils"],files:[g("src/components/ui/checkbox.tsx","{ui}/checkbox.tsx")]},switch:{name:"switch",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/switch.tsx","{ui}/switch.tsx")]},badge:{name:"badge",category:"ui",dependencies:["@base-ui/react","class-variance-authority"],registryDependencies:["utils"],files:[g("src/components/ui/badge.tsx","{ui}/badge.tsx")]},card:{name:"card",category:"ui",dependencies:["class-variance-authority"],registryDependencies:["utils"],files:[g("src/components/ui/card.tsx","{ui}/card.tsx")]},skeleton:{name:"skeleton",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/skeleton.tsx","{ui}/skeleton.tsx")]},tabs:{name:"tabs",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[g("src/components/ui/tabs.tsx","{ui}/tabs.tsx")]},dialog:{name:"dialog",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["button","utils"],files:[g("src/components/ui/dialog.tsx","{ui}/dialog.tsx")]},"dropdown-menu":{name:"dropdown-menu",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[g("src/components/ui/dropdown-menu.tsx","{ui}/dropdown-menu.tsx")]},popover:{name:"popover",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[g("src/components/ui/popover.tsx","{ui}/popover.tsx")]},tooltip:{name:"tooltip",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/tooltip.tsx","{ui}/tooltip.tsx")]},select:{name:"select",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[g("src/components/ui/select.tsx","{ui}/select.tsx")]},table:{name:"table",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/table.tsx","{ui}/table.tsx")]},"segmented-control":{name:"segmented-control",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/segmented-control.tsx","{ui}/segmented-control.tsx")]},"radio-group":{name:"radio-group",category:"ui",registryDependencies:["button","utils"],files:[g("src/components/ui/radio-group.tsx","{ui}/radio-group.tsx")]},kbd:{name:"kbd",category:"ui",files:[g("src/components/ui/kbd.tsx","{ui}/kbd.tsx")]},"hover-card":{name:"hover-card",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/hover-card.tsx","{ui}/hover-card.tsx")]},"scroll-box":{name:"scroll-box",category:"ui",files:[g("src/components/ui/scroll-box.tsx","{ui}/scroll-box.tsx")]},"right-click-menu":{name:"right-click-menu",category:"ui",dependencies:["react"],files:[g("src/components/ui/right-click-menu.tsx","{ui}/right-click-menu.tsx")]},"input-decorator":{name:"input-decorator",category:"inputs",dependencies:["class-variance-authority"],registryDependencies:["input","utils"],files:[g("src/components/inputs/input-decorator.tsx","{components}/inputs/input-decorator.tsx")]},"input-value":{name:"input-value",category:"inputs",files:[g("src/components/inputs/input-value.ts","{components}/inputs/input-value.ts")]},"clearable-input":{name:"clearable-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["input-decorator","input-value"],files:[g("src/components/inputs/clearable-input.tsx","{components}/inputs/clearable-input.tsx")]},"search-input":{name:"search-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["clearable-input"],files:[g("src/components/inputs/search-input.tsx","{components}/inputs/search-input.tsx")]},"password-input":{name:"password-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["input-decorator"],files:[g("src/components/inputs/password-input.tsx","{components}/inputs/password-input.tsx")]},"number-input":{name:"number-input",category:"inputs",registryDependencies:["input-decorator"],files:[g("src/components/inputs/number-input.tsx","{components}/inputs/number-input.tsx")]},"date-input":{name:"date-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["input-decorator","input-value"],files:[g("src/components/inputs/date-input.tsx","{components}/inputs/date-input.tsx")]},"date-range-input":{name:"date-range-input",category:"inputs",registryDependencies:["date-input","utils"],files:[g("src/components/inputs/date-range-input.tsx","{components}/inputs/date-range-input.tsx")]},"money-input":{name:"money-input",category:"inputs",registryDependencies:["input","utils"],files:[g("src/components/inputs/money-input.tsx","{components}/inputs/money-input.tsx")]},"quantity-input":{name:"quantity-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["button","input","utils"],files:[g("src/components/inputs/quantity-input.tsx","{components}/inputs/quantity-input.tsx")]},"masked-input":{name:"masked-input",category:"inputs",registryDependencies:["input-decorator","input-value"],files:[g("src/components/inputs/masked-input.tsx","{components}/inputs/masked-input.tsx")]},"phone-input":{name:"phone-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["masked-input"],files:[g("src/components/inputs/phone-input.tsx","{components}/inputs/phone-input.tsx")]},"tag-input":{name:"tag-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["badge","input","utils"],files:[g("src/components/inputs/tag-input.tsx","{components}/inputs/tag-input.tsx")]},"simple-select":{name:"simple-select",category:"inputs",dependencies:["lucide-react"],registryDependencies:["select","utils"],files:[g("src/components/inputs/simple-select.tsx","{components}/inputs/simple-select.tsx")]},"async-select":{name:"async-select",category:"inputs",dependencies:["lucide-react"],registryDependencies:["button","input","popover","utils"],files:[g("src/components/inputs/async-select.tsx","{components}/inputs/async-select.tsx")]},"app-input":{name:"app-input",category:"inputs",registryDependencies:["input-decorator","clearable-input","search-input","password-input","number-input","phone-input","date-input"],files:[g("src/components/inputs/app-input.tsx","{components}/inputs/app-input.tsx")]},inputs:{name:"inputs",category:"group",registryDependencies:["app-input","clearable-input","search-input","password-input","number-input","date-input","date-range-input","money-input","quantity-input","masked-input","phone-input","tag-input","simple-select","async-select"],files:[g("src/components/inputs/index.ts","{components}/inputs/index.ts")]},"form-field-shell":{name:"form-field-shell",category:"form",registryDependencies:["utils"],files:[g("src/components/form/form-field-shell.tsx","{components}/form/form-field-shell.tsx")]},"form-field-utils":{name:"form-field-utils",category:"form",dependencies:["react-hook-form"],registryDependencies:["form-field-shell"],files:[g("src/components/form/form-field-utils.ts","{components}/form/form-field-utils.ts")]},"form-app-input":{name:"form-app-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["app-input","form-field-shell","form-field-utils"],files:[g("src/components/form/form-app-input.tsx","{components}/form/form-app-input.tsx")]},"form-input":{name:"form-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["input","search-input","password-input","number-input","phone-input","date-input","form-field-shell"],files:[g("src/components/form/form-input.tsx","{components}/form/form-input.tsx")]},"form-select":{name:"form-select",category:"form",dependencies:["react-hook-form"],registryDependencies:["simple-select","async-select","form-field-shell"],files:[g("src/components/form/form-select.tsx","{components}/form/form-select.tsx")]},"form-async-select":{name:"form-async-select",category:"form",dependencies:["react-hook-form"],registryDependencies:["async-select","form-field-shell"],files:[g("src/components/form/form-async-select.tsx","{components}/form/form-async-select.tsx")]},"form-textarea":{name:"form-textarea",category:"form",dependencies:["react-hook-form"],registryDependencies:["textarea","form-field-shell"],files:[g("src/components/form/form-textarea.tsx","{components}/form/form-textarea.tsx")]},"form-switch":{name:"form-switch",category:"form",dependencies:["react-hook-form"],registryDependencies:["switch","form-field-shell","utils"],files:[g("src/components/form/form-switch.tsx","{components}/form/form-switch.tsx")]},"form-search-input":{name:"form-search-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["form-app-input"],files:[g("src/components/form/form-search-input.tsx","{components}/form/form-search-input.tsx")]},"form-password-input":{name:"form-password-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["password-input","form-field-shell"],files:[g("src/components/form/form-password-input.tsx","{components}/form/form-password-input.tsx")]},"form-number-input":{name:"form-number-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["form-app-input"],files:[g("src/components/form/form-number-input.tsx","{components}/form/form-number-input.tsx")]},"form-phone-input":{name:"form-phone-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["form-app-input"],files:[g("src/components/form/form-phone-input.tsx","{components}/form/form-phone-input.tsx")]},"form-date-input":{name:"form-date-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["form-app-input"],files:[g("src/components/form/form-date-input.tsx","{components}/form/form-date-input.tsx")]},"form-date-range-input":{name:"form-date-range-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-range-input","form-field-shell"],files:[g("src/components/form/form-date-range-input.tsx","{components}/form/form-date-range-input.tsx")]},"form-date-picker":{name:"form-date-picker",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-picker","form-field-shell"],files:[g("src/components/form/form-date-picker.tsx","{components}/form/form-date-picker.tsx")]},"form-date-range-picker":{name:"form-date-range-picker",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-range-picker","form-field-shell"],files:[g("src/components/form/form-date-range-picker.tsx","{components}/form/form-date-range-picker.tsx")]},"form-actions":{name:"form-actions",category:"form",registryDependencies:["button"],files:[g("src/components/form/form-actions.tsx","{components}/form/form-actions.tsx")]},"form-section":{name:"form-section",category:"form",registryDependencies:["utils"],files:[g("src/components/form/form-section.tsx","{components}/form/form-section.tsx")]},"smart-form-shell":{name:"smart-form-shell",category:"form",registryDependencies:["form-actions","form-section","utils"],files:[g("src/components/form/smart-form-shell.tsx","{components}/form/smart-form-shell.tsx")]},form:{name:"form",category:"group",registryDependencies:["form-field-shell","form-field-utils","form-app-input","form-input","form-select","form-async-select","form-textarea","form-switch","form-search-input","form-password-input","form-number-input","form-phone-input","form-date-input","form-date-range-input","form-date-picker","form-date-range-picker","form-actions","form-section","smart-form-shell"],files:[g("src/components/form/index.ts","{components}/form/index.ts")]},"dialog-actions":{name:"dialog-actions",category:"overlay",dependencies:["lucide-react"],registryDependencies:["button","dialog"],files:[g("src/components/overlay/dialog-actions.tsx","{components}/overlay/dialog-actions.tsx")]},"modal-shell":{name:"modal-shell",category:"overlay",dependencies:["@base-ui/react"],registryDependencies:["button","dialog"],files:[g("src/components/overlay/modal-shell.tsx","{components}/overlay/modal-shell.tsx")]},"confirm-dialog":{name:"confirm-dialog",category:"overlay",dependencies:["lucide-react"],registryDependencies:["dialog-actions"],files:[g("src/components/overlay/confirm-dialog.tsx","{components}/overlay/confirm-dialog.tsx")]},"sheet-shell":{name:"sheet-shell",category:"overlay",registryDependencies:["dialog"],files:[g("src/components/overlay/sheet-shell.tsx","{components}/overlay/sheet-shell.tsx")]},"alert-dialog":{name:"alert-dialog",category:"overlay",dependencies:["lucide-react"],registryDependencies:["dialog","button"],files:[g("src/components/overlay/alert-dialog.tsx","{components}/overlay/alert-dialog.tsx")]},drawer:{name:"drawer",category:"overlay",dependencies:["@base-ui/react"],registryDependencies:["dialog"],files:[g("src/components/overlay/drawer.tsx","{components}/overlay/drawer.tsx")]},"empty-state":{name:"empty-state",category:"feedback",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[g("src/components/feedback/empty-state.tsx","{components}/feedback/empty-state.tsx")]},"loading-state":{name:"loading-state",category:"feedback",dependencies:["lucide-react"],registryDependencies:["utils"],files:[g("src/components/feedback/loading-state.tsx","{components}/feedback/loading-state.tsx")]},"status-badge":{name:"status-badge",category:"feedback",registryDependencies:["badge","utils"],files:[g("src/components/feedback/status-badge.tsx","{components}/feedback/status-badge.tsx")]},"page-state":{name:"page-state",category:"feedback",registryDependencies:["button","utils"],files:[g("src/components/feedback/page-state.tsx","{components}/feedback/page-state.tsx")]},feedback:{name:"feedback",category:"group",registryDependencies:["empty-state","loading-state","status-badge","page-state"],files:[g("src/components/feedback/index.ts","{components}/feedback/index.ts")]},"page-header":{name:"page-header",category:"layout",dependencies:["class-variance-authority"],registryDependencies:["utils"],files:[g("src/components/layout/page-header.tsx","{components}/layout/page-header.tsx")]},"stat-card":{name:"stat-card",category:"layout",registryDependencies:["card","badge","utils"],files:[g("src/components/layout/stat-card.tsx","{components}/layout/stat-card.tsx")]},layout:{name:"layout",category:"group",registryDependencies:["page-header","stat-card"],files:[g("src/components/layout/index.ts","{components}/layout/index.ts")]},"metric-card":{name:"metric-card",category:"display",registryDependencies:["card"],files:[g("src/components/display/metric-card.tsx","{components}/display/metric-card.tsx")]},calendar:{name:"calendar",category:"calendar",files:[g("src/components/calendar/calendar.tsx","{components}/calendar/calendar.tsx"),g("src/components/calendar/date-utils.ts","{components}/calendar/date-utils.ts")]},"date-picker":{name:"date-picker",category:"calendar",registryDependencies:["calendar"],files:[g("src/components/calendar/date-picker.tsx","{components}/calendar/date-picker.tsx")]},"date-range-picker":{name:"date-range-picker",category:"calendar",registryDependencies:["calendar"],files:[g("src/components/calendar/date-range-picker.tsx","{components}/calendar/date-range-picker.tsx")]},dashboard:{name:"dashboard",category:"group",registryDependencies:["layout","feedback","inputs","form"]},all:{name:"all",category:"group",registryDependencies:["dashboard"]}},Pn=Object.keys(ze);var In=Ie(et());function $n(t){let e=ne__default.default.dirname(url.fileURLToPath(t)),r=ne__default.default.resolve(e,"../vendor");if(In.default.existsSync(ne__default.default.join(r,"src")))return r;let i=[ne__default.default.resolve(e,"../.."),ne__default.default.resolve(e,".."),process.cwd()];for(let n of i){let s=ne__default.default.join(n,"package.json");if(In.default.existsSync(s))try{if(In.default.readJsonSync(s).name===Dn)return n}catch{}}return ne__default.default.resolve(e,"../..")}function qD(t){return t in ze}function jD(t){if(t.paths?.components)return t.paths.components;let e=t.componentsPath??"src/components/ui";return e.endsWith("/ui")||e.endsWith("\\ui")?ne__default.default.dirname(e):e}function ND(t,e){let r=jD(e),i=e.paths?.ui??e.componentsPath??ne__default.default.join(r,"ui"),n=e.paths?.hooks??"src/hooks",s=e.paths?.lib??ne__default.default.dirname(e.utilsPath??"src/lib/utils.ts"),o=e.utilsPath??ne__default.default.join(s,"utils.ts");return t.replaceAll("{components}",r).replaceAll("{ui}",i).replaceAll("{hooks}",n).replaceAll("{lib}",s).replaceAll("{utils}",o)}function BD(t,e="@"){return e==="@"?t:t.replaceAll("@/",`${e}/`)}function UD(t){let e=[],r=new Set;function i(n){if(r.has(n))return;let s=ze[n];s.registryDependencies?.forEach(i),r.add(n),e.push(s);}return t.forEach(i),e}function GD(){return Pn.filter(t=>ze[t].category!=="lib").sort().join(", ")}async function kb(t,e={}){let r=process.cwd(),i=ne__default.default.join(r,"azamat-ui.json");lt.default.existsSync(i)||(C.error("azamat-ui.json topilmadi. Avval init qiling:"),C.info(De("init")),process.exit(1)),t.length||(C.error("Component nomini kiriting:"),C.info(De("add data-table async-select form-input")),C.info(`Mavjud componentlar: ${GD()}`),process.exit(1));let n=[];for(let l of t){if(!qD(l)){C.warn(`${l} registry ichida mavjud emas.`);continue}n.push(l);}n.length||(C.error("Qo\u2018shish uchun valid component topilmadi."),process.exit(1));let s=await lt.default.readJson(i),o=$n((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))),a=yi(r),c=UD(n),u=new Set;for(let l of c){l.dependencies?.forEach(d=>u.add(d));for(let d of l.files??[]){let h=ne__default.default.join(o,d.source),p=ne__default.default.join(r,ND(d.target,s));if(!lt.default.existsSync(h)){C.warn(`${d.source} topilmadi. O\u2018tkazib yuborildi.`);continue}if(e.dryRun){C.info(`[dry-run] ${d.source} -> ${ne__default.default.relative(r,p)}`);continue}if(await lt.default.ensureDir(ne__default.default.dirname(p)),lt.default.existsSync(p)&&!e.overwrite){C.warn(`${ne__default.default.relative(r,p)} allaqachon mavjud. O\u2018tkazib yuborildi.`);continue}let m=await lt.default.readFile(h,"utf8");await lt.default.writeFile(p,BD(m,s.alias)),C.success(`${ne__default.default.relative(r,p)} qo\u2018shildi.`);}}!e.skipInstall&&u.size>0&&!e.dryRun&&await qr({cwd:r,packageManager:a,packages:Array.from(u)}),C.success("Componentlar muvaffaqiyatli qo\u2018shildi.");}var VD={utils:"internal",button:"stable",input:"stable",textarea:"stable",checkbox:"stable",switch:"stable",badge:"stable",card:"stable",dialog:"stable","dropdown-menu":"stable",popover:"stable",select:"stable",table:"stable","radio-group":"stable","hover-card":"stable","scroll-box":"stable","right-click-menu":"stable",kbd:"stable","dialog-actions":"stable","modal-shell":"stable","confirm-dialog":"stable","sheet-shell":"stable","alert-dialog":"stable",drawer:"stable",overlay:"stable",pagination:"stable","clearable-input":"preview","search-input":"preview","password-input":"preview","number-input":"preview","date-input":"preview","date-range-input":"preview","money-input":"preview","quantity-input":"preview","masked-input":"preview","phone-input":"preview","simple-select":"preview","async-select":"preview",inputs:"preview","form-field-shell":"preview","form-input":"preview","form-select":"preview","form-async-select":"preview","form-textarea":"preview","form-switch":"preview","form-search-input":"preview","form-password-input":"preview","form-number-input":"preview","form-phone-input":"preview","form-date-input":"preview","form-date-range-input":"preview","form-date-picker":"preview","form-date-range-picker":"preview",form:"preview","empty-state":"stable","loading-state":"stable","status-badge":"stable",feedback:"stable","description-list":"stable",progress:"stable",result:"stable",timeline:"stable","metric-grid":"stable","metric-card":"stable","info-card":"stable","activity-feed":"stable",display:"stable","action-menu":"stable",actions:"stable","page-header":"stable","stat-card":"stable","app-shell":"stable","app-header":"stable","app-sidebar":"stable","sidebar-nav":"stable",breadcrumbs:"stable","page-container":"stable",layout:"stable","filter-bar":"stable",filters:"stable","data-table-toolbar":"preview","data-table-pagination":"preview","data-table-column-visibility-menu":"preview","data-table-select-column":"preview","data-table-sortable-header":"preview","data-table-row-actions":"preview","data-table-actions-column":"preview","data-table-bulk-actions":"preview","data-table-view-presets":"preview","data-table":"preview",calendar:"preview","date-picker":"preview","date-range-picker":"preview","calendar-kit":"preview","file-upload":"preview","image-upload":"preview",upload:"preview",stepper:"preview",wizard:"preview","wizard-kit":"preview",toast:"preview",notifications:"preview","command-palette":"preview",command:"preview","resource-page":"preview","resource-detail-page":"preview","form-builder":"experimental","form-builder-presets":"experimental",patterns:"preview","use-session-storage-state":"stable","use-before-unload-when-dirty":"stable","use-is-mobile":"stable","use-disclosure":"stable","use-debounce":"stable","use-data-table-view-state":"preview",hooks:"stable",dashboard:"preview",all:"preview"};function Ab(t){return VD[t]??"preview"}var WD={lib:"foundation",ui:"foundation",hooks:"foundation",overlay:"source-copy",navigation:"source-copy",inputs:"source-copy",form:"source-copy",feedback:"source-copy",display:"source-copy",actions:"source-copy",layout:"source-copy",filters:"source-copy","data-table":"system",calendar:"source-copy",upload:"source-copy",wizard:"source-copy",notifications:"source-copy",command:"source-copy",patterns:"system",group:"system"},HD={utils:"foundation",button:"foundation",input:"foundation",textarea:"foundation",checkbox:"foundation",switch:"foundation",badge:"foundation",card:"foundation",skeleton:"foundation",tabs:"foundation",dialog:"foundation","dropdown-menu":"foundation",popover:"foundation",select:"foundation",table:"foundation","use-session-storage-state":"foundation","use-before-unload-when-dirty":"foundation","use-is-mobile":"foundation","use-disclosure":"foundation","use-debounce":"foundation",hooks:"foundation","data-table":"system","form-builder":"system","form-builder-presets":"system","resource-page":"system","resource-detail-page":"system","action-system":"system","status-system":"system","filter-builder":"system","data-view":"system","entity-details":"system","resource-system":"system","crud-system":"system","calendar-kit":"system","wizard-kit":"system",dashboard:"system",all:"system"};function Db(t,e){return HD[t]??WD[e]}function Pb(){let t=Pn.filter(e=>ze[e].category!=="lib").reduce((e,r)=>{let i=ze[r].category;return e[i]??=[],e[i].push(r),e},{});for(let[e,r]of Object.entries(t))console.log(`
448
+ `),await ID({cwd:e,template:i,alias:m.alias,componentsPath:l,hooksPath:h,utilsPath:u}),i==="vite"&&await $D({cwd:e,alias:m.alias}),a.writeThemeCss&&p){let $=await An({cwd:e,cssPath:p});C.success(`Theme CSS yozildi / written: ${$}`);}C.success("Azamat UI Kit source-copy setup tayyor / initialized."),C.info(`Component source root: ${l}`),C.info(`UI primitives path: ${d}`),C.info(`Hooks path: ${h}`),C.info("Componentlarni ko\u2018rish / list components:"),C.info(De("list")),C.info("Component qo\u2018shish / add components:"),C.info(De("add button input data-table")),o.length>0&&!a.installTailwindDeps&&C.warn(`Tailwind paketlari hali o\u2018rnatilmadi: ${o.join(", ")}`),C.info("Theme CSS ni yangilash / update theme CSS:"),C.info(De("theme"));}var lt=Ie(et());var g=(t,e)=>({source:t,target:e}),ze={utils:{name:"utils",category:"lib",dependencies:["clsx","tailwind-merge"],files:[g("src/lib/utils.ts","{utils}")]},button:{name:"button",category:"ui",dependencies:["@base-ui/react","class-variance-authority"],registryDependencies:["utils"],files:[g("src/components/ui/button.tsx","{ui}/button.tsx")]},input:{name:"input",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[g("src/components/ui/input.tsx","{ui}/input.tsx")]},textarea:{name:"textarea",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/textarea.tsx","{ui}/textarea.tsx")]},checkbox:{name:"checkbox",category:"ui",dependencies:["lucide-react"],registryDependencies:["utils"],files:[g("src/components/ui/checkbox.tsx","{ui}/checkbox.tsx")]},switch:{name:"switch",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/switch.tsx","{ui}/switch.tsx")]},badge:{name:"badge",category:"ui",dependencies:["@base-ui/react","class-variance-authority"],registryDependencies:["utils"],files:[g("src/components/ui/badge.tsx","{ui}/badge.tsx")]},card:{name:"card",category:"ui",dependencies:["class-variance-authority"],registryDependencies:["utils"],files:[g("src/components/ui/card.tsx","{ui}/card.tsx")]},skeleton:{name:"skeleton",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/skeleton.tsx","{ui}/skeleton.tsx")]},tabs:{name:"tabs",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[g("src/components/ui/tabs.tsx","{ui}/tabs.tsx")]},dialog:{name:"dialog",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["button","utils"],files:[g("src/components/ui/dialog.tsx","{ui}/dialog.tsx")]},"dropdown-menu":{name:"dropdown-menu",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[g("src/components/ui/dropdown-menu.tsx","{ui}/dropdown-menu.tsx")]},popover:{name:"popover",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[g("src/components/ui/popover.tsx","{ui}/popover.tsx")]},tooltip:{name:"tooltip",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/tooltip.tsx","{ui}/tooltip.tsx")]},select:{name:"select",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[g("src/components/ui/select.tsx","{ui}/select.tsx")]},table:{name:"table",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/table.tsx","{ui}/table.tsx")]},"segmented-control":{name:"segmented-control",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/segmented-control.tsx","{ui}/segmented-control.tsx")]},"radio-group":{name:"radio-group",category:"ui",registryDependencies:["button","utils"],files:[g("src/components/ui/radio-group.tsx","{ui}/radio-group.tsx")]},kbd:{name:"kbd",category:"ui",files:[g("src/components/ui/kbd.tsx","{ui}/kbd.tsx")]},"hover-card":{name:"hover-card",category:"ui",registryDependencies:["utils"],files:[g("src/components/ui/hover-card.tsx","{ui}/hover-card.tsx")]},"scroll-box":{name:"scroll-box",category:"ui",files:[g("src/components/ui/scroll-box.tsx","{ui}/scroll-box.tsx")]},"right-click-menu":{name:"right-click-menu",category:"ui",dependencies:["react"],files:[g("src/components/ui/right-click-menu.tsx","{ui}/right-click-menu.tsx")]},"input-decorator":{name:"input-decorator",category:"inputs",dependencies:["class-variance-authority"],registryDependencies:["input","utils"],files:[g("src/components/inputs/input-decorator.tsx","{components}/inputs/input-decorator.tsx")]},"input-value":{name:"input-value",category:"inputs",files:[g("src/components/inputs/input-value.ts","{components}/inputs/input-value.ts")]},"clearable-input":{name:"clearable-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["input-decorator","input-value"],files:[g("src/components/inputs/clearable-input.tsx","{components}/inputs/clearable-input.tsx")]},"search-input":{name:"search-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["clearable-input"],files:[g("src/components/inputs/search-input.tsx","{components}/inputs/search-input.tsx")]},"password-input":{name:"password-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["input-decorator"],files:[g("src/components/inputs/password-input.tsx","{components}/inputs/password-input.tsx")]},"number-input":{name:"number-input",category:"inputs",registryDependencies:["input-decorator"],files:[g("src/components/inputs/number-input.tsx","{components}/inputs/number-input.tsx")]},"date-input":{name:"date-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["input-decorator","input-value"],files:[g("src/components/inputs/date-input.tsx","{components}/inputs/date-input.tsx")]},"date-range-input":{name:"date-range-input",category:"inputs",registryDependencies:["date-input","utils"],files:[g("src/components/inputs/date-range-input.tsx","{components}/inputs/date-range-input.tsx")]},"money-input":{name:"money-input",category:"inputs",registryDependencies:["input","utils"],files:[g("src/components/inputs/money-input.tsx","{components}/inputs/money-input.tsx")]},"quantity-input":{name:"quantity-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["button","input","utils"],files:[g("src/components/inputs/quantity-input.tsx","{components}/inputs/quantity-input.tsx")]},"masked-input":{name:"masked-input",category:"inputs",registryDependencies:["input-decorator","input-value"],files:[g("src/components/inputs/masked-input.tsx","{components}/inputs/masked-input.tsx")]},"phone-input":{name:"phone-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["masked-input"],files:[g("src/components/inputs/phone-input.tsx","{components}/inputs/phone-input.tsx")]},"tag-input":{name:"tag-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["badge","input","utils"],files:[g("src/components/inputs/tag-input.tsx","{components}/inputs/tag-input.tsx")]},"simple-select":{name:"simple-select",category:"inputs",dependencies:["lucide-react"],registryDependencies:["select","utils"],files:[g("src/components/inputs/simple-select.tsx","{components}/inputs/simple-select.tsx")]},"async-select":{name:"async-select",category:"inputs",dependencies:["lucide-react"],registryDependencies:["button","input","popover","utils"],files:[g("src/components/inputs/async-select.tsx","{components}/inputs/async-select.tsx")]},"app-input":{name:"app-input",category:"inputs",migrationAliasFor:"input",registryDependencies:["input-decorator","clearable-input","search-input","password-input","number-input","phone-input","date-input"],files:[g("src/components/inputs/app-input.tsx","{components}/inputs/app-input.tsx")]},inputs:{name:"inputs",category:"group",registryDependencies:["app-input","clearable-input","search-input","password-input","number-input","date-input","date-range-input","money-input","quantity-input","masked-input","phone-input","tag-input","simple-select","async-select"],files:[g("src/components/inputs/index.ts","{components}/inputs/index.ts")]},"form-field-shell":{name:"form-field-shell",category:"form",registryDependencies:["utils"],files:[g("src/components/form/form-field-shell.tsx","{components}/form/form-field-shell.tsx")]},"form-field-utils":{name:"form-field-utils",category:"form",dependencies:["react-hook-form"],registryDependencies:["form-field-shell"],files:[g("src/components/form/form-field-utils.ts","{components}/form/form-field-utils.ts")]},"form-app-input":{name:"form-app-input",category:"form",migrationAliasFor:"form-input",dependencies:["react-hook-form"],registryDependencies:["app-input","form-field-shell","form-field-utils"],files:[g("src/components/form/form-app-input.tsx","{components}/form/form-app-input.tsx")]},"form-input":{name:"form-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["input","search-input","password-input","number-input","phone-input","date-input","form-field-shell"],files:[g("src/components/form/form-input.tsx","{components}/form/form-input.tsx")]},"form-select":{name:"form-select",category:"form",dependencies:["react-hook-form"],registryDependencies:["simple-select","async-select","form-field-shell"],files:[g("src/components/form/form-select.tsx","{components}/form/form-select.tsx")]},"form-async-select":{name:"form-async-select",category:"form",migrationAliasFor:"form-select",dependencies:["react-hook-form"],registryDependencies:["async-select","form-field-shell"],files:[g("src/components/form/form-async-select.tsx","{components}/form/form-async-select.tsx")]},"form-textarea":{name:"form-textarea",category:"form",dependencies:["react-hook-form"],registryDependencies:["textarea","form-field-shell"],files:[g("src/components/form/form-textarea.tsx","{components}/form/form-textarea.tsx")]},"form-switch":{name:"form-switch",category:"form",dependencies:["react-hook-form"],registryDependencies:["switch","form-field-shell","utils"],files:[g("src/components/form/form-switch.tsx","{components}/form/form-switch.tsx")]},"form-search-input":{name:"form-search-input",category:"form",migrationAliasFor:"form-input",dependencies:["react-hook-form"],registryDependencies:["form-app-input"],files:[g("src/components/form/form-search-input.tsx","{components}/form/form-search-input.tsx")]},"form-password-input":{name:"form-password-input",category:"form",migrationAliasFor:"form-input",dependencies:["react-hook-form"],registryDependencies:["password-input","form-field-shell"],files:[g("src/components/form/form-password-input.tsx","{components}/form/form-password-input.tsx")]},"form-number-input":{name:"form-number-input",category:"form",migrationAliasFor:"form-input",dependencies:["react-hook-form"],registryDependencies:["form-app-input"],files:[g("src/components/form/form-number-input.tsx","{components}/form/form-number-input.tsx")]},"form-phone-input":{name:"form-phone-input",category:"form",migrationAliasFor:"form-input",dependencies:["react-hook-form"],registryDependencies:["form-app-input"],files:[g("src/components/form/form-phone-input.tsx","{components}/form/form-phone-input.tsx")]},"form-date-input":{name:"form-date-input",category:"form",migrationAliasFor:"form-input",dependencies:["react-hook-form"],registryDependencies:["form-app-input"],files:[g("src/components/form/form-date-input.tsx","{components}/form/form-date-input.tsx")]},"form-date-range-input":{name:"form-date-range-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-range-input","form-field-shell"],files:[g("src/components/form/form-date-range-input.tsx","{components}/form/form-date-range-input.tsx")]},"form-date-picker":{name:"form-date-picker",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-picker","form-field-shell"],files:[g("src/components/form/form-date-picker.tsx","{components}/form/form-date-picker.tsx")]},"form-date-range-picker":{name:"form-date-range-picker",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-range-picker","form-field-shell"],files:[g("src/components/form/form-date-range-picker.tsx","{components}/form/form-date-range-picker.tsx")]},"form-actions":{name:"form-actions",category:"form",registryDependencies:["button"],files:[g("src/components/form/form-actions.tsx","{components}/form/form-actions.tsx")]},"form-section":{name:"form-section",category:"form",registryDependencies:["utils"],files:[g("src/components/form/form-section.tsx","{components}/form/form-section.tsx")]},"smart-form-shell":{name:"smart-form-shell",category:"form",registryDependencies:["form-actions","form-section","utils"],files:[g("src/components/form/smart-form-shell.tsx","{components}/form/smart-form-shell.tsx")]},form:{name:"form",category:"group",registryDependencies:["form-field-shell","form-field-utils","form-app-input","form-input","form-select","form-async-select","form-textarea","form-switch","form-search-input","form-password-input","form-number-input","form-phone-input","form-date-input","form-date-range-input","form-date-picker","form-date-range-picker","form-actions","form-section","smart-form-shell"],files:[g("src/components/form/index.ts","{components}/form/index.ts")]},"dialog-actions":{name:"dialog-actions",category:"overlay",dependencies:["lucide-react"],registryDependencies:["button","dialog"],files:[g("src/components/overlay/dialog-actions.tsx","{components}/overlay/dialog-actions.tsx")]},"modal-shell":{name:"modal-shell",category:"overlay",dependencies:["@base-ui/react"],registryDependencies:["button","dialog"],files:[g("src/components/overlay/modal-shell.tsx","{components}/overlay/modal-shell.tsx")]},"confirm-dialog":{name:"confirm-dialog",category:"overlay",dependencies:["lucide-react"],registryDependencies:["dialog-actions"],files:[g("src/components/overlay/confirm-dialog.tsx","{components}/overlay/confirm-dialog.tsx")]},"sheet-shell":{name:"sheet-shell",category:"overlay",registryDependencies:["dialog"],files:[g("src/components/overlay/sheet-shell.tsx","{components}/overlay/sheet-shell.tsx")]},"alert-dialog":{name:"alert-dialog",category:"overlay",dependencies:["lucide-react"],registryDependencies:["dialog","button"],files:[g("src/components/overlay/alert-dialog.tsx","{components}/overlay/alert-dialog.tsx")]},drawer:{name:"drawer",category:"overlay",dependencies:["@base-ui/react"],registryDependencies:["dialog"],files:[g("src/components/overlay/drawer.tsx","{components}/overlay/drawer.tsx")]},"empty-state":{name:"empty-state",category:"feedback",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[g("src/components/feedback/empty-state.tsx","{components}/feedback/empty-state.tsx")]},"loading-state":{name:"loading-state",category:"feedback",dependencies:["lucide-react"],registryDependencies:["utils"],files:[g("src/components/feedback/loading-state.tsx","{components}/feedback/loading-state.tsx")]},"status-badge":{name:"status-badge",category:"feedback",registryDependencies:["badge","utils"],files:[g("src/components/feedback/status-badge.tsx","{components}/feedback/status-badge.tsx")]},"page-state":{name:"page-state",category:"feedback",registryDependencies:["button","utils"],files:[g("src/components/feedback/page-state.tsx","{components}/feedback/page-state.tsx")]},feedback:{name:"feedback",category:"group",registryDependencies:["empty-state","loading-state","status-badge","page-state"],files:[g("src/components/feedback/index.ts","{components}/feedback/index.ts")]},"page-header":{name:"page-header",category:"layout",dependencies:["class-variance-authority"],registryDependencies:["utils"],files:[g("src/components/layout/page-header.tsx","{components}/layout/page-header.tsx")]},"stat-card":{name:"stat-card",category:"layout",registryDependencies:["card","badge","utils"],files:[g("src/components/layout/stat-card.tsx","{components}/layout/stat-card.tsx")]},layout:{name:"layout",category:"group",registryDependencies:["page-header","stat-card"],files:[g("src/components/layout/index.ts","{components}/layout/index.ts")]},"metric-card":{name:"metric-card",category:"display",registryDependencies:["card"],files:[g("src/components/display/metric-card.tsx","{components}/display/metric-card.tsx")]},calendar:{name:"calendar",category:"calendar",files:[g("src/components/calendar/calendar.tsx","{components}/calendar/calendar.tsx"),g("src/components/calendar/date-utils.ts","{components}/calendar/date-utils.ts")]},"date-picker":{name:"date-picker",category:"calendar",registryDependencies:["calendar"],files:[g("src/components/calendar/date-picker.tsx","{components}/calendar/date-picker.tsx")]},"date-range-picker":{name:"date-range-picker",category:"calendar",registryDependencies:["calendar"],files:[g("src/components/calendar/date-range-picker.tsx","{components}/calendar/date-range-picker.tsx")]},dashboard:{name:"dashboard",category:"group",registryDependencies:["layout","feedback","inputs","form"]},all:{name:"all",category:"group",registryDependencies:["dashboard"]}},Dn=Object.keys(ze);var Pn=Ie(et());function In(t){let e=ne__default.default.dirname(url.fileURLToPath(t)),r=ne__default.default.resolve(e,"../vendor");if(Pn.default.existsSync(ne__default.default.join(r,"src")))return r;let i=[ne__default.default.resolve(e,"../.."),ne__default.default.resolve(e,".."),process.cwd()];for(let n of i){let s=ne__default.default.join(n,"package.json");if(Pn.default.existsSync(s))try{if(Pn.default.readJsonSync(s).name===Cb)return n}catch{}}return ne__default.default.resolve(e,"../..")}function qD(t){return t in ze}function jD(t){if(t.paths?.components)return t.paths.components;let e=t.componentsPath??"src/components/ui";return e.endsWith("/ui")||e.endsWith("\\ui")?ne__default.default.dirname(e):e}function ND(t,e){let r=jD(e),i=e.paths?.ui??e.componentsPath??ne__default.default.join(r,"ui"),n=e.paths?.hooks??"src/hooks",s=e.paths?.lib??ne__default.default.dirname(e.utilsPath??"src/lib/utils.ts"),o=e.utilsPath??ne__default.default.join(s,"utils.ts");return t.replaceAll("{components}",r).replaceAll("{ui}",i).replaceAll("{hooks}",n).replaceAll("{lib}",s).replaceAll("{utils}",o)}function BD(t,e="@"){return e==="@"?t:t.replaceAll("@/",`${e}/`)}function UD(t){let e=[],r=new Set;function i(n){if(r.has(n))return;let s=ze[n];s.registryDependencies?.forEach(i),r.add(n),e.push(s);}return t.forEach(i),e}function GD(){return Dn.filter(t=>ze[t].category!=="lib").sort().join(", ")}async function kb(t,e={}){let r=process.cwd(),i=ne__default.default.join(r,"azamat-ui.json");lt.default.existsSync(i)||(C.error("azamat-ui.json topilmadi. Avval init qiling:"),C.info(De("init")),process.exit(1)),t.length||(C.error("Component nomini kiriting:"),C.info(De("add data-table async-select form-input")),C.info(`Mavjud componentlar: ${GD()}`),process.exit(1));let n=[];for(let l of t){if(!qD(l)){C.warn(`${l} registry ichida mavjud emas.`);continue}n.push(l);}n.length||(C.error("Qo\u2018shish uchun valid component topilmadi."),process.exit(1));let s=await lt.default.readJson(i),o=In((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))),a=yi(r),c=UD(n),u=new Set;for(let l of c){l.dependencies?.forEach(d=>u.add(d));for(let d of l.files??[]){let h=ne__default.default.join(o,d.source),p=ne__default.default.join(r,ND(d.target,s));if(!lt.default.existsSync(h)){C.warn(`${d.source} topilmadi. O\u2018tkazib yuborildi.`);continue}if(e.dryRun){C.info(`[dry-run] ${d.source} -> ${ne__default.default.relative(r,p)}`);continue}if(await lt.default.ensureDir(ne__default.default.dirname(p)),lt.default.existsSync(p)&&!e.overwrite){C.warn(`${ne__default.default.relative(r,p)} allaqachon mavjud. O\u2018tkazib yuborildi.`);continue}let m=await lt.default.readFile(h,"utf8");await lt.default.writeFile(p,BD(m,s.alias)),C.success(`${ne__default.default.relative(r,p)} qo\u2018shildi.`);}}!e.skipInstall&&u.size>0&&!e.dryRun&&await qr({cwd:r,packageManager:a,packages:Array.from(u)}),C.success("Componentlar muvaffaqiyatli qo\u2018shildi.");}var VD={utils:"internal",button:"stable",input:"stable",textarea:"stable",checkbox:"stable",switch:"stable",badge:"stable",card:"stable",dialog:"stable","dropdown-menu":"stable",popover:"stable",select:"stable",table:"stable","radio-group":"stable","hover-card":"stable","scroll-box":"stable","right-click-menu":"stable",kbd:"stable","dialog-actions":"stable","modal-shell":"stable","confirm-dialog":"stable","sheet-shell":"stable","alert-dialog":"stable",drawer:"stable",overlay:"stable",pagination:"stable","clearable-input":"preview","search-input":"preview","password-input":"preview","number-input":"preview","date-input":"preview","date-range-input":"preview","money-input":"preview","quantity-input":"preview","masked-input":"preview","phone-input":"preview","simple-select":"preview","async-select":"preview",inputs:"preview","form-field-shell":"preview","form-input":"preview","form-select":"preview","form-async-select":"preview","form-textarea":"preview","form-switch":"preview","form-search-input":"preview","form-password-input":"preview","form-number-input":"preview","form-phone-input":"preview","form-date-input":"preview","form-date-range-input":"preview","form-date-picker":"preview","form-date-range-picker":"preview",form:"preview","empty-state":"stable","loading-state":"stable","status-badge":"stable",feedback:"stable","description-list":"stable",progress:"stable",result:"stable",timeline:"stable","metric-grid":"stable","metric-card":"stable","info-card":"stable","activity-feed":"stable",display:"stable","action-menu":"stable",actions:"stable","page-header":"stable","stat-card":"stable","app-shell":"stable","app-header":"stable","app-sidebar":"stable","sidebar-nav":"stable",breadcrumbs:"stable","page-container":"stable",layout:"stable","filter-bar":"stable",filters:"stable","data-table-toolbar":"preview","data-table-pagination":"preview","data-table-column-visibility-menu":"preview","data-table-select-column":"preview","data-table-sortable-header":"preview","data-table-row-actions":"preview","data-table-actions-column":"preview","data-table-bulk-actions":"preview","data-table-view-presets":"preview","data-table":"preview",calendar:"preview","date-picker":"preview","date-range-picker":"preview","calendar-kit":"preview","file-upload":"preview","image-upload":"preview",upload:"preview",stepper:"preview",wizard:"preview","wizard-kit":"preview",toast:"preview",notifications:"preview","command-palette":"preview",command:"preview","resource-page":"preview","resource-detail-page":"preview","form-builder":"experimental","form-builder-presets":"experimental",patterns:"preview","use-session-storage-state":"stable","use-before-unload-when-dirty":"stable","use-is-mobile":"stable","use-disclosure":"stable","use-debounce":"stable","use-data-table-view-state":"preview",hooks:"stable",dashboard:"preview",all:"preview"};function Ab(t){return VD[t]??"preview"}var WD={lib:"foundation",ui:"foundation",hooks:"foundation",overlay:"source-copy",navigation:"source-copy",inputs:"source-copy",form:"source-copy",feedback:"source-copy",display:"source-copy",actions:"source-copy",layout:"source-copy",filters:"source-copy","data-table":"system",calendar:"source-copy",upload:"source-copy",wizard:"source-copy",notifications:"source-copy",command:"source-copy",patterns:"system",group:"system"},HD={utils:"foundation",button:"foundation",input:"foundation",textarea:"foundation",checkbox:"foundation",switch:"foundation",badge:"foundation",card:"foundation",skeleton:"foundation",tabs:"foundation",dialog:"foundation","dropdown-menu":"foundation",popover:"foundation",select:"foundation",table:"foundation","use-session-storage-state":"foundation","use-before-unload-when-dirty":"foundation","use-is-mobile":"foundation","use-disclosure":"foundation","use-debounce":"foundation",hooks:"foundation","data-table":"system","form-builder":"system","form-builder-presets":"system","resource-page":"system","resource-detail-page":"system","action-system":"system","status-system":"system","filter-builder":"system","data-view":"system","entity-details":"system","resource-system":"system","crud-system":"system","calendar-kit":"system","wizard-kit":"system",dashboard:"system",all:"system"};function Db(t,e){return HD[t]??WD[e]}function Pb(){let t=Dn.filter(e=>ze[e].category!=="lib").reduce((e,r)=>{let i=ze[r].category;return e[i]??=[],e[i].push(r),e},{});for(let[e,r]of Object.entries(t))console.log(`
449
449
  ${e}`),r.sort().forEach(i=>{let n=ze[i],s=Ab(i),o=Db(i,n.category),a=n.registryDependencies?.length?` -> ${n.registryDependencies.join(", ")}`:"";console.log(` ${i} [${s}/${o}]${a}`);});console.log(`
450
450
  Status:`),console.log(" stable = safe public API"),console.log(" preview = usable but API may change"),console.log(" experimental = not ready for stable app contracts"),console.log(" internal = helper metadata"),console.log(`
451
451
  Distribution:`),console.log(" foundation = small runtime-safe primitives, hooks, and helpers"),console.log(" source-copy = copy into app source with init/add and edit locally"),console.log(" system = larger product surfaces, kits, and patterns; prefer source-copy only"),console.log(`
452
- Usage:`),console.log(` ${De("add button input data-table")}`),console.log(` ${De("add form --overwrite")}`);}var ja=Ie(et());async function Ib(t){let e=process.cwd(),r=ne__default.default.join(e,"azamat-ui.json"),i=ja.default.existsSync(r)?await ja.default.readJson(r):{},n=t??i.cssPath??i.globalCssPath??"src/index.css",s=await An({cwd:e,cssPath:n});C.success(`Azamat UI theme CSS yangilandi: ${s}`);}var Ct=Ie(et());var $b={minimal:[{source:"src/lib/utils.ts",target:"{utils}"},{source:"src/components/ui/button.tsx",target:"{ui}/button.tsx"},{source:"src/components/ui/input.tsx",target:"{ui}/input.tsx"},{source:"src/components/ui/card.tsx",target:"{ui}/card.tsx"},{source:"src/components/ui/badge.tsx",target:"{ui}/badge.tsx"}],dashboard:[{source:"src/lib/utils.ts",target:"{utils}"},{source:"src/components/ui/button.tsx",target:"{ui}/button.tsx"},{source:"src/components/ui/input.tsx",target:"{ui}/input.tsx"},{source:"src/components/ui/card.tsx",target:"{ui}/card.tsx"},{source:"src/components/ui/badge.tsx",target:"{ui}/badge.tsx"},{source:"src/components/ui/dropdown-menu.tsx",target:"{ui}/dropdown-menu.tsx"},{source:"src/components/ui/skeleton.tsx",target:"{ui}/skeleton.tsx"},{source:"src/components/ui/tabs.tsx",target:"{ui}/tabs.tsx"},{source:"src/components/feedback/page-state.tsx",target:"{components}/feedback/page-state.tsx"},{source:"src/components/display/property-grid.tsx",target:"{components}/display/property-grid.tsx"},{source:"src/components/display/smart-card.tsx",target:"{components}/display/smart-card.tsx"},{source:"src/components/display/entity-card.tsx",target:"{components}/display/entity-card.tsx"},{source:"src/components/patterns/action-system.tsx",target:"{components}/patterns/action-system.tsx"},{source:"src/components/patterns/status-system.tsx",target:"{components}/patterns/status-system.tsx"},{source:"src/components/patterns/filter-builder.tsx",target:"{components}/patterns/filter-builder.tsx"},{source:"src/components/patterns/data-view.tsx",target:"{components}/patterns/data-view.tsx"},{source:"src/components/patterns/entity-details.tsx",target:"{components}/patterns/entity-details.tsx"},{source:"src/components/patterns/resource-system.tsx",target:"{components}/patterns/resource-system.tsx"},{source:"src/components/patterns/crud-system.tsx",target:"{components}/patterns/crud-system.tsx"},{source:"src/components/form/form-actions.tsx",target:"{components}/form/form-actions.tsx"},{source:"src/components/form/form-section.tsx",target:"{components}/form/form-section.tsx"},{source:"src/components/form/smart-form-shell.tsx",target:"{components}/form/smart-form-shell.tsx"},{source:"src/components/layout/workspace-shell.tsx",target:"{components}/layout/workspace-shell.tsx"}]};function YD(t,e="@"){return e==="@"?t:t.replaceAll("@/",`${e}/`)}function JD(t,e){let r=e.paths?.components??"src/components",i=e.paths?.ui??"src/components/ui",n=e.utilsPath??"src/lib/utils.ts";return t.replaceAll("{components}",r).replaceAll("{ui}",i).replaceAll("{utils}",n)}async function Mb(t,e={}){let r=$b[t];r||(C.error(`Preset topilmadi: ${t}`),process.exit(1));let i=process.cwd(),n=ne__default.default.join(i,"azamat-ui.json");Ct.default.existsSync(n)||(C.error("azamat-ui.json topilmadi. Avval init qiling."),process.exit(1));let s=await Ct.default.readJson(n),o=$n((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));for(let a of r){let c=ne__default.default.join(o,a.source),u=ne__default.default.join(i,JD(a.target,s));if(e.dryRun){C.info(`[dry-run] ${a.source} -> ${ne__default.default.relative(i,u)}`);continue}if(Ct.default.existsSync(u)&&!e.overwrite){C.warn(`${ne__default.default.relative(i,u)} allaqachon mavjud.`);continue}await Ct.default.ensureDir(ne__default.default.dirname(u)),await Ct.default.writeFile(u,YD(await Ct.default.readFile(c,"utf8"),s.alias)),C.success(`${ne__default.default.relative(i,u)} qo\u2018shildi.`);}}var _t=new kt;_t.name("azamat-ui-kit").description("Azamat UI Kit CLI").version("0.3.4");_t.command("init").description("Initialize Azamat UI Kit in your project").option("--template <template>","Project defaults: vite or next","vite").option("--skip-install","Do not install base dependencies").option("-y, --defaults","Use template defaults without interactive prompts").action(Tb);_t.command("preset").description("Add a source-copy preset to your project").argument("<name>","preset name: minimal or dashboard").option("-o, --overwrite","overwrite existing files").option("--dry-run","show files without writing").option("--skip-install","do not install package dependencies").action(Mb);_t.command("list").description("List available registry components").action(Pb);_t.command("add").description("Add components to your project").argument("[components...]","components to add").option("-o, --overwrite","overwrite existing files").option("--dry-run","show files without writing").option("--skip-install","do not install package dependencies").action(kb);_t.command("theme").description("Write or update Azamat UI theme CSS in your global CSS file").argument("[cssPath]","global CSS path, default from azamat-ui.json or src/index.css").action(Ib);_t.parse();
452
+ Usage:`),console.log(` ${De("add button input data-table")}`),console.log(` ${De("add form --overwrite")}`);}var qa=Ie(et());async function Ib(t){let e=process.cwd(),r=ne__default.default.join(e,"azamat-ui.json"),i=qa.default.existsSync(r)?await qa.default.readJson(r):{},n=t??i.cssPath??i.globalCssPath??"src/index.css",s=await An({cwd:e,cssPath:n});C.success(`Azamat UI theme CSS yangilandi: ${s}`);}var Ct=Ie(et());var $b={minimal:[{source:"src/lib/utils.ts",target:"{utils}"},{source:"src/components/ui/button.tsx",target:"{ui}/button.tsx"},{source:"src/components/ui/input.tsx",target:"{ui}/input.tsx"},{source:"src/components/ui/card.tsx",target:"{ui}/card.tsx"},{source:"src/components/ui/badge.tsx",target:"{ui}/badge.tsx"}],dashboard:[{source:"src/lib/utils.ts",target:"{utils}"},{source:"src/components/ui/button.tsx",target:"{ui}/button.tsx"},{source:"src/components/ui/input.tsx",target:"{ui}/input.tsx"},{source:"src/components/ui/card.tsx",target:"{ui}/card.tsx"},{source:"src/components/ui/badge.tsx",target:"{ui}/badge.tsx"},{source:"src/components/ui/dropdown-menu.tsx",target:"{ui}/dropdown-menu.tsx"},{source:"src/components/ui/skeleton.tsx",target:"{ui}/skeleton.tsx"},{source:"src/components/ui/tabs.tsx",target:"{ui}/tabs.tsx"},{source:"src/components/feedback/page-state.tsx",target:"{components}/feedback/page-state.tsx"},{source:"src/components/display/property-grid.tsx",target:"{components}/display/property-grid.tsx"},{source:"src/components/display/smart-card.tsx",target:"{components}/display/smart-card.tsx"},{source:"src/components/display/entity-card.tsx",target:"{components}/display/entity-card.tsx"},{source:"src/components/patterns/action-system.tsx",target:"{components}/patterns/action-system.tsx"},{source:"src/components/patterns/status-system.tsx",target:"{components}/patterns/status-system.tsx"},{source:"src/components/patterns/filter-builder.tsx",target:"{components}/patterns/filter-builder.tsx"},{source:"src/components/patterns/data-view.tsx",target:"{components}/patterns/data-view.tsx"},{source:"src/components/patterns/entity-details.tsx",target:"{components}/patterns/entity-details.tsx"},{source:"src/components/patterns/resource-system.tsx",target:"{components}/patterns/resource-system.tsx"},{source:"src/components/patterns/crud-system.tsx",target:"{components}/patterns/crud-system.tsx"},{source:"src/components/form/form-actions.tsx",target:"{components}/form/form-actions.tsx"},{source:"src/components/form/form-section.tsx",target:"{components}/form/form-section.tsx"},{source:"src/components/form/smart-form-shell.tsx",target:"{components}/form/smart-form-shell.tsx"},{source:"src/components/layout/workspace-shell.tsx",target:"{components}/layout/workspace-shell.tsx"}]};function YD(t,e="@"){return e==="@"?t:t.replaceAll("@/",`${e}/`)}function JD(t,e){let r=e.paths?.components??"src/components",i=e.paths?.ui??"src/components/ui",n=e.utilsPath??"src/lib/utils.ts";return t.replaceAll("{components}",r).replaceAll("{ui}",i).replaceAll("{utils}",n)}async function Mb(t,e={}){let r=$b[t];r||(C.error(`Preset topilmadi: ${t}`),process.exit(1));let i=process.cwd(),n=ne__default.default.join(i,"azamat-ui.json");Ct.default.existsSync(n)||(C.error("azamat-ui.json topilmadi. Avval init qiling."),process.exit(1));let s=await Ct.default.readJson(n),o=In((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));for(let a of r){let c=ne__default.default.join(o,a.source),u=ne__default.default.join(i,JD(a.target,s));if(e.dryRun){C.info(`[dry-run] ${a.source} -> ${ne__default.default.relative(i,u)}`);continue}if(Ct.default.existsSync(u)&&!e.overwrite){C.warn(`${ne__default.default.relative(i,u)} allaqachon mavjud.`);continue}await Ct.default.ensureDir(ne__default.default.dirname(u)),await Ct.default.writeFile(u,YD(await Ct.default.readFile(c,"utf8"),s.alias)),C.success(`${ne__default.default.relative(i,u)} qo\u2018shildi.`);}}var _t=new kt;_t.name("azamat-ui-kit").description("Azamat UI Kit source-copy CLI").version("0.3.13");_t.command("init").description("Initialize local Azamat UI source files in your project").option("--template <template>","Project defaults: vite or next","vite").option("--skip-install","Do not install base dependencies").option("-y, --defaults","Use template defaults without interactive prompts").action(Tb);_t.command("preset").description("Add a source-copy preset to your project").argument("<name>","preset name: minimal or dashboard").option("-o, --overwrite","overwrite existing files").option("--dry-run","show files without writing").option("--skip-install","do not install package dependencies").action(Mb);_t.command("list").description("List available registry components").action(Pb);_t.command("add").description("Copy component source files into your project").argument("[components...]","components to add").option("-o, --overwrite","overwrite existing files").option("--dry-run","show files without writing").option("--skip-install","do not install package dependencies").action(kb);_t.command("theme").description("Write or update Azamat UI theme CSS in your global CSS file").argument("[cssPath]","global CSS path, default from azamat-ui.json or src/index.css").action(Ib);_t.parse();