fter:r,rest:i}=this.sections(),{cursor:n,initial:s="",input:o="",value:a=""}=this,l=this.state.size=i.length,c={after:r,cursor:n,initial:s,input:o,prompt:e,size:l,value:a},u=Eu.cursor.restore(c);u&&this.stdout.write(u)}sections(){let{buffer:e,input:r,prompt:i}=this.state;i=ene.unstyle(i);let n=ene.unstyle(e),s=n.indexOf(i),o=n.slice(0,s),l=n.slice(s).split(`
`),c=l[0],u=l[l.length-1],f=(i+(r?" "+r:"")).length,h=f<c.length?c.slice(f+1):"";return{header:o,prompt:c,after:h,rest:l.slice(1),last:u}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let e=this.state.error||await this.validate(this.value,this.state);if(e!==!0){let r=`
`+this.symbols.pointer+" ";typeof e=="string"?r+=e.trim():r+="Invalid input",this.state.error=`
`+this.styles.danger(r),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),r=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(Eu.cursor.down(e.rest.length)),this.write(`
`.repeat(r))}catch(e){}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=EN.listen(this,this.keypress.bind(this)),this.once("close",this.stop))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip=="function"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:e,options:r,result:i}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>i.call(this,this.value),typeof r.initial=="function"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun=="function"&&await r.onRun.call(this,this),typeof r.onSubmit=="function"){let n=r.onSubmit.bind(this),s=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await n(this.name,this.value,this),s())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(e,r)=>{if(this.once("submit",e),this.once("cancel",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,r,i){let{options:n,state:s,symbols:o,timers:a}=this,l=a&&a[e];s.timer=l;let c=n[e]||s[e]||o[e],u=r&&r[e]!=null?r[e]:await c;if(u==="")return u;let g=await this.resolve(u,s,r,i);return!g&&r&&r[e]?this.resolve(c,s,r,i):g}async prefix(){let e=await this.element("prefix")||this.symbols,r=this.timers&&this.timers.prefix,i=this.state;return i.timer=r,Tn.isObject(e)&&(e=e[i.status]||e.pending),Tn.hasColor(e)?e:(this.styles[i.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return Tn.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,r=this.timers&&this.timers.separator,i=this.state;i.timer=r;let n=e[i.status]||e.pending||i.separator,s=await this.resolve(n,i);return Tn.isObject(s)&&(s=s[i.status]||s.pending),Tn.hasColor(s)?s:this.styles.muted(s)}async pointer(e,r){let i=await this.element("pointer",e,r);if(typeof i=="string"&&Tn.hasColor(i))return i;if(i){let n=this.styles,s=this.index===r,o=s?n.primary:c=>c,a=await this.resolve(i[s?"on":"off"]||i,this.state),l=Tn.hasColor(a)?a:o(a);return s?l:" ".repeat(a.length)}}async indicator(e,r){let i=await this.element("indicator",e,r);if(typeof i=="string"&&Tn.hasColor(i))return i;if(i){let n=this.styles,s=e.enabled===!0,o=s?n.success:n.dark,a=i[s?"on":"off"]||i;return Tn.hasColor(a)?a:o(a)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");return Tn.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?"":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==""}resolve(e,...r){return Tn.resolve(this,e,...r)}get base(){return V0.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||Tn.height(this.stdout,25)}get width(){return this.options.columns||Tn.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:r}=this.state,i=[r,e].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return e=>new this(e).run()}};function Dqe(t){let e=n=>t[n]===void 0||typeof t[n]=="function",r=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],i=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let n of Object.keys(t.options)){if(r.includes(n)||/^on[A-Z]/.test(n))continue;let s=t.options[n];typeof s=="function"&&e(n)?i.includes(n)||(t[n]=s.bind(t)):typeof t[n]!="function"&&(t[n]=s)}}function Rqe(t){typeof t=="number"&&(t=[t,t,t,t]);let e=[].concat(t||[]),r=n=>n%2==0?`
`:" ",i=[];for(let n=0;n<4;n++){let s=r(n);e[n]?i.push(s.repeat(e[n])):i.push("")}return i}$ie.exports=V0});var ine=w((Lpt,tne)=>{"use strict";var Fqe=Xi(),rne={default(t,e){return e},checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||"",e},input(t,e){throw new Error("input role is not implemented yet")},option(t,e){return rne.default(t,e)},radio(t,e){throw new Error("radio role is not implemented yet")},separator(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||t.symbols.line.repeat(5),e},spacer(t,e){return e}};tne.exports=(t,e={})=>{let r=Fqe.merge({},rne,e.roles);return r[t]||r.default}});var ZC=w((Tpt,nne)=>{"use strict";var Nqe=mo(),Lqe=Vf(),Tqe=ine(),X0=Xi(),{reorder:IN,scrollUp:Oqe,scrollDown:Mqe,isObject:sne,swap:Kqe}=X0,one=class extends Lqe{constructor(e){super(e);this.cursorHide(),this.maxSelected=e.maxSelected||Infinity,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:r,autofocus:i,suggest:n}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(s=>s.enabled=!1),typeof n!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");sne(r)&&(r=Object.keys(r)),Array.isArray(r)?(i!=null&&(this.index=this.findIndex(i)),r.forEach(s=>this.enable(this.find(s))),await this.render()):(i!=null&&(r=i),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){this.state.loadingChoices=!0;let i=[],n=0,s=async(o,a)=>{typeof o=="function"&&(o=await o.call(this)),o instanceof Promise&&(o=await o);for(let l=0;l<o.length;l++){let c=o[l]=await this.toChoice(o[l],n++,a);i.push(c),c.choices&&await s(c.choices,c)}return i};return s(e,r).then(o=>(this.state.loadingChoices=!1,o))}async toChoice(e,r,i){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let n=e.value;if(e=Tqe(e.role,this.options)(this,e),typeof e.disabled=="string"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint="(disabled)"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||"",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input="",e.index=r,e.cursor=0,X0.define(e,"parent",i),e.level=i?i.level+1:1,e.indent==null&&(e.indent=i?i.indent+"  ":e.indent||""),e.path=i?i.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,Nqe.unstyle(e.message).length));let o=N({},e);return e.reset=(a=o.input,l=o.value)=>{for(let c of Object.keys(o))e[c]=o[c];e.input=a,e.value=l},n==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,r)),e}async onChoice(e,r){this.emit("choice",e,r,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,r)}async addChoice(e,r,i){let n=await this.toChoice(e,r,i);return this.choices.push(n),this.index=this.choices.length-1,this.limit=this.choices.length,n}async newItem(e,r,i){let n=N({name:"New choice name?",editable:!0,newChoice:!0},e),s=await this.addChoice(n,r,i);return s.updateChoice=()=>{delete s.newChoice,s.name=s.message=s.input,s.input="",s.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?"  ".repeat(e.level-1):"":e.indent}dispatch(e,r){if(this.multiple&&this[r.name])return this[r.name]();this.alert()}focus(e,r){return typeof r!="boolean"&&(r=e.enabled),r&&!e.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=e.index,e.enabled=r&&!this.isDisabled(e),e)}space(){return this.multiple?(this.toggle(this.focused),this.render()):this.alert()}a(){if(this.maxSelected<this.choices.length)return this.alert();let e=this.selectable.every(r=>r.enabled);return this.choices.forEach(r=>r.enabled=!e),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach(e=>e.enabled=!e.enabled),this.render())}g(e=this.focused){return this.choices.some(r=>!!r.parent)?(this.toggle(e.parent&&!e.choices?e.parent:e),this.render()):this.a()}toggle(e,r){if(!e.enabled&&this.selected.length>=this.maxSelected)return this.alert();typeof r!="boolean"&&(r=!e.enabled),e.enabled=r,e.choices&&e.choices.forEach(n=>this.toggle(n,r));let i=e.parent;for(;i;){let n=i.choices.filter(s=>this.isDisabled(s));i.enabled=n.every(s=>s.enabled===!0),i=i.parent}return ane(this,this.choices),this.emit("toggle",e,this),e}enable(e){return this.selected.length>=this.maxSelected?this.alert():(e.enabled=!this.isDisabled(e),e.choices&&e.choices.forEach(this.enable.bind(this)),e)}disable(e){return e.enabled=!1,e.choices&&e.choices.forEach(this.disable.bind(this)),e}number(e){this.num+=e;let r=i=>{let n=Number(i);if(n>this.choices.length-1)return this.alert();let s=this.focused,o=this.choices.find(a=>n===a.index);if(!o.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(this.visible.indexOf(o)===-1){let a=IN(this.choices),l=a.indexOf(o);if(s.index>l){let c=a.slice(l,l+this.limit),u=a.filter(g=>!c.includes(g));this.choices=c.concat(u)}else{let c=l-this.limit+1;this.choices=a.slice(c).concat(a.slice(0,c))}}return this.index=this.choices.indexOf(o),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise(i=>{let n=this.choices.length,s=this.num,o=(a=!1,l)=>{clearTimeout(this.numberTimeout),a&&(l=r(s)),this.num="",i(l)};if(s==="0"||s.length===1&&Number(s+"0")>n)return o(!0);if(Number(s)>n)return o(!1,this.alert());this.numberTimeout=setTimeout(()=>o(!0),this.delay)})}home(){return this.choices=IN(this.choices),this.index=0,this.render()}end(){let e=this.choices.length-this.limit,r=IN(this.choices);return this.choices=r.slice(e).concat(r.slice(0,e)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let e=this.choices.length,r=this.visible.length,i=this.index;return this.options.scroll===!1&&i===0?this.alert():e>r&&i===0?this.scrollUp():(this.index=(i-1%e+e)%e,this.isDisabled()?this.up():this.render())}down(){let e=this.choices.length,r=this.visible.length,i=this.index;return this.options.scroll===!1&&i===r-1?this.alert():e>r&&i===r-1?this.scrollDown():(this.index=(i+1)%e,this.isDisabled()?this.down():this.render())}scrollUp(e=0){return this.choices=Oqe(this.choices),this.index=e,this.isDisabled()?this.up():this.render()}scrollDown(e=this.visible.length-1){return this.choices=Mqe(this.choices),this.index=e,this.isDisabled()?this.down():this.render()}async shiftUp(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index-1),await this.up(),this.sorting=!1;return}return this.scrollUp(this.index)}async shiftDown(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index+1),await this.down(),this.sorting=!1;return}return this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(e){Kqe(this.choices,this.index,e)}isDisabled(e=this.focused){return e&&["disabled","collapsed","hidden","completing","readonly"].some(i=>e[i]===!0)?!0:e&&e.role==="heading"}isEnabled(e=this.focused){if(Array.isArray(e))return e.every(r=>this.isEnabled(r));if(e.choices){let r=e.choices.filter(i=>!this.isDisabled(i));return e.enabled&&r.every(i=>this.isEnabled(i))}return e.enabled&&!this.isDisabled(e)}isChoice(e,r){return e.name===r||e.index===Number(r)}isSelected(e){return Array.isArray(this.initial)?this.initial.some(r=>this.isChoice(e,r)):this.isChoice(e,this.initial)}map(e=[],r="value"){return[].concat(e||[]).reduce((i,n)=>(i[n]=this.find(n,r),i),{})}filter(e,r){let i=(a,l)=>[a.name,l].includes(e),n=typeof e=="function"?e:i,o=(this.options.multiple?this.state._choices:this.choices).filter(n);return r?o.map(a=>a[r]):o}find(e,r){if(sne(e))return r?e[r]:e;let i=(o,a)=>[o.name,a].includes(e),n=typeof e=="function"?e:i,s=this.choices.find(n);if(s)return r?s[r]:s}findIndex(e){return this.choices.indexOf(this.find(e))}async submit(){let e=this.focused;if(!e)return this.alert();if(e.newChoice)return e.input?(e.updateChoice(),this.render()):this.alert();if(this.choices.some(o=>o.newChoice))return this.alert();let{reorder:r,sort:i}=this.options,n=this.multiple===!0,s=this.selected;return s===void 0?this.alert():(Array.isArray(s)&&r!==!1&&i!==!0&&(s=X0.reorder(s)),this.value=n?s.map(o=>o.name):s.name,super.submit())}set choices(e=[]){this.state._choices=this.state._choices||[],this.state.choices=e;for(let r of e)this.state._choices.some(i=>i.name===r.name)||this.state._choices.push(r);if(!this._initial&&this.options.initial){this._initial=!0;let r=this.initial;if(typeof r=="string"||typeof r=="number"){let i=this.find(r);i&&(this.initial=i.index,this.focus(i,!0))}}}get choices(){return ane(this,this.state.choices||[])}set visible(e){this.state.visible=e}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(e){this.state.limit=e}get limit(){let{state:e,options:r,choices:i}=this,n=e.limit||this._limit||r.limit||i.length;return Math.min(n,this.height)}set value(e){super.value=e}get value(){return typeof super.value!="string"&&super.value===this.initial?this.input:super.value}set index(e){this.state.index=e}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let e=this.choices[this.index];return e&&this.state.submitted&&this.multiple!==!0&&(e.enabled=!0),e}get selectable(){return this.choices.filter(e=>!this.isDisabled(e))}get selected(){return this.multiple?this.enabled:this.focused}};function ane(t,e){if(e instanceof Promise)return e;if(typeof e=="function"){if(X0.isAsyncFn(e))return e;e=e.call(t,t)}for(let r of e){if(Array.isArray(r.choices)){let i=r.choices.filter(n=>!t.isDisabled(n));r.enabled=i.every(n=>n.enabled===!0)}t.isDisabled(r)===!0&&delete r.enabled}return e}nne.exports=one});var xl=w((Opt,Ane)=>{"use strict";var Uqe=ZC(),yN=Xi(),lne=class extends Uqe{constructor(e){super(e);this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}separator(){if(this.options.separator)return super.separator();let e=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():e}pointer(e,r){return!this.multiple||this.options.pointer?super.pointer(e,r):""}indicator(e,r){return this.multiple?super.indicator(e,r):""}choiceMessage(e,r){let i=this.resolve(e.message,this.state,e,r);return e.role==="heading"&&!yN.hasColor(i)&&(i=this.styles.strong(i)),this.resolve(i,this.state,e,r)}choiceSeparator(){return":"}async renderChoice(e,r){await this.onChoice(e,r);let i=this.index===r,n=await this.pointer(e,r),s=await this.indicator(e,r)+(e.pad||""),o=await this.resolve(e.hint,this.state,e,r);o&&!yN.hasColor(o)&&(o=this.styles.muted(o));let a=this.indent(e),l=await this.choiceMessage(e,r),c=()=>[this.margin[3],a+n+s,l,this.margin[1],o].filter(Boolean).join(" ");return e.role==="heading"?c():e.disabled?(yN.hasColor(l)||(l=this.styles.disabled(l)),c()):(i&&(l=this.styles.em(l)),c())}async renderChoices(){if(this.state.loading==="choices")return this.styles.warning("Loading choices");if(this.state.submitted)return"";let e=this.visible.map(async(s,o)=>await this.renderChoice(s,o)),r=await Promise.all(e);r.length||r.push(this.styles.danger("No matching choices"));let i=this.margin[0]+r.join(`
`),n;return this.options.choicesHeader&&(n=await this.resolve(this.options.choicesHeader,this.state)),[n,i].filter(Boolean).join(`
`)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:r}=this.state,i="",n=await this.header(),s=await this.prefix(),o=await this.separator(),a=await this.message();this.options.promptLine!==!1&&(i=[s,a,o,""].join(" "),this.state.prompt=i);let l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),g=await this.footer();l&&(i+=l),c&&!i.includes(c)&&(i+=" "+c),e&&!l&&!u.trim()&&this.multiple&&this.emptyError!=null&&(i+=this.styles.danger(this.emptyError)),this.clear(r),this.write([n,i,u,g].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};Ane.exports=lne});var gne=w((Mpt,cne)=>{"use strict";var Hqe=xl(),Gqe=(t,e)=>{let r=t.toLowerCase();return i=>{let s=i.toLowerCase().indexOf(r),o=e(i.slice(s,s+r.length));return s>=0?i.slice(0,s)+o+i.slice(s+r.length):i}},une=class extends Hqe{constructor(e){super(e);this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:r,input:i}=this.state;return this.input=i.slice(0,r)+e+i.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:r}=this.state;return r?(this.input=r.slice(0,e-1)+r.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:r}=this.state;return r[e]===void 0?this.alert():(this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,r=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,r);let i=e.toLowerCase();return r.filter(n=>n.message.toLowerCase().includes(i))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,r=Gqe(this.input,e),i=this.choices;this.choices=i.map(n=>ie(N({},n),{message:r(n.message)})),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};cne.exports=une});var BN=w((Kpt,fne)=>{"use strict";var wN=Xi();fne.exports=(t,e={})=>{t.cursorHide();let{input:r="",initial:i="",pos:n,showCursor:s=!0,color:o}=e,a=o||t.styles.placeholder,l=wN.inverse(t.styles.primary),c=m=>l(t.styles.black(m)),u=r,g=" ",f=c(g);if(t.blink&&t.blink.off===!0&&(c=m=>m,f=""),s&&n===0&&i===""&&r==="")return c(g);if(s&&n===0&&(r===i||r===""))return c(i[0])+a(i.slice(1));i=wN.isPrimitive(i)?`${i}`:"",r=wN.isPrimitive(r)?`${r}`:"";let h=i&&i.startsWith(r)&&i!==r,p=h?c(i[r.length]):f;if(n!==r.length&&s===!0&&(u=r.slice(0,n)+c(r[n])+r.slice(n+1),p=""),s===!1&&(p=""),h){let m=t.styles.unstyle(u+p);return u+p+a(i.slice(m.length))}return u+p}});var Z0=w((Upt,hne)=>{"use strict";var jqe=mo(),Yqe=xl(),qqe=BN(),pne=class extends Yqe{constructor(e){super(ie(N({},e),{multiple:!0}));this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(r=>r!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(r=>r.reset&&r.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let r=this.focused;if(!r)return this.alert();let{cursor:i,input:n}=r;return r.value=r.input=n.slice(0,i)+e+n.slice(i),r.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:r,input:i}=e;return e.value=e.input=i.slice(0,r-1)+i.slice(r),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:r,input:i}=e;if(i[r]===void 0)return this.alert();let n=`${i}`.slice(0,r)+`${i}`.slice(r+1);return e.value=e.input=n,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,r){return this.dispatch(e,r)}number(e,r){return this.dispatch(e,r)}next(){let e=this.focused;if(!e)return this.alert();let{initial:r,input:i}=e;return r&&r.startsWith(i)&&i!==r?(e.value=e.input=r,e.cursor=e.value.length,this.render()):super.next()}prev(){let e=this.focused;return e?e.cursor===0?super.prev():(e.value=e.input="",e.cursor=0,this.render()):this.alert()}separator(){return""}format(e){return this.state.submitted?"":super.format(e)}pointer(){return""}indicator(e){return e.input?"\u29BF":"\u2299"}async choiceSeparator(e,r){let i=await this.resolve(e.separator,this.state,e,r)||":";return i?" "+this.styles.disabled(i):""}async renderChoice(e,r){await this.onChoice(e,r);let{state:i,styles:n}=this,{cursor:s,initial:o="",name:a,hint:l,input:c=""}=e,{muted:u,submitted:g,primary:f,danger:h}=n,p=l,m=this.index===r,y=e.validate||(()=>!0),b=await this.choiceSeparator(e,r),S=e.message;this.align==="right"&&(S=S.padStart(this.longest+1," ")),this.align==="left"&&(S=S.padEnd(this.longest+1," "));let k=this.values[a]=c||o,T=c?"success":"dark";await y.call(e,k,this.state)!==!0&&(T="danger");let j=n[T](await this.indicator(e,r))+(e.pad||""),Z=this.indent(e),J=()=>[Z,j,S+b,c,p].filter(Boolean).join(" ");if(i.submitted)return S=jqe.unstyle(S),c=g(c),p="",J();if(e.format)c=await e.format.call(this,c,e,r);else{let re=this.styles.muted;c=qqe(this,{input:c,initial:o,pos:s,showCursor:m,color:re})}return this.isValue(c)||(c=this.styles.muted(this.symbols.ellipsis)),e.result&&(this.values[a]=await e.result.call(this,k,e,r)),m&&(S=f(S)),e.error?c+=(c?" ":"")+h(e.error.trim()):e.hint&&(c+=(c?" ":"")+u(e.hint.trim())),J()}async submit(){return this.value=this.values,super.base.submit.call(this)}};hne.exports=pne});var bN=w((Hpt,dne)=>{"use strict";var Jqe=Z0(),Wqe=()=>{throw new Error("expected prompt to have a custom authenticate method")},Cne=(t=Wqe)=>{class e extends Jqe{constructor(i){super(i)}async submit(){this.value=await t.call(this,this.values,this.state),super.base.submit.call(this)}static create(i){return Cne(i)}}return e};dne.exports=Cne()});var Ine=w((Gpt,mne)=>{"use strict";var zqe=bN();function _qe(t,e){return t.username===this.options.username&&t.password===this.options.password}var Ene=(t=_qe)=>{let e=[{name:"username",message:"username"},{name:"password",message:"password",format(i){return this.options.showPassword?i:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(i.length))}}];class r extends zqe.create(t){constructor(n){super(ie(N({},n),{choices:e}))}static create(n){return Ene(n)}}return r};mne.exports=Ene()});var $0=w((jpt,yne)=>{"use strict";var Vqe=Vf(),{isPrimitive:Xqe,hasColor:Zqe}=Xi(),wne=class extends Vqe{constructor(e){super(e);this.cursorHide()}async initialize(){let e=await this.resolve(this.initial,this.state);this.input=await this.cast(e),await super.initialize()}dispatch(e){return this.isValue(e)?(this.input=e,this.submit()):this.alert()}format(e){let{styles:r,state:i}=this;return i.submitted?r.success(e):r.primary(e)}cast(e){return this.isTrue(e)}isTrue(e){return/^[ty1]/i.test(e)}isFalse(e){return/^[fn0]/i.test(e)}isValue(e){return Xqe(e)&&(this.isTrue(e)||this.isFalse(e))}async hint(){if(this.state.status==="pending"){let e=await this.element("hint");return Zqe(e)?e:this.styles.muted(e)}}async render(){let{input:e,size:r}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o=this.styles.muted(this.default),a=[i,s,o,n].filter(Boolean).join(" ");this.state.prompt=a;let l=await this.header(),c=this.value=this.cast(e),u=await this.format(c),g=await this.error()||await this.hint(),f=await this.footer();g&&!a.includes(g)&&(u+=" "+g),a+=" "+u,this.clear(r),this.write([l,a,f].filter(Boolean).join(`
`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};yne.exports=wne});var Qne=w((Ypt,Bne)=>{"use strict";var $qe=$0(),bne=class extends $qe{constructor(e){super(e);this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};Bne.exports=bne});var kne=w((qpt,vne)=>{"use strict";var eJe=xl(),tJe=Z0(),Xf=tJe.prototype,Sne=class extends eJe{constructor(e){super(ie(N({},e),{multiple:!0}));this.align=[this.options.align,"left"].find(r=>r!=null),this.emptyError="",this.values={}}dispatch(e,r){let i=this.focused,n=i.parent||{};return!i.editable&&!n.editable&&(e==="a"||e==="i")?super[e]():Xf.dispatch.call(this,e,r)}append(e,r){return Xf.append.call(this,e,r)}delete(e,r){return Xf.delete.call(this,e,r)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?Xf.next.call(this):super.next()}prev(){return this.focused.editable?Xf.prev.call(this):super.prev()}async indicator(e,r){let i=e.indicator||"",n=e.editable?i:super.indicator(e,r);return await this.resolve(n,this.state,e,r)||""}indent(e){return e.role==="heading"?"":e.editable?" ":"  "}async renderChoice(e,r){return e.indent="",e.editable?Xf.renderChoice.call(this,e,r):super.renderChoice(e,r)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let r of this.choices){if(typeof r.validate!="function"||r.role==="heading")continue;let i=r.parent?this.value[r.parent.name]:this.value;if(r.editable?i=r.value===r.name?r.initial||"":r.value:this.isDisabled(r)||(i=r.enabled===!0),e=await r.validate(i,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let r=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?r[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(r[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};vne.exports=Sne});var Iu=w((Jpt,xne)=>{"use strict";var rJe=Vf(),iJe=BN(),{isPrimitive:nJe}=Xi(),Pne=class extends rJe{constructor(e){super(e);this.initial=nJe(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,r={}){let i=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name==="return"&&(!i||i.name!=="return")?this.append(`
`,r):super.keypress(e,r)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,r){if(!e||r.ctrl||r.code)return this.alert();this.append(e)}append(e){let{cursor:r,input:i}=this.state;this.input=`${i}`.slice(0,r)+e+`${i}`.slice(r),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:r}=this.state;if(e<=0)return this.alert();this.input=`${r}`.slice(0,e-1)+`${r}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:r}=this.state;if(r[e]===void 0)return this.alert();this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let r=this.input.slice(0,e),i=this.input.slice(e),n=r.split(" ");this.state.clipboard.push(n.pop()),this.input=n.join(" "),this.cursor=this.input.length,this.input+=i,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):"";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||r):iJe(this,{input:e,initial:r,pos:this.cursor})}async render(){let e=this.state.size,r=await this.prefix(),i=await this.separator(),n=await this.message(),s=[r,n,i].filter(Boolean).join(" ");this.state.prompt=s;let o=await this.header(),a=await this.format(),l=await this.error()||await this.hint(),c=await this.footer();l&&!a.includes(l)&&(a+=" "+l),s+=" "+a,this.clear(e),this.write([o,s,c].filter(Boolean).join(`
`)),this.restore()}};xne.exports=Pne});var Rne=w((Wpt,Dne)=>{"use strict";var sJe=t=>t.filter((e,r)=>t.lastIndexOf(e)===r),eb=t=>sJe(t).filter(Boolean);Dne.exports=(t,e={},r="")=>{let{past:i=[],present:n=""}=e,s,o;switch(t){case"prev":case"undo":return s=i.slice(0,i.length-1),o=i[i.length-1]||"",{past:eb([r,...s]),present:o};case"next":case"redo":return s=i.slice(1),o=i[0]||"",{past:eb([...s,r]),present:o};case"save":return{past:eb([...i,r]),present:""};case"remove":return o=eb(i.filter(a=>a!==r)),n="",o.length&&(n=o.pop()),{past:o,present:n};default:throw new Error(`Invalid action: "${t}"`)}}});var QN=w((zpt,Fne)=>{"use strict";var oJe=Iu(),Nne=Rne(),Lne=class extends oJe{constructor(e){super(e);let r=this.options.history;if(r&&r.store){let i=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get("values")||{past:[],present:i},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=Nne(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){!this.store||(this.data=Nne("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};Fne.exports=Lne});var Mne=w((_pt,Tne)=>{"use strict";var aJe=Iu(),One=class extends aJe{format(){return""}};Tne.exports=One});var Hne=w((Vpt,Kne)=>{"use strict";var AJe=Iu(),Une=class extends AJe{constructor(e={}){super(e);this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:r=>r;return this.list.map(e).join(", ")}async submit(e){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};Kne.exports=Une});var Yne=w((Xpt,Gne)=>{"use strict";var lJe=xl(),jne=class extends lJe{constructor(e){super(ie(N({},e),{multiple:!0}))}};Gne.exports=jne});var vN=w((Zpt,qne)=>{"use strict";var cJe=Iu(),Jne=class extends cJe{constructor(e={}){super(N({style:"number"},e));this.min=this.isValue(e.min)?this.toNumber(e.min):-Infinity,this.max=this.isValue(e.max)?this.toNumber(e.max):Infinity,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let r=e||this.minor,i=this.toNumber(this.input);return i>this.max+r?this.alert():(this.input=`${i+r}`,this.render())}down(e){let r=e||this.minor,i=this.toNumber(this.input);return i<this.min-r?this.alert():(this.input=`${i-r}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format=="function"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=""){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(r=>this.isValue(r));return this.value=this.toNumber(e||0),super.submit()}};qne.exports=Jne});var zne=w(($pt,Wne)=>{Wne.exports=vN()});var Xne=w((edt,_ne)=>{"use strict";var uJe=Iu(),Vne=class extends uJe{constructor(e){super(e);this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};_ne.exports=Vne});var tse=w((tdt,Zne)=>{"use strict";var gJe=mo(),fJe=ZC(),$ne=Xi(),ese=class extends fJe{constructor(e={}){super(e);this.widths=[].concat(e.messageWidth||50),this.align=[].concat(e.align||"left"),this.linebreak=e.linebreak||!1,this.edgeLength=e.edgeLength||3,this.newline=e.newline||`
   `;let r=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((i,n)=>({name:n+r})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let r of this.choices){e=Math.max(e,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let i=0;i<this.scale.length;i++)r.scale.push({index:i})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}heading(e,r,i){return this.styles.strong(e)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIndex>=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.index)).join(", "):""}pointer(){return""}renderScaleKey(){if(this.scaleKey===!1||this.state.submitted)return"";let e=this.scale.map(i=>`   ${i.name} - ${i.message}`);return["",...e].map(i=>this.styles.muted(i)).join(`
`)}renderScaleHeading(e){let r=this.scale.map(l=>l.name);typeof this.options.renderScaleHeading=="function"&&(r=this.options.renderScaleHeading.call(this,e));let i=this.scaleLength-r.join("").length,n=Math.round(i/(r.length-1)),o=r.map(l=>this.styles.strong(l)).join(" ".repeat(n)),a=" ".repeat(this.widths[0]);return this.margin[3]+a+this.margin[1]+o}scaleIndicator(e,r,i){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,r,i);let n=e.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):n?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,r){let i=e.scale.map(s=>this.scaleIndicator(e,s,r)),n=this.term==="Hyper"?"":" ";return i.join(n+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,r){await this.onChoice(e,r);let i=this.index===r,n=await this.pointer(e,r),s=await e.hint;s&&!$ne.hasColor(s)&&(s=this.styles.muted(s));let o=p=>this.margin[3]+p.replace(/\s+$/,"").padEnd(this.widths[0]," "),a=this.newline,l=this.indent(e),c=await this.resolve(e.message,this.state,e,r),u=await this.renderScale(e,r),g=this.margin[1]+this.margin[3];this.scaleLength=gJe.unstyle(u).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-g.length);let h=$ne.wordWrap(c,{width:this.widths[0],newline:a}).split(`
`).map(p=>o(p)+this.margin[1]);return i&&(u=this.styles.info(u),h=h.map(p=>this.styles.info(p))),h[0]+=u,this.linebreak&&h.push(""),[l+n,h.join(`
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(n,s)=>await this.renderChoice(n,s)),r=await Promise.all(e),i=await this.renderScaleHeading();return this.margin[0]+[i,...r.map(n=>n.join(" "))].join(`
`)}async render(){let{submitted:e,size:r}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o="";this.options.promptLine!==!1&&(o=[i,s,n,""].join(" "),this.state.prompt=o);let a=await this.header(),l=await this.format(),c=await this.renderScaleKey(),u=await this.error()||await this.hint(),g=await this.renderChoices(),f=await this.footer(),h=this.emptyError;l&&(o+=l),u&&!o.includes(u)&&(o+=" "+u),e&&!l&&!g.trim()&&this.multiple&&h!=null&&(o+=this.styles.danger(h)),this.clear(r),this.write([a,o,c,g,f].filter(Boolean).join(`
`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};Zne.exports=ese});var sse=w((rdt,rse)=>{"use strict";var ise=mo(),hJe=(t="")=>typeof t=="string"?t.replace(/^['"]|['"]$/g,""):"",nse=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=hJe(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},pJe=async(t={},e={},r=i=>i)=>{let i=new Set,n=t.fields||[],s=t.template,o=[],a=[],l=[],c=1;typeof s=="function"&&(s=await s());let u=-1,g=()=>s[++u],f=()=>s[u+1],h=p=>{p.line=c,o.push(p)};for(h({type:"bos",value:""});u<s.length-1;){let p=g();if(/^[^\S\n ]$/.test(p)){h({type:"text",value:p});continue}if(p===`
`){h({type:"newline",value:p}),c++;continue}if(p==="\\"){p+=g(),h({type:"text",value:p});continue}if((p==="$"||p==="#"||p==="{")&&f()==="{"){p+=g();let b={type:"template",open:p,inner:"",close:"",value:p},S;for(;S=g();){if(S==="}"){f()==="}"&&(S+=g()),b.value+=S,b.close=S;break}S===":"?(b.initial="",b.key=b.inner):b.initial!==void 0&&(b.initial+=S),b.value+=S,b.inner+=S}b.template=b.open+(b.initial||b.inner)+b.close,b.key=b.key||b.inner,e.hasOwnProperty(b.key)&&(b.initial=e[b.key]),b=r(b),h(b),l.push(b.key),i.add(b.key);let k=a.find(T=>T.name===b.key);b.field=n.find(T=>T.name===b.key),k||(k=new nse(b),a.push(k)),k.lines.push(b.line-1);continue}let m=o[o.length-1];m.type==="text"&&m.line===c?m.value+=p:h({type:"text",value:p})}return h({type:"eos",value:""}),{input:s,tabstops:o,unique:i,keys:l,items:a}};rse.exports=async t=>{let e=t.options,r=new Set(e.required===!0?[]:e.required||[]),i=N(N({},e.values),e.initial),{tabstops:n,items:s,keys:o}=await pJe(e,i),a=SN("result",t,e),l=SN("format",t,e),c=SN("validate",t,e,!0),u=t.isValue.bind(t);return async(g={},f=!1)=>{let h=0;g.required=r,g.items=s,g.keys=o,g.output="";let p=async(S,k,T,Y)=>{let j=await c(S,k,T,Y);return j===!1?"Invalid field "+T.name:j};for(let S of n){let k=S.value,T=S.key;if(S.type!=="template"){k&&(g.output+=k);continue}if(S.type==="template"){let Y=s.find(ee=>ee.name===T);e.required===!0&&g.required.add(Y.name);let j=[Y.input,g.values[Y.value],Y.value,k].find(u),J=(Y.field||{}).message||S.inner;if(f){let ee=await p(g.values[T],g,Y,h);if(ee&&typeof ee=="string"||ee===!1){g.invalid.set(T,ee);continue}g.invalid.delete(T);let A=await a(g.values[T],g,Y,h);g.output+=ise.unstyle(A);continue}Y.placeholder=!1;let re=k;k=await l(k,g,Y,h),j!==k?(g.values[T]=j,k=t.styles.typing(j),g.missing.delete(J)):(g.values[T]=void 0,j=`<${J}>`,k=t.styles.primary(j),Y.placeholder=!0,g.required.has(T)&&g.missing.add(J)),g.missing.has(J)&&g.validating&&(k=t.styles.warning(j)),g.invalid.has(T)&&g.validating&&(k=t.styles.danger(j)),h===g.index&&(re!==k?k=t.styles.underline(k):k=t.styles.heading(ise.unstyle(k))),h++}k&&(g.output+=k)}let m=g.output.split(`
`).map(S=>" "+S),y=s.length,b=0;for(let S of s)g.invalid.has(S.name)&&S.lines.forEach(k=>{m[k][0]===" "&&(m[k]=g.styles.danger(g.symbols.bullet)+m[k].slice(1))}),t.isValue(g.values[S.name])&&b++;return g.completed=(b/y*100).toFixed(0),g.output=m.join(`
`),g.output}};function SN(t,e,r,i){return(n,s,o,a)=>typeof o.field[t]=="function"?o.field[t].call(e,n,s,o,a):[i,n].find(l=>e.isValue(l))}});var Ase=w((idt,ose)=>{"use strict";var dJe=mo(),CJe=sse(),mJe=Vf(),ase=class extends mJe{constructor(e){super(e);this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await CJe(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let r=this.getItem();this.cursor+=e,r.cursor+=e}dispatch(e,r){if(!r.code&&!r.ctrl&&e!=null&&this.getItem()){this.append(e,r);return}this.alert()}append(e,r){let i=this.getItem(),n=i.input.slice(0,this.cursor),s=i.input.slice(this.cursor);this.input=i.input=`${n}${e}${s}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let r=e.input.slice(this.cursor),i=e.input.slice(0,this.cursor-1);this.input=e.input=`${i}${r}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:e,keys:r=[],submitted:i,size:n}=this.state,s=[this.options.newline,`
`].find(S=>S!=null),o=await this.prefix(),a=await this.separator(),l=await this.message(),c=[o,l,a].filter(Boolean).join(" ");this.state.prompt=c;let u=await this.header(),g=await this.error()||"",f=await this.hint()||"",h=i?"":await this.interpolate(this.state),p=this.state.key=r[e]||"",m=await this.format(p),y=await this.footer();m&&(c+=" "+m),f&&!m&&this.state.completed===0&&(c+=" "+f),this.clear(n);let b=[u,c,h,y,g.trim()];this.write(b.filter(Boolean).join(s)),this.restore()}getItem(e){let{items:r,keys:i,index:n}=this.state,s=r.find(o=>o.name===i[n]);return s&&s.input!=null&&(this.input=s.input,this.cursor=s.cursor),s}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:r,output:i,values:n}=this.state;if(e.size){let a="";for(let[l,c]of e)a+=`Invalid ${l}: ${c}
`;return this.state.error=a,super.submit()}if(r.size)return this.state.error="Required: "+[...r.keys()].join(", "),super.submit();let o=dJe.unstyle(i).split(`
`).map(a=>a.slice(1)).join(`
`);return this.value={values:n,result:o},super.submit()}};ose.exports=ase});var use=w((ndt,lse)=>{"use strict";var EJe="(Use <shift>+<up/down> to sort)",IJe=xl(),cse=class extends IJe{constructor(e){super(ie(N({},e),{reorder:!1,sort:!0,multiple:!0}));this.state.hint=[this.options.hint,EJe].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,r){let i=await super.renderChoice(e,r),n=this.symbols.identicalTo+" ",s=this.index===r&&this.sorting?this.styles.muted(n):"  ";return this.options.drag===!1&&(s=""),this.options.numbered===!0?s+`${r+1} - `+i:s+i}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};lse.exports=cse});var hse=w((sdt,gse)=>{"use strict";var yJe=ZC(),fse=class extends yJe{constructor(e={}){super(e);if(this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];r=r.map(i=>this.styles.muted(i)),this.state.header=r.join(`
   `)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...e);for(let i of r)i.scale=wJe(5,this.options),i.scaleIdx=2;return r}dispatch(){this.alert()}space(){let e=this.focused,r=e.scale[e.scaleIdx],i=r.selected;return e.scale.forEach(n=>n.selected=!1),r.selected=!i,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return"   "}async renderChoice(e,r){await this.onChoice(e,r);let i=this.index===r,n=this.term==="Hyper",s=n?9:8,o=n?"":" ",a=this.symbols.line.repeat(s),l=" ".repeat(s+(n?0:1)),c=k=>(k?this.styles.success("\u25C9"):"\u25EF")+o,u=r+1+".",g=i?this.styles.heading:this.styles.noop,f=await this.resolve(e.message,this.state,e,r),h=this.indent(e),p=h+e.scale.map((k,T)=>c(T===e.scaleIdx)).join(a),m=k=>k===e.scaleIdx?g(k):k,y=h+e.scale.map((k,T)=>m(T)).join(l),b=()=>[u,f].filter(Boolean).join(" "),S=()=>[b(),p,y," "].filter(Boolean).join(`
`);return i&&(p=this.styles.cyan(p),y=this.styles.cyan(y)),S()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(i,n)=>await this.renderChoice(i,n)),r=await Promise.all(e);return r.length||r.push(this.styles.danger("No matching choices")),r.join(`
`)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:r}=this.state,i=await this.prefix(),n=await this.separator(),s=await this.message(),o=[i,s,n].filter(Boolean).join(" ");this.state.prompt=o;let a=await this.header(),l=await this.format(),c=await this.error()||await this.hint(),u=await this.renderChoices(),g=await this.footer();(l||!c)&&(o+=" "+l),c&&!o.includes(c)&&(o+=" "+c),e&&!l&&!u&&this.multiple&&this.type!=="form"&&(o+=this.styles.danger(this.emptyError)),this.clear(r),this.write([o,a,u,g].filter(Boolean).join(`
`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function wJe(t,e={}){if(Array.isArray(e.scale))return e.scale.map(i=>N({},i));let r=[];for(let i=1;i<t+1;i++)r.push({i,selected:!1});return r}gse.exports=fse});var dse=w((odt,pse)=>{pse.exports=QN()});var Ese=w((adt,Cse)=>{"use strict";var BJe=$0(),mse=class extends BJe{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",r){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let e=i=>this.styles.primary.underline(i);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:e}=this.state,r=await this.header(),i=await this.prefix(),n=await this.separator(),s=await this.message(),o=await this.format(),a=await this.error()||await this.hint(),l=await this.footer(),c=[i,s,n,o].join(" ");this.state.prompt=c,a&&!c.includes(a)&&(c+=" "+a),this.clear(e),this.write([r,c,l].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};Cse.exports=mse});var wse=w((Adt,Ise)=>{"use strict";var bJe=xl(),yse=class extends bJe{constructor(e){super(e);if(typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,r){let i=await super.toChoices(e,r);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};Ise.exports=yse});var bse=w(kN=>{"use strict";var Bse=Xi(),Ci=(t,e)=>{Bse.defineExport(kN,t,e),Bse.defineExport(kN,t.toLowerCase(),e)};Ci("AutoComplete",()=>gne());Ci("BasicAuth",()=>Ine());Ci("Confirm",()=>Qne());Ci("Editable",()=>kne());Ci("Form",()=>Z0());Ci("Input",()=>QN());Ci("Invisible",()=>Mne());Ci("List",()=>Hne());Ci("MultiSelect",()=>Yne());Ci("Numeral",()=>zne());Ci("Password",()=>Xne());Ci("Scale",()=>tse());Ci("Select",()=>xl());Ci("Snippet",()=>Ase());Ci("Sort",()=>use());Ci("Survey",()=>hse());Ci("Text",()=>dse());Ci("Toggle",()=>Ese());Ci("Quiz",()=>wse())});var vse=w((cdt,Qse)=>{Qse.exports={ArrayPrompt:ZC(),AuthPrompt:bN(),BooleanPrompt:$0(),NumberPrompt:vN(),StringPrompt:Iu()}});var em=w((udt,Sse)=>{"use strict";var kse=require("assert"),xN=require("events"),Pl=Xi(),ua=class extends xN{constructor(e,r){super();this.options=Pl.merge({},e),this.answers=N({},r)}register(e,r){if(Pl.isObject(e)){for(let n of Object.keys(e))this.register(n,e[n]);return this}kse.equal(typeof r,"function","expected a function");let i=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[i]=r:this.prompts[i]=r(this.Prompt,this),this}async prompt(e=[]){for(let r of[].concat(e))try{typeof r=="function"&&(r=await r.call(this)),await this.ask(Pl.merge({},this.options,r))}catch(i){return Promise.reject(i)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let r=Pl.merge({},this.options,e),{type:i,name:n}=e,{set:s,get:o}=Pl;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[n];kse(this.prompts[i],`Prompt "${i}" is not registered`);let a=new this.prompts[i](r),l=o(this.answers,n);a.state.answers=this.answers,a.enquirer=this,n&&a.on("submit",u=>{this.emit("answer",n,u,a),s(this.answers,n,u)});let c=a.emit.bind(a);return a.emit=(...u)=>(this.emit.call(this,...u),c(...u)),this.emit("prompt",a,this),r.autofill&&l!=null?(a.value=a.input=l,r.autofill==="show"&&await a.submit()):l=a.value=await a.run(),l}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||Vf()}static get prompts(){return bse()}static get types(){return vse()}static get prompt(){let e=(r,...i)=>{let n=new this(...i),s=n.emit.bind(n);return n.emit=(...o)=>(e.emit(...o),s(...o)),n.prompt(r)};return Pl.mixinEmitter(e,new xN),e}};Pl.mixinEmitter(ua,new xN);var PN=ua.prompts;for(let t of Object.keys(PN)){let e=t.toLowerCase(),r=i=>new PN[t](i).run();ua.prompt[e]=r,ua[e]=r,ua[t]||Reflect.defineProperty(ua,t,{get:()=>PN[t]})}var $C=t=>{Pl.defineExport(ua,t,()=>ua.types[t])};$C("ArrayPrompt");$C("AuthPrompt");$C("BooleanPrompt");$C("NumberPrompt");$C("StringPrompt");Sse.exports=ua});var Hse=w((eCt,Use)=>{function xJe(t,e){for(var r=-1,i=t==null?0:t.length;++r<i&&e(t[r],r,t)!==!1;);return t}Use.exports=xJe});var $f=w((tCt,Gse)=>{var PJe=u0(),DJe=Lf();function RJe(t,e,r,i){var n=!r;r||(r={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=i?i(r[a],t[a],a,r,t):void 0;l===void 0&&(l=t[a]),n?DJe(r,a,l):PJe(r,a,l)}return r}Gse.exports=RJe});var Yse=w((rCt,jse)=>{var FJe=$f(),NJe=Uf();function LJe(t,e){return t&&FJe(e,NJe(e),t)}jse.exports=LJe});var Jse=w((iCt,qse)=>{function TJe(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}qse.exports=TJe});var zse=w((nCt,Wse)=>{var OJe=Rn(),MJe=Q0(),KJe=Jse(),UJe=Object.prototype,HJe=UJe.hasOwnProperty;function GJe(t){if(!OJe(t))return KJe(t);var e=MJe(t),r=[];for(var i in t)i=="constructor"&&(e||!HJe.call(t,i))||r.push(i);return r}Wse.exports=GJe});var eh=w((sCt,_se)=>{var jJe=yF(),YJe=zse(),qJe=NC();function JJe(t){return qJe(t)?jJe(t,!0):YJe(t)}_se.exports=JJe});var Xse=w((oCt,Vse)=>{var WJe=$f(),zJe=eh();function _Je(t,e){return t&&WJe(e,zJe(e),t)}Vse.exports=_Je});var TN=w((am,th)=>{var VJe=Fs(),Zse=typeof am=="object"&&am&&!am.nodeType&&am,$se=Zse&&typeof th=="object"&&th&&!th.nodeType&&th,XJe=$se&&$se.exports===Zse,eoe=XJe?VJe.Buffer:void 0,toe=eoe?eoe.allocUnsafe:void 0;function ZJe(t,e){if(e)return t.slice();var r=t.length,i=toe?toe(r):new t.constructor(r);return t.copy(i),i}th.exports=ZJe});var ON=w((aCt,roe)=>{function $Je(t,e){var r=-1,i=t.length;for(e||(e=Array(i));++r<i;)e[r]=t[r];return e}roe.exports=$Je});var noe=w((ACt,ioe)=>{var e3e=$f(),t3e=S0();function r3e(t,e){return e3e(t,t3e(t),e)}ioe.exports=r3e});var tb=w((lCt,soe)=>{var i3e=wF(),n3e=i3e(Object.getPrototypeOf,Object);soe.exports=n3e});var MN=w((cCt,ooe)=>{var s3e=f0(),o3e=tb(),a3e=S0(),A3e=kF(),l3e=Object.getOwnPropertySymbols,c3e=l3e?function(t){for(var e=[];t;)s3e(e,a3e(t)),t=o3e(t);return e}:A3e;ooe.exports=c3e});var Aoe=w((uCt,aoe)=>{var u3e=$f(),g3e=MN();function f3e(t,e){return u3e(t,g3e(t),e)}aoe.exports=f3e});var coe=w((gCt,loe)=>{var h3e=SF(),p3e=MN(),d3e=eh();function C3e(t){return h3e(t,d3e,p3e)}loe.exports=C3e});var goe=w((fCt,uoe)=>{var m3e=Object.prototype,E3e=m3e.hasOwnProperty;function I3e(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&E3e.call(t,"index")&&(r.index=t.index,r.input=t.input),r}uoe.exports=I3e});var rb=w((hCt,foe)=>{var hoe=QF();function y3e(t){var e=new t.constructor(t.byteLength);return new hoe(e).set(new hoe(t)),e}foe.exports=y3e});var doe=w((pCt,poe)=>{var w3e=rb();function B3e(t,e){var r=e?w3e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}poe.exports=B3e});var moe=w((dCt,Coe)=>{var b3e=/\w*$/;function Q3e(t){var e=new t.constructor(t.source,b3e.exec(t));return e.lastIndex=t.lastIndex,e}Coe.exports=Q3e});var Boe=w((CCt,Eoe)=>{var Ioe=Hc(),yoe=Ioe?Ioe.prototype:void 0,woe=yoe?yoe.valueOf:void 0;function v3e(t){return woe?Object(woe.call(t)):{}}Eoe.exports=v3e});var KN=w((mCt,boe)=>{var S3e=rb();function k3e(t,e){var r=e?S3e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}boe.exports=k3e});var voe=w((ECt,Qoe)=>{var x3e=rb(),P3e=doe(),D3e=moe(),R3e=Boe(),F3e=KN(),N3e="[object Boolean]",L3e="[object Date]",T3e="[object Map]",O3e="[object Number]",M3e="[object RegExp]",K3e="[object Set]",U3e="[object String]",H3e="[object Symbol]",G3e="[object ArrayBuffer]",j3e="[object DataView]",Y3e="[object Float32Array]",q3e="[object Float64Array]",J3e="[object Int8Array]",W3e="[object Int16Array]",z3e="[object Int32Array]",_3e="[object Uint8Array]",V3e="[object Uint8ClampedArray]",X3e="[object Uint16Array]",Z3e="[object Uint32Array]";function $3e(t,e,r){var i=t.constructor;switch(e){case G3e:return x3e(t);case N3e:case L3e:return new i(+t);case j3e:return P3e(t,r);case Y3e:case q3e:case J3e:case W3e:case z3e:case _3e:case V3e:case X3e:case Z3e:return F3e(t,r);case T3e:return new i;case O3e:case U3e:return new i(t);case M3e:return D3e(t);case K3e:return new i;case H3e:return R3e(t)}}Qoe.exports=$3e});var xoe=w((ICt,Soe)=>{var eWe=Rn(),koe=Object.create,tWe=function(){function t(){}return function(e){if(!eWe(e))return{};if(koe)return koe(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();Soe.exports=tWe});var UN=w((yCt,Poe)=>{var rWe=xoe(),iWe=tb(),nWe=Q0();function sWe(t){return typeof t.constructor=="function"&&!nWe(t)?rWe(iWe(t)):{}}Poe.exports=sWe});var Roe=w((wCt,Doe)=>{var oWe=TC(),aWe=Zo(),AWe="[object Map]";function lWe(t){return aWe(t)&&oWe(t)==AWe}Doe.exports=lWe});var Toe=w((BCt,Foe)=>{var cWe=Roe(),uWe=w0(),Noe=B0(),Loe=Noe&&Noe.isMap,gWe=Loe?uWe(Loe):cWe;Foe.exports=gWe});var Moe=w((bCt,Ooe)=>{var fWe=TC(),hWe=Zo(),pWe="[object Set]";function dWe(t){return hWe(t)&&fWe(t)==pWe}Ooe.exports=dWe});var Goe=w((QCt,Koe)=>{var CWe=Moe(),mWe=w0(),Uoe=B0(),Hoe=Uoe&&Uoe.isSet,EWe=Hoe?mWe(Hoe):CWe;Koe.exports=EWe});var Woe=w((vCt,joe)=>{var IWe=LC(),yWe=Hse(),wWe=u0(),BWe=Yse(),bWe=Xse(),QWe=TN(),vWe=ON(),SWe=noe(),kWe=Aoe(),xWe=xF(),PWe=coe(),DWe=TC(),RWe=goe(),FWe=voe(),NWe=UN(),LWe=Ms(),TWe=DC(),OWe=Toe(),MWe=Rn(),KWe=Goe(),UWe=Uf(),HWe=eh(),GWe=1,jWe=2,YWe=4,Yoe="[object Arguments]",qWe="[object Array]",JWe="[object Boolean]",WWe="[object Date]",zWe="[object Error]",qoe="[object Function]",_We="[object GeneratorFunction]",VWe="[object Map]",XWe="[object Number]",Joe="[object Object]",ZWe="[object RegExp]",$We="[object Set]",e8e="[object String]",t8e="[object Symbol]",r8e="[object WeakMap]",i8e="[object ArrayBuffer]",n8e="[object DataView]",s8e="[object Float32Array]",o8e="[object Float64Array]",a8e="[object Int8Array]",A8e="[object Int16Array]",l8e="[object Int32Array]",c8e="[object Uint8Array]",u8e="[object Uint8ClampedArray]",g8e="[object Uint16Array]",f8e="[object Uint32Array]",dr={};dr[Yoe]=dr[qWe]=dr[i8e]=dr[n8e]=dr[JWe]=dr[WWe]=dr[s8e]=dr[o8e]=dr[a8e]=dr[A8e]=dr[l8e]=dr[VWe]=dr[XWe]=dr[Joe]=dr[ZWe]=dr[$We]=dr[e8e]=dr[t8e]=dr[c8e]=dr[u8e]=dr[g8e]=dr[f8e]=!0;dr[zWe]=dr[qoe]=dr[r8e]=!1;function ib(t,e,r,i,n,s){var o,a=e&GWe,l=e&jWe,c=e&YWe;if(r&&(o=n?r(t,i,n,s):r(t)),o!==void 0)return o;if(!MWe(t))return t;var u=LWe(t);if(u){if(o=RWe(t),!a)return vWe(t,o)}else{var g=DWe(t),f=g==qoe||g==_We;if(TWe(t))return QWe(t,a);if(g==Joe||g==Yoe||f&&!n){if(o=l||f?{}:NWe(t),!a)return l?kWe(t,bWe(o,t)):SWe(t,BWe(o,t))}else{if(!dr[g])return n?t:{};o=FWe(t,g,a)}}s||(s=new IWe);var h=s.get(t);if(h)return h;s.set(t,o),KWe(t)?t.forEach(function(y){o.add(ib(y,e,r,y,t,s))}):OWe(t)&&t.forEach(function(y,b){o.set(b,ib(y,e,r,b,t,s))});var p=c?l?PWe:xWe:l?HWe:UWe,m=u?void 0:p(t);return yWe(m||t,function(y,b){m&&(b=y,y=t[b]),wWe(o,b,ib(y,e,r,b,t,s))}),o}joe.exports=ib});var HN=w((SCt,zoe)=>{var h8e=Woe(),p8e=1,d8e=4;function C8e(t){return h8e(t,p8e|d8e)}zoe.exports=C8e});var Voe=w((kCt,_oe)=>{var m8e=XR();function E8e(t,e,r){return t==null?t:m8e(t,e,r)}_oe.exports=E8e});var rae=w((NCt,tae)=>{function I8e(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}tae.exports=I8e});var nae=w((LCt,iae)=>{var y8e=yC(),w8e=AD();function B8e(t,e){return e.length<2?t:y8e(t,w8e(e,0,-1))}iae.exports=B8e});var oae=w((TCt,sae)=>{var b8e=Nf(),Q8e=rae(),v8e=nae(),S8e=cu();function k8e(t,e){return e=b8e(e,t),t=v8e(t,e),t==null||delete t[S8e(Q8e(e))]}sae.exports=k8e});var Aae=w((OCt,aae)=>{var x8e=oae();function P8e(t,e){return t==null?!0:x8e(t,e)}aae.exports=P8e});var Cae=w((fmt,dae)=>{dae.exports={name:"@yarnpkg/cli",version:"3.2.1",license:"BSD-2-Clause",main:"./sources/index.ts",dependencies:{"@yarnpkg/core":"workspace:^","@yarnpkg/fslib":"workspace:^","@yarnpkg/libzip":"workspace:^","@yarnpkg/parsers":"workspace:^","@yarnpkg/plugin-compat":"workspace:^","@yarnpkg/plugin-dlx":"workspace:^","@yarnpkg/plugin-essentials":"workspace:^","@yarnpkg/plugin-file":"workspace:^","@yarnpkg/plugin-git":"workspace:^","@yarnpkg/plugin-github":"workspace:^","@yarnpkg/plugin-http":"workspace:^","@yarnpkg/plugin-init":"workspace:^","@yarnpkg/plugin-link":"workspace:^","@yarnpkg/plugin-nm":"workspace:^","@yarnpkg/plugin-npm":"workspace:^","@yarnpkg/plugin-npm-cli":"workspace:^","@yarnpkg/plugin-pack":"workspace:^","@yarnpkg/plugin-patch":"workspace:^","@yarnpkg/plugin-pnp":"workspace:^","@yarnpkg/plugin-pnpm":"workspace:^","@yarnpkg/shell":"workspace:^",chalk:"^3.0.0","ci-info":"^3.2.0",clipanion:"^3.2.0-rc.4",semver:"^7.1.2",tslib:"^1.13.0",typanion:"^3.3.0",yup:"^0.32.9"},devDependencies:{"@types/semver":"^7.1.0","@types/yup":"^0","@yarnpkg/builder":"workspace:^","@yarnpkg/monorepo":"workspace:^","@yarnpkg/pnpify":"workspace:^",micromatch:"^4.0.2"},peerDependencies:{"@yarnpkg/core":"workspace:^"},scripts:{postpack:"rm -rf lib",prepack:'run build:compile "$(pwd)"',"build:cli+hook":"run build:pnp:hook && builder build bundle","build:cli":"builder build bundle","run:cli":"builder run","update-local":"run build:cli --no-git-hash && rsync -a --delete bundles/ bin/"},publishConfig:{main:"./lib/index.js",types:"./lib/index.d.ts",bin:null},files:["/lib/**/*","!/lib/pluginConfiguration.*","!/lib/cli.*"],"@yarnpkg/builder":{bundles:{standard:["@yarnpkg/plugin-essentials","@yarnpkg/plugin-compat","@yarnpkg/plugin-dlx","@yarnpkg/plugin-file","@yarnpkg/plugin-git","@yarnpkg/plugin-github","@yarnpkg/plugin-http","@yarnpkg/plugin-init","@yarnpkg/plugin-link","@yarnpkg/plugin-nm","@yarnpkg/plugin-npm","@yarnpkg/plugin-npm-cli","@yarnpkg/plugin-pack","@yarnpkg/plugin-patch","@yarnpkg/plugin-pnp","@yarnpkg/plugin-pnpm"]}},repository:{type:"git",url:"ssh://git@github.com/yarnpkg/berry.git",directory:"packages/yarnpkg-cli"},engines:{node:">=12 <14 || 14.2 - 14.9 || >14.10.0"}}});var $N=w((qyt,iAe)=>{"use strict";iAe.exports=function(e,r){r===!0&&(r=0);var i=e.indexOf("://"),n=e.substring(0,i).split("+").filter(Boolean);return typeof r=="number"?n[r]:n}});var eL=w((Jyt,nAe)=>{"use strict";var X8e=$N();function sAe(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=X8e(t);return t=t.substring(t.indexOf("://")+3),sAe(e)?!0:t.indexOf("@")<t.indexOf(":")}nAe.exports=sAe});var aAe=w((Wyt,oAe)=>{"use strict";var Z8e=$N(),$8e=eL(),e4e=require("querystring");function t4e(t){t=(t||"").trim();var e={protocols:Z8e(t),protocol:null,port:null,resource:"",user:"",pathname:"",hash:"",search:"",href:t,query:Object.create(null)},r=t.indexOf("://"),i=-1,n=null,s=null;t.startsWith(".")&&(t.startsWith("./")&&(t=t.substring(2)),e.pathname=t,e.protocol="file");var o=t.charAt(1);return e.protocol||(e.protocol=e.protocols[0],e.protocol||($8e(t)?e.protocol="ssh":((o==="/"||o==="~")&&(t=t.substring(2)),e.protocol="file"))),r!==-1&&(t=t.substring(r+3)),s=t.split("/"),e.protocol!=="file"?e.resource=s.shift():e.resource="",n=e.resource.split("@"),n.length===2&&(e.user=n[0],e.resource=n[1]),n=e.resource.split(":"),n.length===2&&(e.resource=n[0],n[1]?(e.port=Number(n[1]),isNaN(e.port)&&(e.port=null,s.unshift(n[1]))):e.port=null),s=s.filter(Boolean),e.protocol==="file"?e.pathname=e.href:e.pathname=e.pathname||(e.protocol!=="file"||e.href[0]==="/"?"/":"")+s.join("/"),n=e.pathname.split("#"),n.length===2&&(e.pathname=n[0],e.hash=n[1]),n=e.pathname.split("?"),n.length===2&&(e.pathname=n[0],e.search=n[1]),e.query=e4e.parse(e.search),e.href=e.href.replace(/\/$/,""),e.pathname=e.pathname.replace(/\/$/,""),e}oAe.exports=t4e});var cAe=w((zyt,AAe)=>{"use strict";var r4e="text/plain",i4e="us-ascii",lAe=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),n4e=(t,{stripHash:e})=>{let r=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:i,data:n,hash:s}=r.groups,o=i.split(";");s=e?"":s;let a=!1;o[o.length-1]==="base64"&&(o.pop(),a=!0);let l=(o.shift()||"").toLowerCase(),u=[...o.map(g=>{let[f,h=""]=g.split("=").map(p=>p.trim());return f==="charset"&&(h=h.toLowerCase(),h===i4e)?"":`${f}${h?`=${h}`:""}`}).filter(Boolean)];return a&&u.push("base64"),(u.length!==0||l&&l!==r4e)&&u.unshift(l),`data:${u.join(";")},${a?n.trim():n}${s?`#${s}`:""}`},s4e=(t,e)=>{if(e=N({defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0},e),t=t.trim(),/^data:/i.test(t))return n4e(t,e);if(/^view-source:/i.test(t))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let n=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&n.protocol==="https:"&&(n.protocol="http:"),e.forceHttps&&n.protocol==="http:"&&(n.protocol="https:"),e.stripAuthentication&&(n.username="",n.password=""),e.stripHash?n.hash="":e.stripTextFragment&&(n.hash=n.hash.replace(/#?:~:text.*?$/i,"")),n.pathname&&(n.pathname=n.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g,"/")),n.pathname)try{n.pathname=decodeURI(n.pathname)}catch(o){}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let o=n.pathname.split("/"),a=o[o.length-1];lAe(a,e.removeDirectoryIndex)&&(o=o.slice(0,o.length-1),n.pathname=o.slice(1).join("/")+"/")}if(n.hostname&&(n.hostname=n.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(n.hostname)&&(n.hostname=n.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let o of[...n.searchParams.keys()])lAe(o,e.removeQueryParameters)&&n.searchParams.delete(o);e.removeQueryParameters===!0&&(n.search=""),e.sortQueryParameters&&n.searchParams.sort(),e.removeTrailingSlash&&(n.pathname=n.pathname.replace(/\/$/,""));let s=t;return t=n.toString(),!e.removeSingleSlash&&n.pathname==="/"&&!s.endsWith("/")&&n.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||n.pathname==="/")&&n.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t};AAe.exports=s4e});var gAe=w((_yt,uAe)=>{"use strict";var o4e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a4e=aAe(),A4e=cAe();function l4e(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(typeof t!="string"||!t.trim())throw new Error("Invalid url.");e&&((typeof e=="undefined"?"undefined":o4e(e))!=="object"&&(e={stripHash:!1}),t=A4e(t,e));var r=a4e(t);return r}uAe.exports=l4e});var pAe=w((Vyt,fAe)=>{"use strict";var c4e=gAe(),hAe=eL();function u4e(t){var e=c4e(t);e.token="";var r=e.user.split(":");return r.length===2&&(r[1]==="x-oauth-basic"?e.token=r[0]:r[0]==="x-token-auth"&&(e.token=r[1])),hAe(e.protocols)||hAe(t)?e.protocol="ssh":e.protocols.length?e.protocol=e.protocols[0]:e.protocol="file",e.href=e.href.replace(/\/$/,""),e}fAe.exports=u4e});var CAe=w((Xyt,dAe)=>{"use strict";var g4e=pAe();function tL(t){if(typeof t!="string")throw new Error("The url must be a string.");var e=g4e(t),r=e.resource.split("."),i=null;switch(e.toString=function(l){return tL.stringify(this,l)},e.source=r.length>2?r.slice(1-r.length).join("."):e.source=e.resource,e.git_suffix=/\.git$/.test(e.pathname),e.name=decodeURIComponent(e.pathname.replace(/^\//,"").replace(/\.git$/,"")),e.owner=decodeURIComponent(e.user),e.source){case"git.cloudforge.com":e.owner=e.user,e.organization=r[0],e.source="cloudforge.com";break;case"visualstudio.com":if(e.resource==="vs-ssh.visualstudio.com"){i=e.name.split("/"),i.length===4&&(e.organization=i[1],e.owner=i[2],e.name=i[3],e.full_name=i[2]+"/"+i[3]);break}else{i=e.name.split("/"),i.length===2?(e.owner=i[1],e.name=i[1],e.full_name="_git/"+e.name):i.length===3?(e.name=i[2],i[0]==="DefaultCollection"?(e.owner=i[2],e.organization=i[0],e.full_name=e.organization+"/_git/"+e.name):(e.owner=i[0],e.full_name=e.owner+"/_git/"+e.name)):i.length===4&&(e.organization=i[0],e.owner=i[1],e.name=i[3],e.full_name=e.organization+"/"+e.owner+"/_git/"+e.name);break}case"dev.azure.com":case"azure.com":if(e.resource==="ssh.dev.azure.com"){i=e.name.split("/"),i.length===4&&(e.organization=i[1],e.owner=i[2],e.name=i[3]);break}else{i=e.name.split("/"),i.length===5?(e.organization=i[0],e.owner=i[1],e.name=i[4],e.full_name="_git/"+e.name):i.length===3?(e.name=i[2],i[0]==="DefaultCollection"?(e.owner=i[2],e.organization=i[0],e.full_name=e.organization+"/_git/"+e.name):(e.owner=i[0],e.full_name=e.owner+"/_git/"+e.name)):i.length===4&&(e.organization=i[0],e.owner=i[1],e.name=i[3],e.full_name=e.organization+"/"+e.owner+"/_git/"+e.name);break}default:i=e.name.split("/");var n=i.length-1;if(i.length>=2){var s=i.indexOf("blob",2),o=i.indexOf("tree",2),a=i.indexOf("commit",2);n=s>0?s-1:o>0?o-1:a>0?a-1:n,e.owner=i.slice(0,n).join("/"),e.name=i[n],a&&(e.commit=i[n+2])}e.ref="",e.filepathtype="",e.filepath="",i.length>n+2&&["blob","tree"].indexOf(i[n+1])>=0&&(e.filepathtype=i[n+1],e.ref=i[n+2],i.length>n+3&&(e.filepath=i.slice(n+3).join("/"))),e.organization=e.owner;break}return e.full_name||(e.full_name=e.owner,e.name&&(e.full_name&&(e.full_name+="/"),e.full_name+=e.name)),e}tL.stringify=function(t,e){e=e||(t.protocols&&t.protocols.length?t.protocols.join("+"):t.protocol);var r=t.port?":"+t.port:"",i=t.user||"git",n=t.git_suffix?".git":"";switch(e){case"ssh":return r?"ssh://"+i+"@"+t.resource+r+"/"+t.full_name+n:i+"@"+t.resource+":"+t.full_name+n;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return e+"://"+i+"@"+t.resource+r+"/"+t.full_name+n;case"http":case"https":var s=t.token?f4e(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+t.full_name+n;default:return t.href}};function f4e(t){switch(t.source){case"bitbucket.org":return"x-token-auth:"+t.token+"@";default:return t.token+"@"}}dAe.exports=tL});var DL=w((ibt,UAe)=>{var R4e=Lf(),F4e=Df();function N4e(t,e,r){(r!==void 0&&!F4e(t[e],r)||r===void 0&&!(e in t))&&R4e(t,e,r)}UAe.exports=N4e});var GAe=w((nbt,HAe)=>{var L4e=NC(),T4e=Zo();function O4e(t){return T4e(t)&&L4e(t)}HAe.exports=O4e});var qAe=w((sbt,jAe)=>{var M4e=Gc(),K4e=tb(),U4e=Zo(),H4e="[object Object]",G4e=Function.prototype,j4e=Object.prototype,YAe=G4e.toString,Y4e=j4e.hasOwnProperty,q4e=YAe.call(Object);function J4e(t){if(!U4e(t)||M4e(t)!=H4e)return!1;var e=K4e(t);if(e===null)return!0;var r=Y4e.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&YAe.call(r)==q4e}jAe.exports=J4e});var RL=w((obt,JAe)=>{function W4e(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}JAe.exports=W4e});var zAe=w((abt,WAe)=>{var z4e=$f(),_4e=eh();function V4e(t){return z4e(t,_4e(t))}WAe.exports=V4e});var ele=w((Abt,_Ae)=>{var VAe=DL(),X4e=TN(),Z4e=KN(),$4e=ON(),eze=UN(),XAe=BC(),ZAe=Ms(),tze=GAe(),rze=DC(),ize=A0(),nze=Rn(),sze=qAe(),oze=b0(),$Ae=RL(),aze=zAe();function Aze(t,e,r,i,n,s,o){var a=$Ae(t,r),l=$Ae(e,r),c=o.get(l);if(c){VAe(t,r,c);return}var u=s?s(a,l,r+"",t,e,o):void 0,g=u===void 0;if(g){var f=ZAe(l),h=!f&&rze(l),p=!f&&!h&&oze(l);u=l,f||h||p?ZAe(a)?u=a:tze(a)?u=$4e(a):h?(g=!1,u=X4e(l,!0)):p?(g=!1,u=Z4e(l,!0)):u=[]:sze(l)||XAe(l)?(u=a,XAe(a)?u=aze(a):(!nze(a)||ize(a))&&(u=eze(l))):g=!1}g&&(o.set(l,u),n(u,l,i,s,o),o.delete(l)),VAe(t,r,u)}_Ae.exports=Aze});var ile=w((lbt,tle)=>{var lze=LC(),cze=DL(),uze=EF(),gze=ele(),fze=Rn(),hze=eh(),pze=RL();function rle(t,e,r,i,n){t!==e&&uze(e,function(s,o){if(n||(n=new lze),fze(s))gze(t,e,o,r,rle,i,n);else{var a=i?i(pze(t,o),s,o+"",t,e,n):void 0;a===void 0&&(a=s),cze(t,o,a)}},hze)}tle.exports=rle});var sle=w((cbt,nle)=>{var dze=h0(),Cze=eF(),mze=tF();function Eze(t,e){return mze(Cze(t,e,dze),t+"")}nle.exports=Eze});var ale=w((ubt,ole)=>{var Ize=Df(),yze=NC(),wze=wC(),Bze=Rn();function bze(t,e,r){if(!Bze(r))return!1;var i=typeof e;return(i=="number"?yze(r)&&wze(e,r.length):i=="string"&&e in r)?Ize(r[e],t):!1}ole.exports=bze});var lle=w((gbt,Ale)=>{var Qze=sle(),vze=ale();function Sze(t){return Qze(function(e,r){var i=-1,n=r.length,s=n>1?r[n-1]:void 0,o=n>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(n--,s):void 0,o&&vze(r[0],r[1],o)&&(s=n<3?void 0:s,n=1),e=Object(e);++i<n;){var a=r[i];a&&t(e,a,i,s)}return e})}Ale.exports=Sze});var ule=w((fbt,cle)=>{var kze=ile(),xze=lle(),Pze=xze(function(t,e,r){kze(t,e,r)});cle.exports=Pze});var Sle=w((mQt,vle)=>{var JL;vle.exports=()=>(typeof JL=="undefined"&&(JL=require("zlib").brotliDecompressSync(Buffer.from(" ","base64")).toString()),JL)});var Mle=w((XQt,Ole)=>{var VL;Ole.exports=()=>(typeof VL=="undefined"&&(VL=require("zlib").brotliDecompressSync(Buffer.from(" ","base64")).toString()),VL)});var Jle=w((iT,nT)=>{(function(t){iT&&typeof iT=="object"&&typeof nT!="undefined"?nT.exports=t():typeof define=="function"&&define.amd?define([],t):typeof window!="undefined"?window.isWindows=t():typeof global!="undefined"?global.isWindows=t():typeof self!="undefined"?self.isWindows=t():this.isWindows=t()})(function(){"use strict";return function(){return process&&(process.platform==="win32"||/^(msys|cygwin)$/.test(process.env.OSTYPE))}})});var Vle=w((iSt,Wle)=>{"use strict";sT.ifExists=m5e;var Ah=require("util"),Ws=require("path"),zle=Jle(),E5e=/^#!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/,I5e={createPwshFile:!0,createCmdFile:zle(),fs:require("fs")},y5e=new Map([[".js","node"],[".cjs","node"],[".mjs","node"],[".cmd","cmd"],[".bat","cmd"],[".ps1","pwsh"],[".sh","sh"]]);function _le(t){let e=N(N({},I5e),t),r=e.fs;return e.fs_={chmod:r.chmod?Ah.promisify(r.chmod):async()=>{},mkdir:Ah.promisify(r.mkdir),readFile:Ah.promisify(r.readFile),stat:Ah.promisify(r.stat),unlink:Ah.promisify(r.unlink),writeFile:Ah.promisify(r.writeFile)},e}async function sT(t,e,r){let i=_le(r);await i.fs_.stat(t),await w5e(t,e,i)}function m5e(t,e,r){return sT(t,e,r).catch(()=>{})}function B5e(t,e){return e.fs_.unlink(t).catch(()=>{})}async function w5e(t,e,r){let i=await v5e(t,r);return await b5e(e,r),Q5e(t,e,i,r)}function b5e(t,e){return e.fs_.mkdir(Ws.dirname(t),{recursive:!0})}function Q5e(t,e,r,i){let n=_le(i),s=[{generator:x5e,extension:""}];return n.createCmdFile&&s.push({generator:k5e,extension:".cmd"}),n.createPwshFile&&s.push({generator:P5e,extension:".ps1"}),Promise.all(s.map(o=>S5e(t,e+o.extension,r,o.generator,n)))}function D5e(t,e){return B5e(t,e)}function F5e(t,e){return R5e(t,e)}async function v5e(t,e){let n=(await e.fs_.readFile(t,"utf8")).trim().split(/\r*\n/)[0].match(E5e);if(!n){let s=Ws.extname(t).toLowerCase();return{program:y5e.get(s)||null,additionalArgs:""}}return{program:n[1],additionalArgs:n[2]}}async function S5e(t,e,r,i,n){let s=n.preserveSymlinks?"--preserve-symlinks":"",o=[r.additionalArgs,s].filter(a=>a).join(" ");return n=Object.assign({},n,{prog:r.program,args:o}),await D5e(e,n),await n.fs_.writeFile(e,i(t,e,n),"utf8"),F5e(e,n)}function k5e(t,e,r){let n=Ws.relative(Ws.dirname(e),t).split("/").join("\\"),s=Ws.isAbsolute(n)?`"${n}"`:`"%~dp0\\${n}"`,o,a=r.prog,l=r.args||"",c=oT(r.nodePath).win32;a?(o=`"%~dp0\\${a}.exe"`,n=s):(a=s,l="",n="");let u=r.progArgs?`${r.progArgs.join(" ")} `:"",g=c?`@SET NODE_PATH=${c}\r
`:"";return o?g+=`@IF EXIST ${o} (\r
  ${o} ${l} ${n} ${u}%*\r
) ELSE (\r
  @SETLOCAL\r
  @SET PATHEXT=%PATHEXT:;.JS;=;%\r
  ${a} ${l} ${n} ${u}%*\r
)\r
`:g+=`@${a} ${l} ${n} ${u}%*\r
`,g}function x5e(t,e,r){let i=Ws.relative(Ws.dirname(e),t),n=r.prog&&r.prog.split("\\").join("/"),s;i=i.split("\\").join("/");let o=Ws.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,a=r.args||"",l=oT(r.nodePath).posix;n?(s=`"$basedir/${r.prog}"`,i=o):(n=o,a="",i="");let c=r.progArgs?`${r.progArgs.join(" ")} `:"",u=`#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")

case \`uname\` in
    *CYGWIN*) basedir=\`cygpath -w "$basedir"\`;;
esac

`,g=r.nodePath?`export NODE_PATH="${l}"
`:"";return s?u+=`${g}if [ -x ${s} ]; then
  exec ${s} ${a} ${i} ${c}"$@"
else
  exec ${n} ${a} ${i} ${c}"$@"
fi
`:u+=`${g}${n} ${a} ${i} ${c}"$@"
exit $?
`,u}function P5e(t,e,r){let i=Ws.relative(Ws.dirname(e),t),n=r.prog&&r.prog.split("\\").join("/"),s=n&&`"${n}$exe"`,o;i=i.split("\\").join("/");let a=Ws.isAbsolute(i)?`"${i}"`:`"$basedir/${i}"`,l=r.args||"",c=oT(r.nodePath),u=c.win32,g=c.posix;s?(o=`"$basedir/${r.prog}$exe"`,i=a):(s=a,l="",i="");let f=r.progArgs?`${r.progArgs.join(" ")} `:"",h=`#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent

$exe=""
${r.nodePath?`$env_node_path=$env:NODE_PATH
$env:NODE_PATH="${u}"
`:""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
  # Fix case when both the Windows and Linux builds of Node
  # are installed in the same directory
  $exe=".exe"
}`;return r.nodePath&&(h+=` else {
  $env:NODE_PATH="${g}"
}`),o?h+=`
$ret=0
if (Test-Path ${o}) {
  # Support pipeline input
  if ($MyInvocation.ExpectingInput) {
    $input | & ${o} ${l} ${i} ${f}$args
  } else {
    & ${o} ${l} ${i} ${f}$args
  }
  $ret=$LASTEXITCODE
} else {
  # Support pipeline input
  if ($MyInvocation.ExpectingInput) {
    $input | & ${s} ${l} ${i} ${f}$args
  } else {
    & ${s} ${l} ${i} ${f}$args
  }
  $ret=$LASTEXITCODE
}
${r.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $ret
`:h+=`
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
  $input | & ${s} ${l} ${i} ${f}$args
} else {
  & ${s} ${l} ${i} ${f}$args
}
${r.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $LASTEXITCODE
`,h}function R5e(t,e){return e.fs_.chmod(t,493)}function oT(t){if(!t)return{win32:"",posix:""};let e=typeof t=="string"?t.split(Ws.delimiter):Array.from(t),r={};for(let i=0;i<e.length;i++){let n=e[i].split("/").join("\\"),s=zle()?e[i].split("\\").join("/").replace(/^([^:\\/]*):/,(o,a)=>`/mnt/${a.toLowerCase()}`):e[i];r.win32=r.win32?`${r.win32};${n}`:n,r.posix=r.posix?`${r.posix}:${s}`:s,r[i]={win32:n,posix:s}}return r}Wle.exports=sT});var yT=w((Kkt,dce)=>{dce.exports=require("stream")});var Ice=w((Ukt,Cce)=>{"use strict";function mce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function $5e(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mce(Object(r),!0).forEach(function(i){Z5e(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mce(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Z5e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function e_e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ece(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function t_e(t,e,r){return e&&Ece(t.prototype,e),r&&Ece(t,r),t}var r_e=require("buffer"),yb=r_e.Buffer,i_e=require("util"),wT=i_e.inspect,n_e=wT&&wT.custom||"inspect";function s_e(t,e,r){yb.prototype.copy.call(t,e,r)}Cce.exports=function(){function t(){e_e(this,t),this.head=null,this.tail=null,this.length=0}return t_e(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return yb.alloc(0);for(var i=yb.allocUnsafe(r>>>0),n=this.head,s=0;n;)s_e(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,s=i.data;for(r-=s.length;i=i.next;){var o=i.data,a=r>o.length?o.length:r;if(a===o.length?s+=o:s+=o.slice(0,r),r-=a,r===0){a===o.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(r){var i=yb.allocUnsafe(r),n=this.head,s=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var o=n.data,a=r>o.length?o.length:r;if(o.copy(i,i.length-r,0,a),r-=a,r===0){a===o.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++s}return this.length-=s,i}},{key:n_e,value:function(r,i){return wT(this,$5e({},i,{depth:0,customInspect:!1}))}}]),t}()});var bT=w((Hkt,yce)=>{"use strict";function o_e(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(BT,this,t)):process.nextTick(BT,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(wb,r):(r._writableState.errorEmitted=!0,process.nextTick(wce,r,s)):process.nextTick(wce,r,s):e?(process.nextTick(wb,r),e(s)):process.nextTick(wb,r)}),this)}function wce(t,e){BT(t,e),wb(t)}function wb(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function a_e(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function BT(t,e){t.emit("error",e)}function A_e(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}yce.exports={destroy:o_e,undestroy:a_e,errorOrDestroy:A_e}});var Ll=w((Gkt,Bce)=>{"use strict";var bce={};function zs(t,e,r){r||(r=Error);function i(s,o,a){return typeof e=="string"?e:e(s,o,a)}class n extends r{constructor(o,a,l){super(i(o,a,l))}}n.prototype.name=r.name,n.prototype.code=t,bce[t]=n}function Qce(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(i=>String(i)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function l_e(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function c_e(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function u_e(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}zs("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);zs("ERR_INVALID_ARG_TYPE",function(t,e,r){let i;typeof e=="string"&&l_e(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";let n;if(c_e(t," argument"))n=`The ${t} ${i} ${Qce(e,"type")}`;else{let s=u_e(t,".")?"property":"argument";n=`The "${t}" ${s} ${i} ${Qce(e,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);zs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");zs("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});zs("ERR_STREAM_PREMATURE_CLOSE","Premature close");zs("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});zs("ERR_MULTIPLE_CALLBACK","Callback called multiple times");zs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");zs("ERR_STREAM_WRITE_AFTER_END","write after end");zs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);zs("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);zs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Bce.exports.codes=bce});var QT=w((jkt,vce)=>{"use strict";var g_e=Ll().codes.ERR_INVALID_OPT_VALUE;function f_e(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function h_e(t,e,r,i){var n=f_e(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new g_e(s,n)}return Math.floor(n)}return t.objectMode?16:16*1024}vce.exports={getHighWaterMark:h_e}});var Sce=w((Ykt,vT)=>{typeof Object.create=="function"?vT.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:vT.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var Tl=w((qkt,ST)=>{try{if(kT=require("util"),typeof kT.inherits!="function")throw"";ST.exports=kT.inherits}catch(t){ST.exports=Sce()}var kT});var xce=w((Jkt,kce)=>{kce.exports=require("util").deprecate});var DT=w((Wkt,Pce)=>{"use strict";Pce.exports=jr;function Dce(t){var e=this;this.next=null,this.entry=null,this.finish=function(){p_e(e,t)}}var uh;jr.WritableState=Vm;var d_e={deprecate:xce()},Rce=yT(),Bb=require("buffer").Buffer,C_e=global.Uint8Array||function(){};function m_e(t){return Bb.from(t)}function E_e(t){return Bb.isBuffer(t)||t instanceof C_e}var xT=bT(),I_e=QT(),y_e=I_e.getHighWaterMark,Ol=Ll().codes,w_e=Ol.ERR_INVALID_ARG_TYPE,B_e=Ol.ERR_METHOD_NOT_IMPLEMENTED,b_e=Ol.ERR_MULTIPLE_CALLBACK,Q_e=Ol.ERR_STREAM_CANNOT_PIPE,v_e=Ol.ERR_STREAM_DESTROYED,S_e=Ol.ERR_STREAM_NULL_VALUES,k_e=Ol.ERR_STREAM_WRITE_AFTER_END,x_e=Ol.ERR_UNKNOWN_ENCODING,gh=xT.errorOrDestroy;Tl()(jr,Rce);function P_e(){}function Vm(t,e,r){uh=uh||Su(),t=t||{},typeof r!="boolean"&&(r=e instanceof uh),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=y_e(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){D_e(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Dce(this)}Vm.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Vm.prototype,"buffer",{get:d_e.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}})();var bb;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(bb=Function.prototype[Symbol.hasInstance],Object.defineProperty(jr,Symbol.hasInstance,{value:function(e){return bb.call(this,e)?!0:this!==jr?!1:e&&e._writableState instanceof Vm}})):bb=function(e){return e instanceof this};function jr(t){uh=uh||Su();var e=this instanceof uh;if(!e&&!bb.call(jr,this))return new jr(t);this._writableState=new Vm(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Rce.call(this)}jr.prototype.pipe=function(){gh(this,new Q_e)};function R_e(t,e){var r=new k_e;gh(t,r),process.nextTick(e,r)}function F_e(t,e,r,i){var n;return r===null?n=new S_e:typeof r!="string"&&!e.objectMode&&(n=new w_e("chunk",["string","Buffer"],r)),n?(gh(t,n),process.nextTick(i,n),!1):!0}jr.prototype.write=function(t,e,r){var i=this._writableState,n=!1,s=!i.objectMode&&E_e(t);return s&&!Bb.isBuffer(t)&&(t=m_e(t)),typeof e=="function"&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=P_e),i.ending?R_e(this,r):(s||F_e(this,i,t,r))&&(i.pendingcb++,n=N_e(this,i,s,t,e,r)),n};jr.prototype.cork=function(){this._writableState.corked++};jr.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Fce(this,t))};jr.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new x_e(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(jr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function L_e(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Bb.from(e,r)),e}Object.defineProperty(jr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N_e(t,e,r,i,n,s){if(!r){var o=L_e(e,i,n);i!==o&&(r=!0,n="buffer",i=o)}var a=e.objectMode?1:i.length;e.length+=a;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else PT(t,e,!1,a,i,n,s);return l}function PT(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new v_e("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function T_e(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(Xm,t,e),t._writableState.errorEmitted=!0,gh(t,i)):(n(i),t._writableState.errorEmitted=!0,gh(t,i),Xm(t,e))}function O_e(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function D_e(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new b_e;if(O_e(r),e)T_e(t,r,i,e,n);else{var s=Lce(r)||t.destroyed;!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Fce(t,r),i?process.nextTick(Nce,t,r,s,n):Nce(t,r,s,n)}}function Nce(t,e,r,i){r||M_e(t,e),e.pendingcb--,i(),Xm(t,e)}function M_e(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function Fce(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var o=0,a=!0;r;)n[o]=r,r.isBuf||(a=!1),r=r.next,o+=1;n.allBuffers=a,PT(t,e,!0,e.length,n,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new Dce(e),e.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,u=r.callback,g=e.objectMode?1:l.length;if(PT(t,e,!1,g,l,c,u),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}jr.prototype._write=function(t,e,r){r(new B_e("_write()"))};jr.prototype._writev=null;jr.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||K_e(this,i,r),this};Object.defineProperty(jr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Lce(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function U_e(t,e){t._final(function(r){e.pendingcb--,r&&gh(t,r),e.prefinished=!0,t.emit("prefinish"),Xm(t,e)})}function H_e(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(U_e,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function Xm(t,e){var r=Lce(e);if(r&&(H_e(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}function K_e(t,e,r){e.ending=!0,Xm(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function p_e(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(jr.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){!this._writableState||(this._writableState.destroyed=e)}});jr.prototype.destroy=xT.destroy;jr.prototype._undestroy=xT.undestroy;jr.prototype._destroy=function(t,e){e(t)}});var Su=w((zkt,Tce)=>{"use strict";var G_e=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Tce.exports=da;var Oce=RT(),FT=DT();Tl()(da,Oce);for(NT=G_e(FT.prototype),Qb=0;Qb<NT.length;Qb++)vb=NT[Qb],da.prototype[vb]||(da.prototype[vb]=FT.prototype[vb]);var NT,vb,Qb;function da(t){if(!(this instanceof da))return new da(t);Oce.call(this,t),FT.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",j_e)))}Object.defineProperty(da.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(da.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(da.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function j_e(){this._writableState.ended||process.nextTick(Y_e,this)}function Y_e(t){t.end()}Object.defineProperty(da.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Uce=w((LT,Mce)=>{var Sb=require("buffer"),bA=Sb.Buffer;function Kce(t,e){for(var r in t)e[r]=t[r]}bA.from&&bA.alloc&&bA.allocUnsafe&&bA.allocUnsafeSlow?Mce.exports=Sb:(Kce(Sb,LT),LT.Buffer=fh);function fh(t,e,r){return bA(t,e,r)}Kce(bA,fh);fh.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return bA(t,e,r)};fh.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=bA(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};fh.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return bA(t)};fh.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Sb.SlowBuffer(t)}});var MT=w(Hce=>{"use strict";var TT=Uce().Buffer,Gce=TT.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function q_e(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function J_e(t){var e=q_e(t);if(typeof e!="string"&&(TT.isEncoding===Gce||!Gce(t)))throw new Error("Unknown encoding: "+t);return e||t}Hce.StringDecoder=Zm;function Zm(t){this.encoding=J_e(t);var e;switch(this.encoding){case"utf16le":this.text=z_e,this.end=__e,e=4;break;case"utf8":this.fillLast=W_e,e=4;break;case"base64":this.text=V_e,this.end=X_e,e=3;break;default:this.write=Z_e,this.end=$_e;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=TT.allocUnsafe(e)}Zm.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Zm.prototype.end=e6e;Zm.prototype.text=t6e;Zm.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function OT(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function r6e(t,e,r){var i=e.length-1;if(i<r)return 0;var n=OT(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=OT(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=OT(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function i6e(t,e,r){if((e[0]&192)!=128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!=128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!=128)return t.lastNeed=2,"\uFFFD"}}function W_e(t){var e=this.lastTotal-this.lastNeed,r=i6e(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function t6e(t,e){var r=r6e(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function e6e(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function z_e(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function __e(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function V_e(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function X_e(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Z_e(t){return t.toString(this.encoding)}function $_e(t){return t&&t.length?this.write(t):""}});var kb=w((Vkt,jce)=>{"use strict";var Yce=Ll().codes.ERR_STREAM_PREMATURE_CLOSE;function n6e(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}function s6e(){}function o6e(t){return t.setHeader&&typeof t.abort=="function"}function qce(t,e,r){if(typeof e=="function")return qce(t,null,e);e||(e={}),r=n6e(r||s6e);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,s=function(){t.writable||a()},o=t._writableState&&t._writableState.finished,a=function(){n=!1,o=!0,i||r.call(t)},l=t._readableState&&t._readableState.endEmitted,c=function(){i=!1,l=!0,n||r.call(t)},u=function(p){r.call(t,p)},g=function(){var p;if(i&&!l)return(!t._readableState||!t._readableState.ended)&&(p=new Yce),r.call(t,p);if(n&&!o)return(!t._writableState||!t._writableState.ended)&&(p=new Yce),r.call(t,p)},f=function(){t.req.on("finish",a)};return o6e(t)?(t.on("complete",a),t.on("abort",g),t.req?f():t.on("request",f)):n&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",c),t.on("finish",a),e.error!==!1&&t.on("error",u),t.on("close",g),function(){t.removeListener("complete",a),t.removeListener("abort",g),t.removeListener("request",f),t.req&&t.req.removeListener("finish",a),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",a),t.removeListener("end",c),t.removeListener("error",u),t.removeListener("close",g)}}jce.exports=qce});var Wce=w((Xkt,Jce)=>{"use strict";var xb;function Ml(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a6e=kb(),Kl=Symbol("lastResolve"),ku=Symbol("lastReject"),$m=Symbol("error"),Pb=Symbol("ended"),xu=Symbol("lastPromise"),KT=Symbol("handlePromise"),Pu=Symbol("stream");function Ul(t,e){return{value:t,done:e}}function A6e(t){var e=t[Kl];if(e!==null){var r=t[Pu].read();r!==null&&(t[xu]=null,t[Kl]=null,t[ku]=null,e(Ul(r,!1)))}}function l6e(t){process.nextTick(A6e,t)}function c6e(t,e){return function(r,i){t.then(function(){if(e[Pb]){r(Ul(void 0,!0));return}e[KT](r,i)},i)}}var u6e=Object.getPrototypeOf(function(){}),g6e=Object.setPrototypeOf((xb={get stream(){return this[Pu]},next:function(){var e=this,r=this[$m];if(r!==null)return Promise.reject(r);if(this[Pb])return Promise.resolve(Ul(void 0,!0));if(this[Pu].destroyed)return new Promise(function(o,a){process.nextTick(function(){e[$m]?a(e[$m]):o(Ul(void 0,!0))})});var i=this[xu],n;if(i)n=new Promise(c6e(i,this));else{var s=this[Pu].read();if(s!==null)return Promise.resolve(Ul(s,!1));n=new Promise(this[KT])}return this[xu]=n,n}},Ml(xb,Symbol.asyncIterator,function(){return this}),Ml(xb,"return",function(){var e=this;return new Promise(function(r,i){e[Pu].destroy(null,function(n){if(n){i(n);return}r(Ul(void 0,!0))})})}),xb),u6e),f6e=function(e){var r,i=Object.create(g6e,(r={},Ml(r,Pu,{value:e,writable:!0}),Ml(r,Kl,{value:null,writable:!0}),Ml(r,ku,{value:null,writable:!0}),Ml(r,$m,{value:null,writable:!0}),Ml(r,Pb,{value:e._readableState.endEmitted,writable:!0}),Ml(r,KT,{value:function(s,o){var a=i[Pu].read();a?(i[xu]=null,i[Kl]=null,i[ku]=null,s(Ul(a,!1))):(i[Kl]=s,i[ku]=o)},writable:!0}),r));return i[xu]=null,a6e(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=i[ku];s!==null&&(i[xu]=null,i[Kl]=null,i[ku]=null,s(n)),i[$m]=n;return}var o=i[Kl];o!==null&&(i[xu]=null,i[Kl]=null,i[ku]=null,o(Ul(void 0,!0))),i[Pb]=!0}),e.on("readable",l6e.bind(null,i)),i};Jce.exports=f6e});var Xce=w((Zkt,zce)=>{"use strict";function _ce(t,e,r,i,n,s,o){try{var a=t[s](o),l=a.value}catch(c){r(c);return}a.done?e(l):Promise.resolve(l).then(i,n)}function h6e(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(l){_ce(s,i,n,o,a,"next",l)}function a(l){_ce(s,i,n,o,a,"throw",l)}o(void 0)})}}function Vce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function d6e(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vce(Object(r),!0).forEach(function(i){p6e(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vce(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function p6e(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var C6e=Ll().codes.ERR_INVALID_ARG_TYPE;function m6e(t,e,r){var i;if(e&&typeof e.next=="function")i=e;else if(e&&e[Symbol.asyncIterator])i=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])i=e[Symbol.iterator]();else throw new C6e("iterable",["Iterable"],e);var n=new t(d6e({objectMode:!0},r)),s=!1;n._read=function(){s||(s=!0,o())};function o(){return a.apply(this,arguments)}function a(){return a=h6e(function*(){try{var l=yield i.next(),c=l.value,u=l.done;u?n.push(null):n.push(yield c)?o():s=!1}catch(g){n.destroy(g)}}),a.apply(this,arguments)}return n}zce.exports=m6e});var RT=w((ext,Zce)=>{"use strict";Zce.exports=Ut;var hh;Ut.ReadableState=$ce;var $kt=require("events").EventEmitter,eue=function(e,r){return e.listeners(r).length},eE=yT(),Db=require("buffer").Buffer,E6e=global.Uint8Array||function(){};function I6e(t){return Db.from(t)}function y6e(t){return Db.isBuffer(t)||t instanceof E6e}var UT=require("util"),xt;UT&&UT.debuglog?xt=UT.debuglog("stream"):xt=function(){};var w6e=Ice(),HT=bT(),B6e=QT(),b6e=B6e.getHighWaterMark,Rb=Ll().codes,Q6e=Rb.ERR_INVALID_ARG_TYPE,v6e=Rb.ERR_STREAM_PUSH_AFTER_EOF,S6e=Rb.ERR_METHOD_NOT_IMPLEMENTED,k6e=Rb.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,ph,GT,jT;Tl()(Ut,eE);var tE=HT.errorOrDestroy,YT=["error","close","destroy","pause","resume"];function x6e(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function $ce(t,e,r){hh=hh||Su(),t=t||{},typeof r!="boolean"&&(r=e instanceof hh),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=b6e(this,t,"readableHighWaterMark",r),this.buffer=new w6e,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(ph||(ph=MT().StringDecoder),this.decoder=new ph(t.encoding),this.encoding=t.encoding)}function Ut(t){if(hh=hh||Su(),!(this instanceof Ut))return new Ut(t);var e=this instanceof hh;this._readableState=new $ce(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),eE.call(this)}Object.defineProperty(Ut.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){!this._readableState||(this._readableState.destroyed=e)}});Ut.prototype.destroy=HT.destroy;Ut.prototype._undestroy=HT.undestroy;Ut.prototype._destroy=function(t,e){e(t)};Ut.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Db.from(t,e),e=""),i=!0),tue(this,t,e,!1,i)};Ut.prototype.unshift=function(t){return tue(this,t,null,!0,!1)};function tue(t,e,r,i,n){xt("readableAddChunk",e);var s=t._readableState;if(e===null)s.reading=!1,D6e(t,s);else{var o;if(n||(o=P6e(s,e)),o)tE(t,o);else if(s.objectMode||e&&e.length>0)if(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==Db.prototype&&(e=I6e(e)),i)s.endEmitted?tE(t,new k6e):qT(t,s,e,!0);else if(s.ended)tE(t,new v6e);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||e.length!==0?qT(t,s,e,!1):JT(t,s)):qT(t,s,e,!1)}else i||(s.reading=!1,JT(t,s))}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function qT(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Fb(t)),JT(t,e)}function P6e(t,e){var r;return!y6e(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new Q6e("chunk",["string","Buffer","Uint8Array"],e)),r}Ut.prototype.isPaused=function(){return this._readableState.flowing===!1};Ut.prototype.setEncoding=function(t){ph||(ph=MT().StringDecoder);var e=new ph(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var rue=1073741824;function R6e(t){return t>=rue?t=rue:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function iue(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=R6e(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Ut.prototype.read=function(t){xt("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return xt("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?WT(this):Fb(this),null;if(t=iue(t,e),t===0&&e.ended)return e.length===0&&WT(this),null;var i=e.needReadable;xt("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,xt("length less than watermark",i)),e.ended||e.reading?(i=!1,xt("reading or ended",i)):i&&(xt("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=iue(r,e)));var n;return t>0?n=nue(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&WT(this)),n!==null&&this.emit("data",n),n};function D6e(t,e){if(xt("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Fb(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,sue(t)))}}function Fb(t){var e=t._readableState;xt("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(xt("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(sue,t))}function sue(t){var e=t._readableState;xt("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,zT(t)}function JT(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(F6e,t,e))}function F6e(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(xt("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}Ut.prototype._read=function(t){tE(this,new S6e("_read()"))};Ut.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,xt("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,s=n?a:m;i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(y,b){xt("onunpipe"),y===r&&b&&b.hasUnpiped===!1&&(b.hasUnpiped=!0,u())}function a(){xt("onend"),t.end()}var l=N6e(r);t.on("drain",l);var c=!1;function u(){xt("cleanup"),t.removeListener("close",h),t.removeListener("finish",p),t.removeListener("drain",l),t.removeListener("error",f),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",m),r.removeListener("data",g),c=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l()}r.on("data",g);function g(y){xt("ondata");var b=t.write(y);xt("dest.write",b),b===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&oue(i.pipes,t)!==-1)&&!c&&(xt("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function f(y){xt("onerror",y),m(),t.removeListener("error",f),eue(t,"error")===0&&tE(t,y)}x6e(t,"error",f);function h(){t.removeListener("finish",p),m()}t.once("close",h);function p(){xt("onfinish"),t.removeListener("close",h),m()}t.once("finish",p);function m(){xt("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(xt("pipe resume"),r.resume()),t};function N6e(t){return function(){var r=t._readableState;xt("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&eue(t,"data")&&(r.flowing=!0,zT(t))}}Ut.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=oue(e.pipes,t);return o===-1?this:(e.pipes.splice(o,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};Ut.prototype.on=function(t,e){var r=eE.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,xt("on readable",i.length,i.reading),i.length?Fb(this):i.reading||process.nextTick(L6e,this)),r};Ut.prototype.addListener=Ut.prototype.on;Ut.prototype.removeListener=function(t,e){var r=eE.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(aue,this),r};Ut.prototype.removeAllListeners=function(t){var e=eE.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(aue,this),e};function aue(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function L6e(t){xt("readable nexttick read 0"),t.read(0)}Ut.prototype.resume=function(){var t=this._readableState;return t.flowing||(xt("resume"),t.flowing=!t.readableListening,T6e(this,t)),t.paused=!1,this};function T6e(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(O6e,t,e))}function O6e(t,e){xt("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),zT(t),e.flowing&&!e.reading&&t.read(0)}Ut.prototype.pause=function(){return xt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(xt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function zT(t){var e=t._readableState;for(xt("flow",e.flowing);e.flowing&&t.read()!==null;);}Ut.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(xt("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&e.push(o)}e.push(null)}),t.on("data",function(o){if(xt("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var a=e.push(o);a||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=function(a){return function(){return t[a].apply(t,arguments)}}(n));for(var s=0;s<YT.length;s++)t.on(YT[s],this.emit.bind(this,YT[s]));return this._read=function(o){xt("wrapped _read",o),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(Ut.prototype[Symbol.asyncIterator]=function(){return GT===void 0&&(GT=Wce()),GT(this)});Object.defineProperty(Ut.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Ut.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Ut.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});Ut._fromList=nue;Object.defineProperty(Ut.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function nue(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function WT(t){var e=t._readableState;xt("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(M6e,e,t))}function M6e(t,e){if(xt("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(Ut.from=function(t,e){return jT===void 0&&(jT=Xce()),jT(Ut,t,e)});function oue(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}});var _T=w((txt,Aue)=>{"use strict";Aue.exports=QA;var Nb=Ll().codes,K6e=Nb.ERR_METHOD_NOT_IMPLEMENTED,U6e=Nb.ERR_MULTIPLE_CALLBACK,H6e=Nb.ERR_TRANSFORM_ALREADY_TRANSFORMING,G6e=Nb.ERR_TRANSFORM_WITH_LENGTH_0,Lb=Su();Tl()(QA,Lb);function j6e(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new U6e);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function QA(t){if(!(this instanceof QA))return new QA(t);Lb.call(this,t),this._transformState={afterTransform:j6e.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Y6e)}function Y6e(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){lue(t,e,r)}):lue(this,null,null)}QA.prototype.push=function(t,e){return this._transformState.needTransform=!1,Lb.prototype.push.call(this,t,e)};QA.prototype._transform=function(t,e,r){r(new K6e("_transform()"))};QA.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};QA.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};QA.prototype._destroy=function(t,e){Lb.prototype._destroy.call(this,t,function(r){e(r)})};function lue(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new G6e;if(t._transformState.transforming)throw new H6e;return t.push(null)}});var gue=w((rxt,cue)=>{"use strict";cue.exports=rE;var uue=_T();Tl()(rE,uue);function rE(t){if(!(this instanceof rE))return new rE(t);uue.call(this,t)}rE.prototype._transform=function(t,e,r){r(null,t)}});var Cue=w((ixt,fue)=>{"use strict";var VT;function q6e(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var hue=Ll().codes,J6e=hue.ERR_MISSING_ARGS,W6e=hue.ERR_STREAM_DESTROYED;function pue(t){if(t)throw t}function z6e(t){return t.setHeader&&typeof t.abort=="function"}function _6e(t,e,r,i){i=q6e(i);var n=!1;t.on("close",function(){n=!0}),VT===void 0&&(VT=kb()),VT(t,{readable:e,writable:r},function(o){if(o)return i(o);n=!0,i()});var s=!1;return function(o){if(!n&&!s){if(s=!0,z6e(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(o||new W6e("pipe"))}}}function due(t){t()}function V6e(t,e){return t.pipe(e)}function X6e(t){return!t.length||typeof t[t.length-1]!="function"?pue:t.pop()}function Z6e(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=X6e(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new J6e("streams");var n,s=e.map(function(o,a){var l=a<e.length-1,c=a>0;return _6e(o,l,c,function(u){n||(n=u),u&&s.forEach(due),!l&&(s.forEach(due),i(n))})});return e.reduce(V6e)}fue.exports=Z6e});var dh=w((_s,iE)=>{var nE=require("stream");process.env.READABLE_STREAM==="disable"&&nE?(iE.exports=nE.Readable,Object.assign(iE.exports,nE),iE.exports.Stream=nE):(_s=iE.exports=RT(),_s.Stream=nE||_s,_s.Readable=_s,_s.Writable=DT(),_s.Duplex=Su(),_s.Transform=_T(),_s.PassThrough=gue(),_s.finished=kb(),_s.pipeline=Cue())});var Iue=w((nxt,mue)=>{"use strict";var{Buffer:Qo}=require("buffer"),Eue=Symbol.for("BufferList");function mr(t){if(!(this instanceof mr))return new mr(t);mr._init.call(this,t)}mr._init=function(e){Object.defineProperty(this,Eue,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};mr.prototype._new=function(e){return new mr(e)};mr.prototype._offset=function(e){if(e===0)return[0,0];let r=0;for(let i=0;i<this._bufs.length;i++){let n=r+this._bufs[i].length;if(e<n||i===this._bufs.length-1)return[i,e-r];r=n}};mr.prototype._reverseOffset=function(t){let e=t[0],r=t[1];for(let i=0;i<e;i++)r+=this._bufs[i].length;return r};mr.prototype.get=function(e){if(e>this.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};mr.prototype.slice=function(e,r){return typeof e=="number"&&e<0&&(e+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,e,r)};mr.prototype.copy=function(e,r,i,n){if((typeof i!="number"||i<0)&&(i=0),(typeof n!="number"||n>this.length)&&(n=this.length),i>=this.length||n<=0)return e||Qo.alloc(0);let s=!!e,o=this._offset(i),a=n-i,l=a,c=s&&r||0,u=o[1];if(i===0&&n===this.length){if(!s)return this._bufs.length===1?this._bufs[0]:Qo.concat(this._bufs,this.length);for(let g=0;g<this._bufs.length;g++)this._bufs[g].copy(e,c),c+=this._bufs[g].length;return e}if(l<=this._bufs[o[0]].length-u)return s?this._bufs[o[0]].copy(e,r,u,u+l):this._bufs[o[0]].slice(u,u+l);s||(e=Qo.allocUnsafe(a));for(let g=o[0];g<this._bufs.length;g++){let f=this._bufs[g].length-u;if(l>f)this._bufs[g].copy(e,c,u),c+=f;else{this._bufs[g].copy(e,c,u,u+l),c+=f;break}l-=f,u&&(u=0)}return e.length>c?e.slice(0,c):e};mr.prototype.shallowSlice=function(e,r){if(e=e||0,r=typeof r!="number"?this.length:r,e<0&&(e+=this.length),r<0&&(r+=this.length),e===r)return this._new();let i=this._offset(e),n=this._offset(r),s=this._bufs.slice(i[0],n[0]+1);return n[1]===0?s.pop():s[s.length-1]=s[s.length-1].slice(0,n[1]),i[1]!==0&&(s[0]=s[0].slice(i[1])),this._new(s)};mr.prototype.toString=function(e,r,i){return this.slice(r,i).toString(e)};mr.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;)if(e>=this._bufs[0].length)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};mr.prototype.duplicate=function(){let e=this._new();for(let r=0;r<this._bufs.length;r++)e.append(this._bufs[r]);return e};mr.prototype.append=function(e){if(e==null)return this;if(e.buffer)this._appendBuffer(Qo.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let r=0;r<e.length;r++)this.append(e[r]);else if(this._isBufferList(e))for(let r=0;r<e._bufs.length;r++)this.append(e._bufs[r]);else typeof e=="number"&&(e=e.toString()),this._appendBuffer(Qo.from(e));return this};mr.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length};mr.prototype.indexOf=function(t,e,r){if(r===void 0&&typeof e=="string"&&(r=e,e=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=Qo.from([t]):typeof t=="string"?t=Qo.from(t,r):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=Qo.from(t.buffer,t.byteOffset,t.byteLength):Qo.isBuffer(t)||(t=Qo.from(t)),e=Number(e||0),isNaN(e)&&(e=0),e<0&&(e=this.length+e),e<0&&(e=0),t.length===0)return e>this.length?this.length:e;let i=this._offset(e),n=i[0],s=i[1];for(;n<this._bufs.length;n++){let o=this._bufs[n];for(;s<o.length;)if(o.length-s>=t.length){let l=o.indexOf(t,s);if(l!==-1)return this._reverseOffset([n,l]);s=o.length-t.length+1}else{let l=this._reverseOffset([n,s]);if(this._match(l,t))return l;s++}s=0}return-1};mr.prototype._match=function(t,e){if(this.length-t<e.length)return!1;for(let r=0;r<e.length;r++)if(this.get(t+r)!==e[r])return!1;return!0};(function(){let t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let e in t)(function(r){t[r]===null?mr.prototype[r]=function(i,n){return this.slice(i,i+n)[r](0,n)}:mr.prototype[r]=function(i=0){return this.slice(i,i+t[r])[r](0)}})(e)})();mr.prototype._isBufferList=function(e){return e instanceof mr||mr.isBufferList(e)};mr.isBufferList=function(e){return e!=null&&e[Eue]};mue.exports=mr});var yue=w((sxt,Tb)=>{"use strict";var XT=dh().Duplex,$6e=Tl(),sE=Iue();function Zi(t){if(!(this instanceof Zi))return new Zi(t);if(typeof t=="function"){this._callback=t;let e=function(i){this._callback&&(this._callback(i),this._callback=null)}.bind(this);this.on("pipe",function(i){i.on("error",e)}),this.on("unpipe",function(i){i.removeListener("error",e)}),t=null}sE._init.call(this,t),XT.call(this)}$6e(Zi,XT);Object.assign(Zi.prototype,sE.prototype);Zi.prototype._new=function(e){return new Zi(e)};Zi.prototype._write=function(e,r,i){this._appendBuffer(e),typeof i=="function"&&i()};Zi.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)};Zi.prototype.end=function(e){XT.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};Zi.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e)};Zi.prototype._isBufferList=function(e){return e instanceof Zi||e instanceof sE||Zi.isBufferList(e)};Zi.isBufferList=sE.isBufferList;Tb.exports=Zi;Tb.exports.BufferListStream=Zi;Tb.exports.BufferList=sE});var eO=w(Ch=>{var eVe=Buffer.alloc,tVe="0000000000000000000",rVe="7777777777777777777",wue="0".charCodeAt(0),Bue=Buffer.from("ustar\0","binary"),iVe=Buffer.from("00","binary"),nVe=Buffer.from("ustar ","binary"),sVe=Buffer.from(" \0","binary"),oVe=parseInt("7777",8),oE=257,ZT=263,aVe=function(t,e,r){return typeof t!="number"?r:(t=~~t,t>=e?e:t>=0||(t+=e,t>=0)?t:0)},AVe=function(t){switch(t){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},lVe=function(t){switch(t){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},bue=function(t,e,r,i){for(;r<i;r++)if(t[r]===e)return r;return i},Que=function(t){for(var e=8*32,r=0;r<148;r++)e+=t[r];for(var i=156;i<512;i++)e+=t[i];return e},Hl=function(t,e){return t=t.toString(8),t.length>e?rVe.slice(0,e)+" ":tVe.slice(0,e-t.length)+t+" "};function cVe(t){var e;if(t[0]===128)e=!0;else if(t[0]===255)e=!1;else return null;for(var r=[],i=t.length-1;i>0;i--){var n=t[i];e?r.push(n):r.push(255-n)}var s=0,o=r.length;for(i=0;i<o;i++)s+=r[i]*Math.pow(256,i);return e?s:-1*s}var Gl=function(t,e,r){if(t=t.slice(e,e+r),e=0,t[e]&128)return cVe(t);for(;e<t.length&&t[e]===32;)e++;for(var i=aVe(bue(t,32,e,t.length),t.length,t.length);e<i&&t[e]===0;)e++;return i===e?0:parseInt(t.slice(e,i).toString(),8)},mh=function(t,e,r,i){return t.slice(e,bue(t,0,e,e+r)).toString(i)},$T=function(t){var e=Buffer.byteLength(t),r=Math.floor(Math.log(e)/Math.log(10))+1;return e+r>=Math.pow(10,r)&&r++,e+r+t};Ch.decodeLongPath=function(t,e){return mh(t,0,t.length,e)};Ch.encodePax=function(t){var e="";t.name&&(e+=$T(" path="+t.name+`
`)),t.linkname&&(e+=$T(" linkpath="+t.linkname+`
`));var r=t.pax;if(r)for(var i in r)e+=$T(" "+i+"="+r[i]+`
`);return Buffer.from(e)};Ch.decodePax=function(t){for(var e={};t.length;){for(var r=0;r<t.length&&t[r]!==32;)r++;var i=parseInt(t.slice(0,r).toString(),10);if(!i)return e;var n=t.slice(r+1,i-1).toString(),s=n.indexOf("=");if(s===-1)return e;e[n.slice(0,s)]=n.slice(s+1),t=t.slice(i)}return e};Ch.encode=function(t){var e=eVe(512),r=t.name,i="";if(t.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var n=r.indexOf("/");if(n===-1)return null;i+=i?"/"+r.slice(0,n):r.slice(0,n),r=r.slice(n+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(i)>155||t.linkname&&Buffer.byteLength(t.linkname)>100?null:(e.write(r),e.write(Hl(t.mode&oVe,6),100),e.write(Hl(t.uid,6),108),e.write(Hl(t.gid,6),116),e.write(Hl(t.size,11),124),e.write(Hl(t.mtime.getTime()/1e3|0,11),136),e[156]=wue+lVe(t.type),t.linkname&&e.write(t.linkname,157),Bue.copy(e,oE),iVe.copy(e,ZT),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(Hl(t.devmajor||0,6),329),e.write(Hl(t.devminor||0,6),337),i&&e.write(i,345),e.write(Hl(Que(e),6),148),e)};Ch.decode=function(t,e,r){var i=t[156]===0?0:t[156]-wue,n=mh(t,0,100,e),s=Gl(t,100,8),o=Gl(t,108,8),a=Gl(t,116,8),l=Gl(t,124,12),c=Gl(t,136,12),u=AVe(i),g=t[157]===0?null:mh(t,157,100,e),f=mh(t,265,32),h=mh(t,297,32),p=Gl(t,329,8),m=Gl(t,337,8),y=Que(t);if(y===8*32)return null;if(y!==Gl(t,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(Bue.compare(t,oE,oE+6)===0)t[345]&&(n=mh(t,345,155,e)+"/"+n);else if(!(nVe.compare(t,oE,oE+6)===0&&sVe.compare(t,ZT,ZT+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return i===0&&n&&n[n.length-1]==="/"&&(i=5),{name:n,mode:s,uid:o,gid:a,size:l,mtime:new Date(1e3*c),type:u,linkname:g,uname:f,gname:h,devmajor:p,devminor:m}}});var Rue=w((axt,vue)=>{var Sue=require("util"),uVe=yue(),aE=eO(),kue=dh().Writable,xue=dh().PassThrough,Pue=function(){},Due=function(t){return t&=511,t&&512-t},gVe=function(t,e){var r=new Ob(t,e);return r.end(),r},fVe=function(t,e){return e.path&&(t.name=e.path),e.linkpath&&(t.linkname=e.linkpath),e.size&&(t.size=parseInt(e.size,10)),t.pax=e,t},Ob=function(t,e){this._parent=t,this.offset=e,xue.call(this,{autoDestroy:!1})};Sue.inherits(Ob,xue);Ob.prototype.destroy=function(t){this._parent.destroy(t)};var vA=function(t){if(!(this instanceof vA))return new vA(t);kue.call(this,t),t=t||{},this._offset=0,this._buffer=uVe(),this._missing=0,this._partial=!1,this._onparse=Pue,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var e=this,r=e._buffer,i=function(){e._continue()},n=function(f){if(e._locked=!1,f)return e.destroy(f);e._stream||i()},s=function(){e._stream=null;var f=Due(e._header.size);f?e._parse(f,o):e._parse(512,g),e._locked||i()},o=function(){e._buffer.consume(Due(e._header.size)),e._parse(512,g),i()},a=function(){var f=e._header.size;e._paxGlobal=aE.decodePax(r.slice(0,f)),r.consume(f),s()},l=function(){var f=e._header.size;e._pax=aE.decodePax(r.slice(0,f)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),r.consume(f),s()},c=function(){var f=e._header.size;this._gnuLongPath=aE.decodeLongPath(r.slice(0,f),t.filenameEncoding),r.consume(f),s()},u=function(){var f=e._header.size;this._gnuLongLinkPath=aE.decodeLongPath(r.slice(0,f),t.filenameEncoding),r.consume(f),s()},g=function(){var f=e._offset,h;try{h=e._header=aE.decode(r.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(p){e.emit("error",p)}if(r.consume(512),!h){e._parse(512,g),i();return}if(h.type==="gnu-long-path"){e._parse(h.size,c),i();return}if(h.type==="gnu-long-link-path"){e._parse(h.size,u),i();return}if(h.type==="pax-global-header"){e._parse(h.size,a),i();return}if(h.type==="pax-header"){e._parse(h.size,l),i();return}if(e._gnuLongPath&&(h.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(h.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=h=fVe(h,e._pax),e._pax=null),e._locked=!0,!h.size||h.type==="directory"){e._parse(512,g),e.emit("entry",h,gVe(e,f),n);return}e._stream=new Ob(e,f),e.emit("entry",h,e._stream,n),e._parse(h.size,s),i()};this._onheader=g,this._parse(512,g)};Sue.inherits(vA,kue);vA.prototype.destroy=function(t){this._destroyed||(this._destroyed=!0,t&&this.emit("error",t),this.emit("close"),this._stream&&this._stream.emit("close"))};vA.prototype._parse=function(t,e){this._destroyed||(this._offset+=t,this._missing=t,e===this._onheader&&(this._partial=!1),this._onparse=e)};vA.prototype._continue=function(){if(!this._destroyed){var t=this._cb;this._cb=Pue,this._overflow?this._write(this._overflow,void 0,t):t()}};vA.prototype._write=function(t,e,r){if(!this._destroyed){var i=this._stream,n=this._buffer,s=this._missing;if(t.length&&(this._partial=!0),t.length<s)return this._missing-=t.length,this._overflow=null,i?i.write(t,r):(n.append(t),r());this._cb=r,this._missing=0;var o=null;t.length>s&&(o=t.slice(s),t=t.slice(0,s)),i?i.end(t):n.append(t),this._overflow=o,this._onparse()}};vA.prototype._final=function(t){if(this._partial)return this.destroy(new Error("Unexpected end of data"));t()};vue.exports=vA});var Nue=w((Axt,Fue)=>{Fue.exports=require("fs").constants||require("constants")});var Kue=w((lxt,Lue)=>{var Eh=Nue(),Tue=Vx(),Mb=Tl(),hVe=Buffer.alloc,Oue=dh().Readable,Ih=dh().Writable,pVe=require("string_decoder").StringDecoder,Kb=eO(),dVe=parseInt("755",8),CVe=parseInt("644",8),Mue=hVe(1024),tO=function(){},rO=function(t,e){e&=511,e&&t.push(Mue.slice(0,512-e))};function mVe(t){switch(t&Eh.S_IFMT){case Eh.S_IFBLK:return"block-device";case Eh.S_IFCHR:return"character-device";case Eh.S_IFDIR:return"directory";case Eh.S_IFIFO:return"fifo";case Eh.S_IFLNK:return"symlink"}return"file"}var Ub=function(t){Ih.call(this),this.written=0,this._to=t,this._destroyed=!1};Mb(Ub,Ih);Ub.prototype._write=function(t,e,r){if(this.written+=t.length,this._to.push(t))return r();this._to._drain=r};Ub.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Hb=function(){Ih.call(this),this.linkname="",this._decoder=new pVe("utf-8"),this._destroyed=!1};Mb(Hb,Ih);Hb.prototype._write=function(t,e,r){this.linkname+=this._decoder.write(t),r()};Hb.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var AE=function(){Ih.call(this),this._destroyed=!1};Mb(AE,Ih);AE.prototype._write=function(t,e,r){r(new Error("No body allowed for this entry"))};AE.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Ca=function(t){if(!(this instanceof Ca))return new Ca(t);Oue.call(this,t),this._drain=tO,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};Mb(Ca,Oue);Ca.prototype.entry=function(t,e,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof e=="function"&&(r=e,e=null),r||(r=tO);var i=this;if((!t.size||t.type==="symlink")&&(t.size=0),t.type||(t.type=mVe(t.mode)),t.mode||(t.mode=t.type==="directory"?dVe:CVe),t.uid||(t.uid=0),t.gid||(t.gid=0),t.mtime||(t.mtime=new Date),typeof e=="string"&&(e=Buffer.from(e)),Buffer.isBuffer(e)){t.size=e.length,this._encode(t);var n=this.push(e);return rO(i,t.size),n?process.nextTick(r):this._drain=r,new AE}if(t.type==="symlink"&&!t.linkname){var s=new Hb;return Tue(s,function(a){if(a)return i.destroy(),r(a);t.linkname=s.linkname,i._encode(t),r()}),s}if(this._encode(t),t.type!=="file"&&t.type!=="contiguous-file")return process.nextTick(r),new AE;var o=new Ub(this);return this._stream=o,Tue(o,function(a){if(i._stream=null,a)return i.destroy(),r(a);if(o.written!==t.size)return i.destroy(),r(new Error("size mismatch"));rO(i,t.size),i._finalizing&&i.finalize(),r()}),o}};Ca.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(Mue),this.push(null))};Ca.prototype.destroy=function(t){this._destroyed||(this._destroyed=!0,t&&this.emit("error",t),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};Ca.prototype._encode=function(t){if(!t.pax){var e=Kb.encode(t);if(e){this.push(e);return}}this._encodePax(t)};Ca.prototype._encodePax=function(t){var e=Kb.encodePax({name:t.name,linkname:t.linkname,pax:t.pax}),r={name:"PaxHeader",mode:t.mode,uid:t.uid,gid:t.gid,size:e.length,mtime:t.mtime,type:"pax-header",linkname:t.linkname&&"PaxHeader",uname:t.uname,gname:t.gname,devmajor:t.devmajor,devminor:t.devminor};this.push(Kb.encode(r)),this.push(e),rO(this,e.length),r.size=t.size,r.type=t.type,this.push(Kb.encode(r))};Ca.prototype._read=function(t){var e=this._drain;this._drain=tO,e()};Lue.exports=Ca});var Uue=w(iO=>{iO.extract=Rue();iO.pack=Kue()});var $ue=w((Rxt,_ue)=>{"use strict";var yh=class{constructor(e,r,i){this.__specs=e||{},Object.keys(this.__specs).forEach(n=>{if(typeof this.__specs[n]=="string"){let s=this.__specs[n],o=this.__specs[s];if(o){let a=o.aliases||[];a.push(n,s),o.aliases=[...new Set(a)],this.__specs[n]=o}else throw new Error(`Alias refers to invalid key: ${s} -> ${n}`)}}),this.__opts=r||{},this.__providers=Xue(i.filter(n=>n!=null&&typeof n=="object")),this.__isFiggyPudding=!0}get(e){return lO(this,e,!0)}get[Symbol.toStringTag](){return"FiggyPudding"}forEach(e,r=this){for(let[i,n]of this.entries())e.call(r,n,i,this)}toJSON(){let e={};return this.forEach((r,i)=>{e[i]=r}),e}*entries(e){for(let i of Object.keys(this.__specs))yield[i,this.get(i)];let r=e||this.__opts.other;if(r){let i=new Set;for(let n of this.__providers){let s=n.entries?n.entries(r):DVe(n);for(let[o,a]of s)r(o)&&!i.has(o)&&(i.add(o),yield[o,a])}}}*[Symbol.iterator](){for(let[e,r]of this.entries())yield[e,r]}*keys(){for(let[e]of this.entries())yield e}*values(){for(let[,e]of this.entries())yield e}concat(...e){return new Proxy(new yh(this.__specs,this.__opts,Xue(this.__providers).concat(e)),Vue)}};try{let t=require("util");yh.prototype[t.inspect.custom]=function(e,r){return this[Symbol.toStringTag]+" "+t.inspect(this.toJSON(),r)}}catch(t){}function RVe(t){throw Object.assign(new Error(`invalid config key requested: ${t}`),{code:"EBADKEY"})}function lO(t,e,r){let i=t.__specs[e];if(r&&!i&&(!t.__opts.other||!t.__opts.other(e)))RVe(e);else{i||(i={});let n;for(let s of t.__providers){if(n=Zue(e,s),n===void 0&&i.aliases&&i.aliases.length){for(let o of i.aliases)if(o!==e&&(n=Zue(o,s),n!==void 0))break}if(n!==void 0)break}return n===void 0&&i.default!==void 0?typeof i.default=="function"?i.default(t):i.default:n}}function Zue(t,e){let r;return e.__isFiggyPudding?r=lO(e,t,!1):typeof e.get=="function"?r=e.get(t):r=e[t],r}var Vue={has(t,e){return e in t.__specs&&lO(t,e,!1)!==void 0},ownKeys(t){return Object.keys(t.__specs)},get(t,e){return typeof e=="symbol"||e.slice(0,2)==="__"||e in yh.prototype?t[e]:t.get(e)},set(t,e,r){if(typeof e=="symbol"||e.slice(0,2)==="__")return t[e]=r,!0;throw new Error("figgyPudding options cannot be modified. Use .concat() instead.")},deleteProperty(){throw new Error("figgyPudding options cannot be deleted. Use .concat() and shadow them instead.")}};_ue.exports=FVe;function FVe(t,e){function r(...i){return new Proxy(new yh(t,e,i),Vue)}return r}function Xue(t){let e=[];return t.forEach(r=>e.unshift(r)),e}function DVe(t){return Object.keys(t).map(e=>[e,t[e]])}});var rge=w((Fxt,ma)=>{"use strict";var cE=require("crypto"),NVe=$ue(),LVe=require("stream").Transform,ege=["sha256","sha384","sha512"],TVe=/^[a-z0-9+/]+(?:=?=?)$/i,OVe=/^([^-]+)-([^?]+)([?\S*]*)$/,MVe=/^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/,KVe=/^[\x21-\x7E]+$/,Cn=NVe({algorithms:{default:["sha512"]},error:{default:!1},integrity:{},options:{default:[]},pickAlgorithm:{default:()=>UVe},Promise:{default:()=>Promise},sep:{default:" "},single:{default:!1},size:{},strict:{default:!1}}),Du=class{get isHash(){return!0}constructor(e,r){r=Cn(r);let i=!!r.strict;this.source=e.trim();let n=this.source.match(i?MVe:OVe);if(!n||i&&!ege.some(o=>o===n[1]))return;this.algorithm=n[1],this.digest=n[2];let s=n[3];this.options=s?s.slice(1).split("?"):[]}hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toString("hex")}toJSON(){return this.toString()}toString(e){if(e=Cn(e),e.strict&&!(ege.some(i=>i===this.algorithm)&&this.digest.match(TVe)&&(this.options||[]).every(i=>i.match(KVe))))return"";let r=this.options&&this.options.length?`?${this.options.join("?")}`:"";return`${this.algorithm}-${this.digest}${r}`}},wh=class{get isIntegrity(){return!0}toJSON(){return this.toString()}toString(e){e=Cn(e);let r=e.sep||" ";return e.strict&&(r=r.replace(/\S+/g," ")),Object.keys(this).map(i=>this[i].map(n=>Du.prototype.toString.call(n,e)).filter(n=>n.length).join(r)).filter(i=>i.length).join(r)}concat(e,r){r=Cn(r);let i=typeof e=="string"?e:uE(e,r);return Ea(`${this.toString(r)} ${i}`,r)}hexDigest(){return Ea(this,{single:!0}).hexDigest()}match(e,r){r=Cn(r);let i=Ea(e,r),n=i.pickAlgorithm(r);return this[n]&&i[n]&&this[n].find(s=>i[n].find(o=>s.digest===o.digest))||!1}pickAlgorithm(e){e=Cn(e);let r=e.pickAlgorithm,i=Object.keys(this);if(!i.length)throw new Error(`No algorithms available for ${JSON.stringify(this.toString())}`);return i.reduce((n,s)=>r(n,s)||n)}};ma.exports.parse=Ea;function Ea(t,e){if(e=Cn(e),typeof t=="string")return cO(t,e);if(t.algorithm&&t.digest){let r=new wh;return r[t.algorithm]=[t],cO(uE(r,e),e)}else return cO(uE(t,e),e)}function cO(t,e){return e.single?new Du(t,e):t.trim().split(/\s+/).reduce((r,i)=>{let n=new Du(i,e);if(n.algorithm&&n.digest){let s=n.algorithm;r[s]||(r[s]=[]),r[s].push(n)}return r},new wh)}ma.exports.stringify=uE;function uE(t,e){return e=Cn(e),t.algorithm&&t.digest?Du.prototype.toString.call(t,e):typeof t=="string"?uE(Ea(t,e),e):wh.prototype.toString.call(t,e)}ma.exports.fromHex=HVe;function HVe(t,e,r){r=Cn(r);let i=r.options&&r.options.length?`?${r.options.join("?")}`:"";return Ea(`${e}-${Buffer.from(t,"hex").toString("base64")}${i}`,r)}ma.exports.fromData=GVe;function GVe(t,e){e=Cn(e);let r=e.algorithms,i=e.options&&e.options.length?`?${e.options.join("?")}`:"";return r.reduce((n,s)=>{let o=cE.createHash(s).update(t).digest("base64"),a=new Du(`${s}-${o}${i}`,e);if(a.algorithm&&a.digest){let l=a.algorithm;n[l]||(n[l]=[]),n[l].push(a)}return n},new wh)}ma.exports.fromStream=jVe;function jVe(t,e){e=Cn(e);let r=e.Promise||Promise,i=uO(e);return new r((n,s)=>{t.pipe(i),t.on("error",s),i.on("error",s);let o;i.on("integrity",a=>{o=a}),i.on("end",()=>n(o)),i.on("data",()=>{})})}ma.exports.checkData=YVe;function YVe(t,e,r){if(r=Cn(r),e=Ea(e,r),!Object.keys(e).length){if(r.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let i=e.pickAlgorithm(r),n=cE.createHash(i).update(t).digest("base64"),s=Ea({algorithm:i,digest:n}),o=s.match(e,r);if(o||!r.error)return o;if(typeof r.size=="number"&&t.length!==r.size){let a=new Error(`data size mismatch when checking ${e}.
  Wanted: ${r.size}
  Found: ${t.length}`);throw a.code="EBADSIZE",a.found=t.length,a.expected=r.size,a.sri=e,a}else{let a=new Error(`Integrity checksum failed when using ${i}: Wanted ${e}, but got ${s}. (${t.length} bytes)`);throw a.code="EINTEGRITY",a.found=s,a.expected=e,a.algorithm=i,a.sri=e,a}}ma.exports.checkStream=qVe;function qVe(t,e,r){r=Cn(r);let i=r.Promise||Promise,n=uO(r.concat({integrity:e}));return new i((s,o)=>{t.pipe(n),t.on("error",o),n.on("error",o);let a;n.on("verified",l=>{a=l}),n.on("end",()=>s(a)),n.on("data",()=>{})})}ma.exports.integrityStream=uO;function uO(t){t=Cn(t);let e=t.integrity&&Ea(t.integrity,t),r=e&&Object.keys(e).length,i=r&&e.pickAlgorithm(t),n=r&&e[i],s=Array.from(new Set(t.algorithms.concat(i?[i]:[]))),o=s.map(cE.createHash),a=0,l=new LVe({transform(c,u,g){a+=c.length,o.forEach(f=>f.update(c,u)),g(null,c,u)}}).on("end",()=>{let c=t.options&&t.options.length?`?${t.options.join("?")}`:"",u=Ea(o.map((f,h)=>`${s[h]}-${f.digest("base64")}${c}`).join(" "),t),g=r&&u.match(e,t);if(typeof t.size=="number"&&a!==t.size){let f=new Error(`stream size mismatch when checking ${e}.
  Wanted: ${t.size}
  Found: ${a}`);f.code="EBADSIZE",f.found=a,f.expected=t.size,f.sri=e,l.emit("error",f)}else if(t.integrity&&!g){let f=new Error(`${e} integrity checksum failed when using ${i}: wanted ${n} but got ${u}. (${a} bytes)`);f.code="EINTEGRITY",f.found=u,f.expected=n,f.algorithm=i,f.sri=e,l.emit("error",f)}else l.emit("size",a),l.emit("integrity",u),g&&l.emit("verified",g)});return l}ma.exports.create=JVe;function JVe(t){t=Cn(t);let e=t.algorithms,r=t.options.length?`?${t.options.join("?")}`:"",i=e.map(cE.createHash);return{update:function(n,s){return i.forEach(o=>o.update(n,s)),this},digest:function(n){return e.reduce((o,a)=>{let l=i.shift().digest("base64"),c=new Du(`${a}-${l}${r}`,t);if(c.algorithm&&c.digest){let u=c.algorithm;o[u]||(o[u]=[]),o[u].push(c)}return o},new wh)}}}var WVe=new Set(cE.getHashes()),tge=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(t=>WVe.has(t));function UVe(t,e){return tge.indexOf(t.toLowerCase())>=tge.indexOf(e.toLowerCase())?t:e}});var vC={};ft(vC,{BuildType:()=>ls,Cache:()=>Nt,Configuration:()=>we,DEFAULT_LOCK_FILENAME:()=>Qx,DEFAULT_RC_FILENAME:()=>bx,FormatType:()=>Di,InstallMode:()=>di,LightReport:()=>gA,LinkType:()=>Qt,Manifest:()=>At,MessageName:()=>$,MultiFetcher:()=>wd,PackageExtensionStatus:()=>qi,PackageExtensionType:()=>yi,Project:()=>ze,ProjectLookup:()=>al,Report:()=>Ji,ReportError:()=>ct,SettingsType:()=>ye,StreamReport:()=>Je,TAG_REGEXP:()=>qg,TelemetryManager:()=>QC,ThrowReport:()=>pi,VirtualFetcher:()=>bd,Workspace:()=>bC,WorkspaceFetcher:()=>Qd,WorkspaceResolver:()=>oi,YarnVersion:()=>Kr,execUtils:()=>Fr,folderUtils:()=>Cx,formatUtils:()=>Ae,hashUtils:()=>Dn,httpUtils:()=>ir,miscUtils:()=>ve,nodeUtils:()=>Wg,parseMessageName:()=>bI,scriptUtils:()=>Zt,semverUtils:()=>Wt,stringifyMessageName:()=>qA,structUtils:()=>P,tgzUtils:()=>wi,treeUtils:()=>As});var Fr={};ft(Fr,{EndStrategy:()=>ns,ExecError:()=>Rx,PipeError:()=>vw,execvp:()=>mke,pipevp:()=>$o});var $h={};ft($h,{AliasFS:()=>Da,CwdFS:()=>_t,DEFAULT_COMPRESSION_LEVEL:()=>nc,FakeFS:()=>HA,Filename:()=>Pt,JailFS:()=>Ra,LazyFS:()=>Vh,LinkStrategy:()=>Yh,NoFS:()=>_E,NodeFS:()=>ar,PortablePath:()=>Ke,PosixFS:()=>Xh,ProxiedFS:()=>bi,VirtualFS:()=>Wr,ZipFS:()=>Ai,ZipOpenFS:()=>Es,constants:()=>Dr,extendFs:()=>XE,normalizeLineEndings:()=>ec,npath:()=>H,opendir:()=>JE,patchFs:()=>SQ,ppath:()=>x,statUtils:()=>hQ,toFilename:()=>Jr,xfs:()=>K});var Dr={};ft(Dr,{SAFE_TIME:()=>fQ,S_IFDIR:()=>ka,S_IFLNK:()=>Pa,S_IFMT:()=>_n,S_IFREG:()=>xa});var _n=61440,ka=16384,xa=32768,Pa=40960,fQ=456789e3;var hQ={};ft(hQ,{BigIntStatsEntry:()=>Hh,DEFAULT_MODE:()=>Uh,DirEntry:()=>oM,StatEntry:()=>KA,areStatsEqual:()=>dQ,clearStats:()=>KE,convertToBigIntStats:()=>UE,makeDefaultStats:()=>Gh,makeEmptyStats:()=>pfe});var pQ=ge(require("util"));var Uh=xa|420,oM=class{constructor(){this.name="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&_n)===ka}isFIFO(){return!1}isFile(){return(this.mode&_n)===xa}isSocket(){return!1}isSymbolicLink(){return(this.mode&_n)===Pa}},KA=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=0;this.ino=0;this.mode=Uh;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&_n)===ka}isFIFO(){return!1}isFile(){return(this.mode&_n)===xa}isSocket(){return!1}isSymbolicLink(){return(this.mode&_n)===Pa}},Hh=class{constructor(){this.uid=BigInt(0);this.gid=BigInt(0);this.size=BigInt(0);this.blksize=BigInt(0);this.atimeMs=BigInt(0);this.mtimeMs=BigInt(0);this.ctimeMs=BigInt(0);this.birthtimeMs=BigInt(0);this.atimeNs=BigInt(0);this.mtimeNs=BigInt(0);this.ctimeNs=BigInt(0);this.birthtimeNs=BigInt(0);this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=BigInt(0);this.ino=BigInt(0);this.mode=BigInt(Uh);this.nlink=BigInt(1);this.rdev=BigInt(0);this.blocks=BigInt(1)}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&BigInt(_n))===BigInt(ka)}isFIFO(){return!1}isFile(){return(this.mode&BigInt(_n))===BigInt(xa)}isSocket(){return!1}isSymbolicLink(){return(this.mode&BigInt(_n))===BigInt(Pa)}};function Gh(){return new KA}function pfe(){return KE(Gh())}function KE(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];typeof r=="number"?t[e]=0:typeof r=="bigint"?t[e]=BigInt(0):pQ.types.isDate(r)&&(t[e]=new Date(0))}return t}function UE(t){let e=new Hh;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let i=t[r];typeof i=="number"?e[r]=BigInt(i):pQ.types.isDate(i)&&(e[r]=new Date(i))}return e.atimeNs=e.atimeMs*BigInt(1e6),e.mtimeNs=e.mtimeMs*BigInt(1e6),e.ctimeNs=e.ctimeMs*BigInt(1e6),e.birthtimeNs=e.birthtimeMs*BigInt(1e6),e}function dQ(t,e){if(t.atimeMs!==e.atimeMs||t.birthtimeMs!==e.birthtimeMs||t.blksize!==e.blksize||t.blocks!==e.blocks||t.ctimeMs!==e.ctimeMs||t.dev!==e.dev||t.gid!==e.gid||t.ino!==e.ino||t.isBlockDevice()!==e.isBlockDevice()||t.isCharacterDevice()!==e.isCharacterDevice()||t.isDirectory()!==e.isDirectory()||t.isFIFO()!==e.isFIFO()||t.isFile()!==e.isFile()||t.isSocket()!==e.isSocket()||t.isSymbolicLink()!==e.isSymbolicLink()||t.mode!==e.mode||t.mtimeMs!==e.mtimeMs||t.nlink!==e.nlink||t.rdev!==e.rdev||t.size!==e.size||t.uid!==e.uid)return!1;let r=t,i=e;return!(r.atimeNs!==i.atimeNs||r.mtimeNs!==i.mtimeNs||r.ctimeNs!==i.ctimeNs||r.birthtimeNs!==i.birthtimeNs)}var GE=ge(require("fs"));var jh=ge(require("path")),aM;(function(i){i[i.File=0]="File",i[i.Portable=1]="Portable",i[i.Native=2]="Native"})(aM||(aM={}));var Ke={root:"/",dot:"."},Pt={nodeModules:"node_modules",manifest:"package.json",lockfile:"yarn.lock",virtual:"__virtual__",pnpJs:".pnp.js",pnpCjs:".pnp.cjs",rc:".yarnrc.yml"},H=Object.create(jh.default),x=Object.create(jh.default.posix);H.cwd=()=>process.cwd();x.cwd=()=>CQ(process.cwd());x.resolve=(...t)=>t.length>0&&x.isAbsolute(t[0])?jh.default.posix.resolve(...t):jh.default.posix.resolve(x.cwd(),...t);var AM=function(t,e,r){return e=t.normalize(e),r=t.normalize(r),e===r?".":(e.endsWith(t.sep)||(e=e+t.sep),r.startsWith(e)?r.slice(e.length):null)};H.fromPortablePath=lM;H.toPortablePath=CQ;H.contains=(t,e)=>AM(H,t,e);x.contains=(t,e)=>AM(x,t,e);var dfe=/^([a-zA-Z]:.*)$/,Cfe=/^\/\/(\.\/)?(.*)$/,mfe=/^\/([a-zA-Z]:.*)$/,Efe=/^\/unc\/(\.dot\/)?(.*)$/;function lM(t){if(process.platform!=="win32")return t;let e,r;if(e=t.match(mfe))t=e[1];else if(r=t.match(Efe))t=`\\\\${r[1]?".\\":""}${r[2]}`;else return t;return t.replace(/\//g,"\\")}function CQ(t){if(process.platform!=="win32")return t;t=t.replace(/\\/g,"/");let e,r;return(e=t.match(dfe))?t=`/${e[1]}`:(r=t.match(Cfe))&&(t=`/unc/${r[1]?".dot/":""}${r[2]}`),t}function HE(t,e){return t===H?lM(e):CQ(e)}function Jr(t){if(H.parse(t).dir!==""||x.parse(t).dir!=="")throw new Error(`Invalid filename: "${t}"`);return t}var jE=new Date(fQ*1e3),Yh;(function(r){r.Allow="allow",r.ReadOnly="readOnly"})(Yh||(Yh={}));async function cM(t,e,r,i,n){let s=t.pathUtils.normalize(e),o=r.pathUtils.normalize(i),a=[],l=[],{atime:c,mtime:u}=n.stableTime?{atime:jE,mtime:jE}:await r.lstatPromise(o);await t.mkdirpPromise(t.pathUtils.dirname(e),{utimes:[c,u]});let g=typeof t.lutimesPromise=="function"?t.lutimesPromise.bind(t):t.utimesPromise.bind(t);await mQ(a,l,g,t,s,r,o,ie(N({},n),{didParentExist:!0}));for(let f of a)await f();await Promise.all(l.map(f=>f()))}async function mQ(t,e,r,i,n,s,o,a){var h,p;let l=a.didParentExist?await Ife(i,n):null,c=await s.lstatPromise(o),{atime:u,mtime:g}=a.stableTime?{atime:jE,mtime:jE}:c,f;switch(!0){case c.isDirectory():f=await yfe(t,e,r,i,n,l,s,o,c,a);break;case c.isFile():f=await wfe(t,e,r,i,n,l,s,o,c,a);break;case c.isSymbolicLink():f=await Bfe(t,e,r,i,n,l,s,o,c,a);break;default:throw new Error(`Unsupported file type (${c.mode})`)}return(f||((h=l==null?void 0:l.mtime)==null?void 0:h.getTime())!==g.getTime()||((p=l==null?void 0:l.atime)==null?void 0:p.getTime())!==u.getTime())&&(e.push(()=>r(n,u,g)),f=!0),(l===null||(l.mode&511)!=(c.mode&511))&&(e.push(()=>i.chmodPromise(n,c.mode&511)),f=!0),f}async function Ife(t,e){try{return await t.lstatPromise(e)}catch(r){return null}}async function yfe(t,e,r,i,n,s,o,a,l,c){if(s!==null&&!s.isDirectory())if(c.overwrite)t.push(async()=>i.removePromise(n)),s=null;else return!1;let u=!1;s===null&&(t.push(async()=>{try{await i.mkdirPromise(n,{mode:l.mode})}catch(h){if(h.code!=="EEXIST")throw h}}),u=!0);let g=await o.readdirPromise(a),f=c.didParentExist&&!s?ie(N({},c),{didParentExist:!1}):c;if(c.stableSort)for(let h of g.sort())await mQ(t,e,r,i,i.pathUtils.join(n,h),o,o.pathUtils.join(a,h),f)&&(u=!0);else(await Promise.all(g.map(async p=>{await mQ(t,e,r,i,i.pathUtils.join(n,p),o,o.pathUtils.join(a,p),f)}))).some(p=>p)&&(u=!0);return u}var EQ=new WeakMap;function IQ(t,e,r,i,n){return async()=>{await t.linkPromise(r,e),n===Yh.ReadOnly&&(i.mode&=~146,await t.chmodPromise(e,i.mode))}}function bfe(t,e,r,i,n){let s=EQ.get(t);return typeof s=="undefined"?async()=>{try{await t.copyFilePromise(r,e,GE.default.constants.COPYFILE_FICLONE_FORCE),EQ.set(t,!0)}catch(o){if(o.code==="ENOSYS"||o.code==="ENOTSUP")EQ.set(t,!1),await IQ(t,e,r,i,n)();else throw o}}:s?async()=>t.copyFilePromise(r,e,GE.default.constants.COPYFILE_FICLONE_FORCE):IQ(t,e,r,i,n)}async function wfe(t,e,r,i,n,s,o,a,l,c){var f;if(s!==null)if(c.overwrite)t.push(async()=>i.removePromise(n)),s=null;else return!1;let u=(f=c.linkStrategy)!=null?f:null,g=i===o?u!==null?bfe(i,n,a,l,u):async()=>i.copyFilePromise(a,n,GE.default.constants.COPYFILE_FICLONE):u!==null?IQ(i,n,a,l,u):async()=>i.writeFilePromise(n,await o.readFilePromise(a));return t.push(async()=>g()),!0}async function Bfe(t,e,r,i,n,s,o,a,l,c){if(s!==null)if(c.overwrite)t.push(async()=>i.removePromise(n)),s=null;else return!1;return t.push(async()=>{await i.symlinkPromise(HE(i.pathUtils,await o.readlinkPromise(a)),n)}),!0}function ms(t,e){return Object.assign(new Error(`${t}: ${e}`),{code:t})}function YE(t){return ms("EBUSY",t)}function qh(t,e){return ms("ENOSYS",`${t}, ${e}`)}function UA(t){return ms("EINVAL",`invalid argument, ${t}`)}function en(t){return ms("EBADF",`bad file descriptor, ${t}`)}function ro(t){return ms("ENOENT",`no such file or directory, ${t}`)}function Do(t){return ms("ENOTDIR",`not a directory, ${t}`)}function Jh(t){return ms("EISDIR",`illegal operation on a directory, ${t}`)}function qE(t){return ms("EEXIST",`file already exists, ${t}`)}function In(t){return ms("EROFS",`read-only filesystem, ${t}`)}function uM(t){return ms("ENOTEMPTY",`directory not empty, ${t}`)}function gM(t){return ms("EOPNOTSUPP",`operation not supported, ${t}`)}function fM(){return ms("ERR_DIR_CLOSED","Directory handle was closed")}var yQ=class extends Error{constructor(e,r){super(e);this.name="Libzip Error",this.code=r}};var hM=class{constructor(e,r,i={}){this.path=e;this.nextDirent=r;this.opts=i;this.closed=!1}throwIfClosed(){if(this.closed)throw fM()}async*[Symbol.asyncIterator](){try{let e;for(;(e=await this.read())!==null;)yield e}finally{await this.close()}}read(e){let r=this.readSync();return typeof e!="undefined"?e(null,r):Promise.resolve(r)}readSync(){return this.throwIfClosed(),this.nextDirent()}close(e){return this.closeSync(),typeof e!="undefined"?e(null):Promise.resolve()}closeSync(){var e,r;this.throwIfClosed(),(r=(e=this.opts).onClose)==null||r.call(e),this.closed=!0}};function JE(t,e,r,i){let n=()=>{let s=r.shift();return typeof s=="undefined"?null:Object.assign(t.statSync(t.pathUtils.join(e,s)),{name:s})};return new hM(e,n,i)}var pM=ge(require("os"));var HA=class{constructor(e){this.pathUtils=e}async*genTraversePromise(e,{stableSort:r=!1}={}){let i=[e];for(;i.length>0;){let n=i.shift();if((await this.lstatPromise(n)).isDirectory()){let o=await this.readdirPromise(n);if(r)for(let a of o.sort())i.push(this.pathUtils.join(n,a));else throw new Error("Not supported")}else yield n}}async removePromise(e,{recursive:r=!0,maxRetries:i=5}={}){let n;try{n=await this.lstatPromise(e)}catch(s){if(s.code==="ENOENT")return;throw s}if(n.isDirectory()){if(r){let s=await this.readdirPromise(e);await Promise.all(s.map(o=>this.removePromise(this.pathUtils.resolve(e,o))))}for(let s=0;s<=i;s++)try{await this.rmdirPromise(e);break}catch(o){if(o.code!=="EBUSY"&&o.code!=="ENOTEMPTY")throw o;s<i&&await new Promise(a=>setTimeout(a,s*100))}}else await this.unlinkPromise(e)}removeSync(e,{recursive:r=!0}={}){let i;try{i=this.lstatSync(e)}catch(n){if(n.code==="ENOENT")return;throw n}if(i.isDirectory()){if(r)for(let n of this.readdirSync(e))this.removeSync(this.pathUtils.resolve(e,n));this.rmdirSync(e)}else this.unlinkSync(e)}async mkdirpPromise(e,{chmod:r,utimes:i}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let n=e.split(this.pathUtils.sep);for(let s=2;s<=n.length;++s){let o=n.slice(0,s).join(this.pathUtils.sep);if(!this.existsSync(o)){try{await this.mkdirPromise(o)}catch(a){if(a.code==="EEXIST")continue;throw a}if(r!=null&&await this.chmodPromise(o,r),i!=null)await this.utimesPromise(o,i[0],i[1]);else{let a=await this.statPromise(this.pathUtils.dirname(o));await this.utimesPromise(o,a.atime,a.mtime)}}}}mkdirpSync(e,{chmod:r,utimes:i}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let n=e.split(this.pathUtils.sep);for(let s=2;s<=n.length;++s){let o=n.slice(0,s).join(this.pathUtils.sep);if(!this.existsSync(o)){try{this.mkdirSync(o)}catch(a){if(a.code==="EEXIST")continue;throw a}if(r!=null&&this.chmodSync(o,r),i!=null)this.utimesSync(o,i[0],i[1]);else{let a=this.statSync(this.pathUtils.dirname(o));this.utimesSync(o,a.atime,a.mtime)}}}}async copyPromise(e,r,{baseFs:i=this,overwrite:n=!0,stableSort:s=!1,stableTime:o=!1,linkStrategy:a=null}={}){return await cM(this,e,i,r,{overwrite:n,stableSort:s,stableTime:o,linkStrategy:a})}copySync(e,r,{baseFs:i=this,overwrite:n=!0}={}){let s=i.lstatSync(r),o=this.existsSync(e);if(s.isDirectory()){this.mkdirpSync(e);let l=i.readdirSync(r);for(let c of l)this.copySync(this.pathUtils.join(e,c),i.pathUtils.join(r,c),{baseFs:i,overwrite:n})}else if(s.isFile()){if(!o||n){o&&this.removeSync(e);let l=i.readFileSync(r);this.writeFileSync(e,l)}}else if(s.isSymbolicLink()){if(!o||n){o&&this.removeSync(e);let l=i.readlinkSync(r);this.symlinkSync(HE(this.pathUtils,l),e)}}else throw new Error(`Unsupported file type (file: ${r}, mode: 0o${s.mode.toString(8).padStart(6,"0")})`);let a=s.mode&511;this.chmodSync(e,a)}async changeFilePromise(e,r,i={}){return Buffer.isBuffer(r)?this.changeFileBufferPromise(e,r,i):this.changeFileTextPromise(e,r,i)}async changeFileBufferPromise(e,r,{mode:i}={}){let n=Buffer.alloc(0);try{n=await this.readFilePromise(e)}catch(s){}Buffer.compare(n,r)!==0&&await this.writeFilePromise(e,r,{mode:i})}async changeFileTextPromise(e,r,{automaticNewlines:i,mode:n}={}){let s="";try{s=await this.readFilePromise(e,"utf8")}catch(a){}let o=i?ec(s,r):r;s!==o&&await this.writeFilePromise(e,o,{mode:n})}changeFileSync(e,r,i={}){return Buffer.isBuffer(r)?this.changeFileBufferSync(e,r,i):this.changeFileTextSync(e,r,i)}changeFileBufferSync(e,r,{mode:i}={}){let n=Buffer.alloc(0);try{n=this.readFileSync(e)}catch(s){}Buffer.compare(n,r)!==0&&this.writeFileSync(e,r,{mode:i})}changeFileTextSync(e,r,{automaticNewlines:i=!1,mode:n}={}){let s="";try{s=this.readFileSync(e,"utf8")}catch(a){}let o=i?ec(s,r):r;s!==o&&this.writeFileSync(e,o,{mode:n})}async movePromise(e,r){try{await this.renamePromise(e,r)}catch(i){if(i.code==="EXDEV")await this.copyPromise(r,e),await this.removePromise(e);else throw i}}moveSync(e,r){try{this.renameSync(e,r)}catch(i){if(i.code==="EXDEV")this.copySync(r,e),this.removeSync(e);else throw i}}async lockPromise(e,r){let i=`${e}.flock`,n=1e3/60,s=Date.now(),o=null,a=async()=>{let l;try{[l]=await this.readJsonPromise(i)}catch(c){return Date.now()-s<500}try{return process.kill(l,0),!0}catch(c){return!1}};for(;o===null;)try{o=await this.openPromise(i,"wx")}catch(l){if(l.code==="EEXIST"){if(!await a())try{await this.unlinkPromise(i);continue}catch(c){}if(Date.now()-s<60*1e3)await new Promise(c=>setTimeout(c,n));else throw new Error(`Couldn't acquire a lock in a reasonable time (via ${i})`)}else throw l}await this.writePromise(o,JSON.stringify([process.pid]));try{return await r()}finally{try{await this.closePromise(o),await this.unlinkPromise(i)}catch(l){}}}async readJsonPromise(e){let r=await this.readFilePromise(e,"utf8");try{return JSON.parse(r)}catch(i){throw i.message+=` (in ${e})`,i}}readJsonSync(e){let r=this.readFileSync(e,"utf8");try{return JSON.parse(r)}catch(i){throw i.message+=` (in ${e})`,i}}async writeJsonPromise(e,r){return await this.writeFilePromise(e,`${JSON.stringify(r,null,2)}
`)}writeJsonSync(e,r){return this.writeFileSync(e,`${JSON.stringify(r,null,2)}
`)}async preserveTimePromise(e,r){let i=await this.lstatPromise(e),n=await r();typeof n!="undefined"&&(e=n),this.lutimesPromise?await this.lutimesPromise(e,i.atime,i.mtime):i.isSymbolicLink()||await this.utimesPromise(e,i.atime,i.mtime)}async preserveTimeSync(e,r){let i=this.lstatSync(e),n=r();typeof n!="undefined"&&(e=n),this.lutimesSync?this.lutimesSync(e,i.atime,i.mtime):i.isSymbolicLink()||this.utimesSync(e,i.atime,i.mtime)}},tc=class extends HA{constructor(){super(x)}};function Qfe(t){let e=t.match(/\r?\n/g);if(e===null)return pM.EOL;let r=e.filter(n=>n===`\r
`).length,i=e.length-r;return r>i?`\r
`:`
`}function ec(t,e){return e.replace(/\r?\n/g,Qfe(t))}var Ju=ge(require("fs")),wQ=ge(require("stream")),EM=ge(require("util")),BQ=ge(require("zlib"));var dM=ge(require("fs"));var ar=class extends tc{constructor(e=dM.default){super();this.realFs=e,typeof this.realFs.lutimes!="undefined"&&(this.lutimesPromise=this.lutimesPromiseImpl,this.lutimesSync=this.lutimesSyncImpl)}getExtractHint(){return!1}getRealPath(){return Ke.root}resolve(e){return x.resolve(e)}async openPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.open(H.fromPortablePath(e),r,i,this.makeCallback(n,s))})}openSync(e,r,i){return this.realFs.openSync(H.fromPortablePath(e),r,i)}async opendirPromise(e,r){return await new Promise((i,n)=>{typeof r!="undefined"?this.realFs.opendir(H.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.opendir(H.fromPortablePath(e),this.makeCallback(i,n))}).then(i=>Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0}))}opendirSync(e,r){let i=typeof r!="undefined"?this.realFs.opendirSync(H.fromPortablePath(e),r):this.realFs.opendirSync(H.fromPortablePath(e));return Object.defineProperty(i,"path",{value:e,configurable:!0,writable:!0})}async readPromise(e,r,i=0,n=0,s=-1){return await new Promise((o,a)=>{this.realFs.read(e,r,i,n,s,(l,c)=>{l?a(l):o(c)})})}readSync(e,r,i,n,s){return this.realFs.readSync(e,r,i,n,s)}async writePromise(e,r,i,n,s){return await new Promise((o,a)=>typeof r=="string"?this.realFs.write(e,r,i,this.makeCallback(o,a)):this.realFs.write(e,r,i,n,s,this.makeCallback(o,a)))}writeSync(e,r,i,n,s){return typeof r=="string"?this.realFs.writeSync(e,r,i):this.realFs.writeSync(e,r,i,n,s)}async closePromise(e){await new Promise((r,i)=>{this.realFs.close(e,this.makeCallback(r,i))})}closeSync(e){this.realFs.closeSync(e)}createReadStream(e,r){let i=e!==null?H.fromPortablePath(e):e;return this.realFs.createReadStream(i,r)}createWriteStream(e,r){let i=e!==null?H.fromPortablePath(e):e;return this.realFs.createWriteStream(i,r)}async realpathPromise(e){return await new Promise((r,i)=>{this.realFs.realpath(H.fromPortablePath(e),{},this.makeCallback(r,i))}).then(r=>H.toPortablePath(r))}realpathSync(e){return H.toPortablePath(this.realFs.realpathSync(H.fromPortablePath(e),{}))}async existsPromise(e){return await new Promise(r=>{this.realFs.exists(H.fromPortablePath(e),r)})}accessSync(e,r){return this.realFs.accessSync(H.fromPortablePath(e),r)}async accessPromise(e,r){return await new Promise((i,n)=>{this.realFs.access(H.fromPortablePath(e),r,this.makeCallback(i,n))})}existsSync(e){return this.realFs.existsSync(H.fromPortablePath(e))}async statPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.stat(H.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.stat(H.fromPortablePath(e),this.makeCallback(i,n))})}statSync(e,r){return r?this.realFs.statSync(H.fromPortablePath(e),r):this.realFs.statSync(H.fromPortablePath(e))}async fstatPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.fstat(e,r,this.makeCallback(i,n)):this.realFs.fstat(e,this.makeCallback(i,n))})}fstatSync(e,r){return r?this.realFs.fstatSync(e,r):this.realFs.fstatSync(e)}async lstatPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.lstat(H.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.lstat(H.fromPortablePath(e),this.makeCallback(i,n))})}lstatSync(e,r){return r?this.realFs.lstatSync(H.fromPortablePath(e),r):this.realFs.lstatSync(H.fromPortablePath(e))}async chmodPromise(e,r){return await new Promise((i,n)=>{this.realFs.chmod(H.fromPortablePath(e),r,this.makeCallback(i,n))})}chmodSync(e,r){return this.realFs.chmodSync(H.fromPortablePath(e),r)}async chownPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.chown(H.fromPortablePath(e),r,i,this.makeCallback(n,s))})}chownSync(e,r,i){return this.realFs.chownSync(H.fromPortablePath(e),r,i)}async renamePromise(e,r){return await new Promise((i,n)=>{this.realFs.rename(H.fromPortablePath(e),H.fromPortablePath(r),this.makeCallback(i,n))})}renameSync(e,r){return this.realFs.renameSync(H.fromPortablePath(e),H.fromPortablePath(r))}async copyFilePromise(e,r,i=0){return await new Promise((n,s)=>{this.realFs.copyFile(H.fromPortablePath(e),H.fromPortablePath(r),i,this.makeCallback(n,s))})}copyFileSync(e,r,i=0){return this.realFs.copyFileSync(H.fromPortablePath(e),H.fromPortablePath(r),i)}async appendFilePromise(e,r,i){return await new Promise((n,s)=>{let o=typeof e=="string"?H.fromPortablePath(e):e;i?this.realFs.appendFile(o,r,i,this.makeCallback(n,s)):this.realFs.appendFile(o,r,this.makeCallback(n,s))})}appendFileSync(e,r,i){let n=typeof e=="string"?H.fromPortablePath(e):e;i?this.realFs.appendFileSync(n,r,i):this.realFs.appendFileSync(n,r)}async writeFilePromise(e,r,i){return await new Promise((n,s)=>{let o=typeof e=="string"?H.fromPortablePath(e):e;i?this.realFs.writeFile(o,r,i,this.makeCallback(n,s)):this.realFs.writeFile(o,r,this.makeCallback(n,s))})}writeFileSync(e,r,i){let n=typeof e=="string"?H.fromPortablePath(e):e;i?this.realFs.writeFileSync(n,r,i):this.realFs.writeFileSync(n,r)}async unlinkPromise(e){return await new Promise((r,i)=>{this.realFs.unlink(H.fromPortablePath(e),this.makeCallback(r,i))})}unlinkSync(e){return this.realFs.unlinkSync(H.fromPortablePath(e))}async utimesPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.utimes(H.fromPortablePath(e),r,i,this.makeCallback(n,s))})}utimesSync(e,r,i){this.realFs.utimesSync(H.fromPortablePath(e),r,i)}async lutimesPromiseImpl(e,r,i){let n=this.realFs.lutimes;if(typeof n=="undefined")throw qh("unavailable Node binding",`lutimes '${e}'`);return await new Promise((s,o)=>{n.call(this.realFs,H.fromPortablePath(e),r,i,this.makeCallback(s,o))})}lutimesSyncImpl(e,r,i){let n=this.realFs.lutimesSync;if(typeof n=="undefined")throw qh("unavailable Node binding",`lutimes '${e}'`);n.call(this.realFs,H.fromPortablePath(e),r,i)}async mkdirPromise(e,r){return await new Promise((i,n)=>{this.realFs.mkdir(H.fromPortablePath(e),r,this.makeCallback(i,n))})}mkdirSync(e,r){return this.realFs.mkdirSync(H.fromPortablePath(e),r)}async rmdirPromise(e,r){return await new Promise((i,n)=>{r?this.realFs.rmdir(H.fromPortablePath(e),r,this.makeCallback(i,n)):this.realFs.rmdir(H.fromPortablePath(e),this.makeCallback(i,n))})}rmdirSync(e,r){return this.realFs.rmdirSync(H.fromPortablePath(e),r)}async linkPromise(e,r){return await new Promise((i,n)=>{this.realFs.link(H.fromPortablePath(e),H.fromPortablePath(r),this.makeCallback(i,n))})}linkSync(e,r){return this.realFs.linkSync(H.fromPortablePath(e),H.fromPortablePath(r))}async symlinkPromise(e,r,i){return await new Promise((n,s)=>{this.realFs.symlink(H.fromPortablePath(e.replace(/\/+$/,"")),H.fromPortablePath(r),i,this.makeCallback(n,s))})}symlinkSync(e,r,i){return this.realFs.symlinkSync(H.fromPortablePath(e.replace(/\/+$/,"")),H.fromPortablePath(r),i)}async readFilePromise(e,r){return await new Promise((i,n)=>{let s=typeof e=="string"?H.fromPortablePath(e):e;this.realFs.readFile(s,r,this.makeCallback(i,n))})}readFileSync(e,r){let i=typeof e=="string"?H.fromPortablePath(e):e;return this.realFs.readFileSync(i,r)}async readdirPromise(e,r){return await new Promise((i,n)=>{(r==null?void 0:r.withFileTypes)?this.realFs.readdir(H.fromPortablePath(e),{withFileTypes:!0},this.makeCallback(i,n)):this.realFs.readdir(H.fromPortablePath(e),this.makeCallback(s=>i(s),n))})}readdirSync(e,r){return(r==null?void 0:r.withFileTypes)?this.realFs.readdirSync(H.fromPortablePath(e),{withFileTypes:!0}):this.realFs.readdirSync(H.fromPortablePath(e))}async readlinkPromise(e){return await new Promise((r,i)=>{this.realFs.readlink(H.fromPortablePath(e),this.makeCallback(r,i))}).then(r=>H.toPortablePath(r))}readlinkSync(e){return H.toPortablePath(this.realFs.readlinkSync(H.fromPortablePath(e)))}async truncatePromise(e,r){return await new Promise((i,n)=>{this.realFs.truncate(H.fromPortablePath(e),r,this.makeCallback(i,n))})}truncateSync(e,r){return this.realFs.truncateSync(H.fromPortablePath(e),r)}watch(e,r,i){return this.realFs.watch(H.fromPortablePath(e),r,i)}watchFile(e,r,i){return this.realFs.watchFile(H.fromPortablePath(e),r,i)}unwatchFile(e,r){return this.realFs.unwatchFile(H.fromPortablePath(e),r)}makeCallback(e,r){return(i,n)=>{i?r(i):e(n)}}};var CM=ge(require("events"));var rc;(function(r){r.Change="change",r.Stop="stop"})(rc||(rc={}));var ic;(function(i){i.Ready="ready",i.Running="running",i.Stopped="stopped"})(ic||(ic={}));function mM(t,e){if(t!==e)throw new Error(`Invalid StatWatcher status: expected '${e}', got '${t}'`)}var Wh=class extends CM.EventEmitter{constructor(e,r,{bigint:i=!1}={}){super();this.status=ic.Ready;this.changeListeners=new Map;this.startTimeout=null;this.fakeFs=e,this.path=r,this.bigint=i,this.lastStats=this.stat()}static create(e,r,i){let n=new Wh(e,r,i);return n.start(),n}start(){mM(this.status,ic.Ready),this.status=ic.Running,this.startTimeout=setTimeout(()=>{this.startTimeout=null,this.fakeFs.existsSync(this.path)||this.emit(rc.Change,this.lastStats,this.lastStats)},3)}stop(){mM(this.status,ic.Running),this.status=ic.Stopped,this.startTimeout!==null&&(clearTimeout(this.startTimeout),this.startTimeout=null),this.emit(rc.Stop)}stat(){try{return this.fakeFs.statSync(this.path,{bigint:this.bigint})}catch(e){let r=this.bigint?new Hh:new KA;return KE(r)}}makeInterval(e){let r=setInterval(()=>{let i=this.stat(),n=this.lastStats;dQ(i,n)||(this.lastStats=i,this.emit(rc.Change,i,n))},e.interval);return e.persistent?r:r.unref()}registerChangeListener(e,r){this.addListener(rc.Change,e),this.changeListeners.set(e,this.makeInterval(r))}unregisterChangeListener(e){this.removeListener(rc.Change,e);let r=this.changeListeners.get(e);typeof r!="undefined"&&clearInterval(r),this.changeListeners.delete(e)}unregisterAllChangeListeners(){for(let e of this.changeListeners.keys())this.unregisterChangeListener(e)}hasChangeListeners(){return this.changeListeners.size>0}ref(){for(let e of this.changeListeners.values())e.ref();return this}unref(){for(let e of this.changeListeners.values())e.unref();return this}};var WE=new WeakMap;function zE(t,e,r,i){let n,s,o,a;switch(typeof r){case"function":n=!1,s=!0,o=5007,a=r;break;default:({bigint:n=!1,persistent:s=!0,interval:o=5007}=r),a=i;break}let l=WE.get(t);typeof l=="undefined"&&WE.set(t,l=new Map);let c=l.get(e);return typeof c=="undefined"&&(c=Wh.create(t,e,{bigint:n}),l.set(e,c)),c.registerChangeListener(a,{persistent:s,interval:o}),c}function zh(t,e,r){let i=WE.get(t);if(typeof i=="undefined")return;let n=i.get(e);typeof n!="undefined"&&(typeof r=="undefined"?n.unregisterAllChangeListeners():n.unregisterChangeListener(r),n.hasChangeListeners()||(n.stop(),i.delete(e)))}function _h(t){let e=WE.get(t);if(typeof e!="undefined")for(let r of e.keys())zh(t,r)}var nc="mixed";function vfe(t){if(typeof t=="string"&&String(+t)===t)return+t;if(Number.isFinite(t))return t<0?Date.now()/1e3:t;if(EM.types.isDate(t))return t.getTime()/1e3;throw new Error("Invalid time")}function IM(){return Buffer.from([80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}var Ai=class extends tc{constructor(e,r){super();this.lzSource=null;this.listings=new Map;this.entries=new Map;this.fileSources=new Map;this.fds=new Map;this.nextFd=0;this.ready=!1;this.readOnly=!1;this.libzip=r.libzip;let i=r;if(this.level=typeof i.level!="undefined"?i.level:nc,e!=null||(e=IM()),typeof e=="string"){let{baseFs:o=new ar}=i;this.baseFs=o,this.path=e}else this.path=null,this.baseFs=null;if(r.stats)this.stats=r.stats;else if(typeof e=="string")try{this.stats=this.baseFs.statSync(e)}catch(o){if(o.code==="ENOENT"&&i.create)this.stats=Gh();else throw o}else this.stats=Gh();let n=this.libzip.malloc(4);try{let o=0;if(typeof e=="string"&&i.create&&(o|=this.libzip.ZIP_CREATE|this.libzip.ZIP_TRUNCATE),r.readOnly&&(o|=this.libzip.ZIP_RDONLY,this.readOnly=!0),typeof e=="string")this.zip=this.libzip.open(H.fromPortablePath(e),o,n);else{let a=this.allocateUnattachedSource(e);try{this.zip=this.libzip.openFromSource(a,o,n),this.lzSource=a}catch(l){throw this.libzip.source.free(a),l}}if(this.zip===0){let a=this.libzip.struct.errorS();throw this.libzip.error.initWithCode(a,this.libzip.getValue(n,"i32")),this.makeLibzipError(a)}}finally{this.libzip.free(n)}this.listings.set(Ke.root,new Set);let s=this.libzip.getNumEntries(this.zip,0);for(let o=0;o<s;++o){let a=this.libzip.getName(this.zip,o,0);if(x.isAbsolute(a))continue;let l=x.resolve(Ke.root,a);this.registerEntry(l,o),a.endsWith("/")&&this.registerListing(l)}if(this.symlinkCount=this.libzip.ext.countSymlinks(this.zip),this.symlinkCount===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));this.ready=!0}makeLibzipError(e){let r=this.libzip.struct.errorCodeZip(e),i=this.libzip.error.strerror(e),n=new yQ(i,this.libzip.errors[r]);if(r===this.libzip.errors.ZIP_ER_CHANGED)throw new Error(`Assertion failed: Unexpected libzip error: ${n.message}`);return n}getExtractHint(e){for(let r of this.entries.keys()){let i=this.pathUtils.extname(r);if(e.relevantExtensions.has(i))return!0}return!1}getAllFiles(){return Array.from(this.entries.keys())}getRealPath(){if(!this.path)throw new Error("ZipFS don't have real paths when loaded from a buffer");return this.path}getBufferAndClose(){if(this.prepareClose(),!this.lzSource)throw new Error("ZipFS was not created from a Buffer");try{if(this.libzip.source.keep(this.lzSource),this.libzip.close(this.zip)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));if(this.libzip.source.open(this.lzSource)===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));if(this.libzip.source.seek(this.lzSource,0,0,this.libzip.SEEK_END)===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));let e=this.libzip.source.tell(this.lzSource);if(e===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));if(this.libzip.source.seek(this.lzSource,0,0,this.libzip.SEEK_SET)===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));let r=this.libzip.malloc(e);if(!r)throw new Error("Couldn't allocate enough memory");try{let i=this.libzip.source.read(this.lzSource,r,e);if(i===-1)throw this.makeLibzipError(this.libzip.source.error(this.lzSource));if(i<e)throw new Error("Incomplete read");if(i>e)throw new Error("Overread");let n=this.libzip.HEAPU8.subarray(r,r+e);return Buffer.from(n)}finally{this.libzip.free(r)}}finally{this.libzip.source.close(this.lzSource),this.libzip.source.free(this.lzSource),this.ready=!1}}prepareClose(){if(!this.ready)throw YE("archive closed, close");_h(this)}saveAndClose(){if(!this.path||!this.baseFs)throw new Error("ZipFS cannot be saved and must be discarded when loaded from a buffer");if(this.prepareClose(),this.readOnly){this.discardAndClose();return}let e=this.baseFs.existsSync(this.path)||this.stats.mode===Uh?void 0:this.stats.mode;if(this.entries.size===0)this.discardAndClose(),this.baseFs.writeFileSync(this.path,IM(),{mode:e});else{if(this.libzip.close(this.zip)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));typeof e!="undefined"&&this.baseFs.chmodSync(this.path,e)}this.ready=!1}discardAndClose(){this.prepareClose(),this.libzip.discard(this.zip),this.ready=!1}resolve(e){return x.resolve(Ke.root,e)}async openPromise(e,r,i){return this.openSync(e,r,i)}openSync(e,r,i){let n=this.nextFd++;return this.fds.set(n,{cursor:0,p:e}),n}hasOpenFileHandles(){return!!this.fds.size}async opendirPromise(e,r){return this.opendirSync(e,r)}opendirSync(e,r={}){let i=this.resolveFilename(`opendir '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw ro(`opendir '${e}'`);let n=this.listings.get(i);if(!n)throw Do(`opendir '${e}'`);let s=[...n],o=this.openSync(i,"r");return JE(this,i,s,{onClose:()=>{this.closeSync(o)}})}async readPromise(e,r,i,n,s){return this.readSync(e,r,i,n,s)}readSync(e,r,i=0,n=r.byteLength,s=-1){let o=this.fds.get(e);if(typeof o=="undefined")throw en("read");let a=s===-1||s===null?o.cursor:s,l=this.readFileSync(o.p);l.copy(r,i,a,a+n);let c=Math.max(0,Math.min(l.length-a,n));return(s===-1||s===null)&&(o.cursor+=c),c}async writePromise(e,r,i,n,s){return typeof r=="string"?this.writeSync(e,r,s):this.writeSync(e,r,i,n,s)}writeSync(e,r,i,n,s){throw typeof this.fds.get(e)=="undefined"?en("read"):new Error("Unimplemented")}async closePromise(e){return this.closeSync(e)}closeSync(e){if(typeof this.fds.get(e)=="undefined")throw en("read");this.fds.delete(e)}createReadStream(e,{encoding:r}={}){if(e===null)throw new Error("Unimplemented");let i=this.openSync(e,"r"),n=Object.assign(new wQ.PassThrough({emitClose:!0,autoDestroy:!0,destroy:(o,a)=>{clearImmediate(s),this.closeSync(i),a(o)}}),{close(){n.destroy()},bytesRead:0,path:e}),s=setImmediate(async()=>{try{let o=await this.readFilePromise(e,r);n.bytesRead=o.length,n.end(o)}catch(o){n.destroy(o)}});return n}createWriteStream(e,{encoding:r}={}){if(this.readOnly)throw In(`open '${e}'`);if(e===null)throw new Error("Unimplemented");let i=[],n=this.openSync(e,"w"),s=Object.assign(new wQ.PassThrough({autoDestroy:!0,emitClose:!0,destroy:(o,a)=>{try{o?a(o):(this.writeFileSync(e,Buffer.concat(i),r),a(null))}catch(l){a(l)}finally{this.closeSync(n)}}}),{bytesWritten:0,path:e,close(){s.destroy()}});return s.on("data",o=>{let a=Buffer.from(o);s.bytesWritten+=a.length,i.push(a)}),s}async realpathPromise(e){return this.realpathSync(e)}realpathSync(e){let r=this.resolveFilename(`lstat '${e}'`,e);if(!this.entries.has(r)&&!this.listings.has(r))throw ro(`lstat '${e}'`);return r}async existsPromise(e){return this.existsSync(e)}existsSync(e){if(!this.ready)throw YE(`archive closed, existsSync '${e}'`);if(this.symlinkCount===0){let i=x.resolve(Ke.root,e);return this.entries.has(i)||this.listings.has(i)}let r;try{r=this.resolveFilename(`stat '${e}'`,e)}catch(i){return!1}return this.entries.has(r)||this.listings.has(r)}async accessPromise(e,r){return this.accessSync(e,r)}accessSync(e,r=Ju.constants.F_OK){let i=this.resolveFilename(`access '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw ro(`access '${e}'`);if(this.readOnly&&r&Ju.constants.W_OK)throw In(`access '${e}'`)}async statPromise(e,r){return this.statSync(e,r)}statSync(e,r){let i=this.resolveFilename(`stat '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw ro(`stat '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(i))throw Do(`stat '${e}'`);return this.statImpl(`stat '${e}'`,i,r)}async fstatPromise(e,r){return this.fstatSync(e,r)}fstatSync(e,r){let i=this.fds.get(e);if(typeof i=="undefined")throw en("fstatSync");let{p:n}=i,s=this.resolveFilename(`stat '${n}'`,n);if(!this.entries.has(s)&&!this.listings.has(s))throw ro(`stat '${n}'`);if(n[n.length-1]==="/"&&!this.listings.has(s))throw Do(`stat '${n}'`);return this.statImpl(`fstat '${n}'`,s,r)}async lstatPromise(e,r){return this.lstatSync(e,r)}lstatSync(e,r){let i=this.resolveFilename(`lstat '${e}'`,e,!1);if(!this.entries.has(i)&&!this.listings.has(i))throw ro(`lstat '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(i))throw Do(`lstat '${e}'`);return this.statImpl(`lstat '${e}'`,i,r)}statImpl(e,r,i={}){let n=this.entries.get(r);if(typeof n!="undefined"){let s=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,n,0,0,s)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let a=this.stats.uid,l=this.stats.gid,c=this.libzip.struct.statSize(s)>>>0,u=512,g=Math.ceil(c/u),f=(this.libzip.struct.statMtime(s)>>>0)*1e3,h=f,p=f,m=f,y=new Date(h),b=new Date(p),S=new Date(m),k=new Date(f),T=this.listings.has(r)?ka:this.isSymbolicLink(n)?Pa:xa,Y=T===ka?493:420,j=T|this.getUnixMode(n,Y)&511,Z=this.libzip.struct.statCrc(s),J=Object.assign(new KA,{uid:a,gid:l,size:c,blksize:u,blocks:g,atime:y,birthtime:b,ctime:S,mtime:k,atimeMs:h,birthtimeMs:p,ctimeMs:m,mtimeMs:f,mode:j,crc:Z});return i.bigint===!0?UE(J):J}if(this.listings.has(r)){let s=this.stats.uid,o=this.stats.gid,a=0,l=512,c=0,u=this.stats.mtimeMs,g=this.stats.mtimeMs,f=this.stats.mtimeMs,h=this.stats.mtimeMs,p=new Date(u),m=new Date(g),y=new Date(f),b=new Date(h),S=ka|493,k=0,T=Object.assign(new KA,{uid:s,gid:o,size:a,blksize:l,blocks:c,atime:p,birthtime:m,ctime:y,mtime:b,atimeMs:u,birthtimeMs:g,ctimeMs:f,mtimeMs:h,mode:S,crc:k});return i.bigint===!0?UE(T):T}throw new Error("Unreachable")}getUnixMode(e,r){if(this.libzip.file.getExternalAttributes(this.zip,e,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.libzip.getValue(this.libzip.uint08S,"i8")>>>0!==this.libzip.ZIP_OPSYS_UNIX?r:this.libzip.getValue(this.libzip.uint32S,"i32")>>>16}registerListing(e){let r=this.listings.get(e);if(r)return r;this.registerListing(x.dirname(e)).add(x.basename(e));let n=new Set;return this.listings.set(e,n),n}registerEntry(e,r){this.registerListing(x.dirname(e)).add(x.basename(e)),this.entries.set(e,r)}unregisterListing(e){this.listings.delete(e);let r=this.listings.get(x.dirname(e));r==null||r.delete(x.basename(e))}unregisterEntry(e){this.unregisterListing(e);let r=this.entries.get(e);this.entries.delete(e),typeof r!="undefined"&&(this.fileSources.delete(r),this.isSymbolicLink(r)&&this.symlinkCount--)}deleteEntry(e,r){if(this.unregisterEntry(e),this.libzip.delete(this.zip,r)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}resolveFilename(e,r,i=!0){if(!this.ready)throw YE(`archive closed, ${e}`);let n=x.resolve(Ke.root,r);if(n==="/")return Ke.root;let s=this.entries.get(n);if(i&&s!==void 0)if(this.symlinkCount!==0&&this.isSymbolicLink(s)){let o=this.getFileSource(s).toString();return this.resolveFilename(e,x.resolve(x.dirname(n),o),!0)}else return n;for(;;){let o=this.resolveFilename(e,x.dirname(n),!0),a=this.listings.has(o),l=this.entries.has(o);if(!a&&!l)throw ro(e);if(!a)throw Do(e);if(n=x.resolve(o,x.basename(n)),!i||this.symlinkCount===0)break;let c=this.libzip.name.locate(this.zip,n.slice(1));if(c===-1)break;if(this.isSymbolicLink(c)){let u=this.getFileSource(c).toString();n=x.resolve(x.dirname(n),u)}else break}return n}allocateBuffer(e){Buffer.isBuffer(e)||(e=Buffer.from(e));let r=this.libzip.malloc(e.byteLength);if(!r)throw new Error("Couldn't allocate enough memory");return new Uint8Array(this.libzip.HEAPU8.buffer,r,e.byteLength).set(e),{buffer:r,byteLength:e.byteLength}}allocateUnattachedSource(e){let r=this.libzip.struct.errorS(),{buffer:i,byteLength:n}=this.allocateBuffer(e),s=this.libzip.source.fromUnattachedBuffer(i,n,0,!0,r);if(s===0)throw this.libzip.free(r),this.makeLibzipError(r);return s}allocateSource(e){let{buffer:r,byteLength:i}=this.allocateBuffer(e),n=this.libzip.source.fromBuffer(this.zip,r,i,0,!0);if(n===0)throw this.libzip.free(r),this.makeLibzipError(this.libzip.getError(this.zip));return n}setFileSource(e,r){let i=Buffer.isBuffer(r)?r:Buffer.from(r),n=x.relative(Ke.root,e),s=this.allocateSource(r);try{let o=this.libzip.file.add(this.zip,n,s,this.libzip.ZIP_FL_OVERWRITE);if(o===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));if(this.level!=="mixed"){let a=this.level===0?this.libzip.ZIP_CM_STORE:this.libzip.ZIP_CM_DEFLATE;if(this.libzip.file.setCompression(this.zip,o,0,a,this.level)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}return this.fileSources.set(o,i),o}catch(o){throw this.libzip.source.free(s),o}}isSymbolicLink(e){if(this.symlinkCount===0)return!1;if(this.libzip.file.getExternalAttributes(this.zip,e,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.libzip.getValue(this.libzip.uint08S,"i8")>>>0!==this.libzip.ZIP_OPSYS_UNIX?!1:(this.libzip.getValue(this.libzip.uint32S,"i32")>>>16&_n)===Pa}getFileSource(e,r={asyncDecompress:!1}){let i=this.fileSources.get(e);if(typeof i!="undefined")return i;let n=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,e,0,0,n)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let o=this.libzip.struct.statCompSize(n),a=this.libzip.struct.statCompMethod(n),l=this.libzip.malloc(o);try{let c=this.libzip.fopenIndex(this.zip,e,0,this.libzip.ZIP_FL_COMPRESSED);if(c===0)throw this.makeLibzipError(this.libzip.getError(this.zip));try{let u=this.libzip.fread(c,l,o,0);if(u===-1)throw this.makeLibzipError(this.libzip.file.getError(c));if(u<o)throw new Error("Incomplete read");if(u>o)throw new Error("Overread");let g=this.libzip.HEAPU8.subarray(l,l+o),f=Buffer.from(g);if(a===0)return this.fileSources.set(e,f),f;if(r.asyncDecompress)return new Promise((h,p)=>{BQ.default.inflateRaw(f,(m,y)=>{m?p(m):(this.fileSources.set(e,y),h(y))})});{let h=BQ.default.inflateRawSync(f);return this.fileSources.set(e,h),h}}finally{this.libzip.fclose(c)}}finally{this.libzip.free(l)}}async chmodPromise(e,r){return this.chmodSync(e,r)}chmodSync(e,r){if(this.readOnly)throw In(`chmod '${e}'`);r&=493;let i=this.resolveFilename(`chmod '${e}'`,e,!1),n=this.entries.get(i);if(typeof n=="undefined")throw new Error(`Assertion failed: The entry should have been registered (${i})`);let o=this.getUnixMode(n,xa|0)&~511|r;if(this.libzip.file.setExternalAttributes(this.zip,n,0,0,this.libzip.ZIP_OPSYS_UNIX,o<<16)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}async chownPromise(e,r,i){return this.chownSync(e,r,i)}chownSync(e,r,i){throw new Error("Unimplemented")}async renamePromise(e,r){return this.renameSync(e,r)}renameSync(e,r){throw new Error("Unimplemented")}async copyFilePromise(e,r,i){let{indexSource:n,indexDest:s,resolvedDestP:o}=this.prepareCopyFile(e,r,i),a=await this.getFileSource(n,{asyncDecompress:!0}),l=this.setFileSource(o,a);l!==s&&this.registerEntry(o,l)}copyFileSync(e,r,i=0){let{indexSource:n,indexDest:s,resolvedDestP:o}=this.prepareCopyFile(e,r,i),a=this.getFileSource(n),l=this.setFileSource(o,a);l!==s&&this.registerEntry(o,l)}prepareCopyFile(e,r,i=0){if(this.readOnly)throw In(`copyfile '${e} -> '${r}'`);if((i&Ju.constants.COPYFILE_FICLONE_FORCE)!=0)throw qh("unsupported clone operation",`copyfile '${e}' -> ${r}'`);let n=this.resolveFilename(`copyfile '${e} -> ${r}'`,e),s=this.entries.get(n);if(typeof s=="undefined")throw UA(`copyfile '${e}' -> '${r}'`);let o=this.resolveFilename(`copyfile '${e}' -> ${r}'`,r),a=this.entries.get(o);if((i&(Ju.constants.COPYFILE_EXCL|Ju.constants.COPYFILE_FICLONE_FORCE))!=0&&typeof a!="undefined")throw qE(`copyfile '${e}' -> '${r}'`);return{indexSource:s,resolvedDestP:o,indexDest:a}}async appendFilePromise(e,r,i){if(this.readOnly)throw In(`open '${e}'`);return typeof i=="undefined"?i={flag:"a"}:typeof i=="string"?i={flag:"a",encoding:i}:typeof i.flag=="undefined"&&(i=N({flag:"a"},i)),this.writeFilePromise(e,r,i)}appendFileSync(e,r,i={}){if(this.readOnly)throw In(`open '${e}'`);return typeof i=="undefined"?i={flag:"a"}:typeof i=="string"?i={flag:"a",encoding:i}:typeof i.flag=="undefined"&&(i=N({flag:"a"},i)),this.writeFileSync(e,r,i)}fdToPath(e,r){var n;let i=(n=this.fds.get(e))==null?void 0:n.p;if(typeof i=="undefined")throw en(r);return i}async writeFilePromise(e,r,i){let{encoding:n,mode:s,index:o,resolvedP:a}=this.prepareWriteFile(e,i);o!==void 0&&typeof i=="object"&&i.flag&&i.flag.includes("a")&&(r=Buffer.concat([await this.getFileSource(o,{asyncDecompress:!0}),Buffer.from(r)])),n!==null&&(r=r.toString(n));let l=this.setFileSource(a,r);l!==o&&this.registerEntry(a,l),s!==null&&await this.chmodPromise(a,s)}writeFileSync(e,r,i){let{encoding:n,mode:s,index:o,resolvedP:a}=this.prepareWriteFile(e,i);o!==void 0&&typeof i=="object"&&i.flag&&i.flag.includes("a")&&(r=Buffer.concat([this.getFileSource(o),Buffer.from(r)])),n!==null&&(r=r.toString(n));let l=this.setFileSource(a,r);l!==o&&this.registerEntry(a,l),s!==null&&this.chmodSync(a,s)}prepareWriteFile(e,r){if(typeof e=="number"&&(e=this.fdToPath(e,"read")),this.readOnly)throw In(`open '${e}'`);let i=this.resolveFilename(`open '${e}'`,e);if(this.listings.has(i))throw Jh(`open '${e}'`);let n=null,s=null;typeof r=="string"?n=r:typeof r=="object"&&({encoding:n=null,mode:s=null}=r);let o=this.entries.get(i);return{encoding:n,mode:s,resolvedP:i,index:o}}async unlinkPromise(e){return this.unlinkSync(e)}unlinkSync(e){if(this.readOnly)throw In(`unlink '${e}'`);let r=this.resolveFilename(`unlink '${e}'`,e);if(this.listings.has(r))throw Jh(`unlink '${e}'`);let i=this.entries.get(r);if(typeof i=="undefined")throw UA(`unlink '${e}'`);this.deleteEntry(r,i)}async utimesPromise(e,r,i){return this.utimesSync(e,r,i)}utimesSync(e,r,i){if(this.readOnly)throw In(`utimes '${e}'`);let n=this.resolveFilename(`utimes '${e}'`,e);this.utimesImpl(n,i)}async lutimesPromise(e,r,i){return this.lutimesSync(e,r,i)}lutimesSync(e,r,i){if(this.readOnly)throw In(`lutimes '${e}'`);let n=this.resolveFilename(`utimes '${e}'`,e,!1);this.utimesImpl(n,i)}utimesImpl(e,r){this.listings.has(e)&&(this.entries.has(e)||this.hydrateDirectory(e));let i=this.entries.get(e);if(i===void 0)throw new Error("Unreachable");if(this.libzip.file.setMtime(this.zip,i,0,vfe(r),0)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}async mkdirPromise(e,r){return this.mkdirSync(e,r)}mkdirSync(e,{mode:r=493,recursive:i=!1}={}){if(i){this.mkdirpSync(e,{chmod:r});return}if(this.readOnly)throw In(`mkdir '${e}'`);let n=this.resolveFilename(`mkdir '${e}'`,e);if(this.entries.has(n)||this.listings.has(n))throw qE(`mkdir '${e}'`);this.hydrateDirectory(n),this.chmodSync(n,r)}async rmdirPromise(e,r){return this.rmdirSync(e,r)}rmdirSync(e,{recursive:r=!1}={}){if(this.readOnly)throw In(`rmdir '${e}'`);if(r){this.removeSync(e);return}let i=this.resolveFilename(`rmdir '${e}'`,e),n=this.listings.get(i);if(!n)throw Do(`rmdir '${e}'`);if(n.size>0)throw uM(`rmdir '${e}'`);let s=this.entries.get(i);if(typeof s=="undefined")throw UA(`rmdir '${e}'`);this.deleteEntry(e,s)}hydrateDirectory(e){let r=this.libzip.dir.add(this.zip,x.relative(Ke.root,e));if(r===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.registerListing(e),this.registerEntry(e,r),r}async linkPromise(e,r){return this.linkSync(e,r)}linkSync(e,r){throw gM(`link '${e}' -> '${r}'`)}async symlinkPromise(e,r){return this.symlinkSync(e,r)}symlinkSync(e,r){if(this.readOnly)throw In(`symlink '${e}' -> '${r}'`);let i=this.resolveFilename(`symlink '${e}' -> '${r}'`,r);if(this.listings.has(i))throw Jh(`symlink '${e}' -> '${r}'`);if(this.entries.has(i))throw qE(`symlink '${e}' -> '${r}'`);let n=this.setFileSource(i,e);if(this.registerEntry(i,n),this.libzip.file.setExternalAttributes(this.zip,n,0,0,this.libzip.ZIP_OPSYS_UNIX,(Pa|511)<<16)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));this.symlinkCount+=1}async readFilePromise(e,r){typeof r=="object"&&(r=r?r.encoding:void 0);let i=await this.readFileBuffer(e,{asyncDecompress:!0});return r?i.toString(r):i}readFileSync(e,r){typeof r=="object"&&(r=r?r.encoding:void 0);let i=this.readFileBuffer(e);return r?i.toString(r):i}readFileBuffer(e,r={asyncDecompress:!1}){typeof e=="number"&&(e=this.fdToPath(e,"read"));let i=this.resolveFilename(`open '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw ro(`open '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(i))throw Do(`open '${e}'`);if(this.listings.has(i))throw Jh("read");let n=this.entries.get(i);if(n===void 0)throw new Error("Unreachable");return this.getFileSource(n,r)}async readdirPromise(e,r){return this.readdirSync(e,r)}readdirSync(e,r){let i=this.resolveFilename(`scandir '${e}'`,e);if(!this.entries.has(i)&&!this.listings.has(i))throw ro(`scandir '${e}'`);let n=this.listings.get(i);if(!n)throw Do(`scandir '${e}'`);let s=[...n];return(r==null?void 0:r.withFileTypes)?s.map(o=>Object.assign(this.statImpl("lstat",x.join(e,o)),{name:o})):s}async readlinkPromise(e){let r=this.prepareReadlink(e);return(await this.getFileSource(r,{asyncDecompress:!0})).toString()}readlinkSync(e){let r=this.prepareReadlink(e);return this.getFileSource(r).toString()}prepareReadlink(e){let r=this.resolveFilename(`readlink '${e}'`,e,!1);if(!this.entries.has(r)&&!this.listings.has(r))throw ro(`readlink '${e}'`);if(e[e.length-1]==="/"&&!this.listings.has(r))throw Do(`open '${e}'`);if(this.listings.has(r))throw UA(`readlink '${e}'`);let i=this.entries.get(r);if(i===void 0)throw new Error("Unreachable");if(!this.isSymbolicLink(i))throw UA(`readlink '${e}'`);return i}async truncatePromise(e,r=0){let i=this.resolveFilename(`open '${e}'`,e),n=this.entries.get(i);if(typeof n=="undefined")throw UA(`open '${e}'`);let s=await this.getFileSource(n,{asyncDecompress:!0}),o=Buffer.alloc(r,0);return s.copy(o),await this.writeFilePromise(e,o)}truncateSync(e,r=0){let i=this.resolveFilename(`open '${e}'`,e),n=this.entries.get(i);if(typeof n=="undefined")throw UA(`open '${e}'`);let s=this.getFileSource(n),o=Buffer.alloc(r,0);return s.copy(o),this.writeFileSync(e,o)}watch(e,r,i){let n;switch(typeof r){case"function":case"string":case"undefined":n=!0;break;default:({persistent:n=!0}=r);break}if(!n)return{on:()=>{},close:()=>{}};let s=setInterval(()=>{},24*60*60*1e3);return{on:()=>{},close:()=>{clearInterval(s)}}}watchFile(e,r,i){let n=x.resolve(Ke.root,e);return zE(this,n,r,i)}unwatchFile(e,r){let i=x.resolve(Ke.root,e);return zh(this,i,r)}};var bi=class extends HA{getExtractHint(e){return this.baseFs.getExtractHint(e)}resolve(e){return this.mapFromBase(this.baseFs.resolve(this.mapToBase(e)))}getRealPath(){return this.mapFromBase(this.baseFs.getRealPath())}async openPromise(e,r,i){return this.baseFs.openPromise(this.mapToBase(e),r,i)}openSync(e,r,i){return this.baseFs.openSync(this.mapToBase(e),r,i)}async opendirPromise(e,r){return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(e),r),{path:e})}opendirSync(e,r){return Object.assign(this.baseFs.opendirSync(this.mapToBase(e),r),{path:e})}async readPromise(e,r,i,n,s){return await this.baseFs.readPromise(e,r,i,n,s)}readSync(e,r,i,n,s){return this.baseFs.readSync(e,r,i,n,s)}async writePromise(e,r,i,n,s){return typeof r=="string"?await this.baseFs.writePromise(e,r,i):await this.baseFs.writePromise(e,r,i,n,s)}writeSync(e,r,i,n,s){return typeof r=="string"?this.baseFs.writeSync(e,r,i):this.baseFs.writeSync(e,r,i,n,s)}async closePromise(e){return this.baseFs.closePromise(e)}closeSync(e){this.baseFs.closeSync(e)}createReadStream(e,r){return this.baseFs.createReadStream(e!==null?this.mapToBase(e):e,r)}createWriteStream(e,r){return this.baseFs.createWriteStream(e!==null?this.mapToBase(e):e,r)}async realpathPromise(e){return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(e)))}realpathSync(e){return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(e)))}async existsPromise(e){return this.baseFs.existsPromise(this.mapToBase(e))}existsSync(e){return this.baseFs.existsSync(this.mapToBase(e))}accessSync(e,r){return this.baseFs.accessSync(this.mapToBase(e),r)}async accessPromise(e,r){return this.baseFs.accessPromise(this.mapToBase(e),r)}async statPromise(e,r){return this.baseFs.statPromise(this.mapToBase(e),r)}statSync(e,r){return this.baseFs.statSync(this.mapToBase(e),r)}async fstatPromise(e,r){return this.baseFs.fstatPromise(e,r)}fstatSync(e,r){return this.baseFs.fstatSync(e,r)}async lstatPromise(e,r){return this.baseFs.lstatPromise(this.mapToBase(e),r)}lstatSync(e,r){return this.baseFs.lstatSync(this.mapToBase(e),r)}async chmodPromise(e,r){return this.baseFs.chmodPromise(this.mapToBase(e),r)}chmodSync(e,r){return this.baseFs.chmodSync(this.mapToBase(e),r)}async chownPromise(e,r,i){return this.baseFs.chownPromise(this.mapToBase(e),r,i)}chownSync(e,r,i){return this.baseFs.chownSync(this.mapToBase(e),r,i)}async renamePromise(e,r){return this.baseFs.renamePromise(this.mapToBase(e),this.mapToBase(r))}renameSync(e,r){return this.baseFs.renameSync(this.mapToBase(e),this.mapToBase(r))}async copyFilePromise(e,r,i=0){return this.baseFs.copyFilePromise(this.mapToBase(e),this.mapToBase(r),i)}copyFileSync(e,r,i=0){return this.baseFs.copyFileSync(this.mapToBase(e),this.mapToBase(r),i)}async appendFilePromise(e,r,i){return this.baseFs.appendFilePromise(this.fsMapToBase(e),r,i)}appendFileSync(e,r,i){return this.baseFs.appendFileSync(this.fsMapToBase(e),r,i)}async writeFilePromise(e,r,i){return this.baseFs.writeFilePromise(this.fsMapToBase(e),r,i)}writeFileSync(e,r,i){return this.baseFs.writeFileSync(this.fsMapToBase(e),r,i)}async unlinkPromise(e){return this.baseFs.unlinkPromise(this.mapToBase(e))}unlinkSync(e){return this.baseFs.unlinkSync(this.mapToBase(e))}async utimesPromise(e,r,i){return this.baseFs.utimesPromise(this.mapToBase(e),r,i)}utimesSync(e,r,i){return this.baseFs.utimesSync(this.mapToBase(e),r,i)}async mkdirPromise(e,r){return this.baseFs.mkdirPromise(this.mapToBase(e),r)}mkdirSync(e,r){return this.baseFs.mkdirSync(this.mapToBase(e),r)}async rmdirPromise(e,r){return this.baseFs.rmdirPromise(this.mapToBase(e),r)}rmdirSync(e,r){return this.baseFs.rmdirSync(this.mapToBase(e),r)}async linkPromise(e,r){return this.baseFs.linkPromise(this.mapToBase(e),this.mapToBase(r))}linkSync(e,r){return this.baseFs.linkSync(this.mapToBase(e),this.mapToBase(r))}async symlinkPromise(e,r,i){let n=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkPromise(this.mapToBase(e),n,i);let s=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),o=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(n),s);return this.baseFs.symlinkPromise(o,n,i)}symlinkSync(e,r,i){let n=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkSync(this.mapToBase(e),n,i);let s=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),o=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(n),s);return this.baseFs.symlinkSync(o,n,i)}async readFilePromise(e,r){return r==="utf8"?this.baseFs.readFilePromise(this.fsMapToBase(e),r):this.baseFs.readFilePromise(this.fsMapToBase(e),r)}readFileSync(e,r){return r==="utf8"?this.baseFs.readFileSync(this.fsMapToBase(e),r):this.baseFs.readFileSync(this.fsMapToBase(e),r)}async readdirPromise(e,r){return this.baseFs.readdirPromise(this.mapToBase(e),r)}readdirSync(e,r){return this.baseFs.readdirSync(this.mapToBase(e),r)}async readlinkPromise(e){return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(e)))}readlinkSync(e){return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(e)))}async truncatePromise(e,r){return this.baseFs.truncatePromise(this.mapToBase(e),r)}truncateSync(e,r){return this.baseFs.truncateSync(this.mapToBase(e),r)}watch(e,r,i){return this.baseFs.watch(this.mapToBase(e),r,i)}watchFile(e,r,i){return this.baseFs.watchFile(this.mapToBase(e),r,i)}unwatchFile(e,r){return this.baseFs.unwatchFile(this.mapToBase(e),r)}fsMapToBase(e){return typeof e=="number"?e:this.mapToBase(e)}};var Da=class extends bi{constructor(e,{baseFs:r,pathUtils:i}){super(i);this.target=e,this.baseFs=r}getRealPath(){return this.target}getBaseFs(){return this.baseFs}mapFromBase(e){return e}mapToBase(e){return e}};var _t=class extends bi{constructor(e,{baseFs:r=new ar}={}){super(x);this.target=this.pathUtils.normalize(e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.target)}resolve(e){return this.pathUtils.isAbsolute(e)?x.normalize(e):this.baseFs.resolve(x.join(this.target,e))}mapFromBase(e){return e}mapToBase(e){return this.pathUtils.isAbsolute(e)?e:this.pathUtils.join(this.target,e)}};var yM=Ke.root,Ra=class extends bi{constructor(e,{baseFs:r=new ar}={}){super(x);this.target=this.pathUtils.resolve(Ke.root,e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.pathUtils.relative(Ke.root,this.target))}getTarget(){return this.target}getBaseFs(){return this.baseFs}mapToBase(e){let r=this.pathUtils.normalize(e);if(this.pathUtils.isAbsolute(e))return this.pathUtils.resolve(this.target,this.pathUtils.relative(yM,e));if(r.match(/^\.\.\/?/))throw new Error(`Resolving this path (${e}) would escape the jail`);return this.pathUtils.resolve(this.target,e)}mapFromBase(e){return this.pathUtils.resolve(yM,this.pathUtils.relative(this.target,e))}};var Vh=class extends bi{constructor(e,r){super(r);this.instance=null;this.factory=e}get baseFs(){return this.instance||(this.instance=this.factory()),this.instance}set baseFs(e){this.instance=e}mapFromBase(e){return e}mapToBase(e){return e}};var st=()=>Object.assign(new Error("ENOSYS: unsupported filesystem access"),{code:"ENOSYS"}),bQ=class extends HA{constructor(){super(x)}getExtractHint(){throw st()}getRealPath(){throw st()}resolve(){throw st()}async openPromise(){throw st()}openSync(){throw st()}async opendirPromise(){throw st()}opendirSync(){throw st()}async readPromise(){throw st()}readSync(){throw st()}async writePromise(){throw st()}writeSync(){throw st()}async closePromise(){throw st()}closeSync(){throw st()}createWriteStream(){throw st()}createReadStream(){throw st()}async realpathPromise(){throw st()}realpathSync(){throw st()}async readdirPromise(){throw st()}readdirSync(){throw st()}async existsPromise(e){throw st()}existsSync(e){throw st()}async accessPromise(){throw st()}accessSync(){throw st()}async statPromise(){throw st()}statSync(){throw st()}async fstatPromise(e){throw st()}fstatSync(e){throw st()}async lstatPromise(e){throw st()}lstatSync(e){throw st()}async chmodPromise(){throw st()}chmodSync(){throw st()}async chownPromise(){throw st()}chownSync(){throw st()}async mkdirPromise(){throw st()}mkdirSync(){throw st()}async rmdirPromise(){throw st()}rmdirSync(){throw st()}async linkPromise(){throw st()}linkSync(){throw st()}async symlinkPromise(){throw st()}symlinkSync(){throw st()}async renamePromise(){throw st()}renameSync(){throw st()}async copyFilePromise(){throw st()}copyFileSync(){throw st()}async appendFilePromise(){throw st()}appendFileSync(){throw st()}async writeFilePromise(){throw st()}writeFileSync(){throw st()}async unlinkPromise(){throw st()}unlinkSync(){throw st()}async utimesPromise(){throw st()}utimesSync(){throw st()}async readFilePromise(){throw st()}readFileSync(){throw st()}async readlinkPromise(){throw st()}readlinkSync(){throw st()}async truncatePromise(){throw st()}truncateSync(){throw st()}watch(){throw st()}watchFile(){throw st()}unwatchFile(){throw st()}},_E=bQ;_E.instance=new bQ;var Xh=class extends bi{constructor(e){super(H);this.baseFs=e}mapFromBase(e){return H.fromPortablePath(e)}mapToBase(e){return H.toPortablePath(e)}};var Sfe=/^[0-9]+$/,QQ=/^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/,kfe=/^([^/]+-)?[a-f0-9]+$/,Wr=class extends bi{static makeVirtualPath(e,r,i){if(x.basename(e)!=="__virtual__")throw new Error('Assertion failed: Virtual folders must be named "__virtual__"');if(!x.basename(r).match(kfe))throw new Error("Assertion failed: Virtual components must be ended by an hexadecimal hash");let s=x.relative(x.dirname(e),i).split("/"),o=0;for(;o<s.length&&s[o]==="..";)o+=1;let a=s.slice(o);return x.join(e,r,String(o),...a)}static resolveVirtual(e){let r=e.match(QQ);if(!r||!r[3]&&r[5])return e;let i=x.dirname(r[1]);if(!r[3]||!r[4])return i;if(!Sfe.test(r[4]))return e;let s=Number(r[4]),o="../".repeat(s),a=r[5]||".";return Wr.resolveVirtual(x.join(i,o,a))}constructor({baseFs:e=new ar}={}){super(x);this.baseFs=e}getExtractHint(e){return this.baseFs.getExtractHint(e)}getRealPath(){return this.baseFs.getRealPath()}realpathSync(e){let r=e.match(QQ);if(!r)return this.baseFs.realpathSync(e);if(!r[5])return e;let i=this.baseFs.realpathSync(this.mapToBase(e));return Wr.makeVirtualPath(r[1],r[3],i)}async realpathPromise(e){let r=e.match(QQ);if(!r)return await this.baseFs.realpathPromise(e);if(!r[5])return e;let i=await this.baseFs.realpathPromise(this.mapToBase(e));return Wr.makeVirtualPath(r[1],r[3],i)}mapToBase(e){if(e==="")return e;if(this.pathUtils.isAbsolute(e))return Wr.resolveVirtual(e);let r=Wr.resolveVirtual(this.baseFs.resolve(Ke.dot)),i=Wr.resolveVirtual(this.baseFs.resolve(e));return x.relative(r,i)||Ke.dot}mapFromBase(e){return e}};var Zh=ge(require("fs"));var Fa=2147483648,wM=(t,e)=>{let r=t.indexOf(e);if(r<=0)return null;let i=r;for(;r>=0&&(i=r+e.length,t[i]!==x.sep);){if(t[r-1]===x.sep)return null;r=t.indexOf(e,i)}return t.length>i&&t[i]!==x.sep?null:t.slice(0,i)},Es=class extends tc{constructor({libzip:e,baseFs:r=new ar,filter:i=null,maxOpenFiles:n=Infinity,readOnlyArchives:s=!1,useCache:o=!0,maxAge:a=5e3,fileExtensions:l=null}){super();this.fdMap=new Map;this.nextFd=3;this.isZip=new Set;this.notZip=new Set;this.realPaths=new Map;this.limitOpenFilesTimeout=null;this.libzipFactory=typeof e!="function"?()=>e:e,this.baseFs=r,this.zipInstances=o?new Map:null,this.filter=i,this.maxOpenFiles=n,this.readOnlyArchives=s,this.maxAge=a,this.fileExtensions=l}static async openPromise(e,r){let i=new Es(r);try{return await e(i)}finally{i.saveAndClose()}}get libzip(){return typeof this.libzipInstance=="undefined"&&(this.libzipInstance=this.libzipFactory()),this.libzipInstance}getExtractHint(e){return this.baseFs.getExtractHint(e)}getRealPath(){return this.baseFs.getRealPath()}saveAndClose(){if(_h(this),this.zipInstances)for(let[e,{zipFs:r}]of this.zipInstances.entries())r.saveAndClose(),this.zipInstances.delete(e)}discardAndClose(){if(_h(this),this.zipInstances)for(let[e,{zipFs:r}]of this.zipInstances.entries())r.discardAndClose(),this.zipInstances.delete(e)}resolve(e){return this.baseFs.resolve(e)}remapFd(e,r){let i=this.nextFd++|Fa;return this.fdMap.set(i,[e,r]),i}async openPromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.openPromise(e,r,i),async(n,{subPath:s})=>this.remapFd(n,await n.openPromise(s,r,i)))}openSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.openSync(e,r,i),(n,{subPath:s})=>this.remapFd(n,n.openSync(s,r,i)))}async opendirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.opendirPromise(e,r),async(i,{subPath:n})=>await i.opendirPromise(n,r),{requireSubpath:!1})}opendirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.opendirSync(e,r),(i,{subPath:n})=>i.opendirSync(n,r),{requireSubpath:!1})}async readPromise(e,r,i,n,s){if((e&Fa)==0)return await this.baseFs.readPromise(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw en("read");let[a,l]=o;return await a.readPromise(l,r,i,n,s)}readSync(e,r,i,n,s){if((e&Fa)==0)return this.baseFs.readSync(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw en("readSync");let[a,l]=o;return a.readSync(l,r,i,n,s)}async writePromise(e,r,i,n,s){if((e&Fa)==0)return typeof r=="string"?await this.baseFs.writePromise(e,r,i):await this.baseFs.writePromise(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw en("write");let[a,l]=o;return typeof r=="string"?await a.writePromise(l,r,i):await a.writePromise(l,r,i,n,s)}writeSync(e,r,i,n,s){if((e&Fa)==0)return typeof r=="string"?this.baseFs.writeSync(e,r,i):this.baseFs.writeSync(e,r,i,n,s);let o=this.fdMap.get(e);if(typeof o=="undefined")throw en("writeSync");let[a,l]=o;return typeof r=="string"?a.writeSync(l,r,i):a.writeSync(l,r,i,n,s)}async closePromise(e){if((e&Fa)==0)return await this.baseFs.closePromise(e);let r=this.fdMap.get(e);if(typeof r=="undefined")throw en("close");this.fdMap.delete(e);let[i,n]=r;return await i.closePromise(n)}closeSync(e){if((e&Fa)==0)return this.baseFs.closeSync(e);let r=this.fdMap.get(e);if(typeof r=="undefined")throw en("closeSync");this.fdMap.delete(e);let[i,n]=r;return i.closeSync(n)}createReadStream(e,r){return e===null?this.baseFs.createReadStream(e,r):this.makeCallSync(e,()=>this.baseFs.createReadStream(e,r),(i,{archivePath:n,subPath:s})=>{let o=i.createReadStream(s,r);return o.path=H.fromPortablePath(this.pathUtils.join(n,s)),o})}createWriteStream(e,r){return e===null?this.baseFs.createWriteStream(e,r):this.makeCallSync(e,()=>this.baseFs.createWriteStream(e,r),(i,{subPath:n})=>i.createWriteStream(n,r))}async realpathPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.realpathPromise(e),async(r,{archivePath:i,subPath:n})=>{let s=this.realPaths.get(i);return typeof s=="undefined"&&(s=await this.baseFs.realpathPromise(i),this.realPaths.set(i,s)),this.pathUtils.join(s,this.pathUtils.relative(Ke.root,await r.realpathPromise(n)))})}realpathSync(e){return this.makeCallSync(e,()=>this.baseFs.realpathSync(e),(r,{archivePath:i,subPath:n})=>{let s=this.realPaths.get(i);return typeof s=="undefined"&&(s=this.baseFs.realpathSync(i),this.realPaths.set(i,s)),this.pathUtils.join(s,this.pathUtils.relative(Ke.root,r.realpathSync(n)))})}async existsPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.existsPromise(e),async(r,{subPath:i})=>await r.existsPromise(i))}existsSync(e){return this.makeCallSync(e,()=>this.baseFs.existsSync(e),(r,{subPath:i})=>r.existsSync(i))}async accessPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.accessPromise(e,r),async(i,{subPath:n})=>await i.accessPromise(n,r))}accessSync(e,r){return this.makeCallSync(e,()=>this.baseFs.accessSync(e,r),(i,{subPath:n})=>i.accessSync(n,r))}async statPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.statPromise(e,r),async(i,{subPath:n})=>await i.statPromise(n,r))}statSync(e,r){return this.makeCallSync(e,()=>this.baseFs.statSync(e,r),(i,{subPath:n})=>i.statSync(n,r))}async fstatPromise(e,r){if((e&Fa)==0)return this.baseFs.fstatPromise(e,r);let i=this.fdMap.get(e);if(typeof i=="undefined")throw en("fstat");let[n,s]=i;return n.fstatPromise(s,r)}fstatSync(e,r){if((e&Fa)==0)return this.baseFs.fstatSync(e,r);let i=this.fdMap.get(e);if(typeof i=="undefined")throw en("fstatSync");let[n,s]=i;return n.fstatSync(s,r)}async lstatPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.lstatPromise(e,r),async(i,{subPath:n})=>await i.lstatPromise(n,r))}lstatSync(e,r){return this.makeCallSync(e,()=>this.baseFs.lstatSync(e,r),(i,{subPath:n})=>i.lstatSync(n,r))}async chmodPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.chmodPromise(e,r),async(i,{subPath:n})=>await i.chmodPromise(n,r))}chmodSync(e,r){return this.makeCallSync(e,()=>this.baseFs.chmodSync(e,r),(i,{subPath:n})=>i.chmodSync(n,r))}async chownPromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.chownPromise(e,r,i),async(n,{subPath:s})=>await n.chownPromise(s,r,i))}chownSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.chownSync(e,r,i),(n,{subPath:s})=>n.chownSync(s,r,i))}async renamePromise(e,r){return await this.makeCallPromise(e,async()=>await this.makeCallPromise(r,async()=>await this.baseFs.renamePromise(e,r),async()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})}),async(i,{subPath:n})=>await this.makeCallPromise(r,async()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})},async(s,{subPath:o})=>{if(i!==s)throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"});return await i.renamePromise(n,o)}))}renameSync(e,r){return this.makeCallSync(e,()=>this.makeCallSync(r,()=>this.baseFs.renameSync(e,r),()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})}),(i,{subPath:n})=>this.makeCallSync(r,()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})},(s,{subPath:o})=>{if(i!==s)throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"});return i.renameSync(n,o)}))}async copyFilePromise(e,r,i=0){let n=async(s,o,a,l)=>{if((i&Zh.constants.COPYFILE_FICLONE_FORCE)!=0)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${o}' -> ${l}'`),{code:"EXDEV"});if(i&Zh.constants.COPYFILE_EXCL&&await this.existsPromise(o))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${o}' -> '${l}'`),{code:"EEXIST"});let c;try{c=await s.readFilePromise(o)}catch(u){throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${o}' -> '${l}'`),{code:"EINVAL"})}await a.writeFilePromise(l,c)};return await this.makeCallPromise(e,async()=>await this.makeCallPromise(r,async()=>await this.baseFs.copyFilePromise(e,r,i),async(s,{subPath:o})=>await n(this.baseFs,e,s,o)),async(s,{subPath:o})=>await this.makeCallPromise(r,async()=>await n(s,o,this.baseFs,r),async(a,{subPath:l})=>s!==a?await n(s,o,a,l):await s.copyFilePromise(o,l,i)))}copyFileSync(e,r,i=0){let n=(s,o,a,l)=>{if((i&Zh.constants.COPYFILE_FICLONE_FORCE)!=0)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${o}' -> ${l}'`),{code:"EXDEV"});if(i&Zh.constants.COPYFILE_EXCL&&this.existsSync(o))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${o}' -> '${l}'`),{code:"EEXIST"});let c;try{c=s.readFileSync(o)}catch(u){throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${o}' -> '${l}'`),{code:"EINVAL"})}a.writeFileSync(l,c)};return this.makeCallSync(e,()=>this.makeCallSync(r,()=>this.baseFs.copyFileSync(e,r,i),(s,{subPath:o})=>n(this.baseFs,e,s,o)),(s,{subPath:o})=>this.makeCallSync(r,()=>n(s,o,this.baseFs,r),(a,{subPath:l})=>s!==a?n(s,o,a,l):s.copyFileSync(o,l,i)))}async appendFilePromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.appendFilePromise(e,r,i),async(n,{subPath:s})=>await n.appendFilePromise(s,r,i))}appendFileSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.appendFileSync(e,r,i),(n,{subPath:s})=>n.appendFileSync(s,r,i))}async writeFilePromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.writeFilePromise(e,r,i),async(n,{subPath:s})=>await n.writeFilePromise(s,r,i))}writeFileSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.writeFileSync(e,r,i),(n,{subPath:s})=>n.writeFileSync(s,r,i))}async unlinkPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.unlinkPromise(e),async(r,{subPath:i})=>await r.unlinkPromise(i))}unlinkSync(e){return this.makeCallSync(e,()=>this.baseFs.unlinkSync(e),(r,{subPath:i})=>r.unlinkSync(i))}async utimesPromise(e,r,i){return await this.makeCallPromise(e,async()=>await this.baseFs.utimesPromise(e,r,i),async(n,{subPath:s})=>await n.utimesPromise(s,r,i))}utimesSync(e,r,i){return this.makeCallSync(e,()=>this.baseFs.utimesSync(e,r,i),(n,{subPath:s})=>n.utimesSync(s,r,i))}async mkdirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.mkdirPromise(e,r),async(i,{subPath:n})=>await i.mkdirPromise(n,r))}mkdirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.mkdirSync(e,r),(i,{subPath:n})=>i.mkdirSync(n,r))}async rmdirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.rmdirPromise(e,r),async(i,{subPath:n})=>await i.rmdirPromise(n,r))}rmdirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.rmdirSync(e,r),(i,{subPath:n})=>i.rmdirSync(n,r))}async linkPromise(e,r){return await this.makeCallPromise(r,async()=>await this.baseFs.linkPromise(e,r),async(i,{subPath:n})=>await i.linkPromise(e,n))}linkSync(e,r){return this.makeCallSync(r,()=>this.baseFs.linkSync(e,r),(i,{subPath:n})=>i.linkSync(e,n))}async symlinkPromise(e,r,i){return await this.makeCallPromise(r,async()=>await this.baseFs.symlinkPromise(e,r,i),async(n,{subPath:s})=>await n.symlinkPromise(e,s))}symlinkSync(e,r,i){return this.makeCallSync(r,()=>this.baseFs.symlinkSync(e,r,i),(n,{subPath:s})=>n.symlinkSync(e,s))}async readFilePromise(e,r){return this.makeCallPromise(e,async()=>{switch(r){case"utf8":return await this.baseFs.readFilePromise(e,r);default:return await this.baseFs.readFilePromise(e,r)}},async(i,{subPath:n})=>await i.readFilePromise(n,r))}readFileSync(e,r){return this.makeCallSync(e,()=>{switch(r){case"utf8":return this.baseFs.readFileSync(e,r);default:return this.baseFs.readFileSync(e,r)}},(i,{subPath:n})=>i.readFileSync(n,r))}async readdirPromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.readdirPromise(e,r),async(i,{subPath:n})=>await i.readdirPromise(n,r),{requireSubpath:!1})}readdirSync(e,r){return this.makeCallSync(e,()=>this.baseFs.readdirSync(e,r),(i,{subPath:n})=>i.readdirSync(n,r),{requireSubpath:!1})}async readlinkPromise(e){return await this.makeCallPromise(e,async()=>await this.baseFs.readlinkPromise(e),async(r,{subPath:i})=>await r.readlinkPromise(i))}readlinkSync(e){return this.makeCallSync(e,()=>this.baseFs.readlinkSync(e),(r,{subPath:i})=>r.readlinkSync(i))}async truncatePromise(e,r){return await this.makeCallPromise(e,async()=>await this.baseFs.truncatePromise(e,r),async(i,{subPath:n})=>await i.truncatePromise(n,r))}truncateSync(e,r){return this.makeCallSync(e,()=>this.baseFs.truncateSync(e,r),(i,{subPath:n})=>i.truncateSync(n,r))}watch(e,r,i){return this.makeCallSync(e,()=>this.baseFs.watch(e,r,i),(n,{subPath:s})=>n.watch(s,r,i))}watchFile(e,r,i){return this.makeCallSync(e,()=>this.baseFs.watchFile(e,r,i),()=>zE(this,e,r,i))}unwatchFile(e,r){return this.makeCallSync(e,()=>this.baseFs.unwatchFile(e,r),()=>zh(this,e,r))}async makeCallPromise(e,r,i,{requireSubpath:n=!0}={}){if(typeof e!="string")return await r();let s=this.resolve(e),o=this.findZip(s);return o?n&&o.subPath==="/"?await r():await this.getZipPromise(o.archivePath,async a=>await i(a,o)):await r()}makeCallSync(e,r,i,{requireSubpath:n=!0}={}){if(typeof e!="string")return r();let s=this.resolve(e),o=this.findZip(s);return!o||n&&o.subPath==="/"?r():this.getZipSync(o.archivePath,a=>i(a,o))}findZip(e){if(this.filter&&!this.filter.test(e))return null;let r="";for(;;){let i=e.substring(r.length),n;if(!this.fileExtensions)n=wM(i,".zip");else for(let s of this.fileExtensions)if(n=wM(i,s),n)break;if(!n)return null;if(r=this.pathUtils.join(r,n),this.isZip.has(r)===!1){if(this.notZip.has(r))continue;try{if(!this.baseFs.lstatSync(r).isFile()){this.notZip.add(r);continue}}catch{return null}this.isZip.add(r)}return{archivePath:r,subPath:this.pathUtils.join(Ke.root,e.substring(r.length))}}}limitOpenFiles(e){if(this.zipInstances===null)return;let r=Date.now(),i=r+this.maxAge,n=e===null?0:this.zipInstances.size-e;for(let[s,{zipFs:o,expiresAt:a,refCount:l}]of this.zipInstances.entries())if(!(l!==0||o.hasOpenFileHandles())){if(r>=a){o.saveAndClose(),this.zipInstances.delete(s),n-=1;continue}else if(e===null||n<=0){i=a;break}o.saveAndClose(),this.zipInstances.delete(s),n-=1}this.limitOpenFilesTimeout===null&&(e===null&&this.zipInstances.size>0||e!==null)&&(this.limitOpenFilesTimeout=setTimeout(()=>{this.limitOpenFilesTimeout=null,this.limitOpenFiles(null)},i-r).unref())}async getZipPromise(e,r){let i=async()=>({baseFs:this.baseFs,libzip:this.libzip,readOnly:this.readOnlyArchives,stats:await this.baseFs.statPromise(e)});if(this.zipInstances){let n=this.zipInstances.get(e);if(!n){let s=await i();n=this.zipInstances.get(e),n||(n={zipFs:new Ai(e,s),expiresAt:0,refCount:0})}this.zipInstances.delete(e),this.limitOpenFiles(this.maxOpenFiles-1),this.zipInstances.set(e,n),n.expiresAt=Date.now()+this.maxAge,n.refCount+=1;try{return await r(n.zipFs)}finally{n.refCount-=1}}else{let n=new Ai(e,await i());try{return await r(n)}finally{n.saveAndClose()}}}getZipSync(e,r){let i=()=>({baseFs:this.baseFs,libzip:this.libzip,readOnly:this.readOnlyArchives,stats:this.baseFs.statSync(e)});if(this.zipInstances){let n=this.zipInstances.get(e);return n||(n={zipFs:new Ai(e,i()),expiresAt:0,refCount:0}),this.zipInstances.delete(e),this.limitOpenFiles(this.maxOpenFiles-1),this.zipInstances.set(e,n),n.expiresAt=Date.now()+this.maxAge,r(n.zipFs)}else{let n=new Ai(e,i());try{return r(n)}finally{n.saveAndClose()}}}};var Wu=ge(require("util"));var VE=ge(require("url"));var vQ=class extends bi{constructor(e){super(H);this.baseFs=e}mapFromBase(e){return e}mapToBase(e){return e instanceof VE.URL?(0,VE.fileURLToPath)(e):e}};var xfe=new Set(["accessSync","appendFileSync","createReadStream","createWriteStream","chmodSync","chownSync","closeSync","copyFileSync","linkSync","lstatSync","fstatSync","lutimesSync","mkdirSync","openSync","opendirSync","readlinkSync","readFileSync","readdirSync","readlinkSync","realpathSync","renameSync","rmdirSync","statSync","symlinkSync","truncateSync","unlinkSync","unwatchFile","utimesSync","watch","watchFile","writeFileSync","writeSync"]),BM=new Set(["accessPromise","appendFilePromise","chmodPromise","chownPromise","closePromise","copyFilePromise","linkPromise","fstatPromise","lstatPromise","lutimesPromise","mkdirPromise","openPromise","opendirPromise","readdirPromise","realpathPromise","readFilePromise","readdirPromise","readlinkPromise","renamePromise","rmdirPromise","statPromise","symlinkPromise","truncatePromise","unlinkPromise","utimesPromise","writeFilePromise","writeSync"]),Pfe=new Set(["appendFilePromise","chmodPromise","chownPromise","closePromise","readPromise","readFilePromise","statPromise","truncatePromise","utimesPromise","writePromise","writeFilePromise"]);function SQ(t,e){e=new vQ(e);let r=(i,n,s)=>{let o=i[n];i[n]=s,typeof(o==null?void 0:o[Wu.promisify.custom])!="undefined"&&(s[Wu.promisify.custom]=o[Wu.promisify.custom])};{r(t,"exists",(i,...n)=>{let o=typeof n[n.length-1]=="function"?n.pop():()=>{};process.nextTick(()=>{e.existsPromise(i).then(a=>{o(a)},()=>{o(!1)})})}),r(t,"read",(...i)=>{let[n,s,o,a,l,c]=i;if(i.length<=3){let u={};i.length<3?c=i[1]:(u=i[1],c=i[2]),{buffer:s=Buffer.alloc(16384),offset:o=0,length:a=s.byteLength,position:l}=u}if(o==null&&(o=0),a|=0,a===0){process.nextTick(()=>{c(null,0,s)});return}l==null&&(l=-1),process.nextTick(()=>{e.readPromise(n,s,o,a,l).then(u=>{c(null,u,s)},u=>{c(u,0,s)})})});for(let i of BM){let n=i.replace(/Promise$/,"");if(typeof t[n]=="undefined")continue;let s=e[i];if(typeof s=="undefined")continue;r(t,n,(...a)=>{let c=typeof a[a.length-1]=="function"?a.pop():()=>{};process.nextTick(()=>{s.apply(e,a).then(u=>{c(null,u)},u=>{c(u)})})})}t.realpath.native=t.realpath}{r(t,"existsSync",i=>{try{return e.existsSync(i)}catch(n){return!1}}),r(t,"readSync",(...i)=>{let[n,s,o,a,l]=i;return i.length<=3&&({offset:o=0,length:a=s.byteLength,position:l}=i[2]||{}),o==null&&(o=0),a|=0,a===0?0:(l==null&&(l=-1),e.readSync(n,s,o,a,l))});for(let i of xfe){let n=i;if(typeof t[n]=="undefined")continue;let s=e[i];typeof s!="undefined"&&r(t,n,s.bind(e))}t.realpathSync.native=t.realpathSync}{let i=process.emitWarning;process.emitWarning=()=>{};let n;try{n=t.promises}finally{process.emitWarning=i}if(typeof n!="undefined"){for(let o of BM){let a=o.replace(/Promise$/,"");if(typeof n[a]=="undefined")continue;let l=e[o];typeof l!="undefined"&&o!=="open"&&r(n,a,l.bind(e))}class s{constructor(a){this.fd=a}}for(let o of Pfe){let a=o.replace(/Promise$/,""),l=e[o];typeof l!="undefined"&&r(s.prototype,a,function(...c){return l.call(e,this.fd,...c)})}r(n,"open",async(...o)=>{let a=await e.openPromise(...o);return new s(a)})}}t.read[Wu.promisify.custom]=async(i,n,...s)=>({bytesRead:await e.readPromise(i,n,...s),buffer:n}),t.write[Wu.promisify.custom]=async(i,n,...s)=>({bytesWritten:await e.writePromise(i,n,...s),buffer:n})}function XE(t,e){let r=Object.create(t);return SQ(r,e),r}var bM=ge(require("os"));function QM(t){let e=Math.ceil(Math.random()*4294967296).toString(16).padStart(8,"0");return`${t}${e}`}var io=new Set,kQ=null;function vM(){if(kQ)return kQ;let t=H.toPortablePath(bM.default.tmpdir()),e=K.realpathSync(t);return process.once("exit",()=>{K.rmtempSync()}),kQ={tmpdir:t,realTmpdir:e}}var K=Object.assign(new ar,{detachTemp(t){io.delete(t)},mktempSync(t){let{tmpdir:e,realTmpdir:r}=vM();for(;;){let i=QM("xfs-");try{this.mkdirSync(x.join(e,i))}catch(s){if(s.code==="EEXIST")continue;throw s}let n=x.join(r,i);if(io.add(n),typeof t=="undefined")return n;try{return t(n)}finally{if(io.has(n)){io.delete(n);try{this.removeSync(n)}catch{}}}}},async mktempPromise(t){let{tmpdir:e,realTmpdir:r}=vM();for(;;){let i=QM("xfs-");try{await this.mkdirPromise(x.join(e,i))}catch(s){if(s.code==="EEXIST")continue;throw s}let n=x.join(r,i);if(io.add(n),typeof t=="undefined")return n;try{return await t(n)}finally{if(io.has(n)){io.delete(n);try{await this.removePromise(n)}catch{}}}}},async rmtempPromise(){await Promise.all(Array.from(io.values()).map(async t=>{try{await K.removePromise(t,{maxRetries:0}),io.delete(t)}catch{}}))},rmtempSync(){for(let t of io)try{K.removeSync(t),io.delete(t)}catch{}}});var Px=ge(MQ());var ap={};ft(ap,{parseResolution:()=>iI,parseShell:()=>$E,parseSyml:()=>Qi,stringifyArgument:()=>GQ,stringifyArgumentSegment:()=>jQ,stringifyArithmeticExpression:()=>rI,stringifyCommand:()=>HQ,stringifyCommandChain:()=>Xu,stringifyCommandChainThen:()=>UQ,stringifyCommandLine:()=>eI,stringifyCommandLineThen:()=>KQ,stringifyEnvSegment:()=>tI,stringifyRedirectArgument:()=>ep,stringifyResolution:()=>nI,stringifyShell:()=>Vu,stringifyShellLine:()=>Vu,stringifySyml:()=>La,stringifyValueArgument:()=>oc});var dK=ge(pK());function $E(t,e={isGlobPattern:()=>!1}){try{return(0,dK.parse)(t,e)}catch(r){throw r.location&&(r.message=r.message.replace(/(\.)?$/,` (line ${r.location.start.line}, column ${r.location.start.column})$1`)),r}}function Vu(t,{endSemicolon:e=!1}={}){return t.map(({command:r,type:i},n)=>`${eI(r)}${i===";"?n!==t.length-1||e?";":"":" &"}`).join(" ")}function eI(t){return`${Xu(t.chain)}${t.then?` ${KQ(t.then)}`:""}`}function KQ(t){return`${t.type} ${eI(t.line)}`}function Xu(t){return`${HQ(t)}${t.then?` ${UQ(t.then)}`:""}`}function UQ(t){return`${t.type} ${Xu(t.chain)}`}function HQ(t){switch(t.type){case"command":return`${t.envs.length>0?`${t.envs.map(e=>tI(e)).join(" ")} `:""}${t.args.map(e=>GQ(e)).join(" ")}`;case"subshell":return`(${Vu(t.subshell)})${t.args.length>0?` ${t.args.map(e=>ep(e)).join(" ")}`:""}`;case"group":return`{ ${Vu(t.group,{endSemicolon:!0})} }${t.args.length>0?` ${t.args.map(e=>ep(e)).join(" ")}`:""}`;case"envs":return t.envs.map(e=>tI(e)).join(" ");default:throw new Error(`Unsupported command type:  "${t.type}"`)}}function tI(t){return`${t.name}=${t.args[0]?oc(t.args[0]):""}`}function GQ(t){switch(t.type){case"redirection":return ep(t);case"argument":return oc(t);default:throw new Error(`Unsupported argument type: "${t.type}"`)}}function ep(t){return`${t.subtype} ${t.args.map(e=>oc(e)).join(" ")}`}function oc(t){return t.segments.map(e=>jQ(e)).join("")}function jQ(t){let e=(i,n)=>n?`"${i}"`:i,r=i=>i===""?'""':i.match(/[(){}<>$|&; \t"']/)?`$'${i.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0")}'`:i;switch(t.type){case"text":return r(t.text);case"glob":return t.pattern;case"shell":return e(`\${${Vu(t.shell)}}`,t.quoted);case"variable":return e(typeof t.defaultValue=="undefined"?typeof t.alternativeValue=="undefined"?`\${${t.name}}`:t.alternativeValue.length===0?`\${${t.name}:+}`:`\${${t.name}:+${t.alternativeValue.map(i=>oc(i)).join(" ")}}`:t.defaultValue.length===0?`\${${t.name}:-}`:`\${${t.name}:-${t.defaultValue.map(i=>oc(i)).join(" ")}}`,t.quoted);case"arithmetic":return`$(( ${rI(t.arithmetic)} ))`;default:throw new Error(`Unsupported argument segment type: "${t.type}"`)}}function rI(t){let e=n=>{switch(n){case"addition":return"+";case"subtraction":return"-";case"multiplication":return"*";case"division":return"/";default:throw new Error(`Can't extract operator from arithmetic expression of type "${n}"`)}},r=(n,s)=>s?`( ${n} )`:n,i=n=>r(rI(n),!["number","variable"].includes(n.type));switch(t.type){case"number":return String(t.value);case"variable":return t.name;default:return`${i(t.left)} ${e(t.type)} ${i(t.right)}`}}var EK=ge(mK());function iI(t){let e=t.match(/^\*{1,2}\/(.*)/);if(e)throw new Error(`The override for '${t}' includes a glob pattern. Glob patterns have been removed since their behaviours don't match what you'd expect. Set the override to '${e[1]}' instead.`);try{return(0,EK.parse)(t)}catch(r){throw r.location&&(r.message=r.message.replace(/(\.)?$/,` (line ${r.location.start.line}, column ${r.location.start.column})$1`)),r}}function nI(t){let e="";return t.from&&(e+=t.from.fullName,t.from.description&&(e+=`@${t.from.description}`),e+="/"),e+=t.descriptor.fullName,t.descriptor.description&&(e+=`@${t.descriptor.description}`),e}var pI=ge(lU()),gU=ge(uU()),Kde=/^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/,fU=["__metadata","version","resolution","dependencies","peerDependencies","dependenciesMeta","peerDependenciesMeta","binaries"],rv=class{constructor(e){this.data=e}};function hU(t){return t.match(Kde)?t:JSON.stringify(t)}function pU(t){return typeof t=="undefined"?!0:typeof t=="object"&&t!==null?Object.keys(t).every(e=>pU(t[e])):!1}function iv(t,e,r){if(t===null)return`null
`;if(typeof t=="number"||typeof t=="boolean")return`${t.toString()}
`;if(typeof t=="string")return`${hU(t)}
`;if(Array.isArray(t)){if(t.length===0)return`[]
`;let i="  ".repeat(e);return`
${t.map(s=>`${i}- ${iv(s,e+1,!1)}`).join("")}`}if(typeof t=="object"&&t){let i,n;t instanceof rv?(i=t.data,n=!1):(i=t,n=!0);let s="  ".repeat(e),o=Object.keys(i);n&&o.sort((l,c)=>{let u=fU.indexOf(l),g=fU.indexOf(c);return u===-1&&g===-1?l<c?-1:l>c?1:0:u!==-1&&g===-1?-1:u===-1&&g!==-1?1:u-g});let a=o.filter(l=>!pU(i[l])).map((l,c)=>{let u=i[l],g=hU(l),f=iv(u,e+1,!0),h=c>0||r?s:"",p=g.length>1024?`? ${g}
${h}:`:`${g}:`,m=f.startsWith(`
`)?f:` ${f}`;return`${h}${p}${m}`}).join(e===0?`
`:"")||`
`;return r?`
${a}`:`${a}`}throw new Error(`Unsupported value type (${t})`)}function La(t){try{let e=iv(t,0,!1);return e!==`
`?e:""}catch(e){throw e.location&&(e.message=e.message.replace(/(\.)?$/,` (line ${e.location.start.line}, column ${e.location.start.column})$1`)),e}}La.PreserveOrdering=rv;function Ude(t){return t.endsWith(`
`)||(t+=`
`),(0,gU.parse)(t)}var Hde=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i;function Gde(t){if(Hde.test(t))return Ude(t);let e=(0,pI.safeLoad)(t,{schema:pI.FAILSAFE_SCHEMA,json:!0});if(e==null)return{};if(typeof e!="object")throw new Error(`Expected an indexed object, got a ${typeof e} instead. Does your file follow Yaml's rules?`);if(Array.isArray(e))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return e}function Qi(t){return Gde(t)}var i4=ge(CU()),ww=ge(pc());var mp={};ft(mp,{Builtins:()=>mv,Cli:()=>ys,Command:()=>Re,Option:()=>W,UsageError:()=>Pe,formatMarkdownish:()=>Ui});var dc=0,Ap=1,tn=2,sv="