Archived
0
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
wahpkg/.yarn/releases/yarn-sources.cjs

774 lines
2.7 MiB
JavaScript
Raw Normal View History

2022-08-27 06:35:11 +00:00
#!/usr/bin/env node
/* eslint-disable */
//prettier-ignore
2022-09-06 17:07:18 +00:00
(()=>{var c8e=Object.create;var XR=Object.defineProperty;var u8e=Object.getOwnPropertyDescriptor;var f8e=Object.getOwnPropertyNames;var g8e=Object.getPrototypeOf,p8e=Object.prototype.hasOwnProperty;var Be=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var Ot=(t,e)=>()=>(t&&(e=t(t=0)),e);var K=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),sr=(t,e)=>{for(var r in e)XR(t,r,{get:e[r],enumerable:!0})},h8e=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of f8e(e))!p8e.call(t,a)&&a!==r&&XR(t,a,{get:()=>e[a],enumerable:!(o=u8e(e,a))||o.enumerable});return t};var Te=(t,e,r)=>(r=t!=null?c8e(g8e(t)):{},h8e(e||!t||!t.__esModule?XR(r,"default",{value:t,enumerable:!0}):r,t));var Ni={};sr(Ni,{SAFE_TIME:()=>R9,S_IFDIR:()=>o0,S_IFLNK:()=>A0,S_IFMT:()=>rc,S_IFREG:()=>a0});var rc,o0,a0,A0,R9,T9=Ot(()=>{rc=61440,o0=16384,a0=32768,A0=40960,R9=456789e3});var WE={};sr(WE,{BigIntStatsEntry:()=>QC,DEFAULT_MODE:()=>jE,DirEntry:()=>ZR,StatEntry:()=>Mf,areStatsEqual:()=>eT,clearStats:()=>VQ,convertToBigIntStats:()=>XQ,makeDefaultStats:()=>YE,makeEmptyStats:()=>d8e});function YE(){return new Mf}function d8e(){return VQ(YE())}function VQ(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):$R.types.isDate(r)&&(t[e]=new Date(0))}return t}function XQ(t){let e=new QC;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];typeof o=="number"?e[r]=BigInt(o):$R.types.isDate(o)&&(e[r]=new Date(o))}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 eT(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,o=e;return!(r.atimeNs!==o.atimeNs||r.mtimeNs!==o.mtimeNs||r.ctimeNs!==o.ctimeNs||r.birthtimeNs!==o.birthtimeNs)}var $R,jE,ZR,Mf,QC,ZQ=Ot(()=>{$R=Te(Be("util")),jE=33188,ZR=class{constructor(){this.name="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},Mf=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=jE;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},QC=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(jE);this.nlink=BigInt(1);this.rdev=BigInt(0);this.blocks=BigInt(1)}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&BigInt(61440))===BigInt(16384)}isFIFO(){return!1}isFile(){return(thi
`).length,o=e.length-r;return r>o?`\r
2022-08-27 06:35:11 +00:00
`:`
2022-09-06 17:07:18 +00:00
`}function c0(t,e){return e.replace(/\r?\n/g,S8e(t))}var H9,q9,Nf,up,fp=Ot(()=>{H9=Be("crypto"),q9=Be("os");nT();_o();Nf=class{constructor(e){this.pathUtils=e}async*genTraversePromise(e,{stableSort:r=!1}={}){let o=[e];for(;o.length>0;){let a=o.shift();if((await this.lstatPromise(a)).isDirectory()){let c=await this.readdirPromise(a);if(r)for(let f of c.sort())o.push(this.pathUtils.join(a,f));else throw new Error("Not supported")}else yield a}}async checksumFilePromise(e,{algorithm:r="sha512"}={}){let o=await this.openPromise(e,"r");try{let n=Buffer.allocUnsafeSlow(65536),c=(0,H9.createHash)(r),f=0;for(;(f=await this.readPromise(o,n,0,65536))!==0;)c.update(f===65536?n:n.slice(0,f));return c.digest("hex")}finally{await this.closePromise(o)}}async removePromise(e,{recursive:r=!0,maxRetries:o=5}={}){let a;try{a=await this.lstatPromise(e)}catch(n){if(n.code==="ENOENT")return;throw n}if(a.isDirectory()){if(r){let n=await this.readdirPromise(e);await Promise.all(n.map(c=>this.removePromise(this.pathUtils.resolve(e,c))))}for(let n=0;n<=o;n++)try{await this.rmdirPromise(e);break}catch(c){if(c.code!=="EBUSY"&&c.code!=="ENOTEMPTY")throw c;n<o&&await new Promise(f=>setTimeout(f,n*100))}}else await this.unlinkPromise(e)}removeSync(e,{recursive:r=!0}={}){let o;try{o=this.lstatSync(e)}catch(a){if(a.code==="ENOENT")return;throw a}if(o.isDirectory()){if(r)for(let a of this.readdirSync(e))this.removeSync(this.pathUtils.resolve(e,a));this.rmdirSync(e)}else this.unlinkSync(e)}async mkdirpPromise(e,{chmod:r,utimes:o}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{await this.mkdirPromise(f)}catch(g){if(g.code==="EEXIST")continue;throw g}if(n??(n=f),r!=null&&await this.chmodPromise(f,r),o!=null)await this.utimesPromise(f,o[0],o[1]);else{let g=await this.statPromise(this.pathUtils.dirname(f));await this.utimesPromise(f,g.atime,g.mtime)}}}return n}mkdirpSync(e,{chmod:r,utimes:o}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{this.mkdirSync(f)}catch(g){if(g.code==="EEXIST")continue;throw g}if(n??(n=f),r!=null&&this.chmodSync(f,r),o!=null)this.utimesSync(f,o[0],o[1]);else{let g=this.statSync(this.pathUtils.dirname(f));this.utimesSync(f,g.atime,g.mtime)}}}return n}async copyPromise(e,r,{baseFs:o=this,overwrite:a=!0,stableSort:n=!1,stableTime:c=!1,linkStrategy:f=null}={}){return await L9(this,e,o,r,{overwrite:a,stableSort:n,stableTime:c,linkStrategy:f})}copySync(e,r,{baseFs:o=this,overwrite:a=!0}={}){let n=o.lstatSync(r),c=this.existsSync(e);if(n.isDirectory()){this.mkdirpSync(e);let g=o.readdirSync(r);for(let p of g)this.copySync(this.pathUtils.join(e,p),o.pathUtils.join(r,p),{baseFs:o,overwrite:a})}else if(n.isFile()){if(!c||a){c&&this.removeSync(e);let g=o.readFileSync(r);this.writeFileSync(e,g)}}else if(n.isSymbolicLink()){if(!c||a){c&&this.removeSync(e);let g=o.readlinkSync(r);this.symlinkSync($Q(this.pathUtils,g),e)}}else throw new Error(`Unsupported file type (file: ${r}, mode: 0o${n.mode.toString(8).padStart(6,"0")})`);let f=n.mode&511;this.chmodSync(e,f)}async changeFilePromise(e,r,o={}){return Buffer.isBuffer(r)?this.changeFileBufferPromise(e,r,o):this.changeFileTextPromise(e,r,o)}async changeFileBufferPromise(e,r,{mode:o}={}){let a=Buffer.alloc(0);try{a=await this.readFilePromise(e)}catch{}Buffer.compare(a,r)!==0&&await this.writeFilePromise(e,r,{mode:o})}async changeFileTextPromise(e,r,{automaticNewlines:o,mode:a}={}){let n="";try{n=await this.readFilePromise(e,"utf8")}catch{}let c=o?c0(n,r):r;n!==c&&await this.writeFilePromise(e,c,{mode:a})}changeFileSync(e,r,o={}){return Buffer.isBuffer(r)?this.changeFileBufferSync(e,r,o):this.changeFileTextSync(e,r,o)}changeFileBufferSync(e,r,{mode:o}={}){let a=Buffer.alloc(0);try{a=this.readFileSync(e)}catch{}Buffer.compare(a,r)!==0&&this.writeFileSync(e,r,{mode:o})}changeFileTextSync(e,r,{automaticNew
2022-08-27 06:35:11 +00:00
`)}writeJsonSync(e,r){return this.writeFileSync(e,`${JSON.stringify(r,null,2)}
2022-09-06 17:07:18 +00:00
`)}async preserveTimePromise(e,r){let o=await this.lstatPromise(e),a=await r();typeof a<"u"&&(e=a),this.lutimesPromise?await this.lutimesPromise(e,o.atime,o.mtime):o.isSymbolicLink()||await this.utimesPromise(e,o.atime,o.mtime)}async preserveTimeSync(e,r){let o=this.lstatSync(e),a=r();typeof a<"u"&&(e=a),this.lutimesSync?this.lutimesSync(e,o.atime,o.mtime):o.isSymbolicLink()||this.utimesSync(e,o.atime,o.mtime)}},up=class extends Nf{constructor(){super(ee)}}});var G9,Xn,gp=Ot(()=>{G9=Te(Be("fs"));fp();XE();_o();Xn=class extends up{constructor(r=G9.default){super();this.realFs=r,typeof this.realFs.lutimes<"u"&&(this.lutimesPromise=this.lutimesPromiseImpl,this.lutimesSync=this.lutimesSyncImpl)}getExtractHint(){return!1}getRealPath(){return Qt.root}resolve(r){return ee.resolve(r)}async openPromise(r,o,a){return await new Promise((n,c)=>{this.realFs.open(de.fromPortablePath(r),o,a,this.makeCallback(n,c))})}openSync(r,o,a){return this.realFs.openSync(de.fromPortablePath(r),o,a)}async opendirPromise(r,o){return await new Promise((a,n)=>{typeof o<"u"?this.realFs.opendir(de.fromPortablePath(r),o,this.makeCallback(a,n)):this.realFs.opendir(de.fromPortablePath(r),this.makeCallback(a,n))}).then(a=>Object.defineProperty(a,"path",{value:r,configurable:!0,writable:!0}))}opendirSync(r,o){let a=typeof o<"u"?this.realFs.opendirSync(de.fromPortablePath(r),o):this.realFs.opendirSync(de.fromPortablePath(r));return Object.defineProperty(a,"path",{value:r,configurable:!0,writable:!0})}async readPromise(r,o,a=0,n=0,c=-1){return await new Promise((f,g)=>{this.realFs.read(r,o,a,n,c,(p,I)=>{p?g(p):f(I)})})}readSync(r,o,a,n,c){return this.realFs.readSync(r,o,a,n,c)}async writePromise(r,o,a,n,c){return await new Promise((f,g)=>typeof o=="string"?this.realFs.write(r,o,a,this.makeCallback(f,g)):this.realFs.write(r,o,a,n,c,this.makeCallback(f,g)))}writeSync(r,o,a,n,c){return typeof o=="string"?this.realFs.writeSync(r,o,a):this.realFs.writeSync(r,o,a,n,c)}async closePromise(r){await new Promise((o,a)=>{this.realFs.close(r,this.makeCallback(o,a))})}closeSync(r){this.realFs.closeSync(r)}createReadStream(r,o){let a=r!==null?de.fromPortablePath(r):r;return this.realFs.createReadStream(a,o)}createWriteStream(r,o){let a=r!==null?de.fromPortablePath(r):r;return this.realFs.createWriteStream(a,o)}async realpathPromise(r){return await new Promise((o,a)=>{this.realFs.realpath(de.fromPortablePath(r),{},this.makeCallback(o,a))}).then(o=>de.toPortablePath(o))}realpathSync(r){return de.toPortablePath(this.realFs.realpathSync(de.fromPortablePath(r),{}))}async existsPromise(r){return await new Promise(o=>{this.realFs.exists(de.fromPortablePath(r),o)})}accessSync(r,o){return this.realFs.accessSync(de.fromPortablePath(r),o)}async accessPromise(r,o){return await new Promise((a,n)=>{this.realFs.access(de.fromPortablePath(r),o,this.makeCallback(a,n))})}existsSync(r){return this.realFs.existsSync(de.fromPortablePath(r))}async statPromise(r,o){return await new Promise((a,n)=>{o?this.realFs.stat(de.fromPortablePath(r),o,this.makeCallback(a,n)):this.realFs.stat(de.fromPortablePath(r),this.makeCallback(a,n))})}statSync(r,o){return o?this.realFs.statSync(de.fromPortablePath(r),o):this.realFs.statSync(de.fromPortablePath(r))}async fstatPromise(r,o){return await new Promise((a,n)=>{o?this.realFs.fstat(r,o,this.makeCallback(a,n)):this.realFs.fstat(r,this.makeCallback(a,n))})}fstatSync(r,o){return o?this.realFs.fstatSync(r,o):this.realFs.fstatSync(r)}async lstatPromise(r,o){return await new Promise((a,n)=>{o?this.realFs.lstat(de.fromPortablePath(r),o,this.makeCallback(a,n)):this.realFs.lstat(de.fromPortablePath(r),this.makeCallback(a,n))})}lstatSync(r,o){return o?this.realFs.lstatSync(de.fromPortablePath(r),o):this.realFs.lstatSync(de.fromPortablePath(r))}async fchmodPromise(r,o){return await new Promise((a,n)=>{this.realFs.fchmod(r,o,this.makeCallback(a,n))})}fchmodSync(r,o){return this.realFs.fchmodSync(r,o)}async chmodPromise(r,o){return await new Promise((a,n)=>{this.realFs.chmod(de.fromPortablePath(r),o,this.makeCallback(a,n))})}chmodSync(r,o){return this.realFs.chmodSync(de.fr
`,ni=le(`\\
`,!1),Xt=function(){return""},Ri="\\",Yn=le("\\",!1),us=/^[\\$"`]/,Dt=Pe(["\\","$",'"',"`"],!1,!1),Vi=function(N){return N},xn="\\a",fs=le("\\a",!1),oA=function(){return"a"},Sr="\\b",Qo=le("\\b",!1),fr=function(){return"\b"},Sa=/^[Ee]/,$=Pe(["E","e"],!1,!1),tn=function(){return"\x1B"},we="\\f",Lt=le("\\f",!1),HA=function(){return"\f"},Xi="\\n",_l=le("\\n",!1),jt=function(){return`
`},aA="\\r",Lc=le("\\r",!1),$u=function(){return"\r"},qA="\\t",Oc=le("\\t",!1),Nn=function(){return" "},di="\\v",GA=le("\\v",!1),Uc=function(){return"\v"},ea=/^[\\'"?]/,Zi=Pe(["\\","'",'"',"?"],!1,!1),vo=function(N){return String.fromCharCode(parseInt(N,16))},it="\\x",eo=le("\\x",!1),ka="\\u",Kl=le("\\u",!1),Hi="\\U",xa=le("\\U",!1),AA=function(N){return String.fromCodePoint(parseInt(N,16))},Dr=/^[0-7]/,lA=Pe([["0","7"]],!1,!1),Bs=/^[0-9a-fA-f]/,Ut=Pe([["0","9"],["a","f"],["A","f"]],!1,!1),Pn=Ge(),Ai="{}",ta=le("{}",!1),to=function(){return"{}"},Qs="-",ra=le("-",!1),Zt="+",na=le("+",!1),vs=".",ro=le(".",!1),no=function(N,V,ae){return{type:"number",value:(N==="-"?-1:1)*parseFloat(V.join("")+"."+ae.join(""))}},io=function(N,V){return{type:"number",value:(N==="-"?-1:1)*parseInt(V.join(""))}},Do=function(N){return{type:"variable",...N}},li=function(N){return{type:"variable",name:N}},ii=function(N){return N},ia="*",Os=le("*",!1),qi="/",jA=le("/",!1),cA=function(N,V,ae){return{type:V==="*"?"multiplication":"division",right:ae}},oe=function(N,V){return V.reduce((ae,he)=>({left:ae,...he}),N)},ve=function(N,V,ae){return{type:V==="+"?"addition":"subtraction",right:ae}},qe="$((",kt=le("$((",!1),Et="))",Yt=le("))",!1),Fr=function(N){return N},wn="$(",Pa=le("$(",!1),Lh=function(N){return N},So="${",uA=le("${",!1),_c=":-",YA=le(":-",!1),Kc=function(N,V){return{name:N,defaultValue:V}},Rg=":-}",Hl=le(":-}",!1),Tg=function(N){return{name:N,defaultValue:[]}},ql=":+",so=le(":+",!1),Hc=function(N,V){return{name:N,alternativeValue:V}},WA=":+}",sa=le(":+}",!1),Mg=function(N){return{name:N,alternativeValue:[]}},JA=function(N){return{name:N}},Oh="$",Ng=le("$",!1),si=function(N){return e.isGlobPattern(N)},ef=function(N){return N},Lg=/^[a-zA-Z0-9_]/,qc=Pe([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),Us=function(){return F()},Gl=/^[$@*?#a-zA-Z0-9_\-]/,ba=Pe(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),$i=/^[()}<>$|&; \t"']/,oa=Pe(["(",")","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),jl=/^[<>&; \t"']/,Ds=Pe(["<",">","&",";"," "," ",'"',"'"],!1,!1),zA=/^[ \t]/,ko=Pe([" "," "],!1,!1),J=0,Bt=0,Fa=[{line:1,column:1}],ki=0,Ra=[],ct=0,Ta;if("startRule"in e){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=o[e.startRule]}function F(){return t.substring(Bt,J)}function _(){return er(Bt,J)}function G(N,V){throw V=V!==void 0?V:er(Bt,J),ir([bt(N)],t.substring(Bt,J),V)}function ie(N,V){throw V=V!==void 0?V:er(Bt,J),Cr(N,V)}function le(N,V){return{type:"literal",text:N,ignoreCase:V}}function Pe(N,V,ae){return{type:"class",parts:N,inverted:V,ignoreCase:ae}}function Ge(){return{type:"any"}}function ut(){return{type:"end"}}function bt(N){return{type:"other",description:N}}function ar(N){var V=Fa[N],ae;if(V)return V;for(ae=N-1;!Fa[ae];)ae--;for(V=Fa[ae],V={line:V.line,column:V.column};ae<N;)t.charCodeAt(ae)===10?(V.line++,V.column=1):V.column++,ae++;return Fa[N]=V,V}function er(N,V){var ae=ar(N),he=ar(V);return{start:{offset:N,line:ae.line,column:ae.column},end:{offset:V,line:he.line,column:he.column}}}function st(N){J<ki||(J>ki&&(ki=J,Ra=[]),Ra.push(N))}function Cr(N,V){return new f0(N,null,null,V)}function ir(N,V,ae){return new f0(f0.buildMessage(N,V),N,V,ae)}function Hr(){var N,V;return N=J,V=ci(),V===r&&(V=null),V!==r&&(Bt=N,V=n(V)),N=V,N}function ci(){var N,V,ae,he,et;if(N=J,V=xo(),V!==r){for(ae=[],he=Tt();he!==r;)ae.push(he),he=Tt();ae!==r?(he=es(),he!==r?(et=_s(),et===r&&(et=null),et!==r?(Bt=N,V=c(V,he,et),N=V):(J=N,N=r)):(J=N,N=r)):(J=N,N=r)}else J=N,N=r;if(N===r)if(N=J,V=xo(),V!==r){for(ae=[],he=Tt();he!==r;)ae.push(he),he=Tt();ae!==r?(he=es(),he===r&&(he=null),he!==r?(Bt=N,V=f(V,he),N=V):(J=N,N=r)):(J=N,N=r)}else J=N,N=r;return N}function _s(){var N,V,ae,he,et;for(N=J,V=[],ae=Tt();ae!==r;)V.push(ae),ae=Tt();if(V!==r)if(ae=ci(),ae!==r){for(he=[],et=Tt();et!==r;)he.push(et),et=Tt();he!==r?(Bt=N,V=g(ae),N=V):(J=N,N=r)}else J=N,N=r;else J=N,N=r;return N}function es(){var N;return t.charCodeAt(J)===59?(N=p,J++):(N=r,ct===0&&st(I)),N===r&&(t.charCodeAt(J)===38?(N=B,J++):(N=r,ct===0&&st(Q))),
\x85\u2028\u2029`.indexOf(this.buffer.charAt(a-1))===-1;)if(a-=1,this.position-a>r/2-1){o=" ... ",a+=5;break}for(n="",c=this.position;c<this.buffer.length&&`\0\r
\x85\u2028\u2029`.indexOf(this.buffer.charAt(c))===-1;)if(c+=1,c-this.position>r/2-1){n=" ... ",c-=5;break}return f=this.buffer.slice(a,c),u7.repeat(" ",e)+o+f+n+`
`+u7.repeat(" ",e+this.position-a+o.length)+"^"};PT.prototype.toString=function(e){var r,o="";return this.name&&(o+='in "'+this.name+'" '),o+="at line "+(this.line+1)+", column "+(this.column+1),e||(r=this.getSnippet(),r&&(o+=`:
`+r)),o};f7.exports=PT});var Fs=K((dkt,h7)=>{"use strict";var p7=NC(),m_e=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],C_e=["scalar","sequence","mapping"];function y_e(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(o){e[String(o)]=r})}),e}function I_e(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(m_e.indexOf(r)===-1)throw new p7('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=y_e(e.styleAliases||null),C_e.indexOf(this.kind)===-1)throw new p7('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}h7.exports=I_e});var m0=K((mkt,m7)=>{"use strict";var d7=d0(),Iv=NC(),E_e=Fs();function bT(t,e,r){var o=[];return t.include.forEach(function(a){r=bT(a,e,r)}),t[e].forEach(function(a){r.forEach(function(n,c){n.tag===a.tag&&n.kind===a.kind&&o.push(c)}),r.push(a)}),r.filter(function(a,n){return o.indexOf(n)===-1})}function w_e(){var t={scalar:{},sequence:{},mapping:{},fallback:{}},e,r;function o(a){t[a.kind][a.tag]=t.fallback[a.tag]=a}for(e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(o);return t}function LC(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&e.loadKind!=="scalar")throw new Iv("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=bT(this,"implicit",[]),this.compiledExplicit=bT(this,"explicit",[]),this.compiledTypeMap=w_e(this.compiledImplicit,this.compiledExplicit)}LC.DEFAULT=null;LC.create=function(){var e,r;switch(arguments.length){case 1:e=LC.DEFAULT,r=arguments[0];break;case 2:e=arguments[0],r=arguments[1];break;default:throw new Iv("Wrong number of arguments for Schema.create function")}if(e=d7.toArray(e),r=d7.toArray(r),!e.every(function(o){return o instanceof LC}))throw new Iv("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(o){return o instanceof E_e}))throw new Iv("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new LC({include:e,explicit:r})};m7.exports=LC});var y7=K((Ckt,C7)=>{"use strict";var B_e=Fs();C7.exports=new B_e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var E7=K((ykt,I7)=>{"use strict";var Q_e=Fs();I7.exports=new Q_e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var B7=K((Ikt,w7)=>{"use strict";var v_e=Fs();w7.exports=new v_e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var Ev=K((Ekt,Q7)=>{"use strict";var D_e=m0();Q7.exports=new D_e({explicit:[y7(),E7(),B7()]})});var D7=K((wkt,v7)=>{"use strict";var S_e=Fs();function k_e(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function x_e(){return null}function P_e(t){return t===null}v7.exports=new S_e("tag:yaml.org,2002:null",{kind:"scalar",resolve:k_e,construct:x_e,predicate:P_e,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var k7=K((Bkt,S7)=>{"use strict";var b_e=Fs();function F_e(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function R_e(t){return t==="true"||t==="True"||t==="TRUE"}function T_e(t){return Object.prototype.toString.call(t)==="[object Boolean]"}S7.exports=new b_e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:F_e,construct:R_e,predicate:T_e,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE"
\r`;function sKe(t){if(t===null)return!1;var e,r,o=0,a=t.length,n=TT;for(r=0;r<a;r++)if(e=n.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;o+=6}return o%8===0}function oKe(t){var e,r,o=t.replace(/[\r\n=]/g,""),a=o.length,n=TT,c=0,f=[];for(e=0;e<a;e++)e%4===0&&e&&(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)),c=c<<6|n.indexOf(o.charAt(e));return r=a%4*6,r===0?(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)):r===18?(f.push(c>>10&255),f.push(c>>2&255)):r===12&&f.push(c>>4&255),C0?C0.from?C0.from(f):new C0(f):f}function aKe(t){var e="",r=0,o,a,n=t.length,c=TT;for(o=0;o<n;o++)o%3===0&&o&&(e+=c[r>>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]),r=(r<<8)+t[o];return a=n%3,a===0?(e+=c[r>>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]):a===2?(e+=c[r>>10&63],e+=c[r>>4&63],e+=c[r<<2&63],e+=c[64]):a===1&&(e+=c[r>>2&63],e+=c[r<<4&63],e+=c[64],e+=c[64]),e}function AKe(t){return C0&&C0.isBuffer(t)}q7.exports=new iKe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:sKe,construct:oKe,predicate:AKe,represent:aKe})});var Y7=K((bkt,j7)=>{"use strict";var lKe=Fs(),cKe=Object.prototype.hasOwnProperty,uKe=Object.prototype.toString;function fKe(t){if(t===null)return!0;var e=[],r,o,a,n,c,f=t;for(r=0,o=f.length;r<o;r+=1){if(a=f[r],c=!1,uKe.call(a)!=="[object Object]")return!1;for(n in a)if(cKe.call(a,n))if(!c)c=!0;else return!1;if(!c)return!1;if(e.indexOf(n)===-1)e.push(n);else return!1}return!0}function gKe(t){return t!==null?t:[]}j7.exports=new lKe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:fKe,construct:gKe})});var J7=K((Fkt,W7)=>{"use strict";var pKe=Fs(),hKe=Object.prototype.toString;function dKe(t){if(t===null)return!0;var e,r,o,a,n,c=t;for(n=new Array(c.length),e=0,r=c.length;e<r;e+=1){if(o=c[e],hKe.call(o)!=="[object Object]"||(a=Object.keys(o),a.length!==1))return!1;n[e]=[a[0],o[a[0]]]}return!0}function mKe(t){if(t===null)return[];var e,r,o,a,n,c=t;for(n=new Array(c.length),e=0,r=c.length;e<r;e+=1)o=c[e],a=Object.keys(o),n[e]=[a[0],o[a[0]]];return n}W7.exports=new pKe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:dKe,construct:mKe})});var V7=K((Rkt,z7)=>{"use strict";var CKe=Fs(),yKe=Object.prototype.hasOwnProperty;function IKe(t){if(t===null)return!0;var e,r=t;for(e in r)if(yKe.call(r,e)&&r[e]!==null)return!1;return!0}function EKe(t){return t!==null?t:{}}z7.exports=new CKe("tag:yaml.org,2002:set",{kind:"mapping",resolve:IKe,construct:EKe})});var OC=K((Tkt,X7)=>{"use strict";var wKe=m0();X7.exports=new wKe({include:[RT()],implicit:[U7(),K7()],explicit:[G7(),Y7(),J7(),V7()]})});var $7=K((Mkt,Z7)=>{"use strict";var BKe=Fs();function QKe(){return!0}function vKe(){}function DKe(){return""}function SKe(t){return typeof t>"u"}Z7.exports=new BKe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:QKe,construct:vKe,predicate:SKe,represent:DKe})});var tW=K((Nkt,eW)=>{"use strict";var kKe=Fs();function xKe(t){if(t===null||t.length===0)return!1;var e=t,r=/\/([gim]*)$/.exec(t),o="";return!(e[0]==="/"&&(r&&(o=r[1]),o.length>3||e[e.length-o.length-1]!=="/"))}function PKe(t){var e=t,r=/\/([gim]*)$/.exec(t),o="";return e[0]==="/"&&(r&&(o=r[1]),e=e.slice(1,e.length-o.length-1)),new RegExp(e,o)}function bKe(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}function FKe(t){return Object.prototype.toString.call(t)==="[object RegExp]"}eW.exports=new kKe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:xKe,construct:PKe,predicate:FKe,represent:bKe})});var iW=K((Lkt,nW)=>{"use strict";var wv;try{rW=Be,wv=rW("esprima")}catch{typeof window<"u"&&(wv=window.esprima)}var rW,RKe=Fs();function TKe(t){if(t===null)return!1;try{var e="("+t+")",r=wv.parse(e,{range:!0});return!(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function MKe(t){var e="("+t+")",r=wv.parse(e,{range:!0}),o=[],a;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function WKe(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}var yW=new Array(256),IW=new Array(256);for(y0=0;y0<256;y0++)yW[y0]=lW(y0)?1:0,IW[y0]=lW(y0);var y0;function JKe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||UKe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function EW(t,e){return new gW(e,new OKe(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function Mr(t,e){throw EW(t,e)}function vv(t,e){t.onWarning&&t.onWarning.call(null,EW(t,e))}var cW={YAML:function(e,r,o){var a,n,c;e.version!==null&&Mr(e,"duplication of %YAML directive"),o.length!==1&&Mr(e,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),a===null&&Mr(e,"ill-formed argument of the YAML directive"),n=parseInt(a[1],10),c=parseInt(a[2],10),n!==1&&Mr(e,"unacceptable YAML version of the document"),e.version=o[0],e.checkLineBreaks=c<2,c!==1&&c!==2&&vv(e,"unsupported YAML version of the document")},TAG:function(e,r,o){var a,n;o.length!==2&&Mr(e,"TAG directive accepts exactly two arguments"),a=o[0],n=o[1],mW.test(a)||Mr(e,"ill-formed tag handle (first argument) of the TAG directive"),dp.call(e.tagMap,a)&&Mr(e,'there is a previously declared suffix for "'+a+'" tag handle'),CW.test(n)||Mr(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[a]=n}};function hp(t,e,r,o){var a,n,c,f;if(e<r){if(f=t.input.slice(e,r),o)for(a=0,n=f.length;a<n;a+=1)c=f.charCodeAt(a),c===9||32<=c&&c<=1114111||Mr(t,"expected valid JSON character");else KKe.test(f)&&Mr(t,"the stream contains non-printable characters");t.result+=f}}function uW(t,e,r,o){var a,n,c,f;for(Uf.isObject(r)||Mr(t,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(r),c=0,f=a.length;c<f;c+=1)n=a[c],dp.call(e,n)||(e[n]=r[n],o[n]=!0)}function _C(t,e,r,o,a,n,c,f){var g,p;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),g=0,p=a.length;g<p;g+=1)Array.isArray(a[g])&&Mr(t,"nested arrays are not supported inside keys"),typeof a=="object"&&AW(a[g])==="[object Object]"&&(a[g]="[object Object]");if(typeof a=="object"&&AW(a)==="[object Object]"&&(a="[object Object]"),a=String(a),e===null&&(e={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(n))for(g=0,p=n.length;g<p;g+=1)uW(t,e,n[g],r);else uW(t,e,n,r);else!t.json&&!dp.call(r,a)&&dp.call(e,a)&&(t.line=c||t.line,t.position=f||t.position,Mr(t,"duplicated mapping key")),e[a]=n,delete r[a];return e}function NT(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):Mr(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function ps(t,e,r){for(var o=0,a=t.input.charCodeAt(t.position);a!==0;){for(;I0(a);)a=t.input.charCodeAt(++t.position);if(e&&a===35)do a=t.input.charCodeAt(++t.position);while(a!==10&&a!==13&&a!==0);if(Au(a))for(NT(t),a=t.input.charCodeAt(t.position),o++,t.lineIndent=0;a===32;)t.lineIndent++,a=t.input.charCodeAt(++t.position);else break}return r!==-1&&o!==0&&t.lineIndent<r&&vv(t,"deficient indentation"),o}function Dv(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||ja(r)))}function LT(t,e){e===1?t.result+=" ":e>1&&(t.result+=Uf.repeat(`
`,e-1))}function zKe(t,e,r){var o,a,n,c,f,g,p,I,B=t.kind,Q=t.result,x;if(x=t.input.charCodeAt(t.position),ja(x)||UC(x)||x===35||x===38||x===42||x===33||x===124||x===62||x===39||x===34||x===37||x===64||x===96||(x===63||x===45)&&(a=t.input.charCodeAt(t.position+1),ja(a)||r&&UC(a)))return!1;for(t.kind="scalar",t.result="",n=c=t.position,f=!1;x!==0;){if(x===58){if(a=t.input.charCodeAt(t.position+1),ja(a)||r&&UC(a))break}else if(x===35){if(o=t.input.charCodeAt(t.position-1),ja(o))break}else{if(t.position===t.lineStart&&Dv(t)||r&&UC(x))break;if(Au(x))if(g=t.line,p=t.lineStart,I=t.lineIndent,ps(t,!1,-1),t.lineIndent>=e){f=!0,x=t.input.charCodeAt(t.position);continue}else{t.position=c,t.line=g,t.lineStart=p,t.lineIndent=I;break}}f&&(hp(t,n,c,!1),LT(t,t.line-g),n=c=t.position,f=!1),I0(x)||(c=t.position+1),x=t.input.charCodeAt(++t.position)}return hp(t,n,c,!1),t.result?!0:(t.kind=B,t.result=Q,!1)}function VKe(t,e){var r,o,a;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,o=a=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(hp(t,o,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)o=t.position,t.position++,a=t.position;else return!0;else Au(r)?(hp(t,o,a,!0),LT(t,ps(t,!1,e)),o=a=t.position):t.position===t.lineStart&&Dv(t)?Mr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,a=t.position);Mr(t,"unexpected end of the stream within a single quoted scalar")}function XKe(t,e){var r,o,a,n,c,f;if(f=t.input.charCodeAt(t.position),f!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=o=t.position;(f=t.input.charCodeAt(t.position))!==0;){if(f===34)return hp(t,r,t.position,!0),t.position++,!0;if(f===92){if(hp(t,r,t.position,!0),f=t.input.charCodeAt(++t.position),Au(f))ps(t,!1,e);else if(f<256&&yW[f])t.result+=IW[f],t.position++;else if((c=jKe(f))>0){for(a=c,n=0;a>0;a--)f=t.input.charCodeAt(++t.position),(c=GKe(f))>=0?n=(n<<4)+c:Mr(t,"expected hexadecimal character");t.result+=WKe(n),t.position++}else Mr(t,"unknown escape sequence");r=o=t.position}else Au(f)?(hp(t,r,o,!0),LT(t,ps(t,!1,e)),r=o=t.position):t.position===t.lineStart&&Dv(t)?Mr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,o=t.position)}Mr(t,"unexpected end of the stream within a double quoted scalar")}function ZKe(t,e){var r=!0,o,a=t.tag,n,c=t.anchor,f,g,p,I,B,Q={},x,y,T,U;if(U=t.input.charCodeAt(t.position),U===91)g=93,B=!1,n=[];else if(U===123)g=125,B=!0,n={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),U=t.input.charCodeAt(++t.position);U!==0;){if(ps(t,!0,e),U=t.input.charCodeAt(t.position),U===g)return t.position++,t.tag=a,t.anchor=c,t.kind=B?"mapping":"sequence",t.result=n,!0;r||Mr(t,"missed comma between flow collection entries"),y=x=T=null,p=I=!1,U===63&&(f=t.input.charCodeAt(t.position+1),ja(f)&&(p=I=!0,t.position++,ps(t,!0,e))),o=t.line,KC(t,e,Bv,!1,!0),y=t.tag,x=t.result,ps(t,!0,e),U=t.input.charCodeAt(t.position),(I||t.line===o)&&U===58&&(p=!0,U=t.input.charCodeAt(++t.position),ps(t,!0,e),KC(t,e,Bv,!1,!0),T=t.result),B?_C(t,n,Q,y,x,T):p?n.push(_C(t,null,Q,y,x,T)):n.push(x),ps(t,!0,e),U=t.input.charCodeAt(t.position),U===44?(r=!0,U=t.input.charCodeAt(++t.position)):r=!1}Mr(t,"unexpected end of the stream within a flow collection")}function $Ke(t,e){var r,o,a=MT,n=!1,c=!1,f=e,g=0,p=!1,I,B;if(B=t.input.charCodeAt(t.position),B===124)o=!1;else if(B===62)o=!0;else return!1;for(t.kind="scalar",t.result="";B!==0;)if(B=t.input.charCodeAt(++t.position),B===43||B===45)MT===a?a=B===43?aW:_Ke:Mr(t,"repeat of a chomping mode identifier");else if((I=YKe(B))>=0)I===0?Mr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Mr(t,"repeat of an indentation width identifier"):(f=e+I-1,c=!0);else break;if(I0(B)){do B=t.input.charCodeAt(++t.position);while(I0(B));if(B===35)do B=t.input.charCodeAt(++t.position);while(!Au(B)&&B!==0)}for(;B!==0;){for(NT(t),t.lineIndent=0,B=t.input.charCodeAt(t.position);(!c||t.lineIndent<f)&&B===32;)t.lineIndent++,B=t.input.charCodeAt(++t.position);if(!c&&t.lineIndent>f&&(f=t
`,n?1+g:g):a===MT&&n&&(t.result+=`
`);break}for(o?I0(B)?(p=!0,t.result+=Uf.repeat(`
`,n?1+g:g)):p?(p=!1,t.result+=Uf.repeat(`
`,g+1)):g===0?n&&(t.result+=" "):t.result+=Uf.repeat(`
`,g):t.result+=Uf.repeat(`
`,n?1+g:g),n=!0,c=!0,g=0,r=t.position;!Au(B)&&B!==0;)B=t.input.charCodeAt(++t.position);hp(t,r,t.position,!1)}return!0}function fW(t,e){var r,o=t.tag,a=t.anchor,n=[],c,f=!1,g;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),g=t.input.charCodeAt(t.position);g!==0&&!(g!==45||(c=t.input.charCodeAt(t.position+1),!ja(c)));){if(f=!0,t.position++,ps(t,!0,-1)&&t.lineIndent<=e){n.push(null),g=t.input.charCodeAt(t.position);continue}if(r=t.line,KC(t,e,dW,!1,!0),n.push(t.result),ps(t,!0,-1),g=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&g!==0)Mr(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return f?(t.tag=o,t.anchor=a,t.kind="sequence",t.result=n,!0):!1}function eHe(t,e,r){var o,a,n,c,f=t.tag,g=t.anchor,p={},I={},B=null,Q=null,x=null,y=!1,T=!1,U;for(t.anchor!==null&&(t.anchorMap[t.anchor]=p),U=t.input.charCodeAt(t.position);U!==0;){if(o=t.input.charCodeAt(t.position+1),n=t.line,c=t.position,(U===63||U===58)&&ja(o))U===63?(y&&(_C(t,p,I,B,Q,null),B=Q=x=null),T=!0,y=!0,a=!0):y?(y=!1,a=!0):Mr(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,U=o;else if(KC(t,r,hW,!1,!0))if(t.line===n){for(U=t.input.charCodeAt(t.position);I0(U);)U=t.input.charCodeAt(++t.position);if(U===58)U=t.input.charCodeAt(++t.position),ja(U)||Mr(t,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(_C(t,p,I,B,Q,null),B=Q=x=null),T=!0,y=!1,a=!1,B=t.tag,Q=t.result;else if(T)Mr(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=f,t.anchor=g,!0}else if(T)Mr(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=f,t.anchor=g,!0;else break;if((t.line===n||t.lineIndent>e)&&(KC(t,e,Qv,!0,a)&&(y?Q=t.result:x=t.result),y||(_C(t,p,I,B,Q,x,n,c),B=Q=x=null),ps(t,!0,-1),U=t.input.charCodeAt(t.position)),t.lineIndent>e&&U!==0)Mr(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return y&&_C(t,p,I,B,Q,null),T&&(t.tag=f,t.anchor=g,t.kind="mapping",t.result=p),T}function tHe(t){var e,r=!1,o=!1,a,n,c;if(c=t.input.charCodeAt(t.position),c!==33)return!1;if(t.tag!==null&&Mr(t,"duplication of a tag property"),c=t.input.charCodeAt(++t.position),c===60?(r=!0,c=t.input.charCodeAt(++t.position)):c===33?(o=!0,a="!!",c=t.input.charCodeAt(++t.position)):a="!",e=t.position,r){do c=t.input.charCodeAt(++t.position);while(c!==0&&c!==62);t.position<t.length?(n=t.input.slice(e,t.position),c=t.input.charCodeAt(++t.position)):Mr(t,"unexpected end of the stream within a verbatim tag")}else{for(;c!==0&&!ja(c);)c===33&&(o?Mr(t,"tag suffix cannot contain exclamation marks"):(a=t.input.slice(e-1,t.position+1),mW.test(a)||Mr(t,"named tag handle cannot contain such characters"),o=!0,e=t.position+1)),c=t.input.charCodeAt(++t.position);n=t.input.slice(e,t.position),qKe.test(n)&&Mr(t,"tag suffix cannot contain flow indicator characters")}return n&&!CW.test(n)&&Mr(t,"tag name cannot contain such characters: "+n),r?t.tag=n:dp.call(t.tagMap,a)?t.tag=t.tagMap[a]+n:a==="!"?t.tag="!"+n:a==="!!"?t.tag="tag:yaml.org,2002:"+n:Mr(t,'undeclared tag handle "'+a+'"'),!0}function rHe(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&Mr(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!ja(r)&&!UC(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&Mr(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function nHe(t){var e,r,o;if(o=t.input.charCodeAt(t.position),o!==42)return!1;for(o=t.input.charCodeAt(++t.position),e=t.position;o!==0&&!ja(o)&&!UC(o);)o=t.input.charCodeAt(++t.position);return t.position===e&&Mr(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),dp.call(t.anchorMap,r)||Mr(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],ps(t,!0,-1),!0}function KC(t,e,r,o,a){var n,c,f,g=1,p=!1,I=!1,B,Q,x,y,T;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,n
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new JKe(t,e),o=t.indexOf("\0");for(o!==-1&&(r.position=o,Mr(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)iHe(r);return r.documents}function BW(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);var o=wW(t,r);if(typeof e!="function")return o;for(var a=0,n=o.length;a<n;a+=1)e(o[a])}function QW(t,e){var r=wW(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new gW("expected a single document in the stream, but found more")}}function sHe(t,e,r){return typeof e=="object"&&e!==null&&typeof r>"u"&&(r=e,e=null),BW(t,e,Uf.extend({schema:pW},r))}function oHe(t,e){return QW(t,Uf.extend({schema:pW},e))}aw.exports.loadAll=BW;aw.exports.load=QW;aw.exports.safeLoadAll=sHe;aw.exports.safeLoad=oHe});var JW=K((_kt,KT)=>{"use strict";var lw=d0(),cw=NC(),aHe=ow(),AHe=OC(),RW=Object.prototype.toString,TW=Object.prototype.hasOwnProperty,lHe=9,Aw=10,cHe=13,uHe=32,fHe=33,gHe=34,MW=35,pHe=37,hHe=38,dHe=39,mHe=42,NW=44,CHe=45,LW=58,yHe=61,IHe=62,EHe=63,wHe=64,OW=91,UW=93,BHe=96,_W=123,QHe=124,KW=125,Ho={};Ho[0]="\\0";Ho[7]="\\a";Ho[8]="\\b";Ho[9]="\\t";Ho[10]="\\n";Ho[11]="\\v";Ho[12]="\\f";Ho[13]="\\r";Ho[27]="\\e";Ho[34]='\\"';Ho[92]="\\\\";Ho[133]="\\N";Ho[160]="\\_";Ho[8232]="\\L";Ho[8233]="\\P";var vHe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function DHe(t,e){var r,o,a,n,c,f,g;if(e===null)return{};for(r={},o=Object.keys(e),a=0,n=o.length;a<n;a+=1)c=o[a],f=String(e[c]),c.slice(0,2)==="!!"&&(c="tag:yaml.org,2002:"+c.slice(2)),g=t.compiledTypeMap.fallback[c],g&&TW.call(g.styleAliases,f)&&(f=g.styleAliases[f]),r[c]=f;return r}function DW(t){var e,r,o;if(e=t.toString(16).toUpperCase(),t<=255)r="x",o=2;else if(t<=65535)r="u",o=4;else if(t<=4294967295)r="U",o=8;else throw new cw("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+lw.repeat("0",o-e.length)+e}function SHe(t){this.schema=t.schema||aHe,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=lw.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=DHe(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function SW(t,e){for(var r=lw.repeat(" ",e),o=0,a=-1,n="",c,f=t.length;o<f;)a=t.indexOf(`
`,o),a===-1?(c=t.slice(o),o=f):(c=t.slice(o,a+1),o=a+1),c.length&&c!==`
`&&(n+=r),n+=c;return n}function OT(t,e){return`
`+lw.repeat(" ",t.indent*e)}function kHe(t,e){var r,o,a;for(r=0,o=t.implicitTypes.length;r<o;r+=1)if(a=t.implicitTypes[r],a.resolve(e))return!0;return!1}function _T(t){return t===uHe||t===lHe}function HC(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==65279||65536<=t&&t<=1114111}function xHe(t){return HC(t)&&!_T(t)&&t!==65279&&t!==cHe&&t!==Aw}function kW(t,e){return HC(t)&&t!==65279&&t!==NW&&t!==OW&&t!==UW&&t!==_W&&t!==KW&&t!==LW&&(t!==MW||e&&xHe(e))}function PHe(t){return HC(t)&&t!==65279&&!_T(t)&&t!==CHe&&t!==EHe&&t!==LW&&t!==NW&&t!==OW&&t!==UW&&t!==_W&&t!==KW&&t!==MW&&t!==hHe&&t!==mHe&&t!==fHe&&t!==QHe&&t!==yHe&&t!==IHe&&t!==dHe&&t!==gHe&&t!==pHe&&t!==wHe&&t!==BHe}function HW(t){var e=/^\n* /;return e.test(t)}var qW=1,GW=2,jW=3,YW=4,Sv=5;function bHe(t,e,r,o,a){var n,c,f,g=!1,p=!1,I=o!==-1,B=-1,Q=PHe(t.charCodeAt(0))&&!_T(t.charCodeAt(t.length-1));if(e)for(n=0;n<t.length;n++){if(c=t.charCodeAt(n),!HC(c))return Sv;f=n>0?t.charCodeAt(n-1):null,Q=Q&&kW(c,f)}else{for(n=0;n<t.length;n++){if(c=t.charCodeAt(n),c===Aw)g=!0,I&&(p=p||n-B-1>o&&t[B+1]!==" ",B=n);else if(!HC(c))return Sv;f=n>0?t.charCodeAt(n-1):null,Q=Q&&kW(c,f)}p=p||I&&n-B-1>o&&t[B+1]!==" "}return!g&&!p?Q&&!a(t)?qW:GW:r>9&&HW(t)?Sv:p?YW:jW}function FHe(t,e,r,o){t.dump=function(){if(e.length===0)return"''";if(!t.noCompatMode&&vHe.indexOf(e)!==-1)return"'"+e+"'";var a=t.indent*Math.max(1,r),n=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),c=o||t.flowLevel>-1&&r>=t.flowLevel;function f(g){return kHe(t,g)}switch(bHe(e,c,t.indent,n,f)){case qW:return e;case GW:return"'"+e.replace(/'/g,"''")+"'";case jW:return"|"+xW(e,t.indent)+PW(SW(e,a));case YW:return">"+xW(e,t.indent)+PW(SW(RHe(e,n),a));case Sv:return'"'+THe(e,n)+'"';default:throw new cw("impossible error: invalid scalar style")}}()}function xW(t,e){var r=HW(t)?String(e):"",o=t[t.length-1]===`
`,a=o&&(t[t.length-2]===`
2022-08-27 06:35:11 +00:00
`||t===`
2022-09-06 17:07:18 +00:00
`),n=a?"+":o?"":"-";return r+n+`
`}function PW(t){return t[t.length-1]===`
`?t.slice(0,-1):t}function RHe(t,e){for(var r=/(\n+)([^\n]*)/g,o=function(){var p=t.indexOf(`
`);return p=p!==-1?p:t.length,r.lastIndex=p,bW(t.slice(0,p),e)}(),a=t[0]===`
`||t[0]===" ",n,c;c=r.exec(t);){var f=c[1],g=c[2];n=g[0]===" ",o+=f+(!a&&!n&&g!==""?`
`:"")+bW(g,e),a=n}return o}function bW(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,o,a=0,n,c=0,f=0,g="";o=r.exec(t);)f=o.index,f-a>e&&(n=c>a?c:f,g+=`
`+t.slice(a,n),a=n+1),c=f;return g+=`
`,t.length-a>e&&c>a?g+=t.slice(a,c)+`
`+t.slice(c+1):g+=t.slice(a),g.slice(1)}function THe(t){for(var e="",r,o,a,n=0;n<t.length;n++){if(r=t.charCodeAt(n),r>=55296&&r<=56319&&(o=t.charCodeAt(n+1),o>=56320&&o<=57343)){e+=DW((r-55296)*1024+o-56320+65536),n++;continue}a=Ho[r],e+=!a&&HC(r)?t[n]:a||DW(r)}return e}function MHe(t,e,r){var o="",a=t.tag,n,c;for(n=0,c=r.length;n<c;n+=1)E0(t,e,r[n],!1,!1)&&(n!==0&&(o+=","+(t.condenseFlow?"":" ")),o+=t.dump);t.tag=a,t.dump="["+o+"]"}function NHe(t,e,r,o){var a="",n=t.tag,c,f;for(c=0,f=r.length;c<f;c+=1)E0(t,e+1,r[c],!0,!0)&&((!o||c!==0)&&(a+=OT(t,e)),t.dump&&Aw===t.dump.charCodeAt(0)?a+="-":a+="- ",a+=t.dump);t.tag=n,t.dump=a||"[]"}function LHe(t,e,r){var o="",a=t.tag,n=Object.keys(r),c,f,g,p,I;for(c=0,f=n.length;c<f;c+=1)I="",c!==0&&(I+=", "),t.condenseFlow&&(I+='"'),g=n[c],p=r[g],E0(t,e,g,!1,!1)&&(t.dump.length>1024&&(I+="? "),I+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),E0(t,e,p,!1,!1)&&(I+=t.dump,o+=I));t.tag=a,t.dump="{"+o+"}"}function OHe(t,e,r,o){var a="",n=t.tag,c=Object.keys(r),f,g,p,I,B,Q;if(t.sortKeys===!0)c.sort();else if(typeof t.sortKeys=="function")c.sort(t.sortKeys);else if(t.sortKeys)throw new cw("sortKeys must be a boolean or a function");for(f=0,g=c.length;f<g;f+=1)Q="",(!o||f!==0)&&(Q+=OT(t,e)),p=c[f],I=r[p],E0(t,e+1,p,!0,!0,!0)&&(B=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,B&&(t.dump&&Aw===t.dump.charCodeAt(0)?Q+="?":Q+="? "),Q+=t.dump,B&&(Q+=OT(t,e)),E0(t,e+1,I,!0,B)&&(t.dump&&Aw===t.dump.charCodeAt(0)?Q+=":":Q+=": ",Q+=t.dump,a+=Q));t.tag=n,t.dump=a||"{}"}function FW(t,e,r){var o,a,n,c,f,g;for(a=r?t.explicitTypes:t.implicitTypes,n=0,c=a.length;n<c;n+=1)if(f=a[n],(f.instanceOf||f.predicate)&&(!f.instanceOf||typeof e=="object"&&e instanceof f.instanceOf)&&(!f.predicate||f.predicate(e))){if(t.tag=r?f.tag:"?",f.represent){if(g=t.styleMap[f.tag]||f.defaultStyle,RW.call(f.represent)==="[object Function]")o=f.represent(e,g);else if(TW.call(f.represent,g))o=f.represent[g](e,g);else throw new cw("!<"+f.tag+'> tag resolver accepts not "'+g+'" style');t.dump=o}return!0}return!1}function E0(t,e,r,o,a,n){t.tag=null,t.dump=r,FW(t,r,!1)||FW(t,r,!0);var c=RW.call(t.dump);o&&(o=t.flowLevel<0||t.flowLevel>e);var f=c==="[object Object]"||c==="[object Array]",g,p;if(f&&(g=t.duplicates.indexOf(r),p=g!==-1),(t.tag!==null&&t.tag!=="?"||p||t.indent!==2&&e>0)&&(a=!1),p&&t.usedDuplicates[g])t.dump="*ref_"+g;else{if(f&&p&&!t.usedDuplicates[g]&&(t.usedDuplicates[g]=!0),c==="[object Object]")o&&Object.keys(t.dump).length!==0?(OHe(t,e,t.dump,a),p&&(t.dump="&ref_"+g+t.dump)):(LHe(t,e,t.dump),p&&(t.dump="&ref_"+g+" "+t.dump));else if(c==="[object Array]"){var I=t.noArrayIndent&&e>0?e-1:e;o&&t.dump.length!==0?(NHe(t,I,t.dump,a),p&&(t.dump="&ref_"+g+t.dump)):(MHe(t,I,t.dump),p&&(t.dump="&ref_"+g+" "+t.dump))}else if(c==="[object String]")t.tag!=="?"&&FHe(t,t.dump,e,n);else{if(t.skipInvalid)return!1;throw new cw("unacceptable kind of an object to dump "+c)}t.tag!==null&&t.tag!=="?"&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function UHe(t,e){var r=[],o=[],a,n;for(UT(t,r,o),a=0,n=o.length;a<n;a+=1)e.duplicates.push(r[o[a]]);e.usedDuplicates=new Array(n)}function UT(t,e,r){var o,a,n;if(t!==null&&typeof t=="object")if(a=e.indexOf(t),a!==-1)r.indexOf(a)===-1&&r.push(a);else if(e.push(t),Array.isArray(t))for(a=0,n=t.length;a<n;a+=1)UT(t[a],e,r);else for(o=Object.keys(t),a=0,n=o.length;a<n;a+=1)UT(t[o[a]],e,r)}function WW(t,e){e=e||{};var r=new SHe(e);return r.noRefs||UHe(t,r),E0(r,0,t,!0,!0)?r.dump+`
`:""}function _He(t,e){return WW(t,lw.extend({schema:AHe},e))}KT.exports.dump=WW;KT.exports.safeDump=_He});var VW=K((Kkt,ji)=>{"use strict";var kv=vW(),zW=JW();function xv(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}ji.exports.Type=Fs();ji.exports.Schema=m0();ji.exports.FAILSAFE_SCHEMA=Ev();ji.exports.JSON_SCHEMA=FT();ji.exports.CORE_SCHEMA=RT();ji.exports.DEFAULT_SAFE_SCHEMA=OC();ji.exports.DEFAULT_FULL_SCHEMA=ow();ji.exports.load=kv.load;ji.exports.loadAll=kv.loadAll;ji.exports.safeLoad=kv.safeLoad;ji.exports.safeLoadAll=kv.safeLoadAll;ji.exports.dump=zW.dump;ji.exports.safeDump=zW.safeDump;ji.exports.YAMLException=NC();ji.exports.MINIMAL_SCHEMA=Ev();ji.exports.SAFE_SCHEMA=OC();ji.exports.DEFAULT_SCHEMA=ow();ji.exports.scan=xv("scan");ji.exports.parse=xv("parse");ji.exports.compose=xv("compose");ji.exports.addConstructor=xv("addConstructor")});var ZW=K((Hkt,XW)=>{"use strict";var KHe=VW();XW.exports=KHe});var eJ=K((qkt,$W)=>{"use strict";function HHe(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function w0(t,e,r,o){this.message=t,this.expected=e,this.found=r,this.location=o,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,w0)}HHe(w0,Error);w0.buildMessage=function(t,e){var r={literal:function(p){return'"'+a(p.text)+'"'},class:function(p){var I="",B;for(B=0;B<p.parts.length;B++)I+=p.parts[B]instanceof Array?n(p.parts[B][0])+"-"+n(p.parts[B][1]):n(p.parts[B]);return"["+(p.inverted?"^":"")+I+"]"},any:function(p){return"any character"},end:function(p){return"end of input"},other:function(p){return p.description}};function o(p){return p.charCodeAt(0).toString(16).toUpperCase()}function a(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(I){return"\\x0"+o(I)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(I){return"\\x"+o(I)})}function n(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(I){return"\\x0"+o(I)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(I){return"\\x"+o(I)})}function c(p){return r[p.type](p)}function f(p){var I=new Array(p.length),B,Q;for(B=0;B<p.length;B++)I[B]=c(p[B]);if(I.sort(),I.length>0){for(B=1,Q=1;B<I.length;B++)I[B-1]!==I[B]&&(I[Q]=I[B],Q++);I.length=Q}switch(I.length){case 1:return I[0];case 2:return I[0]+" or "+I[1];default:return I.slice(0,-1).join(", ")+", or "+I[I.length-1]}}function g(p){return p?'"'+a(p)+'"':"end of input"}return"Expected "+f(t)+" but "+g(e)+" found."};function qHe(t,e){e=e!==void 0?e:{};var r={},o={Start:Kl},a=Kl,n=function(oe){return[].concat(...oe)},c="-",f=Nn("-",!1),g=function(oe){return oe},p=function(oe){return Object.assign({},...oe)},I="#",B=Nn("#",!1),Q=GA(),x=function(){return{}},y=":",T=Nn(":",!1),U=function(oe,ve){return{[oe]:ve}},q=",",X=Nn(",",!1),se=function(oe,ve){return ve},fe=function(oe,ve,qe){return Object.assign({},...[oe].concat(ve).map(kt=>({[kt]:qe})))},me=function(oe){return oe},Qe=function(oe){return oe},be=ea("correct indentation"),Ee=" ",ye=Nn(" ",!1),De=function(oe){return oe.length===cA*jA},h=function(oe){return oe.length===(cA+1)*jA},Oe=function(){return cA++,!0},Ie=function(){return cA--,!0},Ce=function(){return Lc()},ue=ea("pseudostring"),re=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,Se=di(["\r",`
`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),Le=/^[^\r\n\t ,\][{}:#"']/,dt=di(["\r",`
`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),H=function(){return Lc().replace(/^ *| *$/g,"")},_e="--",tt=Nn("--",!1),Ze=/^[a-zA-Z\/0-9]/,xe=di([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),Ct=/^[^\r\n\t :,]/,We=di(["\r",`
`," "," ",":",","],!0,!1),at="null",ze=Nn("null",!1),k=function(){return null},E="true",S=Nn("true",!1),C=function(){return!0},R="false",Z=Nn("false",!1),te=function(){return!1},ne=ea("string"),Ae='"',Fe=Nn('"',!1),Ue=function(){return""},gt=function(oe){return oe},It=function(oe){return oe.join("")},Ht=/^[^"\\\0-\x1F\x7F]/,or=di(['"',"\\",["\0",""],"\x7F"],!0,!1),Rt='\\"',dn=Nn('\\"',!1),Lr=function(){return'"'},br="\\\\",Or=Nn("\\\\",!1),un=function(){return"\\"},Qn="\\/",ws=Nn("\\/",!1),_i=function(){return"/"},wo="\\b",Bo=Nn("\\b",!1),cs=function(){return"\b"},fn="\\f",$s=Nn("\\f",!1),_A=function(){return"\f"},va="\\n",bg=Nn("\\n",!1),Fg=function(){return`
`},Zu="\\r",Gn=Nn("\\r",!1),Ki=function(){return"\r"},Da="\\t",KA=Nn("\\t",!1),Je=function(){return" "},jn="\\u",ni=Nn("\\u",!1),Xt=function(oe,ve,qe,kt){return String.fromCharCode(parseInt(`0x${oe}${ve}${qe}${kt}`))},Ri=/^[0-9a-fA-F]/,Yn=di([["0","9"],["a","f"],["A","F"]],!1,!1),us=ea("blank space"),Dt=/^[ \t]/,Vi=di([" "," "],!1,!1),xn=ea("white space"),fs=/^[ \t\n\r]/,oA=di([" "," ",`
`,"\r"],!1,!1),Sr=`\r
`,Qo=Nn(`\r
`,!1),fr=`
`,Sa=Nn(`
`,!1),$="\r",tn=Nn("\r",!1),we=0,Lt=0,HA=[{line:1,column:1}],Xi=0,_l=[],jt=0,aA;if("startRule"in e){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=o[e.startRule]}function Lc(){return t.substring(Lt,we)}function $u(){return vo(Lt,we)}function qA(oe,ve){throw ve=ve!==void 0?ve:vo(Lt,we),ka([ea(oe)],t.substring(Lt,we),ve)}function Oc(oe,ve){throw ve=ve!==void 0?ve:vo(Lt,we),eo(oe,ve)}function Nn(oe,ve){return{type:"literal",text:oe,ignoreCase:ve}}function di(oe,ve,qe){return{type:"class",parts:oe,inverted:ve,ignoreCase:qe}}function GA(){return{type:"any"}}function Uc(){return{type:"end"}}function ea(oe){return{type:"other",description:oe}}function Zi(oe){var ve=HA[oe],qe;if(ve)return ve;for(qe=oe-1;!HA[qe];)qe--;for(ve=HA[qe],ve={line:ve.line,column:ve.column};qe<oe;)t.charCodeAt(qe)===10?(ve.line++,ve.column=1):ve.column++,qe++;return HA[oe]=ve,ve}function vo(oe,ve){var qe=Zi(oe),kt=Zi(ve);return{start:{offset:oe,line:qe.line,column:qe.column},end:{offset:ve,line:kt.line,column:kt.column}}}function it(oe){we<Xi||(we>Xi&&(Xi=we,_l=[]),_l.push(oe))}function eo(oe,ve){return new w0(oe,null,null,ve)}function ka(oe,ve,qe){return new w0(w0.buildMessage(oe,ve),oe,ve,qe)}function Kl(){var oe;return oe=AA(),oe}function Hi(){var oe,ve,qe;for(oe=we,ve=[],qe=xa();qe!==r;)ve.push(qe),qe=xa();return ve!==r&&(Lt=oe,ve=n(ve)),oe=ve,oe}function xa(){var oe,ve,qe,kt,Et;return oe=we,ve=Bs(),ve!==r?(t.charCodeAt(we)===45?(qe=c,we++):(qe=r,jt===0&&it(f)),qe!==r?(kt=ii(),kt!==r?(Et=lA(),Et!==r?(Lt=oe,ve=g(Et),oe=ve):(we=oe,oe=r)):(we=oe,oe=r)):(we=oe,oe=r)):(we=oe,oe=r),oe}function AA(){var oe,ve,qe;for(oe=we,ve=[],qe=Dr();qe!==r;)ve.push(qe),qe=Dr();return ve!==r&&(Lt=oe,ve=p(ve)),oe=ve,oe}function Dr(){var oe,ve,qe,kt,Et,Yt,Fr,wn,Pa;if(oe=we,ve=ii(),ve===r&&(ve=null),ve!==r){if(qe=we,t.charCodeAt(we)===35?(kt=I,we++):(kt=r,jt===0&&it(B)),kt!==r){if(Et=[],Yt=we,Fr=we,jt++,wn=qi(),jt--,wn===r?Fr=void 0:(we=Fr,Fr=r),Fr!==r?(t.length>we?(wn=t.charAt(we),we++):(wn=r,jt===0&&it(Q)),wn!==r?(Fr=[Fr,wn],Yt=Fr):(we=Yt,Yt=r)):(we=Yt,Yt=r),Yt!==r)for(;Yt!==r;)Et.push(Yt),Yt=we,Fr=we,jt++,wn=qi(),jt--,wn===r?Fr=void 0:(we=Fr,Fr=r),Fr!==r?(t.length>we?(wn=t.charAt(we),we++):(wn=r,jt===0&&it(Q)),wn!==r?(Fr=[Fr,wn],Yt=Fr):(we=Yt,Yt=r)):(we=Yt,Yt=r);else Et=r;Et!==r?(kt=[kt,Et],qe=kt):(we=qe,qe=r)}else we=qe,qe=r;if(qe===r&&(qe=null),qe!==r){if(kt=[],Et=Os(),Et!==r)for(;Et!==r;)kt.push(Et),Et=Os();else kt=r;kt!==r?(Lt=oe,ve=x(),oe=ve):(we=oe,oe=r)}else we=oe,oe=r}else we=oe,oe=r;if(oe===r&&(oe=we,ve=Bs(),ve!==r?(qe=ta(),qe!==r?(kt=ii(),kt===r&&(kt=null),kt!==r?(t.charCodeAt(we)===58?(Et=y,we++):(Et=r,jt===0&&it(T)),Et!==r?(Yt=ii(),Yt===r&&(Yt=null),Yt!==r?(Fr=lA(),Fr!==r?(Lt=oe,ve=U(qe,Fr),oe=ve):(we=oe,oe=r)):(we=oe,oe=r)):(we=oe,oe=r)):(we=oe,oe=r)):(we=oe,oe=r)):(we=oe,oe=r),oe===r&&(oe=we,ve=Bs(),ve!==r?(qe=to(),qe!==r?(kt=ii(),kt===r&&(kt=null),kt!==r?(t.charCodeAt(we)===58?(Et=y,we++):(Et=r,jt===0&&it(T)),Et!==r?(Yt=ii(),Yt===r&&(Yt=null),Yt!==r?(Fr=lA(),Fr!==r?(Lt=oe,ve=U(qe,Fr),oe=ve):(we=oe,oe=r)):(we=oe,oe=r)):(we=oe,oe=r)):(we=oe,oe=r)):(we=oe,oe=r)):(we=oe,oe=r),oe===r))){if(oe=we,ve=Bs(),ve!==r)if(qe=to(),qe!==r)if(kt=ii(),kt!==r)if(Et=ra(),Et!==r){if(Yt=[],Fr=Os(),Fr!==r)for(;Fr!==r;)Yt.push(Fr),Fr=Os();else Yt=r;Yt!==r?(Lt=oe,ve=U(qe,Et),oe=ve):(we=oe,oe=r)}else we=oe,oe=r;else we=oe,oe=r;else we=oe,oe=r;else we=oe,oe=r;if(oe===r)if(oe=we,ve=Bs(),ve!==r)if(qe=to(),qe!==r){if(kt=[],Et=we,Yt=ii(),Yt===r&&(Yt=null),Yt!==r?(t.charCodeAt(we)===44?(Fr=q,we++):(Fr=r,jt===0&&it(X)),Fr!==r?(wn=ii(),wn===r&&(wn=null),wn!==r?(Pa=to(),Pa!==r?(Lt=Et,Yt=se(qe,Pa),Et=Yt):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r),Et!==r)for(;Et!==r;)kt.push(Et),Et=we,Yt=ii(),Yt===r&&(Yt=null),Yt!==r?(t.charCodeAt(we)===44?(Fr=q,we++):(Fr=r,jt===0&&it(X)),Fr!==r?(wn=ii(),wn===r&&(wn=null),wn!==r?(Pa=to(),Pa!==r?(Lt=Et,Yt=se(qe,Pa),Et=Yt):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r);else kt=r;kt!==r?(Et=ii(),Et===r&&(Et=null),Et!==r?(t.charCodeAt(we)===58?(Yt=y,we++):(Yt=r,jt===0&&it(T)),Yt!==r?(Fr=ii(),Fr===r
2022-08-27 06:35:11 +00:00
`;if(typeof t=="number"||typeof t=="boolean")return`${t.toString()}
2022-09-06 17:07:18 +00:00
`;if(typeof t=="string")return`${rJ(t)}
2022-08-27 06:35:11 +00:00
`;if(Array.isArray(t)){if(t.length===0)return`[]
2022-09-06 17:07:18 +00:00
`;let o=" ".repeat(e);return`
${t.map(n=>`${o}- ${HT(n,e+1,!1)}`).join("")}`}if(typeof t=="object"&&t){let[o,a]=t instanceof Pv?[t.data,!1]:[t,!0],n=" ".repeat(e),c=Object.keys(o);a&&c.sort((g,p)=>{let I=tJ.indexOf(g),B=tJ.indexOf(p);return I===-1&&B===-1?g<p?-1:g>p?1:0:I!==-1&&B===-1?-1:I===-1&&B!==-1?1:I-B});let f=c.filter(g=>!iJ(o[g])).map((g,p)=>{let I=o[g],B=rJ(g),Q=HT(I,e+1,!0),x=p>0||r?n:"",y=B.length>1024?`? ${B}
${x}:`:`${B}:`,T=Q.startsWith(`
`)?Q:` ${Q}`;return`${x}${y}${T}`}).join(e===0?`
2022-08-27 06:35:11 +00:00
`:"")||`
`;return r?`
2022-09-06 17:07:18 +00:00
${f}`:`${f}`}throw new Error(`Unsupported value type (${t})`)}function Ya(t){try{let e=HT(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}}function jHe(t){return t.endsWith(`
2022-08-27 06:35:11 +00:00
`)||(t+=`
2022-09-06 17:07:18 +00:00
`),(0,nJ.parse)(t)}function WHe(t){if(YHe.test(t))return jHe(t);let e=(0,bv.safeLoad)(t,{schema:bv.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 os(t){return WHe(t)}var bv,nJ,GHe,tJ,Pv,YHe,sJ=Ot(()=>{bv=Te(ZW()),nJ=Te(eJ()),GHe=/^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/,tJ=["__metadata","version","resolution","dependencies","peerDependencies","dependenciesMeta","peerDependenciesMeta","binaries"],Pv=class{constructor(e){this.data=e}};Ya.PreserveOrdering=Pv;YHe=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i});var uw={};sr(uw,{parseResolution:()=>Cv,parseShell:()=>hv,parseSyml:()=>os,stringifyArgument:()=>kT,stringifyArgumentSegment:()=>xT,stringifyArithmeticExpression:()=>mv,stringifyCommand:()=>ST,stringifyCommandChain:()=>MC,stringifyCommandChainThen:()=>DT,stringifyCommandLine:()=>dv,stringifyCommandLineThen:()=>vT,stringifyEnvSegment:()=>pv,stringifyRedirectArgument:()=>iw,stringifyResolution:()=>yv,stringifyShell:()=>TC,stringifyShellLine:()=>TC,stringifySyml:()=>Ya,stringifyValueArgument:()=>g0});var ll=Ot(()=>{i7();A7();sJ()});var aJ=K((Jkt,qT)=>{"use strict";var JHe=t=>{let e=!1,r=!1,o=!1;for(let a=0;a<t.length;a++){let n=t[a];e&&/[a-zA-Z]/.test(n)&&n.toUpperCase()===n?(t=t.slice(0,a)+"-"+t.slice(a),e=!1,o=r,r=!0,a++):r&&o&&/[a-zA-Z]/.test(n)&&n.toLowerCase()===n?(t=t.slice(0,a-1)+"-"+t.slice(a-1),o=r,r=!1,e=!0):(e=n.toLowerCase()===n&&n.toUpperCase()!==n,o=r,r=n.toUpperCase()===n&&n.toLowerCase()!==n)}return t},oJ=(t,e)=>{if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");e=Object.assign({pascalCase:!1},e);let r=a=>e.pascalCase?a.charAt(0).toUpperCase()+a.slice(1):a;return Array.isArray(t)?t=t.map(a=>a.trim()).filter(a=>a.length).join("-"):t=t.trim(),t.length===0?"":t.length===1?e.pascalCase?t.toUpperCase():t.toLowerCase():(t!==t.toLowerCase()&&(t=JHe(t)),t=t.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(a,n)=>n.toUpperCase()).replace(/\d+(\w|$)/g,a=>a.toUpperCase()),r(t))};qT.exports=oJ;qT.exports.default=oJ});var AJ=K((zkt,zHe)=>{zHe.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",e
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
${this.candidates.map(({usage:a})=>`$ ${a}`).join(`
`)}`}else if(this.candidates.length===1){let[{usage:o}]=this.candidates;this.message=`Command not found; did you mean:
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
$ ${o}
${WT(e)}`}else this.message=`Command not found; did you mean one of:
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
${this.candidates.map(({usage:o},a)=>`${`${a}.`.padStart(4)} ${o}`).join(`
2022-08-27 06:35:11 +00:00
`)}
2022-09-06 17:07:18 +00:00
${WT(e)}`}},YT=class extends Error{constructor(e,r){super(),this.input=e,this.usages=r,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find which to pick amongst the following alternatives:
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
${this.usages.map((o,a)=>`${`${a}.`.padStart(4)} ${o}`).join(`
2022-08-27 06:35:11 +00:00
`)}
2022-09-06 17:07:18 +00:00
${WT(e)}`}},WT=t=>`While running ${t.filter(e=>e!==aqe.END_OF_INPUT).map(e=>{let r=JSON.stringify(e);return e.match(/\s/)||e.length===0||r!==`"${e}"`?r:e}).join(" ")}`;fw.AmbiguousSyntaxError=YT;fw.UnknownSyntaxError=jT;fw.UsageError=GT});var zT=K(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});var uJ=80,JT=Array(uJ).fill("\u2501");for(let t=0;t<=24;++t)JT[JT.length-t]=`\x1B[38;5;${232+t}m\u2501`;var Aqe={header:t=>`\x1B[1m\u2501\u2501\u2501 ${t}${t.length<uJ-5?` ${JT.slice(t.length+5).join("")}`:":"}\x1B[0m`,bold:t=>`\x1B[1m${t}\x1B[22m`,error:t=>`\x1B[31m\x1B[1m${t}\x1B[22m\x1B[39m`,code:t=>`\x1B[36m${t}\x1B[39m`},lqe={header:t=>t,bold:t=>t,error:t=>t,code:t=>t};function cqe(t){let e=t.split(`
`),r=e.filter(a=>a.match(/\S/)),o=r.length>0?r.reduce((a,n)=>Math.min(a,n.length-n.trimStart().length),Number.MAX_VALUE):0;return e.map(a=>a.slice(o).trimRight()).join(`
`)}function uqe(t,{format:e,paragraphs:r}){return t=t.replace(/\r\n?/g,`
`),t=cqe(t),t=t.replace(/^\n+|\n+$/g,""),t=t.replace(/^(\s*)-([^\n]*?)\n+/gm,`$1-$2
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
`),t=t.replace(/\n(\n)?\n*/g,(o,a)=>a||" "),r&&(t=t.split(/\n/).map(o=>{let a=o.match(/^\s*[*-][\t ]+(.*)/);if(!a)return o.match(/(.{1,80})(?: |$)/g).join(`
`);let n=o.length-o.trimStart().length;return a[1].match(new RegExp(`(.{1,${78-n}})(?: |$)`,"g")).map((c,f)=>" ".repeat(n)+(f===0?"- ":" ")+c).join(`
2022-08-27 06:35:11 +00:00
`)}).join(`
2022-09-06 17:07:18 +00:00
`)),t=t.replace(/(`+)((?:.|[\n])*?)\1/g,(o,a,n)=>e.code(a+n+a)),t=t.replace(/(\*\*)((?:.|[\n])*?)\1/g,(o,a,n)=>e.bold(a+n+a)),t?`${t}
`:""}gw.formatMarkdownish=uqe;gw.richFormat=Aqe;gw.textFormat=lqe});var _f=K(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});var fJ=Rv(),gJ=Symbol("clipanion/isOption");function fqe(t){return{...t,[gJ]:!0}}function gqe(t,e){return typeof t>"u"?[t,e]:typeof t=="object"&&t!==null&&!Array.isArray(t)?[void 0,t]:[t,e]}function VT(t,e=!1){let r=t.replace(/^\.: /,"");return e&&(r=r[0].toLowerCase()+r.slice(1)),r}function pJ(t,e){return e.length===1?new fJ.UsageError(`${t}: ${VT(e[0],!0)}`):new fJ.UsageError(`${t}:
2022-08-27 06:35:11 +00:00
${e.map(r=>`
2022-09-06 17:07:18 +00:00
- ${VT(r)}`).join("")}`)}function pqe(t,e,r){if(typeof r>"u")return e;let o=[],a=[],n=f=>{let g=e;return e=f,n.bind(null,g)};if(!r(e,{errors:o,coercions:a,coercion:n}))throw pJ(`Invalid value for ${t}`,o);for(let[,f]of a)f();return e}mp.applyValidator=pqe;mp.cleanValidationError=VT;mp.formatError=pJ;mp.isOptionSymbol=gJ;mp.makeCommandOption=fqe;mp.rerouteArguments=gqe});var QA=K(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});var hJ=/^[a-zA-Z_][a-zA-Z0-9_]*$/,dJ=/^#[0-9a-f]{6}$/i,mJ=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,CJ=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,yJ=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,XT=/^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/,IJ=t=>()=>t;function sn({test:t}){return IJ(t)()}function hs(t){return t===null?"null":t===void 0?"undefined":t===""?"an empty string":JSON.stringify(t)}function Cp(t,e){var r,o,a;return typeof e=="number"?`${(r=t==null?void 0:t.p)!==null&&r!==void 0?r:"."}[${e}]`:hJ.test(e)?`${(o=t==null?void 0:t.p)!==null&&o!==void 0?o:""}.${e}`:`${(a=t==null?void 0:t.p)!==null&&a!==void 0?a:"."}[${JSON.stringify(e)}]`}function Q0(t,e){return r=>{let o=t[e];return t[e]=r,Q0(t,e).bind(null,o)}}function EJ(t,e){return r=>{t[e]=r}}function Tv(t,e,r){return t===1?e:r}function Kr({errors:t,p:e}={},r){return t==null||t.push(`${e??"."}: ${r}`),!1}var wJ=()=>sn({test:(t,e)=>!0});function hqe(t){return sn({test:(e,r)=>e!==t?Kr(r,`Expected a literal (got ${hs(t)})`):!0})}var dqe=()=>sn({test:(t,e)=>typeof t!="string"?Kr(e,`Expected a string (got ${hs(t)})`):!0});function mqe(t){let e=Array.isArray(t)?t:Object.values(t),r=new Set(e);return sn({test:(o,a)=>r.has(o)?!0:Kr(a,`Expected a valid enumeration value (got ${hs(o)})`)})}var Cqe=new Map([["true",!0],["True",!0],["1",!0],[1,!0],["false",!1],["False",!1],["0",!1],[0,!1]]),yqe=()=>sn({test:(t,e)=>{var r;if(typeof t!="boolean"){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return Kr(e,"Unbound coercion result");let o=Cqe.get(t);if(typeof o<"u")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:".",e.coercion.bind(null,o)]),!0}return Kr(e,`Expected a boolean (got ${hs(t)})`)}return!0}}),Iqe=()=>sn({test:(t,e)=>{var r;if(typeof t!="number"){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return Kr(e,"Unbound coercion result");let o;if(typeof t=="string"){let a;try{a=JSON.parse(t)}catch{}if(typeof a=="number")if(JSON.stringify(a)===t)o=a;else return Kr(e,`Received a number that can't be safely represented by the runtime (${t})`)}if(typeof o<"u")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:".",e.coercion.bind(null,o)]),!0}return Kr(e,`Expected a number (got ${hs(t)})`)}return!0}}),Eqe=()=>sn({test:(t,e)=>{var r;if(!(t instanceof Date)){if(typeof(e==null?void 0:e.coercions)<"u"){if(typeof(e==null?void 0:e.coercion)>"u")return Kr(e,"Unbound coercion result");let o;if(typeof t=="string"&&XT.test(t))o=new Date(t);else{let a;if(typeof t=="string"){let n;try{n=JSON.parse(t)}catch{}typeof n=="number"&&(a=n)}else typeof t=="number"&&(a=t);if(typeof a<"u")if(Number.isSafeInteger(a)||!Number.isSafeInteger(a*1e3))o=new Date(a*1e3);else return Kr(e,`Received a timestamp that can't be safely represented by the runtime (${t})`)}if(typeof o<"u")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:".",e.coercion.bind(null,o)]),!0}return Kr(e,`Expected a date (got ${hs(t)})`)}return!0}}),wqe=(t,{delimiter:e}={})=>sn({test:(r,o)=>{var a;if(typeof r=="string"&&typeof e<"u"&&typeof(o==null?void 0:o.coercions)<"u"){if(typeof(o==null?void 0:o.coercion)>"u")return Kr(o,"Unbound coercion result");r=r.split(e),o.coercions.push([(a=o.p)!==null&&a!==void 0?a:".",o.coercion.bind(null,r)])}if(!Array.isArray(r))return Kr(o,`Expe
2022-08-27 06:35:11 +00:00
`),this.context.stdout.write(`
2022-09-06 17:07:18 +00:00
`);let r=0;for(let o of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[o].commandClass,{prefix:`${r++}. `.padStart(5)}));this.context.stdout.write(`
2022-08-27 06:35:11 +00:00
`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.
2022-09-06 17:07:18 +00:00
`)}}};nM.HelpCommand=Cw});var HJ=K(yw=>{"use strict";Object.defineProperty(yw,"__esModule",{value:!0});var l6e=Fv(),c6e=Uv(),vA=zT(),_J=NJ(),Kv=v0(),u6e=LJ(),OJ=Symbol("clipanion/errorCommand");async function f6e(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:o,resolvedContext:a}=KJ(t);return ac.from(r,e).runExit(o,a)}async function g6e(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:o,resolvedContext:a}=KJ(t);return ac.from(r,e).run(o,a)}function KJ(t){let e,r,o,a;switch(typeof process<"u"&&typeof process.argv<"u"&&(o=process.argv.slice(2)),t.length){case 1:r=t[0];break;case 2:t[0]&&t[0].prototype instanceof Kv.Command||Array.isArray(t[0])?(r=t[0],Array.isArray(t[1])?o=t[1]:a=t[1]):(e=t[0],r=t[1]);break;case 3:Array.isArray(t[2])?(e=t[0],r=t[1],o=t[2]):t[0]&&t[0].prototype instanceof Kv.Command||Array.isArray(t[0])?(r=t[0],o=t[1],a=t[2]):(e=t[0],r=t[1],a=t[2]);break;default:e=t[0],r=t[1],o=t[2],a=t[3];break}if(typeof o>"u")throw new Error("The argv parameter must be provided when running Clipanion outside of a Node context");return{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:o,resolvedContext:a}}var ac=class{constructor({binaryLabel:e,binaryName:r="...",binaryVersion:o,enableCapture:a=!1,enableColors:n}={}){this.registrations=new Map,this.builder=new c6e.CliBuilder({binaryName:r}),this.binaryLabel=e,this.binaryName=r,this.binaryVersion=o,this.enableCapture=a,this.enableColors=n}static from(e,r={}){let o=new ac(r),a=Array.isArray(e)?e:[e];for(let n of a)o.register(n);return o}register(e){var r;let o=new Map,a=new e;for(let g in a){let p=a[g];typeof p=="object"&&p!==null&&p[Kv.Command.isOption]&&o.set(g,p)}let n=this.builder.command(),c=n.cliIndex,f=(r=e.paths)!==null&&r!==void 0?r:a.paths;if(typeof f<"u")for(let g of f)n.addPath(g);this.registrations.set(e,{specs:o,builder:n,index:c});for(let[g,{definition:p}]of o.entries())p(n,g);n.setContext({commandClass:e})}process(e,r){let{contexts:o,process:a}=this.builder.compile(),n=a(e),c={...ac.defaultContext,...r};switch(n.selectedIndex){case l6e.HELP_COMMAND_INDEX:{let f=u6e.HelpCommand.from(n,o);return f.context=c,f}default:{let{commandClass:f}=o[n.selectedIndex],g=this.registrations.get(f);if(typeof g>"u")throw new Error("Assertion failed: Expected the command class to have been registered.");let p=new f;p.context=c,p.path=n.path;try{for(let[I,{transformer:B}]of g.specs.entries())p[I]=B(g.builder,I,n,c);return p}catch(I){throw I[OJ]=p,I}}break}}async run(e,r){var o,a;let n,c={...ac.defaultContext,...r},f=(o=this.enableColors)!==null&&o!==void 0?o:c.colorDepth>1;if(!Array.isArray(e))n=e;else try{n=this.process(e,c)}catch(I){return c.stdout.write(this.error(I,{colored:f})),1}if(n.help)return c.stdout.write(this.usage(n,{colored:f,detailed:!0})),0;n.context=c,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),error:(I,B)=>this.error(I,B),format:I=>this.format(I),process:(I,B)=>this.process(I,{...c,...B}),run:(I,B)=>this.run(I,{...c,...B}),usage:(I,B)=>this.usage(I,B)};let g=this.enableCapture&&(a=_J.getCaptureActivator(c))!==null&&a!==void 0?a:UJ,p;try{p=await g(()=>n.validateAndExecute().catch(I=>n.catch(I).then(()=>0)))}catch(I){return c.stdout.write(this.error(I,{colored:f,command:n})),1}return p}async runExit(e,r){process.exitCode=await this.run(e,r)}suggest(e,r){let{suggest:o}=this.builder.compile();return o(e,r)}definitions({colored:e=!1}={}){let r=[];for(let[o,{index:a}]of this.registrations){if(typeof o.usage>"u")continue;let{usage:n}=this.getUsageByIndex(a,{detailed:!1}),{usage:c,options:f}=this.getUsageByIndex(a,{detailed:!0,inlineOptions:!1}),g=typeof o.usage.category<"u"?vA.formatMarkdownish(o.usage.category,{format:this.format(e),paragraphs:!1}):void 0,p=typeof o.usage.description<"u"?vA.formatMarkdownish(o.usage.description,{format:this.format(e),paragraphs:!1}):void 0,I=typeof o.usage.details<"u"?vA.formatMarkdownish(o.usage.details,{format:this.format(e),paragraphs:!0}):
`),(p!==""||I.length>0)&&(f+=`${this.format(r).header("Usage")}
`,f+=`
`);let{usage:B,options:Q}=this.getUsageByRegistration(c,{inlineOptions:!1});if(f+=`${this.format(r).bold(a)}${B}
`,Q.length>0){f+=`
`,f+=`${this.format(r).header("Options")}
`;let x=Q.reduce((y,T)=>Math.max(y,T.definition.length),0);f+=`
`;for(let{definition:y,description:T}of Q)f+=` ${this.format(r).bold(y.padEnd(x))} ${vA.formatMarkdownish(T,{format:this.format(r),paragraphs:!1})}`}if(p!==""&&(f+=`
`,f+=`${this.format(r).header("Details")}
`,f+=`
`,f+=vA.formatMarkdownish(p,{format:this.format(r),paragraphs:!0})),I.length>0){f+=`
`,f+=`${this.format(r).header("Examples")}
`;for(let[x,y]of I)f+=`
`,f+=vA.formatMarkdownish(x,{format:this.format(r),paragraphs:!1}),f+=`${y.replace(/^/m,` ${this.format(r).bold(a)}`).replace(/\$0/g,this.binaryName)}
`}}else{let{usage:g}=this.getUsageByRegistration(c);f+=`${this.format(r).bold(a)}${g}
`}else{let g=new Map;for(let[Q,{index:x}]of this.registrations.entries()){if(typeof Q.usage>"u")continue;let y=typeof Q.usage.category<"u"?vA.formatMarkdownish(Q.usage.category,{format:this.format(r),paragraphs:!1}):null,T=g.get(y);typeof T>"u"&&g.set(y,T=[]);let{usage:U}=this.getUsageByIndex(x);T.push({commandClass:Q,usage:U})}let p=Array.from(g.keys()).sort((Q,x)=>Q===null?-1:x===null?1:Q.localeCompare(x,"en",{usage:"sort",caseFirst:"upper"})),I=typeof this.binaryLabel<"u",B=typeof this.binaryVersion<"u";I||B?(I&&B?f+=`${this.format(r).header(`${this.binaryLabel} - ${this.binaryVersion}`)}
`:I?f+=`${this.format(r).header(`${this.binaryLabel}`)}
`:f+=`${this.format(r).header(`${this.binaryVersion}`)}
`,f+=` ${this.format(r).bold(a)}${this.binaryName} <command>
`):f+=`${this.format(r).bold(a)}${this.binaryName} <command>
`;for(let Q of p){let x=g.get(Q).slice().sort((T,U)=>T.usage.localeCompare(U.usage,"en",{usage:"sort",caseFirst:"upper"})),y=Q!==null?Q.trim():"General commands";f+=`
`,f+=`${this.format(r).header(`${y}`)}
`;for(let{commandClass:T,usage:U}of x){let q=T.usage.description||"undocumented";f+=`
`,f+=` ${this.format(r).bold(U)}
`,f+=` ${vA.formatMarkdownish(q,{format:this.format(r),paragraphs:!1})}`}}f+=`
`,f+=vA.formatMarkdownish("You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.",{format:this.format(r),paragraphs:!0})}return f}error(e,r){var o,{colored:a,command:n=(o=e[OJ])!==null&&o!==void 0?o:null}=r===void 0?{}:r;e instanceof Error||(e=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(e)})`));let c="",f=e.name.replace(/([a-z])([A-Z])/g,"$1 $2");f==="Error"&&(f="Internal Error"),c+=`${this.format(a).error(f)}: ${e.message}
`;let g=e.clipanion;return typeof g<"u"?g.type==="usage"&&(c+=`
`,c+=this.usage(n)):e.stack&&(c+=`${e.stack.replace(/^.*\n/,"")}
`),c}format(e){var r;return((r=e??this.enableColors)!==null&&r!==void 0?r:ac.defaultContext.colorDepth>1)?vA.richFormat:vA.textFormat}getUsageByRegistration(e,r){let o=this.registrations.get(e);if(typeof o>"u")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(o.index,r)}getUsageByIndex(e,r){return this.builder.getBuilderByIndex(e).usage(r)}};ac.defaultContext={env:process.env,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:_J.getDefaultColorDepth()};function UJ(t){return t()}yw.Cli=ac;yw.run=g6e;yw.runExit=f6e});var qJ=K(iM=>{"use strict";Object.defineProperty(iM,"__esModule",{value:!0});var p6e=v0(),Hv=class extends p6e.Command{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
`)}};Hv.paths=[["--clipanion=definitions"]];iM.DefinitionsCommand=Hv});var GJ=K(sM=>{"use strict";Object.defineProperty(sM,"__esModule",{value:!0});var h6e=v0(),qv=class extends h6e.Command{async execute(){this.context.stdout.write(this.cli.usage())}};qv.paths=[["-h"],["--help"]];sM.HelpCommand=qv});var jJ=K(oM=>{"use strict";Object.defineProperty(oM,"__esModule",{value:!0});var d6e=v0(),Gv=class extends d6e.Command{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:"<unknown>"}
`)}};Gv.paths=[["-v"],["--version"]];oM.VersionCommand=Gv});var YJ=K(Iw=>{"use strict";Object.defineProperty(Iw,"__esModule",{value:!0});var m6e=qJ(),C6e=GJ(),y6e=jJ();Iw.DefinitionsCommand=m6e.DefinitionsCommand;Iw.HelpCommand=C6e.HelpCommand;Iw.VersionCommand=y6e.VersionCommand});var JJ=K(aM=>{"use strict";Object.defineProperty(aM,"__esModule",{value:!0});var WJ=_f();function I6e(t,e,r){let[o,a]=WJ.rerouteArguments(e,r??{}),{arity:n=1}=a,c=t.split(","),f=new Set(c);return WJ.makeCommandOption({definition(g){g.addOption({names:c,arity:n,hidden:a==null?void 0:a.hidden,description:a==null?void 0:a.description,required:a.required})},transformer(g,p,I){let B=typeof o<"u"?[...o]:void 0;for(let{name:Q,value:x}of I.options)!f.has(Q)||(B=B??[],B.push(x));return B}})}aM.Array=I6e});var VJ=K(AM=>{"use strict";Object.defineProperty(AM,"__esModule",{value:!0});var zJ=_f();function E6e(t,e,r){let[o,a]=zJ.rerouteArguments(e,r??{}),n=t.split(","),c=new Set(n);return zJ.makeCommandOption({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,g,p){let I=o;for(let{name:B,value:Q}of p.options)!c.has(B)||(I=Q);return I}})}AM.Boolean=E6e});var ZJ=K(lM=>{"use strict";Object.defineProperty(lM,"__esModule",{value:!0});var XJ=_f();function w6e(t,e,r){let[o,a]=XJ.rerouteArguments(e,r??{}),n=t.split(","),c=new Set(n);return XJ.makeCommandOption({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,g,p){let I=o;for(let{name:B,value:Q}of p.options)!c.has(B)||(I??(I=0),Q?I+=1:I=0);return I}})}lM.Counter=w6e});var $J=K(cM=>{"use strict";Object.defineProperty(cM,"__esModule",{value:!0});var B6e=_f();function Q6e(t={}){return B6e.makeCommandOption({definition(e,r){var o;e.addProxy({name:(o=t.name)!==null&&o!==void 0?o:r,required:t.required})},transformer(e,r,o){return o.positionals.map(({value:a})=>a)}})}cM.Proxy=Q6e});var ez=K(uM=>{"use strict";Object.defineProperty(uM,"__esModule",{value:!0});var v6e=Uv(),D6e=_f();function S6e(t={}){return D6e.makeCommandOption({definition(e,r){var o;e.addRest({name:(o=t.name)!==null&&o!==void 0?o:r,required:t.required})},transformer(e,r,o){let a=c=>{let f=o.positionals[c];return f.extra===v6e.NoLimits||f.extra===!1&&c<e.arity.leading.length},n=0;for(;n<o.positionals.length&&a(n);)n+=1;return o.positionals.splice(0,n).map(({value:c})=>c)}})}uM.Rest=S6e});var tz=K(fM=>{"use strict";Object.defineProperty(fM,"__esModule",{value:!0});var k6e=Uv(),Ew=_f();function x6e(t,e,r){let[o,a]=Ew.rerouteArguments(e,r??{}),{arity:n=1}=a,c=t.split(","),f=new Set(c);return Ew.makeCommandOption({definition(g){g.addOption({names:c,arity:a.tolerateBoolean?0:n,hidden:a.hidden,description:a.description,required:a.required})},transformer(g,p,I,B){let Q,x=o;typeof a.env<"u"&&B.env[a.env]&&(Q=a.env,x=B.env[a.env]);for(let{name:y,value:T}of I.options)!f.has(y)||(Q=y,x=T);return typeof x=="string"?Ew.applyValidator(Q??p,x,a.validator):x}})}function P6e(t={}){let{required:e=!0}=t;return Ew.makeCommandOption({definition(r,o){var a;r.addPositional({name:(a=t.name)!==null&&a!==void 0?a:o,required:t.required})},transformer(r,o,a){var n;for(let c=0;c<a.positionals.length;++c){if(a.positionals[c].extra===k6e.NoLimits||e&&a.positionals[c].extra===!0||!e&&a.positionals[c].extra===!1)continue;let[f]=a.positionals.splice(c,1);return Ew.applyValidator((n=t.name)!==null&&n!==void 0?n:o,f.value,t.validator)}}})}function b6e(t,...e){return typeof t=="string"?x6e(t,...e):P6e(t)}fM.String=b6e});var rz=K(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});var qC=_f(),F6e=JJ(),R6e=VJ(),T6e=ZJ(),M6e=$J(),N6e=ez(),L6e=tz();Wa.applyValidator=qC.applyValidator;Wa.cleanValidationError=qC.cleanValidationError;Wa.formatError=qC.formatError;Wa.isOptionSymbol=qC.isOptionSymbol;Wa.makeCommandOption=qC.makeCommandOption;Wa.rerouteArguments=qC.rerouteArguments;Wa.Array=F6e.Array;Wa.Boolean=R6e.Boolean;Wa.Counter=T6e.Counter;Wa.Proxy=M6e.Proxy;Wa.Rest=N6e.Rest;Wa.String=L6e.String});var Vt=K(f
`,"\r","(",")","!","|","&","^"],!0,!1),Qe=function(ne){return e.queryPattern.test(ne)},be=function(ne){return e.checkFn(ne)},Ee=We("whitespace"),ye=/^[ \t\n\r]/,De=Ze([" "," ",`
`,"\r"],!1,!1),h=0,Oe=0,Ie=[{line:1,column:1}],Ce=0,ue=[],re=0,Se;if("startRule"in e){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=o[e.startRule]}function Le(){return t.substring(Oe,h)}function dt(){return ze(Oe,h)}function H(ne,Ae){throw Ae=Ae!==void 0?Ae:ze(Oe,h),S([We(ne)],t.substring(Oe,h),Ae)}function _e(ne,Ae){throw Ae=Ae!==void 0?Ae:ze(Oe,h),E(ne,Ae)}function tt(ne,Ae){return{type:"literal",text:ne,ignoreCase:Ae}}function Ze(ne,Ae,Fe){return{type:"class",parts:ne,inverted:Ae,ignoreCase:Fe}}function xe(){return{type:"any"}}function Ct(){return{type:"end"}}function We(ne){return{type:"other",description:ne}}function at(ne){var Ae=Ie[ne],Fe;if(Ae)return Ae;for(Fe=ne-1;!Ie[Fe];)Fe--;for(Ae=Ie[Fe],Ae={line:Ae.line,column:Ae.column};Fe<ne;)t.charCodeAt(Fe)===10?(Ae.line++,Ae.column=1):Ae.column++,Fe++;return Ie[ne]=Ae,Ae}function ze(ne,Ae){var Fe=at(ne),Ue=at(Ae);return{start:{offset:ne,line:Fe.line,column:Fe.column},end:{offset:Ae,line:Ue.line,column:Ue.column}}}function k(ne){h<Ce||(h>Ce&&(Ce=h,ue=[]),ue.push(ne))}function E(ne,Ae){return new T0(ne,null,null,Ae)}function S(ne,Ae,Fe){return new T0(T0.buildMessage(ne,Ae),ne,Ae,Fe)}function C(){var ne,Ae,Fe,Ue,gt,It,Ht,or;if(ne=h,Ae=R(),Ae!==r){for(Fe=[],Ue=h,gt=te(),gt!==r?(t.charCodeAt(h)===124?(It=n,h++):(It=r,re===0&&k(c)),It===r&&(t.charCodeAt(h)===38?(It=f,h++):(It=r,re===0&&k(g)),It===r&&(t.charCodeAt(h)===94?(It=p,h++):(It=r,re===0&&k(I)))),It!==r?(Ht=te(),Ht!==r?(or=R(),or!==r?(gt=[gt,It,Ht,or],Ue=gt):(h=Ue,Ue=r)):(h=Ue,Ue=r)):(h=Ue,Ue=r)):(h=Ue,Ue=r);Ue!==r;)Fe.push(Ue),Ue=h,gt=te(),gt!==r?(t.charCodeAt(h)===124?(It=n,h++):(It=r,re===0&&k(c)),It===r&&(t.charCodeAt(h)===38?(It=f,h++):(It=r,re===0&&k(g)),It===r&&(t.charCodeAt(h)===94?(It=p,h++):(It=r,re===0&&k(I)))),It!==r?(Ht=te(),Ht!==r?(or=R(),or!==r?(gt=[gt,It,Ht,or],Ue=gt):(h=Ue,Ue=r)):(h=Ue,Ue=r)):(h=Ue,Ue=r)):(h=Ue,Ue=r);Fe!==r?(Oe=ne,Ae=B(Ae,Fe),ne=Ae):(h=ne,ne=r)}else h=ne,ne=r;return ne}function R(){var ne,Ae,Fe,Ue,gt,It;return ne=h,t.charCodeAt(h)===33?(Ae=Q,h++):(Ae=r,re===0&&k(x)),Ae!==r?(Fe=R(),Fe!==r?(Oe=ne,Ae=y(Fe),ne=Ae):(h=ne,ne=r)):(h=ne,ne=r),ne===r&&(ne=h,t.charCodeAt(h)===40?(Ae=T,h++):(Ae=r,re===0&&k(U)),Ae!==r?(Fe=te(),Fe!==r?(Ue=C(),Ue!==r?(gt=te(),gt!==r?(t.charCodeAt(h)===41?(It=q,h++):(It=r,re===0&&k(X)),It!==r?(Oe=ne,Ae=se(Ue),ne=Ae):(h=ne,ne=r)):(h=ne,ne=r)):(h=ne,ne=r)):(h=ne,ne=r)):(h=ne,ne=r),ne===r&&(ne=Z())),ne}function Z(){var ne,Ae,Fe,Ue,gt;if(ne=h,Ae=te(),Ae!==r){if(Fe=h,Ue=[],fe.test(t.charAt(h))?(gt=t.charAt(h),h++):(gt=r,re===0&&k(me)),gt!==r)for(;gt!==r;)Ue.push(gt),fe.test(t.charAt(h))?(gt=t.charAt(h),h++):(gt=r,re===0&&k(me));else Ue=r;Ue!==r?Fe=t.substring(Fe,h):Fe=Ue,Fe!==r?(Oe=h,Ue=Qe(Fe),Ue?Ue=void 0:Ue=r,Ue!==r?(Oe=ne,Ae=be(Fe),ne=Ae):(h=ne,ne=r)):(h=ne,ne=r)}else h=ne,ne=r;return ne}function te(){var ne,Ae;for(re++,ne=[],ye.test(t.charAt(h))?(Ae=t.charAt(h),h++):(Ae=r,re===0&&k(De));Ae!==r;)ne.push(Ae),ye.test(t.charAt(h))?(Ae=t.charAt(h),h++):(Ae=r,re===0&&k(De));return re--,ne===r&&(Ae=r,re===0&&k(Ee)),ne}if(Se=a(),Se!==r&&h===t.length)return Se;throw Se!==r&&h<t.length&&k(Ct()),S(ue,Ce<t.length?t.charAt(Ce):null,Ce<t.length?ze(Ce,Ce+1):ze(Ce,Ce))}$V.exports={SyntaxError:T0,parse:Zje}});var tX=K(aD=>{var{parse:$je}=eX();aD.makeParser=(t=/[a-z]+/)=>(e,r)=>$je(e,{queryPattern:t,checkFn:r});aD.parse=aD.makeParser()});var nX=K((dPt,rX)=>{"use strict";rX.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darko
2022-08-27 06:35:11 +00:00
`:`
2022-09-06 17:07:18 +00:00
`)+r,a=o+1,o=t.indexOf(`
`,a)}while(o!==-1);return n+=t.substr(a),n};yX.exports={stringReplaceAll:f5e,stringEncaseCRLFWithFirstIndex:g5e}});var vX=K((QPt,QX)=>{"use strict";var p5e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,EX=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,h5e=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,d5e=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,m5e=new Map([["n",`
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function BX(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):m5e.get(t)||t}function C5e(t,e){let r=[],o=e.trim().split(/\s*,\s*/g),a;for(let n of o){let c=Number(n);if(!Number.isNaN(c))r.push(c);else if(a=n.match(h5e))r.push(a[2].replace(d5e,(f,g,p)=>g?BX(g):p));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${t}')`)}return r}function y5e(t){EX.lastIndex=0;let e=[],r;for(;(r=EX.exec(t))!==null;){let o=r[1];if(r[2]){let a=C5e(o,r[2]);e.push([o].concat(a))}else e.push([o])}return e}function wX(t,e){let r={};for(let a of e)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let o=t;for(let[a,n]of Object.entries(r))if(!!Array.isArray(n)){if(!(a in o))throw new Error(`Unknown Chalk style: ${a}`);o=n.length>0?o[a](...n):o[a]}return o}QX.exports=(t,e)=>{let r=[],o=[],a=[];if(e.replace(p5e,(n,c,f,g,p,I)=>{if(c)a.push(BX(c));else if(g){let B=a.join("");a=[],o.push(r.length===0?B:wX(t,r)(B)),r.push({inverse:f,styles:y5e(g)})}else if(p){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");o.push(wX(t,r)(a.join(""))),a=[],r.pop()}else a.push(I)}),o.push(a.join("")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(n)}return o.join("")}});var _M=K((vPt,xX)=>{"use strict";var Mw=Tw(),{stdout:NM,stderr:LM}=TM(),{stringReplaceAll:I5e,stringEncaseCRLFWithFirstIndex:E5e}=IX(),DX=["ansi","ansi","ansi256","ansi16m"],VC=Object.create(null),w5e=(t,e={})=>{if(e.level>3||e.level<0)throw new Error("The `level` option should be an integer from 0 to 3");let r=NM?NM.level:0;t.level=e.level===void 0?r:e.level},OM=class{constructor(e){return SX(e)}},SX=t=>{let e={};return w5e(e,t),e.template=(...r)=>v5e(e.template,...r),Object.setPrototypeOf(e,cD.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=OM,e.template};function cD(t){return SX(t)}for(let[t,e]of Object.entries(Mw))VC[t]={get(){let r=uD(this,UM(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};VC.visible={get(){let t=uD(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var kX=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of kX)VC[t]={get(){let{level:e}=this;return function(...r){let o=UM(Mw.color[DX[e]][t](...r),Mw.color.close,this._styler);return uD(this,o,this._isEmpty)}}};for(let t of kX){let e="bg"+t[0].toUpperCase()+t.slice(1);VC[e]={get(){let{level:r}=this;return function(...o){let a=UM(Mw.bgColor[DX[r]][t](...o),Mw.bgColor.close,this._styler);return uD(this,a,this._isEmpty)}}}}var B5e=Object.defineProperties(()=>{},{...VC,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),UM=(t,e,r)=>{let o,a;return r===void 0?(o=t,a=e):(o=r.openAll+t,a=e+r.closeAll),{open:t,close:e,openAll:o,closeAll:a,parent:r}},uD=(t,e,r)=>{let o=(...a)=>Q5e(o,a.length===1?""+a[0]:a.join(" "));return o.__proto__=B5e,o._generator=t,o._styler=e,o._isEmpty=r,o},Q5e=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:o,closeAll:a}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=I5e(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
`);return n!==-1&&(e=E5e(e,a,o,n)),o+e+a},MM,v5e=(t,...e)=>{let[r]=e;if(!Array.isArray(r))return e.join(" ");let o=e.slice(1),a=[r.raw[0]];for(let n=1;n<r.length;n++)a.push(String(o[n-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[n]));return MM===void 0&&(MM=vX()),MM(t,a.join(""))};Object.defineProperties(cD.prototype,VC);var Nw=cD();Nw.supportsColor=NM;Nw.stderr=cD({level:LM?LM.level:0});Nw.stderr.supportsColor=LM;Nw.Level={None:0,Basic:1,Ansi256:2,TrueColor:3,0:"None",1:"Basic",2:"Ansi256",3:"TrueColor"};xX.exports=Nw});var fD=K(pl=>{"use strict";pl.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;pl.find=(t,e)=>t.nodes.find(r=>r.type===e);pl.exceedsLimit=(t,e,r=1,o)=>o===!1||!pl.isInteger(t)||!pl.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=o;pl.escapeNode=(t,e=0,r)=>{let o=t.nodes[e];!o||(r&&o.type===r||o.type==="open"||o.type==="close")&&o.escaped!==!0&&(o.value="\\"+o.value,o.escaped=!0)};pl.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;pl.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;pl.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;pl.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);pl.flatten=(...t)=>{let e=[],r=o=>{for(let a=0;a<o.length;a++){let n=o[a];Array.isArray(n)?r(n,e):n!==void 0&&e.push(n)}return e};return r(t),e}});var gD=K((SPt,bX)=>{"use strict";var PX=fD();bX.exports=(t,e={})=>{let r=(o,a={})=>{let n=e.escapeInvalid&&PX.isInvalidBrace(a),c=o.invalid===!0&&e.escapeInvalid===!0,f="";if(o.value)return(n||c)&&PX.isOpenOrClose(o)?"\\"+o.value:o.value;if(o.value)return o.value;if(o.nodes)for(let g of o.nodes)f+=r(g);return f};return r(t)}});var RX=K((kPt,FX)=>{"use strict";FX.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var HX=K((xPt,KX)=>{"use strict";var TX=RX(),M0=(t,e,r)=>{if(TX(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(TX(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let o={relaxZeros:!0,...r};typeof o.strictZeros=="boolean"&&(o.relaxZeros=o.strictZeros===!1);let a=String(o.relaxZeros),n=String(o.shorthand),c=String(o.capture),f=String(o.wrap),g=t+":"+e+"="+a+n+c+f;if(M0.cache.hasOwnProperty(g))return M0.cache[g].result;let p=Math.min(t,e),I=Math.max(t,e);if(Math.abs(p-I)===1){let T=t+"|"+e;return o.capture?`(${T})`:o.wrap===!1?T:`(?:${T})`}let B=_X(t)||_X(e),Q={min:t,max:e,a:p,b:I},x=[],y=[];if(B&&(Q.isPadded=B,Q.maxLen=String(Q.max).length),p<0){let T=I<0?Math.abs(I):1;y=MX(T,Math.abs(p),Q,o),p=Q.a=0}return I>=0&&(x=MX(p,I,Q,o)),Q.negatives=y,Q.positives=x,Q.result=D5e(y,x,o),o.capture===!0?Q.result=`(${Q.result})`:o.wrap!==!1&&x.length+y.length>1&&(Q.result=`(?:${Q.result})`),M0.cache[g]=Q,Q.result};function D5e(t,e,r){let o=KM(t,e,"-",!1,r)||[],a=KM(e,t,"",!1,r)||[],n=KM(t,e,"-?",!0,r)||[];return o.concat(n).concat(a).join("|")}function S5e(t,e){let r=1,o=1,a=LX(t,r),n=new Set([e]);for(;t<=a&&a<=e;)n.add(a),r+=1,a=LX(t,r);for(a=OX(e+1,o)-1;t<a&&a<=e;)n.add(a),o+=1,a=OX(e+1,o)-1;return n=[...n],n.sort(P5e),n}function k5e(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let o=x5e(t,e),a=o.length,n="",c=0;for(let f=0;f<a;f++){let[g,p]=o[f];g===p?n+=g:g!=="0"||p!=="9"?n+=b5e(g,p,r):c++}return c&&(n+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:n,count:[c],digits:a}}function MX(t,e,r,o){let a=S5e(t,e),n=[],c=t,f;for(let g=0;g<a.length;g++){let p=a[g],I=k5e(String(c),String(p),o),B="";if(!r.isPadded&&f&&f.pattern===I.pattern){f.count.length>1&&f.count.pop(),f.count.push(I.count[0]),f.string=f.pattern+UX(f.count),c=p+1;continue}r.isPadded&&(B=F5e(p,r,o)),I.string=B+I.pattern+UX(I.count),n.push(I),c=p+1,f=I}return n}function KM(t,e,r,o,a){let n=[];for(let c of t){let{string:f}=c;!o&&!NX(e,"strin
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var lZ=K((TPt,AZ)=>{"use strict";var j5e=gD(),{MAX_LENGTH:sZ,CHAR_BACKSLASH:jM,CHAR_BACKTICK:Y5e,CHAR_COMMA:W5e,CHAR_DOT:J5e,CHAR_LEFT_PARENTHESES:z5e,CHAR_RIGHT_PARENTHESES:V5e,CHAR_LEFT_CURLY_BRACE:X5e,CHAR_RIGHT_CURLY_BRACE:Z5e,CHAR_LEFT_SQUARE_BRACKET:oZ,CHAR_RIGHT_SQUARE_BRACKET:aZ,CHAR_DOUBLE_QUOTE:$5e,CHAR_SINGLE_QUOTE:e9e,CHAR_NO_BREAK_SPACE:t9e,CHAR_ZERO_WIDTH_NOBREAK_SPACE:r9e}=iZ(),n9e=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},o=typeof r.maxLength=="number"?Math.min(sZ,r.maxLength):sZ;if(t.length>o)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${o})`);let a={type:"root",input:t,nodes:[]},n=[a],c=a,f=a,g=0,p=t.length,I=0,B=0,Q,x={},y=()=>t[I++],T=U=>{if(U.type==="text"&&f.type==="dot"&&(f.type="text"),f&&f.type==="text"&&U.type==="text"){f.value+=U.value;return}return c.nodes.push(U),U.parent=c,U.prev=f,f=U,U};for(T({type:"bos"});I<p;)if(c=n[n.length-1],Q=y(),!(Q===r9e||Q===t9e)){if(Q===jM){T({type:"text",value:(e.keepEscaping?Q:"")+y()});continue}if(Q===aZ){T({type:"text",value:"\\"+Q});continue}if(Q===oZ){g++;let U=!0,q;for(;I<p&&(q=y());){if(Q+=q,q===oZ){g++;continue}if(q===jM){Q+=y();continue}if(q===aZ&&(g--,g===0))break}T({type:"text",value:Q});continue}if(Q===z5e){c=T({type:"paren",nodes:[]}),n.push(c),T({type:"text",value:Q});continue}if(Q===V5e){if(c.type!=="paren"){T({type:"text",value:Q});continue}c=n.pop(),T({type:"text",value:Q}),c=n[n.length-1];continue}if(Q===$5e||Q===e9e||Q===Y5e){let U=Q,q;for(e.keepQuotes!==!0&&(Q="");I<p&&(q=y());){if(q===jM){Q+=q+y();continue}if(q===U){e.keepQuotes===!0&&(Q+=q);break}Q+=q}T({type:"text",value:Q});continue}if(Q===X5e){B++;let U=f.value&&f.value.slice(-1)==="$"||c.dollar===!0;c=T({type:"brace",open:!0,close:!1,dollar:U,depth:B,commas:0,ranges:0,nodes:[]}),n.push(c),T({type:"open",value:Q});continue}if(Q===Z5e){if(c.type!=="brace"){T({type:"text",value:Q});continue}let U="close";c=n.pop(),c.close=!0,T({type:U,value:Q}),B--,c=n[n.length-1];continue}if(Q===W5e&&B>0){if(c.ranges>0){c.ranges=0;let U=c.nodes.shift();c.nodes=[U,{type:"text",value:j5e(c)}]}T({type:"comma",value:Q}),c.commas++;continue}if(Q===J5e&&B>0&&c.commas===0){let U=c.nodes;if(B===0||U.length===0){T({type:"text",value:Q});continue}if(f.type==="dot"){if(c.range=[],f.value+=Q,f.type="range",c.nodes.length!==3&&c.nodes.length!==5){c.invalid=!0,c.ranges=0,f.type="text";continue}c.ranges++,c.args=[];continue}if(f.type==="range"){U.pop();let q=U[U.length-1];q.value+=f.value+Q,f=q,c.ranges--;continue}T({type:"dot",value:Q});continue}T({type:"text",value:Q})}do if(c=n.pop(),c.type!=="root"){c.nodes.forEach(X=>{X.nodes||(X.type==="open"&&(X.isOpen=!0),X.type==="close"&&(X.isClose=!0),X.nodes||(X.type="text"),X.invalid=!0)});let U=n[n.length-1],q=U.nodes.indexOf(c);U.nodes.splice(q,1,...c.nodes)}while(n.length>0);return T({type:"eos"}),a};AZ.exports=n9e});var fZ=K((MPt,uZ)=>{"use strict";var cZ=gD(),i9e=$X(),s9e=rZ(),o9e=lZ(),SA=(t,e={})=>{let r=[];if(Array.isArray(t))for(let o of t){let a=SA.create(o,e);Array.isArray(a)?r.push(...a):r.push(a)}else r=[].concat(SA.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};SA.parse=(t,e={})=>o9e(t,e);SA.stringify=(t,e={})=>cZ(typeof t=="string"?SA.parse(t,e):t,e);SA.compile=(t,e={})=>(typeof t=="string"&&(t=SA.parse(t,e)),i9e(t,e));SA.expand=(t,e={})=>{typeof t=="string"&&(t=SA.parse(t,e));let r=s9e(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};SA.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?SA.compile(t,e):SA.expand(t,e);uZ.exports=SA});var Ow=K((NPt,mZ)=>{"use strict";var a9e=Be("path"),pu="\\\\/",gZ=`[^${pu}]`,qf="\\.",A9e="\\+",l9e="\\?",hD="\\/",c9e="(?=.)",pZ="[^/]",YM=`(?:${hD}|$)`,hZ=`(?:^|${h
`),f!==-1){let g=a+c.substring(0,f);c=c.substring(f+1),a="",e!==null?this.reportInfo(null,`${e} ${g}`):this.reportInfo(null,g)}while(f!==-1);a+=c}),r.on("end",()=>{let n=o.end();n!==""&&(e!==null?this.reportInfo(null,`${e} ${n}`):this.reportInfo(null,n))}),r}}});var Dy,qO=Ot(()=>{Il();go();Dy=class{constructor(e){this.fetchers=e}supports(e,r){return!!this.tryFetcher(e,r)}getLocalPath(e,r){return this.getFetcher(e,r).getLocalPath(e,r)}async fetch(e,r){return await this.getFetcher(e,r).fetch(e,r)}tryFetcher(e,r){let o=this.fetchers.find(a=>a.supports(e,r));return o||null}getFetcher(e,r){let o=this.fetchers.find(a=>a.supports(e,r));if(!o)throw new tr(11,`${jr(r.project.configuration,e)} isn't supported by any available fetcher`);return o}}});var ed,GO=Ot(()=>{go();ed=class{constructor(e){this.resolvers=e.filter(r=>r)}supportsDescriptor(e,r){return!!this.tryResolverByDescriptor(e,r)}supportsLocator(e,r){return!!this.tryResolverByLocator(e,r)}shouldPersistResolution(e,r){return this.getResolverByLocator(e,r).shouldPersistResolution(e,r)}bindDescriptor(e,r,o){return this.getResolverByDescriptor(e,o).bindDescriptor(e,r,o)}getResolutionDependencies(e,r){return this.getResolverByDescriptor(e,r).getResolutionDependencies(e,r)}async getCandidates(e,r,o){return await this.getResolverByDescriptor(e,o).getCandidates(e,r,o)}async getSatisfying(e,r,o,a){return this.getResolverByDescriptor(e,a).getSatisfying(e,r,o,a)}async resolve(e,r){return await this.getResolverByLocator(e,r).resolve(e,r)}tryResolverByDescriptor(e,r){let o=this.resolvers.find(a=>a.supportsDescriptor(e,r));return o||null}getResolverByDescriptor(e,r){let o=this.resolvers.find(a=>a.supportsDescriptor(e,r));if(!o)throw new Error(`${Zn(r.project.configuration,e)} isn't supported by any available resolver`);return o}tryResolverByLocator(e,r){let o=this.resolvers.find(a=>a.supportsLocator(e,r));return o||null}getResolverByLocator(e,r){let o=this.resolvers.find(a=>a.supportsLocator(e,r));if(!o)throw new Error(`${jr(r.project.configuration,e)} isn't supported by any available resolver`);return o}}});var Sy,jO=Ot(()=>{Nt();go();Sy=class{supports(e){return!!e.reference.startsWith("virtual:")}getLocalPath(e,r){let o=e.reference.indexOf("#");if(o===-1)throw new Error("Invalid virtual package reference");let a=e.reference.slice(o+1),n=Za(e,a);return r.fetcher.getLocalPath(n,r)}async fetch(e,r){let o=e.reference.indexOf("#");if(o===-1)throw new Error("Invalid virtual package reference");let a=e.reference.slice(o+1),n=Za(e,a),c=await r.fetcher.fetch(n,r);return await this.ensureVirtualLink(e,c,r)}getLocatorFilename(e){return wy(e)}async ensureVirtualLink(e,r,o){let a=r.packageFs.getRealPath(),n=o.project.configuration.get("virtualFolder"),c=this.getLocatorFilename(e),f=Gi.makeVirtualPath(n,c,a),g=new ou(f,{baseFs:r.packageFs,pathUtils:ee});return{...r,packageFs:g}}}});var ky,wB,loe=Ot(()=>{ky=class{static isVirtualDescriptor(e){return!!e.range.startsWith(ky.protocol)}static isVirtualLocator(e){return!!e.reference.startsWith(ky.protocol)}supportsDescriptor(e,r){return ky.isVirtualDescriptor(e)}supportsLocator(e,r){return ky.isVirtualLocator(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){throw new Error('Assertion failed: calling "bindDescriptor" on a virtual descriptor is unsupported')}getResolutionDependencies(e,r){throw new Error('Assertion failed: calling "getResolutionDependencies" on a virtual descriptor is unsupported')}async getCandidates(e,r,o){throw new Error('Assertion failed: calling "getCandidates" on a virtual descriptor is unsupported')}async getSatisfying(e,r,o,a){throw new Error('Assertion failed: calling "getSatisfying" on a virtual descriptor is unsupported')}async resolve(e,r){throw new Error('Assertion failed: calling "resolve" on a virtual locator is unsupported')}},wB=ky;wB.protocol="virtual:"});var xy,YO=Ot(()=>{Nt();Z0();xy=class{supports(e){return!!e.reference.startsWith(Bi.protocol)}getLocalPath(e,r){return this.getWorkspace(e,r).cwd}async fetch(e,r){let o=this.getWorkspace(e,r).cwd;return{packageFs:new Bn(o),prefixPath:Qt.dot,localPath:o}}ge
`);return{stdout:n,stderr:c}}makeResolver(){let e=[];for(let r of this.plugins.values())for(let o of r.resolvers||[])e.push(new o);return new ed([new wB,new Bi,...e])}makeFetcher(){let e=[];for(let r of this.plugins.values())for(let o of r.fetchers||[])e.push(new o);return new Dy([new Sy,new xy,...e])}getLinkers(){let e=[];for(let r of this.plugins.values())for(let o of r.linkers||[])e.push(new o);return e}getSupportedArchitectures(){let e=QB(),r=this.get("supportedArchitectures"),o=r.get("os");o!==null&&(o=o.map(c=>c==="current"?e.os:c));let a=r.get("cpu");a!==null&&(a=a.map(c=>c==="current"?e.cpu:c));let n=r.get("libc");return n!==null&&(n=mu(n,c=>c==="current"?e.libc??mu.skip:c)),{os:o,cpu:a,libc:n}}async refreshPackageExtensions(){this.packageExtensions=new Map;let e=this.packageExtensions,r=(o,a,{userProvided:n=!1}={})=>{if(!wu(o.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let c=new Gt;c.load(a,{yamlCompatibilityMode:!0});let f=ly(e,o.identHash),g=[];f.push([o.range,g]);let p={status:"inactive",userProvided:n,parentDescriptor:o};for(let I of c.dependencies.values())g.push({...p,type:"Dependency",descriptor:I});for(let I of c.peerDependencies.values())g.push({...p,type:"PeerDependency",descriptor:I});for(let[I,B]of c.peerDependenciesMeta)for(let[Q,x]of Object.entries(B))g.push({...p,type:"PeerDependencyMeta",selector:I,key:Q,value:x})};await this.triggerHook(o=>o.registerPackageExtensions,this,r);for(let[o,a]of this.get("packageExtensions"))r(kp(o,!0),LD(a),{userProvided:!0})}normalizeDependency(e){return wu(e.range)?_n(e,`${this.get("defaultProtocol")}${e.range}`):vB.test(e.range)?_n(e,`${this.get("defaultProtocol")}${e.range}`):e}normalizeDependencyMap(e){return new Map([...e].map(([r,o])=>[r,this.normalizeDependency(o)]))}normalizePackage(e){let r=fB(e);if(this.packageExtensions==null)throw new Error("refreshPackageExtensions has to be called before normalizing packages");let o=this.packageExtensions.get(e.identHash);if(typeof o<"u"){let n=e.version;if(n!==null){for(let[c,f]of o)if(!!$0(n,c))for(let g of f)switch(g.status==="inactive"&&(g.status="redundant"),g.type){case"Dependency":typeof r.dependencies.get(g.descriptor.identHash)>"u"&&(g.status="active",r.dependencies.set(g.descriptor.identHash,this.normalizeDependency(g.descriptor)));break;case"PeerDependency":typeof r.peerDependencies.get(g.descriptor.identHash)>"u"&&(g.status="active",r.peerDependencies.set(g.descriptor.identHash,g.descriptor));break;case"PeerDependencyMeta":{let p=r.peerDependenciesMeta.get(g.selector);(typeof p>"u"||!Object.prototype.hasOwnProperty.call(p,g.key)||p[g.key]!==g.value)&&(g.status="active",Gf(r.peerDependenciesMeta,g.selector,()=>({}))[g.key]=g.value)}break;default:ON(g);break}}}let a=n=>n.scope?`${n.scope}__${n.name}`:`${n.name}`;for(let n of r.peerDependenciesMeta.keys()){let c=ha(n);r.peerDependencies.has(c.identHash)||r.peerDependencies.set(c.identHash,_n(c,"*"))}for(let n of r.peerDependencies.values()){if(n.scope==="types")continue;let c=a(n),f=Eu("types",c),g=Cn(f);r.peerDependencies.has(f.identHash)||r.peerDependenciesMeta.has(g)||(r.peerDependencies.set(f.identHash,_n(f,"*")),r.peerDependenciesMeta.set(g,{optional:!0}))}return r.dependencies=new Map(za(r.dependencies,([,n])=>Xa(n))),r.peerDependencies=new Map(za(r.peerDependencies,([,n])=>Xa(n))),r}getLimit(e){return Gf(this.limits,e,()=>(0,hoe.default)(this.get(e)))}async triggerHook(e,...r){for(let o of this.plugins.values()){let a=o.hooks;if(!a)continue;let n=e(a);!n||await n(...r)}}async triggerMultipleHooks(e,r){for(let o of r)await this.triggerHook(e,...o)}async reduceHook(e,r,...o){let a=r;for(let n of this.plugins.values()){let c=n.hooks;if(!c)continue;let f=e(c);!f||(a=await f(a,...o))}return a}async firstHook(e,...r){for(let o of this.plugins.values()){let a=o.hooks;if(!a)continue;let n=e(a);if(!n)continue;let c=await n(...r);if(typeof c<"u")return c}return null}},rt=Bu;rt.deleteProperty=Symbol(),rt.telemetry=null});var gn={};sr(gn,{EndStrategy:()=>l4,ExecError:()=>RS,PipeError:()=>SB,execvp:()=>Mrt,pipe
`,B.message,B.stack);var Q=new Error("tunneling socket could not be established, cause="+B.message);Q.code="ECONNRESET",e.request.emit("error",Q),o.removeSocket(a)}};Zf.prototype.removeSocket=function(e){var r=this.sockets.indexOf(e);if(r!==-1){this.sockets.splice(r,1);var o=this.requests.shift();o&&this.createSocket(o,function(a){o.request.onSocket(a)})}};function Coe(t,e){var r=this;Zf.prototype.createSocket.call(r,t,function(o){var a=t.request.getHeader("host"),n=g4({},r.options,{socket:o,servername:a?a.replace(/:.*$/,""):t.host}),c=Ort.connect(0,n);r.sockets[r.sockets.indexOf(o)]=c,e(c)})}function yoe(t,e,r){return typeof t=="string"?{host:t,port:e,localAddress:r}:t}function g4(t){for(var e=1,r=arguments.length;e<r;++e){var o=arguments[e];if(typeof o=="object")for(var a=Object.keys(o),n=0,c=a.length;n<c;++n){var f=a[n];o[f]!==void 0&&(t[f]=o[f])}}return t}var Fp;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?Fp=function(){var t=Array.prototype.slice.call(arguments);typeof t[0]=="string"?t[0]="TUNNEL: "+t[0]:t.unshift("TUNNEL:"),console.error.apply(console,t)}:Fp=function(){};Py.debug=Fp});var woe=K((DMt,Eoe)=>{Eoe.exports=Ioe()});var eg=K(($f,TS)=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});var Boe=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function jrt(t){return Boe.includes(t)}var Yrt=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...Boe];function Wrt(t){return Yrt.includes(t)}var Jrt=["null","undefined","string","number","bigint","boolean","symbol"];function zrt(t){return Jrt.includes(t)}function by(t){return e=>typeof e===t}var{toString:Qoe}=Object.prototype,kB=t=>{let e=Qoe.call(t).slice(8,-1);if(/HTML\w+Element/.test(e)&&Re.domElement(t))return"HTMLElement";if(Wrt(e))return e},fi=t=>e=>kB(e)===t;function Re(t){if(t===null)return"null";switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(Re.observable(t))return"Observable";if(Re.array(t))return"Array";if(Re.buffer(t))return"Buffer";let e=kB(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}Re.undefined=by("undefined");Re.string=by("string");var Vrt=by("number");Re.number=t=>Vrt(t)&&!Re.nan(t);Re.bigint=by("bigint");Re.function_=by("function");Re.null_=t=>t===null;Re.class_=t=>Re.function_(t)&&t.toString().startsWith("class ");Re.boolean=t=>t===!0||t===!1;Re.symbol=by("symbol");Re.numericString=t=>Re.string(t)&&!Re.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));Re.array=(t,e)=>Array.isArray(t)?Re.function_(e)?t.every(e):!0:!1;Re.buffer=t=>{var e,r,o,a;return(a=(o=(r=(e=t)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.isBuffer)===null||o===void 0?void 0:o.call(r,t))!==null&&a!==void 0?a:!1};Re.nullOrUndefined=t=>Re.null_(t)||Re.undefined(t);Re.object=t=>!Re.null_(t)&&(typeof t=="object"||Re.function_(t));Re.iterable=t=>{var e;return Re.function_((e=t)===null||e===void 0?void 0:e[Symbol.iterator])};Re.asyncIterable=t=>{var e;return Re.function_((e=t)===null||e===void 0?void 0:e[Symbol.asyncIterator])};Re.generator=t=>Re.iterable(t)&&Re.function_(t.next)&&Re.function_(t.throw);Re.asyncGenerator=t=>Re.asyncIterable(t)&&Re.function_(t.next)&&Re.function_(t.throw);Re.nativePromise=t=>fi("Promise")(t);var Xrt=t=>{var e,r;return Re.function_((e=t)===null||e===void 0?void 0:e.then)&&Re.function_((r=t)===null||r===void 0?void 0:r.catch)};Re.promise=t=>Re.nativePromise(t)||Xrt(t);Re.generatorFunction=fi("GeneratorFunction");Re.asyncGene
Please report this to https://github.com/szmarczak/http2-wrapper/`);y(T)}return}o[0].resolve(x);return}}if(c in this.queue){if(f in this.queue[c]){this.queue[c][f].listeners.push(...o),this._tryToCreateNewSession(c,f);return}}else this.queue[c]={};let g=()=>{c in this.queue&&this.queue[c][f]===p&&(delete this.queue[c][f],Object.keys(this.queue[c]).length===0&&delete this.queue[c])},p=()=>{let I=`${f}:${c}`,B=!1;try{let Q=oit.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(I),...r});Q[Ca]=0,Q[My]=!1;let x=()=>Q[Ca]<Q.remoteSettings.maxConcurrentStreams,y=!0;Q.socket.once("session",U=>{this.tlsSessionCache.set(I,U)}),Q.once("error",U=>{for(let{reject:q}of o)q(U);this.tlsSessionCache.delete(I)}),Q.setTimeout(this.timeout,()=>{Q.destroy()}),Q.once("close",()=>{if(B){y&&this._freeSessionsCount--,this._sessionsCount--;let U=this.sessions[c];U.splice(U.indexOf(Q),1),U.length===0&&delete this.sessions[c]}else{let U=new Error("Session closed without receiving a SETTINGS frame");U.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:q}of o)q(U);g()}this._tryToCreateNewSession(c,f)});let T=()=>{if(!(!(c in this.queue)||!x())){for(let U of Q[El])if(U in this.queue[c]){let{listeners:q}=this.queue[c][U];for(;q.length!==0&&x();)q.shift().resolve(Q);let X=this.queue[c];if(X[U].listeners.length===0&&(delete X[U],Object.keys(X).length===0)){delete this.queue[c];break}if(!x())break}}};Q.on("origin",()=>{Q[El]=Q.originSet,x()&&(T(),O4(this.sessions[c],Q))}),Q.once("remoteSettings",()=>{if(Q.ref(),Q.unref(),this._sessionsCount++,p.destroyed){let U=new Error("Agent has been destroyed");for(let q of o)q.reject(U);Q.destroy();return}Q[El]=Q.originSet;{let U=this.sessions;if(c in U){let q=U[c];q.splice(lit(q,Q,cit),0,Q)}else U[c]=[Q]}this._freeSessionsCount+=1,B=!0,this.emit("session",Q),T(),g(),Q[Ca]===0&&this._freeSessionsCount>this.maxFreeSessions&&Q.close(),o.length!==0&&(this.getSession(f,r,o),o.length=0),Q.on("remoteSettings",()=>{T(),O4(this.sessions[c],Q)})}),Q[Iae]=Q.request,Q.request=(U,q)=>{if(Q[My])throw new Error("The session is gracefully closing. No new streams are allowed.");let X=Q[Iae](U,q);return Q.ref(),++Q[Ca],Q[Ca]===Q.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,X.once("close",()=>{if(y=x(),--Q[Ca],!Q.destroyed&&!Q.closed&&(uit(this.sessions[c],Q),x()&&!Q.closed)){y||(this._freeSessionsCount++,y=!0);let se=Q[Ca]===0;se&&Q.unref(),se&&(this._freeSessionsCount>this.maxFreeSessions||Q[My])?Q.close():(O4(this.sessions[c],Q),T())}}),X}}catch(Q){for(let x of o)x.reject(Q);g()}};p.listeners=o,p.completed=!1,p.destroyed=!1,this.queue[c][f]=p,this._tryToCreateNewSession(c,f)})}request(e,r,o,a){return new Promise((n,c)=>{this.getSession(e,r,[{reject:c,resolve:f=>{try{n(f.request(o,a))}catch(g){c(g)}}}])})}createConnection(e,r){return vu.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let o=e.port||443,a=e.hostname||e.host;return typeof r.servername>"u"&&(r.servername=a),sit.connect(o,a,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[Ca]===0&&r.close()}destroy(e){for(let r of Object.values(this.sessions))for(let o of r)o.destroy(e);for(let r of Object.values(this.queue))for(let o of Object.values(r))o.destroyed=!0;this.queue={}}get freeSessions(){return Eae({agent:this,isFree:!0})}get busySessions(){return Eae({agent:this,isFree:!1})}};vu.kCurrentStreamsCount=Ca;vu.kGracefullyClosing=My;Bae.exports={Agent:vu,globalAgent:new vu}});var K4=K((XMt,Qae)=>{"use strict";var{Readable:fit}=Be("stream"),_4=class extends fit{constructor(e,r){super({highWaterMark:r,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"
`).reverse(),f=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
`).reverse();for(;f.length!==0&&f[0]===c[0];)c.shift();this.stack=`${this.stack.slice(0,n)}${c.reverse().join(`
`)}${f.reverse().join(`
`)}`}}};Tn.RequestError=ms;var VS=class extends ms{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError"}};Tn.MaxRedirectsError=VS;var XS=class extends ms{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError"}};Tn.HTTPError=XS;var ZS=class extends ms{constructor(e,r){super(e.message,e,r),this.name="CacheError"}};Tn.CacheError=ZS;var $S=class extends ms{constructor(e,r){super(e.message,e,r),this.name="UploadError"}};Tn.UploadError=$S;var ek=class extends ms{constructor(e,r,o){super(e.message,e,o),this.name="TimeoutError",this.event=e.event,this.timings=r}};Tn.TimeoutError=ek;var MB=class extends ms{constructor(e,r){super(e.message,e,r),this.name="ReadError"}};Tn.ReadError=MB;var tk=class extends ms{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError"}};Tn.UnsupportedProtocolError=tk;var yst=["socket","connect","continue","information","upgrade","timeout"],rk=class extends gAe.Duplex{constructor(e,r={},o){super({autoDestroy:!1,highWaterMark:0}),this[Oy]=0,this[_y]=0,this.requestInitialized=!1,this[WS]=new Set,this.redirects=[],this[Ky]=!1,this[JS]=!1,this[TB]=[],this.retryCount=0,this._progressCallbacks=[];let a=()=>this._unlockWrite(),n=()=>this._lockWrite();this.on("pipe",p=>{p.prependListener("data",a),p.on("data",n),p.prependListener("end",a),p.on("end",n)}),this.on("unpipe",p=>{p.off("data",a),p.off("data",n),p.off("end",a),p.off("end",n)}),this.on("pipe",p=>{p instanceof fU.IncomingMessage&&(this.options.headers={...p.headers,...this.options.headers})});let{json:c,body:f,form:g}=r;if((c||f||g)&&this._lockWrite(),Tn.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,o)}catch(p){lt.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(p);return}(async()=>{var p;try{this.options.body instanceof Zit.ReadStream&&await dst(this.options.body);let{url:I}=this.options;if(!I)throw new TypeError("Missing `url` property");if(this.requestUrl=I.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(p=this[ho])===null||p===void 0||p.destroy();return}for(let B of this[TB])B();this[TB].length=0,this.requestInitialized=!0}catch(I){if(I instanceof ms){this._beforeError(I);return}this.destroyed||this.destroy(I)}})()}static normalizeArguments(e,r,o){var a,n,c,f,g;let p=r;if(lt.default.object(e)&&!lt.default.urlInstance(e))r={...o,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...o,...r},e!==void 0&&(r.url=e),lt.default.urlInstance(r.url)&&(r.url=new Rp.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),lt.assert.any([lt.default.string,lt.default.undefined],r.method),lt.assert.any([lt.default.object,lt.default.undefined],r.headers),lt.assert.any([lt.default.string,lt.default.urlInstance,lt.default.undefined],r.prefixUrl),lt.assert.any([lt.default.object,lt.default.undefined],r.cookieJar),lt.assert.any([lt.default.object,lt.default.string,lt.default.undefined],r.searchParams),lt.assert.any([lt.default.object,lt.default.string,lt.default.undefined],r.cache),lt.assert.any([lt.default.object,lt.default.number,lt.default.undefined],r.timeout),lt.assert.any([lt.default.object,lt.default.undefined],r.context),lt.assert.any([lt.default.object,lt.default.undefined],r.hooks),lt.assert.any([lt.default.boolean,lt.default.undefined],r.decompress),lt.assert.any([lt.default.boolean,lt.default.undefined],r.ignoreInvalidCookies),lt.assert.any([lt.default.boolean,lt.default.undefined],r.followRedirect),lt.assert.any([lt.default.number,lt.default.undefined],r.maxRedirects),lt.assert.any([lt.default.boolean,lt.default.undefined],r.throwHttpErrors),lt.assert.any([lt.default.boolean,lt.default.undefined],r.http2),lt.assert.any([lt.default.boolean,lt.default.undefined],r.allowGetBody),lt.assert.any([lt.default.string,lt.default.undefined],r.localAddress),lt.asser
`)):typeof readline=="function"&&(_=readline(),_!==null&&(_+=`
`));if(!_)return null;F.input=Ai(_,!0)}return F.input.shift()},put_char:function(F,_){_===null||_===10?(X(dt(F.output,0)),F.output=[]):_!=0&&F.output.push(_)},flush:function(F){F.output&&F.output.length>0&&(X(dt(F.output,0)),F.output=[])}},default_tty1_ops:{put_char:function(F,_){_===null||_===10?(se(dt(F.output,0)),F.output=[]):_!=0&&F.output.push(_)},flush:function(F){F.output&&F.output.length>0&&(se(dt(F.output,0)),F.output=[])}}};function oA(F){for(var _=me(F,65536),G=YA(_);F<_;)ze[G+F++]=0;return G}var Sr={ops_table:null,mount:function(F){return Sr.createNode(null,"/",16895,0)},createNode:function(F,_,G,ie){if($.isBlkdev(G)||$.isFIFO(G))throw new $.ErrnoError(63);Sr.ops_table||(Sr.ops_table={dir:{node:{getattr:Sr.node_ops.getattr,setattr:Sr.node_ops.setattr,lookup:Sr.node_ops.lookup,mknod:Sr.node_ops.mknod,rename:Sr.node_ops.rename,unlink:Sr.node_ops.unlink,rmdir:Sr.node_ops.rmdir,readdir:Sr.node_ops.readdir,symlink:Sr.node_ops.symlink},stream:{llseek:Sr.stream_ops.llseek}},file:{node:{getattr:Sr.node_ops.getattr,setattr:Sr.node_ops.setattr},stream:{llseek:Sr.stream_ops.llseek,read:Sr.stream_ops.read,write:Sr.stream_ops.write,allocate:Sr.stream_ops.allocate,mmap:Sr.stream_ops.mmap,msync:Sr.stream_ops.msync}},link:{node:{getattr:Sr.node_ops.getattr,setattr:Sr.node_ops.setattr,readlink:Sr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Sr.node_ops.getattr,setattr:Sr.node_ops.setattr},stream:$.chrdev_stream_ops}});var le=$.createNode(F,_,G,ie);return $.isDir(le.mode)?(le.node_ops=Sr.ops_table.dir.node,le.stream_ops=Sr.ops_table.dir.stream,le.contents={}):$.isFile(le.mode)?(le.node_ops=Sr.ops_table.file.node,le.stream_ops=Sr.ops_table.file.stream,le.usedBytes=0,le.contents=null):$.isLink(le.mode)?(le.node_ops=Sr.ops_table.link.node,le.stream_ops=Sr.ops_table.link.stream):$.isChrdev(le.mode)&&(le.node_ops=Sr.ops_table.chrdev.node,le.stream_ops=Sr.ops_table.chrdev.stream),le.timestamp=Date.now(),F&&(F.contents[_]=le,F.timestamp=le.timestamp),le},getFileDataAsTypedArray:function(F){return F.contents?F.contents.subarray?F.contents.subarray(0,F.usedBytes):new Uint8Array(F.contents):new Uint8Array(0)},expandFileStorage:function(F,_){var G=F.contents?F.contents.length:0;if(!(G>=_)){var ie=1024*1024;_=Math.max(_,G*(G<ie?2:1.125)>>>0),G!=0&&(_=Math.max(_,256));var le=F.contents;F.contents=new Uint8Array(_),F.usedBytes>0&&F.contents.set(le.subarray(0,F.usedBytes),0)}},resizeFileStorage:function(F,_){if(F.usedBytes!=_)if(_==0)F.contents=null,F.usedBytes=0;else{var G=F.contents;F.contents=new Uint8Array(_),G&&F.contents.set(G.subarray(0,Math.min(_,F.usedBytes))),F.usedBytes=_}},node_ops:{getattr:function(F){var _={};return _.dev=$.isChrdev(F.mode)?F.id:1,_.ino=F.id,_.mode=F.mode,_.nlink=1,_.uid=0,_.gid=0,_.rdev=F.rdev,$.isDir(F.mode)?_.size=4096:$.isFile(F.mode)?_.size=F.usedBytes:$.isLink(F.mode)?_.size=F.link.length:_.size=0,_.atime=new Date(F.timestamp),_.mtime=new Date(F.timestamp),_.ctime=new Date(F.timestamp),_.blksize=4096,_.blocks=Math.ceil(_.size/_.blksize),_},setattr:function(F,_){_.mode!==void 0&&(F.mode=_.mode),_.timestamp!==void 0&&(F.timestamp=_.timestamp),_.size!==void 0&&Sr.resizeFileStorage(F,_.size)},lookup:function(F,_){throw $.genericErrors[44]},mknod:function(F,_,G,ie){return Sr.createNode(F,_,G,ie)},rename:function(F,_,G){if($.isDir(F.mode)){var ie;try{ie=$.lookupNode(_,G)}catch{}if(ie)for(var le in ie.contents)throw new $.ErrnoError(55)}delete F.parent.contents[F.name],F.parent.timestamp=Date.now(),F.name=G,_.contents[G]=F,_.timestamp=F.parent.timestamp,F.parent=_},unlink:function(F,_){delete F.contents[_],F.timestamp=Date.now()},rmdir:function(F,_){var G=$.lookupNode(F,_);for(var ie in G.contents)throw new $.ErrnoError(55);delete F.contents[_],F.timestamp=Date.now()},readdir:function(F){var _=[".",".."];for(var G in F.contents)!F.contents.hasOwnProperty(G)||_.push(G);return _},symlink:function(F,_,G){var ie=Sr.createNode(F,_,41471,0);return ie.link=G,ie},readlink:function(F){if(!$.isLink(F.mode))throw new $.ErrnoError(28);return F.link}},stream_ops:{read:function(F,_,G,ie,le){var Pe=F.node.contents;if(l
`),p(127);break;case"EACCES":a[2].write(`permission denied: ${t}
`),p(128);break;default:a[2].write(`uncaught error: ${I.message}
`),p(1);break}}),g.on("close",I=>{sd.delete(g),sd.size===0&&(process.off("SIGINT",RU),process.off("SIGTERM",TU)),p(I!==null?I:129)})})}}}function ple(t){return e=>{let r=e[0]==="pipe"?new Du.PassThrough:e[0];return{stdin:r,promise:Promise.resolve().then(()=>t({stdin:r,stdout:e[1],stderr:e[2]}))}}}function gk(t,e){return Hy.start(t,e)}function cle(t,e=null){let r=new Du.PassThrough,o=new fle.StringDecoder,a="";return r.on("data",n=>{let c=o.write(n),f;do if(f=c.indexOf(`
`),f!==-1){let g=a+c.substring(0,f);c=c.substring(f+1),a="",t(e!==null?`${e} ${g}`:g)}while(f!==-1);a+=c}),r.on("end",()=>{let n=o.end();n!==""&&t(e!==null?`${e} ${n}`:n)}),r}function hle(t,{prefix:e}){return{stdout:cle(r=>t.stdout.write(`${r}
`),t.stdout.isTTY?e:null),stderr:cle(r=>t.stderr.write(`${r}
`),t.stderr.isTTY?e:null)}}var ule,Du,fle,sd,Ql,MU,Hy,NU=Ot(()=>{ule=Te(QT()),Du=Be("stream"),fle=Be("string_decoder"),sd=new Set;Ql=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},MU=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");this.stream.end()}attach(e){this.stream=e}get(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");return this.stream}},Hy=class{constructor(e,r){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=r}static start(e,{stdin:r,stdout:o,stderr:a}){let n=new Hy(null,e);return n.stdin=r,n.stdout=o,n.stderr=a,n}pipeTo(e,r=1){let o=new Hy(this,e),a=new MU;return o.pipe=a,o.stdout=this.stdout,o.stderr=this.stderr,(r&1)===1?this.stdout=a:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(r&2)===2?this.stderr=a:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),o}async exec(){let e=["ignore","ignore","ignore"];if(this.pipe)e[0]="pipe";else{if(this.stdin===null)throw new Error("Assertion failed: No input stream registered");e[0]=this.stdin.get()}let r;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");r=this.stdout,e[1]=r.get();let o;if(this.stderr===null)throw new Error("Assertion failed: No error stream registered");o=this.stderr,e[2]=o.get();let a=this.implementation(e);return this.pipe&&this.pipe.attach(a.stdin),await a.promise.then(n=>(r.close(),o.close(),n))}async run(){let e=[];for(let o=this;o;o=o.ancestor)e.push(o.exec());return(await Promise.all(e))[0]}}});var qB={};sr(qB,{ShellError:()=>PA,execute:()=>mk,globUtils:()=>fk});function dle(t,e,r){let o=new bA.PassThrough({autoDestroy:!0});switch(t){case 0:(e&1)===1&&r.stdin.pipe(o,{end:!1}),(e&2)===2&&r.stdin instanceof bA.Writable&&o.pipe(r.stdin,{end:!1});break;case 1:(e&1)===1&&r.stdout.pipe(o,{end:!1}),(e&2)===2&&o.pipe(r.stdout,{end:!1});break;case 2:(e&1)===1&&r.stderr.pipe(o,{end:!1}),(e&2)===2&&o.pipe(r.stderr,{end:!1});break;default:throw new PA(`Bad file descriptor: "${t}"`)}return o}function hk(t,e={}){let r={...t,...e};return r.environment={...t.environment,...e.environment},r.variables={...t.variables,...e.variables},r}async function rot(t,e,r){let o=[],a=new bA.PassThrough;return a.on("data",n=>o.push(n)),await dk(t,e,hk(r,{stdout:a})),Buffer.concat(o).toString().replace(/[\r\n]+$/,"")}async function mle(t,e,r){let o=t.map(async n=>{let c=await ig(n.args,e,r);return{name:n.name,value:c.join(" ")}});return(await Promise.all(o)).reduce((n,c)=>(n[c.name]=c.value,n),{})}function pk(t){return t.match(/[^ \r\n\t]+/g)||[]}async function Ble(t,e,r,o,a=o){switch(t.name){case"$":o(String(process.pid));break;case"#":o(String(e.args.length));break;case"@":if(t.quoted)for(let n of e.args)a(n);else for(let n of e.args){let c=pk(n);for(let f=0;f<c.length-1;++f)a(c[f]);o(c[c.length-1])}break;case"*":{let n=e.args.join(" ");if(t.quoted)o(n);else for(let c of pk(n))a(c)}break;case"PPID":o(String(process.ppid));break;case"RANDOM":o(String(Math.floor(Math.random()*32768)));break;default:{let n=parseInt(t.name,10),c;if(Number.isFinite(n))if(n>=0&&n<e.args.length)c=e.args[n];else if(t.defaultValue)c=(await ig(t.defaultValue,e,r)).join(" ");else if(t.alternativeValue)c=(await ig(t.alternativeValue,e,r)).join(" ");else throw new PA(`Unbound argument #${n}`);else if(Object.prototype.hasOwnProperty.call(r.variables,t.name))c=r.variables[t.name];else if(Object.prototype.hasOwnProperty.call(r.environment,t.name))c=r.environment[t.name];else if(t.defaultValue)c=(await ig(t.defaultValue,e,r)).join(" ");else throw new PA(`Unbound variable "${t.name}"`);if(typeof c<"u"&&t.alternativeValue&&(c=(await ig(t.alternativeValue,e,r)).join(" ")),t.quoted)o(c);else{let f=pk(c);for(let p=0;p<f.length-1;++p)a(f[p]);let g=f[f.length-1];typeof g<"u"&&o(g)}}break}}async function _B(t,e,r){if(t.type==="number"){if(Number.isInteger(t.value))return t.value;throw new Error(`Invalid number: "${t.value}", only integers are allowed`)}else if(t.type==="variable"){let
`)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${g}, '${c(MC(t))}' has ended
`)})),0}return await yle(t,e,r)}async function aot(t,e,r,{background:o=!1}={}){let a,n=f=>{a=f,r.variables["?"]=String(f)},c=async f=>{try{return await oot(f.chain,e,r,{background:o&&typeof f.then>"u"})}catch(g){if(!(g instanceof PA))throw g;return r.stderr.write(`${g.message}
`),1}};for(n(await c(t));t.then;){if(r.exitCode!==null)return r.exitCode;switch(t.then.type){case"&&":a===0&&n(await c(t.then.line));break;case"||":a!==0&&n(await c(t.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${t.then.type}"`)}t=t.then.line}return a}async function dk(t,e,r){let o=r.backgroundJobs;r.backgroundJobs=[];let a=0;for(let{command:n,type:c}of t){if(a=await aot(n,e,r,{background:c==="&"}),r.exitCode!==null)return r.exitCode;r.variables["?"]=String(a)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=o,a}function Qle(t){switch(t.type){case"variable":return t.name==="@"||t.name==="#"||t.name==="*"||Number.isFinite(parseInt(t.name,10))||"defaultValue"in t&&!!t.defaultValue&&t.defaultValue.some(e=>HB(e))||"alternativeValue"in t&&!!t.alternativeValue&&t.alternativeValue.some(e=>HB(e));case"arithmetic":return LU(t.arithmetic);case"shell":return OU(t.shell);default:return!1}}function HB(t){switch(t.type){case"redirection":return t.args.some(e=>HB(e));case"argument":return t.segments.some(e=>Qle(e));default:throw new Error(`Assertion failed: Unsupported argument type: "${t.type}"`)}}function LU(t){switch(t.type){case"variable":return Qle(t);case"number":return!1;default:return LU(t.left)||LU(t.right)}}function OU(t){return t.some(({command:e})=>{for(;e;){let r=e.chain;for(;r;){let o;switch(r.type){case"subshell":o=OU(r.subshell);break;case"command":o=r.envs.some(a=>a.args.some(n=>HB(n)))||r.args.some(a=>HB(a));break}if(o)return!0;if(!r.then)break;r=r.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function mk(t,e=[],{baseFs:r=new Xn,builtins:o={},cwd:a=de.toPortablePath(process.cwd()),env:n=process.env,stdin:c=process.stdin,stdout:f=process.stdout,stderr:g=process.stderr,variables:p={},glob:I=fk}={}){let B={};for(let[y,T]of Object.entries(n))typeof T<"u"&&(B[y]=T);let Q=new Map(tot);for(let[y,T]of Object.entries(o))Q.set(y,T);c===null&&(c=new bA.PassThrough,c.end());let x=hv(t,I);if(!OU(x)&&x.length>0&&e.length>0){let{command:y}=x[x.length-1];for(;y.then;)y=y.then.line;let T=y.chain;for(;T.then;)T=T.then.chain;T.type==="command"&&(T.args=T.args.concat(e.map(U=>({type:"argument",segments:[{type:"text",text:U}]}))))}return await dk(x,{args:e,baseFs:r,builtins:Q,initialStdin:c,initialStdout:f,initialStderr:g,glob:I},{cwd:a,environment:B,exitCode:null,procedures:{},stdin:c,stdout:f,stderr:g,variables:Object.assign({},p,{["?"]:0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var Ile,Ele,bA,wle,eot,tot,not,Ck=Ot(()=>{Nt();ll();Ile=Te(_M()),Ele=Be("os"),bA=Be("stream"),wle=Be("util");sle();lle();NU();NU();eot=(0,wle.promisify)(setTimeout);tot=new Map([["cd",async([t=(0,Ele.homedir)(),...e],r,o)=>{let a=ee.resolve(o.cwd,de.toPortablePath(t));if(!(await r.baseFs.statPromise(a).catch(c=>{throw c.code==="ENOENT"?new PA(`cd: no such file or directory: ${t}`):c})).isDirectory())throw new PA(`cd: not a directory: ${t}`);return o.cwd=a,0}],["pwd",async(t,e,r)=>(r.stdout.write(`${de.fromPortablePath(r.cwd)}
`),0)],[":",async(t,e,r)=>0],["true",async(t,e,r)=>0],["false",async(t,e,r)=>1],["exit",async([t,...e],r,o)=>o.exitCode=parseInt(t??o.variables["?"],10)],["echo",async(t,e,r)=>(r.stdout.write(`${t.join(" ")}
`),0)],["sleep",async([t],e,r)=>{if(typeof t>"u")throw new PA("sleep: missing operand");let o=Number(t);if(Number.isNaN(o))throw new PA(`sleep: invalid time interval '${t}'`);return await eot(1e3*o,0)}],["__ysh_run_procedure",async(t,e,r)=>{let o=r.procedures[t[0]];return await gk(o,{stdin:new Ql(r.stdin),stdout:new Ql(r.stdout),stderr:new Ql(r.stderr)}).run()}],["__ysh_set_redirects",async(t,e,r)=>{let o=r.stdin,a=r.stdout,n=r.stderr,c=[],f=[],g=[],p=0;for(;t[p]!=="--";){let B=t[p++],{type:Q,fd:x}=JSON.parse(B),y=X=>{switch(x){case null:case 0:c.push(X);break;default:throw new Error(`Unsupported file descriptor: "${x}"`)}},T=X=>{switch(x){case null:case 1:f.push(X);break;case 2:g.push(X);break;default:throw new Error(`Unsupported file descriptor: "${x}"`)}},U=Number(t[p++]),q=p+U;for(let X=p;X<q;++p,++X)switch(Q){case"<":y(()=>e.baseFs.createReadStream(ee.resolve(r.cwd,de.toPortablePath(t[X]))));break;case"<<<":y(()=>{let se=new bA.PassThrough;return process.nextTick(()=>{se.write(`${t[X]}
`),se.end()}),se});break;case"<&":y(()=>dle(Number(t[X]),1,r));break;case">":case">>":{let se=ee.resolve(r.cwd,de.toPortablePath(t[X]));T(se==="/dev/null"?new bA.Writable({autoDestroy:!0,emitClose:!0,write(fe,me,Qe){setImmediate(Qe)}}):e.baseFs.createWriteStream(se,Q===">>"?{flags:"a"}:void 0))}break;case">&":T(dle(Number(t[X]),2,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${Q}"`)}}if(c.length>0){let B=new bA.PassThrough;o=B;let Q=x=>{if(x===c.length)B.end();else{let y=c[x]();y.pipe(B,{end:!1}),y.on("end",()=>{Q(x+1)})}};Q(0)}if(f.length>0){let B=new bA.PassThrough;a=B;for(let Q of f)B.pipe(Q)}if(g.length>0){let B=new bA.PassThrough;n=B;for(let Q of g)B.pipe(Q)}let I=await gk(KB(t.slice(p+1),e,r),{stdin:new Ql(o),stdout:new Ql(a),stderr:new Ql(n)}).run();return await Promise.all(f.map(B=>new Promise((Q,x)=>{B.on("error",y=>{x(y)}),B.on("close",()=>{Q()}),B.end()}))),await Promise.all(g.map(B=>new Promise((Q,x)=>{B.on("error",y=>{x(y)}),B.on("close",()=>{Q()}),B.end()}))),I}]]);not={addition:(t,e)=>t+e,subtraction:(t,e)=>t-e,multiplication:(t,e)=>t*e,division:(t,e)=>Math.trunc(t/e)}});var UU=K((aLt,vle)=>{function Aot(t,e){for(var r=-1,o=t==null?0:t.length,a=Array(o);++r<o;)a[r]=e(t[r],r,t);return a}vle.exports=Aot});var ble=K((ALt,Ple)=>{var Dle=L0(),lot=UU(),cot=lc(),uot=EB(),fot=1/0,Sle=Dle?Dle.prototype:void 0,kle=Sle?Sle.toString:void 0;function xle(t){if(typeof t=="string")return t;if(cot(t))return lot(t,xle)+"";if(uot(t))return kle?kle.call(t):"";var e=t+"";return e=="0"&&1/t==-fot?"-0":e}Ple.exports=xle});var yk=K((lLt,Fle)=>{var got=ble();function pot(t){return t==null?"":got(t)}Fle.exports=pot});var _U=K((cLt,Rle)=>{function hot(t,e,r){var o=-1,a=t.length;e<0&&(e=-e>a?0:a+e),r=r>a?a:r,r<0&&(r+=a),a=e>r?0:r-e>>>0,e>>>=0;for(var n=Array(a);++o<a;)n[o]=t[o+e];return n}Rle.exports=hot});var Mle=K((uLt,Tle)=>{var dot=_U();function mot(t,e,r){var o=t.length;return r=r===void 0?o:r,!e&&r>=o?t:dot(t,e,r)}Tle.exports=mot});var KU=K((fLt,Nle)=>{var Cot="\\ud800-\\udfff",yot="\\u0300-\\u036f",Iot="\\ufe20-\\ufe2f",Eot="\\u20d0-\\u20ff",wot=yot+Iot+Eot,Bot="\\ufe0e\\ufe0f",Qot="\\u200d",vot=RegExp("["+Qot+Cot+wot+Bot+"]");function Dot(t){return vot.test(t)}Nle.exports=Dot});var Ole=K((gLt,Lle)=>{function Sot(t){return t.split("")}Lle.exports=Sot});var Yle=K((pLt,jle)=>{var Ule="\\ud800-\\udfff",kot="\\u0300-\\u036f",xot="\\ufe20-\\ufe2f",Pot="\\u20d0-\\u20ff",bot=kot+xot+Pot,Fot="\\ufe0e\\ufe0f",Rot="["+Ule+"]",HU="["+bot+"]",qU="\\ud83c[\\udffb-\\udfff]",Tot="(?:"+HU+"|"+qU+")",_le="[^"+Ule+"]",Kle="(?:\\ud83c[\\udde6-\\uddff]){2}",Hle="[\\ud800-\\udbff][\\udc00-\\udfff]",Mot="\\u200d",qle=Tot+"?",Gle="["+Fot+"]?",Not="(?:"+Mot+"(?:"+[_le,Kle,Hle].join("|")+")"+Gle+qle+")*",Lot=Gle+qle+Not,Oot="(?:"+[_le+HU+"?",HU,Kle,Hle,Rot].join("|")+")",Uot=RegExp(qU+"(?="+qU+")|"+Oot+Lot,"g");function _ot(t){return t.match(Uot)||[]}jle.exports=_ot});var Jle=K((hLt,Wle)=>{var Kot=Ole(),Hot=KU(),qot=Yle();function Got(t){return Hot(t)?qot(t):Kot(t)}Wle.exports=Got});var Vle=K((dLt,zle)=>{var jot=Mle(),Yot=KU(),Wot=Jle(),Jot=yk();function zot(t){return function(e){e=Jot(e);var r=Yot(e)?Wot(e):void 0,o=r?r[0]:e.charAt(0),a=r?jot(r,1).join(""):e.slice(1);return o[t]()+a}}zle.exports=zot});var Zle=K((mLt,Xle)=>{var Vot=Vle(),Xot=Vot("toUpperCase");Xle.exports=Xot});var GU=K((CLt,$le)=>{var Zot=yk(),$ot=Zle();function eat(t){return $ot(Zot(t).toLowerCase())}$le.exports=eat});var ece=K((yLt,Ik)=>{function tat(){var t=0,e=1,r=2,o=3,a=4,n=5,c=6,f=7,g=8,p=9,I=10,B=11,Q=12,x=13,y=14,T=15,U=16,q=17,X=0,se=1,fe=2,me=3,Qe=4;function be(h,Oe){return 55296<=h.charCodeAt(Oe)&&h.charCodeAt(Oe)<=56319&&56320<=h.charCodeAt(Oe+1)&&h.charCodeAt(Oe+1)<=57343}function Ee(h,Oe){Oe===void 0&&(Oe=0);var Ie=h.charCodeAt(Oe);if(55296<=Ie&&Ie<=56319&&Oe<h.length-1){var Ce=Ie,ue=h.charCodeAt(Oe+1);return 56320<=ue&&ue<=57343?(Ce-55296)*1024+(ue-56320)+65536:Ce}if(56320<=Ie&&Ie<=57343&&Oe>=1){var Ce=h.charCodeAt(Oe-1),ue=Ie;return 55296<=Ce&&Ce<=56319?(Ce-55296)*1024+(ue-56320)+65536:ue}return Ie}function ye(h,Oe,Ie){var Ce=[h
2022-08-27 06:35:11 +00:00
`,end:t=>`::endgroup::
`}:Bk.default.TRAVIS?{start:t=>`travis_fold:start:${t}
`,end:t=>`travis_fold:end:${t}
2022-09-06 17:07:18 +00:00
`}:Bk.default.GITLAB?{start:t=>`section_start:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}[collapsed=true]\r\x1B[0K${t}
`,end:t=>`section_end:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}\r\x1B[0K`}:null,sce=new Date,oat=["iTerm.app","Apple_Terminal"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,aat=t=>t,Qk=aat({patrick:{date:[17,3],chars:["\u{1F340}","\u{1F331}"],size:40},simba:{date:[19,7],chars:["\u{1F981}","\u{1F334}"],size:40},jack:{date:[31,10],chars:["\u{1F383}","\u{1F987}"],size:40},hogsfather:{date:[31,12],chars:["\u{1F389}","\u{1F384}"],size:40},default:{chars:["=","-"],size:80}}),Aat=oat&&Object.keys(Qk).find(t=>{let e=Qk[t];return!(e.date&&(e.date[0]!==sce.getDate()||e.date[1]!==sce.getMonth()+1))})||"default";St=class extends po{constructor({configuration:r,stdout:o,json:a=!1,includeFooter:n=!0,includeLogs:c=!a,includeInfos:f=c,includeWarnings:g=c,forgettableBufferSize:p=sat,forgettableNames:I=new Set}){super();this.uncommitted=new Set;this.cacheHitCount=0;this.cacheMissCount=0;this.lastCacheMiss=null;this.warningCount=0;this.errorCount=0;this.startTime=Date.now();this.indent=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.progressStyle=null;this.progressMaxScaledSize=null;this.forgettableLines=[];if(oB(this,{configuration:r}),this.configuration=r,this.forgettableBufferSize=p,this.forgettableNames=new Set([...I,...iat]),this.includeFooter=n,this.includeInfos=f,this.includeWarnings=g,this.json=a,this.stdout=o,r.get("enableProgressBars")&&!a&&o.isTTY&&o.columns>22){let B=r.get("progressBarStyle")||Aat;if(!Object.prototype.hasOwnProperty.call(Qk,B))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=Qk[B];let Q=12,x=Math.max(0,Math.min(o.columns-Q,80));this.progressMaxScaledSize=Math.floor(this.progressStyle.size*x/80)}}static async start(r,o){let a=new this(r),n=process.emitWarning;process.emitWarning=(c,f)=>{if(typeof c!="string"){let p=c;c=p.message,f=f??p.name}let g=typeof f<"u"?`${f}: ${c}`:c;a.reportWarning(0,g)};try{await o(a)}catch(c){a.reportExceptionOnce(c)}finally{await a.finalize(),process.emitWarning=n}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(r){this.cacheHitCount+=1}reportCacheMiss(r,o){this.lastCacheMiss=r,this.cacheMissCount+=1,typeof o<"u"&&!this.configuration.get("preferAggregateCacheInfo")&&this.reportInfo(13,o)}startSectionSync({reportHeader:r,reportFooter:o,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r==null||r()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return n()}catch(g){throw this.reportExceptionOnce(g),g}finally{let g=Date.now();this.uncommitted.delete(c),c.committed&&(o==null||o(g-f))}}async startSectionPromise({reportHeader:r,reportFooter:o,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r==null||r()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return await n()}catch(g){throw this.reportExceptionOnce(g),g}finally{let g=Date.now();this.uncommitted.delete(c),c.committed&&(o==null||o(g-f))}}startTimerImpl(r,o,a){return{cb:typeof o=="function"?o:a,reportHeader:()=>{this.reportInfo(null,`\u250C ${r}`),this.indent+=1,wk!==null&&!this.json&&this.includeInfos&&this.stdout.write(wk.start(r))},reportFooter:f=>{this.indent-=1,wk!==null&&!this.json&&this.includeInfos&&this.stdout.write(wk.end(r)),this.configuration.get("enableTimers")&&f>200?this.reportInfo(null,`\u2514 Completed in ${Ar(this.configuration,f,Mt.DURATION)}`):this.reportInfo(null,"\u2514 Completed")},skipIfEmpty:(typeof o=="function"?{}:o).skipIfEmpty}}startTimerSync(r,o,a){let{cb:n,...c}=this.startTimerImpl(r,o,a);return this.startSectionSync(c,n)}async startTimerPromise(r,o,a){let{cb:n,...c}=this.startTimerImpl(r,o,a);return this.startSectionPromise(c,n)}async startCacheReport(r){let o=this.configuration.get("preferAggregateCacheInfo")?{cacheHitCount:this.cacheHitCount,cacheMissCount:this.cacheMissCount}:null;try{return await r()}catch(a){throw this.reportExceptionOnce(a),a}finally{o!==null&&this.reportCacheChanges(o)}}reportSeparator(){this.indent===0?this.writeLineWithForgettableReset(""):this.re
`),this.writeProgress()}writeLineWithForgettableReset(r,{truncate:o}={}){this.forgettableLines=[],this.writeLine(r,{truncate:o})}writeLines(r,{truncate:o}={}){this.clearProgress({delta:r.length});for(let a of r)this.stdout.write(`${this.truncate(a,{truncate:o})}
`);this.writeProgress()}reportCacheChanges({cacheHitCount:r,cacheMissCount:o}){let a=this.cacheHitCount-r,n=this.cacheMissCount-o;if(a===0&&n===0)return;let c="";this.cacheHitCount>1?c+=`${this.cacheHitCount} packages were already cached`:this.cacheHitCount===1?c+=" - one package was already cached":c+="No packages were cached",this.cacheHitCount>0?this.cacheMissCount>1?c+=`, ${this.cacheMissCount} had to be fetched`:this.cacheMissCount===1&&(c+=`, one had to be fetched (${jr(this.configuration,this.lastCacheMiss)})`):this.cacheMissCount>1?c+=` - ${this.cacheMissCount} packages had to be fetched`:this.cacheMissCount===1&&(c+=` - one package had to be fetched (${jr(this.configuration,this.lastCacheMiss)})`),this.reportInfo(13,c)}commit(){let r=this.uncommitted;this.uncommitted=new Set;for(let o of r)o.committed=!0,o.action()}clearProgress({delta:r=0,clear:o=!1}){this.progressStyle!==null&&this.progress.size+r>0&&(this.stdout.write(`\x1B[${this.progress.size+r}A`),(r>0||o)&&this.stdout.write("\x1B[0J"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let r=Date.now();r-this.progressTime>ice&&(this.progressFrame=(this.progressFrame+1)%nce.length,this.progressTime=r);let o=nce[this.progressFrame];for(let a of this.progress.values()){let n="";if(typeof a.lastScaledSize<"u"){let p=this.progressStyle.chars[0].repeat(a.lastScaledSize),I=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-a.lastScaledSize);n=` ${p}${I}`}let c=this.formatName(null),f=c?`${c}: `:"",g=a.definition.title?` ${a.definition.title}`:"";this.stdout.write(`${Ar(this.configuration,"\u27A4","blueBright")} ${f}${o}${n}${g}
`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},ice)}refreshProgress({delta:r=0,force:o=!1}={}){let a=!1,n=!1;if(o||this.progress.size===0)a=!0;else for(let c of this.progress.values()){let f=typeof c.definition.progress<"u"?Math.trunc(this.progressMaxScaledSize*c.definition.progress):void 0,g=c.lastScaledSize;c.lastScaledSize=f;let p=c.lastTitle;if(c.lastTitle=c.definition.title,f!==g||(n=p!==c.definition.title)){a=!0;break}}a&&(this.clearProgress({delta:r,clear:n}),this.writeProgress())}truncate(r,{truncate:o}={}){return this.progressStyle===null&&(o=!1),typeof o>"u"&&(o=this.configuration.get("preferTruncatedLines")),o&&(r=(0,oce.default)(r,0,this.stdout.columns-1)),r}formatName(r){return ace(r,{configuration:this.configuration,json:this.json})}formatNameWithHyperlink(r){return jU(r,{configuration:this.configuration,json:this.json})}formatIndent(){return"\u2502 ".repeat(this.indent)}}});var $n,YU=Ot(()=>{$n="4.0.0-rc.18.git.20220906.hash-fc0a563"});var yn={};sr(yn,{PackageManager:()=>cce,detectPackageManager:()=>uce,executePackageAccessibleBinary:()=>dce,executePackageScript:()=>Dk,executePackageShellcode:()=>WU,executeWorkspaceAccessibleBinary:()=>hat,executeWorkspaceLifecycleScript:()=>pce,executeWorkspaceScript:()=>gce,getPackageAccessibleBinaries:()=>Sk,getWorkspaceAccessibleBinaries:()=>hce,hasPackageScript:()=>fat,hasWorkspaceScript:()=>JU,makeScriptEnv:()=>GB,maybeExecuteWorkspaceLifecycleScript:()=>pat,prepareExternalProject:()=>uat});async function sg(t,e,r,o=[]){if(process.platform==="win32"){let a=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${o.map(n=>`"${n.replace('"','""')}"`).join(" ")} %*`;await ge.writeFilePromise(ee.format({dir:t,name:e,ext:".cmd"}),a)}await ge.writeFilePromise(ee.join(t,e),`#!/bin/sh
exec "${r}" ${o.map(a=>`'${a.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@"
`,{mode:493})}async function uce(t){let e=await Gt.tryFind(t);if(e!=null&&e.packageManager){let o=CS(e.packageManager);if(o!=null&&o.name){let a=`found ${JSON.stringify({packageManager:e.packageManager})} in manifest`,[n]=o.reference.split(".");switch(o.name){case"yarn":return{packageManager:Number(n)===1?"Yarn Classic":"Yarn",reason:a};case"npm":return{packageManager:"npm",reason:a};case"pnpm":return{packageManager:"pnpm",reason:a}}}}let r;try{r=await ge.readFilePromise(ee.join(t,Zr.lockfile),"utf8")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:"Yarn",reason:'"__metadata" key found in yarn.lock'}:{packageManager:"Yarn Classic",reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:ge.existsSync(ee.join(t,"package-lock.json"))?{packageManager:"npm",reason:`found npm's "package-lock.json" lockfile`}:ge.existsSync(ee.join(t,"pnpm-lock.yaml"))?{packageManager:"pnpm",reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function GB({project:t,locator:e,binFolder:r,lifecycleScript:o}){let a={};for(let[g,p]of Object.entries(process.env))typeof p<"u"&&(a[g.toLowerCase()!=="path"?g:"PATH"]=p);let n=de.fromPortablePath(r);a.BERRY_BIN_FOLDER=de.fromPortablePath(n);let c=process.env.COREPACK_ROOT?de.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([sg(r,"node",process.execPath),...$n!==null?[sg(r,"run",process.execPath,[c,"run"]),sg(r,"yarn",process.execPath,[c]),sg(r,"yarnpkg",process.execPath,[c]),sg(r,"node-gyp",process.execPath,[c,"run","--top-level","node-gyp"])]:[]]),t&&(a.INIT_CWD=de.cwd(),a.PROJECT_CWD=de.fromPortablePath(t.cwd)),a.PATH=a.PATH?`${n}${de.delimiter}${a.PATH}`:`${n}`,a.npm_execpath=`${n}${de.sep}yarn`,a.npm_node_execpath=`${n}${de.sep}node`,e){if(!t)throw new Error("Assertion failed: Missing project");let g=t.tryWorkspaceByLocator(e),p=g?g.manifest.version??"":t.storedPackages.get(e.locatorHash).version??"";a.npm_package_name=Cn(e),a.npm_package_version=p;let I;if(g)I=g.cwd;else{let B=t.storedPackages.get(e.locatorHash);if(!B)throw new Error(`Package for ${jr(t.configuration,e)} not found in the project`);let Q=t.configuration.getLinkers(),x={project:t,report:new St({stdout:new Lp.PassThrough,configuration:t.configuration})},y=Q.find(T=>T.supportsPackage(B,x));if(!y)throw new Error(`The package ${jr(t.configuration,B)} isn't supported by any of the available linkers`);I=await y.findPackageLocation(B,x)}a.npm_package_json=de.fromPortablePath(ee.join(I,Zr.manifest))}let f=$n!==null?`yarn/${$n}`:`yarn/${gy("@yarnpkg/core").version}-core`;return a.npm_config_user_agent=`${f} npm/? node/${process.version} ${process.platform} ${process.arch}`,o&&(a.npm_lifecycle_event=o),t&&await t.configuration.triggerHook(g=>g.setupScriptEnvironment,t,a,async(g,p,I)=>await sg(r,is(g),p,I)),a}async function uat(t,e,{configuration:r,report:o,workspace:a=null,locator:n=null}){await cat(async()=>{await ge.mktempPromise(async c=>{let f=ee.join(c,"pack.log"),g=null,{stdout:p,stderr:I}=r.getSubprocessStreams(f,{prefix:de.fromPortablePath(t),report:o}),B=n&&gc(n)?pB(n):n,Q=B?Cl(B):"an external project";p.write(`Packing ${Q} from sources
`);let x=await uce(t),y;x!==null?(p.write(`Using ${x.packageManager} for bootstrap. Reason: ${x.reason}
`),y=x.packageManager):(p.write(`No package manager configuration detected; defaulting to Yarn
`),y="Yarn"),await ge.mktempPromise(async T=>{let U=await GB({binFolder:T}),X=new Map([["Yarn Classic",async()=>{let fe=a!==null?["workspace",a]:[],me=ee.join(t,Zr.manifest),Qe=await ge.readFilePromise(me),be=await Qu(process.execPath,[process.argv[1],"set","version","classic","--only-if-needed","--yarn-path"],{cwd:t,env:U,stdin:g,stdout:p,stderr:I,end:1});if(be.code!==0)return be.code;await ge.writeFilePromise(me,Qe),await ge.appendFilePromise(ee.join(t,".npmignore"),`/.yarn
`),p.write(`
`),delete U.NODE_ENV;let Ee=await Qu("yarn",["install"],{cwd:t,env:U,stdin:g,stdout:p,stderr:I,end:1});if(Ee.code!==0)return Ee.code;p.write(`
`);let ye=await Qu("yarn",[...fe,"pack","--filename",de.fromPortablePath(e)],{cwd:t,env:U,stdin:g,stdout:p,stderr:I});return ye.code!==0?ye.code:0}],["Yarn",async()=>{let fe=a!==null?["workspace",a]:[];U.YARN_ENABLE_INLINE_BUILDS="1";let me=ee.join(t,Zr.lockfile);await ge.existsPromise(me)||await ge.writeFilePromise(me,"");let Qe=await Qu("yarn",[...fe,"pack","--install-if-needed","--filename",de.fromPortablePath(e)],{cwd:t,env:U,stdin:g,stdout:p,stderr:I});return Qe.code!==0?Qe.code:0}],["npm",async()=>{if(a!==null){let h=new Lp.PassThrough,Oe=fy(h);h.pipe(p,{end:!1});let Ie=await Qu("npm",["--version"],{cwd:t,env:U,stdin:g,stdout:h,stderr:I,end:0});if(h.end(),Ie.code!==0)return p.end(),I.end(),Ie.code;let Ce=(await Oe).toString().trim();if(!$0(Ce,">=7.x")){let ue=Eu(null,"npm"),re=_n(ue,Ce),Se=_n(ue,">=7.x");throw new Error(`Workspaces aren't supported by ${Zn(r,re)}; please upgrade to ${Zn(r,Se)} (npm has been detected as the primary package manager for ${Ar(r,t,Mt.PATH)})`)}}let fe=a!==null?["--workspace",a]:[];delete U.npm_config_user_agent,delete U.npm_config_production,delete U.NPM_CONFIG_PRODUCTION,delete U.NODE_ENV;let me=await Qu("npm",["install"],{cwd:t,env:U,stdin:g,stdout:p,stderr:I,end:1});if(me.code!==0)return me.code;let Qe=new Lp.PassThrough,be=fy(Qe);Qe.pipe(p);let Ee=await Qu("npm",["pack","--silent",...fe],{cwd:t,env:U,stdin:g,stdout:Qe,stderr:I});if(Ee.code!==0)return Ee.code;let ye=(await be).toString().trim().replace(/^.*\n/s,""),De=ee.resolve(t,de.toPortablePath(ye));return await ge.renamePromise(De,e),0}]]).get(y);if(typeof X>"u")throw new Error("Assertion failed: Unsupported workflow");let se=await X();if(!(se===0||typeof se>"u"))throw ge.detachTemp(c),new tr(58,`Packing the package failed (exit code ${se}, logs can be found here: ${Ar(r,f,Mt.PATH)})`)})})})}async function fat(t,e,{project:r}){let o=r.tryWorkspaceByLocator(t);if(o!==null)return JU(o,e);let a=r.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${jr(r.configuration,t)} not found in the project`);return await EA.openPromise(async n=>{let c=r.configuration,f=r.configuration.getLinkers(),g={project:r,report:new St({stdout:new Lp.PassThrough,configuration:c})},p=f.find(x=>x.supportsPackage(a,g));if(!p)throw new Error(`The package ${jr(r.configuration,a)} isn't supported by any of the available linkers`);let I=await p.findPackageLocation(a,g),B=new Bn(I,{baseFs:n});return(await Gt.find(Qt.dot,{baseFs:B})).scripts.has(e)},{libzip:await ya()})}async function Dk(t,e,r,{cwd:o,project:a,stdin:n,stdout:c,stderr:f}){return await ge.mktempPromise(async g=>{let{manifest:p,env:I,cwd:B}=await fce(t,{project:a,binFolder:g,cwd:o,lifecycleScript:e}),Q=p.scripts.get(e);if(typeof Q>"u")return 1;let x=async()=>await mk(Q,r,{cwd:B,env:I,stdin:n,stdout:c,stderr:f});return await(await a.configuration.reduceHook(T=>T.wrapScriptExecution,x,a,t,e,{script:Q,args:r,cwd:B,env:I,stdin:n,stdout:c,stderr:f}))()})}async function WU(t,e,r,{cwd:o,project:a,stdin:n,stdout:c,stderr:f}){return await ge.mktempPromise(async g=>{let{env:p,cwd:I}=await fce(t,{project:a,binFolder:g,cwd:o});return await mk(e,r,{cwd:I,env:p,stdin:n,stdout:c,stderr:f})})}async function gat(t,{binFolder:e,cwd:r,lifecycleScript:o}){let a=await GB({project:t.project,locator:t.anchoredLocator,binFolder:e,lifecycleScript:o});return await Promise.all(Array.from(await hce(t),([n,[,c]])=>sg(e,is(n),process.execPath,[c]))),typeof r>"u"&&(r=ee.dirname(await ge.realpathPromise(ee.join(t.cwd,"package.json")))),{manifest:t.manifest,binFolder:e,env:a,cwd:r}}async function fce(t,{project:e,binFolder:r,cwd:o,lifecycleScript:a}){let n=e.tryWorkspaceByLocator(t);if(n!==null)return gat(n,{binFolder:r,cwd:o,lifecycleScript:a});let c=e.storedPackages.get(t.locatorHash);if(!c)throw new Error(`Package for ${jr(e.configuration,t)} not found in the project`);return await EA.openPromise(async f=>{let g=e.configuration,p=e.configuration.getLinkers(),I={project:e,report:new St({stdout:new Lp.PassThrough,configuration:g})},B=p.find(U=>U.supportsPackage(c,I));if(!B)throw new Error(`The package ${jr(e.con
`,{stdout:p,stderr:I}=a.getSubprocessStreams(f,{report:o,prefix:jr(a,t.anchoredLocator),header:g});o.reportInfo(36,`Calling the "${e}" lifecycle script`);let B=await gce(t,e,[],{cwd:r,stdin:n,stdout:p,stderr:I});if(p.end(),I.end(),B!==0)throw ge.detachTemp(c),new tr(36,`${(0,Ace.default)(e)} script failed (exit code ${Ar(a,B,Mt.NUMBER)}, logs can be found here: ${Ar(a,f,Mt.PATH)}); run ${Ar(a,`yarn ${e}`,Mt.CODE)} to investigate`)})}async function pat(t,e,r){JU(t,e)&&await pce(t,e,r)}async function Sk(t,{project:e}){let r=e.configuration,o=new Map,a=e.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${jr(r,t)} not found in the project`);let n=new Lp.Writable,c=r.getLinkers(),f={project:e,report:new St({configuration:r,stdout:n})},g=new Set([t.locatorHash]);for(let I of a.dependencies.values()){let B=e.storedResolutions.get(I.descriptorHash);if(!B)throw new Error(`Assertion failed: The resolution (${Zn(r,I)}) should have been registered`);g.add(B)}let p=await Promise.all(Array.from(g,async I=>{let B=e.storedPackages.get(I);if(!B)throw new Error(`Assertion failed: The package (${I}) should have been registered`);if(B.bin.size===0)return mu.skip;let Q=c.find(y=>y.supportsPackage(B,f));if(!Q)return mu.skip;let x=null;try{x=await Q.findPackageLocation(B,f)}catch(y){if(y.code==="LOCATOR_NOT_INSTALLED")return mu.skip;throw y}return{dependency:B,packageLocation:x}}));for(let I of p){if(I===mu.skip)continue;let{dependency:B,packageLocation:Q}=I;for(let[x,y]of B.bin)o.set(x,[B,de.fromPortablePath(ee.resolve(Q,y))])}return o}async function hce(t){return await Sk(t.anchoredLocator,{project:t.project})}async function dce(t,e,r,{cwd:o,project:a,stdin:n,stdout:c,stderr:f,nodeArgs:g=[],packageAccessibleBinaries:p}){p??(p=await Sk(t,{project:a}));let I=p.get(e);if(!I)throw new Error(`Binary not found (${e}) for ${jr(a.configuration,t)}`);return await ge.mktempPromise(async B=>{let[,Q]=I,x=await GB({project:a,locator:t,binFolder:B});await Promise.all(Array.from(p,([T,[,U]])=>sg(x.BERRY_BIN_FOLDER,is(T),process.execPath,[U])));let y;try{y=await Qu(process.execPath,[...g,Q,...r],{cwd:o,env:x,stdin:n,stdout:c,stderr:f})}finally{await ge.removePromise(x.BERRY_BIN_FOLDER)}return y.code})}async function hat(t,e,r,{cwd:o,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f}){return await dce(t.anchoredLocator,e,r,{project:t.project,cwd:o,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f})}var Ace,lce,Lp,cce,lat,cat,zU=Ot(()=>{Nt();Nt();ng();Ck();Ace=Te(GU()),lce=Te(S0()),Lp=Be("stream");vy();Il();vk();YU();u4();fc();dl();xp();go();cce=(a=>(a.Yarn1="Yarn Classic",a.Yarn2="Yarn",a.Npm="npm",a.Pnpm="pnpm",a))(cce||{});lat=2,cat=(0,lce.default)(lat)});var qy=K((_Lt,Cce)=>{"use strict";var mce=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);Cce.exports=t=>t?Object.keys(t).map(e=>[mce.has(e)?mce.get(e):e,t[e]]).reduce((e,r)=>(e[r[0]]=r[1],e),Object.create(null)):{}});var jy=K((KLt,Sce)=>{"use strict";var yce=typeof process=="object"&&process?process:{stdout:null,stderr:null},dat=Be("events"),Ice=Be("stream"),Ece=Be("string_decoder").StringDecoder,og=Symbol("EOF"),ag=Symbol("maybeEmitEnd"),Op=Symbol("emittedEnd"),kk=Symbol("emittingEnd"),jB=Symbol("emittedError"),xk=Symbol("closed"),wce=Symbol("read"),Pk=Symbol("flush"),Bce=Symbol("flushChunk"),$a=Symbol("encoding"),Ag=Symbol("decoder"),bk=Symbol("flowing"),YB=Symbol("paused"),Gy=Symbol("resume"),Vs=Symbol("bufferLength"),VU=Symbol("bufferPush"),XU=Symbol("bufferShift"),Wo=Symbol("objectMode"),Jo=Symbol("destroyed"),ZU=Symbol("emitData"),Qce=Symbol("emitEnd"),$U=Symbol("emitEnd2"),lg=Symbol("async"),WB=t=>Promise.resolve().then(t),vce=global._MP_NO_ITERATOR_SYMBOLS_!=="1",mat=vce&&Symbol.asyncIterator||Symbol("asyncIterator not implem
`,a=Buffer.byteLength(o),n=Math.floor(Math.log(a)/Math.log(10))+1;return a+n>=Math.pow(10,n)&&(n+=1),n+a+o}};zB.parse=(t,e,r)=>new zB(Gat(jat(t),e),r);var Gat=(t,e)=>e?Object.keys(t).reduce((r,o)=>(r[o]=t[o],r),e):t,jat=t=>t.replace(/\n$/,"").split(`
`).reduce(Yat,Object.create(null)),Yat=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.substr((r+" ").length);let o=e.split("="),a=o.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!a)return t;let n=o.join("=");return t[a]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(a)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,t};Kce.exports=zB});var Xy=K(($Lt,Hce)=>{Hce.exports=t=>{let e=t.length-1,r=-1;for(;e>-1&&t.charAt(e)==="/";)r=e,e--;return r===-1?t:t.slice(0,r)}});var Uk=K((eOt,qce)=>{"use strict";qce.exports=t=>class extends t{warn(e,r,o={}){this.file&&(o.file=this.file),this.cwd&&(o.cwd=this.cwd),o.code=r instanceof Error&&r.code||e,o.tarCode=e,!this.strict&&o.recoverable!==!1?(r instanceof Error&&(o=Object.assign(r,o),r=r.message),this.emit("warn",o.tarCode,r,o)):r instanceof Error?this.emit("error",Object.assign(r,o)):this.emit("error",Object.assign(new Error(`${e}: ${r}`),o))}}});var D3=K((rOt,Gce)=>{"use strict";var _k=["|","<",">","?",":"],v3=_k.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),Wat=new Map(_k.map((t,e)=>[t,v3[e]])),Jat=new Map(v3.map((t,e)=>[t,_k[e]]));Gce.exports={encode:t=>_k.reduce((e,r)=>e.split(r).join(Wat.get(r)),t),decode:t=>v3.reduce((e,r)=>e.split(r).join(Jat.get(r)),t)}});var S3=K((nOt,Yce)=>{var{isAbsolute:zat,parse:jce}=Be("path").win32;Yce.exports=t=>{let e="",r=jce(t);for(;zat(t)||r.root;){let o=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":r.root;t=t.substr(o.length),e+=o,r=jce(t)}return[e,t]}});var Jce=K((iOt,Wce)=>{"use strict";Wce.exports=(t,e,r)=>(t&=4095,r&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t)});var L3=K((aOt,Aue)=>{"use strict";var tue=jy(),rue=Ok(),nue=Vy(),ku=Be("fs"),zce=Be("path"),Su=Jy(),Vat=Xy(),iue=(t,e)=>e?(t=Su(t).replace(/^\.(\/|$)/,""),Vat(e)+"/"+t):Su(t),Xat=16*1024*1024,Vce=Symbol("process"),Xce=Symbol("file"),Zce=Symbol("directory"),x3=Symbol("symlink"),$ce=Symbol("hardlink"),VB=Symbol("header"),Kk=Symbol("read"),P3=Symbol("lstat"),Hk=Symbol("onlstat"),b3=Symbol("onread"),F3=Symbol("onreadlink"),R3=Symbol("openfile"),T3=Symbol("onopenfile"),Hp=Symbol("close"),qk=Symbol("mode"),M3=Symbol("awaitDrain"),k3=Symbol("ondrain"),xu=Symbol("prefix"),eue=Symbol("hadError"),sue=Uk(),Zat=D3(),oue=S3(),aue=Jce(),Gk=sue(class extends tue{constructor(e,r){if(r=r||{},super(r),typeof e!="string")throw new TypeError("path is required");this.path=Su(e),this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=r.maxReadSize||Xat,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=Su(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,this.prefix=r.prefix?Su(r.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let o=!1;if(!this.preservePaths){let[a,n]=oue(this.path);a&&(this.path=n,o=a)}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=Zat.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=Su(r.absolute||zce.resolve(this.cwd,e)),this.path===""&&(this.path="./"),o&&this.warn("TAR_ENTRY_INFO",`stripping ${o} from absolute path`,{entry:this,path:o+this.path}),this.statCache.has(this.absolute)?this[Hk](this.statCache.get(this.absolute)):this[P3]()}emit(e,...r){return e==="error"&&(this[eue]=!0),super.emit(e,...r)}[P3](){ku.lstat(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[Hk](r)})}[Hk](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=eAt(e),this.emit("stat",e),this[Vce]()}[Vce](){switch(this.type){case"File":return this[Xce]();case"Directory":return this[Zce]();case"SymbolicLink":return this[x3]();default:return this.end()}}[qk](e){return aue(e,this.type==="Directory",this.portable)}[xu](e){return iue(e,this.prefix)}[VB](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new nue({path:
`}),f},o})});var NA={};sr(NA,{emitList:()=>jlt,emitTree:()=>mge,treeNodeToJson:()=>dge,treeNodeToTreeify:()=>hge});function hge(t,{configuration:e}){let r={},o=(a,n)=>{let c=Array.isArray(a)?a.entries():Object.entries(a);for(let[f,{label:g,value:p,children:I}]of c){let B=[];typeof g<"u"&&B.push(_D(e,g,2)),typeof p<"u"&&B.push(Ar(e,p[0],p[1])),B.length===0&&B.push(_D(e,`${f}`,2));let Q=B.join(": "),x=n[Q]={};typeof I<"u"&&o(I,x)}};if(typeof t.children>"u")throw new Error("The root node must only contain children");return o(t.children,r),r}function dge(t){let e=r=>{if(typeof r.children>"u"){if(typeof r.value>"u")throw new Error("Assertion failed: Expected a value to be set if the children are missing");return H0(r.value[0],r.value[1])}let o=Array.isArray(r.children)?r.children.entries():Object.entries(r.children??{}),a=Array.isArray(r.children)?[]:{};for(let[n,c]of o)a[n]=e(c);return typeof r.value>"u"?a:{value:H0(r.value[0],r.value[1]),children:a}};return e(t)}function jlt(t,{configuration:e,stdout:r,json:o}){let a=t.map(n=>({value:n}));mge({children:a},{configuration:e,stdout:r,json:o})}function mge(t,{configuration:e,stdout:r,json:o,separators:a=0}){if(o){let c=Array.isArray(t.children)?t.children.values():Object.values(t.children??{});for(let f of c)r.write(`${JSON.stringify(dge(f))}
`);return}let n=(0,pge.asTree)(hge(t,{configuration:e}),!1,!1);if(a>=1&&(n=n.replace(/^([├└]─)/gm,`\u2502
$1`).replace(/^│\n/,"")),a>=2)for(let c=0;c<2;++c)n=n.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3 \u2502
$2`).replace(/^│\n/,"");if(a>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");r.write(n)}var pge,Cge=Ot(()=>{pge=Te(gge());fc()});function P8(t){let e=t.indexOf("/");return e!==-1?t.slice(0,e):null}function Wlt(t){let e=t.indexOf("/");return e!==-1?t.slice(e+1):t}var yge,b8,Ylt,Xr,Ige=Ot(()=>{Nt();Nt();ng();yge=Be("crypto"),b8=Te(Be("fs"));Il();z0();dl();go();Ylt=9,Xr=class{constructor(e,{configuration:r,immutable:o=r.get("enableImmutableCache"),check:a=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.cacheId=`-${(0,yge.randomBytes)(8).toString("hex")}.tmp`;this.configuration=r,this.cwd=e,this.immutable=o,this.check=a;let n=r.get("cacheKeyOverride");if(n!==null)this.cacheKey=`${n}`;else{let c=r.get("compressionLevel"),f=c!==u0?`c${c}`:"";this.cacheKey=[Ylt,f].join("")}}static async find(e,{immutable:r,check:o}={}){let a=new Xr(e.get("cacheFolder"),{configuration:e,immutable:r,check:o});return await a.setup(),a}get mirrorCwd(){if(!this.configuration.get("enableMirror"))return null;let e=`${this.configuration.get("globalFolder")}/cache`;return e!==this.cwd?e:null}getVersionFilename(e){return`${wy(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,r){let a=Wlt(r).slice(0,10);return`${wy(e)}-${a}.zip`}getLocatorPath(e,r,o={}){var n;return this.mirrorCwd===null||((n=o.unstablePackages)==null?void 0:n.has(e.locatorHash))?ee.resolve(this.cwd,this.getVersionFilename(e)):r===null||P8(r)!==this.cacheKey?null:ee.resolve(this.cwd,this.getChecksumFilename(e,r))}getLocatorMirrorPath(e){let r=this.mirrorCwd;return r!==null?ee.resolve(r,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await ge.existsPromise(this.cwd))throw new tr(56,"Cache path does not exist.")}else{await ge.mkdirPromise(this.cwd,{recursive:!0});let e=ee.resolve(this.cwd,".gitignore");await ge.changeFilePromise(e,`/.gitignore
2022-08-27 06:35:11 +00:00
*.flock
*.tmp
2022-09-06 17:07:18 +00:00
`)}(this.mirrorCwd||!this.immutable)&&await ge.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,r,{onHit:o,onMiss:a,loader:n,...c}){var ye;let f=this.getLocatorMirrorPath(e),g=new Xn,p=()=>{let De=new Ys(null,{libzip:se}),h=ee.join(Qt.root,UO(e));return De.mkdirSync(h,{recursive:!0}),De.writeJsonSync(ee.join(h,Zr.manifest),{name:Cn(e),mocked:!0}),De},I=async(De,h=null)=>{var Ie;if(h===null&&((Ie=c.unstablePackages)==null?void 0:Ie.has(e.locatorHash)))return null;let Oe=!c.skipIntegrityCheck||!r?`${this.cacheKey}/${await hS(De)}`:r;if(h!==null){let Ce=!c.skipIntegrityCheck||!r?`${this.cacheKey}/${await hS(h)}`:r;if(Oe!==Ce)throw new tr(18,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}if(r!==null&&Oe!==r){let Ce;switch(this.check?Ce="throw":P8(r)!==P8(Oe)?Ce="update":Ce=this.configuration.get("checksumBehavior"),Ce){case"ignore":return r;case"update":return Oe;default:case"throw":throw new tr(18,"The remote archive doesn't match the expected checksum")}}return Oe},B=async De=>{if(!n)throw new Error(`Cache check required but no loader configured for ${jr(this.configuration,e)}`);let h=await n(),Oe=h.getRealPath();return h.saveAndClose(),await ge.chmodPromise(Oe,420),await I(De,Oe)},Q=async()=>{if(f===null||!await ge.existsPromise(f)){let De=await n(),h=De.getRealPath();return De.saveAndClose(),{source:"loader",path:h}}return{source:"mirror",path:f}},x=async()=>{if(!n)throw new Error(`Cache entry required but missing for ${jr(this.configuration,e)}`);if(this.immutable)throw new tr(56,`Cache entry required but missing for ${jr(this.configuration,e)}`);let{path:De,source:h}=await Q(),Oe=await I(De),Ie=this.getLocatorPath(e,Oe,c);if(!Ie)throw new Error("Assertion failed: Expected the cache path to be available");let Ce=[];h!=="mirror"&&f!==null&&Ce.push(async()=>{let re=`${f}${this.cacheId}`;await ge.copyFilePromise(De,re,b8.default.constants.COPYFILE_FICLONE),await ge.chmodPromise(re,420),await ge.renamePromise(re,f)}),(!c.mirrorWriteOnly||f===null)&&Ce.push(async()=>{let re=`${Ie}${this.cacheId}`;await ge.copyFilePromise(De,re,b8.default.constants.COPYFILE_FICLONE),await ge.chmodPromise(re,420),await ge.renamePromise(re,Ie)});let ue=c.mirrorWriteOnly?f??Ie:Ie;return await Promise.all(Ce.map(re=>re())),[!1,ue,Oe]},y=async()=>{let h=(async()=>{var Se;let Oe=this.getLocatorPath(e,r,c),Ie=Oe!==null?this.markedFiles.has(Oe)||await g.existsPromise(Oe):!1,Ce=!!((Se=c.mockedPackages)!=null&&Se.has(e.locatorHash))&&(!this.check||!Ie),ue=Ce||Ie,re=ue?o:a;if(re&&re(),ue){let Le=null,dt=Oe;return Ce||(Le=this.check?await B(dt):await I(dt)),[Ce,dt,Le]}else return x()})();this.mutexes.set(e.locatorHash,h);try{return await h}finally{this.mutexes.delete(e.locatorHash)}};for(let De;De=this.mutexes.get(e.locatorHash);)await De;let[T,U,q]=await y();T||this.markedFiles.add(U);let X,se=await ya(),fe=T?()=>p():()=>new Ys(U,{baseFs:g,libzip:se,readOnly:!0}),me=new SC(()=>UN(()=>X=fe(),De=>`Failed to open the cache entry for ${jr(this.configuration,e)}: ${De}`),ee),Qe=new ou(U,{baseFs:me,pathUtils:ee}),be=()=>{X==null||X.discardAndClose()},Ee=(ye=c.unstablePackages)!=null&&ye.has(e.locatorHash)?null:q;return[Qe,be,Ee]}}});var kx,Ege=Ot(()=>{kx=(r=>(r[r.SCRIPT=0]="SCRIPT",r[r.SHELLCODE=1]="SHELLCODE",r))(kx||{})});var Ru,wge=Ot(()=>{Il();vk();fc();Ru=class extends po{constructor({configuration:r,stdout:o,suggestInstall:a=!0}){super();this.errorCount=0;oB(this,{configuration:r}),this.configuration=r,this.stdout=o,this.suggestInstall=a}static async start(r,o){let a=new this(r);try{await o(a)}catch(n){a.reportExceptionOnce(n)}finally{await a.finalize()}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(r){}reportCacheMiss(r){}startSectionSync(r,o){return o()}async startSectionPromise(r,o){return await o()}startTimerSync(r,o,a){return(typeof o=="function"?o:a)()}async startTimerPromise(r,o,a){return await(typeof o=="function"?o:a)()}async startCacheReport(r){return await r()}reportSeparator(){}reportInfo(r,o){}reportWarning(
`)}reportProgress(r){return{...Promise.resolve().then(async()=>{for await(let{}of r);}),stop:()=>{}}}reportJson(r){}async finalize(){this.errorCount>0&&(this.stdout.write(`
`),this.stdout.write(`${Ar(this.configuration,"\u27A4","redBright")} Errors happened when preparing the environment required to run this command.
`),this.suggestInstall&&this.stdout.write(`${Ar(this.configuration,"\u27A4","redBright")} This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help.
`))}formatNameWithHyperlink(r){return jU(r,{configuration:this.configuration,json:!1})}}});function hg(){}function Jlt(t,e,r,o,a){for(var n=0,c=e.length,f=0,g=0;n<c;n++){var p=e[n];if(p.removed){if(p.value=t.join(o.slice(g,g+p.count)),g+=p.count,n&&e[n-1].added){var B=e[n-1];e[n-1]=e[n],e[n]=B}}else{if(!p.added&&a){var I=r.slice(f,f+p.count);I=I.map(function(x,y){var T=o[g+y];return T.length>x.length?T:x}),p.value=t.join(I)}else p.value=t.join(r.slice(f,f+p.count));f+=p.count,p.added||(g+=p.count)}}var Q=e[c-1];return c>1&&typeof Q.value=="string"&&(Q.added||Q.removed)&&t.equals("",Q.value)&&(e[c-2].value+=Q.value,e.pop()),e}function zlt(t){return{newPos:t.newPos,components:t.components.slice(0)}}function Vlt(t,e){if(typeof t=="function")e.callback=t;else if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function vge(t,e,r){return r=Vlt(r,{ignoreWhitespace:!0}),N8.diff(t,e,r)}function Xlt(t,e,r){return L8.diff(t,e,r)}function xx(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xx=function(e){return typeof e}:xx=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xx(t)}function F8(t){return ect(t)||tct(t)||rct(t)||nct()}function ect(t){if(Array.isArray(t))return R8(t)}function tct(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function rct(t,e){if(!!t){if(typeof t=="string")return R8(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R8(t,e)}}function R8(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function nct(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T8(t,e,r,o,a){e=e||[],r=r||[],o&&(t=o(a,t));var n;for(n=0;n<e.length;n+=1)if(e[n]===t)return r[n];var c;if(ict.call(t)==="[object Array]"){for(e.push(t),c=new Array(t.length),r.push(c),n=0;n<t.length;n+=1)c[n]=T8(t[n],e,r,o,a);return e.pop(),r.pop(),c}if(t&&t.toJSON&&(t=t.toJSON()),xx(t)==="object"&&t!==null){e.push(t),c={},r.push(c);var f=[],g;for(g in t)t.hasOwnProperty(g)&&f.push(g);for(f.sort(),n=0;n<f.length;n+=1)g=f[n],c[g]=T8(t[g],e,r,o,g);e.pop(),r.pop()}else c=t;return c}function Dge(t,e,r,o,a,n,c){c||(c={}),typeof c.context>"u"&&(c.context=4);var f=Xlt(r,o,c);if(!f)return;f.push({value:"",lines:[]});function g(q){return q.map(function(X){return" "+X})}for(var p=[],I=0,B=0,Q=[],x=1,y=1,T=function(X){var se=f[X],fe=se.lines||se.value.replace(/\n$/,"").split(`
`);if(se.lines=fe,se.added||se.removed){var me;if(!I){var Qe=f[X-1];I=x,B=y,Qe&&(Q=c.context>0?g(Qe.lines.slice(-c.context)):[],I-=Q.length,B-=Q.length)}(me=Q).push.apply(me,F8(fe.map(function(Ce){return(se.added?"+":"-")+Ce}))),se.added?y+=fe.length:x+=fe.length}else{if(I)if(fe.length<=c.context*2&&X<f.length-2){var be;(be=Q).push.apply(be,F8(g(fe)))}else{var Ee,ye=Math.min(fe.length,c.context);(Ee=Q).push.apply(Ee,F8(g(fe.slice(0,ye))));var De={oldStart:I,oldLines:x-I+ye,newStart:B,newLines:y-B+ye,lines:Q};if(X>=f.length-2&&fe.length<=c.context){var h=/\n$/.test(r),Oe=/\n$/.test(o),Ie=fe.length==0&&Q.length>De.oldLines;!h&&Ie&&r.length>0&&Q.splice(De.oldLines,0,"\\ No newline at end of file"),(!h&&!Ie||!Oe)&&Q.push("\\ No newline at end of file")}p.push(De),I=0,B=0,Q=[]}x+=fe.length,y+=fe.length}},U=0;U<f.length;U++)T(U);return{oldFileName:t,newFileName:e,oldHeader:a,newHeader:n,hunks:p}}var e4t,Bge,Qge,N8,L8,Zlt,$lt,ict,A1,M8,O8=Ot(()=>{hg.prototype={diff:function(e,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.callback;typeof o=="function"&&(a=o,o={}),this.options=o;var n=this;function c(T){return a?(setTimeout(function(){a(void 0,T)},0),!0):T}e=this.castInput(e),r=this.castInput(r),e=this.removeEmpty(this.tokenize(e)),r=this.removeEmpty(this.tokenize(r));var f=r.length,g=e.length,p=1,I=f+g;o.maxEditLength&&(I=Math.min(I,o.maxEditLength));var B=[{newPos:-1,components:[]}],Q=this.extractCommon(B[0],r,e,0);if(B[0].newPos+1>=f&&Q+1>=g)return c([{value:this.join(r),count:r.length}]);function x(){for(var T=-1*p;T<=p;T+=2){var U=void 0,q=B[T-1],X=B[T+1],se=(X?X.newPos:0)-T;q&&(B[T-1]=void 0);var fe=q&&q.newPos+1<f,me=X&&0<=se&&se<g;if(!fe&&!me){B[T]=void 0;continue}if(!fe||me&&q.newPos<X.newPos?(U=zlt(X),n.pushComponent(U.components,void 0,!0)):(U=q,U.newPos++,n.pushComponent(U.components,!0,void 0)),se=n.extractCommon(U,r,e,T),U.newPos+1>=f&&se+1>=g)return c(Jlt(n,U.components,r,e,n.useLongestToken));B[T]=U}p++}if(a)(function T(){setTimeout(function(){if(p>I)return a();x()||T()},0)})();else for(;p<=I;){var y=x();if(y)return y}},pushComponent:function(e,r,o){var a=e[e.length-1];a&&a.added===r&&a.removed===o?e[e.length-1]={count:a.count+1,added:r,removed:o}:e.push({count:1,added:r,removed:o})},extractCommon:function(e,r,o,a){for(var n=r.length,c=o.length,f=e.newPos,g=f-a,p=0;f+1<n&&g+1<c&&this.equals(r[f+1],o[g+1]);)f++,g++,p++;return p&&e.components.push({count:p}),e.newPos=f,g},equals:function(e,r){return this.options.comparator?this.options.comparator(e,r):e===r||this.options.ignoreCase&&e.toLowerCase()===r.toLowerCase()},removeEmpty:function(e){for(var r=[],o=0;o<e.length;o++)e[o]&&r.push(e[o]);return r},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};e4t=new hg;Bge=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Qge=/\S/,N8=new hg;N8.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!Qge.test(t)&&!Qge.test(e)};N8.tokenize=function(t){for(var e=t.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),r=0;r<e.length-1;r++)!e[r+1]&&e[r+2]&&Bge.test(e[r])&&Bge.test(e[r+2])&&(e[r]+=e[r+2],e.splice(r+1,2),r--);return e};L8=new hg;L8.tokenize=function(t){var e=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var o=0;o<r.length;o++){var a=r[o];o%2&&!this.options.newlineIsToken?e[e.length-1]+=a:(this.options.ignoreWhitespace&&(a=a.trim()),e.push(a))}return e};Zlt=new hg;Zlt.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)};$lt=new hg;$lt.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)};ict=Object.prototype.toString,A1=new hg;A1.useLongestToken=!0;A1.tokenize=L8.tokenize;A1.castInput=function(t){var e=this.options,r=e.undefinedReplacement,o=e.stringifyReplacer,a=o===void 0?function(n,c){return typeof c>"u"?r:c}:o;return typeof t=="string"?t:JSON.stringify(T8(t,null,null,a),a," ")};A1.equals=function(t,e){return hg.prototype.equals.call(A1,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};M8=new hg;M8.tokenize=function(t){return t.s
`;await ge.changeFilePromise(r,o,{automaticNewlines:!0}),this.manifest.raw=e}}});function Cut({project:t,allDescriptors:e,allResolutions:r,allPackages:o,accessibleLocators:a=new Set,optionalBuilds:n=new Set,peerRequirements:c=new Map,volatileDescriptors:f=new Set,report:g,tolerateMissingPackages:p=!1}){let I=new Map,B=[],Q=new Map,x=new Map,y=new Map,T=new Map,U=new Map,q=new Map(t.workspaces.map(ye=>{let De=ye.anchoredLocator.locatorHash,h=o.get(De);if(typeof h>"u"){if(p)return[De,null];throw new Error("Assertion failed: The workspace should have an associated package")}return[De,fB(h)]})),X=()=>{let ye=ge.mktempSync(),De=ee.join(ye,"stacktrace.log"),h=String(B.length+1).length,Oe=B.map((Ie,Ce)=>`${`${Ce+1}.`.padStart(h," ")} ${Cl(Ie)}
`).join("");throw ge.writeFileSync(De,Oe),ge.detachTemp(ye),new tr(45,`Encountered a stack overflow when resolving peer dependencies; cf ${de.fromPortablePath(De)}`)},se=ye=>{let De=r.get(ye.descriptorHash);if(typeof De>"u")throw new Error("Assertion failed: The resolution should have been registered");let h=o.get(De);if(!h)throw new Error("Assertion failed: The package could not be found");return h},fe=(ye,De,h,{top:Oe,optional:Ie})=>{B.length>1e3&&X(),B.push(De);let Ce=me(ye,De,h,{top:Oe,optional:Ie});return B.pop(),Ce},me=(ye,De,h,{top:Oe,optional:Ie})=>{if(a.has(De.locatorHash))return;a.add(De.locatorHash),Ie||n.delete(De.locatorHash);let Ce=o.get(De.locatorHash);if(!Ce){if(p)return;throw new Error(`Assertion failed: The package (${jr(t.configuration,De)}) should have been registered`)}let ue=[],re=[],Se=[],Le=[],dt=[];for(let _e of Array.from(Ce.dependencies.values())){if(Ce.peerDependencies.has(_e.identHash)&&Ce.locatorHash!==Oe)continue;if(Vf(_e))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");f.delete(_e.descriptorHash);let tt=Ie;if(!tt){let k=Ce.dependenciesMeta.get(Cn(_e));if(typeof k<"u"){let E=k.get(null);typeof E<"u"&&E.optional&&(tt=!0)}}let Ze=r.get(_e.descriptorHash);if(!Ze){if(p)continue;throw new Error(`Assertion failed: The resolution (${Zn(t.configuration,_e)}) should have been registered`)}let xe=q.get(Ze)||o.get(Ze);if(!xe)throw new Error(`Assertion failed: The package (${Ze}, resolved from ${Zn(t.configuration,_e)}) should have been registered`);if(xe.peerDependencies.size===0){fe(_e,xe,new Map,{top:Oe,optional:tt});continue}let Ct,We,at=new Set,ze;re.push(()=>{Ct=NO(_e,De.locatorHash),We=LO(xe,De.locatorHash),Ce.dependencies.delete(_e.identHash),Ce.dependencies.set(Ct.identHash,Ct),r.set(Ct.descriptorHash,We.locatorHash),e.set(Ct.descriptorHash,Ct),o.set(We.locatorHash,We),ue.push([xe,Ct,We])}),Se.push(()=>{ze=new Map;for(let k of We.peerDependencies.values()){let E=Ce.dependencies.get(k.identHash);if(!E&&hB(De,k)&&(ye.identHash===De.identHash?E=ye:(E=_n(De,ye.range),e.set(E.descriptorHash,E),r.set(E.descriptorHash,De.locatorHash),f.delete(E.descriptorHash))),(!E||E.range==="missing:")&&We.dependencies.has(k.identHash)){We.peerDependencies.delete(k.identHash);continue}E||(E=_n(k,"missing:")),We.dependencies.set(E.identHash,E),Vf(E)&&K0(y,E.descriptorHash).add(We.locatorHash),Q.set(E.identHash,E),E.range==="missing:"&&at.add(E.identHash),ze.set(k.identHash,h.get(k.identHash)??We.locatorHash)}We.dependencies=new Map(za(We.dependencies,([k,E])=>Cn(E)))}),Le.push(()=>{if(!o.has(We.locatorHash))return;let k=I.get(xe.locatorHash);typeof k=="number"&&k>=2&&X();let E=I.get(xe.locatorHash),S=typeof E<"u"?E+1:1;I.set(xe.locatorHash,S),fe(Ct,We,ze,{top:Oe,optional:tt}),I.set(xe.locatorHash,S-1)}),dt.push(()=>{let k=Ce.dependencies.get(_e.identHash);if(typeof k>"u")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let E=r.get(k.descriptorHash);if(typeof E>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");if(K0(U,E).add(De.locatorHash),!!o.has(We.locatorHash)){for(let S of We.peerDependencies.values()){let C=ze.get(S.identHash);if(typeof C>"u")throw new Error("Assertion failed: Expected the peer dependency ident to be registered");ly(cy(T,C),Cn(S)).push(We.locatorHash)}for(let S of at)We.dependencies.delete(S)}})}for(let _e of[...re,...Se])_e();let H;do{H=!0;for(let[_e,tt,Ze]of ue){let xe=cy(x,_e.locatorHash),Ct=da(...[...Ze.dependencies.values()].map(k=>{let E=k.range!=="missing:"?r.get(k.descriptorHash):"missing:";if(typeof E>"u")throw new Error(`Assertion failed: Expected the resolution for ${Zn(t.configuration,k)} to have been registered`);return E===Oe?`${E} (top)`:E}),tt.identHash),We=xe.get(Ct);if(typeof We>"u"){xe.set(Ct,tt);continue}if(We===tt)continue;o.delete(Ze.locatorHash),e.delete(tt.descriptorHash),r.delete(tt.descriptorHash),a.delete(Ze.locatorHash);let at=y.get(tt.descriptorHash)||[],ze=[Ce.locatorHash,...at];y.delete(tt.descriptorHash);for(let k of z
${[B,Q,x].join(`
`)}`)}async setupResolutions(){this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=ee.join(this.cwd,this.configuration.get("lockfileFilename")),r=this.configuration.get("defaultLanguageName");if(ge.existsSync(e)){let o=await ge.readFilePromise(e,"utf8");this.lockFileChecksum=ppe(o);let a=os(o);if(a.__metadata){let n=a.__metadata.version,c=a.__metadata.cacheKey;this.lockfileNeedsRefresh=n<fpe;for(let f of Object.keys(a)){if(f==="__metadata")continue;let g=a[f];if(typeof g.resolution>"u")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${f})`);let p=V0(g.resolution,!0),I=new Gt;I.load(g,{yamlCompatibilityMode:!0});let B=I.version,Q=I.languageName||r,x=g.linkType.toUpperCase(),y=g.conditions??null,T=I.dependencies,U=I.peerDependencies,q=I.dependenciesMeta,X=I.peerDependenciesMeta,se=I.bin;if(g.checksum!=null){let me=typeof c<"u"&&!g.checksum.includes("/")?`${c}/${g.checksum}`:g.checksum;this.storedChecksums.set(p.locatorHash,me)}let fe={...p,version:B,languageName:Q,linkType:x,conditions:y,dependencies:T,peerDependencies:U,dependenciesMeta:q,peerDependenciesMeta:X,bin:se};this.originalPackages.set(fe.locatorHash,fe);for(let me of f.split(put)){let Qe=kp(me);n<=6&&(Qe=this.configuration.normalizeDependency(Qe),Qe=_n(Qe,Qe.range.replace(/^patch:[^@]+@(?!npm(:|%3A))/,"$1npm%3A"))),this.storedDescriptors.set(Qe.descriptorHash,Qe),this.storedResolutions.set(Qe.descriptorHash,p.locatorHash)}}}}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let e=[this.cwd];for(;e.length>0;){let r=e;e=[];for(let o of r){if(this.workspacesByCwd.has(o))continue;let a=await this.addWorkspace(o);for(let n of a.workspacesCwds)e.push(n)}}}async addWorkspace(e){let r=new fI(e,{project:this});await r.setup();let o=this.workspacesByIdent.get(r.locator.identHash);if(typeof o<"u")throw new Error(`Duplicate workspace name ${Ts(this.configuration,r.locator)}: ${de.fromPortablePath(e)} conflicts with ${de.fromPortablePath(o.cwd)}`);return this.workspaces.push(r),this.workspacesByCwd.set(e,r),this.workspacesByIdent.set(r.locator.identHash,r),r}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){ee.isAbsolute(e)||(e=ee.resolve(this.cwd,e)),e=ee.normalize(e).replace(/\/+$/,"");let r=this.workspacesByCwd.get(e);return r||null}getWorkspaceByCwd(e){let r=this.tryWorkspaceByCwd(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByFilePath(e){let r=null;for(let o of this.workspaces)ee.relative(o.cwd,e).startsWith("../")||r&&r.cwd.length>=o.cwd.length||(r=o);return r||null}getWorkspaceByFilePath(e){let r=this.tryWorkspaceByFilePath(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByIdent(e){let r=this.workspacesByIdent.get(e.identHash);return typeof r>"u"?null:r}getWorkspaceByIdent(e){let r=this.tryWorkspaceByIdent(e);if(!r)throw new Error(`Workspace not found (${Ts(this.configuration,e)})`);return r}tryWorkspaceByDescriptor(e){let r=this.tryWorkspaceByIdent(e);return r===null||(Vf(e)&&(e=gB(e)),!r.accepts(e.range))?null:r}getWorkspaceByDescriptor(e){let r=this.tryWorkspaceByDescriptor(e);if(r===null)throw new Error(`Workspace not found (${Zn(this.configuration,e)})`);return r}tryWorkspaceByLocator(e){let r=this.tryWorkspaceByIdent(e);return r===null||(gc(e)&&(e=pB(e)),r.locator.locatorHash!==e.locatorHash&&r.anchoredLocator.locatorHash!==e.locatorHash)?null:r}getWorkspaceByLocator(e){let r=this.tryWorkspaceByLocator(e);if(!r)throw new Error(`Workspace not found (${jr(this.configuration,e)})`);return r}refreshWorkspaceDependencies(){for(let e of this.workspaces){let r=this.storedPackages.get(e.anchoredLocator.locatorHash);if(!r)throw new Error(`Assertion failed: Expected workspace ${yB(this.configuration,e)} (${Ar(this.configuration,ee.join(e.cwd,Zr.manifest),Mt.PATH)}) to have been resolved. Run "yarn install" to update the lockfile`);e.dependencies=new Map(r.dependencies)}}forgetResolution(e){let r=a=>{this.storedRes
`;switch(_e){case 0:Ze+=`# Script name: ${tt}
`;break;case 1:Ze+=`# Script code: ${tt}
`;break}let xe=null;if(!await ge.mktempPromise(async We=>{let at=ee.join(We,"build.log"),{stdout:ze,stderr:k}=this.configuration.getSubprocessStreams(at,{header:Ze,prefix:jr(this.configuration,re),report:r}),E;try{switch(_e){case 0:E=await Dk(re,tt,[],{cwd:H,project:this,stdin:xe,stdout:ze,stderr:k});break;case 1:E=await WU(re,tt,[],{cwd:H,project:this,stdin:xe,stdout:ze,stderr:k});break}}catch(C){k.write(C.stack),E=1}if(ze.end(),k.end(),E===0)return ye.set(re.locatorHash,dt),!0;ge.detachTemp(We);let S=`${jr(this.configuration,re)} couldn't be built successfully (exit code ${Ar(this.configuration,E,Mt.NUMBER)}, logs can be found here: ${Ar(this.configuration,at,Mt.PATH)})`;return this.optionalBuilds.has(re.locatorHash)?(r.reportInfo(9,S),ye.set(re.locatorHash,dt),!0):(r.reportError(9,S),!1)}))return}})())}}if(await cc(Ce),Ie===se.size){let ue=Array.from(se).map(re=>{let Se=this.storedPackages.get(re);if(!Se)throw new Error("Assertion failed: The package should have been registered");return jr(this.configuration,Se)}).join(", ");r.reportError(3,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${ue})`);break}}this.storedBuildState=ye}async install(e){var f,g;let r=this.configuration.get("nodeLinker");(f=rt.telemetry)==null||f.reportInstall(r),await e.report.startTimerPromise("Project validation",{skipIfEmpty:!0},async()=>{await this.configuration.triggerHook(p=>p.validateProject,this,{reportWarning:e.report.reportWarning.bind(e.report),reportError:e.report.reportError.bind(e.report)})});for(let p of this.configuration.packageExtensions.values())for(let[,I]of p)for(let B of I)B.status="inactive";let o=ee.join(this.cwd,this.configuration.get("lockfileFilename")),a=null;if(e.immutable)try{a=await ge.readFilePromise(o,"utf8")}catch(p){throw p.code==="ENOENT"?new tr(28,"The lockfile would have been created by this install, which is explicitly forbidden."):p}await e.report.startTimerPromise("Resolution step",async()=>{await this.resolveEverything(e)}),await e.report.startTimerPromise("Post-resolution validation",{skipIfEmpty:!0},async()=>{for(let[,p]of this.configuration.packageExtensions)for(let[,I]of p)for(let B of I)if(B.userProvided){let Q=Ar(this.configuration,B,Mt.PACKAGE_EXTENSION);switch(B.status){case"inactive":e.report.reportWarning(68,`${Q}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case"redundant":e.report.reportWarning(69,`${Q}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(a!==null){let p=c0(a,this.generateLockfile());if(p!==a){let I=Dge(o,o,a,p,void 0,void 0,{maxEditLength:100});if(I){e.report.reportSeparator();for(let B of I.hunks){e.report.reportInfo(null,`@@ -${B.oldStart},${B.oldLines} +${B.newStart},${B.newLines} @@`);for(let Q of B.lines)Q.startsWith("+")?e.report.reportError(28,Ar(this.configuration,Q,Mt.ADDED)):Q.startsWith("-")?e.report.reportError(28,Ar(this.configuration,Q,Mt.REMOVED)):e.report.reportInfo(null,Ar(this.configuration,Q,"grey"))}e.report.reportSeparator()}throw new tr(28,"The lockfile would have been modified by this install, which is explicitly forbidden.")}}});for(let p of this.configuration.packageExtensions.values())for(let[,I]of p)for(let B of I)B.userProvided&&B.status==="active"&&((g=rt.telemetry)==null||g.reportPackageExtension(H0(B,Mt.PACKAGE_EXTENSION)));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(e),(typeof e.persistProject>"u"||e.persistProject)&&e.mode!=="update-lockfile"&&await this.cacheCleanup(e)});let n=e.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],c=await Promise.all(n.map(async p=>dS(p,{cwd:this.cwd})));(typeof e.persistProject>"u"||e.persistProject)&&await this.persist(),await e.report.startTimerPromise("Link step",async()=>{if(e.mode==="update-lockfile"){e.report.reportWarning(73,`Skipped due to ${Ar(this.configuration,"mode=update-lockfile",Mt.CODE)}`);return}await this.linkEverything
2022-08-27 06:35:11 +00:00
`,`# Manual changes might be lost - proceed with caution!
`].join("")}
2022-09-06 17:07:18 +00:00
`+Ya(r)}async persistLockfile(){let e=ee.join(this.cwd,this.configuration.get("lockfileFilename")),r="";try{r=await ge.readFilePromise(e,"utf8")}catch{}let o=this.generateLockfile(),a=c0(r,o);a!==r&&(await ge.writeFilePromise(e,a),this.lockFileChecksum=ppe(a),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let c of Object.values(j8))e.push(...c);let r=(0,Mx.default)(this,e),o=W8.default.serialize(r),a=da(o);if(this.installStateChecksum===a)return;let n=this.configuration.get("installStatePath");await ge.mkdirPromise(ee.dirname(n),{recursive:!0}),await ge.writeFilePromise(n,await dut(o)),this.installStateChecksum=a}async restoreInstallState({restoreLinkersCustomData:e=!0,restoreResolutions:r=!0,restoreBuildState:o=!0}={}){let a=this.configuration.get("installStatePath"),n;try{let c=await mut(await ge.readFilePromise(a));n=W8.default.deserialize(c),this.installStateChecksum=da(c)}catch{r&&await this.applyLightResolution();return}e&&typeof n.linkersCustomData<"u"&&(this.linkersCustomData=n.linkersCustomData),o&&Object.assign(this,(0,Mx.default)(n,j8.restoreBuildState)),r&&(n.lockFileChecksum===this.lockFileChecksum?(Object.assign(this,(0,Mx.default)(n,j8.restoreResolutions)),this.refreshWorkspaceDependencies()):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new Yi}),await this.persistInstallStateFile()}async persist(){await this.persistLockfile();for(let e of this.workspacesByCwd.values())await e.persistManifest()}async cacheCleanup({cache:e,report:r}){if(this.configuration.get("enableGlobalCache"))return;let o=new Set([".gitignore"]);if(!zO(e.cwd,this.cwd)||!await ge.existsPromise(e.cwd))return;let a=this.configuration.get("preferAggregateCacheInfo"),n=0,c=null;for(let f of await ge.readdirPromise(e.cwd)){if(o.has(f))continue;let g=ee.resolve(e.cwd,f);e.markedFiles.has(g)||(c=f,e.immutable?r.reportError(56,`${Ar(this.configuration,ee.basename(g),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):(a?n+=1:r.reportInfo(19,`${Ar(this.configuration,ee.basename(g),"magenta")} appears to be unused - removing`),await ge.removePromise(g)))}a&&n!==0&&r.reportInfo(19,n>1?`${n} packages appeared to be unused and were removed`:`${c} appeared to be unused and was removed`)}}});var gI,Cpe=Ot(()=>{Nt();z0();kU();dl();gI=class{constructor(e,r){this.values=new Map;this.hits=new Map;this.enumerators=new Map;this.configuration=e;let o=this.getRegistryPath();this.isNew=!ge.existsSync(o),this.sendReport(r),this.startBuffer()}reportVersion(e){this.reportValue("version",e.replace(/-git\..*/,"-git"))}reportCommandName(e){this.reportValue("commandName",e||"<none>")}reportPluginName(e){this.reportValue("pluginName",e)}reportProject(e){this.reportEnumerator("projectCount",e)}reportInstall(e){this.reportHit("installCount",e)}reportPackageExtension(e){this.reportValue("packageExtension",e)}reportWorkspaceCount(e){this.reportValue("workspaceCount",String(e))}reportDependencyCount(e){this.reportValue("dependencyCount",String(e))}reportValue(e,r){K0(this.values,e).add(r)}reportEnumerator(e,r){K0(this.enumerators,e).add(da(r))}reportHit(e,r="*"){let o=cy(this.hits,e),a=Gf(o,r,()=>0);o.set(r,a+1)}getRegistryPath(){let e=this.configuration.get("globalFolder");return ee.join(e,"telemetry.json")}sendReport(e){let r=this.getRegistryPath(),o;try{o=ge.readJsonSync(r)}catch{o={}}let a=Date.now(),n=this.configuration.get("telemetryInterval")*24*60*60*1e3,f=(o.lastUpdate??a+n+Math.floor(n*Math.random()))+n;if(f>a&&o.lastUpdate!=null)return;try{ge.mkdirSync(ee.dirname(r),{recursive:!0}),ge.writeJsonSync(r,{lastUpdate:a})}catch{return}if(f>a||!o.blocks)return;let g=`https://browser-http-intake.logs.datadoghq.eu/v1/input/${e}?ddsource=yarn`,p=I=>SU(g,I,{configuration:this.configuration}).catch(()=>{});for(let[I,B]of Object.entries(o.blocks??{})){if(Object.keys(B).length===0)continue;let Q=B;Q.userId=I,Q.reportType="primary";for(let T of Object.keys(Q.enumerators??{}))Q.enumerators[T]=Q.enumerators[T].length;p(Q);let x=new Map,y=
`),p=c.length;for(p>0&&c.includes("unstyle")&&(c=[...new Set(["unstyle",...c])].reverse());p-- >0;)f=r(t.styles[c[p]],f,g);return f},a=(n,c,f)=>{t.styles[n]=e({name:n,codes:c}),(t.keys[f]||(t.keys[f]=[])).push(n),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(p){t.alias(n,p)},get(){let p=I=>o(I,p.stack);return Reflect.setPrototypeOf(p,t),p.stack=this.stack?this.stack.concat(n):[n],p}})};return a("reset",[0,0],"modifier"),a("bold",[1,22],"modifier"),a("dim",[2,22],"modifier"),a("italic",[3,23],"modifier"),a("underline",[4,24],"modifier"),a("inverse",[7,27],"modifier"),a("hidden",[8,28],"modifier"),a("strikethrough",[9,29],"modifier"),a("black",[30,39],"color"),a("red",[31,39],"color"),a("green",[32,39],"color"),a("yellow",[33,39],"color"),a("blue",[34,39],"color"),a("magenta",[35,39],"color"),a("cyan",[36,39],"color"),a("white",[37,39],"color"),a("gray",[90,39],"color"),a("grey",[90,39],"color"),a("bgBlack",[40,49],"bg"),a("bgRed",[41,49],"bg"),a("bgGreen",[42,49],"bg"),a("bgYellow",[43,49],"bg"),a("bgBlue",[44,49],"bg"),a("bgMagenta",[45,49],"bg"),a("bgCyan",[46,49],"bg"),a("bgWhite",[47,49],"bg"),a("blackBright",[90,39],"bright"),a("redBright",[91,39],"bright"),a("greenBright",[92,39],"bright"),a("yellowBright",[93,39],"bright"),a("blueBright",[94,39],"bright"),a("magentaBright",[95,39],"bright"),a("cyanBright",[96,39],"bright"),a("whiteBright",[97,39],"bright"),a("bgBlackBright",[100,49],"bgBright"),a("bgRedBright",[101,49],"bgBright"),a("bgGreenBright",[102,49],"bgBright"),a("bgYellowBright",[103,49],"bgBright"),a("bgBlueBright",[104,49],"bgBright"),a("bgMagentaBright",[105,49],"bgBright"),a("bgCyanBright",[106,49],"bgBright"),a("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=Dut,t.hasColor=t.hasAnsi=n=>(t.ansiRegex.lastIndex=0,typeof n=="string"&&n!==""&&t.ansiRegex.test(n)),t.alias=(n,c)=>{let f=typeof c=="string"?t[c]:c;if(typeof f!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");f.stack||(Reflect.defineProperty(f,"name",{value:n}),t.styles[n]=f,f.stack=[n]),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(g){t.alias(n,g)},get(){let g=p=>o(p,g.stack);return Reflect.setPrototypeOf(g,t),g.stack=this.stack?this.stack.concat(f.stack):f.stack,g}})},t.theme=n=>{if(!vut(n))throw new TypeError("Expected theme to be an object");for(let c of Object.keys(n))t.alias(c,n[c]);return t},t.alias("unstyle",n=>typeof n=="string"&&n!==""?(t.ansiRegex.lastIndex=0,n.replace(t.ansiRegex,"")):""),t.alias("noop",n=>n),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=vpe(),t.define=a,t};$8.exports=Dpe();$8.exports.create=Dpe});var Vo=K(pn=>{"use strict";var Sut=Object.prototype.toString,Pl=Cc(),Spe=!1,e_=[],kpe={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};pn.longest=(t,e)=>t.reduce((r,o)=>Math.max(r,e?o[e].length:o.length),0);pn.hasColor=t=>!!t&&Pl.hasColor(t);var _x=pn.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);pn.nativeType=t=>Sut.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"");pn.isAsyncFn=t=>pn.nativeType(t)==="asyncfunction";pn.isPrimitive=t=>t!=null&&typeof t!="object"&&typeof t!="function";pn.resolve=(t,e,...r)=>typeof e=="function"?e.call(t,...r):e;pn.scrollDown=(t=[])=>[...t.slice(1),t[0]];pn.scrollUp=(t=[])=>[t.pop(),...t];pn.reorder=(t=[])=>{let e=t.slice();return e.sort((r,o)=>r.index>o.index?1:r.index<o.index?-1:0),e};pn.swap=(t,e,r)=>{let o=t.length,a=r===o?0:r<0?o-1:r,n=t[e];t[e]=t[a],t[a]=n};pn.width=(t,e=80)=>{let r=t&&t.columns?t.columns:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[0]),process.platform==="win32"?r-1:r};pn.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[1]),r};pn.wordWrap=(t,e={})=>{if(!t)return t;typeof e=="number"&&(e={width:e});let{indent:r="",newline:o=`
`+r,width:a=80}=e;a-=((o+r).match(/[^\S\n]/g)||[]).length;let c=`.{1,${a}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,f=t.trim(),g=new RegExp(c,"g"),p=f.match(g)||[];return p=p.map(I=>I.replace(/\n$/,"")),e.padEnd&&(p=p.map(I=>I.padEnd(a," "))),e.padStart&&(p=p.map(I=>I.padStart(a," "))),r+p.join(o)};pn.unmute=t=>{let e=t.stack.find(o=>Pl.keys.color.includes(o));return e?Pl[e]:t.stack.find(o=>o.slice(2)==="bg")?Pl[e.slice(2)]:o=>o};pn.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"";pn.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(o=>Pl.keys.color.includes(o));if(e){let o=Pl["bg"+pn.pascal(e)];return o?o.black:t}let r=t.stack.find(o=>o.slice(0,2)==="bg");return r?Pl[r.slice(2).toLowerCase()]||t:Pl.none};pn.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(o=>Pl.keys.color.includes(o)),r=t.stack.find(o=>o.slice(0,2)==="bg");if(e&&!r)return Pl[kpe[e]||e];if(r){let o=r.slice(2).toLowerCase(),a=kpe[o];return a&&Pl["bg"+pn.pascal(a)]||t}return Pl.none};pn.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),o=e>=12?"pm":"am";e=e%12;let a=e===0?12:e,n=r<10?"0"+r:r;return a+":"+n+" "+o};pn.set=(t={},e="",r)=>e.split(".").reduce((o,a,n,c)=>{let f=c.length-1>n?o[a]||{}:r;return!pn.isObject(f)&&n<c.length-1&&(f={}),o[a]=f},t);pn.get=(t={},e="",r)=>{let o=t[e]==null?e.split(".").reduce((a,n)=>a&&a[n],t):t[e];return o??r};pn.mixin=(t,e)=>{if(!_x(t))return e;if(!_x(e))return t;for(let r of Object.keys(e)){let o=Object.getOwnPropertyDescriptor(e,r);if(o.hasOwnProperty("value"))if(t.hasOwnProperty(r)&&_x(o.value)){let a=Object.getOwnPropertyDescriptor(t,r);_x(a.value)?t[r]=pn.merge({},t[r],e[r]):Reflect.defineProperty(t,r,o)}else Reflect.defineProperty(t,r,o);else Reflect.defineProperty(t,r,o)}return t};pn.merge=(...t)=>{let e={};for(let r of t)pn.mixin(e,r);return e};pn.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let o of Object.keys(r)){let a=r[o];typeof a=="function"?pn.define(t,o,a.bind(e)):pn.define(t,o,a)}};pn.onExit=t=>{let e=(r,o)=>{Spe||(Spe=!0,e_.forEach(a=>a()),r===!0&&process.exit(128+o))};e_.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),e_.push(t)};pn.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};pn.defineExport=(t,e,r)=>{let o;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(a){o=a},get(){return o?o():r()}})}});var xpe=K(dI=>{"use strict";dI.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};dI.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};dI.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};dI.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};dI.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var Fpe=K((ZUt,bpe)=>{"use strict";var Ppe=Be("readline"),kut=xpe(),xut=/^(?:\x1b)([a-zA-Z0-9])$/,Put=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,but={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2
`)o.name="enter";else if(t===" ")o.name="tab";else if(t==="\b"||t==="\x7F"||t==="\x1B\x7F"||t==="\x1B\b")o.name="backspace",o.meta=t.charAt(0)==="\x1B";else if(t==="\x1B"||t==="\x1B\x1B")o.name="escape",o.meta=t.length===2;else if(t===" "||t==="\x1B ")o.name="space",o.meta=t.length===2;else if(t<="")o.name=String.fromCharCode(t.charCodeAt(0)+"a".charCodeAt(0)-1),o.ctrl=!0;else if(t.length===1&&t>="0"&&t<="9")o.name="number";else if(t.length===1&&t>="a"&&t<="z")o.name=t;else if(t.length===1&&t>="A"&&t<="Z")o.name=t.toLowerCase(),o.shift=!0;else if(r=xut.exec(t))o.meta=!0,o.shift=/^[A-Z]$/.test(r[1]);else if(r=Put.exec(t)){let a=[...t];a[0]==="\x1B"&&a[1]==="\x1B"&&(o.option=!0);let n=[r[1],r[2],r[4],r[6]].filter(Boolean).join(""),c=(r[3]||r[5]||1)-1;o.ctrl=!!(c&4),o.meta=!!(c&10),o.shift=!!(c&1),o.code=n,o.name=but[n],o.shift=Fut(n)||o.shift,o.ctrl=Rut(n)||o.ctrl}return o};Kx.listen=(t={},e)=>{let{stdin:r}=t;if(!r||r!==process.stdin&&!r.isTTY)throw new Error("Invalid stream passed");let o=Ppe.createInterface({terminal:!0,input:r});Ppe.emitKeypressEvents(r,o);let a=(f,g)=>e(f,Kx(f,g),o),n=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on("keypress",a),o.resume(),()=>{r.isTTY&&r.setRawMode(n),r.removeListener("keypress",a),o.pause(),o.close()}};Kx.action=(t,e,r)=>{let o={...kut,...r};return e.ctrl?(e.action=o.ctrl[e.name],e):e.option&&o.option?(e.action=o.option[e.name],e):e.shift?(e.action=o.shift[e.name],e):(e.action=o.keys[e.name],e)};bpe.exports=Kx});var Tpe=K(($Ut,Rpe)=>{"use strict";Rpe.exports=t=>{t.timers=t.timers||{};let e=t.options.timers;if(!!e)for(let r of Object.keys(e)){let o=e[r];typeof o=="number"&&(o={interval:o}),Tut(t,r,o)}};function Tut(t,e,r={}){let o=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},a=r.interval||120;o.frames=r.frames||[],o.loading=!0;let n=setInterval(()=>{o.ms=Date.now()-o.start,o.tick++,t.render()},a);return o.stop=()=>{o.loading=!1,clearInterval(n)},Reflect.defineProperty(o,"interval",{value:n}),t.once("close",()=>o.stop()),o.stop}});var Npe=K((e3t,Mpe)=>{"use strict";var{define:Mut,width:Nut}=Vo(),t_=class{constructor(e){let r=e.options;Mut(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=Nut(r.stdout||process.stdout),Object.assign(this,r),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e={...this};return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let r=this._color||e[this.status];return typeof r=="function"?r:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};Mpe.exports=t_});var Ope=K((t3t,Lpe)=>{"use strict";var r_=Vo(),mo=Cc(),n_={default:mo.noop,noop:mo.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||r_.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||r_.complement(this.primary)},primary:mo.cyan,success:mo.green,danger:mo.magenta,strong:mo.bold,warning:mo.yellow,muted:mo.dim,disabled:mo.gray,dark:mo.dim.gray,underline:mo.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typin
`),p=g[0],I=g[g.length-1],Q=(o+(r?" "+r:"")).length,x=Q<p.length?p.slice(Q+1):"";return{header:c,prompt:p,after:x,rest:g.slice(1),last:I}}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=`
2022-08-27 06:35:11 +00:00
`+this.symbols.pointer+" ";typeof e=="string"?r+=e.trim():r+="Invalid input",this.state.error=`
2022-09-06 17:07:18 +00:00
`+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(yd.cursor.down(e.rest.length)),this.write(`
`.repeat(r))}catch{}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=l_.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:o}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>o.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 a=r.onSubmit.bind(this),n=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await a(this.name,this.value,this),n())}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,o){let{options:a,state:n,symbols:c,timers:f}=this,g=f&&f[e];n.timer=g;let p=a[e]||n[e]||c[e],I=r&&r[e]!=null?r[e]:await p;if(I==="")return I;let B=await this.resolve(I,n,r,o);return!B&&r&&r[e]?this.resolve(p,n,r,o):B}async prefix(){let e=await this.element("prefix")||this.symbols,r=this.timers&&this.timers.prefix,o=this.state;return o.timer=r,rA.isObject(e)&&(e=e[o.status]||e.pending),rA.hasColor(e)?e:(this.styles[o.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return rA.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,r=this.timers&&this.timers.separator,o=this.state;o.timer=r;let a=e[o.status]||e.pending||o.separator,n=await this.resolve(a,o);return rA.isObject(n)&&(n=n[o.status]||n.pending),rA.hasColor(n)?n:this.styles.muted(n)}async pointer(e,r){let o=await this.element("pointer",e,r);if(typeof o=="string"&&rA.hasColor(o))return o;if(o){let a=this.styles,n=this.index===r,c=n?a.primary:p=>p,f=await this.resolve(o[n?"on":"off"]||o,this.state),g=rA.hasColor(f)?f:c(f);return n?g:" ".repeat(f.length)}}async indicator(e,r){let o=await this.element("indicator",e,r);if(typeof o=="string"&&rA.hasColor(o))return o;if(o){let a=this.styles,n=e.enabled===!0,c=n?a.success:a.dark,f=o[n?"on":"off"]||o;return rA.hasColor(f)?f:c(f)}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 rA.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 rA.resolve(this,e,...r)}get base(){return g1.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||rA.height(this.stdout,25)}get width(){return this.options.columns||rA.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,o=[r,e].find(this.isValue.bind(this));return this.isValue(o)?o:this.initial}static get prompt(){return e=>new this(e).run()}};function Yut(t){let e=a=>t[a]===void 0||typeof t[a]=="function",r=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],o=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let a of Object.keys(t.options)){if(r.includes(a)||/^on[A-Z]/.test(a))continue;let n=t.options[a];typeof n=="function"&&e(a)?o.includes(a)||(t[a]=n.bind(t)):typeof t[a]!="function"&&(t[a]=n)}}function Wut(t){t
`:" ",o=[];for(let a=0;a<4;a++){let n=r(a);e[a]?o.push(n.repeat(e[a])):o.push("")}return o}zpe.exports=g1});var Zpe=K((s3t,Xpe)=>{"use strict";var Jut=Vo(),Vpe={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 Vpe.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}};Xpe.exports=(t,e={})=>{let r=Jut.merge({},Vpe,e.roles);return r[t]||r.default}});var p1=K((o3t,the)=>{"use strict";var zut=Cc(),Vut=mI(),Xut=Zpe(),Hx=Vo(),{reorder:c_,scrollUp:Zut,scrollDown:$ut,isObject:$pe,swap:eft}=Hx,u_=class extends Vut{constructor(e){super(e),this.cursorHide(),this.maxSelected=e.maxSelected||1/0,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:o,suggest:a}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(n=>n.enabled=!1),typeof a!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");$pe(r)&&(r=Object.keys(r)),Array.isArray(r)?(o!=null&&(this.index=this.findIndex(o)),r.forEach(n=>this.enable(this.find(n))),await this.render()):(o!=null&&(r=o),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 o=[],a=0,n=async(c,f)=>{typeof c=="function"&&(c=await c.call(this)),c instanceof Promise&&(c=await c);for(let g=0;g<c.length;g++){let p=c[g]=await this.toChoice(c[g],a++,f);o.push(p),p.choices&&await n(p.choices,p)}return o};return n(e,r).then(c=>(this.state.loadingChoices=!1,c))}async toChoice(e,r,o){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 a=e.value;if(e=Xut(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,Hx.define(e,"parent",o),e.level=o?o.level+1:1,e.indent==null&&(e.indent=o?o.indent+" ":e.indent||""),e.path=o?o.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,zut.unstyle(e.message).length));let c={...e};return e.reset=(f=c.input,g=c.value)=>{for(let p of Object.keys(c))e[p]=c[p];e.input=f,e.value=g},a==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,o){let a=await this.toChoice(e,r,o);return this.choices.push(a),this.index=this.choices.length-1,this.limit=this.choices.length,a}async newItem(e,r,o){let a={name:"New choice name?",editable:!0,newChoice:!0,...e},n=await this.addChoice(a,r,o);return n.updateChoice=()=>{delete n.newChoice,n.name=n.message=n.input,n.input="",n.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,r){if(thi
`),a;return this.options.choicesHeader&&(a=await this.resolve(this.options.choicesHeader,this.state)),[a,o].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,o="",a=await this.header(),n=await this.prefix(),c=await this.separator(),f=await this.message();this.options.promptLine!==!1&&(o=[n,f,c,""].join(" "),this.state.prompt=o);let g=await this.format(),p=await this.error()||await this.hint(),I=await this.renderChoices(),B=await this.footer();g&&(o+=g),p&&!o.includes(p)&&(o+=" "+p),e&&!g&&!I.trim()&&this.multiple&&this.emptyError!=null&&(o+=this.styles.danger(this.emptyError)),this.clear(r),this.write([a,o,I,B].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};rhe.exports=g_});var ihe=K((A3t,nhe)=>{"use strict";var rft=Zp(),nft=(t,e)=>{let r=t.toLowerCase();return o=>{let n=o.toLowerCase().indexOf(r),c=e(o.slice(n,n+r.length));return n>=0?o.slice(0,n)+c+o.slice(n+r.length):o}},p_=class extends rft{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:o}=this.state;return this.input=o.slice(0,r)+e+o.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 o=e.toLowerCase();return r.filter(a=>a.message.toLowerCase().includes(o))}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=nft(this.input,e),o=this.choices;this.choices=o.map(a=>({...a,message:r(a.message)})),await super.render(),this.choices=o}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};nhe.exports=p_});var d_=K((l3t,she)=>{"use strict";var h_=Vo();she.exports=(t,e={})=>{t.cursorHide();let{input:r="",initial:o="",pos:a,showCursor:n=!0,color:c}=e,f=c||t.styles.placeholder,g=h_.inverse(t.styles.primary),p=T=>g(t.styles.black(T)),I=r,B=" ",Q=p(B);if(t.blink&&t.blink.off===!0&&(p=T=>T,Q=""),n&&a===0&&o===""&&r==="")return p(B);if(n&&a===0&&(r===o||r===""))return p(o[0])+f(o.slice(1));o=h_.isPrimitive(o)?`${o}`:"",r=h_.isPrimitive(r)?`${r}`:"";let x=o&&o.startsWith(r)&&o!==r,y=x?p(o[r.length]):Q;if(a!==r.length&&n===!0&&(I=r.slice(0,a)+p(r[a])+r.slice(a+1),y=""),n===!1&&(y=""),x){let T=t.styles.unstyle(I+y);return I+y+f(o.slice(T.length))}return I+y}});var qx=K((c3t,ohe)=>{"use strict";var ift=Cc(),sft=Zp(),oft=d_(),m_=class extends sft{constructor(e){super({...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:o,input:a}=r;return r.value=r.input=a.slice(0,o)+e+a.slice(o),r.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:r,input:o}=e;return e.value=e.input=o.slice(0,r-1)+o.slice(r),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:r,input:o}=e;if(o[r]===void 0)return this.alert();let a=`${o}`.slice(0,r)+`${o}`.slice(r+1);return e.value=e.input=a,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:o}=e;return r&&r.startsWith(o)&&o!
`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};fhe.exports=y_});var phe=K((p3t,ghe)=>{"use strict";var pft=Gx(),I_=class extends pft{constructor(e){super(e),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};ghe.exports=I_});var dhe=K((h3t,hhe)=>{"use strict";var hft=Zp(),dft=qx(),CI=dft.prototype,E_=class extends hft{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,"left"].find(r=>r!=null),this.emptyError="",this.values={}}dispatch(e,r){let o=this.focused,a=o.parent||{};return!o.editable&&!a.editable&&(e==="a"||e==="i")?super[e]():CI.dispatch.call(this,e,r)}append(e,r){return CI.append.call(this,e,r)}delete(e,r){return CI.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?CI.next.call(this):super.next()}prev(){return this.focused.editable?CI.prev.call(this):super.prev()}async indicator(e,r){let o=e.indicator||"",a=e.editable?o:super.indicator(e,r);return await this.resolve(a,this.state,e,r)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,r){return e.indent="",e.editable?CI.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 o=r.parent?this.value[r.parent.name]:this.value;if(r.editable?o=r.value===r.name?r.initial||"":r.value:this.isDisabled(r)||(o=r.enabled===!0),e=await r.validate(o,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)}};hhe.exports=E_});var Id=K((d3t,mhe)=>{"use strict";var mft=mI(),Cft=d_(),{isPrimitive:yft}=Vo(),w_=class extends mft{constructor(e){super(e),this.initial=yft(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,r={}){let o=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name==="return"&&(!o||o.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:o}=this.state;this.input=`${o}`.slice(0,r)+e+`${o}`.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),o=this.input.slice(e),a=r.split(" ");this.state.clipboard.push(a.pop()),this.input=a.join(" "),this.cursor=this.input.length,this.input+=o,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):Cft(this,{input:e,initial:r,pos:this.cursor})}async render(){let e=this.state.size,r=await this.prefix(),o=await this.separator(),a=await this.message(),n=[r,a,o].filter(Boolean).join(" ");this.state.prompt=n;let c=await this.header(),f=await this.format(),g=await this.error()||await this.hint(),p=await this.footer();g&&!f.includes(g)&&(f+=" "+g),n+=" "+f,this.clear(e),this.write([c,n,p].filter(Boolean).join(`
`)),this.restore()}};mhe.exports=w_});var yhe=K((m3t,Che)=>{"use strict";var Ift=t=>t.filter((e,r)=>t.lastIndexOf(e)===r),jx=t=>Ift(t).filter(Boolean);Che.exports=(t,e={},r="")=>{let{past:o=[],present:a=""}=e,n,c;switch(t){case"prev":case"undo":return n=o.slice(0,o.length-1),c=o[o.length-1]||"",{past:jx([r,...n]),present:c};case"next":case"redo":return n=o.slice(1),c=o[0]||"",{past:jx([...n,r]),present:c};case"save":return{past:jx([...o,r]),present:""};case"remove":return c=jx(o.filter(f=>f!==r)),a="",c.length&&(a=c.pop()),{past:c,present:a};default:throw new Error(`Invalid action: "${t}"`)}}});var Q_=K((C3t,Ehe)=>{"use strict";var Eft=Id(),Ihe=yhe(),B_=class extends Eft{constructor(e){super(e);let r=this.options.history;if(r&&r.store){let o=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get("values")||{past:[],present:o},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=Ihe(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=Ihe("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};Ehe.exports=B_});var Bhe=K((y3t,whe)=>{"use strict";var wft=Id(),v_=class extends wft{format(){return""}};whe.exports=v_});var vhe=K((I3t,Qhe)=>{"use strict";var Bft=Id(),D_=class extends Bft{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()}};Qhe.exports=D_});var She=K((E3t,Dhe)=>{"use strict";var Qft=Zp(),S_=class extends Qft{constructor(e){super({...e,multiple:!0})}};Dhe.exports=S_});var x_=K((w3t,khe)=>{"use strict";var vft=Id(),k_=class extends vft{constructor(e={}){super({style:"number",...e}),this.min=this.isValue(e.min)?this.toNumber(e.min):-1/0,this.max=this.isValue(e.max)?this.toNumber(e.max):1/0,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,o=this.toNumber(this.input);return o>this.max+r?this.alert():(this.input=`${o+r}`,this.render())}down(e){let r=e||this.minor,o=this.toNumber(this.input);return o<this.min-r?this.alert():(this.input=`${o-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()}};khe.exports=k_});var Phe=K((B3t,xhe)=>{xhe.exports=x_()});var Fhe=K((Q3t,bhe)=>{"use strict";var Dft=Id(),P_=class extends Dft{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)):""}};bhe.exports=P_});var Mhe=K((v3t,The)=>{"use strict";v
`;let r=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((o,a)=>({name:a+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 o=0;o<this.scale.length;o++)r.scale.push({index:o})}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,o){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(o=>` ${o.name} - ${o.message}`);return["",...e].map(o=>this.styles.muted(o)).join(`
`)}renderScaleHeading(e){let r=this.scale.map(g=>g.name);typeof this.options.renderScaleHeading=="function"&&(r=this.options.renderScaleHeading.call(this,e));let o=this.scaleLength-r.join("").length,a=Math.round(o/(r.length-1)),c=r.map(g=>this.styles.strong(g)).join(" ".repeat(a)),f=" ".repeat(this.widths[0]);return this.margin[3]+f+this.margin[1]+c}scaleIndicator(e,r,o){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,r,o);let a=e.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):a?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,r){let o=e.scale.map(n=>this.scaleIndicator(e,n,r)),a=this.term==="Hyper"?"":" ";return o.join(a+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,r){await this.onChoice(e,r);let o=this.index===r,a=await this.pointer(e,r),n=await e.hint;n&&!Rhe.hasColor(n)&&(n=this.styles.muted(n));let c=y=>this.margin[3]+y.replace(/\s+$/,"").padEnd(this.widths[0]," "),f=this.newline,g=this.indent(e),p=await this.resolve(e.message,this.state,e,r),I=await this.renderScale(e,r),B=this.margin[1]+this.margin[3];this.scaleLength=Sft.unstyle(I).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-B.length);let x=Rhe.wordWrap(p,{width:this.widths[0],newline:f}).split(`
`).map(y=>c(y)+this.margin[1]);return o&&(I=this.styles.info(I),x=x.map(y=>this.styles.info(y))),x[0]+=I,this.linebreak&&x.push(""),[g+a,x.join(`
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(a,n)=>await this.renderChoice(a,n)),r=await Promise.all(e),o=await this.renderScaleHeading();return this.margin[0]+[o,...r.map(a=>a.join(" "))].join(`
`)}async render(){let{submitted:e,size:r}=this.state,o=await this.prefix(),a=await this.separator(),n=await this.message(),c="";this.options.promptLine!==!1&&(c=[o,n,a,""].join(" "),this.state.prompt=c);let f=await this.header(),g=await this.format(),p=await this.renderScaleKey(),I=await this.error()||await this.hint(),B=await this.renderChoices(),Q=await this.footer(),x=this.emptyError;g&&(c+=g),I&&!c.includes(I)&&(c+=" "+I),e&&!g&&!B.trim()&&this.multiple&&x!=null&&(c+=this.styles.danger(x)),this.clear(r),this.write([f,c,p,B,Q].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)}};The.exports=b_});var Ohe=K((D3t,Lhe)=>{"use strict";var Nhe=Cc(),xft=(t="")=>typeof t=="string"?t.replace(/^['"]|['"]$/g,""):"",R_=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=xft(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},Pft=async(t={},e={},r=o=>o)=>{let o=new Set,a=t.fields||[],n=t.template,c=[],f=[],g=[],p=1;typeof n=="function"&&(n=await n());let I=-1,B=()=>n[++I],Q=()=>n[I+1],x=y=>{y.line=p,c.push(y)};for(x({type:"bos",value:""});I<n.length-1;){let y=B();if(/^[^\S\n ]$/.test(y)){x({type:"text",value:y});continue}if(y===`
`){x({type:"newline",value:y}),p++;continue}if(y==="\\"){y+=B(),x({type:"text",value:y});continue}if((y==="$"||y==="#"||y==="{")&&Q()==="{"){y+=B();let q={type:"template",open:y,inner:"",close:"",value:y},X;for(;X=B();){if(X==="}"){Q()==="}"&&(X+=B()),q.value+=X,q.close=X;break}X===":"?(q.initial="",q.key=q.inner):q.initial!==void 0&&(q.initial+=X),q.value+=X,q.inner+=X}q.template=q.open+(q.initial||q.inner)+q.close,q.key=q.key||q.inner,e.hasOwnProperty(q.key)&&(q.initial=e[q.key]),q=r(q),x(q),g.push(q.key),o.add(q.key);let se=f.find(fe=>fe.name===q.key);q.field=a.find(fe=>fe.name===q.key),se||(se=new R_(q),f.push(se)),se.lines.push(q.line-1);continue}let T=c[c.length-1];T.type==="text"&&T.line===p?T.value+=y:x({type:"text",value:y})}return x({type:"eos",value:""}),{input:n,tabstops:c,unique:o,keys:g,items:f}};Lhe.exports=async t=>{let e=t.options,r=new Set(e.required===!0?[]:e.required||[]),o={...e.values,...e.initial},{tabstops:a,items:n,keys:c}=await Pft(e,o),f=F_("result",t,e),g=F_("format",t,e),p=F_("validate",t,e,!0),I=t.isValue.bind(t);return async(B={},Q=!1)=>{let x=0;B.required=r,B.items=n,B.keys=c,B.output="";let y=async(X,se,fe,me)=>{let Qe=await p(X,se,fe,me);return Qe===!1?"Invalid field "+fe.name:Qe};for(let X of a){let se=X.value,fe=X.key;if(X.type!=="template"){se&&(B.output+=se);continue}if(X.type==="template"){let me=n.find(De=>De.name===fe);e.required===!0&&B.required.add(me.name);let Qe=[me.input,B.values[me.value],me.value,se].find(I),Ee=(me.field||{}).message||X.inner;if(Q){let De=await y(B.values[fe],B,me,x);if(De&&typeof De=="string"||De===!1){B.invalid.set(fe,De);continue}B.invalid.delete(fe);let h=await f(B.values[fe],B,me,x);B.output+=Nhe.unstyle(h);continue}me.placeholder=!1;let ye=se;se=await g(se,B,me,x),Qe!==se?(B.values[fe]=Qe,se=t.styles.typing(Qe),B.missing.delete(Ee)):(B.values[fe]=void 0,Qe=`<${Ee}>`,se=t.styles.primary(Qe),me.placeholder=!0,B.required.has(fe)&&B.missing.add(Ee)),B.missing.has(Ee)&&B.validating&&(se=t.styles.warning(Qe)),B.invalid.has(fe)&&B.validating&&(se=t.styles.danger(Qe)),x===B.index&&(ye!==se?se=t.styles.underline(se):se=t.styles.heading(Nhe.unstyle(se))),x++}se&&(B.output+=se)}let T=B.output.split(`
`).map(X=>" "+X),U=n.length,q=0;for(let X of n)B.invalid.has(X.name)&&X.lines.forEach(se=>{T[se][0]===" "&&(T[se]=B.styles.danger(B.symbols.bullet)+T[se].slice(1))}),t.isValue(B.values[X.name])&&q++;return B.completed=(q/U*100).toFixed(0),B.output=T.join(`
`),B.output}};function F_(t,e,r,o){return(a,n,c,f)=>typeof c.field[t]=="function"?c.field[t].call(e,a,n,c,f):[o,a].find(g=>e.isValue(g))}});var _he=K((S3t,Uhe)=>{"use strict";var bft=Cc(),Fft=Ohe(),Rft=mI(),T_=class extends Rft{constructor(e){super(e),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await Fft(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 o=this.getItem(),a=o.input.slice(0,this.cursor),n=o.input.slice(this.cursor);this.input=o.input=`${a}${e}${n}`,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),o=e.input.slice(0,this.cursor-1);this.input=e.input=`${o}${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:o,size:a}=this.state,n=[this.options.newline,`
`].find(X=>X!=null),c=await this.prefix(),f=await this.separator(),g=await this.message(),p=[c,g,f].filter(Boolean).join(" ");this.state.prompt=p;let I=await this.header(),B=await this.error()||"",Q=await this.hint()||"",x=o?"":await this.interpolate(this.state),y=this.state.key=r[e]||"",T=await this.format(y),U=await this.footer();T&&(p+=" "+T),Q&&!T&&this.state.completed===0&&(p+=" "+Q),this.clear(a);let q=[I,p,x,U,B.trim()];this.write(q.filter(Boolean).join(n)),this.restore()}getItem(e){let{items:r,keys:o,index:a}=this.state,n=r.find(c=>c.name===o[a]);return n&&n.input!=null&&(this.input=n.input,this.cursor=n.cursor),n}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:r,output:o,values:a}=this.state;if(e.size){let f="";for(let[g,p]of e)f+=`Invalid ${g}: ${p}
`;return this.state.error=f,super.submit()}if(r.size)return this.state.error="Required: "+[...r.keys()].join(", "),super.submit();let c=bft.unstyle(o).split(`
`).map(f=>f.slice(1)).join(`
`);return this.value={values:a,result:c},super.submit()}};Uhe.exports=T_});var Hhe=K((k3t,Khe)=>{"use strict";var Tft="(Use <shift>+<up/down> to sort)",Mft=Zp(),M_=class extends Mft{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,Tft].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,r){let o=await super.renderChoice(e,r),a=this.symbols.identicalTo+" ",n=this.index===r&&this.sorting?this.styles.muted(a):" ";return this.options.drag===!1&&(n=""),this.options.numbered===!0?n+`${r+1} - `+o:n+o}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};Khe.exports=M_});var Ghe=K((x3t,qhe)=>{"use strict";var Nft=p1(),N_=class extends Nft{constructor(e={}){if(super(e),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(o=>this.styles.muted(o)),this.state.header=r.join(`
`)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...e);for(let o of r)o.scale=Lft(5,this.options),o.scaleIdx=2;return r}dispatch(){this.alert()}space(){let e=this.focused,r=e.scale[e.scaleIdx],o=r.selected;return e.scale.forEach(a=>a.selected=!1),r.selected=!o,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 o=this.index===r,a=this.term==="Hyper",n=a?9:8,c=a?"":" ",f=this.symbols.line.repeat(n),g=" ".repeat(n+(a?0:1)),p=se=>(se?this.styles.success("\u25C9"):"\u25EF")+c,I=r+1+".",B=o?this.styles.heading:this.styles.noop,Q=await this.resolve(e.message,this.state,e,r),x=this.indent(e),y=x+e.scale.map((se,fe)=>p(fe===e.scaleIdx)).join(f),T=se=>se===e.scaleIdx?B(se):se,U=x+e.scale.map((se,fe)=>T(fe)).join(g),q=()=>[I,Q].filter(Boolean).join(" "),X=()=>[q(),y,U," "].filter(Boolean).join(`
`);return o&&(y=this.styles.cyan(y),U=this.styles.cyan(U)),X()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(o,a)=>await this.renderChoice(o,a)),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,o=await this.prefix(),a=await this.separator(),n=await this.message(),c=[o,n,a].filter(Boolean).join(" ");this.state.prompt=c;let f=await this.header(),g=await this.format(),p=await this.error()||await this.hint(),I=await this.renderChoices(),B=await this.footer();(g||!p)&&(c+=" "+g),p&&!c.includes(p)&&(c+=" "+p),e&&!g&&!I&&this.multiple&&this.type!=="form"&&(c+=this.styles.danger(this.emptyError)),this.clear(r),this.write([c,f,I,B].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 Lft(t,e={}){if(Array.isArray(e.scale))return e.scale.map(o=>({...o}));let r=[];for(let o=1;o<t+1;o++)r.push({i:o,selected:!1});return r}qhe.exports=N_});var Yhe=K((P3t,jhe)=>{jhe.exports=Q_()});var Jhe=K((b3t,Whe)=>{"use strict";var Oft=Gx(),L_=class extends Oft{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=o=>this.styles.primary.underline(o);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(),o=await this.prefix(),a=await this.separator(),n=await this.message(),c=await this.format(),f=await this.error()||await this.hint(),g=await this.footer(),p=[o,n,a,c].join(" ");this.state.prompt=p,f&&!p.includes(f)&&(p+=" "+f),this.clear(e),this.write([r,p,g].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};Whe.exports=L_});var Vhe=K((F3t,zhe)=>{"use strict";var Uft=Zp(),O_=class extends Uft{constructor(e){if(super(e),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 o=await super.toChoices(e,r);if(o.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>o.length)throw new Error("Please specify the index of the correct answer from the list of choices");return o}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)}}};zhe.exports=O_});var Zhe=K(U_=>{"use strict";var Xhe=Vo(),Ns=(t,e)=>{Xhe.defineExport(U_,t,e),Xhe.defineExport(U_,t.toLowerCase(),e)};Ns("AutoComplete",()=>ihe());Ns("BasicAuth",()=>uhe());Ns("Confirm",()=>phe());Ns("Editable",()=>dhe());Ns("Form",()=>qx());Ns("Input",()=>Q_());Ns("Invisible",()=>Bhe());Ns("List",()=>vhe());Ns("MultiSelect",()=>She());Ns("Numeral",()=>Phe());Ns("Password",()=>Fhe());Ns("Scale",()=>Mhe());Ns("Select",()=>Zp());Ns("Snippet",()=>_he());Ns("Sort",()=>Hhe());Ns("Survey",()=>Ghe());Ns("Text",()=>Yhe());Ns("Toggle",()=>Jhe());Ns("Quiz",()=>Vhe())});var e0e=K((T3t,$he)=>{$he.exports={ArrayPrompt:p1(),AuthPrompt:C_(),BooleanPrompt:Gx(),NumberPrompt:x_(),StringPrompt:Id()}});var d1=K((M3t,r0e)=>{"use strict";var t0e=Be("assert"),K_=Be("events"),$p=Vo(),Ic=class extends K_{constructor(e,r){super(),this.options=$p.merge({},e),this.answers={...r}}register(e,r){if($p.isObject(e)){for(let a of Object.keys(e))this.register(a,e[a]);return this}t0e.equal(typeof r,"function","expected a function");let o=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[o]=r:this.prompts[o]=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($p.merge({},this.options,r))}catch(o){return Promise.reject(o)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let r=$p.merge({},this.options,e),{type:o,name:a}=e,{set:n,get:c}=$p;if(typeof o=="function"&&(o=await o.call(this,e,this.answers)),!o)return this.answers[a];t0e(this.prompts[o],`Prompt "${o}" is not registered`);let f=new this.prompts[o](r),g=c(this.answers,a);f.state.answers=this.answers,f.enquirer=this,a&&f.on("submit",I=>{this.emit("answer",a,I,f),n(this.answers,a,I)});let p=f.emit.bind(f);return f.emit=(...I)=>(this.emit.call(this,...I),p(...I)),this.emit("prompt",f,this),r.autofill&&g!=null?(f.value=f.input=g,r.autofill==="show"&&await f.submit()):g=f.value=await f.run(),g}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||mI()}static get prompts(){return Zhe()}static get types(){return e0e()}static get prompt(){let e=(r,...o)=>{let a=new this(...o),n=a.emit.bind(a);return a.emit=(...c)=>(e.emit(...c),n(...c)),a.prompt(r)};return $p.mixinEmitter(e,new K_),e}};$p.mixinEmitter(Ic,new K_);var __=Ic.prompts;for(let t of Object.keys(__)){let e=t.toLowerCase(),r=o=>new __[t](o).run();Ic.prompt[e]=r,Ic[e]=r,Ic[t]||Reflect.defineProperty(Ic,t,{get:()=>__[t]})}var h1=t=>{$p.defineExport(Ic,t,()=>Ic.types[t])};h1("ArrayPrompt");h1("AuthPrompt");h1("BooleanPrompt");h1("NumberPrompt");h1("StringPrompt");r0e.exports=Ic});var E1=K((p8t,c0e)=>{var jft=Px();function Yft(t,e,r){var o=t==null?void 0:jft(t,e);return o===void 0?r:o}c0e.exports=Yft});var g0e=K((y8t,f0e)=>{function Wft(t,e){for(var r=-1,o=t==null?0:t.length;++r<o&&e(t[r],r,t)!==!1;);return t}f0e.exports=Wft});var h0e=K((I8t,p0e)=>{var Jft=_0(),zft=bD();function Vft(t,e){return t&&Jft(e,zft(e),t)}p0e.exports=Vft});var m0e=K((E8t,d0e)=>{var Xft=_0(),Zft=Ay();function $ft(t,e){return t&&Xft(e,Zft(e),t)}d0e.exports=$ft});var
`+g:"")),c.error.method="_execFileSync",c.error.program=a,c.error.args=n,c.error.extMessage=g,c.error.exitCode=+f),ti.unlinkSync(p),ti.unlinkSync(I),ti.unlinkSync(B),ti.unlinkSync(Q),c}function w0t(t){var e,r={},o,a={env:process.env,encoding:t.encoding};if(lh||(tm?process.env.PSModulePath?(lh="powershell.exe",sP=["-ExecutionPolicy","Bypass","-File",__dirname+"\\read.ps1"]):(lh="cscript.exe",sP=["//nologo",__dirname+"\\read.cs.js"]):(lh="/bin/sh",sP=[__dirname+"/read.sh"])),tm&&!process.env.PSModulePath&&(a.stdio=[process.stdin]),PK.execFileSync){e=pme(t),P1&&P1("execFileSync",e);try{r.input=PK.execFileSync(lh,e,a)}catch(n){o=n.stderr?(n.stderr+"").trim():"",r.error=new Error(fme+(o?`
`+o:"")),r.error.method="execFileSync",r.error.program=lh,r.error.args=e,r.error.extMessage=o,r.error.exitCode=n.status,r.error.code=n.code,r.error.signal=n.signal}}else r=E0t(t,a);return r.error||(r.input=r.input.replace(/^\s*'|'\s*$/g,""),t.display=""),r}function RK(t){var e="",r=t.display,o=!t.display&&t.keyIn&&t.hideEchoBack&&!t.mask;function a(){var n=w0t(t);if(n.error)throw n.error;return n.input}return FK&&FK(t),function(){var n,c,f;function g(){return n||(n=process.binding("fs"),c=process.binding("constants")),n}if(typeof Cg=="string")if(Cg=null,tm){if(f=function(p){var I=p.replace(/^\D+/,"").split("."),B=0;return(I[0]=+I[0])&&(B+=I[0]*1e4),(I[1]=+I[1])&&(B+=I[1]*100),(I[2]=+I[2])&&(B+=I[2]),B}(process.version),!(f>=20302&&f<40204||f>=5e4&&f<50100||f>=50600&&f<60200)&&process.stdin.isTTY)process.stdin.pause(),Cg=process.stdin.fd,bI=process.stdin._handle;else try{Cg=g().open("CONIN$",c.O_RDWR,parseInt("0666",8)),bI=new cme(Cg,!0)}catch{}if(process.stdout.isTTY)Qc=process.stdout.fd;else{try{Qc=ti.openSync("\\\\.\\CON","w")}catch{}if(typeof Qc!="number")try{Qc=g().open("CONOUT$",c.O_RDWR,parseInt("0666",8))}catch{}}}else{if(process.stdin.isTTY){process.stdin.pause();try{Cg=ti.openSync("/dev/tty","r"),bI=process.stdin._handle}catch{}}else try{Cg=ti.openSync("/dev/tty","r"),bI=new cme(Cg,!1)}catch{}if(process.stdout.isTTY)Qc=process.stdout.fd;else try{Qc=ti.openSync("/dev/tty","w")}catch{}}}(),function(){var n,c,f=!t.hideEchoBack&&!t.keyIn,g,p,I,B,Q;oP="";function x(y){return y===ume?!0:bI.setRawMode(y)!==0?!1:(ume=y,!0)}if(gme||!bI||typeof Qc!="number"&&(t.display||!f)){e=a();return}if(t.display&&(ti.writeSync(Qc,t.display),t.display=""),!t.displayOnly){if(!x(!f)){e=a();return}for(p=t.keyIn?1:t.bufferSize,g=Buffer.allocUnsafe&&Buffer.alloc?Buffer.alloc(p):new Buffer(p),t.keyIn&&t.limit&&(c=new RegExp("[^"+t.limit+"]","g"+(t.caseSensitive?"":"i")));;){I=0;try{I=ti.readSync(Cg,g,0,p)}catch(y){if(y.code!=="EOF"){x(!1),e+=a();return}}if(I>0?(B=g.toString(t.encoding,0,I),oP+=B):(B=`
`,oP+=String.fromCharCode(0)),B&&typeof(Q=(B.match(/^(.*?)[\r\n]/)||[])[1])=="string"&&(B=Q,n=!0),B&&(B=B.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"")),B&&c&&(B=B.replace(c,"")),B&&(f||(t.hideEchoBack?t.mask&&ti.writeSync(Qc,new Array(B.length+1).join(t.mask)):ti.writeSync(Qc,B)),e+=B),!t.keyIn&&n||t.keyIn&&e.length>=p)break}!f&&!o&&ti.writeSync(Qc,`
`),x(!1)}}(),t.print&&!o&&t.print(r+(t.displayOnly?"":(t.hideEchoBack?new Array(e.length+1).join(t.mask):e)+`
`),t.encoding),t.displayOnly?"":NK=t.keepWhitespace||t.keyIn?e:e.trim()}function B0t(t,e){var r=[];function o(a){a!=null&&(Array.isArray(a)?a.forEach(o):(!e||e(a))&&r.push(a))}return o(t),r}function LK(t){return t.replace(/[\x00-\x7f]/g,function(e){return"\\x"+("00"+e.charCodeAt().toString(16)).substr(-2)})}function Xs(){var t=Array.prototype.slice.call(arguments),e,r;return t.length&&typeof t[0]=="boolean"&&(r=t.shift(),r&&(e=Object.keys(bK),t.unshift(bK))),t.reduce(function(o,a){return a==null||(a.hasOwnProperty("noEchoBack")&&!a.hasOwnProperty("hideEchoBack")&&(a.hideEchoBack=a.noEchoBack,delete a.noEchoBack),a.hasOwnProperty("noTrim")&&!a.hasOwnProperty("keepWhitespace")&&(a.keepWhitespace=a.noTrim,delete a.noTrim),r||(e=Object.keys(a)),e.forEach(function(n){var c;if(!!a.hasOwnProperty(n))switch(c=a[n],n){case"mask":case"limitMessage":case"defaultInput":case"encoding":c=c!=null?c+"":"",c&&n!=="limitMessage"&&(c=c.replace(/[\r\n]/g,"")),o[n]=c;break;case"bufferSize":!isNaN(c=parseInt(c,10))&&typeof c=="number"&&(o[n]=c);break;case"displayOnly":case"keyIn":case"hideEchoBack":case"caseSensitive":case"keepWhitespace":case"history":case"cd":o[n]=!!c;break;case"limit":case"trueValue":case"falseValue":o[n]=B0t(c,function(f){var g=typeof f;return g==="string"||g==="number"||g==="function"||f instanceof RegExp}).map(function(f){return typeof f=="string"?f.replace(/[\r\n]/g,""):f});break;case"print":case"phContent":case"preCheck":o[n]=typeof c=="function"?c:void 0;break;case"prompt":case"display":o[n]=c??"";break}})),o},{})}function TK(t,e,r){return e.some(function(o){var a=typeof o;return a==="string"?r?t===o:t.toLowerCase()===o.toLowerCase():a==="number"?parseFloat(t)===o:a==="function"?o(t):o instanceof RegExp?o.test(t):!1})}function OK(t,e){var r=ch.normalize(tm?(process.env.HOMEDRIVE||"")+(process.env.HOMEPATH||""):process.env.HOME||"").replace(/[\/\\]+$/,"");return t=ch.normalize(t),e?t.replace(/^~(?=\/|\\|$)/,r):t.replace(new RegExp("^"+LK(r)+"(?=\\/|\\\\|$)",tm?"i":""),"~")}function FI(t,e){var r="(?:\\(([\\s\\S]*?)\\))?(\\w+|.-.)(?:\\(([\\s\\S]*?)\\))?",o=new RegExp("(\\$)?(\\$<"+r+">)","g"),a=new RegExp("(\\$)?(\\$\\{"+r+"\\})","g");function n(c,f,g,p,I,B){var Q;return f||typeof(Q=e(I))!="string"?g:Q?(p||"")+Q+(B||""):""}return t.replace(o,n).replace(a,n)}function hme(t,e,r){var o,a=[],n=-1,c=0,f="",g;function p(I,B){return B.length>3?(I.push(B[0]+"..."+B[B.length-1]),g=!0):B.length&&(I=I.concat(B)),I}return o=t.reduce(function(I,B){return I.concat((B+"").split(""))},[]).reduce(function(I,B){var Q,x;return e||(B=B.toLowerCase()),Q=/^\d$/.test(B)?1:/^[A-Z]$/.test(B)?2:/^[a-z]$/.test(B)?3:0,r&&Q===0?f+=B:(x=B.charCodeAt(0),Q&&Q===n&&x===c+1?a.push(B):(I=p(I,a),a=[B],n=Q),c=x),I},[]),o=p(o,a),f&&(o.push(f),g=!0),{values:o,suppressed:g}}function dme(t,e){return t.join(t.length>2?", ":e?" / ":"/")}function mme(t,e){var r,o,a={},n;if(e.phContent&&(r=e.phContent(t,e)),typeof r!="string")switch(t){case"hideEchoBack":case"mask":case"defaultInput":case"caseSensitive":case"keepWhitespace":case"encoding":case"bufferSize":case"history":case"cd":r=e.hasOwnProperty(t)?typeof e[t]=="boolean"?e[t]?"on":"off":e[t]+"":"";break;case"limit":case"trueValue":case"falseValue":o=e[e.hasOwnProperty(t+"Src")?t+"Src":t],e.keyIn?(a=hme(o,e.caseSensitive),o=a.values):o=o.filter(function(c){var f=typeof c;return f==="string"||f==="number"}),r=dme(o,a.suppressed);break;case"limitCount":case"limitCountNotZero":r=e[e.hasOwnProperty("limitSrc")?"limitSrc":"limit"].length,r=r||t!=="limitCountNotZero"?r+"":"";break;case"lastInput":r=NK;break;case"cwd":case"CWD":case"cwdHome":r=process.cwd(),t==="CWD"?r=ch.basename(r):t==="cwdHome"&&(r=OK(r));break;case"date":case"time":case"localeDate":case"localeTime":r=new Date()["to"+t.replace(/^./,function(c){return c.toUpperCase()})+"String"]();break;default:typeof(n=(t.match(/^history_m(\d+)$/)||[])[1])=="string"&&(r=em[em.length-n]||"")}return r}function Cme(t){var e=/^(.)-(.)$/.exec(t),r="",o,a,n,c;if(!e)return null;for(o=e[1].charCodeAt(0),a=e[2].charCodeAt(0),c=o<a?1:-1,n=o;n!==a+c;n+=c)r+=String.fromCharCode
`:"")+I}for(t.limitSrc=t.limit,t.displaySrc=t.display,t.limit="",t.display=FI(t.display+"",g);;){if(e=RK(t),r=!1,o="",t.defaultInput&&!e&&(e=t.defaultInput),t.history&&((a=/^\s*\!(?:\!|-1)(:p)?\s*$/.exec(e))?(n=em[0]||"",a[1]?r=!0:e=n,p(n+`
`),r||(t.displayOnly=!0,RK(t),t.displayOnly=!1)):e&&e!==em[em.length-1]&&(em=[e])),!r&&t.cd&&e)switch(c=MK(e),c[0].toLowerCase()){case"cd":if(c[1])try{process.chdir(OK(c[1],!0))}catch(I){p(I+"")}r=!0;break;case"pwd":p(process.cwd()),r=!0;break}if(!r&&t.preCheck&&(f=t.preCheck(e,t),e=f.res,f.forceNext&&(r=!0)),!r){if(!t.limitSrc.length||TK(e,t.limitSrc,t.caseSensitive))break;t.limitMessage&&(o=FI(t.limitMessage,g))}p((o?o+`
`:"")+FI(t.displaySrc+"",g))}return yme(e,t)}en._DBG_set_useExt=function(t){gme=t};en._DBG_set_checkOptions=function(t){FK=t};en._DBG_set_checkMethod=function(t){P1=t};en._DBG_clearHistory=function(){NK="",em=[]};en.setDefaultOptions=function(t){return bK=Xs(!0,t),Xs(!0)};en.question=function(t,e){return Ime(Xs(Xs(!0,e),{display:t}))};en.prompt=function(t){var e=Xs(!0,t);return e.display=e.prompt,Ime(e)};en.keyIn=function(t,e){var r=Xs(Xs(!0,e),{display:t,keyIn:!0,keepWhitespace:!0});return r.limitSrc=r.limit.filter(function(o){var a=typeof o;return a==="string"||a==="number"}).map(function(o){return FI(o+"",Cme)}),r.limit=LK(r.limitSrc.join("")),["trueValue","falseValue"].forEach(function(o){r[o]=r[o].reduce(function(a,n){var c=typeof n;return c==="string"||c==="number"?a=a.concat((n+"").split("")):a.push(n),a},[])}),r.display=FI(r.display+"",function(o){return mme(o,r)}),yme(RK(r),r)};en.questionEMail=function(t,e){return t==null&&(t="Input e-mail address: "),en.question(t,Xs({hideEchoBack:!1,limit:/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,limitMessage:"Input valid e-mail address, please.",trueValue:null,falseValue:null},e,{keepWhitespace:!1,cd:!1}))};en.questionNewPassword=function(t,e){var r,o,a,n=Xs({hideEchoBack:!0,mask:"*",limitMessage:`It can include: $<charlist>
And the length must be: $<length>`,trueValue:null,falseValue:null,caseSensitive:!0},e,{history:!1,cd:!1,phContent:function(x){return x==="charlist"?r.text:x==="length"?o+"..."+a:null}}),c,f,g,p,I,B,Q;for(e=e||{},c=FI(e.charlist?e.charlist+"":"$<!-~>",Cme),(isNaN(o=parseInt(e.min,10))||typeof o!="number")&&(o=12),(isNaN(a=parseInt(e.max,10))||typeof a!="number")&&(a=24),p=new RegExp("^["+LK(c)+"]{"+o+","+a+"}$"),r=hme([c],n.caseSensitive,!0),r.text=dme(r.values,r.suppressed),f=e.confirmMessage!=null?e.confirmMessage:"Reinput a same one to confirm it: ",g=e.unmatchMessage!=null?e.unmatchMessage:"It differs from first one. Hit only the Enter key if you want to retry from first one.",t==null&&(t="Input new password: "),I=n.limitMessage;!Q;)n.limit=p,n.limitMessage=I,B=en.question(t,n),n.limit=[B,""],n.limitMessage=g,Q=en.question(f,n);return B};function Eme(t,e,r){var o;function a(n){return o=r(n),!isNaN(o)&&typeof o=="number"}return en.question(t,Xs({limitMessage:"Input valid number, please."},e,{limit:a,cd:!1})),o}en.questionInt=function(t,e){return Eme(t,e,function(r){return parseInt(r,10)})};en.questionFloat=function(t,e){return Eme(t,e,parseFloat)};en.questionPath=function(t,e){var r,o="",a=Xs({hideEchoBack:!1,limitMessage:`$<error(
)>Input valid path, please.$<( Min:)min>$<( Max:)max>`,history:!0,cd:!0},e,{keepWhitespace:!1,limit:function(n){var c,f,g;n=OK(n,!0),o="";function p(I){I.split(/\/|\\/).reduce(function(B,Q){var x=ch.resolve(B+=Q+ch.sep);if(!ti.existsSync(x))ti.mkdirSync(x);else if(!ti.statSync(x).isDirectory())throw new Error("Non directory already exists: "+x);return B},"")}try{if(c=ti.existsSync(n),r=c?ti.realpathSync(n):ch.resolve(n),!e.hasOwnProperty("exists")&&!c||typeof e.exists=="boolean"&&e.exists!==c)return o=(c?"Already exists":"No such file or directory")+": "+r,!1;if(!c&&e.create&&(e.isDirectory?p(r):(p(ch.dirname(r)),ti.closeSync(ti.openSync(r,"w"))),r=ti.realpathSync(r)),c&&(e.min||e.max||e.isFile||e.isDirectory)){if(f=ti.statSync(r),e.isFile&&!f.isFile())return o="Not file: "+r,!1;if(e.isDirectory&&!f.isDirectory())return o="Not directory: "+r,!1;if(e.min&&f.size<+e.min||e.max&&f.size>+e.max)return o="Size "+f.size+" is out of range: "+r,!1}if(typeof e.validate=="function"&&(g=e.validate(r))!==!0)return typeof g=="string"&&(o=g),!1}catch(I){return o=I+"",!1}return!0},phContent:function(n){return n==="error"?o:n!=="min"&&n!=="max"?null:e.hasOwnProperty(n)?e[n]+"":""}});return e=e||{},t==null&&(t='Input path (you can "cd" and "pwd"): '),en.question(t,a),r};function wme(t,e){var r={},o={};return typeof t=="object"?(Object.keys(t).forEach(function(a){typeof t[a]=="function"&&(o[e.caseSensitive?a:a.toLowerCase()]=t[a])}),r.preCheck=function(a){var n;return r.args=MK(a),n=r.args[0]||"",e.caseSensitive||(n=n.toLowerCase()),r.hRes=n!=="_"&&o.hasOwnProperty(n)?o[n].apply(a,r.args.slice(1)):o.hasOwnProperty("_")?o._.apply(a,r.args):null,{res:a,forceNext:!1}},o.hasOwnProperty("_")||(r.limit=function(){var a=r.args[0]||"";return e.caseSensitive||(a=a.toLowerCase()),o.hasOwnProperty(a)})):r.preCheck=function(a){return r.args=MK(a),r.hRes=typeof t=="function"?t.apply(a,r.args):!0,{res:a,forceNext:!1}},r}en.promptCL=function(t,e){var r=Xs({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},e),o=wme(t,r);return r.limit=o.limit,r.preCheck=o.preCheck,en.prompt(r),o.args};en.promptLoop=function(t,e){for(var r=Xs({hideEchoBack:!1,trueValue:null,falseValue:null,caseSensitive:!1,history:!0},e);!t(en.prompt(r)););};en.promptCLLoop=function(t,e){var r=Xs({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},e),o=wme(t,r);for(r.limit=o.limit,r.preCheck=o.preCheck;en.prompt(r),!o.hRes;);};en.promptSimShell=function(t){return en.prompt(Xs({hideEchoBack:!1,history:!0},t,{prompt:function(){return tm?"$<cwd>>":(process.env.USER||"")+(process.env.HOSTNAME?"@"+process.env.HOSTNAME.replace(/\..*$/,""):"")+":$<cwdHome>$ "}()}))};function Bme(t,e,r){var o;return t==null&&(t="Are you sure? "),(!e||e.guide!==!1)&&(t+="")&&(t=t.replace(/\s*:?\s*$/,"")+" [y/n]: "),o=en.keyIn(t,Xs(e,{hideEchoBack:!1,limit:r,trueValue:"y",falseValue:"n",caseSensitive:!1})),typeof o=="boolean"?o:""}en.keyInYN=function(t,e){return Bme(t,e)};en.keyInYNStrict=function(t,e){return Bme(t,e,"yn")};en.keyInPause=function(t,e){t==null&&(t="Continue..."),(!e||e.guide!==!1)&&(t+="")&&(t=t.replace(/\s+$/,"")+" (Hit any key)"),en.keyIn(t,Xs({limit:null},e,{hideEchoBack:!0,mask:""}))};en.keyInSelect=function(t,e,r){var o=Xs({hideEchoBack:!1},r,{trueValue:null,falseValue:null,caseSensitive:!1,phContent:function(g){return g==="itemsCount"?t.length+"":g==="firstItem"?(t[0]+"").trim():g==="lastItem"?(t[t.length-1]+"").trim():null}}),a="",n={},c=49,f=`
`;if(!Array.isArray(t)||!t.length||t.length>35)throw"`items` must be Array (max length: 35).";return t.forEach(function(g,p){var I=String.fromCharCode(c);a+=I,n[I]=p,f+="["+I+"] "+(g+"").trim()+`
`,c=c===57?97:c+1}),(!r||r.cancel!==!1)&&(a+="0",n[0]=-1,f+="[0] "+(r&&r.cancel!=null&&typeof r.cancel!="boolean"?(r.cancel+"").trim():"CANCEL")+`
`),o.limit=a,f+=`
`,e==null&&(e="Choose one from list: "),(e+="")&&((!r||r.guide!==!1)&&(e=e.replace(/\s*:?\s*$/,"")+" [$<limit>]: "),f+=e),n[en.keyIn(f,o).toLowerCase()]};en.getRawInput=function(){return oP};function b1(t,e){var r;return e.length&&(r={},r[t]=e[0]),en.setDefaultOptions(r)[t]}en.setPrint=function(){return b1("print",arguments)};en.setPrompt=function(){return b1("prompt",arguments)};en.setEncoding=function(){return b1("encoding",arguments)};en.setMask=function(){return b1("mask",arguments)};en.setBufferSize=function(){return b1("bufferSize",arguments)}});var UK=K((nGt,OA)=>{(function(){var t={major:0,minor:2,patch:66,status:"beta"};tau_file_system={files:{},open:function(E,S,C){var R=tau_file_system.files[E];if(!R){if(C==="read")return null;R={path:E,text:"",type:S,get:function(Z,te){return te===this.text.length||te>this.text.length?"end_of_file":this.text.substring(te,te+Z)},put:function(Z,te){return te==="end_of_file"?(this.text+=Z,!0):te==="past_end_of_file"?null:(this.text=this.text.substring(0,te)+Z+this.text.substring(te+Z.length),!0)},get_byte:function(Z){if(Z==="end_of_stream")return-1;var te=Math.floor(Z/2);if(this.text.length<=te)return-1;var ne=n(this.text[Math.floor(Z/2)],0);return Z%2===0?ne&255:ne/256>>>0},put_byte:function(Z,te){var ne=te==="end_of_stream"?this.text.length:Math.floor(te/2);if(this.text.length<ne)return null;var Ae=this.text.length===ne?-1:n(this.text[Math.floor(te/2)],0);return te%2===0?(Ae=Ae/256>>>0,Ae=(Ae&255)<<8|Z&255):(Ae=Ae&255,Ae=(Z&255)<<8|Ae&255),this.text.length===ne?this.text+=c(Ae):this.text=this.text.substring(0,ne)+c(Ae)+this.text.substring(ne+1),!0},flush:function(){return!0},close:function(){var Z=tau_file_system.files[this.path];return Z?!0:null}},tau_file_system.files[E]=R}return C==="write"&&(R.text=""),R}},tau_user_input={buffer:"",get:function(E,S){for(var C;tau_user_input.buffer.length<E;)C=window.prompt(),C&&(tau_user_input.buffer+=C);return C=tau_user_input.buffer.substr(0,E),tau_user_input.buffer=tau_user_input.buffer.substr(E),C}},tau_user_output={put:function(E,S){return console.log(E),!0},flush:function(){return!0}},nodejs_file_system={open:function(E,S,C){var R=Be("fs"),Z=R.openSync(E,C[0]);return C==="read"&&!R.existsSync(E)?null:{get:function(te,ne){var Ae=new Buffer(te);return R.readSync(Z,Ae,0,te,ne),Ae.toString()},put:function(te,ne){var Ae=Buffer.from(te);if(ne==="end_of_file")R.writeSync(Z,Ae);else{if(ne==="past_end_of_file")return null;R.writeSync(Z,Ae,0,Ae.length,ne)}return!0},get_byte:function(te){return null},put_byte:function(te,ne){return null},flush:function(){return!0},close:function(){return R.closeSync(Z),!0}}}},nodejs_user_input={buffer:"",get:function(E,S){for(var C,R=Qme();nodejs_user_input.buffer.length<E;)nodejs_user_input.buffer+=R.question();return C=nodejs_user_input.buffer.substr(0,E),nodejs_user_input.buffer=nodejs_user_input.buffer.substr(E),C}},nodejs_user_output={put:function(E,S){return process.stdout.write(E),!0},flush:function(){return!0}};var e;Array.prototype.indexOf?e=function(E,S){return E.indexOf(S)}:e=function(E,S){for(var C=E.length,R=0;R<C;R++)if(S===E[R])return R;return-1};var r=function(E,S){if(E.length!==0){for(var C=E[0],R=E.length,Z=1;Z<R;Z++)C=S(C,E[Z]);return C}},o;Array.prototype.map?o=function(E,S){return E.map(S)}:o=function(E,S){for(var C=[],R=E.length,Z=0;Z<R;Z++)C.push(S(E[Z]));return C};var a;Array.prototype.filter?a=function(E,S){return E.filter(S)}:a=function(E,S){for(var C=[],R=E.length,Z=0;Z<R;Z++)S(E[Z])&&C.push(E[Z]);return C};var n;String.prototype.codePointAt?n=function(E,S){return E.codePointAt(S)}:n=function(E,S){return E.charCodeAt(S)};var c;String.fromCodePoint?c=function(){return String.fromCodePoint.apply(null,arguments)}:c=function(){return String.fromCharCode.apply(null,arguments)};var f=0,g=1,p=/(\\a)|(\\b)|(\\f)|(\\n)|(\\r)|(\\t)|(\\v)|\\x([0-9a-fA-F]+)\\|\\([0-7]+)\\|(\\\\)|(\\')|('')|(\\")|(\\`)|(\\.)|(.)/g,I={"\\a":7,"\\b":8,"\\f":12,"\\n":10,"\\r":13,"\\t":9,"\\v":11};function B(E){var S=[],C=!1;return E.replace(p,function(R,Z,te,ne,Ae,Fe,Ue,gt,It,Ht,or,Rt,dn,Lr,br,Or,un){switch(!0){case
`,"\r"," ","\v"].indexOf(te)!==-1)switch(R+=1,te){case"a":C+="a";break;case"b":C+="\b";break;case"f":C+="\f";break;case"n":C+=`
`;break;case"r":C+="\r";break;case"t":C+=" ";break;case"v":C+="\v";break;case"'":C+="'";break;case'"':C+='"';break;case"\\":C+="\\";break}else return null;else C+=Z}return C}function x(E){for(var S="",C=0;C<E.length;C++)switch(E.charAt(C)){case"'":S+="\\'";break;case"\\":S+="\\\\";break;case"\b":S+="\\b";break;case"\f":S+="\\f";break;case`
`:S+="\\n";break;case"\r":S+="\\r";break;case" ":S+="\\t";break;case"\v":S+="\\v";break;default:S+=E.charAt(C);break}return S}function y(E){var S=E.substr(2);switch(E.substr(0,2).toLowerCase()){case"0x":return parseInt(S,16);case"0b":return parseInt(S,2);case"0o":return parseInt(S,8);case"0'":return B(S)[0];default:return parseFloat(E)}}var T={whitespace:/^\s*(?:(?:%.*)|(?:\/\*(?:\n|\r|.)*?\*\/)|(?:\s+))\s*/,variable:/^(?:[A-Z_][a-zA-Z0-9_]*)/,atom:/^(\!|,|;|[a-z][0-9a-zA-Z_]*|[#\$\&\*\+\-\.\/\:\<\=\>\?\@\^\~\\]+|'(?:[^']*?(?:\\(?:x?\d+)?\\)*(?:'')*(?:\\')*)*')/,number:/^(?:0o[0-7]+|0x[0-9a-fA-F]+|0b[01]+|0'(?:''|\\[abfnrtv\\'"`]|\\x?\d+\\|[^\\])|\d+(?:\.\d+(?:[eE][+-]?\d+)?)?)/,string:/^(?:"([^"]|""|\\")*"|`([^`]|``|\\`)*`)/,l_brace:/^(?:\[)/,r_brace:/^(?:\])/,l_bracket:/^(?:\{)/,r_bracket:/^(?:\})/,bar:/^(?:\|)/,l_paren:/^(?:\()/,r_paren:/^(?:\))/};function U(E,S){return E.get_flag("char_conversion").id==="on"?S.replace(/./g,function(C){return E.get_char_conversion(C)}):S}function q(E){this.thread=E,this.text="",this.tokens=[]}q.prototype.set_last_tokens=function(E){return this.tokens=E},q.prototype.new_text=function(E){this.text=E,this.tokens=[]},q.prototype.get_tokens=function(E){var S,C=0,R=0,Z=0,te=[],ne=!1;if(E){var Ae=this.tokens[E-1];C=Ae.len,S=U(this.thread,this.text.substr(Ae.len)),R=Ae.line,Z=Ae.start}else S=this.text;if(/^\s*$/.test(S))return null;for(;S!=="";){var Fe=[],Ue=!1;if(/^\n/.exec(S)!==null){R++,Z=0,C++,S=S.replace(/\n/,""),ne=!0;continue}for(var gt in T)if(T.hasOwnProperty(gt)){var It=T[gt].exec(S);It&&Fe.push({value:It[0],name:gt,matches:It})}if(!Fe.length)return this.set_last_tokens([{value:S,matches:[],name:"lexical",line:R,start:Z}]);var Ae=r(Fe,function(Lr,br){return Lr.value.length>=br.value.length?Lr:br});switch(Ae.start=Z,Ae.line=R,S=S.replace(Ae.value,""),Z+=Ae.value.length,C+=Ae.value.length,Ae.name){case"atom":Ae.raw=Ae.value,Ae.value.charAt(0)==="'"&&(Ae.value=Q(Ae.value.substr(1,Ae.value.length-2),"'"),Ae.value===null&&(Ae.name="lexical",Ae.value="unknown escape sequence"));break;case"number":Ae.float=Ae.value.substring(0,2)!=="0x"&&Ae.value.match(/[.eE]/)!==null&&Ae.value!=="0'.",Ae.value=y(Ae.value),Ae.blank=Ue;break;case"string":var Ht=Ae.value.charAt(0);Ae.value=Q(Ae.value.substr(1,Ae.value.length-2),Ht),Ae.value===null&&(Ae.name="lexical",Ae.value="unknown escape sequence");break;case"whitespace":var or=te[te.length-1];or&&(or.space=!0),Ue=!0;continue;case"r_bracket":te.length>0&&te[te.length-1].name==="l_bracket"&&(Ae=te.pop(),Ae.name="atom",Ae.value="{}",Ae.raw="{}",Ae.space=!1);break;case"r_brace":te.length>0&&te[te.length-1].name==="l_brace"&&(Ae=te.pop(),Ae.name="atom",Ae.value="[]",Ae.raw="[]",Ae.space=!1);break}Ae.len=C,te.push(Ae),Ue=!1}var Rt=this.set_last_tokens(te);return Rt.length===0?null:Rt};function X(E,S,C,R,Z){if(!S[C])return{type:f,value:k.error.syntax(S[C-1],"expression expected",!0)};var te;if(R==="0"){var ne=S[C];switch(ne.name){case"number":return{type:g,len:C+1,value:new k.type.Num(ne.value,ne.float)};case"variable":return{type:g,len:C+1,value:new k.type.Var(ne.value)};case"string":var Ae;switch(E.get_flag("double_quotes").id){case"atom":Ae=new H(ne.value,[]);break;case"codes":Ae=new H("[]",[]);for(var Fe=ne.value.length-1;Fe>=0;Fe--)Ae=new H(".",[new k.type.Num(n(ne.value,Fe),!1),Ae]);break;case"chars":Ae=new H("[]",[]);for(var Fe=ne.value.length-1;Fe>=0;Fe--)Ae=new H(".",[new k.type.Term(ne.value.charAt(Fe),[]),Ae]);break}return{type:g,len:C+1,value:Ae};case"l_paren":var Rt=X(E,S,C+1,E.__get_max_priority(),!0);return Rt.type!==g?Rt:S[Rt.len]&&S[Rt.len].name==="r_paren"?(Rt.len++,Rt):{type:f,derived:!0,value:k.error.syntax(S[Rt.len]?S[Rt.len]:S[Rt.len-1],") or operator expected",!S[Rt.len])};case"l_bracket":var Rt=X(E,S,C+1,E.__get_max_priority(),!0);return Rt.type!==g?Rt:S[Rt.len]&&S[Rt.len].name==="r_bracket"?(Rt.len++,Rt.value=new H("{}",[Rt.value]),Rt):{type:f,derived:!0,value:k.error.syntax(S[Rt.len]?S[Rt.len]:S[Rt.len-1],"} or operator expected",!S[Rt.len])}}var Ue=se(E,S,C,Z);return Ue.type===g||Ue.derived||(Ue=fe(E,S,C),Ue.type===g||Ue.derived)?Ue
`;S+=`
`;for(key in this.rules)for(C=0;C<this.rules[key].length;C++)S+=this.rules[key][C].toString(E),S+=`
`;return S},Se.prototype.clone=function(){return new Se(this.id)},Le.prototype.clone=function(){return new Le(this.value,this.is_float)},H.prototype.clone=function(){return new H(this.id,o(this.args,function(E){return E.clone()}))},tt.prototype.clone=function(){return new Stram(this.stream,this.mode,this.alias,this.type,this.reposition,this.eof_action)},Ze.prototype.clone=function(){var E={};for(var S in this.links)!this.links.hasOwnProperty(S)||(E[S]=this.links[S].clone());return new Ze(E)},xe.prototype.clone=function(){return new xe(this.goal.clone(),this.substitution.clone(),this.parent)},Ct.prototype.clone=function(){return new Ct(this.head.clone(),this.body!==null?this.body.clone():null)},Se.prototype.equals=function(E){return k.type.is_variable(E)&&this.id===E.id},Le.prototype.equals=function(E){return k.type.is_number(E)&&this.value===E.value&&this.is_float===E.is_float},H.prototype.equals=function(E){if(!k.type.is_term(E)||this.indicator!==E.indicator)return!1;for(var S=0;S<this.args.length;S++)if(!this.args[S].equals(E.args[S]))return!1;return!0},tt.prototype.equals=function(E){return k.type.is_stream(E)&&this.id===E.id},Ze.prototype.equals=function(E){var S;if(!k.type.is_substitution(E))return!1;for(S in this.links)if(!!this.links.hasOwnProperty(S)&&(!E.links[S]||!this.links[S].equals(E.links[S])))return!1;for(S in E.links)if(!!E.links.hasOwnProperty(S)&&!this.links[S])return!1;return!0},xe.prototype.equals=function(E){return k.type.is_state(E)&&this.goal.equals(E.goal)&&this.substitution.equals(E.substitution)&&this.parent===E.parent},Ct.prototype.equals=function(E){return k.type.is_rule(E)&&this.head.equals(E.head)&&(this.body===null&&E.body===null||this.body!==null&&this.body.equals(E.body))},Se.prototype.rename=function(E){return E.get_free_variable(this)},Le.prototype.rename=function(E){return this},H.prototype.rename=function(E){return new H(this.id,o(this.args,function(S){return S.rename(E)}))},tt.prototype.rename=function(E){return this},Ct.prototype.rename=function(E){return new Ct(this.head.rename(E),this.body!==null?this.body.rename(E):null)},Se.prototype.variables=function(){return[this.id]},Le.prototype.variables=function(){return[]},H.prototype.variables=function(){return[].concat.apply([],o(this.args,function(E){return E.variables()}))},tt.prototype.variables=function(){return[]},Ct.prototype.variables=function(){return this.body===null?this.head.variables():this.head.variables().concat(this.body.variables())},Se.prototype.apply=function(E){return E.lookup(this.id)?E.lookup(this.id):this},Le.prototype.apply=function(E){return this},H.prototype.apply=function(E){if(this.indicator==="./2"){for(var S=[],C=this;C.indicator==="./2";)S.push(C.args[0].apply(E)),C=C.args[1];for(var R=C.apply(E),Z=S.length-1;Z>=0;Z--)R=new H(".",[S[Z],R]);return R}return new H(this.id,o(this.args,function(te){return te.apply(E)}),this.ref)},tt.prototype.apply=function(E){return this},Ct.prototype.apply=function(E){return new Ct(this.head.apply(E),this.body!==null?this.body.apply(E):null)},Ze.prototype.apply=function(E){var S,C={};for(S in this.links)!this.links.hasOwnProperty(S)||(C[S]=this.links[S].apply(E));return new Ze(C)},H.prototype.select=function(){for(var E=this;E.indicator===",/2";)E=E.args[0];return E},H.prototype.replace=function(E){return this.indicator===",/2"?this.args[0].indicator===",/2"?new H(",",[this.args[0].replace(E),this.args[1]]):E===null?this.args[1]:new H(",",[E,this.args[1]]):E},H.prototype.search=function(E){if(k.type.is_term(E)&&E.ref!==void 0&&this.ref===E.ref)return!0;for(var S=0;S<this.args.length;S++)if(k.type.is_term(this.args[S])&&this.args[S].search(E))return!0;return!1},We.prototype.get_current_input=function(){return this.current_input},at.prototype.get_current_input=function(){return this.session.get_current_input()},We.prototype.get_current_output=function(){return this.current_output},at.prototype.get_current_output=function(){return this.session.get_current_output()},We.prototype.set_current_input=function(E){this.current_input=E},at.prototype.set_current_input=function(E){return
`,[])])])),S.substitution,S)])},"nl/1":function(E,S,C){var R=C.args[0];E.prepend([new xe(S.goal.replace(new H("put_char",[R,new H(`
`,[])])),S.substitution,S)])},"get_byte/1":function(E,S,C){var R=C.args[0];E.prepend([new xe(S.goal.replace(new H(",",[new H("current_input",[new Se("S")]),new H("get_byte",[new Se("S"),R])])),S.substitution,S)])},"get_byte/2":function(E,S,C){var R=C.args[0],Z=C.args[1],te=k.type.is_stream(R)?R:E.get_stream_by_alias(R.id);if(k.type.is_variable(R))E.throw_error(k.error.instantiation(C.indicator));else if(!k.type.is_variable(Z)&&!k.type.is_byte(Z))E.throw_error(k.error.type("in_byte",char,C.indicator));else if(!k.type.is_stream(R)&&!k.type.is_atom(R))E.throw_error(k.error.domain("stream_or_alias",R,C.indicator));else if(!k.type.is_stream(te)||te.stream===null)E.throw_error(k.error.existence("stream",R,C.indicator));else if(te.output)E.throw_error(k.error.permission("input","stream",R,C.indicator));else if(te.type==="text")E.throw_error(k.error.permission("input","text_stream",R,C.indicator));else if(te.position==="past_end_of_stream"&&te.eof_action==="error")E.throw_error(k.error.permission("input","past_end_of_stream",R,C.indicator));else{var ne;if(te.position==="end_of_stream")ne="end_of_file",te.position="past_end_of_stream";else{if(ne=te.stream.get_byte(te.position),ne===null){E.throw_error(k.error.representation("byte",C.indicator));return}te.position++}E.prepend([new xe(S.goal.replace(new H("=",[new Le(ne,!1),Z])),S.substitution,S)])}},"peek_byte/1":function(E,S,C){var R=C.args[0];E.prepend([new xe(S.goal.replace(new H(",",[new H("current_input",[new Se("S")]),new H("peek_byte",[new Se("S"),R])])),S.substitution,S)])},"peek_byte/2":function(E,S,C){var R=C.args[0],Z=C.args[1],te=k.type.is_stream(R)?R:E.get_stream_by_alias(R.id);if(k.type.is_variable(R))E.throw_error(k.error.instantiation(C.indicator));else if(!k.type.is_variable(Z)&&!k.type.is_byte(Z))E.throw_error(k.error.type("in_byte",char,C.indicator));else if(!k.type.is_stream(R)&&!k.type.is_atom(R))E.throw_error(k.error.domain("stream_or_alias",R,C.indicator));else if(!k.type.is_stream(te)||te.stream===null)E.throw_error(k.error.existence("stream",R,C.indicator));else if(te.output)E.throw_error(k.error.permission("input","stream",R,C.indicator));else if(te.type==="text")E.throw_error(k.error.permission("input","text_stream",R,C.indicator));else if(te.position==="past_end_of_stream"&&te.eof_action==="error")E.throw_error(k.error.permission("input","past_end_of_stream",R,C.indicator));else{var ne;if(te.position==="end_of_stream")ne="end_of_file",te.position="past_end_of_stream";else if(ne=te.stream.get_byte(te.position),ne===null){E.throw_error(k.error.representation("byte",C.indicator));return}E.prepend([new xe(S.goal.replace(new H("=",[new Le(ne,!1),Z])),S.substitution,S)])}},"put_byte/1":function(E,S,C){var R=C.args[0];E.prepend([new xe(S.goal.replace(new H(",",[new H("current_output",[new Se("S")]),new H("put_byte",[new Se("S"),R])])),S.substitution,S)])},"put_byte/2":function(E,S,C){var R=C.args[0],Z=C.args[1],te=k.type.is_stream(R)?R:E.get_stream_by_alias(R.id);k.type.is_variable(R)||k.type.is_variable(Z)?E.throw_error(k.error.instantiation(C.indicator)):k.type.is_byte(Z)?!k.type.is_variable(R)&&!k.type.is_stream(R)&&!k.type.is_atom(R)?E.throw_error(k.error.domain("stream_or_alias",R,C.indicator)):!k.type.is_stream(te)||te.stream===null?E.throw_error(k.error.existence("stream",R,C.indicator)):te.input?E.throw_error(k.error.permission("output","stream",R,C.indicator)):te.type==="text"?E.throw_error(k.error.permission("output","text_stream",R,C.indicator)):te.stream.put_byte(Z.value,te.position)&&(typeof te.position=="number"&&te.position++,E.success(S)):E.throw_error(k.error.type("byte",Z,C.indicator))},"read/1":function(E,S,C){var R=C.args[0];E.prepend([new xe(S.goal.replace(new H(",",[new H("current_input",[new Se("S")]),new H("read_term",[new Se("S"),R,new H("[]",[])])])),S.substitution,S)])},"read/2":function(E,S,C){var R=C.args[0],Z=C.args[1];E.prepend([new xe(S.goal.replace(new H("read_term",[R,Z,new H("[]",[])])),S.substitution,S)])},"read_term/2":function(E,S,C){var R=C.args[0],Z=C.args[1];E.prepend([new xe(S.goal.replace(new H(",",[new H("current_in
`;for(let r of this.project.workspacesByCwd.values()){let o=r.relativeCwd;e+=`workspace(${fh(o)}).
`,e+=`workspace_ident(${fh(o)}, ${fh(Y.stringifyIdent(r.locator))}).
`,e+=`workspace_version(${fh(o)}, ${fh(r.manifest.version)}).
`;for(let a of Pme)for(let n of r.manifest[a].values())e+=`workspace_has_dependency(${fh(o)}, ${fh(Y.stringifyIdent(n))}, ${fh(n.range)}, ${a}).
2022-08-27 06:35:11 +00:00
`}return e+=`workspace(_) :- false.
`,e+=`workspace_ident(_, _) :- false.
`,e+=`workspace_version(_, _) :- false.
`,e+=`workspace_has_dependency(_, _, _, _) :- false.
`,e}getDeclarations(){let e="";return e+=`gen_enforced_dependency(_, _, _, _) :- false.
`,e+=`gen_enforced_field(_, _, _) :- false.
`,e}get fullSource(){return`${this.getProjectDatabase()}
${this.source}
2022-09-06 17:07:18 +00:00
${this.getDeclarations()}`}createSession(){return new HK(this.project,this.fullSource)}async process(){let e=this.createSession();return{enforcedDependencies:await this.genEnforcedDependencies(e),enforcedFields:await this.genEnforcedFields(e)}}async genEnforcedDependencies(e){let r=[];for await(let o of e.makeQuery("workspace(WorkspaceCwd), dependency_type(DependencyType), gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType).")){let a=ee.resolve(this.project.cwd,rm(o.links.WorkspaceCwd)),n=rm(o.links.DependencyIdent),c=rm(o.links.DependencyRange),f=rm(o.links.DependencyType);if(a===null||n===null)throw new Error("Invalid rule");let g=this.project.getWorkspaceByCwd(a),p=Y.parseIdent(n);r.push({workspace:g,dependencyIdent:p,dependencyRange:c,dependencyType:f})}return Ve.sortMap(r,[({dependencyRange:o})=>o!==null?"0":"1",({workspace:o})=>Y.stringifyIdent(o.locator),({dependencyIdent:o})=>Y.stringifyIdent(o)])}async genEnforcedFields(e){let r=[];for await(let o of e.makeQuery("workspace(WorkspaceCwd), gen_enforced_field(WorkspaceCwd, FieldPath, FieldValue).")){let a=ee.resolve(this.project.cwd,rm(o.links.WorkspaceCwd)),n=rm(o.links.FieldPath),c=S0t(o.links.FieldValue);if(a===null||n===null)throw new Error("Invalid rule");let f=this.project.getWorkspaceByCwd(a);r.push({workspace:f,fieldPath:n,fieldValue:c})}return Ve.sortMap(r,[({workspace:o})=>Y.stringifyIdent(o.locator),({fieldPath:o})=>o])}async*query(e){let r=this.createSession();for await(let o of r.makeQuery(e)){let a={};for(let[n,c]of Object.entries(o.links))n!=="_"&&(a[n]=rm(c));yield a}}}});var jme=K(wP=>{"use strict";Object.defineProperty(wP,"__esModule",{value:!0});function _1(t){let e=[...t.caches],r=e.shift();return r===void 0?Gme():{get(o,a,n={miss:()=>Promise.resolve()}){return r.get(o,a,n).catch(()=>_1({caches:e}).get(o,a,n))},set(o,a){return r.set(o,a).catch(()=>_1({caches:e}).set(o,a))},delete(o){return r.delete(o).catch(()=>_1({caches:e}).delete(o))},clear(){return r.clear().catch(()=>_1({caches:e}).clear())}}}function Gme(){return{get(t,e,r={miss:()=>Promise.resolve()}){return e().then(a=>Promise.all([a,r.miss(a)])).then(([a])=>a)},set(t,e){return Promise.resolve(e)},delete(t){return Promise.resolve()},clear(){return Promise.resolve()}}}wP.createFallbackableCache=_1;wP.createNullCache=Gme});var Wme=K((x5t,Yme)=>{Yme.exports=jme()});var Jme=K(iH=>{"use strict";Object.defineProperty(iH,"__esModule",{value:!0});function V0t(t={serializable:!0}){let e={};return{get(r,o,a={miss:()=>Promise.resolve()}){let n=JSON.stringify(r);if(n in e)return Promise.resolve(t.serializable?JSON.parse(e[n]):e[n]);let c=o(),f=a&&a.miss||(()=>Promise.resolve());return c.then(g=>f(g)).then(()=>c)},set(r,o){return e[JSON.stringify(r)]=t.serializable?JSON.stringify(o):o,Promise.resolve(o)},delete(r){return delete e[JSON.stringify(r)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}iH.createInMemoryCache=V0t});var Vme=K((b5t,zme)=>{zme.exports=Jme()});var Zme=K(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});function X0t(t,e,r){let o={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers(){return t===sH.WithinHeaders?o:{}},queryParameters(){return t===sH.WithinQueryParameters?o:{}}}}function Z0t(t){let e=0,r=()=>(e++,new Promise(o=>{setTimeout(()=>{o(t(r))},Math.min(100*e,1e3))}));return t(r)}function Xme(t,e=(r,o)=>Promise.resolve()){return Object.assign(t,{wait(r){return Xme(t.then(o=>Promise.all([e(o,r),o])).then(o=>o[1]))}})}function $0t(t){let e=t.length-1;for(e;e>0;e--){let r=Math.floor(Math.random()*(e+1)),o=t[e];t[e]=t[r],t[r]=o}return t}function edt(t,e){return Object.keys(e!==void 0?e:{}).forEach(r=>{t[r]=e[r](t)}),t}function tdt(t,...e){let r=0;return t.replace(/%s/g,()=>encodeURIComponent(e[r++]))}var rdt="4.2.0",ndt=t=>()=>t.transporter.requester.destroy(),sH={WithinQueryParameters:0,WithinHeaders:1};vc.AuthMode=sH;vc.addMethods=edt;vc.createAuth=X0t;vc.createRetryablePromise=Z0t;vc.createWaitablePromise=Xme;vc.destroy=ndt;vc.encode=tdt;vc.shuffle=$0t;vc.version=rdt});var K1=K((R5t,$me)=>{$me.e
`;f!==o&&(o=f,t.write(Sye.default.eraseLines(r)+f),r=f.split(`
`).length)};return n.clear=()=>{t.write(Sye.default.eraseLines(r)),o="",r=0},n.done=()=>{o="",r=0,e||(kye.default.show(),a=!1)},n};Z1.default={create:sCt}});var bye=K((A9t,oCt)=>{oCt.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY_BUILD_BASE",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}}]});var Tye=K(UA=>{"use strict";var Rye=bye(),Lu=process.env;Object.defineProperty(UA,"_vendors",{value:Rye.map(function(t){return t.constant})});UA.name=null;UA.isPR=null;Rye.forEach(function(t){var e=Array.isArray(t.env)?t.env:[t.env],r=e.every(function(o){return Fye(o)});if(UA[t.constant]=r,r)switch(UA.name=t.name,typeof t.pr){case"string":UA.isPR=!!Lu[t.pr];break;case"object":"env"in t.pr?UA.isPR=t.pr.env in Lu&&Lu[t.pr.env]!==t.pr.ne:"any"in t.pr?UA.isPR=t.pr.any.some(function(o){return!!Lu[o]}):UA.isPR=Fye(t.pr);break;default:UA.isPR=null}});UA.isCI=!!(Lu.CI||Lu.CONTINUOUS_INTEGRATION||Lu.BUILD_NUMBER||Lu.RUN_ID||UA.name);function Fye(t){return typeof t=="string"?!!Lu[t]:Object.keys(t).every(function(e){return Lu[e]===t[e]})}});var Nye=K((c9t,Mye)=>{"use strict";Mye.exports=Tye().isCI});var Oye=K((u9t,Lye)=>{"use strict";var aCt=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};Lye.exports=(t,{include:e,exclude:r}={})=>{let o=a=>{let n=c=>typeof c=="string"?a===c:c.test(a);return e?e.some(n):r?!r.some(n):!0};for(let[a,n]of aCt(t.constructor.prototype)){if(n==="constructor"||!o(n))continue;let c=Reflect.getOwnPropertyDescriptor(a,n);c&&typeof c.value=="function"&&(t[n]=t[n].bind(t))}return t}});var jye=K(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});var WI,t2,HP,qP,YH;typeof window>"u"||typeof MessageChannel!="function"?(YI=null,_H=null,KH=function(){if(YI!==null)try{var t=Hn.unstable_now();YI(!0,t),YI=null}catch(e){throw setTimeout(KH,0),e}},Uye=Date.now(),Hn.unstable_now=function(){return Date.now()-Uye},WI=function(t){YI!==null?setTimeout(WI,0,t):(YI=t,setTimeout(KH,0))},t2=function(t,e){_H=setTimeout(t,e)},HP=function(){clearTimeout(_H)},qP=function(){return!1},YH=Hn.unstable_forceFrameRate=function(){}):(OP=window.perf
in `+(j||"Unknown")+pe}v+=M,D=D.return}while(D);return v}var Je=[],jn=-1;function ni(D){0>jn||(D.current=Je[jn],Je[jn]=null,jn--)}function Xt(D,v){jn++,Je[jn]=D.current,D.current=v}var Ri={},Yn={current:Ri},us={current:!1},Dt=Ri;function Vi(D,v){var M=D.type.contextTypes;if(!M)return Ri;var j=D.stateNode;if(j&&j.__reactInternalMemoizedUnmaskedChildContext===v)return j.__reactInternalMemoizedMaskedChildContext;var z={},pe;for(pe in M)z[pe]=v[pe];return j&&(D=D.stateNode,D.__reactInternalMemoizedUnmaskedChildContext=v,D.__reactInternalMemoizedMaskedChildContext=z),z}function xn(D){return D=D.childContextTypes,D!=null}function fs(D){ni(us,D),ni(Yn,D)}function oA(D){ni(us,D),ni(Yn,D)}function Sr(D,v,M){if(Yn.current!==Ri)throw Error(n(168));Xt(Yn,v,D),Xt(us,M,D)}function Qo(D,v,M){var j=D.stateNode;if(D=v.childContextTypes,typeof j.getChildContext!="function")return M;j=j.getChildContext();for(var z in j)if(!(z in D))throw Error(n(108,Ee(v)||"Unknown",z));return r({},M,{},j)}function fr(D){var v=D.stateNode;return v=v&&v.__reactInternalMemoizedMergedChildContext||Ri,Dt=Yn.current,Xt(Yn,v,D),Xt(us,us.current,D),!0}function Sa(D,v,M){var j=D.stateNode;if(!j)throw Error(n(169));M?(v=Qo(D,v,Dt),j.__reactInternalMemoizedMergedChildContext=v,ni(us,D),ni(Yn,D),Xt(Yn,v,D)):ni(us,D),Xt(us,M,D)}var $=a.unstable_runWithPriority,tn=a.unstable_scheduleCallback,we=a.unstable_cancelCallback,Lt=a.unstable_shouldYield,HA=a.unstable_requestPaint,Xi=a.unstable_now,_l=a.unstable_getCurrentPriorityLevel,jt=a.unstable_ImmediatePriority,aA=a.unstable_UserBlockingPriority,Lc=a.unstable_NormalPriority,$u=a.unstable_LowPriority,qA=a.unstable_IdlePriority,Oc={},Nn=HA!==void 0?HA:function(){},di=null,GA=null,Uc=!1,ea=Xi(),Zi=1e4>ea?Xi:function(){return Xi()-ea};function vo(){switch(_l()){case jt:return 99;case aA:return 98;case Lc:return 97;case $u:return 96;case qA:return 95;default:throw Error(n(332))}}function it(D){switch(D){case 99:return jt;case 98:return aA;case 97:return Lc;case 96:return $u;case 95:return qA;default:throw Error(n(332))}}function eo(D,v){return D=it(D),$(D,v)}function ka(D,v,M){return D=it(D),tn(D,v,M)}function Kl(D){return di===null?(di=[D],GA=tn(jt,xa)):di.push(D),Oc}function Hi(){if(GA!==null){var D=GA;GA=null,we(D)}xa()}function xa(){if(!Uc&&di!==null){Uc=!0;var D=0;try{var v=di;eo(99,function(){for(;D<v.length;D++){var M=v[D];do M=M(!0);while(M!==null)}}),di=null}catch(M){throw di!==null&&(di=di.slice(D+1)),tn(jt,Hi),M}finally{Uc=!1}}}var AA=3;function Dr(D,v,M){return M/=10,1073741821-(((1073741821-D+v/10)/M|0)+1)*M}function lA(D,v){return D===v&&(D!==0||1/D===1/v)||D!==D&&v!==v}var Bs=typeof Object.is=="function"?Object.is:lA,Ut=Object.prototype.hasOwnProperty;function Pn(D,v){if(Bs(D,v))return!0;if(typeof D!="object"||D===null||typeof v!="object"||v===null)return!1;var M=Object.keys(D),j=Object.keys(v);if(M.length!==j.length)return!1;for(j=0;j<M.length;j++)if(!Ut.call(v,M[j])||!Bs(D[M[j]],v[M[j]]))return!1;return!0}function Ai(D,v){if(D&&D.defaultProps){v=r({},v),D=D.defaultProps;for(var M in D)v[M]===void 0&&(v[M]=D[M])}return v}var ta={current:null},to=null,Qs=null,ra=null;function Zt(){ra=Qs=to=null}function na(D,v){var M=D.type._context;k?(Xt(ta,M._currentValue,D),M._currentValue=v):(Xt(ta,M._currentValue2,D),M._currentValue2=v)}function vs(D){var v=ta.current;ni(ta,D),D=D.type._context,k?D._currentValue=v:D._currentValue2=v}function ro(D,v){for(;D!==null;){var M=D.alternate;if(D.childExpirationTime<v)D.childExpirationTime=v,M!==null&&M.childExpirationTime<v&&(M.childExpirationTime=v);else if(M!==null&&M.childExpirationTime<v)M.childExpirationTime=v;else break;D=D.return}}function no(D,v){to=D,ra=Qs=null,D=D.dependencies,D!==null&&D.firstContext!==null&&(D.expirationTime>=v&&(aa=!0),D.firstContext=null)}function io(D,v){if(ra!==D&&v!==!1&&v!==0)if((typeof v!="number"||v===1073741823)&&(ra=D,v=1073741823),v={context:D,observedBits:v,next:null},Qs===null){if(to===null)throw Error(n(308));Qs=v,to.dependencies={expirationTime:0,firstContext:v,responders:null}}else Qs=Qs.next=v;return k?D._currentValue:D._currentVal
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`+KA(z))}gs!==Jl&&(gs=Mi),pe=Hh(pe,z),wt=j;do{switch(wt.tag){case 3:ke=pe,wt.effectTag|=4096,wt.expirationTime=v;var $e=yQ(wt,ke,v);jA(wt,$e);break e;case 1:ke=pe;var ht=wt.type,Wt=wt.stateNode;if((wt.effectTag&64)===0&&(typeof ht.getDerivedStateFromError=="function"||Wt!==null&&typeof Wt.componentDidCatch=="function"&&(Wc===null||!Wc.has(Wt)))){wt.effectTag|=4096,wt.expirationTime=v;var kr=IQ(wt,ke,v);jA(wt,kr);break e}}wt=wt.return}while(wt!==null)}Yr=vQ(Yr)}catch(Ln){v=Ln;continue}break}while(1)}function uf(){var D=qg.current;return qg.current=xo,D===null?xo:D}function PE(D,v){D<hA&&2<D&&(hA=D),v!==null&&D<sf&&2<D&&(sf=D,aC=v)}function uC(D){D>Gg&&(Gg=D)}function kF(){for(;Yr!==null;)Yr=QQ(Yr)}function xF(){for(;Yr!==null&&!Lt();)Yr=QQ(Yr)}function QQ(D){var v=SQ(D.alternate,D,xs);return D.memoizedProps=D.pendingProps,v===null&&(v=vQ(D)),vE.current=null,v}function vQ(D){Yr=D;do{var v=Yr.alternate;if(D=Yr.return,(Yr.effectTag&2048)===0){e:{var M=v;v=Yr;var j=xs,z=v.pendingProps;switch(v.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:xn(v.type)&&fs(v);break;case 3:JA(v),oA(v),z=v.stateNode,z.pendingContext&&(z.context=z.pendingContext,z.pendingContext=null),(M===null||M.child===null)&&fA(v)&&Na(v),XA(v);break;case 5:Ng(v);var pe=sa(WA.current);if(j=v.type,M!==null&&v.stateNode!=null)Ss(M,v,j,z,pe),M.ref!==v.ref&&(v.effectTag|=128);else if(z){if(M=sa(so.current),fA(v)){if(z=v,!C)throw Error(n(175));M=bg(z.stateNode,z.type,z.memoizedProps,pe,M,z),z.updateQueue=M,M=M!==null,M&&Na(v)}else{var ke=dt(j,z,pe,M,v);Yl(ke,v,!1,!1),v.stateNode=ke,_e(ke,j,z,pe,M)&&Na(v)}v.ref!==null&&(v.effectTag|=128)}else if(v.stateNode===null)throw Error(n(166));break;case 6:if(M&&v.stateNode!=null)$r(M,v,M.memoizedProps,z);else{if(typeof z!="string"&&v.stateNode===null)throw Error(n(166));if(M=sa(WA.current),pe=sa(so.current),fA(v)){if(M=v,!C)throw Error(n(176));(M=Fg(M.stateNode,M.memoizedProps,M))&&Na(v)}else v.stateNode=Ct(z,M,pe,v)}break;case 11:break;case 13:if(ni(si,v),z=v.memoizedState,(v.effectTag&64)!==0){v.expirationTime=j;break e}z=z!==null,pe=!1,M===null?v.memoizedProps.fallback!==void 0&&fA(v):(j=M.memoizedState,pe=j!==null,z||j===null||(j=M.child.sibling,j!==null&&(ke=v.firstEffect,ke!==null?(v.firstEffect=j,j.nextEffect=ke):(v.firstEffect=v.lastEffect=j,j.nextEffect=null),j.effectTag=8))),z&&!pe&&(v.mode&2)!==0&&(M===null&&v.memoizedProps.unstable_avoidThisFallback!==!0||(si.current&1)!==0?gs===jc&&(gs=La):((gs===jc||gs===La)&&(gs=ZA),Gg!==0&&xi!==null&&(pf(xi,xs),xQ(xi,Gg)))),S&&z&&(v.effectTag|=4),E&&(z||pe)&&(v.effectTag|=4);break;case 7:break;case 8:break;case 12:break;case 4:JA(v),XA(v);break;case 10:vs(v);break;case 9:break;case 14:break;case 17:xn(v.type)&&fs(v);break;case 19:if(ni(si,v),z=v.memoizedState,z===null)break;if(pe=(v.effectTag&64)!==0,ke=z.rendering,ke===null){if(pe)Wl(z,!1);else if(gs!==jc||M!==null&&(M.effectTag&64)!==0)for(M=v.child;M!==null;){if(ke=ef(M),ke!==null){for(v.effectTag|=64,Wl(z,!1),M=ke.updateQueue,M!==null&&(v.updateQueue=M,v.effectTag|=4),z.lastEffect===null&&(v.firstEffect=null),v.lastEffect=z.lastEffect,M=j,z=v.child;z!==null;)pe=z,j=M,pe.effectTag&=2,pe.nextEffect=null,pe.firstEffect=null,pe.lastEffect=null,ke=pe.alternate,ke===null?(pe.childExpirationTime=0,pe.expirationTime=j,pe.child=null,pe.memoizedProps=null,pe.memoizedState=null,pe.updateQueue=null,pe.dependencies=null):(pe.childExpirationTime=ke.childExpirationTime,pe.expirationTime=ke.expirationTime,pe.child=ke.child,pe.memoizedProps=ke.memoizedProps,pe.memoizedState=ke.memoizedState,pe.updateQueue=ke.updateQueue,j=ke.dependencies,pe.dependencies=j===null?null:{expirationTime:j.expirationTime,firstContext:j.firstContext,responders:j.responders}),z=z.sibling;Xt(si,si.current&1|2,v),v=v.child;break e}M=M.sibling}}else{if(!pe)if(M=ef(ke),M!==null){if(v.effectTag|=64,pe=!0,M=M.updateQueue,M!==null&&(v.updateQueue=M,v.effectTag|=4),Wl(z,!0),z.tail===null&&z.tailMode==="hidden"&&!ke.alternate){v=v.lastEffect=z.
`+Module.extraStackTrace()),demangleAll(t)}Module.stackTrace=stackTrace;var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;TOTAL_MEMORY<TOTAL_STACK&&Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),Module.buffer?buffer=Module.buffer:buffer=new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews();function getTotalMemory(){return TOTAL_MEMORY}if(HEAP32[0]=1668509029,HEAP16[1]=25459,HEAPU8[2]!==115||HEAPU8[3]!==99)throw"Runtime error: expected the system to be little-endian!";Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;function callRuntimeCallbacks(t){for(;t.length>0;){var e=t.shift();if(typeof e=="function"){e();continue}var r=e.func;typeof r=="number"?e.arg===void 0?Module.dynCall_v(r):Module.dynCall_vi(r,e.arg):r(e.arg===void 0?null:e.arg)}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(t){__ATPRERUN__.unshift(t)}Module.addOnPreRun=addOnPreRun;function addOnInit(t){__ATINIT__.unshift(t)}Module.addOnInit=addOnInit;function addOnPreMain(t){__ATMAIN__.unshift(t)}Module.addOnPreMain=addOnPreMain;function addOnExit(t){__ATEXIT__.unshift(t)}Module.addOnExit=addOnExit;function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}Module.addOnPostRun=addOnPostRun;function intArrayFromString(t,e,r){var o=r>0?r:lengthBytesUTF8(t)+1,a=new Array(o),n=stringToUTF8Array(t,a,0,a.length);return e&&(a.length=n),a}Module.intArrayFromString=intArrayFromString;function intArrayToString(t){for(var e=[],r=0;r<t.length;r++){var o=t[r];o>255&&(o&=255),e.push(String.fromCharCode(o))}return e.join("")}Module.intArrayToString=intArrayToString;function writeStringToMemory(t,e,r){Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var o,a;r&&(a=e+lengthBytesUTF8(t),o=HEAP8[a]),stringToUTF8(t,e,1/0),r&&(HEAP8[a]=o)}Module.writeStringToMemory=writeStringToMemory;function writeArrayToMemory(t,e){HEAP8.set(t,e)}Module.writeArrayToMemory=writeArrayToMemory;function
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,r="abort("+t+") at "+stackTrace()+e;throw abortDecorators&&abortDecorators.forEach(function(o){r=o(r,t)}),r}if(Module.abort=Module.abort=abort,Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()})});var gm=K((C9t,nIe)=>{"use strict";var gCt=tIe(),pCt=rIe(),$H=!1,eq=null;pCt({},function(t,e){if(!$H){if($H=!0,t)throw t;eq=e}});if(!$H)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");nIe.exports=gCt(eq.bind,eq.lib)});var rq=K((y9t,tq)=>{"use strict";var iIe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);tq.exports=iIe;tq.exports.default=iIe});var oIe=K((I9t,sIe)=>{"use strict";sIe.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD8
`))e=Math.max(e,CCt(r));return e};iq.exports=AIe;iq.exports.default=AIe});var lIe=K(i2=>{"use strict";var yCt=i2&&i2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(i2,"__esModule",{value:!0});var ICt=yCt(sq()),oq={};i2.default=t=>{if(t.length===0)return{width:0,height:0};if(oq[t])return oq[t];let e=ICt.default(t),r=t.split(`
`).length;return oq[t]={width:e,height:r},{width:e,height:r}}});var cIe=K(s2=>{"use strict";var ECt=s2&&s2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(s2,"__esModule",{value:!0});var Sn=ECt(gm()),wCt=(t,e)=>{"position"in e&&t.setPositionType(e.position==="absolute"?Sn.default.POSITION_TYPE_ABSOLUTE:Sn.default.POSITION_TYPE_RELATIVE)},BCt=(t,e)=>{"marginLeft"in e&&t.setMargin(Sn.default.EDGE_START,e.marginLeft||0),"marginRight"in e&&t.setMargin(Sn.default.EDGE_END,e.marginRight||0),"marginTop"in e&&t.setMargin(Sn.default.EDGE_TOP,e.marginTop||0),"marginBottom"in e&&t.setMargin(Sn.default.EDGE_BOTTOM,e.marginBottom||0)},QCt=(t,e)=>{"paddingLeft"in e&&t.setPadding(Sn.default.EDGE_LEFT,e.paddingLeft||0),"paddingRight"in e&&t.setPadding(Sn.default.EDGE_RIGHT,e.paddingRight||0),"paddingTop"in e&&t.setPadding(Sn.default.EDGE_TOP,e.paddingTop||0),"paddingBottom"in e&&t.setPadding(Sn.default.EDGE_BOTTOM,e.paddingBottom||0)},vCt=(t,e)=>{var r;"flexGrow"in e&&t.setFlexGrow((r=e.flexGrow)!==null&&r!==void 0?r:0),"flexShrink"in e&&t.setFlexShrink(typeof e.flexShrink=="number"?e.flexShrink:1),"flexDirection"in e&&(e.flexDirection==="row"&&t.setFlexDirection(Sn.default.FLEX_DIRECTION_ROW),e.flexDirection==="row-reverse"&&t.setFlexDirection(Sn.default.FLEX_DIRECTION_ROW_REVERSE),e.flexDirection==="column"&&t.setFlexDirection(Sn.default.FLEX_DIRECTION_COLUMN),e.flexDirection==="column-reverse"&&t.setFlexDirection(Sn.default.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in e&&(typeof e.flexBasis=="number"?t.setFlexBasis(e.flexBasis):typeof e.flexBasis=="string"?t.setFlexBasisPercent(Number.parseInt(e.flexBasis,10)):t.setFlexBasis(NaN)),"alignItems"in e&&((e.alignItems==="stretch"||!e.alignItems)&&t.setAlignItems(Sn.default.ALIGN_STRETCH),e.alignItems==="flex-start"&&t.setAlignItems(Sn.default.ALIGN_FLEX_START),e.alignItems==="center"&&t.setAlignItems(Sn.default.ALIGN_CENTER),e.alignItems==="flex-end"&&t.setAlignItems(Sn.default.ALIGN_FLEX_END)),"alignSelf"in e&&((e.alignSelf==="auto"||!e.alignSelf)&&t.setAlignSelf(Sn.default.ALIGN_AUTO),e.alignSelf==="flex-start"&&t.setAlignSelf(Sn.default.ALIGN_FLEX_START),e.alignSelf==="center"&&t.setAlignSelf(Sn.default.ALIGN_CENTER),e.alignSelf==="flex-end"&&t.setAlignSelf(Sn.default.ALIGN_FLEX_END)),"justifyContent"in e&&((e.justifyContent==="flex-start"||!e.justifyContent)&&t.setJustifyContent(Sn.default.JUSTIFY_FLEX_START),e.justifyContent==="center"&&t.setJustifyContent(Sn.default.JUSTIFY_CENTER),e.justifyContent==="flex-end"&&t.setJustifyContent(Sn.default.JUSTIFY_FLEX_END),e.justifyContent==="space-between"&&t.setJustifyContent(Sn.default.JUSTIFY_SPACE_BETWEEN),e.justifyContent==="space-around"&&t.setJustifyContent(Sn.default.JUSTIFY_SPACE_AROUND))},DCt=(t,e)=>{var r,o;"width"in e&&(typeof e.width=="number"?t.setWidth(e.width):typeof e.width=="string"?t.setWidthPercent(Number.parseInt(e.width,10)):t.setWidthAuto()),"height"in e&&(typeof e.height=="number"?t.setHeight(e.height):typeof e.height=="string"?t.setHeightPercent(Number.parseInt(e.height,10)):t.setHeightAuto()),"minWidth"in e&&(typeof e.minWidth=="string"?t.setMinWidthPercent(Number.parseInt(e.minWidth,10)):t.setMinWidth((r=e.minWidth)!==null&&r!==void 0?r:0)),"minHeight"in e&&(typeof e.minHeight=="string"?t.setMinHeightPercent(Number.parseInt(e.minHeight,10)):t.setMinHeight((o=e.minHeight)!==null&&o!==void 0?o:0))},SCt=(t,e)=>{"display"in e&&t.setDisplay(e.display==="flex"?Sn.default.DISPLAY_FLEX:Sn.default.DISPLAY_NONE)},kCt=(t,e)=>{if("borderStyle"in e){let r=typeof e.borderStyle=="string"?1:0;t.setBorder(Sn.default.EDGE_TOP,r),t.setBorder(Sn.default.EDGE_BOTTOM,r),t.setBorder(Sn.default.EDGE_LEFT,r),t.setBorder(Sn.default.EDGE_RIGHT,r)}};s2.default=(t,e={})=>{wCt(t,e),BCt(t,e),QCt(t,e),vCt(t,e),DCt(t,e),SCt(t,e),kCt(t,e)}});var gIe=K((v9t,fIe)=>{"use strict";var o2=JP(),xCt=CD(),PCt=Tw(),Aq=new Set(["\x1B","\x9B"]),bCt=39,uIe=t=>`${Aq.values().next().value}[${t}m`,FCt=t=>t.split(" ").map(e=>o2(e)),aq=(t,e,r)=>{let o=[...e],a=!1,n=o2(xCt(t[t.length-1]));for(let[c,f]of o.entries()){let g=o2(f)
`);for(let[g,p]of[...o].entries()){if(a+=p,Aq.has(p)){let B=parseFloat(/\d[^m]*/.exec(o.slice(g,g+4)));n=B===bCt?null:B}let I=PCt.codes.get(Number(n));n&&I&&(o[g+1]===`
`?a+=uIe(I):p===`
`&&(a+=uIe(n)))}return a};fIe.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
2022-08-27 06:35:11 +00:00
`).split(`
2022-09-06 17:07:18 +00:00
`).map(o=>TCt(o,e,r)).join(`
`)});var dIe=K((D9t,hIe)=>{"use strict";var pIe="[\uD800-\uDBFF][\uDC00-\uDFFF]",MCt=t=>t&&t.exact?new RegExp(`^${pIe}$`):new RegExp(pIe,"g");hIe.exports=MCt});var lq=K((S9t,IIe)=>{"use strict";var NCt=rq(),LCt=dIe(),mIe=Tw(),yIe=["\x1B","\x9B"],zP=t=>`${yIe[0]}[${t}m`,CIe=(t,e,r)=>{let o=[];t=[...t];for(let a of t){let n=a;a.match(";")&&(a=a.split(";")[0][0]+"0");let c=mIe.codes.get(parseInt(a,10));if(c){let f=t.indexOf(c.toString());f>=0?t.splice(f,1):o.push(zP(e?c:n))}else if(e){o.push(zP(0));break}else o.push(zP(n))}if(e&&(o=o.filter((a,n)=>o.indexOf(a)===n),r!==void 0)){let a=zP(mIe.codes.get(parseInt(r,10)));o=o.reduce((n,c)=>c===a?[c,...n]:[...n,c],[])}return o.join("")};IIe.exports=(t,e,r)=>{let o=[...t.normalize()],a=[];r=typeof r=="number"?r:o.length;let n=!1,c,f=0,g="";for(let[p,I]of o.entries()){let B=!1;if(yIe.includes(I)){let Q=/\d[^m]*/.exec(t.slice(p,p+18));c=Q&&Q.length>0?Q[0]:void 0,f<r&&(n=!0,c!==void 0&&a.push(c))}else n&&I==="m"&&(n=!1,B=!0);if(!n&&!B&&++f,!LCt({exact:!0}).test(I)&&NCt(I.codePointAt())&&++f,f>e&&f<=r)g+=I;else if(f===e&&!n&&c!==void 0)g=CIe(a);else if(f>=r){g+=CIe(a,!0,c);break}}return g}});var wIe=K((k9t,EIe)=>{"use strict";var hh=lq(),OCt=JP();function VP(t,e,r){if(t.charAt(e)===" ")return e;for(let o=1;o<=3;o++)if(r){if(t.charAt(e+o)===" ")return e+o}else if(t.charAt(e-o)===" ")return e-o;return e}EIe.exports=(t,e,r)=>{r={position:"end",preferTruncationOnSpace:!1,...r};let{position:o,space:a,preferTruncationOnSpace:n}=r,c="\u2026",f=1;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof t}`);if(typeof e!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof e}`);if(e<1)return"";if(e===1)return c;let g=OCt(t);if(g<=e)return t;if(o==="start"){if(n){let p=VP(t,g-e+1,!0);return c+hh(t,p,g).trim()}return a===!0&&(c+=" ",f=2),c+hh(t,g-e+f,g)}if(o==="middle"){a===!0&&(c=" "+c+" ",f=3);let p=Math.floor(e/2);if(n){let I=VP(t,p),B=VP(t,g-(e-p)+1,!0);return hh(t,0,I)+c+hh(t,B,g).trim()}return hh(t,0,p)+c+hh(t,g-(e-p)+f,g)}if(o==="end"){if(n){let p=VP(t,e-1);return hh(t,0,p)+c}return a===!0&&(c=" "+c,f=2),hh(t,0,e-f)+c}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${o}`)}});var uq=K(a2=>{"use strict";var BIe=a2&&a2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(a2,"__esModule",{value:!0});var UCt=BIe(gIe()),_Ct=BIe(wIe()),cq={};a2.default=(t,e,r)=>{let o=t+String(e)+String(r);if(cq[o])return cq[o];let a=t;if(r==="wrap"&&(a=UCt.default(t,e,{trim:!1,hard:!0})),r.startsWith("truncate")){let n="end";r==="truncate-middle"&&(n="middle"),r==="truncate-start"&&(n="start"),a=_Ct.default(t,e,{position:n})}return cq[o]=a,a}});var gq=K(fq=>{"use strict";Object.defineProperty(fq,"__esModule",{value:!0});var QIe=t=>{let e="";if(t.childNodes.length>0)for(let r of t.childNodes){let o="";r.nodeName==="#text"?o=r.nodeValue:((r.nodeName==="ink-text"||r.nodeName==="ink-virtual-text")&&(o=QIe(r)),o.length>0&&typeof r.internal_transform=="function"&&(o=r.internal_transform(o))),e+=o}return e};fq.default=QIe});var pq=K(Si=>{"use strict";var A2=Si&&Si.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Si,"__esModule",{value:!0});Si.setTextNodeValue=Si.createTextNode=Si.setStyle=Si.setAttribute=Si.removeChildNode=Si.insertBeforeNode=Si.appendChildNode=Si.createNode=Si.TEXT_NAME=void 0;var KCt=A2(gm()),vIe=A2(lIe()),HCt=A2(cIe()),qCt=A2(uq()),GCt=A2(gq());Si.TEXT_NAME="#text";Si.createNode=t=>{var e;let r={nodeName:t,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:t==="ink-virtual-text"?void 0:KCt.default.Node.create()};return t==="ink-text"&&((e=r.yogaNode)===null||e===void 0||e.setMeasureFunc(jCt.bind(null,r))),r};Si.appendChildNode=(t,e)=>{var r;e.parentNode&&Si.removeChildNode(e.parentNode,e),e.parentNode=t,t.childNodes.push(e),e.yogaNode&&((r=t.yogaNode)===null||r===void 0||r.insertChild(e.yogaNode,t.yogaNode.getChildCount())),(t.nodeName==="ink-text"||t.nodeName==="ink-virtual-text")&&XP(t)};Si.insertBefo
2022-08-27 06:35:11 +00:00
`:`
2022-09-06 17:07:18 +00:00
`)+r,a=o+1,o=t.indexOf(`
`,a)}while(o!==-1);return n+=t.substr(a),n};OIe.exports={stringReplaceAll:zCt,stringEncaseCRLFWithFirstIndex:VCt}});var GIe=K((O9t,qIe)=>{"use strict";var XCt=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,_Ie=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,ZCt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,$Ct=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,eyt=new Map([["n",`
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function HIe(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):eyt.get(t)||t}function tyt(t,e){let r=[],o=e.trim().split(/\s*,\s*/g),a;for(let n of o){let c=Number(n);if(!Number.isNaN(c))r.push(c);else if(a=n.match(ZCt))r.push(a[2].replace($Ct,(f,g,p)=>g?HIe(g):p));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${t}')`)}return r}function ryt(t){_Ie.lastIndex=0;let e=[],r;for(;(r=_Ie.exec(t))!==null;){let o=r[1];if(r[2]){let a=tyt(o,r[2]);e.push([o].concat(a))}else e.push([o])}return e}function KIe(t,e){let r={};for(let a of e)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let o=t;for(let[a,n]of Object.entries(r))if(!!Array.isArray(n)){if(!(a in o))throw new Error(`Unknown Chalk style: ${a}`);o=n.length>0?o[a](...n):o[a]}return o}qIe.exports=(t,e)=>{let r=[],o=[],a=[];if(e.replace(XCt,(n,c,f,g,p,I)=>{if(c)a.push(HIe(c));else if(g){let B=a.join("");a=[],o.push(r.length===0?B:KIe(t,r)(B)),r.push({inverse:f,styles:ryt(g)})}else if(p){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");o.push(KIe(t,r)(a.join(""))),a=[],r.pop()}else a.push(I)}),o.push(a.join("")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(n)}return o.join("")}});var nb=K((U9t,VIe)=>{"use strict";var u2=Tw(),{stdout:mq,stderr:Cq}=TM(),{stringReplaceAll:nyt,stringEncaseCRLFWithFirstIndex:iyt}=UIe(),{isArray:$P}=Array,YIe=["ansi","ansi","ansi256","ansi16m"],JI=Object.create(null),syt=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=mq?mq.level:0;t.level=e.level===void 0?r:e.level},yq=class{constructor(e){return WIe(e)}},WIe=t=>{let e={};return syt(e,t),e.template=(...r)=>zIe(e.template,...r),Object.setPrototypeOf(e,eb.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=yq,e.template};function eb(t){return WIe(t)}for(let[t,e]of Object.entries(u2))JI[t]={get(){let r=tb(this,Iq(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};JI.visible={get(){let t=tb(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var JIe=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of JIe)JI[t]={get(){let{level:e}=this;return function(...r){let o=Iq(u2.color[YIe[e]][t](...r),u2.color.close,this._styler);return tb(this,o,this._isEmpty)}}};for(let t of JIe){let e="bg"+t[0].toUpperCase()+t.slice(1);JI[e]={get(){let{level:r}=this;return function(...o){let a=Iq(u2.bgColor[YIe[r]][t](...o),u2.bgColor.close,this._styler);return tb(this,a,this._isEmpty)}}}}var oyt=Object.defineProperties(()=>{},{...JI,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),Iq=(t,e,r)=>{let o,a;return r===void 0?(o=t,a=e):(o=r.openAll+t,a=e+r.closeAll),{open:t,close:e,openAll:o,closeAll:a,parent:r}},tb=(t,e,r)=>{let o=(...a)=>$P(a[0])&&$P(a[0].raw)?jIe(o,zIe(o,...a)):jIe(o,a.length===1?""+a[0]:a.join(" "));return Object.setPrototypeOf(o,oyt),o._generator=t,o._styler=e,o._isEmpty=r,o},jIe=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:o,closeAll:a}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=nyt(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
`);return n!==-1&&(e=iyt(e,a,o,n)),o+e+a},dq,zIe=(t,...e)=>{let[r]=e;if(!$P(r)||!$P(r.raw))return e.join(" ");let o=e.slice(1),a=[r.raw[0]];for(let n=1;n<r.length;n++)a.push(String(o[n-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[n]));return dq===void 0&&(dq=GIe()),dq(t,a.join(""))};Object.defineProperties(eb.prototype,JI);var rb=eb();rb.supportsColor=mq;rb.stderr=eb({level:Cq?Cq.level:0});rb.stderr.supportsColor=Cq;VIe.exports=rb});var Eq=K(g2=>{"use strict";var ayt=g2&&g2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(g2,"__esModule",{value:!0});var f2=ayt(nb()),Ayt=/^(rgb|hsl|hsv|hwb)\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,lyt=/^(ansi|ansi256)\(\s?(\d+)\s?\)$/,ib=(t,e)=>e==="foreground"?t:"bg"+t[0].toUpperCase()+t.slice(1);g2.default=(t,e,r)=>{if(!e)return t;if(e in f2.default){let a=ib(e,r);return f2.default[a](t)}if(e.startsWith("#")){let a=ib("hex",r);return f2.default[a](e)(t)}if(e.startsWith("ansi")){let a=lyt.exec(e);if(!a)return t;let n=ib(a[1],r),c=Number(a[2]);return f2.default[n](c)(t)}if(e.startsWith("rgb")||e.startsWith("hsl")||e.startsWith("hsv")||e.startsWith("hwb")){let a=Ayt.exec(e);if(!a)return t;let n=ib(a[1],r),c=Number(a[2]),f=Number(a[3]),g=Number(a[4]);return f2.default[n](c,f,g)(t)}return t}});var ZIe=K(p2=>{"use strict";var XIe=p2&&p2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(p2,"__esModule",{value:!0});var cyt=XIe(LIe()),wq=XIe(Eq());p2.default=(t,e,r,o)=>{if(typeof r.style.borderStyle=="string"){let a=r.yogaNode.getComputedWidth(),n=r.yogaNode.getComputedHeight(),c=r.style.borderColor,f=cyt.default[r.style.borderStyle],g=wq.default(f.topLeft+f.horizontal.repeat(a-2)+f.topRight,c,"foreground"),p=(wq.default(f.vertical,c,"foreground")+`
`).repeat(n-2),I=wq.default(f.bottomLeft+f.horizontal.repeat(a-2)+f.bottomRight,c,"foreground");o.write(t,e,g,{transformers:[]}),o.write(t,e+1,p,{transformers:[]}),o.write(t+a-1,e+1,p,{transformers:[]}),o.write(t,e+n-1,I,{transformers:[]})}}});var eEe=K(h2=>{"use strict";var pm=h2&&h2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(h2,"__esModule",{value:!0});var uyt=pm(gm()),fyt=pm(sq()),gyt=pm(RIe()),pyt=pm(uq()),hyt=pm(TIe()),dyt=pm(gq()),myt=pm(ZIe()),Cyt=(t,e)=>{var r;let o=(r=t.childNodes[0])===null||r===void 0?void 0:r.yogaNode;if(o){let a=o.getComputedLeft(),n=o.getComputedTop();e=`
`.repeat(n)+gyt.default(e,a)}return e},$Ie=(t,e,r)=>{var o;let{offsetX:a=0,offsetY:n=0,transformers:c=[],skipStaticElements:f}=r;if(f&&t.internal_static)return;let{yogaNode:g}=t;if(g){if(g.getDisplay()===uyt.default.DISPLAY_NONE)return;let p=a+g.getComputedLeft(),I=n+g.getComputedTop(),B=c;if(typeof t.internal_transform=="function"&&(B=[t.internal_transform,...c]),t.nodeName==="ink-text"){let Q=dyt.default(t);if(Q.length>0){let x=fyt.default(Q),y=hyt.default(g);if(x>y){let T=(o=t.style.textWrap)!==null&&o!==void 0?o:"wrap";Q=pyt.default(Q,y,T)}Q=Cyt(t,Q),e.write(p,I,Q,{transformers:B})}return}if(t.nodeName==="ink-box"&&myt.default(p,I,t,e),t.nodeName==="ink-root"||t.nodeName==="ink-box")for(let Q of t.childNodes)$Ie(Q,e,{offsetX:p,offsetY:I,transformers:B,skipStaticElements:f})}};h2.default=$Ie});var rEe=K((q9t,tEe)=>{"use strict";tEe.exports=t=>{t=Object.assign({onlyFirst:!1},t);let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t.onlyFirst?void 0:"g")}});var iEe=K((G9t,Bq)=>{"use strict";var yyt=rEe(),nEe=t=>typeof t=="string"?t.replace(yyt(),""):t;Bq.exports=nEe;Bq.exports.default=nEe});var aEe=K((j9t,oEe)=>{"use strict";var sEe="[\uD800-\uDBFF][\uDC00-\uDFFF]";oEe.exports=t=>t&&t.exact?new RegExp(`^${sEe}$`):new RegExp(sEe,"g")});var lEe=K((Y9t,Qq)=>{"use strict";var Iyt=iEe(),Eyt=aEe(),AEe=t=>Iyt(t).replace(Eyt()," ").length;Qq.exports=AEe;Qq.exports.default=AEe});var fEe=K(d2=>{"use strict";var uEe=d2&&d2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(d2,"__esModule",{value:!0});var cEe=uEe(lq()),wyt=uEe(lEe()),vq=class{constructor(e){this.writes=[];let{width:r,height:o}=e;this.width=r,this.height=o}write(e,r,o,a){let{transformers:n}=a;!o||this.writes.push({x:e,y:r,text:o,transformers:n})}get(){let e=[];for(let o=0;o<this.height;o++)e.push(" ".repeat(this.width));for(let o of this.writes){let{x:a,y:n,text:c,transformers:f}=o,g=c.split(`
`),p=0;for(let I of g){let B=e[n+p];if(!B)continue;let Q=wyt.default(I);for(let x of f)I=x(I);e[n+p]=cEe.default(B,0,a)+I+cEe.default(B,a+Q),p++}}return{output:e.map(o=>o.trimRight()).join(`
`),height:e.length}}};d2.default=vq});var hEe=K(m2=>{"use strict";var Dq=m2&&m2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(m2,"__esModule",{value:!0});var Byt=Dq(gm()),gEe=Dq(eEe()),pEe=Dq(fEe());m2.default=(t,e)=>{var r;if(t.yogaNode.setWidth(e),t.yogaNode){t.yogaNode.calculateLayout(void 0,void 0,Byt.default.DIRECTION_LTR);let o=new pEe.default({width:t.yogaNode.getComputedWidth(),height:t.yogaNode.getComputedHeight()});gEe.default(t,o,{skipStaticElements:!0});let a;!((r=t.staticNode)===null||r===void 0)&&r.yogaNode&&(a=new pEe.default({width:t.staticNode.yogaNode.getComputedWidth(),height:t.staticNode.yogaNode.getComputedHeight()}),gEe.default(t.staticNode,a,{skipStaticElements:!1}));let{output:n,height:c}=o.get();return{output:n,outputHeight:c,staticOutput:a?`${a.get().output}
`:""}}return{output:"",outputHeight:0,staticOutput:""}}});var yEe=K((z9t,CEe)=>{"use strict";var dEe=Be("stream"),mEe=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],Sq={},Qyt=t=>{let e=new dEe.PassThrough,r=new dEe.PassThrough;e.write=a=>t("stdout",a),r.write=a=>t("stderr",a);let o=new console.Console(e,r);for(let a of mEe)Sq[a]=console[a],console[a]=o[a];return()=>{for(let a of mEe)console[a]=Sq[a];Sq={}}};CEe.exports=Qyt});var xq=K(kq=>{"use strict";Object.defineProperty(kq,"__esModule",{value:!0});kq.default=new WeakMap});var bq=K(Pq=>{"use strict";Object.defineProperty(Pq,"__esModule",{value:!0});var vyt=hn(),IEe=vyt.createContext({exit:()=>{}});IEe.displayName="InternalAppContext";Pq.default=IEe});var Rq=K(Fq=>{"use strict";Object.defineProperty(Fq,"__esModule",{value:!0});var Dyt=hn(),EEe=Dyt.createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});EEe.displayName="InternalStdinContext";Fq.default=EEe});var Mq=K(Tq=>{"use strict";Object.defineProperty(Tq,"__esModule",{value:!0});var Syt=hn(),wEe=Syt.createContext({stdout:void 0,write:()=>{}});wEe.displayName="InternalStdoutContext";Tq.default=wEe});var Lq=K(Nq=>{"use strict";Object.defineProperty(Nq,"__esModule",{value:!0});var kyt=hn(),BEe=kyt.createContext({stderr:void 0,write:()=>{}});BEe.displayName="InternalStderrContext";Nq.default=BEe});var sb=K(Oq=>{"use strict";Object.defineProperty(Oq,"__esModule",{value:!0});var xyt=hn(),QEe=xyt.createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{}});QEe.displayName="InternalFocusContext";Oq.default=QEe});var DEe=K((rYt,vEe)=>{"use strict";var Pyt=/[|\\{}()[\]^$+*?.-]/g;vEe.exports=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(Pyt,"\\$&")}});var PEe=K((nYt,xEe)=>{"use strict";var byt=DEe(),Fyt=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",kEe=[].concat(Be("module").builtinModules,"bootstrap_node","node").map(t=>new RegExp(`(?:\\((?:node:)?${t}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${t}(?:\\.js)?:\\d+:\\d+$)`));kEe.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var C2=class{constructor(e){e={ignoredPackages:[],...e},"internals"in e||(e.internals=C2.nodeInternals()),"cwd"in e||(e.cwd=Fyt),this._cwd=e.cwd.replace(/\\/g,"/"),this._internals=[].concat(e.internals,Ryt(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...kEe]}clean(e,r=0){r=" ".repeat(r),Array.isArray(e)||(e=e.split(`
`)),!/^\s*at /.test(e[0])&&/^\s*at /.test(e[1])&&(e=e.slice(1));let o=!1,a=null,n=[];return e.forEach(c=>{if(c=c.replace(/\\/g,"/"),this._internals.some(g=>g.test(c)))return;let f=/^\s*at /.test(c);o?c=c.trimEnd().replace(/^(\s+)at /,"$1"):(c=c.trim(),f&&(c=c.slice(3))),c=c.replace(`${this._cwd}/`,""),c&&(f?(a&&(n.push(a),a=null),n.push(c)):(o=!0,a=c))}),n.map(c=>`${r}${c}
`).join("")}captureString(e,r=this.captureString){typeof e=="function"&&(r=e,e=1/0);let{stackTraceLimit:o}=Error;e&&(Error.stackTraceLimit=e);let a={};Error.captureStackTrace(a,r);let{stack:n}=a;return Error.stackTraceLimit=o,this.clean(n)}capture(e,r=this.capture){typeof e=="function"&&(r=e,e=1/0);let{prepareStackTrace:o,stackTraceLimit:a}=Error;Error.prepareStackTrace=(f,g)=>this._wrapCallSite?g.map(this._wrapCallSite):g,e&&(Error.stackTraceLimit=e);let n={};Error.captureStackTrace(n,r);let{stack:c}=n;return Object.assign(Error,{prepareStackTrace:o,stackTraceLimit:a}),c}at(e=this.at){let[r]=this.capture(1,e);if(!r)return{};let o={line:r.getLineNumber(),column:r.getColumnNumber()};SEe(o,r.getFileName(),this._cwd),r.isConstructor()&&(o.constructor=!0),r.isEval()&&(o.evalOrigin=r.getEvalOrigin()),r.isNative()&&(o.native=!0);let a;try{a=r.getTypeName()}catch{}a&&a!=="Object"&&a!=="[object Object]"&&(o.type=a);let n=r.getFunctionName();n&&(o.function=n);let c=r.getMethodName();return c&&n!==c&&(o.method=c),o}parseLine(e){let r=e&&e.match(Tyt);if(!r)return null;let o=r[1]==="new",a=r[2],n=r[3],c=r[4],f=Number(r[5]),g=Number(r[6]),p=r[7],I=r[8],B=r[9],Q=r[10]==="native",x=r[11]===")",y,T={};if(I&&(T.line=Number(I)),B&&(T.column=Number(B)),x&&p){let U=0;for(let q=p.length-1;q>0;q--)if(p.charAt(q)===")")U++;else if(p.charAt(q)==="("&&p.charAt(q-1)===" "&&(U--,U===-1&&p.charAt(q-1)===" ")){let X=p.slice(0,q-1);p=p.slice(q+1),a+=` (${X}`;break}}if(a){let U=a.match(Myt);U&&(a=U[1],y=U[2])}return SEe(T,p,this._cwd),o&&(T.constructor=!0),n&&(T.evalOrigin=n,T.evalLine=f,T.evalColumn=g,T.evalFile=c&&c.replace(/\\/g,"/")),Q&&(T.native=!0),a&&(T.function=a),y&&a!==y&&(T.method=y),T}};function SEe(t,e,r){e&&(e=e.replace(/\\/g,"/"),e.startsWith(`${r}/`)&&(e=e.slice(r.length+1)),t.file=e)}function Ryt(t){if(t.length===0)return[];let e=t.map(r=>byt(r));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${e.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var Tyt=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),Myt=/^(.*?) \[as (.*?)\]$/;xEe.exports=C2});var FEe=K((iYt,bEe)=>{"use strict";bEe.exports=(t,e)=>t.replace(/^\t+/gm,r=>" ".repeat(r.length*(e||2)))});var TEe=K((sYt,REe)=>{"use strict";var Nyt=FEe(),Lyt=(t,e)=>{let r=[],o=t-e,a=t+e;for(let n=o;n<=a;n++)r.push(n);return r};REe.exports=(t,e,r)=>{if(typeof t!="string")throw new TypeError("Source code is missing.");if(!e||e<1)throw new TypeError("Line number must start from `1`.");if(t=Nyt(t).split(/\r?\n/),!(e>t.length))return r={around:3,...r},Lyt(e,r.around).filter(o=>t[o-1]!==void 0).map(o=>({line:o,value:t[o-1]}))}});var ob=K(xc=>{"use strict";var Oyt=xc&&xc.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),Uyt=xc&&xc.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_yt=xc&&xc.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&Oyt(e,t,r);return Uyt(e,t),e},Kyt=xc&&xc.__rest||function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(r[o[a]]=t[o[a]]);return r};Object.defineProperty(xc,"__esModule",{value:!0});var MEe=_yt(hn()),Uq=MEe.forwardRef((t,e)=>{var{children:r}=t,o=Kyt(t,["children"]);let a=Object.assign(Object.assign({},o),{marginLeft:o.marginLeft||o.marginX||o.margin||0,marginRight:o.marginRight||o.marginX||o.margin||0,marginTop:o.marginTop||o.marginY||o.margin||0,marginBottom:o.marginBottom||o.marginY||o.margin||0,paddingLeft:o.paddingLeft||o.paddingX||o.padding||0,paddingRight:o.paddingRight||o.paddingX||o.padding||0,paddingTop:o.paddingTop||o.paddingY||
`).slice(1):void 0,r=e?UEe.parseLine(e[0]):void 0,o,a=0;if((r==null?void 0:r.file)&&(r==null?void 0:r.line)&&LEe.existsSync(r.file)){let n=LEe.readFileSync(r.file,"utf8");if(o=Yyt.default(n,r.line),o)for(let{line:c}of o)a=Math.max(a,String(c).length)}return Ls.default.createElement(Ig.default,{flexDirection:"column",padding:1},Ls.default.createElement(Ig.default,null,Ls.default.createElement(Ou.default,{backgroundColor:"red",color:"white"}," ","ERROR"," "),Ls.default.createElement(Ou.default,null," ",t.message)),r&&Ls.default.createElement(Ig.default,{marginTop:1},Ls.default.createElement(Ou.default,{dimColor:!0},r.file,":",r.line,":",r.column)),r&&o&&Ls.default.createElement(Ig.default,{marginTop:1,flexDirection:"column"},o.map(({line:n,value:c})=>Ls.default.createElement(Ig.default,{key:n},Ls.default.createElement(Ig.default,{width:a+1},Ls.default.createElement(Ou.default,{dimColor:n!==r.line,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0},String(n).padStart(a," "),":")),Ls.default.createElement(Ou.default,{key:n,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0}," "+c)))),t.stack&&Ls.default.createElement(Ig.default,{marginTop:1,flexDirection:"column"},t.stack.split(`
`).slice(1).map(n=>{let c=UEe.parseLine(n);return c?Ls.default.createElement(Ig.default,{key:n},Ls.default.createElement(Ou.default,{dimColor:!0},"- "),Ls.default.createElement(Ou.default,{dimColor:!0,bold:!0},c.function),Ls.default.createElement(Ou.default,{dimColor:!0,color:"gray"}," ","(",c.file,":",c.line,":",c.column,")")):Ls.default.createElement(Ig.default,{key:n},Ls.default.createElement(Ou.default,{dimColor:!0},"- "),Ls.default.createElement(Ou.default,{dimColor:!0,bold:!0},n))})))};Pc.default=Wyt});var HEe=K(bc=>{"use strict";var Jyt=bc&&bc.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),zyt=bc&&bc.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Vyt=bc&&bc.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&Jyt(e,t,r);return zyt(e,t),e},dm=bc&&bc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bc,"__esModule",{value:!0});var hm=Vyt(hn()),KEe=dm(UH()),Xyt=dm(bq()),Zyt=dm(Rq()),$yt=dm(Mq()),eIt=dm(Lq()),tIt=dm(sb()),rIt=dm(_Ee()),nIt=" ",iIt="\x1B[Z",sIt="\x1B",ab=class extends hm.PureComponent{constructor(){super(...arguments),this.state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0},this.rawModeEnabledCount=0,this.handleSetRawMode=e=>{let{stdin:r}=this.props;if(!this.isRawModeSupported())throw r===process.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
2022-08-27 06:35:11 +00:00
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink.
2022-09-06 17:07:18 +00:00
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(r.setEncoding("utf8"),e){this.rawModeEnabledCount===0&&(r.addListener("data",this.handleInput),r.resume(),r.setRawMode(!0)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(r.setRawMode(!1),r.removeListener("data",this.handleInput),r.pause())},this.handleInput=e=>{e===""&&this.props.exitOnCtrlC&&this.handleExit(),e===sIt&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(e===nIt&&this.focusNext(),e===iIt&&this.focusPrevious())},this.handleExit=e=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(e)},this.enableFocus=()=>{this.setState({isFocusEnabled:!0})},this.disableFocus=()=>{this.setState({isFocusEnabled:!1})},this.focusNext=()=>{this.setState(e=>{let r=e.focusables[0].id;return{activeFocusId:this.findNextFocusable(e)||r}})},this.focusPrevious=()=>{this.setState(e=>{let r=e.focusables[e.focusables.length-1].id;return{activeFocusId:this.findPreviousFocusable(e)||r}})},this.addFocusable=(e,{autoFocus:r})=>{this.setState(o=>{let a=o.activeFocusId;return!a&&r&&(a=e),{activeFocusId:a,focusables:[...o.focusables,{id:e,isActive:!0}]}})},this.removeFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.filter(o=>o.id!==e)}))},this.activateFocusable=e=>{this.setState(r=>({focusables:r.focusables.map(o=>o.id!==e?o:{id:e,isActive:!0})}))},this.deactivateFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.map(o=>o.id!==e?o:{id:e,isActive:!1})}))},this.findNextFocusable=e=>{let r=e.focusables.findIndex(o=>o.id===e.activeFocusId);for(let o=r+1;o<e.focusables.length;o++)if(e.focusables[o].isActive)return e.focusables[o].id},this.findPreviousFocusable=e=>{let r=e.focusables.findIndex(o=>o.id===e.activeFocusId);for(let o=r-1;o>=0;o--)if(e.focusables[o].isActive)return e.focusables[o].id}}static getDerivedStateFromError(e){return{error:e}}isRawModeSupported(){return this.props.stdin.isTTY}render(){return hm.default.createElement(Xyt.default.Provider,{value:{exit:this.handleExit}},hm.default.createElement(Zyt.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},hm.default.createElement($yt.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},hm.default.createElement(eIt.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},hm.default.createElement(tIt.default.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious}},this.state.error?hm.default.createElement(rIt.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){KEe.default.hide(this.props.stdout)}componentWillUnmount(){KEe.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(e){this.handleExit(e)}};bc.default=ab;ab.displayName="InternalApp"});var jEe=K(Fc=>{"use strict";var oIt=Fc&&Fc.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),aIt=Fc&&Fc.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),AIt=Fc&&Fc.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&oIt(e,t,r);return aIt(e,t),e},Rc=Fc&&Fc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fc,"__esModule",{value:!0});var lIt=Rc(hn()),qEe=HO(),cIt=Rc(Pye()),uIt=Rc(TH()),fIt=Rc(Nye(
`;if(this.options.debug){n&&(this.fullStaticOutput+=a),this.options.stdout.write(this.fullStaticOutput+r);return}if(VI){n&&this.options.stdout.write(a),this.lastOutput=r;return}if(n&&(this.fullStaticOutput+=a),o>=this.options.stdout.rows){this.options.stdout.write(uIt.default.clearTerminal+this.fullStaticOutput+r),this.lastOutput=r;return}n&&(this.log.clear(),this.options.stdout.write(a),this.log(r)),!n&&r!==this.lastOutput&&this.throttledLog(r),this.lastOutput=r},gIt.default(this),this.options=e,this.rootNode=mIt.createNode("ink-root"),this.rootNode.onRender=e.debug?this.onRender:qEe(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=cIt.default.create(e.stdout),this.throttledLog=e.debug?this.log:qEe(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=qq.default.createContainer(this.rootNode,!1,!1),this.unsubscribeExit=hIt.default(this.unmount,{alwaysLast:!1}),e.patchConsole&&this.patchConsole(),VI||(e.stdout.on("resize",this.onRender),this.unsubscribeResize=()=>{e.stdout.off("resize",this.onRender)})}render(e){let r=lIt.default.createElement(yIt.default,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},e);qq.default.updateContainer(r,this.container,null,GEe)}writeToStdout(e){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(e+this.fullStaticOutput+this.lastOutput);return}if(VI){this.options.stdout.write(e);return}this.log.clear(),this.options.stdout.write(e),this.log(this.lastOutput)}}writeToStderr(e){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(e),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(VI){this.options.stderr.write(e);return}this.log.clear(),this.options.stderr.write(e),this.log(this.lastOutput)}}unmount(e){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole=="function"&&this.restoreConsole(),typeof this.unsubscribeResize=="function"&&this.unsubscribeResize(),VI?this.options.stdout.write(this.lastOutput+`
`):this.options.debug||this.log.done(),this.isUnmounted=!0,qq.default.updateContainer(null,this.container,null,GEe),CIt.default.delete(this.options.stdout),e instanceof Error?this.rejectExitPromise(e):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise||(this.exitPromise=new Promise((e,r)=>{this.resolveExitPromise=e,this.rejectExitPromise=r})),this.exitPromise}clear(){!VI&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=dIt.default((e,r)=>{e==="stdout"&&this.writeToStdout(r),e==="stderr"&&(r.startsWith("The above error occurred")||this.writeToStderr(r))}))}};Fc.default=Gq});var WEe=K(E2=>{"use strict";var YEe=E2&&E2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(E2,"__esModule",{value:!0});var IIt=YEe(jEe()),Ab=YEe(xq()),EIt=Be("stream"),wIt=(t,e)=>{let r=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},BIt(e)),o=QIt(r.stdout,()=>new IIt.default(r));return o.render(t),{rerender:o.render,unmount:()=>o.unmount(),waitUntilExit:o.waitUntilExit,cleanup:()=>Ab.default.delete(r.stdout),clear:o.clear}};E2.default=wIt;var BIt=(t={})=>t instanceof EIt.Stream?{stdout:t,stdin:process.stdin}:t,QIt=(t,e)=>{let r;return Ab.default.has(t)?r=Ab.default.get(t):(r=e(),Ab.default.set(t,r)),r}});var zEe=K(Eg=>{"use strict";var vIt=Eg&&Eg.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),DIt=Eg&&Eg.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),SIt=Eg&&Eg.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&vIt(e,t,r);return DIt(e,t),e};Object.defineProperty(Eg,"__esModule",{value:!0});var w2=SIt(hn()),JEe=t=>{let{items:e,children:r,style:o}=t,[a,n]=w2.useState(0),c=w2.useMemo(()=>e.slice(a),[e,a]);w2.useLayoutEffect(()=>{n(e.length)},[e.length]);let f=c.map((p,I)=>r(p,a+I)),g=w2.useMemo(()=>Object.assign({position:"absolute",flexDirection:"column"},o),[o]);return w2.default.createElement("ink-box",{internal_static:!0,style:g},f)};JEe.displayName="Static";Eg.default=JEe});var XEe=K(B2=>{"use strict";var kIt=B2&&B2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(B2,"__esModule",{value:!0});var xIt=kIt(hn()),VEe=({children:t,transform:e})=>t==null?null:xIt.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:e},t);VEe.displayName="Transform";B2.default=VEe});var $Ee=K(Q2=>{"use strict";var PIt=Q2&&Q2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Q2,"__esModule",{value:!0});var bIt=PIt(hn()),ZEe=({count:t=1})=>bIt.default.createElement("ink-text",null,`
`.repeat(t));ZEe.displayName="Newline";Q2.default=ZEe});var rwe=K(v2=>{"use strict";var ewe=v2&&v2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(v2,"__esModule",{value:!0});var FIt=ewe(hn()),RIt=ewe(ob()),twe=()=>FIt.default.createElement(RIt.default,{flexGrow:1});twe.displayName="Spacer";v2.default=twe});var lb=K(D2=>{"use strict";var TIt=D2&&D2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(D2,"__esModule",{value:!0});var MIt=hn(),NIt=TIt(Rq()),LIt=()=>MIt.useContext(NIt.default);D2.default=LIt});var iwe=K(S2=>{"use strict";var OIt=S2&&S2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(S2,"__esModule",{value:!0});var nwe=hn(),UIt=OIt(lb()),_It=(t,e={})=>{let{stdin:r,setRawMode:o,internal_exitOnCtrlC:a}=UIt.default();nwe.useEffect(()=>{if(e.isActive!==!1)return o(!0),()=>{o(!1)}},[e.isActive,o]),nwe.useEffect(()=>{if(e.isActive===!1)return;let n=c=>{let f=String(c),g={upArrow:f==="\x1B[A",downArrow:f==="\x1B[B",leftArrow:f==="\x1B[D",rightArrow:f==="\x1B[C",pageDown:f==="\x1B[6~",pageUp:f==="\x1B[5~",return:f==="\r",escape:f==="\x1B",ctrl:!1,shift:!1,tab:f===" "||f==="\x1B[Z",backspace:f==="\b",delete:f==="\x7F"||f==="\x1B[3~",meta:!1};f<=""&&!g.return&&(f=String.fromCharCode(f.charCodeAt(0)+"a".charCodeAt(0)-1),g.ctrl=!0),f.startsWith("\x1B")&&(f=f.slice(1),g.meta=!0);let p=f>="A"&&f<="Z",I=f>="\u0410"&&f<="\u042F";f.length===1&&(p||I)&&(g.shift=!0),g.tab&&f==="[Z"&&(g.shift=!0),(g.tab||g.backspace||g.delete)&&(f=""),(!(f==="c"&&g.ctrl)||!a)&&t(f,g)};return r==null||r.on("data",n),()=>{r==null||r.off("data",n)}},[e.isActive,r,a,t])};S2.default=_It});var swe=K(k2=>{"use strict";var KIt=k2&&k2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(k2,"__esModule",{value:!0});var HIt=hn(),qIt=KIt(bq()),GIt=()=>HIt.useContext(qIt.default);k2.default=GIt});var owe=K(x2=>{"use strict";var jIt=x2&&x2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(x2,"__esModule",{value:!0});var YIt=hn(),WIt=jIt(Mq()),JIt=()=>YIt.useContext(WIt.default);x2.default=JIt});var awe=K(P2=>{"use strict";var zIt=P2&&P2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(P2,"__esModule",{value:!0});var VIt=hn(),XIt=zIt(Lq()),ZIt=()=>VIt.useContext(XIt.default);P2.default=ZIt});var lwe=K(F2=>{"use strict";var Awe=F2&&F2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(F2,"__esModule",{value:!0});var b2=hn(),$It=Awe(sb()),eEt=Awe(lb()),tEt=({isActive:t=!0,autoFocus:e=!1}={})=>{let{isRawModeSupported:r,setRawMode:o}=eEt.default(),{activeId:a,add:n,remove:c,activate:f,deactivate:g}=b2.useContext($It.default),p=b2.useMemo(()=>Math.random().toString().slice(2,7),[]);return b2.useEffect(()=>(n(p,{autoFocus:e}),()=>{c(p)}),[p,e]),b2.useEffect(()=>{t?f(p):g(p)},[t,p]),b2.useEffect(()=>{if(!(!r||!t))return o(!0),()=>{o(!1)}},[t]),{isFocused:Boolean(p)&&a===p}};F2.default=tEt});var cwe=K(R2=>{"use strict";var rEt=R2&&R2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(R2,"__esModule",{value:!0});var nEt=hn(),iEt=rEt(sb()),sEt=()=>{let t=nEt.useContext(iEt.default);return{enableFocus:t.enableFocus,disableFocus:t.disableFocus,focusNext:t.focusNext,focusPrevious:t.focusPrevious}};R2.default=sEt});var uwe=K(jq=>{"use strict";Object.defineProperty(jq,"__esModule",{value:!0});jq.default=t=>{var e,r,o,a;return{width:(r=(e=t.yogaNode)===null||e===void 0?void 0:e.getComputedWidth())!==null&&r!==void 0?r:0,height:(a=(o=t.yogaNode)===null||o===void 0?void 0:o.getComputedHeight())!==null&&a!==void 0?a:0}}});var Rl=K(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});var oEt=WEe();Object.defineProperty(Io,"render",{enumerable:!0,get:function(){return oEt.default}});var aEt=ob();Object.defineProperty(Io,"Box",{enumerable:!0,get:function(){return aEt.default}});var AEt=Hq();Object.defineProperty(Io,"Text",{enumerable:!0,get:function(){return AEt
`:"";return c?B+=`@IF EXIST ${c} (\r
${c} ${g} ${a} ${I}%*\r
2022-08-27 06:35:11 +00:00
) ELSE (\r
@SETLOCAL\r
@SET PATHEXT=%PATHEXT:;.JS;=;%\r
2022-09-06 17:07:18 +00:00
${f} ${g} ${a} ${I}%*\r
2022-08-27 06:35:11 +00:00
)\r
2022-09-06 17:07:18 +00:00
`:B+=`@${f} ${g} ${a} ${I}%*\r
`,B}function Bwt(t,e,r){let o=Ml.relative(Ml.dirname(e),t),a=r.prog&&r.prog.split("\\").join("/"),n;o=o.split("\\").join("/");let c=Ml.isAbsolute(o)?`"${o}"`:`"$basedir/${o}"`,f=r.args||"",g=D6(r.nodePath).posix;a?(n=`"$basedir/${r.prog}"`,o=c):(a=c,f="",o="");let p=r.progArgs?`${r.progArgs.join(" ")} `:"",I=`#!/bin/sh
2022-08-27 06:35:11 +00:00
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
case \`uname\` in
*CYGWIN*) basedir=\`cygpath -w "$basedir"\`;;
esac
2022-09-06 17:07:18 +00:00
`,B=r.nodePath?`export NODE_PATH="${g}"
`:"";return n?I+=`${B}if [ -x ${n} ]; then
exec ${n} ${f} ${o} ${p}"$@"
2022-08-27 06:35:11 +00:00
else
2022-09-06 17:07:18 +00:00
exec ${a} ${f} ${o} ${p}"$@"
2022-08-27 06:35:11 +00:00
fi
2022-09-06 17:07:18 +00:00
`:I+=`${B}${a} ${f} ${o} ${p}"$@"
2022-08-27 06:35:11 +00:00
exit $?
2022-09-06 17:07:18 +00:00
`,I}function Qwt(t,e,r){let o=Ml.relative(Ml.dirname(e),t),a=r.prog&&r.prog.split("\\").join("/"),n=a&&`"${a}$exe"`,c;o=o.split("\\").join("/");let f=Ml.isAbsolute(o)?`"${o}"`:`"$basedir/${o}"`,g=r.args||"",p=D6(r.nodePath),I=p.win32,B=p.posix;n?(c=`"$basedir/${r.prog}$exe"`,o=f):(n=f,g="",o="");let Q=r.progArgs?`${r.progArgs.join(" ")} `:"",x=`#!/usr/bin/env pwsh
2022-08-27 06:35:11 +00:00
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
${r.nodePath?`$env_node_path=$env:NODE_PATH
2022-09-06 17:07:18 +00:00
$env:NODE_PATH="${I}"
2022-08-27 06:35:11 +00:00
`:""}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"
2022-09-06 17:07:18 +00:00
}`;return r.nodePath&&(x+=` else {
$env:NODE_PATH="${B}"
}`),c?x+=`
2022-08-27 06:35:11 +00:00
$ret=0
2022-09-06 17:07:18 +00:00
if (Test-Path ${c}) {
2022-08-27 06:35:11 +00:00
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
2022-09-06 17:07:18 +00:00
$input | & ${c} ${g} ${o} ${Q}$args
2022-08-27 06:35:11 +00:00
} else {
2022-09-06 17:07:18 +00:00
& ${c} ${g} ${o} ${Q}$args
2022-08-27 06:35:11 +00:00
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
2022-09-06 17:07:18 +00:00
$input | & ${n} ${g} ${o} ${Q}$args
2022-08-27 06:35:11 +00:00
} else {
2022-09-06 17:07:18 +00:00
& ${n} ${g} ${o} ${Q}$args
2022-08-27 06:35:11 +00:00
}
$ret=$LASTEXITCODE
}
${r.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $ret
2022-09-06 17:07:18 +00:00
`:x+=`
2022-08-27 06:35:11 +00:00
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
2022-09-06 17:07:18 +00:00
$input | & ${n} ${g} ${o} ${Q}$args
2022-08-27 06:35:11 +00:00
} else {
2022-09-06 17:07:18 +00:00
& ${n} ${g} ${o} ${Q}$args
2022-08-27 06:35:11 +00:00
}
${r.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $LASTEXITCODE
2022-09-06 17:07:18 +00:00
`,x}function vwt(t,e){return e.fs_.chmod(t,493)}function D6(t){if(!t)return{win32:"",posix:""};let e=typeof t=="string"?t.split(Ml.delimiter):Array.from(t),r={};for(let o=0;o<e.length;o++){let a=e[o].split("/").join("\\"),n=cBe()?e[o].split("\\").join("/").replace(/^([^:\\/]*):/,(c,f)=>`/mnt/${f.toLowerCase()}`):e[o];r.win32=r.win32?`${r.win32};${a}`:a,r.posix=r.posix?`${r.posix}:${n}`:n,r[o]={win32:a,posix:n}}return r}fBe.exports=v6});var O6=K((Mzt,RBe)=>{RBe.exports=Be("stream")});var LBe=K((Nzt,NBe)=>{"use strict";function TBe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,o)}return r}function Gwt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?TBe(Object(r),!0).forEach(function(o){jwt(t,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):TBe(Object(r)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))})}return t}function jwt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ywt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function MBe(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function Wwt(t,e,r){return e&&MBe(t.prototype,e),r&&MBe(t,r),t}var Jwt=Be("buffer"),Ub=Jwt.Buffer,zwt=Be("util"),U6=zwt.inspect,Vwt=U6&&U6.custom||"inspect";function Xwt(t,e,r){Ub.prototype.copy.call(t,e,r)}NBe.exports=function(){function t(){Ywt(this,t),this.head=null,this.tail=null,this.length=0}return Wwt(t,[{key:"push",value:function(r){var o={data:r,next:null};this.length>0?this.tail.next=o:this.head=o,this.tail=o,++this.length}},{key:"unshift",value:function(r){var o={data:r,next:this.head};this.length===0&&(this.tail=o),this.head=o,++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 o=this.head,a=""+o.data;o=o.next;)a+=r+o.data;return a}},{key:"concat",value:function(r){if(this.length===0)return Ub.alloc(0);for(var o=Ub.allocUnsafe(r>>>0),a=this.head,n=0;a;)Xwt(a.data,o,n),n+=a.data.length,a=a.next;return o}},{key:"consume",value:function(r,o){var a;return r<this.head.data.length?(a=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?a=this.shift():a=o?this._getString(r):this._getBuffer(r),a}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var o=this.head,a=1,n=o.data;for(r-=n.length;o=o.next;){var c=o.data,f=r>c.length?c.length:r;if(f===c.length?n+=c:n+=c.slice(0,r),r-=f,r===0){f===c.length?(++a,o.next?this.head=o.next:this.head=this.tail=null):(this.head=o,o.data=c.slice(f));break}++a}return this.length-=a,n}},{key:"_getBuffer",value:function(r){var o=Ub.allocUnsafe(r),a=this.head,n=1;for(a.data.copy(o),r-=a.data.length;a=a.next;){var c=a.data,f=r>c.length?c.length:r;if(c.copy(o,o.length-r,0,f),r-=f,r===0){f===c.length?(++n,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=c.slice(f));break}++n}return this.length-=n,o}},{key:Vwt,value:function(r,o){return U6(this,Gwt({},o,{depth:0,customInspect:!1}))}}]),t}()});var K6=K((Lzt,UBe)=>{"use strict";function Zwt(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(_6,this,t)):process.nextTick(_6,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,functio
`)),t.linkname&&(e+=hG(" linkpath="+t.linkname+`
`));var r=t.pax;if(r)for(var o in r)e+=hG(" "+o+"="+r[o]+`
`);return Buffer.from(e)};AE.decodePax=function(t){for(var e={};t.length;){for(var r=0;r<t.length&&t[r]!==32;)r++;var o=parseInt(t.slice(0,r).toString(),10);if(!o)return e;var a=t.slice(r+1,o-1).toString(),n=a.indexOf("=");if(n===-1)return e;e[a.slice(0,n)]=a.slice(n+1),t=t.slice(o)}return e};AE.encode=function(t){var e=Y1t(512),r=t.name,o="";if(t.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var a=r.indexOf("/");if(a===-1)return null;o+=o?"/"+r.slice(0,a):r.slice(0,a),r=r.slice(a+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(o)>155||t.linkname&&Buffer.byteLength(t.linkname)>100?null:(e.write(r),e.write(kh(t.mode&Z1t,6),100),e.write(kh(t.uid,6),108),e.write(kh(t.gid,6),116),e.write(kh(t.size,11),124),e.write(kh(t.mtime.getTime()/1e3|0,11),136),e[156]=U1e+t2t(t.type),t.linkname&&e.write(t.linkname,157),_1e.copy(e,iQ),z1t.copy(e,dG),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(kh(t.devmajor||0,6),329),e.write(kh(t.devminor||0,6),337),o&&e.write(o,345),e.write(kh(H1e(e),6),148),e)};AE.decode=function(t,e,r){var o=t[156]===0?0:t[156]-U1e,a=aE(t,0,100,e),n=xh(t,100,8),c=xh(t,108,8),f=xh(t,116,8),g=xh(t,124,12),p=xh(t,136,12),I=e2t(o),B=t[157]===0?null:aE(t,157,100,e),Q=aE(t,265,32),x=aE(t,297,32),y=xh(t,329,8),T=xh(t,337,8),U=H1e(t);if(U===8*32)return null;if(U!==xh(t,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(_1e.compare(t,iQ,iQ+6)===0)t[345]&&(a=aE(t,345,155,e)+"/"+a);else if(!(V1t.compare(t,iQ,iQ+6)===0&&X1t.compare(t,dG,dG+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return o===0&&a&&a[a.length-1]==="/"&&(o=5),{name:a,mode:n,uid:c,gid:f,size:g,mtime:new Date(1e3*p),type:I,linkname:B,uname:Q,gname:x,devmajor:y,devminor:T}}});var z1e=K((nVt,J1e)=>{var G1e=Be("util"),n2t=O1e(),sQ=mG(),j1e=oE().Writable,Y1e=oE().PassThrough,W1e=function(){},q1e=function(t){return t&=511,t&&512-t},i2t=function(t,e){var r=new tF(t,e);return r.end(),r},s2t=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},tF=function(t,e){this._parent=t,this.offset=e,Y1e.call(this,{autoDestroy:!1})};G1e.inherits(tF,Y1e);tF.prototype.destroy=function(t){this._parent.destroy(t)};var xg=function(t){if(!(this instanceof xg))return new xg(t);j1e.call(this,t),t=t||{},this._offset=0,this._buffer=n2t(),this._missing=0,this._partial=!1,this._onparse=W1e,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,o=function(){e._continue()},a=function(Q){if(e._locked=!1,Q)return e.destroy(Q);e._stream||o()},n=function(){e._stream=null;var Q=q1e(e._header.size);Q?e._parse(Q,c):e._parse(512,B),e._locked||o()},c=function(){e._buffer.consume(q1e(e._header.size)),e._parse(512,B),o()},f=function(){var Q=e._header.size;e._paxGlobal=sQ.decodePax(r.slice(0,Q)),r.consume(Q),n()},g=function(){var Q=e._header.size;e._pax=sQ.decodePax(r.slice(0,Q)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),r.consume(Q),n()},p=function(){var Q=e._header.size;this._gnuLongPath=sQ.decodeLongPath(r.slice(0,Q),t.filenameEncoding),r.consume(Q),n()},I=function(){var Q=e._header.size;this._gnuLongLinkPath=sQ.decodeLongPath(r.slice(0,Q),t.filenameEncoding),r.consume(Q),n()},B=function(){var Q=e._offset,x;try{x=e._header=sQ.decode(r.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(y){e.emit("error",y)}if(r.consume(512),!x){e._parse(512,B),o();return}if(x.type==="gnu-long-path"){e._parse(x.size,p),o();return}if(x.type==="gnu-long-link-path"){e._parse(x.size,I),o();return}if(x.type==="pax-global-header"){e._parse(x.size,f),o();return}if(x.type==="pax-header"){e._parse(x.size,g),o();return}if(e._gnuLongPath&&(x.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(x.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=x=s2t(x,e._pax),e._pax
2022-08-27 06:35:11 +00:00
Wanted: ${r.size}
2022-09-06 17:07:18 +00:00
Found: ${t.length}`);throw f.code="EBADSIZE",f.found=t.length,f.expected=r.size,f.sri=e,f}else{let f=new Error(`Integrity checksum failed when using ${o}: Wanted ${e}, but got ${n}. (${t.length} bytes)`);throw f.code="EINTEGRITY",f.found=n,f.expected=e,f.algorithm=o,f.sri=e,f}}Yu.exports.checkStream=N2t;function N2t(t,e,r){r=Qa(r);let o=r.Promise||Promise,a=kG(r.concat({integrity:e}));return new o((n,c)=>{t.pipe(a),t.on("error",c),a.on("error",c);let f;a.on("verified",g=>{f=g}),a.on("end",()=>n(f)),a.on("data",()=>{})})}Yu.exports.integrityStream=kG;function kG(t){t=Qa(t);let e=t.integrity&&ju(t.integrity,t),r=e&&Object.keys(e).length,o=r&&e.pickAlgorithm(t),a=r&&e[o],n=Array.from(new Set(t.algorithms.concat(o?[o]:[]))),c=n.map(AQ.createHash),f=0,g=new S2t({transform(p,I,B){f+=p.length,c.forEach(Q=>Q.update(p,I)),B(null,p,I)}}).on("end",()=>{let p=t.options&&t.options.length?`?${t.options.join("?")}`:"",I=ju(c.map((Q,x)=>`${n[x]}-${Q.digest("base64")}${p}`).join(" "),t),B=r&&I.match(e,t);if(typeof t.size=="number"&&f!==t.size){let Q=new Error(`stream size mismatch when checking ${e}.
2022-08-27 06:35:11 +00:00
Wanted: ${t.size}
2022-09-06 17:07:18 +00:00
Found: ${f}`);Q.code="EBADSIZE",Q.found=f,Q.expected=t.size,Q.sri=e,g.emit("error",Q)}else if(t.integrity&&!B){let Q=new Error(`${e} integrity checksum failed when using ${o}: wanted ${a} but got ${I}. (${f} bytes)`);Q.code="EINTEGRITY",Q.found=I,Q.expected=a,Q.algorithm=o,Q.sri=e,g.emit("error",Q)}else g.emit("size",f),g.emit("integrity",I),B&&g.emit("verified",B)});return g}Yu.exports.create=L2t;function L2t(t){t=Qa(t);let e=t.algorithms,r=t.options.length?`?${t.options.join("?")}`:"",o=e.map(AQ.createHash);return{update:function(a,n){return o.forEach(c=>c.update(a,n)),this},digest:function(a){return e.reduce((c,f)=>{let g=o.shift().digest("base64"),p=new bh(`${f}-${g}${r}`,t);if(p.algorithm&&p.digest){let I=p.algorithm;c[I]||(c[I]=[]),c[I].push(p)}return c},new Fm)}}}var O2t=new Set(AQ.getHashes()),m2e=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(t=>O2t.has(t));function U2t(t,e){return m2e.indexOf(t.toLowerCase())>=m2e.indexOf(e.toLowerCase())?t:e}});var iQe=K((mer,nQe)=>{var qQt=SN();function GQt(t){return qQt(t)?void 0:t}nQe.exports=GQt});var oQe=K((Cer,sQe)=>{var jQt=UU(),YQt=z_(),WQt=$_(),JQt=md(),zQt=_0(),VQt=iQe(),XQt=H8(),ZQt=J_(),$Qt=1,evt=2,tvt=4,rvt=XQt(function(t,e){var r={};if(t==null)return r;var o=!1;e=jQt(e,function(n){return n=JQt(n,t),o||(o=n.length>1),n}),zQt(t,ZQt(t),r),o&&(r=YQt(r,$Qt|evt|tvt,VQt));for(var a=e.length;a--;)WQt(r,e[a]);return r});sQe.exports=rvt});Xe();Xe();Nt();var V8=Be("child_process"),ype=Te(B0()),Nx=Te(Vt()),X8=Be("fs");var pI=new Map([]);function yut(t){let e=de.fromPortablePath(t);process.on("SIGINT",()=>{}),e?(0,V8.execFileSync)(process.execPath,[e,...process.argv.slice(2)],{stdio:"inherit",env:{...process.env,YARN_IGNORE_PATH:"1",YARN_IGNORE_CWD:"1"}}):(0,V8.execFileSync)(e,process.argv.slice(2),{stdio:"inherit",env:{...process.env,YARN_IGNORE_PATH:"1",YARN_IGNORE_CWD:"1"}})}async function Lx({binaryVersion:t,pluginConfiguration:e}){async function r(){let a=new Nx.Cli({binaryLabel:"Yarn Package Manager",binaryName:"yarn",binaryVersion:t});try{await o(a)}catch(n){process.stdout.write(a.error(n)),process.exitCode=1}}async function o(a){var T,U,q,X;let n=process.versions.node,c=">=14.15.0";if(!Ve.parseOptionalBoolean(process.env.YARN_IGNORE_NODE)&&!Vr.satisfiesWithPrereleases(n,c))throw new Nx.UsageError(`This tool requires a Node version compatible with ${c} (got ${n}). Upgrade Node, or set \`YARN_IGNORE_NODE=1\` in your environment.`);let g=await rt.find(de.toPortablePath(process.cwd()),e,{usePath:!0,strict:!1}),p=g.get("yarnPath"),I=g.get("ignorePath"),B=g.get("ignoreCwd"),Q=de.toPortablePath(de.resolve(process.argv[1])),x=se=>ge.readFilePromise(se).catch(()=>Buffer.of());if(!I&&!B&&await(async()=>p&&(p===Q||Buffer.compare(...await Promise.all([x(p),x(Q)]))===0))()){process.env.YARN_IGNORE_PATH="1",process.env.YARN_IGNORE_CWD="1",await o(a);return}else if(p!==null&&!I)if(!ge.existsSync(p))process.stdout.write(a.error(new Error(`The "yarn-path" option has been set (in ${g.sources.get("yarnPath")}), but the specified location doesn't exist (${p}).`))),process.exitCode=1;else try{yut(p)}catch(se){process.exitCode=se.code||1}else{I&&delete process.env.YARN_IGNORE_PATH,g.get("enableTelemetry")&&!ype.isCI&&process.stdout.isTTY&&(rt.telemetry=new gI(g,"puba9cdc10ec5790a2cf4969dd413a47270")),(T=rt.telemetry)==null||T.reportVersion(t);for(let[be,Ee]of g.plugins.entries()){pI.has(((U=be.match(/^@yarnpkg\/plugin-(.*)$/))==null?void 0:U[1])??"")&&((q=rt.telemetry)==null||q.reportPluginName(be));for(let ye of Ee.commands||[])a.register(ye)}let fe={cwd:de.toPortablePath(process.cwd()),plugins:e,quiet:!1,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr},me=a.process(process.argv.slice(2),fe);me.help||(X=rt.telemetry)==null||X.reportCommandName(me.path.join(" "));let Qe=me.cwd;if(typeof Qe<"u"&&!B){let be=(0,X8.realpathSync)(process.cwd()),Ee=(0,X8.realpathSync)(Qe);if(be!==Ee){process.chdir(Qe),await r();return}}await a.runExit(me,fe)}}return r().catch(a=>{process.stdout.writ
Try running the command again with the package name prefixed: ${Me.pretty(r,"yarn add",Me.Type.CODE)} ${Me.pretty(r,Y.makeDescriptor(Y.makeIdent(null,"my-package"),`${fe[0]}...`),Me.Type.DESCRIPTOR)}`);if(!se)throw new Di.UsageError(`The ${Me.pretty(r,X,Me.Type.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let me=Gft(a,se,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional});return await Promise.all(me.map(async be=>{let Ee=await y1(se,{project:o,workspace:a,cache:n,fixed:c,target:be,modifier:p,strategies:I,maxResults:B});return{request:se,suggestedDescriptors:Ee,target:be}}))})).then(X=>X.flat()),x=await Ru.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async X=>{for(let{request:se,suggestedDescriptors:{suggestions:fe,rejections:me}}of Q)if(fe.filter(be=>be.descriptor!==null).length===0){let[be]=me;if(typeof be>"u")throw new Error("Assertion failed: Expected an error to have been set");o.configuration.get("enableNetwork")?X.reportError(27,`${Y.prettyDescriptor(r,se)} can't be resolved to a satisfying range`):X.reportError(27,`${Y.prettyDescriptor(r,se)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),X.reportSeparator(),X.reportExceptionOnce(be)}});if(x.hasErrors())return x.exitCode();let y=!1,T=[],U=[];for(let{suggestedDescriptors:{suggestions:X},target:se}of Q){let fe,me=X.filter(ye=>ye.descriptor!==null),Qe=me[0].descriptor,be=me.every(ye=>Y.areDescriptorsEqual(ye.descriptor,Qe));me.length===1||be?fe=Qe:(y=!0,{answer:fe}=await(0,A0e.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:X.map(({descriptor:ye,name:De,reason:h})=>ye?{name:De,hint:h,descriptor:ye}:{name:De,hint:h,disabled:!0}),onCancel:()=>process.exit(130),result(ye){return this.find(ye,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let Ee=a.manifest[se].get(fe.identHash);(typeof Ee>"u"||Ee.descriptorHash!==fe.descriptorHash)&&(a.manifest[se].set(fe.identHash,fe),this.optional&&(se==="dependencies"?a.manifest.ensureDependencyMeta({...fe,range:"unknown"}).optional=!0:se==="peerDependencies"&&(a.manifest.ensurePeerDependencyMeta({...fe,range:"unknown"}).optional=!0)),typeof Ee>"u"?T.push([a,se,fe,I]):U.push([a,se,Ee,fe]))}return await r.triggerMultipleHooks(X=>X.afterWorkspaceDependencyAddition,T),await r.triggerMultipleHooks(X=>X.afterWorkspaceDependencyReplacement,U),y&&this.context.stdout.write(`
`),(await St.start({configuration:r,json:this.json,stdout:this.context.stdout,includeLogs:!this.context.quiet},async X=>{await o.install({cache:n,report:X,mode:this.mode})})).exitCode()}};Ed.paths=[["add"]],Ed.usage=Di.Command.Usage({description:"add dependencies to the project",details:"\n This command adds a package to the package.json for the nearest workspace.\n\n - If it didn't exist before, the package will by default be added to the regular `dependencies` field, but this behavior can be overriden thanks to the `-D,--dev` flag (which will cause the dependency to be added to the `devDependencies` field instead) and the `-P,--peer` flag (which will do the same but for `peerDependencies`).\n\n - If the package was already listed in your dependencies, it will by default be upgraded whether it's part of your `dependencies` or `devDependencies` (it won't ever update `peerDependencies`, though).\n\n - If set, the `--prefer-dev` flag will operate as a more flexible `-D,--dev` in that it will add the package to your `devDependencies` if it isn't already listed in either `dependencies` or `devDependencies`, but it will also happily upgrade your `dependencies` if that's what you already use (whereas `-D,--dev` would throw an exception).\n\n - If set, the `-O,--optional` flag will add the package to the `optionalDependencies` field and, in combination with the `-P,--peer` flag, it will add the package as an optional peer dependency. If the package was already listed in your `dependencies`, it will be upgraded to `optionalDependencies`. If the package was already listed in your `peerDependencies`, in combination with the `-P,--peer` flag, it will be upgraded to an optional peer dependency: `\"peerDependenciesMeta\": { \"<package>\": { \"optional\": true } }`\n\n - If the added package doesn't specify a range at all its `latest` tag will be resolved and the returned version will be used to generate a new semver range (using the `^` modifier by default unless otherwise configured via the `defaultSemverRangePrefix` configuration, or the `~` modifier if `-T,--tilde` is specified, or no modifier at all if `-E,--exact` is specified). Two exceptions to this rule: the first one is that if the package is a workspace then its local version will be used, and the second one is that if you use `-P,--peer` the default range will be `*` and won't be resolved at all.\n\n - If the added package specifies a range (such as `^1.0.0`, `latest`, or `rc`), Yarn will add this range as-is in the resulting package.json entry (in particular, tags such as `rc` will be encoded as-is rather than being converted into a semver range).\n\n If the `--cached` option is used, Yarn will preferably reuse the highest version already used somewhere within the project, even if through a transitive dependency.\n\n If the `-i,--interactive` option is used (or if the `preferInteractive` settings is toggled on) the command will first try to check whether other workspaces in the project use the specified package and, if so, will offer to reuse them.\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n For a compilation of all the supported protocols, please consult the dedicated page from our website: https://yarnpkg.com/features/protocols.\n ",examples:[["Add a regular package to the current workspace","$
`),0}return(await St.start({configuration:r,json:this.json,stdout:this.context.stdout},async c=>{let f=await yn.getPackageAccessibleBinaries(a,{project:o}),p=Array.from(f.keys()).reduce((I,B)=>Math.max(I,B.length),0);for(let[I,[B,Q]]of f)c.reportJson({name:I,source:Y.stringifyIdent(B),path:Q});if(this.verbose)for(let[I,[B]]of f)c.reportInfo(null,`${I.padEnd(p," ")} ${Y.prettyLocator(r,B)}`);else for(let I of f.keys())c.reportInfo(null,I)})).exitCode()}};wd.paths=[["bin"]],wd.usage=eh.Command.Usage({description:"get the path to a binary script",details:`
2022-08-27 06:35:11 +00:00
When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.
When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive.
2022-09-06 17:07:18 +00:00
`,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]});Xe();Nt();var I1=Te(Vt()),Bd=class extends pt{constructor(){super(...arguments);this.mirror=I1.Option.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=I1.Option.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),o=await Xr.find(r);return(await St.start({configuration:r,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&o.mirrorCwd!==null,c=!this.mirror;n&&(await ge.removePromise(o.mirrorCwd),await r.triggerHook(f=>f.cleanGlobalArtifacts,r)),c&&await ge.removePromise(o.cwd)})).exitCode()}};Bd.paths=[["cache","clean"],["cache","clear"]],Bd.usage=I1.Command.Usage({description:"remove the shared cache files",details:`
2022-08-27 06:35:11 +00:00
This command will remove all the files from the cache.
2022-09-06 17:07:18 +00:00
`,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]});Xe();var th=Te(Vt()),u0e=Te(E1()),Y_=Be("util"),Qd=class extends pt{constructor(){super(...arguments);this.json=th.Option.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=th.Option.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=th.Option.String()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),o=this.name.replace(/[.[].*$/,""),a=this.name.replace(/^[^.[]*/,"");if(typeof r.settings.get(o)>"u")throw new th.UsageError(`Couldn't find a configuration settings named "${o}"`);let c=r.getSpecial(o,{hideSecrets:!this.unsafe,getNativePaths:!0}),f=Ve.convertMapsToIndexableObjects(c),g=a?(0,u0e.default)(f,a):f,p=await St.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async I=>{I.reportJson(g)});if(!this.json){if(typeof g=="string")return this.context.stdout.write(`${g}
`),p.exitCode();Y_.inspect.styles.name="cyan",this.context.stdout.write(`${(0,Y_.inspect)(g,{depth:1/0,colors:r.get("enableColors"),compact:!1})}
`)}return p.exitCode()}};Qd.paths=[["config","get"]],Qd.usage=th.Command.Usage({description:"read a configuration settings",details:`
2022-08-27 06:35:11 +00:00
This command will print a configuration setting.
Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \`--no-redacted\` to get the untransformed value.
2022-09-06 17:07:18 +00:00
`,examples:[["Print a simple configuration setting","yarn config get yarnPath"],["Print a complex configuration setting","yarn config get packageExtensions"],["Print a nested field from the configuration",`yarn config get 'npmScopes["my-company"].npmRegistryServer'`],["Print a token from the configuration","yarn config get npmAuthToken --no-redacted"],["Print a configuration setting as JSON","yarn config get packageExtensions --json"]]});Xe();var wc=Te(Vt()),tde=Te(V_()),rde=Te(E1()),nde=Te(X_()),Z_=Be("util"),vd=class extends pt{constructor(){super(...arguments);this.json=wc.Option.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=wc.Option.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=wc.Option.String();this.value=wc.Option.String()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),o=()=>{if(!r.projectCwd)throw new wc.UsageError("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new wc.UsageError(`Couldn't find a configuration settings named "${a}"`);if(a==="enableStrictSettings")throw new wc.UsageError("This setting only affects the file it's in, and thus cannot be set from the CLI");let f=this.json?JSON.parse(this.value):this.value;await(this.home?y=>rt.updateHomeConfiguration(y):y=>rt.updateConfiguration(o(),y))(y=>{if(n){let T=(0,tde.default)(y);return(0,nde.default)(T,this.name,f),T}else return{...y,[a]:f}});let I=(await rt.find(this.context.cwd,this.context.plugins)).getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),B=Ve.convertMapsToIndexableObjects(I),Q=n?(0,rde.default)(B,n):B;return(await St.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async y=>{Z_.inspect.styles.name="cyan",y.reportInfo(0,`Successfully set ${this.name} to ${(0,Z_.inspect)(Q,{depth:1/0,colors:r.get("enableColors"),compact:!1})}`)})).exitCode()}};vd.paths=[["config","set"]],vd.usage=wc.Command.Usage({description:"change a configuration settings",details:`
2022-08-27 06:35:11 +00:00
This command will set a configuration setting.
When used without the \`--json\` flag, it can only set a simple configuration setting (a string, a number, or a boolean).
When used with the \`--json\` flag, it can set both simple and complex configuration settings, including Arrays and Objects.
2022-09-06 17:07:18 +00:00
`,examples:[["Set a simple configuration setting (a string, a number, or a boolean)","yarn config set initScope myScope"],["Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag",'yarn config set initScope --json \\"myScope\\"'],["Set a complex configuration setting (an Array) using the `--json` flag",`yarn config set unsafeHttpWhitelist --json '["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarn config set packageExtensions --json '{ "@babel/parser@*": { "dependencies": { "@babel/types": "*" } } }'`],["Set a nested configuration setting",'yarn config set npmScopes.company.npmRegistryServer "https://npm.example.com"'],["Set a nested configuration setting using indexed access for non-simple keys",`yarn config set 'npmRegistries["//npm.example.com"].npmAuthToken' "ffffffff-ffff-ffff-ffff-ffffffffffff"`]]});Xe();var rh=Te(Vt()),pde=Te(V_()),hde=Te(ade()),dde=Te(eK()),Dd=class extends pt{constructor(){super(...arguments);this.home=rh.Option.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=rh.Option.String()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),o=()=>{if(!r.projectCwd)throw new rh.UsageError("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new rh.UsageError(`Couldn't find a configuration settings named "${a}"`);let f=this.home?p=>rt.updateHomeConfiguration(p):p=>rt.updateConfiguration(o(),p);return(await St.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async p=>{let I=!1;await f(B=>{if(!(0,hde.default)(B,this.name))return p.reportWarning(0,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),I=!0,B;let Q=n?(0,pde.default)(B):{...B};return(0,dde.default)(Q,this.name),Q}),I||p.reportInfo(0,`Successfully unset ${this.name}`)})).exitCode()}};Dd.paths=[["config","unset"]],Dd.usage=rh.Command.Usage({description:"unset a configuration setting",details:`
2022-08-27 06:35:11 +00:00
This command will unset a configuration setting.
2022-09-06 17:07:18 +00:00
`,examples:[["Unset a simple configuration setting","yarn config unset initScope"],["Unset a complex configuration setting","yarn config unset packageExtensions"],["Unset a nested configuration setting","yarn config unset npmScopes.company.npmRegistryServer"]]});Xe();Xe();var yI=Te(Vt()),tK=Be("util"),Sd=class extends pt{constructor(){super(...arguments);this.verbose=yI.Option.Boolean("-v,--verbose",!1,{description:"Print the setting description on top of the regular key/value information"});this.why=yI.Option.Boolean("--why",!1,{description:"Print the reason why a setting is set a particular way"});this.json=yI.Option.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins,{strict:!1});return(await St.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{if(r.invalid.size>0&&!this.json){for(let[n,c]of r.invalid)a.reportError(34,`Invalid configuration key "${n}" in ${c}`);a.reportSeparator()}if(this.json){let n=Ve.sortMap(r.settings.keys(),c=>c);for(let c of n){let f=r.settings.get(c),g=r.getSpecial(c,{hideSecrets:!0,getNativePaths:!0}),p=r.sources.get(c);this.verbose?a.reportJson({key:c,effective:g,source:p}):a.reportJson({key:c,effective:g,source:p,...f})}}else{let n=Ve.sortMap(r.settings.keys(),g=>g),c=n.reduce((g,p)=>Math.max(g,p.length),0),f={breakLength:1/0,colors:r.get("enableColors"),maxArrayLength:2};if(this.why||this.verbose){let g=n.map(I=>{let B=r.settings.get(I);if(!B)throw new Error(`Assertion failed: This settings ("${I}") should have been registered`);let Q=this.why?r.sources.get(I)||"<default>":B.description;return[I,Q]}),p=g.reduce((I,[,B])=>Math.max(I,B.length),0);for(let[I,B]of g)a.reportInfo(null,`${I.padEnd(c," ")} ${B.padEnd(p," ")} ${(0,tK.inspect)(r.getSpecial(I,{hideSecrets:!0,getNativePaths:!0}),f)}`)}else for(let g of n)a.reportInfo(null,`${g.padEnd(c," ")} ${(0,tK.inspect)(r.getSpecial(g,{hideSecrets:!0,getNativePaths:!0}),f)}`)}})).exitCode()}};Sd.paths=[["config"]],Sd.usage=yI.Command.Usage({description:"display the current configuration",details:`
2022-08-27 06:35:11 +00:00
This command prints the current active configuration settings.
2022-09-06 17:07:18 +00:00
`,examples:[["Print the active configuration settings","$0 config"]]});Xe();var nh=Te(Vt()),nK=Te(QA());var Jx={};sr(Jx,{Strategy:()=>w1,acceptedStrategies:()=>Dht,dedupe:()=>rK});Xe();Xe();var mde=Te(pa()),w1=(e=>(e.HIGHEST="highest",e))(w1||{}),Dht=new Set(Object.values(w1)),Sht={highest:async(t,e,{resolver:r,fetcher:o,resolveOptions:a,fetchOptions:n})=>{let c=new Map;for(let[g,p]of t.storedResolutions){let I=t.storedDescriptors.get(g);if(typeof I>"u")throw new Error(`Assertion failed: The descriptor (${g}) should have been registered`);Ve.getSetWithDefault(c,I.identHash).add(p)}let f=new Map(Ve.mapAndFilter(t.storedDescriptors.values(),g=>Y.isVirtualDescriptor(g)?Ve.mapAndFilter.skip:[g.descriptorHash,Ve.makeDeferred()]));for(let g of t.storedDescriptors.values()){let p=f.get(g.descriptorHash);if(typeof p>"u")throw new Error(`Assertion failed: The descriptor (${g.descriptorHash}) should have been registered`);let I=t.storedResolutions.get(g.descriptorHash);if(typeof I>"u")throw new Error(`Assertion failed: The resolution (${g.descriptorHash}) should have been registered`);let B=t.originalPackages.get(I);if(typeof B>"u")throw new Error(`Assertion failed: The package (${I}) should have been registered`);Promise.resolve().then(async()=>{var se;let Q=r.getResolutionDependencies(g,a),x=Object.fromEntries(await Ve.allSettledSafe(Object.entries(Q).map(async([fe,me])=>{let Qe=f.get(me.descriptorHash);if(typeof Qe>"u")throw new Error(`Assertion failed: The descriptor (${me.descriptorHash}) should have been registered`);let be=await Qe.promise;if(!be)throw new Error("Assertion failed: Expected the dependency to have been through the dedupe process itself");return[fe,be.updatedPackage]})));if(e.length&&!mde.default.isMatch(Y.stringifyIdent(g),e)||!r.shouldPersistResolution(B,a))return B;let y=c.get(g.identHash);if(typeof y>"u")throw new Error(`Assertion failed: The resolutions (${g.identHash}) should have been registered`);if(y.size===1)return B;let T=[...y].map(fe=>{let me=t.originalPackages.get(fe);if(typeof me>"u")throw new Error(`Assertion failed: The package (${fe}) should have been registered`);return me}),U=await r.getSatisfying(g,x,T,a),q=(se=U.locators)==null?void 0:se[0];if(typeof q>"u"||!U.sorted)return B;let X=t.originalPackages.get(q.locatorHash);if(typeof X>"u")throw new Error(`Assertion failed: The package (${q.locatorHash}) should have been registered`);return X}).then(async Q=>{let x=await t.preparePackage(Q,{resolver:r,resolveOptions:a});p.resolve({descriptor:g,currentPackage:B,updatedPackage:Q,resolvedPackage:x})}).catch(Q=>{p.reject(Q)})}return[...f.values()].map(g=>g.promise)}};async function rK(t,{strategy:e,patterns:r,cache:o,report:a}){let{configuration:n}=t,c=new Yi,f=n.makeResolver(),g=n.makeFetcher(),p={cache:o,checksums:t.storedChecksums,fetcher:g,project:t,report:c,cacheOptions:{skipIntegrityCheck:!0}},I={project:t,resolver:f,report:c,fetchOptions:p};return await a.startTimerPromise("Deduplication step",async()=>{let B=Sht[e],Q=await B(t,r,{resolver:f,resolveOptions:I,fetcher:g,fetchOptions:p}),x=po.progressViaCounter(Q.length);a.reportProgress(x);let y=0;await Promise.all(Q.map(q=>q.then(X=>{if(X===null||X.currentPackage.locatorHash===X.updatedPackage.locatorHash)return;y++;let{descriptor:se,currentPackage:fe,updatedPackage:me}=X;a.reportInfo(0,`${Y.prettyDescriptor(n,se)} can be deduped from ${Y.prettyLocator(n,fe)} to ${Y.prettyLocator(n,me)}`),a.reportJson({descriptor:Y.stringifyDescriptor(se),currentResolution:Y.stringifyLocator(fe),updatedResolution:Y.stringifyLocator(me)}),t.storedResolutions.set(se.descriptorHash,me.locatorHash)}).finally(()=>x.tick())));let T;switch(y){case 0:T="No packages";break;case 1:T="One package";break;default:T=`${y} packages`}let U=Me.pretty(n,e,Me.Type.CODE);return a.reportInfo(0,`${T} can be deduped using the ${U} strategy`),y})}var kd=class extends pt{constructor(){super(...arguments);this.strategy=nh.Option.String("-s,--strategy","highest",{description:"The strategy to use when deduping dependencies",validator:nK.isEnum(w1)});this.check=nh.Option.Boolean("-
`)}};II.paths=[["--clipanion=definitions"]];var EI=class extends pt{async execute(){this.context.stdout.write(this.cli.usage(null))}};EI.paths=[["help"],["--help"],["-h"]];Xe();Nt();var iK=Te(Vt()),B1=class extends pt{constructor(){super(...arguments);this.leadingArgument=iK.Option.String();this.args=iK.Option.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!Y.tryParseIdent(this.leadingArgument)){let r=ee.resolve(this.context.cwd,de.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:r})}else return await this.cli.run(["run",this.leadingArgument,...this.args])}};Xe();var wI=class extends pt{async execute(){this.context.stdout.write(`${$n||"<unknown>"}
`)}};wI.paths=[["-v"],["--version"]];Xe();Xe();var Q1=Te(Vt()),xd=class extends pt{constructor(){super(...arguments);this.commandName=Q1.Option.String();this.args=Q1.Option.Proxy()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,locator:a}=await xt.find(r,this.context.cwd);return await o.restoreInstallState(),await yn.executePackageShellcode(a,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:o})}};xd.paths=[["exec"]],xd.usage=Q1.Command.Usage({description:"execute a shell script",details:`
2022-08-27 06:35:11 +00:00
This command simply executes a shell script within the context of the root directory of the active workspace using the portable shell.
It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
2022-09-06 17:07:18 +00:00
`,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]});Xe();var zx=Te(Vt()),BI=Te(QA()),Pd=class extends pt{constructor(){super(...arguments);this.hash=zx.Option.String({required:!1,validator:BI.applyCascade(BI.isString(),[BI.matchesRegExp(/^p[0-9a-f]{5}$/)])})}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o}=await xt.find(r,this.context.cwd);return await o.restoreInstallState({restoreResolutions:!1}),await o.applyLightResolution(),typeof this.hash<"u"?await xht(this.hash,o,{stdout:this.context.stdout}):(await St.start({configuration:r,stdout:this.context.stdout,includeFooter:!1},async n=>{let c=[([,f])=>Y.stringifyLocator(o.storedPackages.get(f.subject)),([,f])=>Y.stringifyIdent(f.requested)];for(let[f,g]of Ve.sortMap(o.peerRequirements,c)){let p=o.storedPackages.get(g.subject);if(typeof p>"u")throw new Error("Assertion failed: Expected the subject package to have been registered");let I=o.storedPackages.get(g.rootRequester);if(typeof I>"u")throw new Error("Assertion failed: Expected the root package to have been registered");let B=p.dependencies.get(g.requested.identHash)??null,Q=Me.pretty(r,f,Me.Type.CODE),x=Y.prettyLocator(r,p),y=Y.prettyIdent(r,g.requested),T=Y.prettyIdent(r,I),U=g.allRequesters.length-1,q=`descendant${U===1?"":"s"}`,X=U>0?` and ${U} ${q}`:"",se=B!==null?"provides":"doesn't provide";n.reportInfo(null,`${Q} \u2192 ${x} ${se} ${y} to ${T}${X}`)}})).exitCode()}};Pd.paths=[["explain","peer-requirements"]],Pd.usage=zx.Command.Usage({description:"explain a set of peer requirements",details:`
2022-08-27 06:35:11 +00:00
A set of peer requirements represents all peer requirements that a dependent must satisfy when providing a given peer request to a requester and its descendants.
When the hash argument is specified, this command prints a detailed explanation of all requirements of the set corresponding to the hash and whether they're satisfied or not.
When used without arguments, this command lists all sets of peer requirements and the corresponding hash that can be used to get detailed information about a given set.
**Note:** A hash is a six-letter p-prefixed code that can be obtained from peer dependency warnings or from the list of all peer requirements (\`yarn explain peer-requirements\`).
2022-09-06 17:07:18 +00:00
`,examples:[["Explain the corresponding set of peer requirements for a hash","$0 explain peer-requirements p1a4ed"],["List all sets of peer requirements","$0 explain peer-requirements"]]});async function xht(t,e,r){let{configuration:o}=e,a=e.peerRequirements.get(t);if(typeof a>"u")throw new Error(`No peerDependency requirements found for hash: "${t}"`);return(await St.start({configuration:o,stdout:r.stdout,includeFooter:!1},async c=>{let f=e.storedPackages.get(a.subject);if(typeof f>"u")throw new Error("Assertion failed: Expected the subject package to have been registered");let g=e.storedPackages.get(a.rootRequester);if(typeof g>"u")throw new Error("Assertion failed: Expected the root package to have been registered");let p=f.dependencies.get(a.requested.identHash)??null,I=p!==null?e.storedResolutions.get(p.descriptorHash):null;if(typeof I>"u")throw new Error("Assertion failed: Expected the resolution to have been registered");let B=I!==null?e.storedPackages.get(I):null;if(typeof B>"u")throw new Error("Assertion failed: Expected the provided package to have been registered");let Q=[...a.allRequesters.values()].map(q=>{let X=e.storedPackages.get(q);if(typeof X>"u")throw new Error("Assertion failed: Expected the package to be registered");let se=Y.devirtualizeLocator(X),fe=e.storedPackages.get(se.locatorHash);if(typeof fe>"u")throw new Error("Assertion failed: Expected the package to be registered");let me=fe.peerDependencies.get(a.requested.identHash);if(typeof me>"u")throw new Error("Assertion failed: Expected the peer dependency to be registered");return{pkg:X,peerDependency:me}});if(B!==null){let q=Q.every(({peerDependency:X})=>Vr.satisfiesWithPrereleases(B.version,X.range));c.reportInfo(0,`${Y.prettyLocator(o,f)} provides ${Y.prettyLocator(o,B)} with version ${Y.prettyReference(o,B.version??"<missing>")}, which ${q?"satisfies":"doesn't satisfy"} the following requirements:`)}else c.reportInfo(0,`${Y.prettyLocator(o,f)} doesn't provide ${Y.prettyIdent(o,a.requested)}, breaking the following requirements:`);c.reportSeparator();let x=Me.mark(o),y=[];for(let{pkg:q,peerDependency:X}of Ve.sortMap(Q,se=>Y.stringifyLocator(se.pkg))){let fe=(B!==null?Vr.satisfiesWithPrereleases(B.version,X.range):!1)?x.Check:x.Cross;y.push({stringifiedLocator:Y.stringifyLocator(q),prettyLocator:Y.prettyLocator(o,q),prettyRange:Y.prettyRange(o,X.range),mark:fe})}let T=Math.max(...y.map(({stringifiedLocator:q})=>q.length)),U=Math.max(...y.map(({prettyRange:q})=>q.length));for(let{stringifiedLocator:q,prettyLocator:X,prettyRange:se,mark:fe}of Ve.sortMap(y,({stringifiedLocator:me})=>me))c.reportInfo(null,`${X.padEnd(T+(X.length-q.length)," ")} \u2192 ${se.padEnd(U," ")} ${fe}`);y.length>1&&(c.reportSeparator(),c.reportInfo(0,`Note: these requirements start with ${Y.prettyLocator(e.configuration,g)}`))})).exitCode()}Xe();var D1=Te(Vt()),QI=Te(QA());Xe();Xe();Nt();var Bc=Te(Vt()),Ide=Te(Ei()),bd=class extends pt{constructor(){super(...arguments);this.useYarnPath=Bc.Option.Boolean("--yarn-path",{description:"Set the yarnPath setting even if the version can be accessed by Corepack"});this.onlyIfNeeded=Bc.Option.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=Bc.Option.String()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins);if(r.get("yarnPath")&&this.onlyIfNeeded)return 0;let o=()=>{if(typeof $n>"u")throw new Bc.UsageError("The --install flag can only be used without explicit version specifier from the Yarn CLI");return`file://${process.argv[1]}`},a,n=(f,g)=>({version:g,url:f.replace(/\{\}/g,g)});if(this.version==="self")a={url:o(),version:$n??"self"};else if(this.version==="latest"||this.version==="berry"||this.version==="stable")a=n("https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js",await v1(r,"stable"));else if(this.version==="canary")a=n("https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js",await v1(r,"canary"));else if(this.version==="classic")a={url:"https://nightly.yarnpkg.com/latest.js",version:"classic"};else if(this.version
${e}`)})}let f=t.projectCwd??t.startingCwd,g=ee.resolve(f,".yarn/releases"),p=ee.resolve(g,`yarn-${e}.cjs`),I=ee.relative(t.startingCwd,p),B=Ve.isTaggedYarnVersion(e),Q=t.get("yarnPath"),x=!B,y=x||!!Q||!!a;if(a===!1){if(x)throw new tr(0,"You explicitly opted out of yarnPath usage in your command line, but the version you specified cannot be represented by Corepack");y=!1}else!y&&!process.env.COREPACK_ROOT&&(o.reportWarning(0,`You don't seem to have ${Me.applyHyperlink(t,"Corepack","https://nodejs.org/api/corepack.html")} enabled; we'll have to rely on ${Me.applyHyperlink(t,"yarnPath","https://yarnpkg.com/configuration/yarnrc#yarnPath")} instead`),y=!0);if(y){let se=await c();o.reportInfo(0,`Saving the new release in ${Me.pretty(t,I,"magenta")}`),await ge.removePromise(ee.dirname(p)),await ge.mkdirPromise(ee.dirname(p),{recursive:!0}),await ge.writeFilePromise(p,se,{mode:493}),(!Q||ee.contains(g,Q))&&await rt.updateConfiguration(f,{yarnPath:ee.relative(f,p)})}else await ge.removePromise(ee.dirname(p)),await rt.updateConfiguration(f,{yarnPath:rt.deleteProperty});let T=await Gt.tryFind(f)||new Gt;T.packageManager=`yarn@${B?e:await v1(t,"stable")}`;let U={};T.exportTo(U);let q=ee.join(f,Gt.fileName),X=`${JSON.stringify(U,null,T.indent)}
`;return await ge.changeFilePromise(q,X,{automaticNewlines:!0}),{bundleVersion:e}}function Ede(t){return Pr[jv(t)]}var bht=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\n\n(?<details>(?:.(?!##))+)/gs;async function Fht(t){let r=`https://repo.yarnpkg.com/${Ve.isTaggedYarnVersion($n)?$n:await v1(t,"canary")}/packages/gatsby/content/advanced/error-codes.md`,o=await Kn.get(r,{configuration:t});return new Map(Array.from(o.toString().matchAll(bht),({groups:a})=>{if(!a)throw new Error("Assertion failed: Expected the match to have been successful");let n=Ede(a.code);if(a.name!==n)throw new Error(`Assertion failed: Invalid error code data: Expected "${a.name}" to be named "${n}"`);return[a.code,a.details]}))}var Fd=class extends pt{constructor(){super(...arguments);this.code=D1.Option.String({required:!1,validator:QI.applyCascade(QI.isString(),[QI.matchesRegExp(/^YN[0-9]{4}$/)])});this.json=D1.Option.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins);if(typeof this.code<"u"){let o=Ede(this.code),a=Me.pretty(r,o,Me.Type.CODE),n=this.cli.format().header(`${this.code} - ${a}`),f=(await Fht(r)).get(this.code),g=typeof f<"u"?Me.jsonOrPretty(this.json,r,Me.tuple(Me.Type.MARKDOWN,{text:f,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description.
2022-08-27 06:35:11 +00:00
You can help us by editing this page on GitHub \u{1F642}:
2022-09-06 17:07:18 +00:00
${Me.jsonOrPretty(this.json,r,Me.tuple(Me.Type.URL,"https://github.com/yarnpkg/berry/blob/master/packages/gatsby/content/advanced/error-codes.md"))}
`;this.json?this.context.stdout.write(`${JSON.stringify({code:this.code,name:o,details:g})}
`):this.context.stdout.write(`${n}
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
${g}
`)}else{let o={children:Ve.mapAndFilter(Object.entries(Pr),([a,n])=>Number.isNaN(Number(a))?Ve.mapAndFilter.skip:{label:gu(Number(a)),value:Me.tuple(Me.Type.CODE,n)})};NA.emitTree(o,{configuration:r,stdout:this.context.stdout,json:this.json})}}};Fd.paths=[["explain"]],Fd.usage=D1.Command.Usage({description:"explain an error code",details:`
2022-08-27 06:35:11 +00:00
When the code argument is specified, this command prints its name and its details.
When used without arguments, this command lists all error codes and their names.
2022-09-06 17:07:18 +00:00
`,examples:[["Explain an error code","$0 explain YN0006"],["List all error codes","$0 explain"]]});Xe();Nt();var Ia=Te(Vt()),wde=Te(pa()),Rd=class extends pt{constructor(){super(...arguments);this.all=Ia.Option.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=Ia.Option.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=Ia.Option.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=Ia.Option.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=Ia.Option.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=Ia.Option.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=Ia.Option.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=Ia.Option.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=Ia.Option.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=Ia.Option.Rest()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await xt.find(r,this.context.cwd),n=await Xr.find(r);if(!a&&!this.all)throw new lr(o.cwd,this.context.cwd);await o.restoreInstallState();let c=new Set(this.extra);this.cache&&c.add("cache"),this.dependents&&c.add("dependents"),this.manifest&&c.add("manifest");let f=(fe,{recursive:me})=>{let Qe=fe.anchoredLocator.locatorHash,be=new Map,Ee=[Qe];for(;Ee.length>0;){let ye=Ee.shift();if(be.has(ye))continue;let De=o.storedPackages.get(ye);if(typeof De>"u")throw new Error("Assertion failed: Expected the package to be registered");if(be.set(ye,De),Y.isVirtualLocator(De)&&Ee.push(Y.devirtualizeLocator(De).locatorHash),!(!me&&ye!==Qe))for(let h of De.dependencies.values()){let Oe=o.storedResolutions.get(h.descriptorHash);if(typeof Oe>"u")throw new Error("Assertion failed: Expected the resolution to be registered");Ee.push(Oe)}}return be.values()},g=({recursive:fe})=>{let me=new Map;for(let Qe of o.workspaces)for(let be of f(Qe,{recursive:fe}))me.set(be.locatorHash,be);return me.values()},p=({all:fe,recursive:me})=>fe&&me?o.storedPackages.values():fe?g({recursive:me}):f(a,{recursive:me}),I=({all:fe,recursive:me})=>{let Qe=p({all:fe,recursive:me}),be=this.patterns.map(De=>{let h=Y.parseLocator(De),Oe=wde.default.makeRe(Y.stringifyIdent(h)),Ie=Y.isVirtualLocator(h),Ce=Ie?Y.devirtualizeLocator(h):h;return ue=>{let re=Y.stringifyIdent(ue);if(!Oe.test(re))return!1;if(h.reference==="unknown")return!0;let Se=Y.isVirtualLocator(ue),Le=Se?Y.devirtualizeLocator(ue):ue;return!(Ie&&Se&&h.reference!==ue.reference||Ce.reference!==Le.reference)}}),Ee=Ve.sortMap([...Qe],De=>Y.stringifyLocator(De));return{selection:Ee.filter(De=>be.length===0||be.some(h=>h(De))),sortedLookup:Ee}},{selection:B,sortedLookup:Q}=I({all:this.all,recursive:this.recursive});if(B.length===0)throw new Ia.UsageError("No package matched your request");let x=new Map;if(this.dependents)for(let fe of Q)for(let me of fe.dependencies.values()){let Qe=o.storedResolutions.get(me.descriptorHash);if(typeof Qe>"u")throw new Error("Assertion failed: Expected the resolution to be registered");Ve.getArrayWithDefault(x,Qe).push(fe)}let y=new Map;for(let fe of Q){if(!Y.isVirtualLocator(fe))continue;let me=Y.devirtualizeLocator(fe);Ve.getArrayWithDefault(y,me.locatorHash).push(fe)}let T={},U={children:T},q=r.makeFetcher(),X={project:o,fetcher:q,cache:n,checksums:o.storedChecksums,report:new Yi,cacheOptions:{skipIntegrityCheck:!0}},se=[async(fe,me,Qe)=>{var ye;if(!me.has("manifest"))return;let be=await q.fetch(fe,X),Ee;try{Ee=await Gt.find(be.prefixPath,{baseFs:be.packageFs})}finally{(ye=be.releaseFs)==null||ye.call(be)}Qe("Manifest",{License:Me.tuple(Me.Type.NO_HINT,Ee.license),Homepage:Me.tuple(Me.Type.URL,Ee.raw.ho
2022-08-27 06:35:11 +00:00
`),e[1].join(`
2022-09-06 17:07:18 +00:00
`)]}Xe();Nt();var bl=Te(Vt()),Md=class extends pt{constructor(){super(...arguments);this.all=bl.Option.Boolean("-A,--all",!1,{description:"Link all workspaces belonging to the target projects to the current one"});this.private=bl.Option.Boolean("-p,--private",!1,{description:"Also link private workspaces belonging to the target projects to the current one"});this.relative=bl.Option.Boolean("-r,--relative",!1,{description:"Link workspaces using relative paths instead of absolute paths"});this.destinations=bl.Option.Rest()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await xt.find(r,this.context.cwd),n=await Xr.find(r);if(!a)throw new lr(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let c=o.topLevelWorkspace,f=[];for(let p of this.destinations){let I=ee.resolve(this.context.cwd,de.toPortablePath(p)),B=await rt.find(I,this.context.plugins,{useRc:!1,strict:!1}),{project:Q,workspace:x}=await xt.find(B,I);if(o.cwd===Q.cwd)throw new bl.UsageError(`Invalid destination '${p}'; Can't link the project to itself`);if(!x)throw new lr(Q.cwd,I);if(this.all){let y=!1;for(let T of Q.workspaces)T.manifest.name&&(!T.manifest.private||this.private)&&(f.push(T),y=!0);if(!y)throw new bl.UsageError(`No workspace found to be linked in the target project: ${p}`)}else{if(!x.manifest.name)throw new bl.UsageError(`The target workspace at '${p}' doesn't have a name and thus cannot be linked`);if(x.manifest.private&&!this.private)throw new bl.UsageError(`The target workspace at '${p}' is marked private - use the --private flag to link it anyway`);f.push(x)}}for(let p of f){let I=Y.stringifyIdent(p.locator),B=this.relative?ee.relative(o.cwd,p.cwd):p.cwd;c.manifest.resolutions.push({pattern:{descriptor:{fullName:I}},reference:`portal:${B}`})}return(await St.start({configuration:r,stdout:this.context.stdout},async p=>{await o.install({cache:n,report:p})})).exitCode()}};Md.paths=[["link"]],Md.usage=bl.Command.Usage({description:"connect the local project to another one",details:"\n This command will set a new `resolutions` field in the project-level manifest and point it to the workspace at the specified location (even if part of another project).\n ",examples:[["Register one or more remote workspaces for use in the current project","$0 link ~/ts-loader ~/jest"],["Register all workspaces from a remote project for use in the current project","$0 link ~/jest --all"]]});var Xx=Te(Vt()),Nd=class extends pt{constructor(){super(...arguments);this.args=Xx.Option.Proxy()}async execute(){return this.cli.run(["exec","node",...this.args])}};Nd.paths=[["node"]],Nd.usage=Xx.Command.Usage({description:"run node with the hook already setup",details:`
2022-08-27 06:35:11 +00:00
This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version.
2022-09-06 17:07:18 +00:00
`,examples:[["Run a Node script","$0 node ./my-script.js"]]});Xe();Xe();Nt();var mg=Te(Vt()),Pde=Be("os");Xe();Nt();var Tu=Te(Vt()),vde=Be("os");Xe();ll();var Zx=Te(Vt()),Oht="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function Od(t,e){let r=await Kn.get(Oht,{configuration:t}),o=os(r.toString());return Object.fromEntries(Object.entries(o).filter(([a,n])=>!e||Vr.satisfiesWithPrereleases(e,n.range??"<4.0.0-rc.1")))}var Ld=class extends pt{constructor(){super(...arguments);this.json=Zx.Option.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins);return(await St.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{let n=await Od(r,$n);for(let[c,{experimental:f,...g}]of Object.entries(n)){let p=c;f&&(p+=" [experimental]"),a.reportJson({name:c,experimental:f,...g}),a.reportInfo(null,p)}})).exitCode()}};Ld.paths=[["plugin","list"]],Ld.usage=Zx.Command.Usage({category:"Plugin-related commands",description:"list the available official plugins",details:"\n This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarn plugin import`.\n ",examples:[["List the official plugins","$0 plugin list"]]});var Uht=/^[0-9]+$/;function Dde(t){return Uht.test(t)?`pull/${t}/head`:t}var _ht=({repository:t,branch:e},r)=>[["git","init",de.fromPortablePath(r)],["git","remote","add","origin",t],["git","fetch","origin","--depth=1",Dde(e)],["git","reset","--hard","FETCH_HEAD"]],Kht=({branch:t})=>[["git","fetch","origin","--depth=1",Dde(t),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx"]],Hht=({plugins:t,noMinify:e},r)=>[["yarn","build:cli",...new Array().concat(...t.map(o=>["--plugin",ee.resolve(r,o)])),...e?["--no-minify"]:[],"|"]],Ud=class extends pt{constructor(){super(...arguments);this.installPath=Tu.Option.String("--path",{description:"The path where the repository should be cloned to"});this.repository=Tu.Option.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=Tu.Option.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=Tu.Option.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.noMinify=Tu.Option.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=Tu.Option.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=Tu.Option.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o}=await xt.find(r,this.context.cwd),a=typeof this.installPath<"u"?ee.resolve(this.context.cwd,de.toPortablePath(this.installPath)):ee.resolve(de.toPortablePath((0,vde.tmpdir)()),"yarnpkg-sources",Li.makeHash(this.repository).slice(0,6));return(await St.start({configuration:r,stdout:this.context.stdout},async c=>{await oK(this,{configuration:r,report:c,target:a}),c.reportSeparator(),c.reportInfo(0,"Building a fresh bundle"),c.reportSeparator(),await S1(Hht(this,a),{configuration:r,context:this.context,target:a}),c.reportSeparator();let f=ee.resolve(a,"packages/yarnpkg-cli/bundles/yarn.js"),g=await ge.readFilePromise(f),{bundleVersion:p}=await sK(r,null,async()=>g,{report:c});this.skipPlugins||await qht(this,p,{project:o,report:c,target:a})})).exitCode()}};Ud.paths=[["set","version","from","sources"]],Ud.usage=Tu.Command.Usage({description:"build Yarn from master",details:`
2022-08-27 06:35:11 +00:00
This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project.
By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \`--skip-plugins\` flag.
2022-09-06 17:07:18 +00:00
`,examples:[["Build Yarn from master","$0 set version from sources"]]});async function S1(t,{configuration:e,context:r,target:o}){for(let[a,...n]of t){let c=n[n.length-1]==="|";if(c&&n.pop(),c)await gn.pipevp(a,n,{cwd:o,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${Me.pretty(e,` $ ${[a,...n].join(" ")}`,"grey")}
`);try{await gn.execvp(a,n,{cwd:o,strict:!0})}catch(f){throw r.stdout.write(f.stdout||f.stack),f}}}}async function oK(t,{configuration:e,report:r,target:o}){let a=!1;if(!t.force&&ge.existsSync(ee.join(o,".git"))){r.reportInfo(0,"Fetching the latest commits"),r.reportSeparator();try{await S1(Kht(t),{configuration:e,context:t.context,target:o}),a=!0}catch{r.reportSeparator(),r.reportWarning(0,"Repository update failed; we'll try to regenerate it")}}a||(r.reportInfo(0,"Cloning the remote repository"),r.reportSeparator(),await ge.removePromise(o),await ge.mkdirPromise(o,{recursive:!0}),await S1(_ht(t,o),{configuration:e,context:t.context,target:o}))}async function qht(t,e,{project:r,report:o,target:a}){let n=await Od(r.configuration,e),c=new Set(Object.keys(n));for(let f of r.configuration.plugins.keys())!c.has(f)||await aK(f,t,{project:r,report:o,target:a})}Xe();Xe();Nt();var $x=Te(Vt()),Sde=Te(Ei()),kde=Be("url"),xde=Be("vm");var _d=class extends pt{constructor(){super(...arguments);this.name=$x.Option.String()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins);return(await St.start({configuration:r,stdout:this.context.stdout},async a=>{let{project:n}=await xt.find(r,this.context.cwd),c,f;if(this.name.match(/^\.{0,2}[\\/]/)||de.isAbsolute(this.name)){let g=ee.resolve(this.context.cwd,de.toPortablePath(this.name));a.reportInfo(0,`Reading ${Me.pretty(r,g,Me.Type.PATH)}`),c=ee.relative(n.cwd,g),f=await ge.readFilePromise(g)}else{let g;if(this.name.match(/^https?:/)){try{new kde.URL(this.name)}catch{throw new tr(52,`Plugin specifier "${this.name}" is neither a plugin name nor a valid url`)}c=this.name,g=this.name}else{let p=Y.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(p.reference!=="unknown"&&!Sde.default.valid(p.reference))throw new tr(0,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let I=Y.stringifyIdent(p),B=await Od(r,$n);if(!Object.prototype.hasOwnProperty.call(B,I)){let Q=`Couldn't find a plugin named ${Y.prettyIdent(r,p)} on the remote registry.
`;throw r.plugins.has(I)?Q+=`A plugin named ${Y.prettyIdent(r,p)} is already installed; possibly attempting to import a built-in plugin.`:Q+=`Note that only the plugins referenced on our website (${Me.pretty(r,"https://github.com/yarnpkg/berry/blob/master/plugins.yml",Me.Type.URL)}) can be referenced by their name; any other plugin will have to be referenced through its public url (for example ${Me.pretty(r,"https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js",Me.Type.URL)}).`,new tr(51,Q)}c=I,g=B[I].url,p.reference!=="unknown"?g=g.replace(/\/master\//,`/${I}/${p.reference}/`):$n!==null&&(g=g.replace(/\/master\//,`/@yarnpkg/cli/${$n}/`))}a.reportInfo(0,`Downloading ${Me.pretty(r,g,"green")}`),f=await Kn.get(g,{configuration:r})}await AK(c,f,{project:n,report:a})})).exitCode()}};_d.paths=[["plugin","import"]],_d.usage=$x.Command.Usage({category:"Plugin-related commands",description:"download a plugin",details:`
2022-08-27 06:35:11 +00:00
This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations.
Three types of plugin references are accepted:
- If the plugin is stored within the Yarn repository, it can be referenced by name.
- Third-party plugins can be referenced directly through their public urls.
- Local plugins can be referenced by their path on the disk.
Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \`@yarnpkg/builder\` package).
2022-09-06 17:07:18 +00:00
`,examples:[['Download and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import @yarnpkg/plugin-exec"],['Download and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import exec"],["Download and activate a community plugin","$0 plugin import https://example.org/path/to/plugin.js"],["Activate a local plugin","$0 plugin import ./path/to/plugin.js"]]});async function AK(t,e,{project:r,report:o}){let{configuration:a}=r,n={},c={exports:n};(0,xde.runInNewContext)(e.toString(),{module:c,exports:n});let f=c.exports.name,g=`.yarn/plugins/${f}.cjs`,p=ee.resolve(r.cwd,g);o.reportInfo(0,`Saving the new plugin in ${Me.pretty(a,g,"magenta")}`),await ge.mkdirPromise(ee.dirname(p),{recursive:!0}),await ge.writeFilePromise(p,e);let I={path:g,spec:t};await rt.updateConfiguration(r.cwd,B=>{let Q=[],x=!1;for(let y of B.plugins||[]){let T=typeof y!="string"?y.path:y,U=ee.resolve(r.cwd,de.toPortablePath(T)),{name:q}=Ve.dynamicRequire(U);q!==f?Q.push(y):(Q.push(I),x=!0)}return x||Q.push(I),{...B,plugins:Q}})}var Ght=({pluginName:t,noMinify:e},r)=>[["yarn",`build:${t}`,...e?["--no-minify"]:[],"|"]],Kd=class extends pt{constructor(){super(...arguments);this.installPath=mg.Option.String("--path",{description:"The path where the repository should be cloned to"});this.repository=mg.Option.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=mg.Option.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=mg.Option.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=mg.Option.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=mg.Option.String()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),o=typeof this.installPath<"u"?ee.resolve(this.context.cwd,de.toPortablePath(this.installPath)):ee.resolve(de.toPortablePath((0,Pde.tmpdir)()),"yarnpkg-sources",Li.makeHash(this.repository).slice(0,6));return(await St.start({configuration:r,stdout:this.context.stdout},async n=>{let{project:c}=await xt.find(r,this.context.cwd),f=Y.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),g=Y.stringifyIdent(f),p=await Od(r,$n);if(!Object.prototype.hasOwnProperty.call(p,g))throw new tr(51,`Couldn't find a plugin named "${g}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let I=g;await oK(this,{configuration:r,report:n,target:o}),await aK(I,this,{project:c,report:n,target:o})})).exitCode()}};Kd.paths=[["plugin","import","from","sources"]],Kd.usage=mg.Command.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:`
2022-08-27 06:35:11 +00:00
This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations.
The plugins can be referenced by their short name if sourced from the official Yarn repository.
2022-09-06 17:07:18 +00:00
`,examples:[['Build and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import from sources @yarnpkg/plugin-exec"],['Build and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import from sources exec"]]});async function aK(t,{context:e,noMinify:r},{project:o,report:a,target:n}){let c=t.replace(/@yarnpkg\//,""),{configuration:f}=o;a.reportSeparator(),a.reportInfo(0,`Building a fresh ${c}`),a.reportSeparator(),await S1(Ght({pluginName:c,noMinify:r},n),{configuration:f,context:e,target:n}),a.reportSeparator();let g=ee.resolve(n,`packages/${c}/bundles/${t}.js`),p=await ge.readFilePromise(g);await AK(t,p,{project:o,report:a})}Xe();Nt();var vI=Te(Vt()),Hd=class extends pt{constructor(){super(...arguments);this.name=vI.Option.String()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o}=await xt.find(r,this.context.cwd);return(await St.start({configuration:r,stdout:this.context.stdout},async n=>{let c=this.name,f=Y.parseIdent(c);if(!r.plugins.has(c))throw new vI.UsageError(`${Y.prettyIdent(r,f)} isn't referenced by the current configuration`);let g=`.yarn/plugins/${c}.cjs`,p=ee.resolve(o.cwd,g);ge.existsSync(p)&&(n.reportInfo(0,`Removing ${Me.pretty(r,g,Me.Type.PATH)}...`),await ge.removePromise(p)),n.reportInfo(0,"Updating the configuration..."),await rt.updateConfiguration(o.cwd,I=>{if(!Array.isArray(I.plugins))return I;let B=I.plugins.filter(Q=>Q.path!==g);return I.plugins.length===B.length?I:{...I,plugins:B}})})).exitCode()}};Hd.paths=[["plugin","remove"]],Hd.usage=vI.Command.Usage({category:"Plugin-related commands",description:"remove a plugin",details:`
2022-08-27 06:35:11 +00:00
This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration.
**Note:** The plugins have to be referenced by their name property, which can be obtained using the \`yarn plugin runtime\` command. Shorthands are not allowed.
2022-09-06 17:07:18 +00:00
`,examples:[["Remove a plugin imported from the Yarn repository","$0 plugin remove @yarnpkg/plugin-typescript"],["Remove a plugin imported from a local file","$0 plugin remove my-local-plugin"]]});Xe();var eP=Te(Vt()),qd=class extends pt{constructor(){super(...arguments);this.json=eP.Option.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins);return(await St.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{for(let n of r.plugins.keys()){let c=this.context.plugins.plugins.has(n),f=n;c&&(f+=" [builtin]"),a.reportJson({name:n,builtin:c}),a.reportInfo(null,`${f}`)}})).exitCode()}};qd.paths=[["plugin","runtime"]],qd.usage=eP.Command.Usage({category:"Plugin-related commands",description:"list the active plugins",details:`
2022-08-27 06:35:11 +00:00
This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins.
2022-09-06 17:07:18 +00:00
`,examples:[["List the currently active plugins","$0 plugin runtime"]]});Xe();Xe();var tP=Te(Vt()),Gd=class extends pt{constructor(){super(...arguments);this.idents=tP.Option.Rest()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await xt.find(r,this.context.cwd),n=await Xr.find(r);if(!a)throw new lr(o.cwd,this.context.cwd);let c=new Set;for(let g of this.idents)c.add(Y.parseIdent(g).identHash);if(await o.restoreInstallState({restoreResolutions:!1}),await o.resolveEverything({cache:n,report:new Yi}),c.size>0)for(let g of o.storedPackages.values())c.has(g.identHash)&&o.storedBuildState.delete(g.locatorHash);else o.storedBuildState.clear();return(await St.start({configuration:r,stdout:this.context.stdout,includeLogs:!this.context.quiet},async g=>{await o.install({cache:n,report:g})})).exitCode()}};Gd.paths=[["rebuild"]],Gd.usage=tP.Command.Usage({description:"rebuild the project's native packages",details:`
2022-08-27 06:35:11 +00:00
This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again.
Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future).
By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory.
2022-09-06 17:07:18 +00:00
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]});Xe();Xe();Xe();var ih=Te(Vt()),lK=Te(pa()),bde=Te(QA());var jd=class extends pt{constructor(){super(...arguments);this.all=ih.Option.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=ih.Option.String("--mode",{description:"Change what artifacts installs generate",validator:bde.isEnum(LA)});this.patterns=ih.Option.Rest()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await xt.find(r,this.context.cwd),n=await Xr.find(r);if(!a)throw new lr(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let c=this.all?o.workspaces:[a],f=["dependencies","devDependencies","peerDependencies"],g=[],p=!1,I=[];for(let y of this.patterns){let T=!1,U=Y.parseIdent(y);for(let q of c){let X=[...q.manifest.peerDependenciesMeta.keys()];for(let se of(0,lK.default)(X,y))q.manifest.peerDependenciesMeta.delete(se),p=!0,T=!0;for(let se of f){let fe=q.manifest.getForScope(se),me=[...fe.values()].map(Qe=>Y.stringifyIdent(Qe));for(let Qe of(0,lK.default)(me,Y.stringifyIdent(U))){let{identHash:be}=Y.parseIdent(Qe),Ee=fe.get(be);if(typeof Ee>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");q.manifest[se].delete(be),I.push([q,se,Ee]),p=!0,T=!0}}}T||g.push(y)}let B=g.length>1?"Patterns":"Pattern",Q=g.length>1?"don't":"doesn't",x=this.all?"any":"this";if(g.length>0)throw new ih.UsageError(`${B} ${Me.prettyList(r,g,Me.Type.CODE)} ${Q} match any packages referenced by ${x} workspace`);return p?(await r.triggerMultipleHooks(T=>T.afterWorkspaceDependencyRemoval,I),(await St.start({configuration:r,stdout:this.context.stdout},async T=>{await o.install({cache:n,report:T,mode:this.mode})})).exitCode()):0}};jd.paths=[["remove"]],jd.usage=ih.Command.Usage({description:"remove dependencies from the project",details:`
2022-08-27 06:35:11 +00:00
This command will remove the packages matching the specified patterns from the current workspace.
If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
- \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
- \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.
2022-09-06 17:07:18 +00:00
`,examples:[["Remove a dependency from the current project","$0 remove lodash"],["Remove a dependency from all workspaces at once","$0 remove lodash --all"],["Remove all dependencies starting with `eslint-`","$0 remove 'eslint-*'"],["Remove all dependencies with the `@babel` scope","$0 remove '@babel/*'"],["Remove all dependencies matching `react-dom` or `react-helmet`","$0 remove 'react-{dom,helmet}'"]]});Xe();Xe();var Fde=Be("util"),DI=class extends pt{async execute(){let e=await rt.find(this.context.cwd,this.context.plugins),{project:r,workspace:o}=await xt.find(e,this.context.cwd);if(!o)throw new lr(r.cwd,this.context.cwd);return(await St.start({configuration:e,stdout:this.context.stdout},async n=>{let c=o.manifest.scripts,f=Ve.sortMap(c.keys(),I=>I),g={breakLength:1/0,colors:e.get("enableColors"),maxArrayLength:2},p=f.reduce((I,B)=>Math.max(I,B.length),0);for(let[I,B]of c.entries())n.reportInfo(null,`${I.padEnd(p," ")} ${(0,Fde.inspect)(B,g)}`)})).exitCode()}};DI.paths=[["run"]];Xe();Xe();var Co=Te(Vt()),Yd=class extends pt{constructor(){super(...arguments);this.inspect=Co.Option.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=Co.Option.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=Co.Option.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=Co.Option.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.require=Co.Option.String("--require",{description:"Forwarded to the underlying Node process when executing a binary"});this.silent=Co.Option.Boolean("--silent",{hidden:!0});this.scriptName=Co.Option.String();this.args=Co.Option.Proxy()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a,locator:n}=await xt.find(r,this.context.cwd);await o.restoreInstallState();let c=this.topLevel?o.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await yn.hasPackageScript(c,this.scriptName,{project:o}))return await yn.executePackageScript(c,this.scriptName,this.args,{project:o,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let f=await yn.getPackageAccessibleBinaries(c,{project:o});if(f.get(this.scriptName)){let p=[];return this.inspect&&(typeof this.inspect=="string"?p.push(`--inspect=${this.inspect}`):p.push("--inspect")),this.inspectBrk&&(typeof this.inspectBrk=="string"?p.push(`--inspect-brk=${this.inspectBrk}`):p.push("--inspect-brk")),this.require&&p.push(`--require=${this.require}`),await yn.executePackageAccessibleBinary(c,this.scriptName,this.args,{cwd:this.context.cwd,project:o,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:p,packageAccessibleBinaries:f})}if(!this.topLevel&&!this.binariesOnly&&a&&this.scriptName.includes(":")){let I=(await Promise.all(o.workspaces.map(async B=>B.manifest.scripts.has(this.scriptName)?B:null))).filter(B=>B!==null);if(I.length===1)return await yn.executeWorkspaceScript(I[0],this.scriptName,this.args,{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}if(this.topLevel)throw this.scriptName==="node-gyp"?new Co.UsageError(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${Y.prettyLocator(r,n)}). This typically happens because some package depends on "node-gyp" to build itself, but didn't list it in their dependencies. To fix that, please run "yarn add node-gyp" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new Co.UsageError(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${Y.prettyLocator(r,n)}).`);{if(this.scriptName==="global")throw new Co.UsageError("The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a th
2022-08-27 06:35:11 +00:00
This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace:
- If the \`scripts\` field from your local package.json contains a matching script name, its definition will get executed.
- Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed.
- Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed.
Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax).
2022-09-06 17:07:18 +00:00
`,examples:[["Run the tests from the local workspace","$0 run test"],['Same thing, but without the "run" keyword',"$0 test"],["Inspect Webpack while running","$0 run --inspect-brk webpack"]]});Xe();Xe();var SI=Te(Vt()),Wd=class extends pt{constructor(){super(...arguments);this.save=SI.Option.Boolean("-s,--save",!1,{description:"Persist the resolution inside the top-level manifest"});this.descriptor=SI.Option.String();this.resolution=SI.Option.String()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await xt.find(r,this.context.cwd),n=await Xr.find(r);if(await o.restoreInstallState({restoreResolutions:!1}),!a)throw new lr(o.cwd,this.context.cwd);let c=Y.parseDescriptor(this.descriptor,!0),f=Y.makeDescriptor(c,this.resolution);return o.storedDescriptors.set(c.descriptorHash,c),o.storedDescriptors.set(f.descriptorHash,f),o.resolutionAliases.set(c.descriptorHash,f.descriptorHash),(await St.start({configuration:r,stdout:this.context.stdout},async p=>{await o.install({cache:n,report:p})})).exitCode()}};Wd.paths=[["set","resolution"]],Wd.usage=SI.Command.Usage({description:"enforce a package resolution",details:'\n This command updates the resolution table so that `descriptor` is resolved by `resolution`.\n\n Note that by default this command only affect the current resolution table - meaning that this "manual override" will disappear if you remove the lockfile, or if the package disappear from the table. If you wish to make the enforced resolution persist whatever happens, add the `-s,--save` flag which will also edit the `resolutions` field from your top-level manifest.\n\n Note that no attempt is made at validating that `resolution` is a valid resolution entry for `descriptor`.\n ',examples:[["Force all instances of lodash@npm:^1.2.3 to resolve to 1.5.0","$0 set resolution lodash@npm:^1.2.3 1.5.0"]]});Xe();Nt();var sh=Te(Vt()),Rde=Te(pa()),Jd=class extends pt{constructor(){super(...arguments);this.all=sh.Option.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=sh.Option.Rest()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await xt.find(r,this.context.cwd),n=await Xr.find(r);if(!a)throw new lr(o.cwd,this.context.cwd);let c=o.topLevelWorkspace,f=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:p,reference:I}of c.manifest.resolutions)I.startsWith("portal:")&&f.add(p.descriptor.fullName);if(this.leadingArguments.length>0)for(let p of this.leadingArguments){let I=ee.resolve(this.context.cwd,de.toPortablePath(p));if(Ve.isPathLike(p)){let B=await rt.find(I,this.context.plugins,{useRc:!1,strict:!1}),{project:Q,workspace:x}=await xt.find(B,I);if(!x)throw new lr(Q.cwd,I);if(this.all){for(let y of Q.workspaces)y.manifest.name&&f.add(Y.stringifyIdent(y.locator));if(f.size===0)throw new sh.UsageError("No workspace found to be unlinked in the target project")}else{if(!x.manifest.name)throw new sh.UsageError("The target workspace doesn't have a name and thus cannot be unlinked");f.add(Y.stringifyIdent(x.locator))}}else{let B=[...c.manifest.resolutions.map(({pattern:Q})=>Q.descriptor.fullName)];for(let Q of(0,Rde.default)(B,p))f.add(Q)}}return c.manifest.resolutions=c.manifest.resolutions.filter(({pattern:p})=>!f.has(p.descriptor.fullName)),(await St.start({configuration:r,stdout:this.context.stdout},async p=>{await o.install({cache:n,report:p})})).exitCode()}};Jd.paths=[["unlink"]],Jd.usage=sh.Command.Usage({description:"disconnect the local project from another one",details:`
2022-08-27 06:35:11 +00:00
This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments.
2022-09-06 17:07:18 +00:00
`,examples:[["Unregister a remote workspace in the current project","$0 unlink ~/ts-loader"],["Unregister all workspaces from a remote project in the current project","$0 unlink ~/jest --all"],["Unregister all previously linked workspaces","$0 unlink --all"],["Unregister all workspaces matching a glob","$0 unlink '@babel/*' 'pkg-{a,b}'"]]});Xe();Xe();Xe();var Ea=Te(Vt()),Tde=Te(d1()),cK=Te(pa()),kI=Te(QA());var oh=class extends pt{constructor(){super(...arguments);this.interactive=Ea.Option.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.fixed=Ea.Option.Boolean("-F,--fixed",!1,{description:"Store dependency tags as-is instead of resolving them"});this.exact=Ea.Option.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=Ea.Option.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=Ea.Option.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=Ea.Option.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.mode=Ea.Option.String("--mode",{description:"Change what artifacts installs generate",validator:kI.isEnum(LA)});this.patterns=Ea.Option.Rest()}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await xt.find(r,this.context.cwd),n=await Xr.find(r);if(!a)throw new lr(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let c=[...o.storedDescriptors.values()],f=c.map(B=>Y.stringifyIdent(B)),g=new Set;for(let B of this.patterns){if(Y.parseDescriptor(B).range!=="unknown")throw new Ea.UsageError("Ranges aren't allowed when using --recursive");for(let Q of(0,cK.default)(f,B)){let x=Y.parseIdent(Q);g.add(x.identHash)}}let p=c.filter(B=>g.has(B.identHash));for(let B of p)o.storedDescriptors.delete(B.descriptorHash),o.storedResolutions.delete(B.descriptorHash);return(await St.start({configuration:r,stdout:this.context.stdout},async B=>{await o.install({cache:n,report:B})})).exitCode()}async executeUpClassic(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await xt.find(r,this.context.cwd),n=await Xr.find(r);if(!a)throw new lr(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let c=this.fixed,f=this.interactive??r.get("preferInteractive"),g=C1(this,o),p=f?["keep","reuse","project","latest"]:["project","latest"],I=[],B=[];for(let q of this.patterns){let X=!1,se=Y.parseDescriptor(q);for(let fe of o.workspaces)for(let me of["dependencies","devDependencies"]){let be=[...fe.manifest.getForScope(me).values()].map(Ee=>Y.stringifyIdent(Ee));for(let Ee of(0,cK.default)(be,Y.stringifyIdent(se))){let ye=Y.parseIdent(Ee),De=fe.manifest[me].get(ye.identHash);if(typeof De>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");let h=Y.makeDescriptor(ye,se.range);I.push(Promise.resolve().then(async()=>[fe,me,De,await y1(h,{project:o,workspace:fe,cache:n,target:me,fixed:c,modifier:g,strategies:p})])),X=!0}}X||B.push(q)}if(B.length>1)throw new Ea.UsageError(`Patterns ${Me.prettyList(r,B,Me.Type.CODE)} don't match any packages referenced by any workspace`);if(B.length>0)throw new Ea.UsageError(`Pattern ${Me.prettyList(r,B,Me.Type.CODE)} doesn't match any packages referenced by any workspace`);let Q=await Promise.all(I),x=await Ru.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async q=>{for(let[,,X,{suggestions:se,rejections:fe}]of Q){let me=se.filter(Qe=>Qe.descriptor!==null);if(me.length===0){let[Qe]=fe;if(typeof Qe>"u")throw new Error("Assertion failed: Expected an error to have been set");let be=this.cli.error(Qe);o.configuration.get("enableNetwork")?q.reportError(27,`${Y.prettyDescriptor(r,X)} can't be resolved to a satisfying range
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
${be}`):q.reportError(27,`${Y.prettyDescriptor(r,X)} can't be resolved to a satisfying range (note: network resolution has been disabled)
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
${be}`)}else me.length>1&&!f&&q.reportError(27,`${Y.prettyDescriptor(r,X)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(x.hasErrors())return x.exitCode();let y=!1,T=[];for(let[q,X,,{suggestions:se}]of Q){let fe,me=se.filter(ye=>ye.descriptor!==null),Qe=me[0].descriptor,be=me.every(ye=>Y.areDescriptorsEqual(ye.descriptor,Qe));me.length===1||be?fe=Qe:(y=!0,{answer:fe}=await(0,Tde.prompt)({type:"select",name:"answer",message:`Which range do you want to use in ${Y.prettyWorkspace(r,q)} \u276F ${X}?`,choices:se.map(({descriptor:ye,name:De,reason:h})=>ye?{name:De,hint:h,descriptor:ye}:{name:De,hint:h,disabled:!0}),onCancel:()=>process.exit(130),result(ye){return this.find(ye,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let Ee=q.manifest[X].get(fe.identHash);if(typeof Ee>"u")throw new Error("Assertion failed: This descriptor should have a matching entry");if(Ee.descriptorHash!==fe.descriptorHash)q.manifest[X].set(fe.identHash,fe),T.push([q,X,Ee,fe]);else{let ye=r.makeResolver(),De={project:o,resolver:ye},h=r.normalizeDependency(Ee),Oe=ye.bindDescriptor(h,q.anchoredLocator,De);o.forgetResolution(Oe)}}return await r.triggerMultipleHooks(q=>q.afterWorkspaceDependencyReplacement,T),y&&this.context.stdout.write(`
`),(await St.start({configuration:r,stdout:this.context.stdout},async q=>{await o.install({cache:n,report:q,mode:this.mode})})).exitCode()}};oh.paths=[["up"]],oh.usage=Ea.Command.Usage({description:"upgrade dependencies across the project",details:"\n This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\n\n If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarn up` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarn up` and `yarn up -R` to cover all bases.\n\n If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\n\n The, `-C,--caret`, `-E,--exact` and `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the later will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n Generally you can see `yarn up` as a counterpart to what was `yarn upgrade --latest` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike `yarn upgrade` which only upgraded dependencies in the current workspace, `yarn up` will upgrade all workspaces at the same time.\n\n This command accepts glob patterns as arguments (if valid Descriptors and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n **Note:** The ranges have to be static, only the package scopes and names can contain glob patterns.\n ",examples:[["Upgrade all instances of lodash to the latest release","$0 up lodash"],["Upgrade all instances of lodash to the latest release, but ask confirmation for each","$0 up lodash -i"],["Upgrade all instances of lodash to 1.2.3","$0 up lodash@1.2.3"],["Upgrade all instances of packages with the `@babel` scope to the latest release","$0 up '@babel/*'"],["Upgrade all instances of packages containing the word `jest` to the latest release","$0 up '*jest*'"],["Upgrade all instances of packages with the `@babel` scope to 7.0.0","$0 up '@babel/*@7.0.0'"]]}),oh.schema=[kI.hasKeyRelationship("recursive",kI.KeyRelationship.Forbids,["interactive","exact","tilde","caret"],{ignore:[void 0,!1]})];Xe();Xe();Xe();var zd=Te(Vt()),Vd=class extends pt{constructor(){super(...arguments);this.recursive=zd.Option.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=zd.Option.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=zd.Option.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});
2022-08-27 06:35:11 +00:00
This command prints the exact reasons why a package appears in the dependency tree.
If \`-R,--recursive\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named "Foo" when looking for "Bar", it means that "Foo" already got printed higher in the tree.
2022-09-06 17:07:18 +00:00
`,examples:[["Explain why lodash is used in your project","$0 why lodash"]]});function jht(t,e,{configuration:r,peers:o}){let a=Ve.sortMap(t.storedPackages.values(),f=>Y.stringifyLocator(f)),n={},c={children:n};for(let f of a){let g={};for(let I of f.dependencies.values()){if(!o&&f.peerDependencies.has(I.identHash))continue;let B=t.storedResolutions.get(I.descriptorHash);if(!B)throw new Error("Assertion failed: The resolution should have been registered");let Q=t.storedPackages.get(B);if(!Q)throw new Error("Assertion failed: The package should have been registered");if(Q.identHash!==e)continue;{let y=Y.stringifyLocator(f);n[y]={value:[f,Me.Type.LOCATOR],children:g}}let x=Y.stringifyLocator(Q);g[x]={value:[{descriptor:I,locator:Q},Me.Type.DEPENDENT]}}}return c}function Yht(t,e,{configuration:r,peers:o}){let a=Ve.sortMap(t.workspaces,Q=>Y.stringifyLocator(Q.anchoredLocator)),n=new Set,c=new Set,f=Q=>{if(n.has(Q.locatorHash))return c.has(Q.locatorHash);if(n.add(Q.locatorHash),Q.identHash===e)return c.add(Q.locatorHash),!0;let x=!1;Q.identHash===e&&(x=!0);for(let y of Q.dependencies.values()){if(!o&&Q.peerDependencies.has(y.identHash))continue;let T=t.storedResolutions.get(y.descriptorHash);if(!T)throw new Error("Assertion failed: The resolution should have been registered");let U=t.storedPackages.get(T);if(!U)throw new Error("Assertion failed: The package should have been registered");f(U)&&(x=!0)}return x&&c.add(Q.locatorHash),x};for(let Q of a){let x=t.storedPackages.get(Q.anchoredLocator.locatorHash);if(!x)throw new Error("Assertion failed: The package should have been registered");f(x)}let g=new Set,p={},I={children:p},B=(Q,x,y)=>{if(!c.has(Q.locatorHash))return;let T=y!==null?Me.tuple(Me.Type.DEPENDENT,{locator:Q,descriptor:y}):Me.tuple(Me.Type.LOCATOR,Q),U={},q={value:T,children:U},X=Y.stringifyLocator(Q);if(x[X]=q,!g.has(Q.locatorHash)&&(g.add(Q.locatorHash),!(y!==null&&t.tryWorkspaceByLocator(Q))))for(let se of Q.dependencies.values()){if(!o&&Q.peerDependencies.has(se.identHash))continue;let fe=t.storedResolutions.get(se.descriptorHash);if(!fe)throw new Error("Assertion failed: The resolution should have been registered");let me=t.storedPackages.get(fe);if(!me)throw new Error("Assertion failed: The package should have been registered");B(me,U,se)}};for(let Q of a){let x=t.storedPackages.get(Q.anchoredLocator.locatorHash);if(!x)throw new Error("Assertion failed: The package should have been registered");B(x,p,null)}return I}Xe();var IK={};sr(IK,{default:()=>g0t,gitUtils:()=>wa});Xe();Nt();var wa={};sr(wa,{TreeishProtocols:()=>x1,clone:()=>yK,fetchBase:()=>rme,fetchChangedFiles:()=>nme,fetchChangedWorkspaces:()=>u0t,fetchRoot:()=>tme,isGitUrl:()=>PI,lsRemote:()=>eme,normalizeLocator:()=>dK,normalizeRepoUrl:()=>rP,resolveUrl:()=>CK,splitRepoUrl:()=>ah,validateRepoUrl:()=>mK});Xe();Nt();var k1=Te(Vt()),Vde=Te(zde()),Xde=Te(GU()),xI=Te(Be("querystring")),pK=Te(Ei()),Zde=Te(Be("url"));function $de(){return{...process.env,GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||"ssh"} -o BatchMode=yes`}}var c0t=[/^ssh:/,/^git(?:\+[^:]+)?:/,/^(?:git\+)?https?:[^#]+\/[^#]+(?:\.git)(?:#.*)?$/,/^git@[^#]+\/[^#]+\.git(?:#.*)?$/,/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z._0-9-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\.git)?(?:#.*)?$/,/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/],x1=(a=>(a.Commit="commit",a.Head="head",a.Tag="tag",a.Semver="semver",a))(x1||{});function PI(t){return t?c0t.some(e=>!!t.match(e)):!1}function ah(t){t=rP(t);let e=t.indexOf("#");if(e===-1)return{repo:t,treeish:{protocol:"head",request:"HEAD"},extra:{}};let r=t.slice(0,e),o=t.slice(e+1);if(o.match(/^[a-z]+=/)){let a=xI.default.parse(o);for(let[g,p]of Object.entries(a))if(typeof p!="string")throw new Error(`Assertion failed: The ${g} parameter must be a literal string`);let n=Object.values(x1).find(g=>Object.prototype.hasOwnProperty.call(a,g)),[c,f]=typeof n<"u"?[n,a[n]]:["head","HEAD"];for(let g of Object.values(x1))delete a[g];return{repo:r,treeish:{p
- ${g.join(`
- `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:f.cwd})}};$d.paths=[["workspace"]],$d.usage=Ah.Command.Usage({category:"Workspace-related commands",description:"run a command within the specified workspace",details:`
2022-08-27 06:35:11 +00:00
This command will run a given sub-command on a single workspace.
2022-09-06 17:07:18 +00:00
`,examples:[["Add a package to a single workspace","yarn workspace components add -D react"],["Run build script on a single workspace","yarn workspace components run build"]]});var p0t={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:"BOOLEAN",default:ime.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:"STRING",values:["^","~",""],default:"^"},preferReuse:{description:"If true, `yarn add` will attempt to reuse the most common dependency range in other workspaces.",type:"BOOLEAN",default:!1}},commands:[Bd,Qd,vd,Dd,Wd,Ud,bd,Zd,II,EI,B1,wI,Ed,wd,Sd,kd,xd,Pd,Fd,Rd,Td,Md,Jd,Nd,Kd,_d,Hd,Ld,qd,Gd,jd,DI,Yd,oh,Vd,$d]},h0t=p0t;var DK={};sr(DK,{default:()=>m0t});Xe();var Ft={optional:!0},wK=[["@tailwindcss/aspect-ratio@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@tailwindcss/line-clamp@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@fullhuman/postcss-purgecss@3.1.3 || 3.1.3-alpha.0",{peerDependencies:{postcss:"^8.0.0"}}],["@samverschueren/stream-to-observable@<0.3.1",{peerDependenciesMeta:{rxjs:Ft,zenObservable:Ft}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:Ft,zenObservable:Ft}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{["supports-color"]:Ft}}],["got@<11",{dependencies:{["@types/responselike"]:"^1.0.0",["@types/keyv"]:"^3.1.1"}}],["cacheable-lookup@<4.1.2",{dependencies:{["@types/keyv"]:"^3.1.1"}}],["http-link-dataloader@*",{peerDependencies:{graphql:"^0.13.1 || ^14.0.0"}}],["typescript-language-server@*",{dependencies:{["vscode-jsonrpc"]:"^5.0.1",["vscode-languageserver-protocol"]:"^3.15.0"}}],["postcss-syntax@*",{peerDependenciesMeta:{["postcss-html"]:Ft,["postcss-jsx"]:Ft,["postcss-less"]:Ft,["postcss-markdown"]:Ft,["postcss-scss"]:Ft}}],["jss-plugin-rule-value-function@<=10.1.1",{dependencies:{["tiny-warning"]:"^1.0.2"}}],["ink-select-input@<4.1.0",{peerDependencies:{react:"^16.8.2"}}],["license-webpack-plugin@<2.3.18",{peerDependenciesMeta:{webpack:Ft}}],["snowpack@>=3.3.0",{dependencies:{["node-gyp"]:"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:Ft}}],["reactcss@*",{peerDependencies:{react:"*"}}],["react-color@<=2.19.0",{peerDependencies:{react:"*"}}],["gatsby-plugin-i18n@*",{dependencies:{ramda:"^0.24.1"}}],["useragent@^2.0.0",{dependencies:{request:"^2.88.0",yamlparser:"0.0.x",semver:"5.5.x"}}],["@apollographql/apollo-tools@<=0.5.2",{peerDependencies:{graphql:"^14.2.1 || ^15.0.0"}}],["material-table@^2.0.0",{dependencies:{"@babel/runtime":"^7.11.2"}}],["@babel/parser@*",{dependencies:{"@babel/types":"^7.8.3"}}],["fork-ts-checker-webpack-plugin@<=6.3.4",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:Ft,"vue-template-compiler":Ft}}],["rc-animate@<=3.1.1",{peerDependencies:{react:">=16.9.0","react-dom":">=16.9.0"}}],["react-bootstrap-table2-paginator@*",{dependencies:{classnames:"^2.2.6"}}],["react-draggable@<=4.4.3",{peerDependencies:{react:">= 16.3.0","react-dom":">= 16.3.0"}}],["apollo-upload-client@<14",{peerDependencies:{graphql:"14 - 15"}}],["react-instantsearch-core@<=6.7.0",{peerDependencies:{algoliasearch:">= 3.1 < 5"}}],["react-instantsearch-dom@<=6.7.0",{dependencies:{"react-fast-compare":"^3.0.0"}}],["ws@<7.2.1",{peerDependencies:{bufferutil:"^4.0.1","utf-8-validate":"^5.0.2"},peerDependenciesMeta:{bufferutil:Ft,"utf-8-validate":Ft}}],["react-portal@*",{peerDependencies:{"react-dom":"^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0"}}],["react-scripts@<=4.0.1",{peerDependencies:{react:"*"}}],["testcafe@<=1.10.1",{dependencies:{"@babel/plugin-transform-for-of":"^7.12.1","@babel/runtime":"^7.12.5"}}],["testcafe-legacy-api@<=4.2.0",{dependencies:{"testcafe-hammerhead":"^17.0.1","read-file-relative":"^1.2.0"}}],["@google-cloud/firestore@<=4.9.3",{dependencies:{protobufjs:"^6.8.6"}}],["gatsby-source-apiserver@*",{dependencies:{["babel-polyfill"]:"^6.26.0"}}],["@webpack-cli/package-utils@<=1.0.1-alpha.4",{dependencies:{["
2022-08-27 06:35:11 +00:00
This command will output all matches to the given prolog query.
2022-09-06 17:07:18 +00:00
`,examples:[["List all dependencies throughout the workspace","yarn constraints query 'workspace_has_dependency(_, DependencyName, _, _).'"]]});function k0t(t){return typeof t!="string"?`${t}`:t.match(/^[a-zA-Z][a-zA-Z0-9_]+$/)?t:`'${t}'`}function x0t(t,e){let r=t===0,o=t===e-1;return r&&o?"":r?"\u250C ":o?"\u2514 ":"\u2502 "}Xe();var lP=Te(Vt()),im=class extends pt{constructor(){super(...arguments);this.verbose=lP.Option.Boolean("-v,--verbose",!1,{description:"Also print the fact database automatically compiled from the workspace manifests"})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(AP(),aP)),o=await rt.find(this.context.cwd,this.context.plugins),{project:a}=await xt.find(o,this.context.cwd),n=await r.find(a);this.context.stdout.write(this.verbose?n.fullSource:n.source)}};im.paths=[["constraints","source"]],im.usage=lP.Command.Usage({category:"Constraints-related commands",description:"print the source code for the constraints",details:"\n This command will print the Prolog source code used by the constraints engine. Adding the `-v,--verbose` flag will print the *full* source code, including the fact database automatically compiled from the workspace manifests.\n ",examples:[["Prints the source code","yarn constraints source"],["Print the source code and the fact database","yarn constraints source -v"]]});Xe();Xe();Xe();var cP=Te(Vt()),Tme=Te(E1()),Mme=Te(X_()),Nme=Te(eK()),sm=class extends pt{constructor(){super(...arguments);this.fix=cP.Option.Boolean("--fix",!1,{description:"Attempt to automatically fix unambiguous issues, following a multi-pass process"})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(AP(),aP)),o=await rt.find(this.context.cwd,this.context.plugins),{project:a}=await xt.find(o,this.context.cwd),n=await r.find(a),c=await St.start({configuration:o,stdout:this.context.stdout},async f=>{let g=new Set,p=[];for(let I=0,B=this.fix?10:1;I<B;++I){p=[];let Q=await n.process(),x=new Set;await P0t(x,p,Q.enforcedDependencies,{fix:this.fix,configuration:o});for(let{manifest:T}of x){let U={};T.exportTo(U),T.raw=U}let y=new Set;await b0t(y,p,Q.enforcedFields,{fix:this.fix,configuration:o});for(let{manifest:T}of y)T.load(T.raw);if(g=new Set([...g,...x,...y]),x.size===0&&y.size===0)break}await Promise.all([...g].map(async I=>{await I.persistManifest()}));for(let[I,B]of p)f.reportError(I,B)});return c.hasErrors()?c.exitCode():0}};sm.paths=[["constraints"]],sm.usage=cP.Command.Usage({category:"Constraints-related commands",description:"check that the project constraints are met",details:`
2022-08-27 06:35:11 +00:00
This command will run constraints on your project and emit errors for each one that is found but isn't met. If any error is emitted the process will exit with a non-zero exit code.
If the \`--fix\` flag is used, Yarn will attempt to automatically fix the issues the best it can, following a multi-pass process (with a maximum of 10 iterations). Some ambiguous patterns cannot be autofixed, in which case you'll have to manually specify the right resolution.
For more information as to how to write constraints, please consult our dedicated page on our website: https://yarnpkg.com/features/constraints.
2022-09-06 17:07:18 +00:00
`,examples:[["Check that all constraints are satisfied","yarn constraints"],["Autofix all unmet constraints","yarn constraints --fix"]]});async function P0t(t,e,r,{configuration:o,fix:a}){let n=new Map,c=new Map;for(let{workspace:f,dependencyIdent:g,dependencyRange:p,dependencyType:I}of r){let B=c.get(f);typeof B>"u"&&c.set(f,B=new Map);let Q=B.get(g.identHash);typeof Q>"u"&&B.set(g.identHash,Q=new Map);let x=Q.get(I);typeof x>"u"&&Q.set(I,x=new Set),n.set(g.identHash,g),x.add(p)}for(let[f,g]of c)for(let[p,I]of g){let B=n.get(p);if(typeof B>"u")throw new Error("Assertion failed: The ident should have been registered");for(let[Q,x]of I){let y=x.has(null)?[null]:[...x];if(y.length>2)e.push([53,`${Y.prettyWorkspace(o,f)} must depend on ${Y.prettyIdent(o,B)} via conflicting ranges ${y.slice(0,-1).map(T=>Y.prettyRange(o,String(T))).join(", ")}, and ${Y.prettyRange(o,String(y[y.length-1]))} (in ${Q})`]);else if(y.length>1)e.push([53,`${Y.prettyWorkspace(o,f)} must depend on ${Y.prettyIdent(o,B)} via conflicting ranges ${Y.prettyRange(o,String(y[0]))} and ${Y.prettyRange(o,String(y[1]))} (in ${Q})`]);else{let T=f.manifest[Q].get(B.identHash),[U]=y;U!==null?T?T.range!==U&&(a?(f.manifest[Q].set(B.identHash,Y.makeDescriptor(B,U)),t.add(f)):e.push([24,`${Y.prettyWorkspace(o,f)} must depend on ${Y.prettyIdent(o,B)} via ${Y.prettyRange(o,U)}, but uses ${Y.prettyRange(o,T.range)} instead (in ${Q})`])):a?(f.manifest[Q].set(B.identHash,Y.makeDescriptor(B,U)),t.add(f)):e.push([23,`${Y.prettyWorkspace(o,f)} must depend on ${Y.prettyIdent(o,B)} (via ${Y.prettyRange(o,U)}), but doesn't (in ${Q})`]):T&&(a?(f.manifest[Q].delete(B.identHash),t.add(f)):e.push([25,`${Y.prettyWorkspace(o,f)} has an extraneous dependency on ${Y.prettyIdent(o,B)} (in ${Q})`]))}}}}async function b0t(t,e,r,{configuration:o,fix:a}){let n=new Map;for(let{workspace:c,fieldPath:f,fieldValue:g}of r){let p=Ve.getMapWithDefault(n,c);Ve.getSetWithDefault(p,f).add(g)}for(let[c,f]of n)for(let[g,p]of f){let I=[...p];if(I.length>2)e.push([53,`${Y.prettyWorkspace(o,c)} must have a field ${Me.pretty(o,g,"cyan")} set to conflicting values ${I.slice(0,-1).map(B=>Me.pretty(o,String(B),"magenta")).join(", ")}, or ${Me.pretty(o,String(I[I.length-1]),"magenta")}`]);else if(I.length>1)e.push([53,`${Y.prettyWorkspace(o,c)} must have a field ${Me.pretty(o,g,"cyan")} set to conflicting values ${Me.pretty(o,String(I[0]),"magenta")} or ${Me.pretty(o,String(I[1]),"magenta")}`]);else{let B=(0,Tme.default)(c.manifest.raw,g),[Q]=I;Q!==null?B===void 0?a?(await qK(c,g,Q),t.add(c)):e.push([37,`${Y.prettyWorkspace(o,c)} must have a field ${Me.pretty(o,g,"cyan")} set to ${Me.pretty(o,String(Q),"magenta")}, but doesn't`]):JSON.stringify(B)!==Q&&(a?(await qK(c,g,Q),t.add(c)):e.push([38,`${Y.prettyWorkspace(o,c)} must have a field ${Me.pretty(o,g,"cyan")} set to ${Me.pretty(o,String(Q),"magenta")}, but is set to ${Me.pretty(o,JSON.stringify(B),"magenta")} instead`])):B!=null&&(a?(await qK(c,g,null),t.add(c)):e.push([39,`${Y.prettyWorkspace(o,c)} has an extraneous field ${Me.pretty(o,g,"cyan")} set to ${Me.pretty(o,JSON.stringify(B),"magenta")}`]))}}}async function qK(t,e,r){r===null?(0,Nme.default)(t.manifest.raw,e):(0,Mme.default)(t.manifest.raw,e,JSON.parse(r))}var F0t={configuration:{constraintsPath:{description:"The path of the constraints file.",type:"ABSOLUTE_PATH",default:"./constraints.pro"}},commands:[nm,im,sm]},R0t=F0t;var jK={};sr(jK,{default:()=>M0t});Xe();var T1=Te(Vt()),TI=class extends pt{constructor(){super(...arguments);this.pkg=T1.Option.String("-p,--package",{description:"The package to run the provided command from"});this.quiet=T1.Option.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=T1.Option.String();this.args=T1.Option.Proxy()}async execute(){let r=[];this.pkg&&r.push("--package",this.pkg),this.quiet&&r.push("--quiet");let o=Y.parseDescriptor(this.command),a;o.scope?a=Y.makeIdent(o.scope,`create-${o.name}`):o.name.startsWith("@")?a=Y.makeIdent(o.name.substring(1),"create"):a=Y.makeIdent(null,`create-
`),await ge.writeFilePromise(ee.join(o,"yarn.lock"),"");let a=ee.join(o,".yarnrc.yml"),n=await rt.findProjectCwd(this.context.cwd,Zr.lockfile),f={enableGlobalCache:!(await rt.find(this.context.cwd,null,{strict:!1})).get("enableGlobalCache"),enableTelemetry:!1,logFilters:[{code:gu(68),level:Me.LogLevel.Discard}]},g=n!==null?ee.join(n,".yarnrc.yml"):null;g!==null&&ge.existsSync(g)?(await ge.copyFilePromise(g,a),await rt.updateConfiguration(o,U=>{let q=Ve.toMerged(U,f);return Array.isArray(U.plugins)&&(q.plugins=U.plugins.map(X=>{let se=typeof X=="string"?X:X.path,fe=de.isAbsolute(se)?se:de.resolve(de.fromPortablePath(n),se);return typeof X=="string"?fe:{path:fe,spec:X.spec}})),q})):await ge.writeJsonPromise(a,f);let p=this.packages??[this.command],I=Y.parseDescriptor(this.command).name,B=await this.cli.run(["add","--fixed","--",...p],{cwd:o,quiet:this.quiet});if(B!==0)return B;this.quiet||this.context.stdout.write(`
`);let Q=await rt.find(o,this.context.plugins),{project:x,workspace:y}=await xt.find(Q,o);if(y===null)throw new lr(x.cwd,o);await x.restoreInstallState();let T=await yn.getWorkspaceAccessibleBinaries(y);return T.has(I)===!1&&T.size===1&&typeof this.packages>"u"&&(I=Array.from(T)[0][0]),await yn.executeWorkspaceAccessibleBinary(y,I,this.args,{packageAccessibleBinaries:T,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};am.paths=[["dlx"]],am.usage=om.Command.Usage({description:"run a package in a temporary environment",details:"\n This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\n\n By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\n\n Using `yarn dlx` as a replacement of `yarn add` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through `dlx` - neither their name, nor their version).\n ",examples:[["Use create-react-app to create a new React app","yarn dlx create-react-app ./my-app"],["Install multiple packages for a single command",`yarn dlx -p typescript -p ts-node ts-node --transpile-only -e "console.log('hello!')"`]]});var T0t={commands:[TI,am]},M0t=T0t;var JK={};sr(JK,{default:()=>O0t,execUtils:()=>uP});Xe();Xe();Nt();var Mu="exec:";var uP={};sr(uP,{loadGeneratorFile:()=>M1,makeLocator:()=>WK,makeSpec:()=>Lme,parseSpec:()=>YK});Xe();Nt();function YK(t){let{params:e,selector:r}=Y.parseRange(t),o=de.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?Y.parseLocator(e.locator):null,path:o}}function Lme({parentLocator:t,path:e,generatorHash:r,protocol:o}){let a=t!==null?{locator:Y.stringifyLocator(t)}:{},n=typeof r<"u"?{hash:r}:{};return Y.makeRange({protocol:o,source:e,selector:e,params:{...n,...a}})}function WK(t,{parentLocator:e,path:r,generatorHash:o,protocol:a}){return Y.makeLocator(t,Lme({parentLocator:e,path:r,generatorHash:o,protocol:a}))}async function M1(t,e,r){let{parentLocator:o,path:a}=Y.parseFileStyleRange(t,{protocol:e}),n=ee.isAbsolute(a)?{packageFs:new Bn(Qt.root),prefixPath:Qt.dot,localPath:Qt.root}:await r.fetcher.fetch(o,r),c=n.localPath?{packageFs:new Bn(Qt.root),prefixPath:ee.relative(Qt.root,n.localPath)}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,g=ee.join(c.prefixPath,a);return await f.readFilePromise(g,"utf8")}var fP=class{supports(e,r){return!!e.reference.startsWith(Mu)}getLocalPath(e,r){let{parentLocator:o,path:a}=Y.parseFileStyleRange(e.reference,{protocol:Mu});if(ee.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(o,r);return n===null?null:ee.resolve(n,a)}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:Y.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:c}}async fetchFromDisk(e,r){let o=await M1(e.reference,Mu,r);return ge.mktempPromise(async a=>{let n=ee.join(a,"generator.js");return await ge.writeFilePromise(n,o),ge.mktempPromise(async c=>{if(await this.generatePackage(c,e,n,r),!ge.existsSync(ee.join(c,"build")))throw new Error("The script should have generated a build directory");return await Cs.makeArchiveFromDirectory(ee.join(c,"build"),{prefixPath:Y.getIdentVendorPath(e),compressionLevel:r.project.configuration.get("compressionLevel")})})})}async generatePackage(e,r,o,a){return await ge.mktempPromise(async n=>{let c=await yn.makeScriptEnv({project:a.project,binFolder:n}),f=ee.join(e,"runtime.js");return await ge.mktempPromise(async g=>{let p=ee.join(g,"buildfile.log"),I=null,B=ge.createWriteStream(p),Q=B,x=ee.join(e,"generator"),y=ee.join(e,"build");await ge.mkdirPromise(x),await ge.mkdirPromise(y);let T={temp
2022-08-27 06:35:11 +00:00
// Expose 'Module' as a global variable
Object.defineProperty(global, 'Module', {
get: () => require('module'),
configurable: true,
enumerable: false,
});
// Expose non-hidden built-in modules as global variables
for (const name of Module.builtinModules.filter((name) => name !== 'module' && !name.startsWith('_'))) {
Object.defineProperty(global, name, {
get: () => require(name),
configurable: true,
enumerable: false,
});
}
// Expose the 'execEnv' global variable
Object.defineProperty(global, 'execEnv', {
value: {
2022-09-06 17:07:18 +00:00
...${JSON.stringify(T)},
2022-08-27 06:35:11 +00:00
},
enumerable: true,
});
2022-09-06 17:07:18 +00:00
`);let U=c.NODE_OPTIONS||"",q=/\s*--require\s+\S*\.pnp\.c?js\s*/g;U=U.replace(q," ").trim(),c.NODE_OPTIONS=U,B.write(`# This file contains the result of Yarn generating a package (${Y.stringifyLocator(r)})
`),B.write(`
`);let{code:X}=await gn.pipevp(process.execPath,["--require",de.fromPortablePath(f),de.fromPortablePath(o),Y.stringifyIdent(r)],{cwd:e,env:c,stdin:I,stdout:B,stderr:Q});if(X!==0)throw ge.detachTemp(g),new Error(`Package generation failed (exit code ${X}, logs can be found here: ${Me.pretty(a.project.configuration,p,Me.Type.PATH)})`)})})}};Xe();Xe();var N0t=2,gP=class{supportsDescriptor(e,r){return!!e.range.startsWith(Mu)}supportsLocator(e,r){return!!e.reference.startsWith(Mu)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){return Y.bindDescriptor(e,{locator:Y.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){if(!o.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{path:a,parentLocator:n}=YK(e.range);if(n===null)throw new Error("Assertion failed: The descriptor should have been bound");let c=await M1(Y.makeRange({protocol:Mu,source:a,selector:a,params:{locator:Y.stringifyLocator(n)}}),Mu,o.fetchOptions),f=Li.makeHash(`${N0t}`,c).slice(0,6);return[WK(e,{parentLocator:n,path:a,generatorHash:f,protocol:Mu})]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let o=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await Ve.releaseAfterUseAsync(async()=>await Gt.find(o.prefixPath,{baseFs:o.packageFs}),o.releaseFs);return{...e,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"HARD",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var L0t={fetchers:[fP],resolvers:[gP]},O0t=L0t;var ZK={};sr(ZK,{default:()=>K0t,fileUtils:()=>L1});Xe();Nt();var MI=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,N1=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,ls="file:";var L1={};sr(L1,{makeArchiveFromLocator:()=>pP,makeBufferFromLocator:()=>XK,makeLocator:()=>VK,makeSpec:()=>Ome,parseSpec:()=>zK});Xe();Nt();function zK(t){let{params:e,selector:r}=Y.parseRange(t),o=de.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?Y.parseLocator(e.locator):null,path:o}}function Ome({parentLocator:t,path:e,folderHash:r,protocol:o}){let a=t!==null?{locator:Y.stringifyLocator(t)}:{},n=typeof r<"u"?{hash:r}:{};return Y.makeRange({protocol:o,source:e,selector:e,params:{...n,...a}})}function VK(t,{parentLocator:e,path:r,folderHash:o,protocol:a}){return Y.makeLocator(t,Ome({parentLocator:e,path:r,folderHash:o,protocol:a}))}async function pP(t,{protocol:e,fetchOptions:r,inMemory:o=!1}){let{parentLocator:a,path:n}=Y.parseFileStyleRange(t.reference,{protocol:e}),c=ee.isAbsolute(n)?{packageFs:new Bn(Qt.root),prefixPath:Qt.dot,localPath:Qt.root}:await r.fetcher.fetch(a,r),f=c.localPath?{packageFs:new Bn(Qt.root),prefixPath:ee.relative(Qt.root,c.localPath)}:c;c!==f&&c.releaseFs&&c.releaseFs();let g=f.packageFs,p=ee.join(f.prefixPath,n);return await Ve.releaseAfterUseAsync(async()=>await Cs.makeArchiveFromDirectory(p,{baseFs:g,prefixPath:Y.getIdentVendorPath(t),compressionLevel:r.project.configuration.get("compressionLevel"),inMemory:o}),f.releaseFs)}async function XK(t,{protocol:e,fetchOptions:r}){return(await pP(t,{protocol:e,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var hP=class{supports(e,r){return!!e.reference.startsWith(ls)}getLocalPath(e,r){let{parentLocator:o,path:a}=Y.parseFileStyleRange(e.reference,{protocol:ls});if(ee.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(o,r);return n===null?null:ee.resolve(n,a)}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${Y.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetch
`);let f=ee.join(this.context.cwd,Gt.fileName);await ge.changeFilePromise(f,`${JSON.stringify(c,null,2)}
`,{automaticNewlines:!0});let g=ee.join(this.context.cwd,"README.md");if(ge.existsSync(g)||await ge.writeFilePromise(g,`# ${Y.stringifyIdent(a.name)}
`),!o||o.cwd===this.context.cwd){let p=ee.join(this.context.cwd,Zr.lockfile);ge.existsSync(p)||await ge.writeFilePromise(p,"");let B=[".yarn/*","!.yarn/patches","!.yarn/plugins","!.yarn/releases","!.yarn/sdks","!.yarn/versions","","# Swap the comments on the following lines if you wish to use zero-installs","# Also don't forget to run `yarn config set enableGlobalCache false`!","# Documentation here: https://yarnpkg.com/features/zero-installs","","#!.yarn/cache",".pnp.*"].map(U=>`${U}
`).join(""),Q=ee.join(this.context.cwd,".gitignore");ge.existsSync(Q)||await ge.writeFilePromise(Q,B);let x={["*"]:{endOfLine:"lf",insertFinalNewline:!0},["*.{js,json,yml}"]:{charset:"utf-8",indentStyle:"space",indentSize:2}};Ve.mergeIntoTarget(x,r.get("initEditorConfig"));let y=`root = true
`;for(let[U,q]of Object.entries(x)){y+=`
[${U}]
`;for(let[X,se]of Object.entries(q))y+=`${X.replace(/[A-Z]/g,me=>`_${me.toLowerCase()}`)} = ${se}
`}let T=ee.join(this.context.cwd,".editorconfig");ge.existsSync(T)||await ge.writeFilePromise(T,y),ge.existsSync(ee.join(this.context.cwd,".git"))||await gn.execvp("git",["init"],{cwd:this.context.cwd})}}};Am.paths=[["init"]],Am.usage=Nu.Command.Usage({description:"create a new package",details:"\n This command will setup a new package in your local directory.\n\n If the `-p,--private` or `-w,--workspace` options are set, the package will be private by default.\n\n If the `-w,--workspace` option is set, the package will be configured to accept a set of workspaces in the `packages/` directory.\n\n If the `-i,--install` option is given a value, Yarn will first download it using `yarn set version` and only then forward the init call to the newly downloaded bundle. Without arguments, the downloaded bundle will be `latest`.\n\n The initial settings of the manifest can be changed by using the `initScope` and `initFields` configuration values. Additionally, Yarn will generate an EditorConfig file whose rules can be altered via `initEditorConfig`, and will initialize a Git repository in the current directory.\n ",examples:[["Create a new package in the local directory","yarn init"],["Create a new private package in the local directory","yarn init -p"],["Create a new package and store the Yarn release inside","yarn init -i=latest"],["Create a new private package and defines it as a workspace root","yarn init -w"]]});var J0t={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:"STRING",default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:"MAP",valueDefinition:{description:"",type:"ANY"}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:"MAP",valueDefinition:{description:"",type:"ANY"}}},commands:[Am]},z0t=J0t;var i6={};sr(i6,{default:()=>DEt});Xe();var qme=Te(Be("os"));function NI({stdout:t}){if(qme.default.endianness()==="BE")throw new Error("Interactive commands cannot be used on big-endian systems because ink depends on yoga-layout-prebuilt which only supports little-endian architectures");if(!t.isTTY)throw new Error("Interactive commands can only be used inside a TTY environment")}var vwe=Te(Vt());var $Ce=Te(IH()),EH={appId:"OFCNCOG2CU",apiKey:"6fe4476ee5a1832882e326b506d14126",indexName:"npm-search"},Mmt=(0,$Ce.default)(EH.appId,EH.apiKey).initIndex(EH.indexName),wH=async(t,e=0)=>await Mmt.search(t,{analyticsTags:["yarn-plugin-interactive-tools"],attributesToRetrieve:["name","version","owner","repository","humanDownloadsLast30Days"],page:e,hitsPerPage:10});var L2=["regular","dev","peer"],Im=class extends pt{async execute(){NI(this.context);let{Gem:e}=await Promise.resolve().then(()=>(ub(),Wq)),{ScrollableItems:r}=await Promise.resolve().then(()=>(hb(),pb)),{useKeypress:o}=await Promise.resolve().then(()=>(T2(),pwe)),{useMinistore:a}=await Promise.resolve().then(()=>($q(),Zq)),{renderForm:n}=await Promise.resolve().then(()=>(yb(),Cb)),{default:c}=await Promise.resolve().then(()=>Te(Qwe())),{Box:f,Text:g}=await Promise.resolve().then(()=>Te(Rl())),{default:p,useEffect:I,useState:B}=await Promise.resolve().then(()=>Te(hn())),Q=await rt.find(this.context.cwd,this.context.plugins),x=()=>p.createElement(f,{flexDirection:"row"},p.createElement(f,{flexDirection:"column",width:48},p.createElement(f,null,p.createElement(g,null,"Press ",p.createElement(g,{bold:!0,color:"cyanBright"},"<up>"),"/",p.createElement(g,{bold:!0,color:"cyanBright"},"<down>")," to move between packages.")),p.createElement(f,null,p.createElement(g,null,"Press ",p.createElement(g,{bold:!0,color:"cyanBright"},"<space>")," to select a package.")),p.createElement(f,null,p.createElement(g,null,"Press ",p.createElement(g,{bold:!0,color:"cyanBright"},"<space>")," again to change the target."))),p.createElement(f,{flexDirection:"column"},p.createElement(f,{marginLeft:1},p.createElement(g,null,"Press ",p.createElement(g,{bold:!0,color:"cyanBright"},"<enter>")," to install the selected packages."))
2022-08-27 06:35:11 +00:00
This command opens a fullscreen terminal interface where you can search for and install packages from the npm registry.
2022-09-06 17:07:18 +00:00
`,examples:[["Open the search window","yarn search"]]});Xe();var Fwe=Te(Vt());O8();var Rwe=Te(Ei()),bwe=/^((?:[\^~]|>=?)?)([0-9]+)(\.[0-9]+)(\.[0-9]+)((?:-\S+)?)$/,Twe=(t,e)=>t.length>0?[t.slice(0,e)].concat(Twe(t.slice(e),e)):[],Em=class extends pt{async execute(){NI(this.context);let{ItemOptions:e}=await Promise.resolve().then(()=>(Pwe(),xwe)),{Pad:r}=await Promise.resolve().then(()=>(n6(),kwe)),{ScrollableItems:o}=await Promise.resolve().then(()=>(hb(),pb)),{useMinistore:a}=await Promise.resolve().then(()=>($q(),Zq)),{renderForm:n}=await Promise.resolve().then(()=>(yb(),Cb)),{Box:c,Text:f}=await Promise.resolve().then(()=>Te(Rl())),{default:g,useEffect:p,useRef:I,useState:B}=await Promise.resolve().then(()=>Te(hn())),Q=await rt.find(this.context.cwd,this.context.plugins),{project:x,workspace:y}=await xt.find(Q,this.context.cwd),T=await Xr.find(Q);if(!y)throw new lr(x.cwd,this.context.cwd);await x.restoreInstallState({restoreResolutions:!1});let U=this.context.stdout.rows-7,q=(Ie,Ce)=>{let ue=vge(Ie,Ce),re="";for(let Se of ue)Se.added?re+=Me.pretty(Q,Se.value,"green"):Se.removed||(re+=Se.value);return re},X=(Ie,Ce)=>{if(Ie===Ce)return Ce;let ue=Y.parseRange(Ie),re=Y.parseRange(Ce),Se=ue.selector.match(bwe),Le=re.selector.match(bwe);if(!Se||!Le)return q(Ie,Ce);let dt=["gray","red","yellow","green","magenta"],H=null,_e="";for(let tt=1;tt<dt.length;++tt)H!==null||Se[tt]!==Le[tt]?(H===null&&(H=dt[tt-1]),_e+=Me.pretty(Q,Le[tt],H)):_e+=Le[tt];return _e},se=async(Ie,Ce,ue)=>{let re=await Ec.fetchDescriptorFrom(Ie,ue,{project:x,cache:T,preserveModifier:Ce,workspace:y});return re!==null?re.range:Ie.range},fe=async Ie=>{let Ce=Rwe.default.valid(Ie.range)?`^${Ie.range}`:Ie.range,[ue,re]=await Promise.all([se(Ie,Ie.range,Ce).catch(()=>null),se(Ie,Ie.range,"latest").catch(()=>null)]),Se=[{value:null,label:Ie.range}];return ue&&ue!==Ie.range?Se.push({value:ue,label:X(Ie.range,ue)}):Se.push({value:null,label:""}),re&&re!==ue&&re!==Ie.range?Se.push({value:re,label:X(Ie.range,re)}):Se.push({value:null,label:""}),Se},me=()=>g.createElement(c,{flexDirection:"row"},g.createElement(c,{flexDirection:"column",width:49},g.createElement(c,{marginLeft:1},g.createElement(f,null,"Press ",g.createElement(f,{bold:!0,color:"cyanBright"},"<up>"),"/",g.createElement(f,{bold:!0,color:"cyanBright"},"<down>")," to select packages.")),g.createElement(c,{marginLeft:1},g.createElement(f,null,"Press ",g.createElement(f,{bold:!0,color:"cyanBright"},"<left>"),"/",g.createElement(f,{bold:!0,color:"cyanBright"},"<right>")," to select versions."))),g.createElement(c,{flexDirection:"column"},g.createElement(c,{marginLeft:1},g.createElement(f,null,"Press ",g.createElement(f,{bold:!0,color:"cyanBright"},"<enter>")," to install.")),g.createElement(c,{marginLeft:1},g.createElement(f,null,"Press ",g.createElement(f,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),Qe=()=>g.createElement(c,{flexDirection:"row",paddingTop:1,paddingBottom:1},g.createElement(c,{width:50},g.createElement(f,{bold:!0},g.createElement(f,{color:"greenBright"},"?")," Pick the packages you want to upgrade.")),g.createElement(c,{width:17},g.createElement(f,{bold:!0,underline:!0,color:"gray"},"Current")),g.createElement(c,{width:17},g.createElement(f,{bold:!0,underline:!0,color:"gray"},"Range")),g.createElement(c,{width:17},g.createElement(f,{bold:!0,underline:!0,color:"gray"},"Latest"))),be=({active:Ie,descriptor:Ce,suggestions:ue})=>{let[re,Se]=a(Ce.descriptorHash,null),Le=Y.stringifyIdent(Ce),dt=Math.max(0,45-Le.length);return g.createElement(g.Fragment,null,g.createElement(c,null,g.createElement(c,{width:45},g.createElement(f,{bold:!0},Y.prettyIdent(Q,Ce)),g.createElement(r,{active:Ie,length:dt})),g.createElement(e,{active:Ie,options:ue,value:re,skewer:!0,onChange:Se,sizes:[17,17,17]})))},Ee=({dependencies:Ie})=>{let[Ce,ue]=B(Ie.map(()=>null)),re=I(!0),Se=async Le=>{let dt=await fe(Le);return dt.filter(H=>H.label!=="").length<=1?null:{descriptor:Le,suggestions:dt}};return p(()=>()=>{re.current=!1},[]),p(()=>{let Le=Math.trunc(U*1.75),dt=Ie.slice(0,Le),H=Ie.slice(Le),_e=Twe(H,U),tt=
2022-08-27 06:35:11 +00:00
This command opens a fullscreen terminal interface where you can see any out of date packages used by your application, their status compared to the latest versions available on the remote registry, and select packages to upgrade.
2022-09-06 17:07:18 +00:00
`,examples:[["Open the upgrade window","yarn upgrade-interactive"]]});var vEt={commands:[Im,Em]},DEt=vEt;var s6={};sr(s6,{default:()=>kEt});Xe();Nt();var Bg="portal:",Qg="link:";var Ib=class{supports(e,r){return!!e.reference.startsWith(Bg)}getLocalPath(e,r){let{parentLocator:o,path:a}=Y.parseFileStyleRange(e.reference,{protocol:Bg});if(ee.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(o,r);return n===null?null:ee.resolve(n,a)}async fetch(e,r){let{parentLocator:o,path:a}=Y.parseFileStyleRange(e.reference,{protocol:Bg}),n=ee.isAbsolute(a)?{packageFs:new Bn(Qt.root),prefixPath:Qt.dot,localPath:Qt.root}:await r.fetcher.fetch(o,r),c=n.localPath?{packageFs:new Bn(Qt.root),prefixPath:ee.relative(Qt.root,n.localPath),localPath:Qt.root}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,g=ee.resolve(c.localPath??c.packageFs.getRealPath(),c.prefixPath,a);return n.localPath?{packageFs:new Bn(g,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:Qt.dot,localPath:g}:{packageFs:new au(g,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:Qt.dot}}};Xe();Xe();Nt();var Eb=class{supportsDescriptor(e,r){return!!e.range.startsWith(Bg)}supportsLocator(e,r){return!!e.reference.startsWith(Bg)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){return Y.bindDescriptor(e,{locator:Y.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){let a=e.range.slice(Bg.length);return[Y.makeLocator(e,`${Bg}${de.toPortablePath(a)}`)]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let o=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await Ve.releaseAfterUseAsync(async()=>await Gt.find(o.prefixPath,{baseFs:o.packageFs}),o.releaseFs);return{...e,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"SOFT",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};Xe();Nt();var wb=class{supports(e,r){return!!e.reference.startsWith(Qg)}getLocalPath(e,r){let{parentLocator:o,path:a}=Y.parseFileStyleRange(e.reference,{protocol:Qg});if(ee.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(o,r);return n===null?null:ee.resolve(n,a)}async fetch(e,r){let{parentLocator:o,path:a}=Y.parseFileStyleRange(e.reference,{protocol:Qg}),n=ee.isAbsolute(a)?{packageFs:new Bn(Qt.root),prefixPath:Qt.dot,localPath:Qt.root}:await r.fetcher.fetch(o,r),c=n.localPath?{packageFs:new Bn(Qt.root),prefixPath:ee.relative(Qt.root,n.localPath),localPath:Qt.root}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,g=ee.resolve(c.localPath??c.packageFs.getRealPath(),c.prefixPath,a);return n.localPath?{packageFs:new Bn(g,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:Qt.dot,discardFromLookup:!0,localPath:g}:{packageFs:new au(g,{baseFs:f}),releaseFs:c.releaseFs,prefixPath:Qt.dot,discardFromLookup:!0}}};Xe();Nt();var Bb=class{supportsDescriptor(e,r){return!!e.range.startsWith(Qg)}supportsLocator(e,r){return!!e.reference.startsWith(Qg)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){return Y.bindDescriptor(e,{locator:Y.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){let a=e.range.slice(Qg.length);return[Y.makeLocator(e,`${Qg}${de.toPortablePath(a)}`)]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){return{...e,version:"0.0.0",languageName:r.project.configuration.get("defaultLanguageName"),linkType:"SOFT",conditions:null,dependencies:new Map,peerDependencies:new Map,dependenciesMeta:new Map,peerDependenciesMeta:new Map,bin:new Map}}};var SEt={fetchers:[wb,Ib],resolvers:[Bb,Eb]},kEt=SEt;var T6={};sr(T6,{default:()=>Mwt});Nt();Xe();Nt();Nt();va
${I}, next tree:
${U2(f)}`);let Q=Uwe(f);if(Q)throw new Error(`${Q}, after hoisting finished:
${U2(f)}`)}return n.debugLevel>=2&&console.log(U2(f)),NEt(f)},xEt=t=>{let e=t[t.length-1],r=new Map,o=new Set,a=n=>{if(!o.has(n)){o.add(n);for(let c of n.hoistedDependencies.values())r.set(c.name,c);for(let c of n.dependencies.values())n.peerNames.has(c.name)||a(c)}};return a(e),r},PEt=t=>{let e=t[t.length-1],r=new Map,o=new Set,a=new Set,n=(c,f)=>{if(o.has(c))return;o.add(c);for(let p of c.hoistedDependencies.values())if(!f.has(p.name)){let I;for(let B of t)I=B.dependencies.get(p.name),I&&r.set(I.name,I)}let g=new Set;for(let p of c.dependencies.values())g.add(p.name);for(let p of c.dependencies.values())c.peerNames.has(p.name)||n(p,g)};return n(e,a),r},Nwe=(t,e)=>{if(e.decoupled)return e;let{name:r,references:o,ident:a,locator:n,dependencies:c,originalDependencies:f,hoistedDependencies:g,peerNames:p,reasons:I,isHoistBorder:B,hoistPriority:Q,dependencyKind:x,hoistedFrom:y,hoistedTo:T}=e,U={name:r,references:new Set(o),ident:a,locator:n,dependencies:new Map(c),originalDependencies:new Map(f),hoistedDependencies:new Map(g),peerNames:new Set(p),reasons:new Map(I),decoupled:!0,isHoistBorder:B,hoistPriority:Q,dependencyKind:x,hoistedFrom:new Map(y),hoistedTo:new Map(T)},q=U.dependencies.get(r);return q&&q.ident==U.ident&&U.dependencies.set(r,U),t.dependencies.set(U.name,U),U},bEt=(t,e)=>{let r=new Map([[t.name,[t.ident]]]);for(let a of t.dependencies.values())t.peerNames.has(a.name)||r.set(a.name,[a.ident]);let o=Array.from(e.keys());o.sort((a,n)=>{let c=e.get(a),f=e.get(n);return f.hoistPriority!==c.hoistPriority?f.hoistPriority-c.hoistPriority:f.peerDependents.size!==c.peerDependents.size?f.peerDependents.size-c.peerDependents.size:f.dependents.size-c.dependents.size});for(let a of o){let n=a.substring(0,a.indexOf("@",1)),c=a.substring(n.length+1);if(!t.peerNames.has(n)){let f=r.get(n);f||(f=[],r.set(n,f)),f.indexOf(c)<0&&f.push(c)}}return r},o6=t=>{let e=new Set,r=(o,a=new Set)=>{if(!a.has(o)){a.add(o);for(let n of o.peerNames)if(!t.peerNames.has(n)){let c=t.dependencies.get(n);c&&!e.has(c)&&r(c,a)}e.add(o)}};for(let o of t.dependencies.values())t.peerNames.has(o.name)||r(o);return e},A6=(t,e,r,o,a,n=new Set)=>{let c=e[e.length-1];if(n.has(c))return{anotherRoundNeeded:!1,isGraphChanged:!1};n.add(c);let f=LEt(c),g=bEt(c,f),p=t==c?new Map:a.fastLookupPossible?xEt(e):PEt(e),I,B=!1,Q=!1,x=new Map(Array.from(g.entries()).map(([T,U])=>[T,U[0]])),y=new Map;do{let T=TEt(t,e,r,p,x,g,o,y,a);T.isGraphChanged&&(Q=!0),T.anotherRoundNeeded&&(B=!0),I=!1;for(let[U,q]of g)q.length>1&&!c.dependencies.has(U)&&(x.delete(U),q.shift(),x.set(U,q[0]),I=!0)}while(I);for(let T of c.dependencies.values())if(!c.peerNames.has(T.name)&&!r.has(T.locator)){r.add(T.locator);let U=A6(t,[...e,T],r,y,a);U.isGraphChanged&&(Q=!0),U.anotherRoundNeeded&&(B=!0),r.delete(T.locator)}return{anotherRoundNeeded:B,isGraphChanged:Q}},FEt=t=>{for(let[e,r]of t.dependencies)if(!t.peerNames.has(e)&&r.ident!==t.ident)return!0;return!1},REt=(t,e,r,o,a,n,c,f,{outputReason:g,fastLookupPossible:p})=>{let I,B=null,Q=new Set;g&&(I=`${Array.from(e).map(U=>Eo(U)).join("\u2192")}`);let x=r[r.length-1],T=!(o.ident===x.ident);if(g&&!T&&(B="- self-reference"),T&&(T=o.dependencyKind!==1,g&&!T&&(B="- workspace")),T&&o.dependencyKind===2&&(T=!FEt(o),g&&!T&&(B="- external soft link with unhoisted dependencies")),T&&(T=x.dependencyKind!==1||x.hoistedFrom.has(o.name)||e.size===1,g&&!T&&(B=x.reasons.get(o.name))),T&&(T=!t.peerNames.has(o.name),g&&!T&&(B=`- cannot shadow peer: ${Eo(t.originalDependencies.get(o.name).locator)} at ${I}`)),T){let U=!1,q=a.get(o.name);if(U=!q||q.ident===o.ident,g&&!U&&(B=`- filled by: ${Eo(q.locator)} at ${I}`),U)for(let X=r.length-1;X>=1;X--){let fe=r[X].dependencies.get(o.name);if(fe&&fe.ident!==o.ident){U=!1;let me=f.get(x);me||(me=new Set,f.set(x,me)),me.add(o.name),g&&(B=`- filled by ${Eo(fe.locator)} at ${r.slice(0,X).map(Qe=>Eo(Qe.locator)).join("\u2192")}`);break}}T=U}if(T&&(T=n.get(o.name)===o.ident,g&&!T&&(B=`- filled by: ${Eo(c.get(o.name)[0])} at ${I}`)),T){let U=!0,q=new Set(o.peerNames);for(let X=r.length-1;X>=1;X--){let se=r[X];for(let fe of q){if(
${U2(t)}`)}let Ie=o6(fe);for(let Ce of Ie)if(De.has(Ce)){let ue=ye.get(Ce);if((a.get(Ce.name)===Ce.ident||!fe.reasons.has(Ce.name))&&ue.isHoistable!==0&&fe.reasons.set(Ce.name,ue.reason),!Ce.isHoistBorder&&be.indexOf(Qb(Ce))<0){I.add(fe);let Se=Nwe(fe,Ce);x([...q,fe],Qe,be,Se,T),I.delete(fe)}}},y,T=new Set(o6(p)),U=Array.from(e).map(q=>Qb(q));do{y=T,T=new Set;for(let q of y){if(q.locator===p.locator||q.isHoistBorder)continue;let X=Nwe(p,q);x([],Array.from(r),U,X,T)}}while(T.size>0);return{anotherRoundNeeded:B,isGraphChanged:Q}},Uwe=t=>{let e=[],r=new Set,o=new Set,a=(n,c,f)=>{if(r.has(n)||(r.add(n),o.has(n)))return;let g=new Map(c);for(let p of n.dependencies.values())n.peerNames.has(p.name)||g.set(p.name,p);for(let p of n.originalDependencies.values()){let I=g.get(p.name),B=()=>`${Array.from(o).concat([n]).map(Q=>Eo(Q.locator)).join("\u2192")}`;if(n.peerNames.has(p.name)){let Q=c.get(p.name);(Q!==I||!Q||Q.ident!==p.ident)&&e.push(`${B()} - broken peer promise: expected ${p.ident} but found ${Q&&Q.ident}`)}else{let Q=f.hoistedFrom.get(n.name),x=n.hoistedTo.get(p.name),y=`${Q?` hoisted from ${Q.join(", ")}`:""}`,T=`${x?` hoisted to ${x}`:""}`,U=`${B()}${y}`;I?I.ident!==p.ident&&e.push(`${U} - broken require promise for ${p.name}${T}: expected ${p.ident}, but found: ${I.ident}`):e.push(`${U} - broken require promise: no required dependency ${p.name}${T} found`)}}o.add(n);for(let p of n.dependencies.values())n.peerNames.has(p.name)||a(p,g,n);o.delete(n)};return a(t,t.dependencies,t),e.join(`
`)},MEt=(t,e)=>{let{identName:r,name:o,reference:a,peerNames:n}=t,c={name:o,references:new Set([a]),locator:a6(r,a),ident:Mwe(r,a),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(n),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},f=new Map([[t,c]]),g=(p,I)=>{let B=f.get(p),Q=!!B;if(!B){let{name:x,identName:y,reference:T,peerNames:U,hoistPriority:q,dependencyKind:X}=p,se=e.hoistingLimits.get(I.locator);B={name:x,references:new Set([T]),locator:a6(y,T),ident:Mwe(y,T),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(U),reasons:new Map,decoupled:!0,isHoistBorder:se?se.has(x):!1,hoistPriority:q||0,dependencyKind:X||0,hoistedFrom:new Map,hoistedTo:new Map},f.set(p,B)}if(I.dependencies.set(p.name,B),I.originalDependencies.set(p.name,B),Q){let x=new Set,y=T=>{if(!x.has(T)){x.add(T),T.decoupled=!1;for(let U of T.dependencies.values())T.peerNames.has(U.name)||y(U)}};y(B)}else for(let x of p.dependencies)g(x,B)};for(let p of t.dependencies)g(p,c);return c},l6=t=>t.substring(0,t.indexOf("@",1)),NEt=t=>{let e={name:t.name,identName:l6(t.locator),references:new Set(t.references),dependencies:new Set},r=new Set([t]),o=(a,n,c)=>{let f=r.has(a),g;if(n===a)g=c;else{let{name:p,references:I,locator:B}=a;g={name:p,identName:l6(B),references:I,dependencies:new Set}}if(c.dependencies.add(g),!f){r.add(a);for(let p of a.dependencies.values())a.peerNames.has(p.name)||o(p,a,g);r.delete(a)}};for(let a of t.dependencies.values())o(a,t,e);return e},LEt=t=>{let e=new Map,r=new Set([t]),o=c=>`${c.name}@${c.ident}`,a=c=>{let f=o(c),g=e.get(f);return g||(g={dependents:new Set,peerDependents:new Set,hoistPriority:0},e.set(f,g)),g},n=(c,f)=>{let g=!!r.has(f);if(a(f).dependents.add(c.ident),!g){r.add(f);for(let I of f.dependencies.values()){let B=a(I);B.hoistPriority=Math.max(B.hoistPriority,I.hoistPriority),f.peerNames.has(I.name)?B.peerDependents.add(f.ident):n(f,I)}}};for(let c of t.dependencies.values())t.peerNames.has(c.name)||n(t,c);return e},Eo=t=>{if(!t)return"none";let e=t.indexOf("@",1),r=t.substring(0,e);r.endsWith("$wsroot$")&&(r=`wh:${r.replace("$wsroot$","")}`);let o=t.substring(e+1);if(o==="workspace:.")return".";if(o){let a=(o.indexOf("#")>0?o.split("#")[1]:o).replace("npm:","");return o.startsWith("virtual")&&(r=`v:${r}`),a.startsWith("workspace")&&(r=`w:${r}`,a=""),`${r}${a?`@${a}`:""}`}else return`${r}`},Lwe=5e4,U2=t=>{let e=0,r=(a,n,c="")=>{if(e>Lwe||n.has(a))return"";e++;let f=Array.from(a.dependencies.values()).sort((p,I)=>p.name===I.name?0:p.name>I.name?1:-1),g="";n.add(a);for(let p=0;p<f.length;p++){let I=f[p];if(!a.peerNames.has(I.name)&&I!==a){let B=a.reasons.get(I.name),Q=l6(I.locator);g+=`${c}${p<f.length-1?"\u251C\u2500":"\u2514\u2500"}${(n.has(I)?">":"")+(Q!==I.name?`a:${I.name}:`:"")+Eo(I.locator)+(B?` ${B}`:"")}
`,g+=r(I,n,`${c}${p<f.length-1?"\u2502 ":" "}`)}}return n.delete(a),g};return r(t,new Set)+(e>Lwe?`
2022-08-27 06:35:11 +00:00
Tree is too large, part of the tree has been dunped
2022-09-06 17:07:18 +00:00
`:"")};var _2=(o=>(o.WORKSPACES="workspaces",o.DEPENDENCIES="dependencies",o.NONE="none",o))(_2||{}),_we="node_modules",wm="$wsroot$";var K2=(t,e)=>{let{packageTree:r,hoistingLimits:o,errors:a,preserveSymlinksRequired:n}=UEt(t,e),c=null;if(a.length===0){let f=Owe(r,{hoistingLimits:o});c=KEt(t,f,e)}return{tree:c,errors:a,preserveSymlinksRequired:n}},Uu=t=>`${t.name}@${t.reference}`,u6=t=>{let e=new Map;for(let[r,o]of t.entries())if(!o.dirList){let a=e.get(o.locator);a||(a={target:o.target,linkType:o.linkType,locations:[],aliases:o.aliases},e.set(o.locator,a)),a.locations.push(r)}for(let r of e.values())r.locations=r.locations.sort((o,a)=>{let n=o.split(ee.delimiter).length,c=a.split(ee.delimiter).length;return a===o?0:n!==c?c-n:a>o?1:-1});return e},Kwe=(t,e)=>{let r=Y.isVirtualLocator(t)?Y.devirtualizeLocator(t):t,o=Y.isVirtualLocator(e)?Y.devirtualizeLocator(e):e;return Y.areLocatorsEqual(r,o)},c6=(t,e,r,o)=>{if(t.linkType!=="SOFT")return!1;let a=de.toPortablePath(r.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?r.resolveVirtual(t.packageLocation):t.packageLocation);return ee.contains(o,a)===null},OEt=t=>{let e=t.getPackageInformation(t.topLevel);if(e===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(t.findPackageLocator(e.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let o=de.toPortablePath(e.packageLocation.slice(0,-1)),a=new Map,n={children:new Map},c=t.getDependencyTreeRoots(),f=new Map,g=new Set,p=(Q,x)=>{let y=Uu(Q);if(g.has(y))return;g.add(y);let T=t.getPackageInformation(Q);if(T){let U=x?Uu(x):"";if(Uu(Q)!==U&&T.linkType==="SOFT"&&!c6(T,Q,t,o)){let q=Hwe(T,Q,t);(!f.get(q)||Q.reference.startsWith("workspace:"))&&f.set(q,Q)}for(let[q,X]of T.packageDependencies)X!==null&&(T.packagePeers.has(q)||p(t.getLocator(q,X),Q))}};for(let Q of c)p(Q,null);let I=o.split(ee.sep);for(let Q of f.values()){let x=t.getPackageInformation(Q),T=de.toPortablePath(x.packageLocation.slice(0,-1)).split(ee.sep).slice(I.length),U=n;for(let q of T){let X=U.children.get(q);X||(X={children:new Map},U.children.set(q,X)),U=X}U.workspaceLocator=Q}let B=(Q,x)=>{if(Q.workspaceLocator){let y=Uu(x),T=a.get(y);T||(T=new Set,a.set(y,T)),T.add(Q.workspaceLocator)}for(let y of Q.children.values())B(y,Q.workspaceLocator||x)};for(let Q of n.children.values())B(Q,n.workspaceLocator);return a},UEt=(t,e)=>{let r=[],o=!1,a=new Map,n=OEt(t),c=t.getPackageInformation(t.topLevel);if(c===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let f=t.findPackageLocator(c.packageLocation);if(f===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let g=de.toPortablePath(c.packageLocation.slice(0,-1)),p={name:f.name,identName:f.name,reference:f.reference,peerNames:c.packagePeers,dependencies:new Set,dependencyKind:1},I=new Map,B=(x,y)=>`${Uu(y)}:${x}`,Q=(x,y,T,U,q,X,se,fe)=>{var Ce,ue;let me=B(x,T),Qe=I.get(me),be=!!Qe;!be&&T.name===f.name&&T.reference===f.reference&&(Qe=p,I.set(me,p));let Ee=c6(y,T,t,g);if(!Qe){let re=0;Ee?re=2:y.linkType==="SOFT"&&T.name.endsWith(wm)&&(re=1),Qe={name:x,identName:T.name,reference:T.reference,dependencies:new Set,peerNames:re===1?new Set:y.packagePeers,dependencyKind:re},I.set(me,Qe)}let ye;if(Ee?ye=2:q.linkType==="SOFT"?ye=1:ye=0,Qe.hoistPriority=Math.max(Qe.hoistPriority||0,ye),fe&&!Ee){let re=Uu({name:U.identName,reference:U.reference}),Se=a.get(re)||new Set;a.set(re,Se),Se.add(Qe.name)}let De=new Map(y.packageDependencies);if(e.project){let re=e.project.workspacesByCwd.get(de.toPortablePath(y.packageLocation.slice(0,-1)));if(re){let Se=new Set([...Array.from(re.manifest.peerDependencies.values(),Le=>Y.stringifyIdent(Le)),...Array.from(re.manifest.peerDependenciesMeta.keys())]);for(let Le of Se)De.has(Le)||(De.set(Le,X.get(Le)||null),Qe.peerNames.add(Le))}}let h=Uu({name:T.name.replace(wm,""),reference:T.reference}),Oe=n.get(h);if(Oe)for(let re of Oe)De.set(`${re.name}${wm}`,re.reference);(y!==q||y.link
`;for(let n=0,c=t.length;n<c;++n)a+=o+vb(String(n),t[n],e,o).replace(/^ +/,""),n+1<c&&(a+=","),a+=`
`;return a+=r,a+="]",a}function GEt(t,e,r){let o=Object.keys(t),a="";a+="{";for(let n=0,c=o.length,f=0;n<c;++n){let g=o[n],p=t[g];typeof p>"u"||(f!==0&&(a+=", "),a+=JSON.stringify(g),a+=": ",a+=vb(g,p,e,r).replace(/^ +/g,""),f+=1)}return a+="}",a}function jEt(t,e,r){let o=Object.keys(t),a=`${r} `,n="";n+=r,n+=`{
`;let c=0;for(let f=0,g=o.length;f<g;++f){let p=o[f],I=t[p];typeof I>"u"||(c!==0&&(n+=",",n+=`
`),n+=a,n+=JSON.stringify(p),n+=": ",n+=vb(p,I,e,a).replace(/^ +/g,""),c+=1)}return c!==0&&(n+=`
`),n+=r,n+="}",n}function vb(t,e,r,o){let{next:a}=qwe[r],n=a[t]||a["*"];return Gwe(e,n,o)}function Gwe(t,e,r){let{collapsed:o}=qwe[e];return Array.isArray(t)?o?HEt(t,e,r):qEt(t,e,r):typeof t=="object"&&t!==null?o?GEt(t,e,r):jEt(t,e,r):JSON.stringify(t)}function jwe(t){return Gwe(t,"TOP_LEVEL","")}function H2(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let o=[];for(let n of e)o.push(r.map(c=>n(c)));let a=r.map((n,c)=>c);return a.sort((n,c)=>{for(let f of o){let g=f[n]<f[c]?-1:f[n]>f[c]?1:0;if(g!==0)return g}return 0}),a.map(n=>r[n])}function YEt(t){let e=new Map,r=H2(t.fallbackExclusionList||[],[({name:o,reference:a})=>o,({name:o,reference:a})=>a]);for(let{name:o,reference:a}of r){let n=e.get(o);typeof n>"u"&&e.set(o,n=new Set),n.add(a)}return Array.from(e).map(([o,a])=>[o,Array.from(a)])}function WEt(t){return H2(t.fallbackPool||[],([e])=>e)}function JEt(t){let e=[];for(let[r,o]of H2(t.packageRegistry,([a])=>a===null?"0":`1${a}`)){let a=[];e.push([r,a]);for(let[n,{packageLocation:c,packageDependencies:f,packagePeers:g,linkType:p,discardFromLookup:I}]of H2(o,([B])=>B===null?"0":`1${B}`)){let B=[];r!==null&&n!==null&&!f.has(r)&&B.push([r,n]);for(let[y,T]of H2(f.entries(),([U])=>U))B.push([y,T]);let Q=g&&g.size>0?Array.from(g):void 0,x=I||void 0;a.push([n,{packageLocation:c,packageDependencies:B,packagePeers:Q,linkType:p,discardFromLookup:x}])}}return e}function q2(t){return{__info:["This file is automatically generated. Do not touch it, or risk","your modifications being lost."],dependencyTreeRoots:t.dependencyTreeRoots,enableTopLevelFallback:t.enableTopLevelFallback||!1,ignorePatternData:t.ignorePattern||null,fallbackExclusionList:YEt(t),fallbackPool:WEt(t),packageRegistryData:JEt(t)}}var Jwe=Te(Wwe());function zwe(t,e){return[t?`${t}
2022-08-27 06:35:11 +00:00
`:"",`/* eslint-disable */
2022-09-06 17:07:18 +00:00
`,`"use strict";
2022-08-27 06:35:11 +00:00
`,`
`,e,`
2022-09-06 17:07:18 +00:00
`,(0,Jwe.default)()].join("")}function zEt(t){return JSON.stringify(t,null,2)}function VEt(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,`\\
`)}'`}function XEt(t){return[`const RAW_RUNTIME_STATE =
`,`${VEt(jwe(t))};
2022-08-27 06:35:11 +00:00
`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
`,` return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname});
`,`}
2022-09-06 17:07:18 +00:00
`].join("")}function ZEt(){return[`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
`,` return hydrateRuntimeState(require(${JSON.stringify(`./${Zr.pnpData}`)}), {basePath: basePath || __dirname});
2022-08-27 06:35:11 +00:00
`,`}
2022-09-06 17:07:18 +00:00
`].join("")}function Vwe(t){let e=q2(t),r=XEt(e);return zwe(t.shebang,r)}function Xwe(t){let e=q2(t),r=ZEt(),o=zwe(t.shebang,r);return{dataFile:zEt(e),loaderFile:o}}Nt();function g6(t,{basePath:e}){let r=de.toPortablePath(e),o=ee.resolve(r),a=t.ignorePatternData!==null?new RegExp(t.ignorePatternData):null,n=new Map,c=new Map(t.packageRegistryData.map(([B,Q])=>[B,new Map(Q.map(([x,y])=>{if(B===null!=(x===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let T=y.discardFromLookup??!1,U={name:B,reference:x},q=n.get(y.packageLocation);q?(q.discardFromLookup=q.discardFromLookup&&T,T||(q.locator=U)):n.set(y.packageLocation,{locator:U,discardFromLookup:T});let X=null;return[x,{packageDependencies:new Map(y.packageDependencies),packagePeers:new Set(y.packagePeers),linkType:y.linkType,discardFromLookup:T,get packageLocation(){return X||(X=ee.join(o,y.packageLocation))}}]}))])),f=new Map(t.fallbackExclusionList.map(([B,Q])=>[B,new Set(Q)])),g=new Map(t.fallbackPool),p=t.dependencyTreeRoots,I=t.enableTopLevelFallback;return{basePath:r,dependencyTreeRoots:p,enableTopLevelFallback:I,fallbackExclusionList:f,fallbackPool:g,ignorePattern:a,packageLocatorsByLocations:n,packageRegistry:c}}Nt();Nt();var G2=Be("module");function XI(t,e){if(typeof t=="string")return t;if(t){let r,o;if(Array.isArray(t)){for(r=0;r<t.length;r++)if(o=XI(t[r],e))return o}else for(r in t)if(e.has(r))return XI(t[r],e)}}function Bm(t,e,r){throw new Error(r?`No known conditions for "${e}" entry in "${t}" package`:`Missing "${e}" export in "${t}" package`)}function $Et(t,e){return e===t?".":e[0]==="."?e:e.replace(new RegExp("^"+t+"/"),"./")}function Zwe(t,e=".",r={}){let{name:o,exports:a}=t;if(a){let{browser:n,require:c,unsafe:f,conditions:g=[]}=r,p=$Et(o,e);if(p[0]!=="."&&(p="./"+p),typeof a=="string")return p==="."?a:Bm(o,p);let I=new Set(["default",...g]);f||I.add(c?"require":"import"),f||I.add(n?"browser":"node");let B,Q,x=!1;for(B in a){x=B[0]!==".";break}if(x)return p==="."?XI(a,I)||Bm(o,p,1):Bm(o,p);if(Q=a[p])return XI(Q,I)||Bm(o,p,1);for(B in a){if(Q=B[B.length-1],Q==="/"&&p.startsWith(B))return(Q=XI(a[B],I))?Q+p.substring(B.length):Bm(o,p,1);if(Q==="*"&&p.startsWith(B.slice(0,-1))&&p.substring(B.length-1).length>0)return(Q=XI(a[B],I))?Q.replace("*",p.substring(B.length-1)):Bm(o,p,1)}return Bm(o,p)}}var p6=Be("util");Nt();var ewt=new Set(["BUILTIN_NODE_RESOLUTION_FAILED","MISSING_DEPENDENCY","MISSING_PEER_DEPENDENCY","QUALIFIED_PATH_RESOLUTION_FAILED","UNDECLARED_DEPENDENCY"]);function Is(t,e,r={},o){o??(o=ewt.has(t)?"MODULE_NOT_FOUND":t);let a={configurable:!0,writable:!0,enumerable:!1};return Object.defineProperties(new Error(e),{code:{...a,value:o},pnpCode:{...a,value:t},data:{...a,value:r}})}function Tc(t){return de.normalize(de.fromPortablePath(t))}var $we=Be("module");var twt=new Set($we.Module.builtinModules||Object.keys(process.binding("natives"))),Db=t=>t.startsWith("node:")||twt.has(t);function h6(t,e){let r=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,o=Number(process.env.PNP_DEBUG_LEVEL),a=/^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/,n=/^(\/|\.{1,2}(\/|$))/,c=/\/$/,f=/^\.{0,2}\//,g={name:null,reference:null},p=[],I=new Set;if(t.enableTopLevelFallback===!0&&p.push(g),e.compatibilityMode!==!1)for(let H of["react-scripts","gatsby"]){let _e=t.packageRegistry.get(H);if(_e)for(let tt of _e.keys()){if(tt===null)throw new Error("Assertion failed: This reference shouldn't be null");p.push({name:H,reference:tt})}}let{ignorePattern:B,packageRegistry:Q,packageLocatorsByLocations:x}=t;function y(H,_e){return{fn:H,args:_e,error:null,result:null}}function T(H){var Ct,We,at,ze;let _e=((We=(Ct=process.stderr)==null?void 0:Ct.hasColors)==null?void 0:We.call(Ct))??process.stdout.isTTY,tt=(k,E)=>`\x1B[${k}m${E}\x1B[0m`,Ze=H.error;console.error(Ze?tt("31;1",`\u2716 ${(at=H.error)==null?void 0:at.message.replace(/\n.*/s,"")}`):tt("33;1","\u203C Resolution")),H.args.length>0&&console.error();for(let k of H.args)console.error(` ${tt("37;1","In \u2190")} ${(0,p6.inspect)(k,{colors
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Require request: "${Ze}"
Required by: ${xe}
`,{request:Ze,issuer:xe});return de.toPortablePath(at)}let Ct,We=H.match(a);if(We){if(!_e)throw Is("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:Ze,issuer:xe});let[,at,ze]=We,k=Ce(_e);if(!k){let Ae=be(H,_e);if(Ae===!1)throw Is("BUILTIN_NODE_RESOLUTION_FAILED",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree).
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Require path: "${Ze}"
Required by: ${xe}
`,{request:Ze,issuer:xe});return de.toPortablePath(Ae)}let S=q(k).packageDependencies.get(at),C=null;if(S==null&&k.name!==null){let Ae=t.fallbackExclusionList.get(k.name);if(!Ae||!Ae.has(k.reference)){for(let Ue=0,gt=p.length;Ue<gt;++Ue){let Ht=q(p[Ue]).packageDependencies.get(at);if(Ht!=null){r?C=Ht:S=Ht;break}}if(t.enableTopLevelFallback&&S==null&&C===null){let Ue=t.fallbackPool.get(at);Ue!=null&&(C=Ue)}}}let R=null;if(S===null)if(X(k))R=Is("MISSING_PEER_DEPENDENCY",`Your application tried to access ${at} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Required package: ${at}${at!==Ze?` (via "${Ze}")`:""}
Required by: ${xe}
`,{request:Ze,issuer:xe,dependencyName:at});else{let Ae=Ie(at,k);Ae.every(Fe=>X(Fe))?R=Is("MISSING_PEER_DEPENDENCY",`${k.name} tried to access ${at} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Required package: ${at}${at!==Ze?` (via "${Ze}")`:""}
Required by: ${k.name}@${k.reference} (via ${xe})
2022-08-27 06:35:11 +00:00
${Ae.map(Fe=>`Ancestor breaking the chain: ${Fe.name}@${Fe.reference}
`).join("")}
2022-09-06 17:07:18 +00:00
`,{request:Ze,issuer:xe,issuerLocator:Object.assign({},k),dependencyName:at,brokenAncestors:Ae}):R=Is("MISSING_PEER_DEPENDENCY",`${k.name} tried to access ${at} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Required package: ${at}${at!==Ze?` (via "${Ze}")`:""}
Required by: ${k.name}@${k.reference} (via ${xe})
2022-08-27 06:35:11 +00:00
${Ae.map(Fe=>`Ancestor breaking the chain: ${Fe.name}@${Fe.reference}
`).join("")}
2022-09-06 17:07:18 +00:00
`,{request:Ze,issuer:xe,issuerLocator:Object.assign({},k),dependencyName:at,brokenAncestors:Ae})}else S===void 0&&(!tt&&Db(H)?X(k)?R=Is("UNDECLARED_DEPENDENCY",`Your application tried to access ${at}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${at} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Required package: ${at}${at!==Ze?` (via "${Ze}")`:""}
Required by: ${xe}
`,{request:Ze,issuer:xe,dependencyName:at}):R=Is("UNDECLARED_DEPENDENCY",`${k.name} tried to access ${at}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${at} isn't otherwise declared in ${k.name}'s dependencies, this makes the require call ambiguous and unsound.
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Required package: ${at}${at!==Ze?` (via "${Ze}")`:""}
Required by: ${xe}
`,{request:Ze,issuer:xe,issuerLocator:Object.assign({},k),dependencyName:at}):X(k)?R=Is("UNDECLARED_DEPENDENCY",`Your application tried to access ${at}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Required package: ${at}${at!==Ze?` (via "${Ze}")`:""}
Required by: ${xe}
`,{request:Ze,issuer:xe,dependencyName:at}):R=Is("UNDECLARED_DEPENDENCY",`${k.name} tried to access ${at}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Required package: ${at}${at!==Ze?` (via "${Ze}")`:""}
Required by: ${k.name}@${k.reference} (via ${xe})
`,{request:Ze,issuer:xe,issuerLocator:Object.assign({},k),dependencyName:at}));if(S==null){if(C===null||R===null)throw R||new Error("Assertion failed: Expected an error to have been set");S=C;let Ae=R.message.replace(/\n.*/g,"");R.message=Ae,!I.has(Ae)&&o!==0&&(I.add(Ae),process.emitWarning(R))}let Z=Array.isArray(S)?{name:S[0],reference:S[1]}:{name:at,reference:S},te=q(Z);if(!te.packageLocation)throw Is("MISSING_DEPENDENCY",`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod.
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Required package: ${Z.name}@${Z.reference}${Z.name!==Ze?` (via "${Ze}")`:""}
Required by: ${k.name}@${k.reference} (via ${xe})
`,{request:Ze,issuer:xe,dependencyLocator:Object.assign({},Z)});let ne=te.packageLocation;ze?Ct=ee.join(ne,ze):Ct=ne}else if(ee.isAbsolute(H))Ct=ee.normalize(H);else{if(!_e)throw Is("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:Ze,issuer:xe});let at=ee.resolve(_e);_e.match(c)?Ct=ee.normalize(ee.join(at,H)):Ct=ee.normalize(ee.join(ee.dirname(at),H))}return ee.normalize(Ct)}function re(H,_e,tt=se){if(n.test(H))return _e;let Ze=fe(_e,tt);return Ze?ee.normalize(Ze):_e}function Se(H,{extensions:_e=Object.keys(G2.Module._extensions)}={}){let tt=[],Ze=me(H,tt,{extensions:_e});if(Ze)return ee.normalize(Ze);{let xe=Tc(H),Ct=Ce(H);if(Ct){let{packageLocation:We}=q(Ct),at=!0;try{e.fakeFs.accessSync(We)}catch(ze){if((ze==null?void 0:ze.code)==="ENOENT")at=!1;else{let k=((ze==null?void 0:ze.message)??ze??"empty exception thrown").replace(/^[A-Z]/,E=>E.toLowerCase());throw Is("QUALIFIED_PATH_RESOLUTION_FAILED",`Required package exists but could not be accessed (${k}).
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Missing package: ${Ct.name}@${Ct.reference}
Expected package location: ${Tc(We)}
`,{unqualifiedPath:xe,extensions:_e})}}if(!at){let ze=We.includes("/unplugged/")?"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).":"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.";throw Is("QUALIFIED_PATH_RESOLUTION_FAILED",`${ze}
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Missing package: ${Ct.name}@${Ct.reference}
Expected package location: ${Tc(We)}
`,{unqualifiedPath:xe,extensions:_e})}}throw Is("QUALIFIED_PATH_RESOLUTION_FAILED",`Qualified path resolution failed: we looked for the following paths, but none could be accessed.
2022-08-27 06:35:11 +00:00
2022-09-06 17:07:18 +00:00
Source path: ${xe}
${tt.map(We=>`Not found: ${Tc(We)}
`).join("")}`,{unqualifiedPath:xe,extensions:_e})}}function Le(H,_e,{considerBuiltins:tt,extensions:Ze,conditions:xe}={}){try{let Ct=ue(H,_e,{considerBuiltins:tt});if(H==="pnpapi")return Ct;if(Ct===null)return null;let We=()=>_e!==null?Ee(_e):!1,at=(!tt||!Db(H))&&!We()?re(H,Ct,xe):Ct;return Se(at,{extensions:Ze})}catch(Ct){throw Object.prototype.hasOwnProperty.call(Ct,"pnpCode")&&Object.assign(Ct.data,{request:Tc(H),issuer:_e&&Tc(_e)}),Ct}}function dt(H){let _e=ee.normalize(H),tt=Gi.resolveVirtual(_e);return tt!==_e?tt:null}return{VERSIONS:ye,topLevel:De,getLocator:(H,_e)=>Array.isArray(_e)?{name:_e[0],reference:_e[1]}:{name:H,reference:_e},getDependencyTreeRoots:()=>[...t.dependencyTreeRoots],getAllLocators(){let H=[];for(let[_e,tt]of Q)for(let Ze of tt.keys())_e!==null&&Ze!==null&&H.push({name:_e,reference:Ze});return H},getPackageInformation:H=>{let _e=h(H);if(_e===null)return null;let tt=de.fromPortablePath(_e.packageLocation);return{..._e,packageLocation:tt}},findPackageLocator:H=>Ce(de.toPortablePath(H)),resolveToUnqualified:U("resolveToUnqualified",(H,_e,tt)=>{let Ze=_e!==null?de.toPortablePath(_e):null,xe=ue(de.toPortablePath(H),Ze,tt);return xe===null?null:de.fromPortablePath(xe)}),resolveUnqualified:U("resolveUnqualified",(H,_e)=>de.fromPortablePath(Se(de.toPortablePath(H),_e))),resolveRequest:U("resolveRequest",(H,_e,tt)=>{let Ze=_e!==null?de.toPortablePath(_e):null,xe=Le(de.toPortablePath(H),Ze,tt);return xe===null?null:de.fromPortablePath(xe)}),resolveVirtual:U("resolveVirtual",H=>{let _e=dt(de.toPortablePath(H));return _e!==null?de.fromPortablePath(_e):null})}}Nt();var eBe=(t,e,r)=>{let o=q2(t),a=g6(o,{basePath:e}),n=de.join(e,Zr.pnpCjs);return h6(a,{fakeFs:r,pnpapiResolution:n})};var m6=Te(rBe());var E6=Te(Vt());var _u={};sr(_u,{checkAndReportManifestCompatibility:()=>iBe,checkManifestCompatibility:()=>nBe,extractBuildScripts:()=>Sb,getExtractHint:()=>C6,hasBindingGyp:()=>y6});Xe();Nt();function nBe(t){return Y.isPackageCompatible(t,Pp.getArchitectureSet())}function iBe(t,e,{configuration:r,report:o}){return nBe(t)?!0:(o==null||o.reportWarningOnce(76,`${Y.prettyLocator(r,t)} The ${Pp.getArchitectureName()} architecture is incompatible with this package, ${e} skipped.`),!1)}function Sb(t,e,r,{configuration:o,report:a}){let n=[];for(let f of["preinstall","install","postinstall"])e.manifest.scripts.has(f)&&n.push([0,f]);return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&n.push([1,"node-gyp rebuild"]),n.length===0?[]:t.linkType!=="HARD"?(a==null||a.reportWarningOnce(6,`${Y.prettyLocator(o,t)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`),[]):r&&r.built===!1?(a==null||a.reportInfoOnce(5,`${Y.prettyLocator(o,t)} lists build scripts, but its build has been explicitly disabled through configuration.`),[]):!o.get("enableScripts")&&!r.built?(a==null||a.reportWarningOnce(4,`${Y.prettyLocator(o,t)} lists build scripts, but all build scripts have been disabled.`),[]):iBe(t,"build",{configuration:o,report:a})?n:[]}var nwt=new Set([".exe",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function C6(t){return t.packageFs.getExtractHint({relevantExtensions:nwt})}function y6(t){let e=ee.join(t.prefixPath,"binding.gyp");return t.packageFs.existsSync(e)}var Y2={};sr(Y2,{getUnpluggedPath:()=>j2});Xe();Nt();function j2(t,{configuration:e}){return ee.resolve(e.get("pnpUnpluggedFolder"),Y.slugifyLocator(t))}var iwt=new Set([Y.makeIdent(null,"nan").identHash,Y.makeIdent(null,"node-gyp").identHash,Y.makeIdent(null,"node-pre-gyp").identHash,Y.makeIdent(null,"node-addon-api").identHash,Y.makeIdent(null,"fsevents").identHash,Y.makeIdent(null,"open").identHash,Y.makeIdent(null,"opn").identHash]),Ch=class{constructor(){this.mode="strict";this.pnpCache=new Map}getCustomDataKey(){return JSON.stringify({name:"PnpLinker",version:2})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the PnP linker to be enabled");let o=yh(r.project).cjs;if(!ge.exi
2022-08-27 06:35:11 +00:00
`,n+=`# cause your node_modules installation to become invalidated.
`,n+=`
`,n+=`__metadata:
2022-09-06 17:07:18 +00:00
`,n+=` version: ${CBe}
`,n+=` nmMode: ${o.value}
`;let c=Array.from(e.keys()).sort(),f=Y.stringifyLocator(t.topLevelWorkspace.anchoredLocator);for(let I of c){let B=e.get(I);n+=`
`,n+=`${JSON.stringify(I)}:
2022-08-27 06:35:11 +00:00
`,n+=` locations:
2022-09-06 17:07:18 +00:00
`;for(let Q of B.locations){let x=ee.contains(t.cwd,Q);if(x===null)throw new Error(`Assertion failed: Expected the path to be within the project (${Q})`);n+=` - ${JSON.stringify(x)}
`}if(B.aliases.length>0){n+=` aliases:
`;for(let Q of B.aliases)n+=` - ${JSON.stringify(Q)}
`}if(I===f&&r.size>0){n+=` bin:
`;for(let[Q,x]of r){let y=ee.contains(t.cwd,Q);if(y===null)throw new Error(`Assertion failed: Expected the path to be within the project (${Q})`);n+=` ${JSON.stringify(y)}:
`;for(let[T,U]of x){let q=ee.relative(ee.join(Q,Ji),U);n+=` ${JSON.stringify(T)}: ${JSON.stringify(q)}
`}}}}let g=t.cwd,p=ee.join(g,Ji,yBe);a&&await ge.removePromise(p),await ge.changeFilePromise(p,n,{automaticNewlines:!0})}async function x6(t,{unrollAliases:e=!1}={}){let r=t.cwd,o=ee.join(r,Ji,yBe),a;try{a=await ge.statPromise(o)}catch{}if(!a)return null;let n=os(await ge.readFilePromise(o,"utf8"));if(n.__metadata.version>CBe)return null;let c=n.__metadata.nmMode||"hardlinks-local",f=new Map,g=new Map;delete n.__metadata;for(let[p,I]of Object.entries(n)){let B=I.locations.map(x=>ee.join(r,x)),Q=I.bin;if(Q)for(let[x,y]of Object.entries(Q)){let T=ee.join(r,de.toPortablePath(x)),U=Ve.getMapWithDefault(g,T);for(let[q,X]of Object.entries(y))U.set(is(q),de.toPortablePath([T,Ji,X].join(ee.sep)))}if(f.set(p,{target:Qt.dot,linkType:"HARD",locations:B,aliases:I.aliases||[]}),e&&I.aliases)for(let x of I.aliases){let{scope:y,name:T}=Y.parseLocator(p),U=Y.makeLocator(Y.makeIdent(y,T),x),q=Y.stringifyLocator(U);f.set(q,{target:Qt.dot,linkType:"HARD",locations:B,aliases:[]})}}return{locatorMap:f,binSymlinks:g,locationTree:IBe(f,{skipPrefix:t.cwd}),nmMode:c,mtimeMs:a.mtimeMs}}var $I=async(t,e)=>{if(t.split(ee.sep).indexOf(Ji)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${t}`);try{if(!e.innerLoop){let o=e.allowSymlink?await ge.statPromise(t):await ge.lstatPromise(t);if(e.allowSymlink&&!o.isDirectory()||!e.allowSymlink&&o.isSymbolicLink()){await ge.unlinkPromise(t);return}}let r=await ge.readdirPromise(t,{withFileTypes:!0});for(let o of r){let a=ee.join(t,is(o.name));o.isDirectory()?(o.name!==Ji||e&&e.innerLoop)&&await $I(a,{innerLoop:!0,contentsOnly:!1}):await ge.unlinkPromise(a)}e.contentsOnly||await ge.rmdirPromise(t)}catch(r){if(r.code!=="ENOENT"&&r.code!=="ENOTEMPTY")throw r}},pBe=4,Pb=(t,{skipPrefix:e})=>{let r=ee.contains(e,t);if(r===null)throw new Error(`Assertion failed: Writing attempt prevented to ${t} which is outside project root: ${e}`);let o=r.split(ee.sep).filter(g=>g!==""),a=o.indexOf(Ji),n=o.slice(0,a).join(ee.sep),c=ee.join(e,n),f=o.slice(a);return{locationRoot:c,segments:f}},IBe=(t,{skipPrefix:e})=>{let r=new Map;if(t===null)return r;let o=()=>({children:new Map,linkType:"HARD"});for(let[a,n]of t.entries()){if(n.linkType==="SOFT"&&ee.contains(e,n.target)!==null){let f=Ve.getFactoryWithDefault(r,n.target,o);f.locator=a,f.linkType=n.linkType}for(let c of n.locations){let{locationRoot:f,segments:g}=Pb(c,{skipPrefix:e}),p=Ve.getFactoryWithDefault(r,f,o);for(let I=0;I<g.length;++I){let B=g[I];if(B!=="."){let Q=Ve.getFactoryWithDefault(p.children,B,o);p.children.set(B,Q),p=Q}I===g.length-1&&(p.locator=a,p.linkType=n.linkType)}}}return r},b6=async(t,e)=>{let r;try{process.platform==="win32"&&(r=await ge.lstatPromise(t))}catch{}process.platform=="win32"&&(!r||r.isDirectory())?await ge.symlinkPromise(t,e,"junction"):await ge.symlinkPromise(ee.relative(ee.dirname(e),t),e)};async function EBe(t,e,r){let o=ee.join(t,is(`${P6.default.randomBytes(16).toString("hex")}.tmp`));try{await ge.writeFilePromise(o,r);try{await ge.linkPromise(o,e)}catch{}}finally{await ge.unlinkPromise(o)}}async function kwt({srcPath:t,dstPath:e,srcMode:r,globalHardlinksStore:o,baseFs:a,nmMode:n,digest:c}){if(n.value==="hardlinks-global"&&o&&c){let g=ee.join(o,c.substring(0,2),`${c.substring(2)}.dat`),p;try{if(await Li.checksumFile(g,{baseFs:ge,algorithm:"sha1"})!==c){let B=ee.join(o,is(`${P6.default.randomBytes(16).toString("hex")}.tmp`));await ge.renamePromise(g,B);let Q=await a.readFilePromise(t);await ge.writeFilePromise(B,Q);try{await ge.linkPromise(B,g),await ge.unlinkPromise(B)}catch{}}await ge.linkPromise(g,e),p=!0}catch{p=!1}if(!p){let I=await a.readFilePromise(t);await EBe(o,g,I);try{await ge.linkPromise(g,e)}catch(B){B&&B.code&&B.code=="EXDEV"&&(n.value="hardlinks-local",await a.copyFilePromise(t,e))}}}else await a.copyFilePromise(t,e);let f=r&511;f!==420&&await ge.chmodPromise(e,f)}var xwt=async(t,e,{baseFs:r,globalHardlinksStore:o,nmMode:a,packageChecksum:n})=>{await ge.mkdirPromise(t,{recursive:!0});let c=async(g=Qt.dot)=>{let p=ee.join(e,g),I=await r.readdirPromise(p,{withFileTypes:!0}),B=new Ma
2022-08-27 06:35:11 +00:00
This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths).
For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`.
2022-09-06 17:07:18 +00:00
Applying the \`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${lQ.map(r=>`\`${r}\``).join(", ")}.
2022-08-27 06:35:11 +00:00
If the \`--json\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages.
If certain packages produce false positives for a particular environment, the \`--exclude\` flag can be used to exclude any number of packages from the audit. This can also be set in the configuration file with the \`npmAuditExcludePackages\` option.
If particular advisories are needed to be ignored, the \`--ignore\` flag can be used with Advisory ID's to ignore any number of advisories in the audit report. This can also be set in the configuration file with the \`npmAuditIgnoreAdvisories\` option.
To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--json\` flag or use \`yarn why <package>\` to get more information as to who depends on them.
2022-09-06 17:07:18 +00:00
`,examples:[["Checks for known security issues with the installed packages. The output is a list of known issues.","yarn npm audit"],["Audit dependencies in all workspaces","yarn npm audit --all"],["Limit auditing to `dependencies` (excludes `devDependencies`)","yarn npm audit --environment production"],["Show audit report as valid JSON","yarn npm audit --json"],["Audit all direct and transitive dependencies","yarn npm audit --recursive"],["Output moderate (or more severe) vulnerabilities","yarn npm audit --severity moderate"],["Exclude certain packages","yarn npm audit --exclude package1 --exclude package2"],["Ignore specific advisories","yarn npm audit --ignore 1234567 --ignore 7654321"]]});Xe();Xe();Nt();var Fh=Te(Vt()),FG=Te(Ei()),RG=Be("util"),Tm=class extends pt{constructor(){super(...arguments);this.fields=Fh.Option.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=Fh.Option.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=Fh.Option.Rest()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o}=await xt.find(r,this.context.cwd),a=typeof this.fields<"u"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,n=[],c=!1,f=await St.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async g=>{for(let p of this.packages){let I;if(p==="."){let fe=o.topLevelWorkspace;if(!fe.manifest.name)throw new Fh.UsageError(`Missing ${Me.pretty(r,"name",Me.Type.CODE)} field in ${de.fromPortablePath(ee.join(fe.cwd,Zr.manifest))}`);I=Y.makeDescriptor(fe.manifest.name,"unknown")}else I=Y.parseDescriptor(p);let B=En.getIdentUrl(I),Q=TG(await En.get(B,{configuration:r,ident:I,jsonResponse:!0,customErrorMessage:En.customPackageError})),x=Object.keys(Q.versions).sort(FG.default.compareLoose),T=Q["dist-tags"].latest||x[x.length-1],U=Vr.validRange(I.range);if(U){let fe=FG.default.maxSatisfying(x,U);fe!==null?T=fe:(g.reportWarning(0,`Unmet range ${Y.prettyRange(r,I.range)}; falling back to the latest version`),c=!0)}else Object.prototype.hasOwnProperty.call(Q["dist-tags"],I.range)?T=Q["dist-tags"][I.range]:I.range!=="unknown"&&(g.reportWarning(0,`Unknown tag ${Y.prettyRange(r,I.range)}; falling back to the latest version`),c=!0);let q=Q.versions[T],X={...Q,...q,version:T,versions:x},se;if(a!==null){se={};for(let fe of a){let me=X[fe];if(typeof me<"u")se[fe]=me;else{g.reportWarning(1,`The ${Me.pretty(r,fe,Me.Type.CODE)} field doesn't exist inside ${Y.prettyIdent(r,I)}'s information`),c=!0;continue}}}else this.json||(delete X.dist,delete X.readme,delete X.users),se=X;g.reportJson(se),this.json||n.push(se)}});RG.inspect.styles.name="cyan";for(let g of n)(g!==n[0]||c)&&this.context.stdout.write(`
`),this.context.stdout.write(`${(0,RG.inspect)(g,{depth:1/0,colors:!0,compact:!1})}
`);return f.exitCode()}};Tm.paths=[["npm","info"]],Tm.usage=Fh.Command.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command fetches information about a package from the npm registry and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@<range>` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about react@16.12.0","yarn npm info react@16.12.0"],["Show all available information about react@next","yarn npm info react@next"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versions"],["Show the readme of react","yarn npm info react --fields readme"],["Show a few fields of react","yarn npm info react --fields homepage,repository"]]});function TG(t){if(Array.isArray(t)){let e=[];for(let r of t)r=TG(r),r&&e.push(r);return e}else if(typeof t=="object"&&t!==null){let e={};for(let r of Object.keys(t)){if(r.startsWith("_"))continue;let o=TG(t[r]);o&&(e[r]=o)}return e}else return t||null}Xe();Xe();var uQ=Te(Vt()),b2e=Te(d1()),Mm=class extends pt{constructor(){super(...arguments);this.scope=uQ.Option.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=uQ.Option.Boolean("--publish",!1,{description:"Login to the publish registry"})}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),o=await cF({configuration:r,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await St.start({configuration:r,stdout:this.context.stdout},async n=>{let c=await z2t({registry:o,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),f=`/-/user/org.couchdb.user:${encodeURIComponent(c.name)}`,g=await En.put(f,c,{attemptedAs:c.name,configuration:r,registry:o,jsonResponse:!0,authType:En.AuthType.NO_AUTH});return await J2t(o,g.token,{configuration:r,scope:this.scope}),n.reportInfo(0,"Successfully logged in")})).exitCode()}};Mm.paths=[["npm","login"]],Mm.usage=uQ.Command.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]});async function
2022-08-27 06:35:11 +00:00
This command will list all tags of a package from the npm registry.
If the package is not specified, Yarn will default to the current workspace.
2022-09-06 17:07:18 +00:00
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]});async function fQ(t,e){let r=`/-/package${En.getIdentUrl(t)}/dist-tags`;return En.get(r,{configuration:e,ident:t,jsonResponse:!0,customErrorMessage:En.customPackageError})}var _m=class extends pt{constructor(){super(...arguments);this.package=Km.Option.String();this.tag=Km.Option.String()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await xt.find(r,this.context.cwd);if(!a)throw new lr(o.cwd,this.context.cwd);let n=Y.parseDescriptor(this.package,!0),c=n.range;if(!R2e.default.valid(c))throw new Km.UsageError(`The range ${Me.pretty(r,n.range,Me.Type.RANGE)} must be a valid semver version`);let f=ai.getPublishRegistry(a.manifest,{configuration:r}),g=Me.pretty(r,n,Me.Type.IDENT),p=Me.pretty(r,c,Me.Type.RANGE),I=Me.pretty(r,this.tag,Me.Type.CODE);return(await St.start({configuration:r,stdout:this.context.stdout},async Q=>{let x=await fQ(n,r);Object.prototype.hasOwnProperty.call(x,this.tag)&&x[this.tag]===c&&Q.reportWarning(0,`Tag ${I} is already set to version ${p}`);let y=`/-/package${En.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await En.put(y,c,{configuration:r,registry:f,ident:n,jsonRequest:!0,jsonResponse:!0}),Q.reportInfo(0,`Tag ${I} added to version ${p} of package ${g}`)})).exitCode()}};_m.paths=[["npm","tag","add"]],_m.usage=Km.Command.Usage({category:"Npm-related commands",description:"add a tag for a specific version of a package",details:`
2022-08-27 06:35:11 +00:00
This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten.
2022-09-06 17:07:18 +00:00
`,examples:[["Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`","yarn npm tag add my-pkg@2.3.4-beta.4 beta"]]});Xe();var Rh=Te(Vt());var Hm=class extends pt{constructor(){super(...arguments);this.package=Rh.Option.String();this.tag=Rh.Option.String()}async execute(){if(this.tag==="latest")throw new Rh.UsageError("The 'latest' tag cannot be removed.");let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await xt.find(r,this.context.cwd);if(!a)throw new lr(o.cwd,this.context.cwd);let n=Y.parseIdent(this.package),c=ai.getPublishRegistry(a.manifest,{configuration:r}),f=Me.pretty(r,this.tag,Me.Type.CODE),g=Me.pretty(r,n,Me.Type.IDENT),p=await fQ(n,r);if(!Object.prototype.hasOwnProperty.call(p,this.tag))throw new Rh.UsageError(`${f} is not a tag of package ${g}`);return(await St.start({configuration:r,stdout:this.context.stdout},async B=>{let Q=`/-/package${En.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await En.del(Q,{configuration:r,registry:c,ident:n,jsonResponse:!0}),B.reportInfo(0,`Tag ${f} removed from package ${g}`)})).exitCode()}};Hm.paths=[["npm","tag","remove"]],Hm.usage=Rh.Command.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:`
2022-08-27 06:35:11 +00:00
This command will remove a tag from a package from the npm registry.
2022-09-06 17:07:18 +00:00
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});Xe();Xe();var gQ=Te(Vt()),qm=class extends pt{constructor(){super(...arguments);this.scope=gQ.Option.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=gQ.Option.Boolean("--publish",!1,{description:"Print username for the publish registry"})}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),o;return this.scope&&this.publish?o=ai.getScopeRegistry(this.scope,{configuration:r,type:ai.RegistryType.PUBLISH_REGISTRY}):this.scope?o=ai.getScopeRegistry(this.scope,{configuration:r}):this.publish?o=ai.getPublishRegistry((await hI(r,this.context.cwd)).manifest,{configuration:r}):o=ai.getDefaultRegistry({configuration:r}),(await St.start({configuration:r,stdout:this.context.stdout},async n=>{var f,g;let c;try{c=await En.get("/-/whoami",{configuration:r,registry:o,authType:En.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?Y.makeIdent(this.scope,""):void 0})}catch(p){if(((f=p.response)==null?void 0:f.statusCode)===401||((g=p.response)==null?void 0:g.statusCode)===403){n.reportError(41,"Authentication failed - your credentials may have expired");return}else throw p}n.reportInfo(0,c.username)})).exitCode()}};qm.paths=[["npm","whoami"]],qm.usage=gQ.Command.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]});var Z2t={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:"STRING",default:null},npmAuditExcludePackages:{description:"Array of glob patterns of packages to exclude from npm audit",type:"STRING",default:[],isArray:!0},npmAuditIgnoreAdvisories:{description:"Array of glob patterns of advisory IDs to exclude from npm audit",type:"STRING",default:[],isArray:!0}},commands:[Rm,Tm,Mm,Nm,Lm,_m,Om,Hm,qm]},$2t=Z2t;var KG={};sr(KG,{default:()=>mQt,patchUtils:()=>Gm});Xe();Xe();Nt();ng();var Gm={};sr(Gm,{applyPatchFile:()=>gF,diffFolders:()=>_G,ensureUnpatchedDescriptor:()=>NG,ensureUnpatchedLocator:()=>hF,extractPackageToDisk:()=>UG,extractPatchFlags:()=>_2e,isParentRequired:()=>OG,isPatchDescriptor:()=>pF,isPatchLocator:()=>Th,loadPatchFiles:()=>dQ,makeDescriptor:()=>dF,makeLocator:()=>LG,parseDescriptor:()=>pQ,parseLocator:()=>hQ,parsePatchFile:()=>fF,unpatchDescriptor:()=>gQt,unpatchLocator:()=>pQt});Xe();Nt();Xe();Nt();var pE=class extends Error{constructor(r,o){super(`Cannot apply hunk #${r+1}`);this.hunk=o}};Xe();Nt();var eQt=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function hE(t){return ee.relative(Qt.root,ee.resolve(Qt.root,de.toPortablePath(t)))}function tQt(t){let e=t.trim().match(eQt);if(!e)throw new Error(`Bad header line: '${t}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var rQt=420,nQt=493;var T2e=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),iQt=t=>({header:tQt(t),parts:[]}),sQt={["@"]:"header",["-"]:"deletion",["+"]:"insertion",[" "]:"context",["\\"]:"pragm
`)+(a.hunk.parts[0].noNewlineAtEndOfFile?"":`
`):"";await e.mkdirpPromise(ee.dirname(a.path),{chmod:493,utimes:[Ni.SAFE_TIME,Ni.SAFE_TIME]}),await e.writeFilePromise(a.path,n,{mode:a.mode}),await e.utimesPromise(a.path,Ni.SAFE_TIME,Ni.SAFE_TIME)}break;case"patch":await dE(e,a.path,async()=>{await uQt(a,{baseFs:e,dryRun:r})});break;case"mode change":{let c=(await e.statPromise(a.path)).mode;if(M2e(a.newMode)!==M2e(c))continue;await dE(e,a.path,async()=>{await e.chmodPromise(a.path,a.newMode)})}break;default:Ve.assertNever(a);break}}function M2e(t){return(t&64)>0}function N2e(t){return t.replace(/\s+$/,"")}function cQt(t,e){return N2e(t)===N2e(e)}async function uQt({hunks:t,path:e},{baseFs:r,dryRun:o=!1}){let a=await r.statSync(e).mode,c=(await r.readFileSync(e,"utf8")).split(/\n/),f=[],g=0,p=0;for(let B of t){let Q=Math.max(p,B.header.patched.start+g),x=Math.max(0,Q-p),y=Math.max(0,c.length-Q-B.header.original.length),T=Math.max(x,y),U=0,q=0,X=null;for(;U<=T;){if(U<=x&&(q=Q-U,X=L2e(B,c,q),X!==null)){U=-U;break}if(U<=y&&(q=Q+U,X=L2e(B,c,q),X!==null))break;U+=1}if(X===null)throw new pE(t.indexOf(B),B);f.push(X),g+=U,p=q+B.header.original.length}if(o)return;let I=0;for(let B of f)for(let Q of B)switch(Q.type){case"splice":{let x=Q.index+I;c.splice(x,Q.numToDelete,...Q.linesToInsert),I+=Q.linesToInsert.length-Q.numToDelete}break;case"pop":c.pop();break;case"push":c.push(Q.line);break;default:Ve.assertNever(Q);break}await r.writeFilePromise(e,c.join(`
`),{mode:a})}function L2e(t,e,r){let o=[];for(let a of t.parts)switch(a.type){case"context":case"deletion":{for(let n of a.lines){let c=e[r];if(c==null||!cQt(c,n))return null;r+=1}a.type==="deletion"&&(o.push({type:"splice",index:r-a.lines.length,numToDelete:a.lines.length,linesToInsert:[]}),a.noNewlineAtEndOfFile&&o.push({type:"push",line:""}))}break;case"insertion":o.push({type:"splice",index:r,numToDelete:0,linesToInsert:a.lines}),a.noNewlineAtEndOfFile&&o.push({type:"pop"});break;default:Ve.assertNever(a.type);break}return o}var fQt=/^builtin<([^>]+)>$/;function mE(t,e){let{protocol:r,source:o,selector:a,params:n}=Y.parseRange(t);if(r!=="patch:")throw new Error("Invalid patch range");if(o===null)throw new Error("Patch locators must explicitly define their source");let c=a?a.split(/&/).map(I=>de.toPortablePath(I)):[],f=n&&typeof n.locator=="string"?Y.parseLocator(n.locator):null,g=n&&typeof n.version=="string"?n.version:null,p=e(o);return{parentLocator:f,sourceItem:p,patchPaths:c,sourceVersion:g}}function pF(t){return t.range.startsWith("patch:")}function Th(t){return t.reference.startsWith("patch:")}function pQ(t){let{sourceItem:e,...r}=mE(t.range,Y.parseDescriptor);return{...r,sourceDescriptor:e}}function hQ(t){let{sourceItem:e,...r}=mE(t.reference,Y.parseLocator);return{...r,sourceLocator:e}}function gQt(t){let{sourceItem:e}=mE(t.range,Y.parseDescriptor);return e}function pQt(t){let{sourceItem:e}=mE(t.reference,Y.parseLocator);return e}function NG(t){if(!pF(t))return t;let{sourceItem:e}=mE(t.range,Y.parseDescriptor);return e}function hF(t){if(!Th(t))return t;let{sourceItem:e}=mE(t.reference,Y.parseLocator);return e}function O2e({parentLocator:t,sourceItem:e,patchPaths:r,sourceVersion:o,patchHash:a},n){let c=t!==null?{locator:Y.stringifyLocator(t)}:{},f=typeof o<"u"?{version:o}:{},g=typeof a<"u"?{hash:a}:{};return Y.makeRange({protocol:"patch:",source:n(e),selector:r.join("&"),params:{...f,...g,...c}})}function dF(t,{parentLocator:e,sourceDescriptor:r,patchPaths:o}){return Y.makeDescriptor(t,O2e({parentLocator:e,sourceItem:r,patchPaths:o},Y.stringifyDescriptor))}function LG(t,{parentLocator:e,sourcePackage:r,patchPaths:o,patchHash:a}){return Y.makeLocator(t,O2e({parentLocator:e,sourceItem:r,sourceVersion:r.version,patchPaths:o,patchHash:a},Y.stringifyLocator))}function U2e({onAbsolute:t,onRelative:e,onProject:r,onBuiltin:o},a){let n=a.lastIndexOf("!");n!==-1&&(a=a.slice(n+1));let c=a.match(fQt);return c!==null?o(c[1]):a.startsWith("~/")?r(a.slice(2)):ee.isAbsolute(a)?t(a):e(a)}function _2e(t){let e=t.lastIndexOf("!");return{optional:(e!==-1?new Set(t.slice(0,e).split(/!/)):new Set).has("optional")}}function OG(t){return U2e({onAbsolute:()=>!1,onRelative:()=>!0,onProject:()=>!1,onBuiltin:()=>!1},t)}async function dQ(t,e,r){let o=t!==null?await r.fetcher.fetch(t,r):null,a=o&&o.localPath?{packageFs:new Bn(Qt.root),prefixPath:ee.relative(Qt.root,o.localPath)}:o;o&&o!==a&&o.releaseFs&&o.releaseFs();let n=await Ve.releaseAfterUseAsync(async()=>await Promise.all(e.map(async c=>{let f=_2e(c),g=await U2e({onAbsolute:async p=>await ge.readFilePromise(p,"utf8"),onRelative:async p=>{if(a===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await a.packageFs.readFilePromise(ee.join(a.prefixPath,p),"utf8")},onProject:async p=>await ge.readFilePromise(ee.join(r.project.cwd,p),"utf8"),onBuiltin:async p=>await r.project.configuration.firstHook(I=>I.getBuiltinPatch,r.project,p)},c);return{...f,source:g}})));for(let c of n)typeof c.source=="string"&&(c.source=c.source.replace(/\r\n?/g,`
`));return n}async function UG(t,{cache:e,project:r}){let o=r.storedPackages.get(t.locatorHash);if(typeof o>"u")throw new Error("Assertion failed: Expected the package to be registered");let a=hF(t),n=r.storedChecksums,c=new Yi,f=await ge.mktempPromise(),g=ee.join(f,"source"),p=ee.join(f,"user"),I=ee.join(f,".yarn-patch.json"),B=r.configuration.makeFetcher(),Q=[];try{let x,y;if(t.locatorHash===a.locatorHash){let T=await B.fetch(t,{cache:e,project:r,fetcher:B,checksums:n,report:c});Q.push(()=>{var U;return(U=T.releaseFs)==null?void 0:U.call(T)}),x=T,y=T}else x=await B.fetch(t,{cache:e,project:r,fetcher:B,checksums:n,report:c}),Q.push(()=>{var T;return(T=x.releaseFs)==null?void 0:T.call(x)}),y=await B.fetch(t,{cache:e,project:r,fetcher:B,checksums:n,report:c}),Q.push(()=>{var T;return(T=y.releaseFs)==null?void 0:T.call(y)});await Promise.all([ge.copyPromise(g,x.prefixPath,{baseFs:x.packageFs}),ge.copyPromise(p,y.prefixPath,{baseFs:y.packageFs}),ge.writeJsonPromise(I,{locator:Y.stringifyLocator(t),version:o.version})])}finally{for(let x of Q)x()}return ge.detachTemp(f),p}async function _G(t,e){let r=de.fromPortablePath(t).replace(/\\/g,"/"),o=de.fromPortablePath(e).replace(/\\/g,"/"),{stdout:a,stderr:n}=await gn.execvp("git",["-c","core.safecrlf=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--no-renames","--text",r,o],{cwd:de.toPortablePath(process.cwd()),env:{...process.env,GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""}});if(n.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH.
2022-08-27 06:35:11 +00:00
The following error was reported by 'git':
2022-09-06 17:07:18 +00:00
${n}`);let c=r.startsWith("/")?f=>f.slice(1):f=>f;return a.replace(new RegExp(`(a|b)(${Ve.escapeRegExp(`/${c(r)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${Ve.escapeRegExp(`/${c(o)}/`)}`,"g"),"$1/").replace(new RegExp(Ve.escapeRegExp(`${r}/`),"g"),"").replace(new RegExp(Ve.escapeRegExp(`${o}/`),"g"),"")}Xe();function K2e(t,{configuration:e,report:r}){for(let o of t.parts)for(let a of o.lines)switch(o.type){case"context":r.reportInfo(null,` ${Me.pretty(e,a,"grey")}`);break;case"deletion":r.reportError(28,`- ${Me.pretty(e,a,Me.Type.REMOVED)}`);break;case"insertion":r.reportError(28,`+ ${Me.pretty(e,a,Me.Type.ADDED)}`);break;default:Ve.assertNever(o.type)}}var mF=class{supports(e,r){return!!Th(e)}getLocalPath(e,r){return null}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${Y.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:Y.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:c}}async patchPackage(e,r){let{parentLocator:o,sourceLocator:a,sourceVersion:n,patchPaths:c}=hQ(e),f=await dQ(o,c,r),g=await ge.mktempPromise(),p=ee.join(g,"current.zip"),I=await r.fetcher.fetch(a,r),B=Y.getIdentVendorPath(e),Q=await ya(),x=new Ys(p,{libzip:Q,create:!0,level:r.project.configuration.get("compressionLevel")});await Ve.releaseAfterUseAsync(async()=>{await x.copyPromise(B,I.prefixPath,{baseFs:I.packageFs,stableSort:!0})},I.releaseFs),x.saveAndClose();for(let{source:y,optional:T}of f){if(y===null)continue;let U=new Ys(p,{libzip:Q,level:r.project.configuration.get("compressionLevel")}),q=new Bn(ee.resolve(Qt.root,B),{baseFs:U});try{await gF(fF(y),{baseFs:q,version:n})}catch(X){if(!(X instanceof pE))throw X;let se=r.project.configuration.get("enableInlineHunks"),fe=!se&&!T?" (set enableInlineHunks for details)":"",me=`${Y.prettyLocator(r.project.configuration,e)}: ${X.message}${fe}`,Qe=be=>{!se||K2e(X.hunk,{configuration:r.project.configuration,report:be})};if(U.discardAndClose(),T){r.report.reportWarningOnce(66,me,{reportExtra:Qe});continue}else throw new tr(66,me,Qe)}U.saveAndClose()}return new Ys(p,{libzip:Q,level:r.project.configuration.get("compressionLevel")})}};Xe();Xe();var hQt=3,CF=class{supportsDescriptor(e,r){return!!pF(e)}supportsLocator(e,r){return!!Th(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){let{patchPaths:a}=pQ(e);return a.every(n=>!OG(n))?e:Y.bindDescriptor(e,{locator:Y.stringifyLocator(r)})}getResolutionDependencies(e,r){let{sourceDescriptor:o}=pQ(e);return{sourceDescriptor:r.project.configuration.normalizeDependency(o)}}async getCandidates(e,r,o){if(!o.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{parentLocator:a,patchPaths:n}=pQ(e),c=await dQ(a,n,o.fetchOptions),f=r.sourceDescriptor;if(typeof f>"u")throw new Error("Assertion failed: The dependency should have been resolved");let g=Li.makeHash(`${hQt}`,...c.map(p=>JSON.stringify(p))).slice(0,6);return[LG(e,{parentLocator:a,sourcePackage:f,patchPaths:n,patchHash:g})]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let{sourceLocator:o}=hQ(e);return{...await r.resolver.resolve(o,r),...e}}};Xe();Nt();var Mh=Te(Vt());var jm=class extends pt{constructor(){super(...arguments);this.save=Mh.Option.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=Mh.Option.String()}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await xt.find(r,this.context.cwd);if(!a)throw new lr(o.cwd,this.context.cwd);await o.restoreInstallState();let n=ee.resolve(this.context.cwd,de.toPortablePath(this.patchFolder)),c=ee.join(n,"../source"),f=ee.join(n,"../.yarn-patch.json");if(!ge.existsSync(c))throw new Mh.UsageError
${f.map(g=>`
- ${Y.prettyLocator(r,g)}`).join("")}`);c=f[0]}if(!o.storedPackages.has(c.locatorHash))throw new zu.UsageError("No package found in the project for the given locator");await St.start({configuration:r,json:this.json,stdout:this.context.stdout},async f=>{let g=hF(c),p=await UG(c,{cache:n,project:o});f.reportJson({locator:Y.stringifyLocator(g),path:de.fromPortablePath(p)});let I=this.update?" along with its current modifications":"";f.reportInfo(0,`Package ${Y.prettyLocator(r,g)} got extracted with success${I}!`),f.reportInfo(0,`You can now edit the following folder: ${Me.pretty(r,de.fromPortablePath(p),"magenta")}`),f.reportInfo(0,`Once you are done run ${Me.pretty(r,`yarn patch-commit -s ${process.platform==="win32"?'"':""}${de.fromPortablePath(p)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};Ym.paths=[["patch"]],Ym.usage=zu.Command.Usage({description:"prepare a package for patching",details:"\n This command will cause a package to be extracted in a temporary directory intended to be editable at will.\n\n Once you're done with your changes, run `yarn patch-commit -s <path>` (with `<path>` being the temporary directory you received) to generate a patchfile and register it into your top-level manifest via the `patch:` protocol. Run `yarn patch-commit -h` for more details.\n\n Calling the command when you already have a patch won't import it by default (in other words, the default behavior is to reset existing patches). However, adding the `-u,--update` flag will import any current patch.\n "});var dQt={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:"BOOLEAN",default:!1},patchFolder:{description:"Folder where the patch files must be written",type:"ABSOLUTE_PATH",default:"./.yarn/patches"}},commands:[jm,Ym],fetchers:[mF],resolvers:[CF]},mQt=dQt;var GG={};sr(GG,{default:()=>wQt});Xe();Nt();var yF=Te(Vt()),IF=class{getCustomDataKey(){return JSON.stringify({name:"PnpmLinker",version:3})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the pnpm linker to be enabled");let o=this.getCustomDataKey(),a=r.project.linkersCustomData.get(o);if(!a)throw new yF.UsageError(`The project in ${Me.pretty(r.project.configuration,`${r.project.cwd}/package.json`,Me.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=a.pathsByLocator.get(e.locatorHash);if(typeof n>"u")throw new yF.UsageError(`Couldn't find ${Y.prettyLocator(r.project.configuration,e)} in the currently installed pnpm map - running an install might help`);return n.packageLocation}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let o=this.getCustomDataKey(),a=r.project.linkersCustomData.get(o);if(!a)throw new yF.UsageError(`The project in ${Me.pretty(r.project.configuration,`${r.project.cwd}/package.json`,Me.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=e.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);if(n){let g=a.locatorByPath.get(n[1]);if(g)return g}let c=e,f=e;do{f=c,c=ee.dirname(f);let g=a.locatorByPath.get(f);if(g)return g}while(c!==f);return null}makeInstaller(e){return new HG(e)}isEnabled(e){return e.project.configuration.get("nodeLinker")==="pnpm"}},HG=class{constructor(e){this.opts=e;this.asyncActions=new Ve.AsyncActions(10);this.customData={pathsByLocator:new Map,locatorByPath:new Map};this.indexFolderPromise=ev(ge,{indexPath:ee.join(e.project.configuration.get("globalFolder"),"index")})}attachCustomData(e){}async installPackage(e,r,o){switch(e.linkType){case"SOFT":return this.installPackageSoft(e,r,o);case"HARD":return this.installPackageHard(e,r,o)}throw new Error("Assertion failed: Unsupported package link type")}async installPackageSoft(e,r,o){let a=ee.resolve(r.packageFs.getRealPath(),r.prefixPath),n=this.opts.project.tryWorkspaceByLocator(e)?ee.join(a,Zr.nodeModules):null;return this.customData.pathsByLocator.set(e.locatorHas
${vQt}
`,"--",...o],{cwd:t,strict:!0})},async makeReset(t,e){let r=e.map(o=>de.fromPortablePath(o.path));await gn.execvp("git",["reset","HEAD","--",...r],{cwd:t,strict:!0})}};var Z2e={async findRoot(t){return await EF(t,{marker:".hg"})},async filterChanges(t,e,r){return[]},async genCommitMessage(t,e){return""},async makeStage(t,e){},async makeCommit(t,e,r){},async makeReset(t,e){},async makeUpdate(t,e){}};var PQt=[X2e,Z2e],Wm=class extends pt{constructor(){super(...arguments);this.commit=Pg.Option.Boolean("-c,--commit",!1,{description:"Commit the staged files"});this.reset=Pg.Option.Boolean("-r,--reset",!1,{description:"Remove all files from the staging area"});this.dryRun=Pg.Option.Boolean("-n,--dry-run",!1,{description:"Print the commit message and the list of modified files without staging / committing"});this.update=Pg.Option.Boolean("-u,--update",!1,{hidden:!0})}async execute(){let r=await rt.find(this.context.cwd,this.context.plugins),{project:o}=await xt.find(r,this.context.cwd),{driver:a,root:n}=await bQt(o.cwd),c=[r.get("cacheFolder"),r.get("globalFolder"),r.get("virtualFolder"),r.get("yarnPath")];await r.triggerHook(B=>B.populateYarnPaths,o,B=>{c.push(B)});let f=new Set;for(let B of c)for(let Q of FQt(n,B))f.add(Q);let g=new Set([r.get("rcFilename"),r.get("lockfileFilename"),"package.json"]),p=await a.filterChanges(n,f,g),I=await a.genCommitMessage(n,p);if(this.dryRun)if(this.commit)this.context.stdout.write(`${I}
`);else for(let B of p)this.context.stdout.write(`${de.fromPortablePath(B.path)}
`);else if(this.reset){let B=await a.filterChanges(n,f,g,{staged:!0});B.length===0?this.context.stdout.write("No staged changes found!"):await a.makeReset(n,B)}else p.length===0?this.context.stdout.write("No changes found!"):this.commit?await a.makeCommit(n,p,I):(await a.makeStage(n,p),this.context.stdout.write(I))}};Wm.paths=[["stage"]],Wm.usage=Pg.Command.Usage({description:"add all yarn files to your vcs",details:"\n This command will add to your staging area the files belonging to Yarn (typically any modified `package.json` and `.yarnrc.yml` files, but also linker-generated files, cache data, etc). It will take your ignore list into account, so the cache files won't be added if the cache is ignored in a `.gitignore` file (assuming you use Git).\n\n Running `--reset` will instead remove them from the staging area (the changes will still be there, but won't be committed until you stage them back).\n\n Since the staging area is a non-existent concept in Mercurial, Yarn will always create a new commit when running this command on Mercurial repositories. You can get this behavior when using Git by using the `--commit` flag which will directly create a commit.\n ",examples:[["Adds all modified project files to the staging area","yarn stage"],["Creates a new commit containing all modified project files","yarn stage --commit"]]});async function bQt(t){let e=null,r=null;for(let o of PQt)if((r=await o.findRoot(t))!==null){e=o;break}if(e===null||r===null)throw new Pg.UsageError("No stage driver has been found for your current project");return{driver:e,root:r}}function FQt(t,e){let r=[];if(e===null)return r;for(;;){(e===t||e.startsWith(`${t}/`))&&r.push(e);let o;try{o=ge.statSync(e)}catch{break}if(o.isSymbolicLink())e=ee.resolve(ee.dirname(e),ge.readlinkSync(e));else break}return r}var RQt={commands:[Wm]},TQt=RQt;var WG={};sr(WG,{default:()=>HQt});Xe();Xe();Nt();var tQe=Te(Ei());Xe();var $2e=Te(IH()),MQt="e8e1bd300d860104bb8c58453ffa1eb4",NQt="OFCNCOG2CU",eQe=async(t,e)=>{var n;let r=Y.stringifyIdent(t),a=LQt(e).initIndex("npm-search");try{return((n=(await a.getObject(r,{attributesToRetrieve:["types"]})).types)==null?void 0:n.ts)==="definitely-typed"}catch{return!1}},LQt=t=>(0,$2e.default)(NQt,MQt,{requester:{async send(r){try{let o=await Kn.request(r.url,r.data||null,{configuration:t,headers:r.headers});return{content:o.body,isTimedOut:!1,status:o.statusCode}}catch(o){return{content:o.response.body,isTimedOut:!1,status:o.response.statusCode}}}}});var rQe=t=>t.scope?`${t.scope}__${t.name}`:`${t.name}`,OQt=async(t,e,r,o)=>{if(r.scope==="types")return;let{project:a}=t,{configuration:n}=a;if(!(n.get("tsEnableAutoTypes")??ge.existsSync(ee.join(a.cwd,"tsconfig.json"))))return;let f=n.makeResolver(),g={project:a,resolver:f,report:new Yi};if(!await eQe(r,n))return;let I=rQe(r),B=Y.parseRange(r.range).selector;if(!Vr.validRange(B)){let U=n.normalizeDependency(r),q=await f.getCandidates(U,{},g);B=Y.parseRange(q[0].reference).selector}let Q=tQe.default.coerce(B);if(Q===null)return;let x=`${Ec.Modifier.CARET}${Q.major}`,y=Y.makeDescriptor(Y.makeIdent("types",I),x),T=Ve.mapAndFind(a.workspaces,U=>{var fe,me;let q=(fe=U.manifest.dependencies.get(r.identHash))==null?void 0:fe.descriptorHash,X=(me=U.manifest.devDependencies.get(r.identHash))==null?void 0:me.descriptorHash;if(q!==r.descriptorHash&&X!==r.descriptorHash)return Ve.mapAndFind.skip;let se=[];for(let Qe of Gt.allDependencies){let be=U.manifest[Qe].get(y.identHash);typeof be>"u"||se.push([Qe,be])}return se.length===0?Ve.mapAndFind.skip:se});if(typeof T<"u")for(let[U,q]of T)t.manifest[U].set(q.identHash,q);else{try{let U=n.normalizeDependency(y);if((await f.getCandidates(U,{},g)).length===0)return}catch{return}t.manifest[Ec.Target.DEVELOPMENT].set(y.identHash,y)}},UQt=async(t,e,r)=>{if(r.scope==="types")return;let{project:o}=t,{configuration:a}=o;if(!(a.get("tsEnableAutoTypes")??ge.existsSync(ee.join(o.cwd,"tsconfig.json"))))return;let c=rQe(r),f=Y.makeIdent("types",c);for(let g of Gt.allDependencies)typeof t.manifest[g].get(f.identHash)>"u"||t.manifest[g].delete(f.i
- ${f.map(x=>de.fromPortablePath(x)).join(`
- `)}`);let g=new Set(Ve.mapAndFilter(n,x=>{let y=t.tryWorkspaceByFilePath(x);return y===null?Ve.mapAndFilter.skip:y}));if(f.length===0&&g.size===0&&!e)return null;let p=f.length===1?f[0]:ee.join(c,`${Li.makeHash(Math.random().toString()).slice(0,8)}.yml`),I=ge.existsSync(p)?await ge.readFilePromise(p,"utf8"):"{}",B=os(I),Q=new Map;for(let x of B.declined||[]){let y=Y.parseIdent(x),T=t.getWorkspaceByIdent(y);Q.set(T,"decline")}for(let[x,y]of Object.entries(B.releases||{})){let T=Y.parseIdent(x),U=t.getWorkspaceByIdent(T);Q.set(U,yE(y))}return{project:t,root:o,baseHash:a!==null?a.hash:null,baseTitle:a!==null?a.title:null,changedFiles:new Set(n),changedWorkspaces:g,releaseRoots:new Set([...g].filter(x=>x.manifest.version!==null)),releases:Q,async saveAll(){let x={},y=[],T=[];for(let U of t.workspaces){if(U.manifest.version===null)continue;let q=Y.stringifyIdent(U.locator),X=Q.get(U);X==="decline"?y.push(q):typeof X<"u"?x[q]=yE(X):g.has(U)&&T.push(q)}await ge.mkdirPromise(ee.dirname(p),{recursive:!0}),await ge.changeFilePromise(p,Ya(new Ya.PreserveOrdering({releases:Object.keys(x).length>0?x:void 0,declined:y.length>0?y:void 0,undecided:T.length>0?T:void 0})))}}}function ivt(t){return wF(t).size>0||CQ(t).length>0}function wF(t){let e=new Set;for(let r of t.changedWorkspaces)r.manifest.version!==null&&(t.releases.has(r)||e.add(r));return e}function CQ(t,{include:e=new Set}={}){let r=[],o=new Map(Ve.mapAndFilter([...t.releases],([n,c])=>c==="decline"?Ve.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n])),a=new Map(Ve.mapAndFilter([...t.releases],([n,c])=>c!=="decline"?Ve.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n]));for(let n of t.project.workspaces)if(!(!e.has(n)&&(a.has(n.anchoredLocator.locatorHash)||o.has(n.anchoredLocator.locatorHash)))&&n.manifest.version!==null)for(let c of Gt.hardDependencies)for(let f of n.manifest.getForScope(c).values()){let g=t.project.tryWorkspaceByDescriptor(f);g!==null&&o.has(g.anchoredLocator.locatorHash)&&r.push([n,g])}return r}function VG(t,e){let r=Vu.default.clean(e);for(let o of Object.values(IE))if(o!=="undecided"&&o!=="decline"&&Vu.default.inc(t,o)===r)return o;return null}function BF(t,e){if(Vu.default.valid(e))return e;if(t===null)throw new CE.UsageError(`Cannot apply the release strategy "${e}" unless the workspace already has a valid version`);if(!Vu.default.valid(t))throw new CE.UsageError(`Cannot apply the release strategy "${e}" on a non-semver version (${t})`);let r=Vu.default.inc(t,e);if(r===null)throw new CE.UsageError(`Cannot apply the release strategy "${e}" on the specified version (${t})`);return r}function XG(t,e,{report:r}){let o=new Map;for(let a of t.workspaces)for(let n of Gt.allDependencies)for(let c of a.manifest[n].values()){let f=t.tryWorkspaceByDescriptor(c);if(f===null||!e.has(f))continue;Ve.getArrayWithDefault(o,f).push([a,n,c.identHash])}for(let[a,n]of e){let c=a.manifest.version;a.manifest.version=n,Vu.default.prerelease(n)===null?delete a.manifest.raw.stableVersion:a.manifest.raw.stableVersion||(a.manifest.raw.stableVersion=c);let f=a.manifest.name!==null?Y.stringifyIdent(a.manifest.name):null;r.reportInfo(0,`${Y.prettyLocator(t.configuration,a.anchoredLocator)}: Bumped to ${n}`),r.reportJson({cwd:de.fromPortablePath(a.cwd),ident:f,oldVersion:c,newVersion:n});let g=o.get(a);if(!(typeof g>"u"))for(let[p,I,B]of g){let Q=p.manifest[I].get(B);if(typeof Q>"u")throw new Error("Assertion failed: The dependency should have existed");let x=Q.range,y=!1;if(x.startsWith(Bi.protocol)&&(x=x.slice(Bi.protocol.length),y=!0,x===a.relativeCwd))continue;let T=x.match(nvt);if(!T){r.reportWarning(0,`Couldn't auto-upgrade range ${x} (in ${Y.prettyLocator(t.configuration,p.anchoredLocator)})`);continue}let U=`${T[1]}${n}`;y&&(U=`${Bi.protocol}${U}`);let q=Y.makeDescriptor(Q,U);p.manifest[I].set(B,q)}}}var svt=new Map([["%n",{extract:t=>t.length>=1?[t[0],t.slice(1)]:null,generate:(t=0)=>`${t+1}`}]]);function AQe(t,{current:e,prerelease:r}){let o=new Vu.default.SemVer(e),a=o.prerelease.slice(),n=[];o.prerelease=[],o.format()!==t&&(a.length=0);let c=!0,f=r.split(/\./g);fo
2022-08-27 06:35:11 +00:00
This command will apply the deferred version changes and remove their definitions from the repository.
Note that if \`--prerelease\` is set, the given prerelease identifier (by default \`rc.%d\`) will be used on all new versions and the version definitions will be kept as-is.
By default only the current workspace will be bumped, but you can configure this behavior by using one of:
- \`--recursive\` to also apply the version bump on its dependencies
- \`--all\` to apply the version bump on all packages in the repository
Note that this command will also update the \`workspace:\` references across all your local workspaces, thus ensuring that they keep referring to the same workspaces even after the version bump.
2022-09-06 17:07:18 +00:00
`,examples:[["Apply the version change to the local workspace","yarn version apply"],["Apply the version change to all the workspaces in the local workspace","yarn version apply --all"]]});Xe();Nt();var Vm=Te(Vt()),QF=Te(Ei());var zm=class extends pt{constructor(){super(...arguments);this.interactive=Vm.Option.Boolean("-i,--interactive",{description:"Open an interactive interface used to set version bumps"})}async execute(){return this.interactive?await this.executeInteractive():await this.executeStandard()}async executeInteractive(){NI(this.context);let{Gem:r}=await Promise.resolve().then(()=>(ub(),Wq)),{ScrollableItems:o}=await Promise.resolve().then(()=>(hb(),pb)),{FocusRequest:a}=await Promise.resolve().then(()=>(zq(),dwe)),{useListInput:n}=await Promise.resolve().then(()=>(gb(),mwe)),{renderForm:c}=await Promise.resolve().then(()=>(yb(),Cb)),{Box:f,Text:g}=await Promise.resolve().then(()=>Te(Rl())),{default:p,useCallback:I,useState:B}=await Promise.resolve().then(()=>Te(hn())),Q=await rt.find(this.context.cwd,this.context.plugins),{project:x,workspace:y}=await xt.find(Q,this.context.cwd);if(!y)throw new lr(x.cwd,this.context.cwd);await x.restoreInstallState();let T=await EE(x);if(T===null||T.releaseRoots.size===0)return 0;if(T.root===null)throw new Vm.UsageError("This command can only be run on Git repositories");let U=()=>p.createElement(f,{flexDirection:"row",paddingBottom:1},p.createElement(f,{flexDirection:"column",width:60},p.createElement(f,null,p.createElement(g,null,"Press ",p.createElement(g,{bold:!0,color:"cyanBright"},"<up>"),"/",p.createElement(g,{bold:!0,color:"cyanBright"},"<down>")," to select workspaces.")),p.createElement(f,null,p.createElement(g,null,"Press ",p.createElement(g,{bold:!0,color:"cyanBright"},"<left>"),"/",p.createElement(g,{bold:!0,color:"cyanBright"},"<right>")," to select release strategies."))),p.createElement(f,{flexDirection:"column"},p.createElement(f,{marginLeft:1},p.createElement(g,null,"Press ",p.createElement(g,{bold:!0,color:"cyanBright"},"<enter>")," to save.")),p.createElement(f,{marginLeft:1},p.createElement(g,null,"Press ",p.createElement(g,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),q=({workspace:be,active:Ee,decision:ye,setDecision:De})=>{let h=be.manifest.raw.stableVersion??be.manifest.version;if(h===null)throw new Error(`Assertion failed: The version should have been set (${Y.prettyLocator(Q,be.anchoredLocator)})`);if(QF.default.prerelease(h)!==null)throw new Error(`Assertion failed: Prerelease identifiers shouldn't be found (${h})`);let Oe=["undecided","decline","patch","minor","major"];n(ye,Oe,{active:Ee,minus:"left",plus:"right",set:De});let Ie=ye==="undecided"?p.createElement(g,{color:"yellow"},h):ye==="decline"?p.createElement(g,{color:"green"},h):p.createElement(g,null,p.createElement(g,{color:"magenta"},h)," \u2192 ",p.createElement(g,{color:"green"},QF.default.valid(ye)?ye:QF.default.inc(h,ye)));return p.createElement(f,{flexDirection:"column"},p.createElement(f,null,p.createElement(g,null,Y.prettyLocator(Q,be.anchoredLocator)," - ",Ie)),p.createElement(f,null,Oe.map(Ce=>p.createElement(f,{key:Ce,paddingLeft:2},p.createElement(g,null,p.createElement(r,{active:Ce===ye})," ",Ce)))))},X=be=>{let Ee=new Set(T.releaseRoots),ye=new Map([...be].filter(([De])=>Ee.has(De)));for(;;){let De=CQ({project:T.project,releases:ye}),h=!1;if(De.length>0){for(let[Oe]of De)if(!Ee.has(Oe)){Ee.add(Oe),h=!0;let Ie=be.get(Oe);typeof Ie<"u"&&ye.set(Oe,Ie)}}if(!h)break}return{relevantWorkspaces:Ee,relevantReleases:ye}},se=()=>{let[be,Ee]=B(()=>new Map(T.releases)),ye=I((De,h)=>{let Oe=new Map(be);h!=="undecided"?Oe.set(De,h):Oe.delete(De);let{relevantReleases:Ie}=X(Oe);Ee(Ie)},[be,Ee]);return[be,ye]},fe=({workspaces:be,releases:Ee})=>{let ye=[];ye.push(`${be.size} total`);let De=0,h=0;for(let Oe of be){let Ie=Ee.get(Oe);typeof Ie>"u"?h+=1:Ie!=="decline"&&(De+=1)}return ye.push(`${De} release${De===1?"":"s"}`),ye.push(`${h} remaining`),p.createElement(g,{color:"yellow"},ye.join(", "))},Qe=await c(({useSubmit:be})=>{let[Ee,ye]=se();be(Ee);let{relevantWorkspaces:De}=X(
2022-08-27 06:35:11 +00:00
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/*!
* buildToken
* Builds OAuth token prefix (helper function)
*
* @name buildToken
* @function
* @param {GitUrl} obj The parsed Git url object.
* @return {String} token prefix
*/
/*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*/
/*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*/
/*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/
/*!
* is-windows <https://github.com/jonschlinkert/is-windows>
*
* Copyright © 2015-2018, Jon Schlinkert.
* Released under the MIT License.
*/
/*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*/
/** @license React v0.18.0
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v0.24.0
* react-reconciler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/