|
@@ -1,10 +1,10 @@
|
1
1
|
|
2
2
|
await(async()=>{let{dirname:e}=await import("path"),{fileURLToPath:i}=await import("url");if(typeof globalThis.__filename>"u"&&(globalThis.__filename=i(import.meta.url)),typeof globalThis.__dirname>"u"&&(globalThis.__dirname=e(globalThis.__filename)),typeof globalThis.require>"u"){let{default:a}=await import("module");globalThis.require=a.createRequire(import.meta.url)}})();
|
3
3
|
|
4
|
-
var an=Object.create;var _e=Object.defineProperty;var ln=Object.getOwnPropertyDescriptor;var yn=Object.getOwnPropertyNames;var mn=Object.getPrototypeOf,dn=Object.prototype.hasOwnProperty;var hn=e=>_e(e,"__esModule",{value:!0});var P=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var Sn=(e,t)=>()=>(e&&(t=e(e=0)),t);var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var wn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of yn(t))!dn.call(e,i)&&(r||i!=="default")&&_e(e,i,{get:()=>t[i],enumerable:!(n=ln(t,i))||n.enumerable});return e},pn=(e,t)=>wn(hn(_e(e!=null?an(mn(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var f=Sn(()=>{});var W=w(Le=>{"use strict";f();Le.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")e.apply(this,t);else return new Promise((r,n)=>{e.call(this,...t,(i,o)=>i!=null?n(i):r(o))})},"name",{value:e.name})};Le.fromPromise=function(e){return Object.defineProperty(function(...t){let r=t[t.length-1];if(typeof r!="function")return e.apply(this,t);e.apply(this,t.slice(0,-1)).then(n=>r(null,n),r)},"name",{value:e.name})}});var be=w((Jo,Ze)=>{f();var K=P("constants"),qn=process.cwd,Se=null,Fn=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Se||(Se=qn.call(process)),Se};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Ie=process.chdir,process.chdir=function(e){Se=null,Ie.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ie));var Ie;Ze.exports=xn;function xn(e){K.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=i(e.chmodSync),e.fchmodSync=i(e.fchmodSync),e.lchmodSync=i(e.lchmodSync),e.stat=c(e.stat),e.fstat=c(e.fstat),e.lstat=c(e.lstat),e.statSync=a(e.statSync),e.fstatSync=a(e.fstatSync),e.lstatSync=a(e.lstatSync),e.lchmod||(e.lchmod=function(s,y,m){m&&process.nextTick(m)},e.lchmodSync=function(){}),e.lchown||(e.lchown=function(s,y,m,l){l&&process.nextTick(l)},e.lchownSync=function(){}),Fn==="win32"&&(e.rename=function(s){return function(y,m,l){var h=Date.now(),q=0;s(y,m,function p(O){if(O&&(O.code==="EACCES"||O.code==="EPERM")&&Date.now()-h<6e4){setTimeout(function(){e.stat(m,function(T,oe){T&&T.code==="ENOENT"?s(y,m,p):l(O)})},q),q<100&&(q+=10);return}l&&l(O)})}}(e.rename)),e.read=function(s){function y(m,l,h,q,p,O){var T;if(O&&typeof O=="function"){var oe=0;T=function(he,Xe,He){if(he&&he.code==="EAGAIN"&&oe<10)return oe++,s.call(e,m,l,h,q,p,T);O.apply(this,arguments)}}return s.call(e,m,l,h,q,p,T)}return Object.setPrototypeOf&&Object.setPrototypeOf(y,s),y}(e.read),e.readSync=function(s){return function(y,m,l,h,q){for(var p=0;;)try{return s.call(e,y,m,l,h,q)}catch(O){if(O.code==="EAGAIN"&&p<10){p++;continue}throw O}}}(e.readSync);function t(s){s.lchmod=function(y,m,l){s.open(y,K.O_WRONLY|K.O_SYMLINK,m,function(h,q){if(h){l&&l(h);return}s.fchmod(q,m,function(p){s.close(q,function(O){l&&l(p||O)})})})},s.lchmodSync=function(y,m){var l=s.openSync(y,K.O_WRONLY|K.O_SYMLINK,m),h=!0,q;try{q=s.fchmodSync(l,m),h=!1}finally{if(h)try{s.closeSync(l)}catch{}else s.closeSync(l)}return q}}function r(s){K.hasOwnProperty("O_SYMLINK")?(s.lutimes=function(y,m,l,h){s.open(y,K.O_SYMLINK,function(q,p){if(q){h&&h(q);return}s.futimes(p,m,l,function(O){s.close(p,function(T){h&&h(O||T)})})})},s.lutimesSync=function(y,m,l){var h=s.openSync(y,K.O_SYMLINK),q,p=!0;try{q=s.futimesSync(h,m,l),p=!1}finally{if(p)try{s.closeSync(h)}catch{}else s.closeSync(h)}return q}):(s.lutimes=function(y,m,l,h){h&&process.nextTick(h)},s.lutimesSync=function(){})}function n(s){return s&&function(y,m,l){return s.call(e,y,m,function(h){k(h)&&(h=null),l&&l.apply(this,arguments)})}}function i(s){return s&&function(y,m){try{return s.call(e,y,m)}catch(l){if(!k(l))throw l}}}function o(s){return s&&function(y,m,l,h){return s.call(e,y,m,l,function(q){k(q)&&(q=null),h&&h.apply(this,arguments)})}}function u(s){return s&&function(y,m,l){try{return s.call(e,y,m,l)}catch(h){if(!k(h))throw h}}}function c(s){return s&&function(y,m,l){typeof m=="function"&&(l=m,m=null);function h(q,p){p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),l&&l.apply(this,arguments)}return m?s.call(e,y,m,h):s.call(e,y,h)}}function a(s){return s&&function(y,m){var l=m?s.call(e,y,m):s.call(e,y);return l&&(l.uid<0&&(l.uid+=4294967296),l.gid<0&&(l.gid+=4294967296)),l}}function k(s){if(!s||s.code==="ENOSYS")return!0;var y=!process.getuid||process.getuid()!==0;return!!(y&&(s.code==="EINVAL"||s.code==="EPERM"))}}});var rt=w((Bo,tt)=>{f();var et=P("stream").Stream;tt.exports=gn;function gn(e){return{ReadStream:t,WriteStream:r};function t(n,i){if(!(this instanceof t))return new t(n,i);et.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var u=Object.keys(i),c=0,a=u.length;c<a;c++){var k=u[c];this[k]=i[k]}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(){o._read()});return}e.open(this.path,this.flags,this.mode,function(s,y){if(s){o.emit("error",s),o.readable=!1;return}o.fd=y,o.emit("open",y),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);et.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),u=0,c=o.length;u<c;u++){var a=o[u];this[a]=i[a]}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=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var it=w((Uo,nt)=>{"use strict";f();nt.exports=On;var Pn=Object.getPrototypeOf||function(e){return e.__proto__};function On(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Pn(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var M=w((Yo,je)=>{f();var g=P("fs"),Dn=be(),Nn=rt(),Tn=it(),we=P("util"),R,Ee;typeof Symbol=="function"&&typeof Symbol.for=="function"?(R=Symbol.for("graceful-fs.queue"),Ee=Symbol.for("graceful-fs.previous")):(R="___graceful-fs.queue",Ee="___graceful-fs.previous");function Cn(){}function ct(e,t){Object.defineProperty(e,R,{get:function(){return t}})}var Z=Cn;we.debuglog?Z=we.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Z=function(){var e=we.format.apply(we,arguments);e="GFS4: "+e.split(/\n/).join(`
|
5
|
-
GFS4: `),console.error(e)});g[R]||(ot=global[R]||[],ct(g,ot),g.close=function(e){function t(r,n){return e.call(g,r,function(i){i||ut(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(t,Ee,{value:e}),t}(g.close),g.closeSync=function(e){function t(r){e.apply(g,arguments),ut()}return Object.defineProperty(t,Ee,{value:e}),t}(g.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Z(g[R]),P("assert").equal(g[R].length,0)}));var ot;global[R]||ct(global,g[R]);je.exports=Re(Tn(g));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!g.__patched&&(je.exports=Re(g),g.__patched=!0);function Re(e){Dn(e),e.gracefulify=Re,e.createReadStream=he,e.createWriteStream=Xe;var t=e.readFile;e.readFile=r;function r(d,v,E){return typeof v=="function"&&(E=v,v=null),_(d,v,E);function _(L,I,D,j){return t(L,I,function(x){x&&(x.code==="EMFILE"||x.code==="ENFILE")?te([_,[L,I,D],x,j||Date.now(),Date.now()]):typeof D=="function"&&D.apply(this,arguments)})}}var n=e.writeFile;e.writeFile=i;function i(d,v,E,_){return typeof E=="function"&&(_=E,E=null),L(d,v,E,_);function L(I,D,j,x,U){return n(I,D,j,function(N){N&&(N.code==="EMFILE"||N.code==="ENFILE")?te([L,[I,D,j,x],N,U||Date.now(),Date.now()]):typeof x=="function"&&x.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=u);function u(d,v,E,_){return typeof E=="function"&&(_=E,E=null),L(d,v,E,_);function L(I,D,j,x,U){return o(I,D,j,function(N){N&&(N.code==="EMFILE"||N.code==="ENFILE")?te([L,[I,D,j,x],N,U||Date.now(),Date.now()]):typeof x=="function"&&x.apply(this,arguments)})}}var c=e.copyFile;c&&(e.copyFile=a);function a(d,v,E,_){return typeof E=="function"&&(_=E,E=0),L(d,v,E,_);function L(I,D,j,x,U){return c(I,D,j,function(N){N&&(N.code==="EMFILE"||N.code==="ENFILE")?te([L,[I,D,j,x],N,U||Date.now(),Date.now()]):typeof x=="function"&&x.apply(this,arguments)})}}var k=e.readdir;e.readdir=s;function s(d,v,E){return typeof v=="function"&&(E=v,v=null),_(d,v,E);function _(L,I,D,j){return k(L,I,function(x,U){x&&(x.code==="EMFILE"||x.code==="ENFILE")?te([_,[L,I,D],x,j||Date.now(),Date.now()]):(U&&U.sort&&U.sort(),typeof D=="function"&&D.call(this,x,U))})}}if(process.version.substr(0,4)==="v0.8"){var y=Nn(e);p=y.ReadStream,T=y.WriteStream}var m=e.ReadStream;m&&(p.prototype=Object.create(m.prototype),p.prototype.open=O);var l=e.WriteStream;l&&(T.prototype=Object.create(l.prototype),T.prototype.open=oe),Object.defineProperty(e,"ReadStream",{get:function(){return p},set:function(d){p=d},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return T},set:function(d){T=d},enumerable:!0,configurable:!0});var h=p;Object.defineProperty(e,"FileReadStream",{get:function(){return h},set:function(d){h=d},enumerable:!0,configurable:!0});var q=T;Object.defineProperty(e,"FileWriteStream",{get:function(){return q},set:function(d){q=d},enumerable:!0,configurable:!0});function p(d,v){return this instanceof p?(m.apply(this,arguments),this):p.apply(Object.create(p.prototype),arguments)}function O(){var d=this;Ce(d.path,d.flags,d.mode,function(v,E){v?(d.autoClose&&d.destroy(),d.emit("error",v)):(d.fd=E,d.emit("open",E),d.read())})}function T(d,v){return this instanceof T?(l.apply(this,arguments),this):T.apply(Object.create(T.prototype),arguments)}function oe(){var d=this;Ce(d.path,d.flags,d.mode,function(v,E){v?(d.destroy(),d.emit("error",v)):(d.fd=E,d.emit("open",E))})}function he(d,v){return new e.ReadStream(d,v)}function Xe(d,v){return new e.WriteStream(d,v)}var He=e.open;e.open=Ce;function Ce(d,v,E,_){return typeof E=="function"&&(_=E,E=null),L(d,v,E,_);function L(I,D,j,x,U){return He(I,D,j,function(N,Lo){N&&(N.code==="EMFILE"||N.code==="ENFILE")?te([L,[I,D,j,x],N,U||Date.now(),Date.now()]):typeof x=="function"&&x.apply(this,arguments)})}}return e}function te(e){Z("ENQUEUE",e[0].name,e[1]),g[R].push(e),$e()}var pe;function ut(){for(var e=Date.now(),t=0;t<g[R].length;++t)g[R][t].length>2&&(g[R][t][3]=e,g[R][t][4]=e);$e()}function $e(){if(clearTimeout(pe),pe=void 0,g[R].length!==0){var e=g[R].shift(),t=e[0],r=e[1],n=e[2],i=e[3],o=e[4];if(i===void 0)Z("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-i>=6e4){Z("TIMEOUT",t.name,r);var u=r.pop();typeof u=="function"&&u.call(null,n)}else{var c=Date.now()-o,a=Math.max(o-i,1),k=Math.min(a*1.2,100);c>=k?(Z("RETRY",t.name,r),t.apply(null,r.concat([i]))):g[R].push(e)}pe===void 0&&(pe=setTimeout($e,0))}}});var b=w(V=>{"use strict";f();var st=W().fromCallback,B=M(),_n=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(e=>typeof B[e]=="function");Object.assign(V,B);_n.forEach(e=>{V[e]=st(B[e])});V.realpath.native=st(B.realpath.native);V.exists=function(e,t){return typeof t=="function"?B.exists(e,t):new Promise(r=>B.exists(e,r))};V.read=function(e,t,r,n,i,o){return typeof o=="function"?B.read(e,t,r,n,i,o):new Promise((u,c)=>{B.read(e,t,r,n,i,(a,k,s)=>{if(a)return c(a);u({bytesRead:k,buffer:s})})})};V.write=function(e,t,...r){return typeof r[r.length-1]=="function"?B.write(e,t,...r):new Promise((n,i)=>{B.write(e,t,...r,(o,u,c)=>{if(o)return i(o);n({bytesWritten:u,buffer:c})})})};typeof B.writev=="function"&&(V.writev=function(e,t,...r){return typeof r[r.length-1]=="function"?B.writev(e,t,...r):new Promise((n,i)=>{B.writev(e,t,...r,(o,u,c)=>{if(o)return i(o);n({bytesWritten:u,buffers:c})})})})});var at=w((Ko,ft)=>{"use strict";f();var Ln=P("path");ft.exports.checkPath=function(t){if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(Ln.parse(t).root,""))){let n=new Error(`Path contains invalid characters: ${t}`);throw n.code="EINVAL",n}}});var dt=w((Vo,Me)=>{"use strict";f();var lt=b(),{checkPath:yt}=at(),mt=e=>{let t={mode:511};return typeof e=="number"?e:{...t,...e}.mode};Me.exports.makeDir=async(e,t)=>(yt(e),lt.mkdir(e,{mode:mt(t),recursive:!0}));Me.exports.makeDirSync=(e,t)=>(yt(e),lt.mkdirSync(e,{mode:mt(t),recursive:!0}))});var Y=w((Qo,ht)=>{"use strict";f();var In=W().fromPromise,{makeDir:Rn,makeDirSync:Ae}=dt(),We=In(Rn);ht.exports={mkdirs:We,mkdirsSync:Ae,mkdirp:We,mkdirpSync:Ae,ensureDir:We,ensureDirSync:Ae}});var Q=w((Xo,wt)=>{"use strict";f();var $n=W().fromPromise,St=b();function jn(e){return St.access(e).then(()=>!0).catch(()=>!1)}wt.exports={pathExists:$n(jn),pathExistsSync:St.existsSync}});var Je=w((Ho,pt)=>{"use strict";f();var re=M();function Mn(e,t,r,n){re.open(e,"r+",(i,o)=>{if(i)return n(i);re.futimes(o,t,r,u=>{re.close(o,c=>{n&&n(u||c)})})})}function An(e,t,r){let n=re.openSync(e,"r+");return re.futimesSync(n,t,r),re.closeSync(n)}pt.exports={utimesMillis:Mn,utimesMillisSync:An}});var ee=w((zo,kt)=>{"use strict";f();var ne=b(),C=P("path"),Wn=P("util");function Jn(e,t,r){let n=r.dereference?i=>ne.stat(i,{bigint:!0}):i=>ne.lstat(i,{bigint:!0});return Promise.all([n(e),n(t).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,o])=>({srcStat:i,destStat:o}))}function Bn(e,t,r){let n,i=r.dereference?u=>ne.statSync(u,{bigint:!0}):u=>ne.lstatSync(u,{bigint:!0}),o=i(e);try{n=i(t)}catch(u){if(u.code==="ENOENT")return{srcStat:o,destStat:null};throw u}return{srcStat:o,destStat:n}}function Un(e,t,r,n,i){Wn.callbackify(Jn)(e,t,n,(o,u)=>{if(o)return i(o);let{srcStat:c,destStat:a}=u;if(a){if(ue(c,a)){let k=C.basename(e),s=C.basename(t);return r==="move"&&k!==s&&k.toLowerCase()===s.toLowerCase()?i(null,{srcStat:c,destStat:a,isChangingCase:!0}):i(new Error("Source and destination must not be the same."))}if(c.isDirectory()&&!a.isDirectory())return i(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!c.isDirectory()&&a.isDirectory())return i(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return c.isDirectory()&&Be(e,t)?i(new Error(ve(e,t,r))):i(null,{srcStat:c,destStat:a})})}function Yn(e,t,r,n){let{srcStat:i,destStat:o}=Bn(e,t,n);if(o){if(ue(i,o)){let u=C.basename(e),c=C.basename(t);if(r==="move"&&u!==c&&u.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(i.isDirectory()&&Be(e,t))throw new Error(ve(e,t,r));return{srcStat:i,destStat:o}}function Et(e,t,r,n,i){let o=C.resolve(C.dirname(e)),u=C.resolve(C.dirname(r));if(u===o||u===C.parse(u).root)return i();ne.stat(u,{bigint:!0},(c,a)=>c?c.code==="ENOENT"?i():i(c):ue(t,a)?i(new Error(ve(e,r,n))):Et(e,t,u,n,i))}function vt(e,t,r,n){let i=C.resolve(C.dirname(e)),o=C.resolve(C.dirname(r));if(o===i||o===C.parse(o).root)return;let u;try{u=ne.statSync(o,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(ue(t,u))throw new Error(ve(e,r,n));return vt(e,t,o,n)}function ue(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Be(e,t){let r=C.resolve(e).split(C.sep).filter(i=>i),n=C.resolve(t).split(C.sep).filter(i=>i);return r.reduce((i,o,u)=>i&&n[u]===o,!0)}function ve(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}kt.exports={checkPaths:Un,checkPathsSync:Yn,checkParentPaths:Et,checkParentPathsSync:vt,isSrcSubdir:Be,areIdentical:ue}});var Nt=w((Zo,Dt)=>{"use strict";f();var J=M(),ce=P("path"),Gn=Y().mkdirs,Kn=Q().pathExists,Vn=Je().utimesMillis,se=ee();function Qn(e,t,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
6
|
-
|
7
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`),se.checkPaths(e,t,"copy",r,(i,o)=>{if(i)return n(i);let{srcStat:u,destStat:c}=o;se.checkParentPaths(e,u,t,"copy",a=>a?n(a):r.filter?xt(qt,c,e,t,r,n):qt(c,e,t,r,n))})}function qt(e,t,r,n,i){let o=ce.dirname(r);Kn(o,(u,c)=>{if(u)return i(u);if(c)return ke(e,t,r,n,i);Gn(o,a=>a?i(a):ke(e,t,r,n,i))})}function xt(e,t,r,n,i,o){Promise.resolve(i.filter(r,n)).then(u=>u?e(t,r,n,i,o):o(),u=>o(u))}function Xn(e,t,r,n,i){return n.filter?xt(ke,e,t,r,n,i):ke(e,t,r,n,i)}function ke(e,t,r,n,i){(n.dereference?J.stat:J.lstat)(t,(u,c)=>u?i(u):c.isDirectory()?ri(c,e,t,r,n,i):c.isFile()||c.isCharacterDevice()||c.isBlockDevice()?Hn(c,e,t,r,n,i):c.isSymbolicLink()?oi(e,t,r,n,i):c.isSocket()?i(new Error(`Cannot copy a socket file: ${t}`)):c.isFIFO()?i(new Error(`Cannot copy a FIFO pipe: ${t}`)):i(new Error(`Unknown file: ${t}`)))}function Hn(e,t,r,n,i,o){return t?zn(e,r,n,i,o):gt(e,r,n,i,o)}function zn(e,t,r,n,i){if(n.overwrite)J.unlink(r,o=>o?i(o):gt(e,t,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function gt(e,t,r,n,i){J.copyFile(t,r,o=>o?i(o):n.preserveTimestamps?Zn(e.mode,t,r,i):qe(r,e.mode,i))}function Zn(e,t,r,n){return bn(e)?ei(r,e,i=>i?n(i):Ft(e,t,r,n)):Ft(e,t,r,n)}function bn(e){return(e&128)===0}function ei(e,t,r){return qe(e,t|128,r)}function Ft(e,t,r,n){ti(t,r,i=>i?n(i):qe(r,e,n))}function qe(e,t,r){return J.chmod(e,t,r)}function ti(e,t,r){J.stat(e,(n,i)=>n?r(n):Vn(t,i.atime,i.mtime,r))}function ri(e,t,r,n,i,o){return t?Pt(r,n,i,o):ni(e.mode,r,n,i,o)}function ni(e,t,r,n,i){J.mkdir(r,o=>{if(o)return i(o);Pt(t,r,n,u=>u?i(u):qe(r,e,i))})}function Pt(e,t,r,n){J.readdir(e,(i,o)=>i?n(i):Ot(o,e,t,r,n))}function Ot(e,t,r,n,i){let o=e.pop();return o?ii(e,o,t,r,n,i):i()}function ii(e,t,r,n,i,o){let u=ce.join(r,t),c=ce.join(n,t);se.checkPaths(u,c,"copy",i,(a,k)=>{if(a)return o(a);let{destStat:s}=k;Xn(s,u,c,i,y=>y?o(y):Ot(e,r,n,i,o))})}function oi(e,t,r,n,i){J.readlink(t,(o,u)=>{if(o)return i(o);if(n.dereference&&(u=ce.resolve(process.cwd(),u)),e)J.readlink(r,(c,a)=>c?c.code==="EINVAL"||c.code==="UNKNOWN"?J.symlink(u,r,i):i(c):(n.dereference&&(a=ce.resolve(process.cwd(),a)),se.isSrcSubdir(u,a)?i(new Error(`Cannot copy '${u}' to a subdirectory of itself, '${a}'.`)):e.isDirectory()&&se.isSrcSubdir(a,u)?i(new Error(`Cannot overwrite '${a}' with '${u}'.`)):ui(u,r,i)));else return J.symlink(u,r,i)})}function ui(e,t,r){J.unlink(t,n=>n?r(n):J.symlink(e,t,r))}Dt.exports=Qn});var It=w((bo,Lt)=>{"use strict";f();var $=M(),fe=P("path"),ci=Y().mkdirsSync,si=Je().utimesMillisSync,ae=ee();function fi(e,t,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
8
|
-
|
9
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=ae.checkPathsSync(e,t,"copy",r);return ae.checkParentPathsSync(e,n,t,"copy"),ai(i,e,t,r)}function ai(e,t,r,n){if(n.filter&&!n.filter(t,r))return;let i=fe.dirname(r);return $.existsSync(i)||ci(i),Tt(e,t,r,n)}function li(e,t,r,n){if(!(n.filter&&!n.filter(t,r)))return Tt(e,t,r,n)}function Tt(e,t,r,n){let o=(n.dereference?$.statSync:$.lstatSync)(t);if(o.isDirectory())return pi(o,e,t,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return yi(o,e,t,r,n);if(o.isSymbolicLink())return ki(e,t,r,n);throw o.isSocket()?new Error(`Cannot copy a socket file: ${t}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}function yi(e,t,r,n,i){return t?mi(e,r,n,i):Ct(e,r,n,i)}function mi(e,t,r,n){if(n.overwrite)return $.unlinkSync(r),Ct(e,t,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function Ct(e,t,r,n){return $.copyFileSync(t,r),n.preserveTimestamps&&di(e.mode,t,r),Ue(r,e.mode)}function di(e,t,r){return hi(e)&&Si(r,e),wi(t,r)}function hi(e){return(e&128)===0}function Si(e,t){return Ue(e,t|128)}function Ue(e,t){return $.chmodSync(e,t)}function wi(e,t){let r=$.statSync(e);return si(t,r.atime,r.mtime)}function pi(e,t,r,n,i){return t?_t(r,n,i):Ei(e.mode,r,n,i)}function Ei(e,t,r,n){return $.mkdirSync(r),_t(t,r,n),Ue(r,e)}function _t(e,t,r){$.readdirSync(e).forEach(n=>vi(n,e,t,r))}function vi(e,t,r,n){let i=fe.join(t,e),o=fe.join(r,e),{destStat:u}=ae.checkPathsSync(i,o,"copy",n);return li(u,i,o,n)}function ki(e,t,r,n){let i=$.readlinkSync(t);if(n.dereference&&(i=fe.resolve(process.cwd(),i)),e){let o;try{o=$.readlinkSync(r)}catch(u){if(u.code==="EINVAL"||u.code==="UNKNOWN")return $.symlinkSync(i,r);throw u}if(n.dereference&&(o=fe.resolve(process.cwd(),o)),ae.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if($.statSync(r).isDirectory()&&ae.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return qi(i,r)}else return $.symlinkSync(i,r)}function qi(e,t){return $.unlinkSync(t),$.symlinkSync(e,t)}Lt.exports=fi});var Fe=w((eu,Rt)=>{"use strict";f();var Fi=W().fromCallback;Rt.exports={copy:Fi(Nt()),copySync:It()}});var Yt=w((tu,Ut)=>{"use strict";f();var $t=M(),Wt=P("path"),F=P("assert"),le=process.platform==="win32";function Jt(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{e[r]=e[r]||$t[r],r=r+"Sync",e[r]=e[r]||$t[r]}),e.maxBusyTries=e.maxBusyTries||3}function Ye(e,t,r){let n=0;typeof t=="function"&&(r=t,t={}),F(e,"rimraf: missing path"),F.strictEqual(typeof e,"string","rimraf: path should be a string"),F.strictEqual(typeof r,"function","rimraf: callback function required"),F(t,"rimraf: invalid options argument provided"),F.strictEqual(typeof t,"object","rimraf: options should be object"),Jt(t),jt(e,t,function i(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&n<t.maxBusyTries){n++;let u=n*100;return setTimeout(()=>jt(e,t,i),u)}o.code==="ENOENT"&&(o=null)}r(o)})}function jt(e,t,r){F(e),F(t),F(typeof r=="function"),t.lstat(e,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&le)return Mt(e,t,n,r);if(i&&i.isDirectory())return xe(e,t,n,r);t.unlink(e,o=>{if(o){if(o.code==="ENOENT")return r(null);if(o.code==="EPERM")return le?Mt(e,t,o,r):xe(e,t,o,r);if(o.code==="EISDIR")return xe(e,t,o,r)}return r(o)})})}function Mt(e,t,r,n){F(e),F(t),F(typeof n=="function"),t.chmod(e,438,i=>{i?n(i.code==="ENOENT"?null:r):t.stat(e,(o,u)=>{o?n(o.code==="ENOENT"?null:r):u.isDirectory()?xe(e,t,r,n):t.unlink(e,n)})})}function At(e,t,r){let n;F(e),F(t);try{t.chmodSync(e,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=t.statSync(e)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?ge(e,t,r):t.unlinkSync(e)}function xe(e,t,r,n){F(e),F(t),F(typeof n=="function"),t.rmdir(e,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?xi(e,t,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function xi(e,t,r){F(e),F(t),F(typeof r=="function"),t.readdir(e,(n,i)=>{if(n)return r(n);let o=i.length,u;if(o===0)return t.rmdir(e,r);i.forEach(c=>{Ye(Wt.join(e,c),t,a=>{if(!u){if(a)return r(u=a);--o===0&&t.rmdir(e,r)}})})})}function Bt(e,t){let r;t=t||{},Jt(t),F(e,"rimraf: missing path"),F.strictEqual(typeof e,"string","rimraf: path should be a string"),F(t,"rimraf: missing options"),F.strictEqual(typeof t,"object","rimraf: options should be object");try{r=t.lstatSync(e)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&le&&At(e,t,n)}try{r&&r.isDirectory()?ge(e,t,null):t.unlinkSync(e)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return le?At(e,t,n):ge(e,t,n);if(n.code!=="EISDIR")throw n;ge(e,t,n)}}function ge(e,t,r){F(e),F(t);try{t.rmdirSync(e)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")gi(e,t);else if(n.code!=="ENOENT")throw n}}function gi(e,t){if(F(e),F(t),t.readdirSync(e).forEach(r=>Bt(Wt.join(e,r),t)),le){let r=Date.now();do try{return t.rmdirSync(e,t)}catch{}while(Date.now()-r<500)}else return t.rmdirSync(e,t)}Ut.exports=Ye;Ye.sync=Bt});var ye=w((ru,Kt)=>{"use strict";f();var Pe=M(),Pi=W().fromCallback,Gt=Yt();function Oi(e,t){if(Pe.rm)return Pe.rm(e,{recursive:!0,force:!0},t);Gt(e,t)}function Di(e){if(Pe.rmSync)return Pe.rmSync(e,{recursive:!0,force:!0});Gt.sync(e)}Kt.exports={remove:Pi(Oi),removeSync:Di}});var er=w((nu,bt)=>{"use strict";f();var Ni=W().fromPromise,Xt=b(),Ht=P("path"),zt=Y(),Zt=ye(),Vt=Ni(async function(t){let r;try{r=await Xt.readdir(t)}catch{return zt.mkdirs(t)}return Promise.all(r.map(n=>Zt.remove(Ht.join(t,n))))});function Qt(e){let t;try{t=Xt.readdirSync(e)}catch{return zt.mkdirsSync(e)}t.forEach(r=>{r=Ht.join(e,r),Zt.removeSync(r)})}bt.exports={emptyDirSync:Qt,emptydirSync:Qt,emptyDir:Vt,emptydir:Vt}});var ir=w((iu,nr)=>{"use strict";f();var Ti=W().fromCallback,tr=P("path"),X=M(),rr=Y();function Ci(e,t){function r(){X.writeFile(e,"",n=>{if(n)return t(n);t()})}X.stat(e,(n,i)=>{if(!n&&i.isFile())return t();let o=tr.dirname(e);X.stat(o,(u,c)=>{if(u)return u.code==="ENOENT"?rr.mkdirs(o,a=>{if(a)return t(a);r()}):t(u);c.isDirectory()?r():X.readdir(o,a=>{if(a)return t(a)})})})}function _i(e){let t;try{t=X.statSync(e)}catch{}if(t&&t.isFile())return;let r=tr.dirname(e);try{X.statSync(r).isDirectory()||X.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")rr.mkdirsSync(r);else throw n}X.writeFileSync(e,"")}nr.exports={createFile:Ti(Ci),createFileSync:_i}});var fr=w((ou,sr)=>{"use strict";f();var Li=W().fromCallback,or=P("path"),H=M(),ur=Y(),Ii=Q().pathExists,{areIdentical:cr}=ee();function Ri(e,t,r){function n(i,o){H.link(i,o,u=>{if(u)return r(u);r(null)})}H.lstat(t,(i,o)=>{H.lstat(e,(u,c)=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),r(u);if(o&&cr(c,o))return r(null);let a=or.dirname(t);Ii(a,(k,s)=>{if(k)return r(k);if(s)return n(e,t);ur.mkdirs(a,y=>{if(y)return r(y);n(e,t)})})})})}function $i(e,t){let r;try{r=H.lstatSync(t)}catch{}try{let o=H.lstatSync(e);if(r&&cr(o,r))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=or.dirname(t);return H.existsSync(n)||ur.mkdirsSync(n),H.linkSync(e,t)}sr.exports={createLink:Li(Ri),createLinkSync:$i}});var lr=w((uu,ar)=>{"use strict";f();var z=P("path"),me=M(),ji=Q().pathExists;function Mi(e,t,r){if(z.isAbsolute(e))return me.lstat(e,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:e,toDst:e}));{let n=z.dirname(t),i=z.join(n,e);return ji(i,(o,u)=>o?r(o):u?r(null,{toCwd:i,toDst:e}):me.lstat(e,c=>c?(c.message=c.message.replace("lstat","ensureSymlink"),r(c)):r(null,{toCwd:e,toDst:z.relative(n,e)})))}}function Ai(e,t){let r;if(z.isAbsolute(e)){if(r=me.existsSync(e),!r)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}else{let n=z.dirname(t),i=z.join(n,e);if(r=me.existsSync(i),r)return{toCwd:i,toDst:e};if(r=me.existsSync(e),!r)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:z.relative(n,e)}}}ar.exports={symlinkPaths:Mi,symlinkPathsSync:Ai}});var dr=w((cu,mr)=>{"use strict";f();var yr=M();function Wi(e,t,r){if(r=typeof t=="function"?t:r,t=typeof t=="function"?!1:t,t)return r(null,t);yr.lstat(e,(n,i)=>{if(n)return r(null,"file");t=i&&i.isDirectory()?"dir":"file",r(null,t)})}function Ji(e,t){let r;if(t)return t;try{r=yr.lstatSync(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}mr.exports={symlinkType:Wi,symlinkTypeSync:Ji}});var qr=w((su,kr)=>{"use strict";f();var Bi=W().fromCallback,Sr=P("path"),G=b(),wr=Y(),Ui=wr.mkdirs,Yi=wr.mkdirsSync,pr=lr(),Gi=pr.symlinkPaths,Ki=pr.symlinkPathsSync,Er=dr(),Vi=Er.symlinkType,Qi=Er.symlinkTypeSync,Xi=Q().pathExists,{areIdentical:vr}=ee();function Hi(e,t,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,G.lstat(t,(i,o)=>{!i&&o.isSymbolicLink()?Promise.all([G.stat(e),G.stat(t)]).then(([u,c])=>{if(vr(u,c))return n(null);hr(e,t,r,n)}):hr(e,t,r,n)})}function hr(e,t,r,n){Gi(e,t,(i,o)=>{if(i)return n(i);e=o.toDst,Vi(o.toCwd,r,(u,c)=>{if(u)return n(u);let a=Sr.dirname(t);Xi(a,(k,s)=>{if(k)return n(k);if(s)return G.symlink(e,t,c,n);Ui(a,y=>{if(y)return n(y);G.symlink(e,t,c,n)})})})})}function zi(e,t,r){let n;try{n=G.lstatSync(t)}catch{}if(n&&n.isSymbolicLink()){let c=G.statSync(e),a=G.statSync(t);if(vr(c,a))return}let i=Ki(e,t);e=i.toDst,r=Qi(i.toCwd,r);let o=Sr.dirname(t);return G.existsSync(o)||Yi(o),G.symlinkSync(e,t,r)}kr.exports={createSymlink:Bi(Hi),createSymlinkSync:zi}});var Tr=w((fu,Nr)=>{"use strict";f();var{createFile:Fr,createFileSync:xr}=ir(),{createLink:gr,createLinkSync:Pr}=fr(),{createSymlink:Or,createSymlinkSync:Dr}=qr();Nr.exports={createFile:Fr,createFileSync:xr,ensureFile:Fr,ensureFileSync:xr,createLink:gr,createLinkSync:Pr,ensureLink:gr,ensureLinkSync:Pr,createSymlink:Or,createSymlinkSync:Dr,ensureSymlink:Or,ensureSymlinkSync:Dr}});var Oe=w((au,Cr)=>{f();function Zi(e,{EOL:t=`
|
10
|
-
`,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?t:"";return JSON.stringify(e,n,i).replace(/\n/g,t)+o}function bi(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}Cr.exports={stringify:Zi,stripBom:bi}});var Rr=w((lu,Ir)=>{f();var ie;try{ie=M()}catch{ie=P("fs")}var De=W(),{stringify:_r,stripBom:Lr}=Oe();async function eo(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||ie,n="throws"in t?t.throws:!0,i=await De.fromCallback(r.readFile)(e,t);i=Lr(i);let o;try{o=JSON.parse(i,t?t.reviver:null)}catch(u){if(n)throw u.message=`${e}: ${u.message}`,u;return null}return o}var to=De.fromPromise(eo);function ro(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||ie,n="throws"in t?t.throws:!0;try{let i=r.readFileSync(e,t);return i=Lr(i),JSON.parse(i,t.reviver)}catch(i){if(n)throw i.message=`${e}: ${i.message}`,i;return null}}async function no(e,t,r={}){let n=r.fs||ie,i=_r(t,r);await De.fromCallback(n.writeFile)(e,i,r)}var io=De.fromPromise(no);function oo(e,t,r={}){let n=r.fs||ie,i=_r(t,r);return n.writeFileSync(e,i,r)}var uo={readFile:to,readFileSync:ro,writeFile:io,writeFileSync:oo};Ir.exports=uo});var jr=w((yu,$r)=>{"use strict";f();var Ne=Rr();$r.exports={readJson:Ne.readFile,readJsonSync:Ne.readFileSync,writeJson:Ne.writeFile,writeJsonSync:Ne.writeFileSync}});var Te=w((mu,Wr)=>{"use strict";f();var co=W().fromCallback,de=M(),Mr=P("path"),Ar=Y(),so=Q().pathExists;function fo(e,t,r,n){typeof r=="function"&&(n=r,r="utf8");let i=Mr.dirname(e);so(i,(o,u)=>{if(o)return n(o);if(u)return de.writeFile(e,t,r,n);Ar.mkdirs(i,c=>{if(c)return n(c);de.writeFile(e,t,r,n)})})}function ao(e,...t){let r=Mr.dirname(e);if(de.existsSync(r))return de.writeFileSync(e,...t);Ar.mkdirsSync(r),de.writeFileSync(e,...t)}Wr.exports={outputFile:co(fo),outputFileSync:ao}});var Br=w((du,Jr)=>{"use strict";f();var{stringify:lo}=Oe(),{outputFile:yo}=Te();async function mo(e,t,r={}){let n=lo(t,r);await yo(e,n,r)}Jr.exports=mo});var Yr=w((hu,Ur)=>{"use strict";f();var{stringify:ho}=Oe(),{outputFileSync:So}=Te();function wo(e,t,r){let n=ho(t,r);So(e,n,r)}Ur.exports=wo});var Kr=w((Su,Gr)=>{"use strict";f();var po=W().fromPromise,A=jr();A.outputJson=po(Br());A.outputJsonSync=Yr();A.outputJSON=A.outputJson;A.outputJSONSync=A.outputJsonSync;A.writeJSON=A.writeJson;A.writeJSONSync=A.writeJsonSync;A.readJSON=A.readJson;A.readJSONSync=A.readJsonSync;Gr.exports=A});var zr=w((wu,Hr)=>{"use strict";f();var Eo=M(),Ke=P("path"),vo=Fe().copy,Xr=ye().remove,ko=Y().mkdirp,qo=Q().pathExists,Vr=ee();function Fo(e,t,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;Vr.checkPaths(e,t,"move",r,(o,u)=>{if(o)return n(o);let{srcStat:c,isChangingCase:a=!1}=u;Vr.checkParentPaths(e,c,t,"move",k=>{if(k)return n(k);if(xo(t))return Qr(e,t,i,a,n);ko(Ke.dirname(t),s=>s?n(s):Qr(e,t,i,a,n))})})}function xo(e){let t=Ke.dirname(e);return Ke.parse(t).root===t}function Qr(e,t,r,n,i){if(n)return Ge(e,t,r,i);if(r)return Xr(t,o=>o?i(o):Ge(e,t,r,i));qo(t,(o,u)=>o?i(o):u?i(new Error("dest already exists.")):Ge(e,t,r,i))}function Ge(e,t,r,n){Eo.rename(e,t,i=>i?i.code!=="EXDEV"?n(i):go(e,t,r,n):n())}function go(e,t,r,n){vo(e,t,{overwrite:r,errorOnExist:!0},o=>o?n(o):Xr(e,n))}Hr.exports=Fo});var rn=w((pu,tn)=>{"use strict";f();var br=M(),Qe=P("path"),Po=Fe().copySync,en=ye().removeSync,Oo=Y().mkdirpSync,Zr=ee();function Do(e,t,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:o=!1}=Zr.checkPathsSync(e,t,"move",r);return Zr.checkParentPathsSync(e,i,t,"move"),No(t)||Oo(Qe.dirname(t)),To(e,t,n,o)}function No(e){let t=Qe.dirname(e);return Qe.parse(t).root===t}function To(e,t,r,n){if(n)return Ve(e,t,r);if(r)return en(t),Ve(e,t,r);if(br.existsSync(t))throw new Error("dest already exists.");return Ve(e,t,r)}function Ve(e,t,r){try{br.renameSync(e,t)}catch(n){if(n.code!=="EXDEV")throw n;return Co(e,t,r)}}function Co(e,t,r){return Po(e,t,{overwrite:r,errorOnExist:!0}),en(e)}tn.exports=Do});var on=w((Eu,nn)=>{"use strict";f();var _o=W().fromCallback;nn.exports={move:_o(zr()),moveSync:rn()}});var cn=w((vu,un)=>{"use strict";f();un.exports={...b(),...Fe(),...er(),...Tr(),...Kr(),...Y(),...on(),...Te(),...Q(),...ye()}});f();f();import{dirname as En,resolve as vn}from"path";import{fileURLToPath as kn}from"url";var ze=vn(En(kn(import.meta.url)),"..");var fn=pn(cn(),1);import{resolve as sn}from"path";var Fu=async(e,t)=>{let r=sn(ze,`./templates/${e}`),n=sn(t);await(0,fn.copy)(r,n,{overwrite:!0,recursive:!0})};export{Fu as copyTemplate};
|
4
|
+
import{dirname as Y,resolve as F}from"path";import{fileURLToPath as U}from"url";var M=F(Y(U(import.meta.url)),"..");import{spawn as D,execSync as V}from"child_process";import E from"node:process";import K from"node:os";import P from"node:tty";await(async()=>{let{dirname:r}=await import("path"),{fileURLToPath:e}=await import("url");if(typeof globalThis.__filename>"u"&&(globalThis.__filename=e(import.meta.url)),typeof globalThis.__dirname>"u"&&(globalThis.__dirname=r(globalThis.__filename)),typeof globalThis.require>"u"){let{default:t}=await import("module");globalThis.require=t.createRequire(import.meta.url)}})();var _=(r=0)=>e=>`\x1B[${e+r}m`,I=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,j=(r=0)=>(e,t,o)=>`\x1B[${38+r};2;${e};${t};${o}m`;function W(){let r=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,o]of Object.entries(e)){for(let[l,i]of Object.entries(o))e[l]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},o[l]=e[l],r.set(i[0],i[1]);Object.defineProperty(e,t,{value:o,enumerable:!1})}return Object.defineProperty(e,"codes",{value:r,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=_(),e.color.ansi256=I(),e.color.ansi16m=j(),e.bgColor.ansi=_(10),e.bgColor.ansi256=I(10),e.bgColor.ansi16m=j(10),Object.defineProperties(e,{rgbToAnsi256:{value:(t,o,l)=>t===o&&o===l?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(l/255*5),enumerable:!1},hexToRgb:{value:t=>{let o=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!o)return[0,0,0];let{colorString:l}=o.groups;l.length===3&&(l=[...l].map(n=>n+n).join(""));let i=Number.parseInt(l,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>e.rgbToAnsi256(...e.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let o,l,i;if(t>=232)o=((t-232)*10+8)/255,l=o,i=o;else{t-=16;let u=t%36;o=Math.floor(t/36)/5,l=Math.floor(u/6)/5,i=u%6/5}let n=Math.max(o,l,i)*2;if(n===0)return 30;let a=30+(Math.round(i)<<2|Math.round(l)<<1|Math.round(o));return n===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,o,l)=>e.ansi256ToAnsi(e.rgbToAnsi256(t,o,l)),enumerable:!1},hexToAnsi:{value:t=>e.ansi256ToAnsi(e.hexToAnsi256(t)),enumerable:!1}}),e}var J=W(),m=J;function c(r,e=E.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",o=e.indexOf(t+r),l=e.indexOf("--");return o!==-1&&(l===-1||o<l)}var{env:s}=E,R;c("no-color")||c("no-colors")||c("color=false")||c("color=never")?R=0:(c("color")||c("colors")||c("color=true")||c("color=always"))&&(R=1);function q(){if("FORCE_COLOR"in s)return s.FORCE_COLOR==="true"?1:s.FORCE_COLOR==="false"?0:s.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(s.FORCE_COLOR,10),3)}function H(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Q(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let o=q();o!==void 0&&(R=o);let l=t?R:o;if(l===0)return 0;if(t){if(c("color=16m")||c("color=full")||c("color=truecolor"))return 3;if(c("color=256"))return 2}if(r&&!e&&l===void 0)return 0;let i=l||0;if(s.TERM==="dumb")return i;if(E.platform==="win32"){let n=K.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(n=>n in s)||s.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if("TF_BUILD"in s&&"AGENT_NAME"in s)return 1;if(s.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in s){let n=Number.parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:i}function k(r,e={}){let t=Q(r,{streamIsTTY:r&&r.isTTY,...e});return H(t)}var z={stdout:k({isTTY:P.isatty(1)}),stderr:k({isTTY:P.isatty(2)})},X=z;function Z(r,e,t){let o=r.indexOf(e);if(o===-1)return r;let l=e.length,i=0,n="";do n+=r.substr(i,o-i)+e+t,i=o+l,o=r.indexOf(e,i);while(o!==-1);return n+=r.slice(i),n}function ee(r,e,t,o){let l=0,i="";do{let n=r[o-1]==="\r";i+=r.substr(l,(n?o-1:o)-l)+e+(n?`\r
|
5
|
+
`:`
|
6
|
+
`)+t,l=o+1,o=r.indexOf(`
|
7
|
+
`,l)}while(o!==-1);return i+=r.slice(l),i}var{stdout:$,stderr:S}=X,x=Symbol("GENERATOR"),b=Symbol("STYLER"),v=Symbol("IS_EMPTY"),N=["ansi","ansi","ansi256","ansi16m"],T=Object.create(null),re=(r,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=$?$.level:0;r.level=e.level===void 0?t:e.level},te=r=>{let e=(...t)=>t.join(" ");return re(e,r),Object.setPrototypeOf(e,O.prototype),e};function O(r){return te(r)}Object.setPrototypeOf(O.prototype,Function.prototype);for(let[r,e]of Object.entries(m))T[r]={get(){let t=y(this,B(e.open,e.close,this[b]),this[v]);return Object.defineProperty(this,r,{value:t}),t}};T.visible={get(){let r=y(this,this[b],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var w=(r,e,t,...o)=>r==="rgb"?e==="ansi16m"?m[t].ansi16m(...o):e==="ansi256"?m[t].ansi256(m.rgbToAnsi256(...o)):m[t].ansi(m.rgbToAnsi(...o)):r==="hex"?w("rgb",e,t,...m.hexToRgb(...o)):m[t][r](...o),oe=["rgb","hex","ansi256"];for(let r of oe){T[r]={get(){let{level:t}=this;return function(...o){let l=B(w(r,N[t],"color",...o),m.color.close,this[b]);return y(this,l,this[v])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);T[e]={get(){let{level:t}=this;return function(...o){let l=B(w(r,N[t],"bgColor",...o),m.bgColor.close,this[b]);return y(this,l,this[v])}}}}var le=Object.defineProperties(()=>{},{...T,level:{enumerable:!0,get(){return this[x].level},set(r){this[x].level=r}}}),B=(r,e,t)=>{let o,l;return t===void 0?(o=r,l=e):(o=t.openAll+r,l=e+t.closeAll),{open:r,close:e,openAll:o,closeAll:l,parent:t}},y=(r,e,t)=>{let o=(...l)=>ie(o,l.length===1?""+l[0]:l.join(" "));return Object.setPrototypeOf(o,le),o[x]=r,o[b]=e,o[v]=t,o},ie=(r,e)=>{if(r.level<=0||!e)return r[v]?"":e;let t=r[b];if(t===void 0)return e;let{openAll:o,closeAll:l}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=Z(e,t.close,t.open),t=t.parent;let i=e.indexOf(`
|
8
|
+
`);return i!==-1&&(e=ee(e,l,o,i)),o+e+l};Object.defineProperties(O.prototype,T);var ne=O(),ye=O({level:S?S.level:0}),se=ne,ae={win32:r=>({cmd:"cmd.exe",args:["/d","/s","/c",r]})},ce={"cp -rf":{win32:r=>{let e="xcopy /E /S /G /Q /Y",t=r.map(o=>o.endsWith("\\")?o:`${o}\\`).map(o=>o.replace(/\*\\$/,""));return`${e} ${t.join(" ")}`}},ln:{win32:r=>`mklink /D ${r.join(" ")}`},pkill:{win32:r=>`taskkill /T /F /pid ${r.join(" ")}`}},ue=(r,e,t)=>{let o={...ae,...e},l={...ce,...t},i=a=>{let u=process.platform,p=o[u];if(p)return p(a);let[g,...h]=a.split(" ");return{cmd:g,args:h}},n=(a=>{let u=Object.entries(l);for(let[p,g]of u)if(a.startsWith(p)){let h=process.platform,d=g[h];if(!d)break;let f=a.slice(p.length).trim().split(" ");return d(f)}return a})(r);return i(n)},pe=process.platform==="linux"||process.platform==="darwin",C=process.platform==="win32",me={stdio:"pipe",shell:!0,detached:!C,env:process.env},fe={log:!0,commandTranslations:{},shellTranslations:{},...me},L=({log:r=!0,commandTranslations:e={},shellTranslations:t={},...o}=fe)=>{let l=null;return{childProcess:l,async run(i){if(l)throw new Error("Only one command per shell.");if(typeof i=="object"){let u=process.platform;i.posix&&pe&&(u="posix");let p=i[u];if(!p)throw new Error("No command found for platform: "+JSON.stringify({platform:process.platform,command:i}));i=p}let{cmd:n,args:a}=ue(i,t,e);return r&&console.log(se.dim(`
|
9
|
+
$ ${n} ${a.join(" ")}
|
10
|
+
`)),await new Promise((u,p)=>{l=D(n,a,o);let g="",h="";if(!l)throw new Error("Child process was not set.");let d=f=>{l=null;let A={code:f,stdout:g,stderr:h};f===0||f===1&&!C?u(A):p(A)};l.stdout?.on("data",f=>{g+=f.toString()}),l.stderr?.on("data",f=>{h+=f.toString()}),l.on("close",d),l.on("exit",d),l.on("error",d),l.stdout?.pipe(process.stdout),l.stderr?.pipe(process.stderr)})},kill(i="SIGKILL"){if(l?.pid)if(C)V(`taskkill /t /f /pid ${l.pid}`);else return process.kill(-l.pid,i);return!0}}};import{mkdir as ge}from"fs/promises";import{resolve as G}from"path";var Ae=async(r,e)=>{let t=L(),o=G(M,`./templates/${r}`,"*"),l=G(e);await ge(l,{recursive:!0}),await t.run(`cp -rf ${o} ${l}`)};export{Ae as copyTemplate};
|