cmake-ts
Version:
cmake-js rewrite in typescript to support advanced build configurations
7 lines (5 loc) • 291 kB
JavaScript
import ce,{join as fe,sep as kf,normalize as Bf,delimiter as jf,resolve as Fe,basename as to,dirname as Hf,extname as Uf,relative as Jl}from"path";import me,{existsSync as er}from"fs";import Gf from"constants";import qe from"stream";import Vt from"util";import ut from"assert";import ct,{tmpdir as Wf}from"os";import*as Ql from"child_process";import{execSync as ef}from"child_process";import Ve from"events";import Vf from"url";import zf from"http";import Yf from"https";import tf from"string_decoder";import Kf from"buffer";import rf from"zlib";import Xf from"process";import nf from"crypto";import{createRequire as Zf}from"module";var $e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jf(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var s=function c(){return this instanceof c?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(c){var a=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(s,c,a.get?a:{enumerable:!0,get:function(){return e[c]}})}),s}var tr={},lt={},ro;function Se(){return ro||(ro=1,lt.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")e.apply(this,t);else return new Promise((s,c)=>{t.push((a,n)=>a!=null?c(a):s(n)),e.apply(this,t)})},"name",{value:e.name})},lt.fromPromise=function(e){return Object.defineProperty(function(...t){const s=t[t.length-1];if(typeof s!="function")return e.apply(this,t);t.pop(),e.apply(this,t).then(c=>s(null,c),s)},"name",{value:e.name})}),lt}var rr,no;function Qf(){if(no)return rr;no=1;var e=Gf,t=process.cwd,s=null,c=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return s||(s=t.call(process)),s};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var a=process.chdir;process.chdir=function(r){s=null,a.call(process,r)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,a)}rr=n;function n(r){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&i(r),r.lutimes||o(r),r.chown=m(r.chown),r.fchown=m(r.fchown),r.lchown=m(r.lchown),r.chmod=u(r.chmod),r.fchmod=u(r.fchmod),r.lchmod=u(r.lchmod),r.chownSync=h(r.chownSync),r.fchownSync=h(r.fchownSync),r.lchownSync=h(r.lchownSync),r.chmodSync=l(r.chmodSync),r.fchmodSync=l(r.fchmodSync),r.lchmodSync=l(r.lchmodSync),r.stat=E(r.stat),r.fstat=E(r.fstat),r.lstat=E(r.lstat),r.statSync=R(r.statSync),r.fstatSync=R(r.fstatSync),r.lstatSync=R(r.lstatSync),r.chmod&&!r.lchmod&&(r.lchmod=function(d,p,g){g&&process.nextTick(g)},r.lchmodSync=function(){}),r.chown&&!r.lchown&&(r.lchown=function(d,p,g,f){f&&process.nextTick(f)},r.lchownSync=function(){}),c==="win32"&&(r.rename=typeof r.rename!="function"?r.rename:function(d){function p(g,f,S){var _=Date.now(),w=0;d(g,f,function y(b){if(b&&(b.code==="EACCES"||b.code==="EPERM"||b.code==="EBUSY")&&Date.now()-_<6e4){setTimeout(function(){r.stat(f,function(P,D){P&&P.code==="ENOENT"?d(g,f,y):S(b)})},w),w<100&&(w+=10);return}S&&S(b)})}return Object.setPrototypeOf&&Object.setPrototypeOf(p,d),p}(r.rename)),r.read=typeof r.read!="function"?r.read:function(d){function p(g,f,S,_,w,y){var b;if(y&&typeof y=="function"){var P=0;b=function(D,x,q){if(D&&D.code==="EAGAIN"&&P<10)return P++,d.call(r,g,f,S,_,w,b);y.apply(this,arguments)}}return d.call(r,g,f,S,_,w,b)}return Object.setPrototypeOf&&Object.setPrototypeOf(p,d),p}(r.read),r.readSync=typeof r.readSync!="function"?r.readSync:function(d){return function(p,g,f,S,_){for(var w=0;;)try{return d.call(r,p,g,f,S,_)}catch(y){if(y.code==="EAGAIN"&&w<10){w++;continue}throw y}}}(r.readSync);function i(d){d.lchmod=function(p,g,f){d.open(p,e.O_WRONLY|e.O_SYMLINK,g,function(S,_){if(S){f&&f(S);return}d.fchmod(_,g,function(w){d.close(_,function(y){f&&f(w||y)})})})},d.lchmodSync=function(p,g){var f=d.openSync(p,e.O_WRONLY|e.O_SYMLINK,g),S=!0,_;try{_=d.fchmodSync(f,g),S=!1}finally{if(S)try{d.closeSync(f)}catch{}else d.closeSync(f)}return _}}function o(d){e.hasOwnProperty("O_SYMLINK")&&d.futimes?(d.lutimes=function(p,g,f,S){d.open(p,e.O_SYMLINK,function(_,w){if(_){S&&S(_);return}d.futimes(w,g,f,function(y){d.close(w,function(b){S&&S(y||b)})})})},d.lutimesSync=function(p,g,f){var S=d.openSync(p,e.O_SYMLINK),_,w=!0;try{_=d.futimesSync(S,g,f),w=!1}finally{if(w)try{d.closeSync(S)}catch{}else d.closeSync(S)}return _}):d.futimes&&(d.lutimes=function(p,g,f,S){S&&process.nextTick(S)},d.lutimesSync=function(){})}function u(d){return d&&function(p,g,f){return d.call(r,p,g,function(S){v(S)&&(S=null),f&&f.apply(this,arguments)})}}function l(d){return d&&function(p,g){try{return d.call(r,p,g)}catch(f){if(!v(f))throw f}}}function m(d){return d&&function(p,g,f,S){return d.call(r,p,g,f,function(_){v(_)&&(_=null),S&&S.apply(this,arguments)})}}function h(d){return d&&function(p,g,f){try{return d.call(r,p,g,f)}catch(S){if(!v(S))throw S}}}function E(d){return d&&function(p,g,f){typeof g=="function"&&(f=g,g=null);function S(_,w){w&&(w.uid<0&&(w.uid+=4294967296),w.gid<0&&(w.gid+=4294967296)),f&&f.apply(this,arguments)}return g?d.call(r,p,g,S):d.call(r,p,S)}}function R(d){return d&&function(p,g){var f=g?d.call(r,p,g):d.call(r,p);return f&&(f.uid<0&&(f.uid+=4294967296),f.gid<0&&(f.gid+=4294967296)),f}}function v(d){if(!d||d.code==="ENOSYS")return!0;var p=!process.getuid||process.getuid()!==0;return!!(p&&(d.code==="EINVAL"||d.code==="EPERM"))}}return rr}var nr,io;function eh(){if(io)return nr;io=1;var e=qe.Stream;nr=t;function t(s){return{ReadStream:c,WriteStream:a};function c(n,r){if(!(this instanceof c))return new c(n,r);e.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,r=r||{};for(var o=Object.keys(r),u=0,l=o.length;u<l;u++){var m=o[u];this[m]=r[m]}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(){i._read()});return}s.open(this.path,this.flags,this.mode,function(h,E){if(h){i.emit("error",h),i.readable=!1;return}i.fd=E,i.emit("open",E),i._read()})}function a(n,r){if(!(this instanceof a))return new a(n,r);e.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var i=Object.keys(r),o=0,u=i.length;o<u;o++){var l=i[o];this[l]=r[l]}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=s.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}return nr}var ir,so;function th(){if(so)return ir;so=1,ir=t;var e=Object.getPrototypeOf||function(s){return s.__proto__};function t(s){if(s===null||typeof s!="object")return s;if(s instanceof Object)var c={__proto__:e(s)};else var c=Object.create(null);return Object.getOwnPropertyNames(s).forEach(function(a){Object.defineProperty(c,a,Object.getOwnPropertyDescriptor(s,a))}),c}return ir}var ft,oo;function Ee(){if(oo)return ft;oo=1;var e=me,t=Qf(),s=eh(),c=th(),a=Vt,n,r;typeof Symbol=="function"&&typeof Symbol.for=="function"?(n=Symbol.for("graceful-fs.queue"),r=Symbol.for("graceful-fs.previous")):(n="___graceful-fs.queue",r="___graceful-fs.previous");function i(){}function o(d,p){Object.defineProperty(d,n,{get:function(){return p}})}var u=i;if(a.debuglog?u=a.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(u=function(){var d=a.format.apply(a,arguments);d="GFS4: "+d.split(/\n/).join(`
GFS4: `),console.error(d)}),!e[n]){var l=$e[n]||[];o(e,l),e.close=function(d){function p(g,f){return d.call(e,g,function(S){S||R(),typeof f=="function"&&f.apply(this,arguments)})}return Object.defineProperty(p,r,{value:d}),p}(e.close),e.closeSync=function(d){function p(g){d.apply(e,arguments),R()}return Object.defineProperty(p,r,{value:d}),p}(e.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){u(e[n]),ut.equal(e[n].length,0)})}$e[n]||o($e,e[n]),ft=m(c(e)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!e.__patched&&(ft=m(e),e.__patched=!0);function m(d){t(d),d.gracefulify=m,d.createReadStream=O,d.createWriteStream=N;var p=d.readFile;d.readFile=g;function g(M,C,H){return typeof C=="function"&&(H=C,C=null),G(M,C,H);function G(F,B,Y,J){return p(F,B,function(re){re&&(re.code==="EMFILE"||re.code==="ENFILE")?h([G,[F,B,Y],re,J||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments)})}}var f=d.writeFile;d.writeFile=S;function S(M,C,H,G){return typeof H=="function"&&(G=H,H=null),F(M,C,H,G);function F(B,Y,J,re,se){return f(B,Y,J,function(Z){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?h([F,[B,Y,J,re],Z,se||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}var _=d.appendFile;_&&(d.appendFile=w);function w(M,C,H,G){return typeof H=="function"&&(G=H,H=null),F(M,C,H,G);function F(B,Y,J,re,se){return _(B,Y,J,function(Z){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?h([F,[B,Y,J,re],Z,se||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}var y=d.copyFile;y&&(d.copyFile=b);function b(M,C,H,G){return typeof H=="function"&&(G=H,H=0),F(M,C,H,G);function F(B,Y,J,re,se){return y(B,Y,J,function(Z){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?h([F,[B,Y,J,re],Z,se||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}var P=d.readdir;d.readdir=x;var D=/^v[0-5]\./;function x(M,C,H){typeof C=="function"&&(H=C,C=null);var G=D.test(process.version)?function(Y,J,re,se){return P(Y,F(Y,J,re,se))}:function(Y,J,re,se){return P(Y,J,F(Y,J,re,se))};return G(M,C,H);function F(B,Y,J,re){return function(se,Z){se&&(se.code==="EMFILE"||se.code==="ENFILE")?h([G,[B,Y,J],se,re||Date.now(),Date.now()]):(Z&&Z.sort&&Z.sort(),typeof J=="function"&&J.call(this,se,Z))}}}if(process.version.substr(0,4)==="v0.8"){var q=s(d);k=q.ReadStream,V=q.WriteStream}var $=d.ReadStream;$&&(k.prototype=Object.create($.prototype),k.prototype.open=U);var L=d.WriteStream;L&&(V.prototype=Object.create(L.prototype),V.prototype.open=j),Object.defineProperty(d,"ReadStream",{get:function(){return k},set:function(M){k=M},enumerable:!0,configurable:!0}),Object.defineProperty(d,"WriteStream",{get:function(){return V},set:function(M){V=M},enumerable:!0,configurable:!0});var T=k;Object.defineProperty(d,"FileReadStream",{get:function(){return T},set:function(M){T=M},enumerable:!0,configurable:!0});var I=V;Object.defineProperty(d,"FileWriteStream",{get:function(){return I},set:function(M){I=M},enumerable:!0,configurable:!0});function k(M,C){return this instanceof k?($.apply(this,arguments),this):k.apply(Object.create(k.prototype),arguments)}function U(){var M=this;ee(M.path,M.flags,M.mode,function(C,H){C?(M.autoClose&&M.destroy(),M.emit("error",C)):(M.fd=H,M.emit("open",H),M.read())})}function V(M,C){return this instanceof V?(L.apply(this,arguments),this):V.apply(Object.create(V.prototype),arguments)}function j(){var M=this;ee(M.path,M.flags,M.mode,function(C,H){C?(M.destroy(),M.emit("error",C)):(M.fd=H,M.emit("open",H))})}function O(M,C){return new d.ReadStream(M,C)}function N(M,C){return new d.WriteStream(M,C)}var z=d.open;d.open=ee;function ee(M,C,H,G){return typeof H=="function"&&(G=H,H=null),F(M,C,H,G);function F(B,Y,J,re,se){return z(B,Y,J,function(Z,A){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?h([F,[B,Y,J,re],Z,se||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}return d}function h(d){u("ENQUEUE",d[0].name,d[1]),e[n].push(d),v()}var E;function R(){for(var d=Date.now(),p=0;p<e[n].length;++p)e[n][p].length>2&&(e[n][p][3]=d,e[n][p][4]=d);v()}function v(){if(clearTimeout(E),E=void 0,e[n].length!==0){var d=e[n].shift(),p=d[0],g=d[1],f=d[2],S=d[3],_=d[4];if(S===void 0)u("RETRY",p.name,g),p.apply(null,g);else if(Date.now()-S>=6e4){u("TIMEOUT",p.name,g);var w=g.pop();typeof w=="function"&&w.call(null,f)}else{var y=Date.now()-_,b=Math.max(_-S,1),P=Math.min(b*1.2,100);y>=P?(u("RETRY",p.name,g),p.apply(null,g.concat([S]))):e[n].push(d)}E===void 0&&(E=setTimeout(v,0))}}return ft}var ao;function ze(){return ao||(ao=1,function(e){const t=Se().fromCallback,s=Ee(),c=["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(a=>typeof s[a]=="function");Object.assign(e,s),c.forEach(a=>{e[a]=t(s[a])}),e.exists=function(a,n){return typeof n=="function"?s.exists(a,n):new Promise(r=>s.exists(a,r))},e.read=function(a,n,r,i,o,u){return typeof u=="function"?s.read(a,n,r,i,o,u):new Promise((l,m)=>{s.read(a,n,r,i,o,(h,E,R)=>{if(h)return m(h);l({bytesRead:E,buffer:R})})})},e.write=function(a,n,...r){return typeof r[r.length-1]=="function"?s.write(a,n,...r):new Promise((i,o)=>{s.write(a,n,...r,(u,l,m)=>{if(u)return o(u);i({bytesWritten:l,buffer:m})})})},typeof s.writev=="function"&&(e.writev=function(a,n,...r){return typeof r[r.length-1]=="function"?s.writev(a,n,...r):new Promise((i,o)=>{s.writev(a,n,...r,(u,l,m)=>{if(u)return o(u);i({bytesWritten:l,buffers:m})})})}),typeof s.realpath.native=="function"?e.realpath.native=t(s.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(tr)),tr}var ht={},sr={},uo;function rh(){if(uo)return sr;uo=1;const e=ce;return sr.checkPath=function(s){if(process.platform==="win32"&&/[<>:"|?*]/.test(s.replace(e.parse(s).root,""))){const a=new Error(`Path contains invalid characters: ${s}`);throw a.code="EINVAL",a}},sr}var co;function nh(){if(co)return ht;co=1;const e=ze(),{checkPath:t}=rh(),s=c=>{const a={mode:511};return typeof c=="number"?c:{...a,...c}.mode};return ht.makeDir=async(c,a)=>(t(c),e.mkdir(c,{mode:s(a),recursive:!0})),ht.makeDirSync=(c,a)=>(t(c),e.mkdirSync(c,{mode:s(a),recursive:!0})),ht}var or,lo;function Oe(){if(lo)return or;lo=1;const e=Se().fromPromise,{makeDir:t,makeDirSync:s}=nh(),c=e(t);return or={mkdirs:c,mkdirsSync:s,mkdirp:c,mkdirpSync:s,ensureDir:c,ensureDirSync:s},or}var ar,fo;function Me(){if(fo)return ar;fo=1;const e=Se().fromPromise,t=ze();function s(c){return t.access(c).then(()=>!0).catch(()=>!1)}return ar={pathExists:e(s),pathExistsSync:t.existsSync},ar}var ur,ho;function sf(){if(ho)return ur;ho=1;const e=Ee();function t(c,a,n,r){e.open(c,"r+",(i,o)=>{if(i)return r(i);e.futimes(o,a,n,u=>{e.close(o,l=>{r&&r(u||l)})})})}function s(c,a,n){const r=e.openSync(c,"r+");return e.futimesSync(r,a,n),e.closeSync(r)}return ur={utimesMillis:t,utimesMillisSync:s},ur}var cr,po;function Ye(){if(po)return cr;po=1;const e=ze(),t=ce,s=Vt;function c(h,E,R){const v=R.dereference?d=>e.stat(d,{bigint:!0}):d=>e.lstat(d,{bigint:!0});return Promise.all([v(h),v(E).catch(d=>{if(d.code==="ENOENT")return null;throw d})]).then(([d,p])=>({srcStat:d,destStat:p}))}function a(h,E,R){let v;const d=R.dereference?g=>e.statSync(g,{bigint:!0}):g=>e.lstatSync(g,{bigint:!0}),p=d(h);try{v=d(E)}catch(g){if(g.code==="ENOENT")return{srcStat:p,destStat:null};throw g}return{srcStat:p,destStat:v}}function n(h,E,R,v,d){s.callbackify(c)(h,E,v,(p,g)=>{if(p)return d(p);const{srcStat:f,destStat:S}=g;if(S){if(u(f,S)){const _=t.basename(h),w=t.basename(E);return R==="move"&&_!==w&&_.toLowerCase()===w.toLowerCase()?d(null,{srcStat:f,destStat:S,isChangingCase:!0}):d(new Error("Source and destination must not be the same."))}if(f.isDirectory()&&!S.isDirectory())return d(new Error(`Cannot overwrite non-directory '${E}' with directory '${h}'.`));if(!f.isDirectory()&&S.isDirectory())return d(new Error(`Cannot overwrite directory '${E}' with non-directory '${h}'.`))}return f.isDirectory()&&l(h,E)?d(new Error(m(h,E,R))):d(null,{srcStat:f,destStat:S})})}function r(h,E,R,v){const{srcStat:d,destStat:p}=a(h,E,v);if(p){if(u(d,p)){const g=t.basename(h),f=t.basename(E);if(R==="move"&&g!==f&&g.toLowerCase()===f.toLowerCase())return{srcStat:d,destStat:p,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(d.isDirectory()&&!p.isDirectory())throw new Error(`Cannot overwrite non-directory '${E}' with directory '${h}'.`);if(!d.isDirectory()&&p.isDirectory())throw new Error(`Cannot overwrite directory '${E}' with non-directory '${h}'.`)}if(d.isDirectory()&&l(h,E))throw new Error(m(h,E,R));return{srcStat:d,destStat:p}}function i(h,E,R,v,d){const p=t.resolve(t.dirname(h)),g=t.resolve(t.dirname(R));if(g===p||g===t.parse(g).root)return d();e.stat(g,{bigint:!0},(f,S)=>f?f.code==="ENOENT"?d():d(f):u(E,S)?d(new Error(m(h,R,v))):i(h,E,g,v,d))}function o(h,E,R,v){const d=t.resolve(t.dirname(h)),p=t.resolve(t.dirname(R));if(p===d||p===t.parse(p).root)return;let g;try{g=e.statSync(p,{bigint:!0})}catch(f){if(f.code==="ENOENT")return;throw f}if(u(E,g))throw new Error(m(h,R,v));return o(h,E,p,v)}function u(h,E){return E.ino&&E.dev&&E.ino===h.ino&&E.dev===h.dev}function l(h,E){const R=t.resolve(h).split(t.sep).filter(d=>d),v=t.resolve(E).split(t.sep).filter(d=>d);return R.reduce((d,p,g)=>d&&v[g]===p,!0)}function m(h,E,R){return`Cannot ${R} '${h}' to a subdirectory of itself, '${E}'.`}return cr={checkPaths:n,checkPathsSync:r,checkParentPaths:i,checkParentPathsSync:o,isSrcSubdir:l,areIdentical:u},cr}var lr,mo;function ih(){if(mo)return lr;mo=1;const e=Ee(),t=ce,s=Oe().mkdirs,c=Me().pathExists,a=sf().utimesMillis,n=Ye();function r(x,q,$,L){typeof $=="function"&&!L?(L=$,$={}):typeof $=="function"&&($={filter:$}),L=L||function(){},$=$||{},$.clobber="clobber"in $?!!$.clobber:!0,$.overwrite="overwrite"in $?!!$.overwrite:$.clobber,$.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),n.checkPaths(x,q,"copy",$,(T,I)=>{if(T)return L(T);const{srcStat:k,destStat:U}=I;n.checkParentPaths(x,k,q,"copy",V=>V?L(V):$.filter?o(i,U,x,q,$,L):i(U,x,q,$,L))})}function i(x,q,$,L,T){const I=t.dirname($);c(I,(k,U)=>{if(k)return T(k);if(U)return l(x,q,$,L,T);s(I,V=>V?T(V):l(x,q,$,L,T))})}function o(x,q,$,L,T,I){Promise.resolve(T.filter($,L)).then(k=>k?x(q,$,L,T,I):I(),k=>I(k))}function u(x,q,$,L,T){return L.filter?o(l,x,q,$,L,T):l(x,q,$,L,T)}function l(x,q,$,L,T){(L.dereference?e.stat:e.lstat)(q,(k,U)=>k?T(k):U.isDirectory()?S(U,x,q,$,L,T):U.isFile()||U.isCharacterDevice()||U.isBlockDevice()?m(U,x,q,$,L,T):U.isSymbolicLink()?P(x,q,$,L,T):U.isSocket()?T(new Error(`Cannot copy a socket file: ${q}`)):U.isFIFO()?T(new Error(`Cannot copy a FIFO pipe: ${q}`)):T(new Error(`Unknown file: ${q}`)))}function m(x,q,$,L,T,I){return q?h(x,$,L,T,I):E(x,$,L,T,I)}function h(x,q,$,L,T){if(L.overwrite)e.unlink($,I=>I?T(I):E(x,q,$,L,T));else return L.errorOnExist?T(new Error(`'${$}' already exists`)):T()}function E(x,q,$,L,T){e.copyFile(q,$,I=>I?T(I):L.preserveTimestamps?R(x.mode,q,$,T):g($,x.mode,T))}function R(x,q,$,L){return v(x)?d($,x,T=>T?L(T):p(x,q,$,L)):p(x,q,$,L)}function v(x){return(x&128)===0}function d(x,q,$){return g(x,q|128,$)}function p(x,q,$,L){f(q,$,T=>T?L(T):g($,x,L))}function g(x,q,$){return e.chmod(x,q,$)}function f(x,q,$){e.stat(x,(L,T)=>L?$(L):a(q,T.atime,T.mtime,$))}function S(x,q,$,L,T,I){return q?w($,L,T,I):_(x.mode,$,L,T,I)}function _(x,q,$,L,T){e.mkdir($,I=>{if(I)return T(I);w(q,$,L,k=>k?T(k):g($,x,T))})}function w(x,q,$,L){e.readdir(x,(T,I)=>T?L(T):y(I,x,q,$,L))}function y(x,q,$,L,T){const I=x.pop();return I?b(x,I,q,$,L,T):T()}function b(x,q,$,L,T,I){const k=t.join($,q),U=t.join(L,q);n.checkPaths(k,U,"copy",T,(V,j)=>{if(V)return I(V);const{destStat:O}=j;u(O,k,U,T,N=>N?I(N):y(x,$,L,T,I))})}function P(x,q,$,L,T){e.readlink(q,(I,k)=>{if(I)return T(I);if(L.dereference&&(k=t.resolve(process.cwd(),k)),x)e.readlink($,(U,V)=>U?U.code==="EINVAL"||U.code==="UNKNOWN"?e.symlink(k,$,T):T(U):(L.dereference&&(V=t.resolve(process.cwd(),V)),n.isSrcSubdir(k,V)?T(new Error(`Cannot copy '${k}' to a subdirectory of itself, '${V}'.`)):x.isDirectory()&&n.isSrcSubdir(V,k)?T(new Error(`Cannot overwrite '${V}' with '${k}'.`)):D(k,$,T)));else return e.symlink(k,$,T)})}function D(x,q,$){e.unlink(q,L=>L?$(L):e.symlink(x,q,$))}return lr=r,lr}var fr,_o;function sh(){if(_o)return fr;_o=1;const e=Ee(),t=ce,s=Oe().mkdirsSync,c=sf().utimesMillisSync,a=Ye();function n(y,b,P){typeof P=="function"&&(P={filter:P}),P=P||{},P.clobber="clobber"in P?!!P.clobber:!0,P.overwrite="overwrite"in P?!!P.overwrite:P.clobber,P.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");const{srcStat:D,destStat:x}=a.checkPathsSync(y,b,"copy",P);return a.checkParentPathsSync(y,D,b,"copy"),r(x,y,b,P)}function r(y,b,P,D){if(D.filter&&!D.filter(b,P))return;const x=t.dirname(P);return e.existsSync(x)||s(x),o(y,b,P,D)}function i(y,b,P,D){if(!(D.filter&&!D.filter(b,P)))return o(y,b,P,D)}function o(y,b,P,D){const q=(D.dereference?e.statSync:e.lstatSync)(b);if(q.isDirectory())return p(q,y,b,P,D);if(q.isFile()||q.isCharacterDevice()||q.isBlockDevice())return u(q,y,b,P,D);if(q.isSymbolicLink())return _(y,b,P,D);throw q.isSocket()?new Error(`Cannot copy a socket file: ${b}`):q.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${b}`):new Error(`Unknown file: ${b}`)}function u(y,b,P,D,x){return b?l(y,P,D,x):m(y,P,D,x)}function l(y,b,P,D){if(D.overwrite)return e.unlinkSync(P),m(y,b,P,D);if(D.errorOnExist)throw new Error(`'${P}' already exists`)}function m(y,b,P,D){return e.copyFileSync(b,P),D.preserveTimestamps&&h(y.mode,b,P),v(P,y.mode)}function h(y,b,P){return E(y)&&R(P,y),d(b,P)}function E(y){return(y&128)===0}function R(y,b){return v(y,b|128)}function v(y,b){return e.chmodSync(y,b)}function d(y,b){const P=e.statSync(y);return c(b,P.atime,P.mtime)}function p(y,b,P,D,x){return b?f(P,D,x):g(y.mode,P,D,x)}function g(y,b,P,D){return e.mkdirSync(P),f(b,P,D),v(P,y)}function f(y,b,P){e.readdirSync(y).forEach(D=>S(D,y,b,P))}function S(y,b,P,D){const x=t.join(b,y),q=t.join(P,y),{destStat:$}=a.checkPathsSync(x,q,"copy",D);return i($,x,q,D)}function _(y,b,P,D){let x=e.readlinkSync(b);if(D.dereference&&(x=t.resolve(process.cwd(),x)),y){let q;try{q=e.readlinkSync(P)}catch($){if($.code==="EINVAL"||$.code==="UNKNOWN")return e.symlinkSync(x,P);throw $}if(D.dereference&&(q=t.resolve(process.cwd(),q)),a.isSrcSubdir(x,q))throw new Error(`Cannot copy '${x}' to a subdirectory of itself, '${q}'.`);if(e.statSync(P).isDirectory()&&a.isSrcSubdir(q,x))throw new Error(`Cannot overwrite '${q}' with '${x}'.`);return w(x,P)}else return e.symlinkSync(x,P)}function w(y,b){return e.unlinkSync(b),e.symlinkSync(y,b)}return fr=n,fr}var hr,yo;function Ds(){if(yo)return hr;yo=1;const e=Se().fromCallback;return hr={copy:e(ih()),copySync:sh()},hr}var dr,go;function oh(){if(go)return dr;go=1;const e=Ee(),t=ce,s=ut,c=process.platform==="win32";function a(R){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(d=>{R[d]=R[d]||e[d],d=d+"Sync",R[d]=R[d]||e[d]}),R.maxBusyTries=R.maxBusyTries||3}function n(R,v,d){let p=0;typeof v=="function"&&(d=v,v={}),s(R,"rimraf: missing path"),s.strictEqual(typeof R,"string","rimraf: path should be a string"),s.strictEqual(typeof d,"function","rimraf: callback function required"),s(v,"rimraf: invalid options argument provided"),s.strictEqual(typeof v,"object","rimraf: options should be object"),a(v),r(R,v,function g(f){if(f){if((f.code==="EBUSY"||f.code==="ENOTEMPTY"||f.code==="EPERM")&&p<v.maxBusyTries){p++;const S=p*100;return setTimeout(()=>r(R,v,g),S)}f.code==="ENOENT"&&(f=null)}d(f)})}function r(R,v,d){s(R),s(v),s(typeof d=="function"),v.lstat(R,(p,g)=>{if(p&&p.code==="ENOENT")return d(null);if(p&&p.code==="EPERM"&&c)return i(R,v,p,d);if(g&&g.isDirectory())return u(R,v,p,d);v.unlink(R,f=>{if(f){if(f.code==="ENOENT")return d(null);if(f.code==="EPERM")return c?i(R,v,f,d):u(R,v,f,d);if(f.code==="EISDIR")return u(R,v,f,d)}return d(f)})})}function i(R,v,d,p){s(R),s(v),s(typeof p=="function"),v.chmod(R,438,g=>{g?p(g.code==="ENOENT"?null:d):v.stat(R,(f,S)=>{f?p(f.code==="ENOENT"?null:d):S.isDirectory()?u(R,v,d,p):v.unlink(R,p)})})}function o(R,v,d){let p;s(R),s(v);try{v.chmodSync(R,438)}catch(g){if(g.code==="ENOENT")return;throw d}try{p=v.statSync(R)}catch(g){if(g.code==="ENOENT")return;throw d}p.isDirectory()?h(R,v,d):v.unlinkSync(R)}function u(R,v,d,p){s(R),s(v),s(typeof p=="function"),v.rmdir(R,g=>{g&&(g.code==="ENOTEMPTY"||g.code==="EEXIST"||g.code==="EPERM")?l(R,v,p):g&&g.code==="ENOTDIR"?p(d):p(g)})}function l(R,v,d){s(R),s(v),s(typeof d=="function"),v.readdir(R,(p,g)=>{if(p)return d(p);let f=g.length,S;if(f===0)return v.rmdir(R,d);g.forEach(_=>{n(t.join(R,_),v,w=>{if(!S){if(w)return d(S=w);--f===0&&v.rmdir(R,d)}})})})}function m(R,v){let d;v=v||{},a(v),s(R,"rimraf: missing path"),s.strictEqual(typeof R,"string","rimraf: path should be a string"),s(v,"rimraf: missing options"),s.strictEqual(typeof v,"object","rimraf: options should be object");try{d=v.lstatSync(R)}catch(p){if(p.code==="ENOENT")return;p.code==="EPERM"&&c&&o(R,v,p)}try{d&&d.isDirectory()?h(R,v,null):v.unlinkSync(R)}catch(p){if(p.code==="ENOENT")return;if(p.code==="EPERM")return c?o(R,v,p):h(R,v,p);if(p.code!=="EISDIR")throw p;h(R,v,p)}}function h(R,v,d){s(R),s(v);try{v.rmdirSync(R)}catch(p){if(p.code==="ENOTDIR")throw d;if(p.code==="ENOTEMPTY"||p.code==="EEXIST"||p.code==="EPERM")E(R,v);else if(p.code!=="ENOENT")throw p}}function E(R,v){if(s(R),s(v),v.readdirSync(R).forEach(d=>m(t.join(R,d),v)),c){const d=Date.now();do try{return v.rmdirSync(R,v)}catch{}while(Date.now()-d<500)}else return v.rmdirSync(R,v)}return dr=n,n.sync=m,dr}var pr,vo;function zt(){if(vo)return pr;vo=1;const e=Ee(),t=Se().fromCallback,s=oh();function c(n,r){if(e.rm)return e.rm(n,{recursive:!0,force:!0},r);s(n,r)}function a(n){if(e.rmSync)return e.rmSync(n,{recursive:!0,force:!0});s.sync(n)}return pr={remove:t(c),removeSync:a},pr}var mr,Eo;function ah(){if(Eo)return mr;Eo=1;const e=Se().fromPromise,t=ze(),s=ce,c=Oe(),a=zt(),n=e(async function(o){let u;try{u=await t.readdir(o)}catch{return c.mkdirs(o)}return Promise.all(u.map(l=>a.remove(s.join(o,l))))});function r(i){let o;try{o=t.readdirSync(i)}catch{return c.mkdirsSync(i)}o.forEach(u=>{u=s.join(i,u),a.removeSync(u)})}return mr={emptyDirSync:r,emptydirSync:r,emptyDir:n,emptydir:n},mr}var _r,So;function uh(){if(So)return _r;So=1;const e=Se().fromCallback,t=ce,s=Ee(),c=Oe();function a(r,i){function o(){s.writeFile(r,"",u=>{if(u)return i(u);i()})}s.stat(r,(u,l)=>{if(!u&&l.isFile())return i();const m=t.dirname(r);s.stat(m,(h,E)=>{if(h)return h.code==="ENOENT"?c.mkdirs(m,R=>{if(R)return i(R);o()}):i(h);E.isDirectory()?o():s.readdir(m,R=>{if(R)return i(R)})})})}function n(r){let i;try{i=s.statSync(r)}catch{}if(i&&i.isFile())return;const o=t.dirname(r);try{s.statSync(o).isDirectory()||s.readdirSync(o)}catch(u){if(u&&u.code==="ENOENT")c.mkdirsSync(o);else throw u}s.writeFileSync(r,"")}return _r={createFile:e(a),createFileSync:n},_r}var yr,Ro;function ch(){if(Ro)return yr;Ro=1;const e=Se().fromCallback,t=ce,s=Ee(),c=Oe(),a=Me().pathExists,{areIdentical:n}=Ye();function r(o,u,l){function m(h,E){s.link(h,E,R=>{if(R)return l(R);l(null)})}s.lstat(u,(h,E)=>{s.lstat(o,(R,v)=>{if(R)return R.message=R.message.replace("lstat","ensureLink"),l(R);if(E&&n(v,E))return l(null);const d=t.dirname(u);a(d,(p,g)=>{if(p)return l(p);if(g)return m(o,u);c.mkdirs(d,f=>{if(f)return l(f);m(o,u)})})})})}function i(o,u){let l;try{l=s.lstatSync(u)}catch{}try{const E=s.lstatSync(o);if(l&&n(E,l))return}catch(E){throw E.message=E.message.replace("lstat","ensureLink"),E}const m=t.dirname(u);return s.existsSync(m)||c.mkdirsSync(m),s.linkSync(o,u)}return yr={createLink:e(r),createLinkSync:i},yr}var gr,wo;function lh(){if(wo)return gr;wo=1;const e=ce,t=Ee(),s=Me().pathExists;function c(n,r,i){if(e.isAbsolute(n))return t.lstat(n,o=>o?(o.message=o.message.replace("lstat","ensureSymlink"),i(o)):i(null,{toCwd:n,toDst:n}));{const o=e.dirname(r),u=e.join(o,n);return s(u,(l,m)=>l?i(l):m?i(null,{toCwd:u,toDst:n}):t.lstat(n,h=>h?(h.message=h.message.replace("lstat","ensureSymlink"),i(h)):i(null,{toCwd:n,toDst:e.relative(o,n)})))}}function a(n,r){let i;if(e.isAbsolute(n)){if(i=t.existsSync(n),!i)throw new Error("absolute srcpath does not exist");return{toCwd:n,toDst:n}}else{const o=e.dirname(r),u=e.join(o,n);if(i=t.existsSync(u),i)return{toCwd:u,toDst:n};if(i=t.existsSync(n),!i)throw new Error("relative srcpath does not exist");return{toCwd:n,toDst:e.relative(o,n)}}}return gr={symlinkPaths:c,symlinkPathsSync:a},gr}var vr,Oo;function fh(){if(Oo)return vr;Oo=1;const e=Ee();function t(c,a,n){if(n=typeof a=="function"?a:n,a=typeof a=="function"?!1:a,a)return n(null,a);e.lstat(c,(r,i)=>{if(r)return n(null,"file");a=i&&i.isDirectory()?"dir":"file",n(null,a)})}function s(c,a){let n;if(a)return a;try{n=e.lstatSync(c)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}return vr={symlinkType:t,symlinkTypeSync:s},vr}var Er,bo;function hh(){if(bo)return Er;bo=1;const e=Se().fromCallback,t=ce,s=ze(),c=Oe(),a=c.mkdirs,n=c.mkdirsSync,r=lh(),i=r.symlinkPaths,o=r.symlinkPathsSync,u=fh(),l=u.symlinkType,m=u.symlinkTypeSync,h=Me().pathExists,{areIdentical:E}=Ye();function R(p,g,f,S){S=typeof f=="function"?f:S,f=typeof f=="function"?!1:f,s.lstat(g,(_,w)=>{!_&&w.isSymbolicLink()?Promise.all([s.stat(p),s.stat(g)]).then(([y,b])=>{if(E(y,b))return S(null);v(p,g,f,S)}):v(p,g,f,S)})}function v(p,g,f,S){i(p,g,(_,w)=>{if(_)return S(_);p=w.toDst,l(w.toCwd,f,(y,b)=>{if(y)return S(y);const P=t.dirname(g);h(P,(D,x)=>{if(D)return S(D);if(x)return s.symlink(p,g,b,S);a(P,q=>{if(q)return S(q);s.symlink(p,g,b,S)})})})})}function d(p,g,f){let S;try{S=s.lstatSync(g)}catch{}if(S&&S.isSymbolicLink()){const b=s.statSync(p),P=s.statSync(g);if(E(b,P))return}const _=o(p,g);p=_.toDst,f=m(_.toCwd,f);const w=t.dirname(g);return s.existsSync(w)||n(w),s.symlinkSync(p,g,f)}return Er={createSymlink:e(R),createSymlinkSync:d},Er}var Sr,Ao;function dh(){if(Ao)return Sr;Ao=1;const{createFile:e,createFileSync:t}=uh(),{createLink:s,createLinkSync:c}=ch(),{createSymlink:a,createSymlinkSync:n}=hh();return Sr={createFile:e,createFileSync:t,ensureFile:e,ensureFileSync:t,createLink:s,createLinkSync:c,ensureLink:s,ensureLinkSync:c,createSymlink:a,createSymlinkSync:n,ensureSymlink:a,ensureSymlinkSync:n},Sr}var Rr,Po;function xs(){if(Po)return Rr;Po=1;function e(s,{EOL:c=`
`,finalEOL:a=!0,replacer:n=null,spaces:r}={}){const i=a?c:"";return JSON.stringify(s,n,r).replace(/\n/g,c)+i}function t(s){return Buffer.isBuffer(s)&&(s=s.toString("utf8")),s.replace(/^\uFEFF/,"")}return Rr={stringify:e,stripBom:t},Rr}var wr,To;function ph(){if(To)return wr;To=1;let e;try{e=Ee()}catch{e=me}const t=Se(),{stringify:s,stripBom:c}=xs();async function a(m,h={}){typeof h=="string"&&(h={encoding:h});const E=h.fs||e,R="throws"in h?h.throws:!0;let v=await t.fromCallback(E.readFile)(m,h);v=c(v);let d;try{d=JSON.parse(v,h?h.reviver:null)}catch(p){if(R)throw p.message=`${m}: ${p.message}`,p;return null}return d}const n=t.fromPromise(a);function r(m,h={}){typeof h=="string"&&(h={encoding:h});const E=h.fs||e,R="throws"in h?h.throws:!0;try{let v=E.readFileSync(m,h);return v=c(v),JSON.parse(v,h.reviver)}catch(v){if(R)throw v.message=`${m}: ${v.message}`,v;return null}}async function i(m,h,E={}){const R=E.fs||e,v=s(h,E);await t.fromCallback(R.writeFile)(m,v,E)}const o=t.fromPromise(i);function u(m,h,E={}){const R=E.fs||e,v=s(h,E);return R.writeFileSync(m,v,E)}return wr={readFile:n,readFileSync:r,writeFile:o,writeFileSync:u},wr}var Or,Io;function mh(){if(Io)return Or;Io=1;const e=ph();return Or={readJson:e.readFile,readJsonSync:e.readFileSync,writeJson:e.writeFile,writeJsonSync:e.writeFileSync},Or}var br,No;function Fs(){if(No)return br;No=1;const e=Se().fromCallback,t=Ee(),s=ce,c=Oe(),a=Me().pathExists;function n(i,o,u,l){typeof u=="function"&&(l=u,u="utf8");const m=s.dirname(i);a(m,(h,E)=>{if(h)return l(h);if(E)return t.writeFile(i,o,u,l);c.mkdirs(m,R=>{if(R)return l(R);t.writeFile(i,o,u,l)})})}function r(i,...o){const u=s.dirname(i);if(t.existsSync(u))return t.writeFileSync(i,...o);c.mkdirsSync(u),t.writeFileSync(i,...o)}return br={outputFile:e(n),outputFileSync:r},br}var Ar,$o;function _h(){if($o)return Ar;$o=1;const{stringify:e}=xs(),{outputFile:t}=Fs();async function s(c,a,n={}){const r=e(a,n);await t(c,r,n)}return Ar=s,Ar}var Pr,Co;function yh(){if(Co)return Pr;Co=1;const{stringify:e}=xs(),{outputFileSync:t}=Fs();function s(c,a,n){const r=e(a,n);t(c,r,n)}return Pr=s,Pr}var Tr,Lo;function gh(){if(Lo)return Tr;Lo=1;const e=Se().fromPromise,t=mh();return t.outputJson=e(_h()),t.outputJsonSync=yh(),t.outputJSON=t.outputJson,t.outputJSONSync=t.outputJsonSync,t.writeJSON=t.writeJson,t.writeJSONSync=t.writeJsonSync,t.readJSON=t.readJson,t.readJSONSync=t.readJsonSync,Tr=t,Tr}var Ir,Do;function vh(){if(Do)return Ir;Do=1;const e=Ee(),t=ce,s=Ds().copy,c=zt().remove,a=Oe().mkdirp,n=Me().pathExists,r=Ye();function i(h,E,R,v){typeof R=="function"&&(v=R,R={}),R=R||{};const d=R.overwrite||R.clobber||!1;r.checkPaths(h,E,"move",R,(p,g)=>{if(p)return v(p);const{srcStat:f,isChangingCase:S=!1}=g;r.checkParentPaths(h,f,E,"move",_=>{if(_)return v(_);if(o(E))return u(h,E,d,S,v);a(t.dirname(E),w=>w?v(w):u(h,E,d,S,v))})})}function o(h){const E=t.dirname(h);return t.parse(E).root===E}function u(h,E,R,v,d){if(v)return l(h,E,R,d);if(R)return c(E,p=>p?d(p):l(h,E,R,d));n(E,(p,g)=>p?d(p):g?d(new Error("dest already exists.")):l(h,E,R,d))}function l(h,E,R,v){e.rename(h,E,d=>d?d.code!=="EXDEV"?v(d):m(h,E,R,v):v())}function m(h,E,R,v){s(h,E,{overwrite:R,errorOnExist:!0},p=>p?v(p):c(h,v))}return Ir=i,Ir}var Nr,xo;function Eh(){if(xo)return Nr;xo=1;const e=Ee(),t=ce,s=Ds().copySync,c=zt().removeSync,a=Oe().mkdirpSync,n=Ye();function r(m,h,E){E=E||{};const R=E.overwrite||E.clobber||!1,{srcStat:v,isChangingCase:d=!1}=n.checkPathsSync(m,h,"move",E);return n.checkParentPathsSync(m,v,h,"move"),i(h)||a(t.dirname(h)),o(m,h,R,d)}function i(m){const h=t.dirname(m);return t.parse(h).root===h}function o(m,h,E,R){if(R)return u(m,h,E);if(E)return c(h),u(m,h,E);if(e.existsSync(h))throw new Error("dest already exists.");return u(m,h,E)}function u(m,h,E){try{e.renameSync(m,h)}catch(R){if(R.code!=="EXDEV")throw R;return l(m,h,E)}}function l(m,h,E){return s(m,h,{overwrite:E,errorOnExist:!0}),c(m)}return Nr=r,Nr}var $r,Fo;function Sh(){if(Fo)return $r;Fo=1;const e=Se().fromCallback;return $r={move:e(vh()),moveSync:Eh()},$r}var Cr,qo;function Rh(){return qo||(qo=1,Cr={...ze(),...Ds(),...ah(),...dh(),...gh(),...Oe(),...Sh(),...Fs(),...Me(),...zt()}),Cr}var pe=Rh(),Lr,Mo;function wh(){if(Mo)return Lr;Mo=1;var e=ct;return Lr=e.homedir||function(){var s=process.env.HOME,c=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||s||null:process.platform==="darwin"?s||(c?"/Users/"+c:null):process.platform==="linux"?s||(process.getuid()===0?"/root":c?"/home/"+c:null):s||null},Lr}var Dr,ko;function Oh(){return ko||(ko=1,Dr=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(s,c){return c};var t=new Error().stack;return Error.prepareStackTrace=e,t[2].getFileName()}),Dr}var Ue={exports:{}},Bo;function bh(){if(Bo)return Ue.exports;Bo=1;var e=process.platform==="win32",t=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,s={};function c(i){return t.exec(i).slice(1)}s.parse=function(i){if(typeof i!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof i);var o=c(i);if(!o||o.length!==5)throw new TypeError("Invalid path '"+i+"'");return{root:o[1],dir:o[0]===o[1]?o[0]:o[0].slice(0,-1),base:o[2],ext:o[4],name:o[3]}};var a=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,n={};function r(i){return a.exec(i).slice(1)}return n.parse=function(i){if(typeof i!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof i);var o=r(i);if(!o||o.length!==5)throw new TypeError("Invalid path '"+i+"'");return{root:o[1],dir:o[0].slice(0,-1),base:o[2],ext:o[4],name:o[3]}},e?Ue.exports=s.parse:Ue.exports=n.parse,Ue.exports.posix=n.parse,Ue.exports.win32=s.parse,Ue.exports}var xr,jo;function Ah(){if(jo)return xr;jo=1;var e=ce,t=e.parse||bh(),s=function(a,n){var r="/";/^([A-Za-z]:)/.test(a)?r="":/^\\\\/.test(a)&&(r="\\\\");for(var i=[a],o=t(a);o.dir!==i[i.length-1];)i.push(o.dir),o=t(o.dir);return i.reduce(function(u,l){return u.concat(n.map(function(m){return e.resolve(r,l,m)}))},[])};return xr=function(a,n,r){var i=n&&n.moduleDirectory?[].concat(n.moduleDirectory):["node_modules"];if(n&&typeof n.paths=="function")return n.paths(r,a,function(){return s(a,i)},n);var o=s(a,i);return n&&n.paths?o.concat(n.paths):o},xr}var Fr,Ho;function Ph(){return Ho||(Ho=1,Fr=function(e,t){return t||{}}),Fr}var qr,Uo;function Th(){if(Uo)return qr;Uo=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,s=Math.max,c="[object Function]",a=function(o,u){for(var l=[],m=0;m<o.length;m+=1)l[m]=o[m];for(var h=0;h<u.length;h+=1)l[h+o.length]=u[h];return l},n=function(o,u){for(var l=[],m=u,h=0;m<o.length;m+=1,h+=1)l[h]=o[m];return l},r=function(i,o){for(var u="",l=0;l<i.length;l+=1)u+=i[l],l+1<i.length&&(u+=o);return u};return qr=function(o){var u=this;if(typeof u!="function"||t.apply(u)!==c)throw new TypeError(e+u);for(var l=n(arguments,1),m,h=function(){if(this instanceof m){var p=u.apply(this,a(l,arguments));return Object(p)===p?p:this}return u.apply(o,a(l,arguments))},E=s(0,u.length-l.length),R=[],v=0;v<E;v++)R[v]="$"+v;if(m=Function("binder","return function ("+r(R,",")+"){ return binder.apply(this,arguments); }")(h),u.prototype){var d=function(){};d.prototype=u.prototype,m.prototype=new d,d.prototype=null}return m},qr}var Mr,Go;function Ih(){if(Go)return Mr;Go=1;var e=Th();return Mr=Function.prototype.bind||e,Mr}var kr,Wo;function Nh(){if(Wo)return kr;Wo=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,s=Ih();return kr=s.call(e,t),kr}const $h=!0,Ch=">= 8",Lh=">= 0.5 && < 0.9.7",Dh=!0,xh=!0,Fh=">= 0.5",qh=!0,Mh=!0,kh=!0,Bh=">= 1 && < 8",jh="< 8",Hh=!0,Uh=[">= 14.17 && < 15",">= 15.1"],Gh=!0,Wh=">= 0.7.12",Vh=!0,zh="< 6",Yh=!0,Kh=">= 0.11.1",Xh=">= 0.11.1",Zh=">= 0.11.1",Jh=">= 0.11.1",Qh=">= 0.11.1",ed=">= 0.11.1",td=!0,rd=">= 8.8",nd=!0,id=">= 8",sd="< 8",od=!0,ad=!0,ud=!0,cd=!0,ld=">= 8.5",fd=">= 1",hd=">= 0.5",dd=!0,pd=!0,md=!0,_d=">= 0.11.5 && < 3",yd=">= 0.9.4",gd=">= 0.9.4",vd=">= 1.4.1",Ed=">= 0.9.4",Sd=">= 0.9.4",Rd=">= 0.9.4",wd=!0,Od=!0,bd=[">= 0.4 && < 0.7",">= 0.8"],Ad=!0,Pd=">= 0.11.13",Td=">= 0.11.3 && < 10",Id=">= 0.11.3",Nd=!0,$d=">= 10",Cd=!0,Ld=!0,Dd=!0,xd=">= 1",Fd=!0,qd=[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],Md=">= 11.7",kd=">= 0.5",Bd={assert:$h,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:Ch,"node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:Lh,buffer:Dh,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:xh,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:Fh,"node:cluster":[">= 14.18 && < 15",">= 16"],console:qh,"node:console":[">= 14.18 && < 15",">= 16"],constants:Mh,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:kh,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:Bh,_debugger:jh,dgram:Hh,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:Uh,"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:Gh,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:Wh,"node:domain":[">= 14.18 && < 15",">= 16"],events:Vh,"node:events":[">= 14.18 && < 15",">= 16"],freelist:zh,fs:Yh,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:Kh,"node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:Xh,"node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:Zh,"node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:Jh,"node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:Qh,"node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:ed,"node:_http_server":[">= 14.18 && < 15",">= 16"],http:td,"node:http":[">= 14.18 && < 15",">= 16"],http2:rd,"node:http2":[">= 14.18 && < 15",">= 16"],https:nd,"node:https":[">= 14.18 && < 15",">= 16"],inspector:id,"node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:sd,module:od,"node:module":[">= 14.18 && < 15",">= 16"],net:ad,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:ud,"node:os":[">= 14.18 && < 15",">= 16"],path:cd,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:ld,"node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:fd,"node:process":[">= 14.18 && < 15",">= 16"],punycode:hd,"node:punycode":[">= 14.18 && < 15",">= 16"],querystring:dd,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:pd,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:md,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:_d,"node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:yd,"node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:gd,"node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:vd,"node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:Ed,"node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:Sd,"node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:Rd,"node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:wd,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:Od,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:bd,"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:Ad,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:Pd,"node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:Td,_tls_wrap:Id,"node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:Nd,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:$d,"node:trace_events":[">= 14.18 && < 15",">= 16"],tty:Cd,"node:tty":[">= 14.18 && < 15",">= 16"],url:Ld,"node:url":[">= 14.18 && < 15",">= 16"],util:Dd,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:xd,"node:v8":[">= 14.18 && < 15",">= 16"],vm:Fd,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:qd,"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:Md,"node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:kd,"node:zlib":[">= 14.18 && < 15",">= 16"]};var Br,Vo;function jd(){if(Vo)return Br;Vo=1;var e=Nh();function t(n,r){for(var i=n.split("."),o=r.split(" "),u=o.length>1?o[0]:"=",l=(o.length>1?o[1]:o[0]).split("."),m=0;m<3;++m){var h=parseInt(i[m]||0,10),E=parseInt(l[m]||0,10);if(h!==E)return u==="<"?h<E:u===">="?h>=E:!1}return u===">="}function s(n,r){var i=r.split(/ ?&& ?/);if(i.length===0)return!1;for(var o=0;o<i.length;++o)if(!t(n,i[o]))return!1;return!0}function c(n,r){if(typeof r=="boolean")return r;var i=typeof n>"u"?process.versions&&process.versions.node:n;if(typeof i!="string")throw new TypeError(typeof n>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(r&&typeof r=="object"){for(var o=0;o<r.length;++o)if(s(i,r[o]))return!0;return!1}return s(i,r)}var a=Bd;return Br=function(r,i){return e(a,r)&&c(i,a[r])},Br}var jr,zo;function Hd(){if(zo)return jr;zo=1;var e=me,t=wh(),s=ce,c=Oh(),a=Ah(),n=Ph(),r=jd(),i=process.platform!=="win32"&&e.realpath&&typeof e.realpath.native=="function"?e.realpath.native:e.realpath,o=t(),u=function(){return[s.join(o,".node_modules"),s.join(o,".node_libraries")]},l=function(p,g){e.stat(p,function(f,S){return f?f.code==="ENOENT"||f.code==="ENOTDIR"?g(null,!1):g(f):g(null,S.isFile()||S.isFIFO())})},m=function(p,g){e.stat(p,function(f,S){return f?f.code==="ENOENT"||f.code==="ENOTDIR"?g(null,!1):g(f):g(null,S.isDirectory())})},h=function(p,g){i(p,function(f,S){f&&f.code!=="ENOENT"?g(f):g(null,f?p:S)})},E=function(p,g,f,S){f&&f.preserveSymlinks===!1?p(g,S):S(null,g)},R=function(p,g,f){p(g,function(S,_){if(S)f(S);else try{var w=JSON.parse(_);f(null,w)}catch{f(null)}})},v=function(p,g,f){for(var S=a(g,f,p),_=0;_<S.length;_++)S[_]=s.join(S[_],p);return S};return jr=function(p,g,f){var S=f,_=g;if(typeof g=="function"&&(S=_,_={}),typeof p!="string"){var w=new TypeError("Path must be a string.");return process.nextTick(function(){S(w)})}_=n(p,_);var y=_.isFile||l,b=_.isDirectory||m,P=_.readFile||e.readFile,D=_.realpath||h,x=_.readPackage||R;if(_.readFile&&_.readPackage){var q=new TypeError("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick(function(){S(q)})}var $=_.packageIterator,L=_.extensions||[".js"],T=_.includeCoreModules!==!1,I=_.basedir||s.dirname(c()),k=_.filename||I;_.paths=_.paths||u();var U=s.resolve(I);E(D,U,_,function(H,G){H?S(H):j(G)});var V;function j(H){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(p))V=s.resolve(H,p),(p==="."||p===".."||p.slice(-1)==="/")&&(V+="/"),/\/$/.test(p)&&V===H?ee(V,_.package,O):N(V,_.package,O);else{if(T&&r(p))return S(null,p);C(p,H,function(G,F,B){if(G)S(G);else{if(F)return E(D,F,_,function(J,re){J?S(J):S(null,re,B)});var Y=new Error("Cannot find module '"+p+"' from '"+k+"'");Y.code="MODULE_NOT_FOUND",S(Y)}})}}function O(H,G,F){H?S(H):G?S(null,G,F):ee(V,function(B,Y,J){if(B)S(B);else if(Y)E(D,Y,_,function(se,Z){se?S(se):S(null,Z,J)});else{var re=new Error("Cannot find module '"+p+"' from '"+k+"'");re.code="MODULE_NOT_FOUND",S(re)}})}function N(H,G,F){var B=G,Y=F;typeof B=="function"&&(Y=B,B=void 0);var J=[""].concat(L);re(J,H,B);function re(se,Z,A){if(se.length===0)return Y(null,void 0,A);var X=Z+se[0],Q=A;Q?W(null,Q):z(s.dirname(X),W);function W(K,te,ie){if(Q=te,K)return Y(K);if(ie&&Q&&_.pathFilter){var ue=s.relative(ie,X),le=ue.slice(0,ue.length-se[0].length),he=_.pathFilter(Q,Z,le);if(he)return re([""].concat(L.slice()),s.resolve(ie,he),Q)}y(X,ne)}function ne(K,te){if(K)return Y(K);if(te)return Y(null,X,Q);re(se.slice(1),Z,Q)}}}function z(H,G){if(H===""||H==="/"||process.platform==="win32"&&/^\w:[/\\]*$/.test(H)||/[/\\]node_modules[/\\]*$/.test(H))return G(null);E(D,H,_,function(F,B){if(F)return z(s.dirname(H),G);var Y=s.join(B,"package.json");y(Y,function(J,re){if(!re)return z(s.dirname(H),G);x(P,Y,function(se,Z){se&&G(se);var A=Z;A&&_.packageFilter&&(A=_.packageFilter(A,Y)),G(null,A,H)})})})}function ee(H,G,F){var B=F,Y=G;typeof Y=="function"&&(B=Y,Y=_.package),E(D,H,_,function(J,re){if(J)return B(J);var se=s.join(re,"package.json");y(se,function(Z,A){if(Z)return B(Z);if(!A)return N(s.join(H,"index"),Y,B);x(P,se,function(X,Q){if(X)return B(X);var W=Q;if(W&&_.packageFilter&&(W=_.packageFilter(W,se)),W&&W.main){if(typeof W.main!="string"){var ne=new TypeError("package “"+W.name+"” `main` must be a string");return ne.code="INVALID_PACKAGE_MAIN",B(ne)}(W.main==="."||W.main==="./")&&(W.main="index"),N(s.resolve(H,W.main),W,function(K,te,ie){if(K)return B(K);if(te)return B(null,te,ie);if(!ie)return N(s.join(H,"index"),ie,B);var ue=s.resolve(H,ie.main);ee(ue,ie,function(le,he,ge){if(le)return B(le);if(he)return B(null,he,ge);N(s.join(H,"index"),ge,B)})});return}N(s.join(H,"/index"),W,B)})})})}function M(H,G){if(G.length===0)return H(null,void 0);var F=G[0];b(s.dirname(F),B);function B(re,se){if(re)return H(re);if(!se)return M(H,G.slice(1));N(F,_.package,Y)}function Y(re,se,Z){if(re)return H(re);if(se)return H(null,se,Z);ee(F,_.package,J)}function J(re,se,Z){if(re)return H(re);if(se)return H(null,se,Z);M(H,G.slice(1))}}function C(H,G,F){var B=function(){return v(H,G,_)};M(F,$?$(H,G,B,_):B())}},jr}var Hr,Yo;function Ud(){return Yo||(Yo=1,Hr=Hd()),Hr}var Gd=Ud();const Wd=Ie(Gd);async function Vd(){if(typeof require=="function")return require;const{createRequire:e}=await import("module");return e(import.meta.url)}async function zd(e){try{const t=await Vd();let s=null;const c=console.log;console.log=n=>{s=n};const a=t(e);if(console.log=c,typeof a=="string")return a;if(typeof a=="object"){if(typeof a.include_dir=="string")return a.include_dir;if(typeof a.include=="string")return a.include;if(s!==null)return s}}catch{}return e}async function Yd(e,t){try{const s=await Kd(t,e);if(s!==void 0)return s}catch{}