@serverless-devs/s 3.1.0 → 3.1.1-a8c1e3bf
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/lib/daemon/lib.js +1 -1
- package/lib/index.js +7 -7
- package/package.json +3 -3
- package/readme.md +2 -2
package/lib/index.js
CHANGED
|
@@ -206,7 +206,7 @@ Calls to async() callback can have unexpected results.`),l=!0,function(d,m){d?c(
|
|
|
206
206
|
Please select an access:`,choices:n.map(i=>({name:i,value:i}))}]);r=u}(0,LX.transform)(t,(n,u,i)=>{u.__default=fmt.CRYPTO_FALSE,(0,LX.set)(n,i,u)}),(0,LX.set)(t,`${r}.__default`,fmt.CRYPTO_TRUE),yield(0,hDe.writeData)(t)})});var Ml=I(PE=>{"use strict";var hmt=PE&&PE.__awaiter||function(e,t,r,n){function u(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function s(l){try{c(n.next(l))}catch(f){o(f)}}function a(l){try{c(n.throw(l))}catch(f){o(f)}}function c(l){l.done?i(l.value):u(l.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},w8=PE&&PE.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(PE,"__esModule",{value:!0});var xln=ir(),Aln=w8(Hb()),Fln=w8(c2t()),_ln=w8(amt()),Bln=w8(aDe()),wln=w8(cmt()),Sln=w8(lmt()),Oln=w8(IX()),Tln=w8(pmt()),dDe=class{constructor({logger:t}={}){this.getAll=Bln.default,this.remove=Sln.default,this.rename=wln.default,this.decrypt=Oln.default,this.default=Tln.default,Aln.default.set(t)}get(t){return hmt(this,void 0,void 0,function*(){return yield new _ln.default(t).run()})}set(t){return hmt(this,void 0,void 0,function*(){return yield new Fln.default().run((0,xln.cloneDeep)(t||{}))})}};PE.default=dDe});var mDe=I(ga=>{"use strict";var Pln=ga&&ga.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var u=Object.getOwnPropertyDescriptor(t,r);(!u||("get"in u?!t.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,u)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),kln=ga&&ga.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Rln=ga&&ga.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Pln(t,e,r);return kln(t,e),t},Iln=ga&&ga.__awaiter||function(e,t,r,n){function u(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function s(l){try{c(n.next(l))}catch(f){o(f)}}function a(l){try{c(n.throw(l))}catch(f){o(f)}}function c(l){l.done?i(l.value):u(l.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},dmt=ga&&ga.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ga,"__esModule",{value:!0});ga.getCredential=ga.isExtendMode=ga.getDefaultYamlPath=void 0;var jln=dmt(require("path")),NX=Rln(xr()),Lln=dmt(Ml()),Nln=ir(),qln=xr();function Mln(){let e=NX.getYamlPath("s");if(e)return jln.default.resolve(e);throw new NX.DevsError("the s.yaml/s.yml file was not found.",{tips:"Please check if the s.yaml/s.yml file exists, you can also specify it with -t.",trackerType:qln.ETrackerType.parseException})}ga.getDefaultYamlPath=Mln;var Uln=(e,t)=>typeof e!="string"?!1:(NX.getYamlContent(NX.getAbsolutePath(e,t)),!0);ga.isExtendMode=Uln;function $ln(e,t){return Iln(this,void 0,void 0,function*(){try{let n=yield new Lln.default({logger:t}).get(e);return(0,Nln.get)(n,"credential",{})}catch{return{}}})}ga.getCredential=$ln});var gDe=I((bPu,mmt)=>{function zln(e){r.debug=r,r.default=r,r.coerce=a,r.disable=i,r.enable=u,r.enabled=o,r.humanize=CG(),r.destroy=c,Object.keys(e).forEach(l=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let f=0;for(let p=0;p<l.length;p++)f=(f<<5)-f+l.charCodeAt(p),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=t;function r(l){let f,p=null,h,d;function m(...v){if(!m.enabled)return;let y=m,g=Number(new Date),D=g-(f||g);y.diff=D,y.prev=f,y.curr=g,f=g,v[0]=r.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let E=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(C,x)=>{if(C==="%%")return"%";E++;let F=r.formatters[x];if(typeof F=="function"){let A=v[E];C=F.call(y,A),v.splice(E,1),E--}return C}),r.formatArgs.call(y,v),(y.log||r.log).apply(y,v)}return m.namespace=l,m.useColors=r.useColors(),m.color=r.selectColor(l),m.extend=n,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(h!==r.namespaces&&(h=r.namespaces,d=r.enabled(l)),d),set:v=>{p=v}}),typeof r.init=="function"&&r.init(m),m}function n(l,f){let p=r(this.namespace+(typeof f>"u"?":":f)+l);return p.log=this.log,p}function u(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,p=(typeof l=="string"?l:"").split(/[\s,]+/),h=p.length;for(f=0;f<h;f++)p[f]&&(l=p[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function i(){let l=[...r.names.map(s),...r.skips.map(s).map(f=>"-"+f)].join(",");return r.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let f,p;for(f=0,p=r.skips.length;f<p;f++)if(r.skips[f].test(l))return!1;for(f=0,p=r.names.length;f<p;f++)if(r.names[f].test(l))return!0;return!1}function s(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function a(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}mmt.exports=zln});var gmt=I((z0,qX)=>{z0.formatArgs=Wln;z0.save=Vln;z0.load=Hln;z0.useColors=Gln;z0.storage=Kln();z0.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();z0.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Gln(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Wln(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+qX.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,u=>{u!=="%%"&&(r++,u==="%c"&&(n=r))}),e.splice(n,0,t)}z0.log=console.debug||console.log||(()=>{});function Vln(e){try{e?z0.storage.setItem("debug",e):z0.storage.removeItem("debug")}catch{}}function Hln(){let e;try{e=z0.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Kln(){try{return localStorage}catch{}}qX.exports=gDe()(z0);var{formatters:Yln}=qX.exports;Yln.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Dmt=I((oc,UX)=>{var Xln=require("tty"),MX=require("util");oc.init=nfn;oc.log=efn;oc.formatArgs=Qln;oc.save=tfn;oc.load=rfn;oc.useColors=Jln;oc.destroy=MX.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");oc.colors=[6,2,3,4,5,1];try{let e=j0();e&&(e.stderr||e).level>=2&&(oc.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}oc.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(u,i)=>i.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function Jln(){return"colors"in oc.inspectOpts?!!oc.inspectOpts.colors:Xln.isatty(process.stderr.fd)}function Qln(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,u="\x1B[3"+(n<8?n:"8;5;"+n),i=` ${u};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
|
|
207
207
|
`).join(`
|
|
208
208
|
`+i),e.push(u+"m+"+UX.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Zln()+t+" "+e[0]}function Zln(){return oc.inspectOpts.hideDate?"":new Date().toISOString()+" "}function efn(...e){return console.log(MX.format(...e))}function tfn(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function rfn(){return process.env.DEBUG}function nfn(e){e.inspectOpts={};let t=Object.keys(oc.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=oc.inspectOpts[t[r]]}UX.exports=gDe()(oc);var{formatters:vmt}=UX.exports;vmt.o=function(e){return this.inspectOpts.colors=this.useColors,MX.inspect(e,this.inspectOpts).split(`
|
|
209
|
-
`).map(t=>t.trim()).join(" ")};vmt.O=function(e){return this.inspectOpts.colors=this.useColors,MX.inspect(e,this.inspectOpts)}});var Rd=I((CPu,vDe)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?vDe.exports=gmt():vDe.exports=Dmt()});var Emt=I(EDe=>{"use strict";Object.defineProperty(EDe,"__esModule",{value:!0});var Yc=ir(),ymt=Iz(),ufn=xr(),DDe=(0,ufn.isDevsDebugMode)()?Rd()("serverless-devs:parse-spec"):e=>{},yDe=class{constructor(t){this.steps=t,this.useOrder=!1,this.orderMap={},this.dependencies={}}start(){return this.dependencies=this.getDependencies(),this.analysis(),this}sort(t){if(!this.useOrder)return{steps:t,dependencies:this.dependencies};let r=(0,Yc.map)(t,u=>Object.assign(Object.assign({},u),{order:this.orderMap[u.projectName]}));return{steps:(0,Yc.sortBy)(r,u=>u.order),dependencies:this.dependencies,useOrder:this.useOrder}}analysis(){let t=(0,Yc.cloneDeep)(this.dependencies),r=0,n=()=>{for(let u in t){let i=t[u];if((0,Yc.isEmpty)(i)){(0,Yc.set)(this.orderMap,u,r++),(0,Yc.unset)(t,u);for(let o in t)(0,Yc.unset)(t,[o,u]);n()}}};n(),DDe(`order map: ${JSON.stringify(this.orderMap)}`)}getDependencies(){DDe(`order steps: ${JSON.stringify(this.steps)}`);let t=(0,Yc.map)(this.steps,i=>i.projectName),r={},n="",u=i=>{let o=i.constructor===Array?[]:{};if(typeof i=="object")for(var s in i){let a=i[s];if(typeof a=="string"){let c=a.match(ymt.REGXG);if(c)for(let l of c){let f=l.replace(ymt.REGXG,"$1"),p=(0,Yc.split)(f,".")[0],h=(0,Yc.split)(f,".")[1],d=(0,Yc.split)(f,".")[2];p==="resources"&&(0,Yc.includes)(t,h)&&d==="output"&&(this.useOrder=!0,(0,Yc.set)(r,n,Object.assign(Object.assign({},r[n]),{[h]:1})))}}o[s]=(0,Yc.isObject)(a)?u(a):a}else o=i;return o};for(let i of this.steps)n=i.projectName,(0,Yc.set)(r,n,{}),u((0,Yc.get)(i,"props",{}));return DDe(`order dependencies: ${JSON.stringify(r)}`),r}};EDe.default=yDe});var CDe=I((APu,Cmt)=>{"use strict";var bDe=Object.prototype.hasOwnProperty,ifn=Object.prototype.toString,bmt=function(t){if(!t||ifn.call(t)!=="[object Object]")return!1;var r=bDe.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&bDe.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var u;for(u in t);return typeof u>"u"||bDe.call(t,u)};Cmt.exports=function e(){var t,r,n,u,i,o,s=arguments[0],a=1,c=arguments.length,l=!1;for(typeof s=="boolean"?(l=s,s=arguments[1]||{},a=2):(typeof s!="object"&&typeof s!="function"||s==null)&&(s={});a<c;++a)if(t=arguments[a],t!=null)for(r in t)r!=="__proto__"&&(n=s[r],u=t[r],s!==u&&(l&&u&&bmt(u)?(o=n&&bmt(n)?n:{},s[r]=e(l,o,u)):typeof u<"u"&&(s[r]=u)));return s}});var Bmt=I(S5=>{"use strict";var xmt=S5&&S5.__awaiter||function(e,t,r,n){function u(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function s(l){try{c(n.next(l))}catch(f){o(f)}}function a(l){try{c(n.throw(l))}catch(f){o(f)}}function c(l){l.done?i(l.value):u(l.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},ofn=S5&&S5.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,n=Object.getOwnPropertySymbols(e);u<n.length;u++)t.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(r[n[u]]=e[n[u]]);return r},_mt=S5&&S5.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(S5,"__esModule",{value:!0});var sfn=_mt(require("path")),iP=_mt(G1e()),afn=mDe(),cfn=xr(),Iu=ir(),Amt=CDe(),Fmt=(0,cfn.isDevsDebugMode)()?Rd()("serverless-devs:parse-spec"):e=>{},xDe=class{constructor(t={},r={}){this.content=t,this.options=r,this.credential={}}start(){return xmt(this,void 0,void 0,function*(){return yield this.getSteps()})}getEnvMagic(t={}){return Object.assign(Object.assign({},t),{__runtime:"parse",project:(0,Iu.get)(this.options.environment,"__project"),that:(0,Iu.set)((0,Iu.omit)(this.options.environment,["infrastructure","overlays"]),"project",(0,Iu.get)(this.options.environment,"__project")),credential:this.credential})}getCommonMagic(){return{cwd:sfn.default.dirname(this.options.basePath),vars:this.content.vars,__runtime:"parse",credential:this.credential}}getMagicProps(t){let r=(0,Iu.get)(this.content,"resources",{}),n=(0,Iu.get)(this.content,"components",{}),u={},i={};(0,Iu.each)(r,(a,c)=>{(0,Iu.set)(u,`${c}.props`,a.props||{})}),(0,Iu.each)(n,(a,c)=>{(0,Iu.set)(i,`${c}.props`,a.props||{})});let o=t.projectName,s=Object.assign(Object.assign({},this.getCommonMagic()),{resources:u,components:i,that:{name:o,access:t.access,component:t.component,props:u[o].props,output:u[o].output,info:u[o].info}});return(0,Iu.set)(s,"that.props",(0,iP.default)(u[o].props,s)),Fmt(`getMagicProps: ${JSON.stringify(s)}`),s}getSteps(){return xmt(this,void 0,void 0,function*(){let t=this.getAccess();this.credential=yield(0,afn.getCredential)(t,this.options.logger);let r=this.content,{resources:n}=r,u=ofn(r,["resources"]);this.content=Object.assign(Object.assign({},this.content),(0,iP.default)(u,this.getCommonMagic()));let i=[],o=[];for(let c in n){let l=n[c],p=DO()((0,Iu.get)(l,"component"),this.getCommonMagic()),h=(0,Iu.get)(this.content.template,(0,Iu.get)(l,"extend.name"),{});h=(0,iP.default)((0,Iu.omit)(h,(0,Iu.get)(l,"extend.ignore",[])),this.getCommonMagic());let d=Amt(!0,{},h,l.props),m=(0,Iu.cloneDeep)(this.options.environment);m&&!(0,Iu.isEmpty)((0,Iu.get)(m,"overlays.components"))&&(m.overlays.components=(0,Iu.pickBy)(m.overlays.components,(D,E)=>E===p)),m&&!(0,Iu.isEmpty)((0,Iu.get)(m,"overlays.resources"))&&(m.overlays.resources=(0,Iu.pickBy)(m.overlays.resources,(D,E)=>E===c));let v=(0,iP.default)(m,this.getEnvMagic({source:d})),y=(0,Iu.get)(v,"infraStack.region")?{region:(0,Iu.get)(v,"infraStack.region")}:{};Fmt(`real environment: ${JSON.stringify(v)}`),(0,Iu.set)(l,"props",Amt(!0,{},d,(0,Iu.get)(v,`overlays.components.${p}`,{}),(0,Iu.get)(v,`overlays.resources.${c}`,{}),y));let g=(0,iP.default)(l,this.getMagicProps({projectName:c,access:t,component:p}));this.content=Object.assign(Object.assign({},this.content),{access:t,resources:Object.assign(Object.assign({},this.content.resources),{[c]:g})}),i.push(Object.assign(Object.assign({},g),{projectName:c,component:p,access:t,credential:this.credential})),o.push(Object.assign(Object.assign({},l),{projectName:c,component:p,access:t,credential:this.credential}))}let s=this.options.projectName?[(0,Iu.find)(i,c=>c.projectName===this.options.projectName)]:i,a=this.options.projectName?[(0,Iu.find)(o,c=>c.projectName===this.options.projectName)]:o;return{steps:s,content:this.content,originSteps:a,allSteps:i}})}getAccess(){if(this.options.access)return this.options.access;let t=(0,Iu.get)(this.options,"environment.access");if(t)return t;if(this.content.access)return this.content.access}};S5.default=xDe});var ch=I(Yo=>{"use strict";var Tmt=Yo&&Yo.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var u=Object.getOwnPropertyDescriptor(t,r);(!u||("get"in u?!t.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,u)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),lfn=Yo&&Yo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Pmt=Yo&&Yo.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Tmt(t,e,r)},ffn=Yo&&Yo.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Tmt(t,e,r);return lfn(t,e),t},ADe=Yo&&Yo.__awaiter||function(e,t,r,n){function u(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function s(l){try{c(n.next(l))}catch(f){o(f)}}function a(l){try{c(n.throw(l))}catch(f){o(f)}}function c(l){l.done?i(l.value):u(l.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},oP=Yo&&Yo.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,n=Object.getOwnPropertySymbols(e);u<n.length;u++)t.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(r[n[u]]=e[n[u]]);return r},RE=Yo&&Yo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.getInputs=void 0;var pfn=G1e();Object.defineProperty(Yo,"getInputs",{enumerable:!0,get:function(){return RE(pfn).default}});Pmt(W1e(),Yo);Pmt(Iz(),Yo);var ah=ffn(xr()),FDe=RE(Si()),v2=RE(require("path")),_De=RE(Y1e()),BDe=X1e(),wmt=mDe(),hfn=RE(Emt()),wDe=RE(Bmt()),Lr=ir(),kE=W1e(),S8=Iz(),Smt=RE(require("assert")),O5=xr(),Omt=CDe(),Gf=(0,O5.isDevsDebugMode)()?Rd()("serverless-devs:parse-spec"):e=>{},SDe=class{constructor(t="",r={}){this.options=r,this.yaml={},this.record={},this.options.argv=this.options.argv||process.argv.slice(2),this.options.logger=this.options.logger||console,this.init(t),Gf(`yaml path: ${this.yaml.path}`),Gf(`argv: ${JSON.stringify(this.options.argv)}`)}init(t){if((0,Lr.isEmpty)(t))return this.yaml.path=(0,wmt.getDefaultYamlPath)();if(FDe.default.existsSync(t))return this.yaml.path=ah.getAbsolutePath(t);throw new Error(`The specified template file does not exist: ${t}`)}doYamlinit(){return ADe(this,void 0,void 0,function*(){yield this.doExtend(),this.doEnvironment(),this.yaml.access=(0,Lr.get)(this.yaml.content,"access");let t=this.yaml.use3x?"resources":"services",r=(0,Lr.get)(this.yaml.content,t,{});this.yaml.projectNames=(0,Lr.keys)((0,Lr.get)(this.yaml.content,t,{})),this.yaml.vars=(0,Lr.get)(this.yaml.content,"vars",{}),this.yaml.flow=(0,Lr.get)(this.yaml.content,"flow",{}),this.yaml.useFlow=!1,this.yaml.appName=(0,Lr.get)(this.yaml.content,"name");for(let n of this.yaml.projectNames){let u=(0,Lr.get)(r,`${n}.props.code`);if(u&&(0,Lr.isString)(u)){let i=ah.getAbsolutePath((0,Lr.get)(r,`${n}.props.code`,""));(0,BDe.expand)(_De.default.config({path:v2.default.join(i,".env")}))}}(0,BDe.expand)(_De.default.config({path:v2.default.join(v2.default.dirname(this.yaml.path),".env")}))})}doExtend(){return ADe(this,void 0,void 0,function*(){if(this.yaml.content=ah.getYamlContent(this.yaml.path),this.yaml.extend=(0,Lr.get)(this.yaml.content,"extend"),this.yaml.useExtend=(0,wmt.isExtendMode)(this.yaml.extend,v2.default.dirname(this.yaml.path)),this.yaml.useExtend){let t=ah.getAbsolutePath(this.yaml.extend,v2.default.dirname(this.yaml.path));(0,BDe.expand)(_De.default.config({path:v2.default.join(t,".env")}));let r=ah.getYamlContent(t);if(this.yaml.use3x=String((0,Lr.get)(this.yaml.content,"edition",(0,Lr.get)(r,"edition")))==="3.0.0",!this.yaml.use3x)return;let{resources:n}=r,u=oP(r,["resources"]),i=this.yaml.content,{resources:o}=i,s=oP(i,["resources"]),a=Omt(!0,{},u,s),c=yield new wDe.default(Object.assign(Object.assign({},r),a),this.getParsedContentOptions(t)).start(),l=yield new wDe.default(Object.assign(Object.assign({},this.yaml.content),a),this.getParsedContentOptions(this.yaml.path)).start();this.yaml.content=Omt(!0,{},(0,Lr.get)(c,"content"),(0,Lr.get)(l,"content"));return}this.yaml.use3x=String((0,Lr.get)(this.yaml.content,"edition"))==="3.0.0"})}doEnvironment(){if(!this.yaml.use3x)return;let t=this.record.env?this.doEnvWithSpecify():this.doEnvWithNotSpecify();if((0,Lr.isEmpty)(t))return;let{project:r,environment:n}=t;Gf(`use environment: ${JSON.stringify(n)}`),(0,Lr.set)(n,"overlays.resources.region",(0,Lr.get)(n,"region")),(0,Lr.set)(n,"__project",r),this.yaml.environment=n}doEnvWithNotSpecify(){if(this.yaml.useExtend&&(0,Lr.has)(this.yaml.content,S8.ENVIRONMENT_KEY))throw new O5.DevsError("Environment and extend is conflict",{trackerType:O5.ETrackerType.parseException});if(!FDe.default.existsSync(S8.ENVIRONMENT_FILE_PATH))return{};let t=process.env.ALIYUN_DEVS_REMOTE_PROJECT_NAME,r=t||(0,Lr.get)(this.yaml.content,"name"),n=require(S8.ENVIRONMENT_FILE_PATH),u=(0,Lr.get)((0,Lr.find)(n,{project:r}),"default");if((0,Lr.isEmpty)(u))return{};let i=ah.getAbsolutePath((0,Lr.get)(this.yaml.content,S8.ENVIRONMENT_KEY)||"env.yaml",v2.default.dirname(this.yaml.path)),o=ah.getYamlContent(i);if((0,Lr.isEmpty)(o))return this.options.logger.warnOnce(`Environment file [${i}] is not found, run without environment.`),{};let{environments:s}=o,a=(0,Lr.find)(s,c=>c.name===u);return(0,Lr.isEmpty)(a)?(this.options.logger.warnOnce(`Default env [${u}] is not found, run without environment.`),{}):{project:r,environment:a}}doEnvWithSpecify(){if(this.yaml.useExtend)throw new O5.DevsError("Environment and extend is conflict",{trackerType:O5.ETrackerType.parseException});let t=ah.getAbsolutePath((0,Lr.get)(this.yaml.content,S8.ENVIRONMENT_KEY,S8.ENVIRONMENT_FILE_NAME),v2.default.dirname(this.yaml.path)),r=ah.getYamlContent(t);if((0,Lr.isEmpty)(r))return this.options.logger.warnOnce(`Environment file [${t}] is not found, run without environment.`),{};Gf(`environment content: ${JSON.stringify(r)}`);let{environments:n}=r,u=process.env.ALIYUN_DEVS_REMOTE_PROJECT_NAME,i=u||(0,Lr.get)(this.yaml.content,"name"),o=(0,Lr.find)(n,s=>s.name===this.record.env);return(0,Lr.isEmpty)(o)?(this.options.logger.warnOnce(`Env [${this.record.env}] was not found, run without environment.`),{}):{project:i,environment:o}}getParsedContentOptions(t){return{logger:this.options.logger,basePath:t,projectName:this.record.projectName,access:this.record.access,environment:this.yaml.environment}}start(){return ADe(this,void 0,void 0,function*(){if(Gf("parse start"),this.parseArgv(),yield this.doYamlinit(),this.parseArgv(),!this.yaml.use3x)return this.v1();let{steps:t,content:r,originSteps:n,allSteps:u}=yield new wDe.default(this.yaml.content,this.getParsedContentOptions(this.yaml.path)).start(),i=(0,Lr.get)(this.yaml.content,"services",{});if((0,Lr.isEmpty)(t)&&!(0,Lr.isEmpty)(i))throw this.options.logger.tips("Check https://docs.serverless-devs.com/user-guide/spec/ for more details. Use the 's cli fc3 s2tos3' command for automatic YAML transformation."),new O5.DevsError("Keyword 'services' has been replaced by 'resources' in 3.0.0 YAML.",{trackerType:O5.ETrackerType.parseException});this.yaml.content=r,this.yaml.vars=(0,Lr.get)(this.yaml.content,"vars",{});let o=(0,Lr.get)(this.yaml.content,"actions",{});this.yaml.actions=this.parseActions(o);let s=Object.assign({steps:this.record.projectName?t:this.doFlow(t,n),yaml:this.yaml,allSteps:u},this.record);return Gf(`parse result: ${JSON.stringify(s)}`),Gf("parse end"),s})}v1(){let t=[],r=(0,Lr.get)(this.yaml.content,"services",{});for(let n in r){let u=r[n];t.push(Object.assign(Object.assign({},u),{projectName:n}))}return Object.assign({steps:this.record.projectName?(0,Lr.filter)(t,n=>n.projectName===this.record.projectName):t,yaml:this.yaml},this.record)}parseArgv(){let t=ah.parseArgv(this.options.argv);Gf(`parse argv: ${JSON.stringify(t)}`);let{_:r}=t;if(this.record.access=(0,Lr.get)(t,"access"),this.record.version=(0,Lr.get)(t,"version"),this.record.help=(0,Lr.get)(t,"help"),this.record.output=(0,Lr.get)(t,"output"),this.record.skipActions=(0,Lr.get)(t,"skip-actions"),this.record.debug=(0,Lr.get)(t,"debug"),this.record.env=(0,Lr.get)(t,"env"),(0,Lr.includes)(this.yaml.projectNames,r[0])){this.record.projectName=r[0],this.record.command=r[1];return}this.record.command=r[0]}doFlow(t,r){let n=[],u=(0,Lr.find)(this.yaml.flow,(f,p)=>this.matchFlow(p)),i=new hfn.default(r).start(),{steps:o,dependencies:s,useOrder:a}=i.sort(t);if(!u)return o;Gf(`find flow: ${JSON.stringify(u)}`);let c={},l=(f=[],p)=>{(0,Smt.default)((0,Lr.isArray)(f),`flow ${this.record.command} data format is invalid.`);for(let h of f){let d=(0,Lr.find)(t,m=>m.projectName===h);(0,Smt.default)(d,`Resource ${h} is not found. Please check the content of flow.`),n.push(Object.assign(Object.assign({},d),{flowId:p})),c[d.projectName]=p}};if((0,Lr.each)(u,l),Gf(`flow steps: ${JSON.stringify(n)}`),this.yaml.useFlow=!0,Gf(`flow projectOrder: ${JSON.stringify(c)}`),a){Gf(`project dependencies: ${JSON.stringify(s)}`);for(let f in s){let p=s[f];for(let h in p)if(c[h]>=c[f])throw new Error(`flow is invalid, ${h} must be executed before ${f}`)}}return n}matchFlow(t){return S8.REGX.test(t)?DO()(t,{command:this.record.command}):t===this.record.command}parseActions(t={},r=kE.IActionLevel.GLOBAL){let n=[];for(let u in t){let i=t[u];if(!(0,Lr.isArray)(i))throw new O5.DevsError(`${r} action ${u} is invalid, it must be array`,{trackerType:O5.ETrackerType.parseException});let o=this.matchAction(u);Gf(`action: ${u}, useAction: ${JSON.stringify(o)}`),o.validate&&n.push(...(0,Lr.map)(i,s=>{if(s[kE.IActionType.RUN]){let{run:a}=s,c=oP(s,["run"]);return Object.assign(Object.assign({},c),{value:a,path:ah.getAbsolutePath((0,Lr.get)(s,"path","./"),v2.default.dirname(this.yaml.path)),actionType:kE.IActionType.RUN,hookType:o.type,level:r,projectName:this.record.projectName})}if(s[kE.IActionType.PLUGIN]){let{plugin:a}=s,c=oP(s,["plugin"]),l=ah.getAbsolutePath(a,v2.default.dirname(this.yaml.path));return Object.assign(Object.assign({},c),{value:FDe.default.existsSync(l)?l:a,actionType:kE.IActionType.PLUGIN,hookType:o.type,level:r,projectName:this.record.projectName})}if(s[kE.IActionType.COMPONENT]){let{component:a}=s,c=oP(s,["component"]);return Object.assign(Object.assign({},c),{value:a,actionType:kE.IActionType.COMPONENT,hookType:o.type,level:r,projectName:this.record.projectName})}}))}return Gf(`parse actions: ${JSON.stringify(n)}`),n}matchAction(t){if(S8.REGX.test(t)){let o=DO()(t,{command:this.record.command}),[s,a]=(0,Lr.split)(o,"-");return{validate:a==="true",type:s}}let[n,u]=(0,Lr.split)(t,"-");return{validate:u===this.record.command,type:n}}};Yo.default=SDe});var sP=I((BPu,jmt)=>{var dfn=require("path").relative;jmt.exports=yfn;var mfn=process.cwd();function Rmt(e,t){for(var r=e.split(/[ ,]+/),n=String(t).toLowerCase(),u=0;u<r.length;u++){var i=r[u];if(i&&(i==="*"||i.toLowerCase()===n))return!0}return!1}function gfn(e,t,r){var n=Object.getOwnPropertyDescriptor(e,t),u=n.value;return n.get=function(){return u},n.writable&&(n.set=function(o){return u=o}),delete n.value,delete n.writable,Object.defineProperty(e,t,n),n}function vfn(e){for(var t="",r=0;r<e;r++)t+=", arg"+r;return t.substr(2)}function Dfn(e){var t=this.name+": "+this.namespace;this.message&&(t+=" deprecated "+this.message);for(var r=0;r<e.length;r++)t+=`
|
|
209
|
+
`).map(t=>t.trim()).join(" ")};vmt.O=function(e){return this.inspectOpts.colors=this.useColors,MX.inspect(e,this.inspectOpts)}});var Rd=I((CPu,vDe)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?vDe.exports=gmt():vDe.exports=Dmt()});var Emt=I(EDe=>{"use strict";Object.defineProperty(EDe,"__esModule",{value:!0});var Yc=ir(),ymt=Iz(),ufn=xr(),DDe=(0,ufn.isDevsDebugMode)()?Rd()("serverless-devs:parse-spec"):e=>{},yDe=class{constructor(t){this.steps=t,this.useOrder=!1,this.orderMap={},this.dependencies={}}start(){return this.dependencies=this.getDependencies(),this.analysis(),this}sort(t){if(!this.useOrder)return{steps:t,dependencies:this.dependencies};let r=(0,Yc.map)(t,u=>Object.assign(Object.assign({},u),{order:this.orderMap[u.projectName]}));return{steps:(0,Yc.sortBy)(r,u=>u.order),dependencies:this.dependencies,useOrder:this.useOrder}}analysis(){let t=(0,Yc.cloneDeep)(this.dependencies),r=0,n=()=>{for(let u in t){let i=t[u];if((0,Yc.isEmpty)(i)){(0,Yc.set)(this.orderMap,u,r++),(0,Yc.unset)(t,u);for(let o in t)(0,Yc.unset)(t,[o,u]);n()}}};n(),DDe(`order map: ${JSON.stringify(this.orderMap)}`)}getDependencies(){DDe(`order steps: ${JSON.stringify(this.steps)}`);let t=(0,Yc.map)(this.steps,i=>i.projectName),r={},n="",u=i=>{let o=i.constructor===Array?[]:{};if(typeof i=="object")for(var s in i){let a=i[s];if(typeof a=="string"){let c=a.match(ymt.REGXG);if(c)for(let l of c){let f=l.replace(ymt.REGXG,"$1"),p=(0,Yc.split)(f,".")[0],h=(0,Yc.split)(f,".")[1],d=(0,Yc.split)(f,".")[2];p==="resources"&&(0,Yc.includes)(t,h)&&d==="output"&&(this.useOrder=!0,(0,Yc.set)(r,n,Object.assign(Object.assign({},r[n]),{[h]:1})))}}o[s]=(0,Yc.isObject)(a)?u(a):a}else o=i;return o};for(let i of this.steps)n=i.projectName,(0,Yc.set)(r,n,{}),u((0,Yc.get)(i,"props",{}));return DDe(`order dependencies: ${JSON.stringify(r)}`),r}};EDe.default=yDe});var CDe=I((APu,Cmt)=>{"use strict";var bDe=Object.prototype.hasOwnProperty,ifn=Object.prototype.toString,bmt=function(t){if(!t||ifn.call(t)!=="[object Object]")return!1;var r=bDe.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&bDe.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var u;for(u in t);return typeof u>"u"||bDe.call(t,u)};Cmt.exports=function e(){var t,r,n,u,i,o,s=arguments[0],a=1,c=arguments.length,l=!1;for(typeof s=="boolean"?(l=s,s=arguments[1]||{},a=2):(typeof s!="object"&&typeof s!="function"||s==null)&&(s={});a<c;++a)if(t=arguments[a],t!=null)for(r in t)r!=="__proto__"&&(n=s[r],u=t[r],s!==u&&(l&&u&&bmt(u)?(o=n&&bmt(n)?n:{},s[r]=e(l,o,u)):typeof u<"u"&&(s[r]=u)));return s}});var Bmt=I(S5=>{"use strict";var xmt=S5&&S5.__awaiter||function(e,t,r,n){function u(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function s(l){try{c(n.next(l))}catch(f){o(f)}}function a(l){try{c(n.throw(l))}catch(f){o(f)}}function c(l){l.done?i(l.value):u(l.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},ofn=S5&&S5.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,n=Object.getOwnPropertySymbols(e);u<n.length;u++)t.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(r[n[u]]=e[n[u]]);return r},_mt=S5&&S5.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(S5,"__esModule",{value:!0});var sfn=_mt(require("path")),iP=_mt(G1e()),afn=mDe(),cfn=xr(),Iu=ir(),Amt=CDe(),Fmt=(0,cfn.isDevsDebugMode)()?Rd()("serverless-devs:parse-spec"):e=>{},xDe=class{constructor(t={},r={}){this.content=t,this.options=r,this.credential={}}start(){return xmt(this,void 0,void 0,function*(){return yield this.getSteps()})}getEnvMagic(t={}){return Object.assign(Object.assign({},t),{__runtime:"parse",project:(0,Iu.get)(this.options.environment,"__project"),that:(0,Iu.set)((0,Iu.omit)(this.options.environment,["infrastructure","overlays"]),"project",(0,Iu.get)(this.options.environment,"__project")),credential:this.credential})}getCommonMagic(){return{cwd:sfn.default.dirname(this.options.basePath),vars:this.content.vars,__runtime:"parse",credential:this.credential}}getMagicProps(t){let r=(0,Iu.get)(this.content,"resources",{}),n=(0,Iu.get)(this.content,"components",{}),u={},i={};(0,Iu.each)(r,(a,c)=>{(0,Iu.set)(u,`${c}`,a||{})}),(0,Iu.each)(n,(a,c)=>{(0,Iu.set)(i,`${c}.props`,a.props||{})});let o=t.projectName,s=Object.assign(Object.assign({},this.getCommonMagic()),{resources:u,components:i,that:Object.assign({name:o,access:t.access,component:t.component},u[o])});return(0,Iu.set)(s,"that.props",(0,iP.default)(u[o].props,s)),Fmt(`getMagicProps: ${JSON.stringify(s)}`),s}getSteps(){return xmt(this,void 0,void 0,function*(){let t=this.getAccess();this.credential=yield(0,afn.getCredential)(t,this.options.logger);let r=this.content,{resources:n}=r,u=ofn(r,["resources"]);this.content=Object.assign(Object.assign({},this.content),(0,iP.default)(u,this.getCommonMagic()));let i=[],o=[];for(let c in n){let l=n[c],p=DO()((0,Iu.get)(l,"component"),this.getCommonMagic()),h=(0,Iu.get)(this.content.template,(0,Iu.get)(l,"extend.name"),{});h=(0,iP.default)((0,Iu.omit)(h,(0,Iu.get)(l,"extend.ignore",[])),this.getCommonMagic());let d=Amt(!0,{},h,l.props),m=(0,Iu.cloneDeep)(this.options.environment);m&&!(0,Iu.isEmpty)((0,Iu.get)(m,"overlays.components"))&&(m.overlays.components=(0,Iu.pickBy)(m.overlays.components,(D,E)=>E===p)),m&&!(0,Iu.isEmpty)((0,Iu.get)(m,"overlays.resources"))&&(m.overlays.resources=(0,Iu.pickBy)(m.overlays.resources,(D,E)=>E===c));let v=(0,iP.default)(m,this.getEnvMagic({source:d})),y=(0,Iu.get)(v,"infraStack.region")?{region:(0,Iu.get)(v,"infraStack.region")}:{};Fmt(`real environment: ${JSON.stringify(v)}`),(0,Iu.set)(l,"props",Amt(!0,{},d,(0,Iu.get)(v,`overlays.components.${p}`,{}),(0,Iu.get)(v,`overlays.resources.${c}`,{}),y));let g=(0,iP.default)(l,this.getMagicProps({projectName:c,access:t,component:p}));this.content=Object.assign(Object.assign({},this.content),{access:t,resources:Object.assign(Object.assign({},this.content.resources),{[c]:g})}),i.push(Object.assign(Object.assign({},g),{projectName:c,component:p,access:t,credential:this.credential})),o.push(Object.assign(Object.assign({},l),{projectName:c,component:p,access:t,credential:this.credential}))}let s=this.options.projectName?[(0,Iu.find)(i,c=>c.projectName===this.options.projectName)]:i,a=this.options.projectName?[(0,Iu.find)(o,c=>c.projectName===this.options.projectName)]:o;return{steps:s,content:this.content,originSteps:a,allSteps:i}})}getAccess(){if(this.options.access)return this.options.access;let t=(0,Iu.get)(this.options,"environment.access");if(t)return t;if(this.content.access)return this.content.access}};S5.default=xDe});var ch=I(Yo=>{"use strict";var Tmt=Yo&&Yo.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var u=Object.getOwnPropertyDescriptor(t,r);(!u||("get"in u?!t.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,u)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),lfn=Yo&&Yo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Pmt=Yo&&Yo.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Tmt(t,e,r)},ffn=Yo&&Yo.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Tmt(t,e,r);return lfn(t,e),t},ADe=Yo&&Yo.__awaiter||function(e,t,r,n){function u(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function s(l){try{c(n.next(l))}catch(f){o(f)}}function a(l){try{c(n.throw(l))}catch(f){o(f)}}function c(l){l.done?i(l.value):u(l.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},oP=Yo&&Yo.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,n=Object.getOwnPropertySymbols(e);u<n.length;u++)t.indexOf(n[u])<0&&Object.prototype.propertyIsEnumerable.call(e,n[u])&&(r[n[u]]=e[n[u]]);return r},RE=Yo&&Yo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.getInputs=void 0;var pfn=G1e();Object.defineProperty(Yo,"getInputs",{enumerable:!0,get:function(){return RE(pfn).default}});Pmt(W1e(),Yo);Pmt(Iz(),Yo);var ah=ffn(xr()),FDe=RE(Si()),v2=RE(require("path")),_De=RE(Y1e()),BDe=X1e(),wmt=mDe(),hfn=RE(Emt()),wDe=RE(Bmt()),Lr=ir(),kE=W1e(),S8=Iz(),Smt=RE(require("assert")),O5=xr(),Omt=CDe(),Gf=(0,O5.isDevsDebugMode)()?Rd()("serverless-devs:parse-spec"):e=>{},SDe=class{constructor(t="",r={}){this.options=r,this.yaml={},this.record={},this.options.argv=this.options.argv||process.argv.slice(2),this.options.logger=this.options.logger||console,this.init(t),Gf(`yaml path: ${this.yaml.path}`),Gf(`argv: ${JSON.stringify(this.options.argv)}`)}init(t){if((0,Lr.isEmpty)(t))return this.yaml.path=(0,wmt.getDefaultYamlPath)();if(FDe.default.existsSync(t))return this.yaml.path=ah.getAbsolutePath(t);throw new Error(`The specified template file does not exist: ${t}`)}doYamlinit(){return ADe(this,void 0,void 0,function*(){yield this.doExtend(),this.doEnvironment(),this.yaml.access=(0,Lr.get)(this.yaml.content,"access");let t=this.yaml.use3x?"resources":"services",r=(0,Lr.get)(this.yaml.content,t,{});this.yaml.projectNames=(0,Lr.keys)((0,Lr.get)(this.yaml.content,t,{})),this.yaml.vars=(0,Lr.get)(this.yaml.content,"vars",{}),this.yaml.flow=(0,Lr.get)(this.yaml.content,"flow",{}),this.yaml.useFlow=!1,this.yaml.appName=(0,Lr.get)(this.yaml.content,"name");for(let n of this.yaml.projectNames){let u=(0,Lr.get)(r,`${n}.props.code`);if(u&&(0,Lr.isString)(u)){let i=ah.getAbsolutePath((0,Lr.get)(r,`${n}.props.code`,""));(0,BDe.expand)(_De.default.config({path:v2.default.join(i,".env")}))}}(0,BDe.expand)(_De.default.config({path:v2.default.join(v2.default.dirname(this.yaml.path),".env")}))})}doExtend(){return ADe(this,void 0,void 0,function*(){if(this.yaml.content=ah.getYamlContent(this.yaml.path),this.yaml.extend=(0,Lr.get)(this.yaml.content,"extend"),this.yaml.useExtend=(0,wmt.isExtendMode)(this.yaml.extend,v2.default.dirname(this.yaml.path)),this.yaml.useExtend){let t=ah.getAbsolutePath(this.yaml.extend,v2.default.dirname(this.yaml.path));(0,BDe.expand)(_De.default.config({path:v2.default.join(t,".env")}));let r=ah.getYamlContent(t);if(this.yaml.use3x=String((0,Lr.get)(this.yaml.content,"edition",(0,Lr.get)(r,"edition")))==="3.0.0",!this.yaml.use3x)return;let{resources:n}=r,u=oP(r,["resources"]),i=this.yaml.content,{resources:o}=i,s=oP(i,["resources"]),a=Omt(!0,{},u,s),c=yield new wDe.default(Object.assign(Object.assign({},r),a),this.getParsedContentOptions(t)).start(),l=yield new wDe.default(Object.assign(Object.assign({},this.yaml.content),a),this.getParsedContentOptions(this.yaml.path)).start();this.yaml.content=Omt(!0,{},(0,Lr.get)(c,"content"),(0,Lr.get)(l,"content"));return}this.yaml.use3x=String((0,Lr.get)(this.yaml.content,"edition"))==="3.0.0"})}doEnvironment(){if(!this.yaml.use3x)return;let t=this.record.env?this.doEnvWithSpecify():this.doEnvWithNotSpecify();if((0,Lr.isEmpty)(t))return;let{project:r,environment:n}=t;Gf(`use environment: ${JSON.stringify(n)}`),(0,Lr.set)(n,"overlays.resources.region",(0,Lr.get)(n,"region")),(0,Lr.set)(n,"__project",r),this.yaml.environment=n}doEnvWithNotSpecify(){if(this.yaml.useExtend&&(0,Lr.has)(this.yaml.content,S8.ENVIRONMENT_KEY))throw new O5.DevsError("Environment and extend is conflict",{trackerType:O5.ETrackerType.parseException});if(!FDe.default.existsSync(S8.ENVIRONMENT_FILE_PATH))return{};let t=process.env.ALIYUN_DEVS_REMOTE_PROJECT_NAME,r=t||(0,Lr.get)(this.yaml.content,"name"),n=require(S8.ENVIRONMENT_FILE_PATH),u=(0,Lr.get)((0,Lr.find)(n,{project:r}),"default");if((0,Lr.isEmpty)(u))return{};let i=ah.getAbsolutePath((0,Lr.get)(this.yaml.content,S8.ENVIRONMENT_KEY)||"env.yaml",v2.default.dirname(this.yaml.path)),o=ah.getYamlContent(i);if((0,Lr.isEmpty)(o))return this.options.logger.warnOnce(`Environment file [${i}] is not found, run without environment.`),{};let{environments:s}=o,a=(0,Lr.find)(s,c=>c.name===u);return(0,Lr.isEmpty)(a)?(this.options.logger.warnOnce(`Default env [${u}] is not found, run without environment.`),{}):{project:r,environment:a}}doEnvWithSpecify(){if(this.yaml.useExtend)throw new O5.DevsError("Environment and extend is conflict",{trackerType:O5.ETrackerType.parseException});let t=ah.getAbsolutePath((0,Lr.get)(this.yaml.content,S8.ENVIRONMENT_KEY,S8.ENVIRONMENT_FILE_NAME),v2.default.dirname(this.yaml.path)),r=ah.getYamlContent(t);if((0,Lr.isEmpty)(r))return this.options.logger.warnOnce(`Environment file [${t}] is not found, run without environment.`),{};Gf(`environment content: ${JSON.stringify(r)}`);let{environments:n}=r,u=process.env.ALIYUN_DEVS_REMOTE_PROJECT_NAME,i=u||(0,Lr.get)(this.yaml.content,"name"),o=(0,Lr.find)(n,s=>s.name===this.record.env);return(0,Lr.isEmpty)(o)?(this.options.logger.warnOnce(`Env [${this.record.env}] was not found, run without environment.`),{}):{project:i,environment:o}}getParsedContentOptions(t){return{logger:this.options.logger,basePath:t,projectName:this.record.projectName,access:this.record.access,environment:this.yaml.environment}}start(){return ADe(this,void 0,void 0,function*(){if(Gf("parse start"),this.parseArgv(),yield this.doYamlinit(),this.parseArgv(),!this.yaml.use3x)return this.v1();let{steps:t,content:r,originSteps:n,allSteps:u}=yield new wDe.default(this.yaml.content,this.getParsedContentOptions(this.yaml.path)).start(),i=(0,Lr.get)(this.yaml.content,"services",{});if((0,Lr.isEmpty)(t)&&!(0,Lr.isEmpty)(i))throw this.options.logger.tips("Check https://docs.serverless-devs.com/user-guide/spec/ for more details. Use the 's cli fc3 s2tos3' command for automatic YAML transformation."),new O5.DevsError("Keyword 'services' has been replaced by 'resources' in 3.0.0 YAML.",{trackerType:O5.ETrackerType.parseException});this.yaml.content=r,this.yaml.vars=(0,Lr.get)(this.yaml.content,"vars",{});let o=(0,Lr.get)(this.yaml.content,"actions",{});this.yaml.actions=this.parseActions(o);let s=Object.assign({steps:this.record.projectName?t:this.doFlow(t,n),yaml:this.yaml,allSteps:u},this.record);return Gf(`parse result: ${JSON.stringify(s)}`),Gf("parse end"),s})}v1(){let t=[],r=(0,Lr.get)(this.yaml.content,"services",{});for(let n in r){let u=r[n];t.push(Object.assign(Object.assign({},u),{projectName:n}))}return Object.assign({steps:this.record.projectName?(0,Lr.filter)(t,n=>n.projectName===this.record.projectName):t,yaml:this.yaml},this.record)}parseArgv(){let t=ah.parseArgv(this.options.argv);Gf(`parse argv: ${JSON.stringify(t)}`);let{_:r}=t;if(this.record.access=(0,Lr.get)(t,"access"),this.record.version=(0,Lr.get)(t,"version"),this.record.help=(0,Lr.get)(t,"help"),this.record.output=(0,Lr.get)(t,"output"),this.record.skipActions=(0,Lr.get)(t,"skip-actions"),this.record.debug=(0,Lr.get)(t,"debug"),this.record.env=(0,Lr.get)(t,"env"),(0,Lr.includes)(this.yaml.projectNames,r[0])){this.record.projectName=r[0],this.record.command=r[1];return}this.record.command=r[0]}doFlow(t,r){let n=[],u=(0,Lr.find)(this.yaml.flow,(f,p)=>this.matchFlow(p)),i=new hfn.default(r).start(),{steps:o,dependencies:s,useOrder:a}=i.sort(t);if(!u)return o;Gf(`find flow: ${JSON.stringify(u)}`);let c={},l=(f=[],p)=>{(0,Smt.default)((0,Lr.isArray)(f),`flow ${this.record.command} data format is invalid.`);for(let h of f){let d=(0,Lr.find)(t,m=>m.projectName===h);(0,Smt.default)(d,`Resource ${h} is not found. Please check the content of flow.`),n.push(Object.assign(Object.assign({},d),{flowId:p})),c[d.projectName]=p}};if((0,Lr.each)(u,l),Gf(`flow steps: ${JSON.stringify(n)}`),this.yaml.useFlow=!0,Gf(`flow projectOrder: ${JSON.stringify(c)}`),a){Gf(`project dependencies: ${JSON.stringify(s)}`);for(let f in s){let p=s[f];for(let h in p)if(c[h]>=c[f])throw new Error(`flow is invalid, ${h} must be executed before ${f}`)}}return n}matchFlow(t){return S8.REGX.test(t)?DO()(t,{command:this.record.command}):t===this.record.command}parseActions(t={},r=kE.IActionLevel.GLOBAL){let n=[];for(let u in t){let i=t[u];if(!(0,Lr.isArray)(i))throw new O5.DevsError(`${r} action ${u} is invalid, it must be array`,{trackerType:O5.ETrackerType.parseException});let o=this.matchAction(u);Gf(`action: ${u}, useAction: ${JSON.stringify(o)}`),o.validate&&n.push(...(0,Lr.map)(i,s=>{if(s[kE.IActionType.RUN]){let{run:a}=s,c=oP(s,["run"]);return Object.assign(Object.assign({},c),{value:a,path:ah.getAbsolutePath((0,Lr.get)(s,"path","./"),v2.default.dirname(this.yaml.path)),actionType:kE.IActionType.RUN,hookType:o.type,level:r,projectName:this.record.projectName})}if(s[kE.IActionType.PLUGIN]){let{plugin:a}=s,c=oP(s,["plugin"]),l=ah.getAbsolutePath(a,v2.default.dirname(this.yaml.path));return Object.assign(Object.assign({},c),{value:FDe.default.existsSync(l)?l:a,actionType:kE.IActionType.PLUGIN,hookType:o.type,level:r,projectName:this.record.projectName})}if(s[kE.IActionType.COMPONENT]){let{component:a}=s,c=oP(s,["component"]);return Object.assign(Object.assign({},c),{value:a,actionType:kE.IActionType.COMPONENT,hookType:o.type,level:r,projectName:this.record.projectName})}}))}return Gf(`parse actions: ${JSON.stringify(n)}`),n}matchAction(t){if(S8.REGX.test(t)){let o=DO()(t,{command:this.record.command}),[s,a]=(0,Lr.split)(o,"-");return{validate:a==="true",type:s}}let[n,u]=(0,Lr.split)(t,"-");return{validate:u===this.record.command,type:n}}};Yo.default=SDe});var sP=I((BPu,jmt)=>{var dfn=require("path").relative;jmt.exports=yfn;var mfn=process.cwd();function Rmt(e,t){for(var r=e.split(/[ ,]+/),n=String(t).toLowerCase(),u=0;u<r.length;u++){var i=r[u];if(i&&(i==="*"||i.toLowerCase()===n))return!0}return!1}function gfn(e,t,r){var n=Object.getOwnPropertyDescriptor(e,t),u=n.value;return n.get=function(){return u},n.writable&&(n.set=function(o){return u=o}),delete n.value,delete n.writable,Object.defineProperty(e,t,n),n}function vfn(e){for(var t="",r=0;r<e;r++)t+=", arg"+r;return t.substr(2)}function Dfn(e){var t=this.name+": "+this.namespace;this.message&&(t+=" deprecated "+this.message);for(var r=0;r<e.length;r++)t+=`
|
|
210
210
|
at `+e[r].toString();return t}function yfn(e){if(!e)throw new TypeError("argument namespace is required");var t=zX(),r=NC(t[1]),n=r[0];function u(i){$X.call(u,i)}return u._file=n,u._ignored=bfn(e),u._namespace=e,u._traced=Cfn(e),u._warned=Object.create(null),u.function=_fn,u.property=Bfn,u}function Efn(e,t){var r=typeof e.listenerCount!="function"?e.listeners(t).length:e.listenerCount(t);return r>0}function bfn(e){if(process.noDeprecation)return!0;var t=process.env.NO_DEPRECATION||"";return Rmt(t,e)}function Cfn(e){if(process.traceDeprecation)return!0;var t=process.env.TRACE_DEPRECATION||"";return Rmt(t,e)}function $X(e,t){var r=Efn(process,"deprecation");if(!(!r&&this._ignored)){var n,u,i,o,s=0,a=!1,c=zX(),l=this._file;for(t?(o=t,i=NC(c[1]),i.name=o.name,l=i[0]):(s=2,o=NC(c[s]),i=o);s<c.length;s++)if(n=NC(c[s]),u=n[0],u===l)a=!0;else if(u===this._file)l=this._file;else if(a)break;var f=n?o.join(":")+"__"+n.join(":"):void 0;if(!(f!==void 0&&f in this._warned)){this._warned[f]=!0;var p=e;if(p||(p=i===o||!i.name?kmt(o):kmt(i)),r){var h=Imt(this._namespace,p,c.slice(s));process.emit("deprecation",h);return}var d=process.stderr.isTTY?Afn:xfn,m=d.call(this,p,n,c.slice(s));process.stderr.write(m+`
|
|
211
211
|
`,"utf8")}}}function NC(e){var t=e.getFileName()||"<anonymous>",r=e.getLineNumber(),n=e.getColumnNumber();e.isEval()&&(t=e.getEvalOrigin()+", "+t);var u=[t,r,n];return u.callSite=e,u.name=e.getFunctionName(),u}function kmt(e){var t=e.callSite,r=e.name;r||(r="<anonymous@"+ODe(e)+">");var n=t.getThis(),u=n&&t.getTypeName();return u==="Object"&&(u=void 0),u==="Function"&&(u=n.name||u),u&&t.getMethodName()?u+"."+r:r}function xfn(e,t,r){var n=new Date().toUTCString(),u=n+" "+this._namespace+" deprecated "+e;if(this._traced){for(var i=0;i<r.length;i++)u+=`
|
|
212
212
|
at `+r[i].toString();return u}return t&&(u+=" at "+ODe(t)),u}function Afn(e,t,r){var n="\x1B[36;1m"+this._namespace+"\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m"+e+"\x1B[39m";if(this._traced){for(var u=0;u<r.length;u++)n+=`
|
|
@@ -334,7 +334,7 @@ ${" ".repeat(t)}`):"").join(`
|
|
|
334
334
|
${I_t("ERROR:")}`),bt.write(`
|
|
335
335
|
${t}
|
|
336
336
|
`),r&&bt.write(`${dt.gray(r)}
|
|
337
|
-
`)}},nR=sCe});var uR=I((gMu,Nxn)=>{Nxn.exports={name:"@serverless-devs/s",version:"3.1.
|
|
337
|
+
`)}},nR=sCe});var uR=I((gMu,Nxn)=>{Nxn.exports={name:"@serverless-devs/s",version:"3.1.1-a8c1e3bf",description:"Serverless devs tool, serverless developer tool, supports Alibaba cloud, AWS, azure, baidu cloud, Huawei cloud, Google cloud and Tencent cloud.",homepage:"https://www.serverless-devs.com",keywords:["serverless","alibaba","tencent","azure","baidu","huawei","google","function","faas","serverless-devs"],publishConfig:{access:"public",registry:"https://registry.npmjs.org"},license:"Apache 2.0",repository:{type:"git",url:"https://github.com/Serverless-Devs/Serverless-Devs"},bugs:{url:"https://github.com/Serverless-Devs/Serverless-Devs/issues"},scripts:{start:"npm run watch",test:"jest --testTimeout 10000","test:watch":"jest --testTimeout 10000 --watchAll",format:"prettier --write src/ __tests__/**/*.test.ts",watch:"npm run build -- --watch",prebuild:"cross-os prebuild",build:"node ./scripts/build.js","build:ci":"node ./scripts/build.js",pkg:"pkg . --out-path releases",prepublishOnly:"npm run build",beta:"npm publish --tag=beta",canary:"npm publish --tag=canary",pub:"npm publish",eslint:"eslint . --ext .ts,.tsx","eslint:fix":"eslint . --ext .ts,.tsx --fix"},"cross-os":{prebuild:{darwin:"rm -rf node_modules && npm install --production false",linux:"rm -rf node_modules && npm install --production false",win32:"rmdir /s /q node_modules && npm install --production false"}},pkg:{scripts:["./lib/daemon/**/*.js"]},main:"./lib/index.js",bin:{s:"bin/s"},engines:{node:">=14.14.0"},devDependencies:{"@serverless-devs/core":"^0.1.67-beta.1","@serverless-devs/credential":"^0.0.9-beta.1","@serverless-devs/engine":"^0.1.4-beta.8","@serverless-devs/load-application":"^0.0.14-beta.5","@serverless-devs/load-component":"^0.0.8-beta.1","@serverless-devs/logger":"^0.0.5","@serverless-devs/parse-spec":"^0.0.28-beta.7","@serverless-devs/registry":"^0.0.10","@serverless-devs/utils":"^0.0.16-beta.1","@types/fs-extra":"^11.0.4","@types/inquirer":"^9.0.7","@types/jest":"^29.5.8","@types/js-yaml":"^4.0.9","@types/lodash":"^4.14.201","@types/node":"^20.9.1","@types/semver":"^7.5.5","@typescript-eslint/eslint-plugin":"^7.3.1","@typescript-eslint/parser":"^7.3.1",ajv:"^8.12.0",axios:"^1.6.2",boxen:"^7.1.1",chalk:"^5.3.0",commander:"^11.1.0","cross-os":"^1.5.0",dotenv:"^16.3.1","dotenv-expand":"^10.0.0",esbuild:"^0.19.12",eslint:"^8.57.0","eslint-plugin-prettier":"^5.1.3","fs-extra":"^11.1.1","global-agent":"^3.0.0",inquirer:"^9.2.12","inquirer-autocomplete-prompt":"^3.0.1",jest:"^29.7.0","js-yaml":"^4.1.0","latest-version":"^7.0.0",leven:"^4.0.0",lodash:"^4.17.21",pkg:"^5.8.1",prettier:"^3.1.0",prettyjson:"^1.2.5",rimraf:"^5.0.5",semver:"^7.5.4","semver-diff":"^4.0.0","strip-ansi":"^7.1.0","table-layout":"^3.0.2","ts-jest":"^29.1.1","ts-node":"^10.9.1",typescript:"^5.2.2"},"lint-staged":{"**/*.{js,jsx,ts}":"f2elint exec eslint"}}});var J0,iR,oR,z_t,u3,TZ,M_t,qxn,U_t,Mxn,$_t,Vd,tv=Ft(()=>{J0=ot(xr());Mn();pr();iR=ot(require("path")),oR=ot(Si());pn();z_t=ot(xr()),u3=ot(ir());Z8();q_t();TZ=ot(xr()),M_t=uR(),qxn=async(e,t={})=>{bt.unsilent();let{silent:r}=(0,z_t.parseArgv)(process.argv.slice(2)),n=iR.default.join((0,J0.getRootHome)(),"logs",process.env.serverless_devs_traceid,"error.json");oR.default.ensureFileSync(n),oR.default.writeJSONSync(n,[],{spaces:2});let u=1;if((0,u3.isArray)(e))for(let i of e){U_t(i,t);let o=(0,u3.get)(i,"exitCode");o&&(u=o)}else{U_t(e,t);let i=(0,u3.get)(e,"exitCode");i&&(u=i)}TZ.getGlobalConfig("log")!=="disable"&&(bt.write(" "),bt.write(dt.gray(`A complete log of this run can be found in: ${dt.underline(iR.default.join(TZ.getRootHome(),"logs",process.env.serverless_devs_traceid))}`))),bt.write(" "),bt.write(dt.gray(aCe([{key:"Env:",value:`${M_t.name}: ${M_t.version}, ${process.platform}-${process.arch} node-${process.version}`},{key:"Logs:",value:dt.underline(iR.default.join((0,J0.getRootHome)(),"logs",process.env.serverless_devs_traceid))},{key:"Feedback:",value:dt.cyan.underline("https://github.com/Serverless-Devs/Serverless-Devs/issues")}]))),r&&bt.silent(),process.exitCode=u},U_t=(e,t={})=>{il("report.js",{argv:process.argv.slice(2),userAgent:(0,J0.getUserAgent)(),...t,type:(0,u3.get)(e,"trackerType"),message:e.message}),Mxn(e),bt.write(" ");let r=e;if(r.CODE===J0.DevsError.CODE){let i=r.prefix?[`${dt.red("\u2716")} ${r.prefix}`,"===================="]:[];i.push(dt.red("Error Message:"),dt.red((0,J0.isDebugMode)()?r.stack:r.message)),r.tips&&i.push(`
|
|
338
338
|
\u{1F37C} Tips`,"====================",dt.yellow(`${r.tips}`)),bt.write(i.join(`
|
|
339
339
|
`)),$_t(r.stack);return}let n=e,u=[dt.red("Error Message:"),dt.red((0,J0.isDebugMode)()?n.stack:n.message)];bt.write(u.join(`
|
|
340
340
|
`)),$_t(n.stack)},Mxn=e=>{let t=u=>{let i=(0,u3.get)(u,"data");if(i)return i;let o=u;return o.CODE===J0.DevsError.CODE?{prefix:o.prefix,message:o.message,exitCode:o.exitCode,tips:o.tips}:{message:o.message}},r=iR.default.join((0,J0.getRootHome)(),"logs",process.env.serverless_devs_traceid,"error.json"),n=oR.default.readJSONSync(r);n.push(t(e)),oR.default.writeJSONSync(r,n,{spaces:2})},$_t=e=>{(0,J0.isDebugMode)()||bt.debug(e)},Vd=qxn});function $xn(){let{version:e}=cCe.default.minVersion(Uxn.engines.node);cCe.default.gte(process.versions.node,e)||(new nR(`Node.js version must be greater than or equal to ${e}`,`Your current Node.js version is ${process.versions.node}, please upgrade your Node.js version at ${dt.underline("https://nodejs.org/en")}.`),process.exit(1))}var cCe,Uxn,PZ,G_t=Ft(()=>{tv();pr();cCe=ot(r3()),Uxn=uR();PZ=$xn});var W_t=I(kZ=>{"use strict";Object.defineProperty(kZ,"__esModule",{value:!0});kZ.boolean=void 0;var zxn=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return e.valueOf()===1;case"[object Boolean]":return e.valueOf();default:return!1}};kZ.boolean=zxn});var V_t=I(RZ=>{"use strict";Object.defineProperty(RZ,"__esModule",{value:!0});RZ.isBooleanable=void 0;var Gxn=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};RZ.isBooleanable=Gxn});var IZ=I(Xx=>{"use strict";Object.defineProperty(Xx,"__esModule",{value:!0});Xx.isBooleanable=Xx.boolean=void 0;var Wxn=W_t();Object.defineProperty(Xx,"boolean",{enumerable:!0,get:function(){return Wxn.boolean}});var Vxn=V_t();Object.defineProperty(Xx,"isBooleanable",{enumerable:!0,get:function(){return Vxn.isBooleanable}})});var jZ=I((SMu,H_t)=>{H_t.exports=Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"});var lCe=I((OMu,Y_t)=>{"use strict";var K_t=Object.prototype.toString;Y_t.exports=function(t){var r=K_t.call(t),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&K_t.call(t.callee)==="[object Function]"),n}});var uBt=I((TMu,nBt)=>{"use strict";var rBt;Object.keys||(sR=Object.prototype.hasOwnProperty,fCe=Object.prototype.toString,X_t=lCe(),pCe=Object.prototype.propertyIsEnumerable,J_t=!pCe.call({toString:null},"toString"),Q_t=pCe.call(function(){},"prototype"),aR=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],LZ=function(e){var t=e.constructor;return t&&t.prototype===e},Z_t={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},eBt=function(){if(typeof window>"u")return!1;for(var e in window)try{if(!Z_t["$"+e]&&sR.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{LZ(window[e])}catch{return!0}}catch{return!0}return!1}(),tBt=function(e){if(typeof window>"u"||!eBt)return LZ(e);try{return LZ(e)}catch{return!1}},rBt=function(t){var r=t!==null&&typeof t=="object",n=fCe.call(t)==="[object Function]",u=X_t(t),i=r&&fCe.call(t)==="[object String]",o=[];if(!r&&!n&&!u)throw new TypeError("Object.keys called on a non-object");var s=Q_t&&n;if(i&&t.length>0&&!sR.call(t,0))for(var a=0;a<t.length;++a)o.push(String(a));if(u&&t.length>0)for(var c=0;c<t.length;++c)o.push(String(c));else for(var l in t)!(s&&l==="prototype")&&sR.call(t,l)&&o.push(String(l));if(J_t)for(var f=tBt(t),p=0;p<aR.length;++p)!(f&&aR[p]==="constructor")&&sR.call(t,aR[p])&&o.push(aR[p]);return o});var sR,fCe,X_t,pCe,J_t,Q_t,aR,LZ,Z_t,eBt,tBt;nBt.exports=rBt});var aBt=I((PMu,sBt)=>{"use strict";var Hxn=Array.prototype.slice,Kxn=lCe(),iBt=Object.keys,NZ=iBt?function(t){return iBt(t)}:uBt(),oBt=Object.keys;NZ.shim=function(){if(Object.keys){var t=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);t||(Object.keys=function(n){return Kxn(n)?oBt(Hxn.call(n)):oBt(n)})}else Object.keys=NZ;return Object.keys||NZ};sBt.exports=NZ});var lBt=I((kMu,cBt)=>{"use strict";cBt.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var u=42;t[r]=u;for(r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,r);if(o.value!==u||o.enumerable!==!0)return!1}return!0}});var hBt=I((RMu,pBt)=>{"use strict";var fBt=typeof Symbol<"u"&&Symbol,Yxn=lBt();pBt.exports=function(){return typeof fBt!="function"||typeof Symbol!="function"||typeof fBt("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Yxn()}});var gBt=I((IMu,mBt)=>{"use strict";var dBt={foo:{}},Xxn=Object;mBt.exports=function(){return{__proto__:dBt}.foo===dBt.foo&&!({__proto__:null}instanceof Xxn)}});var yBt=I((jMu,DBt)=>{"use strict";var Jxn="Function.prototype.bind called on incompatible ",Qxn=Object.prototype.toString,Zxn=Math.max,eAn="[object Function]",vBt=function(t,r){for(var n=[],u=0;u<t.length;u+=1)n[u]=t[u];for(var i=0;i<r.length;i+=1)n[i+t.length]=r[i];return n},tAn=function(t,r){for(var n=[],u=r||0,i=0;u<t.length;u+=1,i+=1)n[i]=t[u];return n},rAn=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r};DBt.exports=function(t){var r=this;if(typeof r!="function"||Qxn.apply(r)!==eAn)throw new TypeError(Jxn+r);for(var n=tAn(arguments,1),u,i=function(){if(this instanceof u){var l=r.apply(this,vBt(n,arguments));return Object(l)===l?l:this}return r.apply(t,vBt(n,arguments))},o=Zxn(0,r.length-n.length),s=[],a=0;a<o;a++)s[a]="$"+a;if(u=Function("binder","return function ("+rAn(s,",")+"){ return binder.apply(this,arguments); }")(i),r.prototype){var c=function(){};c.prototype=r.prototype,u.prototype=new c,c.prototype=null}return u}});var qZ=I((LMu,EBt)=>{"use strict";var nAn=yBt();EBt.exports=Function.prototype.bind||nAn});var CBt=I((NMu,bBt)=>{"use strict";var uAn=Function.prototype.call,iAn=Object.prototype.hasOwnProperty,oAn=qZ();bBt.exports=oAn.call(uAn,iAn)});var tA=I((qMu,BBt)=>{"use strict";var ou,eA=SyntaxError,_Bt=Function,Zx=TypeError,hCe=function(e){try{return _Bt('"use strict"; return ('+e+").constructor;")()}catch{}},i3=Object.getOwnPropertyDescriptor;if(i3)try{i3({},"")}catch{i3=null}var dCe=function(){throw new Zx},sAn=i3?function(){try{return arguments.callee,dCe}catch{try{return i3(arguments,"callee").get}catch{return dCe}}}():dCe,Jx=hBt()(),aAn=gBt()(),Ea=Object.getPrototypeOf||(aAn?function(e){return e.__proto__}:null),Qx={},cAn=typeof Uint8Array>"u"||!Ea?ou:Ea(Uint8Array),o3={"%AggregateError%":typeof AggregateError>"u"?ou:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ou:ArrayBuffer,"%ArrayIteratorPrototype%":Jx&&Ea?Ea([][Symbol.iterator]()):ou,"%AsyncFromSyncIteratorPrototype%":ou,"%AsyncFunction%":Qx,"%AsyncGenerator%":Qx,"%AsyncGeneratorFunction%":Qx,"%AsyncIteratorPrototype%":Qx,"%Atomics%":typeof Atomics>"u"?ou:Atomics,"%BigInt%":typeof BigInt>"u"?ou:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ou:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ou:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ou:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ou:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ou:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ou:FinalizationRegistry,"%Function%":_Bt,"%GeneratorFunction%":Qx,"%Int8Array%":typeof Int8Array>"u"?ou:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ou:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ou:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Jx&&Ea?Ea(Ea([][Symbol.iterator]())):ou,"%JSON%":typeof JSON=="object"?JSON:ou,"%Map%":typeof Map>"u"?ou:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Jx||!Ea?ou:Ea(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ou:Promise,"%Proxy%":typeof Proxy>"u"?ou:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ou:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ou:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Jx||!Ea?ou:Ea(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ou:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Jx&&Ea?Ea(""[Symbol.iterator]()):ou,"%Symbol%":Jx?Symbol:ou,"%SyntaxError%":eA,"%ThrowTypeError%":sAn,"%TypedArray%":cAn,"%TypeError%":Zx,"%Uint8Array%":typeof Uint8Array>"u"?ou:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ou:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ou:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ou:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ou:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ou:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ou:WeakSet};if(Ea)try{null.error}catch(e){xBt=Ea(Ea(e)),o3["%Error.prototype%"]=xBt}var xBt,lAn=function e(t){var r;if(t==="%AsyncFunction%")r=hCe("async function () {}");else if(t==="%GeneratorFunction%")r=hCe("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=hCe("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var u=e("%AsyncGenerator%");u&&Ea&&(r=Ea(u.prototype))}return o3[t]=r,r},ABt={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},cR=qZ(),MZ=CBt(),fAn=cR.call(Function.call,Array.prototype.concat),pAn=cR.call(Function.apply,Array.prototype.splice),FBt=cR.call(Function.call,String.prototype.replace),UZ=cR.call(Function.call,String.prototype.slice),hAn=cR.call(Function.call,RegExp.prototype.exec),dAn=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,mAn=/\\(\\)?/g,gAn=function(t){var r=UZ(t,0,1),n=UZ(t,-1);if(r==="%"&&n!=="%")throw new eA("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new eA("invalid intrinsic syntax, expected opening `%`");var u=[];return FBt(t,dAn,function(i,o,s,a){u[u.length]=s?FBt(a,mAn,"$1"):o||i}),u},vAn=function(t,r){var n=t,u;if(MZ(ABt,n)&&(u=ABt[n],n="%"+u[0]+"%"),MZ(o3,n)){var i=o3[n];if(i===Qx&&(i=lAn(n)),typeof i>"u"&&!r)throw new Zx("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:u,name:n,value:i}}throw new eA("intrinsic "+t+" does not exist!")};BBt.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new Zx("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Zx('"allowMissing" argument must be a boolean');if(hAn(/^%?[^%]*%?$/,t)===null)throw new eA("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=gAn(t),u=n.length>0?n[0]:"",i=vAn("%"+u+"%",r),o=i.name,s=i.value,a=!1,c=i.alias;c&&(u=c[0],pAn(n,fAn([0,1],c)));for(var l=1,f=!0;l<n.length;l+=1){var p=n[l],h=UZ(p,0,1),d=UZ(p,-1);if((h==='"'||h==="'"||h==="`"||d==='"'||d==="'"||d==="`")&&h!==d)throw new eA("property names with quotes must have matching quotes");if((p==="constructor"||!f)&&(a=!0),u+="."+p,o="%"+u+"%",MZ(o3,o))s=o3[o];else if(s!=null){if(!(p in s)){if(!r)throw new Zx("base intrinsic for "+t+" exists, but the property is not available.");return}if(i3&&l+1>=n.length){var m=i3(s,p);f=!!m,f&&"get"in m&&!("originalValue"in m.get)?s=m.get:s=s[p]}else f=MZ(s,p),s=s[p];f&&!a&&(o3[o]=s)}}return s}});var $Z=I((MMu,wBt)=>{"use strict";var DAn=tA(),mCe=DAn("%Object.defineProperty%",!0),gCe=function(){if(mCe)try{return mCe({},"a",{value:1}),!0}catch{return!1}return!1};gCe.hasArrayLengthDefineBug=function(){if(!gCe())return null;try{return mCe([],"length",{value:1}).length!==1}catch{return!0}};wBt.exports=gCe});var vCe=I((UMu,SBt)=>{"use strict";var yAn=tA(),zZ=yAn("%Object.getOwnPropertyDescriptor%",!0);if(zZ)try{zZ([],"length")}catch{zZ=null}SBt.exports=zZ});var yCe=I(($Mu,TBt)=>{"use strict";var EAn=$Z()(),DCe=tA(),lR=EAn&&DCe("%Object.defineProperty%",!0);if(lR)try{lR({},"a",{value:1})}catch{lR=!1}var bAn=DCe("%SyntaxError%"),rA=DCe("%TypeError%"),OBt=vCe();TBt.exports=function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new rA("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new rA("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new rA("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new rA("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new rA("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new rA("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,a=!!OBt&&OBt(t,r);if(lR)lR(t,r,{configurable:o===null&&a?a.configurable:!o,enumerable:u===null&&a?a.enumerable:!u,value:n,writable:i===null&&a?a.writable:!i});else if(s||!u&&!i&&!o)t[r]=n;else throw new bAn("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var ECe=I((zMu,IBt)=>{"use strict";var CAn=aBt(),xAn=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",AAn=Object.prototype.toString,FAn=Array.prototype.concat,PBt=yCe(),_An=function(e){return typeof e=="function"&&AAn.call(e)==="[object Function]"},kBt=$Z()(),BAn=function(e,t,r,n){if(t in e){if(n===!0){if(e[t]===r)return}else if(!_An(n)||!n())return}kBt?PBt(e,t,r,!0):PBt(e,t,r)},RBt=function(e,t){var r=arguments.length>2?arguments[2]:{},n=CAn(t);xAn&&(n=FAn.call(n,Object.getOwnPropertySymbols(t)));for(var u=0;u<n.length;u+=1)BAn(e,n[u],t[n[u]],r[n[u]])};RBt.supportsDescriptors=!!kBt;IBt.exports=RBt});var bCe=I((GMu,jBt)=>{"use strict";jBt.exports=global});var CCe=I((WMu,LBt)=>{"use strict";var wAn=bCe();LBt.exports=function(){return typeof global!="object"||!global||global.Math!==Math||global.Array!==Array?wAn:global}});var qBt=I((VMu,NBt)=>{"use strict";var SAn=ECe(),OAn=CCe();NBt.exports=function(){var t=OAn();if(SAn.supportsDescriptors){var r=Object.getOwnPropertyDescriptor(t,"globalThis");(!r||r.configurable&&(r.enumerable||!r.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t}});var xCe=I((HMu,$Bt)=>{"use strict";var TAn=ECe(),PAn=bCe(),MBt=CCe(),kAn=qBt(),RAn=MBt(),UBt=function(){return RAn};TAn(UBt,{getPolyfill:MBt,implementation:PAn,shim:kAn});$Bt.exports=UBt});var WBt=I((ACe,GBt)=>{ACe=GBt.exports=IAn;ACe.getSerialize=zBt;function IAn(e,t,r,n){return JSON.stringify(e,zBt(t,n),r)}function zBt(e,t){var r=[],n=[];return t==null&&(t=function(u,i){return r[0]===i?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(i)).join(".")+"]"}),function(u,i){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?n.splice(o,1/0,u):n.push(u),~r.indexOf(i)&&(i=t.call(this,u,i))}else r.push(i);return e==null?i:e.call(this,u,i)}}});var VBt=I(GZ=>{(function(){"use strict";var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(o){return n(i(o),arguments)}function r(o,s){return t.apply(null,[o].concat(s||[]))}function n(o,s){var a=1,c=o.length,l,f="",p,h,d,m,v,y,g,D;for(p=0;p<c;p++)if(typeof o[p]=="string")f+=o[p];else if(typeof o[p]=="object"){if(d=o[p],d.keys)for(l=s[a],h=0;h<d.keys.length;h++){if(l==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',d.keys[h],d.keys[h-1]));l=l[d.keys[h]]}else d.param_no?l=s[d.param_no]:l=s[a++];if(e.not_type.test(d.type)&&e.not_primitive.test(d.type)&&l instanceof Function&&(l=l()),e.numeric_arg.test(d.type)&&typeof l!="number"&&isNaN(l))throw new TypeError(t("[sprintf] expecting number but found %T",l));switch(e.number.test(d.type)&&(g=l>=0),d.type){case"b":l=parseInt(l,10).toString(2);break;case"c":l=String.fromCharCode(parseInt(l,10));break;case"d":case"i":l=parseInt(l,10);break;case"j":l=JSON.stringify(l,null,d.width?parseInt(d.width):0);break;case"e":l=d.precision?parseFloat(l).toExponential(d.precision):parseFloat(l).toExponential();break;case"f":l=d.precision?parseFloat(l).toFixed(d.precision):parseFloat(l);break;case"g":l=d.precision?String(Number(l.toPrecision(d.precision))):parseFloat(l);break;case"o":l=(parseInt(l,10)>>>0).toString(8);break;case"s":l=String(l),l=d.precision?l.substring(0,d.precision):l;break;case"t":l=String(!!l),l=d.precision?l.substring(0,d.precision):l;break;case"T":l=Object.prototype.toString.call(l).slice(8,-1).toLowerCase(),l=d.precision?l.substring(0,d.precision):l;break;case"u":l=parseInt(l,10)>>>0;break;case"v":l=l.valueOf(),l=d.precision?l.substring(0,d.precision):l;break;case"x":l=(parseInt(l,10)>>>0).toString(16);break;case"X":l=(parseInt(l,10)>>>0).toString(16).toUpperCase();break}e.json.test(d.type)?f+=l:(e.number.test(d.type)&&(!g||d.sign)?(D=g?"+":"-",l=l.toString().replace(e.sign,"")):D="",v=d.pad_char?d.pad_char==="0"?"0":d.pad_char.charAt(1):" ",y=d.width-(D+l).length,m=d.width&&y>0?v.repeat(y):"",f+=d.align?D+l+m:v==="0"?D+m+l:m+D+l)}return f}var u=Object.create(null);function i(o){if(u[o])return u[o];for(var s=o,a,c=[],l=0;s;){if((a=e.text.exec(s))!==null)c.push(a[0]);else if((a=e.modulo.exec(s))!==null)c.push("%");else if((a=e.placeholder.exec(s))!==null){if(a[2]){l|=1;var f=[],p=a[2],h=[];if((h=e.key.exec(p))!==null)for(f.push(h[1]);(p=p.substring(h[0].length))!=="";)if((h=e.key_access.exec(p))!==null)f.push(h[1]);else if((h=e.index_access.exec(p))!==null)f.push(h[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");a[2]=f}else l|=2;if(l===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");c.push({placeholder:a[0],param_no:a[1],keys:a[2],sign:a[3],pad_char:a[4],align:a[5],width:a[6],precision:a[7],type:a[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");s=s.substring(a[0].length)}return u[o]=c}typeof GZ<"u"&&(GZ.sprintf=t,GZ.vsprintf=r),typeof window<"u"&&(window.sprintf=t,window.vsprintf=r,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:r}}))})()});var FCe=I(WZ=>{"use strict";Object.defineProperty(WZ,"__esModule",{value:!0});WZ.logLevels=void 0;var jAn={debug:20,error:50,fatal:60,info:30,trace:10,warn:40};WZ.logLevels=jAn});var YBt=I(HZ=>{"use strict";Object.defineProperty(HZ,"__esModule",{value:!0});HZ.default=void 0;var LAn=SCe(jZ()),NAn=SCe(xCe()),qAn=SCe(WBt()),_Ce=VBt(),HBt=FCe();function SCe(e){return e&&e.__esModule?e:{default:e}}function BCe(){return BCe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BCe.apply(this,arguments)}function KBt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),r.push.apply(r,n)}return r}function Xf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KBt(Object(r),!0).forEach(function(n){MAn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KBt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function MAn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var UAn=(0,NAn.default)(),fR;LAn.default&&(fR=require("domain"));var $An=()=>{if(!fR)return{};let e=[],t=process.domain;if(!t||!t.parentDomain)return{};for(;t&&t.parentDomain;)t=t.parentDomain,t.roarr&&t.roarr.context&&e.push(t.roarr.context);let r={};for(let n of e)r=Xf(Xf({},r),n);return r},VZ=()=>{if(!fR)return{};let e=process.domain;if(e&&e.roarr&&e.roarr.context)return e.roarr.context;if(!e||!e.parentDomain)return{};for(;e&&e.parentDomain;)if(e=e.parentDomain,e.roarr&&e.roarr.context)return e.roarr.context;return{}},wCe=(e,t)=>{let r=(n,u,i,o,s,a,c,l,f,p)=>{let h=Date.now(),d=UAn.ROARR.sequence++,m,v;if(typeof n=="string"){m=Xf(Xf({},VZ()),t||{});let y=BCe({},{a:n,b:u,c:i,d:o,e:s,f:a,g:c,h:l,i:f,k:p});v=Object.keys(y).map(E=>y[E]).reduce((E,b)=>E+=typeof b>"u"?0:1,0)===1?(0,_Ce.sprintf)("%s",n):(0,_Ce.sprintf)(n,u,i,o,s,a,c,l,f,p)}else{if(typeof u!="string")throw new TypeError("Message must be a string.");m=JSON.parse((0,qAn.default)(Xf(Xf(Xf({},VZ()),t||{}),n))),v=(0,_Ce.sprintf)(u,i,o,s,a,c,l,f,p)}e({context:m,message:v,sequence:d,time:h,version:"1.0.0"})};r.child=n=>typeof n=="function"?wCe(u=>{if(typeof n!="function")throw new TypeError("Unexpected state.");e(n(u))},t):wCe(e,Xf(Xf(Xf({},VZ()),t),n)),r.getContext=()=>Xf(Xf({},VZ()),t||{}),r.adopt=async(n,u)=>{if(!fR)return n();let i=fR.create();return i.run(()=>(i.roarr={context:Xf(Xf({},$An()),u)},n()))};for(let n of Object.keys(HBt.logLevels))r[n]=(u,i,o,s,a,c,l,f,p,h)=>r.child({logLevel:HBt.logLevels[n]})(u,i,o,s,a,c,l,f,p,h);return r},zAn=wCe;HZ.default=zAn});var QBt=I(KZ=>{"use strict";Object.defineProperty(KZ,"__esModule",{value:!0});KZ.default=void 0;var XBt=FCe(),JBt=(e,t)=>{let r=(n,u,i,o,s,a,c,l,f,p)=>{};r.adopt=async n=>n(),r.child=n=>JBt(e,t),r.getContext=()=>({});for(let n of Object.keys(XBt.logLevels))r[n]=(u,i,o,s,a,c,l,f,p,h)=>r.child({logLevel:XBt.logLevels[n]})(u,i,o,s,a,c,l,f,p,h);return r},GAn=JBt;KZ.default=GAn});var ewt=I((QMu,ZBt)=>{ZBt.exports=function(t,r){for(var n=t.split("."),u=r.split("."),i=0;i<3;i++){var o=Number(n[i]),s=Number(u[i]);if(o>s)return 1;if(s>o)return-1;if(!isNaN(o)&&isNaN(s))return 1;if(isNaN(o)&&!isNaN(s))return-1}return 0}});var twt=I((ZMu,WAn)=>{WAn.exports={author:{email:"gajus@gajus.com",name:"Gajus Kuizinas",url:"http://gajus.com"},ava:{babel:{compileAsTests:["test/helpers/**/*"]},files:["test/roarr/**/*"],require:["@babel/register"]},dependencies:{boolean:"^3.0.1","detect-node":"^2.0.4",globalthis:"^1.0.1","json-stringify-safe":"^5.0.1","semver-compare":"^1.0.0","sprintf-js":"^1.1.2"},description:"JSON logger for Node.js and browser.",devDependencies:{"@ava/babel":"^1.0.1","@babel/cli":"^7.11.6","@babel/core":"^7.11.6","@babel/node":"^7.10.5","@babel/plugin-transform-flow-strip-types":"^7.10.4","@babel/preset-env":"^7.11.5","@babel/register":"^7.11.5",ava:"^3.12.1","babel-plugin-istanbul":"^6.0.0","babel-plugin-transform-export-default-name":"^2.0.4",coveralls:"^3.1.0","domain-parent":"^1.0.0",eslint:"^7.9.0","eslint-config-canonical":"^24.1.1","flow-bin":"^0.133.0","flow-copy-source":"^2.0.9",gitdown:"^3.1.3",husky:"^4.3.0",nyc:"^15.1.0","semantic-release":"^17.1.1"},engines:{node:">=8.0"},husky:{hooks:{"pre-commit":"npm run lint && npm run test && npm run build","pre-push":"gitdown ./.README/README.md --output-file ./README.md --check"}},keywords:["log","logger","json"],main:"./dist/log.js",name:"roarr",nyc:{include:["src/**/*.js"],instrument:!1,reporter:["text-lcov"],require:["@babel/register"],sourceMap:!1},license:"BSD-3-Clause",repository:{type:"git",url:"git@github.com:gajus/roarr.git"},scripts:{build:"rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist","create-readme":"gitdown ./.README/README.md --output-file ./README.md",dev:"NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps --watch",lint:"eslint ./src ./test && flow",test:"NODE_ENV=test ava --serial --verbose"},version:"2.15.4"}});var rwt=I(YZ=>{"use strict";Object.defineProperty(YZ,"__esModule",{value:!0});YZ.default=void 0;var VAn=e=>({write:t=>{e.write(t+`
|
|
@@ -343,9 +343,9 @@ ${t}
|
|
|
343
343
|
`,t.proxy.authorization&&(u+="Proxy-Authorization: Basic "+Buffer.from(t.proxy.authorization).toString("base64")+`\r
|
|
344
344
|
`),u+=`\r
|
|
345
345
|
`,n.write(u)}},FFn=MCe;ree.default=FFn});var gwt=I(dR=>{"use strict";Object.defineProperty(dR,"__esModule",{value:!0});Object.defineProperty(dR,"Agent",{enumerable:!0,get:function(){return _Fn.default}});Object.defineProperty(dR,"HttpProxyAgent",{enumerable:!0,get:function(){return BFn.default}});Object.defineProperty(dR,"HttpsProxyAgent",{enumerable:!0,get:function(){return wFn.default}});var _Fn=$Ce(eee()),BFn=$Ce(dwt()),wFn=$Ce(mwt());function $Ce(e){return e&&e.__esModule?e:{default:e}}});var ywt=I((nee,Dwt)=>{"use strict";Object.defineProperty(nee,"__esModule",{value:!0});function SFn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vwt(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function OFn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function TFn(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var PFn=function(e){OFn(t,e);function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";SFn(this,t);var n=vwt(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,r));return Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:r,writable:!0}),Object.defineProperty(n,"name",{configurable:!0,enumerable:!1,value:n.constructor.name,writable:!0}),Error.hasOwnProperty("captureStackTrace")?(Error.captureStackTrace(n,n.constructor),vwt(n)):(Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,value:new Error(r).stack,writable:!0}),n)}return t}(TFn(Error));nee.default=PFn;Dwt.exports=nee.default});var iee=I(uee=>{"use strict";Object.defineProperty(uee,"__esModule",{value:!0});uee.UnexpectedStateError=void 0;var kFn=RFn(ywt());function RFn(e){return e&&e.__esModule?e:{default:e}}var zCe=class extends kFn.default{constructor(t,r="UNEXPECTED_STATE_ERROR"){super(t),this.code=r}};uee.UnexpectedStateError=zCe});var bwt=I(oee=>{"use strict";Object.defineProperty(oee,"__esModule",{value:!0});oee.default=void 0;var IFn=Ewt(require("http")),jFn=Ewt(require("https"));function Ewt(e){return e&&e.__esModule?e:{default:e}}var LFn=(e,t,r)=>(...n)=>{let u,i,o;return typeof n[0]=="string"||n[0]instanceof URL?(u=n[0],typeof n[1]=="function"?(i={},o=n[1]):(i={...n[1]},o=n[2])):(i={...n[0]},o=n[1]),r?i.agent=t:(i.agent||(i.agent=t),(i.agent===IFn.default.globalAgent||i.agent===jFn.default.globalAgent)&&(i.agent=t)),u?e(u,i,o):e(i,o)},NFn=LFn;oee.default=NFn});var xwt=I((pUu,Cwt)=>{"use strict";Cwt.exports=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}});var Fwt=I((hUu,WCe)=>{"use strict";var qFn=xwt(),GCe=new Map;function Awt(e,t){t={caseSensitive:!1,...t};let r=e+JSON.stringify(t);if(GCe.has(r))return GCe.get(r);let n=e[0]==="!";n&&(e=e.slice(1)),e=qFn(e).replace(/\\\*/g,"[\\s\\S]*");let u=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return u.negated=n,GCe.set(r,u),u}WCe.exports=(e,t,r)=>{if(!(Array.isArray(e)&&Array.isArray(t)))throw new TypeError(`Expected two arrays, got ${typeof e} ${typeof t}`);if(t.length===0)return e;let n=t[0][0]==="!";t=t.map(i=>Awt(i,r));let u=[];for(let i of e){let o=n;for(let s of t)s.test(i)&&(o=!s.negated);o&&u.push(i)}return u};WCe.exports.isMatch=(e,t,r)=>{let n=Array.isArray(e)?e:[e],u=Array.isArray(t)?t:[t];return n.some(i=>u.every(o=>{let s=Awt(o,r),a=s.test(i);return s.negated?!a:a}))}});var Bwt=I(see=>{"use strict";Object.defineProperty(see,"__esModule",{value:!0});see.default=void 0;var MFn=require("url"),UFn=$Fn(Fwt()),_wt=iee();function $Fn(e){return e&&e.__esModule?e:{default:e}}var zFn=(e,t)=>{let r=(0,MFn.parse)(e),n=t.split(/[\s,]+/);for(let u of n){let i=u.replace(/^(?<leadingDot>\.)/,"*").match(/^(?<hostname>.+?)(?::(?<port>\d+))?$/);if(!i||!i.groups)throw new _wt.UnexpectedStateError("Invalid NO_PROXY pattern.");if(!i.groups.hostname)throw new _wt.UnexpectedStateError("NO_PROXY entry pattern must include hostname. Use * to match any hostname.");if(UFn.default.isMatch(r.hostname,i.groups.hostname)&&(!i.groups||!i.groups.port||r.port&&r.port===i.groups.port))return!0}return!1},GFn=zFn;see.default=GFn});var wwt=I(aee=>{"use strict";Object.defineProperty(aee,"__esModule",{value:!0});aee.default=void 0;var WFn=require("url"),VCe=iee(),VFn=e=>{let t=(0,WFn.parse)(e);if(t.query!==null)throw new VCe.UnexpectedStateError("Unsupported `GLOBAL_AGENT.HTTP_PROXY` configuration value: URL must not have query.");if(t.hash!==null)throw new VCe.UnexpectedStateError("Unsupported `GLOBAL_AGENT.HTTP_PROXY` configuration value: URL must not have hash.");if(t.protocol!=="http:")throw new VCe.UnexpectedStateError('Unsupported `GLOBAL_AGENT.HTTP_PROXY` configuration value: URL protocol must be "http:".');let r=80;return t.port&&(r=Number.parseInt(t.port,10)),{authorization:t.auth||null,hostname:t.hostname,port:r}},HFn=VFn;aee.default=HFn});var Swt=I(mR=>{"use strict";Object.defineProperty(mR,"__esModule",{value:!0});Object.defineProperty(mR,"bindHttpMethod",{enumerable:!0,get:function(){return KFn.default}});Object.defineProperty(mR,"isUrlMatchingNoProxy",{enumerable:!0,get:function(){return YFn.default}});Object.defineProperty(mR,"parseProxyUrl",{enumerable:!0,get:function(){return XFn.default}});var KFn=HCe(bwt()),YFn=HCe(Bwt()),XFn=HCe(wwt());function HCe(e){return e&&e.__esModule?e:{default:e}}});var KCe=I(cee=>{"use strict";Object.defineProperty(cee,"__esModule",{value:!0});cee.default=void 0;var JFn=QFn(hR());function QFn(e){return e&&e.__esModule?e:{default:e}}var ZFn=JFn.default.child({namespace:"createProxyController"}),e_n=["HTTP_PROXY","HTTPS_PROXY","NO_PROXY"],t_n=()=>new Proxy({HTTP_PROXY:null,HTTPS_PROXY:null,NO_PROXY:null},{set:(e,t,r)=>{if(!e_n.includes(t))throw new Error('Cannot set an unmapped property "'+t+'".');return e[t]=r,ZFn.info({change:{name:t,value:r},newConfiguration:e},"configuration changed"),!0}}),r_n=t_n;cee.default=r_n});var Rwt=I(lee=>{"use strict";Object.defineProperty(lee,"__esModule",{value:!0});lee.default=void 0;var iA=gR(require("http")),oA=gR(require("https")),n_n=IZ(),Owt=gR(r3()),u_n=gR(hR()),Twt=gwt(),i_n=iee(),uA=Swt(),o_n=gR(KCe());function gR(e){return e&&e.__esModule?e:{default:e}}var s_n=iA.default.get,a_n=iA.default.request,c_n=oA.default.get,l_n=oA.default.request,Pwt=u_n.default.child({namespace:"createGlobalProxyAgent"}),kwt={environmentVariableNamespace:void 0,forceGlobalAgent:void 0,socketConnectionTimeout:6e4},f_n=e=>{let t=Object.keys(e),r={};for(let n of t){let u=e[n];u!==void 0&&(r[n]=u)}return r},p_n=e=>{let t=process.env;return{...{environmentVariableNamespace:typeof t.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE=="string"?t.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE:"GLOBAL_AGENT_",forceGlobalAgent:typeof t.GLOBAL_AGENT_FORCE_GLOBAL_AGENT=="string"?(0,n_n.boolean)(t.GLOBAL_AGENT_FORCE_GLOBAL_AGENT):!0,socketConnectionTimeout:typeof t.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT=="string"?Number.parseInt(t.GLOBAL_AGENT_SOCKET_CONNECTION_TIMEOUT,10):kwt.socketConnectionTimeout},...f_n(e)}},h_n=(e=kwt)=>{let t=p_n(e),r=(0,o_n.default)();r.HTTP_PROXY=process.env[t.environmentVariableNamespace+"HTTP_PROXY"]||null,r.HTTPS_PROXY=process.env[t.environmentVariableNamespace+"HTTPS_PROXY"]||null,r.NO_PROXY=process.env[t.environmentVariableNamespace+"NO_PROXY"]||null,Pwt.info({configuration:t,state:r},"global agent has been initialized");let n=f=>p=>f()?r.NO_PROXY?!(0,uA.isUrlMatchingNoProxy)(p,r.NO_PROXY):!0:!1,u=f=>()=>{let p=f();if(!p)throw new i_n.UnexpectedStateError("HTTP(S) proxy must be configured.");return(0,uA.parseProxyUrl)(p)},i=()=>r.HTTP_PROXY,o=class extends Twt.HttpProxyAgent{constructor(){super(()=>i(),n(i),u(i),iA.default.globalAgent,t.socketConnectionTimeout)}},s=new o,a=()=>r.HTTPS_PROXY||r.HTTP_PROXY,c=class extends Twt.HttpsProxyAgent{constructor(){super(()=>a(),n(a),u(a),oA.default.globalAgent,t.socketConnectionTimeout)}},l=new c;return Owt.default.gte(process.version,"v11.7.0")&&(iA.default.globalAgent=s,oA.default.globalAgent=l),Owt.default.gte(process.version,"v10.0.0")?(iA.default.get=(0,uA.bindHttpMethod)(s_n,s,t.forceGlobalAgent),iA.default.request=(0,uA.bindHttpMethod)(a_n,s,t.forceGlobalAgent),oA.default.get=(0,uA.bindHttpMethod)(c_n,l,t.forceGlobalAgent),oA.default.request=(0,uA.bindHttpMethod)(l_n,l,t.forceGlobalAgent)):Pwt.warn("attempt to initialize global-agent in unsupported Node.js version was ignored"),r},d_n=h_n;lee.default=d_n});var YCe=I(fee=>{"use strict";Object.defineProperty(fee,"__esModule",{value:!0});Object.defineProperty(fee,"createGlobalProxyAgent",{enumerable:!0,get:function(){return m_n.default}});Object.defineProperty(fee,"createProxyController",{enumerable:!0,get:function(){return g_n.default}});var m_n=Iwt(Rwt()),g_n=Iwt(KCe());function Iwt(e){return e&&e.__esModule?e:{default:e}}});var jwt=I(pee=>{"use strict";Object.defineProperty(pee,"__esModule",{value:!0});pee.default=void 0;var v_n=y_n(hR()),D_n=YCe();function y_n(e){return e&&e.__esModule?e:{default:e}}var E_n=v_n.default.child({namespace:"bootstrap"}),b_n=e=>global.GLOBAL_AGENT?(E_n.warn("found global.GLOBAL_AGENT; second attempt to bootstrap global-agent was ignored"),!1):(global.GLOBAL_AGENT=(0,D_n.createGlobalProxyAgent)(e),!0),C_n=b_n;pee.default=C_n});var Lwt=I(XCe=>{"use strict";Object.defineProperty(XCe,"__esModule",{value:!0});Object.defineProperty(XCe,"bootstrap",{enumerable:!0,get:function(){return x_n.default}});var x_n=A_n(jwt());function A_n(e){return e&&e.__esModule?e:{default:e}}});var Nwt=I(hee=>{"use strict";Object.defineProperty(hee,"__esModule",{value:!0});Object.defineProperty(hee,"bootstrap",{enumerable:!0,get:function(){return F_n.bootstrap}});Object.defineProperty(hee,"createGlobalProxyAgent",{enumerable:!0,get:function(){return __n.createGlobalProxyAgent}});var F_n=Lwt(),__n=YCe()});var dee,B_n,w_n,mee,qwt=Ft(()=>{dee=ot(xr()),B_n=Nwt(),w_n=()=>{if(!(0,dee.getGlobalConfig)("proxy_enable"))return;B_n.bootstrap();let t=(0,dee.getGlobalConfig)("http_proxy"),r=(0,dee.getGlobalConfig)("https_proxy");t&&(global.GLOBAL_AGENT.HTTP_PROXY=t),r&&(global.GLOBAL_AGENT.HTTPS_PROXY=r),process.env.NODE_TLS_REJECT_UNAUTHORIZED="0"},mee=w_n});function vR(e,t){if(e===t)return 0;let r=e;e.length>t.length&&(e=t,t=r);let n=e.length,u=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-u);)n--,u--;let i=0;for(;i<n&&e.charCodeAt(i)===t.charCodeAt(i);)i++;if(n-=i,u-=i,n===0)return u;let o,s,a,c,l=0,f=0;for(;l<n;)Mwt[l]=e.charCodeAt(i+l),JCe[l]=++l;for(;f<u;)for(o=t.charCodeAt(i+f),a=f++,s=f,l=0;l<n;l++)c=o===Mwt[l]?a:a+1,a=JCe[l],s=JCe[l]=a>s?c>s?s+1:c:c>a?a+1:c;return s}var JCe,Mwt,Uwt=Ft(()=>{JCe=[],Mwt=[]});var $wt,S_n,I2,zwt=Ft(()=>{pr();Uwt();$wt=ot(ir());tv();S_n=e=>{e.on("command:*",([t])=>{let r=e.commands.map(u=>(0,$wt.get)(u,"_name")),n="";r.forEach(u=>{let i=vR(u,t)<vR(n,t);vR(u,t)<=3&&i&&(n=u)}),new nR(`Unknown command ${dt.yellow(t)}.`,n&&`Did you mean ${dt.yellow(n)}?`),process.env.NODE_ENV!=="test"&&process.exit(1)})},I2=S_n});var vee,s3,QCe,gee,Gwt,O_n,Jf,Wwt=Ft(()=>{vee=ot(xr()),s3=ot(ir()),QCe=ot(Si());mx();gee=ot(ch()),Gwt=ot(i7e()),O_n=e=>{if((0,s3.isEmpty)(e))return;let t=process.argv.slice(2),r=vee.parseArgv(t),n=(0,s3.get)(r,"output-file");if(!n)return;let u=vee.getAbsolutePath(n),i=(0,s3.get)(r,"output")||(0,s3.get)(r,"output-format"),o={[gee.IOutput.JSON]:JSON.stringify(e,null,2),[gee.IOutput.YAML]:qd.dump(e),[gee.IOutput.RAW]:JSON.stringify(e)},s=Gwt.default.render(e,{keysColor:"bold",emptyArrayMsg:"[]"});QCe.default.writeFileSync(u,(0,s3.get)(o,i,s),"utf-8"),QCe.default.appendFileSync(u,`
|
|
346
|
-
`)},Jf=O_n});var Dee=I((kUu,Ywt)=>{"use strict";Ywt.exports=Hwt;function Hwt(e,t,r){e instanceof RegExp&&(e=Vwt(e,r)),t instanceof RegExp&&(t=Vwt(t,r));var n=Kwt(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}function Vwt(e,t){var r=t.match(e);return r?r[0]:null}Hwt.range=Kwt;function Kwt(e,t,r){var n,u,i,o,s,a=r.indexOf(e),c=r.indexOf(t,a+1),l=a;if(a>=0&&c>0){if(e===t)return[a,c];for(n=[],i=r.length;l>=0&&!s;)l==a?(n.push(l),a=r.indexOf(e,l+1)):n.length==1?s=[n.pop(),c]:(u=n.pop(),u<i&&(i=u,o=c),c=r.indexOf(t,l+1)),l=a<c&&a>=0?a:c;n.length&&(s=[i,o])}return s}});var yee=I((RUu,rSt)=>{var Xwt=Dee();rSt.exports=k_n;var Jwt="\0SLASH"+Math.random()+"\0",Qwt="\0OPEN"+Math.random()+"\0",exe="\0CLOSE"+Math.random()+"\0",Zwt="\0COMMA"+Math.random()+"\0",eSt="\0PERIOD"+Math.random()+"\0";function ZCe(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function T_n(e){return e.split("\\\\").join(Jwt).split("\\{").join(Qwt).split("\\}").join(exe).split("\\,").join(Zwt).split("\\.").join(eSt)}function P_n(e){return e.split(Jwt).join("\\").split(Qwt).join("{").split(exe).join("}").split(Zwt).join(",").split(eSt).join(".")}function tSt(e){if(!e)return[""];var t=[],r=Xwt("{","}",e);if(!r)return e.split(",");var n=r.pre,u=r.body,i=r.post,o=n.split(",");o[o.length-1]+="{"+u+"}";var s=tSt(i);return i.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function k_n(e){return e?(e.substr(0,2)==="{}"&&(e="\\{\\}"+e.substr(2)),DR(T_n(e),!0).map(P_n)):[]}function R_n(e){return"{"+e+"}"}function I_n(e){return/^-?0\d/.test(e)}function j_n(e,t){return e<=t}function L_n(e,t){return e>=t}function DR(e,t){var r=[],n=Xwt("{","}",e);if(!n)return[e];var u=n.pre,i=n.post.length?DR(n.post,!1):[""];if(/\$$/.test(n.pre))for(var o=0;o<i.length;o++){var s=u+"{"+n.body+"}"+i[o];r.push(s)}else{var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),l=a||c,f=n.body.indexOf(",")>=0;if(!l&&!f)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+exe+n.post,DR(e)):[e];var p;if(l)p=n.body.split(/\.\./);else if(p=tSt(n.body),p.length===1&&(p=DR(p[0],!1).map(R_n),p.length===1))return i.map(function(S){return n.pre+p[0]+S});var h;if(l){var d=ZCe(p[0]),m=ZCe(p[1]),v=Math.max(p[0].length,p[1].length),y=p.length==3?Math.abs(ZCe(p[2])):1,g=j_n,D=m<d;D&&(y*=-1,g=L_n);var E=p.some(I_n);h=[];for(var b=d;g(b,m);b+=y){var C;if(c)C=String.fromCharCode(b),C==="\\"&&(C="");else if(C=String(b),E){var x=v-C.length;if(x>0){var F=new Array(x+1).join("0");b<0?C="-"+F+C.slice(1):C=F+C}}h.push(C)}}else{h=[];for(var A=0;A<p.length;A++)h.push.apply(h,DR(p[A],!1))}for(var A=0;A<h.length;A++)for(var o=0;o<i.length;o++){var s=u+h[A]+i[o];(!t||l||s)&&r.push(s)}}return r}});var nSt=I(Eee=>{"use strict";Object.defineProperty(Eee,"__esModule",{value:!0});Eee.assertValidPattern=void 0;var N_n=1024*64,q_n=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>N_n)throw new TypeError("pattern is too long")};Eee.assertValidPattern=q_n});var iSt=I(bee=>{"use strict";Object.defineProperty(bee,"__esModule",{value:!0});bee.parseClass=void 0;var M_n={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},yR=e=>e.replace(/[[\]\\-]/g,"\\$&"),U_n=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),uSt=e=>e.join(""),$_n=(e,t)=>{let r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],u=[],i=r+1,o=!1,s=!1,a=!1,c=!1,l=r,f="";e:for(;i<e.length;){let m=e.charAt(i);if((m==="!"||m==="^")&&i===r+1){c=!0,i++;continue}if(m==="]"&&o&&!a){l=i+1;break}if(o=!0,m==="\\"&&!a){a=!0,i++;continue}if(m==="["&&!a){for(let[v,[y,g,D]]of Object.entries(M_n))if(e.startsWith(v,i)){if(f)return["$.",!1,e.length-r,!0];i+=v.length,D?u.push(y):n.push(y),s=s||g;continue e}}if(a=!1,f){m>f?n.push(yR(f)+"-"+yR(m)):m===f&&n.push(yR(m)),f="",i++;continue}if(e.startsWith("-]",i+1)){n.push(yR(m+"-")),i+=2;continue}if(e.startsWith("-",i+1)){f=m,i+=2;continue}n.push(yR(m)),i++}if(l<i)return["",!1,0,!1];if(!n.length&&!u.length)return["$.",!1,e.length-r,!0];if(u.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!c){let m=n[0].length===2?n[0].slice(-1):n[0];return[U_n(m),!1,l-r,!1]}let p="["+(c?"^":"")+uSt(n)+"]",h="["+(c?"":"^")+uSt(u)+"]";return[n.length&&u.length?"("+p+"|"+h+")":n.length?p:h,s,l-r,!0]};bee.parseClass=$_n});var xee=I(Cee=>{"use strict";Object.defineProperty(Cee,"__esModule",{value:!0});Cee.unescape=void 0;var z_n=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Cee.unescape=z_n});var uxe=I(See=>{"use strict";Object.defineProperty(See,"__esModule",{value:!0});See.AST=void 0;var G_n=iSt(),Aee=xee(),W_n=new Set(["!","?","+","*","@"]),oSt=e=>W_n.has(e),V_n="(?!(?:^|/)\\.\\.?(?:$|/))",Fee="(?!\\.)",H_n=new Set(["[","."]),K_n=new Set(["..","."]),Y_n=new Set("().*{}+?[]^$\\!"),X_n=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),nxe="[^/]",sSt=nxe+"*?",aSt=nxe+"+?",Ws,ba,Z5,Zi,Cs,rv,a3,nv,j2,c3,ER,Bee,cSt,sA,_ee,bR,rxe,wee,lSt,ol=class ol{constructor(t,r,n={}){Rt(this,Bee);Rt(this,bR);Cn(this,"type");Rt(this,Ws,void 0);Rt(this,ba,void 0);Rt(this,Z5,!1);Rt(this,Zi,[]);Rt(this,Cs,void 0);Rt(this,rv,void 0);Rt(this,a3,void 0);Rt(this,nv,!1);Rt(this,j2,void 0);Rt(this,c3,void 0);Rt(this,ER,!1);this.type=t,t&&Bt(this,ba,!0),Bt(this,Cs,r),Bt(this,Ws,be(this,Cs)?be(be(this,Cs),Ws):this),Bt(this,j2,be(this,Ws)===this?n:be(be(this,Ws),j2)),Bt(this,a3,be(this,Ws)===this?[]:be(be(this,Ws),a3)),t==="!"&&!be(be(this,Ws),nv)&&be(this,a3).push(this),Bt(this,rv,be(this,Cs)?be(be(this,Cs),Zi).length:0)}get hasMagic(){if(be(this,ba)!==void 0)return be(this,ba);for(let t of be(this,Zi))if(typeof t!="string"&&(t.type||t.hasMagic))return Bt(this,ba,!0);return be(this,ba)}toString(){return be(this,c3)!==void 0?be(this,c3):this.type?Bt(this,c3,this.type+"("+be(this,Zi).map(t=>String(t)).join("|")+")"):Bt(this,c3,be(this,Zi).map(t=>String(t)).join(""))}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof ol&&be(r,Cs)===this))throw new Error("invalid part: "+r);be(this,Zi).push(r)}}toJSON(){var r;let t=this.type===null?be(this,Zi).slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...be(this,Zi).map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===be(this,Ws)||be(be(this,Ws),nv)&&((r=be(this,Cs))==null?void 0:r.type)==="!")&&t.push({}),t}isStart(){var r;if(be(this,Ws)===this)return!0;if(!((r=be(this,Cs))!=null&&r.isStart()))return!1;if(be(this,rv)===0)return!0;let t=be(this,Cs);for(let n=0;n<be(this,rv);n++){let u=be(t,Zi)[n];if(!(u instanceof ol&&u.type==="!"))return!1}return!0}isEnd(){var r,n,u;if(be(this,Ws)===this||((r=be(this,Cs))==null?void 0:r.type)==="!")return!0;if(!((n=be(this,Cs))!=null&&n.isEnd()))return!1;if(!this.type)return(u=be(this,Cs))==null?void 0:u.isEnd();let t=be(this,Cs)?be(be(this,Cs),Zi).length:0;return be(this,rv)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let r=new ol(this.type,t);for(let n of be(this,Zi))r.copyIn(n);return r}static fromGlob(t,r={}){var u;let n=new ol(null,void 0,r);return qt(u=ol,sA,_ee).call(u,t,n,0,r),n}toMMPattern(){if(this!==be(this,Ws))return be(this,Ws).toMMPattern();let t=this.toString(),[r,n,u,i]=this.toRegExpSource();if(!(u||be(this,ba)||be(this,j2).nocase&&!be(this,j2).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let s=(be(this,j2).nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${r}$`,s),{_src:r,_glob:t})}get options(){return be(this,j2)}toRegExpSource(t){var a;let r=t!=null?t:!!be(this,j2).dot;if(be(this,Ws)===this&&qt(this,Bee,cSt).call(this),!this.type){let c=this.isStart()&&this.isEnd(),l=be(this,Zi).map(d=>{var D;let[m,v,y,g]=typeof d=="string"?qt(D=ol,wee,lSt).call(D,d,be(this,ba),c):d.toRegExpSource(t);return Bt(this,ba,be(this,ba)||y),Bt(this,Z5,be(this,Z5)||g),m}).join(""),f="";if(this.isStart()&&typeof be(this,Zi)[0]=="string"&&!(be(this,Zi).length===1&&K_n.has(be(this,Zi)[0]))){let m=H_n,v=r&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),y=!r&&!t&&m.has(l.charAt(0));f=v?V_n:y?Fee:""}let p="";return this.isEnd()&&be(be(this,Ws),nv)&&((a=be(this,Cs))==null?void 0:a.type)==="!"&&(p="(?:$|\\/)"),[f+l+p,(0,Aee.unescape)(l),Bt(this,ba,!!be(this,ba)),be(this,Z5)]}let n=this.type==="*"||this.type==="+",u=this.type==="!"?"(?:(?!(?:":"(?:",i=qt(this,bR,rxe).call(this,r);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let c=this.toString();return Bt(this,Zi,[c]),this.type=null,Bt(this,ba,void 0),[c,(0,Aee.unescape)(this.toString()),!1,!1]}let o=!n||t||r||!Fee?"":qt(this,bR,rxe).call(this,!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let s="";if(this.type==="!"&&be(this,ER))s=(this.isStart()&&!r?Fee:"")+aSt;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Fee:"")+sSt+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;s=u+i+c}return[s,(0,Aee.unescape)(i),Bt(this,ba,!!be(this,ba)),be(this,Z5)]}};Ws=new WeakMap,ba=new WeakMap,Z5=new WeakMap,Zi=new WeakMap,Cs=new WeakMap,rv=new WeakMap,a3=new WeakMap,nv=new WeakMap,j2=new WeakMap,c3=new WeakMap,ER=new WeakMap,Bee=new WeakSet,cSt=function(){if(this!==be(this,Ws))throw new Error("should only call on root");if(be(this,nv))return this;this.toString(),Bt(this,nv,!0);let t;for(;t=be(this,a3).pop();){if(t.type!=="!")continue;let r=t,n=be(r,Cs);for(;n;){for(let u=be(r,rv)+1;!n.type&&u<be(n,Zi).length;u++)for(let i of be(t,Zi)){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(be(n,Zi)[u])}r=n,n=be(r,Cs)}}return this},sA=new WeakSet,_ee=function(t,r,n,u){var h,d;let i=!1,o=!1,s=-1,a=!1;if(r.type===null){let m=n,v="";for(;m<t.length;){let y=t.charAt(m++);if(i||y==="\\"){i=!i,v+=y;continue}if(o){m===s+1?(y==="^"||y==="!")&&(a=!0):y==="]"&&!(m===s+2&&a)&&(o=!1),v+=y;continue}else if(y==="["){o=!0,s=m,a=!1,v+=y;continue}if(!u.noext&&oSt(y)&&t.charAt(m)==="("){r.push(v),v="";let g=new ol(y,r);m=qt(h=ol,sA,_ee).call(h,t,g,m,u),r.push(g);continue}v+=y}return r.push(v),m}let c=n+1,l=new ol(null,r),f=[],p="";for(;c<t.length;){let m=t.charAt(c++);if(i||m==="\\"){i=!i,p+=m;continue}if(o){c===s+1?(m==="^"||m==="!")&&(a=!0):m==="]"&&!(c===s+2&&a)&&(o=!1),p+=m;continue}else if(m==="["){o=!0,s=c,a=!1,p+=m;continue}if(oSt(m)&&t.charAt(c)==="("){l.push(p),p="";let v=new ol(m,l);l.push(v),c=qt(d=ol,sA,_ee).call(d,t,v,c,u);continue}if(m==="|"){l.push(p),p="",f.push(l),l=new ol(null,r);continue}if(m===")")return p===""&&be(r,Zi).length===0&&Bt(r,ER,!0),l.push(p),p="",r.push(...f,l),c;p+=m}return r.type=null,Bt(r,ba,void 0),Bt(r,Zi,[t.substring(n-1)]),c},bR=new WeakSet,rxe=function(t){return be(this,Zi).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,u,i,o]=r.toRegExpSource(t);return Bt(this,Z5,be(this,Z5)||o),n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")},wee=new WeakSet,lSt=function(t,r,n=!1){let u=!1,i="",o=!1;for(let s=0;s<t.length;s++){let a=t.charAt(s);if(u){u=!1,i+=(Y_n.has(a)?"\\":"")+a;continue}if(a==="\\"){s===t.length-1?i+="\\\\":u=!0;continue}if(a==="["){let[c,l,f,p]=(0,G_n.parseClass)(t,s);if(f){i+=c,o=o||l,s+=f-1,r=r||p;continue}}if(a==="*"){n&&t==="*"?i+=aSt:i+=sSt,r=!0;continue}if(a==="?"){i+=nxe,r=!0;continue}i+=X_n(a)}return[i,(0,Aee.unescape)(t),!!r,o]},Rt(ol,sA),Rt(ol,wee);var txe=ol;See.AST=txe});var ixe=I(Oee=>{"use strict";Object.defineProperty(Oee,"__esModule",{value:!0});Oee.escape=void 0;var J_n=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");Oee.escape=J_n});var uv=I(br=>{"use strict";var Q_n=br&&br.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(br,"__esModule",{value:!0});br.unescape=br.escape=br.AST=br.Minimatch=br.match=br.makeRe=br.braceExpand=br.defaults=br.filter=br.GLOBSTAR=br.sep=br.minimatch=void 0;var Z_n=Q_n(yee()),Tee=nSt(),hSt=uxe(),eBn=ixe(),tBn=xee(),rBn=(e,t,r={})=>((0,Tee.assertValidPattern)(t),!r.nocomment&&t.charAt(0)==="#"?!1:new l3(t,r).match(e));br.minimatch=rBn;var nBn=/^\*+([^+@!?\*\[\(]*)$/,uBn=e=>t=>!t.startsWith(".")&&t.endsWith(e),iBn=e=>t=>t.endsWith(e),oBn=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),sBn=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),aBn=/^\*+\.\*+$/,cBn=e=>!e.startsWith(".")&&e.includes("."),lBn=e=>e!=="."&&e!==".."&&e.includes("."),fBn=/^\.\*+$/,pBn=e=>e!=="."&&e!==".."&&e.startsWith("."),hBn=/^\*+$/,dBn=e=>e.length!==0&&!e.startsWith("."),mBn=e=>e.length!==0&&e!=="."&&e!=="..",gBn=/^\?+([^+@!?\*\[\(]*)?$/,vBn=([e,t=""])=>{let r=dSt([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},DBn=([e,t=""])=>{let r=mSt([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},yBn=([e,t=""])=>{let r=mSt([e]);return t?n=>r(n)&&n.endsWith(t):r},EBn=([e,t=""])=>{let r=dSt([e]);return t?n=>r(n)&&n.endsWith(t):r},dSt=([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},mSt=([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},gSt=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",fSt={win32:{sep:"\\"},posix:{sep:"/"}};br.sep=gSt==="win32"?fSt.win32.sep:fSt.posix.sep;br.minimatch.sep=br.sep;br.GLOBSTAR=Symbol("globstar **");br.minimatch.GLOBSTAR=br.GLOBSTAR;var bBn="[^/]",CBn=bBn+"*?",xBn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ABn="(?:(?!(?:\\/|^)\\.).)*?",FBn=(e,t={})=>r=>(0,br.minimatch)(r,e,t);br.filter=FBn;br.minimatch.filter=br.filter;var yh=(e,t={})=>Object.assign({},e,t),_Bn=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return br.minimatch;let t=br.minimatch;return Object.assign((n,u,i={})=>t(n,u,yh(e,i)),{Minimatch:class extends t.Minimatch{constructor(u,i={}){super(u,yh(e,i))}static defaults(u){return t.defaults(yh(e,u)).Minimatch}},AST:class extends t.AST{constructor(u,i,o={}){super(u,i,yh(e,o))}static fromGlob(u,i={}){return t.AST.fromGlob(u,yh(e,i))}},unescape:(n,u={})=>t.unescape(n,yh(e,u)),escape:(n,u={})=>t.escape(n,yh(e,u)),filter:(n,u={})=>t.filter(n,yh(e,u)),defaults:n=>t.defaults(yh(e,n)),makeRe:(n,u={})=>t.makeRe(n,yh(e,u)),braceExpand:(n,u={})=>t.braceExpand(n,yh(e,u)),match:(n,u,i={})=>t.match(n,u,yh(e,i)),sep:t.sep,GLOBSTAR:br.GLOBSTAR})};br.defaults=_Bn;br.minimatch.defaults=br.defaults;var BBn=(e,t={})=>((0,Tee.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,Z_n.default)(e));br.braceExpand=BBn;br.minimatch.braceExpand=br.braceExpand;var wBn=(e,t={})=>new l3(e,t).makeRe();br.makeRe=wBn;br.minimatch.makeRe=br.makeRe;var SBn=(e,t,r={})=>{let n=new l3(t,r);return e=e.filter(u=>n.match(u)),n.options.nonull&&!e.length&&e.push(t),e};br.match=SBn;br.minimatch.match=br.match;var pSt=/[?*]|[+@!]\(.*?\)|\[|\]/,OBn=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),l3=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,r={}){(0,Tee.assertValidPattern)(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||gSt,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let u=this.globParts.map((i,o,s)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=i[0]===""&&i[1]===""&&(i[2]==="?"||!pSt.test(i[2]))&&!pSt.test(i[3]),c=/^[a-z]:/i.test(i[0]);if(a)return[...i.slice(0,4),...i.slice(4).map(l=>this.parse(l))];if(c)return[i[0],...i.slice(1).map(l=>this.parse(l))]}return i.map(a=>this.parse(a))});if(this.debug(this.pattern,u),this.set=u.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let u=0;u<t[n].length;u++)t[n][u]==="**"&&(t[n][u]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let u=n;for(;r[u+1]==="**";)u++;u!==n&&r.splice(n,u-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,u)=>{let i=n[n.length-1];return u==="**"&&i==="**"?n:u===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(n.pop(),n):(n.push(u),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let u=1;u<t.length-1;u++){let i=t[u];u===1&&i===""&&t[0]===""||(i==="."||i==="")&&(r=!0,t.splice(u,1),u--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){let u=t[n-1];u&&u!=="."&&u!==".."&&u!=="**"&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let u=-1;for(;(u=n.indexOf("**",u+1))!==-1;){let o=u;for(;n[o+1]==="**";)o++;o>u&&n.splice(u+1,o-u);let s=n[u+1],a=n[u+2],c=n[u+3];if(s!==".."||!a||a==="."||a===".."||!c||c==="."||c==="..")continue;r=!0,n.splice(u,1);let l=n.slice(0);l[u]="**",t.push(l),u--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let s=n[o];o===1&&s===""&&n[0]===""||(s==="."||s==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let i=0;for(;(i=n.indexOf("..",i+1))!==-1;){let o=n[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let a=i===1&&n[i+1]==="**"?["."]:[];n.splice(i-1,2,...a),n.length===0&&n.push(""),i-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){let u=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);u&&(t[r]=u,t[n]=[])}return t.filter(r=>r.length)}partsMatch(t,r,n=!1){let u=0,i=0,o=[],s="";for(;u<t.length&&i<r.length;)if(t[u]===r[i])o.push(s==="b"?r[i]:t[u]),u++,i++;else if(n&&t[u]==="**"&&r[i]===t[u+1])o.push(t[u]),u++;else if(n&&r[i]==="**"&&t[u]===r[i+1])o.push(r[i]),i++;else if(t[u]==="*"&&r[i]&&(this.options.dot||!r[i].startsWith("."))&&r[i]!=="**"){if(s==="b")return!1;s="a",o.push(t[u]),u++,i++}else if(r[i]==="*"&&t[u]&&(this.options.dot||!t[u].startsWith("."))&&t[u]!=="**"){if(s==="a")return!1;s="b",o.push(r[i]),u++,i++}else return!1;return t.length===r.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,r=!1,n=0;for(let u=0;u<t.length&&t.charAt(u)==="!";u++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r,n=!1){let u=this.options;if(this.isWindows){let m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),y=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),g=!y&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),D=v?3:m?0:void 0,E=g?3:y?0:void 0;if(typeof D=="number"&&typeof E=="number"){let[b,C]=[t[D],r[E]];b.toLowerCase()===C.toLowerCase()&&(r[E]=b,E>D?r=r.slice(E):D>E&&(t=t.slice(D)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:r}),this.debug("matchOne",t.length,r.length);for(var o=0,s=0,a=t.length,c=r.length;o<a&&s<c;o++,s++){this.debug("matchOne loop");var l=r[s],f=t[o];if(this.debug(r,l,f),l===!1)return!1;if(l===br.GLOBSTAR){this.debug("GLOBSTAR",[r,l,f]);var p=o,h=s+1;if(h===c){for(this.debug("** at the end");o<a;o++)if(t[o]==="."||t[o]===".."||!u.dot&&t[o].charAt(0)===".")return!1;return!0}for(;p<a;){var d=t[p];if(this.debug(`
|
|
346
|
+
`)},Jf=O_n});var Dee=I((kUu,Ywt)=>{"use strict";Ywt.exports=Hwt;function Hwt(e,t,r){e instanceof RegExp&&(e=Vwt(e,r)),t instanceof RegExp&&(t=Vwt(t,r));var n=Kwt(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}function Vwt(e,t){var r=t.match(e);return r?r[0]:null}Hwt.range=Kwt;function Kwt(e,t,r){var n,u,i,o,s,a=r.indexOf(e),c=r.indexOf(t,a+1),l=a;if(a>=0&&c>0){if(e===t)return[a,c];for(n=[],i=r.length;l>=0&&!s;)l==a?(n.push(l),a=r.indexOf(e,l+1)):n.length==1?s=[n.pop(),c]:(u=n.pop(),u<i&&(i=u,o=c),c=r.indexOf(t,l+1)),l=a<c&&a>=0?a:c;n.length&&(s=[i,o])}return s}});var yee=I((RUu,rSt)=>{var Xwt=Dee();rSt.exports=k_n;var Jwt="\0SLASH"+Math.random()+"\0",Qwt="\0OPEN"+Math.random()+"\0",exe="\0CLOSE"+Math.random()+"\0",Zwt="\0COMMA"+Math.random()+"\0",eSt="\0PERIOD"+Math.random()+"\0";function ZCe(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function T_n(e){return e.split("\\\\").join(Jwt).split("\\{").join(Qwt).split("\\}").join(exe).split("\\,").join(Zwt).split("\\.").join(eSt)}function P_n(e){return e.split(Jwt).join("\\").split(Qwt).join("{").split(exe).join("}").split(Zwt).join(",").split(eSt).join(".")}function tSt(e){if(!e)return[""];var t=[],r=Xwt("{","}",e);if(!r)return e.split(",");var n=r.pre,u=r.body,i=r.post,o=n.split(",");o[o.length-1]+="{"+u+"}";var s=tSt(i);return i.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function k_n(e){return e?(e.substr(0,2)==="{}"&&(e="\\{\\}"+e.substr(2)),DR(T_n(e),!0).map(P_n)):[]}function R_n(e){return"{"+e+"}"}function I_n(e){return/^-?0\d/.test(e)}function j_n(e,t){return e<=t}function L_n(e,t){return e>=t}function DR(e,t){var r=[],n=Xwt("{","}",e);if(!n)return[e];var u=n.pre,i=n.post.length?DR(n.post,!1):[""];if(/\$$/.test(n.pre))for(var o=0;o<i.length;o++){var s=u+"{"+n.body+"}"+i[o];r.push(s)}else{var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),l=a||c,f=n.body.indexOf(",")>=0;if(!l&&!f)return n.post.match(/,.*\}/)?(e=n.pre+"{"+n.body+exe+n.post,DR(e)):[e];var p;if(l)p=n.body.split(/\.\./);else if(p=tSt(n.body),p.length===1&&(p=DR(p[0],!1).map(R_n),p.length===1))return i.map(function(S){return n.pre+p[0]+S});var h;if(l){var d=ZCe(p[0]),m=ZCe(p[1]),v=Math.max(p[0].length,p[1].length),y=p.length==3?Math.abs(ZCe(p[2])):1,g=j_n,D=m<d;D&&(y*=-1,g=L_n);var E=p.some(I_n);h=[];for(var b=d;g(b,m);b+=y){var C;if(c)C=String.fromCharCode(b),C==="\\"&&(C="");else if(C=String(b),E){var x=v-C.length;if(x>0){var F=new Array(x+1).join("0");b<0?C="-"+F+C.slice(1):C=F+C}}h.push(C)}}else{h=[];for(var A=0;A<p.length;A++)h.push.apply(h,DR(p[A],!1))}for(var A=0;A<h.length;A++)for(var o=0;o<i.length;o++){var s=u+h[A]+i[o];(!t||l||s)&&r.push(s)}}return r}});var nSt=I(Eee=>{"use strict";Object.defineProperty(Eee,"__esModule",{value:!0});Eee.assertValidPattern=void 0;var N_n=1024*64,q_n=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>N_n)throw new TypeError("pattern is too long")};Eee.assertValidPattern=q_n});var iSt=I(bee=>{"use strict";Object.defineProperty(bee,"__esModule",{value:!0});bee.parseClass=void 0;var M_n={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},yR=e=>e.replace(/[[\]\\-]/g,"\\$&"),U_n=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),uSt=e=>e.join(""),$_n=(e,t)=>{let r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],u=[],i=r+1,o=!1,s=!1,a=!1,c=!1,l=r,f="";e:for(;i<e.length;){let m=e.charAt(i);if((m==="!"||m==="^")&&i===r+1){c=!0,i++;continue}if(m==="]"&&o&&!a){l=i+1;break}if(o=!0,m==="\\"&&!a){a=!0,i++;continue}if(m==="["&&!a){for(let[v,[y,g,D]]of Object.entries(M_n))if(e.startsWith(v,i)){if(f)return["$.",!1,e.length-r,!0];i+=v.length,D?u.push(y):n.push(y),s=s||g;continue e}}if(a=!1,f){m>f?n.push(yR(f)+"-"+yR(m)):m===f&&n.push(yR(m)),f="",i++;continue}if(e.startsWith("-]",i+1)){n.push(yR(m+"-")),i+=2;continue}if(e.startsWith("-",i+1)){f=m,i+=2;continue}n.push(yR(m)),i++}if(l<i)return["",!1,0,!1];if(!n.length&&!u.length)return["$.",!1,e.length-r,!0];if(u.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!c){let m=n[0].length===2?n[0].slice(-1):n[0];return[U_n(m),!1,l-r,!1]}let p="["+(c?"^":"")+uSt(n)+"]",h="["+(c?"":"^")+uSt(u)+"]";return[n.length&&u.length?"("+p+"|"+h+")":n.length?p:h,s,l-r,!0]};bee.parseClass=$_n});var xee=I(Cee=>{"use strict";Object.defineProperty(Cee,"__esModule",{value:!0});Cee.unescape=void 0;var z_n=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Cee.unescape=z_n});var uxe=I(See=>{"use strict";Object.defineProperty(See,"__esModule",{value:!0});See.AST=void 0;var G_n=iSt(),Aee=xee(),W_n=new Set(["!","?","+","*","@"]),oSt=e=>W_n.has(e),V_n="(?!(?:^|/)\\.\\.?(?:$|/))",Fee="(?!\\.)",H_n=new Set(["[","."]),K_n=new Set(["..","."]),Y_n=new Set("().*{}+?[]^$\\!"),X_n=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),nxe="[^/]",sSt=nxe+"*?",aSt=nxe+"+?",Ws,ba,Z5,Zi,Cs,rv,a3,nv,j2,c3,ER,Bee,cSt,sA,_ee,bR,rxe,wee,lSt,ol=class ol{constructor(t,r,n={}){Rt(this,Bee);Rt(this,bR);Cn(this,"type");Rt(this,Ws,void 0);Rt(this,ba,void 0);Rt(this,Z5,!1);Rt(this,Zi,[]);Rt(this,Cs,void 0);Rt(this,rv,void 0);Rt(this,a3,void 0);Rt(this,nv,!1);Rt(this,j2,void 0);Rt(this,c3,void 0);Rt(this,ER,!1);this.type=t,t&&Bt(this,ba,!0),Bt(this,Cs,r),Bt(this,Ws,be(this,Cs)?be(be(this,Cs),Ws):this),Bt(this,j2,be(this,Ws)===this?n:be(be(this,Ws),j2)),Bt(this,a3,be(this,Ws)===this?[]:be(be(this,Ws),a3)),t==="!"&&!be(be(this,Ws),nv)&&be(this,a3).push(this),Bt(this,rv,be(this,Cs)?be(be(this,Cs),Zi).length:0)}get hasMagic(){if(be(this,ba)!==void 0)return be(this,ba);for(let t of be(this,Zi))if(typeof t!="string"&&(t.type||t.hasMagic))return Bt(this,ba,!0);return be(this,ba)}toString(){return be(this,c3)!==void 0?be(this,c3):this.type?Bt(this,c3,this.type+"("+be(this,Zi).map(t=>String(t)).join("|")+")"):Bt(this,c3,be(this,Zi).map(t=>String(t)).join(""))}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof ol&&be(r,Cs)===this))throw new Error("invalid part: "+r);be(this,Zi).push(r)}}toJSON(){var r;let t=this.type===null?be(this,Zi).slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...be(this,Zi).map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===be(this,Ws)||be(be(this,Ws),nv)&&((r=be(this,Cs))==null?void 0:r.type)==="!")&&t.push({}),t}isStart(){var r;if(be(this,Ws)===this)return!0;if(!((r=be(this,Cs))!=null&&r.isStart()))return!1;if(be(this,rv)===0)return!0;let t=be(this,Cs);for(let n=0;n<be(this,rv);n++){let u=be(t,Zi)[n];if(!(u instanceof ol&&u.type==="!"))return!1}return!0}isEnd(){var r,n,u;if(be(this,Ws)===this||((r=be(this,Cs))==null?void 0:r.type)==="!")return!0;if(!((n=be(this,Cs))!=null&&n.isEnd()))return!1;if(!this.type)return(u=be(this,Cs))==null?void 0:u.isEnd();let t=be(this,Cs)?be(be(this,Cs),Zi).length:0;return be(this,rv)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let r=new ol(this.type,t);for(let n of be(this,Zi))r.copyIn(n);return r}static fromGlob(t,r={}){var u;let n=new ol(null,void 0,r);return qt(u=ol,sA,_ee).call(u,t,n,0,r),n}toMMPattern(){if(this!==be(this,Ws))return be(this,Ws).toMMPattern();let t=this.toString(),[r,n,u,i]=this.toRegExpSource();if(!(u||be(this,ba)||be(this,j2).nocase&&!be(this,j2).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let s=(be(this,j2).nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${r}$`,s),{_src:r,_glob:t})}get options(){return be(this,j2)}toRegExpSource(t){var a;let r=t!=null?t:!!be(this,j2).dot;if(be(this,Ws)===this&&qt(this,Bee,cSt).call(this),!this.type){let c=this.isStart()&&this.isEnd(),l=be(this,Zi).map(d=>{var D;let[m,v,y,g]=typeof d=="string"?qt(D=ol,wee,lSt).call(D,d,be(this,ba),c):d.toRegExpSource(t);return Bt(this,ba,be(this,ba)||y),Bt(this,Z5,be(this,Z5)||g),m}).join(""),f="";if(this.isStart()&&typeof be(this,Zi)[0]=="string"&&!(be(this,Zi).length===1&&K_n.has(be(this,Zi)[0]))){let m=H_n,v=r&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),y=!r&&!t&&m.has(l.charAt(0));f=v?V_n:y?Fee:""}let p="";return this.isEnd()&&be(be(this,Ws),nv)&&((a=be(this,Cs))==null?void 0:a.type)==="!"&&(p="(?:$|\\/)"),[f+l+p,(0,Aee.unescape)(l),Bt(this,ba,!!be(this,ba)),be(this,Z5)]}let n=this.type==="*"||this.type==="+",u=this.type==="!"?"(?:(?!(?:":"(?:",i=qt(this,bR,rxe).call(this,r);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let c=this.toString();return Bt(this,Zi,[c]),this.type=null,Bt(this,ba,void 0),[c,(0,Aee.unescape)(this.toString()),!1,!1]}let o=!n||t||r||!Fee?"":qt(this,bR,rxe).call(this,!0);o===i&&(o=""),o&&(i=`(?:${i})(?:${o})*?`);let s="";if(this.type==="!"&&be(this,ER))s=(this.isStart()&&!r?Fee:"")+aSt;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Fee:"")+sSt+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;s=u+i+c}return[s,(0,Aee.unescape)(i),Bt(this,ba,!!be(this,ba)),be(this,Z5)]}};Ws=new WeakMap,ba=new WeakMap,Z5=new WeakMap,Zi=new WeakMap,Cs=new WeakMap,rv=new WeakMap,a3=new WeakMap,nv=new WeakMap,j2=new WeakMap,c3=new WeakMap,ER=new WeakMap,Bee=new WeakSet,cSt=function(){if(this!==be(this,Ws))throw new Error("should only call on root");if(be(this,nv))return this;this.toString(),Bt(this,nv,!0);let t;for(;t=be(this,a3).pop();){if(t.type!=="!")continue;let r=t,n=be(r,Cs);for(;n;){for(let u=be(r,rv)+1;!n.type&&u<be(n,Zi).length;u++)for(let i of be(t,Zi)){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(be(n,Zi)[u])}r=n,n=be(r,Cs)}}return this},sA=new WeakSet,_ee=function(t,r,n,u){var h,d;let i=!1,o=!1,s=-1,a=!1;if(r.type===null){let m=n,v="";for(;m<t.length;){let y=t.charAt(m++);if(i||y==="\\"){i=!i,v+=y;continue}if(o){m===s+1?(y==="^"||y==="!")&&(a=!0):y==="]"&&!(m===s+2&&a)&&(o=!1),v+=y;continue}else if(y==="["){o=!0,s=m,a=!1,v+=y;continue}if(!u.noext&&oSt(y)&&t.charAt(m)==="("){r.push(v),v="";let g=new ol(y,r);m=qt(h=ol,sA,_ee).call(h,t,g,m,u),r.push(g);continue}v+=y}return r.push(v),m}let c=n+1,l=new ol(null,r),f=[],p="";for(;c<t.length;){let m=t.charAt(c++);if(i||m==="\\"){i=!i,p+=m;continue}if(o){c===s+1?(m==="^"||m==="!")&&(a=!0):m==="]"&&!(c===s+2&&a)&&(o=!1),p+=m;continue}else if(m==="["){o=!0,s=c,a=!1,p+=m;continue}if(oSt(m)&&t.charAt(c)==="("){l.push(p),p="";let v=new ol(m,l);l.push(v),c=qt(d=ol,sA,_ee).call(d,t,v,c,u);continue}if(m==="|"){l.push(p),p="",f.push(l),l=new ol(null,r);continue}if(m===")")return p===""&&be(r,Zi).length===0&&Bt(r,ER,!0),l.push(p),p="",r.push(...f,l),c;p+=m}return r.type=null,Bt(r,ba,void 0),Bt(r,Zi,[t.substring(n-1)]),c},bR=new WeakSet,rxe=function(t){return be(this,Zi).map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,u,i,o]=r.toRegExpSource(t);return Bt(this,Z5,be(this,Z5)||o),n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")},wee=new WeakSet,lSt=function(t,r,n=!1){let u=!1,i="",o=!1;for(let s=0;s<t.length;s++){let a=t.charAt(s);if(u){u=!1,i+=(Y_n.has(a)?"\\":"")+a;continue}if(a==="\\"){s===t.length-1?i+="\\\\":u=!0;continue}if(a==="["){let[c,l,f,p]=(0,G_n.parseClass)(t,s);if(f){i+=c,o=o||l,s+=f-1,r=r||p;continue}}if(a==="*"){n&&t==="*"?i+=aSt:i+=sSt,r=!0;continue}if(a==="?"){i+=nxe,r=!0;continue}i+=X_n(a)}return[i,(0,Aee.unescape)(t),!!r,o]},Rt(ol,sA),Rt(ol,wee);var txe=ol;See.AST=txe});var ixe=I(Oee=>{"use strict";Object.defineProperty(Oee,"__esModule",{value:!0});Oee.escape=void 0;var J_n=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");Oee.escape=J_n});var uv=I(Cr=>{"use strict";var Q_n=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.unescape=Cr.escape=Cr.AST=Cr.Minimatch=Cr.match=Cr.makeRe=Cr.braceExpand=Cr.defaults=Cr.filter=Cr.GLOBSTAR=Cr.sep=Cr.minimatch=void 0;var Z_n=Q_n(yee()),Tee=nSt(),hSt=uxe(),eBn=ixe(),tBn=xee(),rBn=(e,t,r={})=>((0,Tee.assertValidPattern)(t),!r.nocomment&&t.charAt(0)==="#"?!1:new l3(t,r).match(e));Cr.minimatch=rBn;var nBn=/^\*+([^+@!?\*\[\(]*)$/,uBn=e=>t=>!t.startsWith(".")&&t.endsWith(e),iBn=e=>t=>t.endsWith(e),oBn=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),sBn=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),aBn=/^\*+\.\*+$/,cBn=e=>!e.startsWith(".")&&e.includes("."),lBn=e=>e!=="."&&e!==".."&&e.includes("."),fBn=/^\.\*+$/,pBn=e=>e!=="."&&e!==".."&&e.startsWith("."),hBn=/^\*+$/,dBn=e=>e.length!==0&&!e.startsWith("."),mBn=e=>e.length!==0&&e!=="."&&e!=="..",gBn=/^\?+([^+@!?\*\[\(]*)?$/,vBn=([e,t=""])=>{let r=dSt([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},DBn=([e,t=""])=>{let r=mSt([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},yBn=([e,t=""])=>{let r=mSt([e]);return t?n=>r(n)&&n.endsWith(t):r},EBn=([e,t=""])=>{let r=dSt([e]);return t?n=>r(n)&&n.endsWith(t):r},dSt=([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},mSt=([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},gSt=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",fSt={win32:{sep:"\\"},posix:{sep:"/"}};Cr.sep=gSt==="win32"?fSt.win32.sep:fSt.posix.sep;Cr.minimatch.sep=Cr.sep;Cr.GLOBSTAR=Symbol("globstar **");Cr.minimatch.GLOBSTAR=Cr.GLOBSTAR;var bBn="[^/]",CBn=bBn+"*?",xBn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ABn="(?:(?!(?:\\/|^)\\.).)*?",FBn=(e,t={})=>r=>(0,Cr.minimatch)(r,e,t);Cr.filter=FBn;Cr.minimatch.filter=Cr.filter;var yh=(e,t={})=>Object.assign({},e,t),_Bn=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Cr.minimatch;let t=Cr.minimatch;return Object.assign((n,u,i={})=>t(n,u,yh(e,i)),{Minimatch:class extends t.Minimatch{constructor(u,i={}){super(u,yh(e,i))}static defaults(u){return t.defaults(yh(e,u)).Minimatch}},AST:class extends t.AST{constructor(u,i,o={}){super(u,i,yh(e,o))}static fromGlob(u,i={}){return t.AST.fromGlob(u,yh(e,i))}},unescape:(n,u={})=>t.unescape(n,yh(e,u)),escape:(n,u={})=>t.escape(n,yh(e,u)),filter:(n,u={})=>t.filter(n,yh(e,u)),defaults:n=>t.defaults(yh(e,n)),makeRe:(n,u={})=>t.makeRe(n,yh(e,u)),braceExpand:(n,u={})=>t.braceExpand(n,yh(e,u)),match:(n,u,i={})=>t.match(n,u,yh(e,i)),sep:t.sep,GLOBSTAR:Cr.GLOBSTAR})};Cr.defaults=_Bn;Cr.minimatch.defaults=Cr.defaults;var BBn=(e,t={})=>((0,Tee.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,Z_n.default)(e));Cr.braceExpand=BBn;Cr.minimatch.braceExpand=Cr.braceExpand;var wBn=(e,t={})=>new l3(e,t).makeRe();Cr.makeRe=wBn;Cr.minimatch.makeRe=Cr.makeRe;var SBn=(e,t,r={})=>{let n=new l3(t,r);return e=e.filter(u=>n.match(u)),n.options.nonull&&!e.length&&e.push(t),e};Cr.match=SBn;Cr.minimatch.match=Cr.match;var pSt=/[?*]|[+@!]\(.*?\)|\[|\]/,OBn=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),l3=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,r={}){(0,Tee.assertValidPattern)(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||gSt,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let u=this.globParts.map((i,o,s)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=i[0]===""&&i[1]===""&&(i[2]==="?"||!pSt.test(i[2]))&&!pSt.test(i[3]),c=/^[a-z]:/i.test(i[0]);if(a)return[...i.slice(0,4),...i.slice(4).map(l=>this.parse(l))];if(c)return[i[0],...i.slice(1).map(l=>this.parse(l))]}return i.map(a=>this.parse(a))});if(this.debug(this.pattern,u),this.set=u.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let o=this.set[i];o[0]===""&&o[1]===""&&this.globParts[i][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let u=0;u<t[n].length;u++)t[n][u]==="**"&&(t[n][u]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let u=n;for(;r[u+1]==="**";)u++;u!==n&&r.splice(n,u-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,u)=>{let i=n[n.length-1];return u==="**"&&i==="**"?n:u===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(n.pop(),n):(n.push(u),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let u=1;u<t.length-1;u++){let i=t[u];u===1&&i===""&&t[0]===""||(i==="."||i==="")&&(r=!0,t.splice(u,1),u--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){let u=t[n-1];u&&u!=="."&&u!==".."&&u!=="**"&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let u=-1;for(;(u=n.indexOf("**",u+1))!==-1;){let o=u;for(;n[o+1]==="**";)o++;o>u&&n.splice(u+1,o-u);let s=n[u+1],a=n[u+2],c=n[u+3];if(s!==".."||!a||a==="."||a===".."||!c||c==="."||c==="..")continue;r=!0,n.splice(u,1);let l=n.slice(0);l[u]="**",t.push(l),u--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let s=n[o];o===1&&s===""&&n[0]===""||(s==="."||s==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let i=0;for(;(i=n.indexOf("..",i+1))!==-1;){let o=n[i-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let a=i===1&&n[i+1]==="**"?["."]:[];n.splice(i-1,2,...a),n.length===0&&n.push(""),i-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){let u=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);u&&(t[r]=u,t[n]=[])}return t.filter(r=>r.length)}partsMatch(t,r,n=!1){let u=0,i=0,o=[],s="";for(;u<t.length&&i<r.length;)if(t[u]===r[i])o.push(s==="b"?r[i]:t[u]),u++,i++;else if(n&&t[u]==="**"&&r[i]===t[u+1])o.push(t[u]),u++;else if(n&&r[i]==="**"&&t[u]===r[i+1])o.push(r[i]),i++;else if(t[u]==="*"&&r[i]&&(this.options.dot||!r[i].startsWith("."))&&r[i]!=="**"){if(s==="b")return!1;s="a",o.push(t[u]),u++,i++}else if(r[i]==="*"&&t[u]&&(this.options.dot||!t[u].startsWith("."))&&t[u]!=="**"){if(s==="a")return!1;s="b",o.push(r[i]),u++,i++}else return!1;return t.length===r.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,r=!1,n=0;for(let u=0;u<t.length&&t.charAt(u)==="!";u++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r,n=!1){let u=this.options;if(this.isWindows){let m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),y=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),g=!y&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),D=v?3:m?0:void 0,E=g?3:y?0:void 0;if(typeof D=="number"&&typeof E=="number"){let[b,C]=[t[D],r[E]];b.toLowerCase()===C.toLowerCase()&&(r[E]=b,E>D?r=r.slice(E):D>E&&(t=t.slice(D)))}}let{optimizationLevel:i=1}=this.options;i>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:r}),this.debug("matchOne",t.length,r.length);for(var o=0,s=0,a=t.length,c=r.length;o<a&&s<c;o++,s++){this.debug("matchOne loop");var l=r[s],f=t[o];if(this.debug(r,l,f),l===!1)return!1;if(l===Cr.GLOBSTAR){this.debug("GLOBSTAR",[r,l,f]);var p=o,h=s+1;if(h===c){for(this.debug("** at the end");o<a;o++)if(t[o]==="."||t[o]===".."||!u.dot&&t[o].charAt(0)===".")return!1;return!0}for(;p<a;){var d=t[p];if(this.debug(`
|
|
347
347
|
globstar while`,t,p,r,h,d),this.matchOne(t.slice(p),r.slice(h),n))return this.debug("globstar found match!",p,a,d),!0;if(d==="."||d===".."||!u.dot&&d.charAt(0)==="."){this.debug("dot detected!",t,p,r,h);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(n&&(this.debug(`
|
|
348
|
-
>>> no match, partial?`,t,p,r,h),p===a))}let m;if(typeof l=="string"?(m=f===l,this.debug("string match",l,f,m)):(m=l.test(f),this.debug("pattern match",l,f,m)),!m)return!1}if(o===a&&s===c)return!0;if(o===a)return n;if(s===c)return o===a-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return(0,br.braceExpand)(this.pattern,this.options)}parse(t){(0,Tee.assertValidPattern)(t);let r=this.options;if(t==="**")return br.GLOBSTAR;if(t==="")return"";let n,u=null;(n=t.match(hBn))?u=r.dot?mBn:dBn:(n=t.match(nBn))?u=(r.nocase?r.dot?sBn:oBn:r.dot?iBn:uBn)(n[1]):(n=t.match(gBn))?u=(r.nocase?r.dot?DBn:vBn:r.dot?yBn:EBn)(n):(n=t.match(aBn))?u=r.dot?lBn:cBn:(n=t.match(fBn))&&(u=pBn);let i=hSt.AST.fromGlob(t,this.options).toMMPattern();return u&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:u}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?CBn:r.dot?xBn:ABn,u=new Set(r.nocase?["i"]:[]),i=t.map(a=>{let c=a.map(l=>{if(l instanceof RegExp)for(let f of l.flags.split(""))u.add(f);return typeof l=="string"?OBn(l):l===br.GLOBSTAR?br.GLOBSTAR:l._src});return c.forEach((l,f)=>{let p=c[f+1],h=c[f-1];l!==br.GLOBSTAR||h===br.GLOBSTAR||(h===void 0?p!==void 0&&p!==br.GLOBSTAR?c[f+1]="(?:\\/|"+n+"\\/)?"+p:c[f]=n:p===void 0?c[f-1]=h+"(?:\\/|"+n+")?":p!==br.GLOBSTAR&&(c[f-1]=h+"(?:\\/|\\/"+n+"\\/)"+p,c[f+1]=br.GLOBSTAR))}),c.filter(l=>l!==br.GLOBSTAR).join("/")}).join("|"),[o,s]=t.length>1?["(?:",")"]:["",""];i="^"+o+i+s+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...u].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let n=this.options;this.isWindows&&(t=t.split("\\").join("/"));let u=this.slashSplit(t);this.debug(this.pattern,"split",u);let i=this.set;this.debug(this.pattern,"set",i);let o=u[u.length-1];if(!o)for(let s=u.length-2;!o&&s>=0;s--)o=u[s];for(let s=0;s<i.length;s++){let a=i[s],c=u;if(n.matchBase&&a.length===1&&(c=[o]),this.matchOne(c,a,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return br.minimatch.defaults(t).Minimatch}};br.Minimatch=l3;var TBn=uxe();Object.defineProperty(br,"AST",{enumerable:!0,get:function(){return TBn.AST}});var PBn=ixe();Object.defineProperty(br,"escape",{enumerable:!0,get:function(){return PBn.escape}});var kBn=xee();Object.defineProperty(br,"unescape",{enumerable:!0,get:function(){return kBn.unescape}});br.minimatch.AST=hSt.AST;br.minimatch.Minimatch=l3;br.minimatch.escape=eBn.escape;br.minimatch.unescape=tBn.unescape});var xSt=I(jee=>{"use strict";Object.defineProperty(jee,"__esModule",{value:!0});jee.LRUCache=void 0;var aA=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ySt=new Set,oxe=typeof process=="object"&&process?process:{},ESt=(e,t,r,n)=>{typeof oxe.emitWarning=="function"?oxe.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},Ree=globalThis.AbortController,vSt=globalThis.AbortSignal,DSt;if(typeof Ree>"u"){vSt=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,u){this._onabort.push(u)}},Ree=class{constructor(){t()}signal=new vSt;abort(n){var u,i;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let o of this.signal._onabort)o(n);(i=(u=this.signal).onabort)==null||i.call(u,n)}}};let e=((DSt=oxe.env)==null?void 0:DSt.LRU_CACHE_IGNORE_AC_WARNING)!=="1",t=()=>{e&&(e=!1,ESt("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",t))}}var RBn=e=>!ySt.has(e),VUu=Symbol("type"),iv=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),bSt=e=>iv(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?cA:null:null,cA=class extends Array{constructor(t){super(t),this.fill(0)}},sxe=class e{heap;length;static#e=!1;static create(t){let r=bSt(t);if(!r)return[];e.#e=!0;let n=new e(t,r);return e.#e=!1,n}constructor(t,r){if(!e.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Hd,Q0,Kd,Yd,lA,Vs,Xd,xs,Mi,yn,Jl,Z0,sl,Ca,Jd,xa,Qd,Zd,ep,e1,av,Ql,xR,cxe,f3,eg,AR,tp,Iee,CSt,p3,fA,FR,L2,ov,N2,sv,_R,lxe,IBn,pA,Pee,hA,kee,mi,qi,BR,fxe,h3,CR,pxe=class pxe{constructor(t){Rt(this,xR);Rt(this,Iee);Rt(this,L2);Rt(this,N2);Rt(this,_R);Rt(this,pA);Rt(this,hA);Rt(this,mi);Rt(this,BR);Rt(this,h3);Rt(this,Hd,void 0);Rt(this,Q0,void 0);Rt(this,Kd,void 0);Rt(this,Yd,void 0);Rt(this,lA,void 0);Cn(this,"ttl");Cn(this,"ttlResolution");Cn(this,"ttlAutopurge");Cn(this,"updateAgeOnGet");Cn(this,"updateAgeOnHas");Cn(this,"allowStale");Cn(this,"noDisposeOnSet");Cn(this,"noUpdateTTL");Cn(this,"maxEntrySize");Cn(this,"sizeCalculation");Cn(this,"noDeleteOnFetchRejection");Cn(this,"noDeleteOnStaleGet");Cn(this,"allowStaleOnFetchAbort");Cn(this,"allowStaleOnFetchRejection");Cn(this,"ignoreFetchAbort");Rt(this,Vs,void 0);Rt(this,Xd,void 0);Rt(this,xs,void 0);Rt(this,Mi,void 0);Rt(this,yn,void 0);Rt(this,Jl,void 0);Rt(this,Z0,void 0);Rt(this,sl,void 0);Rt(this,Ca,void 0);Rt(this,Jd,void 0);Rt(this,xa,void 0);Rt(this,Qd,void 0);Rt(this,Zd,void 0);Rt(this,ep,void 0);Rt(this,e1,void 0);Rt(this,av,void 0);Rt(this,Ql,void 0);Rt(this,f3,()=>{});Rt(this,eg,()=>{});Rt(this,AR,()=>{});Rt(this,tp,()=>!1);Rt(this,p3,t=>{});Rt(this,fA,(t,r,n)=>{});Rt(this,FR,(t,r,n,u)=>{if(n||u)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Cn(this,IBn,"LRUCache");let{max:r=0,ttl:n,ttlResolution:u=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:l,noDisposeOnSet:f,noUpdateTTL:p,maxSize:h=0,maxEntrySize:d=0,sizeCalculation:m,fetchMethod:v,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:g,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:E,ignoreFetchAbort:b}=t;if(r!==0&&!iv(r))throw new TypeError("max option must be a nonnegative integer");let C=r?bSt(r):Array;if(!C)throw new Error("invalid max value: "+r);if(Bt(this,Hd,r),Bt(this,Q0,h),this.maxEntrySize=d||be(this,Q0),this.sizeCalculation=m,this.sizeCalculation){if(!be(this,Q0)&&!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(v!==void 0&&typeof v!="function")throw new TypeError("fetchMethod must be a function if specified");if(Bt(this,lA,v),Bt(this,av,!!v),Bt(this,xs,new Map),Bt(this,Mi,new Array(r).fill(void 0)),Bt(this,yn,new Array(r).fill(void 0)),Bt(this,Jl,new C(r)),Bt(this,Z0,new C(r)),Bt(this,sl,0),Bt(this,Ca,0),Bt(this,Jd,sxe.create(r)),Bt(this,Vs,0),Bt(this,Xd,0),typeof c=="function"&&Bt(this,Kd,c),typeof l=="function"?(Bt(this,Yd,l),Bt(this,xa,[])):(Bt(this,Yd,void 0),Bt(this,xa,void 0)),Bt(this,e1,!!be(this,Kd)),Bt(this,Ql,!!be(this,Yd)),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!D,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!b,this.maxEntrySize!==0){if(be(this,Q0)!==0&&!iv(be(this,Q0)))throw new TypeError("maxSize must be a positive integer if specified");if(!iv(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");qt(this,Iee,CSt).call(this)}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!g,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=iv(u)||u===0?u:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!iv(this.ttl))throw new TypeError("ttl must be a positive integer if specified");qt(this,xR,cxe).call(this)}if(be(this,Hd)===0&&this.ttl===0&&be(this,Q0)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!be(this,Hd)&&!be(this,Q0)){let x="LRU_CACHE_UNBOUNDED";RBn(x)&&(ySt.add(x),ESt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,pxe))}}static unsafeExposeInternals(t){return{starts:be(t,Zd),ttls:be(t,ep),sizes:be(t,Qd),keyMap:be(t,xs),keyList:be(t,Mi),valList:be(t,yn),next:be(t,Jl),prev:be(t,Z0),get head(){return be(t,sl)},get tail(){return be(t,Ca)},free:be(t,Jd),isBackgroundFetch:r=>{var n;return qt(n=t,mi,qi).call(n,r)},backgroundFetch:(r,n,u,i)=>{var o;return qt(o=t,hA,kee).call(o,r,n,u,i)},moveToTail:r=>{var n;return qt(n=t,h3,CR).call(n,r)},indexes:r=>{var n;return qt(n=t,L2,ov).call(n,r)},rindexes:r=>{var n;return qt(n=t,N2,sv).call(n,r)},isStale:r=>{var n;return be(n=t,tp).call(n,r)}}}get max(){return be(this,Hd)}get maxSize(){return be(this,Q0)}get calculatedSize(){return be(this,Xd)}get size(){return be(this,Vs)}get fetchMethod(){return be(this,lA)}get dispose(){return be(this,Kd)}get disposeAfter(){return be(this,Yd)}getRemainingTTL(t){return be(this,xs).has(t)?1/0:0}*entries(){for(let t of qt(this,L2,ov).call(this))be(this,yn)[t]!==void 0&&be(this,Mi)[t]!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield[be(this,Mi)[t],be(this,yn)[t]])}*rentries(){for(let t of qt(this,N2,sv).call(this))be(this,yn)[t]!==void 0&&be(this,Mi)[t]!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield[be(this,Mi)[t],be(this,yn)[t]])}*keys(){for(let t of qt(this,L2,ov).call(this)){let r=be(this,Mi)[t];r!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield r)}}*rkeys(){for(let t of qt(this,N2,sv).call(this)){let r=be(this,Mi)[t];r!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield r)}}*values(){for(let t of qt(this,L2,ov).call(this))be(this,yn)[t]!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield be(this,yn)[t])}*rvalues(){for(let t of qt(this,N2,sv).call(this))be(this,yn)[t]!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield be(this,yn)[t])}[Symbol.iterator](){return this.entries()}find(t,r={}){for(let n of qt(this,L2,ov).call(this)){let u=be(this,yn)[n],i=qt(this,mi,qi).call(this,u)?u.__staleWhileFetching:u;if(i!==void 0&&t(i,be(this,Mi)[n],this))return this.get(be(this,Mi)[n],r)}}forEach(t,r=this){for(let n of qt(this,L2,ov).call(this)){let u=be(this,yn)[n],i=qt(this,mi,qi).call(this,u)?u.__staleWhileFetching:u;i!==void 0&&t.call(r,i,be(this,Mi)[n],this)}}rforEach(t,r=this){for(let n of qt(this,N2,sv).call(this)){let u=be(this,yn)[n],i=qt(this,mi,qi).call(this,u)?u.__staleWhileFetching:u;i!==void 0&&t.call(r,i,be(this,Mi)[n],this)}}purgeStale(){let t=!1;for(let r of qt(this,N2,sv).call(this,{allowStale:!0}))be(this,tp).call(this,r)&&(this.delete(be(this,Mi)[r]),t=!0);return t}info(t){let r=be(this,xs).get(t);if(r===void 0)return;let n=be(this,yn)[r],u=qt(this,mi,qi).call(this,n)?n.__staleWhileFetching:n;if(u===void 0)return;let i={value:u};if(be(this,ep)&&be(this,Zd)){let o=be(this,ep)[r],s=be(this,Zd)[r];if(o&&s){let a=o-(aA.now()-s);i.ttl=a,i.start=Date.now()}}return be(this,Qd)&&(i.size=be(this,Qd)[r]),i}dump(){let t=[];for(let r of qt(this,L2,ov).call(this,{allowStale:!0})){let n=be(this,Mi)[r],u=be(this,yn)[r],i=qt(this,mi,qi).call(this,u)?u.__staleWhileFetching:u;if(i===void 0||n===void 0)continue;let o={value:i};if(be(this,ep)&&be(this,Zd)){o.ttl=be(this,ep)[r];let s=aA.now()-be(this,Zd)[r];o.start=Math.floor(Date.now()-s)}be(this,Qd)&&(o.size=be(this,Qd)[r]),t.unshift([n,o])}return t}load(t){this.clear();for(let[r,n]of t){if(n.start){let u=Date.now()-n.start;n.start=aA.now()-u}this.set(r,n.value,n)}}set(t,r,n={}){var p,h,d,m,v;if(r===void 0)return this.delete(t),this;let{ttl:u=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=be(this,FR).call(this,t,r,n.size||0,s);if(this.maxEntrySize&&l>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.delete(t),this;let f=be(this,Vs)===0?void 0:be(this,xs).get(t);if(f===void 0)f=be(this,Vs)===0?be(this,Ca):be(this,Jd).length!==0?be(this,Jd).pop():be(this,Vs)===be(this,Hd)?qt(this,pA,Pee).call(this,!1):be(this,Vs),be(this,Mi)[f]=t,be(this,yn)[f]=r,be(this,xs).set(t,f),be(this,Jl)[be(this,Ca)]=f,be(this,Z0)[f]=be(this,Ca),Bt(this,Ca,f),UU(this,Vs)._++,be(this,fA).call(this,f,l,a),a&&(a.set="add"),c=!1;else{qt(this,h3,CR).call(this,f);let y=be(this,yn)[f];if(r!==y){if(be(this,av)&&qt(this,mi,qi).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=y;g!==void 0&&!o&&(be(this,e1)&&((p=be(this,Kd))==null||p.call(this,g,t,"set")),be(this,Ql)&&((h=be(this,xa))==null||h.push([g,t,"set"])))}else o||(be(this,e1)&&((d=be(this,Kd))==null||d.call(this,y,t,"set")),be(this,Ql)&&((m=be(this,xa))==null||m.push([y,t,"set"])));if(be(this,p3).call(this,f),be(this,fA).call(this,f,l,a),be(this,yn)[f]=r,a){a.set="replace";let g=y&&qt(this,mi,qi).call(this,y)?y.__staleWhileFetching:y;g!==void 0&&(a.oldValue=g)}}else a&&(a.set="update")}if(u!==0&&!be(this,ep)&&qt(this,xR,cxe).call(this),be(this,ep)&&(c||be(this,AR).call(this,f,u,i),a&&be(this,eg).call(this,a,f)),!o&&be(this,Ql)&&be(this,xa)){let y=be(this,xa),g;for(;g=y==null?void 0:y.shift();)(v=be(this,Yd))==null||v.call(this,...g)}return this}pop(){var t;try{for(;be(this,Vs);){let r=be(this,yn)[be(this,sl)];if(qt(this,pA,Pee).call(this,!0),qt(this,mi,qi).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(be(this,Ql)&&be(this,xa)){let r=be(this,xa),n;for(;n=r==null?void 0:r.shift();)(t=be(this,Yd))==null||t.call(this,...n)}}}has(t,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:u}=r,i=be(this,xs).get(t);if(i!==void 0){let o=be(this,yn)[i];if(qt(this,mi,qi).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(be(this,tp).call(this,i))u&&(u.has="stale",be(this,eg).call(this,u,i));else return n&&be(this,f3).call(this,i),u&&(u.has="hit",be(this,eg).call(this,u,i)),!0}else u&&(u.has="miss");return!1}peek(t,r={}){let{allowStale:n=this.allowStale}=r,u=be(this,xs).get(t);if(u===void 0||!n&&be(this,tp).call(this,u))return;let i=be(this,yn)[u];return qt(this,mi,qi).call(this,i)?i.__staleWhileFetching:i}async fetch(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:u=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:m,forceRefresh:v=!1,status:y,signal:g}=r;if(!be(this,av))return y&&(y.fetch="get"),this.get(t,{allowStale:n,updateAgeOnGet:u,noDeleteOnStaleGet:i,status:y});let D={allowStale:n,updateAgeOnGet:u,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:d,ignoreFetchAbort:h,status:y,signal:g},E=be(this,xs).get(t);if(E===void 0){y&&(y.fetch="miss");let b=qt(this,hA,kee).call(this,t,E,D,m);return b.__returned=b}else{let b=be(this,yn)[E];if(qt(this,mi,qi).call(this,b)){let S=n&&b.__staleWhileFetching!==void 0;return y&&(y.fetch="inflight",S&&(y.returnedStale=!0)),S?b.__staleWhileFetching:b.__returned=b}let C=be(this,tp).call(this,E);if(!v&&!C)return y&&(y.fetch="hit"),qt(this,h3,CR).call(this,E),u&&be(this,f3).call(this,E),y&&be(this,eg).call(this,y,E),b;let x=qt(this,hA,kee).call(this,t,E,D,m),A=x.__staleWhileFetching!==void 0&&n;return y&&(y.fetch=C?"stale":"refresh",A&&C&&(y.returnedStale=!0)),A?x.__staleWhileFetching:x.__returned=x}}get(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:u=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,s=be(this,xs).get(t);if(s!==void 0){let a=be(this,yn)[s],c=qt(this,mi,qi).call(this,a);return o&&be(this,eg).call(this,o,s),be(this,tp).call(this,s)?(o&&(o.get="stale"),c?(o&&n&&a.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?a.__staleWhileFetching:void 0):(i||this.delete(t),o&&n&&(o.returnedStale=!0),n?a:void 0)):(o&&(o.get="hit"),c?a.__staleWhileFetching:(qt(this,h3,CR).call(this,s),u&&be(this,f3).call(this,s),a))}else o&&(o.get="miss")}delete(t){var n,u,i,o;let r=!1;if(be(this,Vs)!==0){let s=be(this,xs).get(t);if(s!==void 0)if(r=!0,be(this,Vs)===1)this.clear();else{be(this,p3).call(this,s);let a=be(this,yn)[s];if(qt(this,mi,qi).call(this,a)?a.__abortController.abort(new Error("deleted")):(be(this,e1)||be(this,Ql))&&(be(this,e1)&&((n=be(this,Kd))==null||n.call(this,a,t,"delete")),be(this,Ql)&&((u=be(this,xa))==null||u.push([a,t,"delete"]))),be(this,xs).delete(t),be(this,Mi)[s]=void 0,be(this,yn)[s]=void 0,s===be(this,Ca))Bt(this,Ca,be(this,Z0)[s]);else if(s===be(this,sl))Bt(this,sl,be(this,Jl)[s]);else{let c=be(this,Z0)[s];be(this,Jl)[c]=be(this,Jl)[s];let l=be(this,Jl)[s];be(this,Z0)[l]=be(this,Z0)[s]}UU(this,Vs)._--,be(this,Jd).push(s)}}if(be(this,Ql)&&((i=be(this,xa))!=null&&i.length)){let s=be(this,xa),a;for(;a=s==null?void 0:s.shift();)(o=be(this,Yd))==null||o.call(this,...a)}return r}clear(){var t,r,n;for(let u of qt(this,N2,sv).call(this,{allowStale:!0})){let i=be(this,yn)[u];if(qt(this,mi,qi).call(this,i))i.__abortController.abort(new Error("deleted"));else{let o=be(this,Mi)[u];be(this,e1)&&((t=be(this,Kd))==null||t.call(this,i,o,"delete")),be(this,Ql)&&((r=be(this,xa))==null||r.push([i,o,"delete"]))}}if(be(this,xs).clear(),be(this,yn).fill(void 0),be(this,Mi).fill(void 0),be(this,ep)&&be(this,Zd)&&(be(this,ep).fill(0),be(this,Zd).fill(0)),be(this,Qd)&&be(this,Qd).fill(0),Bt(this,sl,0),Bt(this,Ca,0),be(this,Jd).length=0,Bt(this,Xd,0),Bt(this,Vs,0),be(this,Ql)&&be(this,xa)){let u=be(this,xa),i;for(;i=u==null?void 0:u.shift();)(n=be(this,Yd))==null||n.call(this,...i)}}};IBn=Symbol.toStringTag,Hd=new WeakMap,Q0=new WeakMap,Kd=new WeakMap,Yd=new WeakMap,lA=new WeakMap,Vs=new WeakMap,Xd=new WeakMap,xs=new WeakMap,Mi=new WeakMap,yn=new WeakMap,Jl=new WeakMap,Z0=new WeakMap,sl=new WeakMap,Ca=new WeakMap,Jd=new WeakMap,xa=new WeakMap,Qd=new WeakMap,Zd=new WeakMap,ep=new WeakMap,e1=new WeakMap,av=new WeakMap,Ql=new WeakMap,xR=new WeakSet,cxe=function(){let t=new cA(be(this,Hd)),r=new cA(be(this,Hd));Bt(this,ep,t),Bt(this,Zd,r),Bt(this,AR,(i,o,s=aA.now())=>{if(r[i]=o!==0?s:0,t[i]=o,o!==0&&this.ttlAutopurge){let a=setTimeout(()=>{be(this,tp).call(this,i)&&this.delete(be(this,Mi)[i])},o+1);a.unref&&a.unref()}}),Bt(this,f3,i=>{r[i]=t[i]!==0?aA.now():0}),Bt(this,eg,(i,o)=>{if(t[o]){let s=t[o],a=r[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=n||u();let c=i.now-a;i.remainingTTL=s-c}});let n=0,u=()=>{let i=aA.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return i};this.getRemainingTTL=i=>{let o=be(this,xs).get(i);if(o===void 0)return 0;let s=t[o],a=r[o];if(!s||!a)return 1/0;let c=(n||u())-a;return s-c},Bt(this,tp,i=>{let o=r[i],s=t[i];return!!s&&!!o&&(n||u())-o>s})},f3=new WeakMap,eg=new WeakMap,AR=new WeakMap,tp=new WeakMap,Iee=new WeakSet,CSt=function(){let t=new cA(be(this,Hd));Bt(this,Xd,0),Bt(this,Qd,t),Bt(this,p3,r=>{Bt(this,Xd,be(this,Xd)-t[r]),t[r]=0}),Bt(this,FR,(r,n,u,i)=>{if(qt(this,mi,qi).call(this,n))return 0;if(!iv(u))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(u=i(n,r),!iv(u))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 u}),Bt(this,fA,(r,n,u)=>{if(t[r]=n,be(this,Q0)){let i=be(this,Q0)-t[r];for(;be(this,Xd)>i;)qt(this,pA,Pee).call(this,!0)}Bt(this,Xd,be(this,Xd)+t[r]),u&&(u.entrySize=n,u.totalCalculatedSize=be(this,Xd))})},p3=new WeakMap,fA=new WeakMap,FR=new WeakMap,L2=new WeakSet,ov=function*({allowStale:t=this.allowStale}={}){if(be(this,Vs))for(let r=be(this,Ca);!(!qt(this,_R,lxe).call(this,r)||((t||!be(this,tp).call(this,r))&&(yield r),r===be(this,sl)));)r=be(this,Z0)[r]},N2=new WeakSet,sv=function*({allowStale:t=this.allowStale}={}){if(be(this,Vs))for(let r=be(this,sl);!(!qt(this,_R,lxe).call(this,r)||((t||!be(this,tp).call(this,r))&&(yield r),r===be(this,Ca)));)r=be(this,Jl)[r]},_R=new WeakSet,lxe=function(t){return t!==void 0&&be(this,xs).get(be(this,Mi)[t])===t},pA=new WeakSet,Pee=function(t){var i,o;let r=be(this,sl),n=be(this,Mi)[r],u=be(this,yn)[r];return be(this,av)&&qt(this,mi,qi).call(this,u)?u.__abortController.abort(new Error("evicted")):(be(this,e1)||be(this,Ql))&&(be(this,e1)&&((i=be(this,Kd))==null||i.call(this,u,n,"evict")),be(this,Ql)&&((o=be(this,xa))==null||o.push([u,n,"evict"]))),be(this,p3).call(this,r),t&&(be(this,Mi)[r]=void 0,be(this,yn)[r]=void 0,be(this,Jd).push(r)),be(this,Vs)===1?(Bt(this,sl,Bt(this,Ca,0)),be(this,Jd).length=0):Bt(this,sl,be(this,Jl)[r]),be(this,xs).delete(n),UU(this,Vs)._--,r},hA=new WeakSet,kee=function(t,r,n,u){let i=r===void 0?void 0:be(this,yn)[r];if(qt(this,mi,qi).call(this,i))return i;let o=new Ree,{signal:s}=n;s==null||s.addEventListener("abort",()=>o.abort(s.reason),{signal:o.signal});let a={signal:o.signal,options:n,context:u},c=(m,v=!1)=>{let{aborted:y}=o.signal,g=n.ignoreFetchAbort&&m!==void 0;if(n.status&&(y&&!v?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,g&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),y&&!g&&!v)return f(o.signal.reason);let D=h;return be(this,yn)[r]===h&&(m===void 0?D.__staleWhileFetching?be(this,yn)[r]=D.__staleWhileFetching:this.delete(t):(n.status&&(n.status.fetchUpdated=!0),this.set(t,m,a.options))),m},l=m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),f(m)),f=m=>{let{aborted:v}=o.signal,y=v&&n.allowStaleOnFetchAbort,g=y||n.allowStaleOnFetchRejection,D=g||n.noDeleteOnFetchRejection,E=h;if(be(this,yn)[r]===h&&(!D||E.__staleWhileFetching===void 0?this.delete(t):y||(be(this,yn)[r]=E.__staleWhileFetching)),g)return n.status&&E.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),E.__staleWhileFetching;if(E.__returned===E)throw m},p=(m,v)=>{var g;let y=(g=be(this,lA))==null?void 0:g.call(this,t,i,a);y&&y instanceof Promise&&y.then(D=>m(D===void 0?void 0:D),v),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=D=>c(D,!0)))})};n.status&&(n.status.fetchDispatched=!0);let h=new Promise(p).then(c,l),d=Object.assign(h,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(t,d,{...a.options,status:void 0}),r=be(this,xs).get(t)):be(this,yn)[r]=d,d},mi=new WeakSet,qi=function(t){if(!be(this,av))return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Ree},BR=new WeakSet,fxe=function(t,r){be(this,Z0)[r]=t,be(this,Jl)[t]=r},h3=new WeakSet,CR=function(t){t!==be(this,Ca)&&(t===be(this,sl)?Bt(this,sl,be(this,Jl)[t]):qt(this,BR,fxe).call(this,be(this,Z0)[t],be(this,Jl)[t]),qt(this,BR,fxe).call(this,be(this,Ca),t),Bt(this,Ca,t))};var axe=pxe;jee.LRUCache=axe});var Exe=I(ef=>{"use strict";var jBn=ef&&ef.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ef,"__esModule",{value:!0});ef.Minipass=ef.isWritable=ef.isReadable=ef.isStream=void 0;var ASt=typeof process=="object"&&process?process:{stdout:null,stderr:null},yxe=require("events"),wSt=jBn(require("stream")),LBn=require("string_decoder"),NBn=e=>!!e&&typeof e=="object"&&(e instanceof zee||e instanceof wSt.default||(0,ef.isReadable)(e)||(0,ef.isWritable)(e));ef.isStream=NBn;var qBn=e=>!!e&&typeof e=="object"&&e instanceof yxe.EventEmitter&&typeof e.pipe=="function"&&e.pipe!==wSt.default.Writable.prototype.pipe;ef.isReadable=qBn;var MBn=e=>!!e&&typeof e=="object"&&e instanceof yxe.EventEmitter&&typeof e.write=="function"&&typeof e.end=="function";ef.isWritable=MBn;var tg=Symbol("EOF"),rg=Symbol("maybeEmitEnd"),cv=Symbol("emittedEnd"),Lee=Symbol("emittingEnd"),wR=Symbol("emittedError"),Nee=Symbol("closed"),FSt=Symbol("read"),qee=Symbol("flush"),_St=Symbol("flushChunk"),t1=Symbol("encoding"),dA=Symbol("decoder"),Aa=Symbol("flowing"),SR=Symbol("paused"),mA=Symbol("resume"),Fa=Symbol("buffer"),Zl=Symbol("pipes"),_a=Symbol("bufferLength"),hxe=Symbol("bufferPush"),Mee=Symbol("bufferShift"),al=Symbol("objectMode"),Xo=Symbol("destroyed"),dxe=Symbol("error"),mxe=Symbol("emitData"),BSt=Symbol("emitEnd"),gxe=Symbol("emitEnd2"),q2=Symbol("async"),vxe=Symbol("abort"),Uee=Symbol("aborted"),OR=Symbol("signal"),d3=Symbol("dataListeners"),rp=Symbol("discarded"),TR=e=>Promise.resolve().then(e),UBn=e=>e(),$Bn=e=>e==="end"||e==="finish"||e==="prefinish",zBn=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,GBn=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),$ee=class{src;dest;opts;ondrain;constructor(t,r,n){this.src=t,this.dest=r,this.opts=n,this.ondrain=()=>t[mA](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Dxe=class extends $ee{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,r,n){super(t,r,n),this.proxyErrors=u=>r.emit("error",u),t.on("error",this.proxyErrors)}},WBn=e=>!!e.objectMode,VBn=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",zee=class extends yxe.EventEmitter{[Aa]=!1;[SR]=!1;[Zl]=[];[Fa]=[];[al];[t1];[q2];[dA];[tg]=!1;[cv]=!1;[Lee]=!1;[Nee]=!1;[wR]=null;[_a]=0;[Xo]=!1;[OR];[Uee]=!1;[d3]=0;[rp]=!1;writable=!0;readable=!0;constructor(...t){let r=t[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");WBn(r)?(this[al]=!0,this[t1]=null):VBn(r)?(this[t1]=r.encoding,this[al]=!1):(this[al]=!1,this[t1]=null),this[q2]=!!r.async,this[dA]=this[t1]?new LBn.StringDecoder(this[t1]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Fa]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Zl]});let{signal:n}=r;n&&(this[OR]=n,n.aborted?this[vxe]():n.addEventListener("abort",()=>this[vxe]()))}get bufferLength(){return this[_a]}get encoding(){return this[t1]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[al]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[q2]}set async(t){this[q2]=this[q2]||!!t}[vxe](){var t,r;this[Uee]=!0,this.emit("abort",(t=this[OR])==null?void 0:t.reason),this.destroy((r=this[OR])==null?void 0:r.reason)}get aborted(){return this[Uee]}set aborted(t){}write(t,r,n){var i;if(this[Uee])return!1;if(this[tg])throw new Error("write after end");if(this[Xo])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let u=this[q2]?TR:UBn;if(!this[al]&&!Buffer.isBuffer(t)){if(GBn(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(zBn(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[al]?(this[Aa]&&this[_a]!==0&&this[qee](!0),this[Aa]?this.emit("data",t):this[hxe](t),this[_a]!==0&&this.emit("readable"),n&&u(n),this[Aa]):t.length?(typeof t=="string"&&!(r===this[t1]&&!((i=this[dA])!=null&&i.lastNeed))&&(t=Buffer.from(t,r)),Buffer.isBuffer(t)&&this[t1]&&(t=this[dA].write(t)),this[Aa]&&this[_a]!==0&&this[qee](!0),this[Aa]?this.emit("data",t):this[hxe](t),this[_a]!==0&&this.emit("readable"),n&&u(n),this[Aa]):(this[_a]!==0&&this.emit("readable"),n&&u(n),this[Aa])}read(t){if(this[Xo])return null;if(this[rp]=!1,this[_a]===0||t===0||t&&t>this[_a])return this[rg](),null;this[al]&&(t=null),this[Fa].length>1&&!this[al]&&(this[Fa]=[this[t1]?this[Fa].join(""):Buffer.concat(this[Fa],this[_a])]);let r=this[FSt](t||null,this[Fa][0]);return this[rg](),r}[FSt](t,r){if(this[al])this[Mee]();else{let n=r;t===n.length||t===null?this[Mee]():typeof n=="string"?(this[Fa][0]=n.slice(t),r=n.slice(0,t),this[_a]-=t):(this[Fa][0]=n.subarray(t),r=n.subarray(0,t),this[_a]-=t)}return this.emit("data",r),!this[Fa].length&&!this[tg]&&this.emit("drain"),r}end(t,r,n){return typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r="utf8"),t!==void 0&&this.write(t,r),n&&this.once("end",n),this[tg]=!0,this.writable=!1,(this[Aa]||!this[SR])&&this[rg](),this}[mA](){this[Xo]||(!this[d3]&&!this[Zl].length&&(this[rp]=!0),this[SR]=!1,this[Aa]=!0,this.emit("resume"),this[Fa].length?this[qee]():this[tg]?this[rg]():this.emit("drain"))}resume(){return this[mA]()}pause(){this[Aa]=!1,this[SR]=!0,this[rp]=!1}get destroyed(){return this[Xo]}get flowing(){return this[Aa]}get paused(){return this[SR]}[hxe](t){this[al]?this[_a]+=1:this[_a]+=t.length,this[Fa].push(t)}[Mee](){return this[al]?this[_a]-=1:this[_a]-=this[Fa][0].length,this[Fa].shift()}[qee](t=!1){do;while(this[_St](this[Mee]())&&this[Fa].length);!t&&!this[Fa].length&&!this[tg]&&this.emit("drain")}[_St](t){return this.emit("data",t),this[Aa]}pipe(t,r){if(this[Xo])return t;this[rp]=!1;let n=this[cv];return r=r||{},t===ASt.stdout||t===ASt.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&t.end():(this[Zl].push(r.proxyErrors?new Dxe(this,t,r):new $ee(this,t,r)),this[q2]?TR(()=>this[mA]()):this[mA]()),t}unpipe(t){let r=this[Zl].find(n=>n.dest===t);r&&(this[Zl].length===1?(this[Aa]&&this[d3]===0&&(this[Aa]=!1),this[Zl]=[]):this[Zl].splice(this[Zl].indexOf(r),1),r.unpipe())}addListener(t,r){return this.on(t,r)}on(t,r){let n=super.on(t,r);if(t==="data")this[rp]=!1,this[d3]++,!this[Zl].length&&!this[Aa]&&this[mA]();else if(t==="readable"&&this[_a]!==0)super.emit("readable");else if($Bn(t)&&this[cv])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[wR]){let u=r;this[q2]?TR(()=>u.call(this,this[wR])):u.call(this,this[wR])}return n}removeListener(t,r){return this.off(t,r)}off(t,r){let n=super.off(t,r);return t==="data"&&(this[d3]=this.listeners("data").length,this[d3]===0&&!this[rp]&&!this[Zl].length&&(this[Aa]=!1)),n}removeAllListeners(t){let r=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[d3]=0,!this[rp]&&!this[Zl].length&&(this[Aa]=!1)),r}get emittedEnd(){return this[cv]}[rg](){!this[Lee]&&!this[cv]&&!this[Xo]&&this[Fa].length===0&&this[tg]&&(this[Lee]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Nee]&&this.emit("close"),this[Lee]=!1)}emit(t,...r){let n=r[0];if(t!=="error"&&t!=="close"&&t!==Xo&&this[Xo])return!1;if(t==="data")return!this[al]&&!n?!1:this[q2]?(TR(()=>this[mxe](n)),!0):this[mxe](n);if(t==="end")return this[BSt]();if(t==="close"){if(this[Nee]=!0,!this[cv]&&!this[Xo])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(t==="error"){this[wR]=n,super.emit(dxe,n);let i=!this[OR]||this.listeners("error").length?super.emit("error",n):!1;return this[rg](),i}else if(t==="resume"){let i=super.emit("resume");return this[rg](),i}else if(t==="finish"||t==="prefinish"){let i=super.emit(t);return this.removeAllListeners(t),i}let u=super.emit(t,...r);return this[rg](),u}[mxe](t){for(let n of this[Zl])n.dest.write(t)===!1&&this.pause();let r=this[rp]?!1:super.emit("data",t);return this[rg](),r}[BSt](){return this[cv]?!1:(this[cv]=!0,this.readable=!1,this[q2]?(TR(()=>this[gxe]()),!0):this[gxe]())}[gxe](){if(this[dA]){let r=this[dA].end();if(r){for(let n of this[Zl])n.dest.write(r);this[rp]||super.emit("data",r)}}for(let r of this[Zl])r.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[al]||(t.dataLength=0);let r=this.promise();return this.on("data",n=>{t.push(n),this[al]||(t.dataLength+=n.length)}),await r,t}async concat(){if(this[al])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[t1]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,r)=>{this.on(Xo,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[rp]=!1;let t=!1,r=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return r();let u=this.read();if(u!==null)return Promise.resolve({done:!1,value:u});if(this[tg])return r();let i,o,s=f=>{this.off("data",a),this.off("end",c),this.off(Xo,l),r(),o(f)},a=f=>{this.off("error",s),this.off("end",c),this.off(Xo,l),this.pause(),i({value:f,done:!!this[tg]})},c=()=>{this.off("error",s),this.off("data",a),this.off(Xo,l),r(),i({done:!0,value:void 0})},l=()=>s(new Error("stream destroyed"));return new Promise((f,p)=>{o=p,i=f,this.once(Xo,l),this.once("error",s),this.once("end",c),this.once("data",a)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[rp]=!1;let t=!1,r=()=>(this.pause(),this.off(dxe,r),this.off(Xo,r),this.off("end",r),t=!0,{done:!0,value:void 0}),n=()=>{if(t)return r();let u=this.read();return u===null?r():{done:!1,value:u}};return this.once("end",r),this.once(dxe,r),this.once(Xo,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(t){if(this[Xo])return t?this.emit("error",t):this.emit(Xo),this;this[Xo]=!0,this[rp]=!0,this[Fa].length=0,this[_a]=0;let r=this;return typeof r.close=="function"&&!this[Nee]&&r.close(),t?this.emit("error",t):this.emit(Xo),this}static get isStream(){return ef.isStream}};ef.Minipass=zee});var HSt=I(Hu=>{"use strict";var HBn=Hu&&Hu.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var u=Object.getOwnPropertyDescriptor(t,r);(!u||("get"in u?!t.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,u)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),KBn=Hu&&Hu.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),YBn=Hu&&Hu.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&HBn(t,e,r);return KBn(t,e),t};Object.defineProperty(Hu,"__esModule",{value:!0});Hu.PathScurry=Hu.Path=Hu.PathScurryDarwin=Hu.PathScurryPosix=Hu.PathScurryWin32=Hu.PathScurryBase=Hu.PathPosix=Hu.PathWin32=Hu.PathBase=Hu.ChildrenCache=Hu.ResolveCache=void 0;var RSt=xSt(),Jee=require("path"),XBn=require("url"),kR=require("fs"),JBn=YBn(require("fs")),QBn=kR.realpathSync.native,Gee=require("fs/promises"),SSt=Exe(),RR={lstatSync:kR.lstatSync,readdir:kR.readdir,readdirSync:kR.readdirSync,readlinkSync:kR.readlinkSync,realpathSync:QBn,promises:{lstat:Gee.lstat,readdir:Gee.readdir,readlink:Gee.readlink,realpath:Gee.realpath}},ISt=e=>!e||e===RR||e===JBn?RR:{...RR,...e,promises:{...RR.promises,...e.promises||{}}},jSt=/^\\\\\?\\([a-z]:)\\?$/i,ZBn=e=>e.replace(/\//g,"\\").replace(jSt,"$1\\"),ewn=/[\\\/]/,bh=0,LSt=1,NSt=2,M2=4,qSt=6,MSt=8,m3=10,USt=12,Eh=15,PR=~Eh,bxe=16,OSt=32,IR=64,r1=128,Wee=256,Hee=512,TSt=IR|r1|Hee,twn=1023,Cxe=e=>e.isFile()?MSt:e.isDirectory()?M2:e.isSymbolicLink()?m3:e.isCharacterDevice()?NSt:e.isBlockDevice()?qSt:e.isSocket()?USt:e.isFIFO()?LSt:bh,PSt=new Map,jR=e=>{let t=PSt.get(e);if(t)return t;let r=e.normalize("NFKD");return PSt.set(e,r),r},kSt=new Map,Vee=e=>{let t=kSt.get(e);if(t)return t;let r=jR(e.toLowerCase());return kSt.set(e,r),r},qR=class extends RSt.LRUCache{constructor(){super({max:256})}};Hu.ResolveCache=qR;var Qee=class extends RSt.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:r=>r.length+1})}};Hu.ChildrenCache=Qee;var $St=Symbol("PathScurry setAsCwd"),tf,WR,VR,HR,KR,YR,XR,JR,QR,ZR,eI,tI,rI,nI,uI,iI,oI,sI,aI,lv,g3,U2,ng,ug,ig,vn,v3,og,$2,cI,xxe,gA,Kee,D3,LR,lI,Axe,fI,Fxe,y3,NR,vA,Yee,pI,_xe,hI,Bxe,DA,Xee,ete,zSt,tte,GSt,rte,WSt,dI,wxe,yA,EA,nte,VSt,E3,pc=class{constructor(t,r=bh,n,u,i,o,s){Rt(this,cI);Rt(this,gA);Rt(this,D3);Rt(this,lI);Rt(this,fI);Rt(this,y3);Rt(this,vA);Rt(this,pI);Rt(this,hI);Rt(this,DA);Rt(this,ete);Rt(this,tte);Rt(this,rte);Rt(this,dI);Rt(this,nte);Cn(this,"name");Cn(this,"root");Cn(this,"roots");Cn(this,"parent");Cn(this,"nocase");Cn(this,"isCWD",!1);Rt(this,tf,void 0);Rt(this,WR,void 0);Rt(this,VR,void 0);Rt(this,HR,void 0);Rt(this,KR,void 0);Rt(this,YR,void 0);Rt(this,XR,void 0);Rt(this,JR,void 0);Rt(this,QR,void 0);Rt(this,ZR,void 0);Rt(this,eI,void 0);Rt(this,tI,void 0);Rt(this,rI,void 0);Rt(this,nI,void 0);Rt(this,uI,void 0);Rt(this,iI,void 0);Rt(this,oI,void 0);Rt(this,sI,void 0);Rt(this,aI,void 0);Rt(this,lv,void 0);Rt(this,g3,void 0);Rt(this,U2,void 0);Rt(this,ng,void 0);Rt(this,ug,void 0);Rt(this,ig,void 0);Rt(this,vn,void 0);Rt(this,v3,void 0);Rt(this,og,void 0);Rt(this,$2,void 0);Rt(this,yA,[]);Rt(this,EA,!1);Rt(this,E3,void 0);this.name=t,Bt(this,lv,i?Vee(t):jR(t)),Bt(this,vn,r&twn),this.nocase=i,this.roots=u,this.root=n||this,Bt(this,v3,o),Bt(this,U2,s.fullpath),Bt(this,ug,s.relative),Bt(this,ig,s.relativePosix),this.parent=s.parent,this.parent?Bt(this,tf,be(this.parent,tf)):Bt(this,tf,ISt(s.fs))}get dev(){return be(this,WR)}get mode(){return be(this,VR)}get nlink(){return be(this,HR)}get uid(){return be(this,KR)}get gid(){return be(this,YR)}get rdev(){return be(this,XR)}get blksize(){return be(this,JR)}get ino(){return be(this,QR)}get size(){return be(this,ZR)}get blocks(){return be(this,eI)}get atimeMs(){return be(this,tI)}get mtimeMs(){return be(this,rI)}get ctimeMs(){return be(this,nI)}get birthtimeMs(){return be(this,uI)}get atime(){return be(this,iI)}get mtime(){return be(this,oI)}get ctime(){return be(this,sI)}get birthtime(){return be(this,aI)}get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return be(this,g3)!==void 0?be(this,g3):this.parent?Bt(this,g3,this.parent.depth()+1):Bt(this,g3,0)}childrenCache(){return be(this,v3)}resolve(t){var o;if(!t)return this;let r=this.getRootString(t),u=t.substring(r.length).split(this.splitSep);return r?qt(o=this.getRoot(r),cI,xxe).call(o,u):qt(this,cI,xxe).call(this,u)}children(){let t=be(this,v3).get(this);if(t)return t;let r=Object.assign([],{provisional:0});return be(this,v3).set(this,r),Bt(this,vn,be(this,vn)&~bxe),r}child(t,r){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let n=this.children(),u=this.nocase?Vee(t):jR(t);for(let a of n)if(be(a,lv)===u)return a;let i=this.parent?this.sep:"",o=be(this,U2)?be(this,U2)+i+t:void 0,s=this.newChild(t,bh,{...r,parent:this,fullpath:o});return this.canReaddir()||Bt(s,vn,be(s,vn)|r1),n.push(s),s}relative(){if(this.isCWD)return"";if(be(this,ug)!==void 0)return be(this,ug);let t=this.name,r=this.parent;if(!r)return Bt(this,ug,this.name);let n=r.relative();return n+(!n||!r.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(be(this,ig)!==void 0)return be(this,ig);let t=this.name,r=this.parent;if(!r)return Bt(this,ig,this.fullpathPosix());let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+t}fullpath(){if(be(this,U2)!==void 0)return be(this,U2);let t=this.name,r=this.parent;if(!r)return Bt(this,U2,this.name);let u=r.fullpath()+(r.parent?this.sep:"")+t;return Bt(this,U2,u)}fullpathPosix(){if(be(this,ng)!==void 0)return be(this,ng);if(this.sep==="/")return Bt(this,ng,this.fullpath());if(!this.parent){let u=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(u)?Bt(this,ng,`//?/${u}`):Bt(this,ng,u)}let t=this.parent,r=t.fullpathPosix(),n=r+(!r||!t.parent?"":"/")+this.name;return Bt(this,ng,n)}isUnknown(){return(be(this,vn)&Eh)===bh}isType(t){return this[`is${t}`]()}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(be(this,vn)&Eh)===MSt}isDirectory(){return(be(this,vn)&Eh)===M2}isCharacterDevice(){return(be(this,vn)&Eh)===NSt}isBlockDevice(){return(be(this,vn)&Eh)===qSt}isFIFO(){return(be(this,vn)&Eh)===LSt}isSocket(){return(be(this,vn)&Eh)===USt}isSymbolicLink(){return(be(this,vn)&m3)===m3}lstatCached(){return be(this,vn)&OSt?this:void 0}readlinkCached(){return be(this,og)}realpathCached(){return be(this,$2)}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(be(this,og))return!0;if(!this.parent)return!1;let t=be(this,vn)&Eh;return!(t!==bh&&t!==m3||be(this,vn)&Wee||be(this,vn)&r1)}calledReaddir(){return!!(be(this,vn)&bxe)}isENOENT(){return!!(be(this,vn)&r1)}isNamed(t){return this.nocase?be(this,lv)===Vee(t):be(this,lv)===jR(t)}async readlink(){var r;let t=be(this,og);if(t)return t;if(this.canReadlink()&&this.parent)try{let n=await be(this,tf).promises.readlink(this.fullpath()),u=(r=await this.parent.realpath())==null?void 0:r.resolve(n);if(u)return Bt(this,og,u)}catch(n){qt(this,hI,Bxe).call(this,n.code);return}}readlinkSync(){var r;let t=be(this,og);if(t)return t;if(this.canReadlink()&&this.parent)try{let n=be(this,tf).readlinkSync(this.fullpath()),u=(r=this.parent.realpathSync())==null?void 0:r.resolve(n);if(u)return Bt(this,og,u)}catch(n){qt(this,hI,Bxe).call(this,n.code);return}}async lstat(){if(!(be(this,vn)&r1))try{return qt(this,dI,wxe).call(this,await be(this,tf).promises.lstat(this.fullpath())),this}catch(t){qt(this,pI,_xe).call(this,t.code)}}lstatSync(){if(!(be(this,vn)&r1))try{return qt(this,dI,wxe).call(this,be(this,tf).lstatSync(this.fullpath())),this}catch(t){qt(this,pI,_xe).call(this,t.code)}}readdirCB(t,r=!1){if(!this.canReaddir()){r?t(null,[]):queueMicrotask(()=>t(null,[]));return}let n=this.children();if(this.calledReaddir()){let i=n.slice(0,n.provisional);r?t(null,i):queueMicrotask(()=>t(null,i));return}if(be(this,yA).push(t),be(this,EA))return;Bt(this,EA,!0);let u=this.fullpath();be(this,tf).readdir(u,{withFileTypes:!0},(i,o)=>{if(i)qt(this,vA,Yee).call(this,i.code),n.provisional=0;else{for(let s of o)qt(this,DA,Xee).call(this,s,n);qt(this,gA,Kee).call(this,n)}qt(this,nte,VSt).call(this,n.slice(0,n.provisional))})}async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let r=this.fullpath();if(be(this,E3))await be(this,E3);else{let n=()=>{};Bt(this,E3,new Promise(u=>n=u));try{for(let u of await be(this,tf).promises.readdir(r,{withFileTypes:!0}))qt(this,DA,Xee).call(this,u,t);qt(this,gA,Kee).call(this,t)}catch(u){qt(this,vA,Yee).call(this,u.code),t.provisional=0}Bt(this,E3,void 0),n()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let r=this.fullpath();try{for(let n of be(this,tf).readdirSync(r,{withFileTypes:!0}))qt(this,DA,Xee).call(this,n,t);qt(this,gA,Kee).call(this,t)}catch(n){qt(this,vA,Yee).call(this,n.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(be(this,vn)&TSt)return!1;let t=Eh&be(this,vn);return t===bh||t===M2||t===m3}shouldWalk(t,r){return(be(this,vn)&M2)===M2&&!(be(this,vn)&TSt)&&!t.has(this)&&(!r||r(this))}async realpath(){if(be(this,$2))return be(this,$2);if(!((Hee|Wee|r1)&be(this,vn)))try{let t=await be(this,tf).promises.realpath(this.fullpath());return Bt(this,$2,this.resolve(t))}catch{qt(this,fI,Fxe).call(this)}}realpathSync(){if(be(this,$2))return be(this,$2);if(!((Hee|Wee|r1)&be(this,vn)))try{let t=be(this,tf).realpathSync(this.fullpath());return Bt(this,$2,this.resolve(t))}catch{qt(this,fI,Fxe).call(this)}}[$St](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],u=this;for(;u&&u.parent;)r.add(u),Bt(u,ug,n.join(this.sep)),Bt(u,ig,n.join("/")),u=u.parent,n.push("..");for(u=t;u&&u.parent&&!r.has(u);)Bt(u,ug,void 0),Bt(u,ig,void 0),u=u.parent}};tf=new WeakMap,WR=new WeakMap,VR=new WeakMap,HR=new WeakMap,KR=new WeakMap,YR=new WeakMap,XR=new WeakMap,JR=new WeakMap,QR=new WeakMap,ZR=new WeakMap,eI=new WeakMap,tI=new WeakMap,rI=new WeakMap,nI=new WeakMap,uI=new WeakMap,iI=new WeakMap,oI=new WeakMap,sI=new WeakMap,aI=new WeakMap,lv=new WeakMap,g3=new WeakMap,U2=new WeakMap,ng=new WeakMap,ug=new WeakMap,ig=new WeakMap,vn=new WeakMap,v3=new WeakMap,og=new WeakMap,$2=new WeakMap,cI=new WeakSet,xxe=function(t){let r=this;for(let n of t)r=r.child(n);return r},gA=new WeakSet,Kee=function(t){var r;Bt(this,vn,be(this,vn)|bxe);for(let n=t.provisional;n<t.length;n++){let u=t[n];u&&qt(r=u,D3,LR).call(r)}},D3=new WeakSet,LR=function(){be(this,vn)&r1||(Bt(this,vn,(be(this,vn)|r1)&PR),qt(this,lI,Axe).call(this))},lI=new WeakSet,Axe=function(){var r;let t=this.children();t.provisional=0;for(let n of t)qt(r=n,D3,LR).call(r)},fI=new WeakSet,Fxe=function(){Bt(this,vn,be(this,vn)|Hee),qt(this,y3,NR).call(this)},y3=new WeakSet,NR=function(){if(be(this,vn)&IR)return;let t=be(this,vn);(t&Eh)===M2&&(t&=PR),Bt(this,vn,t|IR),qt(this,lI,Axe).call(this)},vA=new WeakSet,Yee=function(t=""){t==="ENOTDIR"||t==="EPERM"?qt(this,y3,NR).call(this):t==="ENOENT"?qt(this,D3,LR).call(this):this.children().provisional=0},pI=new WeakSet,_xe=function(t=""){var r;if(t==="ENOTDIR"){let n=this.parent;qt(r=n,y3,NR).call(r)}else t==="ENOENT"&&qt(this,D3,LR).call(this)},hI=new WeakSet,Bxe=function(t=""){var n;let r=be(this,vn);r|=Wee,t==="ENOENT"&&(r|=r1),(t==="EINVAL"||t==="UNKNOWN")&&(r&=PR),Bt(this,vn,r),t==="ENOTDIR"&&this.parent&&qt(n=this.parent,y3,NR).call(n)},DA=new WeakSet,Xee=function(t,r){return qt(this,tte,GSt).call(this,t,r)||qt(this,ete,zSt).call(this,t,r)},ete=new WeakSet,zSt=function(t,r){let n=Cxe(t),u=this.newChild(t.name,n,{parent:this}),i=be(u,vn)&Eh;return i!==M2&&i!==m3&&i!==bh&&Bt(u,vn,be(u,vn)|IR),r.unshift(u),r.provisional++,u},tte=new WeakSet,GSt=function(t,r){for(let n=r.provisional;n<r.length;n++){let u=r[n];if((this.nocase?Vee(t.name):jR(t.name))===be(u,lv))return qt(this,rte,WSt).call(this,t,u,n,r)}},rte=new WeakSet,WSt=function(t,r,n,u){let i=r.name;return Bt(r,vn,be(r,vn)&PR|Cxe(t)),i!==t.name&&(r.name=t.name),n!==u.provisional&&(n===u.length-1?u.pop():u.splice(n,1),u.unshift(r)),u.provisional++,r},dI=new WeakSet,wxe=function(t){let{atime:r,atimeMs:n,birthtime:u,birthtimeMs:i,blksize:o,blocks:s,ctime:a,ctimeMs:c,dev:l,gid:f,ino:p,mode:h,mtime:d,mtimeMs:m,nlink:v,rdev:y,size:g,uid:D}=t;Bt(this,iI,r),Bt(this,tI,n),Bt(this,aI,u),Bt(this,uI,i),Bt(this,JR,o),Bt(this,eI,s),Bt(this,sI,a),Bt(this,nI,c),Bt(this,WR,l),Bt(this,YR,f),Bt(this,QR,p),Bt(this,VR,h),Bt(this,oI,d),Bt(this,rI,m),Bt(this,HR,v),Bt(this,XR,y),Bt(this,ZR,g),Bt(this,KR,D);let E=Cxe(t);Bt(this,vn,be(this,vn)&PR|E|OSt),E!==bh&&E!==M2&&E!==m3&&Bt(this,vn,be(this,vn)|IR)},yA=new WeakMap,EA=new WeakMap,nte=new WeakSet,VSt=function(t){Bt(this,EA,!1);let r=be(this,yA).slice();be(this,yA).length=0,r.forEach(n=>n(null,t))},E3=new WeakMap;Hu.PathBase=pc;var MR=class e extends pc{sep="\\";splitSep=ewn;constructor(t,r=bh,n,u,i,o,s){super(t,r,n,u,i,o,s)}newChild(t,r=bh,n={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(t){return Jee.win32.parse(t).root}getRoot(t){if(t=ZBn(t.toUpperCase()),t===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(t,r))return this.roots[t]=n;return this.roots[t]=new zR(t,this).root}sameRoot(t,r=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(jSt,"$1\\"),t===r}};Hu.PathWin32=MR;var UR=class e extends pc{splitSep="/";sep="/";constructor(t,r=bh,n,u,i,o,s){super(t,r,n,u,i,o,s)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,r=bh,n={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}};Hu.PathPosix=UR;var bA,CA,mI,gI,$R=class{constructor(t=process.cwd(),r,n,{nocase:u,childrenCacheSize:i=16*1024,fs:o=RR}={}){Cn(this,"root");Cn(this,"rootPath");Cn(this,"roots");Cn(this,"cwd");Rt(this,bA,void 0);Rt(this,CA,void 0);Rt(this,mI,void 0);Cn(this,"nocase");Rt(this,gI,void 0);Bt(this,gI,ISt(o)),(t instanceof URL||t.startsWith("file://"))&&(t=(0,XBn.fileURLToPath)(t));let s=r.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(s),Bt(this,bA,new qR),Bt(this,CA,new qR),Bt(this,mI,new Qee(i));let a=s.substring(this.rootPath.length).split(n);if(a.length===1&&!a[0]&&a.pop(),u===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=u,this.root=this.newRoot(be(this,gI)),this.roots[this.rootPath]=this.root;let c=this.root,l=a.length-1,f=r.sep,p=this.rootPath,h=!1;for(let d of a){let m=l--;c=c.child(d,{relative:new Array(m).fill("..").join(f),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(h?"":f)+d}),h=!0}this.cwd=c}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return be(this,mI)}resolve(...t){let r="";for(let i=t.length-1;i>=0;i--){let o=t[i];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=be(this,bA).get(r);if(n!==void 0)return n;let u=this.cwd.resolve(r).fullpath();return be(this,bA).set(r,u),u}resolvePosix(...t){let r="";for(let i=t.length-1;i>=0;i--){let o=t[i];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=be(this,CA).get(r);if(n!==void 0)return n;let u=this.cwd.resolve(r).fullpathPosix();return be(this,CA).set(r,u),u}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n}=r;if(t.canReaddir()){let u=await t.readdir();return n?u:u.map(i=>i.name)}else return[]}readdirSync(t=this.cwd,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0}=r;return t.canReaddir()?n?t.readdirSync():t.readdirSync().map(u=>u.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t.withFileTypes,t=this.cwd);let n=await t.readlink();return r?n:n==null?void 0:n.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t.withFileTypes,t=this.cwd);let n=t.readlinkSync();return r?n:n==null?void 0:n.fullpath()}async realpath(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t.withFileTypes,t=this.cwd);let n=await t.realpath();return r?n:n==null?void 0:n.fullpath()}realpathSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t.withFileTypes,t=this.cwd);let n=t.realpathSync();return r?n:n==null?void 0:n.fullpath()}async walk(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:u=!1,filter:i,walkFilter:o}=r,s=[];(!i||i(t))&&s.push(n?t:t.fullpath());let a=new Set,c=(f,p)=>{a.add(f),f.readdirCB((h,d)=>{if(h)return p(h);let m=d.length;if(!m)return p();let v=()=>{--m===0&&p()};for(let y of d)(!i||i(y))&&s.push(n?y:y.fullpath()),u&&y.isSymbolicLink()?y.realpath().then(g=>g!=null&&g.isUnknown()?g.lstat():g).then(g=>g!=null&&g.shouldWalk(a,o)?c(g,v):v()):y.shouldWalk(a,o)?c(y,v):v()},!0)},l=t;return new Promise((f,p)=>{c(l,h=>{if(h)return p(h);f(s)})})}walkSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:u=!1,filter:i,walkFilter:o}=r,s=[];(!i||i(t))&&s.push(n?t:t.fullpath());let a=new Set([t]);for(let c of a){let l=c.readdirSync();for(let f of l){(!i||i(f))&&s.push(n?f:f.fullpath());let p=f;if(f.isSymbolicLink()){if(!(u&&(p=f.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(a,o)&&a.add(p)}}return s}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,r={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd),this.stream(t,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:u=!1,filter:i,walkFilter:o}=r;(!i||i(t))&&(yield n?t:t.fullpath());let s=new Set([t]);for(let a of s){let c=a.readdirSync();for(let l of c){(!i||i(l))&&(yield n?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(u&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(s,o)&&s.add(f)}}}stream(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:u=!1,filter:i,walkFilter:o}=r,s=new SSt.Minipass({objectMode:!0});(!i||i(t))&&s.write(n?t:t.fullpath());let a=new Set,c=[t],l=0,f=()=>{let p=!1;for(;!p;){let h=c.shift();if(!h){l===0&&s.end();return}l++,a.add(h);let d=(v,y,g=!1)=>{if(v)return s.emit("error",v);if(u&&!g){let D=[];for(let E of y)E.isSymbolicLink()&&D.push(E.realpath().then(b=>b!=null&&b.isUnknown()?b.lstat():b));if(D.length){Promise.all(D).then(()=>d(null,y,!0));return}}for(let D of y)D&&(!i||i(D))&&(s.write(n?D:D.fullpath())||(p=!0));l--;for(let D of y){let E=D.realpathCached()||D;E.shouldWalk(a,o)&&c.push(E)}p&&!s.flowing?s.once("drain",f):m||f()},m=!0;h.readdirCB(d,!0),m=!1}};return f(),s}streamSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:u=!1,filter:i,walkFilter:o}=r,s=new SSt.Minipass({objectMode:!0}),a=new Set;(!i||i(t))&&s.write(n?t:t.fullpath());let c=[t],l=0,f=()=>{let p=!1;for(;!p;){let h=c.shift();if(!h){l===0&&s.end();return}l++,a.add(h);let d=h.readdirSync();for(let m of d)(!i||i(m))&&(s.write(n?m:m.fullpath())||(p=!0));l--;for(let m of d){let v=m;if(m.isSymbolicLink()){if(!(u&&(v=m.realpathSync())))continue;v.isUnknown()&&v.lstatSync()}v.shouldWalk(a,o)&&c.push(v)}}p&&!s.flowing&&s.once("drain",f)};return f(),s}chdir(t=this.cwd){let r=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[$St](r)}};bA=new WeakMap,CA=new WeakMap,mI=new WeakMap,gI=new WeakMap;Hu.PathScurryBase=$R;var zR=class extends $R{sep="\\";constructor(t=process.cwd(),r={}){let{nocase:n=!0}=r;super(t,Jee.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let u=this.cwd;u;u=u.parent)u.nocase=this.nocase}parseRootPath(t){return Jee.win32.parse(t).root.toUpperCase()}newRoot(t){return new MR(this.rootPath,M2,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}};Hu.PathScurryWin32=zR;var GR=class extends $R{sep="/";constructor(t=process.cwd(),r={}){let{nocase:n=!1}=r;super(t,Jee.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(t){return"/"}newRoot(t){return new UR(this.rootPath,M2,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}};Hu.PathScurryPosix=GR;var Zee=class extends GR{constructor(t=process.cwd(),r={}){let{nocase:n=!0}=r;super(t,{...r,nocase:n})}};Hu.PathScurryDarwin=Zee;Hu.Path=process.platform==="win32"?MR:UR;Hu.PathScurry=process.platform==="win32"?zR:process.platform==="darwin"?Zee:GR});var Txe=I(ute=>{"use strict";Object.defineProperty(ute,"__esModule",{value:!0});ute.Pattern=void 0;var rwn=uv(),nwn=e=>e.length>=1,uwn=e=>e.length>=1,Hs,np,Ba,b3,n1,vI,fv,pv,hv,xA,Oxe=class Oxe{constructor(t,r,n,u){Rt(this,Hs,void 0);Rt(this,np,void 0);Rt(this,Ba,void 0);Cn(this,"length");Rt(this,b3,void 0);Rt(this,n1,void 0);Rt(this,vI,void 0);Rt(this,fv,void 0);Rt(this,pv,void 0);Rt(this,hv,void 0);Rt(this,xA,!0);if(!nwn(t))throw new TypeError("empty pattern list");if(!uwn(r))throw new TypeError("empty glob list");if(r.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,n<0||n>=this.length)throw new TypeError("index out of range");if(Bt(this,Hs,t),Bt(this,np,r),Bt(this,Ba,n),Bt(this,b3,u),be(this,Ba)===0){if(this.isUNC()){let[i,o,s,a,...c]=be(this,Hs),[l,f,p,h,...d]=be(this,np);c[0]===""&&(c.shift(),d.shift());let m=[i,o,s,a,""].join("/"),v=[l,f,p,h,""].join("/");Bt(this,Hs,[m,...c]),Bt(this,np,[v,...d]),this.length=be(this,Hs).length}else if(this.isDrive()||this.isAbsolute()){let[i,...o]=be(this,Hs),[s,...a]=be(this,np);o[0]===""&&(o.shift(),a.shift());let c=i+"/",l=s+"/";Bt(this,Hs,[c,...o]),Bt(this,np,[l,...a]),this.length=be(this,Hs).length}}}pattern(){return be(this,Hs)[be(this,Ba)]}isString(){return typeof be(this,Hs)[be(this,Ba)]=="string"}isGlobstar(){return be(this,Hs)[be(this,Ba)]===rwn.GLOBSTAR}isRegExp(){return be(this,Hs)[be(this,Ba)]instanceof RegExp}globString(){return Bt(this,vI,be(this,vI)||(be(this,Ba)===0?this.isAbsolute()?be(this,np)[0]+be(this,np).slice(1).join("/"):be(this,np).join("/"):be(this,np).slice(be(this,Ba)).join("/")))}hasMore(){return this.length>be(this,Ba)+1}rest(){return be(this,n1)!==void 0?be(this,n1):this.hasMore()?(Bt(this,n1,new Oxe(be(this,Hs),be(this,np),be(this,Ba)+1,be(this,b3))),Bt(be(this,n1),hv,be(this,hv)),Bt(be(this,n1),pv,be(this,pv)),Bt(be(this,n1),fv,be(this,fv)),be(this,n1)):Bt(this,n1,null)}isUNC(){let t=be(this,Hs);return be(this,pv)!==void 0?be(this,pv):Bt(this,pv,be(this,b3)==="win32"&&be(this,Ba)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=be(this,Hs);return be(this,fv)!==void 0?be(this,fv):Bt(this,fv,be(this,b3)==="win32"&&be(this,Ba)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=be(this,Hs);return be(this,hv)!==void 0?be(this,hv):Bt(this,hv,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=be(this,Hs)[0];return typeof t=="string"&&this.isAbsolute()&&be(this,Ba)===0?t:""}checkFollowGlobstar(){return!(be(this,Ba)===0||!this.isGlobstar()||!be(this,xA))}markFollowGlobstar(){return be(this,Ba)===0||!this.isGlobstar()||!be(this,xA)?!1:(Bt(this,xA,!1),!0)}};Hs=new WeakMap,np=new WeakMap,Ba=new WeakMap,b3=new WeakMap,n1=new WeakMap,vI=new WeakMap,fv=new WeakMap,pv=new WeakMap,hv=new WeakMap,xA=new WeakMap;var Sxe=Oxe;ute.Pattern=Sxe});var kxe=I(ite=>{"use strict";Object.defineProperty(ite,"__esModule",{value:!0});ite.Ignore=void 0;var KSt=uv(),iwn=Txe(),own=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Pxe=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:r,nocase:n,noext:u,noglobstar:i,platform:o=own}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:u,noglobstar:i,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let s of t)this.add(s)}add(t){let r=new KSt.Minimatch(t,this.mmopts);for(let n=0;n<r.set.length;n++){let u=r.set[n],i=r.globParts[n];if(!u||!i)throw new Error("invalid pattern object");for(;u[0]==="."&&i[0]===".";)u.shift(),i.shift();let o=new iwn.Pattern(u,i,0,this.platform),s=new KSt.Minimatch(o.globString(),this.mmopts),a=i[i.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(s):this.relative.push(s),a&&(c?this.absoluteChildren.push(s):this.relativeChildren.push(s))}}ignored(t){let r=t.fullpath(),n=`${r}/`,u=t.relative()||".",i=`${u}/`;for(let o of this.relative)if(o.match(u)||o.match(i))return!0;for(let o of this.absolute)if(o.match(r)||o.match(n))return!0;return!1}childrenIgnored(t){let r=t.fullpath()+"/",n=(t.relative()||".")+"/";for(let u of this.relativeChildren)if(u.match(n))return!0;for(let u of this.absoluteChildren)if(u.match(r))return!0;return!1}};ite.Ignore=Pxe});var XSt=I(z2=>{"use strict";Object.defineProperty(z2,"__esModule",{value:!0});z2.Processor=z2.SubWalks=z2.MatchRecord=z2.HasWalkedCache=void 0;var YSt=uv(),ote=class e{store;constructor(t=new Map){this.store=t}copy(){return new e(new Map(this.store))}hasWalked(t,r){var n;return(n=this.store.get(t.fullpath()))==null?void 0:n.has(r.globString())}storeWalked(t,r){let n=t.fullpath(),u=this.store.get(n);u?u.add(r.globString()):this.store.set(n,new Set([r.globString()]))}};z2.HasWalkedCache=ote;var ste=class{store=new Map;add(t,r,n){let u=(r?2:0)|(n?1:0),i=this.store.get(t);this.store.set(t,i===void 0?u:u&i)}entries(){return[...this.store.entries()].map(([t,r])=>[t,!!(r&2),!!(r&1)])}};z2.MatchRecord=ste;var ate=class{store=new Map;add(t,r){if(!t.canReaddir())return;let n=this.store.get(t);n?n.find(u=>u.globString()===r.globString())||n.push(r):this.store.set(t,[r])}get(t){let r=this.store.get(t);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}};z2.SubWalks=ate;var Rxe=class e{hasWalkedCache;matches=new ste;subwalks=new ate;patterns;follow;dot;opts;constructor(t,r){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=r?r.copy():new ote}processPatterns(t,r){this.patterns=r;let n=r.map(u=>[t,u]);for(let[u,i]of n){this.hasWalkedCache.storeWalked(u,i);let o=i.root(),s=i.isAbsolute()&&this.opts.absolute!==!1;if(o){u=u.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=i.rest();if(f)i=f;else{this.matches.add(u,!0,!1);continue}}if(u.isENOENT())continue;let a,c,l=!1;for(;typeof(a=i.pattern())=="string"&&(c=i.rest());)u=u.resolve(a),i=c,l=!0;if(a=i.pattern(),c=i.rest(),l){if(this.hasWalkedCache.hasWalked(u,i))continue;this.hasWalkedCache.storeWalked(u,i)}if(typeof a=="string"){let f=a===".."||a===""||a===".";this.matches.add(u.resolve(a),s,f);continue}else if(a===YSt.GLOBSTAR){(!u.isSymbolicLink()||this.follow||i.checkFollowGlobstar())&&this.subwalks.add(u,i);let f=c==null?void 0:c.pattern(),p=c==null?void 0:c.rest();if(!c||(f===""||f===".")&&!p)this.matches.add(u,s,f===""||f===".");else if(f===".."){let h=u.parent||u;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,s,!0)}}else a instanceof RegExp&&this.subwalks.add(u,i)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(t,r){let n=this.subwalks.get(t),u=this.child();for(let i of r)for(let o of n){let s=o.isAbsolute(),a=o.pattern(),c=o.rest();a===YSt.GLOBSTAR?u.testGlobstar(i,o,c,s):a instanceof RegExp?u.testRegExp(i,a,c,s):u.testString(i,a,c,s)}return u}testGlobstar(t,r,n,u){if((this.dot||!t.name.startsWith("."))&&(r.hasMore()||this.matches.add(t,u,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,r):t.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(t,n):r.markFollowGlobstar()&&this.subwalks.add(t,r)))),n){let i=n.pattern();if(typeof i=="string"&&i!==".."&&i!==""&&i!==".")this.testString(t,i,n.rest(),u);else if(i===".."){let o=t.parent||t;this.subwalks.add(o,n)}else i instanceof RegExp&&this.testRegExp(t,i,n.rest(),u)}}testRegExp(t,r,n,u){r.test(t.name)&&(n?this.subwalks.add(t,n):this.matches.add(t,u,!1))}testString(t,r,n,u){t.isNamed(r)&&(n?this.subwalks.add(t,n):this.matches.add(t,u,!1))}};z2.Processor=Rxe});var ZSt=I(dv=>{"use strict";Object.defineProperty(dv,"__esModule",{value:!0});dv.GlobStream=dv.GlobWalker=dv.GlobUtil=void 0;var swn=Exe(),JSt=kxe(),QSt=XSt(),awn=(e,t)=>typeof e=="string"?new JSt.Ignore([e],t):Array.isArray(e)?new JSt.Ignore(e,t):e,AA,sg,x3,ag,C3,yI,Ixe,DI=class{constructor(t,r,n){Rt(this,ag);Rt(this,yI);Cn(this,"path");Cn(this,"patterns");Cn(this,"opts");Cn(this,"seen",new Set);Cn(this,"paused",!1);Cn(this,"aborted",!1);Rt(this,AA,[]);Rt(this,sg,void 0);Rt(this,x3,void 0);Cn(this,"signal");Cn(this,"maxDepth");Cn(this,"includeChildMatches");var u;if(this.patterns=t,this.path=r,this.opts=n,Bt(this,x3,!n.posix&&n.platform==="win32"?"\\":"/"),this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(Bt(this,sg,awn((u=n.ignore)!=null?u:[],n)),!this.includeChildMatches&&typeof be(this,sg).add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{be(this,AA).length=0}))}pause(){this.paused=!0}resume(){var r;if((r=this.signal)!=null&&r.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=be(this,AA).shift());)t()}onResume(t){var r;(r=this.signal)!=null&&r.aborted||(this.paused?be(this,AA).push(t):t())}async matchCheck(t,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=t.realpathCached()||await t.realpath(),!n)return;t=n}let i=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&(i!=null&&i.isSymbolicLink())){let o=await i.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(i,r)}matchCheckTest(t,r){var n;return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!r||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!((n=t.realpathCached())!=null&&n.isDirectory()))&&!qt(this,ag,C3).call(this,t)?t:void 0}matchCheckSync(t,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=t.realpathCached()||t.realpathSync(),!n)return;t=n}let i=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&(i!=null&&i.isSymbolicLink())){let o=i.realpathSync();o&&(o!=null&&o.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(i,r)}matchFinish(t,r){var i;if(qt(this,ag,C3).call(this,t))return;if(!this.includeChildMatches&&((i=be(this,sg))!=null&&i.add)){let o=`${t.relativePosix()}/**`;be(this,sg).add(o)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(t);let u=this.opts.mark&&t.isDirectory()?be(this,x3):"";if(this.opts.withFileTypes)this.matchEmit(t);else if(n){let o=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(o+u)}else{let o=this.opts.posix?t.relativePosix():t.relative(),s=this.opts.dotRelative&&!o.startsWith(".."+be(this,x3))?"."+be(this,x3):"";this.matchEmit(o?s+o+u:"."+u)}}async match(t,r,n){let u=await this.matchCheck(t,n);u&&this.matchFinish(u,r)}matchSync(t,r,n){let u=this.matchCheckSync(t,n);u&&this.matchFinish(u,r)}walkCB(t,r,n){var u;(u=this.signal)!=null&&u.aborted&&n(),this.walkCB2(t,r,new QSt.Processor(this.opts),n)}walkCB2(t,r,n,u){var s;if(qt(this,yI,Ixe).call(this,t))return u();if((s=this.signal)!=null&&s.aborted&&u(),this.paused){this.onResume(()=>this.walkCB2(t,r,n,u));return}n.processPatterns(t,r);let i=1,o=()=>{--i===0&&u()};for(let[a,c,l]of n.matches.entries())qt(this,ag,C3).call(this,a)||(i++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,f)=>this.walkCB3(a,f,n,o),!0)}o()}walkCB3(t,r,n,u){n=n.filterEntries(t,r);let i=1,o=()=>{--i===0&&u()};for(let[s,a,c]of n.matches.entries())qt(this,ag,C3).call(this,s)||(i++,this.match(s,a,c).then(()=>o()));for(let[s,a]of n.subwalks.entries())i++,this.walkCB2(s,a,n.child(),o);o()}walkCBSync(t,r,n){var u;(u=this.signal)!=null&&u.aborted&&n(),this.walkCB2Sync(t,r,new QSt.Processor(this.opts),n)}walkCB2Sync(t,r,n,u){var s;if(qt(this,yI,Ixe).call(this,t))return u();if((s=this.signal)!=null&&s.aborted&&u(),this.paused){this.onResume(()=>this.walkCB2Sync(t,r,n,u));return}n.processPatterns(t,r);let i=1,o=()=>{--i===0&&u()};for(let[a,c,l]of n.matches.entries())qt(this,ag,C3).call(this,a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(t,r,n,u){n=n.filterEntries(t,r);let i=1,o=()=>{--i===0&&u()};for(let[s,a,c]of n.matches.entries())qt(this,ag,C3).call(this,s)||this.matchSync(s,a,c);for(let[s,a]of n.subwalks.entries())i++,this.walkCB2Sync(s,a,n.child(),o);o()}};AA=new WeakMap,sg=new WeakMap,x3=new WeakMap,ag=new WeakSet,C3=function(t){var r,n;return this.seen.has(t)||!!((n=(r=be(this,sg))==null?void 0:r.ignored)!=null&&n.call(r,t))},yI=new WeakSet,Ixe=function(t){var r,n;return!!((n=(r=be(this,sg))==null?void 0:r.childrenIgnored)!=null&&n.call(r,t))};dv.GlobUtil=DI;var jxe=class extends DI{matches=new Set;constructor(t,r,n){super(t,r,n)}matchEmit(t){this.matches.add(t)}async walk(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((r,n)=>{this.walkCB(this.path,this.patterns,()=>{var u;(u=this.signal)!=null&&u.aborted?n(this.signal.reason):r(this.matches)})}),this.matches}walkSync(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var r;if((r=this.signal)!=null&&r.aborted)throw this.signal.reason}),this.matches}};dv.GlobWalker=jxe;var Lxe=class extends DI{results;constructor(t,r,n){super(t,r,n),this.results=new swn.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,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}};dv.GlobStream=Lxe});var qxe=I(fte=>{"use strict";Object.defineProperty(fte,"__esModule",{value:!0});fte.Glob=void 0;var cwn=uv(),lwn=require("url"),cte=HSt(),fwn=Txe(),lte=ZSt(),pwn=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Nxe=class{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(t,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,lwn.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(a=>a.includes("/")?a:`./**/${a}`)}if(this.pattern=t,this.platform=r.platform||pwn,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let a=r.platform==="win32"?cte.PathScurryWin32:r.platform==="darwin"?cte.PathScurryDarwin:r.platform?cte.PathScurryPosix:cte.PathScurry;this.scurry=new a(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",u={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},i=this.pattern.map(a=>new cwn.Minimatch(a,u)),[o,s]=i.reduce((a,c)=>(a[0].push(...c.set),a[1].push(...c.globParts),a),[[],[]]);this.patterns=o.map((a,c)=>{let l=s[c];if(!l)throw new Error("invalid pattern object");return new fwn.Pattern(a,l,0,this.platform)})}async walk(){return[...await new lte.GlobWalker(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 lte.GlobWalker(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 lte.GlobStream(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 lte.GlobStream(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()}};fte.Glob=Nxe});var Mxe=I(pte=>{"use strict";Object.defineProperty(pte,"__esModule",{value:!0});pte.hasMagic=void 0;var hwn=uv(),dwn=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let r of e)if(new hwn.Minimatch(r,t).hasMagic())return!0;return!1};pte.hasMagic=dwn});var nOt=I(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.glob=In.sync=In.iterate=In.iterateSync=In.stream=In.streamSync=In.globIterate=In.globIterateSync=In.globSync=In.globStream=In.globStreamSync=In.Ignore=In.hasMagic=In.Glob=In.unescape=In.escape=void 0;var eOt=uv(),A3=qxe(),mwn=Mxe(),rOt=uv();Object.defineProperty(In,"escape",{enumerable:!0,get:function(){return rOt.escape}});Object.defineProperty(In,"unescape",{enumerable:!0,get:function(){return rOt.unescape}});var gwn=qxe();Object.defineProperty(In,"Glob",{enumerable:!0,get:function(){return gwn.Glob}});var vwn=Mxe();Object.defineProperty(In,"hasMagic",{enumerable:!0,get:function(){return vwn.hasMagic}});var Dwn=kxe();Object.defineProperty(In,"Ignore",{enumerable:!0,get:function(){return Dwn.Ignore}});function EI(e,t={}){return new A3.Glob(e,t).streamSync()}In.globStreamSync=EI;function Uxe(e,t={}){return new A3.Glob(e,t).stream()}In.globStream=Uxe;function $xe(e,t={}){return new A3.Glob(e,t).walkSync()}In.globSync=$xe;async function tOt(e,t={}){return new A3.Glob(e,t).walk()}function bI(e,t={}){return new A3.Glob(e,t).iterateSync()}In.globIterateSync=bI;function zxe(e,t={}){return new A3.Glob(e,t).iterate()}In.globIterate=zxe;In.streamSync=EI;In.stream=Object.assign(Uxe,{sync:EI});In.iterateSync=bI;In.iterate=Object.assign(zxe,{sync:bI});In.sync=Object.assign($xe,{stream:EI,iterate:bI});In.glob=Object.assign(tOt,{glob:tOt,globSync:$xe,sync:In.sync,globStream:Uxe,stream:In.stream,globStreamSync:EI,streamSync:In.streamSync,globIterate:zxe,iterate:In.iterate,globIterateSync:bI,iterateSync:In.iterateSync,Glob:A3.Glob,hasMagic:mwn.hasMagic,escape:eOt.escape,unescape:eOt.unescape});In.glob.glob=In.glob});var Gxe=I(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.optArgSync=Ch.optArg=Ch.assertRimrafOptions=Ch.isRimrafOptions=void 0;var mv=(e,t)=>typeof e>"u"||typeof e===t,ywn=e=>!!e&&typeof e=="object"&&mv(e.preserveRoot,"boolean")&&mv(e.tmp,"string")&&mv(e.maxRetries,"number")&&mv(e.retryDelay,"number")&&mv(e.backoff,"number")&&mv(e.maxBackoff,"number")&&(mv(e.glob,"boolean")||e.glob&&typeof e.glob=="object")&&mv(e.filter,"function");Ch.isRimrafOptions=ywn;var Ewn=e=>{if(!(0,Ch.isRimrafOptions)(e))throw new Error("invalid rimraf options")};Ch.assertRimrafOptions=Ewn;var uOt=e=>{(0,Ch.assertRimrafOptions)(e);let{glob:t,...r}=e;if(!t)return r;let n=t===!0?e.signal?{signal:e.signal}:{}:e.signal?{signal:e.signal,...t}:t;return{...r,glob:{...n,absolute:!0,withFileTypes:!1}}},bwn=(e={})=>uOt(e);Ch.optArg=bwn;var Cwn=(e={})=>uOt(e);Ch.optArgSync=Cwn});var CI=I(Wxe=>{"use strict";Object.defineProperty(Wxe,"__esModule",{value:!0});Wxe.default=process.env.__TESTING_RIMRAF_PLATFORM__||process.platform});var iOt=I(xI=>{"use strict";var xwn=xI&&xI.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xI,"__esModule",{value:!0});var Vxe=require("path"),Awn=require("util"),Fwn=xwn(CI()),_wn=(e,t={})=>{let r=typeof e;if(r!=="string"){let u=e&&r==="object"&&e.constructor,o=`The "path" argument must be of type string. Received ${u&&u.name?`an instance of ${u.name}`:r==="object"?(0,Awn.inspect)(e):`type ${r} ${e}`}`;throw Object.assign(new TypeError(o),{path:e,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(e)){let u="path must be a string without null bytes";throw Object.assign(new TypeError(u),{path:e,code:"ERR_INVALID_ARG_VALUE"})}e=(0,Vxe.resolve)(e);let{root:n}=(0,Vxe.parse)(e);if(e===n&&t.preserveRoot!==!1){let u="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(u),{path:e,code:"ERR_PRESERVE_ROOT"})}if(Fwn.default==="win32"){let u=/[*|"<>?:]/,{root:i}=(0,Vxe.parse)(e);if(u.test(e.substring(i.length)))throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e};xI.default=_wn});var vv=I(eo=>{"use strict";var Bwn=eo&&eo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(eo,"__esModule",{value:!0});eo.promises=eo.readdirSync=eo.unlinkSync=eo.lstatSync=eo.statSync=eo.rmSync=eo.rmdirSync=eo.renameSync=eo.mkdirSync=eo.chmodSync=void 0;var cg=Bwn(require("fs")),gv=require("fs");Object.defineProperty(eo,"chmodSync",{enumerable:!0,get:function(){return gv.chmodSync}});Object.defineProperty(eo,"mkdirSync",{enumerable:!0,get:function(){return gv.mkdirSync}});Object.defineProperty(eo,"renameSync",{enumerable:!0,get:function(){return gv.renameSync}});Object.defineProperty(eo,"rmdirSync",{enumerable:!0,get:function(){return gv.rmdirSync}});Object.defineProperty(eo,"rmSync",{enumerable:!0,get:function(){return gv.rmSync}});Object.defineProperty(eo,"statSync",{enumerable:!0,get:function(){return gv.statSync}});Object.defineProperty(eo,"lstatSync",{enumerable:!0,get:function(){return gv.lstatSync}});Object.defineProperty(eo,"unlinkSync",{enumerable:!0,get:function(){return gv.unlinkSync}});var wwn=require("fs"),Swn=e=>(0,wwn.readdirSync)(e,{withFileTypes:!0});eo.readdirSync=Swn;var Own=(e,t)=>new Promise((r,n)=>cg.default.chmod(e,t,(u,...i)=>u?n(u):r(...i))),Twn=(e,t)=>new Promise((r,n)=>cg.default.mkdir(e,t,(u,i)=>u?n(u):r(i))),Pwn=e=>new Promise((t,r)=>cg.default.readdir(e,{withFileTypes:!0},(n,u)=>n?r(n):t(u))),kwn=(e,t)=>new Promise((r,n)=>cg.default.rename(e,t,(u,...i)=>u?n(u):r(...i))),Rwn=(e,t)=>new Promise((r,n)=>cg.default.rm(e,t,(u,...i)=>u?n(u):r(...i))),Iwn=e=>new Promise((t,r)=>cg.default.rmdir(e,(n,...u)=>n?r(n):t(...u))),jwn=e=>new Promise((t,r)=>cg.default.stat(e,(n,u)=>n?r(n):t(u))),Lwn=e=>new Promise((t,r)=>cg.default.lstat(e,(n,u)=>n?r(n):t(u))),Nwn=e=>new Promise((t,r)=>cg.default.unlink(e,(n,...u)=>n?r(n):t(...u)));eo.promises={chmod:Own,mkdir:Twn,readdir:Pwn,rename:kwn,rm:Rwn,rmdir:Iwn,stat:jwn,lstat:Lwn,unlink:Nwn}});var hte=I(FA=>{"use strict";Object.defineProperty(FA,"__esModule",{value:!0});FA.readdirOrErrorSync=FA.readdirOrError=void 0;var oOt=vv(),{readdir:qwn}=oOt.promises,Mwn=e=>qwn(e).catch(t=>t);FA.readdirOrError=Mwn;var Uwn=e=>{try{return(0,oOt.readdirSync)(e)}catch(t){return t}};FA.readdirOrErrorSync=Uwn});var dte=I(_A=>{"use strict";Object.defineProperty(_A,"__esModule",{value:!0});_A.ignoreENOENTSync=_A.ignoreENOENT=void 0;var $wn=async e=>e.catch(t=>{if(t.code!=="ENOENT")throw t});_A.ignoreENOENT=$wn;var zwn=e=>{try{return e()}catch(t){if((t==null?void 0:t.code)!=="ENOENT")throw t}};_A.ignoreENOENTSync=zwn});var Hxe=I(BA=>{"use strict";Object.defineProperty(BA,"__esModule",{value:!0});BA.rimrafPosixSync=BA.rimrafPosix=void 0;var mte=vv(),{lstat:Gwn,rmdir:Wwn,unlink:Vwn}=mte.promises,gte=require("path"),sOt=hte(),vte=dte(),Hwn=async(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return await aOt(e,t,await Gwn(e))}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};BA.rimrafPosix=Hwn;var Kwn=(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return cOt(e,t,(0,mte.lstatSync)(e))}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};BA.rimrafPosixSync=Kwn;var aOt=async(e,t,r)=>{var i;if((i=t==null?void 0:t.signal)!=null&&i.aborted)throw t.signal.reason;let n=r.isDirectory()?await(0,sOt.readdirOrError)(e):null;if(!Array.isArray(n)){if(n){if(n.code==="ENOENT")return!0;if(n.code!=="ENOTDIR")throw n}return t.filter&&!await t.filter(e,r)?!1:(await(0,vte.ignoreENOENT)(Vwn(e)),!0)}return!(await Promise.all(n.map(o=>aOt((0,gte.resolve)(e,o.name),t,o)))).reduce((o,s)=>o&&s,!0)||t.preserveRoot===!1&&e===(0,gte.parse)(e).root||t.filter&&!await t.filter(e,r)?!1:(await(0,vte.ignoreENOENT)(Wwn(e)),!0)},cOt=(e,t,r)=>{var i;if((i=t==null?void 0:t.signal)!=null&&i.aborted)throw t.signal.reason;let n=r.isDirectory()?(0,sOt.readdirOrErrorSync)(e):null;if(!Array.isArray(n)){if(n){if(n.code==="ENOENT")return!0;if(n.code!=="ENOTDIR")throw n}return t.filter&&!t.filter(e,r)?!1:((0,vte.ignoreENOENTSync)(()=>(0,mte.unlinkSync)(e)),!0)}let u=!0;for(let o of n){let s=(0,gte.resolve)(e,o.name);u=cOt(s,t,o)&&u}return t.preserveRoot===!1&&e===(0,gte.parse)(e).root||!u||t.filter&&!t.filter(e,r)?!1:((0,vte.ignoreENOENTSync)(()=>(0,mte.rmdirSync)(e)),!0)}});var fOt=I(wA=>{"use strict";Object.defineProperty(wA,"__esModule",{value:!0});wA.fixEPERMSync=wA.fixEPERM=void 0;var lOt=vv(),{chmod:Ywn}=lOt.promises,Xwn=e=>async t=>{try{return await e(t)}catch(r){let n=r;if((n==null?void 0:n.code)==="ENOENT")return;if((n==null?void 0:n.code)==="EPERM"){try{await Ywn(t,438)}catch(u){let i=u;if((i==null?void 0:i.code)==="ENOENT")return;throw r}return await e(t)}throw r}};wA.fixEPERM=Xwn;var Jwn=e=>t=>{try{return e(t)}catch(r){let n=r;if((n==null?void 0:n.code)==="ENOENT")return;if((n==null?void 0:n.code)==="EPERM"){try{(0,lOt.chmodSync)(t,438)}catch(u){let i=u;if((i==null?void 0:i.code)==="ENOENT")return;throw r}return e(t)}throw r}};wA.fixEPERMSync=Jwn});var pOt=I(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.retryBusySync=As.retryBusy=As.codes=As.MAXRETRIES=As.RATE=As.MAXBACKOFF=void 0;As.MAXBACKOFF=200;As.RATE=1.2;As.MAXRETRIES=10;As.codes=new Set(["EMFILE","ENFILE","EBUSY"]);var Qwn=e=>{let t=async(r,n,u=1,i=0)=>{let o=n.maxBackoff||As.MAXBACKOFF,s=n.backoff||As.RATE,a=n.maxRetries||As.MAXRETRIES,c=0;for(;;)try{return await e(r)}catch(l){let f=l;if((f==null?void 0:f.path)===r&&(f!=null&&f.code)&&As.codes.has(f.code)){if(u=Math.ceil(u*s),i=u+i,i<o)return new Promise((p,h)=>{setTimeout(()=>{t(r,n,u,i).then(p,h)},u)});if(c<a){c++;continue}}throw l}};return t};As.retryBusy=Qwn;var Zwn=e=>(r,n)=>{let u=n.maxRetries||As.MAXRETRIES,i=0;for(;;)try{return e(r)}catch(o){let s=o;if((s==null?void 0:s.path)===r&&(s!=null&&s.code)&&As.codes.has(s.code)&&i<u){i++;continue}throw o}};As.retryBusySync=Zwn});var mOt=I(Dv=>{"use strict";var eSn=Dv&&Dv.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dv,"__esModule",{value:!0});Dv.defaultTmpSync=Dv.defaultTmp=void 0;var Dte=require("os"),SA=require("path"),hOt=vv(),dOt=eSn(CI()),{stat:tSn}=hOt.promises,rSn=e=>{try{return(0,hOt.statSync)(e).isDirectory()}catch{return!1}},nSn=e=>tSn(e).then(t=>t.isDirectory(),()=>!1),uSn=async e=>{let{root:t}=(0,SA.parse)(e),r=(0,Dte.tmpdir)(),{root:n}=(0,SA.parse)(r);if(t.toLowerCase()===n.toLowerCase())return r;let u=(0,SA.resolve)(t,"/temp");return await nSn(u)?u:t},iSn=e=>{let{root:t}=(0,SA.parse)(e),r=(0,Dte.tmpdir)(),{root:n}=(0,SA.parse)(r);if(t.toLowerCase()===n.toLowerCase())return r;let u=(0,SA.resolve)(t,"/temp");return rSn(u)?u:t},oSn=async()=>(0,Dte.tmpdir)(),sSn=()=>(0,Dte.tmpdir)();Dv.defaultTmp=dOt.default==="win32"?uSn:oSn;Dv.defaultTmpSync=dOt.default==="win32"?iSn:sSn});var Xxe=I(TA=>{"use strict";Object.defineProperty(TA,"__esModule",{value:!0});TA.rimrafMoveRemoveSync=TA.rimrafMoveRemove=void 0;var lg=require("path"),yOt=mOt(),yte=dte(),OA=vv(),{lstat:aSn,rename:cSn,unlink:gOt,rmdir:lSn,chmod:fSn}=OA.promises,EOt=hte(),bOt=e=>`.${(0,lg.basename)(e)}.${Math.random()}`,pSn=async e=>gOt(e).catch(t=>{if(t.code==="EPERM")return fSn(e,438).then(()=>gOt(e),r=>{if(r.code!=="ENOENT")throw t});if(t.code==="ENOENT")return;throw t}),hSn=e=>{try{(0,OA.unlinkSync)(e)}catch(t){if((t==null?void 0:t.code)==="EPERM")try{return(0,OA.chmodSync)(e,438)}catch(r){if((r==null?void 0:r.code)==="ENOENT")return;throw t}else if((t==null?void 0:t.code)==="ENOENT")return;throw t}},dSn=async(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return await Kxe(e,t,await aSn(e))}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};TA.rimrafMoveRemove=dSn;var Kxe=async(e,t,r)=>{var i;if((i=t==null?void 0:t.signal)!=null&&i.aborted)throw t.signal.reason;if(!t.tmp)return Kxe(e,{...t,tmp:await(0,yOt.defaultTmp)(e)},r);if(e===t.tmp&&(0,lg.parse)(e).root!==e)throw new Error("cannot delete temp directory used for deletion");let n=r.isDirectory()?await(0,EOt.readdirOrError)(e):null;if(!Array.isArray(n)){if(n){if(n.code==="ENOENT")return!0;if(n.code!=="ENOTDIR")throw n}return t.filter&&!await t.filter(e,r)?!1:(await(0,yte.ignoreENOENT)(vOt(e,t.tmp,pSn)),!0)}return!(await Promise.all(n.map(o=>Kxe((0,lg.resolve)(e,o.name),t,o)))).reduce((o,s)=>o&&s,!0)||t.preserveRoot===!1&&e===(0,lg.parse)(e).root||t.filter&&!await t.filter(e,r)?!1:(await(0,yte.ignoreENOENT)(vOt(e,t.tmp,lSn)),!0)},vOt=async(e,t,r)=>{let n=(0,lg.resolve)(t,bOt(e));return await cSn(e,n),await r(n)},mSn=(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return Yxe(e,t,(0,OA.lstatSync)(e))}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};TA.rimrafMoveRemoveSync=mSn;var Yxe=(e,t,r)=>{var o;if((o=t==null?void 0:t.signal)!=null&&o.aborted)throw t.signal.reason;if(!t.tmp)return Yxe(e,{...t,tmp:(0,yOt.defaultTmpSync)(e)},r);let n=t.tmp;if(e===t.tmp&&(0,lg.parse)(e).root!==e)throw new Error("cannot delete temp directory used for deletion");let u=r.isDirectory()?(0,EOt.readdirOrErrorSync)(e):null;if(!Array.isArray(u)){if(u){if(u.code==="ENOENT")return!0;if(u.code!=="ENOTDIR")throw u}return t.filter&&!t.filter(e,r)?!1:((0,yte.ignoreENOENTSync)(()=>DOt(e,n,hSn)),!0)}let i=!0;for(let s of u){let a=(0,lg.resolve)(e,s.name);i=Yxe(a,t,s)&&i}return!i||t.preserveRoot===!1&&e===(0,lg.parse)(e).root||t.filter&&!t.filter(e,r)?!1:((0,yte.ignoreENOENTSync)(()=>DOt(e,n,OA.rmdirSync)),!0)},DOt=(e,t,r)=>{let n=(0,lg.resolve)(t,bOt(e));return(0,OA.renameSync)(e,n),r(n)}});var Zxe=I(PA=>{"use strict";Object.defineProperty(PA,"__esModule",{value:!0});PA.rimrafWindowsSync=PA.rimrafWindows=void 0;var Ete=require("path"),xte=fOt(),Ate=vv(),bte=dte(),COt=hte(),Fte=pOt(),xOt=Xxe(),{unlink:gSn,rmdir:vSn,lstat:DSn}=Ate.promises,ySn=(0,Fte.retryBusy)((0,xte.fixEPERM)(gSn)),ESn=(0,Fte.retryBusySync)((0,xte.fixEPERMSync)(Ate.unlinkSync)),bSn=(0,Fte.retryBusy)((0,xte.fixEPERM)(vSn)),CSn=(0,Fte.retryBusySync)((0,xte.fixEPERMSync)(Ate.rmdirSync)),xSn=async(e,t)=>{var u;if((u=t==null?void 0:t.signal)!=null&&u.aborted)throw t.signal.reason;let{filter:r,...n}=t;try{return await bSn(e,n)}catch(i){if((i==null?void 0:i.code)==="ENOTEMPTY")return await(0,xOt.rimrafMoveRemove)(e,n);throw i}},ASn=(e,t)=>{var u;if((u=t==null?void 0:t.signal)!=null&&u.aborted)throw t.signal.reason;let{filter:r,...n}=t;try{return CSn(e,n)}catch(i){let o=i;if((o==null?void 0:o.code)==="ENOTEMPTY")return(0,xOt.rimrafMoveRemoveSync)(e,n);throw i}},yv=Symbol("start"),AOt=Symbol("child"),Cte=Symbol("finish"),FSn=async(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return await Jxe(e,t,await DSn(e),yv)}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};PA.rimrafWindows=FSn;var _Sn=(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return Qxe(e,t,(0,Ate.lstatSync)(e),yv)}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};PA.rimrafWindowsSync=_Sn;var Jxe=async(e,t,r,n=yv)=>{var s;if((s=t==null?void 0:t.signal)!=null&&s.aborted)throw t.signal.reason;let u=r.isDirectory()?await(0,COt.readdirOrError)(e):null;if(!Array.isArray(u)){if(u){if(u.code==="ENOENT")return!0;if(u.code!=="ENOTDIR")throw u}return t.filter&&!await t.filter(e,r)?!1:(await(0,bte.ignoreENOENT)(ySn(e,t)),!0)}let i=n===yv?AOt:n,o=(await Promise.all(u.map(a=>Jxe((0,Ete.resolve)(e,a.name),t,a,i)))).reduce((a,c)=>a&&c,!0);if(n===yv)return Jxe(e,t,r,Cte);if(n===Cte){if(t.preserveRoot===!1&&e===(0,Ete.parse)(e).root||!o||t.filter&&!await t.filter(e,r))return!1;await(0,bte.ignoreENOENT)(xSn(e,t))}return!0},Qxe=(e,t,r,n=yv)=>{let u=r.isDirectory()?(0,COt.readdirOrErrorSync)(e):null;if(!Array.isArray(u)){if(u){if(u.code==="ENOENT")return!0;if(u.code!=="ENOTDIR")throw u}return t.filter&&!t.filter(e,r)?!1:((0,bte.ignoreENOENTSync)(()=>ESn(e,t)),!0)}let i=!0;for(let o of u){let s=n===yv?AOt:n,a=(0,Ete.resolve)(e,o.name);i=Qxe(a,t,o,s)&&i}if(n===yv)return Qxe(e,t,r,Cte);if(n===Cte){if(t.preserveRoot===!1&&e===(0,Ete.parse)(e).root||!i||t.filter&&!t.filter(e,r))return!1;(0,bte.ignoreENOENTSync)(()=>{ASn(e,t)})}return!0}});var wOt=I(Ev=>{"use strict";var BSn=Ev&&Ev.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ev,"__esModule",{value:!0});Ev.rimrafManualSync=Ev.rimrafManual=void 0;var FOt=BSn(CI()),_Ot=Hxe(),BOt=Zxe();Ev.rimrafManual=FOt.default==="win32"?BOt.rimrafWindows:_Ot.rimrafPosix;Ev.rimrafManualSync=FOt.default==="win32"?BOt.rimrafWindowsSync:_Ot.rimrafPosixSync});var OOt=I(kA=>{"use strict";Object.defineProperty(kA,"__esModule",{value:!0});kA.rimrafNativeSync=kA.rimrafNative=void 0;var SOt=vv(),{rm:wSn}=SOt.promises,SSn=async(e,t)=>(await wSn(e,{...t,force:!0,recursive:!0}),!0);kA.rimrafNative=SSn;var OSn=(e,t)=>((0,SOt.rmSync)(e,{...t,force:!0,recursive:!0}),!0);kA.rimrafNativeSync=OSn});var ROt=I(bv=>{"use strict";var TSn=bv&&bv.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bv,"__esModule",{value:!0});bv.useNativeSync=bv.useNative=void 0;var POt=TSn(CI()),PSn=process.env.__TESTING_RIMRAF_NODE_VERSION__||process.version,kSn=PSn.replace(/^v/,"").split("."),[TOt=0,RSn=0]=kSn.map(e=>parseInt(e,10)),kOt=TOt>14||TOt===14&&RSn>=14;bv.useNative=!kOt||POt.default==="win32"?()=>!1:e=>!(e!=null&&e.signal)&&!(e!=null&&e.filter);bv.useNativeSync=!kOt||POt.default==="win32"?()=>!1:e=>!(e!=null&&e.signal)&&!(e!=null&&e.filter)});var zOt=I(en=>{"use strict";var ISn=en&&en.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(en,"__esModule",{value:!0});en.rimraf=en.sync=en.rimrafSync=en.moveRemove=en.moveRemoveSync=en.posix=en.posixSync=en.windows=en.windowsSync=en.manual=en.manualSync=en.native=en.nativeSync=en.isRimrafOptions=en.assertRimrafOptions=void 0;var jOt=nOt(),LOt=Gxe(),_te=ISn(iOt()),Bte=wOt(),NOt=Xxe(),wte=OOt(),qOt=Hxe(),MOt=Zxe(),UOt=ROt(),$Ot=Gxe();Object.defineProperty(en,"assertRimrafOptions",{enumerable:!0,get:function(){return $Ot.assertRimrafOptions}});Object.defineProperty(en,"isRimrafOptions",{enumerable:!0,get:function(){return $Ot.isRimrafOptions}});var RA=e=>async(t,r)=>{let n=(0,LOt.optArg)(r);return n.glob&&(t=await(0,jOt.glob)(t,n.glob)),Array.isArray(t)?!!(await Promise.all(t.map(u=>e((0,_te.default)(u,n),n)))).reduce((u,i)=>u&&i,!0):!!await e((0,_te.default)(t,n),n)},IA=e=>(t,r)=>{let n=(0,LOt.optArgSync)(r);return n.glob&&(t=(0,jOt.globSync)(t,n.glob)),Array.isArray(t)?!!t.map(u=>e((0,_te.default)(u,n),n)).reduce((u,i)=>u&&i,!0):!!e((0,_te.default)(t,n),n)};en.nativeSync=IA(wte.rimrafNativeSync);en.native=Object.assign(RA(wte.rimrafNative),{sync:en.nativeSync});en.manualSync=IA(Bte.rimrafManualSync);en.manual=Object.assign(RA(Bte.rimrafManual),{sync:en.manualSync});en.windowsSync=IA(MOt.rimrafWindowsSync);en.windows=Object.assign(RA(MOt.rimrafWindows),{sync:en.windowsSync});en.posixSync=IA(qOt.rimrafPosixSync);en.posix=Object.assign(RA(qOt.rimrafPosix),{sync:en.posixSync});en.moveRemoveSync=IA(NOt.rimrafMoveRemoveSync);en.moveRemove=Object.assign(RA(NOt.rimrafMoveRemove),{sync:en.moveRemoveSync});en.rimrafSync=IA((e,t)=>(0,UOt.useNativeSync)(t)?(0,wte.rimrafNativeSync)(e,t):(0,Bte.rimrafManualSync)(e,t));en.sync=en.rimrafSync;var IOt=RA((e,t)=>(0,UOt.useNative)(t)?(0,wte.rimrafNative)(e,t):(0,Bte.rimrafManual)(e,t));en.rimraf=Object.assign(IOt,{rimraf:IOt,sync:en.rimrafSync,rimrafSync:en.rimrafSync,manual:en.manual,manualSync:en.manualSync,native:en.native,nativeSync:en.nativeSync,posix:en.posix,posixSync:en.posixSync,windows:en.windows,windowsSync:en.windowsSync,moveRemove:en.moveRemove,moveRemoveSync:en.moveRemoveSync});en.rimraf.rimraf=en.rimraf});var KOt={};on(KOt,{default:()=>LSn});function GOt(){let e=(0,Ste.getRootHome)(),t=jA.default.join(e,"logs");AI.sync(t),bt.info("Logs cleaned up successfully.")}function WOt(e){let t=(0,Ste.getRootHome)(),r=jA.default.join(t,"cache");if(e===!0){AI.sync(r),bt.info("Cache cleaned up successfully.");return}AI.sync(jA.default.join(r,e)),bt.info(`Cache [${e}] has been cleaned up successfully.`)}function VOt(e){let t=(0,Ste.getRootHome)(),r=jA.default.join(t,"components");if(e===!0){AI.sync(r),bt.info("Component cleaned up successfully.");return}let n=jA.default.join(r,"devsapp.cn",e);if(!HOt.default.existsSync(n))return bt.tips(`Component [${e}] does not exist.`,"Please check whether the component has been downloaded.");AI.sync(n),bt.info(`Component [${e}] has been cleaned up successfully.`)}var HOt,Ste,jA,AI,jSn,LSn,YOt=Ft(()=>{HOt=ot(require("fs"));pr();pn();Ste=ot(xr()),jA=ot(require("path"));Mn();AI=zOt(),jSn=`Clean up the cache related functions of serverless devs. You can clean up the environment, unused dependent packages and related cache contents through this command.
|
|
348
|
+
>>> no match, partial?`,t,p,r,h),p===a))}let m;if(typeof l=="string"?(m=f===l,this.debug("string match",l,f,m)):(m=l.test(f),this.debug("pattern match",l,f,m)),!m)return!1}if(o===a&&s===c)return!0;if(o===a)return n;if(s===c)return o===a-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return(0,Cr.braceExpand)(this.pattern,this.options)}parse(t){(0,Tee.assertValidPattern)(t);let r=this.options;if(t==="**")return Cr.GLOBSTAR;if(t==="")return"";let n,u=null;(n=t.match(hBn))?u=r.dot?mBn:dBn:(n=t.match(nBn))?u=(r.nocase?r.dot?sBn:oBn:r.dot?iBn:uBn)(n[1]):(n=t.match(gBn))?u=(r.nocase?r.dot?DBn:vBn:r.dot?yBn:EBn)(n):(n=t.match(aBn))?u=r.dot?lBn:cBn:(n=t.match(fBn))&&(u=pBn);let i=hSt.AST.fromGlob(t,this.options).toMMPattern();return u&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:u}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?CBn:r.dot?xBn:ABn,u=new Set(r.nocase?["i"]:[]),i=t.map(a=>{let c=a.map(l=>{if(l instanceof RegExp)for(let f of l.flags.split(""))u.add(f);return typeof l=="string"?OBn(l):l===Cr.GLOBSTAR?Cr.GLOBSTAR:l._src});return c.forEach((l,f)=>{let p=c[f+1],h=c[f-1];l!==Cr.GLOBSTAR||h===Cr.GLOBSTAR||(h===void 0?p!==void 0&&p!==Cr.GLOBSTAR?c[f+1]="(?:\\/|"+n+"\\/)?"+p:c[f]=n:p===void 0?c[f-1]=h+"(?:\\/|"+n+")?":p!==Cr.GLOBSTAR&&(c[f-1]=h+"(?:\\/|\\/"+n+"\\/)"+p,c[f+1]=Cr.GLOBSTAR))}),c.filter(l=>l!==Cr.GLOBSTAR).join("/")}).join("|"),[o,s]=t.length>1?["(?:",")"]:["",""];i="^"+o+i+s+"$",this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...u].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let n=this.options;this.isWindows&&(t=t.split("\\").join("/"));let u=this.slashSplit(t);this.debug(this.pattern,"split",u);let i=this.set;this.debug(this.pattern,"set",i);let o=u[u.length-1];if(!o)for(let s=u.length-2;!o&&s>=0;s--)o=u[s];for(let s=0;s<i.length;s++){let a=i[s],c=u;if(n.matchBase&&a.length===1&&(c=[o]),this.matchOne(c,a,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return Cr.minimatch.defaults(t).Minimatch}};Cr.Minimatch=l3;var TBn=uxe();Object.defineProperty(Cr,"AST",{enumerable:!0,get:function(){return TBn.AST}});var PBn=ixe();Object.defineProperty(Cr,"escape",{enumerable:!0,get:function(){return PBn.escape}});var kBn=xee();Object.defineProperty(Cr,"unescape",{enumerable:!0,get:function(){return kBn.unescape}});Cr.minimatch.AST=hSt.AST;Cr.minimatch.Minimatch=l3;Cr.minimatch.escape=eBn.escape;Cr.minimatch.unescape=tBn.unescape});var xSt=I(jee=>{"use strict";Object.defineProperty(jee,"__esModule",{value:!0});jee.LRUCache=void 0;var aA=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ySt=new Set,oxe=typeof process=="object"&&process?process:{},ESt=(e,t,r,n)=>{typeof oxe.emitWarning=="function"?oxe.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},Ree=globalThis.AbortController,vSt=globalThis.AbortSignal,DSt;if(typeof Ree>"u"){vSt=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,u){this._onabort.push(u)}},Ree=class{constructor(){t()}signal=new vSt;abort(n){var u,i;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let o of this.signal._onabort)o(n);(i=(u=this.signal).onabort)==null||i.call(u,n)}}};let e=((DSt=oxe.env)==null?void 0:DSt.LRU_CACHE_IGNORE_AC_WARNING)!=="1",t=()=>{e&&(e=!1,ESt("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",t))}}var RBn=e=>!ySt.has(e),VUu=Symbol("type"),iv=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),bSt=e=>iv(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?cA:null:null,cA=class extends Array{constructor(t){super(t),this.fill(0)}},sxe=class e{heap;length;static#e=!1;static create(t){let r=bSt(t);if(!r)return[];e.#e=!0;let n=new e(t,r);return e.#e=!1,n}constructor(t,r){if(!e.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Hd,Q0,Kd,Yd,lA,Vs,Xd,xs,Mi,yn,Jl,Z0,sl,Ca,Jd,xa,Qd,Zd,ep,e1,av,Ql,xR,cxe,f3,eg,AR,tp,Iee,CSt,p3,fA,FR,L2,ov,N2,sv,_R,lxe,IBn,pA,Pee,hA,kee,mi,qi,BR,fxe,h3,CR,pxe=class pxe{constructor(t){Rt(this,xR);Rt(this,Iee);Rt(this,L2);Rt(this,N2);Rt(this,_R);Rt(this,pA);Rt(this,hA);Rt(this,mi);Rt(this,BR);Rt(this,h3);Rt(this,Hd,void 0);Rt(this,Q0,void 0);Rt(this,Kd,void 0);Rt(this,Yd,void 0);Rt(this,lA,void 0);Cn(this,"ttl");Cn(this,"ttlResolution");Cn(this,"ttlAutopurge");Cn(this,"updateAgeOnGet");Cn(this,"updateAgeOnHas");Cn(this,"allowStale");Cn(this,"noDisposeOnSet");Cn(this,"noUpdateTTL");Cn(this,"maxEntrySize");Cn(this,"sizeCalculation");Cn(this,"noDeleteOnFetchRejection");Cn(this,"noDeleteOnStaleGet");Cn(this,"allowStaleOnFetchAbort");Cn(this,"allowStaleOnFetchRejection");Cn(this,"ignoreFetchAbort");Rt(this,Vs,void 0);Rt(this,Xd,void 0);Rt(this,xs,void 0);Rt(this,Mi,void 0);Rt(this,yn,void 0);Rt(this,Jl,void 0);Rt(this,Z0,void 0);Rt(this,sl,void 0);Rt(this,Ca,void 0);Rt(this,Jd,void 0);Rt(this,xa,void 0);Rt(this,Qd,void 0);Rt(this,Zd,void 0);Rt(this,ep,void 0);Rt(this,e1,void 0);Rt(this,av,void 0);Rt(this,Ql,void 0);Rt(this,f3,()=>{});Rt(this,eg,()=>{});Rt(this,AR,()=>{});Rt(this,tp,()=>!1);Rt(this,p3,t=>{});Rt(this,fA,(t,r,n)=>{});Rt(this,FR,(t,r,n,u)=>{if(n||u)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Cn(this,IBn,"LRUCache");let{max:r=0,ttl:n,ttlResolution:u=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:l,noDisposeOnSet:f,noUpdateTTL:p,maxSize:h=0,maxEntrySize:d=0,sizeCalculation:m,fetchMethod:v,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:g,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:E,ignoreFetchAbort:b}=t;if(r!==0&&!iv(r))throw new TypeError("max option must be a nonnegative integer");let C=r?bSt(r):Array;if(!C)throw new Error("invalid max value: "+r);if(Bt(this,Hd,r),Bt(this,Q0,h),this.maxEntrySize=d||be(this,Q0),this.sizeCalculation=m,this.sizeCalculation){if(!be(this,Q0)&&!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(v!==void 0&&typeof v!="function")throw new TypeError("fetchMethod must be a function if specified");if(Bt(this,lA,v),Bt(this,av,!!v),Bt(this,xs,new Map),Bt(this,Mi,new Array(r).fill(void 0)),Bt(this,yn,new Array(r).fill(void 0)),Bt(this,Jl,new C(r)),Bt(this,Z0,new C(r)),Bt(this,sl,0),Bt(this,Ca,0),Bt(this,Jd,sxe.create(r)),Bt(this,Vs,0),Bt(this,Xd,0),typeof c=="function"&&Bt(this,Kd,c),typeof l=="function"?(Bt(this,Yd,l),Bt(this,xa,[])):(Bt(this,Yd,void 0),Bt(this,xa,void 0)),Bt(this,e1,!!be(this,Kd)),Bt(this,Ql,!!be(this,Yd)),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!D,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!b,this.maxEntrySize!==0){if(be(this,Q0)!==0&&!iv(be(this,Q0)))throw new TypeError("maxSize must be a positive integer if specified");if(!iv(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");qt(this,Iee,CSt).call(this)}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!g,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=iv(u)||u===0?u:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!iv(this.ttl))throw new TypeError("ttl must be a positive integer if specified");qt(this,xR,cxe).call(this)}if(be(this,Hd)===0&&this.ttl===0&&be(this,Q0)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!be(this,Hd)&&!be(this,Q0)){let x="LRU_CACHE_UNBOUNDED";RBn(x)&&(ySt.add(x),ESt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,pxe))}}static unsafeExposeInternals(t){return{starts:be(t,Zd),ttls:be(t,ep),sizes:be(t,Qd),keyMap:be(t,xs),keyList:be(t,Mi),valList:be(t,yn),next:be(t,Jl),prev:be(t,Z0),get head(){return be(t,sl)},get tail(){return be(t,Ca)},free:be(t,Jd),isBackgroundFetch:r=>{var n;return qt(n=t,mi,qi).call(n,r)},backgroundFetch:(r,n,u,i)=>{var o;return qt(o=t,hA,kee).call(o,r,n,u,i)},moveToTail:r=>{var n;return qt(n=t,h3,CR).call(n,r)},indexes:r=>{var n;return qt(n=t,L2,ov).call(n,r)},rindexes:r=>{var n;return qt(n=t,N2,sv).call(n,r)},isStale:r=>{var n;return be(n=t,tp).call(n,r)}}}get max(){return be(this,Hd)}get maxSize(){return be(this,Q0)}get calculatedSize(){return be(this,Xd)}get size(){return be(this,Vs)}get fetchMethod(){return be(this,lA)}get dispose(){return be(this,Kd)}get disposeAfter(){return be(this,Yd)}getRemainingTTL(t){return be(this,xs).has(t)?1/0:0}*entries(){for(let t of qt(this,L2,ov).call(this))be(this,yn)[t]!==void 0&&be(this,Mi)[t]!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield[be(this,Mi)[t],be(this,yn)[t]])}*rentries(){for(let t of qt(this,N2,sv).call(this))be(this,yn)[t]!==void 0&&be(this,Mi)[t]!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield[be(this,Mi)[t],be(this,yn)[t]])}*keys(){for(let t of qt(this,L2,ov).call(this)){let r=be(this,Mi)[t];r!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield r)}}*rkeys(){for(let t of qt(this,N2,sv).call(this)){let r=be(this,Mi)[t];r!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield r)}}*values(){for(let t of qt(this,L2,ov).call(this))be(this,yn)[t]!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield be(this,yn)[t])}*rvalues(){for(let t of qt(this,N2,sv).call(this))be(this,yn)[t]!==void 0&&!qt(this,mi,qi).call(this,be(this,yn)[t])&&(yield be(this,yn)[t])}[Symbol.iterator](){return this.entries()}find(t,r={}){for(let n of qt(this,L2,ov).call(this)){let u=be(this,yn)[n],i=qt(this,mi,qi).call(this,u)?u.__staleWhileFetching:u;if(i!==void 0&&t(i,be(this,Mi)[n],this))return this.get(be(this,Mi)[n],r)}}forEach(t,r=this){for(let n of qt(this,L2,ov).call(this)){let u=be(this,yn)[n],i=qt(this,mi,qi).call(this,u)?u.__staleWhileFetching:u;i!==void 0&&t.call(r,i,be(this,Mi)[n],this)}}rforEach(t,r=this){for(let n of qt(this,N2,sv).call(this)){let u=be(this,yn)[n],i=qt(this,mi,qi).call(this,u)?u.__staleWhileFetching:u;i!==void 0&&t.call(r,i,be(this,Mi)[n],this)}}purgeStale(){let t=!1;for(let r of qt(this,N2,sv).call(this,{allowStale:!0}))be(this,tp).call(this,r)&&(this.delete(be(this,Mi)[r]),t=!0);return t}info(t){let r=be(this,xs).get(t);if(r===void 0)return;let n=be(this,yn)[r],u=qt(this,mi,qi).call(this,n)?n.__staleWhileFetching:n;if(u===void 0)return;let i={value:u};if(be(this,ep)&&be(this,Zd)){let o=be(this,ep)[r],s=be(this,Zd)[r];if(o&&s){let a=o-(aA.now()-s);i.ttl=a,i.start=Date.now()}}return be(this,Qd)&&(i.size=be(this,Qd)[r]),i}dump(){let t=[];for(let r of qt(this,L2,ov).call(this,{allowStale:!0})){let n=be(this,Mi)[r],u=be(this,yn)[r],i=qt(this,mi,qi).call(this,u)?u.__staleWhileFetching:u;if(i===void 0||n===void 0)continue;let o={value:i};if(be(this,ep)&&be(this,Zd)){o.ttl=be(this,ep)[r];let s=aA.now()-be(this,Zd)[r];o.start=Math.floor(Date.now()-s)}be(this,Qd)&&(o.size=be(this,Qd)[r]),t.unshift([n,o])}return t}load(t){this.clear();for(let[r,n]of t){if(n.start){let u=Date.now()-n.start;n.start=aA.now()-u}this.set(r,n.value,n)}}set(t,r,n={}){var p,h,d,m,v;if(r===void 0)return this.delete(t),this;let{ttl:u=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=be(this,FR).call(this,t,r,n.size||0,s);if(this.maxEntrySize&&l>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.delete(t),this;let f=be(this,Vs)===0?void 0:be(this,xs).get(t);if(f===void 0)f=be(this,Vs)===0?be(this,Ca):be(this,Jd).length!==0?be(this,Jd).pop():be(this,Vs)===be(this,Hd)?qt(this,pA,Pee).call(this,!1):be(this,Vs),be(this,Mi)[f]=t,be(this,yn)[f]=r,be(this,xs).set(t,f),be(this,Jl)[be(this,Ca)]=f,be(this,Z0)[f]=be(this,Ca),Bt(this,Ca,f),UU(this,Vs)._++,be(this,fA).call(this,f,l,a),a&&(a.set="add"),c=!1;else{qt(this,h3,CR).call(this,f);let y=be(this,yn)[f];if(r!==y){if(be(this,av)&&qt(this,mi,qi).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=y;g!==void 0&&!o&&(be(this,e1)&&((p=be(this,Kd))==null||p.call(this,g,t,"set")),be(this,Ql)&&((h=be(this,xa))==null||h.push([g,t,"set"])))}else o||(be(this,e1)&&((d=be(this,Kd))==null||d.call(this,y,t,"set")),be(this,Ql)&&((m=be(this,xa))==null||m.push([y,t,"set"])));if(be(this,p3).call(this,f),be(this,fA).call(this,f,l,a),be(this,yn)[f]=r,a){a.set="replace";let g=y&&qt(this,mi,qi).call(this,y)?y.__staleWhileFetching:y;g!==void 0&&(a.oldValue=g)}}else a&&(a.set="update")}if(u!==0&&!be(this,ep)&&qt(this,xR,cxe).call(this),be(this,ep)&&(c||be(this,AR).call(this,f,u,i),a&&be(this,eg).call(this,a,f)),!o&&be(this,Ql)&&be(this,xa)){let y=be(this,xa),g;for(;g=y==null?void 0:y.shift();)(v=be(this,Yd))==null||v.call(this,...g)}return this}pop(){var t;try{for(;be(this,Vs);){let r=be(this,yn)[be(this,sl)];if(qt(this,pA,Pee).call(this,!0),qt(this,mi,qi).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(be(this,Ql)&&be(this,xa)){let r=be(this,xa),n;for(;n=r==null?void 0:r.shift();)(t=be(this,Yd))==null||t.call(this,...n)}}}has(t,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:u}=r,i=be(this,xs).get(t);if(i!==void 0){let o=be(this,yn)[i];if(qt(this,mi,qi).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(be(this,tp).call(this,i))u&&(u.has="stale",be(this,eg).call(this,u,i));else return n&&be(this,f3).call(this,i),u&&(u.has="hit",be(this,eg).call(this,u,i)),!0}else u&&(u.has="miss");return!1}peek(t,r={}){let{allowStale:n=this.allowStale}=r,u=be(this,xs).get(t);if(u===void 0||!n&&be(this,tp).call(this,u))return;let i=be(this,yn)[u];return qt(this,mi,qi).call(this,i)?i.__staleWhileFetching:i}async fetch(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:u=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:m,forceRefresh:v=!1,status:y,signal:g}=r;if(!be(this,av))return y&&(y.fetch="get"),this.get(t,{allowStale:n,updateAgeOnGet:u,noDeleteOnStaleGet:i,status:y});let D={allowStale:n,updateAgeOnGet:u,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:d,ignoreFetchAbort:h,status:y,signal:g},E=be(this,xs).get(t);if(E===void 0){y&&(y.fetch="miss");let b=qt(this,hA,kee).call(this,t,E,D,m);return b.__returned=b}else{let b=be(this,yn)[E];if(qt(this,mi,qi).call(this,b)){let S=n&&b.__staleWhileFetching!==void 0;return y&&(y.fetch="inflight",S&&(y.returnedStale=!0)),S?b.__staleWhileFetching:b.__returned=b}let C=be(this,tp).call(this,E);if(!v&&!C)return y&&(y.fetch="hit"),qt(this,h3,CR).call(this,E),u&&be(this,f3).call(this,E),y&&be(this,eg).call(this,y,E),b;let x=qt(this,hA,kee).call(this,t,E,D,m),A=x.__staleWhileFetching!==void 0&&n;return y&&(y.fetch=C?"stale":"refresh",A&&C&&(y.returnedStale=!0)),A?x.__staleWhileFetching:x.__returned=x}}get(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:u=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,s=be(this,xs).get(t);if(s!==void 0){let a=be(this,yn)[s],c=qt(this,mi,qi).call(this,a);return o&&be(this,eg).call(this,o,s),be(this,tp).call(this,s)?(o&&(o.get="stale"),c?(o&&n&&a.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?a.__staleWhileFetching:void 0):(i||this.delete(t),o&&n&&(o.returnedStale=!0),n?a:void 0)):(o&&(o.get="hit"),c?a.__staleWhileFetching:(qt(this,h3,CR).call(this,s),u&&be(this,f3).call(this,s),a))}else o&&(o.get="miss")}delete(t){var n,u,i,o;let r=!1;if(be(this,Vs)!==0){let s=be(this,xs).get(t);if(s!==void 0)if(r=!0,be(this,Vs)===1)this.clear();else{be(this,p3).call(this,s);let a=be(this,yn)[s];if(qt(this,mi,qi).call(this,a)?a.__abortController.abort(new Error("deleted")):(be(this,e1)||be(this,Ql))&&(be(this,e1)&&((n=be(this,Kd))==null||n.call(this,a,t,"delete")),be(this,Ql)&&((u=be(this,xa))==null||u.push([a,t,"delete"]))),be(this,xs).delete(t),be(this,Mi)[s]=void 0,be(this,yn)[s]=void 0,s===be(this,Ca))Bt(this,Ca,be(this,Z0)[s]);else if(s===be(this,sl))Bt(this,sl,be(this,Jl)[s]);else{let c=be(this,Z0)[s];be(this,Jl)[c]=be(this,Jl)[s];let l=be(this,Jl)[s];be(this,Z0)[l]=be(this,Z0)[s]}UU(this,Vs)._--,be(this,Jd).push(s)}}if(be(this,Ql)&&((i=be(this,xa))!=null&&i.length)){let s=be(this,xa),a;for(;a=s==null?void 0:s.shift();)(o=be(this,Yd))==null||o.call(this,...a)}return r}clear(){var t,r,n;for(let u of qt(this,N2,sv).call(this,{allowStale:!0})){let i=be(this,yn)[u];if(qt(this,mi,qi).call(this,i))i.__abortController.abort(new Error("deleted"));else{let o=be(this,Mi)[u];be(this,e1)&&((t=be(this,Kd))==null||t.call(this,i,o,"delete")),be(this,Ql)&&((r=be(this,xa))==null||r.push([i,o,"delete"]))}}if(be(this,xs).clear(),be(this,yn).fill(void 0),be(this,Mi).fill(void 0),be(this,ep)&&be(this,Zd)&&(be(this,ep).fill(0),be(this,Zd).fill(0)),be(this,Qd)&&be(this,Qd).fill(0),Bt(this,sl,0),Bt(this,Ca,0),be(this,Jd).length=0,Bt(this,Xd,0),Bt(this,Vs,0),be(this,Ql)&&be(this,xa)){let u=be(this,xa),i;for(;i=u==null?void 0:u.shift();)(n=be(this,Yd))==null||n.call(this,...i)}}};IBn=Symbol.toStringTag,Hd=new WeakMap,Q0=new WeakMap,Kd=new WeakMap,Yd=new WeakMap,lA=new WeakMap,Vs=new WeakMap,Xd=new WeakMap,xs=new WeakMap,Mi=new WeakMap,yn=new WeakMap,Jl=new WeakMap,Z0=new WeakMap,sl=new WeakMap,Ca=new WeakMap,Jd=new WeakMap,xa=new WeakMap,Qd=new WeakMap,Zd=new WeakMap,ep=new WeakMap,e1=new WeakMap,av=new WeakMap,Ql=new WeakMap,xR=new WeakSet,cxe=function(){let t=new cA(be(this,Hd)),r=new cA(be(this,Hd));Bt(this,ep,t),Bt(this,Zd,r),Bt(this,AR,(i,o,s=aA.now())=>{if(r[i]=o!==0?s:0,t[i]=o,o!==0&&this.ttlAutopurge){let a=setTimeout(()=>{be(this,tp).call(this,i)&&this.delete(be(this,Mi)[i])},o+1);a.unref&&a.unref()}}),Bt(this,f3,i=>{r[i]=t[i]!==0?aA.now():0}),Bt(this,eg,(i,o)=>{if(t[o]){let s=t[o],a=r[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=n||u();let c=i.now-a;i.remainingTTL=s-c}});let n=0,u=()=>{let i=aA.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return i};this.getRemainingTTL=i=>{let o=be(this,xs).get(i);if(o===void 0)return 0;let s=t[o],a=r[o];if(!s||!a)return 1/0;let c=(n||u())-a;return s-c},Bt(this,tp,i=>{let o=r[i],s=t[i];return!!s&&!!o&&(n||u())-o>s})},f3=new WeakMap,eg=new WeakMap,AR=new WeakMap,tp=new WeakMap,Iee=new WeakSet,CSt=function(){let t=new cA(be(this,Hd));Bt(this,Xd,0),Bt(this,Qd,t),Bt(this,p3,r=>{Bt(this,Xd,be(this,Xd)-t[r]),t[r]=0}),Bt(this,FR,(r,n,u,i)=>{if(qt(this,mi,qi).call(this,n))return 0;if(!iv(u))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(u=i(n,r),!iv(u))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 u}),Bt(this,fA,(r,n,u)=>{if(t[r]=n,be(this,Q0)){let i=be(this,Q0)-t[r];for(;be(this,Xd)>i;)qt(this,pA,Pee).call(this,!0)}Bt(this,Xd,be(this,Xd)+t[r]),u&&(u.entrySize=n,u.totalCalculatedSize=be(this,Xd))})},p3=new WeakMap,fA=new WeakMap,FR=new WeakMap,L2=new WeakSet,ov=function*({allowStale:t=this.allowStale}={}){if(be(this,Vs))for(let r=be(this,Ca);!(!qt(this,_R,lxe).call(this,r)||((t||!be(this,tp).call(this,r))&&(yield r),r===be(this,sl)));)r=be(this,Z0)[r]},N2=new WeakSet,sv=function*({allowStale:t=this.allowStale}={}){if(be(this,Vs))for(let r=be(this,sl);!(!qt(this,_R,lxe).call(this,r)||((t||!be(this,tp).call(this,r))&&(yield r),r===be(this,Ca)));)r=be(this,Jl)[r]},_R=new WeakSet,lxe=function(t){return t!==void 0&&be(this,xs).get(be(this,Mi)[t])===t},pA=new WeakSet,Pee=function(t){var i,o;let r=be(this,sl),n=be(this,Mi)[r],u=be(this,yn)[r];return be(this,av)&&qt(this,mi,qi).call(this,u)?u.__abortController.abort(new Error("evicted")):(be(this,e1)||be(this,Ql))&&(be(this,e1)&&((i=be(this,Kd))==null||i.call(this,u,n,"evict")),be(this,Ql)&&((o=be(this,xa))==null||o.push([u,n,"evict"]))),be(this,p3).call(this,r),t&&(be(this,Mi)[r]=void 0,be(this,yn)[r]=void 0,be(this,Jd).push(r)),be(this,Vs)===1?(Bt(this,sl,Bt(this,Ca,0)),be(this,Jd).length=0):Bt(this,sl,be(this,Jl)[r]),be(this,xs).delete(n),UU(this,Vs)._--,r},hA=new WeakSet,kee=function(t,r,n,u){let i=r===void 0?void 0:be(this,yn)[r];if(qt(this,mi,qi).call(this,i))return i;let o=new Ree,{signal:s}=n;s==null||s.addEventListener("abort",()=>o.abort(s.reason),{signal:o.signal});let a={signal:o.signal,options:n,context:u},c=(m,v=!1)=>{let{aborted:y}=o.signal,g=n.ignoreFetchAbort&&m!==void 0;if(n.status&&(y&&!v?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,g&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),y&&!g&&!v)return f(o.signal.reason);let D=h;return be(this,yn)[r]===h&&(m===void 0?D.__staleWhileFetching?be(this,yn)[r]=D.__staleWhileFetching:this.delete(t):(n.status&&(n.status.fetchUpdated=!0),this.set(t,m,a.options))),m},l=m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),f(m)),f=m=>{let{aborted:v}=o.signal,y=v&&n.allowStaleOnFetchAbort,g=y||n.allowStaleOnFetchRejection,D=g||n.noDeleteOnFetchRejection,E=h;if(be(this,yn)[r]===h&&(!D||E.__staleWhileFetching===void 0?this.delete(t):y||(be(this,yn)[r]=E.__staleWhileFetching)),g)return n.status&&E.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),E.__staleWhileFetching;if(E.__returned===E)throw m},p=(m,v)=>{var g;let y=(g=be(this,lA))==null?void 0:g.call(this,t,i,a);y&&y instanceof Promise&&y.then(D=>m(D===void 0?void 0:D),v),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=D=>c(D,!0)))})};n.status&&(n.status.fetchDispatched=!0);let h=new Promise(p).then(c,l),d=Object.assign(h,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(t,d,{...a.options,status:void 0}),r=be(this,xs).get(t)):be(this,yn)[r]=d,d},mi=new WeakSet,qi=function(t){if(!be(this,av))return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Ree},BR=new WeakSet,fxe=function(t,r){be(this,Z0)[r]=t,be(this,Jl)[t]=r},h3=new WeakSet,CR=function(t){t!==be(this,Ca)&&(t===be(this,sl)?Bt(this,sl,be(this,Jl)[t]):qt(this,BR,fxe).call(this,be(this,Z0)[t],be(this,Jl)[t]),qt(this,BR,fxe).call(this,be(this,Ca),t),Bt(this,Ca,t))};var axe=pxe;jee.LRUCache=axe});var Exe=I(ef=>{"use strict";var jBn=ef&&ef.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ef,"__esModule",{value:!0});ef.Minipass=ef.isWritable=ef.isReadable=ef.isStream=void 0;var ASt=typeof process=="object"&&process?process:{stdout:null,stderr:null},yxe=require("events"),wSt=jBn(require("stream")),LBn=require("string_decoder"),NBn=e=>!!e&&typeof e=="object"&&(e instanceof zee||e instanceof wSt.default||(0,ef.isReadable)(e)||(0,ef.isWritable)(e));ef.isStream=NBn;var qBn=e=>!!e&&typeof e=="object"&&e instanceof yxe.EventEmitter&&typeof e.pipe=="function"&&e.pipe!==wSt.default.Writable.prototype.pipe;ef.isReadable=qBn;var MBn=e=>!!e&&typeof e=="object"&&e instanceof yxe.EventEmitter&&typeof e.write=="function"&&typeof e.end=="function";ef.isWritable=MBn;var tg=Symbol("EOF"),rg=Symbol("maybeEmitEnd"),cv=Symbol("emittedEnd"),Lee=Symbol("emittingEnd"),wR=Symbol("emittedError"),Nee=Symbol("closed"),FSt=Symbol("read"),qee=Symbol("flush"),_St=Symbol("flushChunk"),t1=Symbol("encoding"),dA=Symbol("decoder"),Aa=Symbol("flowing"),SR=Symbol("paused"),mA=Symbol("resume"),Fa=Symbol("buffer"),Zl=Symbol("pipes"),_a=Symbol("bufferLength"),hxe=Symbol("bufferPush"),Mee=Symbol("bufferShift"),al=Symbol("objectMode"),Xo=Symbol("destroyed"),dxe=Symbol("error"),mxe=Symbol("emitData"),BSt=Symbol("emitEnd"),gxe=Symbol("emitEnd2"),q2=Symbol("async"),vxe=Symbol("abort"),Uee=Symbol("aborted"),OR=Symbol("signal"),d3=Symbol("dataListeners"),rp=Symbol("discarded"),TR=e=>Promise.resolve().then(e),UBn=e=>e(),$Bn=e=>e==="end"||e==="finish"||e==="prefinish",zBn=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,GBn=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),$ee=class{src;dest;opts;ondrain;constructor(t,r,n){this.src=t,this.dest=r,this.opts=n,this.ondrain=()=>t[mA](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Dxe=class extends $ee{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,r,n){super(t,r,n),this.proxyErrors=u=>r.emit("error",u),t.on("error",this.proxyErrors)}},WBn=e=>!!e.objectMode,VBn=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",zee=class extends yxe.EventEmitter{[Aa]=!1;[SR]=!1;[Zl]=[];[Fa]=[];[al];[t1];[q2];[dA];[tg]=!1;[cv]=!1;[Lee]=!1;[Nee]=!1;[wR]=null;[_a]=0;[Xo]=!1;[OR];[Uee]=!1;[d3]=0;[rp]=!1;writable=!0;readable=!0;constructor(...t){let r=t[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");WBn(r)?(this[al]=!0,this[t1]=null):VBn(r)?(this[t1]=r.encoding,this[al]=!1):(this[al]=!1,this[t1]=null),this[q2]=!!r.async,this[dA]=this[t1]?new LBn.StringDecoder(this[t1]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Fa]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Zl]});let{signal:n}=r;n&&(this[OR]=n,n.aborted?this[vxe]():n.addEventListener("abort",()=>this[vxe]()))}get bufferLength(){return this[_a]}get encoding(){return this[t1]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[al]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[q2]}set async(t){this[q2]=this[q2]||!!t}[vxe](){var t,r;this[Uee]=!0,this.emit("abort",(t=this[OR])==null?void 0:t.reason),this.destroy((r=this[OR])==null?void 0:r.reason)}get aborted(){return this[Uee]}set aborted(t){}write(t,r,n){var i;if(this[Uee])return!1;if(this[tg])throw new Error("write after end");if(this[Xo])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let u=this[q2]?TR:UBn;if(!this[al]&&!Buffer.isBuffer(t)){if(GBn(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(zBn(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[al]?(this[Aa]&&this[_a]!==0&&this[qee](!0),this[Aa]?this.emit("data",t):this[hxe](t),this[_a]!==0&&this.emit("readable"),n&&u(n),this[Aa]):t.length?(typeof t=="string"&&!(r===this[t1]&&!((i=this[dA])!=null&&i.lastNeed))&&(t=Buffer.from(t,r)),Buffer.isBuffer(t)&&this[t1]&&(t=this[dA].write(t)),this[Aa]&&this[_a]!==0&&this[qee](!0),this[Aa]?this.emit("data",t):this[hxe](t),this[_a]!==0&&this.emit("readable"),n&&u(n),this[Aa]):(this[_a]!==0&&this.emit("readable"),n&&u(n),this[Aa])}read(t){if(this[Xo])return null;if(this[rp]=!1,this[_a]===0||t===0||t&&t>this[_a])return this[rg](),null;this[al]&&(t=null),this[Fa].length>1&&!this[al]&&(this[Fa]=[this[t1]?this[Fa].join(""):Buffer.concat(this[Fa],this[_a])]);let r=this[FSt](t||null,this[Fa][0]);return this[rg](),r}[FSt](t,r){if(this[al])this[Mee]();else{let n=r;t===n.length||t===null?this[Mee]():typeof n=="string"?(this[Fa][0]=n.slice(t),r=n.slice(0,t),this[_a]-=t):(this[Fa][0]=n.subarray(t),r=n.subarray(0,t),this[_a]-=t)}return this.emit("data",r),!this[Fa].length&&!this[tg]&&this.emit("drain"),r}end(t,r,n){return typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r="utf8"),t!==void 0&&this.write(t,r),n&&this.once("end",n),this[tg]=!0,this.writable=!1,(this[Aa]||!this[SR])&&this[rg](),this}[mA](){this[Xo]||(!this[d3]&&!this[Zl].length&&(this[rp]=!0),this[SR]=!1,this[Aa]=!0,this.emit("resume"),this[Fa].length?this[qee]():this[tg]?this[rg]():this.emit("drain"))}resume(){return this[mA]()}pause(){this[Aa]=!1,this[SR]=!0,this[rp]=!1}get destroyed(){return this[Xo]}get flowing(){return this[Aa]}get paused(){return this[SR]}[hxe](t){this[al]?this[_a]+=1:this[_a]+=t.length,this[Fa].push(t)}[Mee](){return this[al]?this[_a]-=1:this[_a]-=this[Fa][0].length,this[Fa].shift()}[qee](t=!1){do;while(this[_St](this[Mee]())&&this[Fa].length);!t&&!this[Fa].length&&!this[tg]&&this.emit("drain")}[_St](t){return this.emit("data",t),this[Aa]}pipe(t,r){if(this[Xo])return t;this[rp]=!1;let n=this[cv];return r=r||{},t===ASt.stdout||t===ASt.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&t.end():(this[Zl].push(r.proxyErrors?new Dxe(this,t,r):new $ee(this,t,r)),this[q2]?TR(()=>this[mA]()):this[mA]()),t}unpipe(t){let r=this[Zl].find(n=>n.dest===t);r&&(this[Zl].length===1?(this[Aa]&&this[d3]===0&&(this[Aa]=!1),this[Zl]=[]):this[Zl].splice(this[Zl].indexOf(r),1),r.unpipe())}addListener(t,r){return this.on(t,r)}on(t,r){let n=super.on(t,r);if(t==="data")this[rp]=!1,this[d3]++,!this[Zl].length&&!this[Aa]&&this[mA]();else if(t==="readable"&&this[_a]!==0)super.emit("readable");else if($Bn(t)&&this[cv])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[wR]){let u=r;this[q2]?TR(()=>u.call(this,this[wR])):u.call(this,this[wR])}return n}removeListener(t,r){return this.off(t,r)}off(t,r){let n=super.off(t,r);return t==="data"&&(this[d3]=this.listeners("data").length,this[d3]===0&&!this[rp]&&!this[Zl].length&&(this[Aa]=!1)),n}removeAllListeners(t){let r=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[d3]=0,!this[rp]&&!this[Zl].length&&(this[Aa]=!1)),r}get emittedEnd(){return this[cv]}[rg](){!this[Lee]&&!this[cv]&&!this[Xo]&&this[Fa].length===0&&this[tg]&&(this[Lee]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Nee]&&this.emit("close"),this[Lee]=!1)}emit(t,...r){let n=r[0];if(t!=="error"&&t!=="close"&&t!==Xo&&this[Xo])return!1;if(t==="data")return!this[al]&&!n?!1:this[q2]?(TR(()=>this[mxe](n)),!0):this[mxe](n);if(t==="end")return this[BSt]();if(t==="close"){if(this[Nee]=!0,!this[cv]&&!this[Xo])return!1;let i=super.emit("close");return this.removeAllListeners("close"),i}else if(t==="error"){this[wR]=n,super.emit(dxe,n);let i=!this[OR]||this.listeners("error").length?super.emit("error",n):!1;return this[rg](),i}else if(t==="resume"){let i=super.emit("resume");return this[rg](),i}else if(t==="finish"||t==="prefinish"){let i=super.emit(t);return this.removeAllListeners(t),i}let u=super.emit(t,...r);return this[rg](),u}[mxe](t){for(let n of this[Zl])n.dest.write(t)===!1&&this.pause();let r=this[rp]?!1:super.emit("data",t);return this[rg](),r}[BSt](){return this[cv]?!1:(this[cv]=!0,this.readable=!1,this[q2]?(TR(()=>this[gxe]()),!0):this[gxe]())}[gxe](){if(this[dA]){let r=this[dA].end();if(r){for(let n of this[Zl])n.dest.write(r);this[rp]||super.emit("data",r)}}for(let r of this[Zl])r.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[al]||(t.dataLength=0);let r=this.promise();return this.on("data",n=>{t.push(n),this[al]||(t.dataLength+=n.length)}),await r,t}async concat(){if(this[al])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[t1]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,r)=>{this.on(Xo,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[rp]=!1;let t=!1,r=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return r();let u=this.read();if(u!==null)return Promise.resolve({done:!1,value:u});if(this[tg])return r();let i,o,s=f=>{this.off("data",a),this.off("end",c),this.off(Xo,l),r(),o(f)},a=f=>{this.off("error",s),this.off("end",c),this.off(Xo,l),this.pause(),i({value:f,done:!!this[tg]})},c=()=>{this.off("error",s),this.off("data",a),this.off(Xo,l),r(),i({done:!0,value:void 0})},l=()=>s(new Error("stream destroyed"));return new Promise((f,p)=>{o=p,i=f,this.once(Xo,l),this.once("error",s),this.once("end",c),this.once("data",a)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[rp]=!1;let t=!1,r=()=>(this.pause(),this.off(dxe,r),this.off(Xo,r),this.off("end",r),t=!0,{done:!0,value:void 0}),n=()=>{if(t)return r();let u=this.read();return u===null?r():{done:!1,value:u}};return this.once("end",r),this.once(dxe,r),this.once(Xo,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(t){if(this[Xo])return t?this.emit("error",t):this.emit(Xo),this;this[Xo]=!0,this[rp]=!0,this[Fa].length=0,this[_a]=0;let r=this;return typeof r.close=="function"&&!this[Nee]&&r.close(),t?this.emit("error",t):this.emit(Xo),this}static get isStream(){return ef.isStream}};ef.Minipass=zee});var HSt=I(Hu=>{"use strict";var HBn=Hu&&Hu.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var u=Object.getOwnPropertyDescriptor(t,r);(!u||("get"in u?!t.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,u)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),KBn=Hu&&Hu.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),YBn=Hu&&Hu.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&HBn(t,e,r);return KBn(t,e),t};Object.defineProperty(Hu,"__esModule",{value:!0});Hu.PathScurry=Hu.Path=Hu.PathScurryDarwin=Hu.PathScurryPosix=Hu.PathScurryWin32=Hu.PathScurryBase=Hu.PathPosix=Hu.PathWin32=Hu.PathBase=Hu.ChildrenCache=Hu.ResolveCache=void 0;var RSt=xSt(),Jee=require("path"),XBn=require("url"),kR=require("fs"),JBn=YBn(require("fs")),QBn=kR.realpathSync.native,Gee=require("fs/promises"),SSt=Exe(),RR={lstatSync:kR.lstatSync,readdir:kR.readdir,readdirSync:kR.readdirSync,readlinkSync:kR.readlinkSync,realpathSync:QBn,promises:{lstat:Gee.lstat,readdir:Gee.readdir,readlink:Gee.readlink,realpath:Gee.realpath}},ISt=e=>!e||e===RR||e===JBn?RR:{...RR,...e,promises:{...RR.promises,...e.promises||{}}},jSt=/^\\\\\?\\([a-z]:)\\?$/i,ZBn=e=>e.replace(/\//g,"\\").replace(jSt,"$1\\"),ewn=/[\\\/]/,bh=0,LSt=1,NSt=2,M2=4,qSt=6,MSt=8,m3=10,USt=12,Eh=15,PR=~Eh,bxe=16,OSt=32,IR=64,r1=128,Wee=256,Hee=512,TSt=IR|r1|Hee,twn=1023,Cxe=e=>e.isFile()?MSt:e.isDirectory()?M2:e.isSymbolicLink()?m3:e.isCharacterDevice()?NSt:e.isBlockDevice()?qSt:e.isSocket()?USt:e.isFIFO()?LSt:bh,PSt=new Map,jR=e=>{let t=PSt.get(e);if(t)return t;let r=e.normalize("NFKD");return PSt.set(e,r),r},kSt=new Map,Vee=e=>{let t=kSt.get(e);if(t)return t;let r=jR(e.toLowerCase());return kSt.set(e,r),r},qR=class extends RSt.LRUCache{constructor(){super({max:256})}};Hu.ResolveCache=qR;var Qee=class extends RSt.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:r=>r.length+1})}};Hu.ChildrenCache=Qee;var $St=Symbol("PathScurry setAsCwd"),tf,WR,VR,HR,KR,YR,XR,JR,QR,ZR,eI,tI,rI,nI,uI,iI,oI,sI,aI,lv,g3,U2,ng,ug,ig,vn,v3,og,$2,cI,xxe,gA,Kee,D3,LR,lI,Axe,fI,Fxe,y3,NR,vA,Yee,pI,_xe,hI,Bxe,DA,Xee,ete,zSt,tte,GSt,rte,WSt,dI,wxe,yA,EA,nte,VSt,E3,pc=class{constructor(t,r=bh,n,u,i,o,s){Rt(this,cI);Rt(this,gA);Rt(this,D3);Rt(this,lI);Rt(this,fI);Rt(this,y3);Rt(this,vA);Rt(this,pI);Rt(this,hI);Rt(this,DA);Rt(this,ete);Rt(this,tte);Rt(this,rte);Rt(this,dI);Rt(this,nte);Cn(this,"name");Cn(this,"root");Cn(this,"roots");Cn(this,"parent");Cn(this,"nocase");Cn(this,"isCWD",!1);Rt(this,tf,void 0);Rt(this,WR,void 0);Rt(this,VR,void 0);Rt(this,HR,void 0);Rt(this,KR,void 0);Rt(this,YR,void 0);Rt(this,XR,void 0);Rt(this,JR,void 0);Rt(this,QR,void 0);Rt(this,ZR,void 0);Rt(this,eI,void 0);Rt(this,tI,void 0);Rt(this,rI,void 0);Rt(this,nI,void 0);Rt(this,uI,void 0);Rt(this,iI,void 0);Rt(this,oI,void 0);Rt(this,sI,void 0);Rt(this,aI,void 0);Rt(this,lv,void 0);Rt(this,g3,void 0);Rt(this,U2,void 0);Rt(this,ng,void 0);Rt(this,ug,void 0);Rt(this,ig,void 0);Rt(this,vn,void 0);Rt(this,v3,void 0);Rt(this,og,void 0);Rt(this,$2,void 0);Rt(this,yA,[]);Rt(this,EA,!1);Rt(this,E3,void 0);this.name=t,Bt(this,lv,i?Vee(t):jR(t)),Bt(this,vn,r&twn),this.nocase=i,this.roots=u,this.root=n||this,Bt(this,v3,o),Bt(this,U2,s.fullpath),Bt(this,ug,s.relative),Bt(this,ig,s.relativePosix),this.parent=s.parent,this.parent?Bt(this,tf,be(this.parent,tf)):Bt(this,tf,ISt(s.fs))}get dev(){return be(this,WR)}get mode(){return be(this,VR)}get nlink(){return be(this,HR)}get uid(){return be(this,KR)}get gid(){return be(this,YR)}get rdev(){return be(this,XR)}get blksize(){return be(this,JR)}get ino(){return be(this,QR)}get size(){return be(this,ZR)}get blocks(){return be(this,eI)}get atimeMs(){return be(this,tI)}get mtimeMs(){return be(this,rI)}get ctimeMs(){return be(this,nI)}get birthtimeMs(){return be(this,uI)}get atime(){return be(this,iI)}get mtime(){return be(this,oI)}get ctime(){return be(this,sI)}get birthtime(){return be(this,aI)}get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return be(this,g3)!==void 0?be(this,g3):this.parent?Bt(this,g3,this.parent.depth()+1):Bt(this,g3,0)}childrenCache(){return be(this,v3)}resolve(t){var o;if(!t)return this;let r=this.getRootString(t),u=t.substring(r.length).split(this.splitSep);return r?qt(o=this.getRoot(r),cI,xxe).call(o,u):qt(this,cI,xxe).call(this,u)}children(){let t=be(this,v3).get(this);if(t)return t;let r=Object.assign([],{provisional:0});return be(this,v3).set(this,r),Bt(this,vn,be(this,vn)&~bxe),r}child(t,r){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let n=this.children(),u=this.nocase?Vee(t):jR(t);for(let a of n)if(be(a,lv)===u)return a;let i=this.parent?this.sep:"",o=be(this,U2)?be(this,U2)+i+t:void 0,s=this.newChild(t,bh,{...r,parent:this,fullpath:o});return this.canReaddir()||Bt(s,vn,be(s,vn)|r1),n.push(s),s}relative(){if(this.isCWD)return"";if(be(this,ug)!==void 0)return be(this,ug);let t=this.name,r=this.parent;if(!r)return Bt(this,ug,this.name);let n=r.relative();return n+(!n||!r.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(be(this,ig)!==void 0)return be(this,ig);let t=this.name,r=this.parent;if(!r)return Bt(this,ig,this.fullpathPosix());let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+t}fullpath(){if(be(this,U2)!==void 0)return be(this,U2);let t=this.name,r=this.parent;if(!r)return Bt(this,U2,this.name);let u=r.fullpath()+(r.parent?this.sep:"")+t;return Bt(this,U2,u)}fullpathPosix(){if(be(this,ng)!==void 0)return be(this,ng);if(this.sep==="/")return Bt(this,ng,this.fullpath());if(!this.parent){let u=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(u)?Bt(this,ng,`//?/${u}`):Bt(this,ng,u)}let t=this.parent,r=t.fullpathPosix(),n=r+(!r||!t.parent?"":"/")+this.name;return Bt(this,ng,n)}isUnknown(){return(be(this,vn)&Eh)===bh}isType(t){return this[`is${t}`]()}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(be(this,vn)&Eh)===MSt}isDirectory(){return(be(this,vn)&Eh)===M2}isCharacterDevice(){return(be(this,vn)&Eh)===NSt}isBlockDevice(){return(be(this,vn)&Eh)===qSt}isFIFO(){return(be(this,vn)&Eh)===LSt}isSocket(){return(be(this,vn)&Eh)===USt}isSymbolicLink(){return(be(this,vn)&m3)===m3}lstatCached(){return be(this,vn)&OSt?this:void 0}readlinkCached(){return be(this,og)}realpathCached(){return be(this,$2)}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(be(this,og))return!0;if(!this.parent)return!1;let t=be(this,vn)&Eh;return!(t!==bh&&t!==m3||be(this,vn)&Wee||be(this,vn)&r1)}calledReaddir(){return!!(be(this,vn)&bxe)}isENOENT(){return!!(be(this,vn)&r1)}isNamed(t){return this.nocase?be(this,lv)===Vee(t):be(this,lv)===jR(t)}async readlink(){var r;let t=be(this,og);if(t)return t;if(this.canReadlink()&&this.parent)try{let n=await be(this,tf).promises.readlink(this.fullpath()),u=(r=await this.parent.realpath())==null?void 0:r.resolve(n);if(u)return Bt(this,og,u)}catch(n){qt(this,hI,Bxe).call(this,n.code);return}}readlinkSync(){var r;let t=be(this,og);if(t)return t;if(this.canReadlink()&&this.parent)try{let n=be(this,tf).readlinkSync(this.fullpath()),u=(r=this.parent.realpathSync())==null?void 0:r.resolve(n);if(u)return Bt(this,og,u)}catch(n){qt(this,hI,Bxe).call(this,n.code);return}}async lstat(){if(!(be(this,vn)&r1))try{return qt(this,dI,wxe).call(this,await be(this,tf).promises.lstat(this.fullpath())),this}catch(t){qt(this,pI,_xe).call(this,t.code)}}lstatSync(){if(!(be(this,vn)&r1))try{return qt(this,dI,wxe).call(this,be(this,tf).lstatSync(this.fullpath())),this}catch(t){qt(this,pI,_xe).call(this,t.code)}}readdirCB(t,r=!1){if(!this.canReaddir()){r?t(null,[]):queueMicrotask(()=>t(null,[]));return}let n=this.children();if(this.calledReaddir()){let i=n.slice(0,n.provisional);r?t(null,i):queueMicrotask(()=>t(null,i));return}if(be(this,yA).push(t),be(this,EA))return;Bt(this,EA,!0);let u=this.fullpath();be(this,tf).readdir(u,{withFileTypes:!0},(i,o)=>{if(i)qt(this,vA,Yee).call(this,i.code),n.provisional=0;else{for(let s of o)qt(this,DA,Xee).call(this,s,n);qt(this,gA,Kee).call(this,n)}qt(this,nte,VSt).call(this,n.slice(0,n.provisional))})}async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let r=this.fullpath();if(be(this,E3))await be(this,E3);else{let n=()=>{};Bt(this,E3,new Promise(u=>n=u));try{for(let u of await be(this,tf).promises.readdir(r,{withFileTypes:!0}))qt(this,DA,Xee).call(this,u,t);qt(this,gA,Kee).call(this,t)}catch(u){qt(this,vA,Yee).call(this,u.code),t.provisional=0}Bt(this,E3,void 0),n()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let r=this.fullpath();try{for(let n of be(this,tf).readdirSync(r,{withFileTypes:!0}))qt(this,DA,Xee).call(this,n,t);qt(this,gA,Kee).call(this,t)}catch(n){qt(this,vA,Yee).call(this,n.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(be(this,vn)&TSt)return!1;let t=Eh&be(this,vn);return t===bh||t===M2||t===m3}shouldWalk(t,r){return(be(this,vn)&M2)===M2&&!(be(this,vn)&TSt)&&!t.has(this)&&(!r||r(this))}async realpath(){if(be(this,$2))return be(this,$2);if(!((Hee|Wee|r1)&be(this,vn)))try{let t=await be(this,tf).promises.realpath(this.fullpath());return Bt(this,$2,this.resolve(t))}catch{qt(this,fI,Fxe).call(this)}}realpathSync(){if(be(this,$2))return be(this,$2);if(!((Hee|Wee|r1)&be(this,vn)))try{let t=be(this,tf).realpathSync(this.fullpath());return Bt(this,$2,this.resolve(t))}catch{qt(this,fI,Fxe).call(this)}}[$St](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],u=this;for(;u&&u.parent;)r.add(u),Bt(u,ug,n.join(this.sep)),Bt(u,ig,n.join("/")),u=u.parent,n.push("..");for(u=t;u&&u.parent&&!r.has(u);)Bt(u,ug,void 0),Bt(u,ig,void 0),u=u.parent}};tf=new WeakMap,WR=new WeakMap,VR=new WeakMap,HR=new WeakMap,KR=new WeakMap,YR=new WeakMap,XR=new WeakMap,JR=new WeakMap,QR=new WeakMap,ZR=new WeakMap,eI=new WeakMap,tI=new WeakMap,rI=new WeakMap,nI=new WeakMap,uI=new WeakMap,iI=new WeakMap,oI=new WeakMap,sI=new WeakMap,aI=new WeakMap,lv=new WeakMap,g3=new WeakMap,U2=new WeakMap,ng=new WeakMap,ug=new WeakMap,ig=new WeakMap,vn=new WeakMap,v3=new WeakMap,og=new WeakMap,$2=new WeakMap,cI=new WeakSet,xxe=function(t){let r=this;for(let n of t)r=r.child(n);return r},gA=new WeakSet,Kee=function(t){var r;Bt(this,vn,be(this,vn)|bxe);for(let n=t.provisional;n<t.length;n++){let u=t[n];u&&qt(r=u,D3,LR).call(r)}},D3=new WeakSet,LR=function(){be(this,vn)&r1||(Bt(this,vn,(be(this,vn)|r1)&PR),qt(this,lI,Axe).call(this))},lI=new WeakSet,Axe=function(){var r;let t=this.children();t.provisional=0;for(let n of t)qt(r=n,D3,LR).call(r)},fI=new WeakSet,Fxe=function(){Bt(this,vn,be(this,vn)|Hee),qt(this,y3,NR).call(this)},y3=new WeakSet,NR=function(){if(be(this,vn)&IR)return;let t=be(this,vn);(t&Eh)===M2&&(t&=PR),Bt(this,vn,t|IR),qt(this,lI,Axe).call(this)},vA=new WeakSet,Yee=function(t=""){t==="ENOTDIR"||t==="EPERM"?qt(this,y3,NR).call(this):t==="ENOENT"?qt(this,D3,LR).call(this):this.children().provisional=0},pI=new WeakSet,_xe=function(t=""){var r;if(t==="ENOTDIR"){let n=this.parent;qt(r=n,y3,NR).call(r)}else t==="ENOENT"&&qt(this,D3,LR).call(this)},hI=new WeakSet,Bxe=function(t=""){var n;let r=be(this,vn);r|=Wee,t==="ENOENT"&&(r|=r1),(t==="EINVAL"||t==="UNKNOWN")&&(r&=PR),Bt(this,vn,r),t==="ENOTDIR"&&this.parent&&qt(n=this.parent,y3,NR).call(n)},DA=new WeakSet,Xee=function(t,r){return qt(this,tte,GSt).call(this,t,r)||qt(this,ete,zSt).call(this,t,r)},ete=new WeakSet,zSt=function(t,r){let n=Cxe(t),u=this.newChild(t.name,n,{parent:this}),i=be(u,vn)&Eh;return i!==M2&&i!==m3&&i!==bh&&Bt(u,vn,be(u,vn)|IR),r.unshift(u),r.provisional++,u},tte=new WeakSet,GSt=function(t,r){for(let n=r.provisional;n<r.length;n++){let u=r[n];if((this.nocase?Vee(t.name):jR(t.name))===be(u,lv))return qt(this,rte,WSt).call(this,t,u,n,r)}},rte=new WeakSet,WSt=function(t,r,n,u){let i=r.name;return Bt(r,vn,be(r,vn)&PR|Cxe(t)),i!==t.name&&(r.name=t.name),n!==u.provisional&&(n===u.length-1?u.pop():u.splice(n,1),u.unshift(r)),u.provisional++,r},dI=new WeakSet,wxe=function(t){let{atime:r,atimeMs:n,birthtime:u,birthtimeMs:i,blksize:o,blocks:s,ctime:a,ctimeMs:c,dev:l,gid:f,ino:p,mode:h,mtime:d,mtimeMs:m,nlink:v,rdev:y,size:g,uid:D}=t;Bt(this,iI,r),Bt(this,tI,n),Bt(this,aI,u),Bt(this,uI,i),Bt(this,JR,o),Bt(this,eI,s),Bt(this,sI,a),Bt(this,nI,c),Bt(this,WR,l),Bt(this,YR,f),Bt(this,QR,p),Bt(this,VR,h),Bt(this,oI,d),Bt(this,rI,m),Bt(this,HR,v),Bt(this,XR,y),Bt(this,ZR,g),Bt(this,KR,D);let E=Cxe(t);Bt(this,vn,be(this,vn)&PR|E|OSt),E!==bh&&E!==M2&&E!==m3&&Bt(this,vn,be(this,vn)|IR)},yA=new WeakMap,EA=new WeakMap,nte=new WeakSet,VSt=function(t){Bt(this,EA,!1);let r=be(this,yA).slice();be(this,yA).length=0,r.forEach(n=>n(null,t))},E3=new WeakMap;Hu.PathBase=pc;var MR=class e extends pc{sep="\\";splitSep=ewn;constructor(t,r=bh,n,u,i,o,s){super(t,r,n,u,i,o,s)}newChild(t,r=bh,n={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(t){return Jee.win32.parse(t).root}getRoot(t){if(t=ZBn(t.toUpperCase()),t===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(t,r))return this.roots[t]=n;return this.roots[t]=new zR(t,this).root}sameRoot(t,r=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(jSt,"$1\\"),t===r}};Hu.PathWin32=MR;var UR=class e extends pc{splitSep="/";sep="/";constructor(t,r=bh,n,u,i,o,s){super(t,r,n,u,i,o,s)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,r=bh,n={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}};Hu.PathPosix=UR;var bA,CA,mI,gI,$R=class{constructor(t=process.cwd(),r,n,{nocase:u,childrenCacheSize:i=16*1024,fs:o=RR}={}){Cn(this,"root");Cn(this,"rootPath");Cn(this,"roots");Cn(this,"cwd");Rt(this,bA,void 0);Rt(this,CA,void 0);Rt(this,mI,void 0);Cn(this,"nocase");Rt(this,gI,void 0);Bt(this,gI,ISt(o)),(t instanceof URL||t.startsWith("file://"))&&(t=(0,XBn.fileURLToPath)(t));let s=r.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(s),Bt(this,bA,new qR),Bt(this,CA,new qR),Bt(this,mI,new Qee(i));let a=s.substring(this.rootPath.length).split(n);if(a.length===1&&!a[0]&&a.pop(),u===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=u,this.root=this.newRoot(be(this,gI)),this.roots[this.rootPath]=this.root;let c=this.root,l=a.length-1,f=r.sep,p=this.rootPath,h=!1;for(let d of a){let m=l--;c=c.child(d,{relative:new Array(m).fill("..").join(f),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(h?"":f)+d}),h=!0}this.cwd=c}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return be(this,mI)}resolve(...t){let r="";for(let i=t.length-1;i>=0;i--){let o=t[i];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=be(this,bA).get(r);if(n!==void 0)return n;let u=this.cwd.resolve(r).fullpath();return be(this,bA).set(r,u),u}resolvePosix(...t){let r="";for(let i=t.length-1;i>=0;i--){let o=t[i];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=be(this,CA).get(r);if(n!==void 0)return n;let u=this.cwd.resolve(r).fullpathPosix();return be(this,CA).set(r,u),u}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n}=r;if(t.canReaddir()){let u=await t.readdir();return n?u:u.map(i=>i.name)}else return[]}readdirSync(t=this.cwd,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0}=r;return t.canReaddir()?n?t.readdirSync():t.readdirSync().map(u=>u.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t.withFileTypes,t=this.cwd);let n=await t.readlink();return r?n:n==null?void 0:n.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t.withFileTypes,t=this.cwd);let n=t.readlinkSync();return r?n:n==null?void 0:n.fullpath()}async realpath(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t.withFileTypes,t=this.cwd);let n=await t.realpath();return r?n:n==null?void 0:n.fullpath()}realpathSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t.withFileTypes,t=this.cwd);let n=t.realpathSync();return r?n:n==null?void 0:n.fullpath()}async walk(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:u=!1,filter:i,walkFilter:o}=r,s=[];(!i||i(t))&&s.push(n?t:t.fullpath());let a=new Set,c=(f,p)=>{a.add(f),f.readdirCB((h,d)=>{if(h)return p(h);let m=d.length;if(!m)return p();let v=()=>{--m===0&&p()};for(let y of d)(!i||i(y))&&s.push(n?y:y.fullpath()),u&&y.isSymbolicLink()?y.realpath().then(g=>g!=null&&g.isUnknown()?g.lstat():g).then(g=>g!=null&&g.shouldWalk(a,o)?c(g,v):v()):y.shouldWalk(a,o)?c(y,v):v()},!0)},l=t;return new Promise((f,p)=>{c(l,h=>{if(h)return p(h);f(s)})})}walkSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:u=!1,filter:i,walkFilter:o}=r,s=[];(!i||i(t))&&s.push(n?t:t.fullpath());let a=new Set([t]);for(let c of a){let l=c.readdirSync();for(let f of l){(!i||i(f))&&s.push(n?f:f.fullpath());let p=f;if(f.isSymbolicLink()){if(!(u&&(p=f.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(a,o)&&a.add(p)}}return s}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,r={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd),this.stream(t,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:u=!1,filter:i,walkFilter:o}=r;(!i||i(t))&&(yield n?t:t.fullpath());let s=new Set([t]);for(let a of s){let c=a.readdirSync();for(let l of c){(!i||i(l))&&(yield n?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(u&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(s,o)&&s.add(f)}}}stream(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:u=!1,filter:i,walkFilter:o}=r,s=new SSt.Minipass({objectMode:!0});(!i||i(t))&&s.write(n?t:t.fullpath());let a=new Set,c=[t],l=0,f=()=>{let p=!1;for(;!p;){let h=c.shift();if(!h){l===0&&s.end();return}l++,a.add(h);let d=(v,y,g=!1)=>{if(v)return s.emit("error",v);if(u&&!g){let D=[];for(let E of y)E.isSymbolicLink()&&D.push(E.realpath().then(b=>b!=null&&b.isUnknown()?b.lstat():b));if(D.length){Promise.all(D).then(()=>d(null,y,!0));return}}for(let D of y)D&&(!i||i(D))&&(s.write(n?D:D.fullpath())||(p=!0));l--;for(let D of y){let E=D.realpathCached()||D;E.shouldWalk(a,o)&&c.push(E)}p&&!s.flowing?s.once("drain",f):m||f()},m=!0;h.readdirCB(d,!0),m=!1}};return f(),s}streamSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof pc||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:u=!1,filter:i,walkFilter:o}=r,s=new SSt.Minipass({objectMode:!0}),a=new Set;(!i||i(t))&&s.write(n?t:t.fullpath());let c=[t],l=0,f=()=>{let p=!1;for(;!p;){let h=c.shift();if(!h){l===0&&s.end();return}l++,a.add(h);let d=h.readdirSync();for(let m of d)(!i||i(m))&&(s.write(n?m:m.fullpath())||(p=!0));l--;for(let m of d){let v=m;if(m.isSymbolicLink()){if(!(u&&(v=m.realpathSync())))continue;v.isUnknown()&&v.lstatSync()}v.shouldWalk(a,o)&&c.push(v)}}p&&!s.flowing&&s.once("drain",f)};return f(),s}chdir(t=this.cwd){let r=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[$St](r)}};bA=new WeakMap,CA=new WeakMap,mI=new WeakMap,gI=new WeakMap;Hu.PathScurryBase=$R;var zR=class extends $R{sep="\\";constructor(t=process.cwd(),r={}){let{nocase:n=!0}=r;super(t,Jee.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let u=this.cwd;u;u=u.parent)u.nocase=this.nocase}parseRootPath(t){return Jee.win32.parse(t).root.toUpperCase()}newRoot(t){return new MR(this.rootPath,M2,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}};Hu.PathScurryWin32=zR;var GR=class extends $R{sep="/";constructor(t=process.cwd(),r={}){let{nocase:n=!1}=r;super(t,Jee.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(t){return"/"}newRoot(t){return new UR(this.rootPath,M2,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}};Hu.PathScurryPosix=GR;var Zee=class extends GR{constructor(t=process.cwd(),r={}){let{nocase:n=!0}=r;super(t,{...r,nocase:n})}};Hu.PathScurryDarwin=Zee;Hu.Path=process.platform==="win32"?MR:UR;Hu.PathScurry=process.platform==="win32"?zR:process.platform==="darwin"?Zee:GR});var Txe=I(ute=>{"use strict";Object.defineProperty(ute,"__esModule",{value:!0});ute.Pattern=void 0;var rwn=uv(),nwn=e=>e.length>=1,uwn=e=>e.length>=1,Hs,np,Ba,b3,n1,vI,fv,pv,hv,xA,Oxe=class Oxe{constructor(t,r,n,u){Rt(this,Hs,void 0);Rt(this,np,void 0);Rt(this,Ba,void 0);Cn(this,"length");Rt(this,b3,void 0);Rt(this,n1,void 0);Rt(this,vI,void 0);Rt(this,fv,void 0);Rt(this,pv,void 0);Rt(this,hv,void 0);Rt(this,xA,!0);if(!nwn(t))throw new TypeError("empty pattern list");if(!uwn(r))throw new TypeError("empty glob list");if(r.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,n<0||n>=this.length)throw new TypeError("index out of range");if(Bt(this,Hs,t),Bt(this,np,r),Bt(this,Ba,n),Bt(this,b3,u),be(this,Ba)===0){if(this.isUNC()){let[i,o,s,a,...c]=be(this,Hs),[l,f,p,h,...d]=be(this,np);c[0]===""&&(c.shift(),d.shift());let m=[i,o,s,a,""].join("/"),v=[l,f,p,h,""].join("/");Bt(this,Hs,[m,...c]),Bt(this,np,[v,...d]),this.length=be(this,Hs).length}else if(this.isDrive()||this.isAbsolute()){let[i,...o]=be(this,Hs),[s,...a]=be(this,np);o[0]===""&&(o.shift(),a.shift());let c=i+"/",l=s+"/";Bt(this,Hs,[c,...o]),Bt(this,np,[l,...a]),this.length=be(this,Hs).length}}}pattern(){return be(this,Hs)[be(this,Ba)]}isString(){return typeof be(this,Hs)[be(this,Ba)]=="string"}isGlobstar(){return be(this,Hs)[be(this,Ba)]===rwn.GLOBSTAR}isRegExp(){return be(this,Hs)[be(this,Ba)]instanceof RegExp}globString(){return Bt(this,vI,be(this,vI)||(be(this,Ba)===0?this.isAbsolute()?be(this,np)[0]+be(this,np).slice(1).join("/"):be(this,np).join("/"):be(this,np).slice(be(this,Ba)).join("/")))}hasMore(){return this.length>be(this,Ba)+1}rest(){return be(this,n1)!==void 0?be(this,n1):this.hasMore()?(Bt(this,n1,new Oxe(be(this,Hs),be(this,np),be(this,Ba)+1,be(this,b3))),Bt(be(this,n1),hv,be(this,hv)),Bt(be(this,n1),pv,be(this,pv)),Bt(be(this,n1),fv,be(this,fv)),be(this,n1)):Bt(this,n1,null)}isUNC(){let t=be(this,Hs);return be(this,pv)!==void 0?be(this,pv):Bt(this,pv,be(this,b3)==="win32"&&be(this,Ba)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=be(this,Hs);return be(this,fv)!==void 0?be(this,fv):Bt(this,fv,be(this,b3)==="win32"&&be(this,Ba)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=be(this,Hs);return be(this,hv)!==void 0?be(this,hv):Bt(this,hv,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=be(this,Hs)[0];return typeof t=="string"&&this.isAbsolute()&&be(this,Ba)===0?t:""}checkFollowGlobstar(){return!(be(this,Ba)===0||!this.isGlobstar()||!be(this,xA))}markFollowGlobstar(){return be(this,Ba)===0||!this.isGlobstar()||!be(this,xA)?!1:(Bt(this,xA,!1),!0)}};Hs=new WeakMap,np=new WeakMap,Ba=new WeakMap,b3=new WeakMap,n1=new WeakMap,vI=new WeakMap,fv=new WeakMap,pv=new WeakMap,hv=new WeakMap,xA=new WeakMap;var Sxe=Oxe;ute.Pattern=Sxe});var kxe=I(ite=>{"use strict";Object.defineProperty(ite,"__esModule",{value:!0});ite.Ignore=void 0;var KSt=uv(),iwn=Txe(),own=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Pxe=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:r,nocase:n,noext:u,noglobstar:i,platform:o=own}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:u,noglobstar:i,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let s of t)this.add(s)}add(t){let r=new KSt.Minimatch(t,this.mmopts);for(let n=0;n<r.set.length;n++){let u=r.set[n],i=r.globParts[n];if(!u||!i)throw new Error("invalid pattern object");for(;u[0]==="."&&i[0]===".";)u.shift(),i.shift();let o=new iwn.Pattern(u,i,0,this.platform),s=new KSt.Minimatch(o.globString(),this.mmopts),a=i[i.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(s):this.relative.push(s),a&&(c?this.absoluteChildren.push(s):this.relativeChildren.push(s))}}ignored(t){let r=t.fullpath(),n=`${r}/`,u=t.relative()||".",i=`${u}/`;for(let o of this.relative)if(o.match(u)||o.match(i))return!0;for(let o of this.absolute)if(o.match(r)||o.match(n))return!0;return!1}childrenIgnored(t){let r=t.fullpath()+"/",n=(t.relative()||".")+"/";for(let u of this.relativeChildren)if(u.match(n))return!0;for(let u of this.absoluteChildren)if(u.match(r))return!0;return!1}};ite.Ignore=Pxe});var XSt=I(z2=>{"use strict";Object.defineProperty(z2,"__esModule",{value:!0});z2.Processor=z2.SubWalks=z2.MatchRecord=z2.HasWalkedCache=void 0;var YSt=uv(),ote=class e{store;constructor(t=new Map){this.store=t}copy(){return new e(new Map(this.store))}hasWalked(t,r){var n;return(n=this.store.get(t.fullpath()))==null?void 0:n.has(r.globString())}storeWalked(t,r){let n=t.fullpath(),u=this.store.get(n);u?u.add(r.globString()):this.store.set(n,new Set([r.globString()]))}};z2.HasWalkedCache=ote;var ste=class{store=new Map;add(t,r,n){let u=(r?2:0)|(n?1:0),i=this.store.get(t);this.store.set(t,i===void 0?u:u&i)}entries(){return[...this.store.entries()].map(([t,r])=>[t,!!(r&2),!!(r&1)])}};z2.MatchRecord=ste;var ate=class{store=new Map;add(t,r){if(!t.canReaddir())return;let n=this.store.get(t);n?n.find(u=>u.globString()===r.globString())||n.push(r):this.store.set(t,[r])}get(t){let r=this.store.get(t);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}};z2.SubWalks=ate;var Rxe=class e{hasWalkedCache;matches=new ste;subwalks=new ate;patterns;follow;dot;opts;constructor(t,r){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=r?r.copy():new ote}processPatterns(t,r){this.patterns=r;let n=r.map(u=>[t,u]);for(let[u,i]of n){this.hasWalkedCache.storeWalked(u,i);let o=i.root(),s=i.isAbsolute()&&this.opts.absolute!==!1;if(o){u=u.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=i.rest();if(f)i=f;else{this.matches.add(u,!0,!1);continue}}if(u.isENOENT())continue;let a,c,l=!1;for(;typeof(a=i.pattern())=="string"&&(c=i.rest());)u=u.resolve(a),i=c,l=!0;if(a=i.pattern(),c=i.rest(),l){if(this.hasWalkedCache.hasWalked(u,i))continue;this.hasWalkedCache.storeWalked(u,i)}if(typeof a=="string"){let f=a===".."||a===""||a===".";this.matches.add(u.resolve(a),s,f);continue}else if(a===YSt.GLOBSTAR){(!u.isSymbolicLink()||this.follow||i.checkFollowGlobstar())&&this.subwalks.add(u,i);let f=c==null?void 0:c.pattern(),p=c==null?void 0:c.rest();if(!c||(f===""||f===".")&&!p)this.matches.add(u,s,f===""||f===".");else if(f===".."){let h=u.parent||u;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,s,!0)}}else a instanceof RegExp&&this.subwalks.add(u,i)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(t,r){let n=this.subwalks.get(t),u=this.child();for(let i of r)for(let o of n){let s=o.isAbsolute(),a=o.pattern(),c=o.rest();a===YSt.GLOBSTAR?u.testGlobstar(i,o,c,s):a instanceof RegExp?u.testRegExp(i,a,c,s):u.testString(i,a,c,s)}return u}testGlobstar(t,r,n,u){if((this.dot||!t.name.startsWith("."))&&(r.hasMore()||this.matches.add(t,u,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,r):t.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(t,n):r.markFollowGlobstar()&&this.subwalks.add(t,r)))),n){let i=n.pattern();if(typeof i=="string"&&i!==".."&&i!==""&&i!==".")this.testString(t,i,n.rest(),u);else if(i===".."){let o=t.parent||t;this.subwalks.add(o,n)}else i instanceof RegExp&&this.testRegExp(t,i,n.rest(),u)}}testRegExp(t,r,n,u){r.test(t.name)&&(n?this.subwalks.add(t,n):this.matches.add(t,u,!1))}testString(t,r,n,u){t.isNamed(r)&&(n?this.subwalks.add(t,n):this.matches.add(t,u,!1))}};z2.Processor=Rxe});var ZSt=I(dv=>{"use strict";Object.defineProperty(dv,"__esModule",{value:!0});dv.GlobStream=dv.GlobWalker=dv.GlobUtil=void 0;var swn=Exe(),JSt=kxe(),QSt=XSt(),awn=(e,t)=>typeof e=="string"?new JSt.Ignore([e],t):Array.isArray(e)?new JSt.Ignore(e,t):e,AA,sg,x3,ag,C3,yI,Ixe,DI=class{constructor(t,r,n){Rt(this,ag);Rt(this,yI);Cn(this,"path");Cn(this,"patterns");Cn(this,"opts");Cn(this,"seen",new Set);Cn(this,"paused",!1);Cn(this,"aborted",!1);Rt(this,AA,[]);Rt(this,sg,void 0);Rt(this,x3,void 0);Cn(this,"signal");Cn(this,"maxDepth");Cn(this,"includeChildMatches");var u;if(this.patterns=t,this.path=r,this.opts=n,Bt(this,x3,!n.posix&&n.platform==="win32"?"\\":"/"),this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(Bt(this,sg,awn((u=n.ignore)!=null?u:[],n)),!this.includeChildMatches&&typeof be(this,sg).add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{be(this,AA).length=0}))}pause(){this.paused=!0}resume(){var r;if((r=this.signal)!=null&&r.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=be(this,AA).shift());)t()}onResume(t){var r;(r=this.signal)!=null&&r.aborted||(this.paused?be(this,AA).push(t):t())}async matchCheck(t,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=t.realpathCached()||await t.realpath(),!n)return;t=n}let i=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&(i!=null&&i.isSymbolicLink())){let o=await i.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(i,r)}matchCheckTest(t,r){var n;return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!r||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!((n=t.realpathCached())!=null&&n.isDirectory()))&&!qt(this,ag,C3).call(this,t)?t:void 0}matchCheckSync(t,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=t.realpathCached()||t.realpathSync(),!n)return;t=n}let i=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&(i!=null&&i.isSymbolicLink())){let o=i.realpathSync();o&&(o!=null&&o.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(i,r)}matchFinish(t,r){var i;if(qt(this,ag,C3).call(this,t))return;if(!this.includeChildMatches&&((i=be(this,sg))!=null&&i.add)){let o=`${t.relativePosix()}/**`;be(this,sg).add(o)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(t);let u=this.opts.mark&&t.isDirectory()?be(this,x3):"";if(this.opts.withFileTypes)this.matchEmit(t);else if(n){let o=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(o+u)}else{let o=this.opts.posix?t.relativePosix():t.relative(),s=this.opts.dotRelative&&!o.startsWith(".."+be(this,x3))?"."+be(this,x3):"";this.matchEmit(o?s+o+u:"."+u)}}async match(t,r,n){let u=await this.matchCheck(t,n);u&&this.matchFinish(u,r)}matchSync(t,r,n){let u=this.matchCheckSync(t,n);u&&this.matchFinish(u,r)}walkCB(t,r,n){var u;(u=this.signal)!=null&&u.aborted&&n(),this.walkCB2(t,r,new QSt.Processor(this.opts),n)}walkCB2(t,r,n,u){var s;if(qt(this,yI,Ixe).call(this,t))return u();if((s=this.signal)!=null&&s.aborted&&u(),this.paused){this.onResume(()=>this.walkCB2(t,r,n,u));return}n.processPatterns(t,r);let i=1,o=()=>{--i===0&&u()};for(let[a,c,l]of n.matches.entries())qt(this,ag,C3).call(this,a)||(i++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,f)=>this.walkCB3(a,f,n,o),!0)}o()}walkCB3(t,r,n,u){n=n.filterEntries(t,r);let i=1,o=()=>{--i===0&&u()};for(let[s,a,c]of n.matches.entries())qt(this,ag,C3).call(this,s)||(i++,this.match(s,a,c).then(()=>o()));for(let[s,a]of n.subwalks.entries())i++,this.walkCB2(s,a,n.child(),o);o()}walkCBSync(t,r,n){var u;(u=this.signal)!=null&&u.aborted&&n(),this.walkCB2Sync(t,r,new QSt.Processor(this.opts),n)}walkCB2Sync(t,r,n,u){var s;if(qt(this,yI,Ixe).call(this,t))return u();if((s=this.signal)!=null&&s.aborted&&u(),this.paused){this.onResume(()=>this.walkCB2Sync(t,r,n,u));return}n.processPatterns(t,r);let i=1,o=()=>{--i===0&&u()};for(let[a,c,l]of n.matches.entries())qt(this,ag,C3).call(this,a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;i++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(t,r,n,u){n=n.filterEntries(t,r);let i=1,o=()=>{--i===0&&u()};for(let[s,a,c]of n.matches.entries())qt(this,ag,C3).call(this,s)||this.matchSync(s,a,c);for(let[s,a]of n.subwalks.entries())i++,this.walkCB2Sync(s,a,n.child(),o);o()}};AA=new WeakMap,sg=new WeakMap,x3=new WeakMap,ag=new WeakSet,C3=function(t){var r,n;return this.seen.has(t)||!!((n=(r=be(this,sg))==null?void 0:r.ignored)!=null&&n.call(r,t))},yI=new WeakSet,Ixe=function(t){var r,n;return!!((n=(r=be(this,sg))==null?void 0:r.childrenIgnored)!=null&&n.call(r,t))};dv.GlobUtil=DI;var jxe=class extends DI{matches=new Set;constructor(t,r,n){super(t,r,n)}matchEmit(t){this.matches.add(t)}async walk(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((r,n)=>{this.walkCB(this.path,this.patterns,()=>{var u;(u=this.signal)!=null&&u.aborted?n(this.signal.reason):r(this.matches)})}),this.matches}walkSync(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var r;if((r=this.signal)!=null&&r.aborted)throw this.signal.reason}),this.matches}};dv.GlobWalker=jxe;var Lxe=class extends DI{results;constructor(t,r,n){super(t,r,n),this.results=new swn.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,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}};dv.GlobStream=Lxe});var qxe=I(fte=>{"use strict";Object.defineProperty(fte,"__esModule",{value:!0});fte.Glob=void 0;var cwn=uv(),lwn=require("url"),cte=HSt(),fwn=Txe(),lte=ZSt(),pwn=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Nxe=class{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(t,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,lwn.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(a=>a.includes("/")?a:`./**/${a}`)}if(this.pattern=t,this.platform=r.platform||pwn,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let a=r.platform==="win32"?cte.PathScurryWin32:r.platform==="darwin"?cte.PathScurryDarwin:r.platform?cte.PathScurryPosix:cte.PathScurry;this.scurry=new a(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",u={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},i=this.pattern.map(a=>new cwn.Minimatch(a,u)),[o,s]=i.reduce((a,c)=>(a[0].push(...c.set),a[1].push(...c.globParts),a),[[],[]]);this.patterns=o.map((a,c)=>{let l=s[c];if(!l)throw new Error("invalid pattern object");return new fwn.Pattern(a,l,0,this.platform)})}async walk(){return[...await new lte.GlobWalker(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 lte.GlobWalker(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 lte.GlobStream(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 lte.GlobStream(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()}};fte.Glob=Nxe});var Mxe=I(pte=>{"use strict";Object.defineProperty(pte,"__esModule",{value:!0});pte.hasMagic=void 0;var hwn=uv(),dwn=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let r of e)if(new hwn.Minimatch(r,t).hasMagic())return!0;return!1};pte.hasMagic=dwn});var nOt=I(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.glob=In.sync=In.iterate=In.iterateSync=In.stream=In.streamSync=In.globIterate=In.globIterateSync=In.globSync=In.globStream=In.globStreamSync=In.Ignore=In.hasMagic=In.Glob=In.unescape=In.escape=void 0;var eOt=uv(),A3=qxe(),mwn=Mxe(),rOt=uv();Object.defineProperty(In,"escape",{enumerable:!0,get:function(){return rOt.escape}});Object.defineProperty(In,"unescape",{enumerable:!0,get:function(){return rOt.unescape}});var gwn=qxe();Object.defineProperty(In,"Glob",{enumerable:!0,get:function(){return gwn.Glob}});var vwn=Mxe();Object.defineProperty(In,"hasMagic",{enumerable:!0,get:function(){return vwn.hasMagic}});var Dwn=kxe();Object.defineProperty(In,"Ignore",{enumerable:!0,get:function(){return Dwn.Ignore}});function EI(e,t={}){return new A3.Glob(e,t).streamSync()}In.globStreamSync=EI;function Uxe(e,t={}){return new A3.Glob(e,t).stream()}In.globStream=Uxe;function $xe(e,t={}){return new A3.Glob(e,t).walkSync()}In.globSync=$xe;async function tOt(e,t={}){return new A3.Glob(e,t).walk()}function bI(e,t={}){return new A3.Glob(e,t).iterateSync()}In.globIterateSync=bI;function zxe(e,t={}){return new A3.Glob(e,t).iterate()}In.globIterate=zxe;In.streamSync=EI;In.stream=Object.assign(Uxe,{sync:EI});In.iterateSync=bI;In.iterate=Object.assign(zxe,{sync:bI});In.sync=Object.assign($xe,{stream:EI,iterate:bI});In.glob=Object.assign(tOt,{glob:tOt,globSync:$xe,sync:In.sync,globStream:Uxe,stream:In.stream,globStreamSync:EI,streamSync:In.streamSync,globIterate:zxe,iterate:In.iterate,globIterateSync:bI,iterateSync:In.iterateSync,Glob:A3.Glob,hasMagic:mwn.hasMagic,escape:eOt.escape,unescape:eOt.unescape});In.glob.glob=In.glob});var Gxe=I(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.optArgSync=Ch.optArg=Ch.assertRimrafOptions=Ch.isRimrafOptions=void 0;var mv=(e,t)=>typeof e>"u"||typeof e===t,ywn=e=>!!e&&typeof e=="object"&&mv(e.preserveRoot,"boolean")&&mv(e.tmp,"string")&&mv(e.maxRetries,"number")&&mv(e.retryDelay,"number")&&mv(e.backoff,"number")&&mv(e.maxBackoff,"number")&&(mv(e.glob,"boolean")||e.glob&&typeof e.glob=="object")&&mv(e.filter,"function");Ch.isRimrafOptions=ywn;var Ewn=e=>{if(!(0,Ch.isRimrafOptions)(e))throw new Error("invalid rimraf options")};Ch.assertRimrafOptions=Ewn;var uOt=e=>{(0,Ch.assertRimrafOptions)(e);let{glob:t,...r}=e;if(!t)return r;let n=t===!0?e.signal?{signal:e.signal}:{}:e.signal?{signal:e.signal,...t}:t;return{...r,glob:{...n,absolute:!0,withFileTypes:!1}}},bwn=(e={})=>uOt(e);Ch.optArg=bwn;var Cwn=(e={})=>uOt(e);Ch.optArgSync=Cwn});var CI=I(Wxe=>{"use strict";Object.defineProperty(Wxe,"__esModule",{value:!0});Wxe.default=process.env.__TESTING_RIMRAF_PLATFORM__||process.platform});var iOt=I(xI=>{"use strict";var xwn=xI&&xI.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xI,"__esModule",{value:!0});var Vxe=require("path"),Awn=require("util"),Fwn=xwn(CI()),_wn=(e,t={})=>{let r=typeof e;if(r!=="string"){let u=e&&r==="object"&&e.constructor,o=`The "path" argument must be of type string. Received ${u&&u.name?`an instance of ${u.name}`:r==="object"?(0,Awn.inspect)(e):`type ${r} ${e}`}`;throw Object.assign(new TypeError(o),{path:e,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(e)){let u="path must be a string without null bytes";throw Object.assign(new TypeError(u),{path:e,code:"ERR_INVALID_ARG_VALUE"})}e=(0,Vxe.resolve)(e);let{root:n}=(0,Vxe.parse)(e);if(e===n&&t.preserveRoot!==!1){let u="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(u),{path:e,code:"ERR_PRESERVE_ROOT"})}if(Fwn.default==="win32"){let u=/[*|"<>?:]/,{root:i}=(0,Vxe.parse)(e);if(u.test(e.substring(i.length)))throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e};xI.default=_wn});var vv=I(eo=>{"use strict";var Bwn=eo&&eo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(eo,"__esModule",{value:!0});eo.promises=eo.readdirSync=eo.unlinkSync=eo.lstatSync=eo.statSync=eo.rmSync=eo.rmdirSync=eo.renameSync=eo.mkdirSync=eo.chmodSync=void 0;var cg=Bwn(require("fs")),gv=require("fs");Object.defineProperty(eo,"chmodSync",{enumerable:!0,get:function(){return gv.chmodSync}});Object.defineProperty(eo,"mkdirSync",{enumerable:!0,get:function(){return gv.mkdirSync}});Object.defineProperty(eo,"renameSync",{enumerable:!0,get:function(){return gv.renameSync}});Object.defineProperty(eo,"rmdirSync",{enumerable:!0,get:function(){return gv.rmdirSync}});Object.defineProperty(eo,"rmSync",{enumerable:!0,get:function(){return gv.rmSync}});Object.defineProperty(eo,"statSync",{enumerable:!0,get:function(){return gv.statSync}});Object.defineProperty(eo,"lstatSync",{enumerable:!0,get:function(){return gv.lstatSync}});Object.defineProperty(eo,"unlinkSync",{enumerable:!0,get:function(){return gv.unlinkSync}});var wwn=require("fs"),Swn=e=>(0,wwn.readdirSync)(e,{withFileTypes:!0});eo.readdirSync=Swn;var Own=(e,t)=>new Promise((r,n)=>cg.default.chmod(e,t,(u,...i)=>u?n(u):r(...i))),Twn=(e,t)=>new Promise((r,n)=>cg.default.mkdir(e,t,(u,i)=>u?n(u):r(i))),Pwn=e=>new Promise((t,r)=>cg.default.readdir(e,{withFileTypes:!0},(n,u)=>n?r(n):t(u))),kwn=(e,t)=>new Promise((r,n)=>cg.default.rename(e,t,(u,...i)=>u?n(u):r(...i))),Rwn=(e,t)=>new Promise((r,n)=>cg.default.rm(e,t,(u,...i)=>u?n(u):r(...i))),Iwn=e=>new Promise((t,r)=>cg.default.rmdir(e,(n,...u)=>n?r(n):t(...u))),jwn=e=>new Promise((t,r)=>cg.default.stat(e,(n,u)=>n?r(n):t(u))),Lwn=e=>new Promise((t,r)=>cg.default.lstat(e,(n,u)=>n?r(n):t(u))),Nwn=e=>new Promise((t,r)=>cg.default.unlink(e,(n,...u)=>n?r(n):t(...u)));eo.promises={chmod:Own,mkdir:Twn,readdir:Pwn,rename:kwn,rm:Rwn,rmdir:Iwn,stat:jwn,lstat:Lwn,unlink:Nwn}});var hte=I(FA=>{"use strict";Object.defineProperty(FA,"__esModule",{value:!0});FA.readdirOrErrorSync=FA.readdirOrError=void 0;var oOt=vv(),{readdir:qwn}=oOt.promises,Mwn=e=>qwn(e).catch(t=>t);FA.readdirOrError=Mwn;var Uwn=e=>{try{return(0,oOt.readdirSync)(e)}catch(t){return t}};FA.readdirOrErrorSync=Uwn});var dte=I(_A=>{"use strict";Object.defineProperty(_A,"__esModule",{value:!0});_A.ignoreENOENTSync=_A.ignoreENOENT=void 0;var $wn=async e=>e.catch(t=>{if(t.code!=="ENOENT")throw t});_A.ignoreENOENT=$wn;var zwn=e=>{try{return e()}catch(t){if((t==null?void 0:t.code)!=="ENOENT")throw t}};_A.ignoreENOENTSync=zwn});var Hxe=I(BA=>{"use strict";Object.defineProperty(BA,"__esModule",{value:!0});BA.rimrafPosixSync=BA.rimrafPosix=void 0;var mte=vv(),{lstat:Gwn,rmdir:Wwn,unlink:Vwn}=mte.promises,gte=require("path"),sOt=hte(),vte=dte(),Hwn=async(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return await aOt(e,t,await Gwn(e))}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};BA.rimrafPosix=Hwn;var Kwn=(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return cOt(e,t,(0,mte.lstatSync)(e))}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};BA.rimrafPosixSync=Kwn;var aOt=async(e,t,r)=>{var i;if((i=t==null?void 0:t.signal)!=null&&i.aborted)throw t.signal.reason;let n=r.isDirectory()?await(0,sOt.readdirOrError)(e):null;if(!Array.isArray(n)){if(n){if(n.code==="ENOENT")return!0;if(n.code!=="ENOTDIR")throw n}return t.filter&&!await t.filter(e,r)?!1:(await(0,vte.ignoreENOENT)(Vwn(e)),!0)}return!(await Promise.all(n.map(o=>aOt((0,gte.resolve)(e,o.name),t,o)))).reduce((o,s)=>o&&s,!0)||t.preserveRoot===!1&&e===(0,gte.parse)(e).root||t.filter&&!await t.filter(e,r)?!1:(await(0,vte.ignoreENOENT)(Wwn(e)),!0)},cOt=(e,t,r)=>{var i;if((i=t==null?void 0:t.signal)!=null&&i.aborted)throw t.signal.reason;let n=r.isDirectory()?(0,sOt.readdirOrErrorSync)(e):null;if(!Array.isArray(n)){if(n){if(n.code==="ENOENT")return!0;if(n.code!=="ENOTDIR")throw n}return t.filter&&!t.filter(e,r)?!1:((0,vte.ignoreENOENTSync)(()=>(0,mte.unlinkSync)(e)),!0)}let u=!0;for(let o of n){let s=(0,gte.resolve)(e,o.name);u=cOt(s,t,o)&&u}return t.preserveRoot===!1&&e===(0,gte.parse)(e).root||!u||t.filter&&!t.filter(e,r)?!1:((0,vte.ignoreENOENTSync)(()=>(0,mte.rmdirSync)(e)),!0)}});var fOt=I(wA=>{"use strict";Object.defineProperty(wA,"__esModule",{value:!0});wA.fixEPERMSync=wA.fixEPERM=void 0;var lOt=vv(),{chmod:Ywn}=lOt.promises,Xwn=e=>async t=>{try{return await e(t)}catch(r){let n=r;if((n==null?void 0:n.code)==="ENOENT")return;if((n==null?void 0:n.code)==="EPERM"){try{await Ywn(t,438)}catch(u){let i=u;if((i==null?void 0:i.code)==="ENOENT")return;throw r}return await e(t)}throw r}};wA.fixEPERM=Xwn;var Jwn=e=>t=>{try{return e(t)}catch(r){let n=r;if((n==null?void 0:n.code)==="ENOENT")return;if((n==null?void 0:n.code)==="EPERM"){try{(0,lOt.chmodSync)(t,438)}catch(u){let i=u;if((i==null?void 0:i.code)==="ENOENT")return;throw r}return e(t)}throw r}};wA.fixEPERMSync=Jwn});var pOt=I(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.retryBusySync=As.retryBusy=As.codes=As.MAXRETRIES=As.RATE=As.MAXBACKOFF=void 0;As.MAXBACKOFF=200;As.RATE=1.2;As.MAXRETRIES=10;As.codes=new Set(["EMFILE","ENFILE","EBUSY"]);var Qwn=e=>{let t=async(r,n,u=1,i=0)=>{let o=n.maxBackoff||As.MAXBACKOFF,s=n.backoff||As.RATE,a=n.maxRetries||As.MAXRETRIES,c=0;for(;;)try{return await e(r)}catch(l){let f=l;if((f==null?void 0:f.path)===r&&(f!=null&&f.code)&&As.codes.has(f.code)){if(u=Math.ceil(u*s),i=u+i,i<o)return new Promise((p,h)=>{setTimeout(()=>{t(r,n,u,i).then(p,h)},u)});if(c<a){c++;continue}}throw l}};return t};As.retryBusy=Qwn;var Zwn=e=>(r,n)=>{let u=n.maxRetries||As.MAXRETRIES,i=0;for(;;)try{return e(r)}catch(o){let s=o;if((s==null?void 0:s.path)===r&&(s!=null&&s.code)&&As.codes.has(s.code)&&i<u){i++;continue}throw o}};As.retryBusySync=Zwn});var mOt=I(Dv=>{"use strict";var eSn=Dv&&Dv.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dv,"__esModule",{value:!0});Dv.defaultTmpSync=Dv.defaultTmp=void 0;var Dte=require("os"),SA=require("path"),hOt=vv(),dOt=eSn(CI()),{stat:tSn}=hOt.promises,rSn=e=>{try{return(0,hOt.statSync)(e).isDirectory()}catch{return!1}},nSn=e=>tSn(e).then(t=>t.isDirectory(),()=>!1),uSn=async e=>{let{root:t}=(0,SA.parse)(e),r=(0,Dte.tmpdir)(),{root:n}=(0,SA.parse)(r);if(t.toLowerCase()===n.toLowerCase())return r;let u=(0,SA.resolve)(t,"/temp");return await nSn(u)?u:t},iSn=e=>{let{root:t}=(0,SA.parse)(e),r=(0,Dte.tmpdir)(),{root:n}=(0,SA.parse)(r);if(t.toLowerCase()===n.toLowerCase())return r;let u=(0,SA.resolve)(t,"/temp");return rSn(u)?u:t},oSn=async()=>(0,Dte.tmpdir)(),sSn=()=>(0,Dte.tmpdir)();Dv.defaultTmp=dOt.default==="win32"?uSn:oSn;Dv.defaultTmpSync=dOt.default==="win32"?iSn:sSn});var Xxe=I(TA=>{"use strict";Object.defineProperty(TA,"__esModule",{value:!0});TA.rimrafMoveRemoveSync=TA.rimrafMoveRemove=void 0;var lg=require("path"),yOt=mOt(),yte=dte(),OA=vv(),{lstat:aSn,rename:cSn,unlink:gOt,rmdir:lSn,chmod:fSn}=OA.promises,EOt=hte(),bOt=e=>`.${(0,lg.basename)(e)}.${Math.random()}`,pSn=async e=>gOt(e).catch(t=>{if(t.code==="EPERM")return fSn(e,438).then(()=>gOt(e),r=>{if(r.code!=="ENOENT")throw t});if(t.code==="ENOENT")return;throw t}),hSn=e=>{try{(0,OA.unlinkSync)(e)}catch(t){if((t==null?void 0:t.code)==="EPERM")try{return(0,OA.chmodSync)(e,438)}catch(r){if((r==null?void 0:r.code)==="ENOENT")return;throw t}else if((t==null?void 0:t.code)==="ENOENT")return;throw t}},dSn=async(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return await Kxe(e,t,await aSn(e))}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};TA.rimrafMoveRemove=dSn;var Kxe=async(e,t,r)=>{var i;if((i=t==null?void 0:t.signal)!=null&&i.aborted)throw t.signal.reason;if(!t.tmp)return Kxe(e,{...t,tmp:await(0,yOt.defaultTmp)(e)},r);if(e===t.tmp&&(0,lg.parse)(e).root!==e)throw new Error("cannot delete temp directory used for deletion");let n=r.isDirectory()?await(0,EOt.readdirOrError)(e):null;if(!Array.isArray(n)){if(n){if(n.code==="ENOENT")return!0;if(n.code!=="ENOTDIR")throw n}return t.filter&&!await t.filter(e,r)?!1:(await(0,yte.ignoreENOENT)(vOt(e,t.tmp,pSn)),!0)}return!(await Promise.all(n.map(o=>Kxe((0,lg.resolve)(e,o.name),t,o)))).reduce((o,s)=>o&&s,!0)||t.preserveRoot===!1&&e===(0,lg.parse)(e).root||t.filter&&!await t.filter(e,r)?!1:(await(0,yte.ignoreENOENT)(vOt(e,t.tmp,lSn)),!0)},vOt=async(e,t,r)=>{let n=(0,lg.resolve)(t,bOt(e));return await cSn(e,n),await r(n)},mSn=(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return Yxe(e,t,(0,OA.lstatSync)(e))}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};TA.rimrafMoveRemoveSync=mSn;var Yxe=(e,t,r)=>{var o;if((o=t==null?void 0:t.signal)!=null&&o.aborted)throw t.signal.reason;if(!t.tmp)return Yxe(e,{...t,tmp:(0,yOt.defaultTmpSync)(e)},r);let n=t.tmp;if(e===t.tmp&&(0,lg.parse)(e).root!==e)throw new Error("cannot delete temp directory used for deletion");let u=r.isDirectory()?(0,EOt.readdirOrErrorSync)(e):null;if(!Array.isArray(u)){if(u){if(u.code==="ENOENT")return!0;if(u.code!=="ENOTDIR")throw u}return t.filter&&!t.filter(e,r)?!1:((0,yte.ignoreENOENTSync)(()=>DOt(e,n,hSn)),!0)}let i=!0;for(let s of u){let a=(0,lg.resolve)(e,s.name);i=Yxe(a,t,s)&&i}return!i||t.preserveRoot===!1&&e===(0,lg.parse)(e).root||t.filter&&!t.filter(e,r)?!1:((0,yte.ignoreENOENTSync)(()=>DOt(e,n,OA.rmdirSync)),!0)},DOt=(e,t,r)=>{let n=(0,lg.resolve)(t,bOt(e));return(0,OA.renameSync)(e,n),r(n)}});var Zxe=I(PA=>{"use strict";Object.defineProperty(PA,"__esModule",{value:!0});PA.rimrafWindowsSync=PA.rimrafWindows=void 0;var Ete=require("path"),xte=fOt(),Ate=vv(),bte=dte(),COt=hte(),Fte=pOt(),xOt=Xxe(),{unlink:gSn,rmdir:vSn,lstat:DSn}=Ate.promises,ySn=(0,Fte.retryBusy)((0,xte.fixEPERM)(gSn)),ESn=(0,Fte.retryBusySync)((0,xte.fixEPERMSync)(Ate.unlinkSync)),bSn=(0,Fte.retryBusy)((0,xte.fixEPERM)(vSn)),CSn=(0,Fte.retryBusySync)((0,xte.fixEPERMSync)(Ate.rmdirSync)),xSn=async(e,t)=>{var u;if((u=t==null?void 0:t.signal)!=null&&u.aborted)throw t.signal.reason;let{filter:r,...n}=t;try{return await bSn(e,n)}catch(i){if((i==null?void 0:i.code)==="ENOTEMPTY")return await(0,xOt.rimrafMoveRemove)(e,n);throw i}},ASn=(e,t)=>{var u;if((u=t==null?void 0:t.signal)!=null&&u.aborted)throw t.signal.reason;let{filter:r,...n}=t;try{return CSn(e,n)}catch(i){let o=i;if((o==null?void 0:o.code)==="ENOTEMPTY")return(0,xOt.rimrafMoveRemoveSync)(e,n);throw i}},yv=Symbol("start"),AOt=Symbol("child"),Cte=Symbol("finish"),FSn=async(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return await Jxe(e,t,await DSn(e),yv)}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};PA.rimrafWindows=FSn;var _Sn=(e,t)=>{var r;if((r=t==null?void 0:t.signal)!=null&&r.aborted)throw t.signal.reason;try{return Qxe(e,t,(0,Ate.lstatSync)(e),yv)}catch(n){if((n==null?void 0:n.code)==="ENOENT")return!0;throw n}};PA.rimrafWindowsSync=_Sn;var Jxe=async(e,t,r,n=yv)=>{var s;if((s=t==null?void 0:t.signal)!=null&&s.aborted)throw t.signal.reason;let u=r.isDirectory()?await(0,COt.readdirOrError)(e):null;if(!Array.isArray(u)){if(u){if(u.code==="ENOENT")return!0;if(u.code!=="ENOTDIR")throw u}return t.filter&&!await t.filter(e,r)?!1:(await(0,bte.ignoreENOENT)(ySn(e,t)),!0)}let i=n===yv?AOt:n,o=(await Promise.all(u.map(a=>Jxe((0,Ete.resolve)(e,a.name),t,a,i)))).reduce((a,c)=>a&&c,!0);if(n===yv)return Jxe(e,t,r,Cte);if(n===Cte){if(t.preserveRoot===!1&&e===(0,Ete.parse)(e).root||!o||t.filter&&!await t.filter(e,r))return!1;await(0,bte.ignoreENOENT)(xSn(e,t))}return!0},Qxe=(e,t,r,n=yv)=>{let u=r.isDirectory()?(0,COt.readdirOrErrorSync)(e):null;if(!Array.isArray(u)){if(u){if(u.code==="ENOENT")return!0;if(u.code!=="ENOTDIR")throw u}return t.filter&&!t.filter(e,r)?!1:((0,bte.ignoreENOENTSync)(()=>ESn(e,t)),!0)}let i=!0;for(let o of u){let s=n===yv?AOt:n,a=(0,Ete.resolve)(e,o.name);i=Qxe(a,t,o,s)&&i}if(n===yv)return Qxe(e,t,r,Cte);if(n===Cte){if(t.preserveRoot===!1&&e===(0,Ete.parse)(e).root||!i||t.filter&&!t.filter(e,r))return!1;(0,bte.ignoreENOENTSync)(()=>{ASn(e,t)})}return!0}});var wOt=I(Ev=>{"use strict";var BSn=Ev&&Ev.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ev,"__esModule",{value:!0});Ev.rimrafManualSync=Ev.rimrafManual=void 0;var FOt=BSn(CI()),_Ot=Hxe(),BOt=Zxe();Ev.rimrafManual=FOt.default==="win32"?BOt.rimrafWindows:_Ot.rimrafPosix;Ev.rimrafManualSync=FOt.default==="win32"?BOt.rimrafWindowsSync:_Ot.rimrafPosixSync});var OOt=I(kA=>{"use strict";Object.defineProperty(kA,"__esModule",{value:!0});kA.rimrafNativeSync=kA.rimrafNative=void 0;var SOt=vv(),{rm:wSn}=SOt.promises,SSn=async(e,t)=>(await wSn(e,{...t,force:!0,recursive:!0}),!0);kA.rimrafNative=SSn;var OSn=(e,t)=>((0,SOt.rmSync)(e,{...t,force:!0,recursive:!0}),!0);kA.rimrafNativeSync=OSn});var ROt=I(bv=>{"use strict";var TSn=bv&&bv.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bv,"__esModule",{value:!0});bv.useNativeSync=bv.useNative=void 0;var POt=TSn(CI()),PSn=process.env.__TESTING_RIMRAF_NODE_VERSION__||process.version,kSn=PSn.replace(/^v/,"").split("."),[TOt=0,RSn=0]=kSn.map(e=>parseInt(e,10)),kOt=TOt>14||TOt===14&&RSn>=14;bv.useNative=!kOt||POt.default==="win32"?()=>!1:e=>!(e!=null&&e.signal)&&!(e!=null&&e.filter);bv.useNativeSync=!kOt||POt.default==="win32"?()=>!1:e=>!(e!=null&&e.signal)&&!(e!=null&&e.filter)});var zOt=I(en=>{"use strict";var ISn=en&&en.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(en,"__esModule",{value:!0});en.rimraf=en.sync=en.rimrafSync=en.moveRemove=en.moveRemoveSync=en.posix=en.posixSync=en.windows=en.windowsSync=en.manual=en.manualSync=en.native=en.nativeSync=en.isRimrafOptions=en.assertRimrafOptions=void 0;var jOt=nOt(),LOt=Gxe(),_te=ISn(iOt()),Bte=wOt(),NOt=Xxe(),wte=OOt(),qOt=Hxe(),MOt=Zxe(),UOt=ROt(),$Ot=Gxe();Object.defineProperty(en,"assertRimrafOptions",{enumerable:!0,get:function(){return $Ot.assertRimrafOptions}});Object.defineProperty(en,"isRimrafOptions",{enumerable:!0,get:function(){return $Ot.isRimrafOptions}});var RA=e=>async(t,r)=>{let n=(0,LOt.optArg)(r);return n.glob&&(t=await(0,jOt.glob)(t,n.glob)),Array.isArray(t)?!!(await Promise.all(t.map(u=>e((0,_te.default)(u,n),n)))).reduce((u,i)=>u&&i,!0):!!await e((0,_te.default)(t,n),n)},IA=e=>(t,r)=>{let n=(0,LOt.optArgSync)(r);return n.glob&&(t=(0,jOt.globSync)(t,n.glob)),Array.isArray(t)?!!t.map(u=>e((0,_te.default)(u,n),n)).reduce((u,i)=>u&&i,!0):!!e((0,_te.default)(t,n),n)};en.nativeSync=IA(wte.rimrafNativeSync);en.native=Object.assign(RA(wte.rimrafNative),{sync:en.nativeSync});en.manualSync=IA(Bte.rimrafManualSync);en.manual=Object.assign(RA(Bte.rimrafManual),{sync:en.manualSync});en.windowsSync=IA(MOt.rimrafWindowsSync);en.windows=Object.assign(RA(MOt.rimrafWindows),{sync:en.windowsSync});en.posixSync=IA(qOt.rimrafPosixSync);en.posix=Object.assign(RA(qOt.rimrafPosix),{sync:en.posixSync});en.moveRemoveSync=IA(NOt.rimrafMoveRemoveSync);en.moveRemove=Object.assign(RA(NOt.rimrafMoveRemove),{sync:en.moveRemoveSync});en.rimrafSync=IA((e,t)=>(0,UOt.useNativeSync)(t)?(0,wte.rimrafNativeSync)(e,t):(0,Bte.rimrafManualSync)(e,t));en.sync=en.rimrafSync;var IOt=RA((e,t)=>(0,UOt.useNative)(t)?(0,wte.rimrafNative)(e,t):(0,Bte.rimrafManual)(e,t));en.rimraf=Object.assign(IOt,{rimraf:IOt,sync:en.rimrafSync,rimrafSync:en.rimrafSync,manual:en.manual,manualSync:en.manualSync,native:en.native,nativeSync:en.nativeSync,posix:en.posix,posixSync:en.posixSync,windows:en.windows,windowsSync:en.windowsSync,moveRemove:en.moveRemove,moveRemoveSync:en.moveRemoveSync});en.rimraf.rimraf=en.rimraf});var KOt={};on(KOt,{default:()=>LSn});function GOt(){let e=(0,Ste.getRootHome)(),t=jA.default.join(e,"logs");AI.sync(t),bt.info("Logs cleaned up successfully.")}function WOt(e){let t=(0,Ste.getRootHome)(),r=jA.default.join(t,"cache");if(e===!0){AI.sync(r),bt.info("Cache cleaned up successfully.");return}AI.sync(jA.default.join(r,e)),bt.info(`Cache [${e}] has been cleaned up successfully.`)}function VOt(e){let t=(0,Ste.getRootHome)(),r=jA.default.join(t,"components");if(e===!0){AI.sync(r),bt.info("Component cleaned up successfully.");return}let n=jA.default.join(r,"devsapp.cn",e);if(!HOt.default.existsSync(n))return bt.tips(`Component [${e}] does not exist.`,"Please check whether the component has been downloaded.");AI.sync(n),bt.info(`Component [${e}] has been cleaned up successfully.`)}var HOt,Ste,jA,AI,jSn,LSn,YOt=Ft(()=>{HOt=ot(require("fs"));pr();pn();Ste=ot(xr()),jA=ot(require("path"));Mn();AI=zOt(),jSn=`Clean up the cache related functions of serverless devs. You can clean up the environment, unused dependent packages and related cache contents through this command.
|
|
349
349
|
|
|
350
350
|
Example:
|
|
351
351
|
$ s clean --component fc api
|
|
@@ -1014,9 +1014,9 @@ ${Muu.default.green("?")}`:void 0,p=h=>(0,wu.isEmpty)(h)?(0,wu.includes)(u,l)?"v
|
|
|
1014
1014
|
`,u)}while(n!==-1);return i+=e.substr(u),i};GVt.exports={stringReplaceAll:Eiu,stringEncaseCRLFWithFirstIndex:biu}});var XVt=I((MYu,YVt)=>{"use strict";var Ciu=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,VVt=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,xiu=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Aiu=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,Fiu=new Map([["n",`
|
|
1015
1015
|
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function KVt(e){let t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):Fiu.get(e)||e}function _iu(e,t){let r=[],n=t.trim().split(/\s*,\s*/g),u;for(let i of n){let o=Number(i);if(!Number.isNaN(o))r.push(o);else if(u=i.match(xiu))r.push(u[2].replace(Aiu,(s,a,c)=>a?KVt(a):c));else throw new Error(`Invalid Chalk template style argument: ${i} (in style '${e}')`)}return r}function Biu(e){VVt.lastIndex=0;let t=[],r;for(;(r=VVt.exec(e))!==null;){let n=r[1];if(r[2]){let u=_iu(n,r[2]);t.push([n].concat(u))}else t.push([n])}return t}function HVt(e,t){let r={};for(let u of t)for(let i of u.styles)r[i[0]]=u.inverse?null:i.slice(1);let n=e;for(let[u,i]of Object.entries(r))if(Array.isArray(i)){if(!(u in n))throw new Error(`Unknown Chalk style: ${u}`);n=i.length>0?n[u](...i):n[u]}return n}YVt.exports=(e,t)=>{let r=[],n=[],u=[];if(t.replace(Ciu,(i,o,s,a,c,l)=>{if(o)u.push(KVt(o));else if(a){let f=u.join("");u=[],n.push(r.length===0?f:HVt(e,r)(f)),r.push({inverse:s,styles:Biu(a)})}else if(c){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(HVt(e,r)(u.join(""))),u=[],r.pop()}else u.push(l)}),n.push(u.join("")),r.length>0){let i=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(i)}return n.join("")}});var ITe=I((UYu,rHt)=>{"use strict";var GL=zVt(),{stdout:TTe,stderr:PTe}=j0(),{stringReplaceAll:wiu,stringEncaseCRLFWithFirstIndex:Siu}=WVt(),{isArray:iie}=Array,QVt=["ansi","ansi","ansi256","ansi16m"],ZF=Object.create(null),Oiu=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=TTe?TTe.level:0;e.level=t.level===void 0?r:t.level},kTe=class{constructor(t){return ZVt(t)}},ZVt=e=>{let t={};return Oiu(t,e),t.template=(...r)=>tHt(t.template,...r),Object.setPrototypeOf(t,oie.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=kTe,t.template};function oie(e){return ZVt(e)}for(let[e,t]of Object.entries(GL))ZF[e]={get(){let r=sie(this,RTe(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};ZF.visible={get(){let e=sie(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var eHt=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of eHt)ZF[e]={get(){let{level:t}=this;return function(...r){let n=RTe(GL.color[QVt[t]][e](...r),GL.color.close,this._styler);return sie(this,n,this._isEmpty)}}};for(let e of eHt){let t="bg"+e[0].toUpperCase()+e.slice(1);ZF[t]={get(){let{level:r}=this;return function(...n){let u=RTe(GL.bgColor[QVt[r]][e](...n),GL.bgColor.close,this._styler);return sie(this,u,this._isEmpty)}}}}var Tiu=Object.defineProperties(()=>{},{...ZF,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),RTe=(e,t,r)=>{let n,u;return r===void 0?(n=e,u=t):(n=r.openAll+e,u=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:u,parent:r}},sie=(e,t,r)=>{let n=(...u)=>iie(u[0])&&iie(u[0].raw)?JVt(n,tHt(n,...u)):JVt(n,u.length===1?""+u[0]:u.join(" "));return Object.setPrototypeOf(n,Tiu),n._generator=e,n._styler=t,n._isEmpty=r,n},JVt=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;let{openAll:n,closeAll:u}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=wiu(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
|
|
1016
1016
|
`);return i!==-1&&(t=Siu(t,u,n,i)),n+t+u},OTe,tHt=(e,...t)=>{let[r]=t;if(!iie(r)||!iie(r.raw))return t.join(" ");let n=t.slice(1),u=[r.raw[0]];for(let i=1;i<r.length;i++)u.push(String(n[i-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[i]));return OTe===void 0&&(OTe=XVt()),OTe(e,u.join(""))};Object.defineProperties(oie.prototype,ZF);var aie=oie();aie.supportsColor=TTe;aie.stderr=oie({level:PTe?PTe.level:0});aie.stderr.supportsColor=PTe;rHt.exports=aie});var uHt=I(WL=>{"use strict";WL.__esModule=!0;WL.parseArgsStringToArgv=void 0;function nHt(e,t,r){var n=/([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*)|[^\s'"]+|(['"])([^\5]*?)\5/gi,u=e,i=[];t&&i.push(t),r&&i.push(r);var o;do o=n.exec(u),o!==null&&i.push(Piu(o[1],o[6],o[0]));while(o!==null);return i}WL.default=nHt;WL.parseArgsStringToArgv=nHt;function Piu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0;r<e.length;r++){var n=e[r];if(typeof n=="string")return n}}});var jTe=I(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.OUTPUT_EXP_PATTERN=lm.COMPONENT_EXP_PATTERN=lm.INFO_EXP_PATTERN=lm.EXIT_CODE=void 0;lm.EXIT_CODE={DEVS:100,COMPONENT:101,PLUGIN:101,RUN:101};lm.INFO_EXP_PATTERN=/\$\{resources\.([^.{}]+)\.info(\.[^.{}]+)+}/g;lm.COMPONENT_EXP_PATTERN=/\$\{components\.([^.{}]+)\.output(\.[^.{}]+)+}/g;lm.OUTPUT_EXP_PATTERN=/\$\{resources\.([^.{}]+)\.output(\.[^.{}]+)+}/g});var aHt=I(lp=>{"use strict";var kiu=lp&&lp.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var u=Object.getOwnPropertyDescriptor(t,r);(!u||("get"in u?!t.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,u)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Riu=lp&&lp.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Iiu=lp&&lp.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&kiu(t,e,r);return Riu(t,e),t},VL=lp&&lp.__awaiter||function(e,t,r,n){function u(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function s(l){try{c(n.next(l))}catch(f){o(f)}}function a(l){try{c(n.throw(l))}catch(f){o(f)}}function c(l){l.done?i(l.value):u(l.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},cie=lp&&lp.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lp,"__esModule",{value:!0});var vl=ch(),fm=ir(),iHt=Iiu(xr()),b1=xr(),oHt=cie(Si()),jiu=require("child_process"),sHt=cie(J5()),Liu=cie(uHt()),tD=rie(),HL=cie(ITe()),pm=jTe(),LTe=(0,b1.isDevsDebugMode)()?Rd()("serverless-devs:engine"):e=>{},NTe=class{constructor(t=[],r={}){this.actions=t,this.option=r,this.record={},this.inputs={},this.logger=r.logger}setValue(t,r){this.option.skipActions||(0,fm.set)(this.record,t,r)}start(t,r={}){return VL(this,void 0,void 0,function*(){try{return yield this.afterStart(t,r)}catch(n){let u=n;throw this.option.hookLevel===vl.IActionLevel.GLOBAL&&this.logger.write(`${HL.default.red("\u2716")} ${HL.default.gray(`${vl.IActionLevel.GLOBAL} ${t}-action failed to [${this.record.command}] (${(0,tD.getProcessTime)(this.record.startTime)}s)`)}`),n}})}afterStart(t,r={}){return VL(this,void 0,void 0,function*(){if(this.option.skipActions)return{};this.inputs=r,t===vl.IHookType.COMPLETE&&this.actions.find(i=>i.hookType===vl.IHookType.POST)&&(this.actions=this.actions.map(i=>i.hookType===vl.IHookType.POST?Object.assign(Object.assign({},i),{hookType:vl.IHookType.COMPLETE}):i),this.logger.warn(`The action hook 'post-<command>' has been renamed to 'complete-<command>'.
|
|
1017
|
-
You can still use them now, but we suggest to modify them.`));let n=(0,fm.filter)(this.actions,i=>i.hookType===t);if((0,fm.isEmpty)(n))return{};this.record.startTime=Date.now(),this.record.label=this.option.hookLevel===vl.IActionLevel.PROJECT?`[${this.option.projectName}]`:vl.IActionLevel.GLOBAL,this.logger.debug(`Start executing the ${t}-action in ${this.record.label}`);let u=(0,vl.getInputs)(n,this.record.magic);t!==vl.IHookType.PRE&&(this.record.pluginOutput={});for(let i of u)LTe(`${i.level} action item: ${(0,tD.stringify)(i)}`),this.record.allowFailure=this.record.step&&"allow_failure"in this.record.step?(0,fm.get)(this.record,"step.allow_failure"):i.allow_failure,i.actionType===vl.IActionType.RUN&&(yield this.run(i)),i.actionType===vl.IActionType.PLUGIN&&(yield this.plugin(i)),i.actionType===vl.IActionType.COMPONENT&&i.level===vl.IActionLevel.PROJECT&&(yield this.component(i));return this.logger.debug(`The ${t}-action successfully to execute in ${this.record.label}`),this.option.hookLevel===vl.IActionLevel.GLOBAL&&this.logger.write(`${HL.default.green("\u2714")} ${HL.default.gray(`${vl.IActionLevel.GLOBAL} ${t}-action completed (${(0,tD.getProcessTime)(this.record.startTime)})`)}`),this.record})}onFinish(t){return new Promise((r,n)=>{let u=[],i=[];t.stdout.on("data",o=>{this.logger.append(o.toString()),u.push(o)}),t.stderr.on("data",o=>{this.logger.append(o.toString()),i.push(o)}),t.on("exit",o=>{o===0?r({}):n(new Error(Buffer.concat(i).toString()))})})}run(t){return VL(this,void 0,void 0,function*(){if(oHt.default.existsSync(t.path)&&oHt.default.lstatSync(t.path).isDirectory()){try{let n=(0,jiu.spawn)(t.value,{cwd:t.path,shell:!0});yield this.onFinish(n)}catch(n){let u=n;if(iHt.isWindow()&&(LTe("Command run execution environment\uFF1ACMD"),LTe("Please check whether the actions section of yaml can be executed in the current environment.")),(0,tD.getAllowFailure)(this.record.allowFailure,{exitCode:pm.EXIT_CODE.RUN,command:this.record.command}))return;throw new b1.DevsError(u.message,{data:(0,fm.get)(n,"data"),stack:u.stack,exitCode:pm.EXIT_CODE.RUN,prefix:`${this.record.label} ${t.hookType}-action failed to [${this.record.command}]:`,trackerType:b1.ETrackerType.runtimeException})}return}if(!(0,tD.getAllowFailure)(this.record.allowFailure,{exitCode:pm.EXIT_CODE.DEVS,command:this.record.command}))throw new b1.DevsError(`The ${t.path} directory does not exist.`,{exitCode:pm.EXIT_CODE.DEVS,prefix:`${this.record.label} ${t.hookType}-action failed to [${this.record.command}]:`,trackerType:b1.ETrackerType.parseException})})}plugin(t){return VL(this,void 0,void 0,function*(){try{let r=yield(0,sHt.default)(t.value),n=(0,fm.isEmpty)(this.record.pluginOutput)?this.inputs:this.record.pluginOutput;this.record.pluginOutput=yield r(n,t.args,this.logger)}catch(r){let n=r;if((0,tD.getAllowFailure)(this.record.allowFailure,{exitCode:pm.EXIT_CODE.PLUGIN,command:this.record.command}))return;throw new b1.DevsError(n.message,{data:(0,fm.get)(r,"data"),stack:n.stack,exitCode:pm.EXIT_CODE.PLUGIN,prefix:`${this.record.label} ${t.hookType}-action failed to [${this.record.command}]:`,trackerType:b1.ETrackerType.runtimeException})}})}component(t){return VL(this,void 0,void 0,function*(){let r=(0,Liu.default)(t.value),{_:n}=iHt.parseArgv(r),[u,i]=n,o=yield(0,sHt.default)(u,{logger:this.logger,cleanCache:!0});if(o[i]){let a=Object.assign(Object.assign({},this.record.componentProps),{args:(0,fm.filter)(r.slice(2),c=>!(0,fm.includes)([u,i],c))});try{return yield o[i](a)}catch(c){let l=c;if((0,tD.getAllowFailure)(this.record.allowFailure,{exitCode:pm.EXIT_CODE.COMPONENT,command:this.record.command}))return;throw new b1.DevsError(l.message,{data:(0,fm.get)(c,"data"),stack:l.stack,exitCode:pm.EXIT_CODE.COMPONENT,prefix:`${this.record.label} ${t.hookType}-action failed to [${this.record.command}]:`,trackerType:b1.ETrackerType.runtimeException})}}if(!(0,tD.getAllowFailure)(this.record.allowFailure,{exitCode:pm.EXIT_CODE.DEVS,command:this.record.command}))throw new b1.DevsError(`The [${i}] command was not found.`,{exitCode:pm.EXIT_CODE.DEVS,prefix:`${this.record.label} ${t.hookType}-action failed to [${this.record.command}]:`,tips:`Please check the component ${u} has the ${i} command. Serverless Devs documents\uFF1A${HL.default.underline("https://manual.serverless-devs.com/")}`,trackerType:b1.ETrackerType.parseException})})}};lp.default=NTe});var gHt=I(Ro=>{"use strict";var mHt=Ro&&Ro.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var u=Object.getOwnPropertyDescriptor(t,r);(!u||("get"in u?!t.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,u)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Niu=Ro&&Ro.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),qiu=Ro&&Ro.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&mHt(t,e,r);return Niu(t,e),t},Miu=Ro&&Ro.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&mHt(t,e,r)},Dc=Ro&&Ro.__awaiter||function(e,t,r,n){function u(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function s(l){try{c(n.next(l))}catch(f){o(f)}}function a(l){try{c(n.throw(l))}catch(f){o(f)}}function c(l){l.done?i(l.value):u(l.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},rD=Ro&&Ro.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.init=Ro.preview=Ro.verify=void 0;var cHt=cNt(),
|
|
1018
|
-
${Pg.default.gray("====================")}`)),this.globalActionInstance=new fHt.default(r.actions,{hookLevel:fp.IActionLevel.GLOBAL,logger:this.logger,skipActions:this.spec.skipActions});let i=yield(0,hm.getCredential)(u,this.logger);this.context.credential=i;try{this.globalActionInstance.setValue("magic",yield this.getFilterContext()),this.globalActionInstance.setValue("command",n),yield this.globalActionInstance.start(fp.IHookType.PRE,{access:u,credential:i})}catch(s){return this.context.error.push(s),this.context.status=qu.STEP_STATUS.FAILURE,yield this.doCompleted(),this.context}this.context.steps=(0,
|
|
1019
|
-
`})}`,{exitCode:dm.EXIT_CODE.DEVS,trackerType:Dl.ETrackerType.parseException,prefix:"Function props validation error:"})})}getSchemaByInstance(t){return!t||!t.getSchema?null:t.getSchema()}download(t){return Dc(this,void 0,void 0,function*(){let{command:r}=this.spec,n=[];for(let u of t){let i=this.glog.__generate(u.projectName),o=yield(0,pHt.default)(u.component,{logger:i,engineLogger:this.logger}),s=(0,Cr.get)(o,`commands.${r}.verify`);n.push(Object.assign(Object.assign({},u),{instance:o,logger:i,verify:(0,Cr.isUndefined)(s)?!0:s}))}return n})}getLogger(){let t=(0,Cr.get)(this.options,"logConfig.customLogger");if(t){if(mm("use custom logger"),(t==null?void 0:t.CODE)===hHt.default.CODE)return t;throw new Error("customLogger must be instance of Logger")}return new hHt.default(Object.assign(Object.assign({traceId:(0,Dl.traceid)(),logDir:lHt.default.join((0,Dl.getRootHome)(),"logs")},this.options.logConfig),{level:(0,Cr.get)(this.options,"logConfig.level",this.spec.debug?"DEBUG":void 0)}))}recordContext(t,r={}){let{status:n,error:u,output:i,process_time:o,props:s,done:a}=r;this.context.stepCount=t.stepCount,this.context.steps=(0,Cr.map)(this.context.steps,c=>(c.stepCount===t.stepCount&&(n&&(c.status=n),u&&(c.error=u,this.context.error.push(u)),s&&(c.props=s),i&&(c.output=i),a&&(c.done=a),(0,Cr.has)(r,"process_time")&&(c.process_time=o)),c))}getInfo(t){return Dc(this,void 0,void 0,function*(){if(!t)return;let{props:r}=t,n=JSON.stringify(r),u=n.matchAll(dm.INFO_EXP_PATTERN),i=new Set;for(let a of u)a[1]&&i.add(a[1]);let o=n.matchAll(dm.COMPONENT_EXP_PATTERN);for(let a of o)a[1]&&i.add(a[1]);if((0,Cr.isEmpty)(i))return;let s=(0,Cr.map)(Array.from(i),a=>this.context.allSteps.find(c=>c.projectName===a));yield Promise.all((0,Cr.map)(s,a=>Dc(this,void 0,void 0,function*(){if(!a)return;let c=(0,Cr.get)(this.info,a.projectName);if(!c||(0,Cr.isEmpty)(c)||(0,Cr.isNil)(c)){this.logger.write(`${Pg.default.gray(`execute info command of [${a.projectName}]...`)}`);let l=(0,Cr.cloneDeep)(this.spec);l.command="info";let f=yield this.doSrc(a,{},l);(0,Cr.set)(this.info,a.projectName,f),this.logger.write(`${Pg.default.gray(`[${a.projectName}] info command executed.`)}`)}})))})}getFilterContext(t){return Dc(this,void 0,void 0,function*(){yield this.getInfo(t);let r={cwd:lHt.default.dirname(this.spec.yaml.path),vars:this.spec.yaml.vars,resources:{},components:{},__runtime:this.options.verify?"engine":"parse",__steps:this.context.steps};for(let n of this.context.allSteps){let u=(0,Cr.find)(this.context.steps,i=>i.projectName===n.projectName);r.resources[n.projectName]={output:n.output||(0,Cr.get)(u,"output")||{},props:n.props||(0,Cr.get)(u,"props")||{},info:this.info[n.projectName]||{}},r.components[n.projectName]={output:this.info[n.projectName]||{}}}return t&&(r.credential=t.credential,r.that={name:t.projectName,access:t.access,component:t.component,props:r.resources[t.projectName].props,output:r.resources[t.projectName].output}),r})}doCompleted(){return Dc(this,void 0,void 0,function*(){if(this.context.completed=!0,this.context.status===qu.STEP_STATUS.FAILURE)try{yield this.globalActionInstance.start(fp.IHookType.FAIL,this.context)}catch(t){this.context.status=qu.STEP_STATUS.FAILURE,this.context.error.push(t)}if(this.context.status===qu.STEP_STATUS.SUCCESS)try{yield this.globalActionInstance.start(fp.IHookType.SUCCESS,this.context)}catch(t){this.context.status=qu.STEP_STATUS.FAILURE,this.context.error.push(t)}try{yield this.globalActionInstance.start(fp.IHookType.COMPLETE,this.context)}catch(t){this.context.status=qu.STEP_STATUS.FAILURE,this.context.error.push(t)}})}handleSrc(t){var r,n,u;return Dc(this,void 0,void 0,function*(){let{command:i}=this.spec;try{yield this.handleAfterSrc(t)}catch{try{let a=yield(r=this.actionInstance)===null||r===void 0?void 0:r.start(fp.IHookType.FAIL,this.record.componentProps);this.recordContext(t,(0,Cr.get)(a,"pluginOutput",{}))}catch(a){this.record.status=qu.STEP_STATUS.FAILURE,this.recordContext(t,{error:a})}}if(this.record.status===qu.STEP_STATUS.SUCCESS)try{this.actionInstance.setValue("magic",yield this.getFilterContext(t));let s=yield(n=this.actionInstance)===null||n===void 0?void 0:n.start(fp.IHookType.SUCCESS,Object.assign(Object.assign({},this.record.componentProps),{output:(0,Cr.get)(t,"output",{})}));this.recordContext(t,(0,Cr.get)(s,"pluginOutput",{}))}catch(s){this.record.status=qu.STEP_STATUS.FAILURE,this.recordContext(t,{error:s})}try{let s=yield(u=this.actionInstance)===null||u===void 0?void 0:u.start(fp.IHookType.COMPLETE,Object.assign(Object.assign({},this.record.componentProps),{output:(0,Cr.get)(t,"output",{})}));this.recordContext(t,(0,Cr.get)(s,"pluginOutput",{}))}catch(s){this.record.status=qu.STEP_STATUS.FAILURE,this.recordContext(t,{error:s})}let o=(0,hm.getProcessTime)(this.record.startTime);this.recordContext(t,{done:!0,process_time:o}),this.record.status===qu.STEP_STATUS.SUCCESS&&this.logger.write(`${Pg.default.green("\u2714")} ${Pg.default.gray(`[${t.projectName}] completed (${o}s)`)}`),this.record.status===qu.STEP_STATUS.FAILURE&&this.logger.write(`${Pg.default.red("\u2716")} ${Pg.default.gray(`[${t.projectName}] failed to [${i}] (${o}s)`)}`),this.glog.__unset(t.projectName)})}handleAfterSrc(t){var r;return Dc(this,void 0,void 0,function*(){try{mm(`project item: ${(0,hm.stringify)(t)}`);let{command:n}=this.spec;t.credential=yield(0,hm.getCredential)(t.access,this.logger);let{AccessKeyID:u,AccessKeySecret:i}=t.credential;this.glog.__setSecret([u,i]);let o=this.parseSpecInstance.parseActions(t.actions,fp.IActionLevel.PROJECT);mm(`project actions: ${JSON.stringify(o)}`),this.actionInstance=new fHt.default(o,{hookLevel:fp.IActionLevel.PROJECT,projectName:t.projectName,logger:t.logger,skipActions:this.spec.skipActions}),this.actionInstance.setValue("magic",yield this.getFilterContext(t)),this.actionInstance.setValue("step",t),this.actionInstance.setValue("command",n);let s=yield this.getProps(t);this.actionInstance.setValue("componentProps",s);let a=yield(r=this.actionInstance)===null||r===void 0?void 0:r.start(fp.IHookType.PRE,s),c=yield this.doSrc(t,a);this.record.editStatusAble&&(this.record.status=qu.STEP_STATUS.SUCCESS),t.id&&(this.record.steps=Object.assign(Object.assign({},this.record.steps),{[t.id]:{status:qu.STEP_STATUS.SUCCESS,output:c}})),this.recordContext(t,{status:qu.STEP_STATUS.SUCCESS,output:c})}catch(n){let u=n,i=t["continue-on-error"]===!0?qu.STEP_STATUS.ERROR_WITH_CONTINUE:qu.STEP_STATUS.FAILURE;if(this.record.editStatusAble&&(this.record.status=i),i===qu.STEP_STATUS.FAILURE&&(this.record.editStatusAble=!1),t.id&&(this.record.steps=Object.assign(Object.assign({},this.record.steps),{[t.id]:{status:i}})),t["continue-on-error"])this.recordContext(t,{status:i});else throw this.recordContext(t,{status:i,error:u}),u}})}getProps(t){return Dc(this,void 0,void 0,function*(){let r=yield this.getFilterContext(t);mm(`magic context: ${JSON.stringify(r)}`);let n=(0,fp.getInputs)(t.props,r),{projectName:u,command:i}=this.spec,o={cwd:this.options.cwd,userAgent:(0,Dl.getUserAgent)({component:t.instance.__info}),name:(0,Cr.get)(this.spec,"yaml.appName"),props:n,command:i,args:(0,Cr.filter)(this.options.args,s=>!(0,Cr.includes)([u,i],s)),yaml:{path:(0,Cr.get)(this.spec,"yaml.path")},resource:{name:t.projectName,component:t.component,access:t.access},outputs:this.getOutput(),getCredential:()=>Dc(this,void 0,void 0,function*(){let s=yield new Uiu.default({logger:this.logger}).get(t.access);return(0,Cr.get)(s,"credential",{})})};return this.recordContext(t,{props:n}),mm(`get props: ${JSON.stringify(o)}`),o})}doSrc(t,r={},n=this.spec){return Dc(this,void 0,void 0,function*(){let{command:u="",projectName:i,yaml:o}=n,s=yield this.getProps(t),a=o.useFlow?(0,Cr.filter)(this.context.steps,c=>c.flowId===t.flowId):[t];if((0,Cr.size)(a)>1&&s.args.push("-y"),this.record.componentProps=(0,Cr.isEmpty)(r.pluginOutput)?s:r.pluginOutput,mm(`component props: ${(0,hm.stringify)(this.record.componentProps)}`),this.actionInstance.setValue("componentProps",this.record.componentProps),i){if((0,Cr.isFunction)(t.instance[u]))try{return yield t.instance[u](this.record.componentProps)}catch(l){if((0,hm.getAllowFailure)(t.allow_failure,{exitCode:dm.EXIT_CODE.COMPONENT,command:u}))return;let p=l;throw new Dl.DevsError(p.message,{data:(0,Cr.get)(l,"data"),stack:p.stack,exitCode:dm.EXIT_CODE.COMPONENT,prefix:`[${t.projectName}] failed to [${u}]:`,trackerType:Dl.ETrackerType.runtimeException})}if((0,hm.getAllowFailure)(t.allow_failure,{exitCode:dm.EXIT_CODE.DEVS,command:u}))return;throw new Dl.DevsError(`The [${u}] command was not found.`,{exitCode:dm.EXIT_CODE.DEVS,tips:`Please check the component ${t.component} has the ${u} command. Serverless Devs documents\uFF1A${Pg.default.underline("https://manual.serverless-devs.com/")}`,prefix:`[${t.projectName}] failed to [${u}]:`,trackerType:Dl.ETrackerType.parseException})}if((0,Cr.isFunction)(t.instance[u]))try{return yield t.instance[u](this.record.componentProps)}catch(c){if((0,hm.getAllowFailure)(t.allow_failure,{exitCode:dm.EXIT_CODE.COMPONENT,command:u}))return;let f=c;throw new Dl.DevsError(f.message,{data:(0,Cr.get)(c,"data"),stack:f.stack,exitCode:dm.EXIT_CODE.COMPONENT,prefix:`[${t.projectName}] failed to [${u}]:`,trackerType:Dl.ETrackerType.runtimeException})}this.logger.tips(`The [${u}] command was not found.`,`Please check the component ${t.component} has the ${u} command. Serverless Devs documents\uFF1Ahttps://manual.serverless-devs.com/`)})}doSkip(t){return Dc(this,void 0,void 0,function*(){return t.id&&(this.record.steps=Object.assign(Object.assign({},this.record.steps),{[t.id]:{status:qu.STEP_STATUS.SKIP}})),this.recordContext(t,{status:qu.STEP_STATUS.SKIP,process_time:0}),Promise.resolve()})}};Ro.default=qTe});var zTe={};on(zTe,{default:()=>Giu});var gm,lie,vm,Io,UTe,vHt,$Te,DHt,ziu,Giu,GTe=Ft(()=>{gm=ot(jre()),lie=ot(require("path")),vm=ot(xr()),Io=ot(ir());pr();pn();UTe=ot(xr()),vHt=ot(jre());LA();Z8();tv();$Te=class{constructor(t,r={}){this.program=t;this.spec=r}async init(){let t=process.argv.slice(2),{_:r,help:n}=(0,UTe.parseArgv)(t);if(r.length===0&&n)return await this.showSimpleHelp();if(r.length===1&&(this.customProgram=this.program.command(r[0]).allowUnknownOption(),n))return await this.showHelp();if(r.length>1&&(this.customProgram=this.program.command(r[0]).allowUnknownOption(),n))return await this.showComflexHelp();this.customProgram.action(async()=>{await this.doExecCommand()})}async doExecCommand(){let t=process.argv.slice(2),{template:r,help:n,access:u,debug:i,output:o,...s}=(0,UTe.parseArgv)(t),a=await this.getReportComponent(),c={uid:await L3(u),argv:t,command:this.spec.command,component:a,userAgent:(0,vm.getUserAgent)({component:a})};try{let l=await vHt.execCommand({syaml:r,serverName:this.spec.projectName,method:this.spec.command,args:process.argv.slice(2),globalArgs:{access:u,skipActions:s["skip-actions"],debug:i,help:n,output:o||s["output-format"]},env:{serverless_devs_temp_argv:JSON.stringify(process.argv.slice(2))}});Jf(l),il("report.js",{...c,type:"command"})}catch(l){Vd(new vm.DevsError(l.message,{stack:l.stack,trackerType:vm.ETrackerType.runtimeException}),c)}}async getReportComponent(){let t=[],r=(0,Io.get)(this.spec,"components");for(let n of r){if((0,Io.isEmpty)(n))continue;let u=await(0,gm.loadComponent)(n),i=(0,vm.getYamlContent)(lie.default.join(u.__path,"publish.yaml")),o=(0,Io.get)(i,"Version");t.push(o?`${(0,Io.get)(i,"Name")}@${o}`:n)}return(0,Io.join)(t,",")}async showSimpleHelp(){let{steps:t,components:r}=this.spec;if((0,Io.isEmpty)(t))return;let n=["Custom Commands"," Can be used in projects with Serverless Devs Yaml. Usage\uFF1A"," - s <component_command>\uFF1AOperate on the project, E.x: s deploy"," - s <project_name> <component_command>\uFF1AOperate on the resource, E.x: s website deploy"," More information: https://docs.serverless-devs.com/user-guide/builtin/custom/"];if(r.length===1)return(await DHt((0,Io.first)(r))).join(`
|
|
1017
|
+
You can still use them now, but we suggest to modify them.`));let n=(0,fm.filter)(this.actions,i=>i.hookType===t);if((0,fm.isEmpty)(n))return{};this.record.startTime=Date.now(),this.record.label=this.option.hookLevel===vl.IActionLevel.PROJECT?`[${this.option.projectName}]`:vl.IActionLevel.GLOBAL,this.logger.debug(`Start executing the ${t}-action in ${this.record.label}`);let u=(0,vl.getInputs)(n,this.record.magic);t!==vl.IHookType.PRE&&(this.record.pluginOutput={});for(let i of u)LTe(`${i.level} action item: ${(0,tD.stringify)(i)}`),this.record.allowFailure=this.record.step&&"allow_failure"in this.record.step?(0,fm.get)(this.record,"step.allow_failure"):i.allow_failure,i.actionType===vl.IActionType.RUN&&(yield this.run(i)),i.actionType===vl.IActionType.PLUGIN&&(yield this.plugin(i)),i.actionType===vl.IActionType.COMPONENT&&i.level===vl.IActionLevel.PROJECT&&(yield this.component(i));return this.logger.debug(`The ${t}-action successfully to execute in ${this.record.label}`),this.option.hookLevel===vl.IActionLevel.GLOBAL&&this.logger.write(`${HL.default.green("\u2714")} ${HL.default.gray(`${vl.IActionLevel.GLOBAL} ${t}-action completed (${(0,tD.getProcessTime)(this.record.startTime)})`)}`),this.record})}onFinish(t){return new Promise((r,n)=>{let u=[],i=[];t.stdout.on("data",o=>{this.logger.append(o.toString()),u.push(o)}),t.stderr.on("data",o=>{this.logger.append(o.toString()),i.push(o)}),t.on("exit",o=>{o===0?r({}):n(new Error(Buffer.concat(i).toString()))})})}run(t){return VL(this,void 0,void 0,function*(){if(oHt.default.existsSync(t.path)&&oHt.default.lstatSync(t.path).isDirectory()){try{let n=(0,jiu.spawn)(t.value,{cwd:t.path,shell:!0});yield this.onFinish(n)}catch(n){let u=n;if(iHt.isWindow()&&(LTe("Command run execution environment\uFF1ACMD"),LTe("Please check whether the actions section of yaml can be executed in the current environment.")),(0,tD.getAllowFailure)(this.record.allowFailure,{exitCode:pm.EXIT_CODE.RUN,command:this.record.command}))return;throw new b1.DevsError(u.message,{data:(0,fm.get)(n,"data"),stack:u.stack,exitCode:pm.EXIT_CODE.RUN,prefix:`${this.record.label} ${t.hookType}-action failed to [${this.record.command}]:`,trackerType:b1.ETrackerType.runtimeException})}return}if(!(0,tD.getAllowFailure)(this.record.allowFailure,{exitCode:pm.EXIT_CODE.DEVS,command:this.record.command}))throw new b1.DevsError(`The ${t.path} directory does not exist.`,{exitCode:pm.EXIT_CODE.DEVS,prefix:`${this.record.label} ${t.hookType}-action failed to [${this.record.command}]:`,trackerType:b1.ETrackerType.parseException})})}plugin(t){return VL(this,void 0,void 0,function*(){try{let r=yield(0,sHt.default)(t.value),n=(0,fm.isEmpty)(this.record.pluginOutput)?this.inputs:this.record.pluginOutput;this.record.pluginOutput=yield r(n,t.args,this.logger)}catch(r){let n=r;if((0,tD.getAllowFailure)(this.record.allowFailure,{exitCode:pm.EXIT_CODE.PLUGIN,command:this.record.command}))return;throw new b1.DevsError(n.message,{data:(0,fm.get)(r,"data"),stack:n.stack,exitCode:pm.EXIT_CODE.PLUGIN,prefix:`${this.record.label} ${t.hookType}-action failed to [${this.record.command}]:`,trackerType:b1.ETrackerType.runtimeException})}})}component(t){return VL(this,void 0,void 0,function*(){let r=(0,Liu.default)(t.value),{_:n}=iHt.parseArgv(r),[u,i]=n,o=yield(0,sHt.default)(u,{logger:this.logger,cleanCache:!0});if(o[i]){let a=Object.assign(Object.assign({},this.record.componentProps),{args:(0,fm.filter)(r.slice(2),c=>!(0,fm.includes)([u,i],c))});try{return yield o[i](a)}catch(c){let l=c;if((0,tD.getAllowFailure)(this.record.allowFailure,{exitCode:pm.EXIT_CODE.COMPONENT,command:this.record.command}))return;throw new b1.DevsError(l.message,{data:(0,fm.get)(c,"data"),stack:l.stack,exitCode:pm.EXIT_CODE.COMPONENT,prefix:`${this.record.label} ${t.hookType}-action failed to [${this.record.command}]:`,trackerType:b1.ETrackerType.runtimeException})}}if(!(0,tD.getAllowFailure)(this.record.allowFailure,{exitCode:pm.EXIT_CODE.DEVS,command:this.record.command}))throw new b1.DevsError(`The [${i}] command was not found.`,{exitCode:pm.EXIT_CODE.DEVS,prefix:`${this.record.label} ${t.hookType}-action failed to [${this.record.command}]:`,tips:`Please check the component ${u} has the ${i} command. Serverless Devs documents\uFF1A${HL.default.underline("https://manual.serverless-devs.com/")}`,trackerType:b1.ETrackerType.parseException})})}};lp.default=NTe});var gHt=I(Ro=>{"use strict";var mHt=Ro&&Ro.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var u=Object.getOwnPropertyDescriptor(t,r);(!u||("get"in u?!t.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,u)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Niu=Ro&&Ro.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),qiu=Ro&&Ro.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&mHt(t,e,r);return Niu(t,e),t},Miu=Ro&&Ro.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&mHt(t,e,r)},Dc=Ro&&Ro.__awaiter||function(e,t,r,n){function u(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function s(l){try{c(n.next(l))}catch(f){o(f)}}function a(l){try{c(n.throw(l))}catch(f){o(f)}}function c(l){l.done?i(l.value):u(l.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},rD=Ro&&Ro.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.init=Ro.preview=Ro.verify=void 0;var cHt=cNt(),br=ir(),qu=eBe(),hm=rie(),fp=qiu(ch()),lHt=rD(require("path")),Pg=rD(ITe()),fHt=rD(aHt()),Uiu=rD(Ml()),pHt=rD(J5()),hHt=rD(W7e()),Dl=xr(),dm=jTe(),dHt=rD(require("assert")),$iu=rD(Jj());Miu(eBe(),Ro);var MTe=rie();Object.defineProperty(Ro,"verify",{enumerable:!0,get:function(){return MTe.verify}});Object.defineProperty(Ro,"preview",{enumerable:!0,get:function(){return MTe.preview}});Object.defineProperty(Ro,"init",{enumerable:!0,get:function(){return MTe.init}});var mm=(0,Dl.isDevsDebugMode)()?Rd()("serverless-devs:engine"):e=>{},qTe=class{constructor(t){this.options=t,this.context={status:qu.STEP_STATUS.PENDING,completed:!1,error:[]},this.record={status:qu.STEP_STATUS.PENDING,editStatusAble:!0},this.spec={},this.info={},mm("engine start"),this.options.args=(0,br.get)(this.options,"args",process.argv.slice(2)),this.options.cwd=(0,br.get)(this.options,"cwd",process.cwd()),this.options.template=(0,Dl.getAbsolutePath)((0,br.get)(this.options,"template"),this.options.cwd),mm(`engine options: ${(0,hm.stringify)(t)}`)}beforeStart(){return Dc(this,void 0,void 0,function*(){this.glog=this.getLogger(),this.logger=this.glog.__generate("engine"),this.parseSpecInstance=new fp.default((0,br.get)(this.options,"template"),{argv:this.options.args,logger:this.logger}),this.spec=yield this.parseSpecInstance.start(),(0,br.each)(this.options.env,(n,u)=>{process.env[u]=n});let{steps:t,allSteps:r}=this.spec;yield this.validate(),this.context.steps=yield this.download(t),this.context.allSteps=r?yield this.download(r):[]})}start(){return Dc(this,void 0,void 0,function*(){this.context.status=qu.STEP_STATUS.RUNNING,this.record.status=qu.STEP_STATUS.RUNNING;try{yield this.beforeStart()}catch(s){return this.context.status=qu.STEP_STATUS.FAILURE,this.context.completed=!0,this.context.error.push(s),this.context}let{steps:t,yaml:r,command:n,access:u=r.access}=this.spec;this.logger.write(Pg.default.gray(`${(0,Dl.emoji)("\u231B")} Steps for [${n}] of [${(0,br.get)(this.spec,"yaml.appName")}]
|
|
1018
|
+
${Pg.default.gray("====================")}`)),this.globalActionInstance=new fHt.default(r.actions,{hookLevel:fp.IActionLevel.GLOBAL,logger:this.logger,skipActions:this.spec.skipActions});let i=yield(0,hm.getCredential)(u,this.logger);this.context.credential=i;try{this.globalActionInstance.setValue("magic",yield this.getFilterContext()),this.globalActionInstance.setValue("command",n),yield this.globalActionInstance.start(fp.IHookType.PRE,{access:u,credential:i})}catch(s){return this.context.error.push(s),this.context.status=qu.STEP_STATUS.FAILURE,yield this.doCompleted(),this.context}this.context.steps=(0,br.map)(this.context.steps,s=>Object.assign(Object.assign({},s),{stepCount:(0,br.uniqueId)(),status:qu.STEP_STATUS.PENDING,done:!1})),this.context.allSteps=(0,br.map)(this.context.allSteps,s=>Object.assign(Object.assign({},s),{stepCount:(0,br.uniqueId)(),status:qu.STEP_STATUS.PENDING,done:!1}));let o=yield new Promise(s=>Dc(this,void 0,void 0,function*(){let a={init:{on:{INIT:this.context.steps.length===0?"final":(0,br.get)(this.context.steps,"[0].stepCount")}},final:{type:"final",invoke:{src:()=>Dc(this,void 0,void 0,function*(){let f=this.record.status===qu.STEP_STATUS.ERROR_WITH_CONTINUE?qu.STEP_STATUS.SUCCESS:this.record.status;this.context.status=f,yield this.doCompleted(),this.context.steps=(0,br.map)(this.context.steps,p=>(0,br.omit)(p,["instance"])),this.context.output=this.getOutput(),mm(`context: ${(0,hm.stringify)(this.context)}`),mm("engine end"),s(this.context)})}}};(0,br.each)(this.context.steps,(f,p)=>{let h=this.context.steps[p+1]?(0,br.get)(this.context.steps,`[${p+1}].stepCount`):"final",d=r.useFlow?(0,br.filter)(this.context.steps,m=>m.flowId===f.flowId):[f];a[f.stepCount]={invoke:{id:f.stepCount,src:()=>Dc(this,void 0,void 0,function*(){if(!f.done)return this.record.startTime=Date.now(),this.recordContext(f,{status:qu.STEP_STATUS.RUNNING}),this.record.status===qu.STEP_STATUS.FAILURE?yield Promise.all((0,br.map)(d,m=>this.doSkip(m))):yield Promise.all((0,br.map)(d,m=>this.handleSrc(m)))}),onDone:{target:h},onError:h}}});let c=(0,cHt.createMachine)({predictableActionArguments:!0,id:"step",initial:"init",states:a});(0,cHt.interpret)(c).onTransition(f=>f.value).start().send("INIT")}));return this.glog.__clear(),o})}getOutput(){let t={};return(0,br.each)(this.context.steps,r=>{(0,br.isNil)(r.output)||(0,br.set)(t,r.projectName,r.output)}),t}validate(){return Dc(this,void 0,void 0,function*(){let{steps:t,command:r,projectName:n}=this.spec,u=[],i=new $iu.default({allErrors:!0});(0,dHt.default)(!(0,br.isEmpty)(t),"Step is required");for(let o of t){let s=yield(0,pHt.default)(o.component,{logger:this.logger,engineLogger:this.logger});if(n&&(0,br.keys)((0,br.get)(s,"commands")).includes(n))throw new Dl.DevsError(`The name of the project [${n}] overlaps with a command, please change it's name.`,{exitCode:dm.EXIT_CODE.DEVS,trackerType:Dl.ETrackerType.parseException,prefix:`[${n}] failed to [${r}]:`});if((0,br.get)(this.spec,"yaml.use3x")&&(0,br.get)(this.spec,"yaml.content.validation")){let a=yield this.getSchemaByInstance(s);if((0,br.isEmpty)(a))continue;let c=i.compile(JSON.parse(a));if(!c(o.props)){let l=c.errors;if(!l)continue;for(let f of l)f.instancePath=o.projectName+"/props"+f.instancePath,f.keyword==="enum"&&(f.message=f.message+": "+f.params.allowedValues.join(", "));u=u.concat(l)}}}if((0,dHt.default)(r,"Command is required"),!(0,br.isEmpty)(u))throw new Dl.DevsError(`${i.errorsText(u,{dataVar:"",separator:`
|
|
1019
|
+
`})}`,{exitCode:dm.EXIT_CODE.DEVS,trackerType:Dl.ETrackerType.parseException,prefix:"Function props validation error:"})})}getSchemaByInstance(t){return!t||!t.getSchema?null:t.getSchema()}download(t){return Dc(this,void 0,void 0,function*(){let{command:r}=this.spec,n=[];for(let u of t){let i=this.glog.__generate(u.projectName),o=yield(0,pHt.default)(u.component,{logger:i,engineLogger:this.logger}),s=(0,br.get)(o,`commands.${r}.verify`);n.push(Object.assign(Object.assign({},u),{instance:o,logger:i,verify:(0,br.isUndefined)(s)?!0:s}))}return n})}getLogger(){let t=(0,br.get)(this.options,"logConfig.customLogger");if(t){if(mm("use custom logger"),(t==null?void 0:t.CODE)===hHt.default.CODE)return t;throw new Error("customLogger must be instance of Logger")}return new hHt.default(Object.assign(Object.assign({traceId:(0,Dl.traceid)(),logDir:lHt.default.join((0,Dl.getRootHome)(),"logs")},this.options.logConfig),{level:(0,br.get)(this.options,"logConfig.level",this.spec.debug?"DEBUG":void 0)}))}recordContext(t,r={}){let{status:n,error:u,output:i,process_time:o,props:s,done:a}=r;this.context.stepCount=t.stepCount,this.context.steps=(0,br.map)(this.context.steps,c=>(c.stepCount===t.stepCount&&(n&&(c.status=n),u&&(c.error=u,this.context.error.push(u)),s&&(c.props=s),i&&(c.output=i),a&&(c.done=a),(0,br.has)(r,"process_time")&&(c.process_time=o)),c))}getInfo(t){return Dc(this,void 0,void 0,function*(){if(!t)return;let{props:r}=t,n=JSON.stringify(r),u=n.matchAll(dm.INFO_EXP_PATTERN),i=new Set;for(let a of u)a[1]&&i.add(a[1]);let o=n.matchAll(dm.COMPONENT_EXP_PATTERN);for(let a of o)a[1]&&i.add(a[1]);if((0,br.isEmpty)(i))return;let s=(0,br.map)(Array.from(i),a=>this.context.allSteps.find(c=>c.projectName===a));yield Promise.all((0,br.map)(s,a=>Dc(this,void 0,void 0,function*(){if(!a)return;let c=(0,br.get)(this.info,a.projectName);if(!c||(0,br.isEmpty)(c)||(0,br.isNil)(c)){this.logger.write(`${Pg.default.gray(`execute info command of [${a.projectName}]...`)}`);let l=(0,br.cloneDeep)(this.spec);l.command="info";let f=yield this.doSrc(a,{},l);(0,br.set)(this.info,a.projectName,f),this.logger.write(`${Pg.default.gray(`[${a.projectName}] info command executed.`)}`)}})))})}getFilterContext(t){return Dc(this,void 0,void 0,function*(){yield this.getInfo(t);let r={cwd:lHt.default.dirname(this.spec.yaml.path),vars:this.spec.yaml.vars,resources:{},components:{},__runtime:this.options.verify?"engine":"parse",__steps:this.context.steps};for(let n of this.context.allSteps){let u=(0,br.find)(this.context.steps,i=>i.projectName===n.projectName);r.resources[n.projectName]={output:n.output||(0,br.get)(u,"output")||{},props:n.props||(0,br.get)(u,"props")||{},info:this.info[n.projectName]||{},vars:n.vars||(0,br.get)(u,"vars")||{}},r.components[n.projectName]={output:this.info[n.projectName]||{}}}return t&&(r.credential=t.credential,r.that={name:t.projectName,access:t.access,component:t.component,props:r.resources[t.projectName].props,output:r.resources[t.projectName].output,vars:r.resources[t.projectName].vars}),r})}doCompleted(){return Dc(this,void 0,void 0,function*(){if(this.context.completed=!0,this.context.status===qu.STEP_STATUS.FAILURE)try{yield this.globalActionInstance.start(fp.IHookType.FAIL,this.context)}catch(t){this.context.status=qu.STEP_STATUS.FAILURE,this.context.error.push(t)}if(this.context.status===qu.STEP_STATUS.SUCCESS)try{yield this.globalActionInstance.start(fp.IHookType.SUCCESS,this.context)}catch(t){this.context.status=qu.STEP_STATUS.FAILURE,this.context.error.push(t)}try{yield this.globalActionInstance.start(fp.IHookType.COMPLETE,this.context)}catch(t){this.context.status=qu.STEP_STATUS.FAILURE,this.context.error.push(t)}})}handleSrc(t){var r,n,u;return Dc(this,void 0,void 0,function*(){let{command:i}=this.spec;try{yield this.handleAfterSrc(t)}catch{try{let a=yield(r=this.actionInstance)===null||r===void 0?void 0:r.start(fp.IHookType.FAIL,this.record.componentProps);this.recordContext(t,(0,br.get)(a,"pluginOutput",{}))}catch(a){this.record.status=qu.STEP_STATUS.FAILURE,this.recordContext(t,{error:a})}}if(this.record.status===qu.STEP_STATUS.SUCCESS)try{this.actionInstance.setValue("magic",yield this.getFilterContext(t));let s=yield(n=this.actionInstance)===null||n===void 0?void 0:n.start(fp.IHookType.SUCCESS,Object.assign(Object.assign({},this.record.componentProps),{output:(0,br.get)(t,"output",{})}));this.recordContext(t,(0,br.get)(s,"pluginOutput",{}))}catch(s){this.record.status=qu.STEP_STATUS.FAILURE,this.recordContext(t,{error:s})}try{let s=yield(u=this.actionInstance)===null||u===void 0?void 0:u.start(fp.IHookType.COMPLETE,Object.assign(Object.assign({},this.record.componentProps),{output:(0,br.get)(t,"output",{})}));this.recordContext(t,(0,br.get)(s,"pluginOutput",{}))}catch(s){this.record.status=qu.STEP_STATUS.FAILURE,this.recordContext(t,{error:s})}let o=(0,hm.getProcessTime)(this.record.startTime);this.recordContext(t,{done:!0,process_time:o}),this.record.status===qu.STEP_STATUS.SUCCESS&&this.logger.write(`${Pg.default.green("\u2714")} ${Pg.default.gray(`[${t.projectName}] completed (${o}s)`)}`),this.record.status===qu.STEP_STATUS.FAILURE&&this.logger.write(`${Pg.default.red("\u2716")} ${Pg.default.gray(`[${t.projectName}] failed to [${i}] (${o}s)`)}`),this.glog.__unset(t.projectName)})}handleAfterSrc(t){var r;return Dc(this,void 0,void 0,function*(){try{mm(`project item: ${(0,hm.stringify)(t)}`);let{command:n}=this.spec;t.credential=yield(0,hm.getCredential)(t.access,this.logger);let{AccessKeyID:u,AccessKeySecret:i}=t.credential;this.glog.__setSecret([u,i]);let o=this.parseSpecInstance.parseActions(t.actions,fp.IActionLevel.PROJECT);mm(`project actions: ${JSON.stringify(o)}`),this.actionInstance=new fHt.default(o,{hookLevel:fp.IActionLevel.PROJECT,projectName:t.projectName,logger:t.logger,skipActions:this.spec.skipActions}),this.actionInstance.setValue("magic",yield this.getFilterContext(t)),this.actionInstance.setValue("step",t),this.actionInstance.setValue("command",n);let s=yield this.getProps(t);this.actionInstance.setValue("componentProps",s);let a=yield(r=this.actionInstance)===null||r===void 0?void 0:r.start(fp.IHookType.PRE,s),c=yield this.doSrc(t,a);this.record.editStatusAble&&(this.record.status=qu.STEP_STATUS.SUCCESS),t.id&&(this.record.steps=Object.assign(Object.assign({},this.record.steps),{[t.id]:{status:qu.STEP_STATUS.SUCCESS,output:c}})),this.recordContext(t,{status:qu.STEP_STATUS.SUCCESS,output:c})}catch(n){let u=n,i=t["continue-on-error"]===!0?qu.STEP_STATUS.ERROR_WITH_CONTINUE:qu.STEP_STATUS.FAILURE;if(this.record.editStatusAble&&(this.record.status=i),i===qu.STEP_STATUS.FAILURE&&(this.record.editStatusAble=!1),t.id&&(this.record.steps=Object.assign(Object.assign({},this.record.steps),{[t.id]:{status:i}})),t["continue-on-error"])this.recordContext(t,{status:i});else throw this.recordContext(t,{status:i,error:u}),u}})}getProps(t){return Dc(this,void 0,void 0,function*(){let r=yield this.getFilterContext(t);mm(`magic context: ${JSON.stringify(r)}`);let n=(0,fp.getInputs)(t.props,r),{projectName:u,command:i}=this.spec,o={cwd:this.options.cwd,userAgent:(0,Dl.getUserAgent)({component:t.instance.__info}),name:(0,br.get)(this.spec,"yaml.appName"),props:n,command:i,args:(0,br.filter)(this.options.args,s=>!(0,br.includes)([u,i],s)),yaml:{path:(0,br.get)(this.spec,"yaml.path")},resource:{name:t.projectName,component:t.component,access:t.access},outputs:this.getOutput(),getCredential:()=>Dc(this,void 0,void 0,function*(){let s=yield new Uiu.default({logger:this.logger}).get(t.access);return(0,br.get)(s,"credential",{})})};return this.recordContext(t,{props:n}),mm(`get props: ${JSON.stringify(o)}`),o})}doSrc(t,r={},n=this.spec){return Dc(this,void 0,void 0,function*(){let{command:u="",projectName:i,yaml:o}=n,s=yield this.getProps(t),a=o.useFlow?(0,br.filter)(this.context.steps,c=>c.flowId===t.flowId):[t];if((0,br.size)(a)>1&&s.args.push("-y"),this.record.componentProps=(0,br.isEmpty)(r.pluginOutput)?s:r.pluginOutput,mm(`component props: ${(0,hm.stringify)(this.record.componentProps)}`),this.actionInstance.setValue("componentProps",this.record.componentProps),i){if((0,br.isFunction)(t.instance[u]))try{return yield t.instance[u](this.record.componentProps)}catch(l){if((0,hm.getAllowFailure)(t.allow_failure,{exitCode:dm.EXIT_CODE.COMPONENT,command:u}))return;let p=l;throw new Dl.DevsError(p.message,{data:(0,br.get)(l,"data"),stack:p.stack,exitCode:dm.EXIT_CODE.COMPONENT,prefix:`[${t.projectName}] failed to [${u}]:`,trackerType:Dl.ETrackerType.runtimeException})}if((0,hm.getAllowFailure)(t.allow_failure,{exitCode:dm.EXIT_CODE.DEVS,command:u}))return;throw new Dl.DevsError(`The [${u}] command was not found.`,{exitCode:dm.EXIT_CODE.DEVS,tips:`Please check the component ${t.component} has the ${u} command. Serverless Devs documents\uFF1A${Pg.default.underline("https://manual.serverless-devs.com/")}`,prefix:`[${t.projectName}] failed to [${u}]:`,trackerType:Dl.ETrackerType.parseException})}if((0,br.isFunction)(t.instance[u]))try{return yield t.instance[u](this.record.componentProps)}catch(c){if((0,hm.getAllowFailure)(t.allow_failure,{exitCode:dm.EXIT_CODE.COMPONENT,command:u}))return;let f=c;throw new Dl.DevsError(f.message,{data:(0,br.get)(c,"data"),stack:f.stack,exitCode:dm.EXIT_CODE.COMPONENT,prefix:`[${t.projectName}] failed to [${u}]:`,trackerType:Dl.ETrackerType.runtimeException})}this.logger.tips(`The [${u}] command was not found.`,`Please check the component ${t.component} has the ${u} command. Serverless Devs documents\uFF1Ahttps://manual.serverless-devs.com/`)})}doSkip(t){return Dc(this,void 0,void 0,function*(){return t.id&&(this.record.steps=Object.assign(Object.assign({},this.record.steps),{[t.id]:{status:qu.STEP_STATUS.SKIP}})),this.recordContext(t,{status:qu.STEP_STATUS.SKIP,process_time:0}),Promise.resolve()})}};Ro.default=qTe});var zTe={};on(zTe,{default:()=>Giu});var gm,lie,vm,Io,UTe,vHt,$Te,DHt,ziu,Giu,GTe=Ft(()=>{gm=ot(jre()),lie=ot(require("path")),vm=ot(xr()),Io=ot(ir());pr();pn();UTe=ot(xr()),vHt=ot(jre());LA();Z8();tv();$Te=class{constructor(t,r={}){this.program=t;this.spec=r}async init(){let t=process.argv.slice(2),{_:r,help:n}=(0,UTe.parseArgv)(t);if(r.length===0&&n)return await this.showSimpleHelp();if(r.length===1&&(this.customProgram=this.program.command(r[0]).allowUnknownOption(),n))return await this.showHelp();if(r.length>1&&(this.customProgram=this.program.command(r[0]).allowUnknownOption(),n))return await this.showComflexHelp();this.customProgram.action(async()=>{await this.doExecCommand()})}async doExecCommand(){let t=process.argv.slice(2),{template:r,help:n,access:u,debug:i,output:o,...s}=(0,UTe.parseArgv)(t),a=await this.getReportComponent(),c={uid:await L3(u),argv:t,command:this.spec.command,component:a,userAgent:(0,vm.getUserAgent)({component:a})};try{let l=await vHt.execCommand({syaml:r,serverName:this.spec.projectName,method:this.spec.command,args:process.argv.slice(2),globalArgs:{access:u,skipActions:s["skip-actions"],debug:i,help:n,output:o||s["output-format"]},env:{serverless_devs_temp_argv:JSON.stringify(process.argv.slice(2))}});Jf(l),il("report.js",{...c,type:"command"})}catch(l){Vd(new vm.DevsError(l.message,{stack:l.stack,trackerType:vm.ETrackerType.runtimeException}),c)}}async getReportComponent(){let t=[],r=(0,Io.get)(this.spec,"components");for(let n of r){if((0,Io.isEmpty)(n))continue;let u=await(0,gm.loadComponent)(n),i=(0,vm.getYamlContent)(lie.default.join(u.__path,"publish.yaml")),o=(0,Io.get)(i,"Version");t.push(o?`${(0,Io.get)(i,"Name")}@${o}`:n)}return(0,Io.join)(t,",")}async showSimpleHelp(){let{steps:t,components:r}=this.spec;if((0,Io.isEmpty)(t))return;let n=["Custom Commands"," Can be used in projects with Serverless Devs Yaml. Usage\uFF1A"," - s <component_command>\uFF1AOperate on the project, E.x: s deploy"," - s <project_name> <component_command>\uFF1AOperate on the resource, E.x: s website deploy"," More information: https://docs.serverless-devs.com/user-guide/builtin/custom/"];if(r.length===1)return(await DHt((0,Io.first)(r))).join(`
|
|
1020
1020
|
`);let u={};return(0,Io.each)(t,i=>{u[`${i.projectName} [options]`]=`Please use [s ${i.projectName} -h] obtain the documentation.`}),n.push(gm.publishHelp.helpInfo(u,"",27)),n.join(`
|
|
1021
1021
|
`)}async showHelp(){var n;let{projectName:t,steps:r}=this.spec;if(this.customProgram.helpInformation=()=>"",t){let u=(n=(0,Io.find)(r,o=>o.projectName===t))==null?void 0:n.component,i=await ziu(u);return this.customProgram.helpInformation=()=>i}return await this.doExecCommand()}async showComflexHelp(){return this.customProgram.helpInformation=()=>"",await this.doExecCommand()}},DHt=async e=>{let t=[],r=await(0,gm.loadComponent)(e),n=lie.default.join(r.__path,"publish.yaml"),i=(0,vm.getYamlContent)(n).Commands;if(i)for(let a in i)t.push({[a]:i[a]});let o=(0,Io.isPlainObject)((0,Io.first)((0,Io.values)((0,Io.get)(t,"[0]")))),s=[];if(o){s.push(dt.underline(dt.bold(`Custom Commands
|
|
1022
1022
|
|