UNPKG

nx-mesh

Version:
10 lines (8 loc) 67.5 kB
var is=Object.create;var Fe=Object.defineProperty;var ss=Object.getOwnPropertyDescriptor;var os=Object.getOwnPropertyNames;var cs=Object.getPrototypeOf,as=Object.prototype.hasOwnProperty;var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),us=(t,e)=>{for(var r in e)Fe(t,r,{get:e[r],enumerable:!0})},Ut=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of os(e))!as.call(t,i)&&i!==r&&Fe(t,i,{get:()=>e[i],enumerable:!(n=ss(e,i))||n.enumerable});return t};var ct=(t,e,r)=>(r=t!=null?is(cs(t)):{},Ut(e||!t||!t.__esModule?Fe(r,"default",{value:t,enumerable:!0}):r,t)),fs=t=>Ut(Fe({},"__esModule",{value:!0}),t);var rr=S((fa,tr)=>{var z=require("constants"),ys=process.cwd,Ne=null,ws=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ne||(Ne=ys.call(process)),Ne};try{process.cwd()}catch{}typeof process.chdir=="function"&&(at=process.chdir,process.chdir=function(t){Ne=null,at.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,at));var at;tr.exports=Ss;function Ss(t){z.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,l){l&&process.nextTick(l)},t.lchownSync=function(){}),ws==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(u){function f(m,l,g){var E=Date.now(),d=0;u(m,l,function p(y){if(y&&(y.code==="EACCES"||y.code==="EPERM")&&Date.now()-E<6e4){setTimeout(function(){t.stat(l,function(O,de){O&&O.code==="ENOENT"?u(m,l,p):g(y)})},d),d<100&&(d+=10);return}g&&g(y)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(u){function f(m,l,g,E,d,p){var y;if(p&&typeof p=="function"){var O=0;y=function(de,Bt,Yt){if(de&&de.code==="EAGAIN"&&O<10)return O++,u.call(t,m,l,g,E,d,y);p.apply(this,arguments)}}return u.call(t,m,l,g,E,d,y)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(u){return function(f,m,l,g,E){for(var d=0;;)try{return u.call(t,f,m,l,g,E)}catch(p){if(p.code==="EAGAIN"&&d<10){d++;continue}throw p}}}(t.readSync);function e(u){u.lchmod=function(f,m,l){u.open(f,z.O_WRONLY|z.O_SYMLINK,m,function(g,E){if(g){l&&l(g);return}u.fchmod(E,m,function(d){u.close(E,function(p){l&&l(d||p)})})})},u.lchmodSync=function(f,m){var l=u.openSync(f,z.O_WRONLY|z.O_SYMLINK,m),g=!0,E;try{E=u.fchmodSync(l,m),g=!1}finally{if(g)try{u.closeSync(l)}catch{}else u.closeSync(l)}return E}}function r(u){z.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(f,m,l,g){u.open(f,z.O_SYMLINK,function(E,d){if(E){g&&g(E);return}u.futimes(d,m,l,function(p){u.close(d,function(y){g&&g(p||y)})})})},u.lutimesSync=function(f,m,l){var g=u.openSync(f,z.O_SYMLINK),E,d=!0;try{E=u.futimesSync(g,m,l),d=!1}finally{if(d)try{u.closeSync(g)}catch{}else u.closeSync(g)}return E}):u.futimes&&(u.lutimes=function(f,m,l,g){g&&process.nextTick(g)},u.lutimesSync=function(){})}function n(u){return u&&function(f,m,l){return u.call(t,f,m,function(g){h(g)&&(g=null),l&&l.apply(this,arguments)})}}function i(u){return u&&function(f,m){try{return u.call(t,f,m)}catch(l){if(!h(l))throw l}}}function s(u){return u&&function(f,m,l,g){return u.call(t,f,m,l,function(E){h(E)&&(E=null),g&&g.apply(this,arguments)})}}function o(u){return u&&function(f,m,l){try{return u.call(t,f,m,l)}catch(g){if(!h(g))throw g}}}function c(u){return u&&function(f,m,l){typeof m=="function"&&(l=m,m=null);function g(E,d){d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),l&&l.apply(this,arguments)}return m?u.call(t,f,m,g):u.call(t,f,g)}}function a(u){return u&&function(f,m){var l=m?u.call(t,f,m):u.call(t,f);return l&&(l.uid<0&&(l.uid+=4294967296),l.gid<0&&(l.gid+=4294967296)),l}}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 sr=S((ha,ir)=>{var nr=require("stream").Stream;ir.exports=Es;function Es(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);nr.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);nr.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 cr=S((la,or)=>{"use strict";or.exports=xs;var vs=Object.getPrototypeOf||function(t){return t.__proto__};function xs(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:vs(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var I=S((da,ht)=>{var q=require("fs"),Cs=rr(),Ts=sr(),ks=cr(),De=require("util"),M,Me;typeof Symbol=="function"&&typeof Symbol.for=="function"?(M=Symbol.for("graceful-fs.queue"),Me=Symbol.for("graceful-fs.previous")):(M="___graceful-fs.queue",Me="___graceful-fs.previous");function Os(){}function fr(t,e){Object.defineProperty(t,M,{get:function(){return e}})}var ee=Os;De.debuglog?ee=De.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(ee=function(){var t=De.format.apply(De,arguments);t="GFS4: "+t.split(/\n/).join(` GFS4: `),console.error(t)});q[M]||(ar=global[M]||[],fr(q,ar),q.close=function(t){function e(r,n){return t.call(q,r,function(i){i||ur(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Me,{value:t}),e}(q.close),q.closeSync=function(t){function e(r){t.apply(q,arguments),ur()}return Object.defineProperty(e,Me,{value:t}),e}(q.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){ee(q[M]),require("assert").equal(q[M].length,0)}));var ar;global[M]||fr(global,q[M]);ht.exports=ut(ks(q));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!q.__patched&&(ht.exports=ut(q),q.__patched=!0);function ut(t){Cs(t),t.gracefulify=ut,t.createReadStream=Bt,t.createWriteStream=Yt;var e=t.readFile;t.readFile=r;function r(w,x,v){return typeof x=="function"&&(v=x,x=null),N(w,x,v);function N(D,F,P,W){return e(D,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?se([N,[D,F,P],T,W||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(w,x,v,N){return typeof v=="function"&&(N=v,v=null),D(w,x,v,N);function D(F,P,W,T,R){return n(F,P,W,function(k){k&&(k.code==="EMFILE"||k.code==="ENFILE")?se([D,[F,P,W,T],k,R||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var s=t.appendFile;s&&(t.appendFile=o);function o(w,x,v,N){return typeof v=="function"&&(N=v,v=null),D(w,x,v,N);function D(F,P,W,T,R){return s(F,P,W,function(k){k&&(k.code==="EMFILE"||k.code==="ENFILE")?se([D,[F,P,W,T],k,R||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var c=t.copyFile;c&&(t.copyFile=a);function a(w,x,v,N){return typeof v=="function"&&(N=v,v=0),D(w,x,v,N);function D(F,P,W,T,R){return c(F,P,W,function(k){k&&(k.code==="EMFILE"||k.code==="ENFILE")?se([D,[F,P,W,T],k,R||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var h=t.readdir;t.readdir=f;var u=/^v[0-5]\./;function f(w,x,v){typeof x=="function"&&(v=x,x=null);var N=u.test(process.version)?function(P,W,T,R){return h(P,D(P,W,T,R))}:function(P,W,T,R){return h(P,W,D(P,W,T,R))};return N(w,x,v);function D(F,P,W,T){return function(R,k){R&&(R.code==="EMFILE"||R.code==="ENFILE")?se([N,[F,P,W],R,T||Date.now(),Date.now()]):(k&&k.sort&&k.sort(),typeof W=="function"&&W.call(this,R,k))}}}if(process.version.substr(0,4)==="v0.8"){var m=Ts(t);p=m.ReadStream,O=m.WriteStream}var l=t.ReadStream;l&&(p.prototype=Object.create(l.prototype),p.prototype.open=y);var g=t.WriteStream;g&&(O.prototype=Object.create(g.prototype),O.prototype.open=de),Object.defineProperty(t,"ReadStream",{get:function(){return p},set:function(w){p=w},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return O},set:function(w){O=w},enumerable:!0,configurable:!0});var E=p;Object.defineProperty(t,"FileReadStream",{get:function(){return E},set:function(w){E=w},enumerable:!0,configurable:!0});var d=O;Object.defineProperty(t,"FileWriteStream",{get:function(){return d},set:function(w){d=w},enumerable:!0,configurable:!0});function p(w,x){return this instanceof p?(l.apply(this,arguments),this):p.apply(Object.create(p.prototype),arguments)}function y(){var w=this;ot(w.path,w.flags,w.mode,function(x,v){x?(w.autoClose&&w.destroy(),w.emit("error",x)):(w.fd=v,w.emit("open",v),w.read())})}function O(w,x){return this instanceof O?(g.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}function de(){var w=this;ot(w.path,w.flags,w.mode,function(x,v){x?(w.destroy(),w.emit("error",x)):(w.fd=v,w.emit("open",v))})}function Bt(w,x){return new t.ReadStream(w,x)}function Yt(w,x){return new t.WriteStream(w,x)}var ns=t.open;t.open=ot;function ot(w,x,v,N){return typeof v=="function"&&(N=v,v=null),D(w,x,v,N);function D(F,P,W,T,R){return ns(F,P,W,function(k,Xc){k&&(k.code==="EMFILE"||k.code==="ENFILE")?se([D,[F,P,W,T],k,R||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}return t}function se(t){ee("ENQUEUE",t[0].name,t[1]),q[M].push(t),ft()}var Re;function ur(){for(var t=Date.now(),e=0;e<q[M].length;++e)q[M][e].length>2&&(q[M][e][3]=t,q[M][e][4]=t);ft()}function ft(){if(clearTimeout(Re),Re=void 0,q[M].length!==0){var t=q[M].shift(),e=t[0],r=t[1],n=t[2],i=t[3],s=t[4];if(i===void 0)ee("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){ee("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?(ee("RETRY",e.name,r),e.apply(null,r.concat([i]))):q[M].push(t)}Re===void 0&&(Re=setTimeout(ft,0))}}});var lr=S((ma,hr)=>{"use strict";var Ps=require("path");hr.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=Ps.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 yt=S(je=>{"use strict";var mr=require("fs"),_e=require("path"),{EventEmitter:qs}=require("events"),Ws=lr(),pr=require("os").platform()==="darwin",Fs=require("os").platform()==="win32",As=pr||Fs,dr=+process.env.WATCHPACK_WATCHER_LIMIT||(pr?2e3:1e4),Ie=!!process.env.WATCHPACK_RECURSIVE_WATCHER_LOGGING,dt=!1,oe=0,me=new Map,pe=new Map,ge=new Map,te=new Map,mt=class{constructor(e){this.filePath=e,this.watchers=new Set,this.watcher=void 0;try{let r=mr.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){te.set(e,this),this.watchers.add(e)}remove(e){this.watchers.delete(e),this.watchers.size===0&&(ge.delete(this.filePath),oe--,this.watcher&&this.watcher.close())}getWatchers(){return this.watchers}},pt=class{constructor(e){this.rootPath=e,this.mapWatcherToPath=new Map,this.mapPathToWatchers=new Map,this.watcher=void 0;try{let r=mr.watch(e,{recursive:!0});this.watcher=r,r.on("change",(n,i)=>{if(i){let s=_e.dirname(i),o=this.mapPathToWatchers.get(s);if(Ie&&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,_e.basename(i))}else{Ie&&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++,Ie&&process.stderr.write(`[watchpack] created recursive watcher at ${e} `)}add(e,r){te.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&&(pe.delete(this.rootPath),oe--,this.watcher&&this.watcher.close(),Ie&&process.stderr.write(`[watchpack] closed recursive watcher at ${this.rootPath} `))}getWatchers(){return this.mapWatcherToPath}},gt=class extends qs{close(){if(me.has(this)){me.delete(this);return}te.get(this).remove(this),te.delete(this)}},lt=t=>{let e=ge.get(t);if(e!==void 0)return e;let r=new mt(t);return ge.set(t,r),r},Ns=t=>{let e=pe.get(t);if(e!==void 0)return e;let r=new pt(t);return pe.set(t,r),r},gr=()=>{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 me)e(n,i);if(me.clear(),!As||dr-oe>=t.size){for(let[n,i]of t){let s=lt(n);if(Array.isArray(i))for(let o of i)s.add(o);else s.add(i)}return}for(let n of pe.values())for(let[i,s]of n.getWatchers())e(i,_e.join(n.rootPath,s));for(let n of ge.values())for(let i of n.getWatchers())e(i,n.filePath);let r=Ws(t,dr*.9);for(let[n,i]of r)if(i.size===1)for(let[s,o]of i){let c=lt(o),a=te.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=Ns(n);for(let[c,a]of i){let h=te.get(c);h!==o&&(o.add(a,c),h!==void 0&&h.remove(c))}}else for(let o of s){let c=lt(o);for(let a of i.keys()){let h=te.get(a);h!==c&&(c.add(a),h!==void 0&&h.remove(a))}}}};je.watch=t=>{let e=new gt,r=ge.get(t);if(r!==void 0)return r.add(e),e;let n=t;for(;;){let i=pe.get(n);if(i!==void 0)return i.add(t,e),e;let s=_e.dirname(n);if(s===n)break;n=s}return me.set(e,t),dt||gr(),e};je.batch=t=>{dt=!0;try{t()}finally{dt=!1,gr()}};je.getNumberOfWatchers=()=>oe});var vr=S((ga,Et)=>{"use strict";var Er=require("events").EventEmitter,be=I(),ye=require("path"),Ds=yt(),ae=Object.freeze({}),j=2e3,yr=require("os").platform()==="darwin",we=process.env.WATCHPACK_POLLING,wr=`${+we}`===we?+we:!!we&&we!=="false";function ce(t){return t.toLowerCase()}function Rs(t,e){return function(){if(--t===0)return e()}}var wt=class extends Er{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")}},St=class extends Er{constructor(e,r,n){super(),wr&&(n.poll=wr),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)}}:(yr&&this.watchInParentDirectory(),this.watcher=Ds.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)+j,h=j;else if(a=o,h=0,c&&c.timestamp===r&&r+j<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)+j: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 wt(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())Le(c),o=Math.max(o,c.safeTime)}else{let c=this.files.get(e);c?(Le(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=ye.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),be.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===ye.basename(this.path)&&(be.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&&Sr(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=ye.dirname(this.path);if(ye.dirname(e)===e)return;this.parentWatcher=this.watcherManager.watchFile(this.path,1),this.parentWatcher.on("change",(r,n)=>{this.closed||((!yr||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||be.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=>ye.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=Rs(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)be.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&&Sr(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)Le(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)Le(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")}};Et.exports=St;Et.exports.EXISTANCE_ONLY_TIME_ENTRY=ae;function Le(t){t.accuracy>j&&(t.safeTime=t.safeTime-t.accuracy+j,t.accuracy=j)}function Sr(t){t&&(j>1&&t%1!==0?j=1:j>10&&t%10!==0?j=10:j>100&&t%100!==0?j=100:j>1e3&&t%1e3!==0&&(j=1e3))}});var Cr=S((ya,vt)=>{"use strict";var Ms=require("path"),Is=vr(),$e=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 Is(this,e,this.options);return this.directoryWatchers.set(e,n),n.on("closed",()=>{this.directoryWatchers.delete(e)}),n}return r}watchFile(e,r){let n=Ms.dirname(e);return n===e?null:this.getDirectoryWatcher(n).watch(e,r)}watchDirectory(e,r){return this.getDirectoryWatcher(e).watch(e,r)}},xr=new WeakMap;vt.exports=t=>{let e=xr.get(t);if(e!==void 0)return e;let r=new $e(t);return xr.set(t,r),r};vt.exports.WatcherManager=$e});var Or=S((wa,kr)=>{"use strict";var _s=require("fs"),Ge=require("path"),Tr=new Set(["EINVAL","ENOENT"]);process.platform==="win32"&&Tr.add("UNKNOWN");var xt=class{constructor(){this.cache=new Map}resolve(e){let r=this.cache.get(e);if(r!==void 0)return r;let n=Ge.dirname(e);if(n===e){let o=Object.freeze([e]);return this.cache.set(e,o),o}let i=this.resolve(n),s=e;if(i[0]!==n){let o=Ge.basename(e);s=Ge.resolve(i[0],o)}try{let o=_s.readlinkSync(s),c=Ge.resolve(i[0],o),a=this.resolve(c),h;if(a.length>1&&i.length>1){let u=new Set(a);u.add(s);for(let f=1;f<i.length;f++)u.add(i[f]);h=Object.freeze(Array.from(u))}else i.length>1?(h=i.slice(),h[0]=a[0],h.push(s),Object.freeze(h)):a.length>1?(h=a.slice(),h.push(s),Object.freeze(h)):h=Object.freeze([a[0],s]);return this.cache.set(e,h),h}catch(o){if(!Tr.has(o.code))throw o;let c=i.slice();return c[0]=s,Object.freeze(c),this.cache.set(e,c),c}}};kr.exports=xt});var qr=S((Sa,Pr)=>{Pr.exports=function(t,e){if(typeof t!="string")throw new TypeError("Expected a string");for(var r=String(t),n="",i=e?!!e.extended:!1,s=e?!!e.globstar:!1,o=!1,c=e&&typeof e.flags=="string"?e.flags:"",a,h=0,u=r.length;h<u;h++)switch(a=r[h],a){case"/":case"$":case"^":case"+":case".":case"(":case")":case"=":case"!":case"|":n+="\\"+a;break;case"?":if(i){n+=".";break}case"[":case"]":if(i){n+=a;break}case"{":if(i){o=!0,n+="(";break}case"}":if(i){o=!1,n+=")";break}case",":if(o){n+="|";break}n+="\\"+a;break;case"*":for(var f=r[h-1],m=1;r[h+1]==="*";)m++,h++;var l=r[h+1];if(!s)n+=".*";else{var g=m>1&&(f==="/"||f===void 0)&&(l==="/"||l===void 0);g?(n+="((?:[^/]*(?:/|$))*)",h++):n+="([^/]*)"}break;default:n+=a}return(!c||!~c.indexOf("g"))&&(n="^"+n+"$"),new RegExp(n,c)}});var Nr=S((Ea,Ar)=>{"use strict";var js=Cr(),bs=Or(),Ls=require("events").EventEmitter,$s=qr(),Gs=yt(),Je=[],Js={};function Be(t,e){for(let r of t){let n=r.watcher;e.has(n.directoryWatcher)||e.add(n.directoryWatcher)}}var Wr=t=>{let e=$s(t,{globstar:!0,extended:!0}).source;return e.slice(0,e.length-1)+"(?:$|\\/)"},Bs=t=>{if(Array.isArray(t)){let e=new RegExp(t.map(r=>Wr(r)).join("|"));return r=>e.test(r.replace(/\\/g,"/"))}else if(typeof t=="string"){let e=new RegExp(Wr(t));return r=>e.test(r.replace(/\\/g,"/"))}else{if(t instanceof RegExp)return e=>t.test(e.replace(/\\/g,"/"));if(t instanceof Function)return t;if(t)throw new Error(`Invalid option for 'ignored': ${t}`);return()=>!1}},Ys=t=>({followSymlinks:!!t.followSymlinks,ignored:Bs(t.ignored),poll:t.poll}),Fr=new WeakMap,Us=t=>{let e=Fr.get(t);if(e!==void 0)return e;let r=Ys(t);return Fr.set(t,r),r},Ct=class{constructor(e,r,n){this.files=Array.isArray(n)?n:[n],this.watcher=r,r.on("initial-missing",i=>{for(let s of this.files)e._missing.has(s)||e._onRemove(s,s,i)}),r.on("change",(i,s)=>{for(let o of this.files)e._onChange(o,i,o,s)}),r.on("remove",i=>{for(let s of this.files)e._onRemove(s,s,i)})}update(e){Array.isArray(e)?this.files=e:this.files.length!==1?this.files=[e]:this.files[0]!==e&&(this.files[0]=e)}close(){this.watcher.close()}},Tt=class{constructor(e,r,n){this.directories=Array.isArray(n)?n:[n],this.watcher=r,r.on("initial-missing",i=>{for(let s of this.directories)e._onRemove(s,s,i)}),r.on("change",(i,s,o)=>{for(let c of this.directories)e._onChange(c,s,i,o)}),r.on("remove",i=>{for(let s of this.directories)e._onRemove(s,s,i)})}update(e){Array.isArray(e)?this.directories=e:this.directories.length!==1?this.directories=[e]:this.directories[0]!==e&&(this.directories[0]=e)}close(){this.watcher.close()}},kt=class extends Ls{constructor(e){super(),e||(e=Js),this.options=e,this.aggregateTimeout=typeof e.aggregateTimeout=="number"?e.aggregateTimeout:200,this.watcherOptions=Us(e),this.watcherManager=js(this.watcherOptions),this.fileWatchers=new Map,this.directoryWatchers=new Map,this._missing=new Set,this.startTime=void 0,this.paused=!1,this.aggregatedChanges=new Set,this.aggregatedRemovals=new Set,this.aggregateTimer=void 0,this._onTimeout=this._onTimeout.bind(this)}watch(e,r,n){let i,s,o,c;r?(i=e,s=r,o=Je,c=n):{files:i=Je,directories:s=Je,missing:o=Je,startTime:c}=e,this.paused=!1;let a=this.fileWatchers,h=this.directoryWatchers,u=this.watcherOptions.ignored,f=d=>!u(d),m=(d,p,y)=>{let O=d.get(p);O===void 0?d.set(p,y):Array.isArray(O)?O.push(y):d.set(p,[O,y])},l=new Map,g=new Map,E=new Set;if(this.watcherOptions.followSymlinks){let d=new bs;for(let p of i)if(f(p))for(let y of d.resolve(p))(p===y||f(y))&&m(l,y,p);for(let p of o)if(f(p))for(let y of d.resolve(p))(p===y||f(y))&&(E.add(p),m(l,y,p));for(let p of s)if(f(p)){let y=!0;for(let O of d.resolve(p))f(O)&&m(y?g:l,O,p),y=!1}}else{for(let d of i)f(d)&&m(l,d,d);for(let d of o)f(d)&&(E.add(d),m(l,d,d));for(let d of s)f(d)&&m(g,d,d)}for(let[d,p]of a){let y=l.get(d);y===void 0?(p.close(),a.delete(d)):(p.update(y),l.delete(d))}for(let[d,p]of h){let y=g.get(d);y===void 0?(p.close(),h.delete(d)):(p.update(y),g.delete(d))}Gs.batch(()=>{for(let[d,p]of l){let y=this.watcherManager.watchFile(d,c);y&&a.set(d,new Ct(this,y,p))}for(let[d,p]of g){let y=this.watcherManager.watchDirectory(d,c);y&&h.set(d,new Tt(this,y,p))}}),this._missing=E,this.startTime=c}close(){this.paused=!0,this.aggregateTimer&&clearTimeout(this.aggregateTimer);for(let e of this.fileWatchers.values())e.close();for(let e of this.directoryWatchers.values())e.close();this.fileWatchers.clear(),this.directoryWatchers.clear()}pause(){this.paused=!0,this.aggregateTimer&&clearTimeout(this.aggregateTimer)}getTimes(){let e=new Set;Be(this.fileWatchers.values(),e),Be(this.directoryWatchers.values(),e);let r=Object.create(null);for(let n of e){let i=n.getTimes();for(let s of Object.keys(i))r[s]=i[s]}return r}getTimeInfoEntries(){let e=new Map;return this.collectTimeInfoEntries(e,e),e}collectTimeInfoEntries(e,r){let n=new Set;Be(this.fileWatchers.values(),n),Be(this.directoryWatchers.values(),n);let i={value:0};for(let s of n)s.collectTimeInfoEntries(e,r,i)}getAggregated(){this.aggregateTimer&&(clearTimeout(this.aggregateTimer),this.aggregateTimer=void 0);let e=this.aggregatedChanges,r=this.aggregatedRemovals;return this.aggregatedChanges=new Set,this.aggregatedRemovals=new Set,{changes:e,removals:r}}_onChange(e,r,n,i){n=n||e,this.paused||(this.emit("change",n,r,i),this.aggregateTimer&&clearTimeout(this.aggregateTimer),this.aggregateTimer=setTimeout(this._onTimeout,this.aggregateTimeout)),this.aggregatedRemovals.delete(e),this.aggregatedChanges.add(e)}_onRemove(e,r,n){r=r||e,this.paused||(this.emit("remove",r,n),this.aggregateTimer&&clearTimeout(this.aggregateTimer),this.aggregateTimer=setTimeout(this._onTimeout,this.aggregateTimeout)),this.aggregatedChanges.delete(e),this.aggregatedRemovals.add(e)}_onTimeout(){this.aggregateTimer=void 0;let e=this.aggregatedChanges,r=this.aggregatedRemovals;this.aggregatedChanges=new Set,this.aggregatedRemovals=new Set,this.emit("aggregated",e,r)}};Ar.exports=kt});var L=S(Ot=>{"use strict";Ot.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})};Ot.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 re=S(V=>{"use strict";var Yr=L().fromCallback,$=I(),Ks=["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 $[t]=="function");Object.assign(V,$);Ks.forEach(t=>{V[t]=Yr($[t])});V.exists=function(t,e){return typeof e=="function"?$.exists(t,e):new Promise(r=>$.exists(t,r))};V.read=function(t,e,r,n,i,s){return typeof s=="function"?$.read(t,e,r,n,i,s):new Promise((o,c)=>{$.read(t,e,r,n,i,(a,h,u)=>{if(a)return c(a);o({bytesRead:h,buffer:u})})})};V.write=function(t,e,...r){return typeof r[r.length-1]=="function"?$.write(t,e,...r):new Promise((n,i)=>{$.write(t,e,...r,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffer:c})})})};typeof $.writev=="function"&&(V.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?$.writev(t,e,...r):new Promise((n,i)=>{$.writev(t,e,...r,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffers:c})})})});typeof $.realpath.native=="function"?V.realpath.native=Yr($.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var Kr=S((Za,Ur)=>{"use strict";var zs=require("path");Ur.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(zs.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}}});var Xr=S((eu,Pt)=>{"use strict";var zr=re(),{checkPath:Vr}=Kr(),Hr=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Pt.exports.makeDir=async(t,e)=>(Vr(t),zr.mkdir(t,{mode:Hr(e),recursive:!0}));Pt.exports.makeDirSync=(t,e)=>(Vr(t),zr.mkdirSync(t,{mode:Hr(e),recursive:!0}))});var J=S((tu,Qr)=>{"use strict";var Vs=L().fromPromise,{makeDir:Hs,makeDirSync:qt}=Xr(),Wt=Vs(Hs);Qr.exports={mkdirs:Wt,mkdirsSync:qt,mkdirp:Wt,mkdirpSync:qt,ensureDir:Wt,ensureDirSync:qt}});var H=S((ru,en)=>{"use strict";var Xs=L().fromPromise,Zr=re();function Qs(t){return Zr.access(t).then(()=>!0).catch(()=>!1)}en.exports={pathExists:Xs(Qs),pathExistsSync:Zr.existsSync}});var Ft=S((nu,tn)=>{"use strict";var ue=I();function Zs(t,e,r,n){ue.open(t,"r+",(i,s)=>{if(i)return n(i);ue.futimes(s,e,r,o=>{ue.close(s,c=>{n&&n(o||c)})})})}function eo(t,e,r){let n=ue.openSync(t,"r+");return ue.futimesSync(n,e,r),ue.closeSync(n)}tn.exports={utimesMillis:Zs,utimesMillisSync:eo}});var ne=S((iu,sn)=>{"use strict";var fe=re(),A=require("path"),to=require("util");function ro(t,e,r){let n=r.dereference?i=>fe.stat(i,{bigint:!0}):i=>fe.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 no(t,e,r){let n,i=r.dereference?o=>fe.statSync(o,{bigint:!0}):o=>fe.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 io(t,e,r,n,i){to.callbackify(ro)(t,e,n,(s,o)=>{if(s)return i(s);let{srcStat:c,destStat:a}=o;if(a){if(Ee(c,a)){let h=A.basename(t),u=A.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()&&At(t,e)?i(new Error(Ue(t,e,r))):i(null,{srcStat:c,destStat:a})})}function so(t,e,r,n){let{srcStat:i,destStat:s}=no(t,e,n);if(s){if(Ee(i,s)){let o=A.basename(t),c=A.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()&&At(t,e))throw new Error(Ue(t,e,r));return{srcStat:i,destStat:s}}function rn(t,e,r,n,i){let s=A.resolve(A.dirname(t)),o=A.resolve(A.dirname(r));if(o===s||o===A.parse(o).root)return i();fe.stat(o,{bigint:!0},(c,a)=>c?c.code==="ENOENT"?i():i(c):Ee(e,a)?i(new Error(Ue(t,r,n))):rn(t,e,o,n,i))}function nn(t,e,r,n){let i=A.resolve(A.dirname(t)),s=A.resolve(A.dirname(r));if(s===i||s===A.parse(s).root)return;let o;try{o=fe.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(Ee(e,o))throw new Error(Ue(t,r,n));return nn(t,e,s,n)}function Ee(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function At(t,e){let r=A.resolve(t).split(A.sep).filter(i=>i),n=A.resolve(e).split(A.sep).filter(i=>i);return r.reduce((i,s,o)=>i&&n[o]===s,!0)}function Ue(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}sn.exports={checkPaths:io,checkPathsSync:so,checkParentPaths:rn,checkParentPathsSync:nn,isSrcSubdir:At,areIdentical:Ee}});var dn=S((su,ln)=>{"use strict";var G=I(),ve=require("path"),oo=J().mkdirs,co=H().pathExists,ao=Ft().utimesMillis,xe=ne();function uo(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"),xe.checkPaths(t,e,"copy",r,(i,s)=>{if(i)return n(i);let{srcStat:o,destStat:c}=s;xe.checkParentPaths(t,o,e,"copy",a=>a?n(a):r.filter?an(on,c,t,e,r,n):on(c,t,e,r,n))})}function on(t,e,r,n,i){let s=ve.dirname(r);co(s,(o,c)=>{if(o)return i(o);if(c)return Ke(t,e,r,n,i);oo(s,a=>a?i(a):Ke(t,e,r,n,i))})}function an(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 fo(t,e,r,n,i){return n.filter?an(Ke,t,e,r,n,i):Ke(t,e,r,n,i)}function Ke(t,e,r,n,i){(n.dereference?G.stat:G.lstat)(e,(o,c)=>o?i(o):c.isDirectory()?wo(c,t,e,r,n,i):c.isFile()||c.isCharacterDevice()||c.isBlockDevice()?ho(c,t,e,r,n,i):c.isSymbolicLink()?vo(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 ho(t,e,r,n,i,s){return e?lo(t,r,n,i,s):un(t,r,n,i,s)}function lo(t,e,r,n,i){if(n.overwrite)G.unlink(r,s=>s?i(s):un(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function un(t,e,r,n,i){G.copyFile(e,r,s=>s?i(s):n.preserveTimestamps?mo(t.mode,e,r,i):ze(r,t.mode,i))}function mo(t,e,r,n){return po(t)?go(r,t,i=>i?n(i):cn(t,e,r,n)):cn(t,e,r,n)}function po(t){return(t&128)===0}function go(t,e,r){return ze(t,e|128,r)}function cn(t,e,r,n){yo(e,r,i=>i?n(i):ze(r,t,n))}function ze(t,e,r){return G.chmod(t,e,r)}function yo(t,e,r){G.stat(t,(n,i)=>n?r(n):ao(e,i.atime,i.mtime,r))}function wo(t,e,r,n,i,s){return e?fn(r,n,i,s):So(t.mode,r,n,i,s)}function So(t,e,r,n,i){G.mkdir(r,s=>{if(s)return i(s);fn(e,r,n,o=>o?i(o):ze(r,t,i))})}function fn(t,e,r,n){G.readdir(t,(i,s)=>i?n(i):hn(s,t,e,r,n))}function hn(t,e,r,n,i){let s=t.pop();return s?Eo(t,s,e,r,n,i):i()}function Eo(t,e,r,n,i,s){let o=ve.join(r,e),c=ve.join(n,e);xe.checkPaths(o,c,"copy",i,(a,h)=>{if(a)return s(a);let{destStat:u}=h;fo(u,o,c,i,f=>f?s(f):hn(t,r,n,i,s))})}function vo(t,e,r,n,i){G.readlink(e,(s,o)=>{if(s)return i(s);if(n.dereference&&(o=ve.resolve(process.cwd(),o)),t)G.readlink(r,(c,a)=>c?c.code==="EINVAL"||c.code==="UNKNOWN"?G.symlink(o,r,i):i(c):(n.dereference&&(a=ve.resolve(process.cwd(),a)),xe.isSrcSubdir(o,a)?i(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${a}'.`)):t.isDirectory()&&xe.isSrcSubdir(a,o)?i(new Error(`Cannot overwrite '${a}' with '${o}'.`)):xo(o,r,i)));else return G.symlink(o,r,i)})}function xo(t,e,r){G.unlink(e,n=>n?r(n):G.symlink(t,e,r))}ln.exports=uo});var wn=S((ou,yn)=>{"use strict";var _=I(),Ce=require("path"),Co=J().mkdirsSync,To=Ft().utimesMillisSync,Te=ne();function ko(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}=Te.checkPathsSync(t,e,"copy",r);return Te.checkParentPathsSync(t,n,e,"copy"),Oo(i,t,e,r)}function Oo(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=Ce.dirname(r);return _.existsSync(i)||Co(i),mn(t,e,r,n)}function Po(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return mn(t,e,r,n)}function mn(t,e,r,n){let s=(n.dereference?_.statSync:_.lstatSync)(e);if(s.isDirectory())return Ro(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return qo(s,t,e,r,n);if(s.isSymbolicLink())return _o(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 qo(t,e,r,n,i){return e?Wo(t,r,n,i):pn(t,r,n,i)}function Wo(t,e,r,n){if(n.overwrite)return _.unlinkSync(r),pn(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function pn(t,e,r,n){return _.copyFileSync(e,r),n.preserveTimestamps&&Fo(t.mode,e,r),Nt(r,t.mode)}function Fo(t,e,r){return Ao(t)&&No(r,t),Do(e,r)}function Ao(t){return(t&128)===0}function No(t,e){return Nt(t,e|128)}function Nt(t,e){return _.chmodSync(t,e)}function Do(t,e){let r=_.statSync(t);return To(e,r.atime,r.mtime)}function Ro(t,e,r,n,i){return e?gn(r,n,i):Mo(t.mode,r,n,i)}function Mo(t,e,r,n){return _.mkdirSync(r),gn(e,r,n),Nt(r,t)}function gn(t,e,r){_.readdirSync(t).forEach(n=>Io(n,t,e,r))}function Io(t,e,r,n){let i=Ce.join(e,t),s=Ce.join(r,t),{destStat:o}=Te.checkPathsSync(i,s,"copy",n);return Po(o,i,s,n)}function _o(t,e,r,n){let i=_.readlinkSync(e);if(n.dereference&&(i=Ce.resolve(process.cwd(),i)),t){let s;try{s=_.readlinkSync(r)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return _.symlinkSync(i,r);throw o}if(n.dereference&&(s=Ce.resolve(process.cwd(),s)),Te.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(_.statSync(r).isDirectory()&&Te.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return jo(i,r)}else return _.symlinkSync(i,r)}function jo(t,e){return _.unlinkSync(e),_.symlinkSync(t,e)}yn.exports=ko});var Ve=S((cu,Sn)=>{"use strict";var bo=L().fromCallback;Sn.exports={copy:bo(dn()),copySync:wn()}});var qn=S((au,Pn)=>{"use strict";var En=I(),Tn=require("path"),C=require("assert"),ke=process.platform==="win32";function kn(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||En[r],r=r+"Sync",t[r]=t[r]||En[r]}),t.maxBusyTries=t.maxBusyTries||3}function Dt(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),C(t,"rimraf: missing path"),C.strictEqual(typeof t,"string","rimraf: path should be a string"),C.strictEqual(typeof r,"function","rimraf: callback function required"),C(e,"rimraf: invalid options argument provided"),C.strictEqual(typeof e,"object","rimraf: options should be object"),kn(e),vn(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(()=>vn(t,e,i),o)}s.code==="ENOENT"&&(s=null)}r(s)})}function vn(t,e,r){C(t),C(e),C(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&ke)return xn(t,e,n,r);if(i&&i.isDirectory())return He(t,e,n,r);e.unlink(t,s=>{if(s){if(s.code==="ENOENT")return r(null);if(s.code==="EPERM")return ke?xn(t,e,s,r):He(t,e,s,r);if(s.code==="EISDIR")return He(t,e,s,r)}return r(s)})})}function xn(t,e,r,n){C(t),C(e),C(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()?He(t,e,r,n):e.unlink(t,n)})})}function Cn(t,e,r){let n;C(t),C(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()?Xe(t,e,r):e.unlinkSync(t)}function He(t,e,r,n){C(t),C(e),C(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?Lo(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function Lo(t,e,r){C(t),C(e),C(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=>{Dt(Tn.join(t,c),e,a=>{if(!o){if(a)return r(o=a);--s===0&&e.rmdir(t,r)}})})})}function On(t,e){let r;e=e||{},kn(e),C(t,"rimraf: missing path"),C.strictEqual(typeof t,"string","rimraf: path should be a string"),C(e,"rimraf: missing options"),C.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&ke&&Cn(t,e,n)}try{r&&r.isDirectory()?Xe(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return ke?Cn(t,e,n):Xe(t,e,n);if(n.code!=="EISDIR")throw n;Xe(t,e,n)}}function Xe(t,e,r){C(t),C(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")$o(t,e);else if(n.code!=="ENOENT")throw n}}function $o(t,e){if(C(t),C(e),e.readdirSync(t).forEach(r=>On(Tn.join(t,r),e)),ke){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}Pn.exports=Dt;Dt.sync=On});var Oe=S((uu,Fn)=>{"use strict";var Qe=I(),Go=L().fromCallback,Wn=qn();function Jo(t,e){if(Qe.rm)return Qe.rm(t,{recursive:!0,force:!0},e);Wn(t,e)}function Bo(t){if(Qe.rmSync)return Qe.rmSync(t,{recursive:!0,force:!0});Wn.sync(t)}Fn.exports={remove:Go(Jo),removeSync:Bo}});var jn=S((fu,_n)=>{"use strict";var Yo=L().fromPromise,Dn=re(),Rn=require("path"),Mn=J(),In=Oe(),An=Yo(async function(e){let r;try{r=await Dn.readdir(e)}catch{return Mn.mkdirs(e)}return Promise.all(r.map(n=>In.remove(Rn.join(e,n))))});function Nn(t){let e;try{e=Dn.readdirSync(t)}catch{return Mn.mkdirsSync(t)}e.forEach(r=>{r=Rn.join(t,r),In.removeSync(r)})}_n.exports={emptyDirSync:Nn,emptydirSync:Nn,emptyDir:An,emptydir:An}});var Gn=S((hu,$n)=>{"use strict";var Uo=L().fromCallback,bn=require("path"),X=I(),Ln=J();function Ko(t,e){function r(){X.writeFile(t,"",n=>{if(n)return e(n);e()})}X.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let s=bn.dirname(t);X.stat(s,(o,c)=>{if(o)return o.code==="ENOENT"?Ln.mkdirs(s,a=>{if(a)return e(a);r()}):e(o);c.isDirectory()?r():X.readdir(s,a=>{if(a)return e(a)})})})}function zo(t){let e;try{e=X.statSync(t)}catch{}if(e&&e.isFile())return;let r=bn.dirname(t);try{X.statSync(r).isDirectory()||X.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")Ln.mkdirsSync(r);else throw n}X.writeFileSync(t,"")}$n.exports={createFile:Uo(Ko),createFileSync:zo}});var Kn=S((lu,Un)=>{"use strict";var Vo=L().fromCallback,Jn=require("path"),Q=I(),Bn=J(),Ho=H().pathExists,{areIdentical:Yn}=ne();function Xo(t,e,r){function n(i,s){Q.link(i,s,o=>{if(o)return r(o);r(null)})}Q.lstat(e,(i,s)=>{Q.lstat(t,(o,c)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);if(s&&Yn(c,s))return r(nul