nx-mesh
Version:
GraphQL Mesh support for Nx
11 lines (9 loc) • 61.1 kB
JavaScript
var Fi=Object.create;var Oe=Object.defineProperty;var Ni=Object.getOwnPropertyDescriptor;var Ai=Object.getOwnPropertyNames;var Di=Object.getPrototypeOf,Mi=Object.prototype.hasOwnProperty;var w=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),_i=(t,e)=>{for(var r in e)Oe(t,r,{get:e[r],enumerable:!0})},Dt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ai(e))!Mi.call(t,i)&&i!==r&&Oe(t,i,{get:()=>e[i],enumerable:!(n=Ni(e,i))||n.enumerable});return t};var Mt=(t,e,r)=>(r=t!=null?Fi(Di(t)):{},Dt(e||!t||!t.__esModule?Oe(r,"default",{value:t,enumerable:!0}):r,t)),Ri=t=>Dt(Oe({},"__esModule",{value:!0}),t);var $=w(tt=>{"use strict";tt.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{t.call(this,...e,(i,s)=>i!=null?n(i):r(s))})},"name",{value:t.name})};tt.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);t.apply(this,e.slice(0,-1)).then(n=>r(null,n),r)},"name",{value:t.name})}});var Rt=w((Oc,_t)=>{var Y=require("constants"),Ii=process.cwd,Ce=null,ji=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ce||(Ce=Ii.call(process)),Ce};try{process.cwd()}catch{}typeof process.chdir=="function"&&(rt=process.chdir,process.chdir=function(t){Ce=null,rt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,rt));var rt;_t.exports=Li;function Li(t){Y.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=c(t.stat),t.fstat=c(t.fstat),t.lstat=c(t.lstat),t.statSync=a(t.statSync),t.fstatSync=a(t.fstatSync),t.lstatSync=a(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,f,m){m&&process.nextTick(m)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,f,m,d){d&&process.nextTick(d)},t.lchownSync=function(){}),ji==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(u){function f(m,d,p){var E=Date.now(),l=0;u(m,d,function y(S){if(S&&(S.code==="EACCES"||S.code==="EPERM")&&Date.now()-E<6e4){setTimeout(function(){t.stat(d,function(O,ue){O&&O.code==="ENOENT"?u(m,d,y):p(S)})},l),l<100&&(l+=10);return}p&&p(S)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(u){function f(m,d,p,E,l,y){var S;if(y&&typeof y=="function"){var O=0;S=function(ue,Nt,At){if(ue&&ue.code==="EAGAIN"&&O<10)return O++,u.call(t,m,d,p,E,l,S);y.apply(this,arguments)}}return u.call(t,m,d,p,E,l,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(u){return function(f,m,d,p,E){for(var l=0;;)try{return u.call(t,f,m,d,p,E)}catch(y){if(y.code==="EAGAIN"&&l<10){l++;continue}throw y}}}(t.readSync);function e(u){u.lchmod=function(f,m,d){u.open(f,Y.O_WRONLY|Y.O_SYMLINK,m,function(p,E){if(p){d&&d(p);return}u.fchmod(E,m,function(l){u.close(E,function(y){d&&d(l||y)})})})},u.lchmodSync=function(f,m){var d=u.openSync(f,Y.O_WRONLY|Y.O_SYMLINK,m),p=!0,E;try{E=u.fchmodSync(d,m),p=!1}finally{if(p)try{u.closeSync(d)}catch{}else u.closeSync(d)}return E}}function r(u){Y.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(f,m,d,p){u.open(f,Y.O_SYMLINK,function(E,l){if(E){p&&p(E);return}u.futimes(l,m,d,function(y){u.close(l,function(S){p&&p(y||S)})})})},u.lutimesSync=function(f,m,d){var p=u.openSync(f,Y.O_SYMLINK),E,l=!0;try{E=u.futimesSync(p,m,d),l=!1}finally{if(l)try{u.closeSync(p)}catch{}else u.closeSync(p)}return E}):u.futimes&&(u.lutimes=function(f,m,d,p){p&&process.nextTick(p)},u.lutimesSync=function(){})}function n(u){return u&&function(f,m,d){return u.call(t,f,m,function(p){h(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(u){return u&&function(f,m){try{return u.call(t,f,m)}catch(d){if(!h(d))throw d}}}function s(u){return u&&function(f,m,d,p){return u.call(t,f,m,d,function(E){h(E)&&(E=null),p&&p.apply(this,arguments)})}}function o(u){return u&&function(f,m,d){try{return u.call(t,f,m,d)}catch(p){if(!h(p))throw p}}}function c(u){return u&&function(f,m,d){typeof m=="function"&&(d=m,m=null);function p(E,l){l&&(l.uid<0&&(l.uid+=4294967296),l.gid<0&&(l.gid+=4294967296)),d&&d.apply(this,arguments)}return m?u.call(t,f,m,p):u.call(t,f,p)}}function a(u){return u&&function(f,m){var d=m?u.call(t,f,m):u.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function h(u){if(!u||u.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Lt=w((Cc,jt)=>{var It=require("stream").Stream;jt.exports=$i;function $i(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);It.call(this);var s=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 o=Object.keys(i),c=0,a=o.length;c<a;c++){var h=o[c];this[h]=i[h]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(u,f){if(u){s.emit("error",u),s.readable=!1;return}s.fd=f,s.emit("open",f),s._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);It.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 s=Object.keys(i),o=0,c=s.length;o<c;o++){var a=s[o];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=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var bt=w((Wc,$t)=>{"use strict";$t.exports=Ji;var bi=Object.getPrototypeOf||function(t){return t.__proto__};function Ji(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:bi(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var R=w((Pc,st)=>{var W=require("fs"),Bi=Rt(),Gi=Lt(),Yi=bt(),We=require("util"),_,Fe;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_=Symbol.for("graceful-fs.queue"),Fe=Symbol.for("graceful-fs.previous")):(_="___graceful-fs.queue",Fe="___graceful-fs.previous");function zi(){}function Gt(t,e){Object.defineProperty(t,_,{get:function(){return e}})}var X=zi;We.debuglog?X=We.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(X=function(){var t=We.format.apply(We,arguments);t="GFS4: "+t.split(/\n/).join(`
GFS4: `),console.error(t)});W[_]||(Jt=global[_]||[],Gt(W,Jt),W.close=function(t){function e(r,n){return t.call(W,r,function(i){i||Bt(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Fe,{value:t}),e}(W.close),W.closeSync=function(t){function e(r){t.apply(W,arguments),Bt()}return Object.defineProperty(e,Fe,{value:t}),e}(W.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){X(W[_]),require("assert").equal(W[_].length,0)}));var Jt;global[_]||Gt(global,W[_]);st.exports=nt(Yi(W));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!W.__patched&&(st.exports=nt(W),W.__patched=!0);function nt(t){Bi(t),t.gracefulify=nt,t.createReadStream=Nt,t.createWriteStream=At;var e=t.readFile;t.readFile=r;function r(g,T,v){return typeof T=="function"&&(v=T,T=null),A(g,T,v);function A(D,F,C,P){return e(D,F,function(x){x&&(x.code==="EMFILE"||x.code==="ENFILE")?te([A,[D,F,C],x,P||Date.now(),Date.now()]):typeof C=="function"&&C.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(g,T,v,A){return typeof v=="function"&&(A=v,v=null),D(g,T,v,A);function D(F,C,P,x,M){return n(F,C,P,function(q){q&&(q.code==="EMFILE"||q.code==="ENFILE")?te([D,[F,C,P,x],q,M||Date.now(),Date.now()]):typeof x=="function"&&x.apply(this,arguments)})}}var s=t.appendFile;s&&(t.appendFile=o);function o(g,T,v,A){return typeof v=="function"&&(A=v,v=null),D(g,T,v,A);function D(F,C,P,x,M){return s(F,C,P,function(q){q&&(q.code==="EMFILE"||q.code==="ENFILE")?te([D,[F,C,P,x],q,M||Date.now(),Date.now()]):typeof x=="function"&&x.apply(this,arguments)})}}var c=t.copyFile;c&&(t.copyFile=a);function a(g,T,v,A){return typeof v=="function"&&(A=v,v=0),D(g,T,v,A);function D(F,C,P,x,M){return c(F,C,P,function(q){q&&(q.code==="EMFILE"||q.code==="ENFILE")?te([D,[F,C,P,x],q,M||Date.now(),Date.now()]):typeof x=="function"&&x.apply(this,arguments)})}}var h=t.readdir;t.readdir=f;var u=/^v[0-5]\./;function f(g,T,v){typeof T=="function"&&(v=T,T=null);var A=u.test(process.version)?function(C,P,x,M){return h(C,D(C,P,x,M))}:function(C,P,x,M){return h(C,P,D(C,P,x,M))};return A(g,T,v);function D(F,C,P,x){return function(M,q){M&&(M.code==="EMFILE"||M.code==="ENFILE")?te([A,[F,C,P],M,x||Date.now(),Date.now()]):(q&&q.sort&&q.sort(),typeof P=="function"&&P.call(this,M,q))}}}if(process.version.substr(0,4)==="v0.8"){var m=Gi(t);y=m.ReadStream,O=m.WriteStream}var d=t.ReadStream;d&&(y.prototype=Object.create(d.prototype),y.prototype.open=S);var p=t.WriteStream;p&&(O.prototype=Object.create(p.prototype),O.prototype.open=ue),Object.defineProperty(t,"ReadStream",{get:function(){return y},set:function(g){y=g},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return O},set:function(g){O=g},enumerable:!0,configurable:!0});var E=y;Object.defineProperty(t,"FileReadStream",{get:function(){return E},set:function(g){E=g},enumerable:!0,configurable:!0});var l=O;Object.defineProperty(t,"FileWriteStream",{get:function(){return l},set:function(g){l=g},enumerable:!0,configurable:!0});function y(g,T){return this instanceof y?(d.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}function S(){var g=this;et(g.path,g.flags,g.mode,function(T,v){T?(g.autoClose&&g.destroy(),g.emit("error",T)):(g.fd=v,g.emit("open",v),g.read())})}function O(g,T){return this instanceof O?(p.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}function ue(){var g=this;et(g.path,g.flags,g.mode,function(T,v){T?(g.destroy(),g.emit("error",T)):(g.fd=v,g.emit("open",v))})}function Nt(g,T){return new t.ReadStream(g,T)}function At(g,T){return new t.WriteStream(g,T)}var Pi=t.open;t.open=et;function et(g,T,v,A){return typeof v=="function"&&(A=v,v=null),D(g,T,v,A);function D(F,C,P,x,M){return Pi(F,C,P,function(q,kc){q&&(q.code==="EMFILE"||q.code==="ENFILE")?te([D,[F,C,P,x],q,M||Date.now(),Date.now()]):typeof x=="function"&&x.apply(this,arguments)})}}return t}function te(t){X("ENQUEUE",t[0].name,t[1]),W[_].push(t),it()}var Pe;function Bt(){for(var t=Date.now(),e=0;e<W[_].length;++e)W[_][e].length>2&&(W[_][e][3]=t,W[_][e][4]=t);it()}function it(){if(clearTimeout(Pe),Pe=void 0,W[_].length!==0){var t=W[_].shift(),e=t[0],r=t[1],n=t[2],i=t[3],s=t[4];if(i===void 0)X("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){X("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n)}else{var c=Date.now()-s,a=Math.max(s-i,1),h=Math.min(a*1.2,100);c>=h?(X("RETRY",e.name,r),e.apply(null,r.concat([i]))):W[_].push(t)}Pe===void 0&&(Pe=setTimeout(it,0))}}});var Q=w(z=>{"use strict";var Yt=$().fromCallback,b=R(),Ui=["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(t=>typeof b[t]=="function");Object.assign(z,b);Ui.forEach(t=>{z[t]=Yt(b[t])});z.exists=function(t,e){return typeof e=="function"?b.exists(t,e):new Promise(r=>b.exists(t,r))};z.read=function(t,e,r,n,i,s){return typeof s=="function"?b.read(t,e,r,n,i,s):new Promise((o,c)=>{b.read(t,e,r,n,i,(a,h,u)=>{if(a)return c(a);o({bytesRead:h,buffer:u})})})};z.write=function(t,e,...r){return typeof r[r.length-1]=="function"?b.write(t,e,...r):new Promise((n,i)=>{b.write(t,e,...r,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffer:c})})})};typeof b.writev=="function"&&(z.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?b.writev(t,e,...r):new Promise((n,i)=>{b.writev(t,e,...r,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffers:c})})})});typeof b.realpath.native=="function"?z.realpath.native=Yt(b.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var Ut=w((Nc,zt)=>{"use strict";var Ki=require("path");zt.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Ki.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}}});var Xt=w((Ac,ot)=>{"use strict";var Kt=Q(),{checkPath:Vt}=Ut(),Ht=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};ot.exports.makeDir=async(t,e)=>(Vt(t),Kt.mkdir(t,{mode:Ht(e),recursive:!0}));ot.exports.makeDirSync=(t,e)=>(Vt(t),Kt.mkdirSync(t,{mode:Ht(e),recursive:!0}))});var B=w((Dc,Qt)=>{"use strict";var Vi=$().fromPromise,{makeDir:Hi,makeDirSync:ct}=Xt(),at=Vi(Hi);Qt.exports={mkdirs:at,mkdirsSync:ct,mkdirp:at,mkdirpSync:ct,ensureDir:at,ensureDirSync:ct}});var U=w((Mc,er)=>{"use strict";var Xi=$().fromPromise,Zt=Q();function Qi(t){return Zt.access(t).then(()=>!0).catch(()=>!1)}er.exports={pathExists:Xi(Qi),pathExistsSync:Zt.existsSync}});var ut=w((_c,tr)=>{"use strict";var re=R();function Zi(t,e,r,n){re.open(t,"r+",(i,s)=>{if(i)return n(i);re.futimes(s,e,r,o=>{re.close(s,c=>{n&&n(o||c)})})})}function es(t,e,r){let n=re.openSync(t,"r+");return re.futimesSync(n,e,r),re.closeSync(n)}tr.exports={utimesMillis:Zi,utimesMillisSync:es}});var Z=w((Rc,ir)=>{"use strict";var ne=Q(),N=require("path"),ts=require("util");function rs(t,e,r){let n=r.dereference?i=>ne.stat(i,{bigint:!0}):i=>ne.lstat(i,{bigint:!0});return Promise.all([n(t),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}function ns(t,e,r){let n,i=r.dereference?o=>ne.statSync(o,{bigint:!0}):o=>ne.lstatSync(o,{bigint:!0}),s=i(t);try{n=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:n}}function is(t,e,r,n,i){ts.callbackify(rs)(t,e,n,(s,o)=>{if(s)return i(s);let{srcStat:c,destStat:a}=o;if(a){if(fe(c,a)){let h=N.basename(t),u=N.basename(e);return r==="move"&&h!==u&&h.toLowerCase()===u.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 '${e}' with directory '${t}'.`));if(!c.isDirectory()&&a.isDirectory())return i(new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`))}return c.isDirectory()&&ft(t,e)?i(new Error(Ne(t,e,r))):i(null,{srcStat:c,destStat:a})})}function ss(t,e,r,n){let{srcStat:i,destStat:s}=ns(t,e,n);if(s){if(fe(i,s)){let o=N.basename(t),c=N.basename(e);if(r==="move"&&o!==c&&o.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&ft(t,e))throw new Error(Ne(t,e,r));return{srcStat:i,destStat:s}}function rr(t,e,r,n,i){let s=N.resolve(N.dirname(t)),o=N.resolve(N.dirname(r));if(o===s||o===N.parse(o).root)return i();ne.stat(o,{bigint:!0},(c,a)=>c?c.code==="ENOENT"?i():i(c):fe(e,a)?i(new Error(Ne(t,r,n))):rr(t,e,o,n,i))}function nr(t,e,r,n){let i=N.resolve(N.dirname(t)),s=N.resolve(N.dirname(r));if(s===i||s===N.parse(s).root)return;let o;try{o=ne.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(fe(e,o))throw new Error(Ne(t,r,n));return nr(t,e,s,n)}function fe(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function ft(t,e){let r=N.resolve(t).split(N.sep).filter(i=>i),n=N.resolve(e).split(N.sep).filter(i=>i);return r.reduce((i,s,o)=>i&&n[o]===s,!0)}function Ne(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}ir.exports={checkPaths:is,checkPathsSync:ss,checkParentPaths:rr,checkParentPathsSync:nr,isSrcSubdir:ft,areIdentical:fe}});var lr=w((Ic,hr)=>{"use strict";var J=R(),he=require("path"),os=B().mkdirs,cs=U().pathExists,as=ut().utimesMillis,le=Z();function us(t,e,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"&&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"),le.checkPaths(t,e,"copy",r,(i,s)=>{if(i)return n(i);let{srcStat:o,destStat:c}=s;le.checkParentPaths(t,o,e,"copy",a=>a?n(a):r.filter?cr(sr,c,t,e,r,n):sr(c,t,e,r,n))})}function sr(t,e,r,n,i){let s=he.dirname(r);cs(s,(o,c)=>{if(o)return i(o);if(c)return Ae(t,e,r,n,i);os(s,a=>a?i(a):Ae(t,e,r,n,i))})}function cr(t,e,r,n,i,s){Promise.resolve(i.filter(r,n)).then(o=>o?t(e,r,n,i,s):s(),o=>s(o))}function fs(t,e,r,n,i){return n.filter?cr(Ae,t,e,r,n,i):Ae(t,e,r,n,i)}function Ae(t,e,r,n,i){(n.dereference?J.stat:J.lstat)(e,(o,c)=>o?i(o):c.isDirectory()?gs(c,t,e,r,n,i):c.isFile()||c.isCharacterDevice()||c.isBlockDevice()?hs(c,t,e,r,n,i):c.isSymbolicLink()?vs(t,e,r,n,i):c.isSocket()?i(new Error(`Cannot copy a socket file: ${e}`)):c.isFIFO()?i(new Error(`Cannot copy a FIFO pipe: ${e}`)):i(new Error(`Unknown file: ${e}`)))}function hs(t,e,r,n,i,s){return e?ls(t,r,n,i,s):ar(t,r,n,i,s)}function ls(t,e,r,n,i){if(n.overwrite)J.unlink(r,s=>s?i(s):ar(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function ar(t,e,r,n,i){J.copyFile(e,r,s=>s?i(s):n.preserveTimestamps?ds(t.mode,e,r,i):De(r,t.mode,i))}function ds(t,e,r,n){return ms(t)?ys(r,t,i=>i?n(i):or(t,e,r,n)):or(t,e,r,n)}function ms(t){return(t&128)===0}function ys(t,e,r){return De(t,e|128,r)}function or(t,e,r,n){ps(e,r,i=>i?n(i):De(r,t,n))}function De(t,e,r){return J.chmod(t,e,r)}function ps(t,e,r){J.stat(t,(n,i)=>n?r(n):as(e,i.atime,i.mtime,r))}function gs(t,e,r,n,i,s){return e?ur(r,n,i,s):ws(t.mode,r,n,i,s)}function ws(t,e,r,n,i){J.mkdir(r,s=>{if(s)return i(s);ur(e,r,n,o=>o?i(o):De(r,t,i))})}function ur(t,e,r,n){J.readdir(t,(i,s)=>i?n(i):fr(s,t,e,r,n))}function fr(t,e,r,n,i){let s=t.pop();return s?Ss(t,s,e,r,n,i):i()}function Ss(t,e,r,n,i,s){let o=he.join(r,e),c=he.join(n,e);le.checkPaths(o,c,"copy",i,(a,h)=>{if(a)return s(a);let{destStat:u}=h;fs(u,o,c,i,f=>f?s(f):fr(t,r,n,i,s))})}function vs(t,e,r,n,i){J.readlink(e,(s,o)=>{if(s)return i(s);if(n.dereference&&(o=he.resolve(process.cwd(),o)),t)J.readlink(r,(c,a)=>c?c.code==="EINVAL"||c.code==="UNKNOWN"?J.symlink(o,r,i):i(c):(n.dereference&&(a=he.resolve(process.cwd(),a)),le.isSrcSubdir(o,a)?i(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${a}'.`)):t.isDirectory()&&le.isSrcSubdir(a,o)?i(new Error(`Cannot overwrite '${a}' with '${o}'.`)):Es(o,r,i)));else return J.symlink(o,r,i)})}function Es(t,e,r){J.unlink(e,n=>n?r(n):J.symlink(t,e,r))}hr.exports=us});var gr=w((jc,pr)=>{"use strict";var I=R(),de=require("path"),Ts=B().mkdirsSync,ks=ut().utimesMillisSync,me=Z();function xs(t,e,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"&&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");let{srcStat:n,destStat:i}=me.checkPathsSync(t,e,"copy",r);return me.checkParentPathsSync(t,n,e,"copy"),qs(i,t,e,r)}function qs(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=de.dirname(r);return I.existsSync(i)||Ts(i),dr(t,e,r,n)}function Os(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return dr(t,e,r,n)}function dr(t,e,r,n){let s=(n.dereference?I.statSync:I.lstatSync)(e);if(s.isDirectory())return Ds(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Cs(s,t,e,r,n);if(s.isSymbolicLink())return Rs(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function Cs(t,e,r,n,i){return e?Ws(t,r,n,i):mr(t,r,n,i)}function Ws(t,e,r,n){if(n.overwrite)return I.unlinkSync(r),mr(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function mr(t,e,r,n){return I.copyFileSync(e,r),n.preserveTimestamps&&Ps(t.mode,e,r),ht(r,t.mode)}function Ps(t,e,r){return Fs(t)&&Ns(r,t),As(e,r)}function Fs(t){return(t&128)===0}function Ns(t,e){return ht(t,e|128)}function ht(t,e){return I.chmodSync(t,e)}function As(t,e){let r=I.statSync(t);return ks(e,r.atime,r.mtime)}function Ds(t,e,r,n,i){return e?yr(r,n,i):Ms(t.mode,r,n,i)}function Ms(t,e,r,n){return I.mkdirSync(r),yr(e,r,n),ht(r,t)}function yr(t,e,r){I.readdirSync(t).forEach(n=>_s(n,t,e,r))}function _s(t,e,r,n){let i=de.join(e,t),s=de.join(r,t),{destStat:o}=me.checkPathsSync(i,s,"copy",n);return Os(o,i,s,n)}function Rs(t,e,r,n){let i=I.readlinkSync(e);if(n.dereference&&(i=de.resolve(process.cwd(),i)),t){let s;try{s=I.readlinkSync(r)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return I.symlinkSync(i,r);throw o}if(n.dereference&&(s=de.resolve(process.cwd(),s)),me.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(I.statSync(r).isDirectory()&&me.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return Is(i,r)}else return I.symlinkSync(i,r)}function Is(t,e){return I.unlinkSync(e),I.symlinkSync(t,e)}pr.exports=xs});var Me=w((Lc,wr)=>{"use strict";var js=$().fromCallback;wr.exports={copy:js(lr()),copySync:gr()}});var Cr=w(($c,Or)=>{"use strict";var Sr=R(),kr=require("path"),k=require("assert"),ye=process.platform==="win32";function xr(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||Sr[r],r=r+"Sync",t[r]=t[r]||Sr[r]}),t.maxBusyTries=t.maxBusyTries||3}function lt(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),k(t,"rimraf: missing path"),k.strictEqual(typeof t,"string","rimraf: path should be a string"),k.strictEqual(typeof r,"function","rimraf: callback function required"),k(e,"rimraf: invalid options argument provided"),k.strictEqual(typeof e,"object","rimraf: options should be object"),xr(e),vr(t,e,function i(s){if(s){if((s.code==="EBUSY"||s.code==="ENOTEMPTY"||s.code==="EPERM")&&n<e.maxBusyTries){n++;let o=n*100;return setTimeout(()=>vr(t,e,i),o)}s.code==="ENOENT"&&(s=null)}r(s)})}function vr(t,e,r){k(t),k(e),k(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&ye)return Er(t,e,n,r);if(i&&i.isDirectory())return _e(t,e,n,r);e.unlink(t,s=>{if(s){if(s.code==="ENOENT")return r(null);if(s.code==="EPERM")return ye?Er(t,e,s,r):_e(t,e,s,r);if(s.code==="EISDIR")return _e(t,e,s,r)}return r(s)})})}function Er(t,e,r,n){k(t),k(e),k(typeof n=="function"),e.chmod(t,438,i=>{i?n(i.code==="ENOENT"?null:r):e.stat(t,(s,o)=>{s?n(s.code==="ENOENT"?null:r):o.isDirectory()?_e(t,e,r,n):e.unlink(t,n)})})}function Tr(t,e,r){let n;k(t),k(e);try{e.chmodSync(t,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?Re(t,e,r):e.unlinkSync(t)}function _e(t,e,r,n){k(t),k(e),k(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?Ls(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function Ls(t,e,r){k(t),k(e),k(typeof r=="function"),e.readdir(t,(n,i)=>{if(n)return r(n);let s=i.length,o;if(s===0)return e.rmdir(t,r);i.forEach(c=>{lt(kr.join(t,c),e,a=>{if(!o){if(a)return r(o=a);--s===0&&e.rmdir(t,r)}})})})}function qr(t,e){let r;e=e||{},xr(e),k(t,"rimraf: missing path"),k.strictEqual(typeof t,"string","rimraf: path should be a string"),k(e,"rimraf: missing options"),k.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&ye&&Tr(t,e,n)}try{r&&r.isDirectory()?Re(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return ye?Tr(t,e,n):Re(t,e,n);if(n.code!=="EISDIR")throw n;Re(t,e,n)}}function Re(t,e,r){k(t),k(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")$s(t,e);else if(n.code!=="ENOENT")throw n}}function $s(t,e){if(k(t),k(e),e.readdirSync(t).forEach(r=>qr(kr.join(t,r),e)),ye){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}Or.exports=lt;lt.sync=qr});var pe=w((bc,Pr)=>{"use strict";var Ie=R(),bs=$().fromCallback,Wr=Cr();function Js(t,e){if(Ie.rm)return Ie.rm(t,{recursive:!0,force:!0},e);Wr(t,e)}function Bs(t){if(Ie.rmSync)return Ie.rmSync(t,{recursive:!0,force:!0});Wr.sync(t)}Pr.exports={remove:bs(Js),removeSync:Bs}});var Ir=w((Jc,Rr)=>{"use strict";var Gs=$().fromPromise,Ar=Q(),Dr=require("path"),Mr=B(),_r=pe(),Fr=Gs(async function(e){let r;try{r=await Ar.readdir(e)}catch{return Mr.mkdirs(e)}return Promise.all(r.map(n=>_r.remove(Dr.join(e,n))))});function Nr(t){let e;try{e=Ar.readdirSync(t)}catch{return Mr.mkdirsSync(t)}e.forEach(r=>{r=Dr.join(t,r),_r.removeSync(r)})}Rr.exports={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:Fr,emptydir:Fr}});var br=w((Bc,$r)=>{"use strict";var Ys=$().fromCallback,jr=require("path"),K=R(),Lr=B();function zs(t,e){function r(){K.writeFile(t,"",n=>{if(n)return e(n);e()})}K.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let s=jr.dirname(t);K.stat(s,(o,c)=>{if(o)return o.code==="ENOENT"?Lr.mkdirs(s,a=>{if(a)return e(a);r()}):e(o);c.isDirectory()?r():K.readdir(s,a=>{if(a)return e(a)})})})}function Us(t){let e;try{e=K.statSync(t)}catch{}if(e&&e.isFile())return;let r=jr.dirname(t);try{K.statSync(r).isDirectory()||K.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")Lr.mkdirsSync(r);else throw n}K.writeFileSync(t,"")}$r.exports={createFile:Ys(zs),createFileSync:Us}});var zr=w((Gc,Yr)=>{"use strict";var Ks=$().fromCallback,Jr=require("path"),V=R(),Br=B(),Vs=U().pathExists,{areIdentical:Gr}=Z();function Hs(t,e,r){function n(i,s){V.link(i,s,o=>{if(o)return r(o);r(null)})}V.lstat(e,(i,s)=>{V.lstat(t,(o,c)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);if(s&&Gr(c,s))return r(null);let a=Jr.dirname(e);Vs(a,(h,u)=>{if(h)return r(h);if(u)return n(t,e);Br.mkdirs(a,f=>{if(f)return r(f);n(t,e)})})})})}function Xs(t,e){let r;try{r=V.lstatSync(e)}catch{}try{let s=V.lstatSync(t);if(r&&Gr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=Jr.dirname(e);return V.existsSync(n)||Br.mkdirsSync(n),V.linkSync(t,e)}Yr.exports={createLink:Ks(Hs),createLinkSync:Xs}});var Kr=w((Yc,Ur)=>{"use strict";var H=require("path"),ge=R(),Qs=U().pathExists;function Zs(t,e,r){if(H.isAbsolute(t))return ge.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=H.dirname(e),i=H.join(n,t);return Qs(i,(s,o)=>s?r(s):o?r(null,{toCwd:i,toDst:t}):ge.lstat(t,c=>c?(c.message=c.message.replace("lstat","ensureSymlink"),r(c)):r(null,{toCwd:t,toDst:H.relative(n,t)})))}}function eo(t,e){let r;if(H.isAbsolute(t)){if(r=ge.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=H.dirname(e),i=H.join(n,t);if(r=ge.existsSync(i),r)return{toCwd:i,toDst:t};if(r=ge.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:H.relative(n,t)}}}Ur.exports={symlinkPaths:Zs,symlinkPathsSync:eo}});var Xr=w((zc,Hr)=>{"use strict";var Vr=R();function to(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);Vr.lstat(t,(n,i)=>{if(n)return r(null,"file");e=i&&i.isDirectory()?"dir":"file",r(null,e)})}function ro(t,e){let r;if(e)return e;try{r=Vr.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}Hr.exports={symlinkType:to,symlinkTypeSync:ro}});var on=w((Uc,sn)=>{"use strict";var no=$().fromCallback,Zr=require("path"),G=Q(),en=B(),io=en.mkdirs,so=en.mkdirsSync,tn=Kr(),oo=tn.symlinkPaths,co=tn.symlinkPathsSync,rn=Xr(),ao=rn.symlinkType,uo=rn.symlinkTypeSync,fo=U().pathExists,{areIdentical:nn}=Z();function ho(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,G.lstat(e,(i,s)=>{!i&&s.isSymbolicLink()?Promise.all([G.stat(t),G.stat(e)]).then(([o,c])=>{if(nn(o,c))return n(null);Qr(t,e,r,n)}):Qr(t,e,r,n)})}function Qr(t,e,r,n){oo(t,e,(i,s)=>{if(i)return n(i);t=s.toDst,ao(s.toCwd,r,(o,c)=>{if(o)return n(o);let a=Zr.dirname(e);fo(a,(h,u)=>{if(h)return n(h);if(u)return G.symlink(t,e,c,n);io(a,f=>{if(f)return n(f);G.symlink(t,e,c,n)})})})})}function lo(t,e,r){let n;try{n=G.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let c=G.statSync(t),a=G.statSync(e);if(nn(c,a))return}let i=co(t,e);t=i.toDst,r=uo(i.toCwd,r);let s=Zr.dirname(e);return G.existsSync(s)||so(s),G.symlinkSync(t,e,r)}sn.exports={createSymlink:no(ho),createSymlinkSync:lo}});var mn=w((Kc,dn)=>{"use strict";var{createFile:cn,createFileSync:an}=br(),{createLink:un,createLinkSync:fn}=zr(),{createSymlink:hn,createSymlinkSync:ln}=on();dn.exports={createFile:cn,createFileSync:an,ensureFile:cn,ensureFileSync:an,createLink:un,createLinkSync:fn,ensureLink:un,ensureLinkSync:fn,createSymlink:hn,createSymlinkSync:ln,ensureSymlink:hn,ensureSymlinkSync:ln}});var je=w((Vc,yn)=>{function mo(t,{EOL:e=`
`,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let s=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+s}function yo(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}yn.exports={stringify:mo,stripBom:yo}});var Sn=w((Hc,wn)=>{var ie;try{ie=R()}catch{ie=require("fs")}var Le=$(),{stringify:pn,stripBom:gn}=je();async function po(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||ie,n="throws"in e?e.throws:!0,i=await Le.fromCallback(r.readFile)(t,e);i=gn(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}return s}var go=Le.fromPromise(po);function wo(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||ie,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=gn(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function So(t,e,r={}){let n=r.fs||ie,i=pn(e,r);await Le.fromCallback(n.writeFile)(t,i,r)}var vo=Le.fromPromise(So);function Eo(t,e,r={}){let n=r.fs||ie,i=pn(e,r);return n.writeFileSync(t,i,r)}var To={readFile:go,readFileSync:wo,writeFile:vo,writeFileSync:Eo};wn.exports=To});var En=w((Xc,vn)=>{"use strict";var $e=Sn();vn.exports={readJson:$e.readFile,readJsonSync:$e.readFileSync,writeJson:$e.writeFile,writeJsonSync:$e.writeFileSync}});var be=w((Qc,xn)=>{"use strict";var ko=$().fromCallback,we=R(),Tn=require("path"),kn=B(),xo=U().pathExists;function qo(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=Tn.dirname(t);xo(i,(s,o)=>{if(s)return n(s);if(o)return we.writeFile(t,e,r,n);kn.mkdirs(i,c=>{if(c)return n(c);we.writeFile(t,e,r,n)})})}function Oo(t,...e){let r=Tn.dirname(t);if(we.existsSync(r))return we.writeFileSync(t,...e);kn.mkdirsSync(r),we.writeFileSync(t,...e)}xn.exports={outputFile:ko(qo),outputFileSync:Oo}});var On=w((Zc,qn)=>{"use strict";var{stringify:Co}=je(),{outputFile:Wo}=be();async function Po(t,e,r={}){let n=Co(e,r);await Wo(t,n,r)}qn.exports=Po});var Wn=w((ea,Cn)=>{"use strict";var{stringify:Fo}=je(),{outputFileSync:No}=be();function Ao(t,e,r){let n=Fo(e,r);No(t,n,r)}Cn.exports=Ao});var Fn=w((ta,Pn)=>{"use strict";var Do=$().fromPromise,j=En();j.outputJson=Do(On());j.outputJsonSync=Wn();j.outputJSON=j.outputJson;j.outputJSONSync=j.outputJsonSync;j.writeJSON=j.writeJson;j.writeJSONSync=j.writeJsonSync;j.readJSON=j.readJson;j.readJSONSync=j.readJsonSync;Pn.exports=j});var _n=w((ra,Mn)=>{"use strict";var Mo=R(),mt=require("path"),_o=Me().copy,Dn=pe().remove,Ro=B().mkdirp,Io=U().pathExists,Nn=Z();function jo(t,e,r,n){typeof r=="function"&&(n=r,r={}),r=r||{};let i=r.overwrite||r.clobber||!1;Nn.checkPaths(t,e,"move",r,(s,o)=>{if(s)return n(s);let{srcStat:c,isChangingCase:a=!1}=o;Nn.checkParentPaths(t,c,e,"move",h=>{if(h)return n(h);if(Lo(e))return An(t,e,i,a,n);Ro(mt.dirname(e),u=>u?n(u):An(t,e,i,a,n))})})}function Lo(t){let e=mt.dirname(t);return mt.parse(e).root===e}function An(t,e,r,n,i){if(n)return dt(t,e,r,i);if(r)return Dn(e,s=>s?i(s):dt(t,e,r,i));Io(e,(s,o)=>s?i(s):o?i(new Error("dest already exists.")):dt(t,e,r,i))}function dt(t,e,r,n){Mo.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):$o(t,e,r,n):n())}function $o(t,e,r,n){_o(t,e,{overwrite:r,errorOnExist:!0},s=>s?n(s):Dn(t,n))}Mn.exports=jo});var $n=w((na,Ln)=>{"use strict";var In=R(),pt=require("path"),bo=Me().copySync,jn=pe().removeSync,Jo=B().mkdirpSync,Rn=Z();function Bo(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:s=!1}=Rn.checkPathsSync(t,e,"move",r);return Rn.checkParentPathsSync(t,i,e,"move"),Go(e)||Jo(pt.dirname(e)),Yo(t,e,n,s)}function Go(t){let e=pt.dirname(t);return pt.parse(e).root===e}function Yo(t,e,r,n){if(n)return yt(t,e,r);if(r)return jn(e),yt(t,e,r);if(In.existsSync(e))throw new Error("dest already exists.");return yt(t,e,r)}function yt(t,e,r){try{In.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return zo(t,e,r)}}function zo(t,e,r){return bo(t,e,{overwrite:r,errorOnExist:!0}),jn(t)}Ln.exports=Bo});var Jn=w((ia,bn)=>{"use strict";var Uo=$().fromCallback;bn.exports={move:Uo(_n()),moveSync:$n()}});var Gn=w((sa,Bn)=>{"use strict";Bn.exports={...Q(),...Me(),...Ir(),...mn(),...Fn(),...B(),...Jn(),...be(),...U(),...pe()}});var ei=w((ga,Zn)=>{"use strict";var ec=require("path");Zn.exports=(t,e)=>{let r=new Map;for(let[s,o]of t)r.set(s,{filePath:s,parent:void 0,children:void 0,entries:1,active:!0,value:o});let n=r.size;for(let s of r.values()){let o=ec.dirname(s.filePath);if(o!==s.filePath){let c=r.get(o);if(c===void 0)c={filePath:o,parent:void 0,children:[s],entries:s.entries,active:!1,value:void 0},r.set(o,c),s.parent=c;else{s.parent=c,c.children===void 0?c.children=[s]:c.children.push(s);do c.entries+=s.entries,c=c.parent;while(c)}}}for(;n>e;){let s=n-e,o,c=1/0;for(let f of r.values()){if(f.entries<=1||!f.children||!f.parent||f.children.length===0||f.children.length===1&&!f.value)continue;let m=f.entries-1>=s?f.entries-1-s:s-f.entries+1+e*.3;m<c&&(o=f,c=m)}if(!o)break;let a=o.entries-1;o.active=!0,o.entries=1,n-=a;let h=o.parent;for(;h;)h.entries-=a,h=h.parent;let u=new Set(o.children);for(let f of u)if(f.active=!1,f.entries=0,f.children)for(let m of f.children)u.add(m)}let i=new Map;for(let s of r.values()){if(!s.active)continue;let o=new Map,c=new Set([s]);for(let a of c)if(!(a.active&&a!==s)){if(a.value)if(Array.isArray(a.value))for(let h of a.value)o.set(h,a.filePath);else o.set(a.value,a.filePath);if(a.children)for(let h of a.children)c.add(h)}i.set(s.filePath,o)}return i}});var Tt=w(Ye=>{"use strict";var ri=require("fs"),Ge=require("path"),{EventEmitter:tc}=require("events"),rc=ei(),ni=require("os").platform()==="darwin",nc=require("os").platform()==="win32",ic=ni||nc,ti=+process.env.WATCHPACK_WATCHER_LIMIT||(ni?2e3:1e4),Be=!!process.env.WATCHPACK_RECURSIVE_WATCHER_LOGGING,wt=!1,oe=0,Se=new Map,ve=new Map,Ee=new Map,ee=new Map,St=class{constructor(e){this.filePath=e,this.watchers=new Set,this.watcher=void 0;try{let r=ri.watch(e);this.watcher=r,r.on("change",(n,i)=>{for(let s of this.watchers)s.emit("change",n,i)}),r.on("error",n=>{for(let i of this.watchers)i.emit("error",n)})}catch(r){process.nextTick(()=>{for(let n of this.watchers)n.emit("error",r)})}oe++}add(e){ee.set(e,this),this.watchers.add(e)}remove(e){this.watchers.delete(e),this.watchers.size===0&&(Ee.delete(this.filePath),oe--,this.watcher&&this.watcher.close())}getWatchers(){return this.watchers}},vt=class{constructor(e){this.rootPath=e,this.mapWatcherToPath=new Map,this.mapPathToWatchers=new Map,this.watcher=void 0;try{let r=ri.watch(e,{recursive:!0});this.watcher=r,r.on("change",(n,i)=>{if(i){let s=Ge.dirname(i),o=this.mapPathToWatchers.get(s);if(Be&&process.stderr.write(`[watchpack] dispatch ${n} event in recursive watcher (${this.rootPath}) for '${i}' to ${o?o.size:0} watchers
`),o===void 0)return;for(let c of o)c.emit("change",n,Ge.basename(i))}else{Be&&process.stderr.write(`[watchpack] dispatch ${n} event in recursive watcher (${this.rootPath}) to all watchers
`);for(let s of this.mapWatcherToPath.keys())s.emit("change",n)}}),r.on("error",n=>{for(let i of this.mapWatcherToPath.keys())i.emit("error",n)})}catch(r){process.nextTick(()=>{for(let n of this.mapWatcherToPath.keys())n.emit("error",r)})}oe++,Be&&process.stderr.write(`[watchpack] created recursive watcher at ${e}
`)}add(e,r){ee.set(r,this);let n=e.slice(this.rootPath.length+1)||".";this.mapWatcherToPath.set(r,n);let i=this.mapPathToWatchers.get(n);if(i===void 0){let s=new Set;s.add(r),this.mapPathToWatchers.set(n,s)}else i.add(r)}remove(e){let r=this.mapWatcherToPath.get(e);if(!r)return;this.mapWatcherToPath.delete(e);let n=this.mapPathToWatchers.get(r);n.delete(e),n.size===0&&this.mapPathToWatchers.delete(r),this.mapWatcherToPath.size===0&&(ve.delete(this.rootPath),oe--,this.watcher&&this.watcher.close(),Be&&process.stderr.write(`[watchpack] closed recursive watcher at ${this.rootPath}
`))}getWatchers(){return this.mapWatcherToPath}},Et=class extends tc{close(){if(Se.has(this)){Se.delete(this);return}ee.get(this).remove(this),ee.delete(this)}},gt=t=>{let e=Ee.get(t);if(e!==void 0)return e;let r=new St(t);return Ee.set(t,r),r},sc=t=>{let e=ve.get(t);if(e!==void 0)return e;let r=new vt(t);return ve.set(t,r),r},ii=()=>{let t=new Map,e=(n,i)=>{let s=t.get(i);s===void 0?t.set(i,n):Array.isArray(s)?s.push(n):t.set(i,[s,n])};for(let[n,i]of Se)e(n,i);if(Se.clear(),!ic||ti-oe>=t.size){for(let[n,i]of t){let s=gt(n);if(Array.isArray(i))for(let o of i)s.add(o);else s.add(i)}return}for(let n of ve.values())for(let[i,s]of n.getWatchers())e(i,Ge.join(n.rootPath,s));for(let n of Ee.values())for(let i of n.getWatchers())e(i,n.filePath);let r=rc(t,ti*.9);for(let[n,i]of r)if(i.size===1)for(let[s,o]of i){let c=gt(o),a=ee.get(s);a!==c&&(c.add(s),a!==void 0&&a.remove(s))}else{let s=new Set(i.values());if(s.size>1){let o=sc(n);for(let[c,a]of i){let h=ee.get(c);h!==o&&(o.add(a,c),h!==void 0&&h.remove(c))}}else for(let o of s){let c=gt(o);for(let a of i.keys()){let h=ee.get(a);h!==c&&(c.add(a),h!==void 0&&h.remove(a))}}}};Ye.watch=t=>{let e=new Et,r=Ee.get(t);if(r!==void 0)return r.add(e),e;let n=t;for(;;){let i=ve.get(n);if(i!==void 0)return i.add(t,e),e;let s=Ge.dirname(n);if(s===n)break;n=s}return Se.set(e,t),wt||ii(),e};Ye.batch=t=>{wt=!0;try{t()}finally{wt=!1,ii()}};Ye.getNumberOfWatchers=()=>oe});var ui=w((Sa,qt)=>{"use strict";var ai=require("events").EventEmitter,ze=R(),Te=require("path"),oc=Tt(),ae=Object.freeze({}),L=2e3,si=require("os").platform()==="darwin",ke=process.env.WATCHPACK_POLLING,oi=`${+ke}`===ke?+ke:!!ke&&ke!=="false";function ce(t){return t.toLowerCase()}function cc(t,e){return function(){if(--t===0)return e()}}var kt=class extends ai{constructor(e,r,n){super(),this.directoryWatcher=e,this.path=r,this.startTime=n&&+n}checkStartTime(e,r){let n=this.startTime;return typeof n!="number"?!r:n<=e}close(){this.emit("closed")}},xt=class extends ai{constructor(e,r,n){super(),oi&&(n.poll=oi),this.watcherManager=e,this.options=n,this.path=r,this.files=new Map,this.filesWithoutCase=new Map,this.directories=new Map,this.lastWatchEvent=0,this.initialScan=!0,this.ignored=n.ignored||(()=>!1),this.nestedWatching=!1,this.polledWatching=typeof n.poll=="number"?n.poll:n.poll?5007:!1,this.timeout=void 0,this.initialScanRemoved=new Set,this.initialScanFinished=void 0,this.watchers=new Map,this.parentWatcher=null,this.refs=0,this._activeEvents=new Map,this.closed=!1,this.scanning=!1,this.scanAgain=!1,this.scanAgainInitial=!1,this.createWatcher(),this.doScan(!0)}createWatcher(){try{this.polledWatching?this.watcher={close:()=>{this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)}}:(si&&this.watchInParentDirectory(),this.watcher=oc.watch(this.path),this.watcher.on("change",this.onWatchEvent.bind(this)),this.watcher.on("error",this.onWatcherError.bind(this)))}catch(e){this.onWatcherError(e)}}forEachWatcher(e,r){let n=this.watchers.get(ce(e));if(n!==void 0)for(let i of n)r(i)}setMissing(e,r,n){this.initialScan&&this.initialScanRemoved.add(e);let i=this.directories.get(e);if(i&&(this.nestedWatching&&i.close(),this.directories.delete(e),this.forEachWatcher(e,o=>o.emit("remove",n)),r||this.forEachWatcher(this.path,o=>o.emit("change",e,null,n,r))),this.files.get(e)){this.files.delete(e);let o=ce(e),c=this.filesWithoutCase.get(o)-1;c<=0?(this.filesWithoutCase.delete(o),this.forEachWatcher(e,a=>a.emit("remove",n))):this.filesWithoutCase.set(o,c),r||this.forEachWatcher(this.path,a=>a.emit("change",e,null,n,r))}}setFileTime(e,r,n,i,s){let o=Date.now();if(this.ignored(e))return;let c=this.files.get(e),a,h;if(n)a=Math.min(o,r)+L,h=L;else if(a=o,h=0,c&&c.timestamp===r&&r+L<o)return;if(!(i&&c&&c.timestamp===r)){if(this.files.set(e,{safeTime:a,accuracy:h,timestamp:r}),c)n||this.forEachWatcher(e,u=>u.emit("change",r,s));else{let u=ce(e),f=this.filesWithoutCase.get(u);this.filesWithoutCase.set(u,(f||0)+1),f!==void 0&&this.doScan(!1),this.forEachWatcher(e,m=>{(!n||m.checkStartTime(a,n))&&m.emit("change",r,s)})}this.forEachWatcher(this.path,u=>{(!n||u.checkStartTime(a,n))&&u.emit("change",e,a,s,n)})}}setDirectory(e,r,n,i){if(!this.ignored(e)){if(e===this.path)n||this.forEachWatcher(this.path,s=>s.emit("change",e,r,i,n));else if(!this.directories.get(e)){let o=Date.now();this.nestedWatching?this.createNestedWatcher(e):this.directories.set(e,!0);let c;n?c=Math.min(o,r)+L:c=o,this.forEachWatcher(e,a=>{(!n||a.checkStartTime(c,!1))&&a.emit("change",r,i)}),this.forEachWatcher(this.path,a=>{(!n||a.checkStartTime(c,n))&&a.emit("change",e,c,i,n)})}}}createNestedWatcher(e){let r=this.watcherManager.watchDirectory(e,1);r.on("change",(n,i,s,o)=>{this.forEachWatcher(this.path,c=>{(!o||c.checkStartTime(i,o))&&c.emit("change",n,i,s,o)})}),this.directories.set(e,r)}setNestedWatching(e){if(this.nestedWatching!==!!e)if(this.nestedWatching=!!e,this.nestedWatching)for(let r of this.directories.keys())this.createNestedWatcher(r);else for(let[r,n]of this.directories)n.close(),this.directories.set(r,!0)}watch(e,r){let n=ce(e),i=this.watchers.get(n);i===void 0&&(i=new Set,this.watchers.set(n,i)),this.refs++;let s=new kt(this,e,r);s.on("closed",()=>{if(--this.refs<=0){this.close();return}i.delete(s),i.size===0&&(this.watchers.delete(n),this.path===e&&this.setNestedWatching(!1))}),i.add(s);let o;if(e===this.path){this.setNestedWatching(!0),o=this.lastWatchEvent;for(let c of this.files.values())Ue(c),o=Math.max(o,c.safeTime)}else{let c=this.files.get(e);c?(Ue(c),o=c.safeTime):o=0}return o?o>=r&&process.nextTick(()=>{this.closed||(e===this.path?s.emit("change",e,o,"watch (outdated on attach)",!0):s.emit("change",o,"watch (outdated on attach)",!0))}):this.initialScan?this.initialScanRemoved.has(e)&&process.nextTick(()=>{this.closed||s.emit("remove")}):!this.directories.has(e)&&s.checkStartTime(this.initialScanFinished,!1)&&process.nextTick(()=>{this.closed||s.emit("initial-missing","watch (missing on attach)")}),s}onWatchEvent(e,r){if(this.closed)return;if(!r){this.doScan(!1);return}let n=Te.join(this.path,r);if(!this.ignored(n))if(this._activeEvents.get(r)===void 0){this._activeEvents.set(r,!1);let i=()=>{this.closed||(this._activeEvents.set(r,!1),ze.lstat(n,(s,o)=>{if(!this.closed){if(this._activeEvents.get(r)===!0){process.nextTick(i);return}this._activeEvents.delete(r),s&&(s.code!=="ENOENT"&&s.code!=="EPERM"&&s.code!=="EBUSY"?this.onStatsError(s):r===Te.basename(this.path)&&(ze.existsSync(this.path)||this.onDirectoryRemoved("stat failed"))),this.lastWatchEvent=Date.now(),o?o.isDirectory()?this.setDirectory(n,+o.birthtime||1,!1,e):(o.isFile()||o.isSymbolicLink())&&(o.mtime&&ci(o.mtime),this.setFileTime(n,+o.mtime||+o.ctime||1,!1,!1,e)):this.setMissing(n,!1,e)}}))};process.nextTick(i)}else this._activeEvents.set(r,!0)}onWatcherError(e){this.closed||e&&(e.code!=="EPERM"&&e.code!=="ENOENT"&&console.error("Watchpack Error (watcher): "+e),this.onDirectoryRemoved("watch error"))}onStatsError(e){e&&console.error("Watchpack Error (stats): "+e)}onScanError(e){e&&console.error("Watchpack Error (initial scan): "+e),this.onScanFinished()}onScanFinished(){this.polledWatching&&(this.timeout=setTimeout(()=>{this.closed||this.doScan(!1)},this.polledWatching))}onDirectoryRemoved(e){this.watcher&&(this.watcher.close(),this.watcher=null),this.watchInParentDirectory();let r=`directory-removed (${e})`;for(let n of this.directories.keys())this.setMissing(n,null,r);for(let n of this.files.keys())this.setMissing(n,null,r)}watchInParentDirectory(){if(!this.parentWatcher){let e=Te.dirname(this.path);if(Te.dirname(e)===e)return;this.parentWatcher=this.watcherManager.watchFile(this.path,1),this.parentWatcher.on("change",(r,n)=>{this.closed||((!si||this.polledWatching)&&this.parentWatcher&&(this.parentWatcher.close(),this.parentWatcher=null),this.watcher||(this.createWatcher(),this.doScan(!1),this.forEachWatcher(this.path,i=>i.emit("change",this.path,r,n,!1))))}),this.parentWatcher.on("remove",()=>{this.onDirectoryRemoved("parent directory removed")})}}doScan(e){if(this.scanning){this.scanAgain?e||(this.scanAgainInitial=!1):(this.scanAgain=!0,this.scanAgainInitial=e);return}this.scanning=!0,this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0),process.nextTick(()=>{this.closed||ze.readdir(this.path,(r,n)=>{if(this.closed)return;if(r){if(r.code==="ENOENT"||r.code==="EPERM"?this.onDirectoryRemoved("scan readdir failed"):this.onScanError(r),this.initialScan=!1,this.initialScanFinished=Date.now(),e)for(let o of this.watchers.values())for(let c of o)c.checkStartTime(this.initialScanFinished,!1)&&c.emit("initial-missing","scan (parent directory missing in initial scan)");this.scanAgain?(this.scanAgain=!1,this.doScan(this.scanAgainInitial)):this.scanning=!1;return}let i=new Set(n.map(o=>Te.join(this.path,o.normalize("NFC"))));for(let o of this.files.keys())i.has(o)||this.setMissing(o,e,"scan (missing)");for(let o of this.directories.keys())i.has(o)||this.setMissing(o,e,"scan (missing)");if(this.scanAgain){this.scanAgain=!1,this.doScan(e);return}let s=cc(i.size+1,()=>{if(!this.closed){if(this.initialScan=!1,this.initialScanRemoved=null,this.initialScanFinished=Date.now(),e){let o=new Map(this.watchers);o.delete(ce(this.path));for(let c of i)o.delete(ce(c));for(let c of o.values())for(let a of c)a.checkStartTime(this.initialScanFinished,!1)&&a.emit("initial-missing","scan (missing in initial scan)")}this.scanAgain?(this.scanAgain=!1,this.doScan(this.scanAgainInitial)):(this.scanning=!1,this.onScanFinished())}});for(let o of i)ze.lstat(o,(c,a)=>{if(!this.closed){if(c){c.code==="ENOENT"||c.code==="EPERM"||c.code==="EACCES"||c.code==="EBUSY"?this.setMissing(o,e,"scan ("+c.code+")"):this.onScanError(c),s();return}a.isFile()||a.isSymbolicLink()?(a.mtime&&ci(a.mtime),this.setFileTime(o,+a.mtime||+a.ctime||1,e,!0,"scan (file)")):a.isDirectory()&&(!e||!this.directories.has(o))&&this.setDirectory(o,+a.birthtime||1,e,"scan (dir)"),s()}});s()})})}getTimes(){let e=Object.create(null),r=this.lastWatchEvent;for(let[n,i]of this.files)Ue(i),r=Math.max(r,i.safeTime),e[n]=Math.max(i.safeTime,i.timestamp);if(this.nestedWatching){for(let n of this.directories.values()){let i=n.directoryWatcher.getTimes();for(let s of Object.keys(i)){let o=i[s];r=Math.max(r,o),e[s]=o}}e[this.path]=r}if(!this.initialScan)for(let n of this.watchers.values())for(let i of n){let s=i.path;Object.prototype.hasOwnProperty.call(e,s)||(e[s]=null)}return e}collectTimeInfoEntries(e,r){let n=this.lastWatchEvent;for(let[i,s]of this.files)Ue(s),n=Math.max(n,s.safeTime),e.set(i,s);if(this.nestedWatching){for(let i of this.directories.values())n=Math.max(n,i.directoryWatcher.collectTimeInfoEntries(e,r));e.set(this.path,ae),r.set(this.path,{safeTime:n})}else{for(let i of this.directories.keys())e.set(i,ae),r.has(i)||r.set(i,ae);e.set(this.path,ae),r.set(this.path,ae)}if(!this.initialScan)for(let i of this.watchers.values())for(let s of i){let o=s.path;e.has(o)||e.set(o,null)}return n}close(){if(this.closed=!0,this.initialScan=!1,this.watcher&&(this.watcher.close(),this.watcher=null),this.nestedWatching){for(let e of this.directories.values())e.close();this.directories.clear()}this.parentWatcher&&(this.parentWatcher.close(),this.parentWatcher=null),this.emit("closed")}};qt.exports=xt;qt.exports.EXISTANCE_ONLY_TIME_ENTRY=ae;function Ue(t){t.accuracy>L&&(t.safeTime=t.safeTime-t.accuracy+L,t.accuracy=L)}function ci(t){t&&(L>1&&t%1!==0?L=1:L>10&&t%10!==0?L=10:L>100&&t%100!==0?L=100:L>1e3&&t%1e3!==0&&(L=1e3))}});var hi=w((va,Ot)=>{"use strict";var ac=require("path"),uc=ui(),Ke=class{constructor(e){this.options=e,this.directoryWatchers=new Map}getDirectoryWatcher(e){let r=this.directoryWatchers.get(e);if(r===void 0){let n=new uc(this,e,this.options);return this.directoryWatc