@zuplo/core 6.47.8 → 6.47.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/customer.cli.minified.js +2 -2
- package/index.minified.js +2 -2
- package/package.json +4 -4
package/customer.cli.minified.js
CHANGED
|
@@ -575,7 +575,7 @@ globstar while`,s,K,c,Pe,De),this.matchOne(s.slice(K),c.slice(Pe),f))return this
|
|
|
575
575
|
>>> no match, partial?`,s,K,c,Pe),K===O))}let Se;if(typeof W=="string"?(Se=$===W,this.debug("string match",W,$,Se)):(Se=W.test($),this.debug("pattern match",W,$,Se)),!Se)return!1}if(E===O&&A===M)return!0;if(E===O)return f;if(A===M)return E===O-1&&s[E]==="";throw new Error("wtf?")}braceExpand(){return jut(this.pattern,this.options)}parse(s){mQ(s);let c=this.options;if(s==="**")return iy;if(s==="")return"";let f,d=null;(f=s.match(usr))?d=c.dot?_sr:fsr:(f=s.match(esr))?d=(c.nocase?c.dot?isr:nsr:c.dot?rsr:tsr)(f[1]):(f=s.match(psr))?d=(c.nocase?c.dot?msr:dsr:c.dot?hsr:gsr)(f):(f=s.match(ssr))?d=c.dot?osr:asr:(f=s.match(csr))&&(d=lsr);let v=Qj.fromGlob(s,this.options).toMMPattern();return d&&typeof v=="object"&&Reflect.defineProperty(v,"test",{value:d}),v}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let s=this.set;if(!s.length)return this.regexp=!1,this.regexp;let c=this.options,f=c.noglobstar?bsr:c.dot?Ssr:Tsr,d=new Set(c.nocase?["i"]:[]),v=s.map(O=>{let M=O.map(W=>{if(W instanceof RegExp)for(let $ of W.flags.split(""))d.add($);return typeof W=="string"?Asr(W):W===iy?iy:W._src});return M.forEach((W,$)=>{let K=M[$+1],Pe=M[$-1];W!==iy||Pe===iy||(Pe===void 0?K!==void 0&&K!==iy?M[$+1]="(?:\\/|"+f+"\\/)?"+K:M[$]=f:K===void 0?M[$-1]=Pe+"(?:\\/|"+f+")?":K!==iy&&(M[$-1]=Pe+"(?:\\/|\\/"+f+"\\/)"+K,M[$+1]=iy))}),M.filter(W=>W!==iy).join("/")}).join("|"),[E,A]=s.length>1?["(?:",")"]:["",""];v="^"+E+v+A+"$",this.negate&&(v="^(?!"+v+").+$");try{this.regexp=new RegExp(v,[...d].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(s){return this.preserveMultipleSlashes?s.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(s)?["",...s.split(/\/+/)]:s.split(/\/+/)}match(s,c=this.partial){if(this.debug("match",s,this.pattern),this.comment)return!1;if(this.empty)return s==="";if(s==="/"&&c)return!0;let f=this.options;this.isWindows&&(s=s.split("\\").join("/"));let d=this.slashSplit(s);this.debug(this.pattern,"split",d);let v=this.set;this.debug(this.pattern,"set",v);let E=d[d.length-1];if(!E)for(let A=d.length-2;!E&&A>=0;A--)E=d[A];for(let A=0;A<v.length;A++){let O=v[A],M=d;if(f.matchBase&&O.length===1&&(M=[E]),this.matchOne(M,O,c))return f.flipNegate?!0:!this.negate}return f.flipNegate?!1:this.negate}static defaults(s){return xv.defaults(s).Minimatch}};xv.AST=Qj;xv.Minimatch=wS;xv.escape=Kj;xv.unescape=Tx;import{fileURLToPath as sar}from"node:url";var Yj=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Uut=new Set,iNe=typeof process=="object"&&process?process:{},$ut=t((a,s,c,f)=>{typeof iNe.emitWarning=="function"?iNe.emitWarning(a,s,c,f):console.error(`[${c}] ${s}: ${a}`)},"emitWarning"),Que=globalThis.AbortController,But=globalThis.AbortSignal;if(typeof Que>"u"){But=class{static{t(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(f,d){this._onabort.push(d)}},Que=class{static{t(this,"AbortController")}constructor(){s()}signal=new But;abort(f){if(!this.signal.aborted){this.signal.reason=f,this.signal.aborted=!0;for(let d of this.signal._onabort)d(f);this.signal.onabort?.(f)}}};let a=iNe.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",s=t(()=>{a&&(a=!1,$ut("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",s))},"warnACPolyfill")}var ksr=t(a=>!Uut.has(a),"shouldWarn"),Z9r=Symbol("type"),vN=t(a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),"isPosInt"),Jut=t(a=>vN(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?Xj:null:null,"getUintArray"),Xj=class extends Array{static{t(this,"ZeroArray")}constructor(s){super(s),this.fill(0)}},sNe=class a{static{t(this,"Stack")}heap;length;static#r=!1;static create(s){let c=Jut(s);if(!c)return[];a.#r=!0;let f=new a(s,c);return a.#r=!1,f}constructor(s,c){if(!a.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new c(s),this.length=0}push(s){this.heap[this.length++]=s}pop(){return this.heap[--this.length]}},gQ=class a{static{t(this,"LRUCache")}#r;#n;#e;#t;#s;#p;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#_;#c;#l;#i;#f;#v;#d;#u;#m;#g;#x;#C;#b;#A;#E;#y;static unsafeExposeInternals(s){return{starts:s.#C,ttls:s.#b,sizes:s.#x,keyMap:s.#c,keyList:s.#l,valList:s.#i,next:s.#f,prev:s.#v,get head(){return s.#d},get tail(){return s.#u},free:s.#m,isBackgroundFetch:t(c=>s.#h(c),"isBackgroundFetch"),backgroundFetch:t((c,f,d,v)=>s.#j(c,f,d,v),"backgroundFetch"),moveToTail:t(c=>s.#U(c),"moveToTail"),indexes:t(c=>s.#w(c),"indexes"),rindexes:t(c=>s.#P(c),"rindexes"),isStale:t(c=>s.#S(c),"isStale")}}get max(){return this.#r}get maxSize(){return this.#n}get calculatedSize(){return this.#_}get size(){return this.#a}get fetchMethod(){return this.#s}get memoMethod(){return this.#p}get dispose(){return this.#e}get disposeAfter(){return this.#t}constructor(s){let{max:c=0,ttl:f,ttlResolution:d=1,ttlAutopurge:v,updateAgeOnGet:E,updateAgeOnHas:A,allowStale:O,dispose:M,disposeAfter:W,noDisposeOnSet:$,noUpdateTTL:K,maxSize:Pe=0,maxEntrySize:De=0,sizeCalculation:Se,fetchMethod:Ct,memoMethod:bt,noDeleteOnFetchRejection:hr,noDeleteOnStaleGet:Pr,allowStaleOnFetchRejection:jr,allowStaleOnFetchAbort:dr,ignoreFetchAbort:_r}=s;if(c!==0&&!vN(c))throw new TypeError("max option must be a nonnegative integer");let ir=c?Jut(c):Array;if(!ir)throw new Error("invalid max value: "+c);if(this.#r=c,this.#n=Pe,this.maxEntrySize=De||this.#n,this.sizeCalculation=Se,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(bt!==void 0&&typeof bt!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#p=bt,Ct!==void 0&&typeof Ct!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=Ct,this.#E=!!Ct,this.#c=new Map,this.#l=new Array(c).fill(void 0),this.#i=new Array(c).fill(void 0),this.#f=new ir(c),this.#v=new ir(c),this.#d=0,this.#u=0,this.#m=sNe.create(c),this.#a=0,this.#_=0,typeof M=="function"&&(this.#e=M),typeof W=="function"?(this.#t=W,this.#g=[]):(this.#t=void 0,this.#g=void 0),this.#A=!!this.#e,this.#y=!!this.#t,this.noDisposeOnSet=!!$,this.noUpdateTTL=!!K,this.noDeleteOnFetchRejection=!!hr,this.allowStaleOnFetchRejection=!!jr,this.allowStaleOnFetchAbort=!!dr,this.ignoreFetchAbort=!!_r,this.maxEntrySize!==0){if(this.#n!==0&&!vN(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!vN(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#T()}if(this.allowStale=!!O,this.noDeleteOnStaleGet=!!Pr,this.updateAgeOnGet=!!E,this.updateAgeOnHas=!!A,this.ttlResolution=vN(d)||d===0?d:1,this.ttlAutopurge=!!v,this.ttl=f||0,this.ttl){if(!vN(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}if(this.#r===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#r&&!this.#n){let ts="LRU_CACHE_UNBOUNDED";ksr(ts)&&(Uut.add(ts),$ut("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ts,a))}}getRemainingTTL(s){return this.#c.has(s)?1/0:0}#D(){let s=new Xj(this.#r),c=new Xj(this.#r);this.#b=s,this.#C=c,this.#N=(v,E,A=Yj.now())=>{if(c[v]=E!==0?A:0,s[v]=E,E!==0&&this.ttlAutopurge){let O=setTimeout(()=>{this.#S(v)&&this.#O(this.#l[v],"expire")},E+1);O.unref&&O.unref()}},this.#k=v=>{c[v]=s[v]!==0?Yj.now():0},this.#o=(v,E)=>{if(s[E]){let A=s[E],O=c[E];if(!A||!O)return;v.ttl=A,v.start=O,v.now=f||d();let M=v.now-O;v.remainingTTL=A-M}};let f=0,d=t(()=>{let v=Yj.now();if(this.ttlResolution>0){f=v;let E=setTimeout(()=>f=0,this.ttlResolution);E.unref&&E.unref()}return v},"getNow");this.getRemainingTTL=v=>{let E=this.#c.get(v);if(E===void 0)return 0;let A=s[E],O=c[E];if(!A||!O)return 1/0;let M=(f||d())-O;return A-M},this.#S=v=>{let E=c[v],A=s[v];return!!A&&!!E&&(f||d())-E>A}}#k=t(()=>{},"#updateItemAge");#o=t(()=>{},"#statusTTL");#N=t(()=>{},"#setItemTTL");#S=t(()=>!1,"#isStale");#T(){let s=new Xj(this.#r);this.#_=0,this.#x=s,this.#I=c=>{this.#_-=s[c],s[c]=0},this.#L=(c,f,d,v)=>{if(this.#h(f))return 0;if(!vN(d))if(v){if(typeof v!="function")throw new TypeError("sizeCalculation must be a function");if(d=v(f,c),!vN(d))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return d},this.#F=(c,f,d)=>{if(s[c]=f,this.#n){let v=this.#n-s[c];for(;this.#_>v;)this.#M(!0)}this.#_+=s[c],d&&(d.entrySize=f,d.totalCalculatedSize=this.#_)}}#I=t(s=>{},"#removeItemSize");#F=t((s,c,f)=>{},"#addItemSize");#L=t((s,c,f,d)=>{if(f||d)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#w({allowStale:s=this.allowStale}={}){if(this.#a)for(let c=this.#u;!(!this.#R(c)||((s||!this.#S(c))&&(yield c),c===this.#d));)c=this.#v[c]}*#P({allowStale:s=this.allowStale}={}){if(this.#a)for(let c=this.#d;!(!this.#R(c)||((s||!this.#S(c))&&(yield c),c===this.#u));)c=this.#f[c]}#R(s){return s!==void 0&&this.#c.get(this.#l[s])===s}*entries(){for(let s of this.#w())this.#i[s]!==void 0&&this.#l[s]!==void 0&&!this.#h(this.#i[s])&&(yield[this.#l[s],this.#i[s]])}*rentries(){for(let s of this.#P())this.#i[s]!==void 0&&this.#l[s]!==void 0&&!this.#h(this.#i[s])&&(yield[this.#l[s],this.#i[s]])}*keys(){for(let s of this.#w()){let c=this.#l[s];c!==void 0&&!this.#h(this.#i[s])&&(yield c)}}*rkeys(){for(let s of this.#P()){let c=this.#l[s];c!==void 0&&!this.#h(this.#i[s])&&(yield c)}}*values(){for(let s of this.#w())this.#i[s]!==void 0&&!this.#h(this.#i[s])&&(yield this.#i[s])}*rvalues(){for(let s of this.#P())this.#i[s]!==void 0&&!this.#h(this.#i[s])&&(yield this.#i[s])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(s,c={}){for(let f of this.#w()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;if(v!==void 0&&s(v,this.#l[f],this))return this.get(this.#l[f],c)}}forEach(s,c=this){for(let f of this.#w()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;v!==void 0&&s.call(c,v,this.#l[f],this)}}rforEach(s,c=this){for(let f of this.#P()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;v!==void 0&&s.call(c,v,this.#l[f],this)}}purgeStale(){let s=!1;for(let c of this.#P({allowStale:!0}))this.#S(c)&&(this.#O(this.#l[c],"expire"),s=!0);return s}info(s){let c=this.#c.get(s);if(c===void 0)return;let f=this.#i[c],d=this.#h(f)?f.__staleWhileFetching:f;if(d===void 0)return;let v={value:d};if(this.#b&&this.#C){let E=this.#b[c],A=this.#C[c];if(E&&A){let O=E-(Yj.now()-A);v.ttl=O,v.start=Date.now()}}return this.#x&&(v.size=this.#x[c]),v}dump(){let s=[];for(let c of this.#w({allowStale:!0})){let f=this.#l[c],d=this.#i[c],v=this.#h(d)?d.__staleWhileFetching:d;if(v===void 0||f===void 0)continue;let E={value:v};if(this.#b&&this.#C){E.ttl=this.#b[c];let A=Yj.now()-this.#C[c];E.start=Math.floor(Date.now()-A)}this.#x&&(E.size=this.#x[c]),s.unshift([f,E])}return s}load(s){this.clear();for(let[c,f]of s){if(f.start){let d=Date.now()-f.start;f.start=Yj.now()-d}this.set(c,f.value,f)}}set(s,c,f={}){if(c===void 0)return this.delete(s),this;let{ttl:d=this.ttl,start:v,noDisposeOnSet:E=this.noDisposeOnSet,sizeCalculation:A=this.sizeCalculation,status:O}=f,{noUpdateTTL:M=this.noUpdateTTL}=f,W=this.#L(s,c,f.size||0,A);if(this.maxEntrySize&&W>this.maxEntrySize)return O&&(O.set="miss",O.maxEntrySizeExceeded=!0),this.#O(s,"set"),this;let $=this.#a===0?void 0:this.#c.get(s);if($===void 0)$=this.#a===0?this.#u:this.#m.length!==0?this.#m.pop():this.#a===this.#r?this.#M(!1):this.#a,this.#l[$]=s,this.#i[$]=c,this.#c.set(s,$),this.#f[this.#u]=$,this.#v[$]=this.#u,this.#u=$,this.#a++,this.#F($,W,O),O&&(O.set="add"),M=!1;else{this.#U($);let K=this.#i[$];if(c!==K){if(this.#E&&this.#h(K)){K.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Pe}=K;Pe!==void 0&&!E&&(this.#A&&this.#e?.(Pe,s,"set"),this.#y&&this.#g?.push([Pe,s,"set"]))}else E||(this.#A&&this.#e?.(K,s,"set"),this.#y&&this.#g?.push([K,s,"set"]));if(this.#I($),this.#F($,W,O),this.#i[$]=c,O){O.set="replace";let Pe=K&&this.#h(K)?K.__staleWhileFetching:K;Pe!==void 0&&(O.oldValue=Pe)}}else O&&(O.set="update")}if(d!==0&&!this.#b&&this.#D(),this.#b&&(M||this.#N($,d,v),O&&this.#o(O,$)),!E&&this.#y&&this.#g){let K=this.#g,Pe;for(;Pe=K?.shift();)this.#t?.(...Pe)}return this}pop(){try{for(;this.#a;){let s=this.#i[this.#d];if(this.#M(!0),this.#h(s)){if(s.__staleWhileFetching)return s.__staleWhileFetching}else if(s!==void 0)return s}}finally{if(this.#y&&this.#g){let s=this.#g,c;for(;c=s?.shift();)this.#t?.(...c)}}}#M(s){let c=this.#d,f=this.#l[c],d=this.#i[c];return this.#E&&this.#h(d)?d.__abortController.abort(new Error("evicted")):(this.#A||this.#y)&&(this.#A&&this.#e?.(d,f,"evict"),this.#y&&this.#g?.push([d,f,"evict"])),this.#I(c),s&&(this.#l[c]=void 0,this.#i[c]=void 0,this.#m.push(c)),this.#a===1?(this.#d=this.#u=0,this.#m.length=0):this.#d=this.#f[c],this.#c.delete(f),this.#a--,c}has(s,c={}){let{updateAgeOnHas:f=this.updateAgeOnHas,status:d}=c,v=this.#c.get(s);if(v!==void 0){let E=this.#i[v];if(this.#h(E)&&E.__staleWhileFetching===void 0)return!1;if(this.#S(v))d&&(d.has="stale",this.#o(d,v));else return f&&this.#k(v),d&&(d.has="hit",this.#o(d,v)),!0}else d&&(d.has="miss");return!1}peek(s,c={}){let{allowStale:f=this.allowStale}=c,d=this.#c.get(s);if(d===void 0||!f&&this.#S(d))return;let v=this.#i[d];return this.#h(v)?v.__staleWhileFetching:v}#j(s,c,f,d){let v=c===void 0?void 0:this.#i[c];if(this.#h(v))return v;let E=new Que,{signal:A}=f;A?.addEventListener("abort",()=>E.abort(A.reason),{signal:E.signal});let O={signal:E.signal,options:f,context:d},M=t((Se,Ct=!1)=>{let{aborted:bt}=E.signal,hr=f.ignoreFetchAbort&&Se!==void 0;if(f.status&&(bt&&!Ct?(f.status.fetchAborted=!0,f.status.fetchError=E.signal.reason,hr&&(f.status.fetchAbortIgnored=!0)):f.status.fetchResolved=!0),bt&&!hr&&!Ct)return $(E.signal.reason);let Pr=Pe;return this.#i[c]===Pe&&(Se===void 0?Pr.__staleWhileFetching?this.#i[c]=Pr.__staleWhileFetching:this.#O(s,"fetch"):(f.status&&(f.status.fetchUpdated=!0),this.set(s,Se,O.options))),Se},"cb"),W=t(Se=>(f.status&&(f.status.fetchRejected=!0,f.status.fetchError=Se),$(Se)),"eb"),$=t(Se=>{let{aborted:Ct}=E.signal,bt=Ct&&f.allowStaleOnFetchAbort,hr=bt||f.allowStaleOnFetchRejection,Pr=hr||f.noDeleteOnFetchRejection,jr=Pe;if(this.#i[c]===Pe&&(!Pr||jr.__staleWhileFetching===void 0?this.#O(s,"fetch"):bt||(this.#i[c]=jr.__staleWhileFetching)),hr)return f.status&&jr.__staleWhileFetching!==void 0&&(f.status.returnedStale=!0),jr.__staleWhileFetching;if(jr.__returned===jr)throw Se},"fetchFail"),K=t((Se,Ct)=>{let bt=this.#s?.(s,v,O);bt&&bt instanceof Promise&&bt.then(hr=>Se(hr===void 0?void 0:hr),Ct),E.signal.addEventListener("abort",()=>{(!f.ignoreFetchAbort||f.allowStaleOnFetchAbort)&&(Se(void 0),f.allowStaleOnFetchAbort&&(Se=t(hr=>M(hr,!0),"res")))})},"pcall");f.status&&(f.status.fetchDispatched=!0);let Pe=new Promise(K).then(M,W),De=Object.assign(Pe,{__abortController:E,__staleWhileFetching:v,__returned:void 0});return c===void 0?(this.set(s,De,{...O.options,status:void 0}),c=this.#c.get(s)):this.#i[c]=De,De}#h(s){if(!this.#E)return!1;let c=s;return!!c&&c instanceof Promise&&c.hasOwnProperty("__staleWhileFetching")&&c.__abortController instanceof Que}async fetch(s,c={}){let{allowStale:f=this.allowStale,updateAgeOnGet:d=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,ttl:E=this.ttl,noDisposeOnSet:A=this.noDisposeOnSet,size:O=0,sizeCalculation:M=this.sizeCalculation,noUpdateTTL:W=this.noUpdateTTL,noDeleteOnFetchRejection:$=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:K=this.allowStaleOnFetchRejection,ignoreFetchAbort:Pe=this.ignoreFetchAbort,allowStaleOnFetchAbort:De=this.allowStaleOnFetchAbort,context:Se,forceRefresh:Ct=!1,status:bt,signal:hr}=c;if(!this.#E)return bt&&(bt.fetch="get"),this.get(s,{allowStale:f,updateAgeOnGet:d,noDeleteOnStaleGet:v,status:bt});let Pr={allowStale:f,updateAgeOnGet:d,noDeleteOnStaleGet:v,ttl:E,noDisposeOnSet:A,size:O,sizeCalculation:M,noUpdateTTL:W,noDeleteOnFetchRejection:$,allowStaleOnFetchRejection:K,allowStaleOnFetchAbort:De,ignoreFetchAbort:Pe,status:bt,signal:hr},jr=this.#c.get(s);if(jr===void 0){bt&&(bt.fetch="miss");let dr=this.#j(s,jr,Pr,Se);return dr.__returned=dr}else{let dr=this.#i[jr];if(this.#h(dr)){let rs=f&&dr.__staleWhileFetching!==void 0;return bt&&(bt.fetch="inflight",rs&&(bt.returnedStale=!0)),rs?dr.__staleWhileFetching:dr.__returned=dr}let _r=this.#S(jr);if(!Ct&&!_r)return bt&&(bt.fetch="hit"),this.#U(jr),d&&this.#k(jr),bt&&this.#o(bt,jr),dr;let ir=this.#j(s,jr,Pr,Se),Fi=ir.__staleWhileFetching!==void 0&&f;return bt&&(bt.fetch=_r?"stale":"refresh",Fi&&_r&&(bt.returnedStale=!0)),Fi?ir.__staleWhileFetching:ir.__returned=ir}}async forceFetch(s,c={}){let f=await this.fetch(s,c);if(f===void 0)throw new Error("fetch() returned undefined");return f}memo(s,c={}){let f=this.#p;if(!f)throw new Error("no memoMethod provided to constructor");let{context:d,forceRefresh:v,...E}=c,A=this.get(s,E);if(!v&&A!==void 0)return A;let O=f(s,A,{options:E,context:d});return this.set(s,O,E),O}get(s,c={}){let{allowStale:f=this.allowStale,updateAgeOnGet:d=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,status:E}=c,A=this.#c.get(s);if(A!==void 0){let O=this.#i[A],M=this.#h(O);return E&&this.#o(E,A),this.#S(A)?(E&&(E.get="stale"),M?(E&&f&&O.__staleWhileFetching!==void 0&&(E.returnedStale=!0),f?O.__staleWhileFetching:void 0):(v||this.#O(s,"expire"),E&&f&&(E.returnedStale=!0),f?O:void 0)):(E&&(E.get="hit"),M?O.__staleWhileFetching:(this.#U(A),d&&this.#k(A),O))}else E&&(E.get="miss")}#B(s,c){this.#v[c]=s,this.#f[s]=c}#U(s){s!==this.#u&&(s===this.#d?this.#d=this.#f[s]:this.#B(this.#v[s],this.#f[s]),this.#B(this.#u,s),this.#u=s)}delete(s){return this.#O(s,"delete")}#O(s,c){let f=!1;if(this.#a!==0){let d=this.#c.get(s);if(d!==void 0)if(f=!0,this.#a===1)this.#$(c);else{this.#I(d);let v=this.#i[d];if(this.#h(v)?v.__abortController.abort(new Error("deleted")):(this.#A||this.#y)&&(this.#A&&this.#e?.(v,s,c),this.#y&&this.#g?.push([v,s,c])),this.#c.delete(s),this.#l[d]=void 0,this.#i[d]=void 0,d===this.#u)this.#u=this.#v[d];else if(d===this.#d)this.#d=this.#f[d];else{let E=this.#v[d];this.#f[E]=this.#f[d];let A=this.#f[d];this.#v[A]=this.#v[d]}this.#a--,this.#m.push(d)}}if(this.#y&&this.#g?.length){let d=this.#g,v;for(;v=d?.shift();)this.#t?.(...v)}return f}clear(){return this.#$("delete")}#$(s){for(let c of this.#P({allowStale:!0})){let f=this.#i[c];if(this.#h(f))f.__abortController.abort(new Error("deleted"));else{let d=this.#l[c];this.#A&&this.#e?.(f,d,s),this.#y&&this.#g?.push([f,d,s])}}if(this.#c.clear(),this.#i.fill(void 0),this.#l.fill(void 0),this.#b&&this.#C&&(this.#b.fill(0),this.#C.fill(0)),this.#x&&this.#x.fill(0),this.#d=0,this.#u=0,this.#m.length=0,this.#_=0,this.#a=0,this.#y&&this.#g){let c=this.#g,f;for(;f=c?.shift();)this.#t?.(...f)}}};import{posix as Bsr,win32 as mNe}from"node:path";import{fileURLToPath as Usr}from"node:url";import{lstatSync as $sr,readdir as Jsr,readdirSync as qsr,readlinkSync as zsr,realpathSync as Vsr}from"fs";import*as Wsr from"node:fs";import{lstat as Gsr,readdir as Qsr,readlink as Ksr,realpath as Ysr}from"node:fs/promises";import{EventEmitter as _Ne}from"node:events";import Hut from"node:stream";import{StringDecoder as wsr}from"node:string_decoder";var qut=typeof process=="object"&&process?process:{stdout:null,stderr:null},Psr=t(a=>!!a&&typeof a=="object"&&(a instanceof SN||a instanceof Hut||Nsr(a)||Isr(a)),"isStream"),Nsr=t(a=>!!a&&typeof a=="object"&&a instanceof _Ne&&typeof a.pipe=="function"&&a.pipe!==Hut.Writable.prototype.pipe,"isReadable"),Isr=t(a=>!!a&&typeof a=="object"&&a instanceof _Ne&&typeof a.write=="function"&&typeof a.end=="function","isWritable"),n6=Symbol("EOF"),i6=Symbol("maybeEmitEnd"),bN=Symbol("emittedEnd"),Kue=Symbol("emittingEnd"),yQ=Symbol("emittedError"),Yue=Symbol("closed"),zut=Symbol("read"),Xue=Symbol("flush"),Vut=Symbol("flushChunk"),Cx=Symbol("encoding"),Zj=Symbol("decoder"),h0=Symbol("flowing"),vQ=Symbol("paused"),eB=Symbol("resume"),g0=Symbol("buffer"),Dv=Symbol("pipes"),y0=Symbol("bufferLength"),aNe=Symbol("bufferPush"),Zue=Symbol("bufferShift"),s1=Symbol("objectMode"),ph=Symbol("destroyed"),oNe=Symbol("error"),cNe=Symbol("emitData"),Wut=Symbol("emitEnd"),lNe=Symbol("emitEnd2"),ZA=Symbol("async"),uNe=Symbol("abort"),efe=Symbol("aborted"),bQ=Symbol("signal"),WF=Symbol("dataListeners"),PS=Symbol("discarded"),SQ=t(a=>Promise.resolve().then(a),"defer"),Osr=t(a=>a(),"nodefer"),Fsr=t(a=>a==="end"||a==="finish"||a==="prefinish","isEndish"),Lsr=t(a=>a instanceof ArrayBuffer||!!a&&typeof a=="object"&&a.constructor&&a.constructor.name==="ArrayBuffer"&&a.byteLength>=0,"isArrayBufferLike"),Rsr=t(a=>!Buffer.isBuffer(a)&&ArrayBuffer.isView(a),"isArrayBufferView"),tfe=class{static{t(this,"Pipe")}src;dest;opts;ondrain;constructor(s,c,f){this.src=s,this.dest=c,this.opts=f,this.ondrain=()=>s[eB](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(s){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},fNe=class extends tfe{static{t(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(s,c,f){super(s,c,f),this.proxyErrors=d=>c.emit("error",d),s.on("error",this.proxyErrors)}},Msr=t(a=>!!a.objectMode,"isObjectModeOptions"),jsr=t(a=>!a.objectMode&&!!a.encoding&&a.encoding!=="buffer","isEncodingOptions"),SN=class extends _Ne{static{t(this,"Minipass")}[h0]=!1;[vQ]=!1;[Dv]=[];[g0]=[];[s1];[Cx];[ZA];[Zj];[n6]=!1;[bN]=!1;[Kue]=!1;[Yue]=!1;[yQ]=null;[y0]=0;[ph]=!1;[bQ];[efe]=!1;[WF]=0;[PS]=!1;writable=!0;readable=!0;constructor(...s){let c=s[0]||{};if(super(),c.objectMode&&typeof c.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Msr(c)?(this[s1]=!0,this[Cx]=null):jsr(c)?(this[Cx]=c.encoding,this[s1]=!1):(this[s1]=!1,this[Cx]=null),this[ZA]=!!c.async,this[Zj]=this[Cx]?new wsr(this[Cx]):null,c&&c.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:t(()=>this[g0],"get")}),c&&c.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:t(()=>this[Dv],"get")});let{signal:f}=c;f&&(this[bQ]=f,f.aborted?this[uNe]():f.addEventListener("abort",()=>this[uNe]()))}get bufferLength(){return this[y0]}get encoding(){return this[Cx]}set encoding(s){throw new Error("Encoding must be set at instantiation time")}setEncoding(s){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[s1]}set objectMode(s){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ZA]}set async(s){this[ZA]=this[ZA]||!!s}[uNe](){this[efe]=!0,this.emit("abort",this[bQ]?.reason),this.destroy(this[bQ]?.reason)}get aborted(){return this[efe]}set aborted(s){}write(s,c,f){if(this[efe])return!1;if(this[n6])throw new Error("write after end");if(this[ph])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof c=="function"&&(f=c,c="utf8"),c||(c="utf8");let d=this[ZA]?SQ:Osr;if(!this[s1]&&!Buffer.isBuffer(s)){if(Rsr(s))s=Buffer.from(s.buffer,s.byteOffset,s.byteLength);else if(Lsr(s))s=Buffer.from(s);else if(typeof s!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[s1]?(this[h0]&&this[y0]!==0&&this[Xue](!0),this[h0]?this.emit("data",s):this[aNe](s),this[y0]!==0&&this.emit("readable"),f&&d(f),this[h0]):s.length?(typeof s=="string"&&!(c===this[Cx]&&!this[Zj]?.lastNeed)&&(s=Buffer.from(s,c)),Buffer.isBuffer(s)&&this[Cx]&&(s=this[Zj].write(s)),this[h0]&&this[y0]!==0&&this[Xue](!0),this[h0]?this.emit("data",s):this[aNe](s),this[y0]!==0&&this.emit("readable"),f&&d(f),this[h0]):(this[y0]!==0&&this.emit("readable"),f&&d(f),this[h0])}read(s){if(this[ph])return null;if(this[PS]=!1,this[y0]===0||s===0||s&&s>this[y0])return this[i6](),null;this[s1]&&(s=null),this[g0].length>1&&!this[s1]&&(this[g0]=[this[Cx]?this[g0].join(""):Buffer.concat(this[g0],this[y0])]);let c=this[zut](s||null,this[g0][0]);return this[i6](),c}[zut](s,c){if(this[s1])this[Zue]();else{let f=c;s===f.length||s===null?this[Zue]():typeof f=="string"?(this[g0][0]=f.slice(s),c=f.slice(0,s),this[y0]-=s):(this[g0][0]=f.subarray(s),c=f.subarray(0,s),this[y0]-=s)}return this.emit("data",c),!this[g0].length&&!this[n6]&&this.emit("drain"),c}end(s,c,f){return typeof s=="function"&&(f=s,s=void 0),typeof c=="function"&&(f=c,c="utf8"),s!==void 0&&this.write(s,c),f&&this.once("end",f),this[n6]=!0,this.writable=!1,(this[h0]||!this[vQ])&&this[i6](),this}[eB](){this[ph]||(!this[WF]&&!this[Dv].length&&(this[PS]=!0),this[vQ]=!1,this[h0]=!0,this.emit("resume"),this[g0].length?this[Xue]():this[n6]?this[i6]():this.emit("drain"))}resume(){return this[eB]()}pause(){this[h0]=!1,this[vQ]=!0,this[PS]=!1}get destroyed(){return this[ph]}get flowing(){return this[h0]}get paused(){return this[vQ]}[aNe](s){this[s1]?this[y0]+=1:this[y0]+=s.length,this[g0].push(s)}[Zue](){return this[s1]?this[y0]-=1:this[y0]-=this[g0][0].length,this[g0].shift()}[Xue](s=!1){do;while(this[Vut](this[Zue]())&&this[g0].length);!s&&!this[g0].length&&!this[n6]&&this.emit("drain")}[Vut](s){return this.emit("data",s),this[h0]}pipe(s,c){if(this[ph])return s;this[PS]=!1;let f=this[bN];return c=c||{},s===qut.stdout||s===qut.stderr?c.end=!1:c.end=c.end!==!1,c.proxyErrors=!!c.proxyErrors,f?c.end&&s.end():(this[Dv].push(c.proxyErrors?new fNe(this,s,c):new tfe(this,s,c)),this[ZA]?SQ(()=>this[eB]()):this[eB]()),s}unpipe(s){let c=this[Dv].find(f=>f.dest===s);c&&(this[Dv].length===1?(this[h0]&&this[WF]===0&&(this[h0]=!1),this[Dv]=[]):this[Dv].splice(this[Dv].indexOf(c),1),c.unpipe())}addListener(s,c){return this.on(s,c)}on(s,c){let f=super.on(s,c);if(s==="data")this[PS]=!1,this[WF]++,!this[Dv].length&&!this[h0]&&this[eB]();else if(s==="readable"&&this[y0]!==0)super.emit("readable");else if(Fsr(s)&&this[bN])super.emit(s),this.removeAllListeners(s);else if(s==="error"&&this[yQ]){let d=c;this[ZA]?SQ(()=>d.call(this,this[yQ])):d.call(this,this[yQ])}return f}removeListener(s,c){return this.off(s,c)}off(s,c){let f=super.off(s,c);return s==="data"&&(this[WF]=this.listeners("data").length,this[WF]===0&&!this[PS]&&!this[Dv].length&&(this[h0]=!1)),f}removeAllListeners(s){let c=super.removeAllListeners(s);return(s==="data"||s===void 0)&&(this[WF]=0,!this[PS]&&!this[Dv].length&&(this[h0]=!1)),c}get emittedEnd(){return this[bN]}[i6](){!this[Kue]&&!this[bN]&&!this[ph]&&this[g0].length===0&&this[n6]&&(this[Kue]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Yue]&&this.emit("close"),this[Kue]=!1)}emit(s,...c){let f=c[0];if(s!=="error"&&s!=="close"&&s!==ph&&this[ph])return!1;if(s==="data")return!this[s1]&&!f?!1:this[ZA]?(SQ(()=>this[cNe](f)),!0):this[cNe](f);if(s==="end")return this[Wut]();if(s==="close"){if(this[Yue]=!0,!this[bN]&&!this[ph])return!1;let v=super.emit("close");return this.removeAllListeners("close"),v}else if(s==="error"){this[yQ]=f,super.emit(oNe,f);let v=!this[bQ]||this.listeners("error").length?super.emit("error",f):!1;return this[i6](),v}else if(s==="resume"){let v=super.emit("resume");return this[i6](),v}else if(s==="finish"||s==="prefinish"){let v=super.emit(s);return this.removeAllListeners(s),v}let d=super.emit(s,...c);return this[i6](),d}[cNe](s){for(let f of this[Dv])f.dest.write(s)===!1&&this.pause();let c=this[PS]?!1:super.emit("data",s);return this[i6](),c}[Wut](){return this[bN]?!1:(this[bN]=!0,this.readable=!1,this[ZA]?(SQ(()=>this[lNe]()),!0):this[lNe]())}[lNe](){if(this[Zj]){let c=this[Zj].end();if(c){for(let f of this[Dv])f.dest.write(c);this[PS]||super.emit("data",c)}}for(let c of this[Dv])c.end();let s=super.emit("end");return this.removeAllListeners("end"),s}async collect(){let s=Object.assign([],{dataLength:0});this[s1]||(s.dataLength=0);let c=this.promise();return this.on("data",f=>{s.push(f),this[s1]||(s.dataLength+=f.length)}),await c,s}async concat(){if(this[s1])throw new Error("cannot concat in objectMode");let s=await this.collect();return this[Cx]?s.join(""):Buffer.concat(s,s.dataLength)}async promise(){return new Promise((s,c)=>{this.on(ph,()=>c(new Error("stream destroyed"))),this.on("error",f=>c(f)),this.on("end",()=>s())})}[Symbol.asyncIterator](){this[PS]=!1;let s=!1,c=t(async()=>(this.pause(),s=!0,{value:void 0,done:!0}),"stop");return{next:t(()=>{if(s)return c();let d=this.read();if(d!==null)return Promise.resolve({done:!1,value:d});if(this[n6])return c();let v,E,A=t($=>{this.off("data",O),this.off("end",M),this.off(ph,W),c(),E($)},"onerr"),O=t($=>{this.off("error",A),this.off("end",M),this.off(ph,W),this.pause(),v({value:$,done:!!this[n6]})},"ondata"),M=t(()=>{this.off("error",A),this.off("data",O),this.off(ph,W),c(),v({done:!0,value:void 0})},"onend"),W=t(()=>A(new Error("stream destroyed")),"ondestroy");return new Promise(($,K)=>{E=K,v=$,this.once(ph,W),this.once("error",A),this.once("end",M),this.once("data",O)})},"next"),throw:c,return:c,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[PS]=!1;let s=!1,c=t(()=>(this.pause(),this.off(oNe,c),this.off(ph,c),this.off("end",c),s=!0,{done:!0,value:void 0}),"stop"),f=t(()=>{if(s)return c();let d=this.read();return d===null?c():{done:!1,value:d}},"next");return this.once("end",c),this.once(oNe,c),this.once(ph,c),{next:f,throw:c,return:c,[Symbol.iterator](){return this}}}destroy(s){if(this[ph])return s?this.emit("error",s):this.emit(ph),this;this[ph]=!0,this[PS]=!0,this[g0].length=0,this[y0]=0;let c=this;return typeof c.close=="function"&&!this[Yue]&&c.close(),s?this.emit("error",s):this.emit(ph),this}static get isStream(){return Psr}};var Hsr=Vsr.native,CQ={lstatSync:$sr,readdir:Jsr,readdirSync:qsr,readlinkSync:zsr,realpathSync:Hsr,promises:{lstat:Gsr,readdir:Qsr,readlink:Ksr,realpath:Ysr}},Xut=t(a=>!a||a===CQ||a===Wsr?CQ:{...CQ,...a,promises:{...CQ.promises,...a.promises||{}}},"fsFromOption"),Zut=/^\\\\\?\\([a-z]:)\\?$/i,Xsr=t(a=>a.replace(/\//g,"\\").replace(Zut,"$1\\"),"uncToDrive"),Zsr=/[\\\/]/,hC=0,eft=1,tft=2,ek=4,rft=6,nft=8,HF=10,ift=12,mC=15,TQ=~mC,pNe=16,Gut=32,EQ=64,Ex=128,rfe=256,ife=512,Qut=EQ|Ex|ife,ear=1023,dNe=t(a=>a.isFile()?nft:a.isDirectory()?ek:a.isSymbolicLink()?HF:a.isCharacterDevice()?tft:a.isBlockDevice()?rft:a.isSocket()?ift:a.isFIFO()?eft:hC,"entToType"),Kut=new Map,xQ=t(a=>{let s=Kut.get(a);if(s)return s;let c=a.normalize("NFKD");return Kut.set(a,c),c},"normalize"),Yut=new Map,nfe=t(a=>{let s=Yut.get(a);if(s)return s;let c=xQ(a.toLowerCase());return Yut.set(a,c),c},"normalizeNocase"),sfe=class extends gQ{static{t(this,"ResolveCache")}constructor(){super({max:256})}},hNe=class extends gQ{static{t(this,"ChildrenCache")}constructor(s=16*1024){super({maxSize:s,sizeCalculation:t(c=>c.length+1,"sizeCalculation")})}},sft=Symbol("PathScurry setAsCwd"),a1=class{static{t(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#r;#n;get dev(){return this.#n}#e;get mode(){return this.#e}#t;get nlink(){return this.#t}#s;get uid(){return this.#s}#p;get gid(){return this.#p}#a;get rdev(){return this.#a}#_;get blksize(){return this.#_}#c;get ino(){return this.#c}#l;get size(){return this.#l}#i;get blocks(){return this.#i}#f;get atimeMs(){return this.#f}#v;get mtimeMs(){return this.#v}#d;get ctimeMs(){return this.#d}#u;get birthtimeMs(){return this.#u}#m;get atime(){return this.#m}#g;get mtime(){return this.#g}#x;get ctime(){return this.#x}#C;get birthtime(){return this.#C}#b;#A;#E;#y;#D;#k;#o;#N;#S;#T;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(s,c=hC,f,d,v,E,A){this.name=s,this.#b=v?nfe(s):xQ(s),this.#o=c&ear,this.nocase=v,this.roots=d,this.root=f||this,this.#N=E,this.#E=A.fullpath,this.#D=A.relative,this.#k=A.relativePosix,this.parent=A.parent,this.parent?this.#r=this.parent.#r:this.#r=Xut(A.fs)}depth(){return this.#A!==void 0?this.#A:this.parent?this.#A=this.parent.depth()+1:this.#A=0}childrenCache(){return this.#N}resolve(s){if(!s)return this;let c=this.getRootString(s),d=s.substring(c.length).split(this.splitSep);return c?this.getRoot(c).#I(d):this.#I(d)}#I(s){let c=this;for(let f of s)c=c.child(f);return c}children(){let s=this.#N.get(this);if(s)return s;let c=Object.assign([],{provisional:0});return this.#N.set(this,c),this.#o&=~pNe,c}child(s,c){if(s===""||s===".")return this;if(s==="..")return this.parent||this;let f=this.children(),d=this.nocase?nfe(s):xQ(s);for(let O of f)if(O.#b===d)return O;let v=this.parent?this.sep:"",E=this.#E?this.#E+v+s:void 0,A=this.newChild(s,hC,{...c,parent:this,fullpath:E});return this.canReaddir()||(A.#o|=Ex),f.push(A),A}relative(){if(this.isCWD)return"";if(this.#D!==void 0)return this.#D;let s=this.name,c=this.parent;if(!c)return this.#D=this.name;let f=c.relative();return f+(!f||!c.parent?"":this.sep)+s}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let s=this.name,c=this.parent;if(!c)return this.#k=this.fullpathPosix();let f=c.relativePosix();return f+(!f||!c.parent?"":"/")+s}fullpath(){if(this.#E!==void 0)return this.#E;let s=this.name,c=this.parent;if(!c)return this.#E=this.name;let d=c.fullpath()+(c.parent?this.sep:"")+s;return this.#E=d}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let d=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(d)?this.#y=`//?/${d}`:this.#y=d}let s=this.parent,c=s.fullpathPosix(),f=c+(!c||!s.parent?"":"/")+this.name;return this.#y=f}isUnknown(){return(this.#o&mC)===hC}isType(s){return this[`is${s}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#o&mC)===nft}isDirectory(){return(this.#o&mC)===ek}isCharacterDevice(){return(this.#o&mC)===tft}isBlockDevice(){return(this.#o&mC)===rft}isFIFO(){return(this.#o&mC)===eft}isSocket(){return(this.#o&mC)===ift}isSymbolicLink(){return(this.#o&HF)===HF}lstatCached(){return this.#o&Gut?this:void 0}readlinkCached(){return this.#S}realpathCached(){return this.#T}readdirCached(){let s=this.children();return s.slice(0,s.provisional)}canReadlink(){if(this.#S)return!0;if(!this.parent)return!1;let s=this.#o&mC;return!(s!==hC&&s!==HF||this.#o&rfe||this.#o&Ex)}calledReaddir(){return!!(this.#o&pNe)}isENOENT(){return!!(this.#o&Ex)}isNamed(s){return this.nocase?this.#b===nfe(s):this.#b===xQ(s)}async readlink(){let s=this.#S;if(s)return s;if(this.canReadlink()&&this.parent)try{let c=await this.#r.promises.readlink(this.fullpath()),f=(await this.parent.realpath())?.resolve(c);if(f)return this.#S=f}catch(c){this.#h(c.code);return}}readlinkSync(){let s=this.#S;if(s)return s;if(this.canReadlink()&&this.parent)try{let c=this.#r.readlinkSync(this.fullpath()),f=this.parent.realpathSync()?.resolve(c);if(f)return this.#S=f}catch(c){this.#h(c.code);return}}#F(s){this.#o|=pNe;for(let c=s.provisional;c<s.length;c++){let f=s[c];f&&f.#L()}}#L(){this.#o&Ex||(this.#o=(this.#o|Ex)&TQ,this.#w())}#w(){let s=this.children();s.provisional=0;for(let c of s)c.#L()}#P(){this.#o|=ife,this.#R()}#R(){if(this.#o&EQ)return;let s=this.#o;(s&mC)===ek&&(s&=TQ),this.#o=s|EQ,this.#w()}#M(s=""){s==="ENOTDIR"||s==="EPERM"?this.#R():s==="ENOENT"?this.#L():this.children().provisional=0}#j(s=""){s==="ENOTDIR"?this.parent.#R():s==="ENOENT"&&this.#L()}#h(s=""){let c=this.#o;c|=rfe,s==="ENOENT"&&(c|=Ex),(s==="EINVAL"||s==="UNKNOWN")&&(c&=TQ),this.#o=c,s==="ENOTDIR"&&this.parent&&this.parent.#R()}#B(s,c){return this.#O(s,c)||this.#U(s,c)}#U(s,c){let f=dNe(s),d=this.newChild(s.name,f,{parent:this}),v=d.#o&mC;return v!==ek&&v!==HF&&v!==hC&&(d.#o|=EQ),c.unshift(d),c.provisional++,d}#O(s,c){for(let f=c.provisional;f<c.length;f++){let d=c[f];if((this.nocase?nfe(s.name):xQ(s.name))===d.#b)return this.#$(s,d,f,c)}}#$(s,c,f,d){let v=c.name;return c.#o=c.#o&TQ|dNe(s),v!==s.name&&(c.name=s.name),f!==d.provisional&&(f===d.length-1?d.pop():d.splice(f,1),d.unshift(c)),d.provisional++,c}async lstat(){if((this.#o&Ex)===0)try{return this.#V(await this.#r.promises.lstat(this.fullpath())),this}catch(s){this.#j(s.code)}}lstatSync(){if((this.#o&Ex)===0)try{return this.#V(this.#r.lstatSync(this.fullpath())),this}catch(s){this.#j(s.code)}}#V(s){let{atime:c,atimeMs:f,birthtime:d,birthtimeMs:v,blksize:E,blocks:A,ctime:O,ctimeMs:M,dev:W,gid:$,ino:K,mode:Pe,mtime:De,mtimeMs:Se,nlink:Ct,rdev:bt,size:hr,uid:Pr}=s;this.#m=c,this.#f=f,this.#C=d,this.#u=v,this.#_=E,this.#i=A,this.#x=O,this.#d=M,this.#n=W,this.#p=$,this.#c=K,this.#e=Pe,this.#g=De,this.#v=Se,this.#t=Ct,this.#a=bt,this.#l=hr,this.#s=Pr;let jr=dNe(s);this.#o=this.#o&TQ|jr|Gut,jr!==hC&&jr!==ek&&jr!==HF&&(this.#o|=EQ)}#q=[];#z=!1;#W(s){this.#z=!1;let c=this.#q.slice();this.#q.length=0,c.forEach(f=>f(null,s))}readdirCB(s,c=!1){if(!this.canReaddir()){c?s(null,[]):queueMicrotask(()=>s(null,[]));return}let f=this.children();if(this.calledReaddir()){let v=f.slice(0,f.provisional);c?s(null,v):queueMicrotask(()=>s(null,v));return}if(this.#q.push(s),this.#z)return;this.#z=!0;let d=this.fullpath();this.#r.readdir(d,{withFileTypes:!0},(v,E)=>{if(v)this.#M(v.code),f.provisional=0;else{for(let A of E)this.#B(A,f);this.#F(f)}this.#W(f.slice(0,f.provisional))})}#J;async readdir(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let c=this.fullpath();if(this.#J)await this.#J;else{let f=t(()=>{},"resolve");this.#J=new Promise(d=>f=d);try{for(let d of await this.#r.promises.readdir(c,{withFileTypes:!0}))this.#B(d,s);this.#F(s)}catch(d){this.#M(d.code),s.provisional=0}this.#J=void 0,f()}return s.slice(0,s.provisional)}readdirSync(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let c=this.fullpath();try{for(let f of this.#r.readdirSync(c,{withFileTypes:!0}))this.#B(f,s);this.#F(s)}catch(f){this.#M(f.code),s.provisional=0}return s.slice(0,s.provisional)}canReaddir(){if(this.#o&Qut)return!1;let s=mC&this.#o;return s===hC||s===ek||s===HF}shouldWalk(s,c){return(this.#o&ek)===ek&&!(this.#o&Qut)&&!s.has(this)&&(!c||c(this))}async realpath(){if(this.#T)return this.#T;if(!((ife|rfe|Ex)&this.#o))try{let s=await this.#r.promises.realpath(this.fullpath());return this.#T=this.resolve(s)}catch{this.#P()}}realpathSync(){if(this.#T)return this.#T;if(!((ife|rfe|Ex)&this.#o))try{let s=this.#r.realpathSync(this.fullpath());return this.#T=this.resolve(s)}catch{this.#P()}}[sft](s){if(s===this)return;s.isCWD=!1,this.isCWD=!0;let c=new Set([]),f=[],d=this;for(;d&&d.parent;)c.add(d),d.#D=f.join(this.sep),d.#k=f.join("/"),d=d.parent,f.push("..");for(d=s;d&&d.parent&&!c.has(d);)d.#D=void 0,d.#k=void 0,d=d.parent}},afe=class a extends a1{static{t(this,"PathWin32")}sep="\\";splitSep=Zsr;constructor(s,c=hC,f,d,v,E,A){super(s,c,f,d,v,E,A)}newChild(s,c=hC,f={}){return new a(s,c,this.root,this.roots,this.nocase,this.childrenCache(),f)}getRootString(s){return mNe.parse(s).root}getRoot(s){if(s=Xsr(s.toUpperCase()),s===this.root.name)return this.root;for(let[c,f]of Object.entries(this.roots))if(this.sameRoot(s,c))return this.roots[s]=f;return this.roots[s]=new tB(s,this).root}sameRoot(s,c=this.root.name){return s=s.toUpperCase().replace(/\//g,"\\").replace(Zut,"$1\\"),s===c}},ofe=class a extends a1{static{t(this,"PathPosix")}splitSep="/";sep="/";constructor(s,c=hC,f,d,v,E,A){super(s,c,f,d,v,E,A)}getRootString(s){return s.startsWith("/")?"/":""}getRoot(s){return this.root}newChild(s,c=hC,f={}){return new a(s,c,this.root,this.roots,this.nocase,this.childrenCache(),f)}},cfe=class{static{t(this,"PathScurryBase")}root;rootPath;roots;cwd;#r;#n;#e;nocase;#t;constructor(s=process.cwd(),c,f,{nocase:d,childrenCacheSize:v=16*1024,fs:E=CQ}={}){this.#t=Xut(E),(s instanceof URL||s.startsWith("file://"))&&(s=Usr(s));let A=c.resolve(s);this.roots=Object.create(null),this.rootPath=this.parseRootPath(A),this.#r=new sfe,this.#n=new sfe,this.#e=new hNe(v);let O=A.substring(this.rootPath.length).split(f);if(O.length===1&&!O[0]&&O.pop(),d===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=d,this.root=this.newRoot(this.#t),this.roots[this.rootPath]=this.root;let M=this.root,W=O.length-1,$=c.sep,K=this.rootPath,Pe=!1;for(let De of O){let Se=W--;M=M.child(De,{relative:new Array(Se).fill("..").join($),relativePosix:new Array(Se).fill("..").join("/"),fullpath:K+=(Pe?"":$)+De}),Pe=!0}this.cwd=M}depth(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.depth()}childrenCache(){return this.#e}resolve(...s){let c="";for(let v=s.length-1;v>=0;v--){let E=s[v];if(!(!E||E===".")&&(c=c?`${E}/${c}`:E,this.isAbsolute(E)))break}let f=this.#r.get(c);if(f!==void 0)return f;let d=this.cwd.resolve(c).fullpath();return this.#r.set(c,d),d}resolvePosix(...s){let c="";for(let v=s.length-1;v>=0;v--){let E=s[v];if(!(!E||E===".")&&(c=c?`${E}/${c}`:E,this.isAbsolute(E)))break}let f=this.#n.get(c);if(f!==void 0)return f;let d=this.cwd.resolve(c).fullpathPosix();return this.#n.set(c,d),d}relative(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relative()}relativePosix(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relativePosix()}basename(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.name}dirname(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),(s.parent||s).fullpath()}async readdir(s=this.cwd,c={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f}=c;if(s.canReaddir()){let d=await s.readdir();return f?d:d.map(v=>v.name)}else return[]}readdirSync(s=this.cwd,c={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0}=c;return s.canReaddir()?f?s.readdirSync():s.readdirSync().map(d=>d.name):[]}async lstat(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstat()}lstatSync(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstatSync()}async readlink(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s.withFileTypes,s=this.cwd);let f=await s.readlink();return c?f:f?.fullpath()}readlinkSync(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s.withFileTypes,s=this.cwd);let f=s.readlinkSync();return c?f:f?.fullpath()}async realpath(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s.withFileTypes,s=this.cwd);let f=await s.realpath();return c?f:f?.fullpath()}realpathSync(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s.withFileTypes,s=this.cwd);let f=s.realpathSync();return c?f:f?.fullpath()}async walk(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=[];(!v||v(s))&&A.push(f?s:s.fullpath());let O=new Set,M=t(($,K)=>{O.add($),$.readdirCB((Pe,De)=>{if(Pe)return K(Pe);let Se=De.length;if(!Se)return K();let Ct=t(()=>{--Se===0&&K()},"next");for(let bt of De)(!v||v(bt))&&A.push(f?bt:bt.fullpath()),d&&bt.isSymbolicLink()?bt.realpath().then(hr=>hr?.isUnknown()?hr.lstat():hr).then(hr=>hr?.shouldWalk(O,E)?M(hr,Ct):Ct()):bt.shouldWalk(O,E)?M(bt,Ct):Ct()},!0)},"walk"),W=s;return new Promise(($,K)=>{M(W,Pe=>{if(Pe)return K(Pe);$(A)})})}walkSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=[];(!v||v(s))&&A.push(f?s:s.fullpath());let O=new Set([s]);for(let M of O){let W=M.readdirSync();for(let $ of W){(!v||v($))&&A.push(f?$:$.fullpath());let K=$;if($.isSymbolicLink()){if(!(d&&(K=$.realpathSync())))continue;K.isUnknown()&&K.lstatSync()}K.shouldWalk(O,E)&&O.add(K)}}return A}[Symbol.asyncIterator](){return this.iterate()}iterate(s=this.cwd,c={}){return typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd),this.stream(s,c)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c;(!v||v(s))&&(yield f?s:s.fullpath());let A=new Set([s]);for(let O of A){let M=O.readdirSync();for(let W of M){(!v||v(W))&&(yield f?W:W.fullpath());let $=W;if(W.isSymbolicLink()){if(!(d&&($=W.realpathSync())))continue;$.isUnknown()&&$.lstatSync()}$.shouldWalk(A,E)&&A.add($)}}}stream(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=new SN({objectMode:!0});(!v||v(s))&&A.write(f?s:s.fullpath());let O=new Set,M=[s],W=0,$=t(()=>{let K=!1;for(;!K;){let Pe=M.shift();if(!Pe){W===0&&A.end();return}W++,O.add(Pe);let De=t((Ct,bt,hr=!1)=>{if(Ct)return A.emit("error",Ct);if(d&&!hr){let Pr=[];for(let jr of bt)jr.isSymbolicLink()&&Pr.push(jr.realpath().then(dr=>dr?.isUnknown()?dr.lstat():dr));if(Pr.length){Promise.all(Pr).then(()=>De(null,bt,!0));return}}for(let Pr of bt)Pr&&(!v||v(Pr))&&(A.write(f?Pr:Pr.fullpath())||(K=!0));W--;for(let Pr of bt){let jr=Pr.realpathCached()||Pr;jr.shouldWalk(O,E)&&M.push(jr)}K&&!A.flowing?A.once("drain",$):Se||$()},"onReaddir"),Se=!0;Pe.readdirCB(De,!0),Se=!1}},"process");return $(),A}streamSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=new SN({objectMode:!0}),O=new Set;(!v||v(s))&&A.write(f?s:s.fullpath());let M=[s],W=0,$=t(()=>{let K=!1;for(;!K;){let Pe=M.shift();if(!Pe){W===0&&A.end();return}W++,O.add(Pe);let De=Pe.readdirSync();for(let Se of De)(!v||v(Se))&&(A.write(f?Se:Se.fullpath())||(K=!0));W--;for(let Se of De){let Ct=Se;if(Se.isSymbolicLink()){if(!(d&&(Ct=Se.realpathSync())))continue;Ct.isUnknown()&&Ct.lstatSync()}Ct.shouldWalk(O,E)&&M.push(Ct)}}K&&!A.flowing&&A.once("drain",$)},"process");return $(),A}chdir(s=this.cwd){let c=this.cwd;this.cwd=typeof s=="string"?this.cwd.resolve(s):s,this.cwd[sft](c)}},tB=class extends cfe{static{t(this,"PathScurryWin32")}sep="\\";constructor(s=process.cwd(),c={}){let{nocase:f=!0}=c;super(s,mNe,"\\",{...c,nocase:f}),this.nocase=f;for(let d=this.cwd;d;d=d.parent)d.nocase=this.nocase}parseRootPath(s){return mNe.parse(s).root.toUpperCase()}newRoot(s){return new afe(this.rootPath,ek,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")||s.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(s)}},rB=class extends cfe{static{t(this,"PathScurryPosix")}sep="/";constructor(s=process.cwd(),c={}){let{nocase:f=!1}=c;super(s,Bsr,"/",{...c,nocase:f}),this.nocase=f}parseRootPath(s){return"/"}newRoot(s){return new ofe(this.rootPath,ek,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")}},DQ=class extends rB{static{t(this,"PathScurryDarwin")}constructor(s=process.cwd(),c={}){let{nocase:f=!0}=c;super(s,{...c,nocase:f})}},pLr=process.platform==="win32"?afe:ofe,aft=process.platform==="win32"?tB:process.platform==="darwin"?DQ:rB;var tar=t(a=>a.length>=1,"isPatternList"),rar=t(a=>a.length>=1,"isGlobList"),nB=class a{static{t(this,"Pattern")}#r;#n;#e;length;#t;#s;#p;#a;#_;#c;#l=!0;constructor(s,c,f,d){if(!tar(s))throw new TypeError("empty pattern list");if(!rar(c))throw new TypeError("empty glob list");if(c.length!==s.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=s.length,f<0||f>=this.length)throw new TypeError("index out of range");if(this.#r=s,this.#n=c,this.#e=f,this.#t=d,this.#e===0){if(this.isUNC()){let[v,E,A,O,...M]=this.#r,[W,$,K,Pe,...De]=this.#n;M[0]===""&&(M.shift(),De.shift());let Se=[v,E,A,O,""].join("/"),Ct=[W,$,K,Pe,""].join("/");this.#r=[Se,...M],this.#n=[Ct,...De],this.length=this.#r.length}else if(this.isDrive()||this.isAbsolute()){let[v,...E]=this.#r,[A,...O]=this.#n;E[0]===""&&(E.shift(),O.shift());let M=v+"/",W=A+"/";this.#r=[M,...E],this.#n=[W,...O],this.length=this.#r.length}}}pattern(){return this.#r[this.#e]}isString(){return typeof this.#r[this.#e]=="string"}isGlobstar(){return this.#r[this.#e]===iy}isRegExp(){return this.#r[this.#e]instanceof RegExp}globString(){return this.#p=this.#p||(this.#e===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#e).join("/"))}hasMore(){return this.length>this.#e+1}rest(){return this.#s!==void 0?this.#s:this.hasMore()?(this.#s=new a(this.#r,this.#n,this.#e+1,this.#t),this.#s.#c=this.#c,this.#s.#_=this.#_,this.#s.#a=this.#a,this.#s):this.#s=null}isUNC(){let s=this.#r;return this.#_!==void 0?this.#_:this.#_=this.#t==="win32"&&this.#e===0&&s[0]===""&&s[1]===""&&typeof s[2]=="string"&&!!s[2]&&typeof s[3]=="string"&&!!s[3]}isDrive(){let s=this.#r;return this.#a!==void 0?this.#a:this.#a=this.#t==="win32"&&this.#e===0&&this.length>1&&typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0])}isAbsolute(){let s=this.#r;return this.#c!==void 0?this.#c:this.#c=s[0]===""&&s.length>1||this.isDrive()||this.isUNC()}root(){let s=this.#r[0];return typeof s=="string"&&this.isAbsolute()&&this.#e===0?s:""}checkFollowGlobstar(){return!(this.#e===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#e===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var nar=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",iB=class{static{t(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(s,{nobrace:c,nocase:f,noext:d,noglobstar:v,platform:E=nar}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=E,this.mmopts={dot:!0,nobrace:c,nocase:f,noext:d,noglobstar:v,optimizationLevel:2,platform:E,nocomment:!0,nonegate:!0};for(let A of s)this.add(A)}add(s){let c=new wS(s,this.mmopts);for(let f=0;f<c.set.length;f++){let d=c.set[f],v=c.globParts[f];if(!d||!v)throw new Error("invalid pattern object");for(;d[0]==="."&&v[0]===".";)d.shift(),v.shift();let E=new nB(d,v,0,this.platform),A=new wS(E.globString(),this.mmopts),O=v[v.length-1]==="**",M=E.isAbsolute();M?this.absolute.push(A):this.relative.push(A),O&&(M?this.absoluteChildren.push(A):this.relativeChildren.push(A))}}ignored(s){let c=s.fullpath(),f=`${c}/`,d=s.relative()||".",v=`${d}/`;for(let E of this.relative)if(E.match(d)||E.match(v))return!0;for(let E of this.absolute)if(E.match(c)||E.match(f))return!0;return!1}childrenIgnored(s){let c=s.fullpath()+"/",f=(s.relative()||".")+"/";for(let d of this.relativeChildren)if(d.match(f))return!0;for(let d of this.absoluteChildren)if(d.match(c))return!0;return!1}};var gNe=class a{static{t(this,"HasWalkedCache")}store;constructor(s=new Map){this.store=s}copy(){return new a(new Map(this.store))}hasWalked(s,c){return this.store.get(s.fullpath())?.has(c.globString())}storeWalked(s,c){let f=s.fullpath(),d=this.store.get(f);d?d.add(c.globString()):this.store.set(f,new Set([c.globString()]))}},yNe=class{static{t(this,"MatchRecord")}store=new Map;add(s,c,f){let d=(c?2:0)|(f?1:0),v=this.store.get(s);this.store.set(s,v===void 0?d:d&v)}entries(){return[...this.store.entries()].map(([s,c])=>[s,!!(c&2),!!(c&1)])}},vNe=class{static{t(this,"SubWalks")}store=new Map;add(s,c){if(!s.canReaddir())return;let f=this.store.get(s);f?f.find(d=>d.globString()===c.globString())||f.push(c):this.store.set(s,[c])}get(s){let c=this.store.get(s);if(!c)throw new Error("attempting to walk unknown path");return c}entries(){return this.keys().map(s=>[s,this.store.get(s)])}keys(){return[...this.store.keys()].filter(s=>s.canReaddir())}},AQ=class a{static{t(this,"Processor")}hasWalkedCache;matches=new yNe;subwalks=new vNe;patterns;follow;dot;opts;constructor(s,c){this.opts=s,this.follow=!!s.follow,this.dot=!!s.dot,this.hasWalkedCache=c?c.copy():new gNe}processPatterns(s,c){this.patterns=c;let f=c.map(d=>[s,d]);for(let[d,v]of f){this.hasWalkedCache.storeWalked(d,v);let E=v.root(),A=v.isAbsolute()&&this.opts.absolute!==!1;if(E){d=d.resolve(E==="/"&&this.opts.root!==void 0?this.opts.root:E);let $=v.rest();if($)v=$;else{this.matches.add(d,!0,!1);continue}}if(d.isENOENT())continue;let O,M,W=!1;for(;typeof(O=v.pattern())=="string"&&(M=v.rest());)d=d.resolve(O),v=M,W=!0;if(O=v.pattern(),M=v.rest(),W){if(this.hasWalkedCache.hasWalked(d,v))continue;this.hasWalkedCache.storeWalked(d,v)}if(typeof O=="string"){let $=O===".."||O===""||O===".";this.matches.add(d.resolve(O),A,$);continue}else if(O===iy){(!d.isSymbolicLink()||this.follow||v.checkFollowGlobstar())&&this.subwalks.add(d,v);let $=M?.pattern(),K=M?.rest();if(!M||($===""||$===".")&&!K)this.matches.add(d,A,$===""||$===".");else if($===".."){let Pe=d.parent||d;K?this.hasWalkedCache.hasWalked(Pe,K)||this.subwalks.add(Pe,K):this.matches.add(Pe,A,!0)}}else O instanceof RegExp&&this.subwalks.add(d,v)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new a(this.opts,this.hasWalkedCache)}filterEntries(s,c){let f=this.subwalks.get(s),d=this.child();for(let v of c)for(let E of f){let A=E.isAbsolute(),O=E.pattern(),M=E.rest();O===iy?d.testGlobstar(v,E,M,A):O instanceof RegExp?d.testRegExp(v,O,M,A):d.testString(v,O,M,A)}return d}testGlobstar(s,c,f,d){if((this.dot||!s.name.startsWith("."))&&(c.hasMore()||this.matches.add(s,d,!1),s.canReaddir()&&(this.follow||!s.isSymbolicLink()?this.subwalks.add(s,c):s.isSymbolicLink()&&(f&&c.checkFollowGlobstar()?this.subwalks.add(s,f):c.markFollowGlobstar()&&this.subwalks.add(s,c)))),f){let v=f.pattern();if(typeof v=="string"&&v!==".."&&v!==""&&v!==".")this.testString(s,v,f.rest(),d);else if(v===".."){let E=s.parent||s;this.subwalks.add(E,f)}else v instanceof RegExp&&this.testRegExp(s,v,f.rest(),d)}}testRegExp(s,c,f,d){c.test(s.name)&&(f?this.subwalks.add(s,f):this.matches.add(s,d,!1))}testString(s,c,f,d){s.isNamed(c)&&(f?this.subwalks.add(s,f):this.matches.add(s,d,!1))}};var iar=t((a,s)=>typeof a=="string"?new iB([a],s):Array.isArray(a)?new iB(a,s):a,"makeIgnore"),lfe=class{static{t(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#r=[];#n;#e;signal;maxDepth;includeChildMatches;constructor(s,c,f){if(this.patterns=s,this.path=c,this.opts=f,this.#e=!f.posix&&f.platform==="win32"?"\\":"/",this.includeChildMatches=f.includeChildMatches!==!1,(f.ignore||!this.includeChildMatches)&&(this.#n=iar(f.ignore??[],f),!this.includeChildMatches&&typeof this.#n.add!="function")){let d="cannot ignore child matches, ignore lacks add() method.";throw new Error(d)}this.maxDepth=f.maxDepth||1/0,f.signal&&(this.signal=f.signal,this.signal.addEventListener("abort",()=>{this.#r.length=0}))}#t(s){return this.seen.has(s)||!!this.#n?.ignored?.(s)}#s(s){return!!this.#n?.childrenIgnored?.(s)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let s;for(;!this.paused&&(s=this.#r.shift());)s()}onResume(s){this.signal?.aborted||(this.paused?this.#r.push(s):s())}async matchCheck(s,c){if(c&&this.opts.nodir)return;let f;if(this.opts.realpath){if(f=s.realpathCached()||await s.realpath(),!f)return;s=f}let v=s.isUnknown()||this.opts.stat?await s.lstat():s;if(this.opts.follow&&this.opts.nodir&&v?.isSymbolicLink()){let E=await v.realpath();E&&(E.isUnknown()||this.opts.stat)&&await E.lstat()}return this.matchCheckTest(v,c)}matchCheckTest(s,c){return s&&(this.maxDepth===1/0||s.depth()<=this.maxDepth)&&(!c||s.canReaddir())&&(!this.opts.nodir||!s.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!s.isSymbolicLink()||!s.realpathCached()?.isDirectory())&&!this.#t(s)?s:void 0}matchCheckSync(s,c){if(c&&this.opts.nodir)return;let f;if(this.opts.realpath){if(f=s.realpathCached()||s.realpathSync(),!f)return;s=f}let v=s.isUnknown()||this.opts.stat?s.lstatSync():s;if(this.opts.follow&&this.opts.nodir&&v?.isSymbolicLink()){let E=v.realpathSync();E&&(E?.isUnknown()||this.opts.stat)&&E.lstatSync()}return this.matchCheckTest(v,c)}matchFinish(s,c){if(this.#t(s))return;if(!this.includeChildMatches&&this.#n?.add){let v=`${s.relativePosix()}/**`;this.#n.add(v)}let f=this.opts.absolute===void 0?c:this.opts.absolute;this.seen.add(s);let d=this.opts.mark&&s.isDirectory()?this.#e:"";if(this.opts.withFileTypes)this.matchEmit(s);else if(f){let v=this.opts.posix?s.fullpathPosix():s.fullpath();this.matchEmit(v+d)}else{let v=this.opts.posix?s.relativePosix():s.relative(),E=this.opts.dotRelative&&!v.startsWith(".."+this.#e)?"."+this.#e:"";this.matchEmit(v?E+v+d:"."+d)}}async match(s,c,f){let d=await this.matchCheck(s,f);d&&this.matchFinish(d,c)}matchSync(s,c,f){let d=this.matchCheckSync(s,f);d&&this.matchFinish(d,c)}walkCB(s,c,f){this.signal?.aborted&&f(),this.walkCB2(s,c,new AQ(this.opts),f)}walkCB2(s,c,f,d){if(this.#s(s))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2(s,c,f,d));return}f.processPatterns(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,M]of f.matches.entries())this.#t(A)||(v++,this.match(A,O,M).then(()=>E()));for(let A of f.subwalkTargets()){if(this.maxDepth!==1/0&&A.depth()>=this.maxDepth)continue;v++;let O=A.readdirCached();A.calledReaddir()?this.walkCB3(A,O,f,E):A.readdirCB((M,W)=>this.walkCB3(A,W,f,E),!0)}E()}walkCB3(s,c,f,d){f=f.filterEntries(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,M]of f.matches.entries())this.#t(A)||(v++,this.match(A,O,M).then(()=>E()));for(let[A,O]of f.subwalks.entries())v++,this.walkCB2(A,O,f.child(),E);E()}walkCBSync(s,c,f){this.signal?.aborted&&f(),this.walkCB2Sync(s,c,new AQ(this.opts),f)}walkCB2Sync(s,c,f,d){if(this.#s(s))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2Sync(s,c,f,d));return}f.processPatterns(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,M]of f.matches.entries())this.#t(A)||this.matchSync(A,O,M);for(let A of f.subwalkTargets()){if(this.maxDepth!==1/0&&A.depth()>=this.maxDepth)continue;v++;let O=A.readdirSync();this.walkCB3Sync(A,O,f,E)}E()}walkCB3Sync(s,c,f,d){f=f.filterEntries(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,M]of f.matches.entries())this.#t(A)||this.matchSync(A,O,M);for(let[A,O]of f.subwalks.entries())v++,this.walkCB2Sync(A,O,f.child(),E);E()}},kQ=class extends lfe{static{t(this,"GlobWalker")}matches=new Set;constructor(s,c,f){super(s,c,f)}matchEmit(s){this.matches.add(s)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((s,c)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?c(this.signal.reason):s(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},wQ=class extends lfe{static{t(this,"GlobStream")}results;constructor(s,c,f){super(s,c,f),this.results=new SN({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(s){this.results.write(s),this.results.flowing||this.pause()}stream(){let s=this.path;return s.isUnknown()?s.lstat().then(()=>{this.walkCB(s,this.patterns,()=>this.results.end())}):this.walkCB(s,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var aar=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",xx=class{static{t(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(s,c){if(!c)throw new TypeError("glob options required");if(this.withFileTypes=!!c.withFileTypes,this.signal=c.signal,this.follow=!!c.follow,this.dot=!!c.dot,this.dotRelative=!!c.dotRelative,this.nodir=!!c.nodir,this.mark=!!c.mark,c.cwd?(c.cwd instanceof URL||c.cwd.startsWith("file://"))&&(c.cwd=sar(c.cwd)):this.cwd="",this.cwd=c.cwd||"",this.root=c.root,this.magicalBraces=!!c.magicalBraces,this.nobrace=!!c.nobrace,this.noext=!!c.noext,this.realpath=!!c.realpath,this.absolute=c.absolute,this.includeChildMatches=c.includeChildMatches!==!1,this.noglobstar=!!c.noglobstar,this.matchBase=!!c.matchBase,this.maxDepth=typeof c.maxDepth=="number"?c.maxDepth:1/0,this.stat=!!c.stat,this.ignore=c.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof s=="string"&&(s=[s]),this.windowsPathsNoEscape=!!c.windowsPathsNoEscape||c.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(s=s.map(O=>O.replace(/\\/g,"/"))),this.matchBase){if(c.noglobstar)throw new TypeError("base matching requires globstar");s=s.map(O=>O.includes("/")?O:`./**/${O}`)}if(this.pattern=s,this.platform=c.platform||aar,this.opts={...c,platform:this.platform},c.scurry){if(this.scurry=c.scurry,c.nocase!==void 0&&c.nocase!==c.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let O=c.platform==="win32"?tB:c.platform==="darwin"?DQ:c.platform?rB:aft;this.scurry=new O(this.cwd,{nocase:c.nocase,fs:c.fs})}this.nocase=this.scurry.nocase;let f=this.platform==="darwin"||this.platform==="win32",d={...c,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:f,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},v=this.pattern.map(O=>new wS(O,d)),[E,A]=v.reduce((O,M)=>(O[0].push(...M.set),O[1].push(...M.globParts),O),[[],[]]);this.patterns=E.map((O,M)=>{let W=A[M];if(!W)throw new Error("invalid pattern object");return new nB(O,W,0,this.platform)})}async walk(){return[...await new kQ(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new kQ(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new wQ(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new wQ(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var bNe=t((a,s={})=>{Array.isArray(a)||(a=[a]);for(let c of a)if(new wS(c,s).hasMagic())return!0;return!1},"hasMagic");function ufe(a,s={}){return new xx(a,s).streamSync()}t(ufe,"globStreamSync");function cft(a,s={}){return new xx(a,s).stream()}t(cft,"globStream");function lft(a,s={}){return new xx(a,s).walkSync()}t(lft,"globSync");async function oft(a,s={}){return new xx(a,s).walk()}t(oft,"glob_");function ffe(a,s={}){return new xx(a,s).iterateSync()}t(ffe,"globIterateSync");function uft(a,s={}){return new xx(a,s).iterate()}t(uft,"globIterate");var oar=ufe,car=Object.assign(cft,{sync:ufe}),lar=ffe,uar=Object.assign(uft,{sync:ffe}),far=Object.assign(lft,{stream:ufe,iterate:ffe}),PQ=Object.assign(oft,{glob:oft,globSync:lft,sync:far,globStream:cft,stream:car,globStreamSync:ufe,streamSync:oar,globIterate:uft,iterate:uar,globIterateSync:ffe,iterateSync:lar,Glob:xx,hasMagic:bNe,escape:Kj,unescape:Tx});PQ.glob=PQ;import jde from"node:fs";import QLe from"node:path";var Av=class extends Error{static{t(this,"CompilationError")}buildMessages;constructor(s){super("An error occurred during compilation."),this.buildMessages=Array.isArray(s)?s:[s]}toBuildResult(){return{content:"",errors:this.buildMessages}}};var _ar="[",par="]",dar="{",mar="}",har=":",gar=",",yar="true",bar="false",Sar="null",Tar="NaN",Car="Infinity",TNe='"',NQ=new Map([[34,TNe],[92,"\\"],[47,"/"],[98,"\b"],[110,`
|
|
576
576
|
`],[102,"\f"],[114,"\r"],[116," "]]),dfe=new Map([...NQ,[118,"\v"],[48,"\0"]]),Ear=new Map([[TNe,TNe],["\\","\\"],["/","/"],["\b","b"],[`
|
|
577
577
|
`,"n"],["\f","f"],["\r","r"],[" ","t"]]),XLr=new Map([...Ear,["\v","v"],["\0","0"],["\u2028","u2028"],["\u2029","u2029"]]),pfe=new Map([[_ar,"LBracket"],[par,"RBracket"],[dar,"LBrace"],[mar,"RBrace"],[har,"Colon"],[gar,"Comma"],[yar,"Boolean"],[bar,"Boolean"],[Sar,"Null"]]),_fe=new Map([...pfe,[Tar,"Number"],[Car,"Number"]]),CNe=new Set([10,13,8232,8233]),a6=class extends Error{static{t(this,"ErrorWithLocation")}constructor(s,{line:c,column:f,offset:d}){super(`${s} (${c}:${f})`),this.line=c,this.column=f,this.offset=d}},ENe=class extends a6{static{t(this,"UnexpectedChar")}constructor(s,c){super(`Unexpected character '${String.fromCharCode(s)}' found.`,c)}},xNe=class extends a6{static{t(this,"UnexpectedIdentifier")}constructor(s,c){super(`Unexpected identifier '${s}' found.`,c)}},GF=class extends a6{static{t(this,"UnexpectedToken")}constructor(s){super(`Unexpected token ${s.type} found.`,s.loc.start)}},mfe=class extends a6{static{t(this,"UnexpectedEOF")}constructor(s){super("Unexpected end of input found.",s)}},xar=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Dar=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Aar=13,fft=10,DNe=class{static{t(this,"CharCodeReader")}#r="";#n=1;#e=0;#t=-1;#s=!1;#p=-1;#a=!1;constructor(s){this.#r=s}#_(){this.#a||(this.#e++,this.#t++,this.#p=-1,this.#a=!0)}locate(){return{line:this.#n,column:this.#e,offset:this.#t}}next(){if(this.#t>=this.#r.length-1)return this.#_(),-1;this.#t++;let s=this.#r.charCodeAt(this.#t);return this.#s?(this.#n++,this.#e=1,this.#s=!1):this.#e++,s===Aar?(this.#s=!0,this.peek()===fft&&this.#t++):s===fft&&(this.#s=!0),this.#p=s,s}peek(){return this.#t===this.#r.length-1?-1:this.#r.charCodeAt(this.#t+1)}match(s){return s(this.peek())?(this.next(),!0):!1}current(){return this.#p}},kar="Infinity",war="NaN",Par=new Set([116,102,110]),ANe=new Set([32,9,10,13]),_ft=new Set([...ANe,11,12,160,8232,8233,65279,160,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288]),Nar={mode:"json",ranges:!1},Iar=new Set(["true","false","null"]),W_={EOF:0,Number:1,String:2,Boolean:3,Null:4,NaN:5,Infinity:6,Identifier:7,Colon:20,LBrace:21,RBrace:22,LBracket:23,RBracket:24,Comma:25,LineComment:40,BlockComment:41};function s6(a){return a>=48&&a<=57}t(s6,"isDigit");function SNe(a){return s6(a)||a>=65&&a<=70||a>=97&&a<=102}t(SNe,"isHexDigit");function Oar(a){return a>=49&&a<=57}t(Oar,"isPositiveDigit");function Far(a){return Par.has(a)}t(Far,"isKeywordStart");function dft(a){return s6(a)||a===46||a===45}t(dft,"isNumberStart");function Lar(a){return dft(a)||a===43}t(Lar,"isJSON5NumberStart");function pft(a,s){return a===34||s&&a===39}t(pft,"isStringStart");function mft(a){if(a===36||a===95||a===92||a>=97&&a<=122||a>=65&&a<=90||a===8204||a===8205)return!0;let s=String.fromCharCode(a);return xar.test(s)}t(mft,"isJSON5IdentifierStart");function Rar(a){if(mft(a)||s6(a))return!0;let s=String.fromCharCode(a);return Dar.test(s)}t(Rar,"isJSON5IdentifierPart");var kNe=class{static{t(this,"Tokenizer")}#r;#n;#e;#t;#s;#p;#a;#_;#c;#l;#i;constructor(s,c){this.#n=s,this.#r={...Nar,...c},this.#e=new DNe(s),this.#t=this.#r.mode==="json5",this.#s=this.#r.mode!=="json",this.#p=this.#r.ranges,this.#_=this.#t?dfe.has.bind(dfe):NQ.has.bind(NQ),this.#c=this.#t?CNe.has.bind(CNe):()=>!1,this.#l=this.#t?f=>f===120:()=>!1,this.#i=this.#t?_ft.has.bind(_ft):ANe.has.bind(ANe)}#f(s,c=this.#e.locate()){throw new ENe(s,c)}#v(s,c=this.#e.locate()){throw new xNe(s,c)}#d(){throw new mfe(this.#e.locate())}#u(s,c,f,d){let v=f.offset+c,E=this.#r.ranges?{range:[f.offset,v]}:void 0;return{type:s,loc:{start:f,end:d||{line:f.line,column:f.column+c,offset:v}},...E}}#m(s){let c="",f;for(let d=0;d<s;d++){if(f=this.#e.peek(),SNe(f)){this.#e.next(),c+=String.fromCharCode(f);continue}this.#f(f)}return c}#g(s){let c="";do{if(c+=String.fromCharCode(s),s===92&&(s=this.#e.next(),s!==117&&this.#f(s),c+=String.fromCharCode(s),c+=this.#m(4)),s=this.#e.peek(),!Rar(s))break;this.#e.next()}while(!0);return c}#x(s){let c=s,f=1;for(s=this.#e.peek();s!==-1&&s!==c;){if(this.#e.next(),f++,s===92)if(s=this.#e.peek(),this.#_(s)||this.#c(s))this.#e.next(),f++;else if(s===117){this.#e.next(),f++;let d=this.#m(4);f+=d.length}else if(this.#l(s)){this.#e.next(),f++;let d=this.#m(2);f+=d.length}else this.#t?(this.#e.next(),f++):this.#f(s);s=this.#e.peek()}return s===-1&&(this.#e.next(),this.#d()),this.#e.next(),f++,f}#C(s){let c=1;if(s===45||this.#t&&s===43){if(s=this.#e.peek(),this.#t&&(s===73||s===78)){this.#e.next();let f=this.#g(s);return f!==kar&&f!==war&&this.#f(s),c+f.length}s6(s)||this.#f(s),this.#e.next(),c++}if(s===48)if(s=this.#e.peek(),this.#t&&(s===120||s===88)){this.#e.next(),c++,s=this.#e.peek(),SNe(s)||(this.#e.next(),this.#f(s));do this.#e.next(),c++,s=this.#e.peek();while(SNe(s))}else s6(s)&&this.#f(s);else if(!this.#t||s!==46)for(Oar(s)||this.#f(s),s=this.#e.peek();s6(s);)this.#e.next(),c++,s=this.#e.peek();if(s===46){let f=-1;for(this.#e.next(),c++,f++,s=this.#e.peek();s6(s);)this.#e.next(),c++,f++,s=this.#e.peek();!this.#t&&f===0&&(this.#e.next(),s?this.#f(s):this.#d())}if(s===101||s===69)for(this.#e.next(),c++,s=this.#e.peek(),(s===43||s===45)&&(this.#e.next(),c++,s=this.#e.peek()),s===-1&&(this.#e.next(),this.#d()),s6(s)||(this.#e.next(),this.#f(s));s6(s);)this.#e.next(),c++,s=this.#e.peek();return c}#b(s){let c=1;if(s=this.#e.peek(),s===47){do this.#e.next(),c+=1,s=this.#e.peek();while(s>-1&&s!==13&&s!==10);return{length:c,multiline:!1}}if(s===42){for(this.#e.next(),c+=1;s>-1;)if(s=this.#e.peek(),s===42){if(this.#e.next(),c+=1,s=this.#e.peek(),s===47)return this.#e.next(),c+=1,{length:c,multiline:!0}}else this.#e.next(),c+=1;this.#e.next(),this.#d()}this.#e.next(),this.#f(s)}next(){let s=this.#e.next();for(;this.#i(s);)s=this.#e.next();if(s===-1)return W_.EOF;let c=this.#e.locate(),f=String.fromCharCode(s);if(this.#t)if(_fe.has(f))this.#a=this.#u(_fe.get(f),1,c);else if(mft(s)){let d=this.#g(s);_fe.has(d)?this.#a=this.#u(_fe.get(d),d.length,c):this.#a=this.#u("Identifier",d.length,c)}else if(Lar(s)){let d=this.#C(s);this.#a=this.#u("Number",d,c)}else if(pft(s,this.#t)){let d=this.#x(s),v=this.#e.locate();this.#a=this.#u("String",d,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else if(s===47&&this.#s){let d=this.#b(s),v=this.#e.locate();this.#a=this.#u(d.multiline?"BlockComment":"LineComment",d.length,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else this.#f(s);else if(pfe.has(f))this.#a=this.#u(pfe.get(f),1,c);else if(Far(s)){let d=this.#g(s);Iar.has(d)||this.#v(d,c),this.#a=this.#u(pfe.get(d),d.length,c)}else if(dft(s)){let d=this.#C(s);this.#a=this.#u("Number",d,c)}else if(pft(s,this.#t)){let d=this.#x(s);this.#a=this.#u("String",d,c)}else if(s===47&&this.#s){let d=this.#b(s),v=this.#e.locate();this.#a=this.#u(d.multiline?"BlockComment":"LineComment",d.length,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else this.#f(s);return W_[this.#a.type]}get token(){return this.#a}};var gC={document(a,s={}){return{type:"Document",body:a,loc:s.loc,...s}},string(a,s={}){return{type:"String",value:a,loc:s.loc,...s}},number(a,s={}){return{type:"Number",value:a,loc:s.loc,...s}},boolean(a,s={}){return{type:"Boolean",value:a,loc:s.loc,...s}},null(a={}){return{type:"Null",loc:a.loc,...a}},array(a,s={}){return{type:"Array",elements:a,loc:s.loc,...s}},element(a,s={}){return{type:"Element",value:a,loc:s.loc,...s}},object(a,s={}){return{type:"Object",members:a,loc:s.loc,...s}},member(a,s,c={}){return{type:"Member",name:a,value:s,loc:c.loc,...c}},identifier(a,s={}){return{type:"Identifier",name:a,loc:s.loc,...s}},nan(a="",s={}){return{type:"NaN",sign:a,loc:s.loc,...s}},infinity(a="",s={}){return{type:"Infinity",sign:a,loc:s.loc,...s}}},Mar={mode:"json",ranges:!1,tokens:!1,allowTrailingCommas:!1};function jar(a,s,c=!1){let f="",d=a.indexOf("\\"),v=0;for(;d>=0;){f+=a.slice(v,d);let E=a.charAt(d+1),A=E.charCodeAt(0);if(c&&dfe.has(A))f+=dfe.get(A),v=d+2;else if(NQ.has(A))f+=NQ.get(A),v=d+2;else if(E==="u"){let O=a.slice(d+2,d+6);if(O.length<4||/[^0-9a-f]/i.test(O))throw new a6(`Invalid unicode escape \\u${O}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});f+=String.fromCharCode(parseInt(O,16)),v=d+6}else if(c&&E==="x"){let O=a.slice(d+2,d+4);if(O.length<2||/[^0-9a-f]/i.test(O))throw new a6(`Invalid hex escape \\x${O}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});f+=String.fromCharCode(parseInt(O,16)),v=d+4}else if(c&&CNe.has(A))v=d+2,E==="\r"&&a.charAt(v)===`
|
|
578
|
-
`&&v++;else if(c)f+=E,v=d+2;else throw new a6(`Invalid escape \\${E}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});d=a.indexOf("\\",v)}return f+=a.slice(v),f}t(jar,"getStringValue");function Bar(a,s,c=!1){switch(s.type){case"Boolean":return a==="true";case"Number":return Number(a);case"String":return jar(a.slice(1,-1),s,c);default:throw new TypeError(`Unknown token type "${s.type}.`)}}t(Bar,"getLiteralValue");function hft(a,s){s=Object.freeze({...Mar,...s});let c=[],f=new kNe(a,{mode:s.mode,ranges:s.ranges}),d=s.mode==="json5",v=s.allowTrailingCommas||d;function E(){let _r=f.next();return _r&&s.tokens&&c.push(f.token),_r}t(E,"nextNoComments");function A(){let _r=f.next();return _r&&s.tokens&&c.push(f.token),_r>=W_.LineComment?A():_r}t(A,"nextSkipComments");let O=s.mode==="json"?E:A;function M(_r,ir){if(_r!==ir)throw new GF(f.token)}t(M,"assertTokenType");function W(_r,ir){if(!ir.includes(_r))throw new GF(f.token)}t(W,"assertTokenTypes");function $(_r,ir){return s.ranges?{range:[_r.offset,ir.offset]}:void 0}t($,"createRange");function K(_r){let ir=f.token,ts=$(ir.loc.start,ir.loc.end),Fi=Bar(a.slice(ir.loc.start.offset,ir.loc.end.offset),ir,d),ai={loc:{start:{...ir.loc.start},end:{...ir.loc.end}},...ts};switch(_r){case W_.String:return gC.string(Fi,ai);case W_.Number:return gC.number(Fi,ai);case W_.Boolean:return gC.boolean(Fi,ai);default:throw new TypeError(`Unknown token type ${ir.type}.`)}}t(K,"createLiteralNode");function Pe(_r){let ir=$(_r.loc.start,_r.loc.end),ts=a.slice(_r.loc.start.offset,_r.loc.end.offset),rs={loc:{start:{..._r.loc.start},end:{..._r.loc.end}},...ir};if(_r.type!=="Identifier"){let ai="";return(ts[0]==="+"||ts[0]==="-")&&(ai=ts[0]),gC[ts.includes("NaN")?"nan":"infinity"](ai,rs)}return gC.identifier(ts,rs)}t(Pe,"createJSON5IdentifierNode");function De(_r){let ir=$(_r.loc.start,_r.loc.end);return gC.null({loc:{start:{..._r.loc.start},end:{..._r.loc.end}},...ir})}t(De,"createNullNode");function Se(_r){d?W(_r,[W_.String,W_.Identifier,W_.Number]):M(_r,W_.String);let ir=f.token,ts=_r===W_.String?K(_r):Pe(ir);if(d&&(ts.type==="NaN"||ts.type==="Infinity")){if(ts.sign!=="")throw new GF(f.token);ts=gC.identifier(ts.type,{loc:ts.loc,...$(ts.loc.start,ts.loc.end)})}_r=O(),M(_r,W_.Colon);let Fi=hr(),rs=$(ts.loc.start,Fi.loc.end);return gC.member(ts,Fi,{loc:{start:{...ts.loc.start},end:{...Fi.loc.end}},...rs})}t(Se,"parseProperty");function Ct(_r){M(_r,W_.LBrace);let ir=f.token,ts=[],Fi=O();if(Fi!==W_.RBrace)do{if(ts.push(Se(Fi)),Fi=O(),!Fi)throw new mfe(ts[ts.length-1].loc.end);if(Fi===W_.Comma){if(Fi=O(),v&&Fi===W_.RBrace)break}else break}while(Fi);M(Fi,W_.RBrace);let rs=f.token,ai=$(ir.loc.start,rs.loc.end);return gC.object(ts,{loc:{start:{...ir.loc.start},end:{...rs.loc.end}},...ai})}t(Ct,"parseObject");function bt(_r){M(_r,W_.LBracket);let ir=f.token,ts=[],Fi=O();if(Fi!==W_.RBracket)do{let _o=hr(Fi);if(ts.push(gC.element(_o,{loc:_o.loc})),Fi=O(),Fi===W_.Comma){if(Fi=O(),v&&Fi===W_.RBracket)break}else break}while(Fi);M(Fi,W_.RBracket);let rs=f.token,ai=$(ir.loc.start,rs.loc.end);return gC.array(ts,{loc:{start:{...ir.loc.start},end:{...rs.loc.end}},...ai})}t(bt,"parseArray");function hr(_r){_r=_r??O();let ir=f.token;switch(_r){case W_.String:case W_.Boolean:return K(_r);case W_.Number:if(d){let ts=a.slice(ir.loc.start.offset,ir.loc.end.offset);if((ts[0]==="+"||ts[0]==="-")&&(ts=ts.slice(1)),ts==="NaN"||ts==="Infinity")return Pe(ir)}return K(_r);case W_.Null:return De(ir);case W_.LBrace:return Ct(_r);case W_.LBracket:return bt(_r);default:throw new GF(ir)}}t(hr,"parseValue");let Pr=hr();if(O())throw new GF(f.token);let dr={loc:{start:{line:1,column:1,offset:0},end:{...Pr.loc.end}}};return s.tokens&&(dr.tokens=c),s.ranges&&(dr.range=[dr.loc.start.offset,dr.loc.end.offset]),gC.document(Pr,dr)}t(hft,"parse");var Uar=new Map([["Document",["body"]],["Object",["members"]],["Member",["name","value"]],["Element",["value"]],["Array",["elements"]],["String",[]],["Number",[]],["Boolean",[]],["Null",[]],["NaN",[]],["Infinity",[]],["Identifier",[]]]);function gft(a){return a&&typeof a=="object"}t(gft,"isObject");function $ar(a){return gft(a)&&typeof a.type=="string"}t($ar,"isNode");function Jar(a,s){function c(f,d){typeof s.enter=="function"&&s.enter(f,d);for(let v of Uar.get(f.type)){let E=f[v];gft(E)&&(Array.isArray(E)?E.forEach(A=>c(A,f)):$ar(E)&&c(E,f))}typeof s.exit=="function"&&s.exit(f,d)}t(c,"visitNode"),c(a)}t(Jar,"traverse");function yft(a,s=()=>!0){let c=[];return Jar(a,{enter(f,d){c.push({node:f,parent:d,phase:"enter"})},exit(f,d){c.push({node:f,parent:d,phase:"exit"})}}),c.filter(s).values()}t(yft,"iterator");import qar from"node:fs/promises";var IQ=t((a,s)=>a.split(/\r?\n/)[s-1],"getFileLineContent"),hfe=t(async a=>{try{return await qar.readFile(a,"utf-8")}catch{return}},"getSchemaContent"),OQ=t(async a=>{try{return hft(a)}catch(s){if(s.column&&s.line&&s.message){let c=IQ(a,s.line);return{column:s.column,line:s.line,length:void 0,lineText:c}}return}},"getSchemaAST");var vft=t(async(a,s,c)=>{try{if(a.length===0)return;for(let f of a){let d=await hfe(f),v=await zar(d,f,s,c);if(v)return v}}catch{}},"getRouteLocationByValue"),zar=t(async(a,s,c,f)=>{try{if(!a)return;let d=null,v=await OQ(a);if(v){for(let{node:E}of yft(v))if(E.value&&E.value===c){d=E.loc;break}if(d!==null){let E=IQ(a,d.start.line);return{file:s,line:d.start.line,column:d.start.column,length:d.end.column-d.start.column,lineText:E,suggestion:f}}}}catch{}},"getRouteLocationByValueFromSchema");import bft from"node:fs/promises";import tk from"node:path";var wNe="schemas",PNe=".oas.json";var QF=t(async a=>(await bft.readdir(a)).map(c=>`${a}/${c}`).filter(c=>c.endsWith(PNe)).sort(),"getOpenApiFilesByAlphabetical"),sB=t(async a=>{let s=tk.resolve(a,"config");return(await bft.readdir(s)).filter(f=>f.endsWith(PNe)).length>=1},"oasFileInProject");function FQ(a,s,c,f,d,v,E){if(v.has(c))return;let A;try{A=f.get(c)}catch(De){throw new Ev({text:`Failed to resolve reference: ${c}`,detail:De.message,severity:"error",message:"Failed to resolve reference",location:{file:a,column:0,line:0,length:0,lineText:c,namespace:s,suggestion:"Check the reference and try again."}})}let O=yfe(c),M=tk.basename(O,tk.extname(O)),W=c.indexOf("#"),$=W>=0?c.substring(0,W):c,K=W>=0?c.substring(W+1):"",Pe=f.get($);if(K){let De=K.split("/").filter(Boolean);for(let Se of De)if(Pe=Pe[Se],Pe===void 0)throw new Error(`Cannot resolve JSON pointer: ${K}`)}if(Pe&&typeof Pe=="object"&&"$ref"in Pe){let De=tk.resolve(tk.dirname($),Pe.$ref);O=De,M=tk.basename(O,tk.extname(O)),$=De,v.set($,d.length),d.push($),gfe(O,M,A,f,d,v,E)}else v.set(c,d.length),d.push(c),gfe(yfe(c),s,A,f,d,v,E)}t(FQ,"chaseRefs");function gfe(a,s,c,f,d,v,E){if(Array.isArray(c))for(let A of c)gfe(a,s,A,f,d,v,E);else if(typeof c=="object")for(let A in c){if(A==="$ref"){let O=c[A];E&&(c[A]=E(s,O)),FQ(a,s,TN(a,O),f,d,v,E)}gfe(a,s,c[A],f,d,v,E)}}t(gfe,"lookForRefs");function TN(a,s){let c=s.indexOf("#");return c>=0?`${tk.resolve(a,s.substring(0,c))}${s.substring(c)}`:tk.resolve(tk.dirname(a),s)}t(TN,"getFullyQualifiedRefName");function yfe(a){let s=a.indexOf("#");return s>=0?a.substring(0,s):a}t(yfe,"getFilePathNameFromRefName");var YQ=jp(VIe(),1);var HIe={};Clt(HIe,{UnsafePathError:()=>Vfe,deleteFolder:()=>Jfr,dirExists:()=>WIe,fileExists:()=>Ifr,getParentDirFilename:()=>Bfr,isNotFileOrDirectory:()=>Ffr,listFolderContents:()=>Gpt,listFolders:()=>Rfr,mkDirTemp:()=>Ofr,mkdirForFilePathIfNotExits:()=>Mfr,mkdirIfNotExists:()=>Qpt,safePath:()=>jfr,tarFolder:()=>Ufr,untarFile:()=>$fr});import{spawn as Wpt}from"node:child_process";import{randomUUID as wfr}from"node:crypto";import PN from"node:fs/promises";import{platform as Pfr,tmpdir as Nfr}from"node:os";import wN from"node:path";var Hpt=[".git","node_modules",".yarn",".DS_Store"];async function Ifr(a){try{return(await PN.stat(a)).isFile()}catch{return!1}}t(Ifr,"fileExists");async function Ofr(){let a=process.env.BUILD_FILE_PATH??Nfr(),s=wfr().replaceAll("-",""),c=wN.join(a,s);return await PN.mkdir(c,{recursive:!0}),c}t(Ofr,"mkDirTemp");async function WIe(a){try{return(await PN.stat(a)).isDirectory()}catch{return!1}}t(WIe,"dirExists");async function Ffr(a){try{return await PN.stat(a),!1}catch{return!0}}t(Ffr,"isNotFileOrDirectory");function Lfr(a,s){let c=new RegExp(`(.*)(\\/${s})$|(.*)(${s}\\/)`),f=a.match(c);if(!f)return"";let d=a.split(f[0]);return d[1]===""?"":`/${d[1]}`}t(Lfr,"getParentDirectory");async function Rfr(a){if(!await WIe(a))return[];let s=await PN.readdir(a,{withFileTypes:!0}),c=[];for await(let f of s)Hpt.includes(f.name)||f.isDirectory()&&c.push(f.name);return c}t(Rfr,"listFolders");async function Gpt(a,s,c=!0){let f=Lfr(a,s),d=await PN.readdir(a,{withFileTypes:!0}),v=[];for await(let E of d)if(!Hpt.includes(E.name)||!c)if(E.isDirectory()){let A=await Gpt(wN.join(a,E.name),s,c);v.push(...A)}else v.push(wN.join(f,E.name));return v}t(Gpt,"listFolderContents");var Qpt=t(async a=>{await PN.mkdir(a,{recursive:!0})},"mkdirIfNotExists"),Mfr=t(async a=>{let s=wN.dirname(a);return Qpt(s)},"mkdirForFilePathIfNotExits"),Vfe=class extends Error{static{t(this,"UnsafePathError")}constructor(s){super(s)}};function jfr(a){let s=t(c=>{if(!c.startsWith(a))throw new Vfe("Resolved path is not part of the project.");return c},"ensureSafePath");return{resolve:t((...c)=>s(wN.resolve(...c)),"resolve")}}t(jfr,"safePath");function Bfr(a){return`${wN.basename(wN.dirname(a))}/${wN.basename(a)}`}t(Bfr,"getParentDirFilename");async function Ufr({folderPath:a,outputTarPath:s,exclude:c=["node_modules",".git","dist"],logger:f}){let d=[],v=[],E;try{await new Promise((A,O)=>{let M=Wpt("tar",[...c.map(W=>["--exclude",W]).flat(),...Pfr()!=="darwin"?["--warning=no-file-changed"]:[],"-cvf",s,"-C",a,"."]);M.stdout.on("data",W=>{let $=W.toString().trim();$.length>0&&d.push($.trim())}),M.stderr.on("data",W=>{let $=W.toString().trim();$.length>0&&v.push($.trim())}),M.on("close",W=>{E=W,W===0?A():O(new Error(`tar process exited with code ${W}`))}),M.on("error",W=>{O(W)})})}catch(A){throw new Error("Failed to tar folder",{cause:A})}finally{f.info({stdout:d.join(`
|
|
578
|
+
`&&v++;else if(c)f+=E,v=d+2;else throw new a6(`Invalid escape \\${E}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});d=a.indexOf("\\",v)}return f+=a.slice(v),f}t(jar,"getStringValue");function Bar(a,s,c=!1){switch(s.type){case"Boolean":return a==="true";case"Number":return Number(a);case"String":return jar(a.slice(1,-1),s,c);default:throw new TypeError(`Unknown token type "${s.type}.`)}}t(Bar,"getLiteralValue");function hft(a,s){s=Object.freeze({...Mar,...s});let c=[],f=new kNe(a,{mode:s.mode,ranges:s.ranges}),d=s.mode==="json5",v=s.allowTrailingCommas||d;function E(){let _r=f.next();return _r&&s.tokens&&c.push(f.token),_r}t(E,"nextNoComments");function A(){let _r=f.next();return _r&&s.tokens&&c.push(f.token),_r>=W_.LineComment?A():_r}t(A,"nextSkipComments");let O=s.mode==="json"?E:A;function M(_r,ir){if(_r!==ir)throw new GF(f.token)}t(M,"assertTokenType");function W(_r,ir){if(!ir.includes(_r))throw new GF(f.token)}t(W,"assertTokenTypes");function $(_r,ir){return s.ranges?{range:[_r.offset,ir.offset]}:void 0}t($,"createRange");function K(_r){let ir=f.token,ts=$(ir.loc.start,ir.loc.end),Fi=Bar(a.slice(ir.loc.start.offset,ir.loc.end.offset),ir,d),ai={loc:{start:{...ir.loc.start},end:{...ir.loc.end}},...ts};switch(_r){case W_.String:return gC.string(Fi,ai);case W_.Number:return gC.number(Fi,ai);case W_.Boolean:return gC.boolean(Fi,ai);default:throw new TypeError(`Unknown token type ${ir.type}.`)}}t(K,"createLiteralNode");function Pe(_r){let ir=$(_r.loc.start,_r.loc.end),ts=a.slice(_r.loc.start.offset,_r.loc.end.offset),rs={loc:{start:{..._r.loc.start},end:{..._r.loc.end}},...ir};if(_r.type!=="Identifier"){let ai="";return(ts[0]==="+"||ts[0]==="-")&&(ai=ts[0]),gC[ts.includes("NaN")?"nan":"infinity"](ai,rs)}return gC.identifier(ts,rs)}t(Pe,"createJSON5IdentifierNode");function De(_r){let ir=$(_r.loc.start,_r.loc.end);return gC.null({loc:{start:{..._r.loc.start},end:{..._r.loc.end}},...ir})}t(De,"createNullNode");function Se(_r){d?W(_r,[W_.String,W_.Identifier,W_.Number]):M(_r,W_.String);let ir=f.token,ts=_r===W_.String?K(_r):Pe(ir);if(d&&(ts.type==="NaN"||ts.type==="Infinity")){if(ts.sign!=="")throw new GF(f.token);ts=gC.identifier(ts.type,{loc:ts.loc,...$(ts.loc.start,ts.loc.end)})}_r=O(),M(_r,W_.Colon);let Fi=hr(),rs=$(ts.loc.start,Fi.loc.end);return gC.member(ts,Fi,{loc:{start:{...ts.loc.start},end:{...Fi.loc.end}},...rs})}t(Se,"parseProperty");function Ct(_r){M(_r,W_.LBrace);let ir=f.token,ts=[],Fi=O();if(Fi!==W_.RBrace)do{if(ts.push(Se(Fi)),Fi=O(),!Fi)throw new mfe(ts[ts.length-1].loc.end);if(Fi===W_.Comma){if(Fi=O(),v&&Fi===W_.RBrace)break}else break}while(Fi);M(Fi,W_.RBrace);let rs=f.token,ai=$(ir.loc.start,rs.loc.end);return gC.object(ts,{loc:{start:{...ir.loc.start},end:{...rs.loc.end}},...ai})}t(Ct,"parseObject");function bt(_r){M(_r,W_.LBracket);let ir=f.token,ts=[],Fi=O();if(Fi!==W_.RBracket)do{let _o=hr(Fi);if(ts.push(gC.element(_o,{loc:_o.loc})),Fi=O(),Fi===W_.Comma){if(Fi=O(),v&&Fi===W_.RBracket)break}else break}while(Fi);M(Fi,W_.RBracket);let rs=f.token,ai=$(ir.loc.start,rs.loc.end);return gC.array(ts,{loc:{start:{...ir.loc.start},end:{...rs.loc.end}},...ai})}t(bt,"parseArray");function hr(_r){_r=_r??O();let ir=f.token;switch(_r){case W_.String:case W_.Boolean:return K(_r);case W_.Number:if(d){let ts=a.slice(ir.loc.start.offset,ir.loc.end.offset);if((ts[0]==="+"||ts[0]==="-")&&(ts=ts.slice(1)),ts==="NaN"||ts==="Infinity")return Pe(ir)}return K(_r);case W_.Null:return De(ir);case W_.LBrace:return Ct(_r);case W_.LBracket:return bt(_r);default:throw new GF(ir)}}t(hr,"parseValue");let Pr=hr();if(O())throw new GF(f.token);let dr={loc:{start:{line:1,column:1,offset:0},end:{...Pr.loc.end}}};return s.tokens&&(dr.tokens=c),s.ranges&&(dr.range=[dr.loc.start.offset,dr.loc.end.offset]),gC.document(Pr,dr)}t(hft,"parse");var Uar=new Map([["Document",["body"]],["Object",["members"]],["Member",["name","value"]],["Element",["value"]],["Array",["elements"]],["String",[]],["Number",[]],["Boolean",[]],["Null",[]],["NaN",[]],["Infinity",[]],["Identifier",[]]]);function gft(a){return a&&typeof a=="object"}t(gft,"isObject");function $ar(a){return gft(a)&&typeof a.type=="string"}t($ar,"isNode");function Jar(a,s){function c(f,d){typeof s.enter=="function"&&s.enter(f,d);for(let v of Uar.get(f.type)){let E=f[v];gft(E)&&(Array.isArray(E)?E.forEach(A=>c(A,f)):$ar(E)&&c(E,f))}typeof s.exit=="function"&&s.exit(f,d)}t(c,"visitNode"),c(a)}t(Jar,"traverse");function yft(a,s=()=>!0){let c=[];return Jar(a,{enter(f,d){c.push({node:f,parent:d,phase:"enter"})},exit(f,d){c.push({node:f,parent:d,phase:"exit"})}}),c.filter(s).values()}t(yft,"iterator");import qar from"node:fs/promises";var IQ=t((a,s)=>a.split(/\r?\n/)[s-1],"getFileLineContent"),hfe=t(async a=>{try{return await qar.readFile(a,"utf-8")}catch{return}},"getSchemaContent"),OQ=t(async a=>{try{return hft(a)}catch(s){if(s.column&&s.line&&s.message){let c=IQ(a,s.line);return{column:s.column,line:s.line,length:void 0,lineText:c}}return}},"getSchemaAST");var vft=t(async(a,s,c)=>{try{if(a.length===0)return;for(let f of a){let d=await hfe(f),v=await zar(d,f,s,c);if(v)return v}}catch{}},"getRouteLocationByValue"),zar=t(async(a,s,c,f)=>{try{if(!a)return;let d=null,v=await OQ(a);if(v){for(let{node:E}of yft(v))if(E.value&&E.value===c){d=E.loc;break}if(d!==null){let E=IQ(a,d.start.line);return{file:s,line:d.start.line,column:d.start.column,length:d.end.column-d.start.column,lineText:E,suggestion:f}}}}catch{}},"getRouteLocationByValueFromSchema");import bft from"node:fs/promises";import tk from"node:path";var wNe="schemas",PNe=".oas.json";var QF=t(async a=>(await bft.readdir(a)).map(c=>`${a}/${c}`).filter(c=>c.endsWith(PNe)).sort(),"getOpenApiFilesByAlphabetical"),sB=t(async a=>{let s=tk.resolve(a,"config");return(await bft.readdir(s)).filter(f=>f.endsWith(PNe)).length>=1},"oasFileInProject");function FQ(a,s,c,f,d,v,E){if(v.has(c))return;let A;try{A=f.get(c)}catch(De){throw new Ev({text:`Failed to resolve reference: ${c}`,detail:De.message,severity:"error",message:"Failed to resolve reference",location:{file:a,column:0,line:0,length:0,lineText:c,namespace:s,suggestion:"Check the reference and try again."}})}let O=yfe(c),M=tk.basename(O,tk.extname(O)),W=c.indexOf("#"),$=W>=0?c.substring(0,W):c,K=W>=0?c.substring(W+1):"",Pe=f.get($);if(K){let De=K.split("/").filter(Boolean);for(let Se of De)if(Pe=Pe[Se],Pe===void 0)throw new Error(`Cannot resolve JSON pointer: ${K}`)}if(Pe&&typeof Pe=="object"&&"$ref"in Pe&&typeof Pe.$ref=="string"&&!Pe.$ref.startsWith("#")){let De=tk.resolve(tk.dirname($),Pe.$ref);O=De,M=tk.basename(O,tk.extname(O)),$=De,v.set($,d.length),d.push($),gfe(O,M,A,f,d,v,E)}else v.set(c,d.length),d.push(c),gfe(yfe(c),s,A,f,d,v,E)}t(FQ,"chaseRefs");function gfe(a,s,c,f,d,v,E){if(Array.isArray(c))for(let A of c)gfe(a,s,A,f,d,v,E);else if(typeof c=="object")for(let A in c){if(A==="$ref"){let O=c[A];E&&(c[A]=E(s,O)),FQ(a,s,TN(a,O),f,d,v,E)}gfe(a,s,c[A],f,d,v,E)}}t(gfe,"lookForRefs");function TN(a,s){let c=s.indexOf("#");return c>=0?`${tk.resolve(a,s.substring(0,c))}${s.substring(c)}`:tk.resolve(tk.dirname(a),s)}t(TN,"getFullyQualifiedRefName");function yfe(a){let s=a.indexOf("#");return s>=0?a.substring(0,s):a}t(yfe,"getFilePathNameFromRefName");var YQ=jp(VIe(),1);var HIe={};Clt(HIe,{UnsafePathError:()=>Vfe,deleteFolder:()=>Jfr,dirExists:()=>WIe,fileExists:()=>Ifr,getParentDirFilename:()=>Bfr,isNotFileOrDirectory:()=>Ffr,listFolderContents:()=>Gpt,listFolders:()=>Rfr,mkDirTemp:()=>Ofr,mkdirForFilePathIfNotExits:()=>Mfr,mkdirIfNotExists:()=>Qpt,safePath:()=>jfr,tarFolder:()=>Ufr,untarFile:()=>$fr});import{spawn as Wpt}from"node:child_process";import{randomUUID as wfr}from"node:crypto";import PN from"node:fs/promises";import{platform as Pfr,tmpdir as Nfr}from"node:os";import wN from"node:path";var Hpt=[".git","node_modules",".yarn",".DS_Store"];async function Ifr(a){try{return(await PN.stat(a)).isFile()}catch{return!1}}t(Ifr,"fileExists");async function Ofr(){let a=process.env.BUILD_FILE_PATH??Nfr(),s=wfr().replaceAll("-",""),c=wN.join(a,s);return await PN.mkdir(c,{recursive:!0}),c}t(Ofr,"mkDirTemp");async function WIe(a){try{return(await PN.stat(a)).isDirectory()}catch{return!1}}t(WIe,"dirExists");async function Ffr(a){try{return await PN.stat(a),!1}catch{return!0}}t(Ffr,"isNotFileOrDirectory");function Lfr(a,s){let c=new RegExp(`(.*)(\\/${s})$|(.*)(${s}\\/)`),f=a.match(c);if(!f)return"";let d=a.split(f[0]);return d[1]===""?"":`/${d[1]}`}t(Lfr,"getParentDirectory");async function Rfr(a){if(!await WIe(a))return[];let s=await PN.readdir(a,{withFileTypes:!0}),c=[];for await(let f of s)Hpt.includes(f.name)||f.isDirectory()&&c.push(f.name);return c}t(Rfr,"listFolders");async function Gpt(a,s,c=!0){let f=Lfr(a,s),d=await PN.readdir(a,{withFileTypes:!0}),v=[];for await(let E of d)if(!Hpt.includes(E.name)||!c)if(E.isDirectory()){let A=await Gpt(wN.join(a,E.name),s,c);v.push(...A)}else v.push(wN.join(f,E.name));return v}t(Gpt,"listFolderContents");var Qpt=t(async a=>{await PN.mkdir(a,{recursive:!0})},"mkdirIfNotExists"),Mfr=t(async a=>{let s=wN.dirname(a);return Qpt(s)},"mkdirForFilePathIfNotExits"),Vfe=class extends Error{static{t(this,"UnsafePathError")}constructor(s){super(s)}};function jfr(a){let s=t(c=>{if(!c.startsWith(a))throw new Vfe("Resolved path is not part of the project.");return c},"ensureSafePath");return{resolve:t((...c)=>s(wN.resolve(...c)),"resolve")}}t(jfr,"safePath");function Bfr(a){return`${wN.basename(wN.dirname(a))}/${wN.basename(a)}`}t(Bfr,"getParentDirFilename");async function Ufr({folderPath:a,outputTarPath:s,exclude:c=["node_modules",".git","dist"],logger:f}){let d=[],v=[],E;try{await new Promise((A,O)=>{let M=Wpt("tar",[...c.map(W=>["--exclude",W]).flat(),...Pfr()!=="darwin"?["--warning=no-file-changed"]:[],"-cvf",s,"-C",a,"."]);M.stdout.on("data",W=>{let $=W.toString().trim();$.length>0&&d.push($.trim())}),M.stderr.on("data",W=>{let $=W.toString().trim();$.length>0&&v.push($.trim())}),M.on("close",W=>{E=W,W===0?A():O(new Error(`tar process exited with code ${W}`))}),M.on("error",W=>{O(W)})})}catch(A){throw new Error("Failed to tar folder",{cause:A})}finally{f.info({stdout:d.join(`
|
|
579
579
|
`),stderr:v.join(`
|
|
580
580
|
`),exitCode:E},"Tar process logs")}}t(Ufr,"tarFolder");async function $fr({tarFilePath:a,outputDir:s,logger:c}){let f=[],d=[],v;try{await new Promise((E,A)=>{let O=Wpt("sh",["-c",`tar -xvf ${a} -C ${s};`]);O.stdout.on("data",M=>{let W=M.toString().trim();W.length>0&&f.push(W.trim())}),O.stderr.on("data",M=>{let W=M.toString().trim();W.length>0&&d.push(W.trim())}),O.on("close",M=>{v=M,M===0?E():A(new Error(`tar process exited with code ${M}`))}),O.on("error",M=>{A(M)})})}catch(E){throw new Error("Failed to untar file",{cause:E})}finally{c.info({stdout:f.join(`
|
|
581
581
|
`),stderr:d.join(`
|
|
@@ -671,7 +671,7 @@ export default {
|
|
|
671
671
|
return handler.requestHandler(request, env, ctx)
|
|
672
672
|
},
|
|
673
673
|
};
|
|
674
|
-
`,LCt=t(async function({systemDirectory:a,logger:s}){return af.timeFn("Generating Worker shim",async()=>{s.debug("Generating Worker shim");let c=J6r.join(a,zue);try{await $6r.writeFile(c,q6r,"utf-8")}catch(f){s.error(f);let d={message:`Error creating file at ${c}`,pluginName:"generate-worker-entry",severity:"error"};return{warnings:[],errors:[d]}}return{warnings:[],errors:[]}})},"generateWorker");import{readFile as z6r,readdir as V6r}from"node:fs/promises";import RCt from"node:path";var $de="validate-open-api-files",MCt=t(async function({sourceDirectory:a,logger:s}){return af.timeFn("
|
|
674
|
+
`,LCt=t(async function({systemDirectory:a,logger:s}){return af.timeFn("Generating Worker shim",async()=>{s.debug("Generating Worker shim");let c=J6r.join(a,zue);try{await $6r.writeFile(c,q6r,"utf-8")}catch(f){s.error(f);let d={message:`Error creating file at ${c}`,pluginName:"generate-worker-entry",severity:"error"};return{warnings:[],errors:[d]}}return{warnings:[],errors:[]}})},"generateWorker");import{readFile as z6r,readdir as V6r}from"node:fs/promises";import RCt from"node:path";var $de="validate-open-api-files",MCt=t(async function({sourceDirectory:a,logger:s}){return af.timeFn("Validating OpenAPI files",async()=>{s.debug("Validating OpenAPI files");let c=RCt.join(a,kS),f=[];try{if(!await sB(a))return new jC({message:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:$de,severity:"error"});let E=(await V6r(c)).filter(O=>O.endsWith(".oas.json")),A=t(async O=>{let M=RCt.join(c,O);try{O==="zp.oas.json"&&f.push({message:"Open API files cannot be named 'zp.oas.json' since 'zp' is a reserved prefix. Update the file name to solve this build issue.",pluginName:$de,severity:"error"});let W=await z6r(M,"utf-8"),$=JSON.parse(W);if($&&$.paths){let K=Object.entries($.paths).filter(Pe=>Pe[0]==="zp"||Pe[0]==="/zp");if(K.length>0){let Pe=K.length===1?"includes one route path":`includes '${K.length}' routes`;f.push({message:`Open API file '${O}' ${Pe} that's named '/zp' which is a reserved route name. Updating the route to something other than '/zp' will solve this build issue.`,pluginName:$de,severity:"error"})}}}catch(W){s.error(W)}},"validateOpenApiFile");await Promise.all(E.map(A))}catch(d){return s.error(d),f.length>0?{errors:f,warnings:[]}:new jC({message:"Failed while validating the open api files in the project",pluginName:$de,severity:"warning"})}return{errors:f,warnings:[]}})},"validateOpenAPIFiles");var JU=jp(fRe(),1);import{parse as f4r}from"jsonc-parser";import{readFile as _4r,writeFile as nEt}from"node:fs/promises";import p4r from"node:path";var $U=jp(fRe(),1);var rEt=t(()=>({include:["modules/**/*",".zuplo/**/*","tests/**/*"],exclude:["./node_modules","./dist"],compilerOptions:{module:$U.ModuleKind.ESNext,target:$U.ScriptTarget.ES2022,moduleResolution:$U.ModuleResolutionKind.Bundler,lib:["ESNext","WebWorker","Webworker.Iterable"],preserveConstEnums:!0,useUnknownInCatchVariables:!1,forceConsistentCasingInFileNames:!0,importHelpers:!0,esModuleInterop:!0,strictNullChecks:!0,noEmit:!0}}),"getZuploTsConfigTemplate");var n5="validate-tsconfig",iEt=t(async function({sourceDirectory:a,logger:s,command:c,environmentType:f}){return af.timeFn("Validate TSConfig",async()=>{s.debug("Validate TSConfig");let d=f==="WORKING_COPY"||c==="dev";try{let v=rEt(),E=p4r.join(a,"tsconfig.json");if(!await Bu.fileExists(E))return d?(await nEt(E,JSON.stringify(v,null,2)),{warnings:[{message:"This project does not have a tsconfig.json file. The file has been created for you.",severity:"warning",pluginName:n5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}],errors:[]}):{warnings:[],errors:[{message:"This project does not have a tsconfig.json file.",severity:"error",pluginName:n5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}]};let A=await _4r(E,"utf-8"),O=f4r(A);if(!(O&&typeof O=="object"&&"compilerOptions"in O))return d?(await nEt(E,JSON.stringify(v,null,2)),{warnings:[{message:"This project's tsconfig.json file was invalid. A valid file has been written for you.",severity:"warning",pluginName:n5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}],errors:[]}):{warnings:[],errors:[{message:"This project's tsconfig.json file is invalid. It must have a compilerOptions.",severity:"error",pluginName:n5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}]};let M=JU.default.convertCompilerOptionsFromJson(O.compilerOptions,a);if(M.errors.length>0)return{warnings:[],errors:M.errors.map(dr=>({severity:"error",pluginName:n5,message:dr.messageText.toString(),detail:"You will need to modify your tsconfig.json file to build this project.",helpUrl:"https://zuplo.com/docs/articles/tsconfig",location:dr.file?{line:dr.file.getLineStarts()[0],length:dr.file.getWidth(),file:dr.file.fileName,column:dr.file.getStart(),lineText:"",namespace:"",suggestion:""}:void 0}))};if(!O||typeof O!="object")throw new TypeError("The userConfigRaw is not an object, this should not happen.");if(!("compilerOptions"in O)||O.compilerOptions===null||O.compilerOptions===void 0||typeof O.compilerOptions!="object")throw new TypeError("The userConfigRaw.compilerOptions property is not an object, this should not happen.");let W=t((dr,_r,ir)=>`The compiler option '${dr}' should ${_r===void 0?"not be set":`be set to '${typeof _r=="string"?_r:JSON.stringify(_r)}'`}, it was ${ir===void 0?"not set":`set to '${typeof ir=="string"?ir:JSON.stringify(ir)}'`}`,"getMessage"),$="ESNext",K=JU.ModuleKind.ESNext,Pe=[];M.options.module!==K&&Pe.push(W("module",$,O.compilerOptions.module));let De="ES2022",Se=JU.default.ScriptTarget.ES2022;M.options.target!==Se&&Pe.push(W("target",De,O.compilerOptions.target));let Ct="Bundler",bt=JU.default.ModuleResolutionKind.Bundler;M.options.moduleResolution!==bt&&Pe.push(W("moduleResolution",Ct,O.compilerOptions.moduleResolution));let hr=["ESNext","WebWorker","Webworker.Iterable"];t(dr=>{let _r=hr.map(ts=>ts.toLowerCase()),ir=dr.map(ts=>ts.toLowerCase());return _r.every(ts=>ir.includes(ts))},"includesAllLibs")(O.compilerOptions.lib??[])||Pe.push(W("lib",hr,O.compilerOptions.lib)),M.options.baseUrl&&Pe.push(W("baseUrl",void 0,O.compilerOptions.baseUrl));let jr=[];return Pe.length>0&&jr.push({message:"This project's tsconfig.json was not set to the recommended settings. Custom settings may cause build issues. For guidance on how to adjust your settings, please visit: https://zuplo.com/docs/articles/tsconfig",severity:"warning",detail:Pe.join(`
|
|
675
675
|
`),pluginName:n5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}),{warnings:jr,errors:[]}}catch(v){s.error(v);let E={message:`Error validating tsconfig.json : ${v.message}`,severity:"error",pluginName:n5};return{warnings:[],errors:[E]}}})},"validateTSConfig");var qU;try{let a=d4r(XY.resolve(m4r(h4r(import.meta.url)),"../../package.json"),"utf-8");qU=JSON.parse(a).version}catch{qU="0.0.0"}function g4r(a){let{ZUPLO:s,ZUPLO_BUILD_ID:c,ZUPLO_BUILD_CONFIG:f}=process.env;if(s&&c&&f){let d;try{d=JSON.parse(f)}catch{throw new Error("Couuld not parse ZUPLO_BUILD_CONFIG")}let v={ZUPLO_PROJECT_ID:d.projectId,ZUPLO_ACCOUNT_NAME:d.accountName,ZUPLO_PROJECT_NAME:d.projectName,ZUPLO_ENVIRONMENT_TYPE:d.environmentType};for(let[E,A]of Object.entries(process.env))E.startsWith("ZUPLO_PUBLIC_")&&(v[E]=A??"");return{...a,buildId:c,...d,publicZuploEnvironmentVariables:v}}return a}t(g4r,"getBuildConfig");async function _Re(a){let s=performance.now(),{buildId:c,sourceDirectory:f,deploymentName:d=XY.basename(f),command:v,minify:E,entitlements:A,environmentType:O,logger:M,output:W,noCompile:$=!1,projectId:K,deploymentUrl:Pe,publicZuploEnvironmentVariables:De}=g4r(a),Se=await Ude(f),Ct=XY.join(f,Gj),bt;if("errors"in Se)KLe({output:W.child("api"),buildId:c,runtimeVersion:qU}),bt={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:qU,outputPath:Ct,buildTime:new Date().toISOString(),buildTimeMs:0,buildId:c,warnings:[],errors:Se.errors,metafile:void 0};else{$||KLe({output:W.child("api"),buildId:c,runtimeVersion:qU,compatibilityDate:Se.config.compatibilityDate});let jr={command:v,minify:E,deploymentName:d,sourceDirectory:f,outputDirectory:Ct,systemDirectory:XY.join(f,yN),cacheDirectory:XY.join(f,"node_modules",yN),buildId:c,logger:M,output:W,config:Se.config,publicZuploEnvironmentVariables:De,projectId:K,entitlements:A,environmentType:O,deploymentUrl:Pe},dr=[];dr.push(wCt),dr.push(NCt),dr.push(ICt),dr.push(FCt),dr.push(iEt),dr.push(MCt),dr.push(LCt),$||dr.push(bCt),dr.push(kCt);let _r=await xCt(dr,jr),ir=_r.errors.length>0?zF:_r.warnings.length>0?J3e:qF,ts=_r.data.get("metafile");bt={status:ir,compatibilityDate:Se.config.compatibilityDate,runtimeVersion:qU,outputPath:Ct,buildTime:new Date().toISOString(),buildTimeMs:0,metafile:ts,buildId:c,warnings:_r.warnings,errors:_r.errors,flags:Se.config.flags}}bt.warnings.length>0&&bt.warnings.forEach(jr=>{M.warn(jr)}),bt.errors.length>0&&bt.errors.forEach(jr=>{M.error(jr)});let{metafile:hr,...Pr}=bt;if(M.debug(Pr,"Compiler completed"),bt.buildTimeMs=performance.now()-s,$||await Bde(f,W.child("api"),bt),process.env.ZUPLO_SHOW_PERF){console.log();let jr=bt.buildTimeMs<2e3?"green":bt.buildTimeMs<5e3?"yellow":"red";console.log(f_[jr](`Build time: ${bt.buildTimeMs.toFixed(0)}ms`)),af.report()}return af.clear(),bt}t(_Re,"build");var swt=jp(CMe(),1);import{existsSync as QFr}from"node:fs";import{mkdir as KFr,readFile as YFr}from"node:fs/promises";import mX from"node:path";import dOr from"chokidar";import*as xAt from"esbuild";import{randomUUID as EAt}from"node:crypto";import mOr from"node:events";import T$ from"node:path";var EMe=class extends mOr{static{t(this,"WatchEmitter")}},C$=class{static{t(this,"BuildWatcher")}esbuildContext;emitter=new EMe;envFilesWatcher;outputDirectory;sourceDirectory;command;logger;publicZuploEnvironmentVariables;projectName;buildId;output;constructor({sourceDirectory:s,command:c,logger:f,publicZuploEnvironmentVariables:d={},buildId:v,output:E}){this.sourceDirectory=s,this.command=c,this.outputDirectory=T$.join(s,Gj),this.logger=f,this.publicZuploEnvironmentVariables=d,this.projectName=T$.basename(s),this.buildId=v,this.output=E,this.envFilesWatcher=dOr.watch([T$.join(s,".env"),T$.join(s,".env.zuplo")])}watchEnvFiles(){this.envFilesWatcher.on("change",()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("add",()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("unlink",()=>{this.emitter.emit("reload",null,null)})}onReload=t(s=>{this.emitter.on("reload",s)},"onReload");async start(){let{sourceDirectory:s}=this;if(this.esbuildContext!==void 0)throw new Error("Watcher cannot be started more than once");let c=await _Re({buildId:this.buildId,output:this.output,sourceDirectory:s,noCompile:!0,command:this.command,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger,deploymentUrl:void 0}),f=await GY({command:this.command,systemDirectory:T$.join(s,yN),cacheDirectory:T$.join(s,"node_modules",yN),outputDirectory:this.outputDirectory,sourceDirectory:s,logger:this.logger,flags:c.flags,compatibilityDate:c.compatibilityDate}),d=this;f.plugins?.push({name:"on-end",setup(v){v.onEnd(E=>{d.logger.debug("Watcher (build) reloaded");let A=GLe({buildId:EAt(),result:E});A.errors.length>0?d.logger.error(A.errors,"Build errors"):d.logger.debug(`Successfully rebuilt watched project. Build id ${A.buildId}`);let O={...A,compatibilityDate:c.compatibilityDate,flags:c.flags};d.emitter.emit("reload",O,null)})}}),this.esbuildContext=await xAt.context(f);try{if((await this.esbuildContext.rebuild()).errors.length>0){let E={status:"Failed",runtimeVersion:"0.0.0",buildTime:"",buildTimeMs:0,buildId:EAt(),warnings:[],errors:[],metafile:void 0};await Bde(s,d.output.child("api"),E),this.logger.error(E.errors,"Build errors")}}catch(v){throw await this.close(),v}await this.esbuildContext.watch()}async close(){try{await this.envFilesWatcher.close(),this.esbuildContext&&(await this.esbuildContext.dispose(),this.logger.debug("ESBuild watcher closed"))}catch(s){this.logger.error(s)}}};var KMe=jp(PAt(),1);var twt=jp(ykt(),1);import{Buffer as qFr}from"node:buffer";import zFr from"node:path";import ewt from"node:child_process";import khe from"node:process";function MMe(a){let s=typeof a=="string"?`
|
|
676
676
|
`:10,c=typeof a=="string"?"\r":13;return a[a.length-1]===s&&(a=a.slice(0,-1)),a[a.length-1]===c&&(a=a.slice(0,-1)),a}t(MMe,"stripFinalNewline");import bhe from"node:process";import _X from"node:path";import{fileURLToPath as vkt}from"node:url";function vhe(a={}){let{env:s=process.env,platform:c=process.platform}=a;return c!=="win32"?"PATH":Object.keys(s).reverse().find(f=>f.toUpperCase()==="PATH")||"Path"}t(vhe,"pathKey");var nFr=t(({cwd:a=bhe.cwd(),path:s=bhe.env[vhe()],preferLocal:c=!0,execPath:f=bhe.execPath,addExecPath:d=!0}={})=>{let v=a instanceof URL?vkt(a):a,E=_X.resolve(v),A=[];return c&&iFr(A,E),d&&sFr(A,f,E),[...A,s].join(_X.delimiter)},"npmRunPath"),iFr=t((a,s)=>{let c;for(;c!==s;)a.push(_X.join(s,"node_modules/.bin")),c=s,s=_X.resolve(s,"..")},"applyPreferLocal"),sFr=t((a,s,c)=>{let f=s instanceof URL?vkt(s):s;a.push(_X.resolve(c,f,".."))},"applyExecPath"),bkt=t(({env:a=bhe.env,...s}={})=>{a={...a};let c=vhe({env:a});return s.path=a[c],a[c]=nFr(s),a},"npmRunPathEnv");var aFr=t((a,s,c,f)=>{if(c==="length"||c==="prototype"||c==="arguments"||c==="caller")return;let d=Object.getOwnPropertyDescriptor(a,c),v=Object.getOwnPropertyDescriptor(s,c);!oFr(d,v)&&f||Object.defineProperty(a,c,v)},"copyProperty"),oFr=t(function(a,s){return a===void 0||a.configurable||a.writable===s.writable&&a.enumerable===s.enumerable&&a.configurable===s.configurable&&(a.writable||a.value===s.value)},"canCopyProperty"),cFr=t((a,s)=>{let c=Object.getPrototypeOf(s);c!==Object.getPrototypeOf(a)&&Object.setPrototypeOf(a,c)},"changePrototype"),lFr=t((a,s)=>`/* Wrapped ${a}*/
|
|
677
677
|
${s}`,"wrappedToString"),uFr=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),fFr=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),_Fr=t((a,s,c)=>{let f=c===""?"":`with ${c.trim()}() `,d=lFr.bind(null,f,s.toString());Object.defineProperty(d,"name",fFr),Object.defineProperty(a,"toString",{...uFr,value:d})},"changeToString");function jMe(a,s,{ignoreNonConfigurable:c=!1}={}){let{name:f}=a;for(let d of Reflect.ownKeys(s))aFr(a,s,d,c);return cFr(a,s),_Fr(a,s,f),a}t(jMe,"mimicFunction");var She=new WeakMap,Skt=t((a,s={})=>{if(typeof a!="function")throw new TypeError("Expected a function");let c,f=0,d=a.displayName||a.name||"<anonymous>",v=t(function(...E){if(She.set(v,++f),f===1)c=a.apply(this,E),a=null;else if(s.throw===!0)throw new Error(`Function \`${d}\` can only be called once`);return c},"onetime");return jMe(v,a),She.set(v,f),v},"onetime");Skt.callCount=a=>{if(!She.has(a))throw new Error(`The given function \`${a.name}\` is not wrapped by the \`onetime\` package`);return She.get(a)};var Tkt=Skt;import{constants as hFr}from"os";var Ckt=t(function(){let a=BMe-Ekt+1;return Array.from({length:a},pFr)},"getRealtimeSignals"),pFr=t(function(a,s){return{name:`SIGRT${s+1}`,number:Ekt+s,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},"getRealtimeSignal"),Ekt=34,BMe=64;import{constants as dFr}from"os";var xkt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var UMe=t(function(){let a=Ckt();return[...xkt,...a].map(mFr)},"getSignals"),mFr=t(function({name:a,number:s,description:c,action:f,forced:d=!1,standard:v}){let{signals:{[a]:E}}=dFr,A=E!==void 0;return{name:a,number:A?E:s,description:c,supported:A,action:f,forced:d,standard:v}},"normalizeSignal");var gFr=t(function(){return UMe().reduce(yFr,{})},"getSignalsByName"),yFr=t(function(a,{name:s,number:c,description:f,supported:d,action:v,forced:E,standard:A}){return{...a,[s]:{name:s,number:c,description:f,supported:d,action:v,forced:E,standard:A}}},"getSignalByName"),Dkt=gFr(),vFr=t(function(){let a=UMe(),s=BMe+1,c=Array.from({length:s},(f,d)=>bFr(d,a));return Object.assign({},...c)},"getSignalsByNumber"),bFr=t(function(a,s){let c=SFr(a,s);if(c===void 0)return{};let{name:f,description:d,supported:v,action:E,forced:A,standard:O}=c;return{[a]:{name:f,number:a,description:d,supported:v,action:E,forced:A,standard:O}}},"getSignalByNumber"),SFr=t(function(a,s){let c=s.find(({name:f})=>hFr.signals[f]===a);return c!==void 0?c:s.find(f=>f.number===a)},"findSignalByNumber"),Cnn=vFr();var TFr=t(({timedOut:a,timeout:s,errorCode:c,signal:f,signalDescription:d,exitCode:v,isCanceled:E})=>a?`timed out after ${s} milliseconds`:E?"was canceled":c!==void 0?`failed with ${c}`:f!==void 0?`was killed with ${f} (${d})`:v!==void 0?`failed with exit code ${v}`:"failed","getErrorPrefix"),$Me=t(({stdout:a,stderr:s,all:c,error:f,signal:d,exitCode:v,command:E,escapedCommand:A,timedOut:O,isCanceled:M,killed:W,parsed:{options:{timeout:$}}})=>{v=v===null?void 0:v,d=d===null?void 0:d;let K=d===void 0?void 0:Dkt[d].description,Pe=f&&f.code,Se=`Command ${TFr({timedOut:O,timeout:$,errorCode:Pe,signal:d,signalDescription:K,exitCode:v,isCanceled:M})}: ${E}`,Ct=Object.prototype.toString.call(f)==="[object Error]",bt=Ct?`${Se}
|
package/index.minified.js
CHANGED
|
@@ -575,7 +575,7 @@ globstar while`,s,K,c,Pe,De),this.matchOne(s.slice(K),c.slice(Pe),f))return this
|
|
|
575
575
|
>>> no match, partial?`,s,K,c,Pe),K===O))}let Se;if(typeof W=="string"?(Se=$===W,this.debug("string match",W,$,Se)):(Se=W.test($),this.debug("pattern match",W,$,Se)),!Se)return!1}if(E===O&&A===R)return!0;if(E===O)return f;if(A===R)return E===O-1&&s[E]==="";throw new Error("wtf?")}braceExpand(){return zut(this.pattern,this.options)}parse(s){mQ(s);let c=this.options;if(s==="**")return iy;if(s==="")return"";let f,d=null;(f=s.match(Lsr))?d=c.dot?Msr:Rsr:(f=s.match(xsr))?d=(c.nocase?c.dot?wsr:ksr:c.dot?Asr:Dsr)(f[1]):(f=s.match(jsr))?d=(c.nocase?c.dot?Usr:Bsr:c.dot?$sr:Jsr)(f):(f=s.match(Psr))?d=c.dot?Isr:Nsr:(f=s.match(Osr))&&(d=Fsr);let v=Kj.fromGlob(s,this.options).toMMPattern();return d&&typeof v=="object"&&Reflect.defineProperty(v,"test",{value:d}),v}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let s=this.set;if(!s.length)return this.regexp=!1,this.regexp;let c=this.options,f=c.noglobstar?Vsr:c.dot?Wsr:Hsr,d=new Set(c.nocase?["i"]:[]),v=s.map(O=>{let R=O.map(W=>{if(W instanceof RegExp)for(let $ of W.flags.split(""))d.add($);return typeof W=="string"?Xsr(W):W===iy?iy:W._src});return R.forEach((W,$)=>{let K=R[$+1],Pe=R[$-1];W!==iy||Pe===iy||(Pe===void 0?K!==void 0&&K!==iy?R[$+1]="(?:\\/|"+f+"\\/)?"+K:R[$]=f:K===void 0?R[$-1]=Pe+"(?:\\/|"+f+")?":K!==iy&&(R[$-1]=Pe+"(?:\\/|\\/"+f+"\\/)"+K,R[$+1]=iy))}),R.filter(W=>W!==iy).join("/")}).join("|"),[E,A]=s.length>1?["(?:",")"]:["",""];v="^"+E+v+A+"$",this.negate&&(v="^(?!"+v+").+$");try{this.regexp=new RegExp(v,[...d].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(s){return this.preserveMultipleSlashes?s.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(s)?["",...s.split(/\/+/)]:s.split(/\/+/)}match(s,c=this.partial){if(this.debug("match",s,this.pattern),this.comment)return!1;if(this.empty)return s==="";if(s==="/"&&c)return!0;let f=this.options;this.isWindows&&(s=s.split("\\").join("/"));let d=this.slashSplit(s);this.debug(this.pattern,"split",d);let v=this.set;this.debug(this.pattern,"set",v);let E=d[d.length-1];if(!E)for(let A=d.length-2;!E&&A>=0;A--)E=d[A];for(let A=0;A<v.length;A++){let O=v[A],R=d;if(f.matchBase&&O.length===1&&(R=[E]),this.matchOne(R,O,c))return f.flipNegate?!0:!this.negate}return f.flipNegate?!1:this.negate}static defaults(s){return xv.defaults(s).Minimatch}};xv.AST=Kj;xv.Minimatch=wS;xv.escape=Yj;xv.unescape=Cx;import{fileURLToPath as Nar}from"node:url";var Xj=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Wut=new Set,uNe=typeof process=="object"&&process?process:{},Hut=t((a,s,c,f)=>{typeof uNe.emitWarning=="function"?uNe.emitWarning(a,s,c,f):console.error(`[${c}] ${s}: ${a}`)},"emitWarning"),Kue=globalThis.AbortController,Vut=globalThis.AbortSignal;if(typeof Kue>"u"){Vut=class{static{t(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(f,d){this._onabort.push(d)}},Kue=class{static{t(this,"AbortController")}constructor(){s()}signal=new Vut;abort(f){if(!this.signal.aborted){this.signal.reason=f,this.signal.aborted=!0;for(let d of this.signal._onabort)d(f);this.signal.onabort?.(f)}}};let a=uNe.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",s=t(()=>{a&&(a=!1,Hut("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",s))},"warnACPolyfill")}var Zsr=t(a=>!Wut.has(a),"shouldWarn"),TLr=Symbol("type"),SN=t(a=>a&&a===Math.floor(a)&&a>0&&isFinite(a),"isPosInt"),Gut=t(a=>SN(a)?a<=Math.pow(2,8)?Uint8Array:a<=Math.pow(2,16)?Uint16Array:a<=Math.pow(2,32)?Uint32Array:a<=Number.MAX_SAFE_INTEGER?Zj:null:null,"getUintArray"),Zj=class extends Array{static{t(this,"ZeroArray")}constructor(s){super(s),this.fill(0)}},fNe=class a{static{t(this,"Stack")}heap;length;static#r=!1;static create(s){let c=Gut(s);if(!c)return[];a.#r=!0;let f=new a(s,c);return a.#r=!1,f}constructor(s,c){if(!a.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new c(s),this.length=0}push(s){this.heap[this.length++]=s}pop(){return this.heap[--this.length]}},gQ=class a{static{t(this,"LRUCache")}#r;#n;#e;#t;#s;#p;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#_;#c;#l;#i;#f;#v;#d;#u;#m;#g;#x;#C;#b;#A;#E;#y;static unsafeExposeInternals(s){return{starts:s.#C,ttls:s.#b,sizes:s.#x,keyMap:s.#c,keyList:s.#l,valList:s.#i,next:s.#f,prev:s.#v,get head(){return s.#d},get tail(){return s.#u},free:s.#m,isBackgroundFetch:t(c=>s.#h(c),"isBackgroundFetch"),backgroundFetch:t((c,f,d,v)=>s.#j(c,f,d,v),"backgroundFetch"),moveToTail:t(c=>s.#U(c),"moveToTail"),indexes:t(c=>s.#w(c),"indexes"),rindexes:t(c=>s.#P(c),"rindexes"),isStale:t(c=>s.#S(c),"isStale")}}get max(){return this.#r}get maxSize(){return this.#n}get calculatedSize(){return this.#_}get size(){return this.#a}get fetchMethod(){return this.#s}get memoMethod(){return this.#p}get dispose(){return this.#e}get disposeAfter(){return this.#t}constructor(s){let{max:c=0,ttl:f,ttlResolution:d=1,ttlAutopurge:v,updateAgeOnGet:E,updateAgeOnHas:A,allowStale:O,dispose:R,disposeAfter:W,noDisposeOnSet:$,noUpdateTTL:K,maxSize:Pe=0,maxEntrySize:De=0,sizeCalculation:Se,fetchMethod:Ct,memoMethod:bt,noDeleteOnFetchRejection:hr,noDeleteOnStaleGet:Pr,allowStaleOnFetchRejection:jr,allowStaleOnFetchAbort:dr,ignoreFetchAbort:_r}=s;if(c!==0&&!SN(c))throw new TypeError("max option must be a nonnegative integer");let ir=c?Gut(c):Array;if(!ir)throw new Error("invalid max value: "+c);if(this.#r=c,this.#n=Pe,this.maxEntrySize=De||this.#n,this.sizeCalculation=Se,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(bt!==void 0&&typeof bt!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#p=bt,Ct!==void 0&&typeof Ct!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=Ct,this.#E=!!Ct,this.#c=new Map,this.#l=new Array(c).fill(void 0),this.#i=new Array(c).fill(void 0),this.#f=new ir(c),this.#v=new ir(c),this.#d=0,this.#u=0,this.#m=fNe.create(c),this.#a=0,this.#_=0,typeof R=="function"&&(this.#e=R),typeof W=="function"?(this.#t=W,this.#g=[]):(this.#t=void 0,this.#g=void 0),this.#A=!!this.#e,this.#y=!!this.#t,this.noDisposeOnSet=!!$,this.noUpdateTTL=!!K,this.noDeleteOnFetchRejection=!!hr,this.allowStaleOnFetchRejection=!!jr,this.allowStaleOnFetchAbort=!!dr,this.ignoreFetchAbort=!!_r,this.maxEntrySize!==0){if(this.#n!==0&&!SN(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!SN(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#T()}if(this.allowStale=!!O,this.noDeleteOnStaleGet=!!Pr,this.updateAgeOnGet=!!E,this.updateAgeOnHas=!!A,this.ttlResolution=SN(d)||d===0?d:1,this.ttlAutopurge=!!v,this.ttl=f||0,this.ttl){if(!SN(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}if(this.#r===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#r&&!this.#n){let ts="LRU_CACHE_UNBOUNDED";Zsr(ts)&&(Wut.add(ts),Hut("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ts,a))}}getRemainingTTL(s){return this.#c.has(s)?1/0:0}#D(){let s=new Zj(this.#r),c=new Zj(this.#r);this.#b=s,this.#C=c,this.#N=(v,E,A=Xj.now())=>{if(c[v]=E!==0?A:0,s[v]=E,E!==0&&this.ttlAutopurge){let O=setTimeout(()=>{this.#S(v)&&this.#O(this.#l[v],"expire")},E+1);O.unref&&O.unref()}},this.#k=v=>{c[v]=s[v]!==0?Xj.now():0},this.#o=(v,E)=>{if(s[E]){let A=s[E],O=c[E];if(!A||!O)return;v.ttl=A,v.start=O,v.now=f||d();let R=v.now-O;v.remainingTTL=A-R}};let f=0,d=t(()=>{let v=Xj.now();if(this.ttlResolution>0){f=v;let E=setTimeout(()=>f=0,this.ttlResolution);E.unref&&E.unref()}return v},"getNow");this.getRemainingTTL=v=>{let E=this.#c.get(v);if(E===void 0)return 0;let A=s[E],O=c[E];if(!A||!O)return 1/0;let R=(f||d())-O;return A-R},this.#S=v=>{let E=c[v],A=s[v];return!!A&&!!E&&(f||d())-E>A}}#k=t(()=>{},"#updateItemAge");#o=t(()=>{},"#statusTTL");#N=t(()=>{},"#setItemTTL");#S=t(()=>!1,"#isStale");#T(){let s=new Zj(this.#r);this.#_=0,this.#x=s,this.#I=c=>{this.#_-=s[c],s[c]=0},this.#L=(c,f,d,v)=>{if(this.#h(f))return 0;if(!SN(d))if(v){if(typeof v!="function")throw new TypeError("sizeCalculation must be a function");if(d=v(f,c),!SN(d))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return d},this.#F=(c,f,d)=>{if(s[c]=f,this.#n){let v=this.#n-s[c];for(;this.#_>v;)this.#M(!0)}this.#_+=s[c],d&&(d.entrySize=f,d.totalCalculatedSize=this.#_)}}#I=t(s=>{},"#removeItemSize");#F=t((s,c,f)=>{},"#addItemSize");#L=t((s,c,f,d)=>{if(f||d)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#w({allowStale:s=this.allowStale}={}){if(this.#a)for(let c=this.#u;!(!this.#R(c)||((s||!this.#S(c))&&(yield c),c===this.#d));)c=this.#v[c]}*#P({allowStale:s=this.allowStale}={}){if(this.#a)for(let c=this.#d;!(!this.#R(c)||((s||!this.#S(c))&&(yield c),c===this.#u));)c=this.#f[c]}#R(s){return s!==void 0&&this.#c.get(this.#l[s])===s}*entries(){for(let s of this.#w())this.#i[s]!==void 0&&this.#l[s]!==void 0&&!this.#h(this.#i[s])&&(yield[this.#l[s],this.#i[s]])}*rentries(){for(let s of this.#P())this.#i[s]!==void 0&&this.#l[s]!==void 0&&!this.#h(this.#i[s])&&(yield[this.#l[s],this.#i[s]])}*keys(){for(let s of this.#w()){let c=this.#l[s];c!==void 0&&!this.#h(this.#i[s])&&(yield c)}}*rkeys(){for(let s of this.#P()){let c=this.#l[s];c!==void 0&&!this.#h(this.#i[s])&&(yield c)}}*values(){for(let s of this.#w())this.#i[s]!==void 0&&!this.#h(this.#i[s])&&(yield this.#i[s])}*rvalues(){for(let s of this.#P())this.#i[s]!==void 0&&!this.#h(this.#i[s])&&(yield this.#i[s])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(s,c={}){for(let f of this.#w()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;if(v!==void 0&&s(v,this.#l[f],this))return this.get(this.#l[f],c)}}forEach(s,c=this){for(let f of this.#w()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;v!==void 0&&s.call(c,v,this.#l[f],this)}}rforEach(s,c=this){for(let f of this.#P()){let d=this.#i[f],v=this.#h(d)?d.__staleWhileFetching:d;v!==void 0&&s.call(c,v,this.#l[f],this)}}purgeStale(){let s=!1;for(let c of this.#P({allowStale:!0}))this.#S(c)&&(this.#O(this.#l[c],"expire"),s=!0);return s}info(s){let c=this.#c.get(s);if(c===void 0)return;let f=this.#i[c],d=this.#h(f)?f.__staleWhileFetching:f;if(d===void 0)return;let v={value:d};if(this.#b&&this.#C){let E=this.#b[c],A=this.#C[c];if(E&&A){let O=E-(Xj.now()-A);v.ttl=O,v.start=Date.now()}}return this.#x&&(v.size=this.#x[c]),v}dump(){let s=[];for(let c of this.#w({allowStale:!0})){let f=this.#l[c],d=this.#i[c],v=this.#h(d)?d.__staleWhileFetching:d;if(v===void 0||f===void 0)continue;let E={value:v};if(this.#b&&this.#C){E.ttl=this.#b[c];let A=Xj.now()-this.#C[c];E.start=Math.floor(Date.now()-A)}this.#x&&(E.size=this.#x[c]),s.unshift([f,E])}return s}load(s){this.clear();for(let[c,f]of s){if(f.start){let d=Date.now()-f.start;f.start=Xj.now()-d}this.set(c,f.value,f)}}set(s,c,f={}){if(c===void 0)return this.delete(s),this;let{ttl:d=this.ttl,start:v,noDisposeOnSet:E=this.noDisposeOnSet,sizeCalculation:A=this.sizeCalculation,status:O}=f,{noUpdateTTL:R=this.noUpdateTTL}=f,W=this.#L(s,c,f.size||0,A);if(this.maxEntrySize&&W>this.maxEntrySize)return O&&(O.set="miss",O.maxEntrySizeExceeded=!0),this.#O(s,"set"),this;let $=this.#a===0?void 0:this.#c.get(s);if($===void 0)$=this.#a===0?this.#u:this.#m.length!==0?this.#m.pop():this.#a===this.#r?this.#M(!1):this.#a,this.#l[$]=s,this.#i[$]=c,this.#c.set(s,$),this.#f[this.#u]=$,this.#v[$]=this.#u,this.#u=$,this.#a++,this.#F($,W,O),O&&(O.set="add"),R=!1;else{this.#U($);let K=this.#i[$];if(c!==K){if(this.#E&&this.#h(K)){K.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Pe}=K;Pe!==void 0&&!E&&(this.#A&&this.#e?.(Pe,s,"set"),this.#y&&this.#g?.push([Pe,s,"set"]))}else E||(this.#A&&this.#e?.(K,s,"set"),this.#y&&this.#g?.push([K,s,"set"]));if(this.#I($),this.#F($,W,O),this.#i[$]=c,O){O.set="replace";let Pe=K&&this.#h(K)?K.__staleWhileFetching:K;Pe!==void 0&&(O.oldValue=Pe)}}else O&&(O.set="update")}if(d!==0&&!this.#b&&this.#D(),this.#b&&(R||this.#N($,d,v),O&&this.#o(O,$)),!E&&this.#y&&this.#g){let K=this.#g,Pe;for(;Pe=K?.shift();)this.#t?.(...Pe)}return this}pop(){try{for(;this.#a;){let s=this.#i[this.#d];if(this.#M(!0),this.#h(s)){if(s.__staleWhileFetching)return s.__staleWhileFetching}else if(s!==void 0)return s}}finally{if(this.#y&&this.#g){let s=this.#g,c;for(;c=s?.shift();)this.#t?.(...c)}}}#M(s){let c=this.#d,f=this.#l[c],d=this.#i[c];return this.#E&&this.#h(d)?d.__abortController.abort(new Error("evicted")):(this.#A||this.#y)&&(this.#A&&this.#e?.(d,f,"evict"),this.#y&&this.#g?.push([d,f,"evict"])),this.#I(c),s&&(this.#l[c]=void 0,this.#i[c]=void 0,this.#m.push(c)),this.#a===1?(this.#d=this.#u=0,this.#m.length=0):this.#d=this.#f[c],this.#c.delete(f),this.#a--,c}has(s,c={}){let{updateAgeOnHas:f=this.updateAgeOnHas,status:d}=c,v=this.#c.get(s);if(v!==void 0){let E=this.#i[v];if(this.#h(E)&&E.__staleWhileFetching===void 0)return!1;if(this.#S(v))d&&(d.has="stale",this.#o(d,v));else return f&&this.#k(v),d&&(d.has="hit",this.#o(d,v)),!0}else d&&(d.has="miss");return!1}peek(s,c={}){let{allowStale:f=this.allowStale}=c,d=this.#c.get(s);if(d===void 0||!f&&this.#S(d))return;let v=this.#i[d];return this.#h(v)?v.__staleWhileFetching:v}#j(s,c,f,d){let v=c===void 0?void 0:this.#i[c];if(this.#h(v))return v;let E=new Kue,{signal:A}=f;A?.addEventListener("abort",()=>E.abort(A.reason),{signal:E.signal});let O={signal:E.signal,options:f,context:d},R=t((Se,Ct=!1)=>{let{aborted:bt}=E.signal,hr=f.ignoreFetchAbort&&Se!==void 0;if(f.status&&(bt&&!Ct?(f.status.fetchAborted=!0,f.status.fetchError=E.signal.reason,hr&&(f.status.fetchAbortIgnored=!0)):f.status.fetchResolved=!0),bt&&!hr&&!Ct)return $(E.signal.reason);let Pr=Pe;return this.#i[c]===Pe&&(Se===void 0?Pr.__staleWhileFetching?this.#i[c]=Pr.__staleWhileFetching:this.#O(s,"fetch"):(f.status&&(f.status.fetchUpdated=!0),this.set(s,Se,O.options))),Se},"cb"),W=t(Se=>(f.status&&(f.status.fetchRejected=!0,f.status.fetchError=Se),$(Se)),"eb"),$=t(Se=>{let{aborted:Ct}=E.signal,bt=Ct&&f.allowStaleOnFetchAbort,hr=bt||f.allowStaleOnFetchRejection,Pr=hr||f.noDeleteOnFetchRejection,jr=Pe;if(this.#i[c]===Pe&&(!Pr||jr.__staleWhileFetching===void 0?this.#O(s,"fetch"):bt||(this.#i[c]=jr.__staleWhileFetching)),hr)return f.status&&jr.__staleWhileFetching!==void 0&&(f.status.returnedStale=!0),jr.__staleWhileFetching;if(jr.__returned===jr)throw Se},"fetchFail"),K=t((Se,Ct)=>{let bt=this.#s?.(s,v,O);bt&&bt instanceof Promise&&bt.then(hr=>Se(hr===void 0?void 0:hr),Ct),E.signal.addEventListener("abort",()=>{(!f.ignoreFetchAbort||f.allowStaleOnFetchAbort)&&(Se(void 0),f.allowStaleOnFetchAbort&&(Se=t(hr=>R(hr,!0),"res")))})},"pcall");f.status&&(f.status.fetchDispatched=!0);let Pe=new Promise(K).then(R,W),De=Object.assign(Pe,{__abortController:E,__staleWhileFetching:v,__returned:void 0});return c===void 0?(this.set(s,De,{...O.options,status:void 0}),c=this.#c.get(s)):this.#i[c]=De,De}#h(s){if(!this.#E)return!1;let c=s;return!!c&&c instanceof Promise&&c.hasOwnProperty("__staleWhileFetching")&&c.__abortController instanceof Kue}async fetch(s,c={}){let{allowStale:f=this.allowStale,updateAgeOnGet:d=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,ttl:E=this.ttl,noDisposeOnSet:A=this.noDisposeOnSet,size:O=0,sizeCalculation:R=this.sizeCalculation,noUpdateTTL:W=this.noUpdateTTL,noDeleteOnFetchRejection:$=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:K=this.allowStaleOnFetchRejection,ignoreFetchAbort:Pe=this.ignoreFetchAbort,allowStaleOnFetchAbort:De=this.allowStaleOnFetchAbort,context:Se,forceRefresh:Ct=!1,status:bt,signal:hr}=c;if(!this.#E)return bt&&(bt.fetch="get"),this.get(s,{allowStale:f,updateAgeOnGet:d,noDeleteOnStaleGet:v,status:bt});let Pr={allowStale:f,updateAgeOnGet:d,noDeleteOnStaleGet:v,ttl:E,noDisposeOnSet:A,size:O,sizeCalculation:R,noUpdateTTL:W,noDeleteOnFetchRejection:$,allowStaleOnFetchRejection:K,allowStaleOnFetchAbort:De,ignoreFetchAbort:Pe,status:bt,signal:hr},jr=this.#c.get(s);if(jr===void 0){bt&&(bt.fetch="miss");let dr=this.#j(s,jr,Pr,Se);return dr.__returned=dr}else{let dr=this.#i[jr];if(this.#h(dr)){let rs=f&&dr.__staleWhileFetching!==void 0;return bt&&(bt.fetch="inflight",rs&&(bt.returnedStale=!0)),rs?dr.__staleWhileFetching:dr.__returned=dr}let _r=this.#S(jr);if(!Ct&&!_r)return bt&&(bt.fetch="hit"),this.#U(jr),d&&this.#k(jr),bt&&this.#o(bt,jr),dr;let ir=this.#j(s,jr,Pr,Se),Fi=ir.__staleWhileFetching!==void 0&&f;return bt&&(bt.fetch=_r?"stale":"refresh",Fi&&_r&&(bt.returnedStale=!0)),Fi?ir.__staleWhileFetching:ir.__returned=ir}}async forceFetch(s,c={}){let f=await this.fetch(s,c);if(f===void 0)throw new Error("fetch() returned undefined");return f}memo(s,c={}){let f=this.#p;if(!f)throw new Error("no memoMethod provided to constructor");let{context:d,forceRefresh:v,...E}=c,A=this.get(s,E);if(!v&&A!==void 0)return A;let O=f(s,A,{options:E,context:d});return this.set(s,O,E),O}get(s,c={}){let{allowStale:f=this.allowStale,updateAgeOnGet:d=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,status:E}=c,A=this.#c.get(s);if(A!==void 0){let O=this.#i[A],R=this.#h(O);return E&&this.#o(E,A),this.#S(A)?(E&&(E.get="stale"),R?(E&&f&&O.__staleWhileFetching!==void 0&&(E.returnedStale=!0),f?O.__staleWhileFetching:void 0):(v||this.#O(s,"expire"),E&&f&&(E.returnedStale=!0),f?O:void 0)):(E&&(E.get="hit"),R?O.__staleWhileFetching:(this.#U(A),d&&this.#k(A),O))}else E&&(E.get="miss")}#B(s,c){this.#v[c]=s,this.#f[s]=c}#U(s){s!==this.#u&&(s===this.#d?this.#d=this.#f[s]:this.#B(this.#v[s],this.#f[s]),this.#B(this.#u,s),this.#u=s)}delete(s){return this.#O(s,"delete")}#O(s,c){let f=!1;if(this.#a!==0){let d=this.#c.get(s);if(d!==void 0)if(f=!0,this.#a===1)this.#$(c);else{this.#I(d);let v=this.#i[d];if(this.#h(v)?v.__abortController.abort(new Error("deleted")):(this.#A||this.#y)&&(this.#A&&this.#e?.(v,s,c),this.#y&&this.#g?.push([v,s,c])),this.#c.delete(s),this.#l[d]=void 0,this.#i[d]=void 0,d===this.#u)this.#u=this.#v[d];else if(d===this.#d)this.#d=this.#f[d];else{let E=this.#v[d];this.#f[E]=this.#f[d];let A=this.#f[d];this.#v[A]=this.#v[d]}this.#a--,this.#m.push(d)}}if(this.#y&&this.#g?.length){let d=this.#g,v;for(;v=d?.shift();)this.#t?.(...v)}return f}clear(){return this.#$("delete")}#$(s){for(let c of this.#P({allowStale:!0})){let f=this.#i[c];if(this.#h(f))f.__abortController.abort(new Error("deleted"));else{let d=this.#l[c];this.#A&&this.#e?.(f,d,s),this.#y&&this.#g?.push([f,d,s])}}if(this.#c.clear(),this.#i.fill(void 0),this.#l.fill(void 0),this.#b&&this.#C&&(this.#b.fill(0),this.#C.fill(0)),this.#x&&this.#x.fill(0),this.#d=0,this.#u=0,this.#m.length=0,this.#_=0,this.#a=0,this.#y&&this.#g){let c=this.#g,f;for(;f=c?.shift();)this.#t?.(...f)}}};import{posix as uar,win32 as SNe}from"node:path";import{fileURLToPath as far}from"node:url";import{lstatSync as _ar,readdir as par,readdirSync as dar,readlinkSync as mar,realpathSync as har}from"fs";import*as gar from"node:fs";import{lstat as bar,readdir as Sar,readlink as Tar,realpath as Car}from"node:fs/promises";import{EventEmitter as yNe}from"node:events";import Zut from"node:stream";import{StringDecoder as ear}from"node:string_decoder";var Qut=typeof process=="object"&&process?process:{stdout:null,stderr:null},tar=t(a=>!!a&&typeof a=="object"&&(a instanceof CN||a instanceof Zut||rar(a)||nar(a)),"isStream"),rar=t(a=>!!a&&typeof a=="object"&&a instanceof yNe&&typeof a.pipe=="function"&&a.pipe!==Zut.Writable.prototype.pipe,"isReadable"),nar=t(a=>!!a&&typeof a=="object"&&a instanceof yNe&&typeof a.write=="function"&&typeof a.end=="function","isWritable"),a6=Symbol("EOF"),o6=Symbol("maybeEmitEnd"),TN=Symbol("emittedEnd"),Yue=Symbol("emittingEnd"),yQ=Symbol("emittedError"),Xue=Symbol("closed"),Kut=Symbol("read"),Zue=Symbol("flush"),Yut=Symbol("flushChunk"),Ex=Symbol("encoding"),eB=Symbol("decoder"),h0=Symbol("flowing"),vQ=Symbol("paused"),tB=Symbol("resume"),g0=Symbol("buffer"),Dv=Symbol("pipes"),y0=Symbol("bufferLength"),_Ne=Symbol("bufferPush"),efe=Symbol("bufferShift"),s1=Symbol("objectMode"),ph=Symbol("destroyed"),pNe=Symbol("error"),dNe=Symbol("emitData"),Xut=Symbol("emitEnd"),mNe=Symbol("emitEnd2"),ek=Symbol("async"),hNe=Symbol("abort"),tfe=Symbol("aborted"),bQ=Symbol("signal"),GF=Symbol("dataListeners"),PS=Symbol("discarded"),SQ=t(a=>Promise.resolve().then(a),"defer"),iar=t(a=>a(),"nodefer"),sar=t(a=>a==="end"||a==="finish"||a==="prefinish","isEndish"),aar=t(a=>a instanceof ArrayBuffer||!!a&&typeof a=="object"&&a.constructor&&a.constructor.name==="ArrayBuffer"&&a.byteLength>=0,"isArrayBufferLike"),oar=t(a=>!Buffer.isBuffer(a)&&ArrayBuffer.isView(a),"isArrayBufferView"),rfe=class{static{t(this,"Pipe")}src;dest;opts;ondrain;constructor(s,c,f){this.src=s,this.dest=c,this.opts=f,this.ondrain=()=>s[tB](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(s){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},gNe=class extends rfe{static{t(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(s,c,f){super(s,c,f),this.proxyErrors=d=>c.emit("error",d),s.on("error",this.proxyErrors)}},car=t(a=>!!a.objectMode,"isObjectModeOptions"),lar=t(a=>!a.objectMode&&!!a.encoding&&a.encoding!=="buffer","isEncodingOptions"),CN=class extends yNe{static{t(this,"Minipass")}[h0]=!1;[vQ]=!1;[Dv]=[];[g0]=[];[s1];[Ex];[ek];[eB];[a6]=!1;[TN]=!1;[Yue]=!1;[Xue]=!1;[yQ]=null;[y0]=0;[ph]=!1;[bQ];[tfe]=!1;[GF]=0;[PS]=!1;writable=!0;readable=!0;constructor(...s){let c=s[0]||{};if(super(),c.objectMode&&typeof c.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");car(c)?(this[s1]=!0,this[Ex]=null):lar(c)?(this[Ex]=c.encoding,this[s1]=!1):(this[s1]=!1,this[Ex]=null),this[ek]=!!c.async,this[eB]=this[Ex]?new ear(this[Ex]):null,c&&c.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:t(()=>this[g0],"get")}),c&&c.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:t(()=>this[Dv],"get")});let{signal:f}=c;f&&(this[bQ]=f,f.aborted?this[hNe]():f.addEventListener("abort",()=>this[hNe]()))}get bufferLength(){return this[y0]}get encoding(){return this[Ex]}set encoding(s){throw new Error("Encoding must be set at instantiation time")}setEncoding(s){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[s1]}set objectMode(s){throw new Error("objectMode must be set at instantiation time")}get async(){return this[ek]}set async(s){this[ek]=this[ek]||!!s}[hNe](){this[tfe]=!0,this.emit("abort",this[bQ]?.reason),this.destroy(this[bQ]?.reason)}get aborted(){return this[tfe]}set aborted(s){}write(s,c,f){if(this[tfe])return!1;if(this[a6])throw new Error("write after end");if(this[ph])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof c=="function"&&(f=c,c="utf8"),c||(c="utf8");let d=this[ek]?SQ:iar;if(!this[s1]&&!Buffer.isBuffer(s)){if(oar(s))s=Buffer.from(s.buffer,s.byteOffset,s.byteLength);else if(aar(s))s=Buffer.from(s);else if(typeof s!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[s1]?(this[h0]&&this[y0]!==0&&this[Zue](!0),this[h0]?this.emit("data",s):this[_Ne](s),this[y0]!==0&&this.emit("readable"),f&&d(f),this[h0]):s.length?(typeof s=="string"&&!(c===this[Ex]&&!this[eB]?.lastNeed)&&(s=Buffer.from(s,c)),Buffer.isBuffer(s)&&this[Ex]&&(s=this[eB].write(s)),this[h0]&&this[y0]!==0&&this[Zue](!0),this[h0]?this.emit("data",s):this[_Ne](s),this[y0]!==0&&this.emit("readable"),f&&d(f),this[h0]):(this[y0]!==0&&this.emit("readable"),f&&d(f),this[h0])}read(s){if(this[ph])return null;if(this[PS]=!1,this[y0]===0||s===0||s&&s>this[y0])return this[o6](),null;this[s1]&&(s=null),this[g0].length>1&&!this[s1]&&(this[g0]=[this[Ex]?this[g0].join(""):Buffer.concat(this[g0],this[y0])]);let c=this[Kut](s||null,this[g0][0]);return this[o6](),c}[Kut](s,c){if(this[s1])this[efe]();else{let f=c;s===f.length||s===null?this[efe]():typeof f=="string"?(this[g0][0]=f.slice(s),c=f.slice(0,s),this[y0]-=s):(this[g0][0]=f.subarray(s),c=f.subarray(0,s),this[y0]-=s)}return this.emit("data",c),!this[g0].length&&!this[a6]&&this.emit("drain"),c}end(s,c,f){return typeof s=="function"&&(f=s,s=void 0),typeof c=="function"&&(f=c,c="utf8"),s!==void 0&&this.write(s,c),f&&this.once("end",f),this[a6]=!0,this.writable=!1,(this[h0]||!this[vQ])&&this[o6](),this}[tB](){this[ph]||(!this[GF]&&!this[Dv].length&&(this[PS]=!0),this[vQ]=!1,this[h0]=!0,this.emit("resume"),this[g0].length?this[Zue]():this[a6]?this[o6]():this.emit("drain"))}resume(){return this[tB]()}pause(){this[h0]=!1,this[vQ]=!0,this[PS]=!1}get destroyed(){return this[ph]}get flowing(){return this[h0]}get paused(){return this[vQ]}[_Ne](s){this[s1]?this[y0]+=1:this[y0]+=s.length,this[g0].push(s)}[efe](){return this[s1]?this[y0]-=1:this[y0]-=this[g0][0].length,this[g0].shift()}[Zue](s=!1){do;while(this[Yut](this[efe]())&&this[g0].length);!s&&!this[g0].length&&!this[a6]&&this.emit("drain")}[Yut](s){return this.emit("data",s),this[h0]}pipe(s,c){if(this[ph])return s;this[PS]=!1;let f=this[TN];return c=c||{},s===Qut.stdout||s===Qut.stderr?c.end=!1:c.end=c.end!==!1,c.proxyErrors=!!c.proxyErrors,f?c.end&&s.end():(this[Dv].push(c.proxyErrors?new gNe(this,s,c):new rfe(this,s,c)),this[ek]?SQ(()=>this[tB]()):this[tB]()),s}unpipe(s){let c=this[Dv].find(f=>f.dest===s);c&&(this[Dv].length===1?(this[h0]&&this[GF]===0&&(this[h0]=!1),this[Dv]=[]):this[Dv].splice(this[Dv].indexOf(c),1),c.unpipe())}addListener(s,c){return this.on(s,c)}on(s,c){let f=super.on(s,c);if(s==="data")this[PS]=!1,this[GF]++,!this[Dv].length&&!this[h0]&&this[tB]();else if(s==="readable"&&this[y0]!==0)super.emit("readable");else if(sar(s)&&this[TN])super.emit(s),this.removeAllListeners(s);else if(s==="error"&&this[yQ]){let d=c;this[ek]?SQ(()=>d.call(this,this[yQ])):d.call(this,this[yQ])}return f}removeListener(s,c){return this.off(s,c)}off(s,c){let f=super.off(s,c);return s==="data"&&(this[GF]=this.listeners("data").length,this[GF]===0&&!this[PS]&&!this[Dv].length&&(this[h0]=!1)),f}removeAllListeners(s){let c=super.removeAllListeners(s);return(s==="data"||s===void 0)&&(this[GF]=0,!this[PS]&&!this[Dv].length&&(this[h0]=!1)),c}get emittedEnd(){return this[TN]}[o6](){!this[Yue]&&!this[TN]&&!this[ph]&&this[g0].length===0&&this[a6]&&(this[Yue]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Xue]&&this.emit("close"),this[Yue]=!1)}emit(s,...c){let f=c[0];if(s!=="error"&&s!=="close"&&s!==ph&&this[ph])return!1;if(s==="data")return!this[s1]&&!f?!1:this[ek]?(SQ(()=>this[dNe](f)),!0):this[dNe](f);if(s==="end")return this[Xut]();if(s==="close"){if(this[Xue]=!0,!this[TN]&&!this[ph])return!1;let v=super.emit("close");return this.removeAllListeners("close"),v}else if(s==="error"){this[yQ]=f,super.emit(pNe,f);let v=!this[bQ]||this.listeners("error").length?super.emit("error",f):!1;return this[o6](),v}else if(s==="resume"){let v=super.emit("resume");return this[o6](),v}else if(s==="finish"||s==="prefinish"){let v=super.emit(s);return this.removeAllListeners(s),v}let d=super.emit(s,...c);return this[o6](),d}[dNe](s){for(let f of this[Dv])f.dest.write(s)===!1&&this.pause();let c=this[PS]?!1:super.emit("data",s);return this[o6](),c}[Xut](){return this[TN]?!1:(this[TN]=!0,this.readable=!1,this[ek]?(SQ(()=>this[mNe]()),!0):this[mNe]())}[mNe](){if(this[eB]){let c=this[eB].end();if(c){for(let f of this[Dv])f.dest.write(c);this[PS]||super.emit("data",c)}}for(let c of this[Dv])c.end();let s=super.emit("end");return this.removeAllListeners("end"),s}async collect(){let s=Object.assign([],{dataLength:0});this[s1]||(s.dataLength=0);let c=this.promise();return this.on("data",f=>{s.push(f),this[s1]||(s.dataLength+=f.length)}),await c,s}async concat(){if(this[s1])throw new Error("cannot concat in objectMode");let s=await this.collect();return this[Ex]?s.join(""):Buffer.concat(s,s.dataLength)}async promise(){return new Promise((s,c)=>{this.on(ph,()=>c(new Error("stream destroyed"))),this.on("error",f=>c(f)),this.on("end",()=>s())})}[Symbol.asyncIterator](){this[PS]=!1;let s=!1,c=t(async()=>(this.pause(),s=!0,{value:void 0,done:!0}),"stop");return{next:t(()=>{if(s)return c();let d=this.read();if(d!==null)return Promise.resolve({done:!1,value:d});if(this[a6])return c();let v,E,A=t($=>{this.off("data",O),this.off("end",R),this.off(ph,W),c(),E($)},"onerr"),O=t($=>{this.off("error",A),this.off("end",R),this.off(ph,W),this.pause(),v({value:$,done:!!this[a6]})},"ondata"),R=t(()=>{this.off("error",A),this.off("data",O),this.off(ph,W),c(),v({done:!0,value:void 0})},"onend"),W=t(()=>A(new Error("stream destroyed")),"ondestroy");return new Promise(($,K)=>{E=K,v=$,this.once(ph,W),this.once("error",A),this.once("end",R),this.once("data",O)})},"next"),throw:c,return:c,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[PS]=!1;let s=!1,c=t(()=>(this.pause(),this.off(pNe,c),this.off(ph,c),this.off("end",c),s=!0,{done:!0,value:void 0}),"stop"),f=t(()=>{if(s)return c();let d=this.read();return d===null?c():{done:!1,value:d}},"next");return this.once("end",c),this.once(pNe,c),this.once(ph,c),{next:f,throw:c,return:c,[Symbol.iterator](){return this}}}destroy(s){if(this[ph])return s?this.emit("error",s):this.emit(ph),this;this[ph]=!0,this[PS]=!0,this[g0].length=0,this[y0]=0;let c=this;return typeof c.close=="function"&&!this[Xue]&&c.close(),s?this.emit("error",s):this.emit(ph),this}static get isStream(){return tar}};var yar=har.native,CQ={lstatSync:_ar,readdir:par,readdirSync:dar,readlinkSync:mar,realpathSync:yar,promises:{lstat:bar,readdir:Sar,readlink:Tar,realpath:Car}},ift=t(a=>!a||a===CQ||a===gar?CQ:{...CQ,...a,promises:{...CQ.promises,...a.promises||{}}},"fsFromOption"),sft=/^\\\\\?\\([a-z]:)\\?$/i,Ear=t(a=>a.replace(/\//g,"\\").replace(sft,"$1\\"),"uncToDrive"),xar=/[\\\/]/,hC=0,aft=1,oft=2,tk=4,cft=6,lft=8,QF=10,uft=12,mC=15,TQ=~mC,vNe=16,eft=32,EQ=64,xx=128,nfe=256,sfe=512,tft=EQ|xx|sfe,Dar=1023,bNe=t(a=>a.isFile()?lft:a.isDirectory()?tk:a.isSymbolicLink()?QF:a.isCharacterDevice()?oft:a.isBlockDevice()?cft:a.isSocket()?uft:a.isFIFO()?aft:hC,"entToType"),rft=new Map,xQ=t(a=>{let s=rft.get(a);if(s)return s;let c=a.normalize("NFKD");return rft.set(a,c),c},"normalize"),nft=new Map,ife=t(a=>{let s=nft.get(a);if(s)return s;let c=xQ(a.toLowerCase());return nft.set(a,c),c},"normalizeNocase"),afe=class extends gQ{static{t(this,"ResolveCache")}constructor(){super({max:256})}},TNe=class extends gQ{static{t(this,"ChildrenCache")}constructor(s=16*1024){super({maxSize:s,sizeCalculation:t(c=>c.length+1,"sizeCalculation")})}},fft=Symbol("PathScurry setAsCwd"),a1=class{static{t(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#r;#n;get dev(){return this.#n}#e;get mode(){return this.#e}#t;get nlink(){return this.#t}#s;get uid(){return this.#s}#p;get gid(){return this.#p}#a;get rdev(){return this.#a}#_;get blksize(){return this.#_}#c;get ino(){return this.#c}#l;get size(){return this.#l}#i;get blocks(){return this.#i}#f;get atimeMs(){return this.#f}#v;get mtimeMs(){return this.#v}#d;get ctimeMs(){return this.#d}#u;get birthtimeMs(){return this.#u}#m;get atime(){return this.#m}#g;get mtime(){return this.#g}#x;get ctime(){return this.#x}#C;get birthtime(){return this.#C}#b;#A;#E;#y;#D;#k;#o;#N;#S;#T;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(s,c=hC,f,d,v,E,A){this.name=s,this.#b=v?ife(s):xQ(s),this.#o=c&Dar,this.nocase=v,this.roots=d,this.root=f||this,this.#N=E,this.#E=A.fullpath,this.#D=A.relative,this.#k=A.relativePosix,this.parent=A.parent,this.parent?this.#r=this.parent.#r:this.#r=ift(A.fs)}depth(){return this.#A!==void 0?this.#A:this.parent?this.#A=this.parent.depth()+1:this.#A=0}childrenCache(){return this.#N}resolve(s){if(!s)return this;let c=this.getRootString(s),d=s.substring(c.length).split(this.splitSep);return c?this.getRoot(c).#I(d):this.#I(d)}#I(s){let c=this;for(let f of s)c=c.child(f);return c}children(){let s=this.#N.get(this);if(s)return s;let c=Object.assign([],{provisional:0});return this.#N.set(this,c),this.#o&=~vNe,c}child(s,c){if(s===""||s===".")return this;if(s==="..")return this.parent||this;let f=this.children(),d=this.nocase?ife(s):xQ(s);for(let O of f)if(O.#b===d)return O;let v=this.parent?this.sep:"",E=this.#E?this.#E+v+s:void 0,A=this.newChild(s,hC,{...c,parent:this,fullpath:E});return this.canReaddir()||(A.#o|=xx),f.push(A),A}relative(){if(this.isCWD)return"";if(this.#D!==void 0)return this.#D;let s=this.name,c=this.parent;if(!c)return this.#D=this.name;let f=c.relative();return f+(!f||!c.parent?"":this.sep)+s}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let s=this.name,c=this.parent;if(!c)return this.#k=this.fullpathPosix();let f=c.relativePosix();return f+(!f||!c.parent?"":"/")+s}fullpath(){if(this.#E!==void 0)return this.#E;let s=this.name,c=this.parent;if(!c)return this.#E=this.name;let d=c.fullpath()+(c.parent?this.sep:"")+s;return this.#E=d}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let d=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(d)?this.#y=`//?/${d}`:this.#y=d}let s=this.parent,c=s.fullpathPosix(),f=c+(!c||!s.parent?"":"/")+this.name;return this.#y=f}isUnknown(){return(this.#o&mC)===hC}isType(s){return this[`is${s}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#o&mC)===lft}isDirectory(){return(this.#o&mC)===tk}isCharacterDevice(){return(this.#o&mC)===oft}isBlockDevice(){return(this.#o&mC)===cft}isFIFO(){return(this.#o&mC)===aft}isSocket(){return(this.#o&mC)===uft}isSymbolicLink(){return(this.#o&QF)===QF}lstatCached(){return this.#o&eft?this:void 0}readlinkCached(){return this.#S}realpathCached(){return this.#T}readdirCached(){let s=this.children();return s.slice(0,s.provisional)}canReadlink(){if(this.#S)return!0;if(!this.parent)return!1;let s=this.#o&mC;return!(s!==hC&&s!==QF||this.#o&nfe||this.#o&xx)}calledReaddir(){return!!(this.#o&vNe)}isENOENT(){return!!(this.#o&xx)}isNamed(s){return this.nocase?this.#b===ife(s):this.#b===xQ(s)}async readlink(){let s=this.#S;if(s)return s;if(this.canReadlink()&&this.parent)try{let c=await this.#r.promises.readlink(this.fullpath()),f=(await this.parent.realpath())?.resolve(c);if(f)return this.#S=f}catch(c){this.#h(c.code);return}}readlinkSync(){let s=this.#S;if(s)return s;if(this.canReadlink()&&this.parent)try{let c=this.#r.readlinkSync(this.fullpath()),f=this.parent.realpathSync()?.resolve(c);if(f)return this.#S=f}catch(c){this.#h(c.code);return}}#F(s){this.#o|=vNe;for(let c=s.provisional;c<s.length;c++){let f=s[c];f&&f.#L()}}#L(){this.#o&xx||(this.#o=(this.#o|xx)&TQ,this.#w())}#w(){let s=this.children();s.provisional=0;for(let c of s)c.#L()}#P(){this.#o|=sfe,this.#R()}#R(){if(this.#o&EQ)return;let s=this.#o;(s&mC)===tk&&(s&=TQ),this.#o=s|EQ,this.#w()}#M(s=""){s==="ENOTDIR"||s==="EPERM"?this.#R():s==="ENOENT"?this.#L():this.children().provisional=0}#j(s=""){s==="ENOTDIR"?this.parent.#R():s==="ENOENT"&&this.#L()}#h(s=""){let c=this.#o;c|=nfe,s==="ENOENT"&&(c|=xx),(s==="EINVAL"||s==="UNKNOWN")&&(c&=TQ),this.#o=c,s==="ENOTDIR"&&this.parent&&this.parent.#R()}#B(s,c){return this.#O(s,c)||this.#U(s,c)}#U(s,c){let f=bNe(s),d=this.newChild(s.name,f,{parent:this}),v=d.#o&mC;return v!==tk&&v!==QF&&v!==hC&&(d.#o|=EQ),c.unshift(d),c.provisional++,d}#O(s,c){for(let f=c.provisional;f<c.length;f++){let d=c[f];if((this.nocase?ife(s.name):xQ(s.name))===d.#b)return this.#$(s,d,f,c)}}#$(s,c,f,d){let v=c.name;return c.#o=c.#o&TQ|bNe(s),v!==s.name&&(c.name=s.name),f!==d.provisional&&(f===d.length-1?d.pop():d.splice(f,1),d.unshift(c)),d.provisional++,c}async lstat(){if((this.#o&xx)===0)try{return this.#V(await this.#r.promises.lstat(this.fullpath())),this}catch(s){this.#j(s.code)}}lstatSync(){if((this.#o&xx)===0)try{return this.#V(this.#r.lstatSync(this.fullpath())),this}catch(s){this.#j(s.code)}}#V(s){let{atime:c,atimeMs:f,birthtime:d,birthtimeMs:v,blksize:E,blocks:A,ctime:O,ctimeMs:R,dev:W,gid:$,ino:K,mode:Pe,mtime:De,mtimeMs:Se,nlink:Ct,rdev:bt,size:hr,uid:Pr}=s;this.#m=c,this.#f=f,this.#C=d,this.#u=v,this.#_=E,this.#i=A,this.#x=O,this.#d=R,this.#n=W,this.#p=$,this.#c=K,this.#e=Pe,this.#g=De,this.#v=Se,this.#t=Ct,this.#a=bt,this.#l=hr,this.#s=Pr;let jr=bNe(s);this.#o=this.#o&TQ|jr|eft,jr!==hC&&jr!==tk&&jr!==QF&&(this.#o|=EQ)}#q=[];#z=!1;#W(s){this.#z=!1;let c=this.#q.slice();this.#q.length=0,c.forEach(f=>f(null,s))}readdirCB(s,c=!1){if(!this.canReaddir()){c?s(null,[]):queueMicrotask(()=>s(null,[]));return}let f=this.children();if(this.calledReaddir()){let v=f.slice(0,f.provisional);c?s(null,v):queueMicrotask(()=>s(null,v));return}if(this.#q.push(s),this.#z)return;this.#z=!0;let d=this.fullpath();this.#r.readdir(d,{withFileTypes:!0},(v,E)=>{if(v)this.#M(v.code),f.provisional=0;else{for(let A of E)this.#B(A,f);this.#F(f)}this.#W(f.slice(0,f.provisional))})}#J;async readdir(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let c=this.fullpath();if(this.#J)await this.#J;else{let f=t(()=>{},"resolve");this.#J=new Promise(d=>f=d);try{for(let d of await this.#r.promises.readdir(c,{withFileTypes:!0}))this.#B(d,s);this.#F(s)}catch(d){this.#M(d.code),s.provisional=0}this.#J=void 0,f()}return s.slice(0,s.provisional)}readdirSync(){if(!this.canReaddir())return[];let s=this.children();if(this.calledReaddir())return s.slice(0,s.provisional);let c=this.fullpath();try{for(let f of this.#r.readdirSync(c,{withFileTypes:!0}))this.#B(f,s);this.#F(s)}catch(f){this.#M(f.code),s.provisional=0}return s.slice(0,s.provisional)}canReaddir(){if(this.#o&tft)return!1;let s=mC&this.#o;return s===hC||s===tk||s===QF}shouldWalk(s,c){return(this.#o&tk)===tk&&!(this.#o&tft)&&!s.has(this)&&(!c||c(this))}async realpath(){if(this.#T)return this.#T;if(!((sfe|nfe|xx)&this.#o))try{let s=await this.#r.promises.realpath(this.fullpath());return this.#T=this.resolve(s)}catch{this.#P()}}realpathSync(){if(this.#T)return this.#T;if(!((sfe|nfe|xx)&this.#o))try{let s=this.#r.realpathSync(this.fullpath());return this.#T=this.resolve(s)}catch{this.#P()}}[fft](s){if(s===this)return;s.isCWD=!1,this.isCWD=!0;let c=new Set([]),f=[],d=this;for(;d&&d.parent;)c.add(d),d.#D=f.join(this.sep),d.#k=f.join("/"),d=d.parent,f.push("..");for(d=s;d&&d.parent&&!c.has(d);)d.#D=void 0,d.#k=void 0,d=d.parent}},ofe=class a extends a1{static{t(this,"PathWin32")}sep="\\";splitSep=xar;constructor(s,c=hC,f,d,v,E,A){super(s,c,f,d,v,E,A)}newChild(s,c=hC,f={}){return new a(s,c,this.root,this.roots,this.nocase,this.childrenCache(),f)}getRootString(s){return SNe.parse(s).root}getRoot(s){if(s=Ear(s.toUpperCase()),s===this.root.name)return this.root;for(let[c,f]of Object.entries(this.roots))if(this.sameRoot(s,c))return this.roots[s]=f;return this.roots[s]=new rB(s,this).root}sameRoot(s,c=this.root.name){return s=s.toUpperCase().replace(/\//g,"\\").replace(sft,"$1\\"),s===c}},cfe=class a extends a1{static{t(this,"PathPosix")}splitSep="/";sep="/";constructor(s,c=hC,f,d,v,E,A){super(s,c,f,d,v,E,A)}getRootString(s){return s.startsWith("/")?"/":""}getRoot(s){return this.root}newChild(s,c=hC,f={}){return new a(s,c,this.root,this.roots,this.nocase,this.childrenCache(),f)}},lfe=class{static{t(this,"PathScurryBase")}root;rootPath;roots;cwd;#r;#n;#e;nocase;#t;constructor(s=process.cwd(),c,f,{nocase:d,childrenCacheSize:v=16*1024,fs:E=CQ}={}){this.#t=ift(E),(s instanceof URL||s.startsWith("file://"))&&(s=far(s));let A=c.resolve(s);this.roots=Object.create(null),this.rootPath=this.parseRootPath(A),this.#r=new afe,this.#n=new afe,this.#e=new TNe(v);let O=A.substring(this.rootPath.length).split(f);if(O.length===1&&!O[0]&&O.pop(),d===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=d,this.root=this.newRoot(this.#t),this.roots[this.rootPath]=this.root;let R=this.root,W=O.length-1,$=c.sep,K=this.rootPath,Pe=!1;for(let De of O){let Se=W--;R=R.child(De,{relative:new Array(Se).fill("..").join($),relativePosix:new Array(Se).fill("..").join("/"),fullpath:K+=(Pe?"":$)+De}),Pe=!0}this.cwd=R}depth(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.depth()}childrenCache(){return this.#e}resolve(...s){let c="";for(let v=s.length-1;v>=0;v--){let E=s[v];if(!(!E||E===".")&&(c=c?`${E}/${c}`:E,this.isAbsolute(E)))break}let f=this.#r.get(c);if(f!==void 0)return f;let d=this.cwd.resolve(c).fullpath();return this.#r.set(c,d),d}resolvePosix(...s){let c="";for(let v=s.length-1;v>=0;v--){let E=s[v];if(!(!E||E===".")&&(c=c?`${E}/${c}`:E,this.isAbsolute(E)))break}let f=this.#n.get(c);if(f!==void 0)return f;let d=this.cwd.resolve(c).fullpathPosix();return this.#n.set(c,d),d}relative(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relative()}relativePosix(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.relativePosix()}basename(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.name}dirname(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),(s.parent||s).fullpath()}async readdir(s=this.cwd,c={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f}=c;if(s.canReaddir()){let d=await s.readdir();return f?d:d.map(v=>v.name)}else return[]}readdirSync(s=this.cwd,c={withFileTypes:!0}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0}=c;return s.canReaddir()?f?s.readdirSync():s.readdirSync().map(d=>d.name):[]}async lstat(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstat()}lstatSync(s=this.cwd){return typeof s=="string"&&(s=this.cwd.resolve(s)),s.lstatSync()}async readlink(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s.withFileTypes,s=this.cwd);let f=await s.readlink();return c?f:f?.fullpath()}readlinkSync(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s.withFileTypes,s=this.cwd);let f=s.readlinkSync();return c?f:f?.fullpath()}async realpath(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s.withFileTypes,s=this.cwd);let f=await s.realpath();return c?f:f?.fullpath()}realpathSync(s=this.cwd,{withFileTypes:c}={withFileTypes:!1}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s.withFileTypes,s=this.cwd);let f=s.realpathSync();return c?f:f?.fullpath()}async walk(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=[];(!v||v(s))&&A.push(f?s:s.fullpath());let O=new Set,R=t(($,K)=>{O.add($),$.readdirCB((Pe,De)=>{if(Pe)return K(Pe);let Se=De.length;if(!Se)return K();let Ct=t(()=>{--Se===0&&K()},"next");for(let bt of De)(!v||v(bt))&&A.push(f?bt:bt.fullpath()),d&&bt.isSymbolicLink()?bt.realpath().then(hr=>hr?.isUnknown()?hr.lstat():hr).then(hr=>hr?.shouldWalk(O,E)?R(hr,Ct):Ct()):bt.shouldWalk(O,E)?R(bt,Ct):Ct()},!0)},"walk"),W=s;return new Promise(($,K)=>{R(W,Pe=>{if(Pe)return K(Pe);$(A)})})}walkSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=[];(!v||v(s))&&A.push(f?s:s.fullpath());let O=new Set([s]);for(let R of O){let W=R.readdirSync();for(let $ of W){(!v||v($))&&A.push(f?$:$.fullpath());let K=$;if($.isSymbolicLink()){if(!(d&&(K=$.realpathSync())))continue;K.isUnknown()&&K.lstatSync()}K.shouldWalk(O,E)&&O.add(K)}}return A}[Symbol.asyncIterator](){return this.iterate()}iterate(s=this.cwd,c={}){return typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd),this.stream(s,c)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c;(!v||v(s))&&(yield f?s:s.fullpath());let A=new Set([s]);for(let O of A){let R=O.readdirSync();for(let W of R){(!v||v(W))&&(yield f?W:W.fullpath());let $=W;if(W.isSymbolicLink()){if(!(d&&($=W.realpathSync())))continue;$.isUnknown()&&$.lstatSync()}$.shouldWalk(A,E)&&A.add($)}}}stream(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=new CN({objectMode:!0});(!v||v(s))&&A.write(f?s:s.fullpath());let O=new Set,R=[s],W=0,$=t(()=>{let K=!1;for(;!K;){let Pe=R.shift();if(!Pe){W===0&&A.end();return}W++,O.add(Pe);let De=t((Ct,bt,hr=!1)=>{if(Ct)return A.emit("error",Ct);if(d&&!hr){let Pr=[];for(let jr of bt)jr.isSymbolicLink()&&Pr.push(jr.realpath().then(dr=>dr?.isUnknown()?dr.lstat():dr));if(Pr.length){Promise.all(Pr).then(()=>De(null,bt,!0));return}}for(let Pr of bt)Pr&&(!v||v(Pr))&&(A.write(f?Pr:Pr.fullpath())||(K=!0));W--;for(let Pr of bt){let jr=Pr.realpathCached()||Pr;jr.shouldWalk(O,E)&&R.push(jr)}K&&!A.flowing?A.once("drain",$):Se||$()},"onReaddir"),Se=!0;Pe.readdirCB(De,!0),Se=!1}},"process");return $(),A}streamSync(s=this.cwd,c={}){typeof s=="string"?s=this.cwd.resolve(s):s instanceof a1||(c=s,s=this.cwd);let{withFileTypes:f=!0,follow:d=!1,filter:v,walkFilter:E}=c,A=new CN({objectMode:!0}),O=new Set;(!v||v(s))&&A.write(f?s:s.fullpath());let R=[s],W=0,$=t(()=>{let K=!1;for(;!K;){let Pe=R.shift();if(!Pe){W===0&&A.end();return}W++,O.add(Pe);let De=Pe.readdirSync();for(let Se of De)(!v||v(Se))&&(A.write(f?Se:Se.fullpath())||(K=!0));W--;for(let Se of De){let Ct=Se;if(Se.isSymbolicLink()){if(!(d&&(Ct=Se.realpathSync())))continue;Ct.isUnknown()&&Ct.lstatSync()}Ct.shouldWalk(O,E)&&R.push(Ct)}}K&&!A.flowing&&A.once("drain",$)},"process");return $(),A}chdir(s=this.cwd){let c=this.cwd;this.cwd=typeof s=="string"?this.cwd.resolve(s):s,this.cwd[fft](c)}},rB=class extends lfe{static{t(this,"PathScurryWin32")}sep="\\";constructor(s=process.cwd(),c={}){let{nocase:f=!0}=c;super(s,SNe,"\\",{...c,nocase:f}),this.nocase=f;for(let d=this.cwd;d;d=d.parent)d.nocase=this.nocase}parseRootPath(s){return SNe.parse(s).root.toUpperCase()}newRoot(s){return new ofe(this.rootPath,tk,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")||s.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(s)}},nB=class extends lfe{static{t(this,"PathScurryPosix")}sep="/";constructor(s=process.cwd(),c={}){let{nocase:f=!1}=c;super(s,uar,"/",{...c,nocase:f}),this.nocase=f}parseRootPath(s){return"/"}newRoot(s){return new cfe(this.rootPath,tk,void 0,this.roots,this.nocase,this.childrenCache(),{fs:s})}isAbsolute(s){return s.startsWith("/")}},DQ=class extends nB{static{t(this,"PathScurryDarwin")}constructor(s=process.cwd(),c={}){let{nocase:f=!0}=c;super(s,{...c,nocase:f})}},RLr=process.platform==="win32"?ofe:cfe,_ft=process.platform==="win32"?rB:process.platform==="darwin"?DQ:nB;var Aar=t(a=>a.length>=1,"isPatternList"),kar=t(a=>a.length>=1,"isGlobList"),iB=class a{static{t(this,"Pattern")}#r;#n;#e;length;#t;#s;#p;#a;#_;#c;#l=!0;constructor(s,c,f,d){if(!Aar(s))throw new TypeError("empty pattern list");if(!kar(c))throw new TypeError("empty glob list");if(c.length!==s.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=s.length,f<0||f>=this.length)throw new TypeError("index out of range");if(this.#r=s,this.#n=c,this.#e=f,this.#t=d,this.#e===0){if(this.isUNC()){let[v,E,A,O,...R]=this.#r,[W,$,K,Pe,...De]=this.#n;R[0]===""&&(R.shift(),De.shift());let Se=[v,E,A,O,""].join("/"),Ct=[W,$,K,Pe,""].join("/");this.#r=[Se,...R],this.#n=[Ct,...De],this.length=this.#r.length}else if(this.isDrive()||this.isAbsolute()){let[v,...E]=this.#r,[A,...O]=this.#n;E[0]===""&&(E.shift(),O.shift());let R=v+"/",W=A+"/";this.#r=[R,...E],this.#n=[W,...O],this.length=this.#r.length}}}pattern(){return this.#r[this.#e]}isString(){return typeof this.#r[this.#e]=="string"}isGlobstar(){return this.#r[this.#e]===iy}isRegExp(){return this.#r[this.#e]instanceof RegExp}globString(){return this.#p=this.#p||(this.#e===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#e).join("/"))}hasMore(){return this.length>this.#e+1}rest(){return this.#s!==void 0?this.#s:this.hasMore()?(this.#s=new a(this.#r,this.#n,this.#e+1,this.#t),this.#s.#c=this.#c,this.#s.#_=this.#_,this.#s.#a=this.#a,this.#s):this.#s=null}isUNC(){let s=this.#r;return this.#_!==void 0?this.#_:this.#_=this.#t==="win32"&&this.#e===0&&s[0]===""&&s[1]===""&&typeof s[2]=="string"&&!!s[2]&&typeof s[3]=="string"&&!!s[3]}isDrive(){let s=this.#r;return this.#a!==void 0?this.#a:this.#a=this.#t==="win32"&&this.#e===0&&this.length>1&&typeof s[0]=="string"&&/^[a-z]:$/i.test(s[0])}isAbsolute(){let s=this.#r;return this.#c!==void 0?this.#c:this.#c=s[0]===""&&s.length>1||this.isDrive()||this.isUNC()}root(){let s=this.#r[0];return typeof s=="string"&&this.isAbsolute()&&this.#e===0?s:""}checkFollowGlobstar(){return!(this.#e===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#e===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var war=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",sB=class{static{t(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(s,{nobrace:c,nocase:f,noext:d,noglobstar:v,platform:E=war}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=E,this.mmopts={dot:!0,nobrace:c,nocase:f,noext:d,noglobstar:v,optimizationLevel:2,platform:E,nocomment:!0,nonegate:!0};for(let A of s)this.add(A)}add(s){let c=new wS(s,this.mmopts);for(let f=0;f<c.set.length;f++){let d=c.set[f],v=c.globParts[f];if(!d||!v)throw new Error("invalid pattern object");for(;d[0]==="."&&v[0]===".";)d.shift(),v.shift();let E=new iB(d,v,0,this.platform),A=new wS(E.globString(),this.mmopts),O=v[v.length-1]==="**",R=E.isAbsolute();R?this.absolute.push(A):this.relative.push(A),O&&(R?this.absoluteChildren.push(A):this.relativeChildren.push(A))}}ignored(s){let c=s.fullpath(),f=`${c}/`,d=s.relative()||".",v=`${d}/`;for(let E of this.relative)if(E.match(d)||E.match(v))return!0;for(let E of this.absolute)if(E.match(c)||E.match(f))return!0;return!1}childrenIgnored(s){let c=s.fullpath()+"/",f=(s.relative()||".")+"/";for(let d of this.relativeChildren)if(d.match(f))return!0;for(let d of this.absoluteChildren)if(d.match(c))return!0;return!1}};var CNe=class a{static{t(this,"HasWalkedCache")}store;constructor(s=new Map){this.store=s}copy(){return new a(new Map(this.store))}hasWalked(s,c){return this.store.get(s.fullpath())?.has(c.globString())}storeWalked(s,c){let f=s.fullpath(),d=this.store.get(f);d?d.add(c.globString()):this.store.set(f,new Set([c.globString()]))}},ENe=class{static{t(this,"MatchRecord")}store=new Map;add(s,c,f){let d=(c?2:0)|(f?1:0),v=this.store.get(s);this.store.set(s,v===void 0?d:d&v)}entries(){return[...this.store.entries()].map(([s,c])=>[s,!!(c&2),!!(c&1)])}},xNe=class{static{t(this,"SubWalks")}store=new Map;add(s,c){if(!s.canReaddir())return;let f=this.store.get(s);f?f.find(d=>d.globString()===c.globString())||f.push(c):this.store.set(s,[c])}get(s){let c=this.store.get(s);if(!c)throw new Error("attempting to walk unknown path");return c}entries(){return this.keys().map(s=>[s,this.store.get(s)])}keys(){return[...this.store.keys()].filter(s=>s.canReaddir())}},AQ=class a{static{t(this,"Processor")}hasWalkedCache;matches=new ENe;subwalks=new xNe;patterns;follow;dot;opts;constructor(s,c){this.opts=s,this.follow=!!s.follow,this.dot=!!s.dot,this.hasWalkedCache=c?c.copy():new CNe}processPatterns(s,c){this.patterns=c;let f=c.map(d=>[s,d]);for(let[d,v]of f){this.hasWalkedCache.storeWalked(d,v);let E=v.root(),A=v.isAbsolute()&&this.opts.absolute!==!1;if(E){d=d.resolve(E==="/"&&this.opts.root!==void 0?this.opts.root:E);let $=v.rest();if($)v=$;else{this.matches.add(d,!0,!1);continue}}if(d.isENOENT())continue;let O,R,W=!1;for(;typeof(O=v.pattern())=="string"&&(R=v.rest());)d=d.resolve(O),v=R,W=!0;if(O=v.pattern(),R=v.rest(),W){if(this.hasWalkedCache.hasWalked(d,v))continue;this.hasWalkedCache.storeWalked(d,v)}if(typeof O=="string"){let $=O===".."||O===""||O===".";this.matches.add(d.resolve(O),A,$);continue}else if(O===iy){(!d.isSymbolicLink()||this.follow||v.checkFollowGlobstar())&&this.subwalks.add(d,v);let $=R?.pattern(),K=R?.rest();if(!R||($===""||$===".")&&!K)this.matches.add(d,A,$===""||$===".");else if($===".."){let Pe=d.parent||d;K?this.hasWalkedCache.hasWalked(Pe,K)||this.subwalks.add(Pe,K):this.matches.add(Pe,A,!0)}}else O instanceof RegExp&&this.subwalks.add(d,v)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new a(this.opts,this.hasWalkedCache)}filterEntries(s,c){let f=this.subwalks.get(s),d=this.child();for(let v of c)for(let E of f){let A=E.isAbsolute(),O=E.pattern(),R=E.rest();O===iy?d.testGlobstar(v,E,R,A):O instanceof RegExp?d.testRegExp(v,O,R,A):d.testString(v,O,R,A)}return d}testGlobstar(s,c,f,d){if((this.dot||!s.name.startsWith("."))&&(c.hasMore()||this.matches.add(s,d,!1),s.canReaddir()&&(this.follow||!s.isSymbolicLink()?this.subwalks.add(s,c):s.isSymbolicLink()&&(f&&c.checkFollowGlobstar()?this.subwalks.add(s,f):c.markFollowGlobstar()&&this.subwalks.add(s,c)))),f){let v=f.pattern();if(typeof v=="string"&&v!==".."&&v!==""&&v!==".")this.testString(s,v,f.rest(),d);else if(v===".."){let E=s.parent||s;this.subwalks.add(E,f)}else v instanceof RegExp&&this.testRegExp(s,v,f.rest(),d)}}testRegExp(s,c,f,d){c.test(s.name)&&(f?this.subwalks.add(s,f):this.matches.add(s,d,!1))}testString(s,c,f,d){s.isNamed(c)&&(f?this.subwalks.add(s,f):this.matches.add(s,d,!1))}};var Par=t((a,s)=>typeof a=="string"?new sB([a],s):Array.isArray(a)?new sB(a,s):a,"makeIgnore"),ufe=class{static{t(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#r=[];#n;#e;signal;maxDepth;includeChildMatches;constructor(s,c,f){if(this.patterns=s,this.path=c,this.opts=f,this.#e=!f.posix&&f.platform==="win32"?"\\":"/",this.includeChildMatches=f.includeChildMatches!==!1,(f.ignore||!this.includeChildMatches)&&(this.#n=Par(f.ignore??[],f),!this.includeChildMatches&&typeof this.#n.add!="function")){let d="cannot ignore child matches, ignore lacks add() method.";throw new Error(d)}this.maxDepth=f.maxDepth||1/0,f.signal&&(this.signal=f.signal,this.signal.addEventListener("abort",()=>{this.#r.length=0}))}#t(s){return this.seen.has(s)||!!this.#n?.ignored?.(s)}#s(s){return!!this.#n?.childrenIgnored?.(s)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let s;for(;!this.paused&&(s=this.#r.shift());)s()}onResume(s){this.signal?.aborted||(this.paused?this.#r.push(s):s())}async matchCheck(s,c){if(c&&this.opts.nodir)return;let f;if(this.opts.realpath){if(f=s.realpathCached()||await s.realpath(),!f)return;s=f}let v=s.isUnknown()||this.opts.stat?await s.lstat():s;if(this.opts.follow&&this.opts.nodir&&v?.isSymbolicLink()){let E=await v.realpath();E&&(E.isUnknown()||this.opts.stat)&&await E.lstat()}return this.matchCheckTest(v,c)}matchCheckTest(s,c){return s&&(this.maxDepth===1/0||s.depth()<=this.maxDepth)&&(!c||s.canReaddir())&&(!this.opts.nodir||!s.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!s.isSymbolicLink()||!s.realpathCached()?.isDirectory())&&!this.#t(s)?s:void 0}matchCheckSync(s,c){if(c&&this.opts.nodir)return;let f;if(this.opts.realpath){if(f=s.realpathCached()||s.realpathSync(),!f)return;s=f}let v=s.isUnknown()||this.opts.stat?s.lstatSync():s;if(this.opts.follow&&this.opts.nodir&&v?.isSymbolicLink()){let E=v.realpathSync();E&&(E?.isUnknown()||this.opts.stat)&&E.lstatSync()}return this.matchCheckTest(v,c)}matchFinish(s,c){if(this.#t(s))return;if(!this.includeChildMatches&&this.#n?.add){let v=`${s.relativePosix()}/**`;this.#n.add(v)}let f=this.opts.absolute===void 0?c:this.opts.absolute;this.seen.add(s);let d=this.opts.mark&&s.isDirectory()?this.#e:"";if(this.opts.withFileTypes)this.matchEmit(s);else if(f){let v=this.opts.posix?s.fullpathPosix():s.fullpath();this.matchEmit(v+d)}else{let v=this.opts.posix?s.relativePosix():s.relative(),E=this.opts.dotRelative&&!v.startsWith(".."+this.#e)?"."+this.#e:"";this.matchEmit(v?E+v+d:"."+d)}}async match(s,c,f){let d=await this.matchCheck(s,f);d&&this.matchFinish(d,c)}matchSync(s,c,f){let d=this.matchCheckSync(s,f);d&&this.matchFinish(d,c)}walkCB(s,c,f){this.signal?.aborted&&f(),this.walkCB2(s,c,new AQ(this.opts),f)}walkCB2(s,c,f,d){if(this.#s(s))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2(s,c,f,d));return}f.processPatterns(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,R]of f.matches.entries())this.#t(A)||(v++,this.match(A,O,R).then(()=>E()));for(let A of f.subwalkTargets()){if(this.maxDepth!==1/0&&A.depth()>=this.maxDepth)continue;v++;let O=A.readdirCached();A.calledReaddir()?this.walkCB3(A,O,f,E):A.readdirCB((R,W)=>this.walkCB3(A,W,f,E),!0)}E()}walkCB3(s,c,f,d){f=f.filterEntries(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,R]of f.matches.entries())this.#t(A)||(v++,this.match(A,O,R).then(()=>E()));for(let[A,O]of f.subwalks.entries())v++,this.walkCB2(A,O,f.child(),E);E()}walkCBSync(s,c,f){this.signal?.aborted&&f(),this.walkCB2Sync(s,c,new AQ(this.opts),f)}walkCB2Sync(s,c,f,d){if(this.#s(s))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2Sync(s,c,f,d));return}f.processPatterns(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,R]of f.matches.entries())this.#t(A)||this.matchSync(A,O,R);for(let A of f.subwalkTargets()){if(this.maxDepth!==1/0&&A.depth()>=this.maxDepth)continue;v++;let O=A.readdirSync();this.walkCB3Sync(A,O,f,E)}E()}walkCB3Sync(s,c,f,d){f=f.filterEntries(s,c);let v=1,E=t(()=>{--v===0&&d()},"next");for(let[A,O,R]of f.matches.entries())this.#t(A)||this.matchSync(A,O,R);for(let[A,O]of f.subwalks.entries())v++,this.walkCB2Sync(A,O,f.child(),E);E()}},kQ=class extends ufe{static{t(this,"GlobWalker")}matches=new Set;constructor(s,c,f){super(s,c,f)}matchEmit(s){this.matches.add(s)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((s,c)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?c(this.signal.reason):s(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},wQ=class extends ufe{static{t(this,"GlobStream")}results;constructor(s,c,f){super(s,c,f),this.results=new CN({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(s){this.results.write(s),this.results.flowing||this.pause()}stream(){let s=this.path;return s.isUnknown()?s.lstat().then(()=>{this.walkCB(s,this.patterns,()=>this.results.end())}):this.walkCB(s,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var Iar=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Dx=class{static{t(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(s,c){if(!c)throw new TypeError("glob options required");if(this.withFileTypes=!!c.withFileTypes,this.signal=c.signal,this.follow=!!c.follow,this.dot=!!c.dot,this.dotRelative=!!c.dotRelative,this.nodir=!!c.nodir,this.mark=!!c.mark,c.cwd?(c.cwd instanceof URL||c.cwd.startsWith("file://"))&&(c.cwd=Nar(c.cwd)):this.cwd="",this.cwd=c.cwd||"",this.root=c.root,this.magicalBraces=!!c.magicalBraces,this.nobrace=!!c.nobrace,this.noext=!!c.noext,this.realpath=!!c.realpath,this.absolute=c.absolute,this.includeChildMatches=c.includeChildMatches!==!1,this.noglobstar=!!c.noglobstar,this.matchBase=!!c.matchBase,this.maxDepth=typeof c.maxDepth=="number"?c.maxDepth:1/0,this.stat=!!c.stat,this.ignore=c.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof s=="string"&&(s=[s]),this.windowsPathsNoEscape=!!c.windowsPathsNoEscape||c.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(s=s.map(O=>O.replace(/\\/g,"/"))),this.matchBase){if(c.noglobstar)throw new TypeError("base matching requires globstar");s=s.map(O=>O.includes("/")?O:`./**/${O}`)}if(this.pattern=s,this.platform=c.platform||Iar,this.opts={...c,platform:this.platform},c.scurry){if(this.scurry=c.scurry,c.nocase!==void 0&&c.nocase!==c.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let O=c.platform==="win32"?rB:c.platform==="darwin"?DQ:c.platform?nB:_ft;this.scurry=new O(this.cwd,{nocase:c.nocase,fs:c.fs})}this.nocase=this.scurry.nocase;let f=this.platform==="darwin"||this.platform==="win32",d={...c,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:f,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},v=this.pattern.map(O=>new wS(O,d)),[E,A]=v.reduce((O,R)=>(O[0].push(...R.set),O[1].push(...R.globParts),O),[[],[]]);this.patterns=E.map((O,R)=>{let W=A[R];if(!W)throw new Error("invalid pattern object");return new iB(O,W,0,this.platform)})}async walk(){return[...await new kQ(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new kQ(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new wQ(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new wQ(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var DNe=t((a,s={})=>{Array.isArray(a)||(a=[a]);for(let c of a)if(new wS(c,s).hasMagic())return!0;return!1},"hasMagic");function ffe(a,s={}){return new Dx(a,s).streamSync()}t(ffe,"globStreamSync");function dft(a,s={}){return new Dx(a,s).stream()}t(dft,"globStream");function mft(a,s={}){return new Dx(a,s).walkSync()}t(mft,"globSync");async function pft(a,s={}){return new Dx(a,s).walk()}t(pft,"glob_");function _fe(a,s={}){return new Dx(a,s).iterateSync()}t(_fe,"globIterateSync");function hft(a,s={}){return new Dx(a,s).iterate()}t(hft,"globIterate");var Oar=ffe,Far=Object.assign(dft,{sync:ffe}),Lar=_fe,Rar=Object.assign(hft,{sync:_fe}),Mar=Object.assign(mft,{stream:ffe,iterate:_fe}),PQ=Object.assign(pft,{glob:pft,globSync:mft,sync:Mar,globStream:dft,stream:Far,globStreamSync:ffe,streamSync:Oar,globIterate:hft,iterate:Rar,globIterateSync:_fe,iterateSync:Lar,Glob:Dx,hasMagic:DNe,escape:Yj,unescape:Cx});PQ.glob=PQ;import Bde from"node:fs";import rRe from"node:path";var Av=class extends Error{static{t(this,"CompilationError")}buildMessages;constructor(s){super("An error occurred during compilation."),this.buildMessages=Array.isArray(s)?s:[s]}toBuildResult(){return{content:"",errors:this.buildMessages}}};var jar="[",Bar="]",Uar="{",$ar="}",Jar=":",qar=",",zar="true",Var="false",War="null",Har="NaN",Gar="Infinity",kNe='"',NQ=new Map([[34,kNe],[92,"\\"],[47,"/"],[98,"\b"],[110,`
|
|
576
576
|
`],[102,"\f"],[114,"\r"],[116," "]]),mfe=new Map([...NQ,[118,"\v"],[48,"\0"]]),Qar=new Map([[kNe,kNe],["\\","\\"],["/","/"],["\b","b"],[`
|
|
577
577
|
`,"n"],["\f","f"],["\r","r"],[" ","t"]]),SRr=new Map([...Qar,["\v","v"],["\0","0"],["\u2028","u2028"],["\u2029","u2029"]]),dfe=new Map([[jar,"LBracket"],[Bar,"RBracket"],[Uar,"LBrace"],[$ar,"RBrace"],[Jar,"Colon"],[qar,"Comma"],[zar,"Boolean"],[Var,"Boolean"],[War,"Null"]]),pfe=new Map([...dfe,[Har,"Number"],[Gar,"Number"]]),wNe=new Set([10,13,8232,8233]),l6=class extends Error{static{t(this,"ErrorWithLocation")}constructor(s,{line:c,column:f,offset:d}){super(`${s} (${c}:${f})`),this.line=c,this.column=f,this.offset=d}},PNe=class extends l6{static{t(this,"UnexpectedChar")}constructor(s,c){super(`Unexpected character '${String.fromCharCode(s)}' found.`,c)}},NNe=class extends l6{static{t(this,"UnexpectedIdentifier")}constructor(s,c){super(`Unexpected identifier '${s}' found.`,c)}},KF=class extends l6{static{t(this,"UnexpectedToken")}constructor(s){super(`Unexpected token ${s.type} found.`,s.loc.start)}},hfe=class extends l6{static{t(this,"UnexpectedEOF")}constructor(s){super("Unexpected end of input found.",s)}},Kar=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Yar=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Xar=13,gft=10,INe=class{static{t(this,"CharCodeReader")}#r="";#n=1;#e=0;#t=-1;#s=!1;#p=-1;#a=!1;constructor(s){this.#r=s}#_(){this.#a||(this.#e++,this.#t++,this.#p=-1,this.#a=!0)}locate(){return{line:this.#n,column:this.#e,offset:this.#t}}next(){if(this.#t>=this.#r.length-1)return this.#_(),-1;this.#t++;let s=this.#r.charCodeAt(this.#t);return this.#s?(this.#n++,this.#e=1,this.#s=!1):this.#e++,s===Xar?(this.#s=!0,this.peek()===gft&&this.#t++):s===gft&&(this.#s=!0),this.#p=s,s}peek(){return this.#t===this.#r.length-1?-1:this.#r.charCodeAt(this.#t+1)}match(s){return s(this.peek())?(this.next(),!0):!1}current(){return this.#p}},Zar="Infinity",eor="NaN",tor=new Set([116,102,110]),ONe=new Set([32,9,10,13]),yft=new Set([...ONe,11,12,160,8232,8233,65279,160,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288]),ror={mode:"json",ranges:!1},nor=new Set(["true","false","null"]),H_={EOF:0,Number:1,String:2,Boolean:3,Null:4,NaN:5,Infinity:6,Identifier:7,Colon:20,LBrace:21,RBrace:22,LBracket:23,RBracket:24,Comma:25,LineComment:40,BlockComment:41};function c6(a){return a>=48&&a<=57}t(c6,"isDigit");function ANe(a){return c6(a)||a>=65&&a<=70||a>=97&&a<=102}t(ANe,"isHexDigit");function ior(a){return a>=49&&a<=57}t(ior,"isPositiveDigit");function sor(a){return tor.has(a)}t(sor,"isKeywordStart");function bft(a){return c6(a)||a===46||a===45}t(bft,"isNumberStart");function aor(a){return bft(a)||a===43}t(aor,"isJSON5NumberStart");function vft(a,s){return a===34||s&&a===39}t(vft,"isStringStart");function Sft(a){if(a===36||a===95||a===92||a>=97&&a<=122||a>=65&&a<=90||a===8204||a===8205)return!0;let s=String.fromCharCode(a);return Kar.test(s)}t(Sft,"isJSON5IdentifierStart");function oor(a){if(Sft(a)||c6(a))return!0;let s=String.fromCharCode(a);return Yar.test(s)}t(oor,"isJSON5IdentifierPart");var FNe=class{static{t(this,"Tokenizer")}#r;#n;#e;#t;#s;#p;#a;#_;#c;#l;#i;constructor(s,c){this.#n=s,this.#r={...ror,...c},this.#e=new INe(s),this.#t=this.#r.mode==="json5",this.#s=this.#r.mode!=="json",this.#p=this.#r.ranges,this.#_=this.#t?mfe.has.bind(mfe):NQ.has.bind(NQ),this.#c=this.#t?wNe.has.bind(wNe):()=>!1,this.#l=this.#t?f=>f===120:()=>!1,this.#i=this.#t?yft.has.bind(yft):ONe.has.bind(ONe)}#f(s,c=this.#e.locate()){throw new PNe(s,c)}#v(s,c=this.#e.locate()){throw new NNe(s,c)}#d(){throw new hfe(this.#e.locate())}#u(s,c,f,d){let v=f.offset+c,E=this.#r.ranges?{range:[f.offset,v]}:void 0;return{type:s,loc:{start:f,end:d||{line:f.line,column:f.column+c,offset:v}},...E}}#m(s){let c="",f;for(let d=0;d<s;d++){if(f=this.#e.peek(),ANe(f)){this.#e.next(),c+=String.fromCharCode(f);continue}this.#f(f)}return c}#g(s){let c="";do{if(c+=String.fromCharCode(s),s===92&&(s=this.#e.next(),s!==117&&this.#f(s),c+=String.fromCharCode(s),c+=this.#m(4)),s=this.#e.peek(),!oor(s))break;this.#e.next()}while(!0);return c}#x(s){let c=s,f=1;for(s=this.#e.peek();s!==-1&&s!==c;){if(this.#e.next(),f++,s===92)if(s=this.#e.peek(),this.#_(s)||this.#c(s))this.#e.next(),f++;else if(s===117){this.#e.next(),f++;let d=this.#m(4);f+=d.length}else if(this.#l(s)){this.#e.next(),f++;let d=this.#m(2);f+=d.length}else this.#t?(this.#e.next(),f++):this.#f(s);s=this.#e.peek()}return s===-1&&(this.#e.next(),this.#d()),this.#e.next(),f++,f}#C(s){let c=1;if(s===45||this.#t&&s===43){if(s=this.#e.peek(),this.#t&&(s===73||s===78)){this.#e.next();let f=this.#g(s);return f!==Zar&&f!==eor&&this.#f(s),c+f.length}c6(s)||this.#f(s),this.#e.next(),c++}if(s===48)if(s=this.#e.peek(),this.#t&&(s===120||s===88)){this.#e.next(),c++,s=this.#e.peek(),ANe(s)||(this.#e.next(),this.#f(s));do this.#e.next(),c++,s=this.#e.peek();while(ANe(s))}else c6(s)&&this.#f(s);else if(!this.#t||s!==46)for(ior(s)||this.#f(s),s=this.#e.peek();c6(s);)this.#e.next(),c++,s=this.#e.peek();if(s===46){let f=-1;for(this.#e.next(),c++,f++,s=this.#e.peek();c6(s);)this.#e.next(),c++,f++,s=this.#e.peek();!this.#t&&f===0&&(this.#e.next(),s?this.#f(s):this.#d())}if(s===101||s===69)for(this.#e.next(),c++,s=this.#e.peek(),(s===43||s===45)&&(this.#e.next(),c++,s=this.#e.peek()),s===-1&&(this.#e.next(),this.#d()),c6(s)||(this.#e.next(),this.#f(s));c6(s);)this.#e.next(),c++,s=this.#e.peek();return c}#b(s){let c=1;if(s=this.#e.peek(),s===47){do this.#e.next(),c+=1,s=this.#e.peek();while(s>-1&&s!==13&&s!==10);return{length:c,multiline:!1}}if(s===42){for(this.#e.next(),c+=1;s>-1;)if(s=this.#e.peek(),s===42){if(this.#e.next(),c+=1,s=this.#e.peek(),s===47)return this.#e.next(),c+=1,{length:c,multiline:!0}}else this.#e.next(),c+=1;this.#e.next(),this.#d()}this.#e.next(),this.#f(s)}next(){let s=this.#e.next();for(;this.#i(s);)s=this.#e.next();if(s===-1)return H_.EOF;let c=this.#e.locate(),f=String.fromCharCode(s);if(this.#t)if(pfe.has(f))this.#a=this.#u(pfe.get(f),1,c);else if(Sft(s)){let d=this.#g(s);pfe.has(d)?this.#a=this.#u(pfe.get(d),d.length,c):this.#a=this.#u("Identifier",d.length,c)}else if(aor(s)){let d=this.#C(s);this.#a=this.#u("Number",d,c)}else if(vft(s,this.#t)){let d=this.#x(s),v=this.#e.locate();this.#a=this.#u("String",d,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else if(s===47&&this.#s){let d=this.#b(s),v=this.#e.locate();this.#a=this.#u(d.multiline?"BlockComment":"LineComment",d.length,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else this.#f(s);else if(dfe.has(f))this.#a=this.#u(dfe.get(f),1,c);else if(sor(s)){let d=this.#g(s);nor.has(d)||this.#v(d,c),this.#a=this.#u(dfe.get(d),d.length,c)}else if(bft(s)){let d=this.#C(s);this.#a=this.#u("Number",d,c)}else if(vft(s,this.#t)){let d=this.#x(s);this.#a=this.#u("String",d,c)}else if(s===47&&this.#s){let d=this.#b(s),v=this.#e.locate();this.#a=this.#u(d.multiline?"BlockComment":"LineComment",d.length,c,{line:v.line,column:v.column+1,offset:v.offset+1})}else this.#f(s);return H_[this.#a.type]}get token(){return this.#a}};var gC={document(a,s={}){return{type:"Document",body:a,loc:s.loc,...s}},string(a,s={}){return{type:"String",value:a,loc:s.loc,...s}},number(a,s={}){return{type:"Number",value:a,loc:s.loc,...s}},boolean(a,s={}){return{type:"Boolean",value:a,loc:s.loc,...s}},null(a={}){return{type:"Null",loc:a.loc,...a}},array(a,s={}){return{type:"Array",elements:a,loc:s.loc,...s}},element(a,s={}){return{type:"Element",value:a,loc:s.loc,...s}},object(a,s={}){return{type:"Object",members:a,loc:s.loc,...s}},member(a,s,c={}){return{type:"Member",name:a,value:s,loc:c.loc,...c}},identifier(a,s={}){return{type:"Identifier",name:a,loc:s.loc,...s}},nan(a="",s={}){return{type:"NaN",sign:a,loc:s.loc,...s}},infinity(a="",s={}){return{type:"Infinity",sign:a,loc:s.loc,...s}}},cor={mode:"json",ranges:!1,tokens:!1,allowTrailingCommas:!1};function lor(a,s,c=!1){let f="",d=a.indexOf("\\"),v=0;for(;d>=0;){f+=a.slice(v,d);let E=a.charAt(d+1),A=E.charCodeAt(0);if(c&&mfe.has(A))f+=mfe.get(A),v=d+2;else if(NQ.has(A))f+=NQ.get(A),v=d+2;else if(E==="u"){let O=a.slice(d+2,d+6);if(O.length<4||/[^0-9a-f]/i.test(O))throw new l6(`Invalid unicode escape \\u${O}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});f+=String.fromCharCode(parseInt(O,16)),v=d+6}else if(c&&E==="x"){let O=a.slice(d+2,d+4);if(O.length<2||/[^0-9a-f]/i.test(O))throw new l6(`Invalid hex escape \\x${O}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});f+=String.fromCharCode(parseInt(O,16)),v=d+4}else if(c&&wNe.has(A))v=d+2,E==="\r"&&a.charAt(v)===`
|
|
578
|
-
`&&v++;else if(c)f+=E,v=d+2;else throw new l6(`Invalid escape \\${E}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});d=a.indexOf("\\",v)}return f+=a.slice(v),f}t(lor,"getStringValue");function uor(a,s,c=!1){switch(s.type){case"Boolean":return a==="true";case"Number":return Number(a);case"String":return lor(a.slice(1,-1),s,c);default:throw new TypeError(`Unknown token type "${s.type}.`)}}t(uor,"getLiteralValue");function Tft(a,s){s=Object.freeze({...cor,...s});let c=[],f=new FNe(a,{mode:s.mode,ranges:s.ranges}),d=s.mode==="json5",v=s.allowTrailingCommas||d;function E(){let _r=f.next();return _r&&s.tokens&&c.push(f.token),_r}t(E,"nextNoComments");function A(){let _r=f.next();return _r&&s.tokens&&c.push(f.token),_r>=H_.LineComment?A():_r}t(A,"nextSkipComments");let O=s.mode==="json"?E:A;function R(_r,ir){if(_r!==ir)throw new KF(f.token)}t(R,"assertTokenType");function W(_r,ir){if(!ir.includes(_r))throw new KF(f.token)}t(W,"assertTokenTypes");function $(_r,ir){return s.ranges?{range:[_r.offset,ir.offset]}:void 0}t($,"createRange");function K(_r){let ir=f.token,ts=$(ir.loc.start,ir.loc.end),Fi=uor(a.slice(ir.loc.start.offset,ir.loc.end.offset),ir,d),ai={loc:{start:{...ir.loc.start},end:{...ir.loc.end}},...ts};switch(_r){case H_.String:return gC.string(Fi,ai);case H_.Number:return gC.number(Fi,ai);case H_.Boolean:return gC.boolean(Fi,ai);default:throw new TypeError(`Unknown token type ${ir.type}.`)}}t(K,"createLiteralNode");function Pe(_r){let ir=$(_r.loc.start,_r.loc.end),ts=a.slice(_r.loc.start.offset,_r.loc.end.offset),rs={loc:{start:{..._r.loc.start},end:{..._r.loc.end}},...ir};if(_r.type!=="Identifier"){let ai="";return(ts[0]==="+"||ts[0]==="-")&&(ai=ts[0]),gC[ts.includes("NaN")?"nan":"infinity"](ai,rs)}return gC.identifier(ts,rs)}t(Pe,"createJSON5IdentifierNode");function De(_r){let ir=$(_r.loc.start,_r.loc.end);return gC.null({loc:{start:{..._r.loc.start},end:{..._r.loc.end}},...ir})}t(De,"createNullNode");function Se(_r){d?W(_r,[H_.String,H_.Identifier,H_.Number]):R(_r,H_.String);let ir=f.token,ts=_r===H_.String?K(_r):Pe(ir);if(d&&(ts.type==="NaN"||ts.type==="Infinity")){if(ts.sign!=="")throw new KF(f.token);ts=gC.identifier(ts.type,{loc:ts.loc,...$(ts.loc.start,ts.loc.end)})}_r=O(),R(_r,H_.Colon);let Fi=hr(),rs=$(ts.loc.start,Fi.loc.end);return gC.member(ts,Fi,{loc:{start:{...ts.loc.start},end:{...Fi.loc.end}},...rs})}t(Se,"parseProperty");function Ct(_r){R(_r,H_.LBrace);let ir=f.token,ts=[],Fi=O();if(Fi!==H_.RBrace)do{if(ts.push(Se(Fi)),Fi=O(),!Fi)throw new hfe(ts[ts.length-1].loc.end);if(Fi===H_.Comma){if(Fi=O(),v&&Fi===H_.RBrace)break}else break}while(Fi);R(Fi,H_.RBrace);let rs=f.token,ai=$(ir.loc.start,rs.loc.end);return gC.object(ts,{loc:{start:{...ir.loc.start},end:{...rs.loc.end}},...ai})}t(Ct,"parseObject");function bt(_r){R(_r,H_.LBracket);let ir=f.token,ts=[],Fi=O();if(Fi!==H_.RBracket)do{let _o=hr(Fi);if(ts.push(gC.element(_o,{loc:_o.loc})),Fi=O(),Fi===H_.Comma){if(Fi=O(),v&&Fi===H_.RBracket)break}else break}while(Fi);R(Fi,H_.RBracket);let rs=f.token,ai=$(ir.loc.start,rs.loc.end);return gC.array(ts,{loc:{start:{...ir.loc.start},end:{...rs.loc.end}},...ai})}t(bt,"parseArray");function hr(_r){_r=_r??O();let ir=f.token;switch(_r){case H_.String:case H_.Boolean:return K(_r);case H_.Number:if(d){let ts=a.slice(ir.loc.start.offset,ir.loc.end.offset);if((ts[0]==="+"||ts[0]==="-")&&(ts=ts.slice(1)),ts==="NaN"||ts==="Infinity")return Pe(ir)}return K(_r);case H_.Null:return De(ir);case H_.LBrace:return Ct(_r);case H_.LBracket:return bt(_r);default:throw new KF(ir)}}t(hr,"parseValue");let Pr=hr();if(O())throw new KF(f.token);let dr={loc:{start:{line:1,column:1,offset:0},end:{...Pr.loc.end}}};return s.tokens&&(dr.tokens=c),s.ranges&&(dr.range=[dr.loc.start.offset,dr.loc.end.offset]),gC.document(Pr,dr)}t(Tft,"parse");var _or=new Map([["Document",["body"]],["Object",["members"]],["Member",["name","value"]],["Element",["value"]],["Array",["elements"]],["String",[]],["Number",[]],["Boolean",[]],["Null",[]],["NaN",[]],["Infinity",[]],["Identifier",[]]]);function Cft(a){return a&&typeof a=="object"}t(Cft,"isObject");function por(a){return Cft(a)&&typeof a.type=="string"}t(por,"isNode");function dor(a,s){function c(f,d){typeof s.enter=="function"&&s.enter(f,d);for(let v of _or.get(f.type)){let E=f[v];Cft(E)&&(Array.isArray(E)?E.forEach(A=>c(A,f)):por(E)&&c(E,f))}typeof s.exit=="function"&&s.exit(f,d)}t(c,"visitNode"),c(a)}t(dor,"traverse");function Eft(a,s=()=>!0){let c=[];return dor(a,{enter(f,d){c.push({node:f,parent:d,phase:"enter"})},exit(f,d){c.push({node:f,parent:d,phase:"exit"})}}),c.filter(s).values()}t(Eft,"iterator");import mor from"node:fs/promises";var IQ=t((a,s)=>a.split(/\r?\n/)[s-1],"getFileLineContent"),gfe=t(async a=>{try{return await mor.readFile(a,"utf-8")}catch{return}},"getSchemaContent"),OQ=t(async a=>{try{return Tft(a)}catch(s){if(s.column&&s.line&&s.message){let c=IQ(a,s.line);return{column:s.column,line:s.line,length:void 0,lineText:c}}return}},"getSchemaAST");var xft=t(async(a,s,c)=>{try{if(a.length===0)return;for(let f of a){let d=await gfe(f),v=await hor(d,f,s,c);if(v)return v}}catch{}},"getRouteLocationByValue"),hor=t(async(a,s,c,f)=>{try{if(!a)return;let d=null,v=await OQ(a);if(v){for(let{node:E}of Eft(v))if(E.value&&E.value===c){d=E.loc;break}if(d!==null){let E=IQ(a,d.start.line);return{file:s,line:d.start.line,column:d.start.column,length:d.end.column-d.start.column,lineText:E,suggestion:f}}}}catch{}},"getRouteLocationByValueFromSchema");import Dft from"node:fs/promises";import rk from"node:path";var LNe="schemas",RNe=".oas.json";var YF=t(async a=>(await Dft.readdir(a)).map(c=>`${a}/${c}`).filter(c=>c.endsWith(RNe)).sort(),"getOpenApiFilesByAlphabetical"),aB=t(async a=>{let s=rk.resolve(a,"config");return(await Dft.readdir(s)).filter(f=>f.endsWith(RNe)).length>=1},"oasFileInProject");function FQ(a,s,c,f,d,v,E){if(v.has(c))return;let A;try{A=f.get(c)}catch(De){throw new Ev({text:`Failed to resolve reference: ${c}`,detail:De.message,severity:"error",message:"Failed to resolve reference",location:{file:a,column:0,line:0,length:0,lineText:c,namespace:s,suggestion:"Check the reference and try again."}})}let O=vfe(c),R=rk.basename(O,rk.extname(O)),W=c.indexOf("#"),$=W>=0?c.substring(0,W):c,K=W>=0?c.substring(W+1):"",Pe=f.get($);if(K){let De=K.split("/").filter(Boolean);for(let Se of De)if(Pe=Pe[Se],Pe===void 0)throw new Error(`Cannot resolve JSON pointer: ${K}`)}if(Pe&&typeof Pe=="object"&&"$ref"in Pe){let De=rk.resolve(rk.dirname($),Pe.$ref);O=De,R=rk.basename(O,rk.extname(O)),$=De,v.set($,d.length),d.push($),yfe(O,R,A,f,d,v,E)}else v.set(c,d.length),d.push(c),yfe(vfe(c),s,A,f,d,v,E)}t(FQ,"chaseRefs");function yfe(a,s,c,f,d,v,E){if(Array.isArray(c))for(let A of c)yfe(a,s,A,f,d,v,E);else if(typeof c=="object")for(let A in c){if(A==="$ref"){let O=c[A];E&&(c[A]=E(s,O)),FQ(a,s,EN(a,O),f,d,v,E)}yfe(a,s,c[A],f,d,v,E)}}t(yfe,"lookForRefs");function EN(a,s){let c=s.indexOf("#");return c>=0?`${rk.resolve(a,s.substring(0,c))}${s.substring(c)}`:rk.resolve(rk.dirname(a),s)}t(EN,"getFullyQualifiedRefName");function vfe(a){let s=a.indexOf("#");return s>=0?a.substring(0,s):a}t(vfe,"getFilePathNameFromRefName");var YQ=W_(YIe(),1);var ZIe={};Alt(ZIe,{UnsafePathError:()=>Wfe,deleteFolder:()=>p_r,dirExists:()=>XIe,fileExists:()=>n_r,getParentDirFilename:()=>u_r,isNotFileOrDirectory:()=>s_r,listFolderContents:()=>edt,listFolders:()=>o_r,mkDirTemp:()=>i_r,mkdirForFilePathIfNotExits:()=>c_r,mkdirIfNotExists:()=>tdt,safePath:()=>l_r,tarFolder:()=>f_r,untarFile:()=>__r});import{spawn as Xpt}from"node:child_process";import{randomUUID as e_r}from"node:crypto";import IN from"node:fs/promises";import{platform as t_r,tmpdir as r_r}from"node:os";import NN from"node:path";var Zpt=[".git","node_modules",".yarn",".DS_Store"];async function n_r(a){try{return(await IN.stat(a)).isFile()}catch{return!1}}t(n_r,"fileExists");async function i_r(){let a=process.env.BUILD_FILE_PATH??r_r(),s=e_r().replaceAll("-",""),c=NN.join(a,s);return await IN.mkdir(c,{recursive:!0}),c}t(i_r,"mkDirTemp");async function XIe(a){try{return(await IN.stat(a)).isDirectory()}catch{return!1}}t(XIe,"dirExists");async function s_r(a){try{return await IN.stat(a),!1}catch{return!0}}t(s_r,"isNotFileOrDirectory");function a_r(a,s){let c=new RegExp(`(.*)(\\/${s})$|(.*)(${s}\\/)`),f=a.match(c);if(!f)return"";let d=a.split(f[0]);return d[1]===""?"":`/${d[1]}`}t(a_r,"getParentDirectory");async function o_r(a){if(!await XIe(a))return[];let s=await IN.readdir(a,{withFileTypes:!0}),c=[];for await(let f of s)Zpt.includes(f.name)||f.isDirectory()&&c.push(f.name);return c}t(o_r,"listFolders");async function edt(a,s,c=!0){let f=a_r(a,s),d=await IN.readdir(a,{withFileTypes:!0}),v=[];for await(let E of d)if(!Zpt.includes(E.name)||!c)if(E.isDirectory()){let A=await edt(NN.join(a,E.name),s,c);v.push(...A)}else v.push(NN.join(f,E.name));return v}t(edt,"listFolderContents");var tdt=t(async a=>{await IN.mkdir(a,{recursive:!0})},"mkdirIfNotExists"),c_r=t(async a=>{let s=NN.dirname(a);return tdt(s)},"mkdirForFilePathIfNotExits"),Wfe=class extends Error{static{t(this,"UnsafePathError")}constructor(s){super(s)}};function l_r(a){let s=t(c=>{if(!c.startsWith(a))throw new Wfe("Resolved path is not part of the project.");return c},"ensureSafePath");return{resolve:t((...c)=>s(NN.resolve(...c)),"resolve")}}t(l_r,"safePath");function u_r(a){return`${NN.basename(NN.dirname(a))}/${NN.basename(a)}`}t(u_r,"getParentDirFilename");async function f_r({folderPath:a,outputTarPath:s,exclude:c=["node_modules",".git","dist"],logger:f}){let d=[],v=[],E;try{await new Promise((A,O)=>{let R=Xpt("tar",[...c.map(W=>["--exclude",W]).flat(),...t_r()!=="darwin"?["--warning=no-file-changed"]:[],"-cvf",s,"-C",a,"."]);R.stdout.on("data",W=>{let $=W.toString().trim();$.length>0&&d.push($.trim())}),R.stderr.on("data",W=>{let $=W.toString().trim();$.length>0&&v.push($.trim())}),R.on("close",W=>{E=W,W===0?A():O(new Error(`tar process exited with code ${W}`))}),R.on("error",W=>{O(W)})})}catch(A){throw new Error("Failed to tar folder",{cause:A})}finally{f.info({stdout:d.join(`
|
|
578
|
+
`&&v++;else if(c)f+=E,v=d+2;else throw new l6(`Invalid escape \\${E}.`,{line:s.loc.start.line,column:s.loc.start.column+d,offset:s.loc.start.offset+d});d=a.indexOf("\\",v)}return f+=a.slice(v),f}t(lor,"getStringValue");function uor(a,s,c=!1){switch(s.type){case"Boolean":return a==="true";case"Number":return Number(a);case"String":return lor(a.slice(1,-1),s,c);default:throw new TypeError(`Unknown token type "${s.type}.`)}}t(uor,"getLiteralValue");function Tft(a,s){s=Object.freeze({...cor,...s});let c=[],f=new FNe(a,{mode:s.mode,ranges:s.ranges}),d=s.mode==="json5",v=s.allowTrailingCommas||d;function E(){let _r=f.next();return _r&&s.tokens&&c.push(f.token),_r}t(E,"nextNoComments");function A(){let _r=f.next();return _r&&s.tokens&&c.push(f.token),_r>=H_.LineComment?A():_r}t(A,"nextSkipComments");let O=s.mode==="json"?E:A;function R(_r,ir){if(_r!==ir)throw new KF(f.token)}t(R,"assertTokenType");function W(_r,ir){if(!ir.includes(_r))throw new KF(f.token)}t(W,"assertTokenTypes");function $(_r,ir){return s.ranges?{range:[_r.offset,ir.offset]}:void 0}t($,"createRange");function K(_r){let ir=f.token,ts=$(ir.loc.start,ir.loc.end),Fi=uor(a.slice(ir.loc.start.offset,ir.loc.end.offset),ir,d),ai={loc:{start:{...ir.loc.start},end:{...ir.loc.end}},...ts};switch(_r){case H_.String:return gC.string(Fi,ai);case H_.Number:return gC.number(Fi,ai);case H_.Boolean:return gC.boolean(Fi,ai);default:throw new TypeError(`Unknown token type ${ir.type}.`)}}t(K,"createLiteralNode");function Pe(_r){let ir=$(_r.loc.start,_r.loc.end),ts=a.slice(_r.loc.start.offset,_r.loc.end.offset),rs={loc:{start:{..._r.loc.start},end:{..._r.loc.end}},...ir};if(_r.type!=="Identifier"){let ai="";return(ts[0]==="+"||ts[0]==="-")&&(ai=ts[0]),gC[ts.includes("NaN")?"nan":"infinity"](ai,rs)}return gC.identifier(ts,rs)}t(Pe,"createJSON5IdentifierNode");function De(_r){let ir=$(_r.loc.start,_r.loc.end);return gC.null({loc:{start:{..._r.loc.start},end:{..._r.loc.end}},...ir})}t(De,"createNullNode");function Se(_r){d?W(_r,[H_.String,H_.Identifier,H_.Number]):R(_r,H_.String);let ir=f.token,ts=_r===H_.String?K(_r):Pe(ir);if(d&&(ts.type==="NaN"||ts.type==="Infinity")){if(ts.sign!=="")throw new KF(f.token);ts=gC.identifier(ts.type,{loc:ts.loc,...$(ts.loc.start,ts.loc.end)})}_r=O(),R(_r,H_.Colon);let Fi=hr(),rs=$(ts.loc.start,Fi.loc.end);return gC.member(ts,Fi,{loc:{start:{...ts.loc.start},end:{...Fi.loc.end}},...rs})}t(Se,"parseProperty");function Ct(_r){R(_r,H_.LBrace);let ir=f.token,ts=[],Fi=O();if(Fi!==H_.RBrace)do{if(ts.push(Se(Fi)),Fi=O(),!Fi)throw new hfe(ts[ts.length-1].loc.end);if(Fi===H_.Comma){if(Fi=O(),v&&Fi===H_.RBrace)break}else break}while(Fi);R(Fi,H_.RBrace);let rs=f.token,ai=$(ir.loc.start,rs.loc.end);return gC.object(ts,{loc:{start:{...ir.loc.start},end:{...rs.loc.end}},...ai})}t(Ct,"parseObject");function bt(_r){R(_r,H_.LBracket);let ir=f.token,ts=[],Fi=O();if(Fi!==H_.RBracket)do{let _o=hr(Fi);if(ts.push(gC.element(_o,{loc:_o.loc})),Fi=O(),Fi===H_.Comma){if(Fi=O(),v&&Fi===H_.RBracket)break}else break}while(Fi);R(Fi,H_.RBracket);let rs=f.token,ai=$(ir.loc.start,rs.loc.end);return gC.array(ts,{loc:{start:{...ir.loc.start},end:{...rs.loc.end}},...ai})}t(bt,"parseArray");function hr(_r){_r=_r??O();let ir=f.token;switch(_r){case H_.String:case H_.Boolean:return K(_r);case H_.Number:if(d){let ts=a.slice(ir.loc.start.offset,ir.loc.end.offset);if((ts[0]==="+"||ts[0]==="-")&&(ts=ts.slice(1)),ts==="NaN"||ts==="Infinity")return Pe(ir)}return K(_r);case H_.Null:return De(ir);case H_.LBrace:return Ct(_r);case H_.LBracket:return bt(_r);default:throw new KF(ir)}}t(hr,"parseValue");let Pr=hr();if(O())throw new KF(f.token);let dr={loc:{start:{line:1,column:1,offset:0},end:{...Pr.loc.end}}};return s.tokens&&(dr.tokens=c),s.ranges&&(dr.range=[dr.loc.start.offset,dr.loc.end.offset]),gC.document(Pr,dr)}t(Tft,"parse");var _or=new Map([["Document",["body"]],["Object",["members"]],["Member",["name","value"]],["Element",["value"]],["Array",["elements"]],["String",[]],["Number",[]],["Boolean",[]],["Null",[]],["NaN",[]],["Infinity",[]],["Identifier",[]]]);function Cft(a){return a&&typeof a=="object"}t(Cft,"isObject");function por(a){return Cft(a)&&typeof a.type=="string"}t(por,"isNode");function dor(a,s){function c(f,d){typeof s.enter=="function"&&s.enter(f,d);for(let v of _or.get(f.type)){let E=f[v];Cft(E)&&(Array.isArray(E)?E.forEach(A=>c(A,f)):por(E)&&c(E,f))}typeof s.exit=="function"&&s.exit(f,d)}t(c,"visitNode"),c(a)}t(dor,"traverse");function Eft(a,s=()=>!0){let c=[];return dor(a,{enter(f,d){c.push({node:f,parent:d,phase:"enter"})},exit(f,d){c.push({node:f,parent:d,phase:"exit"})}}),c.filter(s).values()}t(Eft,"iterator");import mor from"node:fs/promises";var IQ=t((a,s)=>a.split(/\r?\n/)[s-1],"getFileLineContent"),gfe=t(async a=>{try{return await mor.readFile(a,"utf-8")}catch{return}},"getSchemaContent"),OQ=t(async a=>{try{return Tft(a)}catch(s){if(s.column&&s.line&&s.message){let c=IQ(a,s.line);return{column:s.column,line:s.line,length:void 0,lineText:c}}return}},"getSchemaAST");var xft=t(async(a,s,c)=>{try{if(a.length===0)return;for(let f of a){let d=await gfe(f),v=await hor(d,f,s,c);if(v)return v}}catch{}},"getRouteLocationByValue"),hor=t(async(a,s,c,f)=>{try{if(!a)return;let d=null,v=await OQ(a);if(v){for(let{node:E}of Eft(v))if(E.value&&E.value===c){d=E.loc;break}if(d!==null){let E=IQ(a,d.start.line);return{file:s,line:d.start.line,column:d.start.column,length:d.end.column-d.start.column,lineText:E,suggestion:f}}}}catch{}},"getRouteLocationByValueFromSchema");import Dft from"node:fs/promises";import rk from"node:path";var LNe="schemas",RNe=".oas.json";var YF=t(async a=>(await Dft.readdir(a)).map(c=>`${a}/${c}`).filter(c=>c.endsWith(RNe)).sort(),"getOpenApiFilesByAlphabetical"),aB=t(async a=>{let s=rk.resolve(a,"config");return(await Dft.readdir(s)).filter(f=>f.endsWith(RNe)).length>=1},"oasFileInProject");function FQ(a,s,c,f,d,v,E){if(v.has(c))return;let A;try{A=f.get(c)}catch(De){throw new Ev({text:`Failed to resolve reference: ${c}`,detail:De.message,severity:"error",message:"Failed to resolve reference",location:{file:a,column:0,line:0,length:0,lineText:c,namespace:s,suggestion:"Check the reference and try again."}})}let O=vfe(c),R=rk.basename(O,rk.extname(O)),W=c.indexOf("#"),$=W>=0?c.substring(0,W):c,K=W>=0?c.substring(W+1):"",Pe=f.get($);if(K){let De=K.split("/").filter(Boolean);for(let Se of De)if(Pe=Pe[Se],Pe===void 0)throw new Error(`Cannot resolve JSON pointer: ${K}`)}if(Pe&&typeof Pe=="object"&&"$ref"in Pe&&typeof Pe.$ref=="string"&&!Pe.$ref.startsWith("#")){let De=rk.resolve(rk.dirname($),Pe.$ref);O=De,R=rk.basename(O,rk.extname(O)),$=De,v.set($,d.length),d.push($),yfe(O,R,A,f,d,v,E)}else v.set(c,d.length),d.push(c),yfe(vfe(c),s,A,f,d,v,E)}t(FQ,"chaseRefs");function yfe(a,s,c,f,d,v,E){if(Array.isArray(c))for(let A of c)yfe(a,s,A,f,d,v,E);else if(typeof c=="object")for(let A in c){if(A==="$ref"){let O=c[A];E&&(c[A]=E(s,O)),FQ(a,s,EN(a,O),f,d,v,E)}yfe(a,s,c[A],f,d,v,E)}}t(yfe,"lookForRefs");function EN(a,s){let c=s.indexOf("#");return c>=0?`${rk.resolve(a,s.substring(0,c))}${s.substring(c)}`:rk.resolve(rk.dirname(a),s)}t(EN,"getFullyQualifiedRefName");function vfe(a){let s=a.indexOf("#");return s>=0?a.substring(0,s):a}t(vfe,"getFilePathNameFromRefName");var YQ=W_(YIe(),1);var ZIe={};Alt(ZIe,{UnsafePathError:()=>Wfe,deleteFolder:()=>p_r,dirExists:()=>XIe,fileExists:()=>n_r,getParentDirFilename:()=>u_r,isNotFileOrDirectory:()=>s_r,listFolderContents:()=>edt,listFolders:()=>o_r,mkDirTemp:()=>i_r,mkdirForFilePathIfNotExits:()=>c_r,mkdirIfNotExists:()=>tdt,safePath:()=>l_r,tarFolder:()=>f_r,untarFile:()=>__r});import{spawn as Xpt}from"node:child_process";import{randomUUID as e_r}from"node:crypto";import IN from"node:fs/promises";import{platform as t_r,tmpdir as r_r}from"node:os";import NN from"node:path";var Zpt=[".git","node_modules",".yarn",".DS_Store"];async function n_r(a){try{return(await IN.stat(a)).isFile()}catch{return!1}}t(n_r,"fileExists");async function i_r(){let a=process.env.BUILD_FILE_PATH??r_r(),s=e_r().replaceAll("-",""),c=NN.join(a,s);return await IN.mkdir(c,{recursive:!0}),c}t(i_r,"mkDirTemp");async function XIe(a){try{return(await IN.stat(a)).isDirectory()}catch{return!1}}t(XIe,"dirExists");async function s_r(a){try{return await IN.stat(a),!1}catch{return!0}}t(s_r,"isNotFileOrDirectory");function a_r(a,s){let c=new RegExp(`(.*)(\\/${s})$|(.*)(${s}\\/)`),f=a.match(c);if(!f)return"";let d=a.split(f[0]);return d[1]===""?"":`/${d[1]}`}t(a_r,"getParentDirectory");async function o_r(a){if(!await XIe(a))return[];let s=await IN.readdir(a,{withFileTypes:!0}),c=[];for await(let f of s)Zpt.includes(f.name)||f.isDirectory()&&c.push(f.name);return c}t(o_r,"listFolders");async function edt(a,s,c=!0){let f=a_r(a,s),d=await IN.readdir(a,{withFileTypes:!0}),v=[];for await(let E of d)if(!Zpt.includes(E.name)||!c)if(E.isDirectory()){let A=await edt(NN.join(a,E.name),s,c);v.push(...A)}else v.push(NN.join(f,E.name));return v}t(edt,"listFolderContents");var tdt=t(async a=>{await IN.mkdir(a,{recursive:!0})},"mkdirIfNotExists"),c_r=t(async a=>{let s=NN.dirname(a);return tdt(s)},"mkdirForFilePathIfNotExits"),Wfe=class extends Error{static{t(this,"UnsafePathError")}constructor(s){super(s)}};function l_r(a){let s=t(c=>{if(!c.startsWith(a))throw new Wfe("Resolved path is not part of the project.");return c},"ensureSafePath");return{resolve:t((...c)=>s(NN.resolve(...c)),"resolve")}}t(l_r,"safePath");function u_r(a){return`${NN.basename(NN.dirname(a))}/${NN.basename(a)}`}t(u_r,"getParentDirFilename");async function f_r({folderPath:a,outputTarPath:s,exclude:c=["node_modules",".git","dist"],logger:f}){let d=[],v=[],E;try{await new Promise((A,O)=>{let R=Xpt("tar",[...c.map(W=>["--exclude",W]).flat(),...t_r()!=="darwin"?["--warning=no-file-changed"]:[],"-cvf",s,"-C",a,"."]);R.stdout.on("data",W=>{let $=W.toString().trim();$.length>0&&d.push($.trim())}),R.stderr.on("data",W=>{let $=W.toString().trim();$.length>0&&v.push($.trim())}),R.on("close",W=>{E=W,W===0?A():O(new Error(`tar process exited with code ${W}`))}),R.on("error",W=>{O(W)})})}catch(A){throw new Error("Failed to tar folder",{cause:A})}finally{f.info({stdout:d.join(`
|
|
579
579
|
`),stderr:v.join(`
|
|
580
580
|
`),exitCode:E},"Tar process logs")}}t(f_r,"tarFolder");async function __r({tarFilePath:a,outputDir:s,logger:c}){let f=[],d=[],v;try{await new Promise((E,A)=>{let O=Xpt("sh",["-c",`tar -xvf ${a} -C ${s};`]);O.stdout.on("data",R=>{let W=R.toString().trim();W.length>0&&f.push(W.trim())}),O.stderr.on("data",R=>{let W=R.toString().trim();W.length>0&&d.push(W.trim())}),O.on("close",R=>{v=R,R===0?E():A(new Error(`tar process exited with code ${R}`))}),O.on("error",R=>{A(R)})})}catch(E){throw new Error("Failed to untar file",{cause:E})}finally{c.info({stdout:f.join(`
|
|
581
581
|
`),stderr:d.join(`
|
|
@@ -676,7 +676,7 @@ export default {
|
|
|
676
676
|
return handler.requestHandler(request, env, ctx)
|
|
677
677
|
},
|
|
678
678
|
};
|
|
679
|
-
`,UCt=t(async function({systemDirectory:a,logger:s}){return af.timeFn("Generating Worker shim",async()=>{s.debug("Generating Worker shim");let c=p4r.join(a,Vue);try{await _4r.writeFile(c,d4r,"utf-8")}catch(f){s.error(f);let d={message:`Error creating file at ${c}`,pluginName:"generate-worker-entry",severity:"error"};return{warnings:[],errors:[d]}}return{warnings:[],errors:[]}})},"generateWorker");import{readFile as m4r,readdir as h4r}from"node:fs/promises";import $Ct from"node:path";var Jde="validate-open-api-files",JCt=t(async function({sourceDirectory:a,logger:s}){return af.timeFn("
|
|
679
|
+
`,UCt=t(async function({systemDirectory:a,logger:s}){return af.timeFn("Generating Worker shim",async()=>{s.debug("Generating Worker shim");let c=p4r.join(a,Vue);try{await _4r.writeFile(c,d4r,"utf-8")}catch(f){s.error(f);let d={message:`Error creating file at ${c}`,pluginName:"generate-worker-entry",severity:"error"};return{warnings:[],errors:[d]}}return{warnings:[],errors:[]}})},"generateWorker");import{readFile as m4r,readdir as h4r}from"node:fs/promises";import $Ct from"node:path";var Jde="validate-open-api-files",JCt=t(async function({sourceDirectory:a,logger:s}){return af.timeFn("Validating OpenAPI files",async()=>{s.debug("Validating OpenAPI files");let c=$Ct.join(a,Vb),f=[];try{if(!await aB(a))return new BC({message:"Failed to build project because no open-api file was found on the 'config' folder",pluginName:Jde,severity:"error"});let E=(await h4r(c)).filter(O=>O.endsWith(".oas.json")),A=t(async O=>{let R=$Ct.join(c,O);try{O==="zp.oas.json"&&f.push({message:"Open API files cannot be named 'zp.oas.json' since 'zp' is a reserved prefix. Update the file name to solve this build issue.",pluginName:Jde,severity:"error"});let W=await m4r(R,"utf-8"),$=JSON.parse(W);if($&&$.paths){let K=Object.entries($.paths).filter(Pe=>Pe[0]==="zp"||Pe[0]==="/zp");if(K.length>0){let Pe=K.length===1?"includes one route path":`includes '${K.length}' routes`;f.push({message:`Open API file '${O}' ${Pe} that's named '/zp' which is a reserved route name. Updating the route to something other than '/zp' will solve this build issue.`,pluginName:Jde,severity:"error"})}}}catch(W){s.error(W)}},"validateOpenApiFile");await Promise.all(E.map(A))}catch(d){return s.error(d),f.length>0?{errors:f,warnings:[]}:new BC({message:"Failed while validating the open api files in the project",pluginName:Jde,severity:"warning"})}return{errors:f,warnings:[]}})},"validateOpenAPIFiles");var qU=W_(yRe(),1);import{parse as R4r}from"jsonc-parser";import{readFile as M4r,writeFile as cEt}from"node:fs/promises";import j4r from"node:path";var JU=W_(yRe(),1);var oEt=t(()=>({include:["modules/**/*",".zuplo/**/*","tests/**/*"],exclude:["./node_modules","./dist"],compilerOptions:{module:JU.ModuleKind.ESNext,target:JU.ScriptTarget.ES2022,moduleResolution:JU.ModuleResolutionKind.Bundler,lib:["ESNext","WebWorker","Webworker.Iterable"],preserveConstEnums:!0,useUnknownInCatchVariables:!1,forceConsistentCasingInFileNames:!0,importHelpers:!0,esModuleInterop:!0,strictNullChecks:!0,noEmit:!0}}),"getZuploTsConfigTemplate");var i5="validate-tsconfig",lEt=t(async function({sourceDirectory:a,logger:s,command:c,environmentType:f}){return af.timeFn("Validate TSConfig",async()=>{s.debug("Validate TSConfig");let d=f==="WORKING_COPY"||c==="dev";try{let v=oEt(),E=j4r.join(a,"tsconfig.json");if(!await Bu.fileExists(E))return d?(await cEt(E,JSON.stringify(v,null,2)),{warnings:[{message:"This project does not have a tsconfig.json file. The file has been created for you.",severity:"warning",pluginName:i5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}],errors:[]}):{warnings:[],errors:[{message:"This project does not have a tsconfig.json file.",severity:"error",pluginName:i5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}]};let A=await M4r(E,"utf-8"),O=R4r(A);if(!(O&&typeof O=="object"&&"compilerOptions"in O))return d?(await cEt(E,JSON.stringify(v,null,2)),{warnings:[{message:"This project's tsconfig.json file was invalid. A valid file has been written for you.",severity:"warning",pluginName:i5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}],errors:[]}):{warnings:[],errors:[{message:"This project's tsconfig.json file is invalid. It must have a compilerOptions.",severity:"error",pluginName:i5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}]};let R=qU.default.convertCompilerOptionsFromJson(O.compilerOptions,a);if(R.errors.length>0)return{warnings:[],errors:R.errors.map(dr=>({severity:"error",pluginName:i5,message:dr.messageText.toString(),detail:"You will need to modify your tsconfig.json file to build this project.",helpUrl:"https://zuplo.com/docs/articles/tsconfig",location:dr.file?{line:dr.file.getLineStarts()[0],length:dr.file.getWidth(),file:dr.file.fileName,column:dr.file.getStart(),lineText:"",namespace:"",suggestion:""}:void 0}))};if(!O||typeof O!="object")throw new TypeError("The userConfigRaw is not an object, this should not happen.");if(!("compilerOptions"in O)||O.compilerOptions===null||O.compilerOptions===void 0||typeof O.compilerOptions!="object")throw new TypeError("The userConfigRaw.compilerOptions property is not an object, this should not happen.");let W=t((dr,_r,ir)=>`The compiler option '${dr}' should ${_r===void 0?"not be set":`be set to '${typeof _r=="string"?_r:JSON.stringify(_r)}'`}, it was ${ir===void 0?"not set":`set to '${typeof ir=="string"?ir:JSON.stringify(ir)}'`}`,"getMessage"),$="ESNext",K=qU.ModuleKind.ESNext,Pe=[];R.options.module!==K&&Pe.push(W("module",$,O.compilerOptions.module));let De="ES2022",Se=qU.default.ScriptTarget.ES2022;R.options.target!==Se&&Pe.push(W("target",De,O.compilerOptions.target));let Ct="Bundler",bt=qU.default.ModuleResolutionKind.Bundler;R.options.moduleResolution!==bt&&Pe.push(W("moduleResolution",Ct,O.compilerOptions.moduleResolution));let hr=["ESNext","WebWorker","Webworker.Iterable"];t(dr=>{let _r=hr.map(ts=>ts.toLowerCase()),ir=dr.map(ts=>ts.toLowerCase());return _r.every(ts=>ir.includes(ts))},"includesAllLibs")(O.compilerOptions.lib??[])||Pe.push(W("lib",hr,O.compilerOptions.lib)),R.options.baseUrl&&Pe.push(W("baseUrl",void 0,O.compilerOptions.baseUrl));let jr=[];return Pe.length>0&&jr.push({message:"This project's tsconfig.json was not set to the recommended settings. Custom settings may cause build issues. For guidance on how to adjust your settings, please visit: https://zuplo.com/docs/articles/tsconfig",severity:"warning",detail:Pe.join(`
|
|
680
680
|
`),pluginName:i5,helpUrl:"https://zuplo.com/docs/articles/tsconfig"}),{warnings:jr,errors:[]}}catch(v){s.error(v);let E={message:`Error validating tsconfig.json : ${v.message}`,severity:"error",pluginName:i5};return{warnings:[],errors:[E]}}})},"validateTSConfig");var zU;try{let a=B4r(XY.resolve(U4r($4r(import.meta.url)),"../../package.json"),"utf-8");zU=JSON.parse(a).version}catch{zU="0.0.0"}function J4r(a){let{ZUPLO:s,ZUPLO_BUILD_ID:c,ZUPLO_BUILD_CONFIG:f}=process.env;if(s&&c&&f){let d;try{d=JSON.parse(f)}catch{throw new Error("Couuld not parse ZUPLO_BUILD_CONFIG")}let v={ZUPLO_PROJECT_ID:d.projectId,ZUPLO_ACCOUNT_NAME:d.accountName,ZUPLO_PROJECT_NAME:d.projectName,ZUPLO_ENVIRONMENT_TYPE:d.environmentType};for(let[E,A]of Object.entries(process.env))E.startsWith("ZUPLO_PUBLIC_")&&(v[E]=A??"");return{...a,buildId:c,...d,publicZuploEnvironmentVariables:v}}return a}t(J4r,"getBuildConfig");async function vRe(a){let s=performance.now(),{buildId:c,sourceDirectory:f,deploymentName:d=XY.basename(f),command:v,minify:E,entitlements:A,environmentType:O,logger:R,output:W,noCompile:$=!1,projectId:K,deploymentUrl:Pe,publicZuploEnvironmentVariables:De}=J4r(a),Se=await $de(f),Ct=XY.join(f,WF),bt;if("errors"in Se)nRe({output:W.child("api"),buildId:c,runtimeVersion:zU}),bt={status:"Failed",flags:void 0,compatibilityDate:void 0,runtimeVersion:zU,outputPath:Ct,buildTime:new Date().toISOString(),buildTimeMs:0,buildId:c,warnings:[],errors:Se.errors,metafile:void 0};else{$||nRe({output:W.child("api"),buildId:c,runtimeVersion:zU,compatibilityDate:Se.config.compatibilityDate});let jr={command:v,minify:E,deploymentName:d,sourceDirectory:f,outputDirectory:Ct,systemDirectory:XY.join(f,bN),cacheDirectory:XY.join(f,"node_modules",bN),buildId:c,logger:R,output:W,config:Se.config,publicZuploEnvironmentVariables:De,projectId:K,entitlements:A,environmentType:O,deploymentUrl:Pe},dr=[];dr.push(FCt),dr.push(RCt),dr.push(MCt),dr.push(BCt),dr.push(lEt),dr.push(JCt),dr.push(UCt),$||dr.push(xCt),dr.push(OCt);let _r=await PCt(dr,jr),ir=_r.errors.length>0?VF:_r.warnings.length>0?W3e:zF,ts=_r.data.get("metafile");bt={status:ir,compatibilityDate:Se.config.compatibilityDate,runtimeVersion:zU,outputPath:Ct,buildTime:new Date().toISOString(),buildTimeMs:0,metafile:ts,buildId:c,warnings:_r.warnings,errors:_r.errors,flags:Se.config.flags}}bt.warnings.length>0&&bt.warnings.forEach(jr=>{R.warn(jr)}),bt.errors.length>0&&bt.errors.forEach(jr=>{R.error(jr)});let{metafile:hr,...Pr}=bt;if(R.debug(Pr,"Compiler completed"),bt.buildTimeMs=performance.now()-s,$||await Ude(f,W.child("api"),bt),process.env.ZUPLO_SHOW_PERF){console.log();let jr=bt.buildTimeMs<2e3?"green":bt.buildTimeMs<5e3?"yellow":"red";console.log(f_[jr](`Build time: ${bt.buildTimeMs.toFixed(0)}ms`)),af.report()}return af.clear(),bt}t(vRe,"build");import q4r from"chokidar";import*as fEt from"esbuild";import{randomUUID as uEt}from"node:crypto";import z4r from"node:events";import VU from"node:path";var bRe=class extends z4r{static{t(this,"WatchEmitter")}},s5=class{static{t(this,"BuildWatcher")}esbuildContext;emitter=new bRe;envFilesWatcher;outputDirectory;sourceDirectory;command;logger;publicZuploEnvironmentVariables;projectName;buildId;output;constructor({sourceDirectory:s,command:c,logger:f,publicZuploEnvironmentVariables:d={},buildId:v,output:E}){this.sourceDirectory=s,this.command=c,this.outputDirectory=VU.join(s,WF),this.logger=f,this.publicZuploEnvironmentVariables=d,this.projectName=VU.basename(s),this.buildId=v,this.output=E,this.envFilesWatcher=q4r.watch([VU.join(s,".env"),VU.join(s,".env.zuplo")])}watchEnvFiles(){this.envFilesWatcher.on("change",()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("add",()=>{this.emitter.emit("reload",null,null)}),this.envFilesWatcher.on("unlink",()=>{this.emitter.emit("reload",null,null)})}onReload=t(s=>{this.emitter.on("reload",s)},"onReload");async start(){let{sourceDirectory:s}=this;if(this.esbuildContext!==void 0)throw new Error("Watcher cannot be started more than once");let c=await vRe({buildId:this.buildId,output:this.output,sourceDirectory:s,noCompile:!0,command:this.command,publicZuploEnvironmentVariables:this.publicZuploEnvironmentVariables,logger:this.logger,deploymentUrl:void 0}),f=await GY({command:this.command,systemDirectory:VU.join(s,bN),cacheDirectory:VU.join(s,"node_modules",bN),outputDirectory:this.outputDirectory,sourceDirectory:s,logger:this.logger,flags:c.flags,compatibilityDate:c.compatibilityDate}),d=this;f.plugins?.push({name:"on-end",setup(v){v.onEnd(E=>{d.logger.debug("Watcher (build) reloaded");let A=tRe({buildId:uEt(),result:E});A.errors.length>0?d.logger.error(A.errors,"Build errors"):d.logger.debug(`Successfully rebuilt watched project. Build id ${A.buildId}`);let O={...A,compatibilityDate:c.compatibilityDate,flags:c.flags};d.emitter.emit("reload",O,null)})}}),this.esbuildContext=await fEt.context(f);try{if((await this.esbuildContext.rebuild()).errors.length>0){let E={status:"Failed",runtimeVersion:"0.0.0",buildTime:"",buildTimeMs:0,buildId:uEt(),warnings:[],errors:[],metafile:void 0};await Ude(s,d.output.child("api"),E),this.logger.error(E.errors,"Build errors")}}catch(v){throw await this.close(),v}await this.esbuildContext.watch()}async close(){try{await this.envFilesWatcher.close(),this.esbuildContext&&(await this.esbuildContext.dispose(),this.logger.debug("ESBuild watcher closed"))}catch(s){this.logger.error(s)}}};var swt=W_(NMe(),1);import{existsSync as s7r}from"node:fs";import{mkdir as a7r,readFile as o7r}from"node:fs/promises";import mX from"node:path";var eje=W_(V3e(),1);var twt=W_(ykt(),1);import{Buffer as ZFr}from"node:buffer";import e7r from"node:path";import ewt from"node:child_process";import khe from"node:process";function $Me(a){let s=typeof a=="string"?`
|
|
681
681
|
`:10,c=typeof a=="string"?"\r":13;return a[a.length-1]===s&&(a=a.slice(0,-1)),a[a.length-1]===c&&(a=a.slice(0,-1)),a}t($Me,"stripFinalNewline");import bhe from"node:process";import _X from"node:path";import{fileURLToPath as vkt}from"node:url";function vhe(a={}){let{env:s=process.env,platform:c=process.platform}=a;return c!=="win32"?"PATH":Object.keys(s).reverse().find(f=>f.toUpperCase()==="PATH")||"Path"}t(vhe,"pathKey");var pFr=t(({cwd:a=bhe.cwd(),path:s=bhe.env[vhe()],preferLocal:c=!0,execPath:f=bhe.execPath,addExecPath:d=!0}={})=>{let v=a instanceof URL?vkt(a):a,E=_X.resolve(v),A=[];return c&&dFr(A,E),d&&mFr(A,f,E),[...A,s].join(_X.delimiter)},"npmRunPath"),dFr=t((a,s)=>{let c;for(;c!==s;)a.push(_X.join(s,"node_modules/.bin")),c=s,s=_X.resolve(s,"..")},"applyPreferLocal"),mFr=t((a,s,c)=>{let f=s instanceof URL?vkt(s):s;a.push(_X.resolve(c,f,".."))},"applyExecPath"),bkt=t(({env:a=bhe.env,...s}={})=>{a={...a};let c=vhe({env:a});return s.path=a[c],a[c]=pFr(s),a},"npmRunPathEnv");var hFr=t((a,s,c,f)=>{if(c==="length"||c==="prototype"||c==="arguments"||c==="caller")return;let d=Object.getOwnPropertyDescriptor(a,c),v=Object.getOwnPropertyDescriptor(s,c);!gFr(d,v)&&f||Object.defineProperty(a,c,v)},"copyProperty"),gFr=t(function(a,s){return a===void 0||a.configurable||a.writable===s.writable&&a.enumerable===s.enumerable&&a.configurable===s.configurable&&(a.writable||a.value===s.value)},"canCopyProperty"),yFr=t((a,s)=>{let c=Object.getPrototypeOf(s);c!==Object.getPrototypeOf(a)&&Object.setPrototypeOf(a,c)},"changePrototype"),vFr=t((a,s)=>`/* Wrapped ${a}*/
|
|
682
682
|
${s}`,"wrappedToString"),bFr=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),SFr=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),TFr=t((a,s,c)=>{let f=c===""?"":`with ${c.trim()}() `,d=vFr.bind(null,f,s.toString());Object.defineProperty(d,"name",SFr),Object.defineProperty(a,"toString",{...bFr,value:d})},"changeToString");function JMe(a,s,{ignoreNonConfigurable:c=!1}={}){let{name:f}=a;for(let d of Reflect.ownKeys(s))hFr(a,s,d,c);return yFr(a,s),TFr(a,s,f),a}t(JMe,"mimicFunction");var She=new WeakMap,Skt=t((a,s={})=>{if(typeof a!="function")throw new TypeError("Expected a function");let c,f=0,d=a.displayName||a.name||"<anonymous>",v=t(function(...E){if(She.set(v,++f),f===1)c=a.apply(this,E),a=null;else if(s.throw===!0)throw new Error(`Function \`${d}\` can only be called once`);return c},"onetime");return JMe(v,a),She.set(v,f),v},"onetime");Skt.callCount=a=>{if(!She.has(a))throw new Error(`The given function \`${a.name}\` is not wrapped by the \`onetime\` package`);return She.get(a)};var Tkt=Skt;import{constants as DFr}from"os";var Ckt=t(function(){let a=qMe-Ekt+1;return Array.from({length:a},CFr)},"getRealtimeSignals"),CFr=t(function(a,s){return{name:`SIGRT${s+1}`,number:Ekt+s,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},"getRealtimeSignal"),Ekt=34,qMe=64;import{constants as EFr}from"os";var xkt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var zMe=t(function(){let a=Ckt();return[...xkt,...a].map(xFr)},"getSignals"),xFr=t(function({name:a,number:s,description:c,action:f,forced:d=!1,standard:v}){let{signals:{[a]:E}}=EFr,A=E!==void 0;return{name:a,number:A?E:s,description:c,supported:A,action:f,forced:d,standard:v}},"normalizeSignal");var AFr=t(function(){return zMe().reduce(kFr,{})},"getSignalsByName"),kFr=t(function(a,{name:s,number:c,description:f,supported:d,action:v,forced:E,standard:A}){return{...a,[s]:{name:s,number:c,description:f,supported:d,action:v,forced:E,standard:A}}},"getSignalByName"),Dkt=AFr(),wFr=t(function(){let a=zMe(),s=qMe+1,c=Array.from({length:s},(f,d)=>PFr(d,a));return Object.assign({},...c)},"getSignalsByNumber"),PFr=t(function(a,s){let c=NFr(a,s);if(c===void 0)return{};let{name:f,description:d,supported:v,action:E,forced:A,standard:O}=c;return{[a]:{name:f,number:a,description:d,supported:v,action:E,forced:A,standard:O}}},"getSignalByNumber"),NFr=t(function(a,s){let c=s.find(({name:f})=>DFr.signals[f]===a);return c!==void 0?c:s.find(f=>f.number===a)},"findSignalByNumber"),Qnn=wFr();var IFr=t(({timedOut:a,timeout:s,errorCode:c,signal:f,signalDescription:d,exitCode:v,isCanceled:E})=>a?`timed out after ${s} milliseconds`:E?"was canceled":c!==void 0?`failed with ${c}`:f!==void 0?`was killed with ${f} (${d})`:v!==void 0?`failed with exit code ${v}`:"failed","getErrorPrefix"),VMe=t(({stdout:a,stderr:s,all:c,error:f,signal:d,exitCode:v,command:E,escapedCommand:A,timedOut:O,isCanceled:R,killed:W,parsed:{options:{timeout:$}}})=>{v=v===null?void 0:v,d=d===null?void 0:d;let K=d===void 0?void 0:Dkt[d].description,Pe=f&&f.code,Se=`Command ${IFr({timedOut:O,timeout:$,errorCode:Pe,signal:d,signalDescription:K,exitCode:v,isCanceled:R})}: ${E}`,Ct=Object.prototype.toString.call(f)==="[object Error]",bt=Ct?`${Se}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/core",
|
|
3
|
-
"version": "6.47.
|
|
3
|
+
"version": "6.47.9",
|
|
4
4
|
"repository": "https://github.com/zuplo/zuplo",
|
|
5
5
|
"author": "Zuplo, Inc.",
|
|
6
6
|
"type": "module",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"prettier": "^3.5.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@zuplo/graphql": "^6.47.
|
|
44
|
-
"@zuplo/otel": "^6.47.
|
|
45
|
-
"@zuplo/runtime": "^6.47.
|
|
43
|
+
"@zuplo/graphql": "^6.47.9",
|
|
44
|
+
"@zuplo/otel": "^6.47.9",
|
|
45
|
+
"@zuplo/runtime": "^6.47.9"
|
|
46
46
|
}
|
|
47
47
|
}
|