create-spree-app 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -122,7 +122,7 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu
122
122
  `,LF:`
123
123
  `,concatBytes:po},pg=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},Dg={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:pg};import{Buffer as dg}from"buffer";var Sc=(t,e)=>t?void 0:mg.bind(void 0,e),mg=function*(t,e){if(typeof e!="string"&&!B(e)&&!dg.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},Fc=(t,e)=>t?fg.bind(void 0,e):hg.bind(void 0,e),fg=function*(t,e){wc(t,e),yield e},hg=function*(t,e){if(wc(t,e),typeof e!="string"&&!B(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},wc=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
124
124
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
125
- if (condition) { yield value; }`)};import{Buffer as gg}from"buffer";import{StringDecoder as bg}from"string_decoder";var br=(t,e,r)=>{if(r)return;if(t)return{transform:Eg.bind(void 0,new TextEncoder)};let n=new bg(e);return{transform:Cg.bind(void 0,n),final:yg.bind(void 0,n)}},Eg=function*(t,e){gg.isBuffer(e)?yield Q(e):typeof e=="string"?yield t.encode(e):yield e},Cg=function*(t,e){yield B(e)?t.write(e):e},yg=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as xc}from"util";var mo=xc(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let o of e.currentIterable)n.push(o)}finally{delete e.currentIterable}}),Er=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Fg}=e[r];for await(let o of n(t))yield*Er(o,e,r+1)},Ac=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Sg(r,Number(e),t)},Sg=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*Er(n,r,e+1)},Oc=xc(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Fg=function*(t){yield t};var fo=(t,e,r,n)=>{try{for(let o of t(...e))r.push(o);n()}catch(o){n(o)}},$c=(t,e)=>[...e.flatMap(r=>[...ge(r,t,0)]),...rt(t)],ge=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=xg}=e[r];for(let o of n(t))yield*ge(o,e,r+1)},rt=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*wg(r,Number(e),t)},wg=function*(t,e,r){if(t!==void 0)for(let n of t())yield*ge(n,r,e+1)},xg=function*(t){yield t};var ho=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:o},optionName:s},{encoding:i})=>{let a={},u=Bc(t,i,s),c=he(e),l=he(r),p=c?mo.bind(void 0,Er,a):fo.bind(void 0,ge),D=c||l?mo.bind(void 0,Ac,a):fo.bind(void 0,rt),m=c||l?Oc.bind(void 0,a):void 0;return{stream:new Ag({writableObjectMode:n,writableHighWaterMark:_c(n),readableObjectMode:o,readableHighWaterMark:_c(o),transform(g,S,E){p([g,u,0],this,E)},flush(g){D([u],this,g)},destroy:m})}},Cr=(t,e,r,n)=>{let o=e.filter(({type:i})=>i==="generator"),s=n?o.reverse():o;for(let{value:i,optionName:a}of s){let u=Bc(i,r,a);t=$c(u,t)}return t},Bc=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:s},i,a)=>{let u={};return[{transform:Sc(n,a)},br(r,i,n),gr(r,s,n,u),{transform:t,final:e},{transform:Fc(o,a)},yc({binary:r,preserveNewlines:s,readableObjectMode:o,state:u})].filter(Boolean)};var Tc=(t,e)=>{for(let r of Og(t))$g(t,r,e)},Og=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),$g=(t,e,r)=>{let{stdioItems:n}=t[e],o=n.filter(({contents:a})=>a!==void 0);if(o.length===0)return;if(e!==0){let[{type:a,optionName:u}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${ce[a]} with synchronous methods.`)}let i=o.map(({contents:a})=>a).map(a=>_g(a,n));r.input=ze(i)},_g=(t,e)=>{let r=Cr(t,e,"utf8",!0);return Bg(r),ze(r)},Bg=t=>{let e=t.find(r=>typeof r!="string"&&!B(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as Rg,appendFileSync as Mg}from"fs";var yr=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Ae(r,n)&&!P.has(e)&&Tg(n)&&(t.some(({type:o,value:s})=>o==="native"&&vg.has(s))||t.every(({type:o})=>j.has(o))),Tg=t=>t===1||t===2,vg=new Set(["pipe","overlapped"]),vc=async(t,e,r,n)=>{for await(let o of t)Ig(e)||Rc(o,r,n)},Ic=(t,e,r)=>{for(let n of t)Rc(n,e,r)},Ig=t=>t._readableState.pipes.length>0,Rc=(t,e,r)=>{let n=It(t);q({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var Mc=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(e===null)return{output:Array.from({length:3})};let s={},i=new Set([]);return{output:e.map((u,c)=>Pg({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:i,isMaxBuffer:n,verboseInfo:o},r)),...s}},Pg=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:s,verboseInfo:i},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:p})=>{if(t===null)return;let D=Pu(t,s,p),m=Q(D),{stdioItems:f,objectMode:g}=e[r],S=kg([m],f,u,n),{serializedResult:E,finalResult:$=E}=Lg({chunks:S,objectMode:g,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});jg({serializedResult:E,fdNumber:r,state:n,verboseInfo:i,encoding:u,stdioItems:f,objectMode:g});let T=a[r]?$:void 0;try{return n.error===void 0&&Ng(E,f,o),T}catch(C){return n.error=C,T}},kg=(t,e,r,n)=>{try{return Cr(t,e,r,!1)}catch(o){return n.error=o,t}},Lg=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:o,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:ze(t)};let i=Ji(t,r);return n[s]?{serializedResult:i,finalResult:Do(i,!o[s],e)}:{serializedResult:i}},jg=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:o,stdioItems:s,objectMode:i})=>{if(!yr({stdioItems:s,encoding:o,verboseInfo:n,fdNumber:e}))return;let a=Do(t,!1,i);try{Ic(a,e,n)}catch(u){r.error??=u}},Ng=(t,e,r)=>{for(let{path:n,append:o}of e.filter(({type:s})=>fr.has(s))){let s=typeof n=="string"?n:n.toString();o||r.has(s)?Mg(n,t):(r.add(s),Rg(n,t))}};var Pc=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,re(e,r,"all")]:Array.isArray(e)?[re(t,r,"all"),...e]:B(t)&&B(e)?yn([t,e]):`${t}${e}`};import{once as go}from"events";var kc=async(t,e)=>{let[r,n]=await Ug(t);return e.isForcefullyTerminated??=!1,[r,n]},Ug=async t=>{let[e,r]=await Promise.allSettled([go(t,"spawn"),go(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?Lc(t):r.value},Lc=async t=>{try{return await go(t,"exit")}catch{return Lc(t)}},jc=async t=>{let[e,r]=await t;if(!Vg(e,r)&&bo(e,r))throw new G;return[e,r]},Vg=(t,e)=>t===void 0&&e===void 0,bo=(t,e)=>t!==0||e!==null;var Nc=({error:t,status:e,signal:r,output:n},{maxBuffer:o})=>{let s=Gg(t,e,r),i=s?.code==="ETIMEDOUT",a=Mu(s,n,o);return{resultError:s,exitCode:e,signal:r,timedOut:i,isMaxBuffer:a}},Gg=(t,e,r)=>t!==void 0?t:bo(e,r)?new G:void 0;var Uc=(t,e,r)=>{let{file:n,commandArguments:o,command:s,escapedCommand:i,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=Hg(t,e,r),p=Yg({file:n,commandArguments:o,options:c,command:s,escapedCommand:i,verboseInfo:u,fileDescriptors:l,startTime:a});return Me(p,u,c)},Hg=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=Mt(t,e,r),a=zg(r),{file:u,commandArguments:c,options:l}=rr(t,e,a);qg(l);let p=gc(l,i);return{file:u,commandArguments:c,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},zg=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,qg=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&Sr("ipcInput"),t&&Sr("ipc: true"),r&&Sr("detached: true"),n&&Sr("cancelSignal")},Sr=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Yg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,verboseInfo:s,fileDescriptors:i,startTime:a})=>{let u=Kg({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:a});if(u.failed)return u;let{resultError:c,exitCode:l,signal:p,timedOut:D,isMaxBuffer:m}=Nc(u,r),{output:f,error:g=c}=Mc({fileDescriptors:i,syncResult:u,options:r,isMaxBuffer:m,verboseInfo:s}),S=f.map(($,T)=>re($,r,T)),E=re(Pc(f,r),r,"all");return Xg({error:g,exitCode:l,signal:p,timedOut:D,isMaxBuffer:m,stdio:S,all:E,options:r,command:n,escapedCommand:o,startTime:a})},Kg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:i})=>{try{Tc(s,r);let a=Jg(r);return Wg(...nr(t,e,a))}catch(a){return Re({error:a,command:n,escapedCommand:o,fileDescriptors:s,options:r,startTime:i,isSync:!0})}},Jg=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:pr(e)}),Xg=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:o,stdio:s,all:i,options:a,command:u,escapedCommand:c,startTime:l})=>t===void 0?Dr({command:u,escapedCommand:c,stdio:s,all:i,ipcOutput:[],options:a,startTime:l}):tt({error:t,command:u,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:s,all:i,ipcOutput:[],options:a,startTime:l,isSync:!0});import{setMaxListeners as LE}from"events";import{spawn as jE}from"child_process";import zc from"process";import{once as Eo,on as Zg}from"events";var Vc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0,filter:s}={})=>(_e({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Jt(t)}),Qg({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:o})),Qg=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:o})=>{zt(e,o);let s=ue(t,e,r),i=new AbortController;try{return await Promise.race([eb(s,n,i),tb(s,r,i),rb(s,r,i)])}catch(a){throw Be(t),a}finally{i.abort(),qt(e,o)}},eb=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await Eo(t,"message",{signal:r});return n}for await(let[n]of Zg(t,"message",{signal:r}))if(e(n))return n},tb=async(t,e,{signal:r})=>{await Eo(t,"disconnect",{signal:r}),$a(e)},rb=async(t,e,{signal:r})=>{let[n]=await Eo(t,"strict:error",{signal:r});throw Gt(n,e)};import{once as Wc,on as nb}from"events";var Hc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0}={})=>Co({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),Co=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:o,reference:s})=>{_e({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Jt(t)}),zt(e,s);let i=ue(t,e,r),a=new AbortController,u={};return ob(t,i,a),ib({ipcEmitter:i,isSubprocess:r,controller:a,state:u}),sb({anyProcess:t,channel:e,ipcEmitter:i,isSubprocess:r,shouldAwait:o,controller:a,state:u,reference:s})},ob=async(t,e,r)=>{try{await Wc(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},ib=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[o]=await Wc(t,"strict:error",{signal:r.signal});n.error=Gt(o,e),r.abort()}catch{}},sb=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:s,state:i,reference:a}){try{for await(let[u]of nb(r,"message",{signal:s.signal}))Gc(i),yield u}catch{Gc(i)}finally{s.abort(),qt(e,a),n||Be(t),o&&await t}},Gc=({error:t})=>{if(t)throw t};var qc=(t,{ipc:e})=>{Object.assign(t,Kc(t,!1,e))},Yc=()=>{let t=zc,e=!0,r=zc.channel!==void 0;return{...Kc(t,e,r),getCancelSignal:tu.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},Kc=(t,e,r)=>({sendMessage:er.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Vc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Hc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as ab}from"child_process";import{PassThrough as ub,Readable as cb,Writable as lb,Duplex as pb}from"stream";var Jc=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,verboseInfo:i})=>{co(n);let a=new ab;Db(a,n),Object.assign(a,{readable:db,writable:mb,duplex:fb});let u=Re({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:!1}),c=hb(u,i,o);return{subprocess:a,promise:c}},Db=(t,e)=>{let r=nt(),n=nt(),o=nt(),s=Array.from({length:e.length-3},nt),i=nt(),a=[r,n,o,...s];Object.assign(t,{stdin:r,stdout:n,stderr:o,all:i,stdio:a})},nt=()=>{let t=new ub;return t.end(),t},db=()=>new cb({read(){}}),mb=()=>new lb({write(){}}),fb=()=>new pb({read(){},write(){}}),hb=async(t,e,r)=>Me(t,e,r);import{createReadStream as Xc,createWriteStream as Zc}from"fs";import{Buffer as gb}from"buffer";import{Readable as ot,Writable as bb,Duplex as Eb}from"stream";var el=(t,e)=>hr(Cb,t,e,!1),it=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ce[t]}.`)},Qc={fileNumber:it,generator:ho,asyncGenerator:ho,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:Eb.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Cb={input:{...Qc,fileUrl:({value:t})=>({stream:Xc(t)}),filePath:({value:{file:t}})=>({stream:Xc(t)}),webStream:({value:t})=>({stream:ot.fromWeb(t)}),iterable:({value:t})=>({stream:ot.from(t)}),asyncIterable:({value:t})=>({stream:ot.from(t)}),string:({value:t})=>({stream:ot.from(t)}),uint8Array:({value:t})=>({stream:ot.from(gb.from(t))})},output:{...Qc,fileUrl:({value:t})=>({stream:Zc(t)}),filePath:({value:{file:t,append:e}})=>({stream:Zc(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:bb.fromWeb(t)}),iterable:it,asyncIterable:it,string:it,uint8Array:it}};import{on as yb,once as tl}from"events";import{PassThrough as Sb,getDefaultHighWaterMark as Fb}from"stream";import{finished as ol}from"stream/promises";function be(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let o of t)So(o);let e=t.some(({readableObjectMode:o})=>o),r=wb(t,e),n=new yo({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of t)n.add(o);return n}var wb=(t,e)=>{if(t.length===0)return Fb(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},yo=class extends Sb{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(e){if(So(e),this.#t.has(e))return;this.#t.add(e),this.#n??=xb(this,this.#t,this.#i);let r=$b({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#i});this.#o.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(So(e),!this.#t.has(e))return!1;let r=this.#o.get(e);return r===void 0?!1:(this.#o.delete(e),e.unpipe(this),await r,!0)}},xb=async(t,e,r)=>{Fr(t,rl);let n=new AbortController;try{await Promise.race([Ab(t,n),Ob(t,e,r,n)])}finally{n.abort(),Fr(t,-rl)}},Ab=async(t,{signal:e})=>{try{await ol(t,{signal:e,cleanup:!0})}catch(r){throw il(t,r),r}},Ob=async(t,e,r,{signal:n})=>{for await(let[o]of yb(t,"unpipe",{signal:n}))e.has(o)&&o.emit(r)},So=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},$b=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,onFinished:s,unpipeEvent:i})=>{Fr(t,nl);let a=new AbortController;try{await Promise.race([_b(s,e,a),Bb({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:a}),Tb({stream:e,streams:r,ended:n,aborted:o,unpipeEvent:i,controller:a})])}finally{a.abort(),Fr(t,-nl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?Fo(t):vb(t))},_b=async(t,e,{signal:r})=>{try{await t,r.aborted||Fo(e)}catch(n){r.aborted||il(e,n)}},Bb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:{signal:s}})=>{try{await ol(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(i){if(s.aborted||!r.has(e))return;sl(i)?o.add(e):al(t,i)}},Tb=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:o,controller:{signal:s}})=>{if(await tl(t,o,{signal:s}),!t.readable)return tl(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},vb=t=>{t.writable&&t.end()},il=(t,e)=>{sl(e)?Fo(t):al(t,e)},sl=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Fo=t=>{(t.readable||t.writable)&&t.destroy()},al=(t,e)=>{t.destroyed||(t.once("error",Ib),t.destroy(e))},Ib=()=>{},Fr=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},rl=2,nl=1;import{finished as ul}from"stream/promises";var ke=(t,e)=>{t.pipe(e),Rb(t,e),Mb(t,e)},Rb=async(t,e)=>{if(!(V(t)||V(e))){try{await ul(t,{cleanup:!0,readable:!0,writable:!1})}catch{}wo(e)}},wo=t=>{t.writable&&t.end()},Mb=async(t,e)=>{if(!(V(t)||V(e))){try{await ul(e,{cleanup:!0,readable:!1,writable:!0})}catch{}xo(t)}},xo=t=>{t.readable&&t.destroy()};var cl=(t,e,r)=>{let n=new Map;for(let[o,{stdioItems:s,direction:i}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:u})=>j.has(u)))Pb(t,a,i,o);for(let{stream:a}of s.filter(({type:u})=>!j.has(u)))Lb({subprocess:t,stream:a,direction:i,fdNumber:o,pipeGroups:n,controller:r})}for(let[o,s]of n.entries()){let i=s.length===1?s[0]:be(s);ke(i,o)}},Pb=(t,e,r,n)=>{r==="output"?ke(t.stdio[n],e):ke(e,t.stdio[n]);let o=kb[n];o!==void 0&&(t[o]=e),t.stdio[n]=e},kb=["stdin","stdout","stderr"],Lb=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:o,controller:s})=>{if(e===void 0)return;jb(e,s);let[i,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=o.get(i)??[];o.set(i,[...u,a])},jb=(t,{signal:e})=>{V(t)&&me(t,Nb,e)},Nb=2;import{addAbortListener as Gb}from"events";var Ee=[];Ee.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ee.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ee.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wr=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Ao=Symbol.for("signal-exit emitter"),Oo=globalThis,Ub=Object.defineProperty.bind(Object),$o=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Oo[Ao])return Oo[Ao];Ub(Oo,Ao,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let o=!1;for(let s of this.listeners[e])o=s(r,n)===!0||o;return e==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},xr=class{},Vb=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),_o=class extends xr{onExit(){return()=>{}}load(){}unload(){}},Bo=class extends xr{#t=To.platform==="win32"?"SIGINT":"SIGHUP";#r=new $o;#e;#n;#i;#o={};#s=!1;constructor(e){super(),this.#e=e,this.#o={};for(let r of Ee)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(o+=s.__signal_exit_emitter__.count),n.length===o){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;i||e.kill(e.pid,a)}};this.#i=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!wr(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of Ee)try{let r=this.#o[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#u(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,Ee.forEach(e=>{let r=this.#o[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#i,this.#r.count-=1)}#a(e){return wr(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#u(e,...r){let n=this.#n;if(e==="exit"&&wr(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,e,...r)}},To=globalThis.process,{onExit:ll,load:J3,unload:X3}=Vb(wr(To)?new Bo(To):new _o);var pl=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let o=ll(()=>{t.kill()});Gb(n,()=>{o()})};var dl=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...o)=>{let s=Rt(),{destination:i,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=Wb(r,n,o),{sourceStream:p,sourceError:D}=zb(t,c),{options:m,fileDescriptors:f}=K.get(t);return{sourcePromise:e,sourceStream:p,sourceOptions:m,sourceError:D,destination:i,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:f,startTime:s}},Wb=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:o,to:s,unpipeSignal:i}={}}=Hb(t,e,...r),a=Ht(n,s);return{destination:n,destinationStream:a,from:o,unpipeSignal:i}}catch(n){return{destinationError:n}}},Hb=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Dl,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||En(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[o,s,i]=wt(r,...n);return{destination:e(Dl)(o,s,i),pipeOptions:i}}if(K.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Dl=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),zb=(t,e)=>{try{return{sourceStream:Te(t,e)}}catch(r){return{sourceError:r}}};var fl=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:s,startTime:i})=>{let a=qb({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw vo({error:a,fileDescriptors:o,sourceOptions:s,startTime:i})},qb=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return xo(t),n;if(e!==void 0)return wo(r),e},vo=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Re({error:t,command:ml,escapedCommand:ml,fileDescriptors:e,options:r,startTime:n,isSync:!1}),ml="source.pipe(destination)";var hl=async t=>{let[{status:e,reason:r,value:n=r},{status:o,reason:s,value:i=s}]=await t;if(i.pipedFrom.includes(n)||i.pipedFrom.push(n),o==="rejected")throw i;if(e==="rejected")throw n;return i};import{finished as Yb}from"stream/promises";var gl=(t,e,r)=>{let n=Ar.has(e)?Jb(t,e):Kb(t,e);return me(t,Zb,r.signal),me(e,Qb,r.signal),Xb(e),n},Kb=(t,e)=>{let r=be([t]);return ke(r,e),Ar.set(e,r),r},Jb=(t,e)=>{let r=Ar.get(e);return r.add(t),r},Xb=async t=>{try{await Yb(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Ar.delete(t)},Ar=new WeakMap,Zb=2,Qb=1;import{aborted as eE}from"util";var bl=(t,e)=>t===void 0?[]:[tE(t,e)],tE=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:s})=>{await eE(t,e),await r.remove(e);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw vo({error:i,fileDescriptors:n,sourceOptions:o,startTime:s})};var Or=(t,...e)=>{if(O(e[0]))return Or.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=dl(t,...e),o=rE({...n,destination:r});return o.pipe=Or.bind(void 0,{...t,source:r,sourcePromise:o,boundOptions:{}}),o},rE=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:o,destinationStream:s,destinationError:i,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=nE(t,o);fl({sourceStream:e,sourceError:n,destinationStream:s,destinationError:i,fileDescriptors:u,sourceOptions:r,startTime:c});let p=new AbortController;try{let D=gl(e,s,p);return await Promise.race([hl(l),...bl(a,{sourceStream:e,mergedStream:D,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{p.abort()}},nE=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as lE}from"timers/promises";import{on as oE}from"events";import{getDefaultHighWaterMark as iE}from"stream";var $r=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:o,preserveNewlines:s})=>{let i=new AbortController;return sE(e,i),Cl({stream:t,controller:i,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:o,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},sE=async(t,e)=>{try{await t}catch{}finally{e.abort()}},Io=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:o,allMixed:s})=>{let i=new AbortController;aE(e,i,t);let a=t.readableObjectMode&&!s;return Cl({stream:t,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},aE=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},Cl=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})=>{let a=oE(t,"data",{signal:e.signal,highWaterMark:El,highWatermark:El});return uE({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})},Ro=iE(!0),El=Ro,uE=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i}){let a=cE({binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i});try{for await(let[u]of t)yield*ge(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*rt(a)}},cE=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:o})=>[br(t,r,!e),gr(t,o,!n,{})].filter(Boolean);var yl=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:o,maxBuffer:s,lines:i,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{let p=pE({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:c,streamInfo:l});if(!o){await Promise.all([DE(t),p]);return}let D=lo(u,r),m=Io({stream:t,onStreamEnd:e,lines:i,encoding:n,stripFinalNewline:D,allMixed:a}),[f]=await Promise.all([dE({stream:t,iterable:m,fdNumber:r,encoding:n,maxBuffer:s,lines:i}),p]);return f},pE=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:o,verboseInfo:s,streamInfo:{fileDescriptors:i}})=>{if(!yr({stdioItems:i[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=Io({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await vc(a,t,r,s)},DE=async t=>{await lE(),t.readableFlowing===null&&t.resume()},dE=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:o,maxBuffer:s,lines:i})=>{try{return e||i?await ar(r,{maxBuffer:s}):o==="buffer"?new Uint8Array(await ur(r,{maxBuffer:s})):await lr(r,{maxBuffer:s})}catch(a){return Sl(vu({error:a,stream:t,readableObjectMode:e,lines:i,encoding:o,fdNumber:n}))}},Mo=async t=>{try{return await t}catch(e){return Sl(e)}},Sl=({bufferedData:t})=>Yi(t)?new Uint8Array(t):t;import{finished as mE}from"stream/promises";var st=async(t,e,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let s=fE(t,r),i=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],mE(t,{cleanup:!0,signal:i.signal})])}catch(a){s.stdinCleanedUp||bE(a,e,r,n)}finally{i.abort()}},fE=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&hE(t,r,n),n},hE=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...o)=>{gE(e,r),n.call(t,...o)}},gE=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},bE=(t,e,r,n)=>{if(!EE(t,e,r,n))throw t},EE=(t,e,r,n=!0)=>r.propagating?Fl(t)||_r(t):(r.propagating=!0,Po(r,e)===n?Fl(t):_r(t)),Po=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",_r=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Fl=t=>t?.code==="EPIPE";var wl=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>t.stdio.map((u,c)=>ko({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:s,verboseInfo:i,streamInfo:a})),ko=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c})=>{if(!t)return;let l=st(t,e,c);if(Po(c,e)){await l;return}let[p]=await Promise.all([yl({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return p};var xl=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?be([t,e].filter(Boolean)):void 0,Al=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>ko({...CE(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:yE(t),stripFinalNewline:s,verboseInfo:i,streamInfo:a}),CE=({stdout:t,stderr:e,all:r},[,n,o])=>{let s=n||o;return s?n?o?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},yE=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as SE}from"events";var Ol=t=>Ae(t,"ipc"),$l=(t,e)=>{let r=It(t);q({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var _l=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:s})=>{if(!n)return o;let i=Ol(s),a=ee(e,"ipc"),u=ee(r,"ipc");for await(let c of Co({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Iu(t,o,u),o.push(c)),i&&$l(c,s);return o},Bl=async(t,e)=>(await Promise.allSettled([t]),e);var Tl=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:o,timeoutDuration:s,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,stripFinalNewline:c,ipc:l,ipcInput:p},context:D,verboseInfo:m,fileDescriptors:f,originalStreams:g,onInternalError:S,controller:E})=>{let $=kc(t,D),T={originalStreams:g,fileDescriptors:f,subprocess:t,exitPromise:$,propagating:!1},C=wl({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:m,streamInfo:T}),w=Al({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:m,streamInfo:T}),_=[],I=_l({subprocess:t,buffer:r,maxBuffer:n,ipc:l,ipcOutput:_,verboseInfo:m}),ne=FE(g,t,T),oe=wE(f,T);try{return await Promise.race([Promise.all([{},jc($),Promise.all(C),w,I,pu(t,p),...ne,...oe]),S,xE(t,E),...su(t,s,D,E),...Oa({subprocess:t,cancelSignal:i,gracefulCancel:a,context:D,controller:E}),...ou({subprocess:t,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,context:D,controller:E})])}catch(kr){return D.terminationReason??="other",Promise.all([{error:kr},$,Promise.all(C.map(Ne=>Mo(Ne))),Mo(w),Bl(I,_),Promise.allSettled(ne),Promise.allSettled(oe)])}},FE=(t,e,r)=>t.map((n,o)=>n===e.stdio[o]?void 0:st(n,o,r)),wE=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:s=o})=>H(s,{checkOpen:!1})&&!V(s)).map(({type:o,value:s,stream:i=s})=>st(i,n,e,{isSameDirection:j.has(o),stopOnExit:o==="native"}))),xE=async(t,{signal:e})=>{let[r]=await SE(t,"error",{signal:e});throw r};var vl=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),at=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let o=n.get(e),s=Y();return o.push(s),{resolve:s.resolve.bind(s),promises:o}},Le=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as AE}from"stream";import{callbackify as OE}from"util";import{finished as Il}from"stream/promises";var Lo=async t=>{if(t!==void 0)try{await jo(t)}catch{}},Rl=async t=>{if(t!==void 0)try{await No(t)}catch{}},jo=async t=>{await Il(t,{cleanup:!0,readable:!1,writable:!0})},No=async t=>{await Il(t,{cleanup:!0,readable:!0,writable:!1})},Br=async(t,e)=>{if(await t,e)throw e},Tr=(t,e,r)=>{r&&!_r(r)?t.destroy(r):e&&t.destroy()};var Ml=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:o=!0,preserveNewlines:s=!0}={})=>{let i=o||P.has(r),{subprocessStdout:a,waitReadableDestroy:u}=Uo(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:p}=Vo(a,i),{read:D,onStdoutDataDone:m}=Go({subprocessStdout:a,subprocess:t,binary:i,encoding:r,preserveNewlines:s}),f=new AE({read:D,destroy:OE(Ho.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:p,objectMode:l,encoding:c});return Wo({subprocessStdout:a,onStdoutDataDone:m,readable:f,subprocess:t}),f},Uo=(t,e,r)=>{let n=Te(t,e),o=at(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},Vo=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:Ro},Go=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:o})=>{let s=Y(),i=$r({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){$E(this,i,s)},onStdoutDataDone:s}},$E=async(t,e,r)=>{try{let{value:n,done:o}=await e.next();o?r.resolve():t.push(n)}catch{}},Wo=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:o})=>{try{await No(t),await n,await Lo(o),await e,r.readable&&r.push(null)}catch(s){await Lo(o),Pl(r,s)}},Ho=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Le(r,e)&&(Pl(t,n),await Br(e,n))},Pl=(t,e)=>{Tr(t,t.readable,e)};import{Writable as _E}from"stream";import{callbackify as kl}from"util";var Ll=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}=zo(t,r,e),i=new _E({...qo(n,t,o),destroy:kl(Ko.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:o,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Yo(n,i),i},zo=(t,e,r)=>{let n=Ht(t,e),o=at(r,n,"writableFinal"),s=at(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}},qo=(t,e,r)=>({write:BE.bind(void 0,t),final:kl(TE.bind(void 0,t,e,r))}),BE=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},TE=async(t,e,r)=>{await Le(r,e)&&(t.writable&&t.end(),await e)},Yo=async(t,e,r)=>{try{await jo(t),e.writable&&e.end()}catch(n){await Rl(r),jl(e,n)}},Ko=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await Le(r,e),await Le(n,e)&&(jl(t,o),await Br(e,o))},jl=(t,e)=>{Tr(t,t.writable,e)};import{Duplex as vE}from"stream";import{callbackify as IE}from"util";var Nl=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:o,binary:s=!0,preserveNewlines:i=!0}={})=>{let a=s||P.has(r),{subprocessStdout:u,waitReadableDestroy:c}=Uo(t,n,e),{subprocessStdin:l,waitWritableFinal:p,waitWritableDestroy:D}=zo(t,o,e),{readableEncoding:m,readableObjectMode:f,readableHighWaterMark:g}=Vo(u,a),{read:S,onStdoutDataDone:E}=Go({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:i}),$=new vE({read:S,...qo(l,t,p),destroy:IE(RE.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:p,waitWritableDestroy:D})),readableHighWaterMark:g,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:f,writableObjectMode:l.writableObjectMode,encoding:m});return Wo({subprocessStdout:u,onStdoutDataDone:E,readable:$,subprocess:t,subprocessStdin:l}),Yo(l,$,u),$},RE=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:s},i)=>{await Promise.all([Ho({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},i),Ko({subprocessStdin:e,subprocess:r,waitWritableFinal:o,waitWritableDestroy:s},i)])};var Jo=(t,e,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let s=n||P.has(e),i=Te(t,r),a=$r({subprocessStdout:i,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:o});return ME(a,i,t)},ME=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var Ul=(t,{encoding:e})=>{let r=vl();t.readable=Ml.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=Ll.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Nl.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=Jo.bind(void 0,t,e),t[Symbol.asyncIterator]=Jo.bind(void 0,t,e,{})};var Vl=(t,e)=>{for(let[r,n]of kE){let o=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:o})}},PE=(async()=>{})().constructor.prototype,kE=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(PE,t)]);var Gl=(t,e,r,n)=>{let{file:o,commandArguments:s,command:i,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:p}=NE(t,e,r),{subprocess:D,promise:m}=VE({file:o,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:i,escapedCommand:a,fileDescriptors:p});return D.pipe=Or.bind(void 0,{source:D,sourcePromise:m,boundOptions:{},createNested:n}),Vl(D,m),K.set(D,{options:l,fileDescriptors:p}),D},NE=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=Mt(t,e,r),{file:a,commandArguments:u,options:c}=rr(t,e,r),l=UE(c),p=el(l,i);return{file:a,commandArguments:u,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},UE=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},VE=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:o,command:s,escapedCommand:i,fileDescriptors:a})=>{let u;try{u=jE(...nr(t,e,r))}catch(f){return Jc({error:f,command:s,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}let c=new AbortController;LE(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];cl(u,a,c),pl(u,r,c);let p={},D=Y();u.kill=xa.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:D,context:p,controller:c}),u.all=xl(u,r),Ul(u,r),qc(u,r);let m=GE({subprocess:u,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:i,context:p,onInternalError:D,controller:c});return{subprocess:u,promise:m}},GE=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:s,command:i,escapedCommand:a,context:u,onInternalError:c,controller:l})=>{let[p,[D,m],f,g,S]=await Tl({subprocess:t,options:e,context:u,verboseInfo:n,fileDescriptors:o,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();let E=f.map((C,w)=>re(C,e,w)),$=re(g,e,"all"),T=WE({errorInfo:p,exitCode:D,signal:m,stdio:E,all:$,ipcOutput:S,context:u,options:e,command:i,escapedCommand:a,startTime:r});return Me(T,n,e)},WE=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,context:i,options:a,command:u,escapedCommand:c,startTime:l})=>"error"in t?tt({error:t.error,command:u,escapedCommand:c,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof J,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,options:a,startTime:l,isSync:!1}):Dr({command:u,escapedCommand:c,stdio:n,all:o,ipcOutput:s,options:a,startTime:l});var vr=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,o])=>[n,HE(n,t[n],o)]));return{...t,...r}},HE=(t,e,r)=>zE.has(t)&&O(e)&&O(r)?{...e,...r}:r,zE=new Set(["env",...xn]);var le=(t,e,r,n)=>{let o=(i,a,u)=>le(i,a,r,u),s=(...i)=>qE({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:o},...i);return n!==void 0&&n(s,o,e),s},qE=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:o},s,...i)=>{if(O(s))return o(t,vr(r,s),n);let{file:a,commandArguments:u,options:c,isSync:l}=YE({mapArguments:t,firstArgument:s,nextArguments:i,deepOptions:e,boundOptions:r});return l?Uc(a,u,c):Gl(a,u,c,o)},YE=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:o})=>{let s=es(e)?ts(e,r):[e,...r],[i,a,u]=wt(...s),c=vr(vr(n,o),u),{file:l=i,commandArguments:p=a,options:D=c,isSync:m=!1}=t({file:i,commandArguments:a,options:c});return{file:l,commandArguments:p,options:D,isSync:m}};var Wl=({file:t,commandArguments:e})=>zl(t,e),Hl=({file:t,commandArguments:e})=>({...zl(t,e),isSync:!0}),zl=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=KE(t);return{file:r,commandArguments:n}},KE=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(JE)){let o=r.at(-1);o&&o.endsWith("\\")?r[r.length-1]=`${o.slice(0,-1)} ${n}`:r.push(n)}return r},JE=/ +/g;var ql=(t,e,r)=>{t.sync=e(XE,r),t.s=t.sync},Yl=({options:t})=>Kl(t),XE=({options:t})=>({...Kl(t),isSync:!0}),Kl=t=>({options:{...ZE(t),...t}}),ZE=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},Jl={preferLocal:!0};var je=le(()=>({})),N8=le(()=>({isSync:!0})),Xl=le(Wl),U8=le(Hl),V8=le(uu),G8=le(Yl,{},Jl,ql),{sendMessage:W8,getOneMessage:H8,getEachMessage:z8,getCancelSignal:q8}=Yc();var Zl="ghcr.io/spree/spree",Ir="latest";var Ql="https://github.com/spree/nextjs-starter-spree.git",Rr="spree@example.com",Mr="spree123";import QE from"crypto";function ep(){let t=process.env.npm_config_user_agent??"";return t.startsWith("yarn")?"yarn":t.startsWith("pnpm")?"pnpm":"npm"}async function tp(){try{return await Xl("docker info",{stdio:"ignore"}),!0}catch{return!1}}function rp(){return QE.randomBytes(64).toString("hex")}function Xo(t){return t==="yarn"?"yarn":`${t} install`}function np(t){return`x-app: &app
125
+ if (condition) { yield value; }`)};import{Buffer as gg}from"buffer";import{StringDecoder as bg}from"string_decoder";var br=(t,e,r)=>{if(r)return;if(t)return{transform:Eg.bind(void 0,new TextEncoder)};let n=new bg(e);return{transform:Cg.bind(void 0,n),final:yg.bind(void 0,n)}},Eg=function*(t,e){gg.isBuffer(e)?yield Q(e):typeof e=="string"?yield t.encode(e):yield e},Cg=function*(t,e){yield B(e)?t.write(e):e},yg=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as xc}from"util";var mo=xc(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let o of e.currentIterable)n.push(o)}finally{delete e.currentIterable}}),Er=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Fg}=e[r];for await(let o of n(t))yield*Er(o,e,r+1)},Ac=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Sg(r,Number(e),t)},Sg=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*Er(n,r,e+1)},Oc=xc(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),Fg=function*(t){yield t};var fo=(t,e,r,n)=>{try{for(let o of t(...e))r.push(o);n()}catch(o){n(o)}},$c=(t,e)=>[...e.flatMap(r=>[...ge(r,t,0)]),...rt(t)],ge=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=xg}=e[r];for(let o of n(t))yield*ge(o,e,r+1)},rt=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*wg(r,Number(e),t)},wg=function*(t,e,r){if(t!==void 0)for(let n of t())yield*ge(n,r,e+1)},xg=function*(t){yield t};var ho=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:o},optionName:s},{encoding:i})=>{let a={},u=Bc(t,i,s),c=he(e),l=he(r),p=c?mo.bind(void 0,Er,a):fo.bind(void 0,ge),D=c||l?mo.bind(void 0,Ac,a):fo.bind(void 0,rt),m=c||l?Oc.bind(void 0,a):void 0;return{stream:new Ag({writableObjectMode:n,writableHighWaterMark:_c(n),readableObjectMode:o,readableHighWaterMark:_c(o),transform(g,S,E){p([g,u,0],this,E)},flush(g){D([u],this,g)},destroy:m})}},Cr=(t,e,r,n)=>{let o=e.filter(({type:i})=>i==="generator"),s=n?o.reverse():o;for(let{value:i,optionName:a}of s){let u=Bc(i,r,a);t=$c(u,t)}return t},Bc=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:s},i,a)=>{let u={};return[{transform:Sc(n,a)},br(r,i,n),gr(r,s,n,u),{transform:t,final:e},{transform:Fc(o,a)},yc({binary:r,preserveNewlines:s,readableObjectMode:o,state:u})].filter(Boolean)};var Tc=(t,e)=>{for(let r of Og(t))$g(t,r,e)},Og=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),$g=(t,e,r)=>{let{stdioItems:n}=t[e],o=n.filter(({contents:a})=>a!==void 0);if(o.length===0)return;if(e!==0){let[{type:a,optionName:u}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${ce[a]} with synchronous methods.`)}let i=o.map(({contents:a})=>a).map(a=>_g(a,n));r.input=ze(i)},_g=(t,e)=>{let r=Cr(t,e,"utf8",!0);return Bg(r),ze(r)},Bg=t=>{let e=t.find(r=>typeof r!="string"&&!B(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as Rg,appendFileSync as Mg}from"fs";var yr=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Ae(r,n)&&!P.has(e)&&Tg(n)&&(t.some(({type:o,value:s})=>o==="native"&&vg.has(s))||t.every(({type:o})=>j.has(o))),Tg=t=>t===1||t===2,vg=new Set(["pipe","overlapped"]),vc=async(t,e,r,n)=>{for await(let o of t)Ig(e)||Rc(o,r,n)},Ic=(t,e,r)=>{for(let n of t)Rc(n,e,r)},Ig=t=>t._readableState.pipes.length>0,Rc=(t,e,r)=>{let n=It(t);q({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var Mc=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(e===null)return{output:Array.from({length:3})};let s={},i=new Set([]);return{output:e.map((u,c)=>Pg({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:i,isMaxBuffer:n,verboseInfo:o},r)),...s}},Pg=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:s,verboseInfo:i},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:p})=>{if(t===null)return;let D=Pu(t,s,p),m=Q(D),{stdioItems:f,objectMode:g}=e[r],S=kg([m],f,u,n),{serializedResult:E,finalResult:$=E}=Lg({chunks:S,objectMode:g,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});jg({serializedResult:E,fdNumber:r,state:n,verboseInfo:i,encoding:u,stdioItems:f,objectMode:g});let T=a[r]?$:void 0;try{return n.error===void 0&&Ng(E,f,o),T}catch(C){return n.error=C,T}},kg=(t,e,r,n)=>{try{return Cr(t,e,r,!1)}catch(o){return n.error=o,t}},Lg=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:o,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:ze(t)};let i=Ji(t,r);return n[s]?{serializedResult:i,finalResult:Do(i,!o[s],e)}:{serializedResult:i}},jg=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:o,stdioItems:s,objectMode:i})=>{if(!yr({stdioItems:s,encoding:o,verboseInfo:n,fdNumber:e}))return;let a=Do(t,!1,i);try{Ic(a,e,n)}catch(u){r.error??=u}},Ng=(t,e,r)=>{for(let{path:n,append:o}of e.filter(({type:s})=>fr.has(s))){let s=typeof n=="string"?n:n.toString();o||r.has(s)?Mg(n,t):(r.add(s),Rg(n,t))}};var Pc=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,re(e,r,"all")]:Array.isArray(e)?[re(t,r,"all"),...e]:B(t)&&B(e)?yn([t,e]):`${t}${e}`};import{once as go}from"events";var kc=async(t,e)=>{let[r,n]=await Ug(t);return e.isForcefullyTerminated??=!1,[r,n]},Ug=async t=>{let[e,r]=await Promise.allSettled([go(t,"spawn"),go(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?Lc(t):r.value},Lc=async t=>{try{return await go(t,"exit")}catch{return Lc(t)}},jc=async t=>{let[e,r]=await t;if(!Vg(e,r)&&bo(e,r))throw new G;return[e,r]},Vg=(t,e)=>t===void 0&&e===void 0,bo=(t,e)=>t!==0||e!==null;var Nc=({error:t,status:e,signal:r,output:n},{maxBuffer:o})=>{let s=Gg(t,e,r),i=s?.code==="ETIMEDOUT",a=Mu(s,n,o);return{resultError:s,exitCode:e,signal:r,timedOut:i,isMaxBuffer:a}},Gg=(t,e,r)=>t!==void 0?t:bo(e,r)?new G:void 0;var Uc=(t,e,r)=>{let{file:n,commandArguments:o,command:s,escapedCommand:i,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=Hg(t,e,r),p=Yg({file:n,commandArguments:o,options:c,command:s,escapedCommand:i,verboseInfo:u,fileDescriptors:l,startTime:a});return Me(p,u,c)},Hg=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=Mt(t,e,r),a=zg(r),{file:u,commandArguments:c,options:l}=rr(t,e,a);qg(l);let p=gc(l,i);return{file:u,commandArguments:c,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},zg=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,qg=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&Sr("ipcInput"),t&&Sr("ipc: true"),r&&Sr("detached: true"),n&&Sr("cancelSignal")},Sr=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Yg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,verboseInfo:s,fileDescriptors:i,startTime:a})=>{let u=Kg({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:a});if(u.failed)return u;let{resultError:c,exitCode:l,signal:p,timedOut:D,isMaxBuffer:m}=Nc(u,r),{output:f,error:g=c}=Mc({fileDescriptors:i,syncResult:u,options:r,isMaxBuffer:m,verboseInfo:s}),S=f.map(($,T)=>re($,r,T)),E=re(Pc(f,r),r,"all");return Xg({error:g,exitCode:l,signal:p,timedOut:D,isMaxBuffer:m,stdio:S,all:E,options:r,command:n,escapedCommand:o,startTime:a})},Kg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:i})=>{try{Tc(s,r);let a=Jg(r);return Wg(...nr(t,e,a))}catch(a){return Re({error:a,command:n,escapedCommand:o,fileDescriptors:s,options:r,startTime:i,isSync:!0})}},Jg=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:pr(e)}),Xg=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:o,stdio:s,all:i,options:a,command:u,escapedCommand:c,startTime:l})=>t===void 0?Dr({command:u,escapedCommand:c,stdio:s,all:i,ipcOutput:[],options:a,startTime:l}):tt({error:t,command:u,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:s,all:i,ipcOutput:[],options:a,startTime:l,isSync:!0});import{setMaxListeners as LE}from"events";import{spawn as jE}from"child_process";import zc from"process";import{once as Eo,on as Zg}from"events";var Vc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0,filter:s}={})=>(_e({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Jt(t)}),Qg({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:o})),Qg=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:o})=>{zt(e,o);let s=ue(t,e,r),i=new AbortController;try{return await Promise.race([eb(s,n,i),tb(s,r,i),rb(s,r,i)])}catch(a){throw Be(t),a}finally{i.abort(),qt(e,o)}},eb=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await Eo(t,"message",{signal:r});return n}for await(let[n]of Zg(t,"message",{signal:r}))if(e(n))return n},tb=async(t,e,{signal:r})=>{await Eo(t,"disconnect",{signal:r}),$a(e)},rb=async(t,e,{signal:r})=>{let[n]=await Eo(t,"strict:error",{signal:r});throw Gt(n,e)};import{once as Wc,on as nb}from"events";var Hc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0}={})=>Co({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),Co=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:o,reference:s})=>{_e({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Jt(t)}),zt(e,s);let i=ue(t,e,r),a=new AbortController,u={};return ob(t,i,a),ib({ipcEmitter:i,isSubprocess:r,controller:a,state:u}),sb({anyProcess:t,channel:e,ipcEmitter:i,isSubprocess:r,shouldAwait:o,controller:a,state:u,reference:s})},ob=async(t,e,r)=>{try{await Wc(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},ib=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[o]=await Wc(t,"strict:error",{signal:r.signal});n.error=Gt(o,e),r.abort()}catch{}},sb=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:s,state:i,reference:a}){try{for await(let[u]of nb(r,"message",{signal:s.signal}))Gc(i),yield u}catch{Gc(i)}finally{s.abort(),qt(e,a),n||Be(t),o&&await t}},Gc=({error:t})=>{if(t)throw t};var qc=(t,{ipc:e})=>{Object.assign(t,Kc(t,!1,e))},Yc=()=>{let t=zc,e=!0,r=zc.channel!==void 0;return{...Kc(t,e,r),getCancelSignal:tu.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},Kc=(t,e,r)=>({sendMessage:er.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Vc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Hc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as ab}from"child_process";import{PassThrough as ub,Readable as cb,Writable as lb,Duplex as pb}from"stream";var Jc=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,verboseInfo:i})=>{co(n);let a=new ab;Db(a,n),Object.assign(a,{readable:db,writable:mb,duplex:fb});let u=Re({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:!1}),c=hb(u,i,o);return{subprocess:a,promise:c}},Db=(t,e)=>{let r=nt(),n=nt(),o=nt(),s=Array.from({length:e.length-3},nt),i=nt(),a=[r,n,o,...s];Object.assign(t,{stdin:r,stdout:n,stderr:o,all:i,stdio:a})},nt=()=>{let t=new ub;return t.end(),t},db=()=>new cb({read(){}}),mb=()=>new lb({write(){}}),fb=()=>new pb({read(){},write(){}}),hb=async(t,e,r)=>Me(t,e,r);import{createReadStream as Xc,createWriteStream as Zc}from"fs";import{Buffer as gb}from"buffer";import{Readable as ot,Writable as bb,Duplex as Eb}from"stream";var el=(t,e)=>hr(Cb,t,e,!1),it=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ce[t]}.`)},Qc={fileNumber:it,generator:ho,asyncGenerator:ho,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:Eb.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Cb={input:{...Qc,fileUrl:({value:t})=>({stream:Xc(t)}),filePath:({value:{file:t}})=>({stream:Xc(t)}),webStream:({value:t})=>({stream:ot.fromWeb(t)}),iterable:({value:t})=>({stream:ot.from(t)}),asyncIterable:({value:t})=>({stream:ot.from(t)}),string:({value:t})=>({stream:ot.from(t)}),uint8Array:({value:t})=>({stream:ot.from(gb.from(t))})},output:{...Qc,fileUrl:({value:t})=>({stream:Zc(t)}),filePath:({value:{file:t,append:e}})=>({stream:Zc(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:bb.fromWeb(t)}),iterable:it,asyncIterable:it,string:it,uint8Array:it}};import{on as yb,once as tl}from"events";import{PassThrough as Sb,getDefaultHighWaterMark as Fb}from"stream";import{finished as ol}from"stream/promises";function be(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let o of t)So(o);let e=t.some(({readableObjectMode:o})=>o),r=wb(t,e),n=new yo({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of t)n.add(o);return n}var wb=(t,e)=>{if(t.length===0)return Fb(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},yo=class extends Sb{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(e){if(So(e),this.#t.has(e))return;this.#t.add(e),this.#n??=xb(this,this.#t,this.#i);let r=$b({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#i});this.#o.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(So(e),!this.#t.has(e))return!1;let r=this.#o.get(e);return r===void 0?!1:(this.#o.delete(e),e.unpipe(this),await r,!0)}},xb=async(t,e,r)=>{Fr(t,rl);let n=new AbortController;try{await Promise.race([Ab(t,n),Ob(t,e,r,n)])}finally{n.abort(),Fr(t,-rl)}},Ab=async(t,{signal:e})=>{try{await ol(t,{signal:e,cleanup:!0})}catch(r){throw il(t,r),r}},Ob=async(t,e,r,{signal:n})=>{for await(let[o]of yb(t,"unpipe",{signal:n}))e.has(o)&&o.emit(r)},So=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},$b=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,onFinished:s,unpipeEvent:i})=>{Fr(t,nl);let a=new AbortController;try{await Promise.race([_b(s,e,a),Bb({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:a}),Tb({stream:e,streams:r,ended:n,aborted:o,unpipeEvent:i,controller:a})])}finally{a.abort(),Fr(t,-nl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?Fo(t):vb(t))},_b=async(t,e,{signal:r})=>{try{await t,r.aborted||Fo(e)}catch(n){r.aborted||il(e,n)}},Bb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:{signal:s}})=>{try{await ol(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(i){if(s.aborted||!r.has(e))return;sl(i)?o.add(e):al(t,i)}},Tb=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:o,controller:{signal:s}})=>{if(await tl(t,o,{signal:s}),!t.readable)return tl(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},vb=t=>{t.writable&&t.end()},il=(t,e)=>{sl(e)?Fo(t):al(t,e)},sl=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Fo=t=>{(t.readable||t.writable)&&t.destroy()},al=(t,e)=>{t.destroyed||(t.once("error",Ib),t.destroy(e))},Ib=()=>{},Fr=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},rl=2,nl=1;import{finished as ul}from"stream/promises";var ke=(t,e)=>{t.pipe(e),Rb(t,e),Mb(t,e)},Rb=async(t,e)=>{if(!(V(t)||V(e))){try{await ul(t,{cleanup:!0,readable:!0,writable:!1})}catch{}wo(e)}},wo=t=>{t.writable&&t.end()},Mb=async(t,e)=>{if(!(V(t)||V(e))){try{await ul(e,{cleanup:!0,readable:!1,writable:!0})}catch{}xo(t)}},xo=t=>{t.readable&&t.destroy()};var cl=(t,e,r)=>{let n=new Map;for(let[o,{stdioItems:s,direction:i}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:u})=>j.has(u)))Pb(t,a,i,o);for(let{stream:a}of s.filter(({type:u})=>!j.has(u)))Lb({subprocess:t,stream:a,direction:i,fdNumber:o,pipeGroups:n,controller:r})}for(let[o,s]of n.entries()){let i=s.length===1?s[0]:be(s);ke(i,o)}},Pb=(t,e,r,n)=>{r==="output"?ke(t.stdio[n],e):ke(e,t.stdio[n]);let o=kb[n];o!==void 0&&(t[o]=e),t.stdio[n]=e},kb=["stdin","stdout","stderr"],Lb=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:o,controller:s})=>{if(e===void 0)return;jb(e,s);let[i,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=o.get(i)??[];o.set(i,[...u,a])},jb=(t,{signal:e})=>{V(t)&&me(t,Nb,e)},Nb=2;import{addAbortListener as Gb}from"events";var Ee=[];Ee.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ee.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ee.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wr=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Ao=Symbol.for("signal-exit emitter"),Oo=globalThis,Ub=Object.defineProperty.bind(Object),$o=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Oo[Ao])return Oo[Ao];Ub(Oo,Ao,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let o=!1;for(let s of this.listeners[e])o=s(r,n)===!0||o;return e==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},xr=class{},Vb=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),_o=class extends xr{onExit(){return()=>{}}load(){}unload(){}},Bo=class extends xr{#t=To.platform==="win32"?"SIGINT":"SIGHUP";#r=new $o;#e;#n;#i;#o={};#s=!1;constructor(e){super(),this.#e=e,this.#o={};for(let r of Ee)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(o+=s.__signal_exit_emitter__.count),n.length===o){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;i||e.kill(e.pid,a)}};this.#i=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!wr(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of Ee)try{let r=this.#o[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#u(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,Ee.forEach(e=>{let r=this.#o[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#i,this.#r.count-=1)}#a(e){return wr(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#u(e,...r){let n=this.#n;if(e==="exit"&&wr(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,e,...r)}},To=globalThis.process,{onExit:ll,load:J3,unload:X3}=Vb(wr(To)?new Bo(To):new _o);var pl=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let o=ll(()=>{t.kill()});Gb(n,()=>{o()})};var dl=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...o)=>{let s=Rt(),{destination:i,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=Wb(r,n,o),{sourceStream:p,sourceError:D}=zb(t,c),{options:m,fileDescriptors:f}=K.get(t);return{sourcePromise:e,sourceStream:p,sourceOptions:m,sourceError:D,destination:i,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:f,startTime:s}},Wb=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:o,to:s,unpipeSignal:i}={}}=Hb(t,e,...r),a=Ht(n,s);return{destination:n,destinationStream:a,from:o,unpipeSignal:i}}catch(n){return{destinationError:n}}},Hb=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Dl,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||En(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[o,s,i]=wt(r,...n);return{destination:e(Dl)(o,s,i),pipeOptions:i}}if(K.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Dl=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),zb=(t,e)=>{try{return{sourceStream:Te(t,e)}}catch(r){return{sourceError:r}}};var fl=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:s,startTime:i})=>{let a=qb({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw vo({error:a,fileDescriptors:o,sourceOptions:s,startTime:i})},qb=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return xo(t),n;if(e!==void 0)return wo(r),e},vo=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Re({error:t,command:ml,escapedCommand:ml,fileDescriptors:e,options:r,startTime:n,isSync:!1}),ml="source.pipe(destination)";var hl=async t=>{let[{status:e,reason:r,value:n=r},{status:o,reason:s,value:i=s}]=await t;if(i.pipedFrom.includes(n)||i.pipedFrom.push(n),o==="rejected")throw i;if(e==="rejected")throw n;return i};import{finished as Yb}from"stream/promises";var gl=(t,e,r)=>{let n=Ar.has(e)?Jb(t,e):Kb(t,e);return me(t,Zb,r.signal),me(e,Qb,r.signal),Xb(e),n},Kb=(t,e)=>{let r=be([t]);return ke(r,e),Ar.set(e,r),r},Jb=(t,e)=>{let r=Ar.get(e);return r.add(t),r},Xb=async t=>{try{await Yb(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Ar.delete(t)},Ar=new WeakMap,Zb=2,Qb=1;import{aborted as eE}from"util";var bl=(t,e)=>t===void 0?[]:[tE(t,e)],tE=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:s})=>{await eE(t,e),await r.remove(e);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw vo({error:i,fileDescriptors:n,sourceOptions:o,startTime:s})};var Or=(t,...e)=>{if(O(e[0]))return Or.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=dl(t,...e),o=rE({...n,destination:r});return o.pipe=Or.bind(void 0,{...t,source:r,sourcePromise:o,boundOptions:{}}),o},rE=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:o,destinationStream:s,destinationError:i,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=nE(t,o);fl({sourceStream:e,sourceError:n,destinationStream:s,destinationError:i,fileDescriptors:u,sourceOptions:r,startTime:c});let p=new AbortController;try{let D=gl(e,s,p);return await Promise.race([hl(l),...bl(a,{sourceStream:e,mergedStream:D,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{p.abort()}},nE=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as lE}from"timers/promises";import{on as oE}from"events";import{getDefaultHighWaterMark as iE}from"stream";var $r=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:o,preserveNewlines:s})=>{let i=new AbortController;return sE(e,i),Cl({stream:t,controller:i,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:o,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},sE=async(t,e)=>{try{await t}catch{}finally{e.abort()}},Io=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:o,allMixed:s})=>{let i=new AbortController;aE(e,i,t);let a=t.readableObjectMode&&!s;return Cl({stream:t,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},aE=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},Cl=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})=>{let a=oE(t,"data",{signal:e.signal,highWaterMark:El,highWatermark:El});return uE({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})},Ro=iE(!0),El=Ro,uE=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i}){let a=cE({binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i});try{for await(let[u]of t)yield*ge(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*rt(a)}},cE=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:o})=>[br(t,r,!e),gr(t,o,!n,{})].filter(Boolean);var yl=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:o,maxBuffer:s,lines:i,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{let p=pE({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:c,streamInfo:l});if(!o){await Promise.all([DE(t),p]);return}let D=lo(u,r),m=Io({stream:t,onStreamEnd:e,lines:i,encoding:n,stripFinalNewline:D,allMixed:a}),[f]=await Promise.all([dE({stream:t,iterable:m,fdNumber:r,encoding:n,maxBuffer:s,lines:i}),p]);return f},pE=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:o,verboseInfo:s,streamInfo:{fileDescriptors:i}})=>{if(!yr({stdioItems:i[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=Io({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await vc(a,t,r,s)},DE=async t=>{await lE(),t.readableFlowing===null&&t.resume()},dE=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:o,maxBuffer:s,lines:i})=>{try{return e||i?await ar(r,{maxBuffer:s}):o==="buffer"?new Uint8Array(await ur(r,{maxBuffer:s})):await lr(r,{maxBuffer:s})}catch(a){return Sl(vu({error:a,stream:t,readableObjectMode:e,lines:i,encoding:o,fdNumber:n}))}},Mo=async t=>{try{return await t}catch(e){return Sl(e)}},Sl=({bufferedData:t})=>Yi(t)?new Uint8Array(t):t;import{finished as mE}from"stream/promises";var st=async(t,e,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let s=fE(t,r),i=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],mE(t,{cleanup:!0,signal:i.signal})])}catch(a){s.stdinCleanedUp||bE(a,e,r,n)}finally{i.abort()}},fE=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&hE(t,r,n),n},hE=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...o)=>{gE(e,r),n.call(t,...o)}},gE=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},bE=(t,e,r,n)=>{if(!EE(t,e,r,n))throw t},EE=(t,e,r,n=!0)=>r.propagating?Fl(t)||_r(t):(r.propagating=!0,Po(r,e)===n?Fl(t):_r(t)),Po=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",_r=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Fl=t=>t?.code==="EPIPE";var wl=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>t.stdio.map((u,c)=>ko({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:s,verboseInfo:i,streamInfo:a})),ko=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c})=>{if(!t)return;let l=st(t,e,c);if(Po(c,e)){await l;return}let[p]=await Promise.all([yl({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return p};var xl=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?be([t,e].filter(Boolean)):void 0,Al=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>ko({...CE(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:yE(t),stripFinalNewline:s,verboseInfo:i,streamInfo:a}),CE=({stdout:t,stderr:e,all:r},[,n,o])=>{let s=n||o;return s?n?o?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},yE=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as SE}from"events";var Ol=t=>Ae(t,"ipc"),$l=(t,e)=>{let r=It(t);q({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var _l=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:s})=>{if(!n)return o;let i=Ol(s),a=ee(e,"ipc"),u=ee(r,"ipc");for await(let c of Co({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Iu(t,o,u),o.push(c)),i&&$l(c,s);return o},Bl=async(t,e)=>(await Promise.allSettled([t]),e);var Tl=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:o,timeoutDuration:s,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,stripFinalNewline:c,ipc:l,ipcInput:p},context:D,verboseInfo:m,fileDescriptors:f,originalStreams:g,onInternalError:S,controller:E})=>{let $=kc(t,D),T={originalStreams:g,fileDescriptors:f,subprocess:t,exitPromise:$,propagating:!1},C=wl({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:m,streamInfo:T}),w=Al({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:m,streamInfo:T}),_=[],I=_l({subprocess:t,buffer:r,maxBuffer:n,ipc:l,ipcOutput:_,verboseInfo:m}),ne=FE(g,t,T),oe=wE(f,T);try{return await Promise.race([Promise.all([{},jc($),Promise.all(C),w,I,pu(t,p),...ne,...oe]),S,xE(t,E),...su(t,s,D,E),...Oa({subprocess:t,cancelSignal:i,gracefulCancel:a,context:D,controller:E}),...ou({subprocess:t,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,context:D,controller:E})])}catch(kr){return D.terminationReason??="other",Promise.all([{error:kr},$,Promise.all(C.map(Ne=>Mo(Ne))),Mo(w),Bl(I,_),Promise.allSettled(ne),Promise.allSettled(oe)])}},FE=(t,e,r)=>t.map((n,o)=>n===e.stdio[o]?void 0:st(n,o,r)),wE=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:s=o})=>H(s,{checkOpen:!1})&&!V(s)).map(({type:o,value:s,stream:i=s})=>st(i,n,e,{isSameDirection:j.has(o),stopOnExit:o==="native"}))),xE=async(t,{signal:e})=>{let[r]=await SE(t,"error",{signal:e});throw r};var vl=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),at=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let o=n.get(e),s=Y();return o.push(s),{resolve:s.resolve.bind(s),promises:o}},Le=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as AE}from"stream";import{callbackify as OE}from"util";import{finished as Il}from"stream/promises";var Lo=async t=>{if(t!==void 0)try{await jo(t)}catch{}},Rl=async t=>{if(t!==void 0)try{await No(t)}catch{}},jo=async t=>{await Il(t,{cleanup:!0,readable:!1,writable:!0})},No=async t=>{await Il(t,{cleanup:!0,readable:!0,writable:!1})},Br=async(t,e)=>{if(await t,e)throw e},Tr=(t,e,r)=>{r&&!_r(r)?t.destroy(r):e&&t.destroy()};var Ml=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:o=!0,preserveNewlines:s=!0}={})=>{let i=o||P.has(r),{subprocessStdout:a,waitReadableDestroy:u}=Uo(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:p}=Vo(a,i),{read:D,onStdoutDataDone:m}=Go({subprocessStdout:a,subprocess:t,binary:i,encoding:r,preserveNewlines:s}),f=new AE({read:D,destroy:OE(Ho.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:p,objectMode:l,encoding:c});return Wo({subprocessStdout:a,onStdoutDataDone:m,readable:f,subprocess:t}),f},Uo=(t,e,r)=>{let n=Te(t,e),o=at(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},Vo=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:Ro},Go=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:o})=>{let s=Y(),i=$r({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){$E(this,i,s)},onStdoutDataDone:s}},$E=async(t,e,r)=>{try{let{value:n,done:o}=await e.next();o?r.resolve():t.push(n)}catch{}},Wo=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:o})=>{try{await No(t),await n,await Lo(o),await e,r.readable&&r.push(null)}catch(s){await Lo(o),Pl(r,s)}},Ho=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Le(r,e)&&(Pl(t,n),await Br(e,n))},Pl=(t,e)=>{Tr(t,t.readable,e)};import{Writable as _E}from"stream";import{callbackify as kl}from"util";var Ll=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}=zo(t,r,e),i=new _E({...qo(n,t,o),destroy:kl(Ko.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:o,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Yo(n,i),i},zo=(t,e,r)=>{let n=Ht(t,e),o=at(r,n,"writableFinal"),s=at(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}},qo=(t,e,r)=>({write:BE.bind(void 0,t),final:kl(TE.bind(void 0,t,e,r))}),BE=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},TE=async(t,e,r)=>{await Le(r,e)&&(t.writable&&t.end(),await e)},Yo=async(t,e,r)=>{try{await jo(t),e.writable&&e.end()}catch(n){await Rl(r),jl(e,n)}},Ko=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await Le(r,e),await Le(n,e)&&(jl(t,o),await Br(e,o))},jl=(t,e)=>{Tr(t,t.writable,e)};import{Duplex as vE}from"stream";import{callbackify as IE}from"util";var Nl=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:o,binary:s=!0,preserveNewlines:i=!0}={})=>{let a=s||P.has(r),{subprocessStdout:u,waitReadableDestroy:c}=Uo(t,n,e),{subprocessStdin:l,waitWritableFinal:p,waitWritableDestroy:D}=zo(t,o,e),{readableEncoding:m,readableObjectMode:f,readableHighWaterMark:g}=Vo(u,a),{read:S,onStdoutDataDone:E}=Go({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:i}),$=new vE({read:S,...qo(l,t,p),destroy:IE(RE.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:p,waitWritableDestroy:D})),readableHighWaterMark:g,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:f,writableObjectMode:l.writableObjectMode,encoding:m});return Wo({subprocessStdout:u,onStdoutDataDone:E,readable:$,subprocess:t,subprocessStdin:l}),Yo(l,$,u),$},RE=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:s},i)=>{await Promise.all([Ho({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},i),Ko({subprocessStdin:e,subprocess:r,waitWritableFinal:o,waitWritableDestroy:s},i)])};var Jo=(t,e,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let s=n||P.has(e),i=Te(t,r),a=$r({subprocessStdout:i,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:o});return ME(a,i,t)},ME=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var Ul=(t,{encoding:e})=>{let r=vl();t.readable=Ml.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=Ll.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Nl.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=Jo.bind(void 0,t,e),t[Symbol.asyncIterator]=Jo.bind(void 0,t,e,{})};var Vl=(t,e)=>{for(let[r,n]of kE){let o=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:o})}},PE=(async()=>{})().constructor.prototype,kE=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(PE,t)]);var Gl=(t,e,r,n)=>{let{file:o,commandArguments:s,command:i,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:p}=NE(t,e,r),{subprocess:D,promise:m}=VE({file:o,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:i,escapedCommand:a,fileDescriptors:p});return D.pipe=Or.bind(void 0,{source:D,sourcePromise:m,boundOptions:{},createNested:n}),Vl(D,m),K.set(D,{options:l,fileDescriptors:p}),D},NE=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=Mt(t,e,r),{file:a,commandArguments:u,options:c}=rr(t,e,r),l=UE(c),p=el(l,i);return{file:a,commandArguments:u,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},UE=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},VE=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:o,command:s,escapedCommand:i,fileDescriptors:a})=>{let u;try{u=jE(...nr(t,e,r))}catch(f){return Jc({error:f,command:s,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}let c=new AbortController;LE(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];cl(u,a,c),pl(u,r,c);let p={},D=Y();u.kill=xa.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:D,context:p,controller:c}),u.all=xl(u,r),Ul(u,r),qc(u,r);let m=GE({subprocess:u,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:i,context:p,onInternalError:D,controller:c});return{subprocess:u,promise:m}},GE=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:s,command:i,escapedCommand:a,context:u,onInternalError:c,controller:l})=>{let[p,[D,m],f,g,S]=await Tl({subprocess:t,options:e,context:u,verboseInfo:n,fileDescriptors:o,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();let E=f.map((C,w)=>re(C,e,w)),$=re(g,e,"all"),T=WE({errorInfo:p,exitCode:D,signal:m,stdio:E,all:$,ipcOutput:S,context:u,options:e,command:i,escapedCommand:a,startTime:r});return Me(T,n,e)},WE=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,context:i,options:a,command:u,escapedCommand:c,startTime:l})=>"error"in t?tt({error:t.error,command:u,escapedCommand:c,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof J,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,options:a,startTime:l,isSync:!1}):Dr({command:u,escapedCommand:c,stdio:n,all:o,ipcOutput:s,options:a,startTime:l});var vr=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,o])=>[n,HE(n,t[n],o)]));return{...t,...r}},HE=(t,e,r)=>zE.has(t)&&O(e)&&O(r)?{...e,...r}:r,zE=new Set(["env",...xn]);var le=(t,e,r,n)=>{let o=(i,a,u)=>le(i,a,r,u),s=(...i)=>qE({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:o},...i);return n!==void 0&&n(s,o,e),s},qE=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:o},s,...i)=>{if(O(s))return o(t,vr(r,s),n);let{file:a,commandArguments:u,options:c,isSync:l}=YE({mapArguments:t,firstArgument:s,nextArguments:i,deepOptions:e,boundOptions:r});return l?Uc(a,u,c):Gl(a,u,c,o)},YE=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:o})=>{let s=es(e)?ts(e,r):[e,...r],[i,a,u]=wt(...s),c=vr(vr(n,o),u),{file:l=i,commandArguments:p=a,options:D=c,isSync:m=!1}=t({file:i,commandArguments:a,options:c});return{file:l,commandArguments:p,options:D,isSync:m}};var Wl=({file:t,commandArguments:e})=>zl(t,e),Hl=({file:t,commandArguments:e})=>({...zl(t,e),isSync:!0}),zl=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=KE(t);return{file:r,commandArguments:n}},KE=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(JE)){let o=r.at(-1);o&&o.endsWith("\\")?r[r.length-1]=`${o.slice(0,-1)} ${n}`:r.push(n)}return r},JE=/ +/g;var ql=(t,e,r)=>{t.sync=e(XE,r),t.s=t.sync},Yl=({options:t})=>Kl(t),XE=({options:t})=>({...Kl(t),isSync:!0}),Kl=t=>({options:{...ZE(t),...t}}),ZE=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},Jl={preferLocal:!0};var je=le(()=>({})),N8=le(()=>({isSync:!0})),Xl=le(Wl),U8=le(Hl),V8=le(uu),G8=le(Yl,{},Jl,ql),{sendMessage:W8,getOneMessage:H8,getEachMessage:z8,getCancelSignal:q8}=Yc();var Zl="ghcr.io/spree/spree",Ir="latest";var Ql="https://github.com/spree/storefront.git",Rr="spree@example.com",Mr="spree123";import QE from"crypto";function ep(){let t=process.env.npm_config_user_agent??"";return t.startsWith("yarn")?"yarn":t.startsWith("pnpm")?"pnpm":"npm"}async function tp(){try{return await Xl("docker info",{stdio:"ignore"}),!0}catch{return!1}}function rp(){return QE.randomBytes(64).toString("hex")}function Xo(t){return t==="yarn"?"yarn":`${t} install`}function np(t){return`x-app: &app
126
126
  image: ${Zl}:${Ir}
127
127
  depends_on:
128
128
  postgres:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-spree-app",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Create a new Spree Commerce project with a single command",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",