(()=>{varKoe=Object.create,fg=Object.defineProperty,Uoe=Object.defineProperties,Hoe=Object.getOwnPropertyDescriptor,Yoe=Object.getOwnPropertyDescriptors,qoe=Object.getOwnPropertyNames,uC=Object.getOwnPropertySymbols,Goe=Object.getPrototypeOf,gw=Object.prototype.hasOwnProperty,wL=Object.prototype.propertyIsEnumerable;varQL=(t,e,r)=>eint?fg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,P=(t,e)=>{for(varrine||(e={}))gw.call(e,r)&&QL(t,r,e[r]);if(uC)for(varrofuC(e))wL.call(e,r)&&QL(t,r,e[r]);returnt},V=(t,e)=>Uoe(t,Yoe(e)),joe=t=>fg(t,"__esModule",{value:!0});varvr=(t,e)=>{varr={};for(variint)gw.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&uC)for(variofuC(t))e.indexOf(i)<0&&wL.call(t,i)&&(r[i]=t[i]);returnr},Joe=(t,e)=>()=>(t&&(e=t(t=0)),e),C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),$e=(t,e)=>{for(varrine)fg(t,r,{get:e[r],enumerable:!0})},Woe=(t,e,r)=>{if(e&&typeofe=="object"||typeofe=="function")for(letiofqoe(e))!gw.call(t,i)&&i!=="default"&&fg(t,i,{get:()=>e[i],enumerable:!(r=Hoe(e,i))||r.enumerable});returnt},te=t=>Woe(joe(fg(t!=null?Koe(Goe(t)):{},"default",t&&t.__esModule&&"default"int?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);vartN=C((zze,ZL)=>{ZL.exports=_L;_L.sync=aae;var$L=require("fs");functionAae(t,e){varr=e.pathExt!==void0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(vari=0;i<r.length;i++){varn=r[i].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return!0}return!1}functioneN(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:Aae(e,r)}function_L(t,e,r){$L.stat(t,function(i,n){r(i,i?!1:eN(n,t,e))})}functionaae(t,e){returneN($L.statSync(t),t,e)}});varoN=C((Vze,rN)=>{rN.exports=iN;iN.sync=lae;varnN=require("fs");functioniN(t,e,r){nN.stat(t,function(i,n){r(i,i?!1:sN(n,e))})}functionlae(t,e){returnsN(nN.statSync(t),e)}functionsN(t,e){returnt.isFile()&&cae(t,e)}functioncae(t,e){varr=t.mode,i=t.uid,n=t.gid,s=e.uid!==void0?e.uid:process.getuid&&process.getuid(),o=e.gid!==void0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8),u=a|l,g=r&c||r&l&&n===o||r&a&&i===s||r&u&&s===0;returng}});varAN=C((Zze,aN)=>{varXze=require("fs"),wC;process.platform==="win32"||global.TESTING_WINDOWS?wC=tN():wC=oN();aN.exports=Dw;Dw.sync=uae;functionDw(t,e,r){if(typeofe=="function"&&(r=e,e={}),!r){if(typeofPromise!="function")thrownewTypeError("callback not provided");returnnewPromise(function(i,n){Dw(t,e||{},function(s,o){s?n(s):i(o)})})}wC(t,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),r(i,n)})}functionuae(t,e){try{returnwC.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throwr}}});varpN=C((_ze,lN)=>{varLl=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",cN=require("path"),gae=Ll?";":":",uN=AN(),gN=t=>Object.assign(newError(`not found: ${t}`),{code:"ENOENT"}),hN=(t,e)=>{letr=e.colon||gae,i=t.match(/\//)||Ll&&t.match(/\\/)?[""]:[...Ll?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],n=Ll?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Ll?n.split(r):[""];returnLl&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},fN=(t,e,r)=>{typeofe=="function"&&(r=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:s}=hN(t,e),o=[],a=c=>newPromise((u,g)=>{if(c===i.length)returne.all&&o.length?u(o):g(gN(t));leth=i[c],f=/^".*"$/.test(h)?h.slice(1,-1):h,p=cN.join(f,t),m=!f&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;u(l(m,c,0))}),l=(c,u,g)=>newPromise((h,f)=>{if(g===n.length)returnh(a(u+1));letp=n[g];uN(c+p,{pathExt:s},(m,I)=>{if(!m&&I)if(e.all)o.push(c+p);elsereturnh(c+p);returnh(l(c,u,g+1))})});returnr?a(0).then(c=>r(null,c),r):a(0)},hae=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=hN(t,e),s=[];for(leto=0;o<r.length;o++){leta=r[o],l=/^".*"$/.test(a)?a.slice(1,-1):a,c=cN.join(l,t),u=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(letg=0;g<i.length;g++){leth=u+i[g];try{if(uN.s
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a","\x07"]]);function aM(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)):_ae.get(t)||t}function $ae(t,e){let r=[],i=e.trim().split(/\s*,\s*/g),n;for(let s of i){let o=Number(s);if(!Number.isNaN(o))r.push(o);else if(n=s.match(Xae))r.push(n[2].replace(Zae,(a,l,c)=>l?aM(l):c));else throw new Error(`InvalidChalktemplatestyleargument:${s}(instyle'${t}')`)}return r}function eAe(t){oM.lastIndex=0;let e=[],r;for(;(r=oM.exec(t))!==null;){let i=r[1];if(r[2]){let n=$ae(i,r[2]);e.push([i].concat(n))}else e.push([i])}return e}function AM(t,e){let r={};for(let n of e)for(let s of n.styles)r[s[0]]=n.inverse?null:s.slice(1);let i=t;for(let[n,s]of Object.entries(r))if(!!Array.isArray(s)){if(!(n in i))throw new Error(`UnknownChalkstyle:${n}`);i=s.length>0?i[n](...s):i[n]}return i}sM.exports=(t,e)=>{let r=[],i=[],n=[];if(e.replace(Vae,(s,o,a,l,c,u)=>{if(o)n.push(aM(o));else if(l){let g=n.join("");n=[],i.push(r.length===0?g:AM(t,r)(g)),r.push({inverse:a,styles:eAe(l)})}else if(c){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(AM(t,r)(n.join(""))),n=[],r.pop()}else n.push(u)}),i.push(n.join("")),r.length>0){let s=`Chalktemplateliteralismissing${r.length}closingbracket${r.length===1?"":"s"}(\`}\`)`;thrownewError(s)}returni.join("")}});var$w=C((y4e,cM)=>{"use strict";varFg=ZN(),{stdout:Vw,stderr:Xw}=rM(),{stringReplaceAll:tAe,stringEncaseCRLFWithFirstIndex:rAe}=nM(),uM=["ansi","ansi","ansi256","ansi16m"],Kl=Object.create(null),iAe=(t,e={})=>{if(e.level>3||e.level<0)thrownewError("The `level` option should be an integer from 0 to 3");letr=Vw?Vw.level:0;t.level=e.level===void0?r:e.level},gM=class{constructor(e){returnhM(e)}},hM=t=>{lete={};returniAe(e,t),e.template=(...r)=>nAe(e.template,...r),Object.setPrototypeOf(e,DC.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{thrownewError("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=gM,e.template};functionDC(t){returnhM(t)}for(let[t,e]ofObject.entries(Fg))Kl[t]={get(){letr=SC(this,Zw(e.open,e.close,this._styler),this._isEmpty);returnObject.defineProperty(this,t,{value:r}),r}};Kl.visible={get(){lett=SC(this,this._styler,!0);returnObject.defineProperty(this,"visible",{value:t}),t}};varfM=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(lettoffM)Kl[t]={get(){let{level:e}=this;returnfunction(...r){leti=Zw(Fg.color[uM[e]][t](...r),Fg.color.close,this._styler);returnSC(this,i,this._isEmpty)}}};for(lettoffM){lete="bg"+t[0].toUpperCase()+t.slice(1);Kl[e]={get(){let{level:r}=this;returnfunction(...i){letn=Zw(Fg.bgColor[uM[r]][t](...i),Fg.bgColor.close,this._styler);returnSC(this,n,this._isEmpty)}}}}varsAe=Object.defineProperties(()=>{},V(P({},Kl),{level:{enumerable:!0,get(){returnthis._generator.level},set(t){this._generator.level=t}}})),Zw=(t,e,r)=>{leti,n;returnr===void0?(i=t,n=e):(i=r.openAll+t,n=e+r.closeAll),{open:t,close:e,openAll:i,closeAll:n,parent:r}},SC=(t,e,r)=>{leti=(...n)=>oAe(i,n.length===1?""+n[0]:n.join(" "));returni.__proto__=sAe,i._generator=t,i._styler=e,i._isEmpty=r,i},oAe=(t,e)=>{if(t.level<=0||!e)returnt._isEmpty?"":e;letr=t._styler;if(r===void0)returne;let{openAll:i,closeAll:n}=r;if(e.indexOf("")!==-1)for(;r!==void0;)e=tAe(e,r.close,r.open),r=r.parent;lets=e.indexOf(`
`,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 xO=C((R8e,QO)=>{"use strict";var yle=KC(),{MAX_LENGTH:bO,CHAR_BACKSLASH:IQ,CHAR_BACKTICK:Ble,CHAR_COMMA:wle,CHAR_DOT:Qle,CHAR_LEFT_PARENTHESES:ble,CHAR_RIGHT_PARENTHESES:Dle,CHAR_LEFT_CURLY_BRACE:Sle,CHAR_RIGHT_CURLY_BRACE:xle,CHAR_LEFT_SQUARE_BRACKET:DO,CHAR_RIGHT_SQUARE_BRACKET:SO,CHAR_DOUBLE_QUOTE:Ple,CHAR_SINGLE_QUOTE:kle,CHAR_NO_BREAK_SPACE:vle,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Fle}=wO(),Rle=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},i=typeof r.maxLength=="number"?Math.min(bO,r.maxLength):bO;if(t.length>i)throw new SyntaxError(`Inputlength(${t.length}),exceedsmaxcharacters(${i})`);let n={type:"root",input:t,nodes:[]},s=[n],o=n,a=n,l=0,c=t.length,u=0,g=0,h,f={},p=()=>t[u++],m=I=>{if(I.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&I.type==="text"){a.value+=I.value;return}return o.nodes.push(I),I.parent=o,I.prev=a,a=I,I};for(m({type:"bos"});u<c;)if(o=s[s.length-1],h=p(),!(h===Fle||h===vle)){if(h===IQ){m({type:"text",value:(e.keepEscaping?h:"")+p()});continue}if(h===SO){m({type:"text",value:"\\"+h});continue}if(h===DO){l++;let I=!0,y;for(;u<c&&(y=p());){if(h+=y,y===DO){l++;continue}if(y===IQ){h+=p();continue}if(y===SO&&(l--,l===0))break}m({type:"text",value:h});continue}if(h===ble){o=m({type:"paren",nodes:[]}),s.push(o),m({type:"text",value:h});continue}if(h===Dle){if(o.type!=="paren"){m({type:"text",value:h});continue}o=s.pop(),m({type:"text",value:h}),o=s[s.length-1];continue}if(h===Ple||h===kle||h===Ble){let I=h,y;for(e.keepQuotes!==!0&&(h="");u<c&&(y=p());){if(y===IQ){h+=y+p();continue}if(y===I){e.keepQuotes===!0&&(h+=y);break}h+=y}m({type:"text",value:h});continue}if(h===Sle){g++;let I=a.value&&a.value.slice(-1)==="$"||o.dollar===!0;o=m({type:"brace",open:!0,close:!1,dollar:I,depth:g,commas:0,ranges:0,nodes:[]}),s.push(o),m({type:"open",value:h});continue}if(h===xle){if(o.type!=="brace"){m({type:"text",value:h});continue}let I="close";o=s.pop(),o.close=!0,m({type:I,value:h}),g--,o=s[s.length-1];continue}if(h===wle&&g>0){if(o.ranges>0){o.ranges=0;let I=o.nodes.shift();o.nodes=[I,{type:"text",value:yle(o)}]}m({type:"comma",value:h}),o.commas++;continue}if(h===Qle&&g>0&&o.commas===0){let I=o.nodes;if(g===0||I.length===0){m({type:"text",value:h});continue}if(a.type==="dot"){if(o.range=[],a.value+=h,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){I.pop();let y=I[I.length-1];y.value+=a.value+h,a=y,o.ranges--;continue}m({type:"dot",value:h});continue}m({type:"text",value:h})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(b=>{b.nodes||(b.type==="open"&&(b.isOpen=!0),b.type==="close"&&(b.isClose=!0),b.nodes||(b.type="text"),b.invalid=!0)});let I=s[s.length-1],y=I.nodes.indexOf(o);I.nodes.splice(y,1,...o.nodes)}while(s.length>0);return m({type:"eos"}),n};QO.exports=Rle});var vO=C((L8e,PO)=>{"use strict";var kO=KC(),Lle=mO(),Nle=yO(),Mle=xO(),Ki=(t,e={})=>{let r=[];if(Array.isArray(t))for(let i of t){let n=Ki.create(i,e);Array.isArray(n)?r.push(...n):r.push(n)}else r=[].concat(Ki.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Ki.parse=(t,e={})=>Mle(t,e);Ki.stringify=(t,e={})=>typeof t=="string"?kO(Ki.parse(t,e),e):kO(t,e);Ki.compile=(t,e={})=>(typeof t=="string"&&(t=Ki.parse(t,e)),Lle(t,e));Ki.expand=(t,e={})=>{typeof t=="string"&&(t=Ki.parse(t,e));let r=Nle(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Ki.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Ki.compile(t,e):Ki.expand(t,e);PO.exports=Ki});var qg=C((N8e,FO)=>{"use strict";var Ole=require("path"),$n="\\\\/",RO=`[^${$n}]`,Ns="\\.",Tle="\\+",Kle="\\?",HC="\\/",Ule="(?=.)",LO="[^/]",EQ=`(?:${HC}|$)`,N
Pleasereportthistohttps://github.com/szmarczak/http2-wrapper/`);p(m)}return}i[0].resolve(f);return}}if(o in this.queue){if(a in this.queue[o]){this.queue[o][a].listeners.push(...i),this._tryToCreateNewSession(o,a);return}}else this.queue[o]={};let l=()=>{o in this.queue&&this.queue[o][a]===c&&(delete this.queue[o][a],Object.keys(this.queue[o]).length===0&&delete this.queue[o])},c=()=>{let u=`${a}:${o}`,g=!1;try{let h=dCe.connect(e,P({createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(u)},r));h[oi]=0,h[uc]=!1;let f=()=>h[oi]<h.remoteSettings.maxConcurrentStreams,p=!0;h.socket.once("session",I=>{this.tlsSessionCache.set(u,I)}),h.once("error",I=>{for(let{reject:y}of i)y(I);this.tlsSessionCache.delete(u)}),h.setTimeout(this.timeout,()=>{h.destroy()}),h.once("close",()=>{if(g){p&&this._freeSessionsCount--,this._sessionsCount--;let I=this.sessions[o];I.splice(I.indexOf(h),1),I.length===0&&delete this.sessions[o]}else{let I=new Error("Session closed without receiving a SETTINGS frame");I.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:y}of i)y(I);l()}this._tryToCreateNewSession(o,a)});let m=()=>{if(!(!(o in this.queue)||!f())){for(let I of h[cn])if(I in this.queue[o]){let{listeners:y}=this.queue[o][I];for(;y.length!==0&&f();)y.shift().resolve(h);let b=this.queue[o];if(b[I].listeners.length===0&&(delete b[I],Object.keys(b).length===0)){delete this.queue[o];break}if(!f())break}}};h.on("origin",()=>{h[cn]=h.originSet,!!f()&&(m(),M0(this.sessions[o],h))}),h.once("remoteSettings",()=>{if(h.ref(),h.unref(),this._sessionsCount++,c.destroyed){let I=new Error("Agent has been destroyed");for(let y of i)y.reject(I);h.destroy();return}h[cn]=h.originSet;{let I=this.sessions;if(o in I){let y=I[o];y.splice(ICe(y,h,ECe),0,h)}else I[o]=[h]}this._freeSessionsCount+=1,g=!0,this.emit("session",h),m(),l(),h[oi]===0&&this._freeSessionsCount>this.maxFreeSessions&&h.close(),i.length!==0&&(this.getSession(a,r,i),i.length=0),h.on("remoteSettings",()=>{m(),M0(this.sessions[o],h)})}),h[GH]=h.request,h.request=(I,y)=>{if(h[uc])throw new Error("The session is gracefully closing. No new streams are allowed.");let b=h[GH](I,y);return h.ref(),++h[oi],h[oi]===h.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,b.once("close",()=>{if(p=f(),--h[oi],!h.destroyed&&!h.closed&&(yCe(this.sessions[o],h),f()&&!h.closed)){p||(this._freeSessionsCount++,p=!0);let x=h[oi]===0;x&&h.unref(),x&&(this._freeSessionsCount>this.maxFreeSessions||h[uc])?h.close():(M0(this.sessions[o],h),m())}}),b}}catch(h){for(let f of i)f.reject(h);l()}};c.listeners=i,c.completed=!1,c.destroyed=!1,this.queue[o][a]=c,this._tryToCreateNewSession(o,a)})}request(e,r,i,n){return new Promise((s,o)=>{this.getSession(e,r,[{reject:o,resolve:a=>{try{s(a.request(i,n))}catch(l){o(l)}}}])})}createConnection(e,r){return Js.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let i=e.port||443,n=e.hostname||e.host;return typeof r.servername=="undefined"&&(r.servername=n),pCe.connect(i,n,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[oi]===0&&r.close()}destroy(e){for(let r of Object.values(this.sessions))for(let i of r)i.destroy(e);for(let r of Object.values(this.queue))for(let i of Object.values(r))i.destroyed=!0;this.queue={}}get freeSessions(){return JH({agent:this,isFree:!0})}get busySessions(){return JH({agent:this,isFree:!1})}};Js.kCurrentStreamsCount=oi;Js.kGracefullyClosing=uc;qH.exports={Agent:Js,globalAgent:new Js}});var T0=C((L6e,WH)=>{"use strict";var{Readable:BCe}=require("stream"),zH=class extends BCe{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
`+CG.repeat(" ",e+this.position-n+i.length)+"^"};eS.prototype.toString=function(e){var r,i="";return this.name&&(i+='in "'+this.name+'" '),i+="at line "+(this.line+1)+", column "+(this.column+1),e||(r=this.getSnippet(),r&&(i+=`:
`+r)),i};dG.exports=eS});var Er=C((X7e,IG)=>{"use strict";var EG=bc(),SEe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],xEe=["scalar","sequence","mapping"];function PEe(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(i){e[String(i)]=r})}),e}function kEe(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(SEe.indexOf(r)===-1)throw new EG('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=PEe(e.styleAliases||null),xEe.indexOf(this.kind)===-1)throw new EG('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}IG.exports=kEe});var kA=C((Z7e,yG)=>{"use strict";var BG=PA(),bI=bc(),vEe=Er();function tS(t,e,r){var i=[];return t.include.forEach(function(n){r=tS(n,e,r)}),t[e].forEach(function(n){r.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&i.push(o)}),r.push(n)}),r.filter(function(n,s){return i.indexOf(s)===-1})}function FEe(){var t={scalar:{},sequence:{},mapping:{},fallback:{}},e,r;function i(n){t[n.kind][n.tag]=t.fallback[n.tag]=n}for(e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(i);return t}function Dc(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 bI("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=tS(this,"implicit",[]),this.compiledExplicit=tS(this,"explicit",[]),this.compiledTypeMap=FEe(this.compiledImplicit,this.compiledExplicit)}Dc.DEFAULT=null;Dc.create=function(){var e,r;switch(arguments.length){case 1:e=Dc.DEFAULT,r=arguments[0];break;case 2:e=arguments[0],r=arguments[1];break;default:throw new bI("Wrong number of arguments for Schema.create function")}if(e=BG.toArray(e),r=BG.toArray(r),!e.every(function(i){return i instanceof Dc}))throw new bI("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(i){return i instanceof vEe}))throw new bI("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new Dc({include:e,explicit:r})};yG.exports=Dc});var QG=C((_7e,wG)=>{"use strict";var REe=Er();wG.exports=new REe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var DG=C(($7e,bG)=>{"use strict";var LEe=Er();bG.exports=new LEe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var xG=C((eXe,SG)=>{"use strict";var NEe=Er();SG.exports=new NEe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var DI=C((tXe,PG)=>{"use strict";var MEe=kA();PG.exports=new MEe({explicit:[QG(),DG(),xG()]})});var vG=C((rXe,kG)=>{"use strict";var OEe=Er();function TEe(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function KEe(){return null}function UEe(t){return t===null}kG.exports=new OEe("tag:yaml.org,2002:null",{kind:"scalar",resolve:TEe,construct:KEe,predicate:UEe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var RG=C((iXe,FG)=>{"use strict";var HEe=Er();function YEe(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 qEe(t){return t==="true"||t==="True"||t==="TRUE"}function GEe(t){return Object.prototype.toString.call(t)==="[object Boolean]"}FG.exports=new HEe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:YEe,construct:qEe,predicate:GEe,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE"
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function iBe(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}var yj=new Array(256),Bj=new Array(256);for(var Pc=0;Pc<256;Pc++)yj[Pc]=Ej(Pc)?1:0,Bj[Pc]=Ej(Pc);function nBe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Vye,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 wj(t,e){return new gj(e,new zye(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function _e(t,e){throw wj(t,e)}function kI(t,e){t.onWarning&&t.onWarning.call(null,wj(t,e))}var Qj={YAML:function(e,r,i){var n,s,o;e.version!==null&&_e(e,"duplication of %YAML directive"),i.length!==1&&_e(e,"YAML directive accepts exactly one argument"),n=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),n===null&&_e(e,"ill-formed argument of the YAML directive"),s=parseInt(n[1],10),o=parseInt(n[2],10),s!==1&&_e(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&kI(e,"unsupported YAML version of the document")},TAG:function(e,r,i){var n,s;i.length!==2&&_e(e,"TAG directive accepts exactly two arguments"),n=i[0],s=i[1],Cj.test(n)||_e(e,"ill-formed tag handle (first argument) of the TAG directive"),ta.call(e.tagMap,n)&&_e(e,'there is a previously declared suffix for "'+n+'" tag handle'),mj.test(s)||_e(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=s}};function ra(t,e,r,i){var n,s,o,a;if(e<r){if(a=t.input.slice(e,r),i)for(n=0,s=a.length;n<s;n+=1)o=a.charCodeAt(n),o===9||32<=o&&o<=1114111||_e(t,"expected valid JSON character");else Zye.test(a)&&_e(t,"the stream contains non-printable characters");t.result+=a}}function bj(t,e,r,i){var n,s,o,a;for(Zs.isObject(r)||_e(t,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),o=0,a=n.length;o<a;o+=1)s=n[o],ta.call(e,s)||(e[s]=r[s],i[s]=!0)}function kc(t,e,r,i,n,s,o,a){var l,c;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),l=0,c=n.length;l<c;l+=1)Array.isArray(n[l])&&_e(t,"nested arrays are not supported inside keys"),typeof n=="object"&&Ij(n[l])==="[object Object]"&&(n[l]="[object Object]");if(typeof n=="object"&&Ij(n)==="[object Object]"&&(n="[object Object]"),n=String(n),e===null&&(e={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(l=0,c=s.length;l<c;l+=1)bj(t,e,s[l],r);else bj(t,e,s,r);else!t.json&&!ta.call(r,n)&&ta.call(e,n)&&(t.line=o||t.line,t.position=a||t.position,_e(t,"duplicated mapping key")),e[n]=s,delete r[n];return e}function oS(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++):_e(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function ur(t,e,r){for(var i=0,n=t.input.charCodeAt(t.position);n!==0;){for(;FA(n);)n=t.input.charCodeAt(++t.position);if(e&&n===35)do n=t.input.charCodeAt(++t.position);while(n!==10&&n!==13&&n!==0);if(os(n))for(oS(t),n=t.input.charCodeAt(t.position),i++,t.lineIndent=0;n===32;)t.lineIndent++,n=t.input.charCodeAt(++t.position);else break}return r!==-1&&i!==0&&t.lineIndent<r&&kI(t,"deficient indentation"),i}function vI(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||Di(r)))}function aS(t,e){e===1?t.result+=" ":e>1&&(t.result+=Zs.repeat(`
`,e-1))}function sBe(t,e,r){var i,n,s,o,a,l,c,u,g=t.kind,h=t.result,f;if(f=t.input.charCodeAt(t.position),Di(f)||xc(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(n=t.input.charCodeAt(t.position+1),Di(n)||r&&xc(n)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,a=!1;f!==0;){if(f===58){if(n=t.input.charCodeAt(t.position+1),Di(n)||r&&xc(n))break}else if(f===35){if(i=t.input.charCodeAt(t.position-1),Di(i))break}else{if(t.position===t.lineStart&&vI(t)||r&&xc(f))break;if(os(f))if(l=t.line,c=t.lineStart,u=t.lineIndent,ur(t,!1,-1),t.lineIndent>=e){a=!0,f=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=l,t.lineStart=c,t.lineIndent=u;break}}a&&(ra(t,s,o,!1),aS(t,t.line-l),s=o=t.position,a=!1),FA(f)||(o=t.position+1),f=t.input.charCodeAt(++t.position)}return ra(t,s,o,!1),t.result?!0:(t.kind=g,t.result=h,!1)}function oBe(t,e){var r,i,n;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,i=n=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(ra(t,i,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)i=t.position,t.position++,n=t.position;else return!0;else os(r)?(ra(t,i,n,!0),aS(t,ur(t,!1,e)),i=n=t.position):t.position===t.lineStart&&vI(t)?_e(t,"unexpected end of the document within a single quoted scalar"):(t.position++,n=t.position);_e(t,"unexpected end of the stream within a single quoted scalar")}function aBe(t,e){var r,i,n,s,o,a;if(a=t.input.charCodeAt(t.position),a!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=i=t.position;(a=t.input.charCodeAt(t.position))!==0;){if(a===34)return ra(t,r,t.position,!0),t.position++,!0;if(a===92){if(ra(t,r,t.position,!0),a=t.input.charCodeAt(++t.position),os(a))ur(t,!1,e);else if(a<256&&yj[a])t.result+=Bj[a],t.position++;else if((o=tBe(a))>0){for(n=o,s=0;n>0;n--)a=t.input.charCodeAt(++t.position),(o=eBe(a))>=0?s=(s<<4)+o:_e(t,"expected hexadecimal character");t.result+=iBe(s),t.position++}else _e(t,"unknown escape sequence");r=i=t.position}else os(a)?(ra(t,r,i,!0),aS(t,ur(t,!1,e)),r=i=t.position):t.position===t.lineStart&&vI(t)?_e(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}_e(t,"unexpected end of the stream within a double quoted scalar")}function ABe(t,e){var r=!0,i,n=t.tag,s,o=t.anchor,a,l,c,u,g,h={},f,p,m,I;if(I=t.input.charCodeAt(t.position),I===91)l=93,g=!1,s=[];else if(I===123)l=125,g=!0,s={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),I=t.input.charCodeAt(++t.position);I!==0;){if(ur(t,!0,e),I=t.input.charCodeAt(t.position),I===l)return t.position++,t.tag=n,t.anchor=o,t.kind=g?"mapping":"sequence",t.result=s,!0;r||_e(t,"missed comma between flow collection entries"),p=f=m=null,c=u=!1,I===63&&(a=t.input.charCodeAt(t.position+1),Di(a)&&(c=u=!0,t.position++,ur(t,!0,e))),i=t.line,vc(t,e,xI,!1,!0),p=t.tag,f=t.result,ur(t,!0,e),I=t.input.charCodeAt(t.position),(u||t.line===i)&&I===58&&(c=!0,I=t.input.charCodeAt(++t.position),ur(t,!0,e),vc(t,e,xI,!1,!0),m=t.result),g?kc(t,s,h,p,f,m):c?s.push(kc(t,null,h,p,f,m)):s.push(f),ur(t,!0,e),I=t.input.charCodeAt(t.position),I===44?(r=!0,I=t.input.charCodeAt(++t.position)):r=!1}_e(t,"unexpected end of the stream within a flow collection")}function lBe(t,e){var r,i,n=sS,s=!1,o=!1,a=e,l=0,c=!1,u,g;if(g=t.input.charCodeAt(t.position),g===124)i=!1;else if(g===62)i=!0;else return!1;for(t.kind="scalar",t.result="";g!==0;)if(g=t.input.charCodeAt(++t.position),g===43||g===45)sS===n?n=g===43?dj:Xye:_e(t,"repeat of a chomping mode identifier");else if((u=rBe(g))>=0)u===0?_e(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?_e(t,"repeat of an indentation width identifier"):(a=e+u-1,o=!0);else break;if(FA(g)){do g=t.input.charCodeAt(++t.position);while(FA(g));if(g===35)do g=t.input.charCodeAt(++t.position);while(!os(g)&&g!==0)}for(;g!==0;){for(oS(t),t.lineIndent=0,g=t.input.charCodeAt(t.position);(!o||t.lineIndent<a)&&g===32;)t.lineIndent++,g=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>a&&(a=t
`,s?1+l:l),s=!0,o=!0,l=0,r=t.position;!os(g)&&g!==0;)g=t.input.charCodeAt(++t.position);ra(t,r,t.position,!1)}return!0}function Dj(t,e){var r,i=t.tag,n=t.anchor,s=[],o,a=!1,l;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),l=t.input.charCodeAt(t.position);l!==0&&!(l!==45||(o=t.input.charCodeAt(t.position+1),!Di(o)));){if(a=!0,t.position++,ur(t,!0,-1)&&t.lineIndent<=e){s.push(null),l=t.input.charCodeAt(t.position);continue}if(r=t.line,vc(t,e,pj,!1,!0),s.push(t.result),ur(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&l!==0)_e(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return a?(t.tag=i,t.anchor=n,t.kind="sequence",t.result=s,!0):!1}function cBe(t,e,r){var i,n,s,o,a=t.tag,l=t.anchor,c={},u={},g=null,h=null,f=null,p=!1,m=!1,I;for(t.anchor!==null&&(t.anchorMap[t.anchor]=c),I=t.input.charCodeAt(t.position);I!==0;){if(i=t.input.charCodeAt(t.position+1),s=t.line,o=t.position,(I===63||I===58)&&Di(i))I===63?(p&&(kc(t,c,u,g,h,null),g=h=f=null),m=!0,p=!0,n=!0):p?(p=!1,n=!0):_e(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,I=i;else if(vc(t,r,fj,!1,!0))if(t.line===s){for(I=t.input.charCodeAt(t.position);FA(I);)I=t.input.charCodeAt(++t.position);if(I===58)I=t.input.charCodeAt(++t.position),Di(I)||_e(t,"a whitespace character is expected after the key-value separator within a block mapping"),p&&(kc(t,c,u,g,h,null),g=h=f=null),m=!0,p=!1,n=!1,g=t.tag,h=t.result;else if(m)_e(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=a,t.anchor=l,!0}else if(m)_e(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=a,t.anchor=l,!0;else break;if((t.line===s||t.lineIndent>e)&&(vc(t,e,PI,!0,n)&&(p?h=t.result:f=t.result),p||(kc(t,c,u,g,h,f,s,o),g=h=f=null),ur(t,!0,-1),I=t.input.charCodeAt(t.position)),t.lineIndent>e&&I!==0)_e(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return p&&kc(t,c,u,g,h,null),m&&(t.tag=a,t.anchor=l,t.kind="mapping",t.result=c),m}function uBe(t){var e,r=!1,i=!1,n,s,o;if(o=t.input.charCodeAt(t.position),o!==33)return!1;if(t.tag!==null&&_e(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(r=!0,o=t.input.charCodeAt(++t.position)):o===33?(i=!0,n="!!",o=t.input.charCodeAt(++t.position)):n="!",e=t.position,r){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(s=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):_e(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Di(o);)o===33&&(i?_e(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),Cj.test(n)||_e(t,"named tag handle cannot contain such characters"),i=!0,e=t.position+1)),o=t.input.charCodeAt(++t.position);s=t.input.slice(e,t.position),$ye.test(s)&&_e(t,"tag suffix cannot contain flow indicator characters")}return s&&!mj.test(s)&&_e(t,"tag name cannot contain such characters: "+s),r?t.tag=s:ta.call(t.tagMap,n)?t.tag=t.tagMap[n]+s:n==="!"?t.tag="!"+s:n==="!!"?t.tag="tag:yaml.org,2002:"+s:_e(t,'undeclared tag handle "'+n+'"'),!0}function gBe(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&_e(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!Di(r)&&!xc(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&_e(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function hBe(t){var e,r,i;if(i=t.input.charCodeAt(t.position),i!==42)return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;i!==0&&!Di(i)&&!xc(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&_e(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),ta.call(t.anchorMap,r)||_e(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],ur(t,!0,-1),!0}function vc(t,e,r,i,n){var s,o,a,l=1,c=!1,u=!1,g,h,f,p,m;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new nBe(t,e),i=t.indexOf("\0");for(i!==-1&&(r.position=i,_e(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;)fBe(r);return r.documents}function xj(t,e,r){e!==null&&typeof e=="object"&&typeof r=="undefined"&&(r=e,e=null);var i=Sj(t,r);if(typeof e!="function")return i;for(var n=0,s=i.length;n<s;n+=1)e(i[n])}function Pj(t,e){var r=Sj(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new gj("expected a single document in the stream, but found more")}}function pBe(t,e,r){return typeof e=="object"&&e!==null&&typeof r=="undefined"&&(r=e,e=null),xj(t,e,Zs.extend({schema:hj},r))}function dBe(t,e){return Pj(t,Zs.extend({schema:hj},e))}Uh.exports.loadAll=xj;Uh.exports.load=Pj;Uh.exports.safeLoadAll=pBe;Uh.exports.safeLoad=dBe});var $j=C((EXe,AS)=>{"use strict";var Hh=PA(),Yh=bc(),CBe=Kh(),mBe=Sc(),vj=Object.prototype.toString,Fj=Object.prototype.hasOwnProperty,IBe=9,qh=10,EBe=13,yBe=32,BBe=33,wBe=34,Rj=35,QBe=37,bBe=38,DBe=39,SBe=42,Lj=44,xBe=45,Nj=58,PBe=61,kBe=62,vBe=63,FBe=64,Mj=91,Oj=93,RBe=96,Tj=123,LBe=124,Kj=125,jr={};jr[0]="\\0";jr[7]="\\a";jr[8]="\\b";jr[9]="\\t";jr[10]="\\n";jr[11]="\\v";jr[12]="\\f";jr[13]="\\r";jr[27]="\\e";jr[34]='\\"';jr[92]="\\\\";jr[133]="\\N";jr[160]="\\_";jr[8232]="\\L";jr[8233]="\\P";var NBe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function MBe(t,e){var r,i,n,s,o,a,l;if(e===null)return{};for(r={},i=Object.keys(e),n=0,s=i.length;n<s;n+=1)o=i[n],a=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=t.compiledTypeMap.fallback[o],l&&Fj.call(l.styleAliases,a)&&(a=l.styleAliases[a]),r[o]=a;return r}function Uj(t){var e,r,i;if(e=t.toString(16).toUpperCase(),t<=255)r="x",i=2;else if(t<=65535)r="u",i=4;else if(t<=4294967295)r="U",i=8;else throw new Yh("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Hh.repeat("0",i-e.length)+e}function OBe(t){this.schema=t.schema||CBe,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Hh.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=MBe(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 Hj(t,e){for(var r=Hh.repeat(" ",e),i=0,n=-1,s="",o,a=t.length;i<a;)n=t.indexOf(`
`),m==="+"?f++:m==="-"?p++:m===" "&&(f++,p++);else break}if(!f&&h.newLines===1&&(h.newLines=0),!p&&h.oldLines===1&&(h.oldLines=0),e.strict){if(f!==h.newLines)throw new Error("Added line count did not match for hunk at line "+(c+1));if(p!==h.oldLines)throw new Error("Removed line count did not match for hunk at line "+(c+1))}return h}for(;s<r.length;)o();return n}});var w8=C(fP=>{"use strict";Object.defineProperty(fP,"__esModule",{value:!0});fP.default=$De;function $De(t,e,r){var i=!0,n=!1,s=!1,o=1;return function a(){if(i&&!s){if(n?o++:i=!1,t+o<=r)return o;s=!0}if(!n)return s||(i=!0),e<=t-o?-o++:(n=!0,a())}}});var D8=C($E=>{"use strict";Object.defineProperty($E,"__esModule",{value:!0});$E.applyPatch=Q8;$E.applyPatches=eSe;var b8=_E(),rSe=tSe(w8());function tSe(t){return t&&t.__esModule?t:{default:t}}function Q8(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string"&&(e=(0,b8.parsePatch)(e)),Array.isArray(e)){if(e.length>1)throw new Error("applyPatch only works with a single input.");e=e[0]}var i=t.split(/\r\n|[\n\v\f\r\x85]/),n=t.match(/\r\n|[\n\v\f\r\x85]/g)||[],s=e.hunks,o=r.compareLine||function(H,R,Pe,Le){return R===Le},a=0,l=r.fuzzFactor||0,c=0,u=0,g,h;function f(H,R){for(var Pe=0;Pe<H.lines.length;Pe++){var Le=H.lines[Pe],Ge=Le.length>0?Le[0]:" ",Te=Le.length>0?Le.substr(1):Le;if(Ge===" "||Ge==="-"){if(!o(R+1,i[R],Ge,Te)&&(a++,a>l))return!1;R++}}return!0}for(var p=0;p<s.length;p++){for(var m=s[p],I=i.length-m.oldLines,y=0,b=u+m.oldStart-1,x=(0,rSe.default)(b,c,I);y!==void 0;y=x())if(f(m,b+y)){m.offset=u+=y;break}if(y===void 0)return!1;c=m.offset+m.oldStart+m.oldLines}for(var F=0,N=0;N<s.length;N++){var U=s[N],v=U.oldStart+U.offset+F-1;F+=U.newLines-U.oldLines,v<0&&(v=0);for(var J=0;J<U.lines.length;J++){var oe=U.lines[J],T=oe.length>0?oe[0]:" ",A=oe.length>0?oe.substr(1):oe,W=U.linedelimiters[J];if(T===" ")v++;else if(T==="-")i.splice(v,1),n.splice(v,1);else if(T==="+")i.splice(v,0,A),n.splice(v,0,W),v++;else if(T==="\\"){var $=U.lines[J-1]?U.lines[J-1][0]:null;$==="+"?g=!0:$==="-"&&(h=!0)}}}if(g)for(;!i[i.length-1];)i.pop(),n.pop();else h&&(i.push(""),n.push(`
`);if(x.lines=F,x.added||x.removed){var N;if(!u){var U=a[b-1];u=f,g=p,U&&(h=o.context>0?l(U.lines.slice(-o.context)):[],u-=h.length,g-=h.length)}(N=h).push.apply(N,pP(F.map(function(re){return(x.added?"+":"-")+re}))),x.added?p+=F.length:f+=F.length}else{if(u)if(F.length<=o.context*2&&b<a.length-2){var v;(v=h).push.apply(v,pP(l(F)))}else{var J,oe=Math.min(F.length,o.context);(J=h).push.apply(J,pP(l(F.slice(0,oe))));var T={oldStart:u,oldLines:f-u+oe,newStart:g,newLines:p-g+oe,lines:h};if(b>=a.length-2&&F.length<=o.context){var A=/\n$/.test(r),W=/\n$/.test(i),$=F.length==0&&h.length>T.oldLines;!A&&$&&h.splice(T.oldLines,0,"\\ No newline at end of file"),(!A&&!$||!W)&&h.push("\\ No newline at end of file")}c.push(T),u=0,g=0,h=[]}f+=F.length,p+=F.length}},I=0;I<a.length;I++)m(I);return{oldFileName:t,newFileName:e,oldHeader:n,newHeader:s,hunks:c}}function x8(t,e,r,i,n,s,o){var a=S8(t,e,r,i,n,s,o),l=[];t==e&&l.push("Index: "+t),l.push("==================================================================="),l.push("--- "+a.oldFileName+(typeof a.oldHeader=="undefined"?"":" "+a.oldHeader)),l.push("+++ "+a.newFileName+(typeof a.newHeader=="undefined"?"":" "+a.newHeader));for(var c=0;c<a.hunks.length;c++){var u=a.hunks[c];l.push("@@ -"+u.oldStart+","+u.oldLines+" +"+u.newStart+","+u.newLines+" @@"),l.push.apply(l,u.lines)}return l.join(`
`)+`
`}function iSe(t,e,r,i,n,s){return x8(t,t,e,r,i,n,s)}});var k8=C(ey=>{"use strict";Object.defineProperty(ey,"__esModule",{value:!0});ey.arrayEqual=ASe;ey.arrayStartsWith=P8;function ASe(t,e){return t.length!==e.length?!1:P8(t,e)}function P8(t,e){if(e.length>t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}});var H8=C(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.calcLineCount=v8;ty.merge=lSe;var cSe=dP(),uSe=_E(),CP=k8();function ou(t){return fSe(t)||hSe(t)||gSe()}function gSe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function hSe(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function fSe(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function v8(t){var e=mP(t.lines),r=e.oldLines,i=e.newLines;r!==void 0?t.oldLines=r:delete t.oldLines,i!==void 0?t.newLines=i:delete t.newLines}function lSe(t,e,r){t=F8(t,r),e=F8(e,r);var i={};(t.index||e.index)&&(i.index=t.index||e.index),(t.newFileName||e.newFileName)&&(R8(t)?R8(e)?(i.oldFileName=ry(i,t.oldFileName,e.oldFileName),i.newFileName=ry(i,t.newFileName,e.newFileName),i.oldHeader=ry(i,t.oldHeader,e.oldHeader),i.newHeader=ry(i,t.newHeader,e.newHeader)):(i.oldFileName=t.oldFileName,i.newFileName=t.newFileName,i.oldHeader=t.oldHeader,i.newHeader=t.newHeader):(i.oldFileName=e.oldFileName||t.oldFileName,i.newFileName=e.newFileName||t.newFileName,i.oldHeader=e.oldHeader||t.oldHeader,i.newHeader=e.newHeader||t.newHeader)),i.hunks=[];for(var n=0,s=0,o=0,a=0;n<t.hunks.length||s<e.hunks.length;){var l=t.hunks[n]||{oldStart:Infinity},c=e.hunks[s]||{oldStart:Infinity};if(L8(l,c))i.hunks.push(N8(l,o)),n++,a+=l.newLines-l.oldLines;else if(L8(c,l))i.hunks.push(N8(c,a)),s++,o+=c.newLines-c.oldLines;else{var u={oldStart:Math.min(l.oldStart,c.oldStart),oldLines:0,newStart:Math.min(l.newStart+o,c.oldStart+a),newLines:0,lines:[]};pSe(u,l.oldStart,l.lines,c.oldStart,c.lines),s++,n++,i.hunks.push(u)}}return i}function F8(t,e){if(typeof t=="string"){if(/^@@/m.test(t)||/^Index:/m.test(t))return(0,uSe.parsePatch)(t)[0];if(!e)throw new Error("Must provide a base reference or pass in a patch");return(0,cSe.structuredPatch)(void 0,void 0,e,t)}return t}function R8(t){return t.newFileName&&t.newFileName!==t.oldFileName}function ry(t,e,r){return e===r?e:(t.conflict=!0,{mine:e,theirs:r})}function L8(t,e){return t.oldStart<e.oldStart&&t.oldStart+t.oldLines<e.oldStart}function N8(t,e){return{oldStart:t.oldStart,oldLines:t.oldLines,newStart:t.newStart+e,newLines:t.newLines,lines:t.lines}}function pSe(t,e,r,i,n){var s={offset:e,lines:r,index:0},o={offset:i,lines:n,index:0};for(O8(t,s,o),O8(t,o,s);s.index<s.lines.length&&o.index<o.lines.length;){var a=s.lines[s.index],l=o.lines[o.index];if((a[0]==="-"||a[0]==="+")&&(l[0]==="-"||l[0]==="+"))dSe(t,s,o);else if(a[0]==="+"&&l[0]===" "){var c;(c=t.lines).push.apply(c,ou(tl(s)))}else if(l[0]==="+"&&a[0]===" "){var u;(u=t.lines).push.apply(u,ou(tl(o)))}else a[0]==="-"&&l[0]===" "?M8(t,s,o):l[0]==="-"&&a[0]===" "?M8(t,o,s,!0):a===l?(t.lines.push(a),s.index++,o.index++):IP(t,tl(s),tl(o))}T8(t,s),T8(t,o),v8(t)}function dSe(t,e,r){var i=tl(e),n=tl(r);if(K8(i)&&K8(n)){if((0,CP.arrayStartsWith)(i,n)&&U8(r,i,i.length-n.length)){var s;(s=t.lines).push.apply(s,ou(i));return}else if((0,CP.arrayStartsWith)(n,i)&&U8(e,n,n.length-i.length)){var o;(o=t.lines).push.apply(o,ou(n));return}}else if((0,CP.arrayEqual)(i,n)){var a;(a=t.lines).push.apply(a,ou(i));return}IP(t,i,n)}function M8(t,e,r,i){var n=tl(e),s=CSe(r,n);if(s.merged){var o;(o=t.lines).push.apply(o,ou(s.merged))}else IP(t,i?s:n,i?n:s)}function IP(t,e,r){t.conflict=!0,t.lines.push({conflict:!0,mine:e,theirs:r})}function O8(t,e,r){for(;e.offset<r.offset&&e.index<e.lines.length;){var i=e.lines[e.index++];t.lines.push(i),e.offset++}}function T8(t,e){for(;e.index<e.lines.length;){var r=e.lines[e.index++];t.lines.push(r)}}function tl(t){for(var e=[],r=t.lines[t.index][0];t.index<t.lines.length;){var i=t.lines[t.index];if(r==="-"&&i[0]===
`),c=o.length;for(c>0&&o.includes("unstyle")&&(o=[...new Set(["unstyle",...o])].reverse());c-- >0;)a=r(t.styles[o[c]],a,l);return a},n=(s,o,a)=>{t.styles[s]=e({name:s,codes:o}),(t.keys[a]||(t.keys[a]=[])).push(s),Reflect.defineProperty(t,s,{configurable:!0,enumerable:!0,set(c){t.alias(s,c)},get(){let c=u=>i(u,c.stack);return Reflect.setPrototypeOf(c,t),c.stack=this.stack?this.stack.concat(s):[s],c}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=wTe,t.hasColor=t.hasAnsi=s=>(t.ansiRegex.lastIndex=0,typeof s=="string"&&s!==""&&t.ansiRegex.test(s)),t.alias=(s,o)=>{let a=typeof o=="string"?t[o]:o;if(typeof a!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");a.stack||(Reflect.defineProperty(a,"name",{value:s}),t.styles[s]=a,a.stack=[s]),Reflect.defineProperty(t,s,{configurable:!0,enumerable:!0,set(l){t.alias(s,l)},get(){let l=c=>i(c,l.stack);return Reflect.setPrototypeOf(l,t),l.stack=this.stack?this.stack.concat(a.stack):a.stack,l}})},t.theme=s=>{if(!BTe(s))throw new TypeError("Expected theme to be an object");for(let o of Object.keys(s))t.alias(o,s[o]);return t},t.alias("unstyle",s=>typeof s=="string"&&s!==""?(t.ansiRegex.lastIndex=0,s.replace(t.ansiRegex,"")):""),t.alias("noop",s=>s),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=DZ(),t.define=n,t};Uk.exports=SZ();Uk.exports.create=SZ});var Xr=C(ht=>{"use strict";var QTe=Object.prototype.toString,Bn=Hn(),xZ=!1,Hk=[],PZ={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};ht.longest=(t,e)=>t.reduce((r,i)=>Math.max(r,e?i[e].length:i.length),0);ht.hasColor=t=>!!t&&Bn.hasColor(t);var Jy=ht.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);ht.nativeType=t=>QTe.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"");ht.isAsyncFn=t=>ht.nativeType(t)==="asyncfunction";ht.isPrimitive=t=>t!=null&&typeof t!="object"&&typeof t!="function";ht.resolve=(t,e,...r)=>typeof e=="function"?e.call(t,...r):e;ht.scrollDown=(t=[])=>[...t.slice(1),t[0]];ht.scrollUp=(t=[])=>[t.pop(),...t];ht.reorder=(t=[])=>{let e=t.slice();return e.sort((r,i)=>r.index>i.index?1:r.index<i.index?-1:0),e};ht.swap=(t,e,r)=>{let i=t.length,n=r===i?0:r<0?i-1:r,s=t[e];t[e]=t[n],t[n]=s};ht.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};ht.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[1]),r};ht.wordWrap=(t,e={})=>{if(!t)return t;typeof e=="number"&&(e={width:e});let{indent:r="",newline:i=`
`+r,width:n=80}=e;n-=((i+r).match(/[^\S\n]/g)||[]).length;let o=`.{1,${n}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,a=t.trim(),l=new RegExp(o,"g"),c=a.match(l)||[];return c=c.map(u=>u.replace(/\n$/,"")),e.padEnd&&(c=c.map(u=>u.padEnd(n," "))),e.padStart&&(c=c.map(u=>u.padStart(n," "))),r+c.join(i)};ht.unmute=t=>{let e=t.stack.find(i=>Bn.keys.color.includes(i));return e?Bn[e]:t.stack.find(i=>i.slice(2)==="bg")?Bn[e.slice(2)]:i=>i};ht.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"";ht.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>Bn.keys.color.includes(i));if(e){let i=Bn["bg"+ht.pascal(e)];return i?i.black:t}let r=t.stack.find(i=>i.slice(0,2)==="bg");return r?Bn[r.slice(2).toLowerCase()]||t:Bn.none};ht.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(i=>Bn.keys.color.includes(i)),r=t.stack.find(i=>i.slice(0,2)==="bg");if(e&&!r)return Bn[PZ[e]||e];if(r){let i=r.slice(2).toLowerCase(),n=PZ[i];return n&&Bn["bg"+ht.pascal(n)]||t}return Bn.none};ht.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),i=e>=12?"pm":"am";e=e%12;let n=e===0?12:e,s=r<10?"0"+r:r;return n+":"+s+" "+i};ht.set=(t={},e="",r)=>e.split(".").reduce((i,n,s,o)=>{let a=o.length-1>s?i[n]||{}:r;return!ht.isObject(a)&&s<o.length-1&&(a={}),i[n]=a},t);ht.get=(t={},e="",r)=>{let i=t[e]==null?e.split(".").reduce((n,s)=>n&&n[s],t):t[e];return i==null?r:i};ht.mixin=(t,e)=>{if(!Jy(t))return e;if(!Jy(e))return t;for(let r of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(i.hasOwnProperty("value"))if(t.hasOwnProperty(r)&&Jy(i.value)){let n=Object.getOwnPropertyDescriptor(t,r);Jy(n.value)?t[r]=ht.merge({},t[r],e[r]):Reflect.defineProperty(t,r,i)}else Reflect.defineProperty(t,r,i);else Reflect.defineProperty(t,r,i)}return t};ht.merge=(...t)=>{let e={};for(let r of t)ht.mixin(e,r);return e};ht.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let i of Object.keys(r)){let n=r[i];typeof n=="function"?ht.define(t,i,n.bind(e)):ht.define(t,i,n)}};ht.onExit=t=>{let e=(r,i)=>{xZ||(xZ=!0,Hk.forEach(n=>n()),r===!0&&process.exit(128+i))};Hk.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),Hk.push(t)};ht.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};ht.defineExport=(t,e,r)=>{let i;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(n){i=n},get(){return i?i():r()}})}});var kZ=C(Du=>{"use strict";Du.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"};Du.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};Du.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};Du.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};Du.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 RZ=C((dot,vZ)=>{"use strict";var FZ=require("readline"),bTe=kZ(),DTe=/^(?:\x1b)([a-zA-Z0-9])$/,STe=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,xTe={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",
`:" ",i=[];for(let n=0;n<4;n++){let s=r(n);e[n]?i.push(s.repeat(e[n])):i.push("")}return i}XZ.exports=zy});var e_=C((wot,_Z)=>{"use strict";var jTe=Xr(),$Z={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 $Z.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}};_Z.exports=(t,e={})=>{let r=jTe.merge({},$Z,e.roles);return r[t]||r.default}});var ap=C((Qot,t_)=>{"use strict";var JTe=Hn(),WTe=Su(),zTe=e_(),Vy=Xr(),{reorder:Xk,scrollUp:VTe,scrollDown:XTe,isObject:r_,swap:ZTe}=Vy,i_=class extends WTe{constructor(e){super(e);this.cursorHide(),this.maxSelected=e.maxSelected||Infinity,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:r,autofocus:i,suggest:n}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(s=>s.enabled=!1),typeof n!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");r_(r)&&(r=Object.keys(r)),Array.isArray(r)?(i!=null&&(this.index=this.findIndex(i)),r.forEach(s=>this.enable(this.find(s))),await this.render()):(i!=null&&(r=i),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){this.state.loadingChoices=!0;let i=[],n=0,s=async(o,a)=>{typeof o=="function"&&(o=await o.call(this)),o instanceof Promise&&(o=await o);for(let l=0;l<o.length;l++){let c=o[l]=await this.toChoice(o[l],n++,a);i.push(c),c.choices&&await s(c.choices,c)}return i};return s(e,r).then(o=>(this.state.loadingChoices=!1,o))}async toChoice(e,r,i){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let n=e.value;if(e=zTe(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,Vy.define(e,"parent",i),e.level=i?i.level+1:1,e.indent==null&&(e.indent=i?i.indent+" ":e.indent||""),e.path=i?i.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,JTe.unstyle(e.message).length));let o=P({},e);return e.reset=(a=o.input,l=o.value)=>{for(let c of Object.keys(o))e[c]=o[c];e.input=a,e.value=l},n==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,r)),e}async onChoice(e,r){this.emit("choice",e,r,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,r)}async addChoice(e,r,i){let n=await this.toChoice(e,r,i);return this.choices.push(n),this.index=this.choices.length-1,this.limit=this.choices.length,n}async newItem(e,r,i){let n=P({name:"New choice name?",editable:!0,newChoice:!0},e),s=await this.addChoice(n,r,i);return s.updateChoice=()=>{delete s.newChoice,s.name=s.message=s.input,s.input="",s.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,r){if(this.mul
`).map(b=>" "+b),I=s.length,y=0;for(let b of s)g.invalid.has(b.name)&&b.lines.forEach(x=>{m[x][0]===" "&&(m[x]=g.styles.danger(g.symbols.bullet)+m[x].slice(1))}),t.isValue(g.values[b.name])&&y++;return g.completed=(y/I*100).toFixed(0),g.output=m.join(`
`)),this.write(this.margin[2]),this.restore()}};f$.exports=p$});var I$=C((Xot,C$)=>{"use strict";var MKe=Ea(),m$=class extends MKe{constructor(e){super(e);if(typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,r){let i=await super.toChoices(e,r);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};C$.exports=m$});var y$=C(nv=>{"use strict";var E$=Xr(),wr=(t,e)=>{E$.defineExport(nv,t,e),E$.defineExport(nv,t.toLowerCase(),e)};wr("AutoComplete",()=>l_());wr("BasicAuth",()=>C_());wr("Confirm",()=>B_());wr("Editable",()=>b_());wr("Form",()=>Xy());wr("Input",()=>tv());wr("Invisible",()=>N_());wr("List",()=>T_());wr("MultiSelect",()=>H_());wr("Numeral",()=>j_());wr("Password",()=>z_());wr("Scale",()=>__());wr("Select",()=>Ea());wr("Snippet",()=>s$());wr("Sort",()=>A$());wr("Survey",()=>u$());wr("Text",()=>h$());wr("Toggle",()=>d$());wr("Quiz",()=>I$())});var w$=C((_ot,B$)=>{B$.exports={ArrayPrompt:ap(),AuthPrompt:ev(),BooleanPrompt:Zy(),NumberPrompt:rv(),StringPrompt:gl()}});var lp=C(($ot,Q$)=>{"use strict";var b$=require("assert"),sv=require("events"),ya=Xr(),Is=class extends sv{constructor(e,r){super();this.options=ya.merge({},e),this.answers=P({},r)}register(e,r){if(ya.isObject(e)){for(let n of Object.keys(e))this.register(n,e[n]);return this}b$.equal(typeof r,"function","expected a function");let i=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[i]=r:this.prompts[i]=r(this.Prompt,this),this}async prompt(e=[]){for(let r of[].concat(e))try{typeof r=="function"&&(r=await r.call(this)),await this.ask(ya.merge({},this.options,r))}catch(i){return Promise.reject(i)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let r=ya.merge({},this.options,e),{type:i,name:n}=e,{set:s,get:o}=ya;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[n];b$(this.prompts[i],`Prompt"${i}"isnotregistered`);let a=new this.prompts[i](r),l=o(this.answers,n);a.state.answers=this.answers,a.enquirer=this,n&&a.on("submit",u=>{this.emit("answer",n,u,a),s(this.answers,n,u)});let c=a.emit.bind(a);return a.emit=(...u)=>(this.emit.call(this,...u),c(...u)),this.emit("prompt",a,this),r.autofill&&l!=null?(a.value=a.input=l,r.autofill==="show"&&await a.submit()):l=a.value=await a.run(),l}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||Su()}static get prompts(){return y$()}static get types(){return w$()}static get prompt(){let e=(r,...i)=>{let n=new this(...i),s=n.emit.bind(n);return n.emit=(...o)=>(e.emit(...o),s(...o)),n.prompt(r)};return ya.mixinEmitter(e,new sv),e}};ya.mixinEmitter(Is,new sv);var ov=Is.prompts;for(let t of Object.keys(ov)){let e=t.toLowerCase(),r=i=>new ov[t](i).run();Is.prompt[e]=r,Is[e]=r,Is[t]||Reflect.defineProperty(Is,t,{get:()=>ov[t]})}var Ap=t=>{ya.defineExport(Is,t,()=>Is.types[t])};Ap("ArrayPrompt");Ap("AuthPrompt");Ap("BooleanPrompt");Ap("NumberPrompt");Ap("StringPrompt");Q$.exports=Is});var M$=C((Hat,N$)=>{function UKe(t,e){for(var r=-1,i=t==null?0:t.length;++r<i&&e(t[r],r,t)!==!1;);return t}N$.exports=UKe});var Pu=C((Yat,O$)=>{var HKe=ay(),YKe=gu();function qKe(t,e,r,i){var n=!r;r||(r={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=i?i(r[a],t[a],a,r,t):void 0;l===void 0&&(l=t[a]),n?YKe(r,a,l):HKe(r,a,l)}return r}O$.exports=qKe});var K$=C((qat,T$)=>{var GKe=Pu(),jKe=Cu();function JKe(t,e){return t&&GKe(e,jKe(e),t)}T$.exports=JKe});var H$=C((Gat,U$)=>{function WKe(t)
`,f}function Fqe(t,e){return e.fs_.chmod(t,493)}function UF(t){if(!t)return{win32:"",posix:""};let e=typeof t=="string"?t.split(wn.delimiter):Array.from(t),r={};for(let i=0;i<e.length;i++){let n=e[i].split("/").join("\\"),s=Oie()?e[i].split("\\").join("/").replace(/^([^:\\/]*):/,(o,a)=>`/mnt/${a.toLowerCase()}`):e[i];r.win32=r.win32?`${r.win32};${n}`:n,r.posix=r.posix?`${r.posix}:${s}`:s,r[i]={win32:n,posix:s}}return r}Mie.exports=KF});var oR=C((UEt,rne)=>{rne.exports=require("stream")});var one=C((HEt,ine)=>{"use strict";function nne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function $qe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?nne(Object(r),!0).forEach(function(i){_qe(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nne(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function _qe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eGe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sne(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function tGe(t,e,r){return e&&sne(t.prototype,e),r&&sne(t,r),t}var rGe=require("buffer"),pB=rGe.Buffer,iGe=require("util"),aR=iGe.inspect,nGe=aR&&aR.custom||"inspect";function sGe(t,e,r){pB.prototype.copy.call(t,e,r)}ine.exports=function(){function t(){eGe(this,t),this.head=null,this.tail=null,this.length=0}return tGe(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return pB.alloc(0);for(var i=pB.allocUnsafe(r>>>0),n=this.head,s=0;n;)sGe(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,s=i.data;for(r-=s.length;i=i.next;){var o=i.data,a=r>o.length?o.length:r;if(a===o.length?s+=o:s+=o.slice(0,r),r-=a,r===0){a===o.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(r){var i=pB.allocUnsafe(r),n=this.head,s=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var o=n.data,a=r>o.length?o.length:r;if(o.copy(i,i.length-r,0,a),r-=a,r===0){a===o.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++s}return this.length-=s,i}},{key:nGe,value:function(r,i){return aR(this,$qe({},i,{depth:0,customInspect:!1}))}}]),t}()});var lR=C((YEt,ane)=>{"use strict";function oGe(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(AR,this,t)):process.nextTick(AR,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(
`)),t.linkname&&(e+=TR(" linkpath="+t.linkname+`
`));var r=t.pax;if(r)for(var i in r)e+=TR(" "+i+"="+r[i]+`
`);return Buffer.from(e)};Wu.decodePax=function(t){for(var e={};t.length;){for(var r=0;r<t.length&&t[r]!==32;)r++;var i=parseInt(t.slice(0,r).toString(),10);if(!i)return e;var n=t.slice(r+1,i-1).toString(),s=n.indexOf("=");if(s===-1)return e;e[n.slice(0,s)]=n.slice(s+1),t=t.slice(i)}return e};Wu.encode=function(t){var e=eJe(512),r=t.name,i="";if(t.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var n=r.indexOf("/");if(n===-1)return null;i+=i?"/"+r.slice(0,n):r.slice(0,n),r=r.slice(n+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(i)>155||t.linkname&&Buffer.byteLength(t.linkname)>100?null:(e.write(r),e.write(Ma(t.mode&oJe,6),100),e.write(Ma(t.uid,6),108),e.write(Ma(t.gid,6),116),e.write(Ma(t.size,11),124),e.write(Ma(t.mtime.getTime()/1e3|0,11),136),e[156]=Ase+lJe(t.type),t.linkname&&e.write(t.linkname,157),lse.copy(e,hd),iJe.copy(e,OR),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(Ma(t.devmajor||0,6),329),e.write(Ma(t.devminor||0,6),337),i&&e.write(i,345),e.write(Ma(use(e),6),148),e)};Wu.decode=function(t,e,r){var i=t[156]===0?0:t[156]-Ase,n=zu(t,0,100,e),s=Oa(t,100,8),o=Oa(t,108,8),a=Oa(t,116,8),l=Oa(t,124,12),c=Oa(t,136,12),u=AJe(i),g=t[157]===0?null:zu(t,157,100,e),h=zu(t,265,32),f=zu(t,297,32),p=Oa(t,329,8),m=Oa(t,337,8),I=use(t);if(I===8*32)return null;if(I!==Oa(t,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(lse.compare(t,hd,hd+6)===0)t[345]&&(n=zu(t,345,155,e)+"/"+n);else if(!(nJe.compare(t,hd,hd+6)===0&&sJe.compare(t,OR,OR+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return i===0&&n&&n[n.length-1]==="/"&&(i=5),{name:n,mode:s,uid:o,gid:a,size:l,mtime:new Date(1e3*c),type:u,linkname:g,uname:h,gname:f,devmajor:p,devminor:m}}});var mse=C((Ayt,gse)=>{var hse=require("util"),uJe=ase(),fd=KR(),fse=Ju().Writable,pse=Ju().PassThrough,dse=function(){},Cse=function(t){return t&=511,t&&512-t},gJe=function(t,e){var r=new vB(t,e);return r.end(),r},hJe=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},vB=function(t,e){this._parent=t,this.offset=e,pse.call(this,{autoDestroy:!1})};hse.inherits(vB,pse);vB.prototype.destroy=function(t){this._parent.destroy(t)};var yo=function(t){if(!(this instanceof yo))return new yo(t);fse.call(this,t),t=t||{},this._offset=0,this._buffer=uJe(),this._missing=0,this._partial=!1,this._onparse=dse,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var e=this,r=e._buffer,i=function(){e._continue()},n=function(h){if(e._locked=!1,h)return e.destroy(h);e._stream||i()},s=function(){e._stream=null;var h=Cse(e._header.size);h?e._parse(h,o):e._parse(512,g),e._locked||i()},o=function(){e._buffer.consume(Cse(e._header.size)),e._parse(512,g),i()},a=function(){var h=e._header.size;e._paxGlobal=fd.decodePax(r.slice(0,h)),r.consume(h),s()},l=function(){var h=e._header.size;e._pax=fd.decodePax(r.slice(0,h)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),r.consume(h),s()},c=function(){var h=e._header.size;this._gnuLongPath=fd.decodeLongPath(r.slice(0,h),t.filenameEncoding),r.consume(h),s()},u=function(){var h=e._header.size;this._gnuLongLinkPath=fd.decodeLongPath(r.slice(0,h),t.filenameEncoding),r.consume(h),s()},g=function(){var h=e._offset,f;try{f=e._header=fd.decode(r.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(p){e.emit("error",p)}if(r.consume(512),!f){e._parse(512,g),i();return}if(f.type==="gnu-long-path"){e._parse(f.size,c),i();return}if(f.type==="gnu-long-link-path"){e._parse(f.size,u),i();return}if(f.type==="pax-global-header"){e._parse(f.size,a),i();return}if(f.type==="pax-header"){e._parse(f.size,l),i();return}if(e._gnuLongPath&&(f.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(f.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=f=hJe(f,e._pax),e
-${kC(r)}`).join("")}`)}functionvC(t,e,r){if(typeofr=="undefined")returne;leti=[],n=[],s=a=>{letl=e;returne=a,s.bind(null,l)};if(!r(e,{errors:i,coercions:n,coercion:s}))throwTg(`Invalid value for ${t}`,i);for(let[,a]ofn)a();returne}varfe=class{constructor(){this.help=!1}staticUsage(e){returne}asynccatch(e){throwe}asyncvalidateAndExecute(){letr=this.constructor.schema;if(typeofr!="undefined"){let{isDict:n,isUnknown:s,applyCascade:o}=awaitPromise.resolve().then(()=>(Mo(),Hl)),a=o(n(s()),r),l=[],c=[];if(!a(this,{errors:l,coercions:c}))throwTg("Invalid option schema",l);for(let[,g]ofc)g()}leti=awaitthis.execute();returntypeofi!="undefined"?i:0}};fe.isOption=Og;fe.Default=[];functionEi(t){QM&&console.log(t)}varLM={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:Ul};functionNM(){return{nodes:[ri(),ri(),ri()]}}functionqAe(t){lete=NM(),r=[],i=e.nodes.length;for(letnoft){r.push(i);for(lets=0;s<n.nodes.length;++s)MM(s)||e.nodes.push(YAe(n.nodes[s],i));i+=n.nodes.length-2}for(letnofr)ql(e,$a,n);returne}functionkn(t,e){returnt.nodes.push(e),t.nodes.length-1}functionGAe(t){lete=newSet,r=i=>{if(e.has(i))return;e.add(i);letn=t.nodes[i];for(letoofObject.values(n.statics))for(let{to:a}ofo)r(a);for(let[,{to:o}]ofn.dynamics)r(o);for(let{to:o}ofn.shortcuts)r(o);lets=newSet(n.shortcuts.map(({to:o})=>o));for(;n.shortcuts.length>0;){let{to:o}=n.shortcuts.shift(),a=t.nodes[o];for(let[l,c]ofObject.entries(a.statics)){letu=Object.prototype.hasOwnProperty.call(n.statics,l)?n.statics[l]:n.statics[l]=[];for(letgofc)u.some(({to:h})=>g.to===h)||u.push(g)}for(let[l,c]ofa.dynamics)n.dynamics.some(([u,{to:g}])=>l===u&&c.to===g)||n.dynamics.push([l,c]);for(letlofa.shortcuts)s.has(l.to)||(n.shortcuts.push(l),s.add(l.to))}};r($a)}functionjAe(t,{prefix:e=""}={}){Ei(`${e}Nodes are:`);for(letr=0;r<t.nodes.length;++r)Ei(`${e}${r}: ${JSON.stringify(t.nodes[r])}`)}functionOM(t,e,r=!1){Ei(`Running a vm on ${JSON.stringify(e)}`);leti=[{node:$a,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null}}];jAe(t,{prefix:" "});letn=[eQ,...e];for(lets=0;s<n.length;++s){leto=n[s];Ei(` Processing ${JSON.stringify(o)}`);leta=[];for(let{node:l,state:c}ofi){Ei(` Current node is ${l}`);letu=t.nodes[l];if(l===ei){a.push({node:l,state:c});continue}console.assert(u.shortcuts.length===0,"Shortcuts should have been eliminated by now");letg=Object.prototype.hasOwnProperty.call(u.statics,o);if(!r||s<n.length-1||g)if(g){leth=u.statics[o];for(let{to:f,reducer:p}ofh)a.push({node:f,state:typeofp!="undefined"?RC(cQ,p,c,o):c}),Ei(` Static transition to ${f} found`)}elseEi(" No static transition found");else{leth=!1;for(letfofObject.keys(u.statics))if(!!f.startsWith(o)){if(o===f)for(let{to:p,reducer:m}ofu.statics[f])a.push({node:p,state:typeofm!="undefined"?RC(cQ,m,c,o):c}),Ei(` Static transition to ${p} found`);elsefor(let{to:p}ofu.statics[f])a.push({node:p,state:V(P({},c),{remainder:f.slice(o.length)})}),Ei(` Static transition to ${p} found (partial match)`);h=!0}h||Ei(" No partial static transition found")}if(o!==Fr)for(let[h,{to:f,reducer:p}]ofu.dynamics)RC(LC,h,c,o)&&(a.push({node:f,state:typeofp!="undefined"?RC(cQ,p,c,o):c}),Ei(` Dynamic transition to ${f} found (via ${h})`))}if(a.length===0&&o===Fr&&e.length===1)return[{node:$a,state:LM}];if(a.length===0)thrownewMg(e,i.filter(({node:l})=>l!==ei).map(({state:l})=>({usage:l.candidateUsage,reason:null})));if(a.every(({node:l})=>l===ei))thrownewMg(e,a.map(({state:l})=>({usage:l.candidateUsage,reason:l.errorMessage})));i=JAe(a)}if(i.length>0){Ei(" Results:");for(letsofi)Ei(` - ${s.node} -> ${JSON.stringify(s.state)}`)}elseEi(" No results");returni}functionWAe(t,e){if(e.selectedIndex!==null)return!0;if(Object.prototype.hasOwnProperty.call(t.statics,Fr)){for(let{to:r}oft.statics[Fr])if(r===Ng)return!0}return!1}functionVAe(t,
`:""}var Ug=class extends fe{constructor(e){super();this.contexts=e,this.commands=[]}static from(e,r){let i=new Ug(r);i.path=e.path;for(let n of e.options)switch(n.name){case"-c":i.commands.push(Number(n.value));break;case"-i":i.index=Number(n.value);break}return i}async execute(){let e=this.commands;if(typeof this.index!="undefined"&&this.index>=0&&this.index<e.length&&(e=[e[this.index]]),e.length===0)this.context.stdout.write(this.cli.usage());else if(e.length===1)this.context.stdout.write(this.cli.usage(this.contexts[e[0]].commandClass,{detailed:!0}));else if(e.length>1){this.context.stdout.write(`Multiplecommandsmatchyourselection:
`),this.context.stdout.write(`
`);let r=0;for(let i of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[i].commandClass,{prefix:`${r++}.`.padStart(5)}));this.context.stdout.write(`
`;for(let g of l){let h=a.get(g).slice().sort((p,m)=>p.usage.localeCompare(m.usage,"en",{usage:"sort",caseFirst:"upper"})),f=g!==null?g.trim():"General commands";o+=`
`,o+=rn("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 o}error(e,r){var i,{colored:n,command:s=(i=e[YM])!==null&&i!==void 0?i:null}=r===void 0?{}:r;e instanceof Error||(e=new Error(`Executionfailedwithanon-errorrejection(rejectedvalue:${JSON.stringify(e)})`));let o="",a=e.name.replace(/([a-z])([A-Z])/g,"$1 $2");a==="Error"&&(a="Internal Error"),o+=`${this.format(n).error(a)}:${e.message}
`)}};OC.paths=[["-v"],["--version"]];var j={};$e(j,{Array:()=>qM,Boolean:()=>GM,Counter:()=>jM,Proxy:()=>JM,Rest:()=>WM,String:()=>zM,applyValidator:()=>vC,cleanValidationError:()=>kC,formatError:()=>Tg,isOptionSymbol:()=>Og,makeCommandOption:()=>ti,rerouteArguments:()=>Zn});function qM(t,e,r){let[i,n]=Zn(e,r!=null?r:{}),{arity:s=1}=n,o=t.split(","),a=new Set(o);return ti({definition(l){l.addOption({names:o,arity:s,hidden:n==null?void 0:n.hidden,description:n==null?void 0:n.description,required:n.required})},transformer(l,c,u){let g=typeof i!="undefined"?[...i]:void 0;for(let{name:h,value:f}of u.options)!a.has(h)||(g=g!=null?g:[],g.push(f));return g}})}function GM(t,e,r){let[i,n]=Zn(e,r!=null?r:{}),s=t.split(","),o=new Set(s);return ti({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:h}of c.options)!o.has(g)||(u=h);return u}})}function jM(t,e,r){let[i,n]=Zn(e,r!=null?r:{}),s=t.split(","),o=new Set(s);return ti({definition(a){a.addOption({names:s,allowBinding:!1,arity:0,hidden:n.hidden,description:n.description,required:n.required})},transformer(a,l,c){let u=i;for(let{name:g,value:h}of c.options)!o.has(g)||(u!=null||(u=0),h?u+=1:u=0);return u}})}function JM(t={}){return ti({definition(e,r){var i;e.addProxy({name:(i=t.name)!==null&&i!==void 0?i:r,required:t.required})},transformer(e,r,i){return i.positionals.map(({value:n})=>n)}})}function WM(t={}){return ti({definition(e,r){var i;e.addRest({name:(i=t.name)!==null&&i!==void 0?i:r,required:t.required})},transformer(e,r,i){let n=o=>{let a=i.positionals[o];return a.extra===Ti||a.extra===!1&&o<e.arity.leading.length},s=0;for(;s<i.positionals.length&&n(s);)s+=1;return i.positionals.splice(0,s).map(({value:o})=>o)}})}function ele(t,e,r){let[i,n]=Zn(e,r!=null?r:{}),{arity:s=1}=n,o=t.split(","),a=new Set(o);return ti({definition(l){l.addOption({names:o,arity:n.tolerateBoolean?0:s,hidden:n.hidden,description:n.description,required:n.required})},transformer(l,c,u){let g,h=i;for(let{name:f,value:p}of u.options)!a.has(f)||(g=f,h=p);return typeof h=="string"?vC(g!=null?g:c,h,n.validator):h}})}function tle(t={}){let{required:e=!0}=t;return ti({definition(r,i){var n;r.addPositional({name:(n=t.name)!==null&&n!==void 0?n:i,required:t.required})},transformer(r,i,n){for(let s=0;s<n.positionals.length;++s){if(n.positionals[s].extra===Ti||e&&n.positionals[s].extra===!0||!e&&n.positionals[s].extra===!1)continue;let[o]=n.positionals.splice(s,1);return o.value}}})}function zM(t,...e){return typeof t=="string"?ele(t,...e):tle(t)}var iT=te(sn()),kQ=te(require("stream"));function dce(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vQ(t){}function FQ(t){throw new Error(`Assertionfailed:Unexpectedobject'${t}'`)}function Cce(t,e){if(!Object.values(t).includes(e))throw new Error("Assertion failed: Invalid value for enumeration");return e}function nA(t,e){let r=[];for(let i of t){let n=e(i);n!==nT&&r.push(n)}return r}var nT=Symbol();nA.skip=nT;function oT(t,e){for(let r of t){let i=e(r);if(i!==sT)return i}}var sT=Symbol();oT.skip=sT;function RQ(t){return typeof t=="object"&&t!==null}function GC(t){if(t instanceof Map&&(t=Object.fromEntries(t)),RQ(t))for(let e of Object.keys(t)){let r=t[e];RQ(r)&&(t[e]=GC(r))}return t}function Ms(t,e,r){let i=t.get(e);return typeof i=="undefined"&&t.set(e,i=r()),i}function Jl(t,e){let r=t.get(e);return typeof r=="undefined"&&t.set(e,r=[]),r}function sA(t,e){let r=t.get(e);return typeof r=="undefined"&&t.set(e,r=new Set),r}function Wl(t,e){let r=t.get(e);return typeof r=="undefined"&&t.set(e,r=new Map),r}async function mce(t,e){if(e==null)return await t();try{return await t()}finally{await e()}}async function jC(t,e){try{return await t()}catch(r){throw r.message=e(r.message),r}}function Jg(t,e){try{return t()}catch(r){throw r.message=e(r.message),r}}async function Wg(t){return await new Promise((e,r)=>{let i=[];t.on("error",n=>{r(n)}),t.on("data",n=>{i.push(n)}),t.on("end",()=>{e(Buffer.concat(i))})})}var aT=class extends kQ.Transform{
`),a!==-1){let l=n+o.substr(0,a);o=o.substr(a+1),n="",e!==null?this.reportInfo(null,`${e}${l}`):this.reportInfo(null,l)}while(a!==-1);n+=o}),r.on("end",()=>{let s=i.end();s!==""&&(e!==null?this.reportInfo(null,`${e}${s}`):this.reportInfo(null,s))}),r}};var Pq=te(sI()),kq=new Map,vq=new Map,cIe=new xq.Agent({keepAlive:!0}),uIe=new Sq.Agent({keepAlive:!0});function Fq(t){let e=new oI.URL(t),r={host:e.hostname,headers:{}};return e.port&&(r.port=Number(e.port)),{proxy:r}}async function gIe(t){return Ms(vq,t,()=>M.readFilePromise(t).then(e=>(vq.set(t,e),e)))}function hIe({statusCode:t,statusMessage:e},r){let i=je(r,t,ke.NUMBER),n=`https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/${t}`;return oc(r,`${i}${e?` (${e})`:""}`,n)}async function aI(t,{configuration:e,customErrorMessage:r}){var i,n;try{return await t}catch(s){if(s.name!=="HTTPError")throw s;let o=(n=r==null?void 0:r(s))!=null?n:(i=s.response.body)==null?void 0:i.error;o==null&&(s.message.startsWith("Response code")?o="The remote server failed to provide the requested resource":o=s.message),s instanceof Dq.TimeoutError&&s.event==="socket"&&(o+=`(can be increased via ${je(e,"httpTimeout",ke.SETTING)})`);let a=new Ze(z.NETWORK_ERROR,o,l=>{s.response&&l.reportError(z.NETWORK_ERROR,` ${EA(e,{label:"Response Code",value:IA(ke.NO_HINT,hIe(s.response,e))})}`),s.request&&(l.reportError(z.NETWORK_ERROR,` ${EA(e,{label:"Request Method",value:IA(ke.NO_HINT,s.request.options.method)})}`),l.reportError(z.NETWORK_ERROR,` ${EA(e,{label:"Request URL",value:IA(ke.URL,s.request.requestUrl)})}`)),s.request.redirects.length>0&&l.reportError(z.NETWORK_ERROR,` ${EA(e,{label:"Request Redirects",value:IA(ke.NO_HINT,u0(e,s.request.redirects,ke.URL))})}`),s.request.retryCount===s.request.options.retry.limit&&l.reportError(z.NETWORK_ERROR,` ${EA(e,{label:"Request Retry Count",value:IA(ke.NO_HINT,`${je(e,s.request.retryCount,ke.NUMBER)} (can be increased via ${je(e,"httpRetry",ke.SETTING)})`)})}`)});throw a.originalError=s,a}}function Rq(t,e){let r=[...e.configuration.get("networkSettings")].sort(([o],[a])=>a.length-o.length),i={enableNetwork:void 0,caFilePath:void 0,httpProxy:void 0,httpsProxy:void 0},n=Object.keys(i),s=typeof t=="string"?new oI.URL(t):t;for(let[o,a]of r)if(DD.default.isMatch(s.hostname,o))for(let l of n){let c=a.get(l);c!==null&&typeof i[l]=="undefined"&&(i[l]=c)}for(let o of n)typeof i[o]=="undefined"&&(i[o]=e.configuration.get(o));return i}var BA;(function(n){n.GET="GET",n.PUT="PUT",n.POST="POST",n.DELETE="DELETE"})(BA||(BA={}));async function vh(t,e,{configuration:r,headers:i,jsonRequest:n,jsonResponse:s,method:o=BA.GET}){let a=typeof t=="string"?new oI.URL(t):t,l=Rq(a,{configuration:r});if(l.enableNetwork===!1)throw new Error(`Request to '${a.href}' has been blocked because of your configuration settings`);if(a.protocol==="http:"&&!DD.default.isMatch(a.hostname,r.get("unsafeHttpWhitelist")))throw new Error(`Unsafe http requests must be explicitly whitelisted in your configuration (${a.hostname})`);let u={agent:{http:l.httpProxy?SD.default.httpOverHttp(Fq(l.httpProxy)):cIe,https:l.httpsProxy?SD.default.httpsOverHttp(Fq(l.httpsProxy)):uIe},headers:i,method:o};u.responseType=s?"json":"buffer",e!==null&&(Buffer.isBuffer(e)||!n&&typeof e=="string"?u.body=e:u.json=e);let g=r.get("httpTimeout"),h=r.get("httpRetry"),f=r.get("enableStrictSsl"),p=l.caFilePath,{default:m}=await Promise.resolve().then(()=>te(sI())),I=p?await gIe(p):void 0,y=m.extend(P({timeout:{socket:g},retry:h,https:{rejectUnauthorized:f,certificateAuthority:I}},u));return r.getLimit("networkConcurrency")(()=>y(a))}async function fIe(t,n){var s=n,{configuration:e,jsonResponse:r}=s,i=vr(s,["configuration","jsonResponse"]);let o=Ms(kq,t,()=>aI(vh(t,null,P({configuration:e},i)),{configuration:e}).then(a=>(kq.set(t,a.body),a.body)));return Buffer.isBuffer(o)===!1&&(o=await o),r?JSON.parse(o.toString()):o}async function pIe(t,e,n){var s=n,{customErrorMessage:r}=s,i=vr(s,["customErrorMessage"]);return(await aI(vh(t,e,V(P({},i),{method:BA.PUT})),i)).body}async function xD(t,e,n){var s=n,{customErrorMessage:r
`),p.end()}),p});break;case"<&":o.push(()=>QJ(Number(t[f]),1,r));break;case">":case">>":{let p=B.resolve(r.cwd,L.toPortablePath(t[f]));p==="/dev/null"?a.push(new hn.Writable({autoDestroy:!0,emitClose:!0,write(m,I,y){setImmediate(y)}})):a.push(e.baseFs.createWriteStream(p,u===">>"?{flags:"a"}:void 0))}break;case">&":a.push(QJ(Number(t[f]),2,r));break;default:throw new Error(`Assertionfailed:Unsupportedredirectiontype:"${u}"`)}}if(o.length>0){let u=new hn.PassThrough;i=u;let g=h=>{if(h===o.length)u.end();else{let f=o[h]();f.pipe(u,{end:!1}),f.on("end",()=>{g(h+1)})}};g(0)}if(a.length>0){let u=new hn.PassThrough;n=u;for(let g of a)u.pipe(g)}let c=await KI(Wh(t.slice(l+1),e,r),{stdin:new Mn(i),stdout:new Mn(n),stderr:new Mn(s)}).run();return await Promise.all(a.map(u=>new Promise((g,h)=>{u.on("error",f=>{h(f)}),u.on("close",()=>{g()}),u.end()}))),c}]]);async function Awe(t,e,r){let i=[],n=new hn.PassThrough;return n.on("data",s=>i.push(s)),await HI(t,e,UI(r,{stdout:n})),Buffer.concat(i).toString().replace(/[\r\n]+$/,"")}async function bJ(t,e,r){let i=t.map(async s=>{let o=await MA(s.args,e,r);return{name:s.name,value:o.join(" ")}});return(await Promise.all(i)).reduce((s,o)=>(s[o.name]=o.value,s),{})}function dS(t){return t.match(/[^ \r\n\t]+/g)||[]}async function DJ(t,e,r,i,n=i){switch(t.name){case"$":i(String(process.pid));break;case"#":i(String(e.args.length));break;case"@":if(t.quoted)for(let s of e.args)n(s);else for(let s of e.args){let o=dS(s);for(let a=0;a<o.length-1;++a)n(o[a]);i(o[o.length-1])}break;case"*":{let s=e.args.join(" ");if(t.quoted)i(s);else for(let o of dS(s))n(o)}break;case"PPID":i(String(process.ppid));break;case"RANDOM":i(String(Math.floor(Math.random()*32768)));break;default:{let s=parseInt(t.name,10);if(Number.isFinite(s))if(s>=0&&s<e.args.length)i(e.args[s]);else if(t.defaultValue)i((await MA(t.defaultValue,e,r)).join(" "));else throw new ia(`Unboundargument#${s}`);else if(Object.prototype.hasOwnProperty.call(r.variables,t.name))i(r.variables[t.name]);else if(Object.prototype.hasOwnProperty.call(r.environment,t.name))i(r.environment[t.name]);else if(t.defaultValue)i((await MA(t.defaultValue,e,r)).join(" "));else throw new ia(`Unboundvariable"${t.name}"`)}break}}var lwe={addition:(t,e)=>t+e,subtraction:(t,e)=>t-e,multiplication:(t,e)=>t*e,division:(t,e)=>Math.trunc(t/e)};async function zh(t,e,r){if(t.type==="number"){if(Number.isInteger(t.value))return t.value;throw new Error(`Invalidnumber:"${t.value}",onlyintegersareallowed`)}else if(t.type==="variable"){let i=[];await DJ(V(P({},t),{quoted:!0}),e,r,s=>i.push(s));let n=Number(i.join(" "));return Number.isNaN(n)?zh({type:"variable",name:i.join(" ")},e,r):zh({type:"number",value:n},e,r)}else return lwe[t.type](await zh(t.left,e,r),await zh(t.right,e,r))}async function MA(t,e,r){let i=new Map,n=[],s=[],o=u=>{s.push(u)},a=()=>{s.length>0&&n.push(s.join("")),s=[]},l=u=>{o(u),a()},c=(u,g)=>{let h=i.get(u);typeof h=="undefined"&&i.set(u,h=[]),h.push(g)};for(let u of t){let g=!1;switch(u.type){case"redirection":{let h=await MA(u.args,e,r);for(let f of h)c(u.subtype,f)}break;case"argument":for(let h of u.segments)switch(h.type){case"text":o(h.text);break;case"glob":o(h.pattern),g=!0;break;case"shell":{let f=await Awe(h.shell,e,r);if(h.quoted)o(f);else{let p=dS(f);for(let m=0;m<p.length-1;++m)l(p[m]);o(p[p.length-1])}}break;case"variable":await DJ(h,e,r,o,l);break;case"arithmetic":o(String(await zh(h.arithmetic,e,r)));break}break}if(a(),g){let h=n.pop();if(typeof h=="undefined")throw new Error("Assertion failed: Expected a glob pattern to have been set");let f=await e.glob.match(h,{cwd:r.cwd,baseFs:e.baseFs});if(f.length===0){let p=hJ(h)?". Note: Brace expansion of arbitrary strings isn't currently supported. For more details, please read this issue: https://github.com/yarnpkg/berry/issues/22":"";throw new ia(`Nomatchesfound:"${h}"${p}`)}for(let p of f.sort())l(p)}}if(i.size>0){let u=[];for(let[g,h]of i.entries())u.splice(u.length,0,g,String(h.length),...h);n.splice(0,0,"__ysh_set_redirects",...u,"--")}return n}function Wh(t,e,r){e.builtin
`),this.writeProgress()}writeLineWithForgettableReset(e,{truncate:r}={}){this.forgettableLines=[],this.writeLine(e,{truncate:r})}writeLines(e,{truncate:r}={}){this.clearProgress({delta:e.length});for(let i of e)this.stdout.write(`${this.truncate(i,{truncate:r})}
`);this.writeProgress()}reportCacheChanges({cacheHitCount:e,cacheMissCount:r}){let i=this.cacheHitCount-e,n=this.cacheMissCount-r;if(i===0&&n===0)return;let s="";this.cacheHitCount>1?s+=`${this.cacheHitCount}packageswerealreadycached`:this.cacheHitCount===1?s+=" - one package was already cached":s+="No packages were cached",this.cacheHitCount>0?this.cacheMissCount>1?s+=`,${this.cacheMissCount}hadtobefetched`:this.cacheMissCount===1&&(s+=`,onehadtobefetched(${it(this.configuration,this.lastCacheMiss)})`):this.cacheMissCount>1?s+=`-${this.cacheMissCount}packageshadtobefetched`:this.cacheMissCount===1&&(s+=`-onepackagehadtobefetched(${it(this.configuration,this.lastCacheMiss)})`),this.reportInfo(z.FETCH_NOT_CACHED,s)}commit(){let e=this.uncommitted;this.uncommitted=new Set;for(let r of e)r.committed=!0,r.action()}clearProgress({delta:e=0,clear:r=!1}){!this.configuration.get("enableProgressBars")||this.json||this.progress.size+e>0&&(this.stdout.write(`[${this.progress.size+e}A`),(e>0||r)&&this.stdout.write("[0J"))}writeProgress(){if(!this.configuration.get("enableProgressBars")||this.json||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let e=Date.now();e-this.progressTime>NW&&(this.progressFrame=(this.progressFrame+1)%LW.length,this.progressTime=e);let r=LW[this.progressFrame];for(let i of this.progress.values()){let n=this.progressStyle.chars[0].repeat(i.lastScaledSize),s=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-i.lastScaledSize),o=this.formatName(null),a=o?`${o}:`:"";this.stdout.write(`${je(this.configuration,"\u27A4","blueBright")}${a}${r}${n}${s}
`),await M.chmodPromise(B.join(t,e),493)}async function UQe(t){let e=null;try{e=await M.readFilePromise(B.join(t,mt.lockfile),"utf8")}catch{}return e!==null?e.match(/^__metadata:$/m)?{packageManager:ls.Yarn2,reason:'"__metadata" key found in yarn.lock'}:{packageManager:ls.Yarn1,reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:M.existsSync(B.join(t,"package-lock.json"))?{packageManager:ls.Npm,reason:`foundnpm's "package-lock.json" lockfile`}:M.existsSync(B.join(t,"pnpm-lock.yaml"))?{packageManager:ls.Pnpm,reason:`found pnpm's"pnpm-lock.yaml"lockfile`}:null}async function Zh({project:t,locator:e,binFolder:r,lifecycleScript:i}){var a,l;let n={};for(let[c,u]of Object.entries(process.env))typeof u!="undefined"&&(n[c.toLowerCase()!=="path"?c:"PATH"]=u);let s=L.fromPortablePath(r);if(n.BERRY_BIN_FOLDER=L.fromPortablePath(s),await Promise.all([$s(r,"node",process.execPath),...Yi!==null?[$s(r,"run",process.execPath,[process.argv[1],"run"]),$s(r,"yarn",process.execPath,[process.argv[1]]),$s(r,"yarnpkg",process.execPath,[process.argv[1]]),$s(r,"node-gyp",process.execPath,[process.argv[1],"run","--top-level","node-gyp"])]:[]]),t&&(n.INIT_CWD=L.fromPortablePath(t.configuration.startingCwd),n.PROJECT_CWD=L.fromPortablePath(t.cwd)),n.PATH=n.PATH?`${s}${L.delimiter}${n.PATH}`:`${s}`,n.npm_execpath=`${s}${L.sep}yarn`,n.npm_node_execpath=`${s}${L.sep}node`,e){if(!t)throw new Error("Assertion failed: Missing project");let c=t.tryWorkspaceByLocator(e),u=c?(a=c.manifest.version)!=null?a:"":(l=t.storedPackages.get(e.locatorHash).version)!=null?l:"";n.npm_package_name=dt(e),n.npm_package_version=u}let o=Yi!==null?`yarn/${Yi}`:`yarn/${vn("@yarnpkg/core").version}-core`;return n.npm_config_user_agent=`${o}npm/?node/${process.versions.node}${process.platform}${process.arch}`,i&&(n.npm_lifecycle_event=i),t&&await t.configuration.triggerHook(c=>c.setupScriptEnvironment,t,n,async(c,u,g)=>await $s(r,jt(c),u,g)),n}var HQe=2,YQe=(0,KW.default)(HQe);async function qQe(t,e,{configuration:r,report:i,workspace:n=null,locator:s=null}){await YQe(async()=>{await M.mktempPromise(async o=>{let a=B.join(o,"pack.log"),l=null,{stdout:c,stderr:u}=r.getSubprocessStreams(a,{prefix:L.fromPortablePath(t),report:i}),g=s&&ns(s)?fh(s):s,h=g?ln(g):"an external project";c.write(`Packing${h}fromsources
$2`).replace(/^│\n/,"");if(n>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");r.write(s)}var Vx=te(require("fs"));var pDe=8,gt=class{constructor(e,{configuration:r,immutable:i=r.get("enableImmutableCache"),check:n=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.configuration=r,this.cwd=e,this.immutable=i,this.check=n;let s=r.get("cacheKeyOverride");if(s!==null)this.cacheKey=`${s}`;else{let o=r.get("compressionLevel"),a=o!==Va?`c${o}`:"";this.cacheKey=[pDe,a].join("")}}static async find(e,{immutable:r,check:i}={}){let n=new gt(e.get("cacheFolder"),{configuration:e,immutable:r,check:i});return await n.setup(),n}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`${nc(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,r){let n=dDe(r).slice(0,10);return`${nc(e)}-${n}.zip`}getLocatorPath(e,r){return this.mirrorCwd===null?B.resolve(this.cwd,this.getVersionFilename(e)):r===null||Xx(r)!==this.cacheKey?null:B.resolve(this.cwd,this.getChecksumFilename(e,r))}getLocatorMirrorPath(e){let r=this.mirrorCwd;return r!==null?B.resolve(r,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await M.existsPromise(this.cwd))throw new Ze(z.IMMUTABLE_CACHE,"Cache path does not exist.")}else{await M.mkdirPromise(this.cwd,{recursive:!0});let e=B.resolve(this.cwd,".gitignore");await M.changeFilePromise(e,`/.gitignore
*.flock
`)}(this.mirrorCwd||!this.immutable)&&await M.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,r,{onHit:i,onMiss:n,loader:s,skipIntegrityCheck:o}){let a=this.getLocatorMirrorPath(e),l=new wt,c=async(N,U=null)=>{let v=!o||!r?`${this.cacheKey}/${awaitvm(N)}`:r;if(U!==null){let J=!o||!r?`${this.cacheKey}/${awaitvm(U)}`:r;if(v!==J)throw new Ze(z.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}if(r!==null&&v!==r){let J;switch(this.check?J="throw":Xx(r)!==Xx(v)?J="update":J=this.configuration.get("checksumBehavior"),J){case"ignore":return r;case"update":return v;default:case"throw":throw new Ze(z.CACHE_CHECKSUM_MISMATCH,"The remote archive doesn't match the expected checksum")}}return v},u=async N=>{if(!s)throw new Error(`Cachecheckrequiredbutnoloaderconfiguredfor${it(this.configuration,e)}`);let U=await s(),v=U.getRealPath();return U.saveAndClose(),await M.chmodPromise(v,420),await c(N,v)},g=async()=>{if(a===null||!await M.existsPromise(a)){let v=await s(),J=v.getRealPath();return v.saveAndClose(),{source:"loader",path:J}}let N=await M.mktempPromise(),U=B.join(N,this.getVersionFilename(e));return await M.copyFilePromise(a,U,Vx.default.constants.COPYFILE_FICLONE),{source:"mirror",path:U}},h=async()=>{if(!s)throw new Error(`Cacheentryrequiredbutmissingfor${it(this.configuration,e)}`);if(this.immutable)throw new Ze(z.IMMUTABLE_CACHE,`Cacheentryrequiredbutmissingfor${it(this.configuration,e)}`);let{path:N,source:U}=await g();await M.chmodPromise(N,420);let v=await c(N),J=this.getLocatorPath(e,v);if(!J)throw new Error("Assertion failed: Expected the cache path to be available");let oe=null;if(U!=="mirror"&&a!==null){let T=await M.mktempPromise();oe=B.join(T,this.getVersionFilename(e)),await M.copyFilePromise(N,oe,Vx.default.constants.COPYFILE_FICLONE)}return await this.writeFileWithLock(J,async()=>await this.writeFileWithLock(U==="mirror"?null:a,async()=>(await M.movePromise(N,J),oe&&a&&await M.movePromise(oe,a),[J,v])))},f=async()=>{let U=(async()=>{let v=this.getLocatorPath(e,r),J=v!==null?await l.existsPromise(v):!1,oe=J?i:n;if(oe&&oe(),J){let T=null,A=v;return this.check?T=await u(A):T=await c(A),[A,T]}else return h()})();this.mutexes.set(e.locatorHash,U);try{return await U}finally{this.mutexes.delete(e.locatorHash)}};for(let N;N=this.mutexes.get(e.locatorHash);)await N;let[p,m]=await f();this.markedFiles.add(p);let I=null,y=await li(),b=new Qg(()=>Jg(()=>I=new Qr(p,{baseFs:l,libzip:y,readOnly:!0}),N=>`Failedtoopenthecacheentryfor${it(this.configuration,e)}:${N}`),B);return[new Xa(p,{baseFs:b,pathUtils:B}),()=>{I!==null&&I.discardAndClose()},m]}async writeFileWithLock(e,r){return e===null?await r():await M.lockPromise(e,async()=>await r())}};function Xx(t){let e=t.indexOf("/");return e!==-1?t.slice(0,e):null}function dDe(t){let e=t.indexOf("/");return e!==-1?t.slice(e+1):t}var c8=te(s8()),GE=te(Lg());var u8=te(jI()),tP=te(require("stream"));var o8={hooks:{reduceDependency:(t,e,r,i,{resolver:n,resolveOptions:s})=>{for(let{pattern:o,reference:a}of e.topLevelWorkspace.manifest.resolutions){if(o.from&&o.from.fullName!==dt(r)||o.from&&o.from.description&&o.from.description!==r.reference||o.descriptor.fullName!==dt(t)||o.descriptor.description&&o.descriptor.description!==t.range)continue;return n.bindDescriptor(Wt(t,a),e.topLevelWorkspace.anchoredLocator,s)}return t},validateProject:async(t,e)=>{for(let r of t.workspaces){let i=mh(t.configuration,r);await t.configuration.triggerHook(n=>n.validateWorkspace,r,{reportWarning:(n,s)=>e.reportWarning(n,`${i}:${s}`),reportError:(n,s)=>e.reportError(n,`${i}:${s}`)})}},validateWorkspace:async(t,e)=>{let{manifest:r}=t;r.resolutions.length&&t.cwd!==t.project.cwd&&r.errors.push(new Error("Resolutions field will be ignored"));for(let i of r.errors)e.reportWarning(z.INVALID_MANIFEST,i.message)}}};var _x=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{stdout:s,stderr:o}}makeResolver(){let e=[];for(let r of this.plugins.values())for(let i of r.resolvers||[])e.push(new i);return new eu([new qE,new fi,new $x,...e])}makeFetcher(){let e=[];for(let r of this.plugins.values())for(let i of r.fetchers||[])e.push(new i);return new _x([new mf,new eP,...e])}getLinkers(){let e=[];for(let r of this.plugins.values())for(let i of r.linkers||[])e.push(new i);return e}async refreshPackageExtensions(){this.packageExtensions=new Map;let e=this.packageExtensions,r=(i,n,{userProvided:s=!1}={})=>{if(!Tn(i.range))throw new Error("Only semver ranges are allowed as keys for the lockfileExtensions setting");let o=new ze;o.load(n,{yamlCompatibilityMode:!0});let a=Jl(e,i.identHash),l=[];a.push([i.range,l]);let c={status:Yr.Inactive,userProvided:s,parentDescriptor:i};for(let u of o.dependencies.values())l.push(V(P({},c),{type:Dr.Dependency,descriptor:u}));for(let u of o.peerDependencies.values())l.push(V(P({},c),{type:Dr.PeerDependency,descriptor:u}));for(let[u,g]of o.peerDependenciesMeta)for(let[h,f]of Object.entries(g))l.push(V(P({},c),{type:Dr.PeerDependencyMeta,selector:u,key:h,value:f}))};await this.triggerHook(i=>i.registerPackageExtensions,this,r);for(let[i,n]of this.get("packageExtensions"))r(Jo(i,!0),GC(n),{userProvided:!0})}normalizePackage(e){let r=gh(e);if(this.packageExtensions==null)throw new Error("refreshPackageExtensions has to be called before normalizing packages");let i=this.packageExtensions.get(e.identHash);if(typeof i!="undefined"){let s=e.version;if(s!==null){for(let[o,a]of i)if(!!Xh(s,o))for(let l of a)switch(l.status===Yr.Inactive&&(l.status=Yr.Redundant),l.type){case Dr.Dependency:typeof r.dependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=Yr.Active,r.dependencies.set(l.descriptor.identHash,l.descriptor));break;case Dr.PeerDependency:typeof r.peerDependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=Yr.Active,r.peerDependencies.set(l.descriptor.identHash,l.descriptor));break;case Dr.PeerDependencyMeta:{let c=r.peerDependenciesMeta.get(l.selector);(typeof c=="undefined"||!Object.prototype.hasOwnProperty.call(c,l.key)||c[l.key]!==l.value)&&(l.status=Yr.Active,Ms(r.peerDependenciesMeta,l.selector,()=>({}))[l.key]=l.value)}break;default:FQ(l);break}}}let n=s=>s.scope?`${s.scope}__${s.name}`:`${s.name}`;for(let s of r.peerDependencies.values()){if(s.scope==="types")continue;let o=n(s),a=Go("types",o),l=dt(a);r.peerDependencies.has(a.identHash)||r.peerDependenciesMeta.has(l)||r.peerDependenciesMeta.set(l,{optional:!0})}for(let s of r.peerDependenciesMeta.keys()){let o=Qi(s);r.peerDependencies.has(o.identHash)||r.peerDependencies.set(o.identHash,Wt(o,"*"))}return r.dependencies=new Map(Bi(r.dependencies,([,s])=>bi(s))),r.peerDependencies=new Map(Bi(r.peerDependencies,([,s])=>bi(s))),r}getLimit(e){return Ms(this.limits,e,()=>(0,u8.default)(this.get(e)))}async triggerHook(e,...r){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);!s||await s(...r)}}async triggerMultipleHooks(e,r){for(let i of r)await this.triggerHook(e,...i)}async reduceHook(e,r,...i){let n=r;for(let s of this.plugins.values()){let o=s.hooks;if(!o)continue;let a=e(o);!a||(n=await a(n,...i))}return n}async firstHook(e,...r){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);if(!s)continue;let o=await s(...r);if(typeof o!="undefined")return o}return null}},Ae=oo;Ae.telemetry=null;var Ji;(function(r){r[r.SCRIPT=0]="SCRIPT",r[r.SHELLCODE=1]="SHELLCODE"})(Ji||(Ji={}));var ao=class extends ai{constructor({configuration:e,stdout:r,suggestInstall:i=!0}){super();this.errorCount=0;Eh(this,{configuration:e}),this.configuration=e,this.stdout=r,this.suggestInstall=i}static async start(e,r){let i=new this(e);try{await r(i)}catch(n){i.reportExceptionOnce(n)}finally{await i.finalize()}return i}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(e){}reportCacheMiss(e){}startTimerSync(e,r,i){return(typeof r=="function"?r:i)()}async startTimerPromise(e,r,i){return await(typeof r=="function"?r:i)()}async start
`))}formatNameWithHyperlink(e){return DS(e,{configuration:this.configuration,json:!1})}};var gy=te(require("crypto")),i6=te(z8()),hy=te(t6()),n6=te(jI()),s6=te(Cr()),LP=te(require("util")),NP=te(require("v8")),MP=te(require("zlib"));var sve=[[/^(git(?:\+(?:https|ssh))?:\/\/.*(?:\.git)?)#(.*)$/,(t,e,r,i)=>`${r}#commit=${i}`],[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/,(t,e,r="",i,n)=>`https://${r}github.com/${i}.git#commit=${n}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/,(t,e,r="",i,n)=>`https://${r}github.com/${i}.git#commit=${n}`],[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/,t=>`npm:${t}`],[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)$/,t=>`npm:${t}`],[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/,t=>`npm:${t}`],[/^https?:\/\/(?:[^\\.]+)\.jfrog\.io\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/,(t,e)=>Om({protocol:"npm:",source:null,selector:t,params:{__archiveUrl:e}})],[/^[^/]+\.tgz#[0-9a-f]+$/,t=>`npm:${t}`]],FP=class{constructor(){this.resolutions=null}async setup(e,{report:r}){let i=B.join(e.cwd,e.configuration.get("lockfileFilename"));if(!M.existsSync(i))return;let n=await M.readFilePromise(i,"utf8"),s=Nr(n);if(Object.prototype.hasOwnProperty.call(s,"__metadata"))return;let o=this.resolutions=new Map;for(let a of Object.keys(s)){let l=dh(a);if(!l){r.reportWarning(z.YARN_IMPORT_FAILED,`Failed to parse the string "${a}" into a proper descriptor`);continue}Tn(l.range)&&(l=Wt(l,`npm:${l.range}`));let{version:c,resolved:u}=s[a];if(!u)continue;let g;for(let[f,p]of sve){let m=u.match(f);if(m){g=p(c,...m);break}}if(!g){r.reportWarning(z.YARN_IMPORT_FAILED,`${Tt(e.configuration,l)}: Only some patterns can be imported from legacy lockfiles (not "${u}")`);continue}let h=l;try{let f=ic(l.range),p=dh(f.selector,!0);p&&(h=p)}catch{}o.set(l.descriptorHash,si(h,g))}}supportsDescriptor(e,r){return this.resolutions?this.resolutions.has(e.descriptorHash):!1}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}bindDescriptor(e,r,i){return e}getResolutionDependencies(e,r){return[]}async getCandidates(e,r,i){if(!this.resolutions)throw new Error("Assertion failed: The resolution store should have been setup");let n=this.resolutions.get(e.descriptorHash);if(!n)throw new Error("Assertion failed: The resolution should have been registered");return[n]}async getSatisfying(e,r,i){return null}async resolve(e,r){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}};var uy=class{supportsDescriptor(e,r){return!!(r.project.storedResolutions.get(e.descriptorHash)||r.project.originalPackages.has(Nm(e).locatorHash))}supportsLocator(e,r){return!!r.project.originalPackages.has(e.locatorHash)}shouldPersistResolution(e,r){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(e,r,i){return e}getResolutionDependencies(e,r){return[]}async getCandidates(e,r,i){let n=i.project.originalPackages.get(Nm(e).locatorHash);if(n)return[n];let s=i.project.storedResolutions.get(e.descriptorHash);if(!s)throw new Error("Expected the resolution to have been successful - resolution not found");if(n=i.project.originalPackages.get(s),!n)throw new Error("Expected the resolution to have been successful - package not found");return[n]}async getSatisfying(e,r,i){return null}async resolve(e,r){let i=r.project.originalPackages.get(e.locatorHash);if(!i)throw new Error("The lockfile resolver isn't meant to resolve packages - they should already have been stored into a cache");return i}};var RP=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return this.resolver.supportsDescriptor(e,r)}supportsLocator(e,r){return this.resolver.supportsLocator(e,r)}shouldPersistResolution(e,r){return this.resolver.
-Ifitisn't, it'slikelybecauseyouhaveayarn.lockorpackage.jsonfilethere,confusingtheprojectrootdetection.`)}async setupResolutions(){this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=B.join(this.cwd,this.configuration.get("lockfileFilename")),r=this.configuration.get("defaultLanguageName");if(M.existsSync(e)){let i=await M.readFilePromise(e,"utf8");this.lockFileChecksum=ni(`${ove}`,i);let n=Nr(i);if(n.__metadata){let s=n.__metadata.version,o=n.__metadata.cacheKey;for(let a of Object.keys(n)){if(a==="__metadata")continue;let l=n[a];if(typeof l.resolution=="undefined")throw new Error(`Assertionfailed:Expectedthelockfileentrytohavearesolutionfield(${a})`);let c=CA(l.resolution,!0),u=new ze;u.load(l,{yamlCompatibilityMode:!0});let g=u.version,h=u.languageName||r,f=l.linkType.toUpperCase(),p=u.dependencies,m=u.peerDependencies,I=u.dependenciesMeta,y=u.peerDependenciesMeta,b=u.bin;if(l.checksum!=null){let x=typeof o!="undefined"&&!l.checksum.includes("/")?`${o}/${l.checksum}`:l.checksum;this.storedChecksums.set(c.locatorHash,x)}if(s>=OP){let x=V(P({},c),{version:g,languageName:h,linkType:f,dependencies:p,peerDependencies:m,dependenciesMeta:I,peerDependenciesMeta:y,bin:b});this.originalPackages.set(x.locatorHash,x)}for(let x of a.split(ave)){let F=Jo(x);if(this.storedDescriptors.set(F.descriptorHash,F),s>=OP)this.storedResolutions.set(F.descriptorHash,c.locatorHash);else{let N=Mm(c);N.descriptorHash!==F.descriptorHash&&(this.storedDescriptors.set(N.descriptorHash,N),this.resolutionAliases.set(F.descriptorHash,N.descriptorHash))}}}}}}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 i of r){if(this.workspacesByCwd.has(i))continue;let n=await this.addWorkspace(i),s=this.storedPackages.get(n.anchoredLocator.locatorHash);s&&(n.dependencies=s.dependencies);for(let o of n.workspacesCwds)e.push(o)}}}async addWorkspace(e){let r=new Lf(e,{project:this});await r.setup();let i=this.workspacesByIdent.get(r.locator.identHash);if(typeof i!="undefined")throw new Error(`Duplicateworkspacename${mr(this.configuration,r.locator)}:${L.fromPortablePath(e)}conflictswith${L.fromPortablePath(i.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){B.isAbsolute(e)||(e=B.resolve(this.cwd,e)),e=B.normalize(e).replace(/\/+$/,"");let r=this.workspacesByCwd.get(e);return r||null}getWorkspaceByCwd(e){let r=this.tryWorkspaceByCwd(e);if(!r)throw new Error(`Workspacenotfound(${e})`);return r}tryWorkspaceByFilePath(e){let r=null;for(let i of this.workspaces)B.relative(i.cwd,e).startsWith("../")||r&&r.cwd.length>=i.cwd.length||(r=i);return r||null}getWorkspaceByFilePath(e){let r=this.tryWorkspaceByFilePath(e);if(!r)throw new Error(`Workspacenotfound(${e})`);return r}tryWorkspaceByIdent(e){let r=this.workspacesByIdent.get(e.identHash);return typeof r=="undefined"?null:r}getWorkspaceByIdent(e){let r=this.tryWorkspaceByIdent(e);if(!r)throw new Error(`Workspacenotfound(${mr(this.configuration,e)})`);return r}tryWorkspaceByDescriptor(e){let r=this.tryWorkspaceByIdent(e);return r===null||(jo(e)&&(e=hh(e)),!r.accepts(e.range))?null:r}getWorkspaceByDescriptor(e){let r=this.tryWorkspaceByDescriptor(e);if(r===null)throw new Error(`Workspacenotfound(${Tt(this.configuration,e)})`);return r}tryWorkspaceByLocator(e){let r=this.tryWorkspaceByIdent(e);return r===null||(ns(e)&&(e=fh(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(`Workspacenotfound(${it(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(`Assertionfailed:Expectedworkspace${mh(thi
`;break}let ie=null;if(!await M.mktempPromise(async be=>{let he=B.join(be,"build.log"),{stdout:Ie,stderr:pe}=this.configuration.getSubprocessStreams(he,{header:Te,prefix:it(this.configuration,$),report:r}),ve;try{switch(Le){case Ji.SCRIPT:ve=await XI($,Ge,[],{cwd:Pe,project:this,stdin:ie,stdout:Ie,stderr:pe});break;case Ji.SHELLCODE:ve=await xS($,Ge,[],{cwd:Pe,project:this,stdin:ie,stdout:Ie,stderr:pe});break}}catch(X){pe.write(X.stack),ve=1}if(Ie.end(),pe.end(),ve===0)return v.set($.locatorHash,R),!0;M.detachTemp(be);let Z=`${it(this.configuration,$)}couldn't be built successfully (exit code ${je(this.configuration,ve,ke.NUMBER)}, logs can be found here: ${je(this.configuration,he,ke.PATH)})`;return this.optionalBuilds.has($.locatorHash)?(r.reportInfo(z.BUILD_FAILED,Z),v.set($.locatorHash,R),!0):(r.reportError(z.BUILD_FAILED,Z),!1)}))return}})())}}if(await Promise.all(A),T===y.size){let W=Array.from(y).map($=>{let re=this.storedPackages.get($);if(!re)throw new Error("Assertion failed: The package should have been registered");return it(this.configuration,re)}).join(", ");r.reportError(z.CYCLIC_DEPENDENCIES,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won'tbebuilt(affectedpackagesare:${W})`);break}}this.storedBuildState=v}async install(e){var a,l;let r=this.configuration.get("nodeLinker");(a=Ae.telemetry)==null||a.reportInstall(r),await e.report.startTimerPromise("Project validation",{skipIfEmpty:!0},async()=>{await this.configuration.triggerHook(c=>c.validateProject,this,{reportWarning:e.report.reportWarning.bind(e.report),reportError:e.report.reportError.bind(e.report)})});for(let c of this.configuration.packageExtensions.values())for(let[,u]of c)for(let g of u)g.status=Yr.Inactive;let i=B.join(this.cwd,this.configuration.get("lockfileFilename")),n=null;if(e.immutable)try{n=await M.readFilePromise(i,"utf8")}catch(c){throw c.code==="ENOENT"?new Ze(z.FROZEN_LOCKFILE_EXCEPTION,"The lockfile would have been created by this install, which is explicitly forbidden."):c}await e.report.startTimerPromise("Resolution step",async()=>{await this.resolveEverything(e)}),await e.report.startTimerPromise("Post-resolution validation",{skipIfEmpty:!0},async()=>{for(let[,c]of this.configuration.packageExtensions)for(let[,u]of c)for(let g of u)if(g.userProvided){let h=je(this.configuration,g,ke.PACKAGE_EXTENSION);switch(g.status){case Yr.Inactive:e.report.reportWarning(z.UNUSED_PACKAGE_EXTENSION,`${h}:Nomatchingpackageinthedependencytree;youmaynotneedthisruleanymore.`);break;case Yr.Redundant:e.report.reportWarning(z.REDUNDANT_PACKAGE_EXTENSION,`${h}:Thisruleseemsredundantwhenappliedontheoriginalpackage;theextensionmayhavebeenappliedupstream.`);break}}if(n!==null){let c=Fl(n,this.generateLockfile());if(c!==n){let u=(0,i6.structuredPatch)(i,i,n,c);e.report.reportSeparator();for(let g of u.hunks){e.report.reportInfo(null,`@@-${g.oldStart},${g.oldLines}+${g.newStart},${g.newLines}@@`);for(let h of g.lines)h.startsWith("+")?e.report.reportError(z.FROZEN_LOCKFILE_EXCEPTION,je(this.configuration,h,ke.ADDED)):h.startsWith("-")?e.report.reportError(z.FROZEN_LOCKFILE_EXCEPTION,je(this.configuration,h,ke.REMOVED)):e.report.reportInfo(null,je(this.configuration,h,"grey"))}throw e.report.reportSeparator(),new Ze(z.FROZEN_LOCKFILE_EXCEPTION,"The lockfile would have been modified by this install, which is explicitly forbidden.")}}});for(let c of this.configuration.packageExtensions.values())for(let[,u]of c)for(let g of u)g.userProvided&&g.status===Yr.Active&&((l=Ae.telemetry)==null||l.reportPackageExtension(ac(g,ke.PACKAGE_EXTENSION)));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(e),(typeof e.persistProject=="undefined"||e.persistProject)&&await this.cacheCleanup(e)});let s=e.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],o=await Promise.all(s.map(async c=>Fm(c,{cwd:this.cwd})));(typeof e.persistProject=="undefined"||e.persistProject)&&await this.persist(),await e.report.startTimerPromis
`,`#Manualchangesmightbelost-proceedwithcaution!
`].join("")}
`+_s(r)}async persistLockfile(){let e=B.join(this.cwd,this.configuration.get("lockfileFilename")),r=this.generateLockfile();await M.changeFilePromise(e,r,{automaticNewlines:!0})}async persistInstallStateFile(){let e=[];for(let o of Object.values(TP))e.push(...o);let r=(0,hy.default)(this,e),i=NP.default.serialize(r),n=ni(i);if(this.installStateChecksum===n)return;let s=this.configuration.get("installStatePath");await M.mkdirPromise(B.dirname(s),{recursive:!0}),await M.writeFilePromise(s,await lve(i)),this.installStateChecksum=n}async restoreInstallState({restoreInstallersCustomData:e=!0,restoreResolutions:r=!0,restoreBuildState:i=!0}={}){let n=this.configuration.get("installStatePath");if(!M.existsSync(n)){r&&await this.applyLightResolution();return}let s=await cve(await M.readFilePromise(n));this.installStateChecksum=ni(s);let o=NP.default.deserialize(s);e&&typeof o.installersCustomData!="undefined"&&(this.installersCustomData=o.installersCustomData),i&&Object.assign(this,(0,hy.default)(o,TP.restoreBuildState)),r&&(o.lockFileChecksum===this.lockFileChecksum?(Object.assign(this,(0,hy.default)(o,TP.restoreResolutions)),this.refreshWorkspaceDependencies()):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new Br}),await this.persistInstallStateFile()}async persist(){await this.persistLockfile();for(let e of this.workspacesByCwd.values())await e.persistManifest()}async cacheCleanup({cache:e,report:r}){let i=new Set([".gitignore"]);if(!qw(e.cwd,this.cwd)||!await M.existsPromise(e.cwd))return;let n=this.configuration.get("preferAggregateCacheInfo"),s=0,o=null;for(let a of await M.readdirPromise(e.cwd)){if(i.has(a))continue;let l=B.resolve(e.cwd,a);e.markedFiles.has(l)||(o=a,e.immutable?r.reportError(z.IMMUTABLE_CACHE,`${je(this.configuration,B.basename(l),"magenta")}appearstobeunusedandwouldbemarkedfordeletion,butthecacheisimmutable`):(n?s+=1:r.reportInfo(z.UNUSED_CACHE_ENTRY,`${je(this.configuration,B.basename(l),"magenta")}appearstobeunused-removing`),await M.removePromise(l)))}n&&s!==0&&r.reportInfo(z.UNUSED_CACHE_ENTRY,s>1?`${s}packagesappearedtobeunusedandwereremoved`:`${o}appearedtobeunusedandwasremoved`),e.markedFiles.clear()}};function uve({project:t,allDescriptors:e,allResolutions:r,allPackages:i,accessibleLocators:n=new Set,optionalBuilds:s=new Set,volatileDescriptors:o=new Set,peerRequirements:a=new Map,report:l,tolerateMissingPackages:c=!1}){var oe;let u=new Map,g=[],h=new Map,f=new Map,p=new Map,m=new Map,I=new Map,y=new Map(t.workspaces.map(T=>{let A=T.anchoredLocator.locatorHash,W=i.get(A);if(typeof W=="undefined"){if(c)return[A,null];throw new Error("Assertion failed: The workspace should have an associated package")}return[A,gh(W)]})),b=()=>{let T=M.mktempSync(),A=B.join(T,"stacktrace.log"),W=String(g.length+1).length,$=g.map((re,H)=>`${`${H+1}.`.padStart(W," ")}${ln(re)}
`).join("");throw M.writeFileSync(A,$),M.detachTemp(T),new Ze(z.STACK_OVERFLOW_RESOLUTION,`Encounteredastackoverflowwhenresolvingpeerdependencies;cf${L.fromPortablePath(A)}`)},x=T=>{let A=r.get(T.descriptorHash);if(typeof A=="undefined")throw new Error("Assertion failed: The resolution should have been registered");let W=i.get(A);if(!W)throw new Error("Assertion failed: The package could not be found");return W},F=(T,A,{top:W,optional:$})=>{g.length>1e3&&b(),g.push(T);let re=N(T,A,{top:W,optional:$});return g.pop(),re},N=(T,A,{top:W,optional:$})=>{if(n.has(T.locatorHash))return;n.add(T.locatorHash),$||s.delete(T.locatorHash);let re=i.get(T.locatorHash);if(!re){if(c)return;throw new Error(`Assertionfailed:Thepackage(${it(t.configuration,T)})shouldhavebeenregistered`)}let H=[],R=[],Pe=[],Le=[],Ge=[];for(let ie of Array.from(re.dependencies.values())){if(re.peerDependencies.has(ie.identHash)&&re.locatorHash!==W)continue;if(jo(ie))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");o.delete(ie.descriptorHash);let le=$;if(!le){let ae=re.dependenciesMeta.get(dt(ie));if(typeof ae!="undefined"){let ue=ae.get(null);typeof ue!="undefined"&&ue.optional&&(le=!0)}}let be=r.get(ie.descriptorHash);if(!be){if(c)continue;throw new Error(`Assertionfailed:Theresolution(${Tt(t.configuration,ie)})shouldhavebeenregistered`)}let he=y.get(be)||i.get(be);if(!he)throw new Error(`Assertionfailed:Thepackage(${be},resolvedfrom${Tt(t.configuration,ie)})shouldhavebeenregistered`);if(he.peerDependencies.size===0){F(he,new Map,{top:W,optional:le});continue}let Ie=u.get(he.locatorHash);typeof Ie=="number"&&Ie>=2&&b();let pe,ve,Z=new Set,X;R.push(()=>{pe=t0(ie,T.locatorHash),ve=r0(he,T.locatorHash),re.dependencies.delete(ie.identHash),re.dependencies.set(pe.identHash,pe),r.set(pe.descriptorHash,ve.locatorHash),e.set(pe.descriptorHash,pe),i.set(ve.locatorHash,ve),H.push([he,pe,ve])}),Pe.push(()=>{var ae;X=new Map;for(let ue of ve.peerDependencies.values()){let we=re.dependencies.get(ue.identHash);if(!we&&ph(T,ue)&&(we=Mm(T),e.set(we.descriptorHash,we),r.set(we.descriptorHash,T.locatorHash),o.delete(we.descriptorHash)),(!we||we.range==="missing:")&&ve.dependencies.has(ue.identHash)){ve.peerDependencies.delete(ue.identHash);continue}we||(we=Wt(ue,"missing:")),ve.dependencies.set(we.identHash,we),jo(we)&&sA(p,we.descriptorHash).add(ve.locatorHash),h.set(we.identHash,we),we.range==="missing:"&&Z.add(we.identHash),X.set(ue.identHash,(ae=A.get(ue.identHash))!=null?ae:ve.locatorHash)}ve.dependencies=new Map(Bi(ve.dependencies,([ue,we])=>dt(we)))}),Le.push(()=>{if(!i.has(ve.locatorHash))return;let ae=u.get(he.locatorHash),ue=typeof ae!="undefined"?ae+1:1;u.set(he.locatorHash,ue),F(ve,X,{top:W,optional:le}),u.set(he.locatorHash,ue-1)}),Ge.push(()=>{let ae=re.dependencies.get(ie.identHash);if(typeof ae=="undefined")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let ue=r.get(ae.descriptorHash);if(typeof ue=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");if(sA(I,ue).add(T.locatorHash),!!i.has(ve.locatorHash)){for(let we of ve.peerDependencies.values()){let lt=X.get(we.identHash);if(typeof lt=="undefined")throw new Error("Assertion failed: Expected the peer dependency ident to be registered");Jl(Wl(m,lt),dt(we)).push(ve.locatorHash)}for(let we of Z)ve.dependencies.delete(we)}})}for(let ie of[...R,...Pe])ie();let Te;do{Te=!0;for(let[ie,le,be]of H){if(!i.has(be.locatorHash))continue;let he=Wl(f,ie.locatorHash),Ie=ni(...[...be.dependencies.values()].map(X=>{let ae=X.range!=="missing:"?r.get(X.descriptorHash):"missing:";if(typeof ae=="undefined")throw new Error(`Assertionfailed:Expectedtheresolutionfor${Tt(t.configuration,X)}tohavebeenregistered`);return ae===W?`${ae}(top)`:ae}),le.identHash),pe=he.get(Ie);if(typeof pe=="undefined"){he.set(Ie,le);continue}if(pe===le)continue;Te=!1,i.delete(be.locatorHash),e.delete(le.descriptorHash),r.delete(le.descriptorHash),n.delete(be.lo
`),(await Se.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!this.context.quiet},async I=>{await r.install({cache:n,report:I})})).exitCode()}};gp.paths=[["add"]],gp.usage=fe.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 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 add lodash"],["Add a specific version for a package to the current workspace","$0 add lodash@1.2.3"],["Add a package from a GitHub repository (the master branch) to the current workspace using a URL","$0 add lodash@https://github.com/lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol","$0 add lodash@github:lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol (shorthand)","$0 add lodash@lodash/lodash"],["Add a package from a specific branch of a GitHub repository to the current workspace using the GitHub protocol (shorthand)","$0 add lodash-es@lodash/lodash#es"]]});vark$=gp;functionKKe(t,e,{dev:r,peer:i,preferDev:n,optional:s}){leto=t.m
`),0}return(await Se.start({configuration:e,json:this.json,stdout:this.context.stdout},async s=>{let o=await bt.getPackageAccessibleBinaries(i,{project:r}),l=Array.from(o.keys()).reduce((c,u)=>Math.max(c,u.length),0);for(let[c,[u,g]]of o)s.reportJson({name:c,source:w.stringifyIdent(u),path:g});if(this.verbose)for(let[c,[u]]of o)s.reportInfo(null,`${c.padEnd(l," ")}${w.prettyLocator(e,u)}`);else for(let c of o.keys())s.reportInfo(null,c)})).exitCode()}};hp.paths=[["bin"]],hp.usage=fe.Usage({description:"get the path to a binary script",details:`
Whenusedwithoutarguments,thiscommandwillprintthelistofallthebinariesavailableinthecurrentworkspace.Addingthe\`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.
`,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]});var v$=hp;var fp=class extends Be{constructor(){super(...arguments);this.mirror=j.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=j.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),r=await gt.find(e);return(await Se.start({configuration:e,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&r.mirrorCwd!==null,s=!this.mirror;n&&(await M.removePromise(r.mirrorCwd),await e.triggerHook(o=>o.cleanGlobalArtifacts,e)),s&&await M.removePromise(r.cwd)})).exitCode()}};fp.paths=[["cache","clean"],["cache","clear"]],fp.usage=fe.Usage({description:"remove the shared cache files",details:`
Thiscommandwillremoveallthefilesfromthecache.
`,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]});var F$=fp;var R$=te(Sy()),uv=te(require("util")),pp=class extends Be{constructor(){super(...arguments);this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=j.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),r=this.name.replace(/[.[].*$/,""),i=this.name.replace(/^[^.[]*/,"");if(typeof e.settings.get(r)=="undefined")throw new me(`Couldn'tfindaconfigurationsettingsnamed"${r}"`);let s=e.getSpecial(r,{hideSecrets:!this.unsafe,getNativePaths:!0}),o=de.convertMapsToIndexableObjects(s),a=i?(0,R$.default)(o,i):o,l=await Se.start({configuration:e,includeFooter:!1,json:this.json,stdout:this.context.stdout},async c=>{c.reportJson(a)});if(!this.json){if(typeof a=="string")return this.context.stdout.write(`${a}
`)}return l.exitCode()}};pp.paths=[["config","get"]],pp.usage=fe.Usage({description:"read a configuration settings",details:`
Thiscommandwillprintaconfigurationsetting.
Secrets(suchastokens)willberedactedfromtheoutputbydefault.Ifthisbehaviorisn'tdesired,setthe\`--no-redacted\` to get the untransformed value.
`,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",`yarnconfigget'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"]]});var L$=pp;var Jee=te(Cv()),Wee=te(Sy()),zee=te(jee()),mv=te(require("util")),Cp=class extends Be{constructor(){super(...arguments);this.json=j.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=j.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=j.String();this.value=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),r=()=>{if(!e.projectCwd)throw new me("This command must be run from within a project folder");return e.projectCwd},i=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof e.settings.get(i)=="undefined")throw new me(`Couldn'tfindaconfigurationsettingsnamed"${i}"`);let o=this.json?JSON.parse(this.value):this.value;await(this.home?f=>Ae.updateHomeConfiguration(f):f=>Ae.updateConfiguration(r(),f))(f=>{if(n){let p=(0,Jee.default)(f);return(0,zee.default)(p,this.name,o),p}else return V(P({},f),{[i]:o})});let c=(await Ae.find(this.context.cwd,this.context.plugins)).getSpecial(i,{hideSecrets:!0,getNativePaths:!0}),u=de.convertMapsToIndexableObjects(c),g=n?(0,Wee.default)(u,n):u;return(await Se.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async f=>{mv.inspect.styles.name="cyan",f.reportInfo(z.UNNAMED,`Successfullyset${this.name}to${(0,mv.inspect)(g,{depth:Infinity,colors:e.get("enableColors"),compact:!1})}`)})).exitCode()}};Cp.paths=[["config","set"]],Cp.usage=fe.Usage({description:"change a configuration settings",details:`
Thiscommandwillsetaconfigurationsetting.
Whenusedwithoutthe\`--json\` flag, it can only set a simple configuration setting (a string, a number, or a boolean).
Whenusedwiththe\`--json\` flag, it can set both simple and complex configuration settings, including Arrays and Objects.
`,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",`yarnconfigsetunsafeHttpWhitelist--json'["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarnconfigsetpackageExtensions--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",`yarnconfigset'npmRegistries["//npm.example.com"].npmAuthToken'"ffffffff-ffff-ffff-ffff-ffffffffffff"`]]});var Vee=Cp;var nte=te(Cv()),Iv=te(ite()),mp=class extends Be{constructor(){super(...arguments);this.home=j.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins);if(!e.projectCwd)throw new me("This command must be run from within a project folder");let r=this.name.replace(/[.[].*$/,""),i=this.name.replace(/^[^.[]*\.?/,"");if(typeof e.settings.get(r)=="undefined")throw new me(`Couldn'tfindaconfigurationsettingsnamed"${r}"`);return await(this.home?a=>Ae.updateHomeConfiguration(a):a=>Ae.updateConfiguration(e.projectCwd,a))(a=>{if(i){let l=(0,nte.default)(a);return(0,Iv.default)(l,this.name),l}else return(0,Iv.default)(P({},a),r)}),(await Se.start({configuration:e,includeFooter:!1,stdout:this.context.stdout},async a=>{a.reportInfo(z.UNNAMED,`Successfullyunset${this.name}`)})).exitCode()}};mp.paths=[["config","unset"]],mp.usage=fe.Usage({description:"unset a configuration setting",details:`
Thiscommandwillunsetaconfigurationsetting.
`,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"]]});var ste=mp;var Ev=te(require("util")),Ip=class extends Be{constructor(){super(...arguments);this.verbose=j.Boolean("-v,--verbose",!1,{description:"Print the setting description on top of the regular key/value information"});this.why=j.Boolean("--why",!1,{description:"Print the reason why a setting is set a particular way"});this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins,{strict:!1});return(await Se.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{if(e.invalid.size>0&&!this.json){for(let[n,s]of e.invalid)i.reportError(z.INVALID_CONFIGURATION_KEY,`Invalidconfigurationkey"${n}"in${s}`);i.reportSeparator()}if(this.json){let n=de.sortMap(e.settings.keys(),s=>s);for(let s of n){let o=e.settings.get(s),a=e.getSpecial(s,{hideSecrets:!0,getNativePaths:!0}),l=e.sources.get(s);this.verbose?i.reportJson({key:s,effective:a,source:l}):i.reportJson(P({key:s,effective:a,source:l},o))}}else{let n=de.sortMap(e.settings.keys(),a=>a),s=n.reduce((a,l)=>Math.max(a,l.length),0),o={breakLength:Infinity,colors:e.get("enableColors"),maxArrayLength:2};if(this.why||this.verbose){let a=n.map(c=>{let u=e.settings.get(c);if(!u)throw new Error(`Assertionfailed:Thissettings("${c}")shouldhavebeenregistered`);let g=this.why?e.sources.get(c)||"<default>":u.description;return[c,g]}),l=a.reduce((c,[,u])=>Math.max(c,u.length),0);for(let[c,u]of a)i.reportInfo(null,`${c.padEnd(s," ")}${u.padEnd(l," ")}${(0,Ev.inspect)(e.getSpecial(c,{hideSecrets:!0,getNativePaths:!0}),o)}`)}else for(let a of n)i.reportInfo(null,`${a.padEnd(s," ")}${(0,Ev.inspect)(e.getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),o)}`)}})).exitCode()}};Ip.paths=[["config"]],Ip.usage=fe.Usage({description:"display the current configuration",details:`
`,examples:[["Print the active configuration settings","$0 config"]]});var ote=Ip;Mo();var yv={};$e(yv,{Strategy:()=>fl,acceptedStrategies:()=>Y2e,dedupe:()=>Bv});var ate=te(sn()),fl;(function(e){e.HIGHEST="highest"})(fl||(fl={}));var Y2e=new Set(Object.values(fl)),q2e={highest:async(t,e,{resolver:r,fetcher:i,resolveOptions:n,fetchOptions:s})=>{let o=new Map;for(let[a,l]of t.storedResolutions){let c=t.storedDescriptors.get(a);if(typeof c=="undefined")throw new Error(`Assertionfailed:Thedescriptor(${a})shouldhavebeenregistered`);de.getSetWithDefault(o,c.identHash).add(l)}return Array.from(t.storedDescriptors.values(),async a=>{if(e.length&&!ate.default.isMatch(w.stringifyIdent(a),e))return null;let l=t.storedResolutions.get(a.descriptorHash);if(typeof l=="undefined")throw new Error(`Assertionfailed:Theresolution(${a.descriptorHash})shouldhavebeenregistered`);let c=t.originalPackages.get(l);if(typeof c=="undefined"||!r.shouldPersistResolution(c,n))return null;let u=o.get(a.identHash);if(typeof u=="undefined")throw new Error(`Assertionfailed:Theresolutions(${a.identHash})shouldhavebeenregistered`);if(u.size===1)return null;let g=[...u].map(I=>{let y=t.originalPackages.get(I);if(typeof y=="undefined")throw new Error(`Assertionfailed:Thepackage(${I})shouldhavebeenregistered`);return y.reference}),h=await r.getSatisfying(a,g,n),f=h==null?void 0:h[0];if(typeof f=="undefined")return null;let p=f.locatorHash,m=t.originalPackages.get(p);if(typeof m=="undefined")throw new Error(`Assertionfailed:Thepackage(${p})shouldhavebeenregistered`);return p===l?null:{descriptor:a,currentPackage:c,updatedPackage:m}})}};async function Bv(t,{strategy:e,patterns:r,cache:i,report:n}){let{configuration:s}=t,o=new Br,a=s.makeResolver(),l=s.makeFetcher(),c={cache:i,checksums:t.storedChecksums,fetcher:l,project:t,report:o,skipIntegrityCheck:!0},u={project:t,resolver:a,report:o,fetchOptions:c};return await n.startTimerPromise("Deduplication step",async()=>{let h=await q2e[e](t,r,{resolver:a,resolveOptions:u,fetcher:l,fetchOptions:c}),f=ai.progressViaCounter(h.length);n.reportProgress(f);let p=0;await Promise.all(h.map(y=>y.then(b=>{if(b===null)return;p++;let{descriptor:x,currentPackage:F,updatedPackage:N}=b;n.reportInfo(z.UNNAMED,`${w.prettyDescriptor(s,x)}canbededupedfrom${w.prettyLocator(s,F)}to${w.prettyLocator(s,N)}`),n.reportJson({descriptor:w.stringifyDescriptor(x),currentResolution:w.stringifyLocator(F),updatedResolution:w.stringifyLocator(N)}),t.storedResolutions.set(x.descriptorHash,N.locatorHash)}).finally(()=>f.tick())));let m;switch(p){case 0:m="No packages";break;case 1:m="One package";break;default:m=`${p}packages`}let I=ce.pretty(s,e,ce.Type.CODE);return n.reportInfo(z.UNNAMED,`${m}canbededupedusingthe${I}strategy`),p})}var Ep=class extends Be{constructor(){super(...arguments);this.strategy=j.String("-s,--strategy",fl.HIGHEST,{description:"The strategy to use when deduping dependencies",validator:Yl(fl)});this.check=j.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when duplicates are found, without persisting the dependency tree"});this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=j.Rest()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r}=await Fe.find(e,this.context.cwd),i=await gt.find(e);await r.restoreInstallState({restoreResolutions:!1});let n=0,s=await Se.start({configuration:e,includeFooter:!1,stdout:this.context.stdout,json:this.json},async o=>{n=await Bv(r,{strategy:this.strategy,patterns:this.patterns,cache:i,report:o})});return s.hasErrors()?s.exitCode():this.check?n?1:0:(await Se.start({configuration:e,stdout:this.context.stdout,json:this.json},async a=>{await r.install({cache:i,report:a})})).exitCode()}};Ep.paths=[["dedupe"]],Ep.usage=fe.Usage({description:"deduplicate dependencies with overlapping ranges",details:"\n Duplicates are defined as descriptors with overlapping ranges being resolved and locked to different locators. They are a natural consequence of Ya
`,examples:[["Execute a shell command","$0 exec echo Hello World"]]});var pte=yp;Mo();var Bp=class extends Be{constructor(){super(...arguments);this.hash=j.String({required:!1,validator:aQ(oQ(),[AQ(/^p[0-9a-f]{5}$/)])})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r}=await Fe.find(e,this.context.cwd);return await r.restoreInstallState({restoreResolutions:!1}),await r.applyLightResolution(),typeof this.hash!="undefined"?await G2e(this.hash,r,{stdout:this.context.stdout}):(await Se.start({configuration:e,stdout:this.context.stdout,includeFooter:!1},async n=>{var o;let s=[([,a])=>w.stringifyLocator(r.storedPackages.get(a.subject)),([,a])=>w.stringifyIdent(a.requested)];for(let[a,l]of de.sortMap(r.peerRequirements,s)){let c=r.storedPackages.get(l.subject);if(typeof c=="undefined")throw new Error("Assertion failed: Expected the subject package to have been registered");let u=r.storedPackages.get(l.rootRequester);if(typeof u=="undefined")throw new Error("Assertion failed: Expected the root package to have been registered");let g=(o=c.dependencies.get(l.requested.identHash))!=null?o:null,h=ce.pretty(e,a,ce.Type.CODE),f=w.prettyLocator(e,c),p=w.prettyIdent(e,l.requested),m=w.prettyIdent(e,u),I=l.allRequesters.length-1,y=`descendant${I===1?"":"s"}`,b=I>0?`and${I}${y}`:"",x=g!==null?"provides":"doesn't provide";n.reportInfo(null,`${h}\u2192${f}${x}${p}to${m}${b}`)}})).exitCode()}};Bp.paths=[["explain","peer-requirements"]],Bp.usage=fe.Usage({description:"explain a set of peer requirements",details:`
`,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"]]});var dte=Bp;async function G2e(t,e,r){let{configuration:i}=e,n=e.peerRequirements.get(t);if(typeof n=="undefined")throw new Error(`NopeerDependencyrequirementsfoundforhash:"${t}"`);return(await Se.start({configuration:i,stdout:r.stdout,includeFooter:!1},async o=>{var y,b;let a=e.storedPackages.get(n.subject);if(typeof a=="undefined")throw new Error("Assertion failed: Expected the subject package to have been registered");let l=e.storedPackages.get(n.rootRequester);if(typeof l=="undefined")throw new Error("Assertion failed: Expected the root package to have been registered");let c=(y=a.dependencies.get(n.requested.identHash))!=null?y:null,u=c!==null?e.storedResolutions.get(c.descriptorHash):null;if(typeof u=="undefined")throw new Error("Assertion failed: Expected the resolution to have been registered");let g=u!==null?e.storedPackages.get(u):null;if(typeof g=="undefined")throw new Error("Assertion failed: Expected the provided package to have been registered");let h=[...n.allRequesters.values()].map(x=>{let F=e.storedPackages.get(x);if(typeof F=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let N=w.devirtualizeLocator(F),U=e.storedPackages.get(N.locatorHash);if(typeof U=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let v=U.peerDependencies.get(n.requested.identHash);if(typeof v=="undefined")throw new Error("Assertion failed: Expected the peer dependency to be registered");return{pkg:F,peerDependency:v}});if(g!==null){let x=h.every(({peerDependency:F})=>vt.satisfiesWithPrereleases(g.version,F.range));o.reportInfo(z.UNNAMED,`${w.prettyLocator(i,a)}provides${w.prettyLocator(i,g)}withversion${w.prettyReference(i,(b=g.version)!=null?b:"<missing>")},which${x?"satisfies":"doesn't satisfy"}thefollowingrequirements:`)}else o.reportInfo(z.UNNAMED,`${w.prettyLocator(i,a)}doesn'tprovide${w.prettyIdent(i,n.requested)},breakingthefollowingrequirements:`);o.reportSeparator();let f=ce.mark(i),p=[];for(let{pkg:x,peerDependency:F}of de.sortMap(h,N=>w.stringifyLocator(N.pkg))){let U=(g!==null?vt.satisfiesWithPrereleases(g.version,F.range):!1)?f.Check:f.Cross;p.push({stringifiedLocator:w.stringifyLocator(x),prettyLocator:w.prettyLocator(i,x),prettyRange:w.prettyRange(i,F.range),mark:U})}let m=Math.max(...p.map(({stringifiedLocator:x})=>x.length)),I=Math.max(...p.map(({prettyRange:x})=>x.length));for(let{stringifiedLocator:x,prettyLocator:F,prettyRange:N,mark:U}of de.sortMap(p,({stringifiedLocator:v})=>v))o.reportInfo(null,`${F.padEnd(m+(F.length-x.length)," ")}\u2192${N.padEnd(I," ")}${U}`);p.length>1&&(o.reportSeparator(),o.reportInfo(z.UNNAMED,`Note:theserequirementsstartwith${w.prettyLocator(e.configuration,l)}`))})).exitCode()}var Cte=te(sn()),wp=class extends Be{constructor(){super(...arguments);this.all=j.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=j.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=j.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=j.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=j.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=j.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=j.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=j.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=j.Rest()}async execute(){let e=await Ae.fin
-**Resolution:**Firstthepackagemanagerwillresolveyourdependencies.Theexactwayadependencyversionisprivilegedoveranotherisn't standardized outside of the regular semver guarantees. If a package doesn'tresolvetowhatyouwouldexpect,checkthatalldependenciesarecorrectlydeclared(alsocheckourwebsiteformoreinformation:).
-**Fetch:**Thenwedownloadallthedependenciesifneeded,andmakesurethatthey'reallstoredwithinourcache(checkthevalueof\`cacheFolder\` in \`yarn config\` to see where are stored the cache files).
Ifthe\`--immutable\` option is set (defaults to true on CI), Yarn will abort with an error exit code if the lockfile was to be modified (other paths can be added using the \`immutablePatterns\` configuration setting). For backward compatibility we offer an alias under the name of \`--frozen-lockfile\`, but it will be removed in a later release.
Ifthe\`--immutable-cache\` option is set, Yarn will abort with an error exit code if the cache folder was to be modified (either because files would be added, or because they'd be removed).
Ifthe\`--check-cache\` option is set, Yarn will always refetch the packages and will ensure that their checksum matches what's 1/ described in the lockfile 2/ inside the existing cache files (if present). This is recommended as part of your CI workflow if you're both following the Zero-Installs model and accepting PRs from third-parties, as they'd otherwise have the ability to alter the checked-in packages before submitting them.
Ifthe\`--inline-builds\` option is set, Yarn will verbosely print the output of the build steps of your dependencies (instead of writing them into individual files). This is likely useful mostly for debug purposes only when using Docker-like environments.
Ifthe\`--skip-builds\` option is set, Yarn 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.
`,examples:[["Install the project","$0 install"],["Validate a project when using Zero-Installs","$0 install --immutable --immutable-cache"],["Validate a project when using Zero-Installs (slightly safer if you accept external PRs)","$0 install --immutable --immutable-cache --check-cache"]]});var Ite=Qp,J2e="|||||||",W2e=">>>>>>>",z2e="=======",Ete="<<<<<<<";async function j2e(t,e){if(!t.projectCwd)return!1;let r=B.join(t.projectCwd,t.get("lockfileFilename"));if(!await M.existsPromise(r))return!1;let i=await M.readFilePromise(r,"utf8");if(!i.includes(Ete))return!1;if(e)throw new Ze(z.AUTOMERGE_IMMUTABLE,"Cannot autofix a lockfile when running an immutable install");let[n,s]=V2e(i),o,a;try{o=Nr(n),a=Nr(s)}catch(c){throw new Ze(z.AUTOMERGE_FAILED_TO_PARSE,"The individual variants of the lockfile failed to parse")}let l=P(P({},o),a);for(let[c,u]of Object.entries(l))typeof u=="string"&&delete l[c];return await M.changeFilePromise(r,_s(l),{automaticNewlines:!0}),!0}function V2e(t){let e=[[],[]],r=t.split(/\r?\n/g),i=!1;for(;r.length>0;){let n=r.shift();if(typeof n=="undefined")throw new Error("Assertion failed: Some lines should remain");if(n.startsWith(Ete)){for(;r.length>0;){let s=r.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s===z2e){i=!1;break}else if(i||s.startsWith(J2e)){i=!0;continue}else e[0].push(s)}for(;r.length>0;){let s=r.shift();if(typeof s=="undefined")throw new Error("Assertion failed: Some lines should remain");if(s.startsWith(W2e))break;e[1].push(s)}}else e[0].push(n),e[1].push(n)}return[e[0].join(`
`),e[1].join(`
`)]}var bp=class extends Be{constructor(){super(...arguments);this.all=j.Boolean("-A,--all",!1,{description:"Link all workspaces belonging to the target project to the current one"});this.private=j.Boolean("-p,--private",!1,{description:"Also link private workspaces belonging to the target project to the current one"});this.relative=j.Boolean("-r,--relative",!1,{description:"Link workspaces using relative paths instead of absolute paths"});this.destination=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=B.resolve(this.context.cwd,L.toPortablePath(this.destination)),o=await Ae.find(s,this.context.plugins,{useRc:!1,strict:!1}),{project:a,workspace:l}=await Fe.find(o,s);if(r.cwd===a.cwd)throw new me("Invalid destination; Can't link the project to itself");if(!l)throw new Xe(a.cwd,s);let c=r.topLevelWorkspace,u=[];if(this.all){for(let h of a.workspaces)h.manifest.name&&(!h.manifest.private||this.private)&&u.push(h);if(u.length===0)throw new me("No workspace found to be linked in the target project")}else{if(!l.manifest.name)throw new me("The target workspace doesn't have a name and thus cannot be linked");if(l.manifest.private&&!this.private)throw new me("The target workspace is marked private - use the --private flag to link it anyway");u.push(l)}for(let h of u){let f=w.stringifyIdent(h.locator),p=this.relative?B.relative(r.cwd,h.cwd):h.cwd;c.manifest.resolutions.push({pattern:{descriptor:{fullName:f}},reference:`portal:${p}`})}return(await Se.start({configuration:e,stdout:this.context.stdout},async h=>{await r.install({cache:n,report:h})})).exitCode()}};bp.paths=[["link"]],bp.usage=fe.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 a remote workspace for use in the current project","$0 link ~/ts-loader"],["Register all workspaces from a remote project for use in the current project","$0 link ~/jest --all"]]});var yte=bp;var Dp=class extends Be{constructor(){super(...arguments);this.args=j.Proxy()}async execute(){return this.cli.run(["exec","node",...this.args])}};Dp.paths=[["node"]],Dp.usage=fe.Usage({description:"run node with the hook already setup",details:`
`,examples:[["Run a Node script","$0 node ./my-script.js"]]});var Bte=Dp;var Rte=te(require("os"));var Dte=te(require("os"));var X2e="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function pl(t){let e=await Ut.get(X2e,{configuration:t});return Nr(e.toString())}var Sp=class extends Be{constructor(){super(...arguments);this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins);return(await Se.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{let n=await pl(e);for(let s of Object.entries(n)){let[l,o]=s,a=o,{experimental:c}=a,u=vr(a,["experimental"]);let g=l;c&&(g+=" [experimental]"),i.reportJson(P({name:l,experimental:c},u)),i.reportInfo(null,g)}})).exitCode()}};Sp.paths=[["plugin","list"]],Sp.usage=fe.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 `yarnpluginimport`.\n ",examples:[["List the official plugins","$0 plugin list"]]});var wte=Sp;var Qte=te(Cr()),xp=class extends Be{constructor(){super(...arguments);this.onlyIfNeeded=j.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins);if(e.get("yarnPath")&&this.onlyIfNeeded)return 0;let r;if(this.version==="latest"||this.version==="berry")r="https://github.com/yarnpkg/berry/raw/master/packages/yarnpkg-cli/bin/yarn.js";else if(this.version==="classic")r="https://nightly.yarnpkg.com/latest.js";else if(vt.satisfiesWithPrereleases(this.version,">=2.0.0"))r=`https://github.com/yarnpkg/berry/raw/%40yarnpkg/cli/${this.version}/packages/yarnpkg-cli/bin/yarn.js`;else if(vt.satisfiesWithPrereleases(this.version,"^0.x || ^1.x"))r=`https://github.com/yarnpkg/yarn/releases/download/v${this.version}/yarn-${this.version}.js`;else throw vt.validRange(this.version)?new me("Support for ranges got removed - please use the exact version you want to install, or 'latest' to get the latest build available"):new me(`Invalid version descriptor "${this.version}"`);return(await Se.start({configuration:e,stdout:this.context.stdout},async n=>{n.reportInfo(z.UNNAMED,`Downloading ${ce.pretty(e,r,"green")}`);let s=await Ut.get(r,{configuration:e});await Qv(e,null,s,{report:n})})).exitCode()}};xp.paths=[["set","version"]],xp.usage=fe.Usage({description:"lock the Yarn version used by the project",details:"\n This command will download a specific release of Yarn directly from the Yarn GitHub repository, will store it inside your project, and will change the `yarnPath` settings from your project `.yarnrc.yml` file to point to the new file.\n\n A very good use case for this command is to enforce the version of Yarn used by the any single member of your team inside a same project - by doing this you ensure that you have control on Yarn upgrades and downgrades (including on your deployment servers), and get rid of most of the headaches related to someone using a slightly different version and getting a different behavior than you.\n ",examples:[["Download the latest release from the Yarn repository","$0 set version latest"],["Download the latest classic release from the Yarn repository","$0 set version classic"],["Download a specific Yarn 2 build","$0 set version 2.0.0-rc.30"],["Switch back to a specific Yarn 1 release","$0 set version 1.22.1"]]});var bte=xp;async function Qv(t,e,r,{report:i}){var g;e===null&&await M.mktempPromise(async h=>{let f=B.join(h,"yarn.cjs");await M.writeFilePromise(f,r);let{stdout:p}=await pr.execvp(process.execPath,[L.fromPortablePath(f),"--version"],{cwd:h,env:V(P({},process.env),{YARN_IGNORE_PATH:"1"})});if(e=p.trim(),!Qte.default.valid(e))throw new Error(`Invalid semver version. ${ce.pretty(t,"yarn --version",ce.Type.CODE)} returned:
${e}`)});let n=(g=t.projectCwd)!=null?g:t.startingCwd,s=B.resolve(n,".yarn/releases"),o=B.resolve(s,`yarn-${e}.cjs`),a=B.relative(t.startingCwd,o),l=B.relative(n,o),c=t.get("yarnPath"),u=c===null||c.startsWith(`${s}/`);i.reportInfo(z.UNNAMED,`Savingthenewreleasein${ce.pretty(t,a,"magenta")}`),await M.removePromise(B.dirname(o)),await M.mkdirPromise(B.dirname(o),{recursive:!0}),await M.writeFilePromise(o,r),await M.chmodPromise(o,493),u&&await Ae.updateConfiguration(n,{yarnPath:l})}var Z2e=/^[0-9]+$/;function Ste(t){return Z2e.test(t)?`pull/${t}/head`:t}var _2e=({repository:t,branch:e},r)=>[["git","init",L.fromPortablePath(r)],["git","remote","add","origin",t],["git","fetch","origin",Ste(e)],["git","reset","--hard","FETCH_HEAD"]],$2e=({branch:t})=>[["git","fetch","origin",Ste(t),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx"]],eHe=({plugins:t,noMinify:e},r)=>[["yarn","build:cli",...new Array().concat(...t.map(i=>["--plugin",B.resolve(r,i)])),...e?["--no-minify"]:[],"|"]],Pp=class extends Be{constructor(){super(...arguments);this.installPath=j.String("--path",{description:"The path where the repository should be cloned to"});this.repository=j.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=j.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=j.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.noMinify=j.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=j.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=j.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r}=await Fe.find(e,this.context.cwd),i=typeof this.installPath!="undefined"?B.resolve(this.context.cwd,L.toPortablePath(this.installPath)):B.resolve(L.toPortablePath((0,Dte.tmpdir)()),"yarnpkg-sources",wi.makeHash(this.repository).slice(0,6));return(await Se.start({configuration:e,stdout:this.context.stdout},async s=>{await Dv(this,{configuration:e,report:s,target:i}),s.reportSeparator(),s.reportInfo(z.UNNAMED,"Building a fresh bundle"),s.reportSeparator(),await kp(eHe(this,i),{configuration:e,context:this.context,target:i}),s.reportSeparator();let o=B.resolve(i,"packages/yarnpkg-cli/bundles/yarn.js"),a=await M.readFilePromise(o);await Qv(e,"sources",a,{report:s}),this.skipPlugins||await tHe(this,{project:r,report:s,target:i})})).exitCode()}};Pp.paths=[["set","version","from","sources"]],Pp.usage=fe.Usage({description:"build Yarn from master",details:`
`,examples:[["Build Yarn from master","$0 set version from sources"]]});var xte=Pp;async function kp(t,{configuration:e,context:r,target:i}){for(let[n,...s]of t){let o=s[s.length-1]==="|";if(o&&s.pop(),o)await pr.pipevp(n,s,{cwd:i,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${ce.pretty(e,`$${[n,...s].join(" ")}`,"grey")}
`);try{await pr.execvp(n,s,{cwd:i,strict:!0})}catch(a){throw r.stdout.write(a.stdout||a.stack),a}}}}async function Dv(t,{configuration:e,report:r,target:i}){let n=!1;if(!t.force&&M.existsSync(B.join(i,".git"))){r.reportInfo(z.UNNAMED,"Fetching the latest commits"),r.reportSeparator();try{await kp($2e(t),{configuration:e,context:t.context,target:i}),n=!0}catch(s){r.reportSeparator(),r.reportWarning(z.UNNAMED,"Repository update failed; we'll try to regenerate it")}}n||(r.reportInfo(z.UNNAMED,"Cloning the remote repository"),r.reportSeparator(),await M.removePromise(i),await M.mkdirPromise(i,{recursive:!0}),await kp(_2e(t,i),{configuration:e,context:t.context,target:i}))}async function tHe(t,{project:e,report:r,target:i}){let n=await pl(e.configuration),s=new Set(Object.keys(n));for(let o of e.configuration.plugins.keys())!s.has(o)||await bv(o,t,{project:e,report:r,target:i})}var Pte=te(Cr()),kte=te(require("url")),vte=te(require("vm"));var vp=class extends Be{constructor(){super(...arguments);this.name=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins);return(await Se.start({configuration:e,stdout:this.context.stdout},async i=>{let{project:n}=await Fe.find(e,this.context.cwd),s,o;if(this.name.match(/^\.{0,2}[\\/]/)||L.isAbsolute(this.name)){let a=B.resolve(this.context.cwd,L.toPortablePath(this.name));i.reportInfo(z.UNNAMED,`Reading${ce.pretty(e,a,ce.Type.PATH)}`),s=B.relative(n.cwd,a),o=await M.readFilePromise(a)}else{let a;if(this.name.match(/^https?:/)){try{new kte.URL(this.name)}catch{throw new Ze(z.INVALID_PLUGIN_REFERENCE,`Pluginspecifier"${this.name}"isneitherapluginnamenoravalidurl`)}s=this.name,a=this.name}else{let l=w.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(l.reference!=="unknown"&&!Pte.default.valid(l.reference))throw new Ze(z.UNNAMED,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let c=w.stringifyIdent(l),u=await pl(e);if(!Object.prototype.hasOwnProperty.call(u,c))throw new Ze(z.PLUGIN_NAME_NOT_FOUND,`Couldn'tfindapluginnamed"${c}"ontheremoteregistry.Notethatonlythepluginsreferencedonourwebsite(https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be referenced by their name; any other plugin will have to be referenced through its public url (for example https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js).`);s=c,a=u[c].url,l.reference!=="unknown"?a=a.replace(/\/master\//,`/${c}/${l.reference}/`):Yi!==null&&(a=a.replace(/\/master\//,`/@yarnpkg/cli/${Yi}/`))}i.reportInfo(z.UNNAMED,`Downloading ${ce.pretty(e,a,"green")}`),o=await Ut.get(a,{configuration:e})}await Sv(s,o,{project:n,report:i})})).exitCode()}};vp.paths=[["plugin","import"]],vp.usage=fe.Usage({category:"Plugin-related commands",description:"download a plugin",details:`
`,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"]]});var Fte=vp;async function Sv(t,e,{project:r,report:i}){let{configuration:n}=r,s={},o={exports:s};(0,vte.runInNewContext)(e.toString(),{module:o,exports:s});let a=o.exports.name,l=`.yarn/plugins/${a}.cjs`,c=B.resolve(r.cwd,l);i.reportInfo(z.UNNAMED,`Savingthenewpluginin${ce.pretty(n,l,"magenta")}`),await M.mkdirPromise(B.dirname(c),{recursive:!0}),await M.writeFilePromise(c,e);let u={path:l,spec:t};await Ae.updateConfiguration(r.cwd,g=>{let h=[],f=!1;for(let p of g.plugins||[]){let m=typeof p!="string"?p.path:p,I=B.resolve(r.cwd,L.toPortablePath(m)),{name:y}=de.dynamicRequire(L.fromPortablePath(I));y!==a?h.push(p):(h.push(u),f=!0)}return f||h.push(u),V(P({},g),{plugins:h})})}var rHe=({pluginName:t,noMinify:e},r)=>[["yarn",`build:${t}`,...e?["--no-minify"]:[],"|"]],Fp=class extends Be{constructor(){super(...arguments);this.installPath=j.String("--path",{description:"The path where the repository should be cloned to"});this.repository=j.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=j.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=j.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=j.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),r=typeof this.installPath!="undefined"?B.resolve(this.context.cwd,L.toPortablePath(this.installPath)):B.resolve(L.toPortablePath((0,Rte.tmpdir)()),"yarnpkg-sources",wi.makeHash(this.repository).slice(0,6));return(await Se.start({configuration:e,stdout:this.context.stdout},async n=>{let{project:s}=await Fe.find(e,this.context.cwd),o=w.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),a=w.stringifyIdent(o),l=await pl(e);if(!Object.prototype.hasOwnProperty.call(l,a))throw new Ze(z.PLUGIN_NAME_NOT_FOUND,`Couldn'tfindapluginnamed"${a}"ontheremoteregistry.Notethatonlythepluginsreferencedonourwebsite(https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let c=a;await Dv(this,{configuration:e,report:n,target:r}),await bv(c,this,{project:s,report:n,target:r})})).exitCode()}};Fp.paths=[["plugin","import","from","sources"]],Fp.usage=fe.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:`
**Note:**Thepluginshavetobereferencedbytheirnameproperty,whichcanbeobtainedusingthe\`yarn plugin runtime\` command. Shorthands are not allowed.
`,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"]]});var Nte=Rp;var Lp=class extends Be{constructor(){super(...arguments);this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins);return(await Se.start({configuration:e,json:this.json,stdout:this.context.stdout},async i=>{for(let n of e.plugins.keys()){let s=this.context.plugins.plugins.has(n),o=n;s&&(o+=" [builtin]"),i.reportJson({name:n,builtin:s}),i.reportInfo(null,`${o}`)}})).exitCode()}};Lp.paths=[["plugin","runtime"]],Lp.usage=fe.Usage({category:"Plugin-related commands",description:"list the active plugins",details:`
`,examples:[["List the currently active plugins","$0 plugin runtime"]]});var Mte=Lp;var Np=class extends Be{constructor(){super(...arguments);this.idents=j.Rest()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);let s=new Set;for(let a of this.idents)s.add(w.parseIdent(a).identHash);if(await r.restoreInstallState({restoreResolutions:!1}),await r.resolveEverything({cache:n,report:new Br}),s.size>0)for(let a of r.storedPackages.values())s.has(a.identHash)&&r.storedBuildState.delete(a.locatorHash);else r.storedBuildState.clear();return(await Se.start({configuration:e,stdout:this.context.stdout,includeLogs:!this.context.quiet},async a=>{await r.install({cache:n,report:a})})).exitCode()}};Np.paths=[["rebuild"]],Np.usage=fe.Usage({description:"rebuild the project's native packages",details:`
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]});var Ote=Np;var xv=te(sn());var Mp=class extends Be{constructor(){super(...arguments);this.all=j.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.patterns=j.Rest()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=this.all?r.workspaces:[i],o=[er.REGULAR,er.DEVELOPMENT,er.PEER],a=[],l=!1,c=[];for(let f of this.patterns){let p=!1,m=w.parseIdent(f);for(let I of s){let y=[...I.manifest.peerDependenciesMeta.keys()];for(let b of(0,xv.default)(y,f))I.manifest.peerDependenciesMeta.delete(b),l=!0,p=!0;for(let b of o){let x=I.manifest.getForScope(b),F=[...x.values()].map(N=>w.stringifyIdent(N));for(let N of(0,xv.default)(F,w.stringifyIdent(m))){let{identHash:U}=w.parseIdent(N),v=x.get(U);if(typeof v=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");I.manifest[b].delete(U),c.push([I,b,v]),l=!0,p=!0}}}p||a.push(f)}let u=a.length>1?"Patterns":"Pattern",g=a.length>1?"don't":"doesn't",h=this.all?"any":"this";if(a.length>0)throw new me(`${u}${ce.prettyList(e,a,$A.CODE)}${g}matchanypackagesreferencedby${h}workspace`);return l?(await e.triggerMultipleHooks(p=>p.afterWorkspaceDependencyRemoval,c),(await Se.start({configuration:e,stdout:this.context.stdout},async p=>{await r.install({cache:n,report:p})})).exitCode()):0}};Mp.paths=[["remove"]],Mp.usage=fe.Usage({description:"remove dependencies from the project",details:`
Thiscommandacceptsglobpatternsasarguments(ifvalidIdentsandsupportedby[micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.
`,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}'"]]});var Tte=Mp;var Kte=te(require("util")),sB=class extends Be{async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd);if(!i)throw new Xe(r.cwd,this.context.cwd);return(await Se.start({configuration:e,stdout:this.context.stdout},async s=>{let o=i.manifest.scripts,a=de.sortMap(o.keys(),u=>u),l={breakLength:Infinity,colors:e.get("enableColors"),maxArrayLength:2},c=a.reduce((u,g)=>Math.max(u,g.length),0);for(let[u,g]of o.entries())s.reportInfo(null,`${u.padEnd(c," ")}${(0,Kte.inspect)(g,l)}`)})).exitCode()}};sB.paths=[["run"]];var Ute=sB;var Op=class extends Be{constructor(){super(...arguments);this.inspect=j.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=j.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=j.Boolean("-T,--top-level",!1,{hidden:!0});this.binariesOnly=j.Boolean("-B,--binaries-only",!1,{hidden:!0});this.silent=j.Boolean("--silent",{hidden:!0});this.scriptName=j.String();this.args=j.Proxy()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i,locator:n}=await Fe.find(e,this.context.cwd);await r.restoreInstallState();let s=this.topLevel?r.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await bt.hasPackageScript(s,this.scriptName,{project:r}))return await bt.executePackageScript(s,this.scriptName,this.args,{project:r,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let o=await bt.getPackageAccessibleBinaries(s,{project:r});if(o.get(this.scriptName)){let l=[];return this.inspect&&(typeof this.inspect=="string"?l.push(`--inspect=${this.inspect}`):l.push("--inspect")),this.inspectBrk&&(typeof this.inspectBrk=="string"?l.push(`--inspect-brk=${this.inspectBrk}`):l.push("--inspect-brk")),await bt.executePackageAccessibleBinary(s,this.scriptName,this.args,{cwd:this.context.cwd,project:r,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:l,packageAccessibleBinaries:o})}if(!this.topLevel&&!this.binariesOnly&&i&&this.scriptName.includes(":")){let c=(await Promise.all(r.workspaces.map(async u=>u.manifest.scripts.has(this.scriptName)?u:null))).filter(u=>u!==null);if(c.length===1)return await bt.executeWorkspaceScript(c[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 me(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${w.prettyLocator(e,n)}). This typically happens because some package depends on "node-gyp" to build itself, but didn'tlistitintheirdependencies.Tofixthat,pleaserun"yarn add node-gyp"intoyourtop-levelworkspace.Youalsocanopenanissueontherepositoryofthespecifiedpackagetosuggestthemtouseanoptionalpeerdependency.`):new me(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${w.prettyLocator(e,n)}).`);{if(this.scriptName==="global")throw new me("The 'yarnglobal' commands have been removed in 2.x - consider using 'yarndlx' or a third-party plugin instead");let l=[this.scriptName].concat(this.args);for(let[c,u]of hu)for(let g of u)if(l.length>=g.length&&JSON.stringify(l.slice(0,g.length))===JSON.stringify(g))throw new me(`Couldn'tfindascriptnamed"${this.scriptName}",butamatchingcommandcanbefoundinthe${c}plugin.Youcaninstallitwith"yarn plugin import ${c}".`);throw new me(`Couldn'tfindascriptnamed"${this.s
`,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"]]});var Hte=Op;var Tp=class extends Be{constructor(){super(...arguments);this.save=j.Boolean("-s,--save",!1,{description:"Persist the resolution inside the top-level manifest"});this.descriptor=j.String();this.resolution=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(await r.restoreInstallState({restoreResolutions:!1}),!i)throw new Xe(r.cwd,this.context.cwd);let s=w.parseDescriptor(this.descriptor,!0),o=w.makeDescriptor(s,this.resolution);return r.storedDescriptors.set(s.descriptorHash,s),r.storedDescriptors.set(o.descriptorHash,o),r.resolutionAliases.set(s.descriptorHash,o.descriptorHash),(await Se.start({configuration:e,stdout:this.context.stdout},async l=>{await r.install({cache:n,report:l})})).exitCode()}};Tp.paths=[["set","resolution"]],Tp.usage=fe.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"]]});var Yte=Tp;var qte=te(sn()),Kp=class extends Be{constructor(){super(...arguments);this.all=j.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=j.Rest()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);let s=r.topLevelWorkspace,o=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:l,reference:c}of s.manifest.resolutions)c.startsWith("portal:")&&o.add(l.descriptor.fullName);if(this.leadingArguments.length>0)for(let l of this.leadingArguments){let c=B.resolve(this.context.cwd,L.toPortablePath(l));if(de.isPathLike(l)){let u=await Ae.find(c,this.context.plugins,{useRc:!1,strict:!1}),{project:g,workspace:h}=await Fe.find(u,c);if(!h)throw new Xe(g.cwd,c);if(this.all){for(let f of g.workspaces)f.manifest.name&&o.add(w.stringifyIdent(f.locator));if(o.size===0)throw new me("No workspace found to be unlinked in the target project")}else{if(!h.manifest.name)throw new me("The target workspace doesn't have a name and thus cannot be unlinked");o.add(w.stringifyIdent(h.locator))}}else{let u=[...s.manifest.resolutions.map(({pattern:g})=>g.descriptor.fullName)];for(let g of(0,qte.default)(u,l))o.add(g)}}return s.manifest.resolutions=s.manifest.resolutions.filter(({pattern:l})=>!o.has(l.descriptor.fullName)),(await Se.start({configuration:e,stdout:this.context.stdout},async l=>{await r.install({cache:n,report:l})})).exitCode()}};Kp.paths=[["unlink"]],Kp.usage=fe.Usage({description:"disconnect the local project from another one",details:`
`,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}'"]]});var Gte=Kp;var jte=te(lp()),Pv=te(sn());Mo();var Fu=class extends Be{constructor(){super(...arguments);this.interactive=j.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.exact=j.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=j.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=j.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=j.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.patterns=j.Rest()}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=[...r.storedDescriptors.values()],o=s.map(u=>w.stringifyIdent(u)),a=new Set;for(let u of this.patterns){if(w.parseDescriptor(u).range!=="unknown")throw new me("Ranges aren't allowed when using --recursive");for(let g of(0,Pv.default)(o,u)){let h=w.parseIdent(g);a.add(h.identHash)}}let l=s.filter(u=>a.has(u.identHash));for(let u of l)r.storedDescriptors.delete(u.descriptorHash),r.storedResolutions.delete(u.descriptorHash);return(await Se.start({configuration:e,stdout:this.context.stdout},async u=>{await r.install({cache:n,report:u})})).exitCode()}async executeUpClassic(){var m;let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd),n=await gt.find(e);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState({restoreResolutions:!1});let s=(m=this.interactive)!=null?m:e.get("preferInteractive"),o=cp(this,r),a=s?[sr.KEEP,sr.REUSE,sr.PROJECT,sr.LATEST]:[sr.PROJECT,sr.LATEST],l=[],c=[];for(let I of this.patterns){let y=!1,b=w.parseDescriptor(I);for(let x of r.workspaces)for(let F of[er.REGULAR,er.DEVELOPMENT]){let U=[...x.manifest.getForScope(F).values()].map(v=>w.stringifyIdent(v));for(let v of(0,Pv.default)(U,w.stringifyIdent(b))){let J=w.parseIdent(v),oe=x.manifest[F].get(J.identHash);if(typeof oe=="undefined")throw new Error("Assertion failed: Expected the descriptor to be registered");let T=w.makeDescriptor(J,b.range);l.push(Promise.resolve().then(async()=>[x,F,oe,await up(T,{project:r,workspace:x,cache:n,target:F,modifier:o,strategies:a})])),y=!0}}y||c.push(I)}if(c.length>1)throw new me(`Patterns${ce.prettyList(e,c,$A.CODE)}don't match any packages referenced by any workspace`);if(c.length>0)throw new me(`Pattern ${ce.prettyList(e,c,$A.CODE)} doesn'tmatchanypackagesreferencedbyanyworkspace`);let u=await Promise.all(l),g=await ao.start({configuration:e,stdout:this.context.stdout,suggestInstall:!1},async I=>{for(let[,,y,{suggestions:b,rejections:x}]of u){let F=b.filter(N=>N.descriptor!==null);if(F.length===0){let[N]=x;if(typeof N=="undefined")throw new Error("Assertion failed: Expected an error to have been set");let U=this.cli.error(N);r.configuration.get("enableNetwork")?I.reportError(z.CANT_SUGGEST_RESOLUTIONS,`${w.prettyDescriptor(e,y)}can'tberesolvedtoasatisfyingrange
${U}`)}else F.length>1&&!s&&I.reportError(z.CANT_SUGGEST_RESOLUTIONS,`${w.prettyDescriptor(e,y)}hasmultiplepossibleupgradestrategies;use-itodisambiguatemanually`)}});if(g.hasErrors())return g.exitCode();let h=!1,f=[];for(let[I,y,,{suggestions:b}]of u){let x,F=b.filter(J=>J.descriptor!==null),N=F[0].descriptor,U=F.every(J=>w.areDescriptorsEqual(J.descriptor,N));F.length===1||U?x=N:(h=!0,{answer:x}=await(0,jte.prompt)({type:"select",name:"answer",message:`Whichrangetoyouwanttousein${w.prettyWorkspace(e,I)}\u276F${y}?`,choices:b.map(({descriptor:J,name:oe,reason:T})=>J?{name:oe,hint:T,descriptor:J}:{name:oe,hint:T,disabled:!0}),onCancel:()=>process.exit(130),result(J){return this.find(J,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let v=I.manifest[y].get(x.identHash);if(typeof v=="undefined")throw new Error("Assertion failed: This descriptor should have a matching entry");if(v.descriptorHash!==x.descriptorHash)I.manifest[y].set(x.identHash,x),f.push([I,y,v,x]);else{let J=e.makeResolver(),oe={project:r,resolver:J},T=J.bindDescriptor(v,I.anchoredLocator,oe);r.forgetResolution(T)}}return await e.triggerMultipleHooks(I=>I.afterWorkspaceDependencyReplacement,f),h&&this.context.stdout.write(`
`),(await Se.start({configuration:e,stdout:this.context.stdout},async I=>{await r.install({cache:n,report:I})})).exitCode()}};Fu.paths=[["up"]],Fu.usage=fe.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 `yarnup` 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 `yarnup` and `yarnup-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 Generally you can see `yarnup` as a counterpart to what was `yarnupgrade--latest` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike `yarnupgrade` which only upgraded dependencies in the current workspace, `yarnup` 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'"]]}),Fu.schema=[lQ("recursive",tA.Forbids,["interactive","exact","tilde","caret"],{ignore:[void 0,!1]})];var Jte=Fu;var Up=class extends Be{constructor(){super(...arguments);this.recursive=j.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=j.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState();let n=w.parseIdent(this.package).identHash,s=this.recursive?nHe(r,n,{configuration:e,peers:this.peers}):iHe(r,n,{configuration:e,peers:this.peers});Kn.emitTree(s,{configuration:e,stdout:this.context.stdout,json:this.json,separators:1})}};Up.paths=[["why"]],Up.usage=fe.Usage({description:"display the reason why a package is needed",details:`
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.
`,examples:[["Explain why lodash is used in your project","$0 why lodash"]]});var Wte=Up;function iHe(t,e,{configuration:r,peers:i}){let n=de.sortMap(t.storedPackages.values(),a=>w.stringifyLocator(a)),s={},o={children:s};for(let a of n){let l={},c=null;for(let u of a.dependencies.values()){if(!i&&a.peerDependencies.has(u.identHash))continue;let g=t.storedResolutions.get(u.descriptorHash);if(!g)throw new Error("Assertion failed: The resolution should have been registered");let h=t.storedPackages.get(g);if(!h)throw new Error("Assertion failed: The package should have been registered");if(h.identHash!==e)continue;if(c===null){let p=w.stringifyLocator(a);s[p]={value:[a,ce.Type.LOCATOR],children:l}}let f=w.stringifyLocator(h);l[f]={value:[{descriptor:u,locator:h},ce.Type.DEPENDENT]}}}return o}function nHe(t,e,{configuration:r,peers:i}){let n=de.sortMap(t.workspaces,h=>w.stringifyLocator(h.anchoredLocator)),s=new Set,o=new Set,a=h=>{if(s.has(h.locatorHash))return o.has(h.locatorHash);if(s.add(h.locatorHash),h.identHash===e)return o.add(h.locatorHash),!0;let f=!1;h.identHash===e&&(f=!0);for(let p of h.dependencies.values()){if(!i&&h.peerDependencies.has(p.identHash))continue;let m=t.storedResolutions.get(p.descriptorHash);if(!m)throw new Error("Assertion failed: The resolution should have been registered");let I=t.storedPackages.get(m);if(!I)throw new Error("Assertion failed: The package should have been registered");a(I)&&(f=!0)}return f&&o.add(h.locatorHash),f};for(let h of n){let f=t.storedPackages.get(h.anchoredLocator.locatorHash);if(!f)throw new Error("Assertion failed: The package should have been registered");a(f)}let l=new Set,c={},u={children:c},g=(h,f,p)=>{if(!o.has(h.locatorHash))return;let m=p!==null?ce.tuple(ce.Type.DEPENDENT,{locator:h,descriptor:p}):ce.tuple(ce.Type.LOCATOR,h),I={},y={value:m,children:I},b=w.stringifyLocator(h);if(f[b]=y,!l.has(h.locatorHash)&&(l.add(h.locatorHash),!(p!==null&&t.tryWorkspaceByLocator(h))))for(let x of h.dependencies.values()){if(!i&&h.peerDependencies.has(x.identHash))continue;let F=t.storedResolutions.get(x.descriptorHash);if(!F)throw new Error("Assertion failed: The resolution should have been registered");let N=t.storedPackages.get(F);if(!N)throw new Error("Assertion failed: The package should have been registered");g(N,I,x)}};for(let h of n){let f=t.storedPackages.get(h.anchoredLocator.locatorHash);if(!f)throw new Error("Assertion failed: The package should have been registered");g(f,c,null)}return u}var Hp=class extends Be{constructor(){super(...arguments);this.verbose=j.Boolean("-v,--verbose",!1,{description:"Also return the cross-dependencies between workspaces"});this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r}=await Fe.find(e,this.context.cwd);return(await Se.start({configuration:e,json:this.json,stdout:this.context.stdout},async n=>{for(let s of r.workspaces){let{manifest:o}=s,a;if(this.verbose){let l=new Set,c=new Set;for(let u of ze.hardDependencies)for(let[g,h]of o.getForScope(u)){let f=r.tryWorkspaceByDescriptor(h);f===null?r.workspacesByIdent.has(g)&&c.add(h):l.add(f)}a={workspaceDependencies:Array.from(l).map(u=>u.relativeCwd),mismatchedWorkspaceDependencies:Array.from(c).map(u=>w.stringifyDescriptor(u))}}n.reportInfo(null,`${s.relativeCwd}`),n.reportJson(P({location:s.relativeCwd,name:o.name?w.stringifyIdent(o.name):null},a))}})).exitCode()}};Hp.paths=[["workspaces","list"]],Hp.usage=fe.Usage({category:"Workspace-related commands",description:"list all available workspaces",details:"\n This command will print the list of all workspaces in the project. If both the `-v,--verbose` and `--json` options are set, Yarn will also return the cross-dependencies between each workspaces (useful when you wish to automatically generate Buck / Bazel rules).\n "});var zte=Hp;var Yp=class extends fe{constructor(){super(...arguments);this.workspaceName=j.String();this.commandName=j.String();this.args=j.Proxy()}async execute(){let e=await Ae.fi
-${a.join(`
-`)}?`)}returnthis.cli.run([this.commandName,...this.args],{cwd:o.cwd})}};Yp.paths=[["workspace"]],Yp.usage=fe.Usage({category:"Workspace-related commands",description:"run a command within the specified workspace",details:`
`,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 Vte=Yp;var sHe={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:ge.BOOLEAN,default:Xte.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:ge.STRING,values:["^","~",""],default:hl.CARET}},commands:[F$,L$,Vee,ste,Yte,xte,bte,zte,ute,gte,hte,fte,k$,v$,ote,Ate,pte,dte,mte,Ite,yte,Gte,Bte,Lte,Fte,Nte,wte,Mte,Ote,Tte,Ute,Hte,Jte,Wte,Vte]},oHe=sHe;var Lv={};$e(Lv,{default:()=>AHe});var Zr={optional:!0},Zte=[["@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:Zr,zenObservable:Zr}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:Zr,zenObservable:Zr}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{["supports-color"]:Zr}}],["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"]:Zr,["postcss-jsx"]:Zr,["postcss-less"]:Zr,["postcss-markdown"]:Zr,["postcss-scss"]:Zr}}],["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@*",{peerDependenciesMeta:{webpack:Zr}}],["snowpack@>=3.3.0",{dependencies:{["node-gyp"]:"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:Zr}}],["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@*",{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@*",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:Zr,"vue-template-compiler":Zr}}],["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:Zr,"utf-8-validate":Zr}}],["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:{["cross-spawn"]:"^7.0.3"}}],["gatsby-remark-prismjs@<3.3.28",{dependencies:{lodash:"^4"}}],["gatsby-plugin-favicon@*",{peerDepen
`);let u=await Ae.find(r,this.context.plugins),{project:g,workspace:h}=await Fe.find(u,r);if(h===null)throw new Xe(g.cwd,r);await g.restoreInstallState();let f=await bt.getWorkspaceAccessibleBinaries(h);return f.has(l)===!1&&f.size===1&&typeof this.packages=="undefined"&&(l=Array.from(f)[0][0]),await bt.executeWorkspaceAccessibleBinary(h,l,this.args,{packageAccessibleBinaries:f,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};qp.paths=[["dlx"]],qp.usage=fe.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 `yarndlx` as a replacement of `yarnadd` 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"]]});var ire=qp;var lHe={commands:[rre,ire]},cHe=lHe;var Gv={};$e(Gv,{default:()=>hHe,fileUtils:()=>Mv});var Ru=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,Gp=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,or="file:";var Mv={};$e(Mv,{makeArchiveFromLocator:()=>aB,makeBufferFromLocator:()=>Kv,makeLocator:()=>Tv,makeSpec:()=>nre,parseSpec:()=>Ov});function Ov(t){let{params:e,selector:r}=w.parseRange(t),i=L.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?w.parseLocator(e.locator):null,path:i}}function nre({parentLocator:t,path:e,folderHash:r,protocol:i}){let n=t!==null?{locator:w.stringifyLocator(t)}:{},s=typeof r!="undefined"?{hash:r}:{};return w.makeRange({protocol:i,source:e,selector:e,params:P(P({},s),n)})}function Tv(t,{parentLocator:e,path:r,folderHash:i,protocol:n}){return w.makeLocator(t,nre({parentLocator:e,path:r,folderHash:i,protocol:n}))}async function aB(t,{protocol:e,fetchOptions:r,inMemory:i=!1}){let{parentLocator:n,path:s}=w.parseFileStyleRange(t.reference,{protocol:e}),o=B.isAbsolute(s)?{packageFs:new yt(Ee.root),prefixPath:Ee.dot,localPath:Ee.root}:await r.fetcher.fetch(n,r),a=o.localPath?{packageFs:new yt(Ee.root),prefixPath:B.relative(Ee.root,o.localPath)}:o;o!==a&&o.releaseFs&&o.releaseFs();let l=a.packageFs,c=B.join(a.prefixPath,s);return await de.releaseAfterUseAsync(async()=>await gr.makeArchiveFromDirectory(c,{baseFs:l,prefixPath:w.getIdentVendorPath(t),compressionLevel:r.project.configuration.get("compressionLevel"),inMemory:i}),a.releaseFs)}async function Kv(t,{protocol:e,fetchOptions:r}){return(await aB(t,{protocol:e,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var Uv=class{supports(e,r){return!!e.reference.startsWith(or)}getLocalPath(e,r){let{parentLocator:i,path:n}=w.parseFileStyleRange(e.reference,{protocol:or});if(B.isAbsolute(n))return n;let s=r.fetcher.getLocalPath(i,r);return s===null?null:B.resolve(s,n)}async fetch(e,r){let i=r.checksums.get(e.locatorHash)||null,[n,s,o]=await r.cache.fetchPackageFromCache(e,i,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${w.prettyLocator(r.project.configuration,e)}can'tbefoundinthecacheandwillbefetchedfromthedisk`),loader:()=>this.fetchFromDisk(e,r),skipIntegrityCheck:r.skipIntegrityCheck});return{packageFs:n,releaseFs:s,prefixPath:w.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:o}}async fetchFromDisk(e,r){return aB(e,{protocol:or,fetchOptions:r})}};var uHe=1,Hv=class{supportsDescriptor(e,r){return e.range.match(Ru)?!0:!!e.range.startsWith(or)}supportsLocator(e,r){return!!e.reference.startsWith(or)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i){return Ru.test(e.range)&&(e=w.makeDescriptor(e,`${or}${e.range}`)),w.bindDescriptor(e,{locator:w.stringifyLocator(r)})}getResolutionDependencies(e,r){return
`),!r){let l=B.join(this.context.cwd,mt.lockfile);await M.writeFilePromise(l,"");let u=["/.yarn/*","!/.yarn/patches","!/.yarn/plugins","!/.yarn/releases","!/.yarn/sdks","","# Swap the comments on the following lines if you don't wish to use zero-installs","# Documentation here: https://yarnpkg.com/features/zero-installs","!/.yarn/cache","#/.pnp.*"].map(m=>`${m}
`}let p=B.join(this.context.cwd,".editorconfig");M.existsSync(p)||await M.writeFilePromise(p,f),await pr.execvp("git",["init"],{cwd:this.context.cwd})}}};Xp.paths=[["init"]],Xp.usage=fe.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 `yarnsetversion` 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 eie=Xp;var NYe={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:ge.STRING,default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:ge.MAP,valueDefinition:{description:"",type:ge.ANY}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:ge.MAP,valueDefinition:{description:"",type:ge.ANY}}},commands:[eie]},MYe=NYe;var pF={};$e(pF,{default:()=>TYe});var fo="portal:",po="link:";var uF=class{supports(e,r){return!!e.reference.startsWith(fo)}getLocalPath(e,r){let{parentLocator:i,path:n}=w.parseFileStyleRange(e.reference,{protocol:fo});if(B.isAbsolute(n))return n;let s=r.fetcher.getLocalPath(i,r);return s===null?null:B.resolve(s,n)}async fetch(e,r){let{parentLocator:i,path:n}=w.parseFileStyleRange(e.reference,{protocol:fo}),s=B.isAbsolute(n)?{packageFs:new yt(Ee.root),prefixPath:Ee.dot,localPath:Ee.root}:await r.fetcher.fetch(i,r),o=s.localPath?{packageFs:new yt(Ee.root),prefixPath:B.relative(Ee.root,s.localPath)}:s;s!==o&&s.releaseFs&&s.releaseFs();let a=o.packageFs,l=B.join(o.prefixPath,n);return s.localPath?{packageFs:new yt(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Ee.dot,localPath:l}:{packageFs:new vs(l,{baseFs:a}),releaseFs:o.releaseFs,prefixPath:Ee.dot}}};var gF=class{supportsDescriptor(e,r){return!!e.range.startsWith(fo)}supportsLocator(e,r){return!!e.reference.startsWith(fo)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i){return w.bindDescriptor(e,{locator:w.stringifyLocator(r)})}getResolutionDependencies(e,r){return[]}async getCandidates(e,r,i){let n=e.range.slice(fo.length);return[w.makeLocator(e,`${fo}${L.toPortablePath(n)}`)]}async getSatisfying(e,r,i){return null}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let i=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),n=await de.releaseAfterUseAsync(async()=>await ze.find(i.prefixPath,{baseFs:i.packageFs}),i.releaseFs);return V(P({},e),{version:n.version||"0.0.0",languageName:r.project.configuration.get("defaultLanguageName"),linkType:At.SOFT,dependencies:new Map([...n.dependencies]),peerDependencies:n.peerDependencies,dependenciesMeta:n.dependenciesMeta,peerDependenciesMeta:n.peerDependenciesMeta,bin:n.bin})}};var hF=class{supports(e,r){return!!e.reference.startsWith(po)}getLocalPath(e,r){let{parentLocator:i,path:n}=w.parseFileStyleRange(e.reference,{protocol:po});if(B.isAbsolute(n))return n;let s=r.fetcher.getLocalPath(i,r);return s===null?null:B.resolve(s,n)}async fetch(e,r){let{parentLocator:i,path:n}=w.parseFileStyleRange(e.reference,{pro
${u},nexttree:
${Zp(a)}`);let h=iie(a);if(h)throw new Error(`${h},afterhoistingfinished:
${Zp(a)}`)}return s.debugLevel>=2&&console.log(Zp(a)),UYe(a)},HYe=t=>{let e=t[t.length-1],r=new Map,i=new Set,n=s=>{if(!i.has(s)){i.add(s);for(let o of s.hoistedDependencies.values())r.set(o.name,o);for(let o of s.dependencies.values())s.peerNames.has(o.name)||n(o)}};return n(e),r},YYe=t=>{let e=t[t.length-1],r=new Map,i=new Set,n=new Map;for(let a of t)for(let l of a.dependencies.values())n.set(l.name,l);let s=new Set,o=(a,l)=>{if(i.has(a))return;i.add(a);for(let u of a.hoistedDependencies.values())if(!l.has(u.name)){let g=n.get(u.name);g&&r.set(g.name,g)}let c=new Set;for(let u of a.dependencies.values())c.add(u.name);for(let u of a.dependencies.values())a.peerNames.has(u.name)||o(u,c)};return o(e,s),r},sie=(t,e)=>{if(e.decoupled)return e;let{name:r,references:i,ident:n,locator:s,dependencies:o,originalDependencies:a,hoistedDependencies:l,peerNames:c,reasons:u,isHoistBorder:g}=e,h={name:r,references:new Set(i),ident:n,locator:s,dependencies:new Map(o),originalDependencies:new Map(a),hoistedDependencies:new Map(l),peerNames:new Set(c),reasons:new Map(u),decoupled:!0,isHoistBorder:g,hoistedFrom:[]},f=h.dependencies.get(r);return f&&f.ident==h.ident&&h.dependencies.set(r,h),t.dependencies.set(h.name,h),h},qYe=(t,e)=>{let r=new Map([[t.name,[t.ident]]]);for(let n of t.dependencies.values())t.peerNames.has(n.name)||r.set(n.name,[n.ident]);let i=Array.from(e.keys());i.sort((n,s)=>{let o=e.get(n),a=e.get(s);return a.peerDependents.size!==o.peerDependents.size?a.peerDependents.size-o.peerDependents.size:a.dependents.size-o.dependents.size});for(let n of i){let s=n.substring(0,n.indexOf("@",1)),o=n.substring(s.length+1);if(!t.peerNames.has(s)){let a=r.get(s);a||(a=[],r.set(s,a)),a.indexOf(o)<0&&a.push(o)}}return r},EF=t=>{let e=new Set,r=(i,n=new Set)=>{if(!n.has(i)){n.add(i);for(let s of i.peerNames)if(!t.peerNames.has(s)){let o=t.dependencies.get(s);o&&!e.has(o)&&r(o,n)}e.add(i)}};for(let i of t.dependencies.values())t.peerNames.has(i.name)||r(i);return e},IF=(t,e,r,i,n,s=new Set)=>{let o=e[e.length-1];if(s.has(o))return{anotherRoundNeeded:!1,isGraphChanged:!1};s.add(o);let a=jYe(o),l=qYe(o,a),c=t==o?new Map:n.fastLookupPossible?HYe(e):YYe(e),u,g=!1,h=!1,f=new Map(Array.from(l.entries()).map(([m,I])=>[m,I[0]])),p=new Map;do{let m=GYe(t,e,r,c,f,l,i,p,n);m.isGraphChanged&&(h=!0),m.anotherRoundNeeded&&(g=!0),u=!1;for(let[I,y]of l)y.length>1&&!o.dependencies.has(I)&&(f.delete(I),y.shift(),f.set(I,y[0]),u=!0)}while(u);for(let m of o.dependencies.values())if(!o.peerNames.has(m.name)&&!r.has(m.locator)){r.add(m.locator);let I=IF(t,[...e,m],r,p,n);I.isGraphChanged&&(h=!0),I.anotherRoundNeeded&&(g=!0),r.delete(m.locator)}return{anotherRoundNeeded:g,isGraphChanged:h}},JYe=(t,e,r,i,n,s,o,a,{outputReason:l})=>{let c,u=null,g=new Set;l&&(c=`${Array.from(e).map(m=>Fi(m)).join("\u2192")}`);let h=r[r.length-1],p=!(i.ident===h.ident);if(l&&!p&&(u="- self-reference"),p&&(p=!t.peerNames.has(i.name),l&&!p&&(u=`-cannotshadowpeer:${Fi(t.originalDependencies.get(i.name).locator)}at${c}`)),p){let m=!1,I=n.get(i.name);if(m=!I||I.ident===i.ident,l&&!m&&(u=`-filledby:${Fi(I.locator)}at${c}`),m)for(let y=r.length-1;y>=1;y--){let x=r[y].dependencies.get(i.name);if(x&&x.ident!==i.ident){m=!1;let F=a.get(h);F||(F=new Set,a.set(h,F)),F.add(i.name),l&&(u=`-filledby${Fi(x.locator)}at${r.slice(0,y).map(N=>Fi(N.locator)).join("\u2192")}`);break}}p=m}if(p&&(p=s.get(i.name)===i.ident,l&&!p&&(u=`-filledby:${Fi(o.get(i.name)[0])}at${c}`)),p){let m=!0,I=new Set(i.peerNames);for(let y=r.length-1;y>=1;y--){let b=r[y];for(let x of I){if(b.peerNames.has(x)&&b.originalDependencies.has(x))continue;let F=b.dependencies.get(x);F&&t.dependencies.get(x)!==F&&(y===r.length-1?g.add(F):(g=null,m=!1,l&&(u=`-peerdependency${Fi(F.locator)}fromparent${Fi(b.locator)}wasnothoistedto${c}`))),I.delete(x)}if(!m)break}p=m}return g!==null&&g.size>0?{isHoistable:2,dependsOn:g,reason:u}:{isHoistable:p?0:1,reason:u}},GYe=(t,e,r,i,n,s,o,a,l)=>{let c=e[e.length-1],u=new Set,g=!1,h=!1,f=(I,y,b,x)=>{if(u.has(b))return;let F=[...y,b.locator],N=new Map,U=new Map;for
${Zp(t)}`)}let oe=EF(b);for(let T of oe)if(v.has(T)){let A=U.get(T);if((n.get(T.name)===T.ident||!b.reasons.has(T.name))&&A.isHoistable!==0&&b.reasons.set(T.name,A.reason),!T.isHoistBorder&&F.indexOf(T.locator)<0){u.add(b);let $=sie(b,T);f([...I,b],[...y,b.locator],$,m),u.delete(b)}}},p,m=new Set(EF(c));do{p=m,m=new Set;for(let I of p){if(I.locator===c.locator||I.isHoistBorder)continue;let y=sie(c,I);f([],Array.from(r),y,m)}}while(m.size>0);return{anotherRoundNeeded:g,isGraphChanged:h}},iie=t=>{let e=[],r=new Set,i=new Set,n=(s,o)=>{if(r.has(s)||(r.add(s),i.has(s)))return;let a=new Map(o);for(let l of s.dependencies.values())s.peerNames.has(l.name)||a.set(l.name,l);for(let l of s.originalDependencies.values()){let c=a.get(l.name),u=()=>`${Array.from(i).concat([s]).map(g=>Fi(g.locator)).join("\u2192")}`;if(s.peerNames.has(l.name)){let g=o.get(l.name);(g!==c||!g||g.ident!==l.ident)&&e.push(`${u()}-brokenpeerpromise:expected${l.ident}butfound${g&&g.ident}`)}else c?c.ident!==l.ident&&e.push(`${u()}-brokenrequirepromisefor${l.name}:expected${l.ident},butfound:${c.ident}`):e.push(`${u()}-brokenrequirepromise:norequireddependency${l.locator}found`)}i.add(s);for(let l of s.dependencies.values())s.peerNames.has(l.name)||n(l,a);i.delete(s)};return n(t,t.dependencies),e.join(`
`)},KYe=(t,e)=>{let{identName:r,name:i,reference:n,peerNames:s}=t,o={name:i,references:new Set([n]),locator:mF(r,n),ident:rie(r,n),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(s),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistedFrom:[]},a=new Map([[t,o]]),l=(c,u)=>{let g=a.get(c),h=!!g;if(!g){let{name:f,identName:p,reference:m,peerNames:I}=c,y=e.hoistingLimits.get(u.locator);g={name:f,references:new Set([m]),locator:mF(p,m),ident:rie(p,m),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(I),reasons:new Map,decoupled:!0,isHoistBorder:y?y.has(f):!1,hoistedFrom:[]},a.set(c,g)}if(u.dependencies.set(c.name,g),u.originalDependencies.set(c.name,g),h){let f=new Set,p=m=>{if(!f.has(m)){f.add(m),m.decoupled=!1;for(let I of m.dependencies.values())m.peerNames.has(I.name)||p(I)}};p(g)}else for(let f of c.dependencies)l(f,g)};for(let c of t.dependencies)l(c,o);return o},yF=t=>t.substring(0,t.indexOf("@",1)),UYe=t=>{let e={name:t.name,identName:yF(t.locator),references:new Set(t.references),dependencies:new Set},r=new Set([t]),i=(n,s,o)=>{let a=r.has(n),l;if(s===n)l=o;else{let{name:c,references:u,locator:g}=n;l={name:c,identName:yF(g),references:u,dependencies:new Set}}if(o.dependencies.add(l),!a){r.add(n);for(let c of n.dependencies.values())n.peerNames.has(c.name)||i(c,n,l);r.delete(n)}};for(let n of t.dependencies.values())i(n,t,e);return e},jYe=t=>{let e=new Map,r=new Set([t]),i=o=>`${o.name}@${o.ident}`,n=o=>{let a=i(o),l=e.get(a);return l||(l={dependents:new Set,peerDependents:new Set},e.set(a,l)),l},s=(o,a)=>{let l=!!r.has(a);if(n(a).dependents.add(o.ident),!l){r.add(a);for(let u of a.dependencies.values())a.peerNames.has(u.name)?n(u).peerDependents.add(a.ident):s(a,u)}};for(let o of t.dependencies.values())t.peerNames.has(o.name)||s(t,o);return e},Fi=t=>{let e=t.indexOf("@",1),r=t.substring(0,e);r.endsWith("$wsroot$")&&(r=`wh:${r.replace("$wsroot$","")}`);let i=t.substring(e+1);if(i==="workspace:.")return".";if(i){let n=(i.indexOf("#")>0?i.split("#")[1]:i).replace("npm:","");return i.startsWith("virtual")&&(r=`v:${r}`),n.startsWith("workspace")&&(r=`w:${r}`,n=""),`${r}${n?`@${n}`:""}`}else return`${r}`},oie=5e4,Zp=t=>{let e=0,r=(n,s,o="")=>{if(e>oie||s.has(n))return"";e++;let a=Array.from(n.dependencies.values()).sort((c,u)=>c.name.localeCompare(u.name)),l="";s.add(n);for(let c=0;c<a.length;c++){let u=a[c];if(!n.peerNames.has(u.name)&&u!==n){let g=n.reasons.get(u.name),h=yF(u.locator);l+=`${o}${c<a.length-1?"\u251C\u2500":"\u2514\u2500"}${(s.has(u)?">":"")+(h!==u.name?`a:${u.name}:`:"")+Fi(u.locator)+(g?`${g}`:"")+(u!==n&&u.hoistedFrom.length>0?`, hoisted from: ${u.hoistedFrom.join(", ")}`:"")}
`:"")};var Ba;(function(r){r.HARD="HARD",r.SOFT="SOFT"})(Ba||(Ba={}));var Ri;(function(i){i.WORKSPACES="workspaces",i.DEPENDENCIES="dependencies",i.NONE="none"})(Ri||(Ri={}));var aie="node_modules",AB="$wsroot$";var wa=(t,e)=>{let{packageTree:r,hoistingLimits:i,errors:n,preserveSymlinksRequired:s}=WYe(t,e),o=null;if(n.length===0){let a=nie(r,{hoistingLimits:i});o=zYe(t,a,e)}return{tree:o,errors:n,preserveSymlinksRequired:s}},Es=t=>`${t.name}@${t.reference}`,BF=t=>{let e=new Map;for(let[r,i]of t.entries())if(!i.dirList){let n=e.get(i.locator);n||(n={target:i.target,linkType:i.linkType,locations:[],aliases:i.aliases},e.set(i.locator,n)),n.locations.push(r)}for(let r of e.values())r.locations=r.locations.sort((i,n)=>{let s=i.split(B.delimiter).length,o=n.split(B.delimiter).length;return s!==o?o-s:n.localeCompare(i)});return e},Aie=(t,e)=>{let r=w.isVirtualLocator(t)?w.devirtualizeLocator(t):t,i=w.isVirtualLocator(e)?w.devirtualizeLocator(e):e;return w.areLocatorsEqual(r,i)},WYe=(t,e)=>{let r=t.getDependencyTreeRoots(),i=[],n=!1,s=new Map,o=new Map,a=t.getPackageInformation(t.topLevel);if(a===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let l=t.findPackageLocator(a.packageLocation);if(l===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let c=L.toPortablePath(a.packageLocation),u=Es(l);if(e.project){let I={children:new Map},y=e.project.cwd.split(B.sep);for(let[x,F]of e.project.workspacesByCwd){let N=x.split(B.sep).slice(y.length),U=I;for(let v of N){let J=U.children.get(v);J||(J={children:new Map},U.children.set(v,J)),U=J}U.workspaceLocator={name:w.stringifyIdent(F.anchoredLocator),reference:F.anchoredLocator.reference}}let b=(x,F)=>{if(x.workspaceLocator){let N=Es(F),U=o.get(N);U||(U=new Set,o.set(N,U)),U.add(x.workspaceLocator)}for(let N of x.children.values())b(N,x.workspaceLocator||F)};for(let x of I.children.values())b(x,I.workspaceLocator)}else for(let I of r)if(I.name!==l.name||I.reference!==l.reference){let y=o.get(u);y||(y=new Set,o.set(u,y)),y.add(I)}let g={name:l.name,identName:l.name,reference:l.reference,peerNames:a.packagePeers,dependencies:new Set},h=new Map,f=(I,y)=>`${Es(y)}:${I}`,p=(I,y)=>{if(I.linkType!==Ba.SOFT||!e.project)return!1;let b=L.toPortablePath(t.resolveVirtual&&y.reference&&y.reference.startsWith("virtual:")?t.resolveVirtual(I.packageLocation):I.packageLocation);return B.contains(e.project.cwd,b)===null},m=(I,y,b,x,F,N,U)=>{var $,re;let v=f(I,b),J=h.get(v),oe=!!J;if(!oe&&b.name===l.name&&b.reference===l.reference&&(J=g,h.set(v,g)),J||(J={name:I,identName:b.name,reference:b.reference,dependencies:new Set,peerNames:y.packagePeers},h.set(v,J)),U&&!p(y,b)){let H=Es({name:x.identName,reference:x.reference}),R=s.get(H)||new Set;s.set(H,R),R.add(J.name)}let T=new Map(y.packageDependencies);if(e.project){let H=e.project.workspacesByCwd.get(L.toPortablePath(y.packageLocation.slice(0,-1)));if(H){let R=new Set([...Array.from(H.manifest.peerDependencies.values(),Pe=>w.stringifyIdent(Pe)),...Array.from(H.manifest.peerDependenciesMeta.keys())]);for(let Pe of R)T.has(Pe)||(T.set(Pe,F.get(Pe)||null),J.peerNames.add(Pe))}}let A=Es(b),W=o.get(A);if(W)for(let H of W)T.set(`${H.name}${AB}`,H.reference);if(x.dependencies.add(J),!oe){let H=new Map;for(let[R,Pe]of T)if(Pe!==null){let Le=t.getLocator(R,Pe),Ge=t.getLocator(R.replace(AB,""),Pe),Te=t.getPackageInformation(Ge);if(Te===null)throw new Error("Assertion failed: Expected the package to have been registered");let ie=p(Te,Le);if(e.validateExternalSoftLinks&&e.project&&ie){Te.packageDependencies.size>0&&(n=!0);for(let[pe,ve]of Te.packageDependencies){let Z=w.parseLocator(Array.isArray(ve)?`${ve[0]}@${ve[1]}`:`${pe}@${ve}`);if(Es(Z)!==Es(Le)){let X=T.get(pe);if(X){let ae=w.parseLocator(Array.isArray(X)?`${X[0]}@${X[1]}`:`${pe}@${X}`);Aie(ae,Z)||i.push({messageName:z.NM_CANT_INSTALL_EXTERNAL_SOFT_LINK,text:`Cannotlink${w.prettyIdent(e.project.configuration,w.parseIdent(Le.name))}into${w.prettyLocator(e.project.configuration,w.parseLocator(`${b.name}@${b.refer
`)}return s+=r,s+="}",s}function lB(t,e,r,i){let{next:n}=pie[r],s=n[t]||n["*"];return die(e,s,i)}function die(t,e,r){let{collapsed:i}=pie[e];return Array.isArray(t)?i?ZYe(t,e,r):_Ye(t,e,r):typeof t=="object"&&t!==null?i?$Ye(t,e,r):eqe(t,e,r):JSON.stringify(t)}function Cie(t){return die(t,St.TOP_LEVEL,"")}function $p(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let i=[];for(let s of e)i.push(r.map(o=>s(o)));let n=r.map((s,o)=>o);return n.sort((s,o)=>{for(let a of i){let l=a[s]<a[o]?-1:a[s]>a[o]?1:0;if(l!==0)return l}return 0}),n.map(s=>r[s])}function tqe(t){let e=new Map,r=$p(t.fallbackExclusionList||[],[({name:i,reference:n})=>i,({name:i,reference:n})=>n]);for(let{name:i,reference:n}of r){let s=e.get(i);typeof s=="undefined"&&e.set(i,s=new Set),s.add(n)}return Array.from(e).map(([i,n])=>[i,Array.from(n)])}function rqe(t){return $p(t.fallbackPool||[],([e])=>e)}function iqe(t){let e=[];for(let[r,i]of $p(t.packageRegistry,([n])=>n===null?"0":`1${n}`)){let n=[];e.push([r,n]);for(let[s,{packageLocation:o,packageDependencies:a,packagePeers:l,linkType:c,discardFromLookup:u}]of $p(i,([g])=>g===null?"0":`1${g}`)){let g=[];r!==null&&s!==null&&!a.has(r)&&g.push([r,s]);for(let[p,m]of $p(a.entries(),([I])=>I))g.push([p,m]);let h=l&&l.size>0?Array.from(l):void 0,f=u||void 0;n.push([s,{packageLocation:o,packageDependencies:g,packagePeers:h,linkType:c,discardFromLookup:f}])}}return e}function ed(t){return{__info:["This file is automatically generated. Do not touch it, or risk","your modifications being lost. We also recommend you not to read","it either without using the @yarnpkg/pnp package, as the data layout","is entirely unspecified and WILL change from a version to another."],dependencyTreeRoots:t.dependencyTreeRoots,enableTopLevelFallback:t.enableTopLevelFallback||!1,ignorePatternData:t.ignorePattern||null,fallbackExclusionList:tqe(t),fallbackPool:rqe(t),packageRegistryData:iqe(t)}}var Eie=te(Iie());function yie(t,e){return[t?`${t}
`:"",`/* eslint-disable */
`,`try{
`,`Object.freeze({}).detectStrictMode=true;
`,`}catch(error){
`," throw new Error(`ThewholePnPfilegotstrict-mode-ified,whichisknowntobreak(Emscriptenlibrariesaren'tstrictmode).ThisusuallyhappenswhenthefilegoesthroughBabel.`);\n",`}
`].join("")}function Bie(t){let e=ed(t),r=sqe(e);return yie(t.shebang,r)}function wie(t){let e=ed(t),r=oqe(t.dataLocation),i=yie(t.shebang,r);return{dataFile:nqe(e),loaderFile:i}}var Sie=te(require("fs")),cqe=te(require("path")),xie=te(require("util"));function xF(t,{basePath:e}){let r=L.toPortablePath(e),i=B.resolve(r),n=t.ignorePatternData!==null?new RegExp(t.ignorePatternData):null,s=new Map,o=new Map(t.packageRegistryData.map(([g,h])=>[g,new Map(h.map(([f,p])=>{var x;if(g===null!=(f===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let m=(x=p.discardFromLookup)!=null?x:!1,I={name:g,reference:f},y=s.get(p.packageLocation);y?(y.discardFromLookup=y.discardFromLookup&&m,m||(y.locator=I)):s.set(p.packageLocation,{locator:I,discardFromLookup:m});let b=null;return[f,{packageDependencies:new Map(p.packageDependencies),packagePeers:new Set(p.packagePeers),linkType:p.linkType,discardFromLookup:m,get packageLocation(){return b||(b=B.join(i,p.packageLocation))}}]}))])),a=new Map(t.fallbackExclusionList.map(([g,h])=>[g,new Set(h)])),l=new Map(t.fallbackPool),c=t.dependencyTreeRoots,u=t.enableTopLevelFallback;return{basePath:r,dependencyTreeRoots:c,enableTopLevelFallback:u,fallbackExclusionList:a,fallbackPool:l,ignorePattern:n,packageLocatorsByLocations:s,packageRegistry:o}}var Ou=te(require("module")),Die=te(bie()),kF=te(require("util"));var Vt;(function(l){l.API_ERROR="API_ERROR",l.BUILTIN_NODE_RESOLUTION_FAILED="BUILTIN_NODE_RESOLUTION_FAILED",l.MISSING_DEPENDENCY="MISSING_DEPENDENCY",l.MISSING_PEER_DEPENDENCY="MISSING_PEER_DEPENDENCY",l.QUALIFIED_PATH_RESOLUTION_FAILED="QUALIFIED_PATH_RESOLUTION_FAILED",l.INTERNAL="INTERNAL",l.UNDECLARED_DEPENDENCY="UNDECLARED_DEPENDENCY",l.UNSUPPORTED="UNSUPPORTED"})(Vt||(Vt={}));var lqe=new Set([Vt.BUILTIN_NODE_RESOLUTION_FAILED,Vt.MISSING_DEPENDENCY,Vt.MISSING_PEER_DEPENDENCY,Vt.QUALIFIED_PATH_RESOLUTION_FAILED,Vt.UNDECLARED_DEPENDENCY]);function Or(t,e,r={}){let i=lqe.has(t)?"MODULE_NOT_FOUND":t,n={configurable:!0,writable:!0,enumerable:!1};return Object.defineProperties(new Error(e),{code:V(P({},n),{value:i}),pnpCode:V(P({},n),{value:t}),data:V(P({},n),{value:r})})}function ml(t){return L.normalize(L.fromPortablePath(t))}function vF(t,e){let r=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,i=Number(process.env.PNP_DEBUG_LEVEL),n=new Set(Ou.Module.builtinModules||Object.keys(process.binding("natives"))),s=ie=>n.has(ie)||ie.startsWith("node:"),o=/^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/,a=/^(\/|\.{1,2}(\/|$))/,l=/\/$/,c=/^\.{0,2}\//,u={name:null,reference:null},g=[],h=new Set;if(t.enableTopLevelFallback===!0&&g.push(u),e.compatibilityMode!==!1)for(let ie of["react-scripts","gatsby"]){let le=t.packageRegistry.get(ie);if(le)for(let be of le.keys()){if(be===null)throw new Error("Assertion failed: This reference shouldn't be null");g.push({name:ie,reference:be})}}let{ignorePattern:f,packageRegistry:p,packageLocatorsByLocations:m}=t;function I(ie,le){return{fn:ie,args:le,error:null,result:null}}function y(ie){var pe,ve,Z,X,ae,ue;let le=(Z=(ve=(pe=process.stderr)==null?void 0:pe.hasColors)==null?void 0:ve.call(pe))!=null?Z:process.stdout.isTTY,be=(we,lt)=>`[${we}m${lt}[0m`,he=ie.error;console.error(he?be("31;1",`\u2716${(X=ie.error)==null?void0:X.message.replace(/\n.*/s,"")}`):be("33;1","\u203CResolution")),ie.args.length>0&&console.error();for(letweofie.args)console.error(`${be("37;1","In\u2190")}${(0,kF.inspect)(we,{colors:le,compact:!0})}`);ie.result&&(console.error(),console.error(`${be("37;1","Out\u2192")}${(0,kF.inspect)(ie.result,{colors:le,compact:!0})}`));letIe=(ue=(ae=newError().stack.match(/(?<=^+)at.*/gm))==null?void0:ae.slice(2))!=null?ue:[];if(Ie.length>0){console.error();for(letweofIe)console.error(`${be("38;5;244",we)}`)}console.error()}functionb(ie,le){if(e.allowDebug===!1)returnle;if(Number.isFinite(i)){if(i>=2)return(...be)=>{lethe=I(ie,be);try{returnhe.result=le(...be)}catch(Ie){throwhe.error=Ie}finally{y(he)}};if(i>=1)return(...be)=>{try{returnle(...b
Requirerequest:"${he}"
Requiredby:${Ie}
`,{request:he,issuer:Ie});return L.toPortablePath(Z)}let pe,ve=ie.match(o);if(ve){if(!le)throw Or(Vt.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Ie});let[,Z,X]=ve,ae=H(le);if(!ae){let Zt=J(ie,le);if(Zt===!1)throw Or(Vt.BUILTIN_NODE_RESOLUTION_FAILED,`Thebuiltinnoderesolutionalgorithmwasunabletoresolvetherequestedmodule(itdidn't go through the pnp resolver because the issuer doesn'tseemtobepartoftheYarn-manageddependencytree).
`,{request:he,issuer:Ie,dependencyName:Z}):ft=Or(Vt.UNDECLARED_DEPENDENCY,`${ae.name}triedtoaccess${Z}.WhilethismoduleisusuallyinterpretedasaNodebuiltin,yourresolverisrunninginsideanon-Noderesolutioncontextwheresuchbuiltinsareignored.Since${Z}isn't otherwise declared in ${ae.name}'sdependencies,thismakestherequirecallambiguousandunsound.
`,{request:he,issuer:Ie,issuerLocator:Object.assign({},ae),dependencyName:Z}));if(we==null){if(lt===null||ft===null)throw ft||new Error("Assertion failed: Expected an error to have been set");we=lt;let Zt=ft.message.replace(/\n.*/g,"");ft.message=Zt,!h.has(Zt)&&i!==0&&(h.add(Zt),process.emitWarning(ft))}let xt=Array.isArray(we)?{name:we[0],reference:we[1]}:{name:Z,reference:we},Dn=x(xt);if(!Dn.packageLocation)throw Or(Vt.MISSING_DEPENDENCY,`Adependencyseemsvalidbutdidn'tgetinstalledforsomereason.Thismightbecausedbyapartialinstall,suchasdevvsprod.
`,{request:he,issuer:Ie,dependencyLocator:Object.assign({},xt)});let di=Dn.packageLocation;X?pe=B.join(di,X):pe=di}else if(B.isAbsolute(ie))pe=B.normalize(ie);else{if(!le)throw Or(Vt.API_ERROR,"The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:he,issuer:Ie});let Z=B.resolve(le);le.match(l)?pe=B.normalize(B.join(Z,ie)):pe=B.normalize(B.join(B.dirname(Z),ie))}return B.normalize(pe)}function Pe(ie,le){if(a.test(ie))return le;let be=N(le);return be?B.normalize(be):le}function Le(ie,{extensions:le=Object.keys(Ou.Module._extensions)}={}){let be=[],he=U(ie,be,{extensions:le});if(he)return B.normalize(he);{let Ie=ml(ie);throw Or(Vt.QUALIFIED_PATH_RESOLUTION_FAILED,`Qualifiedpathresolutionfailed-noneofthosefilescanbefoundonthedisk.
Sourcepath:${Ie}
${be.map(pe=>`Not found: ${ml(pe)}
`).join("")}`,{unqualifiedPath:Ie})}}functionGe(ie,le,{considerBuiltins:be,extensions:he}={}){letIe=R(ie,le,{considerBuiltins:be});if(Ie===null)returnnull;letpe=()=>le!==null?oe(le):!1,ve=(!be||!s(ie))&&!pe()?Pe(ie,Ie):Ie;try{returnLe(ve,{extensions:he})}catch(Z){throwZ.pnpCode==="QUALIFIED_PATH_RESOLUTION_FAILED"&&Object.assign(Z.data,{request:ml(ie),issuer:le&&ml(le)}),Z}}functionTe(ie){letle=B.normalize(ie),be=rr.resolveVirtual(le);returnbe!==le?be:null}return{VERSIONS:T,topLevel:A,getLocator:(ie,le)=>Array.isArray(le)?{name:le[0],reference:le[1]}:{name:ie,reference:le},getDependencyTreeRoots:()=>[...t.dependencyTreeRoots],getAllLocators(){letie=[];for(let[le,be]ofp)for(letheofbe.keys())le!==null&&he!==null&&ie.push({name:le,reference:he});returnie},getPackageInformation:ie=>{letle=W(ie);if(le===null)returnnull;letbe=L.fromPortablePath(le.packageLocation);returnV(P({},le),{packageLocation:be})},findPackageLocator:ie=>H(L.toPortablePath(ie)),resolveToUnqualified:b("resolveToUnqualified",(ie,le,be)=>{lethe=le!==null?L.toPortablePath(le):null,Ie=R(L.toPortablePath(ie),he,be);returnIe===null?null:L.fromPortablePath(Ie)}),resolveUnqualified:b("resolveUnqualified",(ie,le)=>L.fromPortablePath(Le(L.toPortablePath(ie),le))),resolveRequest:b("resolveRequest",(ie,le,be)=>{lethe=le!==null?L.toPortablePath(le):null,Ie=Ge(L.toPortablePath(ie),he,be);returnIe===null?null:L.fromPortablePath(Ie)}),resolveVirtual:b("resolveVirtual",ie=>{letle=Te(L.toPortablePath(ie));returnle!==null?L.fromPortablePath(le):null})}}varVCt=(0,xie.promisify)(Sie.readFile);varPie=(t,e,r)=>{leti=ed(t),n=xF(i,{basePath:e}),s=L.join(e,mt.pnpCjs);returnvF(n,{fakeFs:r,pnpapiResolution:s})};varQa={};$e(Qa,{checkAndReportManifestCompatibility:()=>kie,extractBuildScripts:()=>cB,getExtractHint:()=>FF,hasBindingGyp:()=>RF});functionkie(t,e,r,{configuration:i,report:n}){returnze.isManifestFieldCompatible(e.manifest.os,process.platform)?ze.isManifestFieldCompatible(e.manifest.cpu,process.arch)?!0:(n==null||n.reportWarningOnce(z.INCOMPATIBLE_CPU,`${w.prettyLocator(i,t)} The CPU architecture ${process.arch} is incompatible with this module, ${r} skipped.`),!1):(n==null||n.reportWarningOnce(z.INCOMPATIBLE_OS,`${w.prettyLocator(i,t)} The platform ${process.platform} is incompatible with this module, ${r} skipped.`),!1)}functioncB(t,e,r,{configuration:i,report:n}){lets=[];for(letaof["preinstall","install","postinstall"])e.manifest.scripts.has(a)&&s.push([Ji.SCRIPT,a]);return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&s.push([Ji.SHELLCODE,"node-gyp rebuild"]),s.length===0?[]:t.linkType!==At.HARD?(n==null||n.reportWarningOnce(z.SOFT_LINK_BUILD,`${w.prettyLocator(i,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?(n==null||n.reportInfoOnce(z.BUILD_DISABLED,`${w.prettyLocator(i,t)} lists build scripts, but its build has been explicitly disabled through configuration.`),[]):!i.get("enableScripts")&&!r.built?(n==null||n.reportWarningOnce(z.DISABLED_BUILD_SCRIPTS,`${w.prettyLocator(i,t)} lists build scripts, but all build scripts have been disabled.`),[]):kie(t,e,"build",{configuration:i,report:n})?s:[]}varuqe=newSet([".exe",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);functionFF(t){returnt.packageFs.getExtractHint({relevantExtensions:uqe})}functionRF(t){lete=B.join(t.prefixPath,"binding.gyp");returnt.packageFs.existsSync(e)}varLF={};$e(LF,{getUnpluggedPath:()=>td});functiontd(t,{configuration:e}){returnB.resolve(e.get("pnpUnpluggedFolder"),w.slugifyLocator(t))}vargqe=newSet([w.makeIdent(null,"nan").identHash,w.makeIdent(null,"node-gyp").identHash,w.makeIdent(null,"node-pre-gyp").identHash,w.makeIdent(null,"node-addon-api").identHash,w.makeIdent(null,"fsevents").identHash]),Il=class{constructor(){this.mode="strict";this.pnpCache=newMap}supportsPackage(e,r){return!(r.project.configuration.get("nodeLinker")!=="pnp"||r.project.configuration.get("pnpMode")!==this.mode)}asyncfindPackageLocation(e,r){leti=ba
`;let s=Array.from(e.keys()).sort(),o=w.stringifyLocator(t.topLevelWorkspace.anchoredLocator);for(let c of s){let u=e.get(c);n+=`
`,n+=`${JSON.stringify(c)}:
`,n+=`locations:
`;for(let g of u.locations){let h=B.contains(t.cwd,g);if(h===null)throw new Error(`Assertionfailed:Expectedthepathtobewithintheproject(${g})`);n+=`-${JSON.stringify(h)}
`}if(u.aliases.length>0){n+=`aliases:
`;for(let g of u.aliases)n+=`-${JSON.stringify(g)}
`}if(c===o&&r.size>0){n+=`bin:
`;for(let[g,h]of r){let f=B.contains(t.cwd,g);if(f===null)throw new Error(`Assertionfailed:Expectedthepathtobewithintheproject(${g})`);n+=`${JSON.stringify(f)}:
Forconsistencywithourothercommandsthedefaultistoonlycheckthedirectdependenciesfortheactiveworkspace.Toextendthissearchtoallworkspaces,use\`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`.
Applyingthe\`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${TB.map(e=>`\`${e}\``).join(", ")}.
Ifthe\`--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.
Tounderstandthedependencytreerequiringvulnerablepackages,checktherawreportwiththe\`--json\` flag or use \`yarn why <package>\` to get more information as to who depends on them.
`,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"]]});var eoe=Ed;var toe=te(require("path")),$R=te(Cr()),eL=te(require("util")),yd=class extends Be{constructor(){super(...arguments);this.fields=j.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=j.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=j.Rest()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r}=await Fe.find(e,this.context.cwd),i=typeof this.fields!="undefined"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,n=[],s=!1,o=await Se.start({configuration:e,includeFooter:!1,json:this.json,stdout:this.context.stdout},async a=>{for(let l of this.packages){let c;if(l==="."){let x=r.topLevelWorkspace;if(!x.manifest.name)throw new me(`Missing'name'fieldin${toe.default.join(x.cwd,"package.json")}`);c=w.makeDescriptor(x.manifest.name,"unknown")}else c=w.parseDescriptor(l);let u=Bt.getIdentUrl(c),g=tL(await Bt.get(u,{configuration:e,ident:c,jsonResponse:!0,customErrorMessage:Bt.customPackageError})),h=Object.keys(g.versions).sort($R.default.compareLoose),p=g["dist-tags"].latest||h[h.length-1],m=vt.validRange(c.range);if(m){let x=$R.default.maxSatisfying(h,m);x!==null?p=x:(a.reportWarning(z.UNNAMED,`Unmetrange${w.prettyRange(e,c.range)};fallingbacktothelatestversion`),s=!0)}else c.range!=="unknown"&&(a.reportWarning(z.UNNAMED,`Invalidrange${w.prettyRange(e,c.range)};fallingbacktothelatestversion`),s=!0);let I=g.versions[p],y=V(P(P({},g),I),{version:p,versions:h}),b;if(i!==null){b={};for(let x of i){let F=y[x];if(typeof F!="undefined")b[x]=F;else{a.reportWarning(z.EXCEPTION,`The'${x}'fielddoesn't exist inside ${w.prettyIdent(e,c)}'sinformations`),s=!0;continue}}}else this.json||(delete y.dist,delete y.readme,delete y.users),b=y;a.reportJson(b),this.json||n.push(b)}});eL.inspect.styles.name="cyan";for(let a of n)(a!==n[0]||s)&&this.context.stdout.write(`
`);return o.exitCode()}};yd.paths=[["npm","info"]],yd.usage=fe.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command will fetch 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. 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 informations.\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 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"]]});var roe=yd;function tL(t){if(Array.isArray(t)){let e=[];for(let r of t)r=tL(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 i=tL(t[r]);i&&(e[r]=i)}return e}else return t||null}var ioe=te(lp()),Bd=class extends Be{constructor(){super(...arguments);this.scope=j.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=j.Boolean("--publish",!1,{description:"Login to the publish registry"})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),r=await KB({configuration:e,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Se.start({configuration:e,stdout:this.context.stdout},async n=>{let s=await tWe({registry:r,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),o=`/-/user/org.couchdb.user:${encodeURIComponent(s.name)}`,a=awaitBt.put(o,s,{attemptedAs:s.name,configuration:e,registry:r,jsonResponse:!0,authType:Bt.AuthType.NO_AUTH});returnawaiteWe(r,a.token,{configuration:e,scope:this.scope}),n.reportInfo(z.UNNAMED,"Successfullyloggedin")})).exitCode()}};Bd.paths=[["npm","login"]],Bd.usage=fe.Usage({category:"Npm-relatedcommands",description:"storenewlogininfotoaccessthenpmregistry",details:"\nThiscommandwillaskyouforyourusername,password,and2FAOne-Time-Password(whenitapplies).Itwillthenmodifyyourlocalconfiguration(inyourhomefolder,neverintheprojectitself)toreferencethenewtokensthusgenerated.\n\nAddingthe`-s,--scope`flagwillcausetheauthenticationtobedoneagainstwhateverregistryisconfiguredfortheassociatedscope(seealso`npmScopes`).\n\nAddingthe`--publish`flagwillcausetheauthenticationtobedoneagainsttheregistryusedwhenpublishingthepackage(seealso`publishConfig.registry`and`npmPublishRegistry`).\n",examples:[["Logintothedefaultregistry","yarnnpmlogin"],["Logintotheregistrylinkedtothe@my-scoperegistry","yarnnpmlogin--scopemy-scope"],["Logintothepublishregistryforthecurrentpackage","yarnnpmlogin--publish"]]});varnoe=Bd;asyncfunctionKB({scope:t,publish:e,configuration:r,cwd:i}){returnt&&e?Gt.getScopeRegistry(t,{configuration:r,type:Gt.RegistryType.PUBLISH_REGISTRY}):
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]});var Aoe=bd;async function Dd(t,e){let r=`/-/package${Bt.getIdentUrl(t)}/dist-tags`;returnBt.get(r,{configuration:e,ident:t,jsonResponse:!0,customErrorMessage:Bt.customPackageError})}varSd=classextendsBe{constructor(){super(...arguments);this.package=j.String();this.tag=j.String()}asyncexecute(){lete=awaitAe.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=awaitFe.find(e,this.context.cwd);if(!i)thrownewXe(r.cwd,this.context.cwd);letn=w.parseDescriptor(this.package,!0),s=n.range;if(!loe.default.valid(s))thrownewme(`Therange${ce.pretty(e,n.range,ce.Type.RANGE)}mustbeavalidsemverversion`);leto=Gt.getPublishRegistry(i.manifest,{configuration:e}),a=ce.pretty(e,n,ce.Type.IDENT),l=ce.pretty(e,s,ce.Type.RANGE),c=ce.pretty(e,this.tag,ce.Type.CODE);return(awaitSe.start({configuration:e,stdout:this.context.stdout},asyncg=>{leth=awaitDd(n,e);Object.prototype.hasOwnProperty.call(h,this.tag)&&h[this.tag]===s&&g.reportWarning(z.UNNAMED,`Tag${c}isalreadysettoversion${l}`);letf=`/-/package${Bt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;awaitBt.put(f,s,{configuration:e,registry:o,ident:n,jsonRequest:!0,jsonResponse:!0}),g.reportInfo(z.UNNAMED,`Tag${c}addedtoversion${l}ofpackage${a}`)})).exitCode()}};Sd.paths=[["npm","tag","add"]],Sd.usage=fe.Usage({category:"Npm-relatedcommands",description:"addatagforaspecificversionofapackage",details:`
`,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"]]});var coe=Sd;var xd=class extends Be{constructor(){super(...arguments);this.package=j.String();this.tag=j.String()}async execute(){if(this.tag==="latest")throw new me("The 'latest' tag cannot be removed.");let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd);if(!i)throw new Xe(r.cwd,this.context.cwd);let n=w.parseIdent(this.package),s=Gt.getPublishRegistry(i.manifest,{configuration:e}),o=ce.pretty(e,this.tag,ce.Type.CODE),a=ce.pretty(e,n,ce.Type.IDENT),l=await Dd(n,e);if(!Object.prototype.hasOwnProperty.call(l,this.tag))throw new me(`${o}isnotatagofpackage${a}`);return(await Se.start({configuration:e,stdout:this.context.stdout},async u=>{let g=`/-/package${Bt.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;awaitBt.del(g,{configuration:e,registry:s,ident:n,jsonResponse:!0}),u.reportInfo(z.UNNAMED,`Tag${o}removedfrompackage${a}`)})).exitCode()}};xd.paths=[["npm","tag","remove"]],xd.usage=fe.Usage({category:"Npm-relatedcommands",description:"removeatagfromapackage",details:`
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var uoe=xd;var Pd=class extends Be{constructor(){super(...arguments);this.scope=j.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=j.Boolean("--publish",!1,{description:"Print username for the publish registry"})}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),r;return this.scope&&this.publish?r=Gt.getScopeRegistry(this.scope,{configuration:e,type:Gt.RegistryType.PUBLISH_REGISTRY}):this.scope?r=Gt.getScopeRegistry(this.scope,{configuration:e}):this.publish?r=Gt.getPublishRegistry((await bu(e,this.context.cwd)).manifest,{configuration:e}):r=Gt.getDefaultRegistry({configuration:e}),(await Se.start({configuration:e,stdout:this.context.stdout},async n=>{var o,a;let s;try{s=await Bt.get("/-/whoami",{configuration:e,registry:r,authType:Bt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?w.makeIdent(this.scope,""):void 0})}catch(l){if(((o=l.response)==null?void 0:o.statusCode)===401||((a=l.response)==null?void 0:a.statusCode)===403){n.reportError(z.AUTHENTICATION_INVALID,"Authentication failed - your credentials may have expired");return}else throw l}n.reportInfo(z.UNNAMED,s.username)})).exitCode()}};Pd.paths=[["npm","whoami"]],Pd.usage=fe.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 goe=Pd;var nWe={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:ge.STRING,default:null}},commands:[eoe,roe,noe,ooe,aoe,coe,Aoe,uoe,goe]},sWe=nWe;var cL={};$e(cL,{default:()=>yWe,patchUtils:()=>iL});var iL={};$e(iL,{applyPatchFile:()=>qB,diffFolders:()=>aL,extractPackageToDisk:()=>oL,extractPatchFlags:()=>Eoe,isParentRequired:()=>sL,loadPatchFiles:()=>Rd,makeDescriptor:()=>mWe,makeLocator:()=>nL,parseDescriptor:()=>vd,parseLocator:()=>Fd,parsePatchFile:()=>HB});var kd=class extends Error{constructor(e,r){super(`Cannotapplyhunk#${e+1}`);this.hunk=r}};var oWe=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function eg(t){return B.relative(Ee.root,B.resolve(Ee.root,L.toPortablePath(t)))}function aWe(t){let e=t.trim().match(oWe);if(!e)throw new Error(`Badheaderline:'${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 AWe=420,lWe=493,ar;(function(i){i.Context="context",i.Insertion="insertion",i.Deletion="deletion"})(ar||(ar={}));var hoe=()=>({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}),cWe=t=>({header:aWe(t),parts:[]}),uWe={["@"]:"header",["-"]:ar.Deletion,["+"]:ar.Insertion,[" "]:ar.Context,["\\"]:"pragma",undefined:ar.Context};function hWe(t){let e=[],r=hoe(),i="parsing header",n=null,s=null;function o(){n&&(s&&(n.parts.push(s),s=null),r.hunks.push(n),n=null)}function a(){o(),e.push(r),r=hoe()}for(let l=0;l<t.length;l++){let c=t[l];if(i==="parsing header")if(c.startsWith("@@"))i="parsing hunks",r.hunks=[],l-=1;else if(c.startsWith("diff --git ")){r&&r.diffLineFromPath&&
`)+(n.hunk.parts[0].noNewlineAtEndOfFile?"":`
`):"";await e.mkdirpPromise(B.dirname(n.path),{chmod:493,utimes:[YB,YB]}),await e.writeFilePromise(n.path,s,{mode:n.mode}),await e.utimesPromise(n.path,YB,YB)}break;case"patch":await tg(e,n.path,async()=>{await pWe(n,{baseFs:e,dryRun:r})});break;case"mode change":{let o=(await e.statPromise(n.path)).mode;if(foe(n.newMode)!==foe(o))continue;await tg(e,n.path,async()=>{await e.chmodPromise(n.path,n.newMode)})}break;default:de.assertNever(n);break}}function foe(t){return(t&64)>0}function poe(t){return t.replace(/\s+$/,"")}function dWe(t,e){return poe(t)===poe(e)}async function pWe({hunks:t,path:e},{baseFs:r,dryRun:i=!1}){let n=await r.statSync(e).mode,o=(await r.readFileSync(e,"utf8")).split(/\n/),a=[],l=0,c=0;for(let g of t){let h=Math.max(c,g.header.patched.start+l),f=Math.max(0,h-c),p=Math.max(0,o.length-h-g.header.original.length),m=Math.max(f,p),I=0,y=0,b=null;for(;I<=m;){if(I<=f&&(y=h-I,b=doe(g,o,y),b!==null)){I=-I;break}if(I<=p&&(y=h+I,b=doe(g,o,y),b!==null))break;I+=1}if(b===null)throw new kd(t.indexOf(g),g);a.push(b),l+=I,c=y+g.header.original.length}if(i)return;let u=0;for(let g of a)for(let h of g)switch(h.type){case"splice":{let f=h.index+u;o.splice(f,h.numToDelete,...h.linesToInsert),u+=h.linesToInsert.length-h.numToDelete}break;case"pop":o.pop();break;case"push":o.push(h.line);break;default:de.assertNever(h);break}await r.writeFilePromise(e,o.join(`
`),{mode:n})}function doe(t,e,r){let i=[];for(let n of t.parts)switch(n.type){case ar.Context:case ar.Deletion:{for(let s of n.lines){let o=e[r];if(o==null||!dWe(o,s))return null;r+=1}n.type===ar.Deletion&&(i.push({type:"splice",index:r-n.lines.length,numToDelete:n.lines.length,linesToInsert:[]}),n.noNewlineAtEndOfFile&&i.push({type:"push",line:""}))}break;case ar.Insertion:i.push({type:"splice",index:r,numToDelete:0,linesToInsert:n.lines}),n.noNewlineAtEndOfFile&&i.push({type:"pop"});break;default:de.assertNever(n.type);break}return i}var CWe=/^builtin<([^>]+)>$/;function Coe(t,e){let{source:r,selector:i,params:n}=w.parseRange(t);if(r===null)throw new Error("Patch locators must explicitly define their source");let s=i?i.split(/&/).map(c=>L.toPortablePath(c)):[],o=n&&typeof n.locator=="string"?w.parseLocator(n.locator):null,a=n&&typeof n.version=="string"?n.version:null,l=e(r);return{parentLocator:o,sourceItem:l,patchPaths:s,sourceVersion:a}}function vd(t){let i=Coe(t.range,w.parseDescriptor),{sourceItem:e}=i,r=vr(i,["sourceItem"]);return V(P({},r),{sourceDescriptor:e})}function Fd(t){let i=Coe(t.reference,w.parseLocator),{sourceItem:e}=i,r=vr(i,["sourceItem"]);return V(P({},r),{sourceLocator:e})}function moe({parentLocator:t,sourceItem:e,patchPaths:r,sourceVersion:i,patchHash:n},s){let o=t!==null?{locator:w.stringifyLocator(t)}:{},a=typeof i!="undefined"?{version:i}:{},l=typeof n!="undefined"?{hash:n}:{};return w.makeRange({protocol:"patch:",source:s(e),selector:r.join("&"),params:P(P(P({},a),l),o)})}function mWe(t,{parentLocator:e,sourceDescriptor:r,patchPaths:i}){return w.makeLocator(t,moe({parentLocator:e,sourceItem:r,patchPaths:i},w.stringifyDescriptor))}function nL(t,{parentLocator:e,sourcePackage:r,patchPaths:i,patchHash:n}){return w.makeLocator(t,moe({parentLocator:e,sourceItem:r,sourceVersion:r.version,patchPaths:i,patchHash:n},w.stringifyLocator))}function Ioe({onAbsolute:t,onRelative:e,onBuiltin:r},i){i.startsWith("~")&&(i=i.slice(1));let s=i.match(CWe);return s!==null?r(s[1]):B.isAbsolute(i)?t(i):e(i)}function Eoe(t){let e=t.startsWith("~");return e&&(t=t.slice(1)),{optional:e}}function sL(t){return Ioe({onAbsolute:()=>!1,onRelative:()=>!0,onBuiltin:()=>!1},t)}async function Rd(t,e,r){let i=t!==null?await r.fetcher.fetch(t,r):null,n=i&&i.localPath?{packageFs:new yt(Ee.root),prefixPath:B.relative(Ee.root,i.localPath)}:i;i&&i!==n&&i.releaseFs&&i.releaseFs();let s=await de.releaseAfterUseAsync(async()=>await Promise.all(e.map(async o=>{let a=Eoe(o),l=await Ioe({onAbsolute:async()=>await M.readFilePromise(o,"utf8"),onRelative:async()=>{if(n===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await n.packageFs.readFilePromise(B.join(n.prefixPath,o),"utf8")},onBuiltin:async c=>await r.project.configuration.firstHook(u=>u.getBuiltinPatch,r.project,c)},o);return V(P({},a),{source:l})})));for(let o of s)typeof o.source=="string"&&(o.source=o.source.replace(/\r\n?/g,`
`));return s}async function oL(t,{cache:e,project:r}){let i=r.storedPackages.get(t.locatorHash);if(typeof i=="undefined")throw new Error("Assertion failed: Expected the package to be registered");let n=r.storedChecksums,s=new Br,o=r.configuration.makeFetcher(),a=await o.fetch(t,{cache:e,project:r,fetcher:o,checksums:n,report:s}),l=await M.mktempPromise(),c=B.join(l,"source"),u=B.join(l,"user"),g=B.join(l,".yarn-patch.json");return await Promise.all([M.copyPromise(c,a.prefixPath,{baseFs:a.packageFs}),M.copyPromise(u,a.prefixPath,{baseFs:a.packageFs}),M.writeJsonPromise(g,{locator:w.stringifyLocator(t),version:i.version})]),M.detachTemp(l),u}async function aL(t,e){let r=L.fromPortablePath(t).replace(/\\/g,"/"),i=L.fromPortablePath(e).replace(/\\/g,"/"),{stdout:n,stderr:s}=await pr.execvp("git",["-c","core.safecrlf=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--text",r,i],{cwd:L.toPortablePath(process.cwd()),env:V(P({},process.env),{GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""})});if(s.length>0)throw new Error(`Unabletodiffdirectories.Makesureyouhavearecentversionof'git'availableinPATH.
Thefollowingerrorwasreportedby'git':
${s}`);let o=r.startsWith("/")?a=>a.slice(1):a=>a;return n.replace(new RegExp(`(a|b)(${de.escapeRegExp(`/${o(r)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${de.escapeRegExp(`/${o(i)}/`)}`,"g"),"$1/").replace(new RegExp(de.escapeRegExp(`${r}/`),"g"),"").replace(new RegExp(de.escapeRegExp(`${i}/`),"g"),"")}function yoe(t,{configuration:e,report:r}){for(let i of t.parts)for(let n of i.lines)switch(i.type){case ar.Context:r.reportInfo(null,`${ce.pretty(e,n,"grey")}`);break;case ar.Deletion:r.reportError(z.FROZEN_LOCKFILE_EXCEPTION,`-${ce.pretty(e,n,ce.Type.REMOVED)}`);break;case ar.Insertion:r.reportError(z.FROZEN_LOCKFILE_EXCEPTION,`+${ce.pretty(e,n,ce.Type.ADDED)}`);break;default:de.assertNever(i.type)}}var AL=class{supports(e,r){return!!e.reference.startsWith("patch:")}getLocalPath(e,r){return null}async fetch(e,r){let i=r.checksums.get(e.locatorHash)||null,[n,s,o]=await r.cache.fetchPackageFromCache(e,i,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${w.prettyLocator(r.project.configuration,e)}can'tbefoundinthecacheandwillbefetchedfromthedisk`),loader:()=>this.patchPackage(e,r),skipIntegrityCheck:r.skipIntegrityCheck});return{packageFs:n,releaseFs:s,prefixPath:w.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:o}}async patchPackage(e,r){let{parentLocator:i,sourceLocator:n,sourceVersion:s,patchPaths:o}=Fd(e),a=await Rd(i,o,r),l=await M.mktempPromise(),c=B.join(l,"current.zip"),u=await r.fetcher.fetch(n,r),g=w.getIdentVendorPath(e),h=await li(),f=new Qr(c,{libzip:h,create:!0,level:r.project.configuration.get("compressionLevel")});await f.mkdirpPromise(g),await de.releaseAfterUseAsync(async()=>{await f.copyPromise(g,u.prefixPath,{baseFs:u.packageFs,stableSort:!0})},u.releaseFs),f.saveAndClose();for(let{source:p,optional:m}of a){if(p===null)continue;let I=new Qr(c,{libzip:h,level:r.project.configuration.get("compressionLevel")}),y=new yt(B.resolve(Ee.root,g),{baseFs:I});try{await qB(HB(p),{baseFs:y,version:s})}catch(b){if(!(b instanceof kd))throw b;let x=r.project.configuration.get("enableInlineHunks"),F=!x&&!m?" (set enableInlineHunks for details)":"",N=`${w.prettyLocator(r.project.configuration,e)}:${b.message}${F}`,U=v=>{!x||yoe(b.hunk,{configuration:r.project.configuration,report:v})};if(I.discardAndClose(),m){r.report.reportWarningOnce(z.PATCH_HUNK_FAILED,N,{reportExtra:U});continue}else throw new Ze(z.PATCH_HUNK_FAILED,N,U)}I.saveAndClose()}return new Qr(c,{libzip:h,level:r.project.configuration.get("compressionLevel")})}};var IWe=2,lL=class{supportsDescriptor(e,r){return!!e.range.startsWith("patch:")}supportsLocator(e,r){return!!e.reference.startsWith("patch:")}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i){let{patchPaths:n}=vd(e);return n.every(s=>!sL(s))?e:w.bindDescriptor(e,{locator:w.stringifyLocator(r)})}getResolutionDependencies(e,r){let{sourceDescriptor:i}=vd(e);return[i]}async getCandidates(e,r,i){if(!i.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{parentLocator:n,sourceDescriptor:s,patchPaths:o}=vd(e),a=await Rd(n,o,i.fetchOptions),l=r.get(s.descriptorHash);if(typeof l=="undefined")throw new Error("Assertion failed: The dependency should have been resolved");let c=wi.makeHash(`${IWe}`,...a.map(u=>JSON.stringify(u))).slice(0,6);return[nL(e,{parentLocator:n,sourcePackage:l,patchPaths:o,patchHash:c})]}async getSatisfying(e,r,i){return null}async resolve(e,r){let{sourceLocator:i}=Fd(e),n=await r.resolver.resolve(i,r);return P(P({},n),e)}};var Ld=class extends Be{constructor(){super(...arguments);this.save=j.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=j.String()}async execute(){let e=await Ae.find(this.context.cwd,this.context.plugins),{project:r,workspace:i}=await Fe.find(e,this.context.cwd);if(!i)throw new Xe(r.cwd,this.context.cwd);await r.restoreInstallState();let n=B.resolve(this.context.cwd,L.toPortablePath(this.patchFolder)),s=B.join(n,"../source"),o=B.join(n,"../.yarn-patch.json");if(!M.existsSync(s))throw new
${o.map(a=>`
-${w.prettyLocator(e,a)}`).join("")}`);s=o[0]}if(!r.storedPackages.has(s.locatorHash))thrownewme("No package found in the project for the given locator");awaitSe.start({configuration:e,json:this.json,stdout:this.context.stdout},asynco=>{leta=awaitoL(s,{cache:n,project:r});o.reportJson({locator:w.stringifyLocator(s),path:L.fromPortablePath(a)}),o.reportInfo(z.UNNAMED,`Package ${w.prettyLocator(e,s)} got extracted with success!`),o.reportInfo(z.UNNAMED,`You can now edit the following folder: ${ce.pretty(e,L.fromPortablePath(a),"magenta")}`),o.reportInfo(z.UNNAMED,`Once you are done run ${ce.pretty(e,`yarn patch-commit ${process.platform==="win32"?'"':""}${L.fromPortablePath(a)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};Nd.paths=[["patch"]],Nd.usage=fe.Usage({description:"prepare a package for patching",details:'\n This command will cause a package to be extracted in a temporary directory (under a folder named "patch-workdir"). This folder will be editable at will; running `yarn patch` inside it will then cause Yarn to generate a patchfile and register it into your top-level manifest (cf the `patch:` protocol).\n '});varwoe=Nd;varEWe={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:ge.BOOLEAN,default:!1},patchFolder:{description:"Folder where the patch files must be written",type:ge.ABSOLUTE_PATH,default:"./.yarn/patches"}},commands:[Boe,woe],fetchers:[AL],resolvers:[lL]},yWe=EWe;varjy=()=>({modules:newMap([["@yarnpkg/cli",sp],["@yarnpkg/core",Mf],["@yarnpkg/fslib",Pg],["@yarnpkg/libzip",Mh],["@yarnpkg/parsers",Gh],["@yarnpkg/shell",Jh],["clipanion",A6(Hg)],["semver",BWe],["typanion",Hl],["yup",wWe],["@yarnpkg/plugin-essentials",kv],["@yarnpkg/plugin-compat",Lv],["@yarnpkg/plugin-dlx",Nv],["@yarnpkg/plugin-file",Gv],["@yarnpkg/plugin-git",tF],["@yarnpkg/plugin-github",iF],["@yarnpkg/plugin-http",oF],["@yarnpkg/plugin-init",cF],["@yarnpkg/plugin-link",pF],["@yarnpkg/plugin-node-modules",zF],["@yarnpkg/plugin-npm",ZR],["@yarnpkg/plugin-npm-cli",rL],["@yarnpkg/plugin-pack",WR],["@yarnpkg/plugin-patch",cL],["@yarnpkg/plugin-pnp",MF]]),plugins:newSet(["@yarnpkg/plugin-essentials","@yarnpkg/plugin-compat","@yarnpkg/plugin-dlx","@yarnpkg/plugin-file","@yarnpkg/plugin-git","@yarnpkg/plugin-github","@yarnpkg/plugin-http","@yarnpkg/plugin-init","@yarnpkg/plugin-link","@yarnpkg/plugin-node-modules","@yarnpkg/plugin-npm","@yarnpkg/plugin-npm-cli","@yarnpkg/plugin-pack","@yarnpkg/plugin-patch","@yarnpkg/plugin-pnp"])});fy({binaryVersion:Yi||"<unknown>",pluginConfiguration:jy()});})();